@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
package/dist/runtime/dist/web/assets/{DocumentChrome-EUbW_JvA.js → DocumentChrome-Bw4_z5yQ.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as e,I as t,M as n,N as r,R as i,T as a,_ as o,a as s,b as c,i as l,k as u,l as d,m as f,n as p,o as m,p as h,r as g,s as _,z as v}from"./web-Ckpee-ZJ.js";import{t as y}from"./download-j-nqks7p.js";import{t as b}from"./git-fork-PQOXxmWW.js";import{n as x,t as S}from"./users-BJrdLUkX.js";import{n as C,r as w,t as T}from"./DocumentSharing-BuTXuflA.js";import{v as E,y as D}from"./person-mentions-BEjAedYZ.js";import{A as O,G as k,M as A,N as ee,U as j,Y as M,at as N,dt as P,ft as te,g as F,it as I,l as L,o as ne,ot as R,r as re,rt as ie,s as ae,ut as oe,v as se}from"./solid-app-BtmRR9Ax.js";import{n as ce}from"./sign-in-required-7zEVbzx2.js";import{t as z}from"./ConfirmDialog-Ph1VDgNN.js";import{t as le}from"./ForkArtifact-DDmXl1BZ.js";var ue=[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]],de=e=>a(k,t(e,{iconNode:ue,name:`message-circle`})),fe=[[`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`}]],B=e=>a(k,t(e,{iconNode:fe,name:`message-square`})),V=[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]],pe=e=>a(k,t(e,{iconNode:V,name:`refresh-cw`}));function me(e,t,n=1/0){if(e.length===0)return null;let r=null,i=null;for(let a of e)if(!(a.top>t||a.top+Math.max(a.height,1)<=t)){if(a.height>n){(!i||a.height<i.height)&&(i=a);continue}if(!r){r=a;continue}(a.height<r.height||a.height===r.height&&a.top>r.top)&&(r=a)}if(!r){let r=e.filter(e=>e.top>=t&&e.height<=n).sort((e,t)=>e.top-t.top)[0];return r?{path:r.path,fraction:0}:i?{path:i.path,fraction:H((t-i.top)/Math.max(i.height,1))}:{path:e.reduce((e,t)=>t.top>e.top?t:e).path,fraction:1}}let a=(t-r.top)/Math.max(r.height,1);return{path:r.path,fraction:H(a)}}var H=e=>Number.isFinite(e)?Math.min(1,Math.max(0,e)):0,U=`data-mx-ast`;function he(e){let t=e.defaultView?.scrollY??0,n=[];for(let r of e.querySelectorAll(`[${U}]`)){let e=r.getAttribute(U);if(!e)continue;let i=r.getBoundingClientRect();(i.height!==0||i.width!==0)&&n.push({path:e,top:i.top+t,height:i.height})}return n}function ge(e){return me(he(e.document),e.scrollY,e.innerHeight)}var W=e=>`/a/${encodeURIComponent(e)}/app/`,_e=h(`<a target=_self aria-label="Install app">Install app`),ve=h(`<p>Open this artifact from your home screen or desktop. An internet connection is required.`),ye=h(`<p class=mt-3>On iPhone or iPad, open the Share menu and choose Add to Home Screen. In Chrome or Edge, use the browser menu’s Install app option. In Safari on Mac, choose File → Add to Dock.`);function G(e){let t=window.matchMedia?.(`(display-mode: standalone)`).matches||navigator.standalone;return a(c,{when:!t,get children(){var t=_e(),n=t.firstChild;return t.$$click=t=>{if(!e.beforeNavigate)return;t.preventDefault();let n=t.currentTarget.href;e.beforeNavigate().then(e=>{e&&window.location.assign(n)})},m(t,a(y,{size:14}),n),u(n=>{var r=`${W(e.id)}?install=1`,i=e.class;return r!==n.e&&d(t,`href`,n.e=r),i!==n.t&&l(t,n.t=i),n},{e:void 0,t:void 0}),t}})}function be(e){let[t,r]=n(window.location.pathname===W(e.id)&&new URLSearchParams(window.location.search).has(`install`)),[o,s]=n(P()),[l,u]=n(null),[d,f]=n(!1);i(te(()=>s(P())));let p=()=>o()?.path===W(e.id),m=()=>{r(!1);let e=new URL(window.location.href);e.searchParams.delete(`install`),window.history.replaceState(window.history.state,``,e)},h=()=>{if(!p()){m();return}let e=oe();if(e){f(!0);try{e.prompt().then(m,()=>u(`The install prompt could not open. Use your browser’s install option.`)).finally(()=>f(!1))}catch{f(!1),u(`The install prompt could not open. Use your browser’s install option.`)}}};return a(c,{get when(){return t()},get children(){return a(z,{get title(){return`Install ${e.title}`},get action(){return p()?`Install app`:`Done`},get busy(){return d()},get error(){return l()},onCancel:m,onConfirm:h,get description(){return[ve(),a(c,{get when(){return!p()},get children(){return ye()}})]}})}})}s([`click`]);var K=`data-mx-view-reported`,q=(e,t)=>e.body.getAttribute(K)===t;function xe(e,t){if(!t||q(e.document,t))return;let n=()=>{q(e.document,t)||(e.document.body.setAttribute(K,t),e.fetch(`/api/page/artifact/${encodeURIComponent(t)}/view`,{method:`POST`,credentials:`same-origin`,keepalive:!0}).catch(()=>{}))};e.document.prerendering?e.document.addEventListener(`prerenderingchange`,n,{once:!0}):n()}var Se=h(`<button type=button class="flex w-full items-center gap-2 rounded px-2 py-2 text-left font-mono text-xs text-danger hover:bg-raised">delete`);function Ce(e){let[t,r]=n(!1),[i,o]=n(!1),[s,l]=n(null),f=async()=>{if(!i()){o(!0),l(null);try{let t=await fetch(`/api/my/artifacts/${encodeURIComponent(e.id)}`,{method:`DELETE`});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`Could not move this artifact to trash. Try again.`)}M(),e.onDeleted(),r(!1)}catch(e){l(e instanceof Error?e.message:`Could not move this artifact to trash. Try again.`)}finally{o(!1)}}};return[(()=>{var t=Se(),n=t.firstChild;return t.$$click=()=>r(!0),m(t,a(E,{size:14}),n),u(()=>d(t,`aria-label`,`Delete ${e.title}`)),t})(),a(c,{get when(){return t()},get children(){return a(z,{get title(){return`Delete “${e.title}”?`},get description(){return`Delete "${e.title}"? The link stops working. It goes to the trash, where you can restore it any time.`},action:`Move to trash`,confirmLabel:`Confirm delete`,cancelLabel:`Cancel delete`,danger:!0,get busy(){return i()},get error(){return s()},onConfirm:()=>void f(),onCancel:()=>r(!1)})}})]}s([`click`]);var we=h(`<a download aria-label="Download for offline"class="flex w-full items-center gap-2 rounded px-2 py-2 font-mono text-xs text-muted hover:bg-raised">`),Te=h(`<p role=alert class="text-xs text-danger">`);function Ee(e){let[t,r]=n(!1),[i,o]=n(``),s=()=>`/a/${encodeURIComponent(e.id)}/download${e.version===void 0?``:`?version=${e.version}`}`,l=async e=>{if(e.preventDefault(),!t()){r(!0),o(``);try{let e=await fetch(s(),{credentials:`same-origin`});if(!e.ok){let t=await e.json().catch(()=>null);o(t?.message??`The offline file could not be made (HTTP ${e.status}).`);return}let t=URL.createObjectURL(await e.blob()),n=document.createElement(`a`);n.href=t;let r=e.headers.get(`Content-Disposition`),i=r?.match(/filename\*=UTF-8''([^;]+)/i)?.[1];try{n.download=i?decodeURIComponent(i.trim()):r?.match(/filename="([^"]+)"/i)?.[1]??`artifact.html`}catch{n.download=`artifact.html`}document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(t),0)}catch{o(`The offline file could not be downloaded. Check the connection and try again.`)}finally{r(!1)}}};return[a(O,{content:`One HTML file you can open, edit and comment on without a connection.`,get children(){var e=we();return e.$$click=e=>void l(e),m(e,a(y,{size:14}),null),m(e,()=>t()?`preparing file…`:`download for offline`,null),u(n=>{var r=s(),i=t()?`true`:void 0;return r!==n.e&&d(e,`href`,n.e=r),i!==n.t&&d(e,`aria-busy`,n.t=i),n},{e:void 0,t:void 0}),e}}),a(c,{get when(){return i()},get children(){var e=Te();return m(e,i),e}})]}s([`click`]);var De=e=>window.location.assign(e);async function J(e,t,n,r=De){try{let i=await L(e,t?`DELETE`:`POST`);if(await ce(i))return r(A(window.location,n)),null;if(!i.ok)return null;let a=await i.json();return M(),a}catch{return null}}var Oe=h(`<button type=button class="inline-flex items-center gap-1 rounded px-2 py-1 text-sm text-muted hover:text-accent">`);function ke(e){let[t,r]=n(e.initial),[i,o]=n(!1),s=t=>(e.navigate??(e=>location.assign(e)))(t),c=async()=>{if(!e.accountSession){s(A(location,`like`));return}if(i())return;o(!0);let n=await J(`/api/my/artifacts/${encodeURIComponent(e.id)}/like`,t().liked,`like`,s);o(!1),n&&(r(n),e.onChange?.(n))};return a(O,{get content(){return t().liked?`unlike`:`like`},get children(){var e=Oe();return e.$$click=()=>void c(),m(e,a(x,{size:14,get fill(){return t().liked?`currentColor`:`none`}}),null),m(e,()=>t().count,null),u(n=>{var r=t().liked?`Unlike artifact`:`Like artifact`,a=t().liked,o=i();return r!==n.e&&d(e,`aria-label`,n.e=r),a!==n.t&&d(e,`aria-pressed`,n.t=a),o!==n.a&&(e.disabled=n.a=o),n},{e:void 0,t:void 0,a:void 0}),e}})}s([`click`]);var Y=new Map;function Ae(e,t,n={}){let r=Y.get(e)??{at:0};if(Y.set(e,r),r.inflight)return r.inflight;if(!n.force&&r.at&&Date.now()-r.at<(n.ttl??0))return Promise.resolve(r.value);let i=t().then(e=>(r.value=e,r.at=Date.now(),e)).finally(()=>{r.inflight===i&&(r.inflight=void 0)});return r.inflight=i,i}function je(e,t){let n=Y.get(e)??{at:0};n.value=t,n.at=Date.now(),Y.set(e,n)}var Me=h(`<span class="text-xs text-accent">Joined`),Ne=h(`<span class="ml-auto text-xs text-muted">`),Pe=h(`<p role=alert class="text-xs text-danger">`),Fe=h(`<p role=status>Loading people…`),Ie=h(`<div class="space-y-4 rounded-xl border border-edge bg-surface p-4"><div><h3 class=font-medium>People in this artifact</h3><p class="text-xs leading-5 text-muted">Comment access does not depend on joining.`),Le=h(`<section aria-label="artifact people"class=space-y-3><button type=button aria-label=People class="flex w-full items-center gap-2 rounded-md px-2 py-2 text-sm hover:bg-raised"><span>People`),Re=h(`<div class="flex items-center justify-between gap-2"><span class="text-xs text-accent">`),ze=h(`<ul class="divide-y divide-edge">`),Be=h(`<label class="flex items-center gap-2 text-xs"><input type=checkbox>Include viewing access`),Ve=h(`<div class="space-y-2 border-t border-edge pt-4"><p class="text-xs leading-5 text-muted">Find anyone by username. Invitations wait for acceptance unless they follow you.</p><div class="flex flex-wrap gap-1"></div><p class="text-xs leading-5 text-muted">Followers join immediately unless they’ve turned off automatic acceptance. Others see a pending invitation.`),He=h(`<div class="space-y-2 rounded-lg bg-raised p-3"><p class=text-xs></p><div class="flex gap-2">`),Ue=h(`<li class="flex items-center gap-3 py-2.5"><span class="flex h-7 w-7 items-center justify-center rounded-full bg-accent-soft text-xs text-accent"></span><span class="min-w-0 truncate text-sm"></span><span class="ml-auto text-xs text-muted">Member`),We=h(`<div class="space-y-2 rounded-lg border border-edge p-3"><p class=text-xs>@<!> · </p><div class="flex gap-2">`),Ge=h(`<button type=button class="rounded-full bg-accent-soft px-2 py-1 text-xs text-accent">@<!> ×`),Ke=h(`<p role=status class="px-3 py-2 text-xs text-muted">`),qe=h(`<div class="absolute left-0 right-0 top-full z-40 mt-1 overflow-hidden rounded-md border border-edge bg-surface shadow-lg"><ul role=listbox aria-label="People suggestions"class="max-h-48 overflow-y-auto p-1">`),Je=h(`<div class=relative><label class="grid gap-2 text-xs font-medium">Add people`),Ye=h(`<li role=presentation><button type=button role=option tabindex=-1>@<!> <span class="ml-2 text-xs text-muted">`);function X(t){let[r,s]=n(!!t.initialOpen),[l,f]=n(null),[p,h]=n(``),[g,v]=n(!1),[y,b]=n([]),[x,C]=n(!1),w=()=>`/api/my/artifacts/${encodeURIComponent(t.id)}/members`,T=()=>`members:${t.id}`,E=t.revision;e(()=>{r();let e=t.revision!==E;E=t.revision;let n=!0;i(()=>{n=!1}),Ae(T(),async()=>{let e=await fetch(w()),t=await e.json();if(!e.ok||!Array.isArray(t.members)||!Array.isArray(t.pending))throw Error(t.detail??`Could not load people`);return t},{ttl:3e4,force:e}).then(e=>{n&&(f(e),h(``))}).catch(e=>{n&&h(e instanceof Error?e.message:`Could not load people`)})});let D=async e=>{if(!g()){v(!0),h(``);try{let n=await L(w(),`POST`,e),r=await n.json();if(!n.ok||!Array.isArray(r.members)||!Array.isArray(r.pending))throw Error(r.detail??`Could not update people`);f(r),je(T(),r),t.onChange?.(),e.action===`invite`&&b([])}catch(e){h(e instanceof Error?e.message:`Could not update people`)}finally{v(!1)}}},O=()=>l()?.self;return(()=>{var e=Le(),n=e.firstChild,i=n.firstChild;return n.$$click=()=>s(e=>!e),m(n,a(S,{size:16}),i),m(n,a(c,{get when(){return _(()=>O()?.status===`accepted`)()&&O()?.explicit_join},get children(){return Me()}}),null),m(n,a(c,{get when(){return l()},get children(){var e=Ne();return m(e,()=>l().members.length),e}}),null),m(e,a(c,{get when(){return r()},get children(){var e=Ie();return e.firstChild,m(e,a(c,{get when(){return p()},get children(){var e=Pe();return m(e,p),e}}),null),m(e,a(c,{get when(){return _(()=>!l())()&&!p()},get children(){return Fe()}}),null),m(e,a(c,{get when(){return l()},children:e=>[a(c,{get when(){return O()?.status===`accepted`},get fallback(){return a(c,{get when(){return O()?.status===`pending`},get fallback(){return a(c,{get when(){return!t.hideJoin},get children(){return a(F,{get disabled(){return g()},onClick:()=>void D({action:`join`}),get children(){return e().canManage?`Join artifact`:`Request to join`}})}})},get children(){var t=He(),n=t.firstChild,r=n.nextSibling;return m(n,()=>O()?.direction===`request`?`Waiting for an owner or editor to approve.`:`You’ve been invited to join.`),m(r,a(c,{get when(){return O()?.direction===`invitation`||e().canManage},get children(){return a(F,{get disabled(){return g()},onClick:()=>void D({action:e().canManage&&O()?.direction===`request`?`join`:`accept`}),get children(){return e().canManage&&O()?.direction===`request`?`Join artifact`:`Accept invitation`}})}}),null),m(r,a(F,{variant:`ghost`,get disabled(){return g()},onClick:()=>void D({action:`dismiss`}),get children(){return O()?.direction===`request`?`Withdraw request`:`Decline`}}),null),t}})},get children(){var e=Re(),t=e.firstChild;return m(t,()=>O()?.explicit_join?`You’re a member`:`Invitation automatically accepted`),m(e,a(c,{get when(){return!O()?.explicit_join},get children(){return a(F,{get disabled(){return g()},onClick:()=>void D({action:`join`}),children:`Join artifact`})}}),null),m(e,a(F,{variant:`ghost`,get disabled(){return g()},onClick:()=>void D({action:`leave`}),children:`Leave`}),null),e}}),(()=>{var t=ze();return m(t,a(o,{get each(){return e().members},children:e=>(()=>{var t=Ue(),n=t.firstChild,r=n.nextSibling;return m(n,()=>(e.name??e.username??`?`).slice(0,1).toUpperCase()),m(r,(()=>{var t=_(()=>!!e.username);return()=>t()?`@${e.username}`:e.name??e.user_id})()),t})()})),t})(),a(c,{get when(){return e().canManage},get children(){return a(o,{get each(){return e().pending.filter(e=>e.user_id!==O()?.user_id)},children:e=>(()=>{var t=We(),n=t.firstChild,r=n.firstChild.nextSibling;r.nextSibling;var i=n.nextSibling;return m(n,()=>e.username??e.user_id,r),m(n,()=>e.direction===`invitation`?`Invitation pending`:`Wants to join`,null),m(i,a(c,{get when(){return e.direction===`request`},get children(){return a(F,{get disabled(){return g()},onClick:()=>void D({action:`approve`,userId:e.user_id}),get children(){return[`Approve @`,_(()=>e.username??e.user_id)]}})}}),null),m(i,a(F,{variant:`ghost`,get disabled(){return g()},onClick:()=>void D({action:`dismiss`,userId:e.user_id}),children:`Dismiss`}),null),t})()})}}),a(c,{get when(){return e().canInvite},get children(){var t=Ve(),n=t.firstChild,r=n.nextSibling,i=r.nextSibling;return m(t,a(Xe,{get endpoint(){return w()},get selected(){return y()},onSelect:e=>b(t=>[...t,e])}),n),m(r,a(o,{get each(){return y()},children:e=>(()=>{var t=Ge(),n=t.firstChild.nextSibling;return n.nextSibling,t.$$click=()=>b(t=>t.filter(t=>t.user_id!==e.user_id)),m(t,()=>e.username,n),u(()=>d(t,`aria-label`,`Remove @${e.username}`)),t})()})),m(t,a(c,{get when(){return e().canManage},get children(){var e=Be(),t=e.firstChild;return t.addEventListener(`change`,e=>C(e.currentTarget.checked)),u(()=>t.checked=x()),e}}),i),m(t,a(F,{get disabled(){return g()||y().length===0},onClick:()=>void D({action:`invite`,usernames:y().map(e=>`@${e.username}`),includeAccess:x()}),get children(){return[`Invite`,_(()=>_(()=>!!y().length)()?` ${y().length} people`:``)]}}),i),t}})]}),null),e}}),null),u(()=>d(n,`aria-expanded`,r())),e})()}function Xe(t){let s=r(),[f,p]=n(``),[h,g]=n(!1),[v,y]=n([]),[b,x]=n(-1),[S,C]=n(!1),[w,T]=n(``),E=()=>v().filter(e=>!t.selected.some(t=>t.user_id===e.user_id));e(()=>{if(!h())return;let e=new AbortController;C(!0),T(``),y([]),x(-1),fetch(`${t.endpoint}?purpose=invite&query=${encodeURIComponent(f())}`,{signal:e.signal}).then(async t=>{if(!t.ok)throw Error(`Could not find people. Try again.`);let n=await t.json();e.signal.aborted||y(n.people??[])}).catch(()=>{e.signal.aborted||T(`Could not find people. Try again.`)}).finally(()=>{e.signal.aborted||C(!1)}),i(()=>e.abort())});let D=e=>{t.onSelect(e),p(``),g(!1),x(-1)};return(()=>{var e=Je(),t=e.firstChild;return t.firstChild,e.$$focusout=e=>{e.currentTarget.contains(e.relatedTarget)||g(!1)},m(t,a(se,{role:`combobox`,"aria-label":`Find people by username`,"aria-autocomplete":`list`,get"aria-expanded"(){return h()},get"aria-controls"(){return h()?s:void 0},get"aria-activedescendant"(){return _(()=>!!(h()&&E()[b()]))()?`${s}-${b()}`:void 0},get value(){return f()},placeholder:`@username`,autocomplete:`off`,onFocus:()=>g(!0),onClick:()=>g(!0),onInput:e=>{p(e.currentTarget.value),g(!0),x(-1)},onKeyDown:e=>{let t=E();e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),g(!1)):e.key===`ArrowDown`||e.key===`ArrowUp`?(e.preventDefault(),g(!0),x(n=>t.length?n<0?e.key===`ArrowDown`?0:t.length-1:(n+(e.key===`ArrowDown`?1:t.length-1))%t.length:-1)):e.key===`Enter`&&h()&&t[b()]&&(e.preventDefault(),D(t[b()]))}}),null),m(e,a(c,{get when(){return h()},get children(){var e=qe(),t=e.firstChild;return d(t,`id`,s),m(t,a(o,{get each(){return E()},children:(e,t)=>(()=>{var n=Ye(),r=n.firstChild,i=r.firstChild.nextSibling,a=i.nextSibling.nextSibling;return r.$$click=()=>D(e),r.$$mousedown=e=>e.preventDefault(),m(r,()=>e.username,i),m(a,()=>e.name),u(e=>{var n=`${s}-${t()}`,i=b()===t(),a=`w-full rounded px-3 py-2 text-left text-sm hover:bg-raised ${b()===t()?`bg-raised`:``}`;return n!==e.e&&d(r,`id`,e.e=n),i!==e.t&&d(r,`aria-selected`,e.t=i),a!==e.a&&l(r,e.a=a),e},{e:void 0,t:void 0,a:void 0}),n})()})),m(e,a(c,{get when(){return S()||w()||E().length===0},get children(){var e=Ke();return m(e,(()=>{var e=_(()=>!!S());return()=>e()?`Finding people…`:w()||`No people found.`})()),e}}),null),e}}),null),e})()}s([`click`,`focusout`,`mousedown`]);var Ze=h(`<button type=button aria-label="Refresh external images"class="flex w-full items-center gap-2 rounded px-2 py-2 text-left font-mono text-xs text-muted hover:bg-raised disabled:opacity-60">`),Qe=h(`<div role=status aria-label="Refresh result"class="mt-1 rounded border border-edge bg-raised px-2 py-2 text-xs text-muted">`),$e=h(`<p class=break-all>`);function et(e,t){if(t===429)return[`too many web imports this hour — try again later`];if(t!==200)return[e.error??`could not refresh (${t})`];let n=[];e.refreshed?.length?n.push(`${e.refreshed.length} refreshed`):e.unchanged?.length?n.push(`already up to date`):e.failed?.length||n.push(`this document names no external images`);for(let t of e.failed??[])n.push(`${t.url} — ${t.fix}`);return n}function tt(e){let[t,r]=n(!1),[s,l]=n(null),d=!1,f=!0;i(()=>{f=!1});let p=()=>{d||(d=!0,r(!0),l(null),(async()=>{try{let t=await fetch(`/api/my/artifacts/${encodeURIComponent(e.id)}/assets/refresh`,{method:`POST`,credentials:`same-origin`}),n=await t.json().catch(()=>({}));f&&l(et(n,t.status))}catch{f&&l([`could not refresh — try again`])}finally{d=!1,f&&r(!1)}})())};return[(()=>{var e=Ze();return e.$$click=p,m(e,a(pe,{size:14}),null),m(e,()=>t()?`refreshing…`:`refresh external images`,null),u(()=>e.disabled=t()),e})(),a(c,{get when(){return s()},children:e=>(()=>{var t=Qe();return m(t,a(o,{get each(){return e()},children:e=>(()=>{var t=$e();return m(t,e),t})()})),t})()})]}s([`click`]);var nt=h(`<span>`),rt=h(`<button type=button aria-label="Toggle comments"class="flex w-full items-center gap-2 rounded-[5px] border-0 bg-transparent px-2 py-2 text-left font-mono text-xs text-muted hover:bg-raised hover:text-fg"><span class=flex-1>`),it=h(`<button type=button aria-label="Edit artifact"class="flex w-full items-center gap-2 rounded-[5px] border-0 bg-transparent px-2 py-2 text-left font-mono text-xs text-muted hover:bg-raised hover:text-fg">edit artifact`),at=h(`<a class="flex w-full items-center gap-2 rounded-[5px] border-0 bg-transparent px-2 py-2 text-left font-mono text-xs text-muted hover:bg-raised hover:text-fg">Schedule artifact`),ot=h(`<section aria-label="Owner actions"class=space-y-1><h2 class="px-2 font-mono text-[10px] font-semibold uppercase tracking-[0.14em] text-faint">owner`),st=h(`<div class=space-y-4 aria-label="Document actions"><section aria-label="Document actions"class=space-y-1><h2 class="px-2 font-mono text-[10px] font-semibold uppercase tracking-[0.14em] text-faint">Artifact`),ct=h(`<p data-mx-forked-from class="px-2 py-2 font-mono text-xs text-muted">forked from `),lt=h(`<a aria-label="Open the artifact this was forked from"class=underline>`),ut=`flex w-full items-center gap-2 rounded-[5px] border-0 bg-transparent px-2 py-2 text-left font-mono text-xs text-muted hover:bg-raised hover:text-fg`;function dt(e){let[t,r]=n(e.commentsOpen??!1),i=()=>e.owner&&!e.archived,o=()=>e.canEdit&&!e.archived,s=()=>e.canAnnotate&&!e.archived,l=()=>{let n=!t();r(n),e.onCommentsChange(n)};return(()=>{var n=st(),r=n.firstChild;return r.firstChild,m(n,a(c,{get when(){return e.membershipAvailable},get children(){return a(X,{get id(){return e.id},get revision(){return e.membershipRevision},get onChange(){return e.onMembershipChange},hideJoin:!0})}}),r),m(r,a(c,{get when(){return e.forkedFrom},children:e=>(()=>{var t=ct();return t.firstChild,m(t,a(c,{get when(){return e().href},get fallback(){return e().label},children:t=>(()=>{var n=lt();return m(n,()=>e().label),u(()=>d(n,`href`,t())),n})()}),null),t})()}),null),m(r,a(c,{get when(){return s()},get children(){var n=rt(),r=n.firstChild;return n.$$click=l,m(n,a(B,{size:14}),r),m(r,()=>t()?`close comments`:`comments`),m(n,a(c,{get when(){return e.openAnnotations},get children(){var t=nt();return m(t,()=>e.openAnnotations),t}}),null),u(()=>d(n,`aria-pressed`,t())),n}}),null),m(r,a(c,{get when(){return o()},get children(){var t=it(),n=t.firstChild;return g(t,`click`,e.onEdit,!0),m(t,a(D,{size:14}),n),t}}),null),m(r,a(c,{get when(){return _(()=>!!e.pwaEnabled)()&&!e.archived},get children(){return a(G,{get id(){return e.id},class:ut})}}),null),m(r,a(c,{get when(){return _(()=>!!e.accountSession)()&&!e.archived},get children(){var t=at();return u(()=>d(t,`href`,`/schedules?artifact=${encodeURIComponent(e.id)}`)),t}}),null),m(r,a(Ee,{get id(){return e.id},get version(){return _(()=>!!e.archived)()?e.version:void 0}}),null),m(r,a(c,{get when(){return!e.hideFork},get children(){return a(le,{get id(){return e.id},get title(){return e.title}})}}),null),m(r,a(ke,{get id(){return e.id},get accountSession(){return e.accountSession},get initial(){return e.like}}),null),m(n,a(c,{get when(){return i()},get children(){var t=ot();return t.firstChild,m(t,a(tt,{get id(){return e.id}}),null),m(t,a(T,{get id(){return e.id},get title(){return e.title},owner:!0,variant:`menu`,get onOpen(){return e.onShare}}),null),m(t,a(c,{get when(){return e.onDeleted},get children(){return a(Ce,{get id(){return e.id},get title(){return e.title},get onDeleted(){return e.onDeleted}})}}),null),t}}),null),m(n,a(c,{get when(){return _(()=>!i())()&&o()},get children(){return a(T,{get id(){return e.id},get title(){return e.title},owner:!1,editable:!0,variant:`menu`,get onOpen(){return e.onShare}})}}),null),n})()}s([`click`]);var ft={selection:0,discussion:1,navigation:2,modal:4};function pt(e={}){let t=e.doc??document,n=t.createElement(`div`);n.setAttribute(`data-trusted-ui`,``),e.layer&&n.setAttribute(ee,e.layer),n.style.display=`contents`;let r=n.attachShadow({mode:`open`}),i=t.createElement(`style`);i.textContent=ie(),I.add(i);let a=t.createElement(`div`);a.setAttribute(`data-trusted-ui-root`,``);let o=t.createElement(`div`);o.style.display=`contents`;let s=t.createElement(`div`);s.style.display=`contents`,a.append(o,s),r.append(i,a),(e.parent??t.body).append(n);let c=()=>a.setAttribute(`data-theme`,t.documentElement.getAttribute(`data-theme`)===`dark`?`dark`:`light`);c();let l=new MutationObserver(c);l.observe(t.documentElement,{attributes:!0,attributeFilter:[`data-theme`]});let u=!!e.overlay&&typeof a.showPopover==`function`;u&&a.setAttribute(`popover`,`manual`);let d=()=>{if(!(!u||!a.isConnected||R.has(a)))try{N(a,ft[e.layer??`discussion`])}catch{}};return d(),{host:n,content:o,portal:s,show:d,dispose(){if(l.disconnect(),I.delete(i),R.delete(a),u)try{a.hidePopover()}catch{}n.remove()}}}function mt(e){let t=document.createElement(`div`);t.style.display=`contents`;let n=pt({parent:t,overlay:e.overlay,layer:e.layer});return v(()=>n.show()),i(()=>n.dispose()),[t,a(p,{get mount(){return n.content},get children(){return e.children}})]}function ht(t,n){e(()=>{let e=n();if(!t()||!e)return;let r=e.getRootNode(),a=r instanceof ShadowRoot?r.querySelector(`[data-trusted-ui-root]`):null,o=a?R.get(a):void 0;if(!a||o===void 0||typeof a.hidePopover!=`function`)return;let s=a.getRootNode().activeElement;a.hidePopover(),N(a,3),s instanceof HTMLElement&&s.focus({preventScroll:!0}),i(()=>{R.has(a)&&(a.hidePopover(),N(a,o))})})}function gt(e,t){let n=t??ge(e);n&&ne(e,n),e.location.reload()}var _t=h(`<svg viewBox="0 0 24 24"width=18 height=18 fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden=true>`),vt=h(`<span class="min-w-0 flex-1">`),Z=h(`<button type=button class="shrink-0 cursor-pointer rounded-full border border-edge bg-transparent px-2 py-0.5 font-mono text-[11px] text-muted hover:border-accent hover:text-accent">`),yt=h(`<a class="flex shrink-0 items-center gap-1.5 text-muted no-underline hover:text-accent">@`),bt=h(`<span class="min-w-0 truncate font-semibold text-fg"data-mx-document-title>`),xt=h(`<span class="shrink-0 truncate text-muted">`),Q=h(`<span>`),$=h(`<button type=button class="relative flex h-9 min-w-9 cursor-pointer items-center justify-center gap-1 rounded-[8px] border-0 bg-transparent px-1.5 font-mono text-xs text-muted no-underline transition-colors hover:bg-raised hover:text-fg">`),St=h(`<button type=button class="relative flex h-9 min-w-9 cursor-pointer items-center justify-center gap-1 rounded-[8px] border-0 bg-transparent px-1.5 font-mono text-xs text-muted no-underline transition-colors hover:bg-raised hover:text-fg"aria-label=Comment>`),Ct=h(`<button type=button class="relative flex h-9 min-w-9 cursor-pointer items-center justify-center gap-1 rounded-[8px] border-0 bg-transparent px-1.5 font-mono text-xs text-muted no-underline transition-colors hover:bg-raised hover:text-fg hidden sm:flex"aria-label="Fork artifact">`),wt=h(`<a class="relative flex h-9 min-w-9 cursor-pointer items-center justify-center gap-1 rounded-[8px] border-0 bg-transparent px-1.5 font-mono text-xs text-muted no-underline transition-colors hover:bg-raised hover:text-fg hidden sm:flex"aria-label="Install app">`),Tt=h(`<button type=button>`),Et=h(`<button type=button class="relative flex h-9 min-w-9 cursor-pointer items-center justify-center gap-1 rounded-[8px] border-0 bg-transparent px-1.5 font-mono text-xs text-muted no-underline transition-colors hover:bg-raised hover:text-fg border border-edge px-2.5"aria-label=Share><span class="hidden sm:inline">Share`),Dt=(e,t)=>`Version ${e} of ${t} · read-only`,Ot=`relative flex h-9 min-w-9 cursor-pointer items-center justify-center gap-1 rounded-[8px] border-0 bg-transparent px-1.5 font-mono text-xs text-muted no-underline transition-colors hover:bg-raised hover:text-fg`;function kt(e){let t=()=>C[w({visibility:e.visibility,hasInvitedUsers:e.invited})];return(()=>{var e=_t();return u(()=>e.innerHTML=t().map(([e,t])=>`<${e} ${Object.entries(t).filter(([e])=>e!==`key`).map(([e,t])=>`${e}="${t}"`).join(` `)}/>`).join(``)),e})()}function At(e){let[t,r]=n(e.like),[i,o]=n(e.follow??null),s=()=>e.editing?.()??!1,p=()=>!e.archived&&!s(),h=e=>window.location.assign(A(window.location,e)),g=async()=>{if(!e.signedIn()){h(`like`);return}let n=await J(`/api/my/artifacts/${encodeURIComponent(e.id)}/like`,t().liked,`like`);n&&r(n)},v=async()=>{let t=i();if(!t)return;if(!e.signedIn()){h(`follow`);return}let n=await J(`/api/users/${encodeURIComponent(t.userId)}/follow`,t.following,`follow`);n&&o({...t,following:n.following,count:n.count})},S=()=>e.author?.username??null,C=()=>e.membership===`joined`?`Joined — view people`:e.membership===`pending`?`Pending — view request`:`Join artifact`,w=[a(c,{get when(){return S()},children:t=>[a(j,{size:14,class:`shrink-0 text-faint`,"aria-hidden":`true`}),(()=>{var n=yt(),r=n.firstChild;return m(n,a(c,{get when(){return e.author?.id},children:n=>a(ae,{get image(){return e.author?.image??null},get initial(){return t()},get userId(){return n()},size:20})}),r),m(n,t,null),u(e=>{var r=`/@${t()}`,i=`View @${t()}'s profile`;return r!==e.e&&d(n,`href`,e.e=r),i!==e.t&&d(n,`aria-label`,e.t=i),e},{e:void 0,t:void 0}),n})(),a(c,{get when(){return i()},children:e=>(()=>{var n=Z();return n.$$click=()=>void v(),m(n,()=>e().following?`following`:`follow`),u(r=>{var i=`${e().following?`Unfollow`:`Follow`} @${t()}`,a=e().following;return i!==r.e&&d(n,`aria-label`,r.e=i),a!==r.t&&d(n,`aria-pressed`,r.t=a),r},{e:void 0,t:void 0}),n})()})]}),a(j,{size:14,class:`shrink-0 text-faint`,"aria-hidden":`true`}),a(c,{get when(){return e.titleSlot?.()},get fallback(){return(()=>{var t=bt();return m(t,()=>e.title()),t})()},get children(){var t=vt();return f(t=>e.titleHost?.(t),t),t}}),a(c,{get when(){return _(()=>!e.archived&&!s())()&&e.membership},get children(){var t=Z();return t.$$click=()=>e.onMembership(),m(t,(()=>{var t=_(()=>e.membership===`joined`);return()=>t()?`Joined`:e.membership===`pending`?`Pending`:`Join`})()),u(()=>d(t,`aria-label`,C())),t}}),a(c,{get when(){return e.archived},children:e=>(()=>{var t=xt();return m(t,()=>Dt(e().version,e().head)),u(n=>{var r=e().version,i=e().head;return r!==n.e&&d(t,`data-mx-archived-version`,n.e=r),i!==n.t&&d(t,`data-mx-archived-head`,n.t=i),n},{e:void 0,t:void 0}),t})()})],T=[a(c,{get when(){return p()},get children(){return[a(O,{get content(){return t().liked?`Unlike`:`Like`},get children(){var e=$();return e.$$click=()=>void g(),m(e,a(x,{size:18,"stroke-width":1.5,get fill(){return t().liked?`currentColor`:`none`}}),null),m(e,a(c,{get when(){return t().count>0},get children(){var e=Q();return m(e,()=>t().count),e}}),null),u(n=>{var r=t().liked?`Unlike`:`Like`,i=t().liked;return r!==n.e&&d(e,`aria-label`,n.e=r),i!==n.t&&d(e,`aria-pressed`,n.t=i),n},{e:void 0,t:void 0}),e}}),a(O,{content:`Comment`,get children(){var t=St();return t.$$click=()=>e.onComment(),m(t,a(de,{size:18,"stroke-width":1.5}),null),m(t,a(c,{get when(){return e.comments()>0},get children(){var t=Q();return m(t,()=>e.comments()),t}}),null),t}}),a(c,{get when(){return e.canFork},get children(){return a(O,{content:`Fork artifact`,get children(){var t=Ct();return t.$$click=()=>e.onFork(),m(t,a(b,{size:18,"stroke-width":1.5})),t}})}}),a(c,{get when(){return e.install},get children(){return a(O,{content:`Install app`,get children(){var t=wt();return m(t,a(y,{size:18,"stroke-width":1.5})),u(()=>d(t,`href`,`${W(e.id)}?install=1`)),t}})}})]}}),a(c,{get when(){return _(()=>!!e.canEdit)()&&!e.archived},get children(){return a(O,{get content(){return s()?`Done editing`:`Edit`},get children(){var t=Tt();return t.$$click=()=>e.onEdit(),m(t,a(D,{size:18,"stroke-width":1.5})),u(e=>{var n=`${Ot} ${s()?`text-accent`:``}`,r=s()?`Done editing`:`Edit`,i=s();return n!==e.e&&l(t,e.e=n),r!==e.t&&d(t,`aria-label`,e.t=r),i!==e.a&&d(t,`aria-pressed`,e.a=i),e},{e:void 0,t:void 0,a:void 0}),t}})}}),a(c,{get when(){return _(()=>!!e.owner)()&&!e.archived},get children(){return a(O,{content:`Share`,get children(){var t=Et(),n=t.firstChild;return t.$$click=()=>e.onShare(),m(t,a(kt,{get visibility(){return e.visibility??`private`},get invited(){return e.hasInvitedUsers??!1}}),n),t}})}})];return a(re,{label:`Artifact controls`,get title(){return e.title()},byline:w,actions:T,get controls(){return e.controls},get panel(){return e.panel},get setPanel(){return e.setPanel},get mode(){return e.mode},get onMode(){return e.onMode},get star(){return!s()}})}s([`click`]);export{dt as a,xe as c,W as d,U as f,ht as i,be as l,gt as n,X as o,B as p,mt as r,q as s,At as t,G as u};
|
|
1
|
+
import{D as e,I as t,M as n,N as r,R as i,T as a,_ as o,a as s,b as c,i as l,k as u,l as d,m as f,n as p,o as m,p as h,r as g,s as _,z as v}from"./web-Ckpee-ZJ.js";import{t as y}from"./download-Dk3mxCBK.js";import{t as b}from"./git-fork-CN41g1lF.js";import{n as x,t as S}from"./users-Bm0xpNrq.js";import{n as C,r as w,t as T}from"./DocumentSharing-BiTakFtn.js";import{v as E,y as D}from"./person-mentions-C7vQd7Vr.js";import{A as O,G as k,M as A,N as ee,U as j,Y as M,at as N,dt as P,ft as te,g as F,it as I,l as L,o as ne,ot as R,r as re,rt as ie,s as ae,ut as oe,v as se}from"./solid-app-BNcsMwv4.js";import{n as ce}from"./sign-in-required-7zEVbzx2.js";import{t as z}from"./ConfirmDialog-hdkXS1mg.js";import{t as le}from"./ForkArtifact-DXYU1-qL.js";var ue=[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]],de=e=>a(k,t(e,{iconNode:ue,name:`message-circle`})),fe=[[`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`}]],B=e=>a(k,t(e,{iconNode:fe,name:`message-square`})),V=[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]],pe=e=>a(k,t(e,{iconNode:V,name:`refresh-cw`}));function me(e,t,n=1/0){if(e.length===0)return null;let r=null,i=null;for(let a of e)if(!(a.top>t||a.top+Math.max(a.height,1)<=t)){if(a.height>n){(!i||a.height<i.height)&&(i=a);continue}if(!r){r=a;continue}(a.height<r.height||a.height===r.height&&a.top>r.top)&&(r=a)}if(!r){let r=e.filter(e=>e.top>=t&&e.height<=n).sort((e,t)=>e.top-t.top)[0];return r?{path:r.path,fraction:0}:i?{path:i.path,fraction:H((t-i.top)/Math.max(i.height,1))}:{path:e.reduce((e,t)=>t.top>e.top?t:e).path,fraction:1}}let a=(t-r.top)/Math.max(r.height,1);return{path:r.path,fraction:H(a)}}var H=e=>Number.isFinite(e)?Math.min(1,Math.max(0,e)):0,U=`data-mx-ast`;function he(e){let t=e.defaultView?.scrollY??0,n=[];for(let r of e.querySelectorAll(`[${U}]`)){let e=r.getAttribute(U);if(!e)continue;let i=r.getBoundingClientRect();(i.height!==0||i.width!==0)&&n.push({path:e,top:i.top+t,height:i.height})}return n}function ge(e){return me(he(e.document),e.scrollY,e.innerHeight)}var W=e=>`/a/${encodeURIComponent(e)}/app/`,_e=h(`<a target=_self aria-label="Install app">Install app`),ve=h(`<p>Open this artifact from your home screen or desktop. An internet connection is required.`),ye=h(`<p class=mt-3>On iPhone or iPad, open the Share menu and choose Add to Home Screen. In Chrome or Edge, use the browser menu’s Install app option. In Safari on Mac, choose File → Add to Dock.`);function G(e){let t=window.matchMedia?.(`(display-mode: standalone)`).matches||navigator.standalone;return a(c,{when:!t,get children(){var t=_e(),n=t.firstChild;return t.$$click=t=>{if(!e.beforeNavigate)return;t.preventDefault();let n=t.currentTarget.href;e.beforeNavigate().then(e=>{e&&window.location.assign(n)})},m(t,a(y,{size:14}),n),u(n=>{var r=`${W(e.id)}?install=1`,i=e.class;return r!==n.e&&d(t,`href`,n.e=r),i!==n.t&&l(t,n.t=i),n},{e:void 0,t:void 0}),t}})}function be(e){let[t,r]=n(window.location.pathname===W(e.id)&&new URLSearchParams(window.location.search).has(`install`)),[o,s]=n(P()),[l,u]=n(null),[d,f]=n(!1);i(te(()=>s(P())));let p=()=>o()?.path===W(e.id),m=()=>{r(!1);let e=new URL(window.location.href);e.searchParams.delete(`install`),window.history.replaceState(window.history.state,``,e)},h=()=>{if(!p()){m();return}let e=oe();if(e){f(!0);try{e.prompt().then(m,()=>u(`The install prompt could not open. Use your browser’s install option.`)).finally(()=>f(!1))}catch{f(!1),u(`The install prompt could not open. Use your browser’s install option.`)}}};return a(c,{get when(){return t()},get children(){return a(z,{get title(){return`Install ${e.title}`},get action(){return p()?`Install app`:`Done`},get busy(){return d()},get error(){return l()},onCancel:m,onConfirm:h,get description(){return[ve(),a(c,{get when(){return!p()},get children(){return ye()}})]}})}})}s([`click`]);var K=`data-mx-view-reported`,q=(e,t)=>e.body.getAttribute(K)===t;function xe(e,t){if(!t||q(e.document,t))return;let n=()=>{q(e.document,t)||(e.document.body.setAttribute(K,t),e.fetch(`/api/page/artifact/${encodeURIComponent(t)}/view`,{method:`POST`,credentials:`same-origin`,keepalive:!0}).catch(()=>{}))};e.document.prerendering?e.document.addEventListener(`prerenderingchange`,n,{once:!0}):n()}var Se=h(`<button type=button class="flex w-full items-center gap-2 rounded px-2 py-2 text-left font-mono text-xs text-danger hover:bg-raised">delete`);function Ce(e){let[t,r]=n(!1),[i,o]=n(!1),[s,l]=n(null),f=async()=>{if(!i()){o(!0),l(null);try{let t=await fetch(`/api/my/artifacts/${encodeURIComponent(e.id)}`,{method:`DELETE`});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`Could not move this artifact to trash. Try again.`)}M(),e.onDeleted(),r(!1)}catch(e){l(e instanceof Error?e.message:`Could not move this artifact to trash. Try again.`)}finally{o(!1)}}};return[(()=>{var t=Se(),n=t.firstChild;return t.$$click=()=>r(!0),m(t,a(E,{size:14}),n),u(()=>d(t,`aria-label`,`Delete ${e.title}`)),t})(),a(c,{get when(){return t()},get children(){return a(z,{get title(){return`Delete “${e.title}”?`},get description(){return`Delete "${e.title}"? The link stops working. It goes to the trash, where you can restore it any time.`},action:`Move to trash`,confirmLabel:`Confirm delete`,cancelLabel:`Cancel delete`,danger:!0,get busy(){return i()},get error(){return s()},onConfirm:()=>void f(),onCancel:()=>r(!1)})}})]}s([`click`]);var we=h(`<a download aria-label="Download for offline"class="flex w-full items-center gap-2 rounded px-2 py-2 font-mono text-xs text-muted hover:bg-raised">`),Te=h(`<p role=alert class="text-xs text-danger">`);function Ee(e){let[t,r]=n(!1),[i,o]=n(``),s=()=>`/a/${encodeURIComponent(e.id)}/download${e.version===void 0?``:`?version=${e.version}`}`,l=async e=>{if(e.preventDefault(),!t()){r(!0),o(``);try{let e=await fetch(s(),{credentials:`same-origin`});if(!e.ok){let t=await e.json().catch(()=>null);o(t?.message??`The offline file could not be made (HTTP ${e.status}).`);return}let t=URL.createObjectURL(await e.blob()),n=document.createElement(`a`);n.href=t;let r=e.headers.get(`Content-Disposition`),i=r?.match(/filename\*=UTF-8''([^;]+)/i)?.[1];try{n.download=i?decodeURIComponent(i.trim()):r?.match(/filename="([^"]+)"/i)?.[1]??`artifact.html`}catch{n.download=`artifact.html`}document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(t),0)}catch{o(`The offline file could not be downloaded. Check the connection and try again.`)}finally{r(!1)}}};return[a(O,{content:`One HTML file you can open, edit and comment on without a connection.`,get children(){var e=we();return e.$$click=e=>void l(e),m(e,a(y,{size:14}),null),m(e,()=>t()?`preparing file…`:`download for offline`,null),u(n=>{var r=s(),i=t()?`true`:void 0;return r!==n.e&&d(e,`href`,n.e=r),i!==n.t&&d(e,`aria-busy`,n.t=i),n},{e:void 0,t:void 0}),e}}),a(c,{get when(){return i()},get children(){var e=Te();return m(e,i),e}})]}s([`click`]);var De=e=>window.location.assign(e);async function J(e,t,n,r=De){try{let i=await L(e,t?`DELETE`:`POST`);if(await ce(i))return r(A(window.location,n)),null;if(!i.ok)return null;let a=await i.json();return M(),a}catch{return null}}var Oe=h(`<button type=button class="inline-flex items-center gap-1 rounded px-2 py-1 text-sm text-muted hover:text-accent">`);function ke(e){let[t,r]=n(e.initial),[i,o]=n(!1),s=t=>(e.navigate??(e=>location.assign(e)))(t),c=async()=>{if(!e.accountSession){s(A(location,`like`));return}if(i())return;o(!0);let n=await J(`/api/my/artifacts/${encodeURIComponent(e.id)}/like`,t().liked,`like`,s);o(!1),n&&(r(n),e.onChange?.(n))};return a(O,{get content(){return t().liked?`unlike`:`like`},get children(){var e=Oe();return e.$$click=()=>void c(),m(e,a(x,{size:14,get fill(){return t().liked?`currentColor`:`none`}}),null),m(e,()=>t().count,null),u(n=>{var r=t().liked?`Unlike artifact`:`Like artifact`,a=t().liked,o=i();return r!==n.e&&d(e,`aria-label`,n.e=r),a!==n.t&&d(e,`aria-pressed`,n.t=a),o!==n.a&&(e.disabled=n.a=o),n},{e:void 0,t:void 0,a:void 0}),e}})}s([`click`]);var Y=new Map;function Ae(e,t,n={}){let r=Y.get(e)??{at:0};if(Y.set(e,r),r.inflight)return r.inflight;if(!n.force&&r.at&&Date.now()-r.at<(n.ttl??0))return Promise.resolve(r.value);let i=t().then(e=>(r.value=e,r.at=Date.now(),e)).finally(()=>{r.inflight===i&&(r.inflight=void 0)});return r.inflight=i,i}function je(e,t){let n=Y.get(e)??{at:0};n.value=t,n.at=Date.now(),Y.set(e,n)}var Me=h(`<span class="text-xs text-accent">Joined`),Ne=h(`<span class="ml-auto text-xs text-muted">`),Pe=h(`<p role=alert class="text-xs text-danger">`),Fe=h(`<p role=status>Loading people…`),Ie=h(`<div class="space-y-4 rounded-xl border border-edge bg-surface p-4"><div><h3 class=font-medium>People in this artifact</h3><p class="text-xs leading-5 text-muted">Comment access does not depend on joining.`),Le=h(`<section aria-label="artifact people"class=space-y-3><button type=button aria-label=People class="flex w-full items-center gap-2 rounded-md px-2 py-2 text-sm hover:bg-raised"><span>People`),Re=h(`<div class="flex items-center justify-between gap-2"><span class="text-xs text-accent">`),ze=h(`<ul class="divide-y divide-edge">`),Be=h(`<label class="flex items-center gap-2 text-xs"><input type=checkbox>Include viewing access`),Ve=h(`<div class="space-y-2 border-t border-edge pt-4"><p class="text-xs leading-5 text-muted">Find anyone by username. Invitations wait for acceptance unless they follow you.</p><div class="flex flex-wrap gap-1"></div><p class="text-xs leading-5 text-muted">Followers join immediately unless they’ve turned off automatic acceptance. Others see a pending invitation.`),He=h(`<div class="space-y-2 rounded-lg bg-raised p-3"><p class=text-xs></p><div class="flex gap-2">`),Ue=h(`<li class="flex items-center gap-3 py-2.5"><span class="flex h-7 w-7 items-center justify-center rounded-full bg-accent-soft text-xs text-accent"></span><span class="min-w-0 truncate text-sm"></span><span class="ml-auto text-xs text-muted">Member`),We=h(`<div class="space-y-2 rounded-lg border border-edge p-3"><p class=text-xs>@<!> · </p><div class="flex gap-2">`),Ge=h(`<button type=button class="rounded-full bg-accent-soft px-2 py-1 text-xs text-accent">@<!> ×`),Ke=h(`<p role=status class="px-3 py-2 text-xs text-muted">`),qe=h(`<div class="absolute left-0 right-0 top-full z-40 mt-1 overflow-hidden rounded-md border border-edge bg-surface shadow-lg"><ul role=listbox aria-label="People suggestions"class="max-h-48 overflow-y-auto p-1">`),Je=h(`<div class=relative><label class="grid gap-2 text-xs font-medium">Add people`),Ye=h(`<li role=presentation><button type=button role=option tabindex=-1>@<!> <span class="ml-2 text-xs text-muted">`);function X(t){let[r,s]=n(!!t.initialOpen),[l,f]=n(null),[p,h]=n(``),[g,v]=n(!1),[y,b]=n([]),[x,C]=n(!1),w=()=>`/api/my/artifacts/${encodeURIComponent(t.id)}/members`,T=()=>`members:${t.id}`,E=t.revision;e(()=>{r();let e=t.revision!==E;E=t.revision;let n=!0;i(()=>{n=!1}),Ae(T(),async()=>{let e=await fetch(w()),t=await e.json();if(!e.ok||!Array.isArray(t.members)||!Array.isArray(t.pending))throw Error(t.detail??`Could not load people`);return t},{ttl:3e4,force:e}).then(e=>{n&&(f(e),h(``))}).catch(e=>{n&&h(e instanceof Error?e.message:`Could not load people`)})});let D=async e=>{if(!g()){v(!0),h(``);try{let n=await L(w(),`POST`,e),r=await n.json();if(!n.ok||!Array.isArray(r.members)||!Array.isArray(r.pending))throw Error(r.detail??`Could not update people`);f(r),je(T(),r),t.onChange?.(),e.action===`invite`&&b([])}catch(e){h(e instanceof Error?e.message:`Could not update people`)}finally{v(!1)}}},O=()=>l()?.self;return(()=>{var e=Le(),n=e.firstChild,i=n.firstChild;return n.$$click=()=>s(e=>!e),m(n,a(S,{size:16}),i),m(n,a(c,{get when(){return _(()=>O()?.status===`accepted`)()&&O()?.explicit_join},get children(){return Me()}}),null),m(n,a(c,{get when(){return l()},get children(){var e=Ne();return m(e,()=>l().members.length),e}}),null),m(e,a(c,{get when(){return r()},get children(){var e=Ie();return e.firstChild,m(e,a(c,{get when(){return p()},get children(){var e=Pe();return m(e,p),e}}),null),m(e,a(c,{get when(){return _(()=>!l())()&&!p()},get children(){return Fe()}}),null),m(e,a(c,{get when(){return l()},children:e=>[a(c,{get when(){return O()?.status===`accepted`},get fallback(){return a(c,{get when(){return O()?.status===`pending`},get fallback(){return a(c,{get when(){return!t.hideJoin},get children(){return a(F,{get disabled(){return g()},onClick:()=>void D({action:`join`}),get children(){return e().canManage?`Join artifact`:`Request to join`}})}})},get children(){var t=He(),n=t.firstChild,r=n.nextSibling;return m(n,()=>O()?.direction===`request`?`Waiting for an owner or editor to approve.`:`You’ve been invited to join.`),m(r,a(c,{get when(){return O()?.direction===`invitation`||e().canManage},get children(){return a(F,{get disabled(){return g()},onClick:()=>void D({action:e().canManage&&O()?.direction===`request`?`join`:`accept`}),get children(){return e().canManage&&O()?.direction===`request`?`Join artifact`:`Accept invitation`}})}}),null),m(r,a(F,{variant:`ghost`,get disabled(){return g()},onClick:()=>void D({action:`dismiss`}),get children(){return O()?.direction===`request`?`Withdraw request`:`Decline`}}),null),t}})},get children(){var e=Re(),t=e.firstChild;return m(t,()=>O()?.explicit_join?`You’re a member`:`Invitation automatically accepted`),m(e,a(c,{get when(){return!O()?.explicit_join},get children(){return a(F,{get disabled(){return g()},onClick:()=>void D({action:`join`}),children:`Join artifact`})}}),null),m(e,a(F,{variant:`ghost`,get disabled(){return g()},onClick:()=>void D({action:`leave`}),children:`Leave`}),null),e}}),(()=>{var t=ze();return m(t,a(o,{get each(){return e().members},children:e=>(()=>{var t=Ue(),n=t.firstChild,r=n.nextSibling;return m(n,()=>(e.name??e.username??`?`).slice(0,1).toUpperCase()),m(r,(()=>{var t=_(()=>!!e.username);return()=>t()?`@${e.username}`:e.name??e.user_id})()),t})()})),t})(),a(c,{get when(){return e().canManage},get children(){return a(o,{get each(){return e().pending.filter(e=>e.user_id!==O()?.user_id)},children:e=>(()=>{var t=We(),n=t.firstChild,r=n.firstChild.nextSibling;r.nextSibling;var i=n.nextSibling;return m(n,()=>e.username??e.user_id,r),m(n,()=>e.direction===`invitation`?`Invitation pending`:`Wants to join`,null),m(i,a(c,{get when(){return e.direction===`request`},get children(){return a(F,{get disabled(){return g()},onClick:()=>void D({action:`approve`,userId:e.user_id}),get children(){return[`Approve @`,_(()=>e.username??e.user_id)]}})}}),null),m(i,a(F,{variant:`ghost`,get disabled(){return g()},onClick:()=>void D({action:`dismiss`,userId:e.user_id}),children:`Dismiss`}),null),t})()})}}),a(c,{get when(){return e().canInvite},get children(){var t=Ve(),n=t.firstChild,r=n.nextSibling,i=r.nextSibling;return m(t,a(Xe,{get endpoint(){return w()},get selected(){return y()},onSelect:e=>b(t=>[...t,e])}),n),m(r,a(o,{get each(){return y()},children:e=>(()=>{var t=Ge(),n=t.firstChild.nextSibling;return n.nextSibling,t.$$click=()=>b(t=>t.filter(t=>t.user_id!==e.user_id)),m(t,()=>e.username,n),u(()=>d(t,`aria-label`,`Remove @${e.username}`)),t})()})),m(t,a(c,{get when(){return e().canManage},get children(){var e=Be(),t=e.firstChild;return t.addEventListener(`change`,e=>C(e.currentTarget.checked)),u(()=>t.checked=x()),e}}),i),m(t,a(F,{get disabled(){return g()||y().length===0},onClick:()=>void D({action:`invite`,usernames:y().map(e=>`@${e.username}`),includeAccess:x()}),get children(){return[`Invite`,_(()=>_(()=>!!y().length)()?` ${y().length} people`:``)]}}),i),t}})]}),null),e}}),null),u(()=>d(n,`aria-expanded`,r())),e})()}function Xe(t){let s=r(),[f,p]=n(``),[h,g]=n(!1),[v,y]=n([]),[b,x]=n(-1),[S,C]=n(!1),[w,T]=n(``),E=()=>v().filter(e=>!t.selected.some(t=>t.user_id===e.user_id));e(()=>{if(!h())return;let e=new AbortController;C(!0),T(``),y([]),x(-1),fetch(`${t.endpoint}?purpose=invite&query=${encodeURIComponent(f())}`,{signal:e.signal}).then(async t=>{if(!t.ok)throw Error(`Could not find people. Try again.`);let n=await t.json();e.signal.aborted||y(n.people??[])}).catch(()=>{e.signal.aborted||T(`Could not find people. Try again.`)}).finally(()=>{e.signal.aborted||C(!1)}),i(()=>e.abort())});let D=e=>{t.onSelect(e),p(``),g(!1),x(-1)};return(()=>{var e=Je(),t=e.firstChild;return t.firstChild,e.$$focusout=e=>{e.currentTarget.contains(e.relatedTarget)||g(!1)},m(t,a(se,{role:`combobox`,"aria-label":`Find people by username`,"aria-autocomplete":`list`,get"aria-expanded"(){return h()},get"aria-controls"(){return h()?s:void 0},get"aria-activedescendant"(){return _(()=>!!(h()&&E()[b()]))()?`${s}-${b()}`:void 0},get value(){return f()},placeholder:`@username`,autocomplete:`off`,onFocus:()=>g(!0),onClick:()=>g(!0),onInput:e=>{p(e.currentTarget.value),g(!0),x(-1)},onKeyDown:e=>{let t=E();e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),g(!1)):e.key===`ArrowDown`||e.key===`ArrowUp`?(e.preventDefault(),g(!0),x(n=>t.length?n<0?e.key===`ArrowDown`?0:t.length-1:(n+(e.key===`ArrowDown`?1:t.length-1))%t.length:-1)):e.key===`Enter`&&h()&&t[b()]&&(e.preventDefault(),D(t[b()]))}}),null),m(e,a(c,{get when(){return h()},get children(){var e=qe(),t=e.firstChild;return d(t,`id`,s),m(t,a(o,{get each(){return E()},children:(e,t)=>(()=>{var n=Ye(),r=n.firstChild,i=r.firstChild.nextSibling,a=i.nextSibling.nextSibling;return r.$$click=()=>D(e),r.$$mousedown=e=>e.preventDefault(),m(r,()=>e.username,i),m(a,()=>e.name),u(e=>{var n=`${s}-${t()}`,i=b()===t(),a=`w-full rounded px-3 py-2 text-left text-sm hover:bg-raised ${b()===t()?`bg-raised`:``}`;return n!==e.e&&d(r,`id`,e.e=n),i!==e.t&&d(r,`aria-selected`,e.t=i),a!==e.a&&l(r,e.a=a),e},{e:void 0,t:void 0,a:void 0}),n})()})),m(e,a(c,{get when(){return S()||w()||E().length===0},get children(){var e=Ke();return m(e,(()=>{var e=_(()=>!!S());return()=>e()?`Finding people…`:w()||`No people found.`})()),e}}),null),e}}),null),e})()}s([`click`,`focusout`,`mousedown`]);var Ze=h(`<button type=button aria-label="Refresh external images"class="flex w-full items-center gap-2 rounded px-2 py-2 text-left font-mono text-xs text-muted hover:bg-raised disabled:opacity-60">`),Qe=h(`<div role=status aria-label="Refresh result"class="mt-1 rounded border border-edge bg-raised px-2 py-2 text-xs text-muted">`),$e=h(`<p class=break-all>`);function et(e,t){if(t===429)return[`too many web imports this hour — try again later`];if(t!==200)return[e.error??`could not refresh (${t})`];let n=[];e.refreshed?.length?n.push(`${e.refreshed.length} refreshed`):e.unchanged?.length?n.push(`already up to date`):e.failed?.length||n.push(`this document names no external images`);for(let t of e.failed??[])n.push(`${t.url} — ${t.fix}`);return n}function tt(e){let[t,r]=n(!1),[s,l]=n(null),d=!1,f=!0;i(()=>{f=!1});let p=()=>{d||(d=!0,r(!0),l(null),(async()=>{try{let t=await fetch(`/api/my/artifacts/${encodeURIComponent(e.id)}/assets/refresh`,{method:`POST`,credentials:`same-origin`}),n=await t.json().catch(()=>({}));f&&l(et(n,t.status))}catch{f&&l([`could not refresh — try again`])}finally{d=!1,f&&r(!1)}})())};return[(()=>{var e=Ze();return e.$$click=p,m(e,a(pe,{size:14}),null),m(e,()=>t()?`refreshing…`:`refresh external images`,null),u(()=>e.disabled=t()),e})(),a(c,{get when(){return s()},children:e=>(()=>{var t=Qe();return m(t,a(o,{get each(){return e()},children:e=>(()=>{var t=$e();return m(t,e),t})()})),t})()})]}s([`click`]);var nt=h(`<span>`),rt=h(`<button type=button aria-label="Toggle comments"class="flex w-full items-center gap-2 rounded-[5px] border-0 bg-transparent px-2 py-2 text-left font-mono text-xs text-muted hover:bg-raised hover:text-fg"><span class=flex-1>`),it=h(`<button type=button aria-label="Edit artifact"class="flex w-full items-center gap-2 rounded-[5px] border-0 bg-transparent px-2 py-2 text-left font-mono text-xs text-muted hover:bg-raised hover:text-fg">edit artifact`),at=h(`<a class="flex w-full items-center gap-2 rounded-[5px] border-0 bg-transparent px-2 py-2 text-left font-mono text-xs text-muted hover:bg-raised hover:text-fg">Schedule artifact`),ot=h(`<section aria-label="Owner actions"class=space-y-1><h2 class="px-2 font-mono text-[10px] font-semibold uppercase tracking-[0.14em] text-faint">owner`),st=h(`<div class=space-y-4 aria-label="Document actions"><section aria-label="Document actions"class=space-y-1><h2 class="px-2 font-mono text-[10px] font-semibold uppercase tracking-[0.14em] text-faint">Artifact`),ct=h(`<p data-mx-forked-from class="px-2 py-2 font-mono text-xs text-muted">forked from `),lt=h(`<a aria-label="Open the artifact this was forked from"class=underline>`),ut=`flex w-full items-center gap-2 rounded-[5px] border-0 bg-transparent px-2 py-2 text-left font-mono text-xs text-muted hover:bg-raised hover:text-fg`;function dt(e){let[t,r]=n(e.commentsOpen??!1),i=()=>e.owner&&!e.archived,o=()=>e.canEdit&&!e.archived,s=()=>e.canAnnotate&&!e.archived,l=()=>{let n=!t();r(n),e.onCommentsChange(n)};return(()=>{var n=st(),r=n.firstChild;return r.firstChild,m(n,a(c,{get when(){return e.membershipAvailable},get children(){return a(X,{get id(){return e.id},get revision(){return e.membershipRevision},get onChange(){return e.onMembershipChange},hideJoin:!0})}}),r),m(r,a(c,{get when(){return e.forkedFrom},children:e=>(()=>{var t=ct();return t.firstChild,m(t,a(c,{get when(){return e().href},get fallback(){return e().label},children:t=>(()=>{var n=lt();return m(n,()=>e().label),u(()=>d(n,`href`,t())),n})()}),null),t})()}),null),m(r,a(c,{get when(){return s()},get children(){var n=rt(),r=n.firstChild;return n.$$click=l,m(n,a(B,{size:14}),r),m(r,()=>t()?`close comments`:`comments`),m(n,a(c,{get when(){return e.openAnnotations},get children(){var t=nt();return m(t,()=>e.openAnnotations),t}}),null),u(()=>d(n,`aria-pressed`,t())),n}}),null),m(r,a(c,{get when(){return o()},get children(){var t=it(),n=t.firstChild;return g(t,`click`,e.onEdit,!0),m(t,a(D,{size:14}),n),t}}),null),m(r,a(c,{get when(){return _(()=>!!e.pwaEnabled)()&&!e.archived},get children(){return a(G,{get id(){return e.id},class:ut})}}),null),m(r,a(c,{get when(){return _(()=>!!e.accountSession)()&&!e.archived},get children(){var t=at();return u(()=>d(t,`href`,`/schedules?artifact=${encodeURIComponent(e.id)}`)),t}}),null),m(r,a(Ee,{get id(){return e.id},get version(){return _(()=>!!e.archived)()?e.version:void 0}}),null),m(r,a(c,{get when(){return!e.hideFork},get children(){return a(le,{get id(){return e.id},get title(){return e.title}})}}),null),m(r,a(ke,{get id(){return e.id},get accountSession(){return e.accountSession},get initial(){return e.like}}),null),m(n,a(c,{get when(){return i()},get children(){var t=ot();return t.firstChild,m(t,a(tt,{get id(){return e.id}}),null),m(t,a(T,{get id(){return e.id},get title(){return e.title},owner:!0,variant:`menu`,get onOpen(){return e.onShare}}),null),m(t,a(c,{get when(){return e.onDeleted},get children(){return a(Ce,{get id(){return e.id},get title(){return e.title},get onDeleted(){return e.onDeleted}})}}),null),t}}),null),m(n,a(c,{get when(){return _(()=>!i())()&&o()},get children(){return a(T,{get id(){return e.id},get title(){return e.title},owner:!1,editable:!0,variant:`menu`,get onOpen(){return e.onShare}})}}),null),n})()}s([`click`]);var ft={selection:0,discussion:1,navigation:2,modal:4};function pt(e={}){let t=e.doc??document,n=t.createElement(`div`);n.setAttribute(`data-trusted-ui`,``),e.layer&&n.setAttribute(ee,e.layer),n.style.display=`contents`;let r=n.attachShadow({mode:`open`}),i=t.createElement(`style`);i.textContent=ie(),I.add(i);let a=t.createElement(`div`);a.setAttribute(`data-trusted-ui-root`,``);let o=t.createElement(`div`);o.style.display=`contents`;let s=t.createElement(`div`);s.style.display=`contents`,a.append(o,s),r.append(i,a),(e.parent??t.body).append(n);let c=()=>a.setAttribute(`data-theme`,t.documentElement.getAttribute(`data-theme`)===`dark`?`dark`:`light`);c();let l=new MutationObserver(c);l.observe(t.documentElement,{attributes:!0,attributeFilter:[`data-theme`]});let u=!!e.overlay&&typeof a.showPopover==`function`;u&&a.setAttribute(`popover`,`manual`);let d=()=>{if(!(!u||!a.isConnected||R.has(a)))try{N(a,ft[e.layer??`discussion`])}catch{}};return d(),{host:n,content:o,portal:s,show:d,dispose(){if(l.disconnect(),I.delete(i),R.delete(a),u)try{a.hidePopover()}catch{}n.remove()}}}function mt(e){let t=document.createElement(`div`);t.style.display=`contents`;let n=pt({parent:t,overlay:e.overlay,layer:e.layer});return v(()=>n.show()),i(()=>n.dispose()),[t,a(p,{get mount(){return n.content},get children(){return e.children}})]}function ht(t,n){e(()=>{let e=n();if(!t()||!e)return;let r=e.getRootNode(),a=r instanceof ShadowRoot?r.querySelector(`[data-trusted-ui-root]`):null,o=a?R.get(a):void 0;if(!a||o===void 0||typeof a.hidePopover!=`function`)return;let s=a.getRootNode().activeElement;a.hidePopover(),N(a,3),s instanceof HTMLElement&&s.focus({preventScroll:!0}),i(()=>{R.has(a)&&(a.hidePopover(),N(a,o))})})}function gt(e,t){let n=t??ge(e);n&&ne(e,n),e.location.reload()}var _t=h(`<svg viewBox="0 0 24 24"width=18 height=18 fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden=true>`),vt=h(`<span class="min-w-0 flex-1">`),Z=h(`<button type=button class="shrink-0 cursor-pointer rounded-full border border-edge bg-transparent px-2 py-0.5 font-mono text-[11px] text-muted hover:border-accent hover:text-accent">`),yt=h(`<a class="flex shrink-0 items-center gap-1.5 text-muted no-underline hover:text-accent">@`),bt=h(`<span class="min-w-0 truncate font-semibold text-fg"data-mx-document-title>`),xt=h(`<span class="shrink-0 truncate text-muted">`),Q=h(`<span>`),$=h(`<button type=button class="relative flex h-9 min-w-9 cursor-pointer items-center justify-center gap-1 rounded-[8px] border-0 bg-transparent px-1.5 font-mono text-xs text-muted no-underline transition-colors hover:bg-raised hover:text-fg">`),St=h(`<button type=button class="relative flex h-9 min-w-9 cursor-pointer items-center justify-center gap-1 rounded-[8px] border-0 bg-transparent px-1.5 font-mono text-xs text-muted no-underline transition-colors hover:bg-raised hover:text-fg"aria-label=Comment>`),Ct=h(`<button type=button class="relative flex h-9 min-w-9 cursor-pointer items-center justify-center gap-1 rounded-[8px] border-0 bg-transparent px-1.5 font-mono text-xs text-muted no-underline transition-colors hover:bg-raised hover:text-fg hidden sm:flex"aria-label="Fork artifact">`),wt=h(`<a class="relative flex h-9 min-w-9 cursor-pointer items-center justify-center gap-1 rounded-[8px] border-0 bg-transparent px-1.5 font-mono text-xs text-muted no-underline transition-colors hover:bg-raised hover:text-fg hidden sm:flex"aria-label="Install app">`),Tt=h(`<button type=button>`),Et=h(`<button type=button class="relative flex h-9 min-w-9 cursor-pointer items-center justify-center gap-1 rounded-[8px] border-0 bg-transparent px-1.5 font-mono text-xs text-muted no-underline transition-colors hover:bg-raised hover:text-fg border border-edge px-2.5"aria-label=Share><span class="hidden sm:inline">Share`),Dt=(e,t)=>`Version ${e} of ${t} · read-only`,Ot=`relative flex h-9 min-w-9 cursor-pointer items-center justify-center gap-1 rounded-[8px] border-0 bg-transparent px-1.5 font-mono text-xs text-muted no-underline transition-colors hover:bg-raised hover:text-fg`;function kt(e){let t=()=>C[w({visibility:e.visibility,hasInvitedUsers:e.invited})];return(()=>{var e=_t();return u(()=>e.innerHTML=t().map(([e,t])=>`<${e} ${Object.entries(t).filter(([e])=>e!==`key`).map(([e,t])=>`${e}="${t}"`).join(` `)}/>`).join(``)),e})()}function At(e){let[t,r]=n(e.like),[i,o]=n(e.follow??null),s=()=>e.editing?.()??!1,p=()=>!e.archived&&!s(),h=e=>window.location.assign(A(window.location,e)),g=async()=>{if(!e.signedIn()){h(`like`);return}let n=await J(`/api/my/artifacts/${encodeURIComponent(e.id)}/like`,t().liked,`like`);n&&r(n)},v=async()=>{let t=i();if(!t)return;if(!e.signedIn()){h(`follow`);return}let n=await J(`/api/users/${encodeURIComponent(t.userId)}/follow`,t.following,`follow`);n&&o({...t,following:n.following,count:n.count})},S=()=>e.author?.username??null,C=()=>e.membership===`joined`?`Joined — view people`:e.membership===`pending`?`Pending — view request`:`Join artifact`,w=[a(c,{get when(){return S()},children:t=>[a(j,{size:14,class:`shrink-0 text-faint`,"aria-hidden":`true`}),(()=>{var n=yt(),r=n.firstChild;return m(n,a(c,{get when(){return e.author?.id},children:n=>a(ae,{get image(){return e.author?.image??null},get initial(){return t()},get userId(){return n()},size:20})}),r),m(n,t,null),u(e=>{var r=`/@${t()}`,i=`View @${t()}'s profile`;return r!==e.e&&d(n,`href`,e.e=r),i!==e.t&&d(n,`aria-label`,e.t=i),e},{e:void 0,t:void 0}),n})(),a(c,{get when(){return i()},children:e=>(()=>{var n=Z();return n.$$click=()=>void v(),m(n,()=>e().following?`following`:`follow`),u(r=>{var i=`${e().following?`Unfollow`:`Follow`} @${t()}`,a=e().following;return i!==r.e&&d(n,`aria-label`,r.e=i),a!==r.t&&d(n,`aria-pressed`,r.t=a),r},{e:void 0,t:void 0}),n})()})]}),a(j,{size:14,class:`shrink-0 text-faint`,"aria-hidden":`true`}),a(c,{get when(){return e.titleSlot?.()},get fallback(){return(()=>{var t=bt();return m(t,()=>e.title()),t})()},get children(){var t=vt();return f(t=>e.titleHost?.(t),t),t}}),a(c,{get when(){return _(()=>!e.archived&&!s())()&&e.membership},get children(){var t=Z();return t.$$click=()=>e.onMembership(),m(t,(()=>{var t=_(()=>e.membership===`joined`);return()=>t()?`Joined`:e.membership===`pending`?`Pending`:`Join`})()),u(()=>d(t,`aria-label`,C())),t}}),a(c,{get when(){return e.archived},children:e=>(()=>{var t=xt();return m(t,()=>Dt(e().version,e().head)),u(n=>{var r=e().version,i=e().head;return r!==n.e&&d(t,`data-mx-archived-version`,n.e=r),i!==n.t&&d(t,`data-mx-archived-head`,n.t=i),n},{e:void 0,t:void 0}),t})()})],T=[a(c,{get when(){return p()},get children(){return[a(O,{get content(){return t().liked?`Unlike`:`Like`},get children(){var e=$();return e.$$click=()=>void g(),m(e,a(x,{size:18,"stroke-width":1.5,get fill(){return t().liked?`currentColor`:`none`}}),null),m(e,a(c,{get when(){return t().count>0},get children(){var e=Q();return m(e,()=>t().count),e}}),null),u(n=>{var r=t().liked?`Unlike`:`Like`,i=t().liked;return r!==n.e&&d(e,`aria-label`,n.e=r),i!==n.t&&d(e,`aria-pressed`,n.t=i),n},{e:void 0,t:void 0}),e}}),a(O,{content:`Comment`,get children(){var t=St();return t.$$click=()=>e.onComment(),m(t,a(de,{size:18,"stroke-width":1.5}),null),m(t,a(c,{get when(){return e.comments()>0},get children(){var t=Q();return m(t,()=>e.comments()),t}}),null),t}}),a(c,{get when(){return e.canFork},get children(){return a(O,{content:`Fork artifact`,get children(){var t=Ct();return t.$$click=()=>e.onFork(),m(t,a(b,{size:18,"stroke-width":1.5})),t}})}}),a(c,{get when(){return e.install},get children(){return a(O,{content:`Install app`,get children(){var t=wt();return m(t,a(y,{size:18,"stroke-width":1.5})),u(()=>d(t,`href`,`${W(e.id)}?install=1`)),t}})}})]}}),a(c,{get when(){return _(()=>!!e.canEdit)()&&!e.archived},get children(){return a(O,{get content(){return s()?`Done editing`:`Edit`},get children(){var t=Tt();return t.$$click=()=>e.onEdit(),m(t,a(D,{size:18,"stroke-width":1.5})),u(e=>{var n=`${Ot} ${s()?`text-accent`:``}`,r=s()?`Done editing`:`Edit`,i=s();return n!==e.e&&l(t,e.e=n),r!==e.t&&d(t,`aria-label`,e.t=r),i!==e.a&&d(t,`aria-pressed`,e.a=i),e},{e:void 0,t:void 0,a:void 0}),t}})}}),a(c,{get when(){return _(()=>!!e.owner)()&&!e.archived},get children(){return a(O,{content:`Share`,get children(){var t=Et(),n=t.firstChild;return t.$$click=()=>e.onShare(),m(t,a(kt,{get visibility(){return e.visibility??`private`},get invited(){return e.hasInvitedUsers??!1}}),n),t}})}})];return a(re,{label:`Artifact controls`,get title(){return e.title()},byline:w,actions:T,get controls(){return e.controls},get panel(){return e.panel},get setPanel(){return e.setPanel},get mode(){return e.mode},get onMode(){return e.onMode},get star(){return!s()}})}s([`click`]);export{dt as a,xe as c,W as d,U as f,ht as i,be as l,gt as n,X as o,B as p,mt as r,q as s,At as t,G as u};
|
|
Binary file
|
|
Binary file
|
package/dist/runtime/dist/web/assets/{DocumentSharing-BuTXuflA.js → DocumentSharing-BiTakFtn.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as e,I as t,L as n,M as r,N as i,R as a,T as o,_ as s,a as c,b as l,i as u,k as d,l as f,m as p,n as m,o as h,p as g,r as _,s as v,z as y}from"./web-Ckpee-ZJ.js";import{t as b}from"./chevron-down-COGO5cmx.js";import{A as x,G as S,P as C,V as w,W as T,j as E,l as ee}from"./solid-app-BtmRR9Ax.js";import"./src-CcX8uAQo.js";import{t as te}from"./artifact-reference-ChS4TSVz.js";import{t as D}from"./sharing-X_H561x5.js";import{t as ne}from"./ConfirmDialog-Ph1VDgNN.js";import{a as O,t as k}from"./share-roles-c4EwFuyA.js";import{t as re}from"./copy-text-BWnoOWaK.js";import{t as ie}from"./urls-DtkapM59.js";import{t as ae}from"./DialogShell-BA3tWbeJ.js";var A=[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]],j=e=>o(S,t(e,{iconNode:A,name:`link`})),M=[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]],N=e=>o(S,t(e,{iconNode:M,name:`pen-line`})),P=g(`<div data-mx-theme-host><div data-story-popper-wrapper style="position:fixed;left:0px;top:0px;transform:translate(0, -200%);min-width:max-content;z-index:200"><div data-story-floating>`);function F(t){let[a,s]=r(),[c,u]=r(),d=i(),f=O(()=>t.open,()=>t.onOpenChange(!1),a,c);return e(n(()=>t.open,e=>{e&&f()})),[v(()=>t.trigger({ref:s,"aria-haspopup":`true`,"aria-expanded":t.open})),o(l,{get when(){return t.open},get children(){return o(m,{get mount(){return C(document)??document.body},get children(){return o(I,{anchor:()=>a(),ref:u,id:d,get label(){return t.label},get side(){return t.side??`bottom`},get align(){return t.align??`start`},get sideOffset(){return t.sideOffset??4},get class(){return t.class},get role(){return t.role},get onKeyDown(){return t.onPanelKeyDown},get children(){return t.children}})}})}})]}function I(t){let n;return e(()=>{let e=t.anchor();if(!e)return;let r=E(e,n,null,{side:t.side,align:t.align,sideOffset:t.sideOffset,collisionPadding:8,arrowWidth:0,arrowHeight:0,onPlaced:()=>{}});a(r)}),(()=>{var e=P(),r=e.firstChild,i=r.firstChild;return p(e=>{n=e,t.ref(e)},r),_(i,`keydown`,t.onKeyDown,!0),h(i,()=>t.children),d(e=>{var n=t.id,r=t.role,a=t.label,o=`border border-edge bg-surface shadow-lg ${t.class??``}`;return n!==e.e&&f(i,`id`,e.e=n),r!==e.t&&f(i,`role`,e.t=r),a!==e.a&&f(i,`aria-label`,e.a=a),o!==e.o&&u(i,e.o=o),e},{e:void 0,t:void 0,a:void 0,o:void 0}),e})()}c([`keydown`]);var L=g(`<div style=width:var(--radix-popper-anchor-width)>`),R=g(`<div class=relative>`),z=g(`<button type=button class="flex w-full cursor-pointer items-center justify-between gap-2 rounded-[4px] border border-edge bg-surface px-2 py-1 text-left font-mono text-xs text-fg hover:bg-raised disabled:cursor-default disabled:opacity-50"><span class=truncate>`),B=g(`<span class=text-faint> · `),V=g(`<button type=button role=option><span class=truncate>`);function H(e){let[t,n]=r(!1),[i,a]=r(0),c=()=>e.options.find(t=>t.value===e.value),m=()=>e.placeholder??`— none —`,g=t=>{n(!1),e.onChange(t)},_=()=>{a(Math.max(0,e.options.findIndex(t=>t.value===e.value))),n(!0)},y=r=>{if(!t()){(r.key===`ArrowDown`||r.key===`ArrowUp`)&&(r.preventDefault(),_());return}if(r.key===`Escape`)r.preventDefault(),n(!1);else if(r.key===`ArrowDown`)r.preventDefault(),a(t=>Math.min(t+1,e.options.length-1));else if(r.key===`ArrowUp`)r.preventDefault(),a(e=>Math.max(e-1,0));else if(r.key===`Enter`){r.preventDefault();let t=e.options[i()];t&&g(t.value)}else r.key===`Tab`&&n(!1)};return(()=>{var r=R();return r.$$keydown=y,h(r,o(F,{get open(){return t()},onOpenChange:e=>e?_():n(!1),get label(){return`${e.ariaLabel} options`},role:`listbox`,class:`z-[200] max-h-64 overflow-y-auto rounded-[4px] py-1`,onPanelKeyDown:y,trigger:r=>(()=>{var i=z(),a=i.firstChild;i.$$click=()=>t()?n(!1):_();var s=r.ref;return typeof s==`function`?p(s,i):r.ref=i,h(a,(()=>{var e=v(()=>!!c());return()=>e()?c().label:m()})(),null),h(a,o(l,{get when(){return c()?.hint},children:e=>(()=>{var t=B();return t.firstChild,h(t,e,null),t})()}),null),h(i,o(b,{size:12,class:`shrink-0 opacity-60`}),null),d(t=>{var n=e.ariaLabel,a=r[`aria-haspopup`],o=e.disabled;return n!==t.e&&f(i,`aria-label`,t.e=n),a!==t.t&&f(i,`aria-haspopup`,t.t=a),o!==t.a&&(i.disabled=t.a=o),t},{e:void 0,t:void 0,a:void 0}),i})(),get children(){var t=L();return h(t,o(s,{get each(){return e.options},children:(t,n)=>(()=>{var r=V(),s=r.firstChild;return r.addEventListener(`mouseenter`,()=>a(n())),r.$$click=()=>g(t.value),h(s,()=>t.label,null),h(s,o(l,{get when(){return t.hint},children:e=>(()=>{var t=B();return t.firstChild,h(t,e,null),t})()}),null),h(r,o(l,{get when(){return t.value===e.value},get children(){return o(T,{size:11,class:`shrink-0 text-accent`})}}),null),d(a=>{var o=t.value===e.value,s=`flex w-full cursor-pointer items-center justify-between gap-2 px-2 py-1 text-left font-mono text-xs text-fg ${n()===i()?`bg-raised`:``}`;return o!==a.e&&f(r,`aria-selected`,a.e=o),s!==a.t&&u(r,a.t=s),a},{e:void 0,t:void 0}),r})()})),t}})),r})()}c([`keydown`,`click`]);function U({visibility:e,hasInvitedUsers:t}){return e===`private`&&t?`shared`:e}var W={shared:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`users-body`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`users-back-head`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`users-back-body`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`users-head`}]],private:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`lock-body`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`lock-shackle`}]],unlisted:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`eye-top`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`eye-pupil`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`eye-bottom`}],[`path`,{d:`m2 2 20 20`,key:`eye-slash`}]],public:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`globe-outline`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`globe-meridian`}],[`path`,{d:`M2 12h20`,key:`globe-equator`}]]},G=g(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden=true>`),oe=g(`<button type=button aria-label="Copy link"class="mb-4 flex w-full cursor-pointer items-center justify-center gap-2 rounded-[5px] border border-edge bg-raised px-3 py-2.5 text-muted hover:border-edge-bright hover:text-fg"> `),se=g(`<div role=status class="absolute inset-0 flex items-center justify-center text-[11px] text-muted">`),K=g(`<img alt="Current social preview">`),ce=g(`<button type=button aria-label="Edit social preview"class="absolute right-2 top-2 flex h-9 w-9 cursor-pointer items-center justify-center rounded-md border border-edge-bright bg-surface text-fg shadow-sm transition-colors hover:bg-raised focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent">`),le=g(`<figure class="mx-auto mb-5 w-full max-w-xs"><figcaption class="mb-2 text-center text-[11px] text-muted">Social preview</figcaption><div class="relative aspect-[40/21] w-full overflow-hidden rounded-md border border-edge bg-raised">`),ue=g(`<p class=text-muted>loading…`),de=g(`<p role=alert class=text-red-400>`),fe=g(`<div class="flex gap-1">`),pe=g(`<label class="mt-2 flex items-center justify-between gap-2 text-muted"><span>anyone with the link</span><span class="w-32 shrink-0">`),me=g(`<p aria-label="PostgreSQL read-only access"class="mt-5 border-t border-edge pt-4 leading-relaxed text-muted">Editors can manage the connection, notebook and whitelist. Viewers can query exposed data. Database rows cannot be changed here.`),he=g(`<div class=mt-2><p class="mb-1 uppercase tracking-wider text-faint">written by`),ge=g(`<div class="mt-5 border-t border-edge pt-4"><p class="mb-1 flex items-center justify-between text-faint"><span class="uppercase tracking-wider">writes</span></p><div class="flex gap-1"></div><p class="mt-2 leading-relaxed text-muted">`),_e=g(`<div class="mt-5 border-t border-edge pt-4"><p class="mb-1 uppercase tracking-wider text-faint">people</p><form class="mt-2 flex gap-2"><input aria-label="Invite email"placeholder=email@example.com class="min-h-10 min-w-0 flex-1 rounded-[4px] border border-edge bg-transparent px-3 py-2 text-sm text-fg outline-none focus:border-edge-bright"><button type=submit aria-label="Add email"class="min-h-10 cursor-pointer rounded-[4px] border border-edge px-4 py-2 text-sm text-muted hover:border-edge-bright hover:text-fg">Add`),ve=g(`<a aria-label="Manage access policies"class="mt-4 block rounded-lg border border-edge px-3 py-2 text-sm text-muted hover:border-accent hover:text-fg">Manage data actions ↗`),ye=g(`<button type=button> `),be=g(`<button type=button>`),xe=g(`<div class="flex items-center justify-between py-0.5"><span class=truncate></span><span class="ml-2 shrink-0 text-faint">`),Se=g(`<span class="w-32 shrink-0">`),Ce=g(`<div class="flex items-center justify-between gap-2 py-0.5"><span class="min-w-0 truncate"></span><span class="flex shrink-0 items-center gap-1"><button type=button class="cursor-pointer text-muted hover:text-fg">`),we=g(`<section aria-label=Sharing class="font-mono text-xs"><h2 class="mb-4 text-base font-semibold text-fg">`),Te=g(`<button type=button aria-label=Share><span>`),Ee=g(`<div class="fixed inset-0 z-[100] flex items-center justify-center p-3 sm:p-8"><button type=button aria-label="Close sharing by clicking outside"class="absolute inset-0 cursor-default border-0 bg-black/45 p-0 backdrop-blur-[2px]"></button><section role=dialog aria-modal=true aria-label=Sharing class="relative z-10 flex w-full max-w-2xl animate-[rise_.16s_ease-out] flex-col overflow-hidden rounded-[9px] border border-edge-bright bg-surface font-mono text-xs shadow-2xl"style="max-height:calc(100svh - 24px)"><header class="flex items-start gap-4 border-b border-edge px-4 py-4 sm:px-6"><div class="min-w-0 flex-1"><h2 class="break-words text-base font-semibold text-fg"></h2><p class="mt-1 text-[11px] text-faint">Manage access, invite people, or copy the link.</p></div><button type=button aria-label="Close sharing"autofocus class="ml-auto inline-flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-[4px] text-muted hover:bg-raised hover:text-fg"></button></header><div class="overflow-y-auto px-4 py-4 sm:px-6 sm:py-5">`),q=g(`<button type=button aria-label=Share class="flex w-full cursor-pointer items-center gap-2 rounded-[5px] border-0 bg-transparent px-2 py-2 text-left font-mono text-xs text-muted transition-colors hover:bg-raised hover:text-fg">`),J=D.map(e=>({value:e,label:k[e]})),De={public:`anyone with the link · listed on your profile`,unlisted:`anyone with the link · not listed anywhere`,private:`only you and invited emails`};function Y(e){return(()=>{var t=G();return d(n=>{var r=e.size,i=e.size,a=e.class,o=W[e.icon].map(([e,t])=>`<${e} ${Object.entries(t).filter(([e])=>e!==`key`).map(([e,t])=>`${e}="${String(t)}"`).join(` `)}/>`).join(``);return r!==n.e&&f(t,`width`,n.e=r),i!==n.t&&f(t,`height`,n.t=i),a!==n.a&&f(t,`class`,n.a=a),o!==n.o&&(t.innerHTML=n.o=o),n},{e:void 0,t:void 0,a:void 0,o:void 0}),t})()}var Oe=[[`read`,`read-only`,`documents may only read this data`],[`readwrite`,`read & write`,`you and dataset editors may add, change and remove rows`]];function X(t){let n=()=>t.owner||!!t.editable,[i,c]=r(t.variant===`dialog`),[p,g]=r(null),[_,b]=r(``),[S,E]=r(``),[D,O]=r(!1),[k,A]=r(`loading`);e(()=>{if(!D())return;let e=setTimeout(()=>O(!1),1500);a(()=>clearTimeout(e))});let M=`/api/my/artifacts/${encodeURIComponent(t.id)}/sharing`,P=()=>{c(!1),t.onClose?.()},F=()=>{let e=new URL(t.url??`/a/${encodeURIComponent(t.id)}`,location.origin);re(e.origin+e.pathname),O(!0)},I=async e=>{E(``);try{let t=await ee(M,`PUT`,e);if(!t.ok)throw Error(`could not update sharing`);return g(await t.json()),!0}catch{return E(`could not update sharing`),!1}},L=()=>t.format===`dataset`&&(t.datasetKind===`postgres`||p()?.datasetKind===`postgres`),R=()=>t.format===`dataset`&&!!p()&&!L()&&p().policyVersion!==2,z=()=>!L()&&p()?.access===`readwrite`,[B,V]=r(!1),[W,G]=r(!1),[X,Z]=r(null),ke=e=>{if(e===`read`&&(p()?.writtenBy?.length??0)>0){Z(null),V(!0);return}I({access:e})},Ae=async()=>{G(!0);let e=await I({access:`read`});G(!1),e?V(!1):Z(`Could not update sharing. Try again.`)};y(()=>{if(!n())return;let e=new AbortController;fetch(M,{signal:e.signal}).then(async e=>{if(!e.ok)throw Error(`could not load sharing`);g(await e.json())}).catch(()=>{e.signal.aborted||E(`could not load sharing`)}),a(()=>e.abort())}),e(()=>{let e=p();e&&t.onSharingChange?.({visibility:e.visibility,hasInvitedUsers:e.shares.length>0})}),e(()=>{t.version,A(`loading`)});let je=()=>te.test(t.id)?`/a/${t.id}/export?format=jpg&mode=card&v=${Number(t.version??0)}&r=3`:void 0,Q=()=>[(()=>{var e=oe(),t=e.firstChild;return e.$$click=F,h(e,o(l,{get when(){return D()},get fallback(){return o(j,{size:11})},get children(){return o(T,{size:11})}}),t),h(e,()=>D()?`copied`:`copy link`,null),e})(),o(l,{get when(){return t.onSocialPreview},get children(){var e=le(),n=e.firstChild.nextSibling;return h(n,o(l,{get when(){return k()!==`ready`},get children(){var e=se();return h(e,()=>k()===`loading`?`Loading preview…`:`Preview unavailable`),e}}),null),h(n,o(l,{get when(){return k()!==`error`},get children(){var e=K();return e.addEventListener(`error`,()=>A(`error`)),e.addEventListener(`load`,()=>A(`ready`)),d(t=>{var n=je(),r=`h-full w-full object-contain transition-opacity duration-200 motion-reduce:transition-none ${k()===`ready`?`opacity-100`:`opacity-0`}`;return n!==t.e&&f(e,`src`,t.e=n),r!==t.t&&u(e,t.t=r),t},{e:void 0,t:void 0}),e}}),null),h(n,o(x,{content:`Edit thumbnail`,get children(){var e=ce();return e.$$click=()=>{P(),t.onSocialPreview?.()},h(e,o(N,{size:15})),e}}),null),e}}),o(l,{get when(){return v(()=>!!(n()&&!p()))()&&!S()},get children(){return ue()}}),o(l,{get when(){return S()},get children(){var e=de();return h(e,S),e}}),o(l,{get when(){return v(()=>!!n())()&&p()},children:e=>[(()=>{var t=fe();return h(t,o(s,{get each(){return[`public`,`unlisted`,`private`].filter(t=>t!==`private`||e().canPrivate!==!1)},children:t=>o(x,{get content(){return De[t]},get children(){var n=ye(),r=n.firstChild;return n.$$click=()=>void I({visibility:t}),f(n,`aria-label`,`Make ${t}`),h(n,o(Y,{icon:t,size:11,class:`mr-1 inline`}),r),h(n,t,null),d(r=>{var i=e().visibility===t,a=`flex-1 cursor-pointer whitespace-nowrap rounded-[4px] border px-2 py-2.5 ${e().visibility===t?`border-accent/40 bg-accent-soft text-accent`:`border-edge text-muted hover:border-edge-bright hover:text-fg`}`;return i!==r.e&&f(n,`aria-pressed`,r.e=i),a!==r.t&&u(n,r.t=a),r},{e:void 0,t:void 0}),n}})})),t})(),o(l,{get when(){return e().visibility!==`private`},get children(){var t=pe(),n=t.firstChild.nextSibling;return h(n,o(H,{ariaLabel:`Link role`,get value(){return e().linkRole??`viewer`},options:J,onChange:e=>void I({linkRole:e})})),t}}),o(l,{get when(){return L()},get children(){return me()}}),o(l,{get when(){return R()},get children(){var t=ge(),n=t.firstChild;n.firstChild;var r=n.nextSibling,i=r.nextSibling;return h(n,o(N,{size:11}),null),h(r,o(s,{each:Oe,children:([t,n,r])=>o(x,{content:r,get children(){var r=be();return r.$$click=()=>ke(t),f(r,`aria-label`,t===`read`?`Make read-only`:`Make read & write`),h(r,n),d(n=>{var i=(e().access??`read`)===t,a=`flex-1 cursor-pointer whitespace-nowrap rounded-[4px] border px-2 py-1.5 ${(e().access??`read`)===t?t===`readwrite`?`border-amber-500/40 bg-amber-500/10 text-amber-500`:`border-accent/40 bg-accent-soft text-accent`:`border-edge text-muted hover:border-edge-bright hover:text-fg`}`;return i!==n.e&&f(r,`aria-pressed`,n.e=i),a!==n.t&&u(r,n.t=a),n},{e:void 0,t:void 0}),r}})})),h(i,()=>z()?`Sharing controls who can view and manage this dataset. Data rules below control which actions everyone with view access may run. Without a data policy, only dataset editors may write rows.`:`Documents can only read this dataset. A <Mutation> naming it is refused when you publish.`),h(t,o(l,{get when(){return e().writtenBy?.length},get children(){var t=he();return t.firstChild,h(t,o(s,{get each(){return e().writtenBy},children:e=>(()=>{var t=xe(),n=t.firstChild,r=n.nextSibling;return h(n,()=>e.title??e.id),h(r,()=>e.mutations.join(`, `)),t})()}),null),t}}),null),h(t,o(l,{get when(){return B()},get children(){return o(ne,{title:`Make this dataset read-only?`,action:`Make read-only`,confirmLabel:`Confirm read-only`,cancelLabel:`Keep writable`,danger:!0,get busy(){return W()},get error(){return X()},get description(){return`${e().writtenBy?.length??0} document${e().writtenBy?.length===1?``:`s`} write${e().writtenBy?.length===1?`s`:``} here. Their buttons will stop working until you turn writes back on. The rows stay.`},onConfirm:()=>void Ae(),onCancel:()=>V(!1)})}}),null),t}}),(()=>{var t=_e(),n=t.firstChild.nextSibling,r=n.firstChild;return h(t,o(s,{get each(){return e().shares},children:t=>(()=>{var n=Ce(),r=n.firstChild,i=r.nextSibling,a=i.firstChild;return h(r,()=>t.email),h(i,o(x,{content:`already viewable by link`,get disabled(){return e().visibility===`private`||t.role===`editor`},get children(){var n=Se();return h(n,o(H,{get ariaLabel(){return`Role for ${t.email}`},get value(){return t.role},options:J,onChange:n=>void I({shares:e().shares.map(e=>e.email===t.email?{...e,role:n}:e)})})),d(()=>f(n,`data-slot`,e().visibility!==`private`&&t.role!==`editor`?`tooltip-trigger`:void 0)),n}}),a),a.$$click=()=>void I({shares:e().shares.filter(e=>e.email!==t.email)}),h(a,o(w,{size:11})),d(()=>f(a,`aria-label`,`Remove ${t.email}`)),n})()}),n),n.addEventListener(`submit`,t=>{t.preventDefault();let n=_().trim();n&&(I({shares:[...e().shares,{email:n,role:`viewer`}]}),b(``))}),r.$$input=e=>b(e.currentTarget.value),d(()=>r.value=_()),t})(),o(l,{get when(){return v(()=>t.format===`dataset`)()&&!L()},get children(){var e=ve();return e.$$click=P,d(()=>f(e,`href`,ie(t.id))),e}})]})],$=()=>`Share “${t.title||(t.format===`folder`?`Untitled folder`:`Untitled`)}”`,Me=()=>U({visibility:p()?.visibility??`private`,hasInvitedUsers:(p()?.shares.length??0)>0});return t.variant===`embedded`?(()=>{var e=we(),t=e.firstChild;return h(t,$),h(e,Q,null),e})():[o(l,{get when(){return t.variant!==`dialog`},get children(){return o(l,{get when(){return n()||t.onSocialPreview},get fallback(){return(()=>{var e=q();return e.$$click=F,h(e,o(l,{get when(){return D()},get fallback(){return o(j,{size:14})},get children(){return o(T,{size:14})}}),null),h(e,()=>D()?`copied link`:`share`,null),e})()},get children(){var e=Te(),n=e.firstChild;return e.$$click=()=>t.onOpen?t.onOpen():c(e=>!e),h(e,o(Y,{get icon(){return Me()},get size(){return t.variant===`menu`?14:12}}),n),h(n,(()=>{var e=v(()=>!!p());return()=>e()?`sharing · ${p().visibility}`:`sharing`})()),d(()=>u(e,t.variant===`menu`?`flex w-full cursor-pointer items-center gap-2 rounded-[5px] border-0 bg-transparent px-2 py-2 text-left font-mono text-xs transition-colors hover:bg-raised hover:text-fg ${i()?`text-accent`:`text-muted`}`:`inline-flex items-center gap-1 rounded border border-edge px-2 py-1 text-xs`)),e}})}}),o(l,{get when(){return i()},get children(){return o(m,{get mount(){return C(document)??document.body},get children(){return o(ae,{onClose:P,lockScroll:!0,initialFocus:`[autofocus]`,get children(){var e=Ee(),t=e.firstChild,n=t.nextSibling.firstChild,r=n.firstChild,i=r.firstChild,a=r.nextSibling,s=n.nextSibling;return t.$$click=P,h(i,$),a.$$click=P,h(a,o(w,{size:16})),h(s,Q),e}})}})}})]}c([`click`,`input`]);export{F as a,H as i,W as n,U as r,X as t};
|
|
1
|
+
import{D as e,I as t,L as n,M as r,N as i,R as a,T as o,_ as s,a as c,b as l,i as u,k as d,l as f,m as p,n as m,o as h,p as g,r as _,s as v,z as y}from"./web-Ckpee-ZJ.js";import{t as b}from"./chevron-down-M1fHuk7u.js";import{A as x,G as S,P as C,V as w,W as T,j as E,l as ee}from"./solid-app-BNcsMwv4.js";import"./src-CcX8uAQo.js";import{t as te}from"./artifact-reference-ChS4TSVz.js";import{t as D}from"./sharing-X_H561x5.js";import{t as ne}from"./ConfirmDialog-hdkXS1mg.js";import{a as O,t as k}from"./share-roles-c4EwFuyA.js";import{t as re}from"./copy-text-BWnoOWaK.js";import{t as ie}from"./urls-DtkapM59.js";import{t as ae}from"./DialogShell-BA3tWbeJ.js";var A=[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]],j=e=>o(S,t(e,{iconNode:A,name:`link`})),M=[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]],N=e=>o(S,t(e,{iconNode:M,name:`pen-line`})),P=g(`<div data-mx-theme-host><div data-story-popper-wrapper style="position:fixed;left:0px;top:0px;transform:translate(0, -200%);min-width:max-content;z-index:200"><div data-story-floating>`);function F(t){let[a,s]=r(),[c,u]=r(),d=i(),f=O(()=>t.open,()=>t.onOpenChange(!1),a,c);return e(n(()=>t.open,e=>{e&&f()})),[v(()=>t.trigger({ref:s,"aria-haspopup":`true`,"aria-expanded":t.open})),o(l,{get when(){return t.open},get children(){return o(m,{get mount(){return C(document)??document.body},get children(){return o(I,{anchor:()=>a(),ref:u,id:d,get label(){return t.label},get side(){return t.side??`bottom`},get align(){return t.align??`start`},get sideOffset(){return t.sideOffset??4},get class(){return t.class},get role(){return t.role},get onKeyDown(){return t.onPanelKeyDown},get children(){return t.children}})}})}})]}function I(t){let n;return e(()=>{let e=t.anchor();if(!e)return;let r=E(e,n,null,{side:t.side,align:t.align,sideOffset:t.sideOffset,collisionPadding:8,arrowWidth:0,arrowHeight:0,onPlaced:()=>{}});a(r)}),(()=>{var e=P(),r=e.firstChild,i=r.firstChild;return p(e=>{n=e,t.ref(e)},r),_(i,`keydown`,t.onKeyDown,!0),h(i,()=>t.children),d(e=>{var n=t.id,r=t.role,a=t.label,o=`border border-edge bg-surface shadow-lg ${t.class??``}`;return n!==e.e&&f(i,`id`,e.e=n),r!==e.t&&f(i,`role`,e.t=r),a!==e.a&&f(i,`aria-label`,e.a=a),o!==e.o&&u(i,e.o=o),e},{e:void 0,t:void 0,a:void 0,o:void 0}),e})()}c([`keydown`]);var L=g(`<div style=width:var(--radix-popper-anchor-width)>`),R=g(`<div class=relative>`),z=g(`<button type=button class="flex w-full cursor-pointer items-center justify-between gap-2 rounded-[4px] border border-edge bg-surface px-2 py-1 text-left font-mono text-xs text-fg hover:bg-raised disabled:cursor-default disabled:opacity-50"><span class=truncate>`),B=g(`<span class=text-faint> · `),V=g(`<button type=button role=option><span class=truncate>`);function H(e){let[t,n]=r(!1),[i,a]=r(0),c=()=>e.options.find(t=>t.value===e.value),m=()=>e.placeholder??`— none —`,g=t=>{n(!1),e.onChange(t)},_=()=>{a(Math.max(0,e.options.findIndex(t=>t.value===e.value))),n(!0)},y=r=>{if(!t()){(r.key===`ArrowDown`||r.key===`ArrowUp`)&&(r.preventDefault(),_());return}if(r.key===`Escape`)r.preventDefault(),n(!1);else if(r.key===`ArrowDown`)r.preventDefault(),a(t=>Math.min(t+1,e.options.length-1));else if(r.key===`ArrowUp`)r.preventDefault(),a(e=>Math.max(e-1,0));else if(r.key===`Enter`){r.preventDefault();let t=e.options[i()];t&&g(t.value)}else r.key===`Tab`&&n(!1)};return(()=>{var r=R();return r.$$keydown=y,h(r,o(F,{get open(){return t()},onOpenChange:e=>e?_():n(!1),get label(){return`${e.ariaLabel} options`},role:`listbox`,class:`z-[200] max-h-64 overflow-y-auto rounded-[4px] py-1`,onPanelKeyDown:y,trigger:r=>(()=>{var i=z(),a=i.firstChild;i.$$click=()=>t()?n(!1):_();var s=r.ref;return typeof s==`function`?p(s,i):r.ref=i,h(a,(()=>{var e=v(()=>!!c());return()=>e()?c().label:m()})(),null),h(a,o(l,{get when(){return c()?.hint},children:e=>(()=>{var t=B();return t.firstChild,h(t,e,null),t})()}),null),h(i,o(b,{size:12,class:`shrink-0 opacity-60`}),null),d(t=>{var n=e.ariaLabel,a=r[`aria-haspopup`],o=e.disabled;return n!==t.e&&f(i,`aria-label`,t.e=n),a!==t.t&&f(i,`aria-haspopup`,t.t=a),o!==t.a&&(i.disabled=t.a=o),t},{e:void 0,t:void 0,a:void 0}),i})(),get children(){var t=L();return h(t,o(s,{get each(){return e.options},children:(t,n)=>(()=>{var r=V(),s=r.firstChild;return r.addEventListener(`mouseenter`,()=>a(n())),r.$$click=()=>g(t.value),h(s,()=>t.label,null),h(s,o(l,{get when(){return t.hint},children:e=>(()=>{var t=B();return t.firstChild,h(t,e,null),t})()}),null),h(r,o(l,{get when(){return t.value===e.value},get children(){return o(T,{size:11,class:`shrink-0 text-accent`})}}),null),d(a=>{var o=t.value===e.value,s=`flex w-full cursor-pointer items-center justify-between gap-2 px-2 py-1 text-left font-mono text-xs text-fg ${n()===i()?`bg-raised`:``}`;return o!==a.e&&f(r,`aria-selected`,a.e=o),s!==a.t&&u(r,a.t=s),a},{e:void 0,t:void 0}),r})()})),t}})),r})()}c([`keydown`,`click`]);function U({visibility:e,hasInvitedUsers:t}){return e===`private`&&t?`shared`:e}var W={shared:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`users-body`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`users-back-head`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`users-back-body`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`users-head`}]],private:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`lock-body`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`lock-shackle`}]],unlisted:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`eye-top`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`eye-pupil`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`eye-bottom`}],[`path`,{d:`m2 2 20 20`,key:`eye-slash`}]],public:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`globe-outline`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`globe-meridian`}],[`path`,{d:`M2 12h20`,key:`globe-equator`}]]},G=g(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden=true>`),oe=g(`<button type=button aria-label="Copy link"class="mb-4 flex w-full cursor-pointer items-center justify-center gap-2 rounded-[5px] border border-edge bg-raised px-3 py-2.5 text-muted hover:border-edge-bright hover:text-fg"> `),se=g(`<div role=status class="absolute inset-0 flex items-center justify-center text-[11px] text-muted">`),K=g(`<img alt="Current social preview">`),ce=g(`<button type=button aria-label="Edit social preview"class="absolute right-2 top-2 flex h-9 w-9 cursor-pointer items-center justify-center rounded-md border border-edge-bright bg-surface text-fg shadow-sm transition-colors hover:bg-raised focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent">`),le=g(`<figure class="mx-auto mb-5 w-full max-w-xs"><figcaption class="mb-2 text-center text-[11px] text-muted">Social preview</figcaption><div class="relative aspect-[40/21] w-full overflow-hidden rounded-md border border-edge bg-raised">`),ue=g(`<p class=text-muted>loading…`),de=g(`<p role=alert class=text-red-400>`),fe=g(`<div class="flex gap-1">`),pe=g(`<label class="mt-2 flex items-center justify-between gap-2 text-muted"><span>anyone with the link</span><span class="w-32 shrink-0">`),me=g(`<p aria-label="PostgreSQL read-only access"class="mt-5 border-t border-edge pt-4 leading-relaxed text-muted">Editors can manage the connection, notebook and whitelist. Viewers can query exposed data. Database rows cannot be changed here.`),he=g(`<div class=mt-2><p class="mb-1 uppercase tracking-wider text-faint">written by`),ge=g(`<div class="mt-5 border-t border-edge pt-4"><p class="mb-1 flex items-center justify-between text-faint"><span class="uppercase tracking-wider">writes</span></p><div class="flex gap-1"></div><p class="mt-2 leading-relaxed text-muted">`),_e=g(`<div class="mt-5 border-t border-edge pt-4"><p class="mb-1 uppercase tracking-wider text-faint">people</p><form class="mt-2 flex gap-2"><input aria-label="Invite email"placeholder=email@example.com class="min-h-10 min-w-0 flex-1 rounded-[4px] border border-edge bg-transparent px-3 py-2 text-sm text-fg outline-none focus:border-edge-bright"><button type=submit aria-label="Add email"class="min-h-10 cursor-pointer rounded-[4px] border border-edge px-4 py-2 text-sm text-muted hover:border-edge-bright hover:text-fg">Add`),ve=g(`<a aria-label="Manage access policies"class="mt-4 block rounded-lg border border-edge px-3 py-2 text-sm text-muted hover:border-accent hover:text-fg">Manage data actions ↗`),ye=g(`<button type=button> `),be=g(`<button type=button>`),xe=g(`<div class="flex items-center justify-between py-0.5"><span class=truncate></span><span class="ml-2 shrink-0 text-faint">`),Se=g(`<span class="w-32 shrink-0">`),Ce=g(`<div class="flex items-center justify-between gap-2 py-0.5"><span class="min-w-0 truncate"></span><span class="flex shrink-0 items-center gap-1"><button type=button class="cursor-pointer text-muted hover:text-fg">`),we=g(`<section aria-label=Sharing class="font-mono text-xs"><h2 class="mb-4 text-base font-semibold text-fg">`),Te=g(`<button type=button aria-label=Share><span>`),Ee=g(`<div class="fixed inset-0 z-[100] flex items-center justify-center p-3 sm:p-8"><button type=button aria-label="Close sharing by clicking outside"class="absolute inset-0 cursor-default border-0 bg-black/45 p-0 backdrop-blur-[2px]"></button><section role=dialog aria-modal=true aria-label=Sharing class="relative z-10 flex w-full max-w-2xl animate-[rise_.16s_ease-out] flex-col overflow-hidden rounded-[9px] border border-edge-bright bg-surface font-mono text-xs shadow-2xl"style="max-height:calc(100svh - 24px)"><header class="flex items-start gap-4 border-b border-edge px-4 py-4 sm:px-6"><div class="min-w-0 flex-1"><h2 class="break-words text-base font-semibold text-fg"></h2><p class="mt-1 text-[11px] text-faint">Manage access, invite people, or copy the link.</p></div><button type=button aria-label="Close sharing"autofocus class="ml-auto inline-flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-[4px] text-muted hover:bg-raised hover:text-fg"></button></header><div class="overflow-y-auto px-4 py-4 sm:px-6 sm:py-5">`),q=g(`<button type=button aria-label=Share class="flex w-full cursor-pointer items-center gap-2 rounded-[5px] border-0 bg-transparent px-2 py-2 text-left font-mono text-xs text-muted transition-colors hover:bg-raised hover:text-fg">`),J=D.map(e=>({value:e,label:k[e]})),De={public:`anyone with the link · listed on your profile`,unlisted:`anyone with the link · not listed anywhere`,private:`only you and invited emails`};function Y(e){return(()=>{var t=G();return d(n=>{var r=e.size,i=e.size,a=e.class,o=W[e.icon].map(([e,t])=>`<${e} ${Object.entries(t).filter(([e])=>e!==`key`).map(([e,t])=>`${e}="${String(t)}"`).join(` `)}/>`).join(``);return r!==n.e&&f(t,`width`,n.e=r),i!==n.t&&f(t,`height`,n.t=i),a!==n.a&&f(t,`class`,n.a=a),o!==n.o&&(t.innerHTML=n.o=o),n},{e:void 0,t:void 0,a:void 0,o:void 0}),t})()}var Oe=[[`read`,`read-only`,`documents may only read this data`],[`readwrite`,`read & write`,`you and dataset editors may add, change and remove rows`]];function X(t){let n=()=>t.owner||!!t.editable,[i,c]=r(t.variant===`dialog`),[p,g]=r(null),[_,b]=r(``),[S,E]=r(``),[D,O]=r(!1),[k,A]=r(`loading`);e(()=>{if(!D())return;let e=setTimeout(()=>O(!1),1500);a(()=>clearTimeout(e))});let M=`/api/my/artifacts/${encodeURIComponent(t.id)}/sharing`,P=()=>{c(!1),t.onClose?.()},F=()=>{let e=new URL(t.url??`/a/${encodeURIComponent(t.id)}`,location.origin);re(e.origin+e.pathname),O(!0)},I=async e=>{E(``);try{let t=await ee(M,`PUT`,e);if(!t.ok)throw Error(`could not update sharing`);return g(await t.json()),!0}catch{return E(`could not update sharing`),!1}},L=()=>t.format===`dataset`&&(t.datasetKind===`postgres`||p()?.datasetKind===`postgres`),R=()=>t.format===`dataset`&&!!p()&&!L()&&p().policyVersion!==2,z=()=>!L()&&p()?.access===`readwrite`,[B,V]=r(!1),[W,G]=r(!1),[X,Z]=r(null),ke=e=>{if(e===`read`&&(p()?.writtenBy?.length??0)>0){Z(null),V(!0);return}I({access:e})},Ae=async()=>{G(!0);let e=await I({access:`read`});G(!1),e?V(!1):Z(`Could not update sharing. Try again.`)};y(()=>{if(!n())return;let e=new AbortController;fetch(M,{signal:e.signal}).then(async e=>{if(!e.ok)throw Error(`could not load sharing`);g(await e.json())}).catch(()=>{e.signal.aborted||E(`could not load sharing`)}),a(()=>e.abort())}),e(()=>{let e=p();e&&t.onSharingChange?.({visibility:e.visibility,hasInvitedUsers:e.shares.length>0})}),e(()=>{t.version,A(`loading`)});let je=()=>te.test(t.id)?`/a/${t.id}/export?format=jpg&mode=card&v=${Number(t.version??0)}&r=3`:void 0,Q=()=>[(()=>{var e=oe(),t=e.firstChild;return e.$$click=F,h(e,o(l,{get when(){return D()},get fallback(){return o(j,{size:11})},get children(){return o(T,{size:11})}}),t),h(e,()=>D()?`copied`:`copy link`,null),e})(),o(l,{get when(){return t.onSocialPreview},get children(){var e=le(),n=e.firstChild.nextSibling;return h(n,o(l,{get when(){return k()!==`ready`},get children(){var e=se();return h(e,()=>k()===`loading`?`Loading preview…`:`Preview unavailable`),e}}),null),h(n,o(l,{get when(){return k()!==`error`},get children(){var e=K();return e.addEventListener(`error`,()=>A(`error`)),e.addEventListener(`load`,()=>A(`ready`)),d(t=>{var n=je(),r=`h-full w-full object-contain transition-opacity duration-200 motion-reduce:transition-none ${k()===`ready`?`opacity-100`:`opacity-0`}`;return n!==t.e&&f(e,`src`,t.e=n),r!==t.t&&u(e,t.t=r),t},{e:void 0,t:void 0}),e}}),null),h(n,o(x,{content:`Edit thumbnail`,get children(){var e=ce();return e.$$click=()=>{P(),t.onSocialPreview?.()},h(e,o(N,{size:15})),e}}),null),e}}),o(l,{get when(){return v(()=>!!(n()&&!p()))()&&!S()},get children(){return ue()}}),o(l,{get when(){return S()},get children(){var e=de();return h(e,S),e}}),o(l,{get when(){return v(()=>!!n())()&&p()},children:e=>[(()=>{var t=fe();return h(t,o(s,{get each(){return[`public`,`unlisted`,`private`].filter(t=>t!==`private`||e().canPrivate!==!1)},children:t=>o(x,{get content(){return De[t]},get children(){var n=ye(),r=n.firstChild;return n.$$click=()=>void I({visibility:t}),f(n,`aria-label`,`Make ${t}`),h(n,o(Y,{icon:t,size:11,class:`mr-1 inline`}),r),h(n,t,null),d(r=>{var i=e().visibility===t,a=`flex-1 cursor-pointer whitespace-nowrap rounded-[4px] border px-2 py-2.5 ${e().visibility===t?`border-accent/40 bg-accent-soft text-accent`:`border-edge text-muted hover:border-edge-bright hover:text-fg`}`;return i!==r.e&&f(n,`aria-pressed`,r.e=i),a!==r.t&&u(n,r.t=a),r},{e:void 0,t:void 0}),n}})})),t})(),o(l,{get when(){return e().visibility!==`private`},get children(){var t=pe(),n=t.firstChild.nextSibling;return h(n,o(H,{ariaLabel:`Link role`,get value(){return e().linkRole??`viewer`},options:J,onChange:e=>void I({linkRole:e})})),t}}),o(l,{get when(){return L()},get children(){return me()}}),o(l,{get when(){return R()},get children(){var t=ge(),n=t.firstChild;n.firstChild;var r=n.nextSibling,i=r.nextSibling;return h(n,o(N,{size:11}),null),h(r,o(s,{each:Oe,children:([t,n,r])=>o(x,{content:r,get children(){var r=be();return r.$$click=()=>ke(t),f(r,`aria-label`,t===`read`?`Make read-only`:`Make read & write`),h(r,n),d(n=>{var i=(e().access??`read`)===t,a=`flex-1 cursor-pointer whitespace-nowrap rounded-[4px] border px-2 py-1.5 ${(e().access??`read`)===t?t===`readwrite`?`border-amber-500/40 bg-amber-500/10 text-amber-500`:`border-accent/40 bg-accent-soft text-accent`:`border-edge text-muted hover:border-edge-bright hover:text-fg`}`;return i!==n.e&&f(r,`aria-pressed`,n.e=i),a!==n.t&&u(r,n.t=a),n},{e:void 0,t:void 0}),r}})})),h(i,()=>z()?`Sharing controls who can view and manage this dataset. Data rules below control which actions everyone with view access may run. Without a data policy, only dataset editors may write rows.`:`Documents can only read this dataset. A <Mutation> naming it is refused when you publish.`),h(t,o(l,{get when(){return e().writtenBy?.length},get children(){var t=he();return t.firstChild,h(t,o(s,{get each(){return e().writtenBy},children:e=>(()=>{var t=xe(),n=t.firstChild,r=n.nextSibling;return h(n,()=>e.title??e.id),h(r,()=>e.mutations.join(`, `)),t})()}),null),t}}),null),h(t,o(l,{get when(){return B()},get children(){return o(ne,{title:`Make this dataset read-only?`,action:`Make read-only`,confirmLabel:`Confirm read-only`,cancelLabel:`Keep writable`,danger:!0,get busy(){return W()},get error(){return X()},get description(){return`${e().writtenBy?.length??0} document${e().writtenBy?.length===1?``:`s`} write${e().writtenBy?.length===1?`s`:``} here. Their buttons will stop working until you turn writes back on. The rows stay.`},onConfirm:()=>void Ae(),onCancel:()=>V(!1)})}}),null),t}}),(()=>{var t=_e(),n=t.firstChild.nextSibling,r=n.firstChild;return h(t,o(s,{get each(){return e().shares},children:t=>(()=>{var n=Ce(),r=n.firstChild,i=r.nextSibling,a=i.firstChild;return h(r,()=>t.email),h(i,o(x,{content:`already viewable by link`,get disabled(){return e().visibility===`private`||t.role===`editor`},get children(){var n=Se();return h(n,o(H,{get ariaLabel(){return`Role for ${t.email}`},get value(){return t.role},options:J,onChange:n=>void I({shares:e().shares.map(e=>e.email===t.email?{...e,role:n}:e)})})),d(()=>f(n,`data-slot`,e().visibility!==`private`&&t.role!==`editor`?`tooltip-trigger`:void 0)),n}}),a),a.$$click=()=>void I({shares:e().shares.filter(e=>e.email!==t.email)}),h(a,o(w,{size:11})),d(()=>f(a,`aria-label`,`Remove ${t.email}`)),n})()}),n),n.addEventListener(`submit`,t=>{t.preventDefault();let n=_().trim();n&&(I({shares:[...e().shares,{email:n,role:`viewer`}]}),b(``))}),r.$$input=e=>b(e.currentTarget.value),d(()=>r.value=_()),t})(),o(l,{get when(){return v(()=>t.format===`dataset`)()&&!L()},get children(){var e=ve();return e.$$click=P,d(()=>f(e,`href`,ie(t.id))),e}})]})],$=()=>`Share “${t.title||(t.format===`folder`?`Untitled folder`:`Untitled`)}”`,Me=()=>U({visibility:p()?.visibility??`private`,hasInvitedUsers:(p()?.shares.length??0)>0});return t.variant===`embedded`?(()=>{var e=we(),t=e.firstChild;return h(t,$),h(e,Q,null),e})():[o(l,{get when(){return t.variant!==`dialog`},get children(){return o(l,{get when(){return n()||t.onSocialPreview},get fallback(){return(()=>{var e=q();return e.$$click=F,h(e,o(l,{get when(){return D()},get fallback(){return o(j,{size:14})},get children(){return o(T,{size:14})}}),null),h(e,()=>D()?`copied link`:`share`,null),e})()},get children(){var e=Te(),n=e.firstChild;return e.$$click=()=>t.onOpen?t.onOpen():c(e=>!e),h(e,o(Y,{get icon(){return Me()},get size(){return t.variant===`menu`?14:12}}),n),h(n,(()=>{var e=v(()=>!!p());return()=>e()?`sharing · ${p().visibility}`:`sharing`})()),d(()=>u(e,t.variant===`menu`?`flex w-full cursor-pointer items-center gap-2 rounded-[5px] border-0 bg-transparent px-2 py-2 text-left font-mono text-xs transition-colors hover:bg-raised hover:text-fg ${i()?`text-accent`:`text-muted`}`:`inline-flex items-center gap-1 rounded border border-edge px-2 py-1 text-xs`)),e}})}}),o(l,{get when(){return i()},get children(){return o(m,{get mount(){return C(document)??document.body},get children(){return o(ae,{onClose:P,lockScroll:!0,initialFocus:`[autofocus]`,get children(){var e=Ee(),t=e.firstChild,n=t.nextSibling.firstChild,r=n.firstChild,i=r.firstChild,a=r.nextSibling,s=n.nextSibling;return t.$$click=P,h(i,$),a.$$click=P,h(a,o(w,{size:16})),h(s,Q),e}})}})}})]}c([`click`,`input`]);export{F as a,H as i,W as n,U as r,X as t};
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{D as e,I as t,M as n,R as r,S as i,T as a,a as o,b as s,f as c,i as l,k as u,l as d,m as f,o as p,p as m,s as h,t as g,y as _}from"./web-Ckpee-ZJ.js";import{t as v}from"./copy-PNNAtmJH.js";import{t as y}from"./download-j-nqks7p.js";import{t as b}from"./file-up-DH-HiKEX.js";import{G as x,W as S,Z as ee,q as C,t as w,y as T}from"./solid-app-BtmRR9Ax.js";import{t as E}from"./copy-text-BWnoOWaK.js";import{t as D}from"./file-display-CJZlQncv.js";import{t as O}from"./AssetPageHeader-DX2RcYTv.js";var k=[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]],A=e=>a(x,t(e,{iconNode:k,name:`box`})),j=[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]],M=e=>a(x,t(e,{iconNode:j,name:`file-archive`})),N=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]],P=e=>a(x,t(e,{iconNode:N,name:`file-spreadsheet`})),F=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]],I=e=>a(x,t(e,{iconNode:F,name:`file`})),L={three:{package:`three`,version:`0.185.1`,entry:`three.js`}};function R(e=``){return Object.fromEntries(Object.entries(L).map(([t,n])=>[t,`${e}/libraries/${t}-${n.version}/index.js`]))}var z=null;function B(){return z??=w(()=>import(R().three??``),[]),z}var V=m(`<p role=status class="absolute inset-x-0 bottom-2 text-center font-mono text-[11px] text-muted">`),te=m(`<p class="absolute right-2 bottom-2 font-mono text-[10px] text-faint">drag to orbit · scroll to zoom`),ne=m(`<div class=relative><canvas class="h-96 w-full rounded-lg border border-edge bg-raised/40">`);function re(t){let i,[o,c]=n(`loading`);return e(()=>{let e=t.source,n=!1,a=0,o=null,s=null;c(`loading`),(async()=>{try{let t=await B();if(n)return;let r=i.clientWidth||640,l=i.clientHeight||384,u=new t.WebGLRenderer({canvas:i,antialias:!0,alpha:!0});o=u,u.setPixelRatio(Math.min(window.devicePixelRatio||1,2)),u.setSize(r,l,!1);let d=new t.Scene,f=new t.PerspectiveCamera(45,r/l,.01,1e3);d.add(new t.HemisphereLight(16777215,4473924,3));let p=new t.DirectionalLight(16777215,2);p.position.set(3,5,4),d.add(p);let m=typeof e==`string`?await(await fetch(e)).arrayBuffer():await e.arrayBuffer();if(n)return;let{scene:h}=await new t.GLTFLoader().parseAsync(m,``);if(n)return;let g=new t.Box3().setFromObject(h),_=g.getSize(new t.Vector3),v=g.getCenter(new t.Vector3),y=Math.max(_.x,_.y,_.z)||1;h.position.sub(v),d.add(h),f.position.set(y*.9,y*.7,y*1.6),f.near=y/100,f.far=y*100,f.updateProjectionMatrix();let b=new t.OrbitControls(f,i);b.enableDamping=!0,s=b;let x=()=>{a=requestAnimationFrame(x),b.update(),u.render(d,f)};x(),c(`ready`)}catch{n||c(`error`)}})(),r(()=>{n=!0,cancelAnimationFrame(a),s?.dispose(),o?.dispose()})}),(()=>{var e=ne(),n=e.firstChild,r=i;return typeof r==`function`?f(r,n):i=n,p(e,a(s,{get when(){return o()!==`ready`},get children(){var e=V();return p(e,()=>o()===`loading`?`loading 3D preview…`:`could not load this model for preview`),e}}),null),p(e,a(s,{get when(){return o()===`ready`},get children(){return te()}}),null),u(()=>d(n,`aria-label`,`3D preview of ${t.title}`)),e})()}var H={mp4:`video/mp4`,webm:`video/webm`,mov:`video/quicktime`,mp3:`audio/mpeg`,wav:`audio/wav`,ogg:`audio/ogg`,m4a:`audio/mp4`,flac:`audio/flac`,glb:`model/gltf-binary`,gltf:`model/gltf+json`,obj:`model/obj`,fbx:`application/octet-stream`,stl:`model/stl`,png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,webp:`image/webp`,gif:`image/gif`,svg:`image/svg+xml`,avif:`image/avif`,pdf:`application/pdf`,txt:`text/plain`,csv:`text/csv`,json:`application/json`,xlsx:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,woff:`font/woff`,woff2:`font/woff2`,ttf:`font/ttf`,otf:`font/otf`,zip:`application/zip`},U=Object.keys(H);function W(e){let t=e.lastIndexOf(`.`);return t<=0?null:e.slice(t+1).toLowerCase()}function G(e){let t=W(e);return t!==null&&Object.prototype.hasOwnProperty.call(H,t)?H[t]:null}var K=[`png`,`jpg`,`jpeg`,`webp`,`gif`,`svg`];function q(e){let t=W(e);return t===null||!Object.prototype.hasOwnProperty.call(H,t)?null:K.includes(t)?`image`:t===`pdf`?`pdf`:`file`}var J=m(`<p role=alert class="mt-4 rounded border border-danger/30 bg-danger-soft p-3 text-sm text-danger">`),Y=m(`<main class="mx-auto w-full min-w-0 max-w-6xl px-4 py-8 sm:px-8 sm:py-10"><div class="mx-auto max-w-4xl space-y-6"><section aria-label="Upload a file"class="rounded-xl border border-edge bg-surface p-5"><input type=file aria-label="Choose a file"class=hidden>`),ie=m(`<button type=button><span class="text-sm text-fg">Drop a file here, or click to choose one</span><span class="text-xs text-muted">Images, pdf, video, audio, text, fonts and glb models`),ae=m(`<button type=button>choose another`),oe=m(`<div class="flex flex-wrap items-center gap-x-3 gap-y-1 text-sm"><span class="min-w-0 truncate font-medium text-fg"></span><span class="text-xs text-muted">`),se=m(`<div class=mt-4>`),ce=m(`<div class="mt-5 flex flex-wrap items-end gap-3"><label class="grid min-w-48 flex-1 gap-1.5 text-xs text-muted">Title<input class="w-full rounded border border-edge bg-surface px-3 py-2 font-mono text-sm text-fg"></label><button type=button class="inline-flex items-center gap-1.5 rounded border border-accent bg-accent px-3 py-2 font-mono text-xs text-bg disabled:opacity-50">`),le=m(`<div aria-label="Uploaded file"class="mt-5 rounded-lg border border-edge bg-raised/40 p-4"><p class="flex items-center gap-2 text-sm text-fg">Uploaded as <span class=font-medium></span></p><div class="mt-3 flex flex-wrap gap-2"><a aria-label="Open artifact"class="inline-flex cursor-pointer items-center gap-1.5 rounded-[4px] border px-3 py-1.5 font-mono text-xs no-underline transition-colors border-accent bg-accent font-semibold text-bg hover:brightness-110">Open artifact →</a><button type=button aria-label="Copy file reference"class="inline-flex cursor-pointer items-center gap-1.5 rounded-[4px] border px-3 py-1.5 font-mono text-xs no-underline transition-colors border-edge-bright bg-surface text-accent hover:border-accent">ref:</button><button type=button class="inline-flex cursor-pointer items-center gap-1.5 rounded-[4px] border px-3 py-1.5 font-mono text-xs no-underline transition-colors border-edge-bright bg-surface text-fg">Upload another`),ue=m(`<img class="max-h-[28rem] max-w-full rounded-lg border border-edge">`),de=m(`<video controls class="max-h-[28rem] w-full rounded-lg border border-edge bg-black">`),fe=m(`<audio controls class=w-full>`),pe=m(`<pre class="max-h-[28rem] overflow-auto rounded-lg border border-code-edge bg-code p-4 font-mono text-xs leading-relaxed whitespace-pre-wrap text-fg">`),me=m(`<iframe class="h-[32rem] w-full rounded-lg border border-edge bg-surface">`),he=m(`<p class="mt-3 font-mono text-[10px] text-faint">`),ge=m(`<div class="rounded-lg border border-edge bg-raised/40 p-6"><p class="text-3xl leading-tight text-fg">The quick brown fox jumps over the lazy dog</p><p class="mt-2 text-base text-muted">ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789`),_e=m(`<div class="flex items-center gap-4 rounded-lg border border-edge bg-raised/40 p-5"><span class="flex h-14 w-14 shrink-0 items-center justify-center rounded-xl border border-edge bg-surface text-accent"></span><div class="min-w-0 flex-1"><p class="truncate text-sm font-medium text-fg"></p><p class="mt-0.5 text-xs text-muted">.<!> · <!> · </p></div><a class="inline-flex cursor-pointer items-center gap-1.5 rounded-[4px] border px-3 py-1.5 font-mono text-xs no-underline transition-colors border-edge-bright text-fg hover:border-accent hover:text-accent">Download`),ve={png:`image`,jpg:`image`,jpeg:`image`,webp:`image`,gif:`image`,svg:`image`,avif:`image`,pdf:`pdf`,mp4:`video`,webm:`video`,mov:`video`,mp3:`audio`,wav:`audio`,ogg:`audio`,m4a:`audio`,flac:`audio`,txt:`text`,csv:`text`,json:`text`,woff:`font`,woff2:`font`,ttf:`font`,otf:`font`,glb:`model`},ye=U.map(e=>`.${e}`).join(`,`),X=8e3,Z=e=>{let t=e.lastIndexOf(`.`);return t<=0?``:e.slice(t+1).toLowerCase()},Q=(e,t)=>new Promise((n,r)=>{let i=new FileReader;i.onload=()=>n(String(i.result)),i.onerror=()=>r(i.error??Error(`read failed`)),t===`text`?i.readAsText(e):i.readAsDataURL(e)});function be(){let{session:t}=C(),i=new URLSearchParams(window.location.search).get(`parent_id`),o,[c,m]=n(null),[g,_]=n(``),[y,x]=n(!1),[w,k]=n(``),[A,j]=n(null),[M,N]=n(!1),[P,F]=n(!1);e(()=>{let e=c()?.url;e&&r(()=>URL.revokeObjectURL(e))});let I=async e=>{if(k(``),j(null),N(!1),!q(e.name)){let t=Z(e.name);k(`${t?`.${t} files are`:`That file is`} not accepted. Accepted: ${U.join(`, `)}.`);return}let t=ve[Z(e.name)]??`other`,n=t===`text`?await Q(e.slice(0,X),`text`).catch(()=>null):null;m({file:e,url:URL.createObjectURL(e),kind:t,text:n}),_(e.name.replace(/\.[^.]+$/,``))},L=async()=>{let e=c();if(!(!e||y())){x(!0),k(``);try{let t=await Q(e.file,`dataUrl`),n=t.slice(t.indexOf(`,`)+1),r=G(e.file.name)??e.file.type??`application/octet-stream`,a=q(e.file.name),o=a===`image`?{image:`data:${r};base64,${n}`}:a===`pdf`?{pdf:`data:application/pdf;base64,${n}`}:{file:{filename:e.file.name,contentType:r,base64:n}},s=await fetch(`/api/my/artifacts`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...o,title:g().trim()||e.file.name,parent_id:i})}).catch(()=>null);if(!s){k(`Upload failed. Check your connection and try again.`);return}let c=await s.json().catch(()=>({}));if(!s.ok||!c.id){k(s.status===413?`That file is too large${c.maxBytes?` (the limit is ${D(c.maxBytes)})`:``}.`:c.details?.[0]??(s.status===403?`You have reached your limit.`:`Could not upload that file.`));return}j({id:c.id})}finally{x(!1)}}},R=()=>{m(null),_(``),j(null),k(``),N(!1)},z=e=>{e.preventDefault(),F(!1);let t=e.dataTransfer?.files?.[0];t&&I(t)};return a(s,{get when(){return h(()=>!t()?.user)()&&t()},get fallback(){return(()=>{var e=Y(),t=e.firstChild,n=t.firstChild,r=n.firstChild;p(e,a(O,{icon:b,eyebrow:`Asset upload`,title:`Upload a file`,link:{href:`/assets`,label:`Back to assets`,text:`all assets`}}),t),r.addEventListener(`change`,e=>{let t=e.currentTarget.files?.[0];e.currentTarget.value=``,t&&I(t)});var i=o;return typeof i==`function`?f(i,r):o=r,d(r,`accept`,ye),p(n,a(s,{get when(){return c()},get fallback(){return(()=>{var e=ie(),t=e.firstChild;return e.addEventListener(`drop`,z),e.addEventListener(`dragleave`,()=>F(!1)),e.addEventListener(`dragover`,e=>{e.preventDefault(),F(!0)}),e.$$click=()=>o.click(),p(e,a(b,{"aria-hidden":`true`,size:24,strokeWidth:1.6,class:`text-accent`}),t),u(()=>l(e,`flex h-56 w-full cursor-pointer flex-col items-center justify-center gap-2 rounded-lg border border-dashed transition-colors ${P()?`border-accent bg-accent-soft`:`border-edge-bright bg-raised/40 hover:border-accent`}`)),e})()},children:e=>[(()=>{var t=oe(),n=t.firstChild,r=n.nextSibling;return p(n,()=>e().file.name),p(r,()=>D(e().file.size)),p(t,a(s,{get when(){return!A()},get children(){var e=ae();return e.$$click=()=>o.click(),l(e,`ml-auto cursor-pointer font-mono text-xs ${T}`),e}}),null),t})(),(()=>{var t=se();return p(t,a(xe,{get picked(){return e()},get storedUrl(){return h(()=>!!A())()?`/a/${A().id}/raw`:null}})),t})(),a(s,{get when(){return A()},get fallback(){return(()=>{var t=ce(),n=t.firstChild,r=n.firstChild.nextSibling,i=n.nextSibling;return r.$$input=e=>_(e.currentTarget.value),i.$$click=()=>void L(),p(i,a(b,{"aria-hidden":`true`,size:13}),null),p(i,()=>y()?`Uploading…`:`Upload`,null),u(t=>{var n=e().file.name,a=y();return n!==t.e&&d(r,`placeholder`,t.e=n),a!==t.t&&(i.disabled=t.t=a),t},{e:void 0,t:void 0}),u(()=>r.value=g()),t})()},children:t=>(()=>{var n=le(),r=n.firstChild,i=r.firstChild,o=i.nextSibling,s=r.nextSibling.firstChild,c=s.nextSibling;c.firstChild;var l=c.nextSibling;return p(r,a(S,{"aria-hidden":`true`,size:15,class:`text-accent`}),i),p(o,()=>g().trim()||e().file.name),c.$$click=()=>{E(`ref:${t().id}`),N(!0)},p(c,()=>t().id,null),p(c,(()=>{var e=h(()=>!!M());return()=>e()?a(S,{"aria-hidden":`true`,size:12}):a(v,{"aria-hidden":`true`,size:12})})(),null),l.$$click=R,u(()=>d(s,`href`,`/a/${t().id}`)),n})()})]}),null),p(n,a(s,{get when(){return w()},get children(){var e=J();return p(e,w),e}}),null),e})()},get children(){return a(ee,{href:`/login?callbackUrl=%2Ffiles%2Fnew`})}})}function xe(e){let t=()=>e.picked.file,n=()=>e.picked.url;return a(i,{get fallback(){return a($,{get file(){return t()},get url(){return e.storedUrl??n()},note:`no preview for this type`})},get children(){return[a(_,{get when(){return e.picked.kind===`image`},get children(){var e=ue();return u(r=>{var i=n(),a=t().name;return i!==r.e&&d(e,`src`,r.e=i),a!==r.t&&d(e,`alt`,r.t=a),r},{e:void 0,t:void 0}),e}}),a(_,{get when(){return e.picked.kind===`pdf`},get children(){return a(s,{get when(){return e.storedUrl},get fallback(){return a($,{get file(){return t()},get url(){return n()},note:`previews once uploaded`})},children:e=>(()=>{var n=me();return u(r=>{var i=e(),a=t().name;return i!==r.e&&d(n,`src`,r.e=i),a!==r.t&&d(n,`title`,r.t=a),r},{e:void 0,t:void 0}),n})()})}}),a(_,{get when(){return e.picked.kind===`video`},get children(){var e=de();return u(r=>{var i=n(),a=t().name;return i!==r.e&&d(e,`src`,r.e=i),a!==r.t&&d(e,`aria-label`,r.t=a),r},{e:void 0,t:void 0}),e}}),a(_,{get when(){return e.picked.kind===`audio`},get children(){var e=fe();return u(r=>{var i=n(),a=t().name;return i!==r.e&&d(e,`src`,r.e=i),a!==r.t&&d(e,`aria-label`,r.t=a),r},{e:void 0,t:void 0}),e}}),a(_,{get when(){return e.picked.kind===`text`},get children(){var n=pe();return p(n,()=>e.picked.text??``,null),p(n,()=>e.picked.text!==null&&t().size>X?`
|
|
1
|
+
import{D as e,I as t,M as n,R as r,S as i,T as a,a as o,b as s,f as c,i as l,k as u,l as d,m as f,o as p,p as m,s as h,t as g,y as _}from"./web-Ckpee-ZJ.js";import{t as v}from"./copy-v5iTV3kk.js";import{t as y}from"./download-Dk3mxCBK.js";import{t as b}from"./file-up-GoLKOXxO.js";import{G as x,W as S,Z as ee,q as C,t as w,y as T}from"./solid-app-BNcsMwv4.js";import{t as E}from"./copy-text-BWnoOWaK.js";import{t as D}from"./file-display-CJZlQncv.js";import{t as O}from"./AssetPageHeader-BqdRtu9K.js";var k=[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]],A=e=>a(x,t(e,{iconNode:k,name:`box`})),j=[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]],M=e=>a(x,t(e,{iconNode:j,name:`file-archive`})),N=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]],P=e=>a(x,t(e,{iconNode:N,name:`file-spreadsheet`})),F=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]],I=e=>a(x,t(e,{iconNode:F,name:`file`})),L={three:{package:`three`,version:`0.185.1`,entry:`three.js`}};function R(e=``){return Object.fromEntries(Object.entries(L).map(([t,n])=>[t,`${e}/libraries/${t}-${n.version}/index.js`]))}var z=null;function B(){return z??=w(()=>import(R().three??``),[]),z}var V=m(`<p role=status class="absolute inset-x-0 bottom-2 text-center font-mono text-[11px] text-muted">`),te=m(`<p class="absolute right-2 bottom-2 font-mono text-[10px] text-faint">drag to orbit · scroll to zoom`),ne=m(`<div class=relative><canvas class="h-96 w-full rounded-lg border border-edge bg-raised/40">`);function re(t){let i,[o,c]=n(`loading`);return e(()=>{let e=t.source,n=!1,a=0,o=null,s=null;c(`loading`),(async()=>{try{let t=await B();if(n)return;let r=i.clientWidth||640,l=i.clientHeight||384,u=new t.WebGLRenderer({canvas:i,antialias:!0,alpha:!0});o=u,u.setPixelRatio(Math.min(window.devicePixelRatio||1,2)),u.setSize(r,l,!1);let d=new t.Scene,f=new t.PerspectiveCamera(45,r/l,.01,1e3);d.add(new t.HemisphereLight(16777215,4473924,3));let p=new t.DirectionalLight(16777215,2);p.position.set(3,5,4),d.add(p);let m=typeof e==`string`?await(await fetch(e)).arrayBuffer():await e.arrayBuffer();if(n)return;let{scene:h}=await new t.GLTFLoader().parseAsync(m,``);if(n)return;let g=new t.Box3().setFromObject(h),_=g.getSize(new t.Vector3),v=g.getCenter(new t.Vector3),y=Math.max(_.x,_.y,_.z)||1;h.position.sub(v),d.add(h),f.position.set(y*.9,y*.7,y*1.6),f.near=y/100,f.far=y*100,f.updateProjectionMatrix();let b=new t.OrbitControls(f,i);b.enableDamping=!0,s=b;let x=()=>{a=requestAnimationFrame(x),b.update(),u.render(d,f)};x(),c(`ready`)}catch{n||c(`error`)}})(),r(()=>{n=!0,cancelAnimationFrame(a),s?.dispose(),o?.dispose()})}),(()=>{var e=ne(),n=e.firstChild,r=i;return typeof r==`function`?f(r,n):i=n,p(e,a(s,{get when(){return o()!==`ready`},get children(){var e=V();return p(e,()=>o()===`loading`?`loading 3D preview…`:`could not load this model for preview`),e}}),null),p(e,a(s,{get when(){return o()===`ready`},get children(){return te()}}),null),u(()=>d(n,`aria-label`,`3D preview of ${t.title}`)),e})()}var H={mp4:`video/mp4`,webm:`video/webm`,mov:`video/quicktime`,mp3:`audio/mpeg`,wav:`audio/wav`,ogg:`audio/ogg`,m4a:`audio/mp4`,flac:`audio/flac`,glb:`model/gltf-binary`,gltf:`model/gltf+json`,obj:`model/obj`,fbx:`application/octet-stream`,stl:`model/stl`,png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,webp:`image/webp`,gif:`image/gif`,svg:`image/svg+xml`,avif:`image/avif`,pdf:`application/pdf`,txt:`text/plain`,csv:`text/csv`,json:`application/json`,xlsx:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,woff:`font/woff`,woff2:`font/woff2`,ttf:`font/ttf`,otf:`font/otf`,zip:`application/zip`},U=Object.keys(H);function W(e){let t=e.lastIndexOf(`.`);return t<=0?null:e.slice(t+1).toLowerCase()}function G(e){let t=W(e);return t!==null&&Object.prototype.hasOwnProperty.call(H,t)?H[t]:null}var K=[`png`,`jpg`,`jpeg`,`webp`,`gif`,`svg`];function q(e){let t=W(e);return t===null||!Object.prototype.hasOwnProperty.call(H,t)?null:K.includes(t)?`image`:t===`pdf`?`pdf`:`file`}var J=m(`<p role=alert class="mt-4 rounded border border-danger/30 bg-danger-soft p-3 text-sm text-danger">`),Y=m(`<main class="mx-auto w-full min-w-0 max-w-6xl px-4 py-8 sm:px-8 sm:py-10"><div class="mx-auto max-w-4xl space-y-6"><section aria-label="Upload a file"class="rounded-xl border border-edge bg-surface p-5"><input type=file aria-label="Choose a file"class=hidden>`),ie=m(`<button type=button><span class="text-sm text-fg">Drop a file here, or click to choose one</span><span class="text-xs text-muted">Images, pdf, video, audio, text, fonts and glb models`),ae=m(`<button type=button>choose another`),oe=m(`<div class="flex flex-wrap items-center gap-x-3 gap-y-1 text-sm"><span class="min-w-0 truncate font-medium text-fg"></span><span class="text-xs text-muted">`),se=m(`<div class=mt-4>`),ce=m(`<div class="mt-5 flex flex-wrap items-end gap-3"><label class="grid min-w-48 flex-1 gap-1.5 text-xs text-muted">Title<input class="w-full rounded border border-edge bg-surface px-3 py-2 font-mono text-sm text-fg"></label><button type=button class="inline-flex items-center gap-1.5 rounded border border-accent bg-accent px-3 py-2 font-mono text-xs text-bg disabled:opacity-50">`),le=m(`<div aria-label="Uploaded file"class="mt-5 rounded-lg border border-edge bg-raised/40 p-4"><p class="flex items-center gap-2 text-sm text-fg">Uploaded as <span class=font-medium></span></p><div class="mt-3 flex flex-wrap gap-2"><a aria-label="Open artifact"class="inline-flex cursor-pointer items-center gap-1.5 rounded-[4px] border px-3 py-1.5 font-mono text-xs no-underline transition-colors border-accent bg-accent font-semibold text-bg hover:brightness-110">Open artifact →</a><button type=button aria-label="Copy file reference"class="inline-flex cursor-pointer items-center gap-1.5 rounded-[4px] border px-3 py-1.5 font-mono text-xs no-underline transition-colors border-edge-bright bg-surface text-accent hover:border-accent">ref:</button><button type=button class="inline-flex cursor-pointer items-center gap-1.5 rounded-[4px] border px-3 py-1.5 font-mono text-xs no-underline transition-colors border-edge-bright bg-surface text-fg">Upload another`),ue=m(`<img class="max-h-[28rem] max-w-full rounded-lg border border-edge">`),de=m(`<video controls class="max-h-[28rem] w-full rounded-lg border border-edge bg-black">`),fe=m(`<audio controls class=w-full>`),pe=m(`<pre class="max-h-[28rem] overflow-auto rounded-lg border border-code-edge bg-code p-4 font-mono text-xs leading-relaxed whitespace-pre-wrap text-fg">`),me=m(`<iframe class="h-[32rem] w-full rounded-lg border border-edge bg-surface">`),he=m(`<p class="mt-3 font-mono text-[10px] text-faint">`),ge=m(`<div class="rounded-lg border border-edge bg-raised/40 p-6"><p class="text-3xl leading-tight text-fg">The quick brown fox jumps over the lazy dog</p><p class="mt-2 text-base text-muted">ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789`),_e=m(`<div class="flex items-center gap-4 rounded-lg border border-edge bg-raised/40 p-5"><span class="flex h-14 w-14 shrink-0 items-center justify-center rounded-xl border border-edge bg-surface text-accent"></span><div class="min-w-0 flex-1"><p class="truncate text-sm font-medium text-fg"></p><p class="mt-0.5 text-xs text-muted">.<!> · <!> · </p></div><a class="inline-flex cursor-pointer items-center gap-1.5 rounded-[4px] border px-3 py-1.5 font-mono text-xs no-underline transition-colors border-edge-bright text-fg hover:border-accent hover:text-accent">Download`),ve={png:`image`,jpg:`image`,jpeg:`image`,webp:`image`,gif:`image`,svg:`image`,avif:`image`,pdf:`pdf`,mp4:`video`,webm:`video`,mov:`video`,mp3:`audio`,wav:`audio`,ogg:`audio`,m4a:`audio`,flac:`audio`,txt:`text`,csv:`text`,json:`text`,woff:`font`,woff2:`font`,ttf:`font`,otf:`font`,glb:`model`},ye=U.map(e=>`.${e}`).join(`,`),X=8e3,Z=e=>{let t=e.lastIndexOf(`.`);return t<=0?``:e.slice(t+1).toLowerCase()},Q=(e,t)=>new Promise((n,r)=>{let i=new FileReader;i.onload=()=>n(String(i.result)),i.onerror=()=>r(i.error??Error(`read failed`)),t===`text`?i.readAsText(e):i.readAsDataURL(e)});function be(){let{session:t}=C(),i=new URLSearchParams(window.location.search).get(`parent_id`),o,[c,m]=n(null),[g,_]=n(``),[y,x]=n(!1),[w,k]=n(``),[A,j]=n(null),[M,N]=n(!1),[P,F]=n(!1);e(()=>{let e=c()?.url;e&&r(()=>URL.revokeObjectURL(e))});let I=async e=>{if(k(``),j(null),N(!1),!q(e.name)){let t=Z(e.name);k(`${t?`.${t} files are`:`That file is`} not accepted. Accepted: ${U.join(`, `)}.`);return}let t=ve[Z(e.name)]??`other`,n=t===`text`?await Q(e.slice(0,X),`text`).catch(()=>null):null;m({file:e,url:URL.createObjectURL(e),kind:t,text:n}),_(e.name.replace(/\.[^.]+$/,``))},L=async()=>{let e=c();if(!(!e||y())){x(!0),k(``);try{let t=await Q(e.file,`dataUrl`),n=t.slice(t.indexOf(`,`)+1),r=G(e.file.name)??e.file.type??`application/octet-stream`,a=q(e.file.name),o=a===`image`?{image:`data:${r};base64,${n}`}:a===`pdf`?{pdf:`data:application/pdf;base64,${n}`}:{file:{filename:e.file.name,contentType:r,base64:n}},s=await fetch(`/api/my/artifacts`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...o,title:g().trim()||e.file.name,parent_id:i})}).catch(()=>null);if(!s){k(`Upload failed. Check your connection and try again.`);return}let c=await s.json().catch(()=>({}));if(!s.ok||!c.id){k(s.status===413?`That file is too large${c.maxBytes?` (the limit is ${D(c.maxBytes)})`:``}.`:c.details?.[0]??(s.status===403?`You have reached your limit.`:`Could not upload that file.`));return}j({id:c.id})}finally{x(!1)}}},R=()=>{m(null),_(``),j(null),k(``),N(!1)},z=e=>{e.preventDefault(),F(!1);let t=e.dataTransfer?.files?.[0];t&&I(t)};return a(s,{get when(){return h(()=>!t()?.user)()&&t()},get fallback(){return(()=>{var e=Y(),t=e.firstChild,n=t.firstChild,r=n.firstChild;p(e,a(O,{icon:b,eyebrow:`Asset upload`,title:`Upload a file`,link:{href:`/assets`,label:`Back to assets`,text:`all assets`}}),t),r.addEventListener(`change`,e=>{let t=e.currentTarget.files?.[0];e.currentTarget.value=``,t&&I(t)});var i=o;return typeof i==`function`?f(i,r):o=r,d(r,`accept`,ye),p(n,a(s,{get when(){return c()},get fallback(){return(()=>{var e=ie(),t=e.firstChild;return e.addEventListener(`drop`,z),e.addEventListener(`dragleave`,()=>F(!1)),e.addEventListener(`dragover`,e=>{e.preventDefault(),F(!0)}),e.$$click=()=>o.click(),p(e,a(b,{"aria-hidden":`true`,size:24,strokeWidth:1.6,class:`text-accent`}),t),u(()=>l(e,`flex h-56 w-full cursor-pointer flex-col items-center justify-center gap-2 rounded-lg border border-dashed transition-colors ${P()?`border-accent bg-accent-soft`:`border-edge-bright bg-raised/40 hover:border-accent`}`)),e})()},children:e=>[(()=>{var t=oe(),n=t.firstChild,r=n.nextSibling;return p(n,()=>e().file.name),p(r,()=>D(e().file.size)),p(t,a(s,{get when(){return!A()},get children(){var e=ae();return e.$$click=()=>o.click(),l(e,`ml-auto cursor-pointer font-mono text-xs ${T}`),e}}),null),t})(),(()=>{var t=se();return p(t,a(xe,{get picked(){return e()},get storedUrl(){return h(()=>!!A())()?`/a/${A().id}/raw`:null}})),t})(),a(s,{get when(){return A()},get fallback(){return(()=>{var t=ce(),n=t.firstChild,r=n.firstChild.nextSibling,i=n.nextSibling;return r.$$input=e=>_(e.currentTarget.value),i.$$click=()=>void L(),p(i,a(b,{"aria-hidden":`true`,size:13}),null),p(i,()=>y()?`Uploading…`:`Upload`,null),u(t=>{var n=e().file.name,a=y();return n!==t.e&&d(r,`placeholder`,t.e=n),a!==t.t&&(i.disabled=t.t=a),t},{e:void 0,t:void 0}),u(()=>r.value=g()),t})()},children:t=>(()=>{var n=le(),r=n.firstChild,i=r.firstChild,o=i.nextSibling,s=r.nextSibling.firstChild,c=s.nextSibling;c.firstChild;var l=c.nextSibling;return p(r,a(S,{"aria-hidden":`true`,size:15,class:`text-accent`}),i),p(o,()=>g().trim()||e().file.name),c.$$click=()=>{E(`ref:${t().id}`),N(!0)},p(c,()=>t().id,null),p(c,(()=>{var e=h(()=>!!M());return()=>e()?a(S,{"aria-hidden":`true`,size:12}):a(v,{"aria-hidden":`true`,size:12})})(),null),l.$$click=R,u(()=>d(s,`href`,`/a/${t().id}`)),n})()})]}),null),p(n,a(s,{get when(){return w()},get children(){var e=J();return p(e,w),e}}),null),e})()},get children(){return a(ee,{href:`/login?callbackUrl=%2Ffiles%2Fnew`})}})}function xe(e){let t=()=>e.picked.file,n=()=>e.picked.url;return a(i,{get fallback(){return a($,{get file(){return t()},get url(){return e.storedUrl??n()},note:`no preview for this type`})},get children(){return[a(_,{get when(){return e.picked.kind===`image`},get children(){var e=ue();return u(r=>{var i=n(),a=t().name;return i!==r.e&&d(e,`src`,r.e=i),a!==r.t&&d(e,`alt`,r.t=a),r},{e:void 0,t:void 0}),e}}),a(_,{get when(){return e.picked.kind===`pdf`},get children(){return a(s,{get when(){return e.storedUrl},get fallback(){return a($,{get file(){return t()},get url(){return n()},note:`previews once uploaded`})},children:e=>(()=>{var n=me();return u(r=>{var i=e(),a=t().name;return i!==r.e&&d(n,`src`,r.e=i),a!==r.t&&d(n,`title`,r.t=a),r},{e:void 0,t:void 0}),n})()})}}),a(_,{get when(){return e.picked.kind===`video`},get children(){var e=de();return u(r=>{var i=n(),a=t().name;return i!==r.e&&d(e,`src`,r.e=i),a!==r.t&&d(e,`aria-label`,r.t=a),r},{e:void 0,t:void 0}),e}}),a(_,{get when(){return e.picked.kind===`audio`},get children(){var e=fe();return u(r=>{var i=n(),a=t().name;return i!==r.e&&d(e,`src`,r.e=i),a!==r.t&&d(e,`aria-label`,r.t=a),r},{e:void 0,t:void 0}),e}}),a(_,{get when(){return e.picked.kind===`text`},get children(){var n=pe();return p(n,()=>e.picked.text??``,null),p(n,()=>e.picked.text!==null&&t().size>X?`
|
|
2
2
|
…`:``,null),u(()=>d(n,`aria-label`,`Preview of ${t().name}`)),n}}),a(_,{get when(){return e.picked.kind===`font`},get children(){return a(Se,{get file(){return t()},get name(){return t().name}})}}),a(_,{get when(){return e.picked.kind===`model`},get children(){return a(re,{get source(){return t()},get title(){return t().name}})}})]}})}function Se(t){let i=`mx-preview-${Math.random().toString(36).slice(2,8)}`,[o,l]=n(`loading`);return e(()=>{if(typeof FontFace>`u`){l(`error`);return}let e=!1,n=null;t.file.arrayBuffer().then(e=>(n=new FontFace(i,e),n.load())).then(t=>{e||(document.fonts.add(t),l(`ready`))}).catch(()=>{e||l(`error`)}),r(()=>{e=!0,n&&document.fonts.delete(n)})}),(()=>{var e=ge();return e.firstChild.nextSibling,p(e,a(s,{get when(){return o()!==`ready`},get children(){var e=he();return p(e,()=>o()===`loading`?`loading font…`:`this font could not be loaded for preview`),e}}),null),u(n=>{var r=`Font preview of ${t.name}`,a=o()===`ready`?{"font-family":`'${i}', sans-serif`}:void 0;return r!==n.e&&d(e,`aria-label`,n.e=r),n.t=c(e,a,n.t),n},{e:void 0,t:void 0}),e})()}function $(e){let t=()=>Z(e.file.name),n=()=>[`gltf`,`obj`,`fbx`,`stl`].includes(t())?A:t()===`xlsx`?P:t()===`zip`?M:I;return(()=>{var r=_e(),i=r.firstChild,o=i.nextSibling,s=o.firstChild,c=s.nextSibling,l=c.firstChild.nextSibling,f=l.nextSibling.nextSibling;f.nextSibling;var m=o.nextSibling,h=m.firstChild;return p(i,a(g,{get component(){return n()},"aria-hidden":`true`,size:26,strokeWidth:1.5})),p(s,()=>e.file.name),p(c,t,l),p(c,()=>D(e.file.size),f),p(c,()=>e.note,null),p(m,a(y,{"aria-hidden":`true`,size:13}),h),u(t=>{var n=`File summary of ${e.file.name}`,i=e.url,a=e.file.name,o=`Download ${e.file.name}`;return n!==t.e&&d(r,`aria-label`,t.e=n),i!==t.t&&d(m,`href`,t.t=i),a!==t.a&&d(m,`download`,t.a=a),o!==t.o&&d(m,`aria-label`,t.o=o),t},{e:void 0,t:void 0,a:void 0,o:void 0}),r})()}o([`click`,`input`]);export{be as FileUploadPage};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as e,M as t,O as n,R as r,T as i,a,b as o,i as s,k as c,l,o as u,p as d,s as f}from"./web-Ckpee-ZJ.js";import{n as p,t as m}from"./WorkspaceLayout-
|
|
1
|
+
import{D as e,M as t,O as n,R as r,T as i,a,b as o,i as s,k as c,l,o as u,p as d,s as f}from"./web-Ckpee-ZJ.js";import{n as p,t as m}from"./WorkspaceLayout-Qf3x5yOM.js";import{n as h}from"./Shelf-anhc5No9.js";import{U as g,Y as _,x as v}from"./solid-app-BNcsMwv4.js";import{p as y}from"./http-DEdzW08u.js";import{n as b}from"./browser-artifact-write-CG72iseh.js";import{r as x}from"./share-roles-c4EwFuyA.js";var S=d(`<input aria-label="Folder name"autofocus class="font-mono text-base leading-normal font-medium tracking-[-0.01em] text-fg w-full min-w-0 border-b border-accent bg-transparent p-0 focus:outline-none">`),C=d(`<p class="m-0 shrink-0 font-sans text-sm text-muted">`),w=d(`<header class="mb-6 border-b border-edge pb-4"><div class="flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1"><nav aria-label="Folder trail"class="flex min-w-0 flex-1 flex-wrap items-baseline gap-x-3 gap-y-1 font-mono"><a class="font-mono text-base leading-normal font-medium tracking-[-0.01em] text-fg text-muted no-underline hover:text-accent"></a><h1 aria-current=page class="m-0 min-w-0 break-words">`),T=d(`<p class="m-0 mt-1 font-sans text-sm text-muted">Move a document in from its ⋯ menu, or give your agent <code class="rounded-sm bg-raised px-1 py-0.5 font-mono text-[0.9em] text-fg">parent_id: "<!>"</code> when it publishes.`),E=d(`<div aria-label="Empty folder"class="mb-5 rounded-[6px] border border-dashed border-edge px-4 py-6"><p class="m-0 font-sans text-sm text-fg">Nothing here yet.`),D=d(`<button type=button aria-label="Rename folder"class="font-mono text-base leading-normal font-medium tracking-[-0.01em] text-fg cursor-text border-b border-transparent bg-transparent p-0 text-left hover:border-edge-bright">`),O=d(`<span class="font-mono text-base leading-normal font-medium tracking-[-0.01em] text-fg">`),k=d(`<main aria-label=Folder>`),A=d(`<span class="flex min-w-0 items-baseline gap-x-3"><a class="font-mono text-base leading-normal font-medium tracking-[-0.01em] text-fg text-muted no-underline hover:text-accent">`),j=({documents:e,folders:t})=>[e?`${e} document${e===1?``:`s`}`:``,t?`${t} folder${t===1?``:`s`}`:``].filter(Boolean).join(` and `);function M(a){let[d,A]=t(a.folder),[M,P]=t(a.workspace),[F,I]=t(!1),[L,R]=t(``),z=n(()=>d().id),B=()=>x(a.role);e(()=>{a.folder.id!==d().id&&(A(a.folder),P(a.workspace))});let V=()=>{_(),fetch(`/api/page/artifact/${d().id}`,{credentials:`same-origin`}).then(e=>e.ok?e.json():null).then(e=>{e?.folder&&A(e.folder),e?.workspace&&P(e.workspace)}).catch(()=>{})};e(()=>{let e=z(),t=new EventSource(`/a/${e}/events`);t.addEventListener(y,V),r(()=>{t.removeEventListener(y,V),t.close()})});let H=()=>{let e=L().trim();if(I(!1),!e||e===d().title)return;let t=d().id;A(t=>({...t,title:e})),_(),b(t,{title:e}).catch(()=>{})},U=()=>[(()=>{var e=w(),t=e.firstChild,n=t.firstChild,r=n.firstChild,s=r.nextSibling;return u(r,(()=>{var e=f(()=>!!(a.role!==`owner`&&a.ownerUsername));return()=>e()?`@${a.ownerUsername}`:`Home`})()),u(n,i(N,{get folder(){return d()}}),s),u(n,i(g,{size:14,"aria-hidden":`true`,class:`shrink-0 self-center text-faint`}),s),u(s,i(o,{get when(){return F()},get fallback(){return i(o,{get when(){return B()},get fallback(){return(()=>{var e=O();return u(e,()=>d().title??`Untitled folder`),e})()},get children(){var e=D();return e.$$click=()=>{R(d().title??``),I(!0)},u(e,()=>d().title??`Untitled folder`),e}})},get children(){var e=S();return e.$$keydown=e=>{e.key===`Enter`&&H(),e.key===`Escape`&&I(!1)},e.addEventListener(`blur`,H),e.$$input=e=>R(e.currentTarget.value),c(()=>e.value=L()),e}})),u(t,i(o,{get when(){return j(d().count)},get children(){var e=C();return u(e,()=>j(d().count)),e}}),null),c(()=>l(r,`href`,a.role!==`owner`&&a.ownerUsername?`/@${a.ownerUsername}`:`/`)),e})(),i(o,{get when(){return d().rows.length===0},get children(){var e=E();return e.firstChild,u(e,i(o,{get when(){return B()},get children(){var e=T(),t=e.firstChild.nextSibling,n=t.firstChild.nextSibling;return n.nextSibling,u(t,()=>d().id,n),e}}),null),e}}),i(h,{get rows(){return M()?.artifacts.map(e=>({...e,sparkline:e.sparkline??void 0}))??d().rows},get actions(){return B()?`full`:`share`},get canCreateFolders(){return f(()=>!!B())()&&!M()},get parentId(){return d().id},get scopeParentId(){return d().id},assets:!1})];return(()=>{var e=k();return u(e,i(o,{get when(){return M()},get fallback(){return U()},children:e=>i(p,{get workspace(){return e()},get parentId(){return d().id},onCreated:V,label:`Folder workspace`,get children(){return U()}})})),c(()=>s(e,`${M()?m:v} mt-8 pb-24`)),e})()}function N(e){return f(()=>e.folder.trail.map(e=>(()=>{var t=A(),n=t.firstChild;return u(t,i(g,{size:14,"aria-hidden":`true`,class:`shrink-0 self-center text-faint`}),n),u(n,()=>e.title??e.id),c(()=>l(n,`href`,e.url)),t})()))}a([`input`,`keydown`,`click`]);export{M as FolderPage};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as e,I as t,L as n,M as r,R as i,T as a,_ as o,a as s,b as c,i as l,k as u,o as d,p as f,s as p,z as m}from"./web-Ckpee-ZJ.js";import{t as h}from"./git-fork-
|
|
1
|
+
import{D as e,I as t,L as n,M as r,R as i,T as a,_ as o,a as s,b as c,i as l,k as u,o as d,p as f,s as p,z as m}from"./web-Ckpee-ZJ.js";import{t as h}from"./git-fork-CN41g1lF.js";import{A as g,M as _,p as v}from"./solid-app-BNcsMwv4.js";import{t as y}from"./ConfirmDialog-hdkXS1mg.js";function b(t){let[a,o]=r(null);return e(n([()=>t.backend,()=>t.id,()=>t.initialEditId,()=>t.initialVersion,()=>t.enabled??!0],([e,n,r,a,s])=>{if(!s||e.unavailable(`live`))return;let c=a,l=!0,u,d=null,f=!1,p=0,m,h=(e,n)=>{let r=t.isOwnFrame?.(e)??!1;if(typeof r==`boolean`){n(r);return}Promise.resolve(r).then(e=>{l&&n(e)},()=>{l&&n(!1)})},g=(e,t)=>{c=e.version,o({id:n,frame:{...e,by:e.by??t??null}})},_=()=>{!l||f||!d||(clearTimeout(m),m=void 0,f=!0,(async()=>{await t.whenIdle?.();let n=d;if(!l||!n)return;let r=await e.liveFrame();if(l){if(!r||r.version<n.version)throw Error(`frame not available yet`);p=0,r.version>=c&&g(r,n.by),d===n&&(d=null)}})().then(()=>{f=!1,_()},()=>{f=!1,l&&(m=setTimeout(_,v(p++)))}))},y=e.live({onPing:e=>{Number.isInteger(e.version)&&(e.version<c||h(e.editId,t=>{if(!(e.version<c)){if(t){c=e.version;return}(e.version!==a||e.editId!==r)&&(d&&d.version>e.version||(d=e,m!==void 0&&(p=0,clearTimeout(m),m=void 0),_()))}}))},onWake:()=>{if(l){if(d&&m!==void 0){p=0,clearTimeout(m),m=void 0,_();return}f||d||Promise.resolve(t.whenIdle?.()).then(()=>l?e.liveFrame():null).then(e=>{!l||!e||e.version<=c||d||f||h(e.editId,t=>{if(!(e.version<=c||d||f)){if(t){c=e.version;return}g(e,null)}})}).catch(()=>{})}},onData:e=>{!Array.isArray(e.datasets)||e.datasets.length===0||t.onData?.(e)},onAnnotations:()=>{t.onAnnotations&&(u?.abort(),u=new AbortController,e.listAnnotations(`open`,{signal:u.signal}).then(e=>{l&&t.onAnnotations?.(e)}).catch(()=>{}))}},t.since?{since:t.since}:void 0);i(()=>{l=!1,clearTimeout(m),u?.abort(),y()})})),()=>a()?.id===t.id&&a().frame.version>t.initialVersion?a().frame:null}var x=f(`<p>`),S=f(`<p aria-label="Datasets this fork copies"role=status class="mt-3 rounded border border-edge bg-raised px-2 py-2 text-xs text-muted">`),C=f(`<div aria-label="Fork refused"role=status class="mt-3 rounded border border-edge bg-raised px-2 py-2 text-xs text-muted"><button type=button aria-label="Dismiss fork refusal">dismiss`),w=f(`<p class=whitespace-pre-wrap>`),T=f(`<button type=button aria-label="Fork artifact"><span>fork`),E=f(`<div class=relative>`);function D(e){let t=e[0];return t?e.length===1?`Its dataset “${t.title??t.id}” will be copied too`:`Its ${e.length} datasets will be copied too`:null}var O=e=>{window.location.assign(e)};function k(e){let[t,n]=r(!1),[s,l]=r(null),[u,f]=r(null),h=!0,g=!1;i(()=>{h=!1}),m(()=>{fetch(`/api/my/artifacts/${encodeURIComponent(e.id)}/fork`,{method:`POST`,credentials:`same-origin`,headers:{"Content-Type":`application/json`},body:JSON.stringify({dry_run:!0})}).then(async e=>{if(!e.ok)return;let t=await e.json();h&&Array.isArray(t.datasets)&&l(t.datasets)}).catch(()=>{})});let v=t=>(e.navigate??O)(t);return a(y,{title:`Fork this artifact?`,get description(){return[(()=>{var t=x();return d(t,()=>`A copy of “${e.title??`this artifact`}” will be added to your artifacts. You’ll open the new copy after forking. Comments, history and sharing stay with the original.`),t})(),a(c,{get when(){return p(()=>!!s())()&&D(s())},get children(){var e=S();return d(e,()=>D(s())),e}}),a(c,{get when(){return u()},children:e=>(()=>{var t=C(),n=t.firstChild;return d(t,a(o,{get each(){return e()},children:e=>(()=>{var t=w();return d(t,e),t})()}),n),n.$$click=()=>f(null),t})()})]},action:`Fork and open copy`,confirmLabel:`Confirm fork`,cancelLabel:`Cancel fork`,get busy(){return t()},onConfirm:()=>{if(g)return;g=!0,n(!0),f(null);let t=!1;(async()=>{try{let n=await fetch(`/api/my/artifacts/${encodeURIComponent(e.id)}/fork`,{method:`POST`,credentials:`same-origin`}),r=await n.json().catch(()=>({}));if(!h)return;if(n.status===201&&r.url){t=!0;let e=new URL(r.url,location.href);v(e.pathname+e.search);return}if(n.status===401||n.status===409&&r.error===`sign_in_required`){t=!0,v(_(location,`fork`));return}f([...new Set(r.details?.length?r.details:[r.error??`could not fork (${n.status})`])])}catch{h&&f([`could not fork — try again`])}finally{!t&&h&&(g=!1,n(!1))}})()},get onCancel(){return e.onClose}})}function A(e){let[n,i]=r(!1);return(()=>{var r=E();return d(r,a(g,{content:`Fork artifact`,get children(){var t=T(),n=t.firstChild;return t.$$click=()=>i(!0),d(t,a(h,{size:14}),n),u(r=>{var i=e.variant===`bar`?`flex h-9 w-9 items-center justify-center rounded-lg text-muted hover:bg-raised`:`flex w-full items-center gap-2 rounded px-2 py-2 text-left font-mono text-xs text-muted hover:bg-raised`,a=e.variant===`bar`?`sr-only`:``;return i!==r.e&&l(t,r.e=i),a!==r.t&&l(n,r.t=a),r},{e:void 0,t:void 0}),t}}),null),d(r,a(c,{get when(){return n()},get children(){return a(k,t(e,{onClose:()=>i(!1)}))}}),null),r})()}s([`click`]);export{k as n,b as r,A as t};
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{M as e,R as t,T as n,_ as r,a as i,b as a,i as o,k as s,l as c,o as l,p as u,z as d}from"./web-Ckpee-ZJ.js";import{t as f}from"./copy-
|
|
1
|
+
import{M as e,R as t,T as n,_ as r,a as i,b as a,i as o,k as s,l as c,o as l,p as u,z as d}from"./web-Ckpee-ZJ.js";import{t as f}from"./copy-v5iTV3kk.js";import{t as p}from"./loader-circle-2p_rsu6P.js";import{A as m,B as h,L as g,R as _,W as v,y,z as b}from"./solid-app-BNcsMwv4.js";import"./src-CcX8uAQo.js";import"./default-server-CJjQV_9Y.js";import{t as x}from"./copy-text-BWnoOWaK.js";import{n as S,t as C}from"./agent-discovery-tags-DYoCR4DA.js";var w=u(`<span class=text-muted>
|
|
2
2
|
`),T=u(`<button type=button class="mt-[2px] shrink-0 cursor-pointer text-muted hover:text-fg">`),E=u(`<div><pre>`),D={sm:{box:`px-2.5 py-2`,text:`text-[11px]`,icon:12},lg:{box:`px-3.5 py-3`,text:`text-[13px] sm:text-[15px]`,icon:15}};function O(r){let i=()=>D[r.size??`sm`],[u,d]=e(!1),p=0;t(()=>clearTimeout(p));let h=async()=>{await x(r.text)&&(d(!0),clearTimeout(p),p=window.setTimeout(()=>d(!1),1600))};return(()=>{var e=E(),t=e.firstChild;return l(t,()=>r.text,null),l(t,n(a,{get when(){return r.trailer},get children(){var e=w();return e.firstChild,l(e,()=>r.trailer,null),e}}),null),l(e,n(m,{get content(){return u()?`copied!`:`copy`},get children(){var e=T();return e.$$click=()=>void h(),l(e,n(a,{get when(){return u()},get fallback(){return n(f,{get size(){return i().icon}})},get children(){return n(v,{get size(){return i().icon},class:`text-accent`})}})),s(()=>c(e,`aria-label`,r.label)),e}}),null),s(n=>{var a=`${r.class??`mt-3`} ${i().box} flex items-start gap-2 rounded-[4px] border border-code-edge bg-code`,s=`min-w-0 flex-1 font-mono ${i().text} leading-relaxed break-words whitespace-pre-wrap text-fg`;return a!==n.e&&o(e,n.e=a),s!==n.t&&o(t,n.t=s),n},{e:void 0,t:void 0}),e})()}i([`click`]);var k=u(`<span class="shrink-0 font-normal tabular-nums opacity-75">going to the artifact in <!>…`),A=u(`<button type=button aria-label="Create a live document for my agent"><span class="flex min-w-0 items-center gap-2"><span class="min-w-0 break-words">`),j=u(`<p role=alert class="mt-1.5 font-mono text-[11px] text-danger">`),M=u(`<a href=/docs-human>how it works →`),N=u(`<div class="rounded-[6px] border border-edge bg-surface px-4 py-3"><div class="flex items-baseline justify-between gap-3"><span class="font-mono text-xs text-fg">Start a live document:</span></div><div class=mt-2>`),P=u(`<div>`),F=3;function I(r){let[i,c]=e(`idle`),[u,d]=e(``),[h,g]=e(null),_=null;t(()=>{_&&clearInterval(_)});let b=async()=>{if(i()!==`working`&&i()!==`done`){c(`working`);try{let e=await fetch(`/api/start`,{method:`POST`}),t=await e.json().catch(()=>({}));if(!e.ok){c(`error`),d(t.error===`rate_limited`?`too many new documents from here — try again shortly`:`could not start a document`);return}d(typeof t.prompt==`string`&&await x(t.prompt)?`copied! paste it in the agent`:`created! copy the prompt from the document page`),c(`done`),g(F);let n=F;_=setInterval(()=>{if(n--,n>0){g(n);return}_&&clearInterval(_),_=null,window.location.assign(`/a/${t.id}`)},1e3)}catch{c(`error`),d(`could not reach the server`)}}},S=()=>i()===`working`?`creating your document…`:i()===`done`?u():`copy agent instructions`,C=[n(m,{get content(){return i()===`done`?`copied!`:`creates a live doc`},get children(){var e=A(),t=e.firstChild,c=t.firstChild;return e.$$click=()=>void b(),l(c,S),l(t,n(a,{get when(){return i()===`working`},get fallback(){return n(a,{get when(){return i()===`done`},get fallback(){return n(f,{size:13})},get children(){return n(v,{size:13})}})},get children(){return n(p,{size:13,class:`animate-spin`})}}),null),l(e,n(a,{get when(){return h()!==null},get children(){var e=k(),t=e.firstChild.nextSibling;return t.nextSibling,l(e,h,t),e}}),null),s(t=>{var n=i()===`working`,a=`flex cursor-pointer items-center rounded-[4px] border border-accent bg-accent font-semibold text-bg transition-all hover:brightness-110 disabled:opacity-60 ${h()===null?`justify-center`:`justify-between`} ${(r.size??`panel`)===`inline`?`gap-1.5 px-2.5 py-1.5 font-mono text-[11.5px]`:`w-full gap-2 px-3 py-2.5 font-mono text-[12.5px]`}`;return n!==t.e&&(e.disabled=t.e=n),a!==t.t&&o(e,t.t=a),t},{e:void 0,t:void 0}),e}}),n(a,{get when(){return i()===`error`},get children(){var e=j();return l(e,u),e}})];return n(a,{get when(){return r.frame!==!1},get fallback(){return(()=>{var e=P();return l(e,C),e})()},get children(){var e=N(),t=e.firstChild;t.firstChild;var i=t.nextSibling;return l(t,n(a,{get when(){return r.docsLink!==!1},get children(){var e=M();return o(e,`shrink-0 font-mono text-xs ${y}`),e}}),null),l(i,C),e}})}i([`click`]);var L=u(`<div><div class="flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1"><h3 class="font-mono text-[13px] font-semibold text-fg"><span class=text-accent>Step </span><span aria-hidden=true class="mx-2 font-normal text-faint">·`),R=u(`<p class="mt-2 text-xs text-muted">Windows · PowerShell`),z=u(`<div class="mb-4 flex items-baseline justify-between gap-3"><h2 class="font-mono text-[11px] tracking-[0.14em] text-muted uppercase">get started</h2><a href=/docs-human>how it works →`),B=u(`<p class="mt-3 text-xs text-muted">macOS / Linux`),V=u(`<p class="mt-2 text-xs text-muted">Run both commands in the same terminal. The first reuses supported Node/npm or installs official Node LTS for your user. The second runs afbin through npm and installs agent skills.`),H=u(`<div class="mt-2.5 flex flex-wrap items-center gap-x-2 gap-y-1.5"><span class="mr-0.5 font-sans text-[13px] text-muted">also installs skills for`),U=u(`<div class=mt-2>`),W=u(`<section aria-label="Get started"><div><div class=mt-5>`),G=u(`<code class="rounded-[3px] bg-raised px-1 py-0.5 font-mono text-[0.92em] text-fg">afbin`),K=u(`<details class=mt-3><summary class="cursor-pointer text-xs text-muted hover:text-fg">See Windows instructions`),q=u(`<span class="inline-flex items-center gap-1.5 rounded-[4px] border border-edge bg-raised px-2 py-1 font-mono text-[11px] leading-none text-fg">`),J=u(`<p class="ml-auto text-right font-sans text-[13px] leading-relaxed text-muted">Paste into your agent and watch it cook.`),Y=[{key:`claude-code`,label:`Claude Code`,icon:g,size:13},{key:`codex`,label:`Codex`,icon:_,size:15},{key:`pi`,label:`pi`,icon:h,size:16},{key:`opencode`,label:`OpenCode`,icon:b,size:13}];function X(e){return(()=>{var t=L(),n=t.firstChild,r=n.firstChild,i=r.firstChild;return i.firstChild,i.nextSibling,l(i,()=>e.n,null),l(r,()=>e.title,null),l(n,()=>e.aside,null),l(t,()=>e.children,null),t})()}function Z(t){let[i,c]=e(``),[u,f]=e(!1);d(()=>{c(window.location.origin),f(/^Win/i.test(window.navigator.platform))});let p=()=>i()||`https://app.artifactbin.dev`,m=n(O,{class:`mt-2`,get text(){return C(p())},label:`Copy the CLI install command`}),h=[R(),n(O,{class:`mt-2`,get text(){return S(p())},label:`Copy the Windows CLI install command`})];return(()=>{var e=W(),i=e.firstChild,c=i.firstChild;return l(i,n(a,{get when(){return t.heading!==!1},get children(){var e=z(),t=e.firstChild.nextSibling;return o(t,`font-mono text-[11px] ${y}`),e}}),c),l(i,n(X,{n:1,get title(){return[`Prepare Node and run `,G()]},get children(){return[n(a,{get when(){return u()},get fallback(){return[m,(()=>{var e=K();return e.firstChild,l(e,h,null),e})()]},get children(){return[h,B(),m]}}),V(),(()=>{var e=H();return e.firstChild,l(e,n(r,{each:Y,children:e=>(()=>{var t=q();return l(t,n(e.icon,{get size(){return e.size}}),null),l(t,()=>e.label,null),t})()}),null),e})()]}}),c),l(c,n(X,{n:2,title:`Copy the instructions`,get aside(){return J()},get children(){var e=U();return l(e,n(I,{frame:!1,docsLink:!1})),e}})),s(()=>o(i,t.frame===!1?void 0:`rounded-[6px] border border-edge bg-surface px-4 py-4 sm:px-5`)),e})()}export{Z as t};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as e,M as t,O as n,R as r,T as i,_ as a,a as o,b as s,i as c,k as l,l as u,o as d,p as f,r as p,s as m,z as h}from"./web-Ckpee-ZJ.js";import{n as g,r as _,t as v}from"./WorkspaceLayout-fF_ot7EK.js";import{n as y}from"./ShareLink-n8KhtnaI.js";import{n as b}from"./Shelf-BgwHOaeW.js";import{C as x,D as S,J as C,K as w,S as T,Z as E,_ as D,b as O,ct as k,g as A,l as j,q as M,w as N,x as P,y as F}from"./solid-app-BtmRR9Ax.js";import{t as I}from"./sharing-X_H561x5.js";import{t as L}from"./ConfirmDialog-Ph1VDgNN.js";import{t as R}from"./share-roles-c4EwFuyA.js";import{t as z}from"./GetStarted-YjltMEeN.js";var B=f(`<p class="font-sans text-sm text-fg">Made from this browser before you signed in — add to your account?`),V=f(`<ul class="mt-3 flex flex-col gap-1.5">`),H=f(`<div class=mt-3>`),U=f(`<p aria-label="Claim result"class="mt-2 font-mono text-[11px] text-muted">`),W=f(`<section aria-label="Unclaimed drafts">`),G=f(`<li class="flex items-start gap-2"><input type=checkbox class="mt-0.5 cursor-pointer"><span class="min-w-0 flex-1 font-mono text-xs text-muted">`);function K(){let[e,n]=t([]),[o,f]=t({}),[p,m]=t(!1),[g,_]=t(null),[v,y]=t(!1),[b,x]=t(``),[S,w]=t(null);h(()=>{let e=!0;fetch(`/api/tokens/claimable`,{method:`POST`}).then(e=>e.ok?e.json():null).then(t=>{!e||!t?.claimable?.length||(n(t.claimable),f(Object.fromEntries(t.claimable.map(e=>[e.tokenId,!0]))))}).catch(()=>{}),r(()=>{e=!1})});let E=async()=>{let t=e().filter(e=>o()[e.tokenId]);if(!t.length)return;m(!0);let r=await Promise.all(t.map(async e=>({offer:e,ok:!!(await j(`/api/tokens/claim`,`POST`,{tokenId:e.tokenId}).catch(()=>null))?.ok}))),i=r.filter(e=>e.ok).length,a=r.length-i;m(!1),w(a?`Added ${i}. ${a} could not be added — they may have been revoked.`:`Added ${i} to your account.`),n(e=>e.filter(e=>!r.some(t=>t.ok&&t.offer.tokenId===e.tokenId))),i&&window.dispatchEvent(new Event(C))},D=async()=>{let e=g();if(!e)return;y(!0),x(``);let t=await j(`/api/tokens/reject`,`POST`,{tokenId:e}).catch(()=>null);if(y(!1),!t?.ok){x(`Could not reject these drafts. Try again.`);return}n(t=>t.filter(t=>t.tokenId!==e)),f(t=>{let n={...t};return delete n[e],n}),w(null),_(null)};return i(s,{get when(){return e().length||S()},get children(){var t=W();return c(t,`${T} mb-6 p-4`),d(t,i(s,{get when(){return e().length},get children(){return[B(),(()=>{var t=V();return d(t,i(a,{get each(){return e()},children:e=>{let t=e.titles.length?e.titles.join(`, `):`an unsaved session from this browser`,n=e.artifacts-e.titles.length;return(()=>{var r=G(),a=r.firstChild,s=a.nextSibling;return a.addEventListener(`change`,t=>f(n=>({...n,[e.tokenId]:t.currentTarget.checked}))),d(s,t,null),d(s,n>0?` +${n} more`:``,null),d(r,i(A,{type:`button`,variant:`danger`,get"aria-label"(){return`Reject ${e.tokenId}`},get disabled(){return p()},onClick:()=>_(e.tokenId),class:`shrink-0 px-2 py-1`,children:`reject`}),null),l(()=>u(a,`aria-label`,`Claim ${e.titles[0]??`this session`}`)),l(()=>a.checked=!!o()[e.tokenId]),r})()}})),t})(),(()=>{var e=H();return d(e,i(A,{type:`button`,"aria-label":`Add to my account`,get disabled(){return p()},onClick:()=>void E(),get children(){return p()?`adding…`:`add to my account`}})),e})()]}}),null),d(t,i(s,{get when(){return S()},get children(){var e=U();return d(e,S),e}}),null),d(t,i(s,{get when(){return g()},children:t=>i(L,{title:`Reject these drafts?`,get description(){return`Reject ${e().find(e=>e.tokenId===t())?.titles.join(`, `)||`this session`}? This browser’s token will be permanently revoked and cannot be recovered.`},action:`Reject drafts`,confirmLabel:`Confirm reject`,danger:!0,get busy(){return v()},get error(){return b()},onCancel:()=>{_(null),x(``)},onConfirm:()=>void D()})}),null),t}})}var q=f(`<span class="flex shrink-0 flex-wrap items-center gap-1.5 border-edge sm:ml-auto sm:border-l sm:pl-2">`),J=f(`<span class="shrink-0 border-l border-edge pl-2 font-mono text-[10px] text-faint">/`),Y=f(`<tr><td colspan=5 class="px-4 py-6 text-center text-faint">`),X=f(`<section aria-label="Shared with you"class=mt-8><div class=mb-2></div><div><div class="flex flex-wrap items-center gap-2 border-b border-edge px-4 py-2"><input aria-label="Search shared artifacts"placeholder="search shared artifacts"class="min-w-32 flex-1 border-0 bg-transparent font-mono text-xs text-fg placeholder:text-faint focus:outline-none"></div><div class=overflow-x-auto><table class="w-full text-left font-mono text-xs"><tbody>`),Z=f(`<button type=button class="rounded-full border border-edge px-2 py-0.5 font-mono text-[10px]">`),ee=f(`<tr><td class="px-3 py-2"><a></a></td><td class="px-3 py-2 text-muted"></td><td class="px-3 py-2 text-muted"></td><td class="px-3 py-2"></td><td class="px-3 py-2 text-right whitespace-nowrap text-muted">`),Q=[`markup`,`dataset`,`viz`,`image`,`pdf`];function te(e){let[r,o]=t(``),[f,p]=t([]),[h,g]=t([]),_=(e,t)=>{(e===`format`?p:g)(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},v=n(()=>{let t=new Set(e.items.map(e=>e.format??`markup`));return[...Q.filter(e=>t.has(e)),...[...t].filter(e=>!Q.includes(e))]}),y=n(()=>I.filter(t=>e.items.some(e=>e.role===t))),b=()=>(e.query??``).trim().toLowerCase(),C=()=>r().trim().toLowerCase(),w=()=>!!(b()||C()||f().length||h().length),E=n(()=>e.items.filter(e=>{let t=e.format??`markup`,n=[e.title,e.description,e.id,e.owner_username?`@${e.owner_username}`:null,N(t),R[e.role]].filter(Boolean).join(` `).toLowerCase();return(!b()||n.includes(b()))&&(!C()||n.includes(C()))&&(!f().length||f().includes(t))&&(!h().length||h().includes(e.role))}));return i(s,{get when(){return e.items.length},get children(){var t=X(),n=t.firstChild,p=n.nextSibling,g=p.firstChild,k=g.firstChild,A=g.nextSibling.firstChild.firstChild;return d(n,i(O,{children:`shared with you`})),c(p,T),k.$$input=e=>o(e.currentTarget.value),d(g,i(s,{get when(){return v().length>=2||y().length>=2},get children(){var e=q();return d(e,i(s,{get when(){return v().length>=2},get children(){return i(a,{get each(){return v()},children:e=>(()=>{var t=Z();return t.$$click=()=>_(`format`,e),u(t,`aria-label`,`Filter ${e}`),d(t,()=>N(e)),l(()=>u(t,`aria-pressed`,f().includes(e))),t})()})}}),null),d(e,i(s,{get when(){return y().length>=2},get children(){return i(a,{get each(){return y()},children:e=>(()=>{var t=Z();return t.$$click=()=>_(`role`,e),u(t,`aria-label`,`Filter ${e}`),d(t,()=>R[e]),l(()=>u(t,`aria-pressed`,h().includes(e))),t})()})}}),null),e}}),null),d(g,i(s,{get when(){return w()},get children(){var t=J(),n=t.firstChild;return d(t,()=>E().length,n),d(t,()=>e.items.length,null),t}}),null),d(A,i(s,{get when(){return E().length===0},get children(){var t=Y(),n=t.firstChild;return c(t,x),d(n,(()=>{var t=m(()=>!!C());return()=>t()?[`nothing matches “`,m(()=>r().trim()),`”`]:m(()=>!!b())()?[`nothing matches “`,m(()=>(e.query??``).trim()),`”`]:`nothing matches the active filters`})()),t}}),null),d(A,i(a,{get each(){return E()},children:e=>(()=>{var t=ee(),n=t.firstChild,r=n.firstChild,a=n.nextSibling,o=a.nextSibling,s=o.nextSibling,f=s.nextSibling;return c(t,x),c(r,F),d(r,()=>e.title||e.id),d(a,(()=>{var t=m(()=>!!e.owner_username);return()=>t()?`@${e.owner_username}`:``})()),d(o,()=>R[e.role]),d(s,i(D,{get format(){return e.format}})),d(f,()=>S(e.updated_at)),l(t=>{var n=`/a/${e.id}`,i=`Open shared artifact ${e.id}`,a=`Your role on ${e.id}`;return n!==t.e&&u(r,`href`,t.e=n),i!==t.t&&u(r,`aria-label`,t.t=i),a!==t.a&&u(o,`aria-label`,t.a=a),t},{e:void 0,t:void 0,a:void 0}),t})()}),null),l(()=>k.value=r()),t}})}o([`input`,`click`]);var ne=f(`<div role=alert><p>Could not load your workspace.</p><button type=button aria-label="Retry workspace">Try again`),$=f(`<main>`),re=f(`<div class="mb-8 sm:mb-10"><h1 class="font-serif text-[clamp(1.6rem,3.4vw,2.25rem)] leading-[1.15] font-medium tracking-[-0.01em] text-fg"></h1><p class="mt-1.5 font-sans text-sm text-muted">Hand an agent the instruction below along with what artifact you want, and follow along.`),ie=f(`<div class=mb-6>`),ae=f(`<div role=alert>Could not refresh your workspace. <button type=button aria-label="Retry workspace">Try again`),oe=f(`<div class="mb-4 flex justify-end"><a href=/datasets/new aria-label="Create dataset"class="inline-flex items-center gap-1.5 rounded border border-edge-bright px-3 py-1.5 font-mono text-xs text-accent">Create dataset`),se=f(`<p class=mt-8><a href=/trash aria-label=Trash class="font-mono text-[10px] text-faint">trash`);function ce(){let{session:r,sessionError:a,reload:o}=M(),[f,x]=t(``),S=w(`/api/page/home?part=core`),C=w(`/api/page/home?part=insights`,{enabled:()=>!!S.data()?.signedIn});e(()=>{a()&&(S.invalidate(),C.invalidate())});let T=()=>{S.refresh(!0),C.refresh(!0)},D=n(()=>{let e=r(),t=S.data(),n=C.data();return!!(t?.signedIn&&t.accountId!==e?.user?.id)||!!(n&&(!n.signedIn||n.accountId!==e?.user?.id))}),O=()=>D()?null:S.data(),A=()=>{let e=O();return e?.signedIn?e:null},j=()=>D()?null:C.data(),N=()=>!!(A()&&A().artifacts.length===0&&A().shared.length===0&&!j()?.stats?.assets),F=()=>D()||!!S.error(),I=()=>{let e=r()?.user?.email?.split(`@`)[0]??``;return`${e?`hi ${e}, l`:`l`}et’s create your first artifact!`};return h(k),i(s,{get when(){return m(()=>!(r()&&r().kind!==`account`))()&&!(O()&&!O().signedIn)},get fallback(){return i(E,{href:`/login`})},get children(){return i(s,{get when(){return A()},get fallback(){return(()=>{var e=$();return c(e,`${v} mt-8 pb-24`),d(e,i(s,{get when(){return F()},get fallback(){return i(_,{})},get children(){var e=ne(),t=e.firstChild.nextSibling;return p(t,`click`,r()?T:o,!0),e}})),e})()},children:e=>(()=>{var t=$();return d(t,i(s,{get when(){return N()},get children(){return[(()=>{var e=re(),t=e.firstChild;return d(t,I),l(()=>u(t,`aria-label`,I())),e})(),(()=>{var e=ie();return d(e,i(z,{})),e})()]}}),null),d(t,i(K,{}),null),d(t,i(s,{get when(){return F()},get children(){var e=ae(),t=e.firstChild.nextSibling;return t.$$click=T,e}}),null),d(t,i(s,{get when(){return N()},get children(){return[(()=>{var e=oe(),t=e.firstChild,n=t.firstChild;return d(t,i(y,{size:13}),n),e})(),se()]}}),null),d(t,i(s,{get when(){return!N()},get children(){return i(g,{get workspace(){return e()},get insights(){return j()},get insightsError(){return!!C.error()},onCreated:T,get children(){return[i(s,{get when(){return e().artifacts.length},get children(){return i(b,{get rows(){return e().artifacts},actions:`full`,assets:!1,scopeParentId:null,onQuery:x})}}),i(te,{get items(){return e().shared},get query(){return f()}})]}})}}),null),l(()=>c(t,`${N()?P:v} mt-8 pb-24`)),t})()})}})}o([`click`]);export{ce as HomePage};
|
|
1
|
+
import{D as e,M as t,O as n,R as r,T as i,_ as a,a as o,b as s,i as c,k as l,l as u,o as d,p as f,r as p,s as m,z as h}from"./web-Ckpee-ZJ.js";import{n as g,r as _,t as v}from"./WorkspaceLayout-Qf3x5yOM.js";import{n as y}from"./ShareLink-qbYss_Eh.js";import{n as b}from"./Shelf-anhc5No9.js";import{C as x,D as S,J as C,K as w,S as T,Z as E,_ as D,b as O,ct as k,g as A,l as j,q as M,w as N,x as P,y as F}from"./solid-app-BNcsMwv4.js";import{t as I}from"./sharing-X_H561x5.js";import{t as L}from"./ConfirmDialog-hdkXS1mg.js";import{t as R}from"./share-roles-c4EwFuyA.js";import{t as z}from"./GetStarted-CFsSvXR0.js";var B=f(`<p class="font-sans text-sm text-fg">Made from this browser before you signed in — add to your account?`),V=f(`<ul class="mt-3 flex flex-col gap-1.5">`),H=f(`<div class=mt-3>`),U=f(`<p aria-label="Claim result"class="mt-2 font-mono text-[11px] text-muted">`),W=f(`<section aria-label="Unclaimed drafts">`),G=f(`<li class="flex items-start gap-2"><input type=checkbox class="mt-0.5 cursor-pointer"><span class="min-w-0 flex-1 font-mono text-xs text-muted">`);function K(){let[e,n]=t([]),[o,f]=t({}),[p,m]=t(!1),[g,_]=t(null),[v,y]=t(!1),[b,x]=t(``),[S,w]=t(null);h(()=>{let e=!0;fetch(`/api/tokens/claimable`,{method:`POST`}).then(e=>e.ok?e.json():null).then(t=>{!e||!t?.claimable?.length||(n(t.claimable),f(Object.fromEntries(t.claimable.map(e=>[e.tokenId,!0]))))}).catch(()=>{}),r(()=>{e=!1})});let E=async()=>{let t=e().filter(e=>o()[e.tokenId]);if(!t.length)return;m(!0);let r=await Promise.all(t.map(async e=>({offer:e,ok:!!(await j(`/api/tokens/claim`,`POST`,{tokenId:e.tokenId}).catch(()=>null))?.ok}))),i=r.filter(e=>e.ok).length,a=r.length-i;m(!1),w(a?`Added ${i}. ${a} could not be added — they may have been revoked.`:`Added ${i} to your account.`),n(e=>e.filter(e=>!r.some(t=>t.ok&&t.offer.tokenId===e.tokenId))),i&&window.dispatchEvent(new Event(C))},D=async()=>{let e=g();if(!e)return;y(!0),x(``);let t=await j(`/api/tokens/reject`,`POST`,{tokenId:e}).catch(()=>null);if(y(!1),!t?.ok){x(`Could not reject these drafts. Try again.`);return}n(t=>t.filter(t=>t.tokenId!==e)),f(t=>{let n={...t};return delete n[e],n}),w(null),_(null)};return i(s,{get when(){return e().length||S()},get children(){var t=W();return c(t,`${T} mb-6 p-4`),d(t,i(s,{get when(){return e().length},get children(){return[B(),(()=>{var t=V();return d(t,i(a,{get each(){return e()},children:e=>{let t=e.titles.length?e.titles.join(`, `):`an unsaved session from this browser`,n=e.artifacts-e.titles.length;return(()=>{var r=G(),a=r.firstChild,s=a.nextSibling;return a.addEventListener(`change`,t=>f(n=>({...n,[e.tokenId]:t.currentTarget.checked}))),d(s,t,null),d(s,n>0?` +${n} more`:``,null),d(r,i(A,{type:`button`,variant:`danger`,get"aria-label"(){return`Reject ${e.tokenId}`},get disabled(){return p()},onClick:()=>_(e.tokenId),class:`shrink-0 px-2 py-1`,children:`reject`}),null),l(()=>u(a,`aria-label`,`Claim ${e.titles[0]??`this session`}`)),l(()=>a.checked=!!o()[e.tokenId]),r})()}})),t})(),(()=>{var e=H();return d(e,i(A,{type:`button`,"aria-label":`Add to my account`,get disabled(){return p()},onClick:()=>void E(),get children(){return p()?`adding…`:`add to my account`}})),e})()]}}),null),d(t,i(s,{get when(){return S()},get children(){var e=U();return d(e,S),e}}),null),d(t,i(s,{get when(){return g()},children:t=>i(L,{title:`Reject these drafts?`,get description(){return`Reject ${e().find(e=>e.tokenId===t())?.titles.join(`, `)||`this session`}? This browser’s token will be permanently revoked and cannot be recovered.`},action:`Reject drafts`,confirmLabel:`Confirm reject`,danger:!0,get busy(){return v()},get error(){return b()},onCancel:()=>{_(null),x(``)},onConfirm:()=>void D()})}),null),t}})}var q=f(`<span class="flex shrink-0 flex-wrap items-center gap-1.5 border-edge sm:ml-auto sm:border-l sm:pl-2">`),J=f(`<span class="shrink-0 border-l border-edge pl-2 font-mono text-[10px] text-faint">/`),Y=f(`<tr><td colspan=5 class="px-4 py-6 text-center text-faint">`),X=f(`<section aria-label="Shared with you"class=mt-8><div class=mb-2></div><div><div class="flex flex-wrap items-center gap-2 border-b border-edge px-4 py-2"><input aria-label="Search shared artifacts"placeholder="search shared artifacts"class="min-w-32 flex-1 border-0 bg-transparent font-mono text-xs text-fg placeholder:text-faint focus:outline-none"></div><div class=overflow-x-auto><table class="w-full text-left font-mono text-xs"><tbody>`),Z=f(`<button type=button class="rounded-full border border-edge px-2 py-0.5 font-mono text-[10px]">`),ee=f(`<tr><td class="px-3 py-2"><a></a></td><td class="px-3 py-2 text-muted"></td><td class="px-3 py-2 text-muted"></td><td class="px-3 py-2"></td><td class="px-3 py-2 text-right whitespace-nowrap text-muted">`),Q=[`markup`,`dataset`,`viz`,`image`,`pdf`];function te(e){let[r,o]=t(``),[f,p]=t([]),[h,g]=t([]),_=(e,t)=>{(e===`format`?p:g)(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},v=n(()=>{let t=new Set(e.items.map(e=>e.format??`markup`));return[...Q.filter(e=>t.has(e)),...[...t].filter(e=>!Q.includes(e))]}),y=n(()=>I.filter(t=>e.items.some(e=>e.role===t))),b=()=>(e.query??``).trim().toLowerCase(),C=()=>r().trim().toLowerCase(),w=()=>!!(b()||C()||f().length||h().length),E=n(()=>e.items.filter(e=>{let t=e.format??`markup`,n=[e.title,e.description,e.id,e.owner_username?`@${e.owner_username}`:null,N(t),R[e.role]].filter(Boolean).join(` `).toLowerCase();return(!b()||n.includes(b()))&&(!C()||n.includes(C()))&&(!f().length||f().includes(t))&&(!h().length||h().includes(e.role))}));return i(s,{get when(){return e.items.length},get children(){var t=X(),n=t.firstChild,p=n.nextSibling,g=p.firstChild,k=g.firstChild,A=g.nextSibling.firstChild.firstChild;return d(n,i(O,{children:`shared with you`})),c(p,T),k.$$input=e=>o(e.currentTarget.value),d(g,i(s,{get when(){return v().length>=2||y().length>=2},get children(){var e=q();return d(e,i(s,{get when(){return v().length>=2},get children(){return i(a,{get each(){return v()},children:e=>(()=>{var t=Z();return t.$$click=()=>_(`format`,e),u(t,`aria-label`,`Filter ${e}`),d(t,()=>N(e)),l(()=>u(t,`aria-pressed`,f().includes(e))),t})()})}}),null),d(e,i(s,{get when(){return y().length>=2},get children(){return i(a,{get each(){return y()},children:e=>(()=>{var t=Z();return t.$$click=()=>_(`role`,e),u(t,`aria-label`,`Filter ${e}`),d(t,()=>R[e]),l(()=>u(t,`aria-pressed`,h().includes(e))),t})()})}}),null),e}}),null),d(g,i(s,{get when(){return w()},get children(){var t=J(),n=t.firstChild;return d(t,()=>E().length,n),d(t,()=>e.items.length,null),t}}),null),d(A,i(s,{get when(){return E().length===0},get children(){var t=Y(),n=t.firstChild;return c(t,x),d(n,(()=>{var t=m(()=>!!C());return()=>t()?[`nothing matches “`,m(()=>r().trim()),`”`]:m(()=>!!b())()?[`nothing matches “`,m(()=>(e.query??``).trim()),`”`]:`nothing matches the active filters`})()),t}}),null),d(A,i(a,{get each(){return E()},children:e=>(()=>{var t=ee(),n=t.firstChild,r=n.firstChild,a=n.nextSibling,o=a.nextSibling,s=o.nextSibling,f=s.nextSibling;return c(t,x),c(r,F),d(r,()=>e.title||e.id),d(a,(()=>{var t=m(()=>!!e.owner_username);return()=>t()?`@${e.owner_username}`:``})()),d(o,()=>R[e.role]),d(s,i(D,{get format(){return e.format}})),d(f,()=>S(e.updated_at)),l(t=>{var n=`/a/${e.id}`,i=`Open shared artifact ${e.id}`,a=`Your role on ${e.id}`;return n!==t.e&&u(r,`href`,t.e=n),i!==t.t&&u(r,`aria-label`,t.t=i),a!==t.a&&u(o,`aria-label`,t.a=a),t},{e:void 0,t:void 0,a:void 0}),t})()}),null),l(()=>k.value=r()),t}})}o([`input`,`click`]);var ne=f(`<div role=alert><p>Could not load your workspace.</p><button type=button aria-label="Retry workspace">Try again`),$=f(`<main>`),re=f(`<div class="mb-8 sm:mb-10"><h1 class="font-serif text-[clamp(1.6rem,3.4vw,2.25rem)] leading-[1.15] font-medium tracking-[-0.01em] text-fg"></h1><p class="mt-1.5 font-sans text-sm text-muted">Hand an agent the instruction below along with what artifact you want, and follow along.`),ie=f(`<div class=mb-6>`),ae=f(`<div role=alert>Could not refresh your workspace. <button type=button aria-label="Retry workspace">Try again`),oe=f(`<div class="mb-4 flex justify-end"><a href=/datasets/new aria-label="Create dataset"class="inline-flex items-center gap-1.5 rounded border border-edge-bright px-3 py-1.5 font-mono text-xs text-accent">Create dataset`),se=f(`<p class=mt-8><a href=/trash aria-label=Trash class="font-mono text-[10px] text-faint">trash`);function ce(){let{session:r,sessionError:a,reload:o}=M(),[f,x]=t(``),S=w(`/api/page/home?part=core`),C=w(`/api/page/home?part=insights`,{enabled:()=>!!S.data()?.signedIn});e(()=>{a()&&(S.invalidate(),C.invalidate())});let T=()=>{S.refresh(!0),C.refresh(!0)},D=n(()=>{let e=r(),t=S.data(),n=C.data();return!!(t?.signedIn&&t.accountId!==e?.user?.id)||!!(n&&(!n.signedIn||n.accountId!==e?.user?.id))}),O=()=>D()?null:S.data(),A=()=>{let e=O();return e?.signedIn?e:null},j=()=>D()?null:C.data(),N=()=>!!(A()&&A().artifacts.length===0&&A().shared.length===0&&!j()?.stats?.assets),F=()=>D()||!!S.error(),I=()=>{let e=r()?.user?.email?.split(`@`)[0]??``;return`${e?`hi ${e}, l`:`l`}et’s create your first artifact!`};return h(k),i(s,{get when(){return m(()=>!(r()&&r().kind!==`account`))()&&!(O()&&!O().signedIn)},get fallback(){return i(E,{href:`/login`})},get children(){return i(s,{get when(){return A()},get fallback(){return(()=>{var e=$();return c(e,`${v} mt-8 pb-24`),d(e,i(s,{get when(){return F()},get fallback(){return i(_,{})},get children(){var e=ne(),t=e.firstChild.nextSibling;return p(t,`click`,r()?T:o,!0),e}})),e})()},children:e=>(()=>{var t=$();return d(t,i(s,{get when(){return N()},get children(){return[(()=>{var e=re(),t=e.firstChild;return d(t,I),l(()=>u(t,`aria-label`,I())),e})(),(()=>{var e=ie();return d(e,i(z,{})),e})()]}}),null),d(t,i(K,{}),null),d(t,i(s,{get when(){return F()},get children(){var e=ae(),t=e.firstChild.nextSibling;return t.$$click=T,e}}),null),d(t,i(s,{get when(){return N()},get children(){return[(()=>{var e=oe(),t=e.firstChild,n=t.firstChild;return d(t,i(y,{size:13}),n),e})(),se()]}}),null),d(t,i(s,{get when(){return!N()},get children(){return i(g,{get workspace(){return e()},get insights(){return j()},get insightsError(){return!!C.error()},onCreated:T,get children(){return[i(s,{get when(){return e().artifacts.length},get children(){return i(b,{get rows(){return e().artifacts},actions:`full`,assets:!1,scopeParentId:null,onQuery:x})}}),i(te,{get items(){return e().shared},get query(){return f()}})]}})}}),null),l(()=>c(t,`${N()?P:v} mt-8 pb-24`)),t})()})}})}o([`click`]);export{ce as HomePage};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as e,M as t,T as n,a as r,b as i,k as a,o,p as s,s as c}from"./web-Ckpee-ZJ.js";import{l,q as u}from"./solid-app-
|
|
1
|
+
import{D as e,M as t,T as n,a as r,b as i,k as a,o,p as s,s as c}from"./web-Ckpee-ZJ.js";import{l,q as u}from"./solid-app-BNcsMwv4.js";import{n as d,t as f}from"./safe-redirect-C0PCIKoE.js";var p=s(`<p class="mt-2 text-xs text-muted">We’ll email you a 6-digit code. No password to remember.`),m=s(`<form class="mt-5 flex flex-col gap-3"><input type=email autofocus autocomplete=email aria-label=Email placeholder=email class="w-full rounded-[4px] border border-edge bg-surface px-3 py-1.5 font-mono text-sm text-fg placeholder:text-faint focus:border-accent focus:outline-none"><button type=submit aria-label="Log in with email"class="cursor-pointer rounded-[4px] border border-accent bg-accent px-3 py-1.5 font-mono text-xs font-semibold text-bg transition-colors hover:brightness-110 disabled:opacity-50">`),h=s(`<p class="mt-10 text-xs text-muted"><b>Note:</b> Your guest artifacts and connected agents will join this account.`),g=s(`<p class="mt-3 text-xs text-danger">`),_=s(`<main class="mx-auto mt-16 max-w-xl px-6"><div class="mx-auto max-w-sm"><h1 class="text-base font-semibold"><span class=text-accent>></span> log in`),v=s(`<p class="mt-2 text-xs text-muted">We emailed a code to <span class=text-fg></span>. It expires in 10 minutes.`),y=s(`<form class="mt-5 flex flex-col gap-3"><input type=text autofocus inputmode=numeric autocomplete=one-time-code maxlength=6 aria-label="Login code"placeholder="6-digit code"class="w-full rounded-[4px] border border-edge bg-surface px-3 py-1.5 font-mono text-sm text-fg placeholder:text-faint focus:border-accent focus:outline-none"><button type=submit aria-label="Verify code"class="cursor-pointer rounded-[4px] border border-accent bg-accent px-3 py-1.5 font-mono text-xs font-semibold text-bg transition-colors hover:brightness-110 disabled:opacity-50">`),b=s(`<div class="mt-4 flex items-center justify-between text-xs text-muted"><button type=button aria-label="Change email"class="cursor-pointer underline hover:text-accent">change email</button><button type=button aria-label="Resend code"class="cursor-pointer underline hover:text-accent">resend code`);function x(){let{session:r,sessionError:s}=u(),[x,S]=t(``),[C,w]=t(``),[T,E]=t(!1),[D,O]=t(!1),[k,A]=t(null);e(()=>{r()?.user&&window.location.replace(d(new URLSearchParams(window.location.search).get(`callbackUrl`),window.location.origin))});let j=async()=>{O(!0),A(null);try{let e=await l(`/api/auth/email-otp/send-verification-otp`,`POST`,{email:x(),type:`sign-in`});if(e.ok)E(!0),w(``);else{let t=await e.json().catch(()=>({}));A(t.error===`rate_limited`?`Too many codes requested. Try again in a bit.`:`That email address doesn’t look right.`)}}catch{A(`Couldn’t reach the server. Try again.`)}finally{O(!1)}},M=async()=>{O(!0),A(null);let e=await l(`/api/auth/sign-in/email-otp`,`POST`,{email:x(),otp:C()}).catch(()=>null);if(O(!1),!e?.ok){A(`That code isn’t right, or it expired. Request a new one.`);return}window.location.href=f(new URLSearchParams(window.location.search).get(`callbackUrl`),window.location.origin)};return n(i,{get when(){return c(()=>!r()?.user)()&&(r()||s())},get children(){var e=_(),t=e.firstChild;return t.firstChild,o(t,n(i,{get when(){return!T()},get fallback(){return[(()=>{var e=v(),t=e.firstChild.nextSibling;return o(t,x),e})(),(()=>{var e=y(),t=e.firstChild,n=t.nextSibling;return e.addEventListener(`submit`,e=>{e.preventDefault(),M()}),t.$$input=e=>w(e.currentTarget.value),o(n,()=>D()?`checking…`:`log in`),a(()=>n.disabled=D()||!C()),a(()=>t.value=C()),e})(),(()=>{var e=b(),t=e.firstChild,n=t.nextSibling;return t.$$click=()=>{E(!1),w(``),A(null)},n.$$click=()=>void j(),a(()=>n.disabled=D()),e})()]},get children(){return[p(),(()=>{var e=m(),t=e.firstChild,n=t.nextSibling;return e.addEventListener(`submit`,e=>{e.preventDefault(),j()}),t.$$input=e=>S(e.currentTarget.value),o(n,()=>D()?`sending…`:`log in with email`),a(()=>n.disabled=D()||!x()),a(()=>t.value=x()),e})(),h()]}}),null),o(t,n(i,{get when(){return k()},get children(){var e=g();return o(e,k),e}}),null),e}})}r([`input`,`click`]);export{x as LoginPage};
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{M as e,R as t,T as n,a as r,b as i,i as a,k as o,l as s,o as c,p as l,z as u}from"./web-Ckpee-ZJ.js";import{M as d,i as f,q as p,y as m}from"./solid-app-
|
|
1
|
+
import{M as e,R as t,T as n,a as r,b as i,i as a,k as o,l as s,o as c,p as l,z as u}from"./web-Ckpee-ZJ.js";import{M as d,i as f,q as p,y as m}from"./solid-app-BNcsMwv4.js";var h=l(`<a rel=external aria-label="Sign in"class="text-muted no-underline underline-offset-4 hover:text-fg hover:underline">sign in — if it’s yours to see`),g=l(`<main aria-label="Not found"class="mx-auto mt-16 max-w-4xl px-6 pb-24 justify-center text-center"><style>
|
|
2
2
|
.nf-glitch { animation: nf-glitch 2.6s steps(1) infinite; }
|
|
3
3
|
@keyframes nf-glitch {
|
|
4
4
|
0% { text-shadow: 0.06em 0 var(--color-danger), -0.06em 0 var(--color-accent); transform: translateX(-0.015em); }
|
|
Binary file
|
|
Binary file
|
package/dist/runtime/dist/web/assets/{Notifications-BGeJKv2W.js → Notifications-M7BiDhSo.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as e,T as t,b as n,o as r,p as i}from"./web-Ckpee-ZJ.js";import{G as a,Z as o,c as s,q as c}from"./solid-app-
|
|
1
|
+
import{I as e,T as t,b as n,o as r,p as i}from"./web-Ckpee-ZJ.js";import{G as a,Z as o,c as s,q as c}from"./solid-app-BNcsMwv4.js";var l=[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]],u=n=>t(a,e(n,{iconNode:l,name:`settings`})),d=i(`<main class="mx-auto max-w-2xl px-4 py-8 sm:px-6"><div class="mb-5 flex items-center justify-between gap-4"><div><h1 class="text-xl font-semibold">Notifications</h1><p class="mt-1 text-sm text-muted">Invitations, conversations and activity.</p></div><a href=/account#notifications class="inline-flex items-center gap-1.5 text-sm text-muted hover:text-fg">Settings</a></div><div class="overflow-hidden rounded-lg border border-edge bg-surface">`);function f(){let{session:e}=c(),i=new URLSearchParams(window.location.search).get(`run`);return t(n,{get when(){return!e()||e()?.kind===`account`},get fallback(){return t(o,{get href(){return`/login?callbackUrl=${encodeURIComponent(`/notifications${i?`?run=${encodeURIComponent(i)}`:``}`)}`}})},get children(){var e=d(),n=e.firstChild,i=n.firstChild.nextSibling,a=i.firstChild,o=n.nextSibling;return r(i,t(u,{size:16}),a),r(o,t(s,{})),e}})}export{f as NotificationsPage};
|
|
Binary file
|