@inkeep/open-knowledge 0.87.2-beta.1 → 0.87.2-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/dist/THIRD_PARTY_NOTICES.md +1 -0
  2. package/dist/cli.mjs +75 -75
  3. package/dist/constants-B-8Aqlgv.mjs +1 -0
  4. package/dist/dist-BB-NSwQc.mjs +2214 -0
  5. package/dist/dist-BKGJO_91.mjs +1 -0
  6. package/dist/index.mjs +1 -1
  7. package/dist/{init-C34FkXTd.mjs → init-BEfaVdHK.mjs} +11 -11
  8. package/dist/init-lTZrPqKU.mjs +1 -0
  9. package/dist/{launch-json-removal-hdPm7JJ9.mjs → launch-json-removal-Bxpsu-nn.mjs} +1 -1
  10. package/dist/{loader-CpVD-p7P.mjs → loader-B5a5IpWH.mjs} +1 -1
  11. package/dist/loader-w531CFJ8.mjs +1 -0
  12. package/dist/{open-browser-Cv1yuEQw.mjs → open-browser-DWKagh4v.mjs} +1 -1
  13. package/dist/preview-C5SLH48t.mjs +1 -0
  14. package/dist/{preview-D1IEqXE0.mjs → preview-DTFtM-se.mjs} +1 -1
  15. package/dist/public/assets/{AccountSection-BKI8ful_.js → AccountSection-DOClRjaM.js} +1 -1
  16. package/dist/public/assets/{ActivityModeContent-Cs8zvxnL.js → ActivityModeContent-CDvWWrOI.js} +1 -1
  17. package/dist/public/assets/{AddPropertiesButton-CEOdUsGs.js → AddPropertiesButton-nscc-7JQ.js} +1 -1
  18. package/dist/public/assets/{AgentDiffPane-CzfUNzhW.js → AgentDiffPane-_i3KBB8d.js} +1 -1
  19. package/dist/public/assets/{AttachmentsSection-BAyVJFgf.js → AttachmentsSection-DBwBVB-Z.js} +1 -1
  20. package/dist/public/assets/{CodeMirrorPropInput-BbOfR2Hg.js → CodeMirrorPropInput-DJKSXk-t.js} +1 -1
  21. package/dist/public/assets/{ContentRulesSection-B6i1cLKg.js → ContentRulesSection-BfW_rEE9.js} +1 -1
  22. package/dist/public/assets/{DocumentContext-Ctu-HqT4.js → DocumentContext-BMd-lXiz.js} +1 -1
  23. package/dist/public/assets/{EditorModeToggle-BxpOZKiM.js → EditorModeToggle-CAIKFa-E.js} +1 -1
  24. package/dist/public/assets/{ExcalidrawDocEditor-CYiYdvF2.js → ExcalidrawDocEditor-mC6JGTD2.js} +1 -1
  25. package/dist/public/assets/FeedbackForm-BXMBn9VS.js +1 -0
  26. package/dist/public/assets/{ImportSkillDialog-HOR9EZ2f.js → ImportSkillDialog-CQuvLX7j.js} +1 -1
  27. package/dist/public/assets/{LinkPreviewsSection-BQvvaJUI.js → LinkPreviewsSection-NXgzC9Cy.js} +1 -1
  28. package/dist/public/assets/{LintConfigEditor-CWrXBDG_.js → LintConfigEditor-iQSJUUmj.js} +1 -1
  29. package/dist/public/assets/{LintingSection-BiPYwYIO.js → LintingSection-DpmJOwDr.js} +1 -1
  30. package/dist/public/assets/ManagedArtifactProperties-BJJPVWtT.js +1 -0
  31. package/dist/public/assets/{ManagedArtifactProperties-CadUWUsq.js → ManagedArtifactProperties-CxTCmF9h.js} +1 -1
  32. package/dist/public/assets/{MermaidDocEditor-BxFPCx7g.js → MermaidDocEditor-DZ4G08I8.js} +1 -1
  33. package/dist/public/assets/{NetworkAccessSection-C_JY6CML.js → NetworkAccessSection-DlWR0yMG.js} +1 -1
  34. package/dist/public/assets/{PropertyDisplayRow-CFACWxIE.js → PropertyDisplayRow-q8IwilBo.js} +1 -1
  35. package/dist/public/assets/{PublishToGitHubDialog-Qg9R2-X0.js → PublishToGitHubDialog-DhteT4XZ.js} +1 -1
  36. package/dist/public/assets/{SchemaConfigEditor-DEecND8S.js → SchemaConfigEditor-DhnwGFMR.js} +1 -1
  37. package/dist/public/assets/{SearchSection-C5h5t5Bm.js → SearchSection-D8YtOxN7.js} +1 -1
  38. package/dist/public/assets/{SessionsHost-DrGOAImZ.js → SessionsHost-Dr7me5i8.js} +2 -2
  39. package/dist/public/assets/{SettingsDialogBody-9HsCyl9q.js → SettingsDialogBody-BinOFj9C.js} +2 -2
  40. package/dist/public/assets/{ShareReceiveMissDialog-N7vak44i.js → ShareReceiveMissDialog-CDI6TAsz.js} +1 -1
  41. package/dist/public/assets/{SkillToolbarControls-J3FRPp-3.js → SkillToolbarControls-Cmb2MZkZ.js} +1 -1
  42. package/dist/public/assets/{SourceEditor-DijD2qin.js → SourceEditor-MATUSMmn.js} +1 -1
  43. package/dist/public/assets/{SyncSection-TX1SH2IZ.js → SyncSection-C9oBLDeR.js} +1 -1
  44. package/dist/public/assets/{SyncStatusBadge-i2xTrKQt.js → SyncStatusBadge-D2dy63F2.js} +1 -1
  45. package/dist/public/assets/{TerminalSection-DIDjGimp.js → TerminalSection-BoHFqx6c.js} +1 -1
  46. package/dist/public/assets/{TerminalWindowApp-ZDSwFCcn.js → TerminalWindowApp-C8b7XwRk.js} +1 -1
  47. package/dist/public/assets/{TextDocEditor-BjdRabZO.js → TextDocEditor-cQwRUK3S.js} +1 -1
  48. package/dist/public/assets/ThreadView--7-PU1z1.js +28 -0
  49. package/dist/public/assets/{TimelineDiffPane-KJSvQLix.js → TimelineDiffPane-KQHiw3o7.js} +1 -1
  50. package/dist/public/assets/{client-version-CEUebx--.js → client-version-BRNSZ3O-.js} +1 -1
  51. package/dist/public/assets/{comment-chips-D8H8ksVb.js → comment-chips-CCLwigP7.js} +1 -1
  52. package/dist/public/assets/{config-provider-QVZqDwsb.js → config-provider-BRcEwJSU.js} +1 -1
  53. package/dist/public/assets/{doc-undo-manager-CzYtyHUd.js → doc-undo-manager-BrU5Q-vN.js} +1 -1
  54. package/dist/public/assets/{index-D2cACSaG.js → index-CG-4gd5l.js} +7 -7
  55. package/dist/public/assets/{lint-plugins-CE1v_De9.js → lint-plugins-CxeR8Pp_.js} +1 -1
  56. package/dist/public/assets/{pending-receive-nav-store-T3ZXK0s-.js → pending-receive-nav-store-CXD0vhhT.js} +1 -1
  57. package/dist/public/assets/{preferred-session-events-D2WKSTxQ.js → preferred-session-events-Bg_PDMhm.js} +1 -1
  58. package/dist/public/assets/progress-BoLcXQDW.js +10 -0
  59. package/dist/public/assets/{selection-context-DFEuubLf.js → selection-context-CVW8s6Mt.js} +1 -1
  60. package/dist/public/assets/sign-in-terminal-events-gIutiXLp.js +1 -0
  61. package/dist/public/assets/{src-C8wJZTqQ.js → src-DMWRRyM9.js} +1 -1
  62. package/dist/public/assets/{telemetry-impl-crprFKOe.js → telemetry-impl-CnNwQN7y.js} +1 -1
  63. package/dist/public/assets/{telemetry-startup-7Tdxo-4u.js → telemetry-startup-DqmMds7E.js} +1 -1
  64. package/dist/public/assets/{typing-burst-detector-DdtI04xk.js → typing-burst-detector--LDZvgnH.js} +1 -1
  65. package/dist/public/assets/{use-activity-panel-2Bs8Bhwk.js → use-activity-panel-w-kt6C96.js} +1 -1
  66. package/dist/public/assets/{use-open-skill-B4p8VMLX.js → use-open-skill-Vb4tE_Ch.js} +1 -1
  67. package/dist/public/assets/{use-terminal-enabled-DiTNDooB.js → use-terminal-enabled-DqK9WYaA.js} +1 -1
  68. package/dist/public/assets/{use-timeline-entry-diff-JtbYOyhK.js → use-timeline-entry-diff-CBknBBrI.js} +1 -1
  69. package/dist/public/index.html +19 -19
  70. package/dist/{registry-probes-BiySrvm_.mjs → registry-probes-myhbKv3_.mjs} +3 -3
  71. package/dist/{removal-file-path-DUFtjkkZ.mjs → removal-file-path-B0Iz_qz7.mjs} +1 -1
  72. package/dist/{repair-launch-json-B3uRu9qh.mjs → repair-launch-json-BBmodLLT.mjs} +1 -1
  73. package/dist/{repair-mcp-configs-CYq7vfOM.mjs → repair-mcp-configs-D2IDN0x_.mjs} +1 -1
  74. package/dist/src-BDyELaTj.mjs +16 -0
  75. package/dist/src-D_HTv8IX.mjs +1 -0
  76. package/dist/start-C7g4_-_I.mjs +1 -0
  77. package/dist/{start-CaZG06fC.mjs → start-D5HoK5o6.mjs} +3 -3
  78. package/package.json +4 -4
  79. package/dist/constants-DwtiG-TC.mjs +0 -1
  80. package/dist/dist-B_I6SNFI.mjs +0 -1
  81. package/dist/dist-WFhah2YJ.mjs +0 -2214
  82. package/dist/init-Dg1lyv-G.mjs +0 -1
  83. package/dist/loader-H2SukW6-.mjs +0 -1
  84. package/dist/preview-DDxcD2r1.mjs +0 -1
  85. package/dist/public/assets/FeedbackForm-BJ2Oe5Na.js +0 -1
  86. package/dist/public/assets/ManagedArtifactProperties-CrGTWjB7.js +0 -1
  87. package/dist/public/assets/ThreadView-DJRjCobn.js +0 -28
  88. package/dist/public/assets/progress-CMZzr1ER.js +0 -10
  89. package/dist/public/assets/sign-in-terminal-events-D1Wi4Xw6.js +0 -1
  90. package/dist/src-CPB_oYOe.mjs +0 -16
  91. package/dist/src-Cee3yPhD.mjs +0 -1
  92. package/dist/start-D4vJF_D3.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{i as o,n as s,t as c}from"./tooltip-Bz6z4_se.js";import{n as l,r as u,t as d}from"./collapsible-BKbszYZV.js";import{i as f,n as p,o as m,s as h,t as g}from"./select-pACXgFe2.js";import{t as _}from"./button-DzgjsZzC.js";import{n as v}from"./dist-BGzUo_18.js";import{t as y}from"./dist-C_FzPxEX2.js";import{n as b}from"./config-errors-DDAH9fqy.js";import{v as x}from"./documents-events-ddyuXdQl.js";import{f as S,h as C}from"./share-D-LUU2aX-B7Yg0G_m.js";import{i as w}from"./use-apply-config-theme-CYFG76sS.js";import{t as T}from"./createLucideIcon-DdBzwsHe.js";import{n as E,t as D}from"./arrow-up-BGHhPj4y.js";import{t as ee}from"./arrow-up-right-nJaICi16.js";import{t as O}from"./chevron-right-Bofu4lib.js";import{n as k,t as te}from"./settings-2-DoBlNQMk.js";import{t as A}from"./git-merge-VDBzSZBV.js";import{t as j}from"./spinner-Bx8xD6f8.js";import{t as M}from"./refresh-cw-CC7UZEnZ.js";import{t as N}from"./terminal-Cpb4l1oH.js";import{t as P}from"./triangle-alert-BXrUEeRU.js";import{t as F}from"./badge-BIamhtRR.js";import{a as I,c as ne,i as re,n as L,o as ie,r as ae,s as oe,t as se}from"./dialog-BJEjKJjL.js";import{a as ce,u as R}from"./use-settings-route-Bj-m9X61.js";import{c as le,h as ue,l as de}from"./doc-hash-BJkweiX9.js";import{a as fe,i as z,r as pe,t as me}from"./popover-Mb1GgB61.js";import{n as he}from"./use-conflicts-CIjDyM9c.js";import"./config-provider-QVZqDwsb.js";import{n as ge}from"./use-git-sync-status-PkMYmN4D.js";import{t as _e}from"./reveal-editor-ChTC5Vss.js";import{n as B,t as ve}from"./DisclosureWarning-CYHeueUe.js";import{t as ye}from"./terminal-command-events-h-p66odT.js";var V=T(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),be=T(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),xe=T(`cloud-alert`,[[`path`,{d:`M12 12v4`,key:`tww15h`}],[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.128 16.949A7 7 0 1 1 15.71 8h1.79a1 1 0 0 1 0 9h-1.642`,key:`1namsd`}]]),Se=T(`cloud-off`,[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`,key:`1uxyv8`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`,key:`99tcn7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),H=T(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),Ce=T(`git-commit-vertical`,[[`path`,{d:`M12 3v6`,key:`1holv5`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`M12 15v6`,key:`a9ows0`}]]),we=T(`laptop`,[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]),Te=T(`log-in`,[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]),Ee=T(`user-cog`,[[`path`,{d:`M10 15H6a4 4 0 0 0-4 4v2`,key:`1nfge6`}],[`path`,{d:`m14.305 16.53.923-.382`,key:`1itpsq`}],[`path`,{d:`m15.228 13.852-.923-.383`,key:`eplpkm`}],[`path`,{d:`m16.852 12.228-.383-.923`,key:`13v3q0`}],[`path`,{d:`m16.852 17.772-.383.924`,key:`1i8mnm`}],[`path`,{d:`m19.148 12.228.383-.923`,key:`1q8j1v`}],[`path`,{d:`m19.53 18.696-.382-.924`,key:`vk1qj3`}],[`path`,{d:`m20.772 13.852.924-.383`,key:`n880s0`}],[`path`,{d:`m20.772 16.148.924.383`,key:`1g6xey`}],[`circle`,{cx:`18`,cy:`15`,r:`3`,key:`gjjjvw`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),U=a(),W=e(n(),1);function De(){let e=(0,U.c)(2),{projectLocalBinding:t,projectLocalSynced:n}=w();if(t===null||!n)return null;let r;return e[0]===t?r=e[1]:(r=e=>{let n=e?`full`:`off`,r=t.patch({autoSync:{mode:n,enabled:e}});return r.ok?{ok:!0}:{ok:!1,error:b(r.error)}},e[0]=t,e[1]=r),r}function Oe(){let e=(0,U.c)(2),{projectLocalBinding:t,projectLocalSynced:n}=w();if(t===null||!n)return null;let r;return e[0]===t?r=e[1]:(r=e=>{let n=t.patch({autoSync:{mode:e,enabled:null}});return n.ok?{ok:!0}:{ok:!1,error:b(n.error)}},e[0]=t,e[1]=r),r}function ke(){let e=(0,U.c)(2),{projectBinding:t,projectSynced:n}=w();if(t===null||!n)return null;let r;return e[0]===t?r=e[1]:(r=e=>{let n=t.patch({autoSync:{default:e}});return n.ok?{ok:!0}:{ok:!1,error:b(n.error)}},e[0]=t,e[1]=r),r}function Ae(){let e=(0,U.c)(2),{projectLocalBinding:t,projectLocalSynced:n}=w();if(t===null||!n)return null;let r;return e[0]===t?r=e[1]:(r=e=>{let n=t.patch({autoSync:e});return n.ok?{ok:!0}:{ok:!1,error:b(n.error)}},e[0]=t,e[1]=r),r}function je(e,t){let n=(0,U.c)(12),{_:r}=i(),[a,o]=(0,W.useState)(!1),s;n[0]!==r||n[1]!==e?(s=function(t){if(e===null)return v.info(r({id:`fiMNLl`}),{id:`sync-settings-not-ready`}),!1;let n=e(t);if(!n.ok){console.error(`[sync] toggle failed:`,n.error);let e=n.error;return v.error(r(t?{id:`04RA0-`,values:{detail:e}}:{id:`qjHMHf`,values:{detail:e}})),!1}return!0},n[0]=r,n[1]=e,n[2]=s):s=n[2];let c=s,l;n[3]===c?l=n[4]:(l=function(e){if(e){o(!0);return}c(!1)},n[3]=c,n[4]=l);let u=l,d;n[5]!==c||n[6]!==t?(d=function(){c(!0)&&(o(!1),t?.onEnabled?.())},n[5]=c,n[6]=t,n[7]=d):d=n[7];let f=d,p;return n[8]!==a||n[9]!==f||n[10]!==u?(p={confirmOpen:a,setConfirmOpen:o,onToggleRequest:u,onConfirm:f},n[8]=a,n[9]=f,n[10]=u,n[11]=p):p=n[11],p}function Me(e,t,n){let r=(0,U.c)(22),{_:a}=i(),[o,s]=(0,W.useState)(!1),[c,l]=(0,W.useState)(null),u;r[0]!==a||r[1]!==n||r[2]!==e?(u=function(t){if(e===null)return v.info(a({id:`fiMNLl`}),{id:`sync-settings-not-ready`}),!1;let r=e(t);if(!r.ok){console.error(`[sync] mode change failed:`,r.error);let e=r.error;return v.error(a({id:`nOEDQs`,values:{detail:e}})),!1}return n?.onApplied?.(t),!0},r[0]=a,r[1]=n,r[2]=e,r[3]=u):u=r[3];let d=u,f;r[4]!==d||r[5]!==t?(f=function(e){if(e!==t){if(e===`off`){d(`off`);return}l(e),s(!0)}},r[4]=d,r[5]=t,r[6]=f):f=r[6];let p=f,m;r[7]===d?m=r[8]:(m=function(){return d(`off`)},r[7]=d,r[8]=m);let h=m,g;r[9]!==d||r[10]!==t?(g=function(){return d(t)},r[9]=d,r[10]=t,r[11]=g):g=r[11];let _=g,y;r[12]!==d||r[13]!==c?(y=function(){c!==null&&d(c)&&s(!1)},r[12]=d,r[13]=c,r[14]=y):y=r[14];let b=y,x;return r[15]!==o||r[16]!==b||r[17]!==_||r[18]!==p||r[19]!==h||r[20]!==c?(x={confirmOpen:o,setConfirmOpen:s,pendingMode:c,onModeSelect:p,onTurnOff:h,onKeepCurrent:_,onConfirm:b},r[15]=o,r[16]=b,r[17]=_,r[18]=p,r[19]=h,r[20]=c,r[21]=x):x=r[21],x}function Ne(){let e=(0,U.c)(2),{projectLocalBinding:t,projectLocalSynced:n}=w();if(t===null||!n)return null;let r;return e[0]===t?r=e[1]:(r=e=>{let n=t.patch({autoSync:e});return n.ok?{ok:!0}:{ok:!1,error:b(n.error)}},e[0]=t,e[1]=r),r}function Pe(e,t,n){let r=(0,U.c)(19),{_:a}=i(),o=Ne(),[s,c]=(0,W.useState)(!1),[l,u]=(0,W.useState)(null),d;r[0]!==e||r[1]!==t?(d=C(e)??t,r[0]=e,r[1]=t,r[2]=d):d=r[2];let f=d,p;r[3]!==a||r[4]!==o?(p=function(e){if(o===null)return v.info(a({id:`fiMNLl`}),{id:`sync-settings-not-ready`}),!1;let t=o(e);if(!t.ok){console.error(`[sync] badge control failed:`,t.error);let e=t.error;return v.error(a({id:`ZVOhXM`,values:{detail:e}})),!1}return!0},r[3]=a,r[4]=o,r[5]=p):p=r[5];let m=p,h;r[6]!==m||r[7]!==f?(h=function(e){if(e!==f){if(e===`off`){m({mode:`off`,enabled:null,resumeMode:null});return}u(e),c(!0)}},r[6]=m,r[7]=f,r[8]=h):h=r[8];let g=h,_;r[9]!==m||r[10]!==l?(_=function(){l!==null&&m({mode:l,enabled:null,resumeMode:null})&&(c(!1),u(null))},r[9]=m,r[10]=l,r[11]=_):_=r[11];let y=_,b=l===`follow`?n:0,x;return r[12]!==s||r[13]!==f||r[14]!==y||r[15]!==g||r[16]!==l||r[17]!==b?(x={mode:f,confirmOpen:s,setConfirmOpen:c,pendingMode:l,strandedCommitCount:b,onModeSelect:g,onConfirm:y},r[12]=s,r[13]=f,r[14]=y,r[15]=g,r[16]=l,r[17]=b,r[18]=x):x=r[18],x}async function Fe(e){let t=await fetch(`/api/sync/trigger`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({op:e})});if(!t.ok)throw Error(`sync trigger failed: ${t.status}`)}var Ie=5e3,Le=15e3,Re=3e4,ze=0;function Be(){let e=Date.now();e-ze<Re||(ze=e,Fe(`fetch`).catch(()=>{ze===e&&(ze=0)}))}async function Ve(e){try{let t=await fetch(`/api/git/worktree-status`,{signal:e});if(!t.ok)return console.warn(`[sync] worktree status read failed: http`,t.status),{kind:`failed`,reason:`http`};let n=await t.json();return n.readable===!1?{kind:`unreadable`}:{kind:`ok`,status:n}}catch(t){return e.aborted?{kind:`failed`,reason:`aborted`}:(console.warn(`[sync] worktree status read failed: network`,t instanceof Error?t.message:t),{kind:`failed`,reason:`network`})}}var He={status:null,unreadable:!1,stale:!1,lastReadAt:null};function Ue(e){let t=(0,U.c)(9),[n,r]=(0,W.useState)(He),i,a;t[0]===e?(i=t[1],a=t[2]):(i=()=>{if(!e)return;let t=!1,n=!1,i=!1,a=null;function o(){if(n){i=!0;return}n=!0;let e=new AbortController;a=e;let s=setTimeout(()=>e.abort(),Le);Ve(e.signal).then(e=>{if(!t){if(e.kind===`ok`){r({status:e.status,unreadable:!1,stale:!1,lastReadAt:Date.now()});return}if(e.kind===`unreadable`){r(Ge);return}r(We)}}).finally(()=>{clearTimeout(s),a===e&&(a=null),n=!1,i&&!t&&(i=!1,o())})}o(),Be();let s=setInterval(o,Ie),c=x(e=>{e.includes(`sync-status`)&&o()});return()=>{t=!0,clearInterval(s),c(),a?.abort()}},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,W.useEffect)(i,a);let o=e&&n.status===null&&!n.unreadable,s;return t[3]!==n.lastReadAt||t[4]!==n.stale||t[5]!==n.status||t[6]!==n.unreadable||t[7]!==o?(s={status:n.status,loading:o,unreadable:n.unreadable,stale:n.stale,lastReadAt:n.lastReadAt},t[3]=n.lastReadAt,t[4]=n.stale,t[5]=n.status,t[6]=n.unreadable,t[7]=o,t[8]=s):s=t[8],s}function We(e){return e.status===null?e.unreadable?e:{...e,unreadable:!0,stale:!1}:e.unreadable||e.stale?e:{...e,stale:!0}}function Ge(e){return{...e,unreadable:!0,stale:!1}}function Ke(e){return e.syncMode===void 0?e.syncEnabled?`full`:`off`:e.syncMode}var G=t();function K(e){let t=(0,U.c)(4),{variant:n}=e;if((n===void 0?`full`:n)===`follow`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(ne,{children:(0,G.jsx)(r,{id:`W7mERj`})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,G.jsxs)(G.Fragment,{children:[e,(0,G.jsx)(I,{children:(0,G.jsx)(r,{id:`KmVekT`})})]}),t[1]=n):n=t[1],n}let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.jsx)(ne,{children:(0,G.jsx)(r,{id:`Uo2Rj7`})}),t[2]=i):i=t[2];let a;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,G.jsxs)(G.Fragment,{children:[i,(0,G.jsx)(I,{children:(0,G.jsx)(r,{id:`n6hXUm`})})]}),t[3]=a):a=t[3],a}function q(e){let t=(0,U.c)(2),{variant:n}=e,r=n===void 0?`full`:n,i;return t[0]===r?i=t[1]:(i=(0,G.jsx)(ve,{children:r===`follow`?(0,G.jsx)(Je,{}):(0,G.jsx)(qe,{})}),t[0]=r,t[1]=i),i}function qe(){let e=(0,U.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)(B,{icon:(0,G.jsx)(be,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,G.jsx)(r,{id:`cdmk8A`}),body:(0,G.jsx)(r,{id:`YaeyFh`})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,G.jsx)(B,{icon:(0,G.jsx)(Ce,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,G.jsx)(r,{id:`9i21pa`}),body:(0,G.jsx)(r,{id:`KIIamL`})}),e[1]=n):n=e[1];let i;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.jsxs)(G.Fragment,{children:[t,n,(0,G.jsx)(B,{icon:(0,G.jsx)(k,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,G.jsx)(r,{id:`8cpeU3`}),body:(0,G.jsx)(r,{id:`DELNQk`})})]}),e[2]=i):i=e[2],i}function Je(){let e=(0,U.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)(B,{icon:(0,G.jsx)(V,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,G.jsx)(r,{id:`0xnQ_X`}),body:(0,G.jsx)(r,{id:`aCoQfY`})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,G.jsx)(B,{icon:(0,G.jsx)(we,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,G.jsx)(r,{id:`5rnB76`}),body:(0,G.jsx)(r,{id:`kXNv8P`})}),e[1]=n):n=e[1];let i;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.jsxs)(G.Fragment,{children:[t,n,(0,G.jsx)(B,{icon:(0,G.jsx)(A,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,G.jsx)(r,{id:`oBK5fD`}),body:(0,G.jsx)(r,{id:`8Wav8y`})})]}),e[2]=i):i=e[2],i}function Ye(e){let t=(0,U.c)(24),{open:n,onOpenChange:i,onConfirm:a,variant:o,strandedCommitCount:s}=e,c=o===void 0?`full`:o,l=s===void 0?0:s,u=c===`follow`&&l>0,d;t[0]===c?d=t[1]:(d=(0,G.jsx)(oe,{children:(0,G.jsx)(K,{variant:c})}),t[0]=c,t[1]=d);let f;t[2]===c?f=t[3]:(f=(0,G.jsx)(q,{variant:c}),t[2]=c,t[3]=f);let p;t[4]!==u||t[5]!==l?(p=u&&(0,G.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:(0,G.jsx)(r,{id:`caw8gO`,values:{strandedCommitCount:l}})}),t[4]=u,t[5]=l,t[6]=p):p=t[6];let m;t[7]!==f||t[8]!==p?(m=(0,G.jsxs)(L,{children:[f,p]}),t[7]=f,t[8]=p,t[9]=m):m=t[9];let h;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,G.jsx)(ae,{asChild:!0,children:(0,G.jsx)(_,{variant:`outline`,children:(0,G.jsx)(r,{id:`dEgA5A`})})}),t[10]=h):h=t[10];let g;t[11]===c?g=t[12]:(g=c===`follow`?(0,G.jsx)(r,{id:`jTUxaN`}):(0,G.jsx)(r,{id:`pPiV8s`}),t[11]=c,t[12]=g);let v;t[13]!==a||t[14]!==g?(v=(0,G.jsxs)(ie,{children:[h,(0,G.jsx)(_,{onClick:a,children:g})]}),t[13]=a,t[14]=g,t[15]=v):v=t[15];let y;t[16]!==d||t[17]!==m||t[18]!==v?(y=(0,G.jsxs)(re,{className:`sm:max-w-lg`,children:[d,m,v]}),t[16]=d,t[17]=m,t[18]=v,t[19]=y):y=t[19];let b;return t[20]!==i||t[21]!==n||t[22]!==y?(b=(0,G.jsx)(se,{open:n,onOpenChange:i,children:y}),t[20]=i,t[21]=n,t[22]=y,t[23]=b):b=t[23],b}async function Xe(e){let t=await fetch(`/api/sync/resolve-blocking`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:e})});if(!t.ok)throw Error(`sync resolve-blocking failed: ${t.status}`)}function Ze(){return typeof window<`u`&&window.okDesktop!=null}function Qe(e){let t=(0,U.c)(23),{paths:n}=e,[i,a]=(0,W.useState)(null),[o,s]=(0,W.useState)(!1);if(n.length===0)return null;let c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=async function(e){a(e),s(!1);try{await Xe(e),a(null)}catch{s(!0),a(null)}},t[0]=c):c=t[0];let l=c,u=i!==null,d;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,G.jsx)(`span`,{id:`sync-blocking-heading`,className:`text-xs font-medium text-foreground`,children:(0,G.jsx)(r,{id:`sdvHp3`})}),t[1]=d):d=t[1];let f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,G.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[d,(0,G.jsx)(`span`,{className:`text-2xs text-muted-foreground`,children:(0,G.jsx)(r,{id:`H4doZt`})})]}),t[2]=f):f=t[2];let p;t[3]===n?p=t[4]:(p=n.map(et),t[3]=n,t[4]=p);let m;t[5]===p?m=t[6]:(m=(0,G.jsx)(`ul`,{"aria-labelledby":`sync-blocking-heading`,className:`flex max-h-28 flex-col gap-1 overflow-y-auto overscroll-contain`,"data-testid":`sync-blocking-list`,children:p}),t[5]=p,t[6]=m);let h;t[7]===o?h=t[8]:(h=o&&(0,G.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,"data-testid":`sync-blocking-error`,children:(0,G.jsx)(r,{id:`FsEXax`})}),t[7]=o,t[8]=h);let g;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>void l(`commit`),t[9]=g):g=t[9];let v;t[10]===i?v=t[11]:(v=i===`commit`&&(0,G.jsx)(j,{"aria-hidden":`true`,"data-icon":`inline-start`}),t[10]=i,t[11]=v);let y;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,G.jsx)(r,{id:`N7Lau6`}),t[12]=y):y=t[12];let b;t[13]!==u||t[14]!==v?(b=(0,G.jsxs)(_,{size:`xs`,disabled:u,onClick:g,"data-testid":`sync-blocking-commit`,children:[v,y]}),t[13]=u,t[14]=v,t[15]=b):b=t[15];let x;t[16]===u?x=t[17]:(x=Ze()&&(0,G.jsxs)(_,{variant:`link-muted`,size:`xs`,className:`self-start p-0`,disabled:u,onClick:$e,"data-testid":`sync-blocking-terminal`,children:[(0,G.jsx)(N,{"data-icon":`inline-start`}),(0,G.jsx)(r,{id:`6EoD0z`})]}),t[16]=u,t[17]=x);let S;return t[18]!==b||t[19]!==x||t[20]!==m||t[21]!==h?(S=(0,G.jsxs)(`div`,{className:`flex flex-col gap-2 border-t pt-3`,children:[f,m,h,b,x]}),t[18]=b,t[19]=x,t[20]=m,t[21]=h,t[22]=S):S=t[22],S}function $e(){return ye(`git-status`)}function et(e){return(0,G.jsx)(`li`,{title:e,className:`min-w-0 truncate font-mono text-2xs text-foreground`,children:e},e)}function J(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function tt(e){return e===``?[]:e.split(`/`)}function nt(e){if(e.length===0)return``;let t=tt(J(e[0]));for(let n of e.slice(1)){let e=tt(J(n)),r=0;for(;r<t.length&&r<e.length&&t[r]===e[r];)r++;if(t=t.slice(0,r),t.length===0)break}return t.join(`/`)}function Y(e,t){return e===``?t:t.slice(e.length+1)}function rt(e,t=8){if(e.length===0)return{prefix:``,groups:[],loose:[]};if(e.length===1)return{prefix:``,groups:[],loose:[{entry:e[0],label:e[0].path}]};let n=nt(e.map(e=>e.path)),r=e.map(e=>{let t=Y(n,e.path);return{entry:e,rel:t,key:J(t)}}),i=()=>new Set(r.map(e=>e.key));for(;i().size>t;){let e=Math.max(...r.map(e=>tt(e.key).length));if(e===0)break;for(let t of r)tt(t.key).length===e&&(t.key=J(t.key))}let a=new Map;for(let{entry:e,rel:t,key:n}of r){let r=a.get(n)??[];r.push({entry:e,label:n===``?t:t.slice(n.length+1)}),a.set(n,r)}let o=[],s=[];for(let[e,t]of a)if(e===``||t.length===1)for(let e of t)s.push({entry:e.entry,label:Y(n,e.entry.path)});else o.push({dir:e,rows:t});return o.sort((e,t)=>t.rows.length-e.rows.length||e.dir.localeCompare(t.dir)),s.sort((e,t)=>e.entry.path.localeCompare(t.entry.path)),{prefix:n,groups:o,loose:s}}function it(e=`sync`,t){Fe(e).catch(e=>{console.warn(`[sync-badge] manual sync trigger failed`,e instanceof Error?e.message:e),t?.()})}function at(e){typeof window>`u`||(_e(),ue(window.location.hash,e)||(window.location.hash=e))}function ot(e){return e.kind===`doc`?de(e.docName):le(e.path)}var st=3e4;function X(e,t,n){let r=n-t;return r<6e4?e({id:`xOTzt5`}):r<36e5?e({id:`_rP3HI`,values:{minutes:Math.floor(r/6e4)}}):r<864e5?e({id:`nYeBmY`,values:{hours:Math.floor(r/36e5)}}):new Date(t).toLocaleDateString()}function Z(e,t){return X(e,new Date(t).getTime(),Date.now())}function ct(){let e=(0,U.c)(2),[t,n]=(0,W.useState)(lt),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=setInterval(()=>n(Date.now()),st);return()=>clearInterval(e)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,W.useEffect)(r,i),t}function lt(){return Date.now()}function Q(e){return e.syncMode===`follow`}var ut=[`git-operation-in-progress`,`unsafe-incoming-symlinks`];function $(e){return ut.includes(e)}function dt(e){return e.state===`idle`&&e.conflictCount>0?`conflict`:(e.state===`idle`||e.state===`offline`)&&$(e.pausedReason)?`disabled`:e.state}function ft(e){let t=(0,U.c)(23),{status:n,size:r}=e,i=r===void 0?`size-3.5`:r;switch(dt(n)){case`dormant`:{let e=`${i} text-muted-foreground`,n;return t[0]===e?n=t[1]:(n=(0,G.jsx)(H,{className:e}),t[0]=e,t[1]=n),n}case`idle`:{if(n.ahead>0||n.behind>0){let e=`${i} text-muted-foreground`,n;return t[2]===e?n=t[3]:(n=(0,G.jsx)(M,{className:e}),t[2]=e,t[3]=n),n}let e=`${i} text-muted-foreground`,r;return t[4]===e?r=t[5]:(r=(0,G.jsx)(H,{className:e}),t[4]=e,t[5]=r),r}case`fetching`:case`pulling`:case`pushing`:{let e=`${i} text-muted-foreground`,n;return t[6]===e?n=t[7]:(n=(0,G.jsx)(j,{"aria-hidden":`true`,icon:M,className:e}),t[6]=e,t[7]=n),n}case`conflict`:{let e=`${i} text-warning`,n;return t[8]===e?n=t[9]:(n=(0,G.jsx)(P,{className:e}),t[8]=e,t[9]=n),n}case`offline`:{let e=`${i} text-muted-foreground`,n;return t[10]===e?n=t[11]:(n=(0,G.jsx)(Se,{className:e}),t[10]=e,t[11]=n),n}case`auth-error`:{let e;return t[12]!==i||t[13]!==n?(e=Ot(n)?(0,G.jsx)(xe,{className:`${i} text-destructive`}):(0,G.jsx)(Te,{className:`${i} text-destructive`}),t[12]=i,t[13]=n,t[14]=e):e=t[14],e}case`disabled`:{if(n.pausedReason){let e=`${i} text-warning`,n;return t[15]===e?n=t[16]:(n=(0,G.jsx)(P,{className:e}),t[15]=e,t[16]=n),n}if(n.ahead>0||n.behind>0){let e=`${i} text-muted-foreground`,n;return t[17]===e?n=t[18]:(n=(0,G.jsx)(M,{className:e}),t[17]=e,t[18]=n),n}let e=`${i} text-muted-foreground`,r;return t[19]===e?r=t[20]:(r=(0,G.jsx)(H,{className:e}),t[19]=e,t[20]=r),r}default:{let e=`${i} text-muted-foreground`,n;return t[21]===e?n=t[22]:(n=(0,G.jsx)(H,{className:e}),t[21]=e,t[22]=n),n}}}function pt(e){switch(dt(e)){case`idle`:return!Q(e)&&e.ahead>0?`↑${e.ahead}`:e.behind>0?`↓${e.behind}`:``;case`fetching`:case`pulling`:case`pushing`:return``;case`conflict`:return e.conflictCount>0?`${e.conflictCount}`:``;case`offline`:return``;case`auth-error`:return``;default:return``}}function mt(e){let t=Q(e),n=dt(e);switch(n){case`dormant`:return y._({id:`RmBY0A`});case`idle`:return t?y._({id:`j5CWO4`}):y._({id:`N2FcBE`});case`fetching`:return t?y._({id:`7IsvrP`}):y._({id:`Wgmlsw`});case`pulling`:return t?y._({id:`JL3si7`}):y._({id:`4uNLmk`});case`pushing`:return y._({id:`iycx_A`});case`conflict`:return y._({id:`IInnZo`});case`offline`:return y._({id:`6Aih4U`});case`auth-error`:return y._({id:`mHVPm5`});case`disabled`:return e.pausedReason?y._({id:`U6wmNc`}):y._({id:`BWTzAb`});default:return n}}var ht=[`git-index-locked`],gt={"git-index-locked":{id:`sOcMdy`},"git-operation-in-progress":{id:`mJTr6D`},"external-changes-pending":{id:`W9_Bub`},"dirty-tree":{id:`a5Gha5`},"non-content-merge-failure":{id:`sIxSSP`},"detached-head":{id:`uQNW00`},"diverged-local-commits":{id:`LQsCPn`},"auth-error":{id:`mHVPm5`},"protected-branch":{id:`8fc_3j`},"no-push-permission":{id:`EiVgl5`},"no-commits-yet":{id:`-ZVU5v`},"unsafe-incoming-symlinks":{id:`8qsUJv`}};function _t(e){return Object.hasOwn(gt,e)}function vt(e,t){return _t(t)?e(gt[t]):t}function yt(e){return ht.includes(e)}function bt(e){throw Error(`Unhandled node-rendered paused reason: ${String(e)}`)}function xt(e){let t=(0,U.c)(3),{reason:n}=e;switch(n){case`git-index-locked`:{let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(r,{id:`Qca--K`,components:{0:(0,G.jsx)(`span`,{dir:`ltr`,className:`font-mono`})}}),t[0]=e):e=t[0],e}default:{let e;return t[1]===n?e=t[2]:(e=bt(n),t[1]=n,t[2]=e),e}}}function St(e){let t=(0,U.c)(4),{paths:n}=e;if(n===void 0||n.length===0)return null;let r;t[0]===n?r=t[1]:(r=n.map(Ct),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,G.jsx)(`ul`,{className:`flex max-h-28 flex-col gap-1 overflow-y-auto overscroll-contain`,"data-testid":`sync-refused-symlinks`,children:r}),t[2]=r,t[3]=i),i}function Ct(e){return(0,G.jsx)(`li`,{title:e,dir:`ltr`,className:`min-w-0 truncate font-mono text-2xs text-foreground`,children:e},e)}function wt(e){let t=(0,U.c)(7),{reason:n}=e,{_:r}=i();if(yt(n)){let e;return t[0]===n?e=t[1]:(e=(0,G.jsx)(xt,{reason:n}),t[0]=n,t[1]=e),e}let a;t[2]!==r||t[3]!==n?(a=vt(r,n),t[2]=r,t[3]=n,t[4]=a):a=t[4];let o;return t[5]===a?o=t[6]:(o=(0,G.jsx)(G.Fragment,{children:a}),t[5]=a,t[6]=o),o}function Tt(e,t){let n=[];switch(e){case`not-authenticated`:n.push(y._({id:`ycIX5i`}));break;case`no-collaborator`:n.push(y._({id:`EiVgl5`}));break;case`private-no-access`:n.push(y._({id:`07gHun`}));break;case`repo-not-found`:n.push(y._({id:`uksqrP`}));break;default:n.push(y._({id:`EiVgl5`}))}return n.push(...Et(t)),n}function Et(e){let t=[];if(e?.resolvedLogin){let n=e.resolvedLogin;t.push(y._({id:`ZKVuLY`,values:{login:n}}))}return e?.declaredLogin&&t.push(Dt(e.declaredLogin,e.declaredSource)),t}function Dt(e,t){switch(t){case`remote-url`:return y._({id:`CMd-g-`,values:{declaredLogin:e}});case`credential-config`:return y._({id:`akOe4q`,values:{declaredLogin:e}});default:return y._({id:`GBEqoP`,values:{declaredLogin:e}})}}function Ot(e){return e.pushErrorCode===`auth-not-found-as-identity`||e.pullErrorCode===`auth-not-found-as-identity`}function kt(e){return e?.pausedReason===`auth-error`&&Ot(e)}function At(e){return e?.checkStatus===`denied`&&e.deniedReason===`not-authenticated`}function jt(e){return typeof e?.webUrl==`string`}function Mt(e){return e!=null&&!jt(e)}function Nt(e){return e?.transport===void 0||e.transport===`https`}function Pt(e,t){switch(e){case`auth-401`:return t?y._({id:`-Qw-1t`}):y._({id:`LVWA9A`});case`auth-scope-mismatch`:return t?y._({id:`Zue_jx`}):y._({id:`yLyiQV`});case`auth-no-credential`:return t?y._({id:`uCaIdy`}):y._({id:`xJ7qrb`});default:return null}}function Ft(e,t){let n=Pt(e,t);if(n!==null)return n;switch(e){case`auth-403`:return y._({id:`EiVgl5`});case`semantic-protected-branch`:return y._({id:`T0OVm7`});case`auth-not-found-as-identity`:return y._({id:`jRsjlF`});default:return y._({id:`1AumWo`})}}function It(e,t){let n=Pt(e,t);if(n!==null)return n;switch(e){case`auth-403`:return y._({id:`RgbKEe`});case`auth-not-found-as-identity`:return y._({id:`jRsjlF`});default:return y._({id:`jZ_E5M`})}}function Lt(e,t){let n=Pt(e,t);if(n!==null)return n;switch(e){case`auth-403`:return y._({id:`RgbKEe`});case`semantic-protected-branch`:return y._({id:`T0OVm7`});case`auth-not-found-as-identity`:return y._({id:`jRsjlF`});default:return y._({id:`cUk6TF`})}}function Rt(e){let t=jt(e.remote),n=e.pushErrorCode!=null||e.pushError!=null,r=e.pullErrorCode!=null||e.pullError!=null;if(n&&r&&(e.pushErrorCode==null?e.pullErrorCode==null&&e.pushError===e.pullError:e.pushErrorCode===e.pullErrorCode))return[{key:`sync`,direction:null,message:e.pushErrorCode==null?e.pushError:Lt(e.pushErrorCode,t)}];let i=n&&r,a=[];return n&&a.push({key:`push`,direction:i?`push`:null,message:e.pushErrorCode?Ft(e.pushErrorCode,t):e.pushError}),r&&a.push({key:`pull`,direction:i?`pull`:null,message:e.pullErrorCode?It(e.pullErrorCode,t):e.pullError}),a}function zt(e){return e?.checkStatus===`unknown`&&e.unknownError===`token-invalid`}function Bt(e){return dt(e)===`auth-error`&&Ot(e)?y._({id:`EkEFE3`}):mt(e)}function Vt(e){let t=Q(e),n=dt(e);if(n===`conflict`&&e.conflictCount>0){let{conflictCount:t}=e;return y._({id:`cUK8lW`,values:{conflictCount:t}})}if(n===`idle`){let{ahead:n,behind:r}=e;return t?r>0?y._({id:`9o1bIV`,values:{behind:r}}):y._({id:`j5CWO4`}):n>0&&r>0?y._({id:`5F5HYj`,values:{ahead:n,behind:r}}):n>0?y._({id:`PdA9NZ`,values:{ahead:n}}):r>0?y._({id:`9o1bIV`,values:{behind:r}}):y._({id:`N2FcBE`})}return Bt(e)}function Ht(e){let t=(0,U.c)(3),{children:n,id:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,G.jsx)(`span`,{id:r,className:`font-mono uppercase tracking-wide text-2xs text-muted-foreground`,children:n}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function Ut(e){switch(e){case`M`:return y._({id:`tgWuMB`});case`A`:return y._({id:`hp8OtS`});case`D`:return y._({id:`vGjmyl`});case`R`:return y._({id:`QeREu8`});case`C`:return y._({id:`6V3Ea3`});case`U`:return y._({id:`cyoNqf`});case`T`:return y._({id:`zWZBPx`});case`?`:return y._({id:`C2abof`});case`!`:return y._({id:`xDKOFk`});default:return y._({id:`cNsIJf`})}}function Wt(e){switch(e){case`D`:return`destructive`;case`U`:return`warning`;default:return`gray`}}function Gt(e){let t=(0,U.c)(25),{entry:n,dimmed:r,label:i}=e,a;t[0]===n.code?a=t[1]:(a=Ut(n.code),t[0]=n.code,t[1]=a);let l=a,u=n.open,d=`truncate text-start font-mono text-2xs ${r?`text-muted-foreground/60`:`text-foreground`}`,f;t[2]===n.code?f=t[3]:(f=Wt(n.code),t[2]=n.code,t[3]=f);let p;t[4]===n.code?p=t[5]:(p=(0,G.jsx)(`span`,{"aria-hidden":!0,children:n.code}),t[4]=n.code,t[5]=p);let m;t[6]===l?m=t[7]:(m=(0,G.jsx)(`span`,{className:`sr-only`,children:l}),t[6]=l,t[7]=m);let h;t[8]!==f||t[9]!==p||t[10]!==m?(h=(0,G.jsx)(o,{asChild:!0,children:(0,G.jsxs)(F,{variant:f,className:`size-4 shrink-0 justify-center p-0 text-2xs leading-none`,children:[p,m]})}),t[8]=f,t[9]=p,t[10]=m,t[11]=h):h=t[11];let g;t[12]===l?g=t[13]:(g=(0,G.jsx)(s,{children:l}),t[12]=l,t[13]=g);let v;t[14]!==h||t[15]!==g?(v=(0,G.jsxs)(c,{children:[h,g]}),t[14]=h,t[15]=g,t[16]=v):v=t[16];let y;t[17]!==n.path||t[18]!==i||t[19]!==u||t[20]!==d?(y=u?(0,G.jsxs)(c,{children:[(0,G.jsx)(o,{asChild:!0,children:(0,G.jsx)(pe,{asChild:!0,children:(0,G.jsx)(_,{variant:`link-muted`,size:`xs`,className:`h-auto min-h-6 min-w-0 shrink justify-start overflow-hidden p-0 font-normal`,"aria-label":n.path,onClick:()=>at(ot(u)),"data-testid":`worktree-row-open`,children:(0,G.jsx)(`span`,{dir:`auto`,className:`min-w-0 ${d}`,children:i})})})}),(0,G.jsx)(s,{dir:`auto`,className:`font-mono text-2xs`,children:n.path})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(c,{children:[(0,G.jsx)(o,{asChild:!0,children:(0,G.jsx)(`span`,{dir:`auto`,tabIndex:0,className:`min-w-0 rounded-xs focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 ${d}`,children:i})}),(0,G.jsx)(s,{dir:`auto`,className:`font-mono text-2xs`,children:n.path})]}),i!==n.path&&(0,G.jsx)(`span`,{className:`sr-only`,children:n.path})]}),t[17]=n.path,t[18]=i,t[19]=u,t[20]=d,t[21]=y):y=t[21];let b;return t[22]!==v||t[23]!==y?(b=(0,G.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2`,children:[v,y]}),t[22]=v,t[23]=y,t[24]=b):b=t[24],b}function Kt(e){let t=(0,U.c)(15),{rows:n,dimmed:i}=e,[a,o]=(0,W.useState)(!1),s=n.length>6,c;t[0]!==n||t[1]!==a?(c=a?n:n.slice(0,6),t[0]=n,t[1]=a,t[2]=c):c=t[2];let l=c,u=n.length-6,d;if(t[3]!==i||t[4]!==l){let e;t[6]===i?e=t[7]:(e=e=>{let{entry:t,label:n}=e;return(0,G.jsx)(Gt,{entry:t,dimmed:i,label:n},`${t.code}:${t.path}`)},t[6]=i,t[7]=e),d=l.map(e),t[3]=i,t[4]=l,t[5]=d}else d=t[5];let f;t[8]!==s||t[9]!==u||t[10]!==a?(f=s&&(0,G.jsx)(`li`,{children:(0,G.jsx)(_,{variant:`link-muted`,size:`xs`,"aria-expanded":a,className:`h-auto min-h-6 justify-start p-0 text-2xs font-normal`,onClick:()=>o(qt),"data-testid":`worktree-rows-show-all`,children:a?(0,G.jsx)(r,{id:`H86f9p`}):(0,G.jsx)(r,{id:`B6Lac2`,values:{overflowCount:u}})})}),t[8]=s,t[9]=u,t[10]=a,t[11]=f):f=t[11];let p;return t[12]!==d||t[13]!==f?(p=(0,G.jsxs)(`ul`,{className:`flex flex-col gap-1`,children:[d,f]}),t[12]=d,t[13]=f,t[14]=p):p=t[14],p}function qt(e){return!e}function Jt(e){let t=(0,U.c)(25),{group:n,prefix:i,dimmed:a}=e,f=n.rows.length,[p,m]=(0,W.useState)(!1),h=i===``?n.dir:`${i}/${n.dir}`,g=`size-3 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none ${p?`rotate-90`:``}`,v;t[0]===g?v=t[1]:(v=(0,G.jsx)(O,{className:g,"aria-hidden":!0}),t[0]=g,t[1]=v);let y;t[2]===n.dir?y=t[3]:(y=(0,G.jsx)(`span`,{dir:`auto`,className:`min-w-0 truncate text-start font-mono text-2xs text-muted-foreground`,children:n.dir}),t[2]=n.dir,t[3]=y);let b;t[4]===f?b=t[5]:(b=(0,G.jsx)(`span`,{"aria-hidden":!0,className:`ms-auto shrink-0 ps-1 text-2xs text-muted-foreground tabular-nums`,children:f}),t[4]=f,t[5]=b);let x;t[6]===f?x=t[7]:(x=(0,G.jsx)(`span`,{className:`sr-only`,children:(0,G.jsx)(r,{id:`u3BOHd`,values:{fileCount:f}})}),t[6]=f,t[7]=x);let S;t[8]!==v||t[9]!==y||t[10]!==b||t[11]!==x?(S=(0,G.jsx)(o,{asChild:!0,children:(0,G.jsx)(u,{asChild:!0,children:(0,G.jsxs)(_,{variant:`ghost`,size:`xs`,className:`h-auto min-h-6 w-full justify-start gap-1 px-0 font-normal`,children:[v,y,b,x]})})}),t[8]=v,t[9]=y,t[10]=b,t[11]=x,t[12]=S):S=t[12];let C;t[13]===h?C=t[14]:(C=(0,G.jsx)(s,{dir:`auto`,className:`font-mono text-2xs`,children:h}),t[13]=h,t[14]=C);let w;t[15]!==S||t[16]!==C?(w=(0,G.jsxs)(c,{children:[S,C]}),t[15]=S,t[16]=C,t[17]=w):w=t[17];let T;t[18]!==a||t[19]!==n.rows?(T=(0,G.jsx)(l,{className:`ps-4`,children:(0,G.jsx)(Kt,{rows:n.rows,dimmed:a})}),t[18]=a,t[19]=n.rows,t[20]=T):T=t[20];let E;return t[21]!==p||t[22]!==w||t[23]!==T?(E=(0,G.jsxs)(d,{open:p,onOpenChange:m,className:`flex flex-col gap-1`,children:[w,T]}),t[21]=p,t[22]=w,t[23]=T,t[24]=E):E=t[24],E}function Yt(e){let t=(0,U.c)(39),{title:n,note:i,entries:a,dimmed:o}=e,s=o===void 0?!1:o;if(a.length===0)return null;let c=a.length,f,p,m,h,g,v,y,b,x;if(t[0]!==s||t[1]!==a||t[2]!==c||t[3]!==i||t[4]!==n){let{prefix:e,groups:o,loose:S}=rt(a);m=S,p=d,b=`flex flex-col gap-1`;let C;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,G.jsx)(O,{className:`size-3 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none group-data-[state=open]:rotate-90`,"aria-hidden":!0}),t[14]=C):C=t[14];let w;t[15]===n?w=t[16]:(w=(0,G.jsx)(`span`,{className:`text-2xs font-medium text-muted-foreground`,children:n}),t[15]=n,t[16]=w);let T;t[17]===c?T=t[18]:(T=(0,G.jsx)(`span`,{className:`ms-auto shrink-0 ps-1 text-2xs text-muted-foreground tabular-nums`,children:(0,G.jsx)(r,{id:`u3BOHd`,values:{fileCount:c}})}),t[17]=c,t[18]=T),t[19]!==w||t[20]!==T?(x=(0,G.jsx)(u,{asChild:!0,children:(0,G.jsxs)(_,{variant:`ghost`,size:`xs`,className:`group h-auto min-h-6 w-full justify-start gap-1 px-0 font-normal data-[state=open]:bg-transparent`,children:[C,w,T]})}),t[19]=w,t[20]=T,t[21]=x):x=t[21],f=l,h=`flex flex-col gap-1 ps-3`,t[22]===i?g=t[23]:(g=i&&(0,G.jsx)(`span`,{className:`text-2xs text-muted-foreground/80`,children:i}),t[22]=i,t[23]=g),v=e!==``&&(0,G.jsxs)(`span`,{dir:`auto`,className:`break-all font-mono text-2xs text-muted-foreground`,children:[e,`/`]}),y=o.map(t=>(0,G.jsx)(Jt,{group:t,prefix:e,dimmed:s},e===``?t.dir:`${e}/${t.dir}`)),t[0]=s,t[1]=a,t[2]=c,t[3]=i,t[4]=n,t[5]=f,t[6]=p,t[7]=m,t[8]=h,t[9]=g,t[10]=v,t[11]=y,t[12]=b,t[13]=x}else f=t[5],p=t[6],m=t[7],h=t[8],g=t[9],v=t[10],y=t[11],b=t[12],x=t[13];let S;t[24]!==s||t[25]!==m?(S=m.length>0&&(0,G.jsx)(Kt,{rows:m,dimmed:s}),t[24]=s,t[25]=m,t[26]=S):S=t[26];let C;t[27]!==f||t[28]!==h||t[29]!==g||t[30]!==v||t[31]!==y||t[32]!==S?(C=(0,G.jsxs)(f,{className:h,children:[g,v,y,S]}),t[27]=f,t[28]=h,t[29]=g,t[30]=v,t[31]=y,t[32]=S,t[33]=C):C=t[33];let w;return t[34]!==p||t[35]!==b||t[36]!==x||t[37]!==C?(w=(0,G.jsxs)(p,{className:b,children:[x,C]}),t[34]=p,t[35]=b,t[36]=x,t[37]=C,t[38]=w):w=t[38],w}function Xt(e){let t=(0,U.c)(9),{direction:n,count:r}=e,{_:a}=i();if(r<=0)return null;let o;t[0]===n?o=t[1]:(o=n===`behind`?(0,G.jsx)(E,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}):(0,G.jsx)(D,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}),t[0]=n,t[1]=o);let s;t[2]!==a||t[3]!==r||t[4]!==n?(s=a(n===`behind`?{id:`sKHiNR`,values:{count:r}}:{id:`9ZxzfT`,values:{count:r}}),t[2]=a,t[3]=r,t[4]=n,t[5]=s):s=t[5];let c;return t[6]!==o||t[7]!==s?(c=(0,G.jsxs)(`span`,{className:`flex flex-1 items-center gap-1.5 rounded-md bg-muted px-2 py-1 text-xs text-foreground`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8],c}function Zt(e){let t=new Set,n=[],r=[];for(let i of[...e.staged,...e.notStaged,...e.untracked])t.has(i.path)||(t.add(i.path),(i.syncScoped?n:r).push(i));return{willPush:n,wontPush:r}}function Qt(e){let t=(0,U.c)(6),{lastReadAt:n}=e,{_:a}=i(),o=ct(),s;t[0]!==a||t[1]!==n||t[2]!==o?(s=X(a,n,o),t[0]=a,t[1]=n,t[2]=o,t[3]=s):s=t[3];let c=s,l;return t[4]===c?l=t[5]:(l=(0,G.jsx)(`p`,{className:`text-2xs text-muted-foreground`,"data-testid":`worktree-stale`,children:(0,G.jsx)(r,{id:`e-pP6g`,values:{staleRelative:c}})}),t[4]=c,t[5]=l),l}function $t(e){let t=(0,U.c)(36),{status:n,worktree:a,loading:o,unreadable:s,stale:c,lastReadAt:l}=e,u;t[0]===a?u=t[1]:(u=a?Zt(a):{willPush:[],wontPush:[]},t[0]=a,t[1]=u);let{willPush:d,wontPush:f}=u,p;t[2]===a?.incoming?p=t[3]:(p=a?.incoming??[],t[2]=a?.incoming,t[3]=p);let m=p,{_:h}=i(),g=c&&!s&&a!==null&&l!==null,_=a!==null&&d.length===0&&f.length===0&&m.length===0,v;t[4]!==h||t[5]!==g||t[6]!==s?(v=s?h({id:`L9ox9k`}):g?h({id:`_LK4d6`}):``,t[4]=h,t[5]=g,t[6]=s,t[7]=v):v=t[7];let y=v,b;t[8]===y?b=t[9]:(b=(0,G.jsx)(`div`,{className:`sr-only`,role:`status`,"aria-live":`polite`,"data-testid":`worktree-announcer`,children:y}),t[8]=y,t[9]=b);let x;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,G.jsx)(Ht,{id:`worktree-status-label`,children:(0,G.jsx)(r,{id:`uAQUqI`})}),t[10]=x):x=t[10];let S;t[11]!==s||t[12]!==a?(S=!s&&a&&(a.branch||a.detached)&&(0,G.jsx)(`span`,{className:`min-w-0 truncate font-mono text-2xs text-muted-foreground`,"data-testid":`worktree-branch`,children:a.detached?(0,G.jsx)(r,{id:`OBdkpo`}):a.upstream?`${a.branch} → ${a.upstream}`:a.branch}),t[11]=s,t[12]=a,t[13]=S):S=t[13];let C;t[14]===S?C=t[15]:(C=(0,G.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[x,S]}),t[14]=S,t[15]=C);let w;t[16]!==n.ahead||t[17]!==n.behind?(w=(n.behind>0||n.ahead>0)&&(0,G.jsxs)(`div`,{className:`flex items-stretch gap-2`,children:[(0,G.jsx)(Xt,{direction:`behind`,count:n.behind}),(0,G.jsx)(Xt,{direction:`ahead`,count:n.ahead})]}),t[16]=n.ahead,t[17]=n.behind,t[18]=w):w=t[18];let T;t[19]!==_||t[20]!==m||t[21]!==o||t[22]!==s||t[23]!==d||t[24]!==f||t[25]!==a?(T=s?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`worktree-unreadable`,children:(0,G.jsx)(r,{id:`L9ox9k`})}):o?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,G.jsx)(r,{id:`eolhcI`})}):_?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,G.jsx)(r,{id:`WfcERq`})}):a&&(0,G.jsxs)(`section`,{className:`flex max-h-56 flex-col gap-2.5 overflow-y-auto overscroll-contain focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,tabIndex:0,"aria-labelledby":`worktree-status-label`,"data-testid":`worktree-listing`,children:[(0,G.jsx)(Yt,{title:(0,G.jsx)(r,{id:`NcwbBM`}),entries:m}),(0,G.jsx)(Yt,{title:(0,G.jsx)(r,{id:`JOhCT9`}),entries:d}),(0,G.jsx)(Yt,{title:(0,G.jsx)(r,{id:`vsFXfP`}),note:(0,G.jsx)(r,{id:`PxZCNM`}),entries:f,dimmed:!0}),a.truncated&&(0,G.jsx)(`p`,{className:`text-2xs text-muted-foreground`,children:(0,G.jsx)(r,{id:`KvwJv8`})})]}),t[19]=_,t[20]=m,t[21]=o,t[22]=s,t[23]=d,t[24]=f,t[25]=a,t[26]=T):T=t[26];let E;t[27]!==l||t[28]!==g?(E=g&&l!==null&&(0,G.jsx)(Qt,{lastReadAt:l}),t[27]=l,t[28]=g,t[29]=E):E=t[29];let D;return t[30]!==E||t[31]!==b||t[32]!==C||t[33]!==w||t[34]!==T?(D=(0,G.jsxs)(`div`,{className:`flex flex-col gap-2.5 border-t pt-3`,children:[b,C,w,T,E]}),t[30]=E,t[31]=b,t[32]=C,t[33]=w,t[34]=T,t[35]=D):D=t[35],D}function en(e){let t=(0,U.c)(19),{pulledAt:n,pushedAt:r,combinedAt:a}=e,{_:o}=i(),s,c,l;if(t[0]!==o||t[1]!==a||t[2]!==n||t[3]!==r){s=n===null?null:Z(o,n),c=r===null?null:Z(o,r);let e=a===null?null:Z(o,a);l=s!==null&&c!==null?o({id:`1TA-aJ`,values:{pulled:s,pushed:c}}):s===null?c===null?e===null?null:o({id:`irnKr_`,values:{updatedRelative:e}}):o({id:`lPkjpD`,values:{pushed:c}}):o({id:`xW5AUw`,values:{pulled:s}}),t[0]=o,t[1]=a,t[2]=n,t[3]=r,t[4]=s,t[5]=c,t[6]=l}else s=t[4],c=t[5],l=t[6];let u=l,d=s!==null||c!==null;if(u===null){let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(`span`,{}),t[7]=e):e=t[7],e}let f;t[8]!==u||t[9]!==d?(f=d&&(0,G.jsx)(`span`,{className:`sr-only`,"data-testid":`sync-popover-last-sync-label`,children:u}),t[8]=u,t[9]=d,t[10]=f):f=t[10];let p;t[11]!==u||t[12]!==s||t[13]!==c||t[14]!==d?(p=d?(0,G.jsxs)(`span`,{"aria-hidden":`true`,className:`inline-flex items-center gap-1`,children:[s!==null&&(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,G.jsx)(E,{className:`size-3`}),s]}),s!==null&&c!==null&&(0,G.jsx)(`span`,{children:`·`}),c!==null&&(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,G.jsx)(D,{className:`size-3`}),c]})]}):(0,G.jsx)(`span`,{"aria-hidden":`true`,children:u}),t[11]=u,t[12]=s,t[13]=c,t[14]=d,t[15]=p):p=t[15];let m;return t[16]!==f||t[17]!==p?(m=(0,G.jsxs)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`sync-popover-last-sync`,children:[f,p]}),t[16]=f,t[17]=p,t[18]=m):m=t[18],m}function tn(){let e=(0,U.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)(pe,{asChild:!0,children:(0,G.jsx)(_,{variant:`outline`,size:`xs`,className:`self-start`,onClick:nn,"data-testid":`sync-popover-add-host-token`,children:(0,G.jsx)(r,{id:`zXZJoN`})})}),e[0]=t):t=e[0],t}function nn(){return ce()}function rn(e){let t=(0,U.c)(154),{status:n,onSignIn:a,onSetIdentity:o}=e,{_:s}=i(),{conflictCount:c}=n,{projectLocalConfig:l,projectLocalSynced:u}=w(),d=l?.autoSync,v;t[0]===n?v=t[1]:(v=Ke(n),t[0]=n,t[1]=v);let{mode:y,confirmOpen:b,setConfirmOpen:x,pendingMode:C,strandedCommitCount:T,onModeSelect:O,onConfirm:k}=Pe(d,v,n.ahead),{status:A,loading:N,unreadable:P,stale:F,lastReadAt:I}=Ue(!0),ne=y===`follow`,re;t[2]===n?re=t[3]:(re=dt(n),t[2]=n,t[3]=re);let L=re,ie;t[4]===n?ie=t[5]:(ie=Ot(n),t[4]=n,t[5]=ie);let ae=ie,oe=n.lastPullOkUtc??null,se=n.lastPushOkUtc??null,ce=n.lastRunUtc??n.lastSyncUtc??null,R=n.pushPermission?.checkStatus===`denied`&&n.pushPermission.deniedReason!==`not-authenticated`&&!ae,le;t[6]===n.remote?le=t[7]:(le=jt(n.remote),t[6]=n.remote,t[7]=le);let ue=le,fe=!R,z=L===`fetching`||L===`pulling`||L===`pushing`,[me,ge]=(0,W.useState)(null),_e,B;t[8]===z?(_e=t[9],B=t[10]):(_e=()=>{z||ge(null)},B=[z],t[8]=z,t[9]=_e,t[10]=B),(0,W.useEffect)(_e,B);let ve;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(ve=e=>{ge(t=>t===e?null:t)},t[11]=ve):ve=t[11];let ye=ve,V=z?me??(L===`pushing`?`push`:`pull`):null,be;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(be=e=>{ge(e),it(e,()=>ye(e))},t[12]=be):be=t[12];let xe=be,Se=L===`dormant`||L===`auth-error`||n.state===`conflict`,H=Se||n.conflictCount>0,Ce;t[13]===n.blockingPaths?Ce=t[14]:(Ce=n.blockingPaths??[],t[13]=n.blockingPaths,t[14]=Ce);let we=Ce,{conflicts:Te}=he(),De;t[15]===Te?De=t[16]:(De=Te.find(ln)?.docName??null,t[15]=Te,t[16]=De);let Oe=De,ke;t[17]===n?ke=t[18]:(ke=(0,G.jsx)(ft,{status:n}),t[17]=n,t[18]=ke);let Ae;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=(0,G.jsx)(`span`,{className:`text-1sm font-medium`,children:(0,G.jsx)(r,{id:`yZepkk`})}),t[19]=Ae):Ae=t[19];let je;t[20]===ke?je=t[21]:(je=(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[ke,Ae]}),t[20]=ke,t[21]=je);let Me;t[22]!==s||t[23]!==n.remote?(Me=n.remote&&(n.remote.webUrl?(0,G.jsxs)(`a`,{href:n.remote.webUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex min-w-0 items-center gap-0.5 text-xs text-foreground hover:text-primary hover:underline`,"aria-label":s({id:`1nke1r`,values:{0:n.remote.label}}),children:[(0,G.jsx)(`span`,{className:`truncate`,children:n.remote.label}),(0,G.jsx)(ee,{className:`size-3.5 shrink-0`,"aria-hidden":!0})]}):(0,G.jsx)(`span`,{className:`min-w-0 truncate text-xs text-foreground`,children:n.remote.label})),t[22]=s,t[23]=n.remote,t[24]=Me):Me=t[24];let Ne;t[25]!==je||t[26]!==Me?(Ne=(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[je,Me]}),t[25]=je,t[26]=Me,t[27]=Ne):Ne=t[27];let Fe=C??`full`,Ie;t[28]!==b||t[29]!==k||t[30]!==x||t[31]!==T||t[32]!==Fe?(Ie=(0,G.jsx)(Ye,{open:b,onOpenChange:x,onConfirm:k,variant:Fe,strandedCommitCount:T}),t[28]=b,t[29]=k,t[30]=x,t[31]=T,t[32]=Fe,t[33]=Ie):Ie=t[33];let Le;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,G.jsx)(Ht,{children:(0,G.jsx)(r,{id:`CnOGgs`})}),t[34]=Le):Le=t[34];let Re;t[35]===O?Re=t[36]:(Re=e=>{S(e)&&O(e)},t[35]=O,t[36]=Re);let ze=!u,Be;t[37]===s?Be=t[38]:(Be=s({id:`CnOGgs`}),t[37]=s,t[38]=Be);let Ve;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,G.jsx)(h,{}),t[39]=Ve):Ve=t[39];let He;t[40]===Be?He=t[41]:(He=(0,G.jsx)(m,{size:`sm`,className:`w-full text-xs`,"aria-label":Be,"data-testid":`sync-mode-select`,children:Ve}),t[40]=Be,t[41]=He);let We;t[42]===s?We=t[43]:(We=s({id:`BWTzAb`}),t[42]=s,t[43]=We);let Ge;t[44]===We?Ge=t[45]:(Ge=(0,G.jsx)(f,{value:`off`,className:`text-xs`,children:We}),t[44]=We,t[45]=Ge);let K;t[46]===s?K=t[47]:(K=s({id:`tlGXxX`}),t[46]=s,t[47]=K);let q;t[48]===K?q=t[49]:(q=(0,G.jsx)(f,{value:`follow`,className:`text-xs`,children:K}),t[48]=K,t[49]=q);let qe;t[50]===s?qe=t[51]:(qe=s({id:`IXiG0B`}),t[50]=s,t[51]=qe);let Je;t[52]!==R||t[53]!==qe?(Je=(0,G.jsx)(f,{value:`full`,className:`text-xs`,disabled:R,children:qe}),t[52]=R,t[53]=qe,t[54]=Je):Je=t[54];let Xe;t[55]!==Ge||t[56]!==q||t[57]!==Je?(Xe=(0,G.jsxs)(p,{children:[Ge,q,Je]}),t[55]=Ge,t[56]=q,t[57]=Je,t[58]=Xe):Xe=t[58];let Ze;t[59]!==y||t[60]!==Re||t[61]!==ze||t[62]!==He||t[63]!==Xe?(Ze=(0,G.jsxs)(g,{value:y,onValueChange:Re,disabled:ze,children:[He,Xe]}),t[59]=y,t[60]=Re,t[61]=ze,t[62]=He,t[63]=Xe,t[64]=Ze):Ze=t[64];let $e;t[65]===y?$e=t[66]:($e=(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`sync-popover-mode-line`,children:y===`off`?(0,G.jsx)(r,{id:`qD3krc`}):y===`follow`?(0,G.jsx)(r,{id:`PGRnbw`}):(0,G.jsx)(r,{id:`zBiFZh`})}),t[65]=y,t[66]=$e);let et;t[67]!==Ze||t[68]!==$e?(et=(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[Le,Ze,$e]}),t[67]=Ze,t[68]=$e,t[69]=et):et=t[69];let J;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,G.jsx)(Ht,{children:(0,G.jsx)(r,{id:`BWTzAb`})}),t[70]=J):J=t[70];let tt=z||Se,nt;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(nt=()=>xe(`pull`),t[71]=nt):nt=t[71];let Y;t[72]===V?Y=t[73]:(Y=V===`pull`?(0,G.jsx)(j,{"aria-hidden":`true`,"data-icon":`inline-start`}):(0,G.jsx)(E,{"data-icon":`inline-start`}),t[72]=V,t[73]=Y);let rt;t[74]===Symbol.for(`react.memo_cache_sentinel`)?(rt=(0,G.jsx)(r,{id:`e4GHWP`}),t[74]=rt):rt=t[74];let ot;t[75]!==tt||t[76]!==Y?(ot=(0,G.jsxs)(_,{variant:`outline`,size:`xs`,className:`flex-1`,disabled:tt,onClick:nt,"data-testid":`sync-popover-pull`,children:[Y,rt]}),t[75]=tt,t[76]=Y,t[77]=ot):ot=t[77];let st;t[78]!==z||t[79]!==fe||t[80]!==H||t[81]!==V?(st=fe&&(0,G.jsxs)(_,{variant:`outline`,size:`xs`,className:`flex-1`,disabled:z||H,onClick:()=>xe(`push`),"data-testid":`sync-popover-push`,children:[V===`push`?(0,G.jsx)(j,{"aria-hidden":`true`,"data-icon":`inline-start`}):(0,G.jsx)(D,{"data-icon":`inline-start`}),(0,G.jsx)(r,{id:`uO9WLl`})]}),t[78]=z,t[79]=fe,t[80]=H,t[81]=V,t[82]=st):st=t[82];let X;t[83]!==ot||t[84]!==st?(X=(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[ot,st]}),t[83]=ot,t[84]=st,t[85]=X):X=t[85];let Z;t[86]!==z||t[87]!==fe||t[88]!==H||t[89]!==V?(Z=fe&&(0,G.jsxs)(_,{size:`xs`,className:`w-full`,disabled:z||H,onClick:()=>xe(`sync`),"data-testid":`sync-popover-sync`,children:[V===`sync`?(0,G.jsx)(j,{"aria-hidden":`true`,icon:M,"data-icon":`inline-start`}):(0,G.jsx)(M,{"data-icon":`inline-start`}),(0,G.jsx)(r,{id:`YEzhIr`})]}),t[86]=z,t[87]=fe,t[88]=H,t[89]=V,t[90]=Z):Z=t[90];let ct;t[91]!==X||t[92]!==Z?(ct=(0,G.jsxs)(`div`,{className:`flex flex-col gap-2 border-t pt-3`,children:[J,X,Z]}),t[91]=X,t[92]=Z,t[93]=ct):ct=t[93];let lt;if(t[94]!==s||t[95]!==n){let e;t[97]===s?e=t[98]:(e=e=>(0,G.jsx)(`p`,{className:`text-xs text-destructive`,children:e.direction===`push`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`span`,{className:`font-medium`,children:[s({id:`uO9WLl`}),`: `]}),e.message]}):e.direction===`pull`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`span`,{className:`font-medium`,children:[s({id:`e4GHWP`}),`: `]}),e.message]}):e.message},e.key),t[97]=s,t[98]=e),lt=Rt(n).map(e),t[94]=s,t[95]=n,t[96]=lt}else lt=t[96];let Q;t[99]===n?Q=t[100]:(Q=kt(n)&&n.pushPermission?.checkStatus===`denied`?Et(n.pushPermission).map(cn):null,t[99]=n,t[100]=Q);let ut;t[101]!==n.pausedReason||t[102]!==n.pushPermission?(ut=n.pausedReason===`no-push-permission`&&n.pushPermission?.checkStatus===`denied`?Et(n.pushPermission).map(sn):null,t[101]=n.pausedReason,t[102]=n.pushPermission,t[103]=ut):ut=t[103];let $;t[104]!==lt||t[105]!==Q||t[106]!==ut?($=(0,G.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:`flex flex-col gap-3.5 empty:sr-only`,"data-testid":`sync-popover-status`,children:[lt,Q,ut]}),t[104]=lt,t[105]=Q,t[106]=ut,t[107]=$):$=t[107];let pt;t[108]!==we||t[109]!==ne||t[110]!==R||t[111]!==a||t[112]!==n?(pt=!ne&&At(n.pushPermission)?(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,G.jsx)(`p`,{className:`min-w-0 flex-1 text-xs text-muted-foreground`,children:(0,G.jsx)(r,{id:`ycIX5i`})}),a&&(0,G.jsx)(_,{variant:`outline`,size:`xs`,className:`self-start`,onClick:a,children:(0,G.jsx)(r,{id:`5lWFkC`})})]}):we.length>0?(0,G.jsx)(Qe,{paths:we}):kt(n)?null:n.pausedReason?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,G.jsx)(wt,{reason:n.pausedReason})}),(0,G.jsx)(St,{paths:n.refusedSymlinkPaths})]}):!ne&&R&&n.pushPermission?.checkStatus===`denied`?Tt(n.pushPermission.deniedReason,n.pushPermission).map(on):zt(n.pushPermission)?(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,G.jsx)(`p`,{className:`min-w-0 flex-1 text-xs text-muted-foreground`,children:(0,G.jsx)(r,{id:`C_cPoW`})}),a&&(0,G.jsx)(_,{variant:`outline`,size:`xs`,className:`self-start`,onClick:a,children:(0,G.jsx)(r,{id:`5lWFkC`})})]}):null,t[108]=we,t[109]=ne,t[110]=R,t[111]=a,t[112]=n,t[113]=pt):pt=t[113];let mt;t[114]!==Oe||t[115]!==L?(mt=L===`conflict`&&(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,G.jsx)(`p`,{className:`min-w-0 flex-1 text-xs text-warning`,children:(0,G.jsx)(r,{id:`ko386X`})}),Oe!==null&&(0,G.jsx)(_,{variant:`outline`,size:`xs`,className:`self-start`,onClick:()=>at(de(Oe)),children:(0,G.jsx)(r,{id:`5k0NLb`})})]}),t[114]=Oe,t[115]=L,t[116]=mt):mt=t[116];let ht;t[117]!==ue||t[118]!==a||t[119]!==L||t[120]!==n?(ht=L===`auth-error`&&!kt(n)&&(ue?a&&(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,G.jsx)(`p`,{className:`min-w-0 flex-1 text-xs text-destructive`,children:(0,G.jsx)(r,{id:`Vl1H8I`})}),(0,G.jsx)(_,{variant:`outline`,size:`xs`,className:`self-start`,onClick:a,children:(0,G.jsx)(r,{id:`5lWFkC`})})]}):Nt(n.remote)?(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,G.jsx)(`p`,{className:`min-w-0 flex-1 text-xs text-destructive`,"data-testid":`sync-popover-auth-error-unverified`,children:(0,G.jsx)(r,{id:`FioJgb`})}),(0,G.jsx)(tn,{})]}):(0,G.jsx)(`p`,{className:`text-xs text-destructive`,"data-testid":`sync-popover-auth-error-no-token`,children:(0,G.jsx)(r,{id:`w-Wt3H`})})),t[117]=ue,t[118]=a,t[119]=L,t[120]=n,t[121]=ht):ht=t[121];let gt;t[122]===c?gt=t[123]:(gt=c>0&&(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,G.jsx)(r,{id:`B4_ipX`,values:{conflictCount:c}})}),t[122]=c,t[123]=gt);let _t;t[124]!==n||t[125]!==A||t[126]!==I||t[127]!==N||t[128]!==F||t[129]!==P?(_t=(0,G.jsx)($t,{status:n,worktree:A,loading:N,unreadable:P,stale:F,lastReadAt:I}),t[124]=n,t[125]=A,t[126]=I,t[127]=N,t[128]=F,t[129]=P,t[130]=_t):_t=t[130];let vt;t[131]!==ce||t[132]!==oe||t[133]!==se?(vt=(0,G.jsx)(en,{pulledAt:oe,pushedAt:se,combinedAt:ce}),t[131]=ce,t[132]=oe,t[133]=se,t[134]=vt):vt=t[134];let yt;t[135]===Symbol.for(`react.memo_cache_sentinel`)?(yt=(0,G.jsx)(pe,{asChild:!0,children:(0,G.jsxs)(_,{variant:`link`,size:`xs`,className:`h-auto p-0 text-xs text-muted-foreground hover:font-medium hover:text-foreground hover:no-underline`,onClick:an,"data-testid":`sync-popover-settings`,children:[(0,G.jsx)(te,{"data-icon":`inline-start`}),(0,G.jsx)(r,{id:`VNgKZz`})]})}),t[135]=yt):yt=t[135];let bt;t[136]===vt?bt=t[137]:(bt=(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[vt,yt]}),t[136]=vt,t[137]=bt);let xt;t[138]!==o||t[139]!==n.identityUnresolved?(xt=n.identityUnresolved&&o&&(0,G.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed p-2`,children:[(0,G.jsx)(Ee,{className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,G.jsx)(`p`,{className:`text-xs leading-snug text-muted-foreground`,children:(0,G.jsx)(r,{id:`nrGWJ7`})}),(0,G.jsx)(_,{variant:`outline`,size:`xs`,className:`self-start`,onClick:o,children:(0,G.jsx)(r,{id:`keNFEd`})})]})]}),t[138]=o,t[139]=n.identityUnresolved,t[140]=xt):xt=t[140];let Ct;return t[141]!==Ne||t[142]!==Ie||t[143]!==et||t[144]!==ct||t[145]!==$||t[146]!==pt||t[147]!==mt||t[148]!==ht||t[149]!==gt||t[150]!==_t||t[151]!==bt||t[152]!==xt?(Ct=(0,G.jsxs)(`div`,{className:`flex flex-col gap-3.5`,children:[Ne,Ie,et,ct,$,pt,mt,ht,gt,_t,bt,xt]}),t[141]=Ne,t[142]=Ie,t[143]=et,t[144]=ct,t[145]=$,t[146]=pt,t[147]=mt,t[148]=ht,t[149]=gt,t[150]=_t,t[151]=bt,t[152]=xt,t[153]=Ct):Ct=t[153],Ct}function an(){return R({advanced:!0})}function on(e){return(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},e)}function sn(e){return(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},e)}function cn(e){return(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},e)}function ln(e){return e.docName!==null}function un(e){let t=(0,U.c)(68),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{onSignIn:a,onSetIdentity:l}=n,{_:u}=i(),{status:d,fetchError:f}=ge();if(!d){if(f){let e;t[2]===u?e=t[3]:(e=u({id:`iqIDv4`}),t[2]=u,t[3]=e);let n;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,G.jsx)(Se,{className:`size-3.5`}),t[4]=n):n=t[4];let i;t[5]===e?i=t[6]:(i=(0,G.jsx)(o,{asChild:!0,children:(0,G.jsx)(_,{variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground`,"aria-label":e,disabled:!0,children:n})}),t[5]=e,t[6]=i);let a;t[7]===f?a=t[8]:(a=(0,G.jsx)(s,{children:f===`network`?(0,G.jsx)(r,{id:`I5AfhE`}):(0,G.jsx)(r,{id:`uKRYiW`})}),t[7]=f,t[8]=a);let l;return t[9]!==i||t[10]!==a?(l=(0,G.jsxs)(c,{children:[i,a]}),t[9]=i,t[10]=a,t[11]=l):l=t[11],l}return null}if(!d.hasRemote)return null;let p;t[12]===d?p=t[13]:(p=pt(d),t[12]=d,t[13]=p);let m=p,h,g,v,y,b,x,S,C,w,T,E,D;if(t[14]!==u||t[15]!==d){let e=Bt(d);x=!!d.identityUnresolved,b=me,y=c,v=o,D=!0,g=fe,E=!0,h=_,S=`ghost`,C=`icon-sm`,w=`text-muted-foreground relative`,T=u(x?{id:`DFfRbX`,values:{syncStateLabel:e}}:{id:`F4vEsL`,values:{syncStateLabel:e}}),t[14]=u,t[15]=d,t[16]=h,t[17]=g,t[18]=v,t[19]=y,t[20]=b,t[21]=x,t[22]=S,t[23]=C,t[24]=w,t[25]=T,t[26]=E,t[27]=D}else h=t[16],g=t[17],v=t[18],y=t[19],b=t[20],x=t[21],S=t[22],C=t[23],w=t[24],T=t[25],E=t[26],D=t[27];let ee;t[28]===d?ee=t[29]:(ee=(0,G.jsx)(ft,{status:d,size:`size-4`}),t[28]=d,t[29]=ee);let O;t[30]===m?O=t[31]:(O=m&&(0,G.jsx)(`span`,{className:`absolute -top-0.5 -right-0.5 text-[9px] leading-none font-medium bg-background border rounded-full px-0.5`,children:m}),t[30]=m,t[31]=O);let k;t[32]!==m||t[33]!==x?(k=!m&&x&&(0,G.jsx)(`span`,{className:`absolute -top-0.5 -right-0.5 size-1.5 rounded-full bg-warning ring-2 ring-background`,"aria-hidden":!0}),t[32]=m,t[33]=x,t[34]=k):k=t[34];let te;t[35]!==h||t[36]!==O||t[37]!==k||t[38]!==S||t[39]!==C||t[40]!==w||t[41]!==T||t[42]!==ee?(te=(0,G.jsxs)(h,{variant:S,size:C,className:w,"aria-label":T,children:[ee,O,k]}),t[35]=h,t[36]=O,t[37]=k,t[38]=S,t[39]=C,t[40]=w,t[41]=T,t[42]=ee,t[43]=te):te=t[43];let A;t[44]!==g||t[45]!==te||t[46]!==E?(A=(0,G.jsx)(g,{asChild:E,children:te}),t[44]=g,t[45]=te,t[46]=E,t[47]=A):A=t[47];let j;t[48]!==v||t[49]!==A||t[50]!==D?(j=(0,G.jsx)(v,{asChild:D,children:A}),t[48]=v,t[49]=A,t[50]=D,t[51]=j):j=t[51];let M;t[52]===d?M=t[53]:(M=Vt(d),t[52]=d,t[53]=M);let N;t[54]===M?N=t[55]:(N=(0,G.jsx)(s,{children:M}),t[54]=M,t[55]=N);let P;t[56]!==y||t[57]!==j||t[58]!==N?(P=(0,G.jsxs)(y,{children:[j,N]}),t[56]=y,t[57]=j,t[58]=N,t[59]=P):P=t[59];let F;t[60]!==l||t[61]!==a||t[62]!==d?(F=(0,G.jsx)(z,{align:`end`,className:`flex max-h-(--radix-popover-content-available-height) w-80 flex-col overflow-y-auto p-3`,children:(0,G.jsx)(rn,{status:d,onSignIn:a,onSetIdentity:l})}),t[60]=l,t[61]=a,t[62]=d,t[63]=F):F=t[63];let I;return t[64]!==b||t[65]!==P||t[66]!==F?(I=(0,G.jsxs)(b,{children:[P,F]}),t[64]=b,t[65]=P,t[66]=F,t[67]=I):I=t[67],I}export{Ae as C,V as D,H as E,De as S,Oe as T,q as _,Et as a,je as b,Ot as c,$ as d,Nt as f,K as g,Ye as h,dt as i,jt as l,zt as m,St as n,Lt as o,At as p,un as r,Mt as s,wt as t,kt as u,Ke as v,Me as w,ke as x,Fe as y};
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{i as o,n as s,t as c}from"./tooltip-Bz6z4_se.js";import{n as l,r as u,t as d}from"./collapsible-BKbszYZV.js";import{i as f,n as p,o as m,s as h,t as g}from"./select-pACXgFe2.js";import{t as _}from"./button-DzgjsZzC.js";import{n as v}from"./dist-BGzUo_18.js";import{t as y}from"./dist-C_FzPxEX2.js";import{n as b}from"./config-errors-DDAH9fqy.js";import{v as x}from"./documents-events-ddyuXdQl.js";import{f as S,h as C}from"./share-D-LUU2aX-B7Yg0G_m.js";import{i as w}from"./use-apply-config-theme-CYFG76sS.js";import{t as T}from"./createLucideIcon-DdBzwsHe.js";import{n as E,t as D}from"./arrow-up-BGHhPj4y.js";import{t as ee}from"./arrow-up-right-nJaICi16.js";import{t as O}from"./chevron-right-Bofu4lib.js";import{n as k,t as te}from"./settings-2-DoBlNQMk.js";import{t as A}from"./git-merge-VDBzSZBV.js";import{t as j}from"./spinner-Bx8xD6f8.js";import{t as M}from"./refresh-cw-CC7UZEnZ.js";import{t as N}from"./terminal-Cpb4l1oH.js";import{t as P}from"./triangle-alert-BXrUEeRU.js";import{t as F}from"./badge-BIamhtRR.js";import{a as I,c as ne,i as re,n as L,o as ie,r as ae,s as oe,t as se}from"./dialog-BJEjKJjL.js";import{a as ce,u as R}from"./use-settings-route-Bj-m9X61.js";import{c as le,h as ue,l as de}from"./doc-hash-BJkweiX9.js";import{a as fe,i as z,r as pe,t as me}from"./popover-Mb1GgB61.js";import{n as he}from"./use-conflicts-CIjDyM9c.js";import"./config-provider-BRcEwJSU.js";import{n as ge}from"./use-git-sync-status-PkMYmN4D.js";import{t as _e}from"./reveal-editor-ChTC5Vss.js";import{n as B,t as ve}from"./DisclosureWarning-CYHeueUe.js";import{t as ye}from"./terminal-command-events-h-p66odT.js";var V=T(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),be=T(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),xe=T(`cloud-alert`,[[`path`,{d:`M12 12v4`,key:`tww15h`}],[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.128 16.949A7 7 0 1 1 15.71 8h1.79a1 1 0 0 1 0 9h-1.642`,key:`1namsd`}]]),Se=T(`cloud-off`,[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`,key:`1uxyv8`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`,key:`99tcn7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),H=T(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),Ce=T(`git-commit-vertical`,[[`path`,{d:`M12 3v6`,key:`1holv5`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`M12 15v6`,key:`a9ows0`}]]),we=T(`laptop`,[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]),Te=T(`log-in`,[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]),Ee=T(`user-cog`,[[`path`,{d:`M10 15H6a4 4 0 0 0-4 4v2`,key:`1nfge6`}],[`path`,{d:`m14.305 16.53.923-.382`,key:`1itpsq`}],[`path`,{d:`m15.228 13.852-.923-.383`,key:`eplpkm`}],[`path`,{d:`m16.852 12.228-.383-.923`,key:`13v3q0`}],[`path`,{d:`m16.852 17.772-.383.924`,key:`1i8mnm`}],[`path`,{d:`m19.148 12.228.383-.923`,key:`1q8j1v`}],[`path`,{d:`m19.53 18.696-.382-.924`,key:`vk1qj3`}],[`path`,{d:`m20.772 13.852.924-.383`,key:`n880s0`}],[`path`,{d:`m20.772 16.148.924.383`,key:`1g6xey`}],[`circle`,{cx:`18`,cy:`15`,r:`3`,key:`gjjjvw`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),U=a(),W=e(n(),1);function De(){let e=(0,U.c)(2),{projectLocalBinding:t,projectLocalSynced:n}=w();if(t===null||!n)return null;let r;return e[0]===t?r=e[1]:(r=e=>{let n=e?`full`:`off`,r=t.patch({autoSync:{mode:n,enabled:e}});return r.ok?{ok:!0}:{ok:!1,error:b(r.error)}},e[0]=t,e[1]=r),r}function Oe(){let e=(0,U.c)(2),{projectLocalBinding:t,projectLocalSynced:n}=w();if(t===null||!n)return null;let r;return e[0]===t?r=e[1]:(r=e=>{let n=t.patch({autoSync:{mode:e,enabled:null}});return n.ok?{ok:!0}:{ok:!1,error:b(n.error)}},e[0]=t,e[1]=r),r}function ke(){let e=(0,U.c)(2),{projectBinding:t,projectSynced:n}=w();if(t===null||!n)return null;let r;return e[0]===t?r=e[1]:(r=e=>{let n=t.patch({autoSync:{default:e}});return n.ok?{ok:!0}:{ok:!1,error:b(n.error)}},e[0]=t,e[1]=r),r}function Ae(){let e=(0,U.c)(2),{projectLocalBinding:t,projectLocalSynced:n}=w();if(t===null||!n)return null;let r;return e[0]===t?r=e[1]:(r=e=>{let n=t.patch({autoSync:e});return n.ok?{ok:!0}:{ok:!1,error:b(n.error)}},e[0]=t,e[1]=r),r}function je(e,t){let n=(0,U.c)(12),{_:r}=i(),[a,o]=(0,W.useState)(!1),s;n[0]!==r||n[1]!==e?(s=function(t){if(e===null)return v.info(r({id:`fiMNLl`}),{id:`sync-settings-not-ready`}),!1;let n=e(t);if(!n.ok){console.error(`[sync] toggle failed:`,n.error);let e=n.error;return v.error(r(t?{id:`04RA0-`,values:{detail:e}}:{id:`qjHMHf`,values:{detail:e}})),!1}return!0},n[0]=r,n[1]=e,n[2]=s):s=n[2];let c=s,l;n[3]===c?l=n[4]:(l=function(e){if(e){o(!0);return}c(!1)},n[3]=c,n[4]=l);let u=l,d;n[5]!==c||n[6]!==t?(d=function(){c(!0)&&(o(!1),t?.onEnabled?.())},n[5]=c,n[6]=t,n[7]=d):d=n[7];let f=d,p;return n[8]!==a||n[9]!==f||n[10]!==u?(p={confirmOpen:a,setConfirmOpen:o,onToggleRequest:u,onConfirm:f},n[8]=a,n[9]=f,n[10]=u,n[11]=p):p=n[11],p}function Me(e,t,n){let r=(0,U.c)(22),{_:a}=i(),[o,s]=(0,W.useState)(!1),[c,l]=(0,W.useState)(null),u;r[0]!==a||r[1]!==n||r[2]!==e?(u=function(t){if(e===null)return v.info(a({id:`fiMNLl`}),{id:`sync-settings-not-ready`}),!1;let r=e(t);if(!r.ok){console.error(`[sync] mode change failed:`,r.error);let e=r.error;return v.error(a({id:`nOEDQs`,values:{detail:e}})),!1}return n?.onApplied?.(t),!0},r[0]=a,r[1]=n,r[2]=e,r[3]=u):u=r[3];let d=u,f;r[4]!==d||r[5]!==t?(f=function(e){if(e!==t){if(e===`off`){d(`off`);return}l(e),s(!0)}},r[4]=d,r[5]=t,r[6]=f):f=r[6];let p=f,m;r[7]===d?m=r[8]:(m=function(){return d(`off`)},r[7]=d,r[8]=m);let h=m,g;r[9]!==d||r[10]!==t?(g=function(){return d(t)},r[9]=d,r[10]=t,r[11]=g):g=r[11];let _=g,y;r[12]!==d||r[13]!==c?(y=function(){c!==null&&d(c)&&s(!1)},r[12]=d,r[13]=c,r[14]=y):y=r[14];let b=y,x;return r[15]!==o||r[16]!==b||r[17]!==_||r[18]!==p||r[19]!==h||r[20]!==c?(x={confirmOpen:o,setConfirmOpen:s,pendingMode:c,onModeSelect:p,onTurnOff:h,onKeepCurrent:_,onConfirm:b},r[15]=o,r[16]=b,r[17]=_,r[18]=p,r[19]=h,r[20]=c,r[21]=x):x=r[21],x}function Ne(){let e=(0,U.c)(2),{projectLocalBinding:t,projectLocalSynced:n}=w();if(t===null||!n)return null;let r;return e[0]===t?r=e[1]:(r=e=>{let n=t.patch({autoSync:e});return n.ok?{ok:!0}:{ok:!1,error:b(n.error)}},e[0]=t,e[1]=r),r}function Pe(e,t,n){let r=(0,U.c)(19),{_:a}=i(),o=Ne(),[s,c]=(0,W.useState)(!1),[l,u]=(0,W.useState)(null),d;r[0]!==e||r[1]!==t?(d=C(e)??t,r[0]=e,r[1]=t,r[2]=d):d=r[2];let f=d,p;r[3]!==a||r[4]!==o?(p=function(e){if(o===null)return v.info(a({id:`fiMNLl`}),{id:`sync-settings-not-ready`}),!1;let t=o(e);if(!t.ok){console.error(`[sync] badge control failed:`,t.error);let e=t.error;return v.error(a({id:`ZVOhXM`,values:{detail:e}})),!1}return!0},r[3]=a,r[4]=o,r[5]=p):p=r[5];let m=p,h;r[6]!==m||r[7]!==f?(h=function(e){if(e!==f){if(e===`off`){m({mode:`off`,enabled:null,resumeMode:null});return}u(e),c(!0)}},r[6]=m,r[7]=f,r[8]=h):h=r[8];let g=h,_;r[9]!==m||r[10]!==l?(_=function(){l!==null&&m({mode:l,enabled:null,resumeMode:null})&&(c(!1),u(null))},r[9]=m,r[10]=l,r[11]=_):_=r[11];let y=_,b=l===`follow`?n:0,x;return r[12]!==s||r[13]!==f||r[14]!==y||r[15]!==g||r[16]!==l||r[17]!==b?(x={mode:f,confirmOpen:s,setConfirmOpen:c,pendingMode:l,strandedCommitCount:b,onModeSelect:g,onConfirm:y},r[12]=s,r[13]=f,r[14]=y,r[15]=g,r[16]=l,r[17]=b,r[18]=x):x=r[18],x}async function Fe(e){let t=await fetch(`/api/sync/trigger`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({op:e})});if(!t.ok)throw Error(`sync trigger failed: ${t.status}`)}var Ie=5e3,Le=15e3,Re=3e4,ze=0;function Be(){let e=Date.now();e-ze<Re||(ze=e,Fe(`fetch`).catch(()=>{ze===e&&(ze=0)}))}async function Ve(e){try{let t=await fetch(`/api/git/worktree-status`,{signal:e});if(!t.ok)return console.warn(`[sync] worktree status read failed: http`,t.status),{kind:`failed`,reason:`http`};let n=await t.json();return n.readable===!1?{kind:`unreadable`}:{kind:`ok`,status:n}}catch(t){return e.aborted?{kind:`failed`,reason:`aborted`}:(console.warn(`[sync] worktree status read failed: network`,t instanceof Error?t.message:t),{kind:`failed`,reason:`network`})}}var He={status:null,unreadable:!1,stale:!1,lastReadAt:null};function Ue(e){let t=(0,U.c)(9),[n,r]=(0,W.useState)(He),i,a;t[0]===e?(i=t[1],a=t[2]):(i=()=>{if(!e)return;let t=!1,n=!1,i=!1,a=null;function o(){if(n){i=!0;return}n=!0;let e=new AbortController;a=e;let s=setTimeout(()=>e.abort(),Le);Ve(e.signal).then(e=>{if(!t){if(e.kind===`ok`){r({status:e.status,unreadable:!1,stale:!1,lastReadAt:Date.now()});return}if(e.kind===`unreadable`){r(Ge);return}r(We)}}).finally(()=>{clearTimeout(s),a===e&&(a=null),n=!1,i&&!t&&(i=!1,o())})}o(),Be();let s=setInterval(o,Ie),c=x(e=>{e.includes(`sync-status`)&&o()});return()=>{t=!0,clearInterval(s),c(),a?.abort()}},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,W.useEffect)(i,a);let o=e&&n.status===null&&!n.unreadable,s;return t[3]!==n.lastReadAt||t[4]!==n.stale||t[5]!==n.status||t[6]!==n.unreadable||t[7]!==o?(s={status:n.status,loading:o,unreadable:n.unreadable,stale:n.stale,lastReadAt:n.lastReadAt},t[3]=n.lastReadAt,t[4]=n.stale,t[5]=n.status,t[6]=n.unreadable,t[7]=o,t[8]=s):s=t[8],s}function We(e){return e.status===null?e.unreadable?e:{...e,unreadable:!0,stale:!1}:e.unreadable||e.stale?e:{...e,stale:!0}}function Ge(e){return{...e,unreadable:!0,stale:!1}}function Ke(e){return e.syncMode===void 0?e.syncEnabled?`full`:`off`:e.syncMode}var G=t();function K(e){let t=(0,U.c)(4),{variant:n}=e;if((n===void 0?`full`:n)===`follow`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(ne,{children:(0,G.jsx)(r,{id:`W7mERj`})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,G.jsxs)(G.Fragment,{children:[e,(0,G.jsx)(I,{children:(0,G.jsx)(r,{id:`KmVekT`})})]}),t[1]=n):n=t[1],n}let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.jsx)(ne,{children:(0,G.jsx)(r,{id:`Uo2Rj7`})}),t[2]=i):i=t[2];let a;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,G.jsxs)(G.Fragment,{children:[i,(0,G.jsx)(I,{children:(0,G.jsx)(r,{id:`n6hXUm`})})]}),t[3]=a):a=t[3],a}function q(e){let t=(0,U.c)(2),{variant:n}=e,r=n===void 0?`full`:n,i;return t[0]===r?i=t[1]:(i=(0,G.jsx)(ve,{children:r===`follow`?(0,G.jsx)(Je,{}):(0,G.jsx)(qe,{})}),t[0]=r,t[1]=i),i}function qe(){let e=(0,U.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)(B,{icon:(0,G.jsx)(be,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,G.jsx)(r,{id:`cdmk8A`}),body:(0,G.jsx)(r,{id:`YaeyFh`})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,G.jsx)(B,{icon:(0,G.jsx)(Ce,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,G.jsx)(r,{id:`9i21pa`}),body:(0,G.jsx)(r,{id:`KIIamL`})}),e[1]=n):n=e[1];let i;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.jsxs)(G.Fragment,{children:[t,n,(0,G.jsx)(B,{icon:(0,G.jsx)(k,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,G.jsx)(r,{id:`8cpeU3`}),body:(0,G.jsx)(r,{id:`DELNQk`})})]}),e[2]=i):i=e[2],i}function Je(){let e=(0,U.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)(B,{icon:(0,G.jsx)(V,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,G.jsx)(r,{id:`0xnQ_X`}),body:(0,G.jsx)(r,{id:`aCoQfY`})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,G.jsx)(B,{icon:(0,G.jsx)(we,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,G.jsx)(r,{id:`5rnB76`}),body:(0,G.jsx)(r,{id:`kXNv8P`})}),e[1]=n):n=e[1];let i;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.jsxs)(G.Fragment,{children:[t,n,(0,G.jsx)(B,{icon:(0,G.jsx)(A,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),title:(0,G.jsx)(r,{id:`oBK5fD`}),body:(0,G.jsx)(r,{id:`8Wav8y`})})]}),e[2]=i):i=e[2],i}function Ye(e){let t=(0,U.c)(24),{open:n,onOpenChange:i,onConfirm:a,variant:o,strandedCommitCount:s}=e,c=o===void 0?`full`:o,l=s===void 0?0:s,u=c===`follow`&&l>0,d;t[0]===c?d=t[1]:(d=(0,G.jsx)(oe,{children:(0,G.jsx)(K,{variant:c})}),t[0]=c,t[1]=d);let f;t[2]===c?f=t[3]:(f=(0,G.jsx)(q,{variant:c}),t[2]=c,t[3]=f);let p;t[4]!==u||t[5]!==l?(p=u&&(0,G.jsx)(`p`,{className:`mt-4 text-sm text-muted-foreground`,children:(0,G.jsx)(r,{id:`caw8gO`,values:{strandedCommitCount:l}})}),t[4]=u,t[5]=l,t[6]=p):p=t[6];let m;t[7]!==f||t[8]!==p?(m=(0,G.jsxs)(L,{children:[f,p]}),t[7]=f,t[8]=p,t[9]=m):m=t[9];let h;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,G.jsx)(ae,{asChild:!0,children:(0,G.jsx)(_,{variant:`outline`,children:(0,G.jsx)(r,{id:`dEgA5A`})})}),t[10]=h):h=t[10];let g;t[11]===c?g=t[12]:(g=c===`follow`?(0,G.jsx)(r,{id:`jTUxaN`}):(0,G.jsx)(r,{id:`pPiV8s`}),t[11]=c,t[12]=g);let v;t[13]!==a||t[14]!==g?(v=(0,G.jsxs)(ie,{children:[h,(0,G.jsx)(_,{onClick:a,children:g})]}),t[13]=a,t[14]=g,t[15]=v):v=t[15];let y;t[16]!==d||t[17]!==m||t[18]!==v?(y=(0,G.jsxs)(re,{className:`sm:max-w-lg`,children:[d,m,v]}),t[16]=d,t[17]=m,t[18]=v,t[19]=y):y=t[19];let b;return t[20]!==i||t[21]!==n||t[22]!==y?(b=(0,G.jsx)(se,{open:n,onOpenChange:i,children:y}),t[20]=i,t[21]=n,t[22]=y,t[23]=b):b=t[23],b}async function Xe(e){let t=await fetch(`/api/sync/resolve-blocking`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:e})});if(!t.ok)throw Error(`sync resolve-blocking failed: ${t.status}`)}function Ze(){return typeof window<`u`&&window.okDesktop!=null}function Qe(e){let t=(0,U.c)(23),{paths:n}=e,[i,a]=(0,W.useState)(null),[o,s]=(0,W.useState)(!1);if(n.length===0)return null;let c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=async function(e){a(e),s(!1);try{await Xe(e),a(null)}catch{s(!0),a(null)}},t[0]=c):c=t[0];let l=c,u=i!==null,d;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,G.jsx)(`span`,{id:`sync-blocking-heading`,className:`text-xs font-medium text-foreground`,children:(0,G.jsx)(r,{id:`sdvHp3`})}),t[1]=d):d=t[1];let f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,G.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[d,(0,G.jsx)(`span`,{className:`text-2xs text-muted-foreground`,children:(0,G.jsx)(r,{id:`H4doZt`})})]}),t[2]=f):f=t[2];let p;t[3]===n?p=t[4]:(p=n.map(et),t[3]=n,t[4]=p);let m;t[5]===p?m=t[6]:(m=(0,G.jsx)(`ul`,{"aria-labelledby":`sync-blocking-heading`,className:`flex max-h-28 flex-col gap-1 overflow-y-auto overscroll-contain`,"data-testid":`sync-blocking-list`,children:p}),t[5]=p,t[6]=m);let h;t[7]===o?h=t[8]:(h=o&&(0,G.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,"data-testid":`sync-blocking-error`,children:(0,G.jsx)(r,{id:`FsEXax`})}),t[7]=o,t[8]=h);let g;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>void l(`commit`),t[9]=g):g=t[9];let v;t[10]===i?v=t[11]:(v=i===`commit`&&(0,G.jsx)(j,{"aria-hidden":`true`,"data-icon":`inline-start`}),t[10]=i,t[11]=v);let y;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,G.jsx)(r,{id:`N7Lau6`}),t[12]=y):y=t[12];let b;t[13]!==u||t[14]!==v?(b=(0,G.jsxs)(_,{size:`xs`,disabled:u,onClick:g,"data-testid":`sync-blocking-commit`,children:[v,y]}),t[13]=u,t[14]=v,t[15]=b):b=t[15];let x;t[16]===u?x=t[17]:(x=Ze()&&(0,G.jsxs)(_,{variant:`link-muted`,size:`xs`,className:`self-start p-0`,disabled:u,onClick:$e,"data-testid":`sync-blocking-terminal`,children:[(0,G.jsx)(N,{"data-icon":`inline-start`}),(0,G.jsx)(r,{id:`6EoD0z`})]}),t[16]=u,t[17]=x);let S;return t[18]!==b||t[19]!==x||t[20]!==m||t[21]!==h?(S=(0,G.jsxs)(`div`,{className:`flex flex-col gap-2 border-t pt-3`,children:[f,m,h,b,x]}),t[18]=b,t[19]=x,t[20]=m,t[21]=h,t[22]=S):S=t[22],S}function $e(){return ye(`git-status`)}function et(e){return(0,G.jsx)(`li`,{title:e,className:`min-w-0 truncate font-mono text-2xs text-foreground`,children:e},e)}function J(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function tt(e){return e===``?[]:e.split(`/`)}function nt(e){if(e.length===0)return``;let t=tt(J(e[0]));for(let n of e.slice(1)){let e=tt(J(n)),r=0;for(;r<t.length&&r<e.length&&t[r]===e[r];)r++;if(t=t.slice(0,r),t.length===0)break}return t.join(`/`)}function Y(e,t){return e===``?t:t.slice(e.length+1)}function rt(e,t=8){if(e.length===0)return{prefix:``,groups:[],loose:[]};if(e.length===1)return{prefix:``,groups:[],loose:[{entry:e[0],label:e[0].path}]};let n=nt(e.map(e=>e.path)),r=e.map(e=>{let t=Y(n,e.path);return{entry:e,rel:t,key:J(t)}}),i=()=>new Set(r.map(e=>e.key));for(;i().size>t;){let e=Math.max(...r.map(e=>tt(e.key).length));if(e===0)break;for(let t of r)tt(t.key).length===e&&(t.key=J(t.key))}let a=new Map;for(let{entry:e,rel:t,key:n}of r){let r=a.get(n)??[];r.push({entry:e,label:n===``?t:t.slice(n.length+1)}),a.set(n,r)}let o=[],s=[];for(let[e,t]of a)if(e===``||t.length===1)for(let e of t)s.push({entry:e.entry,label:Y(n,e.entry.path)});else o.push({dir:e,rows:t});return o.sort((e,t)=>t.rows.length-e.rows.length||e.dir.localeCompare(t.dir)),s.sort((e,t)=>e.entry.path.localeCompare(t.entry.path)),{prefix:n,groups:o,loose:s}}function it(e=`sync`,t){Fe(e).catch(e=>{console.warn(`[sync-badge] manual sync trigger failed`,e instanceof Error?e.message:e),t?.()})}function at(e){typeof window>`u`||(_e(),ue(window.location.hash,e)||(window.location.hash=e))}function ot(e){return e.kind===`doc`?de(e.docName):le(e.path)}var st=3e4;function X(e,t,n){let r=n-t;return r<6e4?e({id:`xOTzt5`}):r<36e5?e({id:`_rP3HI`,values:{minutes:Math.floor(r/6e4)}}):r<864e5?e({id:`nYeBmY`,values:{hours:Math.floor(r/36e5)}}):new Date(t).toLocaleDateString()}function Z(e,t){return X(e,new Date(t).getTime(),Date.now())}function ct(){let e=(0,U.c)(2),[t,n]=(0,W.useState)(lt),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=setInterval(()=>n(Date.now()),st);return()=>clearInterval(e)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,W.useEffect)(r,i),t}function lt(){return Date.now()}function Q(e){return e.syncMode===`follow`}var ut=[`git-operation-in-progress`,`unsafe-incoming-symlinks`];function $(e){return ut.includes(e)}function dt(e){return e.state===`idle`&&e.conflictCount>0?`conflict`:(e.state===`idle`||e.state===`offline`)&&$(e.pausedReason)?`disabled`:e.state}function ft(e){let t=(0,U.c)(23),{status:n,size:r}=e,i=r===void 0?`size-3.5`:r;switch(dt(n)){case`dormant`:{let e=`${i} text-muted-foreground`,n;return t[0]===e?n=t[1]:(n=(0,G.jsx)(H,{className:e}),t[0]=e,t[1]=n),n}case`idle`:{if(n.ahead>0||n.behind>0){let e=`${i} text-muted-foreground`,n;return t[2]===e?n=t[3]:(n=(0,G.jsx)(M,{className:e}),t[2]=e,t[3]=n),n}let e=`${i} text-muted-foreground`,r;return t[4]===e?r=t[5]:(r=(0,G.jsx)(H,{className:e}),t[4]=e,t[5]=r),r}case`fetching`:case`pulling`:case`pushing`:{let e=`${i} text-muted-foreground`,n;return t[6]===e?n=t[7]:(n=(0,G.jsx)(j,{"aria-hidden":`true`,icon:M,className:e}),t[6]=e,t[7]=n),n}case`conflict`:{let e=`${i} text-warning`,n;return t[8]===e?n=t[9]:(n=(0,G.jsx)(P,{className:e}),t[8]=e,t[9]=n),n}case`offline`:{let e=`${i} text-muted-foreground`,n;return t[10]===e?n=t[11]:(n=(0,G.jsx)(Se,{className:e}),t[10]=e,t[11]=n),n}case`auth-error`:{let e;return t[12]!==i||t[13]!==n?(e=Ot(n)?(0,G.jsx)(xe,{className:`${i} text-destructive`}):(0,G.jsx)(Te,{className:`${i} text-destructive`}),t[12]=i,t[13]=n,t[14]=e):e=t[14],e}case`disabled`:{if(n.pausedReason){let e=`${i} text-warning`,n;return t[15]===e?n=t[16]:(n=(0,G.jsx)(P,{className:e}),t[15]=e,t[16]=n),n}if(n.ahead>0||n.behind>0){let e=`${i} text-muted-foreground`,n;return t[17]===e?n=t[18]:(n=(0,G.jsx)(M,{className:e}),t[17]=e,t[18]=n),n}let e=`${i} text-muted-foreground`,r;return t[19]===e?r=t[20]:(r=(0,G.jsx)(H,{className:e}),t[19]=e,t[20]=r),r}default:{let e=`${i} text-muted-foreground`,n;return t[21]===e?n=t[22]:(n=(0,G.jsx)(H,{className:e}),t[21]=e,t[22]=n),n}}}function pt(e){switch(dt(e)){case`idle`:return!Q(e)&&e.ahead>0?`↑${e.ahead}`:e.behind>0?`↓${e.behind}`:``;case`fetching`:case`pulling`:case`pushing`:return``;case`conflict`:return e.conflictCount>0?`${e.conflictCount}`:``;case`offline`:return``;case`auth-error`:return``;default:return``}}function mt(e){let t=Q(e),n=dt(e);switch(n){case`dormant`:return y._({id:`RmBY0A`});case`idle`:return t?y._({id:`j5CWO4`}):y._({id:`N2FcBE`});case`fetching`:return t?y._({id:`7IsvrP`}):y._({id:`Wgmlsw`});case`pulling`:return t?y._({id:`JL3si7`}):y._({id:`4uNLmk`});case`pushing`:return y._({id:`iycx_A`});case`conflict`:return y._({id:`IInnZo`});case`offline`:return y._({id:`6Aih4U`});case`auth-error`:return y._({id:`mHVPm5`});case`disabled`:return e.pausedReason?y._({id:`U6wmNc`}):y._({id:`BWTzAb`});default:return n}}var ht=[`git-index-locked`],gt={"git-index-locked":{id:`sOcMdy`},"git-operation-in-progress":{id:`mJTr6D`},"external-changes-pending":{id:`W9_Bub`},"dirty-tree":{id:`a5Gha5`},"non-content-merge-failure":{id:`sIxSSP`},"detached-head":{id:`uQNW00`},"diverged-local-commits":{id:`LQsCPn`},"auth-error":{id:`mHVPm5`},"protected-branch":{id:`8fc_3j`},"no-push-permission":{id:`EiVgl5`},"no-commits-yet":{id:`-ZVU5v`},"unsafe-incoming-symlinks":{id:`8qsUJv`}};function _t(e){return Object.hasOwn(gt,e)}function vt(e,t){return _t(t)?e(gt[t]):t}function yt(e){return ht.includes(e)}function bt(e){throw Error(`Unhandled node-rendered paused reason: ${String(e)}`)}function xt(e){let t=(0,U.c)(3),{reason:n}=e;switch(n){case`git-index-locked`:{let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(r,{id:`Qca--K`,components:{0:(0,G.jsx)(`span`,{dir:`ltr`,className:`font-mono`})}}),t[0]=e):e=t[0],e}default:{let e;return t[1]===n?e=t[2]:(e=bt(n),t[1]=n,t[2]=e),e}}}function St(e){let t=(0,U.c)(4),{paths:n}=e;if(n===void 0||n.length===0)return null;let r;t[0]===n?r=t[1]:(r=n.map(Ct),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,G.jsx)(`ul`,{className:`flex max-h-28 flex-col gap-1 overflow-y-auto overscroll-contain`,"data-testid":`sync-refused-symlinks`,children:r}),t[2]=r,t[3]=i),i}function Ct(e){return(0,G.jsx)(`li`,{title:e,dir:`ltr`,className:`min-w-0 truncate font-mono text-2xs text-foreground`,children:e},e)}function wt(e){let t=(0,U.c)(7),{reason:n}=e,{_:r}=i();if(yt(n)){let e;return t[0]===n?e=t[1]:(e=(0,G.jsx)(xt,{reason:n}),t[0]=n,t[1]=e),e}let a;t[2]!==r||t[3]!==n?(a=vt(r,n),t[2]=r,t[3]=n,t[4]=a):a=t[4];let o;return t[5]===a?o=t[6]:(o=(0,G.jsx)(G.Fragment,{children:a}),t[5]=a,t[6]=o),o}function Tt(e,t){let n=[];switch(e){case`not-authenticated`:n.push(y._({id:`ycIX5i`}));break;case`no-collaborator`:n.push(y._({id:`EiVgl5`}));break;case`private-no-access`:n.push(y._({id:`07gHun`}));break;case`repo-not-found`:n.push(y._({id:`uksqrP`}));break;default:n.push(y._({id:`EiVgl5`}))}return n.push(...Et(t)),n}function Et(e){let t=[];if(e?.resolvedLogin){let n=e.resolvedLogin;t.push(y._({id:`ZKVuLY`,values:{login:n}}))}return e?.declaredLogin&&t.push(Dt(e.declaredLogin,e.declaredSource)),t}function Dt(e,t){switch(t){case`remote-url`:return y._({id:`CMd-g-`,values:{declaredLogin:e}});case`credential-config`:return y._({id:`akOe4q`,values:{declaredLogin:e}});default:return y._({id:`GBEqoP`,values:{declaredLogin:e}})}}function Ot(e){return e.pushErrorCode===`auth-not-found-as-identity`||e.pullErrorCode===`auth-not-found-as-identity`}function kt(e){return e?.pausedReason===`auth-error`&&Ot(e)}function At(e){return e?.checkStatus===`denied`&&e.deniedReason===`not-authenticated`}function jt(e){return typeof e?.webUrl==`string`}function Mt(e){return e!=null&&!jt(e)}function Nt(e){return e?.transport===void 0||e.transport===`https`}function Pt(e,t){switch(e){case`auth-401`:return t?y._({id:`-Qw-1t`}):y._({id:`LVWA9A`});case`auth-scope-mismatch`:return t?y._({id:`Zue_jx`}):y._({id:`yLyiQV`});case`auth-no-credential`:return t?y._({id:`uCaIdy`}):y._({id:`xJ7qrb`});default:return null}}function Ft(e,t){let n=Pt(e,t);if(n!==null)return n;switch(e){case`auth-403`:return y._({id:`EiVgl5`});case`semantic-protected-branch`:return y._({id:`T0OVm7`});case`auth-not-found-as-identity`:return y._({id:`jRsjlF`});default:return y._({id:`1AumWo`})}}function It(e,t){let n=Pt(e,t);if(n!==null)return n;switch(e){case`auth-403`:return y._({id:`RgbKEe`});case`auth-not-found-as-identity`:return y._({id:`jRsjlF`});default:return y._({id:`jZ_E5M`})}}function Lt(e,t){let n=Pt(e,t);if(n!==null)return n;switch(e){case`auth-403`:return y._({id:`RgbKEe`});case`semantic-protected-branch`:return y._({id:`T0OVm7`});case`auth-not-found-as-identity`:return y._({id:`jRsjlF`});default:return y._({id:`cUk6TF`})}}function Rt(e){let t=jt(e.remote),n=e.pushErrorCode!=null||e.pushError!=null,r=e.pullErrorCode!=null||e.pullError!=null;if(n&&r&&(e.pushErrorCode==null?e.pullErrorCode==null&&e.pushError===e.pullError:e.pushErrorCode===e.pullErrorCode))return[{key:`sync`,direction:null,message:e.pushErrorCode==null?e.pushError:Lt(e.pushErrorCode,t)}];let i=n&&r,a=[];return n&&a.push({key:`push`,direction:i?`push`:null,message:e.pushErrorCode?Ft(e.pushErrorCode,t):e.pushError}),r&&a.push({key:`pull`,direction:i?`pull`:null,message:e.pullErrorCode?It(e.pullErrorCode,t):e.pullError}),a}function zt(e){return e?.checkStatus===`unknown`&&e.unknownError===`token-invalid`}function Bt(e){return dt(e)===`auth-error`&&Ot(e)?y._({id:`EkEFE3`}):mt(e)}function Vt(e){let t=Q(e),n=dt(e);if(n===`conflict`&&e.conflictCount>0){let{conflictCount:t}=e;return y._({id:`cUK8lW`,values:{conflictCount:t}})}if(n===`idle`){let{ahead:n,behind:r}=e;return t?r>0?y._({id:`9o1bIV`,values:{behind:r}}):y._({id:`j5CWO4`}):n>0&&r>0?y._({id:`5F5HYj`,values:{ahead:n,behind:r}}):n>0?y._({id:`PdA9NZ`,values:{ahead:n}}):r>0?y._({id:`9o1bIV`,values:{behind:r}}):y._({id:`N2FcBE`})}return Bt(e)}function Ht(e){let t=(0,U.c)(3),{children:n,id:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,G.jsx)(`span`,{id:r,className:`font-mono uppercase tracking-wide text-2xs text-muted-foreground`,children:n}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function Ut(e){switch(e){case`M`:return y._({id:`tgWuMB`});case`A`:return y._({id:`hp8OtS`});case`D`:return y._({id:`vGjmyl`});case`R`:return y._({id:`QeREu8`});case`C`:return y._({id:`6V3Ea3`});case`U`:return y._({id:`cyoNqf`});case`T`:return y._({id:`zWZBPx`});case`?`:return y._({id:`C2abof`});case`!`:return y._({id:`xDKOFk`});default:return y._({id:`cNsIJf`})}}function Wt(e){switch(e){case`D`:return`destructive`;case`U`:return`warning`;default:return`gray`}}function Gt(e){let t=(0,U.c)(25),{entry:n,dimmed:r,label:i}=e,a;t[0]===n.code?a=t[1]:(a=Ut(n.code),t[0]=n.code,t[1]=a);let l=a,u=n.open,d=`truncate text-start font-mono text-2xs ${r?`text-muted-foreground/60`:`text-foreground`}`,f;t[2]===n.code?f=t[3]:(f=Wt(n.code),t[2]=n.code,t[3]=f);let p;t[4]===n.code?p=t[5]:(p=(0,G.jsx)(`span`,{"aria-hidden":!0,children:n.code}),t[4]=n.code,t[5]=p);let m;t[6]===l?m=t[7]:(m=(0,G.jsx)(`span`,{className:`sr-only`,children:l}),t[6]=l,t[7]=m);let h;t[8]!==f||t[9]!==p||t[10]!==m?(h=(0,G.jsx)(o,{asChild:!0,children:(0,G.jsxs)(F,{variant:f,className:`size-4 shrink-0 justify-center p-0 text-2xs leading-none`,children:[p,m]})}),t[8]=f,t[9]=p,t[10]=m,t[11]=h):h=t[11];let g;t[12]===l?g=t[13]:(g=(0,G.jsx)(s,{children:l}),t[12]=l,t[13]=g);let v;t[14]!==h||t[15]!==g?(v=(0,G.jsxs)(c,{children:[h,g]}),t[14]=h,t[15]=g,t[16]=v):v=t[16];let y;t[17]!==n.path||t[18]!==i||t[19]!==u||t[20]!==d?(y=u?(0,G.jsxs)(c,{children:[(0,G.jsx)(o,{asChild:!0,children:(0,G.jsx)(pe,{asChild:!0,children:(0,G.jsx)(_,{variant:`link-muted`,size:`xs`,className:`h-auto min-h-6 min-w-0 shrink justify-start overflow-hidden p-0 font-normal`,"aria-label":n.path,onClick:()=>at(ot(u)),"data-testid":`worktree-row-open`,children:(0,G.jsx)(`span`,{dir:`auto`,className:`min-w-0 ${d}`,children:i})})})}),(0,G.jsx)(s,{dir:`auto`,className:`font-mono text-2xs`,children:n.path})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(c,{children:[(0,G.jsx)(o,{asChild:!0,children:(0,G.jsx)(`span`,{dir:`auto`,tabIndex:0,className:`min-w-0 rounded-xs focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 ${d}`,children:i})}),(0,G.jsx)(s,{dir:`auto`,className:`font-mono text-2xs`,children:n.path})]}),i!==n.path&&(0,G.jsx)(`span`,{className:`sr-only`,children:n.path})]}),t[17]=n.path,t[18]=i,t[19]=u,t[20]=d,t[21]=y):y=t[21];let b;return t[22]!==v||t[23]!==y?(b=(0,G.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2`,children:[v,y]}),t[22]=v,t[23]=y,t[24]=b):b=t[24],b}function Kt(e){let t=(0,U.c)(15),{rows:n,dimmed:i}=e,[a,o]=(0,W.useState)(!1),s=n.length>6,c;t[0]!==n||t[1]!==a?(c=a?n:n.slice(0,6),t[0]=n,t[1]=a,t[2]=c):c=t[2];let l=c,u=n.length-6,d;if(t[3]!==i||t[4]!==l){let e;t[6]===i?e=t[7]:(e=e=>{let{entry:t,label:n}=e;return(0,G.jsx)(Gt,{entry:t,dimmed:i,label:n},`${t.code}:${t.path}`)},t[6]=i,t[7]=e),d=l.map(e),t[3]=i,t[4]=l,t[5]=d}else d=t[5];let f;t[8]!==s||t[9]!==u||t[10]!==a?(f=s&&(0,G.jsx)(`li`,{children:(0,G.jsx)(_,{variant:`link-muted`,size:`xs`,"aria-expanded":a,className:`h-auto min-h-6 justify-start p-0 text-2xs font-normal`,onClick:()=>o(qt),"data-testid":`worktree-rows-show-all`,children:a?(0,G.jsx)(r,{id:`H86f9p`}):(0,G.jsx)(r,{id:`B6Lac2`,values:{overflowCount:u}})})}),t[8]=s,t[9]=u,t[10]=a,t[11]=f):f=t[11];let p;return t[12]!==d||t[13]!==f?(p=(0,G.jsxs)(`ul`,{className:`flex flex-col gap-1`,children:[d,f]}),t[12]=d,t[13]=f,t[14]=p):p=t[14],p}function qt(e){return!e}function Jt(e){let t=(0,U.c)(25),{group:n,prefix:i,dimmed:a}=e,f=n.rows.length,[p,m]=(0,W.useState)(!1),h=i===``?n.dir:`${i}/${n.dir}`,g=`size-3 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none ${p?`rotate-90`:``}`,v;t[0]===g?v=t[1]:(v=(0,G.jsx)(O,{className:g,"aria-hidden":!0}),t[0]=g,t[1]=v);let y;t[2]===n.dir?y=t[3]:(y=(0,G.jsx)(`span`,{dir:`auto`,className:`min-w-0 truncate text-start font-mono text-2xs text-muted-foreground`,children:n.dir}),t[2]=n.dir,t[3]=y);let b;t[4]===f?b=t[5]:(b=(0,G.jsx)(`span`,{"aria-hidden":!0,className:`ms-auto shrink-0 ps-1 text-2xs text-muted-foreground tabular-nums`,children:f}),t[4]=f,t[5]=b);let x;t[6]===f?x=t[7]:(x=(0,G.jsx)(`span`,{className:`sr-only`,children:(0,G.jsx)(r,{id:`u3BOHd`,values:{fileCount:f}})}),t[6]=f,t[7]=x);let S;t[8]!==v||t[9]!==y||t[10]!==b||t[11]!==x?(S=(0,G.jsx)(o,{asChild:!0,children:(0,G.jsx)(u,{asChild:!0,children:(0,G.jsxs)(_,{variant:`ghost`,size:`xs`,className:`h-auto min-h-6 w-full justify-start gap-1 px-0 font-normal`,children:[v,y,b,x]})})}),t[8]=v,t[9]=y,t[10]=b,t[11]=x,t[12]=S):S=t[12];let C;t[13]===h?C=t[14]:(C=(0,G.jsx)(s,{dir:`auto`,className:`font-mono text-2xs`,children:h}),t[13]=h,t[14]=C);let w;t[15]!==S||t[16]!==C?(w=(0,G.jsxs)(c,{children:[S,C]}),t[15]=S,t[16]=C,t[17]=w):w=t[17];let T;t[18]!==a||t[19]!==n.rows?(T=(0,G.jsx)(l,{className:`ps-4`,children:(0,G.jsx)(Kt,{rows:n.rows,dimmed:a})}),t[18]=a,t[19]=n.rows,t[20]=T):T=t[20];let E;return t[21]!==p||t[22]!==w||t[23]!==T?(E=(0,G.jsxs)(d,{open:p,onOpenChange:m,className:`flex flex-col gap-1`,children:[w,T]}),t[21]=p,t[22]=w,t[23]=T,t[24]=E):E=t[24],E}function Yt(e){let t=(0,U.c)(39),{title:n,note:i,entries:a,dimmed:o}=e,s=o===void 0?!1:o;if(a.length===0)return null;let c=a.length,f,p,m,h,g,v,y,b,x;if(t[0]!==s||t[1]!==a||t[2]!==c||t[3]!==i||t[4]!==n){let{prefix:e,groups:o,loose:S}=rt(a);m=S,p=d,b=`flex flex-col gap-1`;let C;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,G.jsx)(O,{className:`size-3 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none group-data-[state=open]:rotate-90`,"aria-hidden":!0}),t[14]=C):C=t[14];let w;t[15]===n?w=t[16]:(w=(0,G.jsx)(`span`,{className:`text-2xs font-medium text-muted-foreground`,children:n}),t[15]=n,t[16]=w);let T;t[17]===c?T=t[18]:(T=(0,G.jsx)(`span`,{className:`ms-auto shrink-0 ps-1 text-2xs text-muted-foreground tabular-nums`,children:(0,G.jsx)(r,{id:`u3BOHd`,values:{fileCount:c}})}),t[17]=c,t[18]=T),t[19]!==w||t[20]!==T?(x=(0,G.jsx)(u,{asChild:!0,children:(0,G.jsxs)(_,{variant:`ghost`,size:`xs`,className:`group h-auto min-h-6 w-full justify-start gap-1 px-0 font-normal data-[state=open]:bg-transparent`,children:[C,w,T]})}),t[19]=w,t[20]=T,t[21]=x):x=t[21],f=l,h=`flex flex-col gap-1 ps-3`,t[22]===i?g=t[23]:(g=i&&(0,G.jsx)(`span`,{className:`text-2xs text-muted-foreground/80`,children:i}),t[22]=i,t[23]=g),v=e!==``&&(0,G.jsxs)(`span`,{dir:`auto`,className:`break-all font-mono text-2xs text-muted-foreground`,children:[e,`/`]}),y=o.map(t=>(0,G.jsx)(Jt,{group:t,prefix:e,dimmed:s},e===``?t.dir:`${e}/${t.dir}`)),t[0]=s,t[1]=a,t[2]=c,t[3]=i,t[4]=n,t[5]=f,t[6]=p,t[7]=m,t[8]=h,t[9]=g,t[10]=v,t[11]=y,t[12]=b,t[13]=x}else f=t[5],p=t[6],m=t[7],h=t[8],g=t[9],v=t[10],y=t[11],b=t[12],x=t[13];let S;t[24]!==s||t[25]!==m?(S=m.length>0&&(0,G.jsx)(Kt,{rows:m,dimmed:s}),t[24]=s,t[25]=m,t[26]=S):S=t[26];let C;t[27]!==f||t[28]!==h||t[29]!==g||t[30]!==v||t[31]!==y||t[32]!==S?(C=(0,G.jsxs)(f,{className:h,children:[g,v,y,S]}),t[27]=f,t[28]=h,t[29]=g,t[30]=v,t[31]=y,t[32]=S,t[33]=C):C=t[33];let w;return t[34]!==p||t[35]!==b||t[36]!==x||t[37]!==C?(w=(0,G.jsxs)(p,{className:b,children:[x,C]}),t[34]=p,t[35]=b,t[36]=x,t[37]=C,t[38]=w):w=t[38],w}function Xt(e){let t=(0,U.c)(9),{direction:n,count:r}=e,{_:a}=i();if(r<=0)return null;let o;t[0]===n?o=t[1]:(o=n===`behind`?(0,G.jsx)(E,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}):(0,G.jsx)(D,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}),t[0]=n,t[1]=o);let s;t[2]!==a||t[3]!==r||t[4]!==n?(s=a(n===`behind`?{id:`sKHiNR`,values:{count:r}}:{id:`9ZxzfT`,values:{count:r}}),t[2]=a,t[3]=r,t[4]=n,t[5]=s):s=t[5];let c;return t[6]!==o||t[7]!==s?(c=(0,G.jsxs)(`span`,{className:`flex flex-1 items-center gap-1.5 rounded-md bg-muted px-2 py-1 text-xs text-foreground`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8],c}function Zt(e){let t=new Set,n=[],r=[];for(let i of[...e.staged,...e.notStaged,...e.untracked])t.has(i.path)||(t.add(i.path),(i.syncScoped?n:r).push(i));return{willPush:n,wontPush:r}}function Qt(e){let t=(0,U.c)(6),{lastReadAt:n}=e,{_:a}=i(),o=ct(),s;t[0]!==a||t[1]!==n||t[2]!==o?(s=X(a,n,o),t[0]=a,t[1]=n,t[2]=o,t[3]=s):s=t[3];let c=s,l;return t[4]===c?l=t[5]:(l=(0,G.jsx)(`p`,{className:`text-2xs text-muted-foreground`,"data-testid":`worktree-stale`,children:(0,G.jsx)(r,{id:`e-pP6g`,values:{staleRelative:c}})}),t[4]=c,t[5]=l),l}function $t(e){let t=(0,U.c)(36),{status:n,worktree:a,loading:o,unreadable:s,stale:c,lastReadAt:l}=e,u;t[0]===a?u=t[1]:(u=a?Zt(a):{willPush:[],wontPush:[]},t[0]=a,t[1]=u);let{willPush:d,wontPush:f}=u,p;t[2]===a?.incoming?p=t[3]:(p=a?.incoming??[],t[2]=a?.incoming,t[3]=p);let m=p,{_:h}=i(),g=c&&!s&&a!==null&&l!==null,_=a!==null&&d.length===0&&f.length===0&&m.length===0,v;t[4]!==h||t[5]!==g||t[6]!==s?(v=s?h({id:`L9ox9k`}):g?h({id:`_LK4d6`}):``,t[4]=h,t[5]=g,t[6]=s,t[7]=v):v=t[7];let y=v,b;t[8]===y?b=t[9]:(b=(0,G.jsx)(`div`,{className:`sr-only`,role:`status`,"aria-live":`polite`,"data-testid":`worktree-announcer`,children:y}),t[8]=y,t[9]=b);let x;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,G.jsx)(Ht,{id:`worktree-status-label`,children:(0,G.jsx)(r,{id:`uAQUqI`})}),t[10]=x):x=t[10];let S;t[11]!==s||t[12]!==a?(S=!s&&a&&(a.branch||a.detached)&&(0,G.jsx)(`span`,{className:`min-w-0 truncate font-mono text-2xs text-muted-foreground`,"data-testid":`worktree-branch`,children:a.detached?(0,G.jsx)(r,{id:`OBdkpo`}):a.upstream?`${a.branch} → ${a.upstream}`:a.branch}),t[11]=s,t[12]=a,t[13]=S):S=t[13];let C;t[14]===S?C=t[15]:(C=(0,G.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[x,S]}),t[14]=S,t[15]=C);let w;t[16]!==n.ahead||t[17]!==n.behind?(w=(n.behind>0||n.ahead>0)&&(0,G.jsxs)(`div`,{className:`flex items-stretch gap-2`,children:[(0,G.jsx)(Xt,{direction:`behind`,count:n.behind}),(0,G.jsx)(Xt,{direction:`ahead`,count:n.ahead})]}),t[16]=n.ahead,t[17]=n.behind,t[18]=w):w=t[18];let T;t[19]!==_||t[20]!==m||t[21]!==o||t[22]!==s||t[23]!==d||t[24]!==f||t[25]!==a?(T=s?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`worktree-unreadable`,children:(0,G.jsx)(r,{id:`L9ox9k`})}):o?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,G.jsx)(r,{id:`eolhcI`})}):_?(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,G.jsx)(r,{id:`WfcERq`})}):a&&(0,G.jsxs)(`section`,{className:`flex max-h-56 flex-col gap-2.5 overflow-y-auto overscroll-contain focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,tabIndex:0,"aria-labelledby":`worktree-status-label`,"data-testid":`worktree-listing`,children:[(0,G.jsx)(Yt,{title:(0,G.jsx)(r,{id:`NcwbBM`}),entries:m}),(0,G.jsx)(Yt,{title:(0,G.jsx)(r,{id:`JOhCT9`}),entries:d}),(0,G.jsx)(Yt,{title:(0,G.jsx)(r,{id:`vsFXfP`}),note:(0,G.jsx)(r,{id:`PxZCNM`}),entries:f,dimmed:!0}),a.truncated&&(0,G.jsx)(`p`,{className:`text-2xs text-muted-foreground`,children:(0,G.jsx)(r,{id:`KvwJv8`})})]}),t[19]=_,t[20]=m,t[21]=o,t[22]=s,t[23]=d,t[24]=f,t[25]=a,t[26]=T):T=t[26];let E;t[27]!==l||t[28]!==g?(E=g&&l!==null&&(0,G.jsx)(Qt,{lastReadAt:l}),t[27]=l,t[28]=g,t[29]=E):E=t[29];let D;return t[30]!==E||t[31]!==b||t[32]!==C||t[33]!==w||t[34]!==T?(D=(0,G.jsxs)(`div`,{className:`flex flex-col gap-2.5 border-t pt-3`,children:[b,C,w,T,E]}),t[30]=E,t[31]=b,t[32]=C,t[33]=w,t[34]=T,t[35]=D):D=t[35],D}function en(e){let t=(0,U.c)(19),{pulledAt:n,pushedAt:r,combinedAt:a}=e,{_:o}=i(),s,c,l;if(t[0]!==o||t[1]!==a||t[2]!==n||t[3]!==r){s=n===null?null:Z(o,n),c=r===null?null:Z(o,r);let e=a===null?null:Z(o,a);l=s!==null&&c!==null?o({id:`1TA-aJ`,values:{pulled:s,pushed:c}}):s===null?c===null?e===null?null:o({id:`irnKr_`,values:{updatedRelative:e}}):o({id:`lPkjpD`,values:{pushed:c}}):o({id:`xW5AUw`,values:{pulled:s}}),t[0]=o,t[1]=a,t[2]=n,t[3]=r,t[4]=s,t[5]=c,t[6]=l}else s=t[4],c=t[5],l=t[6];let u=l,d=s!==null||c!==null;if(u===null){let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(`span`,{}),t[7]=e):e=t[7],e}let f;t[8]!==u||t[9]!==d?(f=d&&(0,G.jsx)(`span`,{className:`sr-only`,"data-testid":`sync-popover-last-sync-label`,children:u}),t[8]=u,t[9]=d,t[10]=f):f=t[10];let p;t[11]!==u||t[12]!==s||t[13]!==c||t[14]!==d?(p=d?(0,G.jsxs)(`span`,{"aria-hidden":`true`,className:`inline-flex items-center gap-1`,children:[s!==null&&(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,G.jsx)(E,{className:`size-3`}),s]}),s!==null&&c!==null&&(0,G.jsx)(`span`,{children:`·`}),c!==null&&(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[(0,G.jsx)(D,{className:`size-3`}),c]})]}):(0,G.jsx)(`span`,{"aria-hidden":`true`,children:u}),t[11]=u,t[12]=s,t[13]=c,t[14]=d,t[15]=p):p=t[15];let m;return t[16]!==f||t[17]!==p?(m=(0,G.jsxs)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`sync-popover-last-sync`,children:[f,p]}),t[16]=f,t[17]=p,t[18]=m):m=t[18],m}function tn(){let e=(0,U.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)(pe,{asChild:!0,children:(0,G.jsx)(_,{variant:`outline`,size:`xs`,className:`self-start`,onClick:nn,"data-testid":`sync-popover-add-host-token`,children:(0,G.jsx)(r,{id:`zXZJoN`})})}),e[0]=t):t=e[0],t}function nn(){return ce()}function rn(e){let t=(0,U.c)(154),{status:n,onSignIn:a,onSetIdentity:o}=e,{_:s}=i(),{conflictCount:c}=n,{projectLocalConfig:l,projectLocalSynced:u}=w(),d=l?.autoSync,v;t[0]===n?v=t[1]:(v=Ke(n),t[0]=n,t[1]=v);let{mode:y,confirmOpen:b,setConfirmOpen:x,pendingMode:C,strandedCommitCount:T,onModeSelect:O,onConfirm:k}=Pe(d,v,n.ahead),{status:A,loading:N,unreadable:P,stale:F,lastReadAt:I}=Ue(!0),ne=y===`follow`,re;t[2]===n?re=t[3]:(re=dt(n),t[2]=n,t[3]=re);let L=re,ie;t[4]===n?ie=t[5]:(ie=Ot(n),t[4]=n,t[5]=ie);let ae=ie,oe=n.lastPullOkUtc??null,se=n.lastPushOkUtc??null,ce=n.lastRunUtc??n.lastSyncUtc??null,R=n.pushPermission?.checkStatus===`denied`&&n.pushPermission.deniedReason!==`not-authenticated`&&!ae,le;t[6]===n.remote?le=t[7]:(le=jt(n.remote),t[6]=n.remote,t[7]=le);let ue=le,fe=!R,z=L===`fetching`||L===`pulling`||L===`pushing`,[me,ge]=(0,W.useState)(null),_e,B;t[8]===z?(_e=t[9],B=t[10]):(_e=()=>{z||ge(null)},B=[z],t[8]=z,t[9]=_e,t[10]=B),(0,W.useEffect)(_e,B);let ve;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(ve=e=>{ge(t=>t===e?null:t)},t[11]=ve):ve=t[11];let ye=ve,V=z?me??(L===`pushing`?`push`:`pull`):null,be;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(be=e=>{ge(e),it(e,()=>ye(e))},t[12]=be):be=t[12];let xe=be,Se=L===`dormant`||L===`auth-error`||n.state===`conflict`,H=Se||n.conflictCount>0,Ce;t[13]===n.blockingPaths?Ce=t[14]:(Ce=n.blockingPaths??[],t[13]=n.blockingPaths,t[14]=Ce);let we=Ce,{conflicts:Te}=he(),De;t[15]===Te?De=t[16]:(De=Te.find(ln)?.docName??null,t[15]=Te,t[16]=De);let Oe=De,ke;t[17]===n?ke=t[18]:(ke=(0,G.jsx)(ft,{status:n}),t[17]=n,t[18]=ke);let Ae;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=(0,G.jsx)(`span`,{className:`text-1sm font-medium`,children:(0,G.jsx)(r,{id:`yZepkk`})}),t[19]=Ae):Ae=t[19];let je;t[20]===ke?je=t[21]:(je=(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[ke,Ae]}),t[20]=ke,t[21]=je);let Me;t[22]!==s||t[23]!==n.remote?(Me=n.remote&&(n.remote.webUrl?(0,G.jsxs)(`a`,{href:n.remote.webUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex min-w-0 items-center gap-0.5 text-xs text-foreground hover:text-primary hover:underline`,"aria-label":s({id:`1nke1r`,values:{0:n.remote.label}}),children:[(0,G.jsx)(`span`,{className:`truncate`,children:n.remote.label}),(0,G.jsx)(ee,{className:`size-3.5 shrink-0`,"aria-hidden":!0})]}):(0,G.jsx)(`span`,{className:`min-w-0 truncate text-xs text-foreground`,children:n.remote.label})),t[22]=s,t[23]=n.remote,t[24]=Me):Me=t[24];let Ne;t[25]!==je||t[26]!==Me?(Ne=(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[je,Me]}),t[25]=je,t[26]=Me,t[27]=Ne):Ne=t[27];let Fe=C??`full`,Ie;t[28]!==b||t[29]!==k||t[30]!==x||t[31]!==T||t[32]!==Fe?(Ie=(0,G.jsx)(Ye,{open:b,onOpenChange:x,onConfirm:k,variant:Fe,strandedCommitCount:T}),t[28]=b,t[29]=k,t[30]=x,t[31]=T,t[32]=Fe,t[33]=Ie):Ie=t[33];let Le;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,G.jsx)(Ht,{children:(0,G.jsx)(r,{id:`CnOGgs`})}),t[34]=Le):Le=t[34];let Re;t[35]===O?Re=t[36]:(Re=e=>{S(e)&&O(e)},t[35]=O,t[36]=Re);let ze=!u,Be;t[37]===s?Be=t[38]:(Be=s({id:`CnOGgs`}),t[37]=s,t[38]=Be);let Ve;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,G.jsx)(h,{}),t[39]=Ve):Ve=t[39];let He;t[40]===Be?He=t[41]:(He=(0,G.jsx)(m,{size:`sm`,className:`w-full text-xs`,"aria-label":Be,"data-testid":`sync-mode-select`,children:Ve}),t[40]=Be,t[41]=He);let We;t[42]===s?We=t[43]:(We=s({id:`BWTzAb`}),t[42]=s,t[43]=We);let Ge;t[44]===We?Ge=t[45]:(Ge=(0,G.jsx)(f,{value:`off`,className:`text-xs`,children:We}),t[44]=We,t[45]=Ge);let K;t[46]===s?K=t[47]:(K=s({id:`tlGXxX`}),t[46]=s,t[47]=K);let q;t[48]===K?q=t[49]:(q=(0,G.jsx)(f,{value:`follow`,className:`text-xs`,children:K}),t[48]=K,t[49]=q);let qe;t[50]===s?qe=t[51]:(qe=s({id:`IXiG0B`}),t[50]=s,t[51]=qe);let Je;t[52]!==R||t[53]!==qe?(Je=(0,G.jsx)(f,{value:`full`,className:`text-xs`,disabled:R,children:qe}),t[52]=R,t[53]=qe,t[54]=Je):Je=t[54];let Xe;t[55]!==Ge||t[56]!==q||t[57]!==Je?(Xe=(0,G.jsxs)(p,{children:[Ge,q,Je]}),t[55]=Ge,t[56]=q,t[57]=Je,t[58]=Xe):Xe=t[58];let Ze;t[59]!==y||t[60]!==Re||t[61]!==ze||t[62]!==He||t[63]!==Xe?(Ze=(0,G.jsxs)(g,{value:y,onValueChange:Re,disabled:ze,children:[He,Xe]}),t[59]=y,t[60]=Re,t[61]=ze,t[62]=He,t[63]=Xe,t[64]=Ze):Ze=t[64];let $e;t[65]===y?$e=t[66]:($e=(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`sync-popover-mode-line`,children:y===`off`?(0,G.jsx)(r,{id:`qD3krc`}):y===`follow`?(0,G.jsx)(r,{id:`PGRnbw`}):(0,G.jsx)(r,{id:`zBiFZh`})}),t[65]=y,t[66]=$e);let et;t[67]!==Ze||t[68]!==$e?(et=(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[Le,Ze,$e]}),t[67]=Ze,t[68]=$e,t[69]=et):et=t[69];let J;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,G.jsx)(Ht,{children:(0,G.jsx)(r,{id:`BWTzAb`})}),t[70]=J):J=t[70];let tt=z||Se,nt;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(nt=()=>xe(`pull`),t[71]=nt):nt=t[71];let Y;t[72]===V?Y=t[73]:(Y=V===`pull`?(0,G.jsx)(j,{"aria-hidden":`true`,"data-icon":`inline-start`}):(0,G.jsx)(E,{"data-icon":`inline-start`}),t[72]=V,t[73]=Y);let rt;t[74]===Symbol.for(`react.memo_cache_sentinel`)?(rt=(0,G.jsx)(r,{id:`e4GHWP`}),t[74]=rt):rt=t[74];let ot;t[75]!==tt||t[76]!==Y?(ot=(0,G.jsxs)(_,{variant:`outline`,size:`xs`,className:`flex-1`,disabled:tt,onClick:nt,"data-testid":`sync-popover-pull`,children:[Y,rt]}),t[75]=tt,t[76]=Y,t[77]=ot):ot=t[77];let st;t[78]!==z||t[79]!==fe||t[80]!==H||t[81]!==V?(st=fe&&(0,G.jsxs)(_,{variant:`outline`,size:`xs`,className:`flex-1`,disabled:z||H,onClick:()=>xe(`push`),"data-testid":`sync-popover-push`,children:[V===`push`?(0,G.jsx)(j,{"aria-hidden":`true`,"data-icon":`inline-start`}):(0,G.jsx)(D,{"data-icon":`inline-start`}),(0,G.jsx)(r,{id:`uO9WLl`})]}),t[78]=z,t[79]=fe,t[80]=H,t[81]=V,t[82]=st):st=t[82];let X;t[83]!==ot||t[84]!==st?(X=(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[ot,st]}),t[83]=ot,t[84]=st,t[85]=X):X=t[85];let Z;t[86]!==z||t[87]!==fe||t[88]!==H||t[89]!==V?(Z=fe&&(0,G.jsxs)(_,{size:`xs`,className:`w-full`,disabled:z||H,onClick:()=>xe(`sync`),"data-testid":`sync-popover-sync`,children:[V===`sync`?(0,G.jsx)(j,{"aria-hidden":`true`,icon:M,"data-icon":`inline-start`}):(0,G.jsx)(M,{"data-icon":`inline-start`}),(0,G.jsx)(r,{id:`YEzhIr`})]}),t[86]=z,t[87]=fe,t[88]=H,t[89]=V,t[90]=Z):Z=t[90];let ct;t[91]!==X||t[92]!==Z?(ct=(0,G.jsxs)(`div`,{className:`flex flex-col gap-2 border-t pt-3`,children:[J,X,Z]}),t[91]=X,t[92]=Z,t[93]=ct):ct=t[93];let lt;if(t[94]!==s||t[95]!==n){let e;t[97]===s?e=t[98]:(e=e=>(0,G.jsx)(`p`,{className:`text-xs text-destructive`,children:e.direction===`push`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`span`,{className:`font-medium`,children:[s({id:`uO9WLl`}),`: `]}),e.message]}):e.direction===`pull`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`span`,{className:`font-medium`,children:[s({id:`e4GHWP`}),`: `]}),e.message]}):e.message},e.key),t[97]=s,t[98]=e),lt=Rt(n).map(e),t[94]=s,t[95]=n,t[96]=lt}else lt=t[96];let Q;t[99]===n?Q=t[100]:(Q=kt(n)&&n.pushPermission?.checkStatus===`denied`?Et(n.pushPermission).map(cn):null,t[99]=n,t[100]=Q);let ut;t[101]!==n.pausedReason||t[102]!==n.pushPermission?(ut=n.pausedReason===`no-push-permission`&&n.pushPermission?.checkStatus===`denied`?Et(n.pushPermission).map(sn):null,t[101]=n.pausedReason,t[102]=n.pushPermission,t[103]=ut):ut=t[103];let $;t[104]!==lt||t[105]!==Q||t[106]!==ut?($=(0,G.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:`flex flex-col gap-3.5 empty:sr-only`,"data-testid":`sync-popover-status`,children:[lt,Q,ut]}),t[104]=lt,t[105]=Q,t[106]=ut,t[107]=$):$=t[107];let pt;t[108]!==we||t[109]!==ne||t[110]!==R||t[111]!==a||t[112]!==n?(pt=!ne&&At(n.pushPermission)?(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,G.jsx)(`p`,{className:`min-w-0 flex-1 text-xs text-muted-foreground`,children:(0,G.jsx)(r,{id:`ycIX5i`})}),a&&(0,G.jsx)(_,{variant:`outline`,size:`xs`,className:`self-start`,onClick:a,children:(0,G.jsx)(r,{id:`5lWFkC`})})]}):we.length>0?(0,G.jsx)(Qe,{paths:we}):kt(n)?null:n.pausedReason?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,G.jsx)(wt,{reason:n.pausedReason})}),(0,G.jsx)(St,{paths:n.refusedSymlinkPaths})]}):!ne&&R&&n.pushPermission?.checkStatus===`denied`?Tt(n.pushPermission.deniedReason,n.pushPermission).map(on):zt(n.pushPermission)?(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,G.jsx)(`p`,{className:`min-w-0 flex-1 text-xs text-muted-foreground`,children:(0,G.jsx)(r,{id:`C_cPoW`})}),a&&(0,G.jsx)(_,{variant:`outline`,size:`xs`,className:`self-start`,onClick:a,children:(0,G.jsx)(r,{id:`5lWFkC`})})]}):null,t[108]=we,t[109]=ne,t[110]=R,t[111]=a,t[112]=n,t[113]=pt):pt=t[113];let mt;t[114]!==Oe||t[115]!==L?(mt=L===`conflict`&&(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,G.jsx)(`p`,{className:`min-w-0 flex-1 text-xs text-warning`,children:(0,G.jsx)(r,{id:`ko386X`})}),Oe!==null&&(0,G.jsx)(_,{variant:`outline`,size:`xs`,className:`self-start`,onClick:()=>at(de(Oe)),children:(0,G.jsx)(r,{id:`5k0NLb`})})]}),t[114]=Oe,t[115]=L,t[116]=mt):mt=t[116];let ht;t[117]!==ue||t[118]!==a||t[119]!==L||t[120]!==n?(ht=L===`auth-error`&&!kt(n)&&(ue?a&&(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,G.jsx)(`p`,{className:`min-w-0 flex-1 text-xs text-destructive`,children:(0,G.jsx)(r,{id:`Vl1H8I`})}),(0,G.jsx)(_,{variant:`outline`,size:`xs`,className:`self-start`,onClick:a,children:(0,G.jsx)(r,{id:`5lWFkC`})})]}):Nt(n.remote)?(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,G.jsx)(`p`,{className:`min-w-0 flex-1 text-xs text-destructive`,"data-testid":`sync-popover-auth-error-unverified`,children:(0,G.jsx)(r,{id:`FioJgb`})}),(0,G.jsx)(tn,{})]}):(0,G.jsx)(`p`,{className:`text-xs text-destructive`,"data-testid":`sync-popover-auth-error-no-token`,children:(0,G.jsx)(r,{id:`w-Wt3H`})})),t[117]=ue,t[118]=a,t[119]=L,t[120]=n,t[121]=ht):ht=t[121];let gt;t[122]===c?gt=t[123]:(gt=c>0&&(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,G.jsx)(r,{id:`B4_ipX`,values:{conflictCount:c}})}),t[122]=c,t[123]=gt);let _t;t[124]!==n||t[125]!==A||t[126]!==I||t[127]!==N||t[128]!==F||t[129]!==P?(_t=(0,G.jsx)($t,{status:n,worktree:A,loading:N,unreadable:P,stale:F,lastReadAt:I}),t[124]=n,t[125]=A,t[126]=I,t[127]=N,t[128]=F,t[129]=P,t[130]=_t):_t=t[130];let vt;t[131]!==ce||t[132]!==oe||t[133]!==se?(vt=(0,G.jsx)(en,{pulledAt:oe,pushedAt:se,combinedAt:ce}),t[131]=ce,t[132]=oe,t[133]=se,t[134]=vt):vt=t[134];let yt;t[135]===Symbol.for(`react.memo_cache_sentinel`)?(yt=(0,G.jsx)(pe,{asChild:!0,children:(0,G.jsxs)(_,{variant:`link`,size:`xs`,className:`h-auto p-0 text-xs text-muted-foreground hover:font-medium hover:text-foreground hover:no-underline`,onClick:an,"data-testid":`sync-popover-settings`,children:[(0,G.jsx)(te,{"data-icon":`inline-start`}),(0,G.jsx)(r,{id:`VNgKZz`})]})}),t[135]=yt):yt=t[135];let bt;t[136]===vt?bt=t[137]:(bt=(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[vt,yt]}),t[136]=vt,t[137]=bt);let xt;t[138]!==o||t[139]!==n.identityUnresolved?(xt=n.identityUnresolved&&o&&(0,G.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed p-2`,children:[(0,G.jsx)(Ee,{className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,G.jsx)(`p`,{className:`text-xs leading-snug text-muted-foreground`,children:(0,G.jsx)(r,{id:`nrGWJ7`})}),(0,G.jsx)(_,{variant:`outline`,size:`xs`,className:`self-start`,onClick:o,children:(0,G.jsx)(r,{id:`keNFEd`})})]})]}),t[138]=o,t[139]=n.identityUnresolved,t[140]=xt):xt=t[140];let Ct;return t[141]!==Ne||t[142]!==Ie||t[143]!==et||t[144]!==ct||t[145]!==$||t[146]!==pt||t[147]!==mt||t[148]!==ht||t[149]!==gt||t[150]!==_t||t[151]!==bt||t[152]!==xt?(Ct=(0,G.jsxs)(`div`,{className:`flex flex-col gap-3.5`,children:[Ne,Ie,et,ct,$,pt,mt,ht,gt,_t,bt,xt]}),t[141]=Ne,t[142]=Ie,t[143]=et,t[144]=ct,t[145]=$,t[146]=pt,t[147]=mt,t[148]=ht,t[149]=gt,t[150]=_t,t[151]=bt,t[152]=xt,t[153]=Ct):Ct=t[153],Ct}function an(){return R({advanced:!0})}function on(e){return(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},e)}function sn(e){return(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},e)}function cn(e){return(0,G.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},e)}function ln(e){return e.docName!==null}function un(e){let t=(0,U.c)(68),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{onSignIn:a,onSetIdentity:l}=n,{_:u}=i(),{status:d,fetchError:f}=ge();if(!d){if(f){let e;t[2]===u?e=t[3]:(e=u({id:`iqIDv4`}),t[2]=u,t[3]=e);let n;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,G.jsx)(Se,{className:`size-3.5`}),t[4]=n):n=t[4];let i;t[5]===e?i=t[6]:(i=(0,G.jsx)(o,{asChild:!0,children:(0,G.jsx)(_,{variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground`,"aria-label":e,disabled:!0,children:n})}),t[5]=e,t[6]=i);let a;t[7]===f?a=t[8]:(a=(0,G.jsx)(s,{children:f===`network`?(0,G.jsx)(r,{id:`I5AfhE`}):(0,G.jsx)(r,{id:`uKRYiW`})}),t[7]=f,t[8]=a);let l;return t[9]!==i||t[10]!==a?(l=(0,G.jsxs)(c,{children:[i,a]}),t[9]=i,t[10]=a,t[11]=l):l=t[11],l}return null}if(!d.hasRemote)return null;let p;t[12]===d?p=t[13]:(p=pt(d),t[12]=d,t[13]=p);let m=p,h,g,v,y,b,x,S,C,w,T,E,D;if(t[14]!==u||t[15]!==d){let e=Bt(d);x=!!d.identityUnresolved,b=me,y=c,v=o,D=!0,g=fe,E=!0,h=_,S=`ghost`,C=`icon-sm`,w=`text-muted-foreground relative`,T=u(x?{id:`DFfRbX`,values:{syncStateLabel:e}}:{id:`F4vEsL`,values:{syncStateLabel:e}}),t[14]=u,t[15]=d,t[16]=h,t[17]=g,t[18]=v,t[19]=y,t[20]=b,t[21]=x,t[22]=S,t[23]=C,t[24]=w,t[25]=T,t[26]=E,t[27]=D}else h=t[16],g=t[17],v=t[18],y=t[19],b=t[20],x=t[21],S=t[22],C=t[23],w=t[24],T=t[25],E=t[26],D=t[27];let ee;t[28]===d?ee=t[29]:(ee=(0,G.jsx)(ft,{status:d,size:`size-4`}),t[28]=d,t[29]=ee);let O;t[30]===m?O=t[31]:(O=m&&(0,G.jsx)(`span`,{className:`absolute -top-0.5 -right-0.5 text-[9px] leading-none font-medium bg-background border rounded-full px-0.5`,children:m}),t[30]=m,t[31]=O);let k;t[32]!==m||t[33]!==x?(k=!m&&x&&(0,G.jsx)(`span`,{className:`absolute -top-0.5 -right-0.5 size-1.5 rounded-full bg-warning ring-2 ring-background`,"aria-hidden":!0}),t[32]=m,t[33]=x,t[34]=k):k=t[34];let te;t[35]!==h||t[36]!==O||t[37]!==k||t[38]!==S||t[39]!==C||t[40]!==w||t[41]!==T||t[42]!==ee?(te=(0,G.jsxs)(h,{variant:S,size:C,className:w,"aria-label":T,children:[ee,O,k]}),t[35]=h,t[36]=O,t[37]=k,t[38]=S,t[39]=C,t[40]=w,t[41]=T,t[42]=ee,t[43]=te):te=t[43];let A;t[44]!==g||t[45]!==te||t[46]!==E?(A=(0,G.jsx)(g,{asChild:E,children:te}),t[44]=g,t[45]=te,t[46]=E,t[47]=A):A=t[47];let j;t[48]!==v||t[49]!==A||t[50]!==D?(j=(0,G.jsx)(v,{asChild:D,children:A}),t[48]=v,t[49]=A,t[50]=D,t[51]=j):j=t[51];let M;t[52]===d?M=t[53]:(M=Vt(d),t[52]=d,t[53]=M);let N;t[54]===M?N=t[55]:(N=(0,G.jsx)(s,{children:M}),t[54]=M,t[55]=N);let P;t[56]!==y||t[57]!==j||t[58]!==N?(P=(0,G.jsxs)(y,{children:[j,N]}),t[56]=y,t[57]=j,t[58]=N,t[59]=P):P=t[59];let F;t[60]!==l||t[61]!==a||t[62]!==d?(F=(0,G.jsx)(z,{align:`end`,className:`flex max-h-(--radix-popover-content-available-height) w-80 flex-col overflow-y-auto p-3`,children:(0,G.jsx)(rn,{status:d,onSignIn:a,onSetIdentity:l})}),t[60]=l,t[61]=a,t[62]=d,t[63]=F):F=t[63];let I;return t[64]!==b||t[65]!==P||t[66]!==F?(I=(0,G.jsxs)(b,{children:[P,F]}),t[64]=b,t[65]=P,t[66]=F,t[67]=I):I=t[67],I}export{Ae as C,V as D,H as E,De as S,Oe as T,q as _,Et as a,je as b,Ot as c,$ as d,Nt as f,K as g,Ye as h,dt as i,jt as l,zt as m,St as n,Lt as o,At as p,un as r,Mt as s,wt as t,kt as u,Ke as v,Me as w,ke as x,Fe as y};
@@ -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{r}from"./dist-Nvb76hAm.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{t as a}from"./switch-BKZTXkzu.js";import{n as o}from"./dist-BGzUo_18.js";import{n as s}from"./config-errors-DDAH9fqy.js";import{i as c}from"./use-apply-config-theme-CYFG76sS.js";import"./config-provider-QVZqDwsb.js";import{n as l,t as u}from"./use-terminal-enabled-DiTNDooB.js";import{t as d}from"./channel-cli-copy-BySq87hR.js";import{n as f,t as p}from"./SettingsSectionHeader-BKhNIRp2.js";var m=i(),h=e(n(),1),g=t();function _(){let e=(0,m.c)(51),{_:t}=r(),n=d(),{enabled:i,synced:_}=u(),y=l(),b=i!==!1,{userConfig:x,userBinding:S,userSynced:C}=c(),w=x?.agents?.autoApproveOkTools!==!1,[T,E]=(0,h.useState)(!1),D,O;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>{let e=window.okDesktop;if(!e)return;let t=!1;return e.terminal.cliPreflight(`codex`).then(e=>{t||E(e.onPath===`present`&&e.okServerConfigured!==!0)}).catch(v),()=>{t=!0}},O=[],e[0]=D,e[1]=O):(D=e[0],O=e[1]),(0,h.useEffect)(D,O);let k;e[2]!==t||e[3]!==y?(k=function(e){if(y===null){o.error(t({id:`w6sBjd`}));return}let n=y(e);n.ok||o.error(t(e?{id:`jKd3AP`,values:{0:n.error}}:{id:`pajIrl`,values:{0:n.error}}))},e[2]=t,e[3]=y,e[4]=k):k=e[4];let A=k,j;e[5]!==t||e[6]!==S?(j=function(e){if(S===null){o.error(t({id:`fnlBN4`}));return}let n=S.patch({agents:{autoApproveOkTools:e}});if(!n.ok){let e=s(n.error);o.error(t({id:`habOU_`,values:{detail:e}}))}},e[5]=t,e[6]=S,e[7]=j):j=e[7];let M=j,N;e[8]===t?N=e[9]:(N=t({id:`ALhMYW`}),e[8]=t,e[9]=N);let P;e[10]===t?P=e[11]:(P=t({id:`FCAcjR`}),e[10]=t,e[11]=P);let F;e[12]!==N||e[13]!==P?(F=(0,g.jsx)(p,{titleId:`settings-terminal-title`,title:N,scope:`project-local`,level:`block`,children:P}),e[12]=N,e[13]=P,e[14]=F):F=e[14];let I;e[15]===t?I=e[16]:(I=t({id:`E4XYYH`}),e[15]=t,e[16]=I);let L;e[17]===I?L=e[18]:(L=(0,g.jsx)(`label`,{htmlFor:`settings-terminal-toggle`,className:`text-sm font-medium`,children:I}),e[17]=I,e[18]=L);let R;e[19]!==t||e[20]!==b?(R=t(b?{id:`6ASTuj`}:{id:`QpSqAP`}),e[19]=t,e[20]=b,e[21]=R):R=e[21];let z;e[22]===R?z=e[23]:(z=(0,g.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-terminal-body`,children:R}),e[22]=R,e[23]=z);let B;e[24]!==z||e[25]!==L?(B=(0,g.jsxs)(`div`,{className:`space-y-0.5`,children:[L,z]}),e[24]=z,e[25]=L,e[26]=B):B=e[26];let V=!_||y===null,H;e[27]===t?H=e[28]:(H=t({id:`E4XYYH`}),e[27]=t,e[28]=H);let U;e[29]!==A||e[30]!==b||e[31]!==V||e[32]!==H?(U=(0,g.jsx)(a,{id:`settings-terminal-toggle`,checked:b,onCheckedChange:A,disabled:V,"aria-label":H,"data-testid":`settings-terminal-toggle`}),e[29]=A,e[30]=b,e[31]=V,e[32]=H,e[33]=U):U=e[33];let W;e[34]!==B||e[35]!==U?(W=(0,g.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border p-3`,children:[B,U]}),e[34]=B,e[35]=U,e[36]=W):W=e[36];let G;e[37]===t?G=e[38]:(G=t({id:`ilodsp`}),e[37]=t,e[38]=G);let K;e[39]===G?K=e[40]:(K=(0,g.jsx)(`label`,{htmlFor:`settings-terminal-autoapprove-toggle`,className:`text-sm font-medium`,children:G}),e[39]=G,e[40]=K);let q;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,g.jsx)(f,{scope:`user`}),e[41]=q):q=e[41];let J;e[42]===K?J=e[43]:(J=(0,g.jsxs)(`div`,{className:`flex items-center gap-2`,children:[K,q]}),e[42]=K,e[43]=J);let Y=!C||S===null,X;e[44]===t?X=e[45]:(X=t({id:`ilodsp`}),e[44]=t,e[45]=X);let Z;return e[46]!==M||e[47]!==w||e[48]!==Y||e[49]!==X?(Z=(0,g.jsx)(a,{id:`settings-terminal-autoapprove-toggle`,checked:w,onCheckedChange:M,disabled:Y,"aria-label":X,"data-testid":`settings-terminal-autoapprove-toggle`}),e[46]=M,e[47]=w,e[48]=Y,e[49]=X,e[50]=Z):Z=e[50],(0,g.jsxs)(`section`,{"aria-labelledby":`settings-terminal-title`,className:`space-y-3`,"data-field":`section:terminal`,"data-testid":`settings-terminal`,children:[F,W,(0,g.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border p-3`,children:[(0,g.jsxs)(`div`,{className:`space-y-0.5`,children:[J,(0,g.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-terminal-autoapprove-body`,children:t({id:`Zmg5Ge`,values:{cliCommand:n}})}),w&&T?(0,g.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-terminal-autoapprove-codex-note`,children:t({id:`sTQjgr`,values:{cliCommand:n}})}):null]}),Z]})]})}function v(){}export{_ as TerminalSection};
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{r}from"./dist-Nvb76hAm.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{t as a}from"./switch-BKZTXkzu.js";import{n as o}from"./dist-BGzUo_18.js";import{n as s}from"./config-errors-DDAH9fqy.js";import{i as c}from"./use-apply-config-theme-CYFG76sS.js";import"./config-provider-BRcEwJSU.js";import{n as l,t as u}from"./use-terminal-enabled-DqK9WYaA.js";import{t as d}from"./channel-cli-copy-BySq87hR.js";import{n as f,t as p}from"./SettingsSectionHeader-BKhNIRp2.js";var m=i(),h=e(n(),1),g=t();function _(){let e=(0,m.c)(51),{_:t}=r(),n=d(),{enabled:i,synced:_}=u(),y=l(),b=i!==!1,{userConfig:x,userBinding:S,userSynced:C}=c(),w=x?.agents?.autoApproveOkTools!==!1,[T,E]=(0,h.useState)(!1),D,O;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>{let e=window.okDesktop;if(!e)return;let t=!1;return e.terminal.cliPreflight(`codex`).then(e=>{t||E(e.onPath===`present`&&e.okServerConfigured!==!0)}).catch(v),()=>{t=!0}},O=[],e[0]=D,e[1]=O):(D=e[0],O=e[1]),(0,h.useEffect)(D,O);let k;e[2]!==t||e[3]!==y?(k=function(e){if(y===null){o.error(t({id:`w6sBjd`}));return}let n=y(e);n.ok||o.error(t(e?{id:`jKd3AP`,values:{0:n.error}}:{id:`pajIrl`,values:{0:n.error}}))},e[2]=t,e[3]=y,e[4]=k):k=e[4];let A=k,j;e[5]!==t||e[6]!==S?(j=function(e){if(S===null){o.error(t({id:`fnlBN4`}));return}let n=S.patch({agents:{autoApproveOkTools:e}});if(!n.ok){let e=s(n.error);o.error(t({id:`habOU_`,values:{detail:e}}))}},e[5]=t,e[6]=S,e[7]=j):j=e[7];let M=j,N;e[8]===t?N=e[9]:(N=t({id:`ALhMYW`}),e[8]=t,e[9]=N);let P;e[10]===t?P=e[11]:(P=t({id:`FCAcjR`}),e[10]=t,e[11]=P);let F;e[12]!==N||e[13]!==P?(F=(0,g.jsx)(p,{titleId:`settings-terminal-title`,title:N,scope:`project-local`,level:`block`,children:P}),e[12]=N,e[13]=P,e[14]=F):F=e[14];let I;e[15]===t?I=e[16]:(I=t({id:`E4XYYH`}),e[15]=t,e[16]=I);let L;e[17]===I?L=e[18]:(L=(0,g.jsx)(`label`,{htmlFor:`settings-terminal-toggle`,className:`text-sm font-medium`,children:I}),e[17]=I,e[18]=L);let R;e[19]!==t||e[20]!==b?(R=t(b?{id:`6ASTuj`}:{id:`QpSqAP`}),e[19]=t,e[20]=b,e[21]=R):R=e[21];let z;e[22]===R?z=e[23]:(z=(0,g.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-terminal-body`,children:R}),e[22]=R,e[23]=z);let B;e[24]!==z||e[25]!==L?(B=(0,g.jsxs)(`div`,{className:`space-y-0.5`,children:[L,z]}),e[24]=z,e[25]=L,e[26]=B):B=e[26];let V=!_||y===null,H;e[27]===t?H=e[28]:(H=t({id:`E4XYYH`}),e[27]=t,e[28]=H);let U;e[29]!==A||e[30]!==b||e[31]!==V||e[32]!==H?(U=(0,g.jsx)(a,{id:`settings-terminal-toggle`,checked:b,onCheckedChange:A,disabled:V,"aria-label":H,"data-testid":`settings-terminal-toggle`}),e[29]=A,e[30]=b,e[31]=V,e[32]=H,e[33]=U):U=e[33];let W;e[34]!==B||e[35]!==U?(W=(0,g.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border p-3`,children:[B,U]}),e[34]=B,e[35]=U,e[36]=W):W=e[36];let G;e[37]===t?G=e[38]:(G=t({id:`ilodsp`}),e[37]=t,e[38]=G);let K;e[39]===G?K=e[40]:(K=(0,g.jsx)(`label`,{htmlFor:`settings-terminal-autoapprove-toggle`,className:`text-sm font-medium`,children:G}),e[39]=G,e[40]=K);let q;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,g.jsx)(f,{scope:`user`}),e[41]=q):q=e[41];let J;e[42]===K?J=e[43]:(J=(0,g.jsxs)(`div`,{className:`flex items-center gap-2`,children:[K,q]}),e[42]=K,e[43]=J);let Y=!C||S===null,X;e[44]===t?X=e[45]:(X=t({id:`ilodsp`}),e[44]=t,e[45]=X);let Z;return e[46]!==M||e[47]!==w||e[48]!==Y||e[49]!==X?(Z=(0,g.jsx)(a,{id:`settings-terminal-autoapprove-toggle`,checked:w,onCheckedChange:M,disabled:Y,"aria-label":X,"data-testid":`settings-terminal-autoapprove-toggle`}),e[46]=M,e[47]=w,e[48]=Y,e[49]=X,e[50]=Z):Z=e[50],(0,g.jsxs)(`section`,{"aria-labelledby":`settings-terminal-title`,className:`space-y-3`,"data-field":`section:terminal`,"data-testid":`settings-terminal`,children:[F,W,(0,g.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border p-3`,children:[(0,g.jsxs)(`div`,{className:`space-y-0.5`,children:[J,(0,g.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-terminal-autoapprove-body`,children:t({id:`Zmg5Ge`,values:{cliCommand:n}})}),w&&T?(0,g.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-terminal-autoapprove-codex-note`,children:t({id:`sTQjgr`,values:{cliCommand:n}})}):null]}),Z]})]})}function v(){}export{_ as TerminalSection};
@@ -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}from"./dist-PQ5KMVDh.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{t as a}from"./use-installed-clis-D3LjLTuG.js";import{t as o}from"./config-provider-QVZqDwsb.js";import{t as s}from"./use-live-xterm-theme-BJbDRXxo.js";import{t as c}from"./ReportBugMenuTrigger-xHppTUcT.js";import{SessionsHost as l}from"./SessionsHost-DrGOAImZ.js";var u=i(),d=e(n(),1),f=t();function p(e){let t=(0,u.c)(9),{bridge:n}=e,r=n.config.collabUrl?n.config.collabUrl:null,i=r===null,a;t[0]===n?a=t[1]:(a=(0,f.jsx)(m,{bridge:n}),t[0]=n,t[1]=a);let s=r===null,l;t[2]===s?l=t[3]:(l=(0,f.jsx)(c,{systemWide:s}),t[2]=s,t[3]=l);let d;return t[4]!==r||t[5]!==i||t[6]!==a||t[7]!==l?(d=(0,f.jsxs)(o,{collabUrl:r,collabTerminal:i,children:[a,l]}),t[4]=r,t[5]=i,t[6]=a,t[7]=l,t[8]=d):d=t[8],d}function m(e){let t=(0,u.c)(9),{bridge:n}=e,{resolvedTheme:i}=r(),o=s(i),c=a(),[p,m]=(0,d.useState)(null),_;t[0]===o.background?_=t[1]:(_=(0,f.jsx)(`div`,{ref:m,className:`flex h-screen min-h-0 flex-col`,style:{backgroundColor:o.background}}),t[0]=o.background,t[1]=_);let v;t[2]!==n||t[3]!==p||t[4]!==c?(v=(0,f.jsx)(l,{bridge:n,surface:`terminal-window`,terminalCapable:!0,visible:!0,onVisibleChange:g,installedClis:c,container:p,isShowing:!0,onRequestEditorFocus:h}),t[2]=n,t[3]=p,t[4]=c,t[5]=v):v=t[5];let y;return t[6]!==_||t[7]!==v?(y=(0,f.jsxs)(f.Fragment,{children:[_,v]}),t[6]=_,t[7]=v,t[8]=y):y=t[8],y}function h(){}function g(e){e||window.close()}export{p as TerminalWindowApp};
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}from"./dist-PQ5KMVDh.js";import{t as i}from"./compiler-runtime-BfE3aGVn.js";import{t as a}from"./use-installed-clis-D3LjLTuG.js";import{t as o}from"./config-provider-BRcEwJSU.js";import{t as s}from"./use-live-xterm-theme-BJbDRXxo.js";import{t as c}from"./ReportBugMenuTrigger-xHppTUcT.js";import{SessionsHost as l}from"./SessionsHost-Dr7me5i8.js";var u=i(),d=e(n(),1),f=t();function p(e){let t=(0,u.c)(9),{bridge:n}=e,r=n.config.collabUrl?n.config.collabUrl:null,i=r===null,a;t[0]===n?a=t[1]:(a=(0,f.jsx)(m,{bridge:n}),t[0]=n,t[1]=a);let s=r===null,l;t[2]===s?l=t[3]:(l=(0,f.jsx)(c,{systemWide:s}),t[2]=s,t[3]=l);let d;return t[4]!==r||t[5]!==i||t[6]!==a||t[7]!==l?(d=(0,f.jsxs)(o,{collabUrl:r,collabTerminal:i,children:[a,l]}),t[4]=r,t[5]=i,t[6]=a,t[7]=l,t[8]=d):d=t[8],d}function m(e){let t=(0,u.c)(9),{bridge:n}=e,{resolvedTheme:i}=r(),o=s(i),c=a(),[p,m]=(0,d.useState)(null),_;t[0]===o.background?_=t[1]:(_=(0,f.jsx)(`div`,{ref:m,className:`flex h-screen min-h-0 flex-col`,style:{backgroundColor:o.background}}),t[0]=o.background,t[1]=_);let v;t[2]!==n||t[3]!==p||t[4]!==c?(v=(0,f.jsx)(l,{bridge:n,surface:`terminal-window`,terminalCapable:!0,visible:!0,onVisibleChange:g,installedClis:c,container:p,isShowing:!0,onRequestEditorFocus:h}),t[2]=n,t[3]=p,t[4]=c,t[5]=v):v=t[5];let y;return t[6]!==_||t[7]!==v?(y=(0,f.jsxs)(f.Fragment,{children:[_,v]}),t[6]=_,t[7]=v,t[8]=y):y=t[8],y}function h(){}function g(e){e||window.close()}export{p as TerminalWindowApp};
@@ -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{r}from"./dist-Nvb76hAm.js";import{n as i}from"./dist-PQ5KMVDh.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{_ as o,v as s}from"./constants-upload-CVKO8P4d.js";import{Bn as c,Hn as l,Tn as u,n as d}from"./CodeMirrorPropInput-BbOfR2Hg.js";import{Ct as f,J as p,M as m,Tt as h}from"./dist-B8KZUrr_.js";import{t as g}from"./cm-theme-DY245iRg.js";import{t as _}from"./dist-8cadZTcN.js";import{t as v}from"./text-viewer-languages-CKtwqOI2.js";import{t as y}from"./src-C8wJZTqQ.js";import{t as b}from"./doc-undo-manager-CzYtyHUd.js";var x=a(),S=e(n(),1),C=t(),w=g({dark:!0,background:`var(--background)`,gutterBackground:`var(--muted)`}),T=g({dark:!1,background:`var(--background)`,gutterBackground:`var(--muted)`});function E(e){let t=(0,x.c)(18),{docName:n,provider:a}=e,{_:g}=r(),E=n.slice(n.lastIndexOf(`/`)+1),D=(0,S.useRef)(null),{resolvedTheme:O}=i(),k,A;t[0]===a?(k=t[1],A=t[2]):(A=a.document.getText(`source`),k=b(a,A),t[0]=a,t[1]=k,t[2]=A);let j=k,M;t[3]!==n||t[4]!==a.awareness||t[5]!==O||t[6]!==j||t[7]!==A?(M=()=>{let e=D.current;if(!e)return;let t=O===`dark`?w:T,r=new f,i=new f,g=(o[u(n)]??s(u(n)))!==null&&u(n)!==``,b=new p({state:h.create({doc:A.toString(),extensions:[_,y(A,a.awareness,{undoManager:j}),r.of([]),m(d),i.of(g?[]:p.lineWrapping),p.theme({"&":{height:`100%`}}),t]}),parent:e});c(n,b,`textDocEditor`);let x=!1,S=u(n)||null;return S&&v(S,o[S]??s(S)).then(e=>{x||!e||b.dispatch({effects:r.reconfigure(e)})}),()=>{x=!0,l(n,b),b.destroy()}},t[3]=n,t[4]=a.awareness,t[5]=O,t[6]=j,t[7]=A,t[8]=M):M=t[8];let N;t[9]!==n||t[10]!==a||t[11]!==O||t[12]!==j||t[13]!==A?(N=[A,a,O,n,j],t[9]=n,t[10]=a,t[11]=O,t[12]=j,t[13]=A,t[14]=N):N=t[14],(0,S.useEffect)(M,N);let P=g({id:`xAlHfe`,values:{basename:E}}),F;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,C.jsx)(`div`,{ref:D,className:`min-h-0 flex-1 overflow-auto`}),t[15]=F):F=t[15];let I;return t[16]===P?I=t[17]:(I=(0,C.jsx)(`section`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":P,"data-text-doc-editor":``,children:F}),t[16]=P,t[17]=I),I}export{E as TextDocEditor};
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{r}from"./dist-Nvb76hAm.js";import{n as i}from"./dist-PQ5KMVDh.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{_ as o,v as s}from"./constants-upload-CVKO8P4d.js";import{Bn as c,Hn as l,Tn as u,n as d}from"./CodeMirrorPropInput-DJKSXk-t.js";import{Ct as f,J as p,M as m,Tt as h}from"./dist-B8KZUrr_.js";import{t as g}from"./cm-theme-DY245iRg.js";import{t as _}from"./dist-8cadZTcN.js";import{t as v}from"./text-viewer-languages-CKtwqOI2.js";import{t as y}from"./src-DMWRRyM9.js";import{t as b}from"./doc-undo-manager-BrU5Q-vN.js";var x=a(),S=e(n(),1),C=t(),w=g({dark:!0,background:`var(--background)`,gutterBackground:`var(--muted)`}),T=g({dark:!1,background:`var(--background)`,gutterBackground:`var(--muted)`});function E(e){let t=(0,x.c)(18),{docName:n,provider:a}=e,{_:g}=r(),E=n.slice(n.lastIndexOf(`/`)+1),D=(0,S.useRef)(null),{resolvedTheme:O}=i(),k,A;t[0]===a?(k=t[1],A=t[2]):(A=a.document.getText(`source`),k=b(a,A),t[0]=a,t[1]=k,t[2]=A);let j=k,M;t[3]!==n||t[4]!==a.awareness||t[5]!==O||t[6]!==j||t[7]!==A?(M=()=>{let e=D.current;if(!e)return;let t=O===`dark`?w:T,r=new f,i=new f,g=(o[u(n)]??s(u(n)))!==null&&u(n)!==``,b=new p({state:h.create({doc:A.toString(),extensions:[_,y(A,a.awareness,{undoManager:j}),r.of([]),m(d),i.of(g?[]:p.lineWrapping),p.theme({"&":{height:`100%`}}),t]}),parent:e});c(n,b,`textDocEditor`);let x=!1,S=u(n)||null;return S&&v(S,o[S]??s(S)).then(e=>{x||!e||b.dispatch({effects:r.reconfigure(e)})}),()=>{x=!0,l(n,b),b.destroy()}},t[3]=n,t[4]=a.awareness,t[5]=O,t[6]=j,t[7]=A,t[8]=M):M=t[8];let N;t[9]!==n||t[10]!==a||t[11]!==O||t[12]!==j||t[13]!==A?(N=[A,a,O,n,j],t[9]=n,t[10]=a,t[11]=O,t[12]=j,t[13]=A,t[14]=N):N=t[14],(0,S.useEffect)(M,N);let P=g({id:`xAlHfe`,values:{basename:E}}),F;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,C.jsx)(`div`,{ref:D,className:`min-h-0 flex-1 overflow-auto`}),t[15]=F):F=t[15];let I;return t[16]===P?I=t[17]:(I=(0,C.jsx)(`section`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":P,"data-text-doc-editor":``,children:F}),t[16]=P,t[17]=I),I}export{E as TextDocEditor};