@inkeep/open-knowledge 0.84.0-beta.3 → 0.84.0-beta.4

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 (160) hide show
  1. package/dist/cli.mjs +6 -6
  2. package/dist/constants-DVqvzhbh.mjs +1 -0
  3. package/dist/{dist-BGJh5L15.mjs → dist-BWAvfDuW.mjs} +1 -1
  4. package/dist/{dist-Bxhfiafh.mjs → dist-C01O4iH2.mjs} +501 -501
  5. package/dist/index.d.mts +2 -2
  6. package/dist/index.mjs +1 -1
  7. package/dist/{init-DGuKwx2e.mjs → init-BxVdZi-q.mjs} +2 -2
  8. package/dist/init-CflGUOQW.mjs +1 -0
  9. package/dist/{launch-json-removal-BoLnWuw8.mjs → launch-json-removal-DCpJPTRd.mjs} +1 -1
  10. package/dist/loader-BBciDpto.mjs +1 -0
  11. package/dist/{loader-CwnBJ5G_.mjs → loader-D8c6sLKH.mjs} +1 -1
  12. package/dist/{open-browser-OupsHA1M.mjs → open-browser-etXAlZ_w.mjs} +1 -1
  13. package/dist/{preview-BStZha-C.mjs → preview-B6BmcZp2.mjs} +1 -1
  14. package/dist/preview-Olt-dcII.mjs +1 -0
  15. package/dist/public/assets/{AccountSection-BsoknTRm.js → AccountSection-BQs9T7Qi.js} +1 -1
  16. package/dist/public/assets/{ActivityModeContent-DZbyWBlo.js → ActivityModeContent-DUZhyjXJ.js} +1 -1
  17. package/dist/public/assets/{AddPropertiesButton-DvtOOL5J.js → AddPropertiesButton-BYfH1-WT.js} +2 -2
  18. package/dist/public/assets/{AgentConnectionsSection-D_gmSJG4.js → AgentConnectionsSection-o3ST7BQH.js} +1 -1
  19. package/dist/public/assets/{AgentDiffPane-D9olUVts.js → AgentDiffPane-Bbzn3FVb.js} +1 -1
  20. package/dist/public/assets/{AgentIconCluster-BRpsTDMH.js → AgentIconCluster-BeSduTM5.js} +1 -1
  21. package/dist/public/assets/{AgentThreadClientBinder-BTlP3z2T.js → AgentThreadClientBinder-DcCQm7Nm.js} +1 -1
  22. package/dist/public/assets/AppMenubar-Dgz756Er.js +1 -0
  23. package/dist/public/assets/{AttachmentsSection-DdqsNOtE.js → AttachmentsSection-DUlkIP4l.js} +1 -1
  24. package/dist/public/assets/{AuthModal-CkHLmy_N.js → AuthModal-oJIksUwH.js} +1 -1
  25. package/dist/public/assets/{BugReportHistory-BPO915fE.js → BugReportHistory-B0y8PoGi.js} +1 -1
  26. package/dist/public/assets/{BugReportHistoryDialog-CY6vlR_h.js → BugReportHistoryDialog-Dqm3l3bd.js} +1 -1
  27. package/dist/public/assets/{CodeMirrorPropInput-BTCkQ8gy.js → CodeMirrorPropInput-Drb1OUJC.js} +1 -1
  28. package/dist/public/assets/{ConsentDialogBody-CGhUvR3J.js → ConsentDialogBody-TWGdET4r.js} +1 -1
  29. package/dist/public/assets/{ContentRulesSection-BPc0bEex.js → ContentRulesSection-LsFc1XAM.js} +1 -1
  30. package/dist/public/assets/{DiffViewBoundary-BVzts2c4.js → DiffViewBoundary-CQwFsSb2.js} +1 -1
  31. package/dist/public/assets/{DocumentContext-Cgpe7PUq.js → DocumentContext-Dkr34TWR.js} +1 -1
  32. package/dist/public/assets/{EditorModeToggle-8PbuUKPX.js → EditorModeToggle-Do7kGUFS.js} +1 -1
  33. package/dist/public/assets/{ExcalidrawDocEditor-DPjKh0Z6.js → ExcalidrawDocEditor-madW2o5c.js} +1 -1
  34. package/dist/public/assets/FeedbackForm-DgHrtWvi.js +1 -0
  35. package/dist/public/assets/{GraphPanel-COpuyFxT.js → GraphPanel-B5Mg9hLe.js} +1 -1
  36. package/dist/public/assets/{ImportSkillDialog-BRMCNFIO.js → ImportSkillDialog-DQlC1UVZ.js} +1 -1
  37. package/dist/public/assets/{LinkPreviewsSection-DrVzxhzA.js → LinkPreviewsSection-BGwx2pBe.js} +1 -1
  38. package/dist/public/assets/{LintConfigEditor-CYgb3HLw.js → LintConfigEditor-CnJnzFnT.js} +1 -1
  39. package/dist/public/assets/{LintingSection-DwEExyYA.js → LintingSection-Bz-f01q8.js} +1 -1
  40. package/dist/public/assets/{ManagedArtifactProperties-Cejw-D7l.js → ManagedArtifactProperties-BRRc9Nck.js} +1 -1
  41. package/dist/public/assets/ManagedArtifactProperties-CRowlH3M.js +1 -0
  42. package/dist/public/assets/{MermaidDocEditor-TV8MQtbb.js → MermaidDocEditor-D00SA4S5.js} +1 -1
  43. package/dist/public/assets/{NetworkAccessSection-G-tyEPOW.js → NetworkAccessSection-BrQ04PAl.js} +1 -1
  44. package/dist/public/assets/{OkignoreSection-DUIPj4Vl.js → OkignoreSection-B65Debem.js} +1 -1
  45. package/dist/public/assets/{PageListContext-CYKNvec7.js → PageListContext-CLm_fRR9.js} +1 -1
  46. package/dist/public/assets/{ProjectTemplatesSection-Ctdx9_AL.js → ProjectTemplatesSection-Cgz1Gipq.js} +1 -1
  47. package/dist/public/assets/{PropertyDisplayRow-DULpBoN1.js → PropertyDisplayRow-CejfREf8.js} +1 -1
  48. package/dist/public/assets/{PublishToGitHubDialog-BcpO5RKl.js → PublishToGitHubDialog-C3G5gU4a.js} +1 -1
  49. package/dist/public/assets/{RegisteredAgentIcon-Begcc-nC.js → RegisteredAgentIcon-CWqSvSAf.js} +1 -1
  50. package/dist/public/assets/{ReportBugDialogBody-CPjEs_zr.js → ReportBugDialogBody-xJE9h5I4.js} +1 -1
  51. package/dist/public/assets/{ReportBugMenuTrigger-DwuaKFu1.js → ReportBugMenuTrigger-BcNRdrQT.js} +1 -1
  52. package/dist/public/assets/{SchemaConfigEditor-D79vqFmf.js → SchemaConfigEditor-DfNwto81.js} +1 -1
  53. package/dist/public/assets/{SearchSection-Dx8-C7aO.js → SearchSection-6N-xV3m6.js} +1 -1
  54. package/dist/public/assets/{SessionsHost-DhB6vMF-.js → SessionsHost-Dt0YX7e4.js} +2 -2
  55. package/dist/public/assets/{SettingsDialogBody-BmlfRDFb.js → SettingsDialogBody-CX3cuu2A.js} +2 -2
  56. package/dist/public/assets/{ShareReceiveMissDialog-0PE01E7W.js → ShareReceiveMissDialog-bUB0ammT.js} +1 -1
  57. package/dist/public/assets/{SkillCostValue-Bajv3P86.js → SkillCostValue-tiv0OMS7.js} +1 -1
  58. package/dist/public/assets/{SkillEditBanner-B0ZxQBAN.js → SkillEditBanner-CwGW7u29.js} +1 -1
  59. package/dist/public/assets/{SkillForkDialog-BKGY1iRx.js → SkillForkDialog-HDotxj-S.js} +1 -1
  60. package/dist/public/assets/{SkillInstallMenu-CuOKJ4_n.js → SkillInstallMenu-syd5rOWa.js} +1 -1
  61. package/dist/public/assets/{SkillOriginInline-BrUb4Fgy.js → SkillOriginInline-ek2j3kre.js} +1 -1
  62. package/dist/public/assets/{SkillToolbarControls-CT26YXuL.js → SkillToolbarControls-Cs2gtZl9.js} +1 -1
  63. package/dist/public/assets/{SkillsManagerSection-dqXRCM3C.js → SkillsManagerSection-C6lWLXvH.js} +1 -1
  64. package/dist/public/assets/{SlidesToolbarControls-D-0pa5F-.js → SlidesToolbarControls-5WOf5-kU.js} +1 -1
  65. package/dist/public/assets/{SourceEditor-DghQVHvX.js → SourceEditor-DCI5wuU2.js} +1 -1
  66. package/dist/public/assets/{SpellingSettings-C3y5UjRC.js → SpellingSettings-AV7ODzdq.js} +1 -1
  67. package/dist/public/assets/{SyncSection-DmMPCcrO.js → SyncSection-Dy1x052n.js} +1 -1
  68. package/dist/public/assets/{SyncStatusBadge-7CGaFHUk.js → SyncStatusBadge-CI4kJKJz.js} +1 -1
  69. package/dist/public/assets/{TemplateRow-C8tLmbrb.js → TemplateRow-CKPSBcvy.js} +1 -1
  70. package/dist/public/assets/{TerminalLaunchContext-58PQDilg.js → TerminalLaunchContext-DgUTkKSb.js} +1 -1
  71. package/dist/public/assets/{TerminalPanel-DOYDhObX.js → TerminalPanel-BarBipqm.js} +1 -1
  72. package/dist/public/assets/{TerminalSection-BBA8y3S1.js → TerminalSection-DhkctuaS.js} +1 -1
  73. package/dist/public/assets/{TerminalWindowApp-DFmcq1vG.js → TerminalWindowApp-BiHTk4jD.js} +1 -1
  74. package/dist/public/assets/{TextDocEditor-DxghXof_.js → TextDocEditor-MTT9X-UX.js} +1 -1
  75. package/dist/public/assets/{ThemePluginSection-rW_Rhi3t.js → ThemePluginSection-Bmm0ezpW.js} +1 -1
  76. package/dist/public/assets/{ThreadView-BcdaDwyX.js → ThreadView-CTTrHNJC.js} +1 -1
  77. package/dist/public/assets/{TimelineDiffPane-DbgES6nK.js → TimelineDiffPane-q_M_-BhG.js} +1 -1
  78. package/dist/public/assets/{agent-connections-Bc1t_U_m.js → agent-connections-7wgDgnqZ.js} +1 -1
  79. package/dist/public/assets/{agent-registry-3ko3YkCm.js → agent-registry-Cs85mdZV.js} +1 -1
  80. package/dist/public/assets/{bridge-BqL-1MyE.js → bridge-Jy9bpSqg.js} +1 -1
  81. package/dist/public/assets/{card-CHd8wMSS.js → card-BDi8CQBG.js} +1 -1
  82. package/dist/public/assets/{catalog-nXBoyoEn.js → catalog-Fc3slEfq.js} +1 -1
  83. package/dist/public/assets/{comment-chips-D7PAXgFJ.js → comment-chips-CoLxBx92.js} +1 -1
  84. package/dist/public/assets/{config-errors-DCSQBhyj.js → config-errors-DnAsM78K.js} +1 -1
  85. package/dist/public/assets/{config-provider-DBgrt1kx.js → config-provider-DXmc67dU.js} +1 -1
  86. package/dist/public/assets/config-schema-D59L2aVm.js +1 -0
  87. package/dist/public/assets/{constants-editors-05BNhhVl.js → constants-editors-bLWf6BtK.js} +1 -1
  88. package/dist/public/assets/{constants-product-DhAo-666.js → constants-product-tr6vTp-D.js} +1 -1
  89. package/dist/public/assets/{css-color-to-hex-Dk3DSeEK.js → css-color-to-hex-C9tauY10.js} +1 -1
  90. package/dist/public/assets/{doc-undo-manager-DGQuNlgn.js → doc-undo-manager-C_pnWJYM.js} +1 -1
  91. package/dist/public/assets/{documents-events-C04vpPEp.js → documents-events-DdFfHk7W.js} +1 -1
  92. package/dist/public/assets/field-controls-CKm3BgiK.js +1 -0
  93. package/dist/public/assets/{field-controls-BqsFU6aY.js → field-controls-hlVaDlD0.js} +1 -1
  94. package/dist/public/assets/{folder-config-api-bwKmZWh2.js → folder-config-api-CX9qXRQC.js} +1 -1
  95. package/dist/public/assets/{frontmatter-tags-B7FS--Ga.js → frontmatter-tags-CUlOAi99.js} +1 -1
  96. package/dist/public/assets/{index-C_8iI96N.js → index-DlH3oHvT.js} +19 -19
  97. package/dist/public/assets/{lint-config-client-C0cPUFg9.js → lint-config-client-Dris_9kn.js} +1 -1
  98. package/dist/public/assets/{lint-plugins-24yMjYos.js → lint-plugins-CINC49yJ.js} +1 -1
  99. package/dist/public/assets/{markdown-lint-DxrbxECW.js → markdown-lint-tXEf2MDv.js} +1 -1
  100. package/dist/public/assets/{markdownlint-rule-browser-C-vo_WXw.js → markdownlint-rule-browser-DQbNHswB.js} +1 -1
  101. package/dist/public/assets/{pending-receive-nav-store-ge0q0US7.js → pending-receive-nav-store-Dx3tjU3M.js} +1 -1
  102. package/dist/public/assets/platform-labels-BPRIEv67.js +1 -0
  103. package/dist/public/assets/{preferred-session-events-DZS0rMoL.js → preferred-session-events-UCAyZlN5.js} +1 -1
  104. package/dist/public/assets/{progress-BXjvg4DI.js → progress-kP97a1rO.js} +1 -1
  105. package/dist/public/assets/{project-paths-B82COK8C.js → project-paths-4aL5STlX.js} +1 -1
  106. package/dist/public/assets/{restart-collab-server-C16c-Ep9.js → restart-collab-server-D2OLLel5.js} +1 -1
  107. package/dist/public/assets/{saved-themes-client-CmQnQ6kY.js → saved-themes-client-Cx7GJLm9.js} +1 -1
  108. package/dist/public/assets/{schema-section-eljmMDBb.js → schema-section-CVZJtaH2.js} +1 -1
  109. package/dist/public/assets/{schemas-api-BM3O7zA1.js → schemas-api-JUnildTL.js} +1 -1
  110. package/dist/public/assets/{schemas-cc1-hKlHTZpE.js → schemas-cc1-By47OR1C.js} +1 -1
  111. package/dist/public/assets/{selection-context-C68gF2Oq.js → selection-context-C6c6vB_u.js} +1 -1
  112. package/dist/public/assets/{sign-in-terminal-events-Uy8J-zPE.js → sign-in-terminal-events-DfMaOZjE.js} +1 -1
  113. package/dist/public/assets/{skill-scope-CxuIje2Y.js → skill-scope-qLtpopQG.js} +1 -1
  114. package/dist/public/assets/{skill-targets-schema-BqGbUdGW.js → skill-targets-schema-BX4GqOjw.js} +1 -1
  115. package/dist/public/assets/{skills-api-Cwv39pKK.js → skills-api-DFdWVDY1.js} +1 -1
  116. package/dist/public/assets/{src-COG_7U42.js → src-DmaohtEC.js} +1 -1
  117. package/dist/public/assets/storage-scope-BI-jwbPM.js +1 -0
  118. package/dist/public/assets/{tag-pill-input-DoehfrBo.js → tag-pill-input-4ndm7-qi.js} +1 -1
  119. package/dist/public/assets/{terminal-launch-events-vPUm3fxK.js → terminal-launch-events-qwe1BiG1.js} +1 -1
  120. package/dist/public/assets/{thread-client-BoGcOSf9.js → thread-client-B4wfB-2h.js} +1 -1
  121. package/dist/public/assets/{typing-burst-detector-BKuWOIaA.js → typing-burst-detector-DrGckpC8.js} +1 -1
  122. package/dist/public/assets/{use-activity-panel-BgzoGLEn.js → use-activity-panel-CkJrJb3b.js} +1 -1
  123. package/dist/public/assets/{use-apply-config-color-theme-DsCyuU3O.js → use-apply-config-color-theme-DMXoMpUV.js} +1 -1
  124. package/dist/public/assets/{use-collab-url-CEI12fca.js → use-collab-url-B0dWOEHI.js} +1 -1
  125. package/dist/public/assets/{use-conflicts-CpABgIGI.js → use-conflicts-pFzwHTnA.js} +1 -1
  126. package/dist/public/assets/{use-git-sync-status-BQYF2F5Z.js → use-git-sync-status-CJx_G2N9.js} +1 -1
  127. package/dist/public/assets/use-installed-clis-Bq2JB-bo.js +2 -0
  128. package/dist/public/assets/{use-live-xterm-theme-CkVAs5Ql.js → use-live-xterm-theme-MtGSciv9.js} +1 -1
  129. package/dist/public/assets/{use-open-skill-CDNmRdpj.js → use-open-skill-BfvvQFrP.js} +1 -1
  130. package/dist/public/assets/{use-semantic-search-status-BYu4PoVz.js → use-semantic-search-status-BX5aUgnK.js} +1 -1
  131. package/dist/public/assets/{use-skill-origin-Be1NTkgW.js → use-skill-origin-ywt3YYti.js} +1 -1
  132. package/dist/public/assets/{use-skill-targets-Cf23drqO.js → use-skill-targets-RLdS0VLQ.js} +1 -1
  133. package/dist/public/assets/{use-skills-gbn1t63C.js → use-skills-CyNJ4hcP.js} +1 -1
  134. package/dist/public/assets/{use-terminal-enabled-CYPFWXCG.js → use-terminal-enabled-Bux88unS.js} +1 -1
  135. package/dist/public/assets/{use-timeline-entry-diff-Cb24Bjqb.js → use-timeline-entry-diff-CQd38y1M.js} +1 -1
  136. package/dist/public/assets/{use-workspace-BafUpQnS.js → use-workspace-C_QPbelO.js} +1 -1
  137. package/dist/public/index.html +63 -63
  138. package/dist/{registry-probes-c5NiVSQQ.mjs → registry-probes-CetDjX_j.mjs} +1 -1
  139. package/dist/{removal-file-path-CNAwyHXo.mjs → removal-file-path-Djea2-om.mjs} +1 -1
  140. package/dist/{repair-launch-json-BT9bYx1n.mjs → repair-launch-json-BNvTpRS_.mjs} +1 -1
  141. package/dist/{repair-mcp-configs-DjtDZjPL.mjs → repair-mcp-configs-CxYH74IT.mjs} +1 -1
  142. package/dist/{src-D0AexutX.mjs → src-BILMinJo.mjs} +1 -1
  143. package/dist/src-BUgL_R1i.mjs +1 -0
  144. package/dist/start-_aKlfpQ5.mjs +1 -0
  145. package/dist/{start-DumQRn6S.mjs → start-lJXFuEW7.mjs} +3 -3
  146. package/package.json +4 -4
  147. package/dist/constants-DkpwkeOT.mjs +0 -1
  148. package/dist/init-MqhtKFBc.mjs +0 -1
  149. package/dist/loader-DqyZtaL2.mjs +0 -1
  150. package/dist/preview-CiJP75fX.mjs +0 -1
  151. package/dist/public/assets/AppMenubar-D7u5sV7t.js +0 -1
  152. package/dist/public/assets/FeedbackForm-w2RNhl0R.js +0 -1
  153. package/dist/public/assets/ManagedArtifactProperties-sO6f840l.js +0 -1
  154. package/dist/public/assets/config-schema-xOnB5jc5.js +0 -1
  155. package/dist/public/assets/field-controls-CnF_w0df.js +0 -1
  156. package/dist/public/assets/platform-labels-CtgIRyUl.js +0 -1
  157. package/dist/public/assets/storage-scope-67lIepq6.js +0 -1
  158. package/dist/public/assets/use-installed-clis-CXwm5pk2.js +0 -2
  159. package/dist/src-vA9lJ7v2.mjs +0 -1
  160. package/dist/start-DWdrJgWH.mjs +0 -1
