getborg 0.0.109 → 0.0.118

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 (115) hide show
  1. package/dist/{BunPtyAdapter-B8CZTUkK.mjs → BunPtyAdapter-kPTUT2mb.mjs} +3 -3
  2. package/dist/{Config-DFbx48ty.mjs → Config-DvH5tPG0.mjs} +2 -2
  3. package/dist/{FetchHttpClient-DEMRQKIB.mjs → FetchHttpClient-C-jciW95.mjs} +3 -3
  4. package/dist/{FileSystem-41Cezpd1.mjs → FileSystem-NX0EtGtm.mjs} +109 -3
  5. package/dist/{Mime-D2854Tqo.mjs → Mime-C6O17O_3.mjs} +5 -5
  6. package/dist/{NodeHttpIncomingMessage-BqU9AHA2.mjs → NodeHttpIncomingMessage-CylGKvlB.mjs} +4 -4
  7. package/dist/{NodeHttpServer-C-eqvdR4.mjs → NodeHttpServer-EarHJJzn.mjs} +9 -9
  8. package/dist/{NodePtyAdapter-BdtcaYPg.mjs → NodePtyAdapter-C6ioPYk6.mjs} +5 -5
  9. package/dist/{NodeServices-pD4zkANr.mjs → NodeServices-C18DO3cx.mjs} +6 -6
  10. package/dist/{NodeSqliteClient-BIVa5aFu.mjs → NodeSqliteClient-CWkKfsSo.mjs} +5 -5
  11. package/dist/{NodeStream-BjNgA5_1.mjs → NodeStream-1N7oXzTp.mjs} +3 -3
  12. package/dist/{Path-D8BPsRhh.mjs → Path-ZDpyUmZ1.mjs} +2 -2
  13. package/dist/{PtyAdapter-B9zQDp9u.mjs → PtyAdapter-DSEyRij4.mjs} +2 -2
  14. package/dist/{Schema-DkAVclKk.mjs → Schema-CA_wFfhH.mjs} +141 -4
  15. package/dist/{SqlClient-JflyUX7a.mjs → SqlClient-Cusaqpaw.mjs} +3 -3
  16. package/dist/bin.mjs +7894 -2484
  17. package/dist/{borgTelemetryNode-B0vVayda.mjs → borgTelemetryNode-CHLcRFOW.mjs} +6 -6
  18. package/dist/client/.vite/manifest.json +330 -330
  19. package/dist/client/assets/ArrowRight-CgvCTAzu.js +2 -0
  20. package/dist/client/assets/ArrowSquareOut-C1CwJQ7R.js +2 -0
  21. package/dist/client/assets/ArrowsClockwise-CBwAQTtQ.js +2 -0
  22. package/dist/client/assets/CaretLeft-Bk0n02vc.js +2 -0
  23. package/dist/client/assets/ChatMarkdown-BhfpBJaq.js +249 -0
  24. package/dist/client/assets/DesignWorkspace-okkekyBu.js +3 -0
  25. package/dist/client/assets/DiffPanel-Dn_Or9fx.js +2 -0
  26. package/dist/client/assets/DiffWorkerPoolProvider-Hp3trMBG.js +10 -0
  27. package/dist/client/assets/DocxPreview-DHnzhQMX.js +17 -0
  28. package/dist/client/assets/{FilePreviewPanel-CeAwd87I.js → FilePreviewPanel-KOVwBhPe.js} +19 -19
  29. package/dist/client/assets/HtmlPreview-I3xV5YgS.js +2 -0
  30. package/dist/client/assets/PdfPreview-CjWrZkCM.js +3 -0
  31. package/dist/client/assets/PptxPreview-D4YsFq_s.js +3 -0
  32. package/dist/client/assets/PreviewPanel-CKieJ-9L.js +2 -0
  33. package/dist/client/assets/PullRequestCodeTab-DbUx3FWB.js +6 -0
  34. package/dist/client/assets/{PullRequestReactions-BWjOU4KY.js → PullRequestReactions-BSI_Qt4L.js} +4 -4
  35. package/dist/client/assets/{RightPanelResizeHandle-DZdzK7y3.js → RightPanelResizeHandle-DBci-Ee2.js} +2 -2
  36. package/dist/client/assets/VirtualizedFile-VSzhLWFM.js +2 -0
  37. package/dist/client/assets/XlsxPreview-BnnrdNes.js +3 -0
  38. package/dist/client/assets/accountData-C4ZvicpJ.js +16 -0
  39. package/dist/client/assets/assetUrls-C2vkiSgX.js +2 -0
  40. package/dist/client/assets/browserHistoryStore-CIr_OQCq.js +4 -0
  41. package/dist/client/assets/browserRecording-BmG6q-H4.js +2 -0
  42. package/dist/client/assets/clientPersistenceStorage-BlYjZvCd.js +2 -0
  43. package/dist/client/assets/combobox-uXzVxkLc.js +2 -0
  44. package/dist/client/assets/composerMentionDrag-DTGN7WcV.js +2 -0
  45. package/dist/client/assets/designCanvas.logic-DtK3Ht6X.js +8 -0
  46. package/dist/client/assets/designOpenFileContext-DCJpUleA.js +2 -0
  47. package/dist/client/assets/diffFileContents-CFjzWK4l.js +248 -0
  48. package/dist/client/assets/empty-tcpR9LH8.js +2 -0
  49. package/dist/client/assets/entities-Da-AvwsX.js +2 -0
  50. package/dist/client/assets/env-71Gq9H0m.js +2 -0
  51. package/dist/client/assets/{index-BKWzfr1Y.js → index-DraeEDbf.js} +3 -3
  52. package/dist/client/assets/input-BRLXkmUH.js +2 -0
  53. package/dist/client/assets/{lib-DyhHMOev.js → lib-ay4Y8Jpt.js} +2 -2
  54. package/dist/client/assets/main-Bn8Ylf8R.js +161 -0
  55. package/dist/client/assets/main-YscGsfgO.css +2 -0
  56. package/dist/client/assets/{pdf-C_AIVI51.js → pdf-BH4RlEy2.js} +2 -2
  57. package/dist/client/assets/popover-DTprsoPQ.js +2 -0
  58. package/dist/client/assets/{pptxDocument-CHL8asXA.js → pptxDocument-ifTk53yH.js} +2 -2
  59. package/dist/client/assets/projectFilesQueryState-CD_JXBj5.js +2 -0
  60. package/dist/client/assets/queries-D1AwaR_5.js +2 -0
  61. package/dist/client/assets/scroll-area-j6QV0udq.js +1634 -0
  62. package/dist/client/assets/session-BaysTZDD.js +67 -0
  63. package/dist/client/assets/spinner-DHhZaoFg.js +2 -0
  64. package/dist/client/assets/textarea-BB3euU4O.js +5 -0
  65. package/dist/client/assets/toggle-DwBa6pBo.js +2 -0
  66. package/dist/client/assets/toggle-group-BU7-0DcW.js +2 -0
  67. package/dist/client/assets/useWorkspaceMutationRefresh-DLI4brDf.js +2 -0
  68. package/dist/client/assets/utils-DgzD4MA_.js +30 -0
  69. package/dist/client/assets/{xlsxDocument-ANMZ6ewU.js → xlsxDocument-DwhEMpfP.js} +2 -2
  70. package/dist/client/index.html +1 -1
  71. package/dist/service-launcher.mjs +1 -1
  72. package/package.json +1 -1
  73. package/dist/client/assets/ArrowRight-BOicMyF9.js +0 -2
  74. package/dist/client/assets/ArrowSquareOut-D7Y2Tt3L.js +0 -2
  75. package/dist/client/assets/ArrowsClockwise-DycxhEkt.js +0 -2
  76. package/dist/client/assets/CaretLeft-CDMA3Uas.js +0 -2
  77. package/dist/client/assets/ChatMarkdown-Cl8M9HCx.js +0 -247
  78. package/dist/client/assets/DesignWorkspace-DBL7AxwS.js +0 -3
  79. package/dist/client/assets/DiffPanel-BJ-Ix_7K.js +0 -2
  80. package/dist/client/assets/DiffWorkerPoolProvider-_R9JGgmp.js +0 -10
  81. package/dist/client/assets/DocxPreview-BFCC5VXn.js +0 -17
  82. package/dist/client/assets/HtmlPreview-BpBdu9_j.js +0 -2
  83. package/dist/client/assets/PdfPreview-CeECoD5z.js +0 -3
  84. package/dist/client/assets/PptxPreview-u6gN3x3Z.js +0 -3
  85. package/dist/client/assets/PreviewPanel-BVJp3UI5.js +0 -2
  86. package/dist/client/assets/PullRequestCodeTab-Bxx0Vkdn.js +0 -6
  87. package/dist/client/assets/VirtualizedFile-CyAKSbzc.js +0 -2
  88. package/dist/client/assets/XlsxPreview-CaykIFrZ.js +0 -3
  89. package/dist/client/assets/assetUrls-BBFxUocf.js +0 -2
  90. package/dist/client/assets/browserHistoryStore-K9gWOOUq.js +0 -2
  91. package/dist/client/assets/browserRecording-DrMz1iOt.js +0 -4
  92. package/dist/client/assets/clientPersistenceStorage-DSC61yLx.js +0 -2
  93. package/dist/client/assets/combobox-C4C8XR-w.js +0 -6
  94. package/dist/client/assets/composerMentionDrag-D06cCeGC.js +0 -2
  95. package/dist/client/assets/designCanvas.logic-DuuhotDy.js +0 -8
  96. package/dist/client/assets/designOpenFileContext-CCQs4ovB.js +0 -2
  97. package/dist/client/assets/diffFileContents-Bj3q_jc2.js +0 -248
  98. package/dist/client/assets/empty-DynqTxIR.js +0 -2
  99. package/dist/client/assets/entities-dwE_i4XM.js +0 -2
  100. package/dist/client/assets/env-DgM3kOA4.js +0 -2
  101. package/dist/client/assets/input-Q4KA45-f.js +0 -2
  102. package/dist/client/assets/main-CI0aXqkB.css +0 -2
  103. package/dist/client/assets/main-DFDCV-Ns.js +0 -145
  104. package/dist/client/assets/popover-CXGEm4M0.js +0 -2
  105. package/dist/client/assets/projectFilesQueryState-7mFyaRdj.js +0 -2
  106. package/dist/client/assets/queries-x5LGu_Fy.js +0 -2
  107. package/dist/client/assets/scroll-area-D8MfzXjN.js +0 -1630
  108. package/dist/client/assets/session-DIGL5_Nm.js +0 -67
  109. package/dist/client/assets/spinner-CwxxMzkd.js +0 -2
  110. package/dist/client/assets/textarea-DdNchuIO.js +0 -5
  111. package/dist/client/assets/toggle-CmeCFqd7.js +0 -2
  112. package/dist/client/assets/toggle-group-iEMUfMdW.js +0 -2
  113. package/dist/client/assets/useLocalStorage-2W_I13tQ.js +0 -16
  114. package/dist/client/assets/useWorkspaceMutationRefresh-YuIxWftk.js +0 -2
  115. package/dist/client/assets/utils-D0kLIGeh.js +0 -30
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{a as t}from"./useLocalStorage-2W_I13tQ.js";import{Co as n}from"./utils-D0kLIGeh.js";import{wr as r}from"./textarea-DdNchuIO.js";var i=e(t(),1),a=typeof window<`u`?i.useLayoutEffect:i.useEffect;function o(e){let t=i.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function ee(e,t,n={},r={}){i.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function s(e){let t=i.useRef(null);return i.useImperativeHandle(e,()=>t.current,[]),t}function c(e){let t=r();return i.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function l(e){let t=r(),n=c(),o=i.useRef(null);return a(()=>{o.current!==e&&(n(e),o.current=e)},[t,e,n]),null}var te=new Map([[`bold`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M220,48V96a12,12,0,0,1-24,0V77l-39.51,39.52a12,12,0,0,1-17-17L179,60H160a12,12,0,0,1,0-24h48A12,12,0,0,1,220,48ZM99.51,139.51,60,179V160a12,12,0,0,0-24,0v48a12,12,0,0,0,12,12H96a12,12,0,0,0,0-24H77l39.52-39.51a12,12,0,0,0-17-17Z`}))],[`duotone`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48Z`,opacity:`0.2`}),i.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z`}))],[`fill`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M117.66,138.34a8,8,0,0,1,0,11.32L83.31,184l18.35,18.34A8,8,0,0,1,96,216H48a8,8,0,0,1-8-8V160a8,8,0,0,1,13.66-5.66L72,172.69l34.34-34.35A8,8,0,0,1,117.66,138.34ZM208,40H160a8,8,0,0,0-5.66,13.66L172.69,72l-34.35,34.34a8,8,0,0,0,11.32,11.32L184,83.31l18.34,18.35A8,8,0,0,0,216,96V48A8,8,0,0,0,208,40Z`}))],[`light`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M214,48V96a6,6,0,0,1-12,0V62.48l-53.76,53.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM107.76,139.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l53.76-53.76a6,6,0,0,0-8.48-8.48Z`}))],[`regular`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z`}))],[`thin`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M212,48V96a4,4,0,0,1-8,0V57.66l-57.17,57.17a4,4,0,0,1-5.66-5.66L198.34,52H160a4,4,0,0,1,0-8h48A4,4,0,0,1,212,48ZM109.17,141.17,52,198.34V160a4,4,0,0,0-8,0v48a4,4,0,0,0,4,4H96a4,4,0,0,0,0-8H57.66l57.17-57.17a4,4,0,0,0-5.66-5.66Z`}))]]),ne=new Map([[`bold`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M228,144v64a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V144a12,12,0,0,1,24,0v52H204V144a12,12,0,0,1,24,0Zm-108.49,8.49a12,12,0,0,0,17,0l40-40a12,12,0,0,0-17-17L140,115V32a12,12,0,0,0-24,0v83L96.49,95.51a12,12,0,0,0-17,17Z`}))],[`duotone`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M216,48V208H40V48A16,16,0,0,1,56,32H200A16,16,0,0,1,216,48Z`,opacity:`0.2`}),i.createElement(`path`,{d:`M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z`}))],[`fill`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40A8,8,0,0,0,168,96H136V32a8,8,0,0,0-16,0V96H88a8,8,0,0,0-5.66,13.66Z`}))],[`light`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M222,144v64a6,6,0,0,1-6,6H40a6,6,0,0,1-6-6V144a6,6,0,0,1,12,0v58H210V144a6,6,0,0,1,12,0Zm-98.24,4.24a6,6,0,0,0,8.48,0l40-40a6,6,0,0,0-8.48-8.48L134,129.51V32a6,6,0,0,0-12,0v97.51L92.24,99.76a6,6,0,0,0-8.48,8.48Z`}))],[`regular`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z`}))],[`thin`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M220,144v64a4,4,0,0,1-4,4H40a4,4,0,0,1-4-4V144a4,4,0,0,1,8,0v60H212V144a4,4,0,0,1,8,0Zm-94.83,2.83a4,4,0,0,0,5.66,0l40-40a4,4,0,1,0-5.66-5.66L132,134.34V32a4,4,0,0,0-8,0V134.34L90.83,101.17a4,4,0,0,0-5.66,5.66Z`}))]]),u=new Map([[`bold`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M200,164v8h12a12,12,0,0,1,0,24H200v12a12,12,0,0,1-24,0V152a12,12,0,0,1,12-12h32a12,12,0,0,1,0,24ZM92,172a32,32,0,0,1-32,32H56v4a12,12,0,0,1-24,0V152a12,12,0,0,1,12-12H60A32,32,0,0,1,92,172Zm-24,0a8,8,0,0,0-8-8H56v16h4A8,8,0,0,0,68,172Zm100,8a40,40,0,0,1-40,40H112a12,12,0,0,1-12-12V152a12,12,0,0,1,12-12h16A40,40,0,0,1,168,180Zm-24,0a16,16,0,0,0-16-16h-4v32h4A16,16,0,0,0,144,180ZM36,108V40A20,20,0,0,1,56,20h96a12,12,0,0,1,8.49,3.52l56,56A12,12,0,0,1,220,88v20a12,12,0,0,1-24,0v-4H148a12,12,0,0,1-12-12V44H60v64a12,12,0,0,1-24,0ZM160,57V80h23Z`}))],[`duotone`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M208,88H152V32Z`,opacity:`0.2`}),i.createElement(`path`,{d:`M224,152a8,8,0,0,1-8,8H192v16h16a8,8,0,0,1,0,16H192v16a8,8,0,0,1-16,0V152a8,8,0,0,1,8-8h32A8,8,0,0,1,224,152ZM92,172a28,28,0,0,1-28,28H56v8a8,8,0,0,1-16,0V152a8,8,0,0,1,8-8H64A28,28,0,0,1,92,172Zm-16,0a12,12,0,0,0-12-12H56v24h8A12,12,0,0,0,76,172Zm88,8a36,36,0,0,1-36,36H112a8,8,0,0,1-8-8V152a8,8,0,0,1,8-8h16A36,36,0,0,1,164,180Zm-16,0a20,20,0,0,0-20-20h-8v40h8A20,20,0,0,0,148,180ZM40,112V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0ZM160,80h28.69L160,51.31Z`}))],[`fill`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M44,120H212a4,4,0,0,0,4-4V88a8,8,0,0,0-2.34-5.66l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40v76A4,4,0,0,0,44,120ZM152,44l44,44H152Zm72,108.53a8.18,8.18,0,0,1-8.25,7.47H192v16h15.73a8.17,8.17,0,0,1,8.25,7.47,8,8,0,0,1-8,8.53H192v15.73a8.17,8.17,0,0,1-7.47,8.25,8,8,0,0,1-8.53-8V152a8,8,0,0,1,8-8h32A8,8,0,0,1,224,152.53ZM64,144H48a8,8,0,0,0-8,8v55.73A8.17,8.17,0,0,0,47.47,216,8,8,0,0,0,56,208v-8h7.4c15.24,0,28.14-11.92,28.59-27.15A28,28,0,0,0,64,144Zm-.35,40H56V160h8a12,12,0,0,1,12,13.16A12.25,12.25,0,0,1,63.65,184ZM128,144H112a8,8,0,0,0-8,8v56a8,8,0,0,0,8,8h15.32c19.66,0,36.21-15.48,36.67-35.13A36,36,0,0,0,128,144Zm-.49,56H120V160h8a20,20,0,0,1,20,20.77C147.58,191.59,138.34,200,127.51,200Z`}))],[`light`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M222,152a6,6,0,0,1-6,6H190v20h18a6,6,0,0,1,0,12H190v18a6,6,0,0,1-12,0V152a6,6,0,0,1,6-6h32A6,6,0,0,1,222,152ZM90,172a26,26,0,0,1-26,26H54v10a6,6,0,0,1-12,0V152a6,6,0,0,1,6-6H64A26,26,0,0,1,90,172Zm-12,0a14,14,0,0,0-14-14H54v28H64A14,14,0,0,0,78,172Zm84,8a34,34,0,0,1-34,34H112a6,6,0,0,1-6-6V152a6,6,0,0,1,6-6h16A34,34,0,0,1,162,180Zm-12,0a22,22,0,0,0-22-22H118v44h10A22,22,0,0,0,150,180ZM42,112V40A14,14,0,0,1,56,26h96a6,6,0,0,1,4.25,1.76l56,56A6,6,0,0,1,214,88v24a6,6,0,0,1-12,0V94H152a6,6,0,0,1-6-6V38H56a2,2,0,0,0-2,2v72a6,6,0,0,1-12,0ZM158,82h35.52L158,46.48Z`}))],[`regular`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M224,152a8,8,0,0,1-8,8H192v16h16a8,8,0,0,1,0,16H192v16a8,8,0,0,1-16,0V152a8,8,0,0,1,8-8h32A8,8,0,0,1,224,152ZM92,172a28,28,0,0,1-28,28H56v8a8,8,0,0,1-16,0V152a8,8,0,0,1,8-8H64A28,28,0,0,1,92,172Zm-16,0a12,12,0,0,0-12-12H56v24h8A12,12,0,0,0,76,172Zm88,8a36,36,0,0,1-36,36H112a8,8,0,0,1-8-8V152a8,8,0,0,1,8-8h16A36,36,0,0,1,164,180Zm-16,0a20,20,0,0,0-20-20h-8v40h8A20,20,0,0,0,148,180ZM40,112V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88v24a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H56v72a8,8,0,0,1-16,0ZM160,80h28.69L160,51.31Z`}))],[`thin`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M220,152a4,4,0,0,1-4,4H188v24h20a4,4,0,0,1,0,8H188v20a4,4,0,0,1-8,0V152a4,4,0,0,1,4-4h32A4,4,0,0,1,220,152ZM88,172a24,24,0,0,1-24,24H52v12a4,4,0,0,1-8,0V152a4,4,0,0,1,4-4H64A24,24,0,0,1,88,172Zm-8,0a16,16,0,0,0-16-16H52v32H64A16,16,0,0,0,80,172Zm80,8a32,32,0,0,1-32,32H112a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h16A32,32,0,0,1,160,180Zm-8,0a24,24,0,0,0-24-24H116v48h12A24,24,0,0,0,152,180ZM44,112V40A12,12,0,0,1,56,28h96a4,4,0,0,1,2.83,1.17l56,56A4,4,0,0,1,212,88v24a4,4,0,0,1-8,0V92H152a4,4,0,0,1-4-4V36H56a4,4,0,0,0-4,4v72a4,4,0,0,1-8,0ZM156,84h42.34L156,41.65Z`}))]]),d=new Map([[`bold`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M208,36H48A28,28,0,0,0,20,64V176a28,28,0,0,0,28,28H208a28,28,0,0,0,28-28V64A28,28,0,0,0,208,36Zm4,140a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4Zm-40,52a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,228Z`}))],[`duotone`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M224,64V176a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V64A16,16,0,0,1,48,48H208A16,16,0,0,1,224,64Z`,opacity:`0.2`}),i.createElement(`path`,{d:`M208,40H48A24,24,0,0,0,24,64V176a24,24,0,0,0,24,24H208a24,24,0,0,0,24-24V64A24,24,0,0,0,208,40Zm8,136a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H208a8,8,0,0,1,8,8Zm-48,48a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,224Z`}))],[`fill`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M232,64V176a24,24,0,0,1-24,24H48a24,24,0,0,1-24-24V64A24,24,0,0,1,48,40H208A24,24,0,0,1,232,64ZM160,216H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16Z`}))],[`light`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M208,42H48A22,22,0,0,0,26,64V176a22,22,0,0,0,22,22H208a22,22,0,0,0,22-22V64A22,22,0,0,0,208,42Zm10,134a10,10,0,0,1-10,10H48a10,10,0,0,1-10-10V64A10,10,0,0,1,48,54H208a10,10,0,0,1,10,10Zm-52,48a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,224Z`}))],[`regular`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M208,40H48A24,24,0,0,0,24,64V176a24,24,0,0,0,24,24H208a24,24,0,0,0,24-24V64A24,24,0,0,0,208,40Zm8,136a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H208a8,8,0,0,1,8,8Zm-48,48a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,224Z`}))],[`thin`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M208,44H48A20,20,0,0,0,28,64V176a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V64A20,20,0,0,0,208,44Zm12,132a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V64A12,12,0,0,1,48,52H208a12,12,0,0,1,12,12Zm-56,48a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,224Z`}))]]),f=new Map([[`bold`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M216,36H140V24a12,12,0,0,0-24,0V36H40A20,20,0,0,0,20,56V176a20,20,0,0,0,20,20H71l-16.4,20.5a12,12,0,0,0,18.74,15l28.4-35.5h52.46l28.4,35.5a12,12,0,0,0,18.74-15L185,196h31a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36Zm-4,136H44V60H212Z`}))],[`duotone`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M224,56V176a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z`,opacity:`0.2`}),i.createElement(`path`,{d:`M216,40H136V24a8,8,0,0,0-16,0V40H40A16,16,0,0,0,24,56V176a16,16,0,0,0,16,16H79.36L57.75,219a8,8,0,0,0,12.5,10l29.59-37h56.32l29.59,37a8,8,0,1,0,12.5-10l-21.61-27H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,136H40V56H216V176Z`}))],[`fill`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M216,40H136V24a8,8,0,0,0-16,0V40H40A16,16,0,0,0,24,56V176a16,16,0,0,0,16,16H79.36L57.75,219a8,8,0,0,0,12.5,10l29.59-37h56.32l29.59,37a8,8,0,1,0,12.5-10l-21.61-27H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Z`}))],[`light`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M216,42H134V24a6,6,0,0,0-12,0V42H40A14,14,0,0,0,26,56V176a14,14,0,0,0,14,14H83.52L59.31,220.25a6,6,0,0,0,9.38,7.5L98.88,190h58.24l30.19,37.75a6,6,0,0,0,9.38-7.5L172.48,190H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42Zm2,134a2,2,0,0,1-2,2H40a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H216a2,2,0,0,1,2,2Z`}))],[`regular`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M216,40H136V24a8,8,0,0,0-16,0V40H40A16,16,0,0,0,24,56V176a16,16,0,0,0,16,16H79.36L57.75,219a8,8,0,0,0,12.5,10l29.59-37h56.32l29.59,37a8,8,0,1,0,12.5-10l-21.61-27H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,136H40V56H216V176Z`}))],[`thin`,i.createElement(i.Fragment,null,i.createElement(`path`,{d:`M216,44H132V24a4,4,0,0,0-8,0V44H40A12,12,0,0,0,28,56V176a12,12,0,0,0,12,12H87.68l-26.8,33.5a4,4,0,1,0,6.24,5L97.92,188h60.16l30.8,38.5a4,4,0,0,0,6.24-5L168.32,188H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44Zm4,132a4,4,0,0,1-4,4H40a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H216a4,4,0,0,1,4,4Z`}))]]),p=Object.defineProperty,m=Object.defineProperties,re=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable,_=(e,t,n)=>t in e?p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ae=(e,t)=>{for(var n in t||={})g.call(t,n)&&_(e,n,t[n]);if(h)for(var n of h(t))ie.call(t,n)&&_(e,n,t[n]);return e},oe=(e,t)=>m(e,re(t)),v=(0,i.forwardRef)((e,t)=>i.createElement(n,oe(ae({ref:t},e),{weights:te})));v.displayName=`ArrowsOutSimple`;var y=Object.defineProperty,b=Object.defineProperties,x=Object.getOwnPropertyDescriptors,S=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,T=(e,t,n)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,E=(e,t)=>{for(var n in t||={})C.call(t,n)&&T(e,n,t[n]);if(S)for(var n of S(t))w.call(t,n)&&T(e,n,t[n]);return e},D=(e,t)=>b(e,x(t)),O=(0,i.forwardRef)((e,t)=>i.createElement(n,D(E({ref:t},e),{weights:ne})));O.displayName=`DownloadSimple`;var k=Object.defineProperty,A=Object.defineProperties,j=Object.getOwnPropertyDescriptors,M=Object.getOwnPropertySymbols,N=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable,F=(e,t,n)=>t in e?k(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,I=(e,t)=>{for(var n in t||={})N.call(t,n)&&F(e,n,t[n]);if(M)for(var n of M(t))P.call(t,n)&&F(e,n,t[n]);return e},L=(e,t)=>A(e,j(t)),R=(0,i.forwardRef)((e,t)=>i.createElement(n,L(I({ref:t},e),{weights:u})));R.displayName=`FilePdf`;var z=Object.defineProperty,B=Object.defineProperties,V=Object.getOwnPropertyDescriptors,H=Object.getOwnPropertySymbols,U=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,G=(e,t,n)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,K=(e,t)=>{for(var n in t||={})U.call(t,n)&&G(e,n,t[n]);if(H)for(var n of H(t))W.call(t,n)&&G(e,n,t[n]);return e},q=(e,t)=>B(e,V(t)),J=(0,i.forwardRef)((e,t)=>i.createElement(n,q(K({ref:t},e),{weights:d})));J.displayName=`Monitor`;var Y=Object.defineProperty,se=Object.defineProperties,ce=Object.getOwnPropertyDescriptors,X=Object.getOwnPropertySymbols,le=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable,Z=(e,t,n)=>t in e?Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,de=(e,t)=>{for(var n in t||={})le.call(t,n)&&Z(e,n,t[n]);if(X)for(var n of X(t))ue.call(t,n)&&Z(e,n,t[n]);return e},fe=(e,t)=>se(e,ce(t)),Q=(0,i.forwardRef)((e,t)=>i.createElement(n,fe(de({ref:t},e),{weights:f})));Q.displayName=`Presentation`;var $=(0,i.createContext)(null);function pe(){return(0,i.useContext)($)}export{R as a,l as c,ee as d,a as f,J as i,c as l,pe as n,O as o,o as p,Q as r,v as s,$ as t,s as u};
2
- //# sourceMappingURL=designOpenFileContext-CCQs4ovB.js.map
@@ -1,248 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{a as t}from"./useLocalStorage-2W_I13tQ.js";import{Bo as n,Co as r,Lo as i,wo as a}from"./utils-D0kLIGeh.js";import{qt as o}from"./session-DIGL5_Nm.js";import{B as s,G as c,H as l,Mt as u,R as d,U as f,V as p,W as m,dn as h,en as g,hn as _,jt as v,mn as y,on as b,qt as x,sn as S,un as C,vn as w,yn as ee,z as T}from"./scroll-area-D8MfzXjN.js";import{c as te,n as E,o as D}from"./DiffWorkerPoolProvider-_R9JGgmp.js";import{r as O,t as k}from"./VirtualizedFile-CyAKSbzc.js";var A=e(t(),1),j=new Map([[`bold`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M100,28H64A20,20,0,0,0,44,48V208a20,20,0,0,0,20,20h36a20,20,0,0,0,20-20V48A20,20,0,0,0,100,28ZM96,204H68V52H96ZM192,28H156a20,20,0,0,0-20,20V208a20,20,0,0,0,20,20h36a20,20,0,0,0,20-20V48A20,20,0,0,0,192,28Zm-4,176H160V52h28Z`}))],[`duotone`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M112,48V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V48a8,8,0,0,1,8-8h40A8,8,0,0,1,112,48Zm80-8H152a8,8,0,0,0-8,8V208a8,8,0,0,0,8,8h40a8,8,0,0,0,8-8V48A8,8,0,0,0,192,40Z`,opacity:`0.2`}),A.createElement(`path`,{d:`M104,32H64A16,16,0,0,0,48,48V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,104,32Zm0,176H64V48h40ZM192,32H152a16,16,0,0,0-16,16V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,192,32Zm0,176H152V48h40Z`}))],[`fill`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M120,48V208a16,16,0,0,1-16,16H64a16,16,0,0,1-16-16V48A16,16,0,0,1,64,32h40A16,16,0,0,1,120,48Zm72-16H152a16,16,0,0,0-16,16V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,192,32Z`}))],[`light`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M104,34H64A14,14,0,0,0,50,48V208a14,14,0,0,0,14,14h40a14,14,0,0,0,14-14V48A14,14,0,0,0,104,34Zm2,174a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V48a2,2,0,0,1,2-2h40a2,2,0,0,1,2,2ZM192,34H152a14,14,0,0,0-14,14V208a14,14,0,0,0,14,14h40a14,14,0,0,0,14-14V48A14,14,0,0,0,192,34Zm2,174a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V48a2,2,0,0,1,2-2h40a2,2,0,0,1,2,2Z`}))],[`regular`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M104,32H64A16,16,0,0,0,48,48V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,104,32Zm0,176H64V48h40ZM192,32H152a16,16,0,0,0-16,16V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,192,32Zm0,176H152V48h40Z`}))],[`thin`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M104,36H64A12,12,0,0,0,52,48V208a12,12,0,0,0,12,12h40a12,12,0,0,0,12-12V48A12,12,0,0,0,104,36Zm4,172a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V48a4,4,0,0,1,4-4h40a4,4,0,0,1,4,4ZM192,36H152a12,12,0,0,0-12,12V208a12,12,0,0,0,12,12h40a12,12,0,0,0,12-12V48A12,12,0,0,0,192,36Zm4,172a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V48a4,4,0,0,1,4-4h40a4,4,0,0,1,4,4Z`}))]]),ne=new Map([[`bold`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M208,136H48a20,20,0,0,0-20,20v36a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V156A20,20,0,0,0,208,136Zm-4,52H52V160H204Zm4-144H48A20,20,0,0,0,28,64v36a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V64A20,20,0,0,0,208,44Zm-4,52H52V68H204Z`}))],[`duotone`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M216,152v40a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V152a8,8,0,0,1,8-8H208A8,8,0,0,1,216,152Zm-8-96H48a8,8,0,0,0-8,8v40a8,8,0,0,0,8,8H208a8,8,0,0,0,8-8V64A8,8,0,0,0,208,56Z`,opacity:`0.2`}),A.createElement(`path`,{d:`M208,136H48a16,16,0,0,0-16,16v40a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V152A16,16,0,0,0,208,136Zm0,56H48V152H208v40Zm0-144H48A16,16,0,0,0,32,64v40a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V64A16,16,0,0,0,208,48Zm0,56H48V64H208v40Z`}))],[`fill`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M224,152v40a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V152a16,16,0,0,1,16-16H208A16,16,0,0,1,224,152ZM208,48H48A16,16,0,0,0,32,64v40a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V64A16,16,0,0,0,208,48Z`}))],[`light`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M208,138H48a14,14,0,0,0-14,14v40a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V152A14,14,0,0,0,208,138Zm2,54a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2ZM208,50H48A14,14,0,0,0,34,64v40a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V64A14,14,0,0,0,208,50Zm2,54a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2Z`}))],[`regular`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M208,136H48a16,16,0,0,0-16,16v40a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V152A16,16,0,0,0,208,136Zm0,56H48V152H208v40Zm0-144H48A16,16,0,0,0,32,64v40a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V64A16,16,0,0,0,208,48Zm0,56H48V64H208v40Z`}))],[`thin`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M208,140H48a12,12,0,0,0-12,12v40a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V152A12,12,0,0,0,208,140Zm4,52a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4ZM208,52H48A12,12,0,0,0,36,64v40a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V64A12,12,0,0,0,208,52Zm4,52a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4Z`}))]]),M=Object.defineProperty,N=Object.defineProperties,P=Object.getOwnPropertyDescriptors,F=Object.getOwnPropertySymbols,I=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable,R=(e,t,n)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,z=(e,t)=>{for(var n in t||={})I.call(t,n)&&R(e,n,t[n]);if(F)for(var n of F(t))L.call(t,n)&&R(e,n,t[n]);return e},B=(e,t)=>N(e,P(t)),V=(0,A.forwardRef)((e,t)=>A.createElement(r,B(z({ref:t},e),{weights:j})));V.displayName=`Columns`;var re=Object.defineProperty,H=Object.defineProperties,U=Object.getOwnPropertyDescriptors,ie=Object.getOwnPropertySymbols,ae=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable,se=(e,t,n)=>t in e?re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ce=(e,t)=>{for(var n in t||={})ae.call(t,n)&&se(e,n,t[n]);if(ie)for(var n of ie(t))oe.call(t,n)&&se(e,n,t[n]);return e},le=(e,t)=>H(e,U(t)),ue=(0,A.forwardRef)((e,t)=>A.createElement(r,le(ce({ref:t},e),{weights:ne})));ue.displayName=`Rows`;function de(e,t){return e.length>0&&e.every(e=>t.has(e))}function fe(e,t){return de(e,t)?new Set:new Set(e)}function pe(e,t){return e==null||t==null?e===t:e.header!==t.header||e.footer!==t.footer?!1:me(e.items,t.items)}function me(e,t){if(e==null||t==null)return e===t;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r==null||i==null||r.id!==i.id||r.type!==i.type||r.element!==i.element||r.version!==i.version)return!1}return!0}function he(e,t,n){let r=document.createElement(`div`);return r.style.display=`flow-root`,e===`header`?(r.setAttribute(S,``),t.before(r)):(r.setAttribute(b,``),t.after(r)),n?.observe(r),r}function ge(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function W(e){let t=window.devicePixelRatio??1;return Math.round(e*t)/t}var _e=`theme.disableLineNumbers.overflow.themeType.disableFileHeader.disableVirtualizationBuffers.preferredHighlighter.useCSSClasses.useTokenTransformer.tokenizeMaxLineLength.tokenizeMaxLength.unsafeCSS.diffStyle.diffIndicators.disableBackground.expandUnchanged.loadDiffFiles.collapsedContextThreshold.lineDiffType.maxLineDiffLength.expansionLineCount.lineHoverHighlight.enableTokenInteractionsOnWhitespace.enableGutterUtility.__debugPointerEvents.enableLineSelection.controlledSelection.disableErrorHandling`.split(`.`),ve=[`theme`,`disableLineNumbers`,`overflow`,`themeType`,`disableFileHeader`,`disableVirtualizationBuffers`,`preferredHighlighter`,`useCSSClasses`,`useTokenTransformer`,`tokenizeMaxLineLength`,`tokenizeMaxLength`,`unsafeCSS`,`lineHoverHighlight`,`enableTokenInteractionsOnWhitespace`,`enableGutterUtility`,`__debugPointerEvents`,`enableLineSelection`,`controlledSelection`,`disableErrorHandling`],G=new Set([`useTokenTransformer`,`enableGutterUtility`,`enableLineSelection`,`lineHoverHighlight`]),ye=[`renderCustomHeader`,`renderHeaderPrefix`,`renderHeaderFilenameSuffix`,`renderHeaderMetadata`,`renderAnnotation`,`renderGutterUtility`,`onPostRender`,`onGutterUtilityClick`,`onLineClick`,`onLineNumberClick`,`onLineEnter`,`onLineLeave`,`onTokenClick`,`onTokenEnter`,`onTokenLeave`],be=[`onLineSelected`,`onLineSelectionStart`,`onLineSelectionChange`,`onLineSelectionEnd`],K=Symbol(`CodeView.itemOptionsState`);function xe(e,t){Object.defineProperty(e,K,{configurable:!1,enumerable:!1,value:t})}function q(e){return e[K]}function J(e,t,n){Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get(){return n(this)}})}var Se=120,Ce=`--diffs-overflow-override`,Y=12e6,we=1e6,Te=2e6,Ee=Y-Te,De=Y-we,Oe=(()=>{let{navigator:e}=globalThis,t=e.userAgent,n=/iP(?:hone|ad|od)/.test(t),r=e.platform===`MacIntel`&&e.maxTouchPoints>1;return(n||r)&&/AppleWebKit/.test(t)&&/Safari/.test(t)&&!/(CriOS|FxiOS|EdgiOS|OPiOS)/.test(t)})(),ke=class e{static __STOP=!1;static __lastScrollPosition=0;type=`advanced`;config={overscrollSize:200,intersectionObserverMargin:0,resizeDebugging:!1};items=[];idToItem=new Map;selectedLines=null;itemEditors=new Map;attachedEditors=new Set;instanceToItem=new Map;layoutDirtyIndex;pendingLayoutReset;renderOptionsRevision=0;slotCoordinator;slotSnapshot;scrollListeners=new Set;scrollHeight=0;containerHeight=-1;scrollTop=0;scrollPageOffset=0;scrollDirty=!0;scrollInteractionFixTimer;pointerEventsDisabled=!1;codeOverflowFix=!1;height=0;heightDirty=!0;windowSpecs={top:0,bottom:0};renderState={scrollTop:-1,firstIndex:-1,lastIndex:-1,stickyHeight:0,stickyTop:-1,stickyBottom:-1};itemMetricsCache=C;fileOptionsPrototype;diffOptionsPrototype;pendingScrollTarget;pendingLayoutAnchor;shouldFixContainerFocus=!1;scrollAnimation;root;resizeObserver;container=document.createElement(`div`);stickyContainer=document.createElement(`div`);stickyOffset=document.createElement(`div`);header={element:void 0,render:void 0,height:0};footer={element:void 0,render:void 0,height:0};elementPool=[];elementPoolVersion=0;elementPoolTracker=new WeakMap;pendingElementPool=[];options;workerManager;isReadySubscription;isContainerManaged;constructor(e={theme:_},t,n=!1){this.options=e,this.computeMetricsCache(e.itemMetrics),this.fileOptionsPrototype=this.createFileOptionsPrototype(),this.diffOptionsPrototype=this.createDiffOptionsPrototype(),this.workerManager=t,this.isContainerManaged=n,this.stickyOffset.style.contain=`layout size`,this.stickyContainer.style.position=`sticky`,this.stickyContainer.style.width=`100%`,this.stickyContainer.style.contain=`layout style inline-size`,this.stickyContainer.style.isolation=`isolate`,this.stickyContainer.style.display=`flex`,this.stickyContainer.style.flexDirection=`column`}getLayout(){return this.options.layout??h}getItemTopOffset(){return this.getLayout().paddingTop+this.header.height}computeMetricsCache(e){return this.itemMetricsCache={hunkLineCount:e?.hunkLineCount??C.hunkLineCount,lineHeight:e?.lineHeight??C.lineHeight,diffHeaderHeight:e?.diffHeaderHeight??C.diffHeaderHeight,hunkSeparatorHeight:e?.hunkSeparatorHeight,spacing:e?.spacing??C.spacing,paddingTop:e?.paddingTop,paddingBottom:e?.paddingBottom},this.itemMetricsCache}getSmoothScrollSettings(){return this.options.smoothScrollSettings??y}shouldDisablePointerEvents(){return this.options.pointerEventsOnScroll!==!0}shouldValidateItemHeights(){return w&&this.options.__devOnlyValidateItemHeights===!0}validateRenderedItemHeight(e){if(!this.shouldValidateItemHeights()||e.element==null)return;let t=e.instance.getAdvancedStickySpecs();if(t==null)return;let n=t.height,r=e.element.getBoundingClientRect().height;n!==r&&console.error(`CodeView: reconciled item height does not match DOM height`,{id:e.item.id,type:e.type,index:e.index,version:e.version,expectedHeight:n,actualHeight:r,delta:r-n,stickyTopOffset:t.topOffset,virtualizedHeight:e.instance.getVirtualizedHeight(),top:e.top,scrollTop:this.getScrollTop(),windowSpecs:{...this.windowSpecs},element:e.element,instance:e.instance})}validateStickyContainerHeight(){if(!this.shouldValidateItemHeights())return;let{firstIndex:e,lastIndex:t,stickyHeight:n,stickyTop:r,stickyBottom:i}=this.renderState;if(e===-1||t===-1)return;let a=this.stickyContainer.getBoundingClientRect().height;Math.abs(a-n)<1||console.error(`CodeView: sticky container height does not match computed layout`,{computedStickyHeight:n,actualStickyHeight:a,delta:a-n,stickyTop:r,stickyBottom:i,firstIndex:e,lastIndex:t,firstStickySpecs:this.items[e]?.instance.getAdvancedStickySpecs(),lastStickySpecs:this.items[t]?.instance.getAdvancedStickySpecs(),scrollTop:this.getScrollTop(),scrollPageOffset:this.scrollPageOffset,windowSpecs:{...this.windowSpecs},stickyContainer:this.stickyContainer})}clearScrollInteractionTimer(){this.scrollInteractionFixTimer!=null&&(clearTimeout(this.scrollInteractionFixTimer),this.scrollInteractionFixTimer=void 0)}suspendScrollInteractions(){this.clearScrollInteractionTimer(),this.shouldDisablePointerEvents()&&!this.pointerEventsDisabled&&(this.stickyContainer.style.pointerEvents=`none`,this.pointerEventsDisabled=!0),Oe&&!this.codeOverflowFix&&(this.stickyContainer.style.setProperty(Ce,`hidden`),this.codeOverflowFix=!0),this.scrollInteractionFixTimer=setTimeout(this.restoreScrollInteractions,Se)}restoreScrollInteractions=()=>{this.clearScrollInteractionTimer(),this.pointerEventsDisabled&&=(this.stickyContainer.style.removeProperty(`pointer-events`),!1),this.codeOverflowFix&&=(this.stickyContainer.style.setProperty(Ce,`auto`),!1)};syncLayout(){let{gap:e,paddingBottom:t,paddingTop:n}=this.getLayout();this.stickyContainer.style.gap=`${e}px`,this.container?.style.setProperty(`margin-top`,`${n}px`),this.container?.style.setProperty(`margin-bottom`,`${t}px`)}reconcileHeaderFooterHosts(){let e=this.reconcileHost(`header`),t=this.reconcileHost(`footer`);return e||t}reconcileHost(e){let{root:t,container:n}=this;if(t==null||n==null)return!1;let r=e===`header`?this.header:this.footer,i=e===`header`?this.options.renderCodeViewHeader:this.options.renderCodeViewFooter;if(i==null)return r.element==null?!1:(this.resizeObserver?.unobserve(r.element),r.element.remove(),r.element=void 0,r.render=void 0,this.setHostHeight(r,0),!1);if(r.element!=null&&i===r.render)return!1;let a=r.element??he(e,n,this.resizeObserver);r.element=a;let o=i();return o==null?!this.isContainerManaged&&a.children.length>0&&(a.textContent=``):a.replaceChildren(o),r.render=i,!0}setHostHeight(e,t){e.height!==t&&(e.height=t,this.scrollDirty=!0)}measureMountedHosts(){this.header.element!=null&&this.setHostHeight(this.header,this.header.element.getBoundingClientRect().height),this.footer.element!=null&&this.setHostHeight(this.footer,this.footer.element.getBoundingClientRect().height)}setup(t){if(this.root!=null)throw Error(`CodeView.setup: already setup`);this.workerManager?.subscribeToThemeChanges(this),this.root=t,this.root.style.overflowAnchor=`none`,this.root.hasAttribute(`tabindex`)||(this.root.tabIndex=-1),this.container??=document.createElement(`div`),this.container.style.contain=`layout style`,this.syncLayout(),this.container.appendChild(this.stickyOffset),this.container.appendChild(this.stickyContainer),this.root.appendChild(this.container),this.scrollDirty=!0,this.heightDirty=!0,this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.stickyContainer),this.root.addEventListener(`scroll`,this.handleScroll,{passive:!0}),this.root.addEventListener(`wheel`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`touchstart`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`pointerdown`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`keydown`,this.clearPendingScroll,{passive:!0}),this.resizeObserver.observe(this.root),this.render(!0),window.__INSTANCE=this,window.__TOGGLE=()=>{e.__STOP?(e.__STOP=!1,this.scrollTo({type:`position`,position:e.__lastScrollPosition,behavior:`instant`})):(e.__lastScrollPosition=this.getScrollTop(),e.__STOP=!0)}}reset(){p(this.computeRenderRangeAndEmit),this.clearReadySubscription(),this.restoreScrollInteractions(),this.cleanAllRenderedItems();for(let e of this.itemEditors.values())e.editor.cleanUp();this.itemEditors.clear(),this.attachedEditors.clear(),this.selectedLines=null,this.items.length=0,this.idToItem.clear(),this.instanceToItem.clear(),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,this.stickyContainer.textContent=``,this.stickyOffset.style.height=``,this.container?.style.removeProperty(`height`),this.containerHeight=-1,this.windowSpecs={top:0,bottom:0},this.pendingLayoutAnchor=void 0,this.shouldFixContainerFocus=!1,this.height=0,this.scrollTop=0,this.scrollPageOffset=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.resetRenderState(),this.isContainerManaged||this.flushSlotCoordinator()}cleanUp(){this.reset(),this.clearElementPool(),this.restoreScrollInteractions(),this.workerManager?.unsubscribeToThemeChanges(this),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.root?.removeEventListener(`scroll`,this.handleScroll),this.root?.removeEventListener(`wheel`,this.clearPendingScroll),this.root?.removeEventListener(`touchstart`,this.clearPendingScroll),this.root?.removeEventListener(`pointerdown`,this.clearPendingScroll),this.root?.removeEventListener(`keydown`,this.clearPendingScroll),this.root?.style.removeProperty(`overflow-anchor`),this.container?.remove(),this.stickyOffset.remove(),this.stickyContainer.remove(),this.stickyContainer.textContent=``,this.header.element?.remove(),this.header.element=void 0,this.header.render=void 0,this.header.height=0,this.footer.element?.remove(),this.footer.element=void 0,this.footer.render=void 0,this.footer.height=0,this.root=void 0,this.container=void 0}cleanAllRenderedItems(){if(this.renderState.firstIndex!==-1)for(let e=this.renderState.firstIndex;e<=this.renderState.lastIndex;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.cleanAllRenderedItems: Item does not exist at index: ${e}`);this.releaseRenderedItem(t)}}primeScrollTarget(e){e.type!==`position`&&this.idToItem.get(e.id)?.instance.primeHighlightCache()}getElementPoolLimit(){let e=this.getHeight()+this.config.overscrollSize*2,{diffHeaderHeight:t}=this.itemMetricsCache;return Math.max(8,Math.ceil(e/Math.max(t,10))+1)*(this.isContainerManaged?2:1)}acquireElement(){this.promotePendingPooledElements();let e=this.elementPool.pop();for(;e!=null&&!this.isElementPoolGenerationCurrent(e);)e=this.elementPool.pop();return e??=document.createElement(ee),this.markElementPoolGenerationCurrent(e),e}releaseRenderedItem(e){let{element:t}=e;t!=null&&this.renderedItemOwnsFocus(t)&&(this.shouldFixContainerFocus=!0),e.instance.cleanUp(!0),this.attachedEditors.delete(e.item.id),e.element=void 0,t!=null&&(t.remove(),this.cleanElement(t),this.queueElementForPool(t))}renderedItemOwnsFocus(e){let{activeElement:t}=document;return t===e||e.contains(t)||e.shadowRoot?.activeElement!=null}fixContainerFocus(){this.shouldFixContainerFocus&&(this.shouldFixContainerFocus=!1,this.root?.focus({preventScroll:!0}))}cleanElement(e){let{shadowRoot:t}=e;if(t!=null)for(let e of Array.from(t.children))Pe(e)||e.remove();this.isContainerManaged||e.replaceChildren()}queueElementForPool(e){let t=this.getElementPoolLimit();!this.isElementPoolGenerationCurrent(e)||this.getElementPoolSize()>=t||(this.isElementClean(e)?this.elementPool.push(e):this.pendingElementPool.push(e))}promotePendingPooledElements(){if(this.pendingElementPool.length===0)return;let{pendingElementPool:e}=this;this.pendingElementPool=[];let t=this.getElementPoolLimit();for(let n of e)this.isElementPoolGenerationCurrent(n)&&this.isElementClean(n)&&this.elementPool.length<t?this.elementPool.push(n):this.isElementPoolGenerationCurrent(n)&&this.getElementPoolSize()<t&&this.pendingElementPool.push(n)}isElementClean(e){return e.childNodes.length===0}getElementPoolSize(){return this.elementPool.length+this.pendingElementPool.length}clearElementPool(){this.elementPool.length=0,this.pendingElementPool.length=0}invalidateElementPool(){this.elementPoolVersion++,this.clearElementPool()}markElementPoolGenerationCurrent(e){this.elementPoolTracker.set(e,this.elementPoolVersion)}isElementPoolGenerationCurrent(e){return this.elementPoolTracker.get(e)===this.elementPoolVersion}resolveEffectiveScrollBehavior(e,t){return ge()?`instant`:e.behavior===`smooth-auto`?Math.abs(t-this.getScrollTop())<=this.getHeight()*10?`smooth`:`instant`:e.behavior??`instant`}scrollTo(e){if(this.root==null)return;let t=this.normalizeScrollTarget(e);if(t==null)return;let n=this.resolveScrollTargetTop(t);n!=null&&(this.primeScrollTarget(t),this.resolveEffectiveScrollBehavior(t,n)===`smooth`?this.scrollAnimation??={position:this.getScrollTop(),velocity:0,lastTimestamp:performance.now()}:this.scrollAnimation=void 0,this.suspendScrollInteractions(),this.pendingLayoutAnchor=void 0,this.pendingScrollTarget=t,this.render())}setSelectedLines(e,t){this.applySelectedLines(e,t)}getSelectedLines(){return this.selectedLines}clearSelectedLines(e){this.applySelectedLines(null,e)}getItem(e){return this.idToItem.get(e)?.item}getEditor(e){return this.itemEditors.get(e)?.editor}updateItem(e){let t=this.idToItem.get(e.id);return t==null?(console.error(`CodeView.updateItem: unknown item id "${e.id}"`),!1):this.syncItemRecord(t,e)?(this.markItemLayoutDirty(t),this.scrollDirty=!0,this.render(),this.syncSelection(),this.syncItemEditors(),!0):!1}updateItemId(e,t){if(e===t)return!0;let n=this.idToItem.get(e);if(n==null)return console.error(`CodeView.updateItemId: unknown item id "${e}"`),!1;if(this.idToItem.has(t))return console.error(`CodeView.updateItemId: duplicate item id "${t}"`),!1;this.idToItem.delete(e),n.item.id=t,this.idToItem.set(t,n),this.updateItemOptionsId(n.instance.options,t),this.selectedLines?.id===e&&(this.selectedLines={...this.selectedLines,id:t},this.options.onSelectedLinesChange?.(this.selectedLines));let r=this.itemEditors.get(e);return r!=null&&(r.state.id=t,this.itemEditors.delete(e),this.itemEditors.set(t,r),this.attachedEditors.delete(e)&&this.attachedEditors.add(t)),this.renamePendingScrollTarget(e,t),this.renamePendingLayoutAnchor(e,t),this.render(),!0}addItem(e){this.addItems([e])}addItems(e){this.appendItemsInternal(e),this.syncSelection(),this.syncItemEditors()}setItems(e){if(e.length===0){let e=[];for(let t of this.itemEditors.values()){let{lastChange:n}=t.state;n!=null&&e.push(n)}this.reset();for(let{item:t,file:n,lineAnnotations:r}of e)this.options.onItemEditComplete?.(t,n,r)}else this.items.length===0?this.appendItemsInternal(e):this.tryAppendItems(e)||this.reconcileItems(e);this.syncSelection(),this.syncItemEditors()}appendItemsInternal(e,t=!0){if(e.length===0)return;let n=this.getLayout(),r=this.items.length===0?0:this.scrollHeight+n.gap,i=r;for(let t=0;t<e.length;t++){let i=e[t];if(i==null)throw Error(`CodeView.appendItemsInternal: missing input item`);if(this.idToItem.has(i.id))throw Error(`CodeView.addItem: duplicate id "${i.id}"`);let a=this.createItem(i,this.items.length,r);this.items.push(a),this.idToItem.set(a.item.id,a),this.instanceToItem.set(a.instance,a),a.height=Ae(a),r+=a.height+n.gap}this.scrollHeight=r-n.gap,this.scrollDirty=!0,t&&(this.canSkipRenderForAppend(i)?this.syncContainerHeight():this.render())}canSkipRenderForAppend(e){return this.container!=null&&this.renderState.firstIndex!==-1&&this.pendingScrollTarget==null&&this.scrollAnimation==null&&this.layoutDirtyIndex==null&&e>this.windowSpecs.bottom}onThemeChange(){this.invalidateElementPool()}setOptions(e){if(e==null)return;this.capturePendingLayoutAnchor();let{options:t}=this,n=this.getLayout(),{itemMetricsCache:r}=this;je(t,e)&&this.invalidateElementPool(),this.options=e;let i=this.computeMetricsCache(e.itemMetrics),a=!m(r,i),o=!m(n,this.getLayout());o&&this.syncLayout();let s=a||Me(t,e);if(s){let n=this.pendingLayoutReset;this.pendingLayoutReset={metrics:a?i:n?.metrics,resetFileLayoutCache:!0,resetDiffLayoutCache:!0,includeEstimatedDiffHeights:n?.includeEstimatedDiffHeights===!0||a||Ne(t,e)}}(o||s)&&(this.markLayoutDirtyFromIndex(0),this.scrollDirty=!0),f(t,e)||this.renderOptionsRevision++,this.syncItemEditors();let c=t.renderCodeViewHeader!==e.renderCodeViewHeader||t.renderCodeViewFooter!==e.renderCodeViewFooter;!this.isContainerManaged&&(this.items.length>0||c)&&this.render()}capturePendingLayoutAnchor(){this.root==null||this.items.length===0||this.pendingScrollTarget!=null||(this.pendingLayoutAnchor=this.getScrollAnchor(this.getScrollTop()))}render(t=!1){e.__STOP||(t?(p(this.computeRenderRangeAndEmit),this.computeRenderRangeAndEmit()):l(this.computeRenderRangeAndEmit))}isReady(){let{workerManager:e}=this;return e==null||e.isInitialized()||e.getStats().workersFailed?(this.clearReadySubscription(),!0):(this.isReadySubscription??=e.subscribeToStatChanges(e=>{e.managerState!==`initialized`&&!e.workersFailed||(this.clearReadySubscription(),this.render(!0))}),e.getStats().managerState===`waiting`&&e.initialize().catch(()=>{}),!1)}clearReadySubscription(){this.isReadySubscription!=null&&(this.isReadySubscription(),this.isReadySubscription=void 0)}instanceChanged(e,t){let n=this.instanceToItem.get(e);if(n==null)throw Error(`CodeView.instanceChanged: An instance has changed that is not registered`);t&&this.markItemLayoutDirty(n),this.render()}getWindowSpecs(){return this.windowSpecs}getContainerElement(){return this.root}getHeaderElement(){return this.header.element}getFooterElement(){return this.footer.element}getRenderedItems(){let{firstIndex:e,lastIndex:t}=this.renderState;if(e===-1||t===-1||t<e)return[];let n=[];for(let r=e;r<=t;r++){let e=this.items[r];e?.element!=null&&(e.type===`diff`?n.push({id:e.item.id,type:`diff`,item:e.item,version:e.version,element:e.element,instance:e.instance}):n.push({id:e.item.id,type:`file`,item:e.item,version:e.version,element:e.element,instance:e.instance}))}return n}setSlotCoordinator(e){return e===this.slotCoordinator?!1:(this.slotCoordinator=e,this.slotSnapshot=void 0,!0)}getSlotSnapshot(e){return this.buildSlotSnapshot(e)}buildSlotSnapshot(e){let t=Be(this.getRenderedItems(),e),{element:n}=this.header,{element:r}=this.footer;if(!(t==null&&n==null&&r==null))return{items:t,header:n,footer:r}}subscribeToScroll(e){return this.scrollListeners.add(e),()=>{this.scrollListeners.delete(e)}}getLocalTopForInstance(e){let t=this.instanceToItem.get(e);if(t==null)throw Error(`CodeView.getLocalTopForInstance: unknown virtualized instance`);return t.top}getTopForItem(e){let t=this.idToItem.get(e);if(t!=null)return t.top+this.getItemTopOffset()}createItem(e,t,n){let{itemMetricsCache:r}=this;if(e.type===`diff`){let i=new E(this.createDiffOptions(e.id),this,r,this.workerManager,this.isContainerManaged);return{type:`diff`,item:e,version:e.version,index:t,top:n,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:i}}let i=new k(this.createFileOptions(e.id),this,r,this.workerManager,this.isContainerManaged);return{type:`file`,item:e,version:e.version,index:t,top:n,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:i}}applySelectedLines(e,t){let{selectedLines:n}=this;e==null&&n==null||e!=null&&n?.id===e.id&&s(n.range,e.range)||(n!=null&&n.id!==e?.id&&this.idToItem.get(n.id)?.instance.setSelectedLines(null,{notify:!1}),this.selectedLines=e,this.idToItem.get(e?.id??``)?.instance.setSelectedLines(e?.range??null,t))}syncSelection(){if(this.selectedLines==null)return;let e=this.idToItem.get(this.selectedLines.id);if(e==null){this.selectedLines=null;return}e.instance.setSelectedLines(this.selectedLines.range,{notify:!1})}isItemInEditMode(e){return this.options.createEditor!=null&&e.item.edit===!0&&e.item.collapsed!==!0}isReceiverEdited(e,t){let n=q(e);if(n==null)return!1;let r=this.getItemOptions(n,t);return r!=null&&this.isItemInEditMode(r)}attachItemEditor(e){let{id:t}=e.item,{createEditor:n}=this.options;if(n==null||e.element==null||this.attachedEditors.has(t)||!this.isItemInEditMode(e))return;let r=this.itemEditors.get(t);if(r==null){let e={id:t},i=n({onChange:(t,n)=>{let r=this.idToItem.get(e.id);r!=null&&(e.lastChange={item:r.item,file:t,lineAnnotations:n},this.options.onItemEditChange?.(r.item,t,n))}});if(i==null)return;r={editor:i,state:e},this.itemEditors.set(t,r)}this.selectedLines?.id===t&&this.applySelectedLines(null,{notify:!1}),r.editor.edit(e.instance),this.attachedEditors.add(t)}syncItemEditors(){if(this.itemEditors.size===0)return;let e=[];for(let[t,n]of this.itemEditors){let r=this.idToItem.get(t);if(r!=null&&this.isItemInEditMode(r))continue;n.editor.cleanUp(),this.itemEditors.delete(t),this.attachedEditors.delete(t);let i=r?.item??n.state.lastChange?.item;i?.type===`diff`&&(r!=null&&r.type===`diff`&&r.instance.completeEditSession()&&(this.markItemLayoutDirty(r),this.render()),D(i.fileDiff));let{lastChange:a}=n.state;a!=null&&e.push(r==null?a:{...a,item:r.item})}for(let{item:t,file:n,lineAnnotations:r}of e)this.options.onItemEditComplete?.(t,n,r)}renamePendingScrollTarget(e,t){let{pendingScrollTarget:n}=this;n==null||n.type===`position`||n.id!==e||(this.pendingScrollTarget={...n,id:t})}renamePendingLayoutAnchor(e,t){this.pendingLayoutAnchor?.id===e&&(this.pendingLayoutAnchor.id=t)}createFileOptionsPrototype(){let e={};for(let t of ve)G.has(t)||J(e,t,()=>this.options[t]);J(e,`useTokenTransformer`,e=>this.isReceiverEdited(e,`file`)?!0:this.options.useTokenTransformer),J(e,`enableGutterUtility`,e=>this.isReceiverEdited(e,`file`)?!1:this.options.enableGutterUtility),J(e,`enableLineSelection`,e=>this.isReceiverEdited(e,`file`)?!1:this.options.enableLineSelection),J(e,`lineHoverHighlight`,e=>this.isReceiverEdited(e,`file`)?`disabled`:this.options.lineHoverHighlight),J(e,`stickyHeader`,()=>this.options.stickyHeaders),J(e,`collapsed`,e=>{let t=q(e);if(t!=null)return this.getItemOptions(t,`file`)?.item.collapsed});for(let t of ye)this.defineItemSharedCallback(e,`file`,t);for(let t of be)this.defineItemSelectionCallback(e,`file`,t);return e}createDiffOptionsPrototype(){let e={};for(let t of _e)G.has(t)||J(e,t,()=>this.options[t]);J(e,`useTokenTransformer`,e=>this.isReceiverEdited(e,`diff`)?!0:this.options.useTokenTransformer),J(e,`enableGutterUtility`,e=>this.isReceiverEdited(e,`diff`)?!1:this.options.enableGutterUtility),J(e,`enableLineSelection`,e=>this.isReceiverEdited(e,`diff`)?!1:this.options.enableLineSelection),J(e,`lineHoverHighlight`,e=>this.isReceiverEdited(e,`diff`)?`disabled`:this.options.lineHoverHighlight),J(e,`stickyHeader`,()=>this.options.stickyHeaders),J(e,`hunkSeparators`,()=>this.options.hunkSeparators),J(e,`collapsed`,e=>{let t=q(e);if(t!=null)return this.getItemOptions(t,`diff`)?.item.collapsed});for(let t of ye)this.defineItemSharedCallback(e,`diff`,t);for(let t of be)this.defineItemSelectionCallback(e,`diff`,t);return e}createFileOptions(e){let t=Object.create(this.fileOptionsPrototype);return xe(t,{id:e}),t}createDiffOptions(e){let t=Object.create(this.diffOptionsPrototype);return xe(t,{id:e}),t}updateItemOptionsId(e,t){let n=q(e);if(n==null)throw Error(`CodeView.updateItemOptionsId: No valid state`);n.id=t}getItemOptions(e,t){let n=this.idToItem.get(e.id);if(!(n==null||n.type!==t))return n}defineItemSharedCallback(e,t,n){J(e,n,e=>{if(this.options[n]==null)return;let r=q(e);if(r==null)return;let i=r.callbackCache??={},a=i[n];return a??(a=((...e)=>{let i=this.getItemOptions(r,t);if(i==null)return;let a=this.options[n];return a?.(...e,i)}),i[n]=a),a})}defineItemSelectionCallback(e,t,n){J(e,n,e=>{if(this.options.enableLineSelection!==!0)return;let r=q(e);if(r==null)return;let i=this.getItemOptions(r,t);if(i!=null&&this.isItemInEditMode(i))return;let a=r.callbackCache??={},o=a[n];return o??(o=(e=>{let i=this.getItemOptions(r,t);if(i==null)return;let a=e==null?null:{id:i.item.id,range:e};this.options.controlledSelection!==!0&&(e!=null||this.selectedLines?.id===i.item.id)&&this.applySelectedLines(a,{notify:!1}),this.options.onSelectedLinesChange?.(a);let o=this.options[n];return o?.(e,i)}),a[n]=o),o})}markLayoutDirtyFromIndex(e){this.layoutDirtyIndex=Math.min(this.layoutDirtyIndex??e,e)}markItemLayoutDirty(e){if(this.items[e.index]!==e)throw Error(`CodeView.markItemLayoutDirty: unknown item id "${e.item.id}"`);this.markLayoutDirtyFromIndex(e.index)}tryAppendItems(e){if(e.length<=this.items.length)return!1;for(let t=0;t<this.items.length;t++){let n=this.items[t];if(n==null)throw Error(`CodeView.tryAppendItems: missing existing item`);let r=e[t];if(r==null||n.item.id!==r.id||n.type!==r.type)return!1}for(let t=0;t<this.items.length;t++){let n=this.items[t];if(n==null)throw Error(`CodeView.tryAppendItems: missing existing item`);let r=e[t];if(r==null)throw Error(`CodeView.tryAppendItems: append candidate missing prefix item`);this.syncItemRecord(n,r)&&this.markLayoutDirtyFromIndex(t)}return this.appendItemsInternal(e.slice(this.items.length),!1),this.scrollDirty=!0,this.render(),!0}reconcileItems(e){let{items:t,idToItem:n}=this,r=new Set(t),i=[],a=new Map,o=new Map,s;for(let c=0;c<e.length;c++){let l=e[c];if(l==null)throw Error(`CodeView.reconcileItems: missing input item`);if(a.has(l.id))throw Error(`CodeView.setItems: duplicate id "${l.id}"`);let u=n.get(l.id),d=u!=null&&u.type===l.type?u:this.createItem(l,c,0);d.index=c,u!=null&&u.type===l.type?(r.delete(u),this.syncItemRecord(d,l)&&(s=Math.min(s??c,c))):s=Math.min(s??c,c),t[c]!==d&&(s=Math.min(s??c,c)),i.push(d),a.set(l.id,d),o.set(d.instance,d)}for(let e=0;e<t.length;e++){let n=t[e];if(n==null||!r.has(n))continue;this.releaseRenderedItem(n);let a=Math.max(i.length-1,0);s=Math.min(s??a,a)}s!=null&&(this.items=i,this.idToItem=a,this.instanceToItem=o,this.renderState.firstIndex>=i.length?this.resetRenderState():this.renderState.lastIndex>=i.length&&(this.renderState.lastIndex=i.length-1),this.markLayoutDirtyFromIndex(s),this.scrollDirty=!0,this.render())}syncItemRecord(e,t){if(e.type!==t.type)throw Error(`CodeView.syncItemRecord: type mismatch for id "${t.id}"`);return e.version===t.version?!1:(e.item=t,e.version=t.version,e.renderedOptionsRevision=-1,!0)}getMaxScrollTopForHeight(e){let{paddingBottom:t,paddingTop:n}=this.getLayout();return Math.max(n+this.header.height+e+this.footer.height+t-this.getHeight(),0)}getMaxScrollTop(){return this.getMaxScrollTopForHeight(this.getScrollHeight())}shouldRebaseScroll(){return this.getMaxScrollTop()>De}getPagedScrollHeight(){return this.shouldRebaseScroll()?Math.min(this.getScrollHeight(),Y):this.getScrollHeight()}getMaxPagedScrollTop(){return this.getMaxScrollTopForHeight(this.getPagedScrollHeight())}clampPagedScrollTop(e){let t=this.getMaxPagedScrollTop();return Math.max(0,Math.min(e,t))}clampScrollTop(e){let t=this.getMaxScrollTop();return Math.max(0,Math.min(e,t))}getMaxScrollPageOffset(){return Math.max(this.getMaxScrollTop()-this.getMaxPagedScrollTop(),0)}clampScrollPageOffset(e){let t=this.getMaxScrollPageOffset();return Math.max(0,Math.min(e,t))}resolveScrollPageWindow(e,t){let n=W(this.clampPagedScrollTop(t)),r=this.clampScrollPageOffset(e-n);return n=W(this.clampPagedScrollTop(e-r)),r=this.clampScrollPageOffset(e-n),{pagedScrollTop:n,scrollPageOffset:r}}resolvePagedScrollPosition(e){if(!this.shouldRebaseScroll())return{pagedScrollTop:this.clampPagedScrollTop(e),scrollPageOffset:0};let t=this.clampScrollPageOffset(this.scrollPageOffset),n=e-t,r=this.getMaxPagedScrollTop(),i=this.getMaxScrollPageOffset(),a=n>De&&t<i,o=n<we&&t>0;return n<0||n>r||a||o?this.resolveScrollPageWindow(e,o?Math.min(Ee,r):Te):{pagedScrollTop:W(this.clampPagedScrollTop(n)),scrollPageOffset:t}}needsScrollPageUpdate(e){let t=W(this.clampScrollTop(e)),{scrollPageOffset:n}=this.resolvePagedScrollPosition(t);return n!==this.scrollPageOffset}getPagedLayoutTop(e){return this.shouldRebaseScroll()?Math.max(e-this.scrollPageOffset,0):e}getStickyHeaderOffset(){return this.options.stickyHeaders===!0&&this.options.disableFileHeader!==!0?this.itemMetricsCache.diffHeaderHeight:0}getScrollTargetRect(e){let t=this.idToItem.get(e.id);if(t==null){console.warn(`CodeView.scrollTo: unknown item id "${e.id}"`);return}if(e.type===`item`)return{top:t.top,height:t.height};if(e.type===`range`){let n=this.getRangeScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve range ${Fe(e.range)} for item "${e.id}"`);return}return{top:t.top+n.top,height:n.height}}let n=this.getLineScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve line ${e.lineNumber} for item "${e.id}"`);return}return{top:t.top+n.top,height:n.height}}normalizeScrollTarget(e){if(e.type===`position`||e.align!==`nearest`)return e;let t=this.getScrollTargetRect(e);if(t==null)return;let n=e.offset??0,r=this.getItemTopOffset()+t.top,i=r+t.height,a=this.getScrollTop(),o=a+(e.type===`line`||e.type===`range`?this.getStickyHeaderOffset():0),s=a+this.getHeight();if(!(r-n<=o&&i+n>=s)){if(r-n<o)return{...e,align:`start`};if(i+n>s)return{...e,align:`end`}}}resolveScrollTargetTop(e){if(e.type===`position`){let t=this.clampScrollTop(e.position);return t===e.position?this.clampScrollTop(e.position-this.getStickyHeaderOffset()):t}let t=this.idToItem.get(e.id);if(t==null){console.warn(`CodeView.scrollTo: unknown item id "${e.id}"`);return}if(e.type===`item`)return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top,t.height,e.align,e.offset));if(e.type===`range`){let n=this.getRangeScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve range ${Fe(e.range)} for item "${e.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top+n.top,n.height,e.align,e.offset,this.getStickyHeaderOffset()))}let n=this.getLineScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve line ${e.lineNumber} for item "${e.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top+n.top,n.height,e.align,e.offset,this.getStickyHeaderOffset()))}resolveAlignedScrollPosition(e,t,n,r=0,i=0){e+=this.getItemTopOffset();let a=this.getHeight();return n===`center`&&t+r<a?e-(a-t)/2+r:n===`end`?e-(a-t)+r:e-i-r}getLineScrollPosition(e,t){return e.type===`diff`?e.instance.getLinePosition(t.lineNumber,t.side):e.instance.getLinePosition(t.lineNumber)}getRangeScrollPosition(e,t){let{range:n}=t,r=this.getLineScrollPosition(e,{type:`line`,id:t.id,lineNumber:n.start,side:n.side}),i=this.getLineScrollPosition(e,{type:`line`,id:t.id,lineNumber:n.end,side:n.endSide??n.side});if(r==null||i==null)return;let a=r.top,o=a+r.height,s=i.top,c=s+i.height,l=Math.min(a,s);return{top:l,height:Math.max(o,c)-l}}computeTargetScrollTopForFrame(e,t){if(this.pendingScrollTarget==null)return e;let n=this.resolveScrollTargetTop(this.pendingScrollTarget);if(n==null)return e;let{scrollAnimation:r}=this;return r==null?n:this.computeSpringStep(r,n,t).position}computeSpringStep(e,t,n){let r=Math.max(0,n-e.lastTimestamp),{omega:i}=this.getSmoothScrollSettings(),a=Math.exp(-i*r),o=e.position-t,s=e.velocity+i*o;return{position:t+(o+s*r)*a,velocity:(s*(1-i*r)-i*o)*a}}advanceScrollAnimation(e,t){if(this.pendingScrollTarget==null)return;let n=this.resolveScrollTargetTop(this.pendingScrollTarget);if(n==null){this.pendingScrollTarget=void 0,this.scrollAnimation=void 0;return}let r=this.scrollAnimation;if(r==null)return n;r.position+=t;let{position:i,velocity:a}=this.computeSpringStep(r,n,e);r.lastTimestamp=e,r.position=i,r.velocity=a;let{positionEpsilon:o,velocityEpsilon:s}=this.getSmoothScrollSettings();return Math.abs(n-i)<=o&&Math.abs(a)<=s?(r.position=n,r.velocity=0,this.scrollAnimation=void 0,n):r.position}computeRenderRangeAndEmit=(t=performance.now())=>{if(e.__STOP||this.container==null||!this.isReady())return;let n=this.getHeight(),r=this.getScrollTop(),i=r,a=this.pendingLayoutAnchor!=null,o=this.getScrollAnchor(i);if(this.layoutDirtyIndex!=null&&(this.recomputeLayout(this.layoutDirtyIndex,this.pendingLayoutReset),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,a=!0),a&&o!=null){let e=this.resolveAnchoredScrollTop(o);if(e!=null){let t=e-i;i=e,this.scrollAnimation!=null&&(this.scrollAnimation.position+=t)}}a&&(i=this.clampScrollTop(i),this.syncContainerHeight());let s=this.computeTargetScrollTopForFrame(i,t),c=!a&&(this.renderState.scrollTop===-1||Math.abs(s-this.renderState.scrollTop)>n+this.config.overscrollSize*2);c&&(o=void 0),this.windowSpecs=T({scrollTop:s-this.header.height,height:n,scrollHeight:this.getScrollHeight(),fitPerfectly:c,fitPerfectlyOverscroll:this.getFitPerfectlyOverscroll(),overscrollSize:this.config.overscrollSize});let l=r;(this.pendingScrollTarget!=null&&s!==l||this.needsScrollPageUpdate(s))&&(this.applyScrollFix(s,l,this.windowSpecs),l=s);let{top:u,bottom:d}=this.windowSpecs,{firstIndex:f,lastIndex:p}=this.renderState;if(f>=0)for(let e=f;e<=p;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.computeRenderRangeAndEmit: No item at index: ${e}`);t.top>u-t.height&&t.top<=d||this.releaseRenderedItem(t)}let m=this.reconcileHeaderFooterHosts(),h,g=new Set,_=this.findFirstVisibleIndex(u),v=this.findLastVisibleIndex(d);for(let e=_;e<=v;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.computeRenderRangeAndEmit: missing item`);let{instance:n}=t;t.element==null?(t.element=this.acquireElement(),Re(this.stickyContainer,t.element,h),n.virtualizedSetup(),Le(t,t.element)&&(t.renderedOptionsRevision=this.renderOptionsRevision,g.add(t)),h=t.element):(Re(this.stickyContainer,t.element,h),Le(t,void 0,t.renderedOptionsRevision!==this.renderOptionsRevision)&&(t.renderedOptionsRevision=this.renderOptionsRevision,g.add(t)),h=t.element),t.item.edit===!0&&this.attachItemEditor(t)}this.renderState.firstIndex=_<=v?_:-1,this.renderState.lastIndex=v,this.flushSlotCoordinator(),this.flushManagers(g),m&&this.measureMountedHosts(),this.reconcileRenderedItems(g),this.syncContainerHeight(),this.updateStickyPositioning();let y=o==null?void 0:this.resolveAnchoredScrollTop(o);o===this.pendingLayoutAnchor&&(this.pendingLayoutAnchor=void 0);let b=y==null?0:y-i,x=s,S=!1;if(this.pendingScrollTarget!=null){let e=this.advanceScrollAnimation(t,b);e==null?x=i:(x=e,S=!0)}else x=y??s;x!==l&&(this.applyScrollFix(x,l,this.windowSpecs),l=x),S&&this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),this.renderState.scrollTop=W(l),this.updateStickyPositioning(),this.validateStickyContainerHeight(),this.fixContainerFocus(),(c||this.scrollAnimation!=null)&&this.render()};flushManagers(e){for(let t of e)t.instance.flushManagers()}syncContainerHeight(){let e=this.getPagedScrollHeight();this.container==null||this.containerHeight===e||(this.container.style.height=`${e}px`,this.containerHeight=e)}getStickyBounds(e){let{firstIndex:t,lastIndex:n}=e==null?this.renderState:{firstIndex:this.findFirstVisibleIndex(e.top),lastIndex:this.findLastVisibleIndex(e.bottom)};if(t===-1||n===-1||t>n)return;let r=this.items[t]?.instance.getAdvancedStickySpecs(e),i=this.items[n]?.instance.getAdvancedStickySpecs(e);if(!(r==null||i==null))return{stickyTop:this.getPagedLayoutTop(Math.max(r.topOffset,0)),stickyBottom:this.getPagedLayoutTop(i.topOffset+i.height)}}applyStickyPositioning({stickyTop:e,stickyBottom:t}){let n=this.getHeight(),{itemMetricsCache:r}=this,i=t-e;this.renderState.stickyHeight=i,this.renderState.stickyTop=e,this.renderState.stickyBottom=t,this.stickyOffset.style.height=`${e}px`;let a=(Math.random()*r.lineHeight>>0)*-1,o=-Math.max(i+a,0)+n;this.stickyContainer.style.top=`${o}px`,this.stickyContainer.style.bottom=`${o+r.diffHeaderHeight}px`}syncPagedScrollScaffolding(e){this.syncContainerHeight();let t=this.getStickyBounds(e);t!=null&&this.applyStickyPositioning(t)}reconcileRenderedItems(e){let{firstIndex:t,lastIndex:n}=this.renderState;if(t===-1)return;let r=-1,i=!1;for(let a=t;a<this.items.length&&!(!i&&a>n);a++){let t=this.items[a];if(t==null)throw Error(`CodeView.reconcileRenderedItems: Invalid item`);r===-1?r=t.top:t.top!==r&&(t.top=r,t.instance.syncVirtualizedTop(),i=!0),(e==null?a<=n:e.has(t))&&(t.instance.reconcileHeights()&&(i=!0,t.height=t.instance.getVirtualizedHeight()),this.validateRenderedItemHeight(t)),r+=t.instance.getVirtualizedHeight(),a<this.items.length-1&&(r+=this.getLayout().gap)}i&&r!=null&&(this.scrollDirty=!0,this.scrollHeight=r)}updateStickyPositioning(){let e=this.getStickyBounds();if(e==null)return;let{stickyTop:t,stickyBottom:n}=e;n-t===this.renderState.stickyHeight&&t===this.renderState.stickyTop&&n===this.renderState.stickyBottom||this.applyStickyPositioning(e)}handleScroll=()=>{e.__STOP||(this.suspendScrollInteractions(),this.scrollDirty=!0,this.notifyScroll(),this.render())};clearPendingScroll=()=>{this.pendingScrollTarget=void 0,this.pendingLayoutAnchor=void 0,this.scrollAnimation=void 0};handleResize=e=>{for(let t of e)if(t.target===this.stickyContainer){if(t.borderBoxSize[0].blockSize!==this.renderState.stickyHeight){let e=this.getScrollTop(),t=this.getScrollAnchor(e);this.reconcileRenderedItems(),this.updateStickyPositioning();let n=t==null?void 0:this.resolveAnchoredScrollTop(t);if(n!=null){let t=n-e;this.applyScrollFix(n,e,this.windowSpecs),this.scrollAnimation!=null&&(this.scrollAnimation.position+=t)}this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0)}}else if(t.target===this.header.element||t.target===this.footer.element){let e=t.target===this.header.element?this.header:this.footer,n=t.borderBoxSize[0].blockSize;if(n!==e.height){let t=this.getScrollTop(),r=this.getScrollAnchor(t);this.setHostHeight(e,n);let i=r==null?void 0:this.resolveAnchoredScrollTop(r);if(i!=null){let e=i-t;this.applyScrollFix(i,t,this.windowSpecs),this.scrollAnimation!=null&&(this.scrollAnimation.position+=e)}this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),this.render()}}else this.scrollDirty=!0,this.heightDirty=!0,this.render()};getScrollAnchorViewportTop(e,t){return e<t?t+this.getStickyHeaderOffset():t}getScrollAnchor(e){if(this.pendingLayoutAnchor!=null)return this.pendingLayoutAnchor;if(e<=0)return;let{firstIndex:t,lastIndex:n,stickyTop:r,stickyBottom:i}=this.renderState;if(t===-1||n===-1)return;let a=this.getHeight();if(!(r===-1||i===-1))for(let r=t;r<=n;r++){let t=this.items[r];if(t==null)continue;let n=this.getItemTopOffset()+t.top;if(n+t.height<=e)continue;if(n>=e+a)break;if(n>=e)return{type:`item`,id:t.item.id,viewportOffset:n-e};let i=this.getScrollAnchorViewportTop(n,e)-n,o=t.instance.getNumericScrollAnchor(i);if(o!=null){let r=n+o.top;return{type:`line`,id:t.item.id,lineNumber:o.lineNumber,side:o.side,viewportOffset:r-e}}}}resolveAnchoredScrollTop(e){let t=this.idToItem.get(e.id);if(t==null)return;let n=this.getItemTopOffset();if(e.type===`item`){let r=n+t.top;return this.clampScrollTop(r-e.viewportOffset)}let r=t.type===`diff`?t.instance.getLinePosition(e.lineNumber,e.side):t.instance.getLinePosition(e.lineNumber);if(r==null)return;let i=n+t.top+r.top;return this.clampScrollTop(i-e.viewportOffset)}applyScrollFix(e,t,n){if(this.root==null)return;let r=W(this.clampScrollTop(e)),i=W(t),{scrollPageOffset:a}=this,o=W(this.clampPagedScrollTop(i-a)),{pagedScrollTop:s,scrollPageOffset:c}=this.resolvePagedScrollPosition(r),l=s,u=a!==c;r===this.renderState.scrollTop&&r===i&&l===o&&!u||(this.suspendScrollInteractions(),(l!==o||u)&&(this.scrollPageOffset=c,this.syncPagedScrollScaffolding(n)),l!==o&&this.root.scrollTo({top:l,behavior:`instant`}),this.renderState.scrollTop=r,this.scrollTop=r,this.scrollDirty=!1)}isPendingTargetSettled(e){let t=this.resolveScrollTargetTop(e);return t==null?!0:W(this.getScrollTop())===W(t)}getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let e=this.root?.scrollTop??0;return this.scrollTop=this.clampScrollTop(e+this.scrollPageOffset),this.scrollTop}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root?.getBoundingClientRect().height??0,this.height):this.height}getScrollHeight(){return this.scrollHeight}flushSlotCoordinator(){if(this.slotCoordinator==null)return;let e=this.buildSlotSnapshot(this.slotCoordinator);pe(this.slotSnapshot,e)||(this.slotSnapshot=e,this.slotCoordinator.onSnapshotChange(e))}notifyScroll(){if(this.scrollListeners.size===0)return;let e=this.getScrollTop();for(let t of this.scrollListeners)t(e,this)}findFirstVisibleIndex(e){let t=0,n=this.items.length-1,r=this.items.length;for(;t<=n;){let i=t+n>>1,a=this.items[i];if(a==null)throw Error(`CodeView.findFirstVisibleIndex: invalid item index`);a.top+a.height>e?(r=i,n=i-1):t=i+1}return r}findLastVisibleIndex(e){let t=0,n=this.items.length-1,r=-1;for(;t<=n;){let i=t+n>>1,a=this.items[i];if(a==null)throw Error(`CodeView.findLastVisibleIndex: invalid item index`);a.top<=e?(r=i,t=i+1):n=i-1}return r}recomputeLayout(e=0,t){if(this.items.length===0){this.scrollHeight=0;return}let n=this.getLayout(),r=0;if(e>0){let t=this.items[e-1];if(t==null)throw Error(`CodeView.recomputeLayout: invalid dirty index`);r=t.top+t.height+n.gap}for(let i=e;i<this.items.length;i++){let e=this.items[i];if(e==null)throw Error(`CodeView.recomputeLayout: invalid item index`);if(e.top=r,e.type===`diff`){let n=e.instance.consumeCodeViewLayoutChanges(e.item.fileDiff);n!=null&&Object.assign(e.item.fileDiff,n),e.height=e.instance.prepareCodeViewItem(e.item.fileDiff,r,t,e.item.annotations??[])}else e.height=e.instance.prepareCodeViewItem(e.item.file,r,t,e.item.annotations??[]);r+=e.height,i<this.items.length-1&&(r+=n.gap)}r!==this.scrollHeight&&(this.scrollDirty=!0),this.scrollHeight=r}resetRenderState(){this.renderState.scrollTop=-1,this.renderState.firstIndex=-1,this.renderState.lastIndex=-1,this.renderState.stickyHeight=0,this.renderState.stickyTop=-1,this.renderState.stickyBottom=-1}getFitPerfectlyOverscroll(){return this.getLayout().gap+this.itemMetricsCache.diffHeaderHeight}};function Ae(e){return e.instance.cleanUp(!0),e.type===`diff`?e.instance.prepareCodeViewItem(e.item.fileDiff,e.top,void 0,e.item.annotations??[]):e.instance.prepareCodeViewItem(e.item.file,e.top,void 0,e.item.annotations??[])}function je(e,t){return!v(e.theme??_,t.theme??_)||(e.themeType??`system`)!==(t.themeType??`system`)||e.unsafeCSS!==t.unsafeCSS}function Me(e,t){return(e.overflow??`scroll`)!==(t.overflow??`scroll`)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||e.unsafeCSS!==t.unsafeCSS||(e.diffStyle??`split`)!==(t.diffStyle??`split`)||(e.diffIndicators??`bars`)!==(t.diffIndicators??`bars`)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function Ne(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function Pe(e){return e instanceof SVGElement?!0:d(e)&&(e.hasAttribute(`data-core-css`)||e.hasAttribute(`data-theme-css`)||e.hasAttribute(`data-unsafe-css`))}function Fe(e){let t=Ie(e.start,e.side),n=Ie(e.end,e.endSide??e.side);return t===n?t:`${t}-${n}`}function Ie(e,t){return t==null?`${e}`:`${t===`deletions`?`D`:`A`}${e}`}function Le(e,t,n=!1){return e.type===`diff`?e.instance.render({deferManagers:!0,fileContainer:t,fileDiff:e.item.fileDiff,forceRender:n,lineAnnotations:e.item.annotations??[]}):e.instance.render({deferManagers:!0,fileContainer:t,file:e.item.file,forceRender:n,lineAnnotations:e.item.annotations??[]})}function Re(e,t,n){if(n==null){e.firstChild!==t&&e.prepend(t);return}n.nextSibling!==t&&n.after(t)}function ze(e){return(e.annotations?.length??0)>0}function Be(e,{hasHeaderRenderers:t,hasAnnotationRenderer:n,hasGutterRenderer:r}){if(e.length===0)return;if(t||r)return e;if(!n)return;let i=[];for(let t of e)ze(t.item)&&i.push(t);return i.length>0?i:void 0}var X=e(i(),1),Z=n(),Ve=typeof window>`u`?A.useEffect:A.useLayoutEffect;function He(e){return{instance:void 0,items:void 0,controlled:e,managedOptions:void 0,disableFlushSync:!1,slotCoordinator:void 0}}function Ue(e,t){let{className:n,containerRef:r,createEditor:i,disableWorkerPool:a=!1,initialItems:o,items:s,onItemEditChange:l,onItemEditComplete:d,onScroll:p,onSelectedLinesChange:m,options:h,renderAnnotation:g,renderCodeViewFooter:_,renderCodeViewHeader:v,renderCustomHeader:y,renderGutterUtility:b,renderHeaderFilenameSuffix:x,renderHeaderMetadata:S,renderHeaderPrefix:C,selectedLines:w,style:ee}=e,T=s!==void 0,te=(0,A.useContext)(c),E=(0,A.useRef)(He(T)),D=y!=null,O=g!=null,k=b!=null,j=D||C!=null||x!=null||S!=null,ne=j||O||k,M=v!=null,N=_!=null,P=u(e=>{m?.(e)}),F=w!==void 0,I=u(e=>i?.(e)),L=u((e,t,n)=>{l?.(e,t,n)}),R=u((e,t,n)=>{d?.(e,t,n)}),z=(0,A.useMemo)(()=>Je({options:h,hasCustomHeader:D,hasGutterRenderer:k,hasCodeViewHeader:M,hasCodeViewFooter:N,onSelectedLinesChange:m==null?void 0:P,controlledSelection:F,createEditor:i==null?void 0:I,onItemEditChange:l==null?void 0:L,onItemEditComplete:d==null?void 0:R}),[h,D,k,M,N,m,P,F,i,I,l,L,d,R]),[B]=(0,A.useState)(()=>qe()),[,V]=(0,A.useState)({}),re=u(e=>{E.current.instance!=null&&(e==null||e!==E.current.instance.getContainerElement())&&(E.current.instance.cleanUp(),B.publish(void 0),E.current=He(T)),e!=null&&e!==E.current.instance?.getContainerElement()&&(E.current.instance=new ke(z,a?void 0:te,!0),E.current.instance.setup(e)),typeof r==`function`?r(e):r!=null&&(r.current=e)}),H=u(e=>{E.current.disableFlushSync?B.publish(e):(0,X.flushSync)(()=>{B.publish(e)})}),U=(0,A.useMemo)(()=>{if(!(!j&&!O&&!k&&!M&&!N))return{hasHeaderRenderers:j,hasAnnotationRenderer:O,hasGutterRenderer:k,onSnapshotChange:H}},[H,O,k,j,M,N]);return Ve(()=>p==null?void 0:E.current.instance?.subscribeToScroll(p)),Ve(()=>{let{instance:e,controlled:t,items:n,managedOptions:r,slotCoordinator:i}=E.current;if(e!=null)try{E.current.disableFlushSync=!0;let a=!1;if(f(z,r)||(E.current.managedOptions=z,e.setOptions(z),a=!0),t!==T){console.error(`CodeView: cannot switch between controlled and uncontrolled modes. Remount with a new key instead.`);return}if(T)s!==n&&(Ke(n,s)?E.current.items=s:Ge(n,s)?(E.current.items=s,e.addItems(s.slice(n.length))):(E.current.items=s,e.setItems(s),a=!0));else if(n==null){let t=o??[];E.current.items=t,t.length>0&&(e.setItems(t),a=!0)}w!==void 0&&e.setSelectedLines(w,{notify:!1});let c=e.setSlotCoordinator(U),l=!1;U!==i&&((U==null||i==null)&&(l=!0),E.current.slotCoordinator=U),(a||c)&&e.render(!0),c&&U==null&&B.publish(void 0),l&&V({})}finally{E.current.disableFlushSync=!1}}),(0,A.useImperativeHandle)(t,()=>({addItems(e){let{controlled:t,instance:n}=E.current;Q(t,`addItems`),n==null?console.error(`CodeView.addItems: no valid instance to append items with`,e):n.addItems(e)},getItem(e){let{instance:t}=E.current;if(t==null){console.error(`CodeView.getItem: no valid instance exists`,e);return}else return t.getItem(e)},updateItem(e){let{controlled:t,instance:n}=E.current;return Q(t,`updateItem`),n==null?(console.error(`CodeView.updateItem: no valid instance to update item with`,e),!1):n.updateItem(e)},updateItemId(e,t){let{controlled:n,instance:r}=E.current;return Q(n,`updateItemId`),r==null?(console.error(`CodeView.updateItemId: no valid instance to update item id with`,e,t),!1):r.updateItemId(e,t)},scrollTo(e){let{instance:t}=E.current;t==null?console.error(`CodeView.scrollTo: no valid instance to scroll with`,e):t.scrollTo(e)},setSelectedLines(e){let{instance:t}=E.current;t==null?console.error(`CodeView.setSelectedLines: no valid instance to update selection with`,e):(t.setSelectedLines(e,{notify:!1}),P(e))},getSelectedLines(){let{instance:e}=E.current;return e==null?(console.error(`CodeView.getSelectedLines: no valid instance exists`),null):e.getSelectedLines()},clearSelectedLines(){let{instance:e}=E.current;e==null?console.error(`CodeView.clearSelectedLines: no valid instance to update selection with`):(e.clearSelectedLines({notify:!1}),P(null))},getEditor(e){let{instance:t}=E.current;if(t==null){console.error(`CodeView.getEditor: no valid instance exists`,e);return}return t.getEditor(e)},getInstance(){return E.current.instance}}),[P]),(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{ref:re,className:n,style:ee}),(ne||M||N)&&(0,Z.jsx)(Ye,{managedContentStore:B,renderCustomHeader:y,renderHeaderPrefix:C,renderHeaderFilenameSuffix:x,renderHeaderMetadata:S,renderAnnotation:g,renderGutterUtility:b,renderCodeViewHeader:v,renderCodeViewFooter:_})]})}var We=(0,A.forwardRef)(Ue);function Ge(e,t){if(e==null||t.length<=e.length)return!1;if(e.length===0)return!0;for(let n=0;n<e.length;n++)if(t[n]!==e[n])return!1;return!0}function Ke(e,t){if(e==null||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Q(e,t){if(e)throw Error(`CodeView.${t} cannot be used when CodeView is controlled. Use initialItems for imperative item updates.`)}function qe(){let e,t=new Set;return{getSnapshot(){return e},publish(n){if(!pe(e,n)){e=n;for(let e of t)e()}},subscribe(e){return t.add(e),()=>{t.delete(e)}}}}function Je({options:e,hasCustomHeader:t,hasGutterRenderer:n,hasCodeViewHeader:r,hasCodeViewFooter:i,onSelectedLinesChange:a,controlledSelection:o,createEditor:s,onItemEditChange:c,onItemEditComplete:l}){return!t&&!n&&!r&&!i&&a==null&&!o&&s==null&&c==null&&l==null?e??{}:(e={...e,controlledSelection:o,onSelectedLinesChange:a},s!=null&&(e.createEditor=s),c!=null&&(e.onItemEditChange=c),l!=null&&(e.onItemEditComplete=l),t&&(e.renderCustomHeader=$),n&&(e.renderGutterUtility=$),r&&(e.renderCodeViewHeader=$),i&&(e.renderCodeViewFooter=$),e)}var Ye=(0,A.memo)(function({managedContentStore:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:i,renderAnnotation:a,renderGutterUtility:o,renderCodeViewHeader:s,renderCodeViewFooter:c}){"use no memo";let l=u(t=>e.subscribe(t)),d=u(()=>e.getSnapshot()),f=(0,A.useSyncExternalStore)(l,d,d),p=``;for(let e of f?.items??[])p+=`${e.id}:${e.version}:${e.type}`;return(0,Z.jsxs)(Z.Fragment,{children:[(0,A.useMemo)(()=>f?.items?.map(e=>(0,X.createPortal)(Xe({renderedItem:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:i,renderAnnotation:a,renderGutterUtility:o}),e.element,e.id)),[t,n,r,i,a,o,p]),(0,A.useMemo)(()=>s!=null&&f?.header!=null?(0,X.createPortal)(s(),f.header):null,[s,f?.header]),(0,A.useMemo)(()=>c!=null&&f?.footer!=null?(0,X.createPortal)(c(),f.footer):null,[c,f?.footer])]})});function Xe({renderedItem:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:i,renderAnnotation:a,renderGutterUtility:o}){if(e.type===`diff`){let{item:s,instance:c}=e;return te({fileDiff:s.fileDiff,renderCustomHeader:t==null?void 0:()=>t(s),renderHeaderPrefix:n==null?void 0:()=>n(s),renderHeaderFilenameSuffix:r==null?void 0:()=>r(s),renderHeaderMetadata:i==null?void 0:()=>i(s),renderAnnotation:a==null?void 0:e=>a(e,s),lineAnnotations:s.annotations,renderGutterUtility:o==null?void 0:e=>o(e,s),getHoveredLine:c.getHoveredLine})}else{let{item:s,instance:c}=e;return O({file:s.file,renderCustomHeader:t==null?void 0:()=>t(s),renderHeaderPrefix:n==null?void 0:()=>n(s),renderHeaderFilenameSuffix:r==null?void 0:()=>r(s),renderHeaderMetadata:i==null?void 0:()=>i(s),renderAnnotation:a==null?void 0:e=>a(e,s),lineAnnotations:s.annotations,renderGutterUtility:o==null?void 0:e=>o(e,s),getHoveredLine:c.getHoveredLine})}}function $(){}var Ze=a(),Qe=`${x}
2
- :is(
3
- [data-line],
4
- [data-line-annotation],
5
- [data-merge-conflict],
6
- [data-merge-conflict-actions],
7
- [data-no-newline]
8
- )[data-selected-line] {
9
- --diffs-line-bg: light-dark(
10
- color-mix(
11
- in lab,
12
- var(--code-background) 88%,
13
- color-mix(in srgb, var(--code-background) 50%, var(--diffs-modified-base))
14
- ),
15
- color-mix(
16
- in lab,
17
- var(--code-background) 80%,
18
- color-mix(in srgb, var(--code-background) 70%, var(--diffs-modified-base))
19
- )
20
- ) !important;
21
- }
22
-
23
- :is([data-gutter-buffer], [data-column-number])[data-selected-line] {
24
- --diffs-line-bg: light-dark(
25
- color-mix(
26
- in lab,
27
- var(--code-background) 91%,
28
- color-mix(in srgb, var(--code-background) 35%, var(--diffs-modified-base))
29
- ),
30
- color-mix(
31
- in lab,
32
- var(--code-background) 85%,
33
- color-mix(in srgb, var(--code-background) 60%, var(--diffs-modified-base))
34
- )
35
- ) !important;
36
- }
37
-
38
- [data-indicators="bars"]
39
- :is([data-column-number], [data-gutter-buffer="annotation"])[data-selected-line] {
40
- position: relative;
41
- }
42
-
43
- [data-indicators="bars"]
44
- :is([data-column-number], [data-gutter-buffer="annotation"])[data-selected-line]::before {
45
- position: absolute !important;
46
- inset-block: 0 !important;
47
- inset-inline-start: 0 !important;
48
- display: block !important;
49
- width: 4px !important;
50
- min-width: 4px !important;
51
- max-width: 4px !important;
52
- height: auto !important;
53
- padding: 0 !important;
54
- content: "" !important;
55
- background-color: var(--diffs-modified-base) !important;
56
- background-image: none !important;
57
- }
58
-
59
- [data-file-info] {
60
- background-color: var(--code-background) !important;
61
- border-block-color: transparent !important;
62
- color: var(--code-foreground) !important;
63
- }
64
-
65
- [data-diffs-header] {
66
- position: sticky !important;
67
- top: 0;
68
- z-index: 4;
69
- background-color: var(--code-background) !important;
70
- border-bottom-color: transparent !important;
71
- align-items: center !important;
72
- font-family: var(--font-sans) !important;
73
- font-size: 12px !important;
74
- line-height: 1 !important;
75
- min-height: 32px !important;
76
- padding-block: 6px !important;
77
- padding-inline: 8px 12px !important;
78
- }
79
-
80
- [data-diffs-header]:hover {
81
- /* A native scrollbar gutter cannot be painted by descendants. Use an inset edge cue instead
82
- of a full-width band that would look accidentally clipped at the gutter. */
83
- background-color: var(--code-background) !important;
84
- box-shadow: inset 3px 0 color-mix(in srgb, var(--code-foreground) 24%, transparent);
85
- }
86
-
87
- :is([data-separator="line-info"], [data-separator="line-info-basic"]) {
88
- height: 24px !important;
89
- margin-block: 0 !important;
90
- background-color: var(--code-background) !important;
91
- }
92
-
93
- :is([data-separator="line-info"], [data-separator="line-info-basic"])
94
- [data-separator-wrapper] {
95
- padding-inline: 8px 12px !important;
96
- background-color: transparent !important;
97
- }
98
-
99
- :is([data-separator="line-info"], [data-separator="line-info-basic"])
100
- [data-separator-content] {
101
- gap: 8px;
102
- padding-inline: 0 !important;
103
- background-color: transparent !important;
104
- color: color-mix(in srgb, var(--code-foreground) 52%, var(--code-background)) !important;
105
- font-family: var(--font-sans) !important;
106
- font-size: 11px !important;
107
- text-decoration: none !important;
108
- }
109
-
110
- :is([data-separator="line-info"], [data-separator="line-info-basic"])
111
- [data-unmodified-lines] {
112
- display: flex !important;
113
- min-width: 0;
114
- flex: 1 1 auto;
115
- align-items: center;
116
- gap: 8px;
117
- }
118
-
119
- :is([data-separator="line-info"], [data-separator="line-info-basic"])[data-expand-index]
120
- [data-unmodified-lines] {
121
- cursor: pointer;
122
- }
123
-
124
- :is([data-separator="line-info"], [data-separator="line-info-basic"])
125
- [data-unmodified-lines]::before,
126
- :is([data-separator="line-info"], [data-separator="line-info-basic"])
127
- [data-unmodified-lines]::after {
128
- width: auto;
129
- height: 1px;
130
- flex: 1 1 auto;
131
- content: "";
132
- background-color: color-mix(in srgb, var(--code-background) 92%, var(--code-foreground));
133
- }
134
-
135
- :is([data-separator="line-info"], [data-separator="line-info-basic"])[data-expand-index]
136
- [data-separator-wrapper] {
137
- grid-template-columns: 0 minmax(0, 1fr) !important;
138
- }
139
-
140
- :is([data-separator="line-info"], [data-separator="line-info-basic"])[data-expand-index]
141
- [data-separator-content] {
142
- grid-column: 2 !important;
143
- }
144
-
145
- /* Visually hidden rather than display: none so the expand action stays keyboard-reachable. */
146
- :is([data-separator="line-info"], [data-separator="line-info-basic"])
147
- [data-expand-button] {
148
- position: absolute !important;
149
- width: 1px !important;
150
- height: 1px !important;
151
- margin: -1px !important;
152
- padding: 0 !important;
153
- overflow: hidden !important;
154
- clip-path: inset(50%) !important;
155
- border: 0 !important;
156
- white-space: nowrap !important;
157
- }
158
-
159
- :is([data-separator="line-info"], [data-separator="line-info-basic"]):has(
160
- [data-expand-button]
161
- )
162
- [data-separator-content] {
163
- cursor: pointer;
164
- }
165
-
166
- :is([data-separator="line-info"], [data-separator="line-info-basic"]):has(
167
- [data-expand-button]
168
- ):is(:hover, :focus-within)
169
- [data-separator-content] {
170
- color: color-mix(in srgb, var(--code-foreground) 76%, var(--code-background)) !important;
171
- }
172
-
173
- :is([data-separator="line-info"], [data-separator="line-info-basic"]):has(
174
- [data-expand-button]
175
- ):is(:hover, :focus-within)
176
- [data-unmodified-lines]::before,
177
- :is([data-separator="line-info"], [data-separator="line-info-basic"]):has(
178
- [data-expand-button]
179
- ):is(:hover, :focus-within)
180
- [data-unmodified-lines]::after {
181
- background-color: color-mix(in srgb, var(--code-background) 84%, var(--code-foreground));
182
- }
183
-
184
- [data-diffs-header] [data-header-content] {
185
- align-items: center !important;
186
- line-height: 1 !important;
187
- }
188
-
189
- /* Pierre clips file names with overflow: hidden for its start ellipsis. A 1em line box cuts off
190
- descenders. Only the clipped names get room: 16px plus the header's 12px of padding stays
191
- inside its 32px min-height, which diffHeaderHeight assumes. */
192
- [data-diffs-header] :is([data-title], [data-prev-name]) {
193
- line-height: 16px !important;
194
- }
195
-
196
- [data-diffs-header] [data-metadata] {
197
- align-items: center !important;
198
- line-height: 1 !important;
199
- font-variant-numeric: tabular-nums;
200
- }
201
-
202
- [data-diffs-header] [data-additions-count],
203
- [data-diffs-header] [data-deletions-count] {
204
- font-family: var(--font-mono) !important;
205
- font-size: 11px !important;
206
- font-variant-numeric: tabular-nums;
207
- line-height: 1 !important;
208
- }
209
-
210
- [data-diffs-header] [data-change-icon],
211
- [data-diffs-header] [data-rename-icon] {
212
- display: block;
213
- flex-shrink: 0;
214
- }
215
-
216
- [data-title] {
217
- cursor: pointer;
218
- transition: color 120ms ease;
219
- font-family: var(--font-sans) !important;
220
- }
221
-
222
- [data-title]:hover {
223
- color: color-mix(in srgb, var(--code-foreground) 84%, var(--primary)) !important;
224
- }
225
-
226
- /* Expanding a file mounts its body all at once; easing it in matches the 200ms the app's
227
- collapsibles take. Appearance only — the viewer owns geometry, so height cannot animate.
228
- Departing content cuts, the same one-way rule the pull request chrome fold follows. */
229
- [data-diff],
230
- [data-file] {
231
- transition: opacity 200ms ease-out;
232
- }
233
-
234
- @starting-style {
235
- [data-diff],
236
- [data-file] {
237
- opacity: 0;
238
- }
239
- }
240
-
241
- @media (prefers-reduced-motion: reduce) {
242
- [data-diff],
243
- [data-file] {
244
- transition: none;
245
- }
246
- }
247
- `;function $e(e){let t=(0,Ze.c)(18),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({options:r,viewerRef:o,className:n,unsafeCSSExtra:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===o?s=t[7]:(s=o?{ref:o}:{},t[6]=o,t[7]=s);let c=n?`diff-render-surface [--code-background:var(--background)] outline-none ${n}`:`diff-render-surface [--code-background:var(--background)] outline-none`,l=a?`${Qe}\n${a}`:Qe,u,d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(u={diffHeaderHeight:32,hunkSeparatorHeight:24,spacing:0,paddingTop:0,paddingBottom:8},d={paddingTop:0,paddingBottom:0,gap:0},t[8]=u,t[9]=d):(u=t[8],d=t[9]);let f;t[10]!==r||t[11]!==l?(f={...r,unsafeCSS:l,itemMetrics:u,layout:d},t[10]=r,t[11]=l,t[12]=f):f=t[12];let p;return t[13]!==i||t[14]!==s||t[15]!==c||t[16]!==f?(p=(0,Z.jsx)(We,{...i,...s,className:c,options:f}),t[13]=i,t[14]=s,t[15]=c,t[16]=f,t[17]=p):p=t[17],p}function et(e,t){return async n=>{let r=g(n),i=n.prevName?g({...n,name:n.prevName}):r,a=await e({changeType:n.type,oldPath:i,newPath:r}),o={name:r,contents:a.newContents,cacheKey:`${t}:new:${r}`};return n.type===`rename-pure`?{oldFile:null,newFile:o}:{oldFile:{name:i,contents:a.oldContents,cacheKey:`${t}:old:${i}`},newFile:o}}}function tt(e,t){return et(async({changeType:n,oldPath:r,newPath:i})=>{let a=await e({environmentId:t.environmentId,input:{cwd:t.cwd,threadId:t.threadId,sourceKind:t.sourceKind,changeType:n,baseRef:t.baseRef,headRef:t.headRef,oldPath:r,newPath:i}});if(a._tag!==`Success`)throw o(a);return a.value},t.cacheKey)}function nt(e,t){return et(async({changeType:n,oldPath:r,newPath:i})=>{let a=await e({environmentId:t.environmentId,input:{...t.reference,...t.commit===null?{}:{commit:t.commit},changeType:n,oldPath:r,newPath:i}});if(a._tag!==`Success`)throw o(a);return a.value},t.cacheKey)}export{fe as a,de as i,nt as n,ue as o,$e as r,V as s,tt as t};
248
- //# sourceMappingURL=diffFileContents-Bj3q_jc2.js.map
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{a as t}from"./useLocalStorage-2W_I13tQ.js";import{Bo as n,Co as r,t as i,uo as a,wo as o}from"./utils-D0kLIGeh.js";import"./textarea-DdNchuIO.js";import{t as s}from"./input-Q4KA45-f.js";var c=e(t(),1),l=new Map([[`bold`,c.createElement(c.Fragment,null,c.createElement(`path`,{d:`M244,56v48a12,12,0,0,1-12,12H184a12,12,0,1,1,0-24H201.1l-19-17.38c-.13-.12-.26-.24-.38-.37A76,76,0,1,0,127,204h1a75.53,75.53,0,0,0,52.15-20.72,12,12,0,0,1,16.49,17.45A99.45,99.45,0,0,1,128,228h-1.37A100,100,0,1,1,198.51,57.06L220,76.72V56a12,12,0,0,1,24,0Z`}))],[`duotone`,c.createElement(c.Fragment,null,c.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),c.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`fill`,c.createElement(c.Fragment,null,c.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1-5.66-13.66l17-17-10.55-9.65-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,1,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60l10.93,10L226.34,50.3A8,8,0,0,1,240,56Z`}))],[`light`,c.createElement(c.Fragment,null,c.createElement(`path`,{d:`M238,56v48a6,6,0,0,1-6,6H184a6,6,0,0,1,0-12h32.55l-30.38-27.8c-.06-.06-.12-.13-.19-.19a82,82,0,1,0-1.7,117.65,6,6,0,0,1,8.24,8.73A93.46,93.46,0,0,1,128,222h-1.28A94,94,0,1,1,194.37,61.4L226,90.35V56a6,6,0,1,1,12,0Z`}))],[`regular`,c.createElement(c.Fragment,null,c.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`thin`,c.createElement(c.Fragment,null,c.createElement(`path`,{d:`M236,56v48a4,4,0,0,1-4,4H184a4,4,0,0,1,0-8h37.7L187.53,68.69l-.13-.12a84,84,0,1,0-1.75,120.51,4,4,0,0,1,5.5,5.82A91.43,91.43,0,0,1,128,220h-1.26A92,92,0,1,1,193,62.84l35,32.05V56a4,4,0,1,1,8,0Z`}))]]),u=Object.defineProperty,d=Object.defineProperties,f=Object.getOwnPropertyDescriptors,p=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,g=(e,t,n)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_=(e,t)=>{for(var n in t||={})m.call(t,n)&&g(e,n,t[n]);if(p)for(var n of p(t))h.call(t,n)&&g(e,n,t[n]);return e},v=(e,t)=>d(e,f(t)),y=(0,c.forwardRef)((e,t)=>c.createElement(r,v(_({ref:t},e),{weights:l})));y.displayName=`ArrowClockwise`;var b=o(),x=n(),S=a(`relative inline-flex w-full min-w-0 items-center rounded-[var(--control-radius)] border text-base text-foreground ring-ring/24 transition-shadow has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/64 has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/16 has-[textarea]:h-auto has-data-[align=block-end]:h-auto has-data-[align=block-start]:h-auto has-data-[align=block-end]:flex-col has-data-[align=block-start]:flex-col has-[input:focus-visible,textarea:focus-visible]:border-ring has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/36 has-autofill:bg-foreground/4 has-[input:disabled,textarea:disabled]:opacity-64 has-[input:disabled,textarea:disabled,input:focus-visible,textarea:focus-visible,input[aria-invalid],textarea[aria-invalid]]:shadow-none has-[input:focus-visible,textarea:focus-visible]:ring-[3px] sm:text-sm dark:has-autofill:bg-foreground/8 dark:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/24 has-data-[align=inline-start]:**:[[data-size=sm]_input]:ps-1.5 has-data-[align=inline-end]:**:[[data-size=sm]_input]:pe-1.5 *:[[data-slot=input-control],[data-slot=textarea-control]]:contents *:[[data-slot=input-control],[data-slot=textarea-control]]:before:hidden has-[[data-align=block-start],[data-align=block-end]]:**:[input]:h-auto has-data-[align=inline-start]:**:[input]:ps-2 has-data-[align=inline-end]:**:[input]:pe-2 has-data-[align=block-end]:**:[input]:pt-1.5 has-data-[align=block-start]:**:[input]:pb-1.5 **:[textarea]:min-h-20.5 **:[textarea]:resize-none **:[textarea]:py-[calc(--spacing(3)-1px)] **:[textarea]:max-sm:min-h-23.5 **:[textarea_button]:rounded-[calc(var(--control-radius)-1px)]`,{defaultVariants:{variant:`default`},variants:{variant:{default:`border-input bg-background not-dark:bg-clip-padding shadow-xs/5 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--control-radius)-1px)] not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_-1px_--theme(--color-white/6%)]`,ghost:`border-transparent bg-transparent shadow-none hover:bg-muted/40 has-[input:focus-visible,textarea:focus-visible]:bg-background`}}});function C(e){let t=(0,b.c)(10),n,r,a;t[0]===e?(n=t[1],r=t[2],a=t[3]):({className:n,variant:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a);let o;t[4]!==n||t[5]!==a?(o=i(S({variant:a}),n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==o?(s=(0,x.jsx)(`div`,{className:o,"data-slot":`input-group`,role:`group`,...r}),t[7]=r,t[8]=o,t[9]=s):s=t[9],s}var w=a(`[&_svg]:-mx-0.5 flex h-auto cursor-text select-none items-center justify-center gap-2 leading-none [&>kbd]:rounded-[calc(var(--radius)-5px)] in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 not-has-[button]:**:[svg:not([class*='opacity-'])]:opacity-80`,{defaultVariants:{align:`inline-start`},variants:{align:{"block-end":`order-last w-full justify-start px-[calc(--spacing(3)-1px)] pb-[calc(--spacing(3)-1px)] [.border-t]:pt-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]`,"block-start":`order-first w-full justify-start px-[calc(--spacing(3)-1px)] pt-[calc(--spacing(3)-1px)] [.border-b]:pb-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]`,"inline-end":`has-[>:last-child[data-slot=badge]]:-me-1.5 has-[>button]:-me-2 order-last pe-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:me-[-0.35rem] [[data-size=sm]+&]:pe-[calc(--spacing(2.5)-1px)]`,"inline-start":`has-[>:last-child[data-slot=badge]]:-ms-1.5 has-[>button]:-ms-2 order-first ps-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:ms-[-0.35rem] [[data-size=sm]+&]:ps-[calc(--spacing(2.5)-1px)]`}}});function T(e){let t=(0,b.c)(11),n,r,a;t[0]===e?(n=t[1],r=t[2],a=t[3]):({className:n,align:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a);let o=a===void 0?`inline-start`:a,s;t[4]!==o||t[5]!==n?(s=i(w({align:o}),n),t[4]=o,t[5]=n,t[6]=s):s=t[6];let c;return t[7]!==o||t[8]!==r||t[9]!==s?(c=(0,x.jsx)(`div`,{className:s,"data-align":o,"data-slot":`input-group-addon`,onMouseDown:E,...r}),t[7]=o,t[8]=r,t[9]=s,t[10]=c):c=t[10],c}function E(e){if(e.target.closest(`button, a, input, select, textarea, [role='button'], [role='combobox'], [role='listbox'], [data-slot='select-trigger']`))return;e.preventDefault();let t=e.currentTarget.parentElement,n=t?.querySelector(`input, textarea`);n&&!t?.querySelector(`input:focus, textarea:focus`)&&n.focus()}function D(e){let t=(0,b.c)(6),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;return t[3]!==n||t[4]!==r?(i=(0,x.jsx)(s,{className:n,unstyled:!0,...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function O(e){let t=(0,b.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 a;t[3]===n?a=t[4]:(a=i(`flex min-w-0 flex-1 flex-col items-center justify-center gap-6 text-balance p-6 text-center md:p-12`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,x.jsx)(`div`,{className:a,"data-slot":`empty`,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function k(e){let t=(0,b.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 a;t[3]===n?a=t[4]:(a=i(`flex max-w-sm flex-col items-center text-center`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,x.jsx)(`div`,{className:a,"data-slot":`empty-header`,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}var A=a(`flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{defaultVariants:{variant:`default`},variants:{variant:{default:`bg-transparent`,icon:`relative flex size-10 shrink-0 items-center justify-center rounded-control bg-canvas-quiet text-foreground [&_svg:not([class*='size-'])]:size-4.5`}}});function j(e){let t=(0,b.c)(21),n,r,a;t[0]===e?(n=t[1],r=t[2],a=t[3]):({className:n,variant:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a);let o=a===void 0?`default`:a,s;t[4]===n?s=t[5]:(s=i(`relative mb-6`,n),t[4]=n,t[5]=s);let c;t[6]!==n||t[7]!==o?(c=o===`icon`&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{"aria-hidden":`true`,className:i(A({className:n,variant:o}),`-translate-x-0.5 -rotate-10 pointer-events-none absolute bottom-px origin-bottom-left scale-84 shadow-none`)}),(0,x.jsx)(`div`,{"aria-hidden":`true`,className:i(A({className:n,variant:o}),`pointer-events-none absolute bottom-px origin-bottom-right translate-x-0.5 rotate-10 scale-84 shadow-none`)})]}),t[6]=n,t[7]=o,t[8]=c):c=t[8];let l;t[9]!==n||t[10]!==o?(l=i(A({className:n,variant:o})),t[9]=n,t[10]=o,t[11]=l):l=t[11];let u;t[12]!==r||t[13]!==l?(u=(0,x.jsx)(`div`,{className:l,...r}),t[12]=r,t[13]=l,t[14]=u):u=t[14];let d;return t[15]!==r||t[16]!==s||t[17]!==c||t[18]!==u||t[19]!==o?(d=(0,x.jsxs)(`div`,{className:s,"data-slot":`empty-media`,"data-variant":o,...r,children:[c,u]}),t[15]=r,t[16]=s,t[17]=c,t[18]=u,t[19]=o,t[20]=d):d=t[20],d}function M(e){let t=(0,b.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 a;t[3]===n?a=t[4]:(a=i(`font-serif text-[26px] font-normal leading-[1.15] tracking-[-0.01em]`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,x.jsx)(`div`,{className:a,"data-slot":`empty-title`,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function N(e){let t=(0,b.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 a;t[3]===n?a=t[4]:(a=i(`text-muted-foreground text-sm [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4 [[data-slot=empty-title]+&]:mt-1`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,x.jsx)(`div`,{className:a,"data-slot":`empty-description`,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}function P(e){let t=(0,b.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 a;t[3]===n?a=t[4]:(a=i(`flex w-full min-w-0 max-w-sm flex-col items-center gap-4 text-balance text-sm`,n),t[3]=n,t[4]=a);let o;return t[5]!==r||t[6]!==a?(o=(0,x.jsx)(`div`,{className:a,"data-slot":`empty-content`,...r}),t[5]=r,t[6]=a,t[7]=o):o=t[7],o}export{j as a,T as c,k as i,D as l,P as n,M as o,N as r,C as s,O as t,y as u};
2
- //# sourceMappingURL=empty-DynqTxIR.js.map
@@ -1,2 +0,0 @@
1
- import{ct as e,dt as t,ft as n,ho as r,pt as i,wo as a}from"./utils-D0kLIGeh.js";import{h as o,hn as s,mn as c,q as l,un as u,vn as d}from"./session-DIGL5_Nm.js";import{Rn as f,an as p,in as m,rr as h,tt as g}from"./textarea-DdNchuIO.js";var _=new Set([`pull-request`]);function v(e,t){return t||!_.has(e)}function y(e,t){return e.filter(e=>v(e.kind,t))}var b=`borgcode:right-panel-state:v2`,ee=12,x=e=>e.endsWith(`:pull-requests-panel`),S={isOpen:!1,activeSurfaceId:null,surfaces:[]},C=e=>{switch(e){case`diff`:return{id:`diff`,kind:e};case`files`:return{id:`files`,kind:e};case`file-preview`:return{id:`file-preview`,kind:e,relativePath:null,revealLine:null,revealRequestId:0};case`agents`:return{id:`agents`,kind:e}}},w=e=>e?{id:`browser:${e}`,kind:`preview`,resourceId:e}:{id:`browser:new`,kind:`preview`,resourceId:null},T=(e,t,n)=>({id:`file:${e}`,kind:`file`,relativePath:e,revealLine:t,revealRequestId:n}),E=e=>({id:`terminal:${e}`,kind:`terminal`,resourceId:e,terminalIds:[e],activeTerminalId:e});function D(e){return`pull-request:${e.environmentId===void 0?``:`${encodeURIComponent(e.environmentId)}:`}${encodeURIComponent(e.projectId)}:${encodeURIComponent(e.repository)}:${e.number}`}function O(e){return{id:D(e),kind:`pull-request`,...e.environmentId===void 0?{}:{environmentId:e.environmentId},projectId:e.projectId,repository:e.repository,number:e.number}}function te(e,t,n){return e[t]?.state===n.state&&e[t]?.isDraft===n.isDraft?e:{...e,[t]:n}}var k=(e,t,n=!0)=>({isOpen:!0,surfaces:e.surfaces.some(e=>e.id===t.id)?e.surfaces:[...e.surfaces,t],activeSurfaceId:n?t.id:e.activeSurfaceId}),A=(e,t,n)=>{let r=e[t]??S,i=n(r);if(!i.isOpen&&i.activeSurfaceId===null&&i.surfaces.length===0){if(!(t in e))return e;let{[t]:n,...r}=e;return r}return i===r?e:{...e,[t]:i}};function j(e){return e===void 0||!Number.isFinite(e)?null:Math.max(1,Math.trunc(e))}function M(e){return!e||typeof e!=`object`?{byThreadKey:{}}:{byThreadKey:`byThreadKey`in e&&e.byThreadKey&&typeof e.byThreadKey==`object`?Object.fromEntries(Object.entries(e.byThreadKey).filter(([e])=>!x(e)).map(([e,t])=>{let n=t&&typeof t==`object`?t:null,r=Array.isArray(n?.surfaces)?n.surfaces.flatMap(e=>{let t=e.kind;if(t===`plan`||t===`design`)return[];if(e.kind===`file`){let t=typeof e.revealLine==`number`&&Number.isFinite(e.revealLine)?Math.max(1,Math.trunc(e.revealLine)):null,n=typeof e.revealRequestId==`number`&&Number.isSafeInteger(e.revealRequestId)&&e.revealRequestId>=0?e.revealRequestId:0;return[{...e,revealLine:t,revealRequestId:n}]}if(e.kind===`pull-request`){if(typeof e.projectId!=`string`||typeof e.repository!=`string`||typeof e.number!=`number`||!Number.isSafeInteger(e.number)||e.number<1)return[];let{environmentId:t,...n}=e;return[O({...n,...typeof t==`string`?{environmentId:t}:{}})]}if(e.kind!==`terminal`)return[e];if(!(`resourceId`in e)||typeof e.resourceId!=`string`||e.id!==`terminal:${e.resourceId}`)return[];let n=`terminalIds`in e&&Array.isArray(e.terminalIds)?[...new Set(e.terminalIds.filter(e=>typeof e==`string`))]:[e.resourceId],r=`activeTerminalId`in e&&typeof e.activeTerminalId==`string`&&n.includes(e.activeTerminalId)?e.activeTerminalId:n[0]??e.resourceId;return[{...e,terminalIds:n.length>0?n:[e.resourceId],activeTerminalId:r}]}):[],i=n?.activeSurfaceId,a=r.some(e=>e.id===i)?i??null:i===`pull-request`?r.find(e=>e.kind===`pull-request`)?.id??null:null,o=r.length>0&&(typeof n?.isOpen==`boolean`?n.isOpen:a!==null);return[e,{isOpen:o,surfaces:r,activeSurfaceId:a??(o?r[0]?.id??null:null)}]})):{}}}var N=i()(n(e=>({byThreadKey:{},open:(t,n)=>e(e=>({byThreadKey:A(e.byThreadKey,r(t),e=>n===`preview`?k(e,e.surfaces.find(e=>e.kind===`preview`)??w(null)):k(e,C(n)))})),openBrowser:(t,n)=>e(e=>({byThreadKey:A(e.byThreadKey,r(t),e=>{let t=w(n),r=n?e.surfaces.filter(e=>e.id!==`browser:new`):e.surfaces;return k({...e,surfaces:r},t)})})),selectFilePreview:(t,n,i)=>e(e=>({byThreadKey:A(e.byThreadKey,r(t),e=>{let t=e.surfaces.find(e=>e.kind===`file-preview`),r={id:`file-preview`,kind:`file-preview`,relativePath:n,revealLine:j(i),revealRequestId:(t?.kind===`file-preview`?t.revealRequestId:0)+1};return k({...e,surfaces:e.surfaces.map(e=>e.kind===`file-preview`?r:e)},r)})})),openPullRequest:(t,n)=>e(e=>({byThreadKey:A(e.byThreadKey,r(t),e=>k(e,O(n)))})),openFile:(t,n,i)=>e(e=>({byThreadKey:A(e.byThreadKey,r(t),e=>{let t=e.surfaces.filter(e=>e.kind!==`files`),r=`file:${n}`,a=t.find(e=>e.id===r&&e.kind===`file`),o=T(n,j(i),(a?.revealRequestId??0)+1);return{isOpen:!0,activeSurfaceId:o.id,surfaces:a?t.map(e=>e.id===o.id?o:e):[...t,o]}})})),openTerminal:(t,n)=>e(e=>({byThreadKey:A(e.byThreadKey,r(t),e=>k(e,E(n)))})),splitTerminal:(t,n,i,a=`horizontal`)=>e(e=>({byThreadKey:A(e.byThreadKey,r(t),e=>({...e,isOpen:!0,activeSurfaceId:n,surfaces:e.surfaces.map(e=>{if(e.id!==n||e.kind!==`terminal`)return e;let{splitDirection:t,...r}=e;return{...r,terminalIds:e.terminalIds.includes(i)?e.terminalIds:[...e.terminalIds,i],activeTerminalId:i,...a===`vertical`?{splitDirection:`vertical`}:{}}})}))})),activateTerminal:(t,n,i)=>e(e=>({byThreadKey:A(e.byThreadKey,r(t),e=>({...e,activeSurfaceId:n,surfaces:e.surfaces.map(e=>e.id===n&&e.kind===`terminal`&&e.terminalIds.includes(i)?{...e,activeTerminalId:i}:e)}))})),closeTerminal:(t,n,i)=>e(e=>({byThreadKey:A(e.byThreadKey,r(t),e=>{let t=e.surfaces.find(e=>e.id===n&&e.kind===`terminal`);if(!t||t.kind!==`terminal`)return e;let r=t.terminalIds.filter(e=>e!==i);if(r.length===0){let t=e.surfaces.findIndex(e=>e.id===n),r=e.surfaces.filter(e=>e.id!==n),i=r[Math.min(t,r.length-1)]??null;return{...e,isOpen:r.length>0&&e.isOpen,surfaces:r,activeSurfaceId:e.activeSurfaceId===n?i?.id??null:e.activeSurfaceId}}return{...e,surfaces:e.surfaces.map(e=>e.id===n&&e.kind===`terminal`?{...e,terminalIds:r,activeTerminalId:e.activeTerminalId===i?r.at(-1)??r[0]:e.activeTerminalId}:e)}})})),activateSurface:(t,n)=>e(e=>({byThreadKey:A(e.byThreadKey,r(t),e=>e.surfaces.some(e=>e.id===n)?{...e,isOpen:!0,activeSurfaceId:n}:e)})),closeSurface:(t,n)=>e(e=>({byThreadKey:A(e.byThreadKey,r(t),e=>{let t=e.surfaces.findIndex(e=>e.id===n);if(t<0)return e;let r=e.surfaces.filter(e=>e.id!==n);if(e.activeSurfaceId!==n)return{...e,isOpen:r.length>0&&e.isOpen,surfaces:r};let i=r[Math.min(t,r.length-1)]??null;return{...e,isOpen:r.length>0&&e.isOpen,surfaces:r,activeSurfaceId:i?.id??null}})})),closeOtherSurfaces:(t,n)=>e(e=>({byThreadKey:A(e.byThreadKey,r(t),e=>{let t=e.surfaces.find(e=>e.id===n);return!t||e.surfaces.length===1?e:{...e,isOpen:!0,surfaces:[t],activeSurfaceId:t.id}})})),closeSurfacesToRight:(t,n)=>e(e=>({byThreadKey:A(e.byThreadKey,r(t),e=>{let t=e.surfaces.findIndex(e=>e.id===n);if(t<0||t===e.surfaces.length-1)return e;let r=e.surfaces.slice(0,t+1),i=r.some(t=>t.id===e.activeSurfaceId);return{...e,surfaces:r,activeSurfaceId:i?e.activeSurfaceId:n}})})),closeAllSurfaces:t=>e(e=>({byThreadKey:A(e.byThreadKey,r(t),e=>e.surfaces.length===0?e:{...e,isOpen:!1,surfaces:[],activeSurfaceId:null})})),reconcileBrowserSurfaces:(t,n)=>e(e=>({byThreadKey:A(e.byThreadKey,r(t),e=>{let t=new Set(n.map(e=>`browser:${e}`)),r=e.surfaces.filter(e=>e.kind!==`preview`),i=e.surfaces.filter(e=>e.kind===`preview`&&e.id!==`browser:new`&&t.has(e.id)),a=new Set(i.map(e=>e.id)),o=n.filter(e=>!a.has(`browser:${e}`)).map(e=>w(e)),s=[...r,...i,...o],c=s.some(t=>t.id===e.activeSurfaceId),l=s.find(e=>e.kind===`preview`);return{...e,surfaces:s,activeSurfaceId:c?e.activeSurfaceId:l?.id??s[0]?.id??null}})})),reconcileFileSurfaces:(t,n)=>e(e=>({byThreadKey:A(e.byThreadKey,r(t),e=>{if(n)return e;let t=e.surfaces.filter(e=>e.kind!==`files`&&e.kind!==`file`);if(t.length===e.surfaces.length)return e;let r=t.some(t=>t.id===e.activeSurfaceId);return{...e,isOpen:t.length>0?e.isOpen:!1,surfaces:t,activeSurfaceId:r?e.activeSurfaceId:t.at(-1)?.id??null}})})),show:t=>e(e=>({byThreadKey:A(e.byThreadKey,r(t),e=>e.isOpen?e:{...e,isOpen:!0})})),close:t=>e(e=>({byThreadKey:A(e.byThreadKey,r(t),e=>e.isOpen?{...e,isOpen:!1}:e)})),toggleVisibility:t=>e(e=>({byThreadKey:A(e.byThreadKey,r(t),e=>({...e,isOpen:!e.isOpen}))})),toggle:(t,n)=>e(e=>({byThreadKey:A(e.byThreadKey,r(t),e=>{let t=e.surfaces.find(t=>t.id===e.activeSurfaceId);return e.isOpen&&t?.kind===n?{...e,isOpen:!1}:n===`preview`?k(e,e.surfaces.find(e=>e.kind===`preview`)??w(null)):k(e,C(n))})})),removeThread:t=>e(e=>{let n=r(t);if(!(n in e.byThreadKey))return e;let{[n]:i,...a}=e.byThreadKey;return{byThreadKey:a}})}),{name:b,version:ee,storage:t(()=>e(typeof window<`u`?window.localStorage:void 0)),partialize:e=>({byThreadKey:Object.fromEntries(Object.entries(e.byThreadKey).filter(([e])=>!x(e)))}),migrate:M}));function P(e,t){return t?e[r(t)]??S:S}function F(e,t){let n=P(e,t);return n.isOpen?n.surfaces.find(e=>e.id===n.activeSurfaceId)?.kind??null:null}function I(e,t){return P(e,t).isOpen?L(e,t):null}function L(e,t){let n=P(e,t);return n.surfaces.find(e=>e.id===n.activeSurfaceId)??null}var R=a(),z=Object.freeze([]),B=Object.freeze([]),V=Object.freeze([]),H=Object.freeze([]),U=Object.freeze([]),W=s(null).pipe(d(`web-project:empty`));s(z).pipe(d(`web-project-refs:empty`));var G=s(B).pipe(d(`web-thread-refs:empty`)),K=s(null).pipe(d(`web-thread-shell:empty`)),q=s(null).pipe(d(`web-thread-detail:empty`)),J=s(`empty`).pipe(d(`web-thread-status:empty`));s(V).pipe(d(`web-thread-messages:empty`)),s(H).pipe(d(`web-thread-activities:empty`)),s(U).pipe(d(`web-thread-proposed-plans:empty`)),s(null).pipe(d(`web-thread-session:empty`));var Y=s(null).pipe(c,d(`web-active-environment-id`));function ne(){return u(Y)}function X(e){o.set(Y,e)}function Z(){return u(p.threadRefsAtom)}function re(e){let t=(0,R.c)(2),n;return t[0]===e?n=t[1]:(n=e===null?G:p.environmentThreadRefsAtom(e),t[0]=e,t[1]=n),u(n)}function ie(){return u(f.projectsAtom)}function ae(){return u(g)}function oe(){return u(p.threadShellsAtom)}function se(){return u(h)}function ce(e){let t=(0,R.c)(2),n;return t[0]===e?n=t[1]:(n=p.threadShellsForProjectRefsAtom(e),t[0]=e,t[1]=n),u(n)}function le(e){let t=(0,R.c)(2),n;return t[0]===e?n=t[1]:(n=e===null?W:f.projectAtom(e),t[0]=e,t[1]=n),u(n)}function Q(e){let t=(0,R.c)(2),n;return t[0]===e?n=t[1]:(n=e===null?K:p.threadShellAtom(e),t[0]=e,t[1]=n),u(n)}function $(e){let t=(0,R.c)(2),n;return t[0]===e?n=t[1]:(n=e===null?q:m.detailAtom(e),t[0]=e,t[1]=n),u(n)}function ue(e){let t=(0,R.c)(2),n;return t[0]===e?n=t[1]:(n=e===null?J:m.statusAtom(e),t[0]=e,t[1]=n),u(n)}function de(e,t){return e!==null&&(!t.waitForShell||t.shellExists)?e:null}function fe(e,t){let n=(0,R.c)(7),r=Q(e),i=r!==null,a=t?.waitForShell===!0,o;n[0]!==e||n[1]!==i||n[2]!==a?(o=de(e,{shellExists:i,waitForShell:a}),n[0]=e,n[1]=i,n[2]=a,n[3]=o):o=n[3];let s=$(o),c;return n[4]!==s||n[5]!==r?(c=l(s,r),n[4]=s,n[5]=r,n[6]=c):c=n[6],c}function pe(e){return o.get(f.projectAtom(e))}function me(e){return o.get(p.threadShellAtom(e))}function he(e){return o.get(g).get(e)?.environment.capabilities.threadSettlement===!0}function ge(e){return o.get(g).get(e)?.environment.capabilities.threadSnooze===!0}function _e(e){return o.get(g).get(e)?.environment.capabilities.threadPublish===!0}function ve(e){return o.get(g).get(e)?.environment.capabilities.threadPinning===!0}function ye(e){return o.get(g).get(e)?.environment.capabilities.threadTitleRegeneration===!0}function be(e){return o.get(g).get(e)?.environment.capabilities.threadPinReorder===!0}function xe(e){return o.get(p.environmentThreadRefsAtom(e))}function Se(){return o.get(p.threadShellsAtom)}export{te as A,ce as C,I as D,F as E,y as M,L as O,oe as S,v as T,ae as _,ge as a,Z as b,pe as c,X as d,ne as f,ie as g,le as h,he as i,N as j,P as k,me as l,re as m,ve as n,ye as o,se as p,_e as r,xe as s,be as t,Se as u,fe as v,ue as w,Q as x,$ as y};
2
- //# sourceMappingURL=entities-dwE_i4XM.js.map
@@ -1,2 +0,0 @@
1
- function e(e,t){let n={hour:`numeric`,minute:`2-digit`,...t?{second:`2-digit`}:{}};return e===`locale`?n:{...n,hour12:e===`12-hour`}}function t(e){let t=e?.trim();if(t)try{return Intl.DateTimeFormat.supportedLocalesOf([t]),t}catch{return}}function n(){return typeof window>`u`?null:window.desktopBridge?.getSystemLocale?.()??null}var r=t(n()),i=new Map;function a(t,n){let a=`${t}:${n?`seconds`:`minutes`}`,o=i.get(a);if(o)return o;let s=new Intl.DateTimeFormat(r,e(t,n));return i.set(a,s),s}function o(e){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}var s=new Intl.DateTimeFormat(`en-US`,{month:`long`});function c(e){let t=e%100;if(t>=11&&t<=13)return`th`;switch(e%10){case 1:return`st`;case 2:return`nd`;case 3:return`rd`;default:return`th`}}function l(e,t){let n=o(e);if(!n)return``;let r=u(e,t),i=n.getDate(),a=s.format(n),l=n.getFullYear();return`${r}, ${i}${c(i)} ${a} ${l}`}function u(e,t){let n=o(e);return n?a(t,!1).format(n):``}var d=new Intl.DateTimeFormat(r,{month:`numeric`,day:`numeric`}),f=new Intl.DateTimeFormat(r,{month:`numeric`,day:`numeric`,year:`numeric`});function p(e,t,n=Date.now()){let r=o(e);if(!r)return``;let i=a(t,!1).format(r),s=new Date(n),c=new Date(s.getFullYear(),s.getMonth(),s.getDate()).getTime(),l=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime(),u=Math.round((c-l)/864e5);return u<=0?i:u===1?`yesterday at ${i}`:`${(r.getFullYear()===s.getFullYear()?d:f).format(r)} ${i}`}function m(e){let t=o(e);if(!t)return null;let n=Date.now()-t.getTime();if(n<0)return{value:`just now`,suffix:null};let r=Math.floor(n/1e3);if(r<60)return{value:`just now`,suffix:null};let i=Math.floor(r/60);if(i<60)return{value:`${i}m`,suffix:`ago`};let a=Math.floor(i/60);return a<24?{value:`${a}h`,suffix:`ago`}:{value:`${Math.floor(a/24)}d`,suffix:`ago`}}function h(e){let t=m(e);return t?t.suffix?`${t.value} ${t.suffix}`:t.value:``}function g(e){if(!e)return{status:`missing`};let t=m(e);return t?{status:`relative`,...t}:{status:`invalid`}}function _(e,t=Date.now()){let n=o(e);if(!n)return``;let r=t-n.getTime();if(r<=0)return`just now`;let i=Math.floor(r/1e3);if(i<5)return`just now`;if(i<60)return`${i}s`;let a=Math.floor(i/60);if(a<60)return`${a}m`;let s=Math.floor(a/60);return s<24?`${s}h`:`${Math.floor(s/24)}d`}function v(e,t=Date.now()){let n=o(e);if(!n)return``;let r=n.getTime()-t;if(r<=0)return`Expired`;let i=Math.floor(r/1e3);if(i<5)return`Expires in a moment`;if(i<60)return`Expires in ${i}s`;if(i<3600){let e=Math.floor(i/60),t=i%60;return t===0?`Expires in ${e}m`:`Expires in ${e}m ${t}s`}if(i<86400){let e=Math.floor(i/3600),t=i%3600,n=Math.floor(t/60),r=t%60,a=[`${e}h`];return n>0&&a.push(`${n}m`),r>0&&a.push(`${r}s`),`Expires in ${a.join(` `)}`}let a=Math.floor(i/86400),s=i%86400;if(s===0)return`Expires in ${a}d`;let c=Math.floor(s/3600),l=s%3600,u=Math.floor(l/60),d=l%60,f=[];return c>0&&f.push(`${c}h`),u>0&&f.push(`${u}m`),d>0&&f.push(`${d}s`),f.length>0?`Expires in ${a}d ${f.join(` `)}`:`Expires in ${a}d`}var y=typeof window<`u`&&window.desktopBridge!==void 0;export{v as a,u as c,_ as i,g as l,l as n,m as o,p as r,h as s,y as t,o as u};
2
- //# sourceMappingURL=env-DgM3kOA4.js.map
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{a as t}from"./useLocalStorage-2W_I13tQ.js";import{Bo as n,t as r}from"./utils-D0kLIGeh.js";import{n as i}from"./textarea-DdNchuIO.js";var a=e(t()),o=n(),s=a.forwardRef(function(e,t){return(0,o.jsx)(i,{ref:t,...e})});function c({className:e,size:t=`default`,unstyled:n=!1,nativeInput:i=!1,...a}){let c=r(`h-8.5 w-full min-w-0 rounded-[inherit] px-[calc(--spacing(3)-1px)] leading-8.5 outline-none placeholder:text-placeholder sm:h-7.5 sm:leading-7.5 [transition:background-color_5000000s_ease-in-out_0s]`,t===`compact`&&`h-7 px-[calc(--spacing(2.5)-1px)] text-xs leading-7 sm:h-7 sm:leading-7`,t===`sm`&&`h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5`,t===`lg`&&`h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5`,a.type===`search`&&`[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none`,a.type===`file`&&`text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm`),l;if(i){let{style:e,onValueChange:n,...r}=a;l=(0,o.jsx)(`input`,{className:c,"data-slot":`input`,size:typeof t==`number`?t:void 0,style:typeof e==`function`?void 0:e,...r})}else l=(0,o.jsx)(s,{className:c,"data-slot":`input`,size:typeof t==`number`?t:void 0,...a});return(0,o.jsx)(`span`,{className:r(!n&&`relative inline-flex w-full rounded-control border border-input bg-canvas-quiet text-base text-foreground transition-[border-color,box-shadow] has-aria-invalid:border-destructive/50 has-focus-visible:border-ring has-focus-visible:ring-2 has-focus-visible:ring-selection has-autofill:bg-foreground/4 has-disabled:opacity-64 sm:text-sm`,!n&&t===`compact`&&`rounded-small`,e)||void 0,"data-size":t,"data-slot":`input-control`,children:l})}export{c as t};
2
- //# sourceMappingURL=input-Q4KA45-f.js.map