@afbin/cli 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/afbin.mjs +33 -12
- package/dist/index.mjs +11 -1
- package/dist/runtime/dist/web/.vite/manifest.json +216 -216
- package/dist/runtime/dist/web/assets/{Account-CvOF6jpD.js → Account-qnxwLep7.js} +1 -1
- package/dist/runtime/dist/web/assets/Account-qnxwLep7.js.br +0 -0
- package/dist/runtime/dist/web/assets/Account-qnxwLep7.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{ArtifactAddress-DORDne01.js → ArtifactAddress-1ftOG9A5.js} +2 -2
- package/dist/runtime/dist/web/assets/ArtifactAddress-1ftOG9A5.js.br +0 -0
- package/dist/runtime/dist/web/assets/ArtifactAddress-1ftOG9A5.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{ArtifactData-BdL9R2dA.js → ArtifactData-CZq-MLWc.js} +1 -1
- package/dist/runtime/dist/web/assets/ArtifactData-CZq-MLWc.js.br +0 -0
- package/dist/runtime/dist/web/assets/ArtifactData-CZq-MLWc.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{ArtifactEditor-BZXbOk_F.js → ArtifactEditor-Cd_-Z6DK.js} +1 -1
- package/dist/runtime/dist/web/assets/ArtifactEditor-Cd_-Z6DK.js.br +0 -0
- package/dist/runtime/dist/web/assets/ArtifactEditor-Cd_-Z6DK.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{AssetPageHeader-DX2RcYTv.js → AssetPageHeader-BqdRtu9K.js} +1 -1
- package/dist/runtime/dist/web/assets/AssetPageHeader-BqdRtu9K.js.br +0 -0
- package/dist/runtime/dist/web/assets/AssetPageHeader-BqdRtu9K.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{Assets-dgdXIgAW.js → Assets-D6htDZnu.js} +1 -1
- package/dist/runtime/dist/web/assets/Assets-D6htDZnu.js.br +0 -0
- package/dist/runtime/dist/web/assets/Assets-D6htDZnu.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{AvatarCircle-MNnIhRvg.js → AvatarCircle-CBpOuCGy.js} +1 -1
- package/dist/runtime/dist/web/assets/AvatarCircle-CBpOuCGy.js.br +0 -0
- package/dist/runtime/dist/web/assets/AvatarCircle-CBpOuCGy.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{Chat-V1ku1-60.js → Chat-DueKnMAf.js} +1 -1
- package/dist/runtime/dist/web/assets/Chat-DueKnMAf.js.br +0 -0
- package/dist/runtime/dist/web/assets/Chat-DueKnMAf.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{ConfirmDialog-Ph1VDgNN.js → ConfirmDialog-hdkXS1mg.js} +1 -1
- package/dist/runtime/dist/web/assets/ConfirmDialog-hdkXS1mg.js.br +0 -0
- package/dist/runtime/dist/web/assets/ConfirmDialog-hdkXS1mg.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{DatasetCatalogView-DBJEPKFI.js → DatasetCatalogView-DKNdjYA_.js} +1 -1
- package/dist/runtime/dist/web/assets/DatasetCatalogView-DKNdjYA_.js.br +0 -0
- package/dist/runtime/dist/web/assets/DatasetCatalogView-DKNdjYA_.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{DatasetEditor-CMqN1duq.js → DatasetEditor-C22-4oJL.js} +1 -1
- package/dist/runtime/dist/web/assets/DatasetEditor-C22-4oJL.js.br +0 -0
- package/dist/runtime/dist/web/assets/DatasetEditor-C22-4oJL.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{Docs-DVoW7b7v.js → Docs-B80IZLN8.js} +1 -1
- package/dist/runtime/dist/web/assets/Docs-B80IZLN8.js.br +0 -0
- package/dist/runtime/dist/web/assets/Docs-B80IZLN8.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{Document-udhy5mlX.js → Document-C6-E9V3_.js} +4 -4
- package/dist/runtime/dist/web/assets/Document-C6-E9V3_.js.br +0 -0
- package/dist/runtime/dist/web/assets/Document-C6-E9V3_.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{DocumentChrome-EUbW_JvA.js → DocumentChrome-Bw4_z5yQ.js} +1 -1
- package/dist/runtime/dist/web/assets/DocumentChrome-Bw4_z5yQ.js.br +0 -0
- package/dist/runtime/dist/web/assets/DocumentChrome-Bw4_z5yQ.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{DocumentSharing-BuTXuflA.js → DocumentSharing-BiTakFtn.js} +1 -1
- package/dist/runtime/dist/web/assets/DocumentSharing-BiTakFtn.js.br +0 -0
- package/dist/runtime/dist/web/assets/DocumentSharing-BiTakFtn.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{FileUpload-D6RTOrHD.js → FileUpload-B-da-wki.js} +1 -1
- package/dist/runtime/dist/web/assets/FileUpload-B-da-wki.js.br +0 -0
- package/dist/runtime/dist/web/assets/FileUpload-B-da-wki.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{Folder-DoNsFB2I.js → Folder-B-OlCz39.js} +1 -1
- package/dist/runtime/dist/web/assets/Folder-B-OlCz39.js.br +0 -0
- package/dist/runtime/dist/web/assets/Folder-B-OlCz39.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{ForkArtifact-DDmXl1BZ.js → ForkArtifact-DXYU1-qL.js} +1 -1
- package/dist/runtime/dist/web/assets/ForkArtifact-DXYU1-qL.js.br +0 -0
- package/dist/runtime/dist/web/assets/ForkArtifact-DXYU1-qL.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{GetStarted-YjltMEeN.js → GetStarted-CFsSvXR0.js} +1 -1
- package/dist/runtime/dist/web/assets/GetStarted-CFsSvXR0.js.br +0 -0
- package/dist/runtime/dist/web/assets/GetStarted-CFsSvXR0.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{Home-DijnltFZ.js → Home-BSO7YYXA.js} +1 -1
- package/dist/runtime/dist/web/assets/Home-BSO7YYXA.js.br +0 -0
- package/dist/runtime/dist/web/assets/Home-BSO7YYXA.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{Login-DLwn4aUr.js → Login-CszZ8VGu.js} +1 -1
- package/dist/runtime/dist/web/assets/Login-CszZ8VGu.js.br +0 -0
- package/dist/runtime/dist/web/assets/Login-CszZ8VGu.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{NotFound-svz4wCeL.js → NotFound-D2MOGkIO.js} +1 -1
- package/dist/runtime/dist/web/assets/NotFound-D2MOGkIO.js.br +0 -0
- package/dist/runtime/dist/web/assets/NotFound-D2MOGkIO.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{Notifications-BGeJKv2W.js → Notifications-M7BiDhSo.js} +1 -1
- package/dist/runtime/dist/web/assets/Notifications-M7BiDhSo.js.br +0 -0
- package/dist/runtime/dist/web/assets/Notifications-M7BiDhSo.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{Profile-B38GeCbR.js → Profile-DqV5PMEi.js} +2 -2
- package/dist/runtime/dist/web/assets/Profile-DqV5PMEi.js.br +0 -0
- package/dist/runtime/dist/web/assets/Profile-DqV5PMEi.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{Program-D3-Gfvjo.js → Program-CdwfK2zE.js} +1 -1
- package/dist/runtime/dist/web/assets/Program-CdwfK2zE.js.br +0 -0
- package/dist/runtime/dist/web/assets/Program-CdwfK2zE.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{RowMenu-J4Gbci3B.js → RowMenu-B2c9LyOb.js} +1 -1
- package/dist/runtime/dist/web/assets/RowMenu-B2c9LyOb.js.br +0 -0
- package/dist/runtime/dist/web/assets/RowMenu-B2c9LyOb.js.gz +0 -0
- package/dist/runtime/dist/web/assets/Schedules-D05tndQ1.js +1 -0
- package/dist/runtime/dist/web/assets/Schedules-D05tndQ1.js.br +0 -0
- package/dist/runtime/dist/web/assets/Schedules-D05tndQ1.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{ScreenshotEditor-CUmN5F2q.js → ScreenshotEditor-B8g3LiBx.js} +1 -1
- package/dist/runtime/dist/web/assets/ScreenshotEditor-B8g3LiBx.js.br +0 -0
- package/dist/runtime/dist/web/assets/ScreenshotEditor-B8g3LiBx.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{ShareLink-n8KhtnaI.js → ShareLink-qbYss_Eh.js} +1 -1
- package/dist/runtime/dist/web/assets/ShareLink-qbYss_Eh.js.br +0 -0
- package/dist/runtime/dist/web/assets/ShareLink-qbYss_Eh.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{Shelf-BgwHOaeW.js → Shelf-anhc5No9.js} +1 -1
- package/dist/runtime/dist/web/assets/Shelf-anhc5No9.js.br +0 -0
- package/dist/runtime/dist/web/assets/Shelf-anhc5No9.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{SocialPreviewEditor-DwHHRW29.js → SocialPreviewEditor-B4nUY6FA.js} +1 -1
- package/dist/runtime/dist/web/assets/SocialPreviewEditor-B4nUY6FA.js.br +0 -0
- package/dist/runtime/dist/web/assets/SocialPreviewEditor-B4nUY6FA.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{Starter-I01MNooi.js → Starter-DrID859q.js} +1 -1
- package/dist/runtime/dist/web/assets/Starter-DrID859q.js.br +0 -0
- package/dist/runtime/dist/web/assets/Starter-DrID859q.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{Trash-Cu0KXeW7.js → Trash-DoKID_ux.js} +1 -1
- package/dist/runtime/dist/web/assets/Trash-DoKID_ux.js.br +0 -0
- package/dist/runtime/dist/web/assets/Trash-DoKID_ux.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{Welcome-B8iPt_Nh.js → Welcome-Ct29u9Y9.js} +1 -1
- package/dist/runtime/dist/web/assets/Welcome-Ct29u9Y9.js.br +0 -0
- package/dist/runtime/dist/web/assets/Welcome-Ct29u9Y9.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{WorkspaceLayout-fF_ot7EK.js → WorkspaceLayout-Qf3x5yOM.js} +1 -1
- package/dist/runtime/dist/web/assets/WorkspaceLayout-Qf3x5yOM.js.br +0 -0
- package/dist/runtime/dist/web/assets/WorkspaceLayout-Qf3x5yOM.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{browser-artifact-write-ZsGe-hXr.js → browser-artifact-write-CG72iseh.js} +1 -1
- package/dist/runtime/dist/web/assets/browser-artifact-write-CG72iseh.js.br +0 -0
- package/dist/runtime/dist/web/assets/browser-artifact-write-CG72iseh.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{chevron-down-COGO5cmx.js → chevron-down-M1fHuk7u.js} +1 -1
- package/dist/runtime/dist/web/assets/{chevron-left-BJZiR3W-.js → chevron-left-NHmvDJpN.js} +1 -1
- package/dist/runtime/dist/web/assets/{copy-PNNAtmJH.js → copy-v5iTV3kk.js} +1 -1
- package/dist/runtime/dist/web/assets/copy-v5iTV3kk.js.br +0 -0
- package/dist/runtime/dist/web/assets/copy-v5iTV3kk.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{database-CKOnpvwb.js → database-BbH2eTSj.js} +1 -1
- package/dist/runtime/dist/web/assets/database-BbH2eTSj.js.br +2 -0
- package/dist/runtime/dist/web/assets/database-BbH2eTSj.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{document-update-client-DUF0zs2Z.js → document-update-client-td73lQ81.js} +1 -1
- package/dist/runtime/dist/web/assets/document-update-client-td73lQ81.js.br +0 -0
- package/dist/runtime/dist/web/assets/document-update-client-td73lQ81.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{dom-mounter-64phOf1s.js → dom-mounter-BSxIt5bC.js} +1 -1
- package/dist/runtime/dist/web/assets/dom-mounter-BSxIt5bC.js.br +0 -0
- package/dist/runtime/dist/web/assets/dom-mounter-BSxIt5bC.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{download-j-nqks7p.js → download-Dk3mxCBK.js} +1 -1
- package/dist/runtime/dist/web/assets/download-Dk3mxCBK.js.br +0 -0
- package/dist/runtime/dist/web/assets/download-Dk3mxCBK.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{eye-BNpzRKAK.js → eye-DEiYMLrO.js} +1 -1
- package/dist/runtime/dist/web/assets/eye-DEiYMLrO.js.br +0 -0
- package/dist/runtime/dist/web/assets/eye-DEiYMLrO.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{file-up-DH-HiKEX.js → file-up-GoLKOXxO.js} +1 -1
- package/dist/runtime/dist/web/assets/file-up-GoLKOXxO.js.br +1 -0
- package/dist/runtime/dist/web/assets/file-up-GoLKOXxO.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{git-fork-PQOXxmWW.js → git-fork-CN41g1lF.js} +1 -1
- package/dist/runtime/dist/web/assets/git-fork-CN41g1lF.js.br +0 -0
- package/dist/runtime/dist/web/assets/git-fork-CN41g1lF.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{http-C2exCIpl.js → http-DEdzW08u.js} +1 -1
- package/dist/runtime/dist/web/assets/http-DEdzW08u.js.br +0 -0
- package/dist/runtime/dist/web/assets/http-DEdzW08u.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{list-Dj3WErnh.js → list-CA_o21oZ.js} +1 -1
- package/dist/runtime/dist/web/assets/list-CA_o21oZ.js.br +0 -0
- package/dist/runtime/dist/web/assets/list-CA_o21oZ.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{loader-circle-BXxJOPx-.js → loader-circle-2p_rsu6P.js} +1 -1
- package/dist/runtime/dist/web/assets/{lock-B1nhk71f.js → lock-BRsIxNP2.js} +1 -1
- package/dist/runtime/dist/web/assets/lock-BRsIxNP2.js.br +0 -0
- package/dist/runtime/dist/web/assets/lock-BRsIxNP2.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{person-mentions-BEjAedYZ.js → person-mentions-C7vQd7Vr.js} +1 -1
- package/dist/runtime/dist/web/assets/person-mentions-C7vQd7Vr.js.br +0 -0
- package/dist/runtime/dist/web/assets/person-mentions-C7vQd7Vr.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{plus-BtWrAD8F.js → plus-BNzHjmEg.js} +1 -1
- package/dist/runtime/dist/web/assets/{rotate-ccw-CSJ78xUE.js → rotate-ccw-CIMUmeuJ.js} +1 -1
- package/dist/runtime/dist/web/assets/rotate-ccw-CIMUmeuJ.js.br +0 -0
- package/dist/runtime/dist/web/assets/rotate-ccw-CIMUmeuJ.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{search-agWZofH1.js → search-CmIkt7xE.js} +1 -1
- package/dist/runtime/dist/web/assets/{session-D__Apnw9.js → session-BsshdoaV.js} +1 -1
- package/dist/runtime/dist/web/assets/session-BsshdoaV.js.br +0 -0
- package/dist/runtime/dist/web/assets/session-BsshdoaV.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{shelf-CeaX4iBg.js → shelf-DUXW45ap.js} +1 -1
- package/dist/runtime/dist/web/assets/shelf-DUXW45ap.js.br +0 -0
- package/dist/runtime/dist/web/assets/shelf-DUXW45ap.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{solid-app-BtmRR9Ax.js → solid-app-BNcsMwv4.js} +2 -2
- package/dist/runtime/dist/web/assets/solid-app-BNcsMwv4.js.br +0 -0
- package/dist/runtime/dist/web/assets/solid-app-BNcsMwv4.js.gz +0 -0
- package/dist/runtime/dist/web/assets/solid-app-DRAhiXqs.css +2 -0
- package/dist/runtime/dist/web/assets/solid-app-DRAhiXqs.css.br +0 -0
- package/dist/runtime/dist/web/assets/solid-app-DRAhiXqs.css.gz +0 -0
- package/dist/runtime/dist/web/assets/{undo-2-Di8QrlfX.js → undo-2--XbU60MY.js} +1 -1
- package/dist/runtime/dist/web/assets/undo-2--XbU60MY.js.br +0 -0
- package/dist/runtime/dist/web/assets/undo-2--XbU60MY.js.gz +0 -0
- package/dist/runtime/dist/web/assets/{users-BJrdLUkX.js → users-Bm0xpNrq.js} +1 -1
- package/dist/runtime/dist/web/assets/users-Bm0xpNrq.js.br +0 -0
- package/dist/runtime/dist/web/assets/users-Bm0xpNrq.js.gz +0 -0
- package/dist/runtime/dist/web/solid-app.html +2 -2
- package/dist/runtime/draft-compile-worker.mjs +10 -0
- package/dist/runtime/host.mjs +12 -2
- package/dist/runtime/lambda-page-runtime.js +1 -1
- package/dist/runtime/lib/build-assets/.server-reader-cache.json +1 -1
- package/dist/runtime/lib/build-assets/offline/.build-cache.json +10 -7
- package/dist/runtime/lib/build-assets/offline/manifest.json +4 -4
- package/dist/runtime/lib/build-assets/offline/solid.js.gz +0 -0
- package/dist/runtime/lib/build-assets/prepared-sources.sha256 +1 -1
- package/dist/runtime/pool-worker.mjs +3 -0
- package/dist/runtime/preview/{ScreenshotEditor-R3UODF65.js → ScreenshotEditor-LHC3JZSA.js} +1 -1
- package/dist/runtime/preview/{annotate-U27XXRZK.js → annotate-THM7GL72.js} +1 -1
- package/dist/runtime/preview/chrome.css +1 -1
- package/dist/runtime/preview/{chunk-7RMKAFBO.js → chunk-4O7LVK2Q.js} +1 -1
- package/dist/runtime/preview/chunk-7T3V6PAW.js +1 -0
- package/dist/runtime/preview/{chunk-3KKU74WM.js → chunk-RDT3C3F6.js} +1 -1
- package/dist/runtime/preview/client.js +13 -13
- package/dist/runtime/preview/connect.js +1 -0
- package/dist/runtime/preview/{dom-mounter-3OQN7G4J.js → dom-mounter-2URPGP2F.js} +1 -1
- package/dist/runtime/preview/{engine-I6R47UTB.js → engine-5UO3LPN5.js} +1 -1
- package/dist/runtime/preview/{selection-actions-426G2H4N.js → selection-actions-LBFPODLD.js} +1 -1
- package/dist/runtime/preview/{session-UFN5GQK2.js → session-A2Z3M7QD.js} +1 -1
- package/dist/runtime/preview/update-parts-ZLXTYSVY.js +1 -0
- package/dist/runtime/preview.mjs +74496 -74135
- package/dist/runtime/public/chat/install.ps1 +1 -1
- package/dist/runtime/public/chat/install.sh +1 -1
- package/dist/runtime/public/chat/release.json +1 -1
- package/dist/runtime/public/islands/{boot-74e9143aa374c62b.js → boot-281adc05179334e6.js} +1 -1
- package/dist/runtime/public/islands/boot-281adc05179334e6.js.br +0 -0
- package/dist/runtime/public/islands/boot-281adc05179334e6.js.gz +0 -0
- package/dist/runtime/public/islands/{chunk-51a4b62dc42f3594.js → chunk-1af2f1c5f3e99805.js} +1 -1
- package/dist/runtime/public/islands/chunk-1af2f1c5f3e99805.js.br +0 -0
- package/dist/runtime/public/islands/chunk-1af2f1c5f3e99805.js.gz +0 -0
- package/dist/runtime/public/islands/{chunk-f451297257164687.js → chunk-2f5d885a7394f865.js} +1 -1
- package/dist/runtime/public/islands/chunk-2f5d885a7394f865.js.br +0 -0
- package/dist/runtime/public/islands/{chunk-f451297257164687.js.gz → chunk-2f5d885a7394f865.js.gz} +0 -0
- package/dist/runtime/public/islands/{chunk-68a083200dbd5bf7.js → chunk-3cb86bf7badbd2c3.js} +1 -1
- package/dist/runtime/public/islands/chunk-3cb86bf7badbd2c3.js.br +0 -0
- package/dist/runtime/public/islands/chunk-3cb86bf7badbd2c3.js.gz +0 -0
- package/dist/runtime/public/islands/{chunk-adcd632c8be50ba7.js → chunk-5e05b99cb275660b.js} +1 -1
- package/dist/runtime/public/islands/chunk-5e05b99cb275660b.js.br +0 -0
- package/dist/runtime/public/islands/{chunk-adcd632c8be50ba7.js.gz → chunk-5e05b99cb275660b.js.gz} +0 -0
- package/dist/runtime/public/islands/{chunk-e817ee4addba2d95.js → chunk-d924d4620b11b893.js} +1 -1
- package/dist/runtime/public/islands/chunk-d924d4620b11b893.js.br +0 -0
- package/dist/runtime/public/islands/chunk-d924d4620b11b893.js.gz +0 -0
- package/dist/runtime/public/islands/{chunk-1fa28532f51beb9c.js → chunk-dfe07cc2b19c50cc.js} +1 -1
- package/dist/runtime/public/islands/{frame-editor-6b8a50886fff8604.js → frame-editor-66b0c0d98283e912.js} +1 -1
- package/dist/runtime/public/islands/frame-editor-66b0c0d98283e912.js.br +0 -0
- package/dist/runtime/public/islands/frame-editor-66b0c0d98283e912.js.gz +0 -0
- package/dist/runtime/public/islands/{frame-editor-chunk-87b0311faf57261c.js → frame-editor-chunk-091e41cba1670be1.js} +1 -1
- package/dist/runtime/public/islands/frame-editor-chunk-091e41cba1670be1.js.br +0 -0
- package/dist/runtime/public/islands/frame-editor-chunk-091e41cba1670be1.js.gz +0 -0
- package/dist/runtime/public/islands/{frame-editor-chunk-69c553d9c4562981.js → frame-editor-chunk-5ea52db3a6d93294.js} +1 -1
- package/dist/runtime/public/islands/frame-editor-chunk-5ea52db3a6d93294.js.br +2 -0
- package/dist/runtime/public/islands/frame-editor-chunk-5ea52db3a6d93294.js.gz +0 -0
- package/dist/runtime/public/islands/{frame-editor-chunk-c2b9018371100824.js → frame-editor-chunk-a6db6db210776f5c.js} +1 -1
- package/dist/runtime/public/islands/frame-editor-chunk-a6db6db210776f5c.js.br +0 -0
- package/dist/runtime/public/islands/frame-editor-chunk-a6db6db210776f5c.js.gz +0 -0
- package/dist/runtime/public/islands/{frame-editor-chunk-a13dce46b9b8401f.js → frame-editor-chunk-c9facbfeee3c9bed.js} +1 -1
- package/dist/runtime/public/islands/frame-editor-chunk-c9facbfeee3c9bed.js.br +0 -0
- package/dist/runtime/public/islands/frame-editor-chunk-c9facbfeee3c9bed.js.gz +0 -0
- package/dist/runtime/public/islands/{frame-editor-chunk-b06f17fc7dae17e8.js → frame-editor-chunk-d6c77179f72db0ab.js} +1 -1
- package/dist/runtime/public/islands/frame-editor-chunk-d6c77179f72db0ab.js.br +0 -0
- package/dist/runtime/public/islands/frame-editor-chunk-d6c77179f72db0ab.js.gz +0 -0
- package/dist/runtime/public/islands/{image-map-a9f95f7e8d0712c1.js → image-map-7419ab54ff59434a.js} +1 -1
- package/dist/runtime/public/islands/image-map-7419ab54ff59434a.js.br +0 -0
- package/dist/runtime/public/islands/image-map-7419ab54ff59434a.js.gz +0 -0
- package/dist/runtime/public/islands/{kit-basic-cbabcc4b41d6132a.js → kit-basic-c22b54dcd2ea6161.js} +1 -1
- package/dist/runtime/public/islands/kit-basic-c22b54dcd2ea6161.js.br +2 -0
- package/dist/runtime/public/islands/kit-basic-c22b54dcd2ea6161.js.gz +0 -0
- package/dist/runtime/public/islands/{kit-cells-cefbceccdfd0dbe0.js → kit-cells-55ade213f1751716.js} +1 -1
- package/dist/runtime/public/islands/kit-cells-55ade213f1751716.js.br +0 -0
- package/dist/runtime/public/islands/kit-cells-55ade213f1751716.js.gz +0 -0
- package/dist/runtime/public/islands/{kit-controls-81d17a10f9d457f2.js → kit-controls-4f1b98d7d87c4b21.js} +1 -1
- package/dist/runtime/public/islands/kit-controls-4f1b98d7d87c4b21.js.br +0 -0
- package/dist/runtime/public/islands/kit-controls-4f1b98d7d87c4b21.js.gz +0 -0
- package/dist/runtime/public/islands/{kit-data-43947f36f1c501aa.js → kit-data-e1012fd12092b177.js} +1 -1
- package/dist/runtime/public/islands/kit-data-e1012fd12092b177.js.br +0 -0
- package/dist/runtime/public/islands/kit-data-e1012fd12092b177.js.gz +0 -0
- package/dist/runtime/public/islands/{kit-dialog-eedc51ce82feec4b.js → kit-dialog-1e427336472b2906.js} +1 -1
- package/dist/runtime/public/islands/kit-dialog-1e427336472b2906.js.br +0 -0
- package/dist/runtime/public/islands/kit-dialog-1e427336472b2906.js.gz +0 -0
- package/dist/runtime/public/islands/{kit-embed-3c8886cbfa06f74d.js → kit-embed-c7019820c5200806.js} +1 -1
- package/dist/runtime/public/islands/kit-embed-c7019820c5200806.js.br +0 -0
- package/dist/runtime/public/islands/kit-embed-c7019820c5200806.js.gz +0 -0
- package/dist/runtime/public/islands/{kit-files-b7a2cb758f00a68b.js → kit-files-dc0b71ca71f2151c.js} +1 -1
- package/dist/runtime/public/islands/kit-files-dc0b71ca71f2151c.js.br +0 -0
- package/dist/runtime/public/islands/kit-files-dc0b71ca71f2151c.js.gz +0 -0
- package/dist/runtime/public/islands/{kit-image-126e12fcae4215c1.js → kit-image-b31acf4d31a4eeaf.js} +1 -1
- package/dist/runtime/public/islands/kit-image-b31acf4d31a4eeaf.js.br +0 -0
- package/dist/runtime/public/islands/kit-image-b31acf4d31a4eeaf.js.gz +0 -0
- package/dist/runtime/public/islands/{kit-people-5b6f5dd4aa82b657.js → kit-people-6feb1b730c5fd37f.js} +1 -1
- package/dist/runtime/public/islands/kit-people-6feb1b730c5fd37f.js.br +0 -0
- package/dist/runtime/public/islands/kit-people-6feb1b730c5fd37f.js.gz +0 -0
- package/dist/runtime/public/islands/{kit-static-28174bd8f593f8c0.js → kit-static-853aed2cd04c1b4a.js} +1 -1
- package/dist/runtime/public/islands/kit-static-853aed2cd04c1b4a.js.br +0 -0
- package/dist/runtime/public/islands/kit-static-853aed2cd04c1b4a.js.gz +0 -0
- package/dist/runtime/public/islands/manifest.json +211 -211
- package/dist/runtime/public/islands/manifest.json.br +0 -0
- package/dist/runtime/public/islands/manifest.json.gz +0 -0
- package/dist/runtime/public/islands/{morph-engine-4e664485be475dbf.js → morph-engine-c61693caf767d9bd.js} +1 -1
- package/dist/runtime/public/islands/morph-engine-c61693caf767d9bd.js.br +0 -0
- package/dist/runtime/public/islands/morph-engine-c61693caf767d9bd.js.gz +0 -0
- package/dist/runtime/public/islands/offline-ba3717e06bc69a4e.json.gzip +0 -0
- package/dist/runtime/public/islands/{page-5f87c34c7c181387.js → page-c3ae4acf0988c2b6.js} +1 -1
- package/dist/runtime/public/islands/page-c3ae4acf0988c2b6.js.br +0 -0
- package/dist/runtime/public/islands/page-c3ae4acf0988c2b6.js.gz +0 -0
- package/dist/runtime/public/islands/{rt-30ff0d94ee3732a1.js → rt-2ab0fed85481c574.js} +1 -1
- package/dist/runtime/public/islands/rt-2ab0fed85481c574.js.br +0 -0
- package/dist/runtime/public/islands/rt-2ab0fed85481c574.js.gz +0 -0
- package/dist/runtime/public/islands/{sqlite-engine-9fc56fea8b1e2aaf.js → sqlite-engine-f3956693df7cfa5c.js} +8 -8
- package/dist/runtime/public/islands/sqlite-engine-f3956693df7cfa5c.js.br +0 -0
- package/dist/runtime/public/islands/sqlite-engine-f3956693df7cfa5c.js.gz +0 -0
- package/dist/runtime/public/islands/{ssr-456cabbcb26f723d.js → ssr-ce6931fb7bda9b08.js} +3 -0
- package/dist/runtime/public/islands/ssr-ce6931fb7bda9b08.js.br +0 -0
- package/dist/runtime/public/islands/ssr-ce6931fb7bda9b08.js.gz +0 -0
- package/dist/runtime/public/islands/{url-sync-74b5212f7b3417d7.js → url-sync-b179b054c9d958a7.js} +1 -1
- package/dist/runtime/public/islands/url-sync-b179b054c9d958a7.js.br +0 -0
- package/dist/runtime/public/islands/url-sync-b179b054c9d958a7.js.gz +0 -0
- package/dist/share/man/man1/afbin.1 +6 -4
- package/dist/skills/artifactbin/references/commands.md +4 -2
- package/dist/skills/artifactbin/references/publishing.md +5 -3
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/dist/runtime/dist/web/assets/Account-CvOF6jpD.js.br +0 -0
- package/dist/runtime/dist/web/assets/Account-CvOF6jpD.js.gz +0 -0
- package/dist/runtime/dist/web/assets/ArtifactAddress-DORDne01.js.br +0 -0
- package/dist/runtime/dist/web/assets/ArtifactAddress-DORDne01.js.gz +0 -0
- package/dist/runtime/dist/web/assets/ArtifactData-BdL9R2dA.js.br +0 -0
- package/dist/runtime/dist/web/assets/ArtifactData-BdL9R2dA.js.gz +0 -0
- package/dist/runtime/dist/web/assets/ArtifactEditor-BZXbOk_F.js.br +0 -0
- package/dist/runtime/dist/web/assets/ArtifactEditor-BZXbOk_F.js.gz +0 -0
- package/dist/runtime/dist/web/assets/AssetPageHeader-DX2RcYTv.js.br +0 -0
- package/dist/runtime/dist/web/assets/AssetPageHeader-DX2RcYTv.js.gz +0 -0
- package/dist/runtime/dist/web/assets/Assets-dgdXIgAW.js.br +0 -0
- package/dist/runtime/dist/web/assets/Assets-dgdXIgAW.js.gz +0 -0
- package/dist/runtime/dist/web/assets/AvatarCircle-MNnIhRvg.js.br +0 -0
- package/dist/runtime/dist/web/assets/AvatarCircle-MNnIhRvg.js.gz +0 -0
- package/dist/runtime/dist/web/assets/Chat-V1ku1-60.js.br +0 -0
- package/dist/runtime/dist/web/assets/Chat-V1ku1-60.js.gz +0 -0
- package/dist/runtime/dist/web/assets/ConfirmDialog-Ph1VDgNN.js.br +0 -0
- package/dist/runtime/dist/web/assets/ConfirmDialog-Ph1VDgNN.js.gz +0 -0
- package/dist/runtime/dist/web/assets/DatasetCatalogView-DBJEPKFI.js.br +0 -0
- package/dist/runtime/dist/web/assets/DatasetCatalogView-DBJEPKFI.js.gz +0 -0
- package/dist/runtime/dist/web/assets/DatasetEditor-CMqN1duq.js.br +0 -0
- package/dist/runtime/dist/web/assets/DatasetEditor-CMqN1duq.js.gz +0 -0
- package/dist/runtime/dist/web/assets/Docs-DVoW7b7v.js.br +0 -0
- package/dist/runtime/dist/web/assets/Docs-DVoW7b7v.js.gz +0 -0
- package/dist/runtime/dist/web/assets/Document-udhy5mlX.js.br +0 -0
- package/dist/runtime/dist/web/assets/Document-udhy5mlX.js.gz +0 -0
- package/dist/runtime/dist/web/assets/DocumentChrome-EUbW_JvA.js.br +0 -0
- package/dist/runtime/dist/web/assets/DocumentChrome-EUbW_JvA.js.gz +0 -0
- package/dist/runtime/dist/web/assets/DocumentSharing-BuTXuflA.js.br +0 -0
- package/dist/runtime/dist/web/assets/DocumentSharing-BuTXuflA.js.gz +0 -0
- package/dist/runtime/dist/web/assets/FileUpload-D6RTOrHD.js.br +0 -0
- package/dist/runtime/dist/web/assets/FileUpload-D6RTOrHD.js.gz +0 -0
- package/dist/runtime/dist/web/assets/Folder-DoNsFB2I.js.br +0 -0
- package/dist/runtime/dist/web/assets/Folder-DoNsFB2I.js.gz +0 -0
- package/dist/runtime/dist/web/assets/ForkArtifact-DDmXl1BZ.js.br +0 -0
- package/dist/runtime/dist/web/assets/ForkArtifact-DDmXl1BZ.js.gz +0 -0
- package/dist/runtime/dist/web/assets/GetStarted-YjltMEeN.js.br +0 -0
- package/dist/runtime/dist/web/assets/GetStarted-YjltMEeN.js.gz +0 -0
- package/dist/runtime/dist/web/assets/Home-DijnltFZ.js.br +0 -0
- package/dist/runtime/dist/web/assets/Home-DijnltFZ.js.gz +0 -0
- package/dist/runtime/dist/web/assets/Login-DLwn4aUr.js.br +0 -0
- package/dist/runtime/dist/web/assets/Login-DLwn4aUr.js.gz +0 -0
- package/dist/runtime/dist/web/assets/NotFound-svz4wCeL.js.br +0 -0
- package/dist/runtime/dist/web/assets/NotFound-svz4wCeL.js.gz +0 -0
- package/dist/runtime/dist/web/assets/Notifications-BGeJKv2W.js.br +0 -0
- package/dist/runtime/dist/web/assets/Notifications-BGeJKv2W.js.gz +0 -0
- package/dist/runtime/dist/web/assets/Profile-B38GeCbR.js.br +0 -0
- package/dist/runtime/dist/web/assets/Profile-B38GeCbR.js.gz +0 -0
- package/dist/runtime/dist/web/assets/Program-D3-Gfvjo.js.br +0 -0
- package/dist/runtime/dist/web/assets/Program-D3-Gfvjo.js.gz +0 -0
- package/dist/runtime/dist/web/assets/RowMenu-J4Gbci3B.js.br +0 -0
- package/dist/runtime/dist/web/assets/RowMenu-J4Gbci3B.js.gz +0 -0
- package/dist/runtime/dist/web/assets/Schedules-DK3-YUvJ.js +0 -1
- package/dist/runtime/dist/web/assets/Schedules-DK3-YUvJ.js.br +0 -0
- package/dist/runtime/dist/web/assets/Schedules-DK3-YUvJ.js.gz +0 -0
- package/dist/runtime/dist/web/assets/ScreenshotEditor-CUmN5F2q.js.br +0 -0
- package/dist/runtime/dist/web/assets/ScreenshotEditor-CUmN5F2q.js.gz +0 -0
- package/dist/runtime/dist/web/assets/ShareLink-n8KhtnaI.js.br +0 -0
- package/dist/runtime/dist/web/assets/ShareLink-n8KhtnaI.js.gz +0 -0
- package/dist/runtime/dist/web/assets/Shelf-BgwHOaeW.js.br +0 -0
- package/dist/runtime/dist/web/assets/Shelf-BgwHOaeW.js.gz +0 -0
- package/dist/runtime/dist/web/assets/SocialPreviewEditor-DwHHRW29.js.br +0 -0
- package/dist/runtime/dist/web/assets/SocialPreviewEditor-DwHHRW29.js.gz +0 -0
- package/dist/runtime/dist/web/assets/Starter-I01MNooi.js.br +0 -0
- package/dist/runtime/dist/web/assets/Starter-I01MNooi.js.gz +0 -0
- package/dist/runtime/dist/web/assets/Trash-Cu0KXeW7.js.br +0 -0
- package/dist/runtime/dist/web/assets/Trash-Cu0KXeW7.js.gz +0 -0
- package/dist/runtime/dist/web/assets/Welcome-B8iPt_Nh.js.br +0 -0
- package/dist/runtime/dist/web/assets/Welcome-B8iPt_Nh.js.gz +0 -0
- package/dist/runtime/dist/web/assets/WorkspaceLayout-fF_ot7EK.js.br +0 -0
- package/dist/runtime/dist/web/assets/WorkspaceLayout-fF_ot7EK.js.gz +0 -0
- package/dist/runtime/dist/web/assets/browser-artifact-write-ZsGe-hXr.js.br +0 -0
- package/dist/runtime/dist/web/assets/browser-artifact-write-ZsGe-hXr.js.gz +0 -0
- package/dist/runtime/dist/web/assets/copy-PNNAtmJH.js.br +0 -0
- package/dist/runtime/dist/web/assets/copy-PNNAtmJH.js.gz +0 -0
- package/dist/runtime/dist/web/assets/database-CKOnpvwb.js.br +0 -3
- package/dist/runtime/dist/web/assets/database-CKOnpvwb.js.gz +0 -0
- package/dist/runtime/dist/web/assets/document-update-client-DUF0zs2Z.js.br +0 -0
- package/dist/runtime/dist/web/assets/document-update-client-DUF0zs2Z.js.gz +0 -0
- package/dist/runtime/dist/web/assets/dom-mounter-64phOf1s.js.br +0 -0
- package/dist/runtime/dist/web/assets/dom-mounter-64phOf1s.js.gz +0 -0
- package/dist/runtime/dist/web/assets/download-j-nqks7p.js.br +0 -0
- package/dist/runtime/dist/web/assets/download-j-nqks7p.js.gz +0 -0
- package/dist/runtime/dist/web/assets/eye-BNpzRKAK.js.br +0 -0
- package/dist/runtime/dist/web/assets/eye-BNpzRKAK.js.gz +0 -0
- package/dist/runtime/dist/web/assets/file-up-DH-HiKEX.js.br +0 -0
- package/dist/runtime/dist/web/assets/file-up-DH-HiKEX.js.gz +0 -0
- package/dist/runtime/dist/web/assets/git-fork-PQOXxmWW.js.br +0 -0
- package/dist/runtime/dist/web/assets/git-fork-PQOXxmWW.js.gz +0 -0
- package/dist/runtime/dist/web/assets/http-C2exCIpl.js.br +0 -0
- package/dist/runtime/dist/web/assets/http-C2exCIpl.js.gz +0 -0
- package/dist/runtime/dist/web/assets/list-Dj3WErnh.js.br +0 -0
- package/dist/runtime/dist/web/assets/list-Dj3WErnh.js.gz +0 -0
- package/dist/runtime/dist/web/assets/lock-B1nhk71f.js.br +0 -0
- package/dist/runtime/dist/web/assets/lock-B1nhk71f.js.gz +0 -0
- package/dist/runtime/dist/web/assets/person-mentions-BEjAedYZ.js.br +0 -0
- package/dist/runtime/dist/web/assets/person-mentions-BEjAedYZ.js.gz +0 -0
- package/dist/runtime/dist/web/assets/rotate-ccw-CSJ78xUE.js.br +0 -0
- package/dist/runtime/dist/web/assets/rotate-ccw-CSJ78xUE.js.gz +0 -0
- package/dist/runtime/dist/web/assets/session-D__Apnw9.js.br +0 -0
- package/dist/runtime/dist/web/assets/session-D__Apnw9.js.gz +0 -0
- package/dist/runtime/dist/web/assets/shelf-CeaX4iBg.js.br +0 -0
- package/dist/runtime/dist/web/assets/shelf-CeaX4iBg.js.gz +0 -0
- package/dist/runtime/dist/web/assets/solid-app-BmdFnFpX.css +0 -2
- package/dist/runtime/dist/web/assets/solid-app-BmdFnFpX.css.br +0 -0
- package/dist/runtime/dist/web/assets/solid-app-BmdFnFpX.css.gz +0 -0
- package/dist/runtime/dist/web/assets/solid-app-BtmRR9Ax.js.br +0 -0
- package/dist/runtime/dist/web/assets/solid-app-BtmRR9Ax.js.gz +0 -0
- package/dist/runtime/dist/web/assets/undo-2-Di8QrlfX.js.br +0 -0
- package/dist/runtime/dist/web/assets/undo-2-Di8QrlfX.js.gz +0 -0
- package/dist/runtime/dist/web/assets/users-BJrdLUkX.js.br +0 -0
- package/dist/runtime/dist/web/assets/users-BJrdLUkX.js.gz +0 -0
- package/dist/runtime/preview/update-parts-OJC3ZSRW.js +0 -1
- package/dist/runtime/public/islands/boot-74e9143aa374c62b.js.br +0 -0
- package/dist/runtime/public/islands/boot-74e9143aa374c62b.js.gz +0 -0
- package/dist/runtime/public/islands/chunk-51a4b62dc42f3594.js.br +0 -0
- package/dist/runtime/public/islands/chunk-51a4b62dc42f3594.js.gz +0 -0
- package/dist/runtime/public/islands/chunk-68a083200dbd5bf7.js.br +0 -0
- package/dist/runtime/public/islands/chunk-68a083200dbd5bf7.js.gz +0 -0
- package/dist/runtime/public/islands/chunk-adcd632c8be50ba7.js.br +0 -0
- package/dist/runtime/public/islands/chunk-e817ee4addba2d95.js.br +0 -0
- package/dist/runtime/public/islands/chunk-e817ee4addba2d95.js.gz +0 -0
- package/dist/runtime/public/islands/chunk-f451297257164687.js.br +0 -0
- package/dist/runtime/public/islands/frame-editor-6b8a50886fff8604.js.br +0 -0
- package/dist/runtime/public/islands/frame-editor-6b8a50886fff8604.js.gz +0 -0
- package/dist/runtime/public/islands/frame-editor-chunk-69c553d9c4562981.js.br +0 -1
- package/dist/runtime/public/islands/frame-editor-chunk-69c553d9c4562981.js.gz +0 -0
- package/dist/runtime/public/islands/frame-editor-chunk-87b0311faf57261c.js.br +0 -0
- package/dist/runtime/public/islands/frame-editor-chunk-87b0311faf57261c.js.gz +0 -0
- package/dist/runtime/public/islands/frame-editor-chunk-a13dce46b9b8401f.js.br +0 -0
- package/dist/runtime/public/islands/frame-editor-chunk-a13dce46b9b8401f.js.gz +0 -0
- package/dist/runtime/public/islands/frame-editor-chunk-b06f17fc7dae17e8.js.br +0 -0
- package/dist/runtime/public/islands/frame-editor-chunk-b06f17fc7dae17e8.js.gz +0 -0
- package/dist/runtime/public/islands/frame-editor-chunk-c2b9018371100824.js.br +0 -0
- package/dist/runtime/public/islands/frame-editor-chunk-c2b9018371100824.js.gz +0 -0
- package/dist/runtime/public/islands/image-map-a9f95f7e8d0712c1.js.br +0 -0
- package/dist/runtime/public/islands/image-map-a9f95f7e8d0712c1.js.gz +0 -0
- package/dist/runtime/public/islands/kit-basic-cbabcc4b41d6132a.js.br +0 -0
- package/dist/runtime/public/islands/kit-basic-cbabcc4b41d6132a.js.gz +0 -0
- package/dist/runtime/public/islands/kit-cells-cefbceccdfd0dbe0.js.br +0 -0
- package/dist/runtime/public/islands/kit-cells-cefbceccdfd0dbe0.js.gz +0 -0
- package/dist/runtime/public/islands/kit-controls-81d17a10f9d457f2.js.br +0 -0
- package/dist/runtime/public/islands/kit-controls-81d17a10f9d457f2.js.gz +0 -0
- package/dist/runtime/public/islands/kit-data-43947f36f1c501aa.js.br +0 -0
- package/dist/runtime/public/islands/kit-data-43947f36f1c501aa.js.gz +0 -0
- package/dist/runtime/public/islands/kit-dialog-eedc51ce82feec4b.js.br +0 -0
- package/dist/runtime/public/islands/kit-dialog-eedc51ce82feec4b.js.gz +0 -0
- package/dist/runtime/public/islands/kit-embed-3c8886cbfa06f74d.js.br +0 -0
- package/dist/runtime/public/islands/kit-embed-3c8886cbfa06f74d.js.gz +0 -0
- package/dist/runtime/public/islands/kit-files-b7a2cb758f00a68b.js.br +0 -0
- package/dist/runtime/public/islands/kit-files-b7a2cb758f00a68b.js.gz +0 -0
- package/dist/runtime/public/islands/kit-image-126e12fcae4215c1.js.br +0 -0
- package/dist/runtime/public/islands/kit-image-126e12fcae4215c1.js.gz +0 -0
- package/dist/runtime/public/islands/kit-people-5b6f5dd4aa82b657.js.br +0 -0
- package/dist/runtime/public/islands/kit-people-5b6f5dd4aa82b657.js.gz +0 -0
- package/dist/runtime/public/islands/kit-static-28174bd8f593f8c0.js.br +0 -0
- package/dist/runtime/public/islands/kit-static-28174bd8f593f8c0.js.gz +0 -0
- package/dist/runtime/public/islands/morph-engine-4e664485be475dbf.js.br +0 -0
- package/dist/runtime/public/islands/morph-engine-4e664485be475dbf.js.gz +0 -0
- package/dist/runtime/public/islands/offline-4446a94ed9f706c3.json.gzip +0 -0
- package/dist/runtime/public/islands/page-5f87c34c7c181387.js.br +0 -0
- package/dist/runtime/public/islands/page-5f87c34c7c181387.js.gz +0 -0
- package/dist/runtime/public/islands/rt-30ff0d94ee3732a1.js.br +0 -0
- package/dist/runtime/public/islands/rt-30ff0d94ee3732a1.js.gz +0 -0
- package/dist/runtime/public/islands/sqlite-engine-9fc56fea8b1e2aaf.js.br +0 -0
- package/dist/runtime/public/islands/sqlite-engine-9fc56fea8b1e2aaf.js.gz +0 -0
- package/dist/runtime/public/islands/ssr-456cabbcb26f723d.js.br +0 -0
- package/dist/runtime/public/islands/ssr-456cabbcb26f723d.js.gz +0 -0
- package/dist/runtime/public/islands/url-sync-74b5212f7b3417d7.js.br +0 -0
- package/dist/runtime/public/islands/url-sync-74b5212f7b3417d7.js.gz +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as re,b as Jt,c as $e,d as bt}from"./chunk-2CWE6B2E.js";import{A as v,B as pe,C as M,D as de,E as Cn,F as et,G as se,H as He,I as xe,J as m,K as tt,L as Pe,M as nt,a as Ue,b as N,c as H,d as Q,e as ve,f as Re,g as we,h as Ie,i as ye,j as K,k as wr,l as kr,m as Dt,n as Le,o as Fe,q as d,r as G,t as $r,u as ht,v as ge,w as T,x as Er,y as Y,z as _r}from"./chunk-5JF7QI4S.js";import{a as ze,b as An,q as qt}from"./chunk-RCXK2DBZ.js";import{A as rt,B as Ir,C as Pr,D as Mr,E as Or,F as Ht,G as Lr,a as Cr,b as gt,c as Sr,d as Ft,m as Sn,n as jt,o as Rn,s as Rr,t as Tr,w as Tn,y as qe,z as Ar}from"./chunk-JTUTVTQG.js";import{a as Pn,b as We}from"./chunk-SM7P2RYM.js";import{a as Hr}from"./chunk-3KKU74WM.js";import{a as zt}from"./chunk-7RMKAFBO.js";import"./chunk-BYXBJQAS.js";import{a as jr}from"./chunk-7AB63FHW.js";import{a as Nr,b as ke,d as Dr,e as Fr,f as pt,g as _e}from"./chunk-QVSMXME5.js";import"./chunk-JABILGJZ.js";import{a as Me}from"./chunk-7PMY7F6T.js";import{c as In}from"./chunk-RXGLTQLL.js";import"./chunk-OOJM4CTU.js";function Bt(e,t){e.runtimeRef.current?.send(t)}function Ut(e,t){return e.runtimeRef.current?.subscribe(n=>t({data:n}))??(()=>{})}function Wt(e){return e.runtimeRef.current?.getViewportRect()}function qr(e){return!!e.runtimeRef.current}var Vt=We,Ui="data-mx-ast";function Jr(e,t){let n=ke(e);if(!n.ok)return e;let o=!1;for(let r of t){let i=Vt(n.nodes,r.astPath);if(!(!i||i.type!=="element"||i.isComponent)&&(r.className!==void 0&&(Wi(i,r.className.trim()),o=!0),r.style!==void 0)){let l=r.style.trim();Te(i,"style",l===""?void 0:l),o=!0}}return o?_e(n.nodes):e}function Br(e,t){if(t.length===0)return e;let n=ke(e);if(!n.ok)return e;let o=!1;for(let r of t){let i=Vt(n.nodes,r.astPath);!i||i.type!=="element"||!i.isComponent||i.tag!=="GridItem"||(Te(i,"x",r.x),Te(i,"y",r.y),Te(i,"w",r.w),Te(i,"h",r.h),o=!0)}return o?_e(n.nodes):e}function Wi(e,t){let n=i=>i.name==="className"||i.name==="class",o=e.attributes.findIndex(n);for(let i=e.attributes.length-1;i>=0;i--)n(e.attributes[i])&&e.attributes.splice(i,1);if(t==="")return;let r={name:"className",value:{static:!0,json:t},start:0,end:0};e.attributes.splice(o===-1?e.attributes.length:o,0,r)}function Te(e,t,n){let o=e.attributes.findIndex(i=>i.name===t);if(n===void 0){o!==-1&&e.attributes.splice(o,1);return}let r={name:t,value:{static:!0,json:n},start:0,end:0};o!==-1?e.attributes[o]=r:e.attributes.push(r)}var pd=Me(["span","strong","b","em","i","a","code","br","small","sup","sub","s","del","u","mark","kbd","abbr","time"]),bd=Me(["thead","tbody","tfoot","tr","td","th","caption","colgroup","col","li"]),vd=Me(["Card","CardContent","CardHeader","CardFooter","GridItem","Slide"]),yd=Me(["div","section","article","main","aside","header","footer","figure","nav"]);var Vi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",xd=`${Vi}0123456789`;var Gi=Me(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Yi=Me(["script","style","textarea","title","xmp"]),Ki=Me(["script","iframe","object","embed","base","meta","link","form","frame","frameset","applet","noscript"]),Xi=Me(["dangerouslysetinnerhtml","ref","key","srcdoc","is"]),Zi=Me(["style","labelstyle"]),Qi=Me(["href","src","action","formaction","poster","background","cite","data","xlink:href","ping"]),ea=Me(["srcset","ping"]),ta=Me(In.map(e=>e.toLowerCase())),na={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xA0"};function zr(e){return e.replace(/&(#[xX]?[0-9a-fA-F]+|[a-zA-Z]+);/g,(t,n)=>{if(n[0]==="#"){let o=n[1]==="x"||n[1]==="X",r=parseInt(n.slice(o?2:1),o?16:10);return Number.isFinite(r)&&r>=0&&r<=1114111?String.fromCodePoint(r):t}return na[n.toLowerCase()]??t})}function ra(e){let t={kind:"el",tag:"#root",attrs:[],children:[]},n=[t],o=()=>n[n.length-1],r=l=>{l&&o().children.push({kind:"text",value:zr(l)})},i=0;for(;i<e.length;){let l=e.indexOf("<",i);if(l===-1){r(e.slice(i));break}if(l>i&&r(e.slice(i,l)),e.startsWith("<!--",l)){let y=e.indexOf("-->",l+4);i=y===-1?e.length:y+3;continue}if(e[l+1]==="!"||e[l+1]==="?"){let y=e.indexOf(">",l);i=y===-1?e.length:y+1;continue}if(e[l+1]==="/"){let y=e.indexOf(">",l),p=e.slice(l+2,y===-1?e.length:y).trim().toLowerCase();for(let x=n.length-1;x>=1;x--)if(n[x].tag===p){n.length=x;break}i=y===-1?e.length:y+1;continue}let c=/^<([a-zA-Z][a-zA-Z0-9-]*)/.exec(e.slice(l));if(!c){r("<"),i=l+1;continue}let s=c[1].toLowerCase(),a=l+c[0].length,f=[],h=!1;for(;a<e.length;){for(;a<e.length&&/\s/.test(e[a]);)a++;if(e[a]===">"){a++;break}if(e[a]==="/"){if(e[a+1]===">"){h=!0,a+=2;break}a++;continue}let y=/^[^\s=/>]+/.exec(e.slice(a));if(!y){a++;continue}let p=y[0];for(a+=y[0].length;a<e.length&&/\s/.test(e[a]);)a++;if(e[a]==="="){for(a++;a<e.length&&/\s/.test(e[a]);)a++;let x="",g=e[a];if(g==='"'||g==="'"){let C=e.indexOf(g,a+1);x=e.slice(a+1,C===-1?e.length:C),a=C===-1?e.length:C+1}else{let C=/^[^\s>]*/.exec(e.slice(a));x=C?C[0]:"",a+=x.length}f.push({name:p,value:zr(x)})}else f.push({name:p,value:!0})}let w={kind:"el",tag:s,attrs:f,children:[]};if(o().children.push(w),Yi.has(s)){let y=e.slice(a),p=new RegExp(`</${s}\\s*>`,"i").exec(y),x=p?y.slice(0,p.index):y;x&&w.children.push({kind:"text",value:x}),i=p?a+p.index+p[0].length:e.length;continue}!h&&!Gi.has(s)&&n.push(w),i=a}return t.children}function oa(e,t){let n=[];for(let o of e.attrs){let r=o.name.toLowerCase();if(r.startsWith("data-mx-")||r==="contenteditable")continue;if(r.startsWith("on")||Xi.has(r)||Zi.has(r)){t.push({message:`Dropped attribute "${o.name}" on pasted <${e.tag}>`,attr:o.name,tag:e.tag});continue}if(typeof o.value=="string"&&(ea.has(r)?Fr(o.value,r):Qi.has(r)&&Dr(o.value))){t.push({message:`Dropped attribute "${o.name}" with a disallowed URL scheme on <${e.tag}>`,attr:o.name,tag:e.tag});continue}let i=r==="class"?"className":o.name;n.push({name:i,value:{static:!0,json:o.value},start:0,end:0})}return n}function Ur(e,t,n){let o=[];for(let r of e){if(r.kind==="text"){o.push({type:"text",value:r.value,start:0,end:0});continue}let i=r.attrs.find(c=>c.name.toLowerCase()===Ui);if(i&&typeof i.value=="string"){let c=Vt(t,i.value);if(c&&c.type==="element"&&c.isComponent){o.push(structuredClone(c));continue}}if(Ki.has(r.tag)){n.push({message:`Dropped pasted <${r.tag}> element`,tag:r.tag});continue}let l=Ur(r.children,t,n);if(!ta.has(r.tag)){n.push({message:`Unwrapped pasted <${r.tag}> element (not in the story tag allowlist)`,tag:r.tag}),o.push(...l);continue}o.push({type:"element",tag:r.tag,isComponent:!1,attributes:oa(r,n),children:l,selfClosing:l.length===0,start:0,end:0})}return o}function Wr(e,t){let n=ke(e);if(!n.ok)return{source:e,errors:[Nr(e,n)]};let o=[],r=t.map(l=>({edit:l,host:Vt(n.nodes,l.astPath)})),i=!1;for(let{edit:l,host:c}of r){if(!c||c.type!=="element"){o.push({message:`No element at AST path "${l.astPath}" \u2014 edit skipped`});continue}let s=Ur(ra(l.innerHtml),n.nodes,o),a=pt(s,{components:jr,allowedHtmlTags:In,stylePolicy:"no-inline-style"});if(a.length>0){o.push(...a);continue}c.children=s,s.length>0&&(c.selfClosing=!1),i=!0}return{source:i?_e(n.nodes):e,errors:o}}function Vr(e){let t=e[0];return t&&t.type==="element"&&t.tag==="Helmet"?1:0}function Gt(e,t){let n=ke(e);if(!n.ok)return t;let o=Vr(n.nodes);if(!o)return t;let[r,...i]=t.split("."),l=Number(r);return!Number.isInteger(l)||l<0?t:[String(l+o),...i].join(".")}function ia(e){return e.text.size>0||e.format.size>0||e.layout.size>0}function Yt(e,t){if(!ia(t))return e;let n=ke(e),o=n.ok?Vr(n.nodes):0,r=s=>{if(!o)return s;let[a,...f]=s.split("."),h=Number(a);return Number.isInteger(h)&&h>=0?[String(h+o),...f].join("."):s},i=s=>{if(!n.ok)return!1;let a=We(n.nodes,s);return!!a&&a.type==="element"&&!a.isComponent&&Pn(a)},l=Wr(e,[...t.text].map(([s,a])=>({astPath:r(s),innerHtml:a})).filter(s=>i(s.astPath))).source,c=Jr(l,[...t.format].map(([s,a])=>({astPath:r(s),...a})));return Br(c,[...t.layout].map(([s,a])=>({astPath:r(s),...a})))}function Yr(e,t){let n=ke(e);if(!n.ok)return e;let o=l=>{let c=Gt(e,l),s=c.split("."),a=Number(s.pop()),f=s.length?We(n.nodes,s.join(".")):null,h=s.length?f?.type==="element"?f.children:[]:n.nodes,w=h[a];return w?.type==="element"?{node:w,index:a,siblings:h,parent:f}:null};if(t.kind==="delete"){if(!t.paths.length)return e;let l=t.paths.map(o);if(l.some(f=>!f))return e;let c=new Set(l.map(f=>f.node)),s=f=>f.filter(h=>!c.has(h)).map(h=>{if(h.type!=="element")return h;let w=s(h.children);return["GridItem","Slide","div","section","article","td","th"].includes(h.tag)&&h.children.length>0&&!w.some(y=>y.type==="element"||y.type==="text"&&y.value.trim())&&w.push({type:"element",tag:"p",isComponent:!1,attributes:[{name:"id",value:{static:!0,json:`e${ze().replaceAll("-","")}`},start:0,end:0}],children:[],selfClosing:!1,start:0,end:0}),{...h,children:w}}),a=s(n.nodes);if(!a.some(f=>f.type==="element"&&f.tag!=="Helmet"||f.type==="text"&&f.value.trim())){let f=ke(`<p id="e${ze().replaceAll("-","")}"></p>`);f.ok&&a.push(...f.nodes)}return _e(a)}let r=o(t.path);if(!r)return e;let i=r.node;if(t.kind==="divider"){if(r.parent?.type!=="element"||r.parent.tag!=="Grid"||vt(r.parent,"mode")!=="flow"||i.tag!=="GridItem"||!Number.isFinite(t.width))return e;let l=r.siblings.slice(r.index+1).find(w=>w.type==="element");if(l?.type!=="element"||l.tag!=="GridItem")return e;let c=An(vt(r.parent,"cols")),s=w=>Math.min(c,Math.max(1,Number(vt(w,"w"))||c)),a=0;for(let w of r.siblings.slice(0,r.index)){if(w.type!=="element"||w.tag!=="GridItem")continue;let y=s(w);a=a+y>c?y:a+y,a===c&&(a=0)}if(a+s(i)+s(l)>c)return e;let f=s(i)+s(l),h=Math.max(1,Math.min(f-1,Math.round(t.width)));Te(i,"w",h),Te(l,"w",f-h)}else if(t.kind==="move"){let l=o(t.target);if(!l||r.siblings!==l.siblings||r.node===l.node)return e;r.siblings.splice(r.index,1),r.siblings.splice(l.index,0,i)}else if(t.kind==="resize"){if(!Number.isFinite(t.width)||!Number.isFinite(t.height))return e;if(t.grid){if(i.tag!=="GridItem")return e;if(t.axis!=="height"&&Te(i,"w",Math.max(1,Math.min(An(r.parent?.type==="element"?vt(r.parent,"cols"):void 0),Math.round(t.width)))),t.axis==="width")return _e(n.nodes);r.parent?.type==="element"&&vt(r.parent,"mode")==="flow"?Te(i,"minHeight",Math.max(0,Math.min(1e4,Math.round(t.height)))):Te(i,"h",Math.max(1,Math.min(1e3,Math.round(t.height))))}else{let l=Math.max(40,Math.min(4e3,Math.round(t.width))),c=Math.max(0,Math.min(1e4,Math.round(t.height))),s=Gr(i).filter(a=>!(t.axis!=="height"&&/^w-|^max-w-/.test(a))&&!(t.axis!=="width"&&/^h-|^min-h-|^max-h-|^overflow-(?:hidden|clip)$/.test(a)));t.axis!=="height"&&s.push(`w-[${l}px]`,"max-w-full"),t.axis!=="width"&&s.push(`min-h-[${c}px]`),Te(i,"className",s.join(" "))}}else i.tag==="GridItem"?Te(i,"minHeight",void 0):Te(i,"className",Gr(i).filter(l=>!/^min-h-\[/.test(l)).join(" "));return _e(n.nodes)}function Gr(e){let t=e.attributes.find(n=>["className","class"].includes(n.name))?.value;return t?.static&&typeof t.json=="string"?t.json.split(/\s+/).filter(Boolean):[]}function vt(e,t){let n=e.attributes.find(o=>o.name===t)?.value;return n?.static?n.json:void 0}function Kr(e,t,n,o){let r=n&&/\bid=["{]/.test(n)?e.indexOf(n):-1;if(r>=0&&e.indexOf(n,r+1)<0){let y=ke(o);return!y.ok||!y.nodes.every(qt)||pt(y.nodes,{components:[]}).length?e:e.slice(0,r)+_e(y.nodes)+e.slice(r+n.length)}let i=ke(e),l=ke(n),c=ke(o);if(!i.ok||!l.ok||!c.ok||!l.nodes.length||!c.nodes.every(qt)||pt(c.nodes,{components:[]}).length)return e;let s=Gt(e,t).split("."),a=Number(s.pop()),f=s.length?We(i.nodes,s.join(".")):null,w=(s.length?f?.type==="element"?f.children:[]:i.nodes).slice(a,a+l.nodes.length);return!w.length||_e(w)!==_e(l.nodes)||!w.every(qt)?e:e.slice(0,w[0].start)+_e(c.nodes)+e.slice(w.at(-1).end)}var aa=new Set(["before","after","inside"]);function sa(e){let t=e;return t&&typeof t.path=="string"&&typeof t.side=="string"&&aa.has(t.side)?{path:t.path,side:t.side}:null}function Xr(e){let[t,n]=N(null),[o,r]=N(!1),i=!1,l=!1,c=null,s=null,a=x=>{Bt({runtimeRef:e.runtimeRef},x)};Q(Ie([()=>e.runtimeRef,()=>e.sourceRef,()=>e.sessionNonce],([x,g])=>{K(Ut({runtimeRef:x},b=>{let L=e.sessionNonce;if(!(!L||!Ht(b.data,L)))switch(b.data.type){case"mx:history":e.onHistory?.(b.data.direction);break;case"mx:edit-flush":e.onFlush?.();break;case"mx:comment-key":e.onCommentKey?.();break;case"mx:open-script":typeof b.data.component=="string"&&e.onOpenScript?.(b.data.component);break;case"mx:block-edit":{let S=Yr(g.current,b.data.command);S!==g.current&&e.onSourceEdited(S,!0);break}case"mx:edit-error":e.onError?.(b.data.message);break;case"mx:edit-ready":r(!0);break;case"mx:typing":i=b.data.active;break;case"mx:selection":n(b.data.selection);break;case"mx:flow-edit":{let{path:S,expected:E,replacement:O}=b.data,U=Kr(g.current,S,E,O);U!==g.current?e.onSourceEdited(U,!0,b.data.group,b.data.selection):E!==O&&(l=!0,e.onRejectedEdit?.(O));break}case"mx:text-edit":{let S=Yt(g.current,{text:new Map([[b.data.path,b.data.innerHtml]]),format:new Map,layout:new Map});S!==g.current&&e.onSourceEdited(S);break}case"mx:committed":c?.();break;case"mx:layout-edit":{let S=Yt(g.current,{text:new Map,format:new Map,layout:new Map(b.data.rects.map(E=>[E.path,{x:E.x,y:E.y,w:E.w,h:E.h}]))});S!==g.current&&e.onSourceEdited(S,!0);break}case"mx:slide-title":e.onSlideTitle?.(b.data.path,b.data.title);break;case"mx:edit-key":e.onEditKey?.(b.data.key,t());break;case"mx:image-drop":{let S=b.data.file,E=typeof b.data.target=="string"?b.data.target:null,O=E?{replace:E}:"at"in b.data?{at:sa(b.data.at)}:null;p().then(()=>O?e.onImageDrop?.(S,O):e.onImageDrop?.(S));break}case"mx:image-replace":typeof b.data.path=="string"&&e.onImageReplaceRequest?.(b.data.path);break;default:break}}))}));let f=!1;Q(Ie(()=>e.editing,x=>{x!==f&&(f=x,a({type:Ft,on:x}),x||(r(!1),n(null),i=!1))}));let h=(x,g)=>{let C=t(),b=C?.path===x&&C.editor==="prose";if(a({type:Rr,path:x,...g}),b)return;let L=Yt(e.sourceRef.current,{text:new Map,format:new Map([[x,g]]),layout:new Map});L!==e.sourceRef.current&&e.onSourceEdited(L)},w=(x,g)=>{a({type:Tr,path:x,href:g})},y=(x,g)=>{x===null&&n(null),a({type:qe,path:x,...g?.reveal?{reveal:!0}:{},...g?.nodeId?{nodeId:g.nodeId}:{}})},p=async(x=!1)=>{if(l)throw new Error("Recover the uncommitted text before leaving the editor.");if(!qr({runtimeRef:e.runtimeRef})){if(x)throw new Error("editor is unavailable");return}s||(s=new Promise(C=>{let b=window.setTimeout(()=>L(!1),1200);function L(S=!0){window.clearTimeout(b),c=null,s=null,C(S)}c=L,a({type:Tn})}));let g=await s;if(x&&!g)throw new Error("editor commit timed out")};return{selection:t,ready:o,discardRejectedEdit:()=>{l=!1},isUserEditing:()=>i||l,applyFormat:h,applyLink:w,applyInline:x=>a({type:"mx:inline",tag:x}),pasteMarkdown:x=>a({type:"mx:paste",kind:"markdown",value:x}),select:y,spotlight:x=>a({type:Ar,paths:x}),commitPending:p,restoreSelection:x=>a({type:Tn,restore:x})}}var la;function ca(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),la=window.history.state._depth}Pe||ca();function da(e,t){if(e==null)throw new Error(t);return e}var ua=Le(),nu=Le(),Qr=()=>da(Fe(ua),"<A> and 'use' router primitives can be only used inside a Route.");var ma=()=>Qr().navigatorFactory(),eo=()=>Qr().location;var fa;function ha(){return fa}var ga=!1;function pa(){return ga}var ba="Location",va=5e3,ya=18e4,Mn=new Map;Pe||setInterval(()=>{let e=Date.now();for(let[t,n]of Mn.entries())!n[4].count&&e-n[0]>ya&&Mn.delete(t)},3e5);function yt(){if(!Pe)return Mn;let e=tt();if(!e)throw new Error("Cannot find cache context");return(e.router||(e.router={})).cache||(e.router.cache=new Map)}function Kt(e,t){e.GET&&(e=e.GET);let n=(...o)=>{let r=yt(),i=ha(),l=pa(),s=kr()?ma():void 0,a=Date.now(),f=t+Zr(o),h=r.get(f),w;if(Pe){let x=tt();if(x){let g=(x.router||(x.router={})).dataOnly;if(g){let C=x&&(x.router.data||(x.router.data={}));if(C&&f in C)return C[f];if(Array.isArray(g)&&!xa(f,g))return C[f]=void 0,Promise.resolve()}}}if(wr()&&!Pe&&(w=!0,K(()=>h[4].count--)),h&&h[0]&&(Pe||i==="native"||h[4].count||Date.now()-h[0]<va)){w&&(h[4].count++,h[4][0]()),h[3]==="preload"&&i!=="preload"&&(h[0]=a);let x=h[1];return i!=="preload"&&(x="then"in h[1]?h[1].then(p(!1),p(!0)):p(!1)(h[1]),!Pe&&i==="navigate"&&Dt(()=>h[4][1](h[0]))),l&&"then"in x&&x.catch(()=>{}),x}let y;if(!Pe&&Ue.has&&Ue.has(f)?(y=Ue.load(f),delete globalThis._$HY.r[f]):y=e(...o),h?(h[0]=a,h[1]=y,h[3]=i,!Pe&&i==="navigate"&&Dt(()=>h[4][1](h[0]))):(r.set(f,h=[a,y,,i,N(a)]),h[4].count=0),w&&(h[4].count++,h[4][0]()),Pe){let x=tt();if(x&&x.router.dataOnly)return x.router.data[f]=y}if(i!=="preload"&&(y="then"in y?y.then(p(!1),p(!0)):p(!1)(y)),l&&"then"in y&&y.catch(()=>{}),Pe&&Ue.context&&Ue.context.async&&!Ue.context.noHydrate){let x=tt();(!x||!x.serverOnly)&&Ue.context.serialize(f,y)}return y;function p(x){return async g=>{if(g instanceof Response){let C=tt();if(C)for(let[L,S]of g.headers)L=="set-cookie"?C.response.headers.append("set-cookie",S):C.response.headers.set(L,S);let b=g.headers.get(ba);if(b!==null){s&&b.startsWith("/")?Dt(()=>{s(b,{replace:!0})}):Pe?C&&(C.response.status=302):window.location.href=b;return}g.customBody&&(g=await g.customBody())}if(x)throw g;return h[2]=g,g}}};return n.keyFor=(...o)=>t+Zr(o),n.key=t,n}Kt.get=e=>yt().get(e)[2];Kt.set=(e,t)=>{let n=yt(),o=Date.now(),r=n.get(e);r?(r[0]=o,r[1]=Promise.resolve(t),r[2]=t,r[3]="preload"):(n.set(e,r=[o,Promise.resolve(t),t,"preload",N(o)]),r[4].count=0)};Kt.delete=e=>yt().delete(e);Kt.clear=()=>yt().clear();function xa(e,t){for(let n of t)if(n&&e.startsWith(n))return!0;return!1}function Zr(e){return JSON.stringify(e,(t,n)=>wa(n)?Object.keys(n).sort().reduce((o,r)=>(o[r]=n[r],o),{}):n)}function wa(e){let t;return e!=null&&typeof e=="object"&&(!(t=Object.getPrototypeOf(e))||t===Object.prototype)}var ka=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],to=e=>d(re,G(e,{iconNode:ka,name:"camera"}));var $a=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],On=e=>d(re,G(e,{iconNode:$a,name:"loader-circle"}));var Ea=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],no=e=>d(re,G(e,{iconNode:Ea,name:"message-square"}));var _a=[["path",{d:"M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z",key:"xwnzip"}],["path",{d:"M5 3a2 2 0 0 0-2 2",key:"y57alp"}],["path",{d:"M19 3a2 2 0 0 1 2 2",key:"18rm91"}],["path",{d:"M5 21a2 2 0 0 1-2-2",key:"sbafld"}],["path",{d:"M9 3h1",key:"1yesri"}],["path",{d:"M9 21h2",key:"1qve2z"}],["path",{d:"M14 3h1",key:"1ec4yj"}],["path",{d:"M3 9v1",key:"1r0deq"}],["path",{d:"M21 9v2",key:"p14lih"}],["path",{d:"M3 14v1",key:"vnatye"}]],Ln=e=>d(re,G(e,{iconNode:_a,name:"square-dashed-mouse-pointer"}));var Ca=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ve=e=>d(re,G(e,{iconNode:Ca,name:"x"}));async function ro(e,t={}){let n=new Map,o=new Set,r;for(;;){let i=r?`${e}${e.includes("?")?"&":"?"}cursor=${encodeURIComponent(r)}`:e,l=await fetch(i,{credentials:"same-origin",...t});if(!l.ok)throw new Error(`Annotation read failed (HTTP ${l.status})`);let c=await l.json();if(!Array.isArray(c.annotations))throw new Error("Invalid annotation page");for(let s of c.annotations)n.set(s.id,s);if(c.next_cursor==null)return[...n.values()];if(typeof c.next_cursor!="string"||!c.next_cursor||o.has(c.next_cursor))throw new Error("Invalid annotation cursor");o.add(c.next_cursor),r=c.next_cursor}}function oo(e,t=fetch){let n=new AbortController,o=`/a/${encodeURIComponent(e)}`,r=async(c,s={},a=!1)=>{n.signal.throwIfAborted();let f=await t(c,{...s,credentials:"same-origin",signal:s.signal?AbortSignal.any([n.signal,s.signal]):n.signal});n.signal.throwIfAborted();let h=a?await f.json().catch(()=>({error:"fetch_failed"})):await f.json();if(n.signal.throwIfAborted(),!f.ok&&!a)throw new Error(h.detail??h.error??`request failed (${f.status})`);return h},i=(c,s)=>r(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),l=c=>i(`${o}/query`,c);return{dispose:()=>n.abort(),run:(c,s,a)=>l({values:c,only:s,tz:zt(),...a?{localTables:a}:{}}),hold:async c=>(await i(`${o}/query`,{hold:c})).tables,people:async c=>(await i(`${o}/query`,{people:c})).people,page:async(c,s,a,f)=>{let h=await l({values:c,only:[s],page:{name:s,...a},tz:zt(),...f?{localTables:f}:{}});if(!h.tables[s])throw new Error(h.errors[s]??`no rows for ${s}`);return h.tables[s]},mutate:async c=>{let s=await i(`${o}/mutate`,{tz:zt(),...c});if(!s.ok)throw new Error(s.detail??s.error??"write failed");return{dataset:s.dataset??"",local:s.local,mutationRunId:s.mutationRunId}},importAsset:async(c,s,a)=>{let f=new URLSearchParams({u:c,...s?{kind:s}:{}}),h=await r(`${o}/assets?${f}`,{headers:{Accept:"application/json"},signal:a},!0);return h.url?{url:h.url,image:h.image}:{refused:h.code??h.error??"fetch_failed"}}}}var Nn="sign_in_required";var Sa="keepalive";function Ra(e,t=Math.random){let n=Math.min(3e4,1e3*2**Math.max(0,e));return Math.round(n/2+t()*(n/2))}function Dn(e){let t=e.host??(typeof window>"u"?void 0:window),n=globalThis.EventSource,o=null,r=0,i=!1,l=Date.now(),c,s,a=()=>{clearTimeout(s),s=setTimeout(w,45e3)},f=()=>{l=Date.now(),r=0,a()};function h(){if(i||!n)return;clearTimeout(c),c=void 0,o?.close();let x=new n(e.url);o=x;let g=()=>o===x&&!i;x.onopen=()=>{g()&&a()},x.onmessage=C=>{g()&&(f(),e.onMessage?.(String(C.data)))};for(let[C,b]of Object.entries(e.events??{}))x.addEventListener(C,L=>{g()&&(f(),b(String(L.data)))});x.addEventListener(Sa,()=>{g()&&f()}),x.onerror=()=>{g()&&w()},a()}function w(){i||(clearTimeout(s),o?.close(),o=null,clearTimeout(c),c=setTimeout(h,Ra(r++,e.random)),e.onError?.())}let y=()=>{if(!i){if(!o||Date.now()-l>2e4){r=0,h();return}e.onWake?.()}},p=()=>{t?.document?.visibilityState!=="hidden"&&y()};return t?.addEventListener("online",y),t?.document?.addEventListener("visibilitychange",p),h(),{close(){i||(i=!0,clearTimeout(c),clearTimeout(s),o?.close(),o=null,t?.removeEventListener("online",y),t?.document?.removeEventListener("visibilitychange",p))}}}var Ce=class extends Error{status;signInRequired;constructor(t,n,o=!1){super(t),this.name="BackendRequestError",this.status=n,this.signInRequired=o}};var Ne={"Content-Type":"application/json"};function Ta(e){let t=`/api/my/artifacts/${encodeURIComponent(e)}`;return{head:()=>fetch(t),version:n=>fetch(`${t}/versions/${n}`),edits:n=>fetch(`${t}/edits`,{method:"POST",headers:Ne,body:JSON.stringify(n)}),patch:n=>fetch(t,{method:"PATCH",headers:Ne,body:JSON.stringify(n)}),revert:n=>fetch(`${t}/revert`,{method:"POST",headers:Ne,body:JSON.stringify(n)})}}function Aa(e,t){let n=`Could not save comment (${e})`;if(!t||typeof t!="object")return n;let{error:o,detail:r,details:i}=t,l=typeof o=="string"?o:n,c=typeof r=="string"?r:Array.isArray(i)&&typeof i[0]?.message=="string"?i[0].message:null;return c?`${l}: ${c}`:l}var io=async e=>({ok:e.ok,status:e.status,body:await e.json().catch(()=>({}))});function ao(e){let t=`/api/my/artifacts/${e}`,n=async(o,r,i)=>{let l=await fetch("/api/my/artifacts?visibility=unlisted",{method:"POST",...o}).catch(()=>null);return l?l.ok?{ok:!0,image:await l.json()}:{ok:!1,error:await r(l)}:{ok:!1,error:i}};return{mode:"online",unavailable:()=>null,async load(){let o=await fetch(t);return o.ok?await o.json():null},async commitEdit(o){return io(await fetch(`${t}/edits`,{method:"POST",headers:Ne,body:JSON.stringify(o)}))},async prepare(o){let r=await fetch(`/api/my/artifacts/${encodeURIComponent(e)}/prepare`,{method:"POST",headers:Ne,body:JSON.stringify({source:o})});if(r.ok)return r.json();let i=await r.json().catch(()=>({})),l=i.details?.map(c=>typeof c=="string"?c:c?.message).filter(Boolean).join(`
|
|
2
|
-
`);throw new Error(l||i.error||"Unable to prepare document resources")},async previewCss(o){let r=await fetch("/api/preview",{method:"POST",headers:Ne,body:JSON.stringify({markup:o})});if(!r.ok)throw new Ce("preview refused",r.status);let i=await r.json();if(typeof i.css!="string")throw new Ce("no stylesheet",r.status);return{css:i.css}},async previewQueries(o){let r=await fetch("/api/query",{method:"POST",headers:Ne,body:JSON.stringify({markup:o})});return r.ok?await r.json():null},async queryTable(o,r){let i=await fetch(`/a/${encodeURIComponent(o)}/tables`,{method:"POST",credentials:"same-origin",headers:Ne,body:JSON.stringify(r)}),l=await i.json();if(!i.ok)throw new Ce(l.details?.[0]??l.error??"unavailable",i.status);return l},importImage(o){return"imageUrl"in o?n({headers:Ne,body:JSON.stringify({imageUrl:o.imageUrl})},async r=>(await r.json().catch(()=>null))?.details?.[0]??(r.status===403?"You have reached your artifact limit.":"Could not import that image."),"Import failed \u2014 check your connection and try again."):n({headers:{"Content-Type":o.file.type},body:o.file},async r=>{let i=await r.json().then(l=>l?.error).catch(()=>null);return r.status===413?"That image is too large to upload.":r.status===403?"You have reached your artifact limit.":i==="invalid_image"?"That image type is not supported (png, jpeg, webp, gif, svg).":"Could not upload that image."},"Upload failed \u2014 check your connection and try again.")},async versions(){let o=await fetch(`${t}/versions`);return o.ok?(await o.json()).versions:null},async version(o){let r=await fetch(`${t}/versions/${o}`);return r.ok?await r.json():null},async revert(o){return io(await Ta(e).revert(o))},live(o,r){let i=Dn({url:`/a/${e}/events${r?.since?`?since=${encodeURIComponent(r.since)}`:""}`,onMessage:l=>{let c;try{c=JSON.parse(l)}catch{return}o.onPing(c)},events:{[Sr]:l=>{try{o.onData(JSON.parse(l))}catch{}},[Or]:()=>o.onAnnotations()},onWake:o.onWake});return()=>i.close()},async liveFrame(){let o=await fetch(`/a/${e}/events/frame`,{credentials:"same-origin"});return o.ok?await o.json():null},queryTransport:()=>oo(e),listAnnotations(o,r={}){return ro(`${t}/annotations${o?`?status=${o}`:""}`,r)},async createAnnotation(o,r){let i=await fetch(`${t}/annotations`,{method:"POST",headers:{...Ne,"Idempotency-Key":r},body:JSON.stringify(o)});if(i.ok)return await i.json();let l=await i.json().catch(()=>null),c=l&&typeof l=="object"?l:{};throw new Ce(Aa(i.status,l),i.status,c.error===Nn||c.code===Nn)},async actOnAnnotation(o,r){let i=await fetch(`${t}/annotations/${o}`,{method:"POST",headers:Ne,body:JSON.stringify(r)});if(!i.ok)throw new Ce(`Could not update this comment (${i.status})`,i.status);return await i.json()},async deleteAnnotation(o){if(!(await fetch(`${t}/annotations/${o}`,{method:"DELETE"})).ok)throw new Error("Could not delete this comment. Try again.")},async uploadCommentImage(o){let r=await fetch(`${t}/comment-images`,{method:"POST",body:o});if(!r.ok){let i=await r.json();throw new Error(i.error==="stale"?"The document changed. Your draft is preserved; retake the screenshot.":i.error==="quota_exceeded"?"Image storage quota reached.":"Could not upload the screenshot. Please retry.")}return await r.json()},async members(o,r={}){let i=await fetch(`/api/my/artifacts/${encodeURIComponent(e)}/members${o===void 0?"":`?query=${encodeURIComponent(o)}`}`,{signal:r.signal});return i.ok?await i.json():null},async remoteSessions(o={}){let r=await fetch("/api/remote/sessions",{credentials:"same-origin",signal:o.signal});return r.ok?await r.json():{sessions:[]}},async deleteRemoteSession(o){let r=await fetch(`/api/remote/sessions/${o}`,{method:"DELETE",credentials:"same-origin"});if(!r.ok){let i=await r.json().catch(()=>null);throw new Error(i?.error??"Could not remove agent. Try again.")}}}}var lo="mx_comments_folded",Ia={threads:[],comments:[]};function co(){try{let e=globalThis.localStorage;return e&&typeof e.getItem=="function"?e:null}catch{return null}}var so=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):null;function Pa(e,t){if(!e||typeof e!="object"||Array.isArray(e))return null;let n=e[t];if(!n||typeof n!="object"||Array.isArray(n))return null;let{threads:o,comments:r}=n,i=so(o),l=so(r);return!i||!l?null:{threads:i,comments:l}}function uo(){let e=co();if(!e)return{};try{let t=e.getItem(lo);if(!t)return{};let n=JSON.parse(t);return n&&typeof n=="object"&&!Array.isArray(n)?n:{}}catch{return{}}}function mo(e,t){let n=co();if(!n)return t;try{n.setItem(lo,JSON.stringify({...uo(),[e]:t}))}catch{}return t}function xt(e){return Pa(uo(),e)??{...Ia}}function fo(e,t,n){let o=xt(e),r={...o,[t]:o[t].includes(n)?o[t].filter(i=>i!==n):[...o[t],n]};return mo(e,r)}function Fn(e,t){let n=xt(e),o={threads:n.threads.filter(i=>!t.threads?.includes(i)),comments:n.comments.filter(i=>!t.comments?.includes(i))};return o.threads.length===n.threads.length&&o.comments.length===n.comments.length?n:mo(e,o)}function wt(e,t,n){return e[t].includes(n)}function ho(e,t){let n=Number.isFinite(e)&&e>0&&Number.isFinite(t)&&t>0,o=n?10*t:0;return{overflowing:n&&e-o>=1,lines:n?Math.round(e/t):0,maxHeight:o}}var go="intent";function po(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function Ma(e){return(e.startsWith("?")?e.slice(1):e).split("&").filter(Boolean).map(n=>{let o=n.indexOf("="),[r,i]=o===-1?[n,""]:[n.slice(0,o),n.slice(o+1)];return{raw:n,key:po(r),value:po(i)}})}var Oa=e=>e.length?`?${e.join("&")}`:"";function bo(e,t){return Oa([...Ma(e).filter(n=>n.key!==go).map(n=>n.raw),`${go}=${t}`])}function vo(e,t){if(!t&&(e.pathname==="/"||e.pathname==="/login"))return"/login";let n=t?bo(e.search,t):e.search;return`/login?callbackUrl=${encodeURIComponent(e.pathname+n+e.hash)}`}var yo="(?:[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[a-f0-9]{64})",La=new RegExp(`^/chat\\?session=${yo}$`);function Xt(e){return La.test(e)}function kt(e){return e.matchAll(new RegExp(`\\[(@[^\\]\\n]+)\\]\\(/chat\\?session=(${yo})\\)`,"g"))}function xo(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.author.kind!=="human")continue;let o=new Map;for(let r of kt(n.body))o.set(r[2],r[0]);if(o.size)return[...o.values()].join(" ")+" "}return""}function Ge(e){let t=e;for(let n of kt(e))t=t.replace(n[0],"");return!!t.trim()}function Zt(e){if(e.reason==="queue_full")return"Queue full \xB7 mention again after pending work finishes";if(e.reason==="unauthorized")return"Unavailable \xB7 mention one of your agents";let t={superseded:"Follow-up received",dispatching:"Sending to agent",queued:"Queued",delivered:"Sent \xB7 awaiting acknowledgment\u2026",acknowledged:"Working",completed:"Answered",blocked:"Needs your input",uncertain:"Delivery uncertain \xB7 check terminal",unavailable:"Agent unavailable"}[e.phase];return e.connection==="offline"?t+" \xB7 offline":e.connection==="stopped"?t+" \xB7 stopped":e.phase==="queued"&&e.activity==="unknown"?t+" \xB7 readiness unknown, check terminal":e.phase==="queued"&&e.activity==="starting"?t+" \xB7 loading context":e.phase==="completed"&&e.activity==="listening"?t+" \xB7 listening":t}function Qt(e){return`[@${e.name.replace(/[\[\]\\\n]/g,"")}](/chat?session=${e.id}) `}var Na='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',Ye=[],wo=0,ko="",Da=e=>{let t=e.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t};function $o(e){let t=Ye[Ye.length-1];if(!t)return;if(e.key==="Escape"){if(e.defaultPrevented)return;e.preventDefault(),t.onClose();return}if(e.key!=="Tab")return;let n=t.panel();if(!n)return;let o=[...n.querySelectorAll(t.focusable??Na)];if(!o.length){e.preventDefault();return}let r=o[0],i=o[o.length-1],l=n.getRootNode().activeElement;(!l||!n.contains(l)||(e.shiftKey?l===r:l===i))&&(e.preventDefault(),(e.shiftKey?i:r).focus())}function en(e){ye(()=>{let t=Da(document);Ye.push(e),Ye.length===1&&window.addEventListener("keydown",$o),e.lockScroll&&wo++===0&&(ko=document.body.style.overflow,document.body.style.overflow="hidden"),e.initialFocus?.()?.focus(),K(()=>{let n=Ye.indexOf(e);n>=0&&Ye.splice(n,1),Ye.length===0&&window.removeEventListener("keydown",$o),e.lockScroll&&--wo===0&&(document.body.style.overflow=ko),t?.isConnected&&typeof t.focus=="function"&&t.focus()})})}var Fa=v('<p role=alert class="mt-3 text-sm text-danger">'),ja=v('<div class="fixed inset-0 z-[150] flex items-center justify-center bg-black/45 p-4 backdrop-blur-[2px]"><div role=dialog aria-modal=true class="relative max-h-[calc(100dvh-2rem)] w-full max-w-md overflow-y-auto rounded-xl border border-edge-bright bg-surface p-6 text-fg shadow-2xl"><h2 class="text-base font-semibold"></h2><div class="mt-3 break-words text-sm leading-relaxed text-muted"></div><div class="mt-6 flex justify-end gap-3"><button type=button class="rounded-md border border-edge px-4 py-2 text-sm text-muted">Cancel</button><button type=button>');function Eo(e){let t,n,o=ht(),r=ht();return en({panel:()=>t,onClose:()=>{e.busy||e.onCancel()},initialFocus:()=>n,focusable:"button:not([disabled]), a[href], input:not([disabled])"}),d(nt,{get mount(){return Jt(document)??document.body},get children(){var i=ja(),l=i.firstChild,c=l.firstChild,s=c.nextSibling,a=s.nextSibling,f=a.firstChild,h=f.nextSibling;i.$$mousedown=p=>{p.target===p.currentTarget&&!e.busy&&e.onCancel()};var w=t;typeof w=="function"?xe(w,l):t=l,M(l,"aria-labelledby",o),M(l,"aria-describedby",r),M(c,"id",o),m(c,()=>e.title),M(s,"id",r),m(s,()=>e.description),m(l,d(T,{get when(){return e.error},get children(){var p=Fa();return m(p,()=>e.error),p}}),a),Cn(f,"click",e.onCancel,!0);var y=n;return typeof y=="function"?xe(y,f):n=f,Cn(h,"click",e.onConfirm,!0),m(h,()=>e.action,null),m(h,()=>e.busy?"\u2026":"",null),H(p=>{var x=e.busy,g=e.cancelLabel,C=e.busy,b=e.confirmLabel,L=e.busy,S=`rounded-md border px-4 py-2 text-sm font-medium ${e.danger?"border-danger/40 bg-danger-soft text-danger":"border-accent/40 bg-accent-soft text-accent"}`;return x!==p.e&&M(l,"aria-busy",p.e=x),g!==p.t&&M(f,"aria-label",p.t=g),C!==p.a&&(f.disabled=p.a=C),b!==p.o&&M(h,"aria-label",p.o=b),L!==p.i&&(h.disabled=p.i=L),S!==p.n&&de(h,p.n=S),p},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),i}})}pe(["mousedown","click"]);var Ha=v("<span tabindex=0 data-feature-unavailable><span hidden>");function jn(e){let t=ht();return d(T,{get when(){return e.reason},get fallback(){return e.children({})},children:n=>d($e,{get content(){return n()},get children(){var o=Ha(),r=o.firstChild;return m(o,()=>e.children({disabled:!0,"aria-describedby":t}),r),M(r,"id",t),m(r,n),H(()=>de(o,`${e.class??"inline-flex"} [&>:disabled]:pointer-events-none`)),o}})})}var qa=v('<button type=button aria-label="Close sheet"class="fixed inset-0 z-[2147483006] cursor-default border-0 bg-black/40 p-0">'),za=v("<div class=shrink-0>"),Ja=v('<div role=dialog aria-modal=true><div><div aria-hidden=true class="mx-auto mb-2 h-1 w-9 shrink-0 rounded-full bg-edge"></div></div><div class="min-h-0 flex-1 overflow-y-auto">'),_o=()=>typeof window<"u"&&window.innerWidth<640;function So(){let[e,t]=N(_o());return ye(()=>{let n=()=>t(_o());n(),window.addEventListener("resize",n),K(()=>window.removeEventListener("resize",n))}),e}var Hn=0,Ba=new Set,Co=()=>{for(let e of Ba)e(Hn>0)};var Ua=64;function qn(e){ye(()=>{Hn+=1,Co(),K(()=>{Hn-=1,Co()})});let t;en({panel:()=>t,onClose:()=>e.onClose()});let n=null,[o,r]=N(0),i=a=>{e.swipeToClose&&(n=a.touches[0]?.clientY??null)},l=a=>{!e.swipeToClose||n===null||r(Math.max(0,(a.touches[0]?.clientY??n)-n))},c=()=>{if(!e.swipeToClose)return;let a=o()>=Ua;n=null,r(0),a&&e.onClose()},s=()=>(e.size??"tall")==="half";return d(nt,{get mount(){return Jt(document)??document.body},get children(){return[d(T,{get when(){return!s()},get children(){var a=qa();return a.$$click=()=>e.onClose(),a}}),(()=>{var a=Ja(),f=a.firstChild,h=f.firstChild,w=f.nextSibling,y=t;return typeof y=="function"?xe(y,a):t=a,f.$$touchend=c,f.$$touchmove=l,f.$$touchstart=i,m(f,d(T,{get when(){return e.header},get children(){var p=za();return m(p,()=>e.header),p}}),null),m(w,()=>e.children),H(p=>{var x=e.label,g=o()?{transform:`translateY(${o()}px)`}:void 0,C=`fixed inset-x-0 bottom-0 z-[2147483007] ${s()?"max-h-[50vh]":"max-h-[80vh]"} flex animate-[sheet-in_.2s_ease-out] flex-col rounded-t-[10px] border-t border-edge bg-surface p-3 pb-[max(0.75rem,env(safe-area-inset-bottom))] font-mono text-xs shadow-lg`,b=e.swipeToClose?"shrink-0 touch-none":"contents";return x!==p.e&&M(a,"aria-label",p.e=x),p.t=et(a,g,p.t),C!==p.a&&de(a,p.a=C),b!==p.o&&de(f,p.o=b),p},{e:void 0,t:void 0,a:void 0,o:void 0}),a})()]}})}pe(["click","touchstart","touchmove","touchend"]);var zn="[data-trusted-ui-root]",_m=`
|
|
1
|
+
import{a as Hr}from"./chunk-RDT3C3F6.js";import{a as re,b as Bt,c as $e,d as yt}from"./chunk-2CWE6B2E.js";import{a as Jt}from"./chunk-4O7LVK2Q.js";import"./chunk-7T3V6PAW.js";import"./chunk-BYXBJQAS.js";import{A as v,B as pe,C as I,D as de,E as Sn,F as rt,G as ae,H as ze,I as ye,J as m,K as ot,L as Oe,M as it,a as Ve,b as N,c as q,d as Q,e as be,f as Re,g as xe,h as Me,i as ve,j as K,k as wr,l as kr,m as Ft,n as Ne,o as je,q as d,r as G,t as $r,u as pt,v as ge,w as T,x as Er,y as Y,z as _r}from"./chunk-5JF7QI4S.js";import{a as jr}from"./chunk-7AB63FHW.js";import{a as Be,b as An,q as zt}from"./chunk-RCXK2DBZ.js";import{a as Nr,b as ke,d as Dr,e as Fr,f as vt,g as _e}from"./chunk-QVSMXME5.js";import"./chunk-JABILGJZ.js";import{A as at,B as Ir,C as Pr,D as Mr,E as Or,F as qt,G as Lr,a as Sr,b as bt,c as Cr,d as jt,m as Cn,n as Ht,o as Rn,s as Rr,t as Tr,w as Tn,y as Je,z as Ar}from"./chunk-JTUTVTQG.js";import{a as Pn,b as Ge}from"./chunk-SM7P2RYM.js";import{a as Le}from"./chunk-7PMY7F6T.js";import{c as In}from"./chunk-RXGLTQLL.js";import"./chunk-OOJM4CTU.js";function Ut(e,t){e.runtimeRef.current?.send(t)}function Wt(e,t){return e.runtimeRef.current?.subscribe(n=>t({data:n}))??(()=>{})}function Vt(e){return e.runtimeRef.current?.getViewportRect()}function qr(e){return!!e.runtimeRef.current}var Gt=Ge,Ui="data-mx-ast";function Jr(e,t){let n=ke(e);if(!n.ok)return e;let o=!1;for(let r of t){let i=Gt(n.nodes,r.astPath);if(!(!i||i.type!=="element"||i.isComponent)&&(r.className!==void 0&&(Wi(i,r.className.trim()),o=!0),r.style!==void 0)){let l=r.style.trim();Te(i,"style",l===""?void 0:l),o=!0}}return o?_e(n.nodes):e}function Br(e,t){if(t.length===0)return e;let n=ke(e);if(!n.ok)return e;let o=!1;for(let r of t){let i=Gt(n.nodes,r.astPath);!i||i.type!=="element"||!i.isComponent||i.tag!=="GridItem"||(Te(i,"x",r.x),Te(i,"y",r.y),Te(i,"w",r.w),Te(i,"h",r.h),o=!0)}return o?_e(n.nodes):e}function Wi(e,t){let n=i=>i.name==="className"||i.name==="class",o=e.attributes.findIndex(n);for(let i=e.attributes.length-1;i>=0;i--)n(e.attributes[i])&&e.attributes.splice(i,1);if(t==="")return;let r={name:"className",value:{static:!0,json:t},start:0,end:0};e.attributes.splice(o===-1?e.attributes.length:o,0,r)}function Te(e,t,n){let o=e.attributes.findIndex(i=>i.name===t);if(n===void 0){o!==-1&&e.attributes.splice(o,1);return}let r={name:t,value:{static:!0,json:n},start:0,end:0};o!==-1?e.attributes[o]=r:e.attributes.push(r)}var pd=Le(["span","strong","b","em","i","a","code","br","small","sup","sub","s","del","u","mark","kbd","abbr","time"]),bd=Le(["thead","tbody","tfoot","tr","td","th","caption","colgroup","col","li"]),vd=Le(["Card","CardContent","CardHeader","CardFooter","GridItem","Slide"]),yd=Le(["div","section","article","main","aside","header","footer","figure","nav"]);var Vi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",xd=`${Vi}0123456789`;var Gi=Le(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Yi=Le(["script","style","textarea","title","xmp"]),Ki=Le(["script","iframe","object","embed","base","meta","link","form","frame","frameset","applet","noscript"]),Xi=Le(["dangerouslysetinnerhtml","ref","key","srcdoc","is"]),Zi=Le(["style","labelstyle"]),Qi=Le(["href","src","action","formaction","poster","background","cite","data","xlink:href","ping"]),ea=Le(["srcset","ping"]),ta=Le(In.map(e=>e.toLowerCase())),na={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xA0"};function zr(e){return e.replace(/&(#[xX]?[0-9a-fA-F]+|[a-zA-Z]+);/g,(t,n)=>{if(n[0]==="#"){let o=n[1]==="x"||n[1]==="X",r=parseInt(n.slice(o?2:1),o?16:10);return Number.isFinite(r)&&r>=0&&r<=1114111?String.fromCodePoint(r):t}return na[n.toLowerCase()]??t})}function ra(e){let t={kind:"el",tag:"#root",attrs:[],children:[]},n=[t],o=()=>n[n.length-1],r=l=>{l&&o().children.push({kind:"text",value:zr(l)})},i=0;for(;i<e.length;){let l=e.indexOf("<",i);if(l===-1){r(e.slice(i));break}if(l>i&&r(e.slice(i,l)),e.startsWith("<!--",l)){let x=e.indexOf("-->",l+4);i=x===-1?e.length:x+3;continue}if(e[l+1]==="!"||e[l+1]==="?"){let x=e.indexOf(">",l);i=x===-1?e.length:x+1;continue}if(e[l+1]==="/"){let x=e.indexOf(">",l),g=e.slice(l+2,x===-1?e.length:x).trim().toLowerCase();for(let y=n.length-1;y>=1;y--)if(n[y].tag===g){n.length=y;break}i=x===-1?e.length:x+1;continue}let c=/^<([a-zA-Z][a-zA-Z0-9-]*)/.exec(e.slice(l));if(!c){r("<"),i=l+1;continue}let s=c[1].toLowerCase(),a=l+c[0].length,f=[],h=!1;for(;a<e.length;){for(;a<e.length&&/\s/.test(e[a]);)a++;if(e[a]===">"){a++;break}if(e[a]==="/"){if(e[a+1]===">"){h=!0,a+=2;break}a++;continue}let x=/^[^\s=/>]+/.exec(e.slice(a));if(!x){a++;continue}let g=x[0];for(a+=x[0].length;a<e.length&&/\s/.test(e[a]);)a++;if(e[a]==="="){for(a++;a<e.length&&/\s/.test(e[a]);)a++;let y="",p=e[a];if(p==='"'||p==="'"){let _=e.indexOf(p,a+1);y=e.slice(a+1,_===-1?e.length:_),a=_===-1?e.length:_+1}else{let _=/^[^\s>]*/.exec(e.slice(a));y=_?_[0]:"",a+=y.length}f.push({name:g,value:zr(y)})}else f.push({name:g,value:!0})}let w={kind:"el",tag:s,attrs:f,children:[]};if(o().children.push(w),Yi.has(s)){let x=e.slice(a),g=new RegExp(`</${s}\\s*>`,"i").exec(x),y=g?x.slice(0,g.index):x;y&&w.children.push({kind:"text",value:y}),i=g?a+g.index+g[0].length:e.length;continue}!h&&!Gi.has(s)&&n.push(w),i=a}return t.children}function oa(e,t){let n=[];for(let o of e.attrs){let r=o.name.toLowerCase();if(r.startsWith("data-mx-")||r==="contenteditable")continue;if(r.startsWith("on")||Xi.has(r)||Zi.has(r)){t.push({message:`Dropped attribute "${o.name}" on pasted <${e.tag}>`,attr:o.name,tag:e.tag});continue}if(typeof o.value=="string"&&(ea.has(r)?Fr(o.value,r):Qi.has(r)&&Dr(o.value))){t.push({message:`Dropped attribute "${o.name}" with a disallowed URL scheme on <${e.tag}>`,attr:o.name,tag:e.tag});continue}let i=r==="class"?"className":o.name;n.push({name:i,value:{static:!0,json:o.value},start:0,end:0})}return n}function Ur(e,t,n){let o=[];for(let r of e){if(r.kind==="text"){o.push({type:"text",value:r.value,start:0,end:0});continue}let i=r.attrs.find(c=>c.name.toLowerCase()===Ui);if(i&&typeof i.value=="string"){let c=Gt(t,i.value);if(c&&c.type==="element"&&c.isComponent){o.push(structuredClone(c));continue}}if(Ki.has(r.tag)){n.push({message:`Dropped pasted <${r.tag}> element`,tag:r.tag});continue}let l=Ur(r.children,t,n);if(!ta.has(r.tag)){n.push({message:`Unwrapped pasted <${r.tag}> element (not in the story tag allowlist)`,tag:r.tag}),o.push(...l);continue}o.push({type:"element",tag:r.tag,isComponent:!1,attributes:oa(r,n),children:l,selfClosing:l.length===0,start:0,end:0})}return o}function Wr(e,t){let n=ke(e);if(!n.ok)return{source:e,errors:[Nr(e,n)]};let o=[],r=t.map(l=>({edit:l,host:Gt(n.nodes,l.astPath)})),i=!1;for(let{edit:l,host:c}of r){if(!c||c.type!=="element"){o.push({message:`No element at AST path "${l.astPath}" \u2014 edit skipped`});continue}let s=Ur(ra(l.innerHtml),n.nodes,o),a=vt(s,{components:jr,allowedHtmlTags:In,stylePolicy:"no-inline-style"});if(a.length>0){o.push(...a);continue}c.children=s,s.length>0&&(c.selfClosing=!1),i=!0}return{source:i?_e(n.nodes):e,errors:o}}function Vr(e){let t=e[0];return t&&t.type==="element"&&t.tag==="Helmet"?1:0}function Yt(e,t){let n=ke(e);if(!n.ok)return t;let o=Vr(n.nodes);if(!o)return t;let[r,...i]=t.split("."),l=Number(r);return!Number.isInteger(l)||l<0?t:[String(l+o),...i].join(".")}function ia(e){return e.text.size>0||e.format.size>0||e.layout.size>0}function Kt(e,t){if(!ia(t))return e;let n=ke(e),o=n.ok?Vr(n.nodes):0,r=s=>{if(!o)return s;let[a,...f]=s.split("."),h=Number(a);return Number.isInteger(h)&&h>=0?[String(h+o),...f].join("."):s},i=s=>{if(!n.ok)return!1;let a=Ge(n.nodes,s);return!!a&&a.type==="element"&&!a.isComponent&&Pn(a)},l=Wr(e,[...t.text].map(([s,a])=>({astPath:r(s),innerHtml:a})).filter(s=>i(s.astPath))).source,c=Jr(l,[...t.format].map(([s,a])=>({astPath:r(s),...a})));return Br(c,[...t.layout].map(([s,a])=>({astPath:r(s),...a})))}function Yr(e,t){let n=ke(e);if(!n.ok)return e;let o=l=>{let c=Yt(e,l),s=c.split("."),a=Number(s.pop()),f=s.length?Ge(n.nodes,s.join(".")):null,h=s.length?f?.type==="element"?f.children:[]:n.nodes,w=h[a];return w?.type==="element"?{node:w,index:a,siblings:h,parent:f}:null};if(t.kind==="delete"){if(!t.paths.length)return e;let l=t.paths.map(o);if(l.some(f=>!f))return e;let c=new Set(l.map(f=>f.node)),s=f=>f.filter(h=>!c.has(h)).map(h=>{if(h.type!=="element")return h;let w=s(h.children);return["GridItem","Slide","div","section","article","td","th"].includes(h.tag)&&h.children.length>0&&!w.some(x=>x.type==="element"||x.type==="text"&&x.value.trim())&&w.push({type:"element",tag:"p",isComponent:!1,attributes:[{name:"id",value:{static:!0,json:`e${Be().replaceAll("-","")}`},start:0,end:0}],children:[],selfClosing:!1,start:0,end:0}),{...h,children:w}}),a=s(n.nodes);if(!a.some(f=>f.type==="element"&&f.tag!=="Helmet"||f.type==="text"&&f.value.trim())){let f=ke(`<p id="e${Be().replaceAll("-","")}"></p>`);f.ok&&a.push(...f.nodes)}return _e(a)}let r=o(t.path);if(!r)return e;let i=r.node;if(t.kind==="divider"){if(r.parent?.type!=="element"||r.parent.tag!=="Grid"||xt(r.parent,"mode")!=="flow"||i.tag!=="GridItem"||!Number.isFinite(t.width))return e;let l=r.siblings.slice(r.index+1).find(w=>w.type==="element");if(l?.type!=="element"||l.tag!=="GridItem")return e;let c=An(xt(r.parent,"cols")),s=w=>Math.min(c,Math.max(1,Number(xt(w,"w"))||c)),a=0;for(let w of r.siblings.slice(0,r.index)){if(w.type!=="element"||w.tag!=="GridItem")continue;let x=s(w);a=a+x>c?x:a+x,a===c&&(a=0)}if(a+s(i)+s(l)>c)return e;let f=s(i)+s(l),h=Math.max(1,Math.min(f-1,Math.round(t.width)));Te(i,"w",h),Te(l,"w",f-h)}else if(t.kind==="move"){let l=o(t.target);if(!l||r.siblings!==l.siblings||r.node===l.node)return e;r.siblings.splice(r.index,1),r.siblings.splice(l.index,0,i)}else if(t.kind==="resize"){if(!Number.isFinite(t.width)||!Number.isFinite(t.height))return e;if(t.grid){if(i.tag!=="GridItem")return e;if(t.axis!=="height"&&Te(i,"w",Math.max(1,Math.min(An(r.parent?.type==="element"?xt(r.parent,"cols"):void 0),Math.round(t.width)))),t.axis==="width")return _e(n.nodes);r.parent?.type==="element"&&xt(r.parent,"mode")==="flow"?Te(i,"minHeight",Math.max(0,Math.min(1e4,Math.round(t.height)))):Te(i,"h",Math.max(1,Math.min(1e3,Math.round(t.height))))}else{let l=Math.max(40,Math.min(4e3,Math.round(t.width))),c=Math.max(0,Math.min(1e4,Math.round(t.height))),s=Gr(i).filter(a=>!(t.axis!=="height"&&/^w-|^max-w-/.test(a))&&!(t.axis!=="width"&&/^h-|^min-h-|^max-h-|^overflow-(?:hidden|clip)$/.test(a)));t.axis!=="height"&&s.push(`w-[${l}px]`,"max-w-full"),t.axis!=="width"&&s.push(`min-h-[${c}px]`),Te(i,"className",s.join(" "))}}else i.tag==="GridItem"?Te(i,"minHeight",void 0):Te(i,"className",Gr(i).filter(l=>!/^min-h-\[/.test(l)).join(" "));return _e(n.nodes)}function Gr(e){let t=e.attributes.find(n=>["className","class"].includes(n.name))?.value;return t?.static&&typeof t.json=="string"?t.json.split(/\s+/).filter(Boolean):[]}function xt(e,t){let n=e.attributes.find(o=>o.name===t)?.value;return n?.static?n.json:void 0}function Kr(e,t,n,o){let r=n&&/\bid=["{]/.test(n)?e.indexOf(n):-1;if(r>=0&&e.indexOf(n,r+1)<0){let x=ke(o);return!x.ok||!x.nodes.every(zt)||vt(x.nodes,{components:[]}).length?e:e.slice(0,r)+_e(x.nodes)+e.slice(r+n.length)}let i=ke(e),l=ke(n),c=ke(o);if(!i.ok||!l.ok||!c.ok||!l.nodes.length||!c.nodes.every(zt)||vt(c.nodes,{components:[]}).length)return e;let s=Yt(e,t).split("."),a=Number(s.pop()),f=s.length?Ge(i.nodes,s.join(".")):null,w=(s.length?f?.type==="element"?f.children:[]:i.nodes).slice(a,a+l.nodes.length);return!w.length||_e(w)!==_e(l.nodes)||!w.every(zt)?e:e.slice(0,w[0].start)+_e(c.nodes)+e.slice(w.at(-1).end)}var aa=new Set(["before","after","inside"]);function sa(e){let t=e;return t&&typeof t.path=="string"&&typeof t.side=="string"&&aa.has(t.side)?{path:t.path,side:t.side}:null}function Xr(e){let[t,n]=N(null),[o,r]=N(!1),i=!1,l=!1,c=null,s=null,a=y=>{Ut({runtimeRef:e.runtimeRef},y)};Q(Me([()=>e.runtimeRef,()=>e.sourceRef,()=>e.sessionNonce],([y,p])=>{K(Wt({runtimeRef:y},b=>{let O=e.sessionNonce;if(!(!O||!qt(b.data,O)))switch(b.data.type){case"mx:history":e.onHistory?.(b.data.direction);break;case"mx:edit-flush":e.onFlush?.();break;case"mx:comment-key":e.onCommentKey?.();break;case"mx:open-script":typeof b.data.component=="string"&&e.onOpenScript?.(b.data.component);break;case"mx:block-edit":{let S=Yr(p.current,b.data.command);S!==p.current&&e.onSourceEdited(S,!0);break}case"mx:edit-error":e.onError?.(b.data.message);break;case"mx:edit-ready":r(!0);break;case"mx:typing":i=b.data.active;break;case"mx:selection":n(b.data.selection);break;case"mx:flow-edit":{let{path:S,expected:R,replacement:P}=b.data,J=Kr(p.current,S,R,P);J!==p.current?e.onSourceEdited(J,!0,b.data.group,b.data.selection):R!==P&&(l=!0,e.onRejectedEdit?.(P));break}case"mx:text-edit":{let S=Kt(p.current,{text:new Map([[b.data.path,b.data.innerHtml]]),format:new Map,layout:new Map});S!==p.current&&e.onSourceEdited(S);break}case"mx:committed":c?.();break;case"mx:layout-edit":{let S=Kt(p.current,{text:new Map,format:new Map,layout:new Map(b.data.rects.map(R=>[R.path,{x:R.x,y:R.y,w:R.w,h:R.h}]))});S!==p.current&&e.onSourceEdited(S,!0);break}case"mx:slide-title":e.onSlideTitle?.(b.data.path,b.data.title);break;case"mx:edit-key":e.onEditKey?.(b.data.key,t());break;case"mx:image-drop":{let S=b.data.file,R=typeof b.data.target=="string"?b.data.target:null,P=R?{replace:R}:"at"in b.data?{at:sa(b.data.at)}:null;g().then(()=>P?e.onImageDrop?.(S,P):e.onImageDrop?.(S));break}case"mx:image-replace":typeof b.data.path=="string"&&e.onImageReplaceRequest?.(b.data.path);break;default:break}}))}));let f=!1;Q(Me(()=>e.editing,y=>{y!==f&&(f=y,a({type:jt,on:y}),y||(r(!1),n(null),i=!1))}));let h=(y,p)=>{let _=t(),b=_?.path===y&&_.editor==="prose";if(a({type:Rr,path:y,...p}),b)return;let O=Kt(e.sourceRef.current,{text:new Map,format:new Map([[y,p]]),layout:new Map});O!==e.sourceRef.current&&e.onSourceEdited(O)},w=(y,p)=>{a({type:Tr,path:y,href:p})},x=(y,p)=>{y===null&&n(null),a({type:Je,path:y,...p?.reveal?{reveal:!0}:{},...p?.nodeId?{nodeId:p.nodeId}:{}})},g=async(y=!1)=>{if(l)throw new Error("Recover the uncommitted text before leaving the editor.");if(!qr({runtimeRef:e.runtimeRef})){if(y)throw new Error("editor is unavailable");return}s||(s=new Promise(_=>{let b=window.setTimeout(()=>O(!1),1200);function O(S=!0){window.clearTimeout(b),c=null,s=null,_(S)}c=O,a({type:Tn})}));let p=await s;if(y&&!p)throw new Error("editor commit timed out")};return{selection:t,ready:o,discardRejectedEdit:()=>{l=!1},isUserEditing:()=>i||l,applyFormat:h,applyLink:w,applyInline:y=>a({type:"mx:inline",tag:y}),pasteMarkdown:y=>a({type:"mx:paste",kind:"markdown",value:y}),select:x,spotlight:y=>a({type:Ar,paths:y}),commitPending:g,restoreSelection:y=>a({type:Tn,restore:y})}}var la;function ca(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),la=window.history.state._depth}Oe||ca();function da(e,t){if(e==null)throw new Error(t);return e}var ua=Ne(),nu=Ne(),Qr=()=>da(je(ua),"<A> and 'use' router primitives can be only used inside a Route.");var ma=()=>Qr().navigatorFactory(),eo=()=>Qr().location;var fa;function ha(){return fa}var ga=!1;function pa(){return ga}var ba="Location",va=5e3,ya=18e4,Mn=new Map;Oe||setInterval(()=>{let e=Date.now();for(let[t,n]of Mn.entries())!n[4].count&&e-n[0]>ya&&Mn.delete(t)},3e5);function wt(){if(!Oe)return Mn;let e=ot();if(!e)throw new Error("Cannot find cache context");return(e.router||(e.router={})).cache||(e.router.cache=new Map)}function Xt(e,t){e.GET&&(e=e.GET);let n=(...o)=>{let r=wt(),i=ha(),l=pa(),s=kr()?ma():void 0,a=Date.now(),f=t+Zr(o),h=r.get(f),w;if(Oe){let y=ot();if(y){let p=(y.router||(y.router={})).dataOnly;if(p){let _=y&&(y.router.data||(y.router.data={}));if(_&&f in _)return _[f];if(Array.isArray(p)&&!xa(f,p))return _[f]=void 0,Promise.resolve()}}}if(wr()&&!Oe&&(w=!0,K(()=>h[4].count--)),h&&h[0]&&(Oe||i==="native"||h[4].count||Date.now()-h[0]<va)){w&&(h[4].count++,h[4][0]()),h[3]==="preload"&&i!=="preload"&&(h[0]=a);let y=h[1];return i!=="preload"&&(y="then"in h[1]?h[1].then(g(!1),g(!0)):g(!1)(h[1]),!Oe&&i==="navigate"&&Ft(()=>h[4][1](h[0]))),l&&"then"in y&&y.catch(()=>{}),y}let x;if(!Oe&&Ve.has&&Ve.has(f)?(x=Ve.load(f),delete globalThis._$HY.r[f]):x=e(...o),h?(h[0]=a,h[1]=x,h[3]=i,!Oe&&i==="navigate"&&Ft(()=>h[4][1](h[0]))):(r.set(f,h=[a,x,,i,N(a)]),h[4].count=0),w&&(h[4].count++,h[4][0]()),Oe){let y=ot();if(y&&y.router.dataOnly)return y.router.data[f]=x}if(i!=="preload"&&(x="then"in x?x.then(g(!1),g(!0)):g(!1)(x)),l&&"then"in x&&x.catch(()=>{}),Oe&&Ve.context&&Ve.context.async&&!Ve.context.noHydrate){let y=ot();(!y||!y.serverOnly)&&Ve.context.serialize(f,x)}return x;function g(y){return async p=>{if(p instanceof Response){let _=ot();if(_)for(let[O,S]of p.headers)O=="set-cookie"?_.response.headers.append("set-cookie",S):_.response.headers.set(O,S);let b=p.headers.get(ba);if(b!==null){s&&b.startsWith("/")?Ft(()=>{s(b,{replace:!0})}):Oe?_&&(_.response.status=302):window.location.href=b;return}p.customBody&&(p=await p.customBody())}if(y)throw p;return h[2]=p,p}}};return n.keyFor=(...o)=>t+Zr(o),n.key=t,n}Xt.get=e=>wt().get(e)[2];Xt.set=(e,t)=>{let n=wt(),o=Date.now(),r=n.get(e);r?(r[0]=o,r[1]=Promise.resolve(t),r[2]=t,r[3]="preload"):(n.set(e,r=[o,Promise.resolve(t),t,"preload",N(o)]),r[4].count=0)};Xt.delete=e=>wt().delete(e);Xt.clear=()=>wt().clear();function xa(e,t){for(let n of t)if(n&&e.startsWith(n))return!0;return!1}function Zr(e){return JSON.stringify(e,(t,n)=>wa(n)?Object.keys(n).sort().reduce((o,r)=>(o[r]=n[r],o),{}):n)}function wa(e){let t;return e!=null&&typeof e=="object"&&(!(t=Object.getPrototypeOf(e))||t===Object.prototype)}var ka=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],to=e=>d(re,G(e,{iconNode:ka,name:"camera"}));var $a=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],On=e=>d(re,G(e,{iconNode:$a,name:"loader-circle"}));var Ea=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],no=e=>d(re,G(e,{iconNode:Ea,name:"message-square"}));var _a=[["path",{d:"M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z",key:"xwnzip"}],["path",{d:"M5 3a2 2 0 0 0-2 2",key:"y57alp"}],["path",{d:"M19 3a2 2 0 0 1 2 2",key:"18rm91"}],["path",{d:"M5 21a2 2 0 0 1-2-2",key:"sbafld"}],["path",{d:"M9 3h1",key:"1yesri"}],["path",{d:"M9 21h2",key:"1qve2z"}],["path",{d:"M14 3h1",key:"1ec4yj"}],["path",{d:"M3 9v1",key:"1r0deq"}],["path",{d:"M21 9v2",key:"p14lih"}],["path",{d:"M3 14v1",key:"vnatye"}]],Ln=e=>d(re,G(e,{iconNode:_a,name:"square-dashed-mouse-pointer"}));var Sa=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ye=e=>d(re,G(e,{iconNode:Sa,name:"x"}));async function ro(e,t={}){let n=new Map,o=new Set,r;for(;;){let i=r?`${e}${e.includes("?")?"&":"?"}cursor=${encodeURIComponent(r)}`:e,l=await fetch(i,{credentials:"same-origin",...t});if(!l.ok)throw new Error(`Annotation read failed (HTTP ${l.status})`);let c=await l.json();if(!Array.isArray(c.annotations))throw new Error("Invalid annotation page");for(let s of c.annotations)n.set(s.id,s);if(c.next_cursor==null)return[...n.values()];if(typeof c.next_cursor!="string"||!c.next_cursor||o.has(c.next_cursor))throw new Error("Invalid annotation cursor");o.add(c.next_cursor),r=c.next_cursor}}function oo(e,t=fetch){let n=new AbortController,o=`/a/${encodeURIComponent(e)}`,r=async(c,s={},a=!1)=>{n.signal.throwIfAborted();let f=await t(c,{...s,credentials:"same-origin",signal:s.signal?AbortSignal.any([n.signal,s.signal]):n.signal});n.signal.throwIfAborted();let h=a?await f.json().catch(()=>({error:"fetch_failed"})):await f.json();if(n.signal.throwIfAborted(),!f.ok&&!a)throw new Error(h.detail??h.error??`request failed (${f.status})`);return h},i=(c,s)=>r(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),l=c=>i(`${o}/query`,c);return{dispose:()=>n.abort(),run:(c,s,a)=>l({values:c,only:s,tz:Jt(),...a?{localTables:a}:{}}),hold:async c=>(await i(`${o}/query`,{hold:c})).tables,people:async c=>(await i(`${o}/query`,{people:c})).people,page:async(c,s,a,f)=>{let h=await l({values:c,only:[s],page:{name:s,...a},tz:Jt(),...f?{localTables:f}:{}});if(!h.tables[s])throw new Error(h.errors[s]??`no rows for ${s}`);return h.tables[s]},mutate:async c=>{let s=await i(`${o}/mutate`,{tz:Jt(),...c});if(!s.ok)throw new Error(s.detail??s.error??"write failed");return{dataset:s.dataset??"",local:s.local,mutationRunId:s.mutationRunId}},importAsset:async(c,s,a)=>{let f=new URLSearchParams({u:c,...s?{kind:s}:{}}),h=await r(`${o}/assets?${f}`,{headers:{Accept:"application/json"},signal:a},!0);return h.url?{url:h.url,image:h.image}:{refused:h.code??h.error??"fetch_failed"}}}}var Nn="sign_in_required";var Ca="keepalive";function Ra(e,t=Math.random){let n=Math.min(3e4,1e3*2**Math.max(0,e));return Math.round(n/2+t()*(n/2))}function Dn(e){let t=e.host??(typeof window>"u"?void 0:window),n=globalThis.EventSource,o=null,r=0,i=!1,l=Date.now(),c,s,a=()=>{clearTimeout(s),s=setTimeout(w,45e3)},f=()=>{l=Date.now(),r=0,a()};function h(){if(i||!n)return;clearTimeout(c),c=void 0,o?.close();let y=new n(e.url);o=y;let p=()=>o===y&&!i;y.onopen=()=>{p()&&a()},y.onmessage=_=>{p()&&(f(),e.onMessage?.(String(_.data)))};for(let[_,b]of Object.entries(e.events??{}))y.addEventListener(_,O=>{p()&&(f(),b(String(O.data)))});y.addEventListener(Ca,()=>{p()&&f()}),y.onerror=()=>{p()&&w()},a()}function w(){i||(clearTimeout(s),o?.close(),o=null,clearTimeout(c),c=setTimeout(h,Ra(r++,e.random)),e.onError?.())}let x=()=>{if(!i){if(!o||Date.now()-l>2e4){r=0,h();return}e.onWake?.()}},g=()=>{t?.document?.visibilityState!=="hidden"&&x()};return t?.addEventListener("online",x),t?.document?.addEventListener("visibilitychange",g),h(),{close(){i||(i=!0,clearTimeout(c),clearTimeout(s),o?.close(),o=null,t?.removeEventListener("online",x),t?.document?.removeEventListener("visibilitychange",g))}}}var Se=class extends Error{status;signInRequired;constructor(t,n,o=!1){super(t),this.name="BackendRequestError",this.status=n,this.signInRequired=o}};var De={"Content-Type":"application/json"};function Ta(e){let t=`/api/my/artifacts/${encodeURIComponent(e)}`;return{head:()=>fetch(t),version:n=>fetch(`${t}/versions/${n}`),edits:n=>fetch(`${t}/edits`,{method:"POST",headers:De,body:JSON.stringify(n)}),patch:n=>fetch(t,{method:"PATCH",headers:De,body:JSON.stringify(n)}),revert:n=>fetch(`${t}/revert`,{method:"POST",headers:De,body:JSON.stringify(n)})}}function Aa(e,t){let n=`Could not save comment (${e})`;if(!t||typeof t!="object")return n;let{error:o,detail:r,details:i}=t,l=typeof o=="string"?o:n,c=typeof r=="string"?r:Array.isArray(i)&&typeof i[0]?.message=="string"?i[0].message:null;return c?`${l}: ${c}`:l}var io=async e=>({ok:e.ok,status:e.status,body:await e.json().catch(()=>({}))});function ao(e){let t=`/api/my/artifacts/${e}`,n=async(o,r,i)=>{let l=await fetch("/api/my/artifacts?visibility=unlisted",{method:"POST",...o}).catch(()=>null);return l?l.ok?{ok:!0,image:await l.json()}:{ok:!1,error:await r(l)}:{ok:!1,error:i}};return{mode:"online",unavailable:()=>null,async load(){let o=await fetch(t);return o.ok?await o.json():null},async commitEdit(o){return io(await fetch(`${t}/edits`,{method:"POST",headers:De,body:JSON.stringify(o)}))},async prepare(o){let r=await fetch(`/api/my/artifacts/${encodeURIComponent(e)}/prepare`,{method:"POST",headers:De,body:JSON.stringify({source:o})});if(r.ok)return r.json();let i=await r.json().catch(()=>({})),l=i.details?.map(c=>typeof c=="string"?c:c?.message).filter(Boolean).join(`
|
|
2
|
+
`);throw new Error(l||i.error||"Unable to prepare document resources")},async previewCss(o){let r=await fetch("/api/preview",{method:"POST",headers:De,body:JSON.stringify({markup:o})});if(!r.ok)throw new Se("preview refused",r.status);let i=await r.json();if(typeof i.css!="string")throw new Se("no stylesheet",r.status);return{css:i.css}},async previewQueries(o){let r=await fetch("/api/query",{method:"POST",headers:De,body:JSON.stringify({markup:o})});return r.ok?await r.json():null},async queryTable(o,r){let i=await fetch(`/a/${encodeURIComponent(o)}/tables`,{method:"POST",credentials:"same-origin",headers:De,body:JSON.stringify(r)}),l=await i.json();if(!i.ok)throw new Se(l.details?.[0]??l.error??"unavailable",i.status);return l},importImage(o){return"imageUrl"in o?n({headers:De,body:JSON.stringify({imageUrl:o.imageUrl})},async r=>(await r.json().catch(()=>null))?.details?.[0]??(r.status===403?"You have reached your artifact limit.":"Could not import that image."),"Import failed \u2014 check your connection and try again."):n({headers:{"Content-Type":o.file.type},body:o.file},async r=>{let i=await r.json().then(l=>l?.error).catch(()=>null);return r.status===413?"That image is too large to upload.":r.status===403?"You have reached your artifact limit.":i==="invalid_image"?"That image type is not supported (png, jpeg, webp, gif, svg).":"Could not upload that image."},"Upload failed \u2014 check your connection and try again.")},async versions(){let o=await fetch(`${t}/versions`);return o.ok?(await o.json()).versions:null},async version(o){let r=await fetch(`${t}/versions/${o}`);return r.ok?await r.json():null},async revert(o){return io(await Ta(e).revert(o))},live(o,r){let i=Dn({url:`/a/${e}/events${r?.since?`?since=${encodeURIComponent(r.since)}`:""}`,onMessage:l=>{let c;try{c=JSON.parse(l)}catch{return}o.onPing(c)},events:{[Cr]:l=>{try{o.onData(JSON.parse(l))}catch{}},[Or]:()=>o.onAnnotations()},onWake:o.onWake});return()=>i.close()},async liveFrame(){let o=await fetch(`/a/${e}/events/frame`,{credentials:"same-origin"});return o.ok?await o.json():null},queryTransport:()=>oo(e),listAnnotations(o,r={}){return ro(`${t}/annotations${o?`?status=${o}`:""}`,r)},async createAnnotation(o,r){let i=await fetch(`${t}/annotations`,{method:"POST",headers:{...De,"Idempotency-Key":r},body:JSON.stringify(o)});if(i.ok)return await i.json();let l=await i.json().catch(()=>null),c=l&&typeof l=="object"?l:{};throw new Se(Aa(i.status,l),i.status,c.error===Nn||c.code===Nn)},async actOnAnnotation(o,r){let i=await fetch(`${t}/annotations/${o}`,{method:"POST",headers:De,body:JSON.stringify(r)});if(!i.ok)throw new Se(`Could not update this comment (${i.status})`,i.status);return await i.json()},async deleteAnnotation(o){if(!(await fetch(`${t}/annotations/${o}`,{method:"DELETE"})).ok)throw new Error("Could not delete this comment. Try again.")},async uploadCommentImage(o){let r=await fetch(`${t}/comment-images`,{method:"POST",body:o});if(!r.ok){let i=await r.json();throw new Error(i.error==="stale"?"The document changed. Your draft is preserved; retake the screenshot.":i.error==="quota_exceeded"?"Image storage quota reached.":"Could not upload the screenshot. Please retry.")}return await r.json()},async members(o,r={}){let i=await fetch(`/api/my/artifacts/${encodeURIComponent(e)}/members${o===void 0?"":`?query=${encodeURIComponent(o)}`}`,{signal:r.signal});return i.ok?await i.json():null},async remoteSessions(o={}){let r=await fetch("/api/remote/sessions",{credentials:"same-origin",signal:o.signal});return r.ok?await r.json():{sessions:[]}},async deleteRemoteSession(o){let r=await fetch(`/api/remote/sessions/${o}`,{method:"DELETE",credentials:"same-origin"});if(!r.ok){let i=await r.json().catch(()=>null);throw new Error(i?.error??"Could not remove agent. Try again.")}}}}var lo="mx_comments_folded",Ia={threads:[],comments:[]};function co(){try{let e=globalThis.localStorage;return e&&typeof e.getItem=="function"?e:null}catch{return null}}var so=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):null;function Pa(e,t){if(!e||typeof e!="object"||Array.isArray(e))return null;let n=e[t];if(!n||typeof n!="object"||Array.isArray(n))return null;let{threads:o,comments:r}=n,i=so(o),l=so(r);return!i||!l?null:{threads:i,comments:l}}function uo(){let e=co();if(!e)return{};try{let t=e.getItem(lo);if(!t)return{};let n=JSON.parse(t);return n&&typeof n=="object"&&!Array.isArray(n)?n:{}}catch{return{}}}function mo(e,t){let n=co();if(!n)return t;try{n.setItem(lo,JSON.stringify({...uo(),[e]:t}))}catch{}return t}function kt(e){return Pa(uo(),e)??{...Ia}}function fo(e,t,n){let o=kt(e),r={...o,[t]:o[t].includes(n)?o[t].filter(i=>i!==n):[...o[t],n]};return mo(e,r)}function Fn(e,t){let n=kt(e),o={threads:n.threads.filter(i=>!t.threads?.includes(i)),comments:n.comments.filter(i=>!t.comments?.includes(i))};return o.threads.length===n.threads.length&&o.comments.length===n.comments.length?n:mo(e,o)}function $t(e,t,n){return e[t].includes(n)}function ho(e,t){let n=Number.isFinite(e)&&e>0&&Number.isFinite(t)&&t>0,o=n?10*t:0;return{overflowing:n&&e-o>=1,lines:n?Math.round(e/t):0,maxHeight:o}}var go="intent";function po(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function Ma(e){return(e.startsWith("?")?e.slice(1):e).split("&").filter(Boolean).map(n=>{let o=n.indexOf("="),[r,i]=o===-1?[n,""]:[n.slice(0,o),n.slice(o+1)];return{raw:n,key:po(r),value:po(i)}})}var Oa=e=>e.length?`?${e.join("&")}`:"";function bo(e,t){return Oa([...Ma(e).filter(n=>n.key!==go).map(n=>n.raw),`${go}=${t}`])}function vo(e,t){if(!t&&(e.pathname==="/"||e.pathname==="/login"))return"/login";let n=t?bo(e.search,t):e.search;return`/login?callbackUrl=${encodeURIComponent(e.pathname+n+e.hash)}`}var yo="(?:[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[a-f0-9]{64})",La=new RegExp(`^/chat\\?session=${yo}$`);function Zt(e){return La.test(e)}function Et(e){return e.matchAll(new RegExp(`\\[(@[^\\]\\n]+)\\]\\(/chat\\?session=(${yo})\\)`,"g"))}function xo(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.author.kind!=="human")continue;let o=new Map;for(let r of Et(n.body))o.set(r[2],r[0]);if(o.size)return[...o.values()].join(" ")+" "}return""}function Xe(e){let t=e;for(let n of Et(e))t=t.replace(n[0],"");return!!t.trim()}function Qt(e){if(e.reason==="queue_full")return"Queue full \xB7 mention again after pending work finishes";if(e.reason==="unauthorized")return"Unavailable \xB7 mention one of your agents";let t={superseded:"Follow-up received",dispatching:"Sending to agent",queued:"Queued",delivered:"Sent \xB7 awaiting acknowledgment\u2026",acknowledged:"Working",completed:"Answered",blocked:"Needs your input",uncertain:"Delivery uncertain \xB7 check terminal",unavailable:"Agent unavailable"}[e.phase];return e.connection==="offline"?t+" \xB7 offline":e.connection==="stopped"?t+" \xB7 stopped":e.phase==="queued"&&e.activity==="unknown"?t+" \xB7 readiness unknown, check terminal":e.phase==="queued"&&e.activity==="starting"?t+" \xB7 loading context":e.phase==="completed"&&e.activity==="listening"?t+" \xB7 listening":t}function en(e){return`[@${e.name.replace(/[\[\]\\\n]/g,"")}](/chat?session=${e.id}) `}var Na='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',Ze=[],wo=0,ko="",Da=e=>{let t=e.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t};function $o(e){let t=Ze[Ze.length-1];if(!t)return;if(e.key==="Escape"){if(e.defaultPrevented)return;e.preventDefault(),t.onClose();return}if(e.key!=="Tab")return;let n=t.panel();if(!n)return;let o=[...n.querySelectorAll(t.focusable??Na)];if(!o.length){e.preventDefault();return}let r=o[0],i=o[o.length-1],l=n.getRootNode().activeElement;(!l||!n.contains(l)||(e.shiftKey?l===r:l===i))&&(e.preventDefault(),(e.shiftKey?i:r).focus())}function tn(e){ve(()=>{let t=Da(document);Ze.push(e),Ze.length===1&&window.addEventListener("keydown",$o),e.lockScroll&&wo++===0&&(ko=document.body.style.overflow,document.body.style.overflow="hidden"),e.initialFocus?.()?.focus(),K(()=>{let n=Ze.indexOf(e);n>=0&&Ze.splice(n,1),Ze.length===0&&window.removeEventListener("keydown",$o),e.lockScroll&&--wo===0&&(document.body.style.overflow=ko),t?.isConnected&&typeof t.focus=="function"&&t.focus()})})}var Fa=v('<p role=alert class="mt-3 text-sm text-danger">'),ja=v('<div class="fixed inset-0 z-[150] flex items-center justify-center bg-black/45 p-4 backdrop-blur-[2px]"><div role=dialog aria-modal=true class="relative max-h-[calc(100dvh-2rem)] w-full max-w-md overflow-y-auto rounded-xl border border-edge-bright bg-surface p-6 text-fg shadow-2xl"><h2 class="text-base font-semibold"></h2><div class="mt-3 break-words text-sm leading-relaxed text-muted"></div><div class="mt-6 flex justify-end gap-3"><button type=button class="rounded-md border border-edge px-4 py-2 text-sm text-muted">Cancel</button><button type=button>');function Eo(e){let t,n,o=pt(),r=pt();return tn({panel:()=>t,onClose:()=>{e.busy||e.onCancel()},initialFocus:()=>n,focusable:"button:not([disabled]), a[href], input:not([disabled])"}),d(it,{get mount(){return Bt(document)??document.body},get children(){var i=ja(),l=i.firstChild,c=l.firstChild,s=c.nextSibling,a=s.nextSibling,f=a.firstChild,h=f.nextSibling;i.$$mousedown=g=>{g.target===g.currentTarget&&!e.busy&&e.onCancel()};var w=t;typeof w=="function"?ye(w,l):t=l,I(l,"aria-labelledby",o),I(l,"aria-describedby",r),I(c,"id",o),m(c,()=>e.title),I(s,"id",r),m(s,()=>e.description),m(l,d(T,{get when(){return e.error},get children(){var g=Fa();return m(g,()=>e.error),g}}),a),Sn(f,"click",e.onCancel,!0);var x=n;return typeof x=="function"?ye(x,f):n=f,Sn(h,"click",e.onConfirm,!0),m(h,()=>e.action,null),m(h,()=>e.busy?"\u2026":"",null),q(g=>{var y=e.busy,p=e.cancelLabel,_=e.busy,b=e.confirmLabel,O=e.busy,S=`rounded-md border px-4 py-2 text-sm font-medium ${e.danger?"border-danger/40 bg-danger-soft text-danger":"border-accent/40 bg-accent-soft text-accent"}`;return y!==g.e&&I(l,"aria-busy",g.e=y),p!==g.t&&I(f,"aria-label",g.t=p),_!==g.a&&(f.disabled=g.a=_),b!==g.o&&I(h,"aria-label",g.o=b),O!==g.i&&(h.disabled=g.i=O),S!==g.n&&de(h,g.n=S),g},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),i}})}pe(["mousedown","click"]);var Ha=v("<span tabindex=0 data-feature-unavailable><span hidden>");function jn(e){let t=pt();return d(T,{get when(){return e.reason},get fallback(){return e.children({})},children:n=>d($e,{get content(){return n()},get children(){var o=Ha(),r=o.firstChild;return m(o,()=>e.children({disabled:!0,"aria-describedby":t}),r),I(r,"id",t),m(r,n),q(()=>de(o,`${e.class??"inline-flex"} [&>:disabled]:pointer-events-none`)),o}})})}var qa=v('<button type=button aria-label="Close sheet"class="fixed inset-0 z-[2147483006] cursor-default border-0 bg-black/40 p-0">'),za=v("<div class=shrink-0>"),Ja=v('<div role=dialog aria-modal=true><div><div aria-hidden=true class="mx-auto mb-2 h-1 w-9 shrink-0 rounded-full bg-edge"></div></div><div class="min-h-0 flex-1 overflow-y-auto">'),_o=()=>typeof window<"u"&&window.innerWidth<640;function Co(){let[e,t]=N(_o());return ve(()=>{let n=()=>t(_o());n(),window.addEventListener("resize",n),K(()=>window.removeEventListener("resize",n))}),e}var Hn=0,Ba=new Set,So=()=>{for(let e of Ba)e(Hn>0)};var Ua=64;function qn(e){ve(()=>{Hn+=1,So(),K(()=>{Hn-=1,So()})});let t;tn({panel:()=>t,onClose:()=>e.onClose()});let n=null,[o,r]=N(0),i=a=>{e.swipeToClose&&(n=a.touches[0]?.clientY??null)},l=a=>{!e.swipeToClose||n===null||r(Math.max(0,(a.touches[0]?.clientY??n)-n))},c=()=>{if(!e.swipeToClose)return;let a=o()>=Ua;n=null,r(0),a&&e.onClose()},s=()=>(e.size??"tall")==="half";return d(it,{get mount(){return Bt(document)??document.body},get children(){return[d(T,{get when(){return!s()},get children(){var a=qa();return a.$$click=()=>e.onClose(),a}}),(()=>{var a=Ja(),f=a.firstChild,h=f.firstChild,w=f.nextSibling,x=t;return typeof x=="function"?ye(x,a):t=a,f.$$touchend=c,f.$$touchmove=l,f.$$touchstart=i,m(f,d(T,{get when(){return e.header},get children(){var g=za();return m(g,()=>e.header),g}}),null),m(w,()=>e.children),q(g=>{var y=e.label,p=o()?{transform:`translateY(${o()}px)`}:void 0,_=`fixed inset-x-0 bottom-0 z-[2147483007] ${s()?"max-h-[50vh]":"max-h-[80vh]"} flex animate-[sheet-in_.2s_ease-out] flex-col rounded-t-[10px] border-t border-edge bg-surface p-3 pb-[max(0.75rem,env(safe-area-inset-bottom))] font-mono text-xs shadow-lg`,b=e.swipeToClose?"shrink-0 touch-none":"contents";return y!==g.e&&I(a,"aria-label",g.e=y),g.t=rt(a,p,g.t),_!==g.a&&de(a,g.a=_),b!==g.o&&de(f,g.o=b),g},{e:void 0,t:void 0,a:void 0,o:void 0}),a})()]}})}pe(["click","touchstart","touchmove","touchend"]);var zn="[data-trusted-ui-root]",_m=`
|
|
3
3
|
:host::before, :host::after { content: none !important; display: none !important; }
|
|
4
4
|
${zn}[popover] {
|
|
5
5
|
position: fixed !important; inset: 0 !important; margin: 0 !important;
|
|
@@ -10,22 +10,22 @@ ${zn}[popover] {
|
|
|
10
10
|
}
|
|
11
11
|
${zn}[popover]:popover-open { display: block !important; }
|
|
12
12
|
${zn}[popover] > div { pointer-events: auto; }
|
|
13
|
-
`;var
|
|
14
|
-
`)?null:{label:i,url:e.slice(o+2,r).trim(),end:r+1}}function
|
|
15
|
-
`){i(r);let h=t[t.length-1];h?.kind==="text"&&(h.text=h.text.replace(/[ \t]+$/,""),h.text||t.pop()),t.push({kind:"break"}),r+=1,o=r;continue}if(f==="`"){if(r>=s){for(l??=Xa(e);c<l.count&&l.end[c]<=r;)c+=1;s=l.end[c],a=Za(l,c+1,s-r)}let h=s-r,w=a[h];if(w>s){i(r),t.push({kind:"code",text:e.slice(s,w).trim()}),r=w+h,o=r;continue}}if(f==="*"||f==="_"){let h=f==="*"&&e.startsWith("**",r),w=h?"**":f,
|
|
13
|
+
`;var st=new Map;function nn(e,t){st.set(e,t),e.showPopover();for(let[n,o]of[...st].sort((r,i)=>r[1]-i[1]))n!==e&&o>t&&(n.hidePopover(),n.showPopover())}function Ro(e,t){Q(()=>{let n=t();if(!e()||!n)return;let o=n.getRootNode(),r=o instanceof ShadowRoot?o.querySelector("[data-trusted-ui-root]"):null,i=r?st.get(r):void 0;if(!r||i===void 0||typeof r.hidePopover!="function")return;let l=r.getRootNode().activeElement;r.hidePopover(),nn(r,3),l instanceof HTMLElement&&l.focus({preventScroll:!0}),K(()=>{st.has(r)&&(r.hidePopover(),nn(r,i))})})}function To(e,t,n,o,r=!1){let l=t.width<280,c=l?12:t.left+12,s=l?n-12:Math.min(n-12,t.left+t.width-12),a=Math.max(0,Math.min(r?680:384,s-c)),f=t.left+e.rect.x+e.rect.width,h=Math.max(c,Math.min(f+12,s-a)),w=Math.max(t.top,r?44:0)+12,x=t.top+e.rect.y+Math.min(e.rect.height+12,56),g=Math.max(w,o-(r?720:236)-12);return{left:h,top:Math.max(w,Math.min(x,g)),width:a}}var Ao="[A-Za-z0-9_-]{1,128}";function lt(e){return new RegExp(`^/people/${Ao}$`).test(e)}function Io(e){return e.matchAll(new RegExp(`\\[(@[a-z0-9_]+)\\]\\(/people/(${Ao})\\)`,"gi"))}function Bn(e){return`[@${e.username}](/people/${e.user_id})`}var Wa=3,Va=["http:","https:","mailto:"],Ga=/[\u0000-\u0020\u007f]/g;function Ya(e){if(Zt(e)||lt(e))return e;let t=e.replace(Ga,""),n=t.toLowerCase();return Va.some(o=>n.startsWith(o))?t:null}var Wn=class{constructor(t){this.src=t}src;exhausted=new Set;find(t,n){if(this.exhausted.has(t))return-1;let o=this.src.indexOf(t,n);return o===-1&&this.exhausted.add(t),o}},Ka=new Int32Array(0);function Xa(e){let t=[],n=[];for(let i=0;i<e.length;i+=1){if(e[i]!=="`")continue;let l=i;for(;i<e.length&&e[i]==="`";)i+=1;t.push(l),n.push(i)}let o=t.length,r=new Int32Array(o+1);for(let i=o-1;i>=0;i-=1)r[i]=Math.max(r[i+1],n[i]-t[i]);return{start:Int32Array.from(t),end:Int32Array.from(n),longestAfter:r,count:o}}function Za(e,t,n){let o=new Int32Array(n+1).fill(-1),r=Math.min(n,e.longestAfter[Math.min(t,e.count)]),i=0;for(let l=t;l<e.count&&i<r;l+=1){let c=Math.min(e.end[l]-e.start[l],r);for(let s=i+1;s<=c;s+=1)o[s]=e.start[l];c>i&&(i=c)}return o}function Po(e,t){if(!t)return;let n=e[e.length-1];n?.kind==="text"?n.text+=t:e.push({kind:"text",text:t})}function Qa(e,t,n){let o=n.find("]",t+1);if(o===-1||e[o+1]!=="(")return null;let r=n.find(")",o+2);if(r===-1)return null;let i=e.slice(t+1,o);return i.includes(`
|
|
14
|
+
`)?null:{label:i,url:e.slice(o+2,r).trim(),end:r+1}}function St(e){let t=[],n=new Wn(e),o=0,r=0,i=f=>{Po(t,e.slice(o,f))},l=null,c=0,s=-1,a=Ka;for(;r<e.length;){let f=e[r];if(f===`
|
|
15
|
+
`){i(r);let h=t[t.length-1];h?.kind==="text"&&(h.text=h.text.replace(/[ \t]+$/,""),h.text||t.pop()),t.push({kind:"break"}),r+=1,o=r;continue}if(f==="`"){if(r>=s){for(l??=Xa(e);c<l.count&&l.end[c]<=r;)c+=1;s=l.end[c],a=Za(l,c+1,s-r)}let h=s-r,w=a[h];if(w>s){i(r),t.push({kind:"code",text:e.slice(s,w).trim()}),r=w+h,o=r;continue}}if(f==="*"||f==="_"){let h=f==="*"&&e.startsWith("**",r),w=h?"**":f,x=n.find(w,r+w.length);if(x>r+w.length){let g=e.slice(r+w.length,x);if(!g.startsWith(" ")&&!g.endsWith(" ")){i(r);let y=St(g);t.push(h?{kind:"strong",children:y}:{kind:"em",children:y}),r=x+w.length,o=r;continue}}}if(f==="["){let h=Qa(e,r,n);if(h){i(r);let w=Ya(h.url);w?t.push({kind:"link",href:w,children:St(h.label)}):Po(t,e.slice(r,h.end)),r=h.end,o=r;continue}}r+=1}return i(e.length),t}var Mo=/^\s{0,3}```(.*)$/,es=/^\s{0,3}```\s*$/,Vn=/^\s{0,3}> ?(.*)$/,ts=/^\s*(?:>\s?)+/gm,_t=/^(\s*)(?:([-*])|(\d{1,9})[.)])\s+(.*)$/,rn=/^\s*$/,ns=e=>rn.test(e)||Mo.test(e)||Vn.test(e)||_t.test(e),Un=e=>({children:[{kind:"paragraph",children:St(e)}]});function rs(e,t){let n=_t.exec(e[t]),o=n[1].length,r=n[3]!==void 0,i=[],l=t;for(;l<e.length;){if(rn.test(e[l])){if(l+1>=e.length||!_t.test(e[l+1]))break;l+=1;continue}let c=_t.exec(e[l]);if(!c)break;let s=c[1].length,a=c[3]!==void 0;if(s>o&&i.length>0){let f=i[i.length-1],h=f.children[1];h?.kind==="list"?h.items.push(Un(c[4])):f.children.push({kind:"list",ordered:a,items:[Un(c[4])]}),l+=1;continue}if(a!==r)break;i.push(Un(c[4])),l+=1}return{list:{kind:"list",ordered:r,items:i},next:l}}function Ct(e,t=0){let n=e.replace(/\r\n?/g,`
|
|
16
16
|
`).split(`
|
|
17
|
-
`),o=[],r=0;for(;r<n.length;){let i=n[r];if(
|
|
18
|
-
`)});continue}if(Vn.test(i)){let s=[];for(;r<n.length&&!
|
|
19
|
-
`);o.push(t>=Wa?{kind:"paragraph",children:
|
|
17
|
+
`),o=[],r=0;for(;r<n.length;){let i=n[r];if(rn.test(i)){r+=1;continue}let l=Mo.exec(i);if(l){let s=[];for(r+=1;r<n.length&&!es.test(n[r]);)s.push(n[r]),r+=1;r<n.length&&(r+=1),o.push({kind:"code_block",lang:l[1].trim()||null,text:s.join(`
|
|
18
|
+
`)});continue}if(Vn.test(i)){let s=[];for(;r<n.length&&!rn.test(n[r]);){let f=Vn.exec(n[r]);if(!f)break;s.push(f[1]),r+=1}let a=s.join(`
|
|
19
|
+
`);o.push(t>=Wa?{kind:"paragraph",children:St(a.replace(ts,""))}:{kind:"quote",children:Ct(a,t+1)});continue}if(_t.test(i)){let s=rs(n,r);o.push(s.list),r=s.next;continue}let c=[i];for(r+=1;r<n.length&&!ns(n[r]);)c.push(n[r]),r+=1;o.push({kind:"paragraph",children:St(c.join(`
|
|
20
20
|
`))})}return o}function Oo(e){return e.map(t=>{switch(t.kind){case"text":return t.text;case"code":return t.text;case"break":return`
|
|
21
|
-
`;default:return Oo(t.children)}}).join("")}function
|
|
21
|
+
`;default:return Oo(t.children)}}).join("")}function on(e){return e.map(t=>{switch(t.kind){case"paragraph":return Oo(t.children);case"code_block":return t.text;case"quote":return on(t.children);case"list":return t.items.map(n=>on(n.children)).join(`
|
|
22
22
|
`)}}).filter(Boolean).join(`
|
|
23
23
|
`)}var os={bold:"**",italic:"_",code:"`"};function Lo(e,t,n,o){let r=Math.max(0,Math.min(t,e.length)),i=Math.max(r,Math.min(n,e.length)),l=e.slice(r,i);if(o==="link"){let f=l||"text",h=r+f.length+3;return{text:`${e.slice(0,r)}[${f}](url)${e.slice(i)}`,start:h,end:h+3}}if(o==="list"){let f=e.lastIndexOf(`
|
|
24
24
|
`,r-1)+1,h=e.indexOf(`
|
|
25
|
-
`,i),w=h===-1?e.length:h,
|
|
26
|
-
`).map(
|
|
27
|
-
`);return{text:`${e.slice(0,f)}${y}${e.slice(w)}`,start:f,end:f+y.length}}let c=os[o],s=e.slice(0,r),a=e.slice(i);return s.endsWith(c)&&a.startsWith(c)?{text:`${s.slice(0,s.length-c.length)}${l}${a.slice(c.length)}`,start:r-c.length,end:i-c.length}:{text:`${s}${c}${l}${c}${a}`,start:r+c.length,end:i+c.length}}var No=["blue","violet","teal","amber","rose","slate"];function at(e){let t=0;for(let n of e)t=t*31+n.charCodeAt(0)>>>0;return No[t%No.length]}var Je={blue:"light-dark(#1d4ed8, #93c5fd)",violet:"light-dark(#6d28d9, #c4b5fd)",teal:"light-dark(#0f766e, #5eead4)",amber:"light-dark(#92400e, #fcd34d)",rose:"light-dark(#be185d, #f9a8d4)",slate:"light-dark(#475569, #cbd5e1)"};function is(e){let t=0;for(let n=0;n<e.length;n+=1)t=(t*31+e.charCodeAt(n))%360;return t}var as=55,ss=30,Do=e=>`hsl(${is(e)} ${as}% ${ss}%)`,Fo=e=>(e?.trim()[0]??"?").toUpperCase();var ls=v('<img alt class="absolute inset-0 size-full object-cover">'),cs=v('<span aria-hidden=true class="relative block shrink-0 overflow-hidden rounded-full"><span data-face-initial class="flex size-full items-center justify-center font-semibold leading-none text-white">');function jo(e){let[t,n]=N(null),o=()=>e.image&&/^(https?:\/\/|\/|data:image\/)/.test(e.image)?e.image:null;return(()=>{var r=cs(),i=r.firstChild;return m(i,()=>Fo(e.initial)),m(r,d(T,{get when(){return Y(()=>!!o())()&&t()!==o()},get children(){var l=ls();return l.addEventListener("error",()=>n(o())),H(()=>M(l,"src",o())),l}}),null),H(l=>{var c=e.size?`${e.size}px`:"100%",s=e.size?`${e.size}px`:"100%",a=Do(e.userId),f=e.size?`${Math.round(e.size*.42)}px`:void 0;return c!==l.e&&se(r,"width",l.e=c),s!==l.t&&se(r,"height",l.t=s),a!==l.a&&se(i,"background-color",l.a=a),f!==l.o&&se(i,"font-size",l.o=f),l},{e:void 0,t:void 0,a:void 0,o:void 0}),r})()}var ds=v('<svg><path clip-rule=evenodd d="M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z">'),us=v('<svg><path d="M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z">'),ms=v('<svg><path d="M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z">'),fs=v('<svg><path d="M9.064 3.344a4.578 4.578 0 012.285-.312c1 .115 1.891.54 2.673 1.275.01.01.024.017.037.021a.09.09 0 00.043 0 4.55 4.55 0 013.046.275l.047.022.116.057a4.581 4.581 0 012.188 2.399c.209.51.313 1.041.315 1.595a4.24 4.24 0 01-.134 1.223.123.123 0 00.03.115c.594.607.988 1.33 1.183 2.17.289 1.425-.007 2.71-.887 3.854l-.136.166a4.548 4.548 0 01-2.201 1.388.123.123 0 00-.081.076c-.191.551-.383 1.023-.74 1.494-.9 1.187-2.222 1.846-3.711 1.838-1.187-.006-2.239-.44-3.157-1.302a.107.107 0 00-.105-.024c-.388.125-.78.143-1.204.138a4.441 4.441 0 01-1.945-.466 4.544 4.544 0 01-1.61-1.335c-.152-.202-.303-.392-.414-.617a5.81 5.81 0 01-.37-.961 4.582 4.582 0 01-.014-2.298.124.124 0 00.006-.056.085.085 0 00-.027-.048 4.467 4.467 0 01-1.034-1.651 3.896 3.896 0 01-.251-1.192 5.189 5.189 0 01.141-1.6c.337-1.112.982-1.985 1.933-2.618.212-.141.413-.251.601-.33.215-.089.43-.164.646-.227a.098.098 0 00.065-.066 4.51 4.51 0 01.829-1.615 4.535 4.535 0 011.837-1.388zm3.482 10.565a.637.637 0 000 1.272h3.636a.637.637 0 100-1.272h-3.636zM8.462 9.23a.637.637 0 00-1.106.631l1.272 2.224-1.266 2.136a.636.636 0 101.095.649l1.454-2.455a.636.636 0 00.005-.64L8.462 9.23z"fill=url(#mx-codex-grad)></path><defs><linearGradient gradientUnits=userSpaceOnUse id=mx-codex-grad x1=12 x2=12 y1=3 y2=21><stop stop-color=#B1A7FF></stop><stop offset=.5 stop-color=#7A9DFF></stop><stop offset=1 stop-color=#3941FF>');var on=({size:e=16,className:t})=>({viewBox:"0 0 24 24",width:e,height:e,"aria-hidden":!0,class:t});function Ho(e){return(()=>{var t=ds();return He(t,G(()=>on(e),{fill:"#D97757","fill-rule":"evenodd"}),!0,!0),t})()}function qo(e){return(()=>{var t=us();return He(t,G(()=>on(e),{fill:"#D97757","fill-rule":"nonzero"}),!0,!0),t})()}function zo(e){return(()=>{var t=ms();return He(t,G(()=>on(e),{fill:"currentColor","fill-rule":"evenodd"}),!0,!0),t})()}function Jo(e){return(()=>{var t=fs();return He(t,G(()=>on(e)),!0,!0),t})()}var hs=Le({session:()=>null,reload:()=>{},pages:null,sessionError:()=>null});var Gn=()=>Fe(hs);var gs=Le();function an(){return Fe(gs)}var ps=v("<span aria-hidden=true>\u2726"),Bo=v("<span>"),bs=v('<span class="inline-flex h-[22px] w-[22px] shrink-0 rounded-full">'),vs=v('<span class="shrink-0 font-mono text-[9px] uppercase tracking-[0.08em] text-faint">\xB7 '),ys=v('<span class="flex min-w-0 items-center gap-2">'),xs=v('<a class="pointer-events-auto truncate text-[11px] font-semibold text-fg underline-offset-2 hover:text-accent hover:underline">'),ws=v('<a target=_blank rel="noopener noreferrer"class="truncate text-[11px] font-semibold">@'),ks=v('<span class="flex shrink-0 -space-x-1 [&>*]:ring-1 [&>*]:ring-raised">'),$s=v('<span class="flex min-w-0 items-center gap-1.5"><span class=truncate>'),Es=v("<time tabindex=0> \xB7 "),_s=v('<span aria-label="Unread reply"class="pointer-events-none absolute right-0 top-0 z-10 h-2 w-2 rounded-full bg-accent">'),Cs=v('<span aria-label=Resolved class="pointer-events-none absolute bottom-0 right-0 z-10 text-xs text-accent">\u2713'),Ss=v('<span class="absolute right-2 top-1 text-[10px] text-muted"> agents'),Rs=v('<span role=status class="sr-only motion-reduce:not-sr-only">Resolved \xB7 <!> seconds'),Ts=v('<svg aria-hidden=true class="pointer-events-none absolute -left-1 -top-1 h-[30px] w-[30px] motion-reduce:hidden"viewBox="0 0 40 40"><circle cx=20 cy=20 r=18 fill=none stroke=currentColor stroke-width=2 pathLength=100 transform="rotate(-90 20 20)">'),As=v('<span data-thread-count aria-hidden=true class="absolute right-1.5 top-1/2 -translate-y-1/2 font-mono text-[9px] font-bold leading-none text-fg">'),Is=v('<span class="pointer-events-none absolute inset-0 flex items-center justify-start pl-[7px]"><span class="relative flex h-[22px] w-[22px] shrink-0 items-center justify-center">'),Ps=v('<button type=button aria-label="Expand replies"class="pointer-events-auto cursor-pointer rounded-sm text-left hover:text-accent focus-visible:outline-2 focus-visible:outline-accent">'),Ms=v('<span role=list aria-label="Thread replies"class="pointer-events-auto mt-2 flex flex-col gap-3 border-t border-edge pt-2">'),Os=v('<span class="pointer-events-none relative z-10 flex h-full animate-[rise_.12s_ease-out] flex-col"><span class="flex items-center justify-between gap-2"></span><span class="mt-1.5 line-clamp-2 block font-sans text-sm leading-snug text-fg/90"></span><span class="mt-auto flex items-center justify-between font-mono text-[10px] text-faint"><span class="transition-colors group-hover:text-accent">open \u2192'),Ls=v('<article style="position:fixed;right:12px;max-width:calc(100vw - 24px)"><button type=button class="absolute inset-0 z-0 cursor-pointer focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-accent">'),Ns=v("<span class=sr-only>"),Ds=v('<span role=listitem class=block><span class="mt-1 block whitespace-pre-wrap break-words font-sans text-sm leading-snug text-fg/90">'),Fs=36,js=44,Hs=48,cn=36,Uo=108,qs=6,st=12,Yn=Le(!1),Ct=e=>rn(_t(e)),Kn=e=>Ct(e).split(`
|
|
28
|
-
`,1)[0]??"",Ke=e=>e.label?.trim()||(e.kind==="human"?"You":"Agent"),zs=e=>`${e.kind}:${Ke(e).toLowerCase()}`;function Js(e){let t=new Set;return e.slice(1).flatMap(({author:n})=>{let o=zs(n);return t.has(o)?[]:(t.add(o),[n])})}function Xn(e){let t=()=>Ke(e.author);return d(jo,{get image(){return e.author.image??null},get initial(){return t()},get userId(){return e.author.user_id??`label:${t()}`},get size(){return e.size}})}function Zn(e){let t=()=>{switch(e.label.toLowerCase()){case"codex":return d(Jo,{get size(){return e.compact?13:17}});case"chatgpt":return d(zo,{get size(){return e.compact?12:16}});case"claude code":return d(Ho,{get size(){return e.compact?12:16}});case"claude":return d(qo,{get size(){return e.compact?12:16}});default:return(()=>{var n=ps();return H(()=>de(n,`${e.compact?"text-[10px]":"text-[12px]"} leading-none text-accent`)),n})()}};return(()=>{var n=Bo();return m(n,t),H(o=>{var r=e.decorative?void 0:`${e.label} agent`,i=e.decorative||void 0,l=`inline-flex shrink-0 items-center justify-center rounded-full bg-surface text-fg ${e.borderless?"":"border border-edge"} ${e.compact?"h-[18px] w-[18px]":"h-[22px] w-[22px]"}`;return r!==o.e&&M(n,"aria-label",o.e=r),i!==o.t&&M(n,"aria-hidden",o.t=i),l!==o.a&&de(n,o.a=l),o},{e:void 0,t:void 0,a:void 0}),n})()}function sn(e){let t=()=>Ke(e.author),n=Fe(Yn);return(()=>{var o=ys();return m(o,d(T,{get when(){return e.author.kind==="human"},get fallback(){return d(Zn,{get label(){return t()}})},get children(){var r=bs();return m(r,d(Xn,{get author(){return e.author},size:22})),H(()=>M(r,"aria-label",`${t()} avatar`)),r}}),null),m(o,d(T,{get when(){return e.author.sessionId},get fallback(){return d(T,{get when(){return e.author.kind==="human"&&e.author.label&&!n},get fallback(){return(()=>{var r=Bo();return m(r,t),H(()=>de(r,`truncate text-[11px] font-semibold ${e.author.kind==="agent"?"text-accent":"text-fg"}`)),r})()},get children(){var r=xs();return m(r,t),H(i=>{var l=`/@${encodeURIComponent(e.author.label)}`,c=`View @${e.author.label} profile`;return l!==i.e&&M(r,"href",i.e=l),c!==i.t&&M(r,"aria-label",i.t=c),i},{e:void 0,t:void 0}),r}})},children:r=>(()=>{var i=ws(),l=i.firstChild;return m(i,t,null),H(c=>{var s=`/chat?session=${r()}`,a=Je[e.author.color??at(r())];return s!==c.e&&M(i,"href",c.e=s),a!==c.t&&se(i,"color",c.t=a),c},{e:void 0,t:void 0}),i})()}),null),m(o,d(T,{get when(){return Y(()=>e.author.kind==="agent")()&&e.author.transport!=="unknown"},get children(){var r=vs(),i=r.firstChild;return m(r,()=>e.author.transport,null),H(()=>M(r,"aria-label",`Transport ${e.author.transport.toUpperCase()}`)),r}}),null),o})()}function Bs(e){return d(T,{get when(){return e.author.kind==="agent"},get fallback(){return d(Xn,{get author(){return e.author},size:18})},get children(){return d(Zn,{get label(){return Ke(e.author)},compact:!0,decorative:!0})}})}function ln(e){let t=()=>Math.max(0,e.thread.length-1),n=()=>Js(e.thread);return(()=>{var o=$s(),r=o.firstChild;return m(o,d(T,{get when(){return n().length>0},get children(){var i=ks();return m(i,d(ge,{get each(){return n().slice(0,3)},children:l=>d(Bs,{author:l})})),H(()=>M(i,"aria-label",`Reply participants: ${n().map(Ke).join(", ")}`)),i}}),r),m(r,(()=>{var i=Y(()=>t()>0);return()=>i()?`+${t()} more`:"1 message"})()),o})()}function Us(e){return d(T,{get when(){return e.author.kind==="agent"},get fallback(){return d(Xn,{get author(){return e.author},size:22})},get children(){return d(Zn,{get label(){return Ke(e.author)},compact:!0,decorative:!0,borderless:!0})}})}function Qn(e){let t=()=>new Date(e.iso),n=()=>!Number.isNaN(t().getTime()),o=()=>t().toLocaleDateString("en-GB",{day:"numeric",month:"short",...t().getFullYear()!==new Date().getFullYear()?{year:"numeric"}:{}}),r=()=>t().toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),i=()=>t().toLocaleString(void 0,{year:"numeric",month:"long",day:"numeric",weekday:"long",hour:"numeric",minute:"2-digit",second:"2-digit",timeZoneName:"long"});return d(T,{get when(){return n()},get children(){return d($e,{get content(){return i()},get children(){var l=Es(),c=l.firstChild;return m(l,o,c),m(l,r,null),H(s=>{var a=e.iso,f=i(),h=e.class;return a!==s.e&&M(l,"datetime",s.e=a),f!==s.t&&M(l,"aria-label",s.t=f),h!==s.a&&de(l,s.a=h),s},{e:void 0,t:void 0,a:void 0}),l}})}})}function Wo(e,t,n,o){let r=e.flatMap(f=>{let h=t[f.id];return!h||h.y+h.height<0||h.y>n.height?[]:[{annotation:f,target:n.top+h.y}]}).sort((f,h)=>f.target-h.target);if(!r.length)return[];let i=n.top+st,l=i,c=r.map(({annotation:f,target:h})=>{let w=Math.max(h,l);return l=w+cn+qs,{annotation:f,top:w}}),s=c.at(-1).top+Uo+st-o,a=Math.max(0,Math.min(s,c[0].top-i));return a>0?c.map(f=>({...f,top:f.top-a})):c}var Ws=["queued","dispatching","delivered","acknowledged"];function Vo(e){let[t,n]=N(!1),[o,r]=N();Q(()=>{if(!e.hovered){n(!1);return}let g=o();if(!g)return;let C,b=()=>{clearTimeout(C)},L=()=>{b(),C=setTimeout(()=>n(!0),600)};g.addEventListener("mouseenter",L),g.addEventListener("mouseleave",b),K(()=>{b(),g.removeEventListener("mouseenter",L),g.removeEventListener("mouseleave",b)})});let i=()=>e.row.thread[0],l=()=>i()?Ke(i().author):"Unknown",c=()=>e.row.thread.length,s=()=>(e.row.remote_work??[]).filter((g,C,b)=>!b.slice(C+1).some(L=>L.sessionId===g.sessionId)),a=()=>s().filter(g=>g.connection==="online"&&Ws.includes(g.phase)&&g.activity!=="unknown"),f=()=>a().at(-1)??s().at(-1),h=an(),w=()=>h?.state()?.notifications.some(g=>!g.read_at&&g.source===`comment:${e.row.id}`),y=()=>a().length>0,p=()=>c()>9?Hs:c()>1?js:Fs,x=()=>e.hovered?"5px":"50% 50% 50% 3px";return(()=>{var g=Ls(),C=g.firstChild;return g.$$focusout=b=>{b.currentTarget.contains(b.relatedTarget)||e.onHover(null)},g.$$focusin=()=>e.onHover(e.row.id),g.addEventListener("mouseleave",()=>e.onHover(null)),g.addEventListener("mouseenter",()=>e.onHover(e.row.id)),C.$$click=()=>e.onOpen(),m(g,d(T,{get when(){return w()},get children(){return _s()}}),null),m(g,d(T,{get when(){return e.row.status==="resolved"},get children(){return Cs()}}),null),m(g,d(T,{get when(){return f()},children:b=>(()=>{var L=Ns();return m(L,()=>Zt(b()),null),m(L,(()=>{var S=Y(()=>s().length>1);return()=>S()?` \xB7 ${s().length} agents`:null})(),null),L})()}),null),m(g,d(T,{get when(){return Y(()=>!!e.hovered)()&&s().length>1},get children(){var b=Ss(),L=b.firstChild;return m(b,()=>s().length,L),b}}),null),m(g,d(T,{get when(){return e.remaining!==void 0},get children(){var b=Rs(),L=b.firstChild,S=L.nextSibling,E=S.nextSibling;return m(b,()=>Math.ceil((e.remaining??0)/1e3),S),b}}),null),m(g,d(T,{get when(){return Y(()=>!!i())()&&!e.hovered},get children(){var b=Is(),L=b.firstChild;return m(L,d(T,{get when(){return e.remaining!==void 0},get children(){var S=Ts(),E=S.firstChild;return H(()=>M(E,"stroke-dasharray",`${(e.remaining??0)/100} 100`)),S}}),null),m(L,d(Us,{get author(){return i().author}}),null),m(b,d(T,{get when(){return c()>1},get children(){var S=As();return m(S,(()=>{var E=Y(()=>c()>9);return()=>E()?"9+":c()})()),S}}),null),b}}),null),m(g,d(T,{get when(){return Y(()=>!!i())()&&e.hovered},get children(){var b=Os(),L=b.firstChild,S=L.nextSibling,E=S.nextSibling,O=E.firstChild;return m(L,d(sn,{get author(){return i().author}}),null),m(L,d(Qn,{get iso(){return i().created_at},class:"font-mono text-[10px] text-faint"}),null),m(S,()=>Ct(i().body)),m(E,d(T,{get when(){return c()>1},get fallback(){return d(ln,{get thread(){return e.row.thread}})},get children(){var U=Ps();return U.$$click=()=>n(!0),xe(r,U),m(U,d(ln,{get thread(){return e.row.thread}})),H(()=>M(U,"aria-expanded",t())),U}}),O),m(b,d(T,{get when(){return t()},get children(){var U=Ms();return m(U,d(ge,{get each(){return e.row.thread.slice(1)},children:k=>(()=>{var $=Ds(),A=$.firstChild;return m($,d(sn,{get author(){return k.author}}),A),m(A,()=>Ct(k.body)),$})()})),U}}),null),b}}),null),H(b=>{var L=e.row.id,S=e.hovered?"true":void 0,E=`${y()?"motion-safe:animate-pulse":""} group pointer-events-auto overflow-hidden border text-left shadow-md transition-[top,width,height,border-color,background-color,box-shadow] duration-150 ${e.hovered?"z-10 border-edge-bright bg-comment-hover px-3 py-2.5 shadow-xl":"border-transparent bg-raised hover:bg-raised"}`,O=f()?`2px solid ${Je[f().color]}`:void 0,U=`${e.top}px`,k=`${e.hovered?288:p()}px`,$=e.hovered?t()?"auto":`${Uo}px`:`${cn}px`,A=e.hovered&&t()?`calc(100dvh - ${e.top+st}px)`:void 0,R=e.hovered&&t()?"auto":void 0,I=x(),q=`Open annotation conversation by ${l()}, ${c()} message${c()===1?"":"s"}`,W=x();return L!==b.e&&M(g,"data-annotation-id",b.e=L),S!==b.t&&M(g,"data-hovered",b.t=S),E!==b.a&&de(g,b.a=E),O!==b.o&&se(g,"outline",b.o=O),U!==b.i&&se(g,"top",b.i=U),k!==b.n&&se(g,"width",b.n=k),$!==b.s&&se(g,"height",b.s=$),A!==b.h&&se(g,"max-height",b.h=A),R!==b.r&&se(g,"overflow-y",b.r=R),I!==b.d&&se(g,"border-radius",b.d=I),q!==b.l&&M(C,"aria-label",b.l=q),W!==b.u&&se(C,"border-radius",b.u=W),b},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0}),g})()}pe(["focusin","focusout","click"]);var Vs=v('<div class="flex flex-col gap-2.5">'),Gs=v('<aside data-capture-chrome aria-label="Annotation sidebar"class="fixed bottom-0 z-20 flex flex-col gap-2.5 border-l border-edge bg-bg p-2.5"><div class=shrink-0></div><div class="flex min-h-0 flex-1 flex-col gap-2.5 overflow-y-auto">'),Ys=v('<section data-capture-chrome aria-label="Annotation sidebar"class="flex min-h-0 flex-1 flex-col gap-2.5 bg-bg p-2.5"><div class=shrink-0></div><div class="flex min-h-0 flex-1 flex-col gap-2.5 overflow-y-auto">');function Go(e){let t=()=>e.busy||void 0;return d(T,{get when(){return!e.phone},get fallback(){return d(qn,{label:"Annotation sidebar",get onClose(){return e.onClose},size:"half",get header(){return e.header},get children(){var n=Vs();return m(n,()=>e.children),H(()=>M(n,"aria-busy",t())),n}})},get children(){return d(T,{get when(){return e.host},get fallback(){return(()=>{var n=Gs(),o=n.firstChild,r=o.nextSibling;return se(n,"width",`${320}px`),m(o,()=>e.header),m(r,()=>e.children),H(i=>{var l=t(),c=`${e.topOffset}px`,s=`${e.rightInset}px`;return l!==i.e&&M(n,"aria-busy",i.e=l),c!==i.t&&se(n,"top",i.t=c),s!==i.a&&se(n,"right",i.a=s),i},{e:void 0,t:void 0,a:void 0}),n})()},children:n=>d(nt,{get mount(){return n()},ref:o=>{o.style.display="contents"},get children(){var o=Ys(),r=o.firstChild,i=r.nextSibling;return m(r,()=>e.header),m(i,()=>e.children),H(()=>M(o,"aria-busy",t())),o}})})}})}var Ks=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],dn=e=>d(re,G(e,{iconNode:Ks,name:"chevron-down"}));var Xs=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Yo=e=>d(re,G(e,{iconNode:Xs,name:"chevron-right"}));var Zs=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],Ko=e=>d(re,G(e,{iconNode:Zs,name:"ellipsis-vertical"}));var Qs=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Xo=e=>d(re,G(e,{iconNode:Qs,name:"trash-2"}));var el=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],Zo=e=>d(re,G(e,{iconNode:el,name:"bold"}));var tl=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Qo=e=>d(re,G(e,{iconNode:tl,name:"code"}));var nl=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],ei=e=>d(re,G(e,{iconNode:nl,name:"italic"}));var rl=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],ti=e=>d(re,G(e,{iconNode:rl,name:"link-2"}));var ol=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],ni=e=>d(re,G(e,{iconNode:ol,name:"list"}));function lt(e){let t=[],n="",o=0;for(let c of[...kt(e),...Io(e)].sort((s,a)=>s.index-a.index)){n+=e.slice(o,c.index);let s=n.length;n+=c[1],o=c.index+c[0].length,t.push({start:c.index,end:o,from:s,to:n.length})}n+=e.slice(o);let r=(c,s="start")=>{let a=0;for(let f of t){if(c<=f.from)break;if(c<f.to)return s==="start"?f.start:f.end;a+=f.end-f.start-(f.to-f.from)}return c+a};return{text:n,toRaw:r,toDisplay:c=>{let s=0;for(let a of t){if(c<=a.start)break;if(c<a.end)return a.from+Math.min(c-a.start,a.to-a.from);s+=a.end-a.start-(a.to-a.from)}return c-s},edit:(c,s)=>{if(c===n)return e;let a=0,f=0;for(;a<s&&a<n.length&&n[a]===c[a];)a++;for(;f<c.length-s&&f<n.length-a&&n[n.length-f-1]===c[c.length-f-1];)f++;let h=n.length-f,w=c.slice(a,c.length-f),y=t.find(x=>a>x.from&&a<x.to),p=t.find(x=>h>x.from&&h<x.to);return y&&(w=n.slice(y.from,a)+w,a=y.from),p&&(w+=n.slice(h,p.to),h=p.to),e.slice(0,r(a))+w+e.slice(r(h,"end"))}}}var il=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],ri=e=>d(re,G(e,{iconNode:il,name:"copy"}));var al=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],oi=e=>d(re,G(e,{iconNode:al,name:"plus"}));function sl(e){if(typeof document>"u"||typeof document.execCommand!="function")return!1;let t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.cssText="position:fixed;top:0;left:0;opacity:0;pointer-events:none",document.body.appendChild(t);try{return t.select(),document.execCommand("copy")}catch{return!1}finally{t.remove()}}async function ii(e){try{if(typeof navigator<"u"&&typeof navigator.clipboard?.writeText=="function")return await navigator.clipboard.writeText(e),!0}catch{}return sl(e)}var ll=v('<p class="px-2 py-1.5 text-xs text-muted">Mention a person'),cl=v('<p role=note class="px-2 py-1 text-xs text-muted">'),dl=v('<p role=alert class="px-2 py-1.5 text-sm text-muted">'),ul=v('<button type=button class="mt-1 flex w-full cursor-pointer items-center gap-2 rounded-md border border-edge bg-bg px-2 py-2 text-left text-xs font-medium text-fg transition-colors hover:bg-accent-soft focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent">Add another agent'),ml=v('<p role=note class="px-2 py-1.5 text-xs text-muted">'),fl=v("<p>"),hl=v("<p class=mt-2>Ask your agent to connect:"),gl=v('<button type=button aria-label="Copy connection request"class="shrink-0 cursor-pointer rounded-md p-1 text-muted hover:text-fg">'),pl=v('<div class="mt-2 flex items-start gap-2 rounded-md border border-edge bg-bg p-2"><p class="min-w-0 flex-1 text-xs text-fg">Connect to afbin remote so I can @mention you in artifact comments.'),bl=v('<p role=status class="mt-1 text-xs">'),vl=v('<div class="px-2 py-1.5 text-muted">'),yl=v('<div aria-label="Agent sessions"class="mb-2 overflow-hidden rounded-lg border border-edge bg-surface p-1.5 text-sm shadow-lg"><p class="px-2 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted">Mention an agent'),xl=v('<button type=button>@<span class="ml-2 text-xs text-muted">'),wl=v('<p class="px-2 py-1 text-xs text-muted">No matching followers or members.'),kl=v('<button type=button class="rounded-md p-2 text-muted hover:text-fg disabled:opacity-40">'),$l=v('<div class="flex items-center"><button type=button><span aria-hidden=true class="flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-accent-soft font-semibold text-accent">@</span><span class="min-w-0 flex-1"><span class="block truncate font-medium text-fg"></span><span class="block truncate text-xs text-muted"> \xB7 </span></span><span class="flex shrink-0 items-center gap-1 text-[10px] text-muted"><span>'),El="Connect to afbin remote so I can @mention you in artifact comments.",_l=e=>({claude:"Claude Code",codex:"Codex",pi:"Pi",opencode:"OpenCode"})[e]??e;function ai(e){let[t,n]=N([]),[o,r]=N([]),[i,l]=N(0),[c,s]=N(!1),[a,f]=N(!1),[h,w]=N("idle"),[y,p]=N(""),[x,g]=N(null),C=e.backend.unavailable("remoteSessions"),b=e.backend.unavailable("mentions"),L=()=>t().filter($=>!$.runId&&($.managed?$.exitCode===null&&$.activity!=="stopped":$.online)&&`${$.name} ${$.harness}`.toLowerCase().includes(e.query.toLowerCase())),S=$=>e.onSelect(Qt($)),E={keyDown($){let A=o().length+L().length;if(!A)return!1;if($==="ArrowDown"||$==="ArrowUp")return l(R=>(R+($==="ArrowDown"?1:A-1))%A),!0;if($==="Enter"||$==="Tab"){let R=i()%A,I=o()[R];if(I)e.onSelect(Bn(I));else{let q=L()[R-o().length];q&&S(q)}return!0}return!1}};ye(()=>{if(e.onReady?.(E),K(()=>e.onReady?.(null)),C)return;let $=new AbortController;e.backend.remoteSessions({signal:$.signal}).then(A=>{n(A.sessions??[]),s(!0)}).catch(()=>s(!0)),K(()=>$.abort())}),Q(()=>{let $=e.query;if(l(0),!e.artifactId||b)return;let A=new AbortController;e.backend.members($,{signal:A.signal}).then(R=>R??{people:[]}).then(R=>r(R.people??[])).catch(()=>{}),K(()=>A.abort())});let O=async $=>{g($),p("");try{await e.backend.deleteRemoteSession($),n(A=>A.filter(R=>R.id!==$)),l(0)}catch(A){p(A instanceof Error?A.message:"Could not remove agent. Try again.")}finally{g(null)}},U=async()=>{w(await ii(El)?"copied":"error")},k=$=>$.preventDefault();return(()=>{var $=yl(),A=$.firstChild;return m($,d(T,{get when(){return e.artifactId},get children(){return[ll(),d(ge,{get each(){return o()},children:(R,I)=>(()=>{var q=xl(),W=q.firstChild,oe=W.nextSibling;return q.$$click=()=>e.onSelect(Bn(R)),q.addEventListener("mouseenter",()=>l(I())),q.$$mousedown=k,m(q,()=>R.username,oe),m(oe,()=>R.name),H(ae=>{var z=`Mention @${R.username}`,be=`block w-full rounded-md px-2 py-2 text-left ${I()===i()?"bg-accent-soft":"hover:bg-bg"}`;return z!==ae.e&&M(q,"aria-label",ae.e=z),be!==ae.t&&de(q,ae.t=be),ae},{e:void 0,t:void 0}),q})()}),d(T,{when:b,get fallback(){return d(T,{get when(){return!o().length},get children(){return wl()}})},get children(){var R=cl();return m(R,b),R}})]}}),A),m($,d(ge,{get each(){return L()},children:(R,I)=>(()=>{var q=$l(),W=q.firstChild,oe=W.firstChild,ae=oe.nextSibling,z=ae.firstChild,be=z.nextSibling,me=be.firstChild,le=ae.nextSibling,j=le.firstChild;return W.$$click=()=>S(R),W.$$mousedown=k,W.addEventListener("mouseenter",()=>l(I()+o().length)),m(z,()=>R.name),m(be,()=>_l(R.harness),me),m(be,()=>R.machine,null),m(le,(()=>{var P=Y(()=>!!R.online);return()=>P()?R.activity??"Online":"Offline"})(),null),m(q,d(T,{get when(){return!R.online},get children(){return d($e,{content:"Remove agent",get children(){var P=kl();return P.$$click=()=>{O(R.id)},P.$$mousedown=k,m(P,d(Ve,{size:14,"aria-hidden":"true"})),H(ie=>{var ee=`Remove ${R.name}`,ne=x()!==null;return ee!==ie.e&&M(P,"aria-label",ie.e=ee),ne!==ie.t&&(P.disabled=ie.t=ne),ie},{e:void 0,t:void 0}),P}})}}),null),H(P=>{var ie=`Mention ${R.name} (${R.harness})`,ee=`flex min-w-0 flex-1 items-center gap-2.5 rounded-md px-2 py-2 text-left transition-colors ${I()+o().length===i()?"bg-accent-soft":"hover:bg-bg"}`,ne=Je[R.color??at(R.id)],fe=`h-1.5 w-1.5 rounded-full ${R.online?"bg-green-500":"bg-muted"}`;return ie!==P.e&&M(W,"aria-label",P.e=ie),ee!==P.t&&de(W,P.t=ee),ne!==P.a&&se(oe,"color",P.a=ne),fe!==P.o&&de(j,P.o=fe),P},{e:void 0,t:void 0,a:void 0,o:void 0}),q})()}),null),m($,d(T,{get when(){return y()},get children(){var R=dl();return m(R,y),R}}),null),m($,d(T,{get when(){return Y(()=>!!c())()&&L().length>0},get children(){var R=ul(),I=R.firstChild;return R.$$click=()=>f(q=>!q),R.$$mousedown=k,m(R,d(oi,{size:14,"aria-hidden":"true"}),I),m(R,d(dn,{size:14,"aria-hidden":"true",get class(){return`ml-auto transition-transform ${a()?"rotate-180":""}`}}),null),H(()=>M(R,"aria-expanded",a())),R}}),null),m($,d(T,{when:C,get children(){var R=ml();return m(R,C),R}}),null),m($,d(T,{get when(){return!C&&(!L().length||a())},get children(){var R=vl();return m(R,d(T,{get when(){return!L().length},get children(){var I=fl();return m(I,()=>c()?"No matching agents.":"Loading sessions\u2026"),I}}),null),m(R,d(T,{get when(){return c()},get children(){return[hl(),(()=>{var I=pl(),q=I.firstChild;return m(I,d($e,{get content(){return h()==="copied"?"Copied":"Copy request"},get children(){var W=gl();return W.$$click=()=>{U()},W.$$mousedown=k,m(W,d(T,{get when(){return h()==="copied"},get fallback(){return d(ri,{size:14,"aria-hidden":"true"})},get children(){return d(bt,{size:14,"aria-hidden":"true"})}})),W}}),null),I})(),(()=>{var I=bl();return m(I,(()=>{var q=Y(()=>h()==="copied");return()=>q()?"Copied \u2014 paste into your agent.":h()==="error"?"Could not copy. Select and copy the request above.":""})()),I})()]}}),null),R}}),null),$})()}pe(["mousedown","click"]);var Cl=v('<span class="ml-1 text-xs text-muted-foreground"aria-label="Invitation pending">\xB7 Pending'),Sl=v("<a>"),si=Le(()=>({}));function li(e){let[t,n]=N({});return ye(()=>{let o=e.backend;if(!e.artifactId||!o||o.unavailable("mentions")||window.location.pathname.endsWith("/raw"))return;let r=new AbortController,i=()=>{o.members(void 0,{signal:r.signal}).then(c=>{c&&!r.signal.aborted&&n(c.mentions??{})}).catch(()=>{})};i();let l=setInterval(i,15e3);window.addEventListener("focus",i),K(()=>{r.abort(),clearInterval(l),window.removeEventListener("focus",i)})}),d(si.Provider,{value:t,get children(){return e.children}})}function ci(e){let t=Fe(si),n=()=>it(e.href)?t()[e.href.slice(8)]:void 0;return(()=>{var o=Sl();return m(o,()=>e.children,null),m(o,d(T,{get when(){return n()==="pending"},get children(){return Cl()}}),null),H(r=>{var i=e.href,l=e.class;return i!==r.e&&M(o,"href",r.e=i),l!==r.t&&de(o,r.t=l),r},{e:void 0,t:void 0}),o})()}var Rl=v("<br>"),Tl=v('<strong class="font-semibold text-fg">'),Al=v("<em class=italic>"),Il=v('<code class="break-all rounded-[3px] bg-raised px-1 py-0.5 font-mono text-[0.92em] text-fg">'),Pl=v('<a target=_blank rel="noopener noreferrer"data-agent-mention class="inline-flex max-w-full items-center rounded-md border border-accent/20 bg-accent-soft px-1.5 py-0.5 align-baseline text-[0.9em] font-medium text-accent no-underline hover:bg-accent/15 focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent">'),Ml=v('<a target=_blank rel="noopener noreferrer"class="break-words text-accent underline decoration-dotted underline-offset-2 hover:decoration-solid">'),Ol=v("<p class=leading-normal>"),Ll=v('<pre class="min-w-0 max-w-full overflow-x-auto rounded-[4px] border border-edge bg-raised p-2 font-mono text-[11px] leading-snug text-fg"><code>'),Nl=v('<li class="min-w-0 leading-normal">'),Dl=v('<ol class="min-w-0 pl-5 list-decimal marker:text-faint">'),Fl=v('<ul class="min-w-0 pl-5 list-disc marker:text-faint">'),jl=v('<blockquote class="min-w-0 border-l-2 border-edge pl-2.5 text-muted">'),Hl=v("<div data-markdown>"),ql=v("<button type=button>"),zl=v('<p class="mb-2 text-[10px] text-muted">Ctrl/\u2318 + Enter to send'),Jl=v('<div><div role=toolbar class="mb-1 flex items-center gap-0.5">'),Bl=v('<button type=button class="inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-[3px] text-muted hover:bg-surface hover:text-fg disabled:cursor-default disabled:opacity-40">'),Ul=v('<textarea class="mb-2 min-h-24 w-full resize-y rounded-md border border-edge bg-surface p-3 font-sans text-sm leading-relaxed placeholder:text-faint focus:border-accent focus:outline-none focus:ring-2 focus:ring-accent/10">');function ct(e){return d(ge,{each:e,children:t=>{switch(t.kind){case"text":return t.text;case"break":return Rl();case"strong":return(()=>{var n=Tl();return m(n,()=>ct(t.children)),n})();case"em":return(()=>{var n=Al();return m(n,()=>ct(t.children)),n})();case"code":return(()=>{var n=Il();return m(n,()=>t.text),n})();case"link":return it(t.href)?d(ci,{get href(){return t.href},class:"text-accent",get children(){return ct(t.children)}}):Xt(t.href)?d($e,{content:"Open agent session",get children(){var n=Pl();return m(n,()=>ct(t.children)),H(o=>{var r=t.href,i=Je[at(t.href.split("=")[1]??"")];return r!==o.e&&M(n,"href",o.e=r),i!==o.t&&se(n,"color",o.t=i),o},{e:void 0,t:void 0}),n}}):(()=>{var n=Ml();return m(n,()=>ct(t.children)),H(()=>M(n,"href",t.href)),n})()}}})}function tr(e){switch(e.kind){case"paragraph":return(()=>{var t=Ol();return m(t,()=>ct(e.children)),t})();case"code_block":return(()=>{var t=Ll(),n=t.firstChild;return m(n,()=>e.text),t})();case"list":{let t=()=>d(ge,{get each(){return e.items},children:n=>(()=>{var o=Nl();return m(o,d(ge,{get each(){return n.children},children:tr})),o})()});return e.ordered?(()=>{var n=Dl();return m(n,t),n})():(()=>{var n=Fl();return m(n,t),n})()}case"quote":return(()=>{var t=jl();return m(t,d(ge,{get each(){return e.children},children:tr})),t})()}}function nr(e){return(()=>{var t=Hl();return m(t,d(ge,{get each(){return _t(e.text)},children:tr})),H(n=>{var o=e.label,r=`flex min-w-0 flex-col gap-2 font-sans leading-normal text-fg/90 ${e.class??""}`;return o!==n.e&&M(t,"aria-label",n.e=o),r!==n.t&&de(t,n.t=r),n},{e:void 0,t:void 0}),t})()}var Wl={b:"bold",i:"italic",e:"code"},Vl=[{marker:"bold",label:"Bold",hint:"bold (\u2318B)",Icon:Zo},{marker:"italic",label:"Italic",hint:"italic (\u2318I)",Icon:ei},{marker:"code",label:"Code",hint:"code (\u2318E)",Icon:Qo},{marker:"link",label:"Link",hint:"link",Icon:ti},{marker:"list",label:"List",hint:"list",Icon:ni}];function un(e){let t,n=null,[o,r]=N(!1),i=()=>e.previewing??o(),l=p=>{e.onPreviewingChange?e.onPreviewingChange(p):r(p)},[c,s]=N(null),a=()=>!e.backend||!(e.backend.unavailable("remoteSessions")&&e.backend.unavailable("mentions")),f=(p,x)=>queueMicrotask(()=>{if(!t?.isConnected)return;let g=lt(e.value);t.focus(),t.setSelectionRange(g.toDisplay(p),g.toDisplay(x))}),h=p=>{if(!t)return;let x=lt(e.value),g=Lo(e.value,x.toRaw(t.selectionStart),x.toRaw(t.selectionEnd,"end"),p);e.onChange(g.text),f(g.start,g.end)},w=p=>{let x=c();if(!x)return;let g=x.start+p.length;e.onChange(e.value.slice(0,x.start)+p+e.value.slice(x.end)),s(null),f(g,g)};ye(()=>{e.autoFocus&&t?.focus()});let y=p=>{if(p.isComposing)return;if(c()&&!p.metaKey&&!p.ctrlKey){if(p.key==="Escape"){p.preventDefault(),p.stopPropagation(),s(null);return}if(n?.keyDown(p.key)){p.preventDefault(),p.stopPropagation();return}}if(!p.metaKey&&!p.ctrlKey)return;if(p.key==="Enter"){p.preventDefault(),e.onSubmit?.();return}let x=Wl[p.key.toLowerCase()];x&&(p.preventDefault(),h(x))};return(()=>{var p=Jl(),x=p.firstChild;return m(p,()=>e.children,x),m(x,d(ge,{each:Vl,children:g=>d($e,{get content(){return g.hint},get children(){var C=Bl();return C.$$click=()=>h(g.marker),C.$$mousedown=b=>b.preventDefault(),m(C,d(g.Icon,{size:13,strokeWidth:1.8})),H(b=>{var L=g.label,S=i();return L!==b.e&&M(C,"aria-label",b.e=L),S!==b.t&&(C.disabled=b.t=S),b},{e:void 0,t:void 0}),C}})}),null),m(x,d($e,{get content(){return i()?"back to writing":"preview markdown"},get children(){var g=ql();return g.$$click=()=>{s(null),l(!i())},g.$$mousedown=C=>C.preventDefault(),m(g,()=>i()?"edit":"preview"),H(C=>{var b=e.previewToggleLabel??"Preview comment",L=i(),S=`ml-auto cursor-pointer rounded-[3px] px-1.5 py-0.5 font-mono text-[10px] ${i()?"bg-accent-soft text-accent":"text-faint hover:bg-surface hover:text-fg"}`;return b!==C.e&&M(g,"aria-label",C.e=b),L!==C.t&&M(g,"aria-pressed",C.t=L),S!==C.a&&de(g,C.a=S),C},{e:void 0,t:void 0,a:void 0}),g}}),null),m(p,d(T,{get when(){return i()},get fallback(){return(()=>{var g=Ul();g.$$keydown=y,g.$$click=()=>s(null),g.$$input=b=>{let L=b.currentTarget.value,S=b.currentTarget.selectionStart,E=lt(e.value).edit(L,S),O=lt(E),U=L.slice(0,S).match(/(?:^|\s)@([^\s@\[\]]*)$/);s(a()&&e.backend&&U?{start:O.toRaw(S-U[1].length-1),end:O.toRaw(S,"end"),query:U[1]}:null),e.onChange(E)};var C=t;return typeof C=="function"?xe(C,g):t=g,H(b=>{var L=e.label,S=e.rows??3,E=e.placeholder;return L!==b.e&&M(g,"aria-label",b.e=L),S!==b.t&&M(g,"rows",b.t=S),E!==b.a&&M(g,"placeholder",b.a=E),b},{e:void 0,t:void 0,a:void 0}),H(()=>g.value=lt(e.value).text),g})()},get children(){return d(nr,{get text(){return e.value},get label(){return e.previewLabel??"Comment preview"},class:"mb-2 min-h-[3rem] w-full rounded-[4px] border border-edge bg-surface p-2 text-sm"})}}),null),m(p,d(T,{get when(){return Y(()=>!!(!i()&&c()))()&&e.backend},get children(){return d(ai,{get backend(){return e.backend},get artifactId(){return e.artifactId},get query(){return c().query},onSelect:w,onReady:g=>{n=g}})}}),null),m(p,d(T,{get when(){return Y(()=>!i())()&&!c()},get children(){var g=zl(),C=g.firstChild;return m(g,()=>a()?"Type @ to mention an agent \xB7 ":"",C),g}}),null),H(g=>{var C=`min-w-0 ${e.class??""}`,b=`${e.label} formatting`;return C!==g.e&&de(p,g.e=C),b!==g.t&&M(x,"aria-label",g.t=b),g},{e:void 0,t:void 0}),p})()}pe(["mousedown","click","input","keydown"]);var Gl=v('<button type=button class="mt-1 font-mono text-[10px] text-muted">'),Yl=v("<div class=min-w-0><div><div>");function di(e){let t,[n,o]=N({overflowing:!1,lines:0,maxHeight:0}),[r,i]=N(!1);Q(()=>{e.text,queueMicrotask(()=>{if(!t?.isConnected)return;let c=t.querySelector("p, li, pre")??t,s=Number.parseFloat(getComputedStyle(c).lineHeight)||20,a=ho(t.scrollHeight,s);o(f=>f.overflowing===a.overflowing&&f.lines===a.lines&&f.maxHeight===a.maxHeight?f:a)})});let l=()=>e.foldable&&n().overflowing&&!r();return(()=>{var c=Yl(),s=c.firstChild,a=s.firstChild,f=t;return typeof f=="function"?xe(f,a):t=a,m(a,d(nr,{get text(){return e.text}})),m(c,d(T,{get when(){return Y(()=>!!e.foldable)()&&n().overflowing},get children(){var h=Gl();return h.$$click=()=>i(w=>!w),m(h,(()=>{var w=Y(()=>!!l());return()=>w()?`show more (${n().lines} lines)`:"show less"})()),H(w=>{var y=l()?"Show whole comment":"Show less of comment",p=!l();return y!==w.e&&M(h,"aria-label",w.e=y),p!==w.t&&M(h,"aria-expanded",w.t=p),w},{e:void 0,t:void 0}),h}}),null),H(h=>{var w=l()?"clamped":void 0,y=l()?"overflow-hidden":void 0,p=l()?{"max-height":`${n().maxHeight}px`}:void 0;return w!==h.e&&M(s,"data-folded-body",h.e=w),y!==h.t&&de(s,h.t=y),h.a=et(s,p,h.a),h},{e:void 0,t:void 0,a:void 0}),c})()}pe(["click"]);var Kl=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],rr=e=>d(re,G(e,{iconNode:Kl,name:"arrow-up-right"}));var Xl=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],or=e=>d(re,G(e,{iconNode:Xl,name:"image"}));var Zl=v('<div class="flex justify-center bg-surface p-5 sm:p-8"><img alt="Full comment screenshot"class="h-auto max-h-[68dvh] max-w-full rounded-sm object-contain shadow-lg">'),Ql=v('<div class=mt-2><button type=button aria-label="Open comment screenshot"class="group block w-full overflow-hidden rounded-lg border border-edge bg-surface text-left transition-colors hover:border-accent/50"><img loading=lazy alt="Screenshot attached to comment"class="h-auto max-h-48 w-full object-contain"><span class="flex items-center gap-2 border-t border-edge px-3 py-2 text-xs font-medium text-muted group-hover:text-fg">Screenshot</span></button><dialog aria-label="Comment screenshot"class="m-auto max-h-[94dvh] w-[min(1100px,calc(100vw-24px))] overflow-auto rounded-2xl border border-edge bg-panel p-0 font-sans text-fg shadow-2xl backdrop:bg-black/50 backdrop:backdrop-blur-sm"><header class="flex items-center gap-3 border-b border-edge px-5 py-4"><span class="flex h-9 w-9 items-center justify-center rounded-lg bg-surface text-muted"></span><div class=flex-1><h2 class="text-sm font-semibold">Comment screenshot</h2><p class="mt-0.5 text-xs text-muted"></p></div><button type=button aria-label="Close screenshot"class="flex h-8 w-8 items-center justify-center rounded-lg text-muted hover:bg-surface hover:text-fg"></button></header><footer class="flex justify-end border-t border-edge px-5 py-3"><a target=_blank rel=noreferrer aria-label="Open screenshot at full size"class="inline-flex items-center gap-2 rounded-lg px-3 py-2 text-xs font-medium text-accent hover:bg-accent-soft">Open full size',!0,!1,!1);function ui(e){let t,[n,o]=N(!1);return(()=>{var r=Ql(),i=r.firstChild,l=i.firstChild,c=l.nextSibling,s=c.firstChild,a=i.nextSibling,f=a.firstChild,h=f.firstChild,w=h.nextSibling,y=w.firstChild,p=y.nextSibling,x=w.nextSibling,g=f.nextSibling,C=g.firstChild,b=C.firstChild;i.$$click=()=>{o(!0),t.showModal?.()},m(c,d(or,{size:13}),s),m(c,d(rr,{size:13,class:"ml-auto"}),null),a.addEventListener("close",()=>o(!1));var L=t;return typeof L=="function"?xe(L,a):t=a,m(h,d(or,{size:18})),m(p,()=>new Date(e.image.capturedAt).toLocaleString()),x.$$click=()=>t.close(),m(x,d(Ve,{size:18})),m(a,d(T,{get when(){return n()},get children(){var S=Zl(),E=S.firstChild;return H(O=>{var U=e.image.previewUrl,k=e.image.width,$=e.image.height;return U!==O.e&&M(E,"src",O.e=U),k!==O.t&&M(E,"width",O.t=k),$!==O.a&&M(E,"height",O.a=$),O},{e:void 0,t:void 0,a:void 0}),S}}),g),m(C,d(rr,{size:14}),null),H(S=>{var E=e.image.thumbnailUrl,O=e.image.width,U=e.image.height,k=e.image.previewUrl;return E!==S.e&&M(l,"src",S.e=E),O!==S.t&&M(l,"width",S.t=O),U!==S.a&&M(l,"height",S.a=U),k!==S.o&&M(C,"href",S.o=k),S},{e:void 0,t:void 0,a:void 0,o:void 0}),r})()}pe(["click"]);var ec=v('<button type=button class="-ml-1 inline-flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center rounded-[3px] text-faint hover:bg-raised hover:text-fg">'),tc=v('<div class="px-3 py-2"><div class="flex min-w-0 items-center gap-1.5"><span class="truncate font-mono text-[10px] text-faint">'),nc=v('<p class="border-b border-edge bg-surface/60 px-3 py-1.5 font-mono text-[10px] text-faint">Exact target is unavailable. This comment remains attached to its containing block.'),rc=v('<p class="mb-1 border-l-2 border-edge-bright pl-2 font-sans text-[12px] leading-snug text-fg/80">'),oc=v('<div class="border-b border-edge bg-surface/60 px-3 py-1.5"><p class="font-mono text-[10px] text-faint">This passage was removed from the document.'),ic=v('<div class="border-b border-edge bg-surface/60 px-3 py-1.5"><p class="mb-1 border-l-2 border-edge-bright pl-2 font-sans text-[12px] leading-snug text-fg/80"></p><p class="font-mono text-[10px] text-faint">These words have since been edited.'),ac=v('<ul class="flex flex-col gap-3 px-3 py-3">'),sc=v('<button type=button class="flex w-full cursor-pointer items-center justify-between gap-2 border-t border-edge px-3 py-1.5 font-mono text-[10px] text-faint transition-colors hover:bg-raised hover:text-accent"><span class=shrink-0>open \u2192'),lc=v('<p role=alert class="text-xs text-red-500">'),cc=v('<div class="border-t border-edge px-3 py-2"><div class="flex justify-end gap-2"><button type=button aria-label="Cancel reply"class="cursor-pointer rounded-[4px] bg-transparent px-2 py-1 text-muted hover:bg-surface hover:text-fg">cancel</button><button type=button aria-label="Send reply"class="cursor-pointer rounded-[4px] border border-accent bg-accent px-2 py-1 font-semibold text-bg hover:brightness-110 disabled:cursor-default disabled:opacity-40">reply'),dc=v('<div class="flex justify-end border-t border-edge px-3 py-2"><button type=button aria-label="Reopen annotation"class="cursor-pointer rounded-[4px] border border-edge bg-raised px-2 py-1 text-muted hover:text-accent">\u21BA reopen'),uc=v("<div>"),mc=v('<p class="mt-1 truncate font-sans leading-snug text-fg/90">'),fc=v('<p class="mt-1 font-mono text-[10px] text-faint">'),hc=v('<p role=status class="flex items-center gap-1.5 border-b border-edge px-3 py-1.5 text-[11px] text-muted"><a target=_blank rel="noopener noreferrer">@</a><span>'),gc=v('<span class="inline-flex h-5 w-5 items-center justify-center text-accent">'),pc=v('<button type=button aria-label="Resolve annotation"class="inline-flex h-5 w-5 cursor-pointer items-center justify-center rounded-[3px] text-muted hover:bg-accent-soft hover:text-accent disabled:cursor-default disabled:opacity-40">'),bc=v('<button type=button aria-label="Hide resolved conversation"aria-expanded=true class="cursor-pointer rounded-[3px] px-1 font-mono text-[11px] text-faint hover:bg-raised hover:text-accent">\u2191'),vc=v('<button type=button aria-label="Annotation actions"class="inline-flex h-5 w-5 cursor-pointer items-center justify-center rounded-[3px] text-faint hover:bg-raised hover:text-fg">'),yc=v('<div role=menu aria-label="Annotation action menu"class="absolute right-0 top-6 z-20 min-w-24 rounded-[5px] border border-edge-bright bg-surface p-1 shadow-lg"><button type=button role=menuitem aria-label="Delete annotation"class="flex w-full cursor-pointer items-center gap-2 rounded-[3px] px-2 py-1.5 text-left font-mono text-[11px] text-danger hover:bg-raised disabled:cursor-default disabled:opacity-40">delete'),xc=v("<div class=relative>"),wc=v('<p class="truncate font-sans leading-snug text-fg/90">'),kc=v('<span data-notification-read-point class="block h-px"aria-hidden=true>'),$c=v('<li class="scroll-mb-14 sm:scroll-mb-0"><div class="mb-1.5 flex min-w-0 items-center gap-2"><span>'),Ec=v('<p class="line-clamp-2 font-sans leading-snug text-fg/90">'),_c="rounded-[6px] border border-edge bg-comment text-sm";function mi(e){return(()=>{var t=ec();return t.$$click=()=>e.onToggle(),m(t,d(T,{get when(){return e.folded},get fallback(){return d(dn,{size:13,strokeWidth:1.8})},get children(){return d(Yo,{size:13,strokeWidth:1.8})}})),H(n=>{var o=e.folded?"Expand thread":"Collapse thread",r=!e.folded;return o!==n.e&&M(t,"aria-label",n.e=o),r!==n.t&&M(t,"aria-expanded",n.t=r),n},{e:void 0,t:void 0}),t})()}function ir(e){let t,n,o=an(),{session:r}=Gn(),i=()=>e.isCommentFolded(e.a.thread.at(-1)?.id??"");Q(()=>{let O=r()?.user?.id;if(!e.open||e.folded||i()||!O||!o||!t||typeof IntersectionObserver>"u")return;let U=e.a.id,k=e.a.revision??1,$=new IntersectionObserver(A=>{A.some(R=>R.isIntersecting)&&document.visibilityState==="visible"&&(o.load({read:`thread:${U}:${O}`,revision:k}),$.disconnect())},{threshold:.1});queueMicrotask(()=>{let A=t?.querySelector("[data-notification-read-point]");A&&$.observe(A)}),K(()=>$.disconnect())});let l=()=>xo(e.a.thread),[c,s]=N(l()),a=!1,f=!1,[h,w]=N("");Q(()=>{let O=l();a||s(O)});let[y,p]=N(!1),[x,g]=N(!1),C=()=>e.open?e.a.thread:e.a.thread.slice(0,1),b=()=>e.a.thread[0],L=()=>Math.max(0,e.a.thread.length-1),S=async()=>{if(!(e.busy||f||!Ge(c()))){f=!0,w("");try{if(!await e.onReply(c()))throw new Error("Could not send reply. Your draft is saved here.");a=!1,s(l()),p(!1)}catch{w("Could not send reply. Your draft is saved here.")}finally{f=!1}}};Q(()=>{if(!x())return;let O=k=>{(!n||!k.composedPath().includes(n))&&g(!1)},U=k=>{k.key==="Escape"&&g(!1)};document.addEventListener("pointerdown",O),document.addEventListener("keydown",U),K(()=>{document.removeEventListener("pointerdown",O),document.removeEventListener("keydown",U)})});let E=()=>(e.a.remote_work??[]).filter((O,U,k)=>!k.slice(U+1).some($=>$.sessionId===O.sessionId));return(()=>{var O=uc();O.$$click=k=>{let $=k.target;!e.open&&!e.folded&&!$.closest('a, button, textarea, input, [role="button"]')&&e.onOpen()},O.addEventListener("mouseleave",()=>e.onHover(null)),O.addEventListener("mouseenter",()=>e.onHover(e.a.id));var U=t;return typeof U=="function"?xe(U,O):t=O,m(O,d(T,{get when(){return e.folded},get children(){var k=tc(),$=k.firstChild,A=$.firstChild;return m($,d(mi,{folded:!0,get onToggle(){return e.onToggleFold}}),A),m(A,()=>e.a.snippet||"this document"),m(k,d(T,{get when(){return b()},children:R=>[(()=>{var I=mc();return m(I,()=>Kn(R().body)),I})(),(()=>{var I=fc();return m(I,(()=>{var q=Y(()=>L()===1);return()=>q()?"1 reply":`${L()} replies`})()),I})()]}),null),k}}),null),m(O,d(T,{get when(){return!e.folded},get children(){return[d(ge,{get each(){return E()},children:k=>(()=>{var $=hc(),A=$.firstChild,R=A.firstChild,I=A.nextSibling;return m(A,()=>k.name,null),m(I,()=>Zt(k)),H(q=>{var W=`/chat?session=${k.sessionId}`,oe=Je[k.color];return W!==q.e&&M(A,"href",q.e=W),oe!==q.t&&se(A,"color",q.t=oe),q},{e:void 0,t:void 0}),$})()}),d(T,{get when(){return Y(()=>!!e.targetMissing)()&&!e.a.orphaned},get children(){return nc()}}),d(T,{get when(){return e.a.orphaned},get children(){var k=oc(),$=k.firstChild;return m(k,d(T,{get when(){return Y(()=>!!e.open)()&&(e.a.quote??e.a.snippet)},get children(){var A=rc();return m(A,()=>e.a.quote??e.a.snippet),A}}),$),k}}),d(T,{get when(){return Y(()=>!!(e.open&&!e.a.orphaned&&e.a.quote_found===!1))()&&e.a.quote},get children(){var k=ic(),$=k.firstChild;return m($,()=>e.a.quote),k}}),(()=>{var k=ac();return m(k,d(ge,{get each(){return C().map($=>$.id)},children:($,A)=>{let R=()=>C().find(W=>W.id===$)??e.a.thread[0],I=()=>e.open&&e.isCommentFolded(R().id),q=()=>A()===C().length-1;return(()=>{var W=$c(),oe=W.firstChild,ae=oe.firstChild;return m(oe,d(T,{get when(){return A()===0},get children(){return d(mi,{folded:!1,get onToggle(){return e.onToggleFold}})}}),ae),ae.$$keydown=z=>{!e.open||z.key!=="Enter"&&z.key!==" "||(z.preventDefault(),e.onToggleComment(R().id))},ae.$$click=z=>{e.open&&(z.target.closest("a, button")||e.onToggleComment(R().id))},m(ae,d(sn,{get author(){return R().author}}),null),m(ae,d(Qn,{get iso(){return R().created_at},class:"ml-auto shrink-0 font-mono text-[10px] text-faint"}),null),m(oe,d(T,{get when(){return Y(()=>A()===0)()&&e.resolved},get children(){return d($e,{content:"resolved",get children(){var z=gc();return m(z,d(bt,{size:13,strokeWidth:2})),z}})}}),null),m(oe,d(T,{get when(){return Y(()=>A()===0)()&&!e.resolved},get children(){return d($e,{content:"resolve thread",get children(){var z=pc();return z.$$click=()=>e.onResolve(),m(z,d(bt,{size:13,strokeWidth:2})),H(()=>z.disabled=e.busy),z}})}}),null),m(oe,d(T,{get when(){return Y(()=>!!(A()===0&&e.resolved))()&&e.open},get children(){var z=bc();return z.$$click=()=>e.onOpen(),z}}),null),m(oe,d(T,{get when(){return Y(()=>A()===0)()&&(!e.resolved||e.open)},get children(){var z=xc(),be=n;return typeof be=="function"?xe(be,z):n=z,m(z,d($e,{content:"thread actions",get children(){var me=vc();return me.$$click=()=>g(le=>!le),m(me,d(Ko,{size:13,strokeWidth:1.8})),H(()=>M(me,"aria-expanded",x())),me}}),null),m(z,d(T,{get when(){return x()},get children(){var me=yc(),le=me.firstChild,j=le.firstChild;return le.$$click=()=>{g(!1),e.onDelete()},m(le,d(Xo,{size:12,strokeWidth:1.75}),j),H(()=>le.disabled=e.busy),me}}),null),z}}),null),m(W,d(T,{get when(){return I()},get fallback(){return d(T,{get when(){return e.open},get fallback(){return(()=>{var z=Ec();return m(z,()=>Ct(R().body)),z})()},get children(){return d(di,{get text(){return R().body},get foldable(){return!(e.justOpened&&q())}})}})},get children(){var z=wc();return m(z,()=>Kn(R().body)),z}}),null),m(W,d(T,{get when(){return Y(()=>A()===0)()&&e.a.image},children:z=>d(ui,{get image(){return z()}})}),null),m(W,d(T,{get when(){return Y(()=>!!(q()&&!I()))()&&e.open},get children(){return kc()}}),null),H(z=>{var be=R().id,me=e.open?"button":void 0,le=e.open?0:void 0,j=e.open?I()?"Expand comment":"Collapse comment":void 0,P=e.open?!I():void 0,ie=`flex min-w-0 flex-1 items-center gap-2 rounded-[3px] ${e.open?"cursor-pointer":""}`;return be!==z.e&&M(W,"data-comment-id",z.e=be),me!==z.t&&M(ae,"role",z.t=me),le!==z.a&&M(ae,"tabindex",z.a=le),j!==z.o&&M(ae,"aria-label",z.o=j),P!==z.i&&M(ae,"aria-expanded",z.i=P),ie!==z.n&&de(ae,z.n=ie),z},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),W})()}})),k})(),d(T,{get when(){return!e.open},get children(){var k=sc(),$=k.firstChild;return k.addEventListener("blur",()=>e.onHover(null)),k.addEventListener("focus",()=>e.onHover(e.a.id)),k.$$click=()=>e.onOpen(),m(k,d(ln,{get thread(){return e.a.thread}}),$),H(A=>{var R=e.resolved?"Show resolved conversation":"Open annotation thread",I=e.resolved?!1:void 0;return R!==A.e&&M(k,"aria-label",A.e=R),I!==A.t&&M(k,"aria-expanded",A.t=I),A},{e:void 0,t:void 0}),k}}),d(T,{get when(){return Y(()=>!!e.open)()&&!e.resolved},get children(){var k=cc(),$=k.firstChild,A=$.firstChild,R=A.nextSibling;return m(k,d(un,{get backend(){return e.backend},get artifactId(){return e.artifactId},label:"Reply to annotation",previewLabel:"Reply preview",previewToggleLabel:"Preview reply",get value(){return c()},onChange:I=>{a=!0,s(I)},onSubmit:()=>{S()},get previewing(){return y()},onPreviewingChange:p,rows:2,placeholder:"reply\u2026"}),$),m(k,d(T,{get when(){return h()},get children(){var I=lc();return m(I,h),I}}),$),A.$$click=()=>{a=!0,s(""),p(!1),e.onOpen()},R.$$click=()=>{S()},H(()=>R.disabled=e.busy||!Ge(c())),k}}),d(T,{get when(){return Y(()=>!!e.open)()&&e.resolved},get children(){var k=dc(),$=k.firstChild;return $.$$click=()=>e.onReopen(),H(()=>$.disabled=e.busy),k}})]}}),null),H(k=>{var $=e.resolved?"Resolved annotation thread":"Annotation thread",A=e.a.id,R=e.hovered?"true":void 0,I=`${_c} shrink-0 overflow-hidden transition-[border-color,background-color,opacity] duration-150 ${e.open||e.folded?"":"cursor-pointer"} ${e.open||e.hovered?"border-edge-bright bg-comment-hover":""} ${e.resolved?"opacity-55 hover:opacity-100 focus-within:opacity-100":""}`;return $!==k.e&&M(O,"aria-label",k.e=$),A!==k.t&&M(O,"data-thread-id",k.t=A),R!==k.a&&M(O,"data-hovered",k.a=R),I!==k.o&&de(O,k.o=I),k},{e:void 0,t:void 0,a:void 0,o:void 0}),O})()}pe(["click","keydown"]);var ue=class extends Error{constructor(n,o){super(n);this.code=n;this.stage=o;this.name="CaptureError"}code;stage};var ar,Cc=()=>({width:window.innerWidth,height:window.innerHeight});function Sc(){let e=navigator.mediaDevices;return!!(e?.getDisplayMedia&&e.setCaptureHandleConfig)}function Rc(e,t){if(![e.x,e.y,e.width,e.height,t.width,t.height].every(Number.isFinite)||e.width<=0||e.height<=0)throw new ue("geometry");let n=Math.max(0,e.x),o=Math.max(0,e.y),r=Math.min(t.width,e.x+e.width)-n,i=Math.min(t.height,e.y+e.height)-o;if(r<1||i<1)throw new ue("geometry");return{x:n,y:o,width:r,height:i}}async function St(e,t,n=5e3){let o,r=performance.now(),i="success";try{return await Promise.race([e,new Promise((l,c)=>{o=setTimeout(()=>c(new ue("timeout",t)),n)})])}catch(l){throw i="error",l}finally{clearTimeout(o);let l=`comment-screenshot:${t}`;performance.clearMeasures(l),performance.measure(l,{start:r,end:performance.now(),detail:{outcome:i}})}}function fi(e,t,n=()=>!0){let o=0,r=performance.now(),i=0,l=f=>{let h=`comment-screenshot:${t}`;performance.clearMeasures(h),performance.measure(h,{start:r,end:performance.now(),detail:{outcome:f,frames:i,width:e.videoWidth,height:e.videoHeight}})},c,s=()=>{clearTimeout(c),e.cancelVideoFrameCallback(o)},a=new Promise((f,h)=>{c=setTimeout(()=>{l("timeout"),s(),h(new ue("timeout",t))},5e3);let w=()=>{i++,n()?(l("success"),s(),f()):o=e.requestVideoFrameCallback(w)};o=e.requestVideoFrameCallback(w)});return a.catch(()=>{}),{promise:a,cancel:s}}async function hi(){if(!Sc())throw new ue("unsupported");let e=navigator.mediaDevices;ar??=ze(),e.setCaptureHandleConfig({handle:ar,permittedOrigins:[location.origin],exposeOrigin:!1});let t=e.getDisplayMedia({audio:!1,video:{frameRate:30},preferCurrentTab:!0}),n=!1;t.then(y=>{n&&y.getTracks().forEach(p=>p.stop())},()=>{});let o;try{o=await St(t,"permission",6e5)}catch(y){throw n=!0,y instanceof DOMException&&y.name==="NotAllowedError"?new ue("cancelled"):y}let r=o.getVideoTracks()[0],i=()=>r?.getSettings().displaySurface==="browser"&&r.getCaptureHandle?.()?.handle===ar;if(!r||!i())throw o.getTracks().forEach(y=>y.stop()),new ue("wrong-source");let l=globalThis.ImageCapture,c;try{c=l?new l(r):null}catch(y){throw o.getTracks().forEach(p=>p.stop()),y}let s=c?null:document.createElement("video");s&&(s.muted=!0,s.playsInline=!0,s.srcObject=o);let a=!1,f=!1,h,w=()=>{a||(a=!0,clearTimeout(h),o.getTracks().forEach(y=>y.stop()),s&&(s.pause(),s.srcObject=null),window.removeEventListener("pagehide",w),r.removeEventListener("ended",w),r.removeEventListener("capturehandlechange",w))};if(window.addEventListener("pagehide",w),r.addEventListener("ended",w),r.addEventListener("capturehandlechange",w),h=setTimeout(w,12e4),s){let y=fi(s,"initial-frame");try{await St(s.play(),"playback"),await y.promise}catch(p){throw w(),p}finally{y.cancel()}}return{dispose:w,async capture(y){if(a||f)throw new ue("ended");f=!0;let p=Cc(),x;try{x=Rc(y,p)}catch(E){throw w(),E}let g={x:window.scrollX,y:window.scrollY},C,b=!1,L=()=>{b=!0},S=()=>{(p.width!==innerWidth||p.height!==innerHeight)&&(b=!0)};window.addEventListener("scroll",L,!0),window.addEventListener("resize",S);try{if(!i())throw new ue("wrong-source");if(await St(new Promise(q=>requestAnimationFrame(()=>requestAnimationFrame(()=>q()))),"paint"),a)throw new ue("ended");if(c){let q=!1,W=(async()=>{if((await c.grabFrame()).close(),q||a)throw new ue(q?"timeout":"ended","track-frame");let ae=await c.grabFrame();if(q)throw ae.close(),new ue("timeout","track-frame");return ae})();W.catch(()=>{});try{C=await St(W,"track-frame")}catch(oe){throw q=!0,oe}}else if(s){let q=fi(s,"full-frame");try{await q.promise}finally{q.cancel()}}if(a||r.readyState==="ended")throw new ue("ended");if(!i())throw new ue("wrong-source");if(b||p.width!==innerWidth||p.height!==innerHeight||g.x!==scrollX||g.y!==scrollY)throw new ue("geometry");let E=C?.width??s.videoWidth,O=C?.height??s.videoHeight;if(!E||!O)throw new ue("geometry");let U=p.width/p.height;if(Math.abs(E/O/U-1)>.015)throw new ue("geometry");let k={x:x.x*E/p.width,y:x.y*O/p.height,width:x.width*E/p.width,height:x.height*O/p.height},$=Math.min(1,2048/Math.max(k.width,k.height),Math.sqrt(4e6/(k.width*k.height))),A=document.createElement("canvas");A.width=Math.max(1,Math.round(k.width*$)),A.height=Math.max(1,Math.round(k.height*$));let R=A.getContext("2d");if(!R)throw new ue("unsupported");return R.drawImage(C??s,k.x,k.y,k.width,k.height,0,0,A.width,A.height),{blob:await St(new Promise((q,W)=>A.toBlob(oe=>oe?q(oe):W(new ue("geometry")),"image/png")),"encode"),width:A.width,height:A.height,rect:x,viewport:p,capturedAt:new Date().toISOString(),method:"canvas"}}finally{C?.close(),window.removeEventListener("scroll",L,!0),window.removeEventListener("resize",S),w()}}}}var sr={unsupported:"This browser cannot verify capture of this tab. Upload a screenshot, or explicitly continue without one.",cancelled:"Screen sharing was cancelled. Retry, upload a screenshot, or continue without one.","wrong-source":"Choose this browser tab when sharing. The other source was stopped.",geometry:"The page moved during capture. Retake the screenshot.",ended:"Screen sharing ended. Retake the screenshot.",timeout:"Capture timed out. Please retry."};function gi(e,t){let n=typeof t=="function"?t:()=>t,o=null,r=0,i=null,[l,c]=N(null),[s,a]=N(!1),[f,h]=N(!1),[w,y]=N(""),p=()=>{r+=1,o?.dispose(),o=null,i=null,c(null),a(!1),h(!1),y("")};K(p);let x=()=>!!(n()&&!e.unavailable("commentImages"));return{draft:l,busy:s,required:f,error:w,reset:p,start:async()=>{if(p(),!x())return"unavailable";let S=r;h(!0),a(!0);try{let E=await hi();return S!==r?(E.dispose(),"superseded"):(o=E,"ready")}catch(E){return S!==r?"superseded":E instanceof ue&&E.code==="cancelled"?(p(),"cancelled"):(y(sr[E instanceof ue?E.code:"unsupported"]),"unavailable")}finally{S===r&&a(!1)}},capture:async S=>{if(!x())return;h(!0);let E=o;if(!E){y($=>$||sr.unsupported);return}let O=r,U=n();a(!0);let k=performance.now();document.documentElement.classList.add("mx-taking-screenshot");try{let $=await E.capture(S);if(O!==r)return;if(n()!==U)throw new ue("geometry");c({image:$,preview:$.blob,strokes:[],editId:U}),y("")}catch($){O===r&&y(sr[$ instanceof ue?$.code:"unsupported"])}finally{try{performance.measure("comment-screenshot:capture",{start:k,end:performance.now()})}catch{}o===E&&(o=null),E.dispose(),document.documentElement.classList.remove("mx-taking-screenshot"),O===r&&a(!1)}},upload:async S=>{if(!x())return;let E=++r;o?.dispose(),o=null,a(!0),y("");try{if(S.size>8*1024*1024||!["image/png","image/jpeg","image/webp"].includes(S.type))throw new Error("Use a PNG, JPEG or WebP up to 8 MB.");let O=await createImageBitmap(S);try{let U=Math.min(1,2048/Math.max(O.width,O.height),Math.sqrt(4e6/(O.width*O.height))),k=document.createElement("canvas");k.width=Math.max(1,Math.round(O.width*U)),k.height=Math.max(1,Math.round(O.height*U)),k.getContext("2d").drawImage(O,0,0,k.width,k.height);let $=await new Promise(R=>k.toBlob(R,"image/png"));if(!$)throw new Error("Could not read this image.");let A={blob:$,width:k.width,height:k.height,rect:{x:0,y:0,width:k.width,height:k.height},viewport:{width:k.width,height:k.height},method:"upload",capturedAt:new Date().toISOString()};E===r&&(c({image:A,preview:$,strokes:[],editId:n()}),h(!0))}finally{O.close()}}catch(O){E===r&&y(O instanceof Error?O.message:"Could not read this image.")}finally{E===r&&a(!1)}},stage:async S=>{let E=l();if(!E)return;let O=S?.preview??E.preview;if(i?.draft===E&&i.preview===O)return i.id;let U={v:1,capturedEditId:E.editId,capturedAt:E.image.capturedAt,method:E.image.method,width:E.image.width,height:E.image.height,rect:E.image.rect,viewport:E.image.viewport,strokes:S?.strokes??E.strokes},k=new FormData;k.set("original",E.image.blob,"original.png"),k.set("preview",O,"preview.png"),k.set("metadata",JSON.stringify(U));let $=await e.uploadCommentImage(k);return i={draft:E,preview:O,id:$.id},$.id},skip:p}}var Tc=v('<div class="space-y-3 px-1"><div class="flex items-center justify-between"><h2 class="font-mono text-[10px] font-semibold uppercase tracking-[0.12em] text-faint">comments</h2><button type=button aria-label="Close comments"class="inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-[3px] text-muted hover:bg-surface hover:text-fg"></button></div><div role=group aria-label="Comment tools"class="grid grid-cols-2 gap-2"><button type=button aria-label=Select><span class="flex items-center gap-2 text-sm font-semibold">Select</span><span class=text-[11px]>Block or text</span></button></div><p class="text-xs text-muted">'),Ac=v('<button type=button aria-label=Screenshot><span class="flex items-center gap-2 text-sm font-semibold">Screenshot</span><span class=text-[11px]>Capture an area'),Ic=v("<style>:host-context(.mx-taking-screenshot) [data-capture-chrome],.mx-taking-screenshot [data-capture-chrome]{visibility:hidden!important}"),Pc=v('<div data-capture-chrome role=status class="fixed bottom-4 left-4 z-50 rounded bg-panel p-3 shadow">Preparing screenshot\u2026 <button type=button>Cancel capture'),Mc=v('<div data-capture-chrome aria-label="Open annotation comments"class="pointer-events-none fixed inset-0 z-20">'),Oc=v('<div role=status data-capture-chrome class="rounded-[6px] border border-edge bg-raised text-sm fixed z-30 flex items-center gap-2 border-edge-bright px-3 py-1.5 font-mono text-[11px] text-muted shadow-xl"style=transform:translateX(-50%)><span class=whitespace-nowrap></span><button type=button aria-label="Cancel picking"class="inline-flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center rounded-[3px] text-muted hover:bg-surface hover:text-fg">'),Lc=v('<div role=status class="mb-3 flex items-center gap-2 rounded-lg border border-edge bg-surface p-4 text-sm text-muted">Preparing screenshot\u2026'),Nc=v('<div class="mb-3 space-y-3 rounded-lg border border-edge bg-surface p-3 text-xs"><p role=alert class="leading-relaxed text-muted"></p><button type=button class="rounded-lg border border-edge bg-panel px-3 py-2 font-medium hover:border-accent">Retry screenshot</button><label class="block space-y-2 font-medium">Upload screenshot<input class="block w-full text-xs text-muted file:mr-2 file:rounded-md file:border-0 file:bg-panel file:px-3 file:py-2 file:text-fg"type=file accept=image/png,image/jpeg,image/webp aria-label="Upload screenshot"></label><button type=button class="text-muted underline underline-offset-4 hover:text-fg">Continue without screenshot'),Dc=v("<div class=mb-3>"),Fc=v('<div class="mb-2 flex min-w-0 flex-wrap items-center gap-1 font-mono text-[11px] text-muted">'),jc=v('<p role=alert class="mb-2 font-mono text-[11px] text-danger">'),Hc=v('<section data-capture-chrome role=dialog aria-label="Annotation composer"class="rounded-[6px] border border-edge bg-raised text-sm fixed z-30 overflow-y-auto border-edge-bright shadow-xl"><div class="flex items-center gap-2 border-b border-edge px-3 py-2.5"><span class="inline-flex h-[22px] w-[22px] shrink-0 items-center justify-center rounded-full border border-accent/25 bg-accent-soft text-accent"></span><span class="text-xs font-semibold text-fg">Add comment</span><button type=button aria-label="Close annotation composer"class="ml-auto inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-[3px] text-muted hover:bg-surface hover:text-fg"></button></div><div class=p-3><div class="flex items-center justify-end gap-2"><span class="mr-auto hidden font-mono text-[9px] text-faint sm:inline">\u2318\u21B5 to send</span><button type=button aria-label="Cancel annotation"class="cursor-pointer rounded-[4px] bg-transparent px-2 py-1 text-muted hover:bg-surface hover:text-fg">cancel</button><button type=button aria-label="Save annotation"class="cursor-pointer rounded-[4px] border border-accent bg-accent px-2 py-1 font-semibold text-bg hover:brightness-110 disabled:cursor-default disabled:opacity-40">comment'),qc=v('<p class="p-2 font-mono text-xs text-muted">no open comments \u2014 select text in the document, or pick a block, to leave one'),zc=v('<p class="p-2 font-mono text-xs text-muted">nothing resolved yet'),Jc=v('<div class=contents><div role=separator aria-labelledby=resolved-annotations-heading class="mt-1 flex items-center gap-2 px-1"><span aria-hidden=true class="h-px flex-1 bg-edge"></span><h2 id=resolved-annotations-heading class="shrink-0 font-mono text-[10px] font-semibold uppercase tracking-[0.12em] text-faint">resolved</h2><span aria-hidden=true class="h-px flex-1 bg-edge">'),Bc=v('<div role=status class="mb-3 flex items-center gap-2 rounded-lg border border-edge bg-surface p-4 text-sm text-muted">Loading screenshot\u2026'),Uc=v('<button type=button class="rounded-lg border border-edge bg-panel px-3 py-2 text-xs font-medium disabled:opacity-50">Attach screenshot'),Wc=v("<span>\u203A"),Vc=v('<button type=button class="cursor-pointer truncate underline decoration-dotted hover:text-accent">'),Gc=v('<span class="flex min-w-0 items-center gap-1">'),Yc=v('<span class="truncate text-accent">'),pi=$r(()=>import("./ScreenshotEditor-R3UODF65.js").then(e=>({default:e.ScreenshotEditor}))),Kc=()=>pi.preload();var Xc={title:"Delete this comment?",description:"This comment and its replies will be permanently deleted. This cannot be undone.",action:"Delete comment",confirmLabel:"Confirm delete comment"},lr=e=>{if(e===void 0)return null;let t=new URLSearchParams(e);return t.get("comment")??t.get("thread")},Zc=()=>{try{return eo()}catch{return null}};function Qc(e,t){let[n,o]=N(""),r=!1;return Q(()=>{if(!t()){r=!1;return}if(e.unavailable("remoteSessions"))return;let i=new AbortController;e.remoteSessions({signal:i.signal}).then(l=>{if(i.signal.aborted||r)return;let c=(l.sessions??[]).filter(s=>!s.runId&&s.online&&s.activity!=="stopped"&&s.exitCode===null);c.length===1&&o(Qt(c[0]))}).catch(()=>{}),K(()=>i.abort())}),[n,i=>{r=!0,o(i)},i=>o(i)]}function bi(e){let t=e.backend??ao(e.id),n=ve(()=>e.railOpen),o=ve(()=>e.pickOnOpen!==!1),r=ve(()=>e.initialSelection??null),i=ve(()=>e.sessionNonce??null),l=ve(()=>e.runtimeRef),c=ve(()=>e.liveAnnotations??null),s=t.unavailable("commentImages"),a=gi(t,()=>e.editId),f={current:null},h={signature:"",key:""},w=u=>{e.runtimeRef&&Bt({runtimeRef:e.runtimeRef},u)},[y,p]=N([]),[x,g]=N({}),C=new Set,[b,L]=N(null),[S,E]=N(null),[O,U]=N(null),[k,$]=N(xt(e.id)),[A,R]=N(null),[I,q]=N(null),W=null,oe=u=>{W=u,q(u)},[ae,z]=N(new Set),[be,me]=N({}),le,j,[P,ie]=N(null),[ee,ne]=N(null),fe=!1,Oe=So(),[Ee,Tt,dt]=Qc(t,()=>P()!==null),[At,mn]=N(!1),[Xe,Ze]=N(!1),[dr,Be]=N(null),[fn,hn]=N(null),[gn,ur]=N(!1),[Ei,pn]=N(null),[Qe,_i]=N({width:innerWidth,height:innerHeight});ye(()=>{let u=()=>_i({width:innerWidth,height:innerHeight});window.addEventListener("resize",u),K(()=>window.removeEventListener("resize",u))}),Ro(()=>P()!==null,()=>j);let It=!1,bn=!1;Q(()=>{e.onAnnotationsChange?.(y())}),Q(Ie(y,u=>U(_=>u.some(F=>F.id===_)?null:_)));let Ci=ve(()=>y().some(u=>u.remote_work?.length));Q(()=>{if(n(),!Ci()||Xe())return;let u=new AbortController,_=setInterval(()=>{t.listAnnotations(void 0,{signal:u.signal}).then(F=>{u.signal.aborted||p(F)}).catch(()=>{})},15e3);K(()=>{clearInterval(_),u.abort()})});let Pt=u=>{Re(()=>{a.reset(),ne(null),E(u),U(we(y).some(F=>F.id===u)?null:u),R(u),ie(null);let _=we(y).find(F=>F.id===u)?.thread.at(-1)?.id;$(Fn(e.id,{threads:[u],comments:_?[_]:[]}))}),we(()=>e.railOpen)||(It=!0),e.onRailOpenChange(!0)},mr=Zc(),fr=()=>mr?mr.search:typeof location>"u"?void 0:location.search,[vn,yn]=N(e.linkTarget??lr(we(fr)));Q(()=>{e.linkTarget!==void 0&&yn(e.linkTarget)}),Q(Ie(fr,u=>{e.linkTarget===void 0&&yn(lr(u))},{defer:!0})),ye(()=>{let u=()=>{e.linkTarget===void 0&&yn(lr(location.search))};window.addEventListener("popstate",u),K(()=>window.removeEventListener("popstate",u))});let xn=!1;Q(Ie(vn,()=>{xn=!1})),Q(()=>{let u=vn(),_=[...y(),...b()??[]];if(!u||xn)return;let F=_.find(D=>D.id===u||D.thread.some(J=>J.id===u));we(()=>{F?(xn=!0,Pt(F.id),$(Fn(e.id,{threads:[F.id],comments:[u]}))):e.railOpen||(It=!0,e.onRailOpenChange(!0))})});let hr=(u,_)=>$(fo(e.id,u,_));Q(()=>{let u=S();if(!u||!n())return;let _=requestAnimationFrame(()=>{let F=[...le?.querySelectorAll("[data-thread-id]")??[]].find(Z=>Z.dataset.threadId===u);F?.scrollIntoView?.({block:"start",inline:"nearest"});let D=we(vn);((D?[...F?.querySelectorAll("[data-comment-id]")??[]].find(Z=>Z.dataset.commentId===D):null)??F?.querySelector("li:last-child"))?.scrollIntoView?.({block:"nearest",inline:"nearest"})});K(()=>cancelAnimationFrame(_))}),Q(Ie(()=>e.id,u=>$(xt(u)),{defer:!0})),ye(()=>{let u=new AbortController;t.listAnnotations(void 0,{signal:u.signal}).then(_=>{u.signal.aborted||p(_)}).catch(()=>{}),K(()=>u.abort())}),Q(()=>{let u=c();u&&p(u)}),Q(()=>{let u=y(),_=n(),F=C;C=new Set(u.map(X=>X.id));let D=[...F].filter(X=>!C.has(X)),J=we(x);if(!_&&!D.length&&!Object.keys(J).length)return;let Z=new AbortController;t.listAnnotations("resolved",{signal:Z.signal}).then(X=>{if(Z.signal.aborted)return;let B=X.filter(ce=>!u.some(he=>he.id===ce.id));Re(()=>{L(B),g(ce=>{let he={};for(let V of B){let te=ce[V.id];(D.includes(V.id)||te)&&(he[V.id]={row:V,remaining:te&&te.row.revision===V.revision?te.remaining:1e4})}return he}),E(ce=>ce&&(D.includes(ce)||J[ce])&&!B.some(he=>he.id===ce)&&!C.has(ce)?null:ce)})}).catch(()=>{Z.signal.aborted||Re(()=>{g({}),L(null),E(null)})}),K(()=>Z.abort())});let Mt=u=>{u==="block"&&a.reset(),ne(u),E(null),Oe()&&we(()=>e.railOpen)&&(bn=!0,e.onRailOpenChange(!1))},Ot=()=>Mt("block");Q(Ie([n,o,Oe],([u,_,F])=>{let D=we(P)!==null;if(u){let J=It;It=!1,!J&&!we(r)&&!D&&_&&!F&&Ot();return}if(bn){bn=!1;return}(we(ee)||!D)&&a.reset(),ne(null)})),Q(Ie(o,u=>{u||(fe=!1,ne(null),a.reset())})),Q(()=>{let u=r();u&&we(()=>{fe=ee()==="block",a.reset(),Re(()=>{ie(u),E(null),Be(null),ne(null)}),e.onSelectionConsumed?.()})});let Si=ve(()=>Object.values(x()).filter(u=>u.remaining>0).map(u=>u.row.id).join(","));Q(()=>{if(!i())return;Si();let u=S(),_=O(),F=we(x),D=y(),J=u?(b()??[]).find(B=>B.id===u)??F[u]?.row??null:null,Z=[...D,...J?[J]:[],...Object.values(F).filter(B=>B.remaining>0&&B.row.id!==J?.id&&!D.some(ce=>ce.id===B.row.id)).map(B=>B.row)].filter(B=>!B.orphaned&&B.anchor).map(B=>{let ce=B.anchor;return{id:B.id,path:ce.path,key:ce.key,nodeId:ce.nodeId,range:B.range,...B.status==="resolved"&&(B.id!==_||B.id!==u)?{layoutOnly:!0}:{}}}),X=P();w({type:rt,mode:a.busy()?"off":"on",pins:Z,openId:u,hoverId:I(),selectedPath:X?.path??null,selected:X,canComment:!0,pick:ee()})}),Q(Ie(n,u=>{u||E(null)})),K(()=>w({type:rt,mode:"off",pins:[],openId:null,hoverId:null})),Q(()=>{let u=i(),_=l();if(!u||!_)return;let F=Ut({runtimeRef:_},D=>{let J=D.data;if(!Ht(J,u))return;if(J.type===jt&&J.action==="select"){if(e.pickOnOpen===!1)return;Ot();return}if(J.type===Mr){let X={};for(let B of J.positions)X[B.id]=B.rect;Re(()=>{z(new Set(J.positions.filter(B=>B.status==="missing"||B.status==="ambiguous").map(B=>B.id))),me(X)});return}if(J.type===Ir){Pt(J.id);return}if(J.type===Pr){q(W??J.id);return}let Z=we(ee);if(J.type===Sn&&Z){let X=J.selection;fe=!!X&&Z==="block",Re(()=>{if(ne(null),X){ie(X);let B=X.captureRect??X.rect,ce=e.runtimeRef?Wt({runtimeRef:e.runtimeRef}):void 0;Z==="area"&&a.capture({...B,x:B.x+(ce?.left??0),y:B.y+(ce?.top??0)}),E(null),Be(null)}else a.reset()});return}if(J.type===Sn&&we(P)!==null){let X=J.selection;if(a.draft()||a.busy())return;Re(()=>{ie(B=>{if(JSON.stringify(B)===JSON.stringify(X))return B;if(!(X?.nodeId&&B?.nodeId&&X.nodeId===B.nodeId)||X?.range)return X;let he={...X,...B.quote?{quote:B.quote}:{},...B.range?{range:B.range}:{}};return JSON.stringify(B)===JSON.stringify(he)?B:he}),Be(null),X&&E(null)})}});K(F)});let wn=async(u,_)=>{Ze(!0);try{let F=await t.actOnAnnotation(u,_);return Re(()=>{p(D=>F.status==="resolved"?D.filter(J=>J.id!==u):D.some(J=>J.id===u)?D.map(J=>J.id===u?F:J):[...D,F]),L(D=>D&&(F.status==="open"?D.filter(J=>J.id!==u):D.some(J=>J.id===u)?D.map(J=>J.id===u?F:J):[...D,F])),F.status==="resolved"?E(D=>D===u?null:D):_.reopen&&(E(u),R(u))}),!0}catch{return!1}finally{Ze(!1)}},Ri=async u=>{Ze(!0);try{await t.deleteAnnotation(u),Re(()=>{p(_=>_.filter(F=>F.id!==u)),L(_=>_&&_.filter(F=>F.id!==u)),E(_=>_===u?null:_)})}finally{Ze(!1)}},Ti=async()=>{let u=fn();if(!(!u||gn())){ur(!0),pn(null);try{await Ri(u),hn(null)}catch(_){pn(_ instanceof Error?_.message:"Could not complete this action. Try again.")}finally{ur(!1)}}},Ai=u=>{fn()||(pn(null),hn(u))},Ii=async()=>{let u=P();if(!(!u||!Ge(Ee())||a.busy()||a.required()&&!a.draft())){if(!u.nodeId){Be("Wait for this change to save before commenting. Your draft is still here.");return}Ze(!0),Be(null);try{let _=a.draft();if(_&&!f.current)throw new Error("The screenshot is still loading. Please try again.");let F=await a.stage(_?await f.current():void 0),D=Ee(),J=JSON.stringify([u,D,F]);h.signature!==J&&(h={signature:J,key:ze()});let Z;try{Z=await t.createAnnotation({path:u.path,node_id:u.nodeId,body:D,...F?{attachment_id:F,edit_id:_.editId}:{},...u.quote?{quote:u.quote}:{},...u.range?{range:u.range}:{}},h.key)}catch(B){if(!(B instanceof Ce))throw B;B.signInRequired?window.location.assign(vo(window.location,"comment")):Be(B.message);return}a.reset();let X=fe;fe=!1,Re(()=>{p(B=>[...B.filter(ce=>ce.id!==Z.id),Z]),ie(null),dt(""),mn(!1),E(Z.id),R(Z.id),X&&ne("block")}),X||w({type:qe,path:null})}catch(_){Be(_ instanceof Error?_.message:"Could not save the comment. Your draft is still here.")}finally{Ze(!1)}}},kn=()=>{a.reset(),Re(()=>{ie(null),dt(""),mn(!1),Be(null)}),fe?(fe=!1,Ot()):w({type:qe,path:null})},gr=()=>{Xe()||!Ge(Ee())||Ii()};Q(()=>{if(!P())return;let u=_=>{_.key==="Escape"&&(we(ee)||(_.stopPropagation(),kn()))};window.addEventListener("keydown",u),K(()=>window.removeEventListener("keydown",u))}),Q(()=>{if(!ee())return;let u=_=>{_.key==="Escape"&&(_.stopPropagation(),a.reset(),ne(null))};window.addEventListener("keydown",u),K(()=>window.removeEventListener("keydown",u))});let $n=async()=>{if(!e.editId||s)return;Mt("area");let u=a.start();Kc().catch(()=>{}),await u==="cancelled"&&Mt("block")};ye(()=>{e.pickRequested&&e.pickOnOpen!==!1&&Ot()});let pr=()=>{fe=!1,a.reset(),ne(null)},Pi=()=>ee()==="block"?pr():Mt("block"),Mi=()=>s??(e.editId?null:"Screenshots need a saved document."),ut=()=>e.topOffset??0,br=ve(()=>{let u=y();return[...u,...Object.values(x()).filter(_=>_.remaining>0&&!u.some(F=>F.id===_.row.id)).map(_=>_.row)]}),En=()=>!e.railOpen&&!!e.showViewComments&&br().length>0,Oi=()=>(Qe(),(e.runtimeRef?Wt({runtimeRef:e.runtimeRef}):void 0)??{top:ut(),height:innerHeight-ut()}),_n=ve(()=>En()?Wo(br(),be(),Oi(),Qe().height):[]),Li=ve(()=>_n().map(u=>u.annotation.id),void 0,{equals:(u,_)=>u.length===_.length&&u.every((F,D)=>F===_[D])}),Ni=u=>_n().find(_=>_.annotation.id===u),Di=ve(()=>_n().filter(u=>u.top>=0&&u.top+cn<=Qe().height).map(u=>u.annotation.id).join(",")),Fi=ve(()=>Object.values(x()).some(u=>u.remaining>0));Q(()=>{if(!En()||!Fi())return;let u=new Set(Di().split(",")),_=I(),F=S(),D=performance.now(),J=setInterval(()=>{let Z=performance.now(),X=Math.min(250,Z-D);D=Z,document.visibilityState==="visible"&&g(B=>{let ce=!1,he=Object.fromEntries(Object.entries(B).map(([V,te])=>te.remaining<=0||!u.has(V)||V===_||V===F?[V,te]:(ce=!0,[V,{...te,remaining:Math.max(0,te.remaining-X)}])));return ce?he:B})},100);K(()=>clearInterval(J))});let ji=()=>{let u=P();return u?[...u.ancestors.slice(-2),{path:u.path,tag:u.tag,hint:""}]:[]},vr=()=>e.panelWidth??(e.railOpen&&!Oe()&&!e.railSheet&&e.railHost===void 0?320:0),Lt=ve(()=>{let{width:u}=Qe(),_=e.runtimeRef?Wt({runtimeRef:e.runtimeRef}):void 0;return _?{left:_.left,top:_.top,width:Math.max(0,_.width-vr())}:{left:0,top:ut(),width:u-vr()}}),mt=ve(()=>{let u=P();return u?To(u,Lt(),Qe().width,Qe().height,a.required()):null}),Hi=ve(()=>y().map(u=>u.id),void 0,{equals:(u,_)=>u.length===_.length&&u.every((F,D)=>F===_[D])}),qi=ve(()=>(b()??[]).map(u=>u.id),void 0,{equals:(u,_)=>u.length===_.length&&u.every((F,D)=>F===_[D])}),zi=u=>y().find(_=>_.id===u),Ji=u=>(b()??[]).find(_=>_.id===u),Bi=()=>(()=>{var u=Tc(),_=u.firstChild,F=_.firstChild,D=F.nextSibling,J=_.nextSibling,Z=J.firstChild,X=Z.firstChild,B=X.firstChild,ce=J.nextSibling;return D.$$click=()=>e.onRailOpenChange(!1),m(D,d(Ve,{size:14,strokeWidth:1.8})),Z.$$click=Pi,m(X,d(Ln,{size:18}),B),m(J,d(jn,{get reason(){return Mi()},class:"flex",children:he=>(()=>{var V=Ac(),te=V.firstChild,Se=te.firstChild;return V.$$click=()=>{$n()},He(V,G({get"aria-pressed"(){return a.required()}},he,{get class(){return`flex min-h-16 w-full cursor-pointer flex-col items-center justify-center gap-1 rounded-lg border px-3 py-2 disabled:cursor-default disabled:opacity-50 ${a.required()?"border-accent bg-accent-soft text-accent":"border-edge bg-panel text-fg hover:bg-surface"}`}}),!1,!0),m(te,d(to,{size:18}),Se),V})()}),null),m(ce,()=>a.required()?"Share this tab, then drag an area.":"Click a block or highlight text. No screen sharing."),H(he=>{var V=ee()==="block",te=`flex min-h-16 cursor-pointer flex-col items-center justify-center gap-1 rounded-lg border px-3 py-2 ${ee()==="block"?"border-accent bg-accent-soft text-accent":"border-edge bg-panel text-fg hover:bg-surface"}`;return V!==he.e&&M(Z,"aria-pressed",he.e=V),te!==he.t&&de(Z,he.t=te),he},{e:void 0,t:void 0}),u})(),yr=(u,_)=>({onHover:oe,onDelete:()=>Ai(u),onToggleFold:()=>hr("threads",u),onToggleComment:F=>hr("comments",F),..._?{onOpen:()=>Re(()=>{R(u),U(u),E(F=>F===u?null:u)}),onReply:async()=>!1,onResolve:()=>{},onReopen:()=>{wn(u,{reopen:!0})}}:{onOpen:()=>Pt(u),onReply:F=>wn(u,{reply:F}),onResolve:()=>{wn(u,{resolve:!0})},onReopen:()=>{}}});return d(li,{get artifactId(){return e.id},backend:t,get children(){return d(Yn.Provider,{get value(){return t.mode==="offline"},get children(){return[(()=>{var u=Ic(),_=j;return typeof _=="function"?xe(_,u):j=u,u})(),d(T,{get when(){return Y(()=>!!a.busy())()&&!P()},get children(){var u=Pc(),_=u.firstChild,F=_.nextSibling;return F.$$click=()=>a.reset(),u}}),d(T,{get when(){return En()},get children(){var u=Mc();return m(u,d(ge,{get each(){return Li()},children:_=>d(T,{get when(){return Ni(_)},children:F=>d(Vo,{get row(){return F().annotation},get top(){return F().top},get remaining(){return x()[_]?.remaining},get hovered(){return I()===_},onOpen:()=>Pt(_),onHover:oe})})})),u}}),d(T,{get when(){return ee()},get children(){var u=Oc(),_=u.firstChild,F=_.nextSibling;return m(u,d(Ln,{size:12,strokeWidth:1.8,class:"shrink-0 text-accent"}),_),m(_,(()=>{var D=Y(()=>ee()==="area");return()=>D()?a.busy()?"Choose this tab in the sharing dialog":"drag an area to screenshot":"click a block or highlight text to comment"})()),F.$$click=pr,m(F,d(Ve,{size:12,strokeWidth:1.8})),H(D=>{var J=ee()==="area"?"Screenshot tool active":"Select tool active",Z=`${Lt().left+Lt().width/2}px`,X=`${Math.max(ut(),Lt().top,Oe()?44:0)+st}px`;return J!==D.e&&M(u,"aria-label",D.e=J),Z!==D.t&&se(u,"left",D.t=Z),X!==D.a&&se(u,"top",D.a=X),D},{e:void 0,t:void 0,a:void 0}),u}}),d(T,{get when(){return Y(()=>!!(P()&&mt()))()&&!ee()},get children(){var u=Hc(),_=u.firstChild,F=_.firstChild,D=F.nextSibling,J=D.nextSibling,Z=_.nextSibling,X=Z.firstChild,B=X.firstChild,ce=B.nextSibling,he=ce.nextSibling;return m(F,d(no,{size:12,strokeWidth:1.8})),J.$$click=kn,m(J,d(Ve,{size:14,strokeWidth:1.8})),m(Z,d(T,{get when(){return a.busy()},get children(){var V=Lc(),te=V.firstChild;return m(V,d(On,{size:16,class:"animate-spin"}),te),V}}),X),m(Z,d(T,{get when(){return a.draft()},keyed:!0,children:V=>d(Er,{get fallback(){return(()=>{var te=Bc(),Se=te.firstChild;return m(te,d(On,{size:16,class:"animate-spin"}),Se),te})()},get children(){return d(pi,{get image(){return V.image},get initialStrokes(){return V.strokes},exportRef:f,get busy(){return Xe()},onRetake:()=>{$n()}})}})}),X),m(Z,d(T,{get when(){return Y(()=>!!(a.required()&&!a.draft()))()&&!a.busy()},get children(){var V=Nc(),te=V.firstChild,Se=te.nextSibling,je=Se.nextSibling,Ae=je.firstChild,De=Ae.nextSibling,Nt=je.nextSibling;return m(te,()=>a.error()||"A screenshot is required for this selection."),Se.$$click=()=>{$n()},De.addEventListener("change",ft=>{let xr=ft.currentTarget.files?.[0];xr&&a.upload(xr),ft.currentTarget.value=""}),Nt.$$click=()=>a.skip(),V}}),X),m(Z,d(T,{get when(){return e.editId&&s},get children(){var V=Dc();return m(V,d(jn,{reason:s,children:te=>(()=>{var Se=Uc();return He(Se,te,!1,!0),Se})()})),V}}),X),m(Z,d(un,{backend:t,get artifactId(){return e.id},label:"Annotation comment",previewLabel:"Comment preview",previewToggleLabel:"Preview comment",get value(){return Ee()},onChange:Tt,onSubmit:gr,get previewing(){return At()},onPreviewingChange:mn,rows:4,get autoFocus(){return!a.busy()},placeholder:"Add a comment for your agent\u2026",get children(){var V=Fc();return m(V,d(ge,{get each(){return ji()},children:(te,Se)=>(()=>{var je=Gc();return m(je,d(T,{get when(){return Se()>0},get children(){return Wc()}}),null),m(je,d(T,{get when(){return te.path!==P()?.path},get fallback(){return(()=>{var Ae=Yc();return m(Ae,()=>te.tag),Ae})()},get children(){return d($e,{get content(){return te.hint||te.tag},get children(){var Ae=Vc();return Ae.$$click=()=>w({type:qe,path:te.path}),m(Ae,()=>te.tag),H(De=>{var Nt=`Select ${te.tag}`,ft=!!a.draft()||a.busy();return Nt!==De.e&&M(Ae,"aria-label",De.e=Nt),ft!==De.t&&(Ae.disabled=De.t=ft),De},{e:void 0,t:void 0}),Ae}})}}),null),je})()})),V}}),X),m(Z,d(T,{get when(){return dr()},get children(){var V=jc();return m(V,dr),V}}),X),ce.$$click=kn,he.$$click=gr,H(V=>{var te=`${mt().left}px`,Se=`${mt().top}px`,je=`${mt().width}px`,Ae=`calc(100vh - ${mt().top+st}px)`,De=Xe()||a.busy()||a.required()&&!a.draft()||!Ge(Ee());return te!==V.e&&se(u,"left",V.e=te),Se!==V.t&&se(u,"top",V.t=Se),je!==V.a&&se(u,"width",V.a=je),Ae!==V.o&&se(u,"max-height",V.o=Ae),De!==V.i&&(he.disabled=V.i=De),V},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),u}}),d(T,{get when(){return Y(()=>!!e.railOpen)()&&e.railHost!==null},get children(){return d(Go,{get phone(){return Oe()||!!e.railSheet},get host(){return e.railHost??void 0},get topOffset(){return ut()},get rightInset(){return e.rightInset??0},onClose:()=>e.onRailOpenChange(!1),get header(){return Bi()},get children(){var u=Jc(),_=u.firstChild,F=le;return typeof F=="function"?xe(F,u):le=u,m(u,d(T,{get when(){return Y(()=>y().length===0)()&&!P()},get children(){return qc()}}),_),m(u,d(ge,{get each(){return Hi()},children:D=>d(T,{get when(){return zi(D)},children:J=>d(ir,G({get artifactId(){return e.id},backend:t,get a(){return J()},get open(){return S()===D},get hovered(){return I()===D},get busy(){return Xe()},get targetMissing(){return ae().has(D)},get folded(){return wt(k(),"threads",D)},get justOpened(){return A()===D},isCommentFolded:Z=>wt(k(),"comments",Z)},()=>yr(D,!1)))})}),_),m(u,d(ge,{get each(){return qi()},children:D=>d(T,{get when(){return Ji(D)},children:J=>d(ir,G({get artifactId(){return e.id},backend:t,get a(){return J()},get open(){return S()===D},resolved:!0,get hovered(){return I()===D},get busy(){return Xe()},get targetMissing(){return ae().has(D)},get folded(){return wt(k(),"threads",D)},get justOpened(){return A()===D},isCommentFolded:Z=>wt(k(),"comments",Z)},()=>yr(D,!0)))})}),null),m(u,d(T,{get when(){return(b()?.length??0)===0},get children(){return zc()}}),null),u}})}}),d(T,{get when(){return fn()},get children(){return d(Eo,G(Xc,{danger:!0,get busy(){return gn()},get error(){return Ei()},onCancel:()=>{gn()||hn(null)},onConfirm:()=>{Ti()}}))}})]}})}})}pe(["click"]);function vi(e,t){let n=async(s,a,f)=>{let h=await fetch(s,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({file:e,...a}),signal:f}),w=await h.json();if(!h.ok)throw new Ce(w.error??"Local preview request failed",h.status);return w},o=(s,a={},f)=>n("/editor",{operation:s,...a},f),r=async()=>{let s=await fetch("/document?file="+encodeURIComponent(e));if(!s.ok)throw new Ce("Could not reload saved file",s.status);t(await s.json())},i={webAssets:"Add files with afbin, then restart preview.",mentions:"Mentions are unavailable in local preview.",commentImages:"Comment screenshots are unavailable in local preview.",remoteSessions:"Agent sessions are unavailable in local preview.",live:"Local files refresh from disk."},l=s=>i[s]??null,c=s=>{throw new Ce(l(s)??"Unavailable in local preview",503)};return{mode:"offline",unavailable:l,load:()=>o("load"),commitEdit:async s=>{try{let a=await o("commit",s);return a.ok&&await r(),a}catch(a){if(a instanceof Ce)return{ok:!1,status:a.status,body:{error:a.message,edit_id:s.edit_id,markup:null,version:0,details:[{message:a.message}]}};throw a}},prepare:s=>o("prepare",{markup:s}),previewCss:s=>o("css",{markup:s}),previewQueries:s=>o("queries",{markup:s}),queryTable:async()=>{throw new Ce("Open the local dataset file to inspect its rows.",503)},importImage:async()=>({ok:!1,error:l("webAssets")}),versions:()=>o("versions"),version:s=>o("version",{version:s}),revert:async s=>{let a=await o("revert",s);return a.ok&&await r(),a},live:()=>()=>{},liveFrame:async()=>null,queryTransport:()=>({run:(s,a)=>n("/query",{values:s,only:a}),page:async(s,a,f)=>(await n("/query",{values:s,only:[a],page:{name:a,...f}})).tables[a],dispose:()=>{}}),listAnnotations:(s,a)=>o("annotations.list",{status:s},a?.signal),createAnnotation:(s,a)=>o("annotations.create",{input:s,key:a}),actOnAnnotation:(s,a)=>o("annotations.act",{id:s,input:a}),deleteAnnotation:s=>o("annotations.delete",{id:s}),uploadCommentImage:async()=>c("commentImages"),members:async s=>s===void 0?{mentions:{}}:{people:[]},remoteSessions:async()=>({sessions:[]}),deleteRemoteSession:async()=>c("remoteSessions")}}function yi(e){if(!e||typeof e!="object")return!1;let t=e;return t.type===gt&&Array.isArray(t.nodes)}var xi=e=>{let t=new Map,n=o=>{for(let r of o){if(r.type!=="element")continue;let i=r.attributes.find(l=>l.name==="id")?.value;r.isComponent&&i?.static&&typeof i.json=="string"&&t.set(i.json,_e([r])),n(r.children)}};return n(e),t},wi=e=>{let t=new Map,n=(o,r="")=>{o.forEach((i,l)=>{if(i.type!=="element")return;let c=[r,l].filter(s=>s!=="").join(".");i.isComponent&&t.set(c,_e([i])),n(i.children,c)})};return n(e),t};function ki({win:e,root:t,file:n,initialNodes:o,sourceRef:r,portal:i,onStatus:l}){let c=o,s=!1,a=new Set,f=ze(),h=j=>{if(!s)for(let P of[...a])P(j)},w={nonce:f,post:j=>queueMicrotask(()=>h(j)),innerHtmlOf:j=>j.innerHTML},y=null,p=!1,x=!1,g=null,C=null,b=null,L=!1,S=()=>{s||g||!C||!i||!b||!b.edit&&!b.annotate||(g=C({win:e,root:t,portal:i,onAction:(j,P)=>h({type:jt,nonce:f,action:j,selection:P})}),g.setNodes(c),g.update(b))},E=null,O=null,U=!1,k=0,$=null,A=null,R=null,I=j=>j.getAttributeNames().find(P=>P.startsWith("data-mx-"))??null,q=j=>Array.from(j.head.querySelectorAll("style")).filter(P=>I(P)!==null),W=(j,P)=>{let ie=new Map(q(j).map(ne=>[I(ne),ne])),ee=null;for(let ne of P){let fe=I(ne),Oe=ne.textContent??"",Ee=ie.get(fe)??null;ie.delete(fe),Ee?Ee.textContent!==Oe&&(Ee.textContent=Oe):(Ee=j.importNode(ne,!0),ee?ee.after(Ee):j.head.appendChild(Ee)),ee=Ee}for(let ne of ie.values())ne.textContent=""},oe=(j,P)=>{let ie=xi(P),ee=xi(j);return new Set([...ee].filter(([ne,fe])=>ie.get(ne)===fe).map(([ne])=>ne))},ae=(j,P)=>{let ie=wi(P),ee=wi(j);return new Set([...ee].filter(([ne,fe])=>ie.get(ne)===fe).map(([ne])=>ne))},z=()=>{let j=e.document.activeElement;return j instanceof HTMLElement&&t.contains(j)&&!!j.closest("[data-mx-edit-region]")},be=async(j=!1)=>{let P=R;if(!P||z()&&(!j||!y?.canApplyDraft())||s||!p||P.sequence!==k)return;let{disposeChangedDraftIslands:ie,hydrateDraftIslands:ee,morphDraftDom:ne}=await import("./engine-I6R47UTB.js");s||!p||P.sequence!==k||R!==P||(R=null,A!==null&&(e.clearTimeout(A),A=null),W(e.document,P.sheets),y?.unmountCompiledDom(),ie(t,P.stableIds,P.stablePaths),ne(t,P.root,P.stableIds,P.stablePaths),await ee(e,t,P.document,P.stableIds,P.stablePaths),c=P.nodes,$=P.source,y?.setNodes(c),await y?.mountCompiledDom(),E?.setNodes(c),g?.setNodes(c))},me=()=>{queueMicrotask(()=>{be()})};e.document.addEventListener("focusout",me,!0);let le={nonce:f,selectionReady:S,send(j){if(!(s||!j||typeof j!="object")){if(yi(j)){le.update(j);return}if(Lr(j)){if(j.type===Ft){if(p=j.on,!j.on){k++,R=null,A!==null&&e.clearTimeout(A),A=null,y?.dispose(),y=null;return}if(y||x)return;x=!0,Promise.all([import("./session-UFN5GQK2.js"),import("./dom-mounter-3OQN7G4J.js")]).then(([{createFrameEditSession:P},{mountCompiledEditRegions:ie}])=>{if(!(s||!p))return y=P({win:e,root:t,channel:w,requestRender:()=>{},mountCompiled:ie}),y.setNodes(c),y.mountCompiledDom()}).catch(P=>{s||l?.(P instanceof Error?P.message:String(P))}).finally(()=>{x=!1});return}if(!(y&&(y.onParentMessage(j),j.type!==rt&&j.type!==Rn&&j.type!==qe))){if(j.type===rt){if(O=j,E){E.update(j);return}if(j.mode==="off"||U)return;U=!0,import("./annotate-U27XXRZK.js").then(({createFrameAnnotateSession:P})=>{s||(E=P({win:e,root:t,channel:w,isEditing:()=>p}),E.setNodes(c),O&&E.update(O))}).catch(P=>{s||l?.(P instanceof Error?P.message:String(P))}).finally(()=>{U=!1});return}if(j.type===Rn){if(b=j,g){g.update(j);return}if(C){S();return}if(!j.edit&&!j.annotate||L)return;L=!0,import("./selection-actions-426G2H4N.js").then(({createFrameSelectionActions:P})=>{C=P,S()}).catch(P=>{s||l?.(P instanceof Error?P.message:String(P))}).finally(()=>{L=!1});return}j.type===qe&&E?.select(j.path)}}}},update(j){if(!s){if(p&&j.source!==void 0){let P=++k,ie=j.source;e.fetch("/draft",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({file:n,source:ie})}).then(async ee=>{if(ee.status===400||ee.status===422)return;if(!ee.ok)throw new Error(`draft preview answered ${ee.status}`);let ne=await ee.json(),fe=new DOMParser().parseFromString(ne.html,"text/html");if(s||P!==k||!p)return;let Oe=fe.querySelector("[data-mx-inline-story]");if(!Oe)throw new Error("draft preview carried no story");let Ee=$??r.current,{storyUpdateParts:Tt}=await import("./update-parts-OJC3ZSRW.js"),dt=Ee?Tt(Ee)?.nodes??c:c,At=Tt(ie)?.nodes??j.nodes;R={document:fe,root:Oe,sheets:q(fe),nodes:j.nodes,source:ie,stableIds:oe(At,dt),stablePaths:ae(At,dt),sequence:P},await be(),R?.sequence===P&&A===null&&(A=e.setTimeout(()=>{A=null,be(!0)},500))}).catch(ee=>{s||l?.(ee instanceof Error?ee.message:String(ee))});return}j.nodes&&(c=j.nodes,E?.setNodes(c),g?.setNodes(c))}},invalidate(){},subscribe(j){return s||a.add(j),()=>{a.delete(j)}},getViewportRect:()=>new DOMRect(0,0,e.innerWidth,e.innerHeight),dispose(){s||(s=!0,a.clear(),y?.dispose(),y=null,E?.dispose(),E=null,g?.dispose(),g=null,A!==null&&e.clearTimeout(A),e.document.removeEventListener("focusout",me,!0))}};return le}var ed=v("<div class=afbin-preview-bar><strong>Artifactbin preview</strong><span role=status aria-live=polite style=flex:1;opacity:0.8></span><button type=button>Comments (<!>)"),td=v("<button type=button>Edit in place"),nd=v("<button type=button>Edit the source"),rd=v("<button type=button>Done editing"),od=v("<button type=button>Edit document"),id=v('<div style=position:fixed;top:40px;left:0;right:0;bottom:0;z-index:2147483646;background:#0f172a;padding:12px><textarea aria-label="Markup source"style="width:100%;height:100%;box-sizing:border-box;resize:none;font-family:ui-monospace, monospace;font-size:13px;padding:12px;color:#e2e8f0;background:#111827;border:1px solid #334155;border-radius:6px">'),ad=new URLSearchParams(location.search).get("capture")==="1",Rt=decodeURIComponent(location.pathname.slice(11));async function cr(e,t){let n=await fetch(e,t?{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}:{}),o=await n.json();if(!n.ok)throw Error(o.error??`${n.status}`);return o}var $i=40;function sd(e){let[t,n]=N("Ready"),[o,r]=N(!1),[i,l]=N(!1),[c,s]=N(null),[a,f]=N(e.initial),[h,w]=N(0),[y,p]=N(!1),x=e.initial.revision,g={current:e.initial.body},C={current:!1},b={current:null},S=vi(Rt,I=>{x=I.revision,g.current=I.body,f(I),b.current?.update({type:gt,nodes:I.data.nodes})});ye(()=>{document.body.style.paddingTop=`${$i}px`,K(()=>{document.body.style.paddingTop=""});let I=document.getElementById(Cr);if(!I){n("No document root found");return}let q=document.createElement("div");q.setAttribute("data-afbin-selection-portal",""),document.body.append(q),K(()=>q.remove());let W=ki({win:window,root:I,file:Rt,initialNodes:e.initial.data.nodes,sourceRef:g,portal:q,onStatus:z=>n(z)});b.current=W,s(W.nonce),W.selectionReady(),K(()=>W.dispose());let oe=window.setInterval(()=>{o()||C.current||cr("/document?file="+encodeURIComponent(Rt)).then(z=>{z.revision!==x&&location.reload()}).catch(z=>n(String(z)))},1500);K(()=>window.clearInterval(oe));let ae=z=>{C.current&&(z.preventDefault(),z.returnValue="")};window.addEventListener("beforeunload",ae),K(()=>window.removeEventListener("beforeunload",ae))});let E=(I,q=!0)=>{if(C.current=!0,g.current=I,n("Unsaved"),!q)return;let W=ke(I);W.ok&&b.current?.update({type:gt,nodes:Hr(W.nodes).body,source:I})},O=Xr({get editing(){return o()},get sessionNonce(){return c()},runtimeRef:b,sourceRef:g,onError:I=>n(I),onSourceEdited:E}),U=async()=>{try{await O.commitPending(!0),await cr("/save",{file:Rt,revision:x,body:g.current}),C.current=!1,location.reload()}catch(I){n(I instanceof Error?I.message:String(I))}},[k,$]=N(""),A=()=>{$(g.current),l(!0),r(!0)},R={position:"fixed",top:"0",left:"0",right:"0","z-index":2147483647,display:"flex","align-items":"center",gap:"12px",padding:"8px 16px",background:"#0f172a",color:"#e2e8f0",font:"13px system-ui, sans-serif"};return[(()=>{var I=ed(),q=I.firstChild,W=q.nextSibling,oe=W.nextSibling,ae=oe.firstChild,z=ae.nextSibling,be=z.nextSibling;return et(I,R),m(W,t),m(I,(()=>{var me=Y(()=>!!i());return()=>me()?(()=>{var le=td();return le.$$click=()=>l(!1),le})():(()=>{var le=nd();return le.$$click=A,le})()})(),oe),m(I,(()=>{var me=Y(()=>!!o());return()=>me()?(()=>{var le=rd();return le.$$click=()=>{U()},le})():(()=>{var le=od();return le.$$click=()=>r(!0),le})()})(),oe),oe.$$click=()=>p(me=>!me),m(oe,h,z),H(()=>M(oe,"aria-pressed",y())),I})(),Y(()=>Y(()=>!!i())()&&(()=>{var I=id(),q=I.firstChild;return q.$$input=W=>{$(W.currentTarget.value),E(W.currentTarget.value)},H(()=>q.value=k()),I})()),d(bi,{get id(){return a().metadata.id??"local-preview"},backend:S,get railOpen(){return y()},onRailOpenChange:p,runtimeRef:b,get sessionNonce(){return c()},showViewComments:!0,topOffset:$i,pickOnOpen:!0,onAnnotationsChange:I=>w(I.filter(q=>q.status==="open").length)})]}ad||cr("/document?file="+encodeURIComponent(Rt)).then(e=>{let t=document.createElement("div");document.body.append(t),_r(()=>d(sd,{initial:e}),t)}).catch(e=>{let t=document.createElement("pre");t.textContent=e instanceof Error?e.message:String(e),document.body.append(t)});pe(["click","input"]);
|
|
25
|
+
`,i),w=h===-1?e.length:h,x=e.slice(f,w).split(`
|
|
26
|
+
`).map(g=>g.startsWith("- ")?g:`- ${g}`).join(`
|
|
27
|
+
`);return{text:`${e.slice(0,f)}${x}${e.slice(w)}`,start:f,end:f+x.length}}let c=os[o],s=e.slice(0,r),a=e.slice(i);return s.endsWith(c)&&a.startsWith(c)?{text:`${s.slice(0,s.length-c.length)}${l}${a.slice(c.length)}`,start:r-c.length,end:i-c.length}:{text:`${s}${c}${l}${c}${a}`,start:r+c.length,end:i+c.length}}var No=["blue","violet","teal","amber","rose","slate"];function ct(e){let t=0;for(let n of e)t=t*31+n.charCodeAt(0)>>>0;return No[t%No.length]}var Ue={blue:"light-dark(#1d4ed8, #93c5fd)",violet:"light-dark(#6d28d9, #c4b5fd)",teal:"light-dark(#0f766e, #5eead4)",amber:"light-dark(#92400e, #fcd34d)",rose:"light-dark(#be185d, #f9a8d4)",slate:"light-dark(#475569, #cbd5e1)"};function is(e){let t=0;for(let n=0;n<e.length;n+=1)t=(t*31+e.charCodeAt(n))%360;return t}var as=55,ss=30,Do=e=>`hsl(${is(e)} ${as}% ${ss}%)`,Fo=e=>(e?.trim()[0]??"?").toUpperCase();var ls=v('<img alt class="absolute inset-0 size-full object-cover">'),cs=v('<span aria-hidden=true class="relative block shrink-0 overflow-hidden rounded-full"><span data-face-initial class="flex size-full items-center justify-center font-semibold leading-none text-white">');function jo(e){let[t,n]=N(null),o=()=>e.image&&/^(https?:\/\/|\/|data:image\/)/.test(e.image)?e.image:null;return(()=>{var r=cs(),i=r.firstChild;return m(i,()=>Fo(e.initial)),m(r,d(T,{get when(){return Y(()=>!!o())()&&t()!==o()},get children(){var l=ls();return l.addEventListener("error",()=>n(o())),q(()=>I(l,"src",o())),l}}),null),q(l=>{var c=e.size?`${e.size}px`:"100%",s=e.size?`${e.size}px`:"100%",a=Do(e.userId),f=e.size?`${Math.round(e.size*.42)}px`:void 0;return c!==l.e&&ae(r,"width",l.e=c),s!==l.t&&ae(r,"height",l.t=s),a!==l.a&&ae(i,"background-color",l.a=a),f!==l.o&&ae(i,"font-size",l.o=f),l},{e:void 0,t:void 0,a:void 0,o:void 0}),r})()}var ds=v('<svg><path clip-rule=evenodd d="M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z">'),us=v('<svg><path d="M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z">'),ms=v('<svg><path d="M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z">'),fs=v('<svg><path d="M9.064 3.344a4.578 4.578 0 012.285-.312c1 .115 1.891.54 2.673 1.275.01.01.024.017.037.021a.09.09 0 00.043 0 4.55 4.55 0 013.046.275l.047.022.116.057a4.581 4.581 0 012.188 2.399c.209.51.313 1.041.315 1.595a4.24 4.24 0 01-.134 1.223.123.123 0 00.03.115c.594.607.988 1.33 1.183 2.17.289 1.425-.007 2.71-.887 3.854l-.136.166a4.548 4.548 0 01-2.201 1.388.123.123 0 00-.081.076c-.191.551-.383 1.023-.74 1.494-.9 1.187-2.222 1.846-3.711 1.838-1.187-.006-2.239-.44-3.157-1.302a.107.107 0 00-.105-.024c-.388.125-.78.143-1.204.138a4.441 4.441 0 01-1.945-.466 4.544 4.544 0 01-1.61-1.335c-.152-.202-.303-.392-.414-.617a5.81 5.81 0 01-.37-.961 4.582 4.582 0 01-.014-2.298.124.124 0 00.006-.056.085.085 0 00-.027-.048 4.467 4.467 0 01-1.034-1.651 3.896 3.896 0 01-.251-1.192 5.189 5.189 0 01.141-1.6c.337-1.112.982-1.985 1.933-2.618.212-.141.413-.251.601-.33.215-.089.43-.164.646-.227a.098.098 0 00.065-.066 4.51 4.51 0 01.829-1.615 4.535 4.535 0 011.837-1.388zm3.482 10.565a.637.637 0 000 1.272h3.636a.637.637 0 100-1.272h-3.636zM8.462 9.23a.637.637 0 00-1.106.631l1.272 2.224-1.266 2.136a.636.636 0 101.095.649l1.454-2.455a.636.636 0 00.005-.64L8.462 9.23z"fill=url(#mx-codex-grad)></path><defs><linearGradient gradientUnits=userSpaceOnUse id=mx-codex-grad x1=12 x2=12 y1=3 y2=21><stop stop-color=#B1A7FF></stop><stop offset=.5 stop-color=#7A9DFF></stop><stop offset=1 stop-color=#3941FF>');var an=({size:e=16,className:t})=>({viewBox:"0 0 24 24",width:e,height:e,"aria-hidden":!0,class:t});function Ho(e){return(()=>{var t=ds();return ze(t,G(()=>an(e),{fill:"#D97757","fill-rule":"evenodd"}),!0,!0),t})()}function qo(e){return(()=>{var t=us();return ze(t,G(()=>an(e),{fill:"#D97757","fill-rule":"nonzero"}),!0,!0),t})()}function zo(e){return(()=>{var t=ms();return ze(t,G(()=>an(e),{fill:"currentColor","fill-rule":"evenodd"}),!0,!0),t})()}function Jo(e){return(()=>{var t=fs();return ze(t,G(()=>an(e)),!0,!0),t})()}var hs=Ne({session:()=>null,reload:()=>{},pages:null,sessionError:()=>null});var Gn=()=>je(hs);var gs=Ne();function sn(){return je(gs)}var ps=v("<span aria-hidden=true>\u2726"),Bo=v("<span>"),bs=v('<span class="inline-flex h-[22px] w-[22px] shrink-0 rounded-full">'),vs=v('<span class="shrink-0 font-mono text-[9px] uppercase tracking-[0.08em] text-faint">\xB7 '),ys=v('<span class="flex min-w-0 items-center gap-2">'),xs=v('<a class="pointer-events-auto truncate text-[11px] font-semibold text-fg underline-offset-2 hover:text-accent hover:underline">'),ws=v('<a target=_blank rel="noopener noreferrer"class="truncate text-[11px] font-semibold">@'),ks=v('<span class="flex shrink-0 -space-x-1 [&>*]:ring-1 [&>*]:ring-raised">'),$s=v('<span class="flex min-w-0 items-center gap-1.5"><span class=truncate>'),Es=v("<time tabindex=0> \xB7 "),_s=v('<span aria-label="Unread reply"class="pointer-events-none absolute right-0 top-0 z-10 h-2 w-2 rounded-full bg-accent">'),Ss=v('<span aria-label=Resolved class="pointer-events-none absolute bottom-0 right-0 z-10 text-xs text-accent">\u2713'),Cs=v('<span class="absolute right-2 top-1 text-[10px] text-muted"> agents'),Rs=v('<span role=status class="sr-only motion-reduce:not-sr-only">Resolved \xB7 <!> seconds'),Ts=v('<svg aria-hidden=true class="pointer-events-none absolute -left-1 -top-1 h-[30px] w-[30px] motion-reduce:hidden"viewBox="0 0 40 40"><circle cx=20 cy=20 r=18 fill=none stroke=currentColor stroke-width=2 pathLength=100 transform="rotate(-90 20 20)">'),As=v('<span data-thread-count aria-hidden=true class="absolute right-1.5 top-1/2 -translate-y-1/2 font-mono text-[9px] font-bold leading-none text-fg">'),Is=v('<span class="pointer-events-none absolute inset-0 flex items-center justify-start pl-[7px]"><span class="relative flex h-[22px] w-[22px] shrink-0 items-center justify-center">'),Ps=v('<button type=button aria-label="Expand replies"class="pointer-events-auto cursor-pointer rounded-sm text-left hover:text-accent focus-visible:outline-2 focus-visible:outline-accent">'),Ms=v('<span role=list aria-label="Thread replies"class="pointer-events-auto mt-2 flex flex-col gap-3 border-t border-edge pt-2">'),Os=v('<span class="pointer-events-none relative z-10 flex h-full animate-[rise_.12s_ease-out] flex-col"><span class="flex items-center justify-between gap-2"></span><span class="mt-1.5 line-clamp-2 block font-sans text-sm leading-snug text-fg/90"></span><span class="mt-auto flex items-center justify-between font-mono text-[10px] text-faint"><span class="transition-colors group-hover:text-accent">open \u2192'),Ls=v('<article style="position:fixed;right:12px;max-width:calc(100vw - 24px)"><button type=button class="absolute inset-0 z-0 cursor-pointer focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-accent">'),Ns=v("<span class=sr-only>"),Ds=v('<span role=listitem class=block><span class="mt-1 block whitespace-pre-wrap break-words font-sans text-sm leading-snug text-fg/90">'),Fs=36,js=44,Hs=48,dn=36,Uo=108,qs=6,dt=12,Yn=Ne(!1),Rt=e=>on(Ct(e)),Kn=e=>Rt(e).split(`
|
|
28
|
+
`,1)[0]??"",Qe=e=>e.label?.trim()||(e.kind==="human"?"You":"Agent"),zs=e=>`${e.kind}:${Qe(e).toLowerCase()}`;function Js(e){let t=new Set;return e.slice(1).flatMap(({author:n})=>{let o=zs(n);return t.has(o)?[]:(t.add(o),[n])})}function Xn(e){let t=()=>Qe(e.author);return d(jo,{get image(){return e.author.image??null},get initial(){return t()},get userId(){return e.author.user_id??`label:${t()}`},get size(){return e.size}})}function Zn(e){let t=()=>{switch(e.label.toLowerCase()){case"codex":return d(Jo,{get size(){return e.compact?13:17}});case"chatgpt":return d(zo,{get size(){return e.compact?12:16}});case"claude code":return d(Ho,{get size(){return e.compact?12:16}});case"claude":return d(qo,{get size(){return e.compact?12:16}});default:return(()=>{var n=ps();return q(()=>de(n,`${e.compact?"text-[10px]":"text-[12px]"} leading-none text-accent`)),n})()}};return(()=>{var n=Bo();return m(n,t),q(o=>{var r=e.decorative?void 0:`${e.label} agent`,i=e.decorative||void 0,l=`inline-flex shrink-0 items-center justify-center rounded-full bg-surface text-fg ${e.borderless?"":"border border-edge"} ${e.compact?"h-[18px] w-[18px]":"h-[22px] w-[22px]"}`;return r!==o.e&&I(n,"aria-label",o.e=r),i!==o.t&&I(n,"aria-hidden",o.t=i),l!==o.a&&de(n,o.a=l),o},{e:void 0,t:void 0,a:void 0}),n})()}function ln(e){let t=()=>Qe(e.author),n=je(Yn);return(()=>{var o=ys();return m(o,d(T,{get when(){return e.author.kind==="human"},get fallback(){return d(Zn,{get label(){return t()}})},get children(){var r=bs();return m(r,d(Xn,{get author(){return e.author},size:22})),q(()=>I(r,"aria-label",`${t()} avatar`)),r}}),null),m(o,d(T,{get when(){return e.author.sessionId},get fallback(){return d(T,{get when(){return e.author.kind==="human"&&e.author.label&&!n},get fallback(){return(()=>{var r=Bo();return m(r,t),q(()=>de(r,`truncate text-[11px] font-semibold ${e.author.kind==="agent"?"text-accent":"text-fg"}`)),r})()},get children(){var r=xs();return m(r,t),q(i=>{var l=`/@${encodeURIComponent(e.author.label)}`,c=`View @${e.author.label} profile`;return l!==i.e&&I(r,"href",i.e=l),c!==i.t&&I(r,"aria-label",i.t=c),i},{e:void 0,t:void 0}),r}})},children:r=>(()=>{var i=ws(),l=i.firstChild;return m(i,t,null),q(c=>{var s=`/chat?session=${r()}`,a=Ue[e.author.color??ct(r())];return s!==c.e&&I(i,"href",c.e=s),a!==c.t&&ae(i,"color",c.t=a),c},{e:void 0,t:void 0}),i})()}),null),m(o,d(T,{get when(){return Y(()=>e.author.kind==="agent")()&&e.author.transport!=="unknown"},get children(){var r=vs(),i=r.firstChild;return m(r,()=>e.author.transport,null),q(()=>I(r,"aria-label",`Transport ${e.author.transport.toUpperCase()}`)),r}}),null),o})()}function Bs(e){return d(T,{get when(){return e.author.kind==="agent"},get fallback(){return d(Xn,{get author(){return e.author},size:18})},get children(){return d(Zn,{get label(){return Qe(e.author)},compact:!0,decorative:!0})}})}function cn(e){let t=()=>Math.max(0,e.thread.length-1),n=()=>Js(e.thread);return(()=>{var o=$s(),r=o.firstChild;return m(o,d(T,{get when(){return n().length>0},get children(){var i=ks();return m(i,d(ge,{get each(){return n().slice(0,3)},children:l=>d(Bs,{author:l})})),q(()=>I(i,"aria-label",`Reply participants: ${n().map(Qe).join(", ")}`)),i}}),r),m(r,(()=>{var i=Y(()=>t()>0);return()=>i()?`+${t()} more`:"1 message"})()),o})()}function Us(e){return d(T,{get when(){return e.author.kind==="agent"},get fallback(){return d(Xn,{get author(){return e.author},size:22})},get children(){return d(Zn,{get label(){return Qe(e.author)},compact:!0,decorative:!0,borderless:!0})}})}function Qn(e){let t=()=>new Date(e.iso),n=()=>!Number.isNaN(t().getTime()),o=()=>t().toLocaleDateString("en-GB",{day:"numeric",month:"short",...t().getFullYear()!==new Date().getFullYear()?{year:"numeric"}:{}}),r=()=>t().toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),i=()=>t().toLocaleString(void 0,{year:"numeric",month:"long",day:"numeric",weekday:"long",hour:"numeric",minute:"2-digit",second:"2-digit",timeZoneName:"long"});return d(T,{get when(){return n()},get children(){return d($e,{get content(){return i()},get children(){var l=Es(),c=l.firstChild;return m(l,o,c),m(l,r,null),q(s=>{var a=e.iso,f=i(),h=e.class;return a!==s.e&&I(l,"datetime",s.e=a),f!==s.t&&I(l,"aria-label",s.t=f),h!==s.a&&de(l,s.a=h),s},{e:void 0,t:void 0,a:void 0}),l}})}})}function Wo(e,t,n,o){let r=e.flatMap(f=>{let h=t[f.id];return!h||h.y+h.height<0||h.y>n.height?[]:[{annotation:f,target:n.top+h.y}]}).sort((f,h)=>f.target-h.target);if(!r.length)return[];let i=n.top+dt,l=i,c=r.map(({annotation:f,target:h})=>{let w=Math.max(h,l);return l=w+dn+qs,{annotation:f,top:w}}),s=c.at(-1).top+Uo+dt-o,a=Math.max(0,Math.min(s,c[0].top-i));return a>0?c.map(f=>({...f,top:f.top-a})):c}var Ws=["queued","dispatching","delivered","acknowledged"];function Vo(e){let[t,n]=N(!1),[o,r]=N();Q(()=>{if(!e.hovered){n(!1);return}let p=o();if(!p)return;let _,b=()=>{clearTimeout(_)},O=()=>{b(),_=setTimeout(()=>n(!0),600)};p.addEventListener("mouseenter",O),p.addEventListener("mouseleave",b),K(()=>{b(),p.removeEventListener("mouseenter",O),p.removeEventListener("mouseleave",b)})});let i=()=>e.row.thread[0],l=()=>i()?Qe(i().author):"Unknown",c=()=>e.row.thread.length,s=()=>(e.row.remote_work??[]).filter((p,_,b)=>!b.slice(_+1).some(O=>O.sessionId===p.sessionId)),a=()=>s().filter(p=>p.connection==="online"&&Ws.includes(p.phase)&&p.activity!=="unknown"),f=()=>a().at(-1)??s().at(-1),h=sn(),w=()=>h?.state()?.notifications.some(p=>!p.read_at&&p.source===`comment:${e.row.id}`),x=()=>a().length>0,g=()=>c()>9?Hs:c()>1?js:Fs,y=()=>e.hovered?"5px":"50% 50% 50% 3px";return(()=>{var p=Ls(),_=p.firstChild;return p.$$focusout=b=>{b.currentTarget.contains(b.relatedTarget)||e.onHover(null)},p.$$focusin=()=>e.onHover(e.row.id),p.addEventListener("mouseleave",()=>e.onHover(null)),p.addEventListener("mouseenter",()=>e.onHover(e.row.id)),_.$$click=()=>e.onOpen(),m(p,d(T,{get when(){return w()},get children(){return _s()}}),null),m(p,d(T,{get when(){return e.row.status==="resolved"},get children(){return Ss()}}),null),m(p,d(T,{get when(){return f()},children:b=>(()=>{var O=Ns();return m(O,()=>Qt(b()),null),m(O,(()=>{var S=Y(()=>s().length>1);return()=>S()?` \xB7 ${s().length} agents`:null})(),null),O})()}),null),m(p,d(T,{get when(){return Y(()=>!!e.hovered)()&&s().length>1},get children(){var b=Cs(),O=b.firstChild;return m(b,()=>s().length,O),b}}),null),m(p,d(T,{get when(){return e.remaining!==void 0},get children(){var b=Rs(),O=b.firstChild,S=O.nextSibling,R=S.nextSibling;return m(b,()=>Math.ceil((e.remaining??0)/1e3),S),b}}),null),m(p,d(T,{get when(){return Y(()=>!!i())()&&!e.hovered},get children(){var b=Is(),O=b.firstChild;return m(O,d(T,{get when(){return e.remaining!==void 0},get children(){var S=Ts(),R=S.firstChild;return q(()=>I(R,"stroke-dasharray",`${(e.remaining??0)/100} 100`)),S}}),null),m(O,d(Us,{get author(){return i().author}}),null),m(b,d(T,{get when(){return c()>1},get children(){var S=As();return m(S,(()=>{var R=Y(()=>c()>9);return()=>R()?"9+":c()})()),S}}),null),b}}),null),m(p,d(T,{get when(){return Y(()=>!!i())()&&e.hovered},get children(){var b=Os(),O=b.firstChild,S=O.nextSibling,R=S.nextSibling,P=R.firstChild;return m(O,d(ln,{get author(){return i().author}}),null),m(O,d(Qn,{get iso(){return i().created_at},class:"font-mono text-[10px] text-faint"}),null),m(S,()=>Rt(i().body)),m(R,d(T,{get when(){return c()>1},get fallback(){return d(cn,{get thread(){return e.row.thread}})},get children(){var J=Ps();return J.$$click=()=>n(!0),ye(r,J),m(J,d(cn,{get thread(){return e.row.thread}})),q(()=>I(J,"aria-expanded",t())),J}}),P),m(b,d(T,{get when(){return t()},get children(){var J=Ms();return m(J,d(ge,{get each(){return e.row.thread.slice(1)},children:k=>(()=>{var $=Ds(),M=$.firstChild;return m($,d(ln,{get author(){return k.author}}),M),m(M,()=>Rt(k.body)),$})()})),J}}),null),b}}),null),q(b=>{var O=e.row.id,S=e.hovered?"true":void 0,R=`${x()?"motion-safe:animate-pulse":""} group pointer-events-auto overflow-hidden border text-left shadow-md transition-[top,width,height,border-color,background-color,box-shadow] duration-150 ${e.hovered?"z-10 border-edge-bright bg-comment-hover px-3 py-2.5 shadow-xl":"border-transparent bg-raised hover:bg-raised"}`,P=f()?`2px solid ${Ue[f().color]}`:void 0,J=`${e.top}px`,k=`${e.hovered?288:g()}px`,$=e.hovered?t()?"auto":`${Uo}px`:`${dn}px`,M=e.hovered&&t()?`calc(100dvh - ${e.top+dt}px)`:void 0,A=e.hovered&&t()?"auto":void 0,C=y(),H=`Open annotation conversation by ${l()}, ${c()} message${c()===1?"":"s"}`,W=y();return O!==b.e&&I(p,"data-annotation-id",b.e=O),S!==b.t&&I(p,"data-hovered",b.t=S),R!==b.a&&de(p,b.a=R),P!==b.o&&ae(p,"outline",b.o=P),J!==b.i&&ae(p,"top",b.i=J),k!==b.n&&ae(p,"width",b.n=k),$!==b.s&&ae(p,"height",b.s=$),M!==b.h&&ae(p,"max-height",b.h=M),A!==b.r&&ae(p,"overflow-y",b.r=A),C!==b.d&&ae(p,"border-radius",b.d=C),H!==b.l&&I(_,"aria-label",b.l=H),W!==b.u&&ae(_,"border-radius",b.u=W),b},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0}),p})()}pe(["focusin","focusout","click"]);var Vs=v('<div class="flex flex-col gap-2.5">'),Gs=v('<aside data-capture-chrome aria-label="Annotation sidebar"class="fixed bottom-0 z-20 flex flex-col gap-2.5 border-l border-edge bg-bg p-2.5"><div class=shrink-0></div><div class="flex min-h-0 flex-1 flex-col gap-2.5 overflow-y-auto">'),Ys=v('<section data-capture-chrome aria-label="Annotation sidebar"class="flex min-h-0 flex-1 flex-col gap-2.5 bg-bg p-2.5"><div class=shrink-0></div><div class="flex min-h-0 flex-1 flex-col gap-2.5 overflow-y-auto">');function Go(e){let t=()=>e.busy||void 0;return d(T,{get when(){return!e.phone},get fallback(){return d(qn,{label:"Annotation sidebar",get onClose(){return e.onClose},size:"half",get header(){return e.header},get children(){var n=Vs();return m(n,()=>e.children),q(()=>I(n,"aria-busy",t())),n}})},get children(){return d(T,{get when(){return e.host},get fallback(){return(()=>{var n=Gs(),o=n.firstChild,r=o.nextSibling;return ae(n,"width",`${320}px`),m(o,()=>e.header),m(r,()=>e.children),q(i=>{var l=t(),c=`${e.topOffset}px`,s=`${e.rightInset}px`;return l!==i.e&&I(n,"aria-busy",i.e=l),c!==i.t&&ae(n,"top",i.t=c),s!==i.a&&ae(n,"right",i.a=s),i},{e:void 0,t:void 0,a:void 0}),n})()},children:n=>d(it,{get mount(){return n()},ref:o=>{o.style.display="contents"},get children(){var o=Ys(),r=o.firstChild,i=r.nextSibling;return m(r,()=>e.header),m(i,()=>e.children),q(()=>I(o,"aria-busy",t())),o}})})}})}var Ks=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],un=e=>d(re,G(e,{iconNode:Ks,name:"chevron-down"}));var Xs=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Yo=e=>d(re,G(e,{iconNode:Xs,name:"chevron-right"}));var Zs=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],Ko=e=>d(re,G(e,{iconNode:Zs,name:"ellipsis-vertical"}));var Qs=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Xo=e=>d(re,G(e,{iconNode:Qs,name:"trash-2"}));var el=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],Zo=e=>d(re,G(e,{iconNode:el,name:"bold"}));var tl=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Qo=e=>d(re,G(e,{iconNode:tl,name:"code"}));var nl=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],ei=e=>d(re,G(e,{iconNode:nl,name:"italic"}));var rl=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],ti=e=>d(re,G(e,{iconNode:rl,name:"link-2"}));var ol=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],ni=e=>d(re,G(e,{iconNode:ol,name:"list"}));function ut(e){let t=[],n="",o=0;for(let c of[...Et(e),...Io(e)].sort((s,a)=>s.index-a.index)){n+=e.slice(o,c.index);let s=n.length;n+=c[1],o=c.index+c[0].length,t.push({start:c.index,end:o,from:s,to:n.length})}n+=e.slice(o);let r=(c,s="start")=>{let a=0;for(let f of t){if(c<=f.from)break;if(c<f.to)return s==="start"?f.start:f.end;a+=f.end-f.start-(f.to-f.from)}return c+a};return{text:n,toRaw:r,toDisplay:c=>{let s=0;for(let a of t){if(c<=a.start)break;if(c<a.end)return a.from+Math.min(c-a.start,a.to-a.from);s+=a.end-a.start-(a.to-a.from)}return c-s},edit:(c,s)=>{if(c===n)return e;let a=0,f=0;for(;a<s&&a<n.length&&n[a]===c[a];)a++;for(;f<c.length-s&&f<n.length-a&&n[n.length-f-1]===c[c.length-f-1];)f++;let h=n.length-f,w=c.slice(a,c.length-f),x=t.find(y=>a>y.from&&a<y.to),g=t.find(y=>h>y.from&&h<y.to);return x&&(w=n.slice(x.from,a)+w,a=x.from),g&&(w+=n.slice(h,g.to),h=g.to),e.slice(0,r(a))+w+e.slice(r(h,"end"))}}}var il=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],ri=e=>d(re,G(e,{iconNode:il,name:"copy"}));var al=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],oi=e=>d(re,G(e,{iconNode:al,name:"plus"}));function sl(e){if(typeof document>"u"||typeof document.execCommand!="function")return!1;let t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.cssText="position:fixed;top:0;left:0;opacity:0;pointer-events:none",document.body.appendChild(t);try{return t.select(),document.execCommand("copy")}catch{return!1}finally{t.remove()}}async function ii(e){try{if(typeof navigator<"u"&&typeof navigator.clipboard?.writeText=="function")return await navigator.clipboard.writeText(e),!0}catch{}return sl(e)}var ll=v('<p class="px-2 py-1.5 text-xs text-muted">Mention a person'),cl=v('<p role=note class="px-2 py-1 text-xs text-muted">'),dl=v('<p role=alert class="px-2 py-1.5 text-sm text-muted">'),ul=v('<button type=button class="mt-1 flex w-full cursor-pointer items-center gap-2 rounded-md border border-edge bg-bg px-2 py-2 text-left text-xs font-medium text-fg transition-colors hover:bg-accent-soft focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent">Add another agent'),ml=v('<p role=note class="px-2 py-1.5 text-xs text-muted">'),fl=v("<p>"),hl=v("<p class=mt-2>Ask your agent to connect:"),gl=v('<button type=button aria-label="Copy connection request"class="shrink-0 cursor-pointer rounded-md p-1 text-muted hover:text-fg">'),pl=v('<div class="mt-2 flex items-start gap-2 rounded-md border border-edge bg-bg p-2"><p class="min-w-0 flex-1 text-xs text-fg">Connect to afbin remote so I can @mention you in artifact comments.'),bl=v('<p role=status class="mt-1 text-xs">'),vl=v('<div class="px-2 py-1.5 text-muted">'),yl=v('<div aria-label="Agent sessions"class="mb-2 overflow-hidden rounded-lg border border-edge bg-surface p-1.5 text-sm shadow-lg"><p class="px-2 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted">Mention an agent'),xl=v('<button type=button>@<span class="ml-2 text-xs text-muted">'),wl=v('<p class="px-2 py-1 text-xs text-muted">No matching followers or members.'),kl=v('<button type=button class="rounded-md p-2 text-muted hover:text-fg disabled:opacity-40">'),$l=v('<div class="flex items-center"><button type=button><span aria-hidden=true class="flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-accent-soft font-semibold text-accent">@</span><span class="min-w-0 flex-1"><span class="block truncate font-medium text-fg"></span><span class="block truncate text-xs text-muted"> \xB7 </span></span><span class="flex shrink-0 items-center gap-1 text-[10px] text-muted"><span>'),El="Connect to afbin remote so I can @mention you in artifact comments.",_l=e=>({claude:"Claude Code",codex:"Codex",pi:"Pi",opencode:"OpenCode"})[e]??e;function ai(e){let[t,n]=N([]),[o,r]=N([]),[i,l]=N(0),[c,s]=N(!1),[a,f]=N(!1),[h,w]=N("idle"),[x,g]=N(""),[y,p]=N(null),_=e.backend.unavailable("remoteSessions"),b=e.backend.unavailable("mentions"),O=()=>t().filter($=>!$.runId&&($.managed?$.exitCode===null&&$.activity!=="stopped":$.online)&&`${$.name} ${$.harness}`.toLowerCase().includes(e.query.toLowerCase())),S=$=>e.onSelect(en($)),R={keyDown($){let M=o().length+O().length;if(!M)return!1;if($==="ArrowDown"||$==="ArrowUp")return l(A=>(A+($==="ArrowDown"?1:M-1))%M),!0;if($==="Enter"||$==="Tab"){let A=i()%M,C=o()[A];if(C)e.onSelect(Bn(C));else{let H=O()[A-o().length];H&&S(H)}return!0}return!1}};ve(()=>{if(e.onReady?.(R),K(()=>e.onReady?.(null)),_)return;let $=new AbortController;e.backend.remoteSessions({signal:$.signal}).then(M=>{n(M.sessions??[]),s(!0)}).catch(()=>s(!0)),K(()=>$.abort())}),Q(()=>{let $=e.query;if(l(0),!e.artifactId||b)return;let M=new AbortController;e.backend.members($,{signal:M.signal}).then(A=>A??{people:[]}).then(A=>r(A.people??[])).catch(()=>{}),K(()=>M.abort())});let P=async $=>{p($),g("");try{await e.backend.deleteRemoteSession($),n(M=>M.filter(A=>A.id!==$)),l(0)}catch(M){g(M instanceof Error?M.message:"Could not remove agent. Try again.")}finally{p(null)}},J=async()=>{w(await ii(El)?"copied":"error")},k=$=>$.preventDefault();return(()=>{var $=yl(),M=$.firstChild;return m($,d(T,{get when(){return e.artifactId},get children(){return[ll(),d(ge,{get each(){return o()},children:(A,C)=>(()=>{var H=xl(),W=H.firstChild,ne=W.nextSibling;return H.$$click=()=>e.onSelect(Bn(A)),H.addEventListener("mouseenter",()=>l(C())),H.$$mousedown=k,m(H,()=>A.username,ne),m(ne,()=>A.name),q(oe=>{var z=`Mention @${A.username}`,we=`block w-full rounded-md px-2 py-2 text-left ${C()===i()?"bg-accent-soft":"hover:bg-bg"}`;return z!==oe.e&&I(H,"aria-label",oe.e=z),we!==oe.t&&de(H,oe.t=we),oe},{e:void 0,t:void 0}),H})()}),d(T,{when:b,get fallback(){return d(T,{get when(){return!o().length},get children(){return wl()}})},get children(){var A=cl();return m(A,b),A}})]}}),M),m($,d(ge,{get each(){return O()},children:(A,C)=>(()=>{var H=$l(),W=H.firstChild,ne=W.firstChild,oe=ne.nextSibling,z=oe.firstChild,we=z.nextSibling,fe=we.firstChild,ie=oe.nextSibling,Ae=ie.firstChild;return W.$$click=()=>S(A),W.$$mousedown=k,W.addEventListener("mouseenter",()=>l(C()+o().length)),m(z,()=>A.name),m(we,()=>_l(A.harness),fe),m(we,()=>A.machine,null),m(ie,(()=>{var ee=Y(()=>!!A.online);return()=>ee()?A.activity??"Online":"Offline"})(),null),m(H,d(T,{get when(){return!A.online},get children(){return d($e,{content:"Remove agent",get children(){var ee=kl();return ee.$$click=()=>{P(A.id)},ee.$$mousedown=k,m(ee,d(Ye,{size:14,"aria-hidden":"true"})),q(L=>{var j=`Remove ${A.name}`,se=y()!==null;return j!==L.e&&I(ee,"aria-label",L.e=j),se!==L.t&&(ee.disabled=L.t=se),L},{e:void 0,t:void 0}),ee}})}}),null),q(ee=>{var L=`Mention ${A.name} (${A.harness})`,j=`flex min-w-0 flex-1 items-center gap-2.5 rounded-md px-2 py-2 text-left transition-colors ${C()+o().length===i()?"bg-accent-soft":"hover:bg-bg"}`,se=Ue[A.color??ct(A.id)],le=`h-1.5 w-1.5 rounded-full ${A.online?"bg-green-500":"bg-muted"}`;return L!==ee.e&&I(W,"aria-label",ee.e=L),j!==ee.t&&de(W,ee.t=j),se!==ee.a&&ae(ne,"color",ee.a=se),le!==ee.o&&de(Ae,ee.o=le),ee},{e:void 0,t:void 0,a:void 0,o:void 0}),H})()}),null),m($,d(T,{get when(){return x()},get children(){var A=dl();return m(A,x),A}}),null),m($,d(T,{get when(){return Y(()=>!!c())()&&O().length>0},get children(){var A=ul(),C=A.firstChild;return A.$$click=()=>f(H=>!H),A.$$mousedown=k,m(A,d(oi,{size:14,"aria-hidden":"true"}),C),m(A,d(un,{size:14,"aria-hidden":"true",get class(){return`ml-auto transition-transform ${a()?"rotate-180":""}`}}),null),q(()=>I(A,"aria-expanded",a())),A}}),null),m($,d(T,{when:_,get children(){var A=ml();return m(A,_),A}}),null),m($,d(T,{get when(){return!_&&(!O().length||a())},get children(){var A=vl();return m(A,d(T,{get when(){return!O().length},get children(){var C=fl();return m(C,()=>c()?"No matching agents.":"Loading sessions\u2026"),C}}),null),m(A,d(T,{get when(){return c()},get children(){return[hl(),(()=>{var C=pl(),H=C.firstChild;return m(C,d($e,{get content(){return h()==="copied"?"Copied":"Copy request"},get children(){var W=gl();return W.$$click=()=>{J()},W.$$mousedown=k,m(W,d(T,{get when(){return h()==="copied"},get fallback(){return d(ri,{size:14,"aria-hidden":"true"})},get children(){return d(yt,{size:14,"aria-hidden":"true"})}})),W}}),null),C})(),(()=>{var C=bl();return m(C,(()=>{var H=Y(()=>h()==="copied");return()=>H()?"Copied \u2014 paste into your agent.":h()==="error"?"Could not copy. Select and copy the request above.":""})()),C})()]}}),null),A}}),null),$})()}pe(["mousedown","click"]);var Sl=v('<span class="ml-1 text-xs text-muted-foreground"aria-label="Invitation pending">\xB7 Pending'),Cl=v("<a>"),si=Ne(()=>({}));function li(e){let[t,n]=N({});return ve(()=>{let o=e.backend;if(!e.artifactId||!o||o.unavailable("mentions")||window.location.pathname.endsWith("/raw"))return;let r=new AbortController,i=()=>{o.members(void 0,{signal:r.signal}).then(c=>{c&&!r.signal.aborted&&n(c.mentions??{})}).catch(()=>{})};i();let l=setInterval(i,15e3);window.addEventListener("focus",i),K(()=>{r.abort(),clearInterval(l),window.removeEventListener("focus",i)})}),d(si.Provider,{value:t,get children(){return e.children}})}function ci(e){let t=je(si),n=()=>lt(e.href)?t()[e.href.slice(8)]:void 0;return(()=>{var o=Cl();return m(o,()=>e.children,null),m(o,d(T,{get when(){return n()==="pending"},get children(){return Sl()}}),null),q(r=>{var i=e.href,l=e.class;return i!==r.e&&I(o,"href",r.e=i),l!==r.t&&de(o,r.t=l),r},{e:void 0,t:void 0}),o})()}var Rl=v("<br>"),Tl=v('<strong class="font-semibold text-fg">'),Al=v("<em class=italic>"),Il=v('<code class="break-all rounded-[3px] bg-raised px-1 py-0.5 font-mono text-[0.92em] text-fg">'),Pl=v('<a target=_blank rel="noopener noreferrer"data-agent-mention class="inline-flex max-w-full items-center rounded-md border border-accent/20 bg-accent-soft px-1.5 py-0.5 align-baseline text-[0.9em] font-medium text-accent no-underline hover:bg-accent/15 focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent">'),Ml=v('<a target=_blank rel="noopener noreferrer"class="break-words text-accent underline decoration-dotted underline-offset-2 hover:decoration-solid">'),Ol=v("<p class=leading-normal>"),Ll=v('<pre class="min-w-0 max-w-full overflow-x-auto rounded-[4px] border border-edge bg-raised p-2 font-mono text-[11px] leading-snug text-fg"><code>'),Nl=v('<li class="min-w-0 leading-normal">'),Dl=v('<ol class="min-w-0 pl-5 list-decimal marker:text-faint">'),Fl=v('<ul class="min-w-0 pl-5 list-disc marker:text-faint">'),jl=v('<blockquote class="min-w-0 border-l-2 border-edge pl-2.5 text-muted">'),Hl=v("<div data-markdown>"),ql=v("<button type=button>"),zl=v('<p class="mb-2 text-[10px] text-muted">Ctrl/\u2318 + Enter to send'),Jl=v('<div><div role=toolbar class="mb-1 flex items-center gap-0.5">'),Bl=v('<button type=button class="inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-[3px] text-muted hover:bg-surface hover:text-fg disabled:cursor-default disabled:opacity-40">'),Ul=v('<textarea class="mb-2 min-h-24 w-full resize-y rounded-md border border-edge bg-surface p-3 font-sans text-sm leading-relaxed placeholder:text-faint focus:border-accent focus:outline-none focus:ring-2 focus:ring-accent/10">');function mt(e){return d(ge,{each:e,children:t=>{switch(t.kind){case"text":return t.text;case"break":return Rl();case"strong":return(()=>{var n=Tl();return m(n,()=>mt(t.children)),n})();case"em":return(()=>{var n=Al();return m(n,()=>mt(t.children)),n})();case"code":return(()=>{var n=Il();return m(n,()=>t.text),n})();case"link":return lt(t.href)?d(ci,{get href(){return t.href},class:"text-accent",get children(){return mt(t.children)}}):Zt(t.href)?d($e,{content:"Open agent session",get children(){var n=Pl();return m(n,()=>mt(t.children)),q(o=>{var r=t.href,i=Ue[ct(t.href.split("=")[1]??"")];return r!==o.e&&I(n,"href",o.e=r),i!==o.t&&ae(n,"color",o.t=i),o},{e:void 0,t:void 0}),n}}):(()=>{var n=Ml();return m(n,()=>mt(t.children)),q(()=>I(n,"href",t.href)),n})()}}})}function tr(e){switch(e.kind){case"paragraph":return(()=>{var t=Ol();return m(t,()=>mt(e.children)),t})();case"code_block":return(()=>{var t=Ll(),n=t.firstChild;return m(n,()=>e.text),t})();case"list":{let t=()=>d(ge,{get each(){return e.items},children:n=>(()=>{var o=Nl();return m(o,d(ge,{get each(){return n.children},children:tr})),o})()});return e.ordered?(()=>{var n=Dl();return m(n,t),n})():(()=>{var n=Fl();return m(n,t),n})()}case"quote":return(()=>{var t=jl();return m(t,d(ge,{get each(){return e.children},children:tr})),t})()}}function nr(e){return(()=>{var t=Hl();return m(t,d(ge,{get each(){return Ct(e.text)},children:tr})),q(n=>{var o=e.label,r=`flex min-w-0 flex-col gap-2 font-sans leading-normal text-fg/90 ${e.class??""}`;return o!==n.e&&I(t,"aria-label",n.e=o),r!==n.t&&de(t,n.t=r),n},{e:void 0,t:void 0}),t})()}var Wl={b:"bold",i:"italic",e:"code"},Vl=[{marker:"bold",label:"Bold",hint:"bold (\u2318B)",Icon:Zo},{marker:"italic",label:"Italic",hint:"italic (\u2318I)",Icon:ei},{marker:"code",label:"Code",hint:"code (\u2318E)",Icon:Qo},{marker:"link",label:"Link",hint:"link",Icon:ti},{marker:"list",label:"List",hint:"list",Icon:ni}];function mn(e){let t,n=null,[o,r]=N(!1),i=()=>e.previewing??o(),l=g=>{e.onPreviewingChange?e.onPreviewingChange(g):r(g)},[c,s]=N(null),a=()=>!e.backend||!(e.backend.unavailable("remoteSessions")&&e.backend.unavailable("mentions")),f=(g,y)=>queueMicrotask(()=>{if(!t?.isConnected)return;let p=ut(e.value);t.focus(),t.setSelectionRange(p.toDisplay(g),p.toDisplay(y))}),h=g=>{if(!t)return;let y=ut(e.value),p=Lo(e.value,y.toRaw(t.selectionStart),y.toRaw(t.selectionEnd,"end"),g);e.onChange(p.text),f(p.start,p.end)},w=g=>{let y=c();if(!y)return;let p=y.start+g.length;e.onChange(e.value.slice(0,y.start)+g+e.value.slice(y.end)),s(null),f(p,p)};ve(()=>{e.autoFocus&&t?.focus()});let x=g=>{if(g.isComposing)return;if(c()&&!g.metaKey&&!g.ctrlKey){if(g.key==="Escape"){g.preventDefault(),g.stopPropagation(),s(null);return}if(n?.keyDown(g.key)){g.preventDefault(),g.stopPropagation();return}}if(!g.metaKey&&!g.ctrlKey)return;if(g.key==="Enter"){g.preventDefault(),e.onSubmit?.();return}let y=Wl[g.key.toLowerCase()];y&&(g.preventDefault(),h(y))};return(()=>{var g=Jl(),y=g.firstChild;return m(g,()=>e.children,y),m(y,d(ge,{each:Vl,children:p=>d($e,{get content(){return p.hint},get children(){var _=Bl();return _.$$click=()=>h(p.marker),_.$$mousedown=b=>b.preventDefault(),m(_,d(p.Icon,{size:13,strokeWidth:1.8})),q(b=>{var O=p.label,S=i();return O!==b.e&&I(_,"aria-label",b.e=O),S!==b.t&&(_.disabled=b.t=S),b},{e:void 0,t:void 0}),_}})}),null),m(y,d($e,{get content(){return i()?"back to writing":"preview markdown"},get children(){var p=ql();return p.$$click=()=>{s(null),l(!i())},p.$$mousedown=_=>_.preventDefault(),m(p,()=>i()?"edit":"preview"),q(_=>{var b=e.previewToggleLabel??"Preview comment",O=i(),S=`ml-auto cursor-pointer rounded-[3px] px-1.5 py-0.5 font-mono text-[10px] ${i()?"bg-accent-soft text-accent":"text-faint hover:bg-surface hover:text-fg"}`;return b!==_.e&&I(p,"aria-label",_.e=b),O!==_.t&&I(p,"aria-pressed",_.t=O),S!==_.a&&de(p,_.a=S),_},{e:void 0,t:void 0,a:void 0}),p}}),null),m(g,d(T,{get when(){return i()},get fallback(){return(()=>{var p=Ul();p.$$keydown=x,p.$$click=()=>s(null),p.$$input=b=>{let O=b.currentTarget.value,S=b.currentTarget.selectionStart,R=ut(e.value).edit(O,S),P=ut(R),J=O.slice(0,S).match(/(?:^|\s)@([^\s@\[\]]*)$/);s(a()&&e.backend&&J?{start:P.toRaw(S-J[1].length-1),end:P.toRaw(S,"end"),query:J[1]}:null),e.onChange(R)};var _=t;return typeof _=="function"?ye(_,p):t=p,q(b=>{var O=e.label,S=e.rows??3,R=e.placeholder;return O!==b.e&&I(p,"aria-label",b.e=O),S!==b.t&&I(p,"rows",b.t=S),R!==b.a&&I(p,"placeholder",b.a=R),b},{e:void 0,t:void 0,a:void 0}),q(()=>p.value=ut(e.value).text),p})()},get children(){return d(nr,{get text(){return e.value},get label(){return e.previewLabel??"Comment preview"},class:"mb-2 min-h-[3rem] w-full rounded-[4px] border border-edge bg-surface p-2 text-sm"})}}),null),m(g,d(T,{get when(){return Y(()=>!!(!i()&&c()))()&&e.backend},get children(){return d(ai,{get backend(){return e.backend},get artifactId(){return e.artifactId},get query(){return c().query},onSelect:w,onReady:p=>{n=p}})}}),null),m(g,d(T,{get when(){return Y(()=>!i())()&&!c()},get children(){var p=zl(),_=p.firstChild;return m(p,()=>a()?"Type @ to mention an agent \xB7 ":"",_),p}}),null),q(p=>{var _=`min-w-0 ${e.class??""}`,b=`${e.label} formatting`;return _!==p.e&&de(g,p.e=_),b!==p.t&&I(y,"aria-label",p.t=b),p},{e:void 0,t:void 0}),g})()}pe(["mousedown","click","input","keydown"]);var Gl=v('<button type=button class="mt-1 font-mono text-[10px] text-muted">'),Yl=v("<div class=min-w-0><div><div>");function di(e){let t,[n,o]=N({overflowing:!1,lines:0,maxHeight:0}),[r,i]=N(!1);Q(()=>{e.text,queueMicrotask(()=>{if(!t?.isConnected)return;let c=t.querySelector("p, li, pre")??t,s=Number.parseFloat(getComputedStyle(c).lineHeight)||20,a=ho(t.scrollHeight,s);o(f=>f.overflowing===a.overflowing&&f.lines===a.lines&&f.maxHeight===a.maxHeight?f:a)})});let l=()=>e.foldable&&n().overflowing&&!r();return(()=>{var c=Yl(),s=c.firstChild,a=s.firstChild,f=t;return typeof f=="function"?ye(f,a):t=a,m(a,d(nr,{get text(){return e.text}})),m(c,d(T,{get when(){return Y(()=>!!e.foldable)()&&n().overflowing},get children(){var h=Gl();return h.$$click=()=>i(w=>!w),m(h,(()=>{var w=Y(()=>!!l());return()=>w()?`show more (${n().lines} lines)`:"show less"})()),q(w=>{var x=l()?"Show whole comment":"Show less of comment",g=!l();return x!==w.e&&I(h,"aria-label",w.e=x),g!==w.t&&I(h,"aria-expanded",w.t=g),w},{e:void 0,t:void 0}),h}}),null),q(h=>{var w=l()?"clamped":void 0,x=l()?"overflow-hidden":void 0,g=l()?{"max-height":`${n().maxHeight}px`}:void 0;return w!==h.e&&I(s,"data-folded-body",h.e=w),x!==h.t&&de(s,h.t=x),h.a=rt(s,g,h.a),h},{e:void 0,t:void 0,a:void 0}),c})()}pe(["click"]);var Kl=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],rr=e=>d(re,G(e,{iconNode:Kl,name:"arrow-up-right"}));var Xl=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],or=e=>d(re,G(e,{iconNode:Xl,name:"image"}));var Zl=v('<div class="flex justify-center bg-surface p-5 sm:p-8"><img alt="Full comment screenshot"class="h-auto max-h-[68dvh] max-w-full rounded-sm object-contain shadow-lg">'),Ql=v('<div class=mt-2><button type=button aria-label="Open comment screenshot"class="group block w-full overflow-hidden rounded-lg border border-edge bg-surface text-left transition-colors hover:border-accent/50"><img loading=lazy alt="Screenshot attached to comment"class="h-auto max-h-48 w-full object-contain"><span class="flex items-center gap-2 border-t border-edge px-3 py-2 text-xs font-medium text-muted group-hover:text-fg">Screenshot</span></button><dialog aria-label="Comment screenshot"class="m-auto max-h-[94dvh] w-[min(1100px,calc(100vw-24px))] overflow-auto rounded-2xl border border-edge bg-panel p-0 font-sans text-fg shadow-2xl backdrop:bg-black/50 backdrop:backdrop-blur-sm"><header class="flex items-center gap-3 border-b border-edge px-5 py-4"><span class="flex h-9 w-9 items-center justify-center rounded-lg bg-surface text-muted"></span><div class=flex-1><h2 class="text-sm font-semibold">Comment screenshot</h2><p class="mt-0.5 text-xs text-muted"></p></div><button type=button aria-label="Close screenshot"class="flex h-8 w-8 items-center justify-center rounded-lg text-muted hover:bg-surface hover:text-fg"></button></header><footer class="flex justify-end border-t border-edge px-5 py-3"><a target=_blank rel=noreferrer aria-label="Open screenshot at full size"class="inline-flex items-center gap-2 rounded-lg px-3 py-2 text-xs font-medium text-accent hover:bg-accent-soft">Open full size',!0,!1,!1);function ui(e){let t,[n,o]=N(!1);return(()=>{var r=Ql(),i=r.firstChild,l=i.firstChild,c=l.nextSibling,s=c.firstChild,a=i.nextSibling,f=a.firstChild,h=f.firstChild,w=h.nextSibling,x=w.firstChild,g=x.nextSibling,y=w.nextSibling,p=f.nextSibling,_=p.firstChild,b=_.firstChild;i.$$click=()=>{o(!0),t.showModal?.()},m(c,d(or,{size:13}),s),m(c,d(rr,{size:13,class:"ml-auto"}),null),a.addEventListener("close",()=>o(!1));var O=t;return typeof O=="function"?ye(O,a):t=a,m(h,d(or,{size:18})),m(g,()=>new Date(e.image.capturedAt).toLocaleString()),y.$$click=()=>t.close(),m(y,d(Ye,{size:18})),m(a,d(T,{get when(){return n()},get children(){var S=Zl(),R=S.firstChild;return q(P=>{var J=e.image.previewUrl,k=e.image.width,$=e.image.height;return J!==P.e&&I(R,"src",P.e=J),k!==P.t&&I(R,"width",P.t=k),$!==P.a&&I(R,"height",P.a=$),P},{e:void 0,t:void 0,a:void 0}),S}}),p),m(_,d(rr,{size:14}),null),q(S=>{var R=e.image.thumbnailUrl,P=e.image.width,J=e.image.height,k=e.image.previewUrl;return R!==S.e&&I(l,"src",S.e=R),P!==S.t&&I(l,"width",S.t=P),J!==S.a&&I(l,"height",S.a=J),k!==S.o&&I(_,"href",S.o=k),S},{e:void 0,t:void 0,a:void 0,o:void 0}),r})()}pe(["click"]);var ec=v('<button type=button class="-ml-1 inline-flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center rounded-[3px] text-faint hover:bg-raised hover:text-fg">'),tc=v('<div class="px-3 py-2"><div class="flex min-w-0 items-center gap-1.5"><span class="truncate font-mono text-[10px] text-faint">'),nc=v('<p class="border-b border-edge bg-surface/60 px-3 py-1.5 font-mono text-[10px] text-faint">Exact target is unavailable. This comment remains attached to its containing block.'),rc=v('<p class="mb-1 border-l-2 border-edge-bright pl-2 font-sans text-[12px] leading-snug text-fg/80">'),oc=v('<div class="border-b border-edge bg-surface/60 px-3 py-1.5"><p class="font-mono text-[10px] text-faint">This passage was removed from the document.'),ic=v('<div class="border-b border-edge bg-surface/60 px-3 py-1.5"><p class="mb-1 border-l-2 border-edge-bright pl-2 font-sans text-[12px] leading-snug text-fg/80"></p><p class="font-mono text-[10px] text-faint">These words have since been edited.'),ac=v('<ul class="flex flex-col gap-3 px-3 py-3">'),sc=v('<button type=button class="flex w-full cursor-pointer items-center justify-between gap-2 border-t border-edge px-3 py-1.5 font-mono text-[10px] text-faint transition-colors hover:bg-raised hover:text-accent"><span class=shrink-0>open \u2192'),lc=v('<p role=alert class="text-xs text-red-500">'),cc=v('<div class="border-t border-edge px-3 py-2"><div class="flex justify-end gap-2"><button type=button aria-label="Cancel reply"class="cursor-pointer rounded-[4px] bg-transparent px-2 py-1 text-muted hover:bg-surface hover:text-fg">cancel</button><button type=button aria-label="Send reply"class="cursor-pointer rounded-[4px] border border-accent bg-accent px-2 py-1 font-semibold text-bg hover:brightness-110 disabled:cursor-default disabled:opacity-40">reply'),dc=v('<div class="flex justify-end border-t border-edge px-3 py-2"><button type=button aria-label="Reopen annotation"class="cursor-pointer rounded-[4px] border border-edge bg-raised px-2 py-1 text-muted hover:text-accent">\u21BA reopen'),uc=v("<div>"),mc=v('<p class="mt-1 truncate font-sans leading-snug text-fg/90">'),fc=v('<p class="mt-1 font-mono text-[10px] text-faint">'),hc=v('<p role=status class="flex items-center gap-1.5 border-b border-edge px-3 py-1.5 text-[11px] text-muted"><a target=_blank rel="noopener noreferrer">@</a><span>'),gc=v('<span class="inline-flex h-5 w-5 items-center justify-center text-accent">'),pc=v('<button type=button aria-label="Resolve annotation"class="inline-flex h-5 w-5 cursor-pointer items-center justify-center rounded-[3px] text-muted hover:bg-accent-soft hover:text-accent disabled:cursor-default disabled:opacity-40">'),bc=v('<button type=button aria-label="Hide resolved conversation"aria-expanded=true class="cursor-pointer rounded-[3px] px-1 font-mono text-[11px] text-faint hover:bg-raised hover:text-accent">\u2191'),vc=v('<button type=button aria-label="Annotation actions"class="inline-flex h-5 w-5 cursor-pointer items-center justify-center rounded-[3px] text-faint hover:bg-raised hover:text-fg">'),yc=v('<div role=menu aria-label="Annotation action menu"class="absolute right-0 top-6 z-20 min-w-24 rounded-[5px] border border-edge-bright bg-surface p-1 shadow-lg"><button type=button role=menuitem aria-label="Delete annotation"class="flex w-full cursor-pointer items-center gap-2 rounded-[3px] px-2 py-1.5 text-left font-mono text-[11px] text-danger hover:bg-raised disabled:cursor-default disabled:opacity-40">delete'),xc=v("<div class=relative>"),wc=v('<p class="truncate font-sans leading-snug text-fg/90">'),kc=v('<span data-notification-read-point class="block h-px"aria-hidden=true>'),$c=v('<li class="scroll-mb-14 sm:scroll-mb-0"><div class="mb-1.5 flex min-w-0 items-center gap-2"><span>'),Ec=v('<p class="line-clamp-2 font-sans leading-snug text-fg/90">'),_c="rounded-[6px] border border-edge bg-comment text-sm";function mi(e){return(()=>{var t=ec();return t.$$click=()=>e.onToggle(),m(t,d(T,{get when(){return e.folded},get fallback(){return d(un,{size:13,strokeWidth:1.8})},get children(){return d(Yo,{size:13,strokeWidth:1.8})}})),q(n=>{var o=e.folded?"Expand thread":"Collapse thread",r=!e.folded;return o!==n.e&&I(t,"aria-label",n.e=o),r!==n.t&&I(t,"aria-expanded",n.t=r),n},{e:void 0,t:void 0}),t})()}function ir(e){let t,n,o=sn(),{session:r}=Gn(),i=()=>e.isCommentFolded(e.a.thread.at(-1)?.id??"");Q(()=>{let P=r()?.user?.id;if(!e.open||e.folded||i()||!P||!o||!t||typeof IntersectionObserver>"u")return;let J=e.a.id,k=e.a.revision??1,$=new IntersectionObserver(M=>{M.some(A=>A.isIntersecting)&&document.visibilityState==="visible"&&(o.load({read:`thread:${J}:${P}`,revision:k}),$.disconnect())},{threshold:.1});queueMicrotask(()=>{let M=t?.querySelector("[data-notification-read-point]");M&&$.observe(M)}),K(()=>$.disconnect())});let l=()=>xo(e.a.thread),[c,s]=N(l()),a=!1,f=!1,[h,w]=N("");Q(()=>{let P=l();a||s(P)});let[x,g]=N(!1),[y,p]=N(!1),_=()=>e.open?e.a.thread:e.a.thread.slice(0,1),b=()=>e.a.thread[0],O=()=>Math.max(0,e.a.thread.length-1),S=async()=>{if(!(e.busy||f||!Xe(c()))){f=!0,w("");try{if(!await e.onReply(c()))throw new Error("Could not send reply. Your draft is saved here.");a=!1,s(l()),g(!1)}catch{w("Could not send reply. Your draft is saved here.")}finally{f=!1}}};Q(()=>{if(!y())return;let P=k=>{(!n||!k.composedPath().includes(n))&&p(!1)},J=k=>{k.key==="Escape"&&p(!1)};document.addEventListener("pointerdown",P),document.addEventListener("keydown",J),K(()=>{document.removeEventListener("pointerdown",P),document.removeEventListener("keydown",J)})});let R=()=>(e.a.remote_work??[]).filter((P,J,k)=>!k.slice(J+1).some($=>$.sessionId===P.sessionId));return(()=>{var P=uc();P.$$click=k=>{let $=k.target;!e.open&&!e.folded&&!$.closest('a, button, textarea, input, [role="button"]')&&e.onOpen()},P.addEventListener("mouseleave",()=>e.onHover(null)),P.addEventListener("mouseenter",()=>e.onHover(e.a.id));var J=t;return typeof J=="function"?ye(J,P):t=P,m(P,d(T,{get when(){return e.folded},get children(){var k=tc(),$=k.firstChild,M=$.firstChild;return m($,d(mi,{folded:!0,get onToggle(){return e.onToggleFold}}),M),m(M,()=>e.a.snippet||"this document"),m(k,d(T,{get when(){return b()},children:A=>[(()=>{var C=mc();return m(C,()=>Kn(A().body)),C})(),(()=>{var C=fc();return m(C,(()=>{var H=Y(()=>O()===1);return()=>H()?"1 reply":`${O()} replies`})()),C})()]}),null),k}}),null),m(P,d(T,{get when(){return!e.folded},get children(){return[d(ge,{get each(){return R()},children:k=>(()=>{var $=hc(),M=$.firstChild,A=M.firstChild,C=M.nextSibling;return m(M,()=>k.name,null),m(C,()=>Qt(k)),q(H=>{var W=`/chat?session=${k.sessionId}`,ne=Ue[k.color];return W!==H.e&&I(M,"href",H.e=W),ne!==H.t&&ae(M,"color",H.t=ne),H},{e:void 0,t:void 0}),$})()}),d(T,{get when(){return Y(()=>!!e.targetMissing)()&&!e.a.orphaned},get children(){return nc()}}),d(T,{get when(){return e.a.orphaned},get children(){var k=oc(),$=k.firstChild;return m(k,d(T,{get when(){return Y(()=>!!e.open)()&&(e.a.quote??e.a.snippet)},get children(){var M=rc();return m(M,()=>e.a.quote??e.a.snippet),M}}),$),k}}),d(T,{get when(){return Y(()=>!!(e.open&&!e.a.orphaned&&e.a.quote_found===!1))()&&e.a.quote},get children(){var k=ic(),$=k.firstChild;return m($,()=>e.a.quote),k}}),(()=>{var k=ac();return m(k,d(ge,{get each(){return _().map($=>$.id)},children:($,M)=>{let A=()=>_().find(W=>W.id===$)??e.a.thread[0],C=()=>e.open&&e.isCommentFolded(A().id),H=()=>M()===_().length-1;return(()=>{var W=$c(),ne=W.firstChild,oe=ne.firstChild;return m(ne,d(T,{get when(){return M()===0},get children(){return d(mi,{folded:!1,get onToggle(){return e.onToggleFold}})}}),oe),oe.$$keydown=z=>{!e.open||z.key!=="Enter"&&z.key!==" "||(z.preventDefault(),e.onToggleComment(A().id))},oe.$$click=z=>{e.open&&(z.target.closest("a, button")||e.onToggleComment(A().id))},m(oe,d(ln,{get author(){return A().author}}),null),m(oe,d(Qn,{get iso(){return A().created_at},class:"ml-auto shrink-0 font-mono text-[10px] text-faint"}),null),m(ne,d(T,{get when(){return Y(()=>M()===0)()&&e.resolved},get children(){return d($e,{content:"resolved",get children(){var z=gc();return m(z,d(yt,{size:13,strokeWidth:2})),z}})}}),null),m(ne,d(T,{get when(){return Y(()=>M()===0)()&&!e.resolved},get children(){return d($e,{content:"resolve thread",get children(){var z=pc();return z.$$click=()=>e.onResolve(),m(z,d(yt,{size:13,strokeWidth:2})),q(()=>z.disabled=e.busy),z}})}}),null),m(ne,d(T,{get when(){return Y(()=>!!(M()===0&&e.resolved))()&&e.open},get children(){var z=bc();return z.$$click=()=>e.onOpen(),z}}),null),m(ne,d(T,{get when(){return Y(()=>M()===0)()&&(!e.resolved||e.open)},get children(){var z=xc(),we=n;return typeof we=="function"?ye(we,z):n=z,m(z,d($e,{content:"thread actions",get children(){var fe=vc();return fe.$$click=()=>p(ie=>!ie),m(fe,d(Ko,{size:13,strokeWidth:1.8})),q(()=>I(fe,"aria-expanded",y())),fe}}),null),m(z,d(T,{get when(){return y()},get children(){var fe=yc(),ie=fe.firstChild,Ae=ie.firstChild;return ie.$$click=()=>{p(!1),e.onDelete()},m(ie,d(Xo,{size:12,strokeWidth:1.75}),Ae),q(()=>ie.disabled=e.busy),fe}}),null),z}}),null),m(W,d(T,{get when(){return C()},get fallback(){return d(T,{get when(){return e.open},get fallback(){return(()=>{var z=Ec();return m(z,()=>Rt(A().body)),z})()},get children(){return d(di,{get text(){return A().body},get foldable(){return!(e.justOpened&&H())}})}})},get children(){var z=wc();return m(z,()=>Kn(A().body)),z}}),null),m(W,d(T,{get when(){return Y(()=>M()===0)()&&e.a.image},children:z=>d(ui,{get image(){return z()}})}),null),m(W,d(T,{get when(){return Y(()=>!!(H()&&!C()))()&&e.open},get children(){return kc()}}),null),q(z=>{var we=A().id,fe=e.open?"button":void 0,ie=e.open?0:void 0,Ae=e.open?C()?"Expand comment":"Collapse comment":void 0,ee=e.open?!C():void 0,L=`flex min-w-0 flex-1 items-center gap-2 rounded-[3px] ${e.open?"cursor-pointer":""}`;return we!==z.e&&I(W,"data-comment-id",z.e=we),fe!==z.t&&I(oe,"role",z.t=fe),ie!==z.a&&I(oe,"tabindex",z.a=ie),Ae!==z.o&&I(oe,"aria-label",z.o=Ae),ee!==z.i&&I(oe,"aria-expanded",z.i=ee),L!==z.n&&de(oe,z.n=L),z},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),W})()}})),k})(),d(T,{get when(){return!e.open},get children(){var k=sc(),$=k.firstChild;return k.addEventListener("blur",()=>e.onHover(null)),k.addEventListener("focus",()=>e.onHover(e.a.id)),k.$$click=()=>e.onOpen(),m(k,d(cn,{get thread(){return e.a.thread}}),$),q(M=>{var A=e.resolved?"Show resolved conversation":"Open annotation thread",C=e.resolved?!1:void 0;return A!==M.e&&I(k,"aria-label",M.e=A),C!==M.t&&I(k,"aria-expanded",M.t=C),M},{e:void 0,t:void 0}),k}}),d(T,{get when(){return Y(()=>!!e.open)()&&!e.resolved},get children(){var k=cc(),$=k.firstChild,M=$.firstChild,A=M.nextSibling;return m(k,d(mn,{get backend(){return e.backend},get artifactId(){return e.artifactId},label:"Reply to annotation",previewLabel:"Reply preview",previewToggleLabel:"Preview reply",get value(){return c()},onChange:C=>{a=!0,s(C)},onSubmit:()=>{S()},get previewing(){return x()},onPreviewingChange:g,rows:2,placeholder:"reply\u2026"}),$),m(k,d(T,{get when(){return h()},get children(){var C=lc();return m(C,h),C}}),$),M.$$click=()=>{a=!0,s(""),g(!1),e.onOpen()},A.$$click=()=>{S()},q(()=>A.disabled=e.busy||!Xe(c())),k}}),d(T,{get when(){return Y(()=>!!e.open)()&&e.resolved},get children(){var k=dc(),$=k.firstChild;return $.$$click=()=>e.onReopen(),q(()=>$.disabled=e.busy),k}})]}}),null),q(k=>{var $=e.resolved?"Resolved annotation thread":"Annotation thread",M=e.a.id,A=e.hovered?"true":void 0,C=`${_c} shrink-0 overflow-hidden transition-[border-color,background-color,opacity] duration-150 ${e.open||e.folded?"":"cursor-pointer"} ${e.open||e.hovered?"border-edge-bright bg-comment-hover":""} ${e.resolved?"opacity-55 hover:opacity-100 focus-within:opacity-100":""}`;return $!==k.e&&I(P,"aria-label",k.e=$),M!==k.t&&I(P,"data-thread-id",k.t=M),A!==k.a&&I(P,"data-hovered",k.a=A),C!==k.o&&de(P,k.o=C),k},{e:void 0,t:void 0,a:void 0,o:void 0}),P})()}pe(["click","keydown"]);var ue=class extends Error{constructor(n,o){super(n);this.code=n;this.stage=o;this.name="CaptureError"}code;stage};var ar,Sc=()=>({width:window.innerWidth,height:window.innerHeight});function Cc(){let e=navigator.mediaDevices;return!!(e?.getDisplayMedia&&e.setCaptureHandleConfig)}function Rc(e,t){if(![e.x,e.y,e.width,e.height,t.width,t.height].every(Number.isFinite)||e.width<=0||e.height<=0)throw new ue("geometry");let n=Math.max(0,e.x),o=Math.max(0,e.y),r=Math.min(t.width,e.x+e.width)-n,i=Math.min(t.height,e.y+e.height)-o;if(r<1||i<1)throw new ue("geometry");return{x:n,y:o,width:r,height:i}}async function Tt(e,t,n=5e3){let o,r=performance.now(),i="success";try{return await Promise.race([e,new Promise((l,c)=>{o=setTimeout(()=>c(new ue("timeout",t)),n)})])}catch(l){throw i="error",l}finally{clearTimeout(o);let l=`comment-screenshot:${t}`;performance.clearMeasures(l),performance.measure(l,{start:r,end:performance.now(),detail:{outcome:i}})}}function fi(e,t,n=()=>!0){let o=0,r=performance.now(),i=0,l=f=>{let h=`comment-screenshot:${t}`;performance.clearMeasures(h),performance.measure(h,{start:r,end:performance.now(),detail:{outcome:f,frames:i,width:e.videoWidth,height:e.videoHeight}})},c,s=()=>{clearTimeout(c),e.cancelVideoFrameCallback(o)},a=new Promise((f,h)=>{c=setTimeout(()=>{l("timeout"),s(),h(new ue("timeout",t))},5e3);let w=()=>{i++,n()?(l("success"),s(),f()):o=e.requestVideoFrameCallback(w)};o=e.requestVideoFrameCallback(w)});return a.catch(()=>{}),{promise:a,cancel:s}}async function hi(){if(!Cc())throw new ue("unsupported");let e=navigator.mediaDevices;ar??=Be(),e.setCaptureHandleConfig({handle:ar,permittedOrigins:[location.origin],exposeOrigin:!1});let t=e.getDisplayMedia({audio:!1,video:{frameRate:30},preferCurrentTab:!0}),n=!1;t.then(x=>{n&&x.getTracks().forEach(g=>g.stop())},()=>{});let o;try{o=await Tt(t,"permission",6e5)}catch(x){throw n=!0,x instanceof DOMException&&x.name==="NotAllowedError"?new ue("cancelled"):x}let r=o.getVideoTracks()[0],i=()=>r?.getSettings().displaySurface==="browser"&&r.getCaptureHandle?.()?.handle===ar;if(!r||!i())throw o.getTracks().forEach(x=>x.stop()),new ue("wrong-source");let l=globalThis.ImageCapture,c;try{c=l?new l(r):null}catch(x){throw o.getTracks().forEach(g=>g.stop()),x}let s=c?null:document.createElement("video");s&&(s.muted=!0,s.playsInline=!0,s.srcObject=o);let a=!1,f=!1,h,w=()=>{a||(a=!0,clearTimeout(h),o.getTracks().forEach(x=>x.stop()),s&&(s.pause(),s.srcObject=null),window.removeEventListener("pagehide",w),r.removeEventListener("ended",w),r.removeEventListener("capturehandlechange",w))};if(window.addEventListener("pagehide",w),r.addEventListener("ended",w),r.addEventListener("capturehandlechange",w),h=setTimeout(w,12e4),s){let x=fi(s,"initial-frame");try{await Tt(s.play(),"playback"),await x.promise}catch(g){throw w(),g}finally{x.cancel()}}return{dispose:w,async capture(x){if(a||f)throw new ue("ended");f=!0;let g=Sc(),y;try{y=Rc(x,g)}catch(R){throw w(),R}let p={x:window.scrollX,y:window.scrollY},_,b=!1,O=()=>{b=!0},S=()=>{(g.width!==innerWidth||g.height!==innerHeight)&&(b=!0)};window.addEventListener("scroll",O,!0),window.addEventListener("resize",S);try{if(!i())throw new ue("wrong-source");if(await Tt(new Promise(H=>requestAnimationFrame(()=>requestAnimationFrame(()=>H()))),"paint"),a)throw new ue("ended");if(c){let H=!1,W=(async()=>{if((await c.grabFrame()).close(),H||a)throw new ue(H?"timeout":"ended","track-frame");let oe=await c.grabFrame();if(H)throw oe.close(),new ue("timeout","track-frame");return oe})();W.catch(()=>{});try{_=await Tt(W,"track-frame")}catch(ne){throw H=!0,ne}}else if(s){let H=fi(s,"full-frame");try{await H.promise}finally{H.cancel()}}if(a||r.readyState==="ended")throw new ue("ended");if(!i())throw new ue("wrong-source");if(b||g.width!==innerWidth||g.height!==innerHeight||p.x!==scrollX||p.y!==scrollY)throw new ue("geometry");let R=_?.width??s.videoWidth,P=_?.height??s.videoHeight;if(!R||!P)throw new ue("geometry");let J=g.width/g.height;if(Math.abs(R/P/J-1)>.015)throw new ue("geometry");let k={x:y.x*R/g.width,y:y.y*P/g.height,width:y.width*R/g.width,height:y.height*P/g.height},$=Math.min(1,2048/Math.max(k.width,k.height),Math.sqrt(4e6/(k.width*k.height))),M=document.createElement("canvas");M.width=Math.max(1,Math.round(k.width*$)),M.height=Math.max(1,Math.round(k.height*$));let A=M.getContext("2d");if(!A)throw new ue("unsupported");return A.drawImage(_??s,k.x,k.y,k.width,k.height,0,0,M.width,M.height),{blob:await Tt(new Promise((H,W)=>M.toBlob(ne=>ne?H(ne):W(new ue("geometry")),"image/png")),"encode"),width:M.width,height:M.height,rect:y,viewport:g,capturedAt:new Date().toISOString(),method:"canvas"}}finally{_?.close(),window.removeEventListener("scroll",O,!0),window.removeEventListener("resize",S),w()}}}}var sr={unsupported:"This browser cannot verify capture of this tab. Upload a screenshot, or explicitly continue without one.",cancelled:"Screen sharing was cancelled. Retry, upload a screenshot, or continue without one.","wrong-source":"Choose this browser tab when sharing. The other source was stopped.",geometry:"The page moved during capture. Retake the screenshot.",ended:"Screen sharing ended. Retake the screenshot.",timeout:"Capture timed out. Please retry."};function gi(e,t){let n=typeof t=="function"?t:()=>t,o=null,r=0,i=null,[l,c]=N(null),[s,a]=N(!1),[f,h]=N(!1),[w,x]=N(""),g=()=>{r+=1,o?.dispose(),o=null,i=null,c(null),a(!1),h(!1),x("")};K(g);let y=()=>!!(n()&&!e.unavailable("commentImages"));return{draft:l,busy:s,required:f,error:w,reset:g,start:async()=>{if(g(),!y())return"unavailable";let S=r;h(!0),a(!0);try{let R=await hi();return S!==r?(R.dispose(),"superseded"):(o=R,"ready")}catch(R){return S!==r?"superseded":R instanceof ue&&R.code==="cancelled"?(g(),"cancelled"):(x(sr[R instanceof ue?R.code:"unsupported"]),"unavailable")}finally{S===r&&a(!1)}},capture:async S=>{if(!y())return;h(!0);let R=o;if(!R){x($=>$||sr.unsupported);return}let P=r,J=n();a(!0);let k=performance.now();document.documentElement.classList.add("mx-taking-screenshot");try{let $=await R.capture(S);if(P!==r)return;if(n()!==J)throw new ue("geometry");c({image:$,preview:$.blob,strokes:[],editId:J}),x("")}catch($){P===r&&x(sr[$ instanceof ue?$.code:"unsupported"])}finally{try{performance.measure("comment-screenshot:capture",{start:k,end:performance.now()})}catch{}o===R&&(o=null),R.dispose(),document.documentElement.classList.remove("mx-taking-screenshot"),P===r&&a(!1)}},upload:async S=>{if(!y())return;let R=++r;o?.dispose(),o=null,a(!0),x("");try{if(S.size>8*1024*1024||!["image/png","image/jpeg","image/webp"].includes(S.type))throw new Error("Use a PNG, JPEG or WebP up to 8 MB.");let P=await createImageBitmap(S);try{let J=Math.min(1,2048/Math.max(P.width,P.height),Math.sqrt(4e6/(P.width*P.height))),k=document.createElement("canvas");k.width=Math.max(1,Math.round(P.width*J)),k.height=Math.max(1,Math.round(P.height*J)),k.getContext("2d").drawImage(P,0,0,k.width,k.height);let $=await new Promise(A=>k.toBlob(A,"image/png"));if(!$)throw new Error("Could not read this image.");let M={blob:$,width:k.width,height:k.height,rect:{x:0,y:0,width:k.width,height:k.height},viewport:{width:k.width,height:k.height},method:"upload",capturedAt:new Date().toISOString()};R===r&&(c({image:M,preview:$,strokes:[],editId:n()}),h(!0))}finally{P.close()}}catch(P){R===r&&x(P instanceof Error?P.message:"Could not read this image.")}finally{R===r&&a(!1)}},stage:async S=>{let R=l();if(!R)return;let P=S?.preview??R.preview;if(i?.draft===R&&i.preview===P)return i.id;let J={v:1,capturedEditId:R.editId,capturedAt:R.image.capturedAt,method:R.image.method,width:R.image.width,height:R.image.height,rect:R.image.rect,viewport:R.image.viewport,strokes:S?.strokes??R.strokes},k=new FormData;k.set("original",R.image.blob,"original.png"),k.set("preview",P,"preview.png"),k.set("metadata",JSON.stringify(J));let $=await e.uploadCommentImage(k);return i={draft:R,preview:P,id:$.id},$.id},skip:g}}var Tc=v('<div class="space-y-3 px-1"><div class="flex items-center justify-between"><h2 class="font-mono text-[10px] font-semibold uppercase tracking-[0.12em] text-faint">comments</h2><button type=button aria-label="Close comments"class="inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-[3px] text-muted hover:bg-surface hover:text-fg"></button></div><div role=group aria-label="Comment tools"class="grid grid-cols-2 gap-2"><button type=button aria-label=Select><span class="flex items-center gap-2 text-sm font-semibold">Select</span><span class=text-[11px]>Block or text</span></button></div><p class="text-xs text-muted">'),Ac=v('<button type=button aria-label=Screenshot><span class="flex items-center gap-2 text-sm font-semibold">Screenshot</span><span class=text-[11px]>Capture an area'),Ic=v("<style>:host-context(.mx-taking-screenshot) [data-capture-chrome],.mx-taking-screenshot [data-capture-chrome]{visibility:hidden!important}"),Pc=v('<div data-capture-chrome role=status class="fixed bottom-4 left-4 z-50 rounded bg-panel p-3 shadow">Preparing screenshot\u2026 <button type=button>Cancel capture'),Mc=v('<div data-capture-chrome aria-label="Open annotation comments"class="pointer-events-none fixed inset-0 z-20">'),Oc=v('<div role=status data-capture-chrome class="rounded-[6px] border border-edge bg-raised text-sm fixed z-30 flex items-center gap-2 border-edge-bright px-3 py-1.5 font-mono text-[11px] text-muted shadow-xl"style=transform:translateX(-50%)><span class=whitespace-nowrap></span><button type=button aria-label="Cancel picking"class="inline-flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center rounded-[3px] text-muted hover:bg-surface hover:text-fg">'),Lc=v('<div role=status class="mb-3 flex items-center gap-2 rounded-lg border border-edge bg-surface p-4 text-sm text-muted">Preparing screenshot\u2026'),Nc=v('<div class="mb-3 space-y-3 rounded-lg border border-edge bg-surface p-3 text-xs"><p role=alert class="leading-relaxed text-muted"></p><button type=button class="rounded-lg border border-edge bg-panel px-3 py-2 font-medium hover:border-accent">Retry screenshot</button><label class="block space-y-2 font-medium">Upload screenshot<input class="block w-full text-xs text-muted file:mr-2 file:rounded-md file:border-0 file:bg-panel file:px-3 file:py-2 file:text-fg"type=file accept=image/png,image/jpeg,image/webp aria-label="Upload screenshot"></label><button type=button class="text-muted underline underline-offset-4 hover:text-fg">Continue without screenshot'),Dc=v("<div class=mb-3>"),Fc=v('<div class="mb-2 flex min-w-0 flex-wrap items-center gap-1 font-mono text-[11px] text-muted">'),jc=v('<p role=alert class="mb-2 font-mono text-[11px] text-danger">'),Hc=v('<section data-capture-chrome role=dialog aria-label="Annotation composer"class="rounded-[6px] border border-edge bg-raised text-sm fixed z-30 overflow-y-auto border-edge-bright shadow-xl"><div class="flex items-center gap-2 border-b border-edge px-3 py-2.5"><span class="inline-flex h-[22px] w-[22px] shrink-0 items-center justify-center rounded-full border border-accent/25 bg-accent-soft text-accent"></span><span class="text-xs font-semibold text-fg">Add comment</span><button type=button aria-label="Close annotation composer"class="ml-auto inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-[3px] text-muted hover:bg-surface hover:text-fg"></button></div><div class=p-3><div class="flex items-center justify-end gap-2"><span class="mr-auto hidden font-mono text-[9px] text-faint sm:inline">\u2318\u21B5 to send</span><button type=button aria-label="Cancel annotation"class="cursor-pointer rounded-[4px] bg-transparent px-2 py-1 text-muted hover:bg-surface hover:text-fg">cancel</button><button type=button aria-label="Save annotation"class="cursor-pointer rounded-[4px] border border-accent bg-accent px-2 py-1 font-semibold text-bg hover:brightness-110 disabled:cursor-default disabled:opacity-40">comment'),qc=v('<p class="p-2 font-mono text-xs text-muted">no open comments \u2014 select text in the document, or pick a block, to leave one'),zc=v('<p class="p-2 font-mono text-xs text-muted">nothing resolved yet'),Jc=v('<div class=contents><div role=separator aria-labelledby=resolved-annotations-heading class="mt-1 flex items-center gap-2 px-1"><span aria-hidden=true class="h-px flex-1 bg-edge"></span><h2 id=resolved-annotations-heading class="shrink-0 font-mono text-[10px] font-semibold uppercase tracking-[0.12em] text-faint">resolved</h2><span aria-hidden=true class="h-px flex-1 bg-edge">'),Bc=v('<div role=status class="mb-3 flex items-center gap-2 rounded-lg border border-edge bg-surface p-4 text-sm text-muted">Loading screenshot\u2026'),Uc=v('<button type=button class="rounded-lg border border-edge bg-panel px-3 py-2 text-xs font-medium disabled:opacity-50">Attach screenshot'),Wc=v("<span>\u203A"),Vc=v('<button type=button class="cursor-pointer truncate underline decoration-dotted hover:text-accent">'),Gc=v('<span class="flex min-w-0 items-center gap-1">'),Yc=v('<span class="truncate text-accent">'),pi=$r(()=>import("./ScreenshotEditor-LHC3JZSA.js").then(e=>({default:e.ScreenshotEditor}))),Kc=()=>pi.preload();var Xc={title:"Delete this comment?",description:"This comment and its replies will be permanently deleted. This cannot be undone.",action:"Delete comment",confirmLabel:"Confirm delete comment"},lr=e=>{if(e===void 0)return null;let t=new URLSearchParams(e);return t.get("comment")??t.get("thread")},Zc=()=>{try{return eo()}catch{return null}};function Qc(e,t){let[n,o]=N(""),r=!1;return Q(()=>{if(!t()){r=!1;return}if(e.unavailable("remoteSessions"))return;let i=new AbortController;e.remoteSessions({signal:i.signal}).then(l=>{if(i.signal.aborted||r)return;let c=(l.sessions??[]).filter(s=>!s.runId&&s.online&&s.activity!=="stopped"&&s.exitCode===null);c.length===1&&o(en(c[0]))}).catch(()=>{}),K(()=>i.abort())}),[n,i=>{r=!0,o(i)},i=>o(i)]}function bi(e){let t=e.backend??ao(e.id),n=be(()=>e.railOpen),o=be(()=>e.pickOnOpen!==!1),r=be(()=>e.initialSelection??null),i=be(()=>e.sessionNonce??null),l=be(()=>e.runtimeRef),c=be(()=>e.liveAnnotations??null),s=t.unavailable("commentImages"),a=gi(t,()=>e.editId),f={current:null},h={signature:"",key:""},w=u=>{e.runtimeRef&&Ut({runtimeRef:e.runtimeRef},u)},[x,g]=N([]),[y,p]=N({}),_=new Set,[b,O]=N(null),[S,R]=N(null),[P,J]=N(null),[k,$]=N(kt(e.id)),[M,A]=N(null),[C,H]=N(null),W=null,ne=u=>{W=u,H(u)},[oe,z]=N(new Set),[we,fe]=N({}),ie,Ae,[ee,L]=N(null),[j,se]=N(null),le=!1,me=Co(),[Ee,Ke,Ie]=Qc(t,()=>ee()!==null),[It,et]=N(!1),[He,tt]=N(!1),[dr,We]=N(null),[fn,hn]=N(null),[gn,ur]=N(!1),[Ei,pn]=N(null),[nt,_i]=N({width:innerWidth,height:innerHeight});ve(()=>{let u=()=>_i({width:innerWidth,height:innerHeight});window.addEventListener("resize",u),K(()=>window.removeEventListener("resize",u))}),Ro(()=>ee()!==null,()=>Ae);let Pt=!1,bn=!1;Q(()=>{e.onAnnotationsChange?.(x())}),Q(Me(x,u=>J(E=>u.some(F=>F.id===E)?null:E)));let Si=be(()=>x().some(u=>u.remote_work?.length));Q(()=>{if(n(),!Si()||He())return;let u=new AbortController,E=setInterval(()=>{t.listAnnotations(void 0,{signal:u.signal}).then(F=>{u.signal.aborted||g(F)}).catch(()=>{})},15e3);K(()=>{clearInterval(E),u.abort()})});let Mt=u=>{Re(()=>{a.reset(),se(null),R(u),J(xe(x).some(F=>F.id===u)?null:u),A(u),L(null);let E=xe(x).find(F=>F.id===u)?.thread.at(-1)?.id;$(Fn(e.id,{threads:[u],comments:E?[E]:[]}))}),xe(()=>e.railOpen)||(Pt=!0),e.onRailOpenChange(!0)},mr=Zc(),fr=()=>mr?mr.search:typeof location>"u"?void 0:location.search,[vn,yn]=N(e.linkTarget??lr(xe(fr)));Q(()=>{e.linkTarget!==void 0&&yn(e.linkTarget)}),Q(Me(fr,u=>{e.linkTarget===void 0&&yn(lr(u))},{defer:!0})),ve(()=>{let u=()=>{e.linkTarget===void 0&&yn(lr(location.search))};window.addEventListener("popstate",u),K(()=>window.removeEventListener("popstate",u))});let xn=!1;Q(Me(vn,()=>{xn=!1})),Q(()=>{let u=vn(),E=[...x(),...b()??[]];if(!u||xn)return;let F=E.find(D=>D.id===u||D.thread.some(B=>B.id===u));xe(()=>{F?(xn=!0,Mt(F.id),$(Fn(e.id,{threads:[F.id],comments:[u]}))):e.railOpen||(Pt=!0,e.onRailOpenChange(!0))})});let hr=(u,E)=>$(fo(e.id,u,E));Q(()=>{let u=S();if(!u||!n())return;let E=requestAnimationFrame(()=>{let F=[...ie?.querySelectorAll("[data-thread-id]")??[]].find(Z=>Z.dataset.threadId===u);F?.scrollIntoView?.({block:"start",inline:"nearest"});let D=xe(vn);((D?[...F?.querySelectorAll("[data-comment-id]")??[]].find(Z=>Z.dataset.commentId===D):null)??F?.querySelector("li:last-child"))?.scrollIntoView?.({block:"nearest",inline:"nearest"})});K(()=>cancelAnimationFrame(E))}),Q(Me(()=>e.id,u=>$(kt(u)),{defer:!0})),ve(()=>{let u=new AbortController;t.listAnnotations(void 0,{signal:u.signal}).then(E=>{u.signal.aborted||g(E)}).catch(()=>{}),K(()=>u.abort())}),Q(()=>{let u=c();u&&g(u)}),Q(()=>{let u=x(),E=n(),F=_;_=new Set(u.map(X=>X.id));let D=[...F].filter(X=>!_.has(X)),B=xe(y);if(!E&&!D.length&&!Object.keys(B).length)return;let Z=new AbortController;t.listAnnotations("resolved",{signal:Z.signal}).then(X=>{if(Z.signal.aborted)return;let U=X.filter(ce=>!u.some(he=>he.id===ce.id));Re(()=>{O(U),p(ce=>{let he={};for(let V of U){let te=ce[V.id];(D.includes(V.id)||te)&&(he[V.id]={row:V,remaining:te&&te.row.revision===V.revision?te.remaining:1e4})}return he}),R(ce=>ce&&(D.includes(ce)||B[ce])&&!U.some(he=>he.id===ce)&&!_.has(ce)?null:ce)})}).catch(()=>{Z.signal.aborted||Re(()=>{p({}),O(null),R(null)})}),K(()=>Z.abort())});let Ot=u=>{u==="block"&&a.reset(),se(u),R(null),me()&&xe(()=>e.railOpen)&&(bn=!0,e.onRailOpenChange(!1))},Lt=()=>Ot("block");Q(Me([n,o,me],([u,E,F])=>{let D=xe(ee)!==null;if(u){let B=Pt;Pt=!1,!B&&!xe(r)&&!D&&E&&!F&&Lt();return}if(bn){bn=!1;return}(xe(j)||!D)&&a.reset(),se(null)})),Q(Me(o,u=>{u||(le=!1,se(null),a.reset())})),Q(()=>{let u=r();u&&xe(()=>{le=j()==="block",a.reset(),Re(()=>{L(u),R(null),We(null),se(null)}),e.onSelectionConsumed?.()})});let Ci=be(()=>Object.values(y()).filter(u=>u.remaining>0).map(u=>u.row.id).join(","));Q(()=>{if(!i())return;Ci();let u=S(),E=P(),F=xe(y),D=x(),B=u?(b()??[]).find(U=>U.id===u)??F[u]?.row??null:null,Z=[...D,...B?[B]:[],...Object.values(F).filter(U=>U.remaining>0&&U.row.id!==B?.id&&!D.some(ce=>ce.id===U.row.id)).map(U=>U.row)].filter(U=>!U.orphaned&&U.anchor).map(U=>{let ce=U.anchor;return{id:U.id,path:ce.path,key:ce.key,nodeId:ce.nodeId,range:U.range,...U.status==="resolved"&&(U.id!==E||U.id!==u)?{layoutOnly:!0}:{}}}),X=ee();w({type:at,mode:a.busy()?"off":"on",pins:Z,openId:u,hoverId:C(),selectedPath:X?.path??null,selected:X,canComment:!0,pick:j()})}),Q(Me(n,u=>{u||R(null)})),K(()=>w({type:at,mode:"off",pins:[],openId:null,hoverId:null})),Q(()=>{let u=i(),E=l();if(!u||!E)return;let F=Wt({runtimeRef:E},D=>{let B=D.data;if(!qt(B,u))return;if(B.type===Ht&&B.action==="select"){if(e.pickOnOpen===!1)return;Lt();return}if(B.type===Mr){let X={};for(let U of B.positions)X[U.id]=U.rect;Re(()=>{z(new Set(B.positions.filter(U=>U.status==="missing"||U.status==="ambiguous").map(U=>U.id))),fe(X)});return}if(B.type===Ir){Mt(B.id);return}if(B.type===Pr){H(W??B.id);return}let Z=xe(j);if(B.type===Cn&&Z){let X=B.selection;le=!!X&&Z==="block",Re(()=>{if(se(null),X){L(X);let U=X.captureRect??X.rect,ce=e.runtimeRef?Vt({runtimeRef:e.runtimeRef}):void 0;Z==="area"&&a.capture({...U,x:U.x+(ce?.left??0),y:U.y+(ce?.top??0)}),R(null),We(null)}else a.reset()});return}if(B.type===Cn&&xe(ee)!==null){let X=B.selection;if(a.draft()||a.busy())return;Re(()=>{L(U=>{if(JSON.stringify(U)===JSON.stringify(X))return U;if(!(X?.nodeId&&U?.nodeId&&X.nodeId===U.nodeId)||X?.range)return X;let he={...X,...U.quote?{quote:U.quote}:{},...U.range?{range:U.range}:{}};return JSON.stringify(U)===JSON.stringify(he)?U:he}),We(null),X&&R(null)})}});K(F)});let wn=async(u,E)=>{tt(!0);try{let F=await t.actOnAnnotation(u,E);return Re(()=>{g(D=>F.status==="resolved"?D.filter(B=>B.id!==u):D.some(B=>B.id===u)?D.map(B=>B.id===u?F:B):[...D,F]),O(D=>D&&(F.status==="open"?D.filter(B=>B.id!==u):D.some(B=>B.id===u)?D.map(B=>B.id===u?F:B):[...D,F])),F.status==="resolved"?R(D=>D===u?null:D):E.reopen&&(R(u),A(u))}),!0}catch{return!1}finally{tt(!1)}},Ri=async u=>{tt(!0);try{await t.deleteAnnotation(u),Re(()=>{g(E=>E.filter(F=>F.id!==u)),O(E=>E&&E.filter(F=>F.id!==u)),R(E=>E===u?null:E)})}finally{tt(!1)}},Ti=async()=>{let u=fn();if(!(!u||gn())){ur(!0),pn(null);try{await Ri(u),hn(null)}catch(E){pn(E instanceof Error?E.message:"Could not complete this action. Try again.")}finally{ur(!1)}}},Ai=u=>{fn()||(pn(null),hn(u))},Ii=async()=>{let u=ee();if(!(!u||!Xe(Ee())||a.busy()||a.required()&&!a.draft())){if(!u.nodeId){We("Wait for this change to save before commenting. Your draft is still here.");return}tt(!0),We(null);try{let E=a.draft();if(E&&!f.current)throw new Error("The screenshot is still loading. Please try again.");let F=await a.stage(E?await f.current():void 0),D=Ee(),B=JSON.stringify([u,D,F]);h.signature!==B&&(h={signature:B,key:Be()});let Z;try{Z=await t.createAnnotation({path:u.path,node_id:u.nodeId,body:D,...F?{attachment_id:F,edit_id:E.editId}:{},...u.quote?{quote:u.quote}:{},...u.range?{range:u.range}:{}},h.key)}catch(U){if(!(U instanceof Se))throw U;U.signInRequired?window.location.assign(vo(window.location,"comment")):We(U.message);return}a.reset();let X=le;le=!1,Re(()=>{g(U=>[...U.filter(ce=>ce.id!==Z.id),Z]),L(null),Ie(""),et(!1),R(Z.id),A(Z.id),X&&se("block")}),X||w({type:Je,path:null})}catch(E){We(E instanceof Error?E.message:"Could not save the comment. Your draft is still here.")}finally{tt(!1)}}},kn=()=>{a.reset(),Re(()=>{L(null),Ie(""),et(!1),We(null)}),le?(le=!1,Lt()):w({type:Je,path:null})},gr=()=>{He()||!Xe(Ee())||Ii()};Q(()=>{if(!ee())return;let u=E=>{E.key==="Escape"&&(xe(j)||(E.stopPropagation(),kn()))};window.addEventListener("keydown",u),K(()=>window.removeEventListener("keydown",u))}),Q(()=>{if(!j())return;let u=E=>{E.key==="Escape"&&(E.stopPropagation(),a.reset(),se(null))};window.addEventListener("keydown",u),K(()=>window.removeEventListener("keydown",u))});let $n=async()=>{if(!e.editId||s)return;Ot("area");let u=a.start();Kc().catch(()=>{}),await u==="cancelled"&&Ot("block")};ve(()=>{e.pickRequested&&e.pickOnOpen!==!1&&Lt()});let pr=()=>{le=!1,a.reset(),se(null)},Pi=()=>j()==="block"?pr():Ot("block"),Mi=()=>s??(e.editId?null:"Screenshots need a saved document."),ft=()=>e.topOffset??0,br=be(()=>{let u=x();return[...u,...Object.values(y()).filter(E=>E.remaining>0&&!u.some(F=>F.id===E.row.id)).map(E=>E.row)]}),En=()=>!e.railOpen&&!!e.showViewComments&&br().length>0,Oi=()=>(nt(),(e.runtimeRef?Vt({runtimeRef:e.runtimeRef}):void 0)??{top:ft(),height:innerHeight-ft()}),_n=be(()=>En()?Wo(br(),we(),Oi(),nt().height):[]),Li=be(()=>_n().map(u=>u.annotation.id),void 0,{equals:(u,E)=>u.length===E.length&&u.every((F,D)=>F===E[D])}),Ni=u=>_n().find(E=>E.annotation.id===u),Di=be(()=>_n().filter(u=>u.top>=0&&u.top+dn<=nt().height).map(u=>u.annotation.id).join(",")),Fi=be(()=>Object.values(y()).some(u=>u.remaining>0));Q(()=>{if(!En()||!Fi())return;let u=new Set(Di().split(",")),E=C(),F=S(),D=performance.now(),B=setInterval(()=>{let Z=performance.now(),X=Math.min(250,Z-D);D=Z,document.visibilityState==="visible"&&p(U=>{let ce=!1,he=Object.fromEntries(Object.entries(U).map(([V,te])=>te.remaining<=0||!u.has(V)||V===E||V===F?[V,te]:(ce=!0,[V,{...te,remaining:Math.max(0,te.remaining-X)}])));return ce?he:U})},100);K(()=>clearInterval(B))});let ji=()=>{let u=ee();return u?[...u.ancestors.slice(-2),{path:u.path,tag:u.tag,hint:""}]:[]},vr=()=>e.panelWidth??(e.railOpen&&!me()&&!e.railSheet&&e.railHost===void 0?320:0),Nt=be(()=>{let{width:u}=nt(),E=e.runtimeRef?Vt({runtimeRef:e.runtimeRef}):void 0;return E?{left:E.left,top:E.top,width:Math.max(0,E.width-vr())}:{left:0,top:ft(),width:u-vr()}}),ht=be(()=>{let u=ee();return u?To(u,Nt(),nt().width,nt().height,a.required()):null}),Hi=be(()=>x().map(u=>u.id),void 0,{equals:(u,E)=>u.length===E.length&&u.every((F,D)=>F===E[D])}),qi=be(()=>(b()??[]).map(u=>u.id),void 0,{equals:(u,E)=>u.length===E.length&&u.every((F,D)=>F===E[D])}),zi=u=>x().find(E=>E.id===u),Ji=u=>(b()??[]).find(E=>E.id===u),Bi=()=>(()=>{var u=Tc(),E=u.firstChild,F=E.firstChild,D=F.nextSibling,B=E.nextSibling,Z=B.firstChild,X=Z.firstChild,U=X.firstChild,ce=B.nextSibling;return D.$$click=()=>e.onRailOpenChange(!1),m(D,d(Ye,{size:14,strokeWidth:1.8})),Z.$$click=Pi,m(X,d(Ln,{size:18}),U),m(B,d(jn,{get reason(){return Mi()},class:"flex",children:he=>(()=>{var V=Ac(),te=V.firstChild,Ce=te.firstChild;return V.$$click=()=>{$n()},ze(V,G({get"aria-pressed"(){return a.required()}},he,{get class(){return`flex min-h-16 w-full cursor-pointer flex-col items-center justify-center gap-1 rounded-lg border px-3 py-2 disabled:cursor-default disabled:opacity-50 ${a.required()?"border-accent bg-accent-soft text-accent":"border-edge bg-panel text-fg hover:bg-surface"}`}}),!1,!0),m(te,d(to,{size:18}),Ce),V})()}),null),m(ce,()=>a.required()?"Share this tab, then drag an area.":"Click a block or highlight text. No screen sharing."),q(he=>{var V=j()==="block",te=`flex min-h-16 cursor-pointer flex-col items-center justify-center gap-1 rounded-lg border px-3 py-2 ${j()==="block"?"border-accent bg-accent-soft text-accent":"border-edge bg-panel text-fg hover:bg-surface"}`;return V!==he.e&&I(Z,"aria-pressed",he.e=V),te!==he.t&&de(Z,he.t=te),he},{e:void 0,t:void 0}),u})(),yr=(u,E)=>({onHover:ne,onDelete:()=>Ai(u),onToggleFold:()=>hr("threads",u),onToggleComment:F=>hr("comments",F),...E?{onOpen:()=>Re(()=>{A(u),J(u),R(F=>F===u?null:u)}),onReply:async()=>!1,onResolve:()=>{},onReopen:()=>{wn(u,{reopen:!0})}}:{onOpen:()=>Mt(u),onReply:F=>wn(u,{reply:F}),onResolve:()=>{wn(u,{resolve:!0})},onReopen:()=>{}}});return d(li,{get artifactId(){return e.id},backend:t,get children(){return d(Yn.Provider,{get value(){return t.mode==="offline"},get children(){return[(()=>{var u=Ic(),E=Ae;return typeof E=="function"?ye(E,u):Ae=u,u})(),d(T,{get when(){return Y(()=>!!a.busy())()&&!ee()},get children(){var u=Pc(),E=u.firstChild,F=E.nextSibling;return F.$$click=()=>a.reset(),u}}),d(T,{get when(){return En()},get children(){var u=Mc();return m(u,d(ge,{get each(){return Li()},children:E=>d(T,{get when(){return Ni(E)},children:F=>d(Vo,{get row(){return F().annotation},get top(){return F().top},get remaining(){return y()[E]?.remaining},get hovered(){return C()===E},onOpen:()=>Mt(E),onHover:ne})})})),u}}),d(T,{get when(){return j()},get children(){var u=Oc(),E=u.firstChild,F=E.nextSibling;return m(u,d(Ln,{size:12,strokeWidth:1.8,class:"shrink-0 text-accent"}),E),m(E,(()=>{var D=Y(()=>j()==="area");return()=>D()?a.busy()?"Choose this tab in the sharing dialog":"drag an area to screenshot":"click a block or highlight text to comment"})()),F.$$click=pr,m(F,d(Ye,{size:12,strokeWidth:1.8})),q(D=>{var B=j()==="area"?"Screenshot tool active":"Select tool active",Z=`${Nt().left+Nt().width/2}px`,X=`${Math.max(ft(),Nt().top,me()?44:0)+dt}px`;return B!==D.e&&I(u,"aria-label",D.e=B),Z!==D.t&&ae(u,"left",D.t=Z),X!==D.a&&ae(u,"top",D.a=X),D},{e:void 0,t:void 0,a:void 0}),u}}),d(T,{get when(){return Y(()=>!!(ee()&&ht()))()&&!j()},get children(){var u=Hc(),E=u.firstChild,F=E.firstChild,D=F.nextSibling,B=D.nextSibling,Z=E.nextSibling,X=Z.firstChild,U=X.firstChild,ce=U.nextSibling,he=ce.nextSibling;return m(F,d(no,{size:12,strokeWidth:1.8})),B.$$click=kn,m(B,d(Ye,{size:14,strokeWidth:1.8})),m(Z,d(T,{get when(){return a.busy()},get children(){var V=Lc(),te=V.firstChild;return m(V,d(On,{size:16,class:"animate-spin"}),te),V}}),X),m(Z,d(T,{get when(){return a.draft()},keyed:!0,children:V=>d(Er,{get fallback(){return(()=>{var te=Bc(),Ce=te.firstChild;return m(te,d(On,{size:16,class:"animate-spin"}),Ce),te})()},get children(){return d(pi,{get image(){return V.image},get initialStrokes(){return V.strokes},exportRef:f,get busy(){return He()},onRetake:()=>{$n()}})}})}),X),m(Z,d(T,{get when(){return Y(()=>!!(a.required()&&!a.draft()))()&&!a.busy()},get children(){var V=Nc(),te=V.firstChild,Ce=te.nextSibling,qe=Ce.nextSibling,Pe=qe.firstChild,Fe=Pe.nextSibling,Dt=qe.nextSibling;return m(te,()=>a.error()||"A screenshot is required for this selection."),Ce.$$click=()=>{$n()},Fe.addEventListener("change",gt=>{let xr=gt.currentTarget.files?.[0];xr&&a.upload(xr),gt.currentTarget.value=""}),Dt.$$click=()=>a.skip(),V}}),X),m(Z,d(T,{get when(){return e.editId&&s},get children(){var V=Dc();return m(V,d(jn,{reason:s,children:te=>(()=>{var Ce=Uc();return ze(Ce,te,!1,!0),Ce})()})),V}}),X),m(Z,d(mn,{backend:t,get artifactId(){return e.id},label:"Annotation comment",previewLabel:"Comment preview",previewToggleLabel:"Preview comment",get value(){return Ee()},onChange:Ke,onSubmit:gr,get previewing(){return It()},onPreviewingChange:et,rows:4,get autoFocus(){return!a.busy()},placeholder:"Add a comment for your agent\u2026",get children(){var V=Fc();return m(V,d(ge,{get each(){return ji()},children:(te,Ce)=>(()=>{var qe=Gc();return m(qe,d(T,{get when(){return Ce()>0},get children(){return Wc()}}),null),m(qe,d(T,{get when(){return te.path!==ee()?.path},get fallback(){return(()=>{var Pe=Yc();return m(Pe,()=>te.tag),Pe})()},get children(){return d($e,{get content(){return te.hint||te.tag},get children(){var Pe=Vc();return Pe.$$click=()=>w({type:Je,path:te.path}),m(Pe,()=>te.tag),q(Fe=>{var Dt=`Select ${te.tag}`,gt=!!a.draft()||a.busy();return Dt!==Fe.e&&I(Pe,"aria-label",Fe.e=Dt),gt!==Fe.t&&(Pe.disabled=Fe.t=gt),Fe},{e:void 0,t:void 0}),Pe}})}}),null),qe})()})),V}}),X),m(Z,d(T,{get when(){return dr()},get children(){var V=jc();return m(V,dr),V}}),X),ce.$$click=kn,he.$$click=gr,q(V=>{var te=`${ht().left}px`,Ce=`${ht().top}px`,qe=`${ht().width}px`,Pe=`calc(100vh - ${ht().top+dt}px)`,Fe=He()||a.busy()||a.required()&&!a.draft()||!Xe(Ee());return te!==V.e&&ae(u,"left",V.e=te),Ce!==V.t&&ae(u,"top",V.t=Ce),qe!==V.a&&ae(u,"width",V.a=qe),Pe!==V.o&&ae(u,"max-height",V.o=Pe),Fe!==V.i&&(he.disabled=V.i=Fe),V},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),u}}),d(T,{get when(){return Y(()=>!!e.railOpen)()&&e.railHost!==null},get children(){return d(Go,{get phone(){return me()||!!e.railSheet},get host(){return e.railHost??void 0},get topOffset(){return ft()},get rightInset(){return e.rightInset??0},onClose:()=>e.onRailOpenChange(!1),get header(){return Bi()},get children(){var u=Jc(),E=u.firstChild,F=ie;return typeof F=="function"?ye(F,u):ie=u,m(u,d(T,{get when(){return Y(()=>x().length===0)()&&!ee()},get children(){return qc()}}),E),m(u,d(ge,{get each(){return Hi()},children:D=>d(T,{get when(){return zi(D)},children:B=>d(ir,G({get artifactId(){return e.id},backend:t,get a(){return B()},get open(){return S()===D},get hovered(){return C()===D},get busy(){return He()},get targetMissing(){return oe().has(D)},get folded(){return $t(k(),"threads",D)},get justOpened(){return M()===D},isCommentFolded:Z=>$t(k(),"comments",Z)},()=>yr(D,!1)))})}),E),m(u,d(ge,{get each(){return qi()},children:D=>d(T,{get when(){return Ji(D)},children:B=>d(ir,G({get artifactId(){return e.id},backend:t,get a(){return B()},get open(){return S()===D},resolved:!0,get hovered(){return C()===D},get busy(){return He()},get targetMissing(){return oe().has(D)},get folded(){return $t(k(),"threads",D)},get justOpened(){return M()===D},isCommentFolded:Z=>$t(k(),"comments",Z)},()=>yr(D,!0)))})}),null),m(u,d(T,{get when(){return(b()?.length??0)===0},get children(){return zc()}}),null),u}})}}),d(T,{get when(){return fn()},get children(){return d(Eo,G(Xc,{danger:!0,get busy(){return gn()},get error(){return Ei()},onCancel:()=>{gn()||hn(null)},onConfirm:()=>{Ti()}}))}})]}})}})}pe(["click"]);function vi(e,t){let n=async(s,a,f)=>{let h=await fetch(s,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({file:e,...a}),signal:f}),w=await h.json();if(!h.ok)throw new Se(w.error??"Local preview request failed",h.status);return w},o=(s,a={},f)=>n("/editor",{operation:s,...a},f),r=async()=>{let s=await fetch("/document?file="+encodeURIComponent(e));if(!s.ok)throw new Se("Could not reload saved file",s.status);t(await s.json())},i={webAssets:"Add files with afbin, then restart preview.",mentions:"Mentions are unavailable in local preview.",commentImages:"Comment screenshots are unavailable in local preview.",remoteSessions:"Agent sessions are unavailable in local preview.",live:"Local files refresh from disk."},l=s=>i[s]??null,c=s=>{throw new Se(l(s)??"Unavailable in local preview",503)};return{mode:"offline",unavailable:l,load:()=>o("load"),commitEdit:async s=>{try{let a=await o("commit",s);return a.ok&&await r(),a}catch(a){if(a instanceof Se)return{ok:!1,status:a.status,body:{error:a.message,edit_id:s.edit_id,markup:null,version:0,details:[{message:a.message}]}};throw a}},prepare:s=>o("prepare",{markup:s}),previewCss:s=>o("css",{markup:s}),previewQueries:s=>o("queries",{markup:s}),queryTable:async()=>{throw new Se("Open the local dataset file to inspect its rows.",503)},importImage:async()=>({ok:!1,error:l("webAssets")}),versions:()=>o("versions"),version:s=>o("version",{version:s}),revert:async s=>{let a=await o("revert",s);return a.ok&&await r(),a},live:()=>()=>{},liveFrame:async()=>null,queryTransport:()=>({run:(s,a)=>n("/query",{values:s,only:a}),page:async(s,a,f)=>(await n("/query",{values:s,only:[a],page:{name:a,...f}})).tables[a],dispose:()=>{}}),listAnnotations:(s,a)=>o("annotations.list",{status:s},a?.signal),createAnnotation:(s,a)=>o("annotations.create",{input:s,key:a}),actOnAnnotation:(s,a)=>o("annotations.act",{id:s,input:a}),deleteAnnotation:s=>o("annotations.delete",{id:s}),uploadCommentImage:async()=>c("commentImages"),members:async s=>s===void 0?{mentions:{}}:{people:[]},remoteSessions:async()=>({sessions:[]}),deleteRemoteSession:async()=>c("remoteSessions")}}function yi(e){if(!e||typeof e!="object")return!1;let t=e;return t.type===bt&&Array.isArray(t.nodes)}var xi=e=>{let t=new Map,n=o=>{for(let r of o){if(r.type!=="element")continue;let i=r.attributes.find(l=>l.name==="id")?.value;r.isComponent&&i?.static&&typeof i.json=="string"&&t.set(i.json,_e([r])),n(r.children)}};return n(e),t},wi=e=>{let t=new Map,n=(o,r="")=>{o.forEach((i,l)=>{if(i.type!=="element")return;let c=[r,l].filter(s=>s!=="").join(".");i.isComponent&&t.set(c,_e([i])),n(i.children,c)})};return n(e),t};function ki({win:e,root:t,file:n,initialNodes:o,sourceRef:r,portal:i,onStatus:l,isSourceEditing:c=()=>!1}){let s=o,a=!1,f=new Set,h=Be(),w=L=>{if(!a)for(let j of[...f])j(L)},x={nonce:h,post:L=>queueMicrotask(()=>w(L)),innerHtmlOf:L=>L.innerHTML},g=null,y=!1,p=()=>y||c(),_=!1,b=null,O=null,S=null,R=!1,P=()=>{a||b||!O||!i||!S||!S.edit&&!S.annotate||(b=O({win:e,root:t,portal:i,onAction:(L,j)=>w({type:Ht,nonce:h,action:L,selection:j})}),b.setNodes(s),b.update(S))},J=null,k=null,$=!1,M=0,A=null,C=null,H=null,W=L=>L.getAttributeNames().find(j=>j.startsWith("data-mx-"))??null,ne=L=>Array.from(L.head.querySelectorAll("style")).filter(j=>W(j)!==null),oe=(L,j)=>{let se=new Map(ne(L).map(me=>[W(me),me])),le=null;for(let me of j){let Ee=W(me),Ke=me.textContent??"",Ie=se.get(Ee)??null;se.delete(Ee),Ie?Ie.textContent!==Ke&&(Ie.textContent=Ke):(Ie=L.importNode(me,!0),le?le.after(Ie):L.head.appendChild(Ie)),le=Ie}for(let me of se.values())me.textContent=""},z=(L,j)=>{let se=xi(j),le=xi(L);return new Set([...le].filter(([me,Ee])=>se.get(me)===Ee).map(([me])=>me))},we=(L,j)=>{let se=wi(j),le=wi(L);return new Set([...le].filter(([me,Ee])=>se.get(me)===Ee).map(([me])=>me))},fe=()=>{let L=e.document.activeElement;return L instanceof HTMLElement&&t.contains(L)&&!!L.closest("[data-mx-edit-region]")},ie=async(L=!1)=>{let j=H;if(!j||fe()&&(!L||!g?.canApplyDraft())||a||!p()||j.sequence!==M)return;let{disposeChangedDraftIslands:se,hydrateDraftIslands:le,morphDraftDom:me}=await import("./engine-5UO3LPN5.js");a||!p()||j.sequence!==M||H!==j||(H=null,C!==null&&(e.clearTimeout(C),C=null),oe(e.document,j.sheets),g?.unmountCompiledDom(),se(t,j.stableIds,j.stablePaths),me(t,j.root,j.stableIds,j.stablePaths),await le(e,t,j.document,j.stableIds,j.stablePaths),s=j.nodes,A=j.source,g?.setNodes(s),await g?.mountCompiledDom(),J?.setNodes(s),b?.setNodes(s))},Ae=()=>{queueMicrotask(()=>{ie()})};e.document.addEventListener("focusout",Ae,!0);let ee={nonce:h,selectionReady:P,send(L){if(!(a||!L||typeof L!="object")){if(yi(L)){ee.update(L);return}if(Lr(L)){if(L.type===jt){if(y=L.on,!L.on){M++,H=null,C!==null&&e.clearTimeout(C),C=null,g?.dispose(),g=null;return}if(g||_)return;_=!0,Promise.all([import("./session-A2Z3M7QD.js"),import("./dom-mounter-2URPGP2F.js")]).then(([{createFrameEditSession:j},{mountCompiledEditRegions:se}])=>{if(!(a||!y))return g=j({win:e,root:t,channel:x,requestRender:()=>{},mountCompiled:se}),g.setNodes(s),g.mountCompiledDom()}).catch(j=>{a||l?.(j instanceof Error?j.message:String(j))}).finally(()=>{_=!1});return}if(!(g&&(g.onParentMessage(L),L.type!==at&&L.type!==Rn&&L.type!==Je))){if(L.type===at){if(k=L,J){J.update(L);return}if(L.mode==="off"||$)return;$=!0,import("./annotate-THM7GL72.js").then(({createFrameAnnotateSession:j})=>{a||(J=j({win:e,root:t,channel:x,isEditing:()=>y}),J.setNodes(s),k&&J.update(k))}).catch(j=>{a||l?.(j instanceof Error?j.message:String(j))}).finally(()=>{$=!1});return}if(L.type===Rn){if(S=L,b){b.update(L);return}if(O){P();return}if(!L.edit&&!L.annotate||R)return;R=!0,import("./selection-actions-LBFPODLD.js").then(({createFrameSelectionActions:j})=>{O=j,P()}).catch(j=>{a||l?.(j instanceof Error?j.message:String(j))}).finally(()=>{R=!1});return}L.type===Je&&J?.select(L.path)}}}},update(L){if(!a){if(p()&&L.source!==void 0){let j=++M,se=L.source;e.fetch("/draft",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({file:n,source:se})}).then(async le=>{if(le.status===400||le.status===422)return;if(!le.ok)throw new Error(`draft preview answered ${le.status}`);let me=await le.json(),Ee=new DOMParser().parseFromString(me.html,"text/html");if(a||j!==M||!p())return;let Ke=Ee.querySelector("[data-mx-inline-story]");if(!Ke)throw new Error("draft preview carried no story");let Ie=A??r.current,{storyUpdateParts:It}=await import("./update-parts-ZLXTYSVY.js"),et=Ie?It(Ie)?.nodes??s:s,He=It(se)?.nodes??L.nodes;H={document:Ee,root:Ke,sheets:ne(Ee),nodes:L.nodes,source:se,stableIds:z(He,et),stablePaths:we(He,et),sequence:j},await ie(),H?.sequence===j&&C===null&&(C=e.setTimeout(()=>{C=null,ie(!0)},500))}).catch(le=>{a||l?.(le instanceof Error?le.message:String(le))});return}L.nodes&&(s=L.nodes,J?.setNodes(s),b?.setNodes(s))}},invalidate(){},subscribe(L){return a||f.add(L),()=>{f.delete(L)}},getViewportRect:()=>new DOMRect(0,0,e.innerWidth,e.innerHeight),dispose(){a||(a=!0,f.clear(),g?.dispose(),g=null,J?.dispose(),J=null,b?.dispose(),b=null,C!==null&&e.clearTimeout(C),e.document.removeEventListener("focusout",Ae,!0))}};return ee}var ed=v("<div class=afbin-preview-bar><strong>Artifactbin preview</strong><span role=status aria-live=polite style=flex:1;opacity:0.8></span><button type=button>Comments (<!>)"),td=v("<button type=button>Edit in place"),nd=v("<button type=button>Edit the source"),rd=v("<button type=button>Done editing"),od=v("<button type=button>Edit document"),id=v('<div style=position:fixed;top:40px;left:0;right:0;bottom:0;z-index:2147483646;background:#0f172a;padding:12px><textarea aria-label="Markup source"style="width:100%;height:100%;box-sizing:border-box;resize:none;font-family:ui-monospace, monospace;font-size:13px;padding:12px;color:#e2e8f0;background:#111827;border:1px solid #334155;border-radius:6px">'),ad=new URLSearchParams(location.search).get("capture")==="1",At=decodeURIComponent(location.pathname.slice(11));async function cr(e,t){let n=await fetch(e,t?{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}:{}),o=await n.json();if(!n.ok)throw Error(o.error??`${n.status}`);return o}var $i=40;function sd(e){let[t,n]=N("Ready"),[o,r]=N(!1),[i,l]=N(!1),[c,s]=N(null),[a,f]=N(e.initial),[h,w]=N(0),[x,g]=N(!1),y=e.initial.revision,p={current:e.initial.body},_={current:!1},b={current:null},S=vi(At,C=>{y=C.revision,p.current=C.body,f(C),b.current?.update({type:bt,nodes:C.data.nodes})});ve(()=>{document.body.style.paddingTop=`${$i}px`,K(()=>{document.body.style.paddingTop=""});let C=document.getElementById(Sr);if(!C){n("No document root found");return}let H=document.createElement("div");H.setAttribute("data-afbin-selection-portal",""),document.body.append(H),K(()=>H.remove());let W=ki({win:window,root:C,file:At,initialNodes:e.initial.data.nodes,sourceRef:p,portal:H,isSourceEditing:i,onStatus:z=>n(z)});b.current=W,s(W.nonce),W.selectionReady(),K(()=>W.dispose());let ne=window.setInterval(()=>{o()||_.current||cr("/document?file="+encodeURIComponent(At)).then(z=>{z.revision!==y&&location.reload()}).catch(z=>n(String(z)))},1500);K(()=>window.clearInterval(ne));let oe=z=>{_.current&&(z.preventDefault(),z.returnValue="")};window.addEventListener("beforeunload",oe),K(()=>window.removeEventListener("beforeunload",oe))});let R=(C,H=!0)=>{if(_.current=!0,p.current=C,n("Unsaved"),!H)return;let W=ke(C);W.ok&&b.current?.update({type:bt,nodes:Hr(W.nodes).body,source:C})},P=Xr({get editing(){return o()&&!i()},get sessionNonce(){return c()},runtimeRef:b,sourceRef:p,onError:C=>n(C),onSourceEdited:R}),J=async()=>{try{i()||await P.commitPending(!0),await cr("/save",{file:At,revision:y,body:p.current}),_.current=!1,location.reload()}catch(C){n(C instanceof Error?C.message:String(C))}},[k,$]=N(""),M=async()=>{try{o()&&!i()&&await P.commitPending(!0),$(p.current),l(!0),r(!0)}catch(C){n(C instanceof Error?C.message:String(C))}},A={position:"fixed",top:"0",left:"0",right:"0","z-index":2147483647,display:"flex","align-items":"center",gap:"12px",padding:"8px 16px",background:"#0f172a",color:"#e2e8f0",font:"13px system-ui, sans-serif"};return[(()=>{var C=ed(),H=C.firstChild,W=H.nextSibling,ne=W.nextSibling,oe=ne.firstChild,z=oe.nextSibling,we=z.nextSibling;return rt(C,A),m(W,t),m(C,(()=>{var fe=Y(()=>!!i());return()=>fe()?(()=>{var ie=td();return ie.$$click=()=>l(!1),ie})():(()=>{var ie=nd();return ie.$$click=()=>{M()},ie})()})(),ne),m(C,(()=>{var fe=Y(()=>!!o());return()=>fe()?(()=>{var ie=rd();return ie.$$click=()=>{J()},ie})():(()=>{var ie=od();return ie.$$click=()=>r(!0),ie})()})(),ne),ne.$$click=()=>g(fe=>!fe),m(ne,h,z),q(()=>I(ne,"aria-pressed",x())),C})(),Y(()=>Y(()=>!!i())()&&(()=>{var C=id(),H=C.firstChild;return H.$$input=W=>{$(W.currentTarget.value),R(W.currentTarget.value)},q(()=>H.value=k()),C})()),d(bi,{get id(){return a().metadata.id??"local-preview"},backend:S,get railOpen(){return x()},onRailOpenChange:g,runtimeRef:b,get sessionNonce(){return c()},showViewComments:!0,topOffset:$i,pickOnOpen:!0,onAnnotationsChange:C=>w(C.filter(H=>H.status==="open").length)})]}ad||cr("/document?file="+encodeURIComponent(At)).then(e=>{let t=document.createElement("div");document.body.append(t),_r(()=>d(sd,{initial:e}),t)}).catch(e=>{let t=document.createElement("pre");t.textContent=e instanceof Error?e.message:String(e),document.body.append(t)});pe(["click","input"]);export{sd as Toolbar};
|
|
29
29
|
/*! Bundled license information:
|
|
30
30
|
|
|
31
31
|
lucide-solid/dist/esm/icons/camera.mjs:
|