PageSourceSearch

https://umushroom.com/assets/vue-carousel-card-Bm1sdfnh.js

js umushroom.com collected 2026-10-07 04:48:01 UTC 16,447 bytes, 1 lines download raw bytes

1import{n as z,U as y,h as g,b as F,au as G,av as j,ax as T,aq as W,i as B,a0 as Z,F as ie,$ as se,aa as le,q as ee,as as D,P as te,G as ue,M as ce,W as de,_ as m,e as L,x as he,R as ve,s as fe}from"./@vue-D0zp4N_6.js";var pe=Object.defineProperty,me=Object.prototype.hasOwnProperty,X=Object.getOwnPropertySymbols,_e=Object.prototype.propertyIsEnumerable,Y=(e,t,n)=>t in e?pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,U=(e,t)=>{for(var n in t||(t={}))me.call(t,n)&&Y(e,n,t[n]);if(X)for(var n of X(t))_e.call(t,n)&&Y(e,n,t[n]);return e},be=function(e,t,n,r){var o,s=0;return typeof t!="boolean"&&(r=n,n=t,t=void 0),function(){var i=this,u=Number(new Date)-s,c=arguments;function l(){s=Number(new Date),n.apply(i,c)}function b(){o=void 0}r&&!o&&l(),o&&clearTimeout(o),r===void 0&&u>e?l():t!==!0&&(o=setTimeout(r?b:l,r===void 0?e-u:e))}},J=be,ne=(function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some((function(o,s){return o[0]===n&&(r=s,!0)})),r}return(function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,s=this.__entries__;o<s.length;o++){var i=s[o];n.call(r,i[1],i[0])}},t})()})(),P=typeof window<"u"&&typeof document<"u"&&window.document===document,H=typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")(),ye=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(H):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)},ge=["top","right","bottom","left","width","height","size","weight"],we=typeof MutationObserver<"u",Ee=(function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=(function(t,n){var r=!1,o=!1,s=0;function i(){r&&(r=!1,t()),o&&c()}function u(){ye(i)}function c(){var l=Date.now();if(r){if(l-s<2)return;o=!0}else r=!0,o=!1,setTimeout(u,n);s=l}return c})(this.refresh.bind(this),20)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter((function(n){return n.gatherActive(),n.hasActive()}));return t.forEach((function(n){return n.broadcastActive()})),t.length>0},e.prototype.connect_=function(){P&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),we?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){P&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n;ge.some((function(o){return!!~r.indexOf(o)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=ne
1w e),this.instance_},e.instance_=null,e})(),K=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},A=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||H},re=N(0,0,0,0);function R(e){return parseFloat(e)||0}function Q(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(r,o){return r+R(e["border-"+o+"-width"])}),0)}function Oe(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return re;var r=A(e).getComputedStyle(e),o=(function(w){for(var x={},d=0,v=["top","right","bottom","left"];d<v.length;d++){var E=v[d],O=w["padding-"+E];x[E]=R(O)}return x})(r),s=o.left+o.right,i=o.top+o.bottom,u=R(r.width),c=R(r.height);if(r.boxSizing==="border-box"&&(Math.round(u+s)!==t&&(u-=Q(r,"left","right")+s),Math.round(c+i)!==n&&(c-=Q(r,"top","bottom")+i)),!(function(w){return w===A(w).document.documentElement})(e)){var l=Math.round(u+s)-t,b=Math.round(c+i)-n;Math.abs(l)!==1&&(u-=l),Math.abs(b)!==1&&(c-=b)}return N(o.left,o.top,u,c)}var Ce=typeof SVGGraphicsElement<"u"?function(e){return e instanceof A(e).SVGGraphicsElement}:function(e){return e instanceof A(e).SVGElement&&typeof e.getBBox=="function"};function Me(e){return P?Ce(e)?(function(t){var n=t.getBBox();return N(0,0,n.width,n.height)})(e):Oe(e):re}function N(e,t,n,r){return{x:e,y:t,width:n,height:r}}var xe=(function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=N(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=Me(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e})(),Ie=function(e,t){var n,r,o,s,i,u,c,l=(r=(n=t).x,o=n.y,s=n.width,i=n.height,u=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,c=Object.create(u.prototype),K(c,{x:r,y:o,width:s,height:i,top:o,right:r+s,bottom:i+o,left:r}),c);K(this,{target:e,contentRect:l})},ke=(function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new ne,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(t instanceof A(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new xe(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(t instanceof A(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach((function(n){n.isActive()&&t.activeObservations_.push(n)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map((function(r){return new Ie(r.target,r.broadcastRect())}));this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e})(),ae=typeof WeakMap<"u"?new WeakMap:new ne,oe=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Ee.getInstance(),r=new ke(t,n,this);ae.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){oe.prototype[e]=function(){var t;return(t=ae.get(this))[e].apply(t,arguments)}}));var Se=H.ResizeObserver!==void 0?H.ResizeObserver:oe;const ze=typeof window>"u",Le=e=>{for(const t of e){const n=t.target.__resizeListeners__||[];
1n.length&&n.forEach((r=>r()))}};var S=ee({name:"CarouselCard",props:{initialIndex:{type:Number,default:0},height:{type:String,default:"200"},trigger:{type:String,default:"hover"},autoplay:{type:Boolean,default:!0},interval:{type:Number,default:3e3},indicatorPosition:{type:String,default:"",validator:e=>["outside","none",""].includes(e)},indicator:{type:Boolean,default:!0},arrow:{type:String,default:"hover"},type:{type:String,default:""},loop:{type:Boolean,default:!0},direction:{type:String,default:"horizontal",validator:e=>["horizontal","vertical"].includes(e)},pauseOnHover:{type:Boolean,default:!0}},emits:["change"],setup(e,{emit:t}){const n=m(null),r=m(0),o=m(0),s=m([]),i=m(-1),u=m(null),c=m(!1),l=L((()=>s.value.some((a=>a.label.toString().length>0)))),b=L((()=>e.arrow!=="never"&&e.direction!=="vertical")),w=L((()=>["carousel-card",`carousel-card-${e.direction}`])),x=L((()=>{const a=["carousel-card-indicators",`carousel-card-indicators-${e.direction}`];return l.value&&a.push("carousel-card-indicators-labels"),e.direction==="vertical"||e.indicatorPosition!=="outside"&&e.type!=="card"||a.push("carousel-card-indicators-outside"),a}));D(s,(a=>{a.length>0&&d(e.initialIndex)})),D(i,((a,h)=>{v(h),h>-1&&t("change",a,h)})),D((()=>e.autoplay),(a=>{a?O():E()})),D((()=>e.loop),(()=>{d(i.value)}));const d=a=>{if(typeof a=="string"){const I=s.value.filter((M=>M.name===a));I.length>0&&(a=s.value.indexOf(I[0]))}if(a=Number(a),isNaN(a)||a!==Math.floor(a))return void console.warn("[Vue-Carousel-Card Warn][Carousel-card] index must be an integer.");const h=s.value.length,C=i.value;i.value=a<0?e.loop?h-1:0:a>=h?e.loop?0:h-1:a,C===i.value&&v(C)},v=a=>{s.value.forEach(((h,C)=>{h.translateItem(C,i.value,a)}))},E=()=>{u.value&&clearInterval(u.value)},O=()=>{e.interval<=0||!e.autoplay||(u.value=setInterval($,e.interval))},$=()=>{i.value<s.value.length-1?i.value++:e.loop&&(i.value=0)},p=J(300,!0,(a=>{d(a)})),_=J(300,!0,(a=>{V(a)})),f=()=>{d(i.value+1)},V=a=>{e.trigger==="hover"&&a!==i.value&&(i.value=a)};return te((()=>{ue((()=>{var a,h;n.value&&(a=n.value,h=v,ze||(a.__resizeListeners__||(a.__resizeListeners__=[],a.__ro__=new Se(Le),a.__ro__.observe(a)),a.__resizeListeners__.push(h)),r.value=n.value.offsetWidth,o.value=n.value.offsetHeight),e.initialIndex<s.value.length&&e.initialIndex>=0&&(i.value=e.initialIndex),O()}))})),ce((()=>{var a,h;n.value&&(a=n.value,h=v,a&&a.__resizeListeners__&&(a.__resizeListeners__.splice(a.__resizeListeners__.indexOf(h),1),a.__resizeListeners__.length||a.__ro__.disconnect()))})),de("injectCarouselCardScope",{offsetWidth:r,offsetHeight:o,type:e.type,items:s,direction:e.direction,loop:e.loop,addItem:a=>{s.value.push(a)},removeItem:a=>{const h=s.value.findIndex((C=>C.uid===a));h!==-1&&(s.value.splice(h,1),i.value===h&&f())},setActiveItem:d}),{rootRef:n,items:s,activeIndex:i,hover:c,hasLabel:l,arrowDisplay:b,carouselCardClazz:w,indicatorsClazz:x,setActiveItem:d,handleMouseEnter:()=>{c.value=!0,e.pauseOnHover&&E()},handleMouseLeave:()=>{c.value=!1,O()},handleButtonEnter:a=>{e.direction!=="vertical"&&s.value.forEach(((h,C)=>{a===((I,M)=>{const q=s.value.length;return M===q-1&&I.inStage&&s.value[0].active||I.inStage&&s.value[M+1]&&s.value[M+1].active?"left":!!(M===0&&I.inStage&&s.value[q-1].active||I.inStage&&s.value[M-1]&&s.value[M-1].active)&&"right"})(h,C)&&(h.hover=!0)}))},handleButtonLeave:()=>{e.direction!=="vertical"&&s.value.forEach((a=>{a.hover=!1}))},prev:()=>{d(i.value-1)},next:f,handleIndicatorClick:a=>{i.value=a},handleIndicatorHover:V,throttledArrowClick:p,throttledIndicatorHover:_}}});const Ae=z("i",null,null,-1),Te=z("i",null,null,-1),Be={class:"carousel-card-button"};S.render=function(e,t,n,r,o,s){return y(),g("div",{ref:"rootRef",class:e.carouselCardClazz,onMouseenter:t[7]||(t[7]=T(((...i)=>e.handleMouseEnter&&e.handleMouseEnter(...i)),["stop"])),onMouseleave:t[8]||(t[8]=T(((...i)=>e.handleMouseLeave&&e.handleMouseLeave(...i)),["stop"]))},[z("div",{style:{height:e.height},class:"carousel-card-container"},[e.arrowDisplay?(y(),g(F,{key:0,name:"carousel-card-arrow-left"},{default:G((()=>[j(z("button",{type:"button",class:"carousel-card-arrow carousel-card-arrow-left",onMouseenter:t[1]||(t[1]=i=>e.handleButtonEnter("left")),onMouseleave:t[2]||(t[2]=(...i)=>e.handleButtonLeave&&e.handleButtonLeave(...i)),onClick:t[3]||(t[3]=T((i=>e.throttledArrowClick(e.activeIndex-1)),["stop"]))},[Ae],544),[[W,(e.arrow==="always"||e.hover)&&(e.loop||e.activeIndex>0)]])])),_:1})):B("",!0),e.arrowDisplay?(y(),g(F,{key:1,name:"carousel-card-arrow-right"},{default:G((()=>[j(z("button",{type:"button",class:"carousel-card-arrow carousel-card-arrow-right",onMouseenter:t[4]||(t[4]=i=>
1e.handleButtonEnter("right")),onMouseleave:t[5]||(t[5]=(...i)=>e.handleButtonLeave&&e.handleButtonLeave(...i)),onClick:t[6]||(t[6]=T((i=>e.throttledArrowClick(e.activeIndex+1)),["stop"]))},[Te],544),[[W,(e.arrow==="always"||e.hover)&&(e.loop||e.activeIndex<e.items.length-1)]])])),_:1})):B("",!0),Z(e.$slots,"default")],4),e.indicatorPosition!=="none"?(y(),g("ul",{key:0,class:e.indicatorsClazz},[(y(!0),g(ie,null,se(e.items,((i,u)=>(y(),g("li",{key:u,class:["carousel-card-indicator",`carousel-card-indicator-${e.direction}`,{"is-active":u===e.activeIndex}],onMouseenter:c=>e.throttledIndicatorHover(u),onClick:T((c=>e.handleIndicatorClick(u)),["stop"])},[z("button",Be,[e.hasLabel?(y(),g("span",{key:0,textContent:le(i.label)},null,8,["textContent"])):B("",!0)])],42,["onMouseenter","onClick"])))),128))],2)):B("",!0)],34)};var k=ee({name:"CarouselCardItem",props:{name:{type:String,default:""},label:{type:[String,Number],default:""}},setup(e){const t=fe(),n=m(!1),r=m(0),o=m(1),s=m(!1),i=m(!1),u=m(!1),c=m(!1),l=he("injectCarouselCardScope"),b=L((()=>l.direction)),w=L((()=>b.value==="vertical"?{msTransform:`translateY(${r.value}px) translateX(-50%) scale(${o.value})`,webkitTransform:`translateY(${r.value}px) translateX(-50%) scale(${o.value})`,transform:`translateY(${r.value}px) translateX(-50%) scale(${o.value})`,left:"50%"}:{msTransform:`translateX(${r.value}px) translateY(-50%) scale(${o.value})`,webkitTransform:`translateX(${r.value}px) translateY(-50%) scale(${o.value})`,transform:`translateX(${r.value}px) translateY(-50%) scale(${o.value})`,top:"50%"})),x=(d,v,E)=>{const O=l.items.value.length,$=l.type;$!=="card"&&E!==void 0&&(c.value=d===v||d===E),d!==v&&O>2&&(d=((p,_,f)=>_===0&&p===f-1?-1:_===f-1&&p===0?f:p<_-1&&_-p>=f/2?f+1:p>_+1&&p-_>=f/2?-2:p)(d,v,O)),$==="card"?(b.value==="vertical"&&console.warn("[Vue-Carousel-Card Warn][Carousel-card] vertical direction is not supported in card mode"),u.value=Math.round(Math.abs(d-v))<=1,s.value=d===v,r.value=((p,_)=>{const f=l.offsetWidth.value;return u.value?f*(1.17*(p-_)+1)/4:p<_?-1.83*f/4:3.83*f/4})(d,v),o.value=s.value?1:.83):(s.value=d===v,r.value=((p,_,f)=>l[f?"offsetHeight":"offsetWidth"].value*(p-_))(d,v,b.value==="vertical")),i.value=!0};return te((()=>{l.addItem&&t&&l.addItem(U(U({uid:t.uid},e),{hover:n,translate:r,scale:o,active:s,ready:i,inStage:u,animating:c,translateItem:x}))})),ve((()=>{l.removeItem&&t&&l.removeItem(t.uid)})),{type:l.type,ready:i,active:s,inStage:u,hover:n,animating:c,itemStyle:w,translateItem:x,handleItemClick:()=>{if(l&&l.type==="card"&&t){const d=l.items.value.map((v=>v.uid)).indexOf(t.uid);l.setActiveItem(d)}}}}});const $e={key:0,class:"carousel-card-mask"};k.render=function(e,t,n,r,o,s){return j((y(),g("div",{style:e.itemStyle,class:[{"is-active":e.active,"carousel-card-item-card":e.type==="card","is-in-stage":e.inStage,"is-hover":e.hover,"is-animating":e.animating},"carousel-card-item"],onClick:t[1]||(t[1]=(...i)=>e.handleItemClick&&e.handleItemClick(...i))},[e.type==="card"?j((y(),g("div",$e,null,512)),[[W,!e.active]]):B("",!0),Z(e.$slots,"default")],6)),[[W,e.ready]])},S.install=e=>{e.component(S.name,S)},k.install=e=>{e.component(k.name,k)};var Re={install:e=>{e.component(S.name,S),e.component(k.name,k)},CarouselCard:S,CarouselCardItem:k};export{Re as l};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.