@inkeep/open-knowledge 0.6.1-beta.2 → 0.7.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/cli.mjs +44 -44
- package/dist/constants-DPdafUFc.mjs +2 -0
- package/dist/{dist-D63H1tUT.mjs → dist-CnCjIzK3.mjs} +1 -1
- package/dist/{dist-B5HqGe-T.mjs → dist-Di8PRueX.mjs} +4 -4
- package/dist/index.mjs +1 -1
- package/dist/init-CBOj_heB.mjs +1 -0
- package/dist/{init-Dj6z-pfo.mjs → init-YHL6ybpM.mjs} +8 -8
- package/dist/{loader-BBgjhn4S.mjs → loader-Bujgn8Uz.mjs} +2 -2
- package/dist/loader-jt7t3uh3.mjs +1 -0
- package/dist/preview-DKytxH98.mjs +1 -0
- package/dist/{preview-Dfxalkgw.mjs → preview-DsxeQivm.mjs} +2 -2
- package/dist/public/assets/{index-BuudLGkB.js → index-BHaLjbvs.js} +1 -1
- package/dist/public/assets/index-DzqgVUqV.css +1 -0
- package/dist/public/index.html +2 -2
- package/dist/{repair-launch-json-BJdHaN3O.mjs → repair-launch-json-DgBJFJL6.mjs} +2 -2
- package/dist/{repair-mcp-configs-CbWmPBtN.mjs → repair-mcp-configs-BzMHds3h.mjs} +2 -2
- package/dist/{src-BzdQrsAm.mjs → src-Cgw_y2at.mjs} +2 -2
- package/dist/start-DT0gtwRQ.mjs +3 -0
- package/dist/start-DTshPlFp.mjs +1 -0
- package/package.json +1 -1
- package/dist/constants-DjC4GhDL.mjs +0 -2
- package/dist/init-CiZmhGAx.mjs +0 -1
- package/dist/loader-B_jT2e5R.mjs +0 -1
- package/dist/preview-DbEiZRSz.mjs +0 -1
- package/dist/public/assets/index-BxMSLdLS.css +0 -1
- package/dist/start-C6Ap_owd.mjs +0 -1
- package/dist/start-CtztqyhA.mjs +0 -3
|
@@ -21,7 +21,7 @@ Error generating stack: `+e.message+`
|
|
|
21
21
|
`}function Fg(e,t,n,r,i,a,o){if(typeof o==`function`&&(o={callback:o}),o?.callback){let{callback:s}=o;Ng(e,t,n,r,i,a,Object.assign(Object.assign({},o),{callback:e=>{s(e?Pg(e,o.headerOptions):void 0)}}))}else{let s=Ng(e,t,n,r,i,a,o);return s?Pg(s,o?.headerOptions):void 0}}function Ig(e,t,n,r,i,a){return Fg(e,e,t,n,r,i,a)}function Lg(e){let t=e.endsWith(`
|
|
22
22
|
`),n=e.split(`
|
|
23
23
|
`).map(e=>e+`
|
|
24
|
-
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function Rg(e,t){return`${e}\u0000${t}`}function zg(e,t,n){let r=Fn(e).body,i=Fn(t).body;return r===i?``:Ig(n,r,i,``,``,{context:3})}function Bg(e,t,n){let r=(0,$.c)(8),{activeProvider:i}=ft(),a;r[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={status:`idle`,diff:null},r[0]=a):a=r[0];let[o,s]=(0,Q.useState)(a),c=(0,Q.useRef)(i),l;r[1]===i?l=r[2]:(l=()=>{c.current=i},r[1]=i,r[2]=l),(0,Q.useEffect)(l);let u,d;return r[3]!==n||r[4]!==t||r[5]!==e?(u=()=>{if(!e){s({status:`idle`,diff:null});return}let r=e,i=!1;return s({status:`loading`,diff:null}),(async function(){try{let e=Rg(t,r),a=n.get(e);if(a===void 0){let o=await fetch(`/api/history/${r}?docName=${encodeURIComponent(t)}`);if(i)return;if(!o.ok){s({status:`error`,diff:null});return}let c=await o.json();if(i)return;a=c.content??``,n.set(e,a)}if(i)return;let o=c.current?.document.getText(`source`).toString()??``,l=zg(a,o,t);if(i)return;s({status:`ready`,diff:l})}catch(e){i||(console.error(`[timeline-diff] failed to load entry diff`,{sha:r,docName:t,err:e}),s({status:`error`,diff:null}))}})(),()=>{i=!0}},d=[e,t,n],r[3]=n,r[4]=t,r[5]=e,r[6]=u,r[7]=d):(u=r[6],d=r[7]),(0,Q.useEffect)(u,d),o}var Vg=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./ActivityPanelDiffView-LNHry3BJ.js`),__vite__mapDeps([16,1,6,17]),import.meta.url)).ActivityPanelDiffView}));function Hg(e){let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3);if(r<60)return Y._({id:`xOTzt5`});if(r<3600){let e=Math.floor(r/60);return Y._({id:`UyROxs`,values:{mins:e}})}if(r<86400){let e=Math.floor(r/3600);return Y._({id:`wXO4Tg`,values:{hrs:e}})}if(r<86400*2)return Y._({id:`rQRrkB`});let i=Math.floor(r/86400);return i<7?Y._({id:`6u9LvN`,values:{days:i}}):t.toLocaleDateString()}function Ug(e){return new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function Wg(e){return e.slice(0,7)}function Gg(e){return e.type===`upstream`?Y._({id:`K_vT1F`}):e.contributors.length===1?e.contributors[0].name:e.contributors.length>1?e.contributors.map(e=>e.name).join(`, `):e.author===`openknowledge-server`||e.author===`server`?Y._({id:`B2DrPb`}):e.author}function Kg(e){let t=(0,$.c)(17),n,r;if(t[0]===e?(n=t[1],r=t[2]):({icon:n,...r}=e,t[0]=e,t[1]=n,t[2]=r),n===`claude`){let e;return t[3]===r?e=t[4]:(e=(0,Z.jsx)(Mi,{...r}),t[3]=r,t[4]=e),e}if(n===`cursor`){let e;return t[5]===r?e=t[6]:(e=(0,Z.jsx)(Ri,{...r}),t[5]=r,t[6]=e),e}if(n===`windsurf`){let e;return t[7]===r?e=t[8]:(e=(0,Z.jsx)(Ai,{...r}),t[7]=r,t[8]=e),e}if(n===`openai`){let e;return t[9]===r?e=t[10]:(e=(0,Z.jsx)(Fi,{...r}),t[9]=r,t[10]=e),e}if(n===`cline`){let e;return t[11]===r?e=t[12]:(e=(0,Z.jsx)(Ui,{...r}),t[11]=r,t[12]=e),e}if(n===`github`){let e;return t[13]===r?e=t[14]:(e=(0,Z.jsx)(Vi,{...r}),t[13]=r,t[14]=e),e}let i=r,a;return t[15]===i?a=t[16]:(a=(0,Z.jsx)(zi,{strokeWidth:1.5,...i}),t[15]=i,t[16]=a),a}function qg(e){let t=(0,$.c)(17),{entry:n,isDark:r}=e;if(n.type===`upstream`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(De,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[0]=e):e=t[0],e}if(n.contributors.length>0){let e=n.contributors[0],i=e.colorSeed??e.name,a;t[1]===i?a=t[2]:(a=Hn(i),t[1]=i,t[2]=a);let o=a,s=r?or[o]??wr[o]:wr[o],c;t[3]!==s||t[4]!==i?(c=s??jn(i),t[3]=s,t[4]=i,t[5]=c):c=t[5];let l=c;if(o!==`bot`){let e;t[6]===l?e=t[7]:(e={color:l},t[6]=l,t[7]=e);let n;return t[8]!==o||t[9]!==e?(n=(0,Z.jsx)(Kg,{icon:o,width:14,height:14,className:`shrink-0`,style:e}),t[8]=o,t[9]=e,t[10]=n):n=t[10],n}if(e.name===`File System`){let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(yc,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[11]=e):e=t[11],e}if(e.name===`Open Knowledge (service)`||e.name===`Git (upstream)`){let e;return t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Us,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[12]=e):e=t[12],e}let u;return t[13]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(ol,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[13]=u):u=t[13],u}if(n.authorEmail.includes(`agent`)||n.author.includes(`agent`)||n.authorEmail.includes(`cursor`)||n.authorEmail.includes(`claude`)){let e;return t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(zi,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[14]=e):e=t[14],e}if(n.author===`openknowledge-server`||n.author===`server`){let e;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Us,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[15]=e):e=t[15],e}let i;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(ol,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[16]=i):i=t[16],i}function Jg(e){let t=(0,$.c)(23),{entries:n,defaultExpanded:r,isDark:i,diffLayout:a,cache:o,docName:s,expandedShas:c,onToggleExpanded:l,onRestoreSuccess:u}=e,[d,f]=(0,Q.useState)(r),p=n.length;if(n.length===0)return null;let m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>f(Yg),t[0]=m):m=t[0];let h;t[1]===d?h=t[2]:(h=d?(0,Z.jsx)(Dt,{className:`size-3`}):(0,Z.jsx)(Wo,{className:`size-3`}),t[1]=d,t[2]=h);let g;t[3]!==p||t[4]!==d?(g=d?Y._({id:`OKQe56`,values:{entryCount:p}}):Y._({id:`k9jDvw`,values:{entryCount:p}}),t[3]=p,t[4]=d,t[5]=g):g=t[5];let _;t[6]!==d||t[7]!==h||t[8]!==g?(_=(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":d,className:`flex items-center gap-1.5 rounded-lg px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors text-left`,onClick:m,children:[h,g]}),t[6]=d,t[7]=h,t[8]=g,t[9]=_):_=t[9];let v;t[10]!==o||t[11]!==a||t[12]!==s||t[13]!==n||t[14]!==d||t[15]!==c||t[16]!==i||t[17]!==u||t[18]!==l?(v=d&&n.map(e=>(0,Z.jsx)(s_,{entry:e,isDark:i,diffLayout:a,cache:o,docName:s,expanded:c.has(e.sha),onToggleExpanded:l,onRestoreSuccess:u},e.sha)),t[10]=o,t[11]=a,t[12]=s,t[13]=n,t[14]=d,t[15]=c,t[16]=i,t[17]=u,t[18]=l,t[19]=v):v=t[19];let y;return t[20]!==_||t[21]!==v?(y=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[_,v]}),t[20]=_,t[21]=v,t[22]=y):y=t[22],y}function Yg(e){return!e}function Xg(e){return e.checkpoint?e.checkpoint.kind:`save`}function Zg(e){let t=Xg(e);if(t===`save`)return Y._({id:`gsePqm`});let n=e.checkpoint?.size??null,r=n!=null&&n>0?` (${Qg(n)})`:``;return t===`bridge-merge-loss`?Y._({id:`uZAG7T`,values:{sizeSuffix:r}}):Y._({id:`_4rAQI`,values:{sizeSuffix:r}})}function Qg(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/102.4)/10} KB`:`${Math.round(e/104857.6)/10} MB`}function $g(e){return e.type===`checkpoint`?Xg(e)===`save`?`version`:`auto-save`:`wip`}function e_(e){let t=$g(e);return t===`version`?Y._({id:`RFQ1Yx`}):t===`auto-save`?Y._({id:`9Uv1CD`}):Y._({id:`Yea-K5`})}function t_(e){let t=$g(e);return t===`version`?Y._({id:`gg3Rpy`}):t===`auto-save`?Y._({id:`PXXeW8`}):Y._({id:`Pyp1NA`})}function n_(e){let t=[];for(let n of e.contributors)if(n.summaries)for(let e of n.summaries)t.push(e);return t}function r_(e){let t=(0,$.c)(21),{summaries:n}=e,[r,i]=(0,Q.useState)(!1),a=(0,Q.useId)();if(n.length===0)return null;let o,c;t[0]===n?(o=t[1],c=t[2]):([o,...c]=n,t[0]=n,t[1]=o,t[2]=c);let l=c.length,u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`• `}),t[3]=u):u=t[3];let d;t[4]===o?d=t[5]:(d=(0,Z.jsxs)(`li`,{className:`text-xs text-foreground/90`,children:[u,o]}),t[4]=o,t[5]=d);let f;t[6]!==r||t[7]!==c?(f=r&&c.map(a_),t[6]=r,t[7]=c,t[8]=f):f=t[8];let p;t[9]!==a||t[10]!==d||t[11]!==f?(p=(0,Z.jsxs)(`ul`,{id:a,className:`list-none`,children:[d,f]}),t[9]=a,t[10]=d,t[11]=f,t[12]=p):p=t[12];let m;t[13]!==r||t[14]!==l||t[15]!==a||t[16]!==c.length?(m=c.length>0&&(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":r,"aria-controls":a,className:`inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer`,onClick:e=>{e.stopPropagation(),i(i_)},children:[r?(0,Z.jsx)(Dt,{className:`size-3`}):(0,Z.jsx)(Wo,{className:`size-3`}),r?(0,Z.jsx)(s,{id:`vLyv1R`}):(0,Z.jsx)(s,{id:`ZptNUh`,values:{hidden:l}})]}),t[13]=r,t[14]=l,t[15]=a,t[16]=c.length,t[17]=m):m=t[17];let h;return t[18]!==p||t[19]!==m?(h=(0,Z.jsxs)(`div`,{className:`mt-0.5`,children:[p,m]}),t[18]=p,t[19]=m,t[20]=h):h=t[20],h}function i_(e){return!e}function a_(e,t){return(0,Z.jsxs)(`li`,{className:`text-xs text-foreground/90`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`• `}),e]},`${t}-${e}`)}function o_(e){let t=(0,$.c)(13),{sha:n,docName:r,cache:i,diffLayout:a,panelId:o}=e,c=Bg(n,r,i),l;t[0]===c.status?l=t[1]:(l=c.status===`loading`&&(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-xs text-muted-foreground`,children:[(0,Z.jsx)(B,{className:`size-3 animate-spin`}),(0,Z.jsx)(s,{id:`38foVZ`})]}),t[0]=c.status,t[1]=l);let u;t[2]===c.status?u=t[3]:(u=c.status===`error`&&(0,Z.jsx)(`p`,{className:`py-2 text-xs text-destructive`,children:(0,Z.jsx)(s,{id:`vvWZnu`})}),t[2]=c.status,t[3]=u);let d;t[4]!==a||t[5]!==c.diff||t[6]!==c.status?(d=c.status===`ready`&&(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-xs text-muted-foreground`,children:[(0,Z.jsx)(B,{className:`size-3 animate-spin`}),(0,Z.jsx)(s,{id:`EDm3wJ`})]}),children:(0,Z.jsx)(Vg,{diff:c.diff,viewType:a})}),t[4]=a,t[5]=c.diff,t[6]=c.status,t[7]=d):d=t[7];let f;return t[8]!==o||t[9]!==l||t[10]!==u||t[11]!==d?(f=(0,Z.jsxs)(`div`,{id:o,className:`px-3 pb-2`,"data-testid":`timeline-entry-diff`,children:[l,u,d]}),t[8]=o,t[9]=l,t[10]=u,t[11]=d,t[12]=f):f=t[12],f}function s_(e){let t=(0,$.c)(130),{entry:n,prominent:r,isDark:a,diffLayout:o,cache:c,docName:l,expanded:u,onToggleExpanded:d,onRestoreSuccess:f}=e,p=r===void 0?!1:r,{_:m}=i(),h;t[0]===n.timestamp?h=t[1]:(h=Hg(n.timestamp),t[0]=n.timestamp,t[1]=h);let g=h,_;t[2]===n?_=t[3]:(_=Gg(n),t[2]=n,t[3]=_);let v=_,y;t[4]===n.timestamp?y=t[5]:(y=Ug(n.timestamp),t[4]=n.timestamp,t[5]=y);let b=y,x;t[6]===n.sha?x=t[7]:(x=Wg(n.sha),t[6]=n.sha,t[7]=x);let S=x,C=n.contributors.flatMap(c_),w;t[8]===n?w=t[9]:(w=n_(n),t[8]=n,t[9]=w);let T=w,[E,D]=(0,Q.useState)(!1),[O,k]=(0,Q.useState)(!1),A=(0,Q.useRef)(null),j=(0,Q.useId)(),M,N;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(M=()=>()=>A.current?.abort(),N=[],t[10]=M,t[11]=N):(M=t[10],N=t[11]),(0,Q.useEffect)(M,N);let P;t[12]!==n.sha||t[13]!==d?(P=()=>d(n.sha),t[12]=n.sha,t[13]=d,t[14]=P):P=t[14];let F=P,I;t[15]===D?I=t[16]:(I=function(){A.current?.abort(),A.current=null,k(!1),D(!1)},t[15]=D,t[16]=I);let L=I,R;t[17]!==m||t[18]!==l||t[19]!==n.sha||t[20]!==f||t[21]!==D?(R=async function(){k(!0);let e=new AbortController;A.current=e;let t=function(){e.signal.aborted||k(!1),A.current===e&&(A.current=null)},r;try{r=await fetch(`/api/rollback`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({docName:l,commitSha:n.sha}),signal:e.signal})}catch(r){let i=r;!e.signal.aborted&&!(i instanceof DOMException&&i.name===`AbortError`)&&(console.error(`[timeline] rollback fetch failed`,{docName:l,sha:n.sha,err:i}),Uo.error(m({id:`NkXEFS`}),{duration:4e3})),t();return}if(e.signal.aborted){t();return}if(r.ok)D(!1),f();else{let e=`HTTP ${r.status}`;try{let t=Zn.safeParse(await r.json());t.success&&(e=t.data.title)}catch{}console.error(`[timeline] rollback failed`,{docName:l,sha:n.sha,status:r.status,detail:e}),Uo.error(m({id:`uM6jnS`}),{description:e,duration:6e3})}t()},t[17]=m,t[18]=l,t[19]=n.sha,t[20]=f,t[21]=D,t[22]=R):R=t[22];let z=R,V;t[23]!==n||t[24]!==a||t[25]!==p?(V=p?(()=>{let e=Xg(n);return e===`bridge-merge-loss`?(0,Z.jsx)(hi,{className:`size-3.5 shrink-0 text-amber-600 dark:text-amber-400`,"aria-hidden":`true`}):e===`external-change-rescue`?(0,Z.jsx)(uc,{className:`size-3.5 shrink-0 text-sky-600 dark:text-sky-400`,"aria-hidden":`true`}):(0,Z.jsx)(sc,{className:`size-3.5 shrink-0 text-muted-foreground`})})():(0,Z.jsx)(qg,{entry:n,isDark:a}),t[23]=n,t[24]=a,t[25]=p,t[26]=V):V=t[26];let H=V,U=u?j:void 0,W=u?`bg-muted`:`hover:bg-muted/80`,G;t[27]===W?G=t[28]:(G=[`group flex w-full items-start gap-2.5 rounded-lg px-3 py-2.5 text-left transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring`,W],t[27]=W,t[28]=G);let ee=G.join(` `),K;t[29]===F?K=t[30]:(K=e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),F())},t[29]=F,t[30]=K);let q;t[31]===H?q=t[32]:(q=(0,Z.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:H}),t[31]=H,t[32]=q);let te;t[33]!==v||t[34]!==n||t[35]!==p?(te=p?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:`text-xs text-foreground truncate`,children:Zg(n)}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground/50`,children:`·`}),(0,Z.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:v})]}):(0,Z.jsx)(`span`,{className:`truncate text-xs text-foreground`,children:v}),t[33]=v,t[34]=n,t[35]=p,t[36]=te):te=t[36];let ne;t[37]!==n.timestamp||t[38]!==g?(ne=(0,Z.jsx)(`time`,{className:`ml-auto shrink-0 text-xs text-muted-foreground/80`,dateTime:n.timestamp,title:n.timestamp,children:g}),t[37]=n.timestamp,t[38]=g,t[39]=ne):ne=t[39];let re;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`h-3 w-px shrink-0 bg-border`}),t[40]=re):re=t[40];let ie;t[41]===n?ie=t[42]:(ie=e_(n),t[41]=n,t[42]=ie);let ae;t[43]===D?ae=t[44]:(ae=e=>{e.stopPropagation(),D(!0)},t[43]=D,t[44]=ae);let oe;t[45]===O?oe=t[46]:(oe=O?(0,Z.jsx)(B,{className:`size-3 animate-spin`}):(0,Z.jsx)(Ni,{className:`size-3`}),t[45]=O,t[46]=oe);let se;t[47]!==O||t[48]!==ie||t[49]!==ae||t[50]!==oe?(se=(0,Z.jsx)($n,{asChild:!0,children:(0,Z.jsx)(Di,{variant:`ghost`,size:`icon`,className:`size-5 shrink-0 text-muted-foreground hover:text-destructive`,"data-testid":`timeline-entry-restore`,"aria-label":ie,disabled:O,onClick:ae,children:oe})}),t[47]=O,t[48]=ie,t[49]=ae,t[50]=oe,t[51]=se):se=t[51];let ce;t[52]===n?ce=t[53]:(ce=e_(n),t[52]=n,t[53]=ce);let le;t[54]===ce?le=t[55]:(le=(0,Z.jsx)(wn,{side:`top`,children:ce}),t[54]=ce,t[55]=le);let ue;t[56]!==se||t[57]!==le?(ue=(0,Z.jsxs)(Kr,{children:[se,le]}),t[56]=se,t[57]=le,t[58]=ue):ue=t[58];let de;t[59]!==te||t[60]!==ne||t[61]!==ue?(de=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[te,ne,re,ue]}),t[59]=te,t[60]=ne,t[61]=ue,t[62]=de):de=t[62];let fe;t[63]===T?fe=t[64]:(fe=T.length>0&&(0,Z.jsx)(r_,{summaries:T}),t[63]=T,t[64]=fe);let pe=C.length>0?(0,Z.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:C.join(`, `),children:C.join(`, `)}):(0,Z.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:n.message,children:n.message}),me;t[65]!==de||t[66]!==fe||t[67]!==pe?(me=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[de,fe,pe]}),t[65]=de,t[66]=fe,t[67]=pe,t[68]=me):me=t[68];let he;t[69]!==u||t[70]!==F||t[71]!==U||t[72]!==ee||t[73]!==K||t[74]!==q||t[75]!==me?(he=(0,Z.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-expanded":u,"aria-controls":U,"data-testid":`timeline-entry-expand`,className:ee,onClick:F,onKeyDown:K,children:[q,me]}),t[69]=u,t[70]=F,t[71]=U,t[72]=ee,t[73]=K,t[74]=q,t[75]=me,t[76]=he):he=t[76];let ge;t[77]!==c||t[78]!==o||t[79]!==j||t[80]!==l||t[81]!==n.sha||t[82]!==u?(ge=u&&(0,Z.jsx)(o_,{sha:n.sha,docName:l,cache:c,diffLayout:o,panelId:j}),t[77]=c,t[78]=o,t[79]=j,t[80]=l,t[81]=n.sha,t[82]=u,t[83]=ge):ge=t[83];let _e;t[84]!==he||t[85]!==ge?(_e=(0,Z.jsxs)(`div`,{className:`flex flex-col rounded-lg`,children:[he,ge]}),t[84]=he,t[85]=ge,t[86]=_e):_e=t[86];let ve;t[87]!==L||t[88]!==D?(ve=e=>{e?D(!0):L()},t[87]=L,t[88]=D,t[89]=ve):ve=t[89];let ye;t[90]===n?ye=t[91]:(ye=t_(n),t[90]=n,t[91]=ye);let be;t[92]===ye?be=t[93]:(be=(0,Z.jsx)(jo,{children:ye}),t[92]=ye,t[93]=be);let xe;t[94]!==b||t[95]!==v||t[96]!==S||t[97]!==g?(xe={relative:g,absoluteTime:b,entrySha:S,authorName:v},t[94]=b,t[95]=v,t[96]=S,t[97]=g,t[98]=xe):xe=t[98];let Se;t[99]===Symbol.for(`react.memo_cache_sentinel`)?(Se={0:(0,Z.jsx)(`span`,{className:`font-medium text-foreground`}),1:(0,Z.jsx)(`span`,{className:`font-medium text-foreground`})},t[99]=Se):Se=t[99];let Ce;t[100]===xe?Ce=t[101]:(Ce=(0,Z.jsx)(ko,{children:(0,Z.jsx)(s,{id:`h6EvY-`,values:xe,components:Se})}),t[100]=xe,t[101]=Ce);let we;t[102]!==be||t[103]!==Ce?(we=(0,Z.jsxs)(Bo,{children:[be,Ce]}),t[102]=be,t[103]=Ce,t[104]=we):we=t[104];let Te;t[105]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,Z.jsx)(s,{id:`dEgA5A`}),t[105]=Te):Te=t[105];let Ee;t[106]===L?Ee=t[107]:(Ee=(0,Z.jsx)(Di,{variant:`outline`,"data-testid":`timeline-entry-restore-cancel`,onClick:L,children:Te}),t[106]=L,t[107]=Ee);let De;t[108]===z?De=t[109]:(De=()=>z(),t[108]=z,t[109]=De);let Oe;t[110]===O?Oe=t[111]:(Oe=O?(0,Z.jsx)(B,{className:`mr-2 size-4 animate-spin`}):null,t[110]=O,t[111]=Oe);let ke;t[112]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,Z.jsx)(s,{id:`yKu_3Y`}),t[112]=ke):ke=t[112];let Ae;t[113]!==O||t[114]!==De||t[115]!==Oe?(Ae=(0,Z.jsxs)(Di,{variant:`destructive`,"data-testid":`timeline-entry-restore-confirm`,disabled:O,onClick:De,children:[Oe,ke]}),t[113]=O,t[114]=De,t[115]=Oe,t[116]=Ae):Ae=t[116];let je;t[117]!==Ee||t[118]!==Ae?(je=(0,Z.jsxs)(Ro,{children:[Ee,Ae]}),t[117]=Ee,t[118]=Ae,t[119]=je):je=t[119];let Me;t[120]!==we||t[121]!==je?(Me=(0,Z.jsxs)(Fo,{children:[we,je]}),t[120]=we,t[121]=je,t[122]=Me):Me=t[122];let Ne;t[123]!==E||t[124]!==ve||t[125]!==Me?(Ne=(0,Z.jsx)(Vo,{open:E,onOpenChange:ve,children:Me}),t[123]=E,t[124]=ve,t[125]=Me,t[126]=Ne):Ne=t[126];let Pe;return t[127]!==_e||t[128]!==Ne?(Pe=(0,Z.jsxs)(Z.Fragment,{children:[_e,Ne]}),t[127]=_e,t[128]=Ne,t[129]=Pe):Pe=t[129],Pe}function c_(e){return e.docs}function l_(e){let t=(0,$.c)(87),{docName:n,diffLayout:r,onDiffLayoutChange:a,onSaveVersion:o,saving:c}=e,{_:l}=i(),{resolvedTheme:u}=pr(),d=u===`dark`,f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=[],t[0]=f):f=t[0];let[p,m]=(0,Q.useState)(f),[h,g]=(0,Q.useState)(!1),[_,v]=(0,Q.useState)(null),y=(0,Q.useRef)(null),[b]=(0,Q.useState)(p_),[x,S]=(0,Q.useState)(f_),C;t[1]===b?C=t[2]:(C=()=>{S(new Set),b.clear()},t[1]=b,t[2]=C);let w;t[3]===n?w=t[4]:(w=[n],t[3]=n,t[4]=w),(0,Q.useEffect)(C,w);let T;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(T=function(e){S(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[5]=T):T=t[5];let E=T,D;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(D=function(){S(new Set)},t[6]=D):D=t[6];let O=D,k,A;t[7]!==l||t[8]!==n?(k=()=>{if(!n){m([]);return}let e=!1,t=async function(){if(n)try{let t=await fetch(`/api/history?docName=${encodeURIComponent(n)}&limit=100`);if(e)return;if(!t.ok){v(l({id:`brCtGB`}));return}let r=await t.json();if(e)return;m(r.entries??[]),v(null)}catch(t){let n=t;if(e)return;v(l({id:`brCtGB`})),console.error(`[timeline]`,n)}};return g(!0),t().finally(()=>{e||g(!1)}),y.current=setInterval(t,1e4),()=>{e=!0,y.current&&clearInterval(y.current)}},A=[n,l],t[7]=l,t[8]=n,t[9]=k,t[10]=A):(k=t[9],A=t[10]),(0,Q.useEffect)(k,A);let j,M,N,P,F,I,L,R;if(t[11]!==l||t[12]!==b||t[13]!==r||t[14]!==n||t[15]!==p||t[16]!==_||t[17]!==x||t[18]!==d||t[19]!==h||t[20]!==a||t[21]!==o||t[22]!==c){let e=[],i=[],u=!1;for(let t of p)t.type===`checkpoint`?(i.length>0&&(e.push({kind:`wip-group`,entries:i,isPreCheckpoint:!u}),i=[]),e.push({kind:`checkpoint`,entry:t}),u=!0):i.push(t);i.length>0&&e.push({kind:`wip-group`,entries:i,isPreCheckpoint:!u});let f;t[31]===p?f=t[32]:(f=p.some(d_),t[31]=p,t[32]=f);let m=!f,g=!h&&!_&&p.length>0;F=`flex h-full flex-col`;let v;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(_n,{children:(0,Z.jsx)(s,{id:`cklVjM`})}),t[33]=v):v=t[33];let y;t[34]!==l||t[35]!==r||t[36]!==g||t[37]!==a?(y=g&&(0,Z.jsxs)(Kr,{children:[(0,Z.jsx)($n,{asChild:!0,children:(0,Z.jsxs)(Eo,{type:`single`,value:r,onValueChange:e=>{e&&a(e)},"aria-label":l({id:`XvPJaT`}),variant:`segmented`,size:`sm`,spacing:1,className:`bg-muted dark:bg-background p-0.5 rounded-md shrink-0`,children:[(0,Z.jsx)(Co,{value:`unified`,"aria-label":l({id:`379t2h`}),className:`size-6 px-0`,children:(0,Z.jsx)(Uc,{className:`size-3.5`})}),(0,Z.jsx)(Co,{value:`split`,"aria-label":l({id:`HXFyWD`}),className:`size-6 px-0`,children:(0,Z.jsx)(rc,{className:`size-3.5`})})]})}),(0,Z.jsx)(wn,{children:r===`unified`?(0,Z.jsx)(s,{id:`379t2h`}):(0,Z.jsx)(s,{id:`HXFyWD`})})]}),t[34]=l,t[35]=r,t[36]=g,t[37]=a,t[38]=y):y=t[38];let S;t[39]===l?S=t[40]:(S=l({id:`IrYrzq`}),t[39]=l,t[40]=S);let C;t[41]===c?C=t[42]:(C=c?(0,Z.jsx)(B,{className:`size-4 animate-spin`}):(0,Z.jsx)(Wc,{className:`size-4`}),t[41]=c,t[42]=C);let w;t[43]!==o||t[44]!==c||t[45]!==S||t[46]!==C?(w=(0,Z.jsx)($n,{asChild:!0,children:(0,Z.jsx)(Di,{variant:`ghost`,size:`icon-sm`,onClick:o,disabled:c,"aria-label":S,className:`text-muted-foreground`,"data-testid":`timeline-save-version`,children:C})}),t[43]=o,t[44]=c,t[45]=S,t[46]=C,t[47]=w):w=t[47];let T;t[48]===c?T=t[49]:(T=(0,Z.jsx)(wn,{children:c?(0,Z.jsx)(s,{id:`uF9ruK`}):(0,Z.jsx)(s,{id:`IrYrzq`})}),t[48]=c,t[49]=T);let D;t[50]!==w||t[51]!==T?(D=(0,Z.jsxs)(Kr,{children:[w,T]}),t[50]=w,t[51]=T,t[52]=D):D=t[52],t[53]!==y||t[54]!==D?(I=(0,Z.jsxs)(mn,{children:[v,(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[y,D]})]}),t[53]=y,t[54]=D,t[55]=I):I=t[55],L=`flex-1 overflow-y-auto subtle-scrollbar scroll-fade-mask`,t[56]!==l||t[57]!==h?(R=h&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,role:`status`,"aria-busy":`true`,"aria-label":l({id:`o49mDZ`}),children:[1,2,3].map(u_)}),t[56]=l,t[57]=h,t[58]=R):R=t[58],t[59]!==_||t[60]!==h?(j=!h&&_&&(0,Z.jsx)(`div`,{className:`px-4 py-3`,children:(0,Z.jsx)(`p`,{className:`text-xs text-destructive`,children:_})}),t[59]=_,t[60]=h,t[61]=j):j=t[61],t[62]!==p.length||t[63]!==_||t[64]!==h?(M=!h&&!_&&p.length===0&&(0,Z.jsx)(`div`,{className:`px-4 py-8 text-center`,children:(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(s,{id:`Ta25TG`})})}),t[62]=p.length,t[63]=_,t[64]=h,t[65]=M):M=t[65],t[66]!==b||t[67]!==r||t[68]!==n||t[69]!==p||t[70]!==_||t[71]!==x||t[72]!==m||t[73]!==d||t[74]!==h?(N=!h&&!_&&m&&p.length>0&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,children:p.map(e=>(0,Z.jsx)(s_,{entry:e,isDark:d,diffLayout:r,cache:b,docName:n,expanded:x.has(e.sha),onToggleExpanded:E,onRestoreSuccess:O},e.sha))}),t[66]=b,t[67]=r,t[68]=n,t[69]=p,t[70]=_,t[71]=x,t[72]=m,t[73]=d,t[74]=h,t[75]=N):N=t[75],P=!h&&!_&&!m&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,children:e.map((e,t)=>e.kind===`checkpoint`?(0,Z.jsx)(s_,{entry:e.entry,prominent:!0,isDark:d,diffLayout:r,cache:b,docName:n,expanded:x.has(e.entry.sha),onToggleExpanded:E,onRestoreSuccess:O},e.entry.sha):(0,Z.jsx)(Jg,{entries:e.entries,defaultExpanded:e.isPreCheckpoint,isDark:d,diffLayout:r,cache:b,docName:n,expandedShas:x,onToggleExpanded:E,onRestoreSuccess:O},e.entries[0]?.sha??`wip-${t}`))}),t[11]=l,t[12]=b,t[13]=r,t[14]=n,t[15]=p,t[16]=_,t[17]=x,t[18]=d,t[19]=h,t[20]=a,t[21]=o,t[22]=c,t[23]=j,t[24]=M,t[25]=N,t[26]=P,t[27]=F,t[28]=I,t[29]=L,t[30]=R}else j=t[23],M=t[24],N=t[25],P=t[26],F=t[27],I=t[28],L=t[29],R=t[30];let z;t[76]!==j||t[77]!==M||t[78]!==N||t[79]!==P||t[80]!==L||t[81]!==R?(z=(0,Z.jsxs)(`div`,{className:L,children:[R,j,M,N,P]}),t[76]=j,t[77]=M,t[78]=N,t[79]=P,t[80]=L,t[81]=R,t[82]=z):z=t[82];let V;return t[83]!==F||t[84]!==I||t[85]!==z?(V=(0,Z.jsxs)(`div`,{className:F,children:[I,z]}),t[83]=F,t[84]=I,t[85]=z,t[86]=V):V=t[86],V}function u_(e){return(0,Z.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-lg px-3 py-2.5`,children:[(0,Z.jsx)(Wa,{className:`size-3.5 rounded mt-0.5 shrink-0`}),(0,Z.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,Z.jsx)(Wa,{className:`h-3 w-28`}),(0,Z.jsx)(Wa,{className:`h-3 w-40`})]})]},e)}function d_(e){return e.type===`checkpoint`}function f_(){return new Set}function p_(){return new Pi(32)}var m_=[{id:`outline`,icon:Ec},{id:`links`,icon:ve},{id:`graph`,icon:kc},{id:`timeline`,icon:$s}];function h_(e){return e===`outline`?Y._({id:`dD7NPy`}):e===`links`?Y._({id:`Rj01Fz`}):e===`graph`?Y._({id:`x2fr_j`}):Y._({id:`cklVjM`})}function g_(){return n(()=>import(`./GraphPanel-DtgS21kH.js`),__vite__mapDeps([18,1,19,6,3,7,20,21,22,23,24,25,26,27,28,29,30,31]),import.meta.url)}var __=(0,Q.lazy)(async()=>({default:(await g_()).GraphPanel})),v_=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./ActivityModeContent-C4c01qOn.js`),__vite__mapDeps([32,1,2,33,34,35,20,36,37,38,39,19,6,3,7,4,10,9,40,41]),import.meta.url)).ActivityModeContent}));function y_(e){let t=(0,$.c)(16),{docName:n,isSourceMode:r,activeTab:a,onActiveTabChange:o,mode:c,onSaveVersion:l,saving:u}=e,{_:d}=i(),[f,p]=(0,Q.useState)(`unified`),m;t[0]!==d||t[1]!==a||t[2]!==c||t[3]!==o?(m=c===`doc`?(0,Z.jsx)(`div`,{className:`flex flex-row items-center justify-center gap-3 p-2`,children:(0,Z.jsx)(Eo,{type:`single`,variant:`outline`,value:a,onValueChange:e=>{e&&o(e)},"aria-label":d({id:`SrOuyg`}),children:m_.map(b_)})}):null,t[0]=d,t[1]=a,t[2]=c,t[3]=o,t[4]=m):m=t[4];let h;t[5]!==a||t[6]!==f||t[7]!==n||t[8]!==r||t[9]!==c||t[10]!==l||t[11]!==u?(h=c===`doc`?(0,Z.jsxs)(`div`,{role:`tabpanel`,id:`panel-${a}`,"aria-labelledby":`tab-${a}`,className:`min-h-0 flex-1`,children:[a===`outline`&&(0,Z.jsx)(Es,{docName:n,isSourceMode:r}),a===`links`&&(0,Z.jsx)(ug,{docName:n}),a===`graph`&&(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`-lCAuQ`})}),children:(0,Z.jsx)(__,{activeDocName:n})}),a===`timeline`&&(0,Z.jsx)(l_,{docName:n,diffLayout:f,onDiffLayoutChange:p,onSaveVersion:l,saving:u})]}):(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`div`,{role:`status`,"aria-busy":`true`,className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`ONPvOb`})}),children:(0,Z.jsx)(v_,{})})}),t[5]=a,t[6]=f,t[7]=n,t[8]=r,t[9]=c,t[10]=l,t[11]=u,t[12]=h):h=t[12];let g;return t[13]!==m||t[14]!==h?(g=(0,Z.jsxs)(Z.Fragment,{children:[m,h]}),t[13]=m,t[14]=h,t[15]=g):g=t[15],g}function b_(e){let{id:t,icon:n}=e,r=h_(t);return(0,Z.jsxs)(Kr,{children:[(0,Z.jsx)(Co,{value:t,role:`tab`,id:`tab-${t}`,"aria-controls":`panel-${t}`,"aria-label":r,asChild:!0,children:(0,Z.jsx)($n,{children:(0,Z.jsx)(n,{})})}),(0,Z.jsx)(wn,{side:`bottom`,children:r})]},t)}function x_(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function S_(e,t){let n=getComputedStyle(e.ownerDocument.body);return t*parseFloat(n.fontSize)}function C_(e){return e/100*window.innerHeight}function w_(e){return e/100*window.innerWidth}function T_(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function E_({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=T_(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=S_(t,i);break;case`em`:r=x_(t,i);break;case`vh`:r=C_(i);break;case`vw`:r=w_(i);break}return r}function D_(e){return parseFloat(e.toFixed(3))}function O_({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function k_(e){let{panels:t}=e,n=O_({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=D_(E_({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=D_(E_({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=D_(E_({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=D_(E_({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function A_(e,t=`Assertion error`){if(!e)throw Error(t)}function j_(e,t){return Array.from(t).sort(e===`horizontal`?M_:N_)}function M_(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function N_(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function P_(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function F_(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function I_({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=F_(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return A_(i,`No rect found`),i}var L_;function R_(){return L_===void 0&&(L_=typeof matchMedia==`function`?!!matchMedia(`(pointer:coarse)`).matches:!1),L_}function z_(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=j_(n,Array.from(t.children).filter(P_).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,I_({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p;break}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=R_()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:O_({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var B_=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0)if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},V_=new Map,H_=new B_;function U_(e){V_=new Map(V_),V_.delete(e)}function W_(e,t){for(let[t]of V_)if(t.id===e)return t}function G_(e,t){for(let[t,n]of V_)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function K_(){return V_}function q_(e,t){return H_.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function J_(e,t){let n=V_.get(e);V_=new Map(V_),V_.set(e,t),H_.emit(`groupChange`,{group:e,prev:n,next:t})}function Y_(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=F_(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t);break}}return r?{distance:i,hitRegion:r}:void 0}function X_(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Z_(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:rv(e),b:rv(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();A_(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:nv(tv(n.a)),b:nv(tv(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var Q_=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function $_(e){let t=getComputedStyle(iv(e)??e).display;return t===`flex`||t===`inline-flex`}function ev(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||$_(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||Q_.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function tv(e){let t=e.length;for(;t--;){let n=e[t];if(A_(n,`Missing node`),ev(n))return n}return null}function nv(e){return e&&Number(getComputedStyle(e).zIndex)||0}function rv(e){let t=[];for(;e;)t.push(e),e=iv(e);return t}function iv(e){let{parentNode:t}=e;return X_(t)?t.host:t}function av(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function ov({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!P_(n)||n.contains(e)||e.contains(n))return!0;if(Z_(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(av(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function sv(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=z_(r),a=Y_(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&ov({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function cv(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function lv(e,t,n=0){return Math.abs(D_(e)-D_(t))<=n}function uv(e,t){return lv(e,t)?0:e>t?1:-1}function dv({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(uv(r,c)<0)if(a){let e=(i+c)/2;r=uv(r,e)<0?i:c}else r=c;return r=Math.min(s,r),r=D_(r),r}function fv({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(lv(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;A_(u!=null,`Invalid first pivot index`),A_(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];A_(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(A_(n!=null,`Previous layout not found for panel index ${t}`),lv(n,i)){let t=o-n;uv(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];A_(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(A_(n!=null,`Previous layout not found for panel index ${t}`),lv(n,o)){let t=n-i;uv(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];A_(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&uv(i,c)<0)if(e>0){let t=c-o,n=t/2;uv(i+e,c)<0&&(e=uv(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;uv(i-e,c)<0&&(e=uv(100+e,n)>0?0:-t)}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];A_(e!=null,`Previous layout not found for panel index ${r}`);let a=dv({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];A_(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=dv({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!lv(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(cv(c,l))return i;{let t=e<0?d:u,r=s[t];A_(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=dv({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!lv(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];A_(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=dv({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(lv(i,s)||(t-=s-i,l[r]=s),lv(t,0))break;e>0?r--:r++}}}if(!lv(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function pv(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||uv(e[n],t[n])!==0)return!1;return!0}function mv({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!lv(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];A_(t!=null,`No layout data found for index ${e}`),r[e]=100/i*t}let a=0;for(let e=0;e<t.length;e++){let i=n[e];A_(i!=null,`No layout data found for index ${e}`);let o=r[e];A_(o!=null,`No layout data found for index ${e}`);let s=dv({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!lv(a,0))for(let e=0;e<t.length;e++){let n=r[e];A_(n!=null,`No layout data found for index ${e}`);let i=n+a,o=dv({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,lv(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function hv({groupId:e,panelId:t}){let n=()=>{let t=K_();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=e=>{let r=a();if(e===r)return;let{defaultLayoutDeferred:i,derivedPanelConstraints:o,group:s,groupSize:c,layout:l,separatorToPanels:u}=n(),d=s.panels.findIndex(e=>e.id===t),f=d===s.panels.length-1,p=mv({layout:fv({delta:f?r-e:e-r,initialLayout:l,panelConstraints:o,pivotIndices:f?[d-1,d]:[d,d+1],prevLayout:l,trigger:`imperative-api`}),panelConstraints:o});pv(l,p)||J_(s,{defaultLayoutDeferred:i,derivedPanelConstraints:o,groupSize:c,layout:p,separatorToPanels:u})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),s=a();e&&s!==t&&(n.expandToSize=s,o(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:s}=i(),c=a();if(e&&c===t){let e=s.expandToSize??n;e===0&&(e=1),o(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&lv(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=O_({group:t});o(D_(E_({groupSize:a,panelElement:r,styleProp:e})/a*100))}}}function gv(e){e.defaultPrevented||sv(e,K_()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=hv({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function _v(e){let t=K_();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function vv({groupId:e}){let t=()=>{let t=K_();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=mv({layout:e,panelConstraints:r});return n?o:(pv(o,c)||J_(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function yv(e,t){let n=_v(e),r=G_(n.id,!0),i=n.separators.find(t=>t.element===e);A_(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);A_(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=vv({groupId:n.id}).getLayout(),c=mv({layout:fv({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});pv(s,c)||J_(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels})}function bv(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=_v(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&yv(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&yv(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&yv(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&yv(t,-5);break;case`End`:e.preventDefault(),yv(t,100);break;case`Enter`:{e.preventDefault();let n=_v(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=G_(n.id,!0),o=n.separators.find(e=>e.element===t);A_(o,`Matching separator not found`);let s=a.get(o);A_(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(A_(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];yv(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=_v(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);A_(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),yv(t,-100);break}}var xv={cursorFlags:0,state:`inactive`},Sv=new B_;function Cv(){return xv}function wv(e){return Sv.addListener(`change`,e)}function Tv(e){let t=xv,n={...xv};n.cursorFlags=e,xv=n,Sv.emit(`change`,{prev:t,next:n})}function Ev(e){let t=xv;xv=e,Sv.emit(`change`,{prev:t,next:e})}function Dv(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=K_(),n=sv(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),Ev({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}var Ov=e=>e,kv=()=>{},Av=1,jv=2,Mv=4,Nv=8,Pv=3,Fv=12,Iv;function Lv(){return Iv===void 0&&(Iv=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(Iv=!0)),Iv}function Rv({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++;break}})}if(!(r===0&&i===0)){switch(n){case`active`:if(e&&Lv()){let t=(e&Av)!==0,n=(e&jv)!==0,r=(e&Mv)!==0,i=(e&Nv)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}break}return Lv()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var zv=new WeakMap;function Bv(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=zv.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));let r=Cv();switch(r.state){case`active`:case`hover`:{let e=Rv({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}zv.set(e,{prevStyle:t,styleSheet:n})}function Vv({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=fv({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(pv(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?Av:jv;break;case`vertical`:s|=d<0?Mv:Nv;break}}else J_(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&Pv:c|=s&Pv,t.movementY===0?c|=o&Fv:c|=s&Fv,Tv(c),Bv(e)}function Hv(e){let t=K_(),n=Cv();switch(n.state){case`active`:Vv({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function Uv(e){if(e.defaultPrevented)return;let t=Cv(),n=K_();switch(t.state){case`active`:if(e.buttons===0){Ev({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{let t=G_(e.group.id,!0);J_(e.group,t)});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.hasPointerCapture?.(e.pointerId)||t.setPointerCapture?.(e.pointerId)}Vv({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=sv(e,n);r.length===0?t.state!==`inactive`&&Ev({cursorFlags:0,state:`inactive`}):Ev({cursorFlags:0,hitRegions:r,state:`hover`}),Bv(e.currentTarget);break}}}function Wv(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(Cv().state){case`hover`:Ev({cursorFlags:0,state:`inactive`})}}function Gv(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=Cv();switch(t.state){case`active`:Ev({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(Bv(e.currentTarget),t.hitRegions.forEach(e=>{let t=G_(e.group.id,!0);J_(e.group,t)}),e.preventDefault())}}function Kv(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=D_(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=D_((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function qv(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=O_({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:D_(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function Jv(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Yv({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=D_(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e;break}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=D_((r[e]??0)/a*l);else{let e=D_(l/c.length);for(let t of c)u[t]=e}return u}function Xv(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var Zv=new Map;function Qv(e){let t=!0;A_(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=O_({group:e});if(t===0)return;let n=G_(e.id);if(!n)return;let r=k_(e),i=n.defaultLayoutDeferred?Kv(r):n.layout,a=mv({layout:Yv({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&pv(n.layout,a)&&Jv(n.derivedPanelConstraints,r)&&n.groupSize===t)return;J_(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else qv(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{A_(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=O_({group:e}),s=k_(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(Xv(e.panels,l)||(l=void 0));let u=mv({layout:e.mutableState.layouts[c]??l??Kv(s),panelConstraints:s}),d=e.element.ownerDocument;Zv.set(d,(Zv.get(d)??0)+1);let f=new Map;return z_(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),J_(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{A_(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,bv)}),Zv.get(d)===1&&(d.addEventListener(`dblclick`,gv,!0),d.addEventListener(`pointerdown`,Dv,!0),d.addEventListener(`pointerleave`,Hv),d.addEventListener(`pointermove`,Uv),d.addEventListener(`pointerout`,Wv),d.addEventListener(`pointerup`,Gv,!0)),function(){t=!1,Zv.set(d,Math.max(0,(Zv.get(d)??0)-1)),U_(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,bv)}),Zv.get(d)||(d.removeEventListener(`dblclick`,gv,!0),d.removeEventListener(`pointerdown`,Dv,!0),d.removeEventListener(`pointerleave`,Hv),d.removeEventListener(`pointermove`,Uv),d.removeEventListener(`pointerout`,Wv),d.removeEventListener(`pointerup`,Gv,!0)),a.disconnect()}}function $v(){let[e,t]=(0,Q.useState)({});return[e,(0,Q.useCallback)(()=>t({}),[])]}function ey(e){let t=(0,Q.useId)();return`${e??t}`}var ty=typeof window<`u`?Q.useLayoutEffect:Q.useEffect;function ny(e){let t=(0,Q.useRef)(e);return ty(()=>{t.current=e},[e]),(0,Q.useCallback)((...e)=>t.current?.(...e),[t])}function ry(...e){return ny(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function iy(e){let t=(0,Q.useRef)({...e});return ty(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var ay=(0,Q.createContext)(null);function oy(e,t){let n=(0,Q.useRef)({getLayout:()=>({}),setLayout:Ov});(0,Q.useImperativeHandle)(t,()=>n.current,[]),ty(()=>{Object.assign(n.current,vv({groupId:e}))})}function sy({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){let m=(0,Q.useRef)({onLayoutChange:{},onLayoutChanged:{}}),h=ny(e=>{pv(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=ny(e=>{pv(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e))}),_=ey(s),v=(0,Q.useRef)(null),[y,b]=$v(),x=(0,Q.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),S=ry(v,a);oy(_,o);let C=ny((e,t)=>{let r=Cv(),i=W_(e),a=G_(e);if(a){let e=!1;switch(r.state){case`active`:e=r.hitRegions.some(e=>e.group===i);break}return{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),w=iy({defaultLayout:n,disableCursor:r}),T=(0,Q.useMemo)(()=>({get disableCursor(){return!!w.disableCursor},getPanelStyles:C,id:_,orientation:u,registerPanel:e=>{let t=x.current;return t.panels=j_(u,[...t.panels,e]),b(),()=>{t.panels=t.panels.filter(t=>t!==e),b()}},registerSeparator:e=>{let t=x.current;return t.separators=j_(u,[...t.separators,e]),b(),()=>{t.separators=t.separators.filter(t=>t!==e),b()}},updatePanelProps:(e,{disabled:t})=>{let n=x.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=W_(_),i=G_(_);r&&i&&J_(r,{...i,derivedPanelConstraints:k_(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=x.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[C,_,b,u,w]),E=(0,Q.useRef)(null);return ty(()=>{let e=v.current;if(e===null)return;let t=x.current,n;if(w.defaultLayout!==void 0&&Object.keys(w.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=w.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:_,mutableState:{defaultLayout:n,disableCursor:!!w.disableCursor,expandedPanelSizes:x.current.lastExpandedPanelSizes,layouts:x.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};E.current=r;let a=Qv(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=G_(r.id,!0);!o&&s.length>0&&(h(c),g(c));let l=q_(_,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=lv(t.collapsedSize,i[t.panelId]),a=lv(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=Cv().state!==`active`;h(i),o&&g(i)});return()=>{E.current=null,a(),l()}},[i,_,g,h,u,y,w]),(0,Q.useEffect)(()=>{let e=E.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,Z.jsx)(ay.Provider,{value:T,children:(0,Z.jsx)(`div`,{...p,className:t,"data-group":!0,"data-testid":_,id:_,ref:S,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:e})})}sy.displayName=`Group`;function cy(){let e=(0,Q.useContext)(ay);return A_(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function ly(e,t){let{id:n}=cy(),r=(0,Q.useRef)({collapse:kv,expand:kv,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:kv});(0,Q.useImperativeHandle)(t,()=>r.current,[]),ty(()=>{Object.assign(r.current,hv({groupId:n,panelId:e}))})}function uy({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=ey(c),_=iy({disabled:a}),v=(0,Q.useRef)(null),y=ry(v,o),{getPanelStyles:b,id:x,orientation:S,registerPanel:C,updatePanelProps:w}=cy(),T=d!==null,E=ny((e,t,n)=>{d?.(e,c,n)});ty(()=>{let e=v.current;if(e!==null)return C({element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:T?E:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:_.disabled,maxSize:l,minSize:u}})},[s,n,r,i,T,g,h,l,u,E,C,_]),(0,Q.useEffect)(()=>{w(g,{disabled:a})},[a,g,w]),ly(g,f);let D=()=>{let e=b(x,g);if(e)return JSON.stringify(e)},O=(0,Q.useSyncExternalStore)(e=>q_(x,e),D,D),k;return k=O?JSON.parse(O):i?{flexGrow:void 0,flexShrink:void 0,flexBasis:i}:{flexGrow:1},(0,Z.jsx)(`div`,{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:y,style:{...dy,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...k},children:(0,Z.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...p,touchAction:S===`horizontal`?`pan-y`:`pan-x`},children:e})})}uy.displayName=`Panel`;var dy={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function fy(){return(0,Q.useRef)(null)}function py({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=mv({layout:fv({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=mv({layout:fv({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function my({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,style:o,...s}){let c=ey(a),l=iy({disabled:n,disableDoubleClick:r}),[u,d]=(0,Q.useState)({}),[f,p]=(0,Q.useState)(`inactive`),m=(0,Q.useRef)(null),h=ry(m,i),{disableCursor:g,id:_,orientation:v,registerSeparator:y,updateSeparatorProps:b}=cy(),x=v===`horizontal`?`vertical`:`horizontal`;ty(()=>{let e=m.current;if(e!==null){let t={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:e,id:c},n=y(t),r=wv(e=>{p(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=q_(_,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=a.indexOf(e);d(py({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[_,c,y,l]),(0,Q.useEffect)(()=>{b(c,{disabled:n,disableDoubleClick:r})},[n,r,c,b]);let S;return n&&!g&&(S=`not-allowed`),(0,Z.jsx)(`div`,{...s,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":x,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":n?`disabled`:f,"data-testid":c,id:c,ref:h,role:`separator`,style:{flexBasis:`auto`,cursor:S,...o,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}my.displayName=`Separator`;var hy={name:`toml`,startState:function(){return{inString:!1,stringType:``,lhs:!0,inArray:0}},token:function(e,t){let n;if(!t.inString&&(n=e.match(/^('''|"""|'|")/))&&(t.stringType=n[0],t.inString=!0),e.sol()&&!t.inString&&t.inArray===0&&(t.lhs=!0),t.inString){for(;t.inString;)if(e.match(t.stringType))t.inString=!1;else if(e.peek()===`\\`)e.next(),e.next();else if(e.eol())break;else e.match(/^.[^\\\"\']*/);return t.lhs?`property`:`string`}else if(t.inArray&&e.peek()===`]`)return e.next(),t.inArray--,`bracket`;else if(t.lhs&&e.peek()===`[`&&e.skipTo(`]`))return e.next(),e.peek()===`]`&&e.next(),`atom`;else if(e.peek()===`#`)return e.skipToEnd(),`comment`;else if(e.eatSpace())return null;else if(t.lhs&&e.eatWhile(function(e){return e!=`=`&&e!=` `}))return`property`;else if(t.lhs&&e.peek()===`=`)return e.next(),t.lhs=!1,null;else if(!t.lhs&&e.match(/^\d\d\d\d[\d\-\:\.T]*Z/))return`atom`;else if(!t.lhs&&(e.match(`true`)||e.match(`false`)))return`atom`;else if(!t.lhs&&e.peek()===`[`)return t.inArray++,e.next(),`bracket`;else if(!t.lhs&&e.match(/^\-?\d+(?:\.\d+)?/))return`number`;else e.eatSpace()||e.next();return null},languageData:{commentTokens:{line:`#`}}},gy=Rt({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),_y=_({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}});function vy(e){switch(e.toLowerCase()){case`json`:return Cs().language;case`toml`:return ys.define(hy);default:return null}}function yy(e){let t=(0,$.c)(5),{_:n}=i(),r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={status:`loading`},t[0]=r):r=t[0];let[a,o]=(0,Q.useState)(r),s,c;return t[1]!==n||t[2]!==e?(s=()=>{let t=!1,r=new AbortController;return o({status:`loading`}),fetch(e,{credentials:`same-origin`,signal:r.signal}).then(async e=>{if(!e.ok){let t=e.status;throw Error(n({id:`PauP7d`,values:{status:t}}))}return e.text()}).then(e=>{t||o({status:`loaded`,content:e})}).catch(e=>{t||e instanceof Error&&e.name===`AbortError`||o({status:`error`,message:e instanceof Error?e.message:n({id:`ig5vUe`})})}),()=>{t=!0,r.abort()}},c=[e,n],t[1]=n,t[2]=e,t[3]=s,t[4]=c):(s=t[3],c=t[4]),(0,Q.useEffect)(s,c),a}function by(e){let t=(0,$.c)(28),{src:n,fileName:r,extension:i}=e,a=(0,Q.useRef)(null),o=(0,Q.useRef)(null),{resolvedTheme:c}=pr(),l=yy(n),u=l.status===`loaded`?l.content:null,d,f;if(t[0]!==i||t[1]!==u||t[2]!==c?(d=()=>{if(!a.current||u===null)return;let e=vy(i),t=c===`dark`?gy:_y,n=[Ds,...e?[e]:[],hs.editable.of(!1),as.readOnly.of(!0),hs.lineWrapping,t],r=new hs({state:as.create({doc:u,extensions:n}),parent:a.current});return o.current=r,()=>{r.destroy(),o.current=null}},f=[u,i,c],t[0]=i,t[1]=u,t[2]=c,t[3]=d,t[4]=f):(d=t[3],f=t[4]),(0,Q.useEffect)(d,f),l.status===`loading`){let e;t[5]===r?e=t[6]:(e=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`Md709y`,values:{fileName:r}})}),t[5]=r,t[6]=e);let n;return t[7]!==i||t[8]!==r||t[9]!==e?(n=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center bg-background text-muted-foreground text-sm`,"aria-label":r,"data-text-viewer":``,"data-text-viewer-state":`loading`,"data-text-viewer-extension":i,children:e}),t[7]=i,t[8]=r,t[9]=e,t[10]=n):n=t[10],n}if(l.status===`error`){let e;t[11]===r?e=t[12]:(e=(0,Z.jsx)(`div`,{className:`font-medium text-sm`,children:(0,Z.jsx)(s,{id:`qdBUHP`,values:{fileName:r}})}),t[11]=r,t[12]=e);let a;t[13]===l.message?a=t[14]:(a=(0,Z.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:l.message}),t[13]=l.message,t[14]=a);let o;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(s,{id:`9npOH9`}),t[15]=o):o=t[15];let c;t[16]===n?c=t[17]:(c=(0,Z.jsx)(`a`,{href:n,className:`mt-2 rounded-md border px-3 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground`,children:o}),t[16]=n,t[17]=c);let u;return t[18]!==i||t[19]!==r||t[20]!==e||t[21]!==a||t[22]!==c?(u=(0,Z.jsxs)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center gap-2 bg-background p-4 text-center`,"aria-label":r,"data-text-viewer":``,"data-text-viewer-state":`error`,"data-text-viewer-extension":i,children:[e,a,c]}),t[18]=i,t[19]=r,t[20]=e,t[21]=a,t[22]=c,t[23]=u):u=t[23],u}let p;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(`div`,{ref:a,className:`min-h-0 flex-1 overflow-auto`}),t[24]=p):p=t[24];let m;return t[25]!==i||t[26]!==r?(m=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":r,"data-text-viewer":``,"data-text-viewer-state":`loaded`,"data-text-viewer-extension":i,children:p}),t[25]=i,t[26]=r,t[27]=m):m=t[27],m}function xy(e){return ir(`/api/asset?path=${encodeURIComponent(e)}`)}function Sy(e){return`/api/asset-text?path=${encodeURIComponent(e)}`}function Cy(e){let t=(0,$.c)(28),{assetPath:n,mediaKind:r}=e,[i,a]=(0,Q.useState)(!1),o;t[0]===n?o=t[1]:(o=xy(n),t[0]=n,t[1]=o);let c=o,u;t[2]===n?u=t[3]:(u=n.split(`/`).pop()??n,t[2]=n,t[3]=u);let d=u,f,p,m;if(t[4]!==n||t[5]!==d||t[6]!==i||t[7]!==r||t[8]!==c){m=Symbol.for(`react.early_return_sentinel`);bb0:{let e=d.includes(`.`)?d.split(`.`).pop()??``:``;if(p=e.length>0?e.toUpperCase():`FILE`,f=i?`text`:r,f===`pdf`){let e;t[12]!==d||t[13]!==c?(e=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,Z.jsx)(l,{src:c,title:d,fillContainer:!0})}),t[12]=d,t[13]=c,t[14]=e):e=t[14];let n;t[15]!==d||t[16]!==e?(n=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":d,children:e}),t[15]=d,t[16]=e,t[17]=n):n=t[17],m=n;break bb0}if(f===`text`){let r;t[18]===n?r=t[19]:(r=Sy(n),t[18]=n,t[19]=r),m=(0,Z.jsx)(by,{src:r,fileName:d,extension:e.toLowerCase()},n);break bb0}}t[4]=n,t[5]=d,t[6]=i,t[7]=r,t[8]=c,t[9]=f,t[10]=p,t[11]=m}else f=t[9],p=t[10],m=t[11];if(m!==Symbol.for(`react.early_return_sentinel`))return m;let h;t[20]!==f||t[21]!==p||t[22]!==d||t[23]!==c?(h=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto p-4`,children:f===`image`?(0,Z.jsx)(jt,{src:c,alt:d,draggable:!1,slotClassName:`flex h-full w-full items-center justify-center`,className:`max-h-full max-w-full`}):f===`video`?(0,Z.jsx)(`video`,{src:c,controls:!0,className:`max-h-full max-w-full`}):f===`audio`?(0,Z.jsx)(`audio`,{src:c,controls:!0,className:`w-full max-w-md`}):(0,Z.jsxs)(`div`,{className:`flex max-w-sm flex-col items-center gap-3 text-center`,children:[(0,Z.jsx)(`div`,{className:`flex size-16 items-center justify-center rounded-md border bg-muted font-medium text-muted-foreground text-sm`,children:p}),(0,Z.jsx)(`div`,{className:`max-w-full break-words font-medium text-sm`,children:d}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[(0,Z.jsx)(Di,{asChild:!0,variant:`outline`,size:`sm`,children:(0,Z.jsx)(`a`,{href:c,children:(0,Z.jsx)(s,{id:`9npOH9`})})}),(0,Z.jsx)(Di,{variant:`outline`,size:`sm`,onClick:()=>a(!0),"data-testid":`asset-preview-open-as-text`,children:(0,Z.jsx)(s,{id:`Ruuu3v`})})]})]})}),t[20]=f,t[21]=p,t[22]=d,t[23]=c,t[24]=h):h=t[24];let g;return t[25]!==d||t[26]!==h?(g=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":d,children:h}),t[25]=d,t[26]=h,t[27]=g):g=t[27],g}function wy(){let e=(0,$.c)(5),{_:t}=i(),n;e[0]===t?n=e[1]:(n=t({id:`3VsNTI`}),e[0]=t,e[1]=n);let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(Wa,{className:`h-9 w-2/5 mt-6 mb-5`}),(0,Z.jsx)(Wa,{className:`h-4 w-full`}),(0,Z.jsx)(Wa,{className:`h-4 w-3/4`})]}),e[2]=r):r=e[2];let a;return e[3]===n?a=e[4]:(a=(0,Z.jsx)(`div`,{className:`tiptap-editor pt-10`,role:`status`,"aria-busy":`true`,"aria-label":n,children:r}),e[3]=n,e[4]=a),a}var Ty={"claude-cowork":`claude`,"claude-code":`claude`,codex:`openai`,cursor:`cursor`};function Ey(e){let t=(0,$.c)(23),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({id:r,style:a,className:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let{resolvedTheme:o}=pr(),s=Ty[r],c=s?(o===`dark`?or[s]:void 0)??wr[s]:void 0,l;t[5]!==c||t[6]!==a?(l=c?{...a,"--ok-brand-color":c}:a,t[5]=c,t[6]=a,t[7]=l):l=t[7];let u=l,d=c&&`[&_*]:![color:var(--ok-brand-color)]`,f;t[8]!==n||t[9]!==d?(f=X(d,n),t[8]=n,t[9]=d,t[10]=f):f=t[10];let p=f;if(r===`claude-cowork`||r===`claude-code`){let e;return t[11]!==p||t[12]!==u||t[13]!==i?(e=(0,Z.jsx)(Mi,{style:u,className:p,...i}),t[11]=p,t[12]=u,t[13]=i,t[14]=e):e=t[14],e}if(r===`codex`){let e;return t[15]!==p||t[16]!==u||t[17]!==i?(e=(0,Z.jsx)(ji,{style:u,className:p,...i}),t[15]=p,t[16]=u,t[17]=i,t[18]=e):e=t[18],e}if(r===`cursor`){let e;return t[19]!==p||t[20]!==u||t[21]!==i?(e=(0,Z.jsx)(Ri,{style:u,className:p,...i}),t[19]=p,t[20]=u,t[21]=i,t[22]=e):e=t[22],e}return null}function Dy(e){let{installState:t}=e;return t.installed===null?Y._({id:`IA6JW2`}):t.installed===!1?Y._({id:`5SwVv1`}):null}function Oy(e){let{target:t,installState:n}=e;if(n.installed===null)return{enabled:!1,tooltip:null};if(n.installed===!1){let e=t.appBrandName??t.displayName;return{enabled:!1,tooltip:{message:Y._({id:`OJTOUj`,values:{brand:e}}),installAction:{label:Y._({id:`fG0X0e`,values:{brand:e}}),url:t.installUrl},...t.hasWebFallback?{webFallback:{label:Y._({id:`0S9PW_`}),url:``}}:{}}}}return{enabled:!0,tooltip:null}}function ky(e){return Lr(e)}function Ay(e){return Y._({id:`h_HYHD`,values:{displayName:e}})}var jy=`claude.ai`;async function My(e,t=Wm){(await t(Lr(e))).ok?Uo.success(Ay(jy)):Uo.error(Y._({id:`9NC_MT`,values:{CLAUDE_WEB_FALLBACK_LABEL:jy}}))}function Ny(e){let t=(0,$.c)(68),{_:n}=i(),{target:r,installState:a,isElectronHost:o,prompt:s,onSelect:c}=e,l=e.openExternal??Wm,u=e.onWebFallbackSuccess??Fy,d=e.onWebFallbackError??Py,{displayName:f}=r,p,m,h,g,_,v,y,b,x,S;if(t[0]!==n||t[1]!==a||t[2]!==o||t[3]!==c||t[4]!==d||t[5]!==u||t[6]!==l||t[7]!==s||t[8]!==r||t[9]!==f){S=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Oy({target:r,installState:a,isElectronHost:o}),i=Dy({target:r,installState:a,isElectronHost:o}),C=()=>{e.tooltip&&l(e.tooltip.installAction.url)},w;t[20]!==d||t[21]!==u||t[22]!==l||t[23]!==s||t[24]!==r?(w=()=>{(async()=>{let e=await l(ky(s));e.ok?u(r):d(r,e.detail??e.reason)})()},t[20]=d,t[21]=u,t[22]=l,t[23]=s,t[24]=r,t[25]=w):w=t[25];let T=w;if(e.enabled){let e=`open-in-agent-item-${r.id}`,i;t[26]!==n||t[27]!==f?(i=n({id:`NnQapF`,values:{targetDisplayName:f}}),t[26]=n,t[27]=f,t[28]=i):i=t[28];let a;t[29]===r.id?a=t[30]:(a=(0,Z.jsx)(Ey,{id:r.id,"aria-hidden":`true`}),t[29]=r.id,t[30]=a);let o;t[31]===r.displayName?o=t[32]:(o=(0,Z.jsx)(`span`,{children:r.displayName}),t[31]=r.displayName,t[32]=o);let s;t[33]!==c||t[34]!==i||t[35]!==a||t[36]!==o||t[37]!==e?(s=(0,Z.jsxs)(ca,{onSelect:c,"data-testid":e,"aria-label":i,children:[a,o]}),t[33]=c,t[34]=i,t[35]=a,t[36]=o,t[37]=e,t[38]=s):s=t[38],S=s;break bb0}if(!e.tooltip){let e=n(i?{id:`If0crP`,values:{targetDisplayName:f,hint:i}}:{id:`NnQapF`,values:{targetDisplayName:f}}),a;t[39]===r.id?a=t[40]:(a=(0,Z.jsx)(Ey,{id:r.id,"aria-hidden":`true`}),t[39]=r.id,t[40]=a);let o;t[41]===r.displayName?o=t[42]:(o=(0,Z.jsx)(`span`,{className:`flex-1`,children:r.displayName}),t[41]=r.displayName,t[42]=o),S=(0,Z.jsxs)(ca,{disabled:!0,"data-testid":`open-in-agent-item-${r.id}`,"aria-label":e,children:[a,o,i?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:i}):null]});break bb0}let E=n(i?{id:`If0crP`,values:{targetDisplayName:f,hint:i}}:{id:`NnQapF`,values:{targetDisplayName:f}}),D=e.tooltip.webFallback?.label??``;m=ka;let O=`open-in-agent-item-${r.id}`,k;t[43]===r.id?k=t[44]:(k=(0,Z.jsx)(Ey,{id:r.id,"aria-hidden":`true`,className:`mr-2`}),t[43]=r.id,t[44]=k);let A;t[45]===r.displayName?A=t[46]:(A=(0,Z.jsx)(`span`,{className:`flex-1`,children:r.displayName}),t[45]=r.displayName,t[46]=A);let j;t[47]===i?j=t[48]:(j=i?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:i}):null,t[47]=i,t[48]=j),t[49]!==E||t[50]!==k||t[51]!==A||t[52]!==j||t[53]!==O?(x=(0,Z.jsxs)(Aa,{"data-testid":O,"data-row-disabled":``,"aria-label":E,children:[k,A,j]}),t[49]=E,t[50]=k,t[51]=A,t[52]=j,t[53]=O,t[54]=x):x=t[54],p=Oa,h=`min-w-[260px]`,g=`open-in-agent-submenu-${r.id}`,_=(0,Z.jsx)(io,{className:`font-normal text-muted-foreground text-xs`,"data-testid":`open-in-agent-message-${r.id}`,children:e.tooltip.message}),t[55]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(sa,{}),t[55]=v):v=t[55],y=(0,Z.jsx)(ca,{onSelect:C,"data-testid":`open-in-agent-install-${r.id}`,children:(0,Z.jsx)(`span`,{children:e.tooltip.installAction.label})}),b=e.tooltip.webFallback?(0,Z.jsxs)(ca,{onSelect:T,"data-testid":`open-in-agent-web-fallback-${r.id}`,"aria-label":n({id:`lsOFZR`,values:{webFallbackLabel:D}}),children:[(0,Z.jsx)(`span`,{className:`flex-1`,children:e.tooltip.webFallback.label}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:n({id:`Z9BoIy`})})]}):null}t[0]=n,t[1]=a,t[2]=o,t[3]=c,t[4]=d,t[5]=u,t[6]=l,t[7]=s,t[8]=r,t[9]=f,t[10]=p,t[11]=m,t[12]=h,t[13]=g,t[14]=_,t[15]=v,t[16]=y,t[17]=b,t[18]=x,t[19]=S}else p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15],y=t[16],b=t[17],x=t[18],S=t[19];if(S!==Symbol.for(`react.early_return_sentinel`))return S;let C;t[56]!==p||t[57]!==h||t[58]!==g||t[59]!==_||t[60]!==v||t[61]!==y||t[62]!==b?(C=(0,Z.jsxs)(p,{className:h,"data-testid":g,children:[_,v,y,b]}),t[56]=p,t[57]=h,t[58]=g,t[59]=_,t[60]=v,t[61]=y,t[62]=b,t[63]=C):C=t[63];let w;return t[64]!==m||t[65]!==x||t[66]!==C?(w=(0,Z.jsxs)(m,{children:[x,C]}),t[64]=m,t[65]=x,t[66]=C,t[67]=w):w=t[67],w}function Py(){}function Fy(){}function Iy(e){let t=(0,$.c)(12),{className:n}=e,{states:r,refresh:i}=yh(),{dispatch:a}=ch(),o=Pa(),s,c;if(t[0]!==n||t[1]!==a||t[2]!==i||t[3]!==r||t[4]!==o){let e=Xm({workspace:o});t[7]===n?s=t[8]:(s=X(`grid w-full max-w-5xl gap-4 sm:grid-cols-3`,n),t[7]=n,t[8]=s),c=_m.map(t=>{let n=r[t.id]?.installed,o=n===!0?`installed`:n===!1?`missing`:`pending`;return(0,Z.jsx)(Ly,{target:t,status:o,onOpen:o===`installed`&&e!==null?()=>{a(t.id,e)}:void 0,onInstall:()=>{Qm(t),i()}},t.id)}),t[0]=n,t[1]=a,t[2]=i,t[3]=r,t[4]=o,t[5]=s,t[6]=c}else s=t[5],c=t[6];let l;return t[9]!==s||t[10]!==c?(l=(0,Z.jsx)(`div`,{className:s,children:c}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function Ly(e){let t=(0,$.c)(22),{target:n,status:r,onOpen:i,onInstall:a}=e,o=r===`installed`?i:r===`missing`?a:void 0,s=r===`pending`||r===`installed`&&i===void 0,c=r===`installed`?`Open`:r===`missing`?`Install`:`Checking`,l;t[0]===n.id?l=t[1]:(l=(0,Z.jsx)(Ey,{id:n.id,"aria-hidden":`true`,className:`size-4`}),t[0]=n.id,t[1]=l);let u;t[2]===n.displayName?u=t[3]:(u=(0,Z.jsx)(`h3`,{className:`text-sm font-medium leading-tight`,children:n.displayName}),t[2]=n.displayName,t[3]=u);let d;t[4]!==l||t[5]!==u?(d=(0,Z.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-start sm:items-center gap-2`,children:[l,u]}),t[4]=l,t[5]=u,t[6]=d):d=t[6];let f;t[7]===n.tagline?f=t[8]:(f=n.tagline?(0,Z.jsx)(`p`,{className:`text-1sm leading-relaxed text-muted-foreground`,children:n.tagline}):null,t[7]=n.tagline,t[8]=f);let p;t[9]!==d||t[10]!==f?(p=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[d,f]}),t[9]=d,t[10]=f,t[11]=p):p=t[11];let m;t[12]===r?m=t[13]:(m=r===`missing`?(0,Z.jsx)(To,{"aria-hidden":`true`,className:`size-3`}):null,t[12]=r,t[13]=m);let h;t[14]!==c||t[15]!==m?(h=(0,Z.jsxs)(`p`,{className:`mt-auto inline-flex items-center gap-1 pt-2 font-mono text-2xs uppercase tracking-wider text-muted-foreground`,children:[c,m]}),t[14]=c,t[15]=m,t[16]=h):h=t[16];let g;return t[17]!==s||t[18]!==o||t[19]!==p||t[20]!==h?(g=(0,Z.jsxs)(`button`,{type:`button`,onClick:o,disabled:s,className:`group flex h-full flex-col items-start gap-4 rounded-2xl border border-border/60 bg-card p-5 text-left transition-[border-color,box-shadow,transform] hover:border-border hover:shadow-sm focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:cursor-not-allowed disabled:opacity-60`,children:[p,h]}),t[17]=s,t[18]=o,t[19]=p,t[20]=h,t[21]=g):g=t[21],g}var Ry=3100,zy=3;function By(e,t,n){let r=n?.windowMs??600,i=n?.maxLevel??zy;if(e===0||t>=r)return 1;let a=e+1;return a>i?i:a}var Vy={0:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},1:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},2:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},3:{count:16,startRadius:11,baseDistance:7,distanceVariance:3,sizeMin:.45,sizeMax:1.2,maxDelay:500,durationMin:1100,durationMax:2400}},Hy=[`var(--color-azure-blue)`,`var(--color-sky-blue)`,`var(--color-violet-300)`,`var(--color-orange-light)`,`var(--color-crystal-blue)`,`var(--color-white-cream)`];function Uy(e,t={}){let n=t.rng??Math.random,r=t.colors??Hy,i=Vy[e];if(i.count===0||r.length===0)return[];let a=[],o=Math.PI*2/i.count;for(let e=0;e<i.count;e++){let t=e*o+(n()-.5)*o*.7,s=i.baseDistance+(n()-.5)*2*i.distanceVariance,c=i.sizeMin+n()*(i.sizeMax-i.sizeMin),l=n()*i.maxDelay,u=i.durationMin+n()*(i.durationMax-i.durationMin),d=Math.floor(n()*r.length),f=Math.cos(t),p=Math.sin(t);a.push({id:e,dx:f*s,dy:p*s,originDx:f*i.startRadius,originDy:p*i.startRadius,size:c,color:r[d]??`currentColor`,delay:l,duration:u})}return a}var Wy=1.8,Gy=90,Ky=16,qy=380,Jy=.025,Yy=.1,Xy=.18,Zy=400,Qy=9.2736,$y=18.1799,eb=14.5244,tb={1:{halfWidth:1.5,apexLift:2.2},2:{halfWidth:1.4,apexLift:2.6},3:{halfWidth:1.25,apexLift:3}};function nb(e,t){let{halfWidth:n,apexLift:r}=tb[t];return`M${e-n} ${eb+.3} Q${e} ${eb-r}, ${e+n} ${eb+.3}`}function rb(e){let t=1.5,n=.3;return`M${e-t} ${eb-n} Q${e} ${eb+1.4}, ${e+t} ${eb-n}`}var ib=15,ab=15;function ob(e){return{fill:e.color,"--fx-tx":`${e.dx}px`,"--fx-ty":`${e.dy}px`,"--fx-delay":`${e.delay}ms`,"--fx-duration":`${e.duration}ms`}}function sb(e){let t=(0,$.c)(71),{size:n,className:r,trackMouse:i,variant:a,celebrateSignal:o}=e,s=n===void 0?48:n,c=i===void 0?!0:i,l=a===void 0?`default`:a,u=o===void 0?0:o,d=(0,Q.useRef)(null),f=(0,Q.useRef)(null),p=(0,Q.useRef)(null),m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m={x:0,y:0},t[0]=m):m=t[0];let h=(0,Q.useRef)(m),[g,_]=(0,Q.useState)(0),[v,y]=(0,Q.useState)(0),b;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(b=[],t[1]=b):b=t[1];let[x,S]=(0,Q.useState)(b),C=(0,Q.useRef)(0),w=(0,Q.useRef)(void 0),T=l===`sleeping`,E;t[2]!==g||t[3]!==T?(E=function(){if(T)return;let e=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),t=C.current===0?1/0:e-C.current;C.current=e;let n=By(g,t);_(n),y(db),S(Uy(n)),clearTimeout(w.current),w.current=setTimeout(()=>{_(0),S([])},Ry)},t[2]=g,t[3]=T,t[4]=E):E=t[4];let D=E,O,k;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>()=>clearTimeout(w.current),k=[],t[5]=O,t[6]=k):(O=t[5],k=t[6]),(0,Q.useEffect)(O,k);let A,j;t[7]!==u||t[8]!==T?(A=()=>{u===0||T||(_(3),y(ub),S(Uy(3)),clearTimeout(w.current),w.current=setTimeout(()=>{_(0),S([])},Ry))},j=[u,T],t[7]=u,t[8]=T,t[9]=A,t[10]=j):(A=t[9],j=t[10]),(0,Q.useEffect)(A,j);let M,N;t[11]!==T||t[12]!==c?(M=()=>{if(!c||T||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let e=0,t=0,n=!1,r=0,i=0,a=0,o=0,s=0,l=function(){s===0&&(s=requestAnimationFrame(m))},u=function(r){e=r.clientX,t=r.clientY,n=!0,l()};function m(){s=0;let c=f.current,u=d.current;if(!c||!u){l();return}let m=n;n=!1;let g=c.getBoundingClientRect(),_=g.left+g.width/2,v=g.top+g.height*.48,y=e-_,b=t-v,x=Math.hypot(y,b),S=Math.max(-1,Math.min(1,y/qy)),C=Math.max(-1,Math.min(1,b/qy)),w=S*Ky,T=-C*Ky,E=0,D=0;if(x>=1){let e=Math.min(x/Gy,1)*Wy;E=y/x*e,D=b/x*e}let O=Math.abs(T-r)<.01&&Math.abs(w-i)<.01&&Math.abs(E-a)<.01&&Math.abs(D-o)<.01;if(!m&&O)return;l(),r+=(T-r)*Yy,i+=(w-i)*Yy,u.style.transform=`perspective(${Zy}px) rotateX(${r.toFixed(3)}deg) rotateY(${i.toFixed(3)}deg)`,a+=(E-a)*Xy,o+=(D-o)*Xy;let k=i*Jy,A=-r*Jy,j=a+k,M=o+A;h.current.x=j,h.current.y=M,p.current?.setAttribute(`transform`,`translate(${j.toFixed(3)} ${M.toFixed(3)})`)}return document.addEventListener(`mousemove`,u,{passive:!0}),l(),()=>{document.removeEventListener(`mousemove`,u),s!==0&&cancelAnimationFrame(s),s=0,d.current&&(d.current.style.transform=``),h.current={x:0,y:0},p.current?.removeAttribute(`transform`)}},N=[c,T],t[11]=T,t[12]=c,t[13]=M,t[14]=N):(M=t[13],N=t[14]),(0,Q.useEffect)(M,N);let P;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(P=()=>{let e=p.current;if(!e)return;let{x:t,y:n}=h.current;e.setAttribute(`transform`,`translate(${t.toFixed(3)} ${n.toFixed(3)})`)},t[15]=P):P=t[15],(0,Q.useLayoutEffect)(P);let F=g>0,I=F?g:1,L=F?`ok-blob-clicked-${g}`:null,R;t[16]===r?R=t[17]:(R=X(`ok-blob-3d-wrapper`,r),t[16]=r,t[17]=R);let z=T?`cursor-default`:`cursor-pointer`,B=`body-${v}`,V=T&&`ok-blob-sleeping`,H;t[18]!==L||t[19]!==V?(H=X(`ok-blob-group`,V,L),t[18]=L,t[19]=V,t[20]=H):H=t[20];let U;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(`path`,{d:`M25.2339 6.78134C25.5199 7.35734 25.8179 8.47234 26.0179 9.07834C26.0189 9.08234 26.0209 9.08634 26.0219 9.09134C26.0229 9.09534 26.0249 9.10034 26.0259 9.10434C26.0539 9.19734 26.0949 9.29533 26.1519 9.41633C26.2919 9.71133 26.5269 10.1173 27.1299 11.1683C27.3259 11.4643 27.5209 11.7693 27.7119 12.0903C29.9739 15.1623 29.3259 20.1913 27.0469 22.9153C26.7779 23.2953 26.4869 23.6043 26.1889 23.8863C26.1519 23.9253 26.1129 23.9643 26.0729 24.0033C25.3159 24.7543 24.2949 25.4673 23.6129 25.8323C22.7469 26.2983 22.1349 26.5483 21.6299 26.7463C20.3649 27.3063 19.0609 27.7733 17.6569 28.0423C15.9649 28.3513 14.1939 28.4433 12.4569 28.1373C11.4779 27.9663 10.5119 27.6663 9.60891 27.2493C8.77491 26.8663 7.99192 26.3853 7.26992 25.8403C6.83592 25.5393 6.43893 25.2343 6.08093 24.9383C5.57893 24.5223 5.15993 24.1263 4.83493 23.7793C4.04993 22.9443 3.31593 21.8893 2.80893 21.0953C2.72593 20.9663 2.64792 20.8433 2.57592 20.7293C2.56192 20.7093 2.54793 20.6893 2.53393 20.6703C2.08593 20.0263 1.71892 19.3293 1.43792 18.5993C1.42892 18.5453 1.42093 18.4903 1.41293 18.4353C1.32093 17.7443 1.08292 16.9423 1.01092 15.6333C0.984921 15.0653 0.998928 14.4013 1.12393 13.6353C1.20693 13.1413 1.31993 12.9023 1.40893 12.7113C1.43593 12.6543 1.46193 12.6023 1.48593 12.5483C1.56793 12.3653 1.59392 12.1563 1.63592 11.9083C1.68992 11.5883 1.76992 11.1943 2.04592 10.7553C2.94392 9.37934 3.36792 8.81934 3.66592 8.33934C3.75592 8.20334 3.84292 8.08134 3.94192 7.96634C4.21592 7.64634 4.67693 7.29534 5.10293 7.05734C5.16693 7.02234 5.23093 6.98834 5.29193 6.95534C5.62993 6.77834 6.22592 6.30135 6.66992 5.92035C6.83692 5.77635 7.08193 5.60735 7.37393 5.40935C7.67393 5.20535 8.02593 4.96934 8.39193 4.70234C9.32093 4.02634 9.84091 3.69134 10.2599 3.42334C10.3799 3.34734 10.4919 3.27734 10.6049 3.20834C10.9609 2.98834 11.4149 2.73034 11.8869 2.48634C12.4519 2.19334 13.0469 1.92133 13.5089 1.72233C14.7399 1.30233 16.0539 1.01333 17.4169 1.00033C18.1169 0.991333 18.7939 1.16534 19.2389 1.43034C19.6869 1.69534 19.8689 2.00335 19.8039 2.23935C19.7379 2.47835 19.4399 2.63634 19.0109 2.74734C18.5789 2.85634 18.0469 2.92035 17.4889 2.96135C16.3639 3.04235 15.2399 3.36435 14.1499 3.80835C12.8199 4.35135 11.5379 5.07133 10.2719 5.84733C9.38691 6.39133 8.51192 6.97334 7.63592 7.56834C7.54492 7.63034 7.45492 7.69135 7.36492 7.75235C6.97392 8.06635 6.58293 8.38134 6.22293 8.66334C5.97893 8.85734 5.76793 9.04834 5.59393 9.21434C5.26893 9.52334 5.02393 9.74334 4.81893 9.93934C4.67793 10.0753 4.55793 10.2013 4.45593 10.3443C4.40093 10.4213 4.32992 10.5273 4.24792 10.6593C3.90492 11.1933 3.44493 12.1693 3.15393 13.1173C3.01893 13.5363 2.87991 14.0343 2.79391 14.5253C2.66591 15.2253 2.65594 15.9053 2.71994 16.2373C2.82794 16.8193 2.95593 17.4833 3.14093 18.0553C3.31293 18.6003 3.52991 19.0583 3.70791 19.2823C3.81591 19.4183 3.90394 19.5473 3.99594 19.6913C4.09394 19.8413 4.19191 20.0073 4.31091 20.2033C4.47891 20.4803 4.68592 20.8163 5.00192 21.2493C5.36492 21.7463 5.61793 22.1043 5.83493 22.4023C6.14493 22.8243 6.38591 23.1343 6.83691 23.5033C7.33891 23.9113 7.86593 24.3113 8.26693 24.6393C8.44893 24.7883 8.66993 24.9443 8.90493 25.0963C9.21593 25.2963 9.55192 25.4893 9.85592 25.6703C10.1059 25.8203 10.3059 25.9633 10.4869 26.0863C10.5429 26.1243 10.5979 26.1603 10.6519 26.1943C10.8699 26.2803 11.0929 26.3593 11.3159 26.4283C11.3539 26.4323 11.3949 26.4353 11.4369 26.4393C11.6509 26.4573 11.9089 26.4733 12.2209 26.5133C12.7169 26.5753 13.1399 26.6603 13.6019 26.7243C13.9589 26.7733 14.3409 26.8083 14.7729 26.7893C15.0729 26.7753 15.4069 26.7353 15.7389 26.6813C16.2349 26.6023 16.7179 26.4943 17.0569 26.4473C17.1499 26.4343 17.2359 26.4343 17.3209 26.4373C17.3489 26.4393 17.3799 26.4413 17.4109 26.4433C17.4119 26.4433 17.4119 26.4433 17.4129 26.4433C17.4199 26.4433 17.4279 26.4443 17.4349 26.4443C18.2329 26.2413 19.0259 25.9433 19.7959 25.5983C19.8609 25.5633 19.9259 25.5273 19.9899 25.4913C20.3059 25.3173 20.6049 25.1383 20.7869 24.9943C20.9829 24.8393 21.5189 24.5373 22.0579 24.1853C22.4109 23.9553 22.7649 23.7053 23.0369 23.4833C23.1949 23.3553 23.3689 23.2693 23.5479 23.1773C23.7129 23.0923 23.8809 23.0013 24.0349 22.8653C24.1109 22.7983 24.1869 22.7173 24.2639 22.6303C24.3309 22.5563 24.4039 22.4723 24.4759 22.3923C24.5459 22.3153 24.7199 22.1723 24.9139 21.9793C25.0079 21.8863 25.1059 21.7783 25.1909 21.6713C25.2199 21.6323 25.2489 21.5943 25.2769 21.5553C25.5919 21.0403 25.8779 20.5003 26.1019 19.9653C26.1299 19.8403 26.1379 19.7293 26.1279 19.6373C26.1199 19.5703 26.1029 19.5113 26.0839 19.4503C26.0599 19.3643 26.0329 19.2773 26.0239 19.1723C26.0169 19.0893 26.0309 19.0043 26.0629 18.9543C26.0779 18.9323 26.0969 18.9143 26.1129 18.8993C26.1329 18.8823 26.1499 18.8673 26.1569 18.8443C26.1609 18.8273 26.1579 18.8073 26.1529 18.7833C26.1459 18.7443 26.1369 18.6943 26.1539 18.6293C26.2189 18.3853 26.2869 18.1103 26.3319 17.8383C26.3829 17.5393 26.4049 17.2433 26.3949 17.0123C26.3849 16.7493 26.3909 16.3823 26.3469 16.0003C26.3179 15.7343 26.2659 15.4663 26.1979 15.2383C26.1319 15.0143 26.0219 14.7913 25.9039 14.5783C25.7629 14.3223 25.6119 14.0783 25.5169 13.8453C25.4969 13.7983 25.4999 13.7263 25.4999 13.6323C25.5009 13.5673 25.4999 13.4913 25.4919 13.4083C25.3239 13.1243 25.1459 12.8423 24.9589 12.5483C24.9479 12.5413 24.9369 12.5333 24.9249 12.5263C24.6689 12.3503 24.3139 12.1173 24.0769 11.5503C24.0179 11.4063 24.0069 11.2983 23.9969 11.1993C23.9859 11.1013 23.9799 11.0183 23.9289 10.9093C23.8709 10.7853 23.7759 10.6583 23.6709 10.4993C23.5849 10.3703 23.4899 10.2133 23.4199 10.0423C23.3819 9.95134 23.3509 9.85734 23.3329 9.75934C23.3299 9.74334 23.3269 9.72534 23.3229 9.70634C23.2899 9.52734 23.2439 9.26534 23.2409 8.98634C23.0209 8.24434 22.8339 7.48833 22.6519 6.77633C22.3429 5.57133 22.0519 4.54234 21.3329 3.95434C20.9839 3.65334 20.5689 3.35433 20.2459 3.05433C19.9259 2.75633 19.7449 2.47534 19.8019 2.23834C19.8639 2.00634 20.1589 1.82934 20.6659 1.80534C21.1699 1.78334 21.8699 1.93235 22.5209 2.39235C23.6159 3.14235 24.2029 4.38334 24.5599 5.35734C24.5829 5.40834 24.6049 5.46034 24.6259 5.51234C24.7849 5.89434 24.9529 6.22834 25.1199 6.55534C25.1579 6.63034 25.1969 6.70834 25.2339 6.78134Z`,className:`ok-blob-body`}),t[21]=U):U=t[21];let W=(F||T)&&`ok-blob-eye-hidden`,G;t[22]===W?G=t[23]:(G=X(`ok-blob-eye`,W),t[22]=W,t[23]=G);let ee;t[24]===G?ee=t[25]:(ee=(0,Z.jsx)(`ellipse`,{cx:Qy,cy:eb,rx:1.2722,ry:1.9083,className:G}),t[24]=G,t[25]=ee);let K=(F||T)&&`ok-blob-eye-hidden`,q;t[26]===K?q=t[27]:(q=X(`ok-blob-eye ok-blob-eye-right`,K),t[26]=K,t[27]=q);let te;t[28]===q?te=t[29]:(te=(0,Z.jsx)(`ellipse`,{cx:$y,cy:eb,rx:1.2722,ry:1.9083,className:q}),t[28]=q,t[29]=te);let ne;t[30]===I?ne=t[31]:(ne=nb(Qy,I),t[30]=I,t[31]=ne);let re=(!F||T)&&`ok-blob-eye-hidden`,ie;t[32]===re?ie=t[33]:(ie=X(`ok-blob-happy-eye`,re),t[32]=re,t[33]=ie);let ae;t[34]!==ne||t[35]!==ie?(ae=(0,Z.jsx)(`path`,{d:ne,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:ie}),t[34]=ne,t[35]=ie,t[36]=ae):ae=t[36];let oe;t[37]===I?oe=t[38]:(oe=nb($y,I),t[37]=I,t[38]=oe);let se=(!F||T)&&`ok-blob-eye-hidden`,ce;t[39]===se?ce=t[40]:(ce=X(`ok-blob-happy-eye`,se),t[39]=se,t[40]=ce);let le;t[41]!==oe||t[42]!==ce?(le=(0,Z.jsx)(`path`,{d:oe,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:ce}),t[41]=oe,t[42]=ce,t[43]=le):le=t[43];let ue;t[44]===T?ue=t[45]:(ue=T?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`path`,{d:rb(Qy),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`}),(0,Z.jsx)(`path`,{d:rb($y),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`})]}):null,t[44]=T,t[45]=ue);let de;t[46]!==ee||t[47]!==te||t[48]!==ae||t[49]!==le||t[50]!==ue?(de=(0,Z.jsxs)(`g`,{ref:p,children:[ee,te,ae,le,ue]}),t[46]=ee,t[47]=te,t[48]=ae,t[49]=le,t[50]=ue,t[51]=de):de=t[51];let fe;t[52]!==B||t[53]!==H||t[54]!==de?(fe=(0,Z.jsxs)(`g`,{className:H,children:[U,de]},B),t[52]=B,t[53]=H,t[54]=de,t[55]=fe):fe=t[55];let pe;t[56]===T?pe=t[57]:(pe=T?(0,Z.jsxs)(`g`,{children:[(0,Z.jsx)(`text`,{x:21,y:7,className:`ok-blob-z ok-blob-z-1`,children:`z`}),(0,Z.jsx)(`text`,{x:26,y:2,className:`ok-blob-z ok-blob-z-2`,children:`z`})]}):null,t[56]=T,t[57]=pe);let me;t[58]!==v||t[59]!==x?(me=x.length>0&&(0,Z.jsx)(`g`,{children:x.map(cb)},`firework-${v}`),t[58]=v,t[59]=x,t[60]=me):me=t[60];let he;t[61]!==D||t[62]!==s||t[63]!==z||t[64]!==fe||t[65]!==pe||t[66]!==me?(he=(0,Z.jsxs)(`svg`,{ref:f,width:s,height:s,viewBox:`0 0 30 30`,fill:`none`,overflow:`visible`,xmlns:`http://www.w3.org/2000/svg`,className:z,"aria-hidden":`true`,onClick:D,onMouseDown:lb,children:[fe,pe,me]}),t[61]=D,t[62]=s,t[63]=z,t[64]=fe,t[65]=pe,t[66]=me,t[67]=he):he=t[67];let ge;return t[68]!==R||t[69]!==he?(ge=(0,Z.jsx)(`span`,{ref:d,className:R,children:he}),t[68]=R,t[69]=he,t[70]=ge):ge=t[70],ge}function cb(e){return(0,Z.jsx)(`circle`,{cx:ib+e.originDx,cy:ab+e.originDy,r:e.size,className:`ok-blob-firework`,style:ob(e)},e.id)}function lb(e){return e.preventDefault()}function ub(e){return e+1}function db(e){return e+1}function fb(e){let t=(0,$.c)(12),{title:n,subtitle:r,celebrateSignal:i}=e,a;t[0]===i?a=t[1]:(a=(0,Z.jsx)(sb,{size:64,celebrateSignal:i}),t[0]=i,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,Z.jsx)(`h2`,{className:`text-2xl font-light tracking-tighter text-balance`,children:n}),t[2]=n,t[3]=o);let s;t[4]===r?s=t[5]:(s=r?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r}):null,t[4]=r,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,Z.jsxs)(`div`,{className:`flex items-center gap-4`,children:[a,c]}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}function pb(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`kbd`,{"data-slot":`kbd`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function mb(){let e=(0,$.c)(2),t=Jn()?`⌘ K`:`Ctrl K`,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(pb,{children:t}),e[0]=n):n=e[0];let r;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[n,` `,(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`A1taO8`})})]}),e[1]=r):r=e[1],r}var hb=`open-knowledge:create-top-level-file`;function gb(){window.dispatchEvent(new CustomEvent(hb))}function _b(e){let t=()=>e();return window.addEventListener(hb,t),()=>window.removeEventListener(hb,t)}function vb(){let e=(0,$.c)(14),[t,n]=(0,Q.useState)(!1),[r,i]=(0,Q.useState)(void 0),[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(0),l=(0,Q.useRef)(!1),u=(0,Q.useRef)(void 0),d,f;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{let e=!1,t=async function(){try{let t=await fetch(`/api/documents`),n=await t.json().catch(Sb);if(e)return;let r=t.ok?Mn.safeParse(n):null;r?.success?(o(Cb(r.data.documents)),l.current=!0):l.current||=(o(1),!0)}catch{!e&&!l.current&&(o(1),l.current=!0)}};t();let n=_i(e=>{e.includes(`files`)&&t()});return()=>{e=!0,n(),clearTimeout(u.current)}},f=[],e[0]=d,e[1]=f):(d=e[0],f=e[1]),(0,Q.useEffect)(d,f);let p;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=function(){clearTimeout(u.current),u.current=setTimeout(()=>c(xb),500),fetch(`/api/documents`).then(async e=>{let t=await e.json().catch(bb);if(!e.ok)return;let n=Mn.safeParse(t);n.success&&o(Cb(n.data.documents))}).catch(yb)},e[2]=p):p=e[2];let m=p,h=a!==null,g=a===0,_;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(_=function(e){n(e),e||i(void 0)},e[3]=_):_=e[3];let v=_,y;e[4]!==s||e[5]!==g||e[6]!==h?(y=h?g?(0,Z.jsx)(wb,{celebrateSignal:s,onPackSelect:e=>{i(e),n(!0)}}):(0,Z.jsx)(Tb,{celebrateSignal:s,onAddStarterPack:()=>{n(!0)}}):null,e[4]=s,e[5]=g,e[6]=h,e[7]=y):y=e[7];let b;e[8]!==r||e[9]!==t?(b=(0,Z.jsx)(dm,{open:t,onOpenChange:v,onSeedApplied:m,initialPackId:r}),e[8]=r,e[9]=t,e[10]=b):b=e[10];let x;return e[11]!==y||e[12]!==b?(x=(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center overflow-y-auto px-6 subtle-scrollbar`,children:[y,b]}),e[11]=y,e[12]=b,e[13]=x):x=e[13],x}function yb(){}function bb(){return null}function xb(e){return e+1}function Sb(){return null}function Cb(e){return ui(e).filter(e=>e.kind===`document`||e.kind===`folder`).length}function wb(e){let t=(0,$.c)(16),{celebrateSignal:n,onPackSelect:r}=e,{_:a}=i(),o;t[0]===a?o=t[1]:(o=a({id:`ZmGmNh`}),t[0]=a,t[1]=o);let c;t[2]===a?c=t[3]:(c=a({id:`W8uemY`}),t[2]=a,t[3]=c);let l;t[4]!==n||t[5]!==o||t[6]!==c?(l=(0,Z.jsx)(fb,{title:o,subtitle:c,celebrateSignal:n}),t[4]=n,t[5]=o,t[6]=c,t[7]=l):l=t[7];let u;t[8]===r?u=t[9]:(u=(0,Z.jsx)(im,{onPackSelect:r}),t[8]=r,t[9]=u);let d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(Di,{variant:`link`,className:`text-muted-foreground font-normal justify-end`,size:`sm`,onClick:gb,children:(0,Z.jsx)(s,{id:`ensWZc`,components:{0:(0,Z.jsx)(Ji,{"aria-hidden":`true`,className:`size-3`})}})}),t[10]=d):d=t[10];let f;t[11]===u?f=t[12]:(f=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-3`,children:[u,d]}),t[11]=u,t[12]=f);let p;return t[13]!==l||t[14]!==f?(p=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-10 py-12 max-w-5xl my-auto`,children:[l,f]}),t[13]=l,t[14]=f,t[15]=p):p=t[15],p}function Tb(e){let t=(0,$.c)(19),{celebrateSignal:n,onAddStarterPack:r}=e,{_:a}=i(),o;t[0]===a?o=t[1]:(o=a({id:`8XS8nG`}),t[0]=a,t[1]=o);let c;t[2]===a?c=t[3]:(c=a({id:`GjElCU`}),t[2]=a,t[3]=c);let l;t[4]!==n||t[5]!==o||t[6]!==c?(l=(0,Z.jsx)(fb,{title:o,subtitle:c,celebrateSignal:n}),t[4]=n,t[5]=o,t[6]=c,t[7]=l):l=t[7];let u;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(Iy,{}),t[8]=u):u=t[8];let d,f;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(ne,{"aria-hidden":`true`,className:`size-3`}),f=(0,Z.jsx)(s,{id:`IajAbS`}),t[9]=d,t[10]=f):(d=t[9],f=t[10]);let p;t[11]===r?p=t[12]:(p=(0,Z.jsxs)(Di,{onClick:r,variant:`link`,size:`xs`,className:`font-mono text-2xs uppercase tracking-wider text-muted-foreground font-normal hover:text-foreground hover:no-underline`,children:[d,f]}),t[11]=r,t[12]=p);let m;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(mb,{}),t[13]=m):m=t[13];let h;t[14]===p?h=t[15]:(h=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-4`,children:[u,(0,Z.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-4`,children:[p,m]})]}),t[14]=p,t[15]=h);let g;return t[16]!==l||t[17]!==h?(g=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-10 py-12 max-w-5xl my-auto`,children:[l,h]}),t[16]=l,t[17]=h,t[18]=g):g=t[18],g}function Eb(e){let t=(0,$.c)(76),{folderPath:n,state:r,onChange:a}=e,{_:o}=i(),[c,l]=(0,Q.useState)(!1),[u,d]=(0,Q.useState)(null),[f,p]=(0,Q.useState)(null);if(r.status===`idle`||r.status===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card p-4 space-y-3`,children:[(0,Z.jsx)(Ob,{}),(0,Z.jsx)(Wa,{className:`h-7 w-full`}),(0,Z.jsx)(Wa,{className:`h-7 w-full`}),(0,Z.jsx)(Wa,{className:`h-7 w-full`})]}),t[0]=e):e=t[0],e}if(r.status===`error`){let{message:e}=r,n;return t[1]===e?n=t[2]:(n=(0,Z.jsx)(`section`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,children:(0,Z.jsx)(s,{id:`4UMKtb`,values:{message:e}})}),t[1]=e,t[2]=n),n}let m;t[3]===r.data.folder.frontmatter_defaults?m=t[4]:(m=r.data.folder.frontmatter_defaults??{},t[3]=r.data.folder.frontmatter_defaults,t[4]=m);let h=m,g;t[5]===r.data.frontmatterLocal?g=t[6]:(g=r.data.frontmatterLocal??{},t[5]=r.data.frontmatterLocal,t[6]=g);let _=g,v=r.data.frontmatterSources,y;t[7]===r.data.folder.path?y=t[8]:(y=_o(r.data.folder.path),t[7]=r.data.folder.path,t[8]=y);let b=y,x,S,C,w,T,E,D,O,k,A,j,M,N;if(t[9]!==o||t[10]!==u||t[11]!==c||t[12]!==b||t[13]!==n||t[14]!==_||t[15]!==h||t[16]!==a||t[17]!==f||t[18]!==v){let e=Object.keys(h),r=async function(e,t){let r=await Yi(n,{[e]:t});if(!r.ok){let{error:e}=r;Uo.error(o({id:`xXo8FT`,values:{error:e}}));return}a()},i=async function(e){let t=await Yi(n,{[e]:null});if(!t.ok){let{error:e}=t;Uo.error(o({id:`ZU8VV_`,values:{error:e}}));return}a()},m=function(e,t){let n=h[e];r(e,ma(n,t))},g;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(g=function(){d({name:``,type:`text`,value:``,error:null}),l(!1)},t[32]=g):g=t[32],C=g;let y;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(y=function(e){d(t=>{if(!t)return t;let n=e===`date`?new Date().toISOString().slice(0,10):Zi[e];return{...t,type:e,value:n,error:null}})},t[33]=y):y=t[33],T=y;let P;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(P=function(e){d(t=>t&&{...t,value:e})},t[34]=P):P=t[34],E=P;let F;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(F=function(e){d(t=>t&&{...t,name:e,error:null})},t[35]=F):F=t[35],w=F;let I;t[36]!==o||t[37]!==u||t[38]!==n||t[39]!==h||t[40]!==a?(I=async function(){if(!u)return;let e=u.name.trim();if(!e){d({...u,error:o({id:`8_brI5`})});return}if(Object.hasOwn(h,e)){d({...u,error:o({id:`6lBXm5`,values:{trimmed:e}})});return}let t=await Yi(n,{[e]:u.value});if(!t.ok){d({...u,error:t.error});return}d(null),a()},t[36]=o,t[37]=u,t[38]=n,t[39]=h,t[40]=a,t[41]=I):I=t[41],D=I;let L=function(e){p({key:e,draft:e,error:null})},R=function(e){p(t=>t&&{...t,draft:e,error:null})},z=async function(){if(!f)return;let e=f.draft.trim();if(!e){p({...f,error:o({id:`8_brI5`})});return}if(e===f.key){p(null);return}if(Object.hasOwn(h,e)){p({...f,error:o({id:`6lBXm5`,values:{trimmed:e}})});return}let t=h[f.key],r=await Yi(n,{[f.key]:null,[e]:t});if(!r.ok){p({...f,error:r.error});return}p(null),a()},B=function(){p(null)};N=`rounded-lg border bg-card`,S=Jo,A=!c,t[42]===Symbol.for(`react.memo_cache_sentinel`)?(j=e=>l(!e),t[42]=j):j=t[42];let V=`size-3 transition-transform ${c?``:`rotate-90`}`,H;t[43]===V?H=t[44]:(H=(0,Z.jsx)(Wo,{className:V,"aria-hidden":!0}),t[43]=V,t[44]=H);let U;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`IX_qeH`})}),t[45]=U):U=t[45];let W;t[46]===H?W=t[47]:(W=(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:[H,U]}),t[46]=H,t[47]=W);let G;t[48]===b?G=t[49]:(G=(0,Z.jsx)(`code`,{className:`text-xs text-muted-foreground font-mono cursor-text select-text`,onClick:Db,children:b}),t[48]=b,t[49]=G),t[50]!==W||t[51]!==G?(M=(0,Z.jsxs)(qo,{className:`flex w-full cursor-pointer items-center justify-between gap-2 px-3 py-2.5 data-[state=open]:border-b border-border`,children:[W,G]}),t[50]=W,t[51]=G,t[52]=M):M=t[52],x=Ko,O=`px-2 py-2`,k=e.length===0&&!u?(0,Z.jsx)(`p`,{className:`px-1 py-1 text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`50Y3WA`})}):e.map(e=>{let t=h[e],n=Object.hasOwn(_,e);return(0,Z.jsx)(Ca,{keyName:e,value:t,declared:Ja(t,ri(t)),rename:n?{state:f?.key===e?f:null,onBegin:()=>L(e),onChangeDraft:R,onCommit:z,onCancel:B}:void 0,badge:n?null:(0,Z.jsx)($i,{source:v[e]??``}),isInherited:!n,onCommit:t=>void r(e,t),onChangeType:t=>m(e,t),onRemove:n?()=>void i(e):void 0},e)}),t[9]=o,t[10]=u,t[11]=c,t[12]=b,t[13]=n,t[14]=_,t[15]=h,t[16]=a,t[17]=f,t[18]=v,t[19]=x,t[20]=S,t[21]=C,t[22]=w,t[23]=T,t[24]=E,t[25]=D,t[26]=O,t[27]=k,t[28]=A,t[29]=j,t[30]=M,t[31]=N}else x=t[19],S=t[20],C=t[21],w=t[22],T=t[23],E=t[24],D=t[25],O=t[26],k=t[27],A=t[28],j=t[29],M=t[30],N=t[31];let P;t[53]!==u||t[54]!==C||t[55]!==w||t[56]!==T||t[57]!==E||t[58]!==D?(P=u?(0,Z.jsx)(ho,{draft:u,onChangeName:w,onChangeType:T,onChangeValue:E,onCommit:()=>void D(),onCancel:()=>d(null)}):(0,Z.jsxs)(Di,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`add-property-trigger`,onClick:C,className:`mt-1 flex items-center gap-1.5 rounded px-2 py-1 font-medium text-sm hover:bg-muted/50 hover:text-foreground`,children:[(0,Z.jsx)(ne,{className:`size-3.5`}),(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`F-NRCj`})})]}),t[53]=u,t[54]=C,t[55]=w,t[56]=T,t[57]=E,t[58]=D,t[59]=P):P=t[59];let F;t[60]!==P||t[61]!==O||t[62]!==k?(F=(0,Z.jsxs)(`div`,{className:O,children:[k,P]}),t[60]=P,t[61]=O,t[62]=k,t[63]=F):F=t[63];let I;t[64]!==x||t[65]!==F?(I=(0,Z.jsx)(x,{children:F}),t[64]=x,t[65]=F,t[66]=I):I=t[66];let L;t[67]!==S||t[68]!==I||t[69]!==A||t[70]!==j||t[71]!==M?(L=(0,Z.jsxs)(S,{open:A,onOpenChange:j,children:[M,I]}),t[67]=S,t[68]=I,t[69]=A,t[70]=j,t[71]=M,t[72]=L):L=t[72];let R;return t[73]!==L||t[74]!==N?(R=(0,Z.jsx)(`section`,{className:N,children:L}),t[73]=L,t[74]=N,t[75]=R):R=t[75],R}function Db(e){return e.stopPropagation()}function Ob(){let e=(0,$.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(hc,{className:`size-4 text-muted-foreground`,"aria-hidden":!0}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t,(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(s,{id:`IX_qeH`})})]}),e[1]=n):n=e[1],n}function kb(e){let t=e.split(`/`).pop();return t?`${e}/${t}`:null}function Ab(e,t){let n=t.get(`${e}/index`);if(n)return n;let r=kb(e);if(r){let e=t.get(r);if(e)return e}return e.split(`/`).pop()??e}function jb(e,t,n){let r=n.get(e);return r&&r!==e?r:t}function Mb(e,t){let n=`${e}/`,r=[...t.folderPaths].filter(e=>e.startsWith(n)).map(e=>({path:e,rel:e.slice(n.length)})).filter(e=>e.rel.length>0&&!e.rel.includes(`/`)).map(({path:e,rel:n})=>({kind:`folder`,path:e,name:n,title:Ab(e,t.pageTitles)})),i=[...t.pages].filter(e=>e.startsWith(n)).map(e=>({docName:e,rel:e.slice(n.length)})).filter(e=>e.rel.length>0&&!e.rel.includes(`/`)).map(({docName:e,rel:n})=>{let r=t.pageMeta.get(e);return{kind:`file`,path:e,name:n,title:jb(e,n,t.pageTitles),size:r?.size??0,modified:r?.modified??``}}),a=[...r,...i].sort((e,t)=>e.kind===t.kind?e.title.localeCompare(t.title)||e.name.localeCompare(t.name):e.kind===`folder`?-1:1);return{title:Ab(e,t.pageTitles),children:a}}function Nb(e){let t=(0,$.c)(54),{folderPath:n,state:r,onChange:a,folderConfigHandle:o}=e,{_:c}=i(),[l,u]=(0,Q.useState)(null),[d,f]=(0,Q.useState)(null),[p,m]=(0,Q.useState)(null),[h,g]=(0,Q.useState)(!1),[_,v]=(0,Q.useState)(!1),y;t[0]!==c||t[1]!==a?(y=async function(e){g(!0);let t=await xa(e.source_folder,e.name);if(g(!1),!t.ok){let{error:e}=t;Uo.error(c({id:`yOGrCR`,values:{error:e}}));return}let{name:n}=e;Uo.success(c({id:`I23A-U`,values:{name:n}})),f(null),a()},t[0]=c,t[1]=a,t[2]=y):y=t[2];let b=y;if(r.status===`idle`||r.status===`loading`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card px-3 py-2.5 space-y-3`,children:[(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(s,{id:`-QCLWk`})})}),(0,Z.jsx)(Wa,{className:`h-12 w-full`}),(0,Z.jsx)(Wa,{className:`h-12 w-full`})]}),t[3]=e):e=t[3],e}if(r.status===`error`){let{message:e}=r,n;return t[4]===e?n=t[5]:(n=(0,Z.jsx)(`section`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,children:(0,Z.jsx)(s,{id:`iDZtvM`,values:{message:e}})}),t[4]=e,t[5]=n),n}let x;t[6]===r.data.folder.templates_available?x=t[7]:(x=r.data.folder.templates_available??[],t[6]=r.data.folder.templates_available,t[7]=x);let S=x,C;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(s,{id:`-QCLWk`})}),t[8]=C):C=t[8];let w;t[9]===S.length?w=t[10]:(w=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[C,(0,Z.jsx)(fe,{className:`text-xs`,variant:`secondary`,children:S.length})]}),t[9]=S.length,t[10]=w);let T;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Z.jsxs)(Di,{variant:`ghost`,className:`font-mono uppercase`,size:`sm`,onClick:()=>v(!0),children:[(0,Z.jsx)(ne,{className:`size-3.5`,"aria-hidden":!0}),(0,Z.jsx)(s,{id:`G1Gw0v`})]}),t[11]=T):T=t[11];let E;t[12]===w?E=t[13]:(E=(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-1`,children:[w,T]}),t[12]=w,t[13]=E);let D;t[14]===S?D=t[15]:(D=(0,Z.jsx)(`div`,{className:`px-3 py-2.5`,children:S.length===0?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`BHW0EW`})}):(0,Z.jsx)(`ul`,{className:`space-y-1`,children:S.map(e=>(0,Z.jsx)(Fb,{template:e,onCreate:()=>m(e.name),onEdit:()=>u(e),onDelete:()=>f(e)},e.path))})}),t[14]=S,t[15]=D);let O;t[16]!==E||t[17]!==D?(O=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card`,children:[E,D]}),t[16]=E,t[17]=D,t[18]=O):O=t[18];let k;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(k=e=>{e||u(null)},t[19]=k):k=t[19];let A;t[20]!==l||t[21]!==n||t[22]!==a?(A=(0,Z.jsx)(po,{folderPath:n,template:l,onOpenChange:k,onSaved:a}),t[20]=l,t[21]=n,t[22]=a,t[23]=A):A=t[23];let j=!!d,M;t[24]===h?M=t[25]:(M=e=>{!e&&!h&&f(null)},t[24]=h,t[25]=M);let N;t[26]!==c||t[27]!==d||t[28]!==h||t[29]!==b?(N=d&&(()=>{let{name:e,path:t,scope:n}=d,r=n===`inherited`?`\n\n${c({id:`LUbzI-`})}`:``;return(0,Z.jsx)(Fa,{itemName:c({id:`XfzqjK`,values:{name:e}}),isSubmitting:h,onDelete:()=>b(d),customDescription:`${c({id:`JVgg1-`,values:{path:t}})}${r}`})})(),t[26]=c,t[27]=d,t[28]=h,t[29]=b,t[30]=N):N=t[30];let P;t[31]!==j||t[32]!==M||t[33]!==N?(P=(0,Z.jsx)(Vo,{open:j,onOpenChange:M,children:N}),t[31]=j,t[32]=M,t[33]=N,t[34]=P):P=t[34];let F;t[35]===S?F=t[36]:(F=new Set(S.map(Pb)),t[35]=S,t[36]=F);let I;t[37]!==n||t[38]!==_||t[39]!==a||t[40]!==F?(I=(0,Z.jsx)(yo,{folderPath:n,existingNames:F,open:_,onOpenChange:v,onCreated:a}),t[37]=n,t[38]=_,t[39]=a,t[40]=F,t[41]=I):I=t[41];let L=p!==null,R;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>{e||m(null)},t[42]=R):R=t[42];let z=p??void 0,B;t[43]!==o||t[44]!==n||t[45]!==L||t[46]!==z?(B=(0,Z.jsx)(Vp,{open:L,onOpenChange:R,kind:`file`,initialDir:n,initialTemplate:z,folderConfig:o}),t[43]=o,t[44]=n,t[45]=L,t[46]=z,t[47]=B):B=t[47];let V;return t[48]!==A||t[49]!==P||t[50]!==I||t[51]!==B||t[52]!==O?(V=(0,Z.jsxs)(Z.Fragment,{children:[O,A,P,I,B]}),t[48]=A,t[49]=P,t[50]=I,t[51]=B,t[52]=O,t[53]=V):V=t[53],V}function Pb(e){return e.name}function Fb(e){let t=(0,$.c)(51),{template:n,onCreate:r,onEdit:a,onDelete:o}=e,{_:c}=i(),l=n.title&&n.title!==n.name,u=n.title??n.name,d;t[0]===u?d=t[1]:(d=(0,Z.jsx)(`span`,{className:`font-medium truncate`,children:u}),t[0]=u,t[1]=d);let f;t[2]!==l||t[3]!==n.name?(f=l?(0,Z.jsx)(`code`,{className:`font-mono text-xs text-muted-foreground shrink-0`,children:n.name}):null,t[2]=l,t[3]=n.name,t[4]=f):f=t[4];let p;t[5]!==n.name||t[6]!==n.scope||t[7]!==n.source_folder?(p=n.scope===`inherited`?(0,Z.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,Z.jsx)($i,{source:n.source_folder,target:`templates/${n.name}.md`})}):null,t[5]=n.name,t[6]=n.scope,t[7]=n.source_folder,t[8]=p):p=t[8];let m;t[9]!==d||t[10]!==f||t[11]!==p?(m=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[d,f,p]}),t[9]=d,t[10]=f,t[11]=p,t[12]=m):m=t[12];let h;t[13]===n.description?h=t[14]:(h=n.description?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground truncate mt-0.5`,children:n.description}):null,t[13]=n.description,t[14]=h);let g;t[15]!==a||t[16]!==m||t[17]!==h?(g=(0,Z.jsxs)(`button`,{type:`button`,onClick:a,className:`min-w-0 flex-1 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm`,children:[m,h]}),t[15]=a,t[16]=m,t[17]=h,t[18]=g):g=t[18];let _;t[19]!==c||t[20]!==u?(_=c({id:`5m2Eho`,values:{label:u}}),t[19]=c,t[20]=u,t[21]=_):_=t[21];let v,y;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(fc,{className:`size-3.5`,"aria-hidden":!0}),y=(0,Z.jsx)(s,{id:`hYgDIe`}),t[22]=v,t[23]=y):(v=t[22],y=t[23]);let b;t[24]!==r||t[25]!==_?(b=(0,Z.jsxs)(Di,{type:`button`,variant:`ghost`,size:`sm`,className:`font-mono uppercase shrink-0 opacity-0 group-hover:opacity-100 focus-visible:opacity-100`,onClick:r,"aria-label":_,children:[v,y]}),t[24]=r,t[25]=_,t[26]=b):b=t[26];let x;t[27]!==c||t[28]!==u?(x=c({id:`Bx4EXG`,values:{label:u}}),t[27]=c,t[28]=u,t[29]=x):x=t[29];let S;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(ba,{className:`size-4`,"aria-hidden":!0}),t[30]=S):S=t[30];let C;t[31]===x?C=t[32]:(C=(0,Z.jsx)(va,{asChild:!0,children:(0,Z.jsx)(Di,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0 opacity-0 group-hover:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100`,"aria-label":x,children:S})}),t[31]=x,t[32]=C);let w,E;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(T,{"aria-hidden":!0}),E=(0,Z.jsx)(s,{id:`ePK91l`}),t[33]=w,t[34]=E):(w=t[33],E=t[34]);let D;t[35]===a?D=t[36]:(D=(0,Z.jsxs)(ca,{onSelect:a,children:[w,E]}),t[35]=a,t[36]=D);let O,k;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsx)(K,{"aria-hidden":!0}),k=(0,Z.jsx)(s,{id:`cnGeoo`}),t[37]=O,t[38]=k):(O=t[37],k=t[38]);let A;t[39]===o?A=t[40]:(A=(0,Z.jsxs)(ca,{variant:`destructive`,onSelect:o,children:[O,k]}),t[39]=o,t[40]=A);let j;t[41]!==D||t[42]!==A?(j=(0,Z.jsxs)(ra,{align:`end`,children:[D,A]}),t[41]=D,t[42]=A,t[43]=j):j=t[43];let M;t[44]!==C||t[45]!==j?(M=(0,Z.jsxs)(Ta,{children:[C,j]}),t[44]=C,t[45]=j,t[46]=M):M=t[46];let N;return t[47]!==b||t[48]!==M||t[49]!==g?(N=(0,Z.jsxs)(`li`,{className:`group flex items-center gap-2 rounded-md px-2 py-2 hover:bg-muted/50 text-sm`,children:[g,b,M]}),t[47]=b,t[48]=M,t[49]=g,t[50]=N):N=t[50],N}function Ib(e){let t=(0,$.c)(14),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,containerClassName:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=X(`relative w-full overflow-x-auto subtle-scrollbar`,r),t[4]=r,t[5]=a);let o;t[6]===n?o=t[7]:(o=X(`w-full caption-bottom text-sm`,n),t[6]=n,t[7]=o);let s;t[8]!==i||t[9]!==o?(s=(0,Z.jsx)(`table`,{"data-slot":`table`,className:o,...i}),t[8]=i,t[9]=o,t[10]=s):s=t[10];let c;return t[11]!==a||t[12]!==s?(c=(0,Z.jsx)(`div`,{"data-slot":`table-container`,className:a,children:s}),t[11]=a,t[12]=s,t[13]=c):c=t[13],c}function Lb(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`[&_tr]:border-b`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`thead`,{"data-slot":`table-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Rb(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`[&_tr:last-child]:border-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`tbody`,{"data-slot":`table-body`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function zb(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,noHover:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=(i===void 0?!1:i)&&`hover:bg-transparent`,o;t[4]!==n||t[5]!==a?(o=X(`hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors`,a,n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==o?(s=(0,Z.jsx)(`tr`,{"data-slot":`table-row`,className:o,...r}),t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function Bb(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,scope:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`col`:i,o;t[4]===n?o=t[5]:(o=X(`font-mono uppercase text-xs text-muted-foreground h-10 px-4 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==a||t[8]!==o?(s=(0,Z.jsx)(`th`,{"data-slot":`table-head`,scope:a,className:o,...r}),t[6]=r,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function Vb(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`py-3 px-4 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`td`,{"data-slot":`table-cell`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Hb(e){if(!e)return`—`;let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/6e4);if(r<1)return Y._({id:`xOTzt5`});if(r<60)return Y._({id:`NRSLBe`,values:{diffMin:r}});let i=Math.floor(r/60);if(i<24)return Y._({id:`hDKtoF`,values:{diffHrs:i}});let a=Math.floor(i/24);return a<30?Y._({id:`QDZbvN`,values:{diffDays:a}}):t.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function Ub(e,t,n){return[...e].sort((e,r)=>{if(e.kind!==r.kind)return e.kind===`folder`?-1:1;let i=0;switch(t){case`name`:i=e.title.localeCompare(r.title)||e.name.localeCompare(r.name);break;case`modified`:{let t=e.kind===`file`?e.modified:``,n=r.kind===`file`?r.modified:``;i=t.localeCompare(n);break}}return n===`asc`?i:-i})}function Wb(e){let t=(0,$.c)(10),{label:n,sortKey:r,activeKey:i,activeDir:a,onSort:o}=e,s=i===r,c;t[0]!==o||t[1]!==r?(c=()=>o(r),t[0]=o,t[1]=r,t[2]=c):c=t[2];let l;t[3]!==a||t[4]!==s?(l=s?a===`asc`?(0,Z.jsx)(Nt,{className:`ml-1 size-3`}):(0,Z.jsx)(Ve,{className:`ml-1 size-3`}):(0,Z.jsx)(Ws,{className:`ml-1 size-3 text-muted-foreground/50`}),t[3]=a,t[4]=s,t[5]=l):l=t[5];let u;return t[6]!==n||t[7]!==c||t[8]!==l?(u=(0,Z.jsxs)(Di,{variant:`ghost`,size:`sm`,className:`-ml-3 h-8 uppercase font-mono`,onClick:c,children:[n,l]}),t[6]=n,t[7]=c,t[8]=l,t[9]=u):u=t[9],u}function Gb(e){let t=(0,$.c)(92),{folderPath:n}=e,{_:r}=i(),{folderPaths:a,loading:o,pages:c,pageTitles:l,pageMeta:u}=oi(),d=Qa(n),{state:f,refresh:p}=d,[m,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(`name`),[v,y]=(0,Q.useState)(`asc`);if(o){let e;t[0]===r?e=t[1]:(e=r({id:`X9VpsP`}),t[0]=r,t[1]=e);let n;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Wa,{className:`size-5 rounded`}),(0,Z.jsx)(Wa,{className:`h-7 w-48`})]}),(0,Z.jsx)(Wa,{className:`h-9 w-20 rounded-md`})]}),t[2]=n):n=t[2];let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(Wa,{className:`h-4 w-16`}),t[3]=i):i=t[3];let a;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsxs)(`div`,{className:`mx-auto flex w-full max-w-4xl flex-col gap-6 px-6 py-8`,children:[n,(0,Z.jsxs)(`div`,{className:`rounded-lg border`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-4 border-b px-4 py-3`,children:[i,(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsx)(Wa,{className:`h-4 w-20`})})]}),[`a`,`b`,`c`,`d`].map(Jb)]})]}),t[4]=a):a=t[4];let o;return t[5]===e?o=t[6]:(o=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-start overflow-y-auto subtle-scrollbar`,role:`status`,"aria-busy":`true`,"aria-label":e,children:a}),t[5]=e,t[6]=o),o}let b,x,S,C,w,T,E,D,O,k;if(t[7]!==r||t[8]!==f||t[9]!==d||t[10]!==n||t[11]!==a||t[12]!==u||t[13]!==l||t[14]!==c||t[15]!==p||t[16]!==v||t[17]!==g){let e=Mb(n,{pages:c,pageTitles:l,pageMeta:u,folderPaths:a}),i=Ub(e.children,g,v),o;t[28]===g?o=t[29]:(o=function(e){e===g?y(qb):(_(e),y(`asc`))},t[28]=g,t[29]=o);let m=o;k=`flex min-h-0 flex-1 items-start overflow-y-auto subtle-scrollbar`,T=`mx-auto flex w-full max-w-4xl flex-col gap-6 px-6 py-8`;let A;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Z.jsx)(we,{className:`size-5 text-muted-foreground`}),t[30]=A):A=t[30];let j=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[A,(0,Z.jsx)(`h1`,{className:`text-2xl font-light tracking-tight`,children:e.title})]}),M;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Z.jsxs)(Di,{onClick:()=>h(!0),children:[(0,Z.jsx)(ne,{className:`size-4`}),(0,Z.jsx)(s,{id:`isRobC`})]}),t[31]=M):M=t[31],t[32]===j?E=t[33]:(E=(0,Z.jsx)(`div`,{className:`flex flex-col gap-6`,children:(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[j,M]})}),t[32]=j,t[33]=E),t[34]!==f||t[35]!==n||t[36]!==p?(D=(0,Z.jsx)(Eb,{folderPath:n,state:f,onChange:p}),t[34]=f,t[35]=n,t[36]=p,t[37]=D):D=t[37],t[38]!==f||t[39]!==d||t[40]!==n||t[41]!==p?(O=(0,Z.jsx)(Nb,{folderPath:n,state:f,onChange:p,folderConfigHandle:d}),t[38]=f,t[39]=d,t[40]=n,t[41]=p,t[42]=O):O=t[42],w=`rounded-lg border`,x=Ib;let N=g===`name`?v===`asc`?`ascending`:`descending`:`none`,P;t[43]===r?P=t[44]:(P=r({id:`6YtxFj`}),t[43]=r,t[44]=P);let F;t[45]!==m||t[46]!==v||t[47]!==g||t[48]!==P?(F=(0,Z.jsx)(Wb,{label:P,sortKey:`name`,activeKey:g,activeDir:v,onSort:m}),t[45]=m,t[46]=v,t[47]=g,t[48]=P,t[49]=F):F=t[49];let I;t[50]!==N||t[51]!==F?(I=(0,Z.jsx)(Bb,{"aria-sort":N,children:F}),t[50]=N,t[51]=F,t[52]=I):I=t[52];let L=g===`modified`?v===`asc`?`ascending`:`descending`:`none`,R;t[53]===r?R=t[54]:(R=r({id:`tgWuMB`}),t[53]=r,t[54]=R);let z;t[55]!==m||t[56]!==v||t[57]!==g||t[58]!==R?(z=(0,Z.jsx)(Wb,{label:R,sortKey:`modified`,activeKey:g,activeDir:v,onSort:m}),t[55]=m,t[56]=v,t[57]=g,t[58]=R,t[59]=z):z=t[59];let B;t[60]!==L||t[61]!==z?(B=(0,Z.jsx)(Bb,{className:`w-32`,"aria-sort":L,children:z}),t[60]=L,t[61]=z,t[62]=B):B=t[62],t[63]!==I||t[64]!==B?(C=(0,Z.jsx)(Lb,{children:(0,Z.jsxs)(zb,{children:[I,B]})}),t[63]=I,t[64]=B,t[65]=C):C=t[65],b=Rb,S=i.length?i.map(Kb):(0,Z.jsx)(zb,{children:(0,Z.jsx)(Vb,{colSpan:2,className:`h-24 text-center text-muted-foreground`,children:(0,Z.jsx)(s,{id:`Pkw7J9`})})}),t[7]=r,t[8]=f,t[9]=d,t[10]=n,t[11]=a,t[12]=u,t[13]=l,t[14]=c,t[15]=p,t[16]=v,t[17]=g,t[18]=b,t[19]=x,t[20]=S,t[21]=C,t[22]=w,t[23]=T,t[24]=E,t[25]=D,t[26]=O,t[27]=k}else b=t[18],x=t[19],S=t[20],C=t[21],w=t[22],T=t[23],E=t[24],D=t[25],O=t[26],k=t[27];let A;t[66]!==b||t[67]!==S?(A=(0,Z.jsx)(b,{children:S}),t[66]=b,t[67]=S,t[68]=A):A=t[68];let j;t[69]!==x||t[70]!==C||t[71]!==A?(j=(0,Z.jsxs)(x,{children:[C,A]}),t[69]=x,t[70]=C,t[71]=A,t[72]=j):j=t[72];let M;t[73]!==j||t[74]!==w?(M=(0,Z.jsx)(`div`,{className:w,children:j}),t[73]=j,t[74]=w,t[75]=M):M=t[75];let N;t[76]!==M||t[77]!==T||t[78]!==E||t[79]!==D||t[80]!==O?(N=(0,Z.jsxs)(`div`,{className:T,children:[E,D,O,M]}),t[76]=M,t[77]=T,t[78]=E,t[79]=D,t[80]=O,t[81]=N):N=t[81];let P;t[82]!==N||t[83]!==k?(P=(0,Z.jsx)(`div`,{className:k,children:N}),t[82]=N,t[83]=k,t[84]=P):P=t[84];let F;t[85]!==m||t[86]!==d||t[87]!==n?(F=(0,Z.jsx)(Vp,{open:m,onOpenChange:h,kind:`file`,initialDir:n,folderConfig:d,suggestedName:`index`}),t[85]=m,t[86]=d,t[87]=n,t[88]=F):F=t[88];let I;return t[89]!==P||t[90]!==F?(I=(0,Z.jsxs)(Z.Fragment,{children:[P,F]}),t[89]=P,t[90]=F,t[91]=I):I=t[91],I}function Kb(e){return(0,Z.jsxs)(zb,{children:[(0,Z.jsx)(Vb,{children:(0,Z.jsxs)(`a`,{href:ii(e.path),className:`flex items-center gap-2 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[e.kind===`folder`?(0,Z.jsx)(_c,{className:`size-4 shrink-0 text-muted-foreground`}):(0,Z.jsx)(Ae,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.title})]})}),(0,Z.jsx)(Vb,{className:`text-muted-foreground`,children:e.kind===`file`?Hb(e.modified):`—`})]},e.path)}function qb(e){return e===`asc`?`desc`:`asc`}function Jb(e){return(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 border-b px-4 py-3 last:border-b-0`,children:[(0,Z.jsx)(Wa,{className:`size-4 rounded`}),(0,Z.jsx)(Wa,{className:`h-4 w-40`}),(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsx)(Wa,{className:`h-4 w-16`})})]},e)}function Yb(e){let t=(0,$.c)(8),{docName:n}=e,[r,i]=(0,Q.useState)(Xb),a,o;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>q(e=>{i(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})}),o=[],t[0]=a,t[1]=o):(a=t[0],o=t[1]),(0,Q.useEffect)(a,o),!r.has(n))return null;let c;t[2]===n?c=t[3]:(c=function(){pe(n)?.abort(),i(e=>{if(!e.has(n))return e;let t=new Set(e);return t.delete(n),t})},t[2]=n,t[3]=c);let l=c,u;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`A67Uwj`})}),t[4]=u):u=t[4];let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(s,{id:`dEgA5A`}),t[5]=d):d=t[5];let f;return t[6]===l?f=t[7]:(f=(0,Z.jsxs)(`div`,{className:`absolute inset-x-0 bottom-8 z-20 flex justify-center text-xs text-muted-foreground`,children:[u,(0,Z.jsx)(Di,{variant:`link`,size:`sm`,className:`h-auto px-2 py-0 text-xs`,onClick:l,children:d})]}),t[6]=l,t[7]=f),f}function Xb(){return new Set}var Zb=(0,Q.createContext)(null);function Qb(e){let t=(0,$.c)(7),{children:n}=e,[r,i]=(0,Q.useState)($b),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=e=>{i(t=>{let n=new Map(t);return n.set(e,(t.get(e)??0)+1),n})},t[0]=a):a=t[0];let o=a,s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=e=>{i(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},t[1]=s):s=t[1];let c=s,l;t[2]===r?l=t[3]:(l={addPropertySignal:r,requestAddProperty:o,clearAddProperty:c},t[2]=r,t[3]=l);let u=l,d;return t[4]!==n||t[5]!==u?(d=(0,Z.jsx)(Zb,{value:u,children:n}),t[4]=n,t[5]=u,t[6]=d):d=t[6],d}function $b(){return new Map}function ex(){let e=(0,Q.use)(Zb);if(e===null)throw Error(`useProperties must be used within <PropertyProvider />`);return e}function tx(e){let t=null,n=()=>(t===null&&(t=e(),t.catch(()=>{})),t),r=(0,Q.lazy)(n);return r.preload=n,r}var nx=tx(()=>n(()=>import(`./SettingsDialogBody-B8fXoAN4.js`).then(e=>({default:e.SettingsDialogBody})),__vite__mapDeps([42,1,33,2,34,35,20,36,37,38,39,19,6,3,7,4,10,9,40,43,8,14,21,11]),import.meta.url));function rx(e){let t=(0,$.c)(9),{error:n}=e,{_:r}=i(),a;t[0]!==r||t[1]!==n?(a=n instanceof Error&&/dynamically imported module|Failed to fetch/i.test(n.message)?r({id:`Y8ViJx`}):r({id:`3h5zMp`}),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o=a,c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(`h3`,{id:`settings-body-error-title`,className:`font-heading text-base leading-none font-medium`,children:(0,Z.jsx)(s,{id:`hwFOFD`})}),t[3]=c):c=t[3];let l;t[4]===o?l=t[5]:(l=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[c,(0,Z.jsx)(`p`,{className:`max-w-xs text-sm text-muted-foreground`,children:o})]}),t[4]=o,t[5]=l);let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(Di,{variant:`default`,onClick:ix,children:(0,Z.jsx)(s,{id:`HpK_8d`})}),t[6]=u):u=t[6];let d;return t[7]===l?d=t[8]:(d=(0,Z.jsxs)(`div`,{role:`alert`,"aria-labelledby":`settings-body-error-title`,"data-slot":`settings-body-error-boundary`,className:`flex h-full flex-col items-center justify-center gap-5 p-8 text-center`,children:[l,u]}),t[7]=l,t[8]=d),d}function ix(){return window.location.reload()}function ax(e){let t=(0,$.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(m,{fallbackRender:sx,onError:ox,children:n}),t[0]=n,t[1]=r),r}function ox(e,t){console.error(`[SettingsDialogErrorBoundary] rendered fallback for Settings body`,e,t.componentStack)}function sx(e){return(0,Z.jsx)(rx,{...e})}function cx(e){let t=(0,$.c)(64),{open:n,onOpenChange:r}=e,{_:a}=i(),{collabUrl:o}=ft(),{userBinding:c,userSynced:l,okignoreBinding:u,okignoreSynced:d}=ke(),{desktopPresent:f}=ja(),[p,m]=(0,Q.useState)(`preferences`),h,g;t[0]===n?(h=t[1],g=t[2]):(h=()=>{n&&m(`preferences`)},g=[n],t[0]=n,t[1]=h,t[2]=g),(0,Q.useEffect)(h,g);let _=o!==null,v;t[3]===a?v=t[4]:(v=a({id:`7PzzBU`}),t[3]=a,t[4]=v);let y;t[5]===a?y=t[6]:(y=a({id:`Q6hhn8`}),t[5]=a,t[6]=y);let b;t[7]===y?b=t[8]:(b=[{id:`preferences`,label:y}],t[7]=y,t[8]=b);let x;t[9]!==v||t[10]!==b?(x={id:`user`,label:v,enabled:!0,items:b},t[9]=v,t[10]=b,t[11]=x):x=t[11];let S;t[12]===a?S=t[13]:(S=a({id:`ZWyHmq`}),t[12]=a,t[13]=S);let C;t[14]===a?C=t[15]:(C=a({id:`Nu4DdT`}),t[14]=a,t[15]=C);let w;t[16]===C?w=t[17]:(w={id:`sync`,label:C},t[16]=C,t[17]=w);let T;t[18]===a?T=t[19]:(T=a({id:`iTylMl`}),t[18]=a,t[19]=T);let E;t[20]===T?E=t[21]:(E={id:`project-templates`,label:T},t[20]=T,t[21]=E);let D;t[22]===a?D=t[23]:(D=a({id:`3zyg_A`}),t[22]=a,t[23]=D);let O;t[24]===D?O=t[25]:(O={id:`okignore`,label:D},t[24]=D,t[25]=O);let k;t[26]!==E||t[27]!==O||t[28]!==w?(k=[w,E,O],t[26]=E,t[27]=O,t[28]=w,t[29]=k):k=t[29];let A;t[30]!==_||t[31]!==k||t[32]!==S?(A={id:`project`,label:S,enabled:_,items:k},t[30]=_,t[31]=k,t[32]=S,t[33]=A):A=t[33];let j;t[34]===a?j=t[35]:(j=a({id:`nbfdhU`}),t[34]=a,t[35]=j);let M;t[36]!==a||t[37]!==f?(M=f?[{id:`claude-desktop`,label:a({id:`yvHDYG`})}]:[],t[36]=a,t[37]=f,t[38]=M):M=t[38];let N;t[39]!==j||t[40]!==M?(N={id:`integrations`,label:j,enabled:!0,items:M},t[39]=j,t[40]=M,t[41]=N):N=t[41];let P;t[42]!==A||t[43]!==N||t[44]!==x?(P=[x,A,N],t[42]=A,t[43]=N,t[44]=x,t[45]=P):P=t[45];let F=P,I;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Z.jsx)(jo,{className:`sr-only`,children:(0,Z.jsx)(s,{id:`Tz0i8g`})}),t[46]=I):I=t[46];let L;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(ko,{className:`sr-only`,children:(0,Z.jsx)(s,{id:`RDrXh4`})}),t[47]=L):L=t[47];let R;t[48]!==p||t[49]!==F?(R=(0,Z.jsx)(lx,{groups:F,activeId:p,onSelect:m}),t[48]=p,t[49]=F,t[50]=R):R=t[50];let z;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Z.jsx)(dx,{}),t[51]=z):z=t[51];let B=l?c:null,V;t[52]!==p||t[53]!==u||t[54]!==d||t[55]!==B?(V=(0,Z.jsx)(`div`,{className:`min-h-0 overflow-y-auto overscroll-contain subtle-scrollbar p-6`,children:(0,Z.jsx)(ax,{children:(0,Z.jsx)(Q.Suspense,{fallback:z,children:(0,Z.jsx)(nx,{activeId:p,userBinding:B,okignoreBinding:u,okignoreSynced:d})})})}),t[52]=p,t[53]=u,t[54]=d,t[55]=B,t[56]=V):V=t[56];let H;t[57]!==R||t[58]!==V?(H=(0,Z.jsxs)(Fo,{className:`grid h-[700px] max-h-[calc(100dvh-4rem)] w-[900px] max-w-[calc(100%-2rem)] grid-cols-[220px_1fr] gap-0 overflow-hidden p-0 sm:max-w-[900px]`,"data-testid":`settings-dialog`,children:[I,L,R,V]}),t[57]=R,t[58]=V,t[59]=H):H=t[59];let U;return t[60]!==r||t[61]!==n||t[62]!==H?(U=(0,Z.jsx)(Vo,{open:n,onOpenChange:r,children:H}),t[60]=r,t[61]=n,t[62]=H,t[63]=U):U=t[63],U}function lx(e){let t=(0,$.c)(12),{groups:n,activeId:r,onSelect:a}=e,{_:o}=i(),s;t[0]===o?s=t[1]:(s=o({id:`y1t8bQ`}),t[0]=o,t[1]=s);let c;if(t[2]!==r||t[3]!==n||t[4]!==a){let e;t[6]!==r||t[7]!==a?(e=e=>(0,Z.jsx)(ux,{group:e,activeId:r,onSelect:a},e.id),t[6]=r,t[7]=a,t[8]=e):e=t[8],c=n.map(e),t[2]=r,t[3]=n,t[4]=a,t[5]=c}else c=t[5];let l;return t[9]!==s||t[10]!==c?(l=(0,Z.jsx)(`nav`,{"aria-label":s,className:`h-full overflow-y-auto overscroll-contain subtle-scrollbar border-r bg-muted/30 px-3 py-4`,children:c}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function ux(e){let t=(0,$.c)(28),{group:n,activeId:r,onSelect:i}=e;if(n.items.length===0)return null;let a=`settings-group-${n.id}`,o=`${a}-caption`,c=n.enabled?void 0:o,l=n.enabled?`text-muted-foreground/80`:`text-muted-foreground/50`,u;t[0]===l?u=t[1]:(u=X(`mb-1 px-2 text-xs font-semibold uppercase tracking-wide font-mono`,l),t[0]=l,t[1]=u);let d;t[2]!==n.label||t[3]!==a||t[4]!==c||t[5]!==u?(d=(0,Z.jsx)(`h3`,{id:a,"aria-describedby":c,className:u,children:n.label}),t[2]=n.label,t[3]=a,t[4]=c,t[5]=u,t[6]=d):d=t[6];let f;t[7]!==o||t[8]!==n.enabled?(f=n.enabled?null:(0,Z.jsx)(`p`,{id:o,className:`mb-1 px-2 text-xs italic text-muted-foreground/60`,children:(0,Z.jsx)(s,{id:`JWsZlx`})}),t[7]=o,t[8]=n.enabled,t[9]=f):f=t[9];let p;if(t[10]!==r||t[11]!==o||t[12]!==n.enabled||t[13]!==n.items||t[14]!==i){let e;t[16]!==r||t[17]!==o||t[18]!==n.enabled||t[19]!==i?(e=e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(`button`,{type:`button`,"aria-current":r===e.id?`page`:void 0,"aria-disabled":n.enabled?void 0:!0,"aria-describedby":n.enabled?void 0:o,tabIndex:n.enabled?0:-1,disabled:!n.enabled,onClick:()=>n.enabled&&i(e.id),"data-testid":`settings-sidebar-item-${e.id}`,className:X(`w-full rounded px-2 py-1.5 text-left text-sm transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`,r===e.id&&n.enabled?`bg-accent text-accent-foreground`:`hover:bg-accent/50`),children:e.label})},e.id),t[16]=r,t[17]=o,t[18]=n.enabled,t[19]=i,t[20]=e):e=t[20],p=n.items.map(e),t[10]=r,t[11]=o,t[12]=n.enabled,t[13]=n.items,t[14]=i,t[15]=p}else p=t[15];let m;t[21]!==a||t[22]!==p?(m=(0,Z.jsx)(`ul`,{"aria-labelledby":a,className:`space-y-0.5`,children:p}),t[21]=a,t[22]=p,t[23]=m):m=t[23];let h;return t[24]!==d||t[25]!==f||t[26]!==m?(h=(0,Z.jsxs)(`div`,{className:`mb-4`,children:[d,f,m]}),t[24]=d,t[25]=f,t[26]=m,t[27]=h):h=t[27],h}function dx(){let e=(0,$.c)(4),t,n,r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(s,{id:`GsBUCk`})}),n=(0,Z.jsx)(Wa,{className:`h-5 w-32`}),r=(0,Z.jsx)(Wa,{className:`h-4 w-64`}),e[0]=t,e[1]=n,e[2]=r):(t=e[0],n=e[1],r=e[2]);let i;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-3`,"data-testid":`settings-content-skeleton`,children:[t,n,r,(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(Wa,{className:`h-9 w-full`}),(0,Z.jsx)(Wa,{className:`h-9 w-full`})]})]}),e[3]=i):i=e[3],i}function fx(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`flex h-full w-full aria-[orientation=vertical]:flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(sy,{"data-slot":`resizable-panel-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function px(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(uy,{"data-slot":`resizable-panel`,...n}),t[2]=n,t[3]=r),r}function mx(e){let t=(0,$.c)(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({withHandle:i,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=X(`relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,n),t[4]=n,t[5]=a);let o;t[6]===i?o=t[7]:(o=i&&(0,Z.jsx)(`div`,{className:`z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border`}),t[6]=i,t[7]=o);let s;return t[8]!==r||t[9]!==a||t[10]!==o?(s=(0,Z.jsx)(my,{"data-slot":`resizable-handle`,className:a,...r,children:o}),t[8]=r,t[9]=a,t[10]=o,t[11]=s):s=t[11],s}function hx(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(Io,{"data-slot":`sheet`,...n}),t[2]=n,t[3]=r),r}function gx(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(zo,{"data-slot":`sheet-portal`,...n}),t[2]=n,t[3]=r),r}function _x(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(No,{"data-slot":`sheet-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function vx(e){let t=(0,$.c)(17),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,children:n,side:a,showCloseButton:o,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let c=a===void 0?`right`:a,l=o===void 0?!0:o,u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(_x,{}),t[6]=u):u=t[6];let d;t[7]===r?d=t[8]:(d=X(`fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10 motion-reduce:transition-none motion-reduce:duration-0 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none`,r),t[7]=r,t[8]=d);let f;t[9]===l?f=t[10]:(f=l&&(0,Z.jsx)(Ho,{"data-slot":`sheet-close`,asChild:!0,children:(0,Z.jsxs)(Di,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[(0,Z.jsx)(Oo,{}),(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(s,{id:`yz7wBu`})})]})}),t[9]=l,t[10]=f);let p;return t[11]!==n||t[12]!==i||t[13]!==c||t[14]!==d||t[15]!==f?(p=(0,Z.jsxs)(gx,{children:[u,(0,Z.jsxs)(Mo,{"data-slot":`sheet-content`,"data-side":c,className:d,...i,children:[n,f]})]}),t[11]=n,t[12]=i,t[13]=c,t[14]=d,t[15]=f,t[16]=p):p=t[16],p}function yx(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`flex flex-col gap-0.5 p-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sheet-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function bx(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`font-heading text-base font-medium text-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Po,{"data-slot":`sheet-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function xx(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`input-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Sx=ki(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function Cx(e){let t=(0,$.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,align:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`inline-start`:i,o;t[4]!==a||t[5]!==n?(o=X(Sx({align:a}),n),t[4]=a,t[5]=n,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,Z.jsx)(`div`,{"data-slot":`input-group-addon`,"data-align":a,className:o,onMouseDown:wx,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function wx(e){e.target.closest(`button`)||(e.preventDefault(),e.currentTarget.parentElement?.querySelector(`input`)?.focus())}ki(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function Tx(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`span`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ex(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Go,{"data-slot":`input-group-control`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Dx(e){let t=(0,$.c)(119),{findInputRef:n,query:r,replacement:a,replaceOpen:o,caseSensitive:c,wholeWord:l,current:u,total:d,onQueryChange:f,onReplacementChange:p,onReplaceOpenChange:m,onCaseSensitiveChange:h,onWholeWordChange:g,onNext:_,onPrevious:v,onReplaceCurrent:y,onReplaceAll:b,onClose:x}=e,{_:S}=i(),C=r.length>0,w=d>0,T;t[0]!==S||t[1]!==u||t[2]!==w||t[3]!==C||t[4]!==d?(T=C?w?`${u} / ${d}`:S({id:`Ev2r9A`}):``,t[0]=S,t[1]=u,t[2]=w,t[3]=C,t[4]=d,t[5]=T):T=t[5];let E=T,D;t[6]!==x||t[7]!==_||t[8]!==v?(D=function(e){e.key===`Enter`?(e.preventDefault(),e.shiftKey?v():_()):e.key===`Escape`&&(e.preventDefault(),x())},t[6]=x,t[7]=_,t[8]=v,t[9]=D):D=t[9];let O=D,k;t[10]!==x||t[11]!==y?(k=function(e){e.key===`Enter`?(e.preventDefault(),y()):e.key===`Escape`&&(e.preventDefault(),x())},t[10]=x,t[11]=y,t[12]=k):k=t[12];let A=k,j;t[13]===S?j=t[14]:(j=S({id:`MVxpbf`}),t[13]=S,t[14]=j);let M;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Z.jsx)(`label`,{className:`sr-only`,htmlFor:`ok-find-input`,children:(0,Z.jsx)(s,{id:`KujtjC`})}),t[15]=M):M=t[15];let N;t[16]===f?N=t[17]:(N=e=>f(e.target.value),t[16]=f,t[17]=N);let P;t[18]===S?P=t[19]:(P=S({id:`KujtjC`}),t[18]=S,t[19]=P);let F;t[20]!==n||t[21]!==O||t[22]!==r||t[23]!==N||t[24]!==P?(F=(0,Z.jsx)(Ex,{ref:n,id:`ok-find-input`,value:r,onChange:N,onKeyDown:O,placeholder:P,autoComplete:`off`,spellCheck:!1,className:`h-7 px-2 text-sm`}),t[20]=n,t[21]=O,t[22]=r,t[23]=N,t[24]=P,t[25]=F):F=t[25];let I;t[26]===S?I=t[27]:(I=S({id:`-8PP0T`}),t[26]=S,t[27]=I);let L;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(Xs,{"aria-hidden":`true`}),t[28]=L):L=t[28];let R;t[29]!==c||t[30]!==h||t[31]!==I?(R=(0,Z.jsx)($n,{asChild:!0,children:(0,Z.jsx)(wo,{type:`button`,variant:`segmented`,size:`sm`,"aria-label":I,pressed:c,onPressedChange:h,className:`size-6 min-w-6 px-0`,children:L})}),t[29]=c,t[30]=h,t[31]=I,t[32]=R):R=t[32];let z;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Z.jsx)(wn,{side:`bottom`,children:(0,Z.jsx)(s,{id:`-8PP0T`})}),t[33]=z):z=t[33];let B;t[34]===R?B=t[35]:(B=(0,Z.jsxs)(Kr,{children:[R,z]}),t[34]=R,t[35]=B);let V;t[36]===S?V=t[37]:(V=S({id:`_7UQ7y`}),t[36]=S,t[37]=V);let H;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,Z.jsx)(sl,{"aria-hidden":`true`}),t[38]=H):H=t[38];let U;t[39]!==g||t[40]!==V||t[41]!==l?(U=(0,Z.jsx)($n,{asChild:!0,children:(0,Z.jsx)(wo,{type:`button`,variant:`segmented`,size:`sm`,"aria-label":V,pressed:l,onPressedChange:g,className:`size-6 min-w-6 px-0`,children:H})}),t[39]=g,t[40]=V,t[41]=l,t[42]=U):U=t[42];let W;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Z.jsx)(wn,{side:`bottom`,children:(0,Z.jsx)(s,{id:`_7UQ7y`})}),t[43]=W):W=t[43];let G;t[44]===U?G=t[45]:(G=(0,Z.jsxs)(Kr,{children:[U,W]}),t[44]=U,t[45]=G);let ee;t[46]!==B||t[47]!==G?(ee=(0,Z.jsxs)(Cx,{align:`inline-end`,className:`gap-0.5`,children:[B,G]}),t[46]=B,t[47]=G,t[48]=ee):ee=t[48];let K;t[49]!==ee||t[50]!==F?(K=(0,Z.jsxs)(xx,{className:`h-7 w-56 rounded-[min(var(--radius-md),12px)]`,children:[F,ee]}),t[49]=ee,t[50]=F,t[51]=K):K=t[51];let q;t[52]===E?q=t[53]:(q=(0,Z.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`min-w-14 px-1 text-right text-muted-foreground text-xs tabular-nums shrink-0`,children:E}),t[52]=E,t[53]=q);let te;t[54]===S?te=t[55]:(te=S({id:`oqB2ez`}),t[54]=S,t[55]=te);let ne=!w,re;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Z.jsx)(_t,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[56]=re):re=t[56];let ie;t[57]!==v||t[58]!==te||t[59]!==ne?(ie=(0,Z.jsx)($n,{asChild:!0,children:(0,Z.jsx)(Di,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":te,disabled:ne,onClick:v,children:re})}),t[57]=v,t[58]=te,t[59]=ne,t[60]=ie):ie=t[60];let ae;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,Z.jsx)(wn,{side:`bottom`,children:(0,Z.jsx)(s,{id:`oqB2ez`})}),t[61]=ae):ae=t[61];let oe;t[62]===ie?oe=t[63]:(oe=(0,Z.jsxs)(Kr,{children:[ie,ae]}),t[62]=ie,t[63]=oe);let se;t[64]===S?se=t[65]:(se=S({id:`SiUUCS`}),t[64]=S,t[65]=se);let ce=!w,le;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,Z.jsx)(Dt,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[66]=le):le=t[66];let ue;t[67]!==_||t[68]!==se||t[69]!==ce?(ue=(0,Z.jsx)($n,{asChild:!0,children:(0,Z.jsx)(Di,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":se,disabled:ce,onClick:_,children:le})}),t[67]=_,t[68]=se,t[69]=ce,t[70]=ue):ue=t[70];let de;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,Z.jsx)(wn,{side:`bottom`,children:(0,Z.jsx)(s,{id:`SiUUCS`})}),t[71]=de):de=t[71];let fe;t[72]===ue?fe=t[73]:(fe=(0,Z.jsxs)(Kr,{children:[ue,de]}),t[72]=ue,t[73]=fe);let pe=o?`secondary`:`ghost`,me;t[74]!==S||t[75]!==o?(me=S(o?{id:`UkQGhd`}:{id:`1RluQD`}),t[74]=S,t[75]=o,t[76]=me):me=t[76];let he=o?`ok-replace-input`:void 0,ge;t[77]!==m||t[78]!==o?(ge=()=>m(!o),t[77]=m,t[78]=o,t[79]=ge):ge=t[79];let _e;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,Z.jsx)(Hc,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[80]=_e):_e=t[80];let ve;t[81]!==o||t[82]!==pe||t[83]!==me||t[84]!==he||t[85]!==ge?(ve=(0,Z.jsx)($n,{asChild:!0,children:(0,Z.jsx)(Di,{type:`button`,variant:pe,size:`icon-sm`,"aria-label":me,"aria-expanded":o,"aria-controls":he,onClick:ge,children:_e})}),t[81]=o,t[82]=pe,t[83]=me,t[84]=he,t[85]=ge,t[86]=ve):ve=t[86];let ye;t[87]===o?ye=t[88]:(ye=(0,Z.jsx)(wn,{side:`bottom`,children:o?(0,Z.jsx)(s,{id:`UkQGhd`}):(0,Z.jsx)(s,{id:`1RluQD`})}),t[87]=o,t[88]=ye);let be;t[89]!==ve||t[90]!==ye?(be=(0,Z.jsxs)(Kr,{children:[ve,ye]}),t[89]=ve,t[90]=ye,t[91]=be):be=t[91];let xe;t[92]!==S||t[93]!==A||t[94]!==w||t[95]!==b||t[96]!==y||t[97]!==p||t[98]!==o||t[99]!==a?(xe=o?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`label`,{className:`sr-only`,htmlFor:`ok-replace-input`,children:(0,Z.jsx)(s,{id:`fqSfXY`})}),(0,Z.jsx)(Go,{id:`ok-replace-input`,value:a,onChange:e=>p(e.target.value),onKeyDown:A,placeholder:S({id:`fqSfXY`}),autoComplete:`off`,spellCheck:!1,className:`h-7 w-48 rounded-[min(var(--radius-md),12px)] px-2 text-sm shadow-none focus-visible:ring-2`}),(0,Z.jsxs)(Kr,{children:[(0,Z.jsx)($n,{asChild:!0,children:(0,Z.jsx)(Di,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":S({id:`bS_boY`}),disabled:!w,onClick:y,children:(0,Z.jsx)(Hc,{"data-icon":`inline-start`,"aria-hidden":`true`})})}),(0,Z.jsx)(wn,{side:`bottom`,children:(0,Z.jsx)(s,{id:`bS_boY`})})]}),(0,Z.jsxs)(Kr,{children:[(0,Z.jsx)($n,{asChild:!0,children:(0,Z.jsx)(Di,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":S({id:`dr1vFs`}),disabled:!w,onClick:b,children:(0,Z.jsx)(Vc,{"data-icon":`inline-start`,"aria-hidden":`true`})})}),(0,Z.jsx)(wn,{side:`bottom`,children:(0,Z.jsx)(s,{id:`dr1vFs`})})]})]}):null,t[92]=S,t[93]=A,t[94]=w,t[95]=b,t[96]=y,t[97]=p,t[98]=o,t[99]=a,t[100]=xe):xe=t[100];let Se;t[101]===S?Se=t[102]:(Se=S({id:`wJo9oS`}),t[101]=S,t[102]=Se);let Ce;t[103]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,Z.jsx)(Oo,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[103]=Ce):Ce=t[103];let we;t[104]!==x||t[105]!==Se?(we=(0,Z.jsx)($n,{asChild:!0,children:(0,Z.jsx)(Di,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":Se,onClick:x,children:Ce})}),t[104]=x,t[105]=Se,t[106]=we):we=t[106];let Te;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,Z.jsx)(wn,{side:`bottom`,children:(0,Z.jsx)(s,{id:`yz7wBu`})}),t[107]=Te):Te=t[107];let Ee;t[108]===we?Ee=t[109]:(Ee=(0,Z.jsxs)(Kr,{children:[we,Te]}),t[108]=we,t[109]=Ee);let De;return t[110]!==K||t[111]!==q||t[112]!==oe||t[113]!==fe||t[114]!==j||t[115]!==be||t[116]!==xe||t[117]!==Ee?(De=(0,Z.jsxs)(`search`,{"data-testid":`find-replace-bar`,"aria-label":j,className:`pointer-events-auto flex max-w-[min(calc(100vw-1rem),720px)] touch-manipulation items-center gap-1 rounded-[calc(var(--radius)+2px)] border border-input bg-popover/95 p-1 text-popover-foreground shadow-md shadow-black/10 backdrop-blur`,children:[M,K,q,oe,fe,be,xe,Ee]}),t[110]=K,t[111]=q,t[112]=oe,t[113]=fe,t[114]=j,t[115]=be,t[116]=xe,t[117]=Ee,t[118]=De):De=t[118],De}var Ox={current:0,total:0},kx=120,Ax=100;function jx(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=()=>e?W(e):null,t[0]=e,t[1]=n),(0,Q.useSyncExternalStore)(re,n,Mx)}function Mx(){return null}function Nx(e){if(!e||e.isDestroyed)return null;let{from:t,to:n,empty:r}=e.state.selection;if(r)return null;let i=e.state.doc.textBetween(t,n,`
|
|
24
|
+
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function Rg(e,t){return`${e}\u0000${t}`}function zg(e,t,n){let r=Fn(e).body,i=Fn(t).body;return r===i?``:Ig(n,r,i,``,``,{context:3})}function Bg(e,t,n){let r=(0,$.c)(8),{activeProvider:i}=ft(),a;r[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={status:`idle`,diff:null},r[0]=a):a=r[0];let[o,s]=(0,Q.useState)(a),c=(0,Q.useRef)(i),l;r[1]===i?l=r[2]:(l=()=>{c.current=i},r[1]=i,r[2]=l),(0,Q.useEffect)(l);let u,d;return r[3]!==n||r[4]!==t||r[5]!==e?(u=()=>{if(!e){s({status:`idle`,diff:null});return}let r=e,i=!1;return s({status:`loading`,diff:null}),(async function(){try{let e=Rg(t,r),a=n.get(e);if(a===void 0){let o=await fetch(`/api/history/${r}?docName=${encodeURIComponent(t)}`);if(i)return;if(!o.ok){s({status:`error`,diff:null});return}let c=await o.json();if(i)return;a=c.content??``,n.set(e,a)}if(i)return;let o=c.current?.document.getText(`source`).toString()??``,l=zg(a,o,t);if(i)return;s({status:`ready`,diff:l})}catch(e){i||(console.error(`[timeline-diff] failed to load entry diff`,{sha:r,docName:t,err:e}),s({status:`error`,diff:null}))}})(),()=>{i=!0}},d=[e,t,n],r[3]=n,r[4]=t,r[5]=e,r[6]=u,r[7]=d):(u=r[6],d=r[7]),(0,Q.useEffect)(u,d),o}var Vg=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./ActivityPanelDiffView-LNHry3BJ.js`),__vite__mapDeps([16,1,6,17]),import.meta.url)).ActivityPanelDiffView}));function Hg(e){let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3);if(r<60)return Y._({id:`xOTzt5`});if(r<3600){let e=Math.floor(r/60);return Y._({id:`UyROxs`,values:{mins:e}})}if(r<86400){let e=Math.floor(r/3600);return Y._({id:`wXO4Tg`,values:{hrs:e}})}if(r<86400*2)return Y._({id:`rQRrkB`});let i=Math.floor(r/86400);return i<7?Y._({id:`6u9LvN`,values:{days:i}}):t.toLocaleDateString()}function Ug(e){return new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function Wg(e){return e.slice(0,7)}function Gg(e){return e.type===`upstream`?Y._({id:`K_vT1F`}):e.contributors.length===1?e.contributors[0].name:e.contributors.length>1?e.contributors.map(e=>e.name).join(`, `):e.author===`openknowledge-server`||e.author===`server`?Y._({id:`B2DrPb`}):e.author}function Kg(e){let t=(0,$.c)(17),n,r;if(t[0]===e?(n=t[1],r=t[2]):({icon:n,...r}=e,t[0]=e,t[1]=n,t[2]=r),n===`claude`){let e;return t[3]===r?e=t[4]:(e=(0,Z.jsx)(Mi,{...r}),t[3]=r,t[4]=e),e}if(n===`cursor`){let e;return t[5]===r?e=t[6]:(e=(0,Z.jsx)(Ri,{...r}),t[5]=r,t[6]=e),e}if(n===`windsurf`){let e;return t[7]===r?e=t[8]:(e=(0,Z.jsx)(Ai,{...r}),t[7]=r,t[8]=e),e}if(n===`openai`){let e;return t[9]===r?e=t[10]:(e=(0,Z.jsx)(Fi,{...r}),t[9]=r,t[10]=e),e}if(n===`cline`){let e;return t[11]===r?e=t[12]:(e=(0,Z.jsx)(Ui,{...r}),t[11]=r,t[12]=e),e}if(n===`github`){let e;return t[13]===r?e=t[14]:(e=(0,Z.jsx)(Vi,{...r}),t[13]=r,t[14]=e),e}let i=r,a;return t[15]===i?a=t[16]:(a=(0,Z.jsx)(zi,{strokeWidth:1.5,...i}),t[15]=i,t[16]=a),a}function qg(e){let t=(0,$.c)(17),{entry:n,isDark:r}=e;if(n.type===`upstream`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(De,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[0]=e):e=t[0],e}if(n.contributors.length>0){let e=n.contributors[0],i=e.colorSeed??e.name,a;t[1]===i?a=t[2]:(a=Hn(i),t[1]=i,t[2]=a);let o=a,s=r?or[o]??wr[o]:wr[o],c;t[3]!==s||t[4]!==i?(c=s??jn(i),t[3]=s,t[4]=i,t[5]=c):c=t[5];let l=c;if(o!==`bot`){let e;t[6]===l?e=t[7]:(e={color:l},t[6]=l,t[7]=e);let n;return t[8]!==o||t[9]!==e?(n=(0,Z.jsx)(Kg,{icon:o,width:14,height:14,className:`shrink-0`,style:e}),t[8]=o,t[9]=e,t[10]=n):n=t[10],n}if(e.name===`File System`){let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(yc,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[11]=e):e=t[11],e}if(e.name===`Open Knowledge (service)`||e.name===`Git (upstream)`){let e;return t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Us,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[12]=e):e=t[12],e}let u;return t[13]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(ol,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[13]=u):u=t[13],u}if(n.authorEmail.includes(`agent`)||n.author.includes(`agent`)||n.authorEmail.includes(`cursor`)||n.authorEmail.includes(`claude`)){let e;return t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(zi,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[14]=e):e=t[14],e}if(n.author===`openknowledge-server`||n.author===`server`){let e;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Us,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[15]=e):e=t[15],e}let i;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(ol,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[16]=i):i=t[16],i}function Jg(e){let t=(0,$.c)(23),{entries:n,defaultExpanded:r,isDark:i,diffLayout:a,cache:o,docName:s,expandedShas:c,onToggleExpanded:l,onRestoreSuccess:u}=e,[d,f]=(0,Q.useState)(r),p=n.length;if(n.length===0)return null;let m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>f(Yg),t[0]=m):m=t[0];let h;t[1]===d?h=t[2]:(h=d?(0,Z.jsx)(Dt,{className:`size-3`}):(0,Z.jsx)(Wo,{className:`size-3`}),t[1]=d,t[2]=h);let g;t[3]!==p||t[4]!==d?(g=d?Y._({id:`OKQe56`,values:{entryCount:p}}):Y._({id:`k9jDvw`,values:{entryCount:p}}),t[3]=p,t[4]=d,t[5]=g):g=t[5];let _;t[6]!==d||t[7]!==h||t[8]!==g?(_=(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":d,className:`flex items-center gap-1.5 rounded-lg px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors text-left`,onClick:m,children:[h,g]}),t[6]=d,t[7]=h,t[8]=g,t[9]=_):_=t[9];let v;t[10]!==o||t[11]!==a||t[12]!==s||t[13]!==n||t[14]!==d||t[15]!==c||t[16]!==i||t[17]!==u||t[18]!==l?(v=d&&n.map(e=>(0,Z.jsx)(s_,{entry:e,isDark:i,diffLayout:a,cache:o,docName:s,expanded:c.has(e.sha),onToggleExpanded:l,onRestoreSuccess:u},e.sha)),t[10]=o,t[11]=a,t[12]=s,t[13]=n,t[14]=d,t[15]=c,t[16]=i,t[17]=u,t[18]=l,t[19]=v):v=t[19];let y;return t[20]!==_||t[21]!==v?(y=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[_,v]}),t[20]=_,t[21]=v,t[22]=y):y=t[22],y}function Yg(e){return!e}function Xg(e){return e.checkpoint?e.checkpoint.kind:`save`}function Zg(e){let t=Xg(e);if(t===`save`)return Y._({id:`gsePqm`});let n=e.checkpoint?.size??null,r=n!=null&&n>0?` (${Qg(n)})`:``;return t===`bridge-merge-loss`?Y._({id:`uZAG7T`,values:{sizeSuffix:r}}):Y._({id:`_4rAQI`,values:{sizeSuffix:r}})}function Qg(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/102.4)/10} KB`:`${Math.round(e/104857.6)/10} MB`}function $g(e){return e.type===`checkpoint`?Xg(e)===`save`?`version`:`auto-save`:`wip`}function e_(e){let t=$g(e);return t===`version`?Y._({id:`RFQ1Yx`}):t===`auto-save`?Y._({id:`9Uv1CD`}):Y._({id:`Yea-K5`})}function t_(e){let t=$g(e);return t===`version`?Y._({id:`gg3Rpy`}):t===`auto-save`?Y._({id:`PXXeW8`}):Y._({id:`Pyp1NA`})}function n_(e){let t=[];for(let n of e.contributors)if(n.summaries)for(let e of n.summaries)t.push(e);return t}function r_(e){let t=(0,$.c)(21),{summaries:n}=e,[r,i]=(0,Q.useState)(!1),a=(0,Q.useId)();if(n.length===0)return null;let o,c;t[0]===n?(o=t[1],c=t[2]):([o,...c]=n,t[0]=n,t[1]=o,t[2]=c);let l=c.length,u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`• `}),t[3]=u):u=t[3];let d;t[4]===o?d=t[5]:(d=(0,Z.jsxs)(`li`,{className:`text-xs text-foreground/90`,children:[u,o]}),t[4]=o,t[5]=d);let f;t[6]!==r||t[7]!==c?(f=r&&c.map(a_),t[6]=r,t[7]=c,t[8]=f):f=t[8];let p;t[9]!==a||t[10]!==d||t[11]!==f?(p=(0,Z.jsxs)(`ul`,{id:a,className:`list-none`,children:[d,f]}),t[9]=a,t[10]=d,t[11]=f,t[12]=p):p=t[12];let m;t[13]!==r||t[14]!==l||t[15]!==a||t[16]!==c.length?(m=c.length>0&&(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":r,"aria-controls":a,className:`inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer`,onClick:e=>{e.stopPropagation(),i(i_)},children:[r?(0,Z.jsx)(Dt,{className:`size-3`}):(0,Z.jsx)(Wo,{className:`size-3`}),r?(0,Z.jsx)(s,{id:`vLyv1R`}):(0,Z.jsx)(s,{id:`ZptNUh`,values:{hidden:l}})]}),t[13]=r,t[14]=l,t[15]=a,t[16]=c.length,t[17]=m):m=t[17];let h;return t[18]!==p||t[19]!==m?(h=(0,Z.jsxs)(`div`,{className:`mt-0.5`,children:[p,m]}),t[18]=p,t[19]=m,t[20]=h):h=t[20],h}function i_(e){return!e}function a_(e,t){return(0,Z.jsxs)(`li`,{className:`text-xs text-foreground/90`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`• `}),e]},`${t}-${e}`)}function o_(e){let t=(0,$.c)(13),{sha:n,docName:r,cache:i,diffLayout:a,panelId:o}=e,c=Bg(n,r,i),l;t[0]===c.status?l=t[1]:(l=c.status===`loading`&&(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-xs text-muted-foreground`,children:[(0,Z.jsx)(B,{className:`size-3 animate-spin`}),(0,Z.jsx)(s,{id:`38foVZ`})]}),t[0]=c.status,t[1]=l);let u;t[2]===c.status?u=t[3]:(u=c.status===`error`&&(0,Z.jsx)(`p`,{className:`py-2 text-xs text-destructive`,children:(0,Z.jsx)(s,{id:`vvWZnu`})}),t[2]=c.status,t[3]=u);let d;t[4]!==a||t[5]!==c.diff||t[6]!==c.status?(d=c.status===`ready`&&(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-xs text-muted-foreground`,children:[(0,Z.jsx)(B,{className:`size-3 animate-spin`}),(0,Z.jsx)(s,{id:`EDm3wJ`})]}),children:(0,Z.jsx)(Vg,{diff:c.diff,viewType:a})}),t[4]=a,t[5]=c.diff,t[6]=c.status,t[7]=d):d=t[7];let f;return t[8]!==o||t[9]!==l||t[10]!==u||t[11]!==d?(f=(0,Z.jsxs)(`div`,{id:o,className:`px-3 pb-2`,"data-testid":`timeline-entry-diff`,children:[l,u,d]}),t[8]=o,t[9]=l,t[10]=u,t[11]=d,t[12]=f):f=t[12],f}function s_(e){let t=(0,$.c)(130),{entry:n,prominent:r,isDark:a,diffLayout:o,cache:c,docName:l,expanded:u,onToggleExpanded:d,onRestoreSuccess:f}=e,p=r===void 0?!1:r,{_:m}=i(),h;t[0]===n.timestamp?h=t[1]:(h=Hg(n.timestamp),t[0]=n.timestamp,t[1]=h);let g=h,_;t[2]===n?_=t[3]:(_=Gg(n),t[2]=n,t[3]=_);let v=_,y;t[4]===n.timestamp?y=t[5]:(y=Ug(n.timestamp),t[4]=n.timestamp,t[5]=y);let b=y,x;t[6]===n.sha?x=t[7]:(x=Wg(n.sha),t[6]=n.sha,t[7]=x);let S=x,C=n.contributors.flatMap(c_),w;t[8]===n?w=t[9]:(w=n_(n),t[8]=n,t[9]=w);let T=w,[E,D]=(0,Q.useState)(!1),[O,k]=(0,Q.useState)(!1),A=(0,Q.useRef)(null),j=(0,Q.useId)(),M,N;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(M=()=>()=>A.current?.abort(),N=[],t[10]=M,t[11]=N):(M=t[10],N=t[11]),(0,Q.useEffect)(M,N);let P;t[12]!==n.sha||t[13]!==d?(P=()=>d(n.sha),t[12]=n.sha,t[13]=d,t[14]=P):P=t[14];let F=P,I;t[15]===D?I=t[16]:(I=function(){A.current?.abort(),A.current=null,k(!1),D(!1)},t[15]=D,t[16]=I);let L=I,R;t[17]!==m||t[18]!==l||t[19]!==n.sha||t[20]!==f||t[21]!==D?(R=async function(){k(!0);let e=new AbortController;A.current=e;let t=function(){e.signal.aborted||k(!1),A.current===e&&(A.current=null)},r;try{r=await fetch(`/api/rollback`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({docName:l,commitSha:n.sha}),signal:e.signal})}catch(r){let i=r;!e.signal.aborted&&!(i instanceof DOMException&&i.name===`AbortError`)&&(console.error(`[timeline] rollback fetch failed`,{docName:l,sha:n.sha,err:i}),Uo.error(m({id:`NkXEFS`}),{duration:4e3})),t();return}if(e.signal.aborted){t();return}if(r.ok)D(!1),f();else{let e=`HTTP ${r.status}`;try{let t=Zn.safeParse(await r.json());t.success&&(e=t.data.title)}catch{}console.error(`[timeline] rollback failed`,{docName:l,sha:n.sha,status:r.status,detail:e}),Uo.error(m({id:`uM6jnS`}),{description:e,duration:6e3})}t()},t[17]=m,t[18]=l,t[19]=n.sha,t[20]=f,t[21]=D,t[22]=R):R=t[22];let z=R,V;t[23]!==n||t[24]!==a||t[25]!==p?(V=p?(()=>{let e=Xg(n);return e===`bridge-merge-loss`?(0,Z.jsx)(hi,{className:`size-3.5 shrink-0 text-amber-600 dark:text-amber-400`,"aria-hidden":`true`}):e===`external-change-rescue`?(0,Z.jsx)(uc,{className:`size-3.5 shrink-0 text-sky-600 dark:text-sky-400`,"aria-hidden":`true`}):(0,Z.jsx)(sc,{className:`size-3.5 shrink-0 text-muted-foreground`})})():(0,Z.jsx)(qg,{entry:n,isDark:a}),t[23]=n,t[24]=a,t[25]=p,t[26]=V):V=t[26];let H=V,U=u?j:void 0,W=u?`bg-muted`:`hover:bg-muted/80`,G;t[27]===W?G=t[28]:(G=[`group flex w-full items-start gap-2.5 rounded-lg px-3 py-2.5 text-left transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring`,W],t[27]=W,t[28]=G);let ee=G.join(` `),K;t[29]===F?K=t[30]:(K=e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),F())},t[29]=F,t[30]=K);let q;t[31]===H?q=t[32]:(q=(0,Z.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:H}),t[31]=H,t[32]=q);let te;t[33]!==v||t[34]!==n||t[35]!==p?(te=p?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:`text-xs text-foreground truncate`,children:Zg(n)}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground/50`,children:`·`}),(0,Z.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:v})]}):(0,Z.jsx)(`span`,{className:`truncate text-xs text-foreground`,children:v}),t[33]=v,t[34]=n,t[35]=p,t[36]=te):te=t[36];let ne;t[37]!==n.timestamp||t[38]!==g?(ne=(0,Z.jsx)(`time`,{className:`ml-auto shrink-0 text-xs text-muted-foreground/80`,dateTime:n.timestamp,title:n.timestamp,children:g}),t[37]=n.timestamp,t[38]=g,t[39]=ne):ne=t[39];let re;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`h-3 w-px shrink-0 bg-border`}),t[40]=re):re=t[40];let ie;t[41]===n?ie=t[42]:(ie=e_(n),t[41]=n,t[42]=ie);let ae;t[43]===D?ae=t[44]:(ae=e=>{e.stopPropagation(),D(!0)},t[43]=D,t[44]=ae);let oe;t[45]===O?oe=t[46]:(oe=O?(0,Z.jsx)(B,{className:`size-3 animate-spin`}):(0,Z.jsx)(Ni,{className:`size-3`}),t[45]=O,t[46]=oe);let se;t[47]!==O||t[48]!==ie||t[49]!==ae||t[50]!==oe?(se=(0,Z.jsx)($n,{asChild:!0,children:(0,Z.jsx)(Di,{variant:`ghost`,size:`icon`,className:`size-5 shrink-0 text-muted-foreground hover:text-destructive`,"data-testid":`timeline-entry-restore`,"aria-label":ie,disabled:O,onClick:ae,children:oe})}),t[47]=O,t[48]=ie,t[49]=ae,t[50]=oe,t[51]=se):se=t[51];let ce;t[52]===n?ce=t[53]:(ce=e_(n),t[52]=n,t[53]=ce);let le;t[54]===ce?le=t[55]:(le=(0,Z.jsx)(wn,{side:`top`,children:ce}),t[54]=ce,t[55]=le);let ue;t[56]!==se||t[57]!==le?(ue=(0,Z.jsxs)(Kr,{children:[se,le]}),t[56]=se,t[57]=le,t[58]=ue):ue=t[58];let de;t[59]!==te||t[60]!==ne||t[61]!==ue?(de=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[te,ne,re,ue]}),t[59]=te,t[60]=ne,t[61]=ue,t[62]=de):de=t[62];let fe;t[63]===T?fe=t[64]:(fe=T.length>0&&(0,Z.jsx)(r_,{summaries:T}),t[63]=T,t[64]=fe);let pe=C.length>0?(0,Z.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:C.join(`, `),children:C.join(`, `)}):(0,Z.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:n.message,children:n.message}),me;t[65]!==de||t[66]!==fe||t[67]!==pe?(me=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[de,fe,pe]}),t[65]=de,t[66]=fe,t[67]=pe,t[68]=me):me=t[68];let he;t[69]!==u||t[70]!==F||t[71]!==U||t[72]!==ee||t[73]!==K||t[74]!==q||t[75]!==me?(he=(0,Z.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-expanded":u,"aria-controls":U,"data-testid":`timeline-entry-expand`,className:ee,onClick:F,onKeyDown:K,children:[q,me]}),t[69]=u,t[70]=F,t[71]=U,t[72]=ee,t[73]=K,t[74]=q,t[75]=me,t[76]=he):he=t[76];let ge;t[77]!==c||t[78]!==o||t[79]!==j||t[80]!==l||t[81]!==n.sha||t[82]!==u?(ge=u&&(0,Z.jsx)(o_,{sha:n.sha,docName:l,cache:c,diffLayout:o,panelId:j}),t[77]=c,t[78]=o,t[79]=j,t[80]=l,t[81]=n.sha,t[82]=u,t[83]=ge):ge=t[83];let _e;t[84]!==he||t[85]!==ge?(_e=(0,Z.jsxs)(`div`,{className:`flex flex-col rounded-lg`,children:[he,ge]}),t[84]=he,t[85]=ge,t[86]=_e):_e=t[86];let ve;t[87]!==L||t[88]!==D?(ve=e=>{e?D(!0):L()},t[87]=L,t[88]=D,t[89]=ve):ve=t[89];let ye;t[90]===n?ye=t[91]:(ye=t_(n),t[90]=n,t[91]=ye);let be;t[92]===ye?be=t[93]:(be=(0,Z.jsx)(jo,{children:ye}),t[92]=ye,t[93]=be);let xe;t[94]!==b||t[95]!==v||t[96]!==S||t[97]!==g?(xe={relative:g,absoluteTime:b,entrySha:S,authorName:v},t[94]=b,t[95]=v,t[96]=S,t[97]=g,t[98]=xe):xe=t[98];let Se;t[99]===Symbol.for(`react.memo_cache_sentinel`)?(Se={0:(0,Z.jsx)(`span`,{className:`font-medium text-foreground`}),1:(0,Z.jsx)(`span`,{className:`font-medium text-foreground`})},t[99]=Se):Se=t[99];let Ce;t[100]===xe?Ce=t[101]:(Ce=(0,Z.jsx)(ko,{children:(0,Z.jsx)(s,{id:`h6EvY-`,values:xe,components:Se})}),t[100]=xe,t[101]=Ce);let we;t[102]!==be||t[103]!==Ce?(we=(0,Z.jsxs)(Bo,{children:[be,Ce]}),t[102]=be,t[103]=Ce,t[104]=we):we=t[104];let Te;t[105]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,Z.jsx)(s,{id:`dEgA5A`}),t[105]=Te):Te=t[105];let Ee;t[106]===L?Ee=t[107]:(Ee=(0,Z.jsx)(Di,{variant:`outline`,"data-testid":`timeline-entry-restore-cancel`,onClick:L,children:Te}),t[106]=L,t[107]=Ee);let De;t[108]===z?De=t[109]:(De=()=>z(),t[108]=z,t[109]=De);let Oe;t[110]===O?Oe=t[111]:(Oe=O?(0,Z.jsx)(B,{className:`mr-2 size-4 animate-spin`}):null,t[110]=O,t[111]=Oe);let ke;t[112]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,Z.jsx)(s,{id:`yKu_3Y`}),t[112]=ke):ke=t[112];let Ae;t[113]!==O||t[114]!==De||t[115]!==Oe?(Ae=(0,Z.jsxs)(Di,{variant:`destructive`,"data-testid":`timeline-entry-restore-confirm`,disabled:O,onClick:De,children:[Oe,ke]}),t[113]=O,t[114]=De,t[115]=Oe,t[116]=Ae):Ae=t[116];let je;t[117]!==Ee||t[118]!==Ae?(je=(0,Z.jsxs)(Ro,{children:[Ee,Ae]}),t[117]=Ee,t[118]=Ae,t[119]=je):je=t[119];let Me;t[120]!==we||t[121]!==je?(Me=(0,Z.jsxs)(Fo,{children:[we,je]}),t[120]=we,t[121]=je,t[122]=Me):Me=t[122];let Ne;t[123]!==E||t[124]!==ve||t[125]!==Me?(Ne=(0,Z.jsx)(Vo,{open:E,onOpenChange:ve,children:Me}),t[123]=E,t[124]=ve,t[125]=Me,t[126]=Ne):Ne=t[126];let Pe;return t[127]!==_e||t[128]!==Ne?(Pe=(0,Z.jsxs)(Z.Fragment,{children:[_e,Ne]}),t[127]=_e,t[128]=Ne,t[129]=Pe):Pe=t[129],Pe}function c_(e){return e.docs}function l_(e){let t=(0,$.c)(87),{docName:n,diffLayout:r,onDiffLayoutChange:a,onSaveVersion:o,saving:c}=e,{_:l}=i(),{resolvedTheme:u}=pr(),d=u===`dark`,f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=[],t[0]=f):f=t[0];let[p,m]=(0,Q.useState)(f),[h,g]=(0,Q.useState)(!1),[_,v]=(0,Q.useState)(null),y=(0,Q.useRef)(null),[b]=(0,Q.useState)(p_),[x,S]=(0,Q.useState)(f_),C;t[1]===b?C=t[2]:(C=()=>{S(new Set),b.clear()},t[1]=b,t[2]=C);let w;t[3]===n?w=t[4]:(w=[n],t[3]=n,t[4]=w),(0,Q.useEffect)(C,w);let T;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(T=function(e){S(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[5]=T):T=t[5];let E=T,D;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(D=function(){S(new Set)},t[6]=D):D=t[6];let O=D,k,A;t[7]!==l||t[8]!==n?(k=()=>{if(!n){m([]);return}let e=!1,t=async function(){if(n)try{let t=await fetch(`/api/history?docName=${encodeURIComponent(n)}&limit=100`);if(e)return;if(!t.ok){v(l({id:`brCtGB`}));return}let r=await t.json();if(e)return;m(r.entries??[]),v(null)}catch(t){let n=t;if(e)return;v(l({id:`brCtGB`})),console.error(`[timeline]`,n)}};return g(!0),t().finally(()=>{e||g(!1)}),y.current=setInterval(t,1e4),()=>{e=!0,y.current&&clearInterval(y.current)}},A=[n,l],t[7]=l,t[8]=n,t[9]=k,t[10]=A):(k=t[9],A=t[10]),(0,Q.useEffect)(k,A);let j,M,N,P,F,I,L,R;if(t[11]!==l||t[12]!==b||t[13]!==r||t[14]!==n||t[15]!==p||t[16]!==_||t[17]!==x||t[18]!==d||t[19]!==h||t[20]!==a||t[21]!==o||t[22]!==c){let e=[],i=[],u=!1;for(let t of p)t.type===`checkpoint`?(i.length>0&&(e.push({kind:`wip-group`,entries:i,isPreCheckpoint:!u}),i=[]),e.push({kind:`checkpoint`,entry:t}),u=!0):i.push(t);i.length>0&&e.push({kind:`wip-group`,entries:i,isPreCheckpoint:!u});let f;t[31]===p?f=t[32]:(f=p.some(d_),t[31]=p,t[32]=f);let m=!f,g=!h&&!_&&p.length>0;F=`flex h-full flex-col`;let v;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(_n,{children:(0,Z.jsx)(s,{id:`cklVjM`})}),t[33]=v):v=t[33];let y;t[34]!==l||t[35]!==r||t[36]!==g||t[37]!==a?(y=g&&(0,Z.jsxs)(Kr,{children:[(0,Z.jsx)($n,{asChild:!0,children:(0,Z.jsxs)(Eo,{type:`single`,value:r,onValueChange:e=>{e&&a(e)},"aria-label":l({id:`XvPJaT`}),variant:`segmented`,size:`sm`,spacing:1,className:`bg-muted dark:bg-background p-0.5 rounded-md shrink-0`,children:[(0,Z.jsx)(Co,{value:`unified`,"aria-label":l({id:`379t2h`}),className:`size-6 px-0`,children:(0,Z.jsx)(Uc,{className:`size-3.5`})}),(0,Z.jsx)(Co,{value:`split`,"aria-label":l({id:`HXFyWD`}),className:`size-6 px-0`,children:(0,Z.jsx)(rc,{className:`size-3.5`})})]})}),(0,Z.jsx)(wn,{children:r===`unified`?(0,Z.jsx)(s,{id:`379t2h`}):(0,Z.jsx)(s,{id:`HXFyWD`})})]}),t[34]=l,t[35]=r,t[36]=g,t[37]=a,t[38]=y):y=t[38];let S;t[39]===l?S=t[40]:(S=l({id:`IrYrzq`}),t[39]=l,t[40]=S);let C;t[41]===c?C=t[42]:(C=c?(0,Z.jsx)(B,{className:`size-4 animate-spin`}):(0,Z.jsx)(Wc,{className:`size-4`}),t[41]=c,t[42]=C);let w;t[43]!==o||t[44]!==c||t[45]!==S||t[46]!==C?(w=(0,Z.jsx)($n,{asChild:!0,children:(0,Z.jsx)(Di,{variant:`ghost`,size:`icon-sm`,onClick:o,disabled:c,"aria-label":S,className:`text-muted-foreground`,"data-testid":`timeline-save-version`,children:C})}),t[43]=o,t[44]=c,t[45]=S,t[46]=C,t[47]=w):w=t[47];let T;t[48]===c?T=t[49]:(T=(0,Z.jsx)(wn,{children:c?(0,Z.jsx)(s,{id:`uF9ruK`}):(0,Z.jsx)(s,{id:`IrYrzq`})}),t[48]=c,t[49]=T);let D;t[50]!==w||t[51]!==T?(D=(0,Z.jsxs)(Kr,{children:[w,T]}),t[50]=w,t[51]=T,t[52]=D):D=t[52],t[53]!==y||t[54]!==D?(I=(0,Z.jsxs)(mn,{children:[v,(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[y,D]})]}),t[53]=y,t[54]=D,t[55]=I):I=t[55],L=`flex-1 overflow-y-auto subtle-scrollbar scroll-fade-mask`,t[56]!==l||t[57]!==h?(R=h&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,role:`status`,"aria-busy":`true`,"aria-label":l({id:`o49mDZ`}),children:[1,2,3].map(u_)}),t[56]=l,t[57]=h,t[58]=R):R=t[58],t[59]!==_||t[60]!==h?(j=!h&&_&&(0,Z.jsx)(`div`,{className:`px-4 py-3`,children:(0,Z.jsx)(`p`,{className:`text-xs text-destructive`,children:_})}),t[59]=_,t[60]=h,t[61]=j):j=t[61],t[62]!==p.length||t[63]!==_||t[64]!==h?(M=!h&&!_&&p.length===0&&(0,Z.jsx)(`div`,{className:`px-4 py-8 text-center`,children:(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(s,{id:`Ta25TG`})})}),t[62]=p.length,t[63]=_,t[64]=h,t[65]=M):M=t[65],t[66]!==b||t[67]!==r||t[68]!==n||t[69]!==p||t[70]!==_||t[71]!==x||t[72]!==m||t[73]!==d||t[74]!==h?(N=!h&&!_&&m&&p.length>0&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,children:p.map(e=>(0,Z.jsx)(s_,{entry:e,isDark:d,diffLayout:r,cache:b,docName:n,expanded:x.has(e.sha),onToggleExpanded:E,onRestoreSuccess:O},e.sha))}),t[66]=b,t[67]=r,t[68]=n,t[69]=p,t[70]=_,t[71]=x,t[72]=m,t[73]=d,t[74]=h,t[75]=N):N=t[75],P=!h&&!_&&!m&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,children:e.map((e,t)=>e.kind===`checkpoint`?(0,Z.jsx)(s_,{entry:e.entry,prominent:!0,isDark:d,diffLayout:r,cache:b,docName:n,expanded:x.has(e.entry.sha),onToggleExpanded:E,onRestoreSuccess:O},e.entry.sha):(0,Z.jsx)(Jg,{entries:e.entries,defaultExpanded:e.isPreCheckpoint,isDark:d,diffLayout:r,cache:b,docName:n,expandedShas:x,onToggleExpanded:E,onRestoreSuccess:O},e.entries[0]?.sha??`wip-${t}`))}),t[11]=l,t[12]=b,t[13]=r,t[14]=n,t[15]=p,t[16]=_,t[17]=x,t[18]=d,t[19]=h,t[20]=a,t[21]=o,t[22]=c,t[23]=j,t[24]=M,t[25]=N,t[26]=P,t[27]=F,t[28]=I,t[29]=L,t[30]=R}else j=t[23],M=t[24],N=t[25],P=t[26],F=t[27],I=t[28],L=t[29],R=t[30];let z;t[76]!==j||t[77]!==M||t[78]!==N||t[79]!==P||t[80]!==L||t[81]!==R?(z=(0,Z.jsxs)(`div`,{className:L,children:[R,j,M,N,P]}),t[76]=j,t[77]=M,t[78]=N,t[79]=P,t[80]=L,t[81]=R,t[82]=z):z=t[82];let V;return t[83]!==F||t[84]!==I||t[85]!==z?(V=(0,Z.jsxs)(`div`,{className:F,children:[I,z]}),t[83]=F,t[84]=I,t[85]=z,t[86]=V):V=t[86],V}function u_(e){return(0,Z.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-lg px-3 py-2.5`,children:[(0,Z.jsx)(Wa,{className:`size-3.5 rounded mt-0.5 shrink-0`}),(0,Z.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,Z.jsx)(Wa,{className:`h-3 w-28`}),(0,Z.jsx)(Wa,{className:`h-3 w-40`})]})]},e)}function d_(e){return e.type===`checkpoint`}function f_(){return new Set}function p_(){return new Pi(32)}var m_=[{id:`outline`,icon:Ec},{id:`links`,icon:ve},{id:`graph`,icon:kc},{id:`timeline`,icon:$s}];function h_(e){return e===`outline`?Y._({id:`dD7NPy`}):e===`links`?Y._({id:`Rj01Fz`}):e===`graph`?Y._({id:`x2fr_j`}):Y._({id:`cklVjM`})}function g_(){return n(()=>import(`./GraphPanel-DtgS21kH.js`),__vite__mapDeps([18,1,19,6,3,7,20,21,22,23,24,25,26,27,28,29,30,31]),import.meta.url)}var __=(0,Q.lazy)(async()=>({default:(await g_()).GraphPanel})),v_=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./ActivityModeContent-C4c01qOn.js`),__vite__mapDeps([32,1,2,33,34,35,20,36,37,38,39,19,6,3,7,4,10,9,40,41]),import.meta.url)).ActivityModeContent}));function y_(e){let t=(0,$.c)(16),{docName:n,isSourceMode:r,activeTab:a,onActiveTabChange:o,mode:c,onSaveVersion:l,saving:u}=e,{_:d}=i(),[f,p]=(0,Q.useState)(`unified`),m;t[0]!==d||t[1]!==a||t[2]!==c||t[3]!==o?(m=c===`doc`?(0,Z.jsx)(`div`,{className:`flex flex-row items-center justify-center gap-3 p-2`,children:(0,Z.jsx)(Eo,{type:`single`,variant:`outline`,value:a,onValueChange:e=>{e&&o(e)},"aria-label":d({id:`SrOuyg`}),children:m_.map(b_)})}):null,t[0]=d,t[1]=a,t[2]=c,t[3]=o,t[4]=m):m=t[4];let h;t[5]!==a||t[6]!==f||t[7]!==n||t[8]!==r||t[9]!==c||t[10]!==l||t[11]!==u?(h=c===`doc`?(0,Z.jsxs)(`div`,{role:`tabpanel`,id:`panel-${a}`,"aria-labelledby":`tab-${a}`,className:`min-h-0 flex-1`,children:[a===`outline`&&(0,Z.jsx)(Es,{docName:n,isSourceMode:r}),a===`links`&&(0,Z.jsx)(ug,{docName:n}),a===`graph`&&(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`-lCAuQ`})}),children:(0,Z.jsx)(__,{activeDocName:n})}),a===`timeline`&&(0,Z.jsx)(l_,{docName:n,diffLayout:f,onDiffLayoutChange:p,onSaveVersion:l,saving:u})]}):(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`div`,{role:`status`,"aria-busy":`true`,className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`ONPvOb`})}),children:(0,Z.jsx)(v_,{})})}),t[5]=a,t[6]=f,t[7]=n,t[8]=r,t[9]=c,t[10]=l,t[11]=u,t[12]=h):h=t[12];let g;return t[13]!==m||t[14]!==h?(g=(0,Z.jsxs)(Z.Fragment,{children:[m,h]}),t[13]=m,t[14]=h,t[15]=g):g=t[15],g}function b_(e){let{id:t,icon:n}=e,r=h_(t);return(0,Z.jsxs)(Kr,{children:[(0,Z.jsx)(Co,{value:t,role:`tab`,id:`tab-${t}`,"aria-controls":`panel-${t}`,"aria-label":r,asChild:!0,children:(0,Z.jsx)($n,{children:(0,Z.jsx)(n,{})})}),(0,Z.jsx)(wn,{side:`bottom`,children:r})]},t)}function x_(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function S_(e,t){let n=getComputedStyle(e.ownerDocument.body);return t*parseFloat(n.fontSize)}function C_(e){return e/100*window.innerHeight}function w_(e){return e/100*window.innerWidth}function T_(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function E_({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=T_(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=S_(t,i);break;case`em`:r=x_(t,i);break;case`vh`:r=C_(i);break;case`vw`:r=w_(i);break}return r}function D_(e){return parseFloat(e.toFixed(3))}function O_({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function k_(e){let{panels:t}=e,n=O_({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=D_(E_({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=D_(E_({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=D_(E_({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=D_(E_({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function A_(e,t=`Assertion error`){if(!e)throw Error(t)}function j_(e,t){return Array.from(t).sort(e===`horizontal`?M_:N_)}function M_(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function N_(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function P_(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function F_(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function I_({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=F_(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return A_(i,`No rect found`),i}var L_;function R_(){return L_===void 0&&(L_=typeof matchMedia==`function`?!!matchMedia(`(pointer:coarse)`).matches:!1),L_}function z_(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=j_(n,Array.from(t.children).filter(P_).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,I_({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p;break}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=R_()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:O_({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var B_=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0)if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},V_=new Map,H_=new B_;function U_(e){V_=new Map(V_),V_.delete(e)}function W_(e,t){for(let[t]of V_)if(t.id===e)return t}function G_(e,t){for(let[t,n]of V_)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function K_(){return V_}function q_(e,t){return H_.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function J_(e,t){let n=V_.get(e);V_=new Map(V_),V_.set(e,t),H_.emit(`groupChange`,{group:e,prev:n,next:t})}function Y_(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=F_(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t);break}}return r?{distance:i,hitRegion:r}:void 0}function X_(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Z_(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:rv(e),b:rv(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();A_(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:nv(tv(n.a)),b:nv(tv(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var Q_=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function $_(e){let t=getComputedStyle(iv(e)??e).display;return t===`flex`||t===`inline-flex`}function ev(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||$_(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||Q_.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function tv(e){let t=e.length;for(;t--;){let n=e[t];if(A_(n,`Missing node`),ev(n))return n}return null}function nv(e){return e&&Number(getComputedStyle(e).zIndex)||0}function rv(e){let t=[];for(;e;)t.push(e),e=iv(e);return t}function iv(e){let{parentNode:t}=e;return X_(t)?t.host:t}function av(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function ov({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!P_(n)||n.contains(e)||e.contains(n))return!0;if(Z_(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(av(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function sv(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=z_(r),a=Y_(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&ov({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function cv(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function lv(e,t,n=0){return Math.abs(D_(e)-D_(t))<=n}function uv(e,t){return lv(e,t)?0:e>t?1:-1}function dv({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(uv(r,c)<0)if(a){let e=(i+c)/2;r=uv(r,e)<0?i:c}else r=c;return r=Math.min(s,r),r=D_(r),r}function fv({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(lv(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;A_(u!=null,`Invalid first pivot index`),A_(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];A_(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(A_(n!=null,`Previous layout not found for panel index ${t}`),lv(n,i)){let t=o-n;uv(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];A_(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(A_(n!=null,`Previous layout not found for panel index ${t}`),lv(n,o)){let t=n-i;uv(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];A_(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&uv(i,c)<0)if(e>0){let t=c-o,n=t/2;uv(i+e,c)<0&&(e=uv(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;uv(i-e,c)<0&&(e=uv(100+e,n)>0?0:-t)}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];A_(e!=null,`Previous layout not found for panel index ${r}`);let a=dv({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];A_(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=dv({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!lv(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(cv(c,l))return i;{let t=e<0?d:u,r=s[t];A_(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=dv({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!lv(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];A_(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=dv({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(lv(i,s)||(t-=s-i,l[r]=s),lv(t,0))break;e>0?r--:r++}}}if(!lv(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function pv(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||uv(e[n],t[n])!==0)return!1;return!0}function mv({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!lv(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];A_(t!=null,`No layout data found for index ${e}`),r[e]=100/i*t}let a=0;for(let e=0;e<t.length;e++){let i=n[e];A_(i!=null,`No layout data found for index ${e}`);let o=r[e];A_(o!=null,`No layout data found for index ${e}`);let s=dv({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!lv(a,0))for(let e=0;e<t.length;e++){let n=r[e];A_(n!=null,`No layout data found for index ${e}`);let i=n+a,o=dv({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,lv(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function hv({groupId:e,panelId:t}){let n=()=>{let t=K_();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=e=>{let r=a();if(e===r)return;let{defaultLayoutDeferred:i,derivedPanelConstraints:o,group:s,groupSize:c,layout:l,separatorToPanels:u}=n(),d=s.panels.findIndex(e=>e.id===t),f=d===s.panels.length-1,p=mv({layout:fv({delta:f?r-e:e-r,initialLayout:l,panelConstraints:o,pivotIndices:f?[d-1,d]:[d,d+1],prevLayout:l,trigger:`imperative-api`}),panelConstraints:o});pv(l,p)||J_(s,{defaultLayoutDeferred:i,derivedPanelConstraints:o,groupSize:c,layout:p,separatorToPanels:u})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),s=a();e&&s!==t&&(n.expandToSize=s,o(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:s}=i(),c=a();if(e&&c===t){let e=s.expandToSize??n;e===0&&(e=1),o(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&lv(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=O_({group:t});o(D_(E_({groupSize:a,panelElement:r,styleProp:e})/a*100))}}}function gv(e){e.defaultPrevented||sv(e,K_()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=hv({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function _v(e){let t=K_();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function vv({groupId:e}){let t=()=>{let t=K_();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=mv({layout:e,panelConstraints:r});return n?o:(pv(o,c)||J_(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function yv(e,t){let n=_v(e),r=G_(n.id,!0),i=n.separators.find(t=>t.element===e);A_(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);A_(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=vv({groupId:n.id}).getLayout(),c=mv({layout:fv({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});pv(s,c)||J_(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels})}function bv(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=_v(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&yv(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&yv(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&yv(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&yv(t,-5);break;case`End`:e.preventDefault(),yv(t,100);break;case`Enter`:{e.preventDefault();let n=_v(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=G_(n.id,!0),o=n.separators.find(e=>e.element===t);A_(o,`Matching separator not found`);let s=a.get(o);A_(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(A_(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];yv(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=_v(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);A_(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),yv(t,-100);break}}var xv={cursorFlags:0,state:`inactive`},Sv=new B_;function Cv(){return xv}function wv(e){return Sv.addListener(`change`,e)}function Tv(e){let t=xv,n={...xv};n.cursorFlags=e,xv=n,Sv.emit(`change`,{prev:t,next:n})}function Ev(e){let t=xv;xv=e,Sv.emit(`change`,{prev:t,next:e})}function Dv(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=K_(),n=sv(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),Ev({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}var Ov=e=>e,kv=()=>{},Av=1,jv=2,Mv=4,Nv=8,Pv=3,Fv=12,Iv;function Lv(){return Iv===void 0&&(Iv=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(Iv=!0)),Iv}function Rv({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++;break}})}if(!(r===0&&i===0)){switch(n){case`active`:if(e&&Lv()){let t=(e&Av)!==0,n=(e&jv)!==0,r=(e&Mv)!==0,i=(e&Nv)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}break}return Lv()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var zv=new WeakMap;function Bv(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=zv.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));let r=Cv();switch(r.state){case`active`:case`hover`:{let e=Rv({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}zv.set(e,{prevStyle:t,styleSheet:n})}function Vv({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=fv({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(pv(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?Av:jv;break;case`vertical`:s|=d<0?Mv:Nv;break}}else J_(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&Pv:c|=s&Pv,t.movementY===0?c|=o&Fv:c|=s&Fv,Tv(c),Bv(e)}function Hv(e){let t=K_(),n=Cv();switch(n.state){case`active`:Vv({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function Uv(e){if(e.defaultPrevented)return;let t=Cv(),n=K_();switch(t.state){case`active`:if(e.buttons===0){Ev({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{let t=G_(e.group.id,!0);J_(e.group,t)});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.hasPointerCapture?.(e.pointerId)||t.setPointerCapture?.(e.pointerId)}Vv({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=sv(e,n);r.length===0?t.state!==`inactive`&&Ev({cursorFlags:0,state:`inactive`}):Ev({cursorFlags:0,hitRegions:r,state:`hover`}),Bv(e.currentTarget);break}}}function Wv(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(Cv().state){case`hover`:Ev({cursorFlags:0,state:`inactive`})}}function Gv(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=Cv();switch(t.state){case`active`:Ev({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(Bv(e.currentTarget),t.hitRegions.forEach(e=>{let t=G_(e.group.id,!0);J_(e.group,t)}),e.preventDefault())}}function Kv(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=D_(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=D_((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function qv(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=O_({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:D_(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function Jv(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Yv({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=D_(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e;break}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=D_((r[e]??0)/a*l);else{let e=D_(l/c.length);for(let t of c)u[t]=e}return u}function Xv(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var Zv=new Map;function Qv(e){let t=!0;A_(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=O_({group:e});if(t===0)return;let n=G_(e.id);if(!n)return;let r=k_(e),i=n.defaultLayoutDeferred?Kv(r):n.layout,a=mv({layout:Yv({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&pv(n.layout,a)&&Jv(n.derivedPanelConstraints,r)&&n.groupSize===t)return;J_(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else qv(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{A_(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=O_({group:e}),s=k_(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(Xv(e.panels,l)||(l=void 0));let u=mv({layout:e.mutableState.layouts[c]??l??Kv(s),panelConstraints:s}),d=e.element.ownerDocument;Zv.set(d,(Zv.get(d)??0)+1);let f=new Map;return z_(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),J_(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{A_(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,bv)}),Zv.get(d)===1&&(d.addEventListener(`dblclick`,gv,!0),d.addEventListener(`pointerdown`,Dv,!0),d.addEventListener(`pointerleave`,Hv),d.addEventListener(`pointermove`,Uv),d.addEventListener(`pointerout`,Wv),d.addEventListener(`pointerup`,Gv,!0)),function(){t=!1,Zv.set(d,Math.max(0,(Zv.get(d)??0)-1)),U_(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,bv)}),Zv.get(d)||(d.removeEventListener(`dblclick`,gv,!0),d.removeEventListener(`pointerdown`,Dv,!0),d.removeEventListener(`pointerleave`,Hv),d.removeEventListener(`pointermove`,Uv),d.removeEventListener(`pointerout`,Wv),d.removeEventListener(`pointerup`,Gv,!0)),a.disconnect()}}function $v(){let[e,t]=(0,Q.useState)({});return[e,(0,Q.useCallback)(()=>t({}),[])]}function ey(e){let t=(0,Q.useId)();return`${e??t}`}var ty=typeof window<`u`?Q.useLayoutEffect:Q.useEffect;function ny(e){let t=(0,Q.useRef)(e);return ty(()=>{t.current=e},[e]),(0,Q.useCallback)((...e)=>t.current?.(...e),[t])}function ry(...e){return ny(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function iy(e){let t=(0,Q.useRef)({...e});return ty(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var ay=(0,Q.createContext)(null);function oy(e,t){let n=(0,Q.useRef)({getLayout:()=>({}),setLayout:Ov});(0,Q.useImperativeHandle)(t,()=>n.current,[]),ty(()=>{Object.assign(n.current,vv({groupId:e}))})}function sy({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){let m=(0,Q.useRef)({onLayoutChange:{},onLayoutChanged:{}}),h=ny(e=>{pv(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=ny(e=>{pv(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e))}),_=ey(s),v=(0,Q.useRef)(null),[y,b]=$v(),x=(0,Q.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),S=ry(v,a);oy(_,o);let C=ny((e,t)=>{let r=Cv(),i=W_(e),a=G_(e);if(a){let e=!1;switch(r.state){case`active`:e=r.hitRegions.some(e=>e.group===i);break}return{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),w=iy({defaultLayout:n,disableCursor:r}),T=(0,Q.useMemo)(()=>({get disableCursor(){return!!w.disableCursor},getPanelStyles:C,id:_,orientation:u,registerPanel:e=>{let t=x.current;return t.panels=j_(u,[...t.panels,e]),b(),()=>{t.panels=t.panels.filter(t=>t!==e),b()}},registerSeparator:e=>{let t=x.current;return t.separators=j_(u,[...t.separators,e]),b(),()=>{t.separators=t.separators.filter(t=>t!==e),b()}},updatePanelProps:(e,{disabled:t})=>{let n=x.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=W_(_),i=G_(_);r&&i&&J_(r,{...i,derivedPanelConstraints:k_(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=x.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[C,_,b,u,w]),E=(0,Q.useRef)(null);return ty(()=>{let e=v.current;if(e===null)return;let t=x.current,n;if(w.defaultLayout!==void 0&&Object.keys(w.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=w.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:_,mutableState:{defaultLayout:n,disableCursor:!!w.disableCursor,expandedPanelSizes:x.current.lastExpandedPanelSizes,layouts:x.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};E.current=r;let a=Qv(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=G_(r.id,!0);!o&&s.length>0&&(h(c),g(c));let l=q_(_,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=lv(t.collapsedSize,i[t.panelId]),a=lv(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=Cv().state!==`active`;h(i),o&&g(i)});return()=>{E.current=null,a(),l()}},[i,_,g,h,u,y,w]),(0,Q.useEffect)(()=>{let e=E.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,Z.jsx)(ay.Provider,{value:T,children:(0,Z.jsx)(`div`,{...p,className:t,"data-group":!0,"data-testid":_,id:_,ref:S,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:e})})}sy.displayName=`Group`;function cy(){let e=(0,Q.useContext)(ay);return A_(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function ly(e,t){let{id:n}=cy(),r=(0,Q.useRef)({collapse:kv,expand:kv,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:kv});(0,Q.useImperativeHandle)(t,()=>r.current,[]),ty(()=>{Object.assign(r.current,hv({groupId:n,panelId:e}))})}function uy({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=ey(c),_=iy({disabled:a}),v=(0,Q.useRef)(null),y=ry(v,o),{getPanelStyles:b,id:x,orientation:S,registerPanel:C,updatePanelProps:w}=cy(),T=d!==null,E=ny((e,t,n)=>{d?.(e,c,n)});ty(()=>{let e=v.current;if(e!==null)return C({element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:T?E:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:_.disabled,maxSize:l,minSize:u}})},[s,n,r,i,T,g,h,l,u,E,C,_]),(0,Q.useEffect)(()=>{w(g,{disabled:a})},[a,g,w]),ly(g,f);let D=()=>{let e=b(x,g);if(e)return JSON.stringify(e)},O=(0,Q.useSyncExternalStore)(e=>q_(x,e),D,D),k;return k=O?JSON.parse(O):i?{flexGrow:void 0,flexShrink:void 0,flexBasis:i}:{flexGrow:1},(0,Z.jsx)(`div`,{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:y,style:{...dy,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...k},children:(0,Z.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...p,touchAction:S===`horizontal`?`pan-y`:`pan-x`},children:e})})}uy.displayName=`Panel`;var dy={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function fy(){return(0,Q.useRef)(null)}function py({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=mv({layout:fv({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=mv({layout:fv({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function my({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,style:o,...s}){let c=ey(a),l=iy({disabled:n,disableDoubleClick:r}),[u,d]=(0,Q.useState)({}),[f,p]=(0,Q.useState)(`inactive`),m=(0,Q.useRef)(null),h=ry(m,i),{disableCursor:g,id:_,orientation:v,registerSeparator:y,updateSeparatorProps:b}=cy(),x=v===`horizontal`?`vertical`:`horizontal`;ty(()=>{let e=m.current;if(e!==null){let t={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:e,id:c},n=y(t),r=wv(e=>{p(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=q_(_,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=a.indexOf(e);d(py({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[_,c,y,l]),(0,Q.useEffect)(()=>{b(c,{disabled:n,disableDoubleClick:r})},[n,r,c,b]);let S;return n&&!g&&(S=`not-allowed`),(0,Z.jsx)(`div`,{...s,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":x,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":n?`disabled`:f,"data-testid":c,id:c,ref:h,role:`separator`,style:{flexBasis:`auto`,cursor:S,...o,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}my.displayName=`Separator`;var hy={name:`toml`,startState:function(){return{inString:!1,stringType:``,lhs:!0,inArray:0}},token:function(e,t){let n;if(!t.inString&&(n=e.match(/^('''|"""|'|")/))&&(t.stringType=n[0],t.inString=!0),e.sol()&&!t.inString&&t.inArray===0&&(t.lhs=!0),t.inString){for(;t.inString;)if(e.match(t.stringType))t.inString=!1;else if(e.peek()===`\\`)e.next(),e.next();else if(e.eol())break;else e.match(/^.[^\\\"\']*/);return t.lhs?`property`:`string`}else if(t.inArray&&e.peek()===`]`)return e.next(),t.inArray--,`bracket`;else if(t.lhs&&e.peek()===`[`&&e.skipTo(`]`))return e.next(),e.peek()===`]`&&e.next(),`atom`;else if(e.peek()===`#`)return e.skipToEnd(),`comment`;else if(e.eatSpace())return null;else if(t.lhs&&e.eatWhile(function(e){return e!=`=`&&e!=` `}))return`property`;else if(t.lhs&&e.peek()===`=`)return e.next(),t.lhs=!1,null;else if(!t.lhs&&e.match(/^\d\d\d\d[\d\-\:\.T]*Z/))return`atom`;else if(!t.lhs&&(e.match(`true`)||e.match(`false`)))return`atom`;else if(!t.lhs&&e.peek()===`[`)return t.inArray++,e.next(),`bracket`;else if(!t.lhs&&e.match(/^\-?\d+(?:\.\d+)?/))return`number`;else e.eatSpace()||e.next();return null},languageData:{commentTokens:{line:`#`}}},gy=Rt({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),_y=_({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}});function vy(e){switch(e.toLowerCase()){case`json`:return Cs().language;case`toml`:return ys.define(hy);default:return null}}function yy(e){let t=(0,$.c)(5),{_:n}=i(),r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={status:`loading`},t[0]=r):r=t[0];let[a,o]=(0,Q.useState)(r),s,c;return t[1]!==n||t[2]!==e?(s=()=>{let t=!1,r=new AbortController;return o({status:`loading`}),fetch(e,{credentials:`same-origin`,signal:r.signal}).then(async e=>{if(!e.ok){let t=e.status;throw Error(n({id:`PauP7d`,values:{status:t}}))}return e.text()}).then(e=>{t||o({status:`loaded`,content:e})}).catch(e=>{t||e instanceof Error&&e.name===`AbortError`||o({status:`error`,message:e instanceof Error?e.message:n({id:`ig5vUe`})})}),()=>{t=!0,r.abort()}},c=[e,n],t[1]=n,t[2]=e,t[3]=s,t[4]=c):(s=t[3],c=t[4]),(0,Q.useEffect)(s,c),a}function by(e){let t=(0,$.c)(28),{src:n,fileName:r,extension:i}=e,a=(0,Q.useRef)(null),o=(0,Q.useRef)(null),{resolvedTheme:c}=pr(),l=yy(n),u=l.status===`loaded`?l.content:null,d,f;if(t[0]!==i||t[1]!==u||t[2]!==c?(d=()=>{if(!a.current||u===null)return;let e=vy(i),t=c===`dark`?gy:_y,n=[Ds,...e?[e]:[],hs.editable.of(!1),as.readOnly.of(!0),hs.lineWrapping,t],r=new hs({state:as.create({doc:u,extensions:n}),parent:a.current});return o.current=r,()=>{r.destroy(),o.current=null}},f=[u,i,c],t[0]=i,t[1]=u,t[2]=c,t[3]=d,t[4]=f):(d=t[3],f=t[4]),(0,Q.useEffect)(d,f),l.status===`loading`){let e;t[5]===r?e=t[6]:(e=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`Md709y`,values:{fileName:r}})}),t[5]=r,t[6]=e);let n;return t[7]!==i||t[8]!==r||t[9]!==e?(n=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center bg-background text-muted-foreground text-sm`,"aria-label":r,"data-text-viewer":``,"data-text-viewer-state":`loading`,"data-text-viewer-extension":i,children:e}),t[7]=i,t[8]=r,t[9]=e,t[10]=n):n=t[10],n}if(l.status===`error`){let e;t[11]===r?e=t[12]:(e=(0,Z.jsx)(`div`,{className:`font-medium text-sm`,children:(0,Z.jsx)(s,{id:`qdBUHP`,values:{fileName:r}})}),t[11]=r,t[12]=e);let a;t[13]===l.message?a=t[14]:(a=(0,Z.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:l.message}),t[13]=l.message,t[14]=a);let o;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(s,{id:`9npOH9`}),t[15]=o):o=t[15];let c;t[16]===n?c=t[17]:(c=(0,Z.jsx)(`a`,{href:n,className:`mt-2 rounded-md border px-3 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground`,children:o}),t[16]=n,t[17]=c);let u;return t[18]!==i||t[19]!==r||t[20]!==e||t[21]!==a||t[22]!==c?(u=(0,Z.jsxs)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center gap-2 bg-background p-4 text-center`,"aria-label":r,"data-text-viewer":``,"data-text-viewer-state":`error`,"data-text-viewer-extension":i,children:[e,a,c]}),t[18]=i,t[19]=r,t[20]=e,t[21]=a,t[22]=c,t[23]=u):u=t[23],u}let p;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(`div`,{ref:a,className:`min-h-0 flex-1 overflow-auto`}),t[24]=p):p=t[24];let m;return t[25]!==i||t[26]!==r?(m=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":r,"data-text-viewer":``,"data-text-viewer-state":`loaded`,"data-text-viewer-extension":i,children:p}),t[25]=i,t[26]=r,t[27]=m):m=t[27],m}function xy(e){return ir(`/api/asset?path=${encodeURIComponent(e)}`)}function Sy(e){return`/api/asset-text?path=${encodeURIComponent(e)}`}function Cy(e){let t=(0,$.c)(28),{assetPath:n,mediaKind:r}=e,[i,a]=(0,Q.useState)(!1),o;t[0]===n?o=t[1]:(o=xy(n),t[0]=n,t[1]=o);let c=o,u;t[2]===n?u=t[3]:(u=n.split(`/`).pop()??n,t[2]=n,t[3]=u);let d=u,f,p,m;if(t[4]!==n||t[5]!==d||t[6]!==i||t[7]!==r||t[8]!==c){m=Symbol.for(`react.early_return_sentinel`);bb0:{let e=d.includes(`.`)?d.split(`.`).pop()??``:``;if(p=e.length>0?e.toUpperCase():`FILE`,f=i?`text`:r,f===`pdf`){let e;t[12]!==d||t[13]!==c?(e=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,Z.jsx)(l,{src:c,title:d,fillContainer:!0})}),t[12]=d,t[13]=c,t[14]=e):e=t[14];let n;t[15]!==d||t[16]!==e?(n=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":d,children:e}),t[15]=d,t[16]=e,t[17]=n):n=t[17],m=n;break bb0}if(f===`text`){let r;t[18]===n?r=t[19]:(r=Sy(n),t[18]=n,t[19]=r),m=(0,Z.jsx)(by,{src:r,fileName:d,extension:e.toLowerCase()},n);break bb0}}t[4]=n,t[5]=d,t[6]=i,t[7]=r,t[8]=c,t[9]=f,t[10]=p,t[11]=m}else f=t[9],p=t[10],m=t[11];if(m!==Symbol.for(`react.early_return_sentinel`))return m;let h;t[20]!==f||t[21]!==p||t[22]!==d||t[23]!==c?(h=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto p-4`,children:f===`image`?(0,Z.jsx)(jt,{src:c,alt:d,draggable:!1,slotClassName:`flex h-full w-full items-center justify-center`,className:`max-h-full max-w-full`}):f===`video`?(0,Z.jsx)(`video`,{src:c,controls:!0,className:`max-h-full max-w-full`}):f===`audio`?(0,Z.jsx)(`audio`,{src:c,controls:!0,className:`w-full max-w-md`}):(0,Z.jsxs)(`div`,{className:`flex max-w-sm flex-col items-center gap-3 text-center`,children:[(0,Z.jsx)(`div`,{className:`flex size-16 items-center justify-center rounded-md border bg-muted font-medium text-muted-foreground text-sm`,children:p}),(0,Z.jsx)(`div`,{className:`max-w-full break-words font-medium text-sm`,children:d}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[(0,Z.jsx)(Di,{asChild:!0,variant:`outline`,size:`sm`,children:(0,Z.jsx)(`a`,{href:c,children:(0,Z.jsx)(s,{id:`9npOH9`})})}),(0,Z.jsx)(Di,{variant:`outline`,size:`sm`,onClick:()=>a(!0),"data-testid":`asset-preview-open-as-text`,children:(0,Z.jsx)(s,{id:`Ruuu3v`})})]})]})}),t[20]=f,t[21]=p,t[22]=d,t[23]=c,t[24]=h):h=t[24];let g;return t[25]!==d||t[26]!==h?(g=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":d,children:h}),t[25]=d,t[26]=h,t[27]=g):g=t[27],g}function wy(){let e=(0,$.c)(5),{_:t}=i(),n;e[0]===t?n=e[1]:(n=t({id:`3VsNTI`}),e[0]=t,e[1]=n);let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(Wa,{className:`h-9 w-2/5 mt-6 mb-5`}),(0,Z.jsx)(Wa,{className:`h-4 w-full`}),(0,Z.jsx)(Wa,{className:`h-4 w-3/4`})]}),e[2]=r):r=e[2];let a;return e[3]===n?a=e[4]:(a=(0,Z.jsx)(`div`,{className:`tiptap-editor pt-10`,role:`status`,"aria-busy":`true`,"aria-label":n,children:r}),e[3]=n,e[4]=a),a}var Ty={"claude-cowork":`claude`,"claude-code":`claude`,codex:`openai`,cursor:`cursor`};function Ey(e){let t=(0,$.c)(23),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({id:r,style:a,className:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let{resolvedTheme:o}=pr(),s=Ty[r],c=s?(o===`dark`?or[s]:void 0)??wr[s]:void 0,l;t[5]!==c||t[6]!==a?(l=c?{...a,"--ok-brand-color":c}:a,t[5]=c,t[6]=a,t[7]=l):l=t[7];let u=l,d=c&&`[&_*]:![color:var(--ok-brand-color)]`,f;t[8]!==n||t[9]!==d?(f=X(d,n),t[8]=n,t[9]=d,t[10]=f):f=t[10];let p=f;if(r===`claude-cowork`||r===`claude-code`){let e;return t[11]!==p||t[12]!==u||t[13]!==i?(e=(0,Z.jsx)(Mi,{style:u,className:p,...i}),t[11]=p,t[12]=u,t[13]=i,t[14]=e):e=t[14],e}if(r===`codex`){let e;return t[15]!==p||t[16]!==u||t[17]!==i?(e=(0,Z.jsx)(ji,{style:u,className:p,...i}),t[15]=p,t[16]=u,t[17]=i,t[18]=e):e=t[18],e}if(r===`cursor`){let e;return t[19]!==p||t[20]!==u||t[21]!==i?(e=(0,Z.jsx)(Ri,{style:u,className:p,...i}),t[19]=p,t[20]=u,t[21]=i,t[22]=e):e=t[22],e}return null}function Dy(e){let{installState:t}=e;return t.installed===null?Y._({id:`IA6JW2`}):t.installed===!1?Y._({id:`5SwVv1`}):null}function Oy(e){let{target:t,installState:n}=e;if(n.installed===null)return{enabled:!1,tooltip:null};if(n.installed===!1){let e=t.appBrandName??t.displayName;return{enabled:!1,tooltip:{message:Y._({id:`OJTOUj`,values:{brand:e}}),installAction:{label:Y._({id:`fG0X0e`,values:{brand:e}}),url:t.installUrl},...t.hasWebFallback?{webFallback:{label:Y._({id:`0S9PW_`}),url:``}}:{}}}}return{enabled:!0,tooltip:null}}function ky(e){return Lr(e)}function Ay(e){return Y._({id:`h_HYHD`,values:{displayName:e}})}var jy=`claude.ai`;async function My(e,t=Wm){(await t(Lr(e))).ok?Uo.success(Ay(jy)):Uo.error(Y._({id:`9NC_MT`,values:{CLAUDE_WEB_FALLBACK_LABEL:jy}}))}function Ny(e){let t=(0,$.c)(68),{_:n}=i(),{target:r,installState:a,isElectronHost:o,prompt:s,onSelect:c}=e,l=e.openExternal??Wm,u=e.onWebFallbackSuccess??Fy,d=e.onWebFallbackError??Py,{displayName:f}=r,p,m,h,g,_,v,y,b,x,S;if(t[0]!==n||t[1]!==a||t[2]!==o||t[3]!==c||t[4]!==d||t[5]!==u||t[6]!==l||t[7]!==s||t[8]!==r||t[9]!==f){S=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Oy({target:r,installState:a,isElectronHost:o}),i=Dy({target:r,installState:a,isElectronHost:o}),C=()=>{e.tooltip&&l(e.tooltip.installAction.url)},w;t[20]!==d||t[21]!==u||t[22]!==l||t[23]!==s||t[24]!==r?(w=()=>{(async()=>{let e=await l(ky(s));e.ok?u(r):d(r,e.detail??e.reason)})()},t[20]=d,t[21]=u,t[22]=l,t[23]=s,t[24]=r,t[25]=w):w=t[25];let T=w;if(e.enabled){let e=`open-in-agent-item-${r.id}`,i;t[26]!==n||t[27]!==f?(i=n({id:`NnQapF`,values:{targetDisplayName:f}}),t[26]=n,t[27]=f,t[28]=i):i=t[28];let a;t[29]===r.id?a=t[30]:(a=(0,Z.jsx)(Ey,{id:r.id,"aria-hidden":`true`}),t[29]=r.id,t[30]=a);let o;t[31]===r.displayName?o=t[32]:(o=(0,Z.jsx)(`span`,{children:r.displayName}),t[31]=r.displayName,t[32]=o);let s;t[33]!==c||t[34]!==i||t[35]!==a||t[36]!==o||t[37]!==e?(s=(0,Z.jsxs)(ca,{onSelect:c,"data-testid":e,"aria-label":i,children:[a,o]}),t[33]=c,t[34]=i,t[35]=a,t[36]=o,t[37]=e,t[38]=s):s=t[38],S=s;break bb0}if(!e.tooltip){let e=n(i?{id:`If0crP`,values:{targetDisplayName:f,hint:i}}:{id:`NnQapF`,values:{targetDisplayName:f}}),a;t[39]===r.id?a=t[40]:(a=(0,Z.jsx)(Ey,{id:r.id,"aria-hidden":`true`}),t[39]=r.id,t[40]=a);let o;t[41]===r.displayName?o=t[42]:(o=(0,Z.jsx)(`span`,{className:`flex-1`,children:r.displayName}),t[41]=r.displayName,t[42]=o),S=(0,Z.jsxs)(ca,{disabled:!0,"data-testid":`open-in-agent-item-${r.id}`,"aria-label":e,children:[a,o,i?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:i}):null]});break bb0}let E=n(i?{id:`If0crP`,values:{targetDisplayName:f,hint:i}}:{id:`NnQapF`,values:{targetDisplayName:f}}),D=e.tooltip.webFallback?.label??``;m=ka;let O=`open-in-agent-item-${r.id}`,k;t[43]===r.id?k=t[44]:(k=(0,Z.jsx)(Ey,{id:r.id,"aria-hidden":`true`,className:`mr-2`}),t[43]=r.id,t[44]=k);let A;t[45]===r.displayName?A=t[46]:(A=(0,Z.jsx)(`span`,{className:`flex-1`,children:r.displayName}),t[45]=r.displayName,t[46]=A);let j;t[47]===i?j=t[48]:(j=i?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:i}):null,t[47]=i,t[48]=j),t[49]!==E||t[50]!==k||t[51]!==A||t[52]!==j||t[53]!==O?(x=(0,Z.jsxs)(Aa,{"data-testid":O,"data-row-disabled":``,"aria-label":E,children:[k,A,j]}),t[49]=E,t[50]=k,t[51]=A,t[52]=j,t[53]=O,t[54]=x):x=t[54],p=Oa,h=`min-w-[260px]`,g=`open-in-agent-submenu-${r.id}`,_=(0,Z.jsx)(io,{className:`font-normal text-muted-foreground text-xs`,"data-testid":`open-in-agent-message-${r.id}`,children:e.tooltip.message}),t[55]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(sa,{}),t[55]=v):v=t[55],y=(0,Z.jsx)(ca,{onSelect:C,"data-testid":`open-in-agent-install-${r.id}`,children:(0,Z.jsx)(`span`,{children:e.tooltip.installAction.label})}),b=e.tooltip.webFallback?(0,Z.jsxs)(ca,{onSelect:T,"data-testid":`open-in-agent-web-fallback-${r.id}`,"aria-label":n({id:`lsOFZR`,values:{webFallbackLabel:D}}),children:[(0,Z.jsx)(`span`,{className:`flex-1`,children:e.tooltip.webFallback.label}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:n({id:`Z9BoIy`})})]}):null}t[0]=n,t[1]=a,t[2]=o,t[3]=c,t[4]=d,t[5]=u,t[6]=l,t[7]=s,t[8]=r,t[9]=f,t[10]=p,t[11]=m,t[12]=h,t[13]=g,t[14]=_,t[15]=v,t[16]=y,t[17]=b,t[18]=x,t[19]=S}else p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15],y=t[16],b=t[17],x=t[18],S=t[19];if(S!==Symbol.for(`react.early_return_sentinel`))return S;let C;t[56]!==p||t[57]!==h||t[58]!==g||t[59]!==_||t[60]!==v||t[61]!==y||t[62]!==b?(C=(0,Z.jsxs)(p,{className:h,"data-testid":g,children:[_,v,y,b]}),t[56]=p,t[57]=h,t[58]=g,t[59]=_,t[60]=v,t[61]=y,t[62]=b,t[63]=C):C=t[63];let w;return t[64]!==m||t[65]!==x||t[66]!==C?(w=(0,Z.jsxs)(m,{children:[x,C]}),t[64]=m,t[65]=x,t[66]=C,t[67]=w):w=t[67],w}function Py(){}function Fy(){}function Iy(e){let t=(0,$.c)(12),{className:n}=e,{states:r,refresh:i}=yh(),{dispatch:a}=ch(),o=Pa(),s,c;if(t[0]!==n||t[1]!==a||t[2]!==i||t[3]!==r||t[4]!==o){let e=Xm({workspace:o});t[7]===n?s=t[8]:(s=X(`grid w-full max-w-5xl gap-4 sm:grid-cols-3`,n),t[7]=n,t[8]=s),c=_m.map(t=>{let n=r[t.id]?.installed,o=n===!0?`installed`:n===!1?`missing`:`pending`;return(0,Z.jsx)(Ly,{target:t,status:o,onOpen:o===`installed`&&e!==null?()=>{a(t.id,e)}:void 0,onInstall:()=>{Qm(t),i()}},t.id)}),t[0]=n,t[1]=a,t[2]=i,t[3]=r,t[4]=o,t[5]=s,t[6]=c}else s=t[5],c=t[6];let l;return t[9]!==s||t[10]!==c?(l=(0,Z.jsx)(`div`,{className:s,children:c}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function Ly(e){let t=(0,$.c)(22),{target:n,status:r,onOpen:i,onInstall:a}=e,o=r===`installed`?i:r===`missing`?a:void 0,s=r===`pending`||r===`installed`&&i===void 0,c=r===`installed`?`Open`:r===`missing`?`Install`:`Checking`,l;t[0]===n.id?l=t[1]:(l=(0,Z.jsx)(Ey,{id:n.id,"aria-hidden":`true`,className:`size-4`}),t[0]=n.id,t[1]=l);let u;t[2]===n.displayName?u=t[3]:(u=(0,Z.jsx)(`h3`,{className:`text-sm font-medium leading-tight`,children:n.displayName}),t[2]=n.displayName,t[3]=u);let d;t[4]!==l||t[5]!==u?(d=(0,Z.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-start sm:items-center gap-2`,children:[l,u]}),t[4]=l,t[5]=u,t[6]=d):d=t[6];let f;t[7]===n.tagline?f=t[8]:(f=n.tagline?(0,Z.jsx)(`p`,{className:`text-1sm leading-relaxed text-muted-foreground`,children:n.tagline}):null,t[7]=n.tagline,t[8]=f);let p;t[9]!==d||t[10]!==f?(p=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[d,f]}),t[9]=d,t[10]=f,t[11]=p):p=t[11];let m;t[12]===r?m=t[13]:(m=r===`missing`?(0,Z.jsx)(To,{"aria-hidden":`true`,className:`size-3`}):null,t[12]=r,t[13]=m);let h;t[14]!==c||t[15]!==m?(h=(0,Z.jsxs)(`p`,{className:`mt-auto inline-flex items-center gap-1 pt-2 font-mono text-2xs uppercase tracking-wider text-muted-foreground`,children:[c,m]}),t[14]=c,t[15]=m,t[16]=h):h=t[16];let g;return t[17]!==s||t[18]!==o||t[19]!==p||t[20]!==h?(g=(0,Z.jsxs)(`button`,{type:`button`,onClick:o,disabled:s,className:`group flex h-full flex-col items-start gap-4 rounded-2xl border border-border/60 bg-card p-5 text-left transition-[border-color,box-shadow,transform] hover:border-border hover:shadow-sm focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:cursor-not-allowed disabled:opacity-60`,children:[p,h]}),t[17]=s,t[18]=o,t[19]=p,t[20]=h,t[21]=g):g=t[21],g}var Ry=3100,zy=3;function By(e,t,n){let r=n?.windowMs??600,i=n?.maxLevel??zy;if(e===0||t>=r)return 1;let a=e+1;return a>i?i:a}var Vy={0:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},1:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},2:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},3:{count:16,startRadius:11,baseDistance:7,distanceVariance:3,sizeMin:.45,sizeMax:1.2,maxDelay:500,durationMin:1100,durationMax:2400}},Hy=[`var(--color-azure-blue)`,`var(--color-sky-blue)`,`var(--color-violet-300)`,`var(--color-orange-light)`,`var(--color-crystal-blue)`,`var(--color-white-cream)`];function Uy(e,t={}){let n=t.rng??Math.random,r=t.colors??Hy,i=Vy[e];if(i.count===0||r.length===0)return[];let a=[],o=Math.PI*2/i.count;for(let e=0;e<i.count;e++){let t=e*o+(n()-.5)*o*.7,s=i.baseDistance+(n()-.5)*2*i.distanceVariance,c=i.sizeMin+n()*(i.sizeMax-i.sizeMin),l=n()*i.maxDelay,u=i.durationMin+n()*(i.durationMax-i.durationMin),d=Math.floor(n()*r.length),f=Math.cos(t),p=Math.sin(t);a.push({id:e,dx:f*s,dy:p*s,originDx:f*i.startRadius,originDy:p*i.startRadius,size:c,color:r[d]??`currentColor`,delay:l,duration:u})}return a}var Wy=1.8,Gy=90,Ky=16,qy=380,Jy=.025,Yy=.1,Xy=.18,Zy=400,Qy=9.2736,$y=18.1799,eb=14.5244,tb={1:{halfWidth:1.5,apexLift:2.2},2:{halfWidth:1.4,apexLift:2.6},3:{halfWidth:1.25,apexLift:3}};function nb(e,t){let{halfWidth:n,apexLift:r}=tb[t];return`M${e-n} ${eb+.3} Q${e} ${eb-r}, ${e+n} ${eb+.3}`}function rb(e){let t=1.5,n=.3;return`M${e-t} ${eb-n} Q${e} ${eb+1.4}, ${e+t} ${eb-n}`}var ib=15,ab=15;function ob(e){return{fill:e.color,"--fx-tx":`${e.dx}px`,"--fx-ty":`${e.dy}px`,"--fx-delay":`${e.delay}ms`,"--fx-duration":`${e.duration}ms`}}function sb(e){let t=(0,$.c)(71),{size:n,className:r,trackMouse:i,variant:a,celebrateSignal:o}=e,s=n===void 0?48:n,c=i===void 0?!0:i,l=a===void 0?`default`:a,u=o===void 0?0:o,d=(0,Q.useRef)(null),f=(0,Q.useRef)(null),p=(0,Q.useRef)(null),m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m={x:0,y:0},t[0]=m):m=t[0];let h=(0,Q.useRef)(m),[g,_]=(0,Q.useState)(0),[v,y]=(0,Q.useState)(0),b;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(b=[],t[1]=b):b=t[1];let[x,S]=(0,Q.useState)(b),C=(0,Q.useRef)(0),w=(0,Q.useRef)(void 0),T=l===`sleeping`,E;t[2]!==g||t[3]!==T?(E=function(){if(T)return;let e=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),t=C.current===0?1/0:e-C.current;C.current=e;let n=By(g,t);_(n),y(db),S(Uy(n)),clearTimeout(w.current),w.current=setTimeout(()=>{_(0),S([])},Ry)},t[2]=g,t[3]=T,t[4]=E):E=t[4];let D=E,O,k;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>()=>clearTimeout(w.current),k=[],t[5]=O,t[6]=k):(O=t[5],k=t[6]),(0,Q.useEffect)(O,k);let A,j;t[7]!==u||t[8]!==T?(A=()=>{u===0||T||(_(3),y(ub),S(Uy(3)),clearTimeout(w.current),w.current=setTimeout(()=>{_(0),S([])},Ry))},j=[u,T],t[7]=u,t[8]=T,t[9]=A,t[10]=j):(A=t[9],j=t[10]),(0,Q.useEffect)(A,j);let M,N;t[11]!==T||t[12]!==c?(M=()=>{if(!c||T||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let e=0,t=0,n=!1,r=0,i=0,a=0,o=0,s=0,l=function(){s===0&&(s=requestAnimationFrame(m))},u=function(r){e=r.clientX,t=r.clientY,n=!0,l()};function m(){s=0;let c=f.current,u=d.current;if(!c||!u){l();return}let m=n;n=!1;let g=c.getBoundingClientRect(),_=g.left+g.width/2,v=g.top+g.height*.48,y=e-_,b=t-v,x=Math.hypot(y,b),S=Math.max(-1,Math.min(1,y/qy)),C=Math.max(-1,Math.min(1,b/qy)),w=S*Ky,T=-C*Ky,E=0,D=0;if(x>=1){let e=Math.min(x/Gy,1)*Wy;E=y/x*e,D=b/x*e}let O=Math.abs(T-r)<.01&&Math.abs(w-i)<.01&&Math.abs(E-a)<.01&&Math.abs(D-o)<.01;if(!m&&O)return;l(),r+=(T-r)*Yy,i+=(w-i)*Yy,u.style.transform=`perspective(${Zy}px) rotateX(${r.toFixed(3)}deg) rotateY(${i.toFixed(3)}deg)`,a+=(E-a)*Xy,o+=(D-o)*Xy;let k=i*Jy,A=-r*Jy,j=a+k,M=o+A;h.current.x=j,h.current.y=M,p.current?.setAttribute(`transform`,`translate(${j.toFixed(3)} ${M.toFixed(3)})`)}return document.addEventListener(`mousemove`,u,{passive:!0}),l(),()=>{document.removeEventListener(`mousemove`,u),s!==0&&cancelAnimationFrame(s),s=0,d.current&&(d.current.style.transform=``),h.current={x:0,y:0},p.current?.removeAttribute(`transform`)}},N=[c,T],t[11]=T,t[12]=c,t[13]=M,t[14]=N):(M=t[13],N=t[14]),(0,Q.useEffect)(M,N);let P;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(P=()=>{let e=p.current;if(!e)return;let{x:t,y:n}=h.current;e.setAttribute(`transform`,`translate(${t.toFixed(3)} ${n.toFixed(3)})`)},t[15]=P):P=t[15],(0,Q.useLayoutEffect)(P);let F=g>0,I=F?g:1,L=F?`ok-blob-clicked-${g}`:null,R;t[16]===r?R=t[17]:(R=X(`ok-blob-3d-wrapper`,r),t[16]=r,t[17]=R);let z=T?`cursor-default`:`cursor-pointer`,B=`body-${v}`,V=T&&`ok-blob-sleeping`,H;t[18]!==L||t[19]!==V?(H=X(`ok-blob-group`,V,L),t[18]=L,t[19]=V,t[20]=H):H=t[20];let U;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(`path`,{d:`M25.2339 6.78134C25.5199 7.35734 25.8179 8.47234 26.0179 9.07834C26.0189 9.08234 26.0209 9.08634 26.0219 9.09134C26.0229 9.09534 26.0249 9.10034 26.0259 9.10434C26.0539 9.19734 26.0949 9.29533 26.1519 9.41633C26.2919 9.71133 26.5269 10.1173 27.1299 11.1683C27.3259 11.4643 27.5209 11.7693 27.7119 12.0903C29.9739 15.1623 29.3259 20.1913 27.0469 22.9153C26.7779 23.2953 26.4869 23.6043 26.1889 23.8863C26.1519 23.9253 26.1129 23.9643 26.0729 24.0033C25.3159 24.7543 24.2949 25.4673 23.6129 25.8323C22.7469 26.2983 22.1349 26.5483 21.6299 26.7463C20.3649 27.3063 19.0609 27.7733 17.6569 28.0423C15.9649 28.3513 14.1939 28.4433 12.4569 28.1373C11.4779 27.9663 10.5119 27.6663 9.60891 27.2493C8.77491 26.8663 7.99192 26.3853 7.26992 25.8403C6.83592 25.5393 6.43893 25.2343 6.08093 24.9383C5.57893 24.5223 5.15993 24.1263 4.83493 23.7793C4.04993 22.9443 3.31593 21.8893 2.80893 21.0953C2.72593 20.9663 2.64792 20.8433 2.57592 20.7293C2.56192 20.7093 2.54793 20.6893 2.53393 20.6703C2.08593 20.0263 1.71892 19.3293 1.43792 18.5993C1.42892 18.5453 1.42093 18.4903 1.41293 18.4353C1.32093 17.7443 1.08292 16.9423 1.01092 15.6333C0.984921 15.0653 0.998928 14.4013 1.12393 13.6353C1.20693 13.1413 1.31993 12.9023 1.40893 12.7113C1.43593 12.6543 1.46193 12.6023 1.48593 12.5483C1.56793 12.3653 1.59392 12.1563 1.63592 11.9083C1.68992 11.5883 1.76992 11.1943 2.04592 10.7553C2.94392 9.37934 3.36792 8.81934 3.66592 8.33934C3.75592 8.20334 3.84292 8.08134 3.94192 7.96634C4.21592 7.64634 4.67693 7.29534 5.10293 7.05734C5.16693 7.02234 5.23093 6.98834 5.29193 6.95534C5.62993 6.77834 6.22592 6.30135 6.66992 5.92035C6.83692 5.77635 7.08193 5.60735 7.37393 5.40935C7.67393 5.20535 8.02593 4.96934 8.39193 4.70234C9.32093 4.02634 9.84091 3.69134 10.2599 3.42334C10.3799 3.34734 10.4919 3.27734 10.6049 3.20834C10.9609 2.98834 11.4149 2.73034 11.8869 2.48634C12.4519 2.19334 13.0469 1.92133 13.5089 1.72233C14.7399 1.30233 16.0539 1.01333 17.4169 1.00033C18.1169 0.991333 18.7939 1.16534 19.2389 1.43034C19.6869 1.69534 19.8689 2.00335 19.8039 2.23935C19.7379 2.47835 19.4399 2.63634 19.0109 2.74734C18.5789 2.85634 18.0469 2.92035 17.4889 2.96135C16.3639 3.04235 15.2399 3.36435 14.1499 3.80835C12.8199 4.35135 11.5379 5.07133 10.2719 5.84733C9.38691 6.39133 8.51192 6.97334 7.63592 7.56834C7.54492 7.63034 7.45492 7.69135 7.36492 7.75235C6.97392 8.06635 6.58293 8.38134 6.22293 8.66334C5.97893 8.85734 5.76793 9.04834 5.59393 9.21434C5.26893 9.52334 5.02393 9.74334 4.81893 9.93934C4.67793 10.0753 4.55793 10.2013 4.45593 10.3443C4.40093 10.4213 4.32992 10.5273 4.24792 10.6593C3.90492 11.1933 3.44493 12.1693 3.15393 13.1173C3.01893 13.5363 2.87991 14.0343 2.79391 14.5253C2.66591 15.2253 2.65594 15.9053 2.71994 16.2373C2.82794 16.8193 2.95593 17.4833 3.14093 18.0553C3.31293 18.6003 3.52991 19.0583 3.70791 19.2823C3.81591 19.4183 3.90394 19.5473 3.99594 19.6913C4.09394 19.8413 4.19191 20.0073 4.31091 20.2033C4.47891 20.4803 4.68592 20.8163 5.00192 21.2493C5.36492 21.7463 5.61793 22.1043 5.83493 22.4023C6.14493 22.8243 6.38591 23.1343 6.83691 23.5033C7.33891 23.9113 7.86593 24.3113 8.26693 24.6393C8.44893 24.7883 8.66993 24.9443 8.90493 25.0963C9.21593 25.2963 9.55192 25.4893 9.85592 25.6703C10.1059 25.8203 10.3059 25.9633 10.4869 26.0863C10.5429 26.1243 10.5979 26.1603 10.6519 26.1943C10.8699 26.2803 11.0929 26.3593 11.3159 26.4283C11.3539 26.4323 11.3949 26.4353 11.4369 26.4393C11.6509 26.4573 11.9089 26.4733 12.2209 26.5133C12.7169 26.5753 13.1399 26.6603 13.6019 26.7243C13.9589 26.7733 14.3409 26.8083 14.7729 26.7893C15.0729 26.7753 15.4069 26.7353 15.7389 26.6813C16.2349 26.6023 16.7179 26.4943 17.0569 26.4473C17.1499 26.4343 17.2359 26.4343 17.3209 26.4373C17.3489 26.4393 17.3799 26.4413 17.4109 26.4433C17.4119 26.4433 17.4119 26.4433 17.4129 26.4433C17.4199 26.4433 17.4279 26.4443 17.4349 26.4443C18.2329 26.2413 19.0259 25.9433 19.7959 25.5983C19.8609 25.5633 19.9259 25.5273 19.9899 25.4913C20.3059 25.3173 20.6049 25.1383 20.7869 24.9943C20.9829 24.8393 21.5189 24.5373 22.0579 24.1853C22.4109 23.9553 22.7649 23.7053 23.0369 23.4833C23.1949 23.3553 23.3689 23.2693 23.5479 23.1773C23.7129 23.0923 23.8809 23.0013 24.0349 22.8653C24.1109 22.7983 24.1869 22.7173 24.2639 22.6303C24.3309 22.5563 24.4039 22.4723 24.4759 22.3923C24.5459 22.3153 24.7199 22.1723 24.9139 21.9793C25.0079 21.8863 25.1059 21.7783 25.1909 21.6713C25.2199 21.6323 25.2489 21.5943 25.2769 21.5553C25.5919 21.0403 25.8779 20.5003 26.1019 19.9653C26.1299 19.8403 26.1379 19.7293 26.1279 19.6373C26.1199 19.5703 26.1029 19.5113 26.0839 19.4503C26.0599 19.3643 26.0329 19.2773 26.0239 19.1723C26.0169 19.0893 26.0309 19.0043 26.0629 18.9543C26.0779 18.9323 26.0969 18.9143 26.1129 18.8993C26.1329 18.8823 26.1499 18.8673 26.1569 18.8443C26.1609 18.8273 26.1579 18.8073 26.1529 18.7833C26.1459 18.7443 26.1369 18.6943 26.1539 18.6293C26.2189 18.3853 26.2869 18.1103 26.3319 17.8383C26.3829 17.5393 26.4049 17.2433 26.3949 17.0123C26.3849 16.7493 26.3909 16.3823 26.3469 16.0003C26.3179 15.7343 26.2659 15.4663 26.1979 15.2383C26.1319 15.0143 26.0219 14.7913 25.9039 14.5783C25.7629 14.3223 25.6119 14.0783 25.5169 13.8453C25.4969 13.7983 25.4999 13.7263 25.4999 13.6323C25.5009 13.5673 25.4999 13.4913 25.4919 13.4083C25.3239 13.1243 25.1459 12.8423 24.9589 12.5483C24.9479 12.5413 24.9369 12.5333 24.9249 12.5263C24.6689 12.3503 24.3139 12.1173 24.0769 11.5503C24.0179 11.4063 24.0069 11.2983 23.9969 11.1993C23.9859 11.1013 23.9799 11.0183 23.9289 10.9093C23.8709 10.7853 23.7759 10.6583 23.6709 10.4993C23.5849 10.3703 23.4899 10.2133 23.4199 10.0423C23.3819 9.95134 23.3509 9.85734 23.3329 9.75934C23.3299 9.74334 23.3269 9.72534 23.3229 9.70634C23.2899 9.52734 23.2439 9.26534 23.2409 8.98634C23.0209 8.24434 22.8339 7.48833 22.6519 6.77633C22.3429 5.57133 22.0519 4.54234 21.3329 3.95434C20.9839 3.65334 20.5689 3.35433 20.2459 3.05433C19.9259 2.75633 19.7449 2.47534 19.8019 2.23834C19.8639 2.00634 20.1589 1.82934 20.6659 1.80534C21.1699 1.78334 21.8699 1.93235 22.5209 2.39235C23.6159 3.14235 24.2029 4.38334 24.5599 5.35734C24.5829 5.40834 24.6049 5.46034 24.6259 5.51234C24.7849 5.89434 24.9529 6.22834 25.1199 6.55534C25.1579 6.63034 25.1969 6.70834 25.2339 6.78134Z`,className:`ok-blob-body`}),t[21]=U):U=t[21];let W=(F||T)&&`ok-blob-eye-hidden`,G;t[22]===W?G=t[23]:(G=X(`ok-blob-eye`,W),t[22]=W,t[23]=G);let ee;t[24]===G?ee=t[25]:(ee=(0,Z.jsx)(`ellipse`,{cx:Qy,cy:eb,rx:1.2722,ry:1.9083,className:G}),t[24]=G,t[25]=ee);let K=(F||T)&&`ok-blob-eye-hidden`,q;t[26]===K?q=t[27]:(q=X(`ok-blob-eye ok-blob-eye-right`,K),t[26]=K,t[27]=q);let te;t[28]===q?te=t[29]:(te=(0,Z.jsx)(`ellipse`,{cx:$y,cy:eb,rx:1.2722,ry:1.9083,className:q}),t[28]=q,t[29]=te);let ne;t[30]===I?ne=t[31]:(ne=nb(Qy,I),t[30]=I,t[31]=ne);let re=(!F||T)&&`ok-blob-eye-hidden`,ie;t[32]===re?ie=t[33]:(ie=X(`ok-blob-happy-eye`,re),t[32]=re,t[33]=ie);let ae;t[34]!==ne||t[35]!==ie?(ae=(0,Z.jsx)(`path`,{d:ne,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:ie}),t[34]=ne,t[35]=ie,t[36]=ae):ae=t[36];let oe;t[37]===I?oe=t[38]:(oe=nb($y,I),t[37]=I,t[38]=oe);let se=(!F||T)&&`ok-blob-eye-hidden`,ce;t[39]===se?ce=t[40]:(ce=X(`ok-blob-happy-eye`,se),t[39]=se,t[40]=ce);let le;t[41]!==oe||t[42]!==ce?(le=(0,Z.jsx)(`path`,{d:oe,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:ce}),t[41]=oe,t[42]=ce,t[43]=le):le=t[43];let ue;t[44]===T?ue=t[45]:(ue=T?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`path`,{d:rb(Qy),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`}),(0,Z.jsx)(`path`,{d:rb($y),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`})]}):null,t[44]=T,t[45]=ue);let de;t[46]!==ee||t[47]!==te||t[48]!==ae||t[49]!==le||t[50]!==ue?(de=(0,Z.jsxs)(`g`,{ref:p,children:[ee,te,ae,le,ue]}),t[46]=ee,t[47]=te,t[48]=ae,t[49]=le,t[50]=ue,t[51]=de):de=t[51];let fe;t[52]!==B||t[53]!==H||t[54]!==de?(fe=(0,Z.jsxs)(`g`,{className:H,children:[U,de]},B),t[52]=B,t[53]=H,t[54]=de,t[55]=fe):fe=t[55];let pe;t[56]===T?pe=t[57]:(pe=T?(0,Z.jsxs)(`g`,{children:[(0,Z.jsx)(`text`,{x:21,y:7,className:`ok-blob-z ok-blob-z-1`,children:`z`}),(0,Z.jsx)(`text`,{x:26,y:2,className:`ok-blob-z ok-blob-z-2`,children:`z`})]}):null,t[56]=T,t[57]=pe);let me;t[58]!==v||t[59]!==x?(me=x.length>0&&(0,Z.jsx)(`g`,{children:x.map(cb)},`firework-${v}`),t[58]=v,t[59]=x,t[60]=me):me=t[60];let he;t[61]!==D||t[62]!==s||t[63]!==z||t[64]!==fe||t[65]!==pe||t[66]!==me?(he=(0,Z.jsxs)(`svg`,{ref:f,width:s,height:s,viewBox:`0 0 30 30`,fill:`none`,overflow:`visible`,xmlns:`http://www.w3.org/2000/svg`,className:z,"aria-hidden":`true`,onClick:D,onMouseDown:lb,children:[fe,pe,me]}),t[61]=D,t[62]=s,t[63]=z,t[64]=fe,t[65]=pe,t[66]=me,t[67]=he):he=t[67];let ge;return t[68]!==R||t[69]!==he?(ge=(0,Z.jsx)(`span`,{ref:d,className:R,children:he}),t[68]=R,t[69]=he,t[70]=ge):ge=t[70],ge}function cb(e){return(0,Z.jsx)(`circle`,{cx:ib+e.originDx,cy:ab+e.originDy,r:e.size,className:`ok-blob-firework`,style:ob(e)},e.id)}function lb(e){return e.preventDefault()}function ub(e){return e+1}function db(e){return e+1}function fb(e){let t=(0,$.c)(12),{title:n,subtitle:r,celebrateSignal:i}=e,a;t[0]===i?a=t[1]:(a=(0,Z.jsx)(sb,{size:64,celebrateSignal:i}),t[0]=i,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,Z.jsx)(`h2`,{className:`text-2xl font-light tracking-tighter text-balance`,children:n}),t[2]=n,t[3]=o);let s;t[4]===r?s=t[5]:(s=r?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r}):null,t[4]=r,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,Z.jsxs)(`div`,{className:`flex items-center gap-4`,children:[a,c]}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}function pb(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`kbd`,{"data-slot":`kbd`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function mb(){let e=(0,$.c)(2),t=Jn()?`⌘ K`:`Ctrl K`,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(pb,{children:t}),e[0]=n):n=e[0];let r;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsxs)(`p`,{className:`text-1sm text-muted-foreground`,children:[n,` `,(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`A1taO8`})})]}),e[1]=r):r=e[1],r}var hb=`open-knowledge:create-top-level-file`;function gb(){window.dispatchEvent(new CustomEvent(hb))}function _b(e){let t=()=>e();return window.addEventListener(hb,t),()=>window.removeEventListener(hb,t)}function vb(){let e=(0,$.c)(14),[t,n]=(0,Q.useState)(!1),[r,i]=(0,Q.useState)(void 0),[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(0),l=(0,Q.useRef)(!1),u=(0,Q.useRef)(void 0),d,f;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{let e=!1,t=async function(){try{let t=await fetch(`/api/documents`),n=await t.json().catch(Sb);if(e)return;let r=t.ok?Mn.safeParse(n):null;r?.success?(o(Cb(r.data.documents)),l.current=!0):l.current||=(o(1),!0)}catch{!e&&!l.current&&(o(1),l.current=!0)}};t();let n=_i(e=>{e.includes(`files`)&&t()});return()=>{e=!0,n(),clearTimeout(u.current)}},f=[],e[0]=d,e[1]=f):(d=e[0],f=e[1]),(0,Q.useEffect)(d,f);let p;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=function(){clearTimeout(u.current),u.current=setTimeout(()=>c(xb),500),fetch(`/api/documents`).then(async e=>{let t=await e.json().catch(bb);if(!e.ok)return;let n=Mn.safeParse(t);n.success&&o(Cb(n.data.documents))}).catch(yb)},e[2]=p):p=e[2];let m=p,h=a!==null,g=a===0,_;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(_=function(e){n(e),e||i(void 0)},e[3]=_):_=e[3];let v=_,y;e[4]!==s||e[5]!==g||e[6]!==h?(y=h?g?(0,Z.jsx)(wb,{celebrateSignal:s,onPackSelect:e=>{i(e),n(!0)}}):(0,Z.jsx)(Tb,{celebrateSignal:s,onAddStarterPack:()=>{n(!0)}}):null,e[4]=s,e[5]=g,e[6]=h,e[7]=y):y=e[7];let b;e[8]!==r||e[9]!==t?(b=(0,Z.jsx)(dm,{open:t,onOpenChange:v,onSeedApplied:m,initialPackId:r}),e[8]=r,e[9]=t,e[10]=b):b=e[10];let x;return e[11]!==y||e[12]!==b?(x=(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center overflow-y-auto px-6 sm:px-12 md:px-16 subtle-scrollbar`,children:[y,b]}),e[11]=y,e[12]=b,e[13]=x):x=e[13],x}function yb(){}function bb(){return null}function xb(e){return e+1}function Sb(){return null}function Cb(e){return ui(e).filter(e=>e.kind===`document`||e.kind===`folder`).length}function wb(e){let t=(0,$.c)(16),{celebrateSignal:n,onPackSelect:r}=e,{_:a}=i(),o;t[0]===a?o=t[1]:(o=a({id:`ZmGmNh`}),t[0]=a,t[1]=o);let c;t[2]===a?c=t[3]:(c=a({id:`W8uemY`}),t[2]=a,t[3]=c);let l;t[4]!==n||t[5]!==o||t[6]!==c?(l=(0,Z.jsx)(fb,{title:o,subtitle:c,celebrateSignal:n}),t[4]=n,t[5]=o,t[6]=c,t[7]=l):l=t[7];let u;t[8]===r?u=t[9]:(u=(0,Z.jsx)(im,{onPackSelect:r}),t[8]=r,t[9]=u);let d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(Di,{variant:`link`,className:`text-muted-foreground font-normal justify-end`,size:`sm`,onClick:gb,children:(0,Z.jsx)(s,{id:`ensWZc`,components:{0:(0,Z.jsx)(Ji,{"aria-hidden":`true`,className:`size-3`})}})}),t[10]=d):d=t[10];let f;t[11]===u?f=t[12]:(f=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-3`,children:[u,d]}),t[11]=u,t[12]=f);let p;return t[13]!==l||t[14]!==f?(p=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-10 py-12 max-w-5xl my-auto`,children:[l,f]}),t[13]=l,t[14]=f,t[15]=p):p=t[15],p}function Tb(e){let t=(0,$.c)(19),{celebrateSignal:n,onAddStarterPack:r}=e,{_:a}=i(),o;t[0]===a?o=t[1]:(o=a({id:`8XS8nG`}),t[0]=a,t[1]=o);let c;t[2]===a?c=t[3]:(c=a({id:`GjElCU`}),t[2]=a,t[3]=c);let l;t[4]!==n||t[5]!==o||t[6]!==c?(l=(0,Z.jsx)(fb,{title:o,subtitle:c,celebrateSignal:n}),t[4]=n,t[5]=o,t[6]=c,t[7]=l):l=t[7];let u;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(Iy,{}),t[8]=u):u=t[8];let d,f;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(ne,{"aria-hidden":`true`,className:`size-3`}),f=(0,Z.jsx)(s,{id:`IajAbS`}),t[9]=d,t[10]=f):(d=t[9],f=t[10]);let p;t[11]===r?p=t[12]:(p=(0,Z.jsxs)(Di,{onClick:r,variant:`link`,size:`xs`,className:`font-mono text-xs uppercase tracking-wider text-muted-foreground font-normal hover:text-foreground hover:no-underline`,children:[d,f]}),t[11]=r,t[12]=p);let m;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(mb,{}),t[13]=m):m=t[13];let h;t[14]===p?h=t[15]:(h=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-4`,children:[u,(0,Z.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-4`,children:[p,m]})]}),t[14]=p,t[15]=h);let g;return t[16]!==l||t[17]!==h?(g=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-10 py-12 max-w-5xl my-auto`,children:[l,h]}),t[16]=l,t[17]=h,t[18]=g):g=t[18],g}function Eb(e){let t=(0,$.c)(76),{folderPath:n,state:r,onChange:a}=e,{_:o}=i(),[c,l]=(0,Q.useState)(!1),[u,d]=(0,Q.useState)(null),[f,p]=(0,Q.useState)(null);if(r.status===`idle`||r.status===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card p-4 space-y-3`,children:[(0,Z.jsx)(Ob,{}),(0,Z.jsx)(Wa,{className:`h-7 w-full`}),(0,Z.jsx)(Wa,{className:`h-7 w-full`}),(0,Z.jsx)(Wa,{className:`h-7 w-full`})]}),t[0]=e):e=t[0],e}if(r.status===`error`){let{message:e}=r,n;return t[1]===e?n=t[2]:(n=(0,Z.jsx)(`section`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,children:(0,Z.jsx)(s,{id:`4UMKtb`,values:{message:e}})}),t[1]=e,t[2]=n),n}let m;t[3]===r.data.folder.frontmatter_defaults?m=t[4]:(m=r.data.folder.frontmatter_defaults??{},t[3]=r.data.folder.frontmatter_defaults,t[4]=m);let h=m,g;t[5]===r.data.frontmatterLocal?g=t[6]:(g=r.data.frontmatterLocal??{},t[5]=r.data.frontmatterLocal,t[6]=g);let _=g,v=r.data.frontmatterSources,y;t[7]===r.data.folder.path?y=t[8]:(y=_o(r.data.folder.path),t[7]=r.data.folder.path,t[8]=y);let b=y,x,S,C,w,T,E,D,O,k,A,j,M,N;if(t[9]!==o||t[10]!==u||t[11]!==c||t[12]!==b||t[13]!==n||t[14]!==_||t[15]!==h||t[16]!==a||t[17]!==f||t[18]!==v){let e=Object.keys(h),r=async function(e,t){let r=await Yi(n,{[e]:t});if(!r.ok){let{error:e}=r;Uo.error(o({id:`xXo8FT`,values:{error:e}}));return}a()},i=async function(e){let t=await Yi(n,{[e]:null});if(!t.ok){let{error:e}=t;Uo.error(o({id:`ZU8VV_`,values:{error:e}}));return}a()},m=function(e,t){let n=h[e];r(e,ma(n,t))},g;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(g=function(){d({name:``,type:`text`,value:``,error:null}),l(!1)},t[32]=g):g=t[32],C=g;let y;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(y=function(e){d(t=>{if(!t)return t;let n=e===`date`?new Date().toISOString().slice(0,10):Zi[e];return{...t,type:e,value:n,error:null}})},t[33]=y):y=t[33],T=y;let P;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(P=function(e){d(t=>t&&{...t,value:e})},t[34]=P):P=t[34],E=P;let F;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(F=function(e){d(t=>t&&{...t,name:e,error:null})},t[35]=F):F=t[35],w=F;let I;t[36]!==o||t[37]!==u||t[38]!==n||t[39]!==h||t[40]!==a?(I=async function(){if(!u)return;let e=u.name.trim();if(!e){d({...u,error:o({id:`8_brI5`})});return}if(Object.hasOwn(h,e)){d({...u,error:o({id:`6lBXm5`,values:{trimmed:e}})});return}let t=await Yi(n,{[e]:u.value});if(!t.ok){d({...u,error:t.error});return}d(null),a()},t[36]=o,t[37]=u,t[38]=n,t[39]=h,t[40]=a,t[41]=I):I=t[41],D=I;let L=function(e){p({key:e,draft:e,error:null})},R=function(e){p(t=>t&&{...t,draft:e,error:null})},z=async function(){if(!f)return;let e=f.draft.trim();if(!e){p({...f,error:o({id:`8_brI5`})});return}if(e===f.key){p(null);return}if(Object.hasOwn(h,e)){p({...f,error:o({id:`6lBXm5`,values:{trimmed:e}})});return}let t=h[f.key],r=await Yi(n,{[f.key]:null,[e]:t});if(!r.ok){p({...f,error:r.error});return}p(null),a()},B=function(){p(null)};N=`rounded-lg border bg-card`,S=Jo,A=!c,t[42]===Symbol.for(`react.memo_cache_sentinel`)?(j=e=>l(!e),t[42]=j):j=t[42];let V=`size-3 transition-transform ${c?``:`rotate-90`}`,H;t[43]===V?H=t[44]:(H=(0,Z.jsx)(Wo,{className:V,"aria-hidden":!0}),t[43]=V,t[44]=H);let U;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`IX_qeH`})}),t[45]=U):U=t[45];let W;t[46]===H?W=t[47]:(W=(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:[H,U]}),t[46]=H,t[47]=W);let G;t[48]===b?G=t[49]:(G=(0,Z.jsx)(`code`,{className:`text-xs text-muted-foreground font-mono cursor-text select-text`,onClick:Db,children:b}),t[48]=b,t[49]=G),t[50]!==W||t[51]!==G?(M=(0,Z.jsxs)(qo,{className:`flex w-full cursor-pointer items-center justify-between gap-2 px-3 py-2.5 data-[state=open]:border-b border-border`,children:[W,G]}),t[50]=W,t[51]=G,t[52]=M):M=t[52],x=Ko,O=`px-2 py-2`,k=e.length===0&&!u?(0,Z.jsx)(`p`,{className:`px-1 py-1 text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`50Y3WA`})}):e.map(e=>{let t=h[e],n=Object.hasOwn(_,e);return(0,Z.jsx)(Ca,{keyName:e,value:t,declared:Ja(t,ri(t)),rename:n?{state:f?.key===e?f:null,onBegin:()=>L(e),onChangeDraft:R,onCommit:z,onCancel:B}:void 0,badge:n?null:(0,Z.jsx)($i,{source:v[e]??``}),isInherited:!n,onCommit:t=>void r(e,t),onChangeType:t=>m(e,t),onRemove:n?()=>void i(e):void 0},e)}),t[9]=o,t[10]=u,t[11]=c,t[12]=b,t[13]=n,t[14]=_,t[15]=h,t[16]=a,t[17]=f,t[18]=v,t[19]=x,t[20]=S,t[21]=C,t[22]=w,t[23]=T,t[24]=E,t[25]=D,t[26]=O,t[27]=k,t[28]=A,t[29]=j,t[30]=M,t[31]=N}else x=t[19],S=t[20],C=t[21],w=t[22],T=t[23],E=t[24],D=t[25],O=t[26],k=t[27],A=t[28],j=t[29],M=t[30],N=t[31];let P;t[53]!==u||t[54]!==C||t[55]!==w||t[56]!==T||t[57]!==E||t[58]!==D?(P=u?(0,Z.jsx)(ho,{draft:u,onChangeName:w,onChangeType:T,onChangeValue:E,onCommit:()=>void D(),onCancel:()=>d(null)}):(0,Z.jsxs)(Di,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`add-property-trigger`,onClick:C,className:`mt-1 flex items-center gap-1.5 rounded px-2 py-1 font-medium text-sm hover:bg-muted/50 hover:text-foreground`,children:[(0,Z.jsx)(ne,{className:`size-3.5`}),(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`F-NRCj`})})]}),t[53]=u,t[54]=C,t[55]=w,t[56]=T,t[57]=E,t[58]=D,t[59]=P):P=t[59];let F;t[60]!==P||t[61]!==O||t[62]!==k?(F=(0,Z.jsxs)(`div`,{className:O,children:[k,P]}),t[60]=P,t[61]=O,t[62]=k,t[63]=F):F=t[63];let I;t[64]!==x||t[65]!==F?(I=(0,Z.jsx)(x,{children:F}),t[64]=x,t[65]=F,t[66]=I):I=t[66];let L;t[67]!==S||t[68]!==I||t[69]!==A||t[70]!==j||t[71]!==M?(L=(0,Z.jsxs)(S,{open:A,onOpenChange:j,children:[M,I]}),t[67]=S,t[68]=I,t[69]=A,t[70]=j,t[71]=M,t[72]=L):L=t[72];let R;return t[73]!==L||t[74]!==N?(R=(0,Z.jsx)(`section`,{className:N,children:L}),t[73]=L,t[74]=N,t[75]=R):R=t[75],R}function Db(e){return e.stopPropagation()}function Ob(){let e=(0,$.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(hc,{className:`size-4 text-muted-foreground`,"aria-hidden":!0}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t,(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(s,{id:`IX_qeH`})})]}),e[1]=n):n=e[1],n}function kb(e){let t=e.split(`/`).pop();return t?`${e}/${t}`:null}function Ab(e,t){let n=t.get(`${e}/index`);if(n)return n;let r=kb(e);if(r){let e=t.get(r);if(e)return e}return e.split(`/`).pop()??e}function jb(e,t,n){let r=n.get(e);return r&&r!==e?r:t}function Mb(e,t){let n=`${e}/`,r=[...t.folderPaths].filter(e=>e.startsWith(n)).map(e=>({path:e,rel:e.slice(n.length)})).filter(e=>e.rel.length>0&&!e.rel.includes(`/`)).map(({path:e,rel:n})=>({kind:`folder`,path:e,name:n,title:Ab(e,t.pageTitles)})),i=[...t.pages].filter(e=>e.startsWith(n)).map(e=>({docName:e,rel:e.slice(n.length)})).filter(e=>e.rel.length>0&&!e.rel.includes(`/`)).map(({docName:e,rel:n})=>{let r=t.pageMeta.get(e);return{kind:`file`,path:e,name:n,title:jb(e,n,t.pageTitles),size:r?.size??0,modified:r?.modified??``}}),a=[...r,...i].sort((e,t)=>e.kind===t.kind?e.title.localeCompare(t.title)||e.name.localeCompare(t.name):e.kind===`folder`?-1:1);return{title:Ab(e,t.pageTitles),children:a}}function Nb(e){let t=(0,$.c)(54),{folderPath:n,state:r,onChange:a,folderConfigHandle:o}=e,{_:c}=i(),[l,u]=(0,Q.useState)(null),[d,f]=(0,Q.useState)(null),[p,m]=(0,Q.useState)(null),[h,g]=(0,Q.useState)(!1),[_,v]=(0,Q.useState)(!1),y;t[0]!==c||t[1]!==a?(y=async function(e){g(!0);let t=await xa(e.source_folder,e.name);if(g(!1),!t.ok){let{error:e}=t;Uo.error(c({id:`yOGrCR`,values:{error:e}}));return}let{name:n}=e;Uo.success(c({id:`I23A-U`,values:{name:n}})),f(null),a()},t[0]=c,t[1]=a,t[2]=y):y=t[2];let b=y;if(r.status===`idle`||r.status===`loading`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card px-3 py-2.5 space-y-3`,children:[(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(s,{id:`-QCLWk`})})}),(0,Z.jsx)(Wa,{className:`h-12 w-full`}),(0,Z.jsx)(Wa,{className:`h-12 w-full`})]}),t[3]=e):e=t[3],e}if(r.status===`error`){let{message:e}=r,n;return t[4]===e?n=t[5]:(n=(0,Z.jsx)(`section`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,children:(0,Z.jsx)(s,{id:`iDZtvM`,values:{message:e}})}),t[4]=e,t[5]=n),n}let x;t[6]===r.data.folder.templates_available?x=t[7]:(x=r.data.folder.templates_available??[],t[6]=r.data.folder.templates_available,t[7]=x);let S=x,C;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(s,{id:`-QCLWk`})}),t[8]=C):C=t[8];let w;t[9]===S.length?w=t[10]:(w=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[C,(0,Z.jsx)(fe,{className:`text-xs`,variant:`secondary`,children:S.length})]}),t[9]=S.length,t[10]=w);let T;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Z.jsxs)(Di,{variant:`ghost`,className:`font-mono uppercase`,size:`sm`,onClick:()=>v(!0),children:[(0,Z.jsx)(ne,{className:`size-3.5`,"aria-hidden":!0}),(0,Z.jsx)(s,{id:`G1Gw0v`})]}),t[11]=T):T=t[11];let E;t[12]===w?E=t[13]:(E=(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-1`,children:[w,T]}),t[12]=w,t[13]=E);let D;t[14]===S?D=t[15]:(D=(0,Z.jsx)(`div`,{className:`px-3 py-2.5`,children:S.length===0?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`BHW0EW`})}):(0,Z.jsx)(`ul`,{className:`space-y-1`,children:S.map(e=>(0,Z.jsx)(Fb,{template:e,onCreate:()=>m(e.name),onEdit:()=>u(e),onDelete:()=>f(e)},e.path))})}),t[14]=S,t[15]=D);let O;t[16]!==E||t[17]!==D?(O=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card`,children:[E,D]}),t[16]=E,t[17]=D,t[18]=O):O=t[18];let k;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(k=e=>{e||u(null)},t[19]=k):k=t[19];let A;t[20]!==l||t[21]!==n||t[22]!==a?(A=(0,Z.jsx)(po,{folderPath:n,template:l,onOpenChange:k,onSaved:a}),t[20]=l,t[21]=n,t[22]=a,t[23]=A):A=t[23];let j=!!d,M;t[24]===h?M=t[25]:(M=e=>{!e&&!h&&f(null)},t[24]=h,t[25]=M);let N;t[26]!==c||t[27]!==d||t[28]!==h||t[29]!==b?(N=d&&(()=>{let{name:e,path:t,scope:n}=d,r=n===`inherited`?`\n\n${c({id:`LUbzI-`})}`:``;return(0,Z.jsx)(Fa,{itemName:c({id:`XfzqjK`,values:{name:e}}),isSubmitting:h,onDelete:()=>b(d),customDescription:`${c({id:`JVgg1-`,values:{path:t}})}${r}`})})(),t[26]=c,t[27]=d,t[28]=h,t[29]=b,t[30]=N):N=t[30];let P;t[31]!==j||t[32]!==M||t[33]!==N?(P=(0,Z.jsx)(Vo,{open:j,onOpenChange:M,children:N}),t[31]=j,t[32]=M,t[33]=N,t[34]=P):P=t[34];let F;t[35]===S?F=t[36]:(F=new Set(S.map(Pb)),t[35]=S,t[36]=F);let I;t[37]!==n||t[38]!==_||t[39]!==a||t[40]!==F?(I=(0,Z.jsx)(yo,{folderPath:n,existingNames:F,open:_,onOpenChange:v,onCreated:a}),t[37]=n,t[38]=_,t[39]=a,t[40]=F,t[41]=I):I=t[41];let L=p!==null,R;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>{e||m(null)},t[42]=R):R=t[42];let z=p??void 0,B;t[43]!==o||t[44]!==n||t[45]!==L||t[46]!==z?(B=(0,Z.jsx)(Vp,{open:L,onOpenChange:R,kind:`file`,initialDir:n,initialTemplate:z,folderConfig:o}),t[43]=o,t[44]=n,t[45]=L,t[46]=z,t[47]=B):B=t[47];let V;return t[48]!==A||t[49]!==P||t[50]!==I||t[51]!==B||t[52]!==O?(V=(0,Z.jsxs)(Z.Fragment,{children:[O,A,P,I,B]}),t[48]=A,t[49]=P,t[50]=I,t[51]=B,t[52]=O,t[53]=V):V=t[53],V}function Pb(e){return e.name}function Fb(e){let t=(0,$.c)(51),{template:n,onCreate:r,onEdit:a,onDelete:o}=e,{_:c}=i(),l=n.title&&n.title!==n.name,u=n.title??n.name,d;t[0]===u?d=t[1]:(d=(0,Z.jsx)(`span`,{className:`font-medium truncate`,children:u}),t[0]=u,t[1]=d);let f;t[2]!==l||t[3]!==n.name?(f=l?(0,Z.jsx)(`code`,{className:`font-mono text-xs text-muted-foreground shrink-0`,children:n.name}):null,t[2]=l,t[3]=n.name,t[4]=f):f=t[4];let p;t[5]!==n.name||t[6]!==n.scope||t[7]!==n.source_folder?(p=n.scope===`inherited`?(0,Z.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,Z.jsx)($i,{source:n.source_folder,target:`templates/${n.name}.md`})}):null,t[5]=n.name,t[6]=n.scope,t[7]=n.source_folder,t[8]=p):p=t[8];let m;t[9]!==d||t[10]!==f||t[11]!==p?(m=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[d,f,p]}),t[9]=d,t[10]=f,t[11]=p,t[12]=m):m=t[12];let h;t[13]===n.description?h=t[14]:(h=n.description?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground truncate mt-0.5`,children:n.description}):null,t[13]=n.description,t[14]=h);let g;t[15]!==a||t[16]!==m||t[17]!==h?(g=(0,Z.jsxs)(`button`,{type:`button`,onClick:a,className:`min-w-0 flex-1 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm`,children:[m,h]}),t[15]=a,t[16]=m,t[17]=h,t[18]=g):g=t[18];let _;t[19]!==c||t[20]!==u?(_=c({id:`5m2Eho`,values:{label:u}}),t[19]=c,t[20]=u,t[21]=_):_=t[21];let v,y;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(fc,{className:`size-3.5`,"aria-hidden":!0}),y=(0,Z.jsx)(s,{id:`hYgDIe`}),t[22]=v,t[23]=y):(v=t[22],y=t[23]);let b;t[24]!==r||t[25]!==_?(b=(0,Z.jsxs)(Di,{type:`button`,variant:`ghost`,size:`sm`,className:`font-mono uppercase shrink-0 opacity-0 group-hover:opacity-100 focus-visible:opacity-100`,onClick:r,"aria-label":_,children:[v,y]}),t[24]=r,t[25]=_,t[26]=b):b=t[26];let x;t[27]!==c||t[28]!==u?(x=c({id:`Bx4EXG`,values:{label:u}}),t[27]=c,t[28]=u,t[29]=x):x=t[29];let S;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(ba,{className:`size-4`,"aria-hidden":!0}),t[30]=S):S=t[30];let C;t[31]===x?C=t[32]:(C=(0,Z.jsx)(va,{asChild:!0,children:(0,Z.jsx)(Di,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0 opacity-0 group-hover:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100`,"aria-label":x,children:S})}),t[31]=x,t[32]=C);let w,E;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(T,{"aria-hidden":!0}),E=(0,Z.jsx)(s,{id:`ePK91l`}),t[33]=w,t[34]=E):(w=t[33],E=t[34]);let D;t[35]===a?D=t[36]:(D=(0,Z.jsxs)(ca,{onSelect:a,children:[w,E]}),t[35]=a,t[36]=D);let O,k;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsx)(K,{"aria-hidden":!0}),k=(0,Z.jsx)(s,{id:`cnGeoo`}),t[37]=O,t[38]=k):(O=t[37],k=t[38]);let A;t[39]===o?A=t[40]:(A=(0,Z.jsxs)(ca,{variant:`destructive`,onSelect:o,children:[O,k]}),t[39]=o,t[40]=A);let j;t[41]!==D||t[42]!==A?(j=(0,Z.jsxs)(ra,{align:`end`,children:[D,A]}),t[41]=D,t[42]=A,t[43]=j):j=t[43];let M;t[44]!==C||t[45]!==j?(M=(0,Z.jsxs)(Ta,{children:[C,j]}),t[44]=C,t[45]=j,t[46]=M):M=t[46];let N;return t[47]!==b||t[48]!==M||t[49]!==g?(N=(0,Z.jsxs)(`li`,{className:`group flex items-center gap-2 rounded-md px-2 py-2 hover:bg-muted/50 text-sm`,children:[g,b,M]}),t[47]=b,t[48]=M,t[49]=g,t[50]=N):N=t[50],N}function Ib(e){let t=(0,$.c)(14),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,containerClassName:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=X(`relative w-full overflow-x-auto subtle-scrollbar`,r),t[4]=r,t[5]=a);let o;t[6]===n?o=t[7]:(o=X(`w-full caption-bottom text-sm`,n),t[6]=n,t[7]=o);let s;t[8]!==i||t[9]!==o?(s=(0,Z.jsx)(`table`,{"data-slot":`table`,className:o,...i}),t[8]=i,t[9]=o,t[10]=s):s=t[10];let c;return t[11]!==a||t[12]!==s?(c=(0,Z.jsx)(`div`,{"data-slot":`table-container`,className:a,children:s}),t[11]=a,t[12]=s,t[13]=c):c=t[13],c}function Lb(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`[&_tr]:border-b`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`thead`,{"data-slot":`table-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Rb(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`[&_tr:last-child]:border-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`tbody`,{"data-slot":`table-body`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function zb(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,noHover:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=(i===void 0?!1:i)&&`hover:bg-transparent`,o;t[4]!==n||t[5]!==a?(o=X(`hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors`,a,n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==o?(s=(0,Z.jsx)(`tr`,{"data-slot":`table-row`,className:o,...r}),t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function Bb(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,scope:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`col`:i,o;t[4]===n?o=t[5]:(o=X(`font-mono uppercase text-xs text-muted-foreground h-10 px-4 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==a||t[8]!==o?(s=(0,Z.jsx)(`th`,{"data-slot":`table-head`,scope:a,className:o,...r}),t[6]=r,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function Vb(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`py-3 px-4 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`td`,{"data-slot":`table-cell`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Hb(e){if(!e)return`—`;let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/6e4);if(r<1)return Y._({id:`xOTzt5`});if(r<60)return Y._({id:`NRSLBe`,values:{diffMin:r}});let i=Math.floor(r/60);if(i<24)return Y._({id:`hDKtoF`,values:{diffHrs:i}});let a=Math.floor(i/24);return a<30?Y._({id:`QDZbvN`,values:{diffDays:a}}):t.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function Ub(e,t,n){return[...e].sort((e,r)=>{if(e.kind!==r.kind)return e.kind===`folder`?-1:1;let i=0;switch(t){case`name`:i=e.title.localeCompare(r.title)||e.name.localeCompare(r.name);break;case`modified`:{let t=e.kind===`file`?e.modified:``,n=r.kind===`file`?r.modified:``;i=t.localeCompare(n);break}}return n===`asc`?i:-i})}function Wb(e){let t=(0,$.c)(10),{label:n,sortKey:r,activeKey:i,activeDir:a,onSort:o}=e,s=i===r,c;t[0]!==o||t[1]!==r?(c=()=>o(r),t[0]=o,t[1]=r,t[2]=c):c=t[2];let l;t[3]!==a||t[4]!==s?(l=s?a===`asc`?(0,Z.jsx)(Nt,{className:`ml-1 size-3`}):(0,Z.jsx)(Ve,{className:`ml-1 size-3`}):(0,Z.jsx)(Ws,{className:`ml-1 size-3 text-muted-foreground/50`}),t[3]=a,t[4]=s,t[5]=l):l=t[5];let u;return t[6]!==n||t[7]!==c||t[8]!==l?(u=(0,Z.jsxs)(Di,{variant:`ghost`,size:`sm`,className:`-ml-3 h-8 uppercase font-mono`,onClick:c,children:[n,l]}),t[6]=n,t[7]=c,t[8]=l,t[9]=u):u=t[9],u}function Gb(e){let t=(0,$.c)(92),{folderPath:n}=e,{_:r}=i(),{folderPaths:a,loading:o,pages:c,pageTitles:l,pageMeta:u}=oi(),d=Qa(n),{state:f,refresh:p}=d,[m,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(`name`),[v,y]=(0,Q.useState)(`asc`);if(o){let e;t[0]===r?e=t[1]:(e=r({id:`X9VpsP`}),t[0]=r,t[1]=e);let n;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Wa,{className:`size-5 rounded`}),(0,Z.jsx)(Wa,{className:`h-7 w-48`})]}),(0,Z.jsx)(Wa,{className:`h-9 w-20 rounded-md`})]}),t[2]=n):n=t[2];let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(Wa,{className:`h-4 w-16`}),t[3]=i):i=t[3];let a;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsxs)(`div`,{className:`mx-auto flex w-full max-w-4xl flex-col gap-6 px-6 py-8`,children:[n,(0,Z.jsxs)(`div`,{className:`rounded-lg border`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-4 border-b px-4 py-3`,children:[i,(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsx)(Wa,{className:`h-4 w-20`})})]}),[`a`,`b`,`c`,`d`].map(Jb)]})]}),t[4]=a):a=t[4];let o;return t[5]===e?o=t[6]:(o=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-start overflow-y-auto subtle-scrollbar`,role:`status`,"aria-busy":`true`,"aria-label":e,children:a}),t[5]=e,t[6]=o),o}let b,x,S,C,w,T,E,D,O,k;if(t[7]!==r||t[8]!==f||t[9]!==d||t[10]!==n||t[11]!==a||t[12]!==u||t[13]!==l||t[14]!==c||t[15]!==p||t[16]!==v||t[17]!==g){let e=Mb(n,{pages:c,pageTitles:l,pageMeta:u,folderPaths:a}),i=Ub(e.children,g,v),o;t[28]===g?o=t[29]:(o=function(e){e===g?y(qb):(_(e),y(`asc`))},t[28]=g,t[29]=o);let m=o;k=`flex min-h-0 flex-1 items-start overflow-y-auto subtle-scrollbar`,T=`mx-auto flex w-full max-w-4xl flex-col gap-6 px-6 py-8`;let A;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Z.jsx)(we,{className:`size-5 text-muted-foreground`}),t[30]=A):A=t[30];let j=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[A,(0,Z.jsx)(`h1`,{className:`text-2xl font-light tracking-tight`,children:e.title})]}),M;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Z.jsxs)(Di,{onClick:()=>h(!0),children:[(0,Z.jsx)(ne,{className:`size-4`}),(0,Z.jsx)(s,{id:`isRobC`})]}),t[31]=M):M=t[31],t[32]===j?E=t[33]:(E=(0,Z.jsx)(`div`,{className:`flex flex-col gap-6`,children:(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[j,M]})}),t[32]=j,t[33]=E),t[34]!==f||t[35]!==n||t[36]!==p?(D=(0,Z.jsx)(Eb,{folderPath:n,state:f,onChange:p}),t[34]=f,t[35]=n,t[36]=p,t[37]=D):D=t[37],t[38]!==f||t[39]!==d||t[40]!==n||t[41]!==p?(O=(0,Z.jsx)(Nb,{folderPath:n,state:f,onChange:p,folderConfigHandle:d}),t[38]=f,t[39]=d,t[40]=n,t[41]=p,t[42]=O):O=t[42],w=`rounded-lg border`,x=Ib;let N=g===`name`?v===`asc`?`ascending`:`descending`:`none`,P;t[43]===r?P=t[44]:(P=r({id:`6YtxFj`}),t[43]=r,t[44]=P);let F;t[45]!==m||t[46]!==v||t[47]!==g||t[48]!==P?(F=(0,Z.jsx)(Wb,{label:P,sortKey:`name`,activeKey:g,activeDir:v,onSort:m}),t[45]=m,t[46]=v,t[47]=g,t[48]=P,t[49]=F):F=t[49];let I;t[50]!==N||t[51]!==F?(I=(0,Z.jsx)(Bb,{"aria-sort":N,children:F}),t[50]=N,t[51]=F,t[52]=I):I=t[52];let L=g===`modified`?v===`asc`?`ascending`:`descending`:`none`,R;t[53]===r?R=t[54]:(R=r({id:`tgWuMB`}),t[53]=r,t[54]=R);let z;t[55]!==m||t[56]!==v||t[57]!==g||t[58]!==R?(z=(0,Z.jsx)(Wb,{label:R,sortKey:`modified`,activeKey:g,activeDir:v,onSort:m}),t[55]=m,t[56]=v,t[57]=g,t[58]=R,t[59]=z):z=t[59];let B;t[60]!==L||t[61]!==z?(B=(0,Z.jsx)(Bb,{className:`w-32`,"aria-sort":L,children:z}),t[60]=L,t[61]=z,t[62]=B):B=t[62],t[63]!==I||t[64]!==B?(C=(0,Z.jsx)(Lb,{children:(0,Z.jsxs)(zb,{children:[I,B]})}),t[63]=I,t[64]=B,t[65]=C):C=t[65],b=Rb,S=i.length?i.map(Kb):(0,Z.jsx)(zb,{children:(0,Z.jsx)(Vb,{colSpan:2,className:`h-24 text-center text-muted-foreground`,children:(0,Z.jsx)(s,{id:`Pkw7J9`})})}),t[7]=r,t[8]=f,t[9]=d,t[10]=n,t[11]=a,t[12]=u,t[13]=l,t[14]=c,t[15]=p,t[16]=v,t[17]=g,t[18]=b,t[19]=x,t[20]=S,t[21]=C,t[22]=w,t[23]=T,t[24]=E,t[25]=D,t[26]=O,t[27]=k}else b=t[18],x=t[19],S=t[20],C=t[21],w=t[22],T=t[23],E=t[24],D=t[25],O=t[26],k=t[27];let A;t[66]!==b||t[67]!==S?(A=(0,Z.jsx)(b,{children:S}),t[66]=b,t[67]=S,t[68]=A):A=t[68];let j;t[69]!==x||t[70]!==C||t[71]!==A?(j=(0,Z.jsxs)(x,{children:[C,A]}),t[69]=x,t[70]=C,t[71]=A,t[72]=j):j=t[72];let M;t[73]!==j||t[74]!==w?(M=(0,Z.jsx)(`div`,{className:w,children:j}),t[73]=j,t[74]=w,t[75]=M):M=t[75];let N;t[76]!==M||t[77]!==T||t[78]!==E||t[79]!==D||t[80]!==O?(N=(0,Z.jsxs)(`div`,{className:T,children:[E,D,O,M]}),t[76]=M,t[77]=T,t[78]=E,t[79]=D,t[80]=O,t[81]=N):N=t[81];let P;t[82]!==N||t[83]!==k?(P=(0,Z.jsx)(`div`,{className:k,children:N}),t[82]=N,t[83]=k,t[84]=P):P=t[84];let F;t[85]!==m||t[86]!==d||t[87]!==n?(F=(0,Z.jsx)(Vp,{open:m,onOpenChange:h,kind:`file`,initialDir:n,folderConfig:d,suggestedName:`index`}),t[85]=m,t[86]=d,t[87]=n,t[88]=F):F=t[88];let I;return t[89]!==P||t[90]!==F?(I=(0,Z.jsxs)(Z.Fragment,{children:[P,F]}),t[89]=P,t[90]=F,t[91]=I):I=t[91],I}function Kb(e){return(0,Z.jsxs)(zb,{children:[(0,Z.jsx)(Vb,{children:(0,Z.jsxs)(`a`,{href:ii(e.path),className:`flex items-center gap-2 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[e.kind===`folder`?(0,Z.jsx)(_c,{className:`size-4 shrink-0 text-muted-foreground`}):(0,Z.jsx)(Ae,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.title})]})}),(0,Z.jsx)(Vb,{className:`text-muted-foreground`,children:e.kind===`file`?Hb(e.modified):`—`})]},e.path)}function qb(e){return e===`asc`?`desc`:`asc`}function Jb(e){return(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 border-b px-4 py-3 last:border-b-0`,children:[(0,Z.jsx)(Wa,{className:`size-4 rounded`}),(0,Z.jsx)(Wa,{className:`h-4 w-40`}),(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsx)(Wa,{className:`h-4 w-16`})})]},e)}function Yb(e){let t=(0,$.c)(8),{docName:n}=e,[r,i]=(0,Q.useState)(Xb),a,o;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>q(e=>{i(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})}),o=[],t[0]=a,t[1]=o):(a=t[0],o=t[1]),(0,Q.useEffect)(a,o),!r.has(n))return null;let c;t[2]===n?c=t[3]:(c=function(){pe(n)?.abort(),i(e=>{if(!e.has(n))return e;let t=new Set(e);return t.delete(n),t})},t[2]=n,t[3]=c);let l=c,u;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`A67Uwj`})}),t[4]=u):u=t[4];let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(s,{id:`dEgA5A`}),t[5]=d):d=t[5];let f;return t[6]===l?f=t[7]:(f=(0,Z.jsxs)(`div`,{className:`absolute inset-x-0 bottom-8 z-20 flex justify-center text-xs text-muted-foreground`,children:[u,(0,Z.jsx)(Di,{variant:`link`,size:`sm`,className:`h-auto px-2 py-0 text-xs`,onClick:l,children:d})]}),t[6]=l,t[7]=f),f}function Xb(){return new Set}var Zb=(0,Q.createContext)(null);function Qb(e){let t=(0,$.c)(7),{children:n}=e,[r,i]=(0,Q.useState)($b),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=e=>{i(t=>{let n=new Map(t);return n.set(e,(t.get(e)??0)+1),n})},t[0]=a):a=t[0];let o=a,s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=e=>{i(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},t[1]=s):s=t[1];let c=s,l;t[2]===r?l=t[3]:(l={addPropertySignal:r,requestAddProperty:o,clearAddProperty:c},t[2]=r,t[3]=l);let u=l,d;return t[4]!==n||t[5]!==u?(d=(0,Z.jsx)(Zb,{value:u,children:n}),t[4]=n,t[5]=u,t[6]=d):d=t[6],d}function $b(){return new Map}function ex(){let e=(0,Q.use)(Zb);if(e===null)throw Error(`useProperties must be used within <PropertyProvider />`);return e}function tx(e){let t=null,n=()=>(t===null&&(t=e(),t.catch(()=>{})),t),r=(0,Q.lazy)(n);return r.preload=n,r}var nx=tx(()=>n(()=>import(`./SettingsDialogBody-B8fXoAN4.js`).then(e=>({default:e.SettingsDialogBody})),__vite__mapDeps([42,1,33,2,34,35,20,36,37,38,39,19,6,3,7,4,10,9,40,43,8,14,21,11]),import.meta.url));function rx(e){let t=(0,$.c)(9),{error:n}=e,{_:r}=i(),a;t[0]!==r||t[1]!==n?(a=n instanceof Error&&/dynamically imported module|Failed to fetch/i.test(n.message)?r({id:`Y8ViJx`}):r({id:`3h5zMp`}),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o=a,c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(`h3`,{id:`settings-body-error-title`,className:`font-heading text-base leading-none font-medium`,children:(0,Z.jsx)(s,{id:`hwFOFD`})}),t[3]=c):c=t[3];let l;t[4]===o?l=t[5]:(l=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[c,(0,Z.jsx)(`p`,{className:`max-w-xs text-sm text-muted-foreground`,children:o})]}),t[4]=o,t[5]=l);let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(Di,{variant:`default`,onClick:ix,children:(0,Z.jsx)(s,{id:`HpK_8d`})}),t[6]=u):u=t[6];let d;return t[7]===l?d=t[8]:(d=(0,Z.jsxs)(`div`,{role:`alert`,"aria-labelledby":`settings-body-error-title`,"data-slot":`settings-body-error-boundary`,className:`flex h-full flex-col items-center justify-center gap-5 p-8 text-center`,children:[l,u]}),t[7]=l,t[8]=d),d}function ix(){return window.location.reload()}function ax(e){let t=(0,$.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(m,{fallbackRender:sx,onError:ox,children:n}),t[0]=n,t[1]=r),r}function ox(e,t){console.error(`[SettingsDialogErrorBoundary] rendered fallback for Settings body`,e,t.componentStack)}function sx(e){return(0,Z.jsx)(rx,{...e})}function cx(e){let t=(0,$.c)(64),{open:n,onOpenChange:r}=e,{_:a}=i(),{collabUrl:o}=ft(),{userBinding:c,userSynced:l,okignoreBinding:u,okignoreSynced:d}=ke(),{desktopPresent:f}=ja(),[p,m]=(0,Q.useState)(`preferences`),h,g;t[0]===n?(h=t[1],g=t[2]):(h=()=>{n&&m(`preferences`)},g=[n],t[0]=n,t[1]=h,t[2]=g),(0,Q.useEffect)(h,g);let _=o!==null,v;t[3]===a?v=t[4]:(v=a({id:`7PzzBU`}),t[3]=a,t[4]=v);let y;t[5]===a?y=t[6]:(y=a({id:`Q6hhn8`}),t[5]=a,t[6]=y);let b;t[7]===y?b=t[8]:(b=[{id:`preferences`,label:y}],t[7]=y,t[8]=b);let x;t[9]!==v||t[10]!==b?(x={id:`user`,label:v,enabled:!0,items:b},t[9]=v,t[10]=b,t[11]=x):x=t[11];let S;t[12]===a?S=t[13]:(S=a({id:`ZWyHmq`}),t[12]=a,t[13]=S);let C;t[14]===a?C=t[15]:(C=a({id:`Nu4DdT`}),t[14]=a,t[15]=C);let w;t[16]===C?w=t[17]:(w={id:`sync`,label:C},t[16]=C,t[17]=w);let T;t[18]===a?T=t[19]:(T=a({id:`iTylMl`}),t[18]=a,t[19]=T);let E;t[20]===T?E=t[21]:(E={id:`project-templates`,label:T},t[20]=T,t[21]=E);let D;t[22]===a?D=t[23]:(D=a({id:`3zyg_A`}),t[22]=a,t[23]=D);let O;t[24]===D?O=t[25]:(O={id:`okignore`,label:D},t[24]=D,t[25]=O);let k;t[26]!==E||t[27]!==O||t[28]!==w?(k=[w,E,O],t[26]=E,t[27]=O,t[28]=w,t[29]=k):k=t[29];let A;t[30]!==_||t[31]!==k||t[32]!==S?(A={id:`project`,label:S,enabled:_,items:k},t[30]=_,t[31]=k,t[32]=S,t[33]=A):A=t[33];let j;t[34]===a?j=t[35]:(j=a({id:`nbfdhU`}),t[34]=a,t[35]=j);let M;t[36]!==a||t[37]!==f?(M=f?[{id:`claude-desktop`,label:a({id:`yvHDYG`})}]:[],t[36]=a,t[37]=f,t[38]=M):M=t[38];let N;t[39]!==j||t[40]!==M?(N={id:`integrations`,label:j,enabled:!0,items:M},t[39]=j,t[40]=M,t[41]=N):N=t[41];let P;t[42]!==A||t[43]!==N||t[44]!==x?(P=[x,A,N],t[42]=A,t[43]=N,t[44]=x,t[45]=P):P=t[45];let F=P,I;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Z.jsx)(jo,{className:`sr-only`,children:(0,Z.jsx)(s,{id:`Tz0i8g`})}),t[46]=I):I=t[46];let L;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(ko,{className:`sr-only`,children:(0,Z.jsx)(s,{id:`RDrXh4`})}),t[47]=L):L=t[47];let R;t[48]!==p||t[49]!==F?(R=(0,Z.jsx)(lx,{groups:F,activeId:p,onSelect:m}),t[48]=p,t[49]=F,t[50]=R):R=t[50];let z;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Z.jsx)(dx,{}),t[51]=z):z=t[51];let B=l?c:null,V;t[52]!==p||t[53]!==u||t[54]!==d||t[55]!==B?(V=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain subtle-scrollbar p-6`,children:(0,Z.jsx)(ax,{children:(0,Z.jsx)(Q.Suspense,{fallback:z,children:(0,Z.jsx)(nx,{activeId:p,userBinding:B,okignoreBinding:u,okignoreSynced:d})})})}),t[52]=p,t[53]=u,t[54]=d,t[55]=B,t[56]=V):V=t[56];let H;t[57]!==R||t[58]!==V?(H=(0,Z.jsxs)(Fo,{className:`flex h-[700px] max-h-[calc(100dvh-4rem)] w-[900px] max-w-[calc(100%-2rem)] flex-col gap-0 overflow-hidden p-0 sm:grid sm:grid-cols-[220px_1fr] sm:max-w-[min(900px,calc(100%-2rem))]`,"data-testid":`settings-dialog`,children:[I,L,R,V]}),t[57]=R,t[58]=V,t[59]=H):H=t[59];let U;return t[60]!==r||t[61]!==n||t[62]!==H?(U=(0,Z.jsx)(Vo,{open:n,onOpenChange:r,children:H}),t[60]=r,t[61]=n,t[62]=H,t[63]=U):U=t[63],U}function lx(e){let t=(0,$.c)(12),{groups:n,activeId:r,onSelect:a}=e,{_:o}=i(),s;t[0]===o?s=t[1]:(s=o({id:`y1t8bQ`}),t[0]=o,t[1]=s);let c;if(t[2]!==r||t[3]!==n||t[4]!==a){let e;t[6]!==r||t[7]!==a?(e=e=>(0,Z.jsx)(ux,{group:e,activeId:r,onSelect:a},e.id),t[6]=r,t[7]=a,t[8]=e):e=t[8],c=n.map(e),t[2]=r,t[3]=n,t[4]=a,t[5]=c}else c=t[5];let l;return t[9]!==s||t[10]!==c?(l=(0,Z.jsx)(`nav`,{"aria-label":s,className:`flex shrink-0 gap-x-3 overflow-x-auto overscroll-contain subtle-scrollbar scroll-fade-mask-x-max-sm border-b bg-muted/30 px-3 py-2 max-sm:pt-10 sm:h-full sm:flex-col sm:gap-0 sm:overflow-x-visible sm:overflow-y-auto sm:border-r sm:border-b-0 sm:py-4`,children:c}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function ux(e){let t=(0,$.c)(28),{group:n,activeId:r,onSelect:i}=e;if(n.items.length===0)return null;let a=`settings-group-${n.id}`,o=`${a}-caption`,c=n.enabled?void 0:o,l=n.enabled?`text-muted-foreground/80`:`text-muted-foreground/50`,u;t[0]===l?u=t[1]:(u=X(`shrink-0 whitespace-nowrap px-2 text-xs font-semibold uppercase tracking-wide font-mono sm:mb-1`,l),t[0]=l,t[1]=u);let d;t[2]!==n.label||t[3]!==a||t[4]!==c||t[5]!==u?(d=(0,Z.jsx)(`h3`,{id:a,"aria-describedby":c,className:u,children:n.label}),t[2]=n.label,t[3]=a,t[4]=c,t[5]=u,t[6]=d):d=t[6];let f;t[7]!==o||t[8]!==n.enabled?(f=n.enabled?null:(0,Z.jsx)(`p`,{id:o,className:`px-2 text-xs italic text-muted-foreground/60 sm:mb-1`,children:(0,Z.jsx)(s,{id:`JWsZlx`})}),t[7]=o,t[8]=n.enabled,t[9]=f):f=t[9];let p;if(t[10]!==r||t[11]!==o||t[12]!==n.enabled||t[13]!==n.items||t[14]!==i){let e;t[16]!==r||t[17]!==o||t[18]!==n.enabled||t[19]!==i?(e=e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(`button`,{type:`button`,"aria-current":r===e.id?`page`:void 0,"aria-disabled":n.enabled?void 0:!0,"aria-describedby":n.enabled?void 0:o,tabIndex:n.enabled?0:-1,disabled:!n.enabled,onClick:()=>n.enabled&&i(e.id),"data-testid":`settings-sidebar-item-${e.id}`,className:X(`w-auto whitespace-nowrap rounded px-2 py-1.5 text-left text-sm transition-colors sm:w-full`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`,r===e.id&&n.enabled?`bg-accent text-accent-foreground`:`hover:bg-accent/50`),children:e.label})},e.id),t[16]=r,t[17]=o,t[18]=n.enabled,t[19]=i,t[20]=e):e=t[20],p=n.items.map(e),t[10]=r,t[11]=o,t[12]=n.enabled,t[13]=n.items,t[14]=i,t[15]=p}else p=t[15];let m;t[21]!==a||t[22]!==p?(m=(0,Z.jsx)(`ul`,{"aria-labelledby":a,className:`flex gap-1 sm:block sm:space-y-0.5`,children:p}),t[21]=a,t[22]=p,t[23]=m):m=t[23];let h;return t[24]!==d||t[25]!==f||t[26]!==m?(h=(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 sm:mb-4 sm:block`,children:[d,f,m]}),t[24]=d,t[25]=f,t[26]=m,t[27]=h):h=t[27],h}function dx(){let e=(0,$.c)(4),t,n,r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(s,{id:`GsBUCk`})}),n=(0,Z.jsx)(Wa,{className:`h-5 w-32`}),r=(0,Z.jsx)(Wa,{className:`h-4 w-64`}),e[0]=t,e[1]=n,e[2]=r):(t=e[0],n=e[1],r=e[2]);let i;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-3`,"data-testid":`settings-content-skeleton`,children:[t,n,r,(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(Wa,{className:`h-9 w-full`}),(0,Z.jsx)(Wa,{className:`h-9 w-full`})]})]}),e[3]=i):i=e[3],i}function fx(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`flex h-full w-full aria-[orientation=vertical]:flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(sy,{"data-slot":`resizable-panel-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function px(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(uy,{"data-slot":`resizable-panel`,...n}),t[2]=n,t[3]=r),r}function mx(e){let t=(0,$.c)(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({withHandle:i,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=X(`relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,n),t[4]=n,t[5]=a);let o;t[6]===i?o=t[7]:(o=i&&(0,Z.jsx)(`div`,{className:`z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border`}),t[6]=i,t[7]=o);let s;return t[8]!==r||t[9]!==a||t[10]!==o?(s=(0,Z.jsx)(my,{"data-slot":`resizable-handle`,className:a,...r,children:o}),t[8]=r,t[9]=a,t[10]=o,t[11]=s):s=t[11],s}function hx(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(Io,{"data-slot":`sheet`,...n}),t[2]=n,t[3]=r),r}function gx(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(zo,{"data-slot":`sheet-portal`,...n}),t[2]=n,t[3]=r),r}function _x(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(No,{"data-slot":`sheet-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function vx(e){let t=(0,$.c)(17),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,children:n,side:a,showCloseButton:o,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let c=a===void 0?`right`:a,l=o===void 0?!0:o,u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(_x,{}),t[6]=u):u=t[6];let d;t[7]===r?d=t[8]:(d=X(`fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10 motion-reduce:transition-none motion-reduce:duration-0 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none`,r),t[7]=r,t[8]=d);let f;t[9]===l?f=t[10]:(f=l&&(0,Z.jsx)(Ho,{"data-slot":`sheet-close`,asChild:!0,children:(0,Z.jsxs)(Di,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[(0,Z.jsx)(Oo,{}),(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(s,{id:`yz7wBu`})})]})}),t[9]=l,t[10]=f);let p;return t[11]!==n||t[12]!==i||t[13]!==c||t[14]!==d||t[15]!==f?(p=(0,Z.jsxs)(gx,{children:[u,(0,Z.jsxs)(Mo,{"data-slot":`sheet-content`,"data-side":c,className:d,...i,children:[n,f]})]}),t[11]=n,t[12]=i,t[13]=c,t[14]=d,t[15]=f,t[16]=p):p=t[16],p}function yx(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`flex flex-col gap-0.5 p-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sheet-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function bx(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`font-heading text-base font-medium text-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Po,{"data-slot":`sheet-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function xx(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`input-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Sx=ki(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function Cx(e){let t=(0,$.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,align:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`inline-start`:i,o;t[4]!==a||t[5]!==n?(o=X(Sx({align:a}),n),t[4]=a,t[5]=n,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,Z.jsx)(`div`,{"data-slot":`input-group-addon`,"data-align":a,className:o,onMouseDown:wx,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function wx(e){e.target.closest(`button`)||(e.preventDefault(),e.currentTarget.parentElement?.querySelector(`input`)?.focus())}ki(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function Tx(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`span`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ex(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=X(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Go,{"data-slot":`input-group-control`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Dx(e){let t=(0,$.c)(119),{findInputRef:n,query:r,replacement:a,replaceOpen:o,caseSensitive:c,wholeWord:l,current:u,total:d,onQueryChange:f,onReplacementChange:p,onReplaceOpenChange:m,onCaseSensitiveChange:h,onWholeWordChange:g,onNext:_,onPrevious:v,onReplaceCurrent:y,onReplaceAll:b,onClose:x}=e,{_:S}=i(),C=r.length>0,w=d>0,T;t[0]!==S||t[1]!==u||t[2]!==w||t[3]!==C||t[4]!==d?(T=C?w?`${u} / ${d}`:S({id:`Ev2r9A`}):``,t[0]=S,t[1]=u,t[2]=w,t[3]=C,t[4]=d,t[5]=T):T=t[5];let E=T,D;t[6]!==x||t[7]!==_||t[8]!==v?(D=function(e){e.key===`Enter`?(e.preventDefault(),e.shiftKey?v():_()):e.key===`Escape`&&(e.preventDefault(),x())},t[6]=x,t[7]=_,t[8]=v,t[9]=D):D=t[9];let O=D,k;t[10]!==x||t[11]!==y?(k=function(e){e.key===`Enter`?(e.preventDefault(),y()):e.key===`Escape`&&(e.preventDefault(),x())},t[10]=x,t[11]=y,t[12]=k):k=t[12];let A=k,j;t[13]===S?j=t[14]:(j=S({id:`MVxpbf`}),t[13]=S,t[14]=j);let M;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Z.jsx)(`label`,{className:`sr-only`,htmlFor:`ok-find-input`,children:(0,Z.jsx)(s,{id:`KujtjC`})}),t[15]=M):M=t[15];let N;t[16]===f?N=t[17]:(N=e=>f(e.target.value),t[16]=f,t[17]=N);let P;t[18]===S?P=t[19]:(P=S({id:`KujtjC`}),t[18]=S,t[19]=P);let F;t[20]!==n||t[21]!==O||t[22]!==r||t[23]!==N||t[24]!==P?(F=(0,Z.jsx)(Ex,{ref:n,id:`ok-find-input`,value:r,onChange:N,onKeyDown:O,placeholder:P,autoComplete:`off`,spellCheck:!1,className:`h-7 px-2 text-sm`}),t[20]=n,t[21]=O,t[22]=r,t[23]=N,t[24]=P,t[25]=F):F=t[25];let I;t[26]===S?I=t[27]:(I=S({id:`-8PP0T`}),t[26]=S,t[27]=I);let L;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(Xs,{"aria-hidden":`true`}),t[28]=L):L=t[28];let R;t[29]!==c||t[30]!==h||t[31]!==I?(R=(0,Z.jsx)($n,{asChild:!0,children:(0,Z.jsx)(wo,{type:`button`,variant:`segmented`,size:`sm`,"aria-label":I,pressed:c,onPressedChange:h,className:`size-6 min-w-6 px-0`,children:L})}),t[29]=c,t[30]=h,t[31]=I,t[32]=R):R=t[32];let z;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Z.jsx)(wn,{side:`bottom`,children:(0,Z.jsx)(s,{id:`-8PP0T`})}),t[33]=z):z=t[33];let B;t[34]===R?B=t[35]:(B=(0,Z.jsxs)(Kr,{children:[R,z]}),t[34]=R,t[35]=B);let V;t[36]===S?V=t[37]:(V=S({id:`_7UQ7y`}),t[36]=S,t[37]=V);let H;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,Z.jsx)(sl,{"aria-hidden":`true`}),t[38]=H):H=t[38];let U;t[39]!==g||t[40]!==V||t[41]!==l?(U=(0,Z.jsx)($n,{asChild:!0,children:(0,Z.jsx)(wo,{type:`button`,variant:`segmented`,size:`sm`,"aria-label":V,pressed:l,onPressedChange:g,className:`size-6 min-w-6 px-0`,children:H})}),t[39]=g,t[40]=V,t[41]=l,t[42]=U):U=t[42];let W;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Z.jsx)(wn,{side:`bottom`,children:(0,Z.jsx)(s,{id:`_7UQ7y`})}),t[43]=W):W=t[43];let G;t[44]===U?G=t[45]:(G=(0,Z.jsxs)(Kr,{children:[U,W]}),t[44]=U,t[45]=G);let ee;t[46]!==B||t[47]!==G?(ee=(0,Z.jsxs)(Cx,{align:`inline-end`,className:`gap-0.5`,children:[B,G]}),t[46]=B,t[47]=G,t[48]=ee):ee=t[48];let K;t[49]!==ee||t[50]!==F?(K=(0,Z.jsxs)(xx,{className:`h-7 w-56 rounded-[min(var(--radius-md),12px)]`,children:[F,ee]}),t[49]=ee,t[50]=F,t[51]=K):K=t[51];let q;t[52]===E?q=t[53]:(q=(0,Z.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`min-w-14 px-1 text-right text-muted-foreground text-xs tabular-nums shrink-0`,children:E}),t[52]=E,t[53]=q);let te;t[54]===S?te=t[55]:(te=S({id:`oqB2ez`}),t[54]=S,t[55]=te);let ne=!w,re;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Z.jsx)(_t,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[56]=re):re=t[56];let ie;t[57]!==v||t[58]!==te||t[59]!==ne?(ie=(0,Z.jsx)($n,{asChild:!0,children:(0,Z.jsx)(Di,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":te,disabled:ne,onClick:v,children:re})}),t[57]=v,t[58]=te,t[59]=ne,t[60]=ie):ie=t[60];let ae;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,Z.jsx)(wn,{side:`bottom`,children:(0,Z.jsx)(s,{id:`oqB2ez`})}),t[61]=ae):ae=t[61];let oe;t[62]===ie?oe=t[63]:(oe=(0,Z.jsxs)(Kr,{children:[ie,ae]}),t[62]=ie,t[63]=oe);let se;t[64]===S?se=t[65]:(se=S({id:`SiUUCS`}),t[64]=S,t[65]=se);let ce=!w,le;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,Z.jsx)(Dt,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[66]=le):le=t[66];let ue;t[67]!==_||t[68]!==se||t[69]!==ce?(ue=(0,Z.jsx)($n,{asChild:!0,children:(0,Z.jsx)(Di,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":se,disabled:ce,onClick:_,children:le})}),t[67]=_,t[68]=se,t[69]=ce,t[70]=ue):ue=t[70];let de;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,Z.jsx)(wn,{side:`bottom`,children:(0,Z.jsx)(s,{id:`SiUUCS`})}),t[71]=de):de=t[71];let fe;t[72]===ue?fe=t[73]:(fe=(0,Z.jsxs)(Kr,{children:[ue,de]}),t[72]=ue,t[73]=fe);let pe=o?`secondary`:`ghost`,me;t[74]!==S||t[75]!==o?(me=S(o?{id:`UkQGhd`}:{id:`1RluQD`}),t[74]=S,t[75]=o,t[76]=me):me=t[76];let he=o?`ok-replace-input`:void 0,ge;t[77]!==m||t[78]!==o?(ge=()=>m(!o),t[77]=m,t[78]=o,t[79]=ge):ge=t[79];let _e;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,Z.jsx)(Hc,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[80]=_e):_e=t[80];let ve;t[81]!==o||t[82]!==pe||t[83]!==me||t[84]!==he||t[85]!==ge?(ve=(0,Z.jsx)($n,{asChild:!0,children:(0,Z.jsx)(Di,{type:`button`,variant:pe,size:`icon-sm`,"aria-label":me,"aria-expanded":o,"aria-controls":he,onClick:ge,children:_e})}),t[81]=o,t[82]=pe,t[83]=me,t[84]=he,t[85]=ge,t[86]=ve):ve=t[86];let ye;t[87]===o?ye=t[88]:(ye=(0,Z.jsx)(wn,{side:`bottom`,children:o?(0,Z.jsx)(s,{id:`UkQGhd`}):(0,Z.jsx)(s,{id:`1RluQD`})}),t[87]=o,t[88]=ye);let be;t[89]!==ve||t[90]!==ye?(be=(0,Z.jsxs)(Kr,{children:[ve,ye]}),t[89]=ve,t[90]=ye,t[91]=be):be=t[91];let xe;t[92]!==S||t[93]!==A||t[94]!==w||t[95]!==b||t[96]!==y||t[97]!==p||t[98]!==o||t[99]!==a?(xe=o?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`label`,{className:`sr-only`,htmlFor:`ok-replace-input`,children:(0,Z.jsx)(s,{id:`fqSfXY`})}),(0,Z.jsx)(Go,{id:`ok-replace-input`,value:a,onChange:e=>p(e.target.value),onKeyDown:A,placeholder:S({id:`fqSfXY`}),autoComplete:`off`,spellCheck:!1,className:`h-7 w-48 rounded-[min(var(--radius-md),12px)] px-2 text-sm shadow-none focus-visible:ring-2`}),(0,Z.jsxs)(Kr,{children:[(0,Z.jsx)($n,{asChild:!0,children:(0,Z.jsx)(Di,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":S({id:`bS_boY`}),disabled:!w,onClick:y,children:(0,Z.jsx)(Hc,{"data-icon":`inline-start`,"aria-hidden":`true`})})}),(0,Z.jsx)(wn,{side:`bottom`,children:(0,Z.jsx)(s,{id:`bS_boY`})})]}),(0,Z.jsxs)(Kr,{children:[(0,Z.jsx)($n,{asChild:!0,children:(0,Z.jsx)(Di,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":S({id:`dr1vFs`}),disabled:!w,onClick:b,children:(0,Z.jsx)(Vc,{"data-icon":`inline-start`,"aria-hidden":`true`})})}),(0,Z.jsx)(wn,{side:`bottom`,children:(0,Z.jsx)(s,{id:`dr1vFs`})})]})]}):null,t[92]=S,t[93]=A,t[94]=w,t[95]=b,t[96]=y,t[97]=p,t[98]=o,t[99]=a,t[100]=xe):xe=t[100];let Se;t[101]===S?Se=t[102]:(Se=S({id:`wJo9oS`}),t[101]=S,t[102]=Se);let Ce;t[103]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,Z.jsx)(Oo,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[103]=Ce):Ce=t[103];let we;t[104]!==x||t[105]!==Se?(we=(0,Z.jsx)($n,{asChild:!0,children:(0,Z.jsx)(Di,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":Se,onClick:x,children:Ce})}),t[104]=x,t[105]=Se,t[106]=we):we=t[106];let Te;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,Z.jsx)(wn,{side:`bottom`,children:(0,Z.jsx)(s,{id:`yz7wBu`})}),t[107]=Te):Te=t[107];let Ee;t[108]===we?Ee=t[109]:(Ee=(0,Z.jsxs)(Kr,{children:[we,Te]}),t[108]=we,t[109]=Ee);let De;return t[110]!==K||t[111]!==q||t[112]!==oe||t[113]!==fe||t[114]!==j||t[115]!==be||t[116]!==xe||t[117]!==Ee?(De=(0,Z.jsxs)(`search`,{"data-testid":`find-replace-bar`,"aria-label":j,className:`pointer-events-auto flex max-w-[min(calc(100vw-1rem),720px)] touch-manipulation items-center gap-1 rounded-[calc(var(--radius)+2px)] border border-input bg-popover/95 p-1 text-popover-foreground shadow-md shadow-black/10 backdrop-blur`,children:[M,K,q,oe,fe,be,xe,Ee]}),t[110]=K,t[111]=q,t[112]=oe,t[113]=fe,t[114]=j,t[115]=be,t[116]=xe,t[117]=Ee,t[118]=De):De=t[118],De}var Ox={current:0,total:0},kx=120,Ax=100;function jx(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=()=>e?W(e):null,t[0]=e,t[1]=n),(0,Q.useSyncExternalStore)(re,n,Mx)}function Mx(){return null}function Nx(e){if(!e||e.isDestroyed)return null;let{from:t,to:n,empty:r}=e.state.selection;if(r)return null;let i=e.state.doc.textBetween(t,n,`
|
|
25
25
|
`,`
|
|
26
26
|
`).trim();return i.length===0||i.length>kx||i.includes(`
|
|
27
27
|
`)?null:i}function Px(e,t){return(Jn()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&e.key.toLocaleLowerCase()===t}function Fx(e){let t=e.key.toLocaleLowerCase();return Jn()?e.metaKey&&e.altKey&&!e.ctrlKey&&t===`f`:e.ctrlKey&&!e.metaKey&&!e.altKey&&t===`h`}function Ix(e){let t=ze(e.state);return{current:t.matches.length===0?0:t.activeIndex+1,total:t.matches.length}}function Lx(e,t){return e.current===t.current&&e.total===t.total}function Rx(e,t,n){e&&!e.isDestroyed&&(e.commands.clearFindMatches(),e.commands.focus()),t(e=>({...e,open:!1,activeIndex:0})),n(Ox)}function zx(e){!e||e.isDestroyed||typeof window>`u`||window.requestAnimationFrame(()=>{if(e.isDestroyed)return;let t=de(e);if(!t)return;let n=t.dom.querySelector(`.ok-find-match-active`);n instanceof HTMLElement&&n.scrollIntoView({block:`center`,inline:`nearest`,behavior:`auto`})})}function Bx(e){let t=(0,$.c)(81),{activeDocName:n,isSourceMode:r}=e,i=jx(n),a=(0,Q.useRef)(null),o=(0,Q.useRef)(null),s=(0,Q.useRef)(n),c=(0,Q.useRef)(0),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l={open:!1,replaceOpen:!1,query:``,replacement:``,caseSensitive:!1,wholeWord:!1,activeIndex:0},t[0]=l):l=t[0];let[u,d]=(0,Q.useState)(l),[f,p]=(0,Q.useState)(Ox),m,h;t[1]===n?(m=t[2],h=t[3]):(m=()=>{s.current!==n&&(s.current=n,d(Hx))},h=[n],t[1]=n,t[2]=m,t[3]=h),(0,Q.useEffect)(m,h);let g,_;t[4]===u.activeIndex?(g=t[5],_=t[6]):(g=()=>{c.current=u.activeIndex},_=[u.activeIndex],t[4]=u.activeIndex,t[5]=g,t[6]=_),(0,Q.useEffect)(g,_);let v,y;t[7]===i?(v=t[8],y=t[9]):(v=()=>{let e=o.current;e&&e!==i&&!e.isDestroyed&&e.commands.clearFindMatches(),o.current=i},y=[i],t[7]=i,t[8]=v,t[9]=y),(0,Q.useEffect)(v,y);let b,x;t[10]===u.open?(b=t[11],x=t[12]):(b=()=>{if(!u.open||!a.current)return;let e=requestAnimationFrame(()=>{a.current?.focus(),a.current?.select()});return()=>cancelAnimationFrame(e)},x=[u.open],t[10]=u.open,t[11]=b,t[12]=x),(0,Q.useEffect)(b,x);let S,C;t[13]!==u.open||t[14]!==r?(S=()=>{!u.open||!r||d(Vx)},C=[u.open,r],t[13]=u.open,t[14]=r,t[15]=S,t[16]=C):(S=t[15],C=t[16]),(0,Q.useEffect)(S,C);let w,T;t[17]!==i||t[18]!==u.caseSensitive||t[19]!==u.open||t[20]!==u.query||t[21]!==u.wholeWord||t[22]!==r?(w=()=>{if(!i||i.isDestroyed){p(Ox);return}if(!u.open||r){i.commands.clearFindMatches(),p(Ox);return}let e=window.setTimeout(()=>{if(i.isDestroyed)return;i.commands.setFindQuery(u.query,{options:{caseSensitive:u.caseSensitive,wholeWord:u.wholeWord},activeIndex:c.current});let e=Ix(i);p(t=>Lx(t,e)?t:e)},Ax);return()=>window.clearTimeout(e)},T=[i,u.open,u.query,u.caseSensitive,u.wholeWord,r],t[17]=i,t[18]=u.caseSensitive,t[19]=u.open,t[20]=u.query,t[21]=u.wholeWord,t[22]=r,t[23]=w,t[24]=T):(w=t[23],T=t[24]),(0,Q.useEffect)(w,T);let E,D;t[25]!==i||t[26]!==u.open||t[27]!==r?(E=()=>{if(!i||i.isDestroyed||!u.open||r)return;let e=()=>{let e=ze(i.state),t=Ix(i);p(e=>Lx(e,t)?e:t),d(t=>t.activeIndex===e.activeIndex?t:{...t,activeIndex:e.activeIndex})};return i.on(`transaction`,e),()=>{i.off(`transaction`,e)}},D=[i,u.open,r],t[25]=i,t[26]=u.open,t[27]=r,t[28]=E,t[29]=D):(E=t[28],D=t[29]),(0,Q.useEffect)(E,D);let O,k;t[30]!==n||t[31]!==i||t[32]!==u.open||t[33]!==r?(O=()=>{let e=function(e){let t=Nx(i);d(n=>({...n,open:!0,replaceOpen:e,query:t??n.query,activeIndex:0}))},t=function(t){if(!(!n||r||t.defaultPrevented)){if(Px(t,`f`)){t.preventDefault(),u.open?Rx(i,d,p):e(!1);return}if(Fx(t)){t.preventDefault(),e(!0);return}if(Px(t,`g`)&&u.open){t.preventDefault(),(t.shiftKey?i?.commands.selectPreviousFindMatch():i?.commands.selectNextFindMatch())&&zx(i);return}t.key===`Escape`&&u.open&&(t.preventDefault(),Rx(i,d,p))}};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},k=[n,i,u.open,r],t[30]=n,t[31]=i,t[32]=u.open,t[33]=r,t[34]=O,t[35]=k):(O=t[34],k=t[35]),(0,Q.useEffect)(O,k);let A;t[36]!==i||t[37]!==u.caseSensitive||t[38]!==u.query||t[39]!==u.wholeWord?(A=function(){return!i||i.isDestroyed?!1:(i.commands.setFindQuery(u.query,{options:{caseSensitive:u.caseSensitive,wholeWord:u.wholeWord},activeIndex:c.current}),!0)},t[36]=i,t[37]=u.caseSensitive,t[38]=u.query,t[39]=u.wholeWord,t[40]=A):A=t[40];let j=A,M;t[41]===i?M=t[42]:(M=function(){if(!i||i.isDestroyed)return;let e=ze(i.state),t=Ix(i);p(e=>Lx(e,t)?e:t),d(t=>t.activeIndex===e.activeIndex?t:{...t,activeIndex:e.activeIndex})},t[41]=i,t[42]=M);let N=M,P;t[43]===i?P=t[44]:(P=function(){Rx(i,d,p)},t[43]=i,t[44]=P);let F=P,I;t[45]!==j||t[46]!==i||t[47]!==N?(I=function(){!i||i.isDestroyed||(j(),i.commands.selectNextFindMatch()&&zx(i),N())},t[45]=j,t[46]=i,t[47]=N,t[48]=I):I=t[48];let L=I,R;t[49]!==j||t[50]!==i||t[51]!==N?(R=function(){!i||i.isDestroyed||(j(),i.commands.selectPreviousFindMatch()&&zx(i),N())},t[49]=j,t[50]=i,t[51]=N,t[52]=R):R=t[52];let z=R,B;t[53]!==j||t[54]!==i||t[55]!==u.replacement||t[56]!==N?(B=function(){!i||i.isDestroyed||(j(),i.commands.replaceCurrentFindMatch(u.replacement)&&zx(i),N())},t[53]=j,t[54]=i,t[55]=u.replacement,t[56]=N,t[57]=B):B=t[57];let V=B,H;t[58]!==j||t[59]!==i||t[60]!==u.replacement||t[61]!==N?(H=function(){!i||i.isDestroyed||(j(),i.commands.replaceAllFindMatches(u.replacement)&&zx(i),N())},t[58]=j,t[59]=i,t[60]=u.replacement,t[61]=N,t[62]=H):H=t[62];let U=H;if(!u.open||!n||r)return null;let W,G,ee,K,q;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(W=e=>d(t=>({...t,query:e,activeIndex:0})),G=e=>d(t=>({...t,replacement:e})),ee=e=>d(t=>({...t,replaceOpen:e})),K=e=>d(t=>({...t,caseSensitive:e})),q=e=>d(t=>({...t,wholeWord:e})),t[63]=W,t[64]=G,t[65]=ee,t[66]=K,t[67]=q):(W=t[63],G=t[64],ee=t[65],K=t[66],q=t[67]);let te;return t[68]!==F||t[69]!==u.caseSensitive||t[70]!==u.query||t[71]!==u.replaceOpen||t[72]!==u.replacement||t[73]!==u.wholeWord||t[74]!==f.current||t[75]!==f.total||t[76]!==U||t[77]!==V||t[78]!==L||t[79]!==z?(te=(0,Z.jsx)(`div`,{className:`editor-content-aligned pointer-events-none absolute inset-x-0 top-2 z-30 px-2`,children:(0,Z.jsx)(`div`,{className:`flex justify-end`,children:(0,Z.jsx)(Dx,{findInputRef:a,query:u.query,replacement:u.replacement,replaceOpen:u.replaceOpen,caseSensitive:u.caseSensitive,wholeWord:u.wholeWord,current:f.current,total:f.total,onQueryChange:W,onReplacementChange:G,onReplaceOpenChange:ee,onCaseSensitiveChange:K,onWholeWordChange:q,onNext:L,onPrevious:z,onReplaceCurrent:V,onReplaceAll:U,onClose:F})})}),t[68]=F,t[69]=u.caseSensitive,t[70]=u.query,t[71]=u.replaceOpen,t[72]=u.replacement,t[73]=u.wholeWord,t[74]=f.current,t[75]=f.total,t[76]=U,t[77]=V,t[78]=L,t[79]=z,t[80]=te):te=t[80],te}function Vx(e){return{...e,open:!1,activeIndex:0}}function Hx(e){return{...e,activeIndex:0}}var Ux=960,Wx=1024;function Gx(){let e=(0,$.c)(5),[t,n]=(0,Q.useState)(qx),[r,i]=(0,Q.useState)(Kx),a,o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{let e=window.matchMedia(`(max-width: ${Ux-1}px)`),t=window.matchMedia(`(max-width: ${Wx-1}px)`),r=()=>{let r=e.matches;n(r?`sheet`:`panel`),i(!r&&t.matches)};return e.addEventListener(`change`,r),t.addEventListener(`change`,r),()=>{e.removeEventListener(`change`,r),t.removeEventListener(`change`,r)}},o=[],e[0]=a,e[1]=o):(a=e[0],o=e[1]),(0,Q.useEffect)(a,o);let s;return e[2]!==r||e[3]!==t?(s={layout:t,autoCollapse:r},e[2]=r,e[3]=t,e[4]=s):s=e[4],s}function Kx(){return window.innerWidth>=Ux&&window.innerWidth<Wx}function qx(){return window.innerWidth<Ux?`sheet`:`panel`}var Jx={words:0,chars:0,tokens:0},Yx=/[ -〿-ゟ゠-ヿ㐀-䶿一-鿿豈---ក-]/,Xx=/[\p{L}\p{N}]/u,Zx=new Set([`text`,`inlineCode`,`code`,`tag`]),Qx=new Set([`html`,`definition`,`footnoteDefinition`,`yaml`,`toml`,`image`,`imageReference`,`mdxFlowExpression`,`mdxTextExpression`,`mdxjsEsm`,`rawMdxFallback`,`rawMdxFallbackMdast`]),$x=new Set([`paragraph`,`heading`,`blockquote`,`list`,`listItem`,`thematicBreak`,`table`,`tableRow`,`tableCell`,`mdxJsxFlowElement`,`commentBlock`]);function eS(e,t){if(!e)return;let n=e.type;if(!Qx.has(n)){if(Zx.has(n)){e.value&&(t.push(e.value),n===`code`&&t.push(`
|