studiograph 1.3.18 → 1.3.19
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.
- package/dist/web/_app/immutable/chunks/CIZkRAuY.js +1 -0
- package/dist/web/_app/immutable/chunks/{buWG8Dmo.js → CnKc_Tae.js} +1 -1
- package/dist/web/_app/immutable/chunks/DKIqe64p.js +64 -0
- package/dist/web/_app/immutable/chunks/{BnR489ON.js → DVuLyxG5.js} +1 -1
- package/dist/web/_app/immutable/chunks/{DPUtMAph.js → Scb_NG-a.js} +1 -1
- package/dist/web/_app/immutable/chunks/{Co733CqR.js → glgUBDR2.js} +1 -1
- package/dist/web/_app/immutable/entry/{app.C2utD9VR.js → app.DjTkwlaQ.js} +2 -2
- package/dist/web/_app/immutable/entry/start.Bupokdng.js +1 -0
- package/dist/web/_app/immutable/nodes/{0.DuPJX0GV.js → 0.Q3C-jhjE.js} +1 -1
- package/dist/web/_app/immutable/nodes/{1.Dt07KQlA.js → 1.BPCfgPXb.js} +1 -1
- package/dist/web/_app/immutable/nodes/{2.Bnr_OdSr.js → 2.Bdsd2uts.js} +1 -1
- package/dist/web/_app/immutable/nodes/{3.BykUKLNZ.js → 3.Doh56lgy.js} +3 -3
- package/dist/web/_app/immutable/nodes/{4.0CDHy-v0.js → 4.CD5YzRYT.js} +1 -1
- package/dist/web/_app/immutable/nodes/{5.BKd9g3uI.js → 5.DN4bEWf-.js} +1 -1
- package/dist/web/_app/immutable/nodes/{6.DMZp6xfS.js → 6.BfA9chPb.js} +1 -1
- package/dist/web/_app/immutable/nodes/{7.B9Bv_Jv7.js → 7.DhU0-U33.js} +1 -1
- package/dist/web/_app/immutable/nodes/{8.CbGhzI30.js → 8.wSRycWoC.js} +1 -1
- package/dist/web/_app/version.json +1 -1
- package/dist/web/index.html +6 -6
- package/package.json +1 -1
- package/dist/web/_app/immutable/chunks/BeqErRmy.js +0 -1
- package/dist/web/_app/immutable/chunks/CSTvkpxy.js +0 -64
- package/dist/web/_app/immutable/entry/start.CxneN6NR.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/BaUG0bh_.js","../chunks/DJKRyj_1.js","../chunks/8FUQuwgM.js","../chunks/CbJfRYJV.js","../chunks/CqkleIqs.js","../chunks/DnL9f0lc.js","../chunks/CX_61fY8.js","../chunks/CscoF-YL.js","../chunks/D7ZqAKi9.js","../chunks/C7VoTosa.js","../chunks/CrdV0ttd.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as Nt,_ as jt}from"../chunks/DJKRyj_1.js";import{a as s,f as rt,q as Qt,o as xt,g as qt,e as an,c as y,j as sn,t as Re,s as ie,r as Ut}from"../chunks/0x0awhVy.js";import{q as ht,w as it,z as $,A as nt,v as mt,br as cn,t as He,bs as Pe,F as B,a7 as Rt,a as ct,D as c,g as e,b as Xt,R as Ce,x as Mt,T as m,aF as J,f as g,u as Ge,bt as De,bp as ln,B as un,$ as dn}from"../chunks/8FUQuwgM.js";import{j as _t,s as bt,g as A,i as Se,e as U,d as Me,S as fn,a as re,w as We}from"../chunks/EDLlAC9C.js";import{h as hn}from"../chunks/C7R6dA2m.js";import{g as Ee}from"../chunks/BeqErRmy.js";import{e as le,t as Z,c as yt,S as mn,b as gn,i as vn,n as wn,r as Fe}from"../chunks/Co733CqR.js";import{p as k,i as L,b as Qe,s as kt,r as Ct}from"../chunks/CbJfRYJV.js";import"../chunks/Bl1mtM70.js";const yn=Array(12).fill(0);var _n=rt('<div class="sonner-loading-bar"></div>'),bn=rt('<div><div class="sonner-spinner"></div></div>');function xn(n,t){ht(t,!0);var o=bn(),i=it(o);le(i,23,()=>yn,(r,u)=>`spinner-bar-${u}`,(r,u)=>{var a=_n();s(r,a)}),$(i),$(o),nt(r=>{bt(o,1,r),A(o,"data-visible",t.visible)},[()=>_t(["sonner-loading-wrapper",t.class].filter(Boolean).join(" "))]),s(n,o),mt()}const In=typeof window<"u"?window:void 0;function Tn(n){let t=n.activeElement;for(;t?.shadowRoot;){const o=t.shadowRoot.activeElement;if(o===t)break;t=o}return t}class Sn{#e;#t;constructor(t,o){this.#e=t,this.#t=Qt(o)}get current(){return this.#t(),this.#e()}}const En=/\(.+\)/,An=new Set(["all","print","screen","and","or","not","only"]);class kn extends Sn{constructor(t,o){let i=En.test(t)||t.split(/[\s,]+/).some(u=>An.has(u.trim()))?t:`(${t})`;const r=window.matchMedia(i);super(()=>r.matches,u=>xt(r,"change",u))}}let Bn=class{#e;#t;constructor(t={}){const{window:o=In,document:i=o?.document}=t;o!==void 0&&(this.#e=i,this.#t=Qt(r=>{const u=xt(o,"focusin",r),a=xt(o,"focusout",r);return()=>{u(),a()}}))}get current(){return this.#t?.(),this.#e?Tn(this.#e):null}};new Bn;class Pn{#e;#t;constructor(t){this.#e=t,this.#t=Symbol(t)}get key(){return this.#t}exists(){return cn(this.#t)}get(){const t=He(this.#t);if(t===void 0)throw new Error(`Context "${this.#e}" not found`);return t}getOr(t){const o=He(this.#t);return o===void 0?t:o}set(t){return Pe(this.#t,t)}}const Mn=new Pn("<Toaster/>");function ae(n){return n.label!==void 0}function Cn(){let n=B(Rt(typeof document<"u"?document.hidden:!1));return ct(()=>xt(document,"visibilitychange",()=>{c(n,document.hidden,!0)})),{get current(){return e(n)}}}const Ve=4e3,Dn=14,Ln=45,On=200,zn=.05,Nn={toast:"",title:"",description:"",loader:"",closeButton:"",cancelButton:"",actionButton:"",action:"",warning:"",error:"",success:"",default:"",info:"",loading:""};function Rn(n){const[t,o]=n.split("-"),i=[];return t&&i.push(t),o&&i.push(o),i}function je(n){return 1/(1.5+Math.abs(n)/20)}var Hn=rt("<div><!></div>"),Wn=rt('<button data-close-button=""><!></button>'),Fn=rt('<div data-icon=""><!> <!></div>'),Vn=rt('<div data-description=""><!></div>'),jn=rt('<button data-button="" data-cancel=""> </button>'),qn=rt('<button data-button=""> </button>'),Un=rt('<!> <div data-content=""><div data-title=""><!></div> <!></div> <!> <!>',1),Kn=rt('<li aria-atomic="true" data-sonner-toast=""><!> <!></li>');function Yn(n,t){ht(t,!0);const o=h=>{var w=y(),T=g(w);{var M=E=>{var K=Hn(),zt=it(K);U(zt,()=>t.loadingIcon),$(K),nt(Yt=>{bt(K,1,Yt),A(K,"data-visible",e(z)==="loading")},[()=>_t(yt(e(ot)?.loader,t.toast?.classes?.loader,"sonner-loader"))]),s(E,K)},C=E=>{{let K=m(()=>yt(e(ot)?.loader,t.toast.classes?.loader)),zt=m(()=>e(z)==="loading");xn(E,{get class(){return e(K)},get visible(){return e(zt)}})}};L(T,E=>{t.loadingIcon?E(M):E(C,!1)})}s(h,w)};let i=k(t,"cancelButtonStyle",3,""),r=k(t,"actionButtonStyle",3,""),u=k(t,"descriptionClass",3,""),a=k(t,"unstyled",3,!1),_=k(t,"defaultRichColors",3,!1);const v={...Nn};let P=B(!1),O=B(!1),at=B(!1),j=B(!1),st=B(!1),R=B(0),tt=B(0),lt=t.toast.duration||t.duration||Ve,X=B(void 0),q=B(null),Ht=B(null);const de=m(()=>t.index===0),fe=m(()=>t.index+1<=t.visibleToasts),z=m(()=>t.toast.type),et=m(()=>t.toast.dismissible!==void 0?t.toast.dismissible!==!1:t.toast.dismissable!==!1),Wt=m(()=>t.toast.class||""),Dt=m(()=>t.toast.descriptionClass||""),It=m(()=>Z.heights.findIndex(h=>h.toastId===t.toast.id)||0),Tt=m(()=>t.toast.closeButton??t.closeButton),Lt=m(()=>t.toast.duration??t.duration??Ve);let Bt=null;const pt=m(()=>t.position.split("-")),he=m(()=>Z.heights.reduce((h,w,T)=>T>=e(It)?h:h+w.height,0)),me=Cn(),ge=m(()=>t.toast.invert||t.invert),Kt=m(()=>e(z)==="loading"),ot=m(()=>({...v,...t.classes})),ve=m(()=>t.toast.title),we=m(()=>t.toast.description);let St=B(0),$t=B(0);const Ft=m(()=>Math.round(e(It)*Dn+e(he)));ct(()=>{e(ve),e(we);let h;t.expanded||t.expandByDefault?h=1:h=1-t.index*zn;const w=Xt(()=>e(X));if(w===void 0)return;w.style.setProperty("height","auto");const T=w.offsetHeight,M=w.getBoundingClientRect().height,C=Math.round(M/h+Number.EPSILON&100)/100;w.style.removeProperty("height");let E;Math.abs(C-T)<1?E=C:E=T,c(tt,E,!0),Z.setHeight({toastId:t.toast.id,height:E})});function l(){c(O,!0),c(R,e(Ft),!0),Z.removeHeight(t.toast.id),setTimeout(()=>{Z.remove(t.toast.id)},On)}let H;const gt=m(()=>t.toast.promise&&e(z)==="loading"||t.toast.duration===Number.POSITIVE_INFINITY);function vt(){c(St,new Date().getTime(),!0),H=setTimeout(()=>{t.toast.onAutoClose?.(t.toast),l()},lt)}function Ot(){if(e($t)<e(St)){const h=new Date().getTime()-e(St);lt=lt-h}c($t,new Date().getTime(),!0)}ct(()=>{t.toast.updated&&(clearTimeout(H),lt=e(Lt),vt())}),ct(()=>(e(gt)||(t.expanded||t.interacting||t.pauseWhenPageIsHidden&&me.current?Ot():vt()),()=>clearTimeout(H))),Ce(()=>{c(P,!0);const h=e(X)?.getBoundingClientRect().height;return c(tt,h,!0),Z.setHeight({toastId:t.toast.id,height:h}),()=>{Z.removeHeight(t.toast.id)}}),ct(()=>{t.toast.delete&&Xt(()=>{l(),t.toast.onDismiss?.(t.toast)})});const ye=h=>{if(e(Kt))return;c(R,e(Ft),!0);const w=h.target;w.setPointerCapture(h.pointerId),w.tagName!=="BUTTON"&&(c(at,!0),Bt={x:h.clientX,y:h.clientY})},ze=()=>{if(e(j)||!e(et))return;Bt=null;const h=Number(e(X)?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),w=Number(e(X)?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),T=new Date().getTime()-0,M=e(q)==="x"?h:w,C=Math.abs(M)/T;if(Math.abs(M)>=Ln||C>.11){c(R,e(Ft),!0),t.toast.onDismiss?.(t.toast),e(q)==="x"?c(Ht,h>0?"right":"left",!0):c(Ht,w>0?"down":"up",!0),l(),c(j,!0);return}else e(X)?.style.setProperty("--swipe-amount-x","0px"),e(X)?.style.setProperty("--swipe-amount-y","0px");c(st,!1),c(at,!1),c(q,null)},te=h=>{if(!Bt||!e(et)||(window.getSelection()?.toString().length??-1)>0)return;const T=h.clientY-Bt.y,M=h.clientX-Bt.x,C=t.swipeDirections??Rn(t.position);!e(q)&&(Math.abs(M)>1||Math.abs(T)>1)&&c(q,Math.abs(M)>Math.abs(T)?"x":"y",!0);let E={x:0,y:0};if(e(q)==="y"){if(C.includes("top")||C.includes("bottom"))if(C.includes("top")&&T<0||C.includes("bottom")&&T>0)E.y=T;else{const K=T*je(T);E.y=Math.abs(K)<Math.abs(T)?K:T}}else if(e(q)==="x"&&(C.includes("left")||C.includes("right")))if(C.includes("left")&&M<0||C.includes("right")&&M>0)E.x=M;else{const K=M*je(M);E.x=Math.abs(K)<Math.abs(M)?K:M}(Math.abs(E.x)>0||Math.abs(E.y)>0)&&c(st,!0),e(X)?.style.setProperty("--swipe-amount-x",`${E.x}px`),e(X)?.style.setProperty("--swipe-amount-y",`${E.y}px`)},wt=()=>{c(at,!1),c(q,null),Bt=null},Et=m(()=>t.toast.icon?t.toast.icon:e(z)==="success"?t.successIcon:e(z)==="error"?t.errorIcon:e(z)==="warning"?t.warningIcon:e(z)==="info"?t.infoIcon:e(z)==="loading"?t.loadingIcon:null);var f=Kn();A(f,"tabindex",0);let Vt;var ee=it(f);{var Ne=h=>{var w=Wn(),T=it(w);U(T,()=>t.closeIcon??J),$(w),nt(M=>{A(w,"aria-label",t.closeButtonAriaLabel),A(w,"data-disabled",e(Kt)),bt(w,1,M)},[()=>_t(yt(e(ot)?.closeButton,t.toast?.classes?.closeButton))]),qt("click",w,()=>{e(Kt)||!e(et)||(l(),t.toast.onDismiss?.(t.toast))}),s(h,w)};L(ee,h=>{e(Tt)&&!t.toast.component&&e(z)!=="loading"&&t.closeIcon!==null&&h(Ne)})}var _e=Mt(ee,2);{var be=h=>{const w=m(()=>t.toast.component);var T=y(),M=g(T);Nt(M,()=>e(w),(C,E)=>{E(C,kt(()=>t.toast.componentProps,{closeToast:l}))}),s(h,T)},xe=h=>{var w=Un(),T=g(w);{var M=x=>{var S=Fn(),d=it(S);{var D=b=>{var I=y(),p=g(I);{var W=Pt=>{var oe=y(),Te=g(oe);Nt(Te,()=>t.toast.icon,(Y,Q)=>{Q(Y,{})}),s(Pt,oe)},ft=Pt=>{o(Pt)};L(p,Pt=>{t.toast.icon?Pt(W):Pt(ft,!1)})}s(b,I)};L(d,b=>{(t.toast.promise||e(z)==="loading")&&b(D)})}var V=Mt(d,2);{var N=b=>{var I=y(),p=g(I);{var W=Y=>{var Q=y(),At=g(Q);Nt(At,()=>t.toast.icon,(on,rn)=>{rn(on,{})}),s(Y,Q)},ft=Y=>{var Q=y(),At=g(Q);U(At,()=>t.successIcon??J),s(Y,Q)},Pt=Y=>{var Q=y(),At=g(Q);U(At,()=>t.errorIcon??J),s(Y,Q)},oe=Y=>{var Q=y(),At=g(Q);U(At,()=>t.warningIcon??J),s(Y,Q)},Te=Y=>{var Q=y(),At=g(Q);U(At,()=>t.infoIcon??J),s(Y,Q)};L(p,Y=>{t.toast.icon?Y(W):e(z)==="success"?Y(ft,1):e(z)==="error"?Y(Pt,2):e(z)==="warning"?Y(oe,3):e(z)==="info"&&Y(Te,4)})}s(b,I)};L(V,b=>{t.toast.type!=="loading"&&b(N)})}$(S),nt(b=>bt(S,1,b),[()=>_t(yt(e(ot)?.icon,t.toast?.classes?.icon))]),s(x,S)};L(T,x=>{(e(z)||t.toast.icon||t.toast.promise)&&t.toast.icon!==null&&(e(Et)!==null||t.toast.icon)&&x(M)})}var C=Mt(T,2),E=it(C),K=it(E);{var zt=x=>{var S=y(),d=g(S);{var D=N=>{const b=m(()=>t.toast.title);var I=y(),p=g(I);Nt(p,()=>e(b),(W,ft)=>{ft(W,kt(()=>t.toast.componentProps))}),s(N,I)},V=N=>{var b=Re();nt(()=>ie(b,t.toast.title)),s(N,b)};L(d,N=>{typeof t.toast.title!="string"?N(D):N(V,!1)})}s(x,S)};L(K,x=>{t.toast.title&&x(zt)})}$(E);var Yt=Mt(E,2);{var Ie=x=>{var S=Vn(),d=it(S);{var D=N=>{const b=m(()=>t.toast.description);var I=y(),p=g(I);Nt(p,()=>e(b),(W,ft)=>{ft(W,kt(()=>t.toast.componentProps))}),s(N,I)},V=N=>{var b=Re();nt(()=>ie(b,t.toast.description)),s(N,b)};L(d,N=>{typeof t.toast.description!="string"?N(D):N(V,!1)})}$(S),nt(N=>bt(S,1,N),[()=>_t(yt(u(),e(Dt),e(ot)?.description,t.toast.classes?.description))]),s(x,S)};L(Yt,x=>{t.toast.description&&x(Ie)})}$(C);var ne=Mt(C,2);{var ut=x=>{var S=y(),d=g(S);{var D=b=>{var I=y(),p=g(I);Nt(p,()=>t.toast.cancel,(W,ft)=>{ft(W,{})}),s(b,I)},V=b=>{var I=jn(),p=it(I,!0);$(I),nt(W=>{Se(I,t.toast.cancelButtonStyle??i()),bt(I,1,W),ie(p,t.toast.cancel.label)},[()=>_t(yt(e(ot)?.cancelButton,t.toast?.classes?.cancelButton))]),qt("click",I,W=>{ae(t.toast.cancel)&&e(et)&&(t.toast.cancel?.onClick?.(W),l())}),s(b,I)},N=m(()=>ae(t.toast.cancel));L(d,b=>{typeof t.toast.cancel=="function"?b(D):e(N)&&b(V,1)})}s(x,S)};L(ne,x=>{t.toast.cancel&&x(ut)})}var G=Mt(ne,2);{var dt=x=>{var S=y(),d=g(S);{var D=b=>{var I=y(),p=g(I);Nt(p,()=>t.toast.action,(W,ft)=>{ft(W,{})}),s(b,I)},V=b=>{var I=qn(),p=it(I,!0);$(I),nt(W=>{Se(I,t.toast.actionButtonStyle??r()),bt(I,1,W),ie(p,t.toast.action.label)},[()=>_t(yt(e(ot)?.actionButton,t.toast?.classes?.actionButton))]),qt("click",I,W=>{ae(t.toast.action)&&(t.toast.action?.onClick(W),!W.defaultPrevented&&l())}),s(b,I)},N=m(()=>ae(t.toast.action));L(d,b=>{typeof t.toast.action=="function"?b(D):e(N)&&b(V,1)})}s(x,S)};L(G,x=>{t.toast.action&&x(dt)})}nt((x,S)=>{bt(C,1,x),bt(E,1,S)},[()=>_t(yt(e(ot)?.content,t.toast?.classes?.content)),()=>_t(yt(e(ot)?.title,t.toast?.classes?.title))]),s(h,w)};L(_e,h=>{t.toast.component?h(be):h(xe,!1)})}$(f),Qe(f,h=>c(X,h),()=>e(X)),nt((h,w,T)=>{bt(f,1,h),A(f,"aria-live",t.toast.important?"assertive":"polite"),A(f,"data-rich-colors",t.toast.richColors??_()),A(f,"data-styled",!(t.toast.component||t.toast.unstyled||a())),A(f,"data-mounted",e(P)),A(f,"data-promise",w),A(f,"data-swiped",e(st)),A(f,"data-removed",e(O)),A(f,"data-visible",e(fe)),A(f,"data-y-position",e(pt)[0]),A(f,"data-x-position",e(pt)[1]),A(f,"data-index",t.index),A(f,"data-front",e(de)),A(f,"data-swiping",e(at)),A(f,"data-dismissible",e(et)),A(f,"data-type",e(z)),A(f,"data-invert",e(ge)),A(f,"data-swipe-out",e(j)),A(f,"data-swipe-direction",e(Ht)),A(f,"data-expanded",T),Vt=Se(f,`${t.style} ${t.toast.style}`,Vt,{"--index":t.index,"--toasts-before":t.index,"--z-index":Z.toasts.length-t.index,"--offset":`${e(O)?e(R):e(Ft)}px`,"--initial-height":t.expandByDefault?"auto":`${e(tt)}px`})},[()=>_t(yt(t.class,e(Wt),e(ot)?.toast,t.toast?.classes?.toast,e(ot)?.[e(z)],t.toast?.classes?.[e(z)])),()=>!!t.toast.promise,()=>!!(t.expanded||t.expandByDefault&&e(P))]),qt("pointermove",f,te),qt("pointerup",f,ze),qt("pointerdown",f,ye),an("dragend",f,wt),s(n,f),mt()}sn(["pointermove","pointerup","pointerdown","click"]);var Zn=Ut('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-success-icon=""><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>');function Xn(n){var t=Zn();s(n,t)}var Gn=Ut('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-error-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>');function Qn(n){var t=Gn();s(n,t)}var Jn=Ut('<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" data-sonner-warning-icon="" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>');function pn(n){var t=Jn();s(n,t)}var $n=Ut('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-info-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>');function to(n){var t=$n();s(n,t)}var eo=Ut('<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-sonner-close-icon=""><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>');function no(n){var t=eo();s(n,t)}const oo=3,Je="24px",pe="16px",io=4e3,ro=356,ao=14,Ae="dark",se="light";function so(n,t){const o={};return[n,t].forEach((i,r)=>{const u=r===1,a=u?"--mobile-offset":"--offset",_=u?pe:Je;function v(P){["top","right","bottom","left"].forEach(O=>{o[`${a}-${O}`]=typeof P=="number"?`${P}px`:P})}typeof i=="number"||typeof i=="string"?v(i):typeof i=="object"?["top","right","bottom","left"].forEach(P=>{const O=i[P];O===void 0?o[`${a}-${P}`]=_:o[`${a}-${P}`]=typeof O=="number"?`${O}px`:O}):v(_)}),o}var co=rt("<ol></ol>"),lo=rt('<section aria-live="polite" aria-relevant="additions text" aria-atomic="false" class="svelte-nbs0zk"><!></section>');function uo(n,t){ht(t,!0);function o(l){return l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Ae:se}let i=k(t,"invert",3,!1),r=k(t,"position",3,"bottom-right"),u=k(t,"hotkey",19,()=>["altKey","KeyT"]),a=k(t,"expand",3,!1),_=k(t,"closeButton",3,!1),v=k(t,"offset",3,Je),P=k(t,"mobileOffset",3,pe),O=k(t,"theme",3,"light"),at=k(t,"richColors",3,!1),j=k(t,"duration",3,io),st=k(t,"visibleToasts",3,oo),R=k(t,"toastOptions",19,()=>({})),tt=k(t,"dir",7,"auto"),lt=k(t,"gap",3,ao),X=k(t,"pauseWhenPageIsHidden",3,!1),q=k(t,"containerAriaLabel",3,"Notifications"),Ht=k(t,"closeButtonAriaLabel",3,"Close toast"),de=Ct(t,["$$slots","$$events","$$legacy","invert","position","hotkey","expand","closeButton","offset","mobileOffset","theme","richColors","duration","visibleToasts","toastOptions","dir","gap","pauseWhenPageIsHidden","loadingIcon","successIcon","errorIcon","warningIcon","closeIcon","infoIcon","containerAriaLabel","class","closeButtonAriaLabel","onblur","onfocus","onmouseenter","onmousemove","onmouseleave","ondragend","onpointerdown","onpointerup"]);function fe(){if(tt()!=="auto")return tt();if(typeof window>"u"||typeof document>"u")return"ltr";const l=document.documentElement.getAttribute("dir");return l==="auto"||!l?(Xt(()=>tt(window.getComputedStyle(document.documentElement).direction??"ltr")),tt()):(Xt(()=>tt(l)),l)}const z=m(()=>Array.from(new Set([r(),...Z.toasts.filter(l=>l.position).map(l=>l.position)].filter(Boolean))));let et=B(!1),Wt=B(!1),Dt=B(Rt(o(O()))),It=B(void 0),Tt=B(null),Lt=B(!1);const Bt=m(()=>u().join("+").replace(/Key/g,"").replace(/Digit/g,""));ct(()=>{Z.toasts.length<=1&&c(et,!1)}),ct(()=>{const l=Z.toasts.filter(H=>H.dismiss&&!H.delete);if(l.length>0){const H=Z.toasts.map(gt=>l.find(Ot=>Ot.id===gt.id)?{...gt,delete:!0}:gt);Z.toasts=H}}),ct(()=>()=>{e(It)&&e(Tt)&&(e(Tt).focus({preventScroll:!0}),c(Tt,null),c(Lt,!1))}),Ce(()=>(Z.reset(),xt(document,"keydown",H=>{u().every(vt=>H[vt]||H.code===vt)&&(c(et,!0),e(It)?.focus()),H.code==="Escape"&&(document.activeElement===e(It)||e(It)?.contains(document.activeElement))&&c(et,!1)}))),ct(()=>{if(O()!=="system"&&c(Dt,O()),typeof window<"u"){O()==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?c(Dt,Ae):c(Dt,se));const l=window.matchMedia("(prefers-color-scheme: dark)"),H=({matches:gt})=>{O()==="system"&&c(Dt,gt?Ae:se,!0)};"addEventListener"in l?l.addEventListener("change",H):l.addListener(H)}});const pt=l=>{t.onblur?.(l),e(Lt)&&!l.currentTarget.contains(l.relatedTarget)&&(c(Lt,!1),e(Tt)&&(e(Tt).focus({preventScroll:!0}),c(Tt,null)))},he=l=>{t.onfocus?.(l),!(l.target instanceof HTMLElement&&l.target.dataset.dismissible==="false")&&(e(Lt)||(c(Lt,!0),c(Tt,l.relatedTarget,!0)))},me=l=>{t.onpointerdown?.(l),!(l.target instanceof HTMLElement&&l.target.dataset.dismissible==="false")&&c(Wt,!0)},ge=l=>{t.onmouseenter?.(l),c(et,!0)},Kt=l=>{t.onmouseleave?.(l),e(Wt)||c(et,!1)},ot=l=>{t.onmousemove?.(l),c(et,!0)},ve=l=>{t.ondragend?.(l),c(et,!1)},we=l=>{t.onpointerup?.(l),c(Wt,!1)};Mn.set(new mn);var St=lo();A(St,"tabindex",-1);var $t=it(St);{var Ft=l=>{var H=y(),gt=g(H);le(gt,18,()=>e(z),vt=>vt,(vt,Ot,ye,ze)=>{const te=m(()=>{const[f,Vt]=Ot.split("-");return{y:f,x:Vt}}),wt=m(()=>so(v(),P()));var Et=co();Me(Et,f=>({tabindex:-1,dir:f,class:t.class,"data-sonner-toaster":!0,"data-sonner-theme":e(Dt),"data-y-position":e(te).y,"data-x-position":e(te).x,style:t.style,onblur:pt,onfocus:he,onmouseenter:ge,onmousemove:ot,onmouseleave:Kt,ondragend:ve,onpointerdown:me,onpointerup:we,...de,[fn]:{"--front-toast-height":`${Z.heights[0]?.height}px`,"--width":`${ro}px`,"--gap":`${lt()}px`,"--offset-top":e(wt)["--offset-top"],"--offset-right":e(wt)["--offset-right"],"--offset-bottom":e(wt)["--offset-bottom"],"--offset-left":e(wt)["--offset-left"],"--mobile-offset-top":e(wt)["--mobile-offset-top"],"--mobile-offset-right":e(wt)["--mobile-offset-right"],"--mobile-offset-bottom":e(wt)["--mobile-offset-bottom"],"--mobile-offset-left":e(wt)["--mobile-offset-left"]}}),[fe],void 0,void 0,"svelte-nbs0zk"),le(Et,23,()=>Z.toasts.filter(f=>!f.position&&e(ye)===0||f.position===Ot),f=>f.id,(f,Vt,ee,Ne)=>{{const _e=ut=>{var G=y(),dt=g(G);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.successIcon??J),s(d,D)},S=d=>{Xn(d)};L(dt,d=>{t.successIcon?d(x):t.successIcon!==null&&d(S,1)})}s(ut,G)},be=ut=>{var G=y(),dt=g(G);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.errorIcon??J),s(d,D)},S=d=>{Qn(d)};L(dt,d=>{t.errorIcon?d(x):t.errorIcon!==null&&d(S,1)})}s(ut,G)},xe=ut=>{var G=y(),dt=g(G);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.warningIcon??J),s(d,D)},S=d=>{pn(d)};L(dt,d=>{t.warningIcon?d(x):t.warningIcon!==null&&d(S,1)})}s(ut,G)},h=ut=>{var G=y(),dt=g(G);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.infoIcon??J),s(d,D)},S=d=>{to(d)};L(dt,d=>{t.infoIcon?d(x):t.infoIcon!==null&&d(S,1)})}s(ut,G)},w=ut=>{var G=y(),dt=g(G);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.closeIcon??J),s(d,D)},S=d=>{no(d)};L(dt,d=>{t.closeIcon?d(x):t.closeIcon!==null&&d(S,1)})}s(ut,G)};let T=m(()=>R()?.duration??j()),M=m(()=>R()?.class??""),C=m(()=>R()?.descriptionClass||""),E=m(()=>R()?.style??""),K=m(()=>R().classes||{}),zt=m(()=>R().unstyled??!1),Yt=m(()=>R()?.cancelButtonStyle??""),Ie=m(()=>R()?.actionButtonStyle??""),ne=m(()=>R()?.closeButtonAriaLabel??Ht());Yn(f,{get index(){return e(ee)},get toast(){return e(Vt)},get defaultRichColors(){return at()},get duration(){return e(T)},get class(){return e(M)},get descriptionClass(){return e(C)},get invert(){return i()},get visibleToasts(){return st()},get closeButton(){return _()},get interacting(){return e(Wt)},get position(){return Ot},get style(){return e(E)},get classes(){return e(K)},get unstyled(){return e(zt)},get cancelButtonStyle(){return e(Yt)},get actionButtonStyle(){return e(Ie)},get closeButtonAriaLabel(){return e(ne)},get expandByDefault(){return a()},get expanded(){return e(et)},get pauseWhenPageIsHidden(){return X()},get loadingIcon(){return t.loadingIcon},successIcon:_e,errorIcon:be,warningIcon:xe,infoIcon:h,closeIcon:w,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),$(Et),Qe(Et,f=>c(It,f),()=>e(It)),nt(()=>Et.dir=Et.dir),s(vt,Et)}),s(l,H)};L($t,l=>{Z.toasts.length>0&&l(Ft)})}$(St),nt(()=>A(St,"aria-label",`${q()??""} ${e(Bt)??""}`)),s(n,St),mt()}const $e=typeof window<"u"?window:void 0;function fo(n){let t=n.activeElement;for(;t?.shadowRoot;){const o=t.shadowRoot.activeElement;if(o===t)break;t=o}return t}let ho=class{#e;#t;constructor(t={}){const{window:o=$e,document:i=o?.document}=t;o!==void 0&&(this.#e=i,this.#t=Qt(r=>{const u=xt(o,"focusin",r),a=xt(o,"focusout",r);return()=>{u(),a()}}))}get current(){return this.#t?.(),this.#e?fo(this.#e):null}};new ho;function mo(n,t){switch(n){case"post":ct(t);break;case"pre":Ge(t);break}}function tn(n,t,o,i={}){const{lazy:r=!1}=i;let u=!r,a=Array.isArray(n)?[]:void 0;mo(t,()=>{const _=Array.isArray(n)?n.map(P=>P()):n();if(!u){u=!0,a=_;return}const v=Xt(()=>o(_,a));return a=_,v})}function Le(n,t,o){tn(n,"post",t,o)}function go(n,t,o){tn(n,"pre",t,o)}Le.pre=go;function vo(n,t){switch(n){case"local":return t.localStorage;case"session":return t.sessionStorage}}class en{#e;#t;#o;#n;#r;#i=B(0);constructor(t,o,i={}){const{storage:r="local",serializer:u={serialize:JSON.stringify,deserialize:JSON.parse},syncTabs:a=!0,window:_=$e}=i;if(this.#e=o,this.#t=t,this.#o=u,_===void 0)return;const v=vo(r,_);this.#n=v;const P=v.getItem(t);P!==null?this.#e=this.#a(P):this.#s(o),a&&r==="local"&&(this.#r=Qt(()=>xt(_,"storage",this.#c)))}get current(){this.#r?.(),e(this.#i);const t=this.#a(this.#n?.getItem(this.#t))??this.#e,o=new WeakMap,i=r=>{if(r===null||r?.constructor.name==="Date"||typeof r!="object")return r;let u=o.get(r);return u||(u=new Proxy(r,{get:(a,_)=>(e(this.#i),i(Reflect.get(a,_))),set:(a,_,v)=>(c(this.#i,e(this.#i)+1),Reflect.set(a,_,v),this.#s(t),!0)}),o.set(r,u)),u};return i(t)}set current(t){this.#s(t),c(this.#i,e(this.#i)+1)}#c=t=>{t.key!==this.#t||t.newValue===null||(this.#e=this.#a(t.newValue),c(this.#i,e(this.#i)+1))};#a(t){try{return this.#o.deserialize(t)}catch(o){console.error(`Error when parsing "${t}" from persisted store "${this.#t}"`,o);return}}#s(t){try{t!=null&&this.#n?.setItem(this.#t,this.#o.serialize(t))}catch(o){console.error(`Error when writing value from persisted store "${this.#t}" to ${this.#n}`,o)}}}function qe(n){return n.filter(t=>t.length>0)}const nn={getItem:n=>null,setItem:(n,t)=>{}},ue=typeof document<"u";function wo(n){return typeof n=="function"}function yo(n){return n!==null&&typeof n=="object"}const Gt=Symbol("box"),Oe=Symbol("is-writable");function _o(n){return yo(n)&&Gt in n}function bo(n){return F.isBox(n)&&Oe in n}function F(n){let t=B(Rt(n));return{[Gt]:!0,[Oe]:!0,get current(){return e(t)},set current(o){c(t,o,!0)}}}function xo(n,t){const o=m(n);return t?{[Gt]:!0,[Oe]:!0,get current(){return e(o)},set current(i){t(i)}}:{[Gt]:!0,get current(){return n()}}}function Io(n){return F.isBox(n)?n:wo(n)?F.with(n):F(n)}function To(n){return Object.entries(n).reduce((t,[o,i])=>F.isBox(i)?(F.isWritableBox(i)?Object.defineProperty(t,o,{get(){return i.current},set(r){i.current=r}}):Object.defineProperty(t,o,{get(){return i.current}}),t):Object.assign(t,{[o]:i}),{})}function So(n){return F.isWritableBox(n)?{[Gt]:!0,get current(){return n.current}}:n}F.from=Io;F.with=xo;F.flatten=To;F.readonly=So;F.isBox=_o;F.isWritableBox=bo;function Eo(n,t){const o=RegExp(n,"g");return i=>{if(typeof i!="string")throw new TypeError(`expected an argument of type string, but got ${typeof i}`);return i.match(o)?i.replace(o,t):i}}const Ao=Eo(/[A-Z]/,n=>`-${n.toLowerCase()}`);function ko(n){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError(`expected an argument of type object, but got ${typeof n}`);return Object.keys(n).map(t=>`${Ao(t)}: ${n[t]};`).join(`
|
|
2
|
+
import{c as Nt,_ as jt}from"../chunks/DJKRyj_1.js";import{a as s,f as rt,q as Qt,o as xt,g as qt,e as an,c as y,j as sn,t as Re,s as ie,r as Ut}from"../chunks/0x0awhVy.js";import{q as ht,w as it,z as $,A as nt,v as mt,br as cn,t as He,bs as Pe,F as B,a7 as Rt,a as ct,D as c,g as e,b as Xt,R as Ce,x as Mt,T as m,aF as J,f as g,u as Ge,bt as De,bp as ln,B as un,$ as dn}from"../chunks/8FUQuwgM.js";import{j as _t,s as bt,g as A,i as Se,e as U,d as Me,S as fn,a as re,w as We}from"../chunks/EDLlAC9C.js";import{h as hn}from"../chunks/C7R6dA2m.js";import{g as Ee}from"../chunks/CIZkRAuY.js";import{e as le,t as Z,c as yt,S as mn,b as gn,i as vn,n as wn,r as Fe}from"../chunks/glgUBDR2.js";import{p as k,i as L,b as Qe,s as kt,r as Ct}from"../chunks/CbJfRYJV.js";import"../chunks/Bl1mtM70.js";const yn=Array(12).fill(0);var _n=rt('<div class="sonner-loading-bar"></div>'),bn=rt('<div><div class="sonner-spinner"></div></div>');function xn(n,t){ht(t,!0);var o=bn(),i=it(o);le(i,23,()=>yn,(r,u)=>`spinner-bar-${u}`,(r,u)=>{var a=_n();s(r,a)}),$(i),$(o),nt(r=>{bt(o,1,r),A(o,"data-visible",t.visible)},[()=>_t(["sonner-loading-wrapper",t.class].filter(Boolean).join(" "))]),s(n,o),mt()}const In=typeof window<"u"?window:void 0;function Tn(n){let t=n.activeElement;for(;t?.shadowRoot;){const o=t.shadowRoot.activeElement;if(o===t)break;t=o}return t}class Sn{#e;#t;constructor(t,o){this.#e=t,this.#t=Qt(o)}get current(){return this.#t(),this.#e()}}const En=/\(.+\)/,An=new Set(["all","print","screen","and","or","not","only"]);class kn extends Sn{constructor(t,o){let i=En.test(t)||t.split(/[\s,]+/).some(u=>An.has(u.trim()))?t:`(${t})`;const r=window.matchMedia(i);super(()=>r.matches,u=>xt(r,"change",u))}}let Bn=class{#e;#t;constructor(t={}){const{window:o=In,document:i=o?.document}=t;o!==void 0&&(this.#e=i,this.#t=Qt(r=>{const u=xt(o,"focusin",r),a=xt(o,"focusout",r);return()=>{u(),a()}}))}get current(){return this.#t?.(),this.#e?Tn(this.#e):null}};new Bn;class Pn{#e;#t;constructor(t){this.#e=t,this.#t=Symbol(t)}get key(){return this.#t}exists(){return cn(this.#t)}get(){const t=He(this.#t);if(t===void 0)throw new Error(`Context "${this.#e}" not found`);return t}getOr(t){const o=He(this.#t);return o===void 0?t:o}set(t){return Pe(this.#t,t)}}const Mn=new Pn("<Toaster/>");function ae(n){return n.label!==void 0}function Cn(){let n=B(Rt(typeof document<"u"?document.hidden:!1));return ct(()=>xt(document,"visibilitychange",()=>{c(n,document.hidden,!0)})),{get current(){return e(n)}}}const Ve=4e3,Dn=14,Ln=45,On=200,zn=.05,Nn={toast:"",title:"",description:"",loader:"",closeButton:"",cancelButton:"",actionButton:"",action:"",warning:"",error:"",success:"",default:"",info:"",loading:""};function Rn(n){const[t,o]=n.split("-"),i=[];return t&&i.push(t),o&&i.push(o),i}function je(n){return 1/(1.5+Math.abs(n)/20)}var Hn=rt("<div><!></div>"),Wn=rt('<button data-close-button=""><!></button>'),Fn=rt('<div data-icon=""><!> <!></div>'),Vn=rt('<div data-description=""><!></div>'),jn=rt('<button data-button="" data-cancel=""> </button>'),qn=rt('<button data-button=""> </button>'),Un=rt('<!> <div data-content=""><div data-title=""><!></div> <!></div> <!> <!>',1),Kn=rt('<li aria-atomic="true" data-sonner-toast=""><!> <!></li>');function Yn(n,t){ht(t,!0);const o=h=>{var w=y(),T=g(w);{var M=E=>{var K=Hn(),zt=it(K);U(zt,()=>t.loadingIcon),$(K),nt(Yt=>{bt(K,1,Yt),A(K,"data-visible",e(z)==="loading")},[()=>_t(yt(e(ot)?.loader,t.toast?.classes?.loader,"sonner-loader"))]),s(E,K)},C=E=>{{let K=m(()=>yt(e(ot)?.loader,t.toast.classes?.loader)),zt=m(()=>e(z)==="loading");xn(E,{get class(){return e(K)},get visible(){return e(zt)}})}};L(T,E=>{t.loadingIcon?E(M):E(C,!1)})}s(h,w)};let i=k(t,"cancelButtonStyle",3,""),r=k(t,"actionButtonStyle",3,""),u=k(t,"descriptionClass",3,""),a=k(t,"unstyled",3,!1),_=k(t,"defaultRichColors",3,!1);const v={...Nn};let P=B(!1),O=B(!1),at=B(!1),j=B(!1),st=B(!1),R=B(0),tt=B(0),lt=t.toast.duration||t.duration||Ve,X=B(void 0),q=B(null),Ht=B(null);const de=m(()=>t.index===0),fe=m(()=>t.index+1<=t.visibleToasts),z=m(()=>t.toast.type),et=m(()=>t.toast.dismissible!==void 0?t.toast.dismissible!==!1:t.toast.dismissable!==!1),Wt=m(()=>t.toast.class||""),Dt=m(()=>t.toast.descriptionClass||""),It=m(()=>Z.heights.findIndex(h=>h.toastId===t.toast.id)||0),Tt=m(()=>t.toast.closeButton??t.closeButton),Lt=m(()=>t.toast.duration??t.duration??Ve);let Bt=null;const pt=m(()=>t.position.split("-")),he=m(()=>Z.heights.reduce((h,w,T)=>T>=e(It)?h:h+w.height,0)),me=Cn(),ge=m(()=>t.toast.invert||t.invert),Kt=m(()=>e(z)==="loading"),ot=m(()=>({...v,...t.classes})),ve=m(()=>t.toast.title),we=m(()=>t.toast.description);let St=B(0),$t=B(0);const Ft=m(()=>Math.round(e(It)*Dn+e(he)));ct(()=>{e(ve),e(we);let h;t.expanded||t.expandByDefault?h=1:h=1-t.index*zn;const w=Xt(()=>e(X));if(w===void 0)return;w.style.setProperty("height","auto");const T=w.offsetHeight,M=w.getBoundingClientRect().height,C=Math.round(M/h+Number.EPSILON&100)/100;w.style.removeProperty("height");let E;Math.abs(C-T)<1?E=C:E=T,c(tt,E,!0),Z.setHeight({toastId:t.toast.id,height:E})});function l(){c(O,!0),c(R,e(Ft),!0),Z.removeHeight(t.toast.id),setTimeout(()=>{Z.remove(t.toast.id)},On)}let H;const gt=m(()=>t.toast.promise&&e(z)==="loading"||t.toast.duration===Number.POSITIVE_INFINITY);function vt(){c(St,new Date().getTime(),!0),H=setTimeout(()=>{t.toast.onAutoClose?.(t.toast),l()},lt)}function Ot(){if(e($t)<e(St)){const h=new Date().getTime()-e(St);lt=lt-h}c($t,new Date().getTime(),!0)}ct(()=>{t.toast.updated&&(clearTimeout(H),lt=e(Lt),vt())}),ct(()=>(e(gt)||(t.expanded||t.interacting||t.pauseWhenPageIsHidden&&me.current?Ot():vt()),()=>clearTimeout(H))),Ce(()=>{c(P,!0);const h=e(X)?.getBoundingClientRect().height;return c(tt,h,!0),Z.setHeight({toastId:t.toast.id,height:h}),()=>{Z.removeHeight(t.toast.id)}}),ct(()=>{t.toast.delete&&Xt(()=>{l(),t.toast.onDismiss?.(t.toast)})});const ye=h=>{if(e(Kt))return;c(R,e(Ft),!0);const w=h.target;w.setPointerCapture(h.pointerId),w.tagName!=="BUTTON"&&(c(at,!0),Bt={x:h.clientX,y:h.clientY})},ze=()=>{if(e(j)||!e(et))return;Bt=null;const h=Number(e(X)?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),w=Number(e(X)?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),T=new Date().getTime()-0,M=e(q)==="x"?h:w,C=Math.abs(M)/T;if(Math.abs(M)>=Ln||C>.11){c(R,e(Ft),!0),t.toast.onDismiss?.(t.toast),e(q)==="x"?c(Ht,h>0?"right":"left",!0):c(Ht,w>0?"down":"up",!0),l(),c(j,!0);return}else e(X)?.style.setProperty("--swipe-amount-x","0px"),e(X)?.style.setProperty("--swipe-amount-y","0px");c(st,!1),c(at,!1),c(q,null)},te=h=>{if(!Bt||!e(et)||(window.getSelection()?.toString().length??-1)>0)return;const T=h.clientY-Bt.y,M=h.clientX-Bt.x,C=t.swipeDirections??Rn(t.position);!e(q)&&(Math.abs(M)>1||Math.abs(T)>1)&&c(q,Math.abs(M)>Math.abs(T)?"x":"y",!0);let E={x:0,y:0};if(e(q)==="y"){if(C.includes("top")||C.includes("bottom"))if(C.includes("top")&&T<0||C.includes("bottom")&&T>0)E.y=T;else{const K=T*je(T);E.y=Math.abs(K)<Math.abs(T)?K:T}}else if(e(q)==="x"&&(C.includes("left")||C.includes("right")))if(C.includes("left")&&M<0||C.includes("right")&&M>0)E.x=M;else{const K=M*je(M);E.x=Math.abs(K)<Math.abs(M)?K:M}(Math.abs(E.x)>0||Math.abs(E.y)>0)&&c(st,!0),e(X)?.style.setProperty("--swipe-amount-x",`${E.x}px`),e(X)?.style.setProperty("--swipe-amount-y",`${E.y}px`)},wt=()=>{c(at,!1),c(q,null),Bt=null},Et=m(()=>t.toast.icon?t.toast.icon:e(z)==="success"?t.successIcon:e(z)==="error"?t.errorIcon:e(z)==="warning"?t.warningIcon:e(z)==="info"?t.infoIcon:e(z)==="loading"?t.loadingIcon:null);var f=Kn();A(f,"tabindex",0);let Vt;var ee=it(f);{var Ne=h=>{var w=Wn(),T=it(w);U(T,()=>t.closeIcon??J),$(w),nt(M=>{A(w,"aria-label",t.closeButtonAriaLabel),A(w,"data-disabled",e(Kt)),bt(w,1,M)},[()=>_t(yt(e(ot)?.closeButton,t.toast?.classes?.closeButton))]),qt("click",w,()=>{e(Kt)||!e(et)||(l(),t.toast.onDismiss?.(t.toast))}),s(h,w)};L(ee,h=>{e(Tt)&&!t.toast.component&&e(z)!=="loading"&&t.closeIcon!==null&&h(Ne)})}var _e=Mt(ee,2);{var be=h=>{const w=m(()=>t.toast.component);var T=y(),M=g(T);Nt(M,()=>e(w),(C,E)=>{E(C,kt(()=>t.toast.componentProps,{closeToast:l}))}),s(h,T)},xe=h=>{var w=Un(),T=g(w);{var M=x=>{var S=Fn(),d=it(S);{var D=b=>{var I=y(),p=g(I);{var W=Pt=>{var oe=y(),Te=g(oe);Nt(Te,()=>t.toast.icon,(Y,Q)=>{Q(Y,{})}),s(Pt,oe)},ft=Pt=>{o(Pt)};L(p,Pt=>{t.toast.icon?Pt(W):Pt(ft,!1)})}s(b,I)};L(d,b=>{(t.toast.promise||e(z)==="loading")&&b(D)})}var V=Mt(d,2);{var N=b=>{var I=y(),p=g(I);{var W=Y=>{var Q=y(),At=g(Q);Nt(At,()=>t.toast.icon,(on,rn)=>{rn(on,{})}),s(Y,Q)},ft=Y=>{var Q=y(),At=g(Q);U(At,()=>t.successIcon??J),s(Y,Q)},Pt=Y=>{var Q=y(),At=g(Q);U(At,()=>t.errorIcon??J),s(Y,Q)},oe=Y=>{var Q=y(),At=g(Q);U(At,()=>t.warningIcon??J),s(Y,Q)},Te=Y=>{var Q=y(),At=g(Q);U(At,()=>t.infoIcon??J),s(Y,Q)};L(p,Y=>{t.toast.icon?Y(W):e(z)==="success"?Y(ft,1):e(z)==="error"?Y(Pt,2):e(z)==="warning"?Y(oe,3):e(z)==="info"&&Y(Te,4)})}s(b,I)};L(V,b=>{t.toast.type!=="loading"&&b(N)})}$(S),nt(b=>bt(S,1,b),[()=>_t(yt(e(ot)?.icon,t.toast?.classes?.icon))]),s(x,S)};L(T,x=>{(e(z)||t.toast.icon||t.toast.promise)&&t.toast.icon!==null&&(e(Et)!==null||t.toast.icon)&&x(M)})}var C=Mt(T,2),E=it(C),K=it(E);{var zt=x=>{var S=y(),d=g(S);{var D=N=>{const b=m(()=>t.toast.title);var I=y(),p=g(I);Nt(p,()=>e(b),(W,ft)=>{ft(W,kt(()=>t.toast.componentProps))}),s(N,I)},V=N=>{var b=Re();nt(()=>ie(b,t.toast.title)),s(N,b)};L(d,N=>{typeof t.toast.title!="string"?N(D):N(V,!1)})}s(x,S)};L(K,x=>{t.toast.title&&x(zt)})}$(E);var Yt=Mt(E,2);{var Ie=x=>{var S=Vn(),d=it(S);{var D=N=>{const b=m(()=>t.toast.description);var I=y(),p=g(I);Nt(p,()=>e(b),(W,ft)=>{ft(W,kt(()=>t.toast.componentProps))}),s(N,I)},V=N=>{var b=Re();nt(()=>ie(b,t.toast.description)),s(N,b)};L(d,N=>{typeof t.toast.description!="string"?N(D):N(V,!1)})}$(S),nt(N=>bt(S,1,N),[()=>_t(yt(u(),e(Dt),e(ot)?.description,t.toast.classes?.description))]),s(x,S)};L(Yt,x=>{t.toast.description&&x(Ie)})}$(C);var ne=Mt(C,2);{var ut=x=>{var S=y(),d=g(S);{var D=b=>{var I=y(),p=g(I);Nt(p,()=>t.toast.cancel,(W,ft)=>{ft(W,{})}),s(b,I)},V=b=>{var I=jn(),p=it(I,!0);$(I),nt(W=>{Se(I,t.toast.cancelButtonStyle??i()),bt(I,1,W),ie(p,t.toast.cancel.label)},[()=>_t(yt(e(ot)?.cancelButton,t.toast?.classes?.cancelButton))]),qt("click",I,W=>{ae(t.toast.cancel)&&e(et)&&(t.toast.cancel?.onClick?.(W),l())}),s(b,I)},N=m(()=>ae(t.toast.cancel));L(d,b=>{typeof t.toast.cancel=="function"?b(D):e(N)&&b(V,1)})}s(x,S)};L(ne,x=>{t.toast.cancel&&x(ut)})}var G=Mt(ne,2);{var dt=x=>{var S=y(),d=g(S);{var D=b=>{var I=y(),p=g(I);Nt(p,()=>t.toast.action,(W,ft)=>{ft(W,{})}),s(b,I)},V=b=>{var I=qn(),p=it(I,!0);$(I),nt(W=>{Se(I,t.toast.actionButtonStyle??r()),bt(I,1,W),ie(p,t.toast.action.label)},[()=>_t(yt(e(ot)?.actionButton,t.toast?.classes?.actionButton))]),qt("click",I,W=>{ae(t.toast.action)&&(t.toast.action?.onClick(W),!W.defaultPrevented&&l())}),s(b,I)},N=m(()=>ae(t.toast.action));L(d,b=>{typeof t.toast.action=="function"?b(D):e(N)&&b(V,1)})}s(x,S)};L(G,x=>{t.toast.action&&x(dt)})}nt((x,S)=>{bt(C,1,x),bt(E,1,S)},[()=>_t(yt(e(ot)?.content,t.toast?.classes?.content)),()=>_t(yt(e(ot)?.title,t.toast?.classes?.title))]),s(h,w)};L(_e,h=>{t.toast.component?h(be):h(xe,!1)})}$(f),Qe(f,h=>c(X,h),()=>e(X)),nt((h,w,T)=>{bt(f,1,h),A(f,"aria-live",t.toast.important?"assertive":"polite"),A(f,"data-rich-colors",t.toast.richColors??_()),A(f,"data-styled",!(t.toast.component||t.toast.unstyled||a())),A(f,"data-mounted",e(P)),A(f,"data-promise",w),A(f,"data-swiped",e(st)),A(f,"data-removed",e(O)),A(f,"data-visible",e(fe)),A(f,"data-y-position",e(pt)[0]),A(f,"data-x-position",e(pt)[1]),A(f,"data-index",t.index),A(f,"data-front",e(de)),A(f,"data-swiping",e(at)),A(f,"data-dismissible",e(et)),A(f,"data-type",e(z)),A(f,"data-invert",e(ge)),A(f,"data-swipe-out",e(j)),A(f,"data-swipe-direction",e(Ht)),A(f,"data-expanded",T),Vt=Se(f,`${t.style} ${t.toast.style}`,Vt,{"--index":t.index,"--toasts-before":t.index,"--z-index":Z.toasts.length-t.index,"--offset":`${e(O)?e(R):e(Ft)}px`,"--initial-height":t.expandByDefault?"auto":`${e(tt)}px`})},[()=>_t(yt(t.class,e(Wt),e(ot)?.toast,t.toast?.classes?.toast,e(ot)?.[e(z)],t.toast?.classes?.[e(z)])),()=>!!t.toast.promise,()=>!!(t.expanded||t.expandByDefault&&e(P))]),qt("pointermove",f,te),qt("pointerup",f,ze),qt("pointerdown",f,ye),an("dragend",f,wt),s(n,f),mt()}sn(["pointermove","pointerup","pointerdown","click"]);var Zn=Ut('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-success-icon=""><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>');function Xn(n){var t=Zn();s(n,t)}var Gn=Ut('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-error-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>');function Qn(n){var t=Gn();s(n,t)}var Jn=Ut('<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" data-sonner-warning-icon="" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>');function pn(n){var t=Jn();s(n,t)}var $n=Ut('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-info-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>');function to(n){var t=$n();s(n,t)}var eo=Ut('<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-sonner-close-icon=""><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>');function no(n){var t=eo();s(n,t)}const oo=3,Je="24px",pe="16px",io=4e3,ro=356,ao=14,Ae="dark",se="light";function so(n,t){const o={};return[n,t].forEach((i,r)=>{const u=r===1,a=u?"--mobile-offset":"--offset",_=u?pe:Je;function v(P){["top","right","bottom","left"].forEach(O=>{o[`${a}-${O}`]=typeof P=="number"?`${P}px`:P})}typeof i=="number"||typeof i=="string"?v(i):typeof i=="object"?["top","right","bottom","left"].forEach(P=>{const O=i[P];O===void 0?o[`${a}-${P}`]=_:o[`${a}-${P}`]=typeof O=="number"?`${O}px`:O}):v(_)}),o}var co=rt("<ol></ol>"),lo=rt('<section aria-live="polite" aria-relevant="additions text" aria-atomic="false" class="svelte-nbs0zk"><!></section>');function uo(n,t){ht(t,!0);function o(l){return l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Ae:se}let i=k(t,"invert",3,!1),r=k(t,"position",3,"bottom-right"),u=k(t,"hotkey",19,()=>["altKey","KeyT"]),a=k(t,"expand",3,!1),_=k(t,"closeButton",3,!1),v=k(t,"offset",3,Je),P=k(t,"mobileOffset",3,pe),O=k(t,"theme",3,"light"),at=k(t,"richColors",3,!1),j=k(t,"duration",3,io),st=k(t,"visibleToasts",3,oo),R=k(t,"toastOptions",19,()=>({})),tt=k(t,"dir",7,"auto"),lt=k(t,"gap",3,ao),X=k(t,"pauseWhenPageIsHidden",3,!1),q=k(t,"containerAriaLabel",3,"Notifications"),Ht=k(t,"closeButtonAriaLabel",3,"Close toast"),de=Ct(t,["$$slots","$$events","$$legacy","invert","position","hotkey","expand","closeButton","offset","mobileOffset","theme","richColors","duration","visibleToasts","toastOptions","dir","gap","pauseWhenPageIsHidden","loadingIcon","successIcon","errorIcon","warningIcon","closeIcon","infoIcon","containerAriaLabel","class","closeButtonAriaLabel","onblur","onfocus","onmouseenter","onmousemove","onmouseleave","ondragend","onpointerdown","onpointerup"]);function fe(){if(tt()!=="auto")return tt();if(typeof window>"u"||typeof document>"u")return"ltr";const l=document.documentElement.getAttribute("dir");return l==="auto"||!l?(Xt(()=>tt(window.getComputedStyle(document.documentElement).direction??"ltr")),tt()):(Xt(()=>tt(l)),l)}const z=m(()=>Array.from(new Set([r(),...Z.toasts.filter(l=>l.position).map(l=>l.position)].filter(Boolean))));let et=B(!1),Wt=B(!1),Dt=B(Rt(o(O()))),It=B(void 0),Tt=B(null),Lt=B(!1);const Bt=m(()=>u().join("+").replace(/Key/g,"").replace(/Digit/g,""));ct(()=>{Z.toasts.length<=1&&c(et,!1)}),ct(()=>{const l=Z.toasts.filter(H=>H.dismiss&&!H.delete);if(l.length>0){const H=Z.toasts.map(gt=>l.find(Ot=>Ot.id===gt.id)?{...gt,delete:!0}:gt);Z.toasts=H}}),ct(()=>()=>{e(It)&&e(Tt)&&(e(Tt).focus({preventScroll:!0}),c(Tt,null),c(Lt,!1))}),Ce(()=>(Z.reset(),xt(document,"keydown",H=>{u().every(vt=>H[vt]||H.code===vt)&&(c(et,!0),e(It)?.focus()),H.code==="Escape"&&(document.activeElement===e(It)||e(It)?.contains(document.activeElement))&&c(et,!1)}))),ct(()=>{if(O()!=="system"&&c(Dt,O()),typeof window<"u"){O()==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?c(Dt,Ae):c(Dt,se));const l=window.matchMedia("(prefers-color-scheme: dark)"),H=({matches:gt})=>{O()==="system"&&c(Dt,gt?Ae:se,!0)};"addEventListener"in l?l.addEventListener("change",H):l.addListener(H)}});const pt=l=>{t.onblur?.(l),e(Lt)&&!l.currentTarget.contains(l.relatedTarget)&&(c(Lt,!1),e(Tt)&&(e(Tt).focus({preventScroll:!0}),c(Tt,null)))},he=l=>{t.onfocus?.(l),!(l.target instanceof HTMLElement&&l.target.dataset.dismissible==="false")&&(e(Lt)||(c(Lt,!0),c(Tt,l.relatedTarget,!0)))},me=l=>{t.onpointerdown?.(l),!(l.target instanceof HTMLElement&&l.target.dataset.dismissible==="false")&&c(Wt,!0)},ge=l=>{t.onmouseenter?.(l),c(et,!0)},Kt=l=>{t.onmouseleave?.(l),e(Wt)||c(et,!1)},ot=l=>{t.onmousemove?.(l),c(et,!0)},ve=l=>{t.ondragend?.(l),c(et,!1)},we=l=>{t.onpointerup?.(l),c(Wt,!1)};Mn.set(new mn);var St=lo();A(St,"tabindex",-1);var $t=it(St);{var Ft=l=>{var H=y(),gt=g(H);le(gt,18,()=>e(z),vt=>vt,(vt,Ot,ye,ze)=>{const te=m(()=>{const[f,Vt]=Ot.split("-");return{y:f,x:Vt}}),wt=m(()=>so(v(),P()));var Et=co();Me(Et,f=>({tabindex:-1,dir:f,class:t.class,"data-sonner-toaster":!0,"data-sonner-theme":e(Dt),"data-y-position":e(te).y,"data-x-position":e(te).x,style:t.style,onblur:pt,onfocus:he,onmouseenter:ge,onmousemove:ot,onmouseleave:Kt,ondragend:ve,onpointerdown:me,onpointerup:we,...de,[fn]:{"--front-toast-height":`${Z.heights[0]?.height}px`,"--width":`${ro}px`,"--gap":`${lt()}px`,"--offset-top":e(wt)["--offset-top"],"--offset-right":e(wt)["--offset-right"],"--offset-bottom":e(wt)["--offset-bottom"],"--offset-left":e(wt)["--offset-left"],"--mobile-offset-top":e(wt)["--mobile-offset-top"],"--mobile-offset-right":e(wt)["--mobile-offset-right"],"--mobile-offset-bottom":e(wt)["--mobile-offset-bottom"],"--mobile-offset-left":e(wt)["--mobile-offset-left"]}}),[fe],void 0,void 0,"svelte-nbs0zk"),le(Et,23,()=>Z.toasts.filter(f=>!f.position&&e(ye)===0||f.position===Ot),f=>f.id,(f,Vt,ee,Ne)=>{{const _e=ut=>{var G=y(),dt=g(G);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.successIcon??J),s(d,D)},S=d=>{Xn(d)};L(dt,d=>{t.successIcon?d(x):t.successIcon!==null&&d(S,1)})}s(ut,G)},be=ut=>{var G=y(),dt=g(G);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.errorIcon??J),s(d,D)},S=d=>{Qn(d)};L(dt,d=>{t.errorIcon?d(x):t.errorIcon!==null&&d(S,1)})}s(ut,G)},xe=ut=>{var G=y(),dt=g(G);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.warningIcon??J),s(d,D)},S=d=>{pn(d)};L(dt,d=>{t.warningIcon?d(x):t.warningIcon!==null&&d(S,1)})}s(ut,G)},h=ut=>{var G=y(),dt=g(G);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.infoIcon??J),s(d,D)},S=d=>{to(d)};L(dt,d=>{t.infoIcon?d(x):t.infoIcon!==null&&d(S,1)})}s(ut,G)},w=ut=>{var G=y(),dt=g(G);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.closeIcon??J),s(d,D)},S=d=>{no(d)};L(dt,d=>{t.closeIcon?d(x):t.closeIcon!==null&&d(S,1)})}s(ut,G)};let T=m(()=>R()?.duration??j()),M=m(()=>R()?.class??""),C=m(()=>R()?.descriptionClass||""),E=m(()=>R()?.style??""),K=m(()=>R().classes||{}),zt=m(()=>R().unstyled??!1),Yt=m(()=>R()?.cancelButtonStyle??""),Ie=m(()=>R()?.actionButtonStyle??""),ne=m(()=>R()?.closeButtonAriaLabel??Ht());Yn(f,{get index(){return e(ee)},get toast(){return e(Vt)},get defaultRichColors(){return at()},get duration(){return e(T)},get class(){return e(M)},get descriptionClass(){return e(C)},get invert(){return i()},get visibleToasts(){return st()},get closeButton(){return _()},get interacting(){return e(Wt)},get position(){return Ot},get style(){return e(E)},get classes(){return e(K)},get unstyled(){return e(zt)},get cancelButtonStyle(){return e(Yt)},get actionButtonStyle(){return e(Ie)},get closeButtonAriaLabel(){return e(ne)},get expandByDefault(){return a()},get expanded(){return e(et)},get pauseWhenPageIsHidden(){return X()},get loadingIcon(){return t.loadingIcon},successIcon:_e,errorIcon:be,warningIcon:xe,infoIcon:h,closeIcon:w,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),$(Et),Qe(Et,f=>c(It,f),()=>e(It)),nt(()=>Et.dir=Et.dir),s(vt,Et)}),s(l,H)};L($t,l=>{Z.toasts.length>0&&l(Ft)})}$(St),nt(()=>A(St,"aria-label",`${q()??""} ${e(Bt)??""}`)),s(n,St),mt()}const $e=typeof window<"u"?window:void 0;function fo(n){let t=n.activeElement;for(;t?.shadowRoot;){const o=t.shadowRoot.activeElement;if(o===t)break;t=o}return t}let ho=class{#e;#t;constructor(t={}){const{window:o=$e,document:i=o?.document}=t;o!==void 0&&(this.#e=i,this.#t=Qt(r=>{const u=xt(o,"focusin",r),a=xt(o,"focusout",r);return()=>{u(),a()}}))}get current(){return this.#t?.(),this.#e?fo(this.#e):null}};new ho;function mo(n,t){switch(n){case"post":ct(t);break;case"pre":Ge(t);break}}function tn(n,t,o,i={}){const{lazy:r=!1}=i;let u=!r,a=Array.isArray(n)?[]:void 0;mo(t,()=>{const _=Array.isArray(n)?n.map(P=>P()):n();if(!u){u=!0,a=_;return}const v=Xt(()=>o(_,a));return a=_,v})}function Le(n,t,o){tn(n,"post",t,o)}function go(n,t,o){tn(n,"pre",t,o)}Le.pre=go;function vo(n,t){switch(n){case"local":return t.localStorage;case"session":return t.sessionStorage}}class en{#e;#t;#o;#n;#r;#i=B(0);constructor(t,o,i={}){const{storage:r="local",serializer:u={serialize:JSON.stringify,deserialize:JSON.parse},syncTabs:a=!0,window:_=$e}=i;if(this.#e=o,this.#t=t,this.#o=u,_===void 0)return;const v=vo(r,_);this.#n=v;const P=v.getItem(t);P!==null?this.#e=this.#a(P):this.#s(o),a&&r==="local"&&(this.#r=Qt(()=>xt(_,"storage",this.#c)))}get current(){this.#r?.(),e(this.#i);const t=this.#a(this.#n?.getItem(this.#t))??this.#e,o=new WeakMap,i=r=>{if(r===null||r?.constructor.name==="Date"||typeof r!="object")return r;let u=o.get(r);return u||(u=new Proxy(r,{get:(a,_)=>(e(this.#i),i(Reflect.get(a,_))),set:(a,_,v)=>(c(this.#i,e(this.#i)+1),Reflect.set(a,_,v),this.#s(t),!0)}),o.set(r,u)),u};return i(t)}set current(t){this.#s(t),c(this.#i,e(this.#i)+1)}#c=t=>{t.key!==this.#t||t.newValue===null||(this.#e=this.#a(t.newValue),c(this.#i,e(this.#i)+1))};#a(t){try{return this.#o.deserialize(t)}catch(o){console.error(`Error when parsing "${t}" from persisted store "${this.#t}"`,o);return}}#s(t){try{t!=null&&this.#n?.setItem(this.#t,this.#o.serialize(t))}catch(o){console.error(`Error when writing value from persisted store "${this.#t}" to ${this.#n}`,o)}}}function qe(n){return n.filter(t=>t.length>0)}const nn={getItem:n=>null,setItem:(n,t)=>{}},ue=typeof document<"u";function wo(n){return typeof n=="function"}function yo(n){return n!==null&&typeof n=="object"}const Gt=Symbol("box"),Oe=Symbol("is-writable");function _o(n){return yo(n)&&Gt in n}function bo(n){return F.isBox(n)&&Oe in n}function F(n){let t=B(Rt(n));return{[Gt]:!0,[Oe]:!0,get current(){return e(t)},set current(o){c(t,o,!0)}}}function xo(n,t){const o=m(n);return t?{[Gt]:!0,[Oe]:!0,get current(){return e(o)},set current(i){t(i)}}:{[Gt]:!0,get current(){return n()}}}function Io(n){return F.isBox(n)?n:wo(n)?F.with(n):F(n)}function To(n){return Object.entries(n).reduce((t,[o,i])=>F.isBox(i)?(F.isWritableBox(i)?Object.defineProperty(t,o,{get(){return i.current},set(r){i.current=r}}):Object.defineProperty(t,o,{get(){return i.current}}),t):Object.assign(t,{[o]:i}),{})}function So(n){return F.isWritableBox(n)?{[Gt]:!0,get current(){return n.current}}:n}F.from=Io;F.with=xo;F.flatten=To;F.readonly=So;F.isBox=_o;F.isWritableBox=bo;function Eo(n,t){const o=RegExp(n,"g");return i=>{if(typeof i!="string")throw new TypeError(`expected an argument of type string, but got ${typeof i}`);return i.match(o)?i.replace(o,t):i}}const Ao=Eo(/[A-Z]/,n=>`-${n.toLowerCase()}`);function ko(n){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError(`expected an argument of type object, but got ${typeof n}`);return Object.keys(n).map(t=>`${Ao(t)}: ${n[t]};`).join(`
|
|
3
3
|
`)}function Bo(n={}){return ko(n).replace(`
|
|
4
4
|
`," ")}const Po={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"};Bo(Po);const Mo=typeof window<"u"?window:void 0;function Co(n){let t=n.activeElement;for(;t?.shadowRoot;){const o=t.shadowRoot.activeElement;if(o===t)break;t=o}return t}class Do{#e;#t;constructor(t={}){const{window:o=Mo,document:i=o?.document}=t;o!==void 0&&(this.#e=i,this.#t=Qt(r=>{const u=xt(o,"focusin",r),a=xt(o,"focusout",r);return()=>{u(),a()}}))}get current(){return this.#t?.(),this.#e?Co(this.#e):null}}new Do;const ke=F("mode-watcher-mode"),Be=F("mode-watcher-theme"),Lo=["dark","light","system"];function Ue(n){return typeof n!="string"?!1:Lo.includes(n)}class Oo{#e="system";#t=ue?localStorage:nn;#o=this.#t.getItem(ke.current);#n=Ue(this.#o)?this.#o:this.#e;#r=B(Rt(this.#i()));#i(t=this.#n){return new en(ke.current,t,{serializer:{serialize:o=>o,deserialize:o=>Ue(o)?o:this.#e}})}constructor(){De(()=>Le.pre(()=>ke.current,(t,o)=>{const i=e(this.#r).current;c(this.#r,this.#i(i),!0),o&&localStorage.removeItem(o)}))}get current(){return e(this.#r).current}set current(t){e(this.#r).current=t}}class zo{#e=void 0;#t=!0;#o=B(Rt(this.#e));#n=typeof window<"u"&&typeof window.matchMedia=="function"?new kn("prefers-color-scheme: light"):{current:!1};query(){ue&&c(this.#o,this.#n.current?"light":"dark",!0)}tracking(t){this.#t=t}constructor(){De(()=>{Ge(()=>{this.#t&&this.query()})}),this.query=this.query.bind(this),this.tracking=this.tracking.bind(this)}get current(){return e(this.#o)}}const Ke=new Oo,No=new zo;class Ro{#e=ue?localStorage:nn;#t=this.#e.getItem(Be.current);#o=this.#t===null||this.#t===void 0?"":this.#t;#n=B(Rt(this.#r()));#r(t=this.#o){return new en(Be.current,t,{serializer:{serialize:o=>typeof o!="string"?"":o,deserialize:o=>o}})}constructor(){De(()=>Le.pre(()=>Be.current,(t,o)=>{const i=e(this.#n).current;c(this.#n,this.#r(i),!0),o&&localStorage.removeItem(o)}))}get current(){return e(this.#n).current}set current(t){e(this.#n).current=t}}new Ro;let Ye,Ze,Xe=!1,Zt=null;function Ho(){return Zt||(Zt=document.createElement("style"),Zt.appendChild(document.createTextNode(`* {
|
|
5
5
|
-webkit-transition: none !important;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as u,f as h,s as a}from"../chunks/0x0awhVy.js";import"../chunks/Bl1mtM70.js";import{q as g,f as v,A as l,v as d,w as e,z as o,x}from"../chunks/8FUQuwgM.js";import{i as _}from"../chunks/DxxhVGi2.js";import{s as $,p}from"../chunks/
|
|
1
|
+
import{a as u,f as h,s as a}from"../chunks/0x0awhVy.js";import"../chunks/Bl1mtM70.js";import{q as g,f as v,A as l,v as d,w as e,z as o,x}from"../chunks/8FUQuwgM.js";import{i as _}from"../chunks/DxxhVGi2.js";import{s as $,p}from"../chunks/CIZkRAuY.js";const k={get error(){return p.error},get status(){return p.status}};$.updated.check;const m=k;var b=h("<h1> </h1> <p> </p>",1);function j(i,f){g(f,!1),_();var t=b(),r=v(t),n=e(r,!0);o(r);var s=x(r,2),c=e(s,!0);o(s),l(()=>{a(n,m.status),a(c,m.error?.message)}),u(i,t),d()}export{j as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n,s as $,f as d}from"../chunks/0x0awhVy.js";import"../chunks/Bl1mtM70.js";import{q as b,t as C,v as A,w as t,x as l,y as S,z as e,A as V}from"../chunks/8FUQuwgM.js";import{i as m}from"../chunks/CbJfRYJV.js";import{i as k}from"../chunks/DxxhVGi2.js";import{A as P}from"../chunks/
|
|
1
|
+
import{a as n,s as $,f as d}from"../chunks/0x0awhVy.js";import"../chunks/Bl1mtM70.js";import{q as b,t as C,v as A,w as t,x as l,y as S,z as e,A as V}from"../chunks/8FUQuwgM.js";import{i as m}from"../chunks/CbJfRYJV.js";import{i as k}from"../chunks/DxxhVGi2.js";import{A as P}from"../chunks/Scb_NG-a.js";import{V as q,C as z}from"../chunks/DKIqe64p.js";import{w as p}from"../chunks/EDLlAC9C.js";import{n as E}from"../chunks/glgUBDR2.js";var L=d('<h2 class="svelte-1uha8ag"> </h2>'),T=d('<div class="content-row svelte-1uha8ag"><div class="entity-area svelte-1uha8ag"><!> <div class="welcome svelte-1uha8ag"><!> <p class="svelte-1uha8ag">Select an entity from the sidebar to get started.</p></div></div> <!></div>');function M(c,f){b(f,!1);const h=C("chat");E.showEntity(),k(),P(c,{children:(g,W)=>{var o=T(),s=t(o),i=t(s);q(i,{activeView:"entity"});var v=l(i,2),_=t(v);{var u=a=>{var r=L(),y=t(r);e(r),V(()=>$(y,`Welcome to ${(p.name||"Studiograph")??""}`)),n(a,r)};m(_,a=>{p.nameLoaded&&a(u)})}S(2),e(v),e(s);var w=l(s,2);{var x=a=>{z(a,{})};m(w,a=>{h.open&&a(x)})}e(o),n(g,o)},$$slots:{default:!0}}),A()}export{M as component};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/DnL9f0lc.js","../chunks/CX_61fY8.js","../chunks/CscoF-YL.js","../chunks/D7ZqAKi9.js","../chunks/C7VoTosa.js","../chunks/CrdV0ttd.js","../chunks/CWQRQXxy.js","../chunks/DKQjBKyp.js","../chunks/
|
|
2
|
-
import{f as ra,r as lt,s as tt,w as yt,h as At,i as Be,g as sa,a as Lt,j as ia}from"../chunks/EDLlAC9C.js";import{c as Ne,_ as qe}from"../chunks/DJKRyj_1.js";import{j as Dt,g as Ue,e as Je,a as y,c as Le,t as Ye,s as me,f as N}from"../chunks/0x0awhVy.js";import{M as oa,b as qt,q as at,F as Ae,a7 as Qe,a as Ge,S as la,w as C,x as Y,z as m,g as e,D as E,v as nt,f as we,y as Ve,A as ye,T as De,bn as Vt,aj as ot,t as Wt,R as ca,bo as Ht}from"../chunks/8FUQuwgM.js";import{p as ct,i as Se,b as kt,l as Ze,s as Xe}from"../chunks/CbJfRYJV.js";import{e as Me,i as Ke,a as je,n as Pt,r as ua}from"../chunks/Co733CqR.js";import{g as Rt,i as da}from"../chunks/BeqErRmy.js";import{I as $e,s as et,b as fa,P as va,C as ha,c as zt,S as pa,T as _a,R as ga,d as ma,e as wt,X as Ft,p as Mt,A as ya,f as wa,g as ka,h as ba,i as xa,j as Ea,k as Ca,l as Sa,m as Pa,r as Aa}from"../chunks/DPUtMAph.js";import{c as Ra,V as Da,C as Ta}from"../chunks/CSTvkpxy.js";import{b as Bt,B as Ie}from"../chunks/BVmVTxxa.js";import"../chunks/Bl1mtM70.js";import{C as Oa}from"../chunks/BnR489ON.js";import{g as La}from"../chunks/CqkleIqs.js";function za(W,t,f){oa(()=>{var i=qt(()=>t(W,f?.())||{});if(i?.destroy)return()=>i.destroy()})}const Fa=async({params:W,fetch:t})=>{const{repo:f,type:i,id:u}=W,D=await ra(f,i,u);return{repo:f,type:i,id:u,entity:D}},mr=Object.freeze(Object.defineProperty({__proto__:null,load:Fa},Symbol.toStringTag,{value:"Module"}));var Ma=N('<span class="chip svelte-84vb17"> <!></span>'),Ia=N('<div><span class="entity-title svelte-84vb17"> </span> <span class="entity-meta svelte-84vb17"><span class="entity-type-badge svelte-84vb17"> </span> <span class="entity-repo svelte-84vb17"> </span></span></div>'),ja=N('<div class="dropdown svelte-84vb17"></div>'),Na=N('<div class="autocomplete svelte-84vb17"><div class="input-row svelte-84vb17"><!> <input class="ac-input svelte-84vb17" type="text" placeholder="Search entities..."/></div> <!></div>');function Ua(W,t){at(t,!0);let f=ct(t,"multi",3,!1),i=Ae(""),u=Ae(0),D;const b=De(()=>yt.repos.flatMap(w=>w.entities.map(h=>({id:h.id,title:h.title,entityType:h.entityType,repo:w.name})))),x=De(()=>()=>{const w=e(i).toLowerCase().trim();return w?e(b).filter(h=>h.title.toLowerCase().includes(w)||h.id.toLowerCase().includes(w)).slice(0,20):e(b).slice(0,20)}),J=Array.isArray(t.value)?[...t.value]:t.value?[t.value]:[];let d=Ae(Qe(J));Ge(()=>{la().then(()=>D?.focus())});function Q(w){f()?(e(d).includes(w)||E(d,[...e(d),w],!0),E(i,""),E(u,0),D?.focus()):t.onselect(w)}function H(w){E(d,e(d).filter(h=>h!==w),!0)}function j(){e(d).length===J.length&&e(d).every((h,a)=>h===J[a])?t.oncancel():t.onselect(e(d))}function G(w){const h=e(x)();w.key==="ArrowDown"?(w.preventDefault(),E(u,Math.min(e(u)+1,h.length-1),!0)):w.key==="ArrowUp"?(w.preventDefault(),E(u,Math.max(e(u)-1,0),!0)):w.key==="Enter"?(w.preventDefault(),h.length>0?Q(h[e(u)].id):f()&&j()):w.key==="Escape"?f()&&e(d).length>0?j():t.oncancel():w.key==="Backspace"&&!e(i)&&f()&&e(d).length>0&&E(d,e(d).slice(0,-1),!0)}var ve=Na(),q=C(ve),ke=C(q);{var Ee=w=>{var h=Le(),a=we(h);Me(a,17,()=>e(d),Ke,(n,o)=>{var _=Ma(),k=C(_),U=Y(k);Ie(U,{variant:"ghost",size:"icon",class:"chip-remove",onclick:()=>H(e(o)),children:(ge,Ce)=>{Ve();var g=Ye("×");y(ge,g)},$$slots:{default:!0}}),m(_),ye(()=>me(k,`${e(o)??""} `)),y(n,_)}),y(w,h)};Se(ke,w=>{f()&&w(Ee)})}var $=Y(ke,2);lt($),kt($,w=>D=w,()=>D),m(q);var le=Y(q,2);{var _e=w=>{var h=ja();Me(h,21,()=>e(x)(),Ke,(a,n,o)=>{var _=Ia();let k;var U=C(_),ge=C(U,!0);m(U);var Ce=Y(U,2),g=C(Ce),l=C(g,!0);m(g);var c=Y(g,2),R=C(c,!0);m(c),m(Ce),m(_),ye(()=>{k=tt(_,1,"dropdown-item svelte-84vb17",null,k,{highlighted:o===e(u)}),me(ge,e(n).title),me(l,e(n).entityType),me(R,e(n).repo)}),Ue("mousedown",_,v=>{v.preventDefault(),Q(e(n).id)}),Je("mouseenter",_,()=>E(u,o,!0)),y(a,_)}),m(h),y(w,h)},he=De(()=>e(x)().length>0);Se(le,w=>{e(he)&&w(_e)})}m(ve),Ue("keydown",$,G),Je("blur",$,()=>{setTimeout(()=>{f()&&e(d).length>0?j():f()||t.oncancel()},150)}),Bt($,()=>e(i),w=>E(i,w)),y(W,ve),nt()}Dt(["keydown","mousedown"]);function ht(W,t){const f=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"M12 4v16"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2"}],["path",{d:"M9 20h6"}]];$e(W,Xe({name:"type"},()=>f,{get iconNode(){return i},children:(u,D)=>{var b=Le(),x=we(b);et(x,t,"default",{}),y(u,b)},$$slots:{default:!0}}))}function pt(W,t){const f=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"M8 2v4"}],["path",{d:"M16 2v4"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}],["path",{d:"M3 10h18"}]];$e(W,Xe({name:"calendar"},()=>f,{get iconNode(){return i},children:(u,D)=>{var b=Le(),x=we(b);et(x,t,"default",{}),y(u,b)},$$slots:{default:!0}}))}function _t(W,t){const f=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["circle",{cx:"12",cy:"12",r:"10"}],["circle",{cx:"12",cy:"12",r:"1"}]];$e(W,Xe({name:"circle-dot"},()=>f,{get iconNode(){return i},children:(u,D)=>{var b=Le(),x=we(b);et(x,t,"default",{}),y(u,b)},$$slots:{default:!0}}))}function gt(W,t){const f=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]];$e(W,Xe({name:"link"},()=>f,{get iconNode(){return i},children:(u,D)=>{var b=Le(),x=we(b);et(x,t,"default",{}),y(u,b)},$$slots:{default:!0}}))}function Yt(W,t){const f=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor"}]];$e(W,Xe({name:"tag"},()=>f,{get iconNode(){return i},children:(u,D)=>{var b=Le(),x=we(b);et(x,t,"default",{}),y(u,b)},$$slots:{default:!0}}))}function Ka(W,t){const f=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"m15 18-6-6 6-6"}]];$e(W,Xe({name:"chevron-left"},()=>f,{get iconNode(){return i},children:(u,D)=>{var b=Le(),x=we(b);et(x,t,"default",{}),y(u,b)},$$slots:{default:!0}}))}var qa=N('<span class="ip-menu-check svelte-x7sio8"><!></span>'),Va=N('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span> </span> <!>',1),Wa=N('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span>Remove</span>',1),Ha=N("<!> <!> <!>",1),Ba=N("<!> <!>",1),Ya=N('<input class="ip-edit-input svelte-x7sio8" type="text"/>'),Ja=N('<span class="ip-status-dot svelte-x7sio8"></span> ',1),Qa=N('<div class="ip-status-wrap svelte-x7sio8"><div class="ip-status-value svelte-x7sio8"><span class="ip-status-dot svelte-x7sio8"></span> <span class="ip-status-text svelte-x7sio8"> </span></div> <div class="ip-status-dropdown svelte-x7sio8"></div></div>'),Ga=N('<span class="ip-cal-wd svelte-x7sio8"> </span>'),Za=N('<div class="ip-cal-week svelte-x7sio8"></div>'),Xa=N('<div class="ip-cal-wrap svelte-x7sio8"><span class="ip-date-text svelte-x7sio8"> </span> <div class="ip-cal-dropdown svelte-x7sio8"><div class="ip-cal-header svelte-x7sio8"><!> <span class="ip-cal-title svelte-x7sio8"> </span> <!></div> <div class="ip-cal-weekdays svelte-x7sio8"></div> <!></div></div>'),$a=N('<span class="ip-badge svelte-x7sio8"> </span>'),en=N('<div class="ip-wikilink-group svelte-x7sio8"></div>'),tn=N('<div class="ip-status-value svelte-x7sio8"><span class="ip-status-dot svelte-x7sio8"></span> <span class="ip-status-text svelte-x7sio8"> </span></div>'),an=N('<span class="ip-date-text svelte-x7sio8"> </span>'),nn=N('<a class="ip-url-link svelte-x7sio8" target="_blank" rel="noopener noreferrer"> </a>'),rn=N('<span class="ip-text-value svelte-x7sio8"> </span>'),sn=N('<div><div class="ip-icon svelte-x7sio8"><!></div> <div class="ip-key svelte-x7sio8"> </div> <div class="ip-value svelte-x7sio8"><!></div></div>'),on=N('<div class="ip-row ip-add-row svelte-x7sio8"><div class="ip-icon svelte-x7sio8"><!></div> <div class="ip-key svelte-x7sio8"><input class="ip-add-key-input svelte-x7sio8" type="text" placeholder="Property name"/></div> <div class="ip-value svelte-x7sio8"></div></div>'),ln=N("<!> <span>Add property</span>",1),cn=N('<div class="inline-properties svelte-x7sio8"><!> <!></div>');function un(W,t){at(t,!0);let f=ct(t,"editable",3,!1);const i=[{type:"text",label:"Text"},{type:"date",label:"Date"},{type:"status",label:"Status"},{type:"wikilink",label:"Link"}],u=["active","inactive","in-progress","completed","draft","archived","current","former","won","lost","open","closed"];let D=Ae(null),b=Ae(!1),x=Ae(""),J=Ae(void 0);function d(r){switch(r.toLowerCase()){case"active":case"current":case"won":return"#3ecf8e";case"in-progress":case"open":return"#f0c246";case"inactive":case"lost":case"closed":case"former":return"#e54d4d";default:return"#5c5c66"}}function Q(r){for(const s of yt.repos){const T=s.entities.find(O=>O.id===r);if(T){Rt(`/${s.name}/${T.entityType}/${T.id}`);return}}}function H(r){return typeof r.value=="string"?r.value:r.value[0]}function j(r){return/^https?:\/\//.test(r)}function G(r){try{return new Date(r).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return r}}let ve=Ae(Qe(new Date().getFullYear())),q=Ae(Qe(new Date().getMonth()));const ke=["Su","Mo","Tu","We","Th","Fr","Sa"],Ee=["January","February","March","April","May","June","July","August","September","October","November","December"];function $(r,s){const T=new Date(r,s,1).getDay(),O=new Date(r,s+1,0).getDate(),B=new Date(r,s,0).getDate(),P=[];let A=[];for(let ee=T-1;ee>=0;ee--){const S=B-ee,se=s===0?11:s-1,fe=s===0?r-1:r;A.push({day:S,month:se,year:fe,outside:!0})}for(let ee=1;ee<=O;ee++)A.push({day:ee,month:s,year:r,outside:!1}),A.length===7&&(P.push(A),A=[]);if(A.length>0){const ee=s===11?0:s+1,S=s===11?r+1:r;let se=1;for(;A.length<7;)A.push({day:se++,month:ee,year:S,outside:!0});P.push(A)}return P}function le(r){const s=new Date;return r.day===s.getDate()&&r.month===s.getMonth()&&r.year===s.getFullYear()}function _e(r,s){const T=s.slice(0,10).split("-");return r.year===+T[0]&&r.month===+T[1]-1&&r.day===+T[2]}function he(){e(q)===0?(E(q,11),ot(ve,-1)):ot(q,-1)}function w(){e(q)===11?(E(q,0),ot(ve)):ot(q)}function h(r){try{const s=r.slice(0,10).split("-");E(ve,+s[0]),E(q,+s[1]-1)}catch{const s=new Date;E(ve,s.getFullYear(),!0),E(q,s.getMonth(),!0)}}function a(r){requestAnimationFrame(()=>{r.focus(),r.select()})}function n(r){!f()||r.type==="badge"||(r.type==="date"&&h(H(r)),E(D,r.key,!0))}function o(r,s){t.onedit&&t.onedit(r,s),E(D,null)}function _(r,s){const T=`${s.year}-${String(s.month+1).padStart(2,"0")}-${String(s.day).padStart(2,"0")}`;t.onedit&&t.onedit(r,T),E(D,null)}function k(r,s){t.ontypechange&&t.ontypechange(r,s)}function U(r){E(D,null),t.onremove&&t.onremove(r)}function ge(){E(b,!0),E(x,""),requestAnimationFrame(()=>e(J)?.focus())}function Ce(){const r=e(x).trim();r&&t.onadd&&t.onadd(r,""),E(b,!1),E(x,"")}function g(){E(b,!1),E(x,"")}function l(r){r.key==="Enter"?(r.preventDefault(),Ce()):r.key==="Escape"&&g()}var c=cn();Je("click",Vt,()=>{E(D,null)});var R=C(c);Me(R,17,()=>t.properties,r=>r.key,(r,s)=>{const T=De(()=>e(D)===e(s).key);var O=sn();let B;var P=C(O),A=C(P);{var ee=z=>{var F=Le(),M=we(F);Ne(M,()=>ga,(K,oe)=>{oe(K,{children:(ue,be)=>{var Z=Ba(),te=we(Z);Ne(te,()=>fa,(X,V)=>{V(X,{class:"ip-icon-trigger",children:(ne,pe)=>{var xe=Le(),Te=we(xe);{var Oe=ze=>{pt(ze,{size:14})},He=ze=>{_t(ze,{size:14})},rt=ze=>{gt(ze,{size:14})},ut=ze=>{ht(ze,{size:14})};Se(Te,ze=>{e(s).type==="date"?ze(Oe):e(s).type==="status"?ze(He,1):e(s).type==="wikilink"?ze(rt,2):ze(ut,!1)})}y(ne,xe)},$$slots:{default:!0}})});var Re=Y(te,2);Ne(Re,()=>va,(X,V)=>{V(X,{children:(ne,pe)=>{var xe=Le(),Te=we(xe);Ne(Te,()=>ha,(Oe,He)=>{He(Oe,{class:"ip-menu-content",sideOffset:4,align:"start",children:(rt,ut)=>{var ze=Ha(),bt=we(ze);Me(bt,17,()=>i,Ke,(it,We)=>{var dt=Le(),Tt=we(dt);Ne(Tt,()=>zt,(ft,vt)=>{vt(ft,{class:"ip-menu-item",onSelect:()=>k(e(s).key,e(We).type),children:(xt,rr)=>{var Ot=Va(),Et=we(Ot),Qt=C(Et);{var Gt=Fe=>{ht(Fe,{size:13})},Zt=Fe=>{pt(Fe,{size:13})},Xt=Fe=>{_t(Fe,{size:13})},$t=Fe=>{gt(Fe,{size:13})};Se(Qt,Fe=>{e(We).type==="text"?Fe(Gt):e(We).type==="date"?Fe(Zt,1):e(We).type==="status"?Fe(Xt,2):e(We).type==="wikilink"&&Fe($t,3)})}m(Et);var Ct=Y(Et,2),ea=C(Ct,!0);m(Ct);var ta=Y(Ct,2);{var aa=Fe=>{var St=qa(),na=C(St);Oa(na,{size:12}),m(St),y(Fe,St)};Se(ta,Fe=>{e(s).type===e(We).type&&Fe(aa)})}ye(()=>me(ea,e(We).label)),y(xt,Ot)},$$slots:{default:!0}})}),y(it,dt)});var st=Y(bt,2);Ne(st,()=>pa,(it,We)=>{We(it,{class:"ip-menu-sep"})});var Jt=Y(st,2);Ne(Jt,()=>zt,(it,We)=>{We(it,{class:"ip-menu-item ip-menu-destructive",onSelect:()=>U(e(s).key),children:(dt,Tt)=>{var ft=Wa(),vt=we(ft),xt=C(vt);_a(xt,{size:13}),m(vt),Ve(2),y(dt,ft)},$$slots:{default:!0}})}),y(rt,ze)},$$slots:{default:!0}})}),y(ne,xe)},$$slots:{default:!0}})}),y(ue,Z)},$$slots:{default:!0}})}),y(z,F)},S=z=>{var F=Le(),M=we(F);{var K=te=>{pt(te,{size:14})},oe=te=>{_t(te,{size:14})},ue=te=>{gt(te,{size:14})},be=te=>{Yt(te,{size:14})},Z=te=>{ht(te,{size:14})};Se(M,te=>{e(s).type==="date"?te(K):e(s).type==="status"?te(oe,1):e(s).type==="wikilink"?te(ue,2):e(s).type==="badge"?te(be,3):te(Z,!1)})}y(z,F)};Se(A,z=>{f()&&e(s).type!=="badge"?z(ee):z(S,!1)})}m(P);var se=Y(P,2),fe=C(se,!0);m(se);var re=Y(se,2),de=C(re);{var ae=z=>{var F=Ya();lt(F),za(F,M=>a?.(M)),ye(M=>At(F,M),[()=>H(e(s))]),Je("blur",F,M=>{const K=M.currentTarget.value;K!==H(e(s))&&t.onedit?.(e(s).key,K),E(D,null)}),Ue("keydown",F,M=>{M.key==="Enter"?M.currentTarget.blur():M.key==="Escape"&&(M.currentTarget.value=H(e(s)),E(D,null))}),y(z,F)},ce=z=>{var F=Qa(),M=C(F),K=C(M);let oe;var ue=Y(K,2),be=C(ue,!0);m(ue),m(M);var Z=Y(M,2);Me(Z,21,()=>u,Ke,(te,Re)=>{{let X=De(()=>H(e(s))===e(Re)?"selected":"");Ie(te,{variant:"ghost",get class(){return`ip-status-option ${e(X)??""}`},onclick:()=>o(e(s).key,e(Re)),children:(V,ne)=>{var pe=Ja(),xe=we(pe);let Te;var Oe=Y(xe);ye(He=>{Te=Be(xe,"",Te,He),me(Oe,` ${e(Re)??""}`)},[()=>({background:d(e(Re))})]),y(V,pe)},$$slots:{default:!0}})}}),m(Z),m(F),ye((te,Re)=>{oe=Be(K,"",oe,te),me(be,Re)},[()=>({background:d(H(e(s)))}),()=>H(e(s))]),Ue("click",F,te=>te.stopPropagation()),y(z,F)},I=z=>{var F=Xa(),M=C(F),K=C(M,!0);m(M);var oe=Y(M,2),ue=C(oe),be=C(ue);Ie(be,{variant:"ghost",size:"icon",class:"ip-cal-nav",onclick:he,children:(ne,pe)=>{Ka(ne,{size:14})},$$slots:{default:!0}});var Z=Y(be,2),te=C(Z);m(Z);var Re=Y(Z,2);Ie(Re,{variant:"ghost",size:"icon",class:"ip-cal-nav",onclick:w,children:(ne,pe)=>{ma(ne,{size:14})},$$slots:{default:!0}}),m(ue);var X=Y(ue,2);Me(X,21,()=>ke,Ke,(ne,pe)=>{var xe=Ga(),Te=C(xe,!0);m(xe),ye(()=>me(Te,e(pe))),y(ne,xe)}),m(X);var V=Y(X,2);Me(V,17,()=>$(e(ve),e(q)),Ke,(ne,pe)=>{var xe=Za();Me(xe,21,()=>e(pe),Ke,(Te,Oe)=>{{let He=De(()=>e(Oe).outside?"outside":""),rt=De(()=>le(e(Oe))?"today":""),ut=De(()=>_e(e(Oe),H(e(s)))?"selected":"");Ie(Te,{variant:"ghost",get class(){return`ip-cal-day ${e(He)??""} ${e(rt)??""} ${e(ut)??""}`},onclick:()=>_(e(s).key,e(Oe)),children:(ze,bt)=>{Ve();var st=Ye();ye(()=>me(st,e(Oe).day)),y(ze,st)},$$slots:{default:!0}})}}),m(xe),y(ne,xe)}),m(oe),m(F),ye(ne=>{me(K,ne),me(te,`${Ee[e(q)]??""} ${e(ve)??""}`)},[()=>G(H(e(s)))]),Ue("click",F,ne=>ne.stopPropagation()),y(z,F)},ie=z=>{{let F=De(()=>Array.isArray(e(s).value));Ua(z,{get value(){return e(s).value},get multi(){return e(F)},onselect:M=>{t.onedit?.(e(s).key,M),E(D,null)},oncancel:()=>{E(D,null)}})}},Pe=z=>{var F=Le(),M=we(F);{var K=X=>{var V=$a(),ne=C(V,!0);m(V),ye(pe=>me(ne,pe),[()=>H(e(s))]),y(X,V)},oe=X=>{var V=en();Me(V,21,()=>Array.isArray(e(s).value)?e(s).value:[e(s).value],Ke,(ne,pe)=>{Ie(ne,{variant:"ghost",class:"ip-wikilink-chip",onclick:xe=>{xe.stopPropagation(),Q(e(pe))},children:(xe,Te)=>{Ve();var Oe=Ye();ye(()=>me(Oe,e(pe))),y(xe,Oe)},$$slots:{default:!0}})}),m(V),y(X,V)},ue=X=>{var V=tn(),ne=C(V);let pe;var xe=Y(ne,2),Te=C(xe,!0);m(xe),m(V),ye((Oe,He)=>{pe=Be(ne,"",pe,Oe),me(Te,He)},[()=>({background:d(H(e(s)))}),()=>H(e(s))]),y(X,V)},be=X=>{var V=an(),ne=C(V,!0);m(V),ye(pe=>me(ne,pe),[()=>G(H(e(s)))]),y(X,V)},Z=X=>{var V=nn(),ne=C(V,!0);m(V),ye((pe,xe)=>{sa(V,"href",pe),me(ne,xe)},[()=>H(e(s)),()=>H(e(s))]),Ue("click",V,pe=>pe.stopPropagation()),y(X,V)},te=De(()=>j(H(e(s)))),Re=X=>{var V=rn(),ne=C(V,!0);m(V),ye(pe=>me(ne,pe),[()=>H(e(s))]),y(X,V)};Se(M,X=>{e(s).type==="badge"?X(K):e(s).type==="wikilink"?X(oe,1):e(s).type==="status"?X(ue,2):e(s).type==="date"?X(be,3):e(te)?X(Z,4):X(Re,!1)})}y(z,F)};Se(de,z=>{e(T)&&e(s).type==="text"?z(ae):e(T)&&e(s).type==="status"?z(ce,1):e(T)&&e(s).type==="date"?z(I,2):e(T)&&e(s).type==="wikilink"?z(ie,3):z(Pe,!1)})}m(re),m(O),ye(()=>{B=tt(O,1,"ip-row svelte-x7sio8",null,B,{"ip-focused":e(T)}),me(fe,e(s).key)}),Ue("click",P,z=>z.stopPropagation()),Ue("click",re,z=>{z.stopPropagation(),n(e(s))}),y(r,O)});var v=Y(R,2);{var p=r=>{var s=on(),T=C(s),O=C(T);wt(O,{size:14}),m(T);var B=Y(T,2),P=C(B);lt(P),kt(P,A=>E(J,A),()=>e(J)),m(B),Ve(2),m(s),Ue("keydown",P,l),Je("blur",P,g),Bt(P,()=>e(x),A=>E(x,A)),y(r,s)},L=r=>{Ie(r,{variant:"ghost",class:"ip-add-btn",onclick:s=>{s.stopPropagation(),ge()},children:(s,T)=>{var O=ln(),B=we(O);wt(B,{size:14}),Ve(2),y(s,O)},$$slots:{default:!0}})};Se(v,r=>{e(b)?r(p):f()&&r(L,1)})}m(c),y(W,c),nt()}Dt(["click","keydown"]);var dn=N('<div class="remote-cursor svelte-ok7wy5"><span class="remote-cursor-label svelte-ok7wy5"> </span></div>'),fn=N('<div class="cursor-overlay svelte-ok7wy5"></div>'),vn=N('<div class="editor-wrap svelte-ok7wy5"><div class="cm-container svelte-ok7wy5"></div> <!></div>');function hn(W,t){at(t,!0);let f=ct(t,"readonly",3,!0),i=ct(t,"resetKey",3,0);const u=Wt("theme");let D,b=null,x=null,J=Ae(""),d=null,Q=Ae(Qe([])),H=null,j=t.content;function G(le,_e){return le.theme({"&":{backgroundColor:"transparent",color:"var(--color-text-primary)",fontSize:"15px",fontFamily:"var(--font-sans)"},".cm-content":{padding:"32px 40px",fontFamily:"var(--font-sans)",caretColor:"var(--color-accent)",lineHeight:"1.6"},".cm-cursor":{borderLeftColor:"var(--color-accent)"},".cm-selectionBackground":{backgroundColor:_e?"rgba(110,110,232,0.2)":"rgba(110,110,232,0.15)"},"&.cm-focused .cm-selectionBackground":{backgroundColor:_e?"rgba(110,110,232,0.3)":"rgba(110,110,232,0.2)"},".cm-gutters":{display:"none"},".cm-activeLine":{backgroundColor:"transparent"},".cm-line":{padding:"0"},".cm-header-1":{fontSize:"22px",fontWeight:"600"},".cm-header-2":{fontSize:"16px",fontWeight:"600"},".cm-header-3":{fontSize:"15px",fontWeight:"600"},".cm-formatting":{color:"var(--color-text-tertiary)",opacity:"0.5"},".cm-link":{color:"var(--color-link)",textDecoration:"none"}},{dark:_e})}async function ve(){b&&(b.destroy(),b=null),x&&(x.destroy(),x=null),E(Q,[],!0);const{EditorState:le,Transaction:_e}=await qe(async()=>{const{EditorState:r,Transaction:s}=await import("../chunks/CX_61fY8.js");return{EditorState:r,Transaction:s}},[],import.meta.url);d=_e;const{EditorView:he,keymap:w,ViewPlugin:h}=await qe(async()=>{const{EditorView:r,keymap:s,ViewPlugin:T}=await import("../chunks/DnL9f0lc.js").then(O=>O.i);return{EditorView:r,keymap:s,ViewPlugin:T}},__vite__mapDeps([0,1]),import.meta.url),{markdown:a}=await qe(async()=>{const{markdown:r}=await import("../chunks/CscoF-YL.js");return{markdown:r}},__vite__mapDeps([2,1,0,3,4,5]),import.meta.url),{syntaxHighlighting:n,HighlightStyle:o}=await qe(async()=>{const{syntaxHighlighting:r,HighlightStyle:s}=await import("../chunks/D7ZqAKi9.js");return{syntaxHighlighting:r,HighlightStyle:s}},__vite__mapDeps([3,4,1,0]),import.meta.url),{history:_,defaultKeymap:k,historyKeymap:U}=await qe(async()=>{const{history:r,defaultKeymap:s,historyKeymap:T}=await import("../chunks/CWQRQXxy.js");return{history:r,defaultKeymap:s,historyKeymap:T}},__vite__mapDeps([6,1,0,3,4]),import.meta.url),{tags:ge}=await qe(async()=>{const{tags:r}=await import("../chunks/C7VoTosa.js").then(s=>s.i);return{tags:r}},[],import.meta.url),{livePreviewPlugin:Ce,livePreviewTheme:g}=await qe(async()=>{const{livePreviewPlugin:r,livePreviewTheme:s}=await import("../chunks/DKQjBKyp.js");return{livePreviewPlugin:r,livePreviewTheme:s}},__vite__mapDeps([7,0,1,3,4]),import.meta.url),l=u.current==="dark",c=G(he,l),R=o.define([{tag:ge.processingInstruction,color:"var(--color-text-tertiary)",opacity:"0.7"}]),v=[a(),c,n(R),Ce,g,he.lineWrapping];f()&&v.push(le.readOnly.of(!0));let p=!1;if(t.cursorDocName&&!f())try{let I=function(){if(!b||!S){E(Q,[],!0);return}const z=S.awareness,F=S.ytext,M=F.doc;if(!M){E(Q,[],!0);return}const K=[],oe=b.dom.getBoundingClientRect();z.getStates().forEach((ue,be)=>{if(be===ce)return;const Z=ue.cursor;if(!Z?.head)return;const{name:te="Anonymous",color:Re="#6e6ee8"}=ue.user||{};let X;try{X=A.createRelativePositionFromJSON(Z.head)}catch{return}const V=A.createAbsolutePositionFromRelativePosition(X,M);if(!V||V.type!==F)return;const ne=b.coordsAtPos(Math.min(V.index,b.state.doc.length));ne&&K.push({id:be,name:te,color:Re,top:ne.top-oe.top,left:ne.left-oe.left,height:ne.bottom-ne.top})}),E(Q,K,!0)},ie=function(){H&&cancelAnimationFrame(H),H=requestAnimationFrame(()=>{H=null,I()})},Pe=function({added:z,updated:F,removed:M}){[...z,...F,...M].some(oe=>oe!==ce)&&ie()};const{createCollabSession:r}=await qe(async()=>{const{createCollabSession:z}=await import("../chunks/buWG8Dmo.js");return{createCollabSession:z}},__vite__mapDeps([8,9,10,11,12,13,14,15]),import.meta.url),{ySync:s,ySyncFacet:T,YSyncConfig:O,yUndoManagerKeymap:B}=await qe(async()=>{const{ySync:z,ySyncFacet:F,YSyncConfig:M,yUndoManagerKeymap:K}=await import("../chunks/i9c_RUF6.js");return{ySync:z,ySyncFacet:F,YSyncConfig:M,yUndoManagerKeymap:K}},__vite__mapDeps([16,9,0,1]),import.meta.url),{auth:P}=await qe(async()=>{const{auth:z}=await import("../chunks/EDLlAC9C.js").then(F=>F.x);return{auth:z}},__vite__mapDeps([15,11,13,12]),import.meta.url),A=await qe(()=>import("../chunks/CLFba8FK.js").then(z=>z.A),[],import.meta.url),ee=getComputedStyle(document.documentElement).getPropertyValue("--color-accent").trim()||"#6e6ee8",S=r(t.cursorDocName,{name:P.user?.displayName??"Anonymous",color:ee,colorLight:ee+"33"}),se=new A.UndoManager(S.ytext,{captureTimeout:500}),{yUndoManagerFacet:fe,yUndoManager:re,YUndoManagerConfig:de}=await qe(async()=>{const{yUndoManagerFacet:z,yUndoManager:F,YUndoManagerConfig:M}=await import("../chunks/i9c_RUF6.js");return{yUndoManagerFacet:z,yUndoManager:F,YUndoManagerConfig:M}},__vite__mapDeps([16,9,0,1]),import.meta.url),ae=new O(S.ytext,S.awareness);v.push(T.of(ae),s,fe.of(new de(se)),re,w.of(B)),v.push(h.define(z=>{function F(){const M=z.state.selection.main,K=S.ytext,oe=A.createRelativePositionFromTypeIndex(K,M.anchor),ue=A.createRelativePositionFromTypeIndex(K,M.head);S.awareness.setLocalStateField("cursor",{anchor:A.relativePositionToJSON(oe),head:A.relativePositionToJSON(ue)})}return F(),{update(M){(M.selectionSet||M.docChanged)&&F()}}}));const ce=S.ydoc.clientID;S.awareness.on("change",Pe),v.push(h.define(()=>({update(z){(z.docChanged||z.geometryChanged||z.viewportChanged)&&ie()},destroy(){S.awareness.off("change",Pe)}}))),x=S,p=!0}catch(r){console.warn("Yjs collab setup failed, falling back to solo editing:",r)}if(!f()&&!p?(v.push(_({newGroupDelay:500})),v.push(w.of([...k,...U]))):!f()&&p&&v.push(w.of(k)),t.onchange)if(p){const r=Date.now();v.push(he.updateListener.of(s=>{if(s.docChanged&&Date.now()-r>1e3&&s.transactions.some(O=>O.isUserEvent("input")||O.isUserEvent("delete")||O.isUserEvent("move")||O.isUserEvent("undo")||O.isUserEvent("redo"))){const O=s.state.doc.toString();j=O,t.onchange(O)}}))}else v.push(he.updateListener.of(r=>{if(r.docChanged){const s=r.state.doc.toString();j=s,t.onchange(s)}}));v.push(he.domEventHandlers({click(r){const s=r.target;if(t.onwikilinkclick){const O=s.closest(".cm-live-wikilink");if(O){r.preventDefault();const B=O.textContent?.replace(/^\[{1,2}|\]{1,2}$/g,"").trim();return B&&t.onwikilinkclick(B),!0}}const T=s.closest(".cm-live-link");if(T){const O=T.getAttribute("data-href");if(O)return r.preventDefault(),window.open(O,"_blank","noopener,noreferrer"),!0}return!1}})),t.onsave&&v.push(w.of([{key:"Mod-s",run:()=>(t.onsave(),!0)}]));const L=le.create({doc:p?"":t.content,extensions:v});b=new he({state:L,parent:D}),j=p?"":t.content,E(J,t.cursorDocName??"",!0)}ca(()=>{ve()}),Ge(()=>{t.cursorDocName&&e(J)&&t.cursorDocName!==e(J)&&ve()}),Ge(()=>{if(i(),b&&!x&&t.content!==j){j=t.content;const le=D.closest(".document-scroll"),_e=le?.scrollTop??0;b.dispatch({changes:{from:0,to:b.state.doc.length,insert:t.content},...d?{annotations:d.addToHistory.of(!1)}:{}}),le&&requestAnimationFrame(()=>{le.scrollTop=_e})}}),Ht(()=>{H&&cancelAnimationFrame(H),x?.destroy(),x=null,b?.destroy()});var q=vn(),ke=C(q);kt(ke,le=>D=le,()=>D);var Ee=Y(ke,2);{var $=le=>{var _e=fn();Me(_e,21,()=>e(Q),he=>he.id,(he,w)=>{var h=dn(),a=C(h),n=C(a,!0);m(a),m(h),ye(()=>{Be(h,`top: ${e(w).top??""}px; left: ${e(w).left??""}px; height: ${e(w).height??""}px; --cursor-color: ${e(w).color??""};`),Be(a,`background-color: ${e(w).color??""};`),me(n,e(w).name)}),y(he,h)}),m(_e),y(le,_e)};Se(Ee,le=>{e(Q).length>0&&le($)})}m(q),y(W,q),nt()}var mt={exports:{}};var pn=mt.exports,It;function _n(){return It||(It=1,(function(W,t){((f,i)=>{W.exports=i()})(pn,function f(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},u,D=!i.document&&!!i.postMessage,b=i.IS_PAPA_WORKER||!1,x={},J=0,d={};function Q(a){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(n){var o=he(n);o.chunkSize=parseInt(o.chunkSize),n.step||n.chunk||(o.chunkSize=null),this._handle=new q(o),(this._handle.streamer=this)._config=o}).call(this,a),this.parseChunk=function(n,o){var _=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<_){let U=this._config.newline;U||(k=this._config.quoteChar||'"',U=this._handle.guessLineEndings(n,k)),n=[...n.split(U).slice(_)].join(U)}this.isFirstChunk&&h(this._config.beforeFirstChunk)&&(k=this._config.beforeFirstChunk(n))!==void 0&&(n=k),this.isFirstChunk=!1,this._halted=!1;var _=this._partialLine+n,k=(this._partialLine="",this._handle.parse(_,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(n=k.meta.cursor,_=(this._finished||(this._partialLine=_.substring(n-this._baseIndex),this._baseIndex=n),k&&k.data&&(this._rowCount+=k.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),b)i.postMessage({results:k,workerId:d.WORKER_ID,finished:_});else if(h(this._config.chunk)&&!o){if(this._config.chunk(k,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=k=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(k.data),this._completeResults.errors=this._completeResults.errors.concat(k.errors),this._completeResults.meta=k.meta),this._completed||!_||!h(this._config.complete)||k&&k.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),_||k&&k.meta.paused||this._nextChunk(),k}this._halted=!0},this._sendError=function(n){h(this._config.error)?this._config.error(n):b&&this._config.error&&i.postMessage({workerId:d.WORKER_ID,error:n,finished:!1})}}function H(a){var n;(a=a||{}).chunkSize||(a.chunkSize=d.RemoteChunkSize),Q.call(this,a),this._nextChunk=D?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(o){this._input=o,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(n=new XMLHttpRequest,this._config.withCredentials&&(n.withCredentials=this._config.withCredentials),D||(n.onload=w(this._chunkLoaded,this),n.onerror=w(this._chunkError,this)),n.open(this._config.downloadRequestBody?"POST":"GET",this._input,!D),this._config.downloadRequestHeaders){var o,_=this._config.downloadRequestHeaders;for(o in _)n.setRequestHeader(o,_[o])}var k;this._config.chunkSize&&(k=this._start+this._config.chunkSize-1,n.setRequestHeader("Range","bytes="+this._start+"-"+k));try{n.send(this._config.downloadRequestBody)}catch(U){this._chunkError(U.message)}D&&n.status===0&&this._chunkError()}},this._chunkLoaded=function(){n.readyState===4&&(n.status<200||400<=n.status?this._chunkError():(this._start+=this._config.chunkSize||n.responseText.length,this._finished=!this._config.chunkSize||this._start>=(o=>(o=o.getResponseHeader("Content-Range"))!==null?parseInt(o.substring(o.lastIndexOf("/")+1)):-1)(n),this.parseChunk(n.responseText)))},this._chunkError=function(o){o=n.statusText||o,this._sendError(new Error(o))}}function j(a){(a=a||{}).chunkSize||(a.chunkSize=d.LocalChunkSize),Q.call(this,a);var n,o,_=typeof FileReader<"u";this.stream=function(k){this._input=k,o=k.slice||k.webkitSlice||k.mozSlice,_?((n=new FileReader).onload=w(this._chunkLoaded,this),n.onerror=w(this._chunkError,this)):n=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var k=this._input,U=(this._config.chunkSize&&(U=Math.min(this._start+this._config.chunkSize,this._input.size),k=o.call(k,this._start,U)),n.readAsText(k,this._config.encoding));_||this._chunkLoaded({target:{result:U}})},this._chunkLoaded=function(k){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(k.target.result)},this._chunkError=function(){this._sendError(n.error)}}function G(a){var n;Q.call(this,a=a||{}),this.stream=function(o){return n=o,this._nextChunk()},this._nextChunk=function(){var o,_;if(!this._finished)return o=this._config.chunkSize,n=o?(_=n.substring(0,o),n.substring(o)):(_=n,""),this._finished=!n,this.parseChunk(_)}}function ve(a){Q.call(this,a=a||{});var n=[],o=!0,_=!1;this.pause=function(){Q.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){Q.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(k){this._input=k,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){_&&n.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),n.length?this.parseChunk(n.shift()):o=!0},this._streamData=w(function(k){try{n.push(typeof k=="string"?k:k.toString(this._config.encoding)),o&&(o=!1,this._checkIsFinished(),this.parseChunk(n.shift()))}catch(U){this._streamError(U)}},this),this._streamError=w(function(k){this._streamCleanUp(),this._sendError(k)},this),this._streamEnd=w(function(){this._streamCleanUp(),_=!0,this._streamData("")},this),this._streamCleanUp=w(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function q(a){var n,o,_,k,U=Math.pow(2,53),ge=-U,Ce=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,g=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,l=this,c=0,R=0,v=!1,p=!1,L=[],r={data:[],errors:[],meta:{}};function s(P){return a.skipEmptyLines==="greedy"?P.join("").trim()==="":P.length===1&&P[0].length===0}function T(){if(r&&_&&(B("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+d.DefaultDelimiter+"'"),_=!1),a.skipEmptyLines&&(r.data=r.data.filter(function(S){return!s(S)})),O()){let S=function(se,fe){h(a.transformHeader)&&(se=a.transformHeader(se,fe)),L.push(se)};if(r)if(Array.isArray(r.data[0])){for(var P=0;O()&&P<r.data.length;P++)r.data[P].forEach(S);r.data.splice(0,1)}else r.data.forEach(S)}function A(S,se){for(var fe=a.header?{}:[],re=0;re<S.length;re++){var de=re,ae=S[re],ae=((ce,I)=>(ie=>(a.dynamicTypingFunction&&a.dynamicTyping[ie]===void 0&&(a.dynamicTyping[ie]=a.dynamicTypingFunction(ie)),(a.dynamicTyping[ie]||a.dynamicTyping)===!0))(ce)?I==="true"||I==="TRUE"||I!=="false"&&I!=="FALSE"&&((ie=>{if(Ce.test(ie)&&(ie=parseFloat(ie),ge<ie&&ie<U))return 1})(I)?parseFloat(I):g.test(I)?new Date(I):I===""?null:I):I)(de=a.header?re>=L.length?"__parsed_extra":L[re]:de,ae=a.transform?a.transform(ae,de):ae);de==="__parsed_extra"?(fe[de]=fe[de]||[],fe[de].push(ae)):fe[de]=ae}return a.header&&(re>L.length?B("FieldMismatch","TooManyFields","Too many fields: expected "+L.length+" fields but parsed "+re,R+se):re<L.length&&B("FieldMismatch","TooFewFields","Too few fields: expected "+L.length+" fields but parsed "+re,R+se)),fe}var ee;r&&(a.header||a.dynamicTyping||a.transform)&&(ee=1,!r.data.length||Array.isArray(r.data[0])?(r.data=r.data.map(A),ee=r.data.length):r.data=A(r.data,0),a.header&&r.meta&&(r.meta.fields=L),R+=ee)}function O(){return a.header&&L.length===0}function B(P,A,ee,S){P={type:P,code:A,message:ee},S!==void 0&&(P.row=S),r.errors.push(P)}h(a.step)&&(k=a.step,a.step=function(P){r=P,O()?T():(T(),r.data.length!==0&&(c+=P.data.length,a.preview&&c>a.preview?o.abort():(r.data=r.data[0],k(r,l))))}),this.parse=function(P,A,ee){var S=a.quoteChar||'"',S=(a.newline||(a.newline=this.guessLineEndings(P,S)),_=!1,a.delimiter?h(a.delimiter)&&(a.delimiter=a.delimiter(P),r.meta.delimiter=a.delimiter):((S=((se,fe,re,de,ae)=>{var ce,I,ie,Pe;ae=ae||[","," ","|",";",d.RECORD_SEP,d.UNIT_SEP];for(var z=0;z<ae.length;z++){for(var F,M=ae[z],K=0,oe=0,ue=0,be=(ie=void 0,new Ee({comments:de,delimiter:M,newline:fe,preview:10}).parse(se)),Z=0;Z<be.data.length;Z++)re&&s(be.data[Z])?ue++:(F=be.data[Z].length,oe+=F,ie===void 0?ie=F:0<F&&(K+=Math.abs(F-ie),ie=F));0<be.data.length&&(oe/=be.data.length-ue),(I===void 0||K<=I)&&(Pe===void 0||Pe<oe)&&1.99<oe&&(I=K,ce=M,Pe=oe)}return{successful:!!(a.delimiter=ce),bestDelimiter:ce}})(P,a.newline,a.skipEmptyLines,a.comments,a.delimitersToGuess)).successful?a.delimiter=S.bestDelimiter:(_=!0,a.delimiter=d.DefaultDelimiter),r.meta.delimiter=a.delimiter),he(a));return a.preview&&a.header&&S.preview++,n=P,o=new Ee(S),r=o.parse(n,A,ee),T(),v?{meta:{paused:!0}}:r||{meta:{paused:!1}}},this.paused=function(){return v},this.pause=function(){v=!0,o.abort(),n=h(a.chunk)?"":n.substring(o.getCharIndex())},this.resume=function(){l.streamer._halted?(v=!1,l.streamer.parseChunk(n,!0)):setTimeout(l.resume,3)},this.aborted=function(){return p},this.abort=function(){p=!0,o.abort(),r.meta.aborted=!0,h(a.complete)&&a.complete(r),n=""},this.guessLineEndings=function(se,S){se=se.substring(0,1048576);var S=new RegExp(ke(S)+"([^]*?)"+ke(S),"gm"),ee=(se=se.replace(S,"")).split("\r"),S=se.split(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/DnL9f0lc.js","../chunks/CX_61fY8.js","../chunks/CscoF-YL.js","../chunks/D7ZqAKi9.js","../chunks/C7VoTosa.js","../chunks/CrdV0ttd.js","../chunks/CWQRQXxy.js","../chunks/DKQjBKyp.js","../chunks/CnKc_Tae.js","../chunks/CLFba8FK.js","../chunks/glgUBDR2.js","../chunks/8FUQuwgM.js","../chunks/0x0awhVy.js","../chunks/CbJfRYJV.js","../chunks/CIZkRAuY.js","../chunks/EDLlAC9C.js","../chunks/i9c_RUF6.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{f as ra,r as lt,s as tt,w as yt,h as At,i as Be,g as sa,a as Lt,j as ia}from"../chunks/EDLlAC9C.js";import{c as Ne,_ as qe}from"../chunks/DJKRyj_1.js";import{j as Dt,g as Ue,e as Je,a as y,c as Le,t as Ye,s as me,f as N}from"../chunks/0x0awhVy.js";import{M as oa,b as qt,q as at,F as Ae,a7 as Qe,a as Ge,S as la,w as C,x as Y,z as m,g as e,D as E,v as nt,f as we,y as Ve,A as ye,T as De,bn as Vt,aj as ot,t as Wt,R as ca,bo as Ht}from"../chunks/8FUQuwgM.js";import{p as ct,i as Se,b as kt,l as Ze,s as Xe}from"../chunks/CbJfRYJV.js";import{e as Me,i as Ke,a as je,n as Pt,r as ua}from"../chunks/glgUBDR2.js";import{g as Rt,i as da}from"../chunks/CIZkRAuY.js";import{I as $e,s as et,b as fa,P as va,C as ha,c as zt,S as pa,T as _a,R as ga,d as ma,e as wt,X as Ft,p as Mt,A as ya,f as wa,g as ka,h as ba,i as xa,j as Ea,k as Ca,l as Sa,m as Pa,r as Aa}from"../chunks/Scb_NG-a.js";import{c as Ra,V as Da,C as Ta}from"../chunks/DKIqe64p.js";import{b as Bt,B as Ie}from"../chunks/BVmVTxxa.js";import"../chunks/Bl1mtM70.js";import{C as Oa}from"../chunks/DVuLyxG5.js";import{g as La}from"../chunks/CqkleIqs.js";function za(W,t,f){oa(()=>{var i=qt(()=>t(W,f?.())||{});if(i?.destroy)return()=>i.destroy()})}const Fa=async({params:W,fetch:t})=>{const{repo:f,type:i,id:u}=W,D=await ra(f,i,u);return{repo:f,type:i,id:u,entity:D}},mr=Object.freeze(Object.defineProperty({__proto__:null,load:Fa},Symbol.toStringTag,{value:"Module"}));var Ma=N('<span class="chip svelte-84vb17"> <!></span>'),Ia=N('<div><span class="entity-title svelte-84vb17"> </span> <span class="entity-meta svelte-84vb17"><span class="entity-type-badge svelte-84vb17"> </span> <span class="entity-repo svelte-84vb17"> </span></span></div>'),ja=N('<div class="dropdown svelte-84vb17"></div>'),Na=N('<div class="autocomplete svelte-84vb17"><div class="input-row svelte-84vb17"><!> <input class="ac-input svelte-84vb17" type="text" placeholder="Search entities..."/></div> <!></div>');function Ua(W,t){at(t,!0);let f=ct(t,"multi",3,!1),i=Ae(""),u=Ae(0),D;const b=De(()=>yt.repos.flatMap(w=>w.entities.map(h=>({id:h.id,title:h.title,entityType:h.entityType,repo:w.name})))),x=De(()=>()=>{const w=e(i).toLowerCase().trim();return w?e(b).filter(h=>h.title.toLowerCase().includes(w)||h.id.toLowerCase().includes(w)).slice(0,20):e(b).slice(0,20)}),J=Array.isArray(t.value)?[...t.value]:t.value?[t.value]:[];let d=Ae(Qe(J));Ge(()=>{la().then(()=>D?.focus())});function Q(w){f()?(e(d).includes(w)||E(d,[...e(d),w],!0),E(i,""),E(u,0),D?.focus()):t.onselect(w)}function H(w){E(d,e(d).filter(h=>h!==w),!0)}function j(){e(d).length===J.length&&e(d).every((h,a)=>h===J[a])?t.oncancel():t.onselect(e(d))}function G(w){const h=e(x)();w.key==="ArrowDown"?(w.preventDefault(),E(u,Math.min(e(u)+1,h.length-1),!0)):w.key==="ArrowUp"?(w.preventDefault(),E(u,Math.max(e(u)-1,0),!0)):w.key==="Enter"?(w.preventDefault(),h.length>0?Q(h[e(u)].id):f()&&j()):w.key==="Escape"?f()&&e(d).length>0?j():t.oncancel():w.key==="Backspace"&&!e(i)&&f()&&e(d).length>0&&E(d,e(d).slice(0,-1),!0)}var ve=Na(),q=C(ve),ke=C(q);{var Ee=w=>{var h=Le(),a=we(h);Me(a,17,()=>e(d),Ke,(n,o)=>{var _=Ma(),k=C(_),U=Y(k);Ie(U,{variant:"ghost",size:"icon",class:"chip-remove",onclick:()=>H(e(o)),children:(ge,Ce)=>{Ve();var g=Ye("×");y(ge,g)},$$slots:{default:!0}}),m(_),ye(()=>me(k,`${e(o)??""} `)),y(n,_)}),y(w,h)};Se(ke,w=>{f()&&w(Ee)})}var $=Y(ke,2);lt($),kt($,w=>D=w,()=>D),m(q);var le=Y(q,2);{var _e=w=>{var h=ja();Me(h,21,()=>e(x)(),Ke,(a,n,o)=>{var _=Ia();let k;var U=C(_),ge=C(U,!0);m(U);var Ce=Y(U,2),g=C(Ce),l=C(g,!0);m(g);var c=Y(g,2),R=C(c,!0);m(c),m(Ce),m(_),ye(()=>{k=tt(_,1,"dropdown-item svelte-84vb17",null,k,{highlighted:o===e(u)}),me(ge,e(n).title),me(l,e(n).entityType),me(R,e(n).repo)}),Ue("mousedown",_,v=>{v.preventDefault(),Q(e(n).id)}),Je("mouseenter",_,()=>E(u,o,!0)),y(a,_)}),m(h),y(w,h)},he=De(()=>e(x)().length>0);Se(le,w=>{e(he)&&w(_e)})}m(ve),Ue("keydown",$,G),Je("blur",$,()=>{setTimeout(()=>{f()&&e(d).length>0?j():f()||t.oncancel()},150)}),Bt($,()=>e(i),w=>E(i,w)),y(W,ve),nt()}Dt(["keydown","mousedown"]);function ht(W,t){const f=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"M12 4v16"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2"}],["path",{d:"M9 20h6"}]];$e(W,Xe({name:"type"},()=>f,{get iconNode(){return i},children:(u,D)=>{var b=Le(),x=we(b);et(x,t,"default",{}),y(u,b)},$$slots:{default:!0}}))}function pt(W,t){const f=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"M8 2v4"}],["path",{d:"M16 2v4"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}],["path",{d:"M3 10h18"}]];$e(W,Xe({name:"calendar"},()=>f,{get iconNode(){return i},children:(u,D)=>{var b=Le(),x=we(b);et(x,t,"default",{}),y(u,b)},$$slots:{default:!0}}))}function _t(W,t){const f=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["circle",{cx:"12",cy:"12",r:"10"}],["circle",{cx:"12",cy:"12",r:"1"}]];$e(W,Xe({name:"circle-dot"},()=>f,{get iconNode(){return i},children:(u,D)=>{var b=Le(),x=we(b);et(x,t,"default",{}),y(u,b)},$$slots:{default:!0}}))}function gt(W,t){const f=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]];$e(W,Xe({name:"link"},()=>f,{get iconNode(){return i},children:(u,D)=>{var b=Le(),x=we(b);et(x,t,"default",{}),y(u,b)},$$slots:{default:!0}}))}function Yt(W,t){const f=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor"}]];$e(W,Xe({name:"tag"},()=>f,{get iconNode(){return i},children:(u,D)=>{var b=Le(),x=we(b);et(x,t,"default",{}),y(u,b)},$$slots:{default:!0}}))}function Ka(W,t){const f=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"m15 18-6-6 6-6"}]];$e(W,Xe({name:"chevron-left"},()=>f,{get iconNode(){return i},children:(u,D)=>{var b=Le(),x=we(b);et(x,t,"default",{}),y(u,b)},$$slots:{default:!0}}))}var qa=N('<span class="ip-menu-check svelte-x7sio8"><!></span>'),Va=N('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span> </span> <!>',1),Wa=N('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span>Remove</span>',1),Ha=N("<!> <!> <!>",1),Ba=N("<!> <!>",1),Ya=N('<input class="ip-edit-input svelte-x7sio8" type="text"/>'),Ja=N('<span class="ip-status-dot svelte-x7sio8"></span> ',1),Qa=N('<div class="ip-status-wrap svelte-x7sio8"><div class="ip-status-value svelte-x7sio8"><span class="ip-status-dot svelte-x7sio8"></span> <span class="ip-status-text svelte-x7sio8"> </span></div> <div class="ip-status-dropdown svelte-x7sio8"></div></div>'),Ga=N('<span class="ip-cal-wd svelte-x7sio8"> </span>'),Za=N('<div class="ip-cal-week svelte-x7sio8"></div>'),Xa=N('<div class="ip-cal-wrap svelte-x7sio8"><span class="ip-date-text svelte-x7sio8"> </span> <div class="ip-cal-dropdown svelte-x7sio8"><div class="ip-cal-header svelte-x7sio8"><!> <span class="ip-cal-title svelte-x7sio8"> </span> <!></div> <div class="ip-cal-weekdays svelte-x7sio8"></div> <!></div></div>'),$a=N('<span class="ip-badge svelte-x7sio8"> </span>'),en=N('<div class="ip-wikilink-group svelte-x7sio8"></div>'),tn=N('<div class="ip-status-value svelte-x7sio8"><span class="ip-status-dot svelte-x7sio8"></span> <span class="ip-status-text svelte-x7sio8"> </span></div>'),an=N('<span class="ip-date-text svelte-x7sio8"> </span>'),nn=N('<a class="ip-url-link svelte-x7sio8" target="_blank" rel="noopener noreferrer"> </a>'),rn=N('<span class="ip-text-value svelte-x7sio8"> </span>'),sn=N('<div><div class="ip-icon svelte-x7sio8"><!></div> <div class="ip-key svelte-x7sio8"> </div> <div class="ip-value svelte-x7sio8"><!></div></div>'),on=N('<div class="ip-row ip-add-row svelte-x7sio8"><div class="ip-icon svelte-x7sio8"><!></div> <div class="ip-key svelte-x7sio8"><input class="ip-add-key-input svelte-x7sio8" type="text" placeholder="Property name"/></div> <div class="ip-value svelte-x7sio8"></div></div>'),ln=N("<!> <span>Add property</span>",1),cn=N('<div class="inline-properties svelte-x7sio8"><!> <!></div>');function un(W,t){at(t,!0);let f=ct(t,"editable",3,!1);const i=[{type:"text",label:"Text"},{type:"date",label:"Date"},{type:"status",label:"Status"},{type:"wikilink",label:"Link"}],u=["active","inactive","in-progress","completed","draft","archived","current","former","won","lost","open","closed"];let D=Ae(null),b=Ae(!1),x=Ae(""),J=Ae(void 0);function d(r){switch(r.toLowerCase()){case"active":case"current":case"won":return"#3ecf8e";case"in-progress":case"open":return"#f0c246";case"inactive":case"lost":case"closed":case"former":return"#e54d4d";default:return"#5c5c66"}}function Q(r){for(const s of yt.repos){const T=s.entities.find(O=>O.id===r);if(T){Rt(`/${s.name}/${T.entityType}/${T.id}`);return}}}function H(r){return typeof r.value=="string"?r.value:r.value[0]}function j(r){return/^https?:\/\//.test(r)}function G(r){try{return new Date(r).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return r}}let ve=Ae(Qe(new Date().getFullYear())),q=Ae(Qe(new Date().getMonth()));const ke=["Su","Mo","Tu","We","Th","Fr","Sa"],Ee=["January","February","March","April","May","June","July","August","September","October","November","December"];function $(r,s){const T=new Date(r,s,1).getDay(),O=new Date(r,s+1,0).getDate(),B=new Date(r,s,0).getDate(),P=[];let A=[];for(let ee=T-1;ee>=0;ee--){const S=B-ee,se=s===0?11:s-1,fe=s===0?r-1:r;A.push({day:S,month:se,year:fe,outside:!0})}for(let ee=1;ee<=O;ee++)A.push({day:ee,month:s,year:r,outside:!1}),A.length===7&&(P.push(A),A=[]);if(A.length>0){const ee=s===11?0:s+1,S=s===11?r+1:r;let se=1;for(;A.length<7;)A.push({day:se++,month:ee,year:S,outside:!0});P.push(A)}return P}function le(r){const s=new Date;return r.day===s.getDate()&&r.month===s.getMonth()&&r.year===s.getFullYear()}function _e(r,s){const T=s.slice(0,10).split("-");return r.year===+T[0]&&r.month===+T[1]-1&&r.day===+T[2]}function he(){e(q)===0?(E(q,11),ot(ve,-1)):ot(q,-1)}function w(){e(q)===11?(E(q,0),ot(ve)):ot(q)}function h(r){try{const s=r.slice(0,10).split("-");E(ve,+s[0]),E(q,+s[1]-1)}catch{const s=new Date;E(ve,s.getFullYear(),!0),E(q,s.getMonth(),!0)}}function a(r){requestAnimationFrame(()=>{r.focus(),r.select()})}function n(r){!f()||r.type==="badge"||(r.type==="date"&&h(H(r)),E(D,r.key,!0))}function o(r,s){t.onedit&&t.onedit(r,s),E(D,null)}function _(r,s){const T=`${s.year}-${String(s.month+1).padStart(2,"0")}-${String(s.day).padStart(2,"0")}`;t.onedit&&t.onedit(r,T),E(D,null)}function k(r,s){t.ontypechange&&t.ontypechange(r,s)}function U(r){E(D,null),t.onremove&&t.onremove(r)}function ge(){E(b,!0),E(x,""),requestAnimationFrame(()=>e(J)?.focus())}function Ce(){const r=e(x).trim();r&&t.onadd&&t.onadd(r,""),E(b,!1),E(x,"")}function g(){E(b,!1),E(x,"")}function l(r){r.key==="Enter"?(r.preventDefault(),Ce()):r.key==="Escape"&&g()}var c=cn();Je("click",Vt,()=>{E(D,null)});var R=C(c);Me(R,17,()=>t.properties,r=>r.key,(r,s)=>{const T=De(()=>e(D)===e(s).key);var O=sn();let B;var P=C(O),A=C(P);{var ee=z=>{var F=Le(),M=we(F);Ne(M,()=>ga,(K,oe)=>{oe(K,{children:(ue,be)=>{var Z=Ba(),te=we(Z);Ne(te,()=>fa,(X,V)=>{V(X,{class:"ip-icon-trigger",children:(ne,pe)=>{var xe=Le(),Te=we(xe);{var Oe=ze=>{pt(ze,{size:14})},He=ze=>{_t(ze,{size:14})},rt=ze=>{gt(ze,{size:14})},ut=ze=>{ht(ze,{size:14})};Se(Te,ze=>{e(s).type==="date"?ze(Oe):e(s).type==="status"?ze(He,1):e(s).type==="wikilink"?ze(rt,2):ze(ut,!1)})}y(ne,xe)},$$slots:{default:!0}})});var Re=Y(te,2);Ne(Re,()=>va,(X,V)=>{V(X,{children:(ne,pe)=>{var xe=Le(),Te=we(xe);Ne(Te,()=>ha,(Oe,He)=>{He(Oe,{class:"ip-menu-content",sideOffset:4,align:"start",children:(rt,ut)=>{var ze=Ha(),bt=we(ze);Me(bt,17,()=>i,Ke,(it,We)=>{var dt=Le(),Tt=we(dt);Ne(Tt,()=>zt,(ft,vt)=>{vt(ft,{class:"ip-menu-item",onSelect:()=>k(e(s).key,e(We).type),children:(xt,rr)=>{var Ot=Va(),Et=we(Ot),Qt=C(Et);{var Gt=Fe=>{ht(Fe,{size:13})},Zt=Fe=>{pt(Fe,{size:13})},Xt=Fe=>{_t(Fe,{size:13})},$t=Fe=>{gt(Fe,{size:13})};Se(Qt,Fe=>{e(We).type==="text"?Fe(Gt):e(We).type==="date"?Fe(Zt,1):e(We).type==="status"?Fe(Xt,2):e(We).type==="wikilink"&&Fe($t,3)})}m(Et);var Ct=Y(Et,2),ea=C(Ct,!0);m(Ct);var ta=Y(Ct,2);{var aa=Fe=>{var St=qa(),na=C(St);Oa(na,{size:12}),m(St),y(Fe,St)};Se(ta,Fe=>{e(s).type===e(We).type&&Fe(aa)})}ye(()=>me(ea,e(We).label)),y(xt,Ot)},$$slots:{default:!0}})}),y(it,dt)});var st=Y(bt,2);Ne(st,()=>pa,(it,We)=>{We(it,{class:"ip-menu-sep"})});var Jt=Y(st,2);Ne(Jt,()=>zt,(it,We)=>{We(it,{class:"ip-menu-item ip-menu-destructive",onSelect:()=>U(e(s).key),children:(dt,Tt)=>{var ft=Wa(),vt=we(ft),xt=C(vt);_a(xt,{size:13}),m(vt),Ve(2),y(dt,ft)},$$slots:{default:!0}})}),y(rt,ze)},$$slots:{default:!0}})}),y(ne,xe)},$$slots:{default:!0}})}),y(ue,Z)},$$slots:{default:!0}})}),y(z,F)},S=z=>{var F=Le(),M=we(F);{var K=te=>{pt(te,{size:14})},oe=te=>{_t(te,{size:14})},ue=te=>{gt(te,{size:14})},be=te=>{Yt(te,{size:14})},Z=te=>{ht(te,{size:14})};Se(M,te=>{e(s).type==="date"?te(K):e(s).type==="status"?te(oe,1):e(s).type==="wikilink"?te(ue,2):e(s).type==="badge"?te(be,3):te(Z,!1)})}y(z,F)};Se(A,z=>{f()&&e(s).type!=="badge"?z(ee):z(S,!1)})}m(P);var se=Y(P,2),fe=C(se,!0);m(se);var re=Y(se,2),de=C(re);{var ae=z=>{var F=Ya();lt(F),za(F,M=>a?.(M)),ye(M=>At(F,M),[()=>H(e(s))]),Je("blur",F,M=>{const K=M.currentTarget.value;K!==H(e(s))&&t.onedit?.(e(s).key,K),E(D,null)}),Ue("keydown",F,M=>{M.key==="Enter"?M.currentTarget.blur():M.key==="Escape"&&(M.currentTarget.value=H(e(s)),E(D,null))}),y(z,F)},ce=z=>{var F=Qa(),M=C(F),K=C(M);let oe;var ue=Y(K,2),be=C(ue,!0);m(ue),m(M);var Z=Y(M,2);Me(Z,21,()=>u,Ke,(te,Re)=>{{let X=De(()=>H(e(s))===e(Re)?"selected":"");Ie(te,{variant:"ghost",get class(){return`ip-status-option ${e(X)??""}`},onclick:()=>o(e(s).key,e(Re)),children:(V,ne)=>{var pe=Ja(),xe=we(pe);let Te;var Oe=Y(xe);ye(He=>{Te=Be(xe,"",Te,He),me(Oe,` ${e(Re)??""}`)},[()=>({background:d(e(Re))})]),y(V,pe)},$$slots:{default:!0}})}}),m(Z),m(F),ye((te,Re)=>{oe=Be(K,"",oe,te),me(be,Re)},[()=>({background:d(H(e(s)))}),()=>H(e(s))]),Ue("click",F,te=>te.stopPropagation()),y(z,F)},I=z=>{var F=Xa(),M=C(F),K=C(M,!0);m(M);var oe=Y(M,2),ue=C(oe),be=C(ue);Ie(be,{variant:"ghost",size:"icon",class:"ip-cal-nav",onclick:he,children:(ne,pe)=>{Ka(ne,{size:14})},$$slots:{default:!0}});var Z=Y(be,2),te=C(Z);m(Z);var Re=Y(Z,2);Ie(Re,{variant:"ghost",size:"icon",class:"ip-cal-nav",onclick:w,children:(ne,pe)=>{ma(ne,{size:14})},$$slots:{default:!0}}),m(ue);var X=Y(ue,2);Me(X,21,()=>ke,Ke,(ne,pe)=>{var xe=Ga(),Te=C(xe,!0);m(xe),ye(()=>me(Te,e(pe))),y(ne,xe)}),m(X);var V=Y(X,2);Me(V,17,()=>$(e(ve),e(q)),Ke,(ne,pe)=>{var xe=Za();Me(xe,21,()=>e(pe),Ke,(Te,Oe)=>{{let He=De(()=>e(Oe).outside?"outside":""),rt=De(()=>le(e(Oe))?"today":""),ut=De(()=>_e(e(Oe),H(e(s)))?"selected":"");Ie(Te,{variant:"ghost",get class(){return`ip-cal-day ${e(He)??""} ${e(rt)??""} ${e(ut)??""}`},onclick:()=>_(e(s).key,e(Oe)),children:(ze,bt)=>{Ve();var st=Ye();ye(()=>me(st,e(Oe).day)),y(ze,st)},$$slots:{default:!0}})}}),m(xe),y(ne,xe)}),m(oe),m(F),ye(ne=>{me(K,ne),me(te,`${Ee[e(q)]??""} ${e(ve)??""}`)},[()=>G(H(e(s)))]),Ue("click",F,ne=>ne.stopPropagation()),y(z,F)},ie=z=>{{let F=De(()=>Array.isArray(e(s).value));Ua(z,{get value(){return e(s).value},get multi(){return e(F)},onselect:M=>{t.onedit?.(e(s).key,M),E(D,null)},oncancel:()=>{E(D,null)}})}},Pe=z=>{var F=Le(),M=we(F);{var K=X=>{var V=$a(),ne=C(V,!0);m(V),ye(pe=>me(ne,pe),[()=>H(e(s))]),y(X,V)},oe=X=>{var V=en();Me(V,21,()=>Array.isArray(e(s).value)?e(s).value:[e(s).value],Ke,(ne,pe)=>{Ie(ne,{variant:"ghost",class:"ip-wikilink-chip",onclick:xe=>{xe.stopPropagation(),Q(e(pe))},children:(xe,Te)=>{Ve();var Oe=Ye();ye(()=>me(Oe,e(pe))),y(xe,Oe)},$$slots:{default:!0}})}),m(V),y(X,V)},ue=X=>{var V=tn(),ne=C(V);let pe;var xe=Y(ne,2),Te=C(xe,!0);m(xe),m(V),ye((Oe,He)=>{pe=Be(ne,"",pe,Oe),me(Te,He)},[()=>({background:d(H(e(s)))}),()=>H(e(s))]),y(X,V)},be=X=>{var V=an(),ne=C(V,!0);m(V),ye(pe=>me(ne,pe),[()=>G(H(e(s)))]),y(X,V)},Z=X=>{var V=nn(),ne=C(V,!0);m(V),ye((pe,xe)=>{sa(V,"href",pe),me(ne,xe)},[()=>H(e(s)),()=>H(e(s))]),Ue("click",V,pe=>pe.stopPropagation()),y(X,V)},te=De(()=>j(H(e(s)))),Re=X=>{var V=rn(),ne=C(V,!0);m(V),ye(pe=>me(ne,pe),[()=>H(e(s))]),y(X,V)};Se(M,X=>{e(s).type==="badge"?X(K):e(s).type==="wikilink"?X(oe,1):e(s).type==="status"?X(ue,2):e(s).type==="date"?X(be,3):e(te)?X(Z,4):X(Re,!1)})}y(z,F)};Se(de,z=>{e(T)&&e(s).type==="text"?z(ae):e(T)&&e(s).type==="status"?z(ce,1):e(T)&&e(s).type==="date"?z(I,2):e(T)&&e(s).type==="wikilink"?z(ie,3):z(Pe,!1)})}m(re),m(O),ye(()=>{B=tt(O,1,"ip-row svelte-x7sio8",null,B,{"ip-focused":e(T)}),me(fe,e(s).key)}),Ue("click",P,z=>z.stopPropagation()),Ue("click",re,z=>{z.stopPropagation(),n(e(s))}),y(r,O)});var v=Y(R,2);{var p=r=>{var s=on(),T=C(s),O=C(T);wt(O,{size:14}),m(T);var B=Y(T,2),P=C(B);lt(P),kt(P,A=>E(J,A),()=>e(J)),m(B),Ve(2),m(s),Ue("keydown",P,l),Je("blur",P,g),Bt(P,()=>e(x),A=>E(x,A)),y(r,s)},L=r=>{Ie(r,{variant:"ghost",class:"ip-add-btn",onclick:s=>{s.stopPropagation(),ge()},children:(s,T)=>{var O=ln(),B=we(O);wt(B,{size:14}),Ve(2),y(s,O)},$$slots:{default:!0}})};Se(v,r=>{e(b)?r(p):f()&&r(L,1)})}m(c),y(W,c),nt()}Dt(["click","keydown"]);var dn=N('<div class="remote-cursor svelte-ok7wy5"><span class="remote-cursor-label svelte-ok7wy5"> </span></div>'),fn=N('<div class="cursor-overlay svelte-ok7wy5"></div>'),vn=N('<div class="editor-wrap svelte-ok7wy5"><div class="cm-container svelte-ok7wy5"></div> <!></div>');function hn(W,t){at(t,!0);let f=ct(t,"readonly",3,!0),i=ct(t,"resetKey",3,0);const u=Wt("theme");let D,b=null,x=null,J=Ae(""),d=null,Q=Ae(Qe([])),H=null,j=t.content;function G(le,_e){return le.theme({"&":{backgroundColor:"transparent",color:"var(--color-text-primary)",fontSize:"15px",fontFamily:"var(--font-sans)"},".cm-content":{padding:"32px 40px",fontFamily:"var(--font-sans)",caretColor:"var(--color-accent)",lineHeight:"1.6"},".cm-cursor":{borderLeftColor:"var(--color-accent)"},".cm-selectionBackground":{backgroundColor:_e?"rgba(110,110,232,0.2)":"rgba(110,110,232,0.15)"},"&.cm-focused .cm-selectionBackground":{backgroundColor:_e?"rgba(110,110,232,0.3)":"rgba(110,110,232,0.2)"},".cm-gutters":{display:"none"},".cm-activeLine":{backgroundColor:"transparent"},".cm-line":{padding:"0"},".cm-header-1":{fontSize:"22px",fontWeight:"600"},".cm-header-2":{fontSize:"16px",fontWeight:"600"},".cm-header-3":{fontSize:"15px",fontWeight:"600"},".cm-formatting":{color:"var(--color-text-tertiary)",opacity:"0.5"},".cm-link":{color:"var(--color-link)",textDecoration:"none"}},{dark:_e})}async function ve(){b&&(b.destroy(),b=null),x&&(x.destroy(),x=null),E(Q,[],!0);const{EditorState:le,Transaction:_e}=await qe(async()=>{const{EditorState:r,Transaction:s}=await import("../chunks/CX_61fY8.js");return{EditorState:r,Transaction:s}},[],import.meta.url);d=_e;const{EditorView:he,keymap:w,ViewPlugin:h}=await qe(async()=>{const{EditorView:r,keymap:s,ViewPlugin:T}=await import("../chunks/DnL9f0lc.js").then(O=>O.i);return{EditorView:r,keymap:s,ViewPlugin:T}},__vite__mapDeps([0,1]),import.meta.url),{markdown:a}=await qe(async()=>{const{markdown:r}=await import("../chunks/CscoF-YL.js");return{markdown:r}},__vite__mapDeps([2,1,0,3,4,5]),import.meta.url),{syntaxHighlighting:n,HighlightStyle:o}=await qe(async()=>{const{syntaxHighlighting:r,HighlightStyle:s}=await import("../chunks/D7ZqAKi9.js");return{syntaxHighlighting:r,HighlightStyle:s}},__vite__mapDeps([3,4,1,0]),import.meta.url),{history:_,defaultKeymap:k,historyKeymap:U}=await qe(async()=>{const{history:r,defaultKeymap:s,historyKeymap:T}=await import("../chunks/CWQRQXxy.js");return{history:r,defaultKeymap:s,historyKeymap:T}},__vite__mapDeps([6,1,0,3,4]),import.meta.url),{tags:ge}=await qe(async()=>{const{tags:r}=await import("../chunks/C7VoTosa.js").then(s=>s.i);return{tags:r}},[],import.meta.url),{livePreviewPlugin:Ce,livePreviewTheme:g}=await qe(async()=>{const{livePreviewPlugin:r,livePreviewTheme:s}=await import("../chunks/DKQjBKyp.js");return{livePreviewPlugin:r,livePreviewTheme:s}},__vite__mapDeps([7,0,1,3,4]),import.meta.url),l=u.current==="dark",c=G(he,l),R=o.define([{tag:ge.processingInstruction,color:"var(--color-text-tertiary)",opacity:"0.7"}]),v=[a(),c,n(R),Ce,g,he.lineWrapping];f()&&v.push(le.readOnly.of(!0));let p=!1;if(t.cursorDocName&&!f())try{let I=function(){if(!b||!S){E(Q,[],!0);return}const z=S.awareness,F=S.ytext,M=F.doc;if(!M){E(Q,[],!0);return}const K=[],oe=b.dom.getBoundingClientRect();z.getStates().forEach((ue,be)=>{if(be===ce)return;const Z=ue.cursor;if(!Z?.head)return;const{name:te="Anonymous",color:Re="#6e6ee8"}=ue.user||{};let X;try{X=A.createRelativePositionFromJSON(Z.head)}catch{return}const V=A.createAbsolutePositionFromRelativePosition(X,M);if(!V||V.type!==F)return;const ne=b.coordsAtPos(Math.min(V.index,b.state.doc.length));ne&&K.push({id:be,name:te,color:Re,top:ne.top-oe.top,left:ne.left-oe.left,height:ne.bottom-ne.top})}),E(Q,K,!0)},ie=function(){H&&cancelAnimationFrame(H),H=requestAnimationFrame(()=>{H=null,I()})},Pe=function({added:z,updated:F,removed:M}){[...z,...F,...M].some(oe=>oe!==ce)&&ie()};const{createCollabSession:r}=await qe(async()=>{const{createCollabSession:z}=await import("../chunks/CnKc_Tae.js");return{createCollabSession:z}},__vite__mapDeps([8,9,10,11,12,13,14,15]),import.meta.url),{ySync:s,ySyncFacet:T,YSyncConfig:O,yUndoManagerKeymap:B}=await qe(async()=>{const{ySync:z,ySyncFacet:F,YSyncConfig:M,yUndoManagerKeymap:K}=await import("../chunks/i9c_RUF6.js");return{ySync:z,ySyncFacet:F,YSyncConfig:M,yUndoManagerKeymap:K}},__vite__mapDeps([16,9,0,1]),import.meta.url),{auth:P}=await qe(async()=>{const{auth:z}=await import("../chunks/EDLlAC9C.js").then(F=>F.x);return{auth:z}},__vite__mapDeps([15,11,13,12]),import.meta.url),A=await qe(()=>import("../chunks/CLFba8FK.js").then(z=>z.A),[],import.meta.url),ee=getComputedStyle(document.documentElement).getPropertyValue("--color-accent").trim()||"#6e6ee8",S=r(t.cursorDocName,{name:P.user?.displayName??"Anonymous",color:ee,colorLight:ee+"33"}),se=new A.UndoManager(S.ytext,{captureTimeout:500}),{yUndoManagerFacet:fe,yUndoManager:re,YUndoManagerConfig:de}=await qe(async()=>{const{yUndoManagerFacet:z,yUndoManager:F,YUndoManagerConfig:M}=await import("../chunks/i9c_RUF6.js");return{yUndoManagerFacet:z,yUndoManager:F,YUndoManagerConfig:M}},__vite__mapDeps([16,9,0,1]),import.meta.url),ae=new O(S.ytext,S.awareness);v.push(T.of(ae),s,fe.of(new de(se)),re,w.of(B)),v.push(h.define(z=>{function F(){const M=z.state.selection.main,K=S.ytext,oe=A.createRelativePositionFromTypeIndex(K,M.anchor),ue=A.createRelativePositionFromTypeIndex(K,M.head);S.awareness.setLocalStateField("cursor",{anchor:A.relativePositionToJSON(oe),head:A.relativePositionToJSON(ue)})}return F(),{update(M){(M.selectionSet||M.docChanged)&&F()}}}));const ce=S.ydoc.clientID;S.awareness.on("change",Pe),v.push(h.define(()=>({update(z){(z.docChanged||z.geometryChanged||z.viewportChanged)&&ie()},destroy(){S.awareness.off("change",Pe)}}))),x=S,p=!0}catch(r){console.warn("Yjs collab setup failed, falling back to solo editing:",r)}if(!f()&&!p?(v.push(_({newGroupDelay:500})),v.push(w.of([...k,...U]))):!f()&&p&&v.push(w.of(k)),t.onchange)if(p){const r=Date.now();v.push(he.updateListener.of(s=>{if(s.docChanged&&Date.now()-r>1e3&&s.transactions.some(O=>O.isUserEvent("input")||O.isUserEvent("delete")||O.isUserEvent("move")||O.isUserEvent("undo")||O.isUserEvent("redo"))){const O=s.state.doc.toString();j=O,t.onchange(O)}}))}else v.push(he.updateListener.of(r=>{if(r.docChanged){const s=r.state.doc.toString();j=s,t.onchange(s)}}));v.push(he.domEventHandlers({click(r){const s=r.target;if(t.onwikilinkclick){const O=s.closest(".cm-live-wikilink");if(O){r.preventDefault();const B=O.textContent?.replace(/^\[{1,2}|\]{1,2}$/g,"").trim();return B&&t.onwikilinkclick(B),!0}}const T=s.closest(".cm-live-link");if(T){const O=T.getAttribute("data-href");if(O)return r.preventDefault(),window.open(O,"_blank","noopener,noreferrer"),!0}return!1}})),t.onsave&&v.push(w.of([{key:"Mod-s",run:()=>(t.onsave(),!0)}]));const L=le.create({doc:p?"":t.content,extensions:v});b=new he({state:L,parent:D}),j=p?"":t.content,E(J,t.cursorDocName??"",!0)}ca(()=>{ve()}),Ge(()=>{t.cursorDocName&&e(J)&&t.cursorDocName!==e(J)&&ve()}),Ge(()=>{if(i(),b&&!x&&t.content!==j){j=t.content;const le=D.closest(".document-scroll"),_e=le?.scrollTop??0;b.dispatch({changes:{from:0,to:b.state.doc.length,insert:t.content},...d?{annotations:d.addToHistory.of(!1)}:{}}),le&&requestAnimationFrame(()=>{le.scrollTop=_e})}}),Ht(()=>{H&&cancelAnimationFrame(H),x?.destroy(),x=null,b?.destroy()});var q=vn(),ke=C(q);kt(ke,le=>D=le,()=>D);var Ee=Y(ke,2);{var $=le=>{var _e=fn();Me(_e,21,()=>e(Q),he=>he.id,(he,w)=>{var h=dn(),a=C(h),n=C(a,!0);m(a),m(h),ye(()=>{Be(h,`top: ${e(w).top??""}px; left: ${e(w).left??""}px; height: ${e(w).height??""}px; --cursor-color: ${e(w).color??""};`),Be(a,`background-color: ${e(w).color??""};`),me(n,e(w).name)}),y(he,h)}),m(_e),y(le,_e)};Se(Ee,le=>{e(Q).length>0&&le($)})}m(q),y(W,q),nt()}var mt={exports:{}};var pn=mt.exports,It;function _n(){return It||(It=1,(function(W,t){((f,i)=>{W.exports=i()})(pn,function f(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},u,D=!i.document&&!!i.postMessage,b=i.IS_PAPA_WORKER||!1,x={},J=0,d={};function Q(a){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(n){var o=he(n);o.chunkSize=parseInt(o.chunkSize),n.step||n.chunk||(o.chunkSize=null),this._handle=new q(o),(this._handle.streamer=this)._config=o}).call(this,a),this.parseChunk=function(n,o){var _=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<_){let U=this._config.newline;U||(k=this._config.quoteChar||'"',U=this._handle.guessLineEndings(n,k)),n=[...n.split(U).slice(_)].join(U)}this.isFirstChunk&&h(this._config.beforeFirstChunk)&&(k=this._config.beforeFirstChunk(n))!==void 0&&(n=k),this.isFirstChunk=!1,this._halted=!1;var _=this._partialLine+n,k=(this._partialLine="",this._handle.parse(_,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(n=k.meta.cursor,_=(this._finished||(this._partialLine=_.substring(n-this._baseIndex),this._baseIndex=n),k&&k.data&&(this._rowCount+=k.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),b)i.postMessage({results:k,workerId:d.WORKER_ID,finished:_});else if(h(this._config.chunk)&&!o){if(this._config.chunk(k,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=k=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(k.data),this._completeResults.errors=this._completeResults.errors.concat(k.errors),this._completeResults.meta=k.meta),this._completed||!_||!h(this._config.complete)||k&&k.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),_||k&&k.meta.paused||this._nextChunk(),k}this._halted=!0},this._sendError=function(n){h(this._config.error)?this._config.error(n):b&&this._config.error&&i.postMessage({workerId:d.WORKER_ID,error:n,finished:!1})}}function H(a){var n;(a=a||{}).chunkSize||(a.chunkSize=d.RemoteChunkSize),Q.call(this,a),this._nextChunk=D?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(o){this._input=o,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(n=new XMLHttpRequest,this._config.withCredentials&&(n.withCredentials=this._config.withCredentials),D||(n.onload=w(this._chunkLoaded,this),n.onerror=w(this._chunkError,this)),n.open(this._config.downloadRequestBody?"POST":"GET",this._input,!D),this._config.downloadRequestHeaders){var o,_=this._config.downloadRequestHeaders;for(o in _)n.setRequestHeader(o,_[o])}var k;this._config.chunkSize&&(k=this._start+this._config.chunkSize-1,n.setRequestHeader("Range","bytes="+this._start+"-"+k));try{n.send(this._config.downloadRequestBody)}catch(U){this._chunkError(U.message)}D&&n.status===0&&this._chunkError()}},this._chunkLoaded=function(){n.readyState===4&&(n.status<200||400<=n.status?this._chunkError():(this._start+=this._config.chunkSize||n.responseText.length,this._finished=!this._config.chunkSize||this._start>=(o=>(o=o.getResponseHeader("Content-Range"))!==null?parseInt(o.substring(o.lastIndexOf("/")+1)):-1)(n),this.parseChunk(n.responseText)))},this._chunkError=function(o){o=n.statusText||o,this._sendError(new Error(o))}}function j(a){(a=a||{}).chunkSize||(a.chunkSize=d.LocalChunkSize),Q.call(this,a);var n,o,_=typeof FileReader<"u";this.stream=function(k){this._input=k,o=k.slice||k.webkitSlice||k.mozSlice,_?((n=new FileReader).onload=w(this._chunkLoaded,this),n.onerror=w(this._chunkError,this)):n=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var k=this._input,U=(this._config.chunkSize&&(U=Math.min(this._start+this._config.chunkSize,this._input.size),k=o.call(k,this._start,U)),n.readAsText(k,this._config.encoding));_||this._chunkLoaded({target:{result:U}})},this._chunkLoaded=function(k){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(k.target.result)},this._chunkError=function(){this._sendError(n.error)}}function G(a){var n;Q.call(this,a=a||{}),this.stream=function(o){return n=o,this._nextChunk()},this._nextChunk=function(){var o,_;if(!this._finished)return o=this._config.chunkSize,n=o?(_=n.substring(0,o),n.substring(o)):(_=n,""),this._finished=!n,this.parseChunk(_)}}function ve(a){Q.call(this,a=a||{});var n=[],o=!0,_=!1;this.pause=function(){Q.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){Q.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(k){this._input=k,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){_&&n.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),n.length?this.parseChunk(n.shift()):o=!0},this._streamData=w(function(k){try{n.push(typeof k=="string"?k:k.toString(this._config.encoding)),o&&(o=!1,this._checkIsFinished(),this.parseChunk(n.shift()))}catch(U){this._streamError(U)}},this),this._streamError=w(function(k){this._streamCleanUp(),this._sendError(k)},this),this._streamEnd=w(function(){this._streamCleanUp(),_=!0,this._streamData("")},this),this._streamCleanUp=w(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function q(a){var n,o,_,k,U=Math.pow(2,53),ge=-U,Ce=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,g=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,l=this,c=0,R=0,v=!1,p=!1,L=[],r={data:[],errors:[],meta:{}};function s(P){return a.skipEmptyLines==="greedy"?P.join("").trim()==="":P.length===1&&P[0].length===0}function T(){if(r&&_&&(B("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+d.DefaultDelimiter+"'"),_=!1),a.skipEmptyLines&&(r.data=r.data.filter(function(S){return!s(S)})),O()){let S=function(se,fe){h(a.transformHeader)&&(se=a.transformHeader(se,fe)),L.push(se)};if(r)if(Array.isArray(r.data[0])){for(var P=0;O()&&P<r.data.length;P++)r.data[P].forEach(S);r.data.splice(0,1)}else r.data.forEach(S)}function A(S,se){for(var fe=a.header?{}:[],re=0;re<S.length;re++){var de=re,ae=S[re],ae=((ce,I)=>(ie=>(a.dynamicTypingFunction&&a.dynamicTyping[ie]===void 0&&(a.dynamicTyping[ie]=a.dynamicTypingFunction(ie)),(a.dynamicTyping[ie]||a.dynamicTyping)===!0))(ce)?I==="true"||I==="TRUE"||I!=="false"&&I!=="FALSE"&&((ie=>{if(Ce.test(ie)&&(ie=parseFloat(ie),ge<ie&&ie<U))return 1})(I)?parseFloat(I):g.test(I)?new Date(I):I===""?null:I):I)(de=a.header?re>=L.length?"__parsed_extra":L[re]:de,ae=a.transform?a.transform(ae,de):ae);de==="__parsed_extra"?(fe[de]=fe[de]||[],fe[de].push(ae)):fe[de]=ae}return a.header&&(re>L.length?B("FieldMismatch","TooManyFields","Too many fields: expected "+L.length+" fields but parsed "+re,R+se):re<L.length&&B("FieldMismatch","TooFewFields","Too few fields: expected "+L.length+" fields but parsed "+re,R+se)),fe}var ee;r&&(a.header||a.dynamicTyping||a.transform)&&(ee=1,!r.data.length||Array.isArray(r.data[0])?(r.data=r.data.map(A),ee=r.data.length):r.data=A(r.data,0),a.header&&r.meta&&(r.meta.fields=L),R+=ee)}function O(){return a.header&&L.length===0}function B(P,A,ee,S){P={type:P,code:A,message:ee},S!==void 0&&(P.row=S),r.errors.push(P)}h(a.step)&&(k=a.step,a.step=function(P){r=P,O()?T():(T(),r.data.length!==0&&(c+=P.data.length,a.preview&&c>a.preview?o.abort():(r.data=r.data[0],k(r,l))))}),this.parse=function(P,A,ee){var S=a.quoteChar||'"',S=(a.newline||(a.newline=this.guessLineEndings(P,S)),_=!1,a.delimiter?h(a.delimiter)&&(a.delimiter=a.delimiter(P),r.meta.delimiter=a.delimiter):((S=((se,fe,re,de,ae)=>{var ce,I,ie,Pe;ae=ae||[","," ","|",";",d.RECORD_SEP,d.UNIT_SEP];for(var z=0;z<ae.length;z++){for(var F,M=ae[z],K=0,oe=0,ue=0,be=(ie=void 0,new Ee({comments:de,delimiter:M,newline:fe,preview:10}).parse(se)),Z=0;Z<be.data.length;Z++)re&&s(be.data[Z])?ue++:(F=be.data[Z].length,oe+=F,ie===void 0?ie=F:0<F&&(K+=Math.abs(F-ie),ie=F));0<be.data.length&&(oe/=be.data.length-ue),(I===void 0||K<=I)&&(Pe===void 0||Pe<oe)&&1.99<oe&&(I=K,ce=M,Pe=oe)}return{successful:!!(a.delimiter=ce),bestDelimiter:ce}})(P,a.newline,a.skipEmptyLines,a.comments,a.delimitersToGuess)).successful?a.delimiter=S.bestDelimiter:(_=!0,a.delimiter=d.DefaultDelimiter),r.meta.delimiter=a.delimiter),he(a));return a.preview&&a.header&&S.preview++,n=P,o=new Ee(S),r=o.parse(n,A,ee),T(),v?{meta:{paused:!0}}:r||{meta:{paused:!1}}},this.paused=function(){return v},this.pause=function(){v=!0,o.abort(),n=h(a.chunk)?"":n.substring(o.getCharIndex())},this.resume=function(){l.streamer._halted?(v=!1,l.streamer.parseChunk(n,!0)):setTimeout(l.resume,3)},this.aborted=function(){return p},this.abort=function(){p=!0,o.abort(),r.meta.aborted=!0,h(a.complete)&&a.complete(r),n=""},this.guessLineEndings=function(se,S){se=se.substring(0,1048576);var S=new RegExp(ke(S)+"([^]*?)"+ke(S),"gm"),ee=(se=se.replace(S,"")).split("\r"),S=se.split(`
|
|
3
3
|
`),se=1<S.length&&S[0].length<ee[0].length;if(ee.length===1||se)return`
|
|
4
4
|
`;for(var fe=0,re=0;re<ee.length;re++)ee[re][0]===`
|
|
5
5
|
`&&fe++;return fe>=ee.length/2?`\r
|
|
@@ -8,4 +8,4 @@ import{f as ra,r as lt,s as tt,w as yt,h as At,i as Be,g as sa,a as Lt,j as ia}f
|
|
|
8
8
|
`&&(o=`
|
|
9
9
|
`);var R=0,v=!1;this.parse=function(p,L,r){if(typeof p!="string")throw new Error("Input must be a string");var s=p.length,T=n.length,O=o.length,B=_.length,P=h(k),A=[],ee=[],S=[],se=R=0;if(!p)return K();if(ge||ge!==!1&&p.indexOf(l)===-1){for(var fe=p.split(o),re=0;re<fe.length;re++){if(S=fe[re],R+=S.length,re!==fe.length-1)R+=o.length;else if(r)return K();if(!_||S.substring(0,B)!==_){if(P){if(A=[],Pe(S.split(n)),oe(),v)return K()}else Pe(S.split(n));if(U&&U<=re)return A=A.slice(0,U),K(!0)}}return K()}for(var de=p.indexOf(n,R),ae=p.indexOf(o,R),ce=new RegExp(ke(c)+ke(l),"g"),I=p.indexOf(l,R);;)if(p[R]===l)for(I=R,R++;;){if((I=p.indexOf(l,I+1))===-1)return r||ee.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:A.length,index:R}),F();if(I===s-1)return F(p.substring(R,I).replace(ce,l));if(l===c&&p[I+1]===c)I++;else if(l===c||I===0||p[I-1]!==c){de!==-1&&de<I+1&&(de=p.indexOf(n,I+1));var ie=z((ae=ae!==-1&&ae<I+1?p.indexOf(o,I+1):ae)===-1?de:Math.min(de,ae));if(p.substr(I+1+ie,T)===n){S.push(p.substring(R,I).replace(ce,l)),p[R=I+1+ie+T]!==l&&(I=p.indexOf(l,R)),de=p.indexOf(n,R),ae=p.indexOf(o,R);break}if(ie=z(ae),p.substring(I+1+ie,I+1+ie+O)===o){if(S.push(p.substring(R,I).replace(ce,l)),M(I+1+ie+O),de=p.indexOf(n,R),I=p.indexOf(l,R),P&&(oe(),v))return K();if(U&&A.length>=U)return K(!0);break}ee.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:A.length,index:R}),I++}}else if(_&&S.length===0&&p.substring(R,R+B)===_){if(ae===-1)return K();R=ae+O,ae=p.indexOf(o,R),de=p.indexOf(n,R)}else if(de!==-1&&(de<ae||ae===-1))S.push(p.substring(R,de)),R=de+T,de=p.indexOf(n,R);else{if(ae===-1)break;if(S.push(p.substring(R,ae)),M(ae+O),P&&(oe(),v))return K();if(U&&A.length>=U)return K(!0)}return F();function Pe(ue){A.push(ue),se=R}function z(ue){var be=0;return be=ue!==-1&&(ue=p.substring(I+1,ue))&&ue.trim()===""?ue.length:be}function F(ue){return r||(ue===void 0&&(ue=p.substring(R)),S.push(ue),R=s,Pe(S),P&&oe()),K()}function M(ue){R=ue,Pe(S),S=[],ae=p.indexOf(o,R)}function K(ue){if(a.header&&!L&&A.length&&!g){var be=A[0],Z=Object.create(null),te=new Set(be);let Re=!1;for(let X=0;X<be.length;X++){let V=be[X];if(Z[V=h(a.transformHeader)?a.transformHeader(V,X):V]){let ne,pe=Z[V];for(;ne=V+"_"+pe,pe++,te.has(ne););te.add(ne),be[X]=ne,Z[V]++,Re=!0,(Ce=Ce===null?{}:Ce)[ne]=V}else Z[V]=1,be[X]=V;te.add(V)}Re&&console.warn("Duplicate headers found and renamed."),g=!0}return{data:A,errors:ee,meta:{delimiter:n,linebreak:o,aborted:v,truncated:!!ue,cursor:se+(L||0),renamedHeaders:Ce}}}function oe(){k(K()),A=[],ee=[]}},this.abort=function(){v=!0},this.getCharIndex=function(){return R}}function $(a){var n=a.data,o=x[n.workerId],_=!1;if(n.error)o.userError(n.error,n.file);else if(n.results&&n.results.data){var k={abort:function(){_=!0,le(n.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:_e,resume:_e};if(h(o.userStep)){for(var U=0;U<n.results.data.length&&(o.userStep({data:n.results.data[U],errors:n.results.errors,meta:n.results.meta},k),!_);U++);delete n.results}else h(o.userChunk)&&(o.userChunk(n.results,k,n.file),delete n.results)}n.finished&&!_&&le(n.workerId,n.results)}function le(a,n){var o=x[a];h(o.userComplete)&&o.userComplete(n),o.terminate(),delete x[a]}function _e(){throw new Error("Not implemented.")}function he(a){if(typeof a!="object"||a===null)return a;var n,o=Array.isArray(a)?[]:{};for(n in a)o[n]=he(a[n]);return o}function w(a,n){return function(){a.apply(n,arguments)}}function h(a){return typeof a=="function"}return d.parse=function(a,n){var o=(n=n||{}).dynamicTyping||!1;if(h(o)&&(n.dynamicTypingFunction=o,o={}),n.dynamicTyping=o,n.transform=!!h(n.transform)&&n.transform,!n.worker||!d.WORKERS_SUPPORTED)return o=null,d.NODE_STREAM_INPUT,typeof a=="string"?(a=(_=>_.charCodeAt(0)!==65279?_:_.slice(1))(a),o=new(n.download?H:G)(n)):a.readable===!0&&h(a.read)&&h(a.on)?o=new ve(n):(i.File&&a instanceof File||a instanceof Object)&&(o=new j(n)),o.stream(a);(o=(()=>{var _;return!!d.WORKERS_SUPPORTED&&(_=(()=>{var k=i.URL||i.webkitURL||null,U=f.toString();return d.BLOB_URL||(d.BLOB_URL=k.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",U,")();"],{type:"text/javascript"})))})(),(_=new i.Worker(_)).onmessage=$,_.id=J++,x[_.id]=_)})()).userStep=n.step,o.userChunk=n.chunk,o.userComplete=n.complete,o.userError=n.error,n.step=h(n.step),n.chunk=h(n.chunk),n.complete=h(n.complete),n.error=h(n.error),delete n.worker,o.postMessage({input:a,config:n,workerId:o.id})},d.unparse=function(a,n){var o=!1,_=!0,k=",",U=`\r
|
|
10
10
|
`,ge='"',Ce=ge+ge,g=!1,l=null,c=!1,R=((()=>{if(typeof n=="object"){if(typeof n.delimiter!="string"||d.BAD_DELIMITERS.filter(function(L){return n.delimiter.indexOf(L)!==-1}).length||(k=n.delimiter),typeof n.quotes!="boolean"&&typeof n.quotes!="function"&&!Array.isArray(n.quotes)||(o=n.quotes),typeof n.skipEmptyLines!="boolean"&&typeof n.skipEmptyLines!="string"||(g=n.skipEmptyLines),typeof n.newline=="string"&&(U=n.newline),typeof n.quoteChar=="string"&&(ge=n.quoteChar),typeof n.header=="boolean"&&(_=n.header),Array.isArray(n.columns)){if(n.columns.length===0)throw new Error("Option columns is empty");l=n.columns}n.escapeChar!==void 0&&(Ce=n.escapeChar+ge),n.escapeFormulae instanceof RegExp?c=n.escapeFormulae:typeof n.escapeFormulae=="boolean"&&n.escapeFormulae&&(c=/^[=+\-@\t\r].*$/)}})(),new RegExp(ke(ge),"g"));if(typeof a=="string"&&(a=JSON.parse(a)),Array.isArray(a)){if(!a.length||Array.isArray(a[0]))return v(null,a,g);if(typeof a[0]=="object")return v(l||Object.keys(a[0]),a,g)}else if(typeof a=="object")return typeof a.data=="string"&&(a.data=JSON.parse(a.data)),Array.isArray(a.data)&&(a.fields||(a.fields=a.meta&&a.meta.fields||l),a.fields||(a.fields=Array.isArray(a.data[0])?a.fields:typeof a.data[0]=="object"?Object.keys(a.data[0]):[]),Array.isArray(a.data[0])||typeof a.data[0]=="object"||(a.data=[a.data])),v(a.fields||[],a.data||[],g);throw new Error("Unable to serialize unrecognized input");function v(L,r,s){var T="",O=(typeof L=="string"&&(L=JSON.parse(L)),typeof r=="string"&&(r=JSON.parse(r)),Array.isArray(L)&&0<L.length),B=!Array.isArray(r[0]);if(O&&_){for(var P=0;P<L.length;P++)0<P&&(T+=k),T+=p(L[P],P);0<r.length&&(T+=U)}for(var A=0;A<r.length;A++){var ee=(O?L:r[A]).length,S=!1,se=O?Object.keys(r[A]).length===0:r[A].length===0;if(s&&!O&&(S=s==="greedy"?r[A].join("").trim()==="":r[A].length===1&&r[A][0].length===0),s==="greedy"&&O){for(var fe=[],re=0;re<ee;re++){var de=B?L[re]:re;fe.push(r[A][de])}S=fe.join("").trim()===""}if(!S){for(var ae=0;ae<ee;ae++){0<ae&&!se&&(T+=k);var ce=O&&B?L[ae]:ae;T+=p(r[A][ce],ae)}A<r.length-1&&(!s||0<ee&&!se)&&(T+=U)}}return T}function p(L,r){var s,T;return L==null?"":L.constructor===Date?JSON.stringify(L).slice(1,25):(T=!1,c&&typeof L=="string"&&c.test(L)&&(L="'"+L,T=!0),s=L.toString().replace(R,Ce),(T=T||o===!0||typeof o=="function"&&o(L,r)||Array.isArray(o)&&o[r]||((O,B)=>{for(var P=0;P<B.length;P++)if(-1<O.indexOf(B[P]))return!0;return!1})(s,d.BAD_DELIMITERS)||-1<s.indexOf(k)||s.charAt(0)===" "||s.charAt(s.length-1)===" ")?ge+s+ge:s)}},d.RECORD_SEP="",d.UNIT_SEP="",d.BYTE_ORDER_MARK="\uFEFF",d.BAD_DELIMITERS=["\r",`
|
|
11
|
-
`,'"',d.BYTE_ORDER_MARK],d.WORKERS_SUPPORTED=!D&&!!i.Worker,d.NODE_STREAM_INPUT=1,d.LocalChunkSize=10485760,d.RemoteChunkSize=5242880,d.DefaultDelimiter=",",d.Parser=Ee,d.ParserHandle=q,d.NetworkStreamer=H,d.FileStreamer=j,d.StringStreamer=G,d.ReadableStreamStreamer=ve,i.jQuery&&((u=i.jQuery).fn.parse=function(a){var n=a.config||{},o=[];return this.each(function(U){if(!(u(this).prop("tagName").toUpperCase()==="INPUT"&&u(this).attr("type").toLowerCase()==="file"&&i.FileReader)||!this.files||this.files.length===0)return!0;for(var ge=0;ge<this.files.length;ge++)o.push({file:this.files[ge],inputElem:this,instanceConfig:u.extend({},n)})}),_(),this;function _(){if(o.length===0)h(a.complete)&&a.complete();else{var U,ge,Ce,g,l=o[0];if(h(a.before)){var c=a.before(l.file,l.inputElem);if(typeof c=="object"){if(c.action==="abort")return U="AbortError",ge=l.file,Ce=l.inputElem,g=c.reason,void(h(a.error)&&a.error({name:U},ge,Ce,g));if(c.action==="skip")return void k();typeof c.config=="object"&&(l.instanceConfig=u.extend(l.instanceConfig,c.config))}else if(c==="skip")return void k()}var R=l.instanceConfig.complete;l.instanceConfig.complete=function(v){h(R)&&R(v,l.file,l.inputElem),k()},d.parse(l.file,l.instanceConfig)}}function k(){o.splice(0,1),_()}}),b&&(i.onmessage=function(a){a=a.data,d.WORKER_ID===void 0&&a&&(d.WORKER_ID=a.workerId),typeof a.input=="string"?i.postMessage({workerId:d.WORKER_ID,results:d.parse(a.input,a.config),finished:!0}):(i.File&&a.input instanceof File||a.input instanceof Object)&&(a=d.parse(a.input,a.config))&&i.postMessage({workerId:d.WORKER_ID,results:a,finished:!0})}),(H.prototype=Object.create(Q.prototype)).constructor=H,(j.prototype=Object.create(Q.prototype)).constructor=j,(G.prototype=Object.create(G.prototype)).constructor=G,(ve.prototype=Object.create(Q.prototype)).constructor=ve,d})})(mt)),mt.exports}var gn=_n();const jt=La(gn);var mn=N('<span class="remote-cell-label svelte-63hltt"> </span>'),yn=N('<th><!> <input class="cell-input header-input svelte-63hltt"/> <!></th>'),wn=N('<span class="remote-cell-label svelte-63hltt"> </span>'),kn=N('<td><!> <input class="cell-input svelte-63hltt"/></td>'),bn=N('<tr class="svelte-63hltt"><td class="row-num svelte-63hltt"></td><!><td class="actions svelte-63hltt"><!></td></tr>'),xn=N("<!> <span>Add row</span>",1),En=N('<div class="csv-editor svelte-63hltt"><div class="table-scroll svelte-63hltt"><table class="svelte-63hltt"><thead><tr class="svelte-63hltt"><th class="row-num svelte-63hltt"></th><!><th class="col-add svelte-63hltt"><!></th></tr></thead><tbody></tbody></table></div> <div class="csv-footer svelte-63hltt"><!></div></div>');function Cn(W,t){at(t,!0);let f=ct(t,"remoteCursors",19,()=>[]),i=Ae(Qe([])),u=Ae(Qe([])),D=Ae(void 0);function b(g){const l=jt.parse(g.trim(),{header:!1,skipEmptyLines:!0});l.data.length>0?(E(i,l.data[0],!0),E(u,l.data.slice(1),!0)):(E(i,[],!0),E(u,[],!0))}b(t.content),Ge(()=>{b(t.content)});function x(){return jt.unparse([e(i),...e(u)])}function J(){const g=x();t.onchange?.(g)}function d(g,l,c){e(u)[g][l]=c,E(u,[...e(u)],!0),J()}function Q(g,l){e(i)[g]=l,E(i,[...e(i)],!0),J()}function H(){E(u,[...e(u),e(i).map(()=>"")],!0),J(),q(e(u).length-1,0)}function j(g){E(u,e(u).filter((l,c)=>c!==g),!0),J()}function G(){const g=`col${e(i).length+1}`;E(i,[...e(i),g],!0),E(u,e(u).map(l=>[...l,""]),!0),J(),requestAnimationFrame(()=>{const l=e(D)?.querySelector(`thead th:nth-child(${e(i).length+1}) input`);l&&(l.focus(),l.select())})}function ve(g){e(i).length<=1||(E(i,e(i).filter((l,c)=>c!==g),!0),E(u,e(u).map(l=>l.filter((c,R)=>R!==g)),!0),J())}function q(g,l){requestAnimationFrame(()=>{if(!e(D))return;let c=null;g<0?c=e(D).querySelector(`thead th:nth-child(${l+2}) input`):c=e(D).querySelector(`tbody tr:nth-child(${g+1}) td:nth-child(${l+2}) input`),c&&(c.focus(),c.select())})}function ke(g,l,c){if(g.key==="Tab"){g.preventDefault(),g.shiftKey?c>0?q(l,c-1):l>0?q(l-1,e(i).length-1):l===0&&q(-1,e(i).length-1):c<e(i).length-1?q(l,c+1):l<e(u).length-1?q(l+1,0):l===e(u).length-1&&H();return}if(g.key==="Enter"){g.preventDefault(),g.shiftKey?l>0?q(l-1,c):q(-1,c):l<e(u).length-1?q(l+1,c):H();return}if(g.key==="Escape"){g.target.blur();return}}function Ee(g,l){if(g.key==="Tab"){g.preventDefault(),g.shiftKey?l>0&&q(-1,l-1):l<e(i).length-1?q(-1,l+1):e(u).length>0&&q(0,0);return}if(g.key==="Enter"){g.preventDefault(),e(u).length>0?q(0,l):H();return}if(g.key==="Escape"){g.target.blur();return}}function $(g,l){return f().find(c=>c.row===g&&c.col===l)}function le(g,l){t.oncellselect?.(g,l)}function _e(g){(g.metaKey||g.ctrlKey)&&g.key==="s"&&(g.preventDefault(),t.onsave?.())}var he=En(),w=C(he),h=C(w),a=C(h),n=C(a),o=Y(C(n));Me(o,17,()=>e(i),Ke,(g,l,c)=>{const R=De(()=>$(-1,c));var v=yn();let p;var L=C(v);{var r=B=>{var P=mn(),A=C(P,!0);m(P),ye(()=>{Be(P,`background-color: ${e(R).color??""}`),me(A,e(R).name)}),y(B,P)};Se(L,B=>{e(R)&&B(r)})}var s=Y(L,2);lt(s);var T=Y(s,2);{var O=B=>{Ie(B,{variant:"ghost",size:"icon",class:"col-delete-btn",title:"Delete column",onclick:()=>ve(c),children:(P,A)=>{Ft(P,{size:12})},$$slots:{default:!0}})};Se(T,B=>{e(i).length>1&&B(O)})}m(v),ye(()=>{Be(v,e(R)?`--rc-color: ${e(R).color}`:""),p=tt(v,1,"svelte-63hltt",null,p,{"remote-active":!!e(R)}),At(s,e(l))}),Ue("input",s,B=>Q(c,B.currentTarget.value)),Ue("keydown",s,B=>Ee(B,c)),Je("focus",s,()=>le(-1,c)),y(g,v)});var _=Y(o),k=C(_);Ie(k,{variant:"ghost",size:"icon",class:"col-add-btn",title:"Add column",onclick:G,children:(g,l)=>{wt(g,{size:14})},$$slots:{default:!0}}),m(_),m(n),m(a);var U=Y(a);Me(U,21,()=>e(u),Ke,(g,l,c)=>{var R=bn(),v=C(R);v.textContent=c+1;var p=Y(v);Me(p,17,()=>e(l),Ke,(s,T,O)=>{const B=De(()=>$(c,O));var P=kn();let A;var ee=C(P);{var S=fe=>{var re=wn(),de=C(re,!0);m(re),ye(()=>{Be(re,`background-color: ${e(B).color??""}`),me(de,e(B).name)}),y(fe,re)};Se(ee,fe=>{e(B)&&fe(S)})}var se=Y(ee,2);lt(se),m(P),ye(()=>{Be(P,e(B)?`--rc-color: ${e(B).color}`:""),A=tt(P,1,"svelte-63hltt",null,A,{"remote-active":!!e(B)}),At(se,e(T))}),Ue("input",se,fe=>d(c,O,fe.currentTarget.value)),Ue("keydown",se,fe=>ke(fe,c,O)),Je("focus",se,()=>le(c,O)),y(s,P)});var L=Y(p),r=C(L);Ie(r,{variant:"ghost",size:"icon",class:"delete-btn",title:"Delete row",onclick:()=>j(c),children:(s,T)=>{Ft(s,{size:12})},$$slots:{default:!0}}),m(L),m(R),y(g,R)}),m(U),m(h),kt(h,g=>E(D,g),()=>e(D)),m(w);var ge=Y(w,2),Ce=C(ge);Ie(Ce,{variant:"ghost",class:"add-row-btn",onclick:H,children:(g,l)=>{var c=xn(),R=we(c);wt(R,{size:14}),Ve(2),y(g,c)},$$slots:{default:!0}}),m(ge),m(he),Ue("keydown",he,_e),y(W,he),nt()}Dt(["keydown","input"]);const Sn=/^\d{4}-\d{2}-\d{2}/,Pn=new Set(["active","inactive","in-progress","completed","draft","archived","current","former","contractor","client","partner","won","lost","open","closed"]),An=new Set(["entity_type","format"]),Rn=new Set(["entity_id","created_at","updated_at","created_by","updated_by"]);function Dn(W,t){const f=[];for(const[i,u]of Object.entries(W)){if(Rn.has(i)||u==null)continue;const D=Tn(i,u);D&&f.push(D)}return f}function Tn(W,t){if(An.has(W))return{key:W,value:String(t).toUpperCase(),type:"badge"};if(W==="status")return{key:W,value:String(t),type:"status"};if(Array.isArray(t)){if(t.length>0&&typeof t[0]=="object"&&t[0]!==null){const x=t.map(J=>Object.entries(J).map(([Q,H])=>`${Q}: ${H}`).join(", "));return{key:W,value:x.join(" | "),type:"text"}}const u=t.map(String),D=u.some(x=>/^\[\[.+?\]\]$/.test(x)),b=u.map(x=>{const J=x.match(/^\[\[(.+?)\]\]$/);return J?J[1]:x});return D||b.every(x=>Nt(x))?{key:W,value:b,type:"wikilink"}:{key:W,value:u.join(", "),type:"text"}}const f=String(t),i=f.match(/^\[\[(.+?)\]\]$/);return i?{key:W,value:i[1],type:"wikilink"}:Sn.test(f)?{key:W,value:f,type:"date"}:Pn.has(f.toLowerCase())?{key:W,value:f,type:"status"}:Nt(f)&&!f.includes(" ")?{key:W,value:f,type:"wikilink"}:{key:W,value:f,type:"text"}}function Nt(W){return/^[a-z0-9][a-z0-9-]*[a-z0-9]$/.test(W)&&W.includes("-")}function Ut(W,t){const f=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56"}]];$e(W,Xe({name:"loader-circle"},()=>f,{get iconNode(){return i},children:(u,D)=>{var b=Le(),x=we(b);et(x,t,"default",{}),y(u,b)},$$slots:{default:!0}}))}class On{diff(t,f,i={}){let u;typeof i=="function"?(u=i,i={}):"callback"in i&&(u=i.callback);const D=this.castInput(t,i),b=this.castInput(f,i),x=this.removeEmpty(this.tokenize(D,i)),J=this.removeEmpty(this.tokenize(b,i));return this.diffWithOptionsObj(x,J,i,u)}diffWithOptionsObj(t,f,i,u){var D;const b=$=>{if($=this.postProcess($,i),u){setTimeout(function(){u($)},0);return}else return $},x=f.length,J=t.length;let d=1,Q=x+J;i.maxEditLength!=null&&(Q=Math.min(Q,i.maxEditLength));const H=(D=i.timeout)!==null&&D!==void 0?D:1/0,j=Date.now()+H,G=[{oldPos:-1,lastComponent:void 0}];let ve=this.extractCommon(G[0],f,t,0,i);if(G[0].oldPos+1>=J&&ve+1>=x)return b(this.buildValues(G[0].lastComponent,f,t));let q=-1/0,ke=1/0;const Ee=()=>{for(let $=Math.max(q,-d);$<=Math.min(ke,d);$+=2){let le;const _e=G[$-1],he=G[$+1];_e&&(G[$-1]=void 0);let w=!1;if(he){const a=he.oldPos-$;w=he&&0<=a&&a<x}const h=_e&&_e.oldPos+1<J;if(!w&&!h){G[$]=void 0;continue}if(!h||w&&_e.oldPos<he.oldPos?le=this.addToPath(he,!0,!1,0,i):le=this.addToPath(_e,!1,!0,1,i),ve=this.extractCommon(le,f,t,$,i),le.oldPos+1>=J&&ve+1>=x)return b(this.buildValues(le.lastComponent,f,t))||!0;G[$]=le,le.oldPos+1>=J&&(ke=Math.min(ke,$-1)),ve+1>=x&&(q=Math.max(q,$+1))}d++};if(u)(function $(){setTimeout(function(){if(d>Q||Date.now()>j)return u(void 0);Ee()||$()},0)})();else for(;d<=Q&&Date.now()<=j;){const $=Ee();if($)return $}}addToPath(t,f,i,u,D){const b=t.lastComponent;return b&&!D.oneChangePerToken&&b.added===f&&b.removed===i?{oldPos:t.oldPos+u,lastComponent:{count:b.count+1,added:f,removed:i,previousComponent:b.previousComponent}}:{oldPos:t.oldPos+u,lastComponent:{count:1,added:f,removed:i,previousComponent:b}}}extractCommon(t,f,i,u,D){const b=f.length,x=i.length;let J=t.oldPos,d=J-u,Q=0;for(;d+1<b&&J+1<x&&this.equals(i[J+1],f[d+1],D);)d++,J++,Q++,D.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return Q&&!D.oneChangePerToken&&(t.lastComponent={count:Q,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=J,d}equals(t,f,i){return i.comparator?i.comparator(t,f):t===f||!!i.ignoreCase&&t.toLowerCase()===f.toLowerCase()}removeEmpty(t){const f=[];for(let i=0;i<t.length;i++)t[i]&&f.push(t[i]);return f}castInput(t,f){return t}tokenize(t,f){return Array.from(t)}join(t){return t.join("")}postProcess(t,f){return t}get useLongestToken(){return!1}buildValues(t,f,i){const u=[];let D;for(;t;)u.push(t),D=t.previousComponent,delete t.previousComponent,t=D;u.reverse();const b=u.length;let x=0,J=0,d=0;for(;x<b;x++){const Q=u[x];if(Q.removed)Q.value=this.join(i.slice(d,d+Q.count)),d+=Q.count;else{if(!Q.added&&this.useLongestToken){let H=f.slice(J,J+Q.count);H=H.map(function(j,G){const ve=i[d+G];return ve.length>j.length?ve:j}),Q.value=this.join(H)}else Q.value=this.join(f.slice(J,J+Q.count));J+=Q.count,Q.added||(d+=Q.count)}}return u}}const Kt="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class Ln extends On{tokenize(t){const f=new RegExp(`(\\r?\\n)|[${Kt}]+|[^\\S\\n\\r]+|[^${Kt}]`,"ug");return t.match(f)||[]}}const zn=new Ln;function Fn(W,t,f){return zn.diff(W,t,f)}var Mn=N('<div class="dp-row svelte-1g4tvol"><div class="dp-icon svelte-1g4tvol"><!></div> <div class="dp-key svelte-1g4tvol"> </div> <div class="dp-value svelte-1g4tvol"><div class="dp-diff-old svelte-1g4tvol"><span> </span></div> <div class="dp-diff-new svelte-1g4tvol"><span> </span></div></div></div>'),In=N('<div class="diff-properties svelte-1g4tvol"></div>'),jn=N('<span class="db-added"> </span>'),Nn=N('<span class="db-removed"> </span>'),Un=N("<span> </span>"),Kn=N("<span> </span>"),qn=N('<div class="diff-view svelte-1g4tvol"><!> <div class="diff-body svelte-1g4tvol"><!></div></div>');function Vn(W,t){at(t,!0);function f(j){if(j==null)return"";if(typeof j!="object")return String(j);const G=j;return String(G.name??G.title??G.label??G.id??JSON.stringify(G))}function i(j){return j==null?"":Array.isArray(j)?j.map(f).join(", "):typeof j=="object"?f(j):String(j)}const u=De(()=>t.refreshResult.body_changed&&t.refreshResult.body_diff?Fn(t.refreshResult.body_diff.old,t.refreshResult.body_diff.new):null);var D=qn(),b=C(D);{var x=j=>{var G=In();Me(G,21,()=>t.refreshResult.diffs,Ke,(ve,q)=>{const ke=De(()=>t.properties.find(c=>c.key===e(q).field));var Ee=Mn(),$=C(Ee),le=C($);{var _e=c=>{pt(c,{size:14})},he=c=>{_t(c,{size:14})},w=c=>{gt(c,{size:14})},h=c=>{Yt(c,{size:14})},a=c=>{ht(c,{size:14})};Se(le,c=>{e(ke)?.type==="date"?c(_e):e(ke)?.type==="status"?c(he,1):e(ke)?.type==="wikilink"?c(w,2):e(ke)?.type==="badge"?c(h,3):c(a,!1)})}m($);var n=Y($,2),o=C(n,!0);m(n);var _=Y(n,2),k=C(_),U=C(k),ge=C(U,!0);m(U),m(k);var Ce=Y(k,2),g=C(Ce),l=C(g,!0);m(g),m(Ce),m(_),m(Ee),ye((c,R)=>{me(o,e(q).field),me(ge,c),me(l,R)},[()=>i(e(q).old_value),()=>i(e(q).new_value)]),y(ve,Ee)}),m(G),y(j,G)};Se(b,j=>{t.refreshResult.diffs.length>0&&j(x)})}var J=Y(b,2),d=C(J);{var Q=j=>{var G=Le(),ve=we(G);Me(ve,17,()=>e(u),Ke,(q,ke)=>{var Ee=Le(),$=we(Ee);{var le=w=>{var h=jn(),a=C(h,!0);m(h),ye(()=>me(a,e(ke).value)),y(w,h)},_e=w=>{var h=Nn(),a=C(h,!0);m(h),ye(()=>me(a,e(ke).value)),y(w,h)},he=w=>{var h=Un(),a=C(h,!0);m(h),ye(()=>me(a,e(ke).value)),y(w,h)};Se($,w=>{e(ke).added?w(le):e(ke).removed?w(_e,1):w(he,!1)})}y(q,Ee)}),y(j,G)},H=j=>{var G=Kn(),ve=C(G,!0);m(G),ye(()=>me(ve,t.bodyContent)),y(j,G)};Se(d,j=>{e(u)?j(Q):j(H,!1)})}m(J),m(D),y(W,D),nt()}var Wn=N("<!> ",1),Hn=N('<span class="diff-action-title svelte-1dc9loe">Changes from source</span> <div class="diff-action-buttons svelte-1dc9loe"><!> <!></div>',1),Bn=N('<span class="bc-sep svelte-1dc9loe">/</span>'),Yn=N("<!><span> </span>",1),Jn=N('<span class="status-text saving svelte-1dc9loe">Saving...</span>'),Qn=N('<span class="status-text error svelte-1dc9loe"> </span>'),Gn=N("<!> ",1),Zn=N('<div class="breadcrumb-path svelte-1dc9loe"></div> <div class="editor-actions svelte-1dc9loe"><!> <!> <!></div>',1),Xn=N('<div class="refresh-panel svelte-1dc9loe"><div class="refresh-uptodate svelte-1dc9loe">Entity is up to date with source.</div></div>'),$n=N('<div class="document-scroll svelte-1dc9loe"><!> <!></div>'),er=N('<div class="content-row svelte-1dc9loe"><div class="entity-area svelte-1dc9loe"><!> <div><!></div> <!> <!></div> <!></div>'),tr=N("<!> <!>",1),ar=N("<!> <!>",1),nr=N("<!> <!>",1);function yr(W,t){at(t,!0);const f=Wt("chat"),i=De(()=>t.data.type==="dataset"||t.data.entity.document?.frontmatter?.entity_type==="dataset"),u=De(()=>yt.getAppForEntityType(t.data.entity.document?.frontmatter?.entity_type??t.data.type)),D=De(()=>()=>{const v=t.data.entity.path;if(v){const p=v.lastIndexOf(`/${t.data.repo}/`);if(p>=0)return v.substring(p+1).split("/")}return[t.data.repo,t.data.id,"main.md"]});let b=Ae(""),x=Ae(Qe({})),J=Ae(0);const d=De(()=>Dn(e(x))),Q=De(()=>!!t.data.entity.data?.source_ref);let H=Ae(!1),j=Ae(null),G=Ae(null);async function ve(){if(!e(H)){E(H,!0),E(j,null),E(G,null);try{const{result:v}=await Aa(t.data.repo,t.data.type,t.data.id);E(j,v,!0)}catch(v){E(G,v.message||"Refresh failed",!0)}finally{E(H,!1)}}}let q=Ae(!1);async function ke(){if(!e(q)){E(q,!0);try{await Pa(t.data.repo,t.data.type,t.data.id),E(j,null),await da()}catch(v){E(G,v.message||"Apply changes failed",!0)}finally{E(q,!1)}}}let Ee=null,$=Ae(""),le=!1,_e=Ae(Qe([]));function he(v){w(),qe(async()=>{const{createCollabSession:p}=await import("../chunks/buWG8Dmo.js");return{createCollabSession:p}},__vite__mapDeps([8,9,10,11,12,13,14,15]),import.meta.url).then(({createCollabSession:p})=>{const L=getComputedStyle(document.documentElement).getPropertyValue("--color-accent").trim()||"#6e6ee8",r=p(v,{name:Lt.user?.displayName??"Anonymous",color:L,colorLight:L+"33"});r.ytext.observe(()=>{const O=r.ytext.toString();O!==e(b)&&(le=!0,E(b,O,!0),requestAnimationFrame(()=>{le=!1}))});const s=r.ydoc.clientID;function T(){const O=[];r.awareness.getStates().forEach((B,P)=>{if(P===s)return;const A=B.cell;if(A==null||A.row==null||A.col==null)return;const{name:ee="Anonymous",color:S="#6e6ee8"}=B.user||{};O.push({row:A.row,col:A.col,name:ee,color:S})}),E(_e,O,!0)}r.awareness.on("change",T),Ee=r,E($,v,!0)})}function w(){Ee&&(Ee.destroy(),Ee=null,E($,""),E(_e,[],!0))}Ht(()=>w());let h=Ae(""),a=Ae(0);Ge(()=>{const v=`${t.data.repo}/${t.data.type}/${t.data.id}`,p=Ra.mutationCount;if(v!==e(h)||p!==e(a)){e(h)&&v!==e(h)&&je.flush(),E(h,v),E(a,p,!0),E(b,t.data.entity.document?.content??"",!0),E(x,{...t.data.entity.document?.frontmatter??t.data.entity.data??{}},!0),ot(J),je.reset();const L=`${t.data.repo}/${t.data.type}/${t.data.id}`;e(i)&&L!==e($)?he(L):e(i)||w()}}),Ge(()=>{const v=t.data.repo,p=t.data.type,L=t.data.id;qt(()=>{Pt.select(v,p,L),Pt.showEntity()})});function n(v){if(!le){if(E(b,v,!0),Ee){const p=Ee.ytext,L=p.toString();v!==L&&Ee.ydoc.transact(()=>{p.delete(0,p.length),p.insert(0,v)})}je.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{content:v})}}function o(v,p){E(x,{...e(x),[v]:p},!0),je.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(x)})}function _(v){const{[v]:p,...L}=e(x);E(x,L,!0),je.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(x)})}function k(v,p){E(x,{...e(x),[v]:p},!0),je.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(x)})}function U(v,p){je.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(x)})}function ge(v){for(const p of yt.repos){const L=p.entities.find(r=>r.id===v);if(L){Rt(`/${p.name}/${L.entityType}/${L.id}`);return}}ua.showToast(`"${v}" is in a collection you don't have access to`)}Ge(()=>(Mt.enter(t.data.repo,t.data.type,t.data.id),()=>Mt.leave()));const Ce=De(()=>e(j)!==null&&(e(j).diffs.length>0||e(j).body_changed));function g(v){(v.metaKey||v.ctrlKey)&&v.key==="s"&&(v.preventDefault(),je.flush()),v.key==="Escape"&&!(v.target instanceof HTMLInputElement||v.target instanceof HTMLTextAreaElement)&&(je.flush(),Pt.deselect(),Rt("/"))}var l=nr();Je("keydown",Vt,g);var c=we(l);ya(c,{children:(v,p)=>{var L=er(),r=C(L),s=C(r);Da(s,{activeView:"entity"});var T=Y(s,2);let O;var B=C(T);{var P=ce=>{var I=Hn(),ie=Y(we(I),2),Pe=C(ie);Ie(Pe,{variant:"outline",size:"default",onclick:()=>E(j,null),get disabled(){return e(q)},children:(F,M)=>{Ve();var K=Ye("Dismiss");y(F,K)},$$slots:{default:!0}});var z=Y(Pe,2);Ie(z,{variant:"accent",size:"default",onclick:ke,get disabled(){return e(q)},children:(F,M)=>{var K=Wn(),oe=we(K);{var ue=Z=>{Ut(Z,{class:"size-3 animate-spin",style:"display:inline;vertical-align:middle;margin-right:4px"})};Se(oe,Z=>{e(q)&&Z(ue)})}var be=Y(oe,1,!0);ye(()=>me(be,e(q)?"Applying...":"Apply changes")),y(F,K)},$$slots:{default:!0}}),m(ie),y(ce,I)},A=ce=>{var I=Zn(),ie=we(I);Me(ie,21,()=>e(D)(),Ke,(Z,te,Re)=>{var X=Yn(),V=we(X);{var ne=Te=>{var Oe=Bn();y(Te,Oe)};Se(V,Te=>{Re>0&&Te(ne)})}var pe=Y(V),xe=C(pe,!0);m(pe),ye(Te=>{tt(pe,1,Te,"svelte-1dc9loe"),me(xe,e(te))},[()=>ia(Re===e(D)().length-1?"bc-current":"bc-segment")]),y(Z,X)}),m(ie);var Pe=Y(ie,2),z=C(Pe);{var F=Z=>{var te=Jn();y(Z,te)},M=Z=>{var te=Qn(),Re=C(te,!0);m(te),ye(()=>me(Re,je.error)),y(Z,te)};Se(z,Z=>{je.saving?Z(F):je.error&&Z(M,1)})}var K=Y(z,2);{var oe=Z=>{Ie(Z,{variant:"outline",size:"sm",class:"refresh-btn",onclick:ve,get disabled(){return e(H)},children:(te,Re)=>{var X=Gn(),V=we(X);{var ne=xe=>{Ut(xe,{class:"size-3 animate-spin",style:"display:inline;vertical-align:middle;margin-right:4px"})};Se(V,xe=>{e(H)&&xe(ne)})}var pe=Y(V,1,!0);ye(()=>me(pe,e(H)?"Refreshing...":"Refresh from source")),y(te,X)},$$slots:{default:!0}})};Se(K,Z=>{e(Q)&&Lt.user?.role==="admin"&&Z(oe)})}var ue=Y(K,2);{var be=Z=>{Ie(Z,{variant:"link",size:"sm",class:"open-app",get href(){return`/${t.data.repo??""}/${t.data.type??""}/${t.data.id??""}/edit`},children:(te,Re)=>{Ve();var X=Ye();ye(()=>me(X,`Open in ${e(u).name??""} →`)),y(te,X)},$$slots:{default:!0}})};Se(ue,Z=>{e(u)&&Z(be)})}m(Pe),y(ce,I)};Se(B,ce=>{e(Ce)?ce(P):ce(A,!1)})}m(T);var ee=Y(T,2);{var S=ce=>{var I=Xn();y(ce,I)};Se(ee,ce=>{e(j)&&!e(Ce)&&ce(S)})}var se=Y(ee,2);{var fe=ce=>{Vn(ce,{get properties(){return e(d)},get refreshResult(){return e(j)},get bodyContent(){return e(b)}})},re=ce=>{var I=$n(),ie=C(I);un(ie,{get properties(){return e(d)},editable:!0,onedit:o,onremove:_,onadd:k,ontypechange:U});var Pe=Y(ie,2);{var z=M=>{Cn(M,{get content(){return e(b)},onchange:n,onsave:()=>je.flush(),oncellselect:(K,oe)=>{Ee?.awareness.setLocalStateField("cell",{row:K,col:oe})},get remoteCursors(){return e(_e)}})},F=M=>{{let K=De(()=>`${t.data.repo}/${t.data.type}/${t.data.id}`);hn(M,{get content(){return e(b)},readonly:!1,onchange:n,onsave:()=>je.flush(),onwikilinkclick:ge,get resetKey(){return e(J)},get cursorDocName(){return e(K)}})}};Se(Pe,M=>{e(i)?M(z):M(F,!1)})}m(I),y(ce,I)};Se(se,ce=>{e(Ce)?ce(fe):ce(re,!1)})}m(r);var de=Y(r,2);{var ae=ce=>{Ta(ce,{})};Se(de,ce=>{f.open&&ce(ae)})}m(L),ye(()=>O=tt(T,1,"editor-bar svelte-1dc9loe",null,O,{"editor-bar-diff":e(Ce)})),y(v,L)},$$slots:{default:!0}});var R=Y(c,2);{let v=De(()=>!!e(G));Ne(R,()=>Sa,(p,L)=>{L(p,{get open(){return e(v)},onOpenChange:r=>{r||E(G,null)},children:(r,s)=>{var T=Le(),O=we(T);Ne(O,()=>wa,(B,P)=>{P(B,{children:(A,ee)=>{var S=ar(),se=we(S);Ne(se,()=>ka,(re,de)=>{de(re,{children:(ae,ce)=>{var I=tr(),ie=we(I);Ne(ie,()=>ba,(z,F)=>{F(z,{children:(M,K)=>{Ve();var oe=Ye("Refresh failed");y(M,oe)},$$slots:{default:!0}})});var Pe=Y(ie,2);Ne(Pe,()=>xa,(z,F)=>{F(z,{children:(M,K)=>{Ve();var oe=Ye();ye(()=>me(oe,e(G))),y(M,oe)},$$slots:{default:!0}})}),y(ae,I)},$$slots:{default:!0}})});var fe=Y(se,2);Ne(fe,()=>Ea,(re,de)=>{de(re,{children:(ae,ce)=>{var I=Le(),ie=we(I);Ne(ie,()=>Ca,(Pe,z)=>{z(Pe,{children:(F,M)=>{Ve();var K=Ye("OK");y(F,K)},$$slots:{default:!0}})}),y(ae,I)},$$slots:{default:!0}})}),y(A,S)},$$slots:{default:!0}})}),y(r,T)},$$slots:{default:!0}})})}y(W,l),nt()}export{yr as component,mr as universal};
|
|
11
|
+
`,'"',d.BYTE_ORDER_MARK],d.WORKERS_SUPPORTED=!D&&!!i.Worker,d.NODE_STREAM_INPUT=1,d.LocalChunkSize=10485760,d.RemoteChunkSize=5242880,d.DefaultDelimiter=",",d.Parser=Ee,d.ParserHandle=q,d.NetworkStreamer=H,d.FileStreamer=j,d.StringStreamer=G,d.ReadableStreamStreamer=ve,i.jQuery&&((u=i.jQuery).fn.parse=function(a){var n=a.config||{},o=[];return this.each(function(U){if(!(u(this).prop("tagName").toUpperCase()==="INPUT"&&u(this).attr("type").toLowerCase()==="file"&&i.FileReader)||!this.files||this.files.length===0)return!0;for(var ge=0;ge<this.files.length;ge++)o.push({file:this.files[ge],inputElem:this,instanceConfig:u.extend({},n)})}),_(),this;function _(){if(o.length===0)h(a.complete)&&a.complete();else{var U,ge,Ce,g,l=o[0];if(h(a.before)){var c=a.before(l.file,l.inputElem);if(typeof c=="object"){if(c.action==="abort")return U="AbortError",ge=l.file,Ce=l.inputElem,g=c.reason,void(h(a.error)&&a.error({name:U},ge,Ce,g));if(c.action==="skip")return void k();typeof c.config=="object"&&(l.instanceConfig=u.extend(l.instanceConfig,c.config))}else if(c==="skip")return void k()}var R=l.instanceConfig.complete;l.instanceConfig.complete=function(v){h(R)&&R(v,l.file,l.inputElem),k()},d.parse(l.file,l.instanceConfig)}}function k(){o.splice(0,1),_()}}),b&&(i.onmessage=function(a){a=a.data,d.WORKER_ID===void 0&&a&&(d.WORKER_ID=a.workerId),typeof a.input=="string"?i.postMessage({workerId:d.WORKER_ID,results:d.parse(a.input,a.config),finished:!0}):(i.File&&a.input instanceof File||a.input instanceof Object)&&(a=d.parse(a.input,a.config))&&i.postMessage({workerId:d.WORKER_ID,results:a,finished:!0})}),(H.prototype=Object.create(Q.prototype)).constructor=H,(j.prototype=Object.create(Q.prototype)).constructor=j,(G.prototype=Object.create(G.prototype)).constructor=G,(ve.prototype=Object.create(Q.prototype)).constructor=ve,d})})(mt)),mt.exports}var gn=_n();const jt=La(gn);var mn=N('<span class="remote-cell-label svelte-63hltt"> </span>'),yn=N('<th><!> <input class="cell-input header-input svelte-63hltt"/> <!></th>'),wn=N('<span class="remote-cell-label svelte-63hltt"> </span>'),kn=N('<td><!> <input class="cell-input svelte-63hltt"/></td>'),bn=N('<tr class="svelte-63hltt"><td class="row-num svelte-63hltt"></td><!><td class="actions svelte-63hltt"><!></td></tr>'),xn=N("<!> <span>Add row</span>",1),En=N('<div class="csv-editor svelte-63hltt"><div class="table-scroll svelte-63hltt"><table class="svelte-63hltt"><thead><tr class="svelte-63hltt"><th class="row-num svelte-63hltt"></th><!><th class="col-add svelte-63hltt"><!></th></tr></thead><tbody></tbody></table></div> <div class="csv-footer svelte-63hltt"><!></div></div>');function Cn(W,t){at(t,!0);let f=ct(t,"remoteCursors",19,()=>[]),i=Ae(Qe([])),u=Ae(Qe([])),D=Ae(void 0);function b(g){const l=jt.parse(g.trim(),{header:!1,skipEmptyLines:!0});l.data.length>0?(E(i,l.data[0],!0),E(u,l.data.slice(1),!0)):(E(i,[],!0),E(u,[],!0))}b(t.content),Ge(()=>{b(t.content)});function x(){return jt.unparse([e(i),...e(u)])}function J(){const g=x();t.onchange?.(g)}function d(g,l,c){e(u)[g][l]=c,E(u,[...e(u)],!0),J()}function Q(g,l){e(i)[g]=l,E(i,[...e(i)],!0),J()}function H(){E(u,[...e(u),e(i).map(()=>"")],!0),J(),q(e(u).length-1,0)}function j(g){E(u,e(u).filter((l,c)=>c!==g),!0),J()}function G(){const g=`col${e(i).length+1}`;E(i,[...e(i),g],!0),E(u,e(u).map(l=>[...l,""]),!0),J(),requestAnimationFrame(()=>{const l=e(D)?.querySelector(`thead th:nth-child(${e(i).length+1}) input`);l&&(l.focus(),l.select())})}function ve(g){e(i).length<=1||(E(i,e(i).filter((l,c)=>c!==g),!0),E(u,e(u).map(l=>l.filter((c,R)=>R!==g)),!0),J())}function q(g,l){requestAnimationFrame(()=>{if(!e(D))return;let c=null;g<0?c=e(D).querySelector(`thead th:nth-child(${l+2}) input`):c=e(D).querySelector(`tbody tr:nth-child(${g+1}) td:nth-child(${l+2}) input`),c&&(c.focus(),c.select())})}function ke(g,l,c){if(g.key==="Tab"){g.preventDefault(),g.shiftKey?c>0?q(l,c-1):l>0?q(l-1,e(i).length-1):l===0&&q(-1,e(i).length-1):c<e(i).length-1?q(l,c+1):l<e(u).length-1?q(l+1,0):l===e(u).length-1&&H();return}if(g.key==="Enter"){g.preventDefault(),g.shiftKey?l>0?q(l-1,c):q(-1,c):l<e(u).length-1?q(l+1,c):H();return}if(g.key==="Escape"){g.target.blur();return}}function Ee(g,l){if(g.key==="Tab"){g.preventDefault(),g.shiftKey?l>0&&q(-1,l-1):l<e(i).length-1?q(-1,l+1):e(u).length>0&&q(0,0);return}if(g.key==="Enter"){g.preventDefault(),e(u).length>0?q(0,l):H();return}if(g.key==="Escape"){g.target.blur();return}}function $(g,l){return f().find(c=>c.row===g&&c.col===l)}function le(g,l){t.oncellselect?.(g,l)}function _e(g){(g.metaKey||g.ctrlKey)&&g.key==="s"&&(g.preventDefault(),t.onsave?.())}var he=En(),w=C(he),h=C(w),a=C(h),n=C(a),o=Y(C(n));Me(o,17,()=>e(i),Ke,(g,l,c)=>{const R=De(()=>$(-1,c));var v=yn();let p;var L=C(v);{var r=B=>{var P=mn(),A=C(P,!0);m(P),ye(()=>{Be(P,`background-color: ${e(R).color??""}`),me(A,e(R).name)}),y(B,P)};Se(L,B=>{e(R)&&B(r)})}var s=Y(L,2);lt(s);var T=Y(s,2);{var O=B=>{Ie(B,{variant:"ghost",size:"icon",class:"col-delete-btn",title:"Delete column",onclick:()=>ve(c),children:(P,A)=>{Ft(P,{size:12})},$$slots:{default:!0}})};Se(T,B=>{e(i).length>1&&B(O)})}m(v),ye(()=>{Be(v,e(R)?`--rc-color: ${e(R).color}`:""),p=tt(v,1,"svelte-63hltt",null,p,{"remote-active":!!e(R)}),At(s,e(l))}),Ue("input",s,B=>Q(c,B.currentTarget.value)),Ue("keydown",s,B=>Ee(B,c)),Je("focus",s,()=>le(-1,c)),y(g,v)});var _=Y(o),k=C(_);Ie(k,{variant:"ghost",size:"icon",class:"col-add-btn",title:"Add column",onclick:G,children:(g,l)=>{wt(g,{size:14})},$$slots:{default:!0}}),m(_),m(n),m(a);var U=Y(a);Me(U,21,()=>e(u),Ke,(g,l,c)=>{var R=bn(),v=C(R);v.textContent=c+1;var p=Y(v);Me(p,17,()=>e(l),Ke,(s,T,O)=>{const B=De(()=>$(c,O));var P=kn();let A;var ee=C(P);{var S=fe=>{var re=wn(),de=C(re,!0);m(re),ye(()=>{Be(re,`background-color: ${e(B).color??""}`),me(de,e(B).name)}),y(fe,re)};Se(ee,fe=>{e(B)&&fe(S)})}var se=Y(ee,2);lt(se),m(P),ye(()=>{Be(P,e(B)?`--rc-color: ${e(B).color}`:""),A=tt(P,1,"svelte-63hltt",null,A,{"remote-active":!!e(B)}),At(se,e(T))}),Ue("input",se,fe=>d(c,O,fe.currentTarget.value)),Ue("keydown",se,fe=>ke(fe,c,O)),Je("focus",se,()=>le(c,O)),y(s,P)});var L=Y(p),r=C(L);Ie(r,{variant:"ghost",size:"icon",class:"delete-btn",title:"Delete row",onclick:()=>j(c),children:(s,T)=>{Ft(s,{size:12})},$$slots:{default:!0}}),m(L),m(R),y(g,R)}),m(U),m(h),kt(h,g=>E(D,g),()=>e(D)),m(w);var ge=Y(w,2),Ce=C(ge);Ie(Ce,{variant:"ghost",class:"add-row-btn",onclick:H,children:(g,l)=>{var c=xn(),R=we(c);wt(R,{size:14}),Ve(2),y(g,c)},$$slots:{default:!0}}),m(ge),m(he),Ue("keydown",he,_e),y(W,he),nt()}Dt(["keydown","input"]);const Sn=/^\d{4}-\d{2}-\d{2}/,Pn=new Set(["active","inactive","in-progress","completed","draft","archived","current","former","contractor","client","partner","won","lost","open","closed"]),An=new Set(["entity_type","format"]),Rn=new Set(["entity_id","created_at","updated_at","created_by","updated_by"]);function Dn(W,t){const f=[];for(const[i,u]of Object.entries(W)){if(Rn.has(i)||u==null)continue;const D=Tn(i,u);D&&f.push(D)}return f}function Tn(W,t){if(An.has(W))return{key:W,value:String(t).toUpperCase(),type:"badge"};if(W==="status")return{key:W,value:String(t),type:"status"};if(Array.isArray(t)){if(t.length>0&&typeof t[0]=="object"&&t[0]!==null){const x=t.map(J=>Object.entries(J).map(([Q,H])=>`${Q}: ${H}`).join(", "));return{key:W,value:x.join(" | "),type:"text"}}const u=t.map(String),D=u.some(x=>/^\[\[.+?\]\]$/.test(x)),b=u.map(x=>{const J=x.match(/^\[\[(.+?)\]\]$/);return J?J[1]:x});return D||b.every(x=>Nt(x))?{key:W,value:b,type:"wikilink"}:{key:W,value:u.join(", "),type:"text"}}const f=String(t),i=f.match(/^\[\[(.+?)\]\]$/);return i?{key:W,value:i[1],type:"wikilink"}:Sn.test(f)?{key:W,value:f,type:"date"}:Pn.has(f.toLowerCase())?{key:W,value:f,type:"status"}:Nt(f)&&!f.includes(" ")?{key:W,value:f,type:"wikilink"}:{key:W,value:f,type:"text"}}function Nt(W){return/^[a-z0-9][a-z0-9-]*[a-z0-9]$/.test(W)&&W.includes("-")}function Ut(W,t){const f=Ze(t,["children","$$slots","$$events","$$legacy"]);const i=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56"}]];$e(W,Xe({name:"loader-circle"},()=>f,{get iconNode(){return i},children:(u,D)=>{var b=Le(),x=we(b);et(x,t,"default",{}),y(u,b)},$$slots:{default:!0}}))}class On{diff(t,f,i={}){let u;typeof i=="function"?(u=i,i={}):"callback"in i&&(u=i.callback);const D=this.castInput(t,i),b=this.castInput(f,i),x=this.removeEmpty(this.tokenize(D,i)),J=this.removeEmpty(this.tokenize(b,i));return this.diffWithOptionsObj(x,J,i,u)}diffWithOptionsObj(t,f,i,u){var D;const b=$=>{if($=this.postProcess($,i),u){setTimeout(function(){u($)},0);return}else return $},x=f.length,J=t.length;let d=1,Q=x+J;i.maxEditLength!=null&&(Q=Math.min(Q,i.maxEditLength));const H=(D=i.timeout)!==null&&D!==void 0?D:1/0,j=Date.now()+H,G=[{oldPos:-1,lastComponent:void 0}];let ve=this.extractCommon(G[0],f,t,0,i);if(G[0].oldPos+1>=J&&ve+1>=x)return b(this.buildValues(G[0].lastComponent,f,t));let q=-1/0,ke=1/0;const Ee=()=>{for(let $=Math.max(q,-d);$<=Math.min(ke,d);$+=2){let le;const _e=G[$-1],he=G[$+1];_e&&(G[$-1]=void 0);let w=!1;if(he){const a=he.oldPos-$;w=he&&0<=a&&a<x}const h=_e&&_e.oldPos+1<J;if(!w&&!h){G[$]=void 0;continue}if(!h||w&&_e.oldPos<he.oldPos?le=this.addToPath(he,!0,!1,0,i):le=this.addToPath(_e,!1,!0,1,i),ve=this.extractCommon(le,f,t,$,i),le.oldPos+1>=J&&ve+1>=x)return b(this.buildValues(le.lastComponent,f,t))||!0;G[$]=le,le.oldPos+1>=J&&(ke=Math.min(ke,$-1)),ve+1>=x&&(q=Math.max(q,$+1))}d++};if(u)(function $(){setTimeout(function(){if(d>Q||Date.now()>j)return u(void 0);Ee()||$()},0)})();else for(;d<=Q&&Date.now()<=j;){const $=Ee();if($)return $}}addToPath(t,f,i,u,D){const b=t.lastComponent;return b&&!D.oneChangePerToken&&b.added===f&&b.removed===i?{oldPos:t.oldPos+u,lastComponent:{count:b.count+1,added:f,removed:i,previousComponent:b.previousComponent}}:{oldPos:t.oldPos+u,lastComponent:{count:1,added:f,removed:i,previousComponent:b}}}extractCommon(t,f,i,u,D){const b=f.length,x=i.length;let J=t.oldPos,d=J-u,Q=0;for(;d+1<b&&J+1<x&&this.equals(i[J+1],f[d+1],D);)d++,J++,Q++,D.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return Q&&!D.oneChangePerToken&&(t.lastComponent={count:Q,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=J,d}equals(t,f,i){return i.comparator?i.comparator(t,f):t===f||!!i.ignoreCase&&t.toLowerCase()===f.toLowerCase()}removeEmpty(t){const f=[];for(let i=0;i<t.length;i++)t[i]&&f.push(t[i]);return f}castInput(t,f){return t}tokenize(t,f){return Array.from(t)}join(t){return t.join("")}postProcess(t,f){return t}get useLongestToken(){return!1}buildValues(t,f,i){const u=[];let D;for(;t;)u.push(t),D=t.previousComponent,delete t.previousComponent,t=D;u.reverse();const b=u.length;let x=0,J=0,d=0;for(;x<b;x++){const Q=u[x];if(Q.removed)Q.value=this.join(i.slice(d,d+Q.count)),d+=Q.count;else{if(!Q.added&&this.useLongestToken){let H=f.slice(J,J+Q.count);H=H.map(function(j,G){const ve=i[d+G];return ve.length>j.length?ve:j}),Q.value=this.join(H)}else Q.value=this.join(f.slice(J,J+Q.count));J+=Q.count,Q.added||(d+=Q.count)}}return u}}const Kt="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class Ln extends On{tokenize(t){const f=new RegExp(`(\\r?\\n)|[${Kt}]+|[^\\S\\n\\r]+|[^${Kt}]`,"ug");return t.match(f)||[]}}const zn=new Ln;function Fn(W,t,f){return zn.diff(W,t,f)}var Mn=N('<div class="dp-row svelte-1g4tvol"><div class="dp-icon svelte-1g4tvol"><!></div> <div class="dp-key svelte-1g4tvol"> </div> <div class="dp-value svelte-1g4tvol"><div class="dp-diff-old svelte-1g4tvol"><span> </span></div> <div class="dp-diff-new svelte-1g4tvol"><span> </span></div></div></div>'),In=N('<div class="diff-properties svelte-1g4tvol"></div>'),jn=N('<span class="db-added"> </span>'),Nn=N('<span class="db-removed"> </span>'),Un=N("<span> </span>"),Kn=N("<span> </span>"),qn=N('<div class="diff-view svelte-1g4tvol"><!> <div class="diff-body svelte-1g4tvol"><!></div></div>');function Vn(W,t){at(t,!0);function f(j){if(j==null)return"";if(typeof j!="object")return String(j);const G=j;return String(G.name??G.title??G.label??G.id??JSON.stringify(G))}function i(j){return j==null?"":Array.isArray(j)?j.map(f).join(", "):typeof j=="object"?f(j):String(j)}const u=De(()=>t.refreshResult.body_changed&&t.refreshResult.body_diff?Fn(t.refreshResult.body_diff.old,t.refreshResult.body_diff.new):null);var D=qn(),b=C(D);{var x=j=>{var G=In();Me(G,21,()=>t.refreshResult.diffs,Ke,(ve,q)=>{const ke=De(()=>t.properties.find(c=>c.key===e(q).field));var Ee=Mn(),$=C(Ee),le=C($);{var _e=c=>{pt(c,{size:14})},he=c=>{_t(c,{size:14})},w=c=>{gt(c,{size:14})},h=c=>{Yt(c,{size:14})},a=c=>{ht(c,{size:14})};Se(le,c=>{e(ke)?.type==="date"?c(_e):e(ke)?.type==="status"?c(he,1):e(ke)?.type==="wikilink"?c(w,2):e(ke)?.type==="badge"?c(h,3):c(a,!1)})}m($);var n=Y($,2),o=C(n,!0);m(n);var _=Y(n,2),k=C(_),U=C(k),ge=C(U,!0);m(U),m(k);var Ce=Y(k,2),g=C(Ce),l=C(g,!0);m(g),m(Ce),m(_),m(Ee),ye((c,R)=>{me(o,e(q).field),me(ge,c),me(l,R)},[()=>i(e(q).old_value),()=>i(e(q).new_value)]),y(ve,Ee)}),m(G),y(j,G)};Se(b,j=>{t.refreshResult.diffs.length>0&&j(x)})}var J=Y(b,2),d=C(J);{var Q=j=>{var G=Le(),ve=we(G);Me(ve,17,()=>e(u),Ke,(q,ke)=>{var Ee=Le(),$=we(Ee);{var le=w=>{var h=jn(),a=C(h,!0);m(h),ye(()=>me(a,e(ke).value)),y(w,h)},_e=w=>{var h=Nn(),a=C(h,!0);m(h),ye(()=>me(a,e(ke).value)),y(w,h)},he=w=>{var h=Un(),a=C(h,!0);m(h),ye(()=>me(a,e(ke).value)),y(w,h)};Se($,w=>{e(ke).added?w(le):e(ke).removed?w(_e,1):w(he,!1)})}y(q,Ee)}),y(j,G)},H=j=>{var G=Kn(),ve=C(G,!0);m(G),ye(()=>me(ve,t.bodyContent)),y(j,G)};Se(d,j=>{e(u)?j(Q):j(H,!1)})}m(J),m(D),y(W,D),nt()}var Wn=N("<!> ",1),Hn=N('<span class="diff-action-title svelte-1dc9loe">Changes from source</span> <div class="diff-action-buttons svelte-1dc9loe"><!> <!></div>',1),Bn=N('<span class="bc-sep svelte-1dc9loe">/</span>'),Yn=N("<!><span> </span>",1),Jn=N('<span class="status-text saving svelte-1dc9loe">Saving...</span>'),Qn=N('<span class="status-text error svelte-1dc9loe"> </span>'),Gn=N("<!> ",1),Zn=N('<div class="breadcrumb-path svelte-1dc9loe"></div> <div class="editor-actions svelte-1dc9loe"><!> <!> <!></div>',1),Xn=N('<div class="refresh-panel svelte-1dc9loe"><div class="refresh-uptodate svelte-1dc9loe">Entity is up to date with source.</div></div>'),$n=N('<div class="document-scroll svelte-1dc9loe"><!> <!></div>'),er=N('<div class="content-row svelte-1dc9loe"><div class="entity-area svelte-1dc9loe"><!> <div><!></div> <!> <!></div> <!></div>'),tr=N("<!> <!>",1),ar=N("<!> <!>",1),nr=N("<!> <!>",1);function yr(W,t){at(t,!0);const f=Wt("chat"),i=De(()=>t.data.type==="dataset"||t.data.entity.document?.frontmatter?.entity_type==="dataset"),u=De(()=>yt.getAppForEntityType(t.data.entity.document?.frontmatter?.entity_type??t.data.type)),D=De(()=>()=>{const v=t.data.entity.path;if(v){const p=v.lastIndexOf(`/${t.data.repo}/`);if(p>=0)return v.substring(p+1).split("/")}return[t.data.repo,t.data.id,"main.md"]});let b=Ae(""),x=Ae(Qe({})),J=Ae(0);const d=De(()=>Dn(e(x))),Q=De(()=>!!t.data.entity.data?.source_ref);let H=Ae(!1),j=Ae(null),G=Ae(null);async function ve(){if(!e(H)){E(H,!0),E(j,null),E(G,null);try{const{result:v}=await Aa(t.data.repo,t.data.type,t.data.id);E(j,v,!0)}catch(v){E(G,v.message||"Refresh failed",!0)}finally{E(H,!1)}}}let q=Ae(!1);async function ke(){if(!e(q)){E(q,!0);try{await Pa(t.data.repo,t.data.type,t.data.id),E(j,null),await da()}catch(v){E(G,v.message||"Apply changes failed",!0)}finally{E(q,!1)}}}let Ee=null,$=Ae(""),le=!1,_e=Ae(Qe([]));function he(v){w(),qe(async()=>{const{createCollabSession:p}=await import("../chunks/CnKc_Tae.js");return{createCollabSession:p}},__vite__mapDeps([8,9,10,11,12,13,14,15]),import.meta.url).then(({createCollabSession:p})=>{const L=getComputedStyle(document.documentElement).getPropertyValue("--color-accent").trim()||"#6e6ee8",r=p(v,{name:Lt.user?.displayName??"Anonymous",color:L,colorLight:L+"33"});r.ytext.observe(()=>{const O=r.ytext.toString();O!==e(b)&&(le=!0,E(b,O,!0),requestAnimationFrame(()=>{le=!1}))});const s=r.ydoc.clientID;function T(){const O=[];r.awareness.getStates().forEach((B,P)=>{if(P===s)return;const A=B.cell;if(A==null||A.row==null||A.col==null)return;const{name:ee="Anonymous",color:S="#6e6ee8"}=B.user||{};O.push({row:A.row,col:A.col,name:ee,color:S})}),E(_e,O,!0)}r.awareness.on("change",T),Ee=r,E($,v,!0)})}function w(){Ee&&(Ee.destroy(),Ee=null,E($,""),E(_e,[],!0))}Ht(()=>w());let h=Ae(""),a=Ae(0);Ge(()=>{const v=`${t.data.repo}/${t.data.type}/${t.data.id}`,p=Ra.mutationCount;if(v!==e(h)||p!==e(a)){e(h)&&v!==e(h)&&je.flush(),E(h,v),E(a,p,!0),E(b,t.data.entity.document?.content??"",!0),E(x,{...t.data.entity.document?.frontmatter??t.data.entity.data??{}},!0),ot(J),je.reset();const L=`${t.data.repo}/${t.data.type}/${t.data.id}`;e(i)&&L!==e($)?he(L):e(i)||w()}}),Ge(()=>{const v=t.data.repo,p=t.data.type,L=t.data.id;qt(()=>{Pt.select(v,p,L),Pt.showEntity()})});function n(v){if(!le){if(E(b,v,!0),Ee){const p=Ee.ytext,L=p.toString();v!==L&&Ee.ydoc.transact(()=>{p.delete(0,p.length),p.insert(0,v)})}je.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{content:v})}}function o(v,p){E(x,{...e(x),[v]:p},!0),je.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(x)})}function _(v){const{[v]:p,...L}=e(x);E(x,L,!0),je.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(x)})}function k(v,p){E(x,{...e(x),[v]:p},!0),je.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(x)})}function U(v,p){je.scheduleAutoSave(t.data.repo,t.data.type,t.data.id,{data:e(x)})}function ge(v){for(const p of yt.repos){const L=p.entities.find(r=>r.id===v);if(L){Rt(`/${p.name}/${L.entityType}/${L.id}`);return}}ua.showToast(`"${v}" is in a collection you don't have access to`)}Ge(()=>(Mt.enter(t.data.repo,t.data.type,t.data.id),()=>Mt.leave()));const Ce=De(()=>e(j)!==null&&(e(j).diffs.length>0||e(j).body_changed));function g(v){(v.metaKey||v.ctrlKey)&&v.key==="s"&&(v.preventDefault(),je.flush()),v.key==="Escape"&&!(v.target instanceof HTMLInputElement||v.target instanceof HTMLTextAreaElement)&&(je.flush(),Pt.deselect(),Rt("/"))}var l=nr();Je("keydown",Vt,g);var c=we(l);ya(c,{children:(v,p)=>{var L=er(),r=C(L),s=C(r);Da(s,{activeView:"entity"});var T=Y(s,2);let O;var B=C(T);{var P=ce=>{var I=Hn(),ie=Y(we(I),2),Pe=C(ie);Ie(Pe,{variant:"outline",size:"default",onclick:()=>E(j,null),get disabled(){return e(q)},children:(F,M)=>{Ve();var K=Ye("Dismiss");y(F,K)},$$slots:{default:!0}});var z=Y(Pe,2);Ie(z,{variant:"accent",size:"default",onclick:ke,get disabled(){return e(q)},children:(F,M)=>{var K=Wn(),oe=we(K);{var ue=Z=>{Ut(Z,{class:"size-3 animate-spin",style:"display:inline;vertical-align:middle;margin-right:4px"})};Se(oe,Z=>{e(q)&&Z(ue)})}var be=Y(oe,1,!0);ye(()=>me(be,e(q)?"Applying...":"Apply changes")),y(F,K)},$$slots:{default:!0}}),m(ie),y(ce,I)},A=ce=>{var I=Zn(),ie=we(I);Me(ie,21,()=>e(D)(),Ke,(Z,te,Re)=>{var X=Yn(),V=we(X);{var ne=Te=>{var Oe=Bn();y(Te,Oe)};Se(V,Te=>{Re>0&&Te(ne)})}var pe=Y(V),xe=C(pe,!0);m(pe),ye(Te=>{tt(pe,1,Te,"svelte-1dc9loe"),me(xe,e(te))},[()=>ia(Re===e(D)().length-1?"bc-current":"bc-segment")]),y(Z,X)}),m(ie);var Pe=Y(ie,2),z=C(Pe);{var F=Z=>{var te=Jn();y(Z,te)},M=Z=>{var te=Qn(),Re=C(te,!0);m(te),ye(()=>me(Re,je.error)),y(Z,te)};Se(z,Z=>{je.saving?Z(F):je.error&&Z(M,1)})}var K=Y(z,2);{var oe=Z=>{Ie(Z,{variant:"outline",size:"sm",class:"refresh-btn",onclick:ve,get disabled(){return e(H)},children:(te,Re)=>{var X=Gn(),V=we(X);{var ne=xe=>{Ut(xe,{class:"size-3 animate-spin",style:"display:inline;vertical-align:middle;margin-right:4px"})};Se(V,xe=>{e(H)&&xe(ne)})}var pe=Y(V,1,!0);ye(()=>me(pe,e(H)?"Refreshing...":"Refresh from source")),y(te,X)},$$slots:{default:!0}})};Se(K,Z=>{e(Q)&&Lt.user?.role==="admin"&&Z(oe)})}var ue=Y(K,2);{var be=Z=>{Ie(Z,{variant:"link",size:"sm",class:"open-app",get href(){return`/${t.data.repo??""}/${t.data.type??""}/${t.data.id??""}/edit`},children:(te,Re)=>{Ve();var X=Ye();ye(()=>me(X,`Open in ${e(u).name??""} →`)),y(te,X)},$$slots:{default:!0}})};Se(ue,Z=>{e(u)&&Z(be)})}m(Pe),y(ce,I)};Se(B,ce=>{e(Ce)?ce(P):ce(A,!1)})}m(T);var ee=Y(T,2);{var S=ce=>{var I=Xn();y(ce,I)};Se(ee,ce=>{e(j)&&!e(Ce)&&ce(S)})}var se=Y(ee,2);{var fe=ce=>{Vn(ce,{get properties(){return e(d)},get refreshResult(){return e(j)},get bodyContent(){return e(b)}})},re=ce=>{var I=$n(),ie=C(I);un(ie,{get properties(){return e(d)},editable:!0,onedit:o,onremove:_,onadd:k,ontypechange:U});var Pe=Y(ie,2);{var z=M=>{Cn(M,{get content(){return e(b)},onchange:n,onsave:()=>je.flush(),oncellselect:(K,oe)=>{Ee?.awareness.setLocalStateField("cell",{row:K,col:oe})},get remoteCursors(){return e(_e)}})},F=M=>{{let K=De(()=>`${t.data.repo}/${t.data.type}/${t.data.id}`);hn(M,{get content(){return e(b)},readonly:!1,onchange:n,onsave:()=>je.flush(),onwikilinkclick:ge,get resetKey(){return e(J)},get cursorDocName(){return e(K)}})}};Se(Pe,M=>{e(i)?M(z):M(F,!1)})}m(I),y(ce,I)};Se(se,ce=>{e(Ce)?ce(fe):ce(re,!1)})}m(r);var de=Y(r,2);{var ae=ce=>{Ta(ce,{})};Se(de,ce=>{f.open&&ce(ae)})}m(L),ye(()=>O=tt(T,1,"editor-bar svelte-1dc9loe",null,O,{"editor-bar-diff":e(Ce)})),y(v,L)},$$slots:{default:!0}});var R=Y(c,2);{let v=De(()=>!!e(G));Ne(R,()=>Sa,(p,L)=>{L(p,{get open(){return e(v)},onOpenChange:r=>{r||E(G,null)},children:(r,s)=>{var T=Le(),O=we(T);Ne(O,()=>wa,(B,P)=>{P(B,{children:(A,ee)=>{var S=ar(),se=we(S);Ne(se,()=>ka,(re,de)=>{de(re,{children:(ae,ce)=>{var I=tr(),ie=we(I);Ne(ie,()=>ba,(z,F)=>{F(z,{children:(M,K)=>{Ve();var oe=Ye("Refresh failed");y(M,oe)},$$slots:{default:!0}})});var Pe=Y(ie,2);Ne(Pe,()=>xa,(z,F)=>{F(z,{children:(M,K)=>{Ve();var oe=Ye();ye(()=>me(oe,e(G))),y(M,oe)},$$slots:{default:!0}})}),y(ae,I)},$$slots:{default:!0}})});var fe=Y(se,2);Ne(fe,()=>Ea,(re,de)=>{de(re,{children:(ae,ce)=>{var I=Le(),ie=we(I);Ne(ie,()=>Ca,(Pe,z)=>{z(Pe,{children:(F,M)=>{Ve();var K=Ye("OK");y(F,K)},$$slots:{default:!0}})}),y(ae,I)},$$slots:{default:!0}})}),y(A,S)},$$slots:{default:!0}})}),y(r,T)},$$slots:{default:!0}})})}y(W,l),nt()}export{yr as component,mr as universal};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as dt,s as J,w as ut}from"../chunks/EDLlAC9C.js";import{a as k,s as Z,f as M,c as ft}from"../chunks/0x0awhVy.js";import{q as $,a as tt,R as mt,w as H,x as T,g as h,z as F,A as I,v as et,F as Q,D as S,f as vt,T as ht}from"../chunks/8FUQuwgM.js";import{b as X,i as O}from"../chunks/CbJfRYJV.js";import{A as yt}from"../chunks/
|
|
1
|
+
import{f as dt,s as J,w as ut}from"../chunks/EDLlAC9C.js";import{a as k,s as Z,f as M,c as ft}from"../chunks/0x0awhVy.js";import{q as $,a as tt,R as mt,w as H,x as T,g as h,z as F,A as I,v as et,F as Q,D as S,f as vt,T as ht}from"../chunks/8FUQuwgM.js";import{b as X,i as O}from"../chunks/CbJfRYJV.js";import{A as yt}from"../chunks/Scb_NG-a.js";import{g as pt}from"../chunks/CIZkRAuY.js";import{n as Y}from"../chunks/glgUBDR2.js";const bt=async({params:g})=>{const{repo:o,type:l,id:c}=g,f=await dt(o,l,c);return{repo:o,type:l,id:c,entity:f}},Ht=Object.freeze(Object.defineProperty({__proto__:null,load:bt},Symbol.toStringTag,{value:"Module"}));var gt=M('<div class="loading-indicator svelte-1fltv0h">Loading editor...</div>'),wt=M('<div class="error-indicator svelte-1fltv0h"> </div>'),_t=M('<div><div class="header-mount svelte-1fltv0h"></div> <!> <!> <div></div></div>');function At(g,o){$(o,!0);let l,c,f=Q(!0),m=Q(null),p=[],b=[],w=[],d={},y=[],v=null,_=null,A=0;function j(){const e=window.StudioChrome,i=document.querySelector(".sg-chrome-overflow-menu");if(i&&(i.innerHTML=""),e&&(e.clearViewAction(),e.clearSaveHandlers()),_&&(_.el.removeEventListener("click",_.handler,!0),_=null),e){e.unmountHeader();for(const{event:r,fn:s}of w)e.off(r,s)}w=[];for(const r of p)r.remove();p=[];for(const r of b)r.remove();b=[],v&&(v.remove(),v=null);for(const[r,s]of Object.entries(d))s===void 0?document.body.removeAttribute(r):document.body.setAttribute(r,s);d={};for(const r of y)document.body.classList.remove(r);y=[],c&&(c.innerHTML="")}async function q(){const e=++A;S(f,!0),S(m,null),j();try{const i=`${o.appMountPath}/edit/${encodeURIComponent(o.repo)}/${encodeURIComponent(o.entityId)}`,r=await fetch(i);if(!r.ok)throw new Error(`Failed to load editor: ${r.status}`);if(e!==A)return;const s=await r.text(),P=new DOMParser().parseFromString(s,"text/html"),at=P.querySelectorAll('link[rel="stylesheet"]');for(const t of at){if(t.href.includes("chrome.css"))continue;let n=t.getAttribute("href")||"";n&&!n.startsWith("http")&&!n.startsWith("/")&&(n=`${o.appMountPath}/${n}`);const a=document.createElement("link");a.rel="stylesheet",a.href=n,document.head.appendChild(a),p.push(a)}const it=P.querySelectorAll("head style");for(const t of it){const n=document.createElement("style");n.textContent=t.textContent,document.head.appendChild(n),p.push(n)}v=document.createElement("style"),v.textContent=`
|
|
2
2
|
body.sg-chrome-active { height: auto !important; }
|
|
3
3
|
body.sg-chrome-active > :not(.sg-chrome-header):not(.sg-chrome-footer) { overflow: visible !important; }
|
|
4
4
|
`,document.head.appendChild(v);const L=P.body;for(const t of Array.from(L.attributes))t.name.startsWith("data-")&&(d[t.name]=document.body.getAttribute(t.name)??void 0,document.body.setAttribute(t.name,t.value));const st=Array.from(L.classList);for(const t of st)t!=="sg-chrome-active"&&(document.body.classList.contains(t)||(document.body.classList.add(t),y.push(t)));const ct=L.querySelectorAll("script"),R=[],K=[];for(const t of ct){if(t.src){const n=t.getAttribute("src")||"";if(n.includes("chrome.js"))continue;let a=n;a&&!a.startsWith("http")&&!a.startsWith("/")&&(a=`${o.appMountPath}/${a}`),R.push(a)}else t.textContent&&K.push(t.textContent);t.remove()}c.innerHTML=L.innerHTML;const u=window.StudioChrome;if(u){u.updateBreadcrumb(o.repo,o.entityId),u.mountHeader(l);const t=document.body.dataset.sgViewUrl,n=document.body.dataset.sgViewLabel;t?u.setViewAction(t,n):u.clearViewAction();const a=l.querySelector(".sg-chrome-back");if(a){const N=G=>{G.preventDefault(),G.stopPropagation(),pt(`/${o.repo}/${o.entityType}/${o.entityId}`)};a.addEventListener("click",N,!0),_={el:a,handler:N}}}let E=null;u&&(E=u.on,u.on=function(t,n){w.push({event:t,fn:n}),E.call(this,t,n)});const lt=`?_v=${Date.now()}`;for(const t of R){if(e!==A)return;await ot(t+lt)}for(const t of K){if(e!==A)return;const n=document.createElement("script");n.textContent=t,document.body.appendChild(n),b.push(n)}u&&E&&(u.on=E),S(f,!1)}catch(i){if(e!==A)return;S(m,i.message||"Failed to load editor",!0),S(f,!1)}}function ot(e){return new Promise((i,r)=>{const s=document.createElement("script");s.src=e,s.onload=()=>i(),s.onerror=()=>r(new Error(`Failed to load script: ${e}`)),document.body.appendChild(s),b.push(s)})}let x="";tt(()=>{const e=`${o.appMountPath}|${o.repo}|${o.entityId}`;x&&x!==e&&c&&q(),x=e}),mt(()=>(q(),j));var C=_t();let B;var V=H(C);X(V,e=>l=e,()=>l);var W=T(V,2);{var nt=e=>{var i=gt();k(e,i)};O(W,e=>{h(f)&&e(nt)})}var D=T(W,2);{var rt=e=>{var i=wt(),r=H(i,!0);F(i),I(()=>Z(r,h(m))),k(e,i)};O(D,e=>{h(m)&&e(rt)})}var U=T(D,2);let z;X(U,e=>c=e,()=>c),F(C),I(()=>{B=J(C,1,"editor-frame svelte-1fltv0h",null,B,{loading:h(f)}),z=J(U,1,"editor-container svelte-1fltv0h",null,z,{hidden:h(f)||!!h(m)})}),k(g,C),et()}var St=M('<div class="no-editor svelte-bzivfp"> </div>');function Ft(g,o){$(o,!0);const l=ht(()=>ut.getAppForEntityType(o.data.type));tt(()=>{Y.select(o.data.repo,o.data.type,o.data.id),Y.showEntity()}),yt(g,{showSidebar:!1,children:(c,f)=>{var m=ft(),p=vt(m);{var b=d=>{At(d,{get appMountPath(){return h(l).mountPath},get repo(){return o.data.repo},get entityId(){return o.data.id},get entityType(){return o.data.type}})},w=d=>{var y=St(),v=H(y);F(y),I(()=>Z(v,`No app editor available for entity type "${o.data.type??""}"`)),k(d,y)};O(p,d=>{h(l)?d(b):d(w,!1)})}k(c,m)},$$slots:{default:!0}}),et()}export{Ft as component,Ht as universal};
|