studiograph 1.3.48-next.202 → 1.3.48-next.203

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.
Files changed (61) hide show
  1. package/dist/web/_app/immutable/chunks/{CgvMx17P.js → 07hFP05m.js} +1 -1
  2. package/dist/web/_app/immutable/chunks/{DqVNW14M.js → 7kR889TK.js} +1 -1
  3. package/dist/web/_app/immutable/chunks/{CJHSUZEP2.js → B1IoRIM32.js} +1 -1
  4. package/dist/web/_app/immutable/chunks/{CHfsxCjb2.js → B6IRsNLP2.js} +1 -1
  5. package/dist/web/_app/immutable/chunks/{CqknRY6y.js → BBaGD9in.js} +1 -1
  6. package/dist/web/_app/immutable/chunks/{CtZC4Amr.js → BG6Chr_U.js} +2 -2
  7. package/dist/web/_app/immutable/chunks/{hYB57KiL2.js → BWwVcHCc2.js} +1 -1
  8. package/dist/web/_app/immutable/chunks/{6q9jIkn62.js → BZS902Cj2.js} +1 -1
  9. package/dist/web/_app/immutable/chunks/{B4SxOSjX.js → BbHS-AH8.js} +1 -1
  10. package/dist/web/_app/immutable/chunks/{D8to-Tl2.js → Bnz3DFc4.js} +1 -1
  11. package/dist/web/_app/immutable/chunks/{D4JUyFbF2.js → Br4L22CY2.js} +1 -1
  12. package/dist/web/_app/immutable/chunks/{DHeBt92d.js → BtFFBkw5.js} +1 -1
  13. package/dist/web/_app/immutable/chunks/{BI1QnJpF.js → BxBYpA6r.js} +1 -1
  14. package/dist/web/_app/immutable/chunks/{wOzHAjF8.js → C4WtBaTc.js} +1 -1
  15. package/dist/web/_app/immutable/chunks/{D3Q44JkU.js → C6GeXy2x.js} +3 -3
  16. package/dist/web/_app/immutable/chunks/{CIFJHuW3.js → C7itDC3h.js} +1 -1
  17. package/dist/web/_app/immutable/chunks/{CixKNc3T.js → C8k8ISFi.js} +1 -1
  18. package/dist/web/_app/immutable/chunks/{RGeaCF67.js → CDzfaWKf.js} +1 -1
  19. package/dist/web/_app/immutable/chunks/{D3XZgoPH2.js → CEMPLE8z2.js} +1 -1
  20. package/dist/web/_app/immutable/chunks/{B5VgJxxg.js → CFAVEaSi.js} +1 -1
  21. package/dist/web/_app/immutable/chunks/{Ds2T2cSU.js → CPggL5T4.js} +1 -1
  22. package/dist/web/_app/immutable/chunks/{Dw79l2Rr2.js → CRCPLmOY2.js} +2 -2
  23. package/dist/web/_app/immutable/chunks/{C_dAGBQw.js → CgJ4D3KO.js} +1 -1
  24. package/dist/web/_app/immutable/chunks/{BcNrWv7U.js → CiWqBHuz.js} +1 -1
  25. package/dist/web/_app/immutable/chunks/{WDk1uhnU.js → CpDJX46P.js} +1 -1
  26. package/dist/web/_app/immutable/chunks/{Br6B3af2.js → D13ecV4K.js} +1 -1
  27. package/dist/web/_app/immutable/chunks/{DyBfr58b.js → D3DcX68i.js} +1 -1
  28. package/dist/web/_app/immutable/chunks/{Ci1-gIe3.js → D3zp3KAR.js} +1 -1
  29. package/dist/web/_app/immutable/chunks/{Vs6ipi8V.js → D5KrgeSF.js} +1 -1
  30. package/dist/web/_app/immutable/chunks/{aTepn3vZ.js → D7wNieYW.js} +1 -1
  31. package/dist/web/_app/immutable/chunks/{CkTGtSa0.js → DCoce3cj.js} +1 -1
  32. package/dist/web/_app/immutable/chunks/{ClQpLoo2.js → DLGQ2Ng8.js} +1 -1
  33. package/dist/web/_app/immutable/chunks/{CS1yIpfI.js → DUvuFP83.js} +1 -1
  34. package/dist/web/_app/immutable/chunks/{C9UGSV2P.js → DqcFOWKS.js} +1 -1
  35. package/dist/web/_app/immutable/chunks/{CTwRLVH0.js → DwTthEC8.js} +1 -1
  36. package/dist/web/_app/immutable/chunks/{BcDgRHTK.js → gZQwV3Fq.js} +1 -1
  37. package/dist/web/_app/immutable/chunks/{DSSa3YBM.js → h2w5CgVx.js} +1 -1
  38. package/dist/web/_app/immutable/chunks/{yPcgWH4v2.js → vrKdRCXg2.js} +1 -1
  39. package/dist/web/_app/immutable/chunks/{CHaOoYfr.js → zPZU7CyH.js} +1 -1
  40. package/dist/web/_app/immutable/entry/{app.BNEFqo8b.js → app.BNZl4D36.js} +2 -2
  41. package/dist/web/_app/immutable/entry/start.CAlodW4e.js +1 -0
  42. package/dist/web/_app/immutable/nodes/{0.uzjYOn1T.js → 0.BxFbx_8C.js} +2 -2
  43. package/dist/web/_app/immutable/nodes/{1.Dcx0el9c.js → 1.Xu6kgS6R.js} +1 -1
  44. package/dist/web/_app/immutable/nodes/{10.BZqF2JiY.js → 10.CWtsHXL9.js} +1 -1
  45. package/dist/web/_app/immutable/nodes/{11.DOLrGElY.js → 11.59Xqxt-e.js} +1 -1
  46. package/dist/web/_app/immutable/nodes/{12.B5driBF_.js → 12.nmJIN6dO.js} +1 -1
  47. package/dist/web/_app/immutable/nodes/{14.BW_B8dbj.js → 14.iyoM-j_N.js} +1 -1
  48. package/dist/web/_app/immutable/nodes/{16.DpbWIMnu.js → 16.Du3Jaki5.js} +1 -1
  49. package/dist/web/_app/immutable/nodes/{17.BZfzYKWc.js → 17.Cj3_3kVA.js} +1 -1
  50. package/dist/web/_app/immutable/nodes/{2.CIhxoTKO.js → 2.bK1i_q6O.js} +4 -4
  51. package/dist/web/_app/immutable/nodes/{3.CmwJJMca.js → 3.HFzIGkqN.js} +1 -1
  52. package/dist/web/_app/immutable/nodes/{4.DoQhCj0w.js → 4.Dvmvb_9f.js} +3 -3
  53. package/dist/web/_app/immutable/nodes/{5.DOchopGh.js → 5.CGzLbhws.js} +1 -1
  54. package/dist/web/_app/immutable/nodes/{6.DicwNGWk.js → 6.Cn_Rpl3W.js} +1 -1
  55. package/dist/web/_app/immutable/nodes/{7.pLHde-dl.js → 7.Dn3Hdi6w.js} +1 -1
  56. package/dist/web/_app/immutable/nodes/{8.BuoYVCqz.js → 8.TdDQyhCJ.js} +1 -1
  57. package/dist/web/_app/immutable/nodes/{9.QbcUK_hO.js → 9.BLpLNKL5.js} +1 -1
  58. package/dist/web/_app/version.json +1 -1
  59. package/dist/web/index.html +13 -13
  60. package/package.json +1 -1
  61. package/dist/web/_app/immutable/entry/start.CAN66388.js +0 -1
