import{c as I,I as ne,r as B,a as h,w as E,e as x,A as q,u as H,E as ae,h as b,T as se,g as ie,d as M,B as le,U as re}from"./index-4VyYssN1.js";import{w as ue,u as ce,x as T,y as D,z as de,b as fe,p as he,e as ge,A as ve,B as pe,C as me,f as ye,D as Te,E as A,F as be,c as j,G,H as we}from"./QItemLabel-CAR5HLBB.js";const Pe=I({name:"QTooltip",inheritAttrs:!1,props:{...ue,...ce,...T,maxHeight:{type:String,default:null},maxWidth:{type:String,default:null},transitionShow:{...T.transitionShow,default:"jump-down"},transitionHide:{...T.transitionHide,default:"jump-up"},anchor:{type:String,default:"bottom middle",validator:D},self:{type:String,default:"top middle",validator:D},offset:{type:Array,default:()=>[14,14],validator:de},scrollTarget:ne,delay:{type:Number,default:0},hideDelay:{type:Number,default:0},persistent:Boolean},emits:[...fe],setup(e,{slots:n,emit:o,attrs:r}){let a,u;const p=ie(),{proxy:{$q:s}}=p,c=B(null),g=B(!1),N=h(()=>G(e.anchor,s.lang.rtl)),Q=h(()=>G(e.self,s.lang.rtl)),R=h(()=>e.persistent!==!0),{registerTick:U,removeTick:_}=he(),{registerTimeout:v}=ge(),{transitionProps:L,transitionStyle:J}=ve(e),{localScrollTarget:w,changeScrollEvent:W,unconfigureScrollTarget:$}=pe(e,O),{anchorEl:i,canShow:z,anchorEvents:d}=me({showing:g,configureAnchorEl:ee}),{show:F,hide:m}=ye({showing:g,canShow:z,handleShow:K,handleHide:X,hideOnRouteChange:R,processOnMount:!0});Object.assign(d,{delayShow:Y,delayHide:Z});const{showPortal:k,hidePortal:S,renderPortal:V}=Te(p,c,oe,"tooltip");if(s.platform.is.mobile===!0){const t={anchorEl:i,innerRef:c,onClickOutside(l){return m(l),l.target.classList.contains("q-dialog__backdrop")&&le(l),!0}},y=h(()=>e.modelValue===null&&e.persistent!==!0&&g.value===!0);E(y,l=>{(l===!0?we:A)(t)}),x(()=>{A(t)})}function K(t){k(),U(()=>{u=new MutationObserver(()=>f()),u.observe(c.value,{attributes:!1,childList:!0,characterData:!0,subtree:!0}),f(),O()}),a===void 0&&(a=E(()=>s.screen.width+"|"+s.screen.height+"|"+e.self+"|"+e.anchor+"|"+s.lang.rtl,f)),v(()=>{k(!0),o("show",t)},e.transitionDuration)}function X(t){_(),S(),P(),v(()=>{S(!0),o("hide",t)},e.transitionDuration)}function P(){u!==void 0&&(u.disconnect(),u=void 0),a!==void 0&&(a(),a=void 0),$(),q(d,"tooltipTemp")}function f(){be({targetEl:c.value,offset:e.offset,anchorEl:i.value,anchorOrigin:N.value,selfOrigin:Q.value,maxHeight:e.maxHeight,maxWidth:e.maxWidth})}function Y(t){if(s.platform.is.mobile===!0){j(),document.body.classList.add("non-selectable");const y=i.value,l=["touchmove","touchcancel","touchend","click"].map(C=>[y,C,"delayHide","passiveCapture"]);H(d,"tooltipTemp",l)}v(()=>{F(t)},e.delay)}function Z(t){s.platform.is.mobile===!0&&(q(d,"tooltipTemp"),j(),setTimeout(()=>{document.body.classList.remove("non-selectable")},10)),v(()=>{m(t)},e.hideDelay)}function ee(){if(e.noParentEvent===!0||i.value===null)return;const t=s.platform.is.mobile===!0?[[i.value,"touchstart","delayShow","passive"]]:[[i.value,"mouseenter","delayShow","passive"],[i.value,"mouseleave","delayHide","passive"]];H(d,"anchor",t)}function O(){if(i.value!==null||e.scrollTarget!==void 0){w.value=ae(i.value,e.scrollTarget);const t=e.noParentEvent===!0?f:m;W(w.value,t)}}function te(){return g.value===!0?b("div",{...r,ref:c,class:["q-tooltip q-tooltip--style q-position-engine no-pointer-events",r.class],style:[r.style,J.value],role:"tooltip"},M(n.default)):null}function oe(){return b(se,L.value,te)}return x(P),Object.assign(p.proxy,{updatePosition:f}),V}}),Oe=I({name:"QBtnGroup",props:{unelevated:Boolean,outline:Boolean,flat:Boolean,rounded:Boolean,square:Boolean,push:Boolean,stretch:Boolean,glossy:Boolean,spread:Boolean},setup(e,{slots:n}){const o=h(()=>{const r=["unelevated","outline","flat","rounded","square","push","stretch","glossy"].filter(a=>e[a]===!0).map(a=>`q-btn-group--${a}`).join(" ");return`q-btn-group row no-wrap${r.length!==0?" "+r:""}`+(e.spread===!0?" q-btn-group--spread":" inline")});return()=>b("div",{class:o.value},M(n.default))}}),Ce=re("token",{state:()=>({token:""}),getters:{tokenDataGet(e){if(e.token!==""){let o=e.token.split(".");var n=JSON.parse(decodeURIComponent(escape(window.atob(o[1].replace(/-/g,"+").replace(/_/g,"/")))));return n}else return e.token}},actions:{tokenChange(e){this.token=e},tokenCheck(){if(this.token!==""){let o=this.token.split(".");var e=JSON.parse(decodeURIComponent(escape(window.atob(o[1].replace(/-/g,"+").replace(/_/g,"/"))))),n=e.exp-Date.parse(new Date)/1e3;n<=0&&(this.token="")}},userPermissionGet(e){if(this.token!==""){let o=this.token.split(".");var n=JSON.parse(decodeURIComponent(escape(window.atob(o[1].replace(/-/g,"+").replace(/_/g,"/")))));return e in n.permissions}else return!1}},persist:{enable:!0}});export{Pe as Q,Oe as a,Ce as u};
