PageSourceSearch

https://webassets.cafebazaar.ir/bundles/CmYUMnkU.js

js cafebazaar.ir collected 2026-09-24 15:17:00 UTC 5,004 bytes, 1 lines download raw bytes

1import{av as C,a0 as M,R as T,f as k,aw as P,_ as E,am as g,P as O,o as c,j as S,g as y,C as h,k as m,V as f,i as d,l as v,a4 as w,G as p,v as _,T as b,z,ax as B,I as x}from"./BcZZBfx9.js";try{let e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b842fed6-725f-4844-9ec0-714f310175cc",e._sentryDebugIdIdentifier="sentry-dbid-b842fed6-725f-4844-9ec0-714f310175cc")}catch{}const L=Symbol.for("nuxt:client-only"),I=C({name:"ClientOnly",inheritAttrs:!1,props:["fallback","placeholder","placeholderTag","fallbackTag"],setup(e,{slots:n,attrs:i}){const a=M(!1);return T(()=>{a.value=!0}),P(L,!0),t=>{var l;if(a.value)return(l=n.default)==null?void 0:l.call(n);const o=n.fallback||n.placeholder;if(o)return o();const s=t.fallback||t.placeholder||"",r=t.fallbackTag||t.placeholderTag||"span";return k(r,i,s)}}}),H={name:"Menu",components:{FocusTrap:g},props:{containerClass:{default:()=>[]},manual:{type:Boolean,default:!1},verticalPosition:{type:String,default:"bottom",validator:e=>["top","bottom","center"].includes(e)},horizontalPosition:{type:String,default:"center",validator:e=>["left","right","start","end","center"].includes(e)},teleportToBody:{type:Boolean,default:!1}},data(){return{isOpen:!1,floatingStyle:{}}},computed:{staticHorizontalPosition(){const e=(this._.provides[O]||this.$route).query.l==="en";return this.horizontalPosition.replace("start",e?"left":"right").replace("end",e?"right":"left")},containerComponent(){return this.manual?"div":g}},watch:{"$route.fullPath"(){this.close()}},beforeUnmount(){this.close()},methods:{handleClick(){this.manual||(this.isOpen?this.close():this.open())},open(e){this.openingEvent=e,globalThis.openedMenu!==this&&typeof globalThis.openedMenu=="object"&&globalThis.openedMenu!==null&&typeof globalThis.openedMenu.close=="function"&&globalThis.openedMenu.close(),globalThis.openedMenu=this,this.isOpen=!0,(!history.state||!history.state.search)&&(history.pushState({search:!0},""),this.$nextTick(()=>{window.addEventListener("popstate",this.close),window.addEventListener("keyup",this.windowKeyUpHandler)})),this.$nextTick(()=>{this.updateFloatingPosition(),window.addEventListener("click",this.handleWindowClick,!0),window.addEventListener("resize",this.updateFloatingPosition),window.addEventListener("scroll",this.updateFloatingPosition,!0)})},close(e){e&&e===this.openingEvent||(this.isOpen=!1,window.removeEventListener("click",this.handleWindowClick,!0),window.removeEventListener("popstate",this.close),window.removeEventListener("keyup",this.windowKeyUpHandler),window.removeEventListener("resize",this.updateFloatingPosition),window.removeEventListener("scroll",this.updateFloatingPosition,!0),history.back&&history.state&&history.state.search&&history.back())},getContainerElement(){const e=this.$refs.container;return(e==null?void 0:e.$el)||e||null},updateFloatingPosition(){if(!this.teleportToBody||!this.isOpen)return;const e=this.$refs.activator,n=this.getContainerElement();if(!e||!n)return;const i=8,a=8,t=e.getBoundingClientRect(),o=n.getBoundingClientRect(),s=o.width||200,r=o.height||0;let l=t.bottom+i;this.verticalPosition==="top"?l=t.top-r-i:this.verticalPosition==="center"&&(l=t.top+t.height/2-r/2);let u=t.left+t.width/2-s/2;this.staticHorizontalPosition==="left"?u=t.right-s:this.staticHorizontalPosition==="right"&&(u=t.left),this.floatingStyle={position:"fixed",top:`${Math.max(a,l)}px`,right:"auto",bottom:"auto",left:`${Math.min(Math.max(a,u),window.innerWidth-s-a)}px`,transform:"none"}},windowKeyUpHandler(e){e.keyCode===27&&this.close()},handleWindowClick(e){const n=this.getContainerElement();!this.$el.contains(e.target)&&(!n||!n.contains(e.target))&&(this.close(),e.preventDefault(),e.stopPropagation())}}};function D(e,n,i,a,t,o){return c(),k("div",{class:p(["Menu",[t.isOpen&&"Menu--open"]]),onClick:n[1]||(n[1]=x(()=>{},["stop"]))},[S("div",{ref:"activator",class:"Menu__activator",onClick:n[0]||(n[0]=(...s)=>o.handleClick&&o.handleClick(...s))},[f(e.$slots,"activator")],512),y(b,{name:"fade"},{default:d(()=>[i.teleportToBody?m("",!0):v((c(),h(w(o.containerComponent),{key:0,ref:"container",class:p(["Menu__container",[t.isOpen&&"Me
1nu__container--open",i.containerClass,`Menu__container--v-${i.verticalPosition}`,`Menu__container--h-${o.staticHorizontalPosition}`]])},{default:d(()=>[f(e.$slots,"default")]),_:3},8,["class"])),[[_,t.isOpen]])]),_:3}),i.teleportToBody?(c(),h(B,{key:0,to:"body"},[y(b,{name:"fade"},{default:d(()=>[v((c(),h(w(o.containerComponent),{ref:"container",class:p(["Menu__container Menu__container--teleported",[t.isOpen&&"Menu__container--open",i.containerClass,`Menu__container--v-${i.verticalPosition}`,`Menu__container--h-${o.staticHorizontalPosition}`]]),style:z(t.floatingStyle)},{default:d(()=>[f(e.$slots,"default")]),_:3},8,["class","style"])),[[_,t.isOpen]])]),_:3})])):m("",!0)],2)}const R=E(H,[["render",D]]);export{R as M,I as _};

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.