2 lines
23 KiB
JavaScript
2 lines
23 KiB
JavaScript
import{a9 as st,g as K,r as B,x as pe,u as we,e as Y,Y as Be,w as H,o as Fe,b as V,q as at,l as b,aa as ye,c as Ve,H as ut,$ as ct,h as X,ab as dt,a as P,C as ze,s as x,v as ft,a3 as mt,A as Ie,ac as be,ad as ht,n as I,ae as gt,af as vt}from"./index-BFHpqQMc.js";import{f as pt,g as oe,v as De,h as wt}from"./use-router-link-niyq3CDa.js";import{u as yt,a as bt}from"./QList-CPm2VhlR.js";import{g as xt,h as xe,d as Et}from"./QBtn-Bl8V3g1s.js";function Tt(){if(window.getSelection!==void 0){const e=window.getSelection();e.empty!==void 0?e.empty():e.removeAllRanges!==void 0&&(e.removeAllRanges(),st.is.mobile!==!0&&e.addRange(document.createRange()))}else document.selection!==void 0&&document.selection.empty()}const St={target:{type:[Boolean,String,Element],default:!0},noParentEvent:Boolean},qt={...St,contextMenu:Boolean};function Pt({showing:e,avoidEmit:t,configureAnchorEl:o}){const{props:n,proxy:i,emit:a}=K(),l=B(null);let r=null;function u(s){return l.value===null?!1:s===void 0||s.touches===void 0||s.touches.length<=1}const c={};o===void 0&&(Object.assign(c,{hide(s){i.hide(s)},toggle(s){i.toggle(s),s.qAnchorHandled=!0},toggleKey(s){Be(s,13)===!0&&c.toggle(s)},contextClick(s){i.hide(s),pe(s),Y(()=>{i.show(s),s.qAnchorHandled=!0})},prevent:pe,mobileTouch(s){if(c.mobileCleanup(s),u(s)!==!0)return;i.hide(s),l.value.classList.add("non-selectable");const m=s.target;we(c,"anchor",[[m,"touchmove","mobileCleanup","passive"],[m,"touchend","mobileCleanup","passive"],[m,"touchcancel","mobileCleanup","passive"],[l.value,"contextmenu","prevent","notPassive"]]),r=setTimeout(()=>{r=null,i.show(s),s.qAnchorHandled=!0},300)},mobileCleanup(s){l.value.classList.remove("non-selectable"),r!==null&&(clearTimeout(r),r=null),e.value===!0&&s!==void 0&&Tt()}}),o=function(s=n.contextMenu){if(n.noParentEvent===!0||l.value===null)return;let m;s===!0?i.$q.platform.is.mobile===!0?m=[[l.value,"touchstart","mobileTouch","passive"]]:m=[[l.value,"mousedown","hide","passive"],[l.value,"contextmenu","contextClick","notPassive"]]:m=[[l.value,"click","toggle","passive"],[l.value,"keyup","toggleKey","passive"]],we(c,"anchor",m)});function d(){at(c,"anchor")}function v(s){for(l.value=s;l.value.classList.contains("q-anchor--skip");)l.value=l.value.parentNode;o()}function p(){if(n.target===!1||n.target===""||i.$el.parentNode===null)l.value=null;else if(n.target===!0)v(i.$el.parentNode);else{let s=n.target;if(typeof n.target=="string")try{s=document.querySelector(n.target)}catch{s=void 0}s!=null?(l.value=s.$el||s,o()):(l.value=null,console.error(`Anchor: target "${n.target}" not found`))}}return H(()=>n.contextMenu,s=>{l.value!==null&&(d(),o(s))}),H(()=>n.target,()=>{l.value!==null&&d(),p()}),H(()=>n.noParentEvent,s=>{l.value!==null&&(s===!0?d():o())}),Fe(()=>{p(),t!==!0&&n.modelValue===!0&&l.value===null&&a("update:modelValue",!1)}),V(()=>{r!==null&&clearTimeout(r),d()}),{anchorEl:l,canShow:u,anchorEvents:c}}function Ht(e,t){const o=B(null);let n;function i(r,u){const c=`${u!==void 0?"add":"remove"}EventListener`,d=u!==void 0?u:n;r!==window&&r[c]("scroll",d,b.passive),window[c]("scroll",d,b.passive),n=u}function a(){o.value!==null&&(i(o.value),o.value=null)}const l=H(()=>e.noParentEvent,()=>{o.value!==null&&(a(),t())});return V(l),{localScrollTarget:o,unconfigureScrollTarget:a,changeScrollEvent:i}}const Ct={modelValue:{type:Boolean,default:null},"onUpdate:modelValue":[Function,Array]},Lt=["beforeShow","show","beforeHide","hide"];function _t({showing:e,canShow:t,hideOnRouteChange:o,handleShow:n,handleHide:i,processOnMount:a}){const l=K(),{props:r,emit:u,proxy:c}=l;let d;function v(h){e.value===!0?m(h):p(h)}function p(h){if(r.disable===!0||h?.qAnchorHandled===!0||t!==void 0&&t(h)!==!0)return;const g=r["onUpdate:modelValue"]!==void 0;g===!0&&(u("update:modelValue",!0),d=h,Y(()=>{d===h&&(d=void 0)})),(r.modelValue===null||g===!1)&&s(h)}function s(h){e.value!==!0&&(e.value=!0,u("beforeShow",h),n!==void 0?n(h):u("show",h))}function m(h){if(r.disable===!0)return;const g=r["onUpdate:modelValue"]!==void 0;g===!0&&(u("update:modelValue",!1),d=h,Y(()=>{d===h&&(d=void 0)})),(r.modelValue===null||g===!1)&&C(h)}function C(h){e.value!==!1&&(e.value=!1,u("beforeHide",h),i!==void 0?i(h):u("hide",h))}function T(h){r.disable===!0&&h===!0?r["onUpdate:modelValue"]!==void 0&&u("update:modelValue",!1):h===!0!==e.value&&(h===!0?s:C)(d)}H(()=>r.modelValue,T),o!==void 0&&pt(l)===!0&&H(()=>c.$route.fullPath,()=>{o.value===!0&&e.value===!0&&m()}),a===!0&&Fe(()=>{T(r.modelValue)});const L={show:p,hide:m,toggle:v};return Object.assign(c,L),L}let k=[],R=[];function Oe(e){R=R.filter(t=>t!==e)}function kt(e){Oe(e),R.push(e)}function Ee(e){Oe(e),R.length===0&&k.length!==0&&(k[k.length-1](),k=[])}function Mt(e){R.length===0?e():k.push(e)}function bo(e){k=k.filter(t=>t!==e)}let Wt=1,At=document.body;function $t(e,t){const o=document.createElement("div");if(o.id=t!==void 0?`q-portal--${t}--${Wt++}`:e,ye.globalNodes!==void 0){const n=ye.globalNodes.class;n!==void 0&&(o.className=n)}return At.appendChild(o),o}function Bt(e){e.remove()}const N=[];function Ft(e,t){do{if(e.$options.name==="QMenu"){if(e.hide(t),e.$props.separateClosePopup===!0)return oe(e)}else if(e.__qPortal===!0){const o=oe(e);return o?.$options.name==="QPopupProxy"?(e.hide(t),o):e}e=oe(e)}while(e!=null)}const Vt=Ve({name:"QPortal",setup(e,{slots:t}){return()=>t.default()}});function zt(e){for(e=e.parent;e!=null;){if(e.type.name==="QGlobalDialog")return!0;if(e.type.name==="QDialog"||e.type.name==="QMenu")return!1;e=e.parent}return!1}function It(e,t,o,n){const i=B(!1),a=B(!1);let l=null;const r={},u=n==="dialog"&&zt(e);function c(v){if(v===!0){Ee(r),a.value=!0;return}a.value=!1,i.value===!1&&(u===!1&&l===null&&(l=$t(!1,n)),i.value=!0,N.push(e.proxy),kt(r))}function d(v){if(a.value=!1,v!==!0)return;Ee(r),i.value=!1;const p=N.indexOf(e.proxy);p!==-1&&N.splice(p,1),l!==null&&(Bt(l),l=null)}return ut(()=>{d(!0)}),e.proxy.__qPortal=!0,ct(e.proxy,"contentEl",()=>t.value),{showPortal:c,hidePortal:d,portalIsActive:i,portalIsAccessible:a,renderPortal:()=>u===!0?o():i.value===!0?[X(dt,{to:l},X(Vt,o))]:void 0}}const Dt={transitionShow:{type:String,default:"fade"},transitionHide:{type:String,default:"fade"},transitionDuration:{type:[String,Number],default:300}};function Ot(e,t=()=>{},o=()=>{}){return{transitionProps:P(()=>{const n=`q-transition--${e.transitionShow||t()}`,i=`q-transition--${e.transitionHide||o()}`;return{appear:!0,enterFromClass:`${n}-enter-from`,enterActiveClass:`${n}-enter-active`,enterToClass:`${n}-enter-to`,leaveFromClass:`${i}-leave-from`,leaveActiveClass:`${i}-leave-active`,leaveToClass:`${i}-leave-to`}}),transitionStyle:P(()=>`--q-transition-duration: ${e.transitionDuration}ms`)}}function Nt(){let e;const t=K();function o(){e=void 0}return ze(o),V(o),{removeTick:o,registerTick(n){e=n,Y(()=>{e===n&&(De(t)===!1&&e(),e=void 0)})}}}function Rt(){let e=null;const t=K();function o(){e!==null&&(clearTimeout(e),e=null)}return ze(o),V(o),{removeTimeout:o,registerTimeout(n,i){o(),De(t)===!1&&(e=setTimeout(()=>{e=null,n()},i))}}}const Kt=[Element,String],jt=[null,document,document.body,document.scrollingElement,document.documentElement];function Qt(e,t){let o=xt(t);if(o===void 0){if(e==null)return window;o=e.closest(".scroll,.scroll-y,.overflow-auto")}return jt.includes(o)?window:o}function Ne(e){return e===window?window.pageYOffset||window.scrollY||document.body.scrollTop||0:e.scrollTop}function Re(e){return e===window?window.pageXOffset||window.scrollX||document.body.scrollLeft||0:e.scrollLeft}function Ke(e,t,o=0){const n=arguments[3]===void 0?performance.now():arguments[3],i=Ne(e);if(o<=0){i!==t&&se(e,t);return}requestAnimationFrame(a=>{const l=a-n,r=i+(t-i)/Math.max(l,o)*l;se(e,r),r!==t&&Ke(e,t,o-l,a)})}function je(e,t,o=0){const n=arguments[3]===void 0?performance.now():arguments[3],i=Re(e);if(o<=0){i!==t&&ae(e,t);return}requestAnimationFrame(a=>{const l=a-n,r=i+(t-i)/Math.max(l,o)*l;ae(e,r),r!==t&&je(e,t,o-l,a)})}function se(e,t){if(e===window){window.scrollTo(window.pageXOffset||window.scrollX||document.body.scrollLeft||0,t);return}e.scrollTop=t}function ae(e,t){if(e===window){window.scrollTo(t,window.pageYOffset||window.scrollY||document.body.scrollTop||0);return}e.scrollLeft=t}function xo(e,t,o){if(o){Ke(e,t,o);return}se(e,t)}function Eo(e,t,o){if(o){je(e,t,o);return}ae(e,t)}let j;function Yt(){if(j!==void 0)return j;const e=document.createElement("p"),t=document.createElement("div");xe(e,{width:"100%",height:"200px"}),xe(t,{position:"absolute",top:"0px",left:"0px",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),t.appendChild(e),document.body.appendChild(t);const o=e.offsetWidth;t.style.overflow="scroll";let n=e.offsetWidth;return o===n&&(n=t.clientWidth),t.remove(),j=o-n,j}function Xt(e,t=!0){return!e||e.nodeType!==Node.ELEMENT_NODE?!1:t?e.scrollHeight>e.clientHeight&&(e.classList.contains("scroll")||e.classList.contains("overflow-auto")||["auto","scroll"].includes(window.getComputedStyle(e)["overflow-y"])):e.scrollWidth>e.clientWidth&&(e.classList.contains("scroll")||e.classList.contains("overflow-auto")||["auto","scroll"].includes(window.getComputedStyle(e)["overflow-x"]))}const M=[];let F;function Gt(e){F=e.keyCode===27}function Ut(){F===!0&&(F=!1)}function Jt(e){F===!0&&(F=!1,Be(e,27)===!0&&M[M.length-1](e))}function Qe(e){window[e]("keydown",Gt),window[e]("blur",Ut),window[e]("keyup",Jt),F=!1}function Zt(e){x.is.desktop===!0&&(M.push(e),M.length===1&&Qe("addEventListener"))}function Te(e){const t=M.indexOf(e);t!==-1&&(M.splice(t,1),M.length===0&&Qe("removeEventListener"))}const W=[];function Ye(e){W[W.length-1](e)}function eo(e){x.is.desktop===!0&&(W.push(e),W.length===1&&document.body.addEventListener("focusin",Ye))}function to(e){const t=W.indexOf(e);t!==-1&&(W.splice(t,1),W.length===0&&document.body.removeEventListener("focusin",Ye))}const{notPassiveCapture:G}=b,A=[];function U(e){const t=e.target;if(t===void 0||t.nodeType===8||t.classList.contains("no-pointer-events")===!0)return;let o=N.length-1;for(;o>=0;){const n=N[o].$;if(n.type.name==="QTooltip"){o--;continue}if(n.type.name!=="QDialog")break;if(n.props.seamless!==!0)return;o--}for(let n=A.length-1;n>=0;n--){const i=A[n];if((i.anchorEl.value===null||i.anchorEl.value.contains(t)===!1)&&(t===document.body||i.innerRef.value!==null&&i.innerRef.value.contains(t)===!1))e.qClickOutside=!0,i.onClickOutside(e);else return}}function oo(e){A.push(e),A.length===1&&(document.addEventListener("mousedown",U,G),document.addEventListener("touchstart",U,G))}function Se(e){const t=A.findIndex(o=>o===e);t!==-1&&(A.splice(t,1),A.length===0&&(document.removeEventListener("mousedown",U,G),document.removeEventListener("touchstart",U,G)))}let qe,Pe;function He(e){const t=e.split(" ");return t.length!==2?!1:["top","center","bottom"].includes(t[0])!==!0?(console.error("Anchor/Self position must start with one of top/center/bottom"),!1):["left","middle","right","start","end"].includes(t[1])!==!0?(console.error("Anchor/Self position must end with one of left/middle/right/start/end"),!1):!0}function no(e){return e?!(e.length!==2||typeof e[0]!="number"||typeof e[1]!="number"):!0}const ue={"start#ltr":"left","start#rtl":"right","end#ltr":"right","end#rtl":"left"};["left","middle","right"].forEach(e=>{ue[`${e}#ltr`]=e,ue[`${e}#rtl`]=e});function Ce(e,t){const o=e.split(" ");return{vertical:o[0],horizontal:ue[`${o[1]}#${t===!0?"rtl":"ltr"}`]}}function lo(e,t){let{top:o,left:n,right:i,bottom:a,width:l,height:r}=e.getBoundingClientRect();return t!==void 0&&(o-=t[1],n-=t[0],a+=t[1],i+=t[0],l+=t[0],r+=t[1]),{top:o,bottom:a,height:r,left:n,right:i,width:l,middle:n+(i-n)/2,center:o+(a-o)/2}}function io(e,t,o){let{top:n,left:i}=e.getBoundingClientRect();return n+=t.top,i+=t.left,o!==void 0&&(n+=o[1],i+=o[0]),{top:n,bottom:n+1,height:1,left:i,right:i+1,width:1,middle:i,center:n}}function ro(e,t){return{top:0,center:t/2,bottom:t,left:0,middle:e/2,right:e}}function Le(e,t,o,n){return{top:e[o.vertical]-t[n.vertical],left:e[o.horizontal]-t[n.horizontal]}}function Xe(e,t=0){if(e.targetEl===null||e.anchorEl===null||t>5)return;if(e.targetEl.offsetHeight===0||e.targetEl.offsetWidth===0){setTimeout(()=>{Xe(e,t+1)},10);return}const{targetEl:o,offset:n,anchorEl:i,anchorOrigin:a,selfOrigin:l,absoluteOffset:r,fit:u,cover:c,maxHeight:d,maxWidth:v}=e;if(x.is.ios===!0&&window.visualViewport!==void 0){const $=document.body.style,{offsetLeft:y,offsetTop:E}=window.visualViewport;y!==qe&&($.setProperty("--q-pe-left",y+"px"),qe=y),E!==Pe&&($.setProperty("--q-pe-top",E+"px"),Pe=E)}const{scrollLeft:p,scrollTop:s}=o,m=r===void 0?lo(i,c===!0?[0,0]:n):io(i,r,n);Object.assign(o.style,{top:0,left:0,minWidth:null,minHeight:null,maxWidth:v,maxHeight:d,visibility:"visible"});const{offsetWidth:C,offsetHeight:T}=o,{elWidth:L,elHeight:h}=u===!0||c===!0?{elWidth:Math.max(m.width,C),elHeight:c===!0?Math.max(m.height,T):T}:{elWidth:C,elHeight:T};let g={maxWidth:v,maxHeight:d};(u===!0||c===!0)&&(g.minWidth=m.width+"px",c===!0&&(g.minHeight=m.height+"px")),Object.assign(o.style,g);const S=ro(L,h);let w=Le(m,S,a,l);if(r===void 0||n===void 0)ne(w,m,S,a,l);else{const{top:$,left:y}=w;ne(w,m,S,a,l);let E=!1;if(w.top!==$){E=!0;const q=2*n[1];m.center=m.top-=q,m.bottom-=q+2}if(w.left!==y){E=!0;const q=2*n[0];m.middle=m.left-=q,m.right-=q+2}E===!0&&(w=Le(m,S,a,l),ne(w,m,S,a,l))}g={top:w.top+"px",left:w.left+"px"},w.maxHeight!==void 0&&(g.maxHeight=w.maxHeight+"px",m.height>w.maxHeight&&(g.minHeight=g.maxHeight)),w.maxWidth!==void 0&&(g.maxWidth=w.maxWidth+"px",m.width>w.maxWidth&&(g.minWidth=g.maxWidth)),Object.assign(o.style,g),o.scrollTop!==s&&(o.scrollTop=s),o.scrollLeft!==p&&(o.scrollLeft=p)}function ne(e,t,o,n,i){const a=o.bottom,l=o.right,r=Yt(),u=window.innerHeight-r,c=document.body.clientWidth;if(e.top<0||e.top+a>u)if(i.vertical==="center")e.top=t[n.vertical]>u/2?Math.max(0,u-a):0,e.maxHeight=Math.min(a,u);else if(t[n.vertical]>u/2){const d=Math.min(u,n.vertical==="center"?t.center:n.vertical===i.vertical?t.bottom:t.top);e.maxHeight=Math.min(a,d),e.top=Math.max(0,d-a)}else e.top=Math.max(0,n.vertical==="center"?t.center:n.vertical===i.vertical?t.top:t.bottom),e.maxHeight=Math.min(a,u-e.top);if(e.left<0||e.left+l>c)if(e.maxWidth=Math.min(l,c),i.horizontal==="middle")e.left=t[n.horizontal]>c/2?Math.max(0,c-l):0;else if(t[n.horizontal]>c/2){const d=Math.min(c,n.horizontal==="middle"?t.middle:n.horizontal===i.horizontal?t.right:t.left);e.maxWidth=Math.min(l,d),e.left=Math.max(0,d-e.maxWidth)}else e.left=Math.max(0,n.horizontal==="middle"?t.middle:n.horizontal===i.horizontal?t.left:t.right),e.maxWidth=Math.min(l,c-e.left)}const To=Ve({name:"QMenu",inheritAttrs:!1,props:{...qt,...Ct,...yt,...Dt,persistent:Boolean,autoClose:Boolean,separateClosePopup:Boolean,noEscDismiss:Boolean,noRouteDismiss:Boolean,noRefocus:Boolean,noFocus:Boolean,fit:Boolean,cover:Boolean,square:Boolean,anchor:{type:String,validator:He},self:{type:String,validator:He},offset:{type:Array,validator:no},scrollTarget:Kt,touchPosition:Boolean,maxHeight:{type:String,default:null},maxWidth:{type:String,default:null}},emits:[...Lt,"click","escapeKey"],setup(e,{slots:t,emit:o,attrs:n}){let i=null,a,l,r;const u=K(),{proxy:c}=u,{$q:d}=c,v=B(null),p=B(!1),s=P(()=>e.persistent!==!0&&e.noRouteDismiss!==!0),m=bt(e,d),{registerTick:C,removeTick:T}=Nt(),{registerTimeout:L}=Rt(),{transitionProps:h,transitionStyle:g}=Ot(e),{localScrollTarget:S,changeScrollEvent:w,unconfigureScrollTarget:$}=Ht(e,ge),{anchorEl:y,canShow:E}=Pt({showing:p}),{hide:q}=_t({showing:p,canShow:E,handleShow:tt,handleHide:ot,hideOnRouteChange:s,processOnMount:!0}),{showPortal:ce,hidePortal:de,renderPortal:Ue}=It(u,v,lt,"menu"),J={anchorEl:y,innerRef:v,onClickOutside(f){if(e.persistent!==!0&&p.value===!0)return q(f),(f.type==="touchstart"||f.target.classList.contains("q-dialog__backdrop"))&&Ie(f),!0}},fe=P(()=>Ce(e.anchor||(e.cover===!0?"center middle":"bottom start"),d.lang.rtl)),Je=P(()=>e.cover===!0?fe.value:Ce(e.self||"top start",d.lang.rtl)),Ze=P(()=>(e.square===!0?" q-menu--square":"")+(m.value===!0?" q-menu--dark q-dark":"")),et=P(()=>e.autoClose===!0?{onClick:nt}:{}),me=P(()=>p.value===!0&&e.persistent!==!0);H(me,f=>{f===!0?(Zt(ee),oo(J)):(Te(ee),Se(J))});function Z(){Mt(()=>{let f=v.value;f&&f.contains(document.activeElement)!==!0&&(f=f.querySelector("[autofocus][tabindex], [data-autofocus][tabindex]")||f.querySelector("[autofocus] [tabindex], [data-autofocus] [tabindex]")||f.querySelector("[autofocus], [data-autofocus]")||f,f.focus({preventScroll:!0}))})}function tt(f){if(i=e.noRefocus===!1?document.activeElement:null,eo(ve),ce(),ge(),a=void 0,f!==void 0&&(e.touchPosition||e.contextMenu)){const te=ft(f);if(te.left!==void 0){const{top:it,left:rt}=y.value.getBoundingClientRect();a={left:te.left-rt,top:te.top-it}}}l===void 0&&(l=H(()=>d.screen.width+"|"+d.screen.height+"|"+e.self+"|"+e.anchor+"|"+d.lang.rtl,z)),e.noFocus!==!0&&document.activeElement.blur(),C(()=>{z(),e.noFocus!==!0&&Z()}),L(()=>{d.platform.is.ios===!0&&(r=e.autoClose,v.value.click()),z(),ce(!0),o("show",f)},e.transitionDuration)}function ot(f){T(),de(),he(!0),i!==null&&(f===void 0||f.qClickOutside!==!0)&&(((f?.type.indexOf("key")===0?i.closest('[tabindex]:not([tabindex^="-"])'):void 0)||i).focus(),i=null),L(()=>{de(!0),o("hide",f)},e.transitionDuration)}function he(f){a=void 0,l!==void 0&&(l(),l=void 0),(f===!0||p.value===!0)&&(to(ve),$(),Se(J),Te(ee)),f!==!0&&(i=null)}function ge(){(y.value!==null||e.scrollTarget!==void 0)&&(S.value=Qt(y.value,e.scrollTarget),w(S.value,z))}function nt(f){r!==!0?(Ft(c,f),o("click",f)):r=!1}function ve(f){me.value===!0&&e.noFocus!==!0&&Et(v.value,f.target)!==!0&&Z()}function ee(f){e.noEscDismiss!==!0&&(o("escapeKey"),q(f))}function z(){Xe({targetEl:v.value,offset:e.offset,anchorEl:y.value,anchorOrigin:fe.value,selfOrigin:Je.value,absoluteOffset:a,fit:e.fit,cover:e.cover,maxHeight:e.maxHeight,maxWidth:e.maxWidth})}function lt(){return X(mt,h.value,()=>p.value===!0?X("div",{role:"menu",...n,ref:v,tabindex:-1,class:["q-menu q-position-engine scroll"+Ze.value,n.class],style:[n.style,g.value],...et.value},wt(t.default)):null)}return V(he),Object.assign(c,{focus:Z,updatePosition:z}),Ue}}),_e=["B","KB","MB","GB","TB","PB"];function So(e,t=1){let o=0;for(;parseInt(e,10)>=1024&&o<_e.length-1;)e/=1024,++o;return`${e.toFixed(t)}${_e[o]}`}function qo(e,t,o){return o<=t?t:Math.min(o,Math.max(t,e))}function Po(e,t,o){if(o<=t)return t;const n=o-t+1;let i=t+(e-t)%n;return i<t&&(i=n+i),i===0?0:i}function Ho(e,t,o){let n;function i(){n!==void 0&&(be.remove(n),n=void 0)}return V(()=>{e.value===!0&&i()}),{removeFromHistory:i,addToHistory(){n={condition:()=>o.value===!0,handler:t},be.add(n)}}}let D=0,le,ie,O,re=!1,ke,Me,We,_=null;function so(e){ao(e)&&Ie(e)}function ao(e){if(e.target===document.body||e.target.classList.contains("q-layout__backdrop"))return!0;const t=ht(e),o=e.shiftKey&&!e.deltaX,n=!o&&Math.abs(e.deltaX)<=Math.abs(e.deltaY),i=o||n?e.deltaY:e.deltaX;for(let a=0;a<t.length;a++){const l=t[a];if(Xt(l,n))return n?i<0&&l.scrollTop===0?!0:i>0&&l.scrollTop+l.clientHeight===l.scrollHeight:i<0&&l.scrollLeft===0?!0:i>0&&l.scrollLeft+l.clientWidth===l.scrollWidth}return!0}function Ae(e){e.target===document&&(document.scrollingElement.scrollTop=document.scrollingElement.scrollTop)}function Q(e){re!==!0&&(re=!0,requestAnimationFrame(()=>{re=!1;const{height:t}=e.target,{clientHeight:o,scrollTop:n}=document.scrollingElement;(O===void 0||t!==window.innerHeight)&&(O=o-t,document.scrollingElement.scrollTop=n),n>O&&(document.scrollingElement.scrollTop-=Math.ceil((n-O)/8))}))}function $e(e){const t=document.body,o=window.visualViewport!==void 0;if(e==="add"){const{overflowY:n,overflowX:i}=window.getComputedStyle(t);le=Re(window),ie=Ne(window),ke=t.style.left,Me=t.style.top,We=window.location.href,t.style.left=`-${le}px`,t.style.top=`-${ie}px`,i!=="hidden"&&(i==="scroll"||t.scrollWidth>window.innerWidth)&&t.classList.add("q-body--force-scrollbar-x"),n!=="hidden"&&(n==="scroll"||t.scrollHeight>window.innerHeight)&&t.classList.add("q-body--force-scrollbar-y"),t.classList.add("q-body--prevent-scroll"),document.qScrollPrevented=!0,x.is.ios===!0&&(o===!0?(window.scrollTo(0,0),window.visualViewport.addEventListener("resize",Q,b.passiveCapture),window.visualViewport.addEventListener("scroll",Q,b.passiveCapture),window.scrollTo(0,0)):window.addEventListener("scroll",Ae,b.passiveCapture))}x.is.desktop===!0&&x.is.mac===!0&&window[`${e}EventListener`]("wheel",so,b.notPassive),e==="remove"&&(x.is.ios===!0&&(o===!0?(window.visualViewport.removeEventListener("resize",Q,b.passiveCapture),window.visualViewport.removeEventListener("scroll",Q,b.passiveCapture)):window.removeEventListener("scroll",Ae,b.passiveCapture)),t.classList.remove("q-body--prevent-scroll"),t.classList.remove("q-body--force-scrollbar-x"),t.classList.remove("q-body--force-scrollbar-y"),document.qScrollPrevented=!1,t.style.left=ke,t.style.top=Me,window.location.href===We&&window.scrollTo(le,ie),O=void 0)}function uo(e){let t="add";if(e===!0){if(D++,_!==null){clearTimeout(_),_=null;return}if(D>1)return}else{if(D===0||(D--,D>0))return;if(t="remove",x.is.ios===!0&&x.is.nativeMobile===!0){_!==null&&clearTimeout(_),_=setTimeout(()=>{$e(t),_=null},100);return}}$e(t)}function Co(){let e;return{preventBodyScroll(t){t!==e&&(e!==void 0||t===!0)&&(e=t,uo(t))}}}function co(e){return gt(e)===!0?"__q_date|"+e.getTime():vt(e)===!0?"__q_expr|"+e.source:typeof e=="number"?"__q_numb|"+e:typeof e=="boolean"?"__q_bool|"+(e?"1":"0"):typeof e=="string"?"__q_strn|"+e:typeof e=="function"?"__q_strn|"+e.toString():e===Object(e)?"__q_objt|"+JSON.stringify(e):e}function fo(e){if(e.length<9)return e;const o=e.substring(0,8),n=e.substring(9);switch(o){case"__q_date":const i=Number(n);return new Date(Number.isNaN(i)===!0?n:i);case"__q_expr":return new RegExp(n);case"__q_numb":return Number(n);case"__q_bool":return n==="1";case"__q_strn":return""+n;case"__q_objt":return JSON.parse(n);default:return e}}function mo(){const e=()=>null;return{has:()=>!1,hasItem:()=>!1,getLength:()=>0,getItem:e,getIndex:e,getKey:e,getAll:()=>{},getAllKeys:()=>[],set:I,setItem:I,remove:I,removeItem:I,clear:I,isEmpty:()=>!0}}function ho(e){const t=window[e+"Storage"],o=l=>{const r=t.getItem(l);return r?fo(r):null},n=l=>t.getItem(l)!==null,i=(l,r)=>{t.setItem(l,co(r))},a=l=>{t.removeItem(l)};return{has:n,hasItem:n,getLength:()=>t.length,getItem:o,getIndex:l=>l<t.length?o(t.key(l)):null,getKey:l=>l<t.length?t.key(l):null,getAll:()=>{let l;const r={},u=t.length;for(let c=0;c<u;c++)l=t.key(c),r[l]=o(l);return r},getAllKeys:()=>{const l=[],r=t.length;for(let u=0;u<r;u++)l.push(t.key(u));return l},set:i,setItem:i,remove:a,removeItem:a,clear:()=>{t.clear()},isEmpty:()=>t.length===0}}const Ge=x.has.webStorage===!1?mo():ho("local"),go={install({$q:e}){e.localStorage=Ge}};Object.assign(go,Ge);export{Pt as A,It as B,Se as C,Xe as D,oo as E,to as F,Te as G,eo as H,Zt as I,Po as J,go as P,To as Q,Ne as a,Re as b,Tt as c,qo as d,xo as e,Eo as f,Qt as g,Ct as h,Rt as i,_t as j,Ho as k,Co as l,Yt as m,So as n,Mt as o,He as p,Dt as q,bo as r,Kt as s,St as t,Lt as u,no as v,Ce as w,Nt as x,Ot as y,Ht as z};
|