mirror of
https://github.com/setube/ogame-vue-ts.git
synced 2026-05-12 07:55:11 +08:00
重构并精简了部分UI组件,移除冗余弹窗与详情组件,新增NPC相关逻辑(npcBehaviorLogic、npcGrowthLogic、npcStore等)及外交逻辑(diplomaticLogic、DiplomacyView)。完善分页、标签、复选框等通用UI组件。优化战报弹窗,调整README下载链接为相对路径,修复部分国际化内容。
1 line
52 KiB
JavaScript
1 line
52 KiB
JavaScript
import{$t as e,An as t,Bn as n,Cn as r,En as i,Fn as a,Gn as o,Gt as s,In as c,Jn as l,Jt as u,Ln as d,Mn as f,On as p,Pn as m,Qt as h,Un as g,Wn as _,Xn as v,Xt as y,Yn as b,Yt as x,Zt as S,_n as C,an as w,bn as T,dn as E,en as D,fn as O,gn as k,kn as A,ln as j,mn as M,nn as N,on as ee,qn as P,sn as te,tn as F,un as ne,vn as re,wn as I,zn as L}from"./game-logic-Bi1l7y4K.js";function ie(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ie(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function ae(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ie(e))&&(r&&(r+=` `),r+=t);return r}var oe=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e;const se=ae,ce=(e,t)=>n=>{if(t?.variants==null)return se(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=oe(t)||oe(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return se(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function le(e){return typeof e==`string`?`'${e}'`:new ue().serialize(e)}var ue=function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?e.localeCompare(t):n===`number`&&r===`number`?e-t:String.prototype.localeCompare.call(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}return this.serializeObjectEntries(r,Object.entries(e))}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t?.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((e,t)=>this.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`,`)}]`};for(let t of[`BigInt64Array`,`BigUint64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`n,`)}${e.length>0?`n`:``}]`};return e}();function de(e,t){return e===t||le(e)===le(t)}function fe(e,t){let r=n();return I(()=>{r.value=e()},{...t,flush:t?.flush??`sync`}),c(r)}function R(e){return t()?(m(e),!0):!1}function pe(){let e=new Set,t=t=>{e.delete(t)};return{on:n=>{e.add(n);let r=()=>t(n);return R(r),{off:r}},off:t,trigger:(...t)=>Promise.all(Array.from(e).map(e=>e(...t))),clear:()=>{e.clear()}}}function me(e){let t=!1,n,r=A(!0);return(...i)=>(t||=(n=r.run(()=>e(...i)),!0),n)}function he(e){let t=0,n,r,i=()=>{--t,r&&t<=0&&(r.stop(),n=void 0,r=void 0)};return(...a)=>(t+=1,r||(r=A(!0),n=r.run(()=>e(...a))),R(i),n)}function ge(e){return f(e)?a(new Proxy({},{get(t,n,r){return o(Reflect.get(e.value,n,r))},set(t,n,r){return f(e.value[n])&&!f(r)?e.value[n].value=r:e.value[n]=r,!0},deleteProperty(t,n){return Reflect.deleteProperty(e.value,n)},has(t,n){return Reflect.has(e.value,n)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}})):a(e)}function _e(e){return ge(u(e))}function ve(e,...t){let n=t.flat(),r=n[0];return _e(()=>typeof r==`function`?Object.fromEntries(Object.entries(g(e)).filter(([e,t])=>!r(_(t),e))):Object.fromEntries(Object.entries(g(e)).filter(e=>!n.includes(e[0]))))}var ye=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var z=e=>e!==void 0,be=Object.prototype.toString,xe=e=>be.call(e)===`[object Object]`,Se=Ce();function Ce(){return ye&&(window==null?void 0:window.navigator)?.userAgent&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||(window==null?void 0:window.navigator)?.maxTouchPoints>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function we(e){return e||N()}function Te(e){return Array.isArray(e)?e:[e]}function Ee(e,t=1e4){return p((n,r)=>{let i=_(e),a,o=()=>setTimeout(()=>{i=_(e),r()},_(t));return R(()=>{clearTimeout(a)}),{get(){return n(),i},set(e){i=e,r(),clearTimeout(a),a=o()}}})}function De(e,t){we(t)&&E(e,t)}function Oe(e,t,r={}){let{immediate:i=!0,immediateCallback:a=!1}=r,o=n(!1),s=null;function l(){s&&=(clearTimeout(s),null)}function u(){o.value=!1,l()}function d(...n){a&&e(),l(),o.value=!0,s=setTimeout(()=>{o.value=!1,s=null,e(...n)},_(t))}return i&&(o.value=!0,ye&&d()),R(u),{isPending:c(o),start:d,stop:u}}function ke(e,t,n){return r(e,t,{...n,immediate:!0})}function Ae(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function je(e,t,n=`.`,r){if(!Ae(t))return je(e,{},n,r);let i=Object.assign({},t);for(let t in e){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(Array.isArray(a)&&Array.isArray(i[t])?i[t]=[...a,...i[t]]:Ae(a)&&Ae(i[t])?i[t]=je(a,i[t],(n?`${n}.`:``)+t.toString(),r):i[t]=a))}return i}function Me(e){return(...t)=>t.reduce((t,n)=>je(t,n,``,e),{})}var Ne=Me(),Pe=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Fe=new WeakMap,Ie=new WeakMap,Le={},Re=0,ze=function(e){return e&&(e.host||ze(e.parentNode))},Be=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=ze(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Ve=function(e,t,n,r){var i=Be(t,Array.isArray(e)?e:[e]);Le[n]||(Le[n]=new WeakMap);var a=Le[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Fe.get(e)||0)+1,l=(a.get(e)||0)+1;Fe.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Ie.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Re++,function(){o.forEach(function(e){var t=Fe.get(e)-1,i=a.get(e)-1;Fe.set(e,t),a.set(e,i),t||(Ie.has(e)||e.removeAttribute(r),Ie.delete(e)),i||e.removeAttribute(n)}),Re--,Re||(Fe=new WeakMap,Fe=new WeakMap,Ie=new WeakMap,Le={})}},He=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Pe(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ve(r,i,n,`aria-hidden`)):function(){return null}},Ue=[`top`,`right`,`bottom`,`left`],B=Math.min,V=Math.max,We=Math.round,Ge=Math.floor,H=e=>({x:e,y:e}),Ke={left:`right`,right:`left`,bottom:`top`,top:`bottom`},qe={start:`end`,end:`start`};function Je(e,t,n){return V(e,B(t,n))}function U(e,t){return typeof e==`function`?e(t):e}function W(e){return e.split(`-`)[0]}function Ye(e){return e.split(`-`)[1]}function Xe(e){return e===`x`?`y`:`x`}function Ze(e){return e===`y`?`height`:`width`}var Qe=new Set([`top`,`bottom`]);function G(e){return Qe.has(W(e))?`y`:`x`}function $e(e){return Xe(G(e))}function et(e,t,n){n===void 0&&(n=!1);let r=Ye(e),i=$e(e),a=Ze(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=lt(o)),[o,lt(o)]}function tt(e){let t=lt(e);return[nt(e),t,nt(t)]}function nt(e){return e.replace(/start|end/g,e=>qe[e])}var rt=[`left`,`right`],it=[`right`,`left`],at=[`top`,`bottom`],ot=[`bottom`,`top`];function st(e,t,n){switch(e){case`top`:case`bottom`:return n?t?it:rt:t?rt:it;case`left`:case`right`:return t?at:ot;default:return[]}}function ct(e,t,n,r){let i=Ye(e),a=st(W(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(nt)))),a}function lt(e){return e.replace(/left|right|bottom|top/g,e=>Ke[e])}function ut(e){return{top:0,right:0,bottom:0,left:0,...e}}function dt(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:ut(e)}function ft(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function pt(e,t,n){let{reference:r,floating:i}=e,a=G(t),o=$e(t),s=Ze(o),c=W(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Ye(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}var mt=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=pt(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=pt(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};async function ht(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=U(t,e),p=dt(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ft(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ft(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var gt=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=U(e,t)||{};if(l==null)return{};let d=dt(u),f={x:n,y:r},p=$e(i),m=Ze(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=B(d[_],T),D=B(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=Je(O,A,k),M=!c.arrow&&Ye(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),_t=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=U(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=W(r),_=G(o),v=W(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[lt(o)]:tt(o)),x=p!==`none`;!d&&x&&b.push(...ct(o,m,p,y));let S=[o,...b],C=await ht(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=et(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==G(t))||T.every(e=>G(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=G(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function vt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function yt(e){return Ue.some(t=>e[t]>=0)}var bt=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n}=t,{strategy:r=`referenceHidden`,...i}=U(e,t);switch(r){case`referenceHidden`:{let e=vt(await ht(t,{...i,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:yt(e)}}}case`escaped`:{let e=vt(await ht(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:yt(e)}}}default:return{}}}}},xt=new Set([`left`,`top`]);async function St(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=W(n),s=Ye(n),c=G(n)===`y`,l=xt.has(o)?-1:1,u=a&&c?-1:1,d=U(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Ct=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await St(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},wt=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=U(e,t),l={x:n,y:r},u=await ht(t,c),d=G(W(i)),f=Xe(d),p=l[f],m=l[d];if(a){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=p+u[e],r=p-u[t];p=Je(n,p,r)}if(o){let e=d===`y`?`top`:`left`,t=d===`y`?`bottom`:`right`,n=m+u[e],r=m-u[t];m=Je(n,m,r)}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[d]:o}}}}}},Tt=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=U(e,t),u={x:n,y:r},d=G(i),f=Xe(d),p=u[f],m=u[d],h=U(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=xt.has(W(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Et=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=U(e,t),u=await ht(t,l),d=W(i),f=Ye(i),p=G(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=B(h-u[g],v),x=B(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=V(u.left,0),t=V(u.right,0),n=V(u.top,0),r=V(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:V(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:V(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Dt(){return typeof window<`u`}function Ot(e){return kt(e)?(e.nodeName||``).toLowerCase():`#document`}function K(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function q(e){return((kt(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function kt(e){return Dt()?e instanceof Node||e instanceof K(e).Node:!1}function J(e){return Dt()?e instanceof Element||e instanceof K(e).Element:!1}function Y(e){return Dt()?e instanceof HTMLElement||e instanceof K(e).HTMLElement:!1}function At(e){return!Dt()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof K(e).ShadowRoot}var jt=new Set([`inline`,`contents`]);function Mt(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=X(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!jt.has(i)}var Nt=new Set([`table`,`td`,`th`]);function Pt(e){return Nt.has(Ot(e))}var Ft=[`:popover-open`,`:modal`];function It(e){return Ft.some(t=>{try{return e.matches(t)}catch{return!1}})}var Lt=[`transform`,`translate`,`scale`,`rotate`,`perspective`],Rt=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],zt=[`paint`,`layout`,`strict`,`content`];function Bt(e){let t=Ht(),n=J(e)?X(e):e;return Lt.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||Rt.some(e=>(n.willChange||``).includes(e))||zt.some(e=>(n.contain||``).includes(e))}function Vt(e){let t=Z(e);for(;Y(t)&&!Wt(t);){if(Bt(t))return t;if(It(t))return null;t=Z(t)}return null}function Ht(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var Ut=new Set([`html`,`body`,`#document`]);function Wt(e){return Ut.has(Ot(e))}function X(e){return K(e).getComputedStyle(e)}function Gt(e){return J(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Z(e){if(Ot(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||At(e)&&e.host||q(e);return At(t)?t.host:t}function Kt(e){let t=Z(e);return Wt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Y(t)&&Mt(t)?t:Kt(t)}function qt(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Kt(e),i=r===e.ownerDocument?.body,a=K(r);if(i){let e=Jt(a);return t.concat(a,a.visualViewport||[],Mt(r)?r:[],e&&n?qt(e):[])}return t.concat(r,qt(r,[],n))}function Jt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Yt(e){let t=X(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Y(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=We(n)!==a||We(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Xt(e){return J(e)?e:e.contextElement}function Zt(e){let t=Xt(e);if(!Y(t))return H(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Yt(t),o=(a?We(n.width):n.width)/r,s=(a?We(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Qt=H(0);function $t(e){let t=K(e);return!Ht()||!t.visualViewport?Qt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function en(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==K(e)?!1:t}function tn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Xt(e),o=H(1);t&&(r?J(r)&&(o=Zt(r)):o=Zt(e));let s=en(a,n,r)?$t(a):H(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=K(a),t=r&&J(r)?K(r):r,n=e,i=Jt(n);for(;i&&r&&t!==n;){let e=Zt(i),t=i.getBoundingClientRect(),r=X(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=K(i),i=Jt(n)}}return ft({width:u,height:d,x:c,y:l})}function nn(e,t){let n=Gt(e).scrollLeft;return t?t.left+n:tn(q(e)).left+n}function rn(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-nn(e,n),y:n.top+t.scrollTop}}function an(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=q(r),s=t?It(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=H(1),u=H(0),d=Y(r);if((d||!d&&!a)&&((Ot(r)!==`body`||Mt(o))&&(c=Gt(r)),Y(r))){let e=tn(r);l=Zt(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?rn(o,c):H(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function on(e){return Array.from(e.getClientRects())}function sn(e){let t=q(e),n=Gt(e),r=e.ownerDocument.body,i=V(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=V(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+nn(e),s=-n.scrollTop;return X(r).direction===`rtl`&&(o+=V(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var cn=25;function ln(e,t){let n=K(e),r=q(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Ht();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=nn(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=cn&&(a-=o)}else l<=cn&&(a+=l);return{width:a,height:o,x:s,y:c}}var un=new Set([`absolute`,`fixed`]);function dn(e,t){let n=tn(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Y(e)?Zt(e):H(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function fn(e,t,n){let r;if(t===`viewport`)r=ln(e,n);else if(t===`document`)r=sn(q(e));else if(J(t))r=dn(t,n);else{let n=$t(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ft(r)}function pn(e,t){let n=Z(e);return n===t||!J(n)||Wt(n)?!1:X(n).position===`fixed`||pn(n,t)}function mn(e,t){let n=t.get(e);if(n)return n;let r=qt(e,[],!1).filter(e=>J(e)&&Ot(e)!==`body`),i=null,a=X(e).position===`fixed`,o=a?Z(e):e;for(;J(o)&&!Wt(o);){let t=X(o),n=Bt(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&un.has(i.position)||Mt(o)&&!n&&pn(e,o))?r=r.filter(e=>e!==o):i=t,o=Z(o)}return t.set(e,r),r}function hn(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?It(t)?[]:mn(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=fn(t,n,i);return e.top=V(r.top,e.top),e.right=B(r.right,e.right),e.bottom=B(r.bottom,e.bottom),e.left=V(r.left,e.left),e},fn(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function gn(e){let{width:t,height:n}=Yt(e);return{width:t,height:n}}function _n(e,t,n){let r=Y(t),i=q(t),a=n===`fixed`,o=tn(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=H(0);function l(){c.x=nn(i)}if(r||!r&&!a)if((Ot(t)!==`body`||Mt(i))&&(s=Gt(t)),r){let e=tn(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?rn(i,s):H(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function vn(e){return X(e).position===`static`}function yn(e,t){if(!Y(e)||X(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return q(e)===n&&(n=n.ownerDocument.body),n}function bn(e,t){let n=K(e);if(It(e))return n;if(!Y(e)){let t=Z(e);for(;t&&!Wt(t);){if(J(t)&&!vn(t))return t;t=Z(t)}return n}let r=yn(e,t);for(;r&&Pt(r)&&vn(r);)r=yn(r,t);return r&&Wt(r)&&vn(r)&&!Bt(r)?n:r||Vt(e)||n}var xn=async function(e){let t=this.getOffsetParent||bn,n=this.getDimensions,r=await n(e.floating);return{reference:_n(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Sn(e){return X(e).direction===`rtl`}var Cn={convertOffsetParentRelativeRectToViewportRelativeRect:an,getDocumentElement:q,getClippingRect:hn,getOffsetParent:bn,getElementRects:xn,getClientRects:on,getDimensions:gn,getScale:Zt,isElement:J,isRTL:Sn};function wn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Tn(e,t){let n=null,r,i=q(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Ge(d),h=Ge(i.clientWidth-(u+f)),g=Ge(i.clientHeight-(d+p)),_=Ge(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:V(0,B(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!wn(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function En(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Xt(e),u=i||a?[...l?qt(l):[],...qt(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Tn(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?tn(e):null;c&&g();function g(){let t=tn(e);h&&!wn(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Dn=Ct,On=wt,kn=_t,An=Et,jn=bt,Mn=gt,Nn=Tt,Pn=(e,t,n)=>{let r=new Map,i={platform:Cn,...n},a={...i.platform,_c:r};return mt(e,t,{...i,platform:a})};function Fn(e){return typeof e==`object`&&!!e&&`$el`in e}function In(e){if(Fn(e)){let t=e.$el;return kt(t)&&Ot(t)===`#comment`?null:t}return e}function Ln(e){return typeof e==`function`?e():o(e)}function Rn(e){return{name:`arrow`,options:e,fn(t){let n=In(Ln(e.element));return n==null?{}:Mn({element:n,padding:e.padding}).fn(t)}}}function zn(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Bn(e,t){let n=zn(e);return Math.round(t*n)/n}function Vn(e,i,a){a===void 0&&(a={});let o=a.whileElementsMounted,s=u(()=>Ln(a.open)??!0),c=u(()=>Ln(a.middleware)),l=u(()=>Ln(a.placement)??`bottom`),f=u(()=>Ln(a.strategy)??`absolute`),p=u(()=>Ln(a.transform)??!0),h=u(()=>In(e.value)),g=u(()=>In(i.value)),_=d(0),v=d(0),y=d(f.value),b=d(l.value),x=n({}),S=d(!1),C=u(()=>{let e={position:y.value,left:`0`,top:`0`};if(!g.value)return e;let t=Bn(g.value,_.value),n=Bn(g.value,v.value);return p.value?{...e,transform:`translate(`+t+`px, `+n+`px)`,...zn(g.value)>=1.5&&{willChange:`transform`}}:{position:y.value,left:t+`px`,top:n+`px`}}),w;function T(){if(h.value==null||g.value==null)return;let e=s.value;Pn(h.value,g.value,{middleware:c.value,placement:l.value,strategy:f.value}).then(t=>{_.value=t.x,v.value=t.y,y.value=t.strategy,b.value=t.placement,x.value=t.middlewareData,S.value=e!==!1})}function E(){typeof w==`function`&&(w(),w=void 0)}function D(){if(E(),o===void 0){T();return}if(h.value!=null&&g.value!=null){w=o(h.value,g.value,T);return}}function O(){s.value||(S.value=!1)}return r([c,l,f,s],T,{flush:`sync`}),r([h,g],D,{flush:`sync`}),r(s,O,{flush:`sync`}),t()&&m(E),{x:L(_),y:L(v),strategy:L(y),placement:L(b),middlewareData:L(x),isPositioned:L(S),floatingStyles:C,update:T}}var Hn=new WeakMap,Un=(...e)=>{let n=e[0],r=N()?.proxy??t();if(r==null&&!w())throw Error(`injectLocal must be called in setup`);return r&&Hn.has(r)&&n in Hn.get(r)?Hn.get(r)[n]:ee(...e)},Wn=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var Gn=e=>e!==void 0,Kn=Object.prototype.toString,qn=e=>Kn.call(e)===`[object Object]`;function Jn(e){return e.endsWith(`rem`)?Number.parseFloat(e)*16:Number.parseFloat(e)}function Yn(e){return Array.isArray(e)?e:[e]}function Xn(e){return f(e)?a(new Proxy({},{get(t,n,r){return o(Reflect.get(e.value,n,r))},set(t,n,r){return f(e.value[n])&&!f(r)?e.value[n].value=r:e.value[n]=r,!0},deleteProperty(t,n){return Reflect.deleteProperty(e.value,n)},has(t,n){return Reflect.has(e.value,n)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}})):a(e)}function Zn(e){return Xn(u(e))}function Qn(e,...t){let n=t.flat(),r=n[0];return Zn(()=>typeof r==`function`?Object.fromEntries(Object.entries(g(e)).filter(([e,t])=>!r(_(t),e))):Object.fromEntries(Object.entries(g(e)).filter(e=>!n.includes(e[0]))))}function $n(e,t,n){return r(e,t,{...n,immediate:!0})}var er=1,Q=new class{subscribers;toasts;dismissedToasts;constructor(){this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)});publish=e=>{this.subscribers.forEach(t=>t(e))};addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]};create=e=>{let{message:t,...n}=e,r=typeof e.id==`number`||e.id&&e.id?.length>0?e.id:er++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r};dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e);message=(e,t)=>this.create({...t,message:e,type:`default`});error=(e,t)=>this.create({...t,type:`error`,message:e});success=(e,t)=>this.create({...t,type:`success`,message:e});info=(e,t)=>this.create({...t,type:`info`,message:e});warning=(e,t)=>this.create({...t,type:`warning`,message:e});loading=(e,t)=>this.create({...t,type:`loading`,message:e});promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],te(e))i=!1,this.create({id:n,type:`default`,message:e});else if(nr(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!te(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!te(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!te(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!te(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally?.()}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})};custom=(e,t)=>{let n=t?.id||er++,r=this.toasts.find(e=>e.id===n),i=t?.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(n)&&this.dismissedToasts.delete(n),r?this.toasts=this.toasts.map(r=>r.id===n?(this.publish({...r,component:e,dismissible:i,id:n,...t}),{...r,component:e,dismissible:i,id:n,...t}):r):this.addToast({component:e,dismissible:i,id:n,...t}),n};getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id))};function tr(e,t){let n=t?.id||er++;return Q.create({message:e,id:n,type:`default`,...t}),n}var nr=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,rr=tr,ir=Object.assign(rr,{success:Q.success,info:Q.info,warning:Q.warning,error:Q.error,custom:Q.custom,message:Q.message,promise:Q.promise,dismiss:Q.dismiss,loading:Q.loading},{getHistory:()=>Q.toasts,getToasts:()=>Q.getActiveToasts()});function ar(e){return e.label!==void 0}var or=3,sr=`24px`,cr=`16px`,lr=4e3,ur=356,dr=14,fr=45,pr=200;function mr(){let e=d(!1);return I(()=>{let t=()=>{e.value=document.hidden};return document.addEventListener(`visibilitychange`,t),()=>window.removeEventListener(`visibilitychange`,t)}),{isDocumentHidden:e}}function $(...e){return e.filter(Boolean).join(` `)}function hr(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}function gr(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?cr:sr;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var _r=[`data-rich-colors`,`data-styled`,`data-mounted`,`data-promise`,`data-swiped`,`data-removed`,`data-visible`,`data-y-position`,`data-x-position`,`data-index`,`data-front`,`data-swiping`,`data-dismissible`,`data-type`,`data-invert`,`data-swipe-out`,`data-swipe-direction`,`data-expanded`,`data-testid`],vr=[`aria-label`,`data-disabled`,`data-close-button-position`],yr=F({__name:`Toast`,props:{toast:{},toasts:{},index:{},swipeDirections:{},expanded:{type:Boolean},invert:{type:Boolean},heights:{},gap:{},position:{},closeButtonPosition:{},visibleToasts:{},expandByDefault:{type:Boolean},closeButton:{type:Boolean},interacting:{type:Boolean},style:{},cancelButtonStyle:{},actionButtonStyle:{},duration:{},class:{},unstyled:{type:Boolean},descriptionClass:{},loadingIcon:{},classes:{},icons:{},closeButtonAriaLabel:{},defaultRichColors:{type:Boolean}},emits:[`update:heights`,`update:height`,`removeToast`],setup(t,{emit:n}){let i=t,a=n,c=d(null),f=d(null),p=d(!1),m=d(!1),g=d(!1),_=d(!1),w=d(!1),T=d(0),D=d(0),k=d(i.toast.duration||i.duration||lr),A=d(null),N=d(null),ee=u(()=>i.index===0),te=u(()=>i.index+1<=i.visibleToasts),F=u(()=>i.toast.type),L=u(()=>i.toast.dismissible!==!1),ie=u(()=>i.toast.class||``),ae=u(()=>i.descriptionClass||``),oe=u(()=>{let e=i.toast.position||i.position,t=i.heights.filter(t=>t.position===e).findIndex(e=>e.toastId===i.toast.id);return t>=0?t:0}),se=u(()=>{let e=i.toast.position||i.position;return i.heights.filter(t=>t.position===e).reduce((e,t,n)=>n>=oe.value?e:e+t.height,0)}),ce=u(()=>oe.value*i.gap+se.value||0),le=u(()=>i.toast.closeButton??i.closeButton),ue=u(()=>i.toast.duration||i.duration||lr),de=d(0),fe=d(0),R=d(null),pe=u(()=>i.position.split(`-`)),me=u(()=>pe.value[0]),he=u(()=>pe.value[1]),ge=u(()=>typeof i.toast.title!=`string`),_e=u(()=>typeof i.toast.description!=`string`),{isDocumentHidden:ve}=mr(),ye=u(()=>F.value&&F.value===`loading`);O(()=>{p.value=!0,k.value=ue.value}),I(async()=>{if(!p.value||!N.value)return;await ne();let e=N.value,t=e.style.height;e.style.height=`auto`;let n=e.getBoundingClientRect().height;e.style.height=t,D.value=n,a(`update:height`,{toastId:i.toast.id,height:n,position:i.toast.position||i.position})});function z(){m.value=!0,T.value=ce.value,setTimeout(()=>{a(`removeToast`,i.toast)},pr)}function be(){if(ye.value||!L.value)return{};z(),i.toast.onDismiss?.(i.toast)}function xe(e){e.button!==2&&(ye.value||!L.value||(A.value=new Date,T.value=ce.value,e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(g.value=!0,R.value={x:e.clientX,y:e.clientY})))}function Se(){if(_.value||!L.value)return;R.value=null;let e=Number(N.value?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(N.value?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),n=new Date().getTime()-(A.value?.getTime()||0),r=c.value===`x`?e:t,a=Math.abs(r)/n;if(Math.abs(r)>=fr||a>.11){T.value=ce.value,i.toast.onDismiss?.(i.toast),c.value===`x`?f.value=e>0?`right`:`left`:f.value=t>0?`down`:`up`,z(),_.value=!0;return}else N.value?.style.setProperty(`--swipe-amount-x`,`0px`),N.value?.style.setProperty(`--swipe-amount-y`,`0px`);w.value=!1,g.value=!1,c.value=null}function Ce(e){if(!R.value||!L.value||(window?.getSelection()?.toString()?.length??!1))return;let t=e.clientY-R.value.y,n=e.clientX-R.value.x,r=i.swipeDirections??hr(i.position);!c.value&&(Math.abs(n)>1||Math.abs(t)>1)&&(c.value=Math.abs(n)>Math.abs(t)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(c.value===`y`){if(r.includes(`top`)||r.includes(`bottom`))if(r.includes(`top`)&&t<0||r.includes(`bottom`)&&t>0)a.y=t;else{let e=t*o(t);a.y=Math.abs(e)<Math.abs(t)?e:t}}else if(c.value===`x`&&(r.includes(`left`)||r.includes(`right`)))if(r.includes(`left`)&&n<0||r.includes(`right`)&&n>0)a.x=n;else{let e=n*o(n);a.x=Math.abs(e)<Math.abs(n)?e:n}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&(w.value=!0),N.value?.style.setProperty(`--swipe-amount-x`,`${a.x}px`),N.value?.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}O(()=>{if(p.value=!0,!N.value)return;let e=N.value.getBoundingClientRect().height;D.value=e,a(`update:heights`,[{toastId:i.toast.id,height:e,position:i.toast.position},...i.heights])}),E(()=>{N.value&&a(`removeToast`,i.toast)}),I(e=>{if(i.toast.promise&&F.value===`loading`||i.toast.duration===1/0||i.toast.type===`loading`)return;let t;i.expanded||i.interacting||ve.value?(()=>{if(fe.value<de.value){let e=new Date().getTime()-de.value;k.value-=e}fe.value=new Date().getTime()})():k.value!==1/0&&(de.value=new Date().getTime(),t=setTimeout(()=>{i.toast.onAutoClose?.(i.toast),z()},k.value)),e(()=>{clearTimeout(t)})}),r(()=>i.toast.delete,e=>{e!==void 0&&e&&(z(),i.toast.onDismiss?.(i.toast))},{deep:!0});function we(){g.value=!1,c.value=null,R.value=null}return(t,n)=>(M(),h(`li`,{tabindex:`0`,ref_key:`toastRef`,ref:N,class:P(o($)(i.class,ie.value,t.classes?.toast,t.toast.classes?.toast,t.classes?.[F.value],t.toast?.classes?.[F.value])),"data-sonner-toast":``,"data-rich-colors":t.toast.richColors??t.defaultRichColors,"data-styled":!(t.toast.component||t.toast?.unstyled||t.unstyled),"data-mounted":p.value,"data-promise":!!t.toast.promise,"data-swiped":w.value,"data-removed":m.value,"data-visible":te.value,"data-y-position":me.value,"data-x-position":he.value,"data-index":t.index,"data-front":ee.value,"data-swiping":g.value,"data-dismissible":L.value,"data-type":F.value,"data-invert":t.toast.invert||t.invert,"data-swipe-out":_.value,"data-swipe-direction":f.value,"data-expanded":!!(t.expanded||t.expandByDefault&&p.value),"data-testid":t.toast.testId,style:b({"--index":t.index,"--toasts-before":t.index,"--z-index":t.toasts.length-t.index,"--offset":`${m.value?T.value:ce.value}px`,"--initial-height":t.expandByDefault?`auto`:`${D.value}px`,...t.style,...i.toast.style}),onDragend:we,onPointerdown:xe,onPointerup:Se,onPointermove:Ce},[le.value&&!t.toast.component&&F.value!==`loading`?(M(),h(`button`,{key:0,"aria-label":t.closeButtonAriaLabel||`Close toast`,"data-disabled":ye.value,"data-close-button":`true`,"data-close-button-position":t.closeButtonPosition,class:P(o($)(t.classes?.closeButton,t.toast?.classes?.closeButton)),onClick:be},[t.icons?.close?(M(),y(re(t.icons?.close),{key:0})):C(t.$slots,`close-icon`,{key:1})],10,vr)):S(`v-if`,!0),t.toast.component?(M(),y(re(t.toast.component),j({key:1},t.toast.componentProps,{onCloseToast:be,isPaused:t.$props.expanded||t.$props.interacting||o(ve)}),null,16,[`isPaused`])):(M(),h(s,{key:2},[F.value!==`default`||t.toast.icon||t.toast.promise?(M(),h(`div`,{key:0,"data-icon":``,class:P(o($)(t.classes?.icon,t.toast?.classes?.icon))},[t.toast.icon?(M(),y(re(t.toast.icon),{key:0})):(M(),h(s,{key:1},[F.value===`loading`?C(t.$slots,`loading-icon`,{key:0}):F.value===`success`?C(t.$slots,`success-icon`,{key:1}):F.value===`error`?C(t.$slots,`error-icon`,{key:2}):F.value===`warning`?C(t.$slots,`warning-icon`,{key:3}):F.value===`info`?C(t.$slots,`info-icon`,{key:4}):S(`v-if`,!0)],64))],2)):S(`v-if`,!0),x(`div`,{"data-content":``,class:P(o($)(t.classes?.content,t.toast?.classes?.content))},[x(`div`,{"data-title":``,class:P(o($)(t.classes?.title,t.toast.classes?.title))},[ge.value?(M(),y(re(t.toast.title),l(j({key:0},t.toast.componentProps)),null,16)):(M(),h(s,{key:1},[e(v(t.toast.title),1)],64))],2),t.toast.description?(M(),h(`div`,{key:0,"data-description":``,class:P(o($)(t.descriptionClass,ae.value,t.classes?.description,t.toast.classes?.description))},[_e.value?(M(),y(re(t.toast.description),l(j({key:0},t.toast.componentProps)),null,16)):(M(),h(s,{key:1},[e(v(t.toast.description),1)],64))],2)):S(`v-if`,!0)],2),t.toast.cancel?(M(),h(`button`,{key:1,style:b(t.toast.cancelButtonStyle||t.cancelButtonStyle),class:P(o($)(t.classes?.cancelButton,t.toast.classes?.cancelButton)),"data-button":``,"data-cancel":``,onClick:n[0]||=e=>{o(ar)(t.toast.cancel)&&L.value&&(t.toast.cancel.onClick?.(e),z())}},v(o(ar)(t.toast.cancel)?t.toast.cancel?.label:t.toast.cancel),7)):S(`v-if`,!0),t.toast.action?(M(),h(`button`,{key:2,style:b(t.toast.actionButtonStyle||t.actionButtonStyle),class:P(o($)(t.classes?.actionButton,t.toast.classes?.actionButton)),"data-button":``,"data-action":``,onClick:n[1]||=e=>{o(ar)(t.toast.action)&&(t.toast.action.onClick?.(e),!e.defaultPrevented&&z())}},v(o(ar)(t.toast.action)?t.toast.action?.label:t.toast.action),7)):S(`v-if`,!0)],64))],46,_r))}}),br=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},xr={},Sr={xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stoke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`};function Cr(e,t){return M(),h(`svg`,Sr,t[0]||=[x(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`},null,-1),x(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`},null,-1)])}var wr=br(xr,[[`render`,Cr]]),Tr=[`data-visible`],Er={class:`sonner-spinner`},Dr=F({__name:`Loader`,props:{visible:{type:Boolean}},setup(e){let t=Array(12).fill(0);return(e,n)=>(M(),h(`div`,{class:`sonner-loading-wrapper`,"data-visible":e.visible},[x(`div`,Er,[(M(!0),h(s,null,k(o(t),e=>(M(),h(`div`,{key:`spinner-bar-${e}`,class:`sonner-loading-bar`}))),128))])],8,Tr))}}),Or={},kr={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function Ar(e,t){return M(),h(`svg`,kr,t[0]||=[x(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,"clip-rule":`evenodd`},null,-1)])}var jr=br(Or,[[`render`,Ar]]),Mr={},Nr={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function Pr(e,t){return M(),h(`svg`,Nr,t[0]||=[x(`path`,{"fill-rule":`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,"clip-rule":`evenodd`},null,-1)])}var Fr=br(Mr,[[`render`,Pr]]),Ir={},Lr={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`};function Rr(e,t){return M(),h(`svg`,Lr,t[0]||=[x(`path`,{"fill-rule":`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,"clip-rule":`evenodd`},null,-1)])}var zr=br(Ir,[[`render`,Rr]]),Br={},Vr={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function Hr(e,t){return M(),h(`svg`,Vr,t[0]||=[x(`path`,{"fill-rule":`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,"clip-rule":`evenodd`},null,-1)])}var Ur=br(Br,[[`render`,Hr]]),Wr=[`aria-label`],Gr=[`data-sonner-theme`,`dir`,`data-theme`,`data-rich-colors`,`data-y-position`,`data-x-position`],Kr=typeof window<`u`&&typeof document<`u`;function qr(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}var Jr=F({name:`Toaster`,inheritAttrs:!1,__name:`Toaster`,props:{id:{},invert:{type:Boolean,default:!1},theme:{default:`light`},position:{default:`bottom-right`},closeButtonPosition:{default:`top-left`},hotkey:{default:()=>[`altKey`,`KeyT`]},richColors:{type:Boolean,default:!1},expand:{type:Boolean,default:!1},duration:{},gap:{default:dr},visibleToasts:{default:or},closeButton:{type:Boolean,default:!1},toastOptions:{default:()=>({})},class:{default:``},style:{},offset:{default:sr},mobileOffset:{default:cr},dir:{default:`auto`},swipeDirections:{},icons:{},containerAriaLabel:{default:`Notifications`}},setup(e){let t=e,n=T(),r=d([]),a=u(()=>t.id?r.value.filter(e=>e.toasterId===t.id):r.value.filter(e=>!e.toasterId));function c(e,t){return a.value.filter(n=>!n.position&&t===0||n.position===e)}let l=u(()=>{let e=a.value.filter(e=>e.position).map(e=>e.position);return e.length>0?Array.from(new Set([t.position].concat(e))):[t.position]}),f=u(()=>{let e={};return l.value.forEach(t=>{e[t]=r.value.filter(e=>e.position===t)}),e}),p=d([]),m=d({}),g=d(!1);I(()=>{l.value.forEach(e=>{e in m.value||(m.value[e]=!1)})});let _=d(t.theme===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:t.theme),v=d(null),w=d(null),E=d(!1),O=t.hotkey.join(`+`).replace(/Key/g,``).replace(/Digit/g,``);function A(e){r.value.find(t=>t.id===e.id)?.delete||Q.dismiss(e.id),r.value=r.value.filter(({id:t})=>t!==e.id),setTimeout(()=>{r.value.find(t=>t.id===e.id)||(p.value=p.value.filter(t=>t.toastId!==e.id))},pr+50)}function N(e){E.value&&!e.currentTarget?.contains?.(e.relatedTarget)&&(E.value=!1,w.value&&=(w.value.focus({preventScroll:!0}),null))}function ee(e){e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||E.value||(E.value=!0,w.value=e.relatedTarget)}function te(e){e.target&&e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||(g.value=!0)}I(e=>{e(Q.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{r.value=r.value.map(t=>t.id===e.id?{...t,delete:!0}:t)});return}ne(()=>{let t=r.value.findIndex(t=>t.id===e.id);t===-1?r.value=[e,...r.value]:r.value=[...r.value.slice(0,t),{...r.value[t],...e},...r.value.slice(t+1)]})}))}),I(e=>{if(typeof window>`u`)return;if(t.theme!==`system`){_.value=t.theme;return}let n=window.matchMedia(`(prefers-color-scheme: dark)`),r=e=>{_.value=e?`dark`:`light`};r(n.matches);let i=e=>{r(e.matches)};try{n.addEventListener(`change`,i)}catch{n.addListener(i)}e(()=>{try{n.removeEventListener(`change`,i)}catch{n.removeListener(i)}})}),I(()=>{v.value&&w.value&&(w.value.focus({preventScroll:!0}),w.value=null,E.value=!1)}),I(()=>{r.value.length<=1&&Object.keys(m.value).forEach(e=>{m.value[e]=!1})}),I(e=>{function n(e){let n=t.hotkey.every(t=>e[t]||e.code===t),r=Array.isArray(v.value)?v.value[0]:v.value;n&&(l.value.forEach(e=>{m.value[e]=!0}),r?.focus());let i=document.activeElement===v.value||r?.contains(document.activeElement);e.code===`Escape`&&i&&l.value.forEach(e=>{m.value[e]=!1})}Kr&&(document.addEventListener(`keydown`,n),e(()=>{document.removeEventListener(`keydown`,n)}))});function F(e){let t=e.currentTarget,n=t.getAttribute(`data-y-position`)+`-`+t.getAttribute(`data-x-position`);m.value[n]=!0}function re(e){if(!g.value){let t=e.currentTarget,n=t.getAttribute(`data-y-position`)+`-`+t.getAttribute(`data-x-position`);m.value[n]=!1}}function L(){Object.keys(m.value).forEach(e=>{m.value[e]=!1})}function ie(){g.value=!1}function ae(e){p.value=e}function oe(e){let t=p.value.findIndex(t=>t.toastId===e.toastId);if(t!==-1)p.value[t]=e;else{let t=p.value.findIndex(t=>t.position===e.position);t===-1?p.value.unshift(e):p.value.splice(t,0,e)}}return(e,r)=>(M(),h(s,null,[S(` Remove item from normal navigation flow, only available via hotkey `),x(`section`,{"aria-label":`${e.containerAriaLabel} ${o(O)}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`},[(M(!0),h(s,null,k(l.value,(r,a)=>(M(),h(`ol`,j({key:r,ref_for:!0,ref_key:`listRef`,ref:v,"data-sonner-toaster":``,"data-sonner-theme":_.value,class:t.class,dir:e.dir===`auto`?qr():e.dir,tabIndex:-1,"data-theme":e.theme,"data-rich-colors":e.richColors,"data-y-position":r.split(`-`)[0],"data-x-position":r.split(`-`)[1],style:{"--front-toast-height":`${p.value[0]?.height||0}px`,"--width":`${o(ur)}px`,"--gap":`${e.gap}px`,...e.style,...o(n).style,...o(gr)(e.offset,e.mobileOffset)}},{ref_for:!0},e.$attrs,{onBlur:N,onFocus:ee,onMouseenter:F,onMousemove:F,onMouseleave:re,onDragend:L,onPointerdown:te,onPointerup:ie}),[(M(!0),h(s,null,k(c(r,a),(n,a)=>(M(),y(yr,{key:n.id,heights:p.value,icons:e.icons,index:a,toast:n,defaultRichColors:e.richColors,duration:e.toastOptions?.duration??e.duration,class:P(e.toastOptions?.class??``),descriptionClass:e.toastOptions?.descriptionClass,invert:e.invert,visibleToasts:e.visibleToasts,closeButton:e.toastOptions?.closeButton??e.closeButton,interacting:g.value,position:r,closeButtonPosition:e.toastOptions?.closeButtonPosition??e.closeButtonPosition,style:b(e.toastOptions?.style),unstyled:e.toastOptions?.unstyled,classes:e.toastOptions?.classes,cancelButtonStyle:e.toastOptions?.cancelButtonStyle,actionButtonStyle:e.toastOptions?.actionButtonStyle,"close-button-aria-label":e.toastOptions?.closeButtonAriaLabel,toasts:f.value[r],expandByDefault:e.expand,gap:e.gap,expanded:m.value[r]||!1,swipeDirections:t.swipeDirections,"onUpdate:heights":ae,"onUpdate:height":oe,onRemoveToast:A},{"close-icon":i(()=>[C(e.$slots,`close-icon`,{},()=>[D(wr)])]),"loading-icon":i(()=>[C(e.$slots,`loading-icon`,{},()=>[D(Dr,{visible:n.type===`loading`},null,8,[`visible`])])]),"success-icon":i(()=>[C(e.$slots,`success-icon`,{},()=>[D(jr)])]),"error-icon":i(()=>[C(e.$slots,`error-icon`,{},()=>[D(Ur)])]),"warning-icon":i(()=>[C(e.$slots,`warning-icon`,{},()=>[D(zr)])]),"info-icon":i(()=>[C(e.$slots,`info-icon`,{},()=>[D(Fr)])]),_:2},1032,[`heights`,`icons`,`index`,`toast`,`defaultRichColors`,`duration`,`class`,`descriptionClass`,`invert`,`visibleToasts`,`closeButton`,`interacting`,`position`,`closeButtonPosition`,`style`,`unstyled`,`classes`,`cancelButtonStyle`,`actionButtonStyle`,`close-button-aria-label`,`toasts`,`expandByDefault`,`gap`,`expanded`,`swipeDirections`]))),128))],16,Gr))),128))],8,Wr)],2112))}});export{ve as A,pe as C,z as D,ye as E,Oe as F,ke as I,de as L,Te as M,De as N,Se as O,R as P,ce as R,fe as S,he as T,Dn as _,Gn as a,He as b,Qn as c,Rn as d,Vn as f,Nn as g,jn as h,Wn as i,Ee as j,xe as k,Yn as l,kn as m,ir as n,qn as o,En as p,Un as r,Jn as s,Jr as t,$n as u,On as v,me as w,Ne as x,An as y,ae as z}; |