@@ -1 +1 @@
1
- import{E as e,I as t,L as n,Mt as r,Nt as i,R as a,St as o,V as s,Y as c,_t as l,ft as u,ot as d,pt as f,yt as p,zt as m}from"./iPCkjliu.js";import"./xihTtKlq.js";import{t as h}from"./DyBfr58b.js";import{t as g}from"./9cXiqQci.js";import{t as _}from"./BGmf4b7n2.js";import{a as v,c as y,d as b,i as x,l as S,o as C,u as w}from"./Bskykexb2.js";import{t as T}from"./CIFJHuW3.js";var E=a(`<!> <!>`,1),D=a(`<!> <!>`,1),O=a(`<!> <!> <!>`,1);function k(a,k){i(k,!0);let A=o(()=>T.id!==null),j=p(``),M=p(null);d(()=>{T.id!==null&&l(j,T.title,!0)}),d(()=>{T.id!==null&&c(M)&&requestAnimationFrame(()=>{c(M)?.focus(),c(M)?.select()})});function N(){T.close()}function P(){let e=T.id;!e||!c(j).trim()||(h.renameSession(e,c(j)),N())}var F=n();e(u(F),()=>b,(r,i)=>{i(r,{get open(){return c(A)},onOpenChange:e=>{e||N()},children:(r,i)=>{var a=n();e(u(a),()=>w,(r,i)=>{i(r,{size:`sm`,children:(r,i)=>{var a=O(),d=u(a);e(d,()=>S,(r,i)=>{i(r,{class:`close-only-header`,children:(r,i)=>{var a=n();e(u(a),()=>x,(e,t)=>{t(e,{})}),t(r,a)},$$slots:{default:!0}})});var p=f(d,2);e(p,()=>C,(n,r)=>{r(n,{class:`dialog-body-lg`,children:(n,r)=>{var i=E(),a=u(i);e(a,()=>y,(e,n)=>{n(e,{children:(e,n)=>{m(),t(e,s(`Rename Chat`))},$$slots:{default:!0}})}),_(f(a,2),{type:`text`,placeholder:`Chat name`,onkeydown:e=>{e.key===`Enter`&&(e.preventDefault(),P())},get ref(){return c(M)},set ref(e){l(M,e,!0)},get value(){return c(j)},set value(e){l(j,e,!0)}}),t(n,i)},$$slots:{default:!0}})}),e(f(p,2),()=>v,(e,n)=>{n(e,{children:(e,n)=>{var r=D(),i=u(r);g(i,{variant:`ghost`,onclick:N,children:(e,n)=>{m(),t(e,s(`Cancel`))},$$slots:{default:!0}});var a=f(i,2);{let e=o(()=>!c(j).trim());g(a,{variant:`accent`,get disabled(){return c(e)},onclick:P,children:(e,n)=>{m(),t(e,s(`Rename`))},$$slots:{default:!0}})}t(e,r)},$$slots:{default:!0}})}),t(r,a)},$$slots:{default:!0}})}),t(r,a)},$$slots:{default:!0}})}),t(a,F),r()}export{k as default};
1
+ import{E as e,I as t,L as n,Mt as r,Nt as i,R as a,St as o,V as s,Y as c,_t as l,ft as u,ot as d,pt as f,yt as p,zt as m}from"./iPCkjliu.js";import"./xihTtKlq.js";import{t as h}from"./D3DcX68i.js";import{t as g}from"./9cXiqQci.js";import{t as _}from"./BGmf4b7n2.js";import{a as v,c as y,d as b,i as x,l as S,o as C,u as w}from"./Bskykexb2.js";import{t as T}from"./C7itDC3h.js";var E=a(`<!> <!>`,1),D=a(`<!> <!>`,1),O=a(`<!> <!> <!>`,1);function k(a,k){i(k,!0);let A=o(()=>T.id!==null),j=p(``),M=p(null);d(()=>{T.id!==null&&l(j,T.title,!0)}),d(()=>{T.id!==null&&c(M)&&requestAnimationFrame(()=>{c(M)?.focus(),c(M)?.select()})});function N(){T.close()}function P(){let e=T.id;!e||!c(j).trim()||(h.renameSession(e,c(j)),N())}var F=n();e(u(F),()=>b,(r,i)=>{i(r,{get open(){return c(A)},onOpenChange:e=>{e||N()},children:(r,i)=>{var a=n();e(u(a),()=>w,(r,i)=>{i(r,{size:`sm`,children:(r,i)=>{var a=O(),d=u(a);e(d,()=>S,(r,i)=>{i(r,{class:`close-only-header`,children:(r,i)=>{var a=n();e(u(a),()=>x,(e,t)=>{t(e,{})}),t(r,a)},$$slots:{default:!0}})});var p=f(d,2);e(p,()=>C,(n,r)=>{r(n,{class:`dialog-body-lg`,children:(n,r)=>{var i=E(),a=u(i);e(a,()=>y,(e,n)=>{n(e,{children:(e,n)=>{m(),t(e,s(`Rename Chat`))},$$slots:{default:!0}})}),_(f(a,2),{type:`text`,placeholder:`Chat name`,onkeydown:e=>{e.key===`Enter`&&(e.preventDefault(),P())},get ref(){return c(M)},set ref(e){l(M,e,!0)},get value(){return c(j)},set value(e){l(j,e,!0)}}),t(n,i)},$$slots:{default:!0}})}),e(f(p,2),()=>v,(e,n)=>{n(e,{children:(e,n)=>{var r=D(),i=u(r);g(i,{variant:`ghost`,onclick:N,children:(e,n)=>{m(),t(e,s(`Cancel`))},$$slots:{default:!0}});var a=f(i,2);{let e=o(()=>!c(j).trim());g(a,{variant:`accent`,get disabled(){return c(e)},onclick:P,children:(e,n)=>{m(),t(e,s(`Rename`))},$$slots:{default:!0}})}t(e,r)},$$slots:{default:!0}})}),t(r,a)},$$slots:{default:!0}})}),t(r,a)},$$slots:{default:!0}})}),t(a,F),r()}export{k as default};
@@ -1 +1 @@
1
- import{Gt as e}from"./iPCkjliu.js";import{a as t,o as n,r}from"./CHfsxCjb2.js";import{n as i}from"./C8Ar3dLv.js";import{l as a,m as o,p as s}from"./Wowi_89k.js";import{a as c,l,o as u,r as d,t as f}from"./D3JoMtWC.js";import{T as p}from"./BBGt-XQo.js";var m=`http://www.w3.org/2000/svg`;function h(e,t){let n=document.createElementNS(m,`svg`);n.setAttribute(`viewBox`,`0 0 32 32`),n.setAttribute(`width`,String(e)),n.setAttribute(`height`,String(e)),n.setAttribute(`fill`,`currentColor`),n.setAttribute(`aria-hidden`,`true`);let r=document.createElementNS(m,`path`);return r.setAttribute(`d`,t),n.appendChild(r),n}var g=`M25.7,9.3l-7-7C18.5,2.1,18.3,2,18,2H8C6.9,2,6,2.9,6,4v24c0,1.1,0.9,2,2,2h16c1.1,0,2-0.9,2-2V10C26,9.7,25.9,9.5,25.7,9.3z M18,4.4l5.6,5.6H18V4.4z M24,28H8V4h8v6c0,1.1,0.9,2,2,2h6V28z`,_=`M26,24v4H6V24H4v4a2,2,0,0,0,2,2H26a2,2,0,0,0,2-2V24Z M26,14l-1.41-1.41L17,20.17V2H15V20.17L7.41,12.59,6,14l10,10,10-10z`;function v(e){return!!e&&e.includes(`/api/assets/`)}function y(e){let t=e.split(/[?#]/)[0].split(`/`).pop()??``,n=t.lastIndexOf(`.`);if(n<=0||n===t.length-1)return``;let r=t.slice(n+1);return r.length<=5&&/^[A-Za-z0-9]+$/.test(r)?r.toUpperCase():``}function b({name:e,url:t,ext:n}){let r=document.createElement(`a`);r.className=`sg-file-chip`,r.href=t,r.target=`_blank`,r.rel=`noopener`,r.title=e;let i=h(18,g);i.classList.add(`sg-file-chip-icon`);let a=document.createElement(`span`);a.className=`sg-file-chip-name`,a.textContent=e||`File`,r.append(i,a),typeof requestAnimationFrame==`function`&&requestAnimationFrame(()=>{a.classList.toggle(`is-truncated`,a.scrollWidth>a.clientWidth)});let o=n??y(t),s=document.createElement(`span`);s.className=`sg-file-chip-download`,s.appendChild(h(14,_));let c=document.createElement(`span`);return c.textContent=o||`Download`,s.appendChild(c),r.appendChild(s),r}var x=e({imageKeymap:()=>G,imageSourceField:()=>w,livePreviewPlugin:()=>U,livePreviewTheme:()=>K,refreshExternalStateEffect:()=>S,toggleImageSourceEffect:()=>C}),S=s.define(),C=s.define(),w=o.define({create:()=>new Set,update(e,t){let n=e;if(t.docChanged){n=new Set;for(let r of e)n.add(t.changes.mapPos(r))}for(let r of t.effects)r.is(C)&&(n===e&&(n=new Set(n)),n.has(r.value)?n.delete(r.value):n.add(r.value));return n}}),T=class extends u{toDOM(){let e=document.createElement(`div`);return e.className=`cm-hr-widget`,e}},E=class extends u{toDOM(){let e=document.createElement(`span`);return e.textContent=`—`,e}};function D(){let e=document.createElement(`span`);e.className=`cm-image-unavailable`;let t=`http://www.w3.org/2000/svg`,n=document.createElementNS(t,`svg`);n.setAttribute(`viewBox`,`0 0 32 32`),n.setAttribute(`width`,`18`),n.setAttribute(`height`,`18`),n.setAttribute(`fill`,`currentColor`),n.setAttribute(`aria-hidden`,`true`);let r=document.createElementNS(t,`path`);r.setAttribute(`d`,`M16,30H8a2,2,0,0,1-2-2V4A2,2,0,0,1,8,2h10a1,1,0,0,1,.71.29l5,5A1,1,0,0,1,24,8v6H22V9H17a1,1,0,0,1-1-1V4H8V28h8Z`);let i=document.createElementNS(t,`path`);i.setAttribute(`d`,`M24.5,29A2.5,2.5,0,1,1,27,26.5,2.5,2.5,0,0,1,24.5,29Zm0-3.5a1,1,0,1,0,1,1A1,1,0,0,0,24.5,25.5Z`);let a=document.createElementNS(t,`path`);a.setAttribute(`d`,`M24.5,23a1,1,0,0,1-1-1V21a2.5,2.5,0,1,0-2.5-2.5,1,1,0,0,1-2,0A4.5,4.5,0,1,1,25,22.79V22A1,1,0,0,1,24.5,23Z`),n.append(r,i,a);let o=document.createElement(`span`);return o.className=`cm-image-unavailable-text`,o.textContent=`Original file is no longer available`,e.append(n,o),e}var O=class extends u{alt;url;from;to;sourceShown;isSelected;view;constructor(e,t,n,r,i,a,o){super(),this.alt=e,this.url=t,this.from=n,this.to=r,this.sourceShown=i,this.isSelected=a,this.view=o}eq(e){return this.alt===e.alt&&this.url===e.url&&this.from===e.from&&this.to===e.to&&this.sourceShown===e.sourceShown&&this.isSelected===e.isSelected}toDOM(){let e=document.createElement(`div`);e.className=`cm-image-widget cm-image-loading`,this.isSelected&&e.classList.add(`cm-image-selected`),e.dataset.from=String(this.from),e.dataset.to=String(this.to);let t=document.createElement(`img`);t.src=this.url,t.alt=this.alt,t.loading=`lazy`,t.decoding=`async`,t.onload=()=>{e.classList.remove(`cm-image-loading`)},t.onerror=()=>{e.className=`cm-image-error`,e.replaceChildren(D())},e.appendChild(t);let n=this.view;t.addEventListener(`mousedown`,t=>{t.preventDefault(),t.stopPropagation();let r=+e.dataset.from,i=+e.dataset.to;n.dispatch({selection:{anchor:r,head:i}}),n.focus()});let r=document.createElement(`button`);return r.type=`button`,r.className=`cm-image-source-btn`,this.sourceShown&&r.classList.add(`cm-image-source-btn-active`),r.title=this.sourceShown?`Hide markdown`:`Show markdown`,r.textContent=`</>`,r.addEventListener(`mousedown`,t=>{t.preventDefault(),t.stopPropagation();let r=+e.dataset.from;n.dispatch({effects:C.of(r)})}),e.appendChild(r),e}updateDOM(e){e.classList.toggle(`cm-image-selected`,this.isSelected),e.dataset.from=String(this.from),e.dataset.to=String(this.to);let t=e.querySelector(`img`);t&&(t.getAttribute(`src`)!==this.url&&(t.src=this.url),t.alt!==this.alt&&(t.alt=this.alt));let n=e.querySelector(`.cm-image-source-btn`);return n&&(n.classList.toggle(`cm-image-source-btn-active`,this.sourceShown),n.title=this.sourceShown?`Hide markdown`:`Show markdown`),!0}ignoreEvent(e){return e.type===`mousedown`}},k=class extends u{checked;from;to;constructor(e,t,n){super(),this.checked=e,this.from=t,this.to=n}eq(e){return this.checked===e.checked&&this.from===e.from&&this.to===e.to}toDOM(){let e=document.createElement(`input`);return e.type=`checkbox`,e.checked=this.checked,e.className=`cm-task-checkbox`,e.addEventListener(`mousedown`,t=>{t.preventDefault(),t.stopPropagation(),e.dispatchEvent(new CustomEvent(`task-toggle`,{bubbles:!0,detail:{from:this.from,to:this.to,checked:!this.checked}}))}),e}ignoreEvent(e){return e.type===`mousedown`||e.type===`click`}},A=class extends u{label;url;constructor(e,t){super(),this.label=e,this.url=t}eq(e){return this.label===e.label&&this.url===e.url}toDOM(){let e=b({name:this.label,url:this.url});return e.addEventListener(`mousedown`,e=>{e.preventDefault(),e.stopPropagation(),window.open(this.url,`_blank`,`noopener`)}),e}ignoreEvent(e){return e.type===`mousedown`}},j=class extends u{text;className;entityId;constructor(e,t,n){super(),this.text=e,this.className=t,this.entityId=n}eq(e){return this.text===e.text&&this.className===e.className&&this.entityId===e.entityId}toDOM(){let e=document.createElement(`span`);return e.className=this.className,e.textContent=this.text,e.dataset.entityId=this.entityId,e.addEventListener(`click`,t=>{t.preventDefault(),t.stopPropagation(),e.dispatchEvent(new CustomEvent(`wikilink-click`,{bubbles:!0,detail:this.entityId}))}),e}ignoreEvent(e){return e.type===`mousedown`}};function M(e){if(!e.hasFocus)return[-1,-1];let t=e.state.selection.main,n=e.state.doc,r=n.lineAt(t.from).number;return r===n.lineAt(t.to).number?[r,r]:[-1,-1]}function N(e,t,n){if(!e.hasFocus)return!1;let r=e.state.selection.main,i=e.state.doc;return i.lineAt(r.from).number===i.lineAt(r.to).number?r.to>=t&&r.from<=n:!1}function P(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling}function F(e,r,i,a){let o=r.state,s=e.from>0?o.doc.sliceString(e.from-1,e.from):``,c=e.to<o.doc.length?o.doc.sliceString(e.to,e.to+1):``;if(s!==`[`||c!==`]`)return!1;let l=e.from-1,u=e.to+1,d=o.doc.sliceString(e.from+1,e.to-1),p=n(d),m=p?`cm-live-wikilink cm-wikilink-active`:`cm-live-wikilink cm-wikilink-inactive`,h=a?`${m} ${a}`:m,g=d.indexOf(`|`),_=g===-1?d:d.slice(0,g).trim();if(N(r,l,u))i.push(f.mark({class:`cm-formatting`}).range(l,l+2)),i.push(f.mark({class:h}).range(l+2,u-2)),i.push(f.mark({class:`cm-formatting`}).range(u-2,u));else{let e=p?p.title:t(d);i.push(f.replace({widget:new j(e,h,_)}).range(l,u))}return!0}function I(e,t,n,r){if(N(t,e.from,e.to))n.push(f.mark({class:r}).range(e.from,e.to));else{let i=!1;P(e,e=>{e.name===`Link`&&(i=F(e,t,n,r))}),i||n.push(f.mark({class:r}).range(e.from,e.to)),P(e,e=>{e.name===`EmphasisMark`&&n.push(f.replace({}).range(e.from,e.to))})}}var L=null,R=``,z=0,B=new Map;function V(e,t){if(!R){let t=getComputedStyle(e.contentDOM);R=`${t.fontStyle} ${t.fontWeight} ${t.fontSize} ${t.fontFamily}`,parseFloat(t.fontSize),z=t.letterSpacing&&t.letterSpacing!==`normal`&&parseFloat(t.letterSpacing)||0,L=document.createElement(`canvas`).getContext(`2d`),L&&(L.font=R)}let n=B.get(t);if(n!==void 0)return n;let r=(L?L.measureText(t).width:t.length*e.defaultCharacterWidth)+z*t.length;return B.set(t,r),r}function H(e){let t=e.state,[n,a]=M(e),o=e=>e>=n&&e<=a,s=t.field(w,!1),c=[],l=[];p(t).iterate({enter(n){let r=t.doc.lineAt(n.from).number;if(n.name.startsWith(`ATXHeading`)){let t=`cm-live-heading cm-live-heading-${parseInt(n.name.replace(`ATXHeading`,``),10)||1}`;return c.push(f.mark({class:t}).range(n.from,n.to)),o(r)||P(n.node,r=>{if(r.name===`HeaderMark`){let e=Math.min(r.to+1,n.to);c.push(f.replace({}).range(r.from,e))}else r.name===`Link`&&F(r,e,c,t)}),!1}if(n.name===`Blockquote`){let e=t.doc.lineAt(n.from).number,r=t.doc.lineAt(n.to).number;for(let n=e;n<=r;n++){let e=t.doc.line(n);c.push(f.line({class:`cm-quote-line`}).range(e.from))}}if(n.name===`QuoteMark`&&!o(r)){let e=t.doc.sliceString(n.to,Math.min(n.to+1,t.doc.length))===` `?n.to+1:n.to;c.push(f.replace({}).range(n.from,e))}if(n.name===`FencedCode`){let e=t.doc.lineAt(n.from).number,r=t.doc.lineAt(n.to).number;for(let n=e;n<=r;n++){let e=t.doc.line(n);c.push(f.line({class:`cm-code-line`}).range(e.from))}}if(n.name===`CodeMark`||n.name===`CodeInfo`){let t=n.node.parent;t?.name===`FencedCode`&&(N(e,t.from,t.to)||c.push(f.replace({}).range(n.from,n.to)))}if(n.name===`HorizontalRule`&&!o(r)){let e=t.doc.lineAt(n.from);c.push(f.replace({widget:new T}).range(n.from,n.to)),c.push(f.line({class:`cm-hr-line`}).range(e.from))}if(n.name===`ListMark`){let r=n.node.parent?.parent?.name===`OrderedList`;c.push(f.mark({class:r?`cm-list-marker cm-list-marker-ordered`:`cm-list-marker cm-list-marker-bullet`}).range(n.from,n.to));let i=t.doc.lineAt(n.from),a=n.to;for(;a<i.to&&t.doc.sliceString(a,a+1)===` `;)a++;let o=V(e,t.doc.sliceString(i.from,a));o>0&&c.push(f.line({class:`cm-hang-indent`,attributes:{style:`--cm-hang:${o.toFixed(2)}px`}}).range(i.from)),n.from>i.from&&l.push(f.replace({}).range(i.from,n.from))}if(n.name===`TaskMarker`){let e=t.doc.sliceString(n.from,n.to),r=e===`[x]`||e===`[X]`;c.push(f.replace({widget:new k(r,n.from,n.to)}).range(n.from,n.to))}if(n.name===`StrongEmphasis`)return I(n.node,e,c,`cm-live-strong`),!1;if(n.name===`Emphasis`)return I(n.node,e,c,`cm-live-em`),!1;if(n.name===`InlineCode`)return c.push(f.mark({class:`cm-live-code`}).range(n.from,n.to)),N(e,n.from,n.to)||P(n.node,e=>{e.name===`CodeMark`&&c.push(f.replace({}).range(e.from,e.to))}),!1;if(n.name===`Link`){let r=t.doc.sliceString(n.from,n.to);if(F(n,e,c))return!1;if(r.includes(`](`)){let a=[],o=-1,s=-1;P(n.node,e=>{e.name===`LinkMark`&&a.push({from:e.from,to:e.to}),e.name===`URL`&&(o=e.from,s=e.to)});let u=o>=0?t.doc.sliceString(o,s):``;if(v(u)&&!N(e,n.from,n.to)){let e=a.length>=2?t.doc.sliceString(a[0].to,a[1].from):r;return c.push(f.replace({widget:new A(e,u)}).range(n.from,n.to)),l.push(f.replace({}).range(n.from,n.to)),!1}return c.push(f.mark({class:`cm-live-link`,attributes:u?{"data-href":i(u)}:{}}).range(n.from,n.to)),N(e,n.from,n.to)||a.length>=2&&o>=0&&(c.push(f.replace({}).range(a[0].from,a[0].to)),c.push(f.replace({}).range(a[1].from,n.to))),!1}}if(n.name===`Image`){let r=t.doc.sliceString(n.from,n.to).match(/!\[([^\]]*)\]/),i=r?r[1]:``,a=``;if(P(n.node,e=>{e.name===`URL`&&(a=t.doc.sliceString(e.from,e.to))}),a){let r=!!s?.has(n.from),o=e.state.selection.main,u=o.from<=n.from&&o.to>=n.to&&o.from<o.to;if(r)c.push(f.mark({class:`cm-image-raw`}).range(n.from,n.to)),c.push(f.widget({widget:new O(i,a,n.from,n.to,!0,u,e),side:1}).range(n.to));else{c.push(f.replace({widget:new O(i,a,n.from,n.to,!1,u,e)}).range(n.from,n.to)),l.push(f.replace({}).range(n.from,n.to));let r=t.doc.lineAt(n.from),o=t.doc.sliceString(r.from,r.to),s=t.doc.sliceString(n.from,n.to);o.trim()===s.trim()&&c.push(f.line({class:`cm-image-line`}).range(r.from))}}return!1}}});let u=t.doc;for(let e=1;e<=u.lines;e++){let t=u.line(e),n=t.text,i=n.trim(),a=/^-{3,}$/.test(i)||/^\*{3,}$/.test(i)||/^_{3,}$/.test(i),o=0;for(;!a&&(o=n.indexOf(`--`,o))!==-1;){let e=n[o+2]??``;if(e!==`-`&&!/[A-Za-z0-9_]/.test(e)){let e=t.from+o;c.push(f.replace({widget:new E}).range(e,e+2))}o+=2}for(let e=0;e<n.length;e++){let i=n[e];if(i!==`"`&&i!==`'`)continue;let a=e>0?n[e-1]:``;if(/[0-9]/.test(a))continue;let o=t.from+e,s=r(a),l=i===`"`?s?`“`:`”`:s?`‘`:`’`;c.push(f.mark({class:`cm-smart-quote`,attributes:{"data-smart-quote":l}}).range(o,o+1))}}return{deco:f.set(c,!0),atomic:f.set(l,!0)}}var U=c.fromClass(class{decorations;atomicRanges;constructor(e){let t=H(e);this.decorations=t.deco,this.atomicRanges=t.atomic}update(e){let t=e.transactions.some(e=>e.effects.some(e=>e.is(S)||e.is(C)));if(e.docChanged||e.selectionSet||e.viewportChanged||e.focusChanged||t){let t=H(e.view);this.decorations=t.deco,this.atomicRanges=t.atomic}}},{decorations:e=>e.decorations,provide:e=>d.atomicRanges.of(t=>t.plugin(e)?.atomicRanges??f.none)});function W(e){let t=e.state.selection.main;if(t.from===t.to)return!1;let n=e.state.doc.lineAt(t.from);if(n.from!==t.from||n.to!==t.to)return!1;let r=e.state.doc.sliceString(t.from,t.to);if(!/^!\[[^\]]*\]\([^)]+\)$/.test(r))return!1;let i=e.state.doc.length,a=t.to<i?t.to+1:t.to;return e.dispatch({changes:{from:t.from,to:a,insert:``},userEvent:`delete.selection`}),!0}var G=a.high(l.of([{key:`Backspace`,run:W},{key:`Delete`,run:W}])),K=d.baseTheme({".cm-smart-quote":{position:`relative`,visibility:`hidden`},".cm-smart-quote::before":{content:`attr(data-smart-quote)`,position:`absolute`,insetInlineStart:`0`,visibility:`visible`},".cm-live-heading":{fontWeight:`600`},".cm-live-heading-1":{fontSize:`1.5em`},".cm-live-heading-2":{fontSize:`1.2em`},".cm-live-heading-3":{fontSize:`1.05em`},".cm-live-strong":{fontWeight:`600`},".cm-live-em":{fontStyle:`italic`},".cm-live-code":{fontFamily:`monospace`,fontSize:`0.9em`,padding:`1px 4px`,borderRadius:`0.1875rem`,backgroundColor:`rgba(128,128,128,0.12)`},".cm-live-wikilink":{borderRadius:`0.1875rem`},".cm-wikilink-active":{color:`var(--color-link)`,cursor:`pointer`,textDecoration:`none`},".cm-wikilink-active:hover":{textDecoration:`underline`},".cm-wikilink-inactive":{color:`var(--color-text-tertiary)`},".cm-live-link":{color:`var(--color-link, #f37373)`,textDecoration:`none`,cursor:`pointer`},".cm-live-link:hover":{textDecoration:`underline`},".cm-list-marker":{color:`var(--color-text-tertiary)`},".cm-list-marker-bullet, .cm-list-marker-bullet *":{color:`transparent !important`},".cm-list-marker-bullet::before":{content:`"•"`,display:`inline-block`,width:`0`,overflow:`visible`,textIndent:`0`,color:`var(--color-text-tertiary)`},".cm-list-marker-ordered, .cm-list-marker-ordered *":{color:`var(--color-text-tertiary) !important`,opacity:`1 !important`},".cm-line.cm-hang-indent":{paddingLeft:`var(--cm-hang, 0px)`,textIndent:`calc(-1 * var(--cm-hang, 0px))`},".cm-hr-widget":{borderTop:`1px solid var(--color-border, #333)`,margin:`0`},".cm-line.cm-hr-line":{lineHeight:`0`,padding:`6px 0`},".cm-task-checkbox":{verticalAlign:`middle`,margin:`0 4px 0 0`,cursor:`pointer`,accentColor:`var(--color-accent)`},".cm-image-widget":{display:`block`,width:`fit-content`,maxWidth:`100%`,lineHeight:`0`,position:`relative`,zIndex:`1`,background:`var(--color-bg)`},".cm-line.cm-image-line":{lineHeight:`0`,fontSize:`0`,margin:`0.75rem 0`},".sg-comment-highlight .cm-image-widget img":{outline:`2px solid var(--color-comment-bg, #f5d264)`,outlineOffset:`2px`,borderRadius:`var(--radius-xs)`},".sg-comment-highlight.sg-comment-resolved .cm-image-widget img":{outline:`2px dashed var(--color-text-tertiary)`},".cm-image-source-btn":{position:`absolute`,top:`8px`,right:`8px`,display:`flex`,alignItems:`center`,justifyContent:`center`,height:`24px`,padding:`0 6px`,font:`600 11px var(--font-mono, ui-monospace, monospace)`,lineHeight:`1`,color:`#fff`,background:`rgba(0,0,0,0.55)`,border:`none`,borderRadius:`var(--radius-xs, 4px)`,cursor:`pointer`,opacity:`0`,transition:`opacity 0.12s ease, background 0.12s ease`},".cm-image-widget:hover .cm-image-source-btn":{opacity:`1`},".cm-image-source-btn:hover":{background:`rgba(0,0,0,0.75)`},".cm-image-source-btn-active":{opacity:`1`,background:`var(--color-accent)`},".cm-image-widget img":{maxWidth:`100%`,borderRadius:`var(--radius-xs)`,transition:`opacity 0.15s ease`,verticalAlign:`top`},".cm-image-selected img":{outline:`2px solid var(--color-accent)`,outlineOffset:`2px`},".cm-image-loading":{width:`100%`,minHeight:`120px`,background:`var(--color-surface-subtle, rgba(0,0,0,0.04))`,borderRadius:`var(--radius-xs)`,position:`relative`},".cm-image-loading img":{opacity:`0`},".cm-image-loading::after":{content:`""`,position:`absolute`,top:`50%`,left:`50%`,width:`24px`,height:`24px`,marginTop:`-12px`,marginLeft:`-12px`,border:`2px solid rgba(0,0,0,0.08)`,borderTopColor:`var(--color-accent, #555)`,borderRadius:`50%`,animation:`cm-image-spin 0.8s linear infinite, cm-image-spinner-in 0.2s linear 0.2s forwards`,opacity:`0`},"@keyframes cm-image-spin":{to:{transform:`rotate(360deg)`}},"@keyframes cm-image-spinner-in":{to:{opacity:`1`}},".cm-image-error":{display:`inline-flex`,alignItems:`center`,gap:`var(--space-2, 0.5rem)`,width:`fit-content`,maxWidth:`100%`,padding:`var(--space-2, 0.5rem) var(--space-3, 0.75rem)`,color:`var(--color-text-secondary)`,background:`var(--color-bg-surface)`,border:`1px solid var(--color-border)`,borderRadius:`var(--radius-md, 0.5rem)`,fontSize:`var(--text-sm, 0.875rem)`,lineHeight:`1.3`,fontStyle:`normal`},".cm-image-unavailable":{display:`inline-flex`,alignItems:`center`,gap:`var(--space-2, 0.5rem)`},".cm-image-unavailable svg":{flex:`none`,color:`var(--color-text-secondary)`},".cm-image-unavailable-text":{color:`var(--color-text-primary)`},".cm-image-raw":{color:`var(--color-text-tertiary)`},".cm-line.cm-quote-line":{borderLeft:`1px solid var(--color-border)`,paddingLeft:`12px`,color:`var(--color-text-secondary)`},".cm-line.cm-code-line":{fontFamily:`var(--font-mono, ui-monospace, monospace)`,fontSize:`0.9em`,backgroundColor:`rgba(128,128,128,0.08)`,paddingLeft:`12px`,paddingRight:`12px`}});export{x as n,S as r,w as t};
1
+ import{Gt as e}from"./iPCkjliu.js";import{a as t,o as n,r}from"./B6IRsNLP2.js";import{n as i}from"./C8Ar3dLv.js";import{l as a,m as o,p as s}from"./Wowi_89k.js";import{a as c,l,o as u,r as d,t as f}from"./D3JoMtWC.js";import{T as p}from"./BBGt-XQo.js";var m=`http://www.w3.org/2000/svg`;function h(e,t){let n=document.createElementNS(m,`svg`);n.setAttribute(`viewBox`,`0 0 32 32`),n.setAttribute(`width`,String(e)),n.setAttribute(`height`,String(e)),n.setAttribute(`fill`,`currentColor`),n.setAttribute(`aria-hidden`,`true`);let r=document.createElementNS(m,`path`);return r.setAttribute(`d`,t),n.appendChild(r),n}var g=`M25.7,9.3l-7-7C18.5,2.1,18.3,2,18,2H8C6.9,2,6,2.9,6,4v24c0,1.1,0.9,2,2,2h16c1.1,0,2-0.9,2-2V10C26,9.7,25.9,9.5,25.7,9.3z M18,4.4l5.6,5.6H18V4.4z M24,28H8V4h8v6c0,1.1,0.9,2,2,2h6V28z`,_=`M26,24v4H6V24H4v4a2,2,0,0,0,2,2H26a2,2,0,0,0,2-2V24Z M26,14l-1.41-1.41L17,20.17V2H15V20.17L7.41,12.59,6,14l10,10,10-10z`;function v(e){return!!e&&e.includes(`/api/assets/`)}function y(e){let t=e.split(/[?#]/)[0].split(`/`).pop()??``,n=t.lastIndexOf(`.`);if(n<=0||n===t.length-1)return``;let r=t.slice(n+1);return r.length<=5&&/^[A-Za-z0-9]+$/.test(r)?r.toUpperCase():``}function b({name:e,url:t,ext:n}){let r=document.createElement(`a`);r.className=`sg-file-chip`,r.href=t,r.target=`_blank`,r.rel=`noopener`,r.title=e;let i=h(18,g);i.classList.add(`sg-file-chip-icon`);let a=document.createElement(`span`);a.className=`sg-file-chip-name`,a.textContent=e||`File`,r.append(i,a),typeof requestAnimationFrame==`function`&&requestAnimationFrame(()=>{a.classList.toggle(`is-truncated`,a.scrollWidth>a.clientWidth)});let o=n??y(t),s=document.createElement(`span`);s.className=`sg-file-chip-download`,s.appendChild(h(14,_));let c=document.createElement(`span`);return c.textContent=o||`Download`,s.appendChild(c),r.appendChild(s),r}var x=e({imageKeymap:()=>G,imageSourceField:()=>w,livePreviewPlugin:()=>U,livePreviewTheme:()=>K,refreshExternalStateEffect:()=>S,toggleImageSourceEffect:()=>C}),S=s.define(),C=s.define(),w=o.define({create:()=>new Set,update(e,t){let n=e;if(t.docChanged){n=new Set;for(let r of e)n.add(t.changes.mapPos(r))}for(let r of t.effects)r.is(C)&&(n===e&&(n=new Set(n)),n.has(r.value)?n.delete(r.value):n.add(r.value));return n}}),T=class extends u{toDOM(){let e=document.createElement(`div`);return e.className=`cm-hr-widget`,e}},E=class extends u{toDOM(){let e=document.createElement(`span`);return e.textContent=`—`,e}};function D(){let e=document.createElement(`span`);e.className=`cm-image-unavailable`;let t=`http://www.w3.org/2000/svg`,n=document.createElementNS(t,`svg`);n.setAttribute(`viewBox`,`0 0 32 32`),n.setAttribute(`width`,`18`),n.setAttribute(`height`,`18`),n.setAttribute(`fill`,`currentColor`),n.setAttribute(`aria-hidden`,`true`);let r=document.createElementNS(t,`path`);r.setAttribute(`d`,`M16,30H8a2,2,0,0,1-2-2V4A2,2,0,0,1,8,2h10a1,1,0,0,1,.71.29l5,5A1,1,0,0,1,24,8v6H22V9H17a1,1,0,0,1-1-1V4H8V28h8Z`);let i=document.createElementNS(t,`path`);i.setAttribute(`d`,`M24.5,29A2.5,2.5,0,1,1,27,26.5,2.5,2.5,0,0,1,24.5,29Zm0-3.5a1,1,0,1,0,1,1A1,1,0,0,0,24.5,25.5Z`);let a=document.createElementNS(t,`path`);a.setAttribute(`d`,`M24.5,23a1,1,0,0,1-1-1V21a2.5,2.5,0,1,0-2.5-2.5,1,1,0,0,1-2,0A4.5,4.5,0,1,1,25,22.79V22A1,1,0,0,1,24.5,23Z`),n.append(r,i,a);let o=document.createElement(`span`);return o.className=`cm-image-unavailable-text`,o.textContent=`Original file is no longer available`,e.append(n,o),e}var O=class extends u{alt;url;from;to;sourceShown;isSelected;view;constructor(e,t,n,r,i,a,o){super(),this.alt=e,this.url=t,this.from=n,this.to=r,this.sourceShown=i,this.isSelected=a,this.view=o}eq(e){return this.alt===e.alt&&this.url===e.url&&this.from===e.from&&this.to===e.to&&this.sourceShown===e.sourceShown&&this.isSelected===e.isSelected}toDOM(){let e=document.createElement(`div`);e.className=`cm-image-widget cm-image-loading`,this.isSelected&&e.classList.add(`cm-image-selected`),e.dataset.from=String(this.from),e.dataset.to=String(this.to);let t=document.createElement(`img`);t.src=this.url,t.alt=this.alt,t.loading=`lazy`,t.decoding=`async`,t.onload=()=>{e.classList.remove(`cm-image-loading`)},t.onerror=()=>{e.className=`cm-image-error`,e.replaceChildren(D())},e.appendChild(t);let n=this.view;t.addEventListener(`mousedown`,t=>{t.preventDefault(),t.stopPropagation();let r=+e.dataset.from,i=+e.dataset.to;n.dispatch({selection:{anchor:r,head:i}}),n.focus()});let r=document.createElement(`button`);return r.type=`button`,r.className=`cm-image-source-btn`,this.sourceShown&&r.classList.add(`cm-image-source-btn-active`),r.title=this.sourceShown?`Hide markdown`:`Show markdown`,r.textContent=`</>`,r.addEventListener(`mousedown`,t=>{t.preventDefault(),t.stopPropagation();let r=+e.dataset.from;n.dispatch({effects:C.of(r)})}),e.appendChild(r),e}updateDOM(e){e.classList.toggle(`cm-image-selected`,this.isSelected),e.dataset.from=String(this.from),e.dataset.to=String(this.to);let t=e.querySelector(`img`);t&&(t.getAttribute(`src`)!==this.url&&(t.src=this.url),t.alt!==this.alt&&(t.alt=this.alt));let n=e.querySelector(`.cm-image-source-btn`);return n&&(n.classList.toggle(`cm-image-source-btn-active`,this.sourceShown),n.title=this.sourceShown?`Hide markdown`:`Show markdown`),!0}ignoreEvent(e){return e.type===`mousedown`}},k=class extends u{checked;from;to;constructor(e,t,n){super(),this.checked=e,this.from=t,this.to=n}eq(e){return this.checked===e.checked&&this.from===e.from&&this.to===e.to}toDOM(){let e=document.createElement(`input`);return e.type=`checkbox`,e.checked=this.checked,e.className=`cm-task-checkbox`,e.addEventListener(`mousedown`,t=>{t.preventDefault(),t.stopPropagation(),e.dispatchEvent(new CustomEvent(`task-toggle`,{bubbles:!0,detail:{from:this.from,to:this.to,checked:!this.checked}}))}),e}ignoreEvent(e){return e.type===`mousedown`||e.type===`click`}},A=class extends u{label;url;constructor(e,t){super(),this.label=e,this.url=t}eq(e){return this.label===e.label&&this.url===e.url}toDOM(){let e=b({name:this.label,url:this.url});return e.addEventListener(`mousedown`,e=>{e.preventDefault(),e.stopPropagation(),window.open(this.url,`_blank`,`noopener`)}),e}ignoreEvent(e){return e.type===`mousedown`}},j=class extends u{text;className;entityId;constructor(e,t,n){super(),this.text=e,this.className=t,this.entityId=n}eq(e){return this.text===e.text&&this.className===e.className&&this.entityId===e.entityId}toDOM(){let e=document.createElement(`span`);return e.className=this.className,e.textContent=this.text,e.dataset.entityId=this.entityId,e.addEventListener(`click`,t=>{t.preventDefault(),t.stopPropagation(),e.dispatchEvent(new CustomEvent(`wikilink-click`,{bubbles:!0,detail:this.entityId}))}),e}ignoreEvent(e){return e.type===`mousedown`}};function M(e){if(!e.hasFocus)return[-1,-1];let t=e.state.selection.main,n=e.state.doc,r=n.lineAt(t.from).number;return r===n.lineAt(t.to).number?[r,r]:[-1,-1]}function N(e,t,n){if(!e.hasFocus)return!1;let r=e.state.selection.main,i=e.state.doc;return i.lineAt(r.from).number===i.lineAt(r.to).number?r.to>=t&&r.from<=n:!1}function P(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling}function F(e,r,i,a){let o=r.state,s=e.from>0?o.doc.sliceString(e.from-1,e.from):``,c=e.to<o.doc.length?o.doc.sliceString(e.to,e.to+1):``;if(s!==`[`||c!==`]`)return!1;let l=e.from-1,u=e.to+1,d=o.doc.sliceString(e.from+1,e.to-1),p=n(d),m=p?`cm-live-wikilink cm-wikilink-active`:`cm-live-wikilink cm-wikilink-inactive`,h=a?`${m} ${a}`:m,g=d.indexOf(`|`),_=g===-1?d:d.slice(0,g).trim();if(N(r,l,u))i.push(f.mark({class:`cm-formatting`}).range(l,l+2)),i.push(f.mark({class:h}).range(l+2,u-2)),i.push(f.mark({class:`cm-formatting`}).range(u-2,u));else{let e=p?p.title:t(d);i.push(f.replace({widget:new j(e,h,_)}).range(l,u))}return!0}function I(e,t,n,r){if(N(t,e.from,e.to))n.push(f.mark({class:r}).range(e.from,e.to));else{let i=!1;P(e,e=>{e.name===`Link`&&(i=F(e,t,n,r))}),i||n.push(f.mark({class:r}).range(e.from,e.to)),P(e,e=>{e.name===`EmphasisMark`&&n.push(f.replace({}).range(e.from,e.to))})}}var L=null,R=``,z=0,B=new Map;function V(e,t){if(!R){let t=getComputedStyle(e.contentDOM);R=`${t.fontStyle} ${t.fontWeight} ${t.fontSize} ${t.fontFamily}`,parseFloat(t.fontSize),z=t.letterSpacing&&t.letterSpacing!==`normal`&&parseFloat(t.letterSpacing)||0,L=document.createElement(`canvas`).getContext(`2d`),L&&(L.font=R)}let n=B.get(t);if(n!==void 0)return n;let r=(L?L.measureText(t).width:t.length*e.defaultCharacterWidth)+z*t.length;return B.set(t,r),r}function H(e){let t=e.state,[n,a]=M(e),o=e=>e>=n&&e<=a,s=t.field(w,!1),c=[],l=[];p(t).iterate({enter(n){let r=t.doc.lineAt(n.from).number;if(n.name.startsWith(`ATXHeading`)){let t=`cm-live-heading cm-live-heading-${parseInt(n.name.replace(`ATXHeading`,``),10)||1}`;return c.push(f.mark({class:t}).range(n.from,n.to)),o(r)||P(n.node,r=>{if(r.name===`HeaderMark`){let e=Math.min(r.to+1,n.to);c.push(f.replace({}).range(r.from,e))}else r.name===`Link`&&F(r,e,c,t)}),!1}if(n.name===`Blockquote`){let e=t.doc.lineAt(n.from).number,r=t.doc.lineAt(n.to).number;for(let n=e;n<=r;n++){let e=t.doc.line(n);c.push(f.line({class:`cm-quote-line`}).range(e.from))}}if(n.name===`QuoteMark`&&!o(r)){let e=t.doc.sliceString(n.to,Math.min(n.to+1,t.doc.length))===` `?n.to+1:n.to;c.push(f.replace({}).range(n.from,e))}if(n.name===`FencedCode`){let e=t.doc.lineAt(n.from).number,r=t.doc.lineAt(n.to).number;for(let n=e;n<=r;n++){let e=t.doc.line(n);c.push(f.line({class:`cm-code-line`}).range(e.from))}}if(n.name===`CodeMark`||n.name===`CodeInfo`){let t=n.node.parent;t?.name===`FencedCode`&&(N(e,t.from,t.to)||c.push(f.replace({}).range(n.from,n.to)))}if(n.name===`HorizontalRule`&&!o(r)){let e=t.doc.lineAt(n.from);c.push(f.replace({widget:new T}).range(n.from,n.to)),c.push(f.line({class:`cm-hr-line`}).range(e.from))}if(n.name===`ListMark`){let r=n.node.parent?.parent?.name===`OrderedList`;c.push(f.mark({class:r?`cm-list-marker cm-list-marker-ordered`:`cm-list-marker cm-list-marker-bullet`}).range(n.from,n.to));let i=t.doc.lineAt(n.from),a=n.to;for(;a<i.to&&t.doc.sliceString(a,a+1)===` `;)a++;let o=V(e,t.doc.sliceString(i.from,a));o>0&&c.push(f.line({class:`cm-hang-indent`,attributes:{style:`--cm-hang:${o.toFixed(2)}px`}}).range(i.from)),n.from>i.from&&l.push(f.replace({}).range(i.from,n.from))}if(n.name===`TaskMarker`){let e=t.doc.sliceString(n.from,n.to),r=e===`[x]`||e===`[X]`;c.push(f.replace({widget:new k(r,n.from,n.to)}).range(n.from,n.to))}if(n.name===`StrongEmphasis`)return I(n.node,e,c,`cm-live-strong`),!1;if(n.name===`Emphasis`)return I(n.node,e,c,`cm-live-em`),!1;if(n.name===`InlineCode`)return c.push(f.mark({class:`cm-live-code`}).range(n.from,n.to)),N(e,n.from,n.to)||P(n.node,e=>{e.name===`CodeMark`&&c.push(f.replace({}).range(e.from,e.to))}),!1;if(n.name===`Link`){let r=t.doc.sliceString(n.from,n.to);if(F(n,e,c))return!1;if(r.includes(`](`)){let a=[],o=-1,s=-1;P(n.node,e=>{e.name===`LinkMark`&&a.push({from:e.from,to:e.to}),e.name===`URL`&&(o=e.from,s=e.to)});let u=o>=0?t.doc.sliceString(o,s):``;if(v(u)&&!N(e,n.from,n.to)){let e=a.length>=2?t.doc.sliceString(a[0].to,a[1].from):r;return c.push(f.replace({widget:new A(e,u)}).range(n.from,n.to)),l.push(f.replace({}).range(n.from,n.to)),!1}return c.push(f.mark({class:`cm-live-link`,attributes:u?{"data-href":i(u)}:{}}).range(n.from,n.to)),N(e,n.from,n.to)||a.length>=2&&o>=0&&(c.push(f.replace({}).range(a[0].from,a[0].to)),c.push(f.replace({}).range(a[1].from,n.to))),!1}}if(n.name===`Image`){let r=t.doc.sliceString(n.from,n.to).match(/!\[([^\]]*)\]/),i=r?r[1]:``,a=``;if(P(n.node,e=>{e.name===`URL`&&(a=t.doc.sliceString(e.from,e.to))}),a){let r=!!s?.has(n.from),o=e.state.selection.main,u=o.from<=n.from&&o.to>=n.to&&o.from<o.to;if(r)c.push(f.mark({class:`cm-image-raw`}).range(n.from,n.to)),c.push(f.widget({widget:new O(i,a,n.from,n.to,!0,u,e),side:1}).range(n.to));else{c.push(f.replace({widget:new O(i,a,n.from,n.to,!1,u,e)}).range(n.from,n.to)),l.push(f.replace({}).range(n.from,n.to));let r=t.doc.lineAt(n.from),o=t.doc.sliceString(r.from,r.to),s=t.doc.sliceString(n.from,n.to);o.trim()===s.trim()&&c.push(f.line({class:`cm-image-line`}).range(r.from))}}return!1}}});let u=t.doc;for(let e=1;e<=u.lines;e++){let t=u.line(e),n=t.text,i=n.trim(),a=/^-{3,}$/.test(i)||/^\*{3,}$/.test(i)||/^_{3,}$/.test(i),o=0;for(;!a&&(o=n.indexOf(`--`,o))!==-1;){let e=n[o+2]??``;if(e!==`-`&&!/[A-Za-z0-9_]/.test(e)){let e=t.from+o;c.push(f.replace({widget:new E}).range(e,e+2))}o+=2}for(let e=0;e<n.length;e++){let i=n[e];if(i!==`"`&&i!==`'`)continue;let a=e>0?n[e-1]:``;if(/[0-9]/.test(a))continue;let o=t.from+e,s=r(a),l=i===`"`?s?`“`:`”`:s?`‘`:`’`;c.push(f.mark({class:`cm-smart-quote`,attributes:{"data-smart-quote":l}}).range(o,o+1))}}return{deco:f.set(c,!0),atomic:f.set(l,!0)}}var U=c.fromClass(class{decorations;atomicRanges;constructor(e){let t=H(e);this.decorations=t.deco,this.atomicRanges=t.atomic}update(e){let t=e.transactions.some(e=>e.effects.some(e=>e.is(S)||e.is(C)));if(e.docChanged||e.selectionSet||e.viewportChanged||e.focusChanged||t){let t=H(e.view);this.decorations=t.deco,this.atomicRanges=t.atomic}}},{decorations:e=>e.decorations,provide:e=>d.atomicRanges.of(t=>t.plugin(e)?.atomicRanges??f.none)});function W(e){let t=e.state.selection.main;if(t.from===t.to)return!1;let n=e.state.doc.lineAt(t.from);if(n.from!==t.from||n.to!==t.to)return!1;let r=e.state.doc.sliceString(t.from,t.to);if(!/^!\[[^\]]*\]\([^)]+\)$/.test(r))return!1;let i=e.state.doc.length,a=t.to<i?t.to+1:t.to;return e.dispatch({changes:{from:t.from,to:a,insert:``},userEvent:`delete.selection`}),!0}var G=a.high(l.of([{key:`Backspace`,run:W},{key:`Delete`,run:W}])),K=d.baseTheme({".cm-smart-quote":{position:`relative`,visibility:`hidden`},".cm-smart-quote::before":{content:`attr(data-smart-quote)`,position:`absolute`,insetInlineStart:`0`,visibility:`visible`,textIndent:`0`},".cm-live-heading":{fontWeight:`600`},".cm-live-heading-1":{fontSize:`1.5em`},".cm-live-heading-2":{fontSize:`1.2em`},".cm-live-heading-3":{fontSize:`1.05em`},".cm-live-strong":{fontWeight:`600`},".cm-live-em":{fontStyle:`italic`},".cm-live-code":{fontFamily:`monospace`,fontSize:`0.9em`,padding:`1px 4px`,borderRadius:`0.1875rem`,backgroundColor:`rgba(128,128,128,0.12)`},".cm-live-wikilink":{borderRadius:`0.1875rem`},".cm-wikilink-active":{color:`var(--color-link)`,cursor:`pointer`,textDecoration:`none`},".cm-wikilink-active:hover":{textDecoration:`underline`},".cm-wikilink-inactive":{color:`var(--color-text-tertiary)`},".cm-live-link":{color:`var(--color-link, #f37373)`,textDecoration:`none`,cursor:`pointer`},".cm-live-link:hover":{textDecoration:`underline`},".cm-list-marker":{color:`var(--color-text-tertiary)`},".cm-list-marker-bullet, .cm-list-marker-bullet *":{color:`transparent !important`},".cm-list-marker-bullet::before":{content:`"•"`,display:`inline-block`,width:`0`,overflow:`visible`,textIndent:`0`,color:`var(--color-text-tertiary)`},".cm-list-marker-ordered, .cm-list-marker-ordered *":{color:`var(--color-text-tertiary) !important`,opacity:`1 !important`},".cm-line.cm-hang-indent":{paddingLeft:`var(--cm-hang, 0px)`,textIndent:`calc(-1 * var(--cm-hang, 0px))`},".cm-hr-widget":{borderTop:`1px solid var(--color-border, #333)`,margin:`0`},".cm-line.cm-hr-line":{lineHeight:`0`,padding:`6px 0`},".cm-task-checkbox":{verticalAlign:`middle`,margin:`0 4px 0 0`,cursor:`pointer`,accentColor:`var(--color-accent)`},".cm-image-widget":{display:`block`,width:`fit-content`,maxWidth:`100%`,lineHeight:`0`,position:`relative`,zIndex:`1`,background:`var(--color-bg)`},".cm-line.cm-image-line":{lineHeight:`0`,fontSize:`0`,margin:`0.75rem 0`},".sg-comment-highlight .cm-image-widget img":{outline:`2px solid var(--color-comment-bg, #f5d264)`,outlineOffset:`2px`,borderRadius:`var(--radius-xs)`},".sg-comment-highlight.sg-comment-resolved .cm-image-widget img":{outline:`2px dashed var(--color-text-tertiary)`},".cm-image-source-btn":{position:`absolute`,top:`8px`,right:`8px`,display:`flex`,alignItems:`center`,justifyContent:`center`,height:`24px`,padding:`0 6px`,font:`600 11px var(--font-mono, ui-monospace, monospace)`,lineHeight:`1`,color:`#fff`,background:`rgba(0,0,0,0.55)`,border:`none`,borderRadius:`var(--radius-xs, 4px)`,cursor:`pointer`,opacity:`0`,transition:`opacity 0.12s ease, background 0.12s ease`},".cm-image-widget:hover .cm-image-source-btn":{opacity:`1`},".cm-image-source-btn:hover":{background:`rgba(0,0,0,0.75)`},".cm-image-source-btn-active":{opacity:`1`,background:`var(--color-accent)`},".cm-image-widget img":{maxWidth:`100%`,borderRadius:`var(--radius-xs)`,transition:`opacity 0.15s ease`,verticalAlign:`top`},".cm-image-selected img":{outline:`2px solid var(--color-accent)`,outlineOffset:`2px`},".cm-image-loading":{width:`100%`,minHeight:`120px`,background:`var(--color-surface-subtle, rgba(0,0,0,0.04))`,borderRadius:`var(--radius-xs)`,position:`relative`},".cm-image-loading img":{opacity:`0`},".cm-image-loading::after":{content:`""`,position:`absolute`,top:`50%`,left:`50%`,width:`24px`,height:`24px`,marginTop:`-12px`,marginLeft:`-12px`,border:`2px solid rgba(0,0,0,0.08)`,borderTopColor:`var(--color-accent, #555)`,borderRadius:`50%`,animation:`cm-image-spin 0.8s linear infinite, cm-image-spinner-in 0.2s linear 0.2s forwards`,opacity:`0`},"@keyframes cm-image-spin":{to:{transform:`rotate(360deg)`}},"@keyframes cm-image-spinner-in":{to:{opacity:`1`}},".cm-image-error":{display:`inline-flex`,alignItems:`center`,gap:`var(--space-2, 0.5rem)`,width:`fit-content`,maxWidth:`100%`,padding:`var(--space-2, 0.5rem) var(--space-3, 0.75rem)`,color:`var(--color-text-secondary)`,background:`var(--color-bg-surface)`,border:`1px solid var(--color-border)`,borderRadius:`var(--radius-md, 0.5rem)`,fontSize:`var(--text-sm, 0.875rem)`,lineHeight:`1.3`,fontStyle:`normal`},".cm-image-unavailable":{display:`inline-flex`,alignItems:`center`,gap:`var(--space-2, 0.5rem)`},".cm-image-unavailable svg":{flex:`none`,color:`var(--color-text-secondary)`},".cm-image-unavailable-text":{color:`var(--color-text-primary)`},".cm-image-raw":{color:`var(--color-text-tertiary)`},".cm-line.cm-quote-line":{borderLeft:`1px solid var(--color-border)`,paddingLeft:`12px`,color:`var(--color-text-secondary)`},".cm-line.cm-code-line":{fontFamily:`var(--font-mono, ui-monospace, monospace)`,fontSize:`0.9em`,backgroundColor:`rgba(128,128,128,0.08)`,paddingLeft:`12px`,paddingRight:`12px`}});export{x as n,S as r,w as t};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./yAxYDEMa.js","./iPCkjliu.js","./CK8tIaYT.js","./xihTtKlq.js","./BDIUHcEz.js","../assets/dist.DDCWxn3B.css"])))=>i.map(i=>d[i]);
2
- import{Bt as e,Gt as t,I as n,M as r,Mt as i,Nt as a,P as o,R as s,St as c,V as l,Y as u,_ as d,_t as f,at as p,b as m,dt as h,mt as g,o as _,y as v,yt as y,z as b}from"./iPCkjliu.js";import{t as x}from"./kNaey6uv.js";import"./xihTtKlq.js";import{F as S,m as C}from"./BI1QnJpF.js";import{n as w}from"./JCjEwqH9.js";import{t as T}from"./D3Q44JkU.js";var E=t({AGENT_AVATAR_COLOR:()=>O,userColors:()=>M}),D=[`#FE3C3C`,`#C06A6A`,`#CC7013`,`#AB8630`,`#5A9A08`,`#369770`,`#289795`,`#4289C4`,`#718599`,`#7C7CD9`,`#B267F3`,`#B269C0`,`#DC6CD4`],O=`#B267F3`,k=y(g({}));async function A(){try{let{colors:e}=await w(`/api/auth/colors`);f(k,e,!0)}catch{}}function ee(e,t){if(t===`agent`)return O;let n=u(k)[String(e)];if(n)return n;let r=typeof e==`number`?e:parseInt(String(e),10),i=(Number.isFinite(r)?r:j(String(e)))%D.length;return D[Math.abs(i)]}function j(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return t}A(),T.addConnectHandler(()=>A());var M={getColor:ee,load:A,get colors(){return u(k)}},N=b(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 0 C12 7.5 7.5 12 0 12 C7.5 12 12 16.5 12 24 C12 16.5 16.5 12 24 12 C16.5 12 12 7.5 12 0 Z"></path></svg>`);function P(e,t){let r=_(t,`size`,3,16);var i=N();p(()=>{d(i,`width`,r()),d(i,`height`,r()),d(i,`aria-hidden`,t.title?void 0:!0),d(i,`role`,t.title?`img`:void 0),d(i,`aria-label`,t.title)}),n(e,i)}var F=s(`<span><!></span>`);function I(t,s){a(s,!0);let f=_(s,`agent`,3,!1),g=_(s,`size`,3,`md`),y=_(s,`class`,3,``),b=c(()=>{if(s.color)return s.color;if(s.userId!==void 0&&s.userId!==null)return M.getColor(s.userId);if(f())return`var(--color-agent)`}),x=c(()=>!s.color&&(s.userId===void 0||s.userId===null)&&!f()&&!s.text),S=c(()=>s.text??(s.name?.[0]??`?`).toUpperCase()),C=c(()=>g()===`sm`?11:12);var w=F();let T,E;var D=h(w),O=e=>{P(e,{get size(){return u(C)}})},k=e=>{var t=l();p(()=>o(t,u(S))),n(e,t)};r(D,e=>{f()?e(O):e(k,-1)}),e(w),p(()=>{T=m(w,1,`sg-avatar sg-avatar-${g()??``} ${y()??``}`,`svelte-8w5802`,T,{"sg-avatar-agent":f(),"sg-avatar-muted":u(x)}),d(w,`title`,s.title),E=v(w,``,E,{background:u(b),color:s.textColor})}),n(t,w),i()}function L(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function R(e){return new Date(e+`T00:00:00`)}function z(e){let t=R(e);return t.setDate(t.getDate()-t.getDay()),t}function te(e){let t=z(e),n=new Date(t);n.setDate(t.getDate()-7);let r=new Date(t);return r.setDate(t.getDate()+13),{start:L(n),end:L(r)}}function ne(e){return{id:e.id,title:e.title,entityType:`task`,repo:e.repo,folder_path:``,hasSubContent:!1,wikilinks:[],createdAt:null,updatedAt:null,fields:{date:e.dueDate,status:e.status,priority:e.priority,assignee:e.assignee},status:e.status,priority:e.priority,assignee:e.assignee,dueDate:e.dueDate}}function B(e){return{id:e.id,title:e.title,entityType:`event`,repo:e.repo,folder_path:``,hasSubContent:!1,wikilinks:[],createdAt:null,updatedAt:null,fields:{date:e.date,attendees:e.attendees}}}async function V(e){try{let{toast:t}=await x(async()=>{let{toast:e}=await import(`./yAxYDEMa.js`).then(e=>e.t);return{toast:e}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);t(e,{duration:4e3})}catch{console.error(e)}}function H(){let e=y(g([])),t=y(g([])),n=y(g([])),r=y(null),i=y(null),a=y(!1),o=y(g(L(new Date))),s=y(``),c=y(``),l=y(!1),d=y(!1),p=y(!1),m=y(null);async function h(h=u(o)){f(l,!0),f(p,!1),f(m,null);let g=te(h);try{let l=new Date,u=new Date(l.getFullYear(),l.getMonth(),l.getDate()),p=new Date(u);p.setDate(u.getDate()+1);let m=await C(g.start,g.end,u.toISOString(),p.toISOString());f(e,m.myOpenTasks,!0),f(t,m.completedToday??[],!0),f(n,m.meetings,!0),f(r,m.currentUserPersonId,!0),f(i,m.currentUserId??null,!0),f(a,m.openMode,!0),f(s,m.windowStart,!0),f(c,m.windowEnd,!0),f(o,h,!0),f(d,!0)}catch(e){console.error(`Failed to load home data:`,e),f(m,`Could not load your week`),f(d,!0)}finally{f(l,!1)}}function _(e){let t=z(e),n=new Date(t);n.setDate(t.getDate()+6),!u(s)||!u(c)||L(t)<u(s)||L(n)>u(c)?h(e):f(o,e,!0)}function v(){f(p,!0)}async function b(t,r,i,a){let o=u(e),s=u(n);r===`task`?f(e,u(e).map(e=>e.id===i&&e.repo===t?{...e,dueDate:a}:e),!0):r===`event`&&f(n,u(n).map(e=>e.id===i&&e.repo===t?{...e,date:a}:e),!0);try{await S(t,r,i,{data:{date:a}})}catch(t){throw f(e,o,!0),f(n,s,!0),await V(`Could not reschedule — change reverted`),t}}async function x(n,r){let i=u(e).find(e=>e.id===r&&e.repo===n),a=u(e),o=u(t);i&&(f(e,u(e).filter(e=>!(e.id===r&&e.repo===n)),!0),f(t,[...u(t),{...i,status:`done`,completedAt:new Date().toISOString()}],!0));try{await S(n,`task`,r,{data:{status:`done`}})}catch(n){throw f(e,a,!0),f(t,o,!0),await V(`Could not complete task — change reverted`),n}}async function w(n,r){let i=u(t).find(e=>e.id===r&&e.repo===n),a=u(e),o=u(t);if(i){f(t,u(t).filter(e=>!(e.id===r&&e.repo===n)),!0);let{completedAt:a,...o}=i;f(e,[...u(e),{...o,status:`todo`}],!0)}try{await S(n,`task`,r,{data:{status:`todo`}})}catch(n){throw f(e,a,!0),f(t,o,!0),await V(`Could not reopen task — change reverted`),n}}return{get myOpenTasks(){return u(e)},get completedToday(){return u(t)},get meetings(){return u(n)},get currentUserPersonId(){return u(r)},get currentUserId(){return u(i)},get openMode(){return u(a)},get anchorDate(){return u(o)},get loading(){return u(l)},get loaded(){return u(d)},get stale(){return u(p)},get error(){return u(m)},load:h,setWeek:_,markStale:v,rescheduleEntity:b,completeTask:x,uncompleteTask:w}}var U=H(),W=null;T.addEntityChangeHandler(e=>{e.entityType!==`event`&&e.entityType!==`task`||(W&&clearTimeout(W),W=setTimeout(()=>{W=null,U.load()},250))});var G=[{key:`name`,label:`Name`,filter:`text`},{key:`entity_type`,label:`Type`,filter:`enum`},{key:`folder`,label:`Folder`,filter:`enum`},{key:`updated_at`,label:`Updated`,filter:`date`,format:`date`}],K=[{key:`folder`,label:`Folder`,filter:`enum`},{key:`updated_at`,label:`Updated`,filter:`date`,format:`date`}],q=`__status__`,J={key:q,label:`Status`,filter:`enum`},Y={person:[{key:`name`,label:`Name`,filter:`text`},{key:`role`,label:`Role`,filter:`text`},{key:`category`,label:`Category`,filter:`enum`,sortOrder:{employee:0,contractor:1,client:2,partner:3,other:4}},{key:`status`,label:`Status`,filter:`enum`,sortOrder:{current:0,former:1}},{key:`email`,label:`Email`,filter:`text`},{key:`employer`,label:`Employer`,filter:`enum`,format:`wikilink`}],organization:[{key:`name`,label:`Name`,filter:`text`},{key:`category`,label:`Category`,filter:`enum`,sortOrder:{client:0,vendor:1,partner:2,prospect:3,"professional-association":4,other:5}},{key:`status`,label:`Status`,filter:`enum`,sortOrder:{active:0,dormant:1,former:2}},{key:`industry`,label:`Industry`,filter:`text`}],position:[{key:`name`,label:`Name`,filter:`text`},{key:`department`,label:`Department`,filter:`text`},{key:`category`,label:`Category`,filter:`enum`,sortOrder:{staff:0,contractor:1,intern:2}},{key:`status`,label:`Status`,filter:`enum`,sortOrder:{draft:0,open:1,filled:2,closed:3}}],deal:[{key:`name`,label:`Name`,filter:`text`},{key:`client`,label:`Client`,filter:`enum`,format:`wikilink`},{key:`contact`,label:`Contact`,filter:`enum`,format:`wikilink`},{key:`stage`,label:`Stage`,filter:`enum`,sortOrder:{qualification:0,scoping:1,proposal:2,negotiation:3,"pending-signature":4,won:5,lost:6}},{key:`deal_value`,label:`Value`,filter:`none`,format:`currency`},{key:`start_date`,label:`Start`,filter:`date`,format:`date`},{key:`date`,label:`Close date`,filter:`date`,format:`date`}],project:[{key:`name`,label:`Name`,filter:`text`},{key:`category`,label:`Category`,filter:`enum`,sortOrder:{client:0,internal:1}},{key:`client`,label:`Client`,filter:`text`,format:`wikilink`},{key:`services`,label:`Services`,filter:`text`,format:`wikilink`},{key:`status`,label:`Status`,filter:`enum`,sortOrder:{planning:0,"in-progress":1,paused:2,complete:3,archived:4}},{key:`start_date`,label:`Start`,filter:`date`,format:`date`},{key:`date`,label:`End date`,filter:`date`,format:`date`}],event:[{key:`name`,label:`Name`,filter:`text`},{key:`category`,label:`Category`,filter:`enum`,sortOrder:{meeting:0,call:1,review:2,workshop:3,presentation:4,conference:5,other:6}},{key:`attendees`,label:`Attendees`,filter:`text`,format:`wikilink`},{key:`location`,label:`Location`,filter:`text`},{key:`start_date`,label:`Start`,filter:`date`,format:`date`},{key:`date`,label:`Date`,filter:`date`,format:`date`}],task:[{key:`name`,label:`Name`,filter:`text`},{key:`status`,label:`Status`,filter:`enum`,sortOrder:{backlog:0,todo:1,"in-progress":2,"in-review":3,done:4,cancelled:5}},{key:`priority`,label:`Priority`,filter:`enum`,sortOrder:{urgent:0,high:1,medium:2,low:3}},{key:`assignee`,label:`Assignee`,filter:`enum`,format:`wikilink`},{key:`phase`,label:`Phase`,filter:`enum`},{key:`start_date`,label:`Start`,filter:`date`,format:`date`},{key:`date`,label:`Due date`,filter:`date`,format:`date`}],deliverable:[{key:`name`,label:`Name`,filter:`text`},{key:`parent_project`,label:`Parent project`,filter:`enum`,format:`wikilink`},{key:`status`,label:`Status`,filter:`enum`,sortOrder:{planned:0,"in-progress":1,delivered:2,accepted:3,rejected:4}},{key:`phase`,label:`Phase`,filter:`enum`},{key:`start_date`,label:`Start`,filter:`date`,format:`date`},{key:`date`,label:`Due date`,filter:`date`,format:`date`}],document:[{key:`name`,label:`Name`,filter:`text`},{key:`category`,label:`Category`,filter:`enum`,sortOrder:{proposal:0,contract:1,brief:2,memo:3,report:4,template:5,guideline:6,other:7}},{key:`status`,label:`Status`,filter:`enum`,sortOrder:{draft:0,review:1,final:2,archived:3}}],deck:[{key:`name`,label:`Name`,filter:`text`},{key:`audience`,label:`Audience`,filter:`enum`,sortOrder:{client:0,team:1,board:2,external:3,other:4}},{key:`status`,label:`Status`,filter:`enum`,sortOrder:{draft:0,review:1,final:2,archived:3}}],publication:[{key:`name`,label:`Name`,filter:`text`},{key:`platform`,label:`Platform`,filter:`enum`},{key:`status`,label:`Status`,filter:`enum`,sortOrder:{draft:0,review:1,scheduled:2,published:3}},{key:`date`,label:`Published`,filter:`date`,format:`date`},{key:`url`,label:`URL`,filter:`none`}],"case-study":[{key:`name`,label:`Name`,filter:`text`},{key:`client`,label:`Client`,filter:`enum`,format:`wikilink`},{key:`services`,label:`Services`,filter:`text`,format:`wikilink`},{key:`status`,label:`Status`,filter:`enum`,sortOrder:{draft:0,review:1,final:2,published:3}}],service:[{key:`name`,label:`Name`,filter:`text`},{key:`sprint`,label:`Sprint`,filter:`enum`,format:`wikilink`},{key:`status`,label:`Status`,filter:`enum`,sortOrder:{offered:0,"in-development":1,retired:2}},{key:`depends_on`,label:`Depends on`,filter:`text`,format:`wikilink`},{key:`enables`,label:`Enables`,filter:`text`,format:`wikilink`},{key:`deliverables`,label:`Deliverables`,filter:`text`}],skill:[{key:`name`,label:`Name`,filter:`text`},{key:`description`,label:`Description`,filter:`text`},{key:`applies_to`,label:`Applies to`,filter:`text`}],note:[{key:`name`,label:`Name`,filter:`text`}],reference:[{key:`name`,label:`Name`,filter:`text`},{key:`source`,label:`Source`,filter:`text`},{key:`link`,label:`URL`,filter:`none`}],asset:[{key:`name`,label:`Name`,filter:`text`},{key:`asset_kind`,label:`Kind`,filter:`enum`,sortOrder:{image:0,video:1,audio:2,pdf:3,spreadsheet:4,other:5}},{key:`asset_extension`,label:`Ext`,filter:`text`}]},X={person:[`category`,`employer`],organization:[`category`,`industry`],position:[`department`,`status`],project:[`client`,`date`],event:[`attendees`,`date`],task:[`assignee`,`date`],document:[`category`,`status`],deliverable:[`parent_project`,`date`],publication:[`platform`,`date`],deal:[`client`,`deal_value`],"case-study":[`client`,`status`],deck:[`audience`,`status`],service:[`sprint`,`status`],asset:[`asset_kind`,`asset_extension`],skill:[`description`,`applies_to`]};function re(e){return e?X[e]??[]:[]}var ie=new Set([`name`,`entity_type`,`entity_id`,`created_at`,`updated_at`,`created_by`,`updated_by`,`tags`,`date`]),ae=new Set([`tags`,`entity_type`,`folder`,`created_at`,`updated_at`]);function oe(e){return e in Y}function se(e,t){if(ae.has(t))return!0;let n=Y[e];return n?n.some(e=>e.key===t):!1}function ce(e,t){if(!e)return G;let n=Y[e];if(n)return[...n,...K];let r=[{key:`name`,label:`Name`,filter:`text`}];if(t)for(let e of t){if(ie.has(e))continue;let t=e.replace(/_/g,` `),n=t.charAt(0).toUpperCase()+t.slice(1),i=e.endsWith(`_date`)||e===`date`;r.push({key:e,label:n,filter:i?`date`:`text`,format:i?`date`:void 0})}return[...r,...K]}var Z={MINT:`#369770`,PISTACHIO:`#5A9A08`,SKY:`#4289C4`,TEAL:`#289795`,SAND:`#AB8630`,ORANGE:`#CC7013`,RED:`#FE3C3C`,ROSE:`#C06A6A`,LILAC:`#B267F3`,VIOLET:`#7C7CD9`,SLATE:`#718599`,PINK:`#DC6CD4`},Q={"person.category":{employee:Z.SKY,contractor:Z.SAND,client:Z.MINT,partner:Z.PISTACHIO,other:Z.SLATE},"person.status":{current:Z.MINT,former:Z.SLATE},"organization.category":{client:Z.SKY,vendor:Z.ROSE,partner:Z.PISTACHIO,prospect:Z.LILAC,"professional-association":Z.VIOLET,other:Z.ROSE},"organization.status":{active:Z.MINT,dormant:Z.SAND,former:Z.SLATE},"position.category":{staff:Z.SKY,contractor:Z.SAND,intern:Z.LILAC},"position.status":{draft:Z.LILAC,open:Z.SAND,filled:Z.MINT,closed:Z.SLATE},"deal.stage":{qualification:Z.LILAC,scoping:Z.SAND,proposal:Z.SKY,negotiation:Z.PISTACHIO,"pending-signature":Z.ORANGE,won:Z.MINT,lost:Z.RED},"project.category":{client:Z.SKY,internal:Z.ORANGE},"project.status":{planning:Z.LILAC,"in-progress":Z.SKY,paused:Z.ROSE,complete:Z.MINT,archived:Z.SLATE},"event.category":{meeting:Z.SKY,call:Z.PISTACHIO,review:Z.SAND,workshop:Z.ORANGE,presentation:Z.PINK,conference:Z.VIOLET,other:Z.SLATE},"task.status":{backlog:Z.SLATE,todo:Z.LILAC,"in-progress":Z.SKY,"in-review":Z.SAND,done:Z.MINT,cancelled:Z.ROSE},"task.priority":{urgent:Z.RED,high:Z.ORANGE,medium:Z.ROSE,low:Z.SLATE},"deliverable.status":{planned:Z.LILAC,"in-progress":Z.SKY,delivered:Z.PISTACHIO,accepted:Z.MINT,rejected:Z.RED},"document.category":{proposal:Z.SKY,contract:Z.TEAL,brief:Z.PINK,memo:Z.ROSE,report:Z.SLATE,template:Z.VIOLET,guideline:Z.PISTACHIO,other:Z.ROSE},"document.status":{draft:Z.LILAC,review:Z.SKY,final:Z.MINT,archived:Z.SLATE},"deck.audience":{client:Z.SKY,team:Z.PISTACHIO,board:Z.VIOLET,external:Z.ORANGE,other:Z.SLATE},"deck.status":{draft:Z.LILAC,review:Z.SKY,final:Z.MINT,archived:Z.SLATE},"publication.status":{draft:Z.LILAC,review:Z.SKY,scheduled:Z.PISTACHIO,published:Z.MINT},"case-study.status":{draft:Z.LILAC,review:Z.SKY,final:Z.PISTACHIO,published:Z.MINT},"service.status":{offered:Z.MINT,"in-development":Z.SAND,retired:Z.SLATE},"asset.asset_kind":{image:Z.SKY,video:Z.PINK,audio:Z.VIOLET,pdf:Z.RED,spreadsheet:Z.PISTACHIO,other:Z.SLATE}};function le(e,t,n){return Q[`${e}.${t}`]?.[n]}function $(e){return e===`deal`?`stage`:Q[`${e}.status`]?`status`:null}function ue(e){switch(e.toLowerCase()){case`active`:case`current`:case`won`:case`done`:case`complete`:case`accepted`:case`final`:case`published`:case`offered`:case`filled`:return Z.MINT;case`in-progress`:case`in-review`:case`review`:case`proposal`:return Z.SKY;case`open`:case`scoping`:case`planning`:case`qualification`:case`in-development`:case`dormant`:return Z.SAND;case`todo`:case`draft`:case`backlog`:return Z.LILAC;case`lost`:case`rejected`:return Z.RED;case`former`:case`cancelled`:case`paused`:case`closed`:return Z.ROSE;case`archived`:case`retired`:return Z.SLATE;default:return Z.SLATE}}export{M as _,re as a,le as c,U as d,B as f,I as g,L as h,ce as i,oe as l,z as m,q as n,ue as o,ne as p,Q as r,$ as s,J as t,se as u,E as v};
2
+ import{Bt as e,Gt as t,I as n,M as r,Mt as i,Nt as a,P as o,R as s,St as c,V as l,Y as u,_ as d,_t as f,at as p,b as m,dt as h,mt as g,o as _,y as v,yt as y,z as b}from"./iPCkjliu.js";import{t as x}from"./kNaey6uv.js";import"./xihTtKlq.js";import{F as S,m as C}from"./BxBYpA6r.js";import{n as w}from"./JCjEwqH9.js";import{t as T}from"./C6GeXy2x.js";var E=t({AGENT_AVATAR_COLOR:()=>O,userColors:()=>M}),D=[`#FE3C3C`,`#C06A6A`,`#CC7013`,`#AB8630`,`#5A9A08`,`#369770`,`#289795`,`#4289C4`,`#718599`,`#7C7CD9`,`#B267F3`,`#B269C0`,`#DC6CD4`],O=`#B267F3`,k=y(g({}));async function A(){try{let{colors:e}=await w(`/api/auth/colors`);f(k,e,!0)}catch{}}function ee(e,t){if(t===`agent`)return O;let n=u(k)[String(e)];if(n)return n;let r=typeof e==`number`?e:parseInt(String(e),10),i=(Number.isFinite(r)?r:j(String(e)))%D.length;return D[Math.abs(i)]}function j(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return t}A(),T.addConnectHandler(()=>A());var M={getColor:ee,load:A,get colors(){return u(k)}},N=b(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 0 C12 7.5 7.5 12 0 12 C7.5 12 12 16.5 12 24 C12 16.5 16.5 12 24 12 C16.5 12 12 7.5 12 0 Z"></path></svg>`);function P(e,t){let r=_(t,`size`,3,16);var i=N();p(()=>{d(i,`width`,r()),d(i,`height`,r()),d(i,`aria-hidden`,t.title?void 0:!0),d(i,`role`,t.title?`img`:void 0),d(i,`aria-label`,t.title)}),n(e,i)}var F=s(`<span><!></span>`);function I(t,s){a(s,!0);let f=_(s,`agent`,3,!1),g=_(s,`size`,3,`md`),y=_(s,`class`,3,``),b=c(()=>{if(s.color)return s.color;if(s.userId!==void 0&&s.userId!==null)return M.getColor(s.userId);if(f())return`var(--color-agent)`}),x=c(()=>!s.color&&(s.userId===void 0||s.userId===null)&&!f()&&!s.text),S=c(()=>s.text??(s.name?.[0]??`?`).toUpperCase()),C=c(()=>g()===`sm`?11:12);var w=F();let T,E;var D=h(w),O=e=>{P(e,{get size(){return u(C)}})},k=e=>{var t=l();p(()=>o(t,u(S))),n(e,t)};r(D,e=>{f()?e(O):e(k,-1)}),e(w),p(()=>{T=m(w,1,`sg-avatar sg-avatar-${g()??``} ${y()??``}`,`svelte-8w5802`,T,{"sg-avatar-agent":f(),"sg-avatar-muted":u(x)}),d(w,`title`,s.title),E=v(w,``,E,{background:u(b),color:s.textColor})}),n(t,w),i()}function L(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function R(e){return new Date(e+`T00:00:00`)}function z(e){let t=R(e);return t.setDate(t.getDate()-t.getDay()),t}function te(e){let t=z(e),n=new Date(t);n.setDate(t.getDate()-7);let r=new Date(t);return r.setDate(t.getDate()+13),{start:L(n),end:L(r)}}function ne(e){return{id:e.id,title:e.title,entityType:`task`,repo:e.repo,folder_path:``,hasSubContent:!1,wikilinks:[],createdAt:null,updatedAt:null,fields:{date:e.dueDate,status:e.status,priority:e.priority,assignee:e.assignee},status:e.status,priority:e.priority,assignee:e.assignee,dueDate:e.dueDate}}function B(e){return{id:e.id,title:e.title,entityType:`event`,repo:e.repo,folder_path:``,hasSubContent:!1,wikilinks:[],createdAt:null,updatedAt:null,fields:{date:e.date,attendees:e.attendees}}}async function V(e){try{let{toast:t}=await x(async()=>{let{toast:e}=await import(`./yAxYDEMa.js`).then(e=>e.t);return{toast:e}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);t(e,{duration:4e3})}catch{console.error(e)}}function H(){let e=y(g([])),t=y(g([])),n=y(g([])),r=y(null),i=y(null),a=y(!1),o=y(g(L(new Date))),s=y(``),c=y(``),l=y(!1),d=y(!1),p=y(!1),m=y(null);async function h(h=u(o)){f(l,!0),f(p,!1),f(m,null);let g=te(h);try{let l=new Date,u=new Date(l.getFullYear(),l.getMonth(),l.getDate()),p=new Date(u);p.setDate(u.getDate()+1);let m=await C(g.start,g.end,u.toISOString(),p.toISOString());f(e,m.myOpenTasks,!0),f(t,m.completedToday??[],!0),f(n,m.meetings,!0),f(r,m.currentUserPersonId,!0),f(i,m.currentUserId??null,!0),f(a,m.openMode,!0),f(s,m.windowStart,!0),f(c,m.windowEnd,!0),f(o,h,!0),f(d,!0)}catch(e){console.error(`Failed to load home data:`,e),f(m,`Could not load your week`),f(d,!0)}finally{f(l,!1)}}function _(e){let t=z(e),n=new Date(t);n.setDate(t.getDate()+6),!u(s)||!u(c)||L(t)<u(s)||L(n)>u(c)?h(e):f(o,e,!0)}function v(){f(p,!0)}async function b(t,r,i,a){let o=u(e),s=u(n);r===`task`?f(e,u(e).map(e=>e.id===i&&e.repo===t?{...e,dueDate:a}:e),!0):r===`event`&&f(n,u(n).map(e=>e.id===i&&e.repo===t?{...e,date:a}:e),!0);try{await S(t,r,i,{data:{date:a}})}catch(t){throw f(e,o,!0),f(n,s,!0),await V(`Could not reschedule — change reverted`),t}}async function x(n,r){let i=u(e).find(e=>e.id===r&&e.repo===n),a=u(e),o=u(t);i&&(f(e,u(e).filter(e=>!(e.id===r&&e.repo===n)),!0),f(t,[...u(t),{...i,status:`done`,completedAt:new Date().toISOString()}],!0));try{await S(n,`task`,r,{data:{status:`done`}})}catch(n){throw f(e,a,!0),f(t,o,!0),await V(`Could not complete task — change reverted`),n}}async function w(n,r){let i=u(t).find(e=>e.id===r&&e.repo===n),a=u(e),o=u(t);if(i){f(t,u(t).filter(e=>!(e.id===r&&e.repo===n)),!0);let{completedAt:a,...o}=i;f(e,[...u(e),{...o,status:`todo`}],!0)}try{await S(n,`task`,r,{data:{status:`todo`}})}catch(n){throw f(e,a,!0),f(t,o,!0),await V(`Could not reopen task — change reverted`),n}}return{get myOpenTasks(){return u(e)},get completedToday(){return u(t)},get meetings(){return u(n)},get currentUserPersonId(){return u(r)},get currentUserId(){return u(i)},get openMode(){return u(a)},get anchorDate(){return u(o)},get loading(){return u(l)},get loaded(){return u(d)},get stale(){return u(p)},get error(){return u(m)},load:h,setWeek:_,markStale:v,rescheduleEntity:b,completeTask:x,uncompleteTask:w}}var U=H(),W=null;T.addEntityChangeHandler(e=>{e.entityType!==`event`&&e.entityType!==`task`||(W&&clearTimeout(W),W=setTimeout(()=>{W=null,U.load()},250))});var G=[{key:`name`,label:`Name`,filter:`text`},{key:`entity_type`,label:`Type`,filter:`enum`},{key:`folder`,label:`Folder`,filter:`enum`},{key:`updated_at`,label:`Updated`,filter:`date`,format:`date`}],K=[{key:`folder`,label:`Folder`,filter:`enum`},{key:`updated_at`,label:`Updated`,filter:`date`,format:`date`}],q=`__status__`,J={key:q,label:`Status`,filter:`enum`},Y={person:[{key:`name`,label:`Name`,filter:`text`},{key:`role`,label:`Role`,filter:`text`},{key:`category`,label:`Category`,filter:`enum`,sortOrder:{employee:0,contractor:1,client:2,partner:3,other:4}},{key:`status`,label:`Status`,filter:`enum`,sortOrder:{current:0,former:1}},{key:`email`,label:`Email`,filter:`text`},{key:`employer`,label:`Employer`,filter:`enum`,format:`wikilink`}],organization:[{key:`name`,label:`Name`,filter:`text`},{key:`category`,label:`Category`,filter:`enum`,sortOrder:{client:0,vendor:1,partner:2,prospect:3,"professional-association":4,other:5}},{key:`status`,label:`Status`,filter:`enum`,sortOrder:{active:0,dormant:1,former:2}},{key:`industry`,label:`Industry`,filter:`text`}],position:[{key:`name`,label:`Name`,filter:`text`},{key:`department`,label:`Department`,filter:`text`},{key:`category`,label:`Category`,filter:`enum`,sortOrder:{staff:0,contractor:1,intern:2}},{key:`status`,label:`Status`,filter:`enum`,sortOrder:{draft:0,open:1,filled:2,closed:3}}],deal:[{key:`name`,label:`Name`,filter:`text`},{key:`client`,label:`Client`,filter:`enum`,format:`wikilink`},{key:`contact`,label:`Contact`,filter:`enum`,format:`wikilink`},{key:`stage`,label:`Stage`,filter:`enum`,sortOrder:{qualification:0,scoping:1,proposal:2,negotiation:3,"pending-signature":4,won:5,lost:6}},{key:`deal_value`,label:`Value`,filter:`none`,format:`currency`},{key:`start_date`,label:`Start`,filter:`date`,format:`date`},{key:`date`,label:`Close date`,filter:`date`,format:`date`}],project:[{key:`name`,label:`Name`,filter:`text`},{key:`category`,label:`Category`,filter:`enum`,sortOrder:{client:0,internal:1}},{key:`client`,label:`Client`,filter:`text`,format:`wikilink`},{key:`services`,label:`Services`,filter:`text`,format:`wikilink`},{key:`status`,label:`Status`,filter:`enum`,sortOrder:{planning:0,"in-progress":1,paused:2,complete:3,archived:4}},{key:`start_date`,label:`Start`,filter:`date`,format:`date`},{key:`date`,label:`End date`,filter:`date`,format:`date`}],event:[{key:`name`,label:`Name`,filter:`text`},{key:`category`,label:`Category`,filter:`enum`,sortOrder:{meeting:0,call:1,review:2,workshop:3,presentation:4,conference:5,other:6}},{key:`attendees`,label:`Attendees`,filter:`text`,format:`wikilink`},{key:`location`,label:`Location`,filter:`text`},{key:`start_date`,label:`Start`,filter:`date`,format:`date`},{key:`date`,label:`Date`,filter:`date`,format:`date`}],task:[{key:`name`,label:`Name`,filter:`text`},{key:`status`,label:`Status`,filter:`enum`,sortOrder:{backlog:0,todo:1,"in-progress":2,"in-review":3,done:4,cancelled:5}},{key:`priority`,label:`Priority`,filter:`enum`,sortOrder:{urgent:0,high:1,medium:2,low:3}},{key:`assignee`,label:`Assignee`,filter:`enum`,format:`wikilink`},{key:`phase`,label:`Phase`,filter:`enum`},{key:`start_date`,label:`Start`,filter:`date`,format:`date`},{key:`date`,label:`Due date`,filter:`date`,format:`date`}],deliverable:[{key:`name`,label:`Name`,filter:`text`},{key:`parent_project`,label:`Parent project`,filter:`enum`,format:`wikilink`},{key:`status`,label:`Status`,filter:`enum`,sortOrder:{planned:0,"in-progress":1,delivered:2,accepted:3,rejected:4}},{key:`phase`,label:`Phase`,filter:`enum`},{key:`start_date`,label:`Start`,filter:`date`,format:`date`},{key:`date`,label:`Due date`,filter:`date`,format:`date`}],document:[{key:`name`,label:`Name`,filter:`text`},{key:`category`,label:`Category`,filter:`enum`,sortOrder:{proposal:0,contract:1,brief:2,memo:3,report:4,template:5,guideline:6,other:7}},{key:`status`,label:`Status`,filter:`enum`,sortOrder:{draft:0,review:1,final:2,archived:3}}],deck:[{key:`name`,label:`Name`,filter:`text`},{key:`audience`,label:`Audience`,filter:`enum`,sortOrder:{client:0,team:1,board:2,external:3,other:4}},{key:`status`,label:`Status`,filter:`enum`,sortOrder:{draft:0,review:1,final:2,archived:3}}],publication:[{key:`name`,label:`Name`,filter:`text`},{key:`platform`,label:`Platform`,filter:`enum`},{key:`status`,label:`Status`,filter:`enum`,sortOrder:{draft:0,review:1,scheduled:2,published:3}},{key:`date`,label:`Published`,filter:`date`,format:`date`},{key:`url`,label:`URL`,filter:`none`}],"case-study":[{key:`name`,label:`Name`,filter:`text`},{key:`client`,label:`Client`,filter:`enum`,format:`wikilink`},{key:`services`,label:`Services`,filter:`text`,format:`wikilink`},{key:`status`,label:`Status`,filter:`enum`,sortOrder:{draft:0,review:1,final:2,published:3}}],service:[{key:`name`,label:`Name`,filter:`text`},{key:`sprint`,label:`Sprint`,filter:`enum`,format:`wikilink`},{key:`status`,label:`Status`,filter:`enum`,sortOrder:{offered:0,"in-development":1,retired:2}},{key:`depends_on`,label:`Depends on`,filter:`text`,format:`wikilink`},{key:`enables`,label:`Enables`,filter:`text`,format:`wikilink`},{key:`deliverables`,label:`Deliverables`,filter:`text`}],skill:[{key:`name`,label:`Name`,filter:`text`},{key:`description`,label:`Description`,filter:`text`},{key:`applies_to`,label:`Applies to`,filter:`text`}],note:[{key:`name`,label:`Name`,filter:`text`}],reference:[{key:`name`,label:`Name`,filter:`text`},{key:`source`,label:`Source`,filter:`text`},{key:`link`,label:`URL`,filter:`none`}],asset:[{key:`name`,label:`Name`,filter:`text`},{key:`asset_kind`,label:`Kind`,filter:`enum`,sortOrder:{image:0,video:1,audio:2,pdf:3,spreadsheet:4,other:5}},{key:`asset_extension`,label:`Ext`,filter:`text`}]},X={person:[`category`,`employer`],organization:[`category`,`industry`],position:[`department`,`status`],project:[`client`,`date`],event:[`attendees`,`date`],task:[`assignee`,`date`],document:[`category`,`status`],deliverable:[`parent_project`,`date`],publication:[`platform`,`date`],deal:[`client`,`deal_value`],"case-study":[`client`,`status`],deck:[`audience`,`status`],service:[`sprint`,`status`],asset:[`asset_kind`,`asset_extension`],skill:[`description`,`applies_to`]};function re(e){return e?X[e]??[]:[]}var ie=new Set([`name`,`entity_type`,`entity_id`,`created_at`,`updated_at`,`created_by`,`updated_by`,`tags`,`date`]),ae=new Set([`tags`,`entity_type`,`folder`,`created_at`,`updated_at`]);function oe(e){return e in Y}function se(e,t){if(ae.has(t))return!0;let n=Y[e];return n?n.some(e=>e.key===t):!1}function ce(e,t){if(!e)return G;let n=Y[e];if(n)return[...n,...K];let r=[{key:`name`,label:`Name`,filter:`text`}];if(t)for(let e of t){if(ie.has(e))continue;let t=e.replace(/_/g,` `),n=t.charAt(0).toUpperCase()+t.slice(1),i=e.endsWith(`_date`)||e===`date`;r.push({key:e,label:n,filter:i?`date`:`text`,format:i?`date`:void 0})}return[...r,...K]}var Z={MINT:`#369770`,PISTACHIO:`#5A9A08`,SKY:`#4289C4`,TEAL:`#289795`,SAND:`#AB8630`,ORANGE:`#CC7013`,RED:`#FE3C3C`,ROSE:`#C06A6A`,LILAC:`#B267F3`,VIOLET:`#7C7CD9`,SLATE:`#718599`,PINK:`#DC6CD4`},Q={"person.category":{employee:Z.SKY,contractor:Z.SAND,client:Z.MINT,partner:Z.PISTACHIO,other:Z.SLATE},"person.status":{current:Z.MINT,former:Z.SLATE},"organization.category":{client:Z.SKY,vendor:Z.ROSE,partner:Z.PISTACHIO,prospect:Z.LILAC,"professional-association":Z.VIOLET,other:Z.ROSE},"organization.status":{active:Z.MINT,dormant:Z.SAND,former:Z.SLATE},"position.category":{staff:Z.SKY,contractor:Z.SAND,intern:Z.LILAC},"position.status":{draft:Z.LILAC,open:Z.SAND,filled:Z.MINT,closed:Z.SLATE},"deal.stage":{qualification:Z.LILAC,scoping:Z.SAND,proposal:Z.SKY,negotiation:Z.PISTACHIO,"pending-signature":Z.ORANGE,won:Z.MINT,lost:Z.RED},"project.category":{client:Z.SKY,internal:Z.ORANGE},"project.status":{planning:Z.LILAC,"in-progress":Z.SKY,paused:Z.ROSE,complete:Z.MINT,archived:Z.SLATE},"event.category":{meeting:Z.SKY,call:Z.PISTACHIO,review:Z.SAND,workshop:Z.ORANGE,presentation:Z.PINK,conference:Z.VIOLET,other:Z.SLATE},"task.status":{backlog:Z.SLATE,todo:Z.LILAC,"in-progress":Z.SKY,"in-review":Z.SAND,done:Z.MINT,cancelled:Z.ROSE},"task.priority":{urgent:Z.RED,high:Z.ORANGE,medium:Z.ROSE,low:Z.SLATE},"deliverable.status":{planned:Z.LILAC,"in-progress":Z.SKY,delivered:Z.PISTACHIO,accepted:Z.MINT,rejected:Z.RED},"document.category":{proposal:Z.SKY,contract:Z.TEAL,brief:Z.PINK,memo:Z.ROSE,report:Z.SLATE,template:Z.VIOLET,guideline:Z.PISTACHIO,other:Z.ROSE},"document.status":{draft:Z.LILAC,review:Z.SKY,final:Z.MINT,archived:Z.SLATE},"deck.audience":{client:Z.SKY,team:Z.PISTACHIO,board:Z.VIOLET,external:Z.ORANGE,other:Z.SLATE},"deck.status":{draft:Z.LILAC,review:Z.SKY,final:Z.MINT,archived:Z.SLATE},"publication.status":{draft:Z.LILAC,review:Z.SKY,scheduled:Z.PISTACHIO,published:Z.MINT},"case-study.status":{draft:Z.LILAC,review:Z.SKY,final:Z.PISTACHIO,published:Z.MINT},"service.status":{offered:Z.MINT,"in-development":Z.SAND,retired:Z.SLATE},"asset.asset_kind":{image:Z.SKY,video:Z.PINK,audio:Z.VIOLET,pdf:Z.RED,spreadsheet:Z.PISTACHIO,other:Z.SLATE}};function le(e,t,n){return Q[`${e}.${t}`]?.[n]}function $(e){return e===`deal`?`stage`:Q[`${e}.status`]?`status`:null}function ue(e){switch(e.toLowerCase()){case`active`:case`current`:case`won`:case`done`:case`complete`:case`accepted`:case`final`:case`published`:case`offered`:case`filled`:return Z.MINT;case`in-progress`:case`in-review`:case`review`:case`proposal`:return Z.SKY;case`open`:case`scoping`:case`planning`:case`qualification`:case`in-development`:case`dormant`:return Z.SAND;case`todo`:case`draft`:case`backlog`:return Z.LILAC;case`lost`:case`rejected`:return Z.RED;case`former`:case`cancelled`:case`paused`:case`closed`:return Z.ROSE;case`archived`:case`retired`:return Z.SLATE;default:return Z.SLATE}}export{M as _,re as a,le as c,U as d,B as f,I as g,L as h,ce as i,oe as l,z as m,q as n,ue as o,ne as p,Q as r,$ as s,J as t,se as u,E as v};
@@ -1 +1 @@
1
- import{Y as e,_t as t,mt as n,yt as r}from"./iPCkjliu.js";import{n as i}from"./JCjEwqH9.js";import{i as a,r as o}from"./BcDgRHTK.js";import{t as s}from"./D3Q44JkU.js";function c(e,t){let n=encodeURIComponent(e);return t?`/workspace/folder/${n}/${t.split(`/`).map(encodeURIComponent).join(`/`)}`:`/workspace/folder/${n}`}function l(e,t){if(!t)return e;let n=t.split(`/`),r=e;for(let e of n){let t=r.find(t=>t.name===e);if(!t)return[];r=t.children}return r}var u=/^\[\[(.+)\]\]$/,d=`user:`;function f(e){if(typeof e!=`string`)return null;let t=e.trim();if(!t)return null;let n=t.match(u);n&&(t=n[1].trim());let r,i=t.indexOf(`|`);if(i>=0&&(r=t.slice(i+1).trim()||void 0,t=t.slice(0,i).trim()),!t)return null;if(t.startsWith(d)){let e=t.slice(5).trim();return e?{kind:`user`,userId:e,handle:(r??``).replace(/^@/,``).trim()||void 0,label:r}:null}let a;if(t.includes(`/`)){let e=t.split(`/`);t=(e.pop()??``).trim();let n=e.join(`/`).trim();n&&(a=n)}return t?{kind:`entity`,id:t,repo:a,label:r}:null}function p(e,t){let n=String(e).trim(),r=(t??``).replace(/^@/,``).trim();return r?`[[user:${n}|@${r}]]`:`[[user:${n}]]`}var m=r(n([])),h=r(n({})),g=r(n({}));async function _(){try{let{users:e}=await i(`/api/auth/users`);t(m,e,!0);let n={},r={};for(let t of e)n[t.handle]=t,r[String(t.id)]=t;t(h,n,!0),t(g,r,!0)}catch{}}function v(t){return t?e(h)[t]??null:null}function y(t){let n=String(t).trim();return n?e(g)[n]??null:null}function b(e){let t=f(e);if(t?.kind!==`user`)return null;let n=y(t.userId);return n?n.displayName:t.handle?`@${t.handle}`:t.userId}_(),s.addConnectHandler(()=>_());var x={getByHandle:v,getById:y,resolveUserRefName:b,load:_,get users(){return e(m)}};function S(e){let t=e.replace(/^\[\[|\]\]$/g,``).split(`|`)[0].trim();if(!t)return null;for(let e of a.repos){let n=e.entities.find(e=>e.id===t);if(n)return{id:n.id,title:n.title,entityType:n.entityType,repo:e.name,url:`/${e.name}/${n.entityType}/${n.id}`}}let n=t.indexOf(`/`);if(n>0){let e=t.slice(0,n),r=t.slice(n+1),i=a.repos.find(t=>t.name===e);if(i&&r){let n=i.subfolders,a;for(let e of r.split(`/`)){if(a=n.find(t=>t.name===e),!a)break;n=a.children}if(a)return{id:t,title:a.displayName??o(a.name),entityType:`folder`,repo:e,url:c(e,r)}}}return null}function C(e){if(!e)return[];let t=e.replace(/\[\[|\]\]/g,``).split(`,`).map(e=>e.trim()).filter(Boolean),n=[];for(let e of t){let t=S(e);t&&n.push(t)}return n}function w(e){let t=e.replace(/^\[\[|\]\]$/g,``),n=t.split(`|`)[0].trim();if(n.startsWith(`user:`))return x.resolveUserRefName(t)??n.slice(5);let r=t.indexOf(`|`);if(r!==-1){let e=t.slice(r+1).trim();if(e)return e}return n.replace(/-/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function T(e){let t=[],n=/\[\[([^\]]+)\]\]/g,r=0,i;for(;i=n.exec(e);){i.index>r&&t.push({type:`text`,value:e.slice(r,i.index)});let n=S(i[1]);t.push(n?{type:`ref`,value:n.title,id:n.id,url:n.url}:{type:`ref`,value:w(i[1]),id:i[1].split(`|`)[0].trim(),url:null}),r=i.index+i[0].length}return r<e.length&&t.push({type:`text`,value:e.slice(r)}),t}var E=/[\s([\-—*_~]/;function D(e){return!e||E.test(e)}function O(e,t){let n=D(t);return e===`"`?n?`“`:`”`:n?`‘`:`’`}function k(e,t=``){if(!e)return e;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(i===`"`||i===`'`){let e=n.length?n[n.length-1]:t;n+=O(i,e)}else n+=i}return n}var A=`\xA0`;function j(e){return e&&e.replace(/([‘“])[ \t]/g,`$1${A}`).replace(/[ \t]([’”])/g,`${A}$1`)}function M(e){if(!e)return e;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(r===`"`||r===`'`){t+=O(r,t[t.length-1]??``);continue}if(r===`-`&&e[n+1]===`-`){let r=e[n+2]??``;if(r!==`-`&&!/[A-Za-z0-9_]/.test(r)){t+=`—`,n++;continue}}t+=r}return t}export{w as a,T as c,f as d,l as f,k as i,x as l,j as n,S as o,c as p,D as r,C as s,M as t,p as u};
1
+ import{Y as e,_t as t,mt as n,yt as r}from"./iPCkjliu.js";import{n as i}from"./JCjEwqH9.js";import{i as a,r as o}from"./gZQwV3Fq.js";import{t as s}from"./C6GeXy2x.js";function c(e,t){let n=encodeURIComponent(e);return t?`/workspace/folder/${n}/${t.split(`/`).map(encodeURIComponent).join(`/`)}`:`/workspace/folder/${n}`}function l(e,t){if(!t)return e;let n=t.split(`/`),r=e;for(let e of n){let t=r.find(t=>t.name===e);if(!t)return[];r=t.children}return r}var u=/^\[\[(.+)\]\]$/,d=`user:`;function f(e){if(typeof e!=`string`)return null;let t=e.trim();if(!t)return null;let n=t.match(u);n&&(t=n[1].trim());let r,i=t.indexOf(`|`);if(i>=0&&(r=t.slice(i+1).trim()||void 0,t=t.slice(0,i).trim()),!t)return null;if(t.startsWith(d)){let e=t.slice(5).trim();return e?{kind:`user`,userId:e,handle:(r??``).replace(/^@/,``).trim()||void 0,label:r}:null}let a;if(t.includes(`/`)){let e=t.split(`/`);t=(e.pop()??``).trim();let n=e.join(`/`).trim();n&&(a=n)}return t?{kind:`entity`,id:t,repo:a,label:r}:null}function p(e,t){let n=String(e).trim(),r=(t??``).replace(/^@/,``).trim();return r?`[[user:${n}|@${r}]]`:`[[user:${n}]]`}var m=r(n([])),h=r(n({})),g=r(n({}));async function _(){try{let{users:e}=await i(`/api/auth/users`);t(m,e,!0);let n={},r={};for(let t of e)n[t.handle]=t,r[String(t.id)]=t;t(h,n,!0),t(g,r,!0)}catch{}}function v(t){return t?e(h)[t]??null:null}function y(t){let n=String(t).trim();return n?e(g)[n]??null:null}function b(e){let t=f(e);if(t?.kind!==`user`)return null;let n=y(t.userId);return n?n.displayName:t.handle?`@${t.handle}`:t.userId}_(),s.addConnectHandler(()=>_());var x={getByHandle:v,getById:y,resolveUserRefName:b,load:_,get users(){return e(m)}};function S(e){let t=e.replace(/^\[\[|\]\]$/g,``).split(`|`)[0].trim();if(!t)return null;for(let e of a.repos){let n=e.entities.find(e=>e.id===t);if(n)return{id:n.id,title:n.title,entityType:n.entityType,repo:e.name,url:`/${e.name}/${n.entityType}/${n.id}`}}let n=t.indexOf(`/`);if(n>0){let e=t.slice(0,n),r=t.slice(n+1),i=a.repos.find(t=>t.name===e);if(i&&r){let n=i.subfolders,a;for(let e of r.split(`/`)){if(a=n.find(t=>t.name===e),!a)break;n=a.children}if(a)return{id:t,title:a.displayName??o(a.name),entityType:`folder`,repo:e,url:c(e,r)}}}return null}function C(e){if(!e)return[];let t=e.replace(/\[\[|\]\]/g,``).split(`,`).map(e=>e.trim()).filter(Boolean),n=[];for(let e of t){let t=S(e);t&&n.push(t)}return n}function w(e){let t=e.replace(/^\[\[|\]\]$/g,``),n=t.split(`|`)[0].trim();if(n.startsWith(`user:`))return x.resolveUserRefName(t)??n.slice(5);let r=t.indexOf(`|`);if(r!==-1){let e=t.slice(r+1).trim();if(e)return e}return n.replace(/-/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function T(e){let t=[],n=/\[\[([^\]]+)\]\]/g,r=0,i;for(;i=n.exec(e);){i.index>r&&t.push({type:`text`,value:e.slice(r,i.index)});let n=S(i[1]);t.push(n?{type:`ref`,value:n.title,id:n.id,url:n.url}:{type:`ref`,value:w(i[1]),id:i[1].split(`|`)[0].trim(),url:null}),r=i.index+i[0].length}return r<e.length&&t.push({type:`text`,value:e.slice(r)}),t}var E=/[\s([\-—*_~]/;function D(e){return!e||E.test(e)}function O(e,t){let n=D(t);return e===`"`?n?`“`:`”`:n?`‘`:`’`}function k(e,t=``){if(!e)return e;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(i===`"`||i===`'`){let e=n.length?n[n.length-1]:t;n+=O(i,e)}else n+=i}return n}var A=`\xA0`;function j(e){return e&&e.replace(/([‘“])[ \t]/g,`$1${A}`).replace(/[ \t]([’”])/g,`${A}$1`)}function M(e){if(!e)return e;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(r===`"`||r===`'`){t+=O(r,t[t.length-1]??``);continue}if(r===`-`&&e[n+1]===`-`){let r=e[n+2]??``;if(r!==`-`&&!/[A-Za-z0-9_]/.test(r)){t+=`—`,n++;continue}}t+=r}return t}export{w as a,T as c,f as d,l as f,k as i,x as l,j as n,S as o,c as p,D as r,C as s,M as t,p as u};
@@ -1 +1 @@
1
- import"./iPCkjliu.js";import{s as e}from"./CixKNc3T.js";var t=()=>{let t=e;return{page:{subscribe:t.page.subscribe},navigating:{subscribe:t.navigating.subscribe},updated:t.updated}},n={subscribe(e){return t().page.subscribe(e)}},r={subscribe(e){return t().navigating.subscribe(e)}};export{n,r as t};
1
+ import"./iPCkjliu.js";import{s as e}from"./C8k8ISFi.js";var t=()=>{let t=e;return{page:{subscribe:t.page.subscribe},navigating:{subscribe:t.navigating.subscribe},updated:t.updated}},n={subscribe(e){return t().page.subscribe(e)}},r={subscribe(e){return t().navigating.subscribe(e)}};export{n,r as t};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Wowi_89k.js","./iPCkjliu.js","./D3JoMtWC.js","./Ds2T2cSU.js","./B-Z_xZy_.js","./D3Q44JkU.js","./CixKNc3T.js","./kNaey6uv.js","./BI1QnJpF.js","./JCjEwqH9.js","./yAxYDEMa.js","./CK8tIaYT.js","./xihTtKlq.js","./BDIUHcEz.js","../assets/dist.DDCWxn3B.css","./D3ch71s_.js","./DSSa3YBM.js","./BcDgRHTK.js","./CoHaBDpN.js","./BoglwbZW.js","./CTwRLVH0.js","./B2n86UNJ.js","./C8Ar3dLv.js","./Bqm_YrIg2.js","./BBGt-XQo.js","./BADt8daH.js","./CEniyZ1Z2.js","./BoDmwOTJ2.js","./DqVNW14M.js","./CHfsxCjb2.js","./BJgOZTHR.js","./aTepn3vZ.js","./CJHSUZEP2.js","../assets/list-columns.BgnafZ4K.css","./rbhlO_t8.js"])))=>i.map(i=>d[i]);
2
- import{At as e,B as t,Bt as n,D as r,Gt as i,I as a,L as o,M as s,Mt as c,Nt as l,P as u,Q as d,R as f,St as p,Ut as m,V as h,Y as g,_t as _,at as v,b as y,bt as b,dt as x,ft as S,h as C,k as w,mt as T,n as ee,o as E,ot as D,pt as te,r as ne,s as O,st as re,u as ie,y as k,yt as A}from"./iPCkjliu.js";import{t as j}from"./kNaey6uv.js";import"./xihTtKlq.js";import{i as ae}from"./BcDgRHTK.js";import{C as oe,Dt as se,Et as ce,H as le,Mt as M,Ot as N,Q as ue,R as P,W as de,X as fe,Y as pe,Z as me,_t as F,b as I,dt as L,kt as R,lt as z,nt as he,pt as B,r as ge,ut as _e,vt as ve,xt as ye,yt as be}from"./BgRT-K6w.js";import{N as xe}from"./DqZzYIcH.js";import{n as Se,s as Ce,t as V}from"./De0g5qop2.js";import{l as we}from"./CY0iY_WO.js";import{n as Te,t as Ee}from"./C8Ar3dLv.js";import{m as De,p as Oe}from"./Wowi_89k.js";import{a as ke,r as H,t as Ae}from"./D3JoMtWC.js";import{r as je,t as Me}from"./DqVNW14M.js";import{o as Ne}from"./BADt8daH.js";import{t as Pe}from"./BBGt-XQo.js";import{n as Fe}from"./B2n86UNJ.js";import{t as Ie}from"./CTwRLVH0.js";function Le(e,t){return e-t*Math.floor(e/t)}var Re=1721426;function ze(e,t,n,r){t=Ve(e,t);let i=t-1,a=-2;return n<=2?a=0:Be(t)&&(a=-1),Re-1+365*i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400)+Math.floor((367*n-362)/12+a+r)}function Be(e){return e%4==0&&(e%100!=0||e%400==0)}function Ve(e,t){return e===`BC`?1-t:t}function He(e){let t=`AD`;return e<=0&&(t=`BC`,e=1-e),[t,e]}var Ue={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]},We=class{fromJulianDay(e){let t=e,n=t-Re,r=Math.floor(n/146097),i=Le(n,146097),a=Math.floor(i/36524),o=Le(i,36524),s=Math.floor(o/1461),c=Le(o,1461),l=Math.floor(c/365),[u,d]=He(r*400+a*100+s*4+l+ +(a!==4&&l!==4)),f=t-ze(u,d,1,1),p=2;t<ze(u,d,3,1)?p=0:Be(d)&&(p=1);let m=Math.floor(((f+p)*12+373)/367);return new on(u,d,m,t-ze(u,d,m,1)+1)}toJulianDay(e){return ze(e.era,e.year,e.month,e.day)}getDaysInMonth(e){return Ue[Be(e.year)?`leapyear`:`standard`][e.month-1]}getMonthsInYear(e){return 12}getDaysInYear(e){return Be(e.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(e){return 9999}getEras(){return[`BC`,`AD`]}isInverseEra(e){return e.era===`BC`}balanceDate(e){e.year<=0&&(e.era=e.era===`BC`?`AD`:`BC`,e.year=1-e.year)}constructor(){this.identifier=`gregory`}},Ge={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function U(e,t){return t=J(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function Ke(e,t){return t=J(t,e.calendar),e=at(e),t=at(t),e.era===t.era&&e.year===t.year&&e.month===t.month}function qe(e,t){return e.isEqual?.(t)??t.isEqual?.(e)??e.identifier===t.identifier}function Je(e,t){return U(e,Qe(t))}var Ye={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function Xe(e,t,n){let r=e.calendar.toJulianDay(e),i=n?Ye[n]:ut(t),a=Math.ceil(r+1-i)%7;return a<0&&(a+=7),a}function Ze(e){return q(Date.now(),e)}function Qe(e){return bt(Ze(e))}function $e(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function et(e,t){return tt(e)-tt(t)}function tt(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}var nt=null,rt=!1;function W(){return nt??=new Intl.DateTimeFormat().resolvedOptions().timeZone,nt}function it(){return rt}function at(e){return e.subtract({days:e.day-1})}function ot(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}var st=new Map,ct=new Map;function lt(e){if(Intl.Locale){let t=st.get(e);return t||(t=new Intl.Locale(e).maximize().region,t&&st.set(e,t)),t}let t=e.split(`-`)[1];return t===`u`?void 0:t}function ut(e){let t=ct.get(e);if(!t){if(Intl.Locale){let n=new Intl.Locale(e);if(`getWeekInfo`in n&&(t=n.getWeekInfo(),t))return ct.set(e,t),t.firstDay}let n=lt(e);if(e.includes(`-fw-`)){let n=e.split(`-fw-`)[1].split(`-`)[0];t=n===`mon`?{firstDay:1}:n===`tue`?{firstDay:2}:n===`wed`?{firstDay:3}:n===`thu`?{firstDay:4}:n===`fri`?{firstDay:5}:n===`sat`?{firstDay:6}:{firstDay:0}}else t=e.includes(`-ca-iso8601`)?{firstDay:1}:{firstDay:n&&Ge[n]||0};ct.set(e,t)}return t.firstDay}function G(e){return e=J(e,new We),dt(Ve(e.era,e.year),e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function dt(e,t,n,r,i,a,o){let s=new Date;return s.setUTCHours(r,i,a,o),s.setUTCFullYear(e,t-1,n),s.getTime()}function ft(e,t){if(t===`UTC`)return 0;if(e>0&&t===W()&&!it())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:i,hour:a,minute:o,second:s}=mt(e,t);return dt(n,r,i,a,o,s,0)-Math.floor(e/1e3)*1e3}var pt=new Map;function mt(e,t){let n=pt.get(t);n||(n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,hour12:!1,era:`short`,year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`}),pt.set(t,n));let r=n.formatToParts(new Date(e)),i={};for(let e of r)e.type!==`literal`&&(i[e.type]=e.value);return{year:i.era===`BC`||i.era===`B`?-i.year+1:+i.year,month:+i.month,day:+i.day,hour:i.hour===`24`?0:+i.hour,minute:+i.minute,second:+i.second}}var ht=864e5;function gt(e,t){let n=G(e);return _t(e,t,n-ft(n-ht,t),n-ft(n+ht,t))}function _t(e,t,n,r){return(n===r?[n]:[n,r]).filter(n=>vt(e,t,n))}function vt(e,t,n){let r=mt(n,t);return e.year===r.year&&e.month===r.month&&e.day===r.day&&e.hour===r.hour&&e.minute===r.minute&&e.second===r.second}function K(e,t,n=`compatible`){let r=xt(e);if(t===`UTC`)return G(r);if(t===W()&&n===`compatible`&&!it()){r=J(r,new We);let e=new Date,t=Ve(r.era,r.year);return e.setFullYear(t,r.month-1,r.day),e.setHours(r.hour,r.minute,r.second,r.millisecond),e.getTime()}let i=G(r),a=ft(i-ht,t),o=ft(i+ht,t),s=_t(r,t,i-a,i-o);if(s.length===1)return s[0];if(s.length>1)switch(n){case`compatible`:case`earlier`:return s[0];case`later`:return s[s.length-1];case`reject`:throw RangeError(`Multiple possible absolute times found`)}switch(n){case`earlier`:return Math.min(i-a,i-o);case`compatible`:case`later`:return Math.max(i-a,i-o);case`reject`:throw RangeError(`No such absolute time found`)}}function yt(e,t,n=`compatible`){return new Date(K(e,t,n))}function q(e,t){let n=ft(e,t),r=new Date(e+n),i=r.getUTCFullYear(),a=r.getUTCMonth()+1,o=r.getUTCDate(),s=r.getUTCHours(),c=r.getUTCMinutes(),l=r.getUTCSeconds(),u=r.getUTCMilliseconds();return new cn(i<1?`BC`:`AD`,i<1?-i+1:i,a,o,t,n,s,c,l,u)}function bt(e){return new on(e.calendar,e.era,e.year,e.month,e.day)}function xt(e,t){let n=0,r=0,i=0,a=0;if(`timeZone`in e)({hour:n,minute:r,second:i,millisecond:a}=e);else if(`hour`in e&&!t)return e;return t&&({hour:n,minute:r,second:i,millisecond:a}=t),new sn(e.calendar,e.era,e.year,e.month,e.day,n,r,i,a)}function J(e,t){if(qe(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,jt(r),r}function St(e,t,n){return e instanceof cn?e.timeZone===t?e:wt(e,t):q(K(e,t,n),t)}function Ct(e){let t=G(e)-e.offset;return new Date(t)}function wt(e,t){return J(q(G(e)-e.offset,t),e.calendar)}var Tt=36e5;function Et(e,t){let n=e.copy(),r=`hour`in n?zt(n,t):0;Dt(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,Ot(n),At(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=r,kt(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let i=n.calendar.getYearsInEra(n);if(n.year>i){let e=n.calendar.isInverseEra?.(n);n.year=i,n.month=e?1:n.calendar.getMonthsInYear(n),n.day=e?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let a=n.calendar.getMonthsInYear(n);return n.month>a&&(n.month=a,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function Dt(e,t){e.calendar.isInverseEra?.(e)&&(t=-t),e.year+=t}function Ot(e){for(;e.month<1;)Dt(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,Dt(e,1)}function kt(e){for(;e.day<1;)e.month--,Ot(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,Ot(e)}function At(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function jt(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),At(e)}function Mt(e){let t={};for(let n in e)typeof e[n]==`number`&&(t[n]=-e[n]);return t}function Nt(e,t){return Et(e,Mt(t))}function Pt(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),jt(n),n}function Ft(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),Lt(n),n}function It(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=Rt(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=Rt(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=Rt(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=Rt(e.hour,24),t}function Lt(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function Rt(e,t){let n=e%t;return n<0&&(n+=t),n}function zt(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,It(e)}function Bt(e,t,n,r){let i=e.copy();switch(t){case`era`:{let t=e.calendar.getEras(),a=t.indexOf(e.era);if(a<0)throw Error(`Invalid era: `+e.era);a=Y(a,n,0,t.length-1,r?.round),i.era=t[a],jt(i);break}case`year`:i.calendar.isInverseEra?.(i)&&(n=-n),i.year=Y(e.year,n,-1/0,9999,r?.round),i.year===-1/0&&(i.year=1),i.calendar.balanceYearMonth&&i.calendar.balanceYearMonth(i,e);break;case`month`:i.month=Y(e.month,n,1,e.calendar.getMonthsInYear(e),r?.round);break;case`day`:i.day=Y(e.day,n,1,e.calendar.getDaysInMonth(e),r?.round);break;default:throw Error(`Unsupported field `+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(i),jt(i),i}function Vt(e,t,n,r){let i=e.copy();switch(t){case`hour`:{let t=e.hour,a=0,o=23;if(r?.hourCycle===12){let e=t>=12;a=e?12:0,o=e?23:11}i.hour=Y(t,n,a,o,r?.round);break}case`minute`:i.minute=Y(e.minute,n,0,59,r?.round);break;case`second`:i.second=Y(e.second,n,0,59,r?.round);break;case`millisecond`:i.millisecond=Y(e.millisecond,n,0,999,r?.round);break;default:throw Error(`Unsupported field `+t)}return i}function Y(e,t,n,r,i=!1){if(i){e+=Math.sign(t),e<n&&(e=r);let i=Math.abs(t);e=t>0?Math.ceil(e/i)*i:Math.floor(e/i)*i,e>r&&(e=n)}else e+=t,e<n?e=r-(n-e-1):e>r&&(e=n+(e-r-1));return e}function Ht(e,t){let n;return n=t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0?K(Et(xt(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days}),e.timeZone):G(e)-e.offset,n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5,J(q(n,e.timeZone),e.calendar)}function Ut(e,t){return Ht(e,Mt(t))}function Wt(e,t,n,r){switch(t){case`hour`:{let t=0,i=23;if(r?.hourCycle===12){let n=e.hour>=12;t=n?12:0,i=n?23:11}let a=xt(e),o=J(Ft(a,{hour:t}),new We),s=[K(o,e.timeZone,`earlier`),K(o,e.timeZone,`later`)].filter(t=>q(t,e.timeZone).day===o.day)[0],c=J(Ft(a,{hour:i}),new We),l=[K(c,e.timeZone,`earlier`),K(c,e.timeZone,`later`)].filter(t=>q(t,e.timeZone).day===c.day).pop(),u=G(e)-e.offset,d=Math.floor(u/Tt),f=u%Tt;return u=Y(d,n,Math.floor(s/Tt),Math.floor(l/Tt),r?.round)*Tt+f,J(q(u,e.timeZone),e.calendar)}case`minute`:case`second`:case`millisecond`:return Vt(e,t,n,r);case`era`:case`year`:case`month`:case`day`:return J(q(K(Bt(xt(e),t,n,r),e.timeZone),e.timeZone),e.calendar);default:throw Error(`Unsupported field `+t)}}function Gt(e,t,n){let r=xt(e),i=Ft(Pt(r,t),t);return i.compare(r)===0?e:J(q(K(i,e.timeZone,n),e.timeZone),e.calendar)}var Kt=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/,qt=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/,Jt=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:([+-]\d{2})(?::?(\d{2}))?(?::?(\d{2}))?)?\[(.*?)\]$/,Yt=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;function Xt(e){let t=e.match(Kt);if(!t)throw Yt.test(e)?Error(`Invalid ISO 8601 date string: ${e}. Use parseAbsolute() instead.`):Error(`Invalid ISO 8601 date string: `+e);let n=new on(X(t[1],0,9999),X(t[2],1,12),1);return n.day=X(t[3],1,n.calendar.getDaysInMonth(n)),n}function Zt(e){let t=e.match(qt);if(!t)throw Yt.test(e)?Error(`Invalid ISO 8601 date time string: ${e}. Use parseAbsolute() instead.`):Error(`Invalid ISO 8601 date time string: `+e);let n=X(t[1],-9999,9999),r=new sn(n<1?`BC`:`AD`,n<1?-n+1:n,X(t[2],1,12),1,t[4]?X(t[4],0,23):0,t[5]?X(t[5],0,59):0,t[6]?X(t[6],0,59):0,t[7]?X(t[7],0,1/0)*1e3:0);return r.day=X(t[3],0,r.calendar.getDaysInMonth(r)),r}function Qt(e,t){let n=e.match(Jt);if(!n)throw Error(`Invalid ISO 8601 date time string: `+e);let r=X(n[1],-9999,9999),i=new cn(r<1?`BC`:`AD`,r<1?-r+1:r,X(n[2],1,12),1,n[11],0,n[4]?X(n[4],0,23):0,n[5]?X(n[5],0,59):0,n[6]?X(n[6],0,59):0,n[7]?X(n[7],0,1/0)*1e3:0);i.day=X(n[3],0,i.calendar.getDaysInMonth(i));let a=xt(i),o;if(n[8]){let e=X(n[8],-23,23);if(i.offset=Math.sign(e)*(Math.abs(e)*36e5+X(n[9]??`0`,0,59)*6e4+X(n[10]??`0`,0,59)*1e3),o=G(i)-i.offset,!gt(a,i.timeZone).includes(o))throw Error(`Offset ${nn(i.offset)} is invalid for ${tn(i)} in ${i.timeZone}`)}else o=K(xt(a),i.timeZone,t);return q(o,i.timeZone)}function X(e,t,n){let r=Number(e);if(r<t||r>n)throw RangeError(`Value out of range: ${t} <= ${r} <= ${n}`);return r}function $t(e){return`${String(e.hour).padStart(2,`0`)}:${String(e.minute).padStart(2,`0`)}:${String(e.second).padStart(2,`0`)}${e.millisecond?String(e.millisecond/1e3).slice(1):``}`}function en(e){let t=J(e,new We),n;return n=t.era===`BC`?t.year===1?`0000`:`-`+String(Math.abs(1-t.year)).padStart(6,`00`):String(t.year).padStart(4,`0`),`${n}-${String(t.month).padStart(2,`0`)}-${String(t.day).padStart(2,`0`)}`}function tn(e){return`${en(e)}T${$t(e)}`}function nn(e){let t=Math.sign(e)<0?`-`:`+`;e=Math.abs(e);let n=Math.floor(e/36e5),r=Math.floor(e%36e5/6e4),i=Math.floor(e%36e5%6e4/1e3),a=`${t}${String(n).padStart(2,`0`)}:${String(r).padStart(2,`0`)}`;return i!==0&&(a+=`:${String(i).padStart(2,`0`)}`),a}function rn(e){return`${tn(e)}${nn(e.offset)}[${e.timeZone}]`}function an(e){let t=typeof e[0]==`object`?e.shift():new We,n;if(typeof e[0]==`string`)n=e.shift();else{let e=t.getEras();n=e[e.length-1]}let r=e.shift(),i=e.shift(),a=e.shift();return[t,n,r,i,a]}var on=class e{constructor(...e){let[t,n,r,i,a]=an(e);this.calendar=t,this.era=n,this.year=r,this.month=i,this.day=a,jt(this)}copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day):new e(this.calendar,this.year,this.month,this.day)}add(e){return Et(this,e)}subtract(e){return Nt(this,e)}set(e){return Pt(this,e)}cycle(e,t,n){return Bt(this,e,t,n)}toDate(e){return yt(this,e)}toString(){return en(this)}compare(e){return $e(this,e)}},sn=class e{constructor(...e){let[t,n,r,i,a]=an(e);this.calendar=t,this.era=n,this.year=r,this.month=i,this.day=a,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,jt(this)}copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new e(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(e){return Et(this,e)}subtract(e){return Nt(this,e)}set(e){return Pt(Ft(this,e),e)}cycle(e,t,n){switch(e){case`era`:case`year`:case`month`:case`day`:return Bt(this,e,t,n);default:return Vt(this,e,t,n)}}toDate(e,t){return yt(this,e,t)}toString(){return tn(this)}compare(e){let t=$e(this,e);return t===0?et(this,xt(e)):t}},cn=class e{constructor(...e){let[t,n,r,i,a]=an(e),o=e.shift(),s=e.shift();this.calendar=t,this.era=n,this.year=r,this.month=i,this.day=a,this.timeZone=o,this.offset=s,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,jt(this)}copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new e(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(e){return Ht(this,e)}subtract(e){return Ut(this,e)}set(e,t){return Gt(this,e,t)}cycle(e,t,n){return Wt(this,e,t,n)}toDate(){return Ct(this)}toString(){return rn(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(e){return this.toDate().getTime()-St(e,this.timeZone).toDate().getTime()}},ln=new Map,Z=class{constructor(e,t={}){this.formatter=dn(e,t),this.options=t}format(e){return this.formatter.format(e)}formatToParts(e){return this.formatter.formatToParts(e)}formatRange(e,t){if(typeof this.formatter.formatRange==`function`)return this.formatter.formatRange(e,t);if(t<e)throw RangeError(`End date must be >= start date`);return`${this.formatter.format(e)} \u{2013} ${this.formatter.format(t)}`}formatRangeToParts(e,t){if(typeof this.formatter.formatRangeToParts==`function`)return this.formatter.formatRangeToParts(e,t);if(t<e)throw RangeError(`End date must be >= start date`);let n=this.formatter.formatToParts(e),r=this.formatter.formatToParts(t);return[...n.map(e=>({...e,source:`startRange`})),{type:`literal`,value:` – `,source:`shared`},...r.map(e=>({...e,source:`endRange`}))]}resolvedOptions(){let e=this.formatter.resolvedOptions();return hn()&&(this.resolvedHourCycle||=gn(e.locale,this.options),e.hourCycle=this.resolvedHourCycle,e.hour12=this.resolvedHourCycle===`h11`||this.resolvedHourCycle===`h12`),e.calendar===`ethiopic-amete-alem`&&(e.calendar=`ethioaa`),e}},un={true:{ja:`h11`},false:{}};function dn(e,t={}){if(typeof t.hour12==`boolean`&&pn()){t={...t};let n=un[String(t.hour12)][e.split(`-`)[0]],r=t.hour12?`h12`:`h23`;t.hourCycle=n??r,delete t.hour12}let n=e+(t?Object.entries(t).sort((e,t)=>e[0]<t[0]?-1:1).join():``);if(ln.has(n))return ln.get(n);let r=new Intl.DateTimeFormat(e,t);return ln.set(n,r),r}var fn=null;function pn(){return fn??=new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,hour12:!1}).format(new Date(2020,2,3,0))===`24`,fn}var mn=null;function hn(){return mn??=new Intl.DateTimeFormat(`fr`,{hour:`numeric`,hour12:!1}).resolvedOptions().hourCycle===`h12`,mn}function gn(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,``),e+=(e.includes(`-u-`)?``:`-u`)+`-nu-latn`;let n=dn(e,{...t,timeZone:void 0}),r=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(e=>e.type===`hour`).value,10),i=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(e=>e.type===`hour`).value,10);if(r===0&&i===23)return`h23`;if(r===24&&i===23)return`h24`;if(r===0&&i===11)return`h11`;if(r===12&&i===11)return`h12`;throw Error(`Unexpected hour cycle result`)}function _n(e){if(!le||!e)return null;let t=e.querySelector(`[data-bits-announcer]`),n=t=>{let n=e.createElement(`div`);return n.role=`log`,n.ariaLive=t,n.setAttribute(`aria-relevant`,`additions`),n};if(!de(t)){let r=e.createElement(`div`);r.style.cssText=xe,r.setAttribute(`data-bits-announcer`,``),r.appendChild(n(`assertive`)),r.appendChild(n(`polite`)),t=r,e.body.insertBefore(t,e.body.firstChild)}return{getLog:e=>{if(!de(t))return null;let n=t.querySelector(`[aria-live="${e}"]`);return de(n)?n:null}}}function vn(e){let t=_n(e);function n(n,r=`assertive`,i=7500){if(!t||!le||!e)return;let a=t.getLog(r),o=e.createElement(`div`);return n=typeof n==`number`?n.toString():n===null?`Empty`:n.trim(),o.innerText=n,r===`assertive`?a?.replaceChildren(o):a?.appendChild(o),setTimeout(()=>{o.remove()},i)}return{announce:n}}var yn={defaultValue:void 0,granularity:`day`};function bn(e){let{defaultValue:t,granularity:n,minValue:r,maxValue:i}={...yn,...e};if(Array.isArray(t)&&t.length)return t[t.length-1];if(t&&!Array.isArray(t))return t;{let e=new Date;r&&e<r.toDate(W())?e=r.toDate(W()):i&&e>i.toDate(W())&&(e=i.toDate(W()));let t=e.getFullYear(),a=e.getMonth()+1,o=e.getDate();return[`hour`,`minute`,`second`].includes(n??`day`)?new sn(t,a,o,0,0,0):new on(t,a,o)}}function xn(e,t){let n;return n=t instanceof cn?Qt(e):t instanceof sn?Zt(e):Xt(e),n.calendar===t.calendar?n:J(n,t.calendar)}function Q(e,t=W()){return e instanceof cn?e.toDate():e.toDate(t)}function Sn(e){if(e instanceof on)return`date`;if(e instanceof sn)return`datetime`;if(e instanceof cn)return`zoneddatetime`;throw Error(`Unknown date type`)}function Cn(e,t){switch(t){case`date`:return Xt(e);case`datetime`:return Zt(e);case`zoneddatetime`:return Qt(e);default:throw Error(`Unknown date type: ${t}`)}}function wn(e){return e instanceof sn}function Tn(e){return e instanceof cn}function En(e){return wn(e)||Tn(e)}function Dn(e){if(e instanceof Date){let t=e.getFullYear(),n=e.getMonth()+1;return new Date(t,n,0).getDate()}else return e.set({day:100}).day}function On(e,t){return e.compare(t)<0}function kn(e,t){return e.compare(t)>0}function An(e,t,n){let r=Xe(e,n);return t>r?e.subtract({days:r+7-t}):t===r?e:e.subtract({days:r-t})}function jn(e,t,n){let r=Xe(e,n),i=t===0?6:t-1;return r===i?e:r>i?e.add({days:7-r+i}):e.add({days:i-r})}var Mn={year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`};function Nn(e){let t=e.initialLocale;function n(e){t=e}function r(){return t}function i(e,n){return new Z(t,n).format(e)}function a(e,t=!0){return En(e)&&t?i(Q(e),{dateStyle:`long`,timeStyle:`long`}):i(Q(e),{dateStyle:`long`})}function o(n){return typeof e.monthFormat.current!=`function`&&typeof e.yearFormat.current!=`function`?new Z(t,{month:e.monthFormat.current,year:e.yearFormat.current}).format(n):`${typeof e.monthFormat.current==`function`?e.monthFormat.current(n.getMonth()+1):new Z(t,{month:e.monthFormat.current}).format(n)} ${typeof e.yearFormat.current==`function`?e.yearFormat.current(n.getFullYear()):new Z(t,{year:e.yearFormat.current}).format(n)}`}function s(e){return new Z(t,{month:`long`}).format(e)}function c(e){return new Z(t,{year:`numeric`}).format(e)}function l(e,n){return Tn(e)?new Z(t,{...n,timeZone:e.timeZone}).formatToParts(Q(e)):new Z(t,n).formatToParts(Q(e))}function u(e,n=`narrow`){return new Z(t,{weekday:n}).format(e)}function d(e,n=void 0){return new Z(t,{hour:`numeric`,minute:`numeric`,hourCycle:n===24?`h23`:void 0}).formatToParts(e).find(e=>e.type===`dayPeriod`)?.value===`PM`?`PM`:`AM`}function f(e,t,n={}){let r=l(e,{...Mn,...n}).find(e=>e.type===t);return r?r.value:``}return{setLocale:n,getLocale:r,fullMonth:s,fullYear:c,fullMonthAndYear:o,toParts:l,custom:i,part:f,dayPeriod:d,selectedDate:a,dayOfWeek:u}}function Pn(e){return!(!de(e)||!e.hasAttribute(`data-bits-day`))}function Fn(e,t){let n=[],r=e.add({days:1}),i=t;for(;r.compare(i)<0;)n.push(r),r=r.add({days:1});return n}function In(e){let{dateObj:t,weekStartsOn:n,fixedWeeks:r,locale:i}=e,a=Dn(t),o=Array.from({length:a},(e,n)=>t.set({day:n+1})),s=at(t),c=ot(t),l=n===void 0?An(s,0,i):An(s,n,`en-US`),u=n===void 0?jn(c,0,i):jn(c,n,`en-US`),d=Fn(l.subtract({days:1}),s),f=Fn(c,u.add({days:1})),p=d.length+o.length+f.length;if(r&&p<42){let e=42-p,n=f[f.length-1];n||=t.add({months:1}).set({day:1});let r=e;f.length===0&&(r=e-1,f.push(n));let i=Array.from({length:r},(e,t)=>{let r=t+1;return n.add({days:r})});f.push(...i)}let m=d.concat(o,f);return{value:t,dates:m,weeks:I(m,7)}}function Ln(e){let{numberOfMonths:t,dateObj:n,...r}=e,i=[];if(!t||t===1)return i.push(In({...r,dateObj:n})),i;i.push(In({...r,dateObj:n}));for(let e=1;e<t;e++){let t=n.add({months:e});i.push(In({...r,dateObj:t}))}return i}function Rn(e){return e?Array.from(e.querySelectorAll(`[data-bits-day]:not([data-disabled]):not([data-outside-visible-months])`)).filter(e=>de(e)):[]}function zn(e,t){let n=e.getAttribute(`data-value`);n&&(t.current=xn(n,t.current))}function Bn({node:e,add:t,placeholder:n,calendarNode:r,isPrevButtonDisabled:i,isNextButtonDisabled:a,months:o,numberOfMonths:s}){let c=Rn(r);if(!c.length)return;let l=c.indexOf(e)+t;if(oe(l,c)){let e=c[l];return zn(e,n),e.focus()}if(l<0){if(i)return;let e=o[0]?.value;if(!e)return;n.current=e.subtract({months:s}),ye(()=>{let e=Rn(r);if(!e.length)return;let t=e.length-Math.abs(l);if(oe(t,e)){let r=e[t];return zn(r,n),r.focus()}})}if(l>=c.length){if(a)return;let e=o[0]?.value;if(!e)return;n.current=e.add({months:s}),ye(()=>{let e=Rn(r);if(!e.length)return;let t=l-c.length;if(oe(t,e))return e[t].focus()})}}var Vn=[pe,ue,fe,me],Hn=[he,` `];function Un({event:e,handleCellClick:t,shiftFocus:n,placeholderValue:r}){let i=e.target;if(!Pn(i)||!Vn.includes(e.key)&&!Hn.includes(e.key))return;e.preventDefault();let a={[pe]:7,[ue]:-7,[fe]:-1,[me]:1};if(Vn.includes(e.key)){let t=a[e.key];t!==void 0&&n(i,t)}if(Hn.includes(e.key)){let n=i.getAttribute(`data-value`);if(!n)return;t(e,xn(n,r))}}function Wn({months:e,setMonths:t,numberOfMonths:n,pagedNavigation:r,weekStartsOn:i,locale:a,fixedWeeks:o,setPlaceholder:s}){let c=e[0]?.value;if(c)if(r)s(c.add({months:n}));else{let e=c.add({months:1}),r=Ln({dateObj:e,weekStartsOn:i,locale:a,fixedWeeks:o,numberOfMonths:n});s(e),t(r)}}function Gn({months:e,setMonths:t,numberOfMonths:n,pagedNavigation:r,weekStartsOn:i,locale:a,fixedWeeks:o,setPlaceholder:s}){let c=e[0]?.value;if(c)if(r)s(c.subtract({months:n}));else{let e=c.subtract({months:1}),r=Ln({dateObj:e,weekStartsOn:i,locale:a,fixedWeeks:o,numberOfMonths:n});s(e),t(r)}}function Kn({months:e,formatter:t,weekdayFormat:n}){if(!e.length)return[];let r=e[0].weeks[0];return r?r.map(e=>t.dayOfWeek(Q(e),n)):[]}function qn(e){D(()=>{let t=e.weekStartsOn.current,n=e.locale.current,r=e.fixedWeeks.current,i=e.numberOfMonths.current;d(()=>{let a=e.placeholder.current;if(!a)return;let o={weekStartsOn:t,locale:n,fixedWeeks:r,numberOfMonths:i};e.setMonths(Ln({...o,dateObj:a}))})})}function Jn({calendarNode:e,label:t,accessibleHeadingId:n}){let r=be(e),i=r.createElement(`div`);i.style.cssText=R({border:`0px`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(50%)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0px`,position:`absolute`,whiteSpace:`nowrap`,width:`1px`});let a=r.createElement(`div`);return a.textContent=t,a.id=n,a.role=`heading`,a.ariaLevel=`2`,e.insertBefore(i,e.firstChild),i.appendChild(a),()=>{let e=r.getElementById(n);e&&(i.parentElement?.removeChild(i),e.remove())}}function Yn({placeholder:e,getVisibleMonths:t,weekStartsOn:n,locale:r,fixedWeeks:i,numberOfMonths:a,setMonths:o}){D(()=>{e.current,d(()=>{t().some(t=>Ke(t,e.current))||o(Ln({weekStartsOn:n.current,locale:r.current,fixedWeeks:i.current,numberOfMonths:a.current,dateObj:e.current}))})})}function Xn({maxValue:e,months:t,disabled:n}){if(!e||!t.length)return!1;if(n)return!0;let r=t[t.length-1]?.value;return r?kn(r.add({months:1}).set({day:1}),e):!1}function Zn({minValue:e,months:t,disabled:n}){if(!e||!t.length)return!1;if(n)return!0;let r=t[0]?.value;return r?On(r.subtract({months:1}).set({day:35}),e):!1}function Qn({months:e,locale:t,formatter:n}){if(!e.length)return``;if(t!==n.getLocale()&&n.setLocale(t),e.length===1){let t=Q(e[0].value);return`${n.fullMonthAndYear(t)}`}let r=Q(e[0].value),i=Q(e[e.length-1].value),a=n.fullMonth(r),o=n.fullMonth(i),s=n.fullYear(r),c=n.fullYear(i);return s===c?`${a} - ${o} ${c}`:`${a} ${s} - ${o} ${c}`}function $n({fullCalendarLabel:e,id:t,isInvalid:n,disabled:r,readonly:i}){return{id:t,role:`application`,"aria-label":e,"data-invalid":z(n),"data-disabled":z(r),"data-readonly":z(i)}}function er(e){let t=be(e.target).querySelector(`[data-bits-day][data-focused]`);t&&(e.preventDefault(),t?.focus())}function tr(e){if(!le)return;let t=Array.from(e.querySelectorAll(`[data-bits-day]:not([aria-disabled=true])`));if(t.length===0)return;let n=t[0],r=n?.getAttribute(`data-value`),i=n?.getAttribute(`data-type`);if(!(!r||!i))return Cn(r,i)}function nr({ref:e,placeholder:t,defaultPlaceholder:n,minValue:r,maxValue:i,isDateDisabled:a}){function o(e){return!!(a.current(e)||r.current&&On(e,r.current)||i.current&&On(i.current,e))}ce(()=>e.current,()=>{e.current&&t.current&&U(t.current,n)&&o(n)&&(t.current=tr(e.current)??n)})}function rr(e,t){return!e||!t?e:En(e)&&En(t)?e.set({hour:t.hour,minute:t.minute,millisecond:t.millisecond,second:t.second}):e}var ir=B({component:`calendar`,parts:[`root`,`grid`,`cell`,`next-button`,`prev-button`,`day`,`grid-body`,`grid-head`,`grid-row`,`head-cell`,`header`,`heading`,`month-select`,`year-select`]});function ar(e){let t=new Date().getFullYear(),n=Math.max(e.placeholderYear,t),r,i;if(e.minValue)r=e.minValue.year;else{let t=n-100;r=e.placeholderYear<t?e.placeholderYear-10:t}i=e.maxValue?e.maxValue.year:n+10,r>i&&(r=i);let a=i-r+1;return Array.from({length:a},(e,t)=>r+t)}var $=new se(`Calendar.Root | RangeCalender.Root`),or=class e{static create(t){return $.set(new e(t))}opts;#e=p(()=>this.months.map(e=>e.value));get visibleMonths(){return g(this.#e)}set visibleMonths(e){_(this.#e,e)}formatter;accessibleHeadingId=ge();domContext;attachment;#t=A(T([]));get months(){return g(this.#t)}set months(e){_(this.#t,e,!0)}announcer;constructor(e){this.opts=e,this.attachment=F(this.opts.ref),this.domContext=new ve(e.ref),this.announcer=vn(null),this.formatter=Nn({initialLocale:this.opts.locale.current,monthFormat:this.opts.monthFormat,yearFormat:this.opts.yearFormat}),this.setMonths=this.setMonths.bind(this),this.nextPage=this.nextPage.bind(this),this.prevPage=this.prevPage.bind(this),this.prevYear=this.prevYear.bind(this),this.nextYear=this.nextYear.bind(this),this.setYear=this.setYear.bind(this),this.setMonth=this.setMonth.bind(this),this.isOutsideVisibleMonths=this.isOutsideVisibleMonths.bind(this),this.isDateDisabled=this.isDateDisabled.bind(this),this.isDateSelected=this.isDateSelected.bind(this),this.shiftFocus=this.shiftFocus.bind(this),this.handleCellClick=this.handleCellClick.bind(this),this.handleMultipleUpdate=this.handleMultipleUpdate.bind(this),this.handleSingleUpdate=this.handleSingleUpdate.bind(this),this.onkeydown=this.onkeydown.bind(this),this.getBitsAttr=this.getBitsAttr.bind(this),ne(()=>{this.announcer=vn(this.domContext.getDocument())}),this.months=Ln({dateObj:this.opts.placeholder.current,weekStartsOn:this.opts.weekStartsOn.current,locale:this.opts.locale.current,fixedWeeks:this.opts.fixedWeeks.current,numberOfMonths:this.opts.numberOfMonths.current}),this.#a(),this.#o(),this.#s(),Yn({placeholder:this.opts.placeholder,getVisibleMonths:()=>this.visibleMonths,weekStartsOn:this.opts.weekStartsOn,locale:this.opts.locale,fixedWeeks:this.opts.fixedWeeks,numberOfMonths:this.opts.numberOfMonths,setMonths:e=>this.months=e}),qn({fixedWeeks:this.opts.fixedWeeks,locale:this.opts.locale,numberOfMonths:this.opts.numberOfMonths,placeholder:this.opts.placeholder,setMonths:this.setMonths,weekStartsOn:this.opts.weekStartsOn}),ce(()=>this.fullCalendarLabel,e=>{let t=this.domContext.getElementById(this.accessibleHeadingId);t&&(t.textContent=e)}),ce(()=>this.opts.value.current,()=>{let e=this.opts.value.current;if(Array.isArray(e)&&e.length){let t=e[e.length-1];t&&this.opts.placeholder.current!==t&&(this.opts.placeholder.current=t)}else !Array.isArray(e)&&e&&this.opts.placeholder.current!==e&&(this.opts.placeholder.current=e)}),nr({placeholder:e.placeholder,defaultPlaceholder:e.defaultPlaceholder,isDateDisabled:e.isDateDisabled,maxValue:e.maxValue,minValue:e.minValue,ref:e.ref})}setMonths(e){this.months=e}#n=p(()=>Kn({months:this.months,formatter:this.formatter,weekdayFormat:this.opts.weekdayFormat.current}));get weekdays(){return g(this.#n)}set weekdays(e){_(this.#n,e)}#r=p(()=>d(()=>this.opts.placeholder.current.year));get initialPlaceholderYear(){return g(this.#r)}set initialPlaceholderYear(e){_(this.#r,e)}#i=p(()=>ar({minValue:this.opts.minValue.current,maxValue:this.opts.maxValue.current,placeholderYear:this.initialPlaceholderYear}));get defaultYears(){return g(this.#i)}set defaultYears(e){_(this.#i,e)}#a(){D(()=>{if(d(()=>this.opts.initialFocus.current)){let e=this.opts.ref.current?.querySelector(`[data-focused]`);e&&e.focus()}})}#o(){D(()=>{if(this.opts.ref.current)return Jn({calendarNode:this.opts.ref.current,label:this.fullCalendarLabel,accessibleHeadingId:this.accessibleHeadingId})})}#s(){re(()=>{this.formatter.getLocale()!==this.opts.locale.current&&this.formatter.setLocale(this.opts.locale.current)})}nextPage(){Wn({fixedWeeks:this.opts.fixedWeeks.current,locale:this.opts.locale.current,numberOfMonths:this.opts.numberOfMonths.current,pagedNavigation:this.opts.pagedNavigation.current,setMonths:this.setMonths,setPlaceholder:e=>this.opts.placeholder.current=e,weekStartsOn:this.opts.weekStartsOn.current,months:this.months})}prevPage(){Gn({fixedWeeks:this.opts.fixedWeeks.current,locale:this.opts.locale.current,numberOfMonths:this.opts.numberOfMonths.current,pagedNavigation:this.opts.pagedNavigation.current,setMonths:this.setMonths,setPlaceholder:e=>this.opts.placeholder.current=e,weekStartsOn:this.opts.weekStartsOn.current,months:this.months})}nextYear(){this.opts.placeholder.current=this.opts.placeholder.current.add({years:1})}prevYear(){this.opts.placeholder.current=this.opts.placeholder.current.subtract({years:1})}setYear(e){this.opts.placeholder.current=this.opts.placeholder.current.set({year:e})}setMonth(e){this.opts.placeholder.current=this.opts.placeholder.current.set({month:e})}#c=p(()=>Xn({maxValue:this.opts.maxValue.current,months:this.months,disabled:this.opts.disabled.current}));get isNextButtonDisabled(){return g(this.#c)}set isNextButtonDisabled(e){_(this.#c,e)}#l=p(()=>Zn({minValue:this.opts.minValue.current,months:this.months,disabled:this.opts.disabled.current}));get isPrevButtonDisabled(){return g(this.#l)}set isPrevButtonDisabled(e){_(this.#l,e)}#u=p(()=>{let e=this.opts.value.current,t=this.opts.isDateDisabled.current,n=this.opts.isDateUnavailable.current;if(Array.isArray(e)){if(!e.length)return!1;for(let r of e)if(t(r)||n(r))return!0}else{if(!e)return!1;if(t(e)||n(e))return!0}return!1});get isInvalid(){return g(this.#u)}set isInvalid(e){_(this.#u,e)}#d=p(()=>(this.opts.monthFormat.current,this.opts.yearFormat.current,Qn({months:this.months,formatter:this.formatter,locale:this.opts.locale.current})));get headingValue(){return g(this.#d)}set headingValue(e){_(this.#d,e)}#f=p(()=>`${this.opts.calendarLabel.current} ${this.headingValue}`);get fullCalendarLabel(){return g(this.#f)}set fullCalendarLabel(e){_(this.#f,e)}isOutsideVisibleMonths(e){return!this.visibleMonths.some(t=>Ke(e,t))}isDateDisabled(e){if(this.opts.isDateDisabled.current(e)||this.opts.disabled.current)return!0;let t=this.opts.minValue.current,n=this.opts.maxValue.current;return!!(t&&On(e,t)||n&&On(n,e))}isDateSelected(e){let t=this.opts.value.current;return Array.isArray(t)?t.some(t=>U(t,e)):t?U(t,e):!1}shiftFocus(e,t){return Bn({node:e,add:t,placeholder:this.opts.placeholder,calendarNode:this.opts.ref.current,isPrevButtonDisabled:this.isPrevButtonDisabled,isNextButtonDisabled:this.isNextButtonDisabled,months:this.months,numberOfMonths:this.opts.numberOfMonths.current})}#p(e){if(this.opts.type.current!==`multiple`||!this.opts.maxDays.current)return!0;let t=e.length;return!(this.opts.maxDays.current&&t>this.opts.maxDays.current)}handleCellClick(e,t){if(this.opts.readonly.current||this.opts.isDateDisabled.current?.(t)||this.opts.isDateUnavailable.current?.(t))return;let n=this.opts.value.current;if(this.opts.type.current===`multiple`)(Array.isArray(n)||n===void 0)&&(this.opts.value.current=this.handleMultipleUpdate(n,t));else if(!Array.isArray(n)){let e=this.handleSingleUpdate(n,t);e?this.announcer.announce(`Selected Date: ${this.formatter.selectedDate(e,!1)}`,`polite`):this.announcer.announce(`Selected date is now empty.`,`polite`,5e3),this.opts.value.current=rr(e,n),e!==void 0&&this.opts.onDateSelect?.current?.()}}handleMultipleUpdate(e,t){if(!e){let e=[t];return this.#p(e)?e:[t]}if(!Array.isArray(e))return;let n=e.findIndex(e=>U(e,t)),r=this.opts.preventDeselect.current;if(n===-1){let n=[...e,t];return this.#p(n)?n:[t]}else if(r)return e;else{let n=e.filter(e=>!U(e,t));if(!n.length){this.opts.placeholder.current=t;return}return n}}handleSingleUpdate(e,t){if(!e)return t;if(!this.opts.preventDeselect.current&&U(e,t)){this.opts.placeholder.current=t;return}return t}onkeydown(e){Un({event:e,handleCellClick:this.handleCellClick,shiftFocus:this.shiftFocus,placeholderValue:this.opts.placeholder.current})}#m=p(()=>({months:this.months,weekdays:this.weekdays}));get snippetProps(){return g(this.#m)}set snippetProps(e){_(this.#m,e)}getBitsAttr=e=>ir.getAttr(e);#h=p(()=>({...$n({fullCalendarLabel:this.fullCalendarLabel,id:this.opts.id.current,isInvalid:this.isInvalid,disabled:this.opts.disabled.current,readonly:this.opts.readonly.current}),[this.getBitsAttr(`root`)]:``,onkeydown:this.onkeydown,...this.attachment}));get props(){return g(this.#h)}set props(e){_(this.#h,e)}},sr=class e{static create(t){return new e(t,$.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=F(this.opts.ref)}#e=p(()=>({id:this.opts.id.current,"aria-hidden":L(!0),"data-disabled":z(this.root.opts.disabled.current),"data-readonly":z(this.root.opts.readonly.current),[this.root.getBitsAttr(`heading`)]:``,...this.attachment}));get props(){return g(this.#e)}set props(e){_(this.#e,e)}},cr=new se(`Calendar.Cell | RangeCalendar.Cell`),lr=class e{static create(t){return cr.set(new e(t,$.get()))}opts;root;#e=p(()=>Q(this.opts.date.current));get cellDate(){return g(this.#e)}set cellDate(e){_(this.#e,e)}#t=p(()=>this.root.opts.isDateUnavailable.current(this.opts.date.current));get isUnavailable(){return g(this.#t)}set isUnavailable(e){_(this.#t,e)}#n=p(()=>Je(this.opts.date.current,W()));get isDateToday(){return g(this.#n)}set isDateToday(e){_(this.#n,e)}#r=p(()=>!Ke(this.opts.date.current,this.opts.month.current));get isOutsideMonth(){return g(this.#r)}set isOutsideMonth(e){_(this.#r,e)}#i=p(()=>this.root.isOutsideVisibleMonths(this.opts.date.current));get isOutsideVisibleMonths(){return g(this.#i)}set isOutsideVisibleMonths(e){_(this.#i,e)}#a=p(()=>this.root.isDateDisabled(this.opts.date.current)||this.isOutsideMonth&&this.root.opts.disableDaysOutsideMonth.current);get isDisabled(){return g(this.#a)}set isDisabled(e){_(this.#a,e)}#o=p(()=>U(this.opts.date.current,this.root.opts.placeholder.current));get isFocusedDate(){return g(this.#o)}set isFocusedDate(e){_(this.#o,e)}#s=p(()=>this.root.isDateSelected(this.opts.date.current));get isSelectedDate(){return g(this.#s)}set isSelectedDate(e){_(this.#s,e)}#c=p(()=>this.root.formatter.custom(this.cellDate,{weekday:`long`,month:`long`,day:`numeric`,year:`numeric`}));get labelText(){return g(this.#c)}set labelText(e){_(this.#c,e)}attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=F(this.opts.ref)}#l=p(()=>({disabled:this.isDisabled,unavailable:this.isUnavailable,selected:this.isSelectedDate,day:`${this.opts.date.current.day}`}));get snippetProps(){return g(this.#l)}set snippetProps(e){_(this.#l,e)}#u=p(()=>this.isDisabled||this.isOutsideMonth&&this.root.opts.disableDaysOutsideMonth.current||this.isUnavailable);get ariaDisabled(){return g(this.#u)}set ariaDisabled(e){_(this.#u,e)}#d=p(()=>({"data-unavailable":z(this.isUnavailable),"data-today":this.isDateToday?``:void 0,"data-outside-month":this.isOutsideMonth?``:void 0,"data-outside-visible-months":this.isOutsideVisibleMonths?``:void 0,"data-focused":this.isFocusedDate?``:void 0,"data-selected":z(this.isSelectedDate),"data-value":this.opts.date.current.toString(),"data-type":Sn(this.opts.date.current),"data-disabled":z(this.isDisabled||this.isOutsideMonth&&this.root.opts.disableDaysOutsideMonth.current)}));get sharedDataAttrs(){return g(this.#d)}set sharedDataAttrs(e){_(this.#d,e)}#f=p(()=>({id:this.opts.id.current,role:`gridcell`,"aria-selected":_e(this.isSelectedDate),"aria-disabled":_e(this.ariaDisabled),...this.sharedDataAttrs,[this.root.getBitsAttr(`cell`)]:``,...this.attachment}));get props(){return g(this.#f)}set props(e){_(this.#f,e)}},ur=class e{static create(t){return new e(t,cr.get())}opts;cell;attachment;constructor(e,t){this.opts=e,this.cell=t,this.onclick=this.onclick.bind(this),this.attachment=F(this.opts.ref)}#e=p(()=>this.cell.isOutsideMonth&&this.cell.root.opts.disableDaysOutsideMonth.current||this.cell.isDisabled?void 0:this.cell.isFocusedDate?0:-1);onclick(e){this.cell.isDisabled||this.cell.root.handleCellClick(e,this.cell.opts.date.current)}#t=p(()=>({disabled:this.cell.isDisabled,unavailable:this.cell.isUnavailable,selected:this.cell.isSelectedDate,day:`${this.cell.opts.date.current.day}`}));get snippetProps(){return g(this.#t)}set snippetProps(e){_(this.#t,e)}#n=p(()=>({id:this.opts.id.current,role:`button`,"aria-label":this.cell.labelText,"aria-disabled":_e(this.cell.ariaDisabled),...this.cell.sharedDataAttrs,tabindex:g(this.#e),[this.cell.root.getBitsAttr(`day`)]:``,"data-bits-day":``,onclick:this.onclick,...this.attachment}));get props(){return g(this.#n)}set props(e){_(this.#n,e)}},dr=class e{static create(t){return new e(t,$.get())}opts;root;#e=p(()=>this.root.isNextButtonDisabled);get isDisabled(){return g(this.#e)}set isDisabled(e){_(this.#e,e)}attachment;constructor(e,t){this.opts=e,this.root=t,this.onclick=this.onclick.bind(this),this.attachment=F(this.opts.ref)}onclick(e){this.isDisabled||this.root.nextPage()}#t=p(()=>({id:this.opts.id.current,role:`button`,type:`button`,"aria-label":`Next`,"aria-disabled":_e(this.isDisabled),"data-disabled":z(this.isDisabled),disabled:this.isDisabled,[this.root.getBitsAttr(`next-button`)]:``,onclick:this.onclick,...this.attachment}));get props(){return g(this.#t)}set props(e){_(this.#t,e)}},fr=class e{static create(t){return new e(t,$.get())}opts;root;#e=p(()=>this.root.isPrevButtonDisabled);get isDisabled(){return g(this.#e)}set isDisabled(e){_(this.#e,e)}attachment;constructor(e,t){this.opts=e,this.root=t,this.onclick=this.onclick.bind(this),this.attachment=F(this.opts.ref)}onclick(e){this.isDisabled||this.root.prevPage()}#t=p(()=>({id:this.opts.id.current,role:`button`,type:`button`,"aria-label":`Previous`,"aria-disabled":_e(this.isDisabled),"data-disabled":z(this.isDisabled),disabled:this.isDisabled,[this.root.getBitsAttr(`prev-button`)]:``,onclick:this.onclick,...this.attachment}));get props(){return g(this.#t)}set props(e){_(this.#t,e)}},pr=class e{static create(t){return new e(t,$.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=F(this.opts.ref)}#e=p(()=>({id:this.opts.id.current,tabindex:-1,role:`grid`,"aria-readonly":_e(this.root.opts.readonly.current),"aria-disabled":_e(this.root.opts.disabled.current),"data-readonly":z(this.root.opts.readonly.current),"data-disabled":z(this.root.opts.disabled.current),[this.root.getBitsAttr(`grid`)]:``,...this.attachment}));get props(){return g(this.#e)}set props(e){_(this.#e,e)}},mr=class e{static create(t){return new e(t,$.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=F(this.opts.ref)}#e=p(()=>({id:this.opts.id.current,"data-disabled":z(this.root.opts.disabled.current),"data-readonly":z(this.root.opts.readonly.current),[this.root.getBitsAttr(`grid-body`)]:``,...this.attachment}));get props(){return g(this.#e)}set props(e){_(this.#e,e)}},hr=class e{static create(t){return new e(t,$.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=F(this.opts.ref)}#e=p(()=>({id:this.opts.id.current,"data-disabled":z(this.root.opts.disabled.current),"data-readonly":z(this.root.opts.readonly.current),[this.root.getBitsAttr(`grid-head`)]:``,...this.attachment}));get props(){return g(this.#e)}set props(e){_(this.#e,e)}},gr=class e{static create(t){return new e(t,$.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=F(this.opts.ref)}#e=p(()=>({id:this.opts.id.current,"data-disabled":z(this.root.opts.disabled.current),"data-readonly":z(this.root.opts.readonly.current),[this.root.getBitsAttr(`grid-row`)]:``,...this.attachment}));get props(){return g(this.#e)}set props(e){_(this.#e,e)}},_r=class e{static create(t){return new e(t,$.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=F(this.opts.ref)}#e=p(()=>({id:this.opts.id.current,"data-disabled":z(this.root.opts.disabled.current),"data-readonly":z(this.root.opts.readonly.current),[this.root.getBitsAttr(`head-cell`)]:``,...this.attachment}));get props(){return g(this.#e)}set props(e){_(this.#e,e)}},vr=f(`<div><!></div>`);function yr(e,i){let d=t();l(i,!0);let f=E(i,`ref`,15,null),_=E(i,`id`,19,()=>P(d)),y=O(i,[`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`]),b=ur.create({id:M(()=>_()),ref:M(()=>f(),e=>f(e))}),w=p(()=>N(y,b.props));var T=o(),ee=S(T),D=e=>{var t=o(),n=S(t);{let e=p(()=>({props:g(w),...b.snippetProps}));r(n,()=>i.child,()=>g(e))}a(e,t)},te=e=>{var t=vr();C(t,()=>({...g(w)}));var c=x(t),l=e=>{var t=o();r(S(t),()=>i.children??m,()=>b.snippetProps),a(e,t)},d=e=>{var t=h();v(()=>u(t,b.cell.opts.date.current.day)),a(e,t)};s(c,e=>{i.children?e(l):e(d,-1)}),n(t),a(e,t)};s(ee,e=>{i.child?e(D):e(te,-1)}),a(e,T),c()}var br=f(`<table><!></table>`);function xr(e,i){let u=t();l(i,!0);let d=E(i,`ref`,15,null),f=E(i,`id`,19,()=>P(u)),h=O(i,[`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`]),_=pr.create({id:M(()=>f()),ref:M(()=>d(),e=>d(e))}),v=p(()=>N(h,_.props));var y=o(),b=S(y),w=e=>{var t=o();r(S(t),()=>i.child,()=>({props:g(v)})),a(e,t)},T=e=>{var t=br();C(t,()=>({...g(v)})),r(x(t),()=>i.children??m),n(t),a(e,t)};s(b,e=>{i.child?e(w):e(T,-1)}),a(e,y),c()}var Sr=f(`<tbody><!></tbody>`);function Cr(e,i){let u=t();l(i,!0);let d=E(i,`ref`,15,null),f=E(i,`id`,19,()=>P(u)),h=O(i,[`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`]),_=mr.create({id:M(()=>f()),ref:M(()=>d(),e=>d(e))}),v=p(()=>N(h,_.props));var y=o(),b=S(y),w=e=>{var t=o();r(S(t),()=>i.child,()=>({props:g(v)})),a(e,t)},T=e=>{var t=Sr();C(t,()=>({...g(v)})),r(x(t),()=>i.children??m),n(t),a(e,t)};s(b,e=>{i.child?e(w):e(T,-1)}),a(e,y),c()}var wr=f(`<td><!></td>`);function Tr(e,i){let u=t();l(i,!0);let d=E(i,`ref`,15,null),f=E(i,`id`,19,()=>P(u)),h=O(i,[`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`,`date`,`month`]),_=lr.create({id:M(()=>f()),ref:M(()=>d(),e=>d(e)),date:M(()=>i.date),month:M(()=>i.month)}),v=p(()=>N(h,_.props));var y=o(),b=S(y),w=e=>{var t=o(),n=S(t);{let e=p(()=>({props:g(v),..._.snippetProps}));r(n,()=>i.child,()=>g(e))}a(e,t)},T=e=>{var t=wr();C(t,()=>({...g(v)})),r(x(t),()=>i.children??m,()=>_.snippetProps),n(t),a(e,t)};s(b,e=>{i.child?e(w):e(T,-1)}),a(e,y),c()}var Er=f(`<thead><!></thead>`);function Dr(e,i){let u=t();l(i,!0);let d=E(i,`ref`,15,null),f=E(i,`id`,19,()=>P(u)),h=O(i,[`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`]),_=hr.create({id:M(()=>f()),ref:M(()=>d(),e=>d(e))}),v=p(()=>N(h,_.props));var y=o(),b=S(y),w=e=>{var t=o();r(S(t),()=>i.child,()=>({props:g(v)})),a(e,t)},T=e=>{var t=Er();C(t,()=>({...g(v)})),r(x(t),()=>i.children??m),n(t),a(e,t)};s(b,e=>{i.child?e(w):e(T,-1)}),a(e,y),c()}var Or=f(`<th><!></th>`);function kr(e,i){let u=t();l(i,!0);let d=E(i,`ref`,15,null),f=E(i,`id`,19,()=>P(u)),h=O(i,[`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`]),_=_r.create({id:M(()=>f()),ref:M(()=>d(),e=>d(e))}),v=p(()=>N(h,_.props));var y=o(),b=S(y),w=e=>{var t=o();r(S(t),()=>i.child,()=>({props:g(v)})),a(e,t)},T=e=>{var t=Or();C(t,()=>({...g(v)})),r(x(t),()=>i.children??m),n(t),a(e,t)};s(b,e=>{i.child?e(w):e(T,-1)}),a(e,y),c()}var Ar=f(`<tr><!></tr>`);function jr(e,i){let u=t();l(i,!0);let d=E(i,`ref`,15,null),f=E(i,`id`,19,()=>P(u)),h=O(i,[`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`]),_=gr.create({id:M(()=>f()),ref:M(()=>d(),e=>d(e))}),v=p(()=>N(h,_.props));var y=o(),b=S(y),w=e=>{var t=o();r(S(t),()=>i.child,()=>({props:g(v)})),a(e,t)},T=e=>{var t=Ar();C(t,()=>({...g(v)})),r(x(t),()=>i.children??m),n(t),a(e,t)};s(b,e=>{i.child?e(w):e(T,-1)}),a(e,y),c()}var Mr=f(`<div><!></div>`);function Nr(e,i){let d=t();l(i,!0);let f=E(i,`ref`,15,null),_=E(i,`id`,19,()=>P(d)),y=O(i,[`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`]),b=sr.create({id:M(()=>_()),ref:M(()=>f(),e=>f(e))}),w=p(()=>N(y,b.props));var T=o(),ee=S(T),D=e=>{var t=o();r(S(t),()=>i.child,()=>({props:g(w),headingValue:b.root.headingValue})),a(e,t)},te=e=>{var t=Mr();C(t,()=>({...g(w)}));var c=x(t),l=e=>{var t=o();r(S(t),()=>i.children??m,()=>({headingValue:b.root.headingValue})),a(e,t)},d=e=>{var t=h();v(()=>u(t,b.root.headingValue)),a(e,t)};s(c,e=>{i.children?e(l):e(d,-1)}),n(t),a(e,t)};s(ee,e=>{i.child?e(D):e(te,-1)}),a(e,T),c()}var Pr=f(`<button><!></button>`);function Fr(e,i){let u=t();l(i,!0);let d=E(i,`id`,19,()=>P(u)),f=E(i,`ref`,15,null),h=E(i,`tabindex`,3,0),_=O(i,[`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`tabindex`]),v=dr.create({id:M(()=>d()),ref:M(()=>f(),e=>f(e))}),y=p(()=>N(_,v.props,{tabindex:h()}));var b=o(),w=S(b),T=e=>{var t=o();r(S(t),()=>i.child,()=>({props:g(y)})),a(e,t)},ee=e=>{var t=Pr();C(t,()=>({...g(y)})),r(x(t),()=>i.children??m),n(t),a(e,t)};s(w,e=>{i.child?e(T):e(ee,-1)}),a(e,b),c()}var Ir=f(`<button><!></button>`);function Lr(e,i){let u=t();l(i,!0);let d=E(i,`id`,19,()=>P(u)),f=E(i,`ref`,15,null),h=E(i,`tabindex`,3,0),_=O(i,[`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`tabindex`]),v=fr.create({id:M(()=>d()),ref:M(()=>f(),e=>f(e))}),y=p(()=>N(_,v.props,{tabindex:h()}));var b=o(),w=S(b),T=e=>{var t=o();r(S(t),()=>i.child,()=>({props:g(y)})),a(e,t)},ee=e=>{var t=Ir();C(t,()=>({...g(y)})),r(x(t),()=>i.children??m),n(t),a(e,t)};s(w,e=>{i.child?e(T):e(ee,-1)}),a(e,b),c()}var Rr=i({commentExtension:()=>Ur,refreshCommentsEffect:()=>zr}),zr=Oe.define(),Br=De.define({create(){return Ae.none},update(e,t){let n=e.map(t.changes);for(let e of t.effects)e.is(zr),e.is(Vr)&&(n=e.value.map(t.changes));return n},provide:e=>H.decorations.from(e)}),Vr=Oe.define();function Hr(e,t){let n=Ie.getForEntry(t.repo,t.entryType,t.entryId),r=e.state.doc.length,i=[],a=[];for(let e of n){if(e.deletedAt||e.commentId!==e.threadId||!e.anchorRelpos)continue;let n=Fe(t.ydoc,t.ytext,e.anchorRelpos,e.anchorQuote??``);if(n.orphaned)continue;let o=Math.max(0,Math.min(n.from,r)),s=Math.max(o,Math.min(n.to,r));if(o===s)continue;let c=e.resolvedAt!==null,l=c?`sg-comment-highlight sg-comment-resolved`:`sg-comment-highlight`;i.push({from:o,to:s,deco:Ae.mark({class:l,attributes:{"data-comment-id":e.commentId,"data-thread-id":e.threadId}})}),a.push({commentId:e.commentId,threadId:e.threadId,from:o,to:s,recovered:n.recovered,resolved:c,authorRole:e.authorRole})}return i.sort((e,t)=>e.from-t.from||e.to-t.to),{decorations:Ae.set(i.map(e=>e.deco.range(e.from,e.to))),markers:a}}function Ur(e){let t=[];return[Br,ke.define(n=>{function r(){let r=e.getContext();if(!r)return;let{decorations:i,markers:a}=Hr(n,r);n.dispatch({effects:Vr.of(i)}),t=a,e.onMarkersChanged?.(a)}let i=!1,a=()=>{i||(i=!0,queueMicrotask(()=>{i=!1,r()}))};return a(),{update(e){for(let t of e.transactions)for(let e of t.effects)if(e.is(zr)){a();return}e.docChanged&&a()}}}),H.domEventHandlers({click(n,r){let i=n.target.closest(`.sg-comment-highlight`);if(!i)return e.onCommentClickAway?.(),!1;let a=i.dataset.threadId;if(!a)return!1;if(t.some(e=>e.threadId===a))return e.onCommentClick(a),!0;let o=r.posAtCoords({x:n.clientX,y:n.clientY});if(o!==null){let n=null;for(let e of t)o>=e.from&&o<=e.to&&(!n||e.to-e.from<n.to-n.from)&&(n=e);if(n)return e.onCommentClick(n.threadId),!0}return e.onCommentClickAway?.(),!1}})]}async function Wr(e){let{EditorState:t,Compartment:n}=await j(async()=>{let{EditorState:e,Compartment:t}=await import(`./Wowi_89k.js`).then(e=>e.x);return{EditorState:e,Compartment:t}},__vite__mapDeps([0,1]),import.meta.url),{ViewPlugin:r,keymap:i}=await j(async()=>{let{ViewPlugin:e,keymap:t}=await import(`./D3JoMtWC.js`).then(e=>e.s);return{ViewPlugin:e,keymap:t}},__vite__mapDeps([2,1,0]),import.meta.url),{createCollabSession:a}=await j(async()=>{let{createCollabSession:e}=await import(`./Ds2T2cSU.js`);return{createCollabSession:e}},__vite__mapDeps([3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url),{yCollab:o,yUndoManagerKeymap:s}=await j(async()=>{let{yCollab:e,yUndoManagerKeymap:t}=await import(`./CoHaBDpN.js`);return{yCollab:e,yUndoManagerKeymap:t}},__vite__mapDeps([18,0,1,2,4]),import.meta.url),c=await j(()=>import(`./B-Z_xZy_.js`).then(e=>e.p),__vite__mapDeps([4,1]),import.meta.url),l=!1,u=!1,d=a(e.cursorDocName,{name:e.userDisplayName,color:e.accentColor,colorLight:e.accentColor+`33`},{onSync:()=>{l=!0,e.onSync()}}),f=new c.UndoManager(d.ytext,{captureTimeout:500}),p=[o(d.ytext,null,{undoManager:f}),i.of(s)],m=new n;p.push(m.of(t.readOnly.of(!0))),p.push(r.define(e=>{let t=!1;function n(){let t=e.state.selection.main,n=d.ytext,r=c.createRelativePositionFromTypeIndex(n,t.anchor),i=c.createRelativePositionFromTypeIndex(n,t.head);d.awareness.setLocalStateField(`cursor`,{anchor:c.relativePositionToJSON(r),head:c.relativePositionToJSON(i)})}return{update(e){!t&&e.focusChanged&&e.view.hasFocus&&(t=!0),t&&(e.selectionSet||e.docChanged||e.focusChanged)&&n()}}}));let h=d.ydoc.clientID;function g(){let e=[];return d.awareness.getStates().forEach((t,n)=>{if(n===h)return;let r=t?.user?.name??`Anonymous`;e.push({name:r})}),e}let _=``;function v(){let t=g(),n=t.map(e=>e.name).sort().join(`|`);n!==_&&(_=n,e.onCollaboratorsChange(t))}function y({added:t,updated:n,removed:r}){[...t,...n,...r].some(e=>e!==h)&&e.onRemoteAwarenessChange(),(t.length>0||r.length>0)&&v()}return d.awareness.on(`change`,y),v(),p.push(r.define(()=>({update(t){(t.docChanged||t.geometryChanged||t.viewportChanged||t.selectionSet)&&e.onViewportChange()},destroy(){d.awareness.off(`change`,y)}}))),{extensions:p,session:d,syncGate:m,consumeEarlyUnlock:()=>!l||u?!1:(u=!0,!0),destroy:()=>{d.awareness.off(`change`,y),d.destroy()}}}function Gr(e,t){return Ce(Se.current().formats,e,t)}function Kr(e){let t=e.uploadFn??we;Se.load();async function n(n,r){let i=e.getView();if(!i)return;let a=e.cursorDocName.split(`/`);if(a.length<3)return;let[o,s,...c]=a,l=c.join(`/`);for(let e of n){let n=`![Uploading ${e.name}...]()`;i.dispatch({changes:{from:r,insert:n}});try{let r=await t(o,s,l,e),a=`![${e.name}](${r.url})`,c=i.state.doc.toString().indexOf(n);c>=0&&i.dispatch({changes:{from:c,to:c+n.length,insert:a}})}catch{let t=i.state.doc.toString().indexOf(n);t>=0&&i.dispatch({changes:{from:t,to:t+n.length,insert:`<!-- Upload failed: ${e.name} -->`}})}r+=n.length}}return H.domEventHandlers({drop(t){let r=e.getView(),i=t.dataTransfer?.files;if(!i?.length)return!1;let a=[...i].filter(e=>Gr(e.name,e.type));return a.length?(t.preventDefault(),n(a,r?.posAtCoords({x:t.clientX,y:t.clientY})??r?.state.selection.main.head??0),!0):!1},paste(t){let r=e.getView(),i=t.clipboardData?.items;if(!i)return!1;let a=[];for(let e of i)if(e.kind===`file`&&Gr(``,e.type)){let t=e.getAsFile();t&&a.push(t)}return a.length?(t.preventDefault(),n(a,r?.state.selection.main.head??0),!0):!1}})}var qr=Oe.define(),Jr=Ae.mark({class:`sg-comment-highlight sg-comment-draft`}),Yr=De.define({create:()=>Ae.none,update(e,t){e=e.map(t.changes);for(let e of t.effects)if(e.is(qr)){let t=e.value;return!t||t.from===t.to?Ae.none:Ae.set([Jr.range(t.from,t.to)])}return e},provide:e=>H.decorations.from(e)}),Xr=H.baseTheme({".sg-comment-highlight":{background:`color-mix(in srgb, var(--color-accent) 18%, transparent)`,borderBottom:`1px solid color-mix(in srgb, var(--color-accent) 60%, transparent)`,cursor:`pointer`},".sg-comment-highlight.sg-comment-resolved":{background:`color-mix(in srgb, var(--color-accent) 6%, transparent)`,borderBottomColor:`color-mix(in srgb, var(--color-accent) 30%, transparent)`},".sg-comment-highlight.is-hover-preview":{background:`color-mix(in srgb, var(--color-accent) 40%, transparent)`,borderBottomColor:`var(--color-accent)`},".sg-comment-highlight.is-active":{background:`color-mix(in srgb, var(--color-accent) 40%, transparent)`,borderBottomColor:`var(--color-accent)`},".sg-comment-highlight:hover":{background:`color-mix(in srgb, var(--color-accent) 40%, transparent)`,borderBottomColor:`var(--color-accent)`},".sg-comment-highlight.sg-comment-draft":{background:`color-mix(in srgb, var(--color-accent) 24%, transparent)`,borderBottomColor:`var(--color-accent)`},".sg-comment-selection-btn":{display:`inline-flex`,alignItems:`center`,gap:`var(--space-2)`,padding:`var(--menu-item-padding)`,minHeight:`var(--menu-item-height)`,fontSize:`var(--menu-font-size)`,fontFamily:`var(--font-sans)`,color:`var(--color-text-secondary)`,background:`var(--color-bg-elevated)`,border:`1px solid var(--color-border)`,borderRadius:`var(--menu-item-radius)`,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.18)`,cursor:`pointer`,whiteSpace:`nowrap`},".sg-comment-selection-btn:hover":{background:`var(--color-bg-hover)`,color:`var(--color-text-primary)`},"@media (max-width: 1023px)":{".sg-comment-selection-btn":{display:`none !important`}}});function Zr(e){let t=e.split(`/`);if(t.length<3)return null;let[n,r,...i]=t;return{repo:n,entryType:r,entryId:i.join(`/`)}}async function Qr(e){let t=Zr(e.cursorDocName);if(!t)return null;let{commentExtension:n}=await j(async()=>{let{commentExtension:e}=await Promise.resolve().then(()=>Rr);return{commentExtension:e}},void 0,import.meta.url),{commentSelectionPopup:r}=await j(async()=>{let{commentSelectionPopup:e}=await import(`./BoglwbZW.js`).then(e=>e.t);return{commentSelectionPopup:e}},__vite__mapDeps([19,1,0,2]),import.meta.url),{commentsStore:i}=await j(async()=>{let{commentsStore:e}=await import(`./CTwRLVH0.js`).then(e=>e.n);return{commentsStore:e}},__vite__mapDeps([20,1,9,5,6,7,8,10,11,12,13,14,15,16,17]),import.meta.url),{serializeAnchor:a}=await j(async()=>{let{serializeAnchor:e}=await import(`./B2n86UNJ.js`).then(e=>e.t);return{serializeAnchor:e}},__vite__mapDeps([21,1,4]),import.meta.url),o=e.session,s={repo:t.repo,entryType:t.entryType,entryId:t.entryId,ydoc:o.ydoc,ytext:o.ytext};return i.load(t.repo,t.entryType,t.entryId),{extensions:[Xr,Yr,...n({getContext:()=>s,onCommentClick:t=>e.onCommentOpen(t),onCommentClickAway:()=>e.onCommentClickAway?.(),onMarkersChanged:t=>e.onCommentMarkers?.(t)}),r({onCommentRequested:t=>{let n=a(o.ytext,t.from,t.to);e.onCommentNew({from:t.from,to:t.to,quote:n.quote,anchorRelpos:n.relpos})}})],coords:t}}function $r(e){return e.map(e=>`${e.commentId}:${e.resolvedAt??``}:${e.deletedAt??``}:${e.updatedAt??``}`).join(`|`)}function ei(e,t){if(e.querySelectorAll(`.sg-comment-highlight.is-hover-preview`).forEach(e=>{e.classList.remove(`is-hover-preview`)}),t){let n=`.sg-comment-highlight[data-thread-id="${CSS.escape(t)}"]`;e.querySelectorAll(n).forEach(e=>e.classList.add(`is-hover-preview`))}}function ti(e,t){if(e.querySelectorAll(`.sg-comment-highlight.is-active`).forEach(e=>{e.classList.remove(`is-active`)}),t){let n=`.sg-comment-highlight[data-thread-id="${CSS.escape(t)}"]`;e.querySelectorAll(n).forEach(e=>e.classList.add(`is-active`))}}function ni(e,t){let n=Math.max(0,Math.min(t,e.state.doc.length)),r=e.scrollDOM;for(;r;){let e=getComputedStyle(r).overflowY;if(e===`auto`||e===`scroll`)break;r=r.parentElement}e.dispatch({effects:H.scrollIntoView(n,{y:`center`,yMargin:80})}),e.requestMeasure({read:()=>{if(!r)return null;let t=e.lineBlockAt(n),i=e.contentDOM.getBoundingClientRect(),a=r.getBoundingClientRect(),o=i.top-a.top+r.scrollTop+t.top+t.height/2,s=r.scrollTop+r.clientHeight/2;return Math.abs(o-s)},write:t=>{t!==null&&t>48&&queueMicrotask(()=>{e.dispatch({effects:H.scrollIntoView(n,{y:`center`,yMargin:80})})})}})}async function ri(){let{wrapSelection:e}=await j(async()=>{let{wrapSelection:e}=await import(`./C8Ar3dLv.js`).then(e=>e.i);return{wrapSelection:e}},__vite__mapDeps([22,1]),import.meta.url),{Prec:t}=await j(async()=>{let{Prec:e}=await import(`./Wowi_89k.js`).then(e=>e.x);return{Prec:e}},__vite__mapDeps([0,1]),import.meta.url),{keymap:n}=await j(async()=>{let{keymap:e}=await import(`./D3JoMtWC.js`).then(e=>e.s);return{keymap:e}},__vite__mapDeps([2,1,0]),import.meta.url);return t.high(n.of([{key:`Mod-b`,run:t=>(e(t,`**`,`**`),!0)},{key:`Mod-i`,run:t=>(e(t,`*`,`*`),!0)}]))}function ii(){return H.updateListener.of(e=>{if(V.view!==e.view)return;let t=e.state.selection.main.empty;V.selectionEmpty!==t&&(V.selectionEmpty=t)})}function ai(e,t,n){let r=()=>{if(V.view=e,V.canComment=n?.canComment??!1,V.selectionEmpty=e.state.selection.main.empty,t){let e=Zr(t);e&&(V.entity={repo:e.repo,type:e.entryType,id:e.entryId})}},i=()=>{V.view===e&&(V.view=null,V.entity=null,V.canComment=!1,V.selectionEmpty=!0)};return e.hasFocus&&r(),e.contentDOM.addEventListener(`focus`,r),e.contentDOM.addEventListener(`blur`,i),()=>{e.contentDOM.removeEventListener(`focus`,r),e.contentDOM.removeEventListener(`blur`,i),V.view===e&&(V.view=null,V.entity=null)}}var oi=/(?:https?:\/\/|www\.)[^\s<>()[\]"']+$/i;function si(e,t=``){let n=e.state.selection.main;if(!n.empty)return!1;let r=n.head,i=e.state.doc.lineAt(r),a=i.text.slice(0,r-i.from),o=a.match(oi);if(!o)return!1;let s=o[0],c=r-s.length,l=a.slice(0,a.length-s.length);if(/[([<]$/.test(l))return!1;let u=`[${s}](${Te(s)})${t}`;return e.dispatch({changes:{from:c,to:r,insert:u},selection:{anchor:c+u.length},userEvent:`input.autolink`}),!0}async function ci(){let{EditorView:e,keymap:t}=await j(async()=>{let{EditorView:e,keymap:t}=await import(`./D3JoMtWC.js`).then(e=>e.s);return{EditorView:e,keymap:t}},__vite__mapDeps([2,1,0]),import.meta.url),{Prec:n}=await j(async()=>{let{Prec:e}=await import(`./Wowi_89k.js`).then(e=>e.x);return{Prec:e}},__vite__mapDeps([0,1]),import.meta.url);return[e.domEventHandlers({paste(e,t){let n=e.clipboardData?.getData(`text/plain`)?.trim();if(!n||!Ee.test(n))return!1;let{from:r,to:i}=t.state.selection.main,a=`[${t.state.doc.sliceString(r,i)||n}](${Te(n)})`;return e.preventDefault(),t.dispatch({changes:{from:r,to:i,insert:a},selection:{anchor:r+a.length},userEvent:`input.paste`}),!0}}),n.highest(t.of([{key:` `,run:e=>si(e,` `)},{key:`Enter`,run:e=>(si(e),!1)}]))]}function li(e){return H.theme({"&":{backgroundColor:`transparent`,color:`var(--color-text-primary)`,fontSize:`var(--editor-font-size)`,fontFamily:`var(--font-sans)`},".cm-content":{padding:`32px 0`,fontSize:`var(--editor-font-size)`,fontFamily:`var(--font-sans)`,caretColor:`var(--color-accent-fg)`,lineHeight:`var(--editor-line-height)`},".cm-cursor":{borderLeftColor:`var(--color-accent-fg)`},".cm-placeholder":{color:`var(--color-text-tertiary)`},".cm-selectionBackground":{backgroundColor:`var(--color-selection) !important`},"&.cm-focused .cm-selectionBackground":{backgroundColor:`var(--color-selection) !important`},".cm-gutters":{background:`transparent`,border:`none`,color:`var(--color-text-tertiary)`},".cm-activeLine":{backgroundColor:`transparent`},"&:not(.cm-focused) .cm-cursor":{display:`none !important`},"&:not(.cm-focused) .cm-selectionBackground":{display:`none !important`},".cm-line":{padding:`0`},".cm-header-1":{fontSize:`var(--editor-h1-size)`,fontWeight:`600`},".cm-header-2":{fontSize:`var(--editor-h2-size)`,fontWeight:`600`},".cm-header-3":{fontSize:`var(--editor-h3-size)`,fontWeight:`600`},".cm-formatting":{color:`var(--color-text-tertiary)`,opacity:`0.5`},".cm-link":{color:`var(--color-link)`,textDecoration:`none`}},{dark:e})}var ui=Pe.define([{tag:Ne.processingInstruction,color:`var(--color-text-tertiary)`,opacity:`0.7`}]),di=f(`<div><span class="remote-cursor-label svelte-1cy63ac"> </span></div>`),fi=f(`<div class="cursor-overlay svelte-1cy63ac"></div>`);function pi(e,t){l(t,!0);let r=A(T([])),i=null;function d(){i&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>{i=null,f()})}async function f(){let e=t.getView(),n=t.getEditorEl();if(!e||!n||!t.session){_(r,[],!0);return}let i=await j(()=>import(`./B-Z_xZy_.js`).then(e=>e.p),__vite__mapDeps([4,1]),import.meta.url),a=t.session.awareness,o=t.session.ytext,s=o.doc;if(!s){_(r,[],!0);return}let c=s.clientID,l=n.getBoundingClientRect(),u=[];a.getStates().forEach((t,n)=>{if(n===c)return;let r=t.cursor;if(!r?.head)return;let{name:a=`Anonymous`,color:d=`#f04e4e`}=t.user||{},f;try{f=i.createRelativePositionFromJSON(r.head)}catch{return}let p=i.createAbsolutePositionFromRelativePosition(f,s);if(!p||p.type!==o)return;let m=e.coordsAtPos(Math.min(p.index,e.state.doc.length));if(m){let e=m.left-l.left;u.push({id:n,name:a,color:d,top:m.top-l.top,left:e,height:m.bottom-m.top,flipped:e>l.width*.65})}}),_(r,u,!0)}D(()=>{if(t.refreshKey,t.session,!t.session){_(r,[],!0);return}d()}),ee(()=>{i&&cancelAnimationFrame(i)});var p=o(),m=S(p),h=e=>{var t=fi();w(t,21,()=>g(r),e=>e.id,(e,t)=>{var r=di();let i;var o=x(r),s=x(o,!0);n(o),n(r),v(()=>{i=y(r,1,`remote-cursor svelte-1cy63ac`,null,i,{flipped:g(t).flipped}),k(r,`top: ${g(t).top??``}px; left: ${g(t).left??``}px; height: ${g(t).height??``}px; --cursor-color: ${g(t).color??``};`),k(o,`background-color: ${g(t).color??``};`),u(s,g(t).name)}),a(e,r)}),n(t),a(e,t)};s(m,e=>{g(r).length>0&&e(h)}),a(e,p),c()}var mi=f(`<div class="editor-loader svelte-ok7wy5" role="status" aria-live="polite"><div class="editor-loader-spinner svelte-ok7wy5"></div> <span class="sr-only svelte-ok7wy5">Loading editor…</span></div>`),hi=f(`<div><div class="cm-container svelte-ok7wy5"></div> <!> <!></div>`);function gi(t,r){l(r,!0);let i=E(r,`placeholder`,3,`Add notes…`),o=E(r,`readonly`,3,!0),u=E(r,`resetKey`,3,0),d=E(r,`hoveredCommentThread`,3,null),f=E(r,`activeCommentThread`,3,null),p=E(r,`scrollRequest`,3,null),m=E(r,`pendingCommentDraft`,3,null),h=E(r,`selectionRequest`,3,null),S=e(`theme`),C,w=null,T=A(null),O=A(``),re=null,k=A(!1),oe=null,se=null,ce=null,le=A(0),M=r.content;function N(){w&&(w.focus(),w.dispatch({selection:{anchor:0,head:w.state.doc.length}}))}let ue=0,P=[];function de(){for(;P.length;)try{P.pop()()}catch{}}async function fe(){let e=++ue,t=()=>e!==ue;_(k,!1),ce?.(),ce=null,de(),w?.destroy(),w=null,g(T)?.destroy(),_(T,null),_(le,0),r.oncollaboratorchange?.([]);let{EditorState:n,Transaction:a,Compartment:s,Prec:c}=await j(async()=>{let{EditorState:e,Transaction:t,Compartment:n,Prec:r}=await import(`./Wowi_89k.js`).then(e=>e.x);return{EditorState:e,Transaction:t,Compartment:n,Prec:r}},__vite__mapDeps([0,1]),import.meta.url);if(t())return;re=a,se=n;let{EditorView:l,keymap:u,drawSelection:d,placeholder:p}=await j(async()=>{let{EditorView:e,keymap:t,drawSelection:n,placeholder:r}=await import(`./D3JoMtWC.js`).then(e=>e.s);return{EditorView:e,keymap:t,drawSelection:n,placeholder:r}},__vite__mapDeps([2,1,0]),import.meta.url),{markdown:h,markdownLanguage:v,insertNewlineContinueMarkupCommand:y,deleteMarkupBackward:x}=await j(async()=>{let{markdown:e,markdownLanguage:t,insertNewlineContinueMarkupCommand:n,deleteMarkupBackward:r}=await import(`./Bqm_YrIg2.js`);return{markdown:e,markdownLanguage:t,insertNewlineContinueMarkupCommand:n,deleteMarkupBackward:r}},__vite__mapDeps([23,24,1,0,2,25,26]),import.meta.url),{TaskList:ee}=await j(async()=>{let{TaskList:e}=await import(`./CEniyZ1Z2.js`);return{TaskList:e}},__vite__mapDeps([26,25,1]),import.meta.url),{syntaxHighlighting:E}=await j(async()=>{let{syntaxHighlighting:e}=await import(`./BBGt-XQo.js`).then(e=>e.f);return{syntaxHighlighting:e}},__vite__mapDeps([24,1,0,2,25]),import.meta.url),{history:D,defaultKeymap:te,historyKeymap:ne}=await j(async()=>{let{history:e,defaultKeymap:t,historyKeymap:n}=await import(`./BoDmwOTJ2.js`);return{history:e,defaultKeymap:t,historyKeymap:n}},__vite__mapDeps([27,24,1,0,2,25]),import.meta.url),{livePreviewPlugin:ie,livePreviewTheme:A,imageKeymap:ae}=await j(async()=>{let{livePreviewPlugin:e,livePreviewTheme:t,imageKeymap:n}=await import(`./DqVNW14M.js`).then(e=>e.n);return{livePreviewPlugin:e,livePreviewTheme:t,imageKeymap:n}},__vite__mapDeps([28,1,24,0,2,25,29,9,5,6,7,8,10,11,12,13,14,15,16,17,22]),import.meta.url),{mergeListItemBackward:N}=await j(async()=>{let{mergeListItemBackward:e}=await import(`./BJgOZTHR.js`);return{mergeListItemBackward:e}},__vite__mapDeps([30,24,1,0,2,25]),import.meta.url),{listIndentMore:fe,listIndentLess:pe}=await j(async()=>{let{listIndentMore:e,listIndentLess:t}=await import(`./B6Lt-qaJ.js`);return{listIndentMore:e,listIndentLess:t}},[],import.meta.url),{tablePreviewPlugin:me,tablePreviewTheme:F}=await j(async()=>{let{tablePreviewPlugin:e,tablePreviewTheme:t}=await import(`./aTepn3vZ.js`);return{tablePreviewPlugin:e,tablePreviewTheme:t}},__vite__mapDeps([31,24,1,0,2,25,29,9,5,6,7,8,10,11,12,13,14,15,16,17]),import.meta.url);if(t())return;let I=[h({base:v,extensions:[ee]}),li(S.current===`dark`),E(ui),d(),ie,A,Me,ae,me,F,l.lineWrapping];oe=new s,I.push(oe.of(n.readOnly.of(o()))),!o()&&i()&&I.push(p(i()));let L=!1,R=null;if(r.cursorDocName&&!o())try{let{auth:e}=await j(async()=>{let{auth:e}=await import(`./D3ch71s_.js`).then(e=>e.n);return{auth:e}},__vite__mapDeps([15,1,9]),import.meta.url),{userColors:n}=await j(async()=>{let{userColors:e}=await import(`./CJHSUZEP2.js`).then(e=>e.v);return{userColors:e}},__vite__mapDeps([32,1,7,8,6,9,12,5,10,11,13,14,15,16,17,33]),import.meta.url);if(t())return;let i=e.user?.id,a=i==null?getComputedStyle(document.documentElement).getPropertyValue(`--color-accent`).trim()||`#f04e4e`:n.getColor(i);if(R=await Wr({cursorDocName:r.cursorDocName,accentColor:a,userDisplayName:e.user?.displayName??`Anonymous`,onSync:()=>{w&&R&&w.dispatch({effects:R.syncGate.reconfigure([])}),_(k,!0)},onCollaboratorsChange:e=>r.oncollaboratorchange?.(e),onRemoteAwarenessChange:()=>{b(le)},onViewportChange:()=>{b(le)}}),t()){R.destroy();return}I.push(...R.extensions),_(T,R.session,!0),L=!0}catch(e){console.warn(`Yjs collab setup failed, falling back to solo editing:`,e)}let z=!1;if(L&&R&&r.cursorDocName&&r.oncommentopen&&r.oncommentnew){let e=await Qr({cursorDocName:r.cursorDocName,session:R.session,onCommentOpen:r.oncommentopen,onCommentClickAway:()=>r.oncommentclickaway?.(),onCommentNew:e=>{r.oncommentnew(e)},onCommentMarkers:e=>{C&&ti(C,f()),r.oncommentmarkers?.(e)}});if(t()){R?.destroy();return}e&&(I.push(...e.extensions),z=!0)}if(!o()&&!L?(I.push(D({newGroupDelay:500})),I.push(u.of([...te,...ne]))):!o()&&L&&I.push(u.of([...te])),!o()){let e=y({nonTightLists:!1});I.push(c.high(u.of([{key:`Enter`,run:e},{key:`Backspace`,run:N},{key:`Backspace`,run:x},{key:`Tab`,run:fe},{key:`Shift-Tab`,run:pe}])))}if(!o()){let{wikilinkPlugin:e,wikilinkKeymap:n}=await j(async()=>{let{wikilinkPlugin:e,wikilinkKeymap:t}=await import(`./rbhlO_t8.js`).then(e=>e.n);return{wikilinkPlugin:e,wikilinkKeymap:t}},__vite__mapDeps([34,1,2,0]),import.meta.url);if(t()){R?.destroy();return}I.push(e,c.highest(u.of([...n])))}if(I.push(l.updateListener.of(e=>{(e.viewportChanged||e.geometryChanged)&&C&&ti(C,f())})),r.onchange){let e=Date.now(),t=[`input`,`delete`,`move`,`undo`,`redo`];I.push(l.updateListener.of(n=>{if(!n.docChanged||L&&(Date.now()-e<1e3||!n.transactions.some(e=>t.some(t=>e.isUserEvent(t)))))return;let i=n.state.doc.toString();M=i,r.onchange(i)}))}if(!o()&&r.cursorDocName&&I.push(Kr({cursorDocName:r.cursorDocName,getView:()=>w})),I.push(l.domEventHandlers({click(e){let t=e.target;if(r.onwikilinkclick){let n=t.closest(`.cm-live-wikilink`);if(n){e.preventDefault();let t=n.dataset.entityId||n.textContent?.replace(/^\[{1,2}|\]{1,2}$/g,``).trim();return t&&r.onwikilinkclick(t),!0}}let n=t.closest(`.cm-live-link`)?.getAttribute(`data-href`);return n?(e.preventDefault(),window.open(n,`_blank`,`noopener,noreferrer`),!0):!1}})),r.onsave&&I.push(u.of([{key:`Mod-s`,run:()=>(r.onsave(),!0)}])),!o()){let e=await ri(),n=await ci();if(t()){R?.destroy();return}I.push(e),I.push(n),I.push(ii())}let he=L?R&&R.session.ytext.length>0?R.session.ytext.toString():``:r.content;w=new l({state:n.create({doc:he,extensions:I}),parent:C}),m()&&w.dispatch({effects:qr.of(m())}),R?.consumeEarlyUnlock()&&w.dispatch({effects:R.syncGate.reconfigure([])}),o()||(ce=ai(w,r.cursorDocName??null,{canComment:z}));let B=C;if(r.onwikilinkclick&&B){let e=e=>{e.detail&&r.onwikilinkclick(e.detail)};B.addEventListener(`wikilink-click`,e),P.push(()=>B.removeEventListener(`wikilink-click`,e))}if(!o()&&B){let e=e=>{if(!w||!e.detail)return;let{from:t,to:n,checked:r}=e.detail;t<0||n>w.state.doc.length||w.dispatch({changes:{from:t,to:n,insert:r?`[x]`:`[ ]`},userEvent:`input`})};B.addEventListener(`task-toggle`,e),P.push(()=>B.removeEventListener(`task-toggle`,e))}if(r.oncommenthover&&B){let e=e=>{let t=e.target?.closest?.(`.sg-comment-highlight`);t?.dataset.threadId&&r.oncommenthover(t.dataset.threadId)},t=e=>{e.target?.closest?.(`.sg-comment-highlight`)&&(e.relatedTarget?.closest?.(`.sg-comment-highlight`)||r.oncommenthover(null))};B.addEventListener(`mouseover`,e),B.addEventListener(`mouseout`,t),P.push(()=>{B.removeEventListener(`mouseover`,e),B.removeEventListener(`mouseout`,t)})}M=L?``:r.content,_(O,r.cursorDocName??``,!0),!L||R?.session.synced?_(k,!0):setTimeout(()=>{g(k)||_(k,!0)},5e3),r.onready?.()}ne(async()=>{await fe()}),D(()=>{r.cursorDocName&&g(O)&&r.cursorDocName!==g(O)&&fe()});let pe=A(``);D(()=>{let e=ae.repos.map(e=>`${e.name}:${e.entities.length}`).join(`|`);!w||e===g(pe)||(_(pe,e,!0),w.dispatch({effects:je.of()}))});let me=A(``);D(()=>{if(!r.cursorDocName)return;let e=Zr(r.cursorDocName);if(!e)return;let t=$r(Ie.getForEntry(e.repo,e.entryType,e.entryId));!w||t===g(me)||(_(me,t,!0),w.dispatch({effects:zr.of()}))});let F=0;D(()=>{let e=p();if(!w||!e||e.tick===F)return;F=e.tick,ni(w,e.position);let t=f();requestAnimationFrame(()=>{C&&ti(C,t)})});let I=0;D(()=>{let e=h();if(!w||!e||e.tick===I)return;I=e.tick;let t=w.state.doc.length,n=Math.max(0,Math.min(e.from,t)),r=Math.max(0,Math.min(e.to,t));w.dispatch({selection:{anchor:n,head:r}}),w.focus()}),D(()=>{C&&ei(C,d())}),D(()=>{C&&ti(C,f())}),D(()=>{let e=m();w&&w.dispatch({effects:qr.of(e)})}),D(()=>{w&&oe&&se&&w.dispatch({effects:oe.reconfigure(se.readOnly.of(o()))})}),D(()=>{if(u(),!w||r.content===M)return;if(g(T)){M=r.content;return}if(w.state.doc.toString()===r.content){M=r.content;return}M=r.content;let e=C.closest(`.document-scroll`),t=e?.scrollTop??0;w.dispatch({changes:{from:0,to:w.state.doc.length,insert:r.content},...re?{annotations:re.addToHistory.of(!1)}:{}}),e&&requestAnimationFrame(()=>{e.scrollTop=t})}),ee(()=>{ue++,ce?.(),de(),g(T)?.destroy(),_(T,null),w?.destroy(),r.oncollaboratorchange?.([])});var L={focusSelectAll:N},R=hi();let z;var he=x(R);ie(he,e=>C=e,()=>C);var B=te(he,2),ge=e=>{a(e,mi())};return s(B,e=>{g(k)||e(ge)}),pi(te(B,2),{get session(){return g(T)},getView:()=>w,getEditorEl:()=>C,get refreshKey(){return g(le)}}),n(R),v(()=>{z=y(R,1,`editor-wrap svelte-ok7wy5`,null,z,{loading:!g(k)}),he.inert=!g(k)}),a(t,R),c(L)}export{Xt as C,on as S,En as _,jr as a,Q as b,Tr as c,yr as d,or as f,bn as g,Dn as h,Nr as i,Cr as l,Nn as m,Lr as n,kr as o,er as p,Fr as r,Dr as s,gi as t,xr as u,On as v,vn as x,Tn as y};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Wowi_89k.js","./iPCkjliu.js","./D3JoMtWC.js","./CPggL5T4.js","./B-Z_xZy_.js","./C6GeXy2x.js","./C8k8ISFi.js","./kNaey6uv.js","./BxBYpA6r.js","./JCjEwqH9.js","./yAxYDEMa.js","./CK8tIaYT.js","./xihTtKlq.js","./BDIUHcEz.js","../assets/dist.DDCWxn3B.css","./D3ch71s_.js","./h2w5CgVx.js","./gZQwV3Fq.js","./CoHaBDpN.js","./BoglwbZW.js","./DwTthEC8.js","./B2n86UNJ.js","./C8Ar3dLv.js","./Bqm_YrIg2.js","./BBGt-XQo.js","./BADt8daH.js","./CEniyZ1Z2.js","./BoDmwOTJ2.js","./7kR889TK.js","./B6IRsNLP2.js","./BJgOZTHR.js","./D7wNieYW.js","./B1IoRIM32.js","../assets/list-columns.BgnafZ4K.css","./rbhlO_t8.js"])))=>i.map(i=>d[i]);
2
+ import{At as e,B as t,Bt as n,D as r,Gt as i,I as a,L as o,M as s,Mt as c,Nt as l,P as u,Q as d,R as f,St as p,Ut as m,V as h,Y as g,_t as _,at as v,b as y,bt as b,dt as x,ft as S,h as C,k as w,mt as T,n as ee,o as E,ot as D,pt as te,r as ne,s as O,st as re,u as ie,y as k,yt as A}from"./iPCkjliu.js";import{t as j}from"./kNaey6uv.js";import"./xihTtKlq.js";import{i as ae}from"./gZQwV3Fq.js";import{C as oe,Dt as se,Et as ce,H as le,Mt as M,Ot as N,Q as ue,R as P,W as de,X as fe,Y as pe,Z as me,_t as F,b as I,dt as L,kt as R,lt as z,nt as he,pt as B,r as ge,ut as _e,vt as ve,xt as ye,yt as be}from"./BgRT-K6w.js";import{N as xe}from"./DqZzYIcH.js";import{n as Se,s as Ce,t as V}from"./De0g5qop2.js";import{l as we}from"./CY0iY_WO.js";import{n as Te,t as Ee}from"./C8Ar3dLv.js";import{m as De,p as Oe}from"./Wowi_89k.js";import{a as ke,r as H,t as Ae}from"./D3JoMtWC.js";import{r as je,t as Me}from"./7kR889TK.js";import{o as Ne}from"./BADt8daH.js";import{t as Pe}from"./BBGt-XQo.js";import{n as Fe}from"./B2n86UNJ.js";import{t as Ie}from"./DwTthEC8.js";function Le(e,t){return e-t*Math.floor(e/t)}var Re=1721426;function ze(e,t,n,r){t=Ve(e,t);let i=t-1,a=-2;return n<=2?a=0:Be(t)&&(a=-1),Re-1+365*i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400)+Math.floor((367*n-362)/12+a+r)}function Be(e){return e%4==0&&(e%100!=0||e%400==0)}function Ve(e,t){return e===`BC`?1-t:t}function He(e){let t=`AD`;return e<=0&&(t=`BC`,e=1-e),[t,e]}var Ue={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]},We=class{fromJulianDay(e){let t=e,n=t-Re,r=Math.floor(n/146097),i=Le(n,146097),a=Math.floor(i/36524),o=Le(i,36524),s=Math.floor(o/1461),c=Le(o,1461),l=Math.floor(c/365),[u,d]=He(r*400+a*100+s*4+l+ +(a!==4&&l!==4)),f=t-ze(u,d,1,1),p=2;t<ze(u,d,3,1)?p=0:Be(d)&&(p=1);let m=Math.floor(((f+p)*12+373)/367);return new on(u,d,m,t-ze(u,d,m,1)+1)}toJulianDay(e){return ze(e.era,e.year,e.month,e.day)}getDaysInMonth(e){return Ue[Be(e.year)?`leapyear`:`standard`][e.month-1]}getMonthsInYear(e){return 12}getDaysInYear(e){return Be(e.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(e){return 9999}getEras(){return[`BC`,`AD`]}isInverseEra(e){return e.era===`BC`}balanceDate(e){e.year<=0&&(e.era=e.era===`BC`?`AD`:`BC`,e.year=1-e.year)}constructor(){this.identifier=`gregory`}},Ge={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function U(e,t){return t=J(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function Ke(e,t){return t=J(t,e.calendar),e=at(e),t=at(t),e.era===t.era&&e.year===t.year&&e.month===t.month}function qe(e,t){return e.isEqual?.(t)??t.isEqual?.(e)??e.identifier===t.identifier}function Je(e,t){return U(e,Qe(t))}var Ye={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function Xe(e,t,n){let r=e.calendar.toJulianDay(e),i=n?Ye[n]:ut(t),a=Math.ceil(r+1-i)%7;return a<0&&(a+=7),a}function Ze(e){return q(Date.now(),e)}function Qe(e){return bt(Ze(e))}function $e(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function et(e,t){return tt(e)-tt(t)}function tt(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}var nt=null,rt=!1;function W(){return nt??=new Intl.DateTimeFormat().resolvedOptions().timeZone,nt}function it(){return rt}function at(e){return e.subtract({days:e.day-1})}function ot(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}var st=new Map,ct=new Map;function lt(e){if(Intl.Locale){let t=st.get(e);return t||(t=new Intl.Locale(e).maximize().region,t&&st.set(e,t)),t}let t=e.split(`-`)[1];return t===`u`?void 0:t}function ut(e){let t=ct.get(e);if(!t){if(Intl.Locale){let n=new Intl.Locale(e);if(`getWeekInfo`in n&&(t=n.getWeekInfo(),t))return ct.set(e,t),t.firstDay}let n=lt(e);if(e.includes(`-fw-`)){let n=e.split(`-fw-`)[1].split(`-`)[0];t=n===`mon`?{firstDay:1}:n===`tue`?{firstDay:2}:n===`wed`?{firstDay:3}:n===`thu`?{firstDay:4}:n===`fri`?{firstDay:5}:n===`sat`?{firstDay:6}:{firstDay:0}}else t=e.includes(`-ca-iso8601`)?{firstDay:1}:{firstDay:n&&Ge[n]||0};ct.set(e,t)}return t.firstDay}function G(e){return e=J(e,new We),dt(Ve(e.era,e.year),e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function dt(e,t,n,r,i,a,o){let s=new Date;return s.setUTCHours(r,i,a,o),s.setUTCFullYear(e,t-1,n),s.getTime()}function ft(e,t){if(t===`UTC`)return 0;if(e>0&&t===W()&&!it())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:i,hour:a,minute:o,second:s}=mt(e,t);return dt(n,r,i,a,o,s,0)-Math.floor(e/1e3)*1e3}var pt=new Map;function mt(e,t){let n=pt.get(t);n||(n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,hour12:!1,era:`short`,year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`}),pt.set(t,n));let r=n.formatToParts(new Date(e)),i={};for(let e of r)e.type!==`literal`&&(i[e.type]=e.value);return{year:i.era===`BC`||i.era===`B`?-i.year+1:+i.year,month:+i.month,day:+i.day,hour:i.hour===`24`?0:+i.hour,minute:+i.minute,second:+i.second}}var ht=864e5;function gt(e,t){let n=G(e);return _t(e,t,n-ft(n-ht,t),n-ft(n+ht,t))}function _t(e,t,n,r){return(n===r?[n]:[n,r]).filter(n=>vt(e,t,n))}function vt(e,t,n){let r=mt(n,t);return e.year===r.year&&e.month===r.month&&e.day===r.day&&e.hour===r.hour&&e.minute===r.minute&&e.second===r.second}function K(e,t,n=`compatible`){let r=xt(e);if(t===`UTC`)return G(r);if(t===W()&&n===`compatible`&&!it()){r=J(r,new We);let e=new Date,t=Ve(r.era,r.year);return e.setFullYear(t,r.month-1,r.day),e.setHours(r.hour,r.minute,r.second,r.millisecond),e.getTime()}let i=G(r),a=ft(i-ht,t),o=ft(i+ht,t),s=_t(r,t,i-a,i-o);if(s.length===1)return s[0];if(s.length>1)switch(n){case`compatible`:case`earlier`:return s[0];case`later`:return s[s.length-1];case`reject`:throw RangeError(`Multiple possible absolute times found`)}switch(n){case`earlier`:return Math.min(i-a,i-o);case`compatible`:case`later`:return Math.max(i-a,i-o);case`reject`:throw RangeError(`No such absolute time found`)}}function yt(e,t,n=`compatible`){return new Date(K(e,t,n))}function q(e,t){let n=ft(e,t),r=new Date(e+n),i=r.getUTCFullYear(),a=r.getUTCMonth()+1,o=r.getUTCDate(),s=r.getUTCHours(),c=r.getUTCMinutes(),l=r.getUTCSeconds(),u=r.getUTCMilliseconds();return new cn(i<1?`BC`:`AD`,i<1?-i+1:i,a,o,t,n,s,c,l,u)}function bt(e){return new on(e.calendar,e.era,e.year,e.month,e.day)}function xt(e,t){let n=0,r=0,i=0,a=0;if(`timeZone`in e)({hour:n,minute:r,second:i,millisecond:a}=e);else if(`hour`in e&&!t)return e;return t&&({hour:n,minute:r,second:i,millisecond:a}=t),new sn(e.calendar,e.era,e.year,e.month,e.day,n,r,i,a)}function J(e,t){if(qe(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,jt(r),r}function St(e,t,n){return e instanceof cn?e.timeZone===t?e:wt(e,t):q(K(e,t,n),t)}function Ct(e){let t=G(e)-e.offset;return new Date(t)}function wt(e,t){return J(q(G(e)-e.offset,t),e.calendar)}var Tt=36e5;function Et(e,t){let n=e.copy(),r=`hour`in n?zt(n,t):0;Dt(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,Ot(n),At(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=r,kt(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let i=n.calendar.getYearsInEra(n);if(n.year>i){let e=n.calendar.isInverseEra?.(n);n.year=i,n.month=e?1:n.calendar.getMonthsInYear(n),n.day=e?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let a=n.calendar.getMonthsInYear(n);return n.month>a&&(n.month=a,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function Dt(e,t){e.calendar.isInverseEra?.(e)&&(t=-t),e.year+=t}function Ot(e){for(;e.month<1;)Dt(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,Dt(e,1)}function kt(e){for(;e.day<1;)e.month--,Ot(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,Ot(e)}function At(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function jt(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),At(e)}function Mt(e){let t={};for(let n in e)typeof e[n]==`number`&&(t[n]=-e[n]);return t}function Nt(e,t){return Et(e,Mt(t))}function Pt(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),jt(n),n}function Ft(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),Lt(n),n}function It(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=Rt(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=Rt(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=Rt(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=Rt(e.hour,24),t}function Lt(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function Rt(e,t){let n=e%t;return n<0&&(n+=t),n}function zt(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,It(e)}function Bt(e,t,n,r){let i=e.copy();switch(t){case`era`:{let t=e.calendar.getEras(),a=t.indexOf(e.era);if(a<0)throw Error(`Invalid era: `+e.era);a=Y(a,n,0,t.length-1,r?.round),i.era=t[a],jt(i);break}case`year`:i.calendar.isInverseEra?.(i)&&(n=-n),i.year=Y(e.year,n,-1/0,9999,r?.round),i.year===-1/0&&(i.year=1),i.calendar.balanceYearMonth&&i.calendar.balanceYearMonth(i,e);break;case`month`:i.month=Y(e.month,n,1,e.calendar.getMonthsInYear(e),r?.round);break;case`day`:i.day=Y(e.day,n,1,e.calendar.getDaysInMonth(e),r?.round);break;default:throw Error(`Unsupported field `+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(i),jt(i),i}function Vt(e,t,n,r){let i=e.copy();switch(t){case`hour`:{let t=e.hour,a=0,o=23;if(r?.hourCycle===12){let e=t>=12;a=e?12:0,o=e?23:11}i.hour=Y(t,n,a,o,r?.round);break}case`minute`:i.minute=Y(e.minute,n,0,59,r?.round);break;case`second`:i.second=Y(e.second,n,0,59,r?.round);break;case`millisecond`:i.millisecond=Y(e.millisecond,n,0,999,r?.round);break;default:throw Error(`Unsupported field `+t)}return i}function Y(e,t,n,r,i=!1){if(i){e+=Math.sign(t),e<n&&(e=r);let i=Math.abs(t);e=t>0?Math.ceil(e/i)*i:Math.floor(e/i)*i,e>r&&(e=n)}else e+=t,e<n?e=r-(n-e-1):e>r&&(e=n+(e-r-1));return e}function Ht(e,t){let n;return n=t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0?K(Et(xt(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days}),e.timeZone):G(e)-e.offset,n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5,J(q(n,e.timeZone),e.calendar)}function Ut(e,t){return Ht(e,Mt(t))}function Wt(e,t,n,r){switch(t){case`hour`:{let t=0,i=23;if(r?.hourCycle===12){let n=e.hour>=12;t=n?12:0,i=n?23:11}let a=xt(e),o=J(Ft(a,{hour:t}),new We),s=[K(o,e.timeZone,`earlier`),K(o,e.timeZone,`later`)].filter(t=>q(t,e.timeZone).day===o.day)[0],c=J(Ft(a,{hour:i}),new We),l=[K(c,e.timeZone,`earlier`),K(c,e.timeZone,`later`)].filter(t=>q(t,e.timeZone).day===c.day).pop(),u=G(e)-e.offset,d=Math.floor(u/Tt),f=u%Tt;return u=Y(d,n,Math.floor(s/Tt),Math.floor(l/Tt),r?.round)*Tt+f,J(q(u,e.timeZone),e.calendar)}case`minute`:case`second`:case`millisecond`:return Vt(e,t,n,r);case`era`:case`year`:case`month`:case`day`:return J(q(K(Bt(xt(e),t,n,r),e.timeZone),e.timeZone),e.calendar);default:throw Error(`Unsupported field `+t)}}function Gt(e,t,n){let r=xt(e),i=Ft(Pt(r,t),t);return i.compare(r)===0?e:J(q(K(i,e.timeZone,n),e.timeZone),e.calendar)}var Kt=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/,qt=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/,Jt=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:([+-]\d{2})(?::?(\d{2}))?(?::?(\d{2}))?)?\[(.*?)\]$/,Yt=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;function Xt(e){let t=e.match(Kt);if(!t)throw Yt.test(e)?Error(`Invalid ISO 8601 date string: ${e}. Use parseAbsolute() instead.`):Error(`Invalid ISO 8601 date string: `+e);let n=new on(X(t[1],0,9999),X(t[2],1,12),1);return n.day=X(t[3],1,n.calendar.getDaysInMonth(n)),n}function Zt(e){let t=e.match(qt);if(!t)throw Yt.test(e)?Error(`Invalid ISO 8601 date time string: ${e}. Use parseAbsolute() instead.`):Error(`Invalid ISO 8601 date time string: `+e);let n=X(t[1],-9999,9999),r=new sn(n<1?`BC`:`AD`,n<1?-n+1:n,X(t[2],1,12),1,t[4]?X(t[4],0,23):0,t[5]?X(t[5],0,59):0,t[6]?X(t[6],0,59):0,t[7]?X(t[7],0,1/0)*1e3:0);return r.day=X(t[3],0,r.calendar.getDaysInMonth(r)),r}function Qt(e,t){let n=e.match(Jt);if(!n)throw Error(`Invalid ISO 8601 date time string: `+e);let r=X(n[1],-9999,9999),i=new cn(r<1?`BC`:`AD`,r<1?-r+1:r,X(n[2],1,12),1,n[11],0,n[4]?X(n[4],0,23):0,n[5]?X(n[5],0,59):0,n[6]?X(n[6],0,59):0,n[7]?X(n[7],0,1/0)*1e3:0);i.day=X(n[3],0,i.calendar.getDaysInMonth(i));let a=xt(i),o;if(n[8]){let e=X(n[8],-23,23);if(i.offset=Math.sign(e)*(Math.abs(e)*36e5+X(n[9]??`0`,0,59)*6e4+X(n[10]??`0`,0,59)*1e3),o=G(i)-i.offset,!gt(a,i.timeZone).includes(o))throw Error(`Offset ${nn(i.offset)} is invalid for ${tn(i)} in ${i.timeZone}`)}else o=K(xt(a),i.timeZone,t);return q(o,i.timeZone)}function X(e,t,n){let r=Number(e);if(r<t||r>n)throw RangeError(`Value out of range: ${t} <= ${r} <= ${n}`);return r}function $t(e){return`${String(e.hour).padStart(2,`0`)}:${String(e.minute).padStart(2,`0`)}:${String(e.second).padStart(2,`0`)}${e.millisecond?String(e.millisecond/1e3).slice(1):``}`}function en(e){let t=J(e,new We),n;return n=t.era===`BC`?t.year===1?`0000`:`-`+String(Math.abs(1-t.year)).padStart(6,`00`):String(t.year).padStart(4,`0`),`${n}-${String(t.month).padStart(2,`0`)}-${String(t.day).padStart(2,`0`)}`}function tn(e){return`${en(e)}T${$t(e)}`}function nn(e){let t=Math.sign(e)<0?`-`:`+`;e=Math.abs(e);let n=Math.floor(e/36e5),r=Math.floor(e%36e5/6e4),i=Math.floor(e%36e5%6e4/1e3),a=`${t}${String(n).padStart(2,`0`)}:${String(r).padStart(2,`0`)}`;return i!==0&&(a+=`:${String(i).padStart(2,`0`)}`),a}function rn(e){return`${tn(e)}${nn(e.offset)}[${e.timeZone}]`}function an(e){let t=typeof e[0]==`object`?e.shift():new We,n;if(typeof e[0]==`string`)n=e.shift();else{let e=t.getEras();n=e[e.length-1]}let r=e.shift(),i=e.shift(),a=e.shift();return[t,n,r,i,a]}var on=class e{constructor(...e){let[t,n,r,i,a]=an(e);this.calendar=t,this.era=n,this.year=r,this.month=i,this.day=a,jt(this)}copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day):new e(this.calendar,this.year,this.month,this.day)}add(e){return Et(this,e)}subtract(e){return Nt(this,e)}set(e){return Pt(this,e)}cycle(e,t,n){return Bt(this,e,t,n)}toDate(e){return yt(this,e)}toString(){return en(this)}compare(e){return $e(this,e)}},sn=class e{constructor(...e){let[t,n,r,i,a]=an(e);this.calendar=t,this.era=n,this.year=r,this.month=i,this.day=a,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,jt(this)}copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new e(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(e){return Et(this,e)}subtract(e){return Nt(this,e)}set(e){return Pt(Ft(this,e),e)}cycle(e,t,n){switch(e){case`era`:case`year`:case`month`:case`day`:return Bt(this,e,t,n);default:return Vt(this,e,t,n)}}toDate(e,t){return yt(this,e,t)}toString(){return tn(this)}compare(e){let t=$e(this,e);return t===0?et(this,xt(e)):t}},cn=class e{constructor(...e){let[t,n,r,i,a]=an(e),o=e.shift(),s=e.shift();this.calendar=t,this.era=n,this.year=r,this.month=i,this.day=a,this.timeZone=o,this.offset=s,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,jt(this)}copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new e(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(e){return Ht(this,e)}subtract(e){return Ut(this,e)}set(e,t){return Gt(this,e,t)}cycle(e,t,n){return Wt(this,e,t,n)}toDate(){return Ct(this)}toString(){return rn(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(e){return this.toDate().getTime()-St(e,this.timeZone).toDate().getTime()}},ln=new Map,Z=class{constructor(e,t={}){this.formatter=dn(e,t),this.options=t}format(e){return this.formatter.format(e)}formatToParts(e){return this.formatter.formatToParts(e)}formatRange(e,t){if(typeof this.formatter.formatRange==`function`)return this.formatter.formatRange(e,t);if(t<e)throw RangeError(`End date must be >= start date`);return`${this.formatter.format(e)} \u{2013} ${this.formatter.format(t)}`}formatRangeToParts(e,t){if(typeof this.formatter.formatRangeToParts==`function`)return this.formatter.formatRangeToParts(e,t);if(t<e)throw RangeError(`End date must be >= start date`);let n=this.formatter.formatToParts(e),r=this.formatter.formatToParts(t);return[...n.map(e=>({...e,source:`startRange`})),{type:`literal`,value:` – `,source:`shared`},...r.map(e=>({...e,source:`endRange`}))]}resolvedOptions(){let e=this.formatter.resolvedOptions();return hn()&&(this.resolvedHourCycle||=gn(e.locale,this.options),e.hourCycle=this.resolvedHourCycle,e.hour12=this.resolvedHourCycle===`h11`||this.resolvedHourCycle===`h12`),e.calendar===`ethiopic-amete-alem`&&(e.calendar=`ethioaa`),e}},un={true:{ja:`h11`},false:{}};function dn(e,t={}){if(typeof t.hour12==`boolean`&&pn()){t={...t};let n=un[String(t.hour12)][e.split(`-`)[0]],r=t.hour12?`h12`:`h23`;t.hourCycle=n??r,delete t.hour12}let n=e+(t?Object.entries(t).sort((e,t)=>e[0]<t[0]?-1:1).join():``);if(ln.has(n))return ln.get(n);let r=new Intl.DateTimeFormat(e,t);return ln.set(n,r),r}var fn=null;function pn(){return fn??=new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,hour12:!1}).format(new Date(2020,2,3,0))===`24`,fn}var mn=null;function hn(){return mn??=new Intl.DateTimeFormat(`fr`,{hour:`numeric`,hour12:!1}).resolvedOptions().hourCycle===`h12`,mn}function gn(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,``),e+=(e.includes(`-u-`)?``:`-u`)+`-nu-latn`;let n=dn(e,{...t,timeZone:void 0}),r=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(e=>e.type===`hour`).value,10),i=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(e=>e.type===`hour`).value,10);if(r===0&&i===23)return`h23`;if(r===24&&i===23)return`h24`;if(r===0&&i===11)return`h11`;if(r===12&&i===11)return`h12`;throw Error(`Unexpected hour cycle result`)}function _n(e){if(!le||!e)return null;let t=e.querySelector(`[data-bits-announcer]`),n=t=>{let n=e.createElement(`div`);return n.role=`log`,n.ariaLive=t,n.setAttribute(`aria-relevant`,`additions`),n};if(!de(t)){let r=e.createElement(`div`);r.style.cssText=xe,r.setAttribute(`data-bits-announcer`,``),r.appendChild(n(`assertive`)),r.appendChild(n(`polite`)),t=r,e.body.insertBefore(t,e.body.firstChild)}return{getLog:e=>{if(!de(t))return null;let n=t.querySelector(`[aria-live="${e}"]`);return de(n)?n:null}}}function vn(e){let t=_n(e);function n(n,r=`assertive`,i=7500){if(!t||!le||!e)return;let a=t.getLog(r),o=e.createElement(`div`);return n=typeof n==`number`?n.toString():n===null?`Empty`:n.trim(),o.innerText=n,r===`assertive`?a?.replaceChildren(o):a?.appendChild(o),setTimeout(()=>{o.remove()},i)}return{announce:n}}var yn={defaultValue:void 0,granularity:`day`};function bn(e){let{defaultValue:t,granularity:n,minValue:r,maxValue:i}={...yn,...e};if(Array.isArray(t)&&t.length)return t[t.length-1];if(t&&!Array.isArray(t))return t;{let e=new Date;r&&e<r.toDate(W())?e=r.toDate(W()):i&&e>i.toDate(W())&&(e=i.toDate(W()));let t=e.getFullYear(),a=e.getMonth()+1,o=e.getDate();return[`hour`,`minute`,`second`].includes(n??`day`)?new sn(t,a,o,0,0,0):new on(t,a,o)}}function xn(e,t){let n;return n=t instanceof cn?Qt(e):t instanceof sn?Zt(e):Xt(e),n.calendar===t.calendar?n:J(n,t.calendar)}function Q(e,t=W()){return e instanceof cn?e.toDate():e.toDate(t)}function Sn(e){if(e instanceof on)return`date`;if(e instanceof sn)return`datetime`;if(e instanceof cn)return`zoneddatetime`;throw Error(`Unknown date type`)}function Cn(e,t){switch(t){case`date`:return Xt(e);case`datetime`:return Zt(e);case`zoneddatetime`:return Qt(e);default:throw Error(`Unknown date type: ${t}`)}}function wn(e){return e instanceof sn}function Tn(e){return e instanceof cn}function En(e){return wn(e)||Tn(e)}function Dn(e){if(e instanceof Date){let t=e.getFullYear(),n=e.getMonth()+1;return new Date(t,n,0).getDate()}else return e.set({day:100}).day}function On(e,t){return e.compare(t)<0}function kn(e,t){return e.compare(t)>0}function An(e,t,n){let r=Xe(e,n);return t>r?e.subtract({days:r+7-t}):t===r?e:e.subtract({days:r-t})}function jn(e,t,n){let r=Xe(e,n),i=t===0?6:t-1;return r===i?e:r>i?e.add({days:7-r+i}):e.add({days:i-r})}var Mn={year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`};function Nn(e){let t=e.initialLocale;function n(e){t=e}function r(){return t}function i(e,n){return new Z(t,n).format(e)}function a(e,t=!0){return En(e)&&t?i(Q(e),{dateStyle:`long`,timeStyle:`long`}):i(Q(e),{dateStyle:`long`})}function o(n){return typeof e.monthFormat.current!=`function`&&typeof e.yearFormat.current!=`function`?new Z(t,{month:e.monthFormat.current,year:e.yearFormat.current}).format(n):`${typeof e.monthFormat.current==`function`?e.monthFormat.current(n.getMonth()+1):new Z(t,{month:e.monthFormat.current}).format(n)} ${typeof e.yearFormat.current==`function`?e.yearFormat.current(n.getFullYear()):new Z(t,{year:e.yearFormat.current}).format(n)}`}function s(e){return new Z(t,{month:`long`}).format(e)}function c(e){return new Z(t,{year:`numeric`}).format(e)}function l(e,n){return Tn(e)?new Z(t,{...n,timeZone:e.timeZone}).formatToParts(Q(e)):new Z(t,n).formatToParts(Q(e))}function u(e,n=`narrow`){return new Z(t,{weekday:n}).format(e)}function d(e,n=void 0){return new Z(t,{hour:`numeric`,minute:`numeric`,hourCycle:n===24?`h23`:void 0}).formatToParts(e).find(e=>e.type===`dayPeriod`)?.value===`PM`?`PM`:`AM`}function f(e,t,n={}){let r=l(e,{...Mn,...n}).find(e=>e.type===t);return r?r.value:``}return{setLocale:n,getLocale:r,fullMonth:s,fullYear:c,fullMonthAndYear:o,toParts:l,custom:i,part:f,dayPeriod:d,selectedDate:a,dayOfWeek:u}}function Pn(e){return!(!de(e)||!e.hasAttribute(`data-bits-day`))}function Fn(e,t){let n=[],r=e.add({days:1}),i=t;for(;r.compare(i)<0;)n.push(r),r=r.add({days:1});return n}function In(e){let{dateObj:t,weekStartsOn:n,fixedWeeks:r,locale:i}=e,a=Dn(t),o=Array.from({length:a},(e,n)=>t.set({day:n+1})),s=at(t),c=ot(t),l=n===void 0?An(s,0,i):An(s,n,`en-US`),u=n===void 0?jn(c,0,i):jn(c,n,`en-US`),d=Fn(l.subtract({days:1}),s),f=Fn(c,u.add({days:1})),p=d.length+o.length+f.length;if(r&&p<42){let e=42-p,n=f[f.length-1];n||=t.add({months:1}).set({day:1});let r=e;f.length===0&&(r=e-1,f.push(n));let i=Array.from({length:r},(e,t)=>{let r=t+1;return n.add({days:r})});f.push(...i)}let m=d.concat(o,f);return{value:t,dates:m,weeks:I(m,7)}}function Ln(e){let{numberOfMonths:t,dateObj:n,...r}=e,i=[];if(!t||t===1)return i.push(In({...r,dateObj:n})),i;i.push(In({...r,dateObj:n}));for(let e=1;e<t;e++){let t=n.add({months:e});i.push(In({...r,dateObj:t}))}return i}function Rn(e){return e?Array.from(e.querySelectorAll(`[data-bits-day]:not([data-disabled]):not([data-outside-visible-months])`)).filter(e=>de(e)):[]}function zn(e,t){let n=e.getAttribute(`data-value`);n&&(t.current=xn(n,t.current))}function Bn({node:e,add:t,placeholder:n,calendarNode:r,isPrevButtonDisabled:i,isNextButtonDisabled:a,months:o,numberOfMonths:s}){let c=Rn(r);if(!c.length)return;let l=c.indexOf(e)+t;if(oe(l,c)){let e=c[l];return zn(e,n),e.focus()}if(l<0){if(i)return;let e=o[0]?.value;if(!e)return;n.current=e.subtract({months:s}),ye(()=>{let e=Rn(r);if(!e.length)return;let t=e.length-Math.abs(l);if(oe(t,e)){let r=e[t];return zn(r,n),r.focus()}})}if(l>=c.length){if(a)return;let e=o[0]?.value;if(!e)return;n.current=e.add({months:s}),ye(()=>{let e=Rn(r);if(!e.length)return;let t=l-c.length;if(oe(t,e))return e[t].focus()})}}var Vn=[pe,ue,fe,me],Hn=[he,` `];function Un({event:e,handleCellClick:t,shiftFocus:n,placeholderValue:r}){let i=e.target;if(!Pn(i)||!Vn.includes(e.key)&&!Hn.includes(e.key))return;e.preventDefault();let a={[pe]:7,[ue]:-7,[fe]:-1,[me]:1};if(Vn.includes(e.key)){let t=a[e.key];t!==void 0&&n(i,t)}if(Hn.includes(e.key)){let n=i.getAttribute(`data-value`);if(!n)return;t(e,xn(n,r))}}function Wn({months:e,setMonths:t,numberOfMonths:n,pagedNavigation:r,weekStartsOn:i,locale:a,fixedWeeks:o,setPlaceholder:s}){let c=e[0]?.value;if(c)if(r)s(c.add({months:n}));else{let e=c.add({months:1}),r=Ln({dateObj:e,weekStartsOn:i,locale:a,fixedWeeks:o,numberOfMonths:n});s(e),t(r)}}function Gn({months:e,setMonths:t,numberOfMonths:n,pagedNavigation:r,weekStartsOn:i,locale:a,fixedWeeks:o,setPlaceholder:s}){let c=e[0]?.value;if(c)if(r)s(c.subtract({months:n}));else{let e=c.subtract({months:1}),r=Ln({dateObj:e,weekStartsOn:i,locale:a,fixedWeeks:o,numberOfMonths:n});s(e),t(r)}}function Kn({months:e,formatter:t,weekdayFormat:n}){if(!e.length)return[];let r=e[0].weeks[0];return r?r.map(e=>t.dayOfWeek(Q(e),n)):[]}function qn(e){D(()=>{let t=e.weekStartsOn.current,n=e.locale.current,r=e.fixedWeeks.current,i=e.numberOfMonths.current;d(()=>{let a=e.placeholder.current;if(!a)return;let o={weekStartsOn:t,locale:n,fixedWeeks:r,numberOfMonths:i};e.setMonths(Ln({...o,dateObj:a}))})})}function Jn({calendarNode:e,label:t,accessibleHeadingId:n}){let r=be(e),i=r.createElement(`div`);i.style.cssText=R({border:`0px`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(50%)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0px`,position:`absolute`,whiteSpace:`nowrap`,width:`1px`});let a=r.createElement(`div`);return a.textContent=t,a.id=n,a.role=`heading`,a.ariaLevel=`2`,e.insertBefore(i,e.firstChild),i.appendChild(a),()=>{let e=r.getElementById(n);e&&(i.parentElement?.removeChild(i),e.remove())}}function Yn({placeholder:e,getVisibleMonths:t,weekStartsOn:n,locale:r,fixedWeeks:i,numberOfMonths:a,setMonths:o}){D(()=>{e.current,d(()=>{t().some(t=>Ke(t,e.current))||o(Ln({weekStartsOn:n.current,locale:r.current,fixedWeeks:i.current,numberOfMonths:a.current,dateObj:e.current}))})})}function Xn({maxValue:e,months:t,disabled:n}){if(!e||!t.length)return!1;if(n)return!0;let r=t[t.length-1]?.value;return r?kn(r.add({months:1}).set({day:1}),e):!1}function Zn({minValue:e,months:t,disabled:n}){if(!e||!t.length)return!1;if(n)return!0;let r=t[0]?.value;return r?On(r.subtract({months:1}).set({day:35}),e):!1}function Qn({months:e,locale:t,formatter:n}){if(!e.length)return``;if(t!==n.getLocale()&&n.setLocale(t),e.length===1){let t=Q(e[0].value);return`${n.fullMonthAndYear(t)}`}let r=Q(e[0].value),i=Q(e[e.length-1].value),a=n.fullMonth(r),o=n.fullMonth(i),s=n.fullYear(r),c=n.fullYear(i);return s===c?`${a} - ${o} ${c}`:`${a} ${s} - ${o} ${c}`}function $n({fullCalendarLabel:e,id:t,isInvalid:n,disabled:r,readonly:i}){return{id:t,role:`application`,"aria-label":e,"data-invalid":z(n),"data-disabled":z(r),"data-readonly":z(i)}}function er(e){let t=be(e.target).querySelector(`[data-bits-day][data-focused]`);t&&(e.preventDefault(),t?.focus())}function tr(e){if(!le)return;let t=Array.from(e.querySelectorAll(`[data-bits-day]:not([aria-disabled=true])`));if(t.length===0)return;let n=t[0],r=n?.getAttribute(`data-value`),i=n?.getAttribute(`data-type`);if(!(!r||!i))return Cn(r,i)}function nr({ref:e,placeholder:t,defaultPlaceholder:n,minValue:r,maxValue:i,isDateDisabled:a}){function o(e){return!!(a.current(e)||r.current&&On(e,r.current)||i.current&&On(i.current,e))}ce(()=>e.current,()=>{e.current&&t.current&&U(t.current,n)&&o(n)&&(t.current=tr(e.current)??n)})}function rr(e,t){return!e||!t?e:En(e)&&En(t)?e.set({hour:t.hour,minute:t.minute,millisecond:t.millisecond,second:t.second}):e}var ir=B({component:`calendar`,parts:[`root`,`grid`,`cell`,`next-button`,`prev-button`,`day`,`grid-body`,`grid-head`,`grid-row`,`head-cell`,`header`,`heading`,`month-select`,`year-select`]});function ar(e){let t=new Date().getFullYear(),n=Math.max(e.placeholderYear,t),r,i;if(e.minValue)r=e.minValue.year;else{let t=n-100;r=e.placeholderYear<t?e.placeholderYear-10:t}i=e.maxValue?e.maxValue.year:n+10,r>i&&(r=i);let a=i-r+1;return Array.from({length:a},(e,t)=>r+t)}var $=new se(`Calendar.Root | RangeCalender.Root`),or=class e{static create(t){return $.set(new e(t))}opts;#e=p(()=>this.months.map(e=>e.value));get visibleMonths(){return g(this.#e)}set visibleMonths(e){_(this.#e,e)}formatter;accessibleHeadingId=ge();domContext;attachment;#t=A(T([]));get months(){return g(this.#t)}set months(e){_(this.#t,e,!0)}announcer;constructor(e){this.opts=e,this.attachment=F(this.opts.ref),this.domContext=new ve(e.ref),this.announcer=vn(null),this.formatter=Nn({initialLocale:this.opts.locale.current,monthFormat:this.opts.monthFormat,yearFormat:this.opts.yearFormat}),this.setMonths=this.setMonths.bind(this),this.nextPage=this.nextPage.bind(this),this.prevPage=this.prevPage.bind(this),this.prevYear=this.prevYear.bind(this),this.nextYear=this.nextYear.bind(this),this.setYear=this.setYear.bind(this),this.setMonth=this.setMonth.bind(this),this.isOutsideVisibleMonths=this.isOutsideVisibleMonths.bind(this),this.isDateDisabled=this.isDateDisabled.bind(this),this.isDateSelected=this.isDateSelected.bind(this),this.shiftFocus=this.shiftFocus.bind(this),this.handleCellClick=this.handleCellClick.bind(this),this.handleMultipleUpdate=this.handleMultipleUpdate.bind(this),this.handleSingleUpdate=this.handleSingleUpdate.bind(this),this.onkeydown=this.onkeydown.bind(this),this.getBitsAttr=this.getBitsAttr.bind(this),ne(()=>{this.announcer=vn(this.domContext.getDocument())}),this.months=Ln({dateObj:this.opts.placeholder.current,weekStartsOn:this.opts.weekStartsOn.current,locale:this.opts.locale.current,fixedWeeks:this.opts.fixedWeeks.current,numberOfMonths:this.opts.numberOfMonths.current}),this.#a(),this.#o(),this.#s(),Yn({placeholder:this.opts.placeholder,getVisibleMonths:()=>this.visibleMonths,weekStartsOn:this.opts.weekStartsOn,locale:this.opts.locale,fixedWeeks:this.opts.fixedWeeks,numberOfMonths:this.opts.numberOfMonths,setMonths:e=>this.months=e}),qn({fixedWeeks:this.opts.fixedWeeks,locale:this.opts.locale,numberOfMonths:this.opts.numberOfMonths,placeholder:this.opts.placeholder,setMonths:this.setMonths,weekStartsOn:this.opts.weekStartsOn}),ce(()=>this.fullCalendarLabel,e=>{let t=this.domContext.getElementById(this.accessibleHeadingId);t&&(t.textContent=e)}),ce(()=>this.opts.value.current,()=>{let e=this.opts.value.current;if(Array.isArray(e)&&e.length){let t=e[e.length-1];t&&this.opts.placeholder.current!==t&&(this.opts.placeholder.current=t)}else !Array.isArray(e)&&e&&this.opts.placeholder.current!==e&&(this.opts.placeholder.current=e)}),nr({placeholder:e.placeholder,defaultPlaceholder:e.defaultPlaceholder,isDateDisabled:e.isDateDisabled,maxValue:e.maxValue,minValue:e.minValue,ref:e.ref})}setMonths(e){this.months=e}#n=p(()=>Kn({months:this.months,formatter:this.formatter,weekdayFormat:this.opts.weekdayFormat.current}));get weekdays(){return g(this.#n)}set weekdays(e){_(this.#n,e)}#r=p(()=>d(()=>this.opts.placeholder.current.year));get initialPlaceholderYear(){return g(this.#r)}set initialPlaceholderYear(e){_(this.#r,e)}#i=p(()=>ar({minValue:this.opts.minValue.current,maxValue:this.opts.maxValue.current,placeholderYear:this.initialPlaceholderYear}));get defaultYears(){return g(this.#i)}set defaultYears(e){_(this.#i,e)}#a(){D(()=>{if(d(()=>this.opts.initialFocus.current)){let e=this.opts.ref.current?.querySelector(`[data-focused]`);e&&e.focus()}})}#o(){D(()=>{if(this.opts.ref.current)return Jn({calendarNode:this.opts.ref.current,label:this.fullCalendarLabel,accessibleHeadingId:this.accessibleHeadingId})})}#s(){re(()=>{this.formatter.getLocale()!==this.opts.locale.current&&this.formatter.setLocale(this.opts.locale.current)})}nextPage(){Wn({fixedWeeks:this.opts.fixedWeeks.current,locale:this.opts.locale.current,numberOfMonths:this.opts.numberOfMonths.current,pagedNavigation:this.opts.pagedNavigation.current,setMonths:this.setMonths,setPlaceholder:e=>this.opts.placeholder.current=e,weekStartsOn:this.opts.weekStartsOn.current,months:this.months})}prevPage(){Gn({fixedWeeks:this.opts.fixedWeeks.current,locale:this.opts.locale.current,numberOfMonths:this.opts.numberOfMonths.current,pagedNavigation:this.opts.pagedNavigation.current,setMonths:this.setMonths,setPlaceholder:e=>this.opts.placeholder.current=e,weekStartsOn:this.opts.weekStartsOn.current,months:this.months})}nextYear(){this.opts.placeholder.current=this.opts.placeholder.current.add({years:1})}prevYear(){this.opts.placeholder.current=this.opts.placeholder.current.subtract({years:1})}setYear(e){this.opts.placeholder.current=this.opts.placeholder.current.set({year:e})}setMonth(e){this.opts.placeholder.current=this.opts.placeholder.current.set({month:e})}#c=p(()=>Xn({maxValue:this.opts.maxValue.current,months:this.months,disabled:this.opts.disabled.current}));get isNextButtonDisabled(){return g(this.#c)}set isNextButtonDisabled(e){_(this.#c,e)}#l=p(()=>Zn({minValue:this.opts.minValue.current,months:this.months,disabled:this.opts.disabled.current}));get isPrevButtonDisabled(){return g(this.#l)}set isPrevButtonDisabled(e){_(this.#l,e)}#u=p(()=>{let e=this.opts.value.current,t=this.opts.isDateDisabled.current,n=this.opts.isDateUnavailable.current;if(Array.isArray(e)){if(!e.length)return!1;for(let r of e)if(t(r)||n(r))return!0}else{if(!e)return!1;if(t(e)||n(e))return!0}return!1});get isInvalid(){return g(this.#u)}set isInvalid(e){_(this.#u,e)}#d=p(()=>(this.opts.monthFormat.current,this.opts.yearFormat.current,Qn({months:this.months,formatter:this.formatter,locale:this.opts.locale.current})));get headingValue(){return g(this.#d)}set headingValue(e){_(this.#d,e)}#f=p(()=>`${this.opts.calendarLabel.current} ${this.headingValue}`);get fullCalendarLabel(){return g(this.#f)}set fullCalendarLabel(e){_(this.#f,e)}isOutsideVisibleMonths(e){return!this.visibleMonths.some(t=>Ke(e,t))}isDateDisabled(e){if(this.opts.isDateDisabled.current(e)||this.opts.disabled.current)return!0;let t=this.opts.minValue.current,n=this.opts.maxValue.current;return!!(t&&On(e,t)||n&&On(n,e))}isDateSelected(e){let t=this.opts.value.current;return Array.isArray(t)?t.some(t=>U(t,e)):t?U(t,e):!1}shiftFocus(e,t){return Bn({node:e,add:t,placeholder:this.opts.placeholder,calendarNode:this.opts.ref.current,isPrevButtonDisabled:this.isPrevButtonDisabled,isNextButtonDisabled:this.isNextButtonDisabled,months:this.months,numberOfMonths:this.opts.numberOfMonths.current})}#p(e){if(this.opts.type.current!==`multiple`||!this.opts.maxDays.current)return!0;let t=e.length;return!(this.opts.maxDays.current&&t>this.opts.maxDays.current)}handleCellClick(e,t){if(this.opts.readonly.current||this.opts.isDateDisabled.current?.(t)||this.opts.isDateUnavailable.current?.(t))return;let n=this.opts.value.current;if(this.opts.type.current===`multiple`)(Array.isArray(n)||n===void 0)&&(this.opts.value.current=this.handleMultipleUpdate(n,t));else if(!Array.isArray(n)){let e=this.handleSingleUpdate(n,t);e?this.announcer.announce(`Selected Date: ${this.formatter.selectedDate(e,!1)}`,`polite`):this.announcer.announce(`Selected date is now empty.`,`polite`,5e3),this.opts.value.current=rr(e,n),e!==void 0&&this.opts.onDateSelect?.current?.()}}handleMultipleUpdate(e,t){if(!e){let e=[t];return this.#p(e)?e:[t]}if(!Array.isArray(e))return;let n=e.findIndex(e=>U(e,t)),r=this.opts.preventDeselect.current;if(n===-1){let n=[...e,t];return this.#p(n)?n:[t]}else if(r)return e;else{let n=e.filter(e=>!U(e,t));if(!n.length){this.opts.placeholder.current=t;return}return n}}handleSingleUpdate(e,t){if(!e)return t;if(!this.opts.preventDeselect.current&&U(e,t)){this.opts.placeholder.current=t;return}return t}onkeydown(e){Un({event:e,handleCellClick:this.handleCellClick,shiftFocus:this.shiftFocus,placeholderValue:this.opts.placeholder.current})}#m=p(()=>({months:this.months,weekdays:this.weekdays}));get snippetProps(){return g(this.#m)}set snippetProps(e){_(this.#m,e)}getBitsAttr=e=>ir.getAttr(e);#h=p(()=>({...$n({fullCalendarLabel:this.fullCalendarLabel,id:this.opts.id.current,isInvalid:this.isInvalid,disabled:this.opts.disabled.current,readonly:this.opts.readonly.current}),[this.getBitsAttr(`root`)]:``,onkeydown:this.onkeydown,...this.attachment}));get props(){return g(this.#h)}set props(e){_(this.#h,e)}},sr=class e{static create(t){return new e(t,$.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=F(this.opts.ref)}#e=p(()=>({id:this.opts.id.current,"aria-hidden":L(!0),"data-disabled":z(this.root.opts.disabled.current),"data-readonly":z(this.root.opts.readonly.current),[this.root.getBitsAttr(`heading`)]:``,...this.attachment}));get props(){return g(this.#e)}set props(e){_(this.#e,e)}},cr=new se(`Calendar.Cell | RangeCalendar.Cell`),lr=class e{static create(t){return cr.set(new e(t,$.get()))}opts;root;#e=p(()=>Q(this.opts.date.current));get cellDate(){return g(this.#e)}set cellDate(e){_(this.#e,e)}#t=p(()=>this.root.opts.isDateUnavailable.current(this.opts.date.current));get isUnavailable(){return g(this.#t)}set isUnavailable(e){_(this.#t,e)}#n=p(()=>Je(this.opts.date.current,W()));get isDateToday(){return g(this.#n)}set isDateToday(e){_(this.#n,e)}#r=p(()=>!Ke(this.opts.date.current,this.opts.month.current));get isOutsideMonth(){return g(this.#r)}set isOutsideMonth(e){_(this.#r,e)}#i=p(()=>this.root.isOutsideVisibleMonths(this.opts.date.current));get isOutsideVisibleMonths(){return g(this.#i)}set isOutsideVisibleMonths(e){_(this.#i,e)}#a=p(()=>this.root.isDateDisabled(this.opts.date.current)||this.isOutsideMonth&&this.root.opts.disableDaysOutsideMonth.current);get isDisabled(){return g(this.#a)}set isDisabled(e){_(this.#a,e)}#o=p(()=>U(this.opts.date.current,this.root.opts.placeholder.current));get isFocusedDate(){return g(this.#o)}set isFocusedDate(e){_(this.#o,e)}#s=p(()=>this.root.isDateSelected(this.opts.date.current));get isSelectedDate(){return g(this.#s)}set isSelectedDate(e){_(this.#s,e)}#c=p(()=>this.root.formatter.custom(this.cellDate,{weekday:`long`,month:`long`,day:`numeric`,year:`numeric`}));get labelText(){return g(this.#c)}set labelText(e){_(this.#c,e)}attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=F(this.opts.ref)}#l=p(()=>({disabled:this.isDisabled,unavailable:this.isUnavailable,selected:this.isSelectedDate,day:`${this.opts.date.current.day}`}));get snippetProps(){return g(this.#l)}set snippetProps(e){_(this.#l,e)}#u=p(()=>this.isDisabled||this.isOutsideMonth&&this.root.opts.disableDaysOutsideMonth.current||this.isUnavailable);get ariaDisabled(){return g(this.#u)}set ariaDisabled(e){_(this.#u,e)}#d=p(()=>({"data-unavailable":z(this.isUnavailable),"data-today":this.isDateToday?``:void 0,"data-outside-month":this.isOutsideMonth?``:void 0,"data-outside-visible-months":this.isOutsideVisibleMonths?``:void 0,"data-focused":this.isFocusedDate?``:void 0,"data-selected":z(this.isSelectedDate),"data-value":this.opts.date.current.toString(),"data-type":Sn(this.opts.date.current),"data-disabled":z(this.isDisabled||this.isOutsideMonth&&this.root.opts.disableDaysOutsideMonth.current)}));get sharedDataAttrs(){return g(this.#d)}set sharedDataAttrs(e){_(this.#d,e)}#f=p(()=>({id:this.opts.id.current,role:`gridcell`,"aria-selected":_e(this.isSelectedDate),"aria-disabled":_e(this.ariaDisabled),...this.sharedDataAttrs,[this.root.getBitsAttr(`cell`)]:``,...this.attachment}));get props(){return g(this.#f)}set props(e){_(this.#f,e)}},ur=class e{static create(t){return new e(t,cr.get())}opts;cell;attachment;constructor(e,t){this.opts=e,this.cell=t,this.onclick=this.onclick.bind(this),this.attachment=F(this.opts.ref)}#e=p(()=>this.cell.isOutsideMonth&&this.cell.root.opts.disableDaysOutsideMonth.current||this.cell.isDisabled?void 0:this.cell.isFocusedDate?0:-1);onclick(e){this.cell.isDisabled||this.cell.root.handleCellClick(e,this.cell.opts.date.current)}#t=p(()=>({disabled:this.cell.isDisabled,unavailable:this.cell.isUnavailable,selected:this.cell.isSelectedDate,day:`${this.cell.opts.date.current.day}`}));get snippetProps(){return g(this.#t)}set snippetProps(e){_(this.#t,e)}#n=p(()=>({id:this.opts.id.current,role:`button`,"aria-label":this.cell.labelText,"aria-disabled":_e(this.cell.ariaDisabled),...this.cell.sharedDataAttrs,tabindex:g(this.#e),[this.cell.root.getBitsAttr(`day`)]:``,"data-bits-day":``,onclick:this.onclick,...this.attachment}));get props(){return g(this.#n)}set props(e){_(this.#n,e)}},dr=class e{static create(t){return new e(t,$.get())}opts;root;#e=p(()=>this.root.isNextButtonDisabled);get isDisabled(){return g(this.#e)}set isDisabled(e){_(this.#e,e)}attachment;constructor(e,t){this.opts=e,this.root=t,this.onclick=this.onclick.bind(this),this.attachment=F(this.opts.ref)}onclick(e){this.isDisabled||this.root.nextPage()}#t=p(()=>({id:this.opts.id.current,role:`button`,type:`button`,"aria-label":`Next`,"aria-disabled":_e(this.isDisabled),"data-disabled":z(this.isDisabled),disabled:this.isDisabled,[this.root.getBitsAttr(`next-button`)]:``,onclick:this.onclick,...this.attachment}));get props(){return g(this.#t)}set props(e){_(this.#t,e)}},fr=class e{static create(t){return new e(t,$.get())}opts;root;#e=p(()=>this.root.isPrevButtonDisabled);get isDisabled(){return g(this.#e)}set isDisabled(e){_(this.#e,e)}attachment;constructor(e,t){this.opts=e,this.root=t,this.onclick=this.onclick.bind(this),this.attachment=F(this.opts.ref)}onclick(e){this.isDisabled||this.root.prevPage()}#t=p(()=>({id:this.opts.id.current,role:`button`,type:`button`,"aria-label":`Previous`,"aria-disabled":_e(this.isDisabled),"data-disabled":z(this.isDisabled),disabled:this.isDisabled,[this.root.getBitsAttr(`prev-button`)]:``,onclick:this.onclick,...this.attachment}));get props(){return g(this.#t)}set props(e){_(this.#t,e)}},pr=class e{static create(t){return new e(t,$.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=F(this.opts.ref)}#e=p(()=>({id:this.opts.id.current,tabindex:-1,role:`grid`,"aria-readonly":_e(this.root.opts.readonly.current),"aria-disabled":_e(this.root.opts.disabled.current),"data-readonly":z(this.root.opts.readonly.current),"data-disabled":z(this.root.opts.disabled.current),[this.root.getBitsAttr(`grid`)]:``,...this.attachment}));get props(){return g(this.#e)}set props(e){_(this.#e,e)}},mr=class e{static create(t){return new e(t,$.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=F(this.opts.ref)}#e=p(()=>({id:this.opts.id.current,"data-disabled":z(this.root.opts.disabled.current),"data-readonly":z(this.root.opts.readonly.current),[this.root.getBitsAttr(`grid-body`)]:``,...this.attachment}));get props(){return g(this.#e)}set props(e){_(this.#e,e)}},hr=class e{static create(t){return new e(t,$.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=F(this.opts.ref)}#e=p(()=>({id:this.opts.id.current,"data-disabled":z(this.root.opts.disabled.current),"data-readonly":z(this.root.opts.readonly.current),[this.root.getBitsAttr(`grid-head`)]:``,...this.attachment}));get props(){return g(this.#e)}set props(e){_(this.#e,e)}},gr=class e{static create(t){return new e(t,$.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=F(this.opts.ref)}#e=p(()=>({id:this.opts.id.current,"data-disabled":z(this.root.opts.disabled.current),"data-readonly":z(this.root.opts.readonly.current),[this.root.getBitsAttr(`grid-row`)]:``,...this.attachment}));get props(){return g(this.#e)}set props(e){_(this.#e,e)}},_r=class e{static create(t){return new e(t,$.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=F(this.opts.ref)}#e=p(()=>({id:this.opts.id.current,"data-disabled":z(this.root.opts.disabled.current),"data-readonly":z(this.root.opts.readonly.current),[this.root.getBitsAttr(`head-cell`)]:``,...this.attachment}));get props(){return g(this.#e)}set props(e){_(this.#e,e)}},vr=f(`<div><!></div>`);function yr(e,i){let d=t();l(i,!0);let f=E(i,`ref`,15,null),_=E(i,`id`,19,()=>P(d)),y=O(i,[`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`]),b=ur.create({id:M(()=>_()),ref:M(()=>f(),e=>f(e))}),w=p(()=>N(y,b.props));var T=o(),ee=S(T),D=e=>{var t=o(),n=S(t);{let e=p(()=>({props:g(w),...b.snippetProps}));r(n,()=>i.child,()=>g(e))}a(e,t)},te=e=>{var t=vr();C(t,()=>({...g(w)}));var c=x(t),l=e=>{var t=o();r(S(t),()=>i.children??m,()=>b.snippetProps),a(e,t)},d=e=>{var t=h();v(()=>u(t,b.cell.opts.date.current.day)),a(e,t)};s(c,e=>{i.children?e(l):e(d,-1)}),n(t),a(e,t)};s(ee,e=>{i.child?e(D):e(te,-1)}),a(e,T),c()}var br=f(`<table><!></table>`);function xr(e,i){let u=t();l(i,!0);let d=E(i,`ref`,15,null),f=E(i,`id`,19,()=>P(u)),h=O(i,[`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`]),_=pr.create({id:M(()=>f()),ref:M(()=>d(),e=>d(e))}),v=p(()=>N(h,_.props));var y=o(),b=S(y),w=e=>{var t=o();r(S(t),()=>i.child,()=>({props:g(v)})),a(e,t)},T=e=>{var t=br();C(t,()=>({...g(v)})),r(x(t),()=>i.children??m),n(t),a(e,t)};s(b,e=>{i.child?e(w):e(T,-1)}),a(e,y),c()}var Sr=f(`<tbody><!></tbody>`);function Cr(e,i){let u=t();l(i,!0);let d=E(i,`ref`,15,null),f=E(i,`id`,19,()=>P(u)),h=O(i,[`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`]),_=mr.create({id:M(()=>f()),ref:M(()=>d(),e=>d(e))}),v=p(()=>N(h,_.props));var y=o(),b=S(y),w=e=>{var t=o();r(S(t),()=>i.child,()=>({props:g(v)})),a(e,t)},T=e=>{var t=Sr();C(t,()=>({...g(v)})),r(x(t),()=>i.children??m),n(t),a(e,t)};s(b,e=>{i.child?e(w):e(T,-1)}),a(e,y),c()}var wr=f(`<td><!></td>`);function Tr(e,i){let u=t();l(i,!0);let d=E(i,`ref`,15,null),f=E(i,`id`,19,()=>P(u)),h=O(i,[`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`,`date`,`month`]),_=lr.create({id:M(()=>f()),ref:M(()=>d(),e=>d(e)),date:M(()=>i.date),month:M(()=>i.month)}),v=p(()=>N(h,_.props));var y=o(),b=S(y),w=e=>{var t=o(),n=S(t);{let e=p(()=>({props:g(v),..._.snippetProps}));r(n,()=>i.child,()=>g(e))}a(e,t)},T=e=>{var t=wr();C(t,()=>({...g(v)})),r(x(t),()=>i.children??m,()=>_.snippetProps),n(t),a(e,t)};s(b,e=>{i.child?e(w):e(T,-1)}),a(e,y),c()}var Er=f(`<thead><!></thead>`);function Dr(e,i){let u=t();l(i,!0);let d=E(i,`ref`,15,null),f=E(i,`id`,19,()=>P(u)),h=O(i,[`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`]),_=hr.create({id:M(()=>f()),ref:M(()=>d(),e=>d(e))}),v=p(()=>N(h,_.props));var y=o(),b=S(y),w=e=>{var t=o();r(S(t),()=>i.child,()=>({props:g(v)})),a(e,t)},T=e=>{var t=Er();C(t,()=>({...g(v)})),r(x(t),()=>i.children??m),n(t),a(e,t)};s(b,e=>{i.child?e(w):e(T,-1)}),a(e,y),c()}var Or=f(`<th><!></th>`);function kr(e,i){let u=t();l(i,!0);let d=E(i,`ref`,15,null),f=E(i,`id`,19,()=>P(u)),h=O(i,[`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`]),_=_r.create({id:M(()=>f()),ref:M(()=>d(),e=>d(e))}),v=p(()=>N(h,_.props));var y=o(),b=S(y),w=e=>{var t=o();r(S(t),()=>i.child,()=>({props:g(v)})),a(e,t)},T=e=>{var t=Or();C(t,()=>({...g(v)})),r(x(t),()=>i.children??m),n(t),a(e,t)};s(b,e=>{i.child?e(w):e(T,-1)}),a(e,y),c()}var Ar=f(`<tr><!></tr>`);function jr(e,i){let u=t();l(i,!0);let d=E(i,`ref`,15,null),f=E(i,`id`,19,()=>P(u)),h=O(i,[`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`]),_=gr.create({id:M(()=>f()),ref:M(()=>d(),e=>d(e))}),v=p(()=>N(h,_.props));var y=o(),b=S(y),w=e=>{var t=o();r(S(t),()=>i.child,()=>({props:g(v)})),a(e,t)},T=e=>{var t=Ar();C(t,()=>({...g(v)})),r(x(t),()=>i.children??m),n(t),a(e,t)};s(b,e=>{i.child?e(w):e(T,-1)}),a(e,y),c()}var Mr=f(`<div><!></div>`);function Nr(e,i){let d=t();l(i,!0);let f=E(i,`ref`,15,null),_=E(i,`id`,19,()=>P(d)),y=O(i,[`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`ref`,`id`]),b=sr.create({id:M(()=>_()),ref:M(()=>f(),e=>f(e))}),w=p(()=>N(y,b.props));var T=o(),ee=S(T),D=e=>{var t=o();r(S(t),()=>i.child,()=>({props:g(w),headingValue:b.root.headingValue})),a(e,t)},te=e=>{var t=Mr();C(t,()=>({...g(w)}));var c=x(t),l=e=>{var t=o();r(S(t),()=>i.children??m,()=>({headingValue:b.root.headingValue})),a(e,t)},d=e=>{var t=h();v(()=>u(t,b.root.headingValue)),a(e,t)};s(c,e=>{i.children?e(l):e(d,-1)}),n(t),a(e,t)};s(ee,e=>{i.child?e(D):e(te,-1)}),a(e,T),c()}var Pr=f(`<button><!></button>`);function Fr(e,i){let u=t();l(i,!0);let d=E(i,`id`,19,()=>P(u)),f=E(i,`ref`,15,null),h=E(i,`tabindex`,3,0),_=O(i,[`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`tabindex`]),v=dr.create({id:M(()=>d()),ref:M(()=>f(),e=>f(e))}),y=p(()=>N(_,v.props,{tabindex:h()}));var b=o(),w=S(b),T=e=>{var t=o();r(S(t),()=>i.child,()=>({props:g(y)})),a(e,t)},ee=e=>{var t=Pr();C(t,()=>({...g(y)})),r(x(t),()=>i.children??m),n(t),a(e,t)};s(w,e=>{i.child?e(T):e(ee,-1)}),a(e,b),c()}var Ir=f(`<button><!></button>`);function Lr(e,i){let u=t();l(i,!0);let d=E(i,`id`,19,()=>P(u)),f=E(i,`ref`,15,null),h=E(i,`tabindex`,3,0),_=O(i,[`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`tabindex`]),v=fr.create({id:M(()=>d()),ref:M(()=>f(),e=>f(e))}),y=p(()=>N(_,v.props,{tabindex:h()}));var b=o(),w=S(b),T=e=>{var t=o();r(S(t),()=>i.child,()=>({props:g(y)})),a(e,t)},ee=e=>{var t=Ir();C(t,()=>({...g(y)})),r(x(t),()=>i.children??m),n(t),a(e,t)};s(w,e=>{i.child?e(T):e(ee,-1)}),a(e,b),c()}var Rr=i({commentExtension:()=>Ur,refreshCommentsEffect:()=>zr}),zr=Oe.define(),Br=De.define({create(){return Ae.none},update(e,t){let n=e.map(t.changes);for(let e of t.effects)e.is(zr),e.is(Vr)&&(n=e.value.map(t.changes));return n},provide:e=>H.decorations.from(e)}),Vr=Oe.define();function Hr(e,t){let n=Ie.getForEntry(t.repo,t.entryType,t.entryId),r=e.state.doc.length,i=[],a=[];for(let e of n){if(e.deletedAt||e.commentId!==e.threadId||!e.anchorRelpos)continue;let n=Fe(t.ydoc,t.ytext,e.anchorRelpos,e.anchorQuote??``);if(n.orphaned)continue;let o=Math.max(0,Math.min(n.from,r)),s=Math.max(o,Math.min(n.to,r));if(o===s)continue;let c=e.resolvedAt!==null,l=c?`sg-comment-highlight sg-comment-resolved`:`sg-comment-highlight`;i.push({from:o,to:s,deco:Ae.mark({class:l,attributes:{"data-comment-id":e.commentId,"data-thread-id":e.threadId}})}),a.push({commentId:e.commentId,threadId:e.threadId,from:o,to:s,recovered:n.recovered,resolved:c,authorRole:e.authorRole})}return i.sort((e,t)=>e.from-t.from||e.to-t.to),{decorations:Ae.set(i.map(e=>e.deco.range(e.from,e.to))),markers:a}}function Ur(e){let t=[];return[Br,ke.define(n=>{function r(){let r=e.getContext();if(!r)return;let{decorations:i,markers:a}=Hr(n,r);n.dispatch({effects:Vr.of(i)}),t=a,e.onMarkersChanged?.(a)}let i=!1,a=()=>{i||(i=!0,queueMicrotask(()=>{i=!1,r()}))};return a(),{update(e){for(let t of e.transactions)for(let e of t.effects)if(e.is(zr)){a();return}e.docChanged&&a()}}}),H.domEventHandlers({click(n,r){let i=n.target.closest(`.sg-comment-highlight`);if(!i)return e.onCommentClickAway?.(),!1;let a=i.dataset.threadId;if(!a)return!1;if(t.some(e=>e.threadId===a))return e.onCommentClick(a),!0;let o=r.posAtCoords({x:n.clientX,y:n.clientY});if(o!==null){let n=null;for(let e of t)o>=e.from&&o<=e.to&&(!n||e.to-e.from<n.to-n.from)&&(n=e);if(n)return e.onCommentClick(n.threadId),!0}return e.onCommentClickAway?.(),!1}})]}async function Wr(e){let{EditorState:t,Compartment:n}=await j(async()=>{let{EditorState:e,Compartment:t}=await import(`./Wowi_89k.js`).then(e=>e.x);return{EditorState:e,Compartment:t}},__vite__mapDeps([0,1]),import.meta.url),{ViewPlugin:r,keymap:i}=await j(async()=>{let{ViewPlugin:e,keymap:t}=await import(`./D3JoMtWC.js`).then(e=>e.s);return{ViewPlugin:e,keymap:t}},__vite__mapDeps([2,1,0]),import.meta.url),{createCollabSession:a}=await j(async()=>{let{createCollabSession:e}=await import(`./CPggL5T4.js`);return{createCollabSession:e}},__vite__mapDeps([3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url),{yCollab:o,yUndoManagerKeymap:s}=await j(async()=>{let{yCollab:e,yUndoManagerKeymap:t}=await import(`./CoHaBDpN.js`);return{yCollab:e,yUndoManagerKeymap:t}},__vite__mapDeps([18,0,1,2,4]),import.meta.url),c=await j(()=>import(`./B-Z_xZy_.js`).then(e=>e.p),__vite__mapDeps([4,1]),import.meta.url),l=!1,u=!1,d=a(e.cursorDocName,{name:e.userDisplayName,color:e.accentColor,colorLight:e.accentColor+`33`},{onSync:()=>{l=!0,e.onSync()}}),f=new c.UndoManager(d.ytext,{captureTimeout:500}),p=[o(d.ytext,null,{undoManager:f}),i.of(s)],m=new n;p.push(m.of(t.readOnly.of(!0))),p.push(r.define(e=>{let t=!1;function n(){let t=e.state.selection.main,n=d.ytext,r=c.createRelativePositionFromTypeIndex(n,t.anchor),i=c.createRelativePositionFromTypeIndex(n,t.head);d.awareness.setLocalStateField(`cursor`,{anchor:c.relativePositionToJSON(r),head:c.relativePositionToJSON(i)})}return{update(e){!t&&e.focusChanged&&e.view.hasFocus&&(t=!0),t&&(e.selectionSet||e.docChanged||e.focusChanged)&&n()}}}));let h=d.ydoc.clientID;function g(){let e=[];return d.awareness.getStates().forEach((t,n)=>{if(n===h)return;let r=t?.user?.name??`Anonymous`;e.push({name:r})}),e}let _=``;function v(){let t=g(),n=t.map(e=>e.name).sort().join(`|`);n!==_&&(_=n,e.onCollaboratorsChange(t))}function y({added:t,updated:n,removed:r}){[...t,...n,...r].some(e=>e!==h)&&e.onRemoteAwarenessChange(),(t.length>0||r.length>0)&&v()}return d.awareness.on(`change`,y),v(),p.push(r.define(()=>({update(t){(t.docChanged||t.geometryChanged||t.viewportChanged||t.selectionSet)&&e.onViewportChange()},destroy(){d.awareness.off(`change`,y)}}))),{extensions:p,session:d,syncGate:m,consumeEarlyUnlock:()=>!l||u?!1:(u=!0,!0),destroy:()=>{d.awareness.off(`change`,y),d.destroy()}}}function Gr(e,t){return Ce(Se.current().formats,e,t)}function Kr(e){let t=e.uploadFn??we;Se.load();async function n(n,r){let i=e.getView();if(!i)return;let a=e.cursorDocName.split(`/`);if(a.length<3)return;let[o,s,...c]=a,l=c.join(`/`);for(let e of n){let n=`![Uploading ${e.name}...]()`;i.dispatch({changes:{from:r,insert:n}});try{let r=await t(o,s,l,e),a=`![${e.name}](${r.url})`,c=i.state.doc.toString().indexOf(n);c>=0&&i.dispatch({changes:{from:c,to:c+n.length,insert:a}})}catch{let t=i.state.doc.toString().indexOf(n);t>=0&&i.dispatch({changes:{from:t,to:t+n.length,insert:`<!-- Upload failed: ${e.name} -->`}})}r+=n.length}}return H.domEventHandlers({drop(t){let r=e.getView(),i=t.dataTransfer?.files;if(!i?.length)return!1;let a=[...i].filter(e=>Gr(e.name,e.type));return a.length?(t.preventDefault(),n(a,r?.posAtCoords({x:t.clientX,y:t.clientY})??r?.state.selection.main.head??0),!0):!1},paste(t){let r=e.getView(),i=t.clipboardData?.items;if(!i)return!1;let a=[];for(let e of i)if(e.kind===`file`&&Gr(``,e.type)){let t=e.getAsFile();t&&a.push(t)}return a.length?(t.preventDefault(),n(a,r?.state.selection.main.head??0),!0):!1}})}var qr=Oe.define(),Jr=Ae.mark({class:`sg-comment-highlight sg-comment-draft`}),Yr=De.define({create:()=>Ae.none,update(e,t){e=e.map(t.changes);for(let e of t.effects)if(e.is(qr)){let t=e.value;return!t||t.from===t.to?Ae.none:Ae.set([Jr.range(t.from,t.to)])}return e},provide:e=>H.decorations.from(e)}),Xr=H.baseTheme({".sg-comment-highlight":{background:`color-mix(in srgb, var(--color-accent) 18%, transparent)`,borderBottom:`1px solid color-mix(in srgb, var(--color-accent) 60%, transparent)`,cursor:`pointer`},".sg-comment-highlight.sg-comment-resolved":{background:`color-mix(in srgb, var(--color-accent) 6%, transparent)`,borderBottomColor:`color-mix(in srgb, var(--color-accent) 30%, transparent)`},".sg-comment-highlight.is-hover-preview":{background:`color-mix(in srgb, var(--color-accent) 40%, transparent)`,borderBottomColor:`var(--color-accent)`},".sg-comment-highlight.is-active":{background:`color-mix(in srgb, var(--color-accent) 40%, transparent)`,borderBottomColor:`var(--color-accent)`},".sg-comment-highlight:hover":{background:`color-mix(in srgb, var(--color-accent) 40%, transparent)`,borderBottomColor:`var(--color-accent)`},".sg-comment-highlight.sg-comment-draft":{background:`color-mix(in srgb, var(--color-accent) 24%, transparent)`,borderBottomColor:`var(--color-accent)`},".sg-comment-selection-btn":{display:`inline-flex`,alignItems:`center`,gap:`var(--space-2)`,padding:`var(--menu-item-padding)`,minHeight:`var(--menu-item-height)`,fontSize:`var(--menu-font-size)`,fontFamily:`var(--font-sans)`,color:`var(--color-text-secondary)`,background:`var(--color-bg-elevated)`,border:`1px solid var(--color-border)`,borderRadius:`var(--menu-item-radius)`,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.18)`,cursor:`pointer`,whiteSpace:`nowrap`},".sg-comment-selection-btn:hover":{background:`var(--color-bg-hover)`,color:`var(--color-text-primary)`},"@media (max-width: 1023px)":{".sg-comment-selection-btn":{display:`none !important`}}});function Zr(e){let t=e.split(`/`);if(t.length<3)return null;let[n,r,...i]=t;return{repo:n,entryType:r,entryId:i.join(`/`)}}async function Qr(e){let t=Zr(e.cursorDocName);if(!t)return null;let{commentExtension:n}=await j(async()=>{let{commentExtension:e}=await Promise.resolve().then(()=>Rr);return{commentExtension:e}},void 0,import.meta.url),{commentSelectionPopup:r}=await j(async()=>{let{commentSelectionPopup:e}=await import(`./BoglwbZW.js`).then(e=>e.t);return{commentSelectionPopup:e}},__vite__mapDeps([19,1,0,2]),import.meta.url),{commentsStore:i}=await j(async()=>{let{commentsStore:e}=await import(`./DwTthEC8.js`).then(e=>e.n);return{commentsStore:e}},__vite__mapDeps([20,1,9,5,6,7,8,10,11,12,13,14,15,16,17]),import.meta.url),{serializeAnchor:a}=await j(async()=>{let{serializeAnchor:e}=await import(`./B2n86UNJ.js`).then(e=>e.t);return{serializeAnchor:e}},__vite__mapDeps([21,1,4]),import.meta.url),o=e.session,s={repo:t.repo,entryType:t.entryType,entryId:t.entryId,ydoc:o.ydoc,ytext:o.ytext};return i.load(t.repo,t.entryType,t.entryId),{extensions:[Xr,Yr,...n({getContext:()=>s,onCommentClick:t=>e.onCommentOpen(t),onCommentClickAway:()=>e.onCommentClickAway?.(),onMarkersChanged:t=>e.onCommentMarkers?.(t)}),r({onCommentRequested:t=>{let n=a(o.ytext,t.from,t.to);e.onCommentNew({from:t.from,to:t.to,quote:n.quote,anchorRelpos:n.relpos})}})],coords:t}}function $r(e){return e.map(e=>`${e.commentId}:${e.resolvedAt??``}:${e.deletedAt??``}:${e.updatedAt??``}`).join(`|`)}function ei(e,t){if(e.querySelectorAll(`.sg-comment-highlight.is-hover-preview`).forEach(e=>{e.classList.remove(`is-hover-preview`)}),t){let n=`.sg-comment-highlight[data-thread-id="${CSS.escape(t)}"]`;e.querySelectorAll(n).forEach(e=>e.classList.add(`is-hover-preview`))}}function ti(e,t){if(e.querySelectorAll(`.sg-comment-highlight.is-active`).forEach(e=>{e.classList.remove(`is-active`)}),t){let n=`.sg-comment-highlight[data-thread-id="${CSS.escape(t)}"]`;e.querySelectorAll(n).forEach(e=>e.classList.add(`is-active`))}}function ni(e,t){let n=Math.max(0,Math.min(t,e.state.doc.length)),r=e.scrollDOM;for(;r;){let e=getComputedStyle(r).overflowY;if(e===`auto`||e===`scroll`)break;r=r.parentElement}e.dispatch({effects:H.scrollIntoView(n,{y:`center`,yMargin:80})}),e.requestMeasure({read:()=>{if(!r)return null;let t=e.lineBlockAt(n),i=e.contentDOM.getBoundingClientRect(),a=r.getBoundingClientRect(),o=i.top-a.top+r.scrollTop+t.top+t.height/2,s=r.scrollTop+r.clientHeight/2;return Math.abs(o-s)},write:t=>{t!==null&&t>48&&queueMicrotask(()=>{e.dispatch({effects:H.scrollIntoView(n,{y:`center`,yMargin:80})})})}})}async function ri(){let{wrapSelection:e}=await j(async()=>{let{wrapSelection:e}=await import(`./C8Ar3dLv.js`).then(e=>e.i);return{wrapSelection:e}},__vite__mapDeps([22,1]),import.meta.url),{Prec:t}=await j(async()=>{let{Prec:e}=await import(`./Wowi_89k.js`).then(e=>e.x);return{Prec:e}},__vite__mapDeps([0,1]),import.meta.url),{keymap:n}=await j(async()=>{let{keymap:e}=await import(`./D3JoMtWC.js`).then(e=>e.s);return{keymap:e}},__vite__mapDeps([2,1,0]),import.meta.url);return t.high(n.of([{key:`Mod-b`,run:t=>(e(t,`**`,`**`),!0)},{key:`Mod-i`,run:t=>(e(t,`*`,`*`),!0)}]))}function ii(){return H.updateListener.of(e=>{if(V.view!==e.view)return;let t=e.state.selection.main.empty;V.selectionEmpty!==t&&(V.selectionEmpty=t)})}function ai(e,t,n){let r=()=>{if(V.view=e,V.canComment=n?.canComment??!1,V.selectionEmpty=e.state.selection.main.empty,t){let e=Zr(t);e&&(V.entity={repo:e.repo,type:e.entryType,id:e.entryId})}},i=()=>{V.view===e&&(V.view=null,V.entity=null,V.canComment=!1,V.selectionEmpty=!0)};return e.hasFocus&&r(),e.contentDOM.addEventListener(`focus`,r),e.contentDOM.addEventListener(`blur`,i),()=>{e.contentDOM.removeEventListener(`focus`,r),e.contentDOM.removeEventListener(`blur`,i),V.view===e&&(V.view=null,V.entity=null)}}var oi=/(?:https?:\/\/|www\.)[^\s<>()[\]"']+$/i;function si(e,t=``){let n=e.state.selection.main;if(!n.empty)return!1;let r=n.head,i=e.state.doc.lineAt(r),a=i.text.slice(0,r-i.from),o=a.match(oi);if(!o)return!1;let s=o[0],c=r-s.length,l=a.slice(0,a.length-s.length);if(/[([<]$/.test(l))return!1;let u=`[${s}](${Te(s)})${t}`;return e.dispatch({changes:{from:c,to:r,insert:u},selection:{anchor:c+u.length},userEvent:`input.autolink`}),!0}async function ci(){let{EditorView:e,keymap:t}=await j(async()=>{let{EditorView:e,keymap:t}=await import(`./D3JoMtWC.js`).then(e=>e.s);return{EditorView:e,keymap:t}},__vite__mapDeps([2,1,0]),import.meta.url),{Prec:n}=await j(async()=>{let{Prec:e}=await import(`./Wowi_89k.js`).then(e=>e.x);return{Prec:e}},__vite__mapDeps([0,1]),import.meta.url);return[e.domEventHandlers({paste(e,t){let n=e.clipboardData?.getData(`text/plain`)?.trim();if(!n||!Ee.test(n))return!1;let{from:r,to:i}=t.state.selection.main,a=`[${t.state.doc.sliceString(r,i)||n}](${Te(n)})`;return e.preventDefault(),t.dispatch({changes:{from:r,to:i,insert:a},selection:{anchor:r+a.length},userEvent:`input.paste`}),!0}}),n.highest(t.of([{key:` `,run:e=>si(e,` `)},{key:`Enter`,run:e=>(si(e),!1)}]))]}function li(e){return H.theme({"&":{backgroundColor:`transparent`,color:`var(--color-text-primary)`,fontSize:`var(--editor-font-size)`,fontFamily:`var(--font-sans)`},".cm-content":{padding:`32px 0`,fontSize:`var(--editor-font-size)`,fontFamily:`var(--font-sans)`,caretColor:`var(--color-accent-fg)`,lineHeight:`var(--editor-line-height)`},".cm-cursor":{borderLeftColor:`var(--color-accent-fg)`},".cm-placeholder":{color:`var(--color-text-tertiary)`},".cm-selectionBackground":{backgroundColor:`var(--color-selection) !important`},"&.cm-focused .cm-selectionBackground":{backgroundColor:`var(--color-selection) !important`},".cm-gutters":{background:`transparent`,border:`none`,color:`var(--color-text-tertiary)`},".cm-activeLine":{backgroundColor:`transparent`},"&:not(.cm-focused) .cm-cursor":{display:`none !important`},"&:not(.cm-focused) .cm-selectionBackground":{display:`none !important`},".cm-line":{padding:`0`},".cm-header-1":{fontSize:`var(--editor-h1-size)`,fontWeight:`600`},".cm-header-2":{fontSize:`var(--editor-h2-size)`,fontWeight:`600`},".cm-header-3":{fontSize:`var(--editor-h3-size)`,fontWeight:`600`},".cm-formatting":{color:`var(--color-text-tertiary)`,opacity:`0.5`},".cm-link":{color:`var(--color-link)`,textDecoration:`none`}},{dark:e})}var ui=Pe.define([{tag:Ne.processingInstruction,color:`var(--color-text-tertiary)`,opacity:`0.7`}]),di=f(`<div><span class="remote-cursor-label svelte-1cy63ac"> </span></div>`),fi=f(`<div class="cursor-overlay svelte-1cy63ac"></div>`);function pi(e,t){l(t,!0);let r=A(T([])),i=null;function d(){i&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>{i=null,f()})}async function f(){let e=t.getView(),n=t.getEditorEl();if(!e||!n||!t.session){_(r,[],!0);return}let i=await j(()=>import(`./B-Z_xZy_.js`).then(e=>e.p),__vite__mapDeps([4,1]),import.meta.url),a=t.session.awareness,o=t.session.ytext,s=o.doc;if(!s){_(r,[],!0);return}let c=s.clientID,l=n.getBoundingClientRect(),u=[];a.getStates().forEach((t,n)=>{if(n===c)return;let r=t.cursor;if(!r?.head)return;let{name:a=`Anonymous`,color:d=`#f04e4e`}=t.user||{},f;try{f=i.createRelativePositionFromJSON(r.head)}catch{return}let p=i.createAbsolutePositionFromRelativePosition(f,s);if(!p||p.type!==o)return;let m=e.coordsAtPos(Math.min(p.index,e.state.doc.length));if(m){let e=m.left-l.left;u.push({id:n,name:a,color:d,top:m.top-l.top,left:e,height:m.bottom-m.top,flipped:e>l.width*.65})}}),_(r,u,!0)}D(()=>{if(t.refreshKey,t.session,!t.session){_(r,[],!0);return}d()}),ee(()=>{i&&cancelAnimationFrame(i)});var p=o(),m=S(p),h=e=>{var t=fi();w(t,21,()=>g(r),e=>e.id,(e,t)=>{var r=di();let i;var o=x(r),s=x(o,!0);n(o),n(r),v(()=>{i=y(r,1,`remote-cursor svelte-1cy63ac`,null,i,{flipped:g(t).flipped}),k(r,`top: ${g(t).top??``}px; left: ${g(t).left??``}px; height: ${g(t).height??``}px; --cursor-color: ${g(t).color??``};`),k(o,`background-color: ${g(t).color??``};`),u(s,g(t).name)}),a(e,r)}),n(t),a(e,t)};s(m,e=>{g(r).length>0&&e(h)}),a(e,p),c()}var mi=f(`<div class="editor-loader svelte-ok7wy5" role="status" aria-live="polite"><div class="editor-loader-spinner svelte-ok7wy5"></div> <span class="sr-only svelte-ok7wy5">Loading editor…</span></div>`),hi=f(`<div><div class="cm-container svelte-ok7wy5"></div> <!> <!></div>`);function gi(t,r){l(r,!0);let i=E(r,`placeholder`,3,`Add notes…`),o=E(r,`readonly`,3,!0),u=E(r,`resetKey`,3,0),d=E(r,`hoveredCommentThread`,3,null),f=E(r,`activeCommentThread`,3,null),p=E(r,`scrollRequest`,3,null),m=E(r,`pendingCommentDraft`,3,null),h=E(r,`selectionRequest`,3,null),S=e(`theme`),C,w=null,T=A(null),O=A(``),re=null,k=A(!1),oe=null,se=null,ce=null,le=A(0),M=r.content;function N(){w&&(w.focus(),w.dispatch({selection:{anchor:0,head:w.state.doc.length}}))}let ue=0,P=[];function de(){for(;P.length;)try{P.pop()()}catch{}}async function fe(){let e=++ue,t=()=>e!==ue;_(k,!1),ce?.(),ce=null,de(),w?.destroy(),w=null,g(T)?.destroy(),_(T,null),_(le,0),r.oncollaboratorchange?.([]);let{EditorState:n,Transaction:a,Compartment:s,Prec:c}=await j(async()=>{let{EditorState:e,Transaction:t,Compartment:n,Prec:r}=await import(`./Wowi_89k.js`).then(e=>e.x);return{EditorState:e,Transaction:t,Compartment:n,Prec:r}},__vite__mapDeps([0,1]),import.meta.url);if(t())return;re=a,se=n;let{EditorView:l,keymap:u,drawSelection:d,placeholder:p}=await j(async()=>{let{EditorView:e,keymap:t,drawSelection:n,placeholder:r}=await import(`./D3JoMtWC.js`).then(e=>e.s);return{EditorView:e,keymap:t,drawSelection:n,placeholder:r}},__vite__mapDeps([2,1,0]),import.meta.url),{markdown:h,markdownLanguage:v,insertNewlineContinueMarkupCommand:y,deleteMarkupBackward:x}=await j(async()=>{let{markdown:e,markdownLanguage:t,insertNewlineContinueMarkupCommand:n,deleteMarkupBackward:r}=await import(`./Bqm_YrIg2.js`);return{markdown:e,markdownLanguage:t,insertNewlineContinueMarkupCommand:n,deleteMarkupBackward:r}},__vite__mapDeps([23,24,1,0,2,25,26]),import.meta.url),{TaskList:ee}=await j(async()=>{let{TaskList:e}=await import(`./CEniyZ1Z2.js`);return{TaskList:e}},__vite__mapDeps([26,25,1]),import.meta.url),{syntaxHighlighting:E}=await j(async()=>{let{syntaxHighlighting:e}=await import(`./BBGt-XQo.js`).then(e=>e.f);return{syntaxHighlighting:e}},__vite__mapDeps([24,1,0,2,25]),import.meta.url),{history:D,defaultKeymap:te,historyKeymap:ne}=await j(async()=>{let{history:e,defaultKeymap:t,historyKeymap:n}=await import(`./BoDmwOTJ2.js`);return{history:e,defaultKeymap:t,historyKeymap:n}},__vite__mapDeps([27,24,1,0,2,25]),import.meta.url),{livePreviewPlugin:ie,livePreviewTheme:A,imageKeymap:ae}=await j(async()=>{let{livePreviewPlugin:e,livePreviewTheme:t,imageKeymap:n}=await import(`./7kR889TK.js`).then(e=>e.n);return{livePreviewPlugin:e,livePreviewTheme:t,imageKeymap:n}},__vite__mapDeps([28,1,24,0,2,25,29,9,5,6,7,8,10,11,12,13,14,15,16,17,22]),import.meta.url),{mergeListItemBackward:N}=await j(async()=>{let{mergeListItemBackward:e}=await import(`./BJgOZTHR.js`);return{mergeListItemBackward:e}},__vite__mapDeps([30,24,1,0,2,25]),import.meta.url),{listIndentMore:fe,listIndentLess:pe}=await j(async()=>{let{listIndentMore:e,listIndentLess:t}=await import(`./B6Lt-qaJ.js`);return{listIndentMore:e,listIndentLess:t}},[],import.meta.url),{tablePreviewPlugin:me,tablePreviewTheme:F}=await j(async()=>{let{tablePreviewPlugin:e,tablePreviewTheme:t}=await import(`./D7wNieYW.js`);return{tablePreviewPlugin:e,tablePreviewTheme:t}},__vite__mapDeps([31,24,1,0,2,25,29,9,5,6,7,8,10,11,12,13,14,15,16,17]),import.meta.url);if(t())return;let I=[h({base:v,extensions:[ee]}),li(S.current===`dark`),E(ui),d(),ie,A,Me,ae,me,F,l.lineWrapping];oe=new s,I.push(oe.of(n.readOnly.of(o()))),!o()&&i()&&I.push(p(i()));let L=!1,R=null;if(r.cursorDocName&&!o())try{let{auth:e}=await j(async()=>{let{auth:e}=await import(`./D3ch71s_.js`).then(e=>e.n);return{auth:e}},__vite__mapDeps([15,1,9]),import.meta.url),{userColors:n}=await j(async()=>{let{userColors:e}=await import(`./B1IoRIM32.js`).then(e=>e.v);return{userColors:e}},__vite__mapDeps([32,1,7,8,6,9,12,5,10,11,13,14,15,16,17,33]),import.meta.url);if(t())return;let i=e.user?.id,a=i==null?getComputedStyle(document.documentElement).getPropertyValue(`--color-accent`).trim()||`#f04e4e`:n.getColor(i);if(R=await Wr({cursorDocName:r.cursorDocName,accentColor:a,userDisplayName:e.user?.displayName??`Anonymous`,onSync:()=>{w&&R&&w.dispatch({effects:R.syncGate.reconfigure([])}),_(k,!0)},onCollaboratorsChange:e=>r.oncollaboratorchange?.(e),onRemoteAwarenessChange:()=>{b(le)},onViewportChange:()=>{b(le)}}),t()){R.destroy();return}I.push(...R.extensions),_(T,R.session,!0),L=!0}catch(e){console.warn(`Yjs collab setup failed, falling back to solo editing:`,e)}let z=!1;if(L&&R&&r.cursorDocName&&r.oncommentopen&&r.oncommentnew){let e=await Qr({cursorDocName:r.cursorDocName,session:R.session,onCommentOpen:r.oncommentopen,onCommentClickAway:()=>r.oncommentclickaway?.(),onCommentNew:e=>{r.oncommentnew(e)},onCommentMarkers:e=>{C&&ti(C,f()),r.oncommentmarkers?.(e)}});if(t()){R?.destroy();return}e&&(I.push(...e.extensions),z=!0)}if(!o()&&!L?(I.push(D({newGroupDelay:500})),I.push(u.of([...te,...ne]))):!o()&&L&&I.push(u.of([...te])),!o()){let e=y({nonTightLists:!1});I.push(c.high(u.of([{key:`Enter`,run:e},{key:`Backspace`,run:N},{key:`Backspace`,run:x},{key:`Tab`,run:fe},{key:`Shift-Tab`,run:pe}])))}if(!o()){let{wikilinkPlugin:e,wikilinkKeymap:n}=await j(async()=>{let{wikilinkPlugin:e,wikilinkKeymap:t}=await import(`./rbhlO_t8.js`).then(e=>e.n);return{wikilinkPlugin:e,wikilinkKeymap:t}},__vite__mapDeps([34,1,2,0]),import.meta.url);if(t()){R?.destroy();return}I.push(e,c.highest(u.of([...n])))}if(I.push(l.updateListener.of(e=>{(e.viewportChanged||e.geometryChanged)&&C&&ti(C,f())})),r.onchange){let e=Date.now(),t=[`input`,`delete`,`move`,`undo`,`redo`];I.push(l.updateListener.of(n=>{if(!n.docChanged||L&&(Date.now()-e<1e3||!n.transactions.some(e=>t.some(t=>e.isUserEvent(t)))))return;let i=n.state.doc.toString();M=i,r.onchange(i)}))}if(!o()&&r.cursorDocName&&I.push(Kr({cursorDocName:r.cursorDocName,getView:()=>w})),I.push(l.domEventHandlers({click(e){let t=e.target;if(r.onwikilinkclick){let n=t.closest(`.cm-live-wikilink`);if(n){e.preventDefault();let t=n.dataset.entityId||n.textContent?.replace(/^\[{1,2}|\]{1,2}$/g,``).trim();return t&&r.onwikilinkclick(t),!0}}let n=t.closest(`.cm-live-link`)?.getAttribute(`data-href`);return n?(e.preventDefault(),window.open(n,`_blank`,`noopener,noreferrer`),!0):!1}})),r.onsave&&I.push(u.of([{key:`Mod-s`,run:()=>(r.onsave(),!0)}])),!o()){let e=await ri(),n=await ci();if(t()){R?.destroy();return}I.push(e),I.push(n),I.push(ii())}let he=L?R&&R.session.ytext.length>0?R.session.ytext.toString():``:r.content;w=new l({state:n.create({doc:he,extensions:I}),parent:C}),m()&&w.dispatch({effects:qr.of(m())}),R?.consumeEarlyUnlock()&&w.dispatch({effects:R.syncGate.reconfigure([])}),o()||(ce=ai(w,r.cursorDocName??null,{canComment:z}));let B=C;if(r.onwikilinkclick&&B){let e=e=>{e.detail&&r.onwikilinkclick(e.detail)};B.addEventListener(`wikilink-click`,e),P.push(()=>B.removeEventListener(`wikilink-click`,e))}if(!o()&&B){let e=e=>{if(!w||!e.detail)return;let{from:t,to:n,checked:r}=e.detail;t<0||n>w.state.doc.length||w.dispatch({changes:{from:t,to:n,insert:r?`[x]`:`[ ]`},userEvent:`input`})};B.addEventListener(`task-toggle`,e),P.push(()=>B.removeEventListener(`task-toggle`,e))}if(r.oncommenthover&&B){let e=e=>{let t=e.target?.closest?.(`.sg-comment-highlight`);t?.dataset.threadId&&r.oncommenthover(t.dataset.threadId)},t=e=>{e.target?.closest?.(`.sg-comment-highlight`)&&(e.relatedTarget?.closest?.(`.sg-comment-highlight`)||r.oncommenthover(null))};B.addEventListener(`mouseover`,e),B.addEventListener(`mouseout`,t),P.push(()=>{B.removeEventListener(`mouseover`,e),B.removeEventListener(`mouseout`,t)})}M=L?``:r.content,_(O,r.cursorDocName??``,!0),!L||R?.session.synced?_(k,!0):setTimeout(()=>{g(k)||_(k,!0)},5e3),r.onready?.()}ne(async()=>{await fe()}),D(()=>{r.cursorDocName&&g(O)&&r.cursorDocName!==g(O)&&fe()});let pe=A(``);D(()=>{let e=ae.repos.map(e=>`${e.name}:${e.entities.length}`).join(`|`);!w||e===g(pe)||(_(pe,e,!0),w.dispatch({effects:je.of()}))});let me=A(``);D(()=>{if(!r.cursorDocName)return;let e=Zr(r.cursorDocName);if(!e)return;let t=$r(Ie.getForEntry(e.repo,e.entryType,e.entryId));!w||t===g(me)||(_(me,t,!0),w.dispatch({effects:zr.of()}))});let F=0;D(()=>{let e=p();if(!w||!e||e.tick===F)return;F=e.tick,ni(w,e.position);let t=f();requestAnimationFrame(()=>{C&&ti(C,t)})});let I=0;D(()=>{let e=h();if(!w||!e||e.tick===I)return;I=e.tick;let t=w.state.doc.length,n=Math.max(0,Math.min(e.from,t)),r=Math.max(0,Math.min(e.to,t));w.dispatch({selection:{anchor:n,head:r}}),w.focus()}),D(()=>{C&&ei(C,d())}),D(()=>{C&&ti(C,f())}),D(()=>{let e=m();w&&w.dispatch({effects:qr.of(e)})}),D(()=>{w&&oe&&se&&w.dispatch({effects:oe.reconfigure(se.readOnly.of(o()))})}),D(()=>{if(u(),!w||r.content===M)return;if(g(T)){M=r.content;return}if(w.state.doc.toString()===r.content){M=r.content;return}M=r.content;let e=C.closest(`.document-scroll`),t=e?.scrollTop??0;w.dispatch({changes:{from:0,to:w.state.doc.length,insert:r.content},...re?{annotations:re.addToHistory.of(!1)}:{}}),e&&requestAnimationFrame(()=>{e.scrollTop=t})}),ee(()=>{ue++,ce?.(),de(),g(T)?.destroy(),_(T,null),w?.destroy(),r.oncollaboratorchange?.([])});var L={focusSelectAll:N},R=hi();let z;var he=x(R);ie(he,e=>C=e,()=>C);var B=te(he,2),ge=e=>{a(e,mi())};return s(B,e=>{g(k)||e(ge)}),pi(te(B,2),{get session(){return g(T)},getView:()=>w,getEditorEl:()=>C,get refreshKey(){return g(le)}}),n(R),v(()=>{z=y(R,1,`editor-wrap svelte-ok7wy5`,null,z,{loading:!g(k)}),he.inert=!g(k)}),a(t,R),c(L)}export{Xt as C,on as S,En as _,jr as a,Q as b,Tr as c,yr as d,or as f,bn as g,Dn as h,Nr as i,Cr as l,Nn as m,Lr as n,kr as o,er as p,Fr as r,Dr as s,gi as t,xr as u,On as v,vn as x,Tn as y};