import{ax as R,av as b,n as U,ay as j,an as q,az as T,aB as $,ap as E,am as V,k as I,q as m,d as G,h as H,x as C,ao as J,a4 as Q,A as F,z as Z,bA as ee}from"./app-014d9ed9.js";import{g as z,s as L}from"./touch.70a9dd44.js";import{c as te}from"./selection.2a17b691.js";function ne(t){const i=[.06,6,50];return typeof t=="string"&&t.length&&t.split(":").forEach((u,d)=>{const r=parseFloat(u);r&&(i[d]=r)}),i}const ie=R({name:"touch-swipe",beforeMount(t,{value:i,arg:u,modifiers:d}){if(d.mouse!==!0&&b.has.touch!==!0)return;const r=d.mouseCapture===!0?"Capture":"",e={handler:i,sensitivity:ne(u),direction:z(d),noop:U,mouseStart(o){L(o,e)&&j(o)&&(q(e,"temp",[[document,"mousemove","move",`notPassive${r}`],[document,"mouseup","end","notPassiveCapture"]]),e.start(o,!0))},touchStart(o){if(L(o,e)){const c=o.target;q(e,"temp",[[c,"touchmove","move","notPassiveCapture"],[c,"touchcancel","end","notPassiveCapture"],[c,"touchend","end","notPassiveCapture"]]),e.start(o)}},start(o,c){b.is.firefox===!0&&T(t,!0);const f=$(o);e.event={x:f.left,y:f.top,time:Date.now(),mouse:c===!0,dir:!1}},move(o){if(e.event===void 0)return;if(e.event.dir!==!1){E(o);return}const c=Date.now()-e.event.time;if(c===0)return;const f=$(o),h=f.left-e.event.x,l=Math.abs(h),g=f.top-e.event.y,s=Math.abs(g);if(e.event.mouse!==!0){if(le.sensitivity[0]&&(e.event.dir=g<0?"up":"down"),e.direction.horizontal===!0&&l>s&&s<100&&v>e.sensitivity[0]&&(e.event.dir=h<0?"left":"right"),e.direction.up===!0&&le.sensitivity[0]&&(e.event.dir="up"),e.direction.down===!0&&l0&&l<100&&y>e.sensitivity[0]&&(e.event.dir="down"),e.direction.left===!0&&l>s&&h<0&&s<100&&v>e.sensitivity[0]&&(e.event.dir="left"),e.direction.right===!0&&l>s&&h>0&&s<100&&v>e.sensitivity[0]&&(e.event.dir="right"),e.event.dir!==!1?(E(o),e.event.mouse===!0&&(document.body.classList.add("no-pointer-events--children"),document.body.classList.add("non-selectable"),te(),e.styleCleanup=A=>{e.styleCleanup=void 0,document.body.classList.remove("non-selectable");const x=()=>{document.body.classList.remove("no-pointer-events--children")};A===!0?setTimeout(x,50):x()}),e.handler({evt:o,touch:e.event.mouse!==!0,mouse:e.event.mouse,direction:e.event.dir,duration:c,distance:{x:l,y:s}})):e.end(o)},end(o){e.event!==void 0&&(V(e,"temp"),b.is.firefox===!0&&T(t,!1),e.styleCleanup!==void 0&&e.styleCleanup(!0),o!==void 0&&e.event.dir!==!1&&E(o),e.event=void 0)}};if(t.__qtouchswipe=e,d.mouse===!0){const o=d.mouseCapture===!0||d.mousecapture===!0?"Capture":"";q(e,"main",[[t,"mousedown","mouseStart",`passive${o}`]])}b.has.touch===!0&&q(e,"main",[[t,"touchstart","touchStart",`passive${d.capture===!0?"Capture":""}`],[t,"touchmove","noop","notPassiveCapture"]])},updated(t,i){const u=t.__qtouchswipe;u!==void 0&&(i.oldValue!==i.value&&(typeof i.value!="function"&&u.end(),u.handler=i.value),u.direction=z(i.modifiers))},beforeUnmount(t){const i=t.__qtouchswipe;i!==void 0&&(V(i,"main"),V(i,"temp"),b.is.firefox===!0&&T(t,!1),i.styleCleanup!==void 0&&i.styleCleanup(),delete t.__qtouchswipe)}});function oe(){const t=new Map;return{getCache:function(i,u){return t[i]===void 0?t[i]=u:t[i]},getCacheWithFn:function(i,u){return t[i]===void 0?t[i]=u():t[i]}}}const ue={name:{required:!0},disable:Boolean},W={setup(t,{slots:i}){return()=>C("div",{class:"q-panel scroll",role:"tabpanel"},F(i.default))}},le={modelValue:{required:!0},animated:Boolean,infinite:Boolean,swipeable:Boolean,vertical:Boolean,transitionPrev:String,transitionNext:String,transitionDuration:{type:[String,Number],default:300},keepAlive:Boolean,keepAliveInclude:[String,Array,RegExp],keepAliveExclude:[String,Array,RegExp],keepAliveMax:Number},ce=["update:modelValue","before-transition","transition"];function de(){const{props:t,emit:i,proxy:u}=H(),{getCacheWithFn:d}=oe();let r,e;const o=I(null),c=I(null);function f(n){const a=t.vertical===!0?"up":"left";P((u.$q.lang.rtl===!0?-1:1)*(n.direction===a?1:-1))}const h=m(()=>[[ie,f,void 0,{horizontal:t.vertical!==!0,vertical:t.vertical,mouse:!0}]]),l=m(()=>t.transitionPrev||`slide-${t.vertical===!0?"down":"right"}`),g=m(()=>t.transitionNext||`slide-${t.vertical===!0?"up":"left"}`),s=m(()=>`--q-transition-duration: ${t.transitionDuration}ms`),v=m(()=>typeof t.modelValue=="string"||typeof t.modelValue=="number"?t.modelValue:String(t.modelValue)),y=m(()=>({include:t.keepAliveInclude,exclude:t.keepAliveExclude,max:t.keepAliveMax})),A=m(()=>t.keepAliveInclude!==void 0||t.keepAliveExclude!==void 0);G(()=>t.modelValue,(n,a)=>{const p=S(n)===!0?k(n):-1;e!==!0&&D(p===-1?0:p{i("transition",n,a)}))});function x(){P(1)}function _(){P(-1)}function B(n){i("update:modelValue",n)}function S(n){return n!=null&&n!==""}function k(n){return r.findIndex(a=>a.props.name===n&&a.props.disable!==""&&a.props.disable!==!0)}function K(){return r.filter(n=>n.props.disable!==""&&n.props.disable!==!0)}function D(n){const a=n!==0&&t.animated===!0&&o.value!==-1?"q-transition--"+(n===-1?l.value:g.value):null;c.value!==a&&(c.value=a)}function P(n,a=o.value){let p=a+n;for(;p>-1&&p{e=!1});return}p+=n}t.infinite===!0&&r.length>0&&a!==-1&&a!==r.length&&P(n,n===-1?r.length:-1)}function N(){const n=k(t.modelValue);return o.value!==n&&(o.value=n),!0}function M(){const n=S(t.modelValue)===!0&&N()&&r[o.value];return t.keepAlive===!0?[C(ee,y.value,[C(A.value===!0?d(v.value,()=>({...W,name:v.value})):W,{key:v.value,style:s.value},()=>n)])]:[C("div",{class:"q-panel scroll",style:s.value,key:v.value,role:"tabpanel"},[n])]}function X(){if(r.length!==0)return t.animated===!0?[C(J,{name:c.value},M)]:M()}function Y(n){return r=Q(F(n.default,[])).filter(a=>a.props!==null&&a.props.slot===void 0&&S(a.props.name)===!0),r.length}function O(){return r}return Object.assign(u,{next:x,previous:_,goTo:B}),{panelIndex:o,panelDirectives:h,updatePanelsList:Y,updatePanelIndex:N,getPanelContent:X,getEnabledPanels:K,getPanels:O,isValidPanelName:S,keepAliveProps:y,needsUniqueKeepAliveWrapper:A,goToPanelByOffset:P,goToPanel:B,nextPanel:x,previousPanel:_}}export{ue as a,le as b,ce as c,de as d,oe as u};