@@ -0,0 +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"./utils-CPqDy6Hr.js";import{a as o}from"./dist-CSCUSbQc.js";import{c as s,i as c,l,n as u,o as d}from"./dist-DTFuvKje.js";import{n as f,t as ee}from"./dist-uiDX6Nr9.js";import{n as te,r as p,t as m}from"./dist-BKgU0kag.js";import{_ as h,a as g,c as _,d as ne,f as v,g as re,h as y,i as ie,l as ae,m as oe,n as se,o as ce,p as le,r as ue,s as de,t as b,u as x}from"./dist-d0R4nnoB.js";import{t as fe}from"./check-B2OLRY33.js";import{t as S}from"./chevron-right-Bofu4lib.js";import{n as pe,r as me,t as he}from"./platform-labels-BPRIEv67.js";import{t as ge}from"./app-menubar-gate-P063SDEt.js";var C=e(n(),1),w=t(),T=`Menubar`,[E,D,_e]=f(T),[O,ve]=s(T,[_e,p]),k=h(),ye=p(),[A,j]=O(T),be=C.forwardRef((e,t)=>{let{__scopeMenubar:n,value:r,onValueChange:i,defaultValue:a,loop:o=!0,dir:s,...u}=e,d=ee(s),f=ye(n),[p,m]=c({prop:r,onChange:i,defaultProp:a??``,caller:T}),[h,g]=C.useState(null);return(0,w.jsx)(A,{scope:n,value:p,onMenuOpen:C.useCallback(e=>{m(e),g(e)},[m]),onMenuClose:C.useCallback(()=>m(``),[m]),onMenuToggle:C.useCallback(e=>{m(t=>t?``:e),g(e)},[m]),dir:d,loop:o,children:(0,w.jsx)(E.Provider,{scope:n,children:(0,w.jsx)(E.Slot,{scope:n,children:(0,w.jsx)(te,{asChild:!0,...f,orientation:`horizontal`,loop:o,dir:d,currentTabStopId:h,onCurrentTabStopIdChange:g,children:(0,w.jsx)(l.div,{role:`menubar`,...u,ref:t})})})})})});be.displayName=T;var M=`MenubarMenu`,[N,xe]=O(M),P=e=>{let{__scopeMenubar:t,value:n,...r}=e,i=u(),a=n||i||`LEGACY_REACT_AUTO_VALUE`,o=j(M,t),s=k(t),c=C.useRef(null),l=C.useRef(!1),d=o.value===a;return C.useEffect(()=>{d||(l.current=!1)},[d]),(0,w.jsx)(N,{scope:t,value:a,triggerId:u(),triggerRef:c,contentId:u(),wasKeyboardTriggerOpenRef:l,children:(0,w.jsx)(v,{...s,open:d,onOpenChange:e=>{e||o.onMenuClose()},modal:!1,dir:o.dir,...r})})};P.displayName=M;var F=`MenubarTrigger`,Se=C.forwardRef((e,t)=>{let{__scopeMenubar:n,disabled:r=!1,...i}=e,a=ye(n),s=k(n),c=j(F,n),u=xe(F,n),f=C.useRef(null),ee=o(t,f,u.triggerRef),[te,p]=C.useState(!1),h=c.value===u.value;return(0,w.jsx)(E.ItemSlot,{scope:n,value:u.value,disabled:r,children:(0,w.jsx)(m,{asChild:!0,...a,focusable:!r,tabStopId:u.value,children:(0,w.jsx)(b,{asChild:!0,...s,children:(0,w.jsx)(l.button,{type:`button`,role:`menuitem`,id:u.triggerId,"aria-haspopup":`menu`,"aria-expanded":h,"aria-controls":h?u.contentId:void 0,"data-highlighted":te?``:void 0,"data-state":h?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:ee,onPointerDown:d(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(c.onMenuOpen(u.value),h||e.preventDefault())}),onPointerEnter:d(e.onPointerEnter,()=>{c.value&&!h&&(c.onMenuOpen(u.value),f.current?.focus())}),onKeyDown:d(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&c.onMenuToggle(u.value),e.key===`ArrowDown`&&c.onMenuOpen(u.value),[`Enter`,` `,`ArrowDown`].includes(e.key)&&(u.wasKeyboardTriggerOpenRef.current=!0,e.preventDefault()))}),onFocus:d(e.onFocus,()=>p(!0)),onBlur:d(e.onBlur,()=>p(!1))})})})})});Se.displayName=F;var Ce=`MenubarPortal`,we=e=>{let{__scopeMenubar:t,...n}=e,r=k(t);return(0,w.jsx)(ae,{...r,...n})};we.displayName=Ce;var I=`MenubarContent`,Te=C.forwardRef((e,t)=>{let{__scopeMenubar:n,align:r=`start`,...i}=e,a=k(n),o=j(I,n),s=xe(I,n),c=D(n),l=C.useRef(!1);return(0,w.jsx)(ie,{id:s.contentId,"aria-labelledby":s.triggerId,"data-radix-menubar-content":``,...a,...i,ref:t,align:r,onCloseAutoFocus:d(e.onCloseAutoFocus,e=>{!o.value&&!l.current&&s.triggerRef.current?.focus(),l.current=!1,e.preventDefault()}),onFocusOutside:d(e.onFocusOutside,e=>{let t=e.target;c().some(e=>e.ref.current?.contains(t))&&e.preventDefault()}),onInteractOutside:d(e.onInteractOutside,()=>{l.current=!0}),onEntryFocus:e=>{s.wasKeyboardTriggerOpenRef.current||e.preventDefault()},onKeyDown:d(e.onKeyDown,e=>{if([`ArrowRight`,`ArrowLeft`].includes(e.key)){let t=e.target,n=t.hasAttribute(`data-radix-menubar-subtrigger`),r=t.closest(`[data-radix-menubar-content]`)!==e.currentTarget,i=(o.dir===`rtl`?`ArrowRight`:`ArrowLeft`)===e.key;if(!i&&n||r&&i)return;let a=c().filter(e=>!e.disabled).map(e=>e.value);i&&a.reverse();let l=a.indexOf(s.value);a=o.loop?J(a,l+1):a.slice(l+1);let[u]=a;u&&o.onMenuOpen(u)}},{checkForDefaultPrevented:!1}),style:{...e.style,"--radix-menubar-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-menubar-content-available-width":`var(--radix-popper-available-width)`,"--radix-menubar-content-available-height":`var(--radix-popper-available-height)`,"--radix-menubar-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-menubar-trigger-height":`var(--radix-popper-anchor-height)`}})});Te.displayName=I;var L=`MenubarGroup`,Ee=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=k(n);return(0,w.jsx)(g,{...i,...r,ref:t})});Ee.displayName=L;var De=`MenubarLabel`,R=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=k(n);return(0,w.jsx)(_,{...i,...r,ref:t})});R.displayName=De;var z=`MenubarItem`,Oe=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=k(n);return(0,w.jsx)(ce,{...i,...r,ref:t})});Oe.displayName=z;var ke=`MenubarCheckboxItem`,Ae=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=k(n);return(0,w.jsx)(ue,{...i,...r,ref:t})});Ae.displayName=ke;var je=`MenubarRadioGroup`,B=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=k(n);return(0,w.jsx)(x,{...i,...r,ref:t})});B.displayName=je;var Me=`MenubarRadioItem`,Ne=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=k(n);return(0,w.jsx)(ne,{...i,...r,ref:t})});Ne.displayName=Me;var Pe=`MenubarItemIndicator`,Fe=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=k(n);return(0,w.jsx)(de,{...i,...r,ref:t})});Fe.displayName=Pe;var V=`MenubarSeparator`,H=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=k(n);return(0,w.jsx)(le,{...i,...r,ref:t})});H.displayName=V;var U=`MenubarArrow`,W=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=k(n);return(0,w.jsx)(se,{...i,...r,ref:t})});W.displayName=U;var Ie=`MenubarSub`,G=e=>{let{__scopeMenubar:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=k(t),[s,l]=c({prop:r,defaultProp:a??!1,onChange:i,caller:Ie});return(0,w.jsx)(oe,{...o,open:s,onOpenChange:l,children:n})};G.displayName=Ie;var Le=`MenubarSubTrigger`,Re=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=k(n);return(0,w.jsx)(re,{"data-radix-menubar-subtrigger":``,...i,...r,ref:t})});Re.displayName=Le;var K=`MenubarSubContent`,q=C.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=k(n);return(0,w.jsx)(y,{...i,"data-radix-menubar-content":``,...r,ref:t,style:{...e.style,"--radix-menubar-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-menubar-content-available-width":`var(--radix-popper-available-width)`,"--radix-menubar-content-available-height":`var(--radix-popper-available-height)`,"--radix-menubar-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-menubar-trigger-height":`var(--radix-popper-anchor-height)`}})});q.displayName=K;function J(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Y=be,ze=P,Be=Se,Ve=we,He=Te,Ue=Oe,We=Ae,Ge=Fe,Ke=H,qe=G,Je=Re,Ye=q,X=i();function Xe(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`flex h-8 items-center gap-0.5 rounded-lg border p-[3px]`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,w.jsx)(Y,{"data-slot":`menubar`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}function Ze(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,w.jsx)(ze,{"data-slot":`menubar-menu`,...n}),t[2]=n,t[3]=r),r}function Qe(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,w.jsx)(Ve,{"data-slot":`menubar-portal`,...n}),t[2]=n,t[3]=r),r}function $e(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`flex items-center rounded-sm px-1.5 py-[2px] text-sm font-medium outline-hidden select-none hover:bg-muted aria-expanded:bg-muted`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,w.jsx)(Be,{"data-slot":`menubar-trigger`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}function et(e){let t=(0,X.c)(14),n,r,i,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],o=t[4],s=t[5]):({className:n,align:i,alignOffset:o,sideOffset:s,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s);let c=i===void 0?`start`:i,l=o===void 0?-4:o,u=s===void 0?8:s,d;t[6]===n?d=t[7]:(d=a(`z-50 max-h-(--radix-menubar-content-available-height) min-w-36 origin-(--radix-menubar-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[state=closed]:overflow-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 subtle-scrollbar`,n),t[6]=n,t[7]=d);let f;return t[8]!==c||t[9]!==l||t[10]!==r||t[11]!==u||t[12]!==d?(f=(0,w.jsx)(Qe,{children:(0,w.jsx)(He,{"data-slot":`menubar-content`,align:c,alignOffset:l,sideOffset:u,className:d,collisionPadding:8,...r})}),t[8]=c,t[9]=l,t[10]=r,t[11]=u,t[12]=d,t[13]=f):f=t[13],f}function Z(e){let t=(0,X.c)(12),n,r,i,o;t[0]===e?(n=t[1],r=t[2],i=t[3],o=t[4]):({className:n,inset:r,variant:o,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o);let s=o===void 0?`default`:o,c;t[5]===n?c=t[6]:(c=a(`group/menubar-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive!`,n),t[5]=n,t[6]=c);let l;return t[7]!==r||t[8]!==i||t[9]!==c||t[10]!==s?(l=(0,w.jsx)(Ue,{"data-slot":`menubar-item`,"data-inset":r,"data-variant":s,className:c,...i}),t[7]=r,t[8]=i,t[9]=c,t[10]=s,t[11]=l):l=t[11],l}function tt(e){let t=(0,X.c)(15),n,r,i,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],o=t[4],s=t[5]):({className:i,children:r,checked:n,inset:o,...s}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s);let c;t[6]===i?c=t[7]:(c=a(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-1.5 pl-7 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0`,i),t[6]=i,t[7]=c);let l;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,w.jsx)(`span`,{className:`pointer-events-none absolute left-1.5 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4`,children:(0,w.jsx)(Ge,{children:(0,w.jsx)(fe,{})})}),t[8]=l):l=t[8];let u;return t[9]!==n||t[10]!==r||t[11]!==o||t[12]!==s||t[13]!==c?(u=(0,w.jsxs)(We,{"data-slot":`menubar-checkbox-item`,"data-inset":o,className:c,checked:n,...s,children:[l,r]}),t[9]=n,t[10]=r,t[11]=o,t[12]=s,t[13]=c,t[14]=u):u=t[14],u}function Q(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`-mx-1 my-1 h-px bg-border`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,w.jsx)(Ke,{"data-slot":`menubar-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}function $(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`ml-auto text-xs tracking-widest text-muted-foreground group-focus/menubar-item:text-accent-foreground`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,w.jsx)(`span`,{"data-slot":`menubar-shortcut`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}function nt(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,w.jsx)(qe,{"data-slot":`menubar-sub`,...n}),t[2]=n,t[3]=r),r}function rt(e){let t=(0,X.c)(13),n,r,i,o;t[0]===e?(n=t[1],r=t[2],i=t[3],o=t[4]):({className:r,inset:i,children:n,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o);let s;t[5]===r?s=t[6]:(s=a(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-none select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-4`,r),t[5]=r,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,w.jsx)(S,{className:`ml-auto size-4`}),t[7]=c):c=t[7];let l;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==s?(l=(0,w.jsxs)(Je,{"data-slot":`menubar-sub-trigger`,"data-inset":i,className:s,...o,children:[n,c]}),t[8]=n,t[9]=i,t[10]=o,t[11]=s,t[12]=l):l=t[12],l}function it(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`z-50 max-h-(--radix-menubar-content-available-height) min-w-32 origin-(--radix-menubar-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[state=closed]:overflow-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 subtle-scrollbar`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,w.jsx)(Ye,{"data-slot":`menubar-sub-content`,className:i,collisionPadding:8,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}function at(){let e=(0,X.c)(404),{_:t}=r(),n=typeof window<`u`?window.okDesktop??null:null,[i,a]=(0,C.useState)(null);if(!ge()||n==null||n.menu==null)return null;let o=n.menu,s;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=e=>{o.dispatch(e).catch(ot)},e[0]=s):s=e[0];let c=s,l;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{o.dispatch({kind:`query`}).then(e=>a(e??null)).catch(()=>a(null))},e[1]=l):l=e[1];let u=l,d=i?.activeTarget.kind??null,f=i?.viewMenuState,ee;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(ee=me(n.platform),e[2]=ee):ee=e[2];let te=ee,p;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>{e&&u()},e[3]=p):p=e[3];let m;e[4]===t?m=e[5]:(m=t({id:`J2eKUI`}),e[4]=t,e[5]=m);let h;e[6]===m?h=e[7]:(h=(0,w.jsx)($e,{className:`px-2 py-1 text-xs font-normal`,children:m}),e[6]=m,e[7]=h);let g;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>c({kind:`menu-action`,action:`new-doc`}),e[8]=g):g=e[8];let _;e[9]===t?_=e[10]:(_=t({id:`HdkSiO`}),e[9]=t,e[10]=_);let ne;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,w.jsx)($,{children:`Ctrl+N`}),e[11]=ne):ne=e[11];let v;e[12]===_?v=e[13]:(v=(0,w.jsxs)(Z,{onSelect:g,children:[_,ne]}),e[12]=_,e[13]=v);let re;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(re=()=>c({kind:`menu-action`,action:`new-folder`}),e[14]=re):re=e[14];let y;e[15]===t?y=e[16]:(y=t({id:`96G6Re`}),e[15]=t,e[16]=y);let ie;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,w.jsx)($,{children:`Ctrl+Shift+N`}),e[17]=ie):ie=e[17];let ae;e[18]===y?ae=e[19]:(ae=(0,w.jsxs)(Z,{onSelect:re,children:[y,ie]}),e[18]=y,e[19]=ae);let oe;e[20]===Symbol.for(`react.memo_cache_sentinel`)?(oe=()=>c({kind:`menu-action`,action:`new-from-template`}),e[20]=oe):oe=e[20];let se;e[21]===t?se=e[22]:(se=t({id:`ioMn4Z`}),e[21]=t,e[22]=se);let ce;e[23]===se?ce=e[24]:(ce=(0,w.jsx)(Z,{onSelect:oe,children:se}),e[23]=se,e[24]=ce);let le;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,w.jsx)(Q,{}),e[25]=le):le=e[25];let ue;e[26]===t?ue=e[27]:(ue=t({id:`ten9en`}),e[26]=t,e[27]=ue);let de;e[28]===ue?de=e[29]:(de=(0,w.jsx)(rt,{children:ue}),e[28]=ue,e[29]=de);let b;e[30]!==t||e[31]!==i?(b=(0,w.jsx)(it,{children:i==null||i.recentProjects.length===0?(0,w.jsx)(Z,{disabled:!0,children:t({id:`SvBFYA`})}):(0,w.jsxs)(w.Fragment,{children:[i.recentProjects.slice(0,10).map(e=>(0,w.jsx)(Z,{onSelect:()=>c({kind:`open-recent-project`,path:e.path}),children:e.name},e.path)),(0,w.jsx)(Q,{}),(0,w.jsx)(Z,{onSelect:()=>c({kind:`command`,command:`clear-recent-projects`}),children:t({id:`ak4LLg`})})]})}),e[30]=t,e[31]=i,e[32]=b):b=e[32];let x;e[33]!==de||e[34]!==b?(x=(0,w.jsxs)(nt,{children:[de,b]}),e[33]=de,e[34]=b,e[35]=x):x=e[35];let fe;e[36]===Symbol.for(`react.memo_cache_sentinel`)?(fe=()=>c({kind:`menu-action`,action:`new-project`}),e[36]=fe):fe=e[36];let S;e[37]===t?S=e[38]:(S=t({id:`NYu2Pt`}),e[37]=t,e[38]=S);let T;e[39]===S?T=e[40]:(T=(0,w.jsx)(Z,{onSelect:fe,children:S}),e[39]=S,e[40]=T);let E;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(E=()=>c({kind:`command`,command:`open-navigator`}),e[41]=E):E=e[41];let D;e[42]===t?D=e[43]:(D=t({id:`vYPvPB`}),e[42]=t,e[43]=D);let _e;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,w.jsx)($,{children:`Ctrl+Shift+P`}),e[44]=_e):_e=e[44];let O;e[45]===D?O=e[46]:(O=(0,w.jsxs)(Z,{onSelect:E,children:[D,_e]}),e[45]=D,e[46]=O);let ve;e[47]===Symbol.for(`react.memo_cache_sentinel`)?(ve=()=>c({kind:`command`,command:`open-folder-dialog`}),e[47]=ve):ve=e[47];let k;e[48]===t?k=e[49]:(k=t({id:`FDBwmS`}),e[48]=t,e[49]=k);let ye;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,w.jsx)($,{children:`Ctrl+O`}),e[50]=ye):ye=e[50];let A;e[51]===k?A=e[52]:(A=(0,w.jsxs)(Z,{onSelect:ve,children:[k,ye]}),e[51]=k,e[52]=A);let j;e[53]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,w.jsx)(Q,{}),e[53]=j):j=e[53];let be;e[54]===Symbol.for(`react.memo_cache_sentinel`)?(be=()=>c({kind:`menu-action`,action:`new-worktree`}),e[54]=be):be=e[54];let M;e[55]===t?M=e[56]:(M=t({id:`TTDXD8`}),e[55]=t,e[56]=M);let N;e[57]===M?N=e[58]:(N=(0,w.jsx)(Z,{onSelect:be,children:M}),e[57]=M,e[58]=N);let xe;e[59]===Symbol.for(`react.memo_cache_sentinel`)?(xe=()=>c({kind:`menu-action`,action:`switch-worktree`}),e[59]=xe):xe=e[59];let P;e[60]===t?P=e[61]:(P=t({id:`mxGJVE`}),e[60]=t,e[61]=P);let F;e[62]===P?F=e[63]:(F=(0,w.jsx)(Z,{onSelect:xe,children:P}),e[62]=P,e[63]=F);let Se;e[64]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,w.jsx)(Q,{}),e[64]=Se):Se=e[64];let Ce=d!==`doc`&&d!==`folder`,we;e[65]===Symbol.for(`react.memo_cache_sentinel`)?(we=()=>c({kind:`menu-action`,action:`duplicate`}),e[65]=we):we=e[65];let I;e[66]===t?I=e[67]:(I=t({id:`euc6Ns`}),e[66]=t,e[67]=I);let Te;e[68]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,w.jsx)($,{children:`Ctrl+D`}),e[68]=Te):Te=e[68];let L;e[69]!==Ce||e[70]!==I?(L=(0,w.jsxs)(Z,{disabled:Ce,onSelect:we,children:[I,Te]}),e[69]=Ce,e[70]=I,e[71]=L):L=e[71];let Ee=d===null,De;e[72]===Symbol.for(`react.memo_cache_sentinel`)?(De=()=>c({kind:`menu-action`,action:`rename`}),e[72]=De):De=e[72];let R;e[73]===t?R=e[74]:(R=t({id:`2wxgft`}),e[73]=t,e[74]=R);let z;e[75]!==Ee||e[76]!==R?(z=(0,w.jsx)(Z,{disabled:Ee,onSelect:De,children:R}),e[75]=Ee,e[76]=R,e[77]=z):z=e[77];let Oe=d===null,ke,Ae,je;e[78]===Symbol.for(`react.memo_cache_sentinel`)?(ke=()=>c({kind:`menu-action`,action:`move-to-trash`}),Ae=pe(n.platform),je=(0,w.jsx)($,{children:`Ctrl+Del`}),e[78]=ke,e[79]=Ae,e[80]=je):(ke=e[78],Ae=e[79],je=e[80]);let B;e[81]===Oe?B=e[82]:(B=(0,w.jsxs)(Z,{disabled:Oe,onSelect:ke,children:[Ae,je]}),e[81]=Oe,e[82]=B);let Me;e[83]===Symbol.for(`react.memo_cache_sentinel`)?(Me=(0,w.jsx)(Q,{}),e[83]=Me):Me=e[83];let Ne;e[84]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,w.jsx)(Z,{onSelect:()=>c({kind:`menu-action`,action:`reveal-in-finder`}),children:te}),e[84]=Ne):Ne=e[84];let Pe=d===`asset`,Fe;e[85]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=()=>c({kind:`menu-action`,action:`send-to-ai`}),e[85]=Fe):Fe=e[85];let V;e[86]===t?V=e[87]:(V=t({id:`O7_W_a`}),e[86]=t,e[87]=V);let H;e[88]!==Pe||e[89]!==V?(H=(0,w.jsx)(Z,{disabled:Pe,onSelect:Fe,children:V}),e[88]=Pe,e[89]=V,e[90]=H):H=e[90];let U;e[91]===t?U=e[92]:(U=t({id:`oCZkaG`}),e[91]=t,e[92]=U);let W;e[93]===U?W=e[94]:(W=(0,w.jsx)(rt,{children:U}),e[93]=U,e[94]=W);let Ie;e[95]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=()=>c({kind:`menu-action`,action:`copy-full-path`}),e[95]=Ie):Ie=e[95];let G;e[96]===t?G=e[97]:(G=t({id:`oQA-cA`}),e[96]=t,e[97]=G);let Le;e[98]===G?Le=e[99]:(Le=(0,w.jsx)(Z,{onSelect:Ie,children:G}),e[98]=G,e[99]=Le);let Re;e[100]===Symbol.for(`react.memo_cache_sentinel`)?(Re=()=>c({kind:`menu-action`,action:`copy-relative-path`}),e[100]=Re):Re=e[100];let K;e[101]===t?K=e[102]:(K=t({id:`s061i4`}),e[101]=t,e[102]=K);let q;e[103]===K?q=e[104]:(q=(0,w.jsx)(Z,{onSelect:Re,children:K}),e[103]=K,e[104]=q);let J;e[105]!==Le||e[106]!==q?(J=(0,w.jsxs)(it,{children:[Le,q]}),e[105]=Le,e[106]=q,e[107]=J):J=e[107];let Y;e[108]!==W||e[109]!==J?(Y=(0,w.jsxs)(nt,{children:[W,J]}),e[108]=W,e[109]=J,e[110]=Y):Y=e[110];let ze;e[111]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,w.jsx)(Q,{}),e[111]=ze):ze=e[111];let Be;e[112]!==t||e[113]!==i?.canReconfigureMcpWiring?(Be=i?.canReconfigureMcpWiring===!0&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Z,{onSelect:()=>c({kind:`command`,command:`reconfigure-mcp-wiring`}),children:t({id:`zBUqvf`})}),(0,w.jsx)(Q,{})]}),e[112]=t,e[113]=i?.canReconfigureMcpWiring,e[114]=Be):Be=e[114];let Ve;e[115]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=()=>c({kind:`command`,command:`open-settings`}),e[115]=Ve):Ve=e[115];let He;e[116]===t?He=e[117]:(He=t({id:`uVbUP8`}),e[116]=t,e[117]=He);let Ue;e[118]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=(0,w.jsx)($,{children:`Ctrl+,`}),e[118]=Ue):Ue=e[118];let We;e[119]===He?We=e[120]:(We=(0,w.jsxs)(Z,{onSelect:Ve,children:[He,Ue]}),e[119]=He,e[120]=We);let Ge;e[121]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,w.jsx)(Q,{}),e[121]=Ge):Ge=e[121];let Ke;e[122]===Symbol.for(`react.memo_cache_sentinel`)?(Ke=()=>c({kind:`role`,role:`quit`}),e[122]=Ke):Ke=e[122];let qe;e[123]===t?qe=e[124]:(qe=t({id:`ydzS9x`}),e[123]=t,e[124]=qe);let Je;e[125]===qe?Je=e[126]:(Je=(0,w.jsx)(Z,{onSelect:Ke,children:qe}),e[125]=qe,e[126]=Je);let Ye;e[127]!==ae||e[128]!==ce||e[129]!==x||e[130]!==T||e[131]!==O||e[132]!==A||e[133]!==N||e[134]!==F||e[135]!==L||e[136]!==z||e[137]!==B||e[138]!==H||e[139]!==Y||e[140]!==Be||e[141]!==We||e[142]!==Je||e[143]!==v?(Ye=(0,w.jsxs)(et,{children:[v,ae,ce,le,x,T,O,A,j,N,F,Se,L,z,B,Me,Ne,H,Y,ze,Be,We,Ge,Je]}),e[127]=ae,e[128]=ce,e[129]=x,e[130]=T,e[131]=O,e[132]=A,e[133]=N,e[134]=F,e[135]=L,e[136]=z,e[137]=B,e[138]=H,e[139]=Y,e[140]=Be,e[141]=We,e[142]=Je,e[143]=v,e[144]=Ye):Ye=e[144];let Qe;e[145]!==h||e[146]!==Ye?(Qe=(0,w.jsxs)(Ze,{children:[h,Ye]}),e[145]=h,e[146]=Ye,e[147]=Qe):Qe=e[147];let at;e[148]===t?at=e[149]:(at=t({id:`ePK91l`}),e[148]=t,e[149]=at);let st;e[150]===at?st=e[151]:(st=(0,w.jsx)($e,{className:`px-2 py-1 text-xs font-normal`,children:at}),e[150]=at,e[151]=st);let ct;e[152]===Symbol.for(`react.memo_cache_sentinel`)?(ct=()=>c({kind:`role`,role:`undo`}),e[152]=ct):ct=e[152];let lt;e[153]===t?lt=e[154]:(lt=t({id:`9uI_rE`}),e[153]=t,e[154]=lt);let ut;e[155]===Symbol.for(`react.memo_cache_sentinel`)?(ut=(0,w.jsx)($,{children:`Ctrl+Z`}),e[155]=ut):ut=e[155];let dt;e[156]===lt?dt=e[157]:(dt=(0,w.jsxs)(Z,{onSelect:ct,children:[lt,ut]}),e[156]=lt,e[157]=dt);let ft;e[158]===Symbol.for(`react.memo_cache_sentinel`)?(ft=()=>c({kind:`role`,role:`redo`}),e[158]=ft):ft=e[158];let pt;e[159]===t?pt=e[160]:(pt=t({id:`H3oH0g`}),e[159]=t,e[160]=pt);let mt;e[161]===Symbol.for(`react.memo_cache_sentinel`)?(mt=(0,w.jsx)($,{children:`Ctrl+Y`}),e[161]=mt):mt=e[161];let ht;e[162]===pt?ht=e[163]:(ht=(0,w.jsxs)(Z,{onSelect:ft,children:[pt,mt]}),e[162]=pt,e[163]=ht);let gt;e[164]===Symbol.for(`react.memo_cache_sentinel`)?(gt=(0,w.jsx)(Q,{}),e[164]=gt):gt=e[164];let _t;e[165]===Symbol.for(`react.memo_cache_sentinel`)?(_t=()=>c({kind:`role`,role:`cut`}),e[165]=_t):_t=e[165];let vt;e[166]===t?vt=e[167]:(vt=t({id:`cCd8Bs`}),e[166]=t,e[167]=vt);let yt;e[168]===Symbol.for(`react.memo_cache_sentinel`)?(yt=(0,w.jsx)($,{children:`Ctrl+X`}),e[168]=yt):yt=e[168];let bt;e[169]===vt?bt=e[170]:(bt=(0,w.jsxs)(Z,{onSelect:_t,children:[vt,yt]}),e[169]=vt,e[170]=bt);let xt;e[171]===Symbol.for(`react.memo_cache_sentinel`)?(xt=()=>c({kind:`role`,role:`copy`}),e[171]=xt):xt=e[171];let St;e[172]===t?St=e[173]:(St=t({id:`he3ygx`}),e[172]=t,e[173]=St);let Ct;e[174]===Symbol.for(`react.memo_cache_sentinel`)?(Ct=(0,w.jsx)($,{children:`Ctrl+C`}),e[174]=Ct):Ct=e[174];let wt;e[175]===St?wt=e[176]:(wt=(0,w.jsxs)(Z,{onSelect:xt,children:[St,Ct]}),e[175]=St,e[176]=wt);let Tt;e[177]===Symbol.for(`react.memo_cache_sentinel`)?(Tt=()=>c({kind:`role`,role:`paste`}),e[177]=Tt):Tt=e[177];let Et;e[178]===t?Et=e[179]:(Et=t({id:`HzVv6g`}),e[178]=t,e[179]=Et);let Dt;e[180]===Symbol.for(`react.memo_cache_sentinel`)?(Dt=(0,w.jsx)($,{children:`Ctrl+V`}),e[180]=Dt):Dt=e[180];let Ot;e[181]===Et?Ot=e[182]:(Ot=(0,w.jsxs)(Z,{onSelect:Tt,children:[Et,Dt]}),e[181]=Et,e[182]=Ot);let kt;e[183]===Symbol.for(`react.memo_cache_sentinel`)?(kt=()=>c({kind:`role`,role:`selectAll`}),e[183]=kt):kt=e[183];let At;e[184]===t?At=e[185]:(At=t({id:`mCB6Je`}),e[184]=t,e[185]=At);let jt;e[186]===Symbol.for(`react.memo_cache_sentinel`)?(jt=(0,w.jsx)($,{children:`Ctrl+A`}),e[186]=jt):jt=e[186];let Mt;e[187]===At?Mt=e[188]:(Mt=(0,w.jsxs)(Z,{onSelect:kt,children:[At,jt]}),e[187]=At,e[188]=Mt);let Nt;e[189]===Symbol.for(`react.memo_cache_sentinel`)?(Nt=(0,w.jsx)(Q,{}),e[189]=Nt):Nt=e[189];let Pt=i?.spellCheckEnabled??!0,Ft;e[190]===Symbol.for(`react.memo_cache_sentinel`)?(Ft=()=>c({kind:`command`,command:`toggle-spell-check`}),e[190]=Ft):Ft=e[190];let It;e[191]===t?It=e[192]:(It=t({id:`ZgJVnp`}),e[191]=t,e[192]=It);let Lt;e[193]!==Pt||e[194]!==It?(Lt=(0,w.jsx)(tt,{checked:Pt,onSelect:Ft,children:It}),e[193]=Pt,e[194]=It,e[195]=Lt):Lt=e[195];let Rt;e[196]!==wt||e[197]!==Ot||e[198]!==Mt||e[199]!==Lt||e[200]!==dt||e[201]!==ht||e[202]!==bt?(Rt=(0,w.jsxs)(et,{children:[dt,ht,gt,bt,wt,Ot,Mt,Nt,Lt]}),e[196]=wt,e[197]=Ot,e[198]=Mt,e[199]=Lt,e[200]=dt,e[201]=ht,e[202]=bt,e[203]=Rt):Rt=e[203];let zt;e[204]!==Rt||e[205]!==st?(zt=(0,w.jsxs)(Ze,{children:[st,Rt]}),e[204]=Rt,e[205]=st,e[206]=zt):zt=e[206];let Bt;e[207]===t?Bt=e[208]:(Bt=t({id:`jpctdh`}),e[207]=t,e[208]=Bt);let Vt;e[209]===Bt?Vt=e[210]:(Vt=(0,w.jsx)($e,{className:`px-2 py-1 text-xs font-normal`,children:Bt}),e[209]=Bt,e[210]=Vt);let Ht;e[211]===Symbol.for(`react.memo_cache_sentinel`)?(Ht=()=>c({kind:`menu-action`,action:`navigate-back`}),e[211]=Ht):Ht=e[211];let Ut;e[212]===t?Ut=e[213]:(Ut=t({id:`iH8pgl`}),e[212]=t,e[213]=Ut);let Wt;e[214]===Symbol.for(`react.memo_cache_sentinel`)?(Wt=(0,w.jsx)($,{children:`Alt+Left`}),e[214]=Wt):Wt=e[214];let Gt;e[215]===Ut?Gt=e[216]:(Gt=(0,w.jsxs)(Z,{onSelect:Ht,children:[Ut,Wt]}),e[215]=Ut,e[216]=Gt);let Kt;e[217]===Symbol.for(`react.memo_cache_sentinel`)?(Kt=()=>c({kind:`menu-action`,action:`navigate-forward`}),e[217]=Kt):Kt=e[217];let qt;e[218]===t?qt=e[219]:(qt=t({id:`rxWGWX`}),e[218]=t,e[219]=qt);let Jt;e[220]===Symbol.for(`react.memo_cache_sentinel`)?(Jt=(0,w.jsx)($,{children:`Alt+Right`}),e[220]=Jt):Jt=e[220];let Yt;e[221]===qt?Yt=e[222]:(Yt=(0,w.jsxs)(Z,{onSelect:Kt,children:[qt,Jt]}),e[221]=qt,e[222]=Yt);let Xt;e[223]===Symbol.for(`react.memo_cache_sentinel`)?(Xt=(0,w.jsx)(Q,{}),e[223]=Xt):Xt=e[223];let Zt;e[224]===Symbol.for(`react.memo_cache_sentinel`)?(Zt=()=>c({kind:`role`,role:`reload`}),e[224]=Zt):Zt=e[224];let Qt;e[225]===t?Qt=e[226]:(Qt=t({id:`HpK_8d`}),e[225]=t,e[226]=Qt);let $t;e[227]===Qt?$t=e[228]:($t=(0,w.jsx)(Z,{onSelect:Zt,children:Qt}),e[227]=Qt,e[228]=$t);let en;e[229]===Symbol.for(`react.memo_cache_sentinel`)?(en=()=>c({kind:`role`,role:`forceReload`}),e[229]=en):en=e[229];let tn;e[230]===t?tn=e[231]:(tn=t({id:`2CHoQv`}),e[230]=t,e[231]=tn);let nn;e[232]===tn?nn=e[233]:(nn=(0,w.jsx)(Z,{onSelect:en,children:tn}),e[232]=tn,e[233]=nn);let rn;e[234]!==t||e[235]!==i?.showDevToolsMenu?(rn=i?.showDevToolsMenu===!0&&(0,w.jsx)(Z,{onSelect:()=>c({kind:`role`,role:`toggleDevTools`}),children:t({id:`pgDlbM`})}),e[234]=t,e[235]=i?.showDevToolsMenu,e[236]=rn):rn=e[236];let an;e[237]===Symbol.for(`react.memo_cache_sentinel`)?(an=(0,w.jsx)(Q,{}),e[237]=an):an=e[237];let on;e[238]===Symbol.for(`react.memo_cache_sentinel`)?(on=()=>c({kind:`menu-action`,action:`toggle-sidebar`}),e[238]=on):on=e[238];let sn;e[239]!==t||e[240]!==f?.sidebarVisible?(sn=f?.sidebarVisible===!1?t({id:`151wvk`}):t({id:`Q1mtyd`}),e[239]=t,e[240]=f?.sidebarVisible,e[241]=sn):sn=e[241];let cn;e[242]===Symbol.for(`react.memo_cache_sentinel`)?(cn=(0,w.jsx)($,{children:`Ctrl+Alt+S`}),e[242]=cn):cn=e[242];let ln;e[243]===sn?ln=e[244]:(ln=(0,w.jsxs)(Z,{onSelect:on,children:[sn,cn]}),e[243]=sn,e[244]=ln);let un;e[245]===Symbol.for(`react.memo_cache_sentinel`)?(un=()=>c({kind:`menu-action`,action:`toggle-doc-panel`}),e[245]=un):un=e[245];let dn;e[246]!==t||e[247]!==f?.docPanelVisible?(dn=f?.docPanelVisible===!1?t({id:`fSRzLo`}):t({id:`GSYWCm`}),e[246]=t,e[247]=f?.docPanelVisible,e[248]=dn):dn=e[248];let fn;e[249]===Symbol.for(`react.memo_cache_sentinel`)?(fn=(0,w.jsx)($,{children:`Ctrl+Alt+B`}),e[249]=fn):fn=e[249];let pn;e[250]===dn?pn=e[251]:(pn=(0,w.jsxs)(Z,{onSelect:un,children:[dn,fn]}),e[250]=dn,e[251]=pn);let mn;e[252]!==t||e[253]!==f?.terminalVisible?(mn=n.config.ptyAvailable&&(0,w.jsxs)(Z,{onSelect:()=>c({kind:`menu-action`,action:`toggle-terminal`}),children:[f?.terminalVisible===!0?t({id:`9xCnv8`}):t({id:`xi9KGG`}),(0,w.jsx)($,{children:`Ctrl+J`})]}),e[252]=t,e[253]=f?.terminalVisible,e[254]=mn):mn=e[254];let hn;e[255]===Symbol.for(`react.memo_cache_sentinel`)?(hn=(0,w.jsx)(Q,{}),e[255]=hn):hn=e[255];let gn=f?.showHiddenFiles??!1,_n;e[256]===Symbol.for(`react.memo_cache_sentinel`)?(_n=()=>c({kind:`menu-action`,action:`toggle-show-hidden-files`}),e[256]=_n):_n=e[256];let vn;e[257]===t?vn=e[258]:(vn=t({id:`XcGbim`}),e[257]=t,e[258]=vn);let yn;e[259]===Symbol.for(`react.memo_cache_sentinel`)?(yn=(0,w.jsx)($,{children:`Ctrl+Shift+.`}),e[259]=yn):yn=e[259];let bn;e[260]!==gn||e[261]!==vn?(bn=(0,w.jsxs)(tt,{checked:gn,onSelect:_n,children:[vn,yn]}),e[260]=gn,e[261]=vn,e[262]=bn):bn=e[262];let xn=f?.showOkFolders??!1,Sn;e[263]===Symbol.for(`react.memo_cache_sentinel`)?(Sn=()=>c({kind:`menu-action`,action:`toggle-show-ok-folders`}),e[263]=Sn):Sn=e[263];let Cn;e[264]===t?Cn=e[265]:(Cn=t({id:`GHsJb8`}),e[264]=t,e[265]=Cn);let wn;e[266]!==xn||e[267]!==Cn?(wn=(0,w.jsx)(tt,{checked:xn,onSelect:Sn,children:Cn}),e[266]=xn,e[267]=Cn,e[268]=wn):wn=e[268];let Tn=f?.showOnlyMarkdownFiles??!1,En;e[269]===Symbol.for(`react.memo_cache_sentinel`)?(En=()=>c({kind:`menu-action`,action:`toggle-show-only-markdown-files`}),e[269]=En):En=e[269];let Dn;e[270]===t?Dn=e[271]:(Dn=t({id:`WkTLN7`}),e[270]=t,e[271]=Dn);let On;e[272]!==Tn||e[273]!==Dn?(On=(0,w.jsx)(tt,{checked:Tn,onSelect:En,children:Dn}),e[272]=Tn,e[273]=Dn,e[274]=On):On=e[274];let kn=f?.showSkillsSection??!0,An;e[275]===Symbol.for(`react.memo_cache_sentinel`)?(An=()=>c({kind:`menu-action`,action:`toggle-show-skills-section`}),e[275]=An):An=e[275];let jn;e[276]===t?jn=e[277]:(jn=t({id:`WkyP2p`}),e[276]=t,e[277]=jn);let Mn;e[278]!==kn||e[279]!==jn?(Mn=(0,w.jsx)(tt,{checked:kn,onSelect:An,children:jn}),e[278]=kn,e[279]=jn,e[280]=Mn):Mn=e[280];let Nn;e[281]===Symbol.for(`react.memo_cache_sentinel`)?(Nn=(0,w.jsx)(Q,{}),e[281]=Nn):Nn=e[281];let Pn;e[282]!==t||e[283]!==f?.canExpandAll?(Pn=(f?.canExpandAll??!0)&&(0,w.jsx)(Z,{onSelect:()=>c({kind:`menu-action`,action:`expand-all-tree`}),children:t({id:`OlAl5i`})}),e[282]=t,e[283]=f?.canExpandAll,e[284]=Pn):Pn=e[284];let Fn;e[285]!==t||e[286]!==f?.canCollapseAll?(Fn=(f?.canCollapseAll??!0)&&(0,w.jsx)(Z,{onSelect:()=>c({kind:`menu-action`,action:`collapse-all-tree`}),children:t({id:`qvWGzP`})}),e[285]=t,e[286]=f?.canCollapseAll,e[287]=Fn):Fn=e[287];let In;e[288]===Symbol.for(`react.memo_cache_sentinel`)?(In=(0,w.jsx)(Q,{}),e[288]=In):In=e[288];let Ln;e[289]===Symbol.for(`react.memo_cache_sentinel`)?(Ln=()=>c({kind:`role`,role:`resetZoom`}),e[289]=Ln):Ln=e[289];let Rn;e[290]===t?Rn=e[291]:(Rn=t({id:`FF7V5K`}),e[290]=t,e[291]=Rn);let zn;e[292]===Rn?zn=e[293]:(zn=(0,w.jsx)(Z,{onSelect:Ln,children:Rn}),e[292]=Rn,e[293]=zn);let Bn;e[294]===Symbol.for(`react.memo_cache_sentinel`)?(Bn=()=>c({kind:`role`,role:`zoomIn`}),e[294]=Bn):Bn=e[294];let Vn;e[295]===t?Vn=e[296]:(Vn=t({id:`Dz7fsq`}),e[295]=t,e[296]=Vn);let Hn;e[297]===Vn?Hn=e[298]:(Hn=(0,w.jsx)(Z,{onSelect:Bn,children:Vn}),e[297]=Vn,e[298]=Hn);let Un;e[299]===Symbol.for(`react.memo_cache_sentinel`)?(Un=()=>c({kind:`role`,role:`zoomOut`}),e[299]=Un):Un=e[299];let Wn;e[300]===t?Wn=e[301]:(Wn=t({id:`bbJ-VR`}),e[300]=t,e[301]=Wn);let Gn;e[302]===Wn?Gn=e[303]:(Gn=(0,w.jsx)(Z,{onSelect:Un,children:Wn}),e[302]=Wn,e[303]=Gn);let Kn;e[304]===Symbol.for(`react.memo_cache_sentinel`)?(Kn=(0,w.jsx)(Q,{}),e[304]=Kn):Kn=e[304];let qn;e[305]===Symbol.for(`react.memo_cache_sentinel`)?(qn=()=>c({kind:`role`,role:`toggleFullScreen`}),e[305]=qn):qn=e[305];let Jn;e[306]===t?Jn=e[307]:(Jn=t({id:`LTeJuX`}),e[306]=t,e[307]=Jn);let Yn;e[308]===Symbol.for(`react.memo_cache_sentinel`)?(Yn=(0,w.jsx)($,{children:`F11`}),e[308]=Yn):Yn=e[308];let Xn;e[309]===Jn?Xn=e[310]:(Xn=(0,w.jsxs)(Z,{onSelect:qn,children:[Jn,Yn]}),e[309]=Jn,e[310]=Xn);let Zn;e[311]!==Gt||e[312]!==Yt||e[313]!==$t||e[314]!==nn||e[315]!==rn||e[316]!==ln||e[317]!==pn||e[318]!==mn||e[319]!==bn||e[320]!==wn||e[321]!==On||e[322]!==Mn||e[323]!==Pn||e[324]!==Fn||e[325]!==zn||e[326]!==Hn||e[327]!==Gn||e[328]!==Xn?(Zn=(0,w.jsxs)(et,{children:[Gt,Yt,Xt,$t,nn,rn,an,ln,pn,mn,hn,bn,wn,On,Mn,Nn,Pn,Fn,In,zn,Hn,Gn,Kn,Xn]}),e[311]=Gt,e[312]=Yt,e[313]=$t,e[314]=nn,e[315]=rn,e[316]=ln,e[317]=pn,e[318]=mn,e[319]=bn,e[320]=wn,e[321]=On,e[322]=Mn,e[323]=Pn,e[324]=Fn,e[325]=zn,e[326]=Hn,e[327]=Gn,e[328]=Xn,e[329]=Zn):Zn=e[329];let Qn;e[330]!==Vt||e[331]!==Zn?(Qn=(0,w.jsxs)(Ze,{children:[Vt,Zn]}),e[330]=Vt,e[331]=Zn,e[332]=Qn):Qn=e[332];let $n;e[333]===t?$n=e[334]:($n=t({id:`T3Mld1`}),e[333]=t,e[334]=$n);let er;e[335]===$n?er=e[336]:(er=(0,w.jsx)($e,{className:`px-2 py-1 text-xs font-normal`,children:$n}),e[335]=$n,e[336]=er);let tr;e[337]===Symbol.for(`react.memo_cache_sentinel`)?(tr=()=>c({kind:`role`,role:`minimize`}),e[337]=tr):tr=e[337];let nr;e[338]===t?nr=e[339]:(nr=t({id:`3TSz9S`}),e[338]=t,e[339]=nr);let rr;e[340]===nr?rr=e[341]:(rr=(0,w.jsx)(Z,{onSelect:tr,children:nr}),e[340]=nr,e[341]=rr);let ir;e[342]===Symbol.for(`react.memo_cache_sentinel`)?(ir=()=>c({kind:`role`,role:`close`}),e[342]=ir):ir=e[342];let ar;e[343]===t?ar=e[344]:(ar=t({id:`aRI3Om`}),e[343]=t,e[344]=ar);let or;e[345]===ar?or=e[346]:(or=(0,w.jsx)(Z,{onSelect:ir,children:ar}),e[345]=ar,e[346]=or);let sr;e[347]!==rr||e[348]!==or?(sr=(0,w.jsxs)(et,{children:[rr,or]}),e[347]=rr,e[348]=or,e[349]=sr):sr=e[349];let cr;e[350]!==er||e[351]!==sr?(cr=(0,w.jsxs)(Ze,{children:[er,sr]}),e[350]=er,e[351]=sr,e[352]=cr):cr=e[352];let lr;e[353]===t?lr=e[354]:(lr=t({id:`c3XJ18`}),e[353]=t,e[354]=lr);let ur;e[355]===lr?ur=e[356]:(ur=(0,w.jsx)($e,{className:`px-2 py-1 text-xs font-normal`,children:lr}),e[355]=lr,e[356]=ur);let dr;e[357]===Symbol.for(`react.memo_cache_sentinel`)?(dr=()=>c({kind:`command`,command:`open-github`}),e[357]=dr):dr=e[357];let fr;e[358]===t?fr=e[359]:(fr=t({id:`LeGeTf`}),e[358]=t,e[359]=fr);let pr;e[360]===fr?pr=e[361]:(pr=(0,w.jsx)(Z,{onSelect:dr,children:fr}),e[360]=fr,e[361]=pr);let mr;e[362]===Symbol.for(`react.memo_cache_sentinel`)?(mr=()=>c({kind:`command`,command:`open-docs`}),e[362]=mr):mr=e[362];let hr;e[363]===t?hr=e[364]:(hr=t({id:`TvY_XA`}),e[363]=t,e[364]=hr);let gr;e[365]===hr?gr=e[366]:(gr=(0,w.jsx)(Z,{onSelect:mr,children:hr}),e[365]=hr,e[366]=gr);let _r;e[367]===Symbol.for(`react.memo_cache_sentinel`)?(_r=()=>c({kind:`command`,command:`open-discord`}),e[367]=_r):_r=e[367];let vr;e[368]===t?vr=e[369]:(vr=t({id:`36aWJD`}),e[368]=t,e[369]=vr);let yr;e[370]===vr?yr=e[371]:(yr=(0,w.jsx)(Z,{onSelect:_r,children:vr}),e[370]=vr,e[371]=yr);let br;e[372]===Symbol.for(`react.memo_cache_sentinel`)?(br=()=>c({kind:`menu-action`,action:`report-bug`}),e[372]=br):br=e[372];let xr;e[373]===t?xr=e[374]:(xr=t({id:`ft-BOm`}),e[373]=t,e[374]=xr);let Sr;e[375]===Symbol.for(`react.memo_cache_sentinel`)?(Sr=(0,w.jsx)($,{children:`Ctrl+Shift+D`}),e[375]=Sr):Sr=e[375];let Cr;e[376]===xr?Cr=e[377]:(Cr=(0,w.jsxs)(Z,{onSelect:br,children:[xr,Sr]}),e[376]=xr,e[377]=Cr);let wr;e[378]===Symbol.for(`react.memo_cache_sentinel`)?(wr=()=>c({kind:`menu-action`,action:`send-feedback`}),e[378]=wr):wr=e[378];let Tr;e[379]===t?Tr=e[380]:(Tr=t({id:`_JOGC0`}),e[379]=t,e[380]=Tr);let Er;e[381]===Tr?Er=e[382]:(Er=(0,w.jsx)(Z,{onSelect:wr,children:Tr}),e[381]=Tr,e[382]=Er);let Dr;e[383]!==t||e[384]!==i?.canCheckForUpdates?(Dr=i?.canCheckForUpdates===!0&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Q,{}),(0,w.jsx)(Z,{onSelect:()=>c({kind:`command`,command:`check-for-updates`}),children:t({id:`3SZrdj`})})]}),e[383]=t,e[384]=i?.canCheckForUpdates,e[385]=Dr):Dr=e[385];let Or;e[386]===Symbol.for(`react.memo_cache_sentinel`)?(Or=(0,w.jsx)(Q,{}),e[386]=Or):Or=e[386];let kr;e[387]===Symbol.for(`react.memo_cache_sentinel`)?(kr=(0,w.jsx)(Z,{onSelect:()=>c({kind:`role`,role:`about`}),children:he(n.platform)}),e[387]=kr):kr=e[387];let Ar;e[388]!==pr||e[389]!==gr||e[390]!==yr||e[391]!==Cr||e[392]!==Er||e[393]!==Dr?(Ar=(0,w.jsxs)(et,{children:[pr,gr,yr,Cr,Er,Dr,Or,kr]}),e[388]=pr,e[389]=gr,e[390]=yr,e[391]=Cr,e[392]=Er,e[393]=Dr,e[394]=Ar):Ar=e[394];let jr;e[395]!==ur||e[396]!==Ar?(jr=(0,w.jsxs)(Ze,{children:[ur,Ar]}),e[395]=ur,e[396]=Ar,e[397]=jr):jr=e[397];let Mr;return e[398]!==zt||e[399]!==Qn||e[400]!==cr||e[401]!==jr||e[402]!==Qe?(Mr=(0,w.jsxs)(Xe,{"data-testid":`app-menubar`,className:`h-auto rounded-none border-0 bg-transparent p-0 shadow-none [-webkit-app-region:no-drag]`,onValueChange:p,children:[Qe,zt,Qn,cr,jr]}),e[398]=zt,e[399]=Qn,e[400]=cr,e[401]=jr,e[402]=Qe,e[403]=Mr):Mr=e[403],Mr}function ot(){}export{at as AppMenubar};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as ee}from"./utils-CPqDy6Hr.js";import{i as o,n as te,o as ne,s as re,t as ie}from"./select-Bu4Wm3Rf.js";import"./constants-upload-CVKO8P4d.js";import{n as ae}from"./dist-BGzUo_18.js";import{n as oe}from"./config-errors-DCSQBhyj.js";import"./constants-cc1-Bt4QPTUe.js";import{i as s}from"./use-apply-config-theme-CYFG76sS.js";import{g as c}from"./saved-themes-client-CmQnQ6kY.js";import"./config-provider-DBgrt1kx.js";import{t as se}from"./input-C-Qm8YDT.js";import{n as ce}from"./config-validation-events-Ct4V3svt.js";import{t as le}from"./SettingsSectionHeader-XnGFBVeB.js";import"./config-schema-xOnB5jc5.js";import{a as l,i as ue,n as u,t as de}from"./field-controls-BqsFU6aY.js";var d=a(),f=e(n(),1),p=t(),m=`content.attachmentFolderPath`,h=`attachments`;function fe(e){let t=c(e);return t===`./`?`same-folder`:t===`/`?`content-root`:t.startsWith(`./`)?`current-folder-subfolder`:`content-root-folder`}function pe(e){let t=c(e);return t===`./`||t===`/`?h:t.startsWith(`./`)?t.slice(2)||h:t}function me(e){return e.trim().replace(/^(?:\.\/)+/,``).replace(/\/{2,}/g,`/`).replace(/\/+$/g,``)}function g(e,t){let n=me(t)||h;return e===`same-folder`?`./`:e===`content-root`?`/`:e===`current-folder-subfolder`?`./${n}`:n}function _(){let e=(0,d.c)(4),{projectBinding:t,projectConfig:n,projectSynced:r}=s();if(!t||!r||!n){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,p.jsx)(u,{}),e[0]=t):t=e[0],t}let i=n.content.attachmentFolderPath??`./`,a;return e[1]!==i||e[2]!==t?(a=(0,p.jsx)(v,{binding:t,value:i},i),e[1]=i,e[2]=t,e[3]=a):a=e[3],a}function v(e){let t=(0,d.c)(50),{binding:n,value:a}=e,{_:s}=i(),c;t[0]===a?c=t[1]:(c=()=>fe(a),t[0]=a,t[1]=c);let[u,me]=(0,f.useState)(c),_;t[2]===a?_=t[3]:(_=()=>pe(a),t[2]=a,t[3]=_);let[v,y]=(0,f.useState)(_),[b,x]=(0,f.useState)(null),[S,he]=(0,f.useState)(!1),[ge,_e]=(0,f.useState)(!1),C=(0,f.useRef)(null),w=(0,f.useRef)(null),T,E;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>()=>{C.current&&clearTimeout(C.current),w.current&&clearTimeout(w.current)},E=[],t[4]=T,t[5]=E):(T=t[4],E=t[5]),(0,f.useEffect)(T,E);let D,O;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>ce(e=>{if(e.docName!==`__config__/project`||ue(e.error)!==m)return;let t=l(e.error,m);ae.error(oe(e.error),{duration:8e3}),x(t),_e(!0),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{_e(!1),x(null)},600)}),O=[],t[6]=D,t[7]=O):(D=t[6],O=t[7]),(0,f.useEffect)(D,O);let k;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>{he(!0),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>he(!1),1200)},t[8]=k):k=t[8];let ve=k,A;t[9]!==s||t[10]!==n?(A=e=>{let t=n.patch({content:{attachmentFolderPath:e}});if(t.ok){x(null),ve();return}let r=l(t.error,m);x(r),ae.error(s({id:`eQxm13`,values:{detail:r}}))},t[9]=s,t[10]=n,t[11]=A):A=t[11];let j=A,M;t[12]!==j||t[13]!==v?(M=e=>{if(e!==`same-folder`&&e!==`content-root`&&e!==`current-folder-subfolder`&&e!==`content-root-folder`)return;let t=e,n=t===`current-folder-subfolder`||t===`content-root-folder`?v||h:v;me(t),y(n),j(g(t,n))},t[12]=j,t[13]=v,t[14]=M):M=t[14];let N=M,P;t[15]!==j||t[16]!==v||t[17]!==u?(P=()=>{let e=g(u,v);y(pe(e)),j(e)},t[15]=j,t[16]=v,t[17]=u,t[18]=P):P=t[18];let F=P,I=u===`current-folder-subfolder`||u===`content-root-folder`,L;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,p.jsx)(r,{id:`w_Sphq`}),t[19]=L):L=t[19];let R;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,p.jsx)(le,{titleId:`settings-attachments-title`,title:L,scope:`project`,level:`block`,children:(0,p.jsx)(r,{id:`Hnl9nT`})}),t[20]=R):R=t[20];let z=ge&&`animate-settings-flash`,B;t[21]===z?B=t[22]:(B=ee(`rounded-md border p-3`,z),t[21]=z,t[22]=B);let V;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,p.jsx)(`div`,{className:`text-sm font-medium`,id:`settings-attachments-location-label`,children:(0,p.jsx)(r,{id:`AsqRE_`})}),t[23]=V):V=t[23];let H;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,p.jsxs)(`div`,{className:`space-y-0.5`,children:[V,(0,p.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,p.jsx)(r,{id:`vppAju`})})]}),t[24]=H):H=t[24];let U;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,p.jsx)(ne,{"aria-labelledby":`settings-attachments-location-label`,"data-testid":`settings-attachments-mode`,size:`sm`,children:(0,p.jsx)(re,{})}),t[25]=U):U=t[25];let W;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,p.jsx)(o,{value:`same-folder`,children:(0,p.jsx)(r,{id:`Q7W-mC`})}),t[26]=W):W=t[26];let G;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,p.jsx)(o,{value:`content-root`,children:(0,p.jsx)(r,{id:`yWSvcf`})}),t[27]=G):G=t[27];let K;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,p.jsx)(o,{value:`current-folder-subfolder`,children:(0,p.jsx)(r,{id:`0YUS3Q`})}),t[28]=K):K=t[28];let q;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,p.jsxs)(te,{children:[W,G,K,(0,p.jsx)(o,{value:`content-root-folder`,children:(0,p.jsx)(r,{id:`qAx7xG`})})]}),t[29]=q):q=t[29];let J;t[30]!==u||t[31]!==N?(J=(0,p.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(16rem,18rem)] sm:items-start`,children:[H,(0,p.jsxs)(ie,{value:u,onValueChange:N,children:[U,q]})]}),t[30]=u,t[31]=N,t[32]=J):J=t[32];let Y;t[33]!==s||t[34]!==F||t[35]!==v||t[36]!==I?(Y=I?(0,p.jsxs)(`div`,{className:`mt-3 max-w-sm space-y-1`,children:[(0,p.jsx)(`label`,{className:`text-sm font-medium`,htmlFor:`settings-attachments-folder-input`,children:(0,p.jsx)(r,{id:`kNqMMd`})}),(0,p.jsx)(se,{id:`settings-attachments-folder-input`,value:v,placeholder:s({id:`OeAl1e`}),onChange:e=>y(e.target.value),onBlur:F,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),F())},className:`h-8 text-sm`,"data-testid":`settings-attachments-folder`})]}):null,t[33]=s,t[34]=F,t[35]=v,t[36]=I,t[37]=Y):Y=t[37];let X;t[38]===b?X=t[39]:(X=b?(0,p.jsx)(`p`,{className:`text-1sm text-destructive`,"data-field-error":m,role:`alert`,children:b}):null,t[38]=b,t[39]=X);let Z;t[40]===S?Z=t[41]:(Z=(0,p.jsx)(de,{visible:S}),t[40]=S,t[41]=Z);let Q;t[42]!==X||t[43]!==Z?(Q=(0,p.jsxs)(`div`,{className:`mt-2 flex min-h-5 items-center gap-2`,children:[X,Z]}),t[42]=X,t[43]=Z,t[44]=Q):Q=t[44];let $;return t[45]!==B||t[46]!==J||t[47]!==Y||t[48]!==Q?($=(0,p.jsxs)(`section`,{"aria-labelledby":`settings-attachments-title`,className:`space-y-3`,"data-testid":`settings-attachments`,children:[R,(0,p.jsxs)(`div`,{className:B,"data-field":m,"data-scope":`project`,children:[J,Y,Q]})]}),t[45]=B,t[46]=J,t[47]=Y,t[48]=Q,t[49]=$):$=t[49],$}export{_ as AttachmentsSection};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as ee}from"./utils-CPqDy6Hr.js";import{i as o,n as te,o as ne,s as re,t as ie}from"./select-Bu4Wm3Rf.js";import"./constants-upload-CVKO8P4d.js";import{n as ae}from"./dist-BGzUo_18.js";import{n as oe}from"./config-errors-DnAsM78K.js";import"./constants-cc1-Bt4QPTUe.js";import{i as s}from"./use-apply-config-theme-CYFG76sS.js";import{g as c}from"./saved-themes-client-Cx7GJLm9.js";import"./config-provider-DXmc67dU.js";import{t as se}from"./input-C-Qm8YDT.js";import{n as ce}from"./config-validation-events-Ct4V3svt.js";import{t as le}from"./SettingsSectionHeader-XnGFBVeB.js";import"./config-schema-D59L2aVm.js";import{a as l,i as ue,n as u,t as de}from"./field-controls-hlVaDlD0.js";var d=a(),f=e(n(),1),p=t(),m=`content.attachmentFolderPath`,h=`attachments`;function fe(e){let t=c(e);return t===`./`?`same-folder`:t===`/`?`content-root`:t.startsWith(`./`)?`current-folder-subfolder`:`content-root-folder`}function pe(e){let t=c(e);return t===`./`||t===`/`?h:t.startsWith(`./`)?t.slice(2)||h:t}function me(e){return e.trim().replace(/^(?:\.\/)+/,``).replace(/\/{2,}/g,`/`).replace(/\/+$/g,``)}function g(e,t){let n=me(t)||h;return e===`same-folder`?`./`:e===`content-root`?`/`:e===`current-folder-subfolder`?`./${n}`:n}function _(){let e=(0,d.c)(4),{projectBinding:t,projectConfig:n,projectSynced:r}=s();if(!t||!r||!n){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,p.jsx)(u,{}),e[0]=t):t=e[0],t}let i=n.content.attachmentFolderPath??`./`,a;return e[1]!==i||e[2]!==t?(a=(0,p.jsx)(v,{binding:t,value:i},i),e[1]=i,e[2]=t,e[3]=a):a=e[3],a}function v(e){let t=(0,d.c)(50),{binding:n,value:a}=e,{_:s}=i(),c;t[0]===a?c=t[1]:(c=()=>fe(a),t[0]=a,t[1]=c);let[u,me]=(0,f.useState)(c),_;t[2]===a?_=t[3]:(_=()=>pe(a),t[2]=a,t[3]=_);let[v,y]=(0,f.useState)(_),[b,x]=(0,f.useState)(null),[S,he]=(0,f.useState)(!1),[ge,_e]=(0,f.useState)(!1),C=(0,f.useRef)(null),w=(0,f.useRef)(null),T,E;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>()=>{C.current&&clearTimeout(C.current),w.current&&clearTimeout(w.current)},E=[],t[4]=T,t[5]=E):(T=t[4],E=t[5]),(0,f.useEffect)(T,E);let D,O;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>ce(e=>{if(e.docName!==`__config__/project`||ue(e.error)!==m)return;let t=l(e.error,m);ae.error(oe(e.error),{duration:8e3}),x(t),_e(!0),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{_e(!1),x(null)},600)}),O=[],t[6]=D,t[7]=O):(D=t[6],O=t[7]),(0,f.useEffect)(D,O);let k;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>{he(!0),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>he(!1),1200)},t[8]=k):k=t[8];let ve=k,A;t[9]!==s||t[10]!==n?(A=e=>{let t=n.patch({content:{attachmentFolderPath:e}});if(t.ok){x(null),ve();return}let r=l(t.error,m);x(r),ae.error(s({id:`eQxm13`,values:{detail:r}}))},t[9]=s,t[10]=n,t[11]=A):A=t[11];let j=A,M;t[12]!==j||t[13]!==v?(M=e=>{if(e!==`same-folder`&&e!==`content-root`&&e!==`current-folder-subfolder`&&e!==`content-root-folder`)return;let t=e,n=t===`current-folder-subfolder`||t===`content-root-folder`?v||h:v;me(t),y(n),j(g(t,n))},t[12]=j,t[13]=v,t[14]=M):M=t[14];let N=M,P;t[15]!==j||t[16]!==v||t[17]!==u?(P=()=>{let e=g(u,v);y(pe(e)),j(e)},t[15]=j,t[16]=v,t[17]=u,t[18]=P):P=t[18];let F=P,I=u===`current-folder-subfolder`||u===`content-root-folder`,L;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,p.jsx)(r,{id:`w_Sphq`}),t[19]=L):L=t[19];let R;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,p.jsx)(le,{titleId:`settings-attachments-title`,title:L,scope:`project`,level:`block`,children:(0,p.jsx)(r,{id:`Hnl9nT`})}),t[20]=R):R=t[20];let z=ge&&`animate-settings-flash`,B;t[21]===z?B=t[22]:(B=ee(`rounded-md border p-3`,z),t[21]=z,t[22]=B);let V;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,p.jsx)(`div`,{className:`text-sm font-medium`,id:`settings-attachments-location-label`,children:(0,p.jsx)(r,{id:`AsqRE_`})}),t[23]=V):V=t[23];let H;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,p.jsxs)(`div`,{className:`space-y-0.5`,children:[V,(0,p.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,p.jsx)(r,{id:`vppAju`})})]}),t[24]=H):H=t[24];let U;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,p.jsx)(ne,{"aria-labelledby":`settings-attachments-location-label`,"data-testid":`settings-attachments-mode`,size:`sm`,children:(0,p.jsx)(re,{})}),t[25]=U):U=t[25];let W;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,p.jsx)(o,{value:`same-folder`,children:(0,p.jsx)(r,{id:`Q7W-mC`})}),t[26]=W):W=t[26];let G;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,p.jsx)(o,{value:`content-root`,children:(0,p.jsx)(r,{id:`yWSvcf`})}),t[27]=G):G=t[27];let K;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,p.jsx)(o,{value:`current-folder-subfolder`,children:(0,p.jsx)(r,{id:`0YUS3Q`})}),t[28]=K):K=t[28];let q;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,p.jsxs)(te,{children:[W,G,K,(0,p.jsx)(o,{value:`content-root-folder`,children:(0,p.jsx)(r,{id:`qAx7xG`})})]}),t[29]=q):q=t[29];let J;t[30]!==u||t[31]!==N?(J=(0,p.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(16rem,18rem)] sm:items-start`,children:[H,(0,p.jsxs)(ie,{value:u,onValueChange:N,children:[U,q]})]}),t[30]=u,t[31]=N,t[32]=J):J=t[32];let Y;t[33]!==s||t[34]!==F||t[35]!==v||t[36]!==I?(Y=I?(0,p.jsxs)(`div`,{className:`mt-3 max-w-sm space-y-1`,children:[(0,p.jsx)(`label`,{className:`text-sm font-medium`,htmlFor:`settings-attachments-folder-input`,children:(0,p.jsx)(r,{id:`kNqMMd`})}),(0,p.jsx)(se,{id:`settings-attachments-folder-input`,value:v,placeholder:s({id:`OeAl1e`}),onChange:e=>y(e.target.value),onBlur:F,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),F())},className:`h-8 text-sm`,"data-testid":`settings-attachments-folder`})]}):null,t[33]=s,t[34]=F,t[35]=v,t[36]=I,t[37]=Y):Y=t[37];let X;t[38]===b?X=t[39]:(X=b?(0,p.jsx)(`p`,{className:`text-1sm text-destructive`,"data-field-error":m,role:`alert`,children:b}):null,t[38]=b,t[39]=X);let Z;t[40]===S?Z=t[41]:(Z=(0,p.jsx)(de,{visible:S}),t[40]=S,t[41]=Z);let Q;t[42]!==X||t[43]!==Z?(Q=(0,p.jsxs)(`div`,{className:`mt-2 flex min-h-5 items-center gap-2`,children:[X,Z]}),t[42]=X,t[43]=Z,t[44]=Q):Q=t[44];let $;return t[45]!==B||t[46]!==J||t[47]!==Y||t[48]!==Q?($=(0,p.jsxs)(`section`,{"aria-labelledby":`settings-attachments-title`,className:`space-y-3`,"data-testid":`settings-attachments`,children:[R,(0,p.jsxs)(`div`,{className:B,"data-field":m,"data-scope":`project`,children:[J,Y,Q]})]}),t[45]=B,t[46]=J,t[47]=Y,t[48]=Q,t[49]=$):$=t[49],$}export{_ as AttachmentsSection};
@@ -1,3 +1,3 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-DzgjsZzC.js";import{n as s}from"./dist-BGzUo_18.js";import{t as c}from"./dist-C_FzPxEX2.js";import{u as l,v as u}from"./schemas-B93JY9Ef.js";import"./schemas-api-BM3O7zA1.js";import{n as d}from"./_envelope-Dwl6i2K9-DPqJ_Q4W.js";import{t as f}from"./arrow-up-right-nJaICi16.js";import{t as p}from"./check-B2OLRY33.js";import{t as m}from"./copy-DpWa6i2v.js";import{c as h,i as g,n as _,o as v,s as y,t as b}from"./dialog-BJEjKJjL.js";import{t as x}from"./input-C-Qm8YDT.js";import{t as S}from"./external-link-CldCnbtR.js";var C=e(n(),1),ee=a(),w=`github.com`,T=new Map,E=d.extend({type:l(`urn:ok:error:non-github-origin`),host:u().min(1).nullish().catch(null)});async function D(e){try{return await e.json()}catch{return}}async function O(e){return d.safeParse(await D(e)).data}async function k(e,t){return fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t??{})})}async function A(e){let t=e?.host??w,n=await k(`/api/local-op/auth/status`,e);if(!n.ok){let e=await D(n),r=E.safeParse(e);if(r.success){let e=r.data.host??null;return{authenticated:!1,host:e??t,error:r.data.title,unsupportedOrigin:{host:e}}}return{authenticated:!1,host:t,error:d.safeParse(e).data?.title}}let r=await n.json(),i=typeof r.host==`string`?r.host:t,a=r.ghAvailable===!0;if(r.authenticated===!0&&typeof r.login==`string`){let e=r.tier===`A`||r.tier===`B`||r.tier===`C`?r.tier:void 0;return{authenticated:!0,host:i,login:r.login,tier:e,name:typeof r.name==`string`?r.name:void 0,email:typeof r.email==`string`?r.email:void 0,ghAvailable:a}}return{authenticated:!1,host:i,error:typeof r.error==`string`?r.error:void 0,ghAvailable:a}}function j(e){let t=e?.host??w,n=T.get(t);if(n)return n;let r=A(e).finally(()=>{T.delete(t)});return T.set(t,r),r}function M(e){let t=e.split(`
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-DzgjsZzC.js";import{n as s}from"./dist-BGzUo_18.js";import{t as c}from"./dist-C_FzPxEX2.js";import{u as l,v as u}from"./schemas-B93JY9Ef.js";import"./schemas-api-JUnildTL.js";import{n as d}from"./_envelope-Dwl6i2K9-DPqJ_Q4W.js";import{t as f}from"./arrow-up-right-nJaICi16.js";import{t as p}from"./check-B2OLRY33.js";import{t as m}from"./copy-DpWa6i2v.js";import{c as h,i as g,n as _,o as v,s as y,t as b}from"./dialog-BJEjKJjL.js";import{t as x}from"./input-C-Qm8YDT.js";import{t as S}from"./external-link-CldCnbtR.js";var C=e(n(),1),ee=a(),w=`github.com`,T=new Map,E=d.extend({type:l(`urn:ok:error:non-github-origin`),host:u().min(1).nullish().catch(null)});async function D(e){try{return await e.json()}catch{return}}async function O(e){return d.safeParse(await D(e)).data}async function k(e,t){return fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t??{})})}async function A(e){let t=e?.host??w,n=await k(`/api/local-op/auth/status`,e);if(!n.ok){let e=await D(n),r=E.safeParse(e);if(r.success){let e=r.data.host??null;return{authenticated:!1,host:e??t,error:r.data.title,unsupportedOrigin:{host:e}}}return{authenticated:!1,host:t,error:d.safeParse(e).data?.title}}let r=await n.json(),i=typeof r.host==`string`?r.host:t,a=r.ghAvailable===!0;if(r.authenticated===!0&&typeof r.login==`string`){let e=r.tier===`A`||r.tier===`B`||r.tier===`C`?r.tier:void 0;return{authenticated:!0,host:i,login:r.login,tier:e,name:typeof r.name==`string`?r.name:void 0,email:typeof r.email==`string`?r.email:void 0,ghAvailable:a}}return{authenticated:!1,host:i,error:typeof r.error==`string`?r.error:void 0,ghAvailable:a}}function j(e){let t=e?.host??w,n=T.get(t);if(n)return n;let r=A(e).finally(()=>{T.delete(t)});return T.set(t,r),r}function M(e){let t=e.split(`
2
2
  `);for(let e=t.length-1;e>=0;e--){let n=t[e]?.trim();if(n)try{let e=JSON.parse(n);if(e&&typeof e==`object`)return e}catch{}}return null}function N(){return{status:j,async repos(e){let t=e?.host??`github.com`,n=await k(`/api/local-op/auth/repos`,e);if(!n.ok)return{ok:!1,error:(await O(n))?.title??c._({id:`sGZLfB`})};let r=M(await n.text());if(r&&r.type===`error`&&r.problem&&typeof r.problem==`object`){let e=r.problem;return{ok:!1,error:e.detail||e.title||c._({id:`sGZLfB`})}}if(!r||!Array.isArray(r.repos))return{ok:!1,error:c._({id:`sGZLfB`})};let i=[];for(let e of r.repos){let t=e;typeof t?.full_name==`string`&&typeof t.clone_url==`string`&&i.push({full_name:t.full_name,clone_url:t.clone_url,private:t.private===!0})}return{ok:!0,host:typeof r.host==`string`?r.host:t,repos:i}},async signout(e){let t=await k(`/api/local-op/auth/signout`,e);return t.ok?{ok:!0}:{ok:!1,error:(await O(t))?.title}}}}function P(e){return{status:t=>e.localOp.authStatus(t),repos:t=>e.localOp.authRepos(t)}}async function F(e,t){let n=e.getReader(),r=new TextDecoder,i=``;for(;;){let{done:e,value:a}=await n.read();if(e)return i+=r.decode(),!!(i.trim()&&t(i)===`terminal`);i+=r.decode(a,{stream:!0});let o=i.split(`
3
3
  `);i=o.pop()??``;for(let e of o)if(e.trim()&&t(e)===`terminal`)return!0}}function I(e){let t=[],n=[],r=new AbortController,i=!1,a=()=>{for(let e of n.splice(0))e(null)};return e(e=>{i||(n.length>0?n.shift()?.(e):t.push(e),(e.type===`complete`||e.type===`error`)&&(i=!0,r.abort(),a()))},r.signal),{events:{[Symbol.asyncIterator](){return{async next(){if(t.length>0){let e=t.shift();return e===void 0?{value:void 0,done:!0}:{value:e,done:!1}}return i?{value:void 0,done:!0}:new Promise(e=>{n.push(t=>{e(t===null?{value:void 0,done:!0}:{value:t,done:!1})})})}}}},cancel:()=>{i||(i=!0,r.abort(),a())}}}var L=2e3,R=1e4;function z(e,t){return new Promise(n=>{let r=setTimeout(()=>{t.removeEventListener(`abort`,i),n()},e);function i(){clearTimeout(r),n()}t.addEventListener(`abort`,i,{once:!0})})}function B(e){fetch(`/api/local-op/auth/cancel`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({channel:e})}).catch(e=>{console.warn(`[auth-transport] Cancel request failed (best-effort):`,e instanceof Error?e.message:e)})}async function V(e,t,n,r){let i=N(),a=L;for(;!t.aborted&&Date.now()<n;){try{let n=await i.status(r?{host:r}:void 0);if(t.aborted)return;if(n.authenticated){e({type:`complete`,host:n.host,login:n.login,name:n.name,email:n.email});return}}catch(e){console.warn(`[auth-transport] Recovery probe failed:`,e instanceof Error?e.message:e)}await z(a,t),a=Math.min(a*1.5,R)}t.aborted||e({type:`error`,message:c._({id:`ve8vEM`})})}function te(e,t,n){let r=!1,i=I((n,i)=>{let a=e=>{(e.type===`complete`||e.type===`error`)&&(r=!0),n(e)};(async()=>{let n=null;try{let r=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t),signal:i});if(!r.ok){let e=c._({id:`LnVIW4`});try{let t=d.safeParse(await r.json());t.success&&(e=t.data.detail||t.data.title)}catch{}a({type:`error`,message:e});return}if(!r.body){a({type:`error`,message:c._({id:`LnVIW4`})});return}if(await F(r.body,e=>{let t;try{t=JSON.parse(e)}catch{return console.warn(`[auth-transport] Dropped unparseable NDJSON line:`,e.slice(0,100)),`continue`}if(t&&typeof t==`object`&&t.type===`error`&&`problem`in t){let e=t.problem;return a({type:`error`,message:e?.detail||e?.title||c._({id:`29VNqC`})}),`terminal`}if(t.type===`ping`)return`continue`;let r=t;return r.type===`verification`&&(n=Date.now()+r.expires_in*1e3),a(r),r.type===`complete`||r.type===`error`?`terminal`:`continue`})||i.aborted)return;if(n===null){a({type:`error`,message:c._({id:`DskIkK`})});return}await V(a,i,n,t.host)}catch(e){if(e instanceof Error&&e.name===`AbortError`)return;if(n!==null){await V(a,i,n,t.host);return}a({type:`error`,message:c._({id:`Q5fqMz`})})}})()});return{events:i.events,cancel:()=>{r||B(n),i.cancel()}}}function ne(){return{start(){return te(`/api/local-op/auth/login`,{json:!0},`login`)},ghLogin(e){return te(`/api/local-op/auth/gh-login`,{host:e,json:!0},`gh-login`)},async pat(e,t){try{let n=await fetch(`/api/local-op/auth/pat`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({host:e,token:t})});if(n.ok){let e=await n.json();return{ok:!0,login:typeof e.login==`string`?e.login:``}}let r=c._({id:`sNeKjP`});try{let e=d.safeParse(await n.json());e.success&&(r=e.data.detail||e.data.title)}catch{}return{ok:!1,error:r}}catch{return{ok:!1,error:c._({id:`Q5fqMz`})}}},async hostToken(e,t,n){try{let r=await fetch(`/api/local-op/auth/token`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({host:e,username:t,token:n})});if(r.ok){let e=await r.json();return{ok:!0,login:typeof e.login==`string`?e.login:``}}let i=c._({id:`sNeKjP`});try{let e=d.safeParse(await r.json());e.success&&(i=e.data.detail||e.data.title)}catch{}return{ok:!1,error:i}}catch{return{ok:!1,error:c._({id:`Q5fqMz`})}}}}}function re(e){return{start(){return e.localOp.auth.start()}}}var H=t();async function ie(e){try{await navigator.clipboard.writeText(e)}catch{}}function ae(e){let t=(0,ee.c)(25),{onSuccess:n,startFlow:a}=e,{_:s}=i(),[c,l]=(0,C.useState)(null),[u,d]=(0,C.useState)(`https://github.com/login/device`),[h,g]=(0,C.useState)(!1),[_,v]=(0,C.useState)(null),[y,b]=(0,C.useState)(null),[x,w]=(0,C.useState)(0),T=(0,C.useRef)(null),E=(0,C.useRef)(null),D;t[0]!==s||t[1]!==n||t[2]!==a?(D=async function(){v(null);try{let e=a();T.current=e.cancel;let t=e.events[Symbol.asyncIterator](),r=!1,i=await t.next();for(;!i.done;){let e=i.value;if(e.type===`verification`)l(e.user_code),d(e.verification_uri),b(Date.now()+e.expires_in*1e3),w(e.expires_in*1e3),ie(e.user_code).then(()=>{g(!0),setTimeout(()=>g(!1),2e3)});else if(e.type===`complete`){r=!0,n({login:e.login,name:e.name,email:e.email,avatarUrl:e.avatarUrl});break}else if(e.type===`error`){r=!0,v(e.message);break}i=await t.next()}r||v(s({id:`DskIkK`}))}catch(e){let t=e;t instanceof Error&&t.name!==`AbortError`&&v(s({id:`Q5fqMz`}))}},t[0]=s,t[1]=n,t[2]=a,t[3]=D):D=t[3];let O=D,k;t[4]===O?k=t[5]:(k=()=>{let e=!1;return queueMicrotask(()=>{e||O()}),()=>{e=!0,T.current?.(),T.current=null,E.current&&clearInterval(E.current)}},t[4]=O,t[5]=k);let A;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(A=[],t[6]=A):A=t[6],(0,C.useEffect)(k,A);let j,M;t[7]!==s||t[8]!==y?(j=()=>{if(y!==null)return E.current=setInterval(()=>{let e=y-Date.now();e<=0?(w(0),E.current&&clearInterval(E.current),v(s({id:`ve8vEM`}))):w(e)},1e3),()=>{E.current&&clearInterval(E.current)}},M=[y,s],t[7]=s,t[8]=y,t[9]=j,t[10]=M):(j=t[9],M=t[10]),(0,C.useEffect)(j,M);let N=Math.floor(x/6e4),P=Math.floor(x%6e4/1e3),F;t[11]===P?F=t[12]:(F=P.toString().padStart(2,`0`),t[11]=P,t[12]=F);let I=`${N}:${F}`,L;t[13]!==s||t[14]!==h||t[15]!==_||t[16]!==I||t[17]!==c||t[18]!==u?(L=c?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,H.jsx)(r,{id:`eVPynQ`,values:{verificationUri:u},components:{0:(0,H.jsx)(`a`,{href:u,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>S(e,u),onAuxClick:e=>S(e,u),className:`inline-flex items-center gap-0.5 text-foreground hover:text-primary hover:underline`}),1:(0,H.jsx)(`span`,{}),2:(0,H.jsx)(f,{className:`inline size-3.5`,"aria-hidden":!0})}})}),(0,H.jsxs)(o,{type:`button`,variant:`outline`,"aria-label":s({id:`nCzR-G`,values:{userCode:c}}),onClick:()=>void ie(c).then(()=>{g(!0),setTimeout(()=>g(!1),2e3)}),className:`relative h-auto w-full justify-center rounded-md bg-muted px-12 py-3 hover:bg-muted/80`,children:[(0,H.jsx)(`code`,{className:`font-mono text-2xl font-bold tracking-widest`,children:c}),(0,H.jsx)(`span`,{className:`absolute right-3 text-muted-foreground`,"aria-hidden":`true`,children:h?(0,H.jsx)(p,{className:`size-4`}):(0,H.jsx)(m,{className:`size-4`})})]}),(0,H.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:h?(0,H.jsx)(r,{id:`80c4-P`}):null}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,H.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:`size-1.5 rounded-full bg-amber-500 animate-pulse`}),(0,H.jsx)(r,{id:`5y_9lO`})]}),(0,H.jsx)(`span`,{children:(0,H.jsx)(r,{id:`gYz2ep`,values:{timeLabel:I}})})]})]}):(0,H.jsx)(`div`,{className:`flex items-center justify-center py-6 text-sm text-muted-foreground`,children:_?null:(0,H.jsx)(r,{id:`aWlJai`})}),t[13]=s,t[14]=h,t[15]=_,t[16]=I,t[17]=c,t[18]=u,t[19]=L):L=t[19];let R;t[20]===_?R=t[21]:(R=_&&(0,H.jsx)(`p`,{className:`text-1sm text-destructive`,children:_}),t[20]=_,t[21]=R);let z;return t[22]!==L||t[23]!==R?(z=(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[L,R]}),t[22]=L,t[23]=R,t[24]=z):z=t[24],z}function oe(e){let t=(0,ee.c)(30),{login:n,name:a,onNameChange:o,email:s,onEmailChange:c}=e,{_:l}=i(),u;t[0]===n?u=t[1]:(u=(0,H.jsx)(`p`,{className:`text-sm font-medium`,children:(0,H.jsx)(r,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=u);let d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,H.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,H.jsx)(r,{id:`gp3I7-`})}),t[2]=d):d=t[2];let f;t[3]===l?f=t[4]:(f=l({id:`6YtxFj`}),t[3]=l,t[4]=f);let p;t[5]!==l||t[6]!==n?(p=l({id:`J2Mv98`,values:{login:n}}),t[5]=l,t[6]=n,t[7]=p):p=t[7];let m;t[8]===o?m=t[9]:(m=e=>o(e.target.value),t[8]=o,t[9]=m);let h;t[10]!==a||t[11]!==f||t[12]!==p||t[13]!==m?(h=(0,H.jsx)(x,{"aria-label":f,placeholder:p,value:a,onChange:m}),t[10]=a,t[11]=f,t[12]=p,t[13]=m,t[14]=h):h=t[14];let g;t[15]===l?g=t[16]:(g=l({id:`O3oNi5`}),t[15]=l,t[16]=g);let _;t[17]===l?_=t[18]:(_=l({id:`O3oNi5`}),t[17]=l,t[18]=_);let v;t[19]===c?v=t[20]:(v=e=>c(e.target.value),t[19]=c,t[20]=v);let y;t[21]!==s||t[22]!==g||t[23]!==_||t[24]!==v?(y=(0,H.jsx)(x,{type:`email`,"aria-label":g,placeholder:_,value:s,onChange:v}),t[21]=s,t[22]=g,t[23]=_,t[24]=v,t[25]=y):y=t[25];let b;return t[26]!==u||t[27]!==y||t[28]!==h?(b=(0,H.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[u,d,h,y]}),t[26]=u,t[27]=y,t[28]=h,t[29]=b):b=t[29],b}function se(e){let t=(0,ee.c)(37),{host:n,token:a,onTokenChange:s,error:c,onSubmit:l,showGhOption:u,onGhSignIn:d}=e,{_:p}=i(),m=`https://${n}/settings/tokens/new?scopes=repo,read:user&description=OpenKnowledge`,h;t[0]!==n||t[1]!==d||t[2]!==u?(h=u?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(o,{type:`button`,onClick:d,children:(0,H.jsx)(r,{id:`_SDGzH`})}),(0,H.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-muted-foreground`,children:[(0,H.jsx)(`span`,{className:`h-px flex-1 bg-border`}),(0,H.jsx)(r,{id:`8L0EPw`}),(0,H.jsx)(`span`,{className:`h-px flex-1 bg-border`})]})]}):(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,H.jsx)(r,{id:`8k6INX`,values:{host:n},components:{0:(0,H.jsx)(`span`,{className:`font-medium text-foreground`})}})}),t[0]=n,t[1]=d,t[2]=u,t[3]=h):h=t[3];let g,_;t[4]===m?(g=t[5],_=t[6]):(g=e=>S(e,m),_=e=>S(e,m),t[4]=m,t[5]=g,t[6]=_);let v;t[7]===n?v=t[8]:(v=(0,H.jsx)(r,{id:`6hYjww`,values:{host:n}}),t[7]=n,t[8]=v);let y;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,H.jsx)(f,{className:`inline size-3.5`,"aria-hidden":!0}),t[9]=y):y=t[9];let b;t[10]!==m||t[11]!==g||t[12]!==_||t[13]!==v?(b=(0,H.jsxs)(`a`,{href:m,target:`_blank`,rel:`noopener noreferrer`,onClick:g,onAuxClick:_,className:`inline-flex w-fit items-center gap-0.5 text-sm text-foreground hover:text-primary hover:underline`,children:[v,y]}),t[10]=m,t[11]=g,t[12]=_,t[13]=v,t[14]=b):b=t[14];let C;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,H.jsx)(r,{id:`Xg-Ntj`})}),t[15]=C):C=t[15];let w;t[16]===p?w=t[17]:(w=p({id:`p2LEhJ`}),t[16]=p,t[17]=w);let T;t[18]===s?T=t[19]:(T=e=>s(e.target.value),t[18]=s,t[19]=T);let E;t[20]===l?E=t[21]:(E=e=>{e.key===`Enter`&&l()},t[20]=l,t[21]=E);let D;t[22]!==E||t[23]!==w||t[24]!==T||t[25]!==a?(D=(0,H.jsx)(x,{type:`password`,"aria-label":w,placeholder:`ghp_`,value:a,onChange:T,onKeyDown:E}),t[22]=E,t[23]=w,t[24]=T,t[25]=a,t[26]=D):D=t[26];let O;t[27]===c?O=t[28]:(O=c&&(0,H.jsx)(`p`,{className:`text-1sm text-destructive`,children:c}),t[27]=c,t[28]=O);let k;t[29]===u?k=t[30]:(k=!u&&(0,H.jsxs)(`div`,{className:`mt-1 rounded-md border border-border/60 bg-muted/40 p-3 text-sm text-muted-foreground`,children:[(0,H.jsx)(`p`,{children:(0,H.jsx)(r,{id:`qX-ABr`})}),(0,H.jsxs)(`ol`,{className:`mt-1.5 list-decimal space-y-0.5 pl-5`,children:[(0,H.jsx)(`li`,{children:(0,H.jsx)(r,{id:`jxtXZI`})}),(0,H.jsx)(`li`,{children:(0,H.jsx)(r,{id:`9Vh9Jf`})})]})]}),t[29]=u,t[30]=k);let A;return t[31]!==h||t[32]!==D||t[33]!==O||t[34]!==k||t[35]!==b?(A=(0,H.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[h,b,C,D,O,k]}),t[31]=h,t[32]=D,t[33]=O,t[34]=k,t[35]=b,t[36]=A):A=t[36],A}var ce=1e4;function le(e){let t=(0,ee.c)(94),{open:n,onOpenChange:a,onSuccess:c,identityPrompt:l,reauth:u,transport:d,queryTransport:f,host:p,ghAvailable:m}=e,{_:x}=i(),S;t[0]===d?S=t[1]:(S=d??ne(),t[0]=d,t[1]=S);let w=S,T;t[2]===f?T=t[3]:(T=f??N(),t[2]=f,t[3]=T);let E=T,[D,O]=(0,C.useState)(`auth`),[k,A]=(0,C.useState)(null),[j,M]=(0,C.useState)(``),[P,F]=(0,C.useState)(``),[I,L]=(0,C.useState)(``),[R,z]=(0,C.useState)(null),[B,V]=(0,C.useState)(!1),[te,re]=(0,C.useState)(void 0),[ie,le]=(0,C.useState)(void 0),U=p??te,de=!!U&&U!==`github.com`&&!!(m??ie)&&typeof w.ghLogin==`function`,W=!l&&p===void 0,fe,pe;t[4]!==p||t[5]!==l||t[6]!==W||t[7]!==n?(fe=()=>{n&&(A(null),M(``),F(``),L(``),z(null),V(!1),re(void 0),le(void 0),O(l||W?`checking`:p&&p!==`github.com`?`pat`:`auth`))},pe=[n,l,p,W],t[4]=p,t[5]=l,t[6]=W,t[7]=n,t[8]=fe,t[9]=pe):(fe=t[8],pe=t[9]),(0,C.useLayoutEffect)(fe,pe);let me;t[10]!==l||t[11]!==n||t[12]!==E?(me=()=>{if(!n||!l)return;let e=!1,t=t=>{e||(e=!0,O(t))},r=setTimeout(()=>t(`auth`),ce);return E.status().then(n=>{e||(n.authenticated?(A({login:n.login,name:n.name,email:n.email}),M(n.name??``),F(n.email??``),t(`identity`)):t(`auth`))}).catch(()=>{t(`auth`)}),()=>{e=!0,clearTimeout(r)}},t[10]=l,t[11]=n,t[12]=E,t[13]=me):me=t[13];let he;t[14]!==l||t[15]!==n?(he=[n,l],t[14]=l,t[15]=n,t[16]=he):he=t[16],(0,C.useEffect)(me,he);let ge;t[17]!==x||t[18]!==W||t[19]!==a||t[20]!==n||t[21]!==E?(ge=()=>{if(!n||!W)return;let e=!1,t=t=>{e||(e=!0,O(t))},r=setTimeout(()=>t(`auth`),ce),i=t=>{e||(e=!0,s.error(t),a(!1))};return E.status().then(n=>{if(e)return;if(!n.authenticated&&n.unsupportedOrigin!==void 0){i(n.error??x({id:`qimTXH`}));return}let r=!!n.host&&n.host!==`github.com`;re(n.host),le(n.ghAvailable),t(r?`pat`:`auth`)}).catch(()=>{t(`auth`)}),()=>{e=!0,clearTimeout(r)}},t[17]=x,t[18]=W,t[19]=a,t[20]=n,t[21]=E,t[22]=ge):ge=t[22];let _e;t[23]!==W||t[24]!==n?(_e=[n,W],t[23]=W,t[24]=n,t[25]=_e):_e=t[25],(0,C.useEffect)(ge,_e);let ve;t[26]!==x||t[27]!==l||t[28]!==a||t[29]!==c?(ve=function(e){if(A(e),l)M(e.name??``),F(e.email??``),O(`identity`);else{O(`done`),c?.(e),a(!1);let t=e.login;s.success(x(t?{id:`E_tNGD`,values:{login:t}}:{id:`cgl-gn`}))}},t[26]=x,t[27]=l,t[28]=a,t[29]=c,t[30]=ve):ve=t[30];let G=ve,ye;t[31]!==x||t[32]!==U||t[33]!==G||t[34]!==B||t[35]!==I||t[36]!==w?(ye=async function(){let e=I.trim();if(!e||!U||B)return;if(!w.pat){z(x({id:`iMYFJM`}));return}V(!0),z(null);let t=await w.pat(U,e);V(!1),t.ok?G({login:t.login??``}):z(t.error??x({id:`sNeKjP`}))},t[31]=x,t[32]=U,t[33]=G,t[34]=B,t[35]=I,t[36]=w,t[37]=ye):ye=t[37];let be=ye,xe;t[38]!==x||t[39]!==k||t[40]!==a||t[41]!==c?(xe=function(e,t){fetch(`/api/local-op/auth/set-identity`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:e,email:t})}).catch(ue);let n={...k??{login:``},name:e,email:t};O(`done`),c?.(n),a(!1);let r=n.login;s.success(x(r?{id:`E_tNGD`,values:{login:r}}:{id:`cgl-gn`}))},t[38]=x,t[39]=k,t[40]=a,t[41]=c,t[42]=xe):xe=t[42];let Se=xe,Ce;t[43]!==x||t[44]!==k||t[45]!==a||t[46]!==c?(Ce=function(){if(!k)return;O(`done`),c?.(k),a(!1);let e=k.login;s.success(x(e?{id:`E_tNGD`,values:{login:e}}:{id:`cgl-gn`}))},t[43]=x,t[44]=k,t[45]=a,t[46]=c,t[47]=Ce):Ce=t[47];let we=Ce,Te;t[48]===a?Te=t[49]:(Te=function(){a(!1)},t[48]=a,t[49]=Te);let K=Te,q;t[50]!==l||t[51]!==u||t[52]!==D?(q=(0,H.jsx)(y,{children:(0,H.jsx)(h,{children:u&&(D===`pat`||D===`gh-device`)?(0,H.jsx)(r,{id:`DUWgfT`}):u?(0,H.jsx)(r,{id:`X8kjQX`}):D===`pat`||D===`gh-device`?(0,H.jsx)(r,{id:`tzZ6ha`}):l&&D!==`auth`?(0,H.jsx)(r,{id:`29XZXN`}):(0,H.jsx)(r,{id:`3jod3l`})})}),t[50]=l,t[51]=u,t[52]=D,t[53]=q):q=t[53];let J;t[54]===D?J=t[55]:(J=D===`checking`&&(0,H.jsx)(_,{children:(0,H.jsx)(`div`,{className:`flex items-center justify-center py-6 text-sm text-muted-foreground`,children:(0,H.jsx)(r,{id:`gBbxn_`})})}),t[54]=D,t[55]=J);let Y;t[56]!==G||t[57]!==K||t[58]!==w||t[59]!==D?(Y=D===`auth`&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(_,{children:(0,H.jsx)(ae,{onSuccess:G,startFlow:()=>w.start()})}),(0,H.jsx)(v,{children:(0,H.jsx)(o,{variant:`outline`,onClick:K,children:(0,H.jsx)(r,{id:`dEgA5A`})})})]}),t[56]=G,t[57]=K,t[58]=w,t[59]=D,t[60]=Y):Y=t[60];let X;t[61]!==de||t[62]!==U||t[63]!==K||t[64]!==be||t[65]!==R||t[66]!==B||t[67]!==I||t[68]!==D?(X=D===`pat`&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(_,{children:(0,H.jsx)(se,{host:U??``,token:I,onTokenChange:L,error:R,onSubmit:be,showGhOption:de,onGhSignIn:()=>O(`gh-device`)})}),(0,H.jsxs)(v,{children:[(0,H.jsx)(o,{variant:`outline`,onClick:K,children:(0,H.jsx)(r,{id:`dEgA5A`})}),(0,H.jsx)(o,{onClick:be,disabled:!I.trim()||B,children:B?(0,H.jsx)(r,{id:`9zb2WA`}):(0,H.jsx)(r,{id:`iSLIjg`})})]})]}),t[61]=de,t[62]=U,t[63]=K,t[64]=be,t[65]=R,t[66]=B,t[67]=I,t[68]=D,t[69]=X):X=t[69];let Z;t[70]!==U||t[71]!==G||t[72]!==K||t[73]!==w||t[74]!==D?(Z=D===`gh-device`&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(_,{children:(0,H.jsx)(ae,{onSuccess:G,startFlow:()=>w.ghLogin?.(U??``)??w.start()})}),(0,H.jsxs)(v,{children:[(0,H.jsx)(o,{variant:`ghost`,onClick:()=>O(`pat`),children:(0,H.jsx)(r,{id:`hLKfZe`})}),(0,H.jsx)(o,{variant:`outline`,onClick:K,children:(0,H.jsx)(r,{id:`dEgA5A`})})]})]}),t[70]=U,t[71]=G,t[72]=K,t[73]=w,t[74]=D,t[75]=Z):Z=t[75];let Q;t[76]!==k||t[77]!==Se||t[78]!==we||t[79]!==P||t[80]!==j||t[81]!==D?(Q=D===`identity`&&k&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(_,{children:(0,H.jsx)(oe,{login:k.login,name:j,onNameChange:M,email:P,onEmailChange:F})}),(0,H.jsxs)(v,{children:[(0,H.jsx)(o,{variant:`ghost`,onClick:we,children:(0,H.jsx)(r,{id:`6Uau97`})}),(0,H.jsx)(o,{onClick:()=>Se(j.trim(),P.trim()),disabled:!j.trim()||!P.trim(),children:(0,H.jsx)(r,{id:`tfDRzk`})})]})]}),t[76]=k,t[77]=Se,t[78]=we,t[79]=P,t[80]=j,t[81]=D,t[82]=Q):Q=t[82];let $;t[83]!==q||t[84]!==J||t[85]!==Y||t[86]!==X||t[87]!==Z||t[88]!==Q?($=(0,H.jsxs)(g,{className:`sm:max-w-md`,children:[q,J,Y,X,Z,Q]}),t[83]=q,t[84]=J,t[85]=Y,t[86]=X,t[87]=Z,t[88]=Q,t[89]=$):$=t[89];let Ee;return t[90]!==a||t[91]!==n||t[92]!==$?(Ee=(0,H.jsx)(b,{open:n,onOpenChange:a,children:$}),t[90]=a,t[91]=n,t[92]=$,t[93]=Ee):Ee=t[93],Ee}function ue(){}export{N as a,I as i,ne as n,P as o,re as r,le as t};
@@ -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{n as o,r as s,t as c}from"./collapsible-BKbszYZV.js";import{t as l}from"./button-DzgjsZzC.js";import{t as u}from"./createLucideIcon-DdBzwsHe.js";import{t as d}from"./chevron-down-CEv6N8LG.js";import{t as f}from"./folder-open-COGOeTzI.js";import{t as p}from"./spinner-Bx8xD6f8.js";import{i as m,n as h,o as g,r as _,t as v}from"./bug-report-send-manager-Btm-R8Ei.js";import{t as y}from"./trash-2-CchZ0T47.js";import{t as b}from"./badge-DmdA1C7r.js";import{n as x}from"./platform-labels-CtgIRyUl.js";var S=u(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),C=a(),w=e(n(),1),T=t();function E(){let e=new Map;for(let t of v.getSnapshot())t.status!==`sending`&&e.set(t.operationId,t.requestSeq);return e}function D(){let e=(0,C.c)(16),{_:t}=i(),[n,r]=(0,w.useState)(`loading`),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=[],e[0]=a):a=e[0];let[o,s]=(0,w.useState)(a),c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(c={},e[1]=c):c=e[1];let[l,u]=(0,w.useState)(c),d=(0,w.useRef)(0),f;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=async function(){d.current+=1;let e=d.current,t=window.okDesktop?.bugReport;if(!t){r(`error`);return}try{let n=await t.list();if(d.current!==e)return;n.ok?(s(n.reports),r(`ready`)):r(`error`)}catch{d.current===e&&r(`error`)}},e[2]=f):f=e[2];let p=f,h;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=function(e){u(t=>{if(!e.some(e=>e in t))return t;let n={...t};for(let t of e)delete n[t];return n})},e[3]=h):h=e[3];let g=h,_,y;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>{p();let e=E(),t=v.subscribe(()=>{let t=E(),n=[...t].filter(t=>{let[n,r]=t;return e.get(n)!==r}).map(k);e=t,n.length!==0&&(g(n),p())});return()=>{t(),d.current+=1}},y=[],e[4]=_,e[5]=y):(_=e[4],y=e[5]),(0,w.useEffect)(_,y);let b;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(b=function(e){e.retryable&&(v.startBugReportSend({kind:`history-row`,row:e}),u(t=>({...t,[e.id]:`retrying`})))},e[6]=b):b=e[6];let x=b,S;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(S=async function(e){let t=window.okDesktop?.bugReport;t&&(u(t=>({...t,[e.id]:`deleting`})),await t.delete(e.id).catch(O),await p(),g([e.id]))},e[7]=S):S=e[7];let T=S,D;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(D=function(e){window.okDesktop?.shell.showItemInFolder(e.zipPath)},e[8]=D):D=e[8];let A=D,j;e[9]===t?j=e[10]:(j=function(e){e.reference!==void 0&&window.okDesktop?.shell.openExternal(m(t({id:`qEEfPk`,values:{0:e.reference}})))},e[9]=t,e[10]=j);let M=j,N;return e[11]!==M||e[12]!==l||e[13]!==o||e[14]!==n?(N={status:n,reports:o,pending:l,retry:x,remove:T,reveal:A,contactSupport:M},e[11]=M,e[12]=l,e[13]=o,e[14]=n,e[15]=N):N=e[15],N}function O(){}function k(e){let[t]=e;return t}function A(e){let t=(0,C.c)(6),{state:n}=e;switch(n){case`sent`:{let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,T.jsx)(b,{variant:`primary`,children:(0,T.jsx)(r,{id:`h69WC6`})}),t[0]=e):e=t[0],e}case`upload-failed`:{let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,T.jsx)(b,{variant:`destructive`,children:(0,T.jsx)(r,{id:`7Bj3x9`})}),t[1]=e):e=t[1],e}case`uploading`:{let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,T.jsx)(b,{variant:`warning`,children:(0,T.jsx)(r,{id:`9bG48P`})}),t[2]=e):e=t[2],e}case`email-drafted`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,T.jsx)(b,{variant:`secondary`,children:(0,T.jsx)(r,{id:`cPAWbl`})}),t[3]=e):e=t[3],e}case`generated`:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,T.jsx)(b,{variant:`gray`,children:(0,T.jsx)(r,{id:`2C-6zf`})}),t[4]=e):e=t[4],e}default:{let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,T.jsx)(b,{variant:`outline`,children:(0,T.jsx)(r,{id:`Ef7StM`})}),t[5]=e):e=t[5],e}}}function j(e){let t=(0,C.c)(67),{row:n,pending:a,onRetry:o,onContactSupport:s,onReveal:c,onDelete:u}=e,{_:d,i18n:m}=i(),v=a!==void 0,w;t[0]!==d||t[1]!==n.note||t[2]!==n.projectSlug?(w=h(n.note)??(n.projectSlug===null?d({id:`PZKdTd`}):d({id:`3Uuuft`,values:{0:n.projectSlug}})),t[0]=d,t[1]=n.note,t[2]=n.projectSlug,t[3]=w):w=t[3];let E=w,D;t[4]!==d||t[5]!==m||t[6]!==n.createdAt?(D=n.createdAt===``?d({id:`wF2wqQ`}):new Intl.DateTimeFormat(m.locale||void 0,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(n.createdAt)),t[4]=d,t[5]=m,t[6]=n.createdAt,t[7]=D):D=t[7];let O=D,k;t[8]===E?k=t[9]:(k=(0,T.jsx)(`p`,{dir:`auto`,className:`min-w-0 flex-1 truncate text-1sm`,title:E,children:E}),t[8]=E,t[9]=k);let j;t[10]===n.state?j=t[11]:(j=(0,T.jsx)(A,{state:n.state}),t[10]=n.state,t[11]=j);let M;t[12]!==k||t[13]!==j?(M=(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[k,j]}),t[12]=k,t[13]=j,t[14]=M):M=t[14];let N;t[15]===n.bundleLevel?N=t[16]:(N=n.bundleLevel===`unknown`?null:(0,T.jsx)(b,{variant:`gray`,children:n.bundleLevel}),t[15]=n.bundleLevel,t[16]=N);let P;t[17]===O?P=t[18]:(P=(0,T.jsx)(`span`,{className:`whitespace-nowrap`,children:O}),t[17]=O,t[18]=P);let F;t[19]===n.zipBytes?F=t[20]:(F=n.zipBytes>0?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,T.jsx)(`span`,{className:`whitespace-nowrap`,children:_(n.zipBytes)})]}):null,t[19]=n.zipBytes,t[20]=F);let I;t[21]!==n.lastError||t[22]!==n.reference||t[23]!==n.state?(I=n.state===`sent`&&n.reference!==void 0?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,T.jsx)(`span`,{children:(0,T.jsx)(r,{id:`SInSnF`,values:{0:n.reference},components:{0:(0,T.jsx)(`span`,{className:`font-mono text-foreground`})}})})]}):n.state===`upload-failed`&&n.lastError!==void 0?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,T.jsx)(`span`,{className:`text-destructive`,children:n.lastError.reason})]}):null,t[21]=n.lastError,t[22]=n.reference,t[23]=n.state,t[24]=I):I=t[24];let L;t[25]!==N||t[26]!==P||t[27]!==F||t[28]!==I?(L=(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 text-xs text-muted-foreground`,children:[N,P,F,I]}),t[25]=N,t[26]=P,t[27]=F,t[28]=I,t[29]=L):L=t[29];let R;t[30]!==L||t[31]!==M?(R=(0,T.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[M,L]}),t[30]=L,t[31]=M,t[32]=R):R=t[32];let z;t[33]!==v||t[34]!==o||t[35]!==a||t[36]!==n?(z=n.retryable?(0,T.jsxs)(l,{variant:`outline`,size:`xs`,disabled:v,onClick:()=>o(n),children:[a===`retrying`?(0,T.jsx)(p,{"aria-hidden":`true`}):(0,T.jsx)(S,{"aria-hidden":`true`}),(0,T.jsx)(r,{id:`6gRgw8`})]}):null,t[33]=v,t[34]=o,t[35]=a,t[36]=n,t[37]=z):z=t[37];let B;t[38]!==d||t[39]!==v||t[40]!==s||t[41]!==n?(B=n.state===`sent`&&n.reference!==void 0?(0,T.jsx)(l,{variant:`ghost`,size:`icon-xs`,disabled:v,"aria-label":d({id:`32TTpa`}),onClick:()=>s(n),children:(0,T.jsx)(g,{"aria-hidden":`true`})}):null,t[38]=d,t[39]=v,t[40]=s,t[41]=n,t[42]=B):B=t[42];let V;t[43]!==v||t[44]!==c||t[45]!==n?(V=n.zipExists?(0,T.jsx)(l,{variant:`ghost`,size:`icon-xs`,disabled:v,"aria-label":x(typeof window<`u`?window.okDesktop?.platform:void 0),onClick:()=>c(n),children:(0,T.jsx)(f,{"aria-hidden":`true`})}):null,t[43]=v,t[44]=c,t[45]=n,t[46]=V):V=t[46];let H;t[47]===d?H=t[48]:(H=d({id:`rUWrSE`}),t[47]=d,t[48]=H);let U;t[49]!==u||t[50]!==n?(U=()=>u(n),t[49]=u,t[50]=n,t[51]=U):U=t[51];let W;t[52]===a?W=t[53]:(W=a===`deleting`?(0,T.jsx)(p,{"aria-hidden":`true`}):(0,T.jsx)(y,{"aria-hidden":`true`}),t[52]=a,t[53]=W);let G;t[54]!==v||t[55]!==H||t[56]!==U||t[57]!==W?(G=(0,T.jsx)(l,{variant:`ghost`,size:`icon-xs`,disabled:v,"aria-label":H,onClick:U,children:W}),t[54]=v,t[55]=H,t[56]=U,t[57]=W,t[58]=G):G=t[58];let K;t[59]!==z||t[60]!==B||t[61]!==V||t[62]!==G?(K=(0,T.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[z,B,V,G]}),t[59]=z,t[60]=B,t[61]=V,t[62]=G,t[63]=K):K=t[63];let q;return t[64]!==R||t[65]!==K?(q=(0,T.jsxs)(`li`,{className:`flex items-start gap-2.5 rounded-md border px-3 py-2.5`,children:[R,K]}),t[64]=R,t[65]=K,t[66]=q):q=t[66],q}function M(e){let t=(0,C.c)(15),{reports:n,pending:r,retry:i,remove:a,reveal:o,contactSupport:s}=e,c;if(t[0]!==s||t[1]!==r||t[2]!==a||t[3]!==n||t[4]!==i||t[5]!==o){let e;t[7]!==s||t[8]!==r||t[9]!==a||t[10]!==i||t[11]!==o?(e=e=>(0,T.jsx)(j,{row:e,pending:r[e.id],onRetry:i,onContactSupport:s,onReveal:o,onDelete:a},e.id),t[7]=s,t[8]=r,t[9]=a,t[10]=i,t[11]=o,t[12]=e):e=t[12],c=n.map(e),t[0]=s,t[1]=r,t[2]=a,t[3]=n,t[4]=i,t[5]=o,t[6]=c}else c=t[6];let l;return t[13]===c?l=t[14]:(l=(0,T.jsx)(`ul`,{className:`flex flex-col gap-2`,children:c}),t[13]=c,t[14]=l),l}function N(e){let t=(0,C.c)(9),{onReportABug:n}=e,i=D();if(i.status===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,T.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2.5 py-6 text-sm text-muted-foreground`,children:[(0,T.jsx)(p,{className:`size-4`,"aria-hidden":`true`}),(0,T.jsx)(r,{id:`VmJT51`})]}),t[0]=e):e=t[0],e}if(i.status===`error`){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,T.jsx)(`p`,{className:`py-6 text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`FgQ7XZ`})}),t[1]=e):e=t[1],e}if(i.reports.length===0){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`wcfO9r`})}),t[2]=e):e=t[2];let i;t[3]===n?i=t[4]:(i=n?(0,T.jsx)(l,{onClick:n,children:(0,T.jsx)(r,{id:`cd5EXh`})}):null,t[3]=n,t[4]=i);let a;return t[5]===i?a=t[6]:(a=(0,T.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-6 text-center`,children:[e,i]}),t[5]=i,t[6]=a),a}let a;return t[7]===i?a=t[8]:(a=(0,T.jsx)(M,{...i}),t[7]=i,t[8]=a),a}function P(){let e=(0,C.c)(14),[t,n]=(0,w.useState)(!1),i=D();if(i.status!==`ready`||i.reports.length===0)return null;let a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,T.jsx)(r,{id:`c2ktXL`}),e[0]=a):a=e[0];let u;e[1]===i.reports.length?u=e[2]:(u=(0,T.jsxs)(`span`,{className:`text-sm font-medium`,children:[a,` `,(0,T.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`(`,i.reports.length,`)`]})]}),e[1]=i.reports.length,e[2]=u);let f=`transition-transform motion-reduce:transition-none ${t?`rotate-180`:``}`,p;e[3]===f?p=e[4]:(p=(0,T.jsx)(d,{className:f,"aria-hidden":`true`}),e[3]=f,e[4]=p);let m;e[5]!==u||e[6]!==p?(m=(0,T.jsx)(s,{asChild:!0,children:(0,T.jsxs)(l,{variant:`ghost`,size:`sm`,className:`-mx-2 -my-0.5 h-auto w-[calc(100%+1rem)] justify-between px-2 py-1.5 data-[state=open]:bg-transparent data-[state=open]:hover:bg-muted`,children:[u,p]})}),e[5]=u,e[6]=p,e[7]=m):m=e[7];let h;e[8]===i?h=e[9]:(h=(0,T.jsx)(o,{className:`pt-2`,children:(0,T.jsx)(M,{...i})}),e[8]=i,e[9]=h);let g;return e[10]!==t||e[11]!==m||e[12]!==h?(g=(0,T.jsxs)(c,{open:t,onOpenChange:n,children:[m,h]}),e[10]=t,e[11]=m,e[12]=h,e[13]=g):g=e[13],g}export{P as n,N as t};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{n as o,r as s,t as c}from"./collapsible-BKbszYZV.js";import{t as l}from"./button-DzgjsZzC.js";import{t as u}from"./createLucideIcon-DdBzwsHe.js";import{t as d}from"./chevron-down-CEv6N8LG.js";import{t as f}from"./folder-open-COGOeTzI.js";import{t as p}from"./spinner-Bx8xD6f8.js";import{i as m,n as h,o as g,r as _,t as v}from"./bug-report-send-manager-Btm-R8Ei.js";import{t as y}from"./trash-2-CchZ0T47.js";import{t as b}from"./badge-DmdA1C7r.js";import{r as x}from"./platform-labels-BPRIEv67.js";var S=u(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),C=a(),w=e(n(),1),T=t();function E(){let e=new Map;for(let t of v.getSnapshot())t.status!==`sending`&&e.set(t.operationId,t.requestSeq);return e}function D(){let e=(0,C.c)(16),{_:t}=i(),[n,r]=(0,w.useState)(`loading`),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=[],e[0]=a):a=e[0];let[o,s]=(0,w.useState)(a),c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(c={},e[1]=c):c=e[1];let[l,u]=(0,w.useState)(c),d=(0,w.useRef)(0),f;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=async function(){d.current+=1;let e=d.current,t=window.okDesktop?.bugReport;if(!t){r(`error`);return}try{let n=await t.list();if(d.current!==e)return;n.ok?(s(n.reports),r(`ready`)):r(`error`)}catch{d.current===e&&r(`error`)}},e[2]=f):f=e[2];let p=f,h;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=function(e){u(t=>{if(!e.some(e=>e in t))return t;let n={...t};for(let t of e)delete n[t];return n})},e[3]=h):h=e[3];let g=h,_,y;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>{p();let e=E(),t=v.subscribe(()=>{let t=E(),n=[...t].filter(t=>{let[n,r]=t;return e.get(n)!==r}).map(k);e=t,n.length!==0&&(g(n),p())});return()=>{t(),d.current+=1}},y=[],e[4]=_,e[5]=y):(_=e[4],y=e[5]),(0,w.useEffect)(_,y);let b;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(b=function(e){e.retryable&&(v.startBugReportSend({kind:`history-row`,row:e}),u(t=>({...t,[e.id]:`retrying`})))},e[6]=b):b=e[6];let x=b,S;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(S=async function(e){let t=window.okDesktop?.bugReport;t&&(u(t=>({...t,[e.id]:`deleting`})),await t.delete(e.id).catch(O),await p(),g([e.id]))},e[7]=S):S=e[7];let T=S,D;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(D=function(e){window.okDesktop?.shell.showItemInFolder(e.zipPath)},e[8]=D):D=e[8];let A=D,j;e[9]===t?j=e[10]:(j=function(e){e.reference!==void 0&&window.okDesktop?.shell.openExternal(m(t({id:`qEEfPk`,values:{0:e.reference}})))},e[9]=t,e[10]=j);let M=j,N;return e[11]!==M||e[12]!==l||e[13]!==o||e[14]!==n?(N={status:n,reports:o,pending:l,retry:x,remove:T,reveal:A,contactSupport:M},e[11]=M,e[12]=l,e[13]=o,e[14]=n,e[15]=N):N=e[15],N}function O(){}function k(e){let[t]=e;return t}function A(e){let t=(0,C.c)(6),{state:n}=e;switch(n){case`sent`:{let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,T.jsx)(b,{variant:`primary`,children:(0,T.jsx)(r,{id:`h69WC6`})}),t[0]=e):e=t[0],e}case`upload-failed`:{let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,T.jsx)(b,{variant:`destructive`,children:(0,T.jsx)(r,{id:`7Bj3x9`})}),t[1]=e):e=t[1],e}case`uploading`:{let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,T.jsx)(b,{variant:`warning`,children:(0,T.jsx)(r,{id:`9bG48P`})}),t[2]=e):e=t[2],e}case`email-drafted`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,T.jsx)(b,{variant:`secondary`,children:(0,T.jsx)(r,{id:`cPAWbl`})}),t[3]=e):e=t[3],e}case`generated`:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,T.jsx)(b,{variant:`gray`,children:(0,T.jsx)(r,{id:`2C-6zf`})}),t[4]=e):e=t[4],e}default:{let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,T.jsx)(b,{variant:`outline`,children:(0,T.jsx)(r,{id:`Ef7StM`})}),t[5]=e):e=t[5],e}}}function j(e){let t=(0,C.c)(67),{row:n,pending:a,onRetry:o,onContactSupport:s,onReveal:c,onDelete:u}=e,{_:d,i18n:m}=i(),v=a!==void 0,w;t[0]!==d||t[1]!==n.note||t[2]!==n.projectSlug?(w=h(n.note)??(n.projectSlug===null?d({id:`PZKdTd`}):d({id:`3Uuuft`,values:{0:n.projectSlug}})),t[0]=d,t[1]=n.note,t[2]=n.projectSlug,t[3]=w):w=t[3];let E=w,D;t[4]!==d||t[5]!==m||t[6]!==n.createdAt?(D=n.createdAt===``?d({id:`wF2wqQ`}):new Intl.DateTimeFormat(m.locale||void 0,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(n.createdAt)),t[4]=d,t[5]=m,t[6]=n.createdAt,t[7]=D):D=t[7];let O=D,k;t[8]===E?k=t[9]:(k=(0,T.jsx)(`p`,{dir:`auto`,className:`min-w-0 flex-1 truncate text-1sm`,title:E,children:E}),t[8]=E,t[9]=k);let j;t[10]===n.state?j=t[11]:(j=(0,T.jsx)(A,{state:n.state}),t[10]=n.state,t[11]=j);let M;t[12]!==k||t[13]!==j?(M=(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[k,j]}),t[12]=k,t[13]=j,t[14]=M):M=t[14];let N;t[15]===n.bundleLevel?N=t[16]:(N=n.bundleLevel===`unknown`?null:(0,T.jsx)(b,{variant:`gray`,children:n.bundleLevel}),t[15]=n.bundleLevel,t[16]=N);let P;t[17]===O?P=t[18]:(P=(0,T.jsx)(`span`,{className:`whitespace-nowrap`,children:O}),t[17]=O,t[18]=P);let F;t[19]===n.zipBytes?F=t[20]:(F=n.zipBytes>0?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,T.jsx)(`span`,{className:`whitespace-nowrap`,children:_(n.zipBytes)})]}):null,t[19]=n.zipBytes,t[20]=F);let I;t[21]!==n.lastError||t[22]!==n.reference||t[23]!==n.state?(I=n.state===`sent`&&n.reference!==void 0?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,T.jsx)(`span`,{children:(0,T.jsx)(r,{id:`SInSnF`,values:{0:n.reference},components:{0:(0,T.jsx)(`span`,{className:`font-mono text-foreground`})}})})]}):n.state===`upload-failed`&&n.lastError!==void 0?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,T.jsx)(`span`,{className:`text-destructive`,children:n.lastError.reason})]}):null,t[21]=n.lastError,t[22]=n.reference,t[23]=n.state,t[24]=I):I=t[24];let L;t[25]!==N||t[26]!==P||t[27]!==F||t[28]!==I?(L=(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 text-xs text-muted-foreground`,children:[N,P,F,I]}),t[25]=N,t[26]=P,t[27]=F,t[28]=I,t[29]=L):L=t[29];let R;t[30]!==L||t[31]!==M?(R=(0,T.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[M,L]}),t[30]=L,t[31]=M,t[32]=R):R=t[32];let z;t[33]!==v||t[34]!==o||t[35]!==a||t[36]!==n?(z=n.retryable?(0,T.jsxs)(l,{variant:`outline`,size:`xs`,disabled:v,onClick:()=>o(n),children:[a===`retrying`?(0,T.jsx)(p,{"aria-hidden":`true`}):(0,T.jsx)(S,{"aria-hidden":`true`}),(0,T.jsx)(r,{id:`6gRgw8`})]}):null,t[33]=v,t[34]=o,t[35]=a,t[36]=n,t[37]=z):z=t[37];let B;t[38]!==d||t[39]!==v||t[40]!==s||t[41]!==n?(B=n.state===`sent`&&n.reference!==void 0?(0,T.jsx)(l,{variant:`ghost`,size:`icon-xs`,disabled:v,"aria-label":d({id:`32TTpa`}),onClick:()=>s(n),children:(0,T.jsx)(g,{"aria-hidden":`true`})}):null,t[38]=d,t[39]=v,t[40]=s,t[41]=n,t[42]=B):B=t[42];let V;t[43]!==v||t[44]!==c||t[45]!==n?(V=n.zipExists?(0,T.jsx)(l,{variant:`ghost`,size:`icon-xs`,disabled:v,"aria-label":x(typeof window<`u`?window.okDesktop?.platform:void 0),onClick:()=>c(n),children:(0,T.jsx)(f,{"aria-hidden":`true`})}):null,t[43]=v,t[44]=c,t[45]=n,t[46]=V):V=t[46];let H;t[47]===d?H=t[48]:(H=d({id:`rUWrSE`}),t[47]=d,t[48]=H);let U;t[49]!==u||t[50]!==n?(U=()=>u(n),t[49]=u,t[50]=n,t[51]=U):U=t[51];let W;t[52]===a?W=t[53]:(W=a===`deleting`?(0,T.jsx)(p,{"aria-hidden":`true`}):(0,T.jsx)(y,{"aria-hidden":`true`}),t[52]=a,t[53]=W);let G;t[54]!==v||t[55]!==H||t[56]!==U||t[57]!==W?(G=(0,T.jsx)(l,{variant:`ghost`,size:`icon-xs`,disabled:v,"aria-label":H,onClick:U,children:W}),t[54]=v,t[55]=H,t[56]=U,t[57]=W,t[58]=G):G=t[58];let K;t[59]!==z||t[60]!==B||t[61]!==V||t[62]!==G?(K=(0,T.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[z,B,V,G]}),t[59]=z,t[60]=B,t[61]=V,t[62]=G,t[63]=K):K=t[63];let q;return t[64]!==R||t[65]!==K?(q=(0,T.jsxs)(`li`,{className:`flex items-start gap-2.5 rounded-md border px-3 py-2.5`,children:[R,K]}),t[64]=R,t[65]=K,t[66]=q):q=t[66],q}function M(e){let t=(0,C.c)(15),{reports:n,pending:r,retry:i,remove:a,reveal:o,contactSupport:s}=e,c;if(t[0]!==s||t[1]!==r||t[2]!==a||t[3]!==n||t[4]!==i||t[5]!==o){let e;t[7]!==s||t[8]!==r||t[9]!==a||t[10]!==i||t[11]!==o?(e=e=>(0,T.jsx)(j,{row:e,pending:r[e.id],onRetry:i,onContactSupport:s,onReveal:o,onDelete:a},e.id),t[7]=s,t[8]=r,t[9]=a,t[10]=i,t[11]=o,t[12]=e):e=t[12],c=n.map(e),t[0]=s,t[1]=r,t[2]=a,t[3]=n,t[4]=i,t[5]=o,t[6]=c}else c=t[6];let l;return t[13]===c?l=t[14]:(l=(0,T.jsx)(`ul`,{className:`flex flex-col gap-2`,children:c}),t[13]=c,t[14]=l),l}function N(e){let t=(0,C.c)(9),{onReportABug:n}=e,i=D();if(i.status===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,T.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2.5 py-6 text-sm text-muted-foreground`,children:[(0,T.jsx)(p,{className:`size-4`,"aria-hidden":`true`}),(0,T.jsx)(r,{id:`VmJT51`})]}),t[0]=e):e=t[0],e}if(i.status===`error`){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,T.jsx)(`p`,{className:`py-6 text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`FgQ7XZ`})}),t[1]=e):e=t[1],e}if(i.reports.length===0){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,T.jsx)(r,{id:`wcfO9r`})}),t[2]=e):e=t[2];let i;t[3]===n?i=t[4]:(i=n?(0,T.jsx)(l,{onClick:n,children:(0,T.jsx)(r,{id:`cd5EXh`})}):null,t[3]=n,t[4]=i);let a;return t[5]===i?a=t[6]:(a=(0,T.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-6 text-center`,children:[e,i]}),t[5]=i,t[6]=a),a}let a;return t[7]===i?a=t[8]:(a=(0,T.jsx)(M,{...i}),t[7]=i,t[8]=a),a}function P(){let e=(0,C.c)(14),[t,n]=(0,w.useState)(!1),i=D();if(i.status!==`ready`||i.reports.length===0)return null;let a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,T.jsx)(r,{id:`c2ktXL`}),e[0]=a):a=e[0];let u;e[1]===i.reports.length?u=e[2]:(u=(0,T.jsxs)(`span`,{className:`text-sm font-medium`,children:[a,` `,(0,T.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`(`,i.reports.length,`)`]})]}),e[1]=i.reports.length,e[2]=u);let f=`transition-transform motion-reduce:transition-none ${t?`rotate-180`:``}`,p;e[3]===f?p=e[4]:(p=(0,T.jsx)(d,{className:f,"aria-hidden":`true`}),e[3]=f,e[4]=p);let m;e[5]!==u||e[6]!==p?(m=(0,T.jsx)(s,{asChild:!0,children:(0,T.jsxs)(l,{variant:`ghost`,size:`sm`,className:`-mx-2 -my-0.5 h-auto w-[calc(100%+1rem)] justify-between px-2 py-1.5 data-[state=open]:bg-transparent data-[state=open]:hover:bg-muted`,children:[u,p]})}),e[5]=u,e[6]=p,e[7]=m):m=e[7];let h;e[8]===i?h=e[9]:(h=(0,T.jsx)(o,{className:`pt-2`,children:(0,T.jsx)(M,{...i})}),e[8]=i,e[9]=h);let g;return e[10]!==t||e[11]!==m||e[12]!==h?(g=(0,T.jsxs)(c,{open:t,onOpenChange:n,children:[m,h]}),e[10]=t,e[11]=m,e[12]=h,e[13]=g):g=e[13],g}export{P as n,N as t};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-BUgB2tll.js";import{n as t}from"./dist-Nvb76hAm.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{t as r}from"./BugReportHistory-BPO915fE.js";import{a as i,c as a,i as o,n as s,s as c,t as l}from"./dialog-BJEjKJjL.js";var u=n(),d=e();function f(e){let n=(0,u.c)(11),{open:f,onOpenChange:p,onReportABug:m}=e,h;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,d.jsx)(a,{children:(0,d.jsx)(t,{id:`QHCx0c`})}),n[0]=h):h=n[0];let g;n[1]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,d.jsxs)(c,{children:[h,(0,d.jsx)(i,{children:(0,d.jsx)(t,{id:`5ss1kT`})})]}),n[1]=g):g=n[1];let _;n[2]!==m||n[3]!==f?(_=f?(0,d.jsx)(r,{onReportABug:m}):null,n[2]=m,n[3]=f,n[4]=_):_=n[4];let v;n[5]===_?v=n[6]:(v=(0,d.jsxs)(o,{className:`sm:max-w-md`,children:[g,(0,d.jsx)(s,{className:`max-h-[60vh] overflow-y-auto`,children:_})]}),n[5]=_,n[6]=v);let y;return n[7]!==p||n[8]!==f||n[9]!==v?(y=(0,d.jsx)(l,{open:f,onOpenChange:p,children:v}),n[7]=p,n[8]=f,n[9]=v,n[10]=y):y=n[10],y}export{f as default};
1
+ import{t as e}from"./jsx-runtime-BUgB2tll.js";import{n as t}from"./dist-Nvb76hAm.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{t as r}from"./BugReportHistory-B0y8PoGi.js";import{a as i,c as a,i as o,n as s,s as c,t as l}from"./dialog-BJEjKJjL.js";var u=n(),d=e();function f(e){let n=(0,u.c)(11),{open:f,onOpenChange:p,onReportABug:m}=e,h;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,d.jsx)(a,{children:(0,d.jsx)(t,{id:`QHCx0c`})}),n[0]=h):h=n[0];let g;n[1]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,d.jsxs)(c,{children:[h,(0,d.jsx)(i,{children:(0,d.jsx)(t,{id:`5ss1kT`})})]}),n[1]=g):g=n[1];let _;n[2]!==m||n[3]!==f?(_=f?(0,d.jsx)(r,{onReportABug:m}):null,n[2]=m,n[3]=f,n[4]=_):_=n[4];let v;n[5]===_?v=n[6]:(v=(0,d.jsxs)(o,{className:`sm:max-w-md`,children:[g,(0,d.jsx)(s,{className:`max-h-[60vh] overflow-y-auto`,children:_})]}),n[5]=_,n[6]=v);let y;return n[7]!==p||n[8]!==f||n[9]!==v?(y=(0,d.jsx)(l,{open:f,onOpenChange:p,children:v}),n[7]=p,n[8]=f,n[9]=v,n[10]=y):y=n[10],y}export{f as default};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./dist-D5mDCusD.js","./chunk-CYidjpOJ.js","./dist-D2SphF3p.js","./w3c-keyname-C7Rznu6R.js","./dist-BxTTaZ5o.js","./dist-BkE9d74i.js","./dist-DLvJCXqg.js","./dist-DKYEqMZn.js","./dist-D0SVNMDP.js","./stex-CUzil_LB.js"])))=>i.map(i=>d[i]);
2
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{r as i}from"./dist-Nvb76hAm.js";import{n as a}from"./dist-PQ5KMVDh.js";import{t as o}from"./react-dom-DPxgxlDT.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{n as c,t as l}from"./with-selector-zVo3Fruj.js";import{a as u,d,i as f,l as p,r as m,u as h}from"./floating-ui.dom-DkPPH5vF.js";import{a as g,d as _,g as v,i as y,l as b,n as x,o as S,r as C,t as w,u as T}from"./constants-upload-CVKO8P4d.js";import{$ as ee,A as E,B as te,C as ne,F as re,G as ie,K as D,L as O,N as ae,P as oe,Q as se,R as ce,S as le,T as ue,U as de,V as fe,W as pe,X as me,Y as he,_ as ge,a as _e,at as k,b as ve,bt as A,c as ye,ct as j,d as be,et as xe,f as Se,g as Ce,gt as we,h as Te,ht as Ee,it as M,k as N,l as De,mt as Oe,n as P,nt as ke,o as F,ot as Ae,p as je,q as Me,r as Ne,rt as Pe,s as Fe,st as Ie,t as Le,tt as Re,u as ze,ut as Be,v as Ve,vt as I,w as He,x as Ue,y as We,z as L}from"./dist-Dc8tD1th.js";import{t as Ge}from"./dist-C_FzPxEX2.js";import{C as Ke,a as qe,g as Je,w as Ye}from"./schemas-api-BM3O7zA1.js";import{t as Xe}from"./util-doc-name-D-_o-n0R.js";import{n as Ze}from"./_envelope-Dwl6i2K9-DPqJ_Q4W.js";import{t as Qe}from"./note-window-mode-CI3Yju9B.js";import{i as $e}from"./use-apply-config-theme-CYFG76sS.js";import{t as et}from"./createLucideIcon-DdBzwsHe.js";import{t as tt}from"./folder-open-COGOeTzI.js";import{t as nt}from"./trash-2-CchZ0T47.js";import{n as rt,r as it}from"./structural-freshness-CIbkMFA3-CWi_lyiW.js";import{c as at,d as ot,l as st}from"./doc-hash-BJkweiX9.js";import{_ as ct,b as lt,d as ut,f as dt,g as ft,h as pt,j as mt,k as ht,o as gt,p as _t,v as vt,w as yt,x as bt}from"./navigation-targets-DTSxcGor.js";import{t as xt}from"./doc-paths-cEiFVCxr.js";import{$ as St,A as Ct,C as wt,G as Tt,H as Et,I as Dt,J as Ot,K as kt,L as At,M as jt,O as Mt,P as Nt,Q as Pt,R as Ft,S as It,U as Lt,W as Rt,X as zt,Z as Bt,_ as Vt,a as Ht,b as Ut,c as Wt,d as Gt,et as Kt,f as qt,h as Jt,it as Yt,j as Xt,k as Zt,l as Qt,m as $t,nt as en,o as tn,p as nn,rt as rn,s as an,u as on,v as sn,w as cn,x as ln,y as un}from"./config-provider-DBgrt1kx.js";import{At as dn,Ct as fn,E as pn,F as mn,G as hn,I as R,J as gn,K as _n,M as vn,Mt as yn,Nt as bn,P as z,Tt as xn,X as Sn,a as Cn,c as wn,f as Tn,l as En,lt as Dn,o as On,r as kn,t as An,ut as jn}from"./dist-D2SphF3p.js";import{A as Mn,C as Nn,E as Pn,H as Fn,I as In,L as Ln,M as Rn,N as zn,O as Bn,P as Vn,R as B,S as Hn,T as Un,_ as Wn,a as Gn,b as Kn,c as qn,h as Jn,k as Yn,m as Xn,o as Zn,t as Qn,x as $n,y as er,z as tr}from"./lib-QQS1Brzc.js";import{t as nr}from"./ccount-BoHE53_k.js";import{n as rr,r as ir}from"./lib-DlDYgFfS.js";import{c as ar,f as or,n as sr,r as cr,t as lr,u as ur}from"./trim-lines-DfV8CCf7.js";import{u as dr}from"./space-separated-tokens-l9yufOSK.js";import{n as fr,t as pr}from"./syntax-CKL08zSk.js";import{n as mr,r as hr,t as gr}from"./cm-theme-Cvtw80TE.js";import{i as _r,n as vr}from"./page-list-cache-BNFVKu-D.js";import{t as yr}from"./documents-fetch-Y7Dt9_Tn.js";import{i as br,n as xr,r as Sr,t as Cr}from"./dist-DseqKdAU.js";import{n as wr,r as Tr,t as Er}from"./dist-BxTTaZ5o.js";import{t as Dr}from"./dist-CjyZozAk.js";import{n as Or}from"./dist-C2Kstufe.js";import{n as kr}from"./dist-BvhrN0Uj.js";import{n as Ar}from"./dist-D5mDCusD.js";import{i as jr,n as Mr,r as Nr}from"./dist-BpU-J2LR.js";import{n as Pr}from"./dist-BkE9d74i.js";import{t as Fr}from"./stex-CUzil_LB.js";import{n as Ir,r as Lr}from"./external-link-CldCnbtR.js";var Rr=et(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),zr=et(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Br=et(`film`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]),Vr=et(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Hr=et(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),V=n(),H=e(r(),1),Ur=e(o(),1),Wr=s(),Gr=c();function Kr(e){return e.editorView}var qr=new Map([[32,` `],[9,` `],[160,`\xA0`]]);function Jr(e){let t=/^&#(x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);$/.exec(e);if(!t)return null;let n=t[1],r=n[0]===`x`||n[0]===`X`,i=Number.parseInt(r?n.slice(1):n,r?16:10);return Number.isNaN(i)?null:i}function Yr(e){let t=Jr(e);return t!==null&&qr.has(t)}function Xr(e){let t=Jr(e);return t===null?null:qr.get(t)??null}var Zr=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function Qr(e){Zr.lastIndex=0;let t=e.match(Zr);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=Xr(e);if(t===null)return null;n+=t}return n}var $r=()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else n!==void 0&&n()}},ei=/[\uD800-\uDBFF]/,ti=/[\uDC00-\uDFFF]/,ni=(e,t)=>{let n=0,r=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(n>0&&ei.test(e[n-1])&&n--;r+n<e.length&&r+n<t.length&&e[e.length-r-1]===t[t.length-r-1];)r++;return r>0&&ti.test(e[e.length-r])&&r--,{index:n,remove:e.length-n-r,insert:t.slice(n,t.length-r)}},ri=(e,t)=>e>>>t|e<<32-t,ii=e=>ri(e,2)^ri(e,13)^ri(e,22),ai=e=>ri(e,6)^ri(e,11)^ri(e,25),oi=e=>ri(e,7)^ri(e,18)^e>>>3,si=e=>ri(e,17)^ri(e,19)^e>>>10,ci=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),li=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ui=class{constructor(){let e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(li),this._W=new Uint32Array(e,64,64)}_updateHash(){let e=this._H,t=this._W;for(let e=16;e<64;e++)t[e]=si(t[e-2])+t[e-7]+oi(t[e-15])+t[e-16];let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7];for(let e=0,u,d;e<64;e++)u=l+ai(o)+(o&s^~o&c)+ci[e]+t[e]>>>0,d=ii(n)+(n&r^n&i^r&i)>>>0,l=c,c=s,s=o,o=a+u>>>0,a=i,i=r,r=n,n=u+d>>>0;e[0]+=n,e[1]+=r,e[2]+=i,e[3]+=a,e[4]+=o,e[5]+=s,e[6]+=c,e[7]+=l}digest(e){let t=0;for(;t+56<=e.length;){let n=0;for(;n<16&&t+3<e.length;n++)this._W[n]=e[t++]<<24|e[t++]<<16|e[t++]<<8|e[t++];if(t%64!=0){for(this._W.fill(0,n,16);t<e.length;)this._W[n]|=e[t]<<(3-t%4)*8,t++;this._W[n]|=128<<(3-t%4)*8}this._updateHash()}let n=t%64!=0;this._W.fill(0,0,16);let r=0;for(;t<e.length;r++)for(let n=3;n>=0&&t<e.length;n--)this._W[r]|=e[t++]<<n*8;n||(this._W[r-(t%4==0?0:1)]|=128<<(3-t%4)*8),this._W[14]=e.byteLength/Pt,this._W[15]=e.byteLength*8,this._updateHash();let i=new Uint8Array(32);for(let e=0;e<this._H.length;e++)for(let t=0;t<4;t++)i[e*4+t]=this._H[e]>>>(3-t)*8;return i}},di=e=>new ui().digest(e),U=new k(`y-sync`),fi=new k(`y-undo`),pi=new k(`yjs-cursor`),mi=e=>{for(let t=6;t<e.length;t++)e[t%6]=e[t%6]^e[t];return e.slice(0,6)},hi=e=>Lt(mi(di(Et(e)))),gi=()=>({mapping:new Map,isOMark:new Map}),_i=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&t.sv.get(e.id.client)>e.id.clock&&!Ct(t.ds,e.id),vi=[{light:`#ecd44433`,dark:`#ecd444`}],yi=(e,t,n)=>{if(!e.has(n)){if(e.size<t.length){let n=en();e.forEach(e=>n.add(e)),t=t.filter(e=>!n.has(e))}e.set(n,Ot(t))}return e.get(n)},bi=(e,{colors:t=vi,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:i=()=>{},mapping:a}={})=>{let o=!1,s=new wi(e,a),c=new M({props:{editable:e=>{let t=U.getState(e);return t.snapshot==null&&t.prevSnapshot==null}},key:U,state:{init:(i,a)=>({type:e,doc:e.doc,binding:s,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:t,colorMapping:n,permanentUserData:r}),apply:(e,t)=>{let n=e.getMeta(U);if(n!==void 0){t=Object.assign({},t);for(let e in n)t[e]=n[e]}return t.addToHistory=e.getMeta(`addToHistory`)!==!1,t.isChangeOrigin=n!==void 0&&!!n.isChangeOrigin,t.isUndoRedoOperation=n!==void 0&&!!n.isChangeOrigin&&!!n.isUndoRedoOperation,s.prosemirrorView!==null&&n!==void 0&&(n.snapshot!=null||n.prevSnapshot!=null)&&At(0,()=>{s.prosemirrorView!=null&&(n.restore==null?s._renderSnapshot(n.snapshot,n.prevSnapshot,t):(s._renderSnapshot(n.snapshot,n.snapshot,t),delete t.restore,delete t.snapshot,delete t.prevSnapshot,s.mux(()=>{s._prosemirrorChanged(s.prosemirrorView.state.doc)})))}),t}},view:e=>(s.initView(e),a??s._forceRerender(),i(),{update:()=>{let t=c.getState(e.state);if(t.snapshot==null&&t.prevSnapshot==null&&(o||e.state.doc.content.findDiffStart(e.state.doc.type.createAndFill().content)!==null)){if(o=!0,t.addToHistory===!1&&!t.isChangeOrigin){let t=fi.getState(e.state),n=t&&t.undoManager;n&&n.stopCapturing()}s.mux(()=>{t.doc.transact(n=>{n.meta.set(`addToHistory`,t.addToHistory),s._prosemirrorChanged(e.state.doc)},U)})}},destroy:()=>{s.destroy()}})});return c},xi=(e,t,n)=>{if(t!==null&&t.anchor!==null&&t.head!==null)if(t.type===`all`)e.setSelection(new ke(e.doc));else if(t.type===`node`){let r=na(n.doc,n.type,t.anchor,n.mapping);e.setSelection(Si(e,r))}else{let r=na(n.doc,n.type,t.anchor,n.mapping),i=na(n.doc,n.type,t.head,n.mapping);r!==null&&i!==null&&e.setSelection(j.between(e.doc.resolve(r),e.doc.resolve(i)))}},Si=(e,t)=>{let n=e.doc.resolve(t);return n.nodeAfter?Pe.create(e.doc,t):j.near(n)},Ci=(e,t)=>({type:t.selection.jsonID,anchor:ea(t.selection.anchor,e.type,e.mapping),head:ea(t.selection.head,e.type,e.mapping)}),wi=class{constructor(e,t=new Map){this.type=e,this.prosemirrorView=null,this.mux=$r(),this.mapping=t,this.isOMark=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&this.prosemirrorView!=null&&(this.beforeTransactionSelection=Ci(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta(`addToHistory`,!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(Rt&&this._domSelectionInView===null&&(At(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){let e=this.prosemirrorView._root.getSelection();if(e==null||e.anchorNode==null)return!1;let t=this.prosemirrorView._root.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset),t.getClientRects().length===0&&t.startContainer&&t.collapsed&&t.selectNodeContents(t.startContainer);let n=t.getBoundingClientRect(),r=Ft.documentElement;return n.bottom>=0&&n.right>=0&&n.left<=(window.innerWidth||r.clientWidth||0)&&n.top<=(window.innerHeight||r.clientHeight||0)}renderSnapshot(e,t){t||=cn(Ut(),new Map),this.prosemirrorView.dispatch(this._tr.setMeta(U,{snapshot:e,prevSnapshot:t}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{let e=this.type.toArray().map(e=>Ei(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),t=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new A(I.from(e),0,0));t.setMeta(U,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(t)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{let e=this.beforeTransactionSelection===null?this.prosemirrorView.state.selection:null,t=this.type.toArray().map(e=>Ei(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new A(I.from(t),0,0));if(e){let t=Kt(St(e.anchor,0),n.doc.content.size),r=Kt(St(e.head,0),n.doc.content.size);n.setSelection(j.create(n.doc,t,r))}this.prosemirrorView.dispatch(n.setMeta(U,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,t,n){let r=this.doc,i=this.type;if(e||=Nt(this.doc),e instanceof Uint8Array||t instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(t instanceof Uint8Array))&&Bt(),r=new Wt({gc:!1}),Vt(r,t),t=Nt(r),Vt(r,e),e=Nt(r),i._item===null){let e=Array.from(this.doc.share.keys()).find(e=>this.doc.share.get(e)===this.type);i=r.getXmlFragment(e)}else{let e=r.store.clients.get(i._item.id.client)??[];i=e[Mt(e,i._item.id.clock)].content.type}this.mapping.clear(),this.mux(()=>{r.transact(r=>{let a=n.permanentUserData;a&&a.dss.forEach(e=>{jt(r,e,e=>{})});let o=(e,t)=>{let r=e===`added`?a.getUserByClientId(t.client):a.getUserByDeletedId(t);return{user:r,type:e,color:yi(n.colorMapping,n.colors,r)}},s=Dt(i,new Gt(t.ds,e.sv)).map(n=>!n._item.deleted||_i(n._item,e)||_i(n._item,t)?Ei(n,this.prosemirrorView.state.schema,{mapping:new Map,isOMark:new Map},e,t,o):null).filter(e=>e!==null),c=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new A(I.from(s),0,0));this.prosemirrorView.dispatch(c.setMeta(U,{isChangeOrigin:!0}))},U)})}_typeChanged(e,t){if(this.prosemirrorView==null)return;let n=U.getState(this.prosemirrorView.state);if(e.length===0||n.snapshot!=null||n.prevSnapshot!=null){this.renderSnapshot(n.snapshot,n.prevSnapshot);return}this.mux(()=>{let e=(e,t)=>this.mapping.delete(t);jt(t,t.deleteSet,e=>{if(e.constructor===Qt){let t=e.content.type;t&&this.mapping.delete(t)}}),t.changed.forEach(e),t.changedParentTypes.forEach(e);let n=this.type.toArray().map(e=>Ti(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),r=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new A(I.from(n),0,0));xi(r,this.beforeTransactionSelection,this),r=r.setMeta(U,{isChangeOrigin:!0,isUndoRedoOperation:t.origin instanceof qt}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&r.scrollIntoView(),this.prosemirrorView.dispatch(r)})}_prosemirrorChanged(e){this.doc.transact(()=>{qi(this.doc,this.type,e,this),this.beforeTransactionSelection=Ci(this,this.prosemirrorView.state)},U)}initView(e){this.prosemirrorView!=null&&this.destroy(),this.prosemirrorView=e,this.doc.on(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.on(`afterAllTransactions`,this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){this.prosemirrorView!=null&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.off(`afterAllTransactions`,this.afterAllTransactions))}},Ti=(e,t,n,r,i,a)=>{let o=n.mapping.get(e);if(o===void 0){if(e instanceof $t)return Ei(e,t,n,r,i,a);throw zt()}return o},Ei=(e,t,n,r,i,a)=>{let o=[],s=e=>{if(e instanceof $t){let s=Ti(e,t,n,r,i,a);s!==null&&o.push(s)}else{let s=e._item.right?.content?.type;s instanceof nn&&!s._item.deleted&&s._item.id.client===s.doc.clientID&&(e.applyDelta([{retain:e.length},...s.toDelta()]),s.doc.transact(e=>{s._item.delete(e)}));let c=Di(e,t,n,r,i,a);c!==null&&c.forEach(e=>{e!==null&&o.push(e)})}};r===void 0||i===void 0?e.toArray().forEach(s):Dt(e,new Gt(i.ds,r.sv)).forEach(s);try{let s=e.getAttributes(r);r!==void 0&&(_i(e._item,r)?_i(e._item,i)||(s.ychange=a?a(`added`,e._item.id):{type:`added`}):s.ychange=a?a(`removed`,e._item.id):{type:`removed`});let c=Ii(s),l=Gi(c.marks,t),u=t.node(e.nodeName,c.plain,o,l.length?l:void 0);return n.mapping.set(e,u),u}catch(r){console.warn(`[y-prosemirror] schema.node(`+e.nodeName+`) threw:`,String(r&&r.message||r));let i=globalThis.__okYpsCounters=globalThis.__okYpsCounters||{block:0,inline:0};if(t.nodes[e.nodeName]&&t.nodes[e.nodeName].spec&&t.nodes[e.nodeName].spec.inline)i.inline++;else if(i.block++,t.nodes.rawMdxFallback)try{let i=t.node(`rawMdxFallback`,{reason:String(r&&r.message||r)},[t.text(e.nodeName)]);return n.mapping.set(e,i),i}catch(e){console.warn(`[y-prosemirror] rawMdxFallback substitution also failed:`,String(e&&e.message||e))}return n.mapping.delete(e),null}},Di=(e,t,n,r,i,a)=>{let o=[],s=e.toDelta(r,i,a);try{for(let e=0;e<s.length;e++){let n=s[e];o.push(t.text(n.insert,Gi(n.attributes,t)))}}catch(e){console.warn(`[y-prosemirror] schema.text() threw:`,String(e&&e.message||e));let t=globalThis.__okYpsCounters=globalThis.__okYpsCounters||{block:0,inline:0};return t.inline++,null}return o},Oi=(e,t)=>{let n=new Jt,r=e.map(e=>({insert:e.text,attributes:Ki(e.marks,t)}));return n.applyDelta(r),t.mapping.set(n,e),n},ki=(e,t)=>{let n=new $t(e.type.name);for(let t in e.attrs){let r=e.attrs[t];r!==null&&t!==`ychange`&&n.setAttribute(t,r)}let r=Ki(e.marks||[],t);for(let e in r)n.setAttribute(Fi+e,{...r[e]});return n.insert(0,Ni(e).map(e=>Ai(e,t))),t.mapping.set(n,e),n},Ai=(e,t)=>e instanceof Array?Oi(e,t):ki(e,t),ji=e=>typeof e==`object`&&!!e,Mi=(e,t)=>{let n=Object.keys(e).filter(t=>e[t]!==null),r=n.length===Object.keys(t).filter(e=>t[e]!==null).length;for(let i=0;i<n.length&&r;i++){let a=n[i],o=e[a],s=t[a];r=a===`ychange`||o===s||ji(o)&&ji(s)&&Mi(o,s)}return r},Ni=e=>{let t=e.content.content,n=[];for(let e=0;e<t.length;e++){let r=t[e];if(r.isText){let r=[];for(let n=t[e];e<t.length&&n.isText;n=t[++e])r.push(n);e--,n.push(r)}else n.push(r)}return n},Pi=(e,t)=>{let n=e.toDelta();return n.length===t.length&&n.every((e,n)=>e.insert===t[n].text&&kt(e.attributes||{}).length===t[n].marks.length&&Tt(e.attributes,(e,r)=>{let i=Wi(r),a=t[n].marks;return a.find(e=>e.type.name===i)?Mi(e,a.find(e=>e.type.name===i)?.attrs):!1}))},Fi=`ymark:`,Ii=e=>{let t={},n={};for(let r in e)r.startsWith(Fi)?n[r.slice(6)]=e[r]:t[r]=e[r];return{plain:t,marks:n}},Li=(e,t)=>{let n=Object.keys(e);return n.length===t.length?n.every(n=>{let r=Wi(n),i=t.find(e=>e.type.name===r);return i?Mi(e[n],i.attrs):!1}):!1},Ri=(e,t)=>{if(e instanceof $t&&!(t instanceof Array)&&Ji(e,t)){let n=Ni(t),r=Ii(e.getAttributes());return e._length===n.length&&Li(r.marks,t.marks)&&Mi(r.plain,t.attrs)&&e.toArray().every((e,t)=>Ri(e,n[t]))}return e instanceof Jt&&t instanceof Array&&Pi(e,t)},zi=(e,t)=>e===t||e instanceof Array&&t instanceof Array&&e.length===t.length&&e.every((e,n)=>t[n]===e),Bi=(e,t,n)=>{let r=e.toArray(),i=Ni(t),a=i.length,o=r.length,s=Kt(o,a),c=0,l=0,u=!1;for(;c<s;c++){let e=r[c],t=i[c];if(zi(n.mapping.get(e),t))u=!0;else if(!Ri(e,t))break}for(;c+l<s;l++){let e=r[o-l-1],t=i[a-l-1];if(zi(n.mapping.get(e),t))u=!0;else if(!Ri(e,t))break}return{equalityFactor:c+l,foundMappedChild:u}},Vi=e=>{let t=``,n=e._start,r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof tn?t+=n.content.str:n.content instanceof Ht&&(r[n.content.key]=null)),n=n.right;return{str:t,nAttrs:r}},Hi=(e,t,n)=>{n.mapping.set(e,t);let{nAttrs:r,str:i}=Vi(e),a=t.map(e=>({insert:e.text,attributes:Object.assign({},r,Ki(e.marks,n))})),{insert:o,remove:s,index:c}=ni(i,a.map(e=>e.insert).join(``));e.delete(c,s),e.insert(c,o),e.applyDelta(a.map(e=>({retain:e.insert.length,attributes:e.attributes})))},Ui=/(.*)(--[a-zA-Z0-9+/=]{8})$/,Wi=e=>Ui.exec(e)?.[1]??e,Gi=(e,t)=>{let n=[];for(let r in e)n.push(t.mark(Wi(r),e[r]));return n},Ki=(e,t)=>{let n={};return e.forEach(e=>{if(e.type.name!==`ychange`){let r=Yt(t.isOMark,e.type,()=>!e.type.excludes(e.type));n[r?`${e.type.name}--${hi(e.toJSON())}`:e.type.name]=e.attrs}}),n},qi=(e,t,n,r)=>{if(t instanceof $t&&t.nodeName!==n.type.name)throw Error(`node name mismatch!`);if(r.mapping.set(t,n),t instanceof $t){let e=t.getAttributes(),i=n.attrs;for(let n in i)i[n]===null?t.removeAttribute(n):e[n]!==i[n]&&n!==`ychange`&&t.setAttribute(n,i[n]);for(let n in e)i[n]===void 0&&!n.startsWith(Fi)&&t.removeAttribute(n);let a=Ki(n.marks||[],r);for(let n in a){let r=e[Fi+n];(r===void 0||!Mi(r,a[n]))&&t.setAttribute(Fi+n,{...a[n]})}for(let n in e)n.startsWith(Fi)&&a[n.slice(6)]===void 0&&t.removeAttribute(n)}let i=Ni(n),a=i.length,o=t.toArray(),s=o.length,c=Kt(a,s),l=0,u=0;for(;l<c;l++){let e=o[l],t=i[l];if(!zi(r.mapping.get(e),t))if(Ri(e,t))r.mapping.set(e,t);else break}for(;u+l+1<c;u++){let e=o[s-u-1],t=i[a-u-1];if(!zi(r.mapping.get(e),t))if(Ri(e,t))r.mapping.set(e,t);else break}e.transact(()=>{for(;s-l-u>0&&a-l-u>0;){let n=o[l],c=i[l],d=o[s-u-1],f=i[a-u-1];if(n instanceof Jt&&c instanceof Array)Pi(n,c)||Hi(n,c,r),l+=1;else{let i=n instanceof $t&&Ji(n,c),a=d instanceof $t&&Ji(d,f);if(i&&a){let e=Bi(n,c,r),t=Bi(d,f,r);e.foundMappedChild&&!t.foundMappedChild?a=!1:!e.foundMappedChild&&t.foundMappedChild||e.equalityFactor<t.equalityFactor?i=!1:a=!1}i?(qi(e,n,c,r),l+=1):a?(qi(e,d,f,r),u+=1):(r.mapping.delete(t.get(l)),t.delete(l,1),t.insert(l,[Ai(c,r)]),l+=1)}}let n=s-l-u;if(s===1&&a===0&&o[0]instanceof Jt?(r.mapping.delete(o[0]),o[0].delete(0,o[0].length)):n>0&&(t.slice(l,l+n).forEach(e=>r.mapping.delete(e)),t.delete(l,n)),l+u<a){let e=[];for(let t=l;t<a-u;t++)e.push(Ai(i[t],r));t.insert(l,e)}},U)},Ji=(e,t)=>!(t instanceof Array)&&e.nodeName===t.type.name,Yi=null,Xi=class{constructor(e,t,n){this.view=e,this.key=t,this.value=n}apply(){let e=U.getState(this.view.state);if(e&&e.binding&&!e.binding.isDestroyed){let e=this.view.state.tr;e.setMeta(this.key,this.value),this.view.dispatch(e)}}},Zi=class e{constructor(e=[]){this.entries=e}getFirst(){return this.entries[0]}dequeueFirst(){return this.entries.shift()}isEmpty(){return this.entries.length===0}static fromViewsToUpdate(){let t=Yi;Yi=null;let n=[];return t.forEach((e,t)=>{e.forEach((e,r)=>{n.push(new Xi(t,r,e))})}),new e(n)}},Qi=(e=Zi.fromViewsToUpdate(),t=!1)=>{let n=!0;for(;!e.isEmpty();){let r=e.getFirst();try{r.apply()}catch(r){if(r instanceof RangeError){t&&n&&e.dequeueFirst(),e.isEmpty()||At(0,()=>Qi(e,!0));return}throw r}n=!1,e.dequeueFirst()}},$i=(e,t,n)=>{Yi||(Yi=new Map,At(0,Qi)),Yt(Yi,e,rn).set(t,n)},ea=(e,t,n)=>{if(e===0)return wt(t,0,-1);let r=t._first===null?null:t._first.content.type;for(;r!==null&&t!==r;){if(r instanceof Jt){if(r._length>=e)return wt(r,e,-1);if(e-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,e--;while(r!==t&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==t&&(r=r._item===null?null:r._item.next.content.type)}}else{let i=(n.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&e<i)r=r._first.content.type,e--;else{if(e===1&&r._length===0&&i>1)return new on(r._item===null?null:r._item.id,r._item===null?Zt(r):null,null);if(e-=i,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(e===0)return r=r._item===null?r:r._item.parent,new on(r._item===null?null:r._item.id,r._item===null?Zt(r):null,null);do r=r._item.parent,e--;while(r!==t&&r._item.next===null);r!==t&&(r=r._item.next.content.type)}}}if(r===null)throw Bt();if(e===0&&r.constructor!==Jt&&r!==t)return ta(r._item.parent,r._item)}return wt(t,t._length,-1)},ta=(e,t)=>{let n=null,r=null;return e._item===null?r=Zt(e):n=ln(e._item.id.client,e._item.id.clock),new on(n,r,t.id)},na=(e,t,n,r)=>{let i=un(n,e);if(i===null||i.type!==t&&!Xt(t,i.type._item))return null;let a=i.type,o=0;if(a.constructor===Jt)o=i.index;else if(a._item===null||!a._item.deleted){let e=a._first,t=0;for(;t<a._length&&t<i.index&&e!==null;){if(!e.deleted){let n=e.content.type;if(t++,n instanceof Jt)o+=n._length;else{let e=r.get(n);if(e==null)return null;o+=e.nodeSize}}e=e.right}o+=1}for(;a!==t&&a._item!==null;){let e=a._item.parent;if(e._item===null||!e._item.deleted){o+=1;let t=e._first;for(;t!==null;){let e=t.content.type;if(e===a)break;if(!t.deleted)if(e instanceof Jt)o+=e._length;else{let t=r.get(e);if(t==null)return null;o+=t.nodeSize}t=t.right}}a=e}return o-1},ra=(e,t)=>{let n=e.toArray().map(e=>Ei(e,t,gi())).filter(e=>e!==null);return I.fromArray(n)},ia=(e,t)=>t.topNodeType.create(null,ra(e,t)),aa=(e,t)=>{let n=gi(),r=e.toArray().map(e=>Ei(e,t,n)).filter(e=>e!==null);return{doc:t.topNodeType.create(null,I.fromArray(r)),meta:n,mapping:n.mapping}},oa=(e,t,n)=>e!==t,sa=e=>{let t=document.createElement(`span`);t.classList.add(`ProseMirror-yjs-cursor`),t.setAttribute(`style`,`border-color: ${e.color}`);let n=document.createElement(`div`);n.setAttribute(`style`,`background-color: ${e.color}`),n.insertBefore(document.createTextNode(e.name),null);let r=document.createTextNode(`⁠`),i=document.createTextNode(`⁠`);return t.insertBefore(r,null),t.insertBefore(n,null),t.insertBefore(i,null),t},ca=e=>({style:`background-color: ${e.color}70`,class:`ProseMirror-yjs-selection`}),la=/^#[0-9a-fA-F]{6}$/,ua=(e,t,n,r,i)=>{let a=U.getState(e);if(a==null||a.doc==null||a.binding==null)return me.create(e.doc,[]);let o=a.doc,s=[];return a.snapshot!=null||a.prevSnapshot!=null||a.binding.mapping.size===0?me.create(e.doc,[]):(t.getStates().forEach((t,c)=>{if(n(o.clientID,c,t)&&t.cursor!=null){let n=t.user||{};n.color==null?n.color=`#ffa500`:la.test(n.color)||console.warn(`A user uses an unsupported color format`,n),n.name??=`User: ${c}`;let l=na(o,a.type,It(t.cursor.anchor),a.binding.mapping),u=na(o,a.type,It(t.cursor.head),a.binding.mapping);if(l!==null&&u!==null){let t=St(e.doc.content.size-1,0);l=Kt(l,t),u=Kt(u,t),s.push(he.widget(u,()=>r(n,c),{key:c+``,side:10}));let a=Kt(l,u),o=St(l,u);s.push(he.inline(a,o,i(n,c),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),me.create(e.doc,s))},da=(e,{awarenessStateFilter:t=oa,cursorBuilder:n=sa,selectionBuilder:r=ca,getSelection:i=e=>e.selection}={},a=`cursor`)=>new M({key:pi,state:{init(i,a){return ua(a,e,t,n,r)},apply(i,a,o,s){let c=U.getState(s),l=i.getMeta(pi);return c&&c.isChangeOrigin||l&&l.awarenessUpdated?ua(s,e,t,n,r):a.map(i.mapping,i.doc)}},props:{decorations:e=>pi.getState(e)},view:t=>{let n=()=>{t.docView&&$i(t,pi,{awarenessUpdated:!0})},r=()=>{let n=U.getState(t.state),r=e.getLocalState()||{};if(t.hasFocus()){let o=i(t.state),s=ea(o.anchor,n.type,n.binding.mapping),c=ea(o.head,n.type,n.binding.mapping);(r.cursor==null||!sn(It(r.cursor.anchor),s)||!sn(It(r.cursor.head),c))&&e.setLocalStateField(a,{anchor:s,head:c})}else r.cursor!=null&&na(n.doc,n.type,It(r.cursor.anchor),n.binding.mapping)!==null&&e.setLocalStateField(a,null)};return e.on(`change`,n),t.dom.addEventListener(`focusin`,r),t.dom.addEventListener(`focusout`,r),{update:r,destroy:()=>{t.dom.removeEventListener(`focusin`,r),t.dom.removeEventListener(`focusout`,r),e.off(`change`,n),e.setLocalStateField(a,null)}}}}),fa=e=>{let t=fi.getState(e).undoManager;if(t!=null)return t.undo(),!0},pa=e=>{let t=fi.getState(e).undoManager;if(t!=null)return t.redo(),!0},ma=new Set([`paragraph`]),ha=(e,t)=>!(e instanceof Qt)||!(e.content instanceof an)||!(e.content.type instanceof nn||e.content.type instanceof $t&&t.has(e.content.type.nodeName))||e.content.type._length===0,ga=({protectedNodes:e=ma,trackedOrigins:t=[],undoManager:n=null}={})=>new M({key:fi,state:{init:(r,i)=>{let a=U.getState(i),o=n||new qt(a.type,{trackedOrigins:new Set([U].concat(t)),deleteFilter:t=>ha(t,e),captureTransaction:e=>e.meta.get(`addToHistory`)!==!1});return{undoManager:o,prevSel:null,hasUndoOps:o.undoStack.length>0,hasRedoOps:o.redoStack.length>0}},apply:(e,t,n,r)=>{let i=U.getState(r).binding,a=t.undoManager,o=a.undoStack.length>0,s=a.redoStack.length>0;return i?{undoManager:a,prevSel:Ci(i,n),hasUndoOps:o,hasRedoOps:s}:o!==t.hasUndoOps||s!==t.hasRedoOps?Object.assign({},t,{hasUndoOps:a.undoStack.length>0,hasRedoOps:a.redoStack.length>0}):t}},view:e=>{let t=U.getState(e.state),n=fi.getState(e.state).undoManager;return n.on(`stack-item-added`,({stackItem:n})=>{let r=t.binding;r&&n.meta.set(r,fi.getState(e.state).prevSel)}),n.on(`stack-item-popped`,({stackItem:e})=>{let n=t.binding;n&&(n.beforeTransactionSelection=e.meta.get(n)||n.beforeTransactionSelection)}),{destroy:()=>{n.destroy()}}}}),_a=new Map,va=new Set;function ya(){for(let e of va)e()}function ba(e,t,n){_a.set(e,{view:t,host:n}),ya()}function xa(e,t){_a.get(e)?.view===t&&(_a.delete(e),ya())}function Sa(e){let t=_a.get(e);return t?.host===`sourceEditor`?t.view:null}function Ca(e){return _a.get(e)??null}function wa(e){return va.add(e),()=>{va.delete(e)}}var Ta=new WeakMap,Ea=new WeakMap;function Da(e,t){Ta.set(e,t)}function Oa(e){return Ta.get(e)??!1}function ka(e,t){Ea.set(e,t)}function Aa(e){return Ea.get(e)??!1}function ja(e){return!Oa(e)}var Ma=`autonomousFragmentEdit/swap`;function Na(e){return e.setMeta(Ma,!0)}function Pa(e,t,n){return n===t.textContent?Na(e):e}function Fa(e){return e.getMeta(Ma)===!0}function Ia(e){return!e.getMeta(U)&&!Fa(e)}var La=/^[A-Za-z0-9]{20,}$/,Ra=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function za(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function Ba(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return La.test(n)?n:null}function Va(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!za(t.hostname))return null;let n=Ba(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&Ra.test(r)?r:null}}function Ha(e){return Va(e)!==null}function Ua(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function Wa(e){if(typeof e!=`string`||e.length===0)return!1;let t;try{t=new URL(e)}catch{return!1}return t.protocol!==`http:`&&t.protocol!==`https:`?!1:Ua(t.hostname)}var Ga=/^[A-Za-z0-9_-]{11}$/;function Ka(e){let t=e.toLowerCase();return t===`youtube.com`||t===`www.youtube.com`||t===`m.youtube.com`||t===`music.youtube.com`||t===`youtu.be`||t===`youtube-nocookie.com`||t===`www.youtube-nocookie.com`}function qa(e){if(e.length===0)return null;if(/^[0-9]+$/.test(e)){let t=Number.parseInt(e,10);return t>0?t:null}let t=e.match(/^(?:([0-9]+)h)?(?:([0-9]+)m)?(?:([0-9]+)s?)?$/);if(!t)return null;let n=t[1]?Number.parseInt(t[1],10):0,r=t[2]?Number.parseInt(t[2],10):0,i=t[3]?Number.parseInt(t[3],10):0,a=n*3600+r*60+i;return a>0?a:null}function Ja(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return Ga.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return Ga.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function Ya(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!Ka(t.hostname))return null;let n=Ja(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?qa(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}function Xa(e,t){let n=Array.isArray(e.attrs.attributes)?e.attrs.attributes.filter(e=>typeof e==`object`&&!!e&&`type`in e):[],r=e.attrs.props??{},i=new Map,a=new Set;if(t)for(let e of t)e.omitOnDefault===!0&&`defaultValue`in e&&e.defaultValue!==void 0&&i.set(e.name,e.defaultValue),e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&a.add(e.name);for(let[e,t]of Object.entries(r)){let r=n.findIndex(t=>t.type===`mdxJsxAttribute`&&t.name===e);if(i.has(e)&&Object.is(i.get(e),t)){r>=0&&n.splice(r,1);continue}if(a.has(e)&&t===``){r>=0&&n.splice(r,1);continue}if(r>=0){let e=n[r];if(e.type===`mdxJsxAttribute`&&e.value!=null&&typeof e.value==`object`&&e.value.type===`mdxJsxAttributeValueExpression`&&Za(e.value.value,t))continue}let o=Qa(e,t);r>=0?n[r]=o:n.push(o)}return n}function Za(e,t){try{return JSON.stringify(JSON.parse(e))===JSON.stringify(t)}catch{return!1}}function Qa(e,t){if(t===!0)return{type:`mdxJsxAttribute`,name:e,value:null};if(t===!1)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}};if(t==null)return{type:`mdxJsxAttribute`,name:e,value:null};if(typeof t==`string`)return{type:`mdxJsxAttribute`,name:e,value:t};if(typeof t==`number`)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:JSON.stringify(t)}};if(typeof t==`object`){let n;try{n=JSON.stringify(t)}catch{n=String(t)}return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:n}}}return{type:`mdxJsxAttribute`,name:e,value:String(t)}}function $a(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:Xa(t,r),children:n.all(t),data:{}}}function eo(e,t,n){let r=t.attrs.props?.children;return{type:`mdxJsxTextElement`,name:e,attributes:Xa(t,n),children:typeof r==`string`&&r!==``?[{type:`text`,value:r}]:[],data:{}}}var to=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`],defaultValue:`note`,required:!1,description:`Callout variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)",iconPicker:!0},{name:`color`,type:`string`,required:!1,advanced:!0,description:"Optional accent color override (hex — e.g. `#F05032`)",colorPicker:!0},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,advanced:!0,description:"Render as a foldable `<details>` (Obsidian `[!TYPE]+/-`)"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,description:`When collapsible, start in the open state`,hideWhen:e=>e.collapsible!==!0},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],no=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:x,autoFocus:!0},{name:`alt`,type:`string`,required:!0,description:`Alt text`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Image width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Image height`},{name:`srcset`,type:`string`,required:!1,advanced:!0,description:`Responsive image candidate set (e.g. "x.png 1x, y.png 2x")`},{name:`sizes`,type:`string`,required:!1,advanced:!0,description:`Responsive image sizes hint paired with srcset`},{name:`loading`,type:`enum`,enumValues:[`eager`,`lazy`],defaultValue:`lazy`,required:!1,advanced:!0,omitOnDefault:!0,description:`Native img loading strategy (defaults to lazy)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`decoding`,type:`enum`,enumValues:[`sync`,`async`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Hint for how the browser should decode the image`},{name:`fetchpriority`,type:`enum`,enumValues:[`high`,`low`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Resource fetch priority hint`},{name:`crossorigin`,type:`enum`,enumValues:[`anonymous`,`use-credentials`],required:!1,advanced:!0,description:`CORS mode for the image fetch`},{name:`referrerpolicy`,type:`string`,required:!1,advanced:!0,description:`Referrer policy for the image fetch (HTML referrerpolicy values)`},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],ro=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Embedded page URL (must start with http:// or https://)`,autoFocus:!0},{name:`title`,type:`string`,required:!1,description:`Iframe title (accessible label for screen readers)`},{name:`width`,type:`string`,required:!1,advanced:!0,description:`Embed width as a CSS length (e.g. "100%", "640px")`,cssLengthInput:!0},{name:`height`,type:`string`,required:!1,advanced:!0,description:`Embed height as a CSS length (e.g. "26rem", "480px")`,cssLengthInput:!0},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],io=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:y,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 video controls (defaults to true)`,hideWhen:e=>typeof e.src==`string`&&(Wa(e.src)||Ha(e.src))},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`poster`,type:`string`,required:!1,advanced:!0,description:`Poster image URL shown before playback`,accept:x,hideWhen:e=>typeof e.src==`string`&&(Wa(e.src)||Ha(e.src))},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Video width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Video height`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`,hideWhen:e=>typeof e.src==`string`&&Ha(e.src)},{name:`playsinline`,type:`boolean`,required:!1,advanced:!0,description:`Play inline on iOS rather than entering fullscreen`,hideWhen:e=>typeof e.src==`string`&&(Wa(e.src)||Ha(e.src))},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the video to preload`,hideWhen:e=>typeof e.src==`string`&&(Ya(e.src)!==null||Wa(e.src)||Ha(e.src))},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],ao=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:w,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 audio controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the audio to preload`}],oo=[{name:`title`,type:`string`,required:!0,description:`Heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the block renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Rocket`)",iconPicker:!0},{name:`description`,type:`string`,required:!1,advanced:!0,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,advanced:!0,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],so=[to[0],to[1],to[4],to[5],to[6]],co=[no[0],no[1],no[7]],lo=[oo[0],oo[1],oo[4],oo[5]],uo=[{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`,`justify`],required:!1,defaultValue:`center`,description:"Block alignment from the `<div align>` attribute."},{name:`tag`,type:`string`,required:!1,defaultValue:`div`,hidden:!0,description:`Source wrapper tag (div or center).`},{name:`sourceAttrs`,type:`string`,required:!1,defaultValue:``,hidden:!0,description:`Raw opener-tag attribute bytes preserved for round-trip.`}],fo=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],po=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],mo=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],ho=[{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#install-tabs`)"}],go=[{name:`label`,type:`string`,required:!0,autoFocus:!0,defaultValue:`Tab`,description:`Tab strip label — shown in the clickable pill at the top`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#tab-npm`)"}],_o=[{name:`formula`,type:`string`,required:!0,autoFocus:!0,language:`latex`,description:`LaTeX math source (rendered with KaTeX in the browser)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#eq-pythagoras`)"},{name:`language`,type:`string`,required:!1,advanced:!0,description:"Forward-compat hint for the math source language (default `latex`). Reserved for future MathJax / Typst / AsciiMath substrates."}],vo=[_o[0]],yo=[_o[0]],bo=[{name:`chart`,type:`string`,required:!0,hidden:!0,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`}],xo=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],So=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],Co=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:C,autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded PDF viewer`},{name:`anchor`,type:`string`,required:!1,advanced:!0,description:"PDF viewer parameters as a single URL-fragment string (e.g. `page=3&height=600`)"}],wo=[{name:`src`,type:`string`,required:!0,description:"Path to the `.excalidraw` board this embed renders",autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded board`}],To=[{name:`src`,type:`string`,required:!0,description:"Path of the source doc, extension-less (e.g. `api-spec`).",autoFocus:!0},{name:`anchor`,type:`string`,required:!0,description:"Id of the `<MirrorSource>` block within the source doc."}],Eo=[{name:`id`,type:`string`,required:!0,description:"Stable id agents and authors use to reference this block from `<Mirror>` elsewhere.",autoFocus:!0},{name:`children`,type:`reactnode`,required:!0,description:`Block content this MirrorSource owns — paragraphs, callouts, code, nested JSX, anything.`}];function Do(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function Oo(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function ko(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=typeof t?.sourceTarget==`string`?t.sourceTarget:null,o=typeof t?.sourceAnchor==`string`?t.sourceAnchor:null,s=typeof t?.sourceAlias==`string`?t.sourceAlias:null,c=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:c,data:{target:n,anchor:i,alias:r,sourceTarget:a,sourceAnchor:o,sourceAlias:s},children:[{type:`text`,value:c}]}}var Ao=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:to,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`Alert / admonition with 15 type variants — 5 GFM (note, tip, important, warning, caution) plus 10 Obsidian-parity (abstract, info, todo, success, question, failure, danger, bug, example, quote)`,searchTerms:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`,`alert`,`admonition`,`callout`],serialize:(e,t)=>$a(`Callout`,e,t,to)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:no,icon:`Image`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],placeholder:{label:`Add an image`},serialize:(e,t)=>$a(`img`,e,t,no)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:io,icon:`SquarePlay`,category:`media`,displayName:`Video`,description:`HTML5 video player with native controls`,searchTerms:[`video`,`media`,`player`,`mp4`,`webm`,`movie`],placeholder:{label:`Add a video`},serialize:(e,t)=>$a(`video`,e,t,io)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:ao,icon:`Volume2`,category:`media`,displayName:`Audio`,description:`HTML5 audio player with native controls`,searchTerms:[`audio`,`sound`,`music`,`mp3`,`podcast`,`player`],placeholder:{label:`Add audio`},serialize:(e,t)=>$a(`audio`,e,t,ao)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:Co,icon:`FileText`,category:`media`,displayName:`PDF`,description:"Embedded PDF viewer (`#page=N` to open at page N, `#height=N` for viewer height)",searchTerms:[`pdf`,`document`,`embed`,`pdfjs`],placeholder:{label:`Add a PDF`},serialize:(e,t)=>$a(`Pdf`,e,t,Co)},{name:`Excalidraw`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:wo,icon:`PenTool`,category:`embed`,displayName:`Excalidraw`,description:"Embedded snapshot of an `.excalidraw` board, linking to its canvas editor",searchTerms:[`excalidraw`,`board`,`whiteboard`,`sketch`,`drawing`,`canvas`],serialize:(e,t)=>$a(`Excalidraw`,e,t,wo)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:So,icon:`Paperclip`,category:`media`,displayName:`File`,description:`Downloadable file attachment — inline row with name + size + download link`,searchTerms:[`file`,`attachment`,`download`,`document`,`zip`,`docx`,`doc`],placeholder:{label:`Add a file`},serialize:(e,t)=>$a(`File`,e,t,So)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:ro,icon:`AppWindow`,category:`embed`,displayName:`Embed`,description:'Inline web embed (iframe) — drop a URL, get a resizable preview pane. For YouTube / Vimeo / Loom prefer `<video src="…">` (player props, click-facade); `<Embed>` auto-rewrites watch URLs as a fallback.',searchTerms:[`embed`,`iframe`,`website`,`page`,`inline`,`frame`,`preview`],placeholder:{label:`Embed a URL`},serialize:(e,t)=>$a(`Embed`,e,t,ro)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:oo,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],exampleBody:`Body content revealed when the accordion is expanded.`,serialize:(e,t)=>$a(`Accordion`,e,t,oo)},{name:`Toggle`,surface:`canonical`,hasChildren:!0,props:oo,icon:`ChevronRight`,category:`content`,displayName:`Toggle`,description:"Standalone expand/collapse block (Notion-style). Same render + props as `<Accordion>` — pick whichever vocabulary matches the vault.",searchTerms:[`toggle`,`collapsible`,`expand`,`details`,`disclosure`,`fold`],exampleBody:`Body content revealed when the toggle is expanded.`,serialize:(e,t)=>$a(`Toggle`,e,t,oo)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:ho,icon:`LayoutPanelTop`,category:`content`,displayName:`Tabs`,description:"Horizontal tab strip + active panel below. Each `<Tab>` child is one panel; clickable pills at the top switch the active one. Active selection is ephemeral (resets on reload).",searchTerms:[`tabs`,`tabbed`,`panels`,`tabgroup`,`switcher`],exampleBody:`<Tab label="One">Body of the first tab panel.</Tab>
2
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{r as i}from"./dist-Nvb76hAm.js";import{n as a}from"./dist-PQ5KMVDh.js";import{t as o}from"./react-dom-DPxgxlDT.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{n as c,t as l}from"./with-selector-zVo3Fruj.js";import{a as u,d,i as f,l as p,r as m,u as h}from"./floating-ui.dom-DkPPH5vF.js";import{a as g,d as _,g as v,i as y,l as b,n as x,o as S,r as C,t as w,u as T}from"./constants-upload-CVKO8P4d.js";import{$ as ee,A as E,B as te,C as ne,F as re,G as ie,K as D,L as O,N as ae,P as oe,Q as se,R as ce,S as le,T as ue,U as de,V as fe,W as pe,X as me,Y as he,_ as ge,a as _e,at as k,b as ve,bt as A,c as ye,ct as j,d as be,et as xe,f as Se,g as Ce,gt as we,h as Te,ht as Ee,it as M,k as N,l as De,mt as Oe,n as P,nt as ke,o as F,ot as Ae,p as je,q as Me,r as Ne,rt as Pe,s as Fe,st as Ie,t as Le,tt as Re,u as ze,ut as Be,v as Ve,vt as I,w as He,x as Ue,y as We,z as L}from"./dist-Dc8tD1th.js";import{t as Ge}from"./dist-C_FzPxEX2.js";import{C as Ke,a as qe,g as Je,w as Ye}from"./schemas-api-JUnildTL.js";import{t as Xe}from"./util-doc-name-D-_o-n0R.js";import{n as Ze}from"./_envelope-Dwl6i2K9-DPqJ_Q4W.js";import{t as Qe}from"./note-window-mode-CI3Yju9B.js";import{i as $e}from"./use-apply-config-theme-CYFG76sS.js";import{t as et}from"./createLucideIcon-DdBzwsHe.js";import{t as tt}from"./folder-open-COGOeTzI.js";import{t as nt}from"./trash-2-CchZ0T47.js";import{n as rt,r as it}from"./structural-freshness-CIbkMFA3-CWi_lyiW.js";import{c as at,d as ot,l as st}from"./doc-hash-BJkweiX9.js";import{_ as ct,b as lt,d as ut,f as dt,g as ft,h as pt,j as mt,k as ht,o as gt,p as _t,v as vt,w as yt,x as bt}from"./navigation-targets-DTSxcGor.js";import{t as xt}from"./doc-paths-cEiFVCxr.js";import{$ as St,A as Ct,C as wt,G as Tt,H as Et,I as Dt,J as Ot,K as kt,L as At,M as jt,O as Mt,P as Nt,Q as Pt,R as Ft,S as It,U as Lt,W as Rt,X as zt,Z as Bt,_ as Vt,a as Ht,b as Ut,c as Wt,d as Gt,et as Kt,f as qt,h as Jt,it as Yt,j as Xt,k as Zt,l as Qt,m as $t,nt as en,o as tn,p as nn,rt as rn,s as an,u as on,v as sn,w as cn,x as ln,y as un}from"./config-provider-DXmc67dU.js";import{At as dn,Ct as fn,E as pn,F as mn,G as hn,I as R,J as gn,K as _n,M as vn,Mt as yn,Nt as bn,P as z,Tt as xn,X as Sn,a as Cn,c as wn,f as Tn,l as En,lt as Dn,o as On,r as kn,t as An,ut as jn}from"./dist-D2SphF3p.js";import{A as Mn,C as Nn,E as Pn,H as Fn,I as In,L as Ln,M as Rn,N as zn,O as Bn,P as Vn,R as B,S as Hn,T as Un,_ as Wn,a as Gn,b as Kn,c as qn,h as Jn,k as Yn,m as Xn,o as Zn,t as Qn,x as $n,y as er,z as tr}from"./lib-QQS1Brzc.js";import{t as nr}from"./ccount-BoHE53_k.js";import{n as rr,r as ir}from"./lib-DlDYgFfS.js";import{c as ar,f as or,n as sr,r as cr,t as lr,u as ur}from"./trim-lines-DfV8CCf7.js";import{u as dr}from"./space-separated-tokens-l9yufOSK.js";import{n as fr,t as pr}from"./syntax-CKL08zSk.js";import{n as mr,r as hr,t as gr}from"./cm-theme-Cvtw80TE.js";import{i as _r,n as vr}from"./page-list-cache-BNFVKu-D.js";import{t as yr}from"./documents-fetch-Y7Dt9_Tn.js";import{i as br,n as xr,r as Sr,t as Cr}from"./dist-DseqKdAU.js";import{n as wr,r as Tr,t as Er}from"./dist-BxTTaZ5o.js";import{t as Dr}from"./dist-CjyZozAk.js";import{n as Or}from"./dist-C2Kstufe.js";import{n as kr}from"./dist-BvhrN0Uj.js";import{n as Ar}from"./dist-D5mDCusD.js";import{i as jr,n as Mr,r as Nr}from"./dist-BpU-J2LR.js";import{n as Pr}from"./dist-BkE9d74i.js";import{t as Fr}from"./stex-CUzil_LB.js";import{n as Ir,r as Lr}from"./external-link-CldCnbtR.js";var Rr=et(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),zr=et(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Br=et(`film`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]),Vr=et(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Hr=et(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),V=n(),H=e(r(),1),Ur=e(o(),1),Wr=s(),Gr=c();function Kr(e){return e.editorView}var qr=new Map([[32,` `],[9,` `],[160,`\xA0`]]);function Jr(e){let t=/^&#(x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);$/.exec(e);if(!t)return null;let n=t[1],r=n[0]===`x`||n[0]===`X`,i=Number.parseInt(r?n.slice(1):n,r?16:10);return Number.isNaN(i)?null:i}function Yr(e){let t=Jr(e);return t!==null&&qr.has(t)}function Xr(e){let t=Jr(e);return t===null?null:qr.get(t)??null}var Zr=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function Qr(e){Zr.lastIndex=0;let t=e.match(Zr);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=Xr(e);if(t===null)return null;n+=t}return n}var $r=()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else n!==void 0&&n()}},ei=/[\uD800-\uDBFF]/,ti=/[\uDC00-\uDFFF]/,ni=(e,t)=>{let n=0,r=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(n>0&&ei.test(e[n-1])&&n--;r+n<e.length&&r+n<t.length&&e[e.length-r-1]===t[t.length-r-1];)r++;return r>0&&ti.test(e[e.length-r])&&r--,{index:n,remove:e.length-n-r,insert:t.slice(n,t.length-r)}},ri=(e,t)=>e>>>t|e<<32-t,ii=e=>ri(e,2)^ri(e,13)^ri(e,22),ai=e=>ri(e,6)^ri(e,11)^ri(e,25),oi=e=>ri(e,7)^ri(e,18)^e>>>3,si=e=>ri(e,17)^ri(e,19)^e>>>10,ci=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),li=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ui=class{constructor(){let e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(li),this._W=new Uint32Array(e,64,64)}_updateHash(){let e=this._H,t=this._W;for(let e=16;e<64;e++)t[e]=si(t[e-2])+t[e-7]+oi(t[e-15])+t[e-16];let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7];for(let e=0,u,d;e<64;e++)u=l+ai(o)+(o&s^~o&c)+ci[e]+t[e]>>>0,d=ii(n)+(n&r^n&i^r&i)>>>0,l=c,c=s,s=o,o=a+u>>>0,a=i,i=r,r=n,n=u+d>>>0;e[0]+=n,e[1]+=r,e[2]+=i,e[3]+=a,e[4]+=o,e[5]+=s,e[6]+=c,e[7]+=l}digest(e){let t=0;for(;t+56<=e.length;){let n=0;for(;n<16&&t+3<e.length;n++)this._W[n]=e[t++]<<24|e[t++]<<16|e[t++]<<8|e[t++];if(t%64!=0){for(this._W.fill(0,n,16);t<e.length;)this._W[n]|=e[t]<<(3-t%4)*8,t++;this._W[n]|=128<<(3-t%4)*8}this._updateHash()}let n=t%64!=0;this._W.fill(0,0,16);let r=0;for(;t<e.length;r++)for(let n=3;n>=0&&t<e.length;n--)this._W[r]|=e[t++]<<n*8;n||(this._W[r-(t%4==0?0:1)]|=128<<(3-t%4)*8),this._W[14]=e.byteLength/Pt,this._W[15]=e.byteLength*8,this._updateHash();let i=new Uint8Array(32);for(let e=0;e<this._H.length;e++)for(let t=0;t<4;t++)i[e*4+t]=this._H[e]>>>(3-t)*8;return i}},di=e=>new ui().digest(e),U=new k(`y-sync`),fi=new k(`y-undo`),pi=new k(`yjs-cursor`),mi=e=>{for(let t=6;t<e.length;t++)e[t%6]=e[t%6]^e[t];return e.slice(0,6)},hi=e=>Lt(mi(di(Et(e)))),gi=()=>({mapping:new Map,isOMark:new Map}),_i=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&t.sv.get(e.id.client)>e.id.clock&&!Ct(t.ds,e.id),vi=[{light:`#ecd44433`,dark:`#ecd444`}],yi=(e,t,n)=>{if(!e.has(n)){if(e.size<t.length){let n=en();e.forEach(e=>n.add(e)),t=t.filter(e=>!n.has(e))}e.set(n,Ot(t))}return e.get(n)},bi=(e,{colors:t=vi,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:i=()=>{},mapping:a}={})=>{let o=!1,s=new wi(e,a),c=new M({props:{editable:e=>{let t=U.getState(e);return t.snapshot==null&&t.prevSnapshot==null}},key:U,state:{init:(i,a)=>({type:e,doc:e.doc,binding:s,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:t,colorMapping:n,permanentUserData:r}),apply:(e,t)=>{let n=e.getMeta(U);if(n!==void 0){t=Object.assign({},t);for(let e in n)t[e]=n[e]}return t.addToHistory=e.getMeta(`addToHistory`)!==!1,t.isChangeOrigin=n!==void 0&&!!n.isChangeOrigin,t.isUndoRedoOperation=n!==void 0&&!!n.isChangeOrigin&&!!n.isUndoRedoOperation,s.prosemirrorView!==null&&n!==void 0&&(n.snapshot!=null||n.prevSnapshot!=null)&&At(0,()=>{s.prosemirrorView!=null&&(n.restore==null?s._renderSnapshot(n.snapshot,n.prevSnapshot,t):(s._renderSnapshot(n.snapshot,n.snapshot,t),delete t.restore,delete t.snapshot,delete t.prevSnapshot,s.mux(()=>{s._prosemirrorChanged(s.prosemirrorView.state.doc)})))}),t}},view:e=>(s.initView(e),a??s._forceRerender(),i(),{update:()=>{let t=c.getState(e.state);if(t.snapshot==null&&t.prevSnapshot==null&&(o||e.state.doc.content.findDiffStart(e.state.doc.type.createAndFill().content)!==null)){if(o=!0,t.addToHistory===!1&&!t.isChangeOrigin){let t=fi.getState(e.state),n=t&&t.undoManager;n&&n.stopCapturing()}s.mux(()=>{t.doc.transact(n=>{n.meta.set(`addToHistory`,t.addToHistory),s._prosemirrorChanged(e.state.doc)},U)})}},destroy:()=>{s.destroy()}})});return c},xi=(e,t,n)=>{if(t!==null&&t.anchor!==null&&t.head!==null)if(t.type===`all`)e.setSelection(new ke(e.doc));else if(t.type===`node`){let r=na(n.doc,n.type,t.anchor,n.mapping);e.setSelection(Si(e,r))}else{let r=na(n.doc,n.type,t.anchor,n.mapping),i=na(n.doc,n.type,t.head,n.mapping);r!==null&&i!==null&&e.setSelection(j.between(e.doc.resolve(r),e.doc.resolve(i)))}},Si=(e,t)=>{let n=e.doc.resolve(t);return n.nodeAfter?Pe.create(e.doc,t):j.near(n)},Ci=(e,t)=>({type:t.selection.jsonID,anchor:ea(t.selection.anchor,e.type,e.mapping),head:ea(t.selection.head,e.type,e.mapping)}),wi=class{constructor(e,t=new Map){this.type=e,this.prosemirrorView=null,this.mux=$r(),this.mapping=t,this.isOMark=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&this.prosemirrorView!=null&&(this.beforeTransactionSelection=Ci(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta(`addToHistory`,!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(Rt&&this._domSelectionInView===null&&(At(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){let e=this.prosemirrorView._root.getSelection();if(e==null||e.anchorNode==null)return!1;let t=this.prosemirrorView._root.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset),t.getClientRects().length===0&&t.startContainer&&t.collapsed&&t.selectNodeContents(t.startContainer);let n=t.getBoundingClientRect(),r=Ft.documentElement;return n.bottom>=0&&n.right>=0&&n.left<=(window.innerWidth||r.clientWidth||0)&&n.top<=(window.innerHeight||r.clientHeight||0)}renderSnapshot(e,t){t||=cn(Ut(),new Map),this.prosemirrorView.dispatch(this._tr.setMeta(U,{snapshot:e,prevSnapshot:t}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{let e=this.type.toArray().map(e=>Ei(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),t=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new A(I.from(e),0,0));t.setMeta(U,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(t)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{let e=this.beforeTransactionSelection===null?this.prosemirrorView.state.selection:null,t=this.type.toArray().map(e=>Ei(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new A(I.from(t),0,0));if(e){let t=Kt(St(e.anchor,0),n.doc.content.size),r=Kt(St(e.head,0),n.doc.content.size);n.setSelection(j.create(n.doc,t,r))}this.prosemirrorView.dispatch(n.setMeta(U,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,t,n){let r=this.doc,i=this.type;if(e||=Nt(this.doc),e instanceof Uint8Array||t instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(t instanceof Uint8Array))&&Bt(),r=new Wt({gc:!1}),Vt(r,t),t=Nt(r),Vt(r,e),e=Nt(r),i._item===null){let e=Array.from(this.doc.share.keys()).find(e=>this.doc.share.get(e)===this.type);i=r.getXmlFragment(e)}else{let e=r.store.clients.get(i._item.id.client)??[];i=e[Mt(e,i._item.id.clock)].content.type}this.mapping.clear(),this.mux(()=>{r.transact(r=>{let a=n.permanentUserData;a&&a.dss.forEach(e=>{jt(r,e,e=>{})});let o=(e,t)=>{let r=e===`added`?a.getUserByClientId(t.client):a.getUserByDeletedId(t);return{user:r,type:e,color:yi(n.colorMapping,n.colors,r)}},s=Dt(i,new Gt(t.ds,e.sv)).map(n=>!n._item.deleted||_i(n._item,e)||_i(n._item,t)?Ei(n,this.prosemirrorView.state.schema,{mapping:new Map,isOMark:new Map},e,t,o):null).filter(e=>e!==null),c=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new A(I.from(s),0,0));this.prosemirrorView.dispatch(c.setMeta(U,{isChangeOrigin:!0}))},U)})}_typeChanged(e,t){if(this.prosemirrorView==null)return;let n=U.getState(this.prosemirrorView.state);if(e.length===0||n.snapshot!=null||n.prevSnapshot!=null){this.renderSnapshot(n.snapshot,n.prevSnapshot);return}this.mux(()=>{let e=(e,t)=>this.mapping.delete(t);jt(t,t.deleteSet,e=>{if(e.constructor===Qt){let t=e.content.type;t&&this.mapping.delete(t)}}),t.changed.forEach(e),t.changedParentTypes.forEach(e);let n=this.type.toArray().map(e=>Ti(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),r=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new A(I.from(n),0,0));xi(r,this.beforeTransactionSelection,this),r=r.setMeta(U,{isChangeOrigin:!0,isUndoRedoOperation:t.origin instanceof qt}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&r.scrollIntoView(),this.prosemirrorView.dispatch(r)})}_prosemirrorChanged(e){this.doc.transact(()=>{qi(this.doc,this.type,e,this),this.beforeTransactionSelection=Ci(this,this.prosemirrorView.state)},U)}initView(e){this.prosemirrorView!=null&&this.destroy(),this.prosemirrorView=e,this.doc.on(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.on(`afterAllTransactions`,this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){this.prosemirrorView!=null&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.off(`afterAllTransactions`,this.afterAllTransactions))}},Ti=(e,t,n,r,i,a)=>{let o=n.mapping.get(e);if(o===void 0){if(e instanceof $t)return Ei(e,t,n,r,i,a);throw zt()}return o},Ei=(e,t,n,r,i,a)=>{let o=[],s=e=>{if(e instanceof $t){let s=Ti(e,t,n,r,i,a);s!==null&&o.push(s)}else{let s=e._item.right?.content?.type;s instanceof nn&&!s._item.deleted&&s._item.id.client===s.doc.clientID&&(e.applyDelta([{retain:e.length},...s.toDelta()]),s.doc.transact(e=>{s._item.delete(e)}));let c=Di(e,t,n,r,i,a);c!==null&&c.forEach(e=>{e!==null&&o.push(e)})}};r===void 0||i===void 0?e.toArray().forEach(s):Dt(e,new Gt(i.ds,r.sv)).forEach(s);try{let s=e.getAttributes(r);r!==void 0&&(_i(e._item,r)?_i(e._item,i)||(s.ychange=a?a(`added`,e._item.id):{type:`added`}):s.ychange=a?a(`removed`,e._item.id):{type:`removed`});let c=Ii(s),l=Gi(c.marks,t),u=t.node(e.nodeName,c.plain,o,l.length?l:void 0);return n.mapping.set(e,u),u}catch(r){console.warn(`[y-prosemirror] schema.node(`+e.nodeName+`) threw:`,String(r&&r.message||r));let i=globalThis.__okYpsCounters=globalThis.__okYpsCounters||{block:0,inline:0};if(t.nodes[e.nodeName]&&t.nodes[e.nodeName].spec&&t.nodes[e.nodeName].spec.inline)i.inline++;else if(i.block++,t.nodes.rawMdxFallback)try{let i=t.node(`rawMdxFallback`,{reason:String(r&&r.message||r)},[t.text(e.nodeName)]);return n.mapping.set(e,i),i}catch(e){console.warn(`[y-prosemirror] rawMdxFallback substitution also failed:`,String(e&&e.message||e))}return n.mapping.delete(e),null}},Di=(e,t,n,r,i,a)=>{let o=[],s=e.toDelta(r,i,a);try{for(let e=0;e<s.length;e++){let n=s[e];o.push(t.text(n.insert,Gi(n.attributes,t)))}}catch(e){console.warn(`[y-prosemirror] schema.text() threw:`,String(e&&e.message||e));let t=globalThis.__okYpsCounters=globalThis.__okYpsCounters||{block:0,inline:0};return t.inline++,null}return o},Oi=(e,t)=>{let n=new Jt,r=e.map(e=>({insert:e.text,attributes:Ki(e.marks,t)}));return n.applyDelta(r),t.mapping.set(n,e),n},ki=(e,t)=>{let n=new $t(e.type.name);for(let t in e.attrs){let r=e.attrs[t];r!==null&&t!==`ychange`&&n.setAttribute(t,r)}let r=Ki(e.marks||[],t);for(let e in r)n.setAttribute(Fi+e,{...r[e]});return n.insert(0,Ni(e).map(e=>Ai(e,t))),t.mapping.set(n,e),n},Ai=(e,t)=>e instanceof Array?Oi(e,t):ki(e,t),ji=e=>typeof e==`object`&&!!e,Mi=(e,t)=>{let n=Object.keys(e).filter(t=>e[t]!==null),r=n.length===Object.keys(t).filter(e=>t[e]!==null).length;for(let i=0;i<n.length&&r;i++){let a=n[i],o=e[a],s=t[a];r=a===`ychange`||o===s||ji(o)&&ji(s)&&Mi(o,s)}return r},Ni=e=>{let t=e.content.content,n=[];for(let e=0;e<t.length;e++){let r=t[e];if(r.isText){let r=[];for(let n=t[e];e<t.length&&n.isText;n=t[++e])r.push(n);e--,n.push(r)}else n.push(r)}return n},Pi=(e,t)=>{let n=e.toDelta();return n.length===t.length&&n.every((e,n)=>e.insert===t[n].text&&kt(e.attributes||{}).length===t[n].marks.length&&Tt(e.attributes,(e,r)=>{let i=Wi(r),a=t[n].marks;return a.find(e=>e.type.name===i)?Mi(e,a.find(e=>e.type.name===i)?.attrs):!1}))},Fi=`ymark:`,Ii=e=>{let t={},n={};for(let r in e)r.startsWith(Fi)?n[r.slice(6)]=e[r]:t[r]=e[r];return{plain:t,marks:n}},Li=(e,t)=>{let n=Object.keys(e);return n.length===t.length?n.every(n=>{let r=Wi(n),i=t.find(e=>e.type.name===r);return i?Mi(e[n],i.attrs):!1}):!1},Ri=(e,t)=>{if(e instanceof $t&&!(t instanceof Array)&&Ji(e,t)){let n=Ni(t),r=Ii(e.getAttributes());return e._length===n.length&&Li(r.marks,t.marks)&&Mi(r.plain,t.attrs)&&e.toArray().every((e,t)=>Ri(e,n[t]))}return e instanceof Jt&&t instanceof Array&&Pi(e,t)},zi=(e,t)=>e===t||e instanceof Array&&t instanceof Array&&e.length===t.length&&e.every((e,n)=>t[n]===e),Bi=(e,t,n)=>{let r=e.toArray(),i=Ni(t),a=i.length,o=r.length,s=Kt(o,a),c=0,l=0,u=!1;for(;c<s;c++){let e=r[c],t=i[c];if(zi(n.mapping.get(e),t))u=!0;else if(!Ri(e,t))break}for(;c+l<s;l++){let e=r[o-l-1],t=i[a-l-1];if(zi(n.mapping.get(e),t))u=!0;else if(!Ri(e,t))break}return{equalityFactor:c+l,foundMappedChild:u}},Vi=e=>{let t=``,n=e._start,r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof tn?t+=n.content.str:n.content instanceof Ht&&(r[n.content.key]=null)),n=n.right;return{str:t,nAttrs:r}},Hi=(e,t,n)=>{n.mapping.set(e,t);let{nAttrs:r,str:i}=Vi(e),a=t.map(e=>({insert:e.text,attributes:Object.assign({},r,Ki(e.marks,n))})),{insert:o,remove:s,index:c}=ni(i,a.map(e=>e.insert).join(``));e.delete(c,s),e.insert(c,o),e.applyDelta(a.map(e=>({retain:e.insert.length,attributes:e.attributes})))},Ui=/(.*)(--[a-zA-Z0-9+/=]{8})$/,Wi=e=>Ui.exec(e)?.[1]??e,Gi=(e,t)=>{let n=[];for(let r in e)n.push(t.mark(Wi(r),e[r]));return n},Ki=(e,t)=>{let n={};return e.forEach(e=>{if(e.type.name!==`ychange`){let r=Yt(t.isOMark,e.type,()=>!e.type.excludes(e.type));n[r?`${e.type.name}--${hi(e.toJSON())}`:e.type.name]=e.attrs}}),n},qi=(e,t,n,r)=>{if(t instanceof $t&&t.nodeName!==n.type.name)throw Error(`node name mismatch!`);if(r.mapping.set(t,n),t instanceof $t){let e=t.getAttributes(),i=n.attrs;for(let n in i)i[n]===null?t.removeAttribute(n):e[n]!==i[n]&&n!==`ychange`&&t.setAttribute(n,i[n]);for(let n in e)i[n]===void 0&&!n.startsWith(Fi)&&t.removeAttribute(n);let a=Ki(n.marks||[],r);for(let n in a){let r=e[Fi+n];(r===void 0||!Mi(r,a[n]))&&t.setAttribute(Fi+n,{...a[n]})}for(let n in e)n.startsWith(Fi)&&a[n.slice(6)]===void 0&&t.removeAttribute(n)}let i=Ni(n),a=i.length,o=t.toArray(),s=o.length,c=Kt(a,s),l=0,u=0;for(;l<c;l++){let e=o[l],t=i[l];if(!zi(r.mapping.get(e),t))if(Ri(e,t))r.mapping.set(e,t);else break}for(;u+l+1<c;u++){let e=o[s-u-1],t=i[a-u-1];if(!zi(r.mapping.get(e),t))if(Ri(e,t))r.mapping.set(e,t);else break}e.transact(()=>{for(;s-l-u>0&&a-l-u>0;){let n=o[l],c=i[l],d=o[s-u-1],f=i[a-u-1];if(n instanceof Jt&&c instanceof Array)Pi(n,c)||Hi(n,c,r),l+=1;else{let i=n instanceof $t&&Ji(n,c),a=d instanceof $t&&Ji(d,f);if(i&&a){let e=Bi(n,c,r),t=Bi(d,f,r);e.foundMappedChild&&!t.foundMappedChild?a=!1:!e.foundMappedChild&&t.foundMappedChild||e.equalityFactor<t.equalityFactor?i=!1:a=!1}i?(qi(e,n,c,r),l+=1):a?(qi(e,d,f,r),u+=1):(r.mapping.delete(t.get(l)),t.delete(l,1),t.insert(l,[Ai(c,r)]),l+=1)}}let n=s-l-u;if(s===1&&a===0&&o[0]instanceof Jt?(r.mapping.delete(o[0]),o[0].delete(0,o[0].length)):n>0&&(t.slice(l,l+n).forEach(e=>r.mapping.delete(e)),t.delete(l,n)),l+u<a){let e=[];for(let t=l;t<a-u;t++)e.push(Ai(i[t],r));t.insert(l,e)}},U)},Ji=(e,t)=>!(t instanceof Array)&&e.nodeName===t.type.name,Yi=null,Xi=class{constructor(e,t,n){this.view=e,this.key=t,this.value=n}apply(){let e=U.getState(this.view.state);if(e&&e.binding&&!e.binding.isDestroyed){let e=this.view.state.tr;e.setMeta(this.key,this.value),this.view.dispatch(e)}}},Zi=class e{constructor(e=[]){this.entries=e}getFirst(){return this.entries[0]}dequeueFirst(){return this.entries.shift()}isEmpty(){return this.entries.length===0}static fromViewsToUpdate(){let t=Yi;Yi=null;let n=[];return t.forEach((e,t)=>{e.forEach((e,r)=>{n.push(new Xi(t,r,e))})}),new e(n)}},Qi=(e=Zi.fromViewsToUpdate(),t=!1)=>{let n=!0;for(;!e.isEmpty();){let r=e.getFirst();try{r.apply()}catch(r){if(r instanceof RangeError){t&&n&&e.dequeueFirst(),e.isEmpty()||At(0,()=>Qi(e,!0));return}throw r}n=!1,e.dequeueFirst()}},$i=(e,t,n)=>{Yi||(Yi=new Map,At(0,Qi)),Yt(Yi,e,rn).set(t,n)},ea=(e,t,n)=>{if(e===0)return wt(t,0,-1);let r=t._first===null?null:t._first.content.type;for(;r!==null&&t!==r;){if(r instanceof Jt){if(r._length>=e)return wt(r,e,-1);if(e-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,e--;while(r!==t&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==t&&(r=r._item===null?null:r._item.next.content.type)}}else{let i=(n.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&e<i)r=r._first.content.type,e--;else{if(e===1&&r._length===0&&i>1)return new on(r._item===null?null:r._item.id,r._item===null?Zt(r):null,null);if(e-=i,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(e===0)return r=r._item===null?r:r._item.parent,new on(r._item===null?null:r._item.id,r._item===null?Zt(r):null,null);do r=r._item.parent,e--;while(r!==t&&r._item.next===null);r!==t&&(r=r._item.next.content.type)}}}if(r===null)throw Bt();if(e===0&&r.constructor!==Jt&&r!==t)return ta(r._item.parent,r._item)}return wt(t,t._length,-1)},ta=(e,t)=>{let n=null,r=null;return e._item===null?r=Zt(e):n=ln(e._item.id.client,e._item.id.clock),new on(n,r,t.id)},na=(e,t,n,r)=>{let i=un(n,e);if(i===null||i.type!==t&&!Xt(t,i.type._item))return null;let a=i.type,o=0;if(a.constructor===Jt)o=i.index;else if(a._item===null||!a._item.deleted){let e=a._first,t=0;for(;t<a._length&&t<i.index&&e!==null;){if(!e.deleted){let n=e.content.type;if(t++,n instanceof Jt)o+=n._length;else{let e=r.get(n);if(e==null)return null;o+=e.nodeSize}}e=e.right}o+=1}for(;a!==t&&a._item!==null;){let e=a._item.parent;if(e._item===null||!e._item.deleted){o+=1;let t=e._first;for(;t!==null;){let e=t.content.type;if(e===a)break;if(!t.deleted)if(e instanceof Jt)o+=e._length;else{let t=r.get(e);if(t==null)return null;o+=t.nodeSize}t=t.right}}a=e}return o-1},ra=(e,t)=>{let n=e.toArray().map(e=>Ei(e,t,gi())).filter(e=>e!==null);return I.fromArray(n)},ia=(e,t)=>t.topNodeType.create(null,ra(e,t)),aa=(e,t)=>{let n=gi(),r=e.toArray().map(e=>Ei(e,t,n)).filter(e=>e!==null);return{doc:t.topNodeType.create(null,I.fromArray(r)),meta:n,mapping:n.mapping}},oa=(e,t,n)=>e!==t,sa=e=>{let t=document.createElement(`span`);t.classList.add(`ProseMirror-yjs-cursor`),t.setAttribute(`style`,`border-color: ${e.color}`);let n=document.createElement(`div`);n.setAttribute(`style`,`background-color: ${e.color}`),n.insertBefore(document.createTextNode(e.name),null);let r=document.createTextNode(`⁠`),i=document.createTextNode(`⁠`);return t.insertBefore(r,null),t.insertBefore(n,null),t.insertBefore(i,null),t},ca=e=>({style:`background-color: ${e.color}70`,class:`ProseMirror-yjs-selection`}),la=/^#[0-9a-fA-F]{6}$/,ua=(e,t,n,r,i)=>{let a=U.getState(e);if(a==null||a.doc==null||a.binding==null)return me.create(e.doc,[]);let o=a.doc,s=[];return a.snapshot!=null||a.prevSnapshot!=null||a.binding.mapping.size===0?me.create(e.doc,[]):(t.getStates().forEach((t,c)=>{if(n(o.clientID,c,t)&&t.cursor!=null){let n=t.user||{};n.color==null?n.color=`#ffa500`:la.test(n.color)||console.warn(`A user uses an unsupported color format`,n),n.name??=`User: ${c}`;let l=na(o,a.type,It(t.cursor.anchor),a.binding.mapping),u=na(o,a.type,It(t.cursor.head),a.binding.mapping);if(l!==null&&u!==null){let t=St(e.doc.content.size-1,0);l=Kt(l,t),u=Kt(u,t),s.push(he.widget(u,()=>r(n,c),{key:c+``,side:10}));let a=Kt(l,u),o=St(l,u);s.push(he.inline(a,o,i(n,c),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),me.create(e.doc,s))},da=(e,{awarenessStateFilter:t=oa,cursorBuilder:n=sa,selectionBuilder:r=ca,getSelection:i=e=>e.selection}={},a=`cursor`)=>new M({key:pi,state:{init(i,a){return ua(a,e,t,n,r)},apply(i,a,o,s){let c=U.getState(s),l=i.getMeta(pi);return c&&c.isChangeOrigin||l&&l.awarenessUpdated?ua(s,e,t,n,r):a.map(i.mapping,i.doc)}},props:{decorations:e=>pi.getState(e)},view:t=>{let n=()=>{t.docView&&$i(t,pi,{awarenessUpdated:!0})},r=()=>{let n=U.getState(t.state),r=e.getLocalState()||{};if(t.hasFocus()){let o=i(t.state),s=ea(o.anchor,n.type,n.binding.mapping),c=ea(o.head,n.type,n.binding.mapping);(r.cursor==null||!sn(It(r.cursor.anchor),s)||!sn(It(r.cursor.head),c))&&e.setLocalStateField(a,{anchor:s,head:c})}else r.cursor!=null&&na(n.doc,n.type,It(r.cursor.anchor),n.binding.mapping)!==null&&e.setLocalStateField(a,null)};return e.on(`change`,n),t.dom.addEventListener(`focusin`,r),t.dom.addEventListener(`focusout`,r),{update:r,destroy:()=>{t.dom.removeEventListener(`focusin`,r),t.dom.removeEventListener(`focusout`,r),e.off(`change`,n),e.setLocalStateField(a,null)}}}}),fa=e=>{let t=fi.getState(e).undoManager;if(t!=null)return t.undo(),!0},pa=e=>{let t=fi.getState(e).undoManager;if(t!=null)return t.redo(),!0},ma=new Set([`paragraph`]),ha=(e,t)=>!(e instanceof Qt)||!(e.content instanceof an)||!(e.content.type instanceof nn||e.content.type instanceof $t&&t.has(e.content.type.nodeName))||e.content.type._length===0,ga=({protectedNodes:e=ma,trackedOrigins:t=[],undoManager:n=null}={})=>new M({key:fi,state:{init:(r,i)=>{let a=U.getState(i),o=n||new qt(a.type,{trackedOrigins:new Set([U].concat(t)),deleteFilter:t=>ha(t,e),captureTransaction:e=>e.meta.get(`addToHistory`)!==!1});return{undoManager:o,prevSel:null,hasUndoOps:o.undoStack.length>0,hasRedoOps:o.redoStack.length>0}},apply:(e,t,n,r)=>{let i=U.getState(r).binding,a=t.undoManager,o=a.undoStack.length>0,s=a.redoStack.length>0;return i?{undoManager:a,prevSel:Ci(i,n),hasUndoOps:o,hasRedoOps:s}:o!==t.hasUndoOps||s!==t.hasRedoOps?Object.assign({},t,{hasUndoOps:a.undoStack.length>0,hasRedoOps:a.redoStack.length>0}):t}},view:e=>{let t=U.getState(e.state),n=fi.getState(e.state).undoManager;return n.on(`stack-item-added`,({stackItem:n})=>{let r=t.binding;r&&n.meta.set(r,fi.getState(e.state).prevSel)}),n.on(`stack-item-popped`,({stackItem:e})=>{let n=t.binding;n&&(n.beforeTransactionSelection=e.meta.get(n)||n.beforeTransactionSelection)}),{destroy:()=>{n.destroy()}}}}),_a=new Map,va=new Set;function ya(){for(let e of va)e()}function ba(e,t,n){_a.set(e,{view:t,host:n}),ya()}function xa(e,t){_a.get(e)?.view===t&&(_a.delete(e),ya())}function Sa(e){let t=_a.get(e);return t?.host===`sourceEditor`?t.view:null}function Ca(e){return _a.get(e)??null}function wa(e){return va.add(e),()=>{va.delete(e)}}var Ta=new WeakMap,Ea=new WeakMap;function Da(e,t){Ta.set(e,t)}function Oa(e){return Ta.get(e)??!1}function ka(e,t){Ea.set(e,t)}function Aa(e){return Ea.get(e)??!1}function ja(e){return!Oa(e)}var Ma=`autonomousFragmentEdit/swap`;function Na(e){return e.setMeta(Ma,!0)}function Pa(e,t,n){return n===t.textContent?Na(e):e}function Fa(e){return e.getMeta(Ma)===!0}function Ia(e){return!e.getMeta(U)&&!Fa(e)}var La=/^[A-Za-z0-9]{20,}$/,Ra=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function za(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function Ba(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return La.test(n)?n:null}function Va(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!za(t.hostname))return null;let n=Ba(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&Ra.test(r)?r:null}}function Ha(e){return Va(e)!==null}function Ua(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function Wa(e){if(typeof e!=`string`||e.length===0)return!1;let t;try{t=new URL(e)}catch{return!1}return t.protocol!==`http:`&&t.protocol!==`https:`?!1:Ua(t.hostname)}var Ga=/^[A-Za-z0-9_-]{11}$/;function Ka(e){let t=e.toLowerCase();return t===`youtube.com`||t===`www.youtube.com`||t===`m.youtube.com`||t===`music.youtube.com`||t===`youtu.be`||t===`youtube-nocookie.com`||t===`www.youtube-nocookie.com`}function qa(e){if(e.length===0)return null;if(/^[0-9]+$/.test(e)){let t=Number.parseInt(e,10);return t>0?t:null}let t=e.match(/^(?:([0-9]+)h)?(?:([0-9]+)m)?(?:([0-9]+)s?)?$/);if(!t)return null;let n=t[1]?Number.parseInt(t[1],10):0,r=t[2]?Number.parseInt(t[2],10):0,i=t[3]?Number.parseInt(t[3],10):0,a=n*3600+r*60+i;return a>0?a:null}function Ja(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return Ga.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return Ga.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function Ya(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!Ka(t.hostname))return null;let n=Ja(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?qa(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}function Xa(e,t){let n=Array.isArray(e.attrs.attributes)?e.attrs.attributes.filter(e=>typeof e==`object`&&!!e&&`type`in e):[],r=e.attrs.props??{},i=new Map,a=new Set;if(t)for(let e of t)e.omitOnDefault===!0&&`defaultValue`in e&&e.defaultValue!==void 0&&i.set(e.name,e.defaultValue),e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&a.add(e.name);for(let[e,t]of Object.entries(r)){let r=n.findIndex(t=>t.type===`mdxJsxAttribute`&&t.name===e);if(i.has(e)&&Object.is(i.get(e),t)){r>=0&&n.splice(r,1);continue}if(a.has(e)&&t===``){r>=0&&n.splice(r,1);continue}if(r>=0){let e=n[r];if(e.type===`mdxJsxAttribute`&&e.value!=null&&typeof e.value==`object`&&e.value.type===`mdxJsxAttributeValueExpression`&&Za(e.value.value,t))continue}let o=Qa(e,t);r>=0?n[r]=o:n.push(o)}return n}function Za(e,t){try{return JSON.stringify(JSON.parse(e))===JSON.stringify(t)}catch{return!1}}function Qa(e,t){if(t===!0)return{type:`mdxJsxAttribute`,name:e,value:null};if(t===!1)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}};if(t==null)return{type:`mdxJsxAttribute`,name:e,value:null};if(typeof t==`string`)return{type:`mdxJsxAttribute`,name:e,value:t};if(typeof t==`number`)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:JSON.stringify(t)}};if(typeof t==`object`){let n;try{n=JSON.stringify(t)}catch{n=String(t)}return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:n}}}return{type:`mdxJsxAttribute`,name:e,value:String(t)}}function $a(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:Xa(t,r),children:n.all(t),data:{}}}function eo(e,t,n){let r=t.attrs.props?.children;return{type:`mdxJsxTextElement`,name:e,attributes:Xa(t,n),children:typeof r==`string`&&r!==``?[{type:`text`,value:r}]:[],data:{}}}var to=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`],defaultValue:`note`,required:!1,description:`Callout variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)",iconPicker:!0},{name:`color`,type:`string`,required:!1,advanced:!0,description:"Optional accent color override (hex — e.g. `#F05032`)",colorPicker:!0},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,advanced:!0,description:"Render as a foldable `<details>` (Obsidian `[!TYPE]+/-`)"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,description:`When collapsible, start in the open state`,hideWhen:e=>e.collapsible!==!0},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],no=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:x,autoFocus:!0},{name:`alt`,type:`string`,required:!0,description:`Alt text`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Image width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Image height`},{name:`srcset`,type:`string`,required:!1,advanced:!0,description:`Responsive image candidate set (e.g. "x.png 1x, y.png 2x")`},{name:`sizes`,type:`string`,required:!1,advanced:!0,description:`Responsive image sizes hint paired with srcset`},{name:`loading`,type:`enum`,enumValues:[`eager`,`lazy`],defaultValue:`lazy`,required:!1,advanced:!0,omitOnDefault:!0,description:`Native img loading strategy (defaults to lazy)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`decoding`,type:`enum`,enumValues:[`sync`,`async`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Hint for how the browser should decode the image`},{name:`fetchpriority`,type:`enum`,enumValues:[`high`,`low`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Resource fetch priority hint`},{name:`crossorigin`,type:`enum`,enumValues:[`anonymous`,`use-credentials`],required:!1,advanced:!0,description:`CORS mode for the image fetch`},{name:`referrerpolicy`,type:`string`,required:!1,advanced:!0,description:`Referrer policy for the image fetch (HTML referrerpolicy values)`},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],ro=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Embedded page URL (must start with http:// or https://)`,autoFocus:!0},{name:`title`,type:`string`,required:!1,description:`Iframe title (accessible label for screen readers)`},{name:`width`,type:`string`,required:!1,advanced:!0,description:`Embed width as a CSS length (e.g. "100%", "640px")`,cssLengthInput:!0},{name:`height`,type:`string`,required:!1,advanced:!0,description:`Embed height as a CSS length (e.g. "26rem", "480px")`,cssLengthInput:!0},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],io=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:y,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 video controls (defaults to true)`,hideWhen:e=>typeof e.src==`string`&&(Wa(e.src)||Ha(e.src))},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`poster`,type:`string`,required:!1,advanced:!0,description:`Poster image URL shown before playback`,accept:x,hideWhen:e=>typeof e.src==`string`&&(Wa(e.src)||Ha(e.src))},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Video width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Video height`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`,hideWhen:e=>typeof e.src==`string`&&Ha(e.src)},{name:`playsinline`,type:`boolean`,required:!1,advanced:!0,description:`Play inline on iOS rather than entering fullscreen`,hideWhen:e=>typeof e.src==`string`&&(Wa(e.src)||Ha(e.src))},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the video to preload`,hideWhen:e=>typeof e.src==`string`&&(Ya(e.src)!==null||Wa(e.src)||Ha(e.src))},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],ao=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:w,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 audio controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the audio to preload`}],oo=[{name:`title`,type:`string`,required:!0,description:`Heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the block renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Rocket`)",iconPicker:!0},{name:`description`,type:`string`,required:!1,advanced:!0,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,advanced:!0,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],so=[to[0],to[1],to[4],to[5],to[6]],co=[no[0],no[1],no[7]],lo=[oo[0],oo[1],oo[4],oo[5]],uo=[{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`,`justify`],required:!1,defaultValue:`center`,description:"Block alignment from the `<div align>` attribute."},{name:`tag`,type:`string`,required:!1,defaultValue:`div`,hidden:!0,description:`Source wrapper tag (div or center).`},{name:`sourceAttrs`,type:`string`,required:!1,defaultValue:``,hidden:!0,description:`Raw opener-tag attribute bytes preserved for round-trip.`}],fo=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],po=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],mo=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],ho=[{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#install-tabs`)"}],go=[{name:`label`,type:`string`,required:!0,autoFocus:!0,defaultValue:`Tab`,description:`Tab strip label — shown in the clickable pill at the top`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#tab-npm`)"}],_o=[{name:`formula`,type:`string`,required:!0,autoFocus:!0,language:`latex`,description:`LaTeX math source (rendered with KaTeX in the browser)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#eq-pythagoras`)"},{name:`language`,type:`string`,required:!1,advanced:!0,description:"Forward-compat hint for the math source language (default `latex`). Reserved for future MathJax / Typst / AsciiMath substrates."}],vo=[_o[0]],yo=[_o[0]],bo=[{name:`chart`,type:`string`,required:!0,hidden:!0,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`}],xo=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],So=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],Co=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:C,autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded PDF viewer`},{name:`anchor`,type:`string`,required:!1,advanced:!0,description:"PDF viewer parameters as a single URL-fragment string (e.g. `page=3&height=600`)"}],wo=[{name:`src`,type:`string`,required:!0,description:"Path to the `.excalidraw` board this embed renders",autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded board`}],To=[{name:`src`,type:`string`,required:!0,description:"Path of the source doc, extension-less (e.g. `api-spec`).",autoFocus:!0},{name:`anchor`,type:`string`,required:!0,description:"Id of the `<MirrorSource>` block within the source doc."}],Eo=[{name:`id`,type:`string`,required:!0,description:"Stable id agents and authors use to reference this block from `<Mirror>` elsewhere.",autoFocus:!0},{name:`children`,type:`reactnode`,required:!0,description:`Block content this MirrorSource owns — paragraphs, callouts, code, nested JSX, anything.`}];function Do(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function Oo(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function ko(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=typeof t?.sourceTarget==`string`?t.sourceTarget:null,o=typeof t?.sourceAnchor==`string`?t.sourceAnchor:null,s=typeof t?.sourceAlias==`string`?t.sourceAlias:null,c=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:c,data:{target:n,anchor:i,alias:r,sourceTarget:a,sourceAnchor:o,sourceAlias:s},children:[{type:`text`,value:c}]}}var Ao=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:to,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`Alert / admonition with 15 type variants — 5 GFM (note, tip, important, warning, caution) plus 10 Obsidian-parity (abstract, info, todo, success, question, failure, danger, bug, example, quote)`,searchTerms:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`,`alert`,`admonition`,`callout`],serialize:(e,t)=>$a(`Callout`,e,t,to)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:no,icon:`Image`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],placeholder:{label:`Add an image`},serialize:(e,t)=>$a(`img`,e,t,no)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:io,icon:`SquarePlay`,category:`media`,displayName:`Video`,description:`HTML5 video player with native controls`,searchTerms:[`video`,`media`,`player`,`mp4`,`webm`,`movie`],placeholder:{label:`Add a video`},serialize:(e,t)=>$a(`video`,e,t,io)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:ao,icon:`Volume2`,category:`media`,displayName:`Audio`,description:`HTML5 audio player with native controls`,searchTerms:[`audio`,`sound`,`music`,`mp3`,`podcast`,`player`],placeholder:{label:`Add audio`},serialize:(e,t)=>$a(`audio`,e,t,ao)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:Co,icon:`FileText`,category:`media`,displayName:`PDF`,description:"Embedded PDF viewer (`#page=N` to open at page N, `#height=N` for viewer height)",searchTerms:[`pdf`,`document`,`embed`,`pdfjs`],placeholder:{label:`Add a PDF`},serialize:(e,t)=>$a(`Pdf`,e,t,Co)},{name:`Excalidraw`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:wo,icon:`PenTool`,category:`embed`,displayName:`Excalidraw`,description:"Embedded snapshot of an `.excalidraw` board, linking to its canvas editor",searchTerms:[`excalidraw`,`board`,`whiteboard`,`sketch`,`drawing`,`canvas`],serialize:(e,t)=>$a(`Excalidraw`,e,t,wo)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:So,icon:`Paperclip`,category:`media`,displayName:`File`,description:`Downloadable file attachment — inline row with name + size + download link`,searchTerms:[`file`,`attachment`,`download`,`document`,`zip`,`docx`,`doc`],placeholder:{label:`Add a file`},serialize:(e,t)=>$a(`File`,e,t,So)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:ro,icon:`AppWindow`,category:`embed`,displayName:`Embed`,description:'Inline web embed (iframe) — drop a URL, get a resizable preview pane. For YouTube / Vimeo / Loom prefer `<video src="…">` (player props, click-facade); `<Embed>` auto-rewrites watch URLs as a fallback.',searchTerms:[`embed`,`iframe`,`website`,`page`,`inline`,`frame`,`preview`],placeholder:{label:`Embed a URL`},serialize:(e,t)=>$a(`Embed`,e,t,ro)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:oo,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],exampleBody:`Body content revealed when the accordion is expanded.`,serialize:(e,t)=>$a(`Accordion`,e,t,oo)},{name:`Toggle`,surface:`canonical`,hasChildren:!0,props:oo,icon:`ChevronRight`,category:`content`,displayName:`Toggle`,description:"Standalone expand/collapse block (Notion-style). Same render + props as `<Accordion>` — pick whichever vocabulary matches the vault.",searchTerms:[`toggle`,`collapsible`,`expand`,`details`,`disclosure`,`fold`],exampleBody:`Body content revealed when the toggle is expanded.`,serialize:(e,t)=>$a(`Toggle`,e,t,oo)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:ho,icon:`LayoutPanelTop`,category:`content`,displayName:`Tabs`,description:"Horizontal tab strip + active panel below. Each `<Tab>` child is one panel; clickable pills at the top switch the active one. Active selection is ephemeral (resets on reload).",searchTerms:[`tabs`,`tabbed`,`panels`,`tabgroup`,`switcher`],exampleBody:`<Tab label="One">Body of the first tab panel.</Tab>
3
3
  <Tab label="Two">Body of the second tab panel.</Tab>`,serialize:(e,t)=>$a(`Tabs`,e,t,ho)},{name:`Tab`,surface:`canonical`,hasChildren:!0,props:go,icon:`PanelTop`,category:`content`,displayName:`Tab`,description:"A single tab panel inside a `<Tabs>` container — carries the strip label and the block-content body.",searchTerms:[`tab`,`panel`],exampleBody:"Panel content — must be nested inside a `<Tabs>` parent.",serialize:(e,t)=>$a(`Tab`,e,t,go)},{name:`Math`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:_o,icon:`Sigma`,category:`content`,displayName:`Math`,description:`Block math equation rendered with KaTeX from a LaTeX source string`,searchTerms:[`math`,`latex`,`equation`,`formula`,`katex`,`tex`],serialize:(e,t)=>$a(`Math`,e,t,_o)},{name:`MermaidFence`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:bo,icon:`Workflow`,category:`content`,displayName:`Mermaid`,placeholder:{label:`Add a Mermaid diagram`},description:"Diagram rendered from Mermaid source (flowchart, sequence, class, state, ER, gantt, pie). Authored exclusively as ` ```mermaid ` fenced code.",searchTerms:[`mermaid`,`diagram`,`flowchart`,`graph`,`sequence`,`sequencediagram`,`class`,`state`,`er`,`erdiagram`,`gantt`,`pie`,`chart`],serialize:e=>({type:`code`,lang:`mermaid`,meta:null,value:e.attrs.props?.chart??``})},{name:`Mirror`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:To,icon:`CopyPlus`,category:`content`,displayName:`Mirror`,description:"Render a read-only copy of a `<MirrorSource>` block from another doc. Use to keep the same content in sync across multiple docs without copy-paste — edits land at the source, every Mirror reflects the change.",searchTerms:[`mirror`,`sync`,`synced`,`transclude`,`embed`,`reference`,`shared block`],serialize:(e,t)=>$a(`Mirror`,e,t,To)},{name:`MirrorSource`,surface:`canonical`,hasChildren:!0,props:Eo,icon:`GitBranch`,category:`content`,displayName:`Mirror Source`,description:'Mark a block as the source of truth for content that appears in multiple docs. Wrap any block content; `<Mirror src="…" anchor="<id>">` references render this verbatim read-only at every call-site. Edit here, propagate everywhere.',searchTerms:[`mirror source`,`sync source`,`source block`,`master block`,`shared`],exampleBody:"Authoritative content lives inside this block — edits here propagate to every `<Mirror>` that references this id.",serialize:(e,t)=>$a(`MirrorSource`,e,t,Eo)},{name:`GFMCallout`,surface:`compat`,hasChildren:!0,props:so,icon:`MessageSquareWarning`,category:`content`,displayName:`GFM Callout`,description:"GFM blockquote alert (`> [!NOTE]`) — read-only compat. Preserves `> [!NOTE]` syntax on round-trip; insert a fresh Callout block for the full prop surface.",rendersAs:`Callout`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),i=n?.type??`note`;return{type:`blockquote`,children:[{type:`html`,value:`[!${(r.has(i.toLowerCase())?i:`note`).toUpperCase()}]${n?.collapsible?n.defaultOpen===!1?`-`:`+`:``}${n?.title?` ${n.title}`:``}`},...t.all(e).filter(e=>{if(e.type!==`paragraph`)return!0;let t=e;return Array.isArray(t.children)&&t.children.length>0})]}}},{name:`CommonMarkImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:co,icon:`Image`,category:`media`,displayName:`CommonMark Image`,description:'CommonMark image (`![alt](src "title")`) — read-only compat. Preserves `![alt](src)` syntax on round-trip; insert a fresh Image block for the full HTML-native attribute surface (srcset, sizes, decoding, etc.).',rendersAs:`img`,translateProps:e=>e,serialize:e=>{let t=e.attrs.props;return{type:`paragraph`,children:[{type:`image`,url:t?.sourceUrl??t?.src??``,alt:t?.alt??``,title:t?.title??null}]}}},{name:`WikiEmbedImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:fo,icon:`ZoomIn`,category:`media`,displayName:`Wiki Embed Image`,description:"Obsidian-style `![[file.png]]` wiki-embed — read-only compat. Edit the alt-text via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`img`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,alt:t??n}},serialize:ko},{name:`WikiEmbedVideo`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:po,icon:`Film`,category:`media`,displayName:`Wiki Embed Video`,description:"Obsidian-style `![[clip.mp4]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`video`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:ko},{name:`WikiEmbedAudio`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:mo,icon:`Volume2`,category:`media`,displayName:`Wiki Embed Audio`,description:"Obsidian-style `![[song.mp3]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`audio`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:ko},{name:`WikiEmbedFile`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:xo,icon:`Paperclip`,category:`media`,displayName:`Wiki Embed File`,description:"Obsidian-style `![[file.zip]]` wiki-embed — read-only compat for arbitrary downloadable attachments. Renders through the `File` canonical (inline row with file-up icon + bold name + optional dim size). Edit the display name via the alias slot.",rendersAs:`File`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.size==`string`&&e.size.length>0?e.size:null;return{src:e.src,name:t??void 0,size:n??void 0}},serialize:ko},{name:`HtmlDetailsAccordion`,surface:`compat`,hasChildren:!0,props:lo,icon:`ChevronRight`,category:`content`,displayName:`HTML5 Details`,description:"HTML5 `<details><summary>` collapsible — read-only compat. Preserves `<details>` syntax on round-trip; insert a fresh Accordion block for icon / description / group-name props.",rendersAs:`Accordion`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=n?.defaultOpen?` open`:``,i=n?.name?` name="${Do(n.name)}"`:``,a=n?.id?` id="${Do(n.id)}"`:``,o=n?.title?.trim(),s=o?`<summary>${Oo(o)}</summary>`:``;return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<details${r}${i}${a}>\n${s}`,closer:`</details>`}}}}},{name:`HtmlAlignBlock`,surface:`canonical`,hasChildren:!0,props:uo,icon:`AlignCenter`,category:`content`,displayName:`Align block`,description:"GitHub-style `<div align>` wrapper. Children render as normal blocks with the alignment applied; the `<div align>` syntax is preserved on round-trip.",searchTerms:[`align`,`center`,`centered`,`div`],serialize:(e,t)=>{let n=e.attrs.props,r=n?.tag===`center`?`center`:`div`,i=typeof n?.align==`string`&&n.align?n.align:null,a=typeof n?.sourceAttrs==`string`?n.sourceAttrs:``,o=/(\balign\s*=\s*)(?:"[^"]*"|'[^']*'|[^\s"'<>]+)/i;return i!==null&&(r===`div`||i!==`center`)?a=o.test(a)?a.replace(o,`$1"${Do(i)}"`):`${a} align="${Do(i)}"`:(i===null||r===`center`&&i===`center`)&&(a=a.replace(RegExp(`\\s*${o.source}`,`i`),``)),{type:`mdxJsxFlowElement`,name:`HtmlAlignBlock`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<${r}${a}>`,closer:`</${r}>`}}}}},{name:`DollarMath`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:vo,icon:`Sigma`,category:`content`,displayName:`Dollar Math`,description:"Block math via `$$…$$` syntax — read-only compat. Preserves `$$…$$` form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`math`,value:e.attrs.props?.formula??``})},{name:`MathFence`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:yo,icon:`Sigma`,category:`content`,displayName:`Math Fence`,description:"Block math via ` ```math ` fenced code syntax — read-only compat. Preserves the fence form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`code`,lang:`math`,meta:null,value:e.attrs.props?.formula??``})}],jo={name:`*`,surface:`canonical`,hasChildren:!0,props:[],description:`Unregistered component — children editable as markdown`,serialize:(e,t)=>$a(e.attrs.componentName||`*`,e,t)};function Mo(){let e=new Map;e.set(`*`,jo);for(let t of Ao)e.set(t.name,t);return{get(t){return e.get(t)},getOrWildcard(t){return e.get(t)??e.get(`*`)},set(t,n){e.set(t,n)},has(t){return e.has(t)},entries(){return e.entries()}}}var No=_e.create({name:`sourceLiteral`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceRaw:{default:``}}},parseHTML(){return[{tag:`span[data-source-literal]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-source-literal":``,...e},0]}});function Po(e,t){if(typeof e!=`string`||typeof t!=`string`||/[\x00-\x1F\x7F]/.test(e))return!1;let n=e.replaceAll(`\xA0`,` `),r=t.replaceAll(`\xA0`,` `);return n===r||Fo(n)===r?!0:Qr(e)===t}function Fo(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}function Io(e,t){let{target:n,anchor:r,alias:i}=e;if(!t.separatorCrossed)return e;if(r!==null){let e=Bo(r);return{target:n,anchor:e.length>0?e:null,alias:i===null?null:Vo(i)}}return{target:Bo(n),anchor:null,alias:i===null?null:Vo(i)}}function Lo(e,t,n){let r=e.trim();return r===t?!0:n===`alias`?Vo(r)===t:Bo(r)===t}function Ro(e,t,n){return typeof e==`string`&&Lo(e,t,n)?e:t}function zo(e){return Bo(e.trim())===``}function Bo(e){return e.endsWith(`\\`)?e.slice(0,-1):e}function Vo(e){return e.replace(/\\\|/g,`|`)}function Ho(e){let t=``,n=0;for(let r of e)r===`\\`?n++:(r===`|`&&n%2==0&&(t+=`\\`),n=0),t+=r;return t}function Uo(e){return e.replace(/\|/g,`\\|`)}function Wo(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function Go(e){return e.includes("`")?`~`:"`"}function Ko(e,t,n=3){let r=RegExp(`^ {0,3}(\\${e}+)[ \\t]*$`),i=Math.max(3,n);for(let e of t.split(`
4
4
  `)){let t=r.exec(e);t&&t[1].length>=i&&(i=t[1].length+1)}return i}var qo=new Set([`break`,`delete`,`emphasis`,`footnoteReference`,`html`,`image`,`imageReference`,`inlineCode`,`link`,`linkReference`,`strong`,`text`]);function Jo(e){let t=e.children;Array.isArray(t)&&t.forEach((e,n)=>{if(e.type===`break`){t[n]={type:`html`,value:`<br />`};return}Jo(e)})}function Yo(e){let t=e.children;if(Array.isArray(t))for(let e of t)(e.type===`inlineCode`||e.type===`html`)&&(e.value.includes(`
5
5
  `)&&(e.value=e.value.replace(/[ \t]*\n[ \t]*/g,` `)),e.type===`html`&&e.value.includes(`|`)&&(e.value=Uo(e.value))),Yo(e)}function Xo(e){B(e,`tableCell`,e=>{e.children.some(e=>!qo.has(e.type))&&(e.children=Zo(e.children)),Jo(e),Yo(e)})}function Zo(e){let t=[],n=0,r=()=>{t.length>0&&(n+=1)},i=e=>{for(;n>0;)t.push({type:`break`}),--n;t.push(e)},a=e=>{e.split(`
@@ -1,2 +1,2 @@
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{n as ee,r as o,t as te}from"./collapsible-BKbszYZV.js";import{t as s}from"./button-DzgjsZzC.js";import{n as c}from"./dist-BGzUo_18.js";import{d as l}from"./constants-editors-05BNhhVl.js";import{t as u}from"./chevron-right-Bofu4lib.js";import{t as ne}from"./spinner-Bx8xD6f8.js";import{a as d,c as re,i as ie,n as f,o as p,s as m,t as h}from"./dialog-BJEjKJjL.js";import{t as g}from"./input-C-Qm8YDT.js";import{a as ae,n as oe,o as se,r as _,s as ce,t as le}from"./project-paths-B82COK8C.js";import{t as ue}from"./textarea-qPZDtk8V.js";var de=a(),v=e(n(),1),y=t(),fe=750,b=8e3,pe={root:{id:`ZWolSV`},home:{id:`_RcqUM`},"home-documents":{id:`of3tF-`},"home-desktop":{id:`vfWA_g`},"home-downloads":{id:`wlwXUk`},"volumes-mount":{id:`nMSYz5`},"drive-root":{id:`M3ytY_`}},x={error:e=>c.error(e)};function me(e){let t=(0,de.c)(10),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{store:r,toast:i,payload:a,detectionGraceMs:ee}=n,o=r===void 0?_:r,te=i===void 0?x:i,s=ee===void 0?b:ee,c;t[2]!==a||t[3]!==o?(c=a??o.getSnapshot(),t[2]=a,t[3]=o,t[4]=c):c=t[4];let l=c;if(!l)return null;let u;return t[5]!==s||t[6]!==l||t[7]!==o||t[8]!==te?(u=(0,y.jsx)(S,{payload:l,store:o,toast:te,detectionGraceMs:s}),t[5]=s,t[6]=l,t[7]=o,t[8]=te,t[9]=u):u=t[9],u}function S(e){let t=(0,de.c)(126),{payload:n,store:a,toast:c,detectionGraceMs:l}=e,{_}=i(),b=(0,v.useId)(),[x,me]=(0,v.useState)(n.defaultContentDir),[S,ve]=(0,v.useState)(``),[C,be]=(0,v.useState)(null),[w,xe]=(0,v.useState)(!0),[T,Se]=(0,v.useState)(ae),[Ce,we]=(0,v.useState)(null),[E,Te]=(0,v.useState)(!1),[Ee,De]=(0,v.useState)(null),[Oe,ke]=(0,v.useState)(!1),[D,Ae]=(0,v.useState)(!1),je=(0,v.useRef)(null),Me=(0,v.useRef)(!1),Ne=(0,v.useRef)(0),Pe,Fe;t[0]!==_||t[1]!==x?(Pe=()=>{if(!le(x)){we(null);return}let e=!1,t=setTimeout(()=>{let t=window.okDesktop;t&&t.onboarding.probeContent({contentDir:x}).then(t=>{e||we(t)}).catch(t=>{e||we({ok:!1,error:t instanceof Error?t.message:_({id:`snrVQ7`})})})},fe);return()=>{e=!0,clearTimeout(t)}},Fe=[x,_],t[0]=_,t[1]=x,t[2]=Pe,t[3]=Fe):(Pe=t[2],Fe=t[3]),(0,v.useEffect)(Pe,Fe);let Ie,Le;t[4]===l?(Ie=t[5],Le=t[6]):(Ie=()=>{let e=window.okDesktop;if(!e){be([]);return}let t=!1,n=e.integrations.status().then(_e).catch(ge),r;return je.current=Promise.race([n,new Promise(e=>{r=setTimeout(()=>{console.warn(`[ConsentDialog] editor detection did not settle within ${l}ms`),t||be([]),e([])},l)})]),n.then(e=>{clearTimeout(r),t||be(e)}),()=>{t=!0,clearTimeout(r)}},Le=[l],t[4]=l,t[5]=Ie,t[6]=Le),(0,v.useEffect)(Ie,Le);let Re;t[7]===x?Re=t[8]:(Re=le(x),t[7]=x,t[8]=Re);let O=Re,k=E||!O,ze=!E||D,Be=Oe||!O,Ve=n.projectDir,He;t[9]!==n.pickedPath||t[10]!==n.projectDir?(He=oe(n.projectDir,n.pickedPath)??n.pickedPath,t[9]=n.pickedPath,t[10]=n.projectDir,t[11]=He):He=t[11];let Ue=He,We;t[12]!==_||t[13]!==n.projectDir?(We=async function(){let e=window.okDesktop;if(!e)return;let t;try{t=await e.dialog.openFolder({defaultPath:n.projectDir})}catch(e){let t=e;De(t instanceof Error?t.message:_({id:`P-ye9o`}));return}if(t===null)return;let r=oe(n.projectDir,t);if(r===null){De(_({id:`UTZ97u`}));return}De(null),me(r)},t[12]=_,t[13]=n.projectDir,t[14]=We):We=t[14];let Ge=We,Ke;t[15]!==w||t[16]!==C?(Ke=async function(){if(!w)return[];if(C!==null)return C;let e=je.current;if(e===null)return[];Ae(!0);let t=await e;return Ae(!1),t},t[15]=w,t[16]=C,t[17]=Ke):Ke=t[17];let qe=Ke,Je;t[18]!==S||t[19]!==w||t[20]!==x||t[21]!==qe||t[22]!==T||t[23]!==a||t[24]!==c?(Je=async function(){let e=Ne.current+1;Ne.current=e,Te(!0);let t=await qe();if(Ne.current!==e)return;let n=await a.confirm({initGit:!0,contentDir:x,additionalIgnores:S,editorIds:[...t],connectEditors:w,sharing:T});n.ok||(c.error(n.error),Te(!1))},t[18]=S,t[19]=w,t[20]=x,t[21]=qe,t[22]=T,t[23]=a,t[24]=c,t[25]=Je):Je=t[25];let Ye=Je,Xe;t[26]!==Ye||t[27]!==k?(Xe=function(e){e.preventDefault(),!k&&Ye()},t[26]=Ye,t[27]=k,t[28]=Xe):Xe=t[28];let Ze=Xe,Qe;t[29]!==a||t[30]!==c?(Qe=async function(){if(Me.current)return;Me.current=!0,Ne.current+=1,Te(!0);let e=await a.cancel();e.ok||(Me.current=!1,Ae(!1),c.error(e.error),Te(!1))},t[29]=a,t[30]=c,t[31]=Qe):Qe=t[31];let A=Qe,$e;t[32]!==ze||t[33]!==A?($e=function(e){!e&&ze&&A()},t[32]=ze,t[33]=A,t[34]=$e):$e=t[34];let et=$e,tt;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,y.jsx)(re,{children:(0,y.jsx)(r,{id:`seeS6l`})}),t[35]=tt):tt=t[35];let nt;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(nt=(0,y.jsxs)(m,{children:[tt,(0,y.jsx)(d,{children:(0,y.jsx)(r,{id:`HqiZvw`,components:{0:(0,y.jsx)(`code`,{})}})})]}),t[36]=nt):nt=t[36];let j;t[37]!==n.gitRootPromoted||t[38]!==Ue||t[39]!==Ve?(j=n.gitRootPromoted?(0,y.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,y.jsx)(r,{id:`Y1kX2z`,values:{projectDir:Ve,pickedRelative:Ue},components:{0:(0,y.jsx)(`code`,{}),1:(0,y.jsx)(`code`,{}),2:(0,y.jsx)(`code`,{}),3:(0,y.jsx)(`code`,{}),4:(0,y.jsx)(`code`,{})}})}):null,t[37]=n.gitRootPromoted,t[38]=Ue,t[39]=Ve,t[40]=j):j=t[40];let M;t[41]!==_||t[42]!==n.warnings?(M=n.warnings.length>0?(0,y.jsx)(`div`,{role:`alert`,className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,children:n.warnings.map(e=>(0,y.jsx)(`p`,{className:`mb-1 last:mb-0`,children:_(pe[e.kind])},e.kind))}):null,t[41]=_,t[42]=n.warnings,t[43]=M):M=t[43];let N;t[44]!==O||t[45]!==Ce?(N=O?(0,y.jsx)(ye,{probe:Ce}):null,t[44]=O,t[45]=Ce,t[46]=N):N=t[46];let P;t[47]!==E||t[48]!==w||t[49]!==C?(P=(0,y.jsx)(ce,{detectedEditors:C,checked:w,onCheckedChange:xe,disabled:E,testIdPrefix:`consent-editors`,itemTestIdPrefix:`consent-editor`}),t[47]=E,t[48]=w,t[49]=C,t[50]=P):P=t[50];let F;t[51]!==E||t[52]!==b||t[53]!==T?(F=(0,y.jsx)(se,{idPrefix:b,testIdPrefix:`consent-sharing`,value:T,onValueChange:Se,disabled:E}),t[51]=E,t[52]=b,t[53]=T,t[54]=F):F=t[54];let rt;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(rt=(0,y.jsxs)(o,{className:`group flex w-full items-center justify-between gap-2 px-3 py-2 text-sm font-medium hover:bg-muted/50`,"data-testid":`consent-advanced-trigger`,children:[(0,y.jsx)(r,{id:`VNgKZz`}),(0,y.jsx)(u,{className:`size-4 transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none`,"aria-hidden":!0})]}),t[55]=rt):rt=t[55];let it;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(it=(0,y.jsx)(`label`,{htmlFor:`consent-content-dir`,className:`text-sm font-medium`,children:(0,y.jsx)(r,{id:`ll2yNl`})}),t[56]=it):it=t[56];let at;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(at=e=>{me(e.target.value),De(null)},t[57]=at):at=t[57];let ot=!O,st=Ee===null?O?void 0:`consent-content-dir-error`:`consent-content-dir-browse-error`,I;t[58]!==E||t[59]!==x||t[60]!==ot||t[61]!==st?(I=(0,y.jsx)(g,{id:`consent-content-dir`,value:x,onChange:at,disabled:E,"aria-invalid":ot,"aria-describedby":st,"data-testid":`consent-content-dir`,className:`flex-1`}),t[58]=E,t[59]=x,t[60]=ot,t[61]=st,t[62]=I):I=t[62];let L;t[63]===Ge?L=t[64]:(L=()=>void Ge(),t[63]=Ge,t[64]=L);let ct;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(ct=(0,y.jsx)(r,{id:`O2UpM1`}),t[65]=ct):ct=t[65];let R;t[66]!==E||t[67]!==L?(R=(0,y.jsx)(s,{type:`button`,variant:`outline`,disabled:E,onClick:L,"data-testid":`consent-content-dir-browse`,children:ct}),t[66]=E,t[67]=L,t[68]=R):R=t[68];let z;t[69]!==I||t[70]!==R?(z=(0,y.jsxs)(`div`,{className:`flex items-stretch gap-2`,children:[I,R]}),t[69]=I,t[70]=R,t[71]=z):z=t[71];let B;t[72]!==Ee||t[73]!==O?(B=Ee===null?O?null:(0,y.jsx)(`p`,{id:`consent-content-dir-error`,className:`text-1sm text-destructive`,"data-testid":`consent-content-dir-error`,children:(0,y.jsx)(r,{id:`U5Spo9`})}):(0,y.jsx)(`p`,{id:`consent-content-dir-browse-error`,className:`text-1sm text-destructive`,"data-testid":`consent-content-dir-browse-error`,children:Ee}),t[72]=Ee,t[73]=O,t[74]=B):B=t[74];let V;t[75]!==z||t[76]!==B?(V=(0,y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[it,z,B]}),t[75]=z,t[76]=B,t[77]=V):V=t[77];let lt;t[78]===Symbol.for(`react.memo_cache_sentinel`)?(lt=(0,y.jsx)(`label`,{htmlFor:`consent-additional-ignores`,className:`text-sm font-medium`,children:(0,y.jsx)(r,{id:`3zyg_A`})}),t[78]=lt):lt=t[78];let ut;t[79]===Symbol.for(`react.memo_cache_sentinel`)?(ut=e=>ve(e.target.value),t[79]=ut):ut=t[79];let H;t[80]!==S||t[81]!==E?(H=(0,y.jsx)(ue,{id:`consent-additional-ignores`,value:S,onChange:ut,disabled:E,placeholder:`tmp/
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{n as ee,r as o,t as te}from"./collapsible-BKbszYZV.js";import{t as s}from"./button-DzgjsZzC.js";import{n as c}from"./dist-BGzUo_18.js";import{d as l}from"./constants-editors-bLWf6BtK.js";import{t as u}from"./chevron-right-Bofu4lib.js";import{t as ne}from"./spinner-Bx8xD6f8.js";import{a as d,c as re,i as ie,n as f,o as p,s as m,t as h}from"./dialog-BJEjKJjL.js";import{t as g}from"./input-C-Qm8YDT.js";import{a as ae,n as oe,o as se,r as _,s as ce,t as le}from"./project-paths-4aL5STlX.js";import{t as ue}from"./textarea-qPZDtk8V.js";var de=a(),v=e(n(),1),y=t(),fe=750,b=8e3,pe={root:{id:`ZWolSV`},home:{id:`_RcqUM`},"home-documents":{id:`of3tF-`},"home-desktop":{id:`vfWA_g`},"home-downloads":{id:`wlwXUk`},"volumes-mount":{id:`nMSYz5`},"drive-root":{id:`M3ytY_`}},x={error:e=>c.error(e)};function me(e){let t=(0,de.c)(10),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{store:r,toast:i,payload:a,detectionGraceMs:ee}=n,o=r===void 0?_:r,te=i===void 0?x:i,s=ee===void 0?b:ee,c;t[2]!==a||t[3]!==o?(c=a??o.getSnapshot(),t[2]=a,t[3]=o,t[4]=c):c=t[4];let l=c;if(!l)return null;let u;return t[5]!==s||t[6]!==l||t[7]!==o||t[8]!==te?(u=(0,y.jsx)(S,{payload:l,store:o,toast:te,detectionGraceMs:s}),t[5]=s,t[6]=l,t[7]=o,t[8]=te,t[9]=u):u=t[9],u}function S(e){let t=(0,de.c)(126),{payload:n,store:a,toast:c,detectionGraceMs:l}=e,{_}=i(),b=(0,v.useId)(),[x,me]=(0,v.useState)(n.defaultContentDir),[S,ve]=(0,v.useState)(``),[C,be]=(0,v.useState)(null),[w,xe]=(0,v.useState)(!0),[T,Se]=(0,v.useState)(ae),[Ce,we]=(0,v.useState)(null),[E,Te]=(0,v.useState)(!1),[Ee,De]=(0,v.useState)(null),[Oe,ke]=(0,v.useState)(!1),[D,Ae]=(0,v.useState)(!1),je=(0,v.useRef)(null),Me=(0,v.useRef)(!1),Ne=(0,v.useRef)(0),Pe,Fe;t[0]!==_||t[1]!==x?(Pe=()=>{if(!le(x)){we(null);return}let e=!1,t=setTimeout(()=>{let t=window.okDesktop;t&&t.onboarding.probeContent({contentDir:x}).then(t=>{e||we(t)}).catch(t=>{e||we({ok:!1,error:t instanceof Error?t.message:_({id:`snrVQ7`})})})},fe);return()=>{e=!0,clearTimeout(t)}},Fe=[x,_],t[0]=_,t[1]=x,t[2]=Pe,t[3]=Fe):(Pe=t[2],Fe=t[3]),(0,v.useEffect)(Pe,Fe);let Ie,Le;t[4]===l?(Ie=t[5],Le=t[6]):(Ie=()=>{let e=window.okDesktop;if(!e){be([]);return}let t=!1,n=e.integrations.status().then(_e).catch(ge),r;return je.current=Promise.race([n,new Promise(e=>{r=setTimeout(()=>{console.warn(`[ConsentDialog] editor detection did not settle within ${l}ms`),t||be([]),e([])},l)})]),n.then(e=>{clearTimeout(r),t||be(e)}),()=>{t=!0,clearTimeout(r)}},Le=[l],t[4]=l,t[5]=Ie,t[6]=Le),(0,v.useEffect)(Ie,Le);let Re;t[7]===x?Re=t[8]:(Re=le(x),t[7]=x,t[8]=Re);let O=Re,k=E||!O,ze=!E||D,Be=Oe||!O,Ve=n.projectDir,He;t[9]!==n.pickedPath||t[10]!==n.projectDir?(He=oe(n.projectDir,n.pickedPath)??n.pickedPath,t[9]=n.pickedPath,t[10]=n.projectDir,t[11]=He):He=t[11];let Ue=He,We;t[12]!==_||t[13]!==n.projectDir?(We=async function(){let e=window.okDesktop;if(!e)return;let t;try{t=await e.dialog.openFolder({defaultPath:n.projectDir})}catch(e){let t=e;De(t instanceof Error?t.message:_({id:`P-ye9o`}));return}if(t===null)return;let r=oe(n.projectDir,t);if(r===null){De(_({id:`UTZ97u`}));return}De(null),me(r)},t[12]=_,t[13]=n.projectDir,t[14]=We):We=t[14];let Ge=We,Ke;t[15]!==w||t[16]!==C?(Ke=async function(){if(!w)return[];if(C!==null)return C;let e=je.current;if(e===null)return[];Ae(!0);let t=await e;return Ae(!1),t},t[15]=w,t[16]=C,t[17]=Ke):Ke=t[17];let qe=Ke,Je;t[18]!==S||t[19]!==w||t[20]!==x||t[21]!==qe||t[22]!==T||t[23]!==a||t[24]!==c?(Je=async function(){let e=Ne.current+1;Ne.current=e,Te(!0);let t=await qe();if(Ne.current!==e)return;let n=await a.confirm({initGit:!0,contentDir:x,additionalIgnores:S,editorIds:[...t],connectEditors:w,sharing:T});n.ok||(c.error(n.error),Te(!1))},t[18]=S,t[19]=w,t[20]=x,t[21]=qe,t[22]=T,t[23]=a,t[24]=c,t[25]=Je):Je=t[25];let Ye=Je,Xe;t[26]!==Ye||t[27]!==k?(Xe=function(e){e.preventDefault(),!k&&Ye()},t[26]=Ye,t[27]=k,t[28]=Xe):Xe=t[28];let Ze=Xe,Qe;t[29]!==a||t[30]!==c?(Qe=async function(){if(Me.current)return;Me.current=!0,Ne.current+=1,Te(!0);let e=await a.cancel();e.ok||(Me.current=!1,Ae(!1),c.error(e.error),Te(!1))},t[29]=a,t[30]=c,t[31]=Qe):Qe=t[31];let A=Qe,$e;t[32]!==ze||t[33]!==A?($e=function(e){!e&&ze&&A()},t[32]=ze,t[33]=A,t[34]=$e):$e=t[34];let et=$e,tt;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,y.jsx)(re,{children:(0,y.jsx)(r,{id:`seeS6l`})}),t[35]=tt):tt=t[35];let nt;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(nt=(0,y.jsxs)(m,{children:[tt,(0,y.jsx)(d,{children:(0,y.jsx)(r,{id:`HqiZvw`,components:{0:(0,y.jsx)(`code`,{})}})})]}),t[36]=nt):nt=t[36];let j;t[37]!==n.gitRootPromoted||t[38]!==Ue||t[39]!==Ve?(j=n.gitRootPromoted?(0,y.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,y.jsx)(r,{id:`Y1kX2z`,values:{projectDir:Ve,pickedRelative:Ue},components:{0:(0,y.jsx)(`code`,{}),1:(0,y.jsx)(`code`,{}),2:(0,y.jsx)(`code`,{}),3:(0,y.jsx)(`code`,{}),4:(0,y.jsx)(`code`,{})}})}):null,t[37]=n.gitRootPromoted,t[38]=Ue,t[39]=Ve,t[40]=j):j=t[40];let M;t[41]!==_||t[42]!==n.warnings?(M=n.warnings.length>0?(0,y.jsx)(`div`,{role:`alert`,className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,children:n.warnings.map(e=>(0,y.jsx)(`p`,{className:`mb-1 last:mb-0`,children:_(pe[e.kind])},e.kind))}):null,t[41]=_,t[42]=n.warnings,t[43]=M):M=t[43];let N;t[44]!==O||t[45]!==Ce?(N=O?(0,y.jsx)(ye,{probe:Ce}):null,t[44]=O,t[45]=Ce,t[46]=N):N=t[46];let P;t[47]!==E||t[48]!==w||t[49]!==C?(P=(0,y.jsx)(ce,{detectedEditors:C,checked:w,onCheckedChange:xe,disabled:E,testIdPrefix:`consent-editors`,itemTestIdPrefix:`consent-editor`}),t[47]=E,t[48]=w,t[49]=C,t[50]=P):P=t[50];let F;t[51]!==E||t[52]!==b||t[53]!==T?(F=(0,y.jsx)(se,{idPrefix:b,testIdPrefix:`consent-sharing`,value:T,onValueChange:Se,disabled:E}),t[51]=E,t[52]=b,t[53]=T,t[54]=F):F=t[54];let rt;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(rt=(0,y.jsxs)(o,{className:`group flex w-full items-center justify-between gap-2 px-3 py-2 text-sm font-medium hover:bg-muted/50`,"data-testid":`consent-advanced-trigger`,children:[(0,y.jsx)(r,{id:`VNgKZz`}),(0,y.jsx)(u,{className:`size-4 transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none`,"aria-hidden":!0})]}),t[55]=rt):rt=t[55];let it;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(it=(0,y.jsx)(`label`,{htmlFor:`consent-content-dir`,className:`text-sm font-medium`,children:(0,y.jsx)(r,{id:`ll2yNl`})}),t[56]=it):it=t[56];let at;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(at=e=>{me(e.target.value),De(null)},t[57]=at):at=t[57];let ot=!O,st=Ee===null?O?void 0:`consent-content-dir-error`:`consent-content-dir-browse-error`,I;t[58]!==E||t[59]!==x||t[60]!==ot||t[61]!==st?(I=(0,y.jsx)(g,{id:`consent-content-dir`,value:x,onChange:at,disabled:E,"aria-invalid":ot,"aria-describedby":st,"data-testid":`consent-content-dir`,className:`flex-1`}),t[58]=E,t[59]=x,t[60]=ot,t[61]=st,t[62]=I):I=t[62];let L;t[63]===Ge?L=t[64]:(L=()=>void Ge(),t[63]=Ge,t[64]=L);let ct;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(ct=(0,y.jsx)(r,{id:`O2UpM1`}),t[65]=ct):ct=t[65];let R;t[66]!==E||t[67]!==L?(R=(0,y.jsx)(s,{type:`button`,variant:`outline`,disabled:E,onClick:L,"data-testid":`consent-content-dir-browse`,children:ct}),t[66]=E,t[67]=L,t[68]=R):R=t[68];let z;t[69]!==I||t[70]!==R?(z=(0,y.jsxs)(`div`,{className:`flex items-stretch gap-2`,children:[I,R]}),t[69]=I,t[70]=R,t[71]=z):z=t[71];let B;t[72]!==Ee||t[73]!==O?(B=Ee===null?O?null:(0,y.jsx)(`p`,{id:`consent-content-dir-error`,className:`text-1sm text-destructive`,"data-testid":`consent-content-dir-error`,children:(0,y.jsx)(r,{id:`U5Spo9`})}):(0,y.jsx)(`p`,{id:`consent-content-dir-browse-error`,className:`text-1sm text-destructive`,"data-testid":`consent-content-dir-browse-error`,children:Ee}),t[72]=Ee,t[73]=O,t[74]=B):B=t[74];let V;t[75]!==z||t[76]!==B?(V=(0,y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[it,z,B]}),t[75]=z,t[76]=B,t[77]=V):V=t[77];let lt;t[78]===Symbol.for(`react.memo_cache_sentinel`)?(lt=(0,y.jsx)(`label`,{htmlFor:`consent-additional-ignores`,className:`text-sm font-medium`,children:(0,y.jsx)(r,{id:`3zyg_A`})}),t[78]=lt):lt=t[78];let ut;t[79]===Symbol.for(`react.memo_cache_sentinel`)?(ut=e=>ve(e.target.value),t[79]=ut):ut=t[79];let H;t[80]!==S||t[81]!==E?(H=(0,y.jsx)(ue,{id:`consent-additional-ignores`,value:S,onChange:ut,disabled:E,placeholder:`tmp/
2
2
  *.draft.md`,rows:3,"data-testid":`consent-additional-ignores`}),t[80]=S,t[81]=E,t[82]=H):H=t[82];let dt;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(dt=(0,y.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,y.jsx)(r,{id:`aE2_XM`,components:{0:(0,y.jsx)(`code`,{})}})}),t[83]=dt):dt=t[83];let U;t[84]===H?U=t[85]:(U=(0,y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[lt,H,dt]}),t[84]=H,t[85]=U);let W;t[86]!==V||t[87]!==U?(W=(0,y.jsxs)(ee,{className:`space-y-6 border-t border-border px-3 py-4`,children:[V,U]}),t[86]=V,t[87]=U,t[88]=W):W=t[88];let G;t[89]!==Be||t[90]!==W?(G=(0,y.jsxs)(te,{open:Be,onOpenChange:ke,className:`rounded-md border border-border`,"data-testid":`consent-advanced`,children:[rt,W]}),t[89]=Be,t[90]=W,t[91]=G):G=t[91];let K;t[92]!==b||t[93]!==Ze||t[94]!==N||t[95]!==P||t[96]!==F||t[97]!==G?(K=(0,y.jsxs)(`form`,{id:b,onSubmit:Ze,"data-testid":`consent-form`,className:`space-y-6`,children:[N,P,F,G]}),t[92]=b,t[93]=Ze,t[94]=N,t[95]=P,t[96]=F,t[97]=G,t[98]=K):K=t[98];let q;t[99]!==j||t[100]!==M||t[101]!==K?(q=(0,y.jsxs)(f,{className:`space-y-6`,children:[j,M,K]}),t[99]=j,t[100]=M,t[101]=K,t[102]=q):q=t[102];let J;t[103]===A?J=t[104]:(J=()=>void A(),t[103]=A,t[104]=J);let ft=!ze,pt;t[105]===Symbol.for(`react.memo_cache_sentinel`)?(pt=(0,y.jsx)(r,{id:`dEgA5A`}),t[105]=pt):pt=t[105];let Y;t[106]!==J||t[107]!==ft?(Y=(0,y.jsx)(s,{type:`button`,variant:`outline`,onClick:J,disabled:ft,"data-testid":`consent-cancel`,children:pt}),t[106]=J,t[107]=ft,t[108]=Y):Y=t[108];let X;t[109]===D?X=t[110]:(X=D?(0,y.jsx)(ne,{"aria-hidden":`true`}):null,t[109]=D,t[110]=X);let mt;t[111]===Symbol.for(`react.memo_cache_sentinel`)?(mt=(0,y.jsx)(r,{id:`RDjuBN`}),t[111]=mt):mt=t[111];let Z;t[112]!==D||t[113]!==b||t[114]!==k||t[115]!==X?(Z=(0,y.jsxs)(s,{type:`submit`,form:b,disabled:k,"aria-busy":D,"data-testid":`consent-start`,children:[X,mt]}),t[112]=D,t[113]=b,t[114]=k,t[115]=X,t[116]=Z):Z=t[116];let Q;t[117]!==Y||t[118]!==Z?(Q=(0,y.jsxs)(p,{children:[Y,Z]}),t[117]=Y,t[118]=Z,t[119]=Q):Q=t[119];let $;t[120]!==q||t[121]!==Q?($=(0,y.jsxs)(ie,{className:`sm:max-w-lg`,onOpenAutoFocus:he,children:[nt,q,Q]}),t[120]=q,t[121]=Q,t[122]=$):$=t[122];let ht;return t[123]!==et||t[124]!==$?(ht=(0,y.jsx)(h,{open:!0,onOpenChange:et,children:$}),t[123]=et,t[124]=$,t[125]=ht):ht=t[125],ht}function he(e){e.preventDefault(),e.currentTarget.querySelector(`[role="radio"]`)?.focus()}function ge(e){return console.warn(`[ConsentDialog] editor-detection probe failed:`,e),[]}function _e(e){let t=new Set(e.editors.filter(C).map(ve));return e.detectedEditorIds.filter(e=>l(e,{userMcpEntryInstalled:t.has(e)}))}function ve(e){return e.id}function C(e){return e.state===`installed`}function ye(e){let t=(0,de.c)(29),{probe:n}=e,{_:a,i18n:s}=i();if(n===null){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`consent-preview`,children:(0,y.jsx)(r,{id:`DiFKSL`})}),t[0]=e):e=t[0],e}if(!n.ok){let e=n.error,i;return t[1]===e?i=t[2]:(i=(0,y.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`consent-preview`,children:(0,y.jsx)(r,{id:`9fvog2`,values:{errorDetail:e}})}),t[1]=e,t[2]=i),i}let c,l,ne,d;if(t[3]!==a||t[4]!==s.locale||t[5]!==n.count||t[6]!==n.sample.length||t[7]!==n.truncated){d=Symbol.for(`react.early_return_sentinel`);bb0:{let e=new Intl.NumberFormat(s.locale),t=e.format(n.count);if(c=a({id:`MV-Dkb`,values:{countDisplay:n.truncated?`≥ ${t}`:t}}),n.sample.length===0){d=(0,y.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`consent-preview`,children:c});break bb0}l=n.truncated?null:n.count-n.sample.length,ne=l===null?null:e.format(l)}t[3]=a,t[4]=s.locale,t[5]=n.count,t[6]=n.sample.length,t[7]=n.truncated,t[8]=c,t[9]=l,t[10]=ne,t[11]=d}else c=t[8],l=t[9],ne=t[10],d=t[11];if(d!==Symbol.for(`react.early_return_sentinel`))return d;let re=ne,ie;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,y.jsx)(u,{className:`size-3 transition-transform motion-reduce:transition-none`,"aria-hidden":!0}),t[12]=ie):ie=t[12];let f;t[13]===c?f=t[14]:(f=(0,y.jsxs)(o,{className:`flex items-center gap-1 text-1sm text-muted-foreground hover:text-foreground [&[data-state=open]>svg]:rotate-90`,children:[ie,(0,y.jsx)(`span`,{children:c})]}),t[13]=c,t[14]=f);let p;t[15]===n.sample?p=t[16]:(p=n.sample.map(be),t[15]=n.sample,t[16]=p);let m;t[17]===p?m=t[18]:(m=(0,y.jsx)(`ul`,{className:`space-y-1.5 font-mono`,children:p}),t[17]=p,t[18]=m);let h;t[19]!==n.truncated||t[20]!==re||t[21]!==l?(h=n.truncated||l!==null&&l>0?(0,y.jsx)(`p`,{className:`mt-1 italic`,children:n.truncated?(0,y.jsx)(r,{id:`5wV2qQ`}):(0,y.jsx)(r,{id:`nNYV3Y`,values:{remaining:re}})}):null,t[19]=n.truncated,t[20]=re,t[21]=l,t[22]=h):h=t[22];let g;t[23]!==m||t[24]!==h?(g=(0,y.jsxs)(ee,{className:`pt-1 pl-4 text-1sm text-muted-foreground`,children:[m,h]}),t[23]=m,t[24]=h,t[25]=g):g=t[25];let ae;return t[26]!==f||t[27]!==g?(ae=(0,y.jsxs)(te,{"data-testid":`consent-preview`,children:[f,g]}),t[26]=f,t[27]=g,t[28]=ae):ae=t[28],ae}function be(e){return(0,y.jsx)(`li`,{children:e},e)}export{me as default};