@inkeep/open-knowledge 0.64.0-beta.5 → 0.64.0-beta.6
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/{acp-harness-probe-Bz_Xfqhw.mjs → acp-harness-probe-D_lhich9.mjs} +2 -2
- package/dist/cli.mjs +46 -46
- package/dist/constants-DSfO4eVq.mjs +2 -0
- package/dist/index.d.mts +63 -63
- package/dist/index.mjs +24 -27
- package/dist/{init-JIlCRbdu.mjs → init-D0BDn7f7.mjs} +37 -35
- package/dist/init-lbIkEn-7.mjs +1 -0
- package/dist/{launch-json-removal-D1H1a769.mjs → launch-json-removal-E2Emd_xL.mjs} +2 -2
- package/dist/{loader-BkOiHFr0.mjs → loader-Dic2UiPX.mjs} +2 -2
- package/dist/loader-SF4k-CtY.mjs +1 -0
- package/dist/preview-B45QjIFM.mjs +1 -0
- package/dist/{preview-BF5V_rVP.mjs → preview-DxNiuv8Z.mjs} +2 -2
- package/dist/public/assets/{ActivityModeContent-CauWCpUS.js → ActivityModeContent-CM-GULni.js} +1 -1
- package/dist/public/assets/{AddPropertiesButton-BNouQBfs.js → AddPropertiesButton-BonXQZBb.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-DXQNRZ8O.js → AgentDiffPane-CY_Kh6zE.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-DX8Yunfs.js → CodeMirrorPropInput-B4qzFbMb.js} +1 -1
- package/dist/public/assets/{ConfigSharingInfoTooltip-CmY8gl8k.js → ConfigSharingInfoTooltip-D7VVLhT-.js} +1 -1
- package/dist/public/assets/{ConsentDialogBody-C4z025ef.js → ConsentDialogBody-BcI0XBtZ.js} +1 -1
- package/dist/public/assets/{DocumentContext-BV7jb-np.js → DocumentContext-CWz_S-8Y.js} +1 -1
- package/dist/public/assets/{EditorModeToggle-B8yEewMp.js → EditorModeToggle-DvR5Uhpn.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-uAw_zEkg.js → EnableSyncConfirmDialog-C0npXrd0.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-DhTxtSyA.js → ExcalidrawDocEditor--9rt-v5P.js} +1 -1
- package/dist/public/assets/FeedbackForm-CrDxI1gD.js +1 -0
- package/dist/public/assets/{ImportSkillDialog-BYfuLW-m.js → ImportSkillDialog-Rf5irQi0.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-pJBzAP1G.js → LintConfigEditor-BSZM3DOq.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-D9I4uhwb.js +1 -0
- package/dist/public/assets/{ManagedArtifactProperties-D1f8Frip.js → ManagedArtifactProperties-PAdBvvQU.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-DVxgZCM4.js → MermaidDocEditor-CIH-CyLp.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-9aYyPFhc.js → PropertyDisplayRow-BD9j04sT.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-0hGeiywr.js → SchemaConfigEditor-B5d42qqi.js} +1 -1
- package/dist/public/assets/{SessionsHost-BegjN_Wv.js → SessionsHost-tCIPBfVb.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-Bng9Ek1r.js → SettingsDialogBody-3YR6pboc.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-C2M-0S6A.js → ShareReceiveMissDialog-GhU-86Ae.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-C5Y79gdz.js → SkillInstallMenu-fmfgMHDX.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-DEiTj33j.js → SkillToolbarControls-zY1zUpBC.js} +1 -1
- package/dist/public/assets/{SourceEditor-DzxE90kB.js → SourceEditor-DxF-o0um.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-zabnp2hc.js → TerminalWindowApp-BKKGl39U.js} +1 -1
- package/dist/public/assets/{TextDocEditor-5pSurn6C.js → TextDocEditor-DQciJBia.js} +1 -1
- package/dist/public/assets/{ThreadView-DY925XKN.js → ThreadView-c4uz4TOM.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-BOSthuzR.js → TimelineDiffPane-CT8c3ZZt.js} +1 -1
- package/dist/public/assets/{agent-diff-store-CWlSMAcS.js → agent-diff-store-C5NTN94s.js} +1 -1
- package/dist/public/assets/{auth-state-cache-DN_6SHvB.js → auth-state-cache-PGSY7AYC.js} +1 -1
- package/dist/public/assets/{comment-chips-BtWBKUUL.js → comment-chips-BZuXrN3J.js} +1 -1
- package/dist/public/assets/{config-provider-BXiukxwE.js → config-provider--5n4V-Rz.js} +3 -3
- package/dist/public/assets/i18n-Cx87c5FS.js +1 -0
- package/dist/public/assets/{index-CEIpyn32.js → index-OXAZPX0P.js} +8 -8
- package/dist/public/assets/messages-B9uyxP_H.js +1 -0
- package/dist/public/assets/messages-BLwllinW.js +1 -0
- package/dist/public/assets/messages-BZWorwK3.js +1 -0
- package/dist/public/assets/messages-D7AnVjIw.js +1 -0
- package/dist/public/assets/messages-DAHADeiL.js +1 -0
- package/dist/public/assets/messages-DDndetWV.js +1 -0
- package/dist/public/assets/messages-DxC7zjnD.js +1 -0
- package/dist/public/assets/messages-KWmAiebh.js +1 -0
- package/dist/public/assets/messages-Nq0oR04x.js +1 -0
- package/dist/public/assets/messages-S1CnfW0H.js +1 -0
- package/dist/public/assets/messages-dWZ1vd3M.js +1 -0
- package/dist/public/assets/messages-nGkaHLTU.js +1 -0
- package/dist/public/assets/{pending-receive-nav-store-DLOxz1b_.js → pending-receive-nav-store-BFnfSwLK.js} +1 -1
- package/dist/public/assets/{progress-BtHJSSZk.js → progress-BTmgAyrD.js} +1 -1
- package/dist/public/assets/{project-paths-BN2qP-Oz.js → project-paths-VEOKTjqe.js} +1 -1
- package/dist/public/assets/{selection-context-C0Dh06ez.js → selection-context-BANifgSV.js} +1 -1
- package/dist/public/assets/{src-XvoJ42p_.js → src--RAOoioI.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-CtCPp1ik.js → typing-burst-detector-9KG7xADF.js} +1 -1
- package/dist/public/assets/{uninstall-Be_VK869.js → uninstall-oRFn7evP.js} +1 -1
- package/dist/public/assets/{use-activity-panel-Bat2VfJF.js → use-activity-panel-eHjQUm9s.js} +1 -1
- package/dist/public/assets/{use-open-skill-B004qnQw.js → use-open-skill-V4-GEbyH.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-ST2-eUch.js → use-terminal-enabled-Bv6fREpc.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-C-o8h9N3.js → use-timeline-entry-diff-DyUPWST_.js} +1 -1
- package/dist/public/index.html +22 -22
- package/dist/public/uninstall.html +3 -3
- package/dist/{repair-launch-json-BVjKD52o.mjs → repair-launch-json-Dn7NGvNk.mjs} +2 -2
- package/dist/{repair-mcp-configs-BQ7U1U_I.mjs → repair-mcp-configs-B6Apo_gM.mjs} +2 -2
- package/dist/{src-CnywvEPN.mjs → src-B7T0oZT0.mjs} +2 -2
- package/dist/src-CcDHHPDS.mjs +1 -0
- package/dist/{start-ClCOtrI0.mjs → start-02m6vu7b.mjs} +2 -2
- package/dist/start-BPz8-2Tj.mjs +1 -0
- package/package.json +4 -4
- package/dist/constants-BgJb28Cb.mjs +0 -2
- package/dist/init-Cpnor43q.mjs +0 -1
- package/dist/loader-ROlCo-Nz.mjs +0 -1
- package/dist/preview-PgQuIcNJ.mjs +0 -1
- package/dist/public/assets/FeedbackForm-DJ9TwFhA.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-CFDGVAK1.js +0 -1
- package/dist/public/assets/i18n-CHdOLU04.js +0 -1
- package/dist/public/assets/messages-B9v-Dl6o.js +0 -1
- package/dist/public/assets/messages-BNKgouAQ.js +0 -1
- package/dist/public/assets/messages-BWVpwygE.js +0 -1
- package/dist/public/assets/messages-BdoFX7Ke.js +0 -1
- package/dist/public/assets/messages-BozLzcJu.js +0 -1
- package/dist/public/assets/messages-C0rOkBCJ.js +0 -1
- package/dist/public/assets/messages-CF7zITDG.js +0 -1
- package/dist/public/assets/messages-CIBqdK6N.js +0 -1
- package/dist/public/assets/messages-CfXBJncQ.js +0 -1
- package/dist/public/assets/messages-DXdzgbRq.js +0 -1
- package/dist/public/assets/messages-G8fhkSEs.js +0 -1
- package/dist/public/assets/messages-z_LlF45n.js +0 -1
- package/dist/src-7XhmCEkb.mjs +0 -1
- package/dist/start-CxNMq7dN.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-Cym3gapE.js";import{n as s}from"./dist-CJhtNlOm2.js";import{t as c}from"./createLucideIcon-BulbvLvN.js";import{_ as l,c as u,i as d,l as f,m as p,n as m,o as h,t as g}from"./EnableSyncConfirmDialog-uAw_zEkg.js";import{t as _}from"./arrow-up-right-BTi7mHwL.js";import{t as v}from"./check-Dut4Aov8.js";import{t as y}from"./folder-open-BWpLO6wT.js";import{t as b}from"./info-SlzbpjOb.js";import{t as x}from"./spinner-t7GahFcQ.js";import{n as S}from"./miss-dialog-store-DVpIaq34.js";import{t as C}from"./refresh-cw-DwRz6AkS.js";import{t as w}from"./triangle-alert-D0n54WVY.js";import{g as T,r as E,s as D}from"./doc-paths-DMctW8qz.js";import{t as O}from"./external-link-DGqXfQJy.js";var k=c(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),A=c(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),j=c(`file-x-corner`,[[`path`,{d:`M11 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5`,key:`1jo35a`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m15 17 5 5`,key:`36xl1x`}],[`path`,{d:`m20 17-5 5`,key:`vdz27y`}]]),M=a(),N=e(n(),1),P=t(),F=`https://git-scm.com/docs/git-push`;function I(e,t){return e===`empty`?!0:!(e!==`stale`&&e!==`absent`||e===`stale`&&t?.syncEnabled===!0)}function ee(e){return e?e.state!==`dormant`&&e.state!==`disabled`&&e.state!==`auth-error`&&e.state!==`conflict`:!1}function L(e){let t=(0,M.c)(52),{freshness:n,status:a,kind:s}=e,{_:c}=i(),{confirmOpen:l,setConfirmOpen:u,onToggleRequest:f,onConfirm:p}=d(h()),[y,S]=(0,N.useState)(`idle`),T=(0,N.useRef)(null),E,D;if(t[0]!==a||t[1]!==y?(E=()=>{if(!(y!==`pending`||!a)){if(a.pushError||a.pushErrorCode){S(`idle`);return}(a.lastSyncUtc??null)!==T.current&&S(`synced`)}},D=[y,a],t[0]=a,t[1]=y,t[2]=E,t[3]=D):(E=t[2],D=t[3]),(0,N.useEffect)(E,D),!I(n,a))return null;if(n===`empty`){let e;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),t[4]=e):e=t[4];let n;t[5]===c?n=t[6]:(n=c({id:`eazHgv`}),t[5]=c,t[6]=n);let r;return t[7]===n?r=t[8]:(r=(0,P.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed border-border bg-muted/40 p-2 text-xs text-muted-foreground`,"data-testid":`share-freshness-row`,children:[e,(0,P.jsx)(`span`,{children:n})]}),t[7]=n,t[8]=r),r}if(y===`synced`){let e;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed border-border bg-muted/40 p-2 text-xs text-muted-foreground`,"data-testid":`share-freshness-row`,children:[(0,P.jsx)(v,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),(0,P.jsx)(`span`,{children:(0,P.jsx)(r,{id:`fxbCNQ`})})]}),t[9]=e):e=t[9],e}let O=a?.syncEnabled===!0,k=a?.pushPermission?.checkStatus===`denied`,A=!!(a?.pushError||a?.pushErrorCode),j=k||A,L=n===`absent`&&!O,B;if(n===`absent`&&!O){let e;t[10]!==c||t[11]!==s?(e=c(s===`folder`?{id:`PrJYSN`}:{id:`3BnyYc`}),t[10]=c,t[11]=s,t[12]=e):e=t[12],B=e}else if(n===`stale`){let e;t[13]!==c||t[14]!==s?(e=c(s===`folder`?{id:`Gt4gOO`}:{id:`2IYGkU`}),t[13]=c,t[14]=s,t[15]=e):e=t[15],B=e}else{let e;t[16]!==c||t[17]!==s?(e=c(s===`folder`?{id:`nqV0Kk`}:{id:`gwykHF`}),t[16]=c,t[17]=s,t[18]=e):e=t[18],B=e}let V;t[19]!==c||t[20]!==A||t[21]!==k?(V=k?c({id:`9OIqw4`}):A?c({id:`K6MQQk`}):null,t[19]=c,t[20]=A,t[21]=k,t[22]=V):V=t[22];let H=V,U;t[23]===a?.lastSyncUtc?U=t[24]:(U=()=>{T.current=a?.lastSyncUtc??null,S(`pending`),m(`sync`).catch(e=>{console.warn(`[share-freshness] sync trigger failed`,e instanceof Error?e.message:e),S(`idle`)})},t[23]=a?.lastSyncUtc,t[24]=U);let W=U,G=L?w:b,K;t[25]===G?K=t[26]:(K=(0,P.jsx)(G,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),t[25]=G,t[26]=K);let q;t[27]===B?q=t[28]:(q=(0,P.jsx)(`span`,{children:B}),t[27]=B,t[28]=q);let J;t[29]===H?J=t[30]:(J=H?(0,P.jsx)(`span`,{children:H}):null,t[29]=H,t[30]=J);let Y;t[31]!==j||t[32]!==W||t[33]!==f||t[34]!==a||t[35]!==O||t[36]!==y?(Y=j?null:O?ee(a)?(0,P.jsx)(`div`,{children:y===`pending`?(0,P.jsxs)(o,{variant:`outline`,size:`xs`,disabled:!0,children:[(0,P.jsx)(x,{icon:C,className:`size-3 shrink-0`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`EHu0x2`})]}):(0,P.jsx)(o,{variant:`outline`,size:`xs`,onClick:W,children:(0,P.jsx)(r,{id:`lb_UU4`})})}):null:(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5`,children:[(0,P.jsx)(o,{variant:`outline`,size:`xs`,onClick:()=>f(!0),children:(0,P.jsx)(r,{id:`pPiV8s`})}),(0,P.jsxs)(`a`,{href:F,target:`_blank`,rel:`noopener noreferrer`,onClick:z,onAuxClick:R,className:`inline-flex items-center gap-1 transition-colors hover:text-primary`,children:[(0,P.jsx)(r,{id:`GLxIKR`}),(0,P.jsx)(_,{className:`size-3 shrink-0`,"aria-hidden":`true`})]})]}),t[31]=j,t[32]=W,t[33]=f,t[34]=a,t[35]=O,t[36]=y,t[37]=Y):Y=t[37];let X;t[38]!==q||t[39]!==J||t[40]!==Y?(X=(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[q,J,Y]}),t[38]=q,t[39]=J,t[40]=Y,t[41]=X):X=t[41];let Z;t[42]!==K||t[43]!==X?(Z=(0,P.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed border-border bg-muted/40 p-2 text-xs text-muted-foreground`,"data-testid":`share-freshness-row`,children:[K,X]}),t[42]=K,t[43]=X,t[44]=Z):Z=t[44];let Q;t[45]!==l||t[46]!==p||t[47]!==u?(Q=(0,P.jsx)(g,{open:l,onOpenChange:u,onConfirm:p}),t[45]=l,t[46]=p,t[47]=u,t[48]=Q):Q=t[48];let $;return t[49]!==Z||t[50]!==Q?($=(0,P.jsxs)(P.Fragment,{children:[Z,Q]}),t[49]=Z,t[50]=Q,t[51]=$):$=t[51],$}function R(e){return O(e,F)}function z(e){return O(e,F)}function B(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function V(e){let t=(0,M.c)(17),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={phase:`pending`},t[0]=n):n=t[0];let[r,i]=(0,N.useState)(n),[a,o]=(0,N.useState)(0),s=e.branch,c;t[1]!==s||t[2]!==e.contentRootDepth||t[3]!==e.kind||t[4]!==e.path||t[5]!==e.repositoryPath?(c=()=>{let t=window.okDesktop??null;if(!t||s===null){i({phase:`resolved`,resolution:{verdict:`unknown`}});return}let n=!1;return t.project.fetchTargetStatus({projectPath:t.config.projectPath,branch:s,path:e.repositoryPath??e.path,kind:e.kind,...e.contentRootDepth===void 0?{}:{contentRootDepth:e.contentRootDepth}}).then(e=>{n||i({phase:`resolved`,resolution:e??{verdict:`unknown`}})}).catch(e=>{n||(console.warn(`[receive] miss target-status fetch failed`,e instanceof Error?e.message:e),i({phase:`resolved`,resolution:{verdict:`unknown`}}))}),()=>{n=!0}},t[1]=s,t[2]=e.contentRootDepth,t[3]=e.kind,t[4]=e.path,t[5]=e.repositoryPath,t[6]=c):c=t[6];let l;t[7]!==s||t[8]!==a||t[9]!==e.contentRootDepth||t[10]!==e.kind||t[11]!==e.path||t[12]!==e.repositoryPath?(l=[s,e.kind,e.path,e.repositoryPath,e.contentRootDepth,a],t[7]=s,t[8]=a,t[9]=e.contentRootDepth,t[10]=e.kind,t[11]=e.path,t[12]=e.repositoryPath,t[13]=l):l=t[13],(0,N.useEffect)(c,l);let u;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{i({phase:`pending`}),o(H)},t[14]=u):u=t[14];let d;return t[15]===r?d=t[16]:(d={state:r,refetch:u},t[15]=r,t[16]=d),d}function H(e){return e+1}function U(e){let t=(0,M.c)(15),{onEnabled:n}=e,i=h(),a;t[0]===n?a=t[1]:(a={onEnabled:n},t[0]=n,t[1]=a);let{confirmOpen:s,setConfirmOpen:c,onToggleRequest:l,onConfirm:u}=d(i,a),f;t[2]===l?f=t[3]:(f=()=>l(!0),t[2]=l,t[3]=f);let p,m;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,P.jsx)(C,{className:`size-4`,"aria-hidden":`true`}),m=(0,P.jsx)(r,{id:`pPiV8s`}),t[4]=p,t[5]=m):(p=t[4],m=t[5]);let _;t[6]===f?_=t[7]:(_=(0,P.jsxs)(o,{onClick:f,"data-testid":`share-receive-miss-enable-sync`,children:[p,m]}),t[6]=f,t[7]=_);let v;t[8]!==s||t[9]!==u||t[10]!==c?(v=(0,P.jsx)(g,{open:s,onOpenChange:c,onConfirm:u}),t[8]=s,t[9]=u,t[10]=c,t[11]=v):v=t[11];let y;return t[12]!==_||t[13]!==v?(y=(0,P.jsxs)(P.Fragment,{children:[_,v]}),t[12]=_,t[13]=v,t[14]=y):y=t[14],y}function W(e){let t=(0,M.c)(23),{status:n,onSyncCompleted:a}=e,{_:c}=i(),[l,u]=(0,N.useState)(!1),d=(0,N.useRef)(null),f;t[0]!==a||t[1]!==l||t[2]!==n.lastSyncUtc||t[3]!==n.pushError||t[4]!==n.pushErrorCode?(f=()=>{if(l){if(n.pushError||n.pushErrorCode){u(!1);return}(n.lastSyncUtc??null)!==d.current&&(u(!1),a?.())}},t[0]=a,t[1]=l,t[2]=n.lastSyncUtc,t[3]=n.pushError,t[4]=n.pushErrorCode,t[5]=f):f=t[5];let p;t[6]!==a||t[7]!==l||t[8]!==n?(p=[l,n,a],t[6]=a,t[7]=l,t[8]=n,t[9]=p):p=t[9],(0,N.useEffect)(f,p);let h;t[10]!==c||t[11]!==n.lastSyncUtc?(h=()=>{d.current=n.lastSyncUtc??null,u(!0),m(`sync`).catch(e=>{console.warn(`[receive] miss sync trigger failed`,e instanceof Error?e.message:e),u(!1),s.error(c({id:`1u-mAI`}))})},t[10]=c,t[11]=n.lastSyncUtc,t[12]=h):h=t[12];let g=h,_;t[13]!==g||t[14]!==l?(_=l?(0,P.jsxs)(o,{disabled:!0,"aria-busy":`true`,"data-testid":`share-receive-miss-sync-now`,children:[(0,P.jsx)(x,{icon:C,className:`size-4`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`EHu0x2`})]}):(0,P.jsxs)(o,{onClick:g,"data-testid":`share-receive-miss-sync-now`,children:[(0,P.jsx)(C,{className:`size-4`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`lb_UU4`})]}),t[13]=g,t[14]=l,t[15]=_):_=t[15];let v;t[16]===l?v=t[17]:(v=l?(0,P.jsx)(r,{id:`dXOolp`}):null,t[16]=l,t[17]=v);let y;t[18]===v?y=t[19]:(y=(0,P.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,"data-testid":`share-receive-miss-sync-status`,children:v}),t[18]=v,t[19]=y);let b;return t[20]!==_||t[21]!==y?(b=(0,P.jsxs)(P.Fragment,{children:[_,y]}),t[20]=_,t[21]=y,t[22]=b):b=t[22],b}var G=!1;function K(e){return!G&&e!==null&&e.syncEnabled!==!0}function q(e){return e===null?!1:e.hasRemote&&e.lastPullUtc!==void 0&&e.state!==`conflict`}function J(e,t){let n=(0,M.c)(15),[r,i]=(0,N.useState)(!1),[a,o]=(0,N.useState)(null),[s,c]=(0,N.useState)(!1),l=(0,N.useRef)(null),u,d;n[0]!==t||n[1]!==r||n[2]!==e?(u=()=>{if(!r||(e?.lastPullUtc??null)===l.current)return;i(!1);let n=e?.lastPullOutcome??null;if(n===null){t?.();return}switch(n){case`refused`:case`error`:o(n);return;case`succeeded`:case`up-to-date`:if(K(e)){G=!0,c(!0);return}t?.();return;case`conflict`:t?.();return;default:t?.();return}},d=[r,e,t],n[0]=t,n[1]=r,n[2]=e,n[3]=u,n[4]=d):(u=n[3],d=n[4]),(0,N.useEffect)(u,d);let f;n[5]===t?f=n[6]:(f=()=>{c(!1),t?.()},n[5]=t,n[6]=f);let p;n[7]===e?.lastPullUtc?p=n[8]:(p=()=>{l.current=e?.lastPullUtc??null,o(null),i(!0),m(`pull`).catch(e=>{console.warn(`[receive] miss pull trigger failed`,e instanceof Error?e.message:e),i(!1),o(`error`)})},n[7]=e?.lastPullUtc,n[8]=p);let h;return n[9]!==a||n[10]!==s||n[11]!==r||n[12]!==f||n[13]!==p?(h={pending:r,failure:a,offering:s,resolveOffer:f,start:p},n[9]=a,n[10]=s,n[11]=r,n[12]=f,n[13]=p,n[14]=h):h=n[14],h}function Y(e){let t=(0,M.c)(10),{pending:n,onPull:i}=e,a;t[0]!==i||t[1]!==n?(a=n?(0,P.jsxs)(o,{disabled:!0,"aria-busy":`true`,"data-testid":`share-receive-miss-pull-now`,children:[(0,P.jsx)(x,{icon:C,className:`size-4`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`4uNLmk`})]}):(0,P.jsxs)(o,{onClick:i,"data-testid":`share-receive-miss-pull-now`,children:[(0,P.jsx)(l,{className:`size-4`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`fevEu0`})]}),t[0]=i,t[1]=n,t[2]=a):a=t[2];let s;t[3]===n?s=t[4]:(s=n?(0,P.jsx)(r,{id:`glG1TR`}):null,t[3]=n,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,P.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,"data-testid":`share-receive-miss-pull-status`,children:s}),t[5]=s,t[6]=c);let u;return t[7]!==a||t[8]!==c?(u=(0,P.jsxs)(P.Fragment,{children:[a,c]}),t[7]=a,t[8]=c,t[9]=u):u=t[9],u}function X(e){let t=(0,M.c)(18),{onResolve:n,strandedCommitCount:r}=e,i=f(),a=(0,N.useRef)(!1),o;t[0]===n?o=t[1]:(o=function(){a.current||(a.current=!0,n())},t[0]=n,t[1]=o);let s=o,c;t[2]===s?c=t[3]:(c={onApplied:s},t[2]=s,t[3]=c);let{confirmOpen:l,setConfirmOpen:d,onModeSelect:p,onConfirm:m}=u(i,`off`,c),h=(0,N.useRef)(!1),_,v;t[4]===p?(_=t[5],v=t[6]):(_=()=>{h.current||(h.current=!0,p(`follow`))},v=[p],t[4]=p,t[5]=_,t[6]=v),(0,N.useEffect)(_,v);let y;t[7]!==s||t[8]!==d?(y=e=>{d(e),e||s()},t[7]=s,t[8]=d,t[9]=y):y=t[9];let b;t[10]!==m||t[11]!==s?(b=()=>{m(),s()},t[10]=m,t[11]=s,t[12]=b):b=t[12];let x;return t[13]!==l||t[14]!==r||t[15]!==y||t[16]!==b?(x=(0,P.jsx)(g,{open:l,onOpenChange:y,onConfirm:b,variant:`follow`,strandedCommitCount:r}),t[13]=l,t[14]=r,t[15]=y,t[16]=b,t[17]=x):x=t[17],x}function Z(e){let t=(0,M.c)(89),{nav:n,state:a,onBrowseFolder:s,onOpenRenamed:c,onEnableAutoSync:u,onSyncCompleted:d,onPullApplied:f}=e,{_:m}=i(),h=p(),g=J(h,f),_=n.branch,v;t[0]!==m||t[1]!==n.kind?(v=n.kind===`folder`?m({id:`ugoTXs`}):m({id:`XH30C4`}),t[0]=m,t[1]=n.kind,t[2]=v):v=t[2];let b=v;if(a.phase===`pending`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(x,{className:`size-5`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`c8jBgX`})]}),t[3]=e):e=t[3],e}let{resolution:C}=a,w,T;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,P.jsx)(y,{className:`size-4`,"aria-hidden":`true`}),T=(0,P.jsx)(r,{id:`hItdtk`}),t[4]=w,t[5]=T):(w=t[4],T=t[5]);let E;t[6]===s?E=t[7]:(E=(0,P.jsxs)(o,{variant:`outline`,onClick:s,"data-testid":`share-receive-miss-browse`,children:[w,T]}),t[6]=s,t[7]=E);let D=E,O,N,F,I=null;if(C.verdict===`renamed`){let e;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(S,{className:`size-9`,"aria-hidden":`true`}),t[8]=e):e=t[8],O=e;let n;t[9]!==C.renamedTo||t[10]!==b?(n={0:C.renamedTo,targetNoun:b},t[9]=C.renamedTo,t[10]=b,t[11]=n):n=t[11];let i;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(i={0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[12]=i):i=t[12];let a;t[13]===n?a=t[14]:(a=(0,P.jsx)(r,{id:`P0HC30`,values:n,components:i}),t[13]=n,t[14]=a),N=a;let s;t[15]!==c||t[16]!==C.renamedTo?(s=()=>c(C.renamedTo),t[15]=c,t[16]=C.renamedTo,t[17]=s):s=t[17];let l,u;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,P.jsx)(S,{className:`size-4`,"aria-hidden":`true`}),u=(0,P.jsx)(r,{id:`AItsE5`}),t[18]=l,t[19]=u):(l=t[18],u=t[19]);let d;t[20]===s?d=t[21]:(d=(0,P.jsxs)(o,{onClick:s,"data-testid":`share-receive-miss-open-renamed`,children:[l,u]}),t[20]=s,t[21]=d);let f;t[22]!==D||t[23]!==d?(f=(0,P.jsxs)(P.Fragment,{children:[d,D]}),t[22]=D,t[23]=d,t[24]=f):f=t[24],F=f}else if(C.verdict===`deleted`){let e;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(j,{className:`size-9`,"aria-hidden":`true`}),t[25]=e):e=t[25],O=e;let n;t[26]!==_||t[27]!==b?(n={targetNoun:b,branch:_},t[26]=_,t[27]=b,t[28]=n):n=t[28];let i;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(i={0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[29]=i):i=t[29];let a;t[30]===n?a=t[31]:(a=(0,P.jsx)(r,{id:`kpqWwG`,values:n,components:i}),t[30]=n,t[31]=a),N=a,F=D}else if(C.verdict===`never-on-branch`){let e;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(A,{className:`size-9`,"aria-hidden":`true`}),t[32]=e):e=t[32],O=e;let n;t[33]!==_||t[34]!==b?(n={targetNoun:b,branch:_},t[33]=_,t[34]=b,t[35]=n):n=t[35];let i;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(i={0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[36]=i):i=t[36];let a;t[37]===n?a=t[38]:(a=(0,P.jsx)(r,{id:`i9TPUi`,values:n,components:i}),t[37]=n,t[38]=a),N=a,F=D}else if(C.verdict===`changed-locally`){let e;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(k,{className:`size-9`,"aria-hidden":`true`}),t[39]=e):e=t[39],O=e;let n=h?.syncEnabled===!0,i=h?.pushPermission?.checkStatus===`denied`||!!(h?.pushError||h?.pushErrorCode);if(n){let e;t[40]!==_||t[41]!==b?(e=_===null?(0,P.jsx)(r,{id:`RyIKxy`,values:{targetNoun:b}}):(0,P.jsx)(r,{id:`l6kpzR`,values:{targetNoun:b,branch:_},components:{0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[40]=_,t[41]=b,t[42]=e):e=t[42],N=e}else{let e;t[43]!==_||t[44]!==b?(e=_===null?(0,P.jsx)(r,{id:`UuYo7g`,values:{targetNoun:b}}):(0,P.jsx)(r,{id:`HoWElC`,values:{targetNoun:b,branch:_},components:{0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[43]=_,t[44]=b,t[45]=e):e=t[45],N=e}let a=null;if(h?.syncEnabled){if(ee(h)&&!i){let e;t[46]!==d||t[47]!==h?(e=(0,P.jsx)(W,{status:h,onSyncCompleted:d}),t[46]=d,t[47]=h,t[48]=e):e=t[48],a=e}}else if(h!==null){let e;t[49]===u?e=t[50]:(e=(0,P.jsx)(U,{onEnabled:u}),t[49]=u,t[50]=e),a=e}let o;t[51]!==D||t[52]!==a?(o=(0,P.jsxs)(P.Fragment,{children:[a,D]}),t[51]=D,t[52]=a,t[53]=o):o=t[53],F=o}else{let e;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(l,{className:`size-9`,"aria-hidden":`true`}),t[54]=e):e=t[54],O=e;let n;t[55]===h?n=t[56]:(n=q(h),t[55]=h,t[56]=n);let i=n;if(i){let e;t[57]===_?e=t[58]:(e=_===null?(0,P.jsx)(r,{id:`gwEcOD`}):(0,P.jsx)(r,{id:`wvK7Ay`,values:{branch:_},components:{0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[57]=_,t[58]=e),N=e}else{let e;t[59]===_?e=t[60]:(e=_===null?(0,P.jsx)(r,{id:`Xewl6B`}):(0,P.jsx)(r,{id:`d1JjXo`,values:{branch:_},components:{0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[59]=_,t[60]=e),N=e}let a=g.failure===null?`sr-only`:`max-w-md text-balance text-1sm text-destructive`,o;t[61]===g.failure?o=t[62]:(o=g.failure===`refused`?(0,P.jsx)(r,{id:`Xp7Kq4`}):g.failure===`error`?(0,P.jsx)(r,{id:`JG_8KT`}):null,t[61]=g.failure,t[62]=o);let s;t[63]!==a||t[64]!==o?(s=(0,P.jsx)(`p`,{role:`alert`,className:a,"data-testid":`share-receive-miss-pull-error`,children:o}),t[63]=a,t[64]=o,t[65]=s):s=t[65],I=s;let c;t[66]!==i||t[67]!==g.pending||t[68]!==g.start?(c=i?(0,P.jsx)(Y,{pending:g.pending,onPull:g.start}):null,t[66]=i,t[67]=g.pending,t[68]=g.start,t[69]=c):c=t[69];let u;t[70]!==g.offering||t[71]!==g.resolveOffer||t[72]!==h?.ahead?(u=g.offering?(0,P.jsx)(X,{onResolve:g.resolveOffer,strandedCommitCount:h?.ahead??0}):null,t[70]=g.offering,t[71]=g.resolveOffer,t[72]=h?.ahead,t[73]=u):u=t[73];let d;t[74]!==D||t[75]!==c||t[76]!==u?(d=(0,P.jsxs)(P.Fragment,{children:[c,D,u]}),t[74]=D,t[75]=c,t[76]=u,t[77]=d):d=t[77],F=d}let L;t[78]===O?L=t[79]:(L=(0,P.jsx)(`div`,{className:`flex size-16 items-center justify-center rounded-full border bg-muted/40 text-muted-foreground`,children:O}),t[78]=O,t[79]=L);let R;t[80]===N?R=t[81]:(R=(0,P.jsx)(`p`,{className:`max-w-md text-balance text-base leading-6 text-foreground/90`,children:N}),t[80]=N,t[81]=R);let z;t[82]===F?z=t[83]:(z=(0,P.jsx)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-center`,children:F}),t[82]=F,t[83]=z);let B;return t[84]!==I||t[85]!==L||t[86]!==R||t[87]!==z?(B=(0,P.jsxs)(P.Fragment,{children:[L,R,I,z]}),t[84]=I,t[85]=L,t[86]=R,t[87]=z,t[88]=B):B=t[88],B}function Q(e){return e.replace(/^\/+|\/+$/g,``)}function $(e,t){if(t.kind===`folder`){if(T(e))return Q(t.path)===``;let n=D(e);return n!==null&&Q(n)===Q(t.path)}let n=D(e);return n===null?!1:E(n)===E(t.path)}function te(){let e=null,t=new Set,n=!1;function r(){for(let e of t)e()}function i(t){e!==t&&(e=t,r())}function a(){e!==null&&($(window.location.hash,e)||i(null))}function o(){n||typeof window>`u`||(n=!0,window.addEventListener(`hashchange`,a))}return{arm(e){o(),i(e)},clear(){i(null)},getSnapshot(){return e},subscribe(e){return t.add(e),()=>{t.delete(e)}},dispose(){n&&typeof window<`u`&&(window.removeEventListener(`hashchange`,a),n=!1),i(null)}}}var ne=te();function re(e,t){if(e.contentRootDepth===void 0)return{...e,path:t,repositoryPath:t};let n=(e.repositoryPath??e.path).split(`/`).slice(0,e.contentRootDepth);return{...e,path:t,repositoryPath:[...n,...t===``?[]:t.split(`/`)].join(`/`)}}function ie(e,t){return e===null||e.kind!==`missing`||t===null||E(t.path)!==e.target?null:t}export{B as a,I as c,Z as i,re as n,V as o,ne as r,L as s,ie as t};
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-Cym3gapE.js";import{n as s}from"./dist-CJhtNlOm2.js";import{t as c}from"./createLucideIcon-BulbvLvN.js";import{_ as l,c as u,i as d,l as f,m as p,n as m,o as h,t as g}from"./EnableSyncConfirmDialog-C0npXrd0.js";import{t as _}from"./arrow-up-right-BTi7mHwL.js";import{t as v}from"./check-Dut4Aov8.js";import{t as y}from"./folder-open-BWpLO6wT.js";import{t as b}from"./info-SlzbpjOb.js";import{t as x}from"./spinner-t7GahFcQ.js";import{n as S}from"./miss-dialog-store-DVpIaq34.js";import{t as C}from"./refresh-cw-DwRz6AkS.js";import{t as w}from"./triangle-alert-D0n54WVY.js";import{g as T,r as E,s as D}from"./doc-paths-DMctW8qz.js";import{t as O}from"./external-link-DGqXfQJy.js";var k=c(`file-pen`,[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]]),A=c(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),j=c(`file-x-corner`,[[`path`,{d:`M11 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5`,key:`1jo35a`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m15 17 5 5`,key:`36xl1x`}],[`path`,{d:`m20 17-5 5`,key:`vdz27y`}]]),M=a(),N=e(n(),1),P=t(),F=`https://git-scm.com/docs/git-push`;function I(e,t){return e===`empty`?!0:!(e!==`stale`&&e!==`absent`||e===`stale`&&t?.syncEnabled===!0)}function ee(e){return e?e.state!==`dormant`&&e.state!==`disabled`&&e.state!==`auth-error`&&e.state!==`conflict`:!1}function L(e){let t=(0,M.c)(52),{freshness:n,status:a,kind:s}=e,{_:c}=i(),{confirmOpen:l,setConfirmOpen:u,onToggleRequest:f,onConfirm:p}=d(h()),[y,S]=(0,N.useState)(`idle`),T=(0,N.useRef)(null),E,D;if(t[0]!==a||t[1]!==y?(E=()=>{if(!(y!==`pending`||!a)){if(a.pushError||a.pushErrorCode){S(`idle`);return}(a.lastSyncUtc??null)!==T.current&&S(`synced`)}},D=[y,a],t[0]=a,t[1]=y,t[2]=E,t[3]=D):(E=t[2],D=t[3]),(0,N.useEffect)(E,D),!I(n,a))return null;if(n===`empty`){let e;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(w,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),t[4]=e):e=t[4];let n;t[5]===c?n=t[6]:(n=c({id:`eazHgv`}),t[5]=c,t[6]=n);let r;return t[7]===n?r=t[8]:(r=(0,P.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed border-border bg-muted/40 p-2 text-xs text-muted-foreground`,"data-testid":`share-freshness-row`,children:[e,(0,P.jsx)(`span`,{children:n})]}),t[7]=n,t[8]=r),r}if(y===`synced`){let e;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed border-border bg-muted/40 p-2 text-xs text-muted-foreground`,"data-testid":`share-freshness-row`,children:[(0,P.jsx)(v,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),(0,P.jsx)(`span`,{children:(0,P.jsx)(r,{id:`fxbCNQ`})})]}),t[9]=e):e=t[9],e}let O=a?.syncEnabled===!0,k=a?.pushPermission?.checkStatus===`denied`,A=!!(a?.pushError||a?.pushErrorCode),j=k||A,L=n===`absent`&&!O,B;if(n===`absent`&&!O){let e;t[10]!==c||t[11]!==s?(e=c(s===`folder`?{id:`PrJYSN`}:{id:`3BnyYc`}),t[10]=c,t[11]=s,t[12]=e):e=t[12],B=e}else if(n===`stale`){let e;t[13]!==c||t[14]!==s?(e=c(s===`folder`?{id:`Gt4gOO`}:{id:`2IYGkU`}),t[13]=c,t[14]=s,t[15]=e):e=t[15],B=e}else{let e;t[16]!==c||t[17]!==s?(e=c(s===`folder`?{id:`nqV0Kk`}:{id:`gwykHF`}),t[16]=c,t[17]=s,t[18]=e):e=t[18],B=e}let V;t[19]!==c||t[20]!==A||t[21]!==k?(V=k?c({id:`9OIqw4`}):A?c({id:`K6MQQk`}):null,t[19]=c,t[20]=A,t[21]=k,t[22]=V):V=t[22];let H=V,U;t[23]===a?.lastSyncUtc?U=t[24]:(U=()=>{T.current=a?.lastSyncUtc??null,S(`pending`),m(`sync`).catch(e=>{console.warn(`[share-freshness] sync trigger failed`,e instanceof Error?e.message:e),S(`idle`)})},t[23]=a?.lastSyncUtc,t[24]=U);let W=U,G=L?w:b,K;t[25]===G?K=t[26]:(K=(0,P.jsx)(G,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),t[25]=G,t[26]=K);let q;t[27]===B?q=t[28]:(q=(0,P.jsx)(`span`,{children:B}),t[27]=B,t[28]=q);let J;t[29]===H?J=t[30]:(J=H?(0,P.jsx)(`span`,{children:H}):null,t[29]=H,t[30]=J);let Y;t[31]!==j||t[32]!==W||t[33]!==f||t[34]!==a||t[35]!==O||t[36]!==y?(Y=j?null:O?ee(a)?(0,P.jsx)(`div`,{children:y===`pending`?(0,P.jsxs)(o,{variant:`outline`,size:`xs`,disabled:!0,children:[(0,P.jsx)(x,{icon:C,className:`size-3 shrink-0`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`EHu0x2`})]}):(0,P.jsx)(o,{variant:`outline`,size:`xs`,onClick:W,children:(0,P.jsx)(r,{id:`lb_UU4`})})}):null:(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5`,children:[(0,P.jsx)(o,{variant:`outline`,size:`xs`,onClick:()=>f(!0),children:(0,P.jsx)(r,{id:`pPiV8s`})}),(0,P.jsxs)(`a`,{href:F,target:`_blank`,rel:`noopener noreferrer`,onClick:z,onAuxClick:R,className:`inline-flex items-center gap-1 transition-colors hover:text-primary`,children:[(0,P.jsx)(r,{id:`GLxIKR`}),(0,P.jsx)(_,{className:`size-3 shrink-0`,"aria-hidden":`true`})]})]}),t[31]=j,t[32]=W,t[33]=f,t[34]=a,t[35]=O,t[36]=y,t[37]=Y):Y=t[37];let X;t[38]!==q||t[39]!==J||t[40]!==Y?(X=(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[q,J,Y]}),t[38]=q,t[39]=J,t[40]=Y,t[41]=X):X=t[41];let Z;t[42]!==K||t[43]!==X?(Z=(0,P.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed border-border bg-muted/40 p-2 text-xs text-muted-foreground`,"data-testid":`share-freshness-row`,children:[K,X]}),t[42]=K,t[43]=X,t[44]=Z):Z=t[44];let Q;t[45]!==l||t[46]!==p||t[47]!==u?(Q=(0,P.jsx)(g,{open:l,onOpenChange:u,onConfirm:p}),t[45]=l,t[46]=p,t[47]=u,t[48]=Q):Q=t[48];let $;return t[49]!==Z||t[50]!==Q?($=(0,P.jsxs)(P.Fragment,{children:[Z,Q]}),t[49]=Z,t[50]=Q,t[51]=$):$=t[51],$}function R(e){return O(e,F)}function z(e){return O(e,F)}function B(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function V(e){let t=(0,M.c)(17),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={phase:`pending`},t[0]=n):n=t[0];let[r,i]=(0,N.useState)(n),[a,o]=(0,N.useState)(0),s=e.branch,c;t[1]!==s||t[2]!==e.contentRootDepth||t[3]!==e.kind||t[4]!==e.path||t[5]!==e.repositoryPath?(c=()=>{let t=window.okDesktop??null;if(!t||s===null){i({phase:`resolved`,resolution:{verdict:`unknown`}});return}let n=!1;return t.project.fetchTargetStatus({projectPath:t.config.projectPath,branch:s,path:e.repositoryPath??e.path,kind:e.kind,...e.contentRootDepth===void 0?{}:{contentRootDepth:e.contentRootDepth}}).then(e=>{n||i({phase:`resolved`,resolution:e??{verdict:`unknown`}})}).catch(e=>{n||(console.warn(`[receive] miss target-status fetch failed`,e instanceof Error?e.message:e),i({phase:`resolved`,resolution:{verdict:`unknown`}}))}),()=>{n=!0}},t[1]=s,t[2]=e.contentRootDepth,t[3]=e.kind,t[4]=e.path,t[5]=e.repositoryPath,t[6]=c):c=t[6];let l;t[7]!==s||t[8]!==a||t[9]!==e.contentRootDepth||t[10]!==e.kind||t[11]!==e.path||t[12]!==e.repositoryPath?(l=[s,e.kind,e.path,e.repositoryPath,e.contentRootDepth,a],t[7]=s,t[8]=a,t[9]=e.contentRootDepth,t[10]=e.kind,t[11]=e.path,t[12]=e.repositoryPath,t[13]=l):l=t[13],(0,N.useEffect)(c,l);let u;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{i({phase:`pending`}),o(H)},t[14]=u):u=t[14];let d;return t[15]===r?d=t[16]:(d={state:r,refetch:u},t[15]=r,t[16]=d),d}function H(e){return e+1}function U(e){let t=(0,M.c)(15),{onEnabled:n}=e,i=h(),a;t[0]===n?a=t[1]:(a={onEnabled:n},t[0]=n,t[1]=a);let{confirmOpen:s,setConfirmOpen:c,onToggleRequest:l,onConfirm:u}=d(i,a),f;t[2]===l?f=t[3]:(f=()=>l(!0),t[2]=l,t[3]=f);let p,m;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,P.jsx)(C,{className:`size-4`,"aria-hidden":`true`}),m=(0,P.jsx)(r,{id:`pPiV8s`}),t[4]=p,t[5]=m):(p=t[4],m=t[5]);let _;t[6]===f?_=t[7]:(_=(0,P.jsxs)(o,{onClick:f,"data-testid":`share-receive-miss-enable-sync`,children:[p,m]}),t[6]=f,t[7]=_);let v;t[8]!==s||t[9]!==u||t[10]!==c?(v=(0,P.jsx)(g,{open:s,onOpenChange:c,onConfirm:u}),t[8]=s,t[9]=u,t[10]=c,t[11]=v):v=t[11];let y;return t[12]!==_||t[13]!==v?(y=(0,P.jsxs)(P.Fragment,{children:[_,v]}),t[12]=_,t[13]=v,t[14]=y):y=t[14],y}function W(e){let t=(0,M.c)(23),{status:n,onSyncCompleted:a}=e,{_:c}=i(),[l,u]=(0,N.useState)(!1),d=(0,N.useRef)(null),f;t[0]!==a||t[1]!==l||t[2]!==n.lastSyncUtc||t[3]!==n.pushError||t[4]!==n.pushErrorCode?(f=()=>{if(l){if(n.pushError||n.pushErrorCode){u(!1);return}(n.lastSyncUtc??null)!==d.current&&(u(!1),a?.())}},t[0]=a,t[1]=l,t[2]=n.lastSyncUtc,t[3]=n.pushError,t[4]=n.pushErrorCode,t[5]=f):f=t[5];let p;t[6]!==a||t[7]!==l||t[8]!==n?(p=[l,n,a],t[6]=a,t[7]=l,t[8]=n,t[9]=p):p=t[9],(0,N.useEffect)(f,p);let h;t[10]!==c||t[11]!==n.lastSyncUtc?(h=()=>{d.current=n.lastSyncUtc??null,u(!0),m(`sync`).catch(e=>{console.warn(`[receive] miss sync trigger failed`,e instanceof Error?e.message:e),u(!1),s.error(c({id:`1u-mAI`}))})},t[10]=c,t[11]=n.lastSyncUtc,t[12]=h):h=t[12];let g=h,_;t[13]!==g||t[14]!==l?(_=l?(0,P.jsxs)(o,{disabled:!0,"aria-busy":`true`,"data-testid":`share-receive-miss-sync-now`,children:[(0,P.jsx)(x,{icon:C,className:`size-4`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`EHu0x2`})]}):(0,P.jsxs)(o,{onClick:g,"data-testid":`share-receive-miss-sync-now`,children:[(0,P.jsx)(C,{className:`size-4`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`lb_UU4`})]}),t[13]=g,t[14]=l,t[15]=_):_=t[15];let v;t[16]===l?v=t[17]:(v=l?(0,P.jsx)(r,{id:`dXOolp`}):null,t[16]=l,t[17]=v);let y;t[18]===v?y=t[19]:(y=(0,P.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,"data-testid":`share-receive-miss-sync-status`,children:v}),t[18]=v,t[19]=y);let b;return t[20]!==_||t[21]!==y?(b=(0,P.jsxs)(P.Fragment,{children:[_,y]}),t[20]=_,t[21]=y,t[22]=b):b=t[22],b}var G=!1;function K(e){return!G&&e!==null&&e.syncEnabled!==!0}function q(e){return e===null?!1:e.hasRemote&&e.lastPullUtc!==void 0&&e.state!==`conflict`}function J(e,t){let n=(0,M.c)(15),[r,i]=(0,N.useState)(!1),[a,o]=(0,N.useState)(null),[s,c]=(0,N.useState)(!1),l=(0,N.useRef)(null),u,d;n[0]!==t||n[1]!==r||n[2]!==e?(u=()=>{if(!r||(e?.lastPullUtc??null)===l.current)return;i(!1);let n=e?.lastPullOutcome??null;if(n===null){t?.();return}switch(n){case`refused`:case`error`:o(n);return;case`succeeded`:case`up-to-date`:if(K(e)){G=!0,c(!0);return}t?.();return;case`conflict`:t?.();return;default:t?.();return}},d=[r,e,t],n[0]=t,n[1]=r,n[2]=e,n[3]=u,n[4]=d):(u=n[3],d=n[4]),(0,N.useEffect)(u,d);let f;n[5]===t?f=n[6]:(f=()=>{c(!1),t?.()},n[5]=t,n[6]=f);let p;n[7]===e?.lastPullUtc?p=n[8]:(p=()=>{l.current=e?.lastPullUtc??null,o(null),i(!0),m(`pull`).catch(e=>{console.warn(`[receive] miss pull trigger failed`,e instanceof Error?e.message:e),i(!1),o(`error`)})},n[7]=e?.lastPullUtc,n[8]=p);let h;return n[9]!==a||n[10]!==s||n[11]!==r||n[12]!==f||n[13]!==p?(h={pending:r,failure:a,offering:s,resolveOffer:f,start:p},n[9]=a,n[10]=s,n[11]=r,n[12]=f,n[13]=p,n[14]=h):h=n[14],h}function Y(e){let t=(0,M.c)(10),{pending:n,onPull:i}=e,a;t[0]!==i||t[1]!==n?(a=n?(0,P.jsxs)(o,{disabled:!0,"aria-busy":`true`,"data-testid":`share-receive-miss-pull-now`,children:[(0,P.jsx)(x,{icon:C,className:`size-4`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`4uNLmk`})]}):(0,P.jsxs)(o,{onClick:i,"data-testid":`share-receive-miss-pull-now`,children:[(0,P.jsx)(l,{className:`size-4`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`fevEu0`})]}),t[0]=i,t[1]=n,t[2]=a):a=t[2];let s;t[3]===n?s=t[4]:(s=n?(0,P.jsx)(r,{id:`glG1TR`}):null,t[3]=n,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,P.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,"data-testid":`share-receive-miss-pull-status`,children:s}),t[5]=s,t[6]=c);let u;return t[7]!==a||t[8]!==c?(u=(0,P.jsxs)(P.Fragment,{children:[a,c]}),t[7]=a,t[8]=c,t[9]=u):u=t[9],u}function X(e){let t=(0,M.c)(18),{onResolve:n,strandedCommitCount:r}=e,i=f(),a=(0,N.useRef)(!1),o;t[0]===n?o=t[1]:(o=function(){a.current||(a.current=!0,n())},t[0]=n,t[1]=o);let s=o,c;t[2]===s?c=t[3]:(c={onApplied:s},t[2]=s,t[3]=c);let{confirmOpen:l,setConfirmOpen:d,onModeSelect:p,onConfirm:m}=u(i,`off`,c),h=(0,N.useRef)(!1),_,v;t[4]===p?(_=t[5],v=t[6]):(_=()=>{h.current||(h.current=!0,p(`follow`))},v=[p],t[4]=p,t[5]=_,t[6]=v),(0,N.useEffect)(_,v);let y;t[7]!==s||t[8]!==d?(y=e=>{d(e),e||s()},t[7]=s,t[8]=d,t[9]=y):y=t[9];let b;t[10]!==m||t[11]!==s?(b=()=>{m(),s()},t[10]=m,t[11]=s,t[12]=b):b=t[12];let x;return t[13]!==l||t[14]!==r||t[15]!==y||t[16]!==b?(x=(0,P.jsx)(g,{open:l,onOpenChange:y,onConfirm:b,variant:`follow`,strandedCommitCount:r}),t[13]=l,t[14]=r,t[15]=y,t[16]=b,t[17]=x):x=t[17],x}function Z(e){let t=(0,M.c)(89),{nav:n,state:a,onBrowseFolder:s,onOpenRenamed:c,onEnableAutoSync:u,onSyncCompleted:d,onPullApplied:f}=e,{_:m}=i(),h=p(),g=J(h,f),_=n.branch,v;t[0]!==m||t[1]!==n.kind?(v=n.kind===`folder`?m({id:`ugoTXs`}):m({id:`XH30C4`}),t[0]=m,t[1]=n.kind,t[2]=v):v=t[2];let b=v;if(a.phase===`pending`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(x,{className:`size-5`,"aria-hidden":`true`}),(0,P.jsx)(r,{id:`c8jBgX`})]}),t[3]=e):e=t[3],e}let{resolution:C}=a,w,T;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,P.jsx)(y,{className:`size-4`,"aria-hidden":`true`}),T=(0,P.jsx)(r,{id:`hItdtk`}),t[4]=w,t[5]=T):(w=t[4],T=t[5]);let E;t[6]===s?E=t[7]:(E=(0,P.jsxs)(o,{variant:`outline`,onClick:s,"data-testid":`share-receive-miss-browse`,children:[w,T]}),t[6]=s,t[7]=E);let D=E,O,N,F,I=null;if(C.verdict===`renamed`){let e;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(S,{className:`size-9`,"aria-hidden":`true`}),t[8]=e):e=t[8],O=e;let n;t[9]!==C.renamedTo||t[10]!==b?(n={0:C.renamedTo,targetNoun:b},t[9]=C.renamedTo,t[10]=b,t[11]=n):n=t[11];let i;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(i={0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[12]=i):i=t[12];let a;t[13]===n?a=t[14]:(a=(0,P.jsx)(r,{id:`P0HC30`,values:n,components:i}),t[13]=n,t[14]=a),N=a;let s;t[15]!==c||t[16]!==C.renamedTo?(s=()=>c(C.renamedTo),t[15]=c,t[16]=C.renamedTo,t[17]=s):s=t[17];let l,u;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,P.jsx)(S,{className:`size-4`,"aria-hidden":`true`}),u=(0,P.jsx)(r,{id:`AItsE5`}),t[18]=l,t[19]=u):(l=t[18],u=t[19]);let d;t[20]===s?d=t[21]:(d=(0,P.jsxs)(o,{onClick:s,"data-testid":`share-receive-miss-open-renamed`,children:[l,u]}),t[20]=s,t[21]=d);let f;t[22]!==D||t[23]!==d?(f=(0,P.jsxs)(P.Fragment,{children:[d,D]}),t[22]=D,t[23]=d,t[24]=f):f=t[24],F=f}else if(C.verdict===`deleted`){let e;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(j,{className:`size-9`,"aria-hidden":`true`}),t[25]=e):e=t[25],O=e;let n;t[26]!==_||t[27]!==b?(n={targetNoun:b,branch:_},t[26]=_,t[27]=b,t[28]=n):n=t[28];let i;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(i={0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[29]=i):i=t[29];let a;t[30]===n?a=t[31]:(a=(0,P.jsx)(r,{id:`kpqWwG`,values:n,components:i}),t[30]=n,t[31]=a),N=a,F=D}else if(C.verdict===`never-on-branch`){let e;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(A,{className:`size-9`,"aria-hidden":`true`}),t[32]=e):e=t[32],O=e;let n;t[33]!==_||t[34]!==b?(n={targetNoun:b,branch:_},t[33]=_,t[34]=b,t[35]=n):n=t[35];let i;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(i={0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})},t[36]=i):i=t[36];let a;t[37]===n?a=t[38]:(a=(0,P.jsx)(r,{id:`i9TPUi`,values:n,components:i}),t[37]=n,t[38]=a),N=a,F=D}else if(C.verdict===`changed-locally`){let e;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(k,{className:`size-9`,"aria-hidden":`true`}),t[39]=e):e=t[39],O=e;let n=h?.syncEnabled===!0,i=h?.pushPermission?.checkStatus===`denied`||!!(h?.pushError||h?.pushErrorCode);if(n){let e;t[40]!==_||t[41]!==b?(e=_===null?(0,P.jsx)(r,{id:`RyIKxy`,values:{targetNoun:b}}):(0,P.jsx)(r,{id:`l6kpzR`,values:{targetNoun:b,branch:_},components:{0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[40]=_,t[41]=b,t[42]=e):e=t[42],N=e}else{let e;t[43]!==_||t[44]!==b?(e=_===null?(0,P.jsx)(r,{id:`UuYo7g`,values:{targetNoun:b}}):(0,P.jsx)(r,{id:`HoWElC`,values:{targetNoun:b,branch:_},components:{0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[43]=_,t[44]=b,t[45]=e):e=t[45],N=e}let a=null;if(h?.syncEnabled){if(ee(h)&&!i){let e;t[46]!==d||t[47]!==h?(e=(0,P.jsx)(W,{status:h,onSyncCompleted:d}),t[46]=d,t[47]=h,t[48]=e):e=t[48],a=e}}else if(h!==null){let e;t[49]===u?e=t[50]:(e=(0,P.jsx)(U,{onEnabled:u}),t[49]=u,t[50]=e),a=e}let o;t[51]!==D||t[52]!==a?(o=(0,P.jsxs)(P.Fragment,{children:[a,D]}),t[51]=D,t[52]=a,t[53]=o):o=t[53],F=o}else{let e;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,P.jsx)(l,{className:`size-9`,"aria-hidden":`true`}),t[54]=e):e=t[54],O=e;let n;t[55]===h?n=t[56]:(n=q(h),t[55]=h,t[56]=n);let i=n;if(i){let e;t[57]===_?e=t[58]:(e=_===null?(0,P.jsx)(r,{id:`gwEcOD`}):(0,P.jsx)(r,{id:`wvK7Ay`,values:{branch:_},components:{0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[57]=_,t[58]=e),N=e}else{let e;t[59]===_?e=t[60]:(e=_===null?(0,P.jsx)(r,{id:`Xewl6B`}):(0,P.jsx)(r,{id:`d1JjXo`,values:{branch:_},components:{0:(0,P.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}}),t[59]=_,t[60]=e),N=e}let a=g.failure===null?`sr-only`:`max-w-md text-balance text-1sm text-destructive`,o;t[61]===g.failure?o=t[62]:(o=g.failure===`refused`?(0,P.jsx)(r,{id:`Xp7Kq4`}):g.failure===`error`?(0,P.jsx)(r,{id:`JG_8KT`}):null,t[61]=g.failure,t[62]=o);let s;t[63]!==a||t[64]!==o?(s=(0,P.jsx)(`p`,{role:`alert`,className:a,"data-testid":`share-receive-miss-pull-error`,children:o}),t[63]=a,t[64]=o,t[65]=s):s=t[65],I=s;let c;t[66]!==i||t[67]!==g.pending||t[68]!==g.start?(c=i?(0,P.jsx)(Y,{pending:g.pending,onPull:g.start}):null,t[66]=i,t[67]=g.pending,t[68]=g.start,t[69]=c):c=t[69];let u;t[70]!==g.offering||t[71]!==g.resolveOffer||t[72]!==h?.ahead?(u=g.offering?(0,P.jsx)(X,{onResolve:g.resolveOffer,strandedCommitCount:h?.ahead??0}):null,t[70]=g.offering,t[71]=g.resolveOffer,t[72]=h?.ahead,t[73]=u):u=t[73];let d;t[74]!==D||t[75]!==c||t[76]!==u?(d=(0,P.jsxs)(P.Fragment,{children:[c,D,u]}),t[74]=D,t[75]=c,t[76]=u,t[77]=d):d=t[77],F=d}let L;t[78]===O?L=t[79]:(L=(0,P.jsx)(`div`,{className:`flex size-16 items-center justify-center rounded-full border bg-muted/40 text-muted-foreground`,children:O}),t[78]=O,t[79]=L);let R;t[80]===N?R=t[81]:(R=(0,P.jsx)(`p`,{className:`max-w-md text-balance text-base leading-6 text-foreground/90`,children:N}),t[80]=N,t[81]=R);let z;t[82]===F?z=t[83]:(z=(0,P.jsx)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-center`,children:F}),t[82]=F,t[83]=z);let B;return t[84]!==I||t[85]!==L||t[86]!==R||t[87]!==z?(B=(0,P.jsxs)(P.Fragment,{children:[L,R,I,z]}),t[84]=I,t[85]=L,t[86]=R,t[87]=z,t[88]=B):B=t[88],B}function Q(e){return e.replace(/^\/+|\/+$/g,``)}function $(e,t){if(t.kind===`folder`){if(T(e))return Q(t.path)===``;let n=D(e);return n!==null&&Q(n)===Q(t.path)}let n=D(e);return n===null?!1:E(n)===E(t.path)}function te(){let e=null,t=new Set,n=!1;function r(){for(let e of t)e()}function i(t){e!==t&&(e=t,r())}function a(){e!==null&&($(window.location.hash,e)||i(null))}function o(){n||typeof window>`u`||(n=!0,window.addEventListener(`hashchange`,a))}return{arm(e){o(),i(e)},clear(){i(null)},getSnapshot(){return e},subscribe(e){return t.add(e),()=>{t.delete(e)}},dispose(){n&&typeof window<`u`&&(window.removeEventListener(`hashchange`,a),n=!1),i(null)}}}var ne=te();function re(e,t){if(e.contentRootDepth===void 0)return{...e,path:t,repositoryPath:t};let n=(e.repositoryPath??e.path).split(`/`).slice(0,e.contentRootDepth);return{...e,path:t,repositoryPath:[...n,...t===``?[]:t.split(`/`)].join(`/`)}}function ie(e,t){return e===null||e.kind!==`missing`||t===null||E(t.path)!==e.target?null:t}export{B as a,I as c,Z as i,re as n,V as o,ne as r,L as s,ie as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{L as n,P as r,R as i}from"./DocumentContext-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{L as n,P as r,R as i}from"./DocumentContext-CWz_S-8Y.js";import{t as a}from"./react-f2sANaYj.js";import{r as o}from"./dist-Nvb76hAm.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{t as c}from"./utils-CPqDy6Hr.js";import{r as l,t as u}from"./button-Cym3gapE.js";import{c as d,l as f}from"./dist-BcvirUWL.js";import{B as p,C as m,F as h,H as g,S as _,f as v,g as ee,h as y,l as b,m as x,p as S,u as C}from"./CodeMirrorPropInput-B4qzFbMb.js";import"./separator-C6x7j8mC.js";import{Ba as w,Fa as T,Ga as te,Ka as E,Va as D,aa as O,ha as ne,ia as re,mt as k,oa as A,sa as j,va as M,za as N}from"./dist-C_QZEaeX.js";import{t as P}from"./dist-Cr4-nBVI.js";import{t as ie}from"./workspace-paths-CAsMig07.js";import{t as F}from"./createLucideIcon-BulbvLvN.js";import{t as I}from"./x-C0WDbk6g.js";var L=e(a(),1),R=t(),z=`Progress`,B=100,[V,ae]=d(z),[H,U]=V(z),W=L.forwardRef((e,t)=>{let{__scopeProgress:n,value:r=null,max:i,getValueLabel:a=q,...o}=e;(i||i===0)&&!oe(i)&&console.error(ce(`${i}`,`Progress`));let s=oe(i)?i:B;r!==null&&!se(r,s)&&console.error(le(`${r}`,`Progress`));let c=se(r,s)?r:null,l=Y(c)?a(c,s):void 0;return(0,R.jsx)(H,{scope:n,value:c,max:s,children:(0,R.jsx)(f.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":Y(c)?c:void 0,"aria-valuetext":l,role:`progressbar`,"data-state":J(c,s),"data-value":c??void 0,"data-max":s,...o,ref:t})})});W.displayName=z;var G=`ProgressIndicator`,K=L.forwardRef((e,t)=>{let{__scopeProgress:n,...r}=e,i=U(G,n);return(0,R.jsx)(f.div,{"data-state":J(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});K.displayName=G;function q(e,t){return`${Math.round(e/t*100)}%`}function J(e,t){return e==null?`indeterminate`:e===t?`complete`:`loading`}function Y(e){return typeof e==`number`}function oe(e){return Y(e)&&!isNaN(e)&&e>0}function se(e,t){return Y(e)&&!isNaN(e)&&e<=t&&e>=0}function ce(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${B}\`.`}function le(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
2
2
|
- a positive number
|
|
3
3
|
- less than the value passed to \`max\` (or ${B} if no \`max\` prop is set)
|
|
4
4
|
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{t as s}from"./checkbox-UfDS9TpS.js";import{t as c}from"./label-D-K3fWtj.js";import{n as l,t as u}from"./radio-group-npdxiS6E.js";import{ho as d,mo as f,po as p}from"./dist-C_QZEaeX.js";import{t as m}from"./dist-Cr4-nBVI.js";import{t as h}from"./external-link-DGqXfQJy.js";import{t as g}from"./RowDisclosure-BD4HJbRH.js";import{t as _}from"./tool-list-format-HdFmW82S.js";import{t as v}from"./ConfigSharingInfoTooltip-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import{t as s}from"./checkbox-UfDS9TpS.js";import{t as c}from"./label-D-K3fWtj.js";import{n as l,t as u}from"./radio-group-npdxiS6E.js";import{ho as d,mo as f,po as p}from"./dist-C_QZEaeX.js";import{t as m}from"./dist-Cr4-nBVI.js";import{t as h}from"./external-link-DGqXfQJy.js";import{t as g}from"./RowDisclosure-BD4HJbRH.js";import{t as _}from"./tool-list-format-HdFmW82S.js";import{t as v}from"./ConfigSharingInfoTooltip-D7VVLhT-.js";var y=a(),b=e(n(),1),x=t();function S(e){let t=(0,y.c)(60),{detectedEditors:n,checked:a,onCheckedChange:l,disabled:u,testIdPrefix:h,itemTestIdPrefix:v}=e,{_:S}=i(),w=(0,b.useId)(),T,E,D,O,k,A,j,M,N,P;if(t[0]!==S||t[1]!==w||t[2]!==a||t[3]!==n||t[4]!==u||t[5]!==v||t[6]!==l||t[7]!==h){P=Symbol.for(`react.early_return_sentinel`);bb0:{let e=n===null?{kind:`probing`,message:S({id:`jWzDfC`})}:n.length===0?{kind:`none`,message:S({id:`aSVmqV`})}:{kind:`ready`,message:``,editors:n},i=e.kind===`ready`?`sr-only`:`rounded-md border border-border px-3 py-2.5 text-1sm text-muted-foreground`,y;t[18]===i?y=t[19]:(y=o(i),t[18]=i,t[19]=y);let b=(0,x.jsx)(`p`,{"aria-live":`polite`,className:y,"data-status":e.kind,"data-testid":`${h}-status`,children:e.message});if(e.kind!==`ready`){P=b;break bb0}let F=_(e.editors.map(C),m.locale);N=b,j=`relative overflow-hidden rounded-lg border border-border bg-card/50 px-4 py-3 hover:bg-accent`;let I;t[20]!==a||t[21]!==l?(I=()=>l(!a),t[20]=a,t[21]=l,t[22]=I):I=t[22];let L=`${h}-checkbox`,R;t[23]!==w||t[24]!==a||t[25]!==u||t[26]!==I||t[27]!==L?(R=(0,x.jsx)(s,{id:w,checked:a,onCheckedChange:I,disabled:u,"data-testid":L}),t[23]=w,t[24]=a,t[25]=u,t[26]=I,t[27]=L,t[28]=R):R=t[28];let z=`${h}-title`,B;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,x.jsx)(r,{id:`waCGTy`}),t[29]=B):B=t[29];let V;t[30]===z?V=t[31]:(V=(0,x.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 pe-28 text-sm font-medium text-foreground`,"data-testid":z,children:B}),t[30]=z,t[31]=V);let H;t[32]!==R||t[33]!==V?(H=(0,x.jsxs)(`span`,{className:`flex w-full items-center gap-2.5`,children:[R,V]}),t[32]=R,t[33]=V,t[34]=H):H=t[34];let U;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,x.jsx)(`span`,{className:`font-medium text-foreground`}),t[35]=U):U=t[35];let W=(0,x.jsx)(`span`,{className:`text-1sm leading-normal ps-6.5 text-muted-foreground`,"data-testid":`${h}-summary`,children:(0,x.jsx)(r,{id:`3nICSW`,values:{toolList:F},components:{0:U}})});t[36]!==w||t[37]!==H||t[38]!==W?(M=(0,x.jsxs)(c,{htmlFor:w,className:`flex min-w-0 cursor-pointer flex-col items-start gap-1 font-normal`,children:[H,W]}),t[36]=w,t[37]=H,t[38]=W,t[39]=M):M=t[39],T=g,t[40]===S?k=t[41]:(k=S({id:`uIA8mX`}),t[40]=S,t[41]=k),A=`${h}-details-toggle`,E=`flex flex-col gap-2`,D=`${h}-details`;let G;t[42]===v?G=t[43]:(G=e=>{let t=f[e],n=d[e];return(0,x.jsxs)(`li`,{className:`flex min-w-0 flex-col`,"data-testid":`${v}-${e}`,children:[(0,x.jsx)(`span`,{className:`font-medium`,children:p[e]}),t!==null&&(0,x.jsx)(`span`,{className:`wrap-break-word opacity-75`,children:(0,x.jsx)(`code`,{className:`break-all`,children:t})}),n!==null&&(0,x.jsx)(`span`,{className:`wrap-break-word opacity-75`,children:(0,x.jsx)(`code`,{className:`break-all`,children:`${n}/open-knowledge/`})})]},e)},t[42]=v,t[43]=G),O=e.editors.map(G)}t[0]=S,t[1]=w,t[2]=a,t[3]=n,t[4]=u,t[5]=v,t[6]=l,t[7]=h,t[8]=T,t[9]=E,t[10]=D,t[11]=O,t[12]=k,t[13]=A,t[14]=j,t[15]=M,t[16]=N,t[17]=P}else T=t[8],E=t[9],D=t[10],O=t[11],k=t[12],A=t[13],j=t[14],M=t[15],N=t[16],P=t[17];if(P!==Symbol.for(`react.early_return_sentinel`))return P;let F;t[44]!==E||t[45]!==D||t[46]!==O?(F=(0,x.jsx)(`ul`,{className:E,"data-testid":D,children:O}),t[44]=E,t[45]=D,t[46]=O,t[47]=F):F=t[47];let I;t[48]!==T||t[49]!==F||t[50]!==k||t[51]!==A?(I=(0,x.jsx)(T,{title:k,testId:A,children:F}),t[48]=T,t[49]=F,t[50]=k,t[51]=A,t[52]=I):I=t[52];let L;t[53]!==I||t[54]!==j||t[55]!==M?(L=(0,x.jsxs)(`div`,{className:j,children:[M,I]}),t[53]=I,t[54]=j,t[55]=M,t[56]=L):L=t[56];let R;return t[57]!==L||t[58]!==N?(R=(0,x.jsxs)(x.Fragment,{children:[N,L]}),t[57]=L,t[58]=N,t[59]=R):R=t[59],R}function C(e){return p[e]}var w=`https://openknowledge.ai/docs/reference/what-open-knowledge-writes`,T=`local-only`,E=`flex items-start gap-2 rounded-md border p-3 text-sm font-normal transition-colors cursor-pointer`;function D(e){let t=(0,y.c)(48),{value:n,onValueChange:a,disabled:s,idPrefix:d,testIdPrefix:f}=e,p=s===void 0?!1:s,{_:m}=i(),h=`${d}-sharing-shared`,g=`${d}-sharing-local-only`,_=`${d}-sharing-label`,b;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,x.jsx)(r,{id:`wtcxiD`}),t[0]=b):b=t[0];let S;t[1]===_?S=t[2]:(S=(0,x.jsx)(`span`,{id:_,className:`text-sm font-medium`,children:b}),t[1]=_,t[2]=S);let C;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,x.jsx)(v,{}),t[3]=C):C=t[3];let T;t[4]===m?T=t[5]:(T=m({id:`rCDe1d`}),t[4]=m,t[5]=T);let D=`${f}-docs-link`,A;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,x.jsx)(r,{id:`zwWKhA`}),t[6]=A):A=t[6];let j;t[7]!==T||t[8]!==D?(j=(0,x.jsx)(`a`,{href:w,target:`_blank`,rel:`noopener noreferrer`,onClick:k,onAuxClick:O,"aria-label":T,className:`ms-auto text-1sm font-normal text-muted-foreground underline decoration-dotted decoration-muted-foreground/50 underline-offset-4 transition-colors hover:text-foreground hover:decoration-foreground`,"data-testid":D,children:A}),t[7]=T,t[8]=D,t[9]=j):j=t[9];let M;t[10]!==S||t[11]!==j?(M=(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[S,C,j]}),t[10]=S,t[11]=j,t[12]=M):M=t[12];let N;t[13]===a?N=t[14]:(N=e=>a(e),t[13]=a,t[14]=N);let P=n===`local-only`?`border-primary bg-primary/5`:`border-border hover:bg-muted/40`,F;t[15]===P?F=t[16]:(F=o(E,P),t[15]=P,t[16]=F);let I=`${f}-local-only`,L;t[17]!==g||t[18]!==I?(L=(0,x.jsx)(l,{id:g,value:`local-only`,"data-testid":I,className:`mt-0.5`}),t[17]=g,t[18]=I,t[19]=L):L=t[19];let R;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,x.jsx)(`span`,{className:`block font-medium`,children:(0,x.jsx)(r,{id:`QjzFZj`})}),t[20]=R):R=t[20];let z;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,x.jsxs)(`span`,{children:[R,(0,x.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,x.jsx)(r,{id:`un-K1H`})})]}),t[21]=z):z=t[21];let B;t[22]!==g||t[23]!==F||t[24]!==L?(B=(0,x.jsxs)(c,{htmlFor:g,className:F,children:[L,z]}),t[22]=g,t[23]=F,t[24]=L,t[25]=B):B=t[25];let V=n===`shared`?`border-primary bg-primary/5`:`border-border hover:bg-muted/40`,H;t[26]===V?H=t[27]:(H=o(E,V),t[26]=V,t[27]=H);let U=`${f}-shared`,W;t[28]!==h||t[29]!==U?(W=(0,x.jsx)(l,{id:h,value:`shared`,"data-testid":U,className:`mt-0.5`}),t[28]=h,t[29]=U,t[30]=W):W=t[30];let G;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,x.jsx)(`span`,{className:`block font-medium`,children:(0,x.jsx)(r,{id:`0Gd0NU`})}),t[31]=G):G=t[31];let K;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,x.jsxs)(`span`,{children:[G,(0,x.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,x.jsx)(r,{id:`dJw2_7`})})]}),t[32]=K):K=t[32];let q;t[33]!==h||t[34]!==H||t[35]!==W?(q=(0,x.jsxs)(c,{htmlFor:h,className:H,children:[W,K]}),t[33]=h,t[34]=H,t[35]=W,t[36]=q):q=t[36];let J;t[37]!==p||t[38]!==_||t[39]!==N||t[40]!==B||t[41]!==q||t[42]!==n?(J=(0,x.jsxs)(u,{value:n,onValueChange:N,disabled:p,className:`grid-cols-2 gap-3`,"aria-labelledby":_,children:[B,q]}),t[37]=p,t[38]=_,t[39]=N,t[40]=B,t[41]=q,t[42]=n,t[43]=J):J=t[43];let Y;return t[44]!==J||t[45]!==M||t[46]!==f?(Y=(0,x.jsxs)(`div`,{className:`flex flex-col space-y-2`,"data-testid":f,children:[M,J]}),t[44]=J,t[45]=M,t[46]=f,t[47]=Y):Y=t[47],Y}function O(e){return h(e,w)}function k(e){return h(e,w)}function A(){let e=null,t=null,n=new Set,r=!1,i=null;function a(){for(let e of n)e()}function o(){e!==null&&(e=null,a())}return{install({bridge:n}){if(n&&n.onboarding)return r?i??void 0:(r=!0,t=n,i=n.onboarding.onShow(t=>{e=t,a()}),n.onboarding.signalReady(),()=>{i?.(),i=null,r=!1,t=null,o()})},getSnapshot(){return e},subscribe(e){return n.add(e),()=>{n.delete(e)}},async confirm(e){let n=t;if(!n)return{ok:!1,error:m._({id:`bEp7UY`})};try{let t=await n.onboarding.confirm(e);return t.ok&&o(),t}catch(e){return{ok:!1,error:e instanceof Error?e.message:m._({id:`29VNqC`})}}},async cancel(){let e=t;if(!e)return{ok:!1,error:m._({id:`bEp7UY`})};try{let t=await e.onboarding.cancel();return t.ok&&o(),t}catch(e){return{ok:!1,error:e instanceof Error?e.message:m._({id:`29VNqC`})}}},dismiss(){o()}}}var j=A();function M(e){return j.install(e)}function N(e,t){let n=e=>e.replace(/\\/g,`/`).replace(/\/+$/,``)||(e.startsWith(`/`)?`/`:``),r=n(e),i=n(t);if(r===i)return`.`;let a=r.endsWith(`/`)?r:`${r}/`;return i.startsWith(a)?i.slice(a.length):null}function P(e){if(e===``||e===`.`)return!0;if(e.startsWith(`/`)||/^[A-Za-z]:/.test(e))return!1;let t=e.replace(/\\/g,`/`).split(`/`),n=0;for(let e of t)if(!(e===``||e===`.`))if(e===`..`){if(--n,n<0)return!1}else n+=1;return!0}export{T as a,M as i,N as n,D as o,j as r,S as s,P as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{X as e}from"./DocumentContext-
|
|
1
|
+
import{X as e}from"./DocumentContext-CWz_S-8Y.js";import{G as t}from"./CodeMirrorPropInput-B4qzFbMb.js";function n(n){let r=e(n.state.selection.content(),n.state.schema);return t().serialize(r).trim()}function r(e){return e.lineCount===1&&e.charLen<100?{kind:`inline`,markdown:e.markdown}:e.surface===`source`&&e.sourceLineStart!==void 0&&e.sourceLineEnd!==void 0?{kind:`lines`,startLine:e.sourceLineStart,endLine:e.sourceLineEnd}:{kind:`anchor`,markdown:e.markdown}}function i(e,t){return e.sourceLineStart!==void 0&&e.sourceLineEnd!==void 0?`${t} (${e.sourceLineStart===e.sourceLineEnd?`${e.sourceLineStart}`:`${e.sourceLineStart}-${e.sourceLineEnd}`})`:e.lineCount>1?`${t} (${e.lineCount} lines)`:`${t} (selection)`}function a(e){let t=e.replace(/\r\n/g,`
|
|
2
2
|
`).split(`
|
|
3
3
|
`),n=[],r=!1;for(let e of t){let t=e.trim();if(/^(```|~~~)/.test(t)){r||n.push(`code`),r=!r;continue}if(r||t===``)continue;if(/^\|.*\|?$/.test(t)&&t.includes(`|`)){n[n.length-1]!==`table`&&n.push(`table`);continue}if(/^<\/?[A-Za-z]/.test(t)){n[n.length-1]!==`component`&&n.push(`component`);continue}let i=t.match(/^#{1,6}\s+(.*)$/);if(i){n.push(i[1]??``);continue}let a=t.match(/^[-*+]\s+(.*)$/);if(a){n.push(`• ${a[1]??``}`);continue}let o=t.match(/^\d+\.\s+(.*)$/);if(o){n.push(`• ${o[1]??``}`);continue}let s=t.match(/^>\s?(.*)$/);if(s){n.push(s[1]??``);continue}n.push(t)}return n.join(` `).replace(/\s+/g,` `).trim()}var o=new Map,s=new Set,c=(e,t)=>`${t}:${e}`;function l(){for(let e of s)e()}function u(e,t){return e.markdown===t.markdown&&e.sourceLineStart===t.sourceLineStart&&e.sourceLineEnd===t.sourceLineEnd}function d(e,t,n){let r=c(e,t);if(n===null){o.delete(r)&&l();return}let i=o.get(r);i&&u(i,n)||(o.set(r,n),l())}function f(e,t){return e===null?null:o.get(c(e,t))??null}function p(e){return s.add(e),()=>{s.delete(e)}}function m(e,t){if(e.state.selection.empty)return null;let r=n(e);return r.trim()?{surface:`wysiwyg`,docName:t,markdown:r,charLen:r.trim().length,lineCount:(r.match(/\n/g)?.length??0)+1}:null}function h(e,t){return e.trim()?{surface:`frontmatter`,docName:t,markdown:e,charLen:e.trim().length,lineCount:(e.match(/\n/g)?.length??0)+1}:null}function g(e,t){let n=[],r=1/0,i=-1;for(let t of e.state.selection.ranges)t.empty||(n.push(e.state.sliceDoc(t.from,t.to)),r=Math.min(r,t.from),i=Math.max(i,t.to));if(n.length===0)return null;let a=n.join(`
|
|
4
4
|
`);if(!a.trim())return null;let o=e.state.doc.lineAt(r).number,s=e.state.doc.lineAt(i).number;return{surface:`source`,docName:t,markdown:a,charLen:a.trim().length,lineCount:s-o+1,sourceLineStart:o,sourceLineEnd:s}}export{h as a,r as c,i,p as l,a as n,g as o,d as r,m as s,f as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{bt as e}from"./CodeMirrorPropInput-
|
|
1
|
+
import{bt as e}from"./CodeMirrorPropInput-B4qzFbMb.js";import{C as t,D as n,E as r,G as i,L as a,S as o,U as s,W as c,g as l,it as u,rt as d}from"./config-provider--5n4V-Rz.js";import{$ as f,At as p,Ct as m,Nt as h,Ot as g,Y as _,Z as v,et as y}from"./dist-BXlOzfrR.js";var b=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:a(this.yanchor),yhead:a(this.yhead)}}static fromJSON(t){return new e(r(t.yanchor),r(t.yhead))}},x=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new l(e)}toYPos(e,t=0){return n(this.ytext,e,t)}fromYPos(e){let n=t(r(e),this.ytext.doc);if(n==null||n.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:n.index,assoc:n.assoc}}toYRange(e){let t=e.assoc;return new b(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?g.cursor(n.pos,n.assoc):g.range(t.pos,n.pos)}},S=p.define({combine(e){return e[e.length-1]}}),C=m.define(),w=class{constructor(e){this.view=e,this.conf=e.state.facet(S),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[C.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(C)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
|
|
2
2
|
`);e!==r&&t.delete(e+n,r-e),s.length>0&&t.insert(e+n,s),n+=s.length-(r-e)})},this.conf)}destroy(){this._ytext.unobserve(this._observer)}},T=f.fromClass(w),E=v.baseTheme({".cm-ySelection":{},".cm-yLineSelection":{padding:0,margin:`0px 2px 0px 4px`},".cm-ySelectionCaret":{position:`relative`,borderLeft:`1px solid black`,borderRight:`1px solid black`,marginLeft:`-1px`,marginRight:`-1px`,boxSizing:`border-box`,display:`inline`},".cm-ySelectionCaretDot":{borderRadius:`50%`,position:`absolute`,width:`.4em`,height:`.4em`,top:`-.2em`,left:`-.2em`,backgroundColor:`inherit`,transition:`transform .3s ease-in-out`,boxSizing:`border-box`},".cm-ySelectionCaret:hover > .cm-ySelectionCaretDot":{transformOrigin:`bottom center`,transform:`scale(0)`},".cm-ySelectionInfo":{position:`absolute`,top:`-1.05em`,left:`-1px`,fontSize:`.75em`,fontFamily:`serif`,fontStyle:`normal`,fontWeight:`normal`,lineHeight:`normal`,userSelect:`none`,color:`white`,paddingLeft:`2px`,paddingRight:`2px`,zIndex:101,transition:`opacity .3s ease-in-out`,backgroundColor:`inherit`,opacity:0,transitionDelay:`0s`,whiteSpace:`nowrap`},".cm-ySelectionCaret:hover > .cm-ySelectionInfo":{opacity:1,transitionDelay:`0s`}}),D=m.define(),O=class extends y{constructor(e,t){super(),this.color=e,this.name=t}toDOM(){return s(`span`,[i(`class`,`cm-ySelectionCaret`),i(`style`,`background-color: ${this.color}; border-color: ${this.color}`)],[c(``),s(`div`,[i(`class`,`cm-ySelectionCaretDot`)]),c(``),s(`div`,[i(`class`,`cm-ySelectionInfo`)],[c(this.name)]),c(``)])}eq(e){return e.color===this.color}compare(e){return e.color===this.color}updateDOM(){return!1}get estimatedHeight(){return-1}ignoreEvent(){return!0}},k=class{constructor(e){this.conf=e.state.facet(S),this._listener=({added:t,updated:n,removed:r},i,a)=>{t.concat(n).concat(r).findIndex(e=>e!==this.conf.awareness.doc.clientID)>=0&&e.dispatch({annotations:[D.of([])]})},this._awareness=this.conf.awareness,this._awareness.on(`change`,this._listener),this.decorations=h.of([])}destroy(){this._awareness.off(`change`,this._listener)}update(e){let i=this.conf.ytext,a=i.doc,s=this.conf.awareness,c=[],l=this.conf.awareness.getLocalState();if(l!=null){let t=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),a=t?e.state.selection.main:null,c=l.cursor==null?null:r(l.cursor.anchor),u=l.cursor==null?null:r(l.cursor.head);if(a!=null){let e=n(i,a.anchor),t=n(i,a.head);(l.cursor==null||!o(c,e)||!o(u,t))&&s.setLocalStateField(`cursor`,{anchor:e,head:t})}else l.cursor!=null&&t&&s.setLocalStateField(`cursor`,null)}s.getStates().forEach((n,r)=>{if(r===s.doc.clientID)return;let o=n.cursor;if(o==null||o.anchor==null||o.head==null)return;let l=t(o.anchor,a),f=t(o.head,a);if(l==null||f==null||l.type!==i||f.type!==i)return;let{color:p=`#30bced`,name:m=`Anonymous`}=n.user||{},h=n.user&&n.user.colorLight||p+`33`,g=u(l.index,f.index),v=d(l.index,f.index),y=e.view.state.doc.lineAt(g),b=e.view.state.doc.lineAt(v);if(y.number===b.number)c.push({from:g,to:v,value:_.mark({attributes:{style:`background-color: ${h}`},class:`cm-ySelection`})});else{c.push({from:g,to:y.from+y.length,value:_.mark({attributes:{style:`background-color: ${h}`},class:`cm-ySelection`})}),c.push({from:b.from,to:v,value:_.mark({attributes:{style:`background-color: ${h}`},class:`cm-ySelection`})});for(let t=y.number+1;t<b.number;t++){let n=e.view.state.doc.line(t).from;c.push({from:n,to:n,value:_.line({attributes:{style:`background-color: ${h}`,class:`cm-yLineSelection`}})})}}c.push({from:f.index,to:f.index,value:_.widget({side:f.index-l.index>0?-1:1,block:!1,widget:new O(p,m)})})}),this.decorations=_.set(c,!0)}},A=f.fromClass(k,{decorations:e=>e.decorations}),j=class{constructor(e){this.undoManager=e}addTrackedOrigin(e){this.undoManager.addTrackedOrigin(e)}removeTrackedOrigin(e){this.undoManager.removeTrackedOrigin(e)}undo(){return this.undoManager.undo()!=null}redo(){return this.undoManager.redo()!=null}},M=p.define({combine(e){return e[e.length-1]}});m.define();var N=class{constructor(t){this.view=t,this.conf=t.state.facet(M),this._undoManager=this.conf.undoManager,this.syncConf=t.state.facet(S),this._beforeChangeSelection=null,this._mux=e(),this._onStackItemAdded=({stackItem:e,changedParentTypes:t})=>{t.has(this.syncConf.ytext)&&this._beforeChangeSelection&&!e.meta.has(this)&&e.meta.set(this,this._beforeChangeSelection)},this._onStackItemPopped=({stackItem:e})=>{let n=e.meta.get(this);if(n){let e=this.syncConf.fromYRange(n);t.dispatch(t.state.update({selection:e,effects:[v.scrollIntoView(e)]})),this._storeSelection()}},this._storeSelection=()=>{this._beforeChangeSelection=this.syncConf.toYRange(this.view.state.selection.main)},this._undoManager.on(`stack-item-added`,this._onStackItemAdded),this._undoManager.on(`stack-item-popped`,this._onStackItemPopped),this._undoManager.addTrackedOrigin(this.syncConf)}update(e){e.selectionSet&&(e.transactions.length===0||e.transactions[0].annotation(C)!==this.syncConf)&&this._storeSelection()}destroy(){this._undoManager.off(`stack-item-added`,this._onStackItemAdded),this._undoManager.off(`stack-item-popped`,this._onStackItemPopped),this._undoManager.removeTrackedOrigin(this.syncConf)}},P=f.fromClass(N),F=({state:e,dispatch:t})=>e.facet(M).undo()||!0,I=({state:e,dispatch:t})=>e.facet(M).redo()||!0,L=[{key:`Mod-z`,run:F,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:I,preventDefault:!0},{key:`Mod-Shift-z`,run:I,preventDefault:!0}],R=(e,t,{undoManager:n=new l(e)}={})=>{let r=new x(e,t),i=[S.of(r),T];return t&&i.push(E,A),n!==!1&&i.push(M.of(new j(n)),P,v.domEventHandlers({beforeinput(e,t){return e.inputType===`historyUndo`?F(t):e.inputType===`historyRedo`?I(t):!1}})),i};export{L as n,R as t};
|
package/dist/public/assets/{typing-burst-detector-CtCPp1ik.js → typing-burst-detector-9KG7xADF.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{An as n,En as r,Fn as i,Gn as a,Mt as o,_n as s,_r as c,dr as l,er as u,hn as d,i as f,jt as p,on as m,si as h,ui as g,z as _}from"./DocumentContext-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{An as n,En as r,Fn as i,Gn as a,Mt as o,_n as s,_r as c,dr as l,er as u,hn as d,i as f,jt as p,on as m,si as h,ui as g,z as _}from"./DocumentContext-CWz_S-8Y.js";import{t as v}from"./react-f2sANaYj.js";import{n as y,r as b}from"./dist-Nvb76hAm.js";import{r as x,t as S}from"./useQuery-ZeEDLtxh.js";import{t as C}from"./compiler-runtime-BfE3aGVn.js";import{t as w}from"./utils-CPqDy6Hr.js";import{t as T}from"./button-Cym3gapE.js";import{i as E,n as D,t as O}from"./tooltip-DttaCTqz.js";import{n as k,r as ee,t as A}from"./collapsible-DYySK8La.js";import{Ct as j,Et as M,G as N,Q as P,b as F,xt as I}from"./CodeMirrorPropInput-B4qzFbMb.js";import{n as L,t as R}from"./toggle-group-C2_37kV5.js";import{Ds as z,F as B,No as V,Ri as H,bt as te,cn as ne,ln as U,nr as W,qo as G,rr as re,vo as K,wt as q}from"./dist-C_QZEaeX.js";import{n as J}from"./dist-CJhtNlOm2.js";import{s as ie}from"./use-settings-route-6Aa41RPQ.js";import{t as Y}from"./dist-Cr4-nBVI.js";import{f as ae,v as oe}from"./documents-events-CwqQxQT5.js";import{t as se}from"./note-window-mode-CsmLTxU_.js";import{t as ce}from"./createLucideIcon-BulbvLvN.js";import{t as le}from"./chevron-right-4mYNnAZZ.js";import{n as ue,t as de}from"./lint-plugin-meta-LEBWvINg.js";import{t as fe}from"./circle-alert-b-E0_BIP.js";import{i as pe,r as me}from"./prop-types-Boc_oFTG.js";import{t as he}from"./refresh-cw-DwRz6AkS.js";import{t as ge}from"./triangle-alert-D0n54WVY.js";import{t as _e}from"./wrench-ZOpNzIoC.js";import{f as ve,u as ye}from"./doc-paths-DMctW8qz.js";import{a as be,i as xe,s as Se}from"./startup-marks-Cw2UqI10.js";import{C as Ce,D as we}from"./config-provider--5n4V-Rz.js";import{$ as Te,It as Ee,Lt as De,Ot as Oe,Y as ke,Z as Ae}from"./dist-BXlOzfrR.js";import{t as je}from"./badge-52pHek8I.js";import{a as Me,c as Ne,i as Pe,n as Fe,r as Ie,s as Le,t as Re}from"./panel-Do94xfkL.js";import{t as ze}from"./skeleton-DIxLroLR.js";import{a as Be,c as Ve,d as He}from"./lint-config-client-pNtVqn1v.js";var Ue=ce(`chevrons-down-up`,[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]),We=56,Ge=2,Ke=150,qe=2e3;function Je(e,t,n){return e.top+e.height/2-(n+t)/2}function Ye(e,t){let n=Math.max(0,t.scrollHeight-t.clientHeight);return Math.max(0,Math.min(e,n))}function Xe(e){let{docName:t,container:a,measureTarget:o,placement:s,intent:c,grade:l,landedMode:u,transition:d,onOutcome:f,onDiscardQueuedTarget:p,toolbarOffset:m=We,driftThresholdPx:h=Ge,quietMs:g=Ke,abandonAfterMs:_=qe}=e,v=e.contentColumn??a.firstElementChild,y=r(t,`landing`),b=n(t,{yieldsToNavigation:c===`toggle`,supersede:()=>N(`superseded`)}),x=a.style.overflowAnchor;a.style.overflowAnchor=`none`,d&&be(`ok/mode-switch/transition`,{from:d.from,to:d.to,grade:l});let S=!1,C=null,w,T,E=0,D,O=()=>{let e=o();return e===null?null:Ye(s===`center`?Je(e,a.clientHeight,m):e.top-m,a)},k=()=>{let e=O();if(e===null)return{measurable:!1,moved:!1};C=e;let t=Math.abs(a.scrollTop-e)>h;return t&&(a.scrollTop=e),{measurable:!0,moved:t}},ee=()=>a.scrollTop-(O()??C??a.scrollTop),A=()=>{w&&clearTimeout(w),T&&clearTimeout(T),E&&cancelAnimationFrame(E),D?.disconnect(),a.removeEventListener(`wheel`,F),a.removeEventListener(`touchstart`,F),a.removeEventListener(`contentvisibilityautostatechange`,I,!0),a.style.overflowAnchor=x,y.release(),b.release()},j=()=>{if(S)return;S=!0;let e;try{k(),e=ee(),C!==null&&i({docName:t,container:a,targetScrollTop:a.scrollTop,mode:u})}finally{A()}be(`ok/landing/land`,{grade:l,delta:e}),f?.({status:`landed`,delta:e})},M=()=>{if(S)return;S=!0;let e=C??a.scrollTop,t;try{t=ee()}finally{A()}be(`ok/landing/abandoned`,{grade:l,target:e,delta:t}),f?.({status:`abandoned`,delta:t})},N=e=>{S||(S=!0,A(),e===`mode-flip`&&p?.(),f?.({status:`cancelled`,reason:e}))},P=()=>{w&&clearTimeout(w),w=setTimeout(j,g)};function F(){N(`user-scroll`)}function I(){if(S)return;let{measurable:e,moved:t}=k();e&&(t||w===void 0)&&P()}try{k().measurable&&P(),a.addEventListener(`contentvisibilityautostatechange`,I,!0),a.addEventListener(`wheel`,F,{passive:!0}),a.addEventListener(`touchstart`,F,{passive:!0}),typeof ResizeObserver<`u`&&v&&(D=new ResizeObserver(I),D.observe(v)),E=requestAnimationFrame(I),T=setTimeout(M,_)}catch(e){throw S=!0,A(),e}return{cancel:N}}function X(e){switch(e){case`bulletList`:case`orderedList`:case`taskList`:case`list`:return`list`;case`codeBlock`:case`code`:return`code`;case`horizontalRule`:case`thematicBreak`:return`thematicBreak`;case`jsxComponent`:case`mdxJsxFlowElement`:case`mdxJsxTextElement`:return`jsx`;case`htmlBlock`:case`html`:return`html`;default:return e}}function Ze(e){return typeof e!=`object`||!e?``:`value`in e&&typeof e.value==`string`?e.value:`children`in e&&Array.isArray(e.children)?e.children.map(Ze).join(``):``}function Qe(e,t){let{frontmatter:n,body:r}=G(e),i=n===``?0:n.split(`
|
|
2
2
|
`).length-1;try{return{blocks:t.parseToEditorMdast(r).children.map(e=>({start:(e.position?.start.line??1/0)+i,end:(e.position?.end.line??-1/0)+i,kind:X(e.type),text:Ze(e)})),fmLineCount:i}}catch{return performance.mark(`ok/block-spans/parse-failed`),{blocks:[],fmLineCount:i}}}function $e(e,t){let{blocks:n,fmLineCount:r}=Qe(e,t);return{spans:n.map(e=>({start:e.start,end:e.end})),fmLineCount:r}}function et(e,t){if(e.length===0)return null;let n=0,r=e.length-1,i=e.length-1;for(;n<=r;){let a=n+r>>1,o=e[a];o!==void 0&&o.end>=t?(i=a,r=a-1):n=a+1}return i}function tt(e){let t=0;for(let n=e.childCount-1;n>=0;n--){let r=e.child(n);if(r.type.name!==`paragraph`||r.content.size!==0)break;t++}return t<2?e.childCount-t:e.childCount}function nt(e,t,n){let r=e.childCount,i=Math.max(0,Math.min(t,r)),a=Math.max(i,Math.min(n,r));if(a<=i)return null;let o=0;for(let t=0;t<i;t++)o+=e.child(t).nodeSize;let s=o;for(let t=i;t<a;t++)o+=e.child(t).nodeSize;let c=o,l=e.content.size,u=Math.max(0,Math.min(s,l)),d=Math.max(u,Math.min(c,l));return d<=u?null:{from:u,to:d}}function rt(e){let t=[0];for(let n=0;n<e.length;n++)e[n]===`
|
|
3
3
|
`&&t.push(n+1);return t}function it(e,t,n){return t<=1?0:t-1>=e.length?n:e[t-1]??n}function at(e,t){let n=0,r=e.length-1,i=1;for(;n<=r;){let a=n+r>>1;(e[a]??0)<=t?(i=a+1,n=a+1):r=a-1}return i}function ot(e,t,n){return Math.max(t,Math.min(e,n))}function st(e,t){let n=e=>e.replace(/\s+/g,` `).trim();return n(e)===n(t)}function ct(e,t){return t.inRange?t.tripwireOk?st(e.content,t.text)?`exact`:e.kind===t.kind?`same-type-ordinal`:`ordinal`:`ordinal`:`clamped`}function lt(e){let t=null,n=null;function r(r){return n!==null&&t===r?n:(n={blocks:Qe(r,e).blocks,lineStarts:rt(r)},t=r,n)}return{captureFromWysiwyg(e,t,n){if(e.childCount===0)return null;let r=ot(t,0,e.content.size),i=0,a=e.childCount-1,o=0;for(let t=0;t<e.childCount;t++){let n=e.child(t).nodeSize;if(r<i+n){a=t,o=i+1;break}i+=n,o=i+1}let s=e.child(a),c={blockIndex:a,kind:X(s.type.name),content:s.textContent};return n?.refine&&(c.selectionInBlock=Math.max(0,r-o)),c},captureFromSource(e,t,n){let{blocks:i,lineStarts:a}=r(e);if(i.length===0)return null;let o=ot(t,0,e.length),s=et(i,at(a,o));if(s===null)return null;let c=i[s];if(!c)return null;let l={blockIndex:s,kind:c.kind,content:c.text};if(n?.refine){let t=it(a,c.start,e.length);l.selectionInBlock=Math.max(0,o-t)}return l},resolveInSource(e,{source:t,doc:n}){let{blocks:i,lineStarts:a}=r(t);if(i.length===0)return null;let o=e.blockIndex>=0&&e.blockIndex<i.length,s=tt(n)===i.length,c=i[ot(e.blockIndex,0,i.length-1)],l=it(a,c.start,t.length),u=Math.min(it(a,c.end+1,t.length),t.length),d=ct(e,{inRange:o,tripwireOk:s,kind:c.kind,text:c.text}),f=l;return d===`exact`&&e.selectionInBlock!==void 0&&(f=ot(l+e.selectionInBlock,l,u)),{blockStart:l,blockEnd:u,point:f,confidence:d}},resolveInWysiwyg(e,{source:t,doc:n}){let i=tt(n);if(i===0)return null;let{blocks:a}=r(t),o=e.blockIndex>=0&&e.blockIndex<i,s=i===a.length,c=ot(e.blockIndex,0,i-1),l=nt(n,c,c+1);if(l===null)return null;let u=n.child(c),d=ct(e,{inRange:o,tripwireOk:s,kind:X(u.type.name),text:u.textContent});return{blockStart:l.from,blockEnd:l.to,point:l.from,confidence:d}}}}var ut=Ee.define(),dt=Ee.define(),ft=ke.mark({class:p}),pt=De.define({create(){return ke.none},update(e,t){let n=e.map(t.changes);for(let e of t.effects)e.is(ut)?n=ke.set([ft.range(e.value.from,e.value.to)]):e.is(dt)&&(n=ke.none);return n},provide:e=>Ae.decorations.from(e)}),mt=new WeakMap,ht=Te.define(e=>({destroy(){let t=mt.get(e);t!==void 0&&(clearTimeout(t),mt.delete(e))}}));function gt(e,t,n,r){let i=o(e.state.doc.length,t,n,r);if(!i)return;e.dispatch({effects:ut.of(i)});let a=mt.get(e);a!==void 0&&clearTimeout(a);let s=setTimeout(()=>{mt.delete(e),e.dispatch({effects:dt.of(null)})},B);mt.set(e,s)}function _t(){return[pt,ht]}var vt=3e4;function yt(){let e=new Map,t=e=>e?Date.now()-e.rememberedAt>vt?null:e.navigation:null;return{remember(t,n){e.set(t,{navigation:n,rememberedAt:Date.now()})},peek(n){return t(e.get(n))},consume(n){let r=e.get(n);return e.delete(n),t(r)},clear(t){e.delete(t)},clearForTest(){e.clear()}}}var bt=yt(),xt=yt(),St=bt.remember,Ct=bt.peek,wt=bt.consume,Tt=bt.clear;bt.clearForTest;var Et=xt.remember,Dt=xt.peek,Ot=xt.consume,kt=xt.clear;xt.clearForTest;function At(e,t,n){return{start:we(e,t),end:we(e,n)}}function jt(e,t){let n=Ce(e.start,t),r=Ce(e.end,t);return n===null||r===null||r.index<=n.index?null:n.index}var Mt=`open-knowledge:view-in-source`,Nt=null;function Pt(){return Nt??=lt(N()),Nt}function Ft(e,t,n,r,i=`toggle`){let a=r.captureFromWysiwyg(e,t,{refine:i===`jump`});if(!a)return null;let o=r.resolveInSource(a,{source:n.toString(),doc:e});return{kind:`selection-offset`,intent:i,anchor:a,pin:o?At(n,o.blockStart,o.blockEnd):void 0}}function It(e){let{editor:t,docName:n,ytext:r}=e,i=I(t);if(!i)return;let a=i.state.selection.from,o=Ft(i.state.doc,a,r,Pt(),`jump`);o&&St(n,o),window.dispatchEvent(new CustomEvent(Mt,{detail:{docName:n}}))}function Lt(e,t,n,r,i){let a=r.captureFromSource(e,t);if(!a)return null;let o=i?r.resolveInSource(a,{source:e,doc:i}):null;return{kind:`selection-offset`,anchor:a,pin:o?At(n,o.blockStart,o.blockEnd):void 0}}function Rt(e,t){let{source:n,pmDoc:r,ydoc:i,resolver:a}=t;if(e.pin){let t=jt(e.pin,i);if(t===null){let t=a.resolveInWysiwyg(e.anchor,{source:n,doc:r});return t?{...t,point:t.blockStart,confidence:`clamped`}:null}let o=a.captureFromSource(n,t);if(o)return a.resolveInWysiwyg(o,{source:n,doc:r})}return a.resolveInWysiwyg(e.anchor,{source:n,doc:r})}function zt(e,t){let{source:n,pmDoc:r,ydoc:i,resolver:a}=t;if(e.pin){let t=jt(e.pin,i);if(t===null){let t=a.resolveInSource(e.anchor,{source:n,doc:r});return t?{...t,point:t.blockStart,confidence:`clamped`}:null}let o=a.captureFromSource(n,t);if(o)return a.resolveInSource(o,{source:n,doc:r})}return a.resolveInSource(e.anchor,{source:n,doc:r})}function Bt(e,t){try{return e.coordsAtPos(t)}catch{return null}}function Vt(e,t,n){let r=Math.max(0,Math.min(n,e.state.doc.length)),i=t.getBoundingClientRect().top,a=Bt(e,r);if(a)return{top:a.top-i+t.scrollTop,height:a.bottom-a.top};try{let n=e.lineBlockAt(r);return{top:e.documentTop-i+t.scrollTop+n.top,height:n.height}}catch{return null}}function Ht(e,t){if(e.isDestroyed)return null;try{let n=e.nodeDOM(t);if(n instanceof HTMLElement)return n;let{node:r}=e.domAtPos(t);return r instanceof HTMLElement?r:r.parentElement}catch{return null}}function Ut(e,t,n){if(e.isDestroyed)return null;let r=Ht(e,Math.max(0,Math.min(n,e.state.doc.content.size)));if(!r)return null;let i=r.getBoundingClientRect(),a=t.getBoundingClientRect().top;return{top:i.top-a+t.scrollTop,height:i.height}}function Wt(){return typeof document>`u`?null:m()}function Gt(e,t){let n=t.getBoundingClientRect(),r=n.left+n.width/2,i=F();for(let t of[i+1,i+12,i+40]){let i=e.posAtCoords({left:r,top:n.top+t});if(i)return i.pos}return null}function Kt(e,t){let n=t.getBoundingClientRect(),r=n.left+n.width/2,i=F();for(let t of[i+1,i+12,i+40]){let i=e.posAtCoords({x:r,y:n.top+t});if(i!==null)return i}return null}function qt(e){let{from:t,to:n,docName:r,ytext:i}=e;t===`wysiwyg`&&n===`source`?Jt(r,i):t===`source`&&n===`wysiwyg`&&Yt(r,i)}function Jt(e,t){let n=Ct(e);if(n&&n.kind!==`selection-offset`)return;let r=a(e);if(!r)return;let i=I(r);if(!i)return;let o=Wt();if(!o)return;let s=Gt(i,o);if(s===null)return;let c=Ft(i.state.doc,s,t,Pt());c&&St(e,c)}function Yt(e,t){let n=d(e);if(!n)return;let r=Wt();if(!r)return;let i=Kt(n,r);if(i===null)return;let o=a(e),s=o?I(o)?.state.doc:void 0,c=Lt(t.toString(),i,t,Pt(),s);c&&Et(e,c)}function Xt(e){let{view:t,docName:r,navigation:i,ydoc:o,transition:s}=e,c=a(r),l=c?I(c)?.state.doc:void 0;if(!l)return null;let u=zt(i,{source:t.state.doc.toString(),pmDoc:l,ydoc:o,resolver:Pt()});if(!u)return null;let d=Wt();if(!d)return null;let f=u,p=i.intent===`jump`,m=p?f.point:f.blockStart;t.dispatch({effects:Ae.scrollIntoView(m,{y:`start`})});let h=!1,g=null,_=n(r,{yieldsToNavigation:!p,supersede:()=>{h=!0,_.release()}}),v=e=>{if(!h){if(Bt(t,m)===null&&e<8){requestAnimationFrame(()=>v(e+1));return}try{p&&(t.dispatch({selection:Oe.cursor(m)}),t.focus())}finally{_.release()}g=Xe({docName:r,container:d,contentColumn:t.contentDOM,measureTarget:()=>Vt(t,d,m),placement:p?`center`:`top`,intent:p?`jump`:`toggle`,grade:f.confidence,landedMode:`source`,transition:s,toolbarOffset:F(),onOutcome:p?e=>{e.status===`landed`&>(t,f.blockStart,f.blockEnd,f.confidence)}:void 0,onDiscardQueuedTarget:()=>Tt(r)})}};return v(0),{cancel:e=>{h=!0,_.release(),g?.cancel(e)}}}function Zt(e){let{editor:t,docName:n,navigation:r,ydoc:i,transition:a}=e,o=I(t);if(!o)return null;let s=Rt(r,{source:i.getText(`source`).toString(),pmDoc:o.state.doc,ydoc:i,resolver:Pt()});if(!s)return null;let c=Wt();if(!c)return null;let l=s;return Xe({docName:n,container:c,contentColumn:o.dom,measureTarget:()=>Ut(o,c,l.point),placement:`top`,intent:`toggle`,grade:l.confidence,landedMode:`wysiwyg`,transition:a,toolbarOffset:F(),onDiscardQueuedTarget:()=>kt(n)})}var Z=e(v(),1),Q=C(),$=t();function Qt(e){let t=(0,Q.c)(14),{scope:n,onScopeChange:r,projectLabel:i}=e,{_:a}=b(),o;t[0]===r?o=t[1]:(o=e=>{e&&r(e)},t[0]=r,t[1]=o);let s;t[2]===a?s=t[3]:(s=a({id:`aBgwis`}),t[2]=a,t[3]=s);let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(L,{value:`doc`,className:`flex-1`,"data-testid":`panel-scope-doc`,children:(0,$.jsx)(y,{id:`UpCz01`})}),t[4]=c):c=t[4];let l;t[5]===i?l=t[6]:(l=i??(0,$.jsx)(y,{id:`ZWyHmq`}),t[5]=i,t[6]=l);let u;t[7]===l?u=t[8]:(u=(0,$.jsx)(L,{value:`project`,className:`flex-1`,"data-testid":`panel-scope-project`,children:l}),t[7]=l,t[8]=u);let d;return t[9]!==n||t[10]!==o||t[11]!==s||t[12]!==u?(d=(0,$.jsx)(`div`,{className:`shrink-0 px-4 pb-2`,children:(0,$.jsxs)(R,{type:`single`,variant:`segmented`,size:`sm`,spacing:1,value:n,onValueChange:o,"aria-label":s,className:`w-full rounded-md bg-muted p-0.5 dark:bg-background`,children:[c,u]})}),t[9]=n,t[10]=o,t[11]=s,t[12]=u,t[13]=d):d=t[13],d}function $t(e){let t=e.localTarget;if(e.source!==`links`||t===void 0)return e.message;let n=t.resolvedTarget??t.href;return t.reason===`unresolvable`?t.role===`image`?Y._({id:`W5qdI_`,values:{shown:n}}):Y._({id:`bpMVIA`,values:{shown:n}}):t.targetKind===`file`?t.role===`image`?Y._({id:`iSWh95`,values:{shown:n}}):Y._({id:`fOzzSV`,values:{shown:n}}):Y._({id:`XBBZnv`,values:{shown:n}})}var en=`audit-superseded`;async function tn(e={kind:`project`},t){return rn(e,U,!1,t)}async function nn(e={kind:`project`},t){return rn(e,ne,!0,t)}async function rn(e,t,n,r){try{let i=new URLSearchParams;e.kind===`path`?i.set(`path`,e.path):e.kind===`doc`&&i.set(`doc`,e.docName),n&&i.set(`counts`,`1`);let a=i.size===0?``:`?${i}`,o=await fetch(`/api/audit${a}`,r===void 0?void 0:{signal:r});if(!o.ok)return o.status===409?en:(console.warn(`[audit] request failed`,o.status,o.statusText),null);let s;try{s=await o.json()}catch{return r?.aborted===!0||console.warn(`[audit] response body is not valid JSON`),null}let c=t.safeParse(s);return c.success?c.data:(console.warn(`[audit] response failed schema validation`,c.error.issues),null)}catch(e){return r?.aborted===!0||console.warn(`[audit] fetch threw`,e),null}}function an(e,t){let n=!1,r=!1,i=!1,a=[],o=null,s=()=>{if(r){i=!0;return}r=!0,o=new AbortController,t({status:`loading`,findings:a}),tn({kind:`doc`,docName:e},o.signal).then(e=>{if(!(n||o?.signal.aborted===!0)){if(e===null){t({status:`failed`,findings:a});return}if(e===`audit-superseded`){i=!0;return}i||(a=e.files.flatMap(e=>e.diagnostics).filter(e=>e.source===`links`),t({status:`loaded`,findings:a}))}}).finally(()=>{n||(r=!1,o=null,i&&(i=!1,s()))})};s();let c=oe(e=>{(e.includes(`backlinks`)||ae(e))&&s()});return()=>{n=!0,o?.abort(),c()}}function on(e){let t=(0,Q.c)(6),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={docName:null,state:{status:`idle`,findings:[]}},t[0]=n):n=t[0];let[r,i]=(0,Z.useState)(n),a,o;if(t[1]===e?(a=t[2],o=t[3]):(a=()=>{if(e===null){i({docName:null,state:{status:`idle`,findings:[]}});return}return i({docName:e,state:{status:`loading`,findings:[]}}),an(e,t=>i({docName:e,state:t}))},o=[e],t[1]=e,t[2]=a,t[3]=o),(0,Z.useEffect)(a,o),r.docName!==e){let n;return t[4]===e?n=t[5]:(n=e===null?{status:`idle`,findings:[]}:{status:`loading`,findings:[]},t[4]=e,t[5]=n),n}return r.state}function sn(e){return Math.min(50,Math.max(1,Math.ceil(e/10)))}function cn(e,t){return e===t||e%sn(t)===0}var ln=[250,500,1e3,2e3,4e3];function un(e){return e.status===503&&e.problemType===`urn:ok:error:too-many-agent-sessions`}async function dn(e,t){let n=await t.fixItem(e);for(let r of ln){if(n.ok||!un(n)||!t.shouldContinue()||(console.debug(`[sweep] capacity refusal, backing off %dms`,r),await t.sleep(r),!t.shouldContinue()))break;n=await t.fixItem(e)}return n}async function fn(e){let t=e.items.length,n=[];for(let[r,i]of e.items.entries()){if(r>0&&(await e.sleep(15),!e.shouldContinue()))return{failures:n,cancelled:!0};let a=await dn(i,e);if(a.ok||n.push({item:i,detail:a.errorDetail}),!e.shouldContinue())return{failures:n,cancelled:!0};let o=r+1;cn(o,t)&&e.onProgress(o,t)}return{failures:n,cancelled:!1}}function pn(e){return new Promise(t=>setTimeout(t,e))}var mn=null,hn=!1,gn=new Set,_n=new Set;function vn(e){mn=e;for(let e of gn)e()}function yn(e){return gn.add(e),()=>{gn.delete(e)}}function bn(){return mn}function xn(){return(0,Z.useSyncExternalStore)(yn,bn,bn)}function Sn(e){return _n.add(e),()=>{_n.delete(e)}}function Cn(){hn=!0}function wn(e,t,n){if(e.length>0&&(console.warn(`[lint] fix-all: ${e.length} of ${n} files failed`,e.map(e=>({file:e.item.file,detail:e.detail}))),!t)){let t=e[0];J.error(Y._({id:`se-tU0`,values:{0:e.length,total:n}}),{description:t===void 0?void 0:`${t.item.file}${t.detail===null?``:` — ${t.detail}`}`})}if(t){J.info(Y._({id:`H1TmTu`}));return}e.length===0&&J.success(Y._({id:`SWX1O7`,values:{total:n}}))}async function Tn({items:e,fixItem:t,sleep:n=pn}){if(mn!==null||e.length===0)return;let r=e.length;hn=!1,vn({done:0,total:r});let i=[],a=!1,o=!1;try{let o=await fn({items:e,fixItem:t,sleep:n,onProgress:e=>vn({done:e,total:r}),shouldContinue:()=>!hn});i=o.failures,a=o.cancelled}catch(e){console.warn(`[lint] fix-all: sweep threw`,e),o=!0}finally{vn(null)}try{o?J.error(Y._({id:`vwV-kH`})):wn(i,a,r)}finally{for(let e of _n)e()}}var En={errorCount:0,warningCount:0},Dn=new Map,On=new Set,kn=new Map;function An(){let e=new Map;for(let[t,n]of Dn){let r=n.lint.errorCount+n.links.errorCount,i=n.lint.warningCount+n.links.warningCount;r===0&&i===0||e.set(t,{errorCount:r,warningCount:i})}kn=e;for(let e of On)e()}var jn=W;function Mn(e){return On.add(e),()=>{On.delete(e)}}function Nn(){return kn}function Pn(e){Dn.clear();for(let t of e)Dn.set(ye(t.file),jn(t.diagnostics));An()}function Fn(e){Dn.clear();for(let t of e)Dn.set(ye(t.file),{lint:t.lint,links:t.links});An()}function In(e,t){Dn.set(e,jn(t)),An()}function Ln(e,t,n){let r=Dn.get(e)??{lint:En,links:En},i=r[t];i.errorCount===n.errorCount&&i.warningCount===n.warningCount||(Dn.set(e,{...r,[t]:n}),An())}var Rn=`open-knowledge:lint-nav`;function zn(e,t){return e.range.start.line-t.range.start.line||e.range.start.character-t.range.start.character}function Bn(e,t){return{docName:e,line:t.range.start.line+1,column:t.range.start.character+1,source:t.source,...t.frontmatterScope===void 0?{}:{frontmatterScope:t.frontmatterScope}}}function Vn(e){if(e.source!==`links`)return null;let t=e.localTarget;return t===void 0?`document`:t.role===`image`?`image`:t.targetKind===`file`?`file`:t.targetKind===`document`?`document`:`unresolvable`}var Hn={document:l,file:c,image:j,unresolvable:l};function Un(e){return e.linkTarget!==void 0&&Vn(e)===`document`}function Wn(e){let t=(0,Q.c)(40),{diagnostic:n,instanceCount:r}=e,{_:i}=b(),a=n.severity===`error`?fe:ge,o=n.range.start.line+1,s;t[0]===n?s=t[1]:(s=Vn(n),t[0]=n,t[1]=s);let c=s,l=c===null?null:Hn[c],u=r!==void 0&&r>1,d=n.severity===`error`?`text-destructive`:`text-amber-500`,f;t[2]===d?f=t[3]:(f=w(`mt-0.5 size-3.5 shrink-0`,d),t[2]=d,t[3]=f);let p;t[4]!==a||t[5]!==f?(p=(0,$.jsx)(a,{"aria-hidden":`true`,className:f}),t[4]=a,t[5]=f,t[6]=p):p=t[6];let m;t[7]===n?m=t[8]:(m=$t(n),t[7]=n,t[8]=m);let h;t[9]===m?h=t[10]:(h=(0,$.jsx)(`span`,{className:`min-w-0 flex-1 text-foreground`,children:m}),t[9]=m,t[10]=h);let g;t[11]!==u||t[12]!==r?(g=u?(0,$.jsxs)(`span`,{className:`mt-0.5 flex shrink-0 items-center gap-1`,children:[(0,$.jsx)(je,{variant:`gray`,"data-testid":`problems-instance-count`,className:`h-4 px-1 font-sans text-[10px] leading-none`,children:(0,$.jsx)(y,{id:`iZCZmF`,values:{instanceCount:r}})}),(0,$.jsx)(le,{"aria-hidden":`true`,className:`size-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none`})]}):null,t[11]=u,t[12]=r,t[13]=g):g=t[13];let _;t[14]!==p||t[15]!==h||t[16]!==g?(_=(0,$.jsxs)(`span`,{className:`flex items-start gap-1.5 text-sm`,children:[p,h,g]}),t[14]=p,t[15]=h,t[16]=g,t[17]=_):_=t[17];let v=c??void 0,x=l!==null&&`gap-0.5`,S;t[18]===x?S=t[19]:(S=w(`h-4 shrink-0 px-1 font-sans text-[10px] uppercase leading-none`,x),t[18]=x,t[19]=S);let C;t[20]===l?C=t[21]:(C=l===null?null:(0,$.jsx)(l,{"aria-hidden":`true`,className:`size-2.5`}),t[20]=l,t[21]=C);let T;t[22]!==n.source||t[23]!==S||t[24]!==C||t[25]!==v?(T=(0,$.jsxs)(je,{variant:`gray`,"data-testid":`problems-source-tag`,"data-target-kind":v,className:S,children:[C,n.source]}),t[22]=n.source,t[23]=S,t[24]=C,t[25]=v,t[26]=T):T=t[26];let E;t[27]!==i||t[28]!==n.code||t[29]!==o||t[30]!==u?(E=u?n.code:`${n.code} · ${i({id:`enPTnx`,values:{displayLine:o}})}`,t[27]=i,t[28]=n.code,t[29]=o,t[30]=u,t[31]=E):E=t[31];let D;t[32]===E?D=t[33]:(D=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:E}),t[32]=E,t[33]=D);let O;t[34]!==T||t[35]!==D?(O=(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5 ps-5 font-mono text-xs text-muted-foreground`,children:[T,D]}),t[34]=T,t[35]=D,t[36]=O):O=t[36];let k;return t[37]!==O||t[38]!==_?(k=(0,$.jsxs)($.Fragment,{children:[_,O]}),t[37]=O,t[38]=_,t[39]=k):k=t[39],k}function Gn(e){let t=new Map;for(let n of e){let e=`${n.source}/${n.code}\u0000${n.linkTarget??``}\u0000${n.message}`,r=t.get(e);r===void 0?t.set(e,{key:e,instances:[n]}):r.instances.push(n)}return[...t.values()]}function Kn(e){let t=(0,Q.c)(63),{group:n,onNavigate:r,navTitle:i,renderActions:a}=e,{_:o}=b(),s=n.instances[0],c,l,u,d,f,p,m,h;if(t[0]!==o||t[1]!==s||t[2]!==n.instances.length||t[3]!==i||t[4]!==r||t[5]!==a){h=Symbol.for(`react.early_return_sentinel`);bb0:{let e=$t(s);if(n.instances.length===1){let e;t[14]!==s||t[15]!==a?(e=a(s),t[14]=s,t[15]=a,t[16]=e):e=t[16];let n=e,o;t[17]!==s||t[18]!==r?(o=()=>r(s),t[17]=s,t[18]=r,t[19]=o):o=t[19];let c;t[20]!==s||t[21]!==i?(c=i(s),t[20]=s,t[21]=i,t[22]=c):c=t[22];let l;t[23]===s?l=t[24]:(l=(0,$.jsx)(Wn,{diagnostic:s}),t[23]=s,t[24]=l);let u;t[25]!==l||t[26]!==o||t[27]!==c?(u=(0,$.jsx)(`button`,{type:`button`,onClick:o,className:`flex w-full cursor-pointer flex-col gap-0.5 rounded px-2 py-1.5 text-left`,title:c,children:l}),t[25]=l,t[26]=o,t[27]=c,t[28]=u):u=t[28];let d;t[29]===n?d=t[30]:(d=n===null?null:(0,$.jsx)(`div`,{className:`absolute bottom-1 right-1 flex items-center gap-1 rounded bg-muted opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100 motion-reduce:transition-none`,children:n}),t[29]=n,t[30]=d);let f;t[31]!==u||t[32]!==d?(f=(0,$.jsxs)(`li`,{className:`group relative rounded transition-colors hover:bg-muted`,children:[u,d]}),t[31]=u,t[32]=d,t[33]=f):f=t[33],h=f;break bb0}p=`rounded`,m=`problems-duplicate-group`,l=A,t[34]!==s||t[35]!==n.instances.length?(f=(0,$.jsx)(ee,{className:`group flex w-full cursor-pointer flex-col gap-0.5 rounded px-2 py-1.5 text-left transition-colors hover:bg-muted`,children:(0,$.jsx)(Wn,{diagnostic:s,instanceCount:n.instances.length})}),t[34]=s,t[35]=n.instances.length,t[36]=f):f=t[36],c=k,d=`overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in] motion-reduce:animate-none`,u=o({id:`_Bix3-`,values:{localizedFirstMessage:e}})}t[0]=o,t[1]=s,t[2]=n.instances.length,t[3]=i,t[4]=r,t[5]=a,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m,t[13]=h}else c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13];if(h!==Symbol.for(`react.early_return_sentinel`))return h;let g;if(t[37]!==o||t[38]!==n.instances||t[39]!==i||t[40]!==r||t[41]!==a){let e;t[43]!==o||t[44]!==i||t[45]!==r||t[46]!==a?(e=e=>{let t=a(e),n=e.range.start.line+1,s=$t(e);return(0,$.jsxs)(`li`,{className:`group relative rounded transition-colors hover:bg-muted`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:()=>r(e),className:`flex w-full cursor-pointer rounded px-2 py-1 text-left font-mono text-xs text-muted-foreground`,title:i(e),"aria-label":o({id:`txUHO8`,values:{localizedMessage:s,displayLine:n}}),children:o({id:`enPTnx`,values:{displayLine:n}})}),t===null?null:(0,$.jsx)(`div`,{className:`absolute bottom-0.5 right-1 flex items-center gap-1 rounded bg-muted opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100 motion-reduce:transition-none`,children:t})]},qn(e))},t[43]=o,t[44]=i,t[45]=r,t[46]=a,t[47]=e):e=t[47],g=n.instances.map(e),t[37]=o,t[38]=n.instances,t[39]=i,t[40]=r,t[41]=a,t[42]=g}else g=t[42];let _;t[48]!==u||t[49]!==g?(_=(0,$.jsx)(`ul`,{"aria-label":u,className:`flex flex-col gap-0.5 pb-1 ps-5`,"data-testid":`problems-duplicate-instances`,children:g}),t[48]=u,t[49]=g,t[50]=_):_=t[50];let v;t[51]!==c||t[52]!==d||t[53]!==_?(v=(0,$.jsx)(c,{className:d,children:_}),t[51]=c,t[52]=d,t[53]=_,t[54]=v):v=t[54];let y;t[55]!==l||t[56]!==f||t[57]!==v?(y=(0,$.jsxs)(l,{children:[f,v]}),t[55]=l,t[56]=f,t[57]=v,t[58]=y):y=t[58];let x;return t[59]!==y||t[60]!==p||t[61]!==m?(x=(0,$.jsx)(`li`,{className:p,"data-testid":m,children:y}),t[59]=y,t[60]=p,t[61]=m,t[62]=x):x=t[62],x}function qn(e){return`${e.source}/${e.code}-${e.range.start.line}-${e.range.start.character}-${e.message}`}function Jn(e){return e.reduce((e,t)=>e+ +((t.fixes?.length??0)>0),0)}function Yn(e){let t=(0,Q.c)(11),{target:n,creating:r,disabled:i,onCreate:a}=e,{_:o}=b(),s;t[0]!==o||t[1]!==n?(s=o({id:`oWsZk8`,values:{target:n}}),t[0]=o,t[1]=n,t[2]=s):s=t[2];let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(M,{"aria-hidden":`true`,className:`size-3`}),t[3]=c):c=t[3];let l;t[4]===r?l=t[5]:(l=r?(0,$.jsx)(y,{id:`E9bKSA`}):(0,$.jsx)(y,{id:`XRuL0i`}),t[4]=r,t[5]=l);let u;return t[6]!==i||t[7]!==a||t[8]!==s||t[9]!==l?(u=(0,$.jsxs)(T,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,disabled:i,onClick:a,"aria-label":s,"data-testid":`problems-create-page`,children:[c,l]}),t[6]=i,t[7]=a,t[8]=s,t[9]=l,t[10]=u):u=t[10],u}function Xn(e){let t=(0,Q.c)(8),{tip:n,testId:r,children:i}=e,a;t[0]===i?a=t[1]:(a=(0,$.jsx)(E,{asChild:!0,children:(0,$.jsx)(`span`,{className:`inline-flex shrink-0`,children:i})}),t[0]=i,t[1]=a);let o;t[2]!==r||t[3]!==n?(o=(0,$.jsx)(D,{"data-testid":r,children:n}),t[2]=r,t[3]=n,t[4]=o):o=t[4];let s;return t[5]!==a||t[6]!==o?(s=(0,$.jsxs)(O,{children:[a,o]}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function Zn(e){let t=(0,Q.c)(21),{count:n,problemCount:r,aiAvailable:i,disabled:a,onClick:o,children:s}=e,{_:c}=b(),l;t[0]!==i||t[1]!==n||t[2]!==r?(l=n>0?(0,$.jsx)(y,{id:`vjwsDi`,values:{count:n}}):r===0?(0,$.jsx)(y,{id:`gAhHu7`}):i?(0,$.jsx)(y,{id:`zA9zRL`}):(0,$.jsx)(y,{id:`X3MMeA`}),t[0]=i,t[1]=n,t[2]=r,t[3]=l):l=t[3];let u;t[4]!==c||t[5]!==s||t[6]!==n||t[7]!==r?(u=s===void 0?r===0?c({id:`4m-xuX`}):n===0?c({id:`SqIoy_`}):void 0:void 0,t[4]=c,t[5]=s,t[6]=n,t[7]=r,t[8]=u):u=t[8];let d;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(_e,{"aria-hidden":`true`,className:`size-3`}),t[9]=d):d=t[9];let f;t[10]!==s||t[11]!==n?(f=s??(0,$.jsx)(y,{id:`RZXTlY`,values:{count:n}}),t[10]=s,t[11]=n,t[12]=f):f=t[12];let p;t[13]!==a||t[14]!==o||t[15]!==u||t[16]!==f?(p=(0,$.jsxs)(T,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,disabled:a,onClick:o,"aria-label":u,"data-testid":`problems-auto-fix`,children:[d,f]}),t[13]=a,t[14]=o,t[15]=u,t[16]=f,t[17]=p):p=t[17];let m;return t[18]!==l||t[19]!==p?(m=(0,$.jsx)(Xn,{testId:`problems-auto-fix-tip`,tip:l,children:p}),t[18]=l,t[19]=p,t[20]=m):m=t[20],m}function Qn(e){let t=(0,Q.c)(12),{count:n,disabled:r,onClick:i}=e,a;t[0]===n?a=t[1]:(a=(0,$.jsx)(y,{id:`mgDKWS`,values:{count:n}}),t[0]=n,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(u,{"aria-hidden":`true`,className:`size-3`}),t[2]=o):o=t[2];let s;t[3]===n?s=t[4]:(s=(0,$.jsx)(y,{id:`gyHDWC`,values:{count:n}}),t[3]=n,t[4]=s);let c;t[5]!==r||t[6]!==i||t[7]!==s?(c=(0,$.jsxs)(T,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,disabled:r,onClick:i,"data-testid":`problems-fix-with-ai`,children:[o,s]}),t[5]=r,t[6]=i,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,$.jsx)(Xn,{testId:`problems-fix-with-ai-tip`,tip:a,children:c}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}function $n(e){let t=(0,Q.c)(61),{docName:n,diagnostics:r,linkFindingsStatus:i,onFix:a,onAutoFix:o,onAskAi:s,onFixWithAi:c}=e,l=i===void 0?`loaded`:i,{_:d}=b(),f=(0,Z.useRef)(null),p=(0,Z.useId)(),[m,v]=(0,Z.useState)(`doc`),x;t[0]===n?x=t[1]:(x=z(n),t[0]=n,t[1]=x);let S=!x,{data:C}=He(),w=C===null?null:C.effective.enabled?de.filter(e=>C.effective.plugins[e.id].enabled):[],k=w!==null&&w.length===0,ee=(m===`project`||S)&&w!==null&&w.length>0,A;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(A={status:`idle`},t[2]=A):A=t[2];let[j,M]=(0,Z.useState)(A),N=xn(),P=me(),[F,I]=(0,Z.useState)(null),L=(0,Z.useRef)(!0),R,B;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>(L.current=!0,()=>{L.current=!1}),B=[],t[3]=R,t[4]=B):(R=t[3],B=t[4]),(0,Z.useEffect)(R,B);let V=(0,Z.useRef)(sr),H=(0,Z.useRef)(or),te;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(te={status:`idle`},t[5]=te):te=t[5];let ne=(0,Z.useRef)(te),U;t[6]===j?U=t[7]:(U=()=>{j.status!==`loading`&&(ne.current=j)},t[6]=j,t[7]=U),(0,Z.useEffect)(U);let W=(0,Z.useRef)(0),G=[...r].sort(zn),re=Jn(G),K;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(K=async function(){W.current+=1;let e=W.current,t=ne.current;M({status:`loading`});let n=await tn();if(n===`audit-superseded`){W.current===e&&L.current&&M(t.status===`idle`?{status:`failed`}:t);return}n!==null&&Pn(n.files),L.current&&M(n===null?{status:`failed`}:{status:`loaded`,result:n})},t[8]=K):K=t[8];let q=K,Y;t[9]!==d||t[10]!==j.status||t[11]!==F||t[12]!==P?(Y=async function(e){let t=e.linkTarget;if(!(t===void 0||F!==null||P===null)){I(t);try{await _({initialDir:``,suggestedName:t},{addPage:P.addPage})}catch(e){let t=e;J.error(t instanceof Error?t.message:d({id:`tfi40B`})),L.current&&I(null);return}J.success(d({id:`EWCJFu`,values:{target:t}})),L.current&&I(null),L.current&&j.status===`loaded`&&await q()}},t[9]=d,t[10]=j.status,t[11]=F,t[12]=P,t[13]=Y):Y=t[13];let se=Y,ce=j.status===`loaded`?j.result.files.filter(ir):[],le=function(){Tn({items:ce,fixItem:rr})},ue;t[14]===j.status?ue=t[15]:(ue=function(e){v(e),e===`project`&&j.status===`idle`&&q()},t[14]=j.status,t[15]=ue);let fe=ue,pe;t[16]===j.status?pe=t[17]:(pe=()=>{V.current=()=>{j.status===`idle`||j.status===`failed`||q()}},t[16]=j.status,t[17]=pe),(0,Z.useEffect)(pe);let he,ge;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(he=()=>Ve(()=>V.current()),ge=[],t[18]=he,t[19]=ge):(he=t[18],ge=t[19]),(0,Z.useEffect)(he,ge);let be,xe;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(be=()=>oe(e=>{ae(e)&&V.current()}),xe=[],t[20]=be,t[21]=xe):(be=t[20],xe=t[21]),(0,Z.useEffect)(be,xe);let Se;t[22]===fe?Se=t[23]:(Se=(e,t)=>{e===`problems`&&(h(`problems`),t.scope!==void 0&&fe(t.scope),t.focus===`panel`&&f.current?.focus({preventScroll:!0}))},t[22]=fe,t[23]=Se);let Ce=(0,Z.useEffectEvent)(Se),we;t[24]===Ce?we=t[25]:(we=()=>{let e=h(`problems`);return e!==null&&Ce(`problems`,e),g(Ce)},t[24]=Ce,t[25]=we);let Te;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(Te=[],t[26]=Te):Te=t[26],(0,Z.useEffect)(we,Te);let Ee;t[27]===j.status?Ee=t[28]:(Ee=()=>{H.current=()=>{j.status===`idle`||j.status===`failed`||q().catch(e=>{console.warn(`[lint] post-sweep re-audit failed`,e),L.current&&M({status:`failed`})})}},t[27]=j.status,t[28]=Ee),(0,Z.useEffect)(Ee);let De,Oe;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(De=()=>Sn(()=>H.current()),Oe=[],t[29]=De,t[30]=Oe):(De=t[29],Oe=t[30]),(0,Z.useEffect)(De,Oe);let ke;t[31]===n?ke=t[32]:(ke=function(e){let t=Bn(n,e);St(n,{kind:`lint`,detail:t}),window.dispatchEvent(new CustomEvent(Rn,{detail:t}))},t[31]=n,t[32]=ke);let Ae=ke,je;t[33]!==n||t[34]!==Ae?(je=function(e,t){let r=ye(e);if(r===n){Ae(t);return}St(r,{kind:`lint`,detail:Bn(r,t)}),window.location.hash=ve(r)},t[33]=n,t[34]=Ae,t[35]=je):je=t[35];let ze=je,Be;t[36]!==d||t[37]!==se||t[38]!==F||t[39]!==s||t[40]!==a||t[41]!==P?(Be=function(e){let t=a!==void 0&&(e.fixes?.length??0)>0,n=Un(e)&&P!==null;if(!t&&!n&&s===void 0)return null;let r=`${e.source}/${e.code}`;return(0,$.jsxs)($.Fragment,{children:[n?(0,$.jsx)(Yn,{target:e.linkTarget??``,creating:F===e.linkTarget,disabled:F!==null,onCreate:()=>void se(e)}):null,t?(0,$.jsxs)(T,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>a?.(e),"aria-label":d({id:`fZj9em`,values:{flatId:r}}),"data-testid":`problems-fix`,children:[(0,$.jsx)(_e,{"aria-hidden":`true`,className:`size-3`}),(0,$.jsx)(y,{id:`c4fVUV`})]}):null,s===void 0?null:(0,$.jsxs)(T,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>s(e),"aria-label":d({id:`hh4mVC`,values:{flatId:r}}),"data-testid":`problems-ask-ai`,children:[(0,$.jsx)(u,{"aria-hidden":`true`,className:`size-3`}),(0,$.jsx)(y,{id:`xWEvuo`})]})]})},t[36]=d,t[37]=se,t[38]=F,t[39]=s,t[40]=a,t[41]=P,t[42]=Be):Be=t[42];let Ue=Be,We=Re,Ge;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,$.jsx)(y,{id:`OXdGnd`}),t[43]=Ge):Ge=t[43];let Ke;t[44]===p?Ke=t[45]:(Ke=(0,$.jsx)(Ne,{id:p,children:Ge}),t[44]=p,t[45]=Ke);let qe=ee&&(0,$.jsxs)(O,{children:[(0,$.jsx)(E,{className:`shrink-0 cursor-default rounded-md bg-muted-foreground/5 px-2 py-1 font-mono text-xs text-muted-foreground`,"data-testid":`problems-active-plugins`,children:(0,$.jsx)(y,{id:`yxF19Y`,values:{0:w.length}})}),(0,$.jsx)(D,{"data-testid":`problems-active-plugins-tooltip`,children:(0,$.jsx)(y,{id:`ws5o1F`,values:{0:w.map(nr).join(`, `)}})})]}),Je;t[46]!==Ke||t[47]!==qe?(Je=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[Ke,qe]}),t[46]=Ke,t[47]=qe,t[48]=Je):Je=t[48];let Ye=m===`doc`&&G.length>0&&(0,$.jsx)(Ie,{children:G.length}),Xe;t[49]!==Je||t[50]!==Ye?(Xe=(0,$.jsxs)(Le,{children:[Je,Ye]}),t[49]=Je,t[50]=Ye,t[51]=Xe):Xe=t[51];let X;t[52]!==fe||t[53]!==m?(X=(0,$.jsx)(Qt,{scope:m,onScopeChange:fe}),t[52]=fe,t[53]=m,t[54]=X):X=t[54];let Ze=m===`doc`?(0,$.jsxs)(Fe,{className:`px-2 py-2`,children:[l===`idle`||l===`loading`?(0,$.jsx)(Pe,{className:`px-2 pb-2`,role:`status`,"aria-live":`polite`,"data-testid":`problems-links-loading`,children:(0,$.jsx)(y,{id:`W9NSe0`})}):l===`failed`?(0,$.jsx)(Me,{className:`px-2 pb-2`,role:`status`,"data-testid":`problems-links-failed`,children:G.length>0?(0,$.jsx)(y,{id:`IoHQYP`}):(0,$.jsx)(y,{id:`gpbKxw`})}):null,G.length===0?l===`loaded`?S?k?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Pe,{className:`px-2`,"data-testid":`problems-no-plugins`,children:(0,$.jsx)(y,{id:`Hngy37`})}),(0,$.jsx)(`div`,{className:`px-2 pt-2`,children:(0,$.jsx)(T,{variant:`outline`,size:`sm`,onClick:ie,"data-testid":`problems-enable-plugins`,children:(0,$.jsx)(y,{id:`rnX-1S`})})})]}):(0,$.jsx)(Pe,{className:`px-2`,children:(0,$.jsx)(y,{id:`ZI8uvA`})}):(0,$.jsx)(Pe,{className:`px-2`,"data-testid":`problems-markdown-not-applicable`,children:(0,$.jsx)(y,{id:`Kdvukk`})}):null:(0,$.jsxs)($.Fragment,{children:[o!==void 0||c!==void 0?(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1 px-2 pb-1`,children:[o!==void 0&&(0,$.jsx)(Zn,{count:re,problemCount:G.length,aiAvailable:c!==void 0,disabled:re===0,onClick:o}),c!==void 0&&(0,$.jsx)(Qn,{count:G.length,disabled:!1,onClick:()=>c(`doc`)})]}):null,(0,$.jsx)(`ul`,{"aria-label":d({id:`OXdGnd`}),className:`flex flex-col gap-0.5`,children:Gn(G).map(e=>(0,$.jsx)(Kn,{group:e,onNavigate:Ae,navTitle:e=>d({id:`vbMHjo`,values:{0:e.range.start.line+1}}),renderActions:Ue},e.key))})]})]}):(0,$.jsx)(cr,{audit:j,onRefresh:()=>void q(),onNavigate:ze,fixableCount:ce.reduce(tr,0),problemCount:j.status===`loaded`?j.result.files.reduce(er,0):0,fixing:N,onAutoFix:le,onCancelFix:Cn,onFixWithAi:c===void 0||j.status!==`loaded`?void 0:()=>c(`project`),onCreateTarget:P===null?void 0:e=>void se(e),creatingTarget:F}),Qe;return t[55]!==We||t[56]!==p||t[57]!==Xe||t[58]!==X||t[59]!==Ze?(Qe=(0,$.jsxs)(We,{ref:f,tabIndex:-1,"aria-labelledby":p,"data-testid":`problems-panel`,children:[Xe,X,Ze]}),t[55]=We,t[56]=p,t[57]=Xe,t[58]=X,t[59]=Ze,t[60]=Qe):Qe=t[60],Qe}function er(e,t){return e+t.diagnostics.length}function tr(e,t){return e+Jn(t.diagnostics)}function nr(e){return e.label}function rr(e){return Be(ye(e.file))}function ir(e){return e.diagnostics.some(ar)}function ar(e){return(e.fixes?.length??0)>0}function or(){}function sr(){}function cr(e){let t=(0,Q.c)(81),{audit:n,onRefresh:r,onNavigate:i,fixableCount:a,problemCount:o,fixing:s,onAutoFix:c,onCancelFix:l,onFixWithAi:u,onCreateTarget:d,creatingTarget:f}=e,{_:p}=b(),m=n.status===`loading`||n.status===`idle`,h;t[0]!==n.result||t[1]!==n.status?(h=n.status===`loaded`?n.result.files:[],t[0]=n.result,t[1]=n.status,t[2]=h):h=t[2];let g=h,[_,v]=(0,Z.useState)(dr),x;t[3]!==_||t[4]!==g?(x=g.length>0&&g.every(e=>_.has(e.file)),t[3]=_,t[4]=g,t[5]=x):x=t[5];let S=x,C;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(C=function(e,t){v(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})},t[6]=C):C=t[6];let w=C,k;t[7]!==S||t[8]!==g?(k=function(){v(S?new Set:new Set(g.map(ur)))},t[7]=S,t[8]=g,t[9]=k):k=t[9];let ee=k,A;t[10]!==n.result||t[11]!==n.status?(A=n.status===`loaded`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(y,{id:`DsDwR-`,values:{0:n.result.errorCount}}),` · `,(0,$.jsx)(y,{id:`W1SI2K`,values:{0:n.result.warningCount}})]}),t[10]=n.result,t[11]=n.status,t[12]=A):A=t[12];let j;t[13]===A?j=t[14]:(j=(0,$.jsx)(`p`,{className:`min-w-0 truncate text-xs text-muted-foreground`,"data-testid":`problems-audit-summary`,children:A}),t[13]=A,t[14]=j);let M;t[15]!==p||t[16]!==S||t[17]!==g.length||t[18]!==ee?(M=g.length>0?(0,$.jsxs)(O,{children:[(0,$.jsx)(E,{asChild:!0,children:(0,$.jsx)(T,{variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground`,"aria-label":p(S?{id:`I4LGsH`}:{id:`Ugvy4O`}),"data-testid":`problems-audit-expand-toggle`,onClick:ee,children:S?(0,$.jsx)(Ue,{"aria-hidden":`true`,className:`size-3.5`}):(0,$.jsx)(ue,{"aria-hidden":`true`,className:`size-3.5`})})}),(0,$.jsx)(D,{"data-testid":`problems-audit-expand-toggle-tooltip`,children:S?(0,$.jsx)(y,{id:`I4LGsH`}):(0,$.jsx)(y,{id:`Ugvy4O`})})]}):null,t[15]=p,t[16]=S,t[17]=g.length,t[18]=ee,t[19]=M):M=t[19];let N;t[20]===p?N=t[21]:(N=p({id:`I7y_vn`}),t[20]=p,t[21]=N);let P=m||s!==null,F;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(he,{"aria-hidden":`true`,className:`size-3.5`}),t[22]=F):F=t[22];let I;t[23]!==r||t[24]!==N||t[25]!==P?(I=(0,$.jsx)(E,{asChild:!0,children:(0,$.jsx)(T,{variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground`,"aria-label":N,"data-testid":`problems-audit-refresh`,disabled:P,onClick:r,children:F})}),t[23]=r,t[24]=N,t[25]=P,t[26]=I):I=t[26];let L;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,$.jsx)(D,{"data-testid":`problems-audit-refresh-tooltip`,children:(0,$.jsx)(y,{id:`I7y_vn`})}),t[27]=L):L=t[27];let R;t[28]===I?R=t[29]:(R=(0,$.jsxs)(O,{children:[I,L]}),t[28]=I,t[29]=R);let z;t[30]!==R||t[31]!==M?(z=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[M,R]}),t[30]=R,t[31]=M,t[32]=z):z=t[32];let B;t[33]!==z||t[34]!==j?(B=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[j,z]}),t[33]=z,t[34]=j,t[35]=B):B=t[35];let V;t[36]!==p||t[37]!==s?(V=s===null?null:(0,$.jsx)(`span`,{className:`sr-only`,role:`status`,children:p({id:`gZElfU`,values:{0:s.done,1:s.total}})}),t[36]=p,t[37]=s,t[38]=V):V=t[38];let H;t[39]!==p||t[40]!==s||t[41]!==l?(H=s===null?null:(0,$.jsxs)(O,{children:[(0,$.jsx)(E,{asChild:!0,children:(0,$.jsx)(T,{variant:`ghost`,size:`sm`,className:`h-6 shrink-0 px-2 text-muted-foreground`,"aria-label":p({id:`q2cLM6`}),"data-testid":`problems-cancel-fix`,onClick:l,children:(0,$.jsx)(y,{id:`ygCKqB`})})}),(0,$.jsx)(D,{"data-testid":`problems-cancel-fix-tooltip`,children:(0,$.jsx)(y,{id:`yvSAuM`})})]}),t[39]=p,t[40]=s,t[41]=l,t[42]=H):H=t[42];let te=u!==void 0,ne=m||s!==null||a===0,U;t[43]===s?U=t[44]:(U=s===null?void 0:(0,$.jsx)(y,{id:`S9t1PI`,values:{0:s.done,1:s.total}}),t[43]=s,t[44]=U);let W;t[45]!==a||t[46]!==c||t[47]!==o||t[48]!==te||t[49]!==ne||t[50]!==U?(W=(0,$.jsx)(Zn,{count:a,problemCount:o,aiAvailable:te,disabled:ne,onClick:c,children:U}),t[45]=a,t[46]=c,t[47]=o,t[48]=te,t[49]=ne,t[50]=U,t[51]=W):W=t[51];let G;t[52]!==s||t[53]!==u||t[54]!==o?(G=u!==void 0&&o>0?(0,$.jsx)(Qn,{count:o,disabled:s!==null,onClick:u}):null,t[52]=s,t[53]=u,t[54]=o,t[55]=G):G=t[55];let re;t[56]!==V||t[57]!==H||t[58]!==W||t[59]!==G?(re=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1`,children:[V,H,W,G]}),t[56]=V,t[57]=H,t[58]=W,t[59]=G,t[60]=re):re=t[60];let K;t[61]!==B||t[62]!==re?(K=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1 px-2 pb-1`,children:[B,re]}),t[61]=B,t[62]=re,t[63]=K):K=t[63];let q;t[64]!==p||t[65]!==m?(q=m&&(0,$.jsx)(`div`,{className:`flex flex-col gap-1`,role:`status`,"aria-busy":`true`,"aria-label":p({id:`dx-TwN`}),children:[1,2,3].map(lr)}),t[64]=p,t[65]=m,t[66]=q):q=t[66];let J;t[67]===n.status?J=t[68]:(J=n.status===`failed`&&(0,$.jsx)(Me,{className:`px-2 text-xs`,children:(0,$.jsx)(y,{id:`IFezUv`})}),t[67]=n.status,t[68]=J);let ie;t[69]!==n.result||t[70]!==n.status||t[71]!==f||t[72]!==_||t[73]!==d||t[74]!==i?(ie=n.status===`loaded`&&(0,$.jsx)(fr,{result:n.result,onNavigate:i,onCreateTarget:d,creatingTarget:f,expandedFiles:_,onToggleFile:w}),t[69]=n.result,t[70]=n.status,t[71]=f,t[72]=_,t[73]=d,t[74]=i,t[75]=ie):ie=t[75];let Y;return t[76]!==K||t[77]!==q||t[78]!==J||t[79]!==ie?(Y=(0,$.jsxs)(Fe,{className:`px-2 py-2`,"data-testid":`problems-project-scope`,children:[K,q,J,ie]}),t[76]=K,t[77]=q,t[78]=J,t[79]=ie,t[80]=Y):Y=t[80],Y}function lr(e){return(0,$.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded px-2 py-1.5`,children:[(0,$.jsx)(ze,{className:`mt-0.5 size-3.5 shrink-0 rounded`}),(0,$.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,$.jsx)(ze,{className:`h-3 w-28`}),(0,$.jsx)(ze,{className:`h-3 w-40`})]})]},e)}function ur(e){return e.file}function dr(){return new Set}function fr(e){let t=(0,Q.c)(14),{result:n,onNavigate:r,onCreateTarget:i,creatingTarget:a,expandedFiles:o,onToggleFile:s}=e,{_:c}=b(),l;t[0]!==c||t[1]!==n.warnings?(l=n.warnings.length>0&&(0,$.jsx)(`ul`,{"aria-label":c({id:`Rsdhj9`}),className:`flex flex-col gap-0.5 pb-1`,children:n.warnings.map(pr)}),t[0]=c,t[1]=n.warnings,t[2]=l):l=t[2];let u;t[3]!==a||t[4]!==o||t[5]!==i||t[6]!==r||t[7]!==s||t[8]!==n.fileCount||t[9]!==n.files?(u=n.files.length===0?(0,$.jsx)(Pe,{className:`px-2`,children:(0,$.jsx)(y,{id:`k_Dqw1`,values:{0:n.fileCount}})}):n.files.map(e=>(0,$.jsx)(mr,{file:e,onNavigate:r,onCreateTarget:i,creatingTarget:a,open:o.has(e.file),onOpenChange:t=>s(e.file,t)},e.file)),t[3]=a,t[4]=o,t[5]=i,t[6]=r,t[7]=s,t[8]=n.fileCount,t[9]=n.files,t[10]=u):u=t[10];let d;return t[11]!==l||t[12]!==u?(d=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[l,u]}),t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function pr(e,t){return(0,$.jsxs)(`li`,{className:`flex items-start gap-1.5 px-2 text-xs`,children:[(0,$.jsx)(ge,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-amber-500`}),(0,$.jsx)(`span`,{className:`min-w-0 text-foreground`,children:e})]},`${t}-${e}`)}function mr(e){let t=(0,Q.c)(45),{file:n,onNavigate:r,onCreateTarget:i,creatingTarget:a,open:o,onOpenChange:s}=e,{_:c}=b(),l,u,d,f,p,m,h,g,_,v;if(t[0]!==c||t[1]!==a||t[2]!==n.diagnostics||t[3]!==n.file||t[4]!==i||t[5]!==r||t[6]!==s||t[7]!==o){let e=[...n.diagnostics].sort(zn);u=A,h=o,g=s,_=`problems-audit-group`;let y;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(le,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none`}),t[18]=y):y=t[18];let b;t[19]===n.file?b=t[20]:(b=(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-foreground`,title:n.file,children:n.file}),t[19]=n.file,t[20]=b),v=(0,$.jsxs)(ee,{className:`group flex w-full cursor-pointer items-center gap-1.5 rounded px-2 py-1.5 text-left transition-colors hover:bg-muted`,children:[y,b,(0,$.jsx)(je,{variant:`gray`,"data-testid":`problems-audit-file-count`,className:`shrink-0`,children:e.length})]}),l=k,m=`overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in] motion-reduce:animate-none`,t[21]!==c||t[22]!==n.file?(d=c({id:`zAJzIg`,values:{0:n.file}}),t[21]=c,t[22]=n.file,t[23]=d):d=t[23],f=`flex flex-col gap-0.5 pb-1 ps-3`;let x;t[24]!==c||t[25]!==a||t[26]!==n.file||t[27]!==i||t[28]!==r?(x=e=>(0,$.jsx)(Kn,{group:e,onNavigate:e=>r(n.file,e),navTitle:e=>c({id:`xKDsGS`,values:{0:e.range.start.line+1,1:n.file}}),renderActions:e=>!Un(e)||i===void 0?null:(0,$.jsx)(Yn,{target:e.linkTarget??``,creating:a===e.linkTarget,disabled:a!==null,onCreate:()=>i(e)})},e.key),t[24]=c,t[25]=a,t[26]=n.file,t[27]=i,t[28]=r,t[29]=x):x=t[29],p=Gn(e).map(x),t[0]=c,t[1]=a,t[2]=n.diagnostics,t[3]=n.file,t[4]=i,t[5]=r,t[6]=s,t[7]=o,t[8]=l,t[9]=u,t[10]=d,t[11]=f,t[12]=p,t[13]=m,t[14]=h,t[15]=g,t[16]=_,t[17]=v}else l=t[8],u=t[9],d=t[10],f=t[11],p=t[12],m=t[13],h=t[14],g=t[15],_=t[16],v=t[17];let y;t[30]!==d||t[31]!==f||t[32]!==p?(y=(0,$.jsx)(`ul`,{"aria-label":d,className:f,children:p}),t[30]=d,t[31]=f,t[32]=p,t[33]=y):y=t[33];let x;t[34]!==l||t[35]!==m||t[36]!==y?(x=(0,$.jsx)(l,{className:m,children:y}),t[34]=l,t[35]=m,t[36]=y,t[37]=x):x=t[37];let S;return t[38]!==u||t[39]!==x||t[40]!==h||t[41]!==g||t[42]!==_||t[43]!==v?(S=(0,$.jsxs)(u,{open:h,onOpenChange:g,"data-testid":_,children:[v,x]}),t[38]=u,t[39]=x,t[40]=h,t[41]=g,t[42]=_,t[43]=v,t[44]=S):S=t[44],S}var hr=null,gr=[];function _r(e){if(e===hr)return gr;let t=vr(e);return hr=e,gr=t,t}function vr(e){let t=[],n=new Map,r=re();for(let i=yr(e);i<=e.lines;i++){let a=e.line(i);if(r(a.text))continue;let o=H(a.text,n);o&&t.push({slug:o.slug,from:a.from})}return t}function yr(e){if(!br(e.line(1).text))return 1;for(let t=2;t<=e.lines;t++)if(br(e.line(t).text))return t+1;return 1}function br(e){return K.test(e.endsWith(`\r`)?e.slice(0,-1):e)}function xr(e){let t=document.getElementById(e);return t?t.getBoundingClientRect().top:null}function Sr(e){let t=new Map;for(let n of _r(e.state.doc))t.set(n.slug,n.from);let n=e.documentTop;return r=>{let i=t.get(r);return i===void 0?null:n+e.lineBlockAt(i).top}}function Cr(e,t){let n=(0,Q.c)(9),r;n[0]===t?r=n[1]:(r=t===void 0?{}:t,n[0]=t,n[1]=r);let{isSourceMode:i,docName:a}=r,o=i===void 0?!1:i,[c,l]=(0,Z.useState)(void 0),u=(0,Z.useRef)(null),f;n[2]===a?f=n[3]:(f=()=>a?d(a):null,n[2]=a,n[3]=f);let p=(0,Z.useSyncExternalStore)(s,f,wr),m,h;return n[4]!==o||n[5]!==e||n[6]!==p?(m=()=>{if(e.length===0||o&&!p){l(void 0);return}let t=function(){let t=o&&p?Sr(p):xr,n=window.innerHeight/2,r,i;for(let a of e){let e=t(a);e!==null&&(e<0?r=a:i===void 0&&e<n&&(i=a))}l(i??r??e[0])},n=function(){u.current===null&&(u.current=requestAnimationFrame(()=>{u.current=null,t()}))};return document.addEventListener(`scroll`,n,{capture:!0,passive:!0}),t(),()=>{document.removeEventListener(`scroll`,n,{capture:!0}),u.current!==null&&(cancelAnimationFrame(u.current),u.current=null)}},h=[e,o,p],n[4]=o,n[5]=e,n[6]=p,n[7]=m,n[8]=h):(m=n[7],h=n[8]),(0,Z.useEffect)(m,h),c}function wr(){return null}var Tr=300;async function Er(e){let t=await fetch(`/api/page-headings?docName=${encodeURIComponent(e)}`),n;try{n=await t.json()}catch(e){throw new P(Y._({id:`qAQVSD`}),{cause:e,status:t.status})}if(!t.ok){let e=q.safeParse(n);throw e.success?Error(e.data.title):new P(Y._({id:`zlErBl`}),{status:t.status})}let r=te.safeParse(n);if(!r.success)throw new P(Y._({id:`XW18jo`}),{status:t.status});return r.data.headings??[]}var Dr=32,Or=12,kr=6,Ar=`open-knowledge:outline-nav`,jr=`ok-outline-nav`,Mr=`ok-outline-nav-dispatch`,Nr=`ok-outline-nav-settled`;function Pr(e){let t=(0,Q.c)(2),n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(xe,{name:`outline-panel`,children:(0,$.jsx)(Fr,{...e})}),t[0]=e,t[1]=n),n}function Fr(e){let t=(0,Q.c)(55),{docName:n,isSourceMode:r,className:i}=e,a=i===void 0?``:i,{_:o}=b(),{pages:s,loading:c}=pe(),l=x(),{activeProvider:u,activeDocName:d}=f(),p,m;t[0]===n?(p=t[1],m=t[2]):(p=[`page-headings`,n],m=()=>Er(n),t[0]=n,t[1]=p,t[2]=m);let h;t[3]!==n||t[4]!==c||t[5]!==s?(h=!c&&(s.has(n)||V(n)),t[3]=n,t[4]=c,t[5]=s,t[6]=h):h=t[6];let g;t[7]!==p||t[8]!==m||t[9]!==h?(g={queryKey:p,queryFn:m,enabled:h,staleTime:1/0},t[7]=p,t[8]=m,t[9]=h,t[10]=g):g=t[10];let{data:_,isLoading:v,error:C}=S(g),T;t[11]===_?T=t[12]:(T=_===void 0?[]:_,t[11]=_,t[12]=T);let E=T,D,O;t[13]!==d||t[14]!==u||t[15]!==n||t[16]!==l?(D=()=>{if(!u||d!==n)return;let e=u.document,t=null,r=()=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{t=null,l.invalidateQueries({queryKey:[`page-headings`,n]})},Tr)};return e.on(`update`,r),()=>{e.off(`update`,r),t!==null&&clearTimeout(t)}},O=[u,d,n,l],t[13]=d,t[14]=u,t[15]=n,t[16]=l,t[17]=D,t[18]=O):(D=t[17],O=t[18]),(0,Z.useEffect)(D,O);let k;t[19]===E?k=t[20]:(k=E.map(Ir),t[19]=E,t[20]=k);let ee=k,A;t[21]!==n||t[22]!==r?(A={isSourceMode:r,docName:n},t[21]=n,t[22]=r,t[23]=A):A=t[23];let j=Cr(ee,A),M,N,P,F,I,L,R;if(t[24]!==o||t[25]!==j||t[26]!==a||t[27]!==n||t[28]!==C||t[29]!==E||t[30]!==v||t[31]!==r){let e=j?E.findIndex(e=>e.slug===j):-1,i=function(t,i){let a={docName:n,index:t,slug:i,mode:r?`source`:`wysiwyg`};a.mode===`source`&&St(n,{kind:`outline`,detail:a}),Se(Mr,{docName:n,index:t,mode:a.mode,outlineCount:E.length,headingLevel:E[t]?.level,activeIndex:e}),window.dispatchEvent(new CustomEvent(Ar,{detail:a}))},s=((e>=0?E[e].level:1)-1)*Or+(Or-kr)/2,c=e*Dr+(Dr-kr)/2;N=Re,L=a;let l;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(Ne,{children:(0,$.jsx)(y,{id:`dD7NPy`})}),t[39]=l):l=t[39];let u;t[40]!==E.length||t[41]!==v?(u=!v&&(0,$.jsx)(Ie,{children:E.length}),t[40]=E.length,t[41]=v,t[42]=u):u=t[42],t[43]===u?R=t[44]:(R=(0,$.jsxs)(Le,{children:[l,u]}),t[43]=u,t[44]=R),M=Fe,P=`px-3 py-2`,F=v,I=C?(0,$.jsx)(Me,{className:`px-2`,children:C instanceof Error?C.message:o({id:`GuqOb1`})}):E.length===0&&!v?(0,$.jsx)(Pe,{className:`px-2`,children:(0,$.jsx)(y,{id:`0BB9ID`})}):(0,$.jsxs)(`nav`,{"aria-label":o({id:`BymzO4`}),className:`relative`,children:[e>=0&&(0,$.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute left-0 top-0 rounded-full bg-primary motion-safe:[transition:transform_0.25s_var(--ease-out-strong)]`,style:{width:kr,height:kr,transform:`translate(${s}px, ${c}px)`}}),E.map((e,t)=>{let n=e.slug===j;return(0,$.jsx)(`button`,{type:`button`,"aria-current":n?`location`:void 0,onClick:()=>i(t,e.slug),className:w(`w-full cursor-pointer truncate py-1.5 pe-2 text-left text-sm transition-colors`,n?`font-medium text-primary`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${(e.level-1)*Or+20}px`},title:e.text,children:e.text},t)})]}),t[24]=o,t[25]=j,t[26]=a,t[27]=n,t[28]=C,t[29]=E,t[30]=v,t[31]=r,t[32]=M,t[33]=N,t[34]=P,t[35]=F,t[36]=I,t[37]=L,t[38]=R}else M=t[32],N=t[33],P=t[34],F=t[35],I=t[36],L=t[37],R=t[38];let z;t[45]!==M||t[46]!==P||t[47]!==F||t[48]!==I?(z=(0,$.jsx)(M,{className:P,"aria-busy":F,children:I}),t[45]=M,t[46]=P,t[47]=F,t[48]=I,t[49]=z):z=t[49];let B;return t[50]!==N||t[51]!==L||t[52]!==R||t[53]!==z?(B=(0,$.jsxs)(N,{className:L,children:[R,z]}),t[50]=N,t[51]=L,t[52]=R,t[53]=z,t[54]=B):B=t[54],B}function Ir(e){return e.slug}var Lr={words:0,chars:0,tokens:0},Rr=/[ -〿-ゟ゠-ヿ㐀-䶿一-鿿豈---ក-]/,zr=/[\p{L}\p{N}]/u,Br=new Set([`text`,`inlineCode`,`code`,`tag`]),Vr=new Set([`html`,`definition`,`footnoteDefinition`,`yaml`,`toml`,`image`,`imageReference`,`mdxFlowExpression`,`mdxTextExpression`,`mdxjsEsm`,`rawMdxFallback`,`rawMdxFallbackMdast`]),Hr=new Set([`paragraph`,`heading`,`blockquote`,`list`,`listItem`,`thematicBreak`,`table`,`tableRow`,`tableCell`,`mdxJsxFlowElement`,`commentBlock`]);function Ur(e,t){if(!e)return;let n=e.type;if(!Vr.has(n)){if(Br.has(n)){e.value&&(t.push(e.value),n===`code`&&t.push(`
|
|
4
4
|
`));return}if(n===`wikiLink`||n===`wikiLinkEmbed`){let n=e.data?.alias??e.value??``;n&&t.push(n);return}if(Array.isArray(e.children)){for(let n of e.children)Ur(n,t);if(Hr.has(n)&&t.length>0){let e=t[t.length-1];e&&!e.endsWith(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./globals-CTSydwqe.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a,t as o}from"./dist-Nvb76hAm.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{t as c}from"./utils-CPqDy6Hr.js";import{t as l}from"./button-Cym3gapE.js";import{t as u}from"./checkbox-UfDS9TpS.js";import{t as d}from"./label-D-K3fWtj.js";import{n as f,t as p}from"./radio-group-npdxiS6E.js";import{an as m,on as h}from"./dist-C_QZEaeX.js";import{t as g}from"./dist-Cr4-nBVI.js";import{t as _}from"./check-Dut4Aov8.js";import{t as v}from"./spinner-t7GahFcQ.js";import{t as y}from"./input-Cy2M_Avq.js";import"./i18n-CHdOLU04.js";import{t as b}from"./badge-52pHek8I.js";import{t as x}from"./textarea-BtqZ3yY1.js";var S=e(r(),1),C=t(),w=s();async function T(){let e=typeof window>`u`?void 0:window.okUninstall;if(e===void 0)return null;try{let t=await e.ready();return t.kind===`screen`?t.screen:null}catch{return null}}function E(e){let t=typeof window>`u`?void 0:window.okUninstall;t!==void 0&&t.send(e).catch(()=>void 0)}var D=n();function O(e){let t=(0,w.c)(6),{items:n}=e,r;if(t[0]!==n){let e;t[2]===n.length?e=t[3]:(e=(e,t)=>(0,D.jsxs)(`li`,{className:`relative pb-5 pl-[30px] last:pb-1`,children:[t<n.length-1&&(0,D.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-[22px] bottom-0.5 left-[9px] w-0.5 bg-border`}),(0,D.jsx)(`span`,{"aria-hidden":`true`,className:c(`absolute top-px left-0 inline-flex size-5 items-center justify-center rounded-full`,e.done?`bg-primary/15 text-primary`:`border-[1.5px] border-muted-foreground/50`),children:e.done&&(0,D.jsx)(_,{className:`size-3`})}),(0,D.jsx)(`span`,{className:`sr-only`,children:e.done?(0,D.jsx)(i,{id:`clJ3qM`}):(0,D.jsx)(i,{id:`yU_9ur`})}),(0,D.jsxs)(`span`,{className:`block`,children:[(0,D.jsx)(`span`,{className:`font-medium`,children:e.label}),e.detail!==void 0&&(0,D.jsx)(`span`,{className:`mt-0.5 block text-muted-foreground leading-snug`,children:e.detail})]})]},e.label),t[2]=n.length,t[3]=e),r=n.map(e),t[0]=n,t[1]=r}else r=t[1];let a;return t[4]===r?a=t[5]:(a=(0,D.jsx)(`ol`,{className:`mb-1.5`,children:r}),t[4]=r,t[5]=a),a}function k(e){let t=(0,w.c)(49),{notice:n,onConfirm:r,onCancel:i,onRevealLog:o}=e,{_:s}=a(),c=(0,S.useId)(),u=(0,S.useId)(),d=n.cancelLabel!==void 0,f,p;t[0]!==d||t[1]!==i||t[2]!==r?(f=()=>{let e=e=>{e.key===`Escape`&&(d?i():r())};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},p=[d,i,r],t[0]=d,t[1]=i,t[2]=r,t[3]=f,t[4]=p):(f=t[3],p=t[4]),(0,S.useEffect)(f,p);let m;t[5]!==n.title||t[6]!==c?(m=(0,D.jsx)(`h1`,{id:c,className:`font-medium text-base leading-none`,children:n.title}),t[5]=n.title,t[6]=c,t[7]=m):m=t[7];let h;t[8]===n.subtitle?h=t[9]:(h=n.subtitle!==void 0&&(0,D.jsx)(`p`,{className:`text-muted-foreground text-sm leading-snug`,children:n.subtitle}),t[8]=n.subtitle,t[9]=h);let g;t[10]!==m||t[11]!==h?(g=(0,D.jsxs)(`header`,{className:`shrink-0 space-y-4 px-6 pt-5 pb-3.5`,children:[m,h]}),t[10]=m,t[11]=h,t[12]=g):g=t[12];let _;t[13]===n.paragraphs?_=t[14]:(_=n.paragraphs.map(A),t[13]=n.paragraphs,t[14]=_);let v;t[15]===n.checklist?v=t[16]:(v=n.checklist!==void 0&&(0,D.jsx)(O,{items:n.checklist}),t[15]=n.checklist,t[16]=v);let y;t[17]!==s||t[18]!==n.log?(y=n.log!==void 0&&(0,D.jsx)(`section`,{"aria-label":s({id:`Oi56Cu`}),tabIndex:0,className:`subtle-scrollbar mt-0.5 mb-2.5 min-h-20 flex-1 overflow-auto rounded-lg border border-border border-dotted bg-muted/40 px-3 py-2.5 focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,D.jsx)(`pre`,{className:`select-text whitespace-pre-wrap font-mono text-xs leading-relaxed wrap-anywhere`,children:n.log})}),t[17]=s,t[18]=n.log,t[19]=y):y=t[19];let b;t[20]===n.footnote?b=t[21]:(b=n.footnote!==void 0&&(0,D.jsx)(`p`,{className:`select-text text-muted-foreground text-xs wrap-anywhere`,children:n.footnote}),t[20]=n.footnote,t[21]=b);let x;t[22]!==n.logRevealLabel||t[23]!==o?(x=n.logRevealLabel!==void 0&&(0,D.jsx)(`p`,{className:`mt-0.5`,children:(0,D.jsx)(l,{type:`button`,variant:`link-muted`,size:`xs`,className:`h-auto px-0 underline underline-offset-2`,onClick:o,children:n.logRevealLabel})}),t[22]=n.logRevealLabel,t[23]=o,t[24]=x):x=t[24];let C;t[25]!==u||t[26]!==x||t[27]!==_||t[28]!==v||t[29]!==y||t[30]!==b?(C=(0,D.jsxs)(`div`,{id:u,className:`flex min-h-0 flex-1 flex-col px-6 pt-1 pb-4 text-sm`,children:[_,v,y,b,x]}),t[25]=u,t[26]=x,t[27]=_,t[28]=v,t[29]=y,t[30]=b,t[31]=C):C=t[31];let T;t[32]!==n.cancelLabel||t[33]!==i?(T=n.cancelLabel!==void 0&&(0,D.jsx)(l,{type:`button`,variant:`outline-mono`,autoFocus:!0,onClick:i,children:n.cancelLabel}),t[32]=n.cancelLabel,t[33]=i,t[34]=T):T=t[34];let E=n.danger===!0?`destructive`:`default`,k=!d,j;t[35]!==n.confirmLabel||t[36]!==r||t[37]!==E||t[38]!==k?(j=(0,D.jsx)(l,{type:`button`,variant:E,autoFocus:k,onClick:r,children:n.confirmLabel}),t[35]=n.confirmLabel,t[36]=r,t[37]=E,t[38]=k,t[39]=j):j=t[39];let M;t[40]!==T||t[41]!==j?(M=(0,D.jsxs)(`footer`,{className:`flex items-center justify-end gap-2.5 border-border border-t bg-muted/50 px-6 pt-3.5 pb-4`,children:[T,j]}),t[40]=T,t[41]=j,t[42]=M):M=t[42];let N;return t[43]!==u||t[44]!==C||t[45]!==M||t[46]!==g||t[47]!==c?(N=(0,D.jsxs)(`div`,{role:`alertdialog`,"aria-labelledby":c,"aria-describedby":u,className:`flex h-dvh flex-col bg-background text-foreground`,children:[g,C,M]}),t[43]=u,t[44]=C,t[45]=M,t[46]=g,t[47]=c,t[48]=N):N=t[48],N}function A(e){return(0,D.jsx)(`p`,{className:`mb-2.5 leading-normal`,children:e},e)}function j(e){return e.open||e.running?`active`:e.recent?`recent`:null}function M(e){return e.split(`/`).filter(Boolean).at(-1)??e}function N(e){let t=(0,w.c)(9),{status:n}=e,{_:r}=a(),i;t[0]===r?i=t[1]:(i=r({id:`s_ereB`}),t[0]=r,t[1]=i);let o;t[2]===r?o=t[3]:(o=r({id:`_2cM9E`}),t[2]=r,t[3]=o);let s;t[4]!==i||t[5]!==o?(s={active:i,recent:o},t[4]=i,t[5]=o,t[6]=s):s=t[6];let c=s[n],l;return t[7]===c?l=t[8]:(l=(0,D.jsx)(b,{variant:`secondary`,className:`rounded-sm text-muted-foreground`,children:c}),t[7]=c,t[8]=l),l}function P(e){let t=(0,w.c)(28),{project:n,checked:r,onCheckedChange:i}=e,{_:o}=a(),s=(0,S.useId)(),c;t[0]===n?c=t[1]:(c=j(n),t[0]=n,t[1]=c);let l=c,f;t[2]===i?f=t[3]:(f=e=>i(e===!0),t[2]=i,t[3]=f);let p;t[4]!==o||t[5]!==n.path?(p=o({id:`CHfFN_`,values:{0:n.path}}),t[4]=o,t[5]=n.path,t[6]=p):p=t[6];let m;t[7]!==s||t[8]!==r||t[9]!==f||t[10]!==p?(m=(0,D.jsx)(u,{id:s,className:`mt-0.5`,checked:r,onCheckedChange:f,"aria-label":p}),t[7]=s,t[8]=r,t[9]=f,t[10]=p,t[11]=m):m=t[11];let h;t[12]===n.path?h=t[13]:(h=M(n.path),t[12]=n.path,t[13]=h);let g;t[14]===h?g=t[15]:(g=(0,D.jsx)(`span`,{className:`w-full truncate font-medium text-sm`,children:h}),t[14]=h,t[15]=g);let _;t[16]===n.path?_=t[17]:(_=(0,D.jsx)(`span`,{className:`w-full select-text break-words text-muted-foreground text-xs`,children:n.path}),t[16]=n.path,t[17]=_);let v;t[18]!==s||t[19]!==g||t[20]!==_?(v=(0,D.jsxs)(d,{htmlFor:s,className:`min-w-0 flex-col items-start gap-0.5 font-normal`,children:[g,_]}),t[18]=s,t[19]=g,t[20]=_,t[21]=v):v=t[21];let y;t[22]===l?y=t[23]:(y=l!==null&&(0,D.jsx)(`div`,{className:`flex justify-end max-sm:col-start-2 max-sm:justify-start`,children:(0,D.jsx)(N,{status:l})}),t[22]=l,t[23]=y);let b;return t[24]!==m||t[25]!==v||t[26]!==y?(b=(0,D.jsxs)(`div`,{className:`grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-2.5 border-border/60 border-b px-3 py-2.5 last:border-b-0 hover:bg-accent/40 max-sm:grid-cols-[auto_minmax(0,1fr)]`,children:[m,v,y]}),t[24]=m,t[25]=v,t[26]=y,t[27]=b):b=t[27],b}function F(e){let t=(0,w.c)(45),{projects:n,onConfirm:r,onCancel:o}=e,{_:s}=a(),[c,f]=(0,S.useState)(ne),p=(0,S.useId)(),m=(0,S.useId)(),h=(0,S.useId)(),g=n.length>0&&c.size===n.length?!0:c.size>0?`indeterminate`:!1,_;t[0]===n?_=t[1]:(_=e=>f(e?new Set(n.map(I)):new Set),t[0]=n,t[1]=_);let v=_,y,b;t[2]!==o||t[3]!==n?(y=()=>{let e=e=>{if(e.key===`Escape`){o();return}(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`a`&&(e.preventDefault(),f(new Set(n.map(te))))};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},b=[o,n],t[2]=o,t[3]=n,t[4]=y,t[5]=b):(y=t[4],b=t[5]),(0,S.useEffect)(y,b);let x;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,D.jsx)(i,{id:`PrVaZo`}),t[6]=x):x=t[6];let C;t[7]===p?C=t[8]:(C=(0,D.jsx)(`h1`,{id:p,className:`font-medium leading-none text-base`,children:x}),t[7]=p,t[8]=C);let T;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,D.jsx)(i,{id:`keop3U`}),t[9]=T):T=t[9];let E;t[10]===m?E=t[11]:(E=(0,D.jsx)(`p`,{id:m,className:`text-sm text-muted-foreground`,children:T}),t[10]=m,t[11]=E);let O;t[12]!==C||t[13]!==E?(O=(0,D.jsxs)(`header`,{className:`shrink-0 px-6 pt-5 pb-3.5 space-y-4`,children:[C,E]}),t[12]=C,t[13]=E,t[14]=O):O=t[14];let k;t[15]===s?k=t[16]:(k=s({id:`QySH4I`}),t[15]=s,t[16]=k);let A;t[17]!==s||t[18]!==n||t[19]!==h||t[20]!==g||t[21]!==c||t[22]!==v?(A=n.length===0?(0,D.jsx)(`div`,{className:`rounded-lg border border-border p-4`,children:(0,D.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:(0,D.jsx)(i,{id:`bKt9Jk`})})}):(0,D.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-border`,children:[(0,D.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2.5 border-border border-b px-3 py-2.5 bg-muted/30`,children:[(0,D.jsx)(u,{id:h,checked:g,onCheckedChange:e=>v(e===!0)}),(0,D.jsx)(d,{htmlFor:h,className:`flex-1 font-medium text-sm`,children:(0,D.jsx)(i,{id:`wgNoIs`})}),(0,D.jsxs)(`span`,{role:`status`,"aria-label":s({id:`nsUDL8`,values:{0:c.size,1:n.length}}),className:`text-muted-foreground text-xs tabular-nums`,children:[c.size,` / `,n.length]})]}),(0,D.jsx)(`div`,{className:`subtle-scrollbar min-h-0 flex-1 overflow-y-scroll [scrollbar-gutter:stable]`,children:n.map((e,t)=>(0,D.jsx)(P,{project:e,checked:c.has(t),onCheckedChange:e=>{f(n=>{let r=new Set(n);return e?r.add(t):r.delete(t),r})}},e.path))})]}),t[17]=s,t[18]=n,t[19]=h,t[20]=g,t[21]=c,t[22]=v,t[23]=A):A=t[23];let j;t[24]!==A||t[25]!==k?(j=(0,D.jsx)(`section`,{"aria-label":k,className:`flex min-h-0 flex-1 flex-col px-6 py-3.5`,children:A}),t[24]=A,t[25]=k,t[26]=j):j=t[26];let M;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,D.jsx)(i,{id:`dEgA5A`}),t[27]=M):M=t[27];let N;t[28]===o?N=t[29]:(N=(0,D.jsx)(l,{type:`button`,variant:`outline-mono`,autoFocus:!0,onClick:o,children:M}),t[28]=o,t[29]=N);let F;t[30]!==r||t[31]!==c?(F=()=>r([...c].sort(ee)),t[30]=r,t[31]=c,t[32]=F):F=t[32];let L;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,D.jsx)(i,{id:`J7nMqi`}),t[33]=L):L=t[33];let R;t[34]===F?R=t[35]:(R=(0,D.jsx)(l,{type:`button`,variant:`destructive`,onClick:F,children:L}),t[34]=F,t[35]=R);let z;t[36]!==N||t[37]!==R?(z=(0,D.jsxs)(`footer`,{className:`flex items-center justify-end gap-2.5 border-border border-t bg-muted/50 px-6 pt-3.5 pb-4`,children:[N,R]}),t[36]=N,t[37]=R,t[38]=z):z=t[38];let B;return t[39]!==m||t[40]!==j||t[41]!==z||t[42]!==O||t[43]!==p?(B=(0,D.jsxs)(`div`,{role:`dialog`,"aria-labelledby":p,"aria-describedby":m,className:`flex h-dvh flex-col overflow-hidden bg-background text-foreground`,children:[O,j,z]}),t[39]=m,t[40]=j,t[41]=z,t[42]=O,t[43]=p,t[44]=B):B=t[44],B}function ee(e,t){return e-t}function te(e,t){return t}function I(e,t){return t}function ne(){return new Set}function L(){let e=(0,w.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,D.jsx)(v,{"aria-hidden":`true`,className:`mx-auto mb-4 size-8 text-primary`}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,D.jsx)(`h1`,{className:`mb-2 font-medium text-base leading-none`,children:(0,D.jsx)(i,{id:`j2229h`})}),e[1]=n):n=e[1];let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,D.jsx)(`main`,{className:`grid h-dvh place-items-center bg-background text-foreground`,children:(0,D.jsxs)(`div`,{role:`status`,className:`max-w-vw px-7 py-7 text-center`,children:[t,n,(0,D.jsx)(`p`,{className:`text-muted-foreground text-sm leading-relaxed`,children:(0,D.jsx)(i,{id:`kCjkGY`})})]})}),e[2]=r):r=e[2],r}function R(){let{_:e}=a();return{"workflow-fit":e({id:`5vAI6Z`}),"missing-feature":e({id:`cH0dkG`}),"hard-to-start":e({id:`uoJF_D`}),unreliable:e({id:`WGMoTY`}),"switched-tool":e({id:`jO18NZ`}),"one-off":e({id:`S3qu11`}),other:e({id:`aQyGJc`})}}function z(e){let t=(0,w.c)(86),{onSend:n,onSkip:r}=e,{_:o}=a(),s=R(),[c,g]=(0,S.useState)(``),[_,v]=(0,S.useState)(``),[b,C]=(0,S.useState)(!1),[T,E]=(0,S.useState)(``),O=(0,S.useRef)(null),k=(0,S.useId)(),A=(0,S.useId)(),j=(0,S.useId)(),M=(0,S.useId)(),N=(0,S.useId)(),P=(0,S.useId)(),F,ee;t[0]===b?(F=t[1],ee=t[2]):(F=()=>{b&&O.current?.focus()},ee=[b],t[0]=b,t[1]=F,t[2]=ee),(0,S.useEffect)(F,ee);let te;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,D.jsx)(i,{id:`ElyuiT`}),t[3]=te):te=t[3];let I;t[4]===k?I=t[5]:(I=(0,D.jsx)(`h1`,{id:k,className:`font-medium leading-none text-base`,children:te}),t[4]=k,t[5]=I);let ne;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,D.jsx)(i,{id:`ZDOq9A`}),t[6]=ne):ne=t[6];let L;t[7]===A?L=t[8]:(L=(0,D.jsx)(`p`,{id:A,className:`text-muted-foreground text-sm`,children:ne}),t[7]=A,t[8]=L);let z;t[9]!==I||t[10]!==L?(z=(0,D.jsxs)(`header`,{className:`px-6 pt-5 pb-3.5 space-y-4`,children:[I,L]}),t[9]=I,t[10]=L,t[11]=z):z=t[11];let B;t[12]!==T||t[13]!==b||t[14]!==_||t[15]!==n||t[16]!==c?(B=e=>{e.preventDefault();let t=_.trim(),r=b?T.trim():``;n({...c===``?{}:{reason:c},...t===``?{}:{note:t},...r===``?{}:{email:r}})},t[12]=T,t[13]=b,t[14]=_,t[15]=n,t[16]=c,t[17]=B):B=t[17];let re;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,D.jsx)(i,{id:`oxdGJn`}),t[18]=re):re=t[18];let V;t[19]===j?V=t[20]:(V=(0,D.jsx)(`p`,{id:j,className:`mb-2 font-medium text-sm`,children:re}),t[19]=j,t[20]=V);let H;t[21]!==j||t[22]!==s?(H=h.map(e=>(0,D.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-md px-1 py-1`,children:[(0,D.jsx)(f,{id:`${j}-${e.value}`,value:e.value}),(0,D.jsx)(d,{htmlFor:`${j}-${e.value}`,className:`font-normal text-sm leading-snug`,children:s[e.value]})]},e.value)),t[21]=j,t[22]=s,t[23]=H):H=t[23];let U;t[24]!==j||t[25]!==c||t[26]!==H?(U=(0,D.jsx)(p,{"aria-labelledby":j,value:c,onValueChange:g,children:H}),t[24]=j,t[25]=c,t[26]=H,t[27]=U):U=t[27];let W;t[28]!==V||t[29]!==U?(W=(0,D.jsxs)(`div`,{className:`mb-6`,children:[V,U]}),t[28]=V,t[29]=U,t[30]=W):W=t[30];let ie;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,D.jsx)(i,{id:`axQ1h6`}),t[31]=ie):ie=t[31];let G;t[32]===M?G=t[33]:(G=(0,D.jsx)(d,{htmlFor:M,className:`mb-2 font-medium text-sm`,children:ie}),t[32]=M,t[33]=G);let K;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(K=e=>v(e.target.value),t[34]=K):K=t[34];let q;t[35]!==_||t[36]!==M?(q=(0,D.jsx)(x,{id:M,rows:3,maxLength:m,value:_,onChange:K}),t[35]=_,t[36]=M,t[37]=q):q=t[37];let J;t[38]!==G||t[39]!==q?(J=(0,D.jsxs)(`div`,{className:`mb-6`,children:[G,q]}),t[38]=G,t[39]=q,t[40]=J):J=t[40];let ae;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(ae=e=>C(e===!0),t[41]=ae):ae=t[41];let Y;t[42]!==b||t[43]!==N?(Y=(0,D.jsx)(u,{id:N,checked:b,onCheckedChange:ae}),t[42]=b,t[43]=N,t[44]=Y):Y=t[44];let oe;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,D.jsx)(i,{id:`xEb24l`}),t[45]=oe):oe=t[45];let X;t[46]===N?X=t[47]:(X=(0,D.jsx)(d,{htmlFor:N,className:`font-medium text-sm`,children:oe}),t[46]=N,t[47]=X);let Z;t[48]!==Y||t[49]!==X?(Z=(0,D.jsxs)(`div`,{className:`mb-2 flex items-center gap-2.5`,children:[Y,X]}),t[48]=Y,t[49]=X,t[50]=Z):Z=t[50];let se=!b,ce;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,D.jsx)(i,{id:`ATGYL1`}),t[51]=ce):ce=t[51];let Q;t[52]===P?Q=t[53]:(Q=(0,D.jsx)(d,{htmlFor:P,className:`mb-2 font-medium text-sm sr-only`,children:ce}),t[52]=P,t[53]=Q);let le;t[54]===o?le=t[55]:(le=o({id:`JHf6qZ`}),t[54]=o,t[55]=le);let ue=!b,de;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(de=e=>E(e.target.value),t[56]=de):de=t[56];let fe;t[57]!==T||t[58]!==P||t[59]!==le||t[60]!==ue?(fe=(0,D.jsx)(y,{id:P,ref:O,type:`email`,maxLength:320,autoComplete:`email`,spellCheck:!1,placeholder:le,disabled:ue,value:T,onChange:de}),t[57]=T,t[58]=P,t[59]=le,t[60]=ue,t[61]=fe):fe=t[61];let $;t[62]!==se||t[63]!==Q||t[64]!==fe?($=(0,D.jsxs)(`div`,{className:`mb-6`,hidden:se,children:[Q,fe]}),t[62]=se,t[63]=Q,t[64]=fe,t[65]=$):$=t[65];let pe;t[66]!==W||t[67]!==J||t[68]!==Z||t[69]!==$?(pe=(0,D.jsxs)(`div`,{className:`subtle-scrollbar min-h-0 flex-1 overflow-y-auto px-6 pt-1 pb-4`,children:[W,J,Z,$]}),t[66]=W,t[67]=J,t[68]=Z,t[69]=$,t[70]=pe):pe=t[70];let me;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,D.jsx)(i,{id:`6Uau97`}),t[71]=me):me=t[71];let he;t[72]===r?he=t[73]:(he=(0,D.jsx)(l,{type:`button`,variant:`outline-mono`,autoFocus:!0,onClick:r,children:me}),t[72]=r,t[73]=he);let ge;t[74]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,D.jsx)(l,{type:`submit`,children:(0,D.jsx)(i,{id:`xMsnTe`})}),t[74]=ge):ge=t[74];let _e;t[75]===he?_e=t[76]:(_e=(0,D.jsxs)(`footer`,{className:`flex items-center justify-end gap-2.5 border-border border-t bg-muted/50 px-6 pt-3.5 pb-4`,children:[he,ge]}),t[75]=he,t[76]=_e);let ve;t[77]!==pe||t[78]!==_e||t[79]!==B?(ve=(0,D.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:B,children:[pe,_e]}),t[77]=pe,t[78]=_e,t[79]=B,t[80]=ve):ve=t[80];let ye;return t[81]!==A||t[82]!==ve||t[83]!==z||t[84]!==k?(ye=(0,D.jsxs)(`div`,{role:`dialog`,"aria-labelledby":k,"aria-describedby":A,className:`flex h-dvh flex-col bg-background text-foreground`,children:[z,ve]}),t[81]=A,t[82]=ve,t[83]=z,t[84]=k,t[85]=ye):ye=t[85],ye}function B(){let e=(0,w.c)(9),[t,n]=(0,S.useState)(null),r,a;if(e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=!0;return T().then(t=>{e&&n(t)}),()=>{e=!1}},a=[],e[0]=r,e[1]=a):(r=e[0],a=e[1]),(0,S.useEffect)(r,a),t!==null)switch(t.kind){case`picker`:{let n;return e[2]===t.projects?n=e[3]:(n=(0,D.jsx)(F,{projects:t.projects,onConfirm:G,onCancel:ie}),e[2]=t.projects,e[3]=n),n}case`survey`:{let t;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,D.jsx)(z,{onSend:W,onSkip:U}),e[4]=t):t=e[4],t}case`progress`:{let t;return e[5]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,D.jsx)(L,{}),e[5]=t):t=e[5],t}case`notice`:{let n;return e[6]===t.notice?n=e[7]:(n=(0,D.jsx)(k,{notice:t.notice,onConfirm:H,onCancel:V,onRevealLog:re}),e[6]=t.notice,e[7]=n),n}default:return t}let o;return e[8]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,D.jsx)(`main`,{className:`flex min-h-dvh items-center justify-center bg-background p-8 text-foreground`,children:(0,D.jsx)(`p`,{className:`text-center text-muted-foreground text-sm`,children:(0,D.jsx)(i,{id:`tzGWeg`})})}),e[8]=o):o=e[8],o}function re(){return E({kind:`notice-reveal-log`})}function V(){return E({kind:`notice-cancel`})}function H(){return E({kind:`notice-confirm`})}function U(){return E({kind:`survey-skip`})}function W(e){return E({kind:`survey-send`,...e})}function ie(){return E({kind:`picker-cancel`})}function G(e){return E({kind:`picker-confirm`,selectedIndexes:e})}var K=document.getElementById(`root`);if(!K)throw Error(`Root element not found`);(0,C.createRoot)(K).render((0,D.jsx)(S.StrictMode,{children:(0,D.jsx)(o,{i18n:g,children:(0,D.jsx)(B,{})})}));
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./globals-CTSydwqe.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a,t as o}from"./dist-Nvb76hAm.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{t as c}from"./utils-CPqDy6Hr.js";import{t as l}from"./button-Cym3gapE.js";import{t as u}from"./checkbox-UfDS9TpS.js";import{t as d}from"./label-D-K3fWtj.js";import{n as f,t as p}from"./radio-group-npdxiS6E.js";import{an as m,on as h}from"./dist-C_QZEaeX.js";import{t as g}from"./dist-Cr4-nBVI.js";import{t as _}from"./check-Dut4Aov8.js";import{t as v}from"./spinner-t7GahFcQ.js";import{t as y}from"./input-Cy2M_Avq.js";import"./i18n-Cx87c5FS.js";import{t as b}from"./badge-52pHek8I.js";import{t as x}from"./textarea-BtqZ3yY1.js";var S=e(r(),1),C=t(),w=s();async function T(){let e=typeof window>`u`?void 0:window.okUninstall;if(e===void 0)return null;try{let t=await e.ready();return t.kind===`screen`?t.screen:null}catch{return null}}function E(e){let t=typeof window>`u`?void 0:window.okUninstall;t!==void 0&&t.send(e).catch(()=>void 0)}var D=n();function O(e){let t=(0,w.c)(6),{items:n}=e,r;if(t[0]!==n){let e;t[2]===n.length?e=t[3]:(e=(e,t)=>(0,D.jsxs)(`li`,{className:`relative pb-5 pl-[30px] last:pb-1`,children:[t<n.length-1&&(0,D.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-[22px] bottom-0.5 left-[9px] w-0.5 bg-border`}),(0,D.jsx)(`span`,{"aria-hidden":`true`,className:c(`absolute top-px left-0 inline-flex size-5 items-center justify-center rounded-full`,e.done?`bg-primary/15 text-primary`:`border-[1.5px] border-muted-foreground/50`),children:e.done&&(0,D.jsx)(_,{className:`size-3`})}),(0,D.jsx)(`span`,{className:`sr-only`,children:e.done?(0,D.jsx)(i,{id:`clJ3qM`}):(0,D.jsx)(i,{id:`yU_9ur`})}),(0,D.jsxs)(`span`,{className:`block`,children:[(0,D.jsx)(`span`,{className:`font-medium`,children:e.label}),e.detail!==void 0&&(0,D.jsx)(`span`,{className:`mt-0.5 block text-muted-foreground leading-snug`,children:e.detail})]})]},e.label),t[2]=n.length,t[3]=e),r=n.map(e),t[0]=n,t[1]=r}else r=t[1];let a;return t[4]===r?a=t[5]:(a=(0,D.jsx)(`ol`,{className:`mb-1.5`,children:r}),t[4]=r,t[5]=a),a}function k(e){let t=(0,w.c)(49),{notice:n,onConfirm:r,onCancel:i,onRevealLog:o}=e,{_:s}=a(),c=(0,S.useId)(),u=(0,S.useId)(),d=n.cancelLabel!==void 0,f,p;t[0]!==d||t[1]!==i||t[2]!==r?(f=()=>{let e=e=>{e.key===`Escape`&&(d?i():r())};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},p=[d,i,r],t[0]=d,t[1]=i,t[2]=r,t[3]=f,t[4]=p):(f=t[3],p=t[4]),(0,S.useEffect)(f,p);let m;t[5]!==n.title||t[6]!==c?(m=(0,D.jsx)(`h1`,{id:c,className:`font-medium text-base leading-none`,children:n.title}),t[5]=n.title,t[6]=c,t[7]=m):m=t[7];let h;t[8]===n.subtitle?h=t[9]:(h=n.subtitle!==void 0&&(0,D.jsx)(`p`,{className:`text-muted-foreground text-sm leading-snug`,children:n.subtitle}),t[8]=n.subtitle,t[9]=h);let g;t[10]!==m||t[11]!==h?(g=(0,D.jsxs)(`header`,{className:`shrink-0 space-y-4 px-6 pt-5 pb-3.5`,children:[m,h]}),t[10]=m,t[11]=h,t[12]=g):g=t[12];let _;t[13]===n.paragraphs?_=t[14]:(_=n.paragraphs.map(A),t[13]=n.paragraphs,t[14]=_);let v;t[15]===n.checklist?v=t[16]:(v=n.checklist!==void 0&&(0,D.jsx)(O,{items:n.checklist}),t[15]=n.checklist,t[16]=v);let y;t[17]!==s||t[18]!==n.log?(y=n.log!==void 0&&(0,D.jsx)(`section`,{"aria-label":s({id:`Oi56Cu`}),tabIndex:0,className:`subtle-scrollbar mt-0.5 mb-2.5 min-h-20 flex-1 overflow-auto rounded-lg border border-border border-dotted bg-muted/40 px-3 py-2.5 focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,D.jsx)(`pre`,{className:`select-text whitespace-pre-wrap font-mono text-xs leading-relaxed wrap-anywhere`,children:n.log})}),t[17]=s,t[18]=n.log,t[19]=y):y=t[19];let b;t[20]===n.footnote?b=t[21]:(b=n.footnote!==void 0&&(0,D.jsx)(`p`,{className:`select-text text-muted-foreground text-xs wrap-anywhere`,children:n.footnote}),t[20]=n.footnote,t[21]=b);let x;t[22]!==n.logRevealLabel||t[23]!==o?(x=n.logRevealLabel!==void 0&&(0,D.jsx)(`p`,{className:`mt-0.5`,children:(0,D.jsx)(l,{type:`button`,variant:`link-muted`,size:`xs`,className:`h-auto px-0 underline underline-offset-2`,onClick:o,children:n.logRevealLabel})}),t[22]=n.logRevealLabel,t[23]=o,t[24]=x):x=t[24];let C;t[25]!==u||t[26]!==x||t[27]!==_||t[28]!==v||t[29]!==y||t[30]!==b?(C=(0,D.jsxs)(`div`,{id:u,className:`flex min-h-0 flex-1 flex-col px-6 pt-1 pb-4 text-sm`,children:[_,v,y,b,x]}),t[25]=u,t[26]=x,t[27]=_,t[28]=v,t[29]=y,t[30]=b,t[31]=C):C=t[31];let T;t[32]!==n.cancelLabel||t[33]!==i?(T=n.cancelLabel!==void 0&&(0,D.jsx)(l,{type:`button`,variant:`outline-mono`,autoFocus:!0,onClick:i,children:n.cancelLabel}),t[32]=n.cancelLabel,t[33]=i,t[34]=T):T=t[34];let E=n.danger===!0?`destructive`:`default`,k=!d,j;t[35]!==n.confirmLabel||t[36]!==r||t[37]!==E||t[38]!==k?(j=(0,D.jsx)(l,{type:`button`,variant:E,autoFocus:k,onClick:r,children:n.confirmLabel}),t[35]=n.confirmLabel,t[36]=r,t[37]=E,t[38]=k,t[39]=j):j=t[39];let M;t[40]!==T||t[41]!==j?(M=(0,D.jsxs)(`footer`,{className:`flex items-center justify-end gap-2.5 border-border border-t bg-muted/50 px-6 pt-3.5 pb-4`,children:[T,j]}),t[40]=T,t[41]=j,t[42]=M):M=t[42];let N;return t[43]!==u||t[44]!==C||t[45]!==M||t[46]!==g||t[47]!==c?(N=(0,D.jsxs)(`div`,{role:`alertdialog`,"aria-labelledby":c,"aria-describedby":u,className:`flex h-dvh flex-col bg-background text-foreground`,children:[g,C,M]}),t[43]=u,t[44]=C,t[45]=M,t[46]=g,t[47]=c,t[48]=N):N=t[48],N}function A(e){return(0,D.jsx)(`p`,{className:`mb-2.5 leading-normal`,children:e},e)}function j(e){return e.open||e.running?`active`:e.recent?`recent`:null}function M(e){return e.split(`/`).filter(Boolean).at(-1)??e}function N(e){let t=(0,w.c)(9),{status:n}=e,{_:r}=a(),i;t[0]===r?i=t[1]:(i=r({id:`s_ereB`}),t[0]=r,t[1]=i);let o;t[2]===r?o=t[3]:(o=r({id:`_2cM9E`}),t[2]=r,t[3]=o);let s;t[4]!==i||t[5]!==o?(s={active:i,recent:o},t[4]=i,t[5]=o,t[6]=s):s=t[6];let c=s[n],l;return t[7]===c?l=t[8]:(l=(0,D.jsx)(b,{variant:`secondary`,className:`rounded-sm text-muted-foreground`,children:c}),t[7]=c,t[8]=l),l}function P(e){let t=(0,w.c)(28),{project:n,checked:r,onCheckedChange:i}=e,{_:o}=a(),s=(0,S.useId)(),c;t[0]===n?c=t[1]:(c=j(n),t[0]=n,t[1]=c);let l=c,f;t[2]===i?f=t[3]:(f=e=>i(e===!0),t[2]=i,t[3]=f);let p;t[4]!==o||t[5]!==n.path?(p=o({id:`CHfFN_`,values:{0:n.path}}),t[4]=o,t[5]=n.path,t[6]=p):p=t[6];let m;t[7]!==s||t[8]!==r||t[9]!==f||t[10]!==p?(m=(0,D.jsx)(u,{id:s,className:`mt-0.5`,checked:r,onCheckedChange:f,"aria-label":p}),t[7]=s,t[8]=r,t[9]=f,t[10]=p,t[11]=m):m=t[11];let h;t[12]===n.path?h=t[13]:(h=M(n.path),t[12]=n.path,t[13]=h);let g;t[14]===h?g=t[15]:(g=(0,D.jsx)(`span`,{className:`w-full truncate font-medium text-sm`,children:h}),t[14]=h,t[15]=g);let _;t[16]===n.path?_=t[17]:(_=(0,D.jsx)(`span`,{className:`w-full select-text break-words text-muted-foreground text-xs`,children:n.path}),t[16]=n.path,t[17]=_);let v;t[18]!==s||t[19]!==g||t[20]!==_?(v=(0,D.jsxs)(d,{htmlFor:s,className:`min-w-0 flex-col items-start gap-0.5 font-normal`,children:[g,_]}),t[18]=s,t[19]=g,t[20]=_,t[21]=v):v=t[21];let y;t[22]===l?y=t[23]:(y=l!==null&&(0,D.jsx)(`div`,{className:`flex justify-end max-sm:col-start-2 max-sm:justify-start`,children:(0,D.jsx)(N,{status:l})}),t[22]=l,t[23]=y);let b;return t[24]!==m||t[25]!==v||t[26]!==y?(b=(0,D.jsxs)(`div`,{className:`grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-2.5 border-border/60 border-b px-3 py-2.5 last:border-b-0 hover:bg-accent/40 max-sm:grid-cols-[auto_minmax(0,1fr)]`,children:[m,v,y]}),t[24]=m,t[25]=v,t[26]=y,t[27]=b):b=t[27],b}function F(e){let t=(0,w.c)(45),{projects:n,onConfirm:r,onCancel:o}=e,{_:s}=a(),[c,f]=(0,S.useState)(ne),p=(0,S.useId)(),m=(0,S.useId)(),h=(0,S.useId)(),g=n.length>0&&c.size===n.length?!0:c.size>0?`indeterminate`:!1,_;t[0]===n?_=t[1]:(_=e=>f(e?new Set(n.map(I)):new Set),t[0]=n,t[1]=_);let v=_,y,b;t[2]!==o||t[3]!==n?(y=()=>{let e=e=>{if(e.key===`Escape`){o();return}(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`a`&&(e.preventDefault(),f(new Set(n.map(te))))};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},b=[o,n],t[2]=o,t[3]=n,t[4]=y,t[5]=b):(y=t[4],b=t[5]),(0,S.useEffect)(y,b);let x;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,D.jsx)(i,{id:`PrVaZo`}),t[6]=x):x=t[6];let C;t[7]===p?C=t[8]:(C=(0,D.jsx)(`h1`,{id:p,className:`font-medium leading-none text-base`,children:x}),t[7]=p,t[8]=C);let T;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,D.jsx)(i,{id:`keop3U`}),t[9]=T):T=t[9];let E;t[10]===m?E=t[11]:(E=(0,D.jsx)(`p`,{id:m,className:`text-sm text-muted-foreground`,children:T}),t[10]=m,t[11]=E);let O;t[12]!==C||t[13]!==E?(O=(0,D.jsxs)(`header`,{className:`shrink-0 px-6 pt-5 pb-3.5 space-y-4`,children:[C,E]}),t[12]=C,t[13]=E,t[14]=O):O=t[14];let k;t[15]===s?k=t[16]:(k=s({id:`QySH4I`}),t[15]=s,t[16]=k);let A;t[17]!==s||t[18]!==n||t[19]!==h||t[20]!==g||t[21]!==c||t[22]!==v?(A=n.length===0?(0,D.jsx)(`div`,{className:`rounded-lg border border-border p-4`,children:(0,D.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:(0,D.jsx)(i,{id:`bKt9Jk`})})}):(0,D.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-border`,children:[(0,D.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2.5 border-border border-b px-3 py-2.5 bg-muted/30`,children:[(0,D.jsx)(u,{id:h,checked:g,onCheckedChange:e=>v(e===!0)}),(0,D.jsx)(d,{htmlFor:h,className:`flex-1 font-medium text-sm`,children:(0,D.jsx)(i,{id:`wgNoIs`})}),(0,D.jsxs)(`span`,{role:`status`,"aria-label":s({id:`nsUDL8`,values:{0:c.size,1:n.length}}),className:`text-muted-foreground text-xs tabular-nums`,children:[c.size,` / `,n.length]})]}),(0,D.jsx)(`div`,{className:`subtle-scrollbar min-h-0 flex-1 overflow-y-scroll [scrollbar-gutter:stable]`,children:n.map((e,t)=>(0,D.jsx)(P,{project:e,checked:c.has(t),onCheckedChange:e=>{f(n=>{let r=new Set(n);return e?r.add(t):r.delete(t),r})}},e.path))})]}),t[17]=s,t[18]=n,t[19]=h,t[20]=g,t[21]=c,t[22]=v,t[23]=A):A=t[23];let j;t[24]!==A||t[25]!==k?(j=(0,D.jsx)(`section`,{"aria-label":k,className:`flex min-h-0 flex-1 flex-col px-6 py-3.5`,children:A}),t[24]=A,t[25]=k,t[26]=j):j=t[26];let M;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,D.jsx)(i,{id:`dEgA5A`}),t[27]=M):M=t[27];let N;t[28]===o?N=t[29]:(N=(0,D.jsx)(l,{type:`button`,variant:`outline-mono`,autoFocus:!0,onClick:o,children:M}),t[28]=o,t[29]=N);let F;t[30]!==r||t[31]!==c?(F=()=>r([...c].sort(ee)),t[30]=r,t[31]=c,t[32]=F):F=t[32];let L;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,D.jsx)(i,{id:`J7nMqi`}),t[33]=L):L=t[33];let R;t[34]===F?R=t[35]:(R=(0,D.jsx)(l,{type:`button`,variant:`destructive`,onClick:F,children:L}),t[34]=F,t[35]=R);let z;t[36]!==N||t[37]!==R?(z=(0,D.jsxs)(`footer`,{className:`flex items-center justify-end gap-2.5 border-border border-t bg-muted/50 px-6 pt-3.5 pb-4`,children:[N,R]}),t[36]=N,t[37]=R,t[38]=z):z=t[38];let B;return t[39]!==m||t[40]!==j||t[41]!==z||t[42]!==O||t[43]!==p?(B=(0,D.jsxs)(`div`,{role:`dialog`,"aria-labelledby":p,"aria-describedby":m,className:`flex h-dvh flex-col overflow-hidden bg-background text-foreground`,children:[O,j,z]}),t[39]=m,t[40]=j,t[41]=z,t[42]=O,t[43]=p,t[44]=B):B=t[44],B}function ee(e,t){return e-t}function te(e,t){return t}function I(e,t){return t}function ne(){return new Set}function L(){let e=(0,w.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,D.jsx)(v,{"aria-hidden":`true`,className:`mx-auto mb-4 size-8 text-primary`}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,D.jsx)(`h1`,{className:`mb-2 font-medium text-base leading-none`,children:(0,D.jsx)(i,{id:`j2229h`})}),e[1]=n):n=e[1];let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,D.jsx)(`main`,{className:`grid h-dvh place-items-center bg-background text-foreground`,children:(0,D.jsxs)(`div`,{role:`status`,className:`max-w-vw px-7 py-7 text-center`,children:[t,n,(0,D.jsx)(`p`,{className:`text-muted-foreground text-sm leading-relaxed`,children:(0,D.jsx)(i,{id:`kCjkGY`})})]})}),e[2]=r):r=e[2],r}function R(){let{_:e}=a();return{"workflow-fit":e({id:`5vAI6Z`}),"missing-feature":e({id:`cH0dkG`}),"hard-to-start":e({id:`uoJF_D`}),unreliable:e({id:`WGMoTY`}),"switched-tool":e({id:`jO18NZ`}),"one-off":e({id:`S3qu11`}),other:e({id:`aQyGJc`})}}function z(e){let t=(0,w.c)(86),{onSend:n,onSkip:r}=e,{_:o}=a(),s=R(),[c,g]=(0,S.useState)(``),[_,v]=(0,S.useState)(``),[b,C]=(0,S.useState)(!1),[T,E]=(0,S.useState)(``),O=(0,S.useRef)(null),k=(0,S.useId)(),A=(0,S.useId)(),j=(0,S.useId)(),M=(0,S.useId)(),N=(0,S.useId)(),P=(0,S.useId)(),F,ee;t[0]===b?(F=t[1],ee=t[2]):(F=()=>{b&&O.current?.focus()},ee=[b],t[0]=b,t[1]=F,t[2]=ee),(0,S.useEffect)(F,ee);let te;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,D.jsx)(i,{id:`ElyuiT`}),t[3]=te):te=t[3];let I;t[4]===k?I=t[5]:(I=(0,D.jsx)(`h1`,{id:k,className:`font-medium leading-none text-base`,children:te}),t[4]=k,t[5]=I);let ne;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,D.jsx)(i,{id:`ZDOq9A`}),t[6]=ne):ne=t[6];let L;t[7]===A?L=t[8]:(L=(0,D.jsx)(`p`,{id:A,className:`text-muted-foreground text-sm`,children:ne}),t[7]=A,t[8]=L);let z;t[9]!==I||t[10]!==L?(z=(0,D.jsxs)(`header`,{className:`px-6 pt-5 pb-3.5 space-y-4`,children:[I,L]}),t[9]=I,t[10]=L,t[11]=z):z=t[11];let B;t[12]!==T||t[13]!==b||t[14]!==_||t[15]!==n||t[16]!==c?(B=e=>{e.preventDefault();let t=_.trim(),r=b?T.trim():``;n({...c===``?{}:{reason:c},...t===``?{}:{note:t},...r===``?{}:{email:r}})},t[12]=T,t[13]=b,t[14]=_,t[15]=n,t[16]=c,t[17]=B):B=t[17];let re;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,D.jsx)(i,{id:`oxdGJn`}),t[18]=re):re=t[18];let V;t[19]===j?V=t[20]:(V=(0,D.jsx)(`p`,{id:j,className:`mb-2 font-medium text-sm`,children:re}),t[19]=j,t[20]=V);let H;t[21]!==j||t[22]!==s?(H=h.map(e=>(0,D.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-md px-1 py-1`,children:[(0,D.jsx)(f,{id:`${j}-${e.value}`,value:e.value}),(0,D.jsx)(d,{htmlFor:`${j}-${e.value}`,className:`font-normal text-sm leading-snug`,children:s[e.value]})]},e.value)),t[21]=j,t[22]=s,t[23]=H):H=t[23];let U;t[24]!==j||t[25]!==c||t[26]!==H?(U=(0,D.jsx)(p,{"aria-labelledby":j,value:c,onValueChange:g,children:H}),t[24]=j,t[25]=c,t[26]=H,t[27]=U):U=t[27];let W;t[28]!==V||t[29]!==U?(W=(0,D.jsxs)(`div`,{className:`mb-6`,children:[V,U]}),t[28]=V,t[29]=U,t[30]=W):W=t[30];let ie;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,D.jsx)(i,{id:`axQ1h6`}),t[31]=ie):ie=t[31];let G;t[32]===M?G=t[33]:(G=(0,D.jsx)(d,{htmlFor:M,className:`mb-2 font-medium text-sm`,children:ie}),t[32]=M,t[33]=G);let K;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(K=e=>v(e.target.value),t[34]=K):K=t[34];let q;t[35]!==_||t[36]!==M?(q=(0,D.jsx)(x,{id:M,rows:3,maxLength:m,value:_,onChange:K}),t[35]=_,t[36]=M,t[37]=q):q=t[37];let J;t[38]!==G||t[39]!==q?(J=(0,D.jsxs)(`div`,{className:`mb-6`,children:[G,q]}),t[38]=G,t[39]=q,t[40]=J):J=t[40];let ae;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(ae=e=>C(e===!0),t[41]=ae):ae=t[41];let Y;t[42]!==b||t[43]!==N?(Y=(0,D.jsx)(u,{id:N,checked:b,onCheckedChange:ae}),t[42]=b,t[43]=N,t[44]=Y):Y=t[44];let oe;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,D.jsx)(i,{id:`xEb24l`}),t[45]=oe):oe=t[45];let X;t[46]===N?X=t[47]:(X=(0,D.jsx)(d,{htmlFor:N,className:`font-medium text-sm`,children:oe}),t[46]=N,t[47]=X);let Z;t[48]!==Y||t[49]!==X?(Z=(0,D.jsxs)(`div`,{className:`mb-2 flex items-center gap-2.5`,children:[Y,X]}),t[48]=Y,t[49]=X,t[50]=Z):Z=t[50];let se=!b,ce;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,D.jsx)(i,{id:`ATGYL1`}),t[51]=ce):ce=t[51];let Q;t[52]===P?Q=t[53]:(Q=(0,D.jsx)(d,{htmlFor:P,className:`mb-2 font-medium text-sm sr-only`,children:ce}),t[52]=P,t[53]=Q);let le;t[54]===o?le=t[55]:(le=o({id:`JHf6qZ`}),t[54]=o,t[55]=le);let ue=!b,de;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(de=e=>E(e.target.value),t[56]=de):de=t[56];let fe;t[57]!==T||t[58]!==P||t[59]!==le||t[60]!==ue?(fe=(0,D.jsx)(y,{id:P,ref:O,type:`email`,maxLength:320,autoComplete:`email`,spellCheck:!1,placeholder:le,disabled:ue,value:T,onChange:de}),t[57]=T,t[58]=P,t[59]=le,t[60]=ue,t[61]=fe):fe=t[61];let $;t[62]!==se||t[63]!==Q||t[64]!==fe?($=(0,D.jsxs)(`div`,{className:`mb-6`,hidden:se,children:[Q,fe]}),t[62]=se,t[63]=Q,t[64]=fe,t[65]=$):$=t[65];let pe;t[66]!==W||t[67]!==J||t[68]!==Z||t[69]!==$?(pe=(0,D.jsxs)(`div`,{className:`subtle-scrollbar min-h-0 flex-1 overflow-y-auto px-6 pt-1 pb-4`,children:[W,J,Z,$]}),t[66]=W,t[67]=J,t[68]=Z,t[69]=$,t[70]=pe):pe=t[70];let me;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,D.jsx)(i,{id:`6Uau97`}),t[71]=me):me=t[71];let he;t[72]===r?he=t[73]:(he=(0,D.jsx)(l,{type:`button`,variant:`outline-mono`,autoFocus:!0,onClick:r,children:me}),t[72]=r,t[73]=he);let ge;t[74]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,D.jsx)(l,{type:`submit`,children:(0,D.jsx)(i,{id:`xMsnTe`})}),t[74]=ge):ge=t[74];let _e;t[75]===he?_e=t[76]:(_e=(0,D.jsxs)(`footer`,{className:`flex items-center justify-end gap-2.5 border-border border-t bg-muted/50 px-6 pt-3.5 pb-4`,children:[he,ge]}),t[75]=he,t[76]=_e);let ve;t[77]!==pe||t[78]!==_e||t[79]!==B?(ve=(0,D.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:B,children:[pe,_e]}),t[77]=pe,t[78]=_e,t[79]=B,t[80]=ve):ve=t[80];let ye;return t[81]!==A||t[82]!==ve||t[83]!==z||t[84]!==k?(ye=(0,D.jsxs)(`div`,{role:`dialog`,"aria-labelledby":k,"aria-describedby":A,className:`flex h-dvh flex-col bg-background text-foreground`,children:[z,ve]}),t[81]=A,t[82]=ve,t[83]=z,t[84]=k,t[85]=ye):ye=t[85],ye}function B(){let e=(0,w.c)(9),[t,n]=(0,S.useState)(null),r,a;if(e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=!0;return T().then(t=>{e&&n(t)}),()=>{e=!1}},a=[],e[0]=r,e[1]=a):(r=e[0],a=e[1]),(0,S.useEffect)(r,a),t!==null)switch(t.kind){case`picker`:{let n;return e[2]===t.projects?n=e[3]:(n=(0,D.jsx)(F,{projects:t.projects,onConfirm:G,onCancel:ie}),e[2]=t.projects,e[3]=n),n}case`survey`:{let t;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,D.jsx)(z,{onSend:W,onSkip:U}),e[4]=t):t=e[4],t}case`progress`:{let t;return e[5]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,D.jsx)(L,{}),e[5]=t):t=e[5],t}case`notice`:{let n;return e[6]===t.notice?n=e[7]:(n=(0,D.jsx)(k,{notice:t.notice,onConfirm:H,onCancel:V,onRevealLog:re}),e[6]=t.notice,e[7]=n),n}default:return t}let o;return e[8]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,D.jsx)(`main`,{className:`flex min-h-dvh items-center justify-center bg-background p-8 text-foreground`,children:(0,D.jsx)(`p`,{className:`text-center text-muted-foreground text-sm`,children:(0,D.jsx)(i,{id:`tzGWeg`})})}),e[8]=o):o=e[8],o}function re(){return E({kind:`notice-reveal-log`})}function V(){return E({kind:`notice-cancel`})}function H(){return E({kind:`notice-confirm`})}function U(){return E({kind:`survey-skip`})}function W(e){return E({kind:`survey-send`,...e})}function ie(){return E({kind:`picker-cancel`})}function G(e){return E({kind:`picker-confirm`,selectedIndexes:e})}var K=document.getElementById(`root`);if(!K)throw Error(`Root element not found`);(0,C.createRoot)(K).render((0,D.jsx)(S.StrictMode,{children:(0,D.jsx)(o,{i18n:g,children:(0,D.jsx)(B,{})})}));
|
package/dist/public/assets/{use-activity-panel-Bat2VfJF.js → use-activity-panel-eHjQUm9s.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{i as t}from"./DocumentContext-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{i as t}from"./DocumentContext-CWz_S-8Y.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{Q as i}from"./CodeMirrorPropInput-B4qzFbMb.js";import{i as a,r as o,wt as s}from"./dist-C_QZEaeX.js";import{v as c}from"./documents-events-CwqQxQT5.js";import{n as l}from"./agent-presence-C_iH_p3q.js";import{t as u}from"./lru-string-cache-CEQLtS-9.js";var d=r(),f=e(n(),1),p=500,m=64;async function h(e){let t=`/api/agent-activity?agentId=${encodeURIComponent(e)}`,n=await fetch(t),r;try{r=await n.json()}catch(e){throw new i(`Could not parse /api/agent-activity response.`,{cause:e,status:n.status})}if(!n.ok){let e=s.safeParse(r);throw e.success?Error(e.data.title):new i(`/api/agent-activity returned a non-RFC-9457 error response.`,{cause:e.error,status:n.status})}let a=o.safeParse(r);if(!a.success)throw new i(`/api/agent-activity returned a body that did not match AgentActivitySuccessSchema.`,{cause:a.error,status:n.status});return a.data}async function g(e,t,n){let r=`/api/agent-burst-diff?agentId=${encodeURIComponent(e)}&docName=${encodeURIComponent(t)}&keptCount=${n}`,o=await fetch(r),c;try{c=await o.json()}catch(e){throw new i(`Could not parse /api/agent-burst-diff response.`,{cause:e,status:o.status})}if(!o.ok){let e=s.safeParse(c);throw e.success?Error(e.data.title):new i(`/api/agent-burst-diff returned a non-RFC-9457 error response.`,{cause:e.error,status:o.status})}let l=a.safeParse(c);if(!l.success)throw new i(`/api/agent-burst-diff returned a body that did not match AgentBurstDiffSuccessSchema.`,{cause:l.error,status:o.status});let{diff:u,before:d,after:f,properties:p}=l.data;return{diff:u,before:d,after:f,properties:p}}function _(e){let n=(0,d.c)(23),{systemProvider:r}=t(),[i,a]=(0,f.useState)(null),[o,s]=(0,f.useState)(`idle`),[l,_]=(0,f.useState)(null),b;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=new u(m),n[0]=b):b=n[0];let x=(0,f.useRef)(b),S=(0,f.useRef)(0),C;n[1]===r?C=n[2]:(C=e=>{let t=S.current+=1;s(`loading`),_(null),h(e).then(n=>{if(S.current!==t)return;let i=y(r,e);a({...n,writingDocs:i}),s(`ready`)}).catch(e=>{S.current===t&&(_(e instanceof Error?e.message:String(e)),s(`error`))})},n[1]=r,n[2]=C);let w=C,T;n[3]!==e||n[4]!==w?(T=()=>{if(!e){S.current+=1,a(null),s(`idle`),_(null),x.current.clear();return}x.current.clear(),w(e);let t=null,n=c(n=>{n.includes(`session-activity`)&&(t&&clearTimeout(t),t=setTimeout(()=>{t=null,w(e)},p))});return()=>{t&&clearTimeout(t),n()}},n[3]=e,n[4]=w,n[5]=T):T=n[5];let E;n[6]===e?E=n[7]:(E=[e],n[6]=e,n[7]=E),(0,f.useEffect)(T,E);let D,O;n[8]!==e||n[9]!==r?(D=()=>{if(!e||!r)return;let t=()=>{if(!r.awareness)return;let t=y(r,e);a(e=>!e||v(e.writingDocs,t)?e:{...e,writingDocs:t})},n=r.awareness;if(!n||typeof n.on!=`function`){t();return}n.on(`update`,t),t();let i=setInterval(t,1e3);return()=>{clearInterval(i),typeof n.off==`function`&&n.off(`update`,t)}},O=[e,r],n[8]=e,n[9]=r,n[10]=D,n[11]=O):(D=n[10],O=n[11]),(0,f.useEffect)(D,O);let k;n[12]===e?k=n[13]:(k=async(t,n)=>{if(!e)return``;let r=`${t}\0${n}`,i=x.current.get(r);if(i!==void 0)return i;let{diff:a}=await g(e,t,n);return x.current.set(r,a),a},n[12]=e,n[13]=k);let A=k,j;n[14]!==e||n[15]!==w?(j=()=>{e&&w(e)},n[14]=e,n[15]=w,n[16]=j):j=n[16];let M=j,N;return n[17]!==i||n[18]!==l||n[19]!==A||n[20]!==M||n[21]!==o?(N={data:i,status:o,error:l,reload:M,fetchBurstDiff:A},n[17]=i,n[18]=l,n[19]=A,n[20]=M,n[21]=o,n[22]=N):N=n[22],N}function v(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function y(e,t){let n=new Set;if(!e)return n;let r=e.awareness;if(!l(r))return n;let i=[t,t.startsWith(`agent-`)?t.slice(6):`agent-${t}`];for(let e of r.getStates().values()){let t=e.agentPresence;if(t)for(let e of i){let r=t[e];r&&r.mode===`writing`&&r.currentDoc&&n.add(r.currentDoc)}}return n}export{_ as n,g as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./DocumentContext-
|
|
1
|
+
import{i as e}from"./DocumentContext-CWz_S-8Y.js";import{t}from"./compiler-runtime-BfE3aGVn.js";import{Go as n}from"./dist-C_QZEaeX.js";import{n as r}from"./dist-CJhtNlOm2.js";import{t as i}from"./dist-Cr4-nBVI.js";import{d as a,r as o}from"./documents-events-CwqQxQT5.js";import{t as s}from"./createLucideIcon-BulbvLvN.js";import{b as c,f as l,h as u,v as d,x as f}from"./doc-paths-DMctW8qz.js";import{m as p}from"./page-list-cache-DambRQ7B.js";import{_ as m}from"./skills-api-Du0yE_Ea.js";import{n as h,t as g}from"./use-skills-BkWQHhha.js";var _=s(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),v=t();function y(e){if(typeof window>`u`)return;let t=l(e);d(window.location.hash,t)||(window.location.hash=t)}function b(e){if(typeof window>`u`)return;let t=u(e);window.location.hash!==t&&(window.location.hash=t)}var x=null,S=new Set;function C(){return x}function w(e){return S.add(e),()=>{S.delete(e)}}function T(){for(let e of S)e()}function E(e){x!==null&&x.scope===e.scope&&x.name===e.name||(x=e,T())}function D(){x!==null&&(x=null,T())}function O(){let t=(0,v.c)(4),{openTarget:s}=e(),u=g(),d;return t[0]!==s||t[1]!==u.data||t[2]!==u.status?(d=(e,t,d)=>{let g=n=>{u.status===`ready`&&u.data.some(n=>n.scope===e&&n.name===t)||(o(e,t),h(e,t).then(()=>a(e,t))),s({kind:`doc`,target:n,docName:n},d?.replaceActive?{tabBehavior:`replace-active`}:void 0);let r=l(n);d?.replaceHistory?f(r):c(r)},_=u.status===`ready`?u.data.find(n=>n.scope===e&&n.name===t&&(d?.host===void 0?n.hostQualifier===void 0:n.hostQualifier===d.host)):void 0;if(_?.ignored===!0&&_.managed!==!0){let n=_;(async()=>{try{let n=await m(e),r=n.ok?n.skills.find(n=>n.scope===e&&n.name===t&&(d?.host===void 0?n.hostQualifier===void 0:n.hostQualifier===d.host)):void 0;if(r&&r.ignored!==!0){g(p(r));return}}catch{}E({scope:n.scope,name:n.name})})();return}let v=k;if(_?.managed===!0&&_.absolutePath!==void 0){b({flavor:`builtin`,source:v(_.absolutePath),name:_.name,subtitle:``,level:_.scope});return}if(_&&_.scope===`project`&&_.managed!==!0&&_.canonicalPath!==void 0&&_.absolutePath!==void 0){b({flavor:`linked`,source:v(_.absolutePath),name:_.name,subtitle:``,level:_.scope});return}if(_)return g(p(_));if(e===`project`&&d?.path)return g(d.path.replace(/\.mdx?$/i,``));if(e===`global`)return g(n(e,t,d?.host));(async()=>{try{let n=await m(`project`);if(!n.ok){r.error(i._({id:`IO8REi`,values:{0:n.error,name:t}}));return}let a=n.skills.find(n=>n.scope===e&&n.name===t);if(!a){r.error(i._({id:`9uRLEH`,values:{name:t}}));return}g(p(a))}catch(e){let n=e;r.error(i._({id:`IO8REi`,values:{0:n instanceof Error?n.message:String(n),name:t}}))}})()},t[0]=s,t[1]=u.data,t[2]=u.status,t[3]=d):d=t[3],d}function k(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t>0?e.slice(0,t):e}export{w as a,_ as c,E as i,D as n,y as o,C as r,b as s,O as t};
|
package/dist/public/assets/{use-terminal-enabled-ST2-eUch.js → use-terminal-enabled-Bv6fREpc.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./compiler-runtime-BfE3aGVn.js";import{t}from"./terminal-telemetry-CWD0Kbui.js";import{Ts as n}from"./dist-C_QZEaeX.js";import{i as r}from"./use-apply-config-theme-CBmHKD_B.js";import"./config-provider-
|
|
1
|
+
import{t as e}from"./compiler-runtime-BfE3aGVn.js";import{t}from"./terminal-telemetry-CWD0Kbui.js";import{Ts as n}from"./dist-C_QZEaeX.js";import{i as r}from"./use-apply-config-theme-CBmHKD_B.js";import"./config-provider--5n4V-Rz.js";var i=e();function a(){let e=(0,i.c)(3),{projectLocalConfig:t,projectLocalSynced:n}=r(),a=t?.terminal?.enabled??null,o;return e[0]!==n||e[1]!==a?(o={enabled:a,synced:n},e[0]=n,e[1]=a,e[2]=o):o=e[2],o}function o(){let e=(0,i.c)(2),{projectLocalBinding:a}=r();if(a===null)return null;let o;return e[0]===a?o=e[1]:(o=e=>{let r=a.patch({terminal:{enabled:e}});return r.ok&&e&&t(),r.ok?{ok:!0}:{ok:!1,error:n(r.error)}},e[0]=a,e[1]=o),o}export{o as n,a as t};
|