1import{b1 as P,b0 as $,aO as p,aP as s,aX as g,aQ as m,aT as f,aU as h,aV as v,aR as b,bT as E,a_ as L,bo as c,aZ as B,a$ as k,bz as A,ch as M,bE as T,aY as w,aW as S}from"./v7.12-VpakeqIi.js";import{d as D}from"./v7.12-BArc2E63.js";import{v as Y}from"./v7.12-BzjUzmp5.js";function O(){document.documentElement.classList.add("no-scroll")}function R(){document.documentElement.classList.remove("no-scroll")}const F=P({name:"Shutter",inheritAttrs:!1,props:{title:{type:String,default:""},active:{type:Boolean,default:!1},hideBreakpoint:{type:String,default:"tablet",validator:e=>["tablet","big-tablet","desktop","desktop-wide"].includes(e)}},emits:["close"],data:()=>({startY:0,isDragging:!1,transform:"",transition:""}),watch:{async active(e){var t;this.transition="",this.startY=0,this.isDragging=!1,e?(this.transform="",((t=this.$refs.shutter)==null?void 0:t.offsetParent)!==null&&O()):R()}},methods:{close(){this.$nextTick(()=>{this.$emit("close")})},handlePointerDown({clientY:e,isPrimary:t}){t&&(this.isDragging=!0,this.startY=e,this.transition="transform 25ms linear")},handlePointerMove({clientY:e,isPrimary:t}){if(!t||!this.isDragging)return;const n=Math.max(e-this.startY,0);this.transform=`translateY(${n}px)`},handlePointerUp({clientY:e,isPrimary:t}){if(!t||!this.isDragging)return;const n=Math.max(e-this.startY,0);this.startY=0,this.isDragging=!1,n>100?this.close():(this.transform="",this.transition="transform .2s ease-in-out")}}},"$L-75liQeMO"),z=["innerHTML"];function N(e,t,n,i,r,a){return s(),p(k,{to:"#teleports"},[g("div",B({ref:"shutter",class:["shutter",e.hideBreakpoint]},e.$attrs,{onPointermovePassive:t[2]||(t[2]=(...o)=>e.handlePointerMove&&e.handlePointerMove(...o)),onPointerupPassive:t[3]||(t[3]=(...o)=>e.handlePointerUp&&e.handlePointerUp(...o)),onPointercancelPassive:t[4]||(t[4]=(...o)=>e.handlePointerUp&&e.handlePointerUp(...o))}),[m(b,{name:"shutter-fade"},{default:f(()=>[e.active?(s(),h("div",{key:0,class:"shutter__overlay",onClick:t[0]||(t[0]=(...o)=>e.close&&e.close(...o))})):v("",!0)]),_:1}),m(b,{name:"shutter-slide"},{default:f(()=>[e.active?(s(),h("div",{key:0,class:"shutter__panel",style:E({transform:e.transform,transition:e.transition})},[g("div",{class:"shutter__dragger",onPointerdownPassive:t[1]||(t[1]=(...o)=>e.handlePointerDown&&e.handlePointerDown(...o))},null,32),e.title?(s(),h("div",{key:0,class:"shutter__title",innerHTML:e.title},null,8,z)):v("",!0),g("div",{class:"shutter__content",onClick:L(()=>{},["stop"])},[c(e.$slots,"default",{},void 0,!0)])],4)):v("",!0)]),_:3})],16)])}const U=$(F,[["render",N],["__scopeId","data-v-e3bc64f5"]]),X=P({name:"TransitionAnimation",props:{name:{type:String,default:"lh-fade"},mode:{type:String,default:"out-in"},duration:{type:Number,default:300},beforeEnter:{type:Function,default:null},beforeLeave:{type:Function,default:null},beforeAppear:{type:Function,default:null},enter:{type:Function,default:null},leave:{type:Function,default:null},appear:{type:Function,default:null},afterEnter:{type:Function,default:null},afterLeave:{type:Function,default:null},afterAppear:{type:Function,default:null},enterCancelled:{type:Function,default:null},leaveCancelled:{type:Function,default:null},appearCancelled:{type:Function,default:null}},methods:{onBeforeEnter(){typeof this.beforeEnter=="function"&&this.beforeEnter()},onBeforeLeave(){typeof this.beforeLeave=="function"&&this.beforeLeave()},onBeforeAppear(){typeof this.beforeAppear=="function"&&this.beforeAppear()},onEnter(){typeof this.enter=="function"&&this.enter()},onLeave(){typeof this.leave=="function"&&this.leave()},onAppear(){typeof this.appear=="function"&&this.appear()},onAfterEnter(){typeof this.afterEnter=="function"&&this.afterEnter()},onAfterLeave(){typeof this.afterLeave=="function"&&this.afterLeave()},onAfterAppear(){typeof this.afterAppear=="function"&&this.afterAppear()},onEnterCancelled(){typeof this.enterCancelled=="function"&&this.enterCancelled()},onLeaveCancelled(){typeof this.leaveCancelled=="function"&&this.leaveCancelled()},onAppearCancelled(){typeof this.appearCancelled=="function"&&this.appearCancelled()}}},"$vMfkwCrWVJ");function V(e,t,n,i,r,a){return s(),p(b,{name:e.name,mode:e.mode,duration:e.duration,onBeforeEnter:e.onBeforeEnter,onBeforeLeave:e.onBeforeLeave,onBeforeAppear:e.onBeforeAppear,onEnter:e.onEnter,onLeave:e.onLeave,onAppear:e.onAppear,onAfterEnter:e.onAfterEnter,onAfterLeave:e.onAfterLeave,onAfterAppear:e.onAfterAppear,onEnterCancelled:e.onEnterCancelled,onLeaveCancelled:e.onLeaveCancelled,onAppearCancelled:e.onAppearCancelled},{default:f(()=>
1[c(e.$slots,"default")]),_:3},8,["name","mode","duration","onBeforeEnter","onBeforeLeave","onBeforeAppear","onEnter","onLeave","onAppear","onAfterEnter","onAfterLeave","onAfterAppear","onEnterCancelled","onLeaveCancelled","onAppearCancelled"])}const H=$(X,[["render",V]]),C=(e=!0)=>typeof window<"u"?window.innerWidth<768:e,W=P({name:"ContextMenu",directives:{clickOutside:Y},components:{Shutter:U,TransitionAnimation:H},props:{type:{type:String,default:"click",validator:e=>["click","hover"].includes(e)},active:{type:Boolean,required:!0},offsetX:{type:Number,default:0},offsetY:{type:Number,default:0},hoverDelay:{type:Number,default:100},forcePopupPosition:{type:String,default:void 0,validator:e=>["top-left","top-right","bottom-left","bottom-right"].includes(e)},tag:{type:String,default:"div"},handlerClass:{type:[String,Object,Array],default:null}},emits:["close","update:active"],data(){return{position:void 0,x:void 0,y:void 0,hoverTimer:void 0,resizeUnsubscribe:()=>{},resizeObserver:void 0}},computed:{popupPosition(){return{top:`${this.y}px`,left:`${this.x}px`}}},watch:{async active(e){var t,n;(t=this.resizeObserver)==null||t.disconnect(),e&&(await this.$nextTick(),this.resizeObserver=new ResizeObserver(i=>{i.forEach(r=>{this.updatePosition()})}),(n=this.resizeObserver)==null||n.observe(this.$refs.content),this.updatePosition())}},mounted(){D(window,"resize",()=>{!C()&&this.close()})},unmounted(){this.resizeUnsubscribe()},methods:{updatePosition(){const e=this.forcePopupPosition||this.getBestPosition(),{x:t,y:n}=this.getMenuCoords(e);this.x=t,this.y=n},mouseEnter(){this.type!=="hover"||C()||(this.active||this.$emit("update:active",!0),this.hoverTimer&&window.clearTimeout(this.hoverTimer))},mouseLeave(){this.type!=="hover"||C()||(this.hoverTimer=window.setTimeout(()=>{this.close()},this.hoverDelay))},clickOutside(e){e.target.closest("#teleports")||this.close()},handlerClick(){this.$emit("update:active",!0)},getBestPosition(){const e=this.$refs.handler,t=this.$refs.content;if(!e||!t)throw new Error("Some refs are empty");const n=e.getBoundingClientRect(),{width:i,height:r}=t.getBoundingClientRect(),a=Math.round(r),o=n.left+this.offsetX+n.width,u=window.innerWidth-n.left-this.offsetX,d=n.top-this.offsetY,l=Math.round(window.innerHeight-this.offsetY-n.bottom),y=u<i&&o>i?"right":"left";return`${l<=a&&d>a?"top":"bottom"}-${y}`},getMenuCoords(e){const t=this.$refs.handler,n=this.$refs.content;if(!t||!n)throw new Error("Some refs are empty");const i=t.getBoundingClientRect(),r=n.getBoundingClientRect(),a=e.includes("left"),o=e.includes("top"),{scrollLeft:u=0,scrollTop:d=0}=document.scrollingElement||{},l=a?i.left+this.offsetX+u:i.right-r.width-this.offsetX+u,y=o?i.top-r.height-this.offsetY+d:i.bottom+this.offsetY+d;return{x:l,y}},close(){this.active&&this.$emit("update:active",!1)}}},"$wwJ_wDOP9Q");function Q(e,t,n,i,r,a){const o=A("TransitionAnimation"),u=A("Shutter"),d=M("click-outside");return T((s(),p(w(e.tag),{class:"context-menu"},{default:f(()=>[(s(),p(w(e.tag),{ref:"handler",class:S(["context-menu__handler",e.handlerClass]),onClick:e.handlerClick,onMouseenterPassive:e.mouseEnter,onMouseleavePassive:e.mouseLeave},{default:f(()=>[c(e.$slots,"default",{},void 0,!0)]),_:3},40,["class","onClick","onMouseenterPassive","onMouseleavePassive"])),(s(),p(k,{to:"#teleports"},[m(o,null,{default:f(()=>[e.active?(s(),h("div",{key:0,ref:"content",class:"context-menu__popup",style:E(e.popupPosition),onClick:t[0]||(t[0]=L(()=>{},["stop"])),onMouseenterPassive:t[1]||(t[1]=(...l)=>e.mouseEnter&&e.mouseEnter(...l)),onMouseleavePassive:t[2]||(t[2]=(...l)=>e.mouseLeave&&e.mouseLeave(...l))},[c(e.$slots,"context",{},void 0,!0)],36)):v("",!0)]),_:3})])),m(u,{active:e.active,"hide-breakpoint":"tablet",onClose:e.close},{default:f(()=>[c(e.$slots,"mobile",{},void 0,!0)]),_:3},8,["active","onClose"])]),_:3})),[[d,e.clickOutside]])}const Z=$(W,[["render",Q],["__scopeId","data-v-0ff35abe"]]);export{Z as C}; 2//# sourceMappingURL=v7.12-CBjiEQEi.js.map
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.