epic-modals 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -63,6 +63,7 @@ export declare function restoreModal(id: ModalId): void;
63
63
  export declare function restoreAllMinimizedModals(): void;
64
64
  /**
65
65
  * Restore a child modal that was hidden with parent
66
+ * Recursively restores all descendants (grandchildren, etc.)
66
67
  */
67
68
  export declare function restoreChildModal(id: ModalId): void;
68
69
  /**
@@ -87,6 +88,7 @@ export declare function updateModal(id: ModalId, updates: Partial<ModalState>):
87
88
  /**
88
89
  * Bring a modal to the front (highest z-index)
89
90
  * Maintains parent-child z-index relationship: child always above parent
91
+ * When clicking on any modal in a chain, the ENTIRE chain is brought to front
90
92
  */
91
93
  export declare function bringToFront(id: ModalId): void;
92
94
  /**
@@ -147,6 +149,7 @@ export declare function openChildModal(child: {
147
149
  export declare function linkModals(parentId: ModalId, childId: ModalId): void;
148
150
  /**
149
151
  * Hide a child modal when its parent is minimized
152
+ * Recursively hides all descendants (grandchildren, etc.)
150
153
  */
151
154
  export declare function hideChildWithParent(parentId: ModalId): void;
152
155
  /**
package/dist/core.js CHANGED
@@ -1 +1 @@
1
- import*as t from"svelte/internal/client";const e={BASE:0,DROPDOWN:100,STICKY:200,OVERLAY:300,MODAL:400,DOCK:8e3,TOAST:9e3};let n=t.state(t.proxy(e.MODAL));function i(){t.set(n,oe().zIndex.base,!0)}function s(){const e=t.get(n);return t.set(n,t.get(n)+2),e}function o(t){const n=oe();return"MODAL"===t?n.zIndex.base:"DOCK"===t?n.zIndex.dock:"TOAST"===t?n.zIndex.toast:e[t]}function a(){t.set(n,oe().zIndex.base,!0)}const r=8;function d(t,e,n,i,s={}){const{margin:o=r,allowPartialVisibility:a=!1}=s,d="undefined"!=typeof window?window.innerWidth:1920,c="undefined"!=typeof window?window.innerHeight:1080;let u,l,f,g;return a&&n>d-2*o?(u=40-n,l=d-40):(u=o,l=Math.max(o,d-n-o)),a&&i>c-2*o?(f=40-i,g=c-40):(f=o,g=Math.max(o,c-i-o)),{x:Math.max(u,Math.min(l,t)),y:Math.max(f,Math.min(g,e))}}function c(t,e,n,i,s={}){const{margin:o=r}=s,a=("undefined"!=typeof window?window.innerWidth:1920)-2*o,c=("undefined"!=typeof window?window.innerHeight:1080)-2*o,u=Math.min(n,a),l=Math.min(i,c),f=d(t,e,u,l,s);return{x:f.x,y:f.y,width:u,height:l}}function u(t,e){return Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x))*Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y))}function l(t,e,n,i,s,o){const a={x:t-o,y:e-o,width:n+2*o,height:i+2*o};let r=0;for(const t of s)r+=u(a,t);return r}function f(t){if("undefined"==typeof document)return[];const e=[];for(const n of t)try{const t=document.querySelectorAll(n);for(const n of t){const t=n.getBoundingClientRect();t.width>0&&t.height>0&&e.push({x:t.left,y:t.top,width:t.width,height:t.height})}}catch{}return e}function g(t,e,n,i,s,o,a){const r=(s-n)/2,d=(o-i)/2,c=r-a,u=d-a,l=Math.abs(t-r)/(c||1),f=Math.abs(e-d)/(u||1),g=Math.sqrt(l*l+f*f)/Math.SQRT2,h=50,p=t-a,m=s-n-a-t,x=e-a,I=o-i-a-e;let y=0;return p<h&&(y+=.3*(1-p/h)),m<h&&(y+=.3*(1-m/h)),x<h&&(y+=.2*(1-x/h)),I<h&&(y+=.2*(1-I/h)),Math.min(1,g+y)}function h(t,e,n,i={}){const{modalGap:s=16,gridResolution:o=10,avoidBounds:a=[],avoidMargin:r=16}=i,d=i.margin??s,c="undefined"!=typeof window?window.innerWidth:1920,u="undefined"!=typeof window?window.innerHeight:1080,f=a.map(t=>({x:t.x-r,y:t.y-r,width:t.width+2*r,height:t.height+2*r})),h={x:(c-t)/2,y:(u-e)/2};if(0===n.length&&0===f.length)return h;const p=d,m=Math.max(d,c-t-d),x=d,I=Math.max(d,u-e-d);if(m<=p||I<=x)return h;const y=l(h.x,h.y,t,e,n,s),w=l(h.x,h.y,t,e,f,0);if(0===y&&0===w)return h;const z=[],M=(m-p)/o,v=(I-x)/o;for(let i=0;i<=o;i++)for(let a=0;a<=o;a++){const o=p+i*M,r=x+a*v,h=l(o,r,t,e,n,s),m=l(o,r,t,e,f,0),I=g(o,r,t,e,c,u,d);z.push({pos:{x:o,y:r},modalOverlap:h,avoidOverlap:m,centerDist:I})}const O=z.filter(t=>0===t.avoidOverlap),P=O.length>0?O:z,C=t*e,D=Math.min(...P.map(t=>t.modalOverlap))/C;return P.sort((t,e)=>{if(0===O.length&&t.avoidOverlap!==e.avoidOverlap)return t.avoidOverlap-e.avoidOverlap;const n=t.modalOverlap/C,i=e.modalOverlap/C;if(D<.3){const s=.3,o=n<=s,a=i<=s;if(o&&a)return t.centerDist+.3*n-(e.centerDist+.3*i);if(o)return-1;if(a)return 1}return.6*n+.4*t.centerDist-(.6*i+.4*e.centerDist)}),P[0].pos}function p(t,e,n,i={}){const{modalGap:s=16}=i,o=i.margin??s,a="undefined"!=typeof window?window.innerWidth:1920,r="undefined"!=typeof window?window.innerHeight:1080,d=n.reduce((t,e)=>t+e.width,0)+t,c=n.length*s,u=a-2*o;if(d+c>u)return null;const l=u-d-c;n.length;const f=l/2,g=a/2,h=[...n.map(t=>({id:t.id,width:t.width,height:t.height,currentX:t.x+t.width/2,currentY:t.y,isNew:!1})),{id:"__new__",width:t,height:e,currentX:g,currentY:(r-e)/2,isNew:!0}];h.sort((t,e)=>t.currentX-e.currentX);let p=o+f;const m=new Map;let x=null;for(const t of h){const e=p;if(t.isNew)x={x:Math.round(e),y:Math.round(t.currentY)};else{const i=n.find(e=>e.id===t.id);Math.abs(e-i.x)>5&&m.set(t.id,{x:Math.round(e),y:Math.round(i.y)})}p+=t.width+s}return x?{newModalPosition:x,existingModalMoves:m}:null}function m(t){return"symbol"==typeof t?t.description??"symbol":t}let x=t.proxy(new Map),I=t.state(0);const y=new Set;function w(){t.update(I),queueMicrotask(()=>{y.forEach(t=>t())})}function z(t){return y.add(t),()=>y.delete(t)}let M=t.state(t.proxy([])),v=t.state(t.proxy([])),O=t.state(t.proxy([])),P=t.state(t.proxy([])),C=t.state(t.proxy([])),D=t.state(t.proxy([])),k=t.state(t.proxy([])),b=t.state(t.proxy([])),A=t.state(null),T=t.proxy(new Map),F=t.state(null),W=t.proxy(new Map),H=t.proxy(new Set),B=t.proxy(new Set),R=t.state(t.proxy([])),S=null,X=null;function E(e){const n=x.get(e.id),i=(null==n?void 0:n.zIndex)??s();n?x.set(e.id,{...n,title:e.title,icon:e.icon,glow:e.glow,zIndex:i}):x.set(e.id,{...e,zIndex:i,isAnimating:!1}),w(),e.isMinimized&&!t.get(R).includes(e.id)&&t.get(R).push(e.id)}function q(e){const n=x.get(e);if(n){if(t.set(R,t.get(R).filter(t=>t!==e),!0),n.childId){const t=x.get(n.childId);t&&x.set(n.childId,{...t,parentId:void 0})}if(n.parentId){const t=x.get(n.parentId);t&&x.set(n.parentId,{...t,childId:void 0,lastChildId:n.id})}x.delete(e),w(),B.delete(e),H.delete(e)}}function Y(e){const n=x.get(e);if(!n||n.isMinimized)return;if(jt(e),n.parentId){const t=x.get(n.parentId);if(t&&!t.isMinimized)return void Y(n.parentId)}if(t.set(M,[...t.get(M),e],!0),n.position&&n.size&&X){const i=X(),s=t.get(R).indexOf(e),o=i.x+s*(i.height+8),a=i.y;t.set(A,{x:o,y:a,originX:n.position.x+n.size.width/2,originY:n.position.y+n.size.height/2},!0)}const i=n.childId;x.set(e,{...n,isMinimized:!0,lastChildId:i}),w(),t.get(R).includes(e)||t.get(R).push(e),n.childId&&ot(e)}function L(e){const n=x.get(e);if(!n||!n.isMinimized)return;x.set(e,{...n,isMinimized:!1,isOpen:!0}),w(),t.set(C,[...t.get(C),e],!0),V(e);const i=n.lastChildId||n.childId;i&&_(i)}function N(){Array.from(x.values()).filter(t=>t.isMinimized).map(t=>t.id).forEach(e=>{const n=x.get(e);if(n){x.set(e,{...n,isMinimized:!1,isOpen:!0}),t.set(C,[...t.get(C),e],!0),V(e);const i=n.lastChildId||n.childId;i&&_(i)}}),t.set(R,[],!0),w()}function _(e){const n=x.get(e);n&&n.isHiddenWithParent&&(x.set(e,{...n,isHiddenWithParent:!1}),w(),t.set(D,[...t.get(D),e],!0))}function G(t,e,n){const i=x.get(t);if(!i)return;let s=e;if((null==n?void 0:n.constrain)&&i.size&&(s=d(e.x,e.y,i.size.width,i.size.height)),x.set(t,{...i,position:s,size:(null==n?void 0:n.size)??i.size,hasBeenDragged:i.hasBeenDragged||(null==n?void 0:n.drag)||!1}),i.childId){let e=t,n=s;for(;;){const t=x.get(e);if(!(null==t?void 0:t.childId))break;const i=x.get(t.childId);if(!(null==i?void 0:i.offsetFromParent))break;const s={x:n.x+i.offsetFromParent.x,y:n.y+i.offsetFromParent.y};x.set(t.childId,{...i,position:s,hasBeenDragged:!0}),e=t.childId,n=s}}if(i.parentId&&i.offsetFromParent){const e=oe();let n=t,o=i;for(;o.parentId&&o.offsetFromParent;){const i=x.get(o.parentId);if(!i)break;const a=n===t?s:x.get(n).position,r={x:a.x-o.offsetFromParent.x,y:a.y-o.offsetFromParent.y};"animated"===e.parentChild.movementMode?W.set(o.parentId,r):x.set(o.parentId,{...i,position:r,hasBeenDragged:!0}),n=o.parentId,o=i}}w()}function K(t,e){const n=x.get(t);n&&(x.set(t,{...n,size:e}),w())}function j(t,e){const n=x.get(t);n&&(x.set(t,{...n,...e}),w())}function V(t){var e;const n=x.get(t);if(!n)return;const i=Math.max(...Array.from(x.values()).map(t=>t.zIndex),0);if(n.parentId){const s=x.get(n.parentId);s&&s.zIndex<i&&x.set(n.parentId,{...s,zIndex:i+2});const o=(null==(e=x.get(n.parentId))?void 0:e.zIndex)??i+2;return n.zIndex<=o&&x.set(t,{...n,zIndex:o+2}),void w()}if(n.zIndex<i&&(x.set(t,{...n,zIndex:i+2}),w()),n.childId){const e=x.get(n.childId),i=x.get(t);e&&i&&e.zIndex<=i.zIndex&&(x.set(n.childId,{...e,zIndex:i.zIndex+2}),w())}}function $(t){const e=x.get(t);if(!e)return!1;const n=Math.max(...Array.from(x.values()).map(t=>t.zIndex),0);return e.zIndex===n&&!e.isMinimized&&!e.isHiddenWithParent}function Q(e){t.set(R,e,!0)}function J(e,n,i){const s=n.getBoundingClientRect();T.set(e,{x:s.left+s.width/2,y:s.top+s.height/2});const o=oe();(null==i?void 0:i.parentId)&&o.features.parentChild&&t.set(F,{parentId:i.parentId,childId:e},!0),t.get(v).includes(e)||t.set(v,[...t.get(v),e],!0),w();const a=x.get(e);if(a){if(a.isOpen&&!a.isMinimized&&!a.isHiddenWithParent)return t.set(v,t.get(v).filter(t=>t!==e),!0),bt(e),void V(e);if(a.isMinimized)return t.set(v,t.get(v).filter(t=>t!==e),!0),void L(e);x.set(e,{...a,isOpen:!0}),V(e),null==S||S.push(e)}}function U(e){E(e);const n=x.get(e.id);n&&(x.set(e.id,{...n,isOpen:!0}),w()),t.set(v,[...t.get(v),e.id],!0),w(),V(e.id),null==S||S.push(e.id)}function Z(e,n=!1){const i=x.get(e);i&&(jt(e),n?t.set(P,[...t.get(P),e],!0):t.set(O,[...t.get(O),e],!0),w(),i.childId&&Z(i.childId,n),null==S||S.pop())}function tt(){Array.from(x.keys()).forEach(t=>Z(t,!0))}function et(t){const e=x.get(t);if(e){if(e.parentId){const n=x.get(e.parentId);n&&n.childId===t&&x.set(e.parentId,{...n,childId:void 0,lastChildId:t})}x.set(t,{...e,isOpen:!1,isMinimized:!1,isHiddenWithParent:!1,isTransparent:!1,position:null,size:null,hasBeenDragged:!1,parentId:void 0,childId:void 0,offsetFromParent:void 0}),w()}}function nt(t){const e=x.get(t);if(!e)return[t];const n=[t];return e.childId&&n.push(...nt(e.childId)),n}function it(e,n,i){const s=oe();if(i&&!T.has(e.id)){const t=i.getBoundingClientRect();T.set(e.id,{x:t.left+t.width/2,y:t.top+t.height/2})}const o={id:e.id,title:e.title??"",icon:e.icon??"",isOpen:!0,isMinimized:!1,isHiddenWithParent:!1,isTransparent:e.isTransparent??!1,isRejected:!1,position:e.position??null,size:e.size??null,hasBeenDragged:e.hasBeenDragged??!1,dockPosition:e.dockPosition??-1,glow:e.glow??null};if(!s.features.parentChild){E(o);const n=x.get(e.id);return n&&x.set(e.id,{...n,isOpen:!0}),t.set(v,[...t.get(v),e.id],!0),w(),void V(e.id)}const a=x.get(n);if(!a)return;a.childId&&Z(a.childId,!0),E({...o,parentId:n});const r=x.get(e.id);r&&x.set(e.id,{...r,isOpen:!0,parentId:n}),t.set(v,[...t.get(v),e.id],!0),w(),V(e.id),t.set(F,{parentId:n,childId:e.id},!0)}function st(t,e){if(!oe().features.parentChild)return;const n=x.get(t),i=x.get(e);if(!n||!i)return;let s={x:40,y:40};n.position&&i.position&&(s={x:i.position.x-n.position.x,y:i.position.y-n.position.y});const o=Math.max(i.zIndex,n.zIndex+1);x.set(t,{...n,childId:e,lastChildId:e}),x.set(e,{...i,parentId:t,offsetFromParent:s,zIndex:o}),w()}function ot(t){const e=x.get(t);if(!(null==e?void 0:e.childId))return;const n=x.get(e.childId);n&&(x.set(e.childId,{...n,isHiddenWithParent:!0}),w())}function at(t,e){const n=x.get(t);if(!(null==n?void 0:n.childId))return;const i=x.get(n.childId);if(!i||!i.offsetFromParent)return;const s={x:e.x+i.offsetFromParent.x,y:e.y+i.offsetFromParent.y};x.set(n.childId,{...i,position:s}),w()}function rt(t,e){const n=x.get(t),i=x.get(e);if(!(null==n?void 0:n.position)||!(null==i?void 0:i.position))return;const s={x:n.position.x-i.position.x,y:n.position.y-i.position.y};x.set(t,{...n,offsetFromParent:s}),w()}function dt(e){return t.get(M).includes(e)}function ct(e){return!!t.get(M).includes(e)&&(t.set(M,t.get(M).filter(t=>t!==e),!0),!0)}function ut(){return t.get(M).length>0}function lt(){return Array.from(x.keys())}function ft(t){return x.get(t)}function gt(t){const e=[];for(const[n,i]of x.entries())if(n!==t&&i.isOpen&&!i.isMinimized&&!i.isHiddenWithParent&&!i.parentId)if(i.position&&i.size)e.push({id:m(n),x:i.position.x,y:i.position.y,width:i.size.width,height:i.size.height});else{const t=document.querySelector(`[data-modal-id="${m(n)}"]`);if(t){const i=t.getBoundingClientRect();e.push({id:m(n),x:i.left,y:i.top,width:i.width,height:i.height})}}return e}function ht(t){const e=[];for(const[n,i]of x.entries())if(n!==t&&i.isOpen&&!i.isMinimized&&!i.isHiddenWithParent)if(i.position&&i.size)e.push({x:i.position.x,y:i.position.y,width:i.size.width,height:i.size.height});else{const t=document.querySelector(`[data-modal-id="${m(n)}"]`);if(t){const n=t.getBoundingClientRect();e.push({x:n.left,y:n.top,width:n.width,height:n.height})}}return e}function pt(){return t.get(I)}function mt(){const e=t.get(A);return t.set(A,null),e}function xt(e){return t.get(v).includes(e)}function It(e){return!!t.get(v).includes(e)&&(t.set(v,t.get(v).filter(t=>t!==e),!0),!0)}function yt(e){return t.get(O).includes(e)}function wt(e){return!!t.get(O).includes(e)&&(t.set(O,t.get(O).filter(t=>t!==e),!0),!0)}function zt(e){return t.get(P).includes(e)}function Mt(e){return!!t.get(P).includes(e)&&(t.set(P,t.get(P).filter(t=>t!==e),!0),!0)}function vt(e){return t.get(C).includes(e)}function Ot(e){return!!t.get(C).includes(e)&&(t.set(C,t.get(C).filter(t=>t!==e),!0),!0)}function Pt(e){return t.get(D).includes(e)}function Ct(e){return!!t.get(D).includes(e)&&(t.set(D,t.get(D).filter(t=>t!==e),!0),!0)}function Dt(e){return t.get(k).includes(e)}function kt(e){return!!t.get(k).includes(e)&&(t.set(k,t.get(k).filter(t=>t!==e),!0),!0)}function bt(e){x.get(e)&&(t.get(k).includes(e)||t.get(b).includes(e)||(t.set(k,[...t.get(k),e],!0),w()))}function At(e){t.get(b).includes(e)||t.set(b,[...t.get(b),e],!0)}function Tt(e){t.set(b,t.get(b).filter(t=>t!==e),!0)}function Ft(){return t.get(F)}function Wt(e){if(!t.get(F)||t.get(F).childId!==e)return null;const n=t.get(F);return t.set(F,null),n}function Ht(t,e){T.set(t,e)}function Bt(t){const e=T.get(t);return e&&T.delete(t),e??null}function Rt(t,e){e?H.add(t):H.delete(t)}function St(t){return H.has(t)}function Xt(t){const e=x.get(t);return void 0!==e&&e.isOpen&&!e.isMinimized&&!e.isHiddenWithParent}function Et(t){return x.has(t)}function qt(){return{get modals(){return x},get pendingMinimize(){return t.get(M)},get pendingOpen(){return t.get(v)},get pendingClose(){return t.get(O)},get pendingRestore(){return t.get(C)},get dockOrder(){return t.get(R)}}}function Yt(t){B.has(t)?B.delete(t):B.add(t);const e=x.get(t);e&&(x.set(t,{...e,isTransparent:B.has(t)}),w())}function Lt(t){B.delete(t);const e=x.get(t);e&&(x.set(t,{...e,isTransparent:!1}),w())}function Nt(t){t.animate([{transform:"translateX(0)"},{transform:"translateX(-6px)"},{transform:"translateX(6px)"},{transform:"translateX(-6px)"},{transform:"translateX(6px)"},{transform:"translateX(0)"}],{duration:300,easing:"ease-in-out"})}function _t(t){const e=W.get(t);if(!e)return;const n=x.get(t);n&&(x.set(t,{...n,isAnimatingPosition:!0,position:e}),W.delete(t),w())}function Gt(t){const e=x.get(t);e&&(x.set(t,{...e,isAnimatingPosition:!1}),w())}function Kt(t){return W.has(t)}function jt(t){W.delete(t)}function Vt(t){const e=oe().parentChild.animationDuration;for(const[e,n]of t){const t=x.get(e);t&&x.set(e,{...t,position:n,isAnimatingPosition:!0,hasBeenDragged:!0})}w(),setTimeout(()=>{for(const e of t.keys()){const t=x.get(e);t&&x.set(e,{...t,isAnimatingPosition:!1})}w()},e)}function $t(t){const e=oe();if("animated"!==e.parentChild.movementMode)return;const n=e.parentChild.animationDuration,i=[];let s=t;for(;;){const t=x.get(s);if(!(null==t?void 0:t.parentId))break;i.push({parentId:t.parentId,childId:s}),s=t.parentId}i.forEach(({parentId:t,childId:e},i)=>{setTimeout(()=>{const i=x.get(e),s=x.get(t);if(!(null==i?void 0:i.position)||!i.offsetFromParent||!s)return;const o={x:i.position.x-i.offsetFromParent.x,y:i.position.y-i.offsetFromParent.y};W.set(t,o),_t(t),setTimeout(()=>Gt(t),n)},i*n)})}function Qt(t){}function Jt(t){S=t}function Ut(t){X=t}function Zt(){return{modals:x,pendingMinimize:t.get(M),pendingOpen:t.get(v),pendingClose:t.get(O),pendingRestore:t.get(C),dockOrder:t.get(R),animatingModals:H,transparentModals:B}}function te(){x.clear(),t.get(M).length=0,t.get(v).length=0,t.get(O).length=0,t.get(P).length=0,t.get(C).length=0,t.get(D).length=0,t.set(A,null),T.clear(),t.set(F,null),W.clear(),H.clear(),B.clear(),t.get(R).length=0,S=null,X=null}const ee={features:{dock:!0,minimize:!0,transparency:!0,resize:!0,drag:!0,focusTrap:!0,animations:!0,backdrop:!0,parentChild:!0},dock:{position:"bottom",labelMode:"beside",enableReorder:!0,enableFreeDrag:!0},animations:{open:400,close:250,minimize:500,restore:400},appearance:{headerLayout:"macos",defaultWidth:"480px",defaultHeight:"auto",minWidth:280,minHeight:200},zIndex:{base:400,dock:8e3,toast:9e3},parentChild:{movementMode:"animated",animationDuration:300},positioning:{strategy:"smart",modalGap:16,avoidElements:[]},portalTarget:"#modal-portal"};let ne={...ee},ie=t.state(0);function se(){return t.get(ie)}function oe(){return ne}function ae(e){const n=ne;ne=de(ee,e),t.update(ie),n.features.dock&&!ne.features.dock&&N()}function re(){ne={...ee},t.update(ie)}function de(t,e){return{features:{...t.features,...e.features},dock:{...t.dock,...e.dock},animations:{...t.animations,...e.animations},appearance:{...t.appearance,...e.appearance},zIndex:{...t.zIndex,...e.zIndex},parentChild:{...t.parentChild,...e.parentChild},positioning:{...t.positioning,...e.positioning},portalTarget:e.portalTarget??t.portalTarget}}function ce(t){return ne.features[t]}export{st as $,Mt as A,mt as B,j as C,ct as D,Ot as E,Ct as F,wt as G,et as H,xt as I,It as J,Bt as K,Dt as L,kt as M,At as N,Tt as O,Wt as P,Ft as Q,ht as R,f as S,h as T,l as U,gt as V,p as W,Vt as X,E as Y,$ as Z,Yt as _,Xt as a,o as a0,qt as a1,St as a2,Nt as a3,ae as a4,i as a5,re as a6,a as a7,ee as a8,de as a9,g as aA,z as aa,N as ab,_ as ac,K as ad,Q as ae,U as af,tt as ag,nt as ah,ot as ai,at as aj,rt as ak,ut as al,lt as am,Ht as an,Rt as ao,_t as ap,Gt as aq,Kt as ar,jt as as,Qt as at,Jt as au,Ut as av,Zt as aw,te as ax,s as ay,u as az,J as b,Z as c,V as d,d as e,c as f,oe as g,m as h,Et as i,ft as j,se as k,pt as l,Y as m,yt as n,it as o,dt as p,Pt as q,L as r,vt as s,bt as t,Lt as u,q as v,ce as w,G as x,$t as y,zt as z};
1
+ import*as t from"svelte/internal/client";const e={BASE:0,DROPDOWN:100,STICKY:200,OVERLAY:300,MODAL:400,DOCK:8e3,TOAST:9e3};let n=t.state(t.proxy(e.MODAL));function i(){t.set(n,ae().zIndex.base,!0)}function s(){const e=t.get(n);return t.set(n,t.get(n)+2),e}function o(t){const n=ae();return"MODAL"===t?n.zIndex.base:"DOCK"===t?n.zIndex.dock:"TOAST"===t?n.zIndex.toast:e[t]}function a(){t.set(n,ae().zIndex.base,!0)}const r=8;function d(t,e,n,i,s={}){const{margin:o=r,allowPartialVisibility:a=!1}=s,d="undefined"!=typeof window?window.innerWidth:1920,c="undefined"!=typeof window?window.innerHeight:1080;let u,l,f,g;return a&&n>d-2*o?(u=40-n,l=d-40):(u=o,l=Math.max(o,d-n-o)),a&&i>c-2*o?(f=40-i,g=c-40):(f=o,g=Math.max(o,c-i-o)),{x:Math.max(u,Math.min(l,t)),y:Math.max(f,Math.min(g,e))}}function c(t,e,n,i,s={}){const{margin:o=r}=s,a=("undefined"!=typeof window?window.innerWidth:1920)-2*o,c=("undefined"!=typeof window?window.innerHeight:1080)-2*o,u=Math.min(n,a),l=Math.min(i,c),f=d(t,e,u,l,s);return{x:f.x,y:f.y,width:u,height:l}}function u(t,e){return Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x))*Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y))}function l(t,e,n,i,s,o){const a={x:t-o,y:e-o,width:n+2*o,height:i+2*o};let r=0;for(const t of s)r+=u(a,t);return r}function f(t){if("undefined"==typeof document)return[];const e=[];for(const n of t)try{const t=document.querySelectorAll(n);for(const n of t){const t=n.getBoundingClientRect();t.width>0&&t.height>0&&e.push({x:t.left,y:t.top,width:t.width,height:t.height})}}catch{}return e}function g(t,e,n,i,s,o,a){const r=(s-n)/2,d=(o-i)/2,c=r-a,u=d-a,l=Math.abs(t-r)/(c||1),f=Math.abs(e-d)/(u||1),g=Math.sqrt(l*l+f*f)/Math.SQRT2,h=50,p=t-a,m=s-n-a-t,x=e-a,I=o-i-a-e;let y=0;return p<h&&(y+=.3*(1-p/h)),m<h&&(y+=.3*(1-m/h)),x<h&&(y+=.2*(1-x/h)),I<h&&(y+=.2*(1-I/h)),Math.min(1,g+y)}function h(t,e,n,i={}){const{modalGap:s=16,gridResolution:o=10,avoidBounds:a=[],avoidMargin:r=16}=i,d=i.margin??s,c="undefined"!=typeof window?window.innerWidth:1920,u="undefined"!=typeof window?window.innerHeight:1080,f=a.map(t=>({x:t.x-r,y:t.y-r,width:t.width+2*r,height:t.height+2*r})),h={x:(c-t)/2,y:(u-e)/2};if(0===n.length&&0===f.length)return h;const p=d,m=Math.max(d,c-t-d),x=d,I=Math.max(d,u-e-d);if(m<=p||I<=x)return h;const y=l(h.x,h.y,t,e,n,s),w=l(h.x,h.y,t,e,f,0);if(0===y&&0===w)return h;const M=[],z=(m-p)/o,v=(I-x)/o;for(let i=0;i<=o;i++)for(let a=0;a<=o;a++){const o=p+i*z,r=x+a*v,h=l(o,r,t,e,n,s),m=l(o,r,t,e,f,0),I=g(o,r,t,e,c,u,d);M.push({pos:{x:o,y:r},modalOverlap:h,avoidOverlap:m,centerDist:I})}const O=M.filter(t=>0===t.avoidOverlap),P=O.length>0?O:M,C=t*e,D=Math.min(...P.map(t=>t.modalOverlap))/C;return P.sort((t,e)=>{if(0===O.length&&t.avoidOverlap!==e.avoidOverlap)return t.avoidOverlap-e.avoidOverlap;const n=t.modalOverlap/C,i=e.modalOverlap/C;if(D<.3){const s=.3,o=n<=s,a=i<=s;if(o&&a)return t.centerDist+.3*n-(e.centerDist+.3*i);if(o)return-1;if(a)return 1}return.6*n+.4*t.centerDist-(.6*i+.4*e.centerDist)}),P[0].pos}function p(t,e,n,i={}){const{modalGap:s=16}=i,o=i.margin??s,a="undefined"!=typeof window?window.innerWidth:1920,r="undefined"!=typeof window?window.innerHeight:1080,d=n.reduce((t,e)=>t+e.width,0)+t,c=n.length*s,u=a-2*o;if(d+c>u)return null;const l=u-d-c;n.length;const f=l/2,g=a/2,h=[...n.map(t=>({id:t.id,width:t.width,height:t.height,currentX:t.x+t.width/2,currentY:t.y,isNew:!1})),{id:"__new__",width:t,height:e,currentX:g,currentY:(r-e)/2,isNew:!0}];h.sort((t,e)=>t.currentX-e.currentX);let p=o+f;const m=new Map;let x=null;for(const t of h){const e=p;if(t.isNew)x={x:Math.round(e),y:Math.round(t.currentY)};else{const i=n.find(e=>e.id===t.id);Math.abs(e-i.x)>5&&m.set(t.id,{x:Math.round(e),y:Math.round(i.y)})}p+=t.width+s}return x?{newModalPosition:x,existingModalMoves:m}:null}function m(t){return"symbol"==typeof t?t.description??"symbol":t}let x=t.proxy(new Map),I=t.state(0);const y=new Set;function w(){t.update(I),queueMicrotask(()=>{y.forEach(t=>t())})}function M(t){return y.add(t),()=>y.delete(t)}let z=t.state(t.proxy([])),v=t.state(t.proxy([])),O=t.state(t.proxy([])),P=t.state(t.proxy([])),C=t.state(t.proxy([])),D=t.state(t.proxy([])),k=t.state(t.proxy([])),b=t.state(t.proxy([])),A=t.state(null),T=t.proxy(new Map),F=t.state(null),W=t.proxy(new Map),H=t.proxy(new Set),B=t.proxy(new Set),R=t.state(t.proxy([])),S=null,X=null;function E(e){const n=x.get(e.id),i=(null==n?void 0:n.zIndex)??s();n?x.set(e.id,{...n,title:e.title,icon:e.icon,glow:e.glow,zIndex:i}):x.set(e.id,{...e,zIndex:i,isAnimating:!1}),w(),e.isMinimized&&!t.get(R).includes(e.id)&&t.get(R).push(e.id)}function q(e){const n=x.get(e);if(n){if(t.set(R,t.get(R).filter(t=>t!==e),!0),n.childId){const t=x.get(n.childId);t&&x.set(n.childId,{...t,parentId:void 0})}if(n.parentId){const t=x.get(n.parentId);t&&x.set(n.parentId,{...t,childId:void 0,lastChildId:n.id})}x.delete(e),w(),B.delete(e),H.delete(e)}}function Y(e){const n=x.get(e);if(!n||n.isMinimized)return;if(Vt(e),n.parentId){const t=x.get(n.parentId);if(t&&!t.isMinimized)return void Y(n.parentId)}if(t.set(z,[...t.get(z),e],!0),n.position&&n.size&&X){const i=X(),s=t.get(R).indexOf(e),o=i.x+s*(i.height+8),a=i.y;t.set(A,{x:o,y:a,originX:n.position.x+n.size.width/2,originY:n.position.y+n.size.height/2},!0)}const i=n.childId;x.set(e,{...n,isMinimized:!0,lastChildId:i}),w(),t.get(R).includes(e)||t.get(R).push(e),n.childId&&at(e)}function L(e){const n=x.get(e);if(!n||!n.isMinimized)return;x.set(e,{...n,isMinimized:!1,isOpen:!0}),w(),t.set(C,[...t.get(C),e],!0),$(e);const i=n.lastChildId||n.childId;i&&_(i)}function N(){Array.from(x.values()).filter(t=>t.isMinimized).map(t=>t.id).forEach(e=>{const n=x.get(e);if(n){x.set(e,{...n,isMinimized:!1,isOpen:!0}),t.set(C,[...t.get(C),e],!0),$(e);const i=n.lastChildId||n.childId;i&&_(i)}}),t.set(R,[],!0),w()}function _(e){const n=x.get(e);if(n&&n.isHiddenWithParent){x.set(e,{...n,isHiddenWithParent:!1}),w(),t.set(D,[...t.get(D),e],!0);const i=n.lastChildId||n.childId;i&&_(i)}}function G(t,e,n){const i=x.get(t);if(!i)return;let s=e;if((null==n?void 0:n.constrain)&&i.size&&(s=d(e.x,e.y,i.size.width,i.size.height)),x.set(t,{...i,position:s,size:(null==n?void 0:n.size)??i.size,hasBeenDragged:i.hasBeenDragged||(null==n?void 0:n.drag)||!1}),i.childId){let e=t,n=s;for(;;){const t=x.get(e);if(!(null==t?void 0:t.childId))break;const i=x.get(t.childId);if(!(null==i?void 0:i.offsetFromParent))break;const s={x:n.x+i.offsetFromParent.x,y:n.y+i.offsetFromParent.y};x.set(t.childId,{...i,position:s,hasBeenDragged:!0}),e=t.childId,n=s}}if(i.parentId&&i.offsetFromParent){const e=ae();let n=t,o=i;for(;o.parentId&&o.offsetFromParent;){const i=x.get(o.parentId);if(!i)break;const a=n===t?s:x.get(n).position,r={x:a.x-o.offsetFromParent.x,y:a.y-o.offsetFromParent.y};"animated"===e.parentChild.movementMode?W.set(o.parentId,r):x.set(o.parentId,{...i,position:r,hasBeenDragged:!0}),n=o.parentId,o=i}}w()}function K(t,e){const n=x.get(t);n&&(x.set(t,{...n,size:e}),w())}function j(t,e){const n=x.get(t);n&&(x.set(t,{...n,...e}),w())}function V(t,e){const n=x.get(t);if(!(null==n?void 0:n.childId))return;const i=x.get(n.childId);if(!i)return;const s=e+2;x.set(n.childId,{...i,zIndex:s}),V(n.childId,s)}function $(t){if(!x.get(t))return;const e=Math.max(...Array.from(x.values()).map(t=>t.zIndex),0),n=function(t){let e=t,n=x.get(e);for(;null==n?void 0:n.parentId;)e=n.parentId,n=x.get(e);return e}(t),i=x.get(n);if(!i)return;const s=e+2;x.set(n,{...i,zIndex:s}),V(n,s),w()}function Q(t){const e=x.get(t);if(!e)return!1;const n=Math.max(...Array.from(x.values()).map(t=>t.zIndex),0);return e.zIndex===n&&!e.isMinimized&&!e.isHiddenWithParent}function J(e){t.set(R,e,!0)}function U(e,n,i){const s=n.getBoundingClientRect();T.set(e,{x:s.left+s.width/2,y:s.top+s.height/2});const o=ae();(null==i?void 0:i.parentId)&&o.features.parentChild&&t.set(F,{parentId:i.parentId,childId:e},!0),t.get(v).includes(e)||t.set(v,[...t.get(v),e],!0),w();const a=x.get(e);if(a){if(a.isOpen&&!a.isMinimized&&!a.isHiddenWithParent)return t.set(v,t.get(v).filter(t=>t!==e),!0),At(e),void $(e);if(a.isMinimized)return t.set(v,t.get(v).filter(t=>t!==e),!0),void L(e);x.set(e,{...a,isOpen:!0}),$(e),null==S||S.push(e)}}function Z(e){E(e);const n=x.get(e.id);n&&(x.set(e.id,{...n,isOpen:!0}),w()),t.set(v,[...t.get(v),e.id],!0),w(),$(e.id),null==S||S.push(e.id)}function tt(e,n=!1){const i=x.get(e);i&&(Vt(e),n?t.set(P,[...t.get(P),e],!0):t.set(O,[...t.get(O),e],!0),w(),i.childId&&tt(i.childId,n),null==S||S.pop())}function et(){Array.from(x.keys()).forEach(t=>tt(t,!0))}function nt(t){const e=x.get(t);if(e){if(e.parentId){const n=x.get(e.parentId);n&&n.childId===t&&x.set(e.parentId,{...n,childId:void 0,lastChildId:t})}x.set(t,{...e,isOpen:!1,isMinimized:!1,isHiddenWithParent:!1,isTransparent:!1,position:null,size:null,hasBeenDragged:!1,parentId:void 0,childId:void 0,offsetFromParent:void 0}),w()}}function it(t){const e=x.get(t);if(!e)return[t];const n=[t];return e.childId&&n.push(...it(e.childId)),n}function st(e,n,i){const s=ae();if(i&&!T.has(e.id)){const t=i.getBoundingClientRect();T.set(e.id,{x:t.left+t.width/2,y:t.top+t.height/2})}const o={id:e.id,title:e.title??"",icon:e.icon??"",isOpen:!0,isMinimized:!1,isHiddenWithParent:!1,isTransparent:e.isTransparent??!1,isRejected:!1,position:e.position??null,size:e.size??null,hasBeenDragged:e.hasBeenDragged??!1,dockPosition:e.dockPosition??-1,glow:e.glow??null};if(!s.features.parentChild){E(o);const n=x.get(e.id);return n&&x.set(e.id,{...n,isOpen:!0}),t.set(v,[...t.get(v),e.id],!0),w(),void $(e.id)}const a=x.get(n);if(!a)return;a.childId&&tt(a.childId,!0),E({...o,parentId:n});const r=x.get(e.id);r&&x.set(e.id,{...r,isOpen:!0,parentId:n}),t.set(v,[...t.get(v),e.id],!0),w(),$(e.id),t.set(F,{parentId:n,childId:e.id},!0)}function ot(t,e){if(!ae().features.parentChild)return;const n=x.get(t),i=x.get(e);if(!n||!i)return;let s={x:40,y:40};n.position&&i.position&&(s={x:i.position.x-n.position.x,y:i.position.y-n.position.y});const o=Math.max(i.zIndex,n.zIndex+1);x.set(t,{...n,childId:e,lastChildId:e}),x.set(e,{...i,parentId:t,offsetFromParent:s,zIndex:o}),w()}function at(t){const e=x.get(t);if(!(null==e?void 0:e.childId))return;const n=x.get(e.childId);n&&(n.childId&&at(e.childId),x.set(e.childId,{...n,isHiddenWithParent:!0}),w())}function rt(t,e){const n=x.get(t);if(!(null==n?void 0:n.childId))return;const i=x.get(n.childId);if(!i||!i.offsetFromParent)return;const s={x:e.x+i.offsetFromParent.x,y:e.y+i.offsetFromParent.y};x.set(n.childId,{...i,position:s}),w()}function dt(t,e){const n=x.get(t),i=x.get(e);if(!(null==n?void 0:n.position)||!(null==i?void 0:i.position))return;const s={x:n.position.x-i.position.x,y:n.position.y-i.position.y};x.set(t,{...n,offsetFromParent:s}),w()}function ct(e){return t.get(z).includes(e)}function ut(e){return!!t.get(z).includes(e)&&(t.set(z,t.get(z).filter(t=>t!==e),!0),!0)}function lt(){return t.get(z).length>0}function ft(){return Array.from(x.keys())}function gt(t){return x.get(t)}function ht(t){const e=[];for(const[n,i]of x.entries())if(n!==t&&i.isOpen&&!i.isMinimized&&!i.isHiddenWithParent&&!i.parentId)if(i.position&&i.size)e.push({id:m(n),x:i.position.x,y:i.position.y,width:i.size.width,height:i.size.height});else{const t=document.querySelector(`[data-modal-id="${m(n)}"]`);if(t){const i=t.getBoundingClientRect();e.push({id:m(n),x:i.left,y:i.top,width:i.width,height:i.height})}}return e}function pt(t){const e=[];for(const[n,i]of x.entries())if(n!==t&&i.isOpen&&!i.isMinimized&&!i.isHiddenWithParent)if(i.position&&i.size)e.push({x:i.position.x,y:i.position.y,width:i.size.width,height:i.size.height});else{const t=document.querySelector(`[data-modal-id="${m(n)}"]`);if(t){const n=t.getBoundingClientRect();e.push({x:n.left,y:n.top,width:n.width,height:n.height})}}return e}function mt(){return t.get(I)}function xt(){const e=t.get(A);return t.set(A,null),e}function It(e){return t.get(v).includes(e)}function yt(e){return!!t.get(v).includes(e)&&(t.set(v,t.get(v).filter(t=>t!==e),!0),!0)}function wt(e){return t.get(O).includes(e)}function Mt(e){return!!t.get(O).includes(e)&&(t.set(O,t.get(O).filter(t=>t!==e),!0),!0)}function zt(e){return t.get(P).includes(e)}function vt(e){return!!t.get(P).includes(e)&&(t.set(P,t.get(P).filter(t=>t!==e),!0),!0)}function Ot(e){return t.get(C).includes(e)}function Pt(e){return!!t.get(C).includes(e)&&(t.set(C,t.get(C).filter(t=>t!==e),!0),!0)}function Ct(e){return t.get(D).includes(e)}function Dt(e){return!!t.get(D).includes(e)&&(t.set(D,t.get(D).filter(t=>t!==e),!0),!0)}function kt(e){return t.get(k).includes(e)}function bt(e){return!!t.get(k).includes(e)&&(t.set(k,t.get(k).filter(t=>t!==e),!0),!0)}function At(e){x.get(e)&&(t.get(k).includes(e)||t.get(b).includes(e)||(t.set(k,[...t.get(k),e],!0),w()))}function Tt(e){t.get(b).includes(e)||t.set(b,[...t.get(b),e],!0)}function Ft(e){t.set(b,t.get(b).filter(t=>t!==e),!0)}function Wt(){return t.get(F)}function Ht(e){if(!t.get(F)||t.get(F).childId!==e)return null;const n=t.get(F);return t.set(F,null),n}function Bt(t,e){T.set(t,e)}function Rt(t){const e=T.get(t);return e&&T.delete(t),e??null}function St(t,e){e?H.add(t):H.delete(t)}function Xt(t){return H.has(t)}function Et(t){const e=x.get(t);return void 0!==e&&e.isOpen&&!e.isMinimized&&!e.isHiddenWithParent}function qt(t){return x.has(t)}function Yt(){return{get modals(){return x},get pendingMinimize(){return t.get(z)},get pendingOpen(){return t.get(v)},get pendingClose(){return t.get(O)},get pendingRestore(){return t.get(C)},get dockOrder(){return t.get(R)}}}function Lt(t){B.has(t)?B.delete(t):B.add(t);const e=x.get(t);e&&(x.set(t,{...e,isTransparent:B.has(t)}),w())}function Nt(t){B.delete(t);const e=x.get(t);e&&(x.set(t,{...e,isTransparent:!1}),w())}function _t(t){t.animate([{transform:"translateX(0)"},{transform:"translateX(-6px)"},{transform:"translateX(6px)"},{transform:"translateX(-6px)"},{transform:"translateX(6px)"},{transform:"translateX(0)"}],{duration:300,easing:"ease-in-out"})}function Gt(t){const e=W.get(t);if(!e)return;const n=x.get(t);n&&(x.set(t,{...n,isAnimatingPosition:!0,position:e}),W.delete(t),w())}function Kt(t){const e=x.get(t);e&&(x.set(t,{...e,isAnimatingPosition:!1}),w())}function jt(t){return W.has(t)}function Vt(t){W.delete(t)}function $t(t){const e=ae().parentChild.animationDuration;for(const[e,n]of t){const t=x.get(e);t&&x.set(e,{...t,position:n,isAnimatingPosition:!0,hasBeenDragged:!0})}w(),setTimeout(()=>{for(const e of t.keys()){const t=x.get(e);t&&x.set(e,{...t,isAnimatingPosition:!1})}w()},e)}function Qt(t){const e=ae();if("animated"!==e.parentChild.movementMode)return;const n=e.parentChild.animationDuration,i=[];let s=t;for(;;){const t=x.get(s);if(!(null==t?void 0:t.parentId))break;i.push({parentId:t.parentId,childId:s}),s=t.parentId}i.forEach(({parentId:t,childId:e},i)=>{setTimeout(()=>{const i=x.get(e),s=x.get(t);if(!(null==i?void 0:i.position)||!i.offsetFromParent||!s)return;const o={x:i.position.x-i.offsetFromParent.x,y:i.position.y-i.offsetFromParent.y};W.set(t,o),Gt(t),setTimeout(()=>Kt(t),n)},i*n)})}function Jt(t){}function Ut(t){S=t}function Zt(t){X=t}function te(){return{modals:x,pendingMinimize:t.get(z),pendingOpen:t.get(v),pendingClose:t.get(O),pendingRestore:t.get(C),dockOrder:t.get(R),animatingModals:H,transparentModals:B}}function ee(){x.clear(),t.get(z).length=0,t.get(v).length=0,t.get(O).length=0,t.get(P).length=0,t.get(C).length=0,t.get(D).length=0,t.set(A,null),T.clear(),t.set(F,null),W.clear(),H.clear(),B.clear(),t.get(R).length=0,S=null,X=null}const ne={features:{dock:!0,minimize:!0,transparency:!0,resize:!0,drag:!0,focusTrap:!0,animations:!0,backdrop:!0,parentChild:!0},dock:{position:"bottom",labelMode:"beside",enableReorder:!0,enableFreeDrag:!0},animations:{open:400,close:250,minimize:500,restore:400},appearance:{headerLayout:"macos",defaultWidth:"480px",defaultHeight:"auto",minWidth:280,minHeight:200},zIndex:{base:400,dock:8e3,toast:9e3},parentChild:{movementMode:"animated",animationDuration:300},positioning:{strategy:"smart",modalGap:16,avoidElements:[]},portalTarget:"#modal-portal"};let ie={...ne},se=t.state(0);function oe(){return t.get(se)}function ae(){return ie}function re(e){const n=ie;ie=ce(ne,e),t.update(se),n.features.dock&&!ie.features.dock&&N()}function de(){ie={...ne},t.update(se)}function ce(t,e){return{features:{...t.features,...e.features},dock:{...t.dock,...e.dock},animations:{...t.animations,...e.animations},appearance:{...t.appearance,...e.appearance},zIndex:{...t.zIndex,...e.zIndex},parentChild:{...t.parentChild,...e.parentChild},positioning:{...t.positioning,...e.positioning},portalTarget:e.portalTarget??t.portalTarget}}function ue(t){return ie.features[t]}export{ot as $,vt as A,xt as B,j as C,ut as D,Pt as E,Dt as F,Mt as G,nt as H,Ht as I,It as J,yt as K,Rt as L,kt as M,bt as N,Tt as O,Ft as P,Wt as Q,pt as R,f as S,h as T,l as U,ht as V,p as W,$t as X,E as Y,Q as Z,Lt as _,Et as a,o as a0,Yt as a1,Xt as a2,_t as a3,re as a4,i as a5,de as a6,a as a7,ne as a8,ce as a9,g as aA,M as aa,N as ab,_ as ac,K as ad,J as ae,Z as af,et as ag,it as ah,at as ai,rt as aj,dt as ak,lt as al,ft as am,Bt as an,St as ao,Gt as ap,Kt as aq,jt as ar,Vt as as,Jt as at,Ut as au,Zt as av,te as aw,ee as ax,s as ay,u as az,U as b,tt as c,$ as d,d as e,c as f,ae as g,m as h,qt as i,gt as j,oe as k,mt as l,Y as m,wt as n,st as o,ct as p,Ct as q,L as r,Ot as s,At as t,Nt as u,q as v,ue as w,G as x,Qt as y,zt as z};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{aw as a,ax as e,ay as s,X as n,ap as i,d as t,az as o,aA as d,W as r,U as l,aq as g,as as c,ag as P,c as m,f as M,e as u,K as p,M as C,F as h,G as A,A as S,D as f,B as T,J as z,P as O,E as k,af as R,a8 as F,O as I,H as b,T as y,g as L,k as V,S as x,a0 as B,j as D,a1 as E,ah as j,R as v,V as w,Q as W,am as Z,l as _,al as q,L as G,q as U,n as H,z as J,p as K,I as N,ar as Q,s as X,ai as Y,a5 as $,w as aa,a2 as ea,a as sa,i as na,Z as ia,$ as ta,a9 as oa,m as da,o as ra,b as la,Y as ga,ae as ca,a6 as Pa,u as ma,a7 as Ma,ab as ua,ac as pa,r as Ca,ak as ha,a4 as Aa,av as Sa,ao as fa,at as Ta,au as za,a3 as Oa,N as ka,an as Ra,aa as Fa,h as Ia,_ as ba,t as ya,y as La,v as Va,aj as xa,C as Ba,x as Da,ad as Ea}from"./core.js";import"./ui.js";export{a as _getInternalState,e as _resetInternalState,s as acquireModalZIndex,n as animateModalsToPositions,i as animateParentToPosition,t as bringToFront,o as calculateOverlap,d as calculatePositionScore,r as calculateRearrangement,l as calculateTotalOverlap,g as clearParentAnimationFlag,c as clearPendingParentAnimation,P as closeAllModals,m as closeModal,M as constrainSizeToViewport,u as constrainToViewport,p as consumeOpenSourcePosition,C as consumePendingAttention,h as consumePendingChildRestore,A as consumePendingClose,S as consumePendingForceClose,f as consumePendingMinimize,T as consumePendingMinimizeTarget,z as consumePendingOpen,O as consumePendingParentLink,k as consumePendingRestore,R as createModal,F as defaultConfig,I as endAttentionAnimation,b as finalizeModalClose,y as findSmartPosition,L as getConfig,V as getConfigVersion,x as getElementBounds,B as getLayerZIndex,D as getModalState,E as getModalsStore,j as getModalsToClose,v as getOpenModalBounds,w as getOpenModalBoundsWithIds,W as getPendingParentLink,Z as getRegisteredModalIds,_ as getStateVersion,q as hasAnyPendingMinimize,G as hasPendingAttention,U as hasPendingChildRestore,H as hasPendingClose,J as hasPendingForceClose,K as hasPendingMinimize,N as hasPendingOpen,Q as hasPendingParentAnimation,X as hasPendingRestore,Y as hideChildWithParent,$ as initializeStacking,aa as isFeatureEnabled,ea as isModalAnimating,sa as isModalOpen,na as isModalRegistered,ia as isTopModal,ta as linkModals,oa as mergeConfig,da as minimizeModal,ra as openChildModal,la as openModal,ga as registerModal,ca as reorderDock,Pa as resetConfig,ma as resetModalTransparency,Ma as resetStacking,ua as restoreAllMinimizedModals,pa as restoreChildModal,Ca as restoreModal,ha as setChildOffsetFromParent,Aa as setConfig,Sa as setDockPositionGetter,fa as setModalAnimating,Ta as setRegistryFunctions,za as setURLStateCallbacks,Oa as shakeElement,ka as startAttentionAnimation,Ra as storeOpenSourcePosition,Fa as subscribe,Ia as toDataId,ba as toggleModalTransparency,ya as triggerAttention,La as triggerCascadingParentAnimations,Va as unregisterModal,xa as updateChildPosition,Ba as updateModal,Da as updateModalPosition,Ea as updateModalSize};
1
+ import{aw as a,ax as e,ay as s,X as n,ap as i,d as t,az as o,aA as d,W as r,U as l,aq as g,as as c,ag as P,c as m,f as M,e as u,L as p,N as C,F as h,G as A,A as S,D as f,B as T,K as z,I as O,E as k,af as R,a8 as F,P as I,H as b,T as y,g as L,k as V,S as x,a0 as B,j as D,a1 as E,ah as j,R as v,V as w,Q as W,am as Z,l as _,al as q,M as G,q as U,n as H,z as J,p as K,J as N,ar as Q,s as X,ai as Y,a5 as $,w as aa,a2 as ea,a as sa,i as na,Z as ia,$ as ta,a9 as oa,m as da,o as ra,b as la,Y as ga,ae as ca,a6 as Pa,u as ma,a7 as Ma,ab as ua,ac as pa,r as Ca,ak as ha,a4 as Aa,av as Sa,ao as fa,at as Ta,au as za,a3 as Oa,O as ka,an as Ra,aa as Fa,h as Ia,_ as ba,t as ya,y as La,v as Va,aj as xa,C as Ba,x as Da,ad as Ea}from"./core.js";import"./ui.js";export{a as _getInternalState,e as _resetInternalState,s as acquireModalZIndex,n as animateModalsToPositions,i as animateParentToPosition,t as bringToFront,o as calculateOverlap,d as calculatePositionScore,r as calculateRearrangement,l as calculateTotalOverlap,g as clearParentAnimationFlag,c as clearPendingParentAnimation,P as closeAllModals,m as closeModal,M as constrainSizeToViewport,u as constrainToViewport,p as consumeOpenSourcePosition,C as consumePendingAttention,h as consumePendingChildRestore,A as consumePendingClose,S as consumePendingForceClose,f as consumePendingMinimize,T as consumePendingMinimizeTarget,z as consumePendingOpen,O as consumePendingParentLink,k as consumePendingRestore,R as createModal,F as defaultConfig,I as endAttentionAnimation,b as finalizeModalClose,y as findSmartPosition,L as getConfig,V as getConfigVersion,x as getElementBounds,B as getLayerZIndex,D as getModalState,E as getModalsStore,j as getModalsToClose,v as getOpenModalBounds,w as getOpenModalBoundsWithIds,W as getPendingParentLink,Z as getRegisteredModalIds,_ as getStateVersion,q as hasAnyPendingMinimize,G as hasPendingAttention,U as hasPendingChildRestore,H as hasPendingClose,J as hasPendingForceClose,K as hasPendingMinimize,N as hasPendingOpen,Q as hasPendingParentAnimation,X as hasPendingRestore,Y as hideChildWithParent,$ as initializeStacking,aa as isFeatureEnabled,ea as isModalAnimating,sa as isModalOpen,na as isModalRegistered,ia as isTopModal,ta as linkModals,oa as mergeConfig,da as minimizeModal,ra as openChildModal,la as openModal,ga as registerModal,ca as reorderDock,Pa as resetConfig,ma as resetModalTransparency,Ma as resetStacking,ua as restoreAllMinimizedModals,pa as restoreChildModal,Ca as restoreModal,ha as setChildOffsetFromParent,Aa as setConfig,Sa as setDockPositionGetter,fa as setModalAnimating,Ta as setRegistryFunctions,za as setURLStateCallbacks,Oa as shakeElement,ka as startAttentionAnimation,Ra as storeOpenSourcePosition,Fa as subscribe,Ia as toDataId,ba as toggleModalTransparency,ya as triggerAttention,La as triggerCascadingParentAnimations,Va as unregisterModal,xa as updateChildPosition,Ba as updateModal,Da as updateModalPosition,Ea as updateModalSize};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Reactive Props Helper for React-Svelte Bridge
3
+ *
4
+ * In Svelte 5, props passed to mount() need to be reactive ($state) to update.
5
+ * This helper creates a reactive props object that can be mutated from React.
6
+ */
7
+ /**
8
+ * Creates a reactive props object that can be passed to Svelte's mount()
9
+ * and updated from non-Svelte code (like React).
10
+ */
11
+ export declare function createReactiveProps<T extends Record<string, unknown>>(initial: T): T;
12
+ /**
13
+ * Updates a reactive props object with new values.
14
+ * Only updates changed properties to minimize reactivity triggers.
15
+ */
16
+ export declare function updateReactiveProps<T extends Record<string, unknown>>(props: T, updates: Partial<T>): void;
17
+ //# sourceMappingURL=reactiveProps.svelte.d.ts.map
package/dist/react.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- export { openModal, closeModal, closeAllModals, minimizeModal, restoreModal, openChildModal, bringToFront, isModalOpen, isModalRegistered, toggleModalTransparency, } from './core/state.svelte';
2
- export { getConfig, setConfig } from './core/config.svelte';
3
1
  export { Modal } from './react/Modal';
4
2
  export type { ModalProps } from './react/Modal';
5
3
  export { ModalProvider } from './react/ModalProvider';
package/dist/react.js CHANGED
@@ -1 +1 @@
1
- import{r as e,u as n,m as t,M as r,a as o,t as i,s as l,i as s,g as c,b as u,c as a,D as d,d as m,o as p,e as f,f as g,h,j as y,k as M,l as z,n as v,p as C}from"./runtime.js";import{q as E,v as b,w as O}from"./runtime.js";import{jsxs as j,Fragment as k,jsx as w}from"react/jsx-runtime";import x,{useRef as T,useState as F,useEffect as H,useCallback as R,useSyncExternalStore as W}from"react";import{createPortal as A}from"react-dom";function D({id:l,title:s,icon:c,maxWidth:u="600px",preferredHeight:a,autoOpen:d=!1,glow:m,config:p,closeOnEscape:f=!0,onClose:g,children:h,footer:y}){const M=T(null),z=T(null),v=T(null),C=T(null),[E,b]=F(!1),[O,x]=F(!1);H(()=>(e({id:l,title:s,icon:c??"",isOpen:d,isMinimized:!1,isHiddenWithParent:!1,isTransparent:!1,isRejected:!1,position:null,size:null,hasBeenDragged:!1,dockPosition:0,glow:m??null}),b(!0),()=>{n(l)}),[l]),H(()=>{if(!E||!M.current)return;const e=h?(v.current||"undefined"==typeof document||(v.current=document.createElement("div"),v.current.className="react-modal-body-content"),v.current):null,n=y?(C.current||"undefined"==typeof document||(C.current=document.createElement("div"),C.current.className="react-modal-footer-content"),C.current):null;return z.current=t(r,{target:M.current,props:{id:l,title:s,icon:c??"",maxWidth:u,preferredHeight:a,closeOnEscape:f,onClose:g,bodyElement:e,footerElement:n}}),x(!0),()=>{z.current&&(o(z.current),z.current=null,x(!1)),v.current=null,C.current=null}},[E,l]);const R=i(l),W=O?v.current:null,D=O?C.current:null;return j(k,{children:[w("div",{ref:M,"data-modal-bridge":R,style:{display:"contents"}}),W&&h&&A(h,W),D&&y&&A(y,D)]})}function N({config:e,children:n}){return H(()=>{e&&l(e),s();const n=c().portalTarget;let t=null;return"string"==typeof n&&"undefined"!=typeof document&&(document.querySelector(n)||(t=document.createElement("div"),t.id=n.replace("#",""),document.body.appendChild(t))),()=>{u(),a(),t&&t.remove()}},[e]),x.createElement(x.Fragment,null,n)}function P({renderIcon:e}){const n=T(null),r=T(null);return H(()=>{if(n.current)return r.current=t(d,{target:n.current,props:{}}),()=>{r.current&&(o(r.current),r.current=null)}},[]),w("div",{ref:n,"data-dock-bridge":"true",style:{display:"contents"}})}function S(e,n){if(!C(e))throw new Error(`Cannot call ${n}() on unregistered modal "${String(e)}". Ensure the Modal component is rendered.`)}const $=new Map;function q(e){const n=R(()=>function(e){const n=v().modals.get(e),t=void 0!==n&&!n.isMinimized,r=(null==n?void 0:n.isMinimized)??!1,o=void 0!==n,i=$.get(e);if(i&&i.isOpen===t&&i.isMinimized===r&&i.isRegistered===o)return i;const l={isOpen:t,isMinimized:r,isRegistered:o};return $.set(e,l),l}(e),[e]);return{...W(m,n,n),open:R(n=>{S(e,"open"),p(e,n)},[e]),close:R(()=>{S(e,"close"),f(e)},[e]),minimize:R(()=>{S(e,"minimize"),g(e)},[e]),restore:R(()=>{S(e,"restore"),h(e)},[e]),openChild:R((n,t)=>{S(e,"openChild"),y({id:n},e,t)},[e]),shake:R(()=>{S(e,"shake"),M(e)},[e]),bringToFront:R(()=>{S(e,"bringToFront"),z(e)},[e])}}let B=null;function I(){const e=v(),n=Array.from(e.modals.values()),t=n.filter(e=>e.isMinimized).length,r=n.filter(e=>!e.isMinimized).length;return B&&B.modals===e.modals&&B.minimizedCount===t&&B.openCount===r||(B={modals:e.modals,minimizedCount:t,openCount:r}),B}function G(){return W(m,I,I)}export{P as Dock,D as Modal,N as ModalProvider,z as bringToFront,E as closeAllModals,f as closeModal,c as getConfig,b as isModalOpen,C as isModalRegistered,g as minimizeModal,y as openChildModal,p as openModal,h as restoreModal,l as setConfig,O as toggleModalTransparency,q as useModal,G as useModals};
1
+ import{jsxs as e,Fragment as n,jsx as r}from"react/jsx-runtime";import t,{useRef as i,useState as o,useEffect as l,useCallback as c,useSyncExternalStore as s}from"react";import{createPortal as u}from"react-dom";import{p as d,r as a,u as m,m as p,M as f,a as g,t as h,s as y,i as z,g as v,b as C,c as E,D as M,d as b,o as O,e as k,f as x,h as j,j as w,k as H,l as T,n as W,q as F}from"./runtime.js";function R({id:t,title:c,icon:s,maxWidth:y="600px",preferredHeight:z,autoOpen:v=!1,glow:C,config:E,closeOnEscape:M=!0,onClose:b,children:O,footer:k}){const x=i(null),j=i(null),w=i(null),H=i(null),T=i(null),[W,F]=o(!1),[R,q]=o(!1);l(()=>(a({id:t,title:c,icon:s??"",isOpen:v,isMinimized:!1,isHiddenWithParent:!1,isTransparent:!1,isRejected:!1,position:null,size:null,hasBeenDragged:!1,dockPosition:0,glow:C??null}),F(!0),()=>{m(t)}),[t]),l(()=>{if(!W||!x.current)return;const e=O?(w.current||"undefined"==typeof document||(w.current=document.createElement("div"),w.current.className="react-modal-body-content"),w.current):null,n=k?(H.current||"undefined"==typeof document||(H.current=document.createElement("div"),H.current.className="react-modal-footer-content"),H.current):null;var r;return T.current=(r={id:t,title:c,icon:s??"",maxWidth:y,preferredHeight:z,closeOnEscape:M,onClose:b,bodyElement:e,footerElement:n},d({...r})),j.current=p(f,{target:x.current,props:T.current}),q(!0),()=>{j.current&&(g(j.current),j.current=null,T.current=null,q(!1)),w.current=null,H.current=null}},[W,t]),l(()=>{T.current&&function(e,n){for(const r of Object.keys(n))e[r]!==n[r]&&(e[r]=n[r])}(T.current,{title:c,icon:s??"",maxWidth:y,preferredHeight:z,closeOnEscape:M,onClose:b})},[c,s,y,z,M,b]);const D=h(t),N=R?w.current:null,P=R?H.current:null;return e(n,{children:[r("div",{ref:x,"data-modal-bridge":D,style:{display:"contents"}}),N&&O&&u(O,N),P&&k&&u(k,P)]})}function q({config:e,children:n}){return l(()=>{e&&y(e),z();const n=v().portalTarget;let r=null;return"string"==typeof n&&"undefined"!=typeof document&&(document.querySelector(n)||(r=document.createElement("div"),r.id=n.replace("#",""),document.body.appendChild(r))),()=>{C(),E(),r&&r.remove()}},[e]),t.createElement(t.Fragment,null,n)}function D({renderIcon:e}){const n=i(null),t=i(null);return l(()=>{if(n.current)return t.current=p(M,{target:n.current,props:{}}),()=>{t.current&&(g(t.current),t.current=null)}},[]),r("div",{ref:n,"data-dock-bridge":"true",style:{display:"contents"}})}function N(e,n){if(!F(e))throw new Error(`Cannot call ${n}() on unregistered modal "${String(e)}". Ensure the Modal component is rendered.`)}const P=new Map;function S(e){const n=c(()=>function(e){const n=W().modals.get(e),r=void 0!==n&&!n.isMinimized,t=(null==n?void 0:n.isMinimized)??!1,i=void 0!==n,o=P.get(e);if(o&&o.isOpen===r&&o.isMinimized===t&&o.isRegistered===i)return o;const l={isOpen:r,isMinimized:t,isRegistered:i};return P.set(e,l),l}(e),[e]);return{...s(b,n,n),open:c(n=>{N(e,"open"),O(e,n)},[e]),close:c(()=>{N(e,"close"),k(e)},[e]),minimize:c(()=>{N(e,"minimize"),x(e)},[e]),restore:c(()=>{N(e,"restore"),j(e)},[e]),openChild:c((n,r)=>{N(e,"openChild"),w({id:n},e,r)},[e]),shake:c(()=>{N(e,"shake"),H(e)},[e]),bringToFront:c(()=>{N(e,"bringToFront"),T(e)},[e])}}let $=null;function A(){const e=W(),n=Array.from(e.modals.values()),r=n.filter(e=>e.isMinimized).length,t=n.filter(e=>!e.isMinimized).length;return $&&$.modals===e.modals&&$.minimizedCount===r&&$.openCount===t||($={modals:e.modals,minimizedCount:r,openCount:t}),$}function B(){return s(b,A,A)}export{D as Dock,R as Modal,q as ModalProvider,S as useModal,B as useModals};
package/dist/runtime.js CHANGED
@@ -1 +1 @@
1
- var t,e,n,i,r,o,s,a,l,d,u,c,f,h,p,v,g,m,w,y,x,b,M,z,k,I,_,P,D,C,S,O,E,W,T,B,R,A,L,H,$,F,q=Object.defineProperty,j=t=>{throw TypeError(t)},X=(t,e,n)=>((t,e,n)=>e in t?q(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n)(t,"symbol"!=typeof e?e+"":e,n),Y=(t,e,n)=>e.has(t)||j("Cannot "+n),N=(t,e,n)=>(Y(t,e,"read from private field"),n?n.call(t):e.get(t)),K=(t,e,n)=>e.has(t)?j("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),G=(t,e,n,i)=>(Y(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n),V=(t,e,n)=>(Y(t,e,"access private method"),n);const U=Symbol();var Q=Array.isArray,J=Array.prototype.indexOf,Z=Array.from,tt=Object.defineProperty,et=Object.getOwnPropertyDescriptor,nt=Object.getOwnPropertyDescriptors,it=Object.prototype,rt=Array.prototype,ot=Object.getPrototypeOf,st=Object.isExtensible;const at=()=>{};function lt(){var t,e;return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}}const dt=16,ut=512,ct=1024,ft=2048,ht=4096,pt=8192,vt=16384,gt=32768,mt=65536,wt=1<<18,yt=1<<19,xt=1<<25,bt=32768,Mt=1<<21,zt=1<<23,kt=Symbol("$state"),It=Symbol(""),_t=new class extends Error{constructor(){super(...arguments),X(this,"name","StaleReactionError"),X(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Pt(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Dt(t){return t===this.v}function Ct(t,e){return t!=t?e==e:t!==e||null!==t&&"object"==typeof t||"function"==typeof t}function St(t){return!Ct(t,this.v)}let Ot=null;function Et(t){Ot=t}function Wt(t){return Rt().get(t)}function Tt(t,e=!1,n){Ot={p:Ot,i:!1,c:null,e:null,s:t,x:null,l:null}}function Bt(t){var e=Ot,n=e.e;if(null!==n)for(var i of(e.e=null,n))$e(i);return void 0!==t&&(e.x=t),e.i=!0,Ot=e.p,t??{}}function Rt(t){return null===Ot&&Pt(),Ot.c??(Ot.c=new Map(function(){let t=Ot.p;for(;null!==t;){const e=t.c;if(null!==e)return e;t=t.p}return null}()||void 0))}let At=[];function Lt(){var t=At;At=[],function(t){for(var e=0;e<t.length;e++)t[e]()}(t)}function Ht(t){if(0===At.length&&!Vt){var e=At;queueMicrotask(()=>{e===At&&Lt()})}At.push(t)}function $t(){for(;At.length>0;)Lt()}function Ft(t){var e=dn;if(null===e)return sn.f|=zt,t;if(0===(e.f&gt)){if(!(128&e.f))throw t;e.b.error(t)}else qt(t,e)}function qt(t,e){for(;null!==e;){if(128&e.f)try{return void e.b.error(t)}catch(e){t=e}e=e.parent}throw t}const jt=new Set;let Xt=null,Yt=null,Nt=[],Kt=null,Gt=!1,Vt=!1;t=new WeakMap,e=new WeakMap,n=new WeakMap,i=new WeakMap,r=new WeakMap,o=new WeakMap,s=new WeakMap,a=new WeakSet,l=function(t,e){var n;t.f^=ct;for(var i=t.first;null!==i;){var r=i.f,s=!!(96&r),l=s&&0!==(r&ct)||0!==(r&pt)||this.skipped_effects.has(i);if(!!(128&i.f)&&(null==(n=i.b)?void 0:n.is_pending())&&(e={parent:e,effect:i,effects:[],render_effects:[]}),!l&&null!==i.fn){s?i.f^=ct:4&r?e.effects.push(i):bn(i)&&(0!==(i.f&dt)&&N(this,o).add(i),_n(i));var u=i.first;if(null!==u){i=u;continue}}var c=i.parent;for(i=i.next;null===i&&null!==c;)c===e.effect&&(V(this,a,d).call(this,e.effects),V(this,a,d).call(this,e.render_effects),e=e.parent),i=c.next,c=c.parent}},d=function(t){for(const e of t)0!==(e.f&ft)?N(this,o).add(e):0!==(e.f&ht)&&N(this,s).add(e),V(this,a,u).call(this,e.deps),Wn(e,ct)},u=function(t){if(null!==t)for(const e of t)2&e.f&&0!==(e.f&bt)&&(e.f^=bt,V(this,a,u).call(this,e.deps))},c=function(){if(0===N(this,i)){for(const e of N(this,t))e();N(this,t).clear()}0===N(this,n)&&V(this,a,f).call(this)},f=function(){var t;if(jt.size>1){this.previous.clear();var e=Yt,n=!0,i={parent:null,effect:null,effects:[],render_effects:[]};for(const e of jt){if(e===this){n=!1;continue}const o=[];for(const[t,i]of this.current){if(e.current.has(t)){if(!n||i===e.current.get(t))continue;e.current.set(t,i)}o.push(t)}if(0===o.length)continue;const s=[...e.current.keys()].filter(t=>!this.current.has(t));if(s.length>0){var r=Nt;Nt=[];const n=new Set,d=new Map;for(const t of o)ee(t,s,n,d);if(Nt.length>0){Xt=e,e.apply();for(const n of Nt)V(t=e,a,l).call(t,n,i);e.deactivate()}Nt=r}}Xt=null,Yt=e}this.committed=!0,jt.delete(this)};let Ut=class u{constructor(){K(this,a),X(this,"committed",!1),X(this,"current",new Map),X(this,"previous",new Map),K(this,t,new Set),K(this,e,new Set),K(this,n,0),K(this,i,0),K(this,r,null),K(this,o,new Set),K(this,s,new Set),X(this,"skipped_effects",new Set),X(this,"is_fork",!1)}is_deferred(){return this.is_fork||N(this,i)>0}process(t){var e;Nt=[],this.apply();var n={parent:null,effect:null,effects:[],render_effects:[]};for(const e of t)V(this,a,l).call(this,e,n);this.is_fork||V(this,a,c).call(this),this.is_deferred()?(V(this,a,d).call(this,n.effects),V(this,a,d).call(this,n.render_effects)):(Xt=null,te(n.render_effects),te(n.effects),null==(e=N(this,r))||e.resolve()),Yt=null}capture(t,e){this.previous.has(t)||this.previous.set(t,e),0===(t.f&zt)&&(this.current.set(t,t.v),null==Yt||Yt.set(t,t.v))}activate(){Xt=this,this.apply()}deactivate(){Xt===this&&(Xt=null,Yt=null)}flush(){if(this.activate(),Nt.length>0){if(Qt(),null!==Xt&&Xt!==this)return}else 0===N(this,n)&&this.process([]);this.deactivate()}discard(){for(const t of N(this,e))t(this);N(this,e).clear()}increment(t){G(this,n,N(this,n)+1),t&&G(this,i,N(this,i)+1)}decrement(t){G(this,n,N(this,n)-1),t&&G(this,i,N(this,i)-1),this.revive()}revive(){for(const t of N(this,o))N(this,s).delete(t),Wn(t,ft),ie(t);for(const t of N(this,s))Wn(t,ht),ie(t);this.flush()}oncommit(e){N(this,t).add(e)}ondiscard(t){N(this,e).add(t)}settled(){return(N(this,r)??G(this,r,lt())).promise}static ensure(){if(null===Xt){const t=Xt=new u;jt.add(Xt),Vt||u.enqueue(()=>{Xt===t&&t.flush()})}return Xt}static enqueue(t){Ht(t)}apply(){}};function Qt(){var t=en;Gt=!0;try{var e=0;for(nn(!0);Nt.length>0;){var n=Ut.ensure();e++>1e3&&Jt(),n.process(Nt),pe.clear()}}finally{Gt=!1,nn(t),Kt=null}}function Jt(){try{!function(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}()}catch(t){qt(t,Kt)}}let Zt=null;function te(t){var e=t.length;if(0!==e){for(var n=0;n<e;){var i=t[n++];if(!(24576&i.f)&&bn(i)&&(Zt=new Set,_n(i),null===i.deps&&null===i.first&&null===i.nodes&&(null===i.teardown&&null===i.ac?Ve(i):i.fn=null),(null==Zt?void 0:Zt.size)>0)){pe.clear();for(const t of Zt){if(24576&t.f)continue;const e=[t];let n=t.parent;for(;null!==n;)Zt.has(n)&&(Zt.delete(n),e.push(n)),n=n.parent;for(let t=e.length-1;t>=0;t--){const n=e[t];24576&n.f||_n(n)}}Zt.clear()}}Zt=null}}function ee(t,e,n,i){if(!n.has(t)&&(n.add(t),null!==t.reactions))for(const r of t.reactions){const t=r.f;2&t?ee(r,e,n,i):4194320&t&&0===(t&ft)&&ne(r,e,i)&&(Wn(r,ft),ie(r))}}function ne(t,e,n){const i=n.get(t);if(void 0!==i)return i;if(null!==t.deps)for(const i of t.deps){if(e.includes(i))return!0;if(2&i.f&&ne(i,e,n))return n.set(i,!0),!0}return n.set(t,!1),!1}function ie(t){for(var e=Kt=t;null!==e.parent;){var n=(e=e.parent).f;if(Gt&&e===dn&&0!==(n&dt)&&0===(n&wt))return;if(96&n){if(0===(n&ct))return;e.f^=ct}}Nt.push(e)}class re{constructor(t,e,n){K(this,C),X(this,"parent"),K(this,h,!1),K(this,p),K(this,v,null),K(this,g),K(this,m),K(this,w),K(this,y,null),K(this,x,null),K(this,b,null),K(this,M,null),K(this,z,null),K(this,k,0),K(this,I,0),K(this,_,!1),K(this,P,null),K(this,D,function(t){let e,n=0,i=ge(0);return()=>{Ae()&&(Dn(i),qe(()=>(0===n&&(e=On(()=>t())),n+=1,()=>{Ht(()=>{n-=1,0===n&&(null==e||e(),e=void 0,Me(i))})})))}}(()=>(G(this,P,ge(N(this,k))),()=>{G(this,P,null)}))),G(this,p,t),G(this,g,e),G(this,m,n),this.parent=dn.b,G(this,h,!!N(this,g).pending),G(this,w,Xe(()=>{dn.b=this;var t=V(this,C,S).call(this);try{G(this,y,Ye(()=>n(t)))}catch(t){this.error(t)}return N(this,I)>0?V(this,C,E).call(this):G(this,h,!1),()=>{var t;null==(t=N(this,z))||t.remove()}},589952))}is_pending(){return N(this,h)||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!N(this,g).pending}update_pending_count(t){V(this,C,W).call(this,t),G(this,k,N(this,k)+t),N(this,P)&&xe(N(this,P),N(this,k))}get_effect_pending(){return N(this,D).call(this),Dn(N(this,P))}error(t){var e=N(this,g).onerror;let n=N(this,g).failed;if(N(this,_)||!e&&!n)throw t;N(this,y)&&(Ge(N(this,y)),G(this,y,null)),N(this,x)&&(Ge(N(this,x)),G(this,x,null)),N(this,b)&&(Ge(N(this,b)),G(this,b,null));var i=!1,r=!1;const o=()=>{i||(i=!0,r&&function(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}(),Ut.ensure(),G(this,k,0),null!==N(this,b)&&Ue(N(this,b),()=>{G(this,b,null)}),G(this,h,this.has_pending_snippet()),G(this,y,V(this,C,O).call(this,()=>(G(this,_,!1),Ye(()=>N(this,m).call(this,N(this,p)))))),N(this,I)>0?V(this,C,E).call(this):G(this,h,!1))};var s=sn;try{ln(null),r=!0,null==e||e(t,o),r=!1}catch(t){qt(t,N(this,w)&&N(this,w).parent)}finally{ln(s)}n&&Ht(()=>{G(this,b,V(this,C,O).call(this,()=>{Ut.ensure(),G(this,_,!0);try{return Ye(()=>{n(N(this,p),()=>t,()=>o)})}catch(t){return qt(t,N(this,w).parent),null}finally{G(this,_,!1)}}))})}}function oe(){un(null),ln(null),Et(null)}function se(t){var e=null!==sn&&2&sn.f?sn:null;return null!==dn&&(dn.f|=yt),{ctx:Ot,deps:null,effects:null,equals:Dt,f:2050,fn:t,reactions:null,rv:0,v:U,wv:0,parent:e??dn,ac:null}}function ae(t,e){let n=dn;null===n&&function(){throw new Error("https://svelte.dev/e/async_derived_orphan")}();var i=n.b,r=void 0,o=ge(U),s=!sn,a=new Map;return function(t){Re(4718592,t,!0)}(()=>{var e,n=lt();r=n.promise;try{Promise.resolve(t()).then(n.resolve,n.reject).then(()=>{l===Xt&&l.committed&&l.deactivate(),oe()})}catch(t){n.reject(t),oe()}var l=Xt;if(s){var d=!i.is_pending();i.update_pending_count(1),l.increment(d),null==(e=a.get(l))||e.reject(_t),a.delete(l),a.set(l,n)}const u=(t,e=void 0)=>{if(l.activate(),e)e!==_t&&(o.f|=zt,xe(o,e));else{0!==(o.f&zt)&&(o.f^=zt),xe(o,t);for(const[t,e]of a){if(a.delete(t),t===l)break;e.reject(_t)}}s&&(i.update_pending_count(-1),l.decrement(d))};n.promise.then(u,t=>u(null,t||"unknown"))}),Le(()=>{for(const t of a.values())t.reject(_t)}),new Promise(t=>{!function e(n){function i(){n===r?t(o):e(r)}n.then(i,i)}(r)})}function le(t){const e=se(t);return fn(e),e}function de(t){const e=se(t);return e.equals=St,e}function ue(t){var e=t.effects;if(null!==e){t.effects=null;for(var n=0;n<e.length;n+=1)Ge(e[n])}}function ce(t){var e,n=dn;un(function(t){for(var e=t.parent;null!==e;){if(!(2&e.f))return 0===(e.f&vt)?e:null;e=e.parent}return null}(t));try{t.f&=-32769,ue(t),e=zn(t)}finally{un(n)}return e}function fe(t){var e=ce(t);t.equals(e)||((null==Xt?void 0:Xt.is_fork)||(t.v=e),t.wv=xn()),rn||(null!==Yt?(Ae()||(null==Xt?void 0:Xt.is_fork))&&Yt.set(t,e):Wn(t,0===(t.f&ut)?ht:ct))}h=new WeakMap,p=new WeakMap,v=new WeakMap,g=new WeakMap,m=new WeakMap,w=new WeakMap,y=new WeakMap,x=new WeakMap,b=new WeakMap,M=new WeakMap,z=new WeakMap,k=new WeakMap,I=new WeakMap,_=new WeakMap,P=new WeakMap,D=new WeakMap,C=new WeakSet,S=function(){var t=N(this,p);return N(this,h)&&(G(this,z,Ce()),N(this,p).before(N(this,z)),t=N(this,z)),t},O=function(t){var e=dn,n=sn,i=Ot;un(N(this,w)),ln(N(this,w)),Et(N(this,w).ctx);try{return t()}catch(t){return Ft(t),null}finally{un(e),ln(n),Et(i)}},E=function(){const t=N(this,g).pending;null!==N(this,y)&&(G(this,M,document.createDocumentFragment()),N(this,M).append(N(this,z)),tn(N(this,y),N(this,M))),null===N(this,x)&&G(this,x,Ye(()=>t(N(this,p))))},W=function(t){var e;this.has_pending_snippet()?(G(this,I,N(this,I)+t),0===N(this,I)&&(G(this,h,!1),N(this,x)&&Ue(N(this,x),()=>{G(this,x,null)}),N(this,M)&&(N(this,p).before(N(this,M)),G(this,M,null)))):this.parent&&V(e=this.parent,C,W).call(e,t)};let he=new Set;const pe=new Map;let ve=!1;function ge(t,e){return{f:0,v:t,reactions:null,equals:Dt,rv:0,wv:0}}function me(t,e){const n=ge(t);return fn(n),n}function we(t,e=!1,n=!0){const i=ge(t);return e||(i.equals=St),i}function ye(t,e,n=!1){return null===sn||an&&!(131072&sn.f)||!(4325394&sn.f)||(null==cn?void 0:cn.includes(t))||function(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}(),xe(t,n?ke(e):e)}function xe(t,e){if(!t.equals(e)){var n=t.v;rn?pe.set(t,e):pe.set(t,n),t.v=e;var i=Ut.ensure();i.capture(t,n),2&t.f&&(0!==(t.f&ft)&&ce(t),Wn(t,0!==(t.f&ut)?ct:ht)),t.wv=xn(),ze(t,ft),null===dn||0===(dn.f&ct)||96&dn.f||(null===vn?function(t){vn=t}([t]):vn.push(t)),!i.is_fork&&he.size>0&&!ve&&function(){ve=!1;var t=en;nn(!0);const e=Array.from(he);try{for(const t of e)0!==(t.f&ct)&&Wn(t,ht),bn(t)&&_n(t)}finally{nn(t)}he.clear()}()}return e}function be(t,e=1){var n=Dn(t),i=1===e?n++:n--;return ye(t,n),i}function Me(t){ye(t,t.v+1)}function ze(t,e){var n=t.reactions;if(null!==n)for(var i=n.length,r=0;r<i;r++){var o=n[r],s=o.f,a=0===(s&ft);if(a&&Wn(o,e),2&s){var l=o;null==Yt||Yt.delete(l),0===(s&bt)&&(s&ut&&(o.f|=bt),ze(l,ht))}else a&&(0!==(s&dt)&&null!==Zt&&Zt.add(o),ie(o))}}function ke(t){if("object"!=typeof t||null===t||kt in t)return t;const e=ot(t);if(e!==it&&e!==rt)return t;var n=new Map,i=Q(t),r=me(0),o=wn,s=t=>{if(wn===o)return t();var e=sn,n=wn;ln(null),yn(o);var i=t();return ln(e),yn(n),i};return i&&n.set("length",me(t.length)),new Proxy(t,{defineProperty(t,e,i){"value"in i&&!1!==i.configurable&&!1!==i.enumerable&&!1!==i.writable||function(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}();var r=n.get(e);return void 0===r?r=s(()=>{var t=me(i.value);return n.set(e,t),t}):ye(r,i.value,!0),!0},deleteProperty(t,e){var i=n.get(e);if(void 0===i){if(e in t){const t=s(()=>me(U));n.set(e,t),Me(r)}}else ye(i,U),Me(r);return!0},get(e,i,r){var o;if(i===kt)return t;var a=n.get(i),l=i in e;if(void 0!==a||l&&!(null==(o=et(e,i))?void 0:o.writable)||(a=s(()=>me(ke(l?e[i]:U))),n.set(i,a)),void 0!==a){var d=Dn(a);return d===U?void 0:d}return Reflect.get(e,i,r)},getOwnPropertyDescriptor(t,e){var i=Reflect.getOwnPropertyDescriptor(t,e);if(i&&"value"in i){var r=n.get(e);r&&(i.value=Dn(r))}else if(void 0===i){var o=n.get(e),s=null==o?void 0:o.v;if(void 0!==o&&s!==U)return{enumerable:!0,configurable:!0,value:s,writable:!0}}return i},has(t,e){var i;if(e===kt)return!0;var r=n.get(e),o=void 0!==r&&r.v!==U||Reflect.has(t,e);return!((void 0!==r||null!==dn&&(!o||(null==(i=et(t,e))?void 0:i.writable)))&&(void 0===r&&(r=s(()=>me(o?ke(t[e]):U)),n.set(e,r)),Dn(r)===U))&&o},set(t,e,o,a){var l,d=n.get(e),u=e in t;if(i&&"length"===e)for(var c=o;c<d.v;c+=1){var f=n.get(c+"");void 0!==f?ye(f,U):c in t&&(f=s(()=>me(U)),n.set(c+"",f))}void 0===d?u&&!(null==(l=et(t,e))?void 0:l.writable)||(ye(d=s(()=>me(void 0)),ke(o)),n.set(e,d)):(u=d.v!==U,ye(d,s(()=>ke(o))));var h=Reflect.getOwnPropertyDescriptor(t,e);if((null==h?void 0:h.set)&&h.set.call(a,o),!u){if(i&&"string"==typeof e){var p=n.get("length"),v=Number(e);Number.isInteger(v)&&v>=p.v&&ye(p,v+1)}Me(r)}return!0},ownKeys(t){Dn(r);var e=Reflect.ownKeys(t).filter(t=>{var e=n.get(t);return void 0===e||e.v!==U});for(var[i,o]of n)o.v===U||i in t||e.push(i);return e},setPrototypeOf(){!function(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}()}})}var Ie,_e,Pe,De;function Ce(t=""){return document.createTextNode(t)}function Se(t){return Pe.call(t)}function Oe(t){return De.call(t)}function Ee(t,e){return Se(t)}function We(t,e=!1){var n=Se(t);return n instanceof Comment&&""===n.data?Oe(n):n}function Te(t,e=1,n=!1){let i=t;for(;e--;)i=Oe(i);return i}function Be(t){var e=sn,n=dn;ln(null),un(null);try{return t()}finally{ln(e),un(n)}}function Re(t,e,n){var i=dn;null!==i&&0!==(i.f&pt)&&(t|=pt);var r={ctx:Ot,deps:null,nodes:null,f:t|ft|ut,first:null,fn:e,last:null,next:null,parent:i,b:i&&i.b,prev:null,teardown:null,wv:0,ac:null};if(n)try{_n(r),r.f|=gt}catch(t){throw Ge(r),t}else null!==e&&ie(r);var o=r;if(n&&null===o.deps&&null===o.teardown&&null===o.nodes&&o.first===o.last&&0===(o.f&yt)&&(o=o.first,0!==(t&dt)&&0!==(t&mt)&&null!==o&&(o.f|=mt)),null!==o&&(o.parent=i,null!==i&&function(t,e){var n=e.last;null===n?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}(o,i),null!==sn&&2&sn.f&&!(64&t))){var s=sn;(s.effects??(s.effects=[])).push(o)}return r}function Ae(){return null!==sn&&!an}function Le(t){const e=Re(8,null,!1);return Wn(e,ct),e.teardown=t,e}function He(t){null===dn&&(null===sn&&function(){throw new Error("https://svelte.dev/e/effect_orphan")}(),function(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}()),rn&&function(){throw new Error("https://svelte.dev/e/effect_in_teardown")}();var e=dn.f;if(sn||!(32&e)||0!==(e&gt))return $e(t);var n=Ot;(n.e??(n.e=[])).push(t)}function $e(t){return Re(1048580,t,!1)}function Fe(t){return Re(4,t,!1)}function qe(t,e=0){return Re(8|e,t,!0)}function je(t,e=[],n=[],i=[]){!function(t,e,n,i){const r=se;if(0!==n.length||0!==t.length){var o,s,a,l,d=Xt,u=dn,c=(o=dn,s=sn,a=Ot,l=Xt,function(t=!0){un(o),ln(s),Et(a),t&&(null==l||l.activate())});t.length>0?Promise.all(t).then(()=>{c();try{return f()}finally{null==d||d.deactivate(),oe()}}):f()}else i(e.map(r));function f(){Promise.all(n.map(t=>ae(t))).then(t=>{c();try{i([...e.map(r),...t])}catch(t){0===(u.f&vt)&&qt(t,u)}null==d||d.deactivate(),oe()}).catch(t=>{qt(t,u)})}}(i,e,n,e=>{Re(8,()=>t(...e.map(Dn)),!0)})}function Xe(t,e=0){return Re(dt|e,t,!0)}function Ye(t){return Re(524320,t,!0)}function Ne(t){var e=t.teardown;if(null!==e){const t=rn,n=sn;on(!0),ln(null);try{e.call(null)}finally{on(t),ln(n)}}}function Ke(t,e=!1){var n=t.first;for(t.first=t.last=null;null!==n;){const t=n.ac;null!==t&&Be(()=>{t.abort(_t)});var i=n.next;64&n.f?n.parent=null:Ge(n,e),n=i}}function Ge(t,e=!0){var n=!1;!e&&0===(t.f&wt)||null===t.nodes||null===t.nodes.end||(function(t,e){for(;null!==t;){var n=t===e?null:Oe(t);t.remove(),t=n}}(t.nodes.start,t.nodes.end),n=!0),Ke(t,e&&!n),In(t,0),Wn(t,vt);var i=t.nodes&&t.nodes.t;if(null!==i)for(const t of i)t.stop();Ne(t);var r=t.parent;null!==r&&null!==r.first&&Ve(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=null}function Ve(t){var e=t.parent,n=t.prev,i=t.next;null!==n&&(n.next=i),null!==i&&(i.prev=n),null!==e&&(e.first===t&&(e.first=i),e.last===t&&(e.last=n))}function Ue(t,e,n=!0){var i=[];Qe(t,i,!0);var r=()=>{n&&Ge(t),e&&e()},o=i.length;if(o>0){var s=()=>--o||r();for(var a of i)a.out(s)}else r()}function Qe(t,e,n){if(0===(t.f&pt)){t.f^=pt;var i=t.nodes&&t.nodes.t;if(null!==i)for(const t of i)(t.is_global||n)&&e.push(t);for(var r=t.first;null!==r;){var o=r.next;Qe(r,e,!!(0!==(r.f&mt)||32&r.f&&0!==(t.f&dt))&&n),r=o}}}function Je(t){Ze(t,!0)}function Ze(t,e){if(0!==(t.f&pt)){t.f^=pt,0===(t.f&ct)&&(Wn(t,ft),ie(t));for(var n=t.first;null!==n;){var i=n.next;Ze(n,!!(0!==(n.f&mt)||32&n.f)&&e),n=i}var r=t.nodes&&t.nodes.t;if(null!==r)for(const t of r)(t.is_global||e)&&t.in()}}function tn(t,e){if(t.nodes)for(var n=t.nodes.start,i=t.nodes.end;null!==n;){var r=n===i?null:Oe(n);e.append(n),n=r}}let en=!1;function nn(t){en=t}let rn=!1;function on(t){rn=t}let sn=null,an=!1;function ln(t){sn=t}let dn=null;function un(t){dn=t}let cn=null;function fn(t){null!==sn&&(null===cn?cn=[t]:cn.push(t))}let hn=null,pn=0,vn=null,gn=1,mn=0,wn=mn;function yn(t){wn=t}function xn(){return++gn}function bn(t){var e=t.f;if(0!==(e&ft))return!0;if(2&e&&(t.f&=-32769),0!==(e&ht)){var n=t.deps;if(null!==n)for(var i=n.length,r=0;r<i;r++){var o=n[r];if(bn(o)&&fe(o),o.wv>t.wv)return!0}0!==(e&ut)&&null===Yt&&Wn(t,ct)}return!1}function Mn(t,e,n=!0){var i=t.reactions;if(null!==i&&!(null==cn?void 0:cn.includes(t)))for(var r=0;r<i.length;r++){var o=i[r];2&o.f?Mn(o,e,!1):e===o&&(n?Wn(o,ft):0!==(o.f&ct)&&Wn(o,ht),ie(o))}}function zn(t){var e,n=hn,i=pn,r=vn,o=sn,s=cn,a=Ot,l=an,d=wn,u=t.f;hn=null,pn=0,vn=null,sn=96&u?null:t,cn=null,Et(t.ctx),an=!1,wn=++mn,null!==t.ac&&(Be(()=>{t.ac.abort(_t)}),t.ac=null);try{t.f|=Mt;var c=(0,t.fn)(),f=t.deps;if(null!==hn){var h;if(In(t,pn),null!==f&&pn>0)for(f.length=pn+hn.length,h=0;h<hn.length;h++)f[pn+h]=hn[h];else t.deps=f=hn;if(Ae()&&0!==(t.f&ut))for(h=pn;h<f.length;h++)((e=f[h]).reactions??(e.reactions=[])).push(t)}else null!==f&&pn<f.length&&(In(t,pn),f.length=pn);if(!(null===vn||an||null===f||6146&t.f))for(h=0;h<vn.length;h++)Mn(vn[h],t);return null!==o&&o!==t&&(mn++,null!==vn&&(null===r?r=vn:r.push(...vn))),0!==(t.f&zt)&&(t.f^=zt),c}catch(t){return Ft(t)}finally{t.f^=Mt,hn=n,pn=i,vn=r,sn=o,cn=s,Et(a),an=l,wn=d}}function kn(t,e){let n=e.reactions;if(null!==n){var i=J.call(n,t);if(-1!==i){var r=n.length-1;0===r?n=e.reactions=null:(n[i]=n[r],n.pop())}}null===n&&2&e.f&&(null===hn||!hn.includes(e))&&(Wn(e,ht),0!==(e.f&ut)&&(e.f^=ut,e.f&=-32769),ue(e),In(e,0))}function In(t,e){var n=t.deps;if(null!==n)for(var i=e;i<n.length;i++)kn(t,n[i])}function _n(t){var e=t.f;if(0===(e&vt)){Wn(t,ct);var n=dn,i=en;dn=t,en=!0;try{16777232&e?function(t){for(var e=t.first;null!==e;){var n=e.next;!(32&e.f)&&Ge(e),e=n}}(t):Ke(t),Ne(t);var r=zn(t);t.teardown="function"==typeof r?r:null,t.wv=gn}finally{en=i,dn=n}}}async function Pn(){await Promise.resolve(),function(){var t=Vt;Vt=!0;try{for(;;){if($t(),0===Nt.length&&(null==Xt||Xt.flush(),0===Nt.length))return void(Kt=null);Qt()}}finally{Vt=t}}()}function Dn(t){var e=!!(2&t.f);if(!(null===sn||an||null!==dn&&0!==(dn.f&vt)||(null==cn?void 0:cn.includes(t)))){var n=sn.deps;if(0!==(sn.f&Mt))t.rv<mn&&(t.rv=mn,null===hn&&null!==n&&n[pn]===t?pn++:null===hn?hn=[t]:hn.includes(t)||hn.push(t));else{(sn.deps??(sn.deps=[])).push(t);var i=t.reactions;null===i?t.reactions=[sn]:i.includes(sn)||i.push(sn)}}if(rn){if(pe.has(t))return pe.get(t);if(e){var r=t,o=r.v;return(0===(r.f&ct)&&null!==r.reactions||Sn(r))&&(o=ce(r)),pe.set(r,o),o}}else e&&(!(null==Yt?void 0:Yt.has(t))||(null==Xt?void 0:Xt.is_fork)&&!Ae())&&(bn(r=t)&&fe(r),en&&Ae()&&0===(r.f&ut)&&Cn(r));if(null==Yt?void 0:Yt.has(t))return Yt.get(t);if(0!==(t.f&zt))throw t.v;return t.v}function Cn(t){if(null!==t.deps){t.f^=ut;for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),2&e.f&&0===(e.f&ut)&&Cn(e)}}function Sn(t){if(t.v===U)return!0;if(null===t.deps)return!1;for(const e of t.deps){if(pe.has(e))return!0;if(2&e.f&&Sn(e))return!0}return!1}function On(t){var e=an;try{return an=!0,t()}finally{an=e}}const En=-7169;function Wn(t,e){t.f=t.f&En|e}function Tn(t,e=new Set){if(!("object"!=typeof t||null===t||t instanceof EventTarget||e.has(t))){e.add(t),t instanceof Date&&t.getTime();for(let n in t)try{Tn(t[n],e)}catch(t){}const n=ot(t);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const e=nt(n);for(let n in e){const i=e[n].get;if(i)try{i.call(t)}catch(t){}}}}}const Bn=new Set,Rn=new Set;function An(t){for(var e=0;e<t.length;e++)Bn.add(t[e]);for(var n of Rn)n(t)}let Ln=null;function Hn(t){var e,n=this,i=n.ownerDocument,r=t.type,o=(null==(e=t.composedPath)?void 0:e.call(t))||[],s=o[0]||t.target;Ln=t;var a=0,l=Ln===t&&t.__root;if(l){var d=o.indexOf(l);if(-1!==d&&(n===document||n===window))return void(t.__root=n);var u=o.indexOf(n);if(-1===u)return;d<=u&&(a=d)}if((s=o[a]||t.target)!==n){tt(t,"currentTarget",{configurable:!0,get:()=>s||i});var c=sn,f=dn;ln(null),un(null);try{for(var h,p=[];null!==s;){var v=s.assignedSlot||s.parentNode||s.host||null;try{var g=s["__"+r];null==g||s.disabled&&t.target!==s||g.call(s,t)}catch(t){h?p.push(t):h=t}if(t.cancelBubble||v===n||null===v)break;s=v}if(h){for(let t of p)queueMicrotask(()=>{throw t});throw h}}finally{t.__root=n,delete t.currentTarget,ln(c),un(f)}}}function $n(t,e){var n=dn;null===n.nodes&&(n.nodes={start:t,end:e,a:null,t:null})}function Fn(t,e){var n,i=!!(1&e),r=!!(2&e),o=!t.startsWith("<!>");return()=>{var e,s;void 0===n&&(e=o?t:"<!>"+t,(s=document.createElement("template")).innerHTML=e.replaceAll("<!>","\x3c!----\x3e"),n=s.content,i||(n=Se(n)));var a=r||_e?document.importNode(n,!0):n.cloneNode(!0);return i?$n(Se(a),a.lastChild):$n(a,a),a}}function qn(){var t=document.createDocumentFragment(),e=document.createComment(""),n=Ce();return t.append(e,n),$n(e,n),t}function jn(t,e){null!==t&&t.before(e)}const Xn=["touchstart","touchmove"];function Yn(t){return Xn.includes(t)}let Nn=!0;function Kn(t,e){var n=null==e?"":"object"==typeof e?e+"":e;n!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=n,t.nodeValue=n+"")}function Gn(t,e){return function(t,{target:e,anchor:n,props:i={},events:r,context:o,intro:s=!0}){!function(){if(void 0===Ie){Ie=window,_e=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;Pe=et(e,"firstChild").get,De=et(e,"nextSibling").get,st(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),st(n)&&(n.__t=void 0)}}();var a=new Set,l=t=>{for(var n=0;n<t.length;n++){var i=t[n];if(!a.has(i)){a.add(i);var r=Yn(i);e.addEventListener(i,Hn,{passive:r});var o=Vn.get(i);void 0===o?(document.addEventListener(i,Hn,{passive:r}),Vn.set(i,1)):Vn.set(i,o+1)}}};l(Z(Bn)),Rn.add(l);var d=void 0,u=function(){Ut.ensure();const u=Re(524352,()=>{var u=n??e.appendChild(Ce());return new re(u,{pending:()=>{}},e=>{o&&(Tt({}),Ot.c=o),r&&(i.$$events=r),Nn=s,d=t(e,i)||{},Nn=!0,o&&Bt()}),()=>{var t;for(var i of a){e.removeEventListener(i,Hn);var r=Vn.get(i);0===--r?(document.removeEventListener(i,Hn),Vn.delete(i)):Vn.set(i,r)}Rn.delete(l),u!==n&&(null==(t=u.parentNode)||t.removeChild(u))}},!0);return(t={})=>new Promise(e=>{t.outro?Ue(u,()=>{Ge(u),e(void 0)}):(Ge(u),e(void 0))})}();return Un.set(d,u),d}(t,e)}const Vn=new Map;let Un=new WeakMap;function Qn(t,e){const n=Un.get(t);return n?(Un.delete(t),n(e)):Promise.resolve()}class Jn{constructor(t,e=!0){X(this,"anchor"),K(this,T,new Map),K(this,B,new Map),K(this,R,new Map),K(this,A,new Set),K(this,L,!0),K(this,H,()=>{var t=Xt;if(N(this,T).has(t)){var e=N(this,T).get(t),n=N(this,B).get(e);if(n)Je(n),N(this,A).delete(e);else{var i=N(this,R).get(e);i&&(N(this,B).set(e,i.effect),N(this,R).delete(e),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),n=i.effect)}for(const[e,n]of N(this,T)){if(N(this,T).delete(e),e===t)break;const i=N(this,R).get(n);i&&(Ge(i.effect),N(this,R).delete(n))}for(const[t,i]of N(this,B)){if(t===e||N(this,A).has(t))continue;const r=()=>{if(Array.from(N(this,T).values()).includes(t)){var e=document.createDocumentFragment();tn(i,e),e.append(Ce()),N(this,R).set(t,{effect:i,fragment:e})}else Ge(i);N(this,A).delete(t),N(this,B).delete(t)};N(this,L)||!n?(N(this,A).add(t),Ue(i,r,!1)):r()}}}),K(this,$,t=>{N(this,T).delete(t);const e=Array.from(N(this,T).values());for(const[t,n]of N(this,R))e.includes(t)||(Ge(n.effect),N(this,R).delete(t))}),this.anchor=t,G(this,L,e)}ensure(t,e){var n=Xt;!e||N(this,B).has(t)||N(this,R).has(t)||N(this,B).set(t,Ye(()=>e(this.anchor))),N(this,T).set(n,t),N(this,H).call(this)}}function Zn(t,e,...n){var i=new Jn(t);Xe(()=>{const t=e()??null;i.ensure(t,t&&(e=>t(e,...n)))},mt)}function ti(t){null===Ot&&Pt(),He(()=>{const e=On(t);if("function"==typeof e)return e})}function ei(t){null===Ot&&Pt(),ti(()=>()=>On(t))}function ni(t,e,n=!1){var i=new Jn(t);function r(t,e){i.ensure(t,e)}Xe(()=>{var t=!1;e((e,n=!0)=>{t=!0,r(n,e)}),t||r(!1,null)},n?mt:0)}function ii(t,e){return e}function ri(t,e=!0){for(var n=0;n<t.length;n++)Ge(t[n],e)}var oi;function si(t,e,n,i,r,o=null){var s=t,a=new Map;!(4&e)||(s=t.appendChild(Ce()));var l,d=null,u=de(()=>{var t=n();return Q(t)?t:null==t?[]:Z(t)}),c=!0,f={effect:Xe(()=>{for(var t=(l=Dn(u)).length,h=new Set,p=0;p<t;p+=1){var v=l[p],g=i(v,p),m=c?null:a.get(g);m?(m.v&&xe(m.v,v),m.i&&xe(m.i,p)):(m=ai(a,c?s:oi??(oi=Ce()),v,g,p,r,e,n),c||(m.e.f|=xt),a.set(g,m)),h.add(g)}0===t&&o&&!d&&(c?d=Ye(()=>o(s)):(d=Ye(()=>o(oi??(oi=Ce())))).f|=xt),c||(f.fallback=d,function(t,e,n,i,r){var o,s,a,l,d,u,c,f,h,p,v,g,m,w,y=!!(8&i),x=e.length,b=t.items,M=t.effect.first,z=null,k=[],I=[];if(y)for(w=0;w<x;w+=1)g=r(e[w],w),0===((m=b.get(g).e).f&xt)&&(null==(s=null==(o=m.nodes)?void 0:o.a)||s.measure(),(v??(v=new Set)).add(m));for(w=0;w<x;w+=1){if(g=r(e[w],w),m=b.get(g).e,null!==t.outrogroups)for(const e of t.outrogroups)e.pending.delete(m),e.done.delete(m);if(0!==(m.f&xt)){if(m.f^=xt,m!==M){var _=z?z.next:M;m===t.effect.last&&(t.effect.last=m.prev),m.prev&&(m.prev.next=m.next),m.next&&(m.next.prev=m.prev),di(t,z,m),di(t,m,_),li(m,_,n),k=[],I=[],M=(z=m).next;continue}li(m,null,n)}if(0!==(m.f&pt)&&(Je(m),y&&(null==(l=null==(a=m.nodes)?void 0:a.a)||l.unfix(),(v??(v=new Set)).delete(m))),m!==M){if(void 0!==p&&p.has(m)){if(k.length<I.length){var P,D=I[0];z=D.prev;var C=k[0],S=k[k.length-1];for(P=0;P<k.length;P+=1)li(k[P],D,n);for(P=0;P<I.length;P+=1)p.delete(I[P]);di(t,C.prev,S.next),di(t,z,C),di(t,S,D),M=D,z=S,w-=1,k=[],I=[]}else p.delete(m),li(m,M,n),di(t,m.prev,m.next),di(t,m,null===z?t.effect.first:z.next),di(t,z,m),z=m;continue}for(k=[],I=[];null!==M&&M!==m;)(p??(p=new Set)).add(M),I.push(M),M=M.next;if(null===M)continue}0===(m.f&xt)&&k.push(m),z=m,M=m.next}if(null!==t.outrogroups){for(const e of t.outrogroups)0===e.pending.size&&(ri(Z(e.done)),null==(d=t.outrogroups)||d.delete(e));0===t.outrogroups.size&&(t.outrogroups=null)}if(null!==M||void 0!==p){var O=[];if(void 0!==p)for(m of p)0===(m.f&pt)&&O.push(m);for(;null!==M;)0===(M.f&pt)&&M!==t.fallback&&O.push(M),M=M.next;var E=O.length;if(E>0){var W=4&i&&0===x?n:null;if(y){for(w=0;w<E;w+=1)null==(c=null==(u=O[w].nodes)?void 0:u.a)||c.measure();for(w=0;w<E;w+=1)null==(h=null==(f=O[w].nodes)?void 0:f.a)||h.fix()}!function(t,e,n){for(var i,r=e.length,o=e.length,s=0;s<r;s++){let n=e[s];Ue(n,()=>{if(i){if(i.pending.delete(n),i.done.add(n),0===i.pending.size){var e=t.outrogroups;ri(Z(i.done)),e.delete(i),0===e.size&&(t.outrogroups=null)}}else o-=1},!1)}if(0===o){var a=null!==n;if(a){var l=n,d=l.parentNode;d.textContent="",d.append(l),t.items.clear()}ri(e,!a)}else i={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(i)}(t,O,W)}}y&&Ht(()=>{var t,e;if(void 0!==v)for(m of v)null==(e=null==(t=m.nodes)?void 0:t.a)||e.apply()})}(f,l,s,e,i),null!==d&&(0===l.length?0===(d.f&xt)?Je(d):(d.f^=xt,li(d,null,s)):Ue(d,()=>{d=null}))),Dn(u)}),items:a,outrogroups:null,fallback:d};c=!1}function ai(t,e,n,i,r,o,s,a){var l=1&s?16&s?ge(n):we(n,!1,!1):null,d=2&s?ge(r):null;return{v:l,i:d,e:Ye(()=>(o(e,l??n,d??r,a),()=>{t.delete(i)}))}}function li(t,e,n){if(t.nodes)for(var i=t.nodes.start,r=t.nodes.end,o=e&&0===(e.f&xt)?e.nodes.start:n;null!==i;){var s=Oe(i);if(o.before(i),i===r)return;i=s}}function di(t,e,n){null===e?t.effect.first=n:e.next=n,null===n?t.effect.last=e:n.prev=e}T=new WeakMap,B=new WeakMap,R=new WeakMap,A=new WeakMap,L=new WeakMap,H=new WeakMap,$=new WeakMap;const ui={tick:t=>requestAnimationFrame(t),now:()=>performance.now(),tasks:new Set};function ci(){const t=ui.now();ui.tasks.forEach(e=>{e.c(t)||(ui.tasks.delete(e),e.f())}),0!==ui.tasks.size&&ui.tick(ci)}function fi(t,e){Be(()=>{t.dispatchEvent(new CustomEvent(e))})}function hi(t){if("float"===t)return"cssFloat";if("offset"===t)return"cssOffset";if(t.startsWith("--"))return t;const e=t.split("-");return 1===e.length?e[0]:e[0]+e.slice(1).map(t=>t[0].toUpperCase()+t.slice(1)).join("")}function pi(t){const e={},n=t.split(";");for(const t of n){const[n,i]=t.split(":");if(!n||void 0===i)break;e[hi(n.trim())]=i.trim()}return e}const vi=t=>t;function gi(t,e,n,i){var r,o,s,a,l=!!(4&t),d=e.inert,u=e.style.overflow;function c(){return Be(()=>o??(o=n()(e,(null==i?void 0:i())??{},{direction:"both"})))}var f={is_global:l,in(){e.inert=d,fi(e,"introstart"),s=mi(e,c(),a,1,()=>{fi(e,"introend"),null==s||s.abort(),s=o=void 0,e.style.overflow=u})},out(t){e.inert=!0,fi(e,"outrostart"),a=mi(e,c(),s,0,()=>{fi(e,"outroend"),null==t||t()})},stop:()=>{null==s||s.abort(),null==a||a.abort()}},h=dn;if(((r=h.nodes).t??(r.t=[])).push(f),Nn){var p=l;if(!p){for(var v=h.parent;v&&0!==(v.f&mt);)for(;(v=v.parent)&&0===(v.f&dt););p=!v||0!==(v.f&gt)}p&&Fe(()=>{On(()=>f.in())})}}function mi(t,e,n,i,r){var o=1===i;if("function"==typeof e){var s,a=!1;return Ht(()=>{if(!a){var l=e({direction:o?"in":"out"});s=mi(t,l,n,i,r)}}),{abort:()=>{a=!0,null==s||s.abort()},deactivate:()=>s.deactivate(),reset:()=>s.reset(),t:()=>s.t()}}if(null==n||n.deactivate(),!(null==e?void 0:e.duration))return r(),{abort:at,deactivate:at,reset:at,t:()=>i};const{delay:l=0,css:d,tick:u,easing:c=vi}=e;var f=[];if(o&&void 0===n&&(u&&u(0,1),d)){var h=pi(d(0,1));f.push(h,h)}var p=()=>1-i,v=t.animate(f,{duration:l,fill:"forwards"});return v.onfinish=()=>{v.cancel();var o=(null==n?void 0:n.t())??1-i;null==n||n.abort();var s=i-o,a=e.duration*Math.abs(s),l=[];if(a>0){var f=!1;if(d)for(var h=Math.ceil(a/(1e3/60)),g=0;g<=h;g+=1){var m=o+s*c(g/h),w=pi(d(m,1-m));l.push(w),f||(f="hidden"===w.overflow)}f&&(t.style.overflow="hidden"),p=()=>{var t=v.currentTime;return o+s*c(t/a)},u&&function(t){let e;0===ui.tasks.size&&ui.tick(ci),new Promise(n=>{ui.tasks.add(e={c:t,f:n})})}(()=>{if("running"!==v.playState)return!1;var t=p();return u(t,1-t),!0})}(v=t.animate(l,{duration:a,fill:"forwards"})).onfinish=()=>{p=()=>i,null==u||u(i,1-i),r()}},{abort:()=>{v&&(v.cancel(),v.effect=null,v.onfinish=at)},deactivate:()=>{r=at},reset:()=>{0===i&&(null==u||u(1,0))},t:()=>p()}}function wi(t,e,n){Fe(()=>{var i=On(()=>e(t,null==n?void 0:n())||{});if(n&&(null==i?void 0:i.update)){var r=!1,o={};qe(()=>{var t=n();!function(t){if("object"==typeof t&&t&&!(t instanceof EventTarget))if(kt in t)Tn(t);else if(!Array.isArray(t))for(let e in t){const n=t[e];"object"==typeof n&&n&&kt in n&&Tn(n)}}(t),r&&Ct(o,t)&&(o=t,i.update(t))}),r=!0}if(null==i?void 0:i.destroy)return()=>i.destroy()})}const yi=[..." \t\n\r\f \v\ufeff"];function xi(t,e=!1){var n=e?" !important;":";",i="";for(var r in t){var o=t[r];null!=o&&""!==o&&(i+=" "+r+": "+o+n)}return i}function bi(t){return"-"!==t[0]||"-"!==t[1]?t.toLowerCase():t}function Mi(t,e,n,i,r,o){var s=t.__className;if(s!==n||void 0===s){var a=function(t,e,n){var i=null==t?"":""+t;if(e&&(i=i?i+" "+e:e),n)for(var r in n)if(n[r])i=i?i+" "+r:r;else if(i.length)for(var o=r.length,s=0;(s=i.indexOf(r,s))>=0;){var a=s+o;0!==s&&!yi.includes(i[s-1])||a!==i.length&&!yi.includes(i[a])?s=a:i=(0===s?"":i.substring(0,s))+i.substring(a+1)}return""===i?null:i}(n,i,o);null==a?t.removeAttribute("class"):t.className=a,t.__className=n}else if(o&&r!==o)for(var l in o){var d=!!o[l];null!=r&&d===!!r[l]||t.classList.toggle(l,d)}return o}function zi(t,e={},n,i){for(var r in n){var o=n[r];e[r]!==o&&(null==n[r]?t.style.removeProperty(r):t.style.setProperty(r,o,i))}}function ki(t,e,n,i){if(t.__style!==e){var r=function(t,e){if(e){var n,i,r="";if(Array.isArray(e)?(n=e[0],i=e[1]):n=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var o=!1,s=0,a=!1,l=[];n&&l.push(...Object.keys(n).map(bi)),i&&l.push(...Object.keys(i).map(bi));var d=0,u=-1;const e=t.length;for(var c=0;c<e;c++){var f=t[c];if(a?"/"===f&&"*"===t[c-1]&&(a=!1):o?o===f&&(o=!1):"/"===f&&"*"===t[c+1]?a=!0:'"'===f||"'"===f?o=f:"("===f?s++:")"===f&&s--,!a&&!1===o&&0===s)if(":"===f&&-1===u)u=c;else if(";"===f||c===e-1){if(-1!==u){var h=bi(t.substring(d,u).trim());l.includes(h)||(";"!==f&&c++,r+=" "+t.substring(d,c).trim()+";")}d=c+1,u=-1}}}return n&&(r+=xi(n)),i&&(r+=xi(i,!0)),""===(r=r.trim())?null:r}return null==t?null:String(t)}(e,i);null==r?t.removeAttribute("style"):t.style.cssText=r,t.__style=e}else i&&(Array.isArray(i)?(zi(t,null==n?void 0:n[0],i[0]),zi(t,null==n?void 0:n[1],i[1],"important")):zi(t,n,i));return i}const Ii=Symbol("is custom element"),_i=Symbol("is html");function Pi(t,e,n,i){var r=function(t){return t.__attributes??(t.__attributes={[Ii]:t.nodeName.includes("-"),[_i]:"http://www.w3.org/1999/xhtml"===t.namespaceURI})}(t);r[e]!==(r[e]=n)&&("loading"===e&&(t[It]=n),null==n?t.removeAttribute(e):"string"!=typeof n&&function(t){var e,n=t.getAttribute("is")||t.nodeName,i=Di.get(n);if(i)return i;Di.set(n,i=[]);for(var r=t,o=Element.prototype;o!==r;){for(var s in e=nt(r))e[s].set&&i.push(s);r=ot(r)}return i}(t).includes(e)?t[e]=n:t.setAttribute(e,n))}var Di=new Map;function Ci(t,e){return t===e||(null==t?void 0:t[kt])===e}function Si(t={},e,n,i){return Fe(()=>{var i,r;return qe(()=>{i=r,r=[],On(()=>{t!==n(...r)&&(e(t,...r),i&&Ci(n(...i),t)&&e(null,...i))})}),()=>{Ht(()=>{r&&Ci(n(...r),t)&&e(null,...r)})}}),t}function Oi(t,e,n,i){var r=i,o=!0,s=()=>(o&&(o=!1,r=i),r);return void 0===t[e]&&void 0!==i&&s(),()=>{var n=t[e];return void 0===n?s():(o=!0,n)}}const Ei={features:{dock:!0,minimize:!0,transparency:!0,resize:!0,drag:!0,focusTrap:!0,animations:!0,backdrop:!0,parentChild:!0},dock:{position:"bottom",labelMode:"beside",enableReorder:!0,enableFreeDrag:!0},animations:{open:400,close:250,minimize:500,restore:400},appearance:{headerLayout:"macos",defaultWidth:"480px",defaultHeight:"auto",minWidth:280,minHeight:200},zIndex:{base:400,dock:8e3,toast:9e3},parentChild:{movementMode:"animated",animationDuration:300},positioning:{strategy:"smart",modalGap:16,avoidElements:[]},portalTarget:"#modal-portal"};let Wi={...Ei},Ti=me(0);function Bi(){return Dn(Ti)}function Ri(){return Wi}function Ai(t){const e=Wi;var n,i;Wi={features:{...(n=Ei).features,...(i=t).features},dock:{...n.dock,...i.dock},animations:{...n.animations,...i.animations},appearance:{...n.appearance,...i.appearance},zIndex:{...n.zIndex,...i.zIndex},parentChild:{...n.parentChild,...i.parentChild},positioning:{...n.positioning,...i.positioning},portalTarget:i.portalTarget??n.portalTarget},be(Ti),e.features.dock&&!Wi.features.dock&&(Array.from(Qi.values()).filter(t=>t.isMinimized).map(t=>t.id).forEach(t=>{const e=Qi.get(t);if(e){Qi.set(t,{...e,isMinimized:!1,isOpen:!0}),ye(sr,[...Dn(sr),t],!0),kr(t);const n=e.lastChildId||e.childId;n&&br(n)}}),ye(gr,[],!0),tr())}function Li(){Wi={...Ei},be(Ti)}const Hi={BASE:0,DROPDOWN:100,STICKY:200,OVERLAY:300,MODAL:400,DOCK:8e3,TOAST:9e3};let $i=me(ke(Hi.MODAL));function Fi(){ye($i,Ri().zIndex.base,!0)}function qi(t){const e=Ri();return"MODAL"===t?e.zIndex.base:"DOCK"===t?e.zIndex.dock:"TOAST"===t?e.zIndex.toast:Hi[t]}function ji(){ye($i,Ri().zIndex.base,!0)}const Xi=8;function Yi(t,e,n,i,r={}){const{margin:o=Xi,allowPartialVisibility:s=!1}=r,a="undefined"!=typeof window?window.innerWidth:1920,l="undefined"!=typeof window?window.innerHeight:1080;let d,u,c,f;return s&&n>a-2*o?(d=40-n,u=a-40):(d=o,u=Math.max(o,a-n-o)),s&&i>l-2*o?(c=40-i,f=l-40):(c=o,f=Math.max(o,l-i-o)),{x:Math.max(d,Math.min(u,t)),y:Math.max(c,Math.min(f,e))}}function Ni(t,e,n,i,r={}){const{margin:o=Xi}=r,s=("undefined"!=typeof window?window.innerWidth:1920)-2*o,a=("undefined"!=typeof window?window.innerHeight:1080)-2*o,l=Math.min(n,s),d=Math.min(i,a),u=Yi(t,e,l,d,r);return{x:u.x,y:u.y,width:l,height:d}}function Ki(t,e){return Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x))*Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y))}function Gi(t,e,n,i,r,o){const s={x:t-o,y:e-o,width:n+2*o,height:i+2*o};let a=0;for(const t of r)a+=Ki(s,t);return a}function Vi(t,e,n,i,r,o,s){const a=(r-n)/2,l=(o-i)/2,d=a-s,u=l-s,c=Math.abs(t-a)/(d||1),f=Math.abs(e-l)/(u||1),h=Math.sqrt(c*c+f*f)/Math.SQRT2,p=50,v=t-s,g=r-n-s-t,m=e-s,w=o-i-s-e;let y=0;return v<p&&(y+=.3*(1-v/p)),g<p&&(y+=.3*(1-g/p)),m<p&&(y+=.2*(1-m/p)),w<p&&(y+=.2*(1-w/p)),Math.min(1,h+y)}function Ui(t){return"symbol"==typeof t?t.description??"symbol":t}let Qi=ke(new Map),Ji=me(0);const Zi=new Set;function tr(){be(Ji),queueMicrotask(()=>{Zi.forEach(t=>t())})}function er(t){return Zi.add(t),()=>Zi.delete(t)}let nr=me(ke([])),ir=me(ke([])),rr=me(ke([])),or=me(ke([])),sr=me(ke([])),ar=me(ke([])),lr=me(ke([])),dr=me(ke([])),ur=me(null),cr=ke(new Map),fr=me(null),hr=ke(new Map),pr=ke(new Set),vr=ke(new Set),gr=me(ke([]));function mr(t){const e=Qi.get(t.id),n=(null==e?void 0:e.zIndex)??function(){const t=Dn($i);return ye($i,Dn($i)+2),t}();e?Qi.set(t.id,{...e,title:t.title,icon:t.icon,glow:t.glow,zIndex:n}):Qi.set(t.id,{...t,zIndex:n,isAnimating:!1}),tr(),t.isMinimized&&!Dn(gr).includes(t.id)&&Dn(gr).push(t.id)}function wr(t){const e=Qi.get(t);if(e){if(ye(gr,Dn(gr).filter(e=>e!==t),!0),e.childId){const t=Qi.get(e.childId);t&&Qi.set(e.childId,{...t,parentId:void 0})}if(e.parentId){const t=Qi.get(e.parentId);t&&Qi.set(e.parentId,{...t,childId:void 0,lastChildId:e.id})}Qi.delete(t),tr(),vr.delete(t),pr.delete(t)}}function yr(t){const e=Qi.get(t);if(!e||e.isMinimized)return;if(Xr(t),e.parentId){const t=Qi.get(e.parentId);if(t&&!t.isMinimized)return void yr(e.parentId)}ye(nr,[...Dn(nr),t],!0),e.position&&e.size;const n=e.childId;Qi.set(t,{...e,isMinimized:!0,lastChildId:n}),tr(),Dn(gr).includes(t)||Dn(gr).push(t),e.childId&&function(t){const e=Qi.get(t);if(!(null==e?void 0:e.childId))return;const n=Qi.get(e.childId);n&&(Qi.set(e.childId,{...n,isHiddenWithParent:!0}),tr())}(t)}function xr(t){const e=Qi.get(t);if(!e||!e.isMinimized)return;Qi.set(t,{...e,isMinimized:!1,isOpen:!0}),tr(),ye(sr,[...Dn(sr),t],!0),kr(t);const n=e.lastChildId||e.childId;n&&br(n)}function br(t){const e=Qi.get(t);e&&e.isHiddenWithParent&&(Qi.set(t,{...e,isHiddenWithParent:!1}),tr(),ye(ar,[...Dn(ar),t],!0))}function Mr(t,e,n){const i=Qi.get(t);if(!i)return;let r=e;if((null==n?void 0:n.constrain)&&i.size&&(r=Yi(e.x,e.y,i.size.width,i.size.height)),Qi.set(t,{...i,position:r,size:(null==n?void 0:n.size)??i.size,hasBeenDragged:i.hasBeenDragged||(null==n?void 0:n.drag)||!1}),i.childId){let e=t,n=r;for(;;){const t=Qi.get(e);if(!(null==t?void 0:t.childId))break;const i=Qi.get(t.childId);if(!(null==i?void 0:i.offsetFromParent))break;const r={x:n.x+i.offsetFromParent.x,y:n.y+i.offsetFromParent.y};Qi.set(t.childId,{...i,position:r,hasBeenDragged:!0}),e=t.childId,n=r}}if(i.parentId&&i.offsetFromParent){const e=Ri();let n=t,o=i;for(;o.parentId&&o.offsetFromParent;){const i=Qi.get(o.parentId);if(!i)break;const s=n===t?r:Qi.get(n).position,a={x:s.x-o.offsetFromParent.x,y:s.y-o.offsetFromParent.y};"animated"===e.parentChild.movementMode?hr.set(o.parentId,a):Qi.set(o.parentId,{...i,position:a,hasBeenDragged:!0}),n=o.parentId,o=i}}tr()}function zr(t,e){const n=Qi.get(t);n&&(Qi.set(t,{...n,...e}),tr())}function kr(t){var e;const n=Qi.get(t);if(!n)return;const i=Math.max(...Array.from(Qi.values()).map(t=>t.zIndex),0);if(n.parentId){const r=Qi.get(n.parentId);r&&r.zIndex<i&&Qi.set(n.parentId,{...r,zIndex:i+2});const o=(null==(e=Qi.get(n.parentId))?void 0:e.zIndex)??i+2;return n.zIndex<=o&&Qi.set(t,{...n,zIndex:o+2}),void tr()}if(n.zIndex<i&&(Qi.set(t,{...n,zIndex:i+2}),tr()),n.childId){const e=Qi.get(n.childId),i=Qi.get(t);e&&i&&e.zIndex<=i.zIndex&&(Qi.set(n.childId,{...e,zIndex:i.zIndex+2}),tr())}}function Ir(t,e,n){const i=e.getBoundingClientRect();cr.set(t,{x:i.left+i.width/2,y:i.top+i.height/2});const r=Ri();(null==n?void 0:n.parentId)&&r.features.parentChild&&ye(fr,{parentId:n.parentId,childId:t},!0),Dn(ir).includes(t)||ye(ir,[...Dn(ir),t],!0),tr();const o=Qi.get(t);if(o){if(o.isOpen&&!o.isMinimized&&!o.isHiddenWithParent)return ye(ir,Dn(ir).filter(e=>e!==t),!0),Lr(t),void kr(t);if(o.isMinimized)return ye(ir,Dn(ir).filter(e=>e!==t),!0),void xr(t);Qi.set(t,{...o,isOpen:!0}),kr(t)}}function _r(t,e=!1){const n=Qi.get(t);n&&(Xr(t),e?ye(or,[...Dn(or),t],!0):ye(rr,[...Dn(rr),t],!0),tr(),n.childId&&_r(n.childId,e))}function Pr(){Array.from(Qi.keys()).forEach(t=>_r(t,!0))}function Dr(t,e,n){const i=Ri();if(n&&!cr.has(t.id)){const e=n.getBoundingClientRect();cr.set(t.id,{x:e.left+e.width/2,y:e.top+e.height/2})}const r={id:t.id,title:t.title??"",icon:t.icon??"",isOpen:!0,isMinimized:!1,isHiddenWithParent:!1,isTransparent:t.isTransparent??!1,isRejected:!1,position:t.position??null,size:t.size??null,hasBeenDragged:t.hasBeenDragged??!1,dockPosition:t.dockPosition??-1,glow:t.glow??null};if(!i.features.parentChild){mr(r);const e=Qi.get(t.id);return e&&Qi.set(t.id,{...e,isOpen:!0}),ye(ir,[...Dn(ir),t.id],!0),tr(),void kr(t.id)}const o=Qi.get(e);if(!o)return;o.childId&&_r(o.childId,!0),mr({...r,parentId:e});const s=Qi.get(t.id);s&&Qi.set(t.id,{...s,isOpen:!0,parentId:e}),ye(ir,[...Dn(ir),t.id],!0),tr(),kr(t.id),ye(fr,{parentId:e,childId:t.id},!0)}function Cr(t){return Dn(nr).includes(t)}function Sr(t){return Qi.get(t)}function Or(){return Dn(Ji)}function Er(t){return Dn(ir).includes(t)}function Wr(t){return Dn(rr).includes(t)}function Tr(t){return Dn(or).includes(t)}function Br(t){return!!Dn(or).includes(t)&&(ye(or,Dn(or).filter(e=>e!==t),!0),!0)}function Rr(t){return Dn(sr).includes(t)}function Ar(t){return Dn(ar).includes(t)}function Lr(t){Qi.get(t)&&(Dn(lr).includes(t)||Dn(dr).includes(t)||(ye(lr,[...Dn(lr),t],!0),tr()))}function Hr(t){const e=Qi.get(t);return void 0!==e&&e.isOpen&&!e.isMinimized&&!e.isHiddenWithParent}function $r(t){return Qi.has(t)}function Fr(){return{get modals(){return Qi},get pendingMinimize(){return Dn(nr)},get pendingOpen(){return Dn(ir)},get pendingClose(){return Dn(rr)},get pendingRestore(){return Dn(sr)},get dockOrder(){return Dn(gr)}}}function qr(t){vr.has(t)?vr.delete(t):vr.add(t);const e=Qi.get(t);e&&(Qi.set(t,{...e,isTransparent:vr.has(t)}),tr())}function jr(t){vr.delete(t);const e=Qi.get(t);e&&(Qi.set(t,{...e,isTransparent:!1}),tr())}function Xr(t){hr.delete(t)}"undefined"!=typeof window&&((F=window.__svelte??(window.__svelte={})).v??(F.v=new Set)).add("5");const Yr=Symbol("modal-render-icon"),Nr=Symbol("modal-id");function Kr(){return Ri().features.animations}const Gr=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function Vr(t){return Array.from(t.querySelectorAll(Gr)).filter(t=>null!==t.offsetParent||"A"===t.tagName)}function Ur(t,e){if("Tab"!==t.key)return;const n=Vr(e);if(0===n.length)return void t.preventDefault();const i=n[0],r=n[n.length-1],o=document.activeElement;t.shiftKey?o===i&&(r.focus(),t.preventDefault()):o===r&&(i.focus(),t.preventDefault())}function Qr(t){const e=Vr(t);return e.length>0&&(e[0].focus(),!0)}const Jr="modal-portal";var Zr=Fn('<div style="display: contents;"><!></div>');function to(t,e){Tt(e,!0);let n=Oi(e,"target",0,"body"),i=null,r=null;const{mount:o}={mount:function(t,e=null){const n=function(t){if("undefined"==typeof window)return null;if(t instanceof HTMLElement)return t;if("string"==typeof t){const e=document.querySelector(t);if(e)return e;if(t.startsWith("#")){const e=t.slice(1),n=document.createElement("div");return n.id=e,document.body.appendChild(n),n}}let e=document.getElementById(Jr);return e||(e=document.createElement("div"),e.id=Jr,document.body.appendChild(e)),e}(e);return n?(n.appendChild(t),()=>{t.parentNode===n&&n.removeChild(t),n.id!==Jr&&0===n.children.length&&n.parentNode&&n.parentNode.removeChild(n)}):()=>{}}};ti(()=>(i&&(r=o(i,n())),()=>{null==r||r()}));var s=Zr();Zn(Ee(s),()=>e.children),Si(s,t=>i=t,()=>i),jn(t,s),Bt()}var eo=Fn('<button type="button" aria-label="Minimize"></button>'),no=Fn('<button type="button" class="modal-header-light modal-header-light-style" aria-label="Toggle style"></button>'),io=Fn('<div class="modal-header-icon"><!></div>'),ro=Fn('<div class="modal-header-icon"><!></div>'),oo=Fn('<h2 class="modal-header-title"> </h2>'),so=Fn('<h2 class="modal-header-title"> </h2>'),ao=Fn('<div class="modal-header-traffic-lights"><button type="button" class="modal-header-light modal-header-light-close" aria-label="Close"></button> <!> <!></div> <div class="modal-header-mac-center"><!> <div class="modal-header-title-group"><!></div></div> <div class="modal-header-mac-spacer"></div>',1),lo=Fn('<div class="modal-header-icon"><!></div>'),uo=Fn('<div class="modal-header-icon"><!></div>'),co=Fn('<h2 class="modal-header-title"> </h2>'),fo=Fn('<h2 class="modal-header-title"> </h2>'),ho=Fn('<button type="button" class="modal-header-btn-windows modal-header-btn-windows-style" aria-label="Toggle style">&#9671;</button>'),po=Fn('<button type="button" aria-label="Minimize">&#8211;</button>'),vo=Fn('<div class="modal-header-title-group"><!> <!></div> <div class="modal-header-actions"><!> <!> <button type="button" class="modal-header-btn-windows modal-header-btn-windows-close" aria-label="Close">&times;</button></div>',1),go=Fn("<header><!></header>");An(["pointerdown","click"]);var mo=Fn("<div></div>"),wo=Fn('<div class="modal-resize-handles"></div>');function yo(t,e){return e&&t.appendChild(e),{update(e){t.innerHTML="",e&&t.appendChild(e)},destroy(){t.innerHTML=""}}}An(["pointerdown"]);var xo=Fn('<div class="modal-footer"><!></div>'),bo=Fn("<div></div>"),Mo=Fn('<div role="dialog" aria-modal="true" tabindex="-1"><!> <div class="modal-body"><!></div> <!> <!> <!></div>');function zo(t,e){Tt(e,!0);let n=Oi(e,"maxWidth",0,"600px"),i=Oi(e,"autoOpen",0,!1),r=Oi(e,"closeOnEscape",0,!0),o=Oi(e,"skipRegistration",0,!1);var s,a;s=Nr,a=()=>e.id,Rt().set(s,a);const l=Ri().portalTarget,d=le(()=>Ui(e.id));function u(t){var n,i;return(null==(i=null==(n=e.config)?void 0:n.features)?void 0:i[t])??function(t){return Wi.features[t]}(t)}const c=le(()=>(Bi(),u("drag"))),f=le(()=>(Bi(),u("minimize"))),h=le(()=>(Bi(),!u("dock"))),p=le(()=>(Bi(),u("transparency"))),v=le(()=>(Bi(),u("resize"))),g=le(()=>{var t,n;return Bi(),(null==(n=null==(t=e.config)?void 0:t.appearance)?void 0:n.headerLayout)??Ri().appearance.headerLayout});let m=me(null),w=me(!1),y=me(!1),x=me(!1),b=me(!1),M=me(!1);const z=le(()=>(Or(),Sr(e.id))),k=le(()=>Dn(z)&&(Dn(z).isOpen||Wr(e.id))&&(!Dn(z).isMinimized||Cr(e.id))&&!Dn(z).isHiddenWithParent),I=le(()=>{var t;return!!(null==(t=Dn(z))?void 0:t.childId)}),_=le(()=>{var t;return!!(null==(t=Dn(z))?void 0:t.parentId)}),P=le(()=>Dn(I)||Dn(y)),D=le(()=>!!e.glow),C=le(()=>`modal-title-${Dn(d)}`),S=le(()=>{var t;return(null==(t=Dn(z))?void 0:t.zIndex)??1e3}),O=function(t={x:0,y:0}){const e=ke({...t}),n=ke({isDragging:!1,startX:0,startY:0,initialX:0,initialY:0,hasBeenDragged:!1});return{get position(){return e},get hasBeenDragged(){return n.hasBeenDragged},get isDragging(){return n.isDragging},onPointerDown:function(t,i){if(0===t.button){if(!n.hasBeenDragged){const t=i.getBoundingClientRect();e.x=t.left,e.y=t.top}n.isDragging=!0,n.startX=t.clientX,n.startY=t.clientY,n.initialX=e.x,n.initialY=e.y,i.setPointerCapture(t.pointerId)}},onPointerMove:function(t,i,r){if(!n.isDragging)return;const o=t.clientX-n.startX,s=t.clientY-n.startY,a=Yi(n.initialX+o,n.initialY+s,r.width,r.height);e.x=a.x,e.y=a.y,n.hasBeenDragged=!0},onPointerUp:function(t,e){n.isDragging&&(n.isDragging=!1,e.releasePointerCapture(t.pointerId))},setPosition:function(t){e.x=t.x,e.y=t.y},setHasBeenDragged:function(t){n.hasBeenDragged=t},reset:function(){e.x=t.x,e.y=t.y,n.hasBeenDragged=!1}}}({x:0,y:0});let E=me(!1);const W=function(t,n,i){let r=me(!1),o=me(""),s=me(ke({width:0,height:0})),a=me(!1),l=me(!1),d={x:0,y:0,width:0,height:0,posX:0,posY:0},u=null;function c(e,l){e.preventDefault(),e.stopPropagation();const c=t();if(!c)return;const p=c.getBoundingClientRect();O.hasBeenDragged||(i({x:p.left,y:p.top}),O.setHasBeenDragged(!0)),Dn(a)||(ye(s,{width:p.width,height:p.height},!0),ye(a,!0));const v=n();ye(r,!0),ye(o,l,!0),u=e.pointerId,d={x:e.clientX,y:e.clientY,width:Dn(s).width,height:Dn(s).height,posX:v.x,posY:v.y,centerX:v.x+Dn(s).width/2,centerY:v.y+Dn(s).height/2},window.addEventListener("pointermove",f),window.addEventListener("pointerup",h),window.addEventListener("pointercancel",h)}function f(t){if(t.pointerId!==u)return;const e=t.clientX-d.x,n=t.clientY-d.y,r=window.innerWidth,a=window.innerHeight;let l=d.width,c=d.height,f=d.posX,h=d.posY;if(Dn(o).includes("e")){const t=r-f;l=Math.max(280,Math.min(d.width+e,t))}if(Dn(o).includes("w")){const t=d.width-280,n=Math.min(e,t);l=d.width-n,f=d.posX+n}if(Dn(o).includes("s")){const t=a-h;c=Math.max(200,Math.min(d.height+n,t))}if(Dn(o).includes("n")){const t=d.height-200,e=Math.min(n,t);c=d.height-e,h=d.posY+e}const p=Ni(f,h,l,c);ye(s,{width:p.width,height:p.height},!0),i({x:p.x,y:p.y})}function h(t){t.pointerId===u&&(ye(r,!1),u=null,window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),ye(l,!0),((t,n)=>{const i=Sr(e.id);if(null==i?void 0:i.parentId){const t=Sr(i.parentId),r=document.querySelector(`[data-modal-id="${Ui(i.parentId)}"]`);if(t&&r){const i=t.position??{x:r.getBoundingClientRect().left,y:r.getBoundingClientRect().top},o=t.size??{width:r.offsetWidth,height:r.offsetHeight},s={x:i.x+(o.width-n.width)/2,y:i.y+(o.height-n.height)/2};ye(E,!0),O.setPosition(s);const a={x:s.x-i.x,y:s.y-i.y};return zr(e.id,{position:s,size:n,hasBeenDragged:!0,offsetFromParent:a}),void setTimeout(()=>{ye(E,!1)},200)}}zr(e.id,{position:t,size:n,hasBeenDragged:!0})})(n(),Dn(s)),setTimeout(()=>{ye(l,!1)},0))}const p={startResize:c};return{get isResizing(){return Dn(r)},get resizeDirection(){return Dn(o)},get size(){return Dn(s)},get hasBeenResized(){return Dn(a)},get isActive(){return Dn(r)},get justFinishedResizing(){return Dn(l)},start:c,setHasBeenResized:()=>{},setSize:function(t){ye(s,t,!0),ye(a,!0)},reset:function(){ye(a,!1),ye(s,{width:0,height:0},!0)},constrainToViewport:function(){const e=n(),r=t();if(!r)return;const o=Ni(e.x,e.y,Dn(s).width||r.offsetWidth,Dn(s).height||r.offsetHeight);ye(s,{width:o.width,height:o.height},!0),i({x:o.x,y:o.y})},handlers:p}}(()=>Dn(m),()=>O.position,t=>O.setPosition(t)),T=function(t,n,i,r,o,s,a,l,d){let u=me(!1),c=me(!1),f=me(!1),h=me(!1),p=me(null),v=me(null),g=null,m=null;function w(){m&&(clearTimeout(m),m=null)}function y(){const t=e.id,n=document.querySelector(`.modal-dock-item[data-modal-id="${Ui(t)}"]`),i=document.querySelector('[data-dock-container="true"]'),r=n||i;if(r){const t=r.getBoundingClientRect();return{x:t.left+t.width/2,y:t.top+t.height/2}}return{x:window.innerWidth/2,y:window.innerHeight-40}}return He(()=>()=>{w(),ye(u,!1),ye(c,!1),ye(f,!1),ye(h,!1),ye(p,null),ye(v,null),g=null}),{get isMinimizing(){return Dn(u)},get isRestoring(){return Dn(c)},get isOpening(){return Dn(f)},get isClosing(){return Dn(h)},get animationTransform(){return Dn(p)},get pendingOpenSource(){return Dn(v)},startMinimize:function(t,e){const h=n();if(Dn(u)||!h)return;if(ye(c,!1),ye(f,!1),w(),!Kr()){const t=h.getBoundingClientRect();let n=o()?i():{x:t.left,y:t.top},u=a()?l():{width:t.width,height:t.height};return o()||(r(n),s(!0)),void(e?e():d(n,!0,u))}const v=h.getBoundingClientRect(),g=v.left+v.width/2,x=v.top+v.height/2;let b=o()?i():{x:v.left,y:v.top},M=a()?l():{width:v.width,height:v.height};o()||(r(b),s(!0));const z=t??y(),k=z.x-v.left,I=z.y-v.top,_={x:z.x-g,y:z.y-x,originX:k,originY:I};ye(p,_,!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{ye(u,!0)})}),m=setTimeout(()=>{e?e():d(b,!0,M)},500)},startRestore:function(t,e){if(!Kr()){const e=t||{x:window.innerWidth/2,y:window.innerHeight/2};return r(e),void s(!0)}const n=y(),i=t||{x:window.innerWidth/2,y:window.innerHeight/2},o=e||{width:480,height:400};r(i),s(!0);const a=i.x+o.width/2,l=i.y+o.height/2,d=n.x-i.x,u=n.y-i.y;ye(p,{x:n.x-a,y:n.y-l,originX:d,originY:u},!0),ye(c,!0),setTimeout(()=>{ye(c,!1),ye(p,null)},400)},startClose:function(t){Dn(h)||Dn(u)||(Kr()?(g=t,ye(h,!0),setTimeout(()=>{ye(h,!1),g&&(g(),g=null)},250)):t())},setPendingOpenSource:function(t){ye(v,t,!0)},tryStartOpenAnimation:function(){const t=n();if(!Dn(v)||!t||Dn(f))return!1;if(!Kr())return ye(v,null),!1;const e=Dn(v);ye(v,null);const a=t.getBoundingClientRect(),l=o()?i():{x:a.left,y:a.top},d=a.width,u=a.height,c=l.x+d/2,h=l.y+u/2;o()||(r(l),s(!0));const g=e.x-l.x,m=e.y-l.y;return ye(p,{x:e.x-c,y:e.y-h,originX:g,originY:m},!0),ye(f,!0),setTimeout(()=>{ye(f,!1),ye(p,null)},400),!0},forceClearMinimize:function(){w(),ye(u,!1),ye(p,null)}}}(0,()=>Dn(m),()=>O.position,t=>O.setPosition(t),()=>O.hasBeenDragged,t=>O.setHasBeenDragged(t),()=>W.hasBeenResized,()=>W.size,(t,n,i)=>{zr(e.id,{position:t,size:i,hasBeenDragged:n}),yr(e.id)}),{trapFocus:B,focusFirstElement:R}={trapFocus:Ur,focusFirstElement:Qr},A=le(()=>T.isMinimizing||T.isRestoring||T.isOpening||T.isClosing),L=le(()=>(Ar(e.id)||Rr(e.id))&&!T.isRestoring);let H=me(!1);const $=le(()=>T.isRestoring||T.isOpening||Dn(H)),F=le(()=>Dn(k)&&!O.hasBeenDragged&&!Dn(A)&&!T.pendingOpenSource&&!Dn(L)),q=le(()=>{const t=[];return t.push(`z-index: ${Dn(S)};`),T.animationTransform?(t.push(`left: ${O.position.x}px; top: ${O.position.y}px;`),t.push(`--genie-origin-x: ${T.animationTransform.originX}px;`),t.push(`--genie-origin-y: ${T.animationTransform.originY}px;`),t.push(`--genie-translate-x: ${T.animationTransform.x}px;`),t.push(`--genie-translate-y: ${T.animationTransform.y}px;`)):O.hasBeenDragged&&t.push(`left: ${O.position.x}px; top: ${O.position.y}px; transform: none;`),W.hasBeenResized?t.push(`width: ${W.size.width}px; height: ${W.size.height}px; max-width: none; max-height: none;`):(e.preferredHeight&&t.push(`min-height: ${e.preferredHeight};`),n()&&t.push(`max-width: ${n()};`)),Dn(D)&&e.glow&&(t.push(`--modal-glow-color: ${e.glow.color};`),t.push(`--modal-glow-intensity: ${e.glow.intensity};`)),t.join(" ")});function j(){Dn(f)&&yr(e.id)}function X(){var t;Tr(e.id)&&Br(e.id),_r(e.id),null==(t=e.onClose)||t.call(e)}function Y(){qr(e.id)}function N(t){Dn(c)&&Dn(m)&&O.onPointerDown(t,Dn(m))}function K(t){r()&&"Escape"===t.key&&function(t){const e=Qi.get(t);if(!e)return!1;const n=Math.max(...Array.from(Qi.values()).map(t=>t.zIndex),0);return e.zIndex===n&&!e.isMinimized&&!e.isHiddenWithParent}(e.id)&&(t.stopPropagation(),X())}function G(t){if(!Dn(m))return;const n=O.isDragging,i=W.hasBeenResized?W.size:{width:Dn(m).offsetWidth,height:Dn(m).offsetHeight};O.onPointerMove(t,Dn(m),i),O.isDragging&&n&&Mr(e.id,O.position,{drag:!0})}function V(t){if(!Dn(m))return;const n=O.isDragging;O.onPointerUp(t,Dn(m)),n&&!W.justFinishedResizing&&(Mr(e.id,O.position,{drag:!0}),function(t){const e=Ri();if("animated"!==e.parentChild.movementMode)return;const n=e.parentChild.animationDuration,i=[];let r=t;for(;;){const t=Qi.get(r);if(!(null==t?void 0:t.parentId))break;i.push({parentId:t.parentId,childId:r}),r=t.parentId}i.forEach(({parentId:t,childId:e},i)=>{setTimeout(()=>{const i=Qi.get(e),r=Qi.get(t);if(!(null==i?void 0:i.position)||!i.offsetFromParent||!r)return;const o={x:i.position.x-i.offsetFromParent.x,y:i.position.y-i.offsetFromParent.y};hr.set(t,o),function(t){const e=hr.get(t);if(!e)return;const n=Qi.get(t);n&&(Qi.set(t,{...n,isAnimatingPosition:!0,position:e}),hr.delete(t),tr())}(t),setTimeout(()=>function(t){const e=Qi.get(t);e&&(Qi.set(t,{...e,isAnimatingPosition:!1}),tr())}(t),n)},i*n)})}(e.id))}function U(){var t;const n=Ri();if("smart"!==(null==(t=n.positioning)?void 0:t.strategy))return!1;const i=Sr(e.id),r=Dn(fr);if((null==i?void 0:i.parentId)||r&&r.childId===e.id)return!1;if((null==i?void 0:i.hasBeenDragged)||(null==i?void 0:i.position))return!1;const o=Dn(m)||document.querySelector(`[data-modal-id="${Dn(d)}"]`);if(!o)return!1;const s=o.offsetWidth,a=o.offsetHeight;if(s<=0||a<=0)return!1;const l=n.positioning.modalGap??16,u=function(t){const e=[];for(const[n,i]of Qi.entries())if(n!==t&&i.isOpen&&!i.isMinimized&&!i.isHiddenWithParent)if(i.position&&i.size)e.push({x:i.position.x,y:i.position.y,width:i.size.width,height:i.size.height});else{const t=document.querySelector(`[data-modal-id="${Ui(n)}"]`);if(t){const n=t.getBoundingClientRect();e.push({x:n.left,y:n.top,width:n.width,height:n.height})}}return e}(e.id),c=function(t){if("undefined"==typeof document)return[];const e=[];for(const n of t)try{const t=document.querySelectorAll(n);for(const n of t){const t=n.getBoundingClientRect();t.width>0&&t.height>0&&e.push({x:t.left,y:t.top,width:t.width,height:t.height})}}catch{}return e}(n.positioning.avoidElements??[]),f=function(t,e,n,i={}){const{modalGap:r=16,gridResolution:o=10,avoidBounds:s=[],avoidMargin:a=16}=i,l=i.margin??r,d="undefined"!=typeof window?window.innerWidth:1920,u="undefined"!=typeof window?window.innerHeight:1080,c=s.map(t=>({x:t.x-a,y:t.y-a,width:t.width+2*a,height:t.height+2*a})),f={x:(d-t)/2,y:(u-e)/2};if(0===n.length&&0===c.length)return f;const h=l,p=Math.max(l,d-t-l),v=l,g=Math.max(l,u-e-l);if(p<=h||g<=v)return f;const m=Gi(f.x,f.y,t,e,n,r),w=Gi(f.x,f.y,t,e,c,0);if(0===m&&0===w)return f;const y=[],x=(p-h)/o,b=(g-v)/o;for(let i=0;i<=o;i++)for(let s=0;s<=o;s++){const o=h+i*x,a=v+s*b,f=Gi(o,a,t,e,n,r),p=Gi(o,a,t,e,c,0),g=Vi(o,a,t,e,d,u,l);y.push({pos:{x:o,y:a},modalOverlap:f,avoidOverlap:p,centerDist:g})}const M=y.filter(t=>0===t.avoidOverlap),z=M.length>0?M:y,k=t*e,I=Math.min(...z.map(t=>t.modalOverlap))/k;return z.sort((t,e)=>{if(0===M.length&&t.avoidOverlap!==e.avoidOverlap)return t.avoidOverlap-e.avoidOverlap;const n=t.modalOverlap/k,i=e.modalOverlap/k;if(I<.3){const r=.3,o=n<=r,s=i<=r;if(o&&s)return t.centerDist+.3*n-(e.centerDist+.3*i);if(o)return-1;if(s)return 1}return.6*n+.4*t.centerDist-(.6*i+.4*e.centerDist)}),z[0].pos}(s,a,u,{modalGap:l,avoidBounds:c});if(Gi(f.x,f.y,s,a,u,l)/(s*a)>.1&&u.length>0){const t=function(t){const e=[];for(const[n,i]of Qi.entries())if(n!==t&&i.isOpen&&!i.isMinimized&&!i.isHiddenWithParent&&!i.parentId)if(i.position&&i.size)e.push({id:Ui(n),x:i.position.x,y:i.position.y,width:i.size.width,height:i.size.height});else{const t=document.querySelector(`[data-modal-id="${Ui(n)}"]`);if(t){const i=t.getBoundingClientRect();e.push({id:Ui(n),x:i.left,y:i.top,width:i.width,height:i.height})}}return e}(e.id),n=function(t,e,n,i={}){const{modalGap:r=16}=i,o=i.margin??r,s="undefined"!=typeof window?window.innerWidth:1920,a="undefined"!=typeof window?window.innerHeight:1080,l=n.reduce((t,e)=>t+e.width,0)+t,d=n.length*r,u=s-2*o;if(l+d>u)return null;const c=u-l-d;n.length;const f=c/2,h=s/2,p=[...n.map(t=>({id:t.id,width:t.width,height:t.height,currentX:t.x+t.width/2,currentY:t.y,isNew:!1})),{id:"__new__",width:t,height:e,currentX:h,currentY:(a-e)/2,isNew:!0}];p.sort((t,e)=>t.currentX-e.currentX);let v=o+f;const g=new Map;let m=null;for(const t of p){const e=v;if(t.isNew)m={x:Math.round(e),y:Math.round(t.currentY)};else{const i=n.find(e=>e.id===t.id);Math.abs(e-i.x)>5&&g.set(t.id,{x:Math.round(e),y:Math.round(i.y)})}v+=t.width+r}return m?{newModalPosition:m,existingModalMoves:g}:null}(s,a,t,{modalGap:l});if(n&&n.existingModalMoves.size>0)return function(t){const e=Ri().parentChild.animationDuration;for(const[e,n]of t){const t=Qi.get(e);t&&Qi.set(e,{...t,position:n,isAnimatingPosition:!0,hasBeenDragged:!0})}tr(),setTimeout(()=>{for(const e of t.keys()){const t=Qi.get(e);t&&Qi.set(e,{...t,isAnimatingPosition:!1})}tr()},e)}(n.existingModalMoves),O.setPosition(n.newModalPosition),O.setHasBeenDragged(!0),Mr(e.id,n.newModalPosition,{size:{width:s,height:a}}),!0}return O.setPosition(f),O.setHasBeenDragged(!0),Mr(e.id,f,{size:{width:s,height:a}}),!0}function Q(){Pn().then(()=>Pn()).then(()=>{let t=0;const e=()=>{t+=1,U()||t>5||requestAnimationFrame(e)};Dn(m)?e():requestAnimationFrame(e)})}ti(()=>{var t;function n(){const t=Sr(e.id);if(!(null==t?void 0:t.position)||!Dn(m))return;if(t.parentId)return;const n=W.hasBeenResized?W.size.width:Dn(m).offsetWidth,i=W.hasBeenResized?W.size.height:Dn(m).offsetHeight;if(n<=0||i<=0)return;const r=Yi(t.position.x,t.position.y,n,i);(Math.abs(r.x-t.position.x)>1||Math.abs(r.y-t.position.y)>1)&&(O.setPosition(r),Mr(e.id,r))}return o()||(t=i(),mr({id:e.id,title:e.title,icon:e.icon??"",isOpen:t,isMinimized:!1,isHiddenWithParent:!1,isTransparent:!1,isRejected:!1,position:null,size:null,hasBeenDragged:!1,dockPosition:0,glow:e.glow??null,parentId:void 0,childId:void 0,offsetFromParent:void 0}),t&&kr(e.id)),i()&&(Pn().then(()=>{Dn(m)&&R(Dn(m))}),Q()),window.addEventListener("pointermove",G),window.addEventListener("pointerup",V),window.addEventListener("resize",n),()=>{window.removeEventListener("pointermove",G),window.removeEventListener("pointerup",V),window.removeEventListener("resize",n)}}),ei(()=>{jr(e.id),o()||wr(e.id)}),He(()=>{Or();const t=Sr(e.id);if(t){if(ye(w,t.isTransparent,!0),!O.isDragging&&!W.isResizing&&t.position){const e=O.position,n=t.position;(Math.abs(e.x-n.x)>.5||Math.abs(e.y-n.y)>.5)&&(O.setPosition(n),t.hasBeenDragged&&O.setHasBeenDragged(!0))}Pn().then(()=>function(){var t,n;if(!Sr(e.id))return;if(Tr(e.id))return Br(e.id),void(null==(t=e.onClose)||t.call(e));if(Cr(e.id)&&!Dn(b)){if(ye(b,!0),Dn(ur),ye(ur,null),Dn(m)){const t=Dn(m).getBoundingClientRect(),n=O.hasBeenDragged?O.position:{x:t.left,y:t.top},i=W.hasBeenResized?W.size:{width:t.width,height:t.height};zr(e.id,{position:n,size:i,hasBeenDragged:!0})}T.startMinimize(void 0,()=>{var t;t=e.id,Dn(nr).includes(t)&&ye(nr,Dn(nr).filter(e=>e!==t),!0),ye(b,!1)})}if(Rr(e.id)){n=e.id,Dn(sr).includes(n)&&ye(sr,Dn(sr).filter(t=>t!==n),!0);const t=Sr(e.id);T.startRestore((null==t?void 0:t.position)??void 0,(null==t?void 0:t.size)??void 0),Pn().then(()=>{Dn(m)&&R(Dn(m))})}if(Ar(e.id)){!function(t){Dn(ar).includes(t)&&ye(ar,Dn(ar).filter(e=>e!==t),!0)}(e.id);const t=Sr(e.id);T.startRestore((null==t?void 0:t.position)??void 0,(null==t?void 0:t.size)??void 0)}if(Wr(e.id)&&(function(t){Dn(rr).includes(t)&&ye(rr,Dn(rr).filter(e=>e!==t),!0)}(e.id),T.startClose(()=>{var t;jr(e.id),function(t){const e=Qi.get(t);if(e){if(e.parentId){const n=Qi.get(e.parentId);n&&n.childId===t&&Qi.set(e.parentId,{...n,childId:void 0,lastChildId:t})}Qi.set(t,{...e,isOpen:!1,isMinimized:!1,isHiddenWithParent:!1,isTransparent:!1,position:null,size:null,hasBeenDragged:!1,parentId:void 0,childId:void 0,offsetFromParent:void 0}),tr()}}(e.id),null==(t=e.onClose)||t.call(e)})),Er(e.id)){!function(t){Dn(ir).includes(t)&&ye(ir,Dn(ir).filter(e=>e!==t),!0)}(e.id);const t=function(t){const e=cr.get(t);return e&&cr.delete(t),e??null}(e.id)||e.openSourcePosition||null;t?(T.setPendingOpenSource(t),Pn().then(()=>Pn()).then(()=>{U(),T.tryStartOpenAnimation()})):Q(),Pn().then(()=>{Dn(m)&&R(Dn(m))})}(function(t){return Dn(lr).includes(t)})(e.id)&&(function(t){Dn(lr).includes(t)&&ye(lr,Dn(lr).filter(e=>e!==t),!0)}(e.id),function(t){Dn(dr).includes(t)||ye(dr,[...Dn(dr),t],!0)}(e.id),ye(M,!0),setTimeout(()=>{ye(M,!1),function(t){ye(dr,Dn(dr).filter(e=>e!==t),!0)}(e.id)},600));const i=function(t){if(!Dn(fr)||Dn(fr).childId!==t)return null;const e=Dn(fr);return ye(fr,null),e}(e.id);var r;i&&Dn(m)&&(r=i.parentId,Pn().then(()=>Pn()).then(()=>{let t=0;const n=()=>{t+=1;const i=function(t){var n,i;const r=Sr(t);if(!r)return!1;const o=Dn(m)||document.querySelector(`[data-modal-id="${Dn(d)}"]`),s=document.querySelector(`[data-modal-id="${Ui(t)}"]`),a=null==s?void 0:s.getBoundingClientRect(),l=r.position??(a?{x:a.left,y:a.top}:null);if(!l||!o)return!1;const u=(null==(n=r.size)?void 0:n.width)??(null==s?void 0:s.offsetWidth)??(null==a?void 0:a.width)??480,c=(null==(i=r.size)?void 0:i.height)??(null==s?void 0:s.offsetHeight)??(null==a?void 0:a.height)??400,f=o.offsetWidth,h=o.offsetHeight;if(u<=0||c<=0||f<=0||h<=0)return!1;const p={x:l.x+(u-f)/2,y:l.y+(c-h)/2};return O.setPosition(p),O.setHasBeenDragged(!0),Mr(e.id,p,{size:{width:f,height:h}}),r.position&&r.size||!a||Mr(t,{x:a.left,y:a.top},{size:{width:u,height:c}}),function(t,e){if(!Ri().features.parentChild)return;const n=Qi.get(t),i=Qi.get(e);if(!n||!i)return;let r={x:40,y:40};n.position&&i.position&&(r={x:i.position.x-n.position.x,y:i.position.y-n.position.y});const o=Math.max(i.zIndex,n.zIndex+1);Qi.set(t,{...n,childId:e,lastChildId:e}),Qi.set(e,{...i,parentId:t,offsetFromParent:r,zIndex:o}),tr()}(t,e.id),!0}(r);i||t>5||requestAnimationFrame(n)};Dn(m)?n():requestAnimationFrame(n)}))}())}}),He(()=>{const t=Sr(e.id);t&&t.isTransparent!==Dn(w)&&ye(w,t.isTransparent,!0)}),He(()=>{if(Dn(k)&&Dn(m)){const t=t=>function(t){Dn(m)&&B(t,Dn(m))}(t);return Dn(m).addEventListener("keydown",t),()=>{var e;return null==(e=Dn(m))?void 0:e.removeEventListener("keydown",t)}}}),He(()=>{!Dn(k)&&T.isMinimizing&&T.forceClearMinimize()}),He(()=>{T.isRestoring||T.isOpening?ye(H,!0):Dn(H)&&requestAnimationFrame(()=>{ye(H,!1)})}),He(()=>{Dn(x)&&!Dn(I)&&(ye(y,!0),setTimeout(()=>{ye(y,!1)},200)),ye(x,Dn(I),!0)});var J=qn(),Z=We(J),tt=t=>{to(t,{get target(){return l},children:(t,n)=>{var i=Mo();let r;i.__keydown=K;var o=Ee(i);{let t=le(()=>Dn(c)?N:void 0);!function(t,e){Tt(e,!0);let n=Oi(e,"isTransparent",0,!1),i=Oi(e,"headerLayout",0,"macos"),r=Oi(e,"minimizable",0,!0),o=Oi(e,"minimizeDisabled",0,!1),s=Oi(e,"transparencyEnabled",0,!0);const a=Wt(Yr),l=le(()=>null==a?void 0:a()),d=le(()=>"macos"===i());var u=go();let c;u.__pointerdown=function(t){var n;t.target.closest("button")||null==(n=e.onStartDrag)||n.call(e,t)};var f=Ee(u),h=t=>{var n=ao(),i=We(n),a=Ee(i);a.__click=function(...t){var n;null==(n=e.onClose)||n.apply(this,t)};var d=Te(a,2),u=t=>{var n=eo();let i;n.__click=function(...t){var n;null==(n=o()?void 0:e.onMinimize)||n.apply(this,t)},je(()=>{i=Mi(n,0,"modal-header-light modal-header-light-minimize",null,i,{"modal-header-light-disabled":o()}),n.disabled=o(),Pi(n,"title",o()?"Enable dock to minimize":void 0)}),jn(t,n)};ni(d,t=>{r()&&t(u)});var c=Te(d,2),f=t=>{var n=no();n.__click=function(...t){var n;null==(n=e.onToggleStyle)||n.apply(this,t)},jn(t,n)};ni(c,t=>{s()&&t(f)});var h=Ee(Te(i,2)),p=t=>{var n=io();Zn(Ee(n),()=>e.customIcon),jn(t,n)},v=t=>{var n=qn(),i=We(n),r=t=>{var n=ro();Zn(Ee(n),()=>Dn(l),()=>e.icon),jn(t,n)};ni(i,t=>{e.icon&&Dn(l)&&t(r)},!0),jn(t,n)};ni(h,t=>{e.customIcon?t(p):t(v,!1)});var g=Ee(Te(h,2)),m=t=>{var n=oo(),i=Ee(n);je(()=>{Pi(n,"id",e.titleId),Kn(i,e.title)}),jn(t,n)},w=t=>{var n=so(),i=Ee(n);je(()=>Kn(i,e.title)),jn(t,n)};ni(g,t=>{e.titleId?t(m):t(w,!1)}),jn(t,n)},p=t=>{var n=vo(),i=We(n),a=Ee(i),d=t=>{var n=lo();Zn(Ee(n),()=>e.customIcon),jn(t,n)},u=t=>{var n=qn(),i=We(n),r=t=>{var n=uo();Zn(Ee(n),()=>Dn(l),()=>e.icon),jn(t,n)};ni(i,t=>{e.icon&&Dn(l)&&t(r)},!0),jn(t,n)};ni(a,t=>{e.customIcon?t(d):t(u,!1)});var c=Te(a,2),f=t=>{var n=co(),i=Ee(n);je(()=>{Pi(n,"id",e.titleId),Kn(i,e.title)}),jn(t,n)},h=t=>{var n=fo(),i=Ee(n);je(()=>Kn(i,e.title)),jn(t,n)};ni(c,t=>{e.titleId?t(f):t(h,!1)});var p=Ee(Te(i,2)),v=t=>{var n=ho();n.__click=function(...t){var n;null==(n=e.onToggleStyle)||n.apply(this,t)},jn(t,n)};ni(p,t=>{s()&&t(v)});var g=Te(p,2),m=t=>{var n=po();let i;n.__click=function(...t){var n;null==(n=o()?void 0:e.onMinimize)||n.apply(this,t)},je(()=>{i=Mi(n,0,"modal-header-btn-windows",null,i,{"modal-header-btn-windows-disabled":o()}),n.disabled=o(),Pi(n,"title",o()?"Enable dock to minimize":void 0)}),jn(t,n)};ni(g,t=>{r()&&t(m)}),Te(g,2).__click=function(...t){var n;null==(n=e.onClose)||n.apply(this,t)},jn(t,n)};ni(f,t=>{Dn(d)?t(h):t(p,!1)}),je(()=>c=Mi(u,0,"modal-header",null,c,{"modal-header-draggable":!!e.onStartDrag,transparent:n()})),jn(t,u),Bt()}(o,{get title(){return e.title},get customIcon(){return e.customIcon},get icon(){return e.icon},get isTransparent(){return Dn(w)},get titleId(){return Dn(C)},get headerLayout(){return Dn(g)},get onStartDrag(){return Dn(t)},onToggleStyle:Y,onMinimize:j,onClose:X,get minimizable(){return Dn(f)},get minimizeDisabled(){return Dn(h)},get transparencyEnabled(){return Dn(p)}})}var s=Te(o,2);Zn(Ee(s),()=>e.children??at),wi(s,(t,e)=>null==yo?void 0:yo(t,e),()=>e.bodyElement);var a=Te(s,2),l=t=>{var n=xo(),i=Ee(n),r=t=>{var n=qn();Zn(We(n),()=>e.footer),jn(t,n)};ni(i,t=>{e.footer&&t(r)}),wi(n,(t,e)=>null==yo?void 0:yo(t,e),()=>e.footerElement),jn(t,n)};ni(a,t=>{(e.footer||e.footerElement)&&t(l)});var u=Te(a,2);{let t=le(()=>Dn(v)&&!Dn(I)?W.handlers.startResize:void 0);!function(t,e){Tt(e,!0);const n=["n","s","e","w","ne","nw","se","sw"];var i=qn(),r=We(i),o=t=>{var i=wo();si(i,21,()=>n,ii,(t,n)=>{var i=mo();i.__pointerdown=t=>function(t,n){var i;null==(i=e.onStartResize)||i.call(e,t,n)}(t,Dn(n)),je(()=>Mi(i,0,`modal-resize-handle modal-resize-${Dn(n)??""}`)),jn(t,i)}),jn(t,i)};ni(r,t=>{e.onStartResize&&t(o)}),jn(t,i),Bt()}(u,{get onStartResize(){return Dn(t)}})}var x,b,k,S=Te(u,2),B=t=>{var e=bo();let n;je(()=>n=Mi(e,0,"modal-child-overlay",null,n,{"modal-overlay-closing":Dn(y)})),jn(t,e)};ni(S,t=>{Dn(P)&&t(B)}),Si(i,t=>ye(m,t),()=>Dn(m)),je(()=>{var t;r=Mi(i,0,"modal-dialog",null,r,{"modal-dragging":O.isDragging,"modal-resizing":W.isResizing,"modal-positioned":O.hasBeenDragged,"modal-minimizing":T.isMinimizing,"modal-restoring":T.isRestoring,"modal-opening":T.isOpening,"modal-closing":T.isClosing,"modal-centered":Dn(F),"modal-solid":!Dn(w),"modal-transparent":Dn(w),"modal-glow":Dn(D),"modal-has-child":Dn(I),"modal-is-child":Dn(_),"modal-visible-by-animation":Dn($),"modal-animating-to-center":Dn(E),"modal-animating-position":null==(t=Dn(z))?void 0:t.isAnimatingPosition,"modal-attention":Dn(M)}),Pi(i,"data-modal-id",Dn(d)),ki(i,Dn(q)),Pi(i,"aria-labelledby",Dn(C))}),k=function(t,e,n,i={}){function r(t){if(i.capture||Hn.call(e,t),!t.cancelBubble)return Be(()=>null==n?void 0:n.call(this,t))}return t.startsWith("pointer")||t.startsWith("touch")||"wheel"===t?Ht(()=>{e.addEventListener(t,r,i)}):e.addEventListener(t,r,i),r}("pointerdown",x=i,()=>kr(e.id),b={capture:!0,passive:void 0}),(x===document.body||x===window||x===document||x instanceof HTMLMediaElement)&&Le(()=>{x.removeEventListener("pointerdown",k,b)}),jn(t,i)},$$slots:{default:!0}})};ni(Z,t=>{Dn(k)&&t(tt)}),jn(t,J),Bt()}An(["keydown"]);const ko=t=>t;function Io(t){const e=t-1;return e*e*e+1}function _o(t){const e="string"==typeof t&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}function Po(t,{delay:e=0,duration:n=400,easing:i=ko}={}){const r=+getComputedStyle(t).opacity;return{delay:e,duration:n,easing:i,css:t=>"opacity: "+t*r}}function Do(t,{delay:e=0,duration:n=400,easing:i=Io,x:r=0,y:o=0,opacity:s=0}={}){const a=getComputedStyle(t),l=+a.opacity,d="none"===a.transform?"":a.transform,u=l*(1-s),[c,f]=_o(r),[h,p]=_o(o);return{delay:e,duration:n,easing:i,css:(t,e)=>`\n\t\t\ttransform: ${d} translate(${(1-t)*c}${f}, ${(1-t)*h}${p});\n\t\t\topacity: ${l-u*e}`}}function Co(t,{delay:e=0,duration:n=400,easing:i=Io,start:r=0,opacity:o=0}={}){const s=getComputedStyle(t),a=+s.opacity,l="none"===s.transform?"":s.transform,d=1-r,u=a*(1-o);return{delay:e,duration:n,easing:i,css:(t,e)=>`\n\t\t\ttransform: ${l} scale(${1-d*e});\n\t\t\topacity: ${a-u*e}\n\t\t`}}function So(t){const e=1.70158;return--t*t*((e+1)*t+e)+1}function Oo(t){const e=t-1;return e*e*e+1}var Eo=Fn('<button type="button" aria-label="Drag dock"></button>'),Wo=Fn('<span class="modal-dock-item-icon-placeholder"> </span>'),To=Fn('<span class="modal-dock-item-label"> </span>'),Bo=Fn("<span>+</span>"),Ro=Fn('<span class="modal-dock-child-indicator"><!></span>'),Ao=Fn('<button><span class="modal-dock-item-icon"><!></span> <!> <span class="modal-dock-item-glow"></span> <!></button>'),Lo=Fn('<div data-dock-container="true"><div><!> <!></div></div>');function Ho(t,e){Tt(e,!0);const n=Wt(Yr),i=le(()=>e.renderIcon??(null==n?void 0:n())),r=Fr(),o=le(()=>(Bi(),Ri())),s=le(()=>qi("DOCK")),a=le(()=>Dn(o).dock.position),l=le(()=>Dn(o).dock.labelMode);let d=me("horizontal"),u=me(ke({x:100,y:100})),c=me(null),f=me(!1),h={x:0,y:0},p=null;const v=le(()=>(Or(),Array.from(r.modals.values()).filter(t=>t.isMinimized).sort((t,e)=>t.dockPosition-e.dockPosition))),g=le(()=>{switch(Dn(a)){case"left":return{x:-20,duration:250,easing:Oo};case"right":return{x:20,duration:250,easing:Oo};default:return{y:20,duration:250,easing:Oo}}});function m(t){var e;"free"===Dn(a)&&(ye(f,!0),p=t.pointerId,h={x:t.clientX-Dn(u).x,y:t.clientY-Dn(u).y},null==(e=t.currentTarget)||e.setPointerCapture(t.pointerId),window.addEventListener("pointermove",w),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y))}function w(t){if(t.pointerId!==p||!Dn(c))return;const e=Dn(c).getBoundingClientRect(),n=window.innerWidth-e.width-8,i=window.innerHeight-e.height-8,r=Math.min(Math.max(t.clientX-h.x,8),Math.max(8,n)),o=Math.min(Math.max(t.clientY-h.y,8),Math.max(8,i));ye(u,{x:Math.round(r),y:Math.round(o)},!0)}function y(t){t.pointerId===p&&(ye(f,!1),p=null,window.removeEventListener("pointermove",w),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y))}const{addListener:x}=function(){function t(t,e,n){return"undefined"==typeof window?()=>{}:(window.addEventListener(t,e,n),()=>{window.removeEventListener(t,e,n)})}return{addListener:t,addListenerEffect:function(e,n,i){He(()=>{if("undefined"!=typeof window)return t(e,n,i)})}}}();function b(){if("free"!==Dn(a)||!Dn(c))return;const t=Dn(c).getBoundingClientRect(),e=Yi(Dn(u).x,Dn(u).y,t.width,t.height);e.x===Dn(u).x&&e.y===Dn(u).y||ye(u,{x:Math.round(e.x),y:Math.round(e.y)},!0)}He(()=>{"undefined"!=typeof window&&x("resize",b)});var M={setDockOrientation:function(t){ye(d,t,!0)},setDockFreePosition:function(t){ye(u,t,!0)},getDockState:function(){return{dockPosition:Dn(a),dockOrientation:Dn(d),dockFreePosition:Dn(u),dockLabelMode:Dn(l)}}};return to(t,{get target(){return Dn(o).portalTarget},children:(t,e)=>{var n=Lo();let o,h;var p=Ee(n);let w;var y=Ee(p),x=t=>{var e=Eo();let n;e.__pointerdown=m,je(()=>n=Mi(e,0,"modal-dock-handle",null,n,{"modal-dock-handle-dragging":Dn(f)})),jn(t,e)};ni(y,t=>{"free"===Dn(a)&&t(x)}),si(Te(y,2),19,()=>Dn(v),t=>t.id,(t,e,n)=>{const o=le(()=>Dn(e).lastChildId?r.modals.get(Dn(e).lastChildId):null);var s=Ao();let a;s.__click=t=>{var n;n=Dn(e).id,pr.has(n)?t.currentTarget.animate([{transform:"translateX(0)"},{transform:"translateX(-6px)"},{transform:"translateX(6px)"},{transform:"translateX(-6px)"},{transform:"translateX(6px)"},{transform:"translateX(0)"}],{duration:300,easing:"ease-in-out"}):xr(Dn(e).id)};var d=Ee(s),u=Ee(d),c=t=>{var n=qn();Zn(We(n),()=>Dn(i),()=>Dn(e).icon),jn(t,n)},f=t=>{var n=Wo(),i=Ee(n);je(t=>Kn(i,t),[()=>Dn(e).title.charAt(0)]),jn(t,n)};ni(u,t=>{Dn(e).icon&&Dn(i)?t(c):t(f,!1)});var h=Te(d,2),p=t=>{var n=To(),i=Ee(n);je(()=>Kn(i,Dn(e).title)),jn(t,n)};ni(h,t=>{"hidden"!==Dn(l)&&t(p)});var v=Te(h,4),g=t=>{var e=Ro(),n=Ee(e),r=t=>{var e=qn();Zn(We(e),()=>Dn(i),()=>Dn(o).icon),jn(t,e)},s=t=>{jn(t,Bo())};ni(n,t=>{Dn(o).icon&&Dn(i)?t(r):t(s,!1)}),jn(t,e)};ni(v,t=>{Dn(e).lastChildId&&Dn(o)&&t(g)}),je(t=>{a=Mi(s,0,"modal-dock-item",null,a,{"modal-dock-item-has-glow":!!Dn(e).glow,"modal-dock-item-has-child":!!Dn(e).lastChildId,"modal-dock-item-label-beside":"beside"===Dn(l),"modal-dock-item-label-below":"below"===Dn(l)}),Pi(s,"data-modal-id",t),ki(s,Dn(e).glow?`--modal-dock-glow-color: ${Dn(e).glow.color};`:"")},[()=>Ui(Dn(e).id)]),gi(3,s,()=>Co,()=>({duration:300,delay:50*Dn(n),easing:So,start:.5})),jn(t,s)}),Si(n,t=>ye(c,t),()=>Dn(c)),je(()=>{o=Mi(n,0,"modal-dock-container",null,o,{"modal-dock-left":"left"===Dn(a),"modal-dock-right":"right"===Dn(a),"modal-dock-bottom":"bottom"===Dn(a),"modal-dock-free":"free"===Dn(a),"modal-dock-empty":0===Dn(v).length}),h=ki(n,"free"===Dn(a)?`left: ${Dn(u).x}px; top: ${Dn(u).y}px;`:"",h,{"z-index":Dn(s)}),w=Mi(p,0,"modal-dock",null,w,{"modal-dock-free-horizontal":"free"===Dn(a)&&"horizontal"===Dn(d),"modal-dock-free-vertical":"free"===Dn(a)&&"vertical"===Dn(d)})}),gi(3,n,()=>Do,()=>Dn(v).length>0?Dn(g):{duration:0}),jn(t,n)},$$slots:{default:!0}}),Bt(M)}function $o(t,e){Tt(e,!0);let n=Oi(e,"maxWidth",0,"600px"),i=Oi(e,"autoOpen",0,!1),r=Oi(e,"closeOnEscape",0,!0),o=me(!1);ti(()=>{mr({id:e.id,title:e.title,icon:e.icon??"",isOpen:i(),isMinimized:!1,isHiddenWithParent:!1,isTransparent:!1,isRejected:!1,position:null,size:null,hasBeenDragged:!1,dockPosition:0,glow:e.glow??null,parentId:void 0,childId:void 0,offsetFromParent:void 0}),ye(o,!0)}),ei(()=>{wr(e.id)});const s=le(()=>{if(!Dn(o))return!1;Or();const t=Sr(e.id);return!!t&&(t.isOpen||t.isMinimized||Er(e.id)||Wr(e.id)||Cr(e.id))});var a=qn(),l=We(a),d=t=>{zo(t,{get id(){return e.id},get title(){return e.title},get icon(){return e.icon},get customIcon(){return e.customIcon},get maxWidth(){return n()},get preferredHeight(){return e.preferredHeight},get autoOpen(){return i()},get openSourcePosition(){return e.openSourcePosition},get glow(){return e.glow},get config(){return e.config},get closeOnEscape(){return r()},get onClose(){return e.onClose},get children(){return e.children},get footer(){return e.footer},skipRegistration:!0})};ni(l,t=>{Dn(s)&&t(d)}),jn(t,a),Bt()}An(["pointerdown","click"]);var Fo=Fn('<div class="modal-backdrop svelte-1d3nq4t" aria-hidden="true"></div>');function qo(t,e){Tt(e,!0);const n=Fr(),i=le(()=>(Bi(),Ri())),r=le(()=>Dn(i).features.backdrop),o=le(()=>(Or(),Array.from(n.modals.values()).some(t=>t.isOpen&&!t.isMinimized&&!t.isHiddenWithParent))),s=le(()=>Dn(r)&&Dn(o)),a=le(()=>qi("MODAL")-1);to(t,{get target(){return Dn(i).portalTarget},children:(t,e)=>{var n=qn(),i=We(n),r=t=>{var e=Fo();let n;je(()=>n=ki(e,"",n,{"z-index":Dn(a)})),gi(3,e,()=>Po,()=>({duration:200})),jn(t,e)};ni(i,t=>{Dn(s)&&t(r)}),jn(t,n)},$$slots:{default:!0}}),Bt()}export{qo as B,Ho as D,zo as M,Qn as a,Li as b,ji as c,er as d,_r as e,yr as f,Ri as g,xr as h,Fi as i,Dr as j,Lr as k,kr as l,Gn as m,Fr as n,Ir as o,$r as p,Pr as q,mr as r,Ai as s,Ui as t,wr as u,Hr as v,qr as w,$o as x};
1
+ var t,e,n,i,r,o,s,l,a,d,u,c,f,h,p,v,g,m,w,y,x,b,M,z,k,I,_,P,D,C,S,O,E,W,T,B,R,A,L,H,$,F,q=Object.defineProperty,j=t=>{throw TypeError(t)},X=(t,e,n)=>((t,e,n)=>e in t?q(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n)(t,"symbol"!=typeof e?e+"":e,n),Y=(t,e,n)=>e.has(t)||j("Cannot "+n),N=(t,e,n)=>(Y(t,e,"read from private field"),n?n.call(t):e.get(t)),K=(t,e,n)=>e.has(t)?j("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),G=(t,e,n,i)=>(Y(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n),V=(t,e,n)=>(Y(t,e,"access private method"),n),U=Array.isArray,Q=Array.prototype.indexOf,J=Array.from,Z=Object.defineProperty,tt=Object.getOwnPropertyDescriptor,et=Object.getOwnPropertyDescriptors,nt=Object.prototype,it=Array.prototype,rt=Object.getPrototypeOf,ot=Object.isExtensible;const st=()=>{};function lt(){var t,e;return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}}const at=16,dt=512,ut=1024,ct=2048,ft=4096,ht=8192,pt=16384,vt=32768,gt=65536,mt=1<<18,wt=1<<19,yt=1<<25,xt=32768,bt=1<<21,Mt=1<<23,zt=Symbol("$state"),kt=Symbol(""),It=new class extends Error{constructor(){super(...arguments),X(this,"name","StaleReactionError"),X(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function _t(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}const Pt=Symbol();function Dt(t){return t===this.v}function Ct(t,e){return t!=t?e==e:t!==e||null!==t&&"object"==typeof t||"function"==typeof t}function St(t){return!Ct(t,this.v)}let Ot=null;function Et(t){Ot=t}function Wt(t){return Rt().get(t)}function Tt(t,e=!1,n){Ot={p:Ot,i:!1,c:null,e:null,s:t,x:null,l:null}}function Bt(t){var e=Ot,n=e.e;if(null!==n)for(var i of(e.e=null,n))$e(i);return void 0!==t&&(e.x=t),e.i=!0,Ot=e.p,t??{}}function Rt(t){return null===Ot&&_t(),Ot.c??(Ot.c=new Map(function(){let t=Ot.p;for(;null!==t;){const e=t.c;if(null!==e)return e;t=t.p}return null}()||void 0))}let At=[];function Lt(){var t=At;At=[],function(t){for(var e=0;e<t.length;e++)t[e]()}(t)}function Ht(t){if(0===At.length&&!Vt){var e=At;queueMicrotask(()=>{e===At&&Lt()})}At.push(t)}function $t(){for(;At.length>0;)Lt()}function Ft(t){var e=dn;if(null===e)return sn.f|=Mt,t;if(0===(e.f&vt)){if(!(128&e.f))throw t;e.b.error(t)}else qt(t,e)}function qt(t,e){for(;null!==e;){if(128&e.f)try{return void e.b.error(t)}catch(e){t=e}e=e.parent}throw t}const jt=new Set;let Xt=null,Yt=null,Nt=[],Kt=null,Gt=!1,Vt=!1;t=new WeakMap,e=new WeakMap,n=new WeakMap,i=new WeakMap,r=new WeakMap,o=new WeakMap,s=new WeakMap,l=new WeakSet,a=function(t,e){var n;t.f^=ut;for(var i=t.first;null!==i;){var r=i.f,s=!!(96&r),a=s&&0!==(r&ut)||0!==(r&ht)||this.skipped_effects.has(i);if(!!(128&i.f)&&(null==(n=i.b)?void 0:n.is_pending())&&(e={parent:e,effect:i,effects:[],render_effects:[]}),!a&&null!==i.fn){s?i.f^=ut:4&r?e.effects.push(i):bn(i)&&(0!==(i.f&at)&&N(this,o).add(i),_n(i));var u=i.first;if(null!==u){i=u;continue}}var c=i.parent;for(i=i.next;null===i&&null!==c;)c===e.effect&&(V(this,l,d).call(this,e.effects),V(this,l,d).call(this,e.render_effects),e=e.parent),i=c.next,c=c.parent}},d=function(t){for(const e of t)0!==(e.f&ct)?N(this,o).add(e):0!==(e.f&ft)&&N(this,s).add(e),V(this,l,u).call(this,e.deps),Wn(e,ut)},u=function(t){if(null!==t)for(const e of t)2&e.f&&0!==(e.f&xt)&&(e.f^=xt,V(this,l,u).call(this,e.deps))},c=function(){if(0===N(this,i)){for(const e of N(this,t))e();N(this,t).clear()}0===N(this,n)&&V(this,l,f).call(this)},f=function(){var t;if(jt.size>1){this.previous.clear();var e=Yt,n=!0,i={parent:null,effect:null,effects:[],render_effects:[]};for(const e of jt){if(e===this){n=!1;continue}const o=[];for(const[t,i]of this.current){if(e.current.has(t)){if(!n||i===e.current.get(t))continue;e.current.set(t,i)}o.push(t)}if(0===o.length)continue;const s=[...e.current.keys()].filter(t=>!this.current.has(t));if(s.length>0){var r=Nt;Nt=[];const n=new Set,d=new Map;for(const t of o)ee(t,s,n,d);if(Nt.length>0){Xt=e,e.apply();for(const n of Nt)V(t=e,l,a).call(t,n,i);e.deactivate()}Nt=r}}Xt=null,Yt=e}this.committed=!0,jt.delete(this)};let Ut=class u{constructor(){K(this,l),X(this,"committed",!1),X(this,"current",new Map),X(this,"previous",new Map),K(this,t,new Set),K(this,e,new Set),K(this,n,0),K(this,i,0),K(this,r,null),K(this,o,new Set),K(this,s,new Set),X(this,"skipped_effects",new Set),X(this,"is_fork",!1)}is_deferred(){return this.is_fork||N(this,i)>0}process(t){var e;Nt=[],this.apply();var n={parent:null,effect:null,effects:[],render_effects:[]};for(const e of t)V(this,l,a).call(this,e,n);this.is_fork||V(this,l,c).call(this),this.is_deferred()?(V(this,l,d).call(this,n.effects),V(this,l,d).call(this,n.render_effects)):(Xt=null,te(n.render_effects),te(n.effects),null==(e=N(this,r))||e.resolve()),Yt=null}capture(t,e){this.previous.has(t)||this.previous.set(t,e),0===(t.f&Mt)&&(this.current.set(t,t.v),null==Yt||Yt.set(t,t.v))}activate(){Xt=this,this.apply()}deactivate(){Xt===this&&(Xt=null,Yt=null)}flush(){if(this.activate(),Nt.length>0){if(Qt(),null!==Xt&&Xt!==this)return}else 0===N(this,n)&&this.process([]);this.deactivate()}discard(){for(const t of N(this,e))t(this);N(this,e).clear()}increment(t){G(this,n,N(this,n)+1),t&&G(this,i,N(this,i)+1)}decrement(t){G(this,n,N(this,n)-1),t&&G(this,i,N(this,i)-1),this.revive()}revive(){for(const t of N(this,o))N(this,s).delete(t),Wn(t,ct),ie(t);for(const t of N(this,s))Wn(t,ft),ie(t);this.flush()}oncommit(e){N(this,t).add(e)}ondiscard(t){N(this,e).add(t)}settled(){return(N(this,r)??G(this,r,lt())).promise}static ensure(){if(null===Xt){const t=Xt=new u;jt.add(Xt),Vt||u.enqueue(()=>{Xt===t&&t.flush()})}return Xt}static enqueue(t){Ht(t)}apply(){}};function Qt(){var t=en;Gt=!0;try{var e=0;for(nn(!0);Nt.length>0;){var n=Ut.ensure();e++>1e3&&Jt(),n.process(Nt),pe.clear()}}finally{Gt=!1,nn(t),Kt=null}}function Jt(){try{!function(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}()}catch(t){qt(t,Kt)}}let Zt=null;function te(t){var e=t.length;if(0!==e){for(var n=0;n<e;){var i=t[n++];if(!(24576&i.f)&&bn(i)&&(Zt=new Set,_n(i),null===i.deps&&null===i.first&&null===i.nodes&&(null===i.teardown&&null===i.ac?Ve(i):i.fn=null),(null==Zt?void 0:Zt.size)>0)){pe.clear();for(const t of Zt){if(24576&t.f)continue;const e=[t];let n=t.parent;for(;null!==n;)Zt.has(n)&&(Zt.delete(n),e.push(n)),n=n.parent;for(let t=e.length-1;t>=0;t--){const n=e[t];24576&n.f||_n(n)}}Zt.clear()}}Zt=null}}function ee(t,e,n,i){if(!n.has(t)&&(n.add(t),null!==t.reactions))for(const r of t.reactions){const t=r.f;2&t?ee(r,e,n,i):4194320&t&&0===(t&ct)&&ne(r,e,i)&&(Wn(r,ct),ie(r))}}function ne(t,e,n){const i=n.get(t);if(void 0!==i)return i;if(null!==t.deps)for(const i of t.deps){if(e.includes(i))return!0;if(2&i.f&&ne(i,e,n))return n.set(i,!0),!0}return n.set(t,!1),!1}function ie(t){for(var e=Kt=t;null!==e.parent;){var n=(e=e.parent).f;if(Gt&&e===dn&&0!==(n&at)&&0===(n&mt))return;if(96&n){if(0===(n&ut))return;e.f^=ut}}Nt.push(e)}class re{constructor(t,e,n){K(this,C),X(this,"parent"),K(this,h,!1),K(this,p),K(this,v,null),K(this,g),K(this,m),K(this,w),K(this,y,null),K(this,x,null),K(this,b,null),K(this,M,null),K(this,z,null),K(this,k,0),K(this,I,0),K(this,_,!1),K(this,P,null),K(this,D,function(t){let e,n=0,i=ge(0);return()=>{Ae()&&(Dn(i),qe(()=>(0===n&&(e=On(()=>t())),n+=1,()=>{Ht(()=>{n-=1,0===n&&(null==e||e(),e=void 0,Me(i))})})))}}(()=>(G(this,P,ge(N(this,k))),()=>{G(this,P,null)}))),G(this,p,t),G(this,g,e),G(this,m,n),this.parent=dn.b,G(this,h,!!N(this,g).pending),G(this,w,Xe(()=>{dn.b=this;var t=V(this,C,S).call(this);try{G(this,y,Ye(()=>n(t)))}catch(t){this.error(t)}return N(this,I)>0?V(this,C,E).call(this):G(this,h,!1),()=>{var t;null==(t=N(this,z))||t.remove()}},589952))}is_pending(){return N(this,h)||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!N(this,g).pending}update_pending_count(t){V(this,C,W).call(this,t),G(this,k,N(this,k)+t),N(this,P)&&xe(N(this,P),N(this,k))}get_effect_pending(){return N(this,D).call(this),Dn(N(this,P))}error(t){var e=N(this,g).onerror;let n=N(this,g).failed;if(N(this,_)||!e&&!n)throw t;N(this,y)&&(Ge(N(this,y)),G(this,y,null)),N(this,x)&&(Ge(N(this,x)),G(this,x,null)),N(this,b)&&(Ge(N(this,b)),G(this,b,null));var i=!1,r=!1;const o=()=>{i||(i=!0,r&&function(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}(),Ut.ensure(),G(this,k,0),null!==N(this,b)&&Ue(N(this,b),()=>{G(this,b,null)}),G(this,h,this.has_pending_snippet()),G(this,y,V(this,C,O).call(this,()=>(G(this,_,!1),Ye(()=>N(this,m).call(this,N(this,p)))))),N(this,I)>0?V(this,C,E).call(this):G(this,h,!1))};var s=sn;try{an(null),r=!0,null==e||e(t,o),r=!1}catch(t){qt(t,N(this,w)&&N(this,w).parent)}finally{an(s)}n&&Ht(()=>{G(this,b,V(this,C,O).call(this,()=>{Ut.ensure(),G(this,_,!0);try{return Ye(()=>{n(N(this,p),()=>t,()=>o)})}catch(t){return qt(t,N(this,w).parent),null}finally{G(this,_,!1)}}))})}}function oe(){un(null),an(null),Et(null)}function se(t){var e=null!==sn&&2&sn.f?sn:null;return null!==dn&&(dn.f|=wt),{ctx:Ot,deps:null,effects:null,equals:Dt,f:2050,fn:t,reactions:null,rv:0,v:Pt,wv:0,parent:e??dn,ac:null}}function le(t,e){let n=dn;null===n&&function(){throw new Error("https://svelte.dev/e/async_derived_orphan")}();var i=n.b,r=void 0,o=ge(Pt),s=!sn,l=new Map;return function(t){Re(4718592,t,!0)}(()=>{var e,n=lt();r=n.promise;try{Promise.resolve(t()).then(n.resolve,n.reject).then(()=>{a===Xt&&a.committed&&a.deactivate(),oe()})}catch(t){n.reject(t),oe()}var a=Xt;if(s){var d=!i.is_pending();i.update_pending_count(1),a.increment(d),null==(e=l.get(a))||e.reject(It),l.delete(a),l.set(a,n)}const u=(t,e=void 0)=>{if(a.activate(),e)e!==It&&(o.f|=Mt,xe(o,e));else{0!==(o.f&Mt)&&(o.f^=Mt),xe(o,t);for(const[t,e]of l){if(l.delete(t),t===a)break;e.reject(It)}}s&&(i.update_pending_count(-1),a.decrement(d))};n.promise.then(u,t=>u(null,t||"unknown"))}),Le(()=>{for(const t of l.values())t.reject(It)}),new Promise(t=>{!function e(n){function i(){n===r?t(o):e(r)}n.then(i,i)}(r)})}function ae(t){const e=se(t);return fn(e),e}function de(t){const e=se(t);return e.equals=St,e}function ue(t){var e=t.effects;if(null!==e){t.effects=null;for(var n=0;n<e.length;n+=1)Ge(e[n])}}function ce(t){var e,n=dn;un(function(t){for(var e=t.parent;null!==e;){if(!(2&e.f))return 0===(e.f&pt)?e:null;e=e.parent}return null}(t));try{t.f&=-32769,ue(t),e=zn(t)}finally{un(n)}return e}function fe(t){var e=ce(t);t.equals(e)||((null==Xt?void 0:Xt.is_fork)||(t.v=e),t.wv=xn()),rn||(null!==Yt?(Ae()||(null==Xt?void 0:Xt.is_fork))&&Yt.set(t,e):Wn(t,0===(t.f&dt)?ft:ut))}h=new WeakMap,p=new WeakMap,v=new WeakMap,g=new WeakMap,m=new WeakMap,w=new WeakMap,y=new WeakMap,x=new WeakMap,b=new WeakMap,M=new WeakMap,z=new WeakMap,k=new WeakMap,I=new WeakMap,_=new WeakMap,P=new WeakMap,D=new WeakMap,C=new WeakSet,S=function(){var t=N(this,p);return N(this,h)&&(G(this,z,Ce()),N(this,p).before(N(this,z)),t=N(this,z)),t},O=function(t){var e=dn,n=sn,i=Ot;un(N(this,w)),an(N(this,w)),Et(N(this,w).ctx);try{return t()}catch(t){return Ft(t),null}finally{un(e),an(n),Et(i)}},E=function(){const t=N(this,g).pending;null!==N(this,y)&&(G(this,M,document.createDocumentFragment()),N(this,M).append(N(this,z)),tn(N(this,y),N(this,M))),null===N(this,x)&&G(this,x,Ye(()=>t(N(this,p))))},W=function(t){var e;this.has_pending_snippet()?(G(this,I,N(this,I)+t),0===N(this,I)&&(G(this,h,!1),N(this,x)&&Ue(N(this,x),()=>{G(this,x,null)}),N(this,M)&&(N(this,p).before(N(this,M)),G(this,M,null)))):this.parent&&V(e=this.parent,C,W).call(e,t)};let he=new Set;const pe=new Map;let ve=!1;function ge(t,e){return{f:0,v:t,reactions:null,equals:Dt,rv:0,wv:0}}function me(t,e){const n=ge(t);return fn(n),n}function we(t,e=!1,n=!0){const i=ge(t);return e||(i.equals=St),i}function ye(t,e,n=!1){return null===sn||ln&&!(131072&sn.f)||!(4325394&sn.f)||(null==cn?void 0:cn.includes(t))||function(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}(),xe(t,n?ke(e):e)}function xe(t,e){if(!t.equals(e)){var n=t.v;rn?pe.set(t,e):pe.set(t,n),t.v=e;var i=Ut.ensure();i.capture(t,n),2&t.f&&(0!==(t.f&ct)&&ce(t),Wn(t,0!==(t.f&dt)?ut:ft)),t.wv=xn(),ze(t,ct),null===dn||0===(dn.f&ut)||96&dn.f||(null===vn?function(t){vn=t}([t]):vn.push(t)),!i.is_fork&&he.size>0&&!ve&&function(){ve=!1;var t=en;nn(!0);const e=Array.from(he);try{for(const t of e)0!==(t.f&ut)&&Wn(t,ft),bn(t)&&_n(t)}finally{nn(t)}he.clear()}()}return e}function be(t,e=1){var n=Dn(t),i=1===e?n++:n--;return ye(t,n),i}function Me(t){ye(t,t.v+1)}function ze(t,e){var n=t.reactions;if(null!==n)for(var i=n.length,r=0;r<i;r++){var o=n[r],s=o.f,l=0===(s&ct);if(l&&Wn(o,e),2&s){var a=o;null==Yt||Yt.delete(a),0===(s&xt)&&(s&dt&&(o.f|=xt),ze(a,ft))}else l&&(0!==(s&at)&&null!==Zt&&Zt.add(o),ie(o))}}function ke(t){if("object"!=typeof t||null===t||zt in t)return t;const e=rt(t);if(e!==nt&&e!==it)return t;var n=new Map,i=U(t),r=me(0),o=wn,s=t=>{if(wn===o)return t();var e=sn,n=wn;an(null),yn(o);var i=t();return an(e),yn(n),i};return i&&n.set("length",me(t.length)),new Proxy(t,{defineProperty(t,e,i){"value"in i&&!1!==i.configurable&&!1!==i.enumerable&&!1!==i.writable||function(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}();var r=n.get(e);return void 0===r?r=s(()=>{var t=me(i.value);return n.set(e,t),t}):ye(r,i.value,!0),!0},deleteProperty(t,e){var i=n.get(e);if(void 0===i){if(e in t){const t=s(()=>me(Pt));n.set(e,t),Me(r)}}else ye(i,Pt),Me(r);return!0},get(e,i,r){var o;if(i===zt)return t;var l=n.get(i),a=i in e;if(void 0!==l||a&&!(null==(o=tt(e,i))?void 0:o.writable)||(l=s(()=>me(ke(a?e[i]:Pt))),n.set(i,l)),void 0!==l){var d=Dn(l);return d===Pt?void 0:d}return Reflect.get(e,i,r)},getOwnPropertyDescriptor(t,e){var i=Reflect.getOwnPropertyDescriptor(t,e);if(i&&"value"in i){var r=n.get(e);r&&(i.value=Dn(r))}else if(void 0===i){var o=n.get(e),s=null==o?void 0:o.v;if(void 0!==o&&s!==Pt)return{enumerable:!0,configurable:!0,value:s,writable:!0}}return i},has(t,e){var i;if(e===zt)return!0;var r=n.get(e),o=void 0!==r&&r.v!==Pt||Reflect.has(t,e);return!((void 0!==r||null!==dn&&(!o||(null==(i=tt(t,e))?void 0:i.writable)))&&(void 0===r&&(r=s(()=>me(o?ke(t[e]):Pt)),n.set(e,r)),Dn(r)===Pt))&&o},set(t,e,o,l){var a,d=n.get(e),u=e in t;if(i&&"length"===e)for(var c=o;c<d.v;c+=1){var f=n.get(c+"");void 0!==f?ye(f,Pt):c in t&&(f=s(()=>me(Pt)),n.set(c+"",f))}void 0===d?u&&!(null==(a=tt(t,e))?void 0:a.writable)||(ye(d=s(()=>me(void 0)),ke(o)),n.set(e,d)):(u=d.v!==Pt,ye(d,s(()=>ke(o))));var h=Reflect.getOwnPropertyDescriptor(t,e);if((null==h?void 0:h.set)&&h.set.call(l,o),!u){if(i&&"string"==typeof e){var p=n.get("length"),v=Number(e);Number.isInteger(v)&&v>=p.v&&ye(p,v+1)}Me(r)}return!0},ownKeys(t){Dn(r);var e=Reflect.ownKeys(t).filter(t=>{var e=n.get(t);return void 0===e||e.v!==Pt});for(var[i,o]of n)o.v===Pt||i in t||e.push(i);return e},setPrototypeOf(){!function(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}()}})}var Ie,_e,Pe,De;function Ce(t=""){return document.createTextNode(t)}function Se(t){return Pe.call(t)}function Oe(t){return De.call(t)}function Ee(t,e){return Se(t)}function We(t,e=!1){var n=Se(t);return n instanceof Comment&&""===n.data?Oe(n):n}function Te(t,e=1,n=!1){let i=t;for(;e--;)i=Oe(i);return i}function Be(t){var e=sn,n=dn;an(null),un(null);try{return t()}finally{an(e),un(n)}}function Re(t,e,n){var i=dn;null!==i&&0!==(i.f&ht)&&(t|=ht);var r={ctx:Ot,deps:null,nodes:null,f:t|ct|dt,first:null,fn:e,last:null,next:null,parent:i,b:i&&i.b,prev:null,teardown:null,wv:0,ac:null};if(n)try{_n(r),r.f|=vt}catch(t){throw Ge(r),t}else null!==e&&ie(r);var o=r;if(n&&null===o.deps&&null===o.teardown&&null===o.nodes&&o.first===o.last&&0===(o.f&wt)&&(o=o.first,0!==(t&at)&&0!==(t&gt)&&null!==o&&(o.f|=gt)),null!==o&&(o.parent=i,null!==i&&function(t,e){var n=e.last;null===n?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}(o,i),null!==sn&&2&sn.f&&!(64&t))){var s=sn;(s.effects??(s.effects=[])).push(o)}return r}function Ae(){return null!==sn&&!ln}function Le(t){const e=Re(8,null,!1);return Wn(e,ut),e.teardown=t,e}function He(t){null===dn&&(null===sn&&function(){throw new Error("https://svelte.dev/e/effect_orphan")}(),function(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}()),rn&&function(){throw new Error("https://svelte.dev/e/effect_in_teardown")}();var e=dn.f;if(sn||!(32&e)||0!==(e&vt))return $e(t);var n=Ot;(n.e??(n.e=[])).push(t)}function $e(t){return Re(1048580,t,!1)}function Fe(t){return Re(4,t,!1)}function qe(t,e=0){return Re(8|e,t,!0)}function je(t,e=[],n=[],i=[]){!function(t,e,n,i){const r=se;if(0!==n.length||0!==t.length){var o,s,l,a,d=Xt,u=dn,c=(o=dn,s=sn,l=Ot,a=Xt,function(t=!0){un(o),an(s),Et(l),t&&(null==a||a.activate())});t.length>0?Promise.all(t).then(()=>{c();try{return f()}finally{null==d||d.deactivate(),oe()}}):f()}else i(e.map(r));function f(){Promise.all(n.map(t=>le(t))).then(t=>{c();try{i([...e.map(r),...t])}catch(t){0===(u.f&pt)&&qt(t,u)}null==d||d.deactivate(),oe()}).catch(t=>{qt(t,u)})}}(i,e,n,e=>{Re(8,()=>t(...e.map(Dn)),!0)})}function Xe(t,e=0){return Re(at|e,t,!0)}function Ye(t){return Re(524320,t,!0)}function Ne(t){var e=t.teardown;if(null!==e){const t=rn,n=sn;on(!0),an(null);try{e.call(null)}finally{on(t),an(n)}}}function Ke(t,e=!1){var n=t.first;for(t.first=t.last=null;null!==n;){const t=n.ac;null!==t&&Be(()=>{t.abort(It)});var i=n.next;64&n.f?n.parent=null:Ge(n,e),n=i}}function Ge(t,e=!0){var n=!1;!e&&0===(t.f&mt)||null===t.nodes||null===t.nodes.end||(function(t,e){for(;null!==t;){var n=t===e?null:Oe(t);t.remove(),t=n}}(t.nodes.start,t.nodes.end),n=!0),Ke(t,e&&!n),In(t,0),Wn(t,pt);var i=t.nodes&&t.nodes.t;if(null!==i)for(const t of i)t.stop();Ne(t);var r=t.parent;null!==r&&null!==r.first&&Ve(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=null}function Ve(t){var e=t.parent,n=t.prev,i=t.next;null!==n&&(n.next=i),null!==i&&(i.prev=n),null!==e&&(e.first===t&&(e.first=i),e.last===t&&(e.last=n))}function Ue(t,e,n=!0){var i=[];Qe(t,i,!0);var r=()=>{n&&Ge(t),e&&e()},o=i.length;if(o>0){var s=()=>--o||r();for(var l of i)l.out(s)}else r()}function Qe(t,e,n){if(0===(t.f&ht)){t.f^=ht;var i=t.nodes&&t.nodes.t;if(null!==i)for(const t of i)(t.is_global||n)&&e.push(t);for(var r=t.first;null!==r;){var o=r.next;Qe(r,e,!!(0!==(r.f&gt)||32&r.f&&0!==(t.f&at))&&n),r=o}}}function Je(t){Ze(t,!0)}function Ze(t,e){if(0!==(t.f&ht)){t.f^=ht,0===(t.f&ut)&&(Wn(t,ct),ie(t));for(var n=t.first;null!==n;){var i=n.next;Ze(n,!!(0!==(n.f&gt)||32&n.f)&&e),n=i}var r=t.nodes&&t.nodes.t;if(null!==r)for(const t of r)(t.is_global||e)&&t.in()}}function tn(t,e){if(t.nodes)for(var n=t.nodes.start,i=t.nodes.end;null!==n;){var r=n===i?null:Oe(n);e.append(n),n=r}}let en=!1;function nn(t){en=t}let rn=!1;function on(t){rn=t}let sn=null,ln=!1;function an(t){sn=t}let dn=null;function un(t){dn=t}let cn=null;function fn(t){null!==sn&&(null===cn?cn=[t]:cn.push(t))}let hn=null,pn=0,vn=null,gn=1,mn=0,wn=mn;function yn(t){wn=t}function xn(){return++gn}function bn(t){var e=t.f;if(0!==(e&ct))return!0;if(2&e&&(t.f&=-32769),0!==(e&ft)){var n=t.deps;if(null!==n)for(var i=n.length,r=0;r<i;r++){var o=n[r];if(bn(o)&&fe(o),o.wv>t.wv)return!0}0!==(e&dt)&&null===Yt&&Wn(t,ut)}return!1}function Mn(t,e,n=!0){var i=t.reactions;if(null!==i&&!(null==cn?void 0:cn.includes(t)))for(var r=0;r<i.length;r++){var o=i[r];2&o.f?Mn(o,e,!1):e===o&&(n?Wn(o,ct):0!==(o.f&ut)&&Wn(o,ft),ie(o))}}function zn(t){var e,n=hn,i=pn,r=vn,o=sn,s=cn,l=Ot,a=ln,d=wn,u=t.f;hn=null,pn=0,vn=null,sn=96&u?null:t,cn=null,Et(t.ctx),ln=!1,wn=++mn,null!==t.ac&&(Be(()=>{t.ac.abort(It)}),t.ac=null);try{t.f|=bt;var c=(0,t.fn)(),f=t.deps;if(null!==hn){var h;if(In(t,pn),null!==f&&pn>0)for(f.length=pn+hn.length,h=0;h<hn.length;h++)f[pn+h]=hn[h];else t.deps=f=hn;if(Ae()&&0!==(t.f&dt))for(h=pn;h<f.length;h++)((e=f[h]).reactions??(e.reactions=[])).push(t)}else null!==f&&pn<f.length&&(In(t,pn),f.length=pn);if(!(null===vn||ln||null===f||6146&t.f))for(h=0;h<vn.length;h++)Mn(vn[h],t);return null!==o&&o!==t&&(mn++,null!==vn&&(null===r?r=vn:r.push(...vn))),0!==(t.f&Mt)&&(t.f^=Mt),c}catch(t){return Ft(t)}finally{t.f^=bt,hn=n,pn=i,vn=r,sn=o,cn=s,Et(l),ln=a,wn=d}}function kn(t,e){let n=e.reactions;if(null!==n){var i=Q.call(n,t);if(-1!==i){var r=n.length-1;0===r?n=e.reactions=null:(n[i]=n[r],n.pop())}}null===n&&2&e.f&&(null===hn||!hn.includes(e))&&(Wn(e,ft),0!==(e.f&dt)&&(e.f^=dt,e.f&=-32769),ue(e),In(e,0))}function In(t,e){var n=t.deps;if(null!==n)for(var i=e;i<n.length;i++)kn(t,n[i])}function _n(t){var e=t.f;if(0===(e&pt)){Wn(t,ut);var n=dn,i=en;dn=t,en=!0;try{16777232&e?function(t){for(var e=t.first;null!==e;){var n=e.next;!(32&e.f)&&Ge(e),e=n}}(t):Ke(t),Ne(t);var r=zn(t);t.teardown="function"==typeof r?r:null,t.wv=gn}finally{en=i,dn=n}}}async function Pn(){await Promise.resolve(),function(){var t=Vt;Vt=!0;try{for(;;){if($t(),0===Nt.length&&(null==Xt||Xt.flush(),0===Nt.length))return void(Kt=null);Qt()}}finally{Vt=t}}()}function Dn(t){var e=!!(2&t.f);if(!(null===sn||ln||null!==dn&&0!==(dn.f&pt)||(null==cn?void 0:cn.includes(t)))){var n=sn.deps;if(0!==(sn.f&bt))t.rv<mn&&(t.rv=mn,null===hn&&null!==n&&n[pn]===t?pn++:null===hn?hn=[t]:hn.includes(t)||hn.push(t));else{(sn.deps??(sn.deps=[])).push(t);var i=t.reactions;null===i?t.reactions=[sn]:i.includes(sn)||i.push(sn)}}if(rn){if(pe.has(t))return pe.get(t);if(e){var r=t,o=r.v;return(0===(r.f&ut)&&null!==r.reactions||Sn(r))&&(o=ce(r)),pe.set(r,o),o}}else e&&(!(null==Yt?void 0:Yt.has(t))||(null==Xt?void 0:Xt.is_fork)&&!Ae())&&(bn(r=t)&&fe(r),en&&Ae()&&0===(r.f&dt)&&Cn(r));if(null==Yt?void 0:Yt.has(t))return Yt.get(t);if(0!==(t.f&Mt))throw t.v;return t.v}function Cn(t){if(null!==t.deps){t.f^=dt;for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),2&e.f&&0===(e.f&dt)&&Cn(e)}}function Sn(t){if(t.v===Pt)return!0;if(null===t.deps)return!1;for(const e of t.deps){if(pe.has(e))return!0;if(2&e.f&&Sn(e))return!0}return!1}function On(t){var e=ln;try{return ln=!0,t()}finally{ln=e}}const En=-7169;function Wn(t,e){t.f=t.f&En|e}function Tn(t,e=new Set){if(!("object"!=typeof t||null===t||t instanceof EventTarget||e.has(t))){e.add(t),t instanceof Date&&t.getTime();for(let n in t)try{Tn(t[n],e)}catch(t){}const n=rt(t);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const e=et(n);for(let n in e){const i=e[n].get;if(i)try{i.call(t)}catch(t){}}}}}const Bn=["touchstart","touchmove"];function Rn(t){return Bn.includes(t)}const An=new Set,Ln=new Set;function Hn(t){for(var e=0;e<t.length;e++)An.add(t[e]);for(var n of Ln)n(t)}let $n=null;function Fn(t){var e,n=this,i=n.ownerDocument,r=t.type,o=(null==(e=t.composedPath)?void 0:e.call(t))||[],s=o[0]||t.target;$n=t;var l=0,a=$n===t&&t.__root;if(a){var d=o.indexOf(a);if(-1!==d&&(n===document||n===window))return void(t.__root=n);var u=o.indexOf(n);if(-1===u)return;d<=u&&(l=d)}if((s=o[l]||t.target)!==n){Z(t,"currentTarget",{configurable:!0,get:()=>s||i});var c=sn,f=dn;an(null),un(null);try{for(var h,p=[];null!==s;){var v=s.assignedSlot||s.parentNode||s.host||null;try{var g=s["__"+r];null==g||s.disabled&&t.target!==s||g.call(s,t)}catch(t){h?p.push(t):h=t}if(t.cancelBubble||v===n||null===v)break;s=v}if(h){for(let t of p)queueMicrotask(()=>{throw t});throw h}}finally{t.__root=n,delete t.currentTarget,an(c),un(f)}}}function qn(t,e){var n=dn;null===n.nodes&&(n.nodes={start:t,end:e,a:null,t:null})}function jn(t,e){var n,i=!!(1&e),r=!!(2&e),o=!t.startsWith("<!>");return()=>{var e,s;void 0===n&&(e=o?t:"<!>"+t,(s=document.createElement("template")).innerHTML=e.replaceAll("<!>","\x3c!----\x3e"),n=s.content,i||(n=Se(n)));var l=r||_e?document.importNode(n,!0):n.cloneNode(!0);return i?qn(Se(l),l.lastChild):qn(l,l),l}}function Xn(){var t=document.createDocumentFragment(),e=document.createComment(""),n=Ce();return t.append(e,n),qn(e,n),t}function Yn(t,e){null!==t&&t.before(e)}let Nn=!0;function Kn(t,e){var n=null==e?"":"object"==typeof e?e+"":e;n!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=n,t.nodeValue=n+"")}function Gn(t,e){return function(t,{target:e,anchor:n,props:i={},events:r,context:o,intro:s=!0}){!function(){if(void 0===Ie){Ie=window,_e=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;Pe=tt(e,"firstChild").get,De=tt(e,"nextSibling").get,ot(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),ot(n)&&(n.__t=void 0)}}();var l=new Set,a=t=>{for(var n=0;n<t.length;n++){var i=t[n];if(!l.has(i)){l.add(i);var r=Rn(i);e.addEventListener(i,Fn,{passive:r});var o=Vn.get(i);void 0===o?(document.addEventListener(i,Fn,{passive:r}),Vn.set(i,1)):Vn.set(i,o+1)}}};a(J(An)),Ln.add(a);var d=void 0,u=function(){Ut.ensure();const u=Re(524352,()=>{var u=n??e.appendChild(Ce());return new re(u,{pending:()=>{}},e=>{o&&(Tt({}),Ot.c=o),r&&(i.$$events=r),Nn=s,d=t(e,i)||{},Nn=!0,o&&Bt()}),()=>{var t;for(var i of l){e.removeEventListener(i,Fn);var r=Vn.get(i);0===--r?(document.removeEventListener(i,Fn),Vn.delete(i)):Vn.set(i,r)}Ln.delete(a),u!==n&&(null==(t=u.parentNode)||t.removeChild(u))}},!0);return(t={})=>new Promise(e=>{t.outro?Ue(u,()=>{Ge(u),e(void 0)}):(Ge(u),e(void 0))})}();return Un.set(d,u),d}(t,e)}const Vn=new Map;let Un=new WeakMap;function Qn(t,e){const n=Un.get(t);return n?(Un.delete(t),n(e)):Promise.resolve()}class Jn{constructor(t,e=!0){X(this,"anchor"),K(this,T,new Map),K(this,B,new Map),K(this,R,new Map),K(this,A,new Set),K(this,L,!0),K(this,H,()=>{var t=Xt;if(N(this,T).has(t)){var e=N(this,T).get(t),n=N(this,B).get(e);if(n)Je(n),N(this,A).delete(e);else{var i=N(this,R).get(e);i&&(N(this,B).set(e,i.effect),N(this,R).delete(e),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),n=i.effect)}for(const[e,n]of N(this,T)){if(N(this,T).delete(e),e===t)break;const i=N(this,R).get(n);i&&(Ge(i.effect),N(this,R).delete(n))}for(const[t,i]of N(this,B)){if(t===e||N(this,A).has(t))continue;const r=()=>{if(Array.from(N(this,T).values()).includes(t)){var e=document.createDocumentFragment();tn(i,e),e.append(Ce()),N(this,R).set(t,{effect:i,fragment:e})}else Ge(i);N(this,A).delete(t),N(this,B).delete(t)};N(this,L)||!n?(N(this,A).add(t),Ue(i,r,!1)):r()}}}),K(this,$,t=>{N(this,T).delete(t);const e=Array.from(N(this,T).values());for(const[t,n]of N(this,R))e.includes(t)||(Ge(n.effect),N(this,R).delete(t))}),this.anchor=t,G(this,L,e)}ensure(t,e){var n=Xt;!e||N(this,B).has(t)||N(this,R).has(t)||N(this,B).set(t,Ye(()=>e(this.anchor))),N(this,T).set(n,t),N(this,H).call(this)}}function Zn(t,e,n=!1){var i=new Jn(t);function r(t,e){i.ensure(t,e)}Xe(()=>{var t=!1;e((e,n=!0)=>{t=!0,r(n,e)}),t||r(!1,null)},n?gt:0)}function ti(t,e){return e}function ei(t,e=!0){for(var n=0;n<t.length;n++)Ge(t[n],e)}var ni;function ii(t,e,n,i,r,o=null){var s=t,l=new Map;!(4&e)||(s=t.appendChild(Ce()));var a,d=null,u=de(()=>{var t=n();return U(t)?t:null==t?[]:J(t)}),c=!0,f={effect:Xe(()=>{for(var t=(a=Dn(u)).length,h=new Set,p=0;p<t;p+=1){var v=a[p],g=i(v,p),m=c?null:l.get(g);m?(m.v&&xe(m.v,v),m.i&&xe(m.i,p)):(m=ri(l,c?s:ni??(ni=Ce()),v,g,p,r,e,n),c||(m.e.f|=yt),l.set(g,m)),h.add(g)}0===t&&o&&!d&&(c?d=Ye(()=>o(s)):(d=Ye(()=>o(ni??(ni=Ce())))).f|=yt),c||(f.fallback=d,function(t,e,n,i,r){var o,s,l,a,d,u,c,f,h,p,v,g,m,w,y=!!(8&i),x=e.length,b=t.items,M=t.effect.first,z=null,k=[],I=[];if(y)for(w=0;w<x;w+=1)g=r(e[w],w),0===((m=b.get(g).e).f&yt)&&(null==(s=null==(o=m.nodes)?void 0:o.a)||s.measure(),(v??(v=new Set)).add(m));for(w=0;w<x;w+=1){if(g=r(e[w],w),m=b.get(g).e,null!==t.outrogroups)for(const e of t.outrogroups)e.pending.delete(m),e.done.delete(m);if(0!==(m.f&yt)){if(m.f^=yt,m!==M){var _=z?z.next:M;m===t.effect.last&&(t.effect.last=m.prev),m.prev&&(m.prev.next=m.next),m.next&&(m.next.prev=m.prev),si(t,z,m),si(t,m,_),oi(m,_,n),k=[],I=[],M=(z=m).next;continue}oi(m,null,n)}if(0!==(m.f&ht)&&(Je(m),y&&(null==(a=null==(l=m.nodes)?void 0:l.a)||a.unfix(),(v??(v=new Set)).delete(m))),m!==M){if(void 0!==p&&p.has(m)){if(k.length<I.length){var P,D=I[0];z=D.prev;var C=k[0],S=k[k.length-1];for(P=0;P<k.length;P+=1)oi(k[P],D,n);for(P=0;P<I.length;P+=1)p.delete(I[P]);si(t,C.prev,S.next),si(t,z,C),si(t,S,D),M=D,z=S,w-=1,k=[],I=[]}else p.delete(m),oi(m,M,n),si(t,m.prev,m.next),si(t,m,null===z?t.effect.first:z.next),si(t,z,m),z=m;continue}for(k=[],I=[];null!==M&&M!==m;)(p??(p=new Set)).add(M),I.push(M),M=M.next;if(null===M)continue}0===(m.f&yt)&&k.push(m),z=m,M=m.next}if(null!==t.outrogroups){for(const e of t.outrogroups)0===e.pending.size&&(ei(J(e.done)),null==(d=t.outrogroups)||d.delete(e));0===t.outrogroups.size&&(t.outrogroups=null)}if(null!==M||void 0!==p){var O=[];if(void 0!==p)for(m of p)0===(m.f&ht)&&O.push(m);for(;null!==M;)0===(M.f&ht)&&M!==t.fallback&&O.push(M),M=M.next;var E=O.length;if(E>0){var W=4&i&&0===x?n:null;if(y){for(w=0;w<E;w+=1)null==(c=null==(u=O[w].nodes)?void 0:u.a)||c.measure();for(w=0;w<E;w+=1)null==(h=null==(f=O[w].nodes)?void 0:f.a)||h.fix()}!function(t,e,n){for(var i,r=e.length,o=e.length,s=0;s<r;s++){let n=e[s];Ue(n,()=>{if(i){if(i.pending.delete(n),i.done.add(n),0===i.pending.size){var e=t.outrogroups;ei(J(i.done)),e.delete(i),0===e.size&&(t.outrogroups=null)}}else o-=1},!1)}if(0===o){var l=null!==n;if(l){var a=n,d=a.parentNode;d.textContent="",d.append(a),t.items.clear()}ei(e,!l)}else i={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(i)}(t,O,W)}}y&&Ht(()=>{var t,e;if(void 0!==v)for(m of v)null==(e=null==(t=m.nodes)?void 0:t.a)||e.apply()})}(f,a,s,e,i),null!==d&&(0===a.length?0===(d.f&yt)?Je(d):(d.f^=yt,oi(d,null,s)):Ue(d,()=>{d=null}))),Dn(u)}),items:l,outrogroups:null,fallback:d};c=!1}function ri(t,e,n,i,r,o,s,l){var a=1&s?16&s?ge(n):we(n,!1,!1):null,d=2&s?ge(r):null;return{v:a,i:d,e:Ye(()=>(o(e,a??n,d??r,l),()=>{t.delete(i)}))}}function oi(t,e,n){if(t.nodes)for(var i=t.nodes.start,r=t.nodes.end,o=e&&0===(e.f&yt)?e.nodes.start:n;null!==i;){var s=Oe(i);if(o.before(i),i===r)return;i=s}}function si(t,e,n){null===e?t.effect.first=n:e.next=n,null===n?t.effect.last=e:n.prev=e}function li(t,e,...n){var i=new Jn(t);Xe(()=>{const t=e()??null;i.ensure(t,t&&(e=>t(e,...n)))},gt)}T=new WeakMap,B=new WeakMap,R=new WeakMap,A=new WeakMap,L=new WeakMap,H=new WeakMap,$=new WeakMap;const ai={tick:t=>requestAnimationFrame(t),now:()=>performance.now(),tasks:new Set};function di(){const t=ai.now();ai.tasks.forEach(e=>{e.c(t)||(ai.tasks.delete(e),e.f())}),0!==ai.tasks.size&&ai.tick(di)}function ui(t,e){Be(()=>{t.dispatchEvent(new CustomEvent(e))})}function ci(t){if("float"===t)return"cssFloat";if("offset"===t)return"cssOffset";if(t.startsWith("--"))return t;const e=t.split("-");return 1===e.length?e[0]:e[0]+e.slice(1).map(t=>t[0].toUpperCase()+t.slice(1)).join("")}function fi(t){const e={},n=t.split(";");for(const t of n){const[n,i]=t.split(":");if(!n||void 0===i)break;e[ci(n.trim())]=i.trim()}return e}const hi=t=>t;function pi(t,e,n,i){var r,o,s,l,a=!!(4&t),d=e.inert,u=e.style.overflow;function c(){return Be(()=>o??(o=n()(e,(null==i?void 0:i())??{},{direction:"both"})))}var f={is_global:a,in(){e.inert=d,ui(e,"introstart"),s=vi(e,c(),l,1,()=>{ui(e,"introend"),null==s||s.abort(),s=o=void 0,e.style.overflow=u})},out(t){e.inert=!0,ui(e,"outrostart"),l=vi(e,c(),s,0,()=>{ui(e,"outroend"),null==t||t()})},stop:()=>{null==s||s.abort(),null==l||l.abort()}},h=dn;if(((r=h.nodes).t??(r.t=[])).push(f),Nn){var p=a;if(!p){for(var v=h.parent;v&&0!==(v.f&gt);)for(;(v=v.parent)&&0===(v.f&at););p=!v||0!==(v.f&vt)}p&&Fe(()=>{On(()=>f.in())})}}function vi(t,e,n,i,r){var o=1===i;if("function"==typeof e){var s,l=!1;return Ht(()=>{if(!l){var a=e({direction:o?"in":"out"});s=vi(t,a,n,i,r)}}),{abort:()=>{l=!0,null==s||s.abort()},deactivate:()=>s.deactivate(),reset:()=>s.reset(),t:()=>s.t()}}if(null==n||n.deactivate(),!(null==e?void 0:e.duration))return r(),{abort:st,deactivate:st,reset:st,t:()=>i};const{delay:a=0,css:d,tick:u,easing:c=hi}=e;var f=[];if(o&&void 0===n&&(u&&u(0,1),d)){var h=fi(d(0,1));f.push(h,h)}var p=()=>1-i,v=t.animate(f,{duration:a,fill:"forwards"});return v.onfinish=()=>{v.cancel();var o=(null==n?void 0:n.t())??1-i;null==n||n.abort();var s=i-o,l=e.duration*Math.abs(s),a=[];if(l>0){var f=!1;if(d)for(var h=Math.ceil(l/(1e3/60)),g=0;g<=h;g+=1){var m=o+s*c(g/h),w=fi(d(m,1-m));a.push(w),f||(f="hidden"===w.overflow)}f&&(t.style.overflow="hidden"),p=()=>{var t=v.currentTime;return o+s*c(t/l)},u&&function(t){let e;0===ai.tasks.size&&ai.tick(di),new Promise(n=>{ai.tasks.add(e={c:t,f:n})})}(()=>{if("running"!==v.playState)return!1;var t=p();return u(t,1-t),!0})}(v=t.animate(a,{duration:l,fill:"forwards"})).onfinish=()=>{p=()=>i,null==u||u(i,1-i),r()}},{abort:()=>{v&&(v.cancel(),v.effect=null,v.onfinish=st)},deactivate:()=>{r=st},reset:()=>{0===i&&(null==u||u(1,0))},t:()=>p()}}function gi(t,e,n){Fe(()=>{var i=On(()=>e(t,null==n?void 0:n())||{});if(n&&(null==i?void 0:i.update)){var r=!1,o={};qe(()=>{var t=n();!function(t){if("object"==typeof t&&t&&!(t instanceof EventTarget))if(zt in t)Tn(t);else if(!Array.isArray(t))for(let e in t){const n=t[e];"object"==typeof n&&n&&zt in n&&Tn(n)}}(t),r&&Ct(o,t)&&(o=t,i.update(t))}),r=!0}if(null==i?void 0:i.destroy)return()=>i.destroy()})}const mi=[..." \t\n\r\f \v\ufeff"];function wi(t,e=!1){var n=e?" !important;":";",i="";for(var r in t){var o=t[r];null!=o&&""!==o&&(i+=" "+r+": "+o+n)}return i}function yi(t){return"-"!==t[0]||"-"!==t[1]?t.toLowerCase():t}function xi(t,e,n,i,r,o){var s=t.__className;if(s!==n||void 0===s){var l=function(t,e,n){var i=null==t?"":""+t;if(e&&(i=i?i+" "+e:e),n)for(var r in n)if(n[r])i=i?i+" "+r:r;else if(i.length)for(var o=r.length,s=0;(s=i.indexOf(r,s))>=0;){var l=s+o;0!==s&&!mi.includes(i[s-1])||l!==i.length&&!mi.includes(i[l])?s=l:i=(0===s?"":i.substring(0,s))+i.substring(l+1)}return""===i?null:i}(n,i,o);null==l?t.removeAttribute("class"):t.className=l,t.__className=n}else if(o&&r!==o)for(var a in o){var d=!!o[a];null!=r&&d===!!r[a]||t.classList.toggle(a,d)}return o}function bi(t,e={},n,i){for(var r in n){var o=n[r];e[r]!==o&&(null==n[r]?t.style.removeProperty(r):t.style.setProperty(r,o,i))}}function Mi(t,e,n,i){if(t.__style!==e){var r=function(t,e){if(e){var n,i,r="";if(Array.isArray(e)?(n=e[0],i=e[1]):n=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var o=!1,s=0,l=!1,a=[];n&&a.push(...Object.keys(n).map(yi)),i&&a.push(...Object.keys(i).map(yi));var d=0,u=-1;const e=t.length;for(var c=0;c<e;c++){var f=t[c];if(l?"/"===f&&"*"===t[c-1]&&(l=!1):o?o===f&&(o=!1):"/"===f&&"*"===t[c+1]?l=!0:'"'===f||"'"===f?o=f:"("===f?s++:")"===f&&s--,!l&&!1===o&&0===s)if(":"===f&&-1===u)u=c;else if(";"===f||c===e-1){if(-1!==u){var h=yi(t.substring(d,u).trim());a.includes(h)||(";"!==f&&c++,r+=" "+t.substring(d,c).trim()+";")}d=c+1,u=-1}}}return n&&(r+=wi(n)),i&&(r+=wi(i,!0)),""===(r=r.trim())?null:r}return null==t?null:String(t)}(e,i);null==r?t.removeAttribute("style"):t.style.cssText=r,t.__style=e}else i&&(Array.isArray(i)?(bi(t,null==n?void 0:n[0],i[0]),bi(t,null==n?void 0:n[1],i[1],"important")):bi(t,n,i));return i}const zi=Symbol("is custom element"),ki=Symbol("is html");function Ii(t,e,n,i){var r=function(t){return t.__attributes??(t.__attributes={[zi]:t.nodeName.includes("-"),[ki]:"http://www.w3.org/1999/xhtml"===t.namespaceURI})}(t);r[e]!==(r[e]=n)&&("loading"===e&&(t[kt]=n),null==n?t.removeAttribute(e):"string"!=typeof n&&function(t){var e,n=t.getAttribute("is")||t.nodeName,i=_i.get(n);if(i)return i;_i.set(n,i=[]);for(var r=t,o=Element.prototype;o!==r;){for(var s in e=et(r))e[s].set&&i.push(s);r=rt(r)}return i}(t).includes(e)?t[e]=n:t.setAttribute(e,n))}var _i=new Map;function Pi(t,e){return t===e||(null==t?void 0:t[zt])===e}function Di(t={},e,n,i){return Fe(()=>{var i,r;return qe(()=>{i=r,r=[],On(()=>{t!==n(...r)&&(e(t,...r),i&&Pi(n(...i),t)&&e(null,...i))})}),()=>{Ht(()=>{r&&Pi(n(...r),t)&&e(null,...r)})}}),t}function Ci(t,e,n,i){var r=i,o=!0,s=()=>(o&&(o=!1,r=i),r);return void 0===t[e]&&void 0!==i&&s(),()=>{var n=t[e];return void 0===n?s():(o=!0,n)}}function Si(t){null===Ot&&_t(),He(()=>{const e=On(t);if("function"==typeof e)return e})}function Oi(t){null===Ot&&_t(),Si(()=>()=>On(t))}"undefined"!=typeof window&&((F=window.__svelte??(window.__svelte={})).v??(F.v=new Set)).add("5");const Ei=Symbol("modal-render-icon"),Wi=Symbol("modal-id"),Ti={features:{dock:!0,minimize:!0,transparency:!0,resize:!0,drag:!0,focusTrap:!0,animations:!0,backdrop:!0,parentChild:!0},dock:{position:"bottom",labelMode:"beside",enableReorder:!0,enableFreeDrag:!0},animations:{open:400,close:250,minimize:500,restore:400},appearance:{headerLayout:"macos",defaultWidth:"480px",defaultHeight:"auto",minWidth:280,minHeight:200},zIndex:{base:400,dock:8e3,toast:9e3},parentChild:{movementMode:"animated",animationDuration:300},positioning:{strategy:"smart",modalGap:16,avoidElements:[]},portalTarget:"#modal-portal"};let Bi={...Ti},Ri=me(0);function Ai(){return Dn(Ri)}function Li(){return Bi}function Hi(t){const e=Bi;var n,i;Bi={features:{...(n=Ti).features,...(i=t).features},dock:{...n.dock,...i.dock},animations:{...n.animations,...i.animations},appearance:{...n.appearance,...i.appearance},zIndex:{...n.zIndex,...i.zIndex},parentChild:{...n.parentChild,...i.parentChild},positioning:{...n.positioning,...i.positioning},portalTarget:i.portalTarget??n.portalTarget},be(Ri),e.features.dock&&!Bi.features.dock&&(Array.from(Zi.values()).filter(t=>t.isMinimized).map(t=>t.id).forEach(t=>{const e=Zi.get(t);if(e){Zi.set(t,{...e,isMinimized:!1,isOpen:!0}),ye(ar,[...Dn(ar),t],!0),Pr(t);const n=e.lastChildId||e.childId;n&&zr(n)}}),ye(wr,[],!0),nr())}function $i(){Bi={...Ti},be(Ri)}const Fi={BASE:0,DROPDOWN:100,STICKY:200,OVERLAY:300,MODAL:400,DOCK:8e3,TOAST:9e3};let qi=me(ke(Fi.MODAL));function ji(){ye(qi,Li().zIndex.base,!0)}function Xi(t){const e=Li();return"MODAL"===t?e.zIndex.base:"DOCK"===t?e.zIndex.dock:"TOAST"===t?e.zIndex.toast:Fi[t]}function Yi(){ye(qi,Li().zIndex.base,!0)}const Ni=8;function Ki(t,e,n,i,r={}){const{margin:o=Ni,allowPartialVisibility:s=!1}=r,l="undefined"!=typeof window?window.innerWidth:1920,a="undefined"!=typeof window?window.innerHeight:1080;let d,u,c,f;return s&&n>l-2*o?(d=40-n,u=l-40):(d=o,u=Math.max(o,l-n-o)),s&&i>a-2*o?(c=40-i,f=a-40):(c=o,f=Math.max(o,a-i-o)),{x:Math.max(d,Math.min(u,t)),y:Math.max(c,Math.min(f,e))}}function Gi(t,e,n,i,r={}){const{margin:o=Ni}=r,s=("undefined"!=typeof window?window.innerWidth:1920)-2*o,l=("undefined"!=typeof window?window.innerHeight:1080)-2*o,a=Math.min(n,s),d=Math.min(i,l),u=Ki(t,e,a,d,r);return{x:u.x,y:u.y,width:a,height:d}}function Vi(t,e){return Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x))*Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y))}function Ui(t,e,n,i,r,o){const s={x:t-o,y:e-o,width:n+2*o,height:i+2*o};let l=0;for(const t of r)l+=Vi(s,t);return l}function Qi(t,e,n,i,r,o,s){const l=(r-n)/2,a=(o-i)/2,d=l-s,u=a-s,c=Math.abs(t-l)/(d||1),f=Math.abs(e-a)/(u||1),h=Math.sqrt(c*c+f*f)/Math.SQRT2,p=50,v=t-s,g=r-n-s-t,m=e-s,w=o-i-s-e;let y=0;return v<p&&(y+=.3*(1-v/p)),g<p&&(y+=.3*(1-g/p)),m<p&&(y+=.2*(1-m/p)),w<p&&(y+=.2*(1-w/p)),Math.min(1,h+y)}function Ji(t){return"symbol"==typeof t?t.description??"symbol":t}let Zi=ke(new Map),tr=me(0);const er=new Set;function nr(){be(tr),queueMicrotask(()=>{er.forEach(t=>t())})}function ir(t){return er.add(t),()=>er.delete(t)}let rr=me(ke([])),or=me(ke([])),sr=me(ke([])),lr=me(ke([])),ar=me(ke([])),dr=me(ke([])),ur=me(ke([])),cr=me(ke([])),fr=me(null),hr=ke(new Map),pr=me(null),vr=ke(new Map),gr=ke(new Set),mr=ke(new Set),wr=me(ke([]));function yr(t){const e=Zi.get(t.id),n=(null==e?void 0:e.zIndex)??function(){const t=Dn(qi);return ye(qi,Dn(qi)+2),t}();e?Zi.set(t.id,{...e,title:t.title,icon:t.icon,glow:t.glow,zIndex:n}):Zi.set(t.id,{...t,zIndex:n,isAnimating:!1}),nr(),t.isMinimized&&!Dn(wr).includes(t.id)&&Dn(wr).push(t.id)}function xr(t){const e=Zi.get(t);if(e){if(ye(wr,Dn(wr).filter(e=>e!==t),!0),e.childId){const t=Zi.get(e.childId);t&&Zi.set(e.childId,{...t,parentId:void 0})}if(e.parentId){const t=Zi.get(e.parentId);t&&Zi.set(e.parentId,{...t,childId:void 0,lastChildId:e.id})}Zi.delete(t),nr(),mr.delete(t),gr.delete(t)}}function br(t){const e=Zi.get(t);if(!e||e.isMinimized)return;if(Gr(t),e.parentId){const t=Zi.get(e.parentId);if(t&&!t.isMinimized)return void br(e.parentId)}ye(rr,[...Dn(rr),t],!0),e.position&&e.size;const n=e.childId;Zi.set(t,{...e,isMinimized:!0,lastChildId:n}),nr(),Dn(wr).includes(t)||Dn(wr).push(t),e.childId&&Er(t)}function Mr(t){const e=Zi.get(t);if(!e||!e.isMinimized)return;Zi.set(t,{...e,isMinimized:!1,isOpen:!0}),nr(),ye(ar,[...Dn(ar),t],!0),Pr(t);const n=e.lastChildId||e.childId;n&&zr(n)}function zr(t){const e=Zi.get(t);if(e&&e.isHiddenWithParent){Zi.set(t,{...e,isHiddenWithParent:!1}),nr(),ye(dr,[...Dn(dr),t],!0);const n=e.lastChildId||e.childId;n&&zr(n)}}function kr(t,e,n){const i=Zi.get(t);if(!i)return;let r=e;if((null==n?void 0:n.constrain)&&i.size&&(r=Ki(e.x,e.y,i.size.width,i.size.height)),Zi.set(t,{...i,position:r,size:(null==n?void 0:n.size)??i.size,hasBeenDragged:i.hasBeenDragged||(null==n?void 0:n.drag)||!1}),i.childId){let e=t,n=r;for(;;){const t=Zi.get(e);if(!(null==t?void 0:t.childId))break;const i=Zi.get(t.childId);if(!(null==i?void 0:i.offsetFromParent))break;const r={x:n.x+i.offsetFromParent.x,y:n.y+i.offsetFromParent.y};Zi.set(t.childId,{...i,position:r,hasBeenDragged:!0}),e=t.childId,n=r}}if(i.parentId&&i.offsetFromParent){const e=Li();let n=t,o=i;for(;o.parentId&&o.offsetFromParent;){const i=Zi.get(o.parentId);if(!i)break;const s=n===t?r:Zi.get(n).position,l={x:s.x-o.offsetFromParent.x,y:s.y-o.offsetFromParent.y};"animated"===e.parentChild.movementMode?vr.set(o.parentId,l):Zi.set(o.parentId,{...i,position:l,hasBeenDragged:!0}),n=o.parentId,o=i}}nr()}function Ir(t,e){const n=Zi.get(t);n&&(Zi.set(t,{...n,...e}),nr())}function _r(t,e){const n=Zi.get(t);if(!(null==n?void 0:n.childId))return;const i=Zi.get(n.childId);if(!i)return;const r=e+2;Zi.set(n.childId,{...i,zIndex:r}),_r(n.childId,r)}function Pr(t){if(!Zi.get(t))return;const e=Math.max(...Array.from(Zi.values()).map(t=>t.zIndex),0),n=function(t){let e=t,n=Zi.get(e);for(;null==n?void 0:n.parentId;)e=n.parentId,n=Zi.get(e);return e}(t),i=Zi.get(n);if(!i)return;const r=e+2;Zi.set(n,{...i,zIndex:r}),_r(n,r),nr()}function Dr(t,e,n){const i=e.getBoundingClientRect();hr.set(t,{x:i.left+i.width/2,y:i.top+i.height/2});const r=Li();(null==n?void 0:n.parentId)&&r.features.parentChild&&ye(pr,{parentId:n.parentId,childId:t},!0),Dn(or).includes(t)||ye(or,[...Dn(or),t],!0),nr();const o=Zi.get(t);if(o){if(o.isOpen&&!o.isMinimized&&!o.isHiddenWithParent)return ye(or,Dn(or).filter(e=>e!==t),!0),qr(t),void Pr(t);if(o.isMinimized)return ye(or,Dn(or).filter(e=>e!==t),!0),void Mr(t);Zi.set(t,{...o,isOpen:!0}),Pr(t)}}function Cr(t,e=!1){const n=Zi.get(t);n&&(Gr(t),e?ye(lr,[...Dn(lr),t],!0):ye(sr,[...Dn(sr),t],!0),nr(),n.childId&&Cr(n.childId,e))}function Sr(){Array.from(Zi.keys()).forEach(t=>Cr(t,!0))}function Or(t,e,n){const i=Li();if(n&&!hr.has(t.id)){const e=n.getBoundingClientRect();hr.set(t.id,{x:e.left+e.width/2,y:e.top+e.height/2})}const r={id:t.id,title:t.title??"",icon:t.icon??"",isOpen:!0,isMinimized:!1,isHiddenWithParent:!1,isTransparent:t.isTransparent??!1,isRejected:!1,position:t.position??null,size:t.size??null,hasBeenDragged:t.hasBeenDragged??!1,dockPosition:t.dockPosition??-1,glow:t.glow??null};if(!i.features.parentChild){yr(r);const e=Zi.get(t.id);return e&&Zi.set(t.id,{...e,isOpen:!0}),ye(or,[...Dn(or),t.id],!0),nr(),void Pr(t.id)}const o=Zi.get(e);if(!o)return;o.childId&&Cr(o.childId,!0),yr({...r,parentId:e});const s=Zi.get(t.id);s&&Zi.set(t.id,{...s,isOpen:!0,parentId:e}),ye(or,[...Dn(or),t.id],!0),nr(),Pr(t.id),ye(pr,{parentId:e,childId:t.id},!0)}function Er(t){const e=Zi.get(t);if(!(null==e?void 0:e.childId))return;const n=Zi.get(e.childId);n&&(n.childId&&Er(e.childId),Zi.set(e.childId,{...n,isHiddenWithParent:!0}),nr())}function Wr(t){return Dn(rr).includes(t)}function Tr(t){return Zi.get(t)}function Br(){return Dn(tr)}function Rr(t){return Dn(or).includes(t)}function Ar(t){return Dn(sr).includes(t)}function Lr(t){return Dn(lr).includes(t)}function Hr(t){return!!Dn(lr).includes(t)&&(ye(lr,Dn(lr).filter(e=>e!==t),!0),!0)}function $r(t){return Dn(ar).includes(t)}function Fr(t){return Dn(dr).includes(t)}function qr(t){Zi.get(t)&&(Dn(ur).includes(t)||Dn(cr).includes(t)||(ye(ur,[...Dn(ur),t],!0),nr()))}function jr(t){const e=Zi.get(t);return void 0!==e&&e.isOpen&&!e.isMinimized&&!e.isHiddenWithParent}function Xr(t){return Zi.has(t)}function Yr(){return{get modals(){return Zi},get pendingMinimize(){return Dn(rr)},get pendingOpen(){return Dn(or)},get pendingClose(){return Dn(sr)},get pendingRestore(){return Dn(ar)},get dockOrder(){return Dn(wr)}}}function Nr(t){mr.has(t)?mr.delete(t):mr.add(t);const e=Zi.get(t);e&&(Zi.set(t,{...e,isTransparent:mr.has(t)}),nr())}function Kr(t){mr.delete(t);const e=Zi.get(t);e&&(Zi.set(t,{...e,isTransparent:!1}),nr())}function Gr(t){vr.delete(t)}function Vr(){return Li().features.animations}const Ur=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function Qr(t){return Array.from(t.querySelectorAll(Ur)).filter(t=>null!==t.offsetParent||"A"===t.tagName)}function Jr(t,e){if("Tab"!==t.key)return;const n=Qr(e);if(0===n.length)return void t.preventDefault();const i=n[0],r=n[n.length-1],o=document.activeElement;t.shiftKey?o===i&&(r.focus(),t.preventDefault()):o===r&&(i.focus(),t.preventDefault())}function Zr(t){const e=Qr(t);return e.length>0&&(e[0].focus(),!0)}const to="modal-portal";var eo=jn('<div style="display: contents;"><!></div>');function no(t,e){Tt(e,!0);let n=Ci(e,"target",0,"body"),i=null,r=null;const{mount:o}={mount:function(t,e=null){const n=function(t){if("undefined"==typeof window)return null;if(t instanceof HTMLElement)return t;if("string"==typeof t){const e=document.querySelector(t);if(e)return e;if(t.startsWith("#")){const e=t.slice(1),n=document.createElement("div");return n.id=e,document.body.appendChild(n),n}}let e=document.getElementById(to);return e||(e=document.createElement("div"),e.id=to,document.body.appendChild(e)),e}(e);return n?(n.appendChild(t),()=>{t.parentNode===n&&n.removeChild(t),n.id!==to&&0===n.children.length&&n.parentNode&&n.parentNode.removeChild(n)}):()=>{}}};Si(()=>(i&&(r=o(i,n())),()=>{null==r||r()}));var s=eo();li(Ee(s),()=>e.children),Di(s,t=>i=t,()=>i),Yn(t,s),Bt()}var io=jn('<button type="button" aria-label="Minimize"></button>'),ro=jn('<button type="button" class="modal-header-light modal-header-light-style" aria-label="Toggle style"></button>'),oo=jn('<div class="modal-header-icon"><!></div>'),so=jn('<div class="modal-header-icon"><!></div>'),lo=jn('<h2 class="modal-header-title"> </h2>'),ao=jn('<h2 class="modal-header-title"> </h2>'),uo=jn('<div class="modal-header-traffic-lights"><button type="button" class="modal-header-light modal-header-light-close" aria-label="Close"></button> <!> <!></div> <div class="modal-header-mac-center"><!> <div class="modal-header-title-group"><!></div></div> <div class="modal-header-mac-spacer"></div>',1),co=jn('<div class="modal-header-icon"><!></div>'),fo=jn('<div class="modal-header-icon"><!></div>'),ho=jn('<h2 class="modal-header-title"> </h2>'),po=jn('<h2 class="modal-header-title"> </h2>'),vo=jn('<button type="button" class="modal-header-btn-windows modal-header-btn-windows-style" aria-label="Toggle style">&#9671;</button>'),go=jn('<button type="button" aria-label="Minimize">&#8211;</button>'),mo=jn('<div class="modal-header-title-group"><!> <!></div> <div class="modal-header-actions"><!> <!> <button type="button" class="modal-header-btn-windows modal-header-btn-windows-close" aria-label="Close">&times;</button></div>',1),wo=jn("<header><!></header>");Hn(["pointerdown","click"]);var yo=jn("<div></div>"),xo=jn('<div class="modal-resize-handles"></div>');function bo(t,e){return e&&t.appendChild(e),{update(e){t.innerHTML="",e&&t.appendChild(e)},destroy(){t.innerHTML=""}}}Hn(["pointerdown"]);var Mo=jn('<div class="modal-footer"><!></div>'),zo=jn("<div></div>"),ko=jn('<div role="dialog" aria-modal="true" tabindex="-1"><!> <div class="modal-body"><!></div> <!> <!> <!></div>');function Io(t,e){Tt(e,!0);let n=Ci(e,"maxWidth",0,"600px"),i=Ci(e,"autoOpen",0,!1),r=Ci(e,"closeOnEscape",0,!0),o=Ci(e,"skipRegistration",0,!1);var s,l;s=Wi,l=()=>e.id,Rt().set(s,l);const a=Li().portalTarget,d=ae(()=>Ji(e.id));function u(t){var n,i;return(null==(i=null==(n=e.config)?void 0:n.features)?void 0:i[t])??function(t){return Bi.features[t]}(t)}const c=ae(()=>(Ai(),u("drag"))),f=ae(()=>(Ai(),u("minimize"))),h=ae(()=>(Ai(),!u("dock"))),p=ae(()=>(Ai(),u("transparency"))),v=ae(()=>(Ai(),u("resize"))),g=ae(()=>{var t,n;return Ai(),(null==(n=null==(t=e.config)?void 0:t.appearance)?void 0:n.headerLayout)??Li().appearance.headerLayout});let m=me(null),w=me(!1),y=me(!1),x=me(!1),b=me(!1),M=me(!1);const z=ae(()=>(Br(),Tr(e.id))),k=ae(()=>Dn(z)&&(Dn(z).isOpen||Ar(e.id))&&(!Dn(z).isMinimized||Wr(e.id))&&!Dn(z).isHiddenWithParent),I=ae(()=>{var t;return!!(null==(t=Dn(z))?void 0:t.childId)}),_=ae(()=>{var t;return!!(null==(t=Dn(z))?void 0:t.parentId)}),P=ae(()=>Dn(I)||Dn(y)),D=ae(()=>!!e.glow),C=ae(()=>`modal-title-${Dn(d)}`),S=ae(()=>{var t;return(null==(t=Dn(z))?void 0:t.zIndex)??1e3}),O=function(t={x:0,y:0}){const e=ke({...t}),n=ke({isDragging:!1,startX:0,startY:0,initialX:0,initialY:0,hasBeenDragged:!1});return{get position(){return e},get hasBeenDragged(){return n.hasBeenDragged},get isDragging(){return n.isDragging},onPointerDown:function(t,i){if(0===t.button){if(!n.hasBeenDragged){const t=i.getBoundingClientRect();e.x=t.left,e.y=t.top}n.isDragging=!0,n.startX=t.clientX,n.startY=t.clientY,n.initialX=e.x,n.initialY=e.y,i.setPointerCapture(t.pointerId)}},onPointerMove:function(t,i,r){if(!n.isDragging)return;const o=t.clientX-n.startX,s=t.clientY-n.startY,l=Ki(n.initialX+o,n.initialY+s,r.width,r.height);e.x=l.x,e.y=l.y,n.hasBeenDragged=!0},onPointerUp:function(t,e){n.isDragging&&(n.isDragging=!1,e.releasePointerCapture(t.pointerId))},setPosition:function(t){e.x=t.x,e.y=t.y},setHasBeenDragged:function(t){n.hasBeenDragged=t},reset:function(){e.x=t.x,e.y=t.y,n.hasBeenDragged=!1}}}({x:0,y:0});let E=me(!1);const W=function(t,n,i){let r=me(!1),o=me(""),s=me(ke({width:0,height:0})),l=me(!1),a=me(!1),d={x:0,y:0,width:0,height:0,posX:0,posY:0},u=null;function c(e,a){e.preventDefault(),e.stopPropagation();const c=t();if(!c)return;const p=c.getBoundingClientRect();O.hasBeenDragged||(i({x:p.left,y:p.top}),O.setHasBeenDragged(!0)),Dn(l)||(ye(s,{width:p.width,height:p.height},!0),ye(l,!0));const v=n();ye(r,!0),ye(o,a,!0),u=e.pointerId,d={x:e.clientX,y:e.clientY,width:Dn(s).width,height:Dn(s).height,posX:v.x,posY:v.y,centerX:v.x+Dn(s).width/2,centerY:v.y+Dn(s).height/2},window.addEventListener("pointermove",f),window.addEventListener("pointerup",h),window.addEventListener("pointercancel",h)}function f(t){if(t.pointerId!==u)return;const e=t.clientX-d.x,n=t.clientY-d.y,r=window.innerWidth,l=window.innerHeight;let a=d.width,c=d.height,f=d.posX,h=d.posY;if(Dn(o).includes("e")){const t=r-f;a=Math.max(280,Math.min(d.width+e,t))}if(Dn(o).includes("w")){const t=d.width-280,n=Math.min(e,t);a=d.width-n,f=d.posX+n}if(Dn(o).includes("s")){const t=l-h;c=Math.max(200,Math.min(d.height+n,t))}if(Dn(o).includes("n")){const t=d.height-200,e=Math.min(n,t);c=d.height-e,h=d.posY+e}const p=Gi(f,h,a,c);ye(s,{width:p.width,height:p.height},!0),i({x:p.x,y:p.y})}function h(t){t.pointerId===u&&(ye(r,!1),u=null,window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),ye(a,!0),((t,n)=>{const i=Tr(e.id);if(null==i?void 0:i.parentId){const t=Tr(i.parentId),r=document.querySelector(`[data-modal-id="${Ji(i.parentId)}"]`);if(t&&r){const i=t.position??{x:r.getBoundingClientRect().left,y:r.getBoundingClientRect().top},o=t.size??{width:r.offsetWidth,height:r.offsetHeight},s={x:i.x+(o.width-n.width)/2,y:i.y+(o.height-n.height)/2};ye(E,!0),O.setPosition(s);const l={x:s.x-i.x,y:s.y-i.y};return Ir(e.id,{position:s,size:n,hasBeenDragged:!0,offsetFromParent:l}),void setTimeout(()=>{ye(E,!1)},200)}}Ir(e.id,{position:t,size:n,hasBeenDragged:!0})})(n(),Dn(s)),setTimeout(()=>{ye(a,!1)},0))}const p={startResize:c};return{get isResizing(){return Dn(r)},get resizeDirection(){return Dn(o)},get size(){return Dn(s)},get hasBeenResized(){return Dn(l)},get isActive(){return Dn(r)},get justFinishedResizing(){return Dn(a)},start:c,setHasBeenResized:()=>{},setSize:function(t){ye(s,t,!0),ye(l,!0)},reset:function(){ye(l,!1),ye(s,{width:0,height:0},!0)},constrainToViewport:function(){const e=n(),r=t();if(!r)return;const o=Gi(e.x,e.y,Dn(s).width||r.offsetWidth,Dn(s).height||r.offsetHeight);ye(s,{width:o.width,height:o.height},!0),i({x:o.x,y:o.y})},handlers:p}}(()=>Dn(m),()=>O.position,t=>O.setPosition(t)),T=function(t,n,i,r,o,s,l,a,d){let u=me(!1),c=me(!1),f=me(!1),h=me(!1),p=me(null),v=me(null),g=null,m=null;function w(){m&&(clearTimeout(m),m=null)}function y(){const t=e.id,n=document.querySelector(`.modal-dock-item[data-modal-id="${Ji(t)}"]`),i=document.querySelector('[data-dock-container="true"]'),r=n||i;if(r){const t=r.getBoundingClientRect();return{x:t.left+t.width/2,y:t.top+t.height/2}}return{x:window.innerWidth/2,y:window.innerHeight-40}}return He(()=>()=>{w(),ye(u,!1),ye(c,!1),ye(f,!1),ye(h,!1),ye(p,null),ye(v,null),g=null}),{get isMinimizing(){return Dn(u)},get isRestoring(){return Dn(c)},get isOpening(){return Dn(f)},get isClosing(){return Dn(h)},get animationTransform(){return Dn(p)},get pendingOpenSource(){return Dn(v)},startMinimize:function(t,e){const h=n();if(Dn(u)||!h)return;if(ye(c,!1),ye(f,!1),w(),!Vr()){const t=h.getBoundingClientRect();let n=o()?i():{x:t.left,y:t.top},u=l()?a():{width:t.width,height:t.height};return o()||(r(n),s(!0)),void(e?e():d(n,!0,u))}const v=h.getBoundingClientRect(),g=v.left+v.width/2,x=v.top+v.height/2;let b=o()?i():{x:v.left,y:v.top},M=l()?a():{width:v.width,height:v.height};o()||(r(b),s(!0));const z=t??y(),k=z.x-v.left,I=z.y-v.top,_={x:z.x-g,y:z.y-x,originX:k,originY:I};ye(p,_,!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{ye(u,!0)})}),m=setTimeout(()=>{e?e():d(b,!0,M)},500)},startRestore:function(t,e){if(!Vr()){const e=t||{x:window.innerWidth/2,y:window.innerHeight/2};return r(e),void s(!0)}const n=y(),i=t||{x:window.innerWidth/2,y:window.innerHeight/2},o=e||{width:480,height:400};r(i),s(!0);const l=i.x+o.width/2,a=i.y+o.height/2,d=n.x-i.x,u=n.y-i.y;ye(p,{x:n.x-l,y:n.y-a,originX:d,originY:u},!0),ye(c,!0),setTimeout(()=>{ye(c,!1),ye(p,null)},400)},startClose:function(t){Dn(h)||Dn(u)||(Vr()?(g=t,ye(h,!0),setTimeout(()=>{ye(h,!1),g&&(g(),g=null)},250)):t())},setPendingOpenSource:function(t){ye(v,t,!0)},tryStartOpenAnimation:function(){const t=n();if(!Dn(v)||!t||Dn(f))return!1;if(!Vr())return ye(v,null),!1;const e=Dn(v);ye(v,null);const l=t.getBoundingClientRect(),a=o()?i():{x:l.left,y:l.top},d=l.width,u=l.height,c=a.x+d/2,h=a.y+u/2;o()||(r(a),s(!0));const g=e.x-a.x,m=e.y-a.y;return ye(p,{x:e.x-c,y:e.y-h,originX:g,originY:m},!0),ye(f,!0),setTimeout(()=>{ye(f,!1),ye(p,null)},400),!0},forceClearMinimize:function(){w(),ye(u,!1),ye(p,null)}}}(0,()=>Dn(m),()=>O.position,t=>O.setPosition(t),()=>O.hasBeenDragged,t=>O.setHasBeenDragged(t),()=>W.hasBeenResized,()=>W.size,(t,n,i)=>{Ir(e.id,{position:t,size:i,hasBeenDragged:n}),br(e.id)}),{trapFocus:B,focusFirstElement:R}={trapFocus:Jr,focusFirstElement:Zr},A=ae(()=>T.isMinimizing||T.isRestoring||T.isOpening||T.isClosing),L=ae(()=>(Fr(e.id)||$r(e.id))&&!T.isRestoring);let H=me(!1);const $=ae(()=>T.isRestoring||T.isOpening||Dn(H)),F=ae(()=>Dn(k)&&!O.hasBeenDragged&&!Dn(A)&&!T.pendingOpenSource&&!Dn(L)),q=ae(()=>{const t=[];return t.push(`z-index: ${Dn(S)};`),T.animationTransform?(t.push(`left: ${O.position.x}px; top: ${O.position.y}px;`),t.push(`--genie-origin-x: ${T.animationTransform.originX}px;`),t.push(`--genie-origin-y: ${T.animationTransform.originY}px;`),t.push(`--genie-translate-x: ${T.animationTransform.x}px;`),t.push(`--genie-translate-y: ${T.animationTransform.y}px;`)):O.hasBeenDragged&&t.push(`left: ${O.position.x}px; top: ${O.position.y}px; transform: none;`),W.hasBeenResized?t.push(`width: ${W.size.width}px; height: ${W.size.height}px; max-width: none; max-height: none;`):(e.preferredHeight&&t.push(`min-height: ${e.preferredHeight};`),n()&&t.push(`max-width: ${n()};`)),Dn(D)&&e.glow&&(t.push(`--modal-glow-color: ${e.glow.color};`),t.push(`--modal-glow-intensity: ${e.glow.intensity};`)),t.join(" ")});function j(){Dn(f)&&br(e.id)}function X(){var t;Lr(e.id)&&Hr(e.id),Cr(e.id),null==(t=e.onClose)||t.call(e)}function Y(){Nr(e.id)}function N(t){Dn(c)&&Dn(m)&&O.onPointerDown(t,Dn(m))}function K(t){r()&&"Escape"===t.key&&function(t){const e=Zi.get(t);if(!e)return!1;const n=Math.max(...Array.from(Zi.values()).map(t=>t.zIndex),0);return e.zIndex===n&&!e.isMinimized&&!e.isHiddenWithParent}(e.id)&&(t.stopPropagation(),X())}function G(t){if(!Dn(m))return;const n=O.isDragging,i=W.hasBeenResized?W.size:{width:Dn(m).offsetWidth,height:Dn(m).offsetHeight};O.onPointerMove(t,Dn(m),i),O.isDragging&&n&&kr(e.id,O.position,{drag:!0})}function V(t){if(!Dn(m))return;const n=O.isDragging;O.onPointerUp(t,Dn(m)),n&&!W.justFinishedResizing&&(kr(e.id,O.position,{drag:!0}),function(t){const e=Li();if("animated"!==e.parentChild.movementMode)return;const n=e.parentChild.animationDuration,i=[];let r=t;for(;;){const t=Zi.get(r);if(!(null==t?void 0:t.parentId))break;i.push({parentId:t.parentId,childId:r}),r=t.parentId}i.forEach(({parentId:t,childId:e},i)=>{setTimeout(()=>{const i=Zi.get(e),r=Zi.get(t);if(!(null==i?void 0:i.position)||!i.offsetFromParent||!r)return;const o={x:i.position.x-i.offsetFromParent.x,y:i.position.y-i.offsetFromParent.y};vr.set(t,o),function(t){const e=vr.get(t);if(!e)return;const n=Zi.get(t);n&&(Zi.set(t,{...n,isAnimatingPosition:!0,position:e}),vr.delete(t),nr())}(t),setTimeout(()=>function(t){const e=Zi.get(t);e&&(Zi.set(t,{...e,isAnimatingPosition:!1}),nr())}(t),n)},i*n)})}(e.id))}function U(){var t;const n=Li();if("smart"!==(null==(t=n.positioning)?void 0:t.strategy))return!1;const i=Tr(e.id),r=Dn(pr);if((null==i?void 0:i.parentId)||r&&r.childId===e.id)return!1;if((null==i?void 0:i.hasBeenDragged)||(null==i?void 0:i.position))return!1;const o=Dn(m)||document.querySelector(`[data-modal-id="${Dn(d)}"]`);if(!o)return!1;const s=o.offsetWidth,l=o.offsetHeight;if(s<=0||l<=0)return!1;const a=n.positioning.modalGap??16,u=function(t){const e=[];for(const[n,i]of Zi.entries())if(n!==t&&i.isOpen&&!i.isMinimized&&!i.isHiddenWithParent)if(i.position&&i.size)e.push({x:i.position.x,y:i.position.y,width:i.size.width,height:i.size.height});else{const t=document.querySelector(`[data-modal-id="${Ji(n)}"]`);if(t){const n=t.getBoundingClientRect();e.push({x:n.left,y:n.top,width:n.width,height:n.height})}}return e}(e.id),c=function(t){if("undefined"==typeof document)return[];const e=[];for(const n of t)try{const t=document.querySelectorAll(n);for(const n of t){const t=n.getBoundingClientRect();t.width>0&&t.height>0&&e.push({x:t.left,y:t.top,width:t.width,height:t.height})}}catch{}return e}(n.positioning.avoidElements??[]),f=function(t,e,n,i={}){const{modalGap:r=16,gridResolution:o=10,avoidBounds:s=[],avoidMargin:l=16}=i,a=i.margin??r,d="undefined"!=typeof window?window.innerWidth:1920,u="undefined"!=typeof window?window.innerHeight:1080,c=s.map(t=>({x:t.x-l,y:t.y-l,width:t.width+2*l,height:t.height+2*l})),f={x:(d-t)/2,y:(u-e)/2};if(0===n.length&&0===c.length)return f;const h=a,p=Math.max(a,d-t-a),v=a,g=Math.max(a,u-e-a);if(p<=h||g<=v)return f;const m=Ui(f.x,f.y,t,e,n,r),w=Ui(f.x,f.y,t,e,c,0);if(0===m&&0===w)return f;const y=[],x=(p-h)/o,b=(g-v)/o;for(let i=0;i<=o;i++)for(let s=0;s<=o;s++){const o=h+i*x,l=v+s*b,f=Ui(o,l,t,e,n,r),p=Ui(o,l,t,e,c,0),g=Qi(o,l,t,e,d,u,a);y.push({pos:{x:o,y:l},modalOverlap:f,avoidOverlap:p,centerDist:g})}const M=y.filter(t=>0===t.avoidOverlap),z=M.length>0?M:y,k=t*e,I=Math.min(...z.map(t=>t.modalOverlap))/k;return z.sort((t,e)=>{if(0===M.length&&t.avoidOverlap!==e.avoidOverlap)return t.avoidOverlap-e.avoidOverlap;const n=t.modalOverlap/k,i=e.modalOverlap/k;if(I<.3){const r=.3,o=n<=r,s=i<=r;if(o&&s)return t.centerDist+.3*n-(e.centerDist+.3*i);if(o)return-1;if(s)return 1}return.6*n+.4*t.centerDist-(.6*i+.4*e.centerDist)}),z[0].pos}(s,l,u,{modalGap:a,avoidBounds:c});if(Ui(f.x,f.y,s,l,u,a)/(s*l)>.1&&u.length>0){const t=function(t){const e=[];for(const[n,i]of Zi.entries())if(n!==t&&i.isOpen&&!i.isMinimized&&!i.isHiddenWithParent&&!i.parentId)if(i.position&&i.size)e.push({id:Ji(n),x:i.position.x,y:i.position.y,width:i.size.width,height:i.size.height});else{const t=document.querySelector(`[data-modal-id="${Ji(n)}"]`);if(t){const i=t.getBoundingClientRect();e.push({id:Ji(n),x:i.left,y:i.top,width:i.width,height:i.height})}}return e}(e.id),n=function(t,e,n,i={}){const{modalGap:r=16}=i,o=i.margin??r,s="undefined"!=typeof window?window.innerWidth:1920,l="undefined"!=typeof window?window.innerHeight:1080,a=n.reduce((t,e)=>t+e.width,0)+t,d=n.length*r,u=s-2*o;if(a+d>u)return null;const c=u-a-d;n.length;const f=c/2,h=s/2,p=[...n.map(t=>({id:t.id,width:t.width,height:t.height,currentX:t.x+t.width/2,currentY:t.y,isNew:!1})),{id:"__new__",width:t,height:e,currentX:h,currentY:(l-e)/2,isNew:!0}];p.sort((t,e)=>t.currentX-e.currentX);let v=o+f;const g=new Map;let m=null;for(const t of p){const e=v;if(t.isNew)m={x:Math.round(e),y:Math.round(t.currentY)};else{const i=n.find(e=>e.id===t.id);Math.abs(e-i.x)>5&&g.set(t.id,{x:Math.round(e),y:Math.round(i.y)})}v+=t.width+r}return m?{newModalPosition:m,existingModalMoves:g}:null}(s,l,t,{modalGap:a});if(n&&n.existingModalMoves.size>0)return function(t){const e=Li().parentChild.animationDuration;for(const[e,n]of t){const t=Zi.get(e);t&&Zi.set(e,{...t,position:n,isAnimatingPosition:!0,hasBeenDragged:!0})}nr(),setTimeout(()=>{for(const e of t.keys()){const t=Zi.get(e);t&&Zi.set(e,{...t,isAnimatingPosition:!1})}nr()},e)}(n.existingModalMoves),O.setPosition(n.newModalPosition),O.setHasBeenDragged(!0),kr(e.id,n.newModalPosition,{size:{width:s,height:l}}),!0}return O.setPosition(f),O.setHasBeenDragged(!0),kr(e.id,f,{size:{width:s,height:l}}),!0}function Q(){Pn().then(()=>Pn()).then(()=>{let t=0;const e=()=>{t+=1,U()||t>5||requestAnimationFrame(e)};Dn(m)?e():requestAnimationFrame(e)})}Si(()=>{var t;function n(){const t=Tr(e.id);if(!(null==t?void 0:t.position)||!Dn(m))return;if(t.parentId)return;const n=W.hasBeenResized?W.size.width:Dn(m).offsetWidth,i=W.hasBeenResized?W.size.height:Dn(m).offsetHeight;if(n<=0||i<=0)return;const r=Ki(t.position.x,t.position.y,n,i);(Math.abs(r.x-t.position.x)>1||Math.abs(r.y-t.position.y)>1)&&(O.setPosition(r),kr(e.id,r))}return o()||(t=i(),yr({id:e.id,title:e.title,icon:e.icon??"",isOpen:t,isMinimized:!1,isHiddenWithParent:!1,isTransparent:!1,isRejected:!1,position:null,size:null,hasBeenDragged:!1,dockPosition:0,glow:e.glow??null,parentId:void 0,childId:void 0,offsetFromParent:void 0}),t&&Pr(e.id)),i()&&(Pn().then(()=>{Dn(m)&&R(Dn(m))}),Q()),window.addEventListener("pointermove",G),window.addEventListener("pointerup",V),window.addEventListener("resize",n),()=>{window.removeEventListener("pointermove",G),window.removeEventListener("pointerup",V),window.removeEventListener("resize",n)}}),Oi(()=>{Kr(e.id),o()||xr(e.id)}),He(()=>{Br();const t=Tr(e.id);if(t){if(ye(w,t.isTransparent,!0),!O.isDragging&&!W.isResizing&&t.position){const e=O.position,n=t.position;(Math.abs(e.x-n.x)>.5||Math.abs(e.y-n.y)>.5)&&(O.setPosition(n),t.hasBeenDragged&&O.setHasBeenDragged(!0))}Pn().then(()=>function(){var t,n,i;if(!Tr(e.id))return;if(Lr(e.id))return Hr(e.id),void(null==(t=e.onClose)||t.call(e));if(Wr(e.id)&&!Dn(b)){if(ye(b,!0),Dn(fr),ye(fr,null),Dn(m)){const t=Dn(m).getBoundingClientRect(),n=O.hasBeenDragged?O.position:{x:t.left,y:t.top},i=W.hasBeenResized?W.size:{width:t.width,height:t.height};Ir(e.id,{position:n,size:i,hasBeenDragged:!0})}T.startMinimize(void 0,()=>{var t;t=e.id,Dn(rr).includes(t)&&ye(rr,Dn(rr).filter(e=>e!==t),!0),ye(b,!1)})}if($r(e.id)){i=e.id,Dn(ar).includes(i)&&ye(ar,Dn(ar).filter(t=>t!==i),!0);const t=Tr(e.id);T.startRestore((null==t?void 0:t.position)??void 0,(null==t?void 0:t.size)??void 0),Pn().then(()=>{Dn(m)&&R(Dn(m))})}if(Fr(e.id)){!function(t){Dn(dr).includes(t)&&ye(dr,Dn(dr).filter(e=>e!==t),!0)}(e.id);const t=Tr(e.id);T.startRestore((null==t?void 0:t.position)??void 0,(null==t?void 0:t.size)??void 0)}Ar(e.id)&&(function(t){Dn(sr).includes(t)&&ye(sr,Dn(sr).filter(e=>e!==t),!0)}(e.id),T.startClose(()=>{var t;Kr(e.id),function(t){const e=Zi.get(t);if(e){if(e.parentId){const n=Zi.get(e.parentId);n&&n.childId===t&&Zi.set(e.parentId,{...n,childId:void 0,lastChildId:t})}Zi.set(t,{...e,isOpen:!1,isMinimized:!1,isHiddenWithParent:!1,isTransparent:!1,position:null,size:null,hasBeenDragged:!1,parentId:void 0,childId:void 0,offsetFromParent:void 0}),nr()}}(e.id),null==(t=e.onClose)||t.call(e)}));const r=function(t){if(!Dn(pr)||Dn(pr).childId!==t)return null;const e=Dn(pr);return ye(pr,null),e}(e.id),o=!!r||!!(null==(n=Tr(e.id))?void 0:n.parentId);if(Rr(e.id)){!function(t){Dn(or).includes(t)&&ye(or,Dn(or).filter(e=>e!==t),!0)}(e.id);const t=function(t){const e=hr.get(t);return e&&hr.delete(t),e??null}(e.id)||e.openSourcePosition||null;t?(T.setPendingOpenSource(t),Pn().then(()=>Pn()).then(()=>{o||U(),T.tryStartOpenAnimation()})):o||Q(),Pn().then(()=>{Dn(m)&&R(Dn(m))})}var s;(function(t){return Dn(ur).includes(t)})(e.id)&&(function(t){Dn(ur).includes(t)&&ye(ur,Dn(ur).filter(e=>e!==t),!0)}(e.id),function(t){Dn(cr).includes(t)||ye(cr,[...Dn(cr),t],!0)}(e.id),ye(M,!0),setTimeout(()=>{ye(M,!1),function(t){ye(cr,Dn(cr).filter(e=>e!==t),!0)}(e.id)},600)),r&&Dn(m)&&(s=r.parentId,Pn().then(()=>Pn()).then(()=>{let t=0;const n=()=>{t+=1;const i=function(t){var n,i;const r=Tr(t);if(!r)return!1;const o=Dn(m)||document.querySelector(`[data-modal-id="${Dn(d)}"]`),s=document.querySelector(`[data-modal-id="${Ji(t)}"]`),l=null==s?void 0:s.getBoundingClientRect(),a=r.position??(l?{x:l.left,y:l.top}:null);if(!a||!o)return!1;const u=(null==(n=r.size)?void 0:n.width)??(null==s?void 0:s.offsetWidth)??(null==l?void 0:l.width)??480,c=(null==(i=r.size)?void 0:i.height)??(null==s?void 0:s.offsetHeight)??(null==l?void 0:l.height)??400,f=o.offsetWidth,h=o.offsetHeight;if(u<=0||c<=0||f<=0||h<=0)return!1;const p={x:a.x+(u-f)/2,y:a.y+(c-h)/2};return O.setPosition(p),O.setHasBeenDragged(!0),kr(e.id,p,{size:{width:f,height:h}}),r.position&&r.size||!l||kr(t,{x:l.left,y:l.top},{size:{width:u,height:c}}),function(t,e){if(!Li().features.parentChild)return;const n=Zi.get(t),i=Zi.get(e);if(!n||!i)return;let r={x:40,y:40};n.position&&i.position&&(r={x:i.position.x-n.position.x,y:i.position.y-n.position.y});const o=Math.max(i.zIndex,n.zIndex+1);Zi.set(t,{...n,childId:e,lastChildId:e}),Zi.set(e,{...i,parentId:t,offsetFromParent:r,zIndex:o}),nr()}(t,e.id),!0}(s);i||t>5||requestAnimationFrame(n)};Dn(m)?n():requestAnimationFrame(n)}))}())}}),He(()=>{const t=Tr(e.id);t&&t.isTransparent!==Dn(w)&&ye(w,t.isTransparent,!0)}),He(()=>{if(Dn(k)&&Dn(m)){const t=t=>function(t){Dn(m)&&B(t,Dn(m))}(t);return Dn(m).addEventListener("keydown",t),()=>{var e;return null==(e=Dn(m))?void 0:e.removeEventListener("keydown",t)}}}),He(()=>{!Dn(k)&&T.isMinimizing&&T.forceClearMinimize()}),He(()=>{T.isRestoring||T.isOpening?ye(H,!0):Dn(H)&&requestAnimationFrame(()=>{ye(H,!1)})}),He(()=>{Dn(x)&&!Dn(I)&&(ye(y,!0),setTimeout(()=>{ye(y,!1)},200)),ye(x,Dn(I),!0)});var J=Xn(),Z=We(J),tt=t=>{no(t,{get target(){return a},children:(t,n)=>{var i=ko();let r;i.__keydown=K;var o=Ee(i);{let t=ae(()=>Dn(c)?N:void 0);!function(t,e){Tt(e,!0);let n=Ci(e,"isTransparent",0,!1),i=Ci(e,"headerLayout",0,"macos"),r=Ci(e,"minimizable",0,!0),o=Ci(e,"minimizeDisabled",0,!1),s=Ci(e,"transparencyEnabled",0,!0);const l=Wt(Ei),a=ae(()=>null==l?void 0:l()),d=ae(()=>"macos"===i());var u=wo();let c;u.__pointerdown=function(t){var n;t.target.closest("button")||null==(n=e.onStartDrag)||n.call(e,t)};var f=Ee(u),h=t=>{var n=uo(),i=We(n),l=Ee(i);l.__click=function(...t){var n;null==(n=e.onClose)||n.apply(this,t)};var d=Te(l,2),u=t=>{var n=io();let i;n.__click=function(...t){var n;null==(n=o()?void 0:e.onMinimize)||n.apply(this,t)},je(()=>{i=xi(n,0,"modal-header-light modal-header-light-minimize",null,i,{"modal-header-light-disabled":o()}),n.disabled=o(),Ii(n,"title",o()?"Enable dock to minimize":void 0)}),Yn(t,n)};Zn(d,t=>{r()&&t(u)});var c=Te(d,2),f=t=>{var n=ro();n.__click=function(...t){var n;null==(n=e.onToggleStyle)||n.apply(this,t)},Yn(t,n)};Zn(c,t=>{s()&&t(f)});var h=Ee(Te(i,2)),p=t=>{var n=oo();li(Ee(n),()=>e.customIcon),Yn(t,n)},v=t=>{var n=Xn(),i=We(n),r=t=>{var n=so();li(Ee(n),()=>Dn(a),()=>e.icon),Yn(t,n)};Zn(i,t=>{e.icon&&Dn(a)&&t(r)},!0),Yn(t,n)};Zn(h,t=>{e.customIcon?t(p):t(v,!1)});var g=Ee(Te(h,2)),m=t=>{var n=lo(),i=Ee(n);je(()=>{Ii(n,"id",e.titleId),Kn(i,e.title)}),Yn(t,n)},w=t=>{var n=ao(),i=Ee(n);je(()=>Kn(i,e.title)),Yn(t,n)};Zn(g,t=>{e.titleId?t(m):t(w,!1)}),Yn(t,n)},p=t=>{var n=mo(),i=We(n),l=Ee(i),d=t=>{var n=co();li(Ee(n),()=>e.customIcon),Yn(t,n)},u=t=>{var n=Xn(),i=We(n),r=t=>{var n=fo();li(Ee(n),()=>Dn(a),()=>e.icon),Yn(t,n)};Zn(i,t=>{e.icon&&Dn(a)&&t(r)},!0),Yn(t,n)};Zn(l,t=>{e.customIcon?t(d):t(u,!1)});var c=Te(l,2),f=t=>{var n=ho(),i=Ee(n);je(()=>{Ii(n,"id",e.titleId),Kn(i,e.title)}),Yn(t,n)},h=t=>{var n=po(),i=Ee(n);je(()=>Kn(i,e.title)),Yn(t,n)};Zn(c,t=>{e.titleId?t(f):t(h,!1)});var p=Ee(Te(i,2)),v=t=>{var n=vo();n.__click=function(...t){var n;null==(n=e.onToggleStyle)||n.apply(this,t)},Yn(t,n)};Zn(p,t=>{s()&&t(v)});var g=Te(p,2),m=t=>{var n=go();let i;n.__click=function(...t){var n;null==(n=o()?void 0:e.onMinimize)||n.apply(this,t)},je(()=>{i=xi(n,0,"modal-header-btn-windows",null,i,{"modal-header-btn-windows-disabled":o()}),n.disabled=o(),Ii(n,"title",o()?"Enable dock to minimize":void 0)}),Yn(t,n)};Zn(g,t=>{r()&&t(m)}),Te(g,2).__click=function(...t){var n;null==(n=e.onClose)||n.apply(this,t)},Yn(t,n)};Zn(f,t=>{Dn(d)?t(h):t(p,!1)}),je(()=>c=xi(u,0,"modal-header",null,c,{"modal-header-draggable":!!e.onStartDrag,transparent:n()})),Yn(t,u),Bt()}(o,{get title(){return e.title},get customIcon(){return e.customIcon},get icon(){return e.icon},get isTransparent(){return Dn(w)},get titleId(){return Dn(C)},get headerLayout(){return Dn(g)},get onStartDrag(){return Dn(t)},onToggleStyle:Y,onMinimize:j,onClose:X,get minimizable(){return Dn(f)},get minimizeDisabled(){return Dn(h)},get transparencyEnabled(){return Dn(p)}})}var s=Te(o,2);li(Ee(s),()=>e.children??st),gi(s,(t,e)=>null==bo?void 0:bo(t,e),()=>e.bodyElement);var l=Te(s,2),a=t=>{var n=Mo(),i=Ee(n),r=t=>{var n=Xn();li(We(n),()=>e.footer),Yn(t,n)};Zn(i,t=>{e.footer&&t(r)}),gi(n,(t,e)=>null==bo?void 0:bo(t,e),()=>e.footerElement),Yn(t,n)};Zn(l,t=>{(e.footer||e.footerElement)&&t(a)});var u=Te(l,2);{let t=ae(()=>Dn(v)&&!Dn(I)?W.handlers.startResize:void 0);!function(t,e){Tt(e,!0);const n=["n","s","e","w","ne","nw","se","sw"];var i=Xn(),r=We(i),o=t=>{var i=xo();ii(i,21,()=>n,ti,(t,n)=>{var i=yo();i.__pointerdown=t=>function(t,n){var i;null==(i=e.onStartResize)||i.call(e,t,n)}(t,Dn(n)),je(()=>xi(i,0,`modal-resize-handle modal-resize-${Dn(n)??""}`)),Yn(t,i)}),Yn(t,i)};Zn(r,t=>{e.onStartResize&&t(o)}),Yn(t,i),Bt()}(u,{get onStartResize(){return Dn(t)}})}var x,b,k,S=Te(u,2),B=t=>{var e=zo();let n;je(()=>n=xi(e,0,"modal-child-overlay",null,n,{"modal-overlay-closing":Dn(y)})),Yn(t,e)};Zn(S,t=>{Dn(P)&&t(B)}),Di(i,t=>ye(m,t),()=>Dn(m)),je(()=>{var t;r=xi(i,0,"modal-dialog",null,r,{"modal-dragging":O.isDragging,"modal-resizing":W.isResizing,"modal-positioned":O.hasBeenDragged,"modal-minimizing":T.isMinimizing,"modal-restoring":T.isRestoring,"modal-opening":T.isOpening,"modal-closing":T.isClosing,"modal-centered":Dn(F),"modal-solid":!Dn(w),"modal-transparent":Dn(w),"modal-glow":Dn(D),"modal-has-child":Dn(I),"modal-is-child":Dn(_),"modal-visible-by-animation":Dn($),"modal-animating-to-center":Dn(E),"modal-animating-position":null==(t=Dn(z))?void 0:t.isAnimatingPosition,"modal-attention":Dn(M)}),Ii(i,"data-modal-id",Dn(d)),Mi(i,Dn(q)),Ii(i,"aria-labelledby",Dn(C))}),k=function(t,e,n,i={}){function r(t){if(i.capture||Fn.call(e,t),!t.cancelBubble)return Be(()=>null==n?void 0:n.call(this,t))}return t.startsWith("pointer")||t.startsWith("touch")||"wheel"===t?Ht(()=>{e.addEventListener(t,r,i)}):e.addEventListener(t,r,i),r}("pointerdown",x=i,()=>Pr(e.id),b={capture:!0,passive:void 0}),(x===document.body||x===window||x===document||x instanceof HTMLMediaElement)&&Le(()=>{x.removeEventListener("pointerdown",k,b)}),Yn(t,i)},$$slots:{default:!0}})};Zn(Z,t=>{Dn(k)&&t(tt)}),Yn(t,J),Bt()}Hn(["keydown"]);const _o=t=>t;function Po(t){const e=t-1;return e*e*e+1}function Do(t){const e="string"==typeof t&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}function Co(t,{delay:e=0,duration:n=400,easing:i=_o}={}){const r=+getComputedStyle(t).opacity;return{delay:e,duration:n,easing:i,css:t=>"opacity: "+t*r}}function So(t,{delay:e=0,duration:n=400,easing:i=Po,x:r=0,y:o=0,opacity:s=0}={}){const l=getComputedStyle(t),a=+l.opacity,d="none"===l.transform?"":l.transform,u=a*(1-s),[c,f]=Do(r),[h,p]=Do(o);return{delay:e,duration:n,easing:i,css:(t,e)=>`\n\t\t\ttransform: ${d} translate(${(1-t)*c}${f}, ${(1-t)*h}${p});\n\t\t\topacity: ${a-u*e}`}}function Oo(t,{delay:e=0,duration:n=400,easing:i=Po,start:r=0,opacity:o=0}={}){const s=getComputedStyle(t),l=+s.opacity,a="none"===s.transform?"":s.transform,d=1-r,u=l*(1-o);return{delay:e,duration:n,easing:i,css:(t,e)=>`\n\t\t\ttransform: ${a} scale(${1-d*e});\n\t\t\topacity: ${l-u*e}\n\t\t`}}function Eo(t){const e=1.70158;return--t*t*((e+1)*t+e)+1}function Wo(t){const e=t-1;return e*e*e+1}var To=jn('<button type="button" aria-label="Drag dock"></button>'),Bo=jn('<span class="modal-dock-item-icon-placeholder"> </span>'),Ro=jn('<span class="modal-dock-item-label"> </span>'),Ao=jn("<span>+</span>"),Lo=jn('<span class="modal-dock-child-indicator"><!></span>'),Ho=jn('<button><span class="modal-dock-item-icon"><!></span> <!> <span class="modal-dock-item-glow"></span> <!></button>'),$o=jn('<div data-dock-container="true"><div><!> <!></div></div>');function Fo(t,e){Tt(e,!0);const n=Wt(Ei),i=ae(()=>e.renderIcon??(null==n?void 0:n())),r=Yr(),o=ae(()=>(Ai(),Li())),s=ae(()=>Xi("DOCK")),l=ae(()=>Dn(o).dock.position),a=ae(()=>Dn(o).dock.labelMode);let d=me("horizontal"),u=me(ke({x:100,y:100})),c=me(null),f=me(!1),h={x:0,y:0},p=null;const v=ae(()=>(Br(),Array.from(r.modals.values()).filter(t=>t.isMinimized).sort((t,e)=>t.dockPosition-e.dockPosition))),g=ae(()=>{switch(Dn(l)){case"left":return{x:-20,duration:250,easing:Wo};case"right":return{x:20,duration:250,easing:Wo};default:return{y:20,duration:250,easing:Wo}}});function m(t){var e;"free"===Dn(l)&&(ye(f,!0),p=t.pointerId,h={x:t.clientX-Dn(u).x,y:t.clientY-Dn(u).y},null==(e=t.currentTarget)||e.setPointerCapture(t.pointerId),window.addEventListener("pointermove",w),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y))}function w(t){if(t.pointerId!==p||!Dn(c))return;const e=Dn(c).getBoundingClientRect(),n=window.innerWidth-e.width-8,i=window.innerHeight-e.height-8,r=Math.min(Math.max(t.clientX-h.x,8),Math.max(8,n)),o=Math.min(Math.max(t.clientY-h.y,8),Math.max(8,i));ye(u,{x:Math.round(r),y:Math.round(o)},!0)}function y(t){t.pointerId===p&&(ye(f,!1),p=null,window.removeEventListener("pointermove",w),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y))}const{addListener:x}=function(){function t(t,e,n){return"undefined"==typeof window?()=>{}:(window.addEventListener(t,e,n),()=>{window.removeEventListener(t,e,n)})}return{addListener:t,addListenerEffect:function(e,n,i){He(()=>{if("undefined"!=typeof window)return t(e,n,i)})}}}();function b(){if("free"!==Dn(l)||!Dn(c))return;const t=Dn(c).getBoundingClientRect(),e=Ki(Dn(u).x,Dn(u).y,t.width,t.height);e.x===Dn(u).x&&e.y===Dn(u).y||ye(u,{x:Math.round(e.x),y:Math.round(e.y)},!0)}He(()=>{"undefined"!=typeof window&&x("resize",b)});var M={setDockOrientation:function(t){ye(d,t,!0)},setDockFreePosition:function(t){ye(u,t,!0)},getDockState:function(){return{dockPosition:Dn(l),dockOrientation:Dn(d),dockFreePosition:Dn(u),dockLabelMode:Dn(a)}}};return no(t,{get target(){return Dn(o).portalTarget},children:(t,e)=>{var n=$o();let o,h;var p=Ee(n);let w;var y=Ee(p),x=t=>{var e=To();let n;e.__pointerdown=m,je(()=>n=xi(e,0,"modal-dock-handle",null,n,{"modal-dock-handle-dragging":Dn(f)})),Yn(t,e)};Zn(y,t=>{"free"===Dn(l)&&t(x)}),ii(Te(y,2),19,()=>Dn(v),t=>t.id,(t,e,n)=>{const o=ae(()=>Dn(e).lastChildId?r.modals.get(Dn(e).lastChildId):null);var s=Ho();let l;s.__click=t=>{var n;n=Dn(e).id,gr.has(n)?t.currentTarget.animate([{transform:"translateX(0)"},{transform:"translateX(-6px)"},{transform:"translateX(6px)"},{transform:"translateX(-6px)"},{transform:"translateX(6px)"},{transform:"translateX(0)"}],{duration:300,easing:"ease-in-out"}):Mr(Dn(e).id)};var d=Ee(s),u=Ee(d),c=t=>{var n=Xn();li(We(n),()=>Dn(i),()=>Dn(e).icon),Yn(t,n)},f=t=>{var n=Bo(),i=Ee(n);je(t=>Kn(i,t),[()=>Dn(e).title.charAt(0)]),Yn(t,n)};Zn(u,t=>{Dn(e).icon&&Dn(i)?t(c):t(f,!1)});var h=Te(d,2),p=t=>{var n=Ro(),i=Ee(n);je(()=>Kn(i,Dn(e).title)),Yn(t,n)};Zn(h,t=>{"hidden"!==Dn(a)&&t(p)});var v=Te(h,4),g=t=>{var e=Lo(),n=Ee(e),r=t=>{var e=Xn();li(We(e),()=>Dn(i),()=>Dn(o).icon),Yn(t,e)},s=t=>{Yn(t,Ao())};Zn(n,t=>{Dn(o).icon&&Dn(i)?t(r):t(s,!1)}),Yn(t,e)};Zn(v,t=>{Dn(e).lastChildId&&Dn(o)&&t(g)}),je(t=>{l=xi(s,0,"modal-dock-item",null,l,{"modal-dock-item-has-glow":!!Dn(e).glow,"modal-dock-item-has-child":!!Dn(e).lastChildId,"modal-dock-item-label-beside":"beside"===Dn(a),"modal-dock-item-label-below":"below"===Dn(a)}),Ii(s,"data-modal-id",t),Mi(s,Dn(e).glow?`--modal-dock-glow-color: ${Dn(e).glow.color};`:"")},[()=>Ji(Dn(e).id)]),pi(3,s,()=>Oo,()=>({duration:300,delay:50*Dn(n),easing:Eo,start:.5})),Yn(t,s)}),Di(n,t=>ye(c,t),()=>Dn(c)),je(()=>{o=xi(n,0,"modal-dock-container",null,o,{"modal-dock-left":"left"===Dn(l),"modal-dock-right":"right"===Dn(l),"modal-dock-bottom":"bottom"===Dn(l),"modal-dock-free":"free"===Dn(l),"modal-dock-empty":0===Dn(v).length}),h=Mi(n,"free"===Dn(l)?`left: ${Dn(u).x}px; top: ${Dn(u).y}px;`:"",h,{"z-index":Dn(s)}),w=xi(p,0,"modal-dock",null,w,{"modal-dock-free-horizontal":"free"===Dn(l)&&"horizontal"===Dn(d),"modal-dock-free-vertical":"free"===Dn(l)&&"vertical"===Dn(d)})}),pi(3,n,()=>So,()=>Dn(v).length>0?Dn(g):{duration:0}),Yn(t,n)},$$slots:{default:!0}}),Bt(M)}function qo(t,e){Tt(e,!0);let n=Ci(e,"maxWidth",0,"600px"),i=Ci(e,"autoOpen",0,!1),r=Ci(e,"closeOnEscape",0,!0),o=me(!1);Si(()=>{yr({id:e.id,title:e.title,icon:e.icon??"",isOpen:i(),isMinimized:!1,isHiddenWithParent:!1,isTransparent:!1,isRejected:!1,position:null,size:null,hasBeenDragged:!1,dockPosition:0,glow:e.glow??null,parentId:void 0,childId:void 0,offsetFromParent:void 0}),ye(o,!0)}),Oi(()=>{xr(e.id)});const s=ae(()=>{if(!Dn(o))return!1;Br();const t=Tr(e.id);return!!t&&(t.isOpen||t.isMinimized||Rr(e.id)||Ar(e.id)||Wr(e.id))});var l=Xn(),a=We(l),d=t=>{Io(t,{get id(){return e.id},get title(){return e.title},get icon(){return e.icon},get customIcon(){return e.customIcon},get maxWidth(){return n()},get preferredHeight(){return e.preferredHeight},get autoOpen(){return i()},get openSourcePosition(){return e.openSourcePosition},get glow(){return e.glow},get config(){return e.config},get closeOnEscape(){return r()},get onClose(){return e.onClose},get children(){return e.children},get footer(){return e.footer},skipRegistration:!0})};Zn(a,t=>{Dn(s)&&t(d)}),Yn(t,l),Bt()}Hn(["pointerdown","click"]);var jo=jn('<div class="modal-backdrop svelte-1d3nq4t" aria-hidden="true"></div>');function Xo(t,e){Tt(e,!0);const n=Yr(),i=ae(()=>(Ai(),Li())),r=ae(()=>Dn(i).features.backdrop),o=ae(()=>(Br(),Array.from(n.modals.values()).some(t=>t.isOpen&&!t.isMinimized&&!t.isHiddenWithParent))),s=ae(()=>Dn(r)&&Dn(o)),l=ae(()=>Xi("MODAL")-1);no(t,{get target(){return Dn(i).portalTarget},children:(t,e)=>{var n=Xn(),i=We(n),r=t=>{var e=jo();let n;je(()=>n=Mi(e,"",n,{"z-index":Dn(l)})),pi(3,e,()=>Co,()=>({duration:200})),Yn(t,e)};Zn(i,t=>{Dn(s)&&t(r)}),Yn(t,n)},$$slots:{default:!0}}),Bt()}export{Xo as B,Fo as D,Io as M,Qn as a,$i as b,Yi as c,ir as d,Cr as e,br as f,Li as g,Mr as h,ji as i,Or as j,qr as k,Pr as l,Gn as m,Yr as n,Dr as o,ke as p,Xr as q,yr as r,Hi as s,Ji as t,xr as u,qo as v,jr as w,Sr as x,Nr as y};
package/dist/ui.js CHANGED
@@ -1 +1 @@
1
- import*as e from"svelte/internal/client";import{i as t,a as i,o as n,r as o,m as r,c as s,b as a,d,t as l,e as g,f as c,g as u,h as p,j as h,k as m,l as f,n as v,p as w,q as y,s as x,u as _,v as b,w as z,x as k,y as D,z as M,A as B,B as I,C,D as E,E as R,F as P,G as T,H as L,I as $,J as S,K as H,L as O,M as X,N as Y,O as F,P as W,Q as A,R as q,S as j,T as N,U as G,V as K,W as U,X as V,Y as Z,Z as J,_ as Q,$ as ee,a0 as te,a1 as ie,a2 as ne,a3 as oe,a4 as re,a5 as se,a6 as ae,a7 as de}from"./core.js";import{getContext as le,onMount as ge,setContext as ce,tick as ue,onDestroy as pe,untrack as he}from"svelte";import"svelte/internal/disclose-version";import{scale as me,fly as fe,fade as ve}from"svelte/transition";import{cubicOut as we,backOut as ye}from"svelte/easing";const xe=Symbol("modal-render-icon"),_e=Symbol("modal-id");function be(e,i){if(!t(e))throw new Error(`Cannot call ${i}() on unregistered modal "${String(e)}". Ensure the Modal component is rendered.`)}function ze(e){return{shake:()=>{be(e,"shake"),l(e)},bringToFront:()=>{be(e,"bringToFront"),d(e)},isOpen:()=>i(e),isRegistered:()=>t(e),open:t=>{be(e,"open"),a(e,t)},close:()=>{be(e,"close"),s(e)},minimize:()=>{be(e,"minimize"),r(e)},restore:()=>{be(e,"restore"),o(e)},openChild:(t,i)=>{be(e,"openChild"),n({id:t},e,i)}}}function ke(t={x:0,y:0}){const i=e.proxy({...t}),n=e.proxy({isDragging:!1,startX:0,startY:0,initialX:0,initialY:0,hasBeenDragged:!1});return{get position(){return i},get hasBeenDragged(){return n.hasBeenDragged},get isDragging(){return n.isDragging},onPointerDown:function(e,t){if(0===e.button){if(!n.hasBeenDragged){const e=t.getBoundingClientRect();i.x=e.left,i.y=e.top}n.isDragging=!0,n.startX=e.clientX,n.startY=e.clientY,n.initialX=i.x,n.initialY=i.y,t.setPointerCapture(e.pointerId)}},onPointerMove:function(e,t,o){if(!n.isDragging)return;const r=e.clientX-n.startX,s=e.clientY-n.startY,a=n.initialX+r,d=n.initialY+s,l=g(a,d,o.width,o.height);i.x=l.x,i.y=l.y,n.hasBeenDragged=!0},onPointerUp:function(e,t){n.isDragging&&(n.isDragging=!1,t.releasePointerCapture(e.pointerId))},setPosition:function(e){i.x=e.x,i.y=e.y},setHasBeenDragged:function(e){n.hasBeenDragged=e},reset:function(){i.x=t.x,i.y=t.y,n.hasBeenDragged=!1}}}function De(t,i,n,o,r,s,a){let d=e.state(!1),l=e.state(""),g=e.state(e.proxy({width:0,height:0})),u=e.state(!1),p=e.state(!1),h={x:0,y:0,width:0,height:0,posX:0,posY:0,centerX:0,centerY:0},m=null;function f(s,a){s.preventDefault(),s.stopPropagation();const c=t();if(!c)return;const p=c.getBoundingClientRect();o()||(n({x:p.left,y:p.top}),r(!0)),e.get(u)||(e.set(g,{width:p.width,height:p.height},!0),e.set(u,!0));const f=i();e.set(d,!0),e.set(l,a,!0),m=s.pointerId,h={x:s.clientX,y:s.clientY,width:e.get(g).width,height:e.get(g).height,posX:f.x,posY:f.y,centerX:f.x+e.get(g).width/2,centerY:f.y+e.get(g).height/2},window.addEventListener("pointermove",v),window.addEventListener("pointerup",w),window.addEventListener("pointercancel",w)}function v(t){if(t.pointerId!==m)return;const i=t.clientX-h.x,o=t.clientY-h.y,r=window.innerWidth,s=window.innerHeight,d=(null==a?void 0:a())??!1;let u=h.width,p=h.height,f=h.posX,v=h.posY;if(d){if(e.get(l).includes("e")||e.get(l).includes("w")){const t=e.get(l).includes("e")?i:-i;u=Math.max(280,h.width+2*t),f=h.centerX-u/2}if(e.get(l).includes("s")||e.get(l).includes("n")){const t=e.get(l).includes("s")?o:-o;p=Math.max(200,h.height+2*t),v=h.centerY-p/2}}else{if(e.get(l).includes("e")){const e=r-f;u=Math.max(280,Math.min(h.width+i,e))}if(e.get(l).includes("w")){const e=h.width-280,t=Math.min(i,e);u=h.width-t,f=h.posX+t}if(e.get(l).includes("s")){const e=s-v;p=Math.max(200,Math.min(h.height+o,e))}if(e.get(l).includes("n")){const e=h.height-200,t=Math.min(o,e);p=h.height-t,v=h.posY+t}}const w=c(f,v,u,p);e.set(g,{width:w.width,height:w.height},!0),n({x:w.x,y:w.y})}function w(t){t.pointerId===m&&(e.set(d,!1),m=null,window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",w),window.removeEventListener("pointercancel",w),e.set(p,!0),s(i(),e.get(g)),setTimeout(()=>{e.set(p,!1)},0))}const y={startResize:f};return{get isResizing(){return e.get(d)},get resizeDirection(){return e.get(l)},get size(){return e.get(g)},get hasBeenResized(){return e.get(u)},get isActive(){return e.get(d)},get justFinishedResizing(){return e.get(p)},start:f,setHasBeenResized:()=>{},setSize:function(t){e.set(g,t,!0),e.set(u,!0)},reset:function(){e.set(u,!1),e.set(g,{width:0,height:0},!0)},constrainToViewport:function(){const o=i(),r=t();if(!r)return;const s=c(o.x,o.y,e.get(g).width||r.offsetWidth,e.get(g).height||r.offsetHeight);e.set(g,{width:s.width,height:s.height},!0),n({x:s.x,y:s.y})},handlers:y}}function Me(){return u().features.animations}function Be(t,i,n,o,r,s,a,d,l){let g=e.state(!1),c=e.state(!1),u=e.state(!1),h=e.state(!1),m=e.state(null),f=e.state(null),v=null,w=null;function y(){w&&(clearTimeout(w),w=null)}function x(){const e=t(),i=document.querySelector(`.modal-dock-item[data-modal-id="${p(e)}"]`),n=document.querySelector('[data-dock-container="true"]'),o=i||n;if(o){const e=o.getBoundingClientRect();return{x:e.left+e.width/2,y:e.top+e.height/2}}return{x:window.innerWidth/2,y:window.innerHeight-40}}return e.user_effect(()=>()=>{y(),e.set(g,!1),e.set(c,!1),e.set(u,!1),e.set(h,!1),e.set(m,null),e.set(f,null),v=null}),{get isMinimizing(){return e.get(g)},get isRestoring(){return e.get(c)},get isOpening(){return e.get(u)},get isClosing(){return e.get(h)},get animationTransform(){return e.get(m)},get pendingOpenSource(){return e.get(f)},startMinimize:function(t,p){const h=i();if(e.get(g)||!h)return;if(e.set(c,!1),e.set(u,!1),y(),!Me()){const e=h.getBoundingClientRect();let t=r()?n():{x:e.left,y:e.top},i=a()?d():{width:e.width,height:e.height};return r()||(o(t),s(!0)),void(p?p():l(t,!0,i))}const f=h.getBoundingClientRect(),v=f.left+f.width/2,_=f.top+f.height/2;let b=r()?n():{x:f.left,y:f.top},z=a()?d():{width:f.width,height:f.height};r()||(o(b),s(!0));const k=t??x(),D=k.x-f.left,M=k.y-f.top,B={x:k.x-v,y:k.y-_,originX:D,originY:M};e.set(m,B,!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.set(g,!0)})}),w=setTimeout(()=>{p?p():l(b,!0,z)},500)},startRestore:function(t,i){if(!Me()){const e=t||{x:window.innerWidth/2,y:window.innerHeight/2};return o(e),void s(!0)}const n=x(),r=t||{x:window.innerWidth/2,y:window.innerHeight/2},a=i||{width:480,height:400};o(r),s(!0);const d=r.x+a.width/2,l=r.y+a.height/2,g=n.x-r.x,u=n.y-r.y;e.set(m,{x:n.x-d,y:n.y-l,originX:g,originY:u},!0),e.set(c,!0),setTimeout(()=>{e.set(c,!1),e.set(m,null)},400)},startClose:function(t){e.get(h)||e.get(g)||(Me()?(v=t,e.set(h,!0),setTimeout(()=>{e.set(h,!1),v&&(v(),v=null)},250)):t())},setPendingOpenSource:function(t){e.set(f,t,!0)},tryStartOpenAnimation:function(){const t=i();if(!e.get(f)||!t||e.get(u))return!1;if(!Me())return e.set(f,null),!1;const a=e.get(f);e.set(f,null);const d=t.getBoundingClientRect(),l=r()?n():{x:d.left,y:d.top},g=d.width,c=d.height,p=l.x+g/2,h=l.y+c/2;r()||(o(l),s(!0));const v=a.x-l.x,w=a.y-l.y;return e.set(m,{x:a.x-p,y:a.y-h,originX:v,originY:w},!0),e.set(u,!0),setTimeout(()=>{e.set(u,!1),e.set(m,null)},400),!0},forceClearMinimize:function(){y(),e.set(g,!1),e.set(m,null)}}}const Ie=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function Ce(e){return Array.from(e.querySelectorAll(Ie)).filter(e=>null!==e.offsetParent||"A"===e.tagName)}function Ee(e,t){if("Tab"!==e.key)return;const i=Ce(t);if(0===i.length)return void e.preventDefault();const n=i[0],o=i[i.length-1],r=document.activeElement;e.shiftKey?r===n&&(o.focus(),e.preventDefault()):r===o&&(n.focus(),e.preventDefault())}function Re(e){const t=Ce(e);return t.length>0&&(t[0].focus(),!0)}function Pe(){return{trapFocus:Ee,focusFirstElement:Re}}const Te="modal-portal";function Le(){return{mount:function(e,t=null){const i=function(e){if("undefined"==typeof window)return null;if(e instanceof HTMLElement)return e;if("string"==typeof e){const t=document.querySelector(e);if(t)return t;if(e.startsWith("#")){const t=e.slice(1),i=document.createElement("div");return i.id=t,document.body.appendChild(i),i}}let t=document.getElementById(Te);return t||(t=document.createElement("div"),t.id=Te,document.body.appendChild(t)),t}(t);return i?(i.appendChild(e),()=>{e.parentNode===i&&i.removeChild(e),i.id!==Te&&0===i.children.length&&i.parentNode&&i.parentNode.removeChild(i)}):()=>{}}}}function $e(e){const t=le(_e),i=e??t;if(!i)throw new Error("useModalZIndex: No modal ID provided and no modal context found. Either pass a modal ID or use this hook inside a Modal component.");return{get zIndex(){const e=h(i);return((null==e?void 0:e.zIndex)??u().zIndex.base)+1},get portalTarget(){return u().portalTarget}}}function Se(){function t(e,t,i){return"undefined"==typeof window?()=>{}:(window.addEventListener(e,t,i),()=>{window.removeEventListener(e,t,i)})}return{addListener:t,addListenerEffect:function(i,n,o){e.user_effect(()=>{if("undefined"!=typeof window)return t(i,n,o)})}}}var He=e.from_html('<div style="display: contents;"><!></div>');function Oe(t,i){e.push(i,!0);let n=e.prop(i,"target",3,"body"),o=null,r=null;const{mount:s}=Le();ge(()=>(o&&(r=s(o,n())),()=>{null==r||r()}));var a=He(),d=e.child(a);e.snippet(d,()=>i.children),e.reset(a),e.bind_this(a,e=>o=e,()=>o),e.append(t,a),e.pop()}var Xe=e.from_html('<button type="button" aria-label="Minimize"></button>'),Ye=e.from_html('<button type="button" class="modal-header-light modal-header-light-style" aria-label="Toggle style"></button>'),Fe=e.from_html('<div class="modal-header-icon"><!></div>'),We=e.from_html('<div class="modal-header-icon"><!></div>'),Ae=e.from_html('<h2 class="modal-header-title"> </h2>'),qe=e.from_html('<h2 class="modal-header-title"> </h2>'),je=e.from_html('<div class="modal-header-traffic-lights"><button type="button" class="modal-header-light modal-header-light-close" aria-label="Close"></button> <!> <!></div> <div class="modal-header-mac-center"><!> <div class="modal-header-title-group"><!></div></div> <div class="modal-header-mac-spacer"></div>',1),Ne=e.from_html('<div class="modal-header-icon"><!></div>'),Ge=e.from_html('<div class="modal-header-icon"><!></div>'),Ke=e.from_html('<h2 class="modal-header-title"> </h2>'),Ue=e.from_html('<h2 class="modal-header-title"> </h2>'),Ve=e.from_html('<button type="button" class="modal-header-btn-windows modal-header-btn-windows-style" aria-label="Toggle style">&#9671;</button>'),Ze=e.from_html('<button type="button" aria-label="Minimize">&#8211;</button>'),Je=e.from_html('<div class="modal-header-title-group"><!> <!></div> <div class="modal-header-actions"><!> <!> <button type="button" class="modal-header-btn-windows modal-header-btn-windows-close" aria-label="Close">&times;</button></div>',1),Qe=e.from_html("<header><!></header>");function et(t,i){e.push(i,!0);let n=e.prop(i,"isTransparent",3,!1),o=e.prop(i,"headerLayout",3,"macos"),r=e.prop(i,"minimizable",3,!0),s=e.prop(i,"minimizeDisabled",3,!1),a=e.prop(i,"transparencyEnabled",3,!0);const d=le(xe),l=e.derived(()=>null==d?void 0:d()),g=e.derived(()=>"macos"===o());var c=Qe();let u;c.__pointerdown=function(e){var t;e.target.closest("button")||null==(t=i.onStartDrag)||t.call(i,e)};var p=e.child(c),h=t=>{var n=je(),o=e.first_child(n),d=e.child(o);d.__click=function(...e){var t;null==(t=i.onClose)||t.apply(this,e)};var g=e.sibling(d,2),c=t=>{var n=Xe();let o;n.__click=function(...e){var t;null==(t=s()?void 0:i.onMinimize)||t.apply(this,e)},e.template_effect(()=>{o=e.set_class(n,1,"modal-header-light modal-header-light-minimize",null,o,{"modal-header-light-disabled":s()}),n.disabled=s(),e.set_attribute(n,"title",s()?"Enable dock to minimize":void 0)}),e.append(t,n)};e.if(g,e=>{r()&&e(c)});var u=e.sibling(g,2),p=t=>{var n=Ye();n.__click=function(...e){var t;null==(t=i.onToggleStyle)||t.apply(this,e)},e.append(t,n)};e.if(u,e=>{a()&&e(p)}),e.reset(o);var h=e.sibling(o,2),m=e.child(h),f=t=>{var n=Fe(),o=e.child(n);e.snippet(o,()=>i.customIcon),e.reset(n),e.append(t,n)},v=t=>{var n=e.comment(),o=e.first_child(n),r=t=>{var n=We(),o=e.child(n);e.snippet(o,()=>e.get(l),()=>i.icon),e.reset(n),e.append(t,n)};e.if(o,t=>{i.icon&&e.get(l)&&t(r)},!0),e.append(t,n)};e.if(m,e=>{i.customIcon?e(f):e(v,!1)});var w=e.sibling(m,2),y=e.child(w),x=t=>{var n=Ae(),o=e.child(n,!0);e.reset(n),e.template_effect(()=>{e.set_attribute(n,"id",i.titleId),e.set_text(o,i.title)}),e.append(t,n)},_=t=>{var n=qe(),o=e.child(n,!0);e.reset(n),e.template_effect(()=>e.set_text(o,i.title)),e.append(t,n)};e.if(y,e=>{i.titleId?e(x):e(_,!1)}),e.reset(w),e.reset(h),e.next(2),e.append(t,n)},m=t=>{var n=Je(),o=e.first_child(n),d=e.child(o),g=t=>{var n=Ne(),o=e.child(n);e.snippet(o,()=>i.customIcon),e.reset(n),e.append(t,n)},c=t=>{var n=e.comment(),o=e.first_child(n),r=t=>{var n=Ge(),o=e.child(n);e.snippet(o,()=>e.get(l),()=>i.icon),e.reset(n),e.append(t,n)};e.if(o,t=>{i.icon&&e.get(l)&&t(r)},!0),e.append(t,n)};e.if(d,e=>{i.customIcon?e(g):e(c,!1)});var u=e.sibling(d,2),p=t=>{var n=Ke(),o=e.child(n,!0);e.reset(n),e.template_effect(()=>{e.set_attribute(n,"id",i.titleId),e.set_text(o,i.title)}),e.append(t,n)},h=t=>{var n=Ue(),o=e.child(n,!0);e.reset(n),e.template_effect(()=>e.set_text(o,i.title)),e.append(t,n)};e.if(u,e=>{i.titleId?e(p):e(h,!1)}),e.reset(o);var m=e.sibling(o,2),f=e.child(m),v=t=>{var n=Ve();n.__click=function(...e){var t;null==(t=i.onToggleStyle)||t.apply(this,e)},e.append(t,n)};e.if(f,e=>{a()&&e(v)});var w=e.sibling(f,2),y=t=>{var n=Ze();let o;n.__click=function(...e){var t;null==(t=s()?void 0:i.onMinimize)||t.apply(this,e)},e.template_effect(()=>{o=e.set_class(n,1,"modal-header-btn-windows",null,o,{"modal-header-btn-windows-disabled":s()}),n.disabled=s(),e.set_attribute(n,"title",s()?"Enable dock to minimize":void 0)}),e.append(t,n)};e.if(w,e=>{r()&&e(y)}),e.sibling(w,2).__click=function(...e){var t;null==(t=i.onClose)||t.apply(this,e)},e.reset(m),e.append(t,n)};e.if(p,t=>{e.get(g)?t(h):t(m,!1)}),e.reset(c),e.template_effect(()=>u=e.set_class(c,1,"modal-header",null,u,{"modal-header-draggable":!!i.onStartDrag,transparent:n()})),e.append(t,c),e.pop()}e.delegate(["pointerdown","click"]);var tt=e.from_html("<div></div>"),it=e.from_html('<div class="modal-resize-handles"></div>');function nt(t,i){e.push(i,!0);const n=["n","s","e","w","ne","nw","se","sw"];var o=e.comment(),r=e.first_child(o),s=t=>{var o=it();e.each(o,21,()=>n,e.index,(t,n)=>{var o=tt();o.__pointerdown=t=>function(e,t){var n;null==(n=i.onStartResize)||n.call(i,e,t)}(t,e.get(n)),e.template_effect(()=>e.set_class(o,1,`modal-resize-handle modal-resize-${e.get(n)??""}`)),e.append(t,o)}),e.reset(o),e.append(t,o)};e.if(r,e=>{i.onStartResize&&e(s)}),e.append(t,o),e.pop()}function ot(e,t){return t&&e.appendChild(t),{update(t){e.innerHTML="",t&&e.appendChild(t)},destroy(){e.innerHTML=""}}}e.delegate(["pointerdown"]);var rt=e.from_html('<div class="modal-footer"><!></div>'),st=e.from_html("<div></div>"),at=e.from_html('<div role="dialog" aria-modal="true" tabindex="-1"><!> <div class="modal-body"><!></div> <!> <!> <!></div>');function dt(t,i){e.push(i,!0);let n=e.prop(i,"maxWidth",3,"600px"),o=e.prop(i,"autoOpen",3,!1),a=e.prop(i,"closeOnEscape",3,!0),l=e.state(!1);ge(()=>{Z({id:i.id,title:i.title,icon:i.icon??"",isOpen:o(),isMinimized:!1,isHiddenWithParent:!1,isTransparent:!1,isRejected:!1,position:null,size:null,hasBeenDragged:!1,dockPosition:0,glow:i.glow??null,parentId:void 0,childId:void 0,offsetFromParent:void 0}),e.set(l,!0)}),pe(()=>{b(i.id)});const c=e.derived(()=>{if(!e.get(l))return!1;f();const t=h(i.id);return!!t&&(t.isOpen||t.isMinimized||$(i.id)||v(i.id)||w(i.id))});var te=e.comment(),ie=e.first_child(te),ne=t=>{!function(t,i){e.push(i,!0);let n=e.prop(i,"maxWidth",3,"600px"),o=e.prop(i,"autoOpen",3,!1),a=e.prop(i,"closeOnEscape",3,!0),l=e.prop(i,"skipRegistration",3,!1);ce(_e,()=>i.id);const c=u().portalTarget,te=e.derived(()=>p(i.id));function ie(e){var t,n;return(null==(n=null==(t=i.config)?void 0:t.features)?void 0:n[e])??z(e)}const ne=e.derived(()=>(m(),ie("drag"))),oe=e.derived(()=>(m(),ie("minimize"))),re=e.derived(()=>(m(),!ie("dock"))),se=e.derived(()=>(m(),ie("transparency"))),ae=e.derived(()=>(m(),ie("resize"))),de=e.derived(()=>{var e,t;return m(),(null==(t=null==(e=i.config)?void 0:e.appearance)?void 0:t.headerLayout)??u().appearance.headerLayout});let le=e.state(null),he=e.state(!1),me=e.state(!1),fe=e.state(!1),ve=e.state(!1),we=e.state(!1);const ye=e.derived(()=>(f(),h(i.id))),xe=e.derived(()=>e.get(ye)&&(e.get(ye).isOpen||v(i.id))&&(!e.get(ye).isMinimized||w(i.id))&&!e.get(ye).isHiddenWithParent),be=e.derived(()=>{var t;return!!(null==(t=e.get(ye))?void 0:t.childId)}),ze=e.derived(()=>{var t;return!!(null==(t=e.get(ye))?void 0:t.parentId)}),Me=e.derived(()=>e.get(be)||e.get(me)),Ie=e.derived(()=>!!i.glow),Ce=e.derived(()=>`modal-title-${e.get(te)}`),Ee=e.derived(()=>{var t;return(null==(t=e.get(ye))?void 0:t.zIndex)??1e3}),Re=ke({x:0,y:0});let Te=e.state(!1);const Le=De(()=>e.get(le),()=>Re.position,e=>Re.setPosition(e),()=>Re.hasBeenDragged,e=>Re.setHasBeenDragged(e),(t,n)=>{const o=h(i.id);if(null==o?void 0:o.parentId){const t=h(o.parentId),r=document.querySelector(`[data-modal-id="${p(o.parentId)}"]`);if(t&&r){const o=t.position??{x:r.getBoundingClientRect().left,y:r.getBoundingClientRect().top},s=t.size??{width:r.offsetWidth,height:r.offsetHeight},a={x:o.x+(s.width-n.width)/2,y:o.y+(s.height-n.height)/2};e.set(Te,!0),Re.setPosition(a);const d={x:a.x-o.x,y:a.y-o.y};return C(i.id,{position:a,size:n,hasBeenDragged:!0,offsetFromParent:d}),void setTimeout(()=>{e.set(Te,!1)},200)}}C(i.id,{position:t,size:n,hasBeenDragged:!0})}),$e=Be(()=>i.id,()=>e.get(le),()=>Re.position,e=>Re.setPosition(e),()=>Re.hasBeenDragged,e=>Re.setHasBeenDragged(e),()=>Le.hasBeenResized,()=>Le.size,(e,t,n)=>{C(i.id,{position:e,size:n,hasBeenDragged:t}),r(i.id)}),{trapFocus:Se,focusFirstElement:He}=Pe(),Xe=e.derived(()=>$e.isMinimizing||$e.isRestoring||$e.isOpening||$e.isClosing),Ye=e.derived(()=>(y(i.id)||x(i.id))&&!$e.isRestoring);let Fe=e.state(!1);const We=e.derived(()=>$e.isRestoring||$e.isOpening||e.get(Fe)),Ae=e.derived(()=>e.get(xe)&&!Re.hasBeenDragged&&!e.get(Xe)&&!$e.pendingOpenSource&&!e.get(Ye)),qe=e.derived(()=>{const t=[];return t.push(`z-index: ${e.get(Ee)};`),$e.animationTransform?(t.push(`left: ${Re.position.x}px; top: ${Re.position.y}px;`),t.push(`--genie-origin-x: ${$e.animationTransform.originX}px;`),t.push(`--genie-origin-y: ${$e.animationTransform.originY}px;`),t.push(`--genie-translate-x: ${$e.animationTransform.x}px;`),t.push(`--genie-translate-y: ${$e.animationTransform.y}px;`)):Re.hasBeenDragged&&t.push(`left: ${Re.position.x}px; top: ${Re.position.y}px; transform: none;`),Le.hasBeenResized?t.push(`width: ${Le.size.width}px; height: ${Le.size.height}px; max-width: none; max-height: none;`):(i.preferredHeight&&t.push(`min-height: ${i.preferredHeight};`),n()&&t.push(`max-width: ${n()};`)),e.get(Ie)&&i.glow&&(t.push(`--modal-glow-color: ${i.glow.color};`),t.push(`--modal-glow-intensity: ${i.glow.intensity};`)),t.join(" ")});function je(){e.get(oe)&&r(i.id)}function Ne(){var e;M(i.id)&&B(i.id),s(i.id),null==(e=i.onClose)||e.call(i)}function Ge(){Q(i.id)}function Ke(t){e.get(ne)&&e.get(le)&&Re.onPointerDown(t,e.get(le))}function Ue(e){a()&&"Escape"===e.key&&J(i.id)&&(e.stopPropagation(),Ne())}function Ve(t){if(!e.get(le))return;const n=Re.isDragging,o=Le.hasBeenResized?Le.size:{width:e.get(le).offsetWidth,height:e.get(le).offsetHeight};Re.onPointerMove(t,e.get(le),o),Re.isDragging&&n&&k(i.id,Re.position,{drag:!0})}function Ze(t){if(!e.get(le))return;const n=Re.isDragging;Re.onPointerUp(t,e.get(le)),n&&!Le.justFinishedResizing&&(k(i.id,Re.position,{drag:!0}),D(i.id))}function Je(){var t;const n=u();if("smart"!==(null==(t=n.positioning)?void 0:t.strategy))return!1;const o=h(i.id),r=A();if((null==o?void 0:o.parentId)||r&&r.childId===i.id)return!1;if((null==o?void 0:o.hasBeenDragged)||(null==o?void 0:o.position))return!1;const s=e.get(le)||document.querySelector(`[data-modal-id="${e.get(te)}"]`);if(!s)return!1;const a=s.offsetWidth,d=s.offsetHeight;if(a<=0||d<=0)return!1;const l=n.positioning.modalGap??16,g=q(i.id),c=j(n.positioning.avoidElements??[]),p=N(a,d,g,{modalGap:l,avoidBounds:c});if(G(p.x,p.y,a,d,g,l)/(a*d)>.1&&g.length>0){const e=K(i.id),t=U(a,d,e,{modalGap:l});if(t&&t.existingModalMoves.size>0)return V(t.existingModalMoves),Re.setPosition(t.newModalPosition),Re.setHasBeenDragged(!0),k(i.id,t.newModalPosition,{size:{width:a,height:d}}),!0}return Re.setPosition(p),Re.setHasBeenDragged(!0),k(i.id,p,{size:{width:a,height:d}}),!0}function Qe(){ue().then(()=>ue()).then(()=>{let t=0;const i=()=>{t+=1,Je()||t>5||requestAnimationFrame(i)};e.get(le)?i():requestAnimationFrame(i)})}ge(()=>{var t;function n(){const t=h(i.id);if(!(null==t?void 0:t.position)||!e.get(le))return;if(t.parentId)return;const n=Le.hasBeenResized?Le.size.width:e.get(le).offsetWidth,o=Le.hasBeenResized?Le.size.height:e.get(le).offsetHeight;if(n<=0||o<=0)return;const r=g(t.position.x,t.position.y,n,o);(Math.abs(r.x-t.position.x)>1||Math.abs(r.y-t.position.y)>1)&&(Re.setPosition(r),k(i.id,r))}return l()||(t=o(),Z({id:i.id,title:i.title,icon:i.icon??"",isOpen:t,isMinimized:!1,isHiddenWithParent:!1,isTransparent:!1,isRejected:!1,position:null,size:null,hasBeenDragged:!1,dockPosition:0,glow:i.glow??null,parentId:void 0,childId:void 0,offsetFromParent:void 0}),t&&d(i.id)),o()&&(ue().then(()=>{e.get(le)&&He(e.get(le))}),Qe()),window.addEventListener("pointermove",Ve),window.addEventListener("pointerup",Ze),window.addEventListener("resize",n),()=>{window.removeEventListener("pointermove",Ve),window.removeEventListener("pointerup",Ze),window.removeEventListener("resize",n)}}),pe(()=>{_(i.id),l()||b(i.id)}),e.user_effect(()=>{f();const t=h(i.id);if(t){if(e.set(he,t.isTransparent,!0),!Re.isDragging&&!Le.isResizing&&t.position){const e=Re.position,i=t.position;(Math.abs(e.x-i.x)>.5||Math.abs(e.y-i.y)>.5)&&(Re.setPosition(i),t.hasBeenDragged&&Re.setHasBeenDragged(!0))}ue().then(()=>function(){var t;if(!h(i.id))return;if(M(i.id))return B(i.id),void(null==(t=i.onClose)||t.call(i));if(w(i.id)&&!e.get(ve)){if(e.set(ve,!0),I(),e.get(le)){const t=e.get(le).getBoundingClientRect(),n=Re.hasBeenDragged?Re.position:{x:t.left,y:t.top},o=Le.hasBeenResized?Le.size:{width:t.width,height:t.height};C(i.id,{position:n,size:o,hasBeenDragged:!0})}$e.startMinimize(void 0,()=>{E(i.id),e.set(ve,!1)})}if(x(i.id)){R(i.id);const t=h(i.id);$e.startRestore((null==t?void 0:t.position)??void 0,(null==t?void 0:t.size)??void 0),ue().then(()=>{e.get(le)&&He(e.get(le))})}if(y(i.id)){P(i.id);const e=h(i.id);$e.startRestore((null==e?void 0:e.position)??void 0,(null==e?void 0:e.size)??void 0)}if(v(i.id)&&(T(i.id),$e.startClose(()=>{var e;_(i.id),L(i.id),null==(e=i.onClose)||e.call(i)})),$(i.id)){S(i.id);const t=H(i.id)||i.openSourcePosition||null;t?($e.setPendingOpenSource(t),ue().then(()=>ue()).then(()=>{Je(),$e.tryStartOpenAnimation()})):Qe(),ue().then(()=>{e.get(le)&&He(e.get(le))})}O(i.id)&&(X(i.id),Y(i.id),e.set(we,!0),setTimeout(()=>{e.set(we,!1),F(i.id)},600));const n=W(i.id);var o;n&&e.get(le)&&(o=n.parentId,ue().then(()=>ue()).then(()=>{let t=0;const n=()=>{t+=1;const r=function(t){var n,o;const r=h(t);if(!r)return!1;const s=e.get(le)||document.querySelector(`[data-modal-id="${e.get(te)}"]`),a=document.querySelector(`[data-modal-id="${p(t)}"]`),d=null==a?void 0:a.getBoundingClientRect(),l=r.position??(d?{x:d.left,y:d.top}:null);if(!l||!s)return!1;const g=(null==(n=r.size)?void 0:n.width)??(null==a?void 0:a.offsetWidth)??(null==d?void 0:d.width)??480,c=(null==(o=r.size)?void 0:o.height)??(null==a?void 0:a.offsetHeight)??(null==d?void 0:d.height)??400,u=s.offsetWidth,m=s.offsetHeight;if(g<=0||c<=0||u<=0||m<=0)return!1;const f={x:l.x+(g-u)/2,y:l.y+(c-m)/2};return Re.setPosition(f),Re.setHasBeenDragged(!0),k(i.id,f,{size:{width:u,height:m}}),r.position&&r.size||!d||k(t,{x:d.left,y:d.top},{size:{width:g,height:c}}),ee(t,i.id),!0}(o);r||t>5||requestAnimationFrame(n)};e.get(le)?n():requestAnimationFrame(n)}))}())}}),e.user_effect(()=>{const t=h(i.id);t&&t.isTransparent!==e.get(he)&&e.set(he,t.isTransparent,!0)}),e.user_effect(()=>{if(e.get(xe)&&e.get(le)){const t=t=>function(t){e.get(le)&&Se(t,e.get(le))}(t);return e.get(le).addEventListener("keydown",t),()=>{var i;return null==(i=e.get(le))?void 0:i.removeEventListener("keydown",t)}}}),e.user_effect(()=>{!e.get(xe)&&$e.isMinimizing&&$e.forceClearMinimize()}),e.user_effect(()=>{$e.isRestoring||$e.isOpening?e.set(Fe,!0):e.get(Fe)&&requestAnimationFrame(()=>{e.set(Fe,!1)})}),e.user_effect(()=>{e.get(fe)&&!e.get(be)&&(e.set(me,!0),setTimeout(()=>{e.set(me,!1)},200)),e.set(fe,e.get(be),!0)});var tt=e.comment(),it=e.first_child(tt),dt=t=>{Oe(t,{get target(){return c},children:(t,n)=>{var o=at();let r;o.__keydown=Ue;var s=e.child(o);{let t=e.derived(()=>e.get(ne)?Ke:void 0);et(s,{get title(){return i.title},get customIcon(){return i.customIcon},get icon(){return i.icon},get isTransparent(){return e.get(he)},get titleId(){return e.get(Ce)},get headerLayout(){return e.get(de)},get onStartDrag(){return e.get(t)},onToggleStyle:Ge,onMinimize:je,onClose:Ne,get minimizable(){return e.get(oe)},get minimizeDisabled(){return e.get(re)},get transparencyEnabled(){return e.get(se)}})}var a=e.sibling(s,2),l=e.child(a);e.snippet(l,()=>i.children??e.noop),e.reset(a),e.action(a,(e,t)=>null==ot?void 0:ot(e,t),()=>i.bodyElement);var g=e.sibling(a,2),c=t=>{var n=rt(),o=e.child(n),r=t=>{var n=e.comment(),o=e.first_child(n);e.snippet(o,()=>i.footer),e.append(t,n)};e.if(o,e=>{i.footer&&e(r)}),e.reset(n),e.action(n,(e,t)=>null==ot?void 0:ot(e,t),()=>i.footerElement),e.append(t,n)};e.if(g,e=>{(i.footer||i.footerElement)&&e(c)});var u=e.sibling(g,2);{let t=e.derived(()=>e.get(ae)&&!e.get(be)?Le.handlers.startResize:void 0);nt(u,{get onStartResize(){return e.get(t)}})}var p=e.sibling(u,2),h=t=>{var i=st();let n;e.template_effect(()=>n=e.set_class(i,1,"modal-child-overlay",null,n,{"modal-overlay-closing":e.get(me)})),e.append(t,i)};e.if(p,t=>{e.get(Me)&&t(h)}),e.reset(o),e.bind_this(o,t=>e.set(le,t),()=>e.get(le)),e.template_effect(()=>{var t;r=e.set_class(o,1,"modal-dialog",null,r,{"modal-dragging":Re.isDragging,"modal-resizing":Le.isResizing,"modal-positioned":Re.hasBeenDragged,"modal-minimizing":$e.isMinimizing,"modal-restoring":$e.isRestoring,"modal-opening":$e.isOpening,"modal-closing":$e.isClosing,"modal-centered":e.get(Ae),"modal-solid":!e.get(he),"modal-transparent":e.get(he),"modal-glow":e.get(Ie),"modal-has-child":e.get(be),"modal-is-child":e.get(ze),"modal-visible-by-animation":e.get(We),"modal-animating-to-center":e.get(Te),"modal-animating-position":null==(t=e.get(ye))?void 0:t.isAnimatingPosition,"modal-attention":e.get(we)}),e.set_attribute(o,"data-modal-id",e.get(te)),e.set_style(o,e.get(qe)),e.set_attribute(o,"aria-labelledby",e.get(Ce))}),e.event("pointerdown",o,()=>d(i.id),!0),e.append(t,o)},$$slots:{default:!0}})};e.if(it,t=>{e.get(xe)&&t(dt)}),e.append(t,tt),e.pop()}(t,{get id(){return i.id},get title(){return i.title},get icon(){return i.icon},get customIcon(){return i.customIcon},get maxWidth(){return n()},get preferredHeight(){return i.preferredHeight},get autoOpen(){return o()},get openSourcePosition(){return i.openSourcePosition},get glow(){return i.glow},get config(){return i.config},get closeOnEscape(){return a()},get onClose(){return i.onClose},get children(){return i.children},get footer(){return i.footer},skipRegistration:!0})};e.if(ie,t=>{e.get(c)&&t(ne)}),e.append(t,te),e.pop()}e.delegate(["keydown"]);var lt=e.from_html('<button type="button" aria-label="Drag dock"></button>'),gt=e.from_html('<span class="modal-dock-item-icon-placeholder"> </span>'),ct=e.from_html('<span class="modal-dock-item-label"> </span>'),ut=e.from_html("<span>+</span>"),pt=e.from_html('<span class="modal-dock-child-indicator"><!></span>'),ht=e.from_html('<button><span class="modal-dock-item-icon"><!></span> <!> <span class="modal-dock-item-glow"></span> <!></button>'),mt=e.from_html('<div data-dock-container="true"><div><!> <!></div></div>');function ft(t,i){e.push(i,!0);const n=le(xe),r=e.derived(()=>i.renderIcon??(null==n?void 0:n())),s=ie(),a=e.derived(()=>(m(),u())),d=e.derived(()=>te("DOCK")),l=e.derived(()=>e.get(a).dock.position),c=e.derived(()=>e.get(a).dock.labelMode);let h=e.state("horizontal"),v=e.state(e.proxy({x:100,y:100})),w=e.state(null),y=e.state(!1),x={x:0,y:0},_=null;const b=e.derived(()=>(f(),Array.from(s.modals.values()).filter(e=>e.isMinimized).sort((e,t)=>e.dockPosition-t.dockPosition))),z=e.derived(()=>{switch(e.get(l)){case"left":return{x:-20,duration:250,easing:we};case"right":return{x:20,duration:250,easing:we};default:return{y:20,duration:250,easing:we}}});function k(t){var i;"free"===e.get(l)&&(e.set(y,!0),_=t.pointerId,x={x:t.clientX-e.get(v).x,y:t.clientY-e.get(v).y},null==(i=t.currentTarget)||i.setPointerCapture(t.pointerId),window.addEventListener("pointermove",D),window.addEventListener("pointerup",M),window.addEventListener("pointercancel",M))}function D(t){if(t.pointerId!==_||!e.get(w))return;const i=e.get(w).getBoundingClientRect(),n=window.innerWidth-i.width-8,o=window.innerHeight-i.height-8,r=Math.min(Math.max(t.clientX-x.x,8),Math.max(8,n)),s=Math.min(Math.max(t.clientY-x.y,8),Math.max(8,o));e.set(v,{x:Math.round(r),y:Math.round(s)},!0)}function M(t){t.pointerId===_&&(e.set(y,!1),_=null,window.removeEventListener("pointermove",D),window.removeEventListener("pointerup",M),window.removeEventListener("pointercancel",M))}const{addListener:B}=Se();function I(){if("free"!==e.get(l)||!e.get(w))return;const t=e.get(w).getBoundingClientRect(),i=g(e.get(v).x,e.get(v).y,t.width,t.height);i.x===e.get(v).x&&i.y===e.get(v).y||e.set(v,{x:Math.round(i.x),y:Math.round(i.y)},!0)}e.user_effect(()=>{"undefined"!=typeof window&&B("resize",I)});var C={setDockOrientation:function(t){e.set(h,t,!0)},setDockFreePosition:function(t){e.set(v,t,!0)},getDockState:function(){return{dockPosition:e.get(l),dockOrientation:e.get(h),dockFreePosition:e.get(v),dockLabelMode:e.get(c)}}};return Oe(t,{get target(){return e.get(a).portalTarget},children:(t,i)=>{var n=mt();let a,g;var u=e.child(n);let m;var f=e.child(u),x=t=>{var i=lt();let n;i.__pointerdown=k,e.template_effect(()=>n=e.set_class(i,1,"modal-dock-handle",null,n,{"modal-dock-handle-dragging":e.get(y)})),e.append(t,i)};e.if(f,t=>{"free"===e.get(l)&&t(x)});var _=e.sibling(f,2);e.each(_,19,()=>e.get(b),e=>e.id,(t,i,n)=>{const a=e.derived(()=>e.get(i).lastChildId?s.modals.get(e.get(i).lastChildId):null);var d=ht();let l;d.__click=t=>{ne(e.get(i).id)?oe(t.currentTarget):o(e.get(i).id)};var g=e.child(d),u=e.child(g),h=t=>{var n=e.comment(),o=e.first_child(n);e.snippet(o,()=>e.get(r),()=>e.get(i).icon),e.append(t,n)},m=t=>{var n=gt(),o=e.child(n,!0);e.reset(n),e.template_effect(t=>e.set_text(o,t),[()=>e.get(i).title.charAt(0)]),e.append(t,n)};e.if(u,t=>{e.get(i).icon&&e.get(r)?t(h):t(m,!1)}),e.reset(g);var f=e.sibling(g,2),v=t=>{var n=ct(),o=e.child(n,!0);e.reset(n),e.template_effect(()=>e.set_text(o,e.get(i).title)),e.append(t,n)};e.if(f,t=>{"hidden"!==e.get(c)&&t(v)});var w=e.sibling(f,4),y=t=>{var i=pt(),n=e.child(i),o=t=>{var i=e.comment(),n=e.first_child(i);e.snippet(n,()=>e.get(r),()=>e.get(a).icon),e.append(t,i)},s=t=>{var i=ut();e.append(t,i)};e.if(n,t=>{e.get(a).icon&&e.get(r)?t(o):t(s,!1)}),e.reset(i),e.append(t,i)};e.if(w,t=>{e.get(i).lastChildId&&e.get(a)&&t(y)}),e.reset(d),e.template_effect(t=>{l=e.set_class(d,1,"modal-dock-item",null,l,{"modal-dock-item-has-glow":!!e.get(i).glow,"modal-dock-item-has-child":!!e.get(i).lastChildId,"modal-dock-item-label-beside":"beside"===e.get(c),"modal-dock-item-label-below":"below"===e.get(c)}),e.set_attribute(d,"data-modal-id",t),e.set_style(d,e.get(i).glow?`--modal-dock-glow-color: ${e.get(i).glow.color};`:"")},[()=>p(e.get(i).id)]),e.transition(3,d,()=>me,()=>({duration:300,delay:50*e.get(n),easing:ye,start:.5})),e.append(t,d)}),e.reset(u),e.reset(n),e.bind_this(n,t=>e.set(w,t),()=>e.get(w)),e.template_effect(()=>{a=e.set_class(n,1,"modal-dock-container",null,a,{"modal-dock-left":"left"===e.get(l),"modal-dock-right":"right"===e.get(l),"modal-dock-bottom":"bottom"===e.get(l),"modal-dock-free":"free"===e.get(l),"modal-dock-empty":0===e.get(b).length}),g=e.set_style(n,"free"===e.get(l)?`left: ${e.get(v).x}px; top: ${e.get(v).y}px;`:"",g,{"z-index":e.get(d)}),m=e.set_class(u,1,"modal-dock",null,m,{"modal-dock-free-horizontal":"free"===e.get(l)&&"horizontal"===e.get(h),"modal-dock-free-vertical":"free"===e.get(l)&&"vertical"===e.get(h)})}),e.transition(3,n,()=>fe,()=>e.get(b).length>0?e.get(z):{duration:0}),e.append(t,n)},$$slots:{default:!0}}),e.pop(C)}e.delegate(["pointerdown","click"]);var vt=e.from_html('<div class="modal-backdrop svelte-1d3nq4t" aria-hidden="true"></div>');function wt(t,i){e.push(i,!0);const n=ie(),o=e.derived(()=>(m(),u())),r=e.derived(()=>e.get(o).features.backdrop),s=e.derived(()=>(f(),Array.from(n.modals.values()).some(e=>e.isOpen&&!e.isMinimized&&!e.isHiddenWithParent))),a=e.derived(()=>e.get(r)&&e.get(s)),d=e.derived(()=>te("MODAL")-1);Oe(t,{get target(){return e.get(o).portalTarget},children:(t,i)=>{var n=e.comment(),o=e.first_child(n),r=t=>{var i=vt();let n;e.template_effect(()=>n=e.set_style(i,"",n,{"z-index":e.get(d)})),e.transition(3,i,()=>ve,()=>({duration:200})),e.append(t,i)};e.if(o,t=>{e.get(a)&&t(r)}),e.append(t,n)},$$slots:{default:!0}}),e.pop()}var yt=e.from_html("<!> <!>",1);function xt(t,i){e.push(i,!0),ce(xe,()=>i.renderIcon),e.user_effect(()=>(he(()=>{i.config&&re(i.config),se()}),()=>{ae(),de()})),e.user_effect(()=>{if("undefined"==typeof document)return;const e=he(()=>u().portalTarget);if("string"==typeof e&&!document.querySelector(e)){const t=document.createElement("div");return t.id=e.replace("#",""),document.body.appendChild(t),()=>{t.remove()}}});var n=yt(),o=e.first_child(n);wt(o,{});var r=e.sibling(o,2);e.snippet(r,()=>i.children??e.noop),e.append(t,n),e.pop()}export{wt as B,ft as D,dt as M,Oe as P,nt as R,xt as a,et as b,ke as c,De as d,Be as e,Re as f,Pe as g,Le as h,$e as i,Se as j,Ee as t,ze as u};
1
+ import*as e from"svelte/internal/client";import{i as t,a as i,o as n,r as o,m as r,c as s,b as a,d,t as l,e as g,f as c,g as u,h as p,j as h,k as m,l as f,n as v,p as w,q as y,s as x,u as _,v as b,w as z,x as k,y as D,z as M,A as B,B as I,C,D as E,E as R,F as P,G as T,H as L,I as $,J as S,K as H,L as O,M as X,N as Y,O as F,P as W,Q as A,R as q,S as j,T as N,U as G,V as K,W as U,X as V,Y as Z,Z as J,_ as Q,$ as ee,a0 as te,a1 as ie,a2 as ne,a3 as oe,a4 as re,a5 as se,a6 as ae,a7 as de}from"./core.js";import{getContext as le,onMount as ge,setContext as ce,tick as ue,onDestroy as pe,untrack as he}from"svelte";import"svelte/internal/disclose-version";import{scale as me,fly as fe,fade as ve}from"svelte/transition";import{cubicOut as we,backOut as ye}from"svelte/easing";const xe=Symbol("modal-render-icon"),_e=Symbol("modal-id");function be(e,i){if(!t(e))throw new Error(`Cannot call ${i}() on unregistered modal "${String(e)}". Ensure the Modal component is rendered.`)}function ze(e){return{shake:()=>{be(e,"shake"),l(e)},bringToFront:()=>{be(e,"bringToFront"),d(e)},isOpen:()=>i(e),isRegistered:()=>t(e),open:t=>{be(e,"open"),a(e,t)},close:()=>{be(e,"close"),s(e)},minimize:()=>{be(e,"minimize"),r(e)},restore:()=>{be(e,"restore"),o(e)},openChild:(t,i)=>{be(e,"openChild"),n({id:t},e,i)}}}function ke(t={x:0,y:0}){const i=e.proxy({...t}),n=e.proxy({isDragging:!1,startX:0,startY:0,initialX:0,initialY:0,hasBeenDragged:!1});return{get position(){return i},get hasBeenDragged(){return n.hasBeenDragged},get isDragging(){return n.isDragging},onPointerDown:function(e,t){if(0===e.button){if(!n.hasBeenDragged){const e=t.getBoundingClientRect();i.x=e.left,i.y=e.top}n.isDragging=!0,n.startX=e.clientX,n.startY=e.clientY,n.initialX=i.x,n.initialY=i.y,t.setPointerCapture(e.pointerId)}},onPointerMove:function(e,t,o){if(!n.isDragging)return;const r=e.clientX-n.startX,s=e.clientY-n.startY,a=n.initialX+r,d=n.initialY+s,l=g(a,d,o.width,o.height);i.x=l.x,i.y=l.y,n.hasBeenDragged=!0},onPointerUp:function(e,t){n.isDragging&&(n.isDragging=!1,t.releasePointerCapture(e.pointerId))},setPosition:function(e){i.x=e.x,i.y=e.y},setHasBeenDragged:function(e){n.hasBeenDragged=e},reset:function(){i.x=t.x,i.y=t.y,n.hasBeenDragged=!1}}}function De(t,i,n,o,r,s,a){let d=e.state(!1),l=e.state(""),g=e.state(e.proxy({width:0,height:0})),u=e.state(!1),p=e.state(!1),h={x:0,y:0,width:0,height:0,posX:0,posY:0,centerX:0,centerY:0},m=null;function f(s,a){s.preventDefault(),s.stopPropagation();const c=t();if(!c)return;const p=c.getBoundingClientRect();o()||(n({x:p.left,y:p.top}),r(!0)),e.get(u)||(e.set(g,{width:p.width,height:p.height},!0),e.set(u,!0));const f=i();e.set(d,!0),e.set(l,a,!0),m=s.pointerId,h={x:s.clientX,y:s.clientY,width:e.get(g).width,height:e.get(g).height,posX:f.x,posY:f.y,centerX:f.x+e.get(g).width/2,centerY:f.y+e.get(g).height/2},window.addEventListener("pointermove",v),window.addEventListener("pointerup",w),window.addEventListener("pointercancel",w)}function v(t){if(t.pointerId!==m)return;const i=t.clientX-h.x,o=t.clientY-h.y,r=window.innerWidth,s=window.innerHeight,d=(null==a?void 0:a())??!1;let u=h.width,p=h.height,f=h.posX,v=h.posY;if(d){if(e.get(l).includes("e")||e.get(l).includes("w")){const t=e.get(l).includes("e")?i:-i;u=Math.max(280,h.width+2*t),f=h.centerX-u/2}if(e.get(l).includes("s")||e.get(l).includes("n")){const t=e.get(l).includes("s")?o:-o;p=Math.max(200,h.height+2*t),v=h.centerY-p/2}}else{if(e.get(l).includes("e")){const e=r-f;u=Math.max(280,Math.min(h.width+i,e))}if(e.get(l).includes("w")){const e=h.width-280,t=Math.min(i,e);u=h.width-t,f=h.posX+t}if(e.get(l).includes("s")){const e=s-v;p=Math.max(200,Math.min(h.height+o,e))}if(e.get(l).includes("n")){const e=h.height-200,t=Math.min(o,e);p=h.height-t,v=h.posY+t}}const w=c(f,v,u,p);e.set(g,{width:w.width,height:w.height},!0),n({x:w.x,y:w.y})}function w(t){t.pointerId===m&&(e.set(d,!1),m=null,window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",w),window.removeEventListener("pointercancel",w),e.set(p,!0),s(i(),e.get(g)),setTimeout(()=>{e.set(p,!1)},0))}const y={startResize:f};return{get isResizing(){return e.get(d)},get resizeDirection(){return e.get(l)},get size(){return e.get(g)},get hasBeenResized(){return e.get(u)},get isActive(){return e.get(d)},get justFinishedResizing(){return e.get(p)},start:f,setHasBeenResized:()=>{},setSize:function(t){e.set(g,t,!0),e.set(u,!0)},reset:function(){e.set(u,!1),e.set(g,{width:0,height:0},!0)},constrainToViewport:function(){const o=i(),r=t();if(!r)return;const s=c(o.x,o.y,e.get(g).width||r.offsetWidth,e.get(g).height||r.offsetHeight);e.set(g,{width:s.width,height:s.height},!0),n({x:s.x,y:s.y})},handlers:y}}function Me(){return u().features.animations}function Be(t,i,n,o,r,s,a,d,l){let g=e.state(!1),c=e.state(!1),u=e.state(!1),h=e.state(!1),m=e.state(null),f=e.state(null),v=null,w=null;function y(){w&&(clearTimeout(w),w=null)}function x(){const e=t(),i=document.querySelector(`.modal-dock-item[data-modal-id="${p(e)}"]`),n=document.querySelector('[data-dock-container="true"]'),o=i||n;if(o){const e=o.getBoundingClientRect();return{x:e.left+e.width/2,y:e.top+e.height/2}}return{x:window.innerWidth/2,y:window.innerHeight-40}}return e.user_effect(()=>()=>{y(),e.set(g,!1),e.set(c,!1),e.set(u,!1),e.set(h,!1),e.set(m,null),e.set(f,null),v=null}),{get isMinimizing(){return e.get(g)},get isRestoring(){return e.get(c)},get isOpening(){return e.get(u)},get isClosing(){return e.get(h)},get animationTransform(){return e.get(m)},get pendingOpenSource(){return e.get(f)},startMinimize:function(t,p){const h=i();if(e.get(g)||!h)return;if(e.set(c,!1),e.set(u,!1),y(),!Me()){const e=h.getBoundingClientRect();let t=r()?n():{x:e.left,y:e.top},i=a()?d():{width:e.width,height:e.height};return r()||(o(t),s(!0)),void(p?p():l(t,!0,i))}const f=h.getBoundingClientRect(),v=f.left+f.width/2,_=f.top+f.height/2;let b=r()?n():{x:f.left,y:f.top},z=a()?d():{width:f.width,height:f.height};r()||(o(b),s(!0));const k=t??x(),D=k.x-f.left,M=k.y-f.top,B={x:k.x-v,y:k.y-_,originX:D,originY:M};e.set(m,B,!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.set(g,!0)})}),w=setTimeout(()=>{p?p():l(b,!0,z)},500)},startRestore:function(t,i){if(!Me()){const e=t||{x:window.innerWidth/2,y:window.innerHeight/2};return o(e),void s(!0)}const n=x(),r=t||{x:window.innerWidth/2,y:window.innerHeight/2},a=i||{width:480,height:400};o(r),s(!0);const d=r.x+a.width/2,l=r.y+a.height/2,g=n.x-r.x,u=n.y-r.y;e.set(m,{x:n.x-d,y:n.y-l,originX:g,originY:u},!0),e.set(c,!0),setTimeout(()=>{e.set(c,!1),e.set(m,null)},400)},startClose:function(t){e.get(h)||e.get(g)||(Me()?(v=t,e.set(h,!0),setTimeout(()=>{e.set(h,!1),v&&(v(),v=null)},250)):t())},setPendingOpenSource:function(t){e.set(f,t,!0)},tryStartOpenAnimation:function(){const t=i();if(!e.get(f)||!t||e.get(u))return!1;if(!Me())return e.set(f,null),!1;const a=e.get(f);e.set(f,null);const d=t.getBoundingClientRect(),l=r()?n():{x:d.left,y:d.top},g=d.width,c=d.height,p=l.x+g/2,h=l.y+c/2;r()||(o(l),s(!0));const v=a.x-l.x,w=a.y-l.y;return e.set(m,{x:a.x-p,y:a.y-h,originX:v,originY:w},!0),e.set(u,!0),setTimeout(()=>{e.set(u,!1),e.set(m,null)},400),!0},forceClearMinimize:function(){y(),e.set(g,!1),e.set(m,null)}}}const Ie=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function Ce(e){return Array.from(e.querySelectorAll(Ie)).filter(e=>null!==e.offsetParent||"A"===e.tagName)}function Ee(e,t){if("Tab"!==e.key)return;const i=Ce(t);if(0===i.length)return void e.preventDefault();const n=i[0],o=i[i.length-1],r=document.activeElement;e.shiftKey?r===n&&(o.focus(),e.preventDefault()):r===o&&(n.focus(),e.preventDefault())}function Re(e){const t=Ce(e);return t.length>0&&(t[0].focus(),!0)}function Pe(){return{trapFocus:Ee,focusFirstElement:Re}}const Te="modal-portal";function Le(){return{mount:function(e,t=null){const i=function(e){if("undefined"==typeof window)return null;if(e instanceof HTMLElement)return e;if("string"==typeof e){const t=document.querySelector(e);if(t)return t;if(e.startsWith("#")){const t=e.slice(1),i=document.createElement("div");return i.id=t,document.body.appendChild(i),i}}let t=document.getElementById(Te);return t||(t=document.createElement("div"),t.id=Te,document.body.appendChild(t)),t}(t);return i?(i.appendChild(e),()=>{e.parentNode===i&&i.removeChild(e),i.id!==Te&&0===i.children.length&&i.parentNode&&i.parentNode.removeChild(i)}):()=>{}}}}function $e(e){const t=le(_e),i=e??t;if(!i)throw new Error("useModalZIndex: No modal ID provided and no modal context found. Either pass a modal ID or use this hook inside a Modal component.");return{get zIndex(){const e=h(i);return((null==e?void 0:e.zIndex)??u().zIndex.base)+1},get portalTarget(){return u().portalTarget}}}function Se(){function t(e,t,i){return"undefined"==typeof window?()=>{}:(window.addEventListener(e,t,i),()=>{window.removeEventListener(e,t,i)})}return{addListener:t,addListenerEffect:function(i,n,o){e.user_effect(()=>{if("undefined"!=typeof window)return t(i,n,o)})}}}var He=e.from_html('<div style="display: contents;"><!></div>');function Oe(t,i){e.push(i,!0);let n=e.prop(i,"target",3,"body"),o=null,r=null;const{mount:s}=Le();ge(()=>(o&&(r=s(o,n())),()=>{null==r||r()}));var a=He(),d=e.child(a);e.snippet(d,()=>i.children),e.reset(a),e.bind_this(a,e=>o=e,()=>o),e.append(t,a),e.pop()}var Xe=e.from_html('<button type="button" aria-label="Minimize"></button>'),Ye=e.from_html('<button type="button" class="modal-header-light modal-header-light-style" aria-label="Toggle style"></button>'),Fe=e.from_html('<div class="modal-header-icon"><!></div>'),We=e.from_html('<div class="modal-header-icon"><!></div>'),Ae=e.from_html('<h2 class="modal-header-title"> </h2>'),qe=e.from_html('<h2 class="modal-header-title"> </h2>'),je=e.from_html('<div class="modal-header-traffic-lights"><button type="button" class="modal-header-light modal-header-light-close" aria-label="Close"></button> <!> <!></div> <div class="modal-header-mac-center"><!> <div class="modal-header-title-group"><!></div></div> <div class="modal-header-mac-spacer"></div>',1),Ne=e.from_html('<div class="modal-header-icon"><!></div>'),Ge=e.from_html('<div class="modal-header-icon"><!></div>'),Ke=e.from_html('<h2 class="modal-header-title"> </h2>'),Ue=e.from_html('<h2 class="modal-header-title"> </h2>'),Ve=e.from_html('<button type="button" class="modal-header-btn-windows modal-header-btn-windows-style" aria-label="Toggle style">&#9671;</button>'),Ze=e.from_html('<button type="button" aria-label="Minimize">&#8211;</button>'),Je=e.from_html('<div class="modal-header-title-group"><!> <!></div> <div class="modal-header-actions"><!> <!> <button type="button" class="modal-header-btn-windows modal-header-btn-windows-close" aria-label="Close">&times;</button></div>',1),Qe=e.from_html("<header><!></header>");function et(t,i){e.push(i,!0);let n=e.prop(i,"isTransparent",3,!1),o=e.prop(i,"headerLayout",3,"macos"),r=e.prop(i,"minimizable",3,!0),s=e.prop(i,"minimizeDisabled",3,!1),a=e.prop(i,"transparencyEnabled",3,!0);const d=le(xe),l=e.derived(()=>null==d?void 0:d()),g=e.derived(()=>"macos"===o());var c=Qe();let u;c.__pointerdown=function(e){var t;e.target.closest("button")||null==(t=i.onStartDrag)||t.call(i,e)};var p=e.child(c),h=t=>{var n=je(),o=e.first_child(n),d=e.child(o);d.__click=function(...e){var t;null==(t=i.onClose)||t.apply(this,e)};var g=e.sibling(d,2),c=t=>{var n=Xe();let o;n.__click=function(...e){var t;null==(t=s()?void 0:i.onMinimize)||t.apply(this,e)},e.template_effect(()=>{o=e.set_class(n,1,"modal-header-light modal-header-light-minimize",null,o,{"modal-header-light-disabled":s()}),n.disabled=s(),e.set_attribute(n,"title",s()?"Enable dock to minimize":void 0)}),e.append(t,n)};e.if(g,e=>{r()&&e(c)});var u=e.sibling(g,2),p=t=>{var n=Ye();n.__click=function(...e){var t;null==(t=i.onToggleStyle)||t.apply(this,e)},e.append(t,n)};e.if(u,e=>{a()&&e(p)}),e.reset(o);var h=e.sibling(o,2),m=e.child(h),f=t=>{var n=Fe(),o=e.child(n);e.snippet(o,()=>i.customIcon),e.reset(n),e.append(t,n)},v=t=>{var n=e.comment(),o=e.first_child(n),r=t=>{var n=We(),o=e.child(n);e.snippet(o,()=>e.get(l),()=>i.icon),e.reset(n),e.append(t,n)};e.if(o,t=>{i.icon&&e.get(l)&&t(r)},!0),e.append(t,n)};e.if(m,e=>{i.customIcon?e(f):e(v,!1)});var w=e.sibling(m,2),y=e.child(w),x=t=>{var n=Ae(),o=e.child(n,!0);e.reset(n),e.template_effect(()=>{e.set_attribute(n,"id",i.titleId),e.set_text(o,i.title)}),e.append(t,n)},_=t=>{var n=qe(),o=e.child(n,!0);e.reset(n),e.template_effect(()=>e.set_text(o,i.title)),e.append(t,n)};e.if(y,e=>{i.titleId?e(x):e(_,!1)}),e.reset(w),e.reset(h),e.next(2),e.append(t,n)},m=t=>{var n=Je(),o=e.first_child(n),d=e.child(o),g=t=>{var n=Ne(),o=e.child(n);e.snippet(o,()=>i.customIcon),e.reset(n),e.append(t,n)},c=t=>{var n=e.comment(),o=e.first_child(n),r=t=>{var n=Ge(),o=e.child(n);e.snippet(o,()=>e.get(l),()=>i.icon),e.reset(n),e.append(t,n)};e.if(o,t=>{i.icon&&e.get(l)&&t(r)},!0),e.append(t,n)};e.if(d,e=>{i.customIcon?e(g):e(c,!1)});var u=e.sibling(d,2),p=t=>{var n=Ke(),o=e.child(n,!0);e.reset(n),e.template_effect(()=>{e.set_attribute(n,"id",i.titleId),e.set_text(o,i.title)}),e.append(t,n)},h=t=>{var n=Ue(),o=e.child(n,!0);e.reset(n),e.template_effect(()=>e.set_text(o,i.title)),e.append(t,n)};e.if(u,e=>{i.titleId?e(p):e(h,!1)}),e.reset(o);var m=e.sibling(o,2),f=e.child(m),v=t=>{var n=Ve();n.__click=function(...e){var t;null==(t=i.onToggleStyle)||t.apply(this,e)},e.append(t,n)};e.if(f,e=>{a()&&e(v)});var w=e.sibling(f,2),y=t=>{var n=Ze();let o;n.__click=function(...e){var t;null==(t=s()?void 0:i.onMinimize)||t.apply(this,e)},e.template_effect(()=>{o=e.set_class(n,1,"modal-header-btn-windows",null,o,{"modal-header-btn-windows-disabled":s()}),n.disabled=s(),e.set_attribute(n,"title",s()?"Enable dock to minimize":void 0)}),e.append(t,n)};e.if(w,e=>{r()&&e(y)}),e.sibling(w,2).__click=function(...e){var t;null==(t=i.onClose)||t.apply(this,e)},e.reset(m),e.append(t,n)};e.if(p,t=>{e.get(g)?t(h):t(m,!1)}),e.reset(c),e.template_effect(()=>u=e.set_class(c,1,"modal-header",null,u,{"modal-header-draggable":!!i.onStartDrag,transparent:n()})),e.append(t,c),e.pop()}e.delegate(["pointerdown","click"]);var tt=e.from_html("<div></div>"),it=e.from_html('<div class="modal-resize-handles"></div>');function nt(t,i){e.push(i,!0);const n=["n","s","e","w","ne","nw","se","sw"];var o=e.comment(),r=e.first_child(o),s=t=>{var o=it();e.each(o,21,()=>n,e.index,(t,n)=>{var o=tt();o.__pointerdown=t=>function(e,t){var n;null==(n=i.onStartResize)||n.call(i,e,t)}(t,e.get(n)),e.template_effect(()=>e.set_class(o,1,`modal-resize-handle modal-resize-${e.get(n)??""}`)),e.append(t,o)}),e.reset(o),e.append(t,o)};e.if(r,e=>{i.onStartResize&&e(s)}),e.append(t,o),e.pop()}function ot(e,t){return t&&e.appendChild(t),{update(t){e.innerHTML="",t&&e.appendChild(t)},destroy(){e.innerHTML=""}}}e.delegate(["pointerdown"]);var rt=e.from_html('<div class="modal-footer"><!></div>'),st=e.from_html("<div></div>"),at=e.from_html('<div role="dialog" aria-modal="true" tabindex="-1"><!> <div class="modal-body"><!></div> <!> <!> <!></div>');function dt(t,i){e.push(i,!0);let n=e.prop(i,"maxWidth",3,"600px"),o=e.prop(i,"autoOpen",3,!1),a=e.prop(i,"closeOnEscape",3,!0),l=e.state(!1);ge(()=>{Z({id:i.id,title:i.title,icon:i.icon??"",isOpen:o(),isMinimized:!1,isHiddenWithParent:!1,isTransparent:!1,isRejected:!1,position:null,size:null,hasBeenDragged:!1,dockPosition:0,glow:i.glow??null,parentId:void 0,childId:void 0,offsetFromParent:void 0}),e.set(l,!0)}),pe(()=>{b(i.id)});const c=e.derived(()=>{if(!e.get(l))return!1;f();const t=h(i.id);return!!t&&(t.isOpen||t.isMinimized||S(i.id)||v(i.id)||w(i.id))});var te=e.comment(),ie=e.first_child(te),ne=t=>{!function(t,i){e.push(i,!0);let n=e.prop(i,"maxWidth",3,"600px"),o=e.prop(i,"autoOpen",3,!1),a=e.prop(i,"closeOnEscape",3,!0),l=e.prop(i,"skipRegistration",3,!1);ce(_e,()=>i.id);const c=u().portalTarget,te=e.derived(()=>p(i.id));function ie(e){var t,n;return(null==(n=null==(t=i.config)?void 0:t.features)?void 0:n[e])??z(e)}const ne=e.derived(()=>(m(),ie("drag"))),oe=e.derived(()=>(m(),ie("minimize"))),re=e.derived(()=>(m(),!ie("dock"))),se=e.derived(()=>(m(),ie("transparency"))),ae=e.derived(()=>(m(),ie("resize"))),de=e.derived(()=>{var e,t;return m(),(null==(t=null==(e=i.config)?void 0:e.appearance)?void 0:t.headerLayout)??u().appearance.headerLayout});let le=e.state(null),he=e.state(!1),me=e.state(!1),fe=e.state(!1),ve=e.state(!1),we=e.state(!1);const ye=e.derived(()=>(f(),h(i.id))),xe=e.derived(()=>e.get(ye)&&(e.get(ye).isOpen||v(i.id))&&(!e.get(ye).isMinimized||w(i.id))&&!e.get(ye).isHiddenWithParent),be=e.derived(()=>{var t;return!!(null==(t=e.get(ye))?void 0:t.childId)}),ze=e.derived(()=>{var t;return!!(null==(t=e.get(ye))?void 0:t.parentId)}),Me=e.derived(()=>e.get(be)||e.get(me)),Ie=e.derived(()=>!!i.glow),Ce=e.derived(()=>`modal-title-${e.get(te)}`),Ee=e.derived(()=>{var t;return(null==(t=e.get(ye))?void 0:t.zIndex)??1e3}),Re=ke({x:0,y:0});let Te=e.state(!1);const Le=De(()=>e.get(le),()=>Re.position,e=>Re.setPosition(e),()=>Re.hasBeenDragged,e=>Re.setHasBeenDragged(e),(t,n)=>{const o=h(i.id);if(null==o?void 0:o.parentId){const t=h(o.parentId),r=document.querySelector(`[data-modal-id="${p(o.parentId)}"]`);if(t&&r){const o=t.position??{x:r.getBoundingClientRect().left,y:r.getBoundingClientRect().top},s=t.size??{width:r.offsetWidth,height:r.offsetHeight},a={x:o.x+(s.width-n.width)/2,y:o.y+(s.height-n.height)/2};e.set(Te,!0),Re.setPosition(a);const d={x:a.x-o.x,y:a.y-o.y};return C(i.id,{position:a,size:n,hasBeenDragged:!0,offsetFromParent:d}),void setTimeout(()=>{e.set(Te,!1)},200)}}C(i.id,{position:t,size:n,hasBeenDragged:!0})}),$e=Be(()=>i.id,()=>e.get(le),()=>Re.position,e=>Re.setPosition(e),()=>Re.hasBeenDragged,e=>Re.setHasBeenDragged(e),()=>Le.hasBeenResized,()=>Le.size,(e,t,n)=>{C(i.id,{position:e,size:n,hasBeenDragged:t}),r(i.id)}),{trapFocus:Se,focusFirstElement:He}=Pe(),Xe=e.derived(()=>$e.isMinimizing||$e.isRestoring||$e.isOpening||$e.isClosing),Ye=e.derived(()=>(y(i.id)||x(i.id))&&!$e.isRestoring);let Fe=e.state(!1);const We=e.derived(()=>$e.isRestoring||$e.isOpening||e.get(Fe)),Ae=e.derived(()=>e.get(xe)&&!Re.hasBeenDragged&&!e.get(Xe)&&!$e.pendingOpenSource&&!e.get(Ye)),qe=e.derived(()=>{const t=[];return t.push(`z-index: ${e.get(Ee)};`),$e.animationTransform?(t.push(`left: ${Re.position.x}px; top: ${Re.position.y}px;`),t.push(`--genie-origin-x: ${$e.animationTransform.originX}px;`),t.push(`--genie-origin-y: ${$e.animationTransform.originY}px;`),t.push(`--genie-translate-x: ${$e.animationTransform.x}px;`),t.push(`--genie-translate-y: ${$e.animationTransform.y}px;`)):Re.hasBeenDragged&&t.push(`left: ${Re.position.x}px; top: ${Re.position.y}px; transform: none;`),Le.hasBeenResized?t.push(`width: ${Le.size.width}px; height: ${Le.size.height}px; max-width: none; max-height: none;`):(i.preferredHeight&&t.push(`min-height: ${i.preferredHeight};`),n()&&t.push(`max-width: ${n()};`)),e.get(Ie)&&i.glow&&(t.push(`--modal-glow-color: ${i.glow.color};`),t.push(`--modal-glow-intensity: ${i.glow.intensity};`)),t.join(" ")});function je(){e.get(oe)&&r(i.id)}function Ne(){var e;M(i.id)&&B(i.id),s(i.id),null==(e=i.onClose)||e.call(i)}function Ge(){Q(i.id)}function Ke(t){e.get(ne)&&e.get(le)&&Re.onPointerDown(t,e.get(le))}function Ue(e){a()&&"Escape"===e.key&&J(i.id)&&(e.stopPropagation(),Ne())}function Ve(t){if(!e.get(le))return;const n=Re.isDragging,o=Le.hasBeenResized?Le.size:{width:e.get(le).offsetWidth,height:e.get(le).offsetHeight};Re.onPointerMove(t,e.get(le),o),Re.isDragging&&n&&k(i.id,Re.position,{drag:!0})}function Ze(t){if(!e.get(le))return;const n=Re.isDragging;Re.onPointerUp(t,e.get(le)),n&&!Le.justFinishedResizing&&(k(i.id,Re.position,{drag:!0}),D(i.id))}function Je(){var t;const n=u();if("smart"!==(null==(t=n.positioning)?void 0:t.strategy))return!1;const o=h(i.id),r=A();if((null==o?void 0:o.parentId)||r&&r.childId===i.id)return!1;if((null==o?void 0:o.hasBeenDragged)||(null==o?void 0:o.position))return!1;const s=e.get(le)||document.querySelector(`[data-modal-id="${e.get(te)}"]`);if(!s)return!1;const a=s.offsetWidth,d=s.offsetHeight;if(a<=0||d<=0)return!1;const l=n.positioning.modalGap??16,g=q(i.id),c=j(n.positioning.avoidElements??[]),p=N(a,d,g,{modalGap:l,avoidBounds:c});if(G(p.x,p.y,a,d,g,l)/(a*d)>.1&&g.length>0){const e=K(i.id),t=U(a,d,e,{modalGap:l});if(t&&t.existingModalMoves.size>0)return V(t.existingModalMoves),Re.setPosition(t.newModalPosition),Re.setHasBeenDragged(!0),k(i.id,t.newModalPosition,{size:{width:a,height:d}}),!0}return Re.setPosition(p),Re.setHasBeenDragged(!0),k(i.id,p,{size:{width:a,height:d}}),!0}function Qe(){ue().then(()=>ue()).then(()=>{let t=0;const i=()=>{t+=1,Je()||t>5||requestAnimationFrame(i)};e.get(le)?i():requestAnimationFrame(i)})}ge(()=>{var t;function n(){const t=h(i.id);if(!(null==t?void 0:t.position)||!e.get(le))return;if(t.parentId)return;const n=Le.hasBeenResized?Le.size.width:e.get(le).offsetWidth,o=Le.hasBeenResized?Le.size.height:e.get(le).offsetHeight;if(n<=0||o<=0)return;const r=g(t.position.x,t.position.y,n,o);(Math.abs(r.x-t.position.x)>1||Math.abs(r.y-t.position.y)>1)&&(Re.setPosition(r),k(i.id,r))}return l()||(t=o(),Z({id:i.id,title:i.title,icon:i.icon??"",isOpen:t,isMinimized:!1,isHiddenWithParent:!1,isTransparent:!1,isRejected:!1,position:null,size:null,hasBeenDragged:!1,dockPosition:0,glow:i.glow??null,parentId:void 0,childId:void 0,offsetFromParent:void 0}),t&&d(i.id)),o()&&(ue().then(()=>{e.get(le)&&He(e.get(le))}),Qe()),window.addEventListener("pointermove",Ve),window.addEventListener("pointerup",Ze),window.addEventListener("resize",n),()=>{window.removeEventListener("pointermove",Ve),window.removeEventListener("pointerup",Ze),window.removeEventListener("resize",n)}}),pe(()=>{_(i.id),l()||b(i.id)}),e.user_effect(()=>{f();const t=h(i.id);if(t){if(e.set(he,t.isTransparent,!0),!Re.isDragging&&!Le.isResizing&&t.position){const e=Re.position,i=t.position;(Math.abs(e.x-i.x)>.5||Math.abs(e.y-i.y)>.5)&&(Re.setPosition(i),t.hasBeenDragged&&Re.setHasBeenDragged(!0))}ue().then(()=>function(){var t,n;if(!h(i.id))return;if(M(i.id))return B(i.id),void(null==(t=i.onClose)||t.call(i));if(w(i.id)&&!e.get(ve)){if(e.set(ve,!0),I(),e.get(le)){const t=e.get(le).getBoundingClientRect(),n=Re.hasBeenDragged?Re.position:{x:t.left,y:t.top},o=Le.hasBeenResized?Le.size:{width:t.width,height:t.height};C(i.id,{position:n,size:o,hasBeenDragged:!0})}$e.startMinimize(void 0,()=>{E(i.id),e.set(ve,!1)})}if(x(i.id)){R(i.id);const t=h(i.id);$e.startRestore((null==t?void 0:t.position)??void 0,(null==t?void 0:t.size)??void 0),ue().then(()=>{e.get(le)&&He(e.get(le))})}if(y(i.id)){P(i.id);const e=h(i.id);$e.startRestore((null==e?void 0:e.position)??void 0,(null==e?void 0:e.size)??void 0)}v(i.id)&&(T(i.id),$e.startClose(()=>{var e;_(i.id),L(i.id),null==(e=i.onClose)||e.call(i)}));const o=$(i.id),r=!!o||!!(null==(n=h(i.id))?void 0:n.parentId);if(S(i.id)){H(i.id);const t=O(i.id)||i.openSourcePosition||null;t?($e.setPendingOpenSource(t),ue().then(()=>ue()).then(()=>{r||Je(),$e.tryStartOpenAnimation()})):r||Qe(),ue().then(()=>{e.get(le)&&He(e.get(le))})}var s;X(i.id)&&(Y(i.id),F(i.id),e.set(we,!0),setTimeout(()=>{e.set(we,!1),W(i.id)},600)),o&&e.get(le)&&(s=o.parentId,ue().then(()=>ue()).then(()=>{let t=0;const n=()=>{t+=1;const o=function(t){var n,o;const r=h(t);if(!r)return!1;const s=e.get(le)||document.querySelector(`[data-modal-id="${e.get(te)}"]`),a=document.querySelector(`[data-modal-id="${p(t)}"]`),d=null==a?void 0:a.getBoundingClientRect(),l=r.position??(d?{x:d.left,y:d.top}:null);if(!l||!s)return!1;const g=(null==(n=r.size)?void 0:n.width)??(null==a?void 0:a.offsetWidth)??(null==d?void 0:d.width)??480,c=(null==(o=r.size)?void 0:o.height)??(null==a?void 0:a.offsetHeight)??(null==d?void 0:d.height)??400,u=s.offsetWidth,m=s.offsetHeight;if(g<=0||c<=0||u<=0||m<=0)return!1;const f={x:l.x+(g-u)/2,y:l.y+(c-m)/2};return Re.setPosition(f),Re.setHasBeenDragged(!0),k(i.id,f,{size:{width:u,height:m}}),r.position&&r.size||!d||k(t,{x:d.left,y:d.top},{size:{width:g,height:c}}),ee(t,i.id),!0}(s);o||t>5||requestAnimationFrame(n)};e.get(le)?n():requestAnimationFrame(n)}))}())}}),e.user_effect(()=>{const t=h(i.id);t&&t.isTransparent!==e.get(he)&&e.set(he,t.isTransparent,!0)}),e.user_effect(()=>{if(e.get(xe)&&e.get(le)){const t=t=>function(t){e.get(le)&&Se(t,e.get(le))}(t);return e.get(le).addEventListener("keydown",t),()=>{var i;return null==(i=e.get(le))?void 0:i.removeEventListener("keydown",t)}}}),e.user_effect(()=>{!e.get(xe)&&$e.isMinimizing&&$e.forceClearMinimize()}),e.user_effect(()=>{$e.isRestoring||$e.isOpening?e.set(Fe,!0):e.get(Fe)&&requestAnimationFrame(()=>{e.set(Fe,!1)})}),e.user_effect(()=>{e.get(fe)&&!e.get(be)&&(e.set(me,!0),setTimeout(()=>{e.set(me,!1)},200)),e.set(fe,e.get(be),!0)});var tt=e.comment(),it=e.first_child(tt),dt=t=>{Oe(t,{get target(){return c},children:(t,n)=>{var o=at();let r;o.__keydown=Ue;var s=e.child(o);{let t=e.derived(()=>e.get(ne)?Ke:void 0);et(s,{get title(){return i.title},get customIcon(){return i.customIcon},get icon(){return i.icon},get isTransparent(){return e.get(he)},get titleId(){return e.get(Ce)},get headerLayout(){return e.get(de)},get onStartDrag(){return e.get(t)},onToggleStyle:Ge,onMinimize:je,onClose:Ne,get minimizable(){return e.get(oe)},get minimizeDisabled(){return e.get(re)},get transparencyEnabled(){return e.get(se)}})}var a=e.sibling(s,2),l=e.child(a);e.snippet(l,()=>i.children??e.noop),e.reset(a),e.action(a,(e,t)=>null==ot?void 0:ot(e,t),()=>i.bodyElement);var g=e.sibling(a,2),c=t=>{var n=rt(),o=e.child(n),r=t=>{var n=e.comment(),o=e.first_child(n);e.snippet(o,()=>i.footer),e.append(t,n)};e.if(o,e=>{i.footer&&e(r)}),e.reset(n),e.action(n,(e,t)=>null==ot?void 0:ot(e,t),()=>i.footerElement),e.append(t,n)};e.if(g,e=>{(i.footer||i.footerElement)&&e(c)});var u=e.sibling(g,2);{let t=e.derived(()=>e.get(ae)&&!e.get(be)?Le.handlers.startResize:void 0);nt(u,{get onStartResize(){return e.get(t)}})}var p=e.sibling(u,2),h=t=>{var i=st();let n;e.template_effect(()=>n=e.set_class(i,1,"modal-child-overlay",null,n,{"modal-overlay-closing":e.get(me)})),e.append(t,i)};e.if(p,t=>{e.get(Me)&&t(h)}),e.reset(o),e.bind_this(o,t=>e.set(le,t),()=>e.get(le)),e.template_effect(()=>{var t;r=e.set_class(o,1,"modal-dialog",null,r,{"modal-dragging":Re.isDragging,"modal-resizing":Le.isResizing,"modal-positioned":Re.hasBeenDragged,"modal-minimizing":$e.isMinimizing,"modal-restoring":$e.isRestoring,"modal-opening":$e.isOpening,"modal-closing":$e.isClosing,"modal-centered":e.get(Ae),"modal-solid":!e.get(he),"modal-transparent":e.get(he),"modal-glow":e.get(Ie),"modal-has-child":e.get(be),"modal-is-child":e.get(ze),"modal-visible-by-animation":e.get(We),"modal-animating-to-center":e.get(Te),"modal-animating-position":null==(t=e.get(ye))?void 0:t.isAnimatingPosition,"modal-attention":e.get(we)}),e.set_attribute(o,"data-modal-id",e.get(te)),e.set_style(o,e.get(qe)),e.set_attribute(o,"aria-labelledby",e.get(Ce))}),e.event("pointerdown",o,()=>d(i.id),!0),e.append(t,o)},$$slots:{default:!0}})};e.if(it,t=>{e.get(xe)&&t(dt)}),e.append(t,tt),e.pop()}(t,{get id(){return i.id},get title(){return i.title},get icon(){return i.icon},get customIcon(){return i.customIcon},get maxWidth(){return n()},get preferredHeight(){return i.preferredHeight},get autoOpen(){return o()},get openSourcePosition(){return i.openSourcePosition},get glow(){return i.glow},get config(){return i.config},get closeOnEscape(){return a()},get onClose(){return i.onClose},get children(){return i.children},get footer(){return i.footer},skipRegistration:!0})};e.if(ie,t=>{e.get(c)&&t(ne)}),e.append(t,te),e.pop()}e.delegate(["keydown"]);var lt=e.from_html('<button type="button" aria-label="Drag dock"></button>'),gt=e.from_html('<span class="modal-dock-item-icon-placeholder"> </span>'),ct=e.from_html('<span class="modal-dock-item-label"> </span>'),ut=e.from_html("<span>+</span>"),pt=e.from_html('<span class="modal-dock-child-indicator"><!></span>'),ht=e.from_html('<button><span class="modal-dock-item-icon"><!></span> <!> <span class="modal-dock-item-glow"></span> <!></button>'),mt=e.from_html('<div data-dock-container="true"><div><!> <!></div></div>');function ft(t,i){e.push(i,!0);const n=le(xe),r=e.derived(()=>i.renderIcon??(null==n?void 0:n())),s=ie(),a=e.derived(()=>(m(),u())),d=e.derived(()=>te("DOCK")),l=e.derived(()=>e.get(a).dock.position),c=e.derived(()=>e.get(a).dock.labelMode);let h=e.state("horizontal"),v=e.state(e.proxy({x:100,y:100})),w=e.state(null),y=e.state(!1),x={x:0,y:0},_=null;const b=e.derived(()=>(f(),Array.from(s.modals.values()).filter(e=>e.isMinimized).sort((e,t)=>e.dockPosition-t.dockPosition))),z=e.derived(()=>{switch(e.get(l)){case"left":return{x:-20,duration:250,easing:we};case"right":return{x:20,duration:250,easing:we};default:return{y:20,duration:250,easing:we}}});function k(t){var i;"free"===e.get(l)&&(e.set(y,!0),_=t.pointerId,x={x:t.clientX-e.get(v).x,y:t.clientY-e.get(v).y},null==(i=t.currentTarget)||i.setPointerCapture(t.pointerId),window.addEventListener("pointermove",D),window.addEventListener("pointerup",M),window.addEventListener("pointercancel",M))}function D(t){if(t.pointerId!==_||!e.get(w))return;const i=e.get(w).getBoundingClientRect(),n=window.innerWidth-i.width-8,o=window.innerHeight-i.height-8,r=Math.min(Math.max(t.clientX-x.x,8),Math.max(8,n)),s=Math.min(Math.max(t.clientY-x.y,8),Math.max(8,o));e.set(v,{x:Math.round(r),y:Math.round(s)},!0)}function M(t){t.pointerId===_&&(e.set(y,!1),_=null,window.removeEventListener("pointermove",D),window.removeEventListener("pointerup",M),window.removeEventListener("pointercancel",M))}const{addListener:B}=Se();function I(){if("free"!==e.get(l)||!e.get(w))return;const t=e.get(w).getBoundingClientRect(),i=g(e.get(v).x,e.get(v).y,t.width,t.height);i.x===e.get(v).x&&i.y===e.get(v).y||e.set(v,{x:Math.round(i.x),y:Math.round(i.y)},!0)}e.user_effect(()=>{"undefined"!=typeof window&&B("resize",I)});var C={setDockOrientation:function(t){e.set(h,t,!0)},setDockFreePosition:function(t){e.set(v,t,!0)},getDockState:function(){return{dockPosition:e.get(l),dockOrientation:e.get(h),dockFreePosition:e.get(v),dockLabelMode:e.get(c)}}};return Oe(t,{get target(){return e.get(a).portalTarget},children:(t,i)=>{var n=mt();let a,g;var u=e.child(n);let m;var f=e.child(u),x=t=>{var i=lt();let n;i.__pointerdown=k,e.template_effect(()=>n=e.set_class(i,1,"modal-dock-handle",null,n,{"modal-dock-handle-dragging":e.get(y)})),e.append(t,i)};e.if(f,t=>{"free"===e.get(l)&&t(x)});var _=e.sibling(f,2);e.each(_,19,()=>e.get(b),e=>e.id,(t,i,n)=>{const a=e.derived(()=>e.get(i).lastChildId?s.modals.get(e.get(i).lastChildId):null);var d=ht();let l;d.__click=t=>{ne(e.get(i).id)?oe(t.currentTarget):o(e.get(i).id)};var g=e.child(d),u=e.child(g),h=t=>{var n=e.comment(),o=e.first_child(n);e.snippet(o,()=>e.get(r),()=>e.get(i).icon),e.append(t,n)},m=t=>{var n=gt(),o=e.child(n,!0);e.reset(n),e.template_effect(t=>e.set_text(o,t),[()=>e.get(i).title.charAt(0)]),e.append(t,n)};e.if(u,t=>{e.get(i).icon&&e.get(r)?t(h):t(m,!1)}),e.reset(g);var f=e.sibling(g,2),v=t=>{var n=ct(),o=e.child(n,!0);e.reset(n),e.template_effect(()=>e.set_text(o,e.get(i).title)),e.append(t,n)};e.if(f,t=>{"hidden"!==e.get(c)&&t(v)});var w=e.sibling(f,4),y=t=>{var i=pt(),n=e.child(i),o=t=>{var i=e.comment(),n=e.first_child(i);e.snippet(n,()=>e.get(r),()=>e.get(a).icon),e.append(t,i)},s=t=>{var i=ut();e.append(t,i)};e.if(n,t=>{e.get(a).icon&&e.get(r)?t(o):t(s,!1)}),e.reset(i),e.append(t,i)};e.if(w,t=>{e.get(i).lastChildId&&e.get(a)&&t(y)}),e.reset(d),e.template_effect(t=>{l=e.set_class(d,1,"modal-dock-item",null,l,{"modal-dock-item-has-glow":!!e.get(i).glow,"modal-dock-item-has-child":!!e.get(i).lastChildId,"modal-dock-item-label-beside":"beside"===e.get(c),"modal-dock-item-label-below":"below"===e.get(c)}),e.set_attribute(d,"data-modal-id",t),e.set_style(d,e.get(i).glow?`--modal-dock-glow-color: ${e.get(i).glow.color};`:"")},[()=>p(e.get(i).id)]),e.transition(3,d,()=>me,()=>({duration:300,delay:50*e.get(n),easing:ye,start:.5})),e.append(t,d)}),e.reset(u),e.reset(n),e.bind_this(n,t=>e.set(w,t),()=>e.get(w)),e.template_effect(()=>{a=e.set_class(n,1,"modal-dock-container",null,a,{"modal-dock-left":"left"===e.get(l),"modal-dock-right":"right"===e.get(l),"modal-dock-bottom":"bottom"===e.get(l),"modal-dock-free":"free"===e.get(l),"modal-dock-empty":0===e.get(b).length}),g=e.set_style(n,"free"===e.get(l)?`left: ${e.get(v).x}px; top: ${e.get(v).y}px;`:"",g,{"z-index":e.get(d)}),m=e.set_class(u,1,"modal-dock",null,m,{"modal-dock-free-horizontal":"free"===e.get(l)&&"horizontal"===e.get(h),"modal-dock-free-vertical":"free"===e.get(l)&&"vertical"===e.get(h)})}),e.transition(3,n,()=>fe,()=>e.get(b).length>0?e.get(z):{duration:0}),e.append(t,n)},$$slots:{default:!0}}),e.pop(C)}e.delegate(["pointerdown","click"]);var vt=e.from_html('<div class="modal-backdrop svelte-1d3nq4t" aria-hidden="true"></div>');function wt(t,i){e.push(i,!0);const n=ie(),o=e.derived(()=>(m(),u())),r=e.derived(()=>e.get(o).features.backdrop),s=e.derived(()=>(f(),Array.from(n.modals.values()).some(e=>e.isOpen&&!e.isMinimized&&!e.isHiddenWithParent))),a=e.derived(()=>e.get(r)&&e.get(s)),d=e.derived(()=>te("MODAL")-1);Oe(t,{get target(){return e.get(o).portalTarget},children:(t,i)=>{var n=e.comment(),o=e.first_child(n),r=t=>{var i=vt();let n;e.template_effect(()=>n=e.set_style(i,"",n,{"z-index":e.get(d)})),e.transition(3,i,()=>ve,()=>({duration:200})),e.append(t,i)};e.if(o,t=>{e.get(a)&&t(r)}),e.append(t,n)},$$slots:{default:!0}}),e.pop()}var yt=e.from_html("<!> <!>",1);function xt(t,i){e.push(i,!0),ce(xe,()=>i.renderIcon),e.user_effect(()=>(he(()=>{i.config&&re(i.config),se()}),()=>{ae(),de()})),e.user_effect(()=>{if("undefined"==typeof document)return;const e=he(()=>u().portalTarget);if("string"==typeof e&&!document.querySelector(e)){const t=document.createElement("div");return t.id=e.replace("#",""),document.body.appendChild(t),()=>{t.remove()}}});var n=yt(),o=e.first_child(n);wt(o,{});var r=e.sibling(o,2);e.snippet(r,()=>i.children??e.noop),e.append(t,n),e.pop()}export{wt as B,ft as D,dt as M,Oe as P,nt as R,xt as a,et as b,ke as c,De as d,Be as e,Re as f,Pe as g,Le as h,$e as i,Se as j,Ee as t,ze as u};
package/dist/vanilla.js CHANGED
@@ -1 +1 @@
1
- import{m as o,x as t,a as n,s as e,i as r,g as s,D as a,B as d}from"./runtime.js";import{l as c,q as i,e as l,v as u,p,f,j as m,o as y,h as g,w as M}from"./runtime.js";function b(e){const{content:r,footer:s,icon:a,...d}=e,c=o(t,{target:document.body,props:{...d,children:r?()=>v(r):void 0,footer:s?()=>v(s):void 0,icon:a?()=>v(a):void 0}});return{destroy:()=>n(c)}}function k(){const t=o(a,{target:document.body,props:{}});return{destroy:()=>n(t)}}function v(o){if("string"==typeof o){const t=document.createElement("div");return t.innerHTML=o,t}return o}function T(){const t=o(d,{target:document.body,props:{}});return{destroy:()=>n(t)}}function h(o={}){const{config:t}=o;t&&e(t),r();const n=s(),a=o.backdrop??n.features.backdrop?T():null,d=o.dock??n.features.dock?k():null;return{backdrop:a,dock:d,destroy:()=>{null==a||a.destroy(),null==d||d.destroy()}}}export{c as bringToFront,i as closeAllModals,l as closeModal,T as createBackdrop,k as createDock,b as createModal,s as getConfig,h as init,u as isModalOpen,p as isModalRegistered,f as minimizeModal,m as openChildModal,y as openModal,g as restoreModal,e as setConfig,M as toggleModalTransparency};
1
+ import{m as o,v as t,a as n,s as e,i as r,g as s,D as a,B as d}from"./runtime.js";import{l as c,x as i,e as l,w as u,q as p,f,j as m,o as y,h as g,y as M}from"./runtime.js";function b(e){const{content:r,footer:s,icon:a,...d}=e,c=o(t,{target:document.body,props:{...d,children:r?()=>v(r):void 0,footer:s?()=>v(s):void 0,icon:a?()=>v(a):void 0}});return{destroy:()=>n(c)}}function k(){const t=o(a,{target:document.body,props:{}});return{destroy:()=>n(t)}}function v(o){if("string"==typeof o){const t=document.createElement("div");return t.innerHTML=o,t}return o}function T(){const t=o(d,{target:document.body,props:{}});return{destroy:()=>n(t)}}function h(o={}){const{config:t}=o;t&&e(t),r();const n=s(),a=o.backdrop??n.features.backdrop?T():null,d=o.dock??n.features.dock?k():null;return{backdrop:a,dock:d,destroy:()=>{null==a||a.destroy(),null==d||d.destroy()}}}export{c as bringToFront,i as closeAllModals,l as closeModal,T as createBackdrop,k as createDock,b as createModal,s as getConfig,h as init,u as isModalOpen,p as isModalRegistered,f as minimizeModal,m as openChildModal,y as openModal,g as restoreModal,e as setConfig,M as toggleModalTransparency};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "epic-modals",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "A stunning modal library with macOS-style animations, drag, resize, and dock. Supports Svelte 5, React, and vanilla JS.",
5
5
  "keywords": [
6
6
  "modal",