@powerhousedao/connect 5.0.0-staging.9 → 5.0.1-staging.10
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/{dist/.env → .env} +4 -6
- package/README.md +3 -4
- package/assets/icon.icns +0 -0
- package/assets/icon.ico +0 -0
- package/assets/icon.png +0 -0
- package/assets/icons/Atlas-Logomark.svg +24 -0
- package/assets/icons/BBP-logo-hover-dark.svg +14 -0
- package/assets/icons/BBP-logo-hover-light.svg +14 -0
- package/assets/icons/BBP-logo-main.svg +14 -0
- package/assets/icons/collapse.svg +7 -0
- package/assets/icons/connect-small.svg +3 -0
- package/assets/icons/connect.svg +16 -0
- package/assets/icons/cross.svg +4 -0
- package/assets/icons/dark.svg +5 -0
- package/assets/icons/draft.svg +3 -0
- package/assets/icons/file.svg +3 -0
- package/assets/icons/file2.svg +10 -0
- package/assets/icons/folder.svg +3 -0
- package/assets/icons/light.svg +20 -0
- package/assets/icons/logo.svg +11 -0
- package/assets/icons/plus-circle.svg +5 -0
- package/assets/icons/refresh.svg +4 -0
- package/assets/icons/renown.svg +27 -0
- package/assets/icons/settings.svg +6 -0
- package/assets/icons/template.svg +3 -0
- package/assets/info.plist +85 -0
- package/dist/assets/AddDriveModal-_VEckfgs.js +1 -0
- package/dist/assets/ClearStorageModal-BIEumLFB.js +1 -0
- package/dist/assets/CookiesPolicyModal-DxXlDzMD.js +1 -0
- package/dist/assets/CreateDocumentModal-i8Mn-zHZ.js +1 -0
- package/dist/assets/DebugSettingsModal-B7_0MfyY.js +1 -0
- package/dist/assets/DeleteDriveModal-Z_QkBHwL.js +1 -0
- package/dist/assets/DeleteItemModal-PX5rpWQp.js +1 -0
- package/dist/assets/DisclaimerModal-DnyAi8SY.js +1 -0
- package/dist/assets/DriveSettingsModal-CKBxDPF4.js +1 -0
- package/dist/assets/ExportDocumentWithErrorsModal-PwfR0wZb.js +1 -0
- package/dist/assets/SettingsModal-CvlSE5u_.js +1 -0
- package/dist/assets/UpgradeDriveModal-C5OBv8od.js +1 -0
- package/dist/assets/config-CU-aFfVJ.js +1 -0
- package/dist/assets/design_system-wkSa2XkO.js +45 -0
- package/dist/assets/design_system_connect-KiHH4lsC.js +45 -0
- package/dist/assets/design_system_ui-yn9Bp8-M.js +1 -0
- package/dist/assets/document_drive-BEIKnuGM.js +305 -0
- package/dist/assets/document_engineering-DwkL4RC_.js +1 -0
- package/dist/assets/document_model-DXcLJEjZ.js +230 -0
- package/dist/assets/document_model_editor-Dzl0xzA_.js +23 -0
- package/dist/assets/drive_explorer-BXnew3vz.js +2 -0
- package/dist/assets/graphql-BS4Brs_E.js +75 -0
- package/dist/assets/graphql-editor-CYvFkX8-.js +73 -0
- package/dist/assets/graphql_request-9RNJ00DB.js +3 -0
- package/dist/assets/hmr-LMNkvzP7.js +1 -0
- package/dist/assets/hooks-D1J714hY.js +12 -0
- package/dist/assets/index-2InhLUpC.js +18 -0
- package/dist/assets/index-Br7E7qjt.css +1 -0
- package/dist/assets/json-editor-Meugtes8.js +1 -0
- package/dist/assets/react/jsx-runtime-DldvXD6N.js +1 -0
- package/dist/assets/react-DQSxOgtG.js +1 -0
- package/dist/assets/react-dom/client-BVPiT_FE.js +9 -0
- package/dist/assets/react-dom-D6zQJsh6.js +1 -0
- package/dist/assets/reactor_browser-CSyNHuU2.js +25 -0
- package/dist/assets/sentry_browser-B4YoBIIG.js +498 -0
- package/dist/assets/sentry_react-cODD7zWc.js +3 -0
- package/dist/assets/state-schemas-Dq1fQPOB.js +2 -0
- package/dist/assets/tailwind_merge-Dr4f9Rms.js +1 -0
- package/dist/assets/virtual_ph_external-packages-CM1tCR4L.js +1 -0
- package/dist/assets/zod-C6yxFxyo.js +1 -0
- package/dist/index.html +51 -75
- package/heroku/Dockerfile +98 -0
- package/heroku/Procfile +1 -0
- package/heroku/config/nginx.conf.template +77 -0
- package/heroku/heroku-entrypoint.sh +38 -0
- package/lib/cypress/e2e/navigation.cy.d.ts +2 -0
- package/lib/cypress/e2e/navigation.cy.d.ts.map +1 -0
- package/lib/cypress/e2e/navigation.cy.js +221 -0
- package/lib/cypress/e2e/navigation.cy.js.map +1 -0
- package/lib/cypress/e2e/utils/index.d.ts +15 -0
- package/lib/cypress/e2e/utils/index.d.ts.map +1 -0
- package/lib/cypress/e2e/utils/index.js +121 -0
- package/lib/cypress/e2e/utils/index.js.map +1 -0
- package/lib/cypress/support/commands.d.ts +2 -0
- package/lib/cypress/support/commands.d.ts.map +1 -0
- package/lib/cypress/support/commands.js +29 -0
- package/lib/cypress/support/commands.js.map +1 -0
- package/lib/cypress/support/e2e.d.ts +2 -0
- package/lib/cypress/support/e2e.d.ts.map +1 -0
- package/lib/cypress/support/e2e.js +19 -0
- package/lib/cypress/support/e2e.js.map +1 -0
- package/lib/cypress.config.d.ts +3 -0
- package/lib/cypress.config.d.ts.map +1 -0
- package/lib/cypress.config.js +15 -0
- package/lib/cypress.config.js.map +1 -0
- package/lib/package.copy.json +165 -0
- package/lib/scripts/render-skeleton.d.ts +2 -0
- package/lib/scripts/render-skeleton.d.ts.map +1 -0
- package/lib/scripts/render-skeleton.js +11 -0
- package/lib/scripts/render-skeleton.js.map +1 -0
- package/lib/src/components/analytics.d.ts +8 -0
- package/lib/src/components/analytics.d.ts.map +1 -0
- package/lib/src/components/analytics.js +30 -0
- package/lib/src/components/analytics.js.map +1 -0
- package/lib/src/components/app-loader.d.ts +7 -0
- package/lib/src/components/app-loader.d.ts.map +1 -0
- package/lib/src/components/app-loader.js +20 -0
- package/lib/src/components/app-loader.js.map +1 -0
- package/lib/src/components/app-skeleton.d.ts +3 -0
- package/lib/src/components/app-skeleton.d.ts.map +1 -0
- package/lib/src/components/app-skeleton.js +38 -0
- package/lib/src/components/app-skeleton.js.map +1 -0
- package/lib/src/components/app.d.ts +2 -0
- package/lib/src/components/app.d.ts.map +1 -0
- package/lib/src/components/app.js +18 -0
- package/lib/src/components/app.js.map +1 -0
- package/lib/src/components/button.d.ts +3 -0
- package/lib/src/components/button.d.ts.map +1 -0
- package/lib/src/components/button.js +7 -0
- package/lib/src/components/button.js.map +1 -0
- package/lib/src/components/cookie-banner.d.ts +2 -0
- package/lib/src/components/cookie-banner.d.ts.map +1 -0
- package/lib/src/components/cookie-banner.js +48 -0
- package/lib/src/components/cookie-banner.js.map +1 -0
- package/lib/src/components/document-editor-container.d.ts +2 -0
- package/lib/src/components/document-editor-container.d.ts.map +1 -0
- package/lib/src/components/document-editor-container.js +62 -0
- package/lib/src/components/document-editor-container.js.map +1 -0
- package/lib/src/components/dots-loader.d.ts +2 -0
- package/lib/src/components/dots-loader.d.ts.map +1 -0
- package/lib/src/components/dots-loader.js +15 -0
- package/lib/src/components/dots-loader.js.map +1 -0
- package/lib/src/components/drive-editor-container.d.ts +2 -0
- package/lib/src/components/drive-editor-container.d.ts.map +1 -0
- package/lib/src/components/drive-editor-container.js +25 -0
- package/lib/src/components/drive-editor-container.js.map +1 -0
- package/lib/src/components/drive-icon.d.ts +5 -0
- package/lib/src/components/drive-icon.d.ts.map +1 -0
- package/lib/src/components/drive-icon.js +15 -0
- package/lib/src/components/drive-icon.js.map +1 -0
- package/lib/src/components/editor-loader.d.ts +9 -0
- package/lib/src/components/editor-loader.d.ts.map +1 -0
- package/lib/src/components/editor-loader.js +19 -0
- package/lib/src/components/editor-loader.js.map +1 -0
- package/lib/src/components/editors.d.ts +10 -0
- package/lib/src/components/editors.d.ts.map +1 -0
- package/lib/src/components/editors.js +93 -0
- package/lib/src/components/editors.js.map +1 -0
- package/lib/src/components/footer.d.ts +2 -0
- package/lib/src/components/footer.d.ts.map +1 -0
- package/lib/src/components/footer.js +16 -0
- package/lib/src/components/footer.js.map +1 -0
- package/lib/src/components/index.d.ts +22 -0
- package/lib/src/components/index.d.ts.map +1 -0
- package/lib/src/components/index.js +22 -0
- package/lib/src/components/index.js.map +1 -0
- package/lib/src/components/login.d.ts +2 -0
- package/lib/src/components/login.d.ts.map +1 -0
- package/lib/src/components/login.js +12 -0
- package/lib/src/components/login.js.map +1 -0
- package/lib/src/components/modal/index.d.ts +19 -0
- package/lib/src/components/modal/index.d.ts.map +1 -0
- package/lib/src/components/modal/index.js +19 -0
- package/lib/src/components/modal/index.js.map +1 -0
- package/lib/src/components/modal/modals/AddDriveModal.d.ts +2 -0
- package/lib/src/components/modal/modals/AddDriveModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/AddDriveModal.js +113 -0
- package/lib/src/components/modal/modals/AddDriveModal.js.map +1 -0
- package/lib/src/components/modal/modals/ClearStorageModal.d.ts +2 -0
- package/lib/src/components/modal/modals/ClearStorageModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/ClearStorageModal.js +35 -0
- package/lib/src/components/modal/modals/ClearStorageModal.js.map +1 -0
- package/lib/src/components/modal/modals/CookiesPolicyModal.d.ts +2 -0
- package/lib/src/components/modal/modals/CookiesPolicyModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/CookiesPolicyModal.js +16 -0
- package/lib/src/components/modal/modals/CookiesPolicyModal.js.map +1 -0
- package/lib/src/components/modal/modals/CreateDocumentModal.d.ts +2 -0
- package/lib/src/components/modal/modals/CreateDocumentModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/CreateDocumentModal.js +24 -0
- package/lib/src/components/modal/modals/CreateDocumentModal.js.map +1 -0
- package/lib/src/components/modal/modals/DebugSettingsModal.d.ts +2 -0
- package/lib/src/components/modal/modals/DebugSettingsModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/DebugSettingsModal.js +108 -0
- package/lib/src/components/modal/modals/DebugSettingsModal.js.map +1 -0
- package/lib/src/components/modal/modals/DeleteDriveModal.d.ts +2 -0
- package/lib/src/components/modal/modals/DeleteDriveModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/DeleteDriveModal.js +32 -0
- package/lib/src/components/modal/modals/DeleteDriveModal.js.map +1 -0
- package/lib/src/components/modal/modals/DeleteItemModal.d.ts +3 -0
- package/lib/src/components/modal/modals/DeleteItemModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/DeleteItemModal.js +33 -0
- package/lib/src/components/modal/modals/DeleteItemModal.js.map +1 -0
- package/lib/src/components/modal/modals/DisclaimerModal.d.ts +3 -0
- package/lib/src/components/modal/modals/DisclaimerModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/DisclaimerModal.js +12 -0
- package/lib/src/components/modal/modals/DisclaimerModal.js.map +1 -0
- package/lib/src/components/modal/modals/DriveSettingsModal.d.ts +2 -0
- package/lib/src/components/modal/modals/DriveSettingsModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/DriveSettingsModal.js +28 -0
- package/lib/src/components/modal/modals/DriveSettingsModal.js.map +1 -0
- package/lib/src/components/modal/modals/ExportDocumentWithErrorsModal.d.ts +2 -0
- package/lib/src/components/modal/modals/ExportDocumentWithErrorsModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/ExportDocumentWithErrorsModal.js +30 -0
- package/lib/src/components/modal/modals/ExportDocumentWithErrorsModal.js.map +1 -0
- package/lib/src/components/modal/modals/SettingsModal.d.ts +3 -0
- package/lib/src/components/modal/modals/SettingsModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/SettingsModal.js +45 -0
- package/lib/src/components/modal/modals/SettingsModal.js.map +1 -0
- package/lib/src/components/modal/modals/UpgradeDriveModal.d.ts +3 -0
- package/lib/src/components/modal/modals/UpgradeDriveModal.d.ts.map +1 -0
- package/lib/src/components/modal/modals/UpgradeDriveModal.js +21 -0
- package/lib/src/components/modal/modals/UpgradeDriveModal.js.map +1 -0
- package/lib/src/components/modal/modals/settings/about.d.ts +2 -0
- package/lib/src/components/modal/modals/settings/about.d.ts.map +1 -0
- package/lib/src/components/modal/modals/settings/about.js +10 -0
- package/lib/src/components/modal/modals/settings/about.js.map +1 -0
- package/lib/src/components/modal/modals/settings/danger-zone.d.ts +2 -0
- package/lib/src/components/modal/modals/settings/danger-zone.d.ts.map +1 -0
- package/lib/src/components/modal/modals/settings/danger-zone.js +15 -0
- package/lib/src/components/modal/modals/settings/danger-zone.js.map +1 -0
- package/lib/src/components/modal/modals/settings/default-editor.d.ts +2 -0
- package/lib/src/components/modal/modals/settings/default-editor.d.ts.map +1 -0
- package/lib/src/components/modal/modals/settings/default-editor.js +18 -0
- package/lib/src/components/modal/modals/settings/default-editor.js.map +1 -0
- package/lib/src/components/modal/modals/settings/package-manager.d.ts +3 -0
- package/lib/src/components/modal/modals/settings/package-manager.d.ts.map +1 -0
- package/lib/src/components/modal/modals/settings/package-manager.js +87 -0
- package/lib/src/components/modal/modals/settings/package-manager.js.map +1 -0
- package/lib/src/components/modal/modals-container.d.ts +2 -0
- package/lib/src/components/modal/modals-container.d.ts.map +1 -0
- package/lib/src/components/modal/modals-container.js +62 -0
- package/lib/src/components/modal/modals-container.js.map +1 -0
- package/lib/src/components/modal/modals-error-boundary.d.ts +18 -0
- package/lib/src/components/modal/modals-error-boundary.d.ts.map +1 -0
- package/lib/src/components/modal/modals-error-boundary.js +22 -0
- package/lib/src/components/modal/modals-error-boundary.js.map +1 -0
- package/lib/src/components/ph-logo.d.ts +2 -0
- package/lib/src/components/ph-logo.d.ts.map +1 -0
- package/lib/src/components/ph-logo.js +7 -0
- package/lib/src/components/ph-logo.js.map +1 -0
- package/lib/src/components/reload-connect-toast.d.ts +2 -0
- package/lib/src/components/reload-connect-toast.d.ts.map +1 -0
- package/lib/src/components/reload-connect-toast.js +7 -0
- package/lib/src/components/reload-connect-toast.js.map +1 -0
- package/lib/src/components/root.d.ts +2 -0
- package/lib/src/components/root.d.ts.map +1 -0
- package/lib/src/components/root.js +8 -0
- package/lib/src/components/root.js.map +1 -0
- package/lib/src/components/router.d.ts +2 -0
- package/lib/src/components/router.d.ts.map +1 -0
- package/lib/src/components/router.js +41 -0
- package/lib/src/components/router.js.map +1 -0
- package/lib/src/components/search-bar.d.ts +2 -0
- package/lib/src/components/search-bar.d.ts.map +1 -0
- package/lib/src/components/search-bar.js +36 -0
- package/lib/src/components/search-bar.js.map +1 -0
- package/lib/src/components/sidebar.d.ts +2 -0
- package/lib/src/components/sidebar.d.ts.map +1 -0
- package/lib/src/components/sidebar.js +27 -0
- package/lib/src/components/sidebar.js.map +1 -0
- package/lib/src/connect.config.d.ts +113 -0
- package/lib/src/connect.config.d.ts.map +1 -0
- package/lib/src/connect.config.js +147 -0
- package/lib/src/connect.config.js.map +1 -0
- package/lib/src/context/index.d.ts +4 -0
- package/lib/src/context/index.d.ts.map +1 -0
- package/lib/src/context/index.js +4 -0
- package/lib/src/context/index.js.map +1 -0
- package/lib/src/context/processor-manager.d.ts +3 -0
- package/lib/src/context/processor-manager.d.ts.map +1 -0
- package/lib/src/context/processor-manager.js +189 -0
- package/lib/src/context/processor-manager.js.map +1 -0
- package/lib/src/context/read-mode.d.ts +2 -0
- package/lib/src/context/read-mode.d.ts.map +1 -0
- package/lib/src/context/read-mode.js +219 -0
- package/lib/src/context/read-mode.js.map +1 -0
- package/lib/src/context/sentry-provider.d.ts +6 -0
- package/lib/src/context/sentry-provider.d.ts.map +1 -0
- package/lib/src/context/sentry-provider.js +6 -0
- package/lib/src/context/sentry-provider.js.map +1 -0
- package/lib/src/feature-flags.d.ts +34 -0
- package/lib/src/feature-flags.d.ts.map +1 -0
- package/lib/src/feature-flags.js +124 -0
- package/lib/src/feature-flags.js.map +1 -0
- package/lib/src/globals.d.ts +9 -0
- package/lib/src/globals.d.ts.map +1 -0
- package/lib/src/globals.js +2 -0
- package/lib/src/globals.js.map +1 -0
- package/lib/src/hmr.d.ts +3 -0
- package/lib/src/hmr.d.ts.map +1 -0
- package/lib/src/hmr.js +2 -0
- package/lib/src/hmr.js.map +1 -0
- package/lib/src/hooks/index.d.ts +10 -0
- package/lib/src/hooks/index.d.ts.map +1 -0
- package/lib/src/hooks/index.js +10 -0
- package/lib/src/hooks/index.js.map +1 -0
- package/lib/src/hooks/useAcceptedCookies.d.ts +9 -0
- package/lib/src/hooks/useAcceptedCookies.d.ts.map +1 -0
- package/lib/src/hooks/useAcceptedCookies.js +34 -0
- package/lib/src/hooks/useAcceptedCookies.js.map +1 -0
- package/lib/src/hooks/useCheckLatestVersion.d.ts +2 -0
- package/lib/src/hooks/useCheckLatestVersion.d.ts.map +1 -0
- package/lib/src/hooks/useCheckLatestVersion.js +33 -0
- package/lib/src/hooks/useCheckLatestVersion.js.map +1 -0
- package/lib/src/hooks/useClientErrorHandler.d.ts +6 -0
- package/lib/src/hooks/useClientErrorHandler.d.ts.map +1 -0
- package/lib/src/hooks/useClientErrorHandler.js +120 -0
- package/lib/src/hooks/useClientErrorHandler.js.map +1 -0
- package/lib/src/hooks/useCookieBanner.d.ts +5 -0
- package/lib/src/hooks/useCookieBanner.d.ts.map +1 -0
- package/lib/src/hooks/useCookieBanner.js +32 -0
- package/lib/src/hooks/useCookieBanner.js.map +1 -0
- package/lib/src/hooks/useInitSentry.d.ts +2 -0
- package/lib/src/hooks/useInitSentry.d.ts.map +1 -0
- package/lib/src/hooks/useInitSentry.js +80 -0
- package/lib/src/hooks/useInitSentry.js.map +1 -0
- package/lib/src/hooks/useNodeActions.d.ts +6 -0
- package/lib/src/hooks/useNodeActions.d.ts.map +1 -0
- package/lib/src/hooks/useNodeActions.js +35 -0
- package/lib/src/hooks/useNodeActions.js.map +1 -0
- package/lib/src/hooks/useUndoRedoShortcuts.d.ts +8 -0
- package/lib/src/hooks/useUndoRedoShortcuts.d.ts.map +1 -0
- package/lib/src/hooks/useUndoRedoShortcuts.js +26 -0
- package/lib/src/hooks/useUndoRedoShortcuts.js.map +1 -0
- package/lib/src/hooks/useWindowSize.d.ts +5 -0
- package/lib/src/hooks/useWindowSize.d.ts.map +1 -0
- package/lib/src/hooks/useWindowSize.js +21 -0
- package/lib/src/hooks/useWindowSize.js.map +1 -0
- package/lib/src/hooks/utils.d.ts +7 -0
- package/lib/src/hooks/utils.d.ts.map +1 -0
- package/lib/src/hooks/utils.js +46 -0
- package/lib/src/hooks/utils.js.map +1 -0
- package/lib/src/i18n/index.d.ts +4 -0
- package/lib/src/i18n/index.d.ts.map +1 -0
- package/lib/src/i18n/index.js +26 -0
- package/lib/src/i18n/index.js.map +1 -0
- package/lib/src/i18n/locales/en.json +114 -0
- package/lib/src/index.d.ts +2 -0
- package/lib/src/index.d.ts.map +1 -0
- package/lib/src/index.js +2 -0
- package/lib/src/index.js.map +1 -0
- package/lib/src/main.d.ts +2 -0
- package/lib/src/main.d.ts.map +1 -0
- package/lib/src/main.js +5 -0
- package/lib/src/main.js.map +1 -0
- package/lib/src/pages/content.d.ts +2 -0
- package/lib/src/pages/content.d.ts.map +1 -0
- package/lib/src/pages/content.js +39 -0
- package/lib/src/pages/content.js.map +1 -0
- package/lib/src/pages/demo/atlas-import.d.ts +2 -0
- package/lib/src/pages/demo/atlas-import.d.ts.map +1 -0
- package/lib/src/pages/demo/atlas-import.js +122 -0
- package/lib/src/pages/demo/atlas-import.js.map +1 -0
- package/lib/src/pages/index.d.ts +4 -0
- package/lib/src/pages/index.d.ts.map +1 -0
- package/lib/src/pages/index.js +4 -0
- package/lib/src/pages/index.js.map +1 -0
- package/lib/src/pages/settings.d.ts +4 -0
- package/lib/src/pages/settings.d.ts.map +1 -0
- package/lib/src/pages/settings.js +9 -0
- package/lib/src/pages/settings.js.map +1 -0
- package/lib/src/service-worker.d.ts +2 -0
- package/lib/src/service-worker.d.ts.map +1 -0
- package/lib/src/service-worker.js +58 -0
- package/lib/src/service-worker.js.map +1 -0
- package/lib/src/services/hmr.d.ts +13 -0
- package/lib/src/services/hmr.d.ts.map +1 -0
- package/lib/src/services/hmr.js +85 -0
- package/lib/src/services/hmr.js.map +1 -0
- package/lib/src/services/index.d.ts +10 -0
- package/lib/src/services/index.d.ts.map +1 -0
- package/lib/src/services/index.js +9 -0
- package/lib/src/services/index.js.map +1 -0
- package/lib/src/services/logger.d.ts +2 -0
- package/lib/src/services/logger.d.ts.map +1 -0
- package/lib/src/services/logger.js +28 -0
- package/lib/src/services/logger.js.map +1 -0
- package/lib/src/services/renown/browser.d.ts +2 -0
- package/lib/src/services/renown/browser.d.ts.map +1 -0
- package/lib/src/services/renown/browser.js +6 -0
- package/lib/src/services/renown/browser.js.map +1 -0
- package/lib/src/services/renown/constants.d.ts +130 -0
- package/lib/src/services/renown/constants.d.ts.map +1 -0
- package/lib/src/services/renown/constants.js +41 -0
- package/lib/src/services/renown/constants.js.map +1 -0
- package/lib/src/services/renown/utils.d.ts +7 -0
- package/lib/src/services/renown/utils.d.ts.map +1 -0
- package/lib/src/services/renown/utils.js +20 -0
- package/lib/src/services/renown/utils.js.map +1 -0
- package/lib/src/services/storage/base-storage.d.ts +9 -0
- package/lib/src/services/storage/base-storage.d.ts.map +1 -0
- package/lib/src/services/storage/base-storage.js +21 -0
- package/lib/src/services/storage/base-storage.js.map +1 -0
- package/lib/src/services/storage/browser.d.ts +5 -0
- package/lib/src/services/storage/browser.d.ts.map +1 -0
- package/lib/src/services/storage/browser.js +25 -0
- package/lib/src/services/storage/browser.js.map +1 -0
- package/lib/src/services/storage/types.d.ts +6 -0
- package/lib/src/services/storage/types.d.ts.map +1 -0
- package/lib/src/services/storage/types.js +2 -0
- package/lib/src/services/storage/types.js.map +1 -0
- package/lib/src/services/toast.d.ts +8 -0
- package/lib/src/services/toast.d.ts.map +1 -0
- package/lib/src/services/toast.js +11 -0
- package/lib/src/services/toast.js.map +1 -0
- package/lib/src/store/document-model.d.ts +3 -0
- package/lib/src/store/document-model.d.ts.map +1 -0
- package/lib/src/store/document-model.js +79 -0
- package/lib/src/store/document-model.js.map +1 -0
- package/lib/src/store/editor.d.ts +5 -0
- package/lib/src/store/editor.d.ts.map +1 -0
- package/lib/src/store/editor.js +31 -0
- package/lib/src/store/editor.js.map +1 -0
- package/lib/src/store/external-packages.d.ts +4 -0
- package/lib/src/store/external-packages.d.ts.map +1 -0
- package/lib/src/store/external-packages.js +36 -0
- package/lib/src/store/external-packages.js.map +1 -0
- package/lib/src/store/index.d.ts +7 -0
- package/lib/src/store/index.d.ts.map +1 -0
- package/lib/src/store/index.js +7 -0
- package/lib/src/store/index.js.map +1 -0
- package/lib/src/store/reactor.d.ts +3 -0
- package/lib/src/store/reactor.d.ts.map +1 -0
- package/lib/src/store/reactor.js +177 -0
- package/lib/src/store/reactor.js.map +1 -0
- package/lib/src/store/user.d.ts +2 -0
- package/lib/src/store/user.d.ts.map +1 -0
- package/lib/src/store/user.js +16 -0
- package/lib/src/store/user.js.map +1 -0
- package/lib/src/store/utils.d.ts +2 -0
- package/lib/src/store/utils.d.ts.map +1 -0
- package/lib/src/store/utils.js +59 -0
- package/lib/src/store/utils.js.map +1 -0
- package/lib/src/utils/browser.d.ts +2 -0
- package/lib/src/utils/browser.d.ts.map +1 -0
- package/lib/src/utils/browser.js +9 -0
- package/lib/src/utils/browser.js.map +1 -0
- package/lib/src/utils/document-editor-debug-tools.d.ts +17 -0
- package/lib/src/utils/document-editor-debug-tools.d.ts.map +1 -0
- package/lib/src/utils/document-editor-debug-tools.js +55 -0
- package/lib/src/utils/document-editor-debug-tools.js.map +1 -0
- package/lib/src/utils/drive-preservation.d.ts +19 -0
- package/lib/src/utils/drive-preservation.d.ts.map +1 -0
- package/lib/src/utils/drive-preservation.js +51 -0
- package/lib/src/utils/drive-preservation.js.map +1 -0
- package/lib/src/utils/drive-sections.d.ts +31 -0
- package/lib/src/utils/drive-sections.d.ts.map +1 -0
- package/lib/src/utils/drive-sections.js +63 -0
- package/lib/src/utils/drive-sections.js.map +1 -0
- package/lib/src/utils/index.d.ts +12 -0
- package/lib/src/utils/index.d.ts.map +1 -0
- package/lib/src/utils/index.js +12 -0
- package/lib/src/utils/index.js.map +1 -0
- package/lib/src/utils/join.d.ts +2 -0
- package/lib/src/utils/join.d.ts.map +1 -0
- package/lib/src/utils/join.js +11 -0
- package/lib/src/utils/join.js.map +1 -0
- package/lib/src/utils/openUrl.d.ts +2 -0
- package/lib/src/utils/openUrl.d.ts.map +1 -0
- package/lib/src/utils/openUrl.js +3 -0
- package/lib/src/utils/openUrl.js.map +1 -0
- package/lib/src/utils/path.d.ts +4 -0
- package/lib/src/utils/path.d.ts.map +1 -0
- package/lib/src/utils/path.js +17 -0
- package/lib/src/utils/path.js.map +1 -0
- package/lib/src/utils/reactor.d.ts +6 -0
- package/lib/src/utils/reactor.d.ts.map +1 -0
- package/lib/src/utils/reactor.js +57 -0
- package/lib/src/utils/reactor.js.map +1 -0
- package/lib/src/utils/registerServiceWorker.d.ts +12 -0
- package/lib/src/utils/registerServiceWorker.d.ts.map +1 -0
- package/lib/src/utils/registerServiceWorker.js +97 -0
- package/lib/src/utils/registerServiceWorker.js.map +1 -0
- package/lib/src/utils/signature.d.ts +4 -0
- package/lib/src/utils/signature.d.ts.map +1 -0
- package/lib/src/utils/signature.js +36 -0
- package/lib/src/utils/signature.js.map +1 -0
- package/lib/src/utils/slug.d.ts +2 -0
- package/lib/src/utils/slug.d.ts.map +1 -0
- package/lib/src/utils/slug.js +4 -0
- package/lib/src/utils/slug.js.map +1 -0
- package/lib/src/workers/pglite-worker.d.ts +2 -0
- package/lib/src/workers/pglite-worker.d.ts.map +1 -0
- package/lib/src/workers/pglite-worker.js +32 -0
- package/lib/src/workers/pglite-worker.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/vite.config.d.ts +3 -0
- package/lib/vite.config.d.ts.map +1 -0
- package/lib/vite.config.js +55 -0
- package/lib/vite.config.js.map +1 -0
- package/package.copy.json +165 -0
- package/package.json +126 -66
- package/public/icon.ico +0 -0
- package/public/robots.txt +3 -0
- package/public/settings.png +0 -0
- package/scripts/render-skeleton.ts +8 -10
- package/src/index.css +4 -0
- package/dist/assets/AddDriveModal.CsX1V9k8.js +0 -2
- package/dist/assets/AddDriveModal.CsX1V9k8.js.map +0 -1
- package/dist/assets/AddLocalDriveModal.9wlqUaI7.js +0 -2
- package/dist/assets/AddLocalDriveModal.9wlqUaI7.js.map +0 -1
- package/dist/assets/AddRemoteDriveModal.BViKJcIG.js +0 -2
- package/dist/assets/AddRemoteDriveModal.BViKJcIG.js.map +0 -1
- package/dist/assets/ConfirmationModal.Cwd4p-FQ.js +0 -2
- package/dist/assets/ConfirmationModal.Cwd4p-FQ.js.map +0 -1
- package/dist/assets/CookiesPolicyModal.DBYakGYw.js +0 -2
- package/dist/assets/CookiesPolicyModal.DBYakGYw.js.map +0 -1
- package/dist/assets/CreateDocumentModal.BCLwbl_7.js +0 -2
- package/dist/assets/CreateDocumentModal.BCLwbl_7.js.map +0 -1
- package/dist/assets/DebugSettingsModal.C2JfEGKx.js +0 -7
- package/dist/assets/DebugSettingsModal.C2JfEGKx.js.map +0 -1
- package/dist/assets/DeleteDriveModal.ccJLuz-v.js +0 -2
- package/dist/assets/DeleteDriveModal.ccJLuz-v.js.map +0 -1
- package/dist/assets/DeleteItemModal.lxt16WLJ.js +0 -2
- package/dist/assets/DeleteItemModal.lxt16WLJ.js.map +0 -1
- package/dist/assets/DisclaimerModal.YKaHnRz1.js +0 -2
- package/dist/assets/DisclaimerModal.YKaHnRz1.js.map +0 -1
- package/dist/assets/DriveSettingsModal.DUtXh2J3.js +0 -2
- package/dist/assets/DriveSettingsModal.DUtXh2J3.js.map +0 -1
- package/dist/assets/SettingsModal.NCZyx-LZ.js +0 -2
- package/dist/assets/SettingsModal.NCZyx-LZ.js.map +0 -1
- package/dist/assets/UpgradeDriveModal.Bp1cbwzD.js +0 -2
- package/dist/assets/UpgradeDriveModal.Bp1cbwzD.js.map +0 -1
- package/dist/assets/app-form-input.DrsD0P0g.js +0 -2
- package/dist/assets/app-form-input.DrsD0P0g.js.map +0 -1
- package/dist/assets/atlas-import.S0zyqygI.js +0 -6
- package/dist/assets/atlas-import.S0zyqygI.js.map +0 -1
- package/dist/assets/ccip.DbzT2NeK.js +0 -2
- package/dist/assets/ccip.DbzT2NeK.js.map +0 -1
- package/dist/assets/confirmation-modal.BRg1WqhO.js +0 -2
- package/dist/assets/confirmation-modal.BRg1WqhO.js.map +0 -1
- package/dist/assets/content.BwwSwPoU.js +0 -11
- package/dist/assets/content.BwwSwPoU.js.map +0 -1
- package/dist/assets/creators.Beog8W4R.js +0 -2
- package/dist/assets/creators.Beog8W4R.js.map +0 -1
- package/dist/assets/crypto.DdbxIXEQ.js +0 -2
- package/dist/assets/crypto.DdbxIXEQ.js.map +0 -1
- package/dist/assets/disclosure.g6ojAjR7.js +0 -2
- package/dist/assets/disclosure.g6ojAjR7.js.map +0 -1
- package/dist/assets/document.CskU24Eo.js +0 -2
- package/dist/assets/document.CskU24Eo.js.map +0 -1
- package/dist/assets/documents.WANXuQQw.js +0 -2
- package/dist/assets/documents.WANXuQQw.js.map +0 -1
- package/dist/assets/drive-name.f6u15KL9.js +0 -2
- package/dist/assets/drive-name.f6u15KL9.js.map +0 -1
- package/dist/assets/drive.Bwke9qtc.js +0 -2
- package/dist/assets/drive.Bwke9qtc.js.map +0 -1
- package/dist/assets/drives.BT9_cNvB.js +0 -2
- package/dist/assets/drives.BT9_cNvB.js.map +0 -1
- package/dist/assets/drives.CnLEcvUe.js +0 -2
- package/dist/assets/drives.CnLEcvUe.js.map +0 -1
- package/dist/assets/dropdown-menu.CrltaMAi.js +0 -2
- package/dist/assets/dropdown-menu.CrltaMAi.js.map +0 -1
- package/dist/assets/form-input.CKWaNWHS.js +0 -2
- package/dist/assets/form-input.CKWaNWHS.js.map +0 -1
- package/dist/assets/index.B0KswTVc.js +0 -2
- package/dist/assets/index.B0KswTVc.js.map +0 -1
- package/dist/assets/index.B5Jahs6e.js +0 -210
- package/dist/assets/index.B5Jahs6e.js.map +0 -1
- package/dist/assets/index.B_w9kQDS.js +0 -2
- package/dist/assets/index.B_w9kQDS.js.map +0 -1
- package/dist/assets/index.CJhJIgr2.js +0 -5
- package/dist/assets/index.CJhJIgr2.js.map +0 -1
- package/dist/assets/index.CZGlv_DJ.js +0 -2
- package/dist/assets/index.CZGlv_DJ.js.map +0 -1
- package/dist/assets/index.Cy9Uih6l.js +0 -368
- package/dist/assets/index.Cy9Uih6l.js.map +0 -1
- package/dist/assets/index.DgMWNgC4.js +0 -2
- package/dist/assets/index.DgMWNgC4.js.map +0 -1
- package/dist/assets/index.DnmeBfoc.js +0 -2
- package/dist/assets/index.DnmeBfoc.js.map +0 -1
- package/dist/assets/index.LCmAGl8C.js +0 -114
- package/dist/assets/index.LCmAGl8C.js.map +0 -1
- package/dist/assets/index._iE_O567.js +0 -2
- package/dist/assets/index._iE_O567.js.map +0 -1
- package/dist/assets/index.esm.B0PnDknv.js +0 -2
- package/dist/assets/index.esm.B0PnDknv.js.map +0 -1
- package/dist/assets/index.jCXguwyn.js +0 -2
- package/dist/assets/index.jCXguwyn.js.map +0 -1
- package/dist/assets/index.rWEXHbK2.js +0 -2
- package/dist/assets/index.rWEXHbK2.js.map +0 -1
- package/dist/assets/index.rdGjBzAn.js +0 -2
- package/dist/assets/index.rdGjBzAn.js.map +0 -1
- package/dist/assets/location-info.CUOr58bf.js +0 -2
- package/dist/assets/location-info.CUOr58bf.js.map +0 -1
- package/dist/assets/main-BhSHpqSI.css +0 -1
- package/dist/assets/main.DaFo88Bw.js +0 -857
- package/dist/assets/main.DaFo88Bw.js.map +0 -1
- package/dist/assets/modal.oz3Jhm_k.js +0 -6
- package/dist/assets/modal.oz3Jhm_k.js.map +0 -1
- package/dist/assets/modals.Qs6mizxC.js +0 -2
- package/dist/assets/modals.Qs6mizxC.js.map +0 -1
- package/dist/assets/nodefs-CYAJKQhI.js +0 -2
- package/dist/assets/nodefs-CYAJKQhI.js.map +0 -1
- package/dist/assets/nodefs.DhjGeTvv.js +0 -2
- package/dist/assets/nodefs.DhjGeTvv.js.map +0 -1
- package/dist/assets/opfs-ahp-Br3qpBoL.js +0 -4
- package/dist/assets/opfs-ahp-Br3qpBoL.js.map +0 -1
- package/dist/assets/opfs-ahp.r3uiPDIk.js +0 -4
- package/dist/assets/opfs-ahp.r3uiPDIk.js.map +0 -1
- package/dist/assets/options.BWIJIz-I.js +0 -2
- package/dist/assets/options.BWIJIz-I.js.map +0 -1
- package/dist/assets/pglite-worker-DgAiCanq.js +0 -144
- package/dist/assets/pglite-worker-DgAiCanq.js.map +0 -1
- package/dist/assets/pglite-worker.BmajlV4J.js +0 -2
- package/dist/assets/pglite-worker.BmajlV4J.js.map +0 -1
- package/dist/assets/postgres-CkP7QCDB.data +0 -0
- package/dist/assets/postgres-CyuUVpXN.wasm +0 -0
- package/dist/assets/queue.CnIzwthA.js +0 -2
- package/dist/assets/queue.CnIzwthA.js.map +0 -1
- package/dist/assets/read-required-modal.DpPnKHjB.js +0 -2
- package/dist/assets/read-required-modal.DpPnKHjB.js.map +0 -1
- package/dist/assets/root.ZkWX3Xsc.js +0 -2
- package/dist/assets/root.ZkWX3Xsc.js.map +0 -1
- package/dist/assets/select.DJuJpI3A.js +0 -2
- package/dist/assets/select.DJuJpI3A.js.map +0 -1
- package/dist/assets/sharing-type-form-input.CUG75fNB.js +0 -2
- package/dist/assets/sharing-type-form-input.CUG75fNB.js.map +0 -1
- package/dist/assets/style-GxvX-8si.css +0 -1
- package/dist/assets/toggle.8B3GpI90.js +0 -2
- package/dist/assets/toggle.8B3GpI90.js.map +0 -1
- package/dist/assets/user.7iHZB6Al.js +0 -2
- package/dist/assets/user.7iHZB6Al.js.map +0 -1
- package/dist/assets/utils.BpWye9Xm.js +0 -2
- package/dist/assets/utils.BpWye9Xm.js.map +0 -1
- package/dist/external-packages.js +0 -1
- package/dist/fonts/Inter-Black.ttf +0 -0
- package/dist/fonts/Inter-Bold.ttf +0 -0
- package/dist/fonts/Inter-ExtraBold.ttf +0 -0
- package/dist/fonts/Inter-ExtraLight.ttf +0 -0
- package/dist/fonts/Inter-Light.ttf +0 -0
- package/dist/fonts/Inter-Medium.ttf +0 -0
- package/dist/fonts/Inter-Regular.ttf +0 -0
- package/dist/fonts/Inter-SemiBold.ttf +0 -0
- package/dist/fonts/Inter-Thin.ttf +0 -0
- package/dist/fonts/Inter-VariableFont_slnt,wght.ttf +0 -0
- package/dist/hmr.js +0 -2
- package/dist/hmr.js.map +0 -1
- package/dist/service-worker.js +0 -2
- package/dist/service-worker.js.map +0 -1
- package/dist/swEnv.js +0 -70
- package/dist/vite-envs.sh +0 -494
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content.BwwSwPoU.js","sources":["../../../../packages/design-system/dist/src/powerhouse/components/pagination/pagination-button.js","../../../../packages/design-system/dist/src/powerhouse/components/pagination/pagination.js","../../../../packages/design-system/dist/src/powerhouse/hooks/usePagination.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constants.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constructFrom.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/toDate.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/defaultOptions.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfWeek.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfISOWeek.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getISOWeekYear.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/normalizeDates.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfDay.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarDays.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfISOWeekYear.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/compareAsc.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constructNow.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isDate.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isValid.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarMonths.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/getRoundingMethod.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInMilliseconds.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfDay.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfMonth.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isLastDayOfMonth.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInMonths.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInSeconds.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfYear.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatLong.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/localize.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchFn.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/match.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDayOfYear.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getISOWeek.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getWeekYear.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfWeekYear.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getWeek.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/addLeadingZeros.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/format/lightFormatters.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/format/formatters.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/format/longFormatters.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/protectedTokens.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/format.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistance.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatDistanceToNow.js","../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parseISO.js","../../../../node_modules/.pnpm/lz-string@1.5.0/node_modules/lz-string/libs/lz-string.js","../../../../packages/design-system/dist/src/connect/components/default-editor-loader/default-editor-loader.js","../../../../packages/design-system/dist/src/connect/components/document-timeline/components/h-divider.js","../../../../packages/design-system/dist/src/connect/components/document-timeline/components/timeline-bar.js","../../../../packages/design-system/dist/src/connect/components/document-timeline/document-timeline.js","../../../../packages/design-system/dist/src/connect/components/document-toolbar/document-toolbar.js","../../../../packages/design-system/dist/src/connect/components/home-screen/home-screen-item/home-screen-item.js","../../../../packages/design-system/dist/src/connect/components/home-screen/home-screen-add-drive-item/home-screen-add-drive-item.js","../../../../packages/design-system/dist/src/connect/components/revision-history/header/branch.js","../../../../packages/design-system/dist/src/connect/components/revision-history/header/doc-id.js","../../../../packages/design-system/dist/src/connect/components/revision-history/header/scope.js","../../../../packages/design-system/dist/src/connect/components/revision-history/header/header.js","../../../../packages/design-system/dist/src/connect/components/revision-history/revision/address.js","../../../../packages/design-system/dist/src/connect/components/revision-history/revision/errors.js","../../../../packages/design-system/dist/src/connect/components/revision-history/revision/operation.js","../../../../packages/design-system/dist/src/connect/components/revision-history/revision/revision-number.js","../../../../packages/design-system/dist/src/connect/components/revision-history/revision/signature.js","../../../../packages/design-system/dist/src/connect/components/revision-history/revision/timestamp.js","../../../../packages/design-system/dist/src/connect/components/revision-history/revision/revision.js","../../../../packages/design-system/dist/src/connect/components/revision-history/skip/skip.js","../../../../packages/design-system/dist/src/connect/components/revision-history/utils.js","../../../../packages/design-system/dist/src/connect/components/revision-history/timeline/day.js","../../../../packages/design-system/dist/src/connect/components/revision-history/timeline/timeline.js","../../../../packages/design-system/dist/src/connect/components/revision-history/revision-history.js","../../../../packages/design-system/dist/src/connect/components/tooltip/tooltip.js","../../../../packages/design-system/dist/src/connect/utils/address.js","../../../../packages/reactor-browser/dist/src/utils/switchboard.js","../../src/utils/openUrl.ts","../../src/utils/validate-document.ts","../../../../packages/reactor-browser/dist/src/analytics/hooks.js","../../../../packages/common/dist/hooks/useTimelineItems.js","../../../../packages/common/dist/utils/index.js","../../src/components/editor-loader.tsx","../../src/components/editors.tsx","../../src/components/document-editor-container.tsx","../../src/components/drive-editor-container.tsx","../../src/hooks/useNodeActions.ts","../../../../node_modules/.pnpm/react-hotkeys-hook@4.6.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-hotkeys-hook/dist/react-hotkeys-hook.esm.js","../../src/hooks/useUndoRedoShortcuts.ts","../../src/pages/content.tsx"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { Button, mergeClassNameProps } from \"#powerhouse\";\nimport { twMerge } from \"tailwind-merge\";\nexport const PaginationButton = ({ active = false, ...props }) => {\n const className = twMerge(\"h-8 min-w-8 border border-solid border-gray-300 bg-white px-3 py-1 text-xs text-gray-900 hover:bg-gray-100\", !active && \"border-0\");\n return (_jsx(Button, { color: \"light\", size: \"small\", ...mergeClassNameProps(props, className), children: props.children }));\n};\n//# sourceMappingURL=pagination-button.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Icon } from \"#powerhouse\";\nimport { PaginationButton } from \"./pagination-button.js\";\nexport const Pagination = (props) => {\n const { pages = [], goToFirstPage, goToLastPage, goToNextPage, goToPreviousPage, goToPage, isNextPageAvailable, isPreviousPageAvailable, hiddenNextPages, firstPageLabel = \"First\", lastPageLabel = \"Last\", nextPageLabel = \"Next\", previousPageLabel = \"Previous\", } = props;\n return (_jsxs(\"div\", { className: \"flex gap-x-1\", children: [firstPageLabel ? (_jsx(PaginationButton, { disabled: !isPreviousPageAvailable, onClick: () => goToFirstPage(), children: firstPageLabel })) : null, previousPageLabel ? (_jsxs(PaginationButton, { disabled: !isPreviousPageAvailable, onClick: () => goToPreviousPage(), children: [_jsx(Icon, { className: \"rotate-90\", name: \"ChevronDown\", size: 16 }), previousPageLabel] })) : null, pages.map((page) => (_jsx(PaginationButton, { active: page.active, onClick: () => goToPage(page.index), children: page.number }, page.index))), hiddenNextPages ? (_jsx(\"span\", { className: \"flex items-center justify-center px-2\", children: \"...\" })) : null, nextPageLabel ? (_jsxs(PaginationButton, { disabled: !isNextPageAvailable, onClick: () => goToNextPage(), children: [nextPageLabel, _jsx(Icon, { className: \"-rotate-90\", name: \"ChevronDown\", size: 16 })] })) : null, lastPageLabel ? (_jsx(PaginationButton, { disabled: !isNextPageAvailable, onClick: () => goToLastPage(), children: lastPageLabel })) : null] }));\n};\n//# sourceMappingURL=pagination.js.map","import { useCallback, useMemo, useState } from \"react\";\n/**\n * Custom hook for pagination.\n *\n * @template T - The type of items in the pagination.\n * @param {T[]} items - The array of items to paginate.\n * @param {UsePaginationOptions} [options] - The pagination options.\n * @returns {{\n * pages: PageItem[]; - The array of page items.\n * goToPage: (page: number) => void; - The function to go to a specific page.\n * pageItems: T[]; - The array of items for the current page.\n * pageCount: number; - The total number of pages.\n * currentPage: number; - The current page index.\n * goToLastPage: () => void; - The function to go to the last page.\n * goToFirstPage: () => void; - The function to go to the first page.\n * goToNextPage: () => void; - The function to go to the next page.\n * goToPreviousPage: () => void; - The function to go to the previous page.\n * isNextPageAvailable: boolean; - The flag to indicate if the next page is available.\n * isPreviousPageAvailable: boolean; - The flag to indicate if the previous page is available.\n * }} - The pagination object with various functions and properties.\n */\nexport function usePagination(items, options) {\n const { itemsPerPage = 20, initialPage = 0, pageRange = 3 } = options || {};\n const [currentPage, setCurrentPage] = useState(initialPage);\n const pageCount = Math.ceil(items.length / itemsPerPage);\n const isNextPageAvailable = currentPage < pageCount - 1;\n const isPreviousPageAvailable = currentPage > 0;\n const goToNextPage = useCallback(() => {\n if (isNextPageAvailable) {\n setCurrentPage((prev) => prev + 1);\n }\n }, [isNextPageAvailable, setCurrentPage]);\n const goToPreviousPage = useCallback(() => {\n if (isPreviousPageAvailable) {\n setCurrentPage((prev) => prev - 1);\n }\n }, [isPreviousPageAvailable, setCurrentPage]);\n const goToLastPage = useCallback(() => {\n setCurrentPage(pageCount - 1);\n }, [pageCount]);\n const goToFirstPage = useCallback(() => {\n setCurrentPage(0);\n }, []);\n const goToPage = useCallback((page) => {\n if (page >= 0 && page < pageCount) {\n setCurrentPage(page);\n }\n }, [pageCount]);\n const pageOffset = Math.floor((pageRange - 1) / 2);\n const availableRange = Math.min(pageRange, pageCount);\n const maxStartIndex = Math.max(pageCount - availableRange);\n const startIndex = Math.min(maxStartIndex, Math.max(currentPage - pageOffset, 0));\n const pages = useMemo(() => {\n const range = [];\n for (let i = startIndex; i < availableRange + startIndex; i++) {\n range.push({\n index: i,\n active: i === currentPage,\n number: i + 1,\n });\n }\n return range;\n }, [availableRange, startIndex, currentPage]);\n const pageItems = items.slice(currentPage * itemsPerPage, (currentPage + 1) * itemsPerPage);\n const hiddenNextPages = pages.length > 0 && pages.slice(-1)[0].index < pageCount - 1;\n return {\n pages,\n goToPage,\n pageItems,\n pageCount,\n currentPage,\n goToLastPage,\n goToFirstPage,\n goToNextPage,\n hiddenNextPages,\n goToPreviousPage,\n isNextPageAvailable,\n isPreviousPageAvailable,\n };\n}\n//# sourceMappingURL=usePagination.js.map","/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n\n/**\n * @constant\n * @name constructFromSymbol\n * @summary Symbol enabling Date extensions to inherit properties from the reference date.\n *\n * The symbol is used to enable the `constructFrom` function to construct a date\n * using a reference date and a value. It allows to transfer extra properties\n * from the reference date to the new date. It's useful for extensions like\n * [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as\n * a constructor argument.\n */\nexport const constructFromSymbol = Symbol.for(\"constructDateFrom\");\n","import { constructFromSymbol } from \"./constants.js\";\n\n/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * Starting from v3.7.0, it allows to construct a date using `[Symbol.for(\"constructDateFrom\")]`\n * enabling to transfer extra properties from the reference date to the new date.\n * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)\n * that accept a time zone as a constructor argument.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from \"./constructFrom/date-fns\";\n *\n * // A function that clones a date preserving the original type\n * function cloneDate<DateType extends Date>(date: DateType): DateType {\n * return constructFrom(\n * date, // Use constructor from the given date\n * date.getTime() // Use the date value to create a new date\n * );\n * }\n */\nexport function constructFrom(date, value) {\n if (typeof date === \"function\") return date(value);\n\n if (date && typeof date === \"object\" && constructFromSymbol in date)\n return date[constructFromSymbol](value);\n\n if (date instanceof Date) return new date.constructor(value);\n\n return new Date(value);\n}\n\n// Fallback for modularized imports:\nexport default constructFrom;\n","import { constructFrom } from \"./constructFrom.js\";\n\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * Starting from v3.7.0, it clones a date using `[Symbol.for(\"constructDateFrom\")]`\n * enabling to transfer extra properties from the reference date to the new date.\n * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)\n * that accept a time zone as a constructor argument.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument, context) {\n // [TODO] Get rid of `toDate` or `constructFrom`?\n return constructFrom(context || argument, argument);\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n","let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n","import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date, options?.in);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n","import { startOfWeek } from \"./startOfWeek.js\";\n\n/**\n * The {@link startOfISOWeek} function options.\n */\n\n/**\n * @name startOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of an ISO week\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfISOWeek(date, options) {\n return startOfWeek(date, { ...options, weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeek;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { startOfISOWeek } from \"./startOfISOWeek.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getISOWeekYear} function options.\n */\n\n/**\n * @name getISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param date - The given date\n *\n * @returns The ISO week-numbering year\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * const result = getISOWeekYear(new Date(2005, 0, 2))\n * //=> 2004\n */\nexport function getISOWeekYear(date, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n\n const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n\n const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getISOWeekYear;\n","import { toDate } from \"../toDate.js\";\n\n/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const _date = toDate(date);\n const utcDate = new Date(\n Date.UTC(\n _date.getFullYear(),\n _date.getMonth(),\n _date.getDate(),\n _date.getHours(),\n _date.getMinutes(),\n _date.getSeconds(),\n _date.getMilliseconds(),\n ),\n );\n utcDate.setUTCFullYear(_date.getFullYear());\n return +date - +utcDate;\n}\n","import { constructFrom } from \"../constructFrom.js\";\n\nexport function normalizeDates(context, ...dates) {\n const normalize = constructFrom.bind(\n null,\n context || dates.find((date) => typeof date === \"object\"),\n );\n return dates.map(normalize);\n}\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfDay} function options.\n */\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - The options\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date, options) {\n const _date = toDate(date, options?.in);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n","import { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { millisecondsInDay } from \"./constants.js\";\nimport { startOfDay } from \"./startOfDay.js\";\n\n/**\n * The {@link differenceInCalendarDays} function options.\n */\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - The options object\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n const laterStartOfDay = startOfDay(laterDate_);\n const earlierStartOfDay = startOfDay(earlierDate_);\n\n const laterTimestamp =\n +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);\n const earlierTimestamp =\n +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);\n\n // Round the number of days to the nearest integer because the number of\n // milliseconds in a day is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { getISOWeekYear } from \"./getISOWeekYear.js\";\nimport { startOfISOWeek } from \"./startOfISOWeek.js\";\n\n/**\n * The {@link startOfISOWeekYear} function options.\n */\n\n/**\n * @name startOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of an ISO week-numbering year\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * const result = startOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfISOWeekYear(date, options) {\n const year = getISOWeekYear(date, options);\n const fourthOfJanuary = constructFrom(options?.in || date, 0);\n fourthOfJanuary.setFullYear(year, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n return startOfISOWeek(fourthOfJanuary);\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeekYear;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name compareAsc\n * @category Common Helpers\n * @summary Compare the two dates and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return 1 if the first date is after the second,\n * -1 if the first date is before the second or 0 if dates are equal.\n *\n * @param dateLeft - The first date to compare\n * @param dateRight - The second date to compare\n *\n * @returns The result of the comparison\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989:\n * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))\n * //=> -1\n *\n * @example\n * // Sort the array of dates:\n * const result = [\n * new Date(1995, 6, 2),\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * ].sort(compareAsc)\n * //=> [\n * // Wed Feb 11 1987 00:00:00,\n * // Mon Jul 10 1989 00:00:00,\n * // Sun Jul 02 1995 00:00:00\n * // ]\n */\nexport function compareAsc(dateLeft, dateRight) {\n const diff = +toDate(dateLeft) - +toDate(dateRight);\n\n if (diff < 0) return -1;\n else if (diff > 0) return 1;\n\n // Return 0 if diff is 0; return NaN if diff is NaN\n return diff;\n}\n\n// Fallback for modularized imports:\nexport default compareAsc;\n","import { constructFrom } from \"./constructFrom.js\";\n\n/**\n * @name constructNow\n * @category Generic Helpers\n * @summary Constructs a new current date using the passed value constructor.\n * @pure false\n *\n * @description\n * The function constructs a new current date using the constructor from\n * the reference date. It helps to build generic functions that accept date\n * extensions and use the current date.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * @param date - The reference date to take constructor from\n *\n * @returns Current date initialized using the given date constructor\n *\n * @example\n * import { constructNow, isSameDay } from 'date-fns'\n *\n * function isToday<DateType extends Date>(\n * date: DateArg<DateType>,\n * ): boolean {\n * // If we were to use `new Date()` directly, the function would behave\n * // differently in different timezones and return false for the same date.\n * return isSameDay(date, constructNow(date));\n * }\n */\nexport function constructNow(date) {\n return constructFrom(date, Date.now());\n}\n\n// Fallback for modularized imports:\nexport default constructNow;\n","/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n return (\n value instanceof Date ||\n (typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Date]\")\n );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n","import { isDate } from \"./isDate.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @param date - The date to check\n *\n * @returns The date is valid\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertible into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nexport function isValid(date) {\n return !((!isDate(date) && typeof date !== \"number\") || isNaN(+toDate(date)));\n}\n\n// Fallback for modularized imports:\nexport default isValid;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\n\n/**\n * The {@link differenceInCalendarMonths} function options.\n */\n\n/**\n * @name differenceInCalendarMonths\n * @category Month Helpers\n * @summary Get the number of calendar months between the given dates.\n *\n * @description\n * Get the number of calendar months between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n *\n * @returns The number of calendar months\n *\n * @example\n * // How many calendar months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInCalendarMonths(\n * new Date(2014, 8, 1),\n * new Date(2014, 0, 31)\n * )\n * //=> 8\n */\nexport function differenceInCalendarMonths(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();\n const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();\n\n return yearsDiff * 12 + monthsDiff;\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarMonths;\n","export function getRoundingMethod(method) {\n return (number) => {\n const round = method ? Math[method] : Math.trunc;\n const result = round(number);\n // Prevent negative zero\n return result === 0 ? 0 : result;\n };\n}\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name differenceInMilliseconds\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n *\n * @returns The number of milliseconds\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * const result = differenceInMilliseconds(\n * new Date(2014, 6, 2, 12, 30, 21, 700),\n * new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\nexport function differenceInMilliseconds(laterDate, earlierDate) {\n return +toDate(laterDate) - +toDate(earlierDate);\n}\n\n// Fallback for modularized imports:\nexport default differenceInMilliseconds;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link endOfDay} function options.\n */\n\n/**\n * @name endOfDay\n * @category Day Helpers\n * @summary Return the end of a day for the given date.\n *\n * @description\n * Return the end of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The end of a day\n *\n * @example\n * // The end of a day for 2 September 2014 11:55:00:\n * const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 23:59:59.999\n */\nexport function endOfDay(date, options) {\n const _date = toDate(date, options?.in);\n _date.setHours(23, 59, 59, 999);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default endOfDay;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link endOfMonth} function options.\n */\n\n/**\n * @name endOfMonth\n * @category Month Helpers\n * @summary Return the end of a month for the given date.\n *\n * @description\n * Return the end of a month for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The end of a month\n *\n * @example\n * // The end of a month for 2 September 2014 11:55:00:\n * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\nexport function endOfMonth(date, options) {\n const _date = toDate(date, options?.in);\n const month = _date.getMonth();\n _date.setFullYear(_date.getFullYear(), month + 1, 0);\n _date.setHours(23, 59, 59, 999);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default endOfMonth;\n","import { endOfDay } from \"./endOfDay.js\";\nimport { endOfMonth } from \"./endOfMonth.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * @name isLastDayOfMonth\n * @category Month Helpers\n * @summary Is the given date the last day of a month?\n *\n * @description\n * Is the given date the last day of a month?\n *\n * @param date - The date to check\n * @param options - An object with options\n *\n * @returns The date is the last day of a month\n *\n * @example\n * // Is 28 February 2014 the last day of a month?\n * const result = isLastDayOfMonth(new Date(2014, 1, 28))\n * //=> true\n */\nexport function isLastDayOfMonth(date, options) {\n const _date = toDate(date, options?.in);\n return +endOfDay(_date, options) === +endOfMonth(_date, options);\n}\n\n// Fallback for modularized imports:\nexport default isLastDayOfMonth;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { compareAsc } from \"./compareAsc.js\";\nimport { differenceInCalendarMonths } from \"./differenceInCalendarMonths.js\";\nimport { isLastDayOfMonth } from \"./isLastDayOfMonth.js\";\n\n/**\n * The {@link differenceInMonths} function options.\n */\n\n/**\n * @name differenceInMonths\n * @category Month Helpers\n * @summary Get the number of full months between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n *\n * @returns The number of full months\n *\n * @example\n * // How many full months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))\n * //=> 7\n */\nexport function differenceInMonths(laterDate, earlierDate, options) {\n const [laterDate_, workingLaterDate, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n laterDate,\n earlierDate,\n );\n\n const sign = compareAsc(workingLaterDate, earlierDate_);\n const difference = Math.abs(\n differenceInCalendarMonths(workingLaterDate, earlierDate_),\n );\n\n if (difference < 1) return 0;\n\n if (workingLaterDate.getMonth() === 1 && workingLaterDate.getDate() > 27)\n workingLaterDate.setDate(30);\n\n workingLaterDate.setMonth(workingLaterDate.getMonth() - sign * difference);\n\n let isLastMonthNotFull = compareAsc(workingLaterDate, earlierDate_) === -sign;\n\n if (\n isLastDayOfMonth(laterDate_) &&\n difference === 1 &&\n compareAsc(laterDate_, earlierDate_) === 1\n ) {\n isLastMonthNotFull = false;\n }\n\n const result = sign * (difference - +isLastMonthNotFull);\n return result === 0 ? 0 : result;\n}\n\n// Fallback for modularized imports:\nexport default differenceInMonths;\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { differenceInMilliseconds } from \"./differenceInMilliseconds.js\";\n\n/**\n * The {@link differenceInSeconds} function options.\n */\n\n/**\n * @name differenceInSeconds\n * @category Second Helpers\n * @summary Get the number of seconds between the given dates.\n *\n * @description\n * Get the number of seconds between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of seconds\n *\n * @example\n * // How many seconds are between\n * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?\n * const result = differenceInSeconds(\n * new Date(2014, 6, 2, 12, 30, 20, 0),\n * new Date(2014, 6, 2, 12, 30, 7, 999)\n * )\n * //=> 12\n */\nexport function differenceInSeconds(laterDate, earlierDate, options) {\n const diff = differenceInMilliseconds(laterDate, earlierDate) / 1000;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInSeconds;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfYear} function options.\n */\n\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - The options\n *\n * @returns The start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nexport function startOfYear(date, options) {\n const date_ = toDate(date, options?.in);\n date_.setFullYear(date_.getFullYear(), 0, 1);\n date_.setHours(0, 0, 0, 0);\n return date_;\n}\n\n// Fallback for modularized imports:\nexport default startOfYear;\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n","export function buildFormatLongFn(args) {\n return (options = {}) => {\n // TODO: Remove String()\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.js\";\n\nconst dateFormats = {\n full: \"EEEE, MMMM do, y\",\n long: \"MMMM do, y\",\n medium: \"MMM d, y\",\n short: \"MM/dd/yyyy\",\n};\n\nconst timeFormats = {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","const formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n","/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n\n valuesArray =\n args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.js\";\n\nconst eraValues = {\n narrow: [\"B\", \"A\"],\n abbreviated: [\"BC\", \"AD\"],\n wide: [\"Before Christ\", \"Anno Domini\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"],\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n\n // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n const rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + \"st\";\n case 2:\n return number + \"nd\";\n case 3:\n return number + \"rd\";\n }\n }\n return number + \"th\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","export function buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n\n const matchPattern =\n (width && args.matchPatterns[width]) ||\n args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n\n const parsePatterns =\n (width && args.parsePatterns[width]) ||\n args.parsePatterns[args.defaultParseWidth];\n\n const key = Array.isArray(parsePatterns)\n ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n : // [TODO] -- I challenge you to fix the type\n findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n let value;\n\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback\n ? // [TODO] -- I challenge you to fix the type\n options.valueCallback(value)\n : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (\n Object.prototype.hasOwnProperty.call(object, key) &&\n predicate(object[key])\n ) {\n return key;\n }\n }\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (let key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}\n","export function buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n const matchedString = matchResult[0];\n\n const parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n let value = args.valueCallback\n ? args.valueCallback(parseResult[0])\n : parseResult[0];\n\n // [TODO] I challenge you to fix the type\n value = options.valueCallback ? options.valueCallback(value) : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.js\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.js\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i,\n};\nconst parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^ap/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { formatDistance } from \"./en-US/_lib/formatDistance.js\";\nimport { formatLong } from \"./en-US/_lib/formatLong.js\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.js\";\nimport { localize } from \"./en-US/_lib/localize.js\";\nimport { match } from \"./en-US/_lib/match.js\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n","import { differenceInCalendarDays } from \"./differenceInCalendarDays.js\";\nimport { startOfYear } from \"./startOfYear.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getDayOfYear} function options.\n */\n\n/**\n * @name getDayOfYear\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * @param date - The given date\n * @param options - The options\n *\n * @returns The day of year\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * const result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\nexport function getDayOfYear(date, options) {\n const _date = toDate(date, options?.in);\n const diff = differenceInCalendarDays(_date, startOfYear(_date));\n const dayOfYear = diff + 1;\n return dayOfYear;\n}\n\n// Fallback for modularized imports:\nexport default getDayOfYear;\n","import { millisecondsInWeek } from \"./constants.js\";\nimport { startOfISOWeek } from \"./startOfISOWeek.js\";\nimport { startOfISOWeekYear } from \"./startOfISOWeekYear.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getISOWeek} function options.\n */\n\n/**\n * @name getISOWeek\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param date - The given date\n * @param options - The options\n *\n * @returns The ISO week\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * const result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\nexport function getISOWeek(date, options) {\n const _date = toDate(date, options?.in);\n const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);\n\n // Round the number of weeks to the nearest integer because the number of\n // milliseconds in a week is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getISOWeek;\n","import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { constructFrom } from \"./constructFrom.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getWeekYear} function options.\n */\n\n/**\n * @name getWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Get the local week-numbering year of the given date.\n *\n * @description\n * Get the local week-numbering year of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The local week-numbering year\n *\n * @example\n * // Which week numbering year is 26 December 2004 with the default settings?\n * const result = getWeekYear(new Date(2004, 11, 26))\n * //=> 2005\n *\n * @example\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\n * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\n * //=> 2004\n *\n * @example\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\n * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\n * //=> 2004\n */\nexport function getWeekYear(date, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const firstWeekOfNextYear = constructFrom(options?.in || date, 0);\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);\n\n const firstWeekOfThisYear = constructFrom(options?.in || date, 0);\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);\n\n if (+_date >= +startOfNextYear) {\n return year + 1;\n } else if (+_date >= +startOfThisYear) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getWeekYear;\n","import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { constructFrom } from \"./constructFrom.js\";\nimport { getWeekYear } from \"./getWeekYear.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\n\n/**\n * The {@link startOfWeekYear} function options.\n */\n\n/**\n * @name startOfWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Return the start of a local week-numbering year for the given date.\n *\n * @description\n * Return the start of a local week-numbering year.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week-numbering year\n *\n * @example\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\n * const result = startOfWeekYear(new Date(2005, 6, 2))\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // The start of a week-numbering year for 2 July 2005\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * const result = startOfWeekYear(new Date(2005, 6, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfWeekYear(date, options) {\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const year = getWeekYear(date, options);\n const firstWeek = constructFrom(options?.in || date, 0);\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n const _date = startOfWeek(firstWeek, options);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeekYear;\n","import { millisecondsInWeek } from \"./constants.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\nimport { startOfWeekYear } from \"./startOfWeekYear.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getWeek} function options.\n */\n\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The week\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * const result = getWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * const result = getWeek(new Date(2005, 0, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> 53\n */\nexport function getWeek(date, options) {\n const _date = toDate(date, options?.in);\n const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);\n\n // Round the number of weeks to the nearest integer because the number of\n // milliseconds in a week is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getWeek;\n","export function addLeadingZeros(number, targetLength) {\n const sign = number < 0 ? \"-\" : \"\";\n const output = Math.abs(number).toString().padStart(targetLength, \"0\");\n return sign + output;\n}\n","import { addLeadingZeros } from \"../addLeadingZeros.js\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nexport const lightFormatters = {\n // Year\n y(date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === \"yy\" ? year % 100 : year, token.length);\n },\n\n // Month\n M(date, token) {\n const month = date.getMonth();\n return token === \"M\" ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n\n // Day of the month\n d(date, token) {\n return addLeadingZeros(date.getDate(), token.length);\n },\n\n // AM or PM\n a(date, token) {\n const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return dayPeriodEnumValue.toUpperCase();\n case \"aaa\":\n return dayPeriodEnumValue;\n case \"aaaaa\":\n return dayPeriodEnumValue[0];\n case \"aaaa\":\n default:\n return dayPeriodEnumValue === \"am\" ? \"a.m.\" : \"p.m.\";\n }\n },\n\n // Hour [1-12]\n h(date, token) {\n return addLeadingZeros(date.getHours() % 12 || 12, token.length);\n },\n\n // Hour [0-23]\n H(date, token) {\n return addLeadingZeros(date.getHours(), token.length);\n },\n\n // Minute\n m(date, token) {\n return addLeadingZeros(date.getMinutes(), token.length);\n },\n\n // Second\n s(date, token) {\n return addLeadingZeros(date.getSeconds(), token.length);\n },\n\n // Fraction of second\n S(date, token) {\n const numberOfDigits = token.length;\n const milliseconds = date.getMilliseconds();\n const fractionalSeconds = Math.trunc(\n milliseconds * Math.pow(10, numberOfDigits - 3),\n );\n return addLeadingZeros(fractionalSeconds, token.length);\n },\n};\n","import { getDayOfYear } from \"../../getDayOfYear.js\";\nimport { getISOWeek } from \"../../getISOWeek.js\";\nimport { getISOWeekYear } from \"../../getISOWeekYear.js\";\nimport { getWeek } from \"../../getWeek.js\";\nimport { getWeekYear } from \"../../getWeekYear.js\";\n\nimport { addLeadingZeros } from \"../addLeadingZeros.js\";\nimport { lightFormatters } from \"./lightFormatters.js\";\n\nconst dayPeriodEnum = {\n am: \"am\",\n pm: \"pm\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n};\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nexport const formatters = {\n // Era\n G: function (date, token, localize) {\n const era = date.getFullYear() > 0 ? 1 : 0;\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return localize.era(era, { width: \"abbreviated\" });\n // A, B\n case \"GGGGG\":\n return localize.era(era, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return localize.era(era, { width: \"wide\" });\n }\n },\n\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === \"yo\") {\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, { unit: \"year\" });\n }\n\n return lightFormatters.y(date, token);\n },\n\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n const signedWeekYear = getWeekYear(date, options);\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;\n\n // Two digit year\n if (token === \"YY\") {\n const twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n }\n\n // Ordinal number\n if (token === \"Yo\") {\n return localize.ordinalNumber(weekYear, { unit: \"year\" });\n }\n\n // Padding\n return addLeadingZeros(weekYear, token.length);\n },\n\n // ISO week-numbering year\n R: function (date, token) {\n const isoWeekYear = getISOWeekYear(date);\n\n // Padding\n return addLeadingZeros(isoWeekYear, token.length);\n },\n\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n const year = date.getFullYear();\n return addLeadingZeros(year, token.length);\n },\n\n // Quarter\n Q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"QQ\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone quarter\n q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"qq\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // Month\n M: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n case \"M\":\n case \"MM\":\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // J, F, ..., D\n case \"MMMMM\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return localize.month(month, { width: \"wide\", context: \"formatting\" });\n }\n },\n\n // Stand-alone month\n L: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return String(month + 1);\n // 01, 02, ..., 12\n case \"LL\":\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // J, F, ..., D\n case \"LLLLL\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return localize.month(month, { width: \"wide\", context: \"standalone\" });\n }\n },\n\n // Local week of year\n w: function (date, token, localize, options) {\n const week = getWeek(date, options);\n\n if (token === \"wo\") {\n return localize.ordinalNumber(week, { unit: \"week\" });\n }\n\n return addLeadingZeros(week, token.length);\n },\n\n // ISO week of year\n I: function (date, token, localize) {\n const isoWeek = getISOWeek(date);\n\n if (token === \"Io\") {\n return localize.ordinalNumber(isoWeek, { unit: \"week\" });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n\n // Day of the month\n d: function (date, token, localize) {\n if (token === \"do\") {\n return localize.ordinalNumber(date.getDate(), { unit: \"date\" });\n }\n\n return lightFormatters.d(date, token);\n },\n\n // Day of year\n D: function (date, token, localize) {\n const dayOfYear = getDayOfYear(date);\n\n if (token === \"Do\") {\n return localize.ordinalNumber(dayOfYear, { unit: \"dayOfYear\" });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n\n // Day of week\n E: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"EEEEE\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"EEEE\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Local day of week\n e: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case \"e\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"ee\":\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n case \"eo\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"eee\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"eeeee\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"eeee\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (same as in `e`)\n case \"c\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"cc\":\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n case \"co\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"ccc\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // T\n case \"ccccc\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"standalone\",\n });\n // Tuesday\n case \"cccc\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // ISO day of week\n i: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n switch (token) {\n // 2\n case \"i\":\n return String(isoDayOfWeek);\n // 02\n case \"ii\":\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n case \"io\":\n return localize.ordinalNumber(isoDayOfWeek, { unit: \"day\" });\n // Tue\n case \"iii\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"iiiii\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"iiiiii\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"iiii\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM or PM\n a: function (date, token, localize) {\n const hours = date.getHours();\n const dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"aaa\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"aaaaa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n }\n\n switch (token) {\n case \"b\":\n case \"bb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"bbb\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"bbbbb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"BBBBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === \"ho\") {\n let hours = date.getHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return lightFormatters.h(date, token);\n },\n\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === \"Ho\") {\n return localize.ordinalNumber(date.getHours(), { unit: \"hour\" });\n }\n\n return lightFormatters.H(date, token);\n },\n\n // Hour [0-11]\n K: function (date, token, localize) {\n const hours = date.getHours() % 12;\n\n if (token === \"Ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Hour [1-24]\n k: function (date, token, localize) {\n let hours = date.getHours();\n if (hours === 0) hours = 24;\n\n if (token === \"ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Minute\n m: function (date, token, localize) {\n if (token === \"mo\") {\n return localize.ordinalNumber(date.getMinutes(), { unit: \"minute\" });\n }\n\n return lightFormatters.m(date, token);\n },\n\n // Second\n s: function (date, token, localize) {\n if (token === \"so\") {\n return localize.ordinalNumber(date.getSeconds(), { unit: \"second\" });\n }\n\n return lightFormatters.s(date, token);\n },\n\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return \"Z\";\n }\n\n switch (token) {\n // Hours and optional minutes\n case \"X\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n case \"XXXX\":\n case \"XX\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n case \"XXXXX\":\n case \"XXX\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case \"x\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n case \"xxxx\":\n case \"xx\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n case \"xxxxx\":\n case \"xxx\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (GMT)\n O: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"O\":\n case \"OO\":\n case \"OOO\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"OOOO\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (specific non-location)\n z: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"z\":\n case \"zz\":\n case \"zzz\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"zzzz\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Seconds timestamp\n t: function (date, token, _localize) {\n const timestamp = Math.trunc(+date / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n\n // Milliseconds timestamp\n T: function (date, token, _localize) {\n return addLeadingZeros(+date, token.length);\n },\n};\n\nfunction formatTimezoneShort(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = Math.trunc(absOffset / 60);\n const minutes = absOffset % 60;\n if (minutes === 0) {\n return sign + String(hours);\n }\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, delimiter) {\n if (offset % 60 === 0) {\n const sign = offset > 0 ? \"-\" : \"+\";\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n return formatTimezone(offset, delimiter);\n}\n\nfunction formatTimezone(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);\n const minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n","const dateLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"P\":\n return formatLong.date({ width: \"short\" });\n case \"PP\":\n return formatLong.date({ width: \"medium\" });\n case \"PPP\":\n return formatLong.date({ width: \"long\" });\n case \"PPPP\":\n default:\n return formatLong.date({ width: \"full\" });\n }\n};\n\nconst timeLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"p\":\n return formatLong.time({ width: \"short\" });\n case \"pp\":\n return formatLong.time({ width: \"medium\" });\n case \"ppp\":\n return formatLong.time({ width: \"long\" });\n case \"pppp\":\n default:\n return formatLong.time({ width: \"full\" });\n }\n};\n\nconst dateTimeLongFormatter = (pattern, formatLong) => {\n const matchResult = pattern.match(/(P+)(p+)?/) || [];\n const datePattern = matchResult[1];\n const timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n let dateTimeFormat;\n\n switch (datePattern) {\n case \"P\":\n dateTimeFormat = formatLong.dateTime({ width: \"short\" });\n break;\n case \"PP\":\n dateTimeFormat = formatLong.dateTime({ width: \"medium\" });\n break;\n case \"PPP\":\n dateTimeFormat = formatLong.dateTime({ width: \"long\" });\n break;\n case \"PPPP\":\n default:\n dateTimeFormat = formatLong.dateTime({ width: \"full\" });\n break;\n }\n\n return dateTimeFormat\n .replace(\"{{date}}\", dateLongFormatter(datePattern, formatLong))\n .replace(\"{{time}}\", timeLongFormatter(timePattern, formatLong));\n};\n\nexport const longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter,\n};\n","const dayOfYearTokenRE = /^D+$/;\nconst weekYearTokenRE = /^Y+$/;\n\nconst throwTokens = [\"D\", \"DD\", \"YY\", \"YYYY\"];\n\nexport function isProtectedDayOfYearToken(token) {\n return dayOfYearTokenRE.test(token);\n}\n\nexport function isProtectedWeekYearToken(token) {\n return weekYearTokenRE.test(token);\n}\n\nexport function warnOrThrowProtectedError(token, format, input) {\n const _message = message(token, format, input);\n console.warn(_message);\n if (throwTokens.includes(token)) throw new RangeError(_message);\n}\n\nfunction message(token, format, input) {\n const subject = token[0] === \"Y\" ? \"years\" : \"days of the month\";\n return `Use \\`${token.toLowerCase()}\\` instead of \\`${token}\\` (in \\`${format}\\`) for formatting ${subject} to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;\n}\n","import { defaultLocale } from \"./_lib/defaultLocale.js\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { formatters } from \"./_lib/format/formatters.js\";\nimport { longFormatters } from \"./_lib/format/longFormatters.js\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n warnOrThrowProtectedError,\n} from \"./_lib/protectedTokens.js\";\nimport { isValid } from \"./isValid.js\";\nimport { toDate } from \"./toDate.js\";\n\n// Rexports of internal for libraries to use.\n// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874\nexport { formatters, longFormatters };\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\nexport { format as formatDate };\n\n/**\n * The {@link format} function options.\n */\n\n/**\n * @name format\n * @alias formatDate\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)\n * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @param date - The original date\n * @param format - The string of tokens\n * @param options - An object with options\n *\n * @returns The formatted date string\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const originalDate = toDate(date, options?.in);\n\n if (!isValid(originalDate)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n let parts = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp)\n .map((substring) => {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return { isToken: false, value: \"'\" };\n }\n\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return { isToken: false, value: cleanEscapedString(substring) };\n }\n\n if (formatters[firstCharacter]) {\n return { isToken: true, value: substring };\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n return { isToken: false, value: substring };\n });\n\n // invoke localize preprocessor (only for french locales at the moment)\n if (locale.localize.preprocessor) {\n parts = locale.localize.preprocessor(originalDate, parts);\n }\n\n const formatterOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n return parts\n .map((part) => {\n if (!part.isToken) return part.value;\n\n const token = part.value;\n\n if (\n (!options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)) ||\n (!options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token))\n ) {\n warnOrThrowProtectedError(token, formatStr, String(date));\n }\n\n const formatter = formatters[token[0]];\n return formatter(originalDate, token, locale.localize, formatterOptions);\n })\n .join(\"\");\n}\n\nfunction cleanEscapedString(input) {\n const matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default format;\n","import { defaultLocale } from \"./_lib/defaultLocale.js\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { compareAsc } from \"./compareAsc.js\";\nimport { minutesInDay, minutesInMonth } from \"./constants.js\";\nimport { differenceInMonths } from \"./differenceInMonths.js\";\nimport { differenceInSeconds } from \"./differenceInSeconds.js\";\n\n/**\n * The {@link formatDistance} function options.\n */\n\n/**\n * @name formatDistance\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words.\n *\n * | Distance between dates | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance between dates | Result |\n * |------------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * @param laterDate - The date\n * @param earlierDate - The date to compare with\n * @param options - An object with options\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `baseDate` must not be Invalid Date\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * const result = formatDistance(new Date(2014, 6, 2), new Date(2015, 0, 1))\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00, including seconds?\n * const result = formatDistance(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0),\n * { includeSeconds: true }\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * const result = formatDistance(new Date(2015, 0, 1), new Date(2016, 0, 1), {\n * addSuffix: true\n * })\n * //=> 'about 1 year ago'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = formatDistance(new Date(2016, 7, 1), new Date(2015, 0, 1), {\n * locale: eoLocale\n * })\n * //=> 'pli ol 1 jaro'\n */\nexport function formatDistance(laterDate, earlierDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n const minutesInAlmostTwoDays = 2520;\n\n const comparison = compareAsc(laterDate, earlierDate);\n\n if (isNaN(comparison)) throw new RangeError(\"Invalid time value\");\n\n const localizeOptions = Object.assign({}, options, {\n addSuffix: options?.addSuffix,\n comparison: comparison,\n });\n\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n ...(comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]),\n );\n\n const seconds = differenceInSeconds(earlierDate_, laterDate_);\n const offsetInSeconds =\n (getTimezoneOffsetInMilliseconds(earlierDate_) -\n getTimezoneOffsetInMilliseconds(laterDate_)) /\n 1000;\n const minutes = Math.round((seconds - offsetInSeconds) / 60);\n let months;\n\n // 0 up to 2 mins\n if (minutes < 2) {\n if (options?.includeSeconds) {\n if (seconds < 5) {\n return locale.formatDistance(\"lessThanXSeconds\", 5, localizeOptions);\n } else if (seconds < 10) {\n return locale.formatDistance(\"lessThanXSeconds\", 10, localizeOptions);\n } else if (seconds < 20) {\n return locale.formatDistance(\"lessThanXSeconds\", 20, localizeOptions);\n } else if (seconds < 40) {\n return locale.formatDistance(\"halfAMinute\", 0, localizeOptions);\n } else if (seconds < 60) {\n return locale.formatDistance(\"lessThanXMinutes\", 1, localizeOptions);\n } else {\n return locale.formatDistance(\"xMinutes\", 1, localizeOptions);\n }\n } else {\n if (minutes === 0) {\n return locale.formatDistance(\"lessThanXMinutes\", 1, localizeOptions);\n } else {\n return locale.formatDistance(\"xMinutes\", minutes, localizeOptions);\n }\n }\n\n // 2 mins up to 0.75 hrs\n } else if (minutes < 45) {\n return locale.formatDistance(\"xMinutes\", minutes, localizeOptions);\n\n // 0.75 hrs up to 1.5 hrs\n } else if (minutes < 90) {\n return locale.formatDistance(\"aboutXHours\", 1, localizeOptions);\n\n // 1.5 hrs up to 24 hrs\n } else if (minutes < minutesInDay) {\n const hours = Math.round(minutes / 60);\n return locale.formatDistance(\"aboutXHours\", hours, localizeOptions);\n\n // 1 day up to 1.75 days\n } else if (minutes < minutesInAlmostTwoDays) {\n return locale.formatDistance(\"xDays\", 1, localizeOptions);\n\n // 1.75 days up to 30 days\n } else if (minutes < minutesInMonth) {\n const days = Math.round(minutes / minutesInDay);\n return locale.formatDistance(\"xDays\", days, localizeOptions);\n\n // 1 month up to 2 months\n } else if (minutes < minutesInMonth * 2) {\n months = Math.round(minutes / minutesInMonth);\n return locale.formatDistance(\"aboutXMonths\", months, localizeOptions);\n }\n\n months = differenceInMonths(earlierDate_, laterDate_);\n\n // 2 months up to 12 months\n if (months < 12) {\n const nearestMonth = Math.round(minutes / minutesInMonth);\n return locale.formatDistance(\"xMonths\", nearestMonth, localizeOptions);\n\n // 1 year up to max Date\n } else {\n const monthsSinceStartOfYear = months % 12;\n const years = Math.trunc(months / 12);\n\n // N years up to 1 years 3 months\n if (monthsSinceStartOfYear < 3) {\n return locale.formatDistance(\"aboutXYears\", years, localizeOptions);\n\n // N years 3 months up to N years 9 months\n } else if (monthsSinceStartOfYear < 9) {\n return locale.formatDistance(\"overXYears\", years, localizeOptions);\n\n // N years 9 months up to N year 12 months\n } else {\n return locale.formatDistance(\"almostXYears\", years + 1, localizeOptions);\n }\n }\n}\n\n// Fallback for modularized imports:\nexport default formatDistance;\n","import { constructNow } from \"./constructNow.js\";\n\nimport { formatDistance } from \"./formatDistance.js\";\n\n/**\n * The {@link formatDistanceToNow} function options.\n */\n\n/**\n * @name formatDistanceToNow\n * @category Common Helpers\n * @summary Return the distance between the given date and now in words.\n * @pure false\n *\n * @description\n * Return the distance between the given date and now in words.\n *\n * | Distance to now | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance to now | Result |\n * |---------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * @param date - The given date\n * @param options - The object with options\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // If today is 1 January 2015, what is the distance to 2 July 2014?\n * const result = formatDistanceToNow(\n * new Date(2014, 6, 2)\n * )\n * //=> '6 months'\n *\n * @example\n * // If now is 1 January 2015 00:00:00,\n * // what is the distance to 1 January 2015 00:00:15, including seconds?\n * const result = formatDistanceToNow(\n * new Date(2015, 0, 1, 0, 0, 15),\n * {includeSeconds: true}\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 January 2016, with a suffix?\n * const result = formatDistanceToNow(\n * new Date(2016, 0, 1),\n * {addSuffix: true}\n * )\n * //=> 'in about 1 year'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 August 2016 in Esperanto?\n * const eoLocale = require('date-fns/locale/eo')\n * const result = formatDistanceToNow(\n * new Date(2016, 7, 1),\n * {locale: eoLocale}\n * )\n * //=> 'pli ol 1 jaro'\n */\nexport function formatDistanceToNow(date, options) {\n return formatDistance(date, constructNow(date), options);\n}\n\n// Fallback for modularized imports:\nexport default formatDistanceToNow;\n","import {\n millisecondsInHour,\n millisecondsInMinute,\n} from \"./constants.js\";\nimport { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link parseISO} function options.\n */\n\n/**\n * @name parseISO\n * @category Common Helpers\n * @summary Parse ISO string\n *\n * @description\n * Parse the given string in ISO 8601 format and return an instance of Date.\n *\n * Function accepts complete ISO 8601 formats as well as partial implementations.\n * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601\n *\n * If the argument isn't a string, the function cannot parse the string or\n * the values are invalid, it returns Invalid Date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param argument - The value to convert\n * @param options - An object with options\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Convert string '2014-02-11T11:30:30' to date:\n * const result = parseISO('2014-02-11T11:30:30')\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert string '+02014101' to date,\n * // if the additional number of digits in the extended year format is 1:\n * const result = parseISO('+02014101', { additionalDigits: 1 })\n * //=> Fri Apr 11 2014 00:00:00\n */\nexport function parseISO(argument, options) {\n const invalidDate = () => constructFrom(options?.in, NaN);\n\n const additionalDigits = options?.additionalDigits ?? 2;\n const dateStrings = splitDateString(argument);\n\n let date;\n if (dateStrings.date) {\n const parseYearResult = parseYear(dateStrings.date, additionalDigits);\n date = parseDate(parseYearResult.restDateString, parseYearResult.year);\n }\n\n if (!date || isNaN(+date)) return invalidDate();\n\n const timestamp = +date;\n let time = 0;\n let offset;\n\n if (dateStrings.time) {\n time = parseTime(dateStrings.time);\n if (isNaN(time)) return invalidDate();\n }\n\n if (dateStrings.timezone) {\n offset = parseTimezone(dateStrings.timezone);\n if (isNaN(offset)) return invalidDate();\n } else {\n const tmpDate = new Date(timestamp + time);\n const result = toDate(0, options?.in);\n result.setFullYear(\n tmpDate.getUTCFullYear(),\n tmpDate.getUTCMonth(),\n tmpDate.getUTCDate(),\n );\n result.setHours(\n tmpDate.getUTCHours(),\n tmpDate.getUTCMinutes(),\n tmpDate.getUTCSeconds(),\n tmpDate.getUTCMilliseconds(),\n );\n return result;\n }\n\n return toDate(timestamp + time + offset, options?.in);\n}\n\nconst patterns = {\n dateTimeDelimiter: /[T ]/,\n timeZoneDelimiter: /[Z ]/i,\n timezone: /([Z+-].*)$/,\n};\n\nconst dateRegex =\n /^-?(?:(\\d{3})|(\\d{2})(?:-?(\\d{2}))?|W(\\d{2})(?:-?(\\d{1}))?|)$/;\nconst timeRegex =\n /^(\\d{2}(?:[.,]\\d*)?)(?::?(\\d{2}(?:[.,]\\d*)?))?(?::?(\\d{2}(?:[.,]\\d*)?))?$/;\nconst timezoneRegex = /^([+-])(\\d{2})(?::?(\\d{2}))?$/;\n\nfunction splitDateString(dateString) {\n const dateStrings = {};\n const array = dateString.split(patterns.dateTimeDelimiter);\n let timeString;\n\n // The regex match should only return at maximum two array elements.\n // [date], [time], or [date, time].\n if (array.length > 2) {\n return dateStrings;\n }\n\n if (/:/.test(array[0])) {\n timeString = array[0];\n } else {\n dateStrings.date = array[0];\n timeString = array[1];\n if (patterns.timeZoneDelimiter.test(dateStrings.date)) {\n dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];\n timeString = dateString.substr(\n dateStrings.date.length,\n dateString.length,\n );\n }\n }\n\n if (timeString) {\n const token = patterns.timezone.exec(timeString);\n if (token) {\n dateStrings.time = timeString.replace(token[1], \"\");\n dateStrings.timezone = token[1];\n } else {\n dateStrings.time = timeString;\n }\n }\n\n return dateStrings;\n}\n\nfunction parseYear(dateString, additionalDigits) {\n const regex = new RegExp(\n \"^(?:(\\\\d{4}|[+-]\\\\d{\" +\n (4 + additionalDigits) +\n \"})|(\\\\d{2}|[+-]\\\\d{\" +\n (2 + additionalDigits) +\n \"})$)\",\n );\n\n const captures = dateString.match(regex);\n // Invalid ISO-formatted year\n if (!captures) return { year: NaN, restDateString: \"\" };\n\n const year = captures[1] ? parseInt(captures[1]) : null;\n const century = captures[2] ? parseInt(captures[2]) : null;\n\n // either year or century is null, not both\n return {\n year: century === null ? year : century * 100,\n restDateString: dateString.slice((captures[1] || captures[2]).length),\n };\n}\n\nfunction parseDate(dateString, year) {\n // Invalid ISO-formatted year\n if (year === null) return new Date(NaN);\n\n const captures = dateString.match(dateRegex);\n // Invalid ISO-formatted string\n if (!captures) return new Date(NaN);\n\n const isWeekDate = !!captures[4];\n const dayOfYear = parseDateUnit(captures[1]);\n const month = parseDateUnit(captures[2]) - 1;\n const day = parseDateUnit(captures[3]);\n const week = parseDateUnit(captures[4]);\n const dayOfWeek = parseDateUnit(captures[5]) - 1;\n\n if (isWeekDate) {\n if (!validateWeekDate(year, week, dayOfWeek)) {\n return new Date(NaN);\n }\n return dayOfISOWeekYear(year, week, dayOfWeek);\n } else {\n const date = new Date(0);\n if (\n !validateDate(year, month, day) ||\n !validateDayOfYearDate(year, dayOfYear)\n ) {\n return new Date(NaN);\n }\n date.setUTCFullYear(year, month, Math.max(dayOfYear, day));\n return date;\n }\n}\n\nfunction parseDateUnit(value) {\n return value ? parseInt(value) : 1;\n}\n\nfunction parseTime(timeString) {\n const captures = timeString.match(timeRegex);\n if (!captures) return NaN; // Invalid ISO-formatted time\n\n const hours = parseTimeUnit(captures[1]);\n const minutes = parseTimeUnit(captures[2]);\n const seconds = parseTimeUnit(captures[3]);\n\n if (!validateTime(hours, minutes, seconds)) {\n return NaN;\n }\n\n return (\n hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1000\n );\n}\n\nfunction parseTimeUnit(value) {\n return (value && parseFloat(value.replace(\",\", \".\"))) || 0;\n}\n\nfunction parseTimezone(timezoneString) {\n if (timezoneString === \"Z\") return 0;\n\n const captures = timezoneString.match(timezoneRegex);\n if (!captures) return 0;\n\n const sign = captures[1] === \"+\" ? -1 : 1;\n const hours = parseInt(captures[2]);\n const minutes = (captures[3] && parseInt(captures[3])) || 0;\n\n if (!validateTimezone(hours, minutes)) {\n return NaN;\n }\n\n return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute);\n}\n\nfunction dayOfISOWeekYear(isoWeekYear, week, day) {\n const date = new Date(0);\n date.setUTCFullYear(isoWeekYear, 0, 4);\n const fourthOfJanuaryDay = date.getUTCDay() || 7;\n const diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}\n\n// Validation functions\n\n// February is null to handle the leap year (using ||)\nconst daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\nfunction isLeapYearIndex(year) {\n return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);\n}\n\nfunction validateDate(year, month, date) {\n return (\n month >= 0 &&\n month <= 11 &&\n date >= 1 &&\n date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28))\n );\n}\n\nfunction validateDayOfYearDate(year, dayOfYear) {\n return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);\n}\n\nfunction validateWeekDate(_year, week, day) {\n return week >= 1 && week <= 53 && day >= 0 && day <= 6;\n}\n\nfunction validateTime(hours, minutes, seconds) {\n if (hours === 24) {\n return minutes === 0 && seconds === 0;\n }\n\n return (\n seconds >= 0 &&\n seconds < 60 &&\n minutes >= 0 &&\n minutes < 60 &&\n hours >= 0 &&\n hours < 25\n );\n}\n\nfunction validateTimezone(_hours, minutes) {\n return minutes >= 0 && minutes <= 59;\n}\n\n// Fallback for modularized imports:\nexport default parseISO;\n","// Copyright (c) 2013 Pieroxy <pieroxy@pieroxy.net>\n// This work is free. You can redistribute it and/or modify it\n// under the terms of the WTFPL, Version 2\n// For more information see LICENSE.txt or http://www.wtfpl.net/\n//\n// For more information, the home page:\n// http://pieroxy.net/blog/pages/lz-string/testing.html\n//\n// LZ-based compression algorithm, version 1.4.5\nvar LZString = (function() {\n\n// private property\nvar f = String.fromCharCode;\nvar keyStrBase64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\nvar keyStrUriSafe = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$\";\nvar baseReverseDic = {};\n\nfunction getBaseValue(alphabet, character) {\n if (!baseReverseDic[alphabet]) {\n baseReverseDic[alphabet] = {};\n for (var i=0 ; i<alphabet.length ; i++) {\n baseReverseDic[alphabet][alphabet.charAt(i)] = i;\n }\n }\n return baseReverseDic[alphabet][character];\n}\n\nvar LZString = {\n compressToBase64 : function (input) {\n if (input == null) return \"\";\n var res = LZString._compress(input, 6, function(a){return keyStrBase64.charAt(a);});\n switch (res.length % 4) { // To produce valid Base64\n default: // When could this happen ?\n case 0 : return res;\n case 1 : return res+\"===\";\n case 2 : return res+\"==\";\n case 3 : return res+\"=\";\n }\n },\n\n decompressFromBase64 : function (input) {\n if (input == null) return \"\";\n if (input == \"\") return null;\n return LZString._decompress(input.length, 32, function(index) { return getBaseValue(keyStrBase64, input.charAt(index)); });\n },\n\n compressToUTF16 : function (input) {\n if (input == null) return \"\";\n return LZString._compress(input, 15, function(a){return f(a+32);}) + \" \";\n },\n\n decompressFromUTF16: function (compressed) {\n if (compressed == null) return \"\";\n if (compressed == \"\") return null;\n return LZString._decompress(compressed.length, 16384, function(index) { return compressed.charCodeAt(index) - 32; });\n },\n\n //compress into uint8array (UCS-2 big endian format)\n compressToUint8Array: function (uncompressed) {\n var compressed = LZString.compress(uncompressed);\n var buf=new Uint8Array(compressed.length*2); // 2 bytes per character\n\n for (var i=0, TotalLen=compressed.length; i<TotalLen; i++) {\n var current_value = compressed.charCodeAt(i);\n buf[i*2] = current_value >>> 8;\n buf[i*2+1] = current_value % 256;\n }\n return buf;\n },\n\n //decompress from uint8array (UCS-2 big endian format)\n decompressFromUint8Array:function (compressed) {\n if (compressed===null || compressed===undefined){\n return LZString.decompress(compressed);\n } else {\n var buf=new Array(compressed.length/2); // 2 bytes per character\n for (var i=0, TotalLen=buf.length; i<TotalLen; i++) {\n buf[i]=compressed[i*2]*256+compressed[i*2+1];\n }\n\n var result = [];\n buf.forEach(function (c) {\n result.push(f(c));\n });\n return LZString.decompress(result.join(''));\n\n }\n\n },\n\n\n //compress into a string that is already URI encoded\n compressToEncodedURIComponent: function (input) {\n if (input == null) return \"\";\n return LZString._compress(input, 6, function(a){return keyStrUriSafe.charAt(a);});\n },\n\n //decompress from an output of compressToEncodedURIComponent\n decompressFromEncodedURIComponent:function (input) {\n if (input == null) return \"\";\n if (input == \"\") return null;\n input = input.replace(/ /g, \"+\");\n return LZString._decompress(input.length, 32, function(index) { return getBaseValue(keyStrUriSafe, input.charAt(index)); });\n },\n\n compress: function (uncompressed) {\n return LZString._compress(uncompressed, 16, function(a){return f(a);});\n },\n _compress: function (uncompressed, bitsPerChar, getCharFromInt) {\n if (uncompressed == null) return \"\";\n var i, value,\n context_dictionary= {},\n context_dictionaryToCreate= {},\n context_c=\"\",\n context_wc=\"\",\n context_w=\"\",\n context_enlargeIn= 2, // Compensate for the first entry which should not count\n context_dictSize= 3,\n context_numBits= 2,\n context_data=[],\n context_data_val=0,\n context_data_position=0,\n ii;\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii);\n if (!Object.prototype.hasOwnProperty.call(context_dictionary,context_c)) {\n context_dictionary[context_c] = context_dictSize++;\n context_dictionaryToCreate[context_c] = true;\n }\n\n context_wc = context_w + context_c;\n if (Object.prototype.hasOwnProperty.call(context_dictionary,context_wc)) {\n context_w = context_wc;\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate,context_w)) {\n if (context_w.charCodeAt(0)<256) {\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n }\n value = context_w.charCodeAt(0);\n for (i=0 ; i<8 ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n } else {\n value = 1;\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1) | value;\n if (context_data_position ==bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = 0;\n }\n value = context_w.charCodeAt(0);\n for (i=0 ; i<16 ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n delete context_dictionaryToCreate[context_w];\n } else {\n value = context_dictionary[context_w];\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n\n\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++;\n context_w = String(context_c);\n }\n }\n\n // Output the code for w.\n if (context_w !== \"\") {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate,context_w)) {\n if (context_w.charCodeAt(0)<256) {\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n }\n value = context_w.charCodeAt(0);\n for (i=0 ; i<8 ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n } else {\n value = 1;\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1) | value;\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = 0;\n }\n value = context_w.charCodeAt(0);\n for (i=0 ; i<16 ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n delete context_dictionaryToCreate[context_w];\n } else {\n value = context_dictionary[context_w];\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n\n\n }\n context_enlargeIn--;\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits);\n context_numBits++;\n }\n }\n\n // Mark the end of the stream\n value = 2;\n for (i=0 ; i<context_numBits ; i++) {\n context_data_val = (context_data_val << 1) | (value&1);\n if (context_data_position == bitsPerChar-1) {\n context_data_position = 0;\n context_data.push(getCharFromInt(context_data_val));\n context_data_val = 0;\n } else {\n context_data_position++;\n }\n value = value >> 1;\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1);\n if (context_data_position == bitsPerChar-1) {\n context_data.push(getCharFromInt(context_data_val));\n break;\n }\n else context_data_position++;\n }\n return context_data.join('');\n },\n\n decompress: function (compressed) {\n if (compressed == null) return \"\";\n if (compressed == \"\") return null;\n return LZString._decompress(compressed.length, 32768, function(index) { return compressed.charCodeAt(index); });\n },\n\n _decompress: function (length, resetValue, getNextValue) {\n var dictionary = [],\n next,\n enlargeIn = 4,\n dictSize = 4,\n numBits = 3,\n entry = \"\",\n result = [],\n i,\n w,\n bits, resb, maxpower, power,\n c,\n data = {val:getNextValue(0), position:resetValue, index:1};\n\n for (i = 0; i < 3; i += 1) {\n dictionary[i] = i;\n }\n\n bits = 0;\n maxpower = Math.pow(2,2);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n\n switch (next = bits) {\n case 0:\n bits = 0;\n maxpower = Math.pow(2,8);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n c = f(bits);\n break;\n case 1:\n bits = 0;\n maxpower = Math.pow(2,16);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n c = f(bits);\n break;\n case 2:\n return \"\";\n }\n dictionary[3] = c;\n w = c;\n result.push(c);\n while (true) {\n if (data.index > length) {\n return \"\";\n }\n\n bits = 0;\n maxpower = Math.pow(2,numBits);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n\n switch (c = bits) {\n case 0:\n bits = 0;\n maxpower = Math.pow(2,8);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n\n dictionary[dictSize++] = f(bits);\n c = dictSize-1;\n enlargeIn--;\n break;\n case 1:\n bits = 0;\n maxpower = Math.pow(2,16);\n power=1;\n while (power!=maxpower) {\n resb = data.val & data.position;\n data.position >>= 1;\n if (data.position == 0) {\n data.position = resetValue;\n data.val = getNextValue(data.index++);\n }\n bits |= (resb>0 ? 1 : 0) * power;\n power <<= 1;\n }\n dictionary[dictSize++] = f(bits);\n c = dictSize-1;\n enlargeIn--;\n break;\n case 2:\n return result.join('');\n }\n\n if (enlargeIn == 0) {\n enlargeIn = Math.pow(2, numBits);\n numBits++;\n }\n\n if (dictionary[c]) {\n entry = dictionary[c];\n } else {\n if (c === dictSize) {\n entry = w + w.charAt(0);\n } else {\n return null;\n }\n }\n result.push(entry);\n\n // Add w+entry[0] to the dictionary.\n dictionary[dictSize++] = w + entry.charAt(0);\n enlargeIn--;\n\n w = entry;\n\n if (enlargeIn == 0) {\n enlargeIn = Math.pow(2, numBits);\n numBits++;\n }\n\n }\n }\n};\n return LZString;\n})();\n\nif (typeof define === 'function' && define.amd) {\n define(function () { return LZString; });\n} else if( typeof module !== 'undefined' && module != null ) {\n module.exports = LZString\n} else if( typeof angular !== 'undefined' && angular != null ) {\n angular.module('LZString', [])\n .factory('LZString', function () {\n return LZString;\n });\n}\n","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { AnimatedLoader } from \"#connect\";\nexport function DefaultEditorLoader(props) {\n const { message = \"Loading editor\", ...divProps } = props;\n return (_jsx(\"div\", { className: \"grid h-full place-items-center\", ...divProps, children: _jsxs(\"div\", { className: \"-mt-20 grid place-items-center\", children: [_jsx(\"h3\", { className: \"mb-4 text-xl\", children: message }), _jsx(AnimatedLoader, {})] }) }));\n}\n//# sourceMappingURL=default-editor-loader.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Tooltip } from \"#connect\";\nimport { Icon } from \"#powerhouse\";\nimport { formatDistanceToNow } from \"date-fns\";\nimport { useEffect, useState } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nexport const HDivider = (props) => {\n const { className, timestampUtcMs: timestamp, title, subtitle, onClick, isSelected = false, } = props;\n const [open, setOpen] = useState(false);\n const hasContent = !!title || !!subtitle || !!timestamp;\n // Force update tooltips when props change\n useEffect(() => {\n // Force close and re-open if already open to refresh content\n if (open) {\n setOpen(false);\n setTimeout(() => hasContent && setOpen(true), 50);\n }\n }, [title, subtitle, timestamp, hasContent]);\n const formatTimestamp = (isoString) => {\n if (!isoString)\n return \"\";\n try {\n return formatDistanceToNow(new Date(isoString), { addSuffix: true });\n }\n catch {\n return isoString;\n }\n };\n const tooltipContent = (_jsxs(\"div\", { className: \"flex flex-col text-xs\", children: [!!title && _jsx(\"div\", { children: title }), !!subtitle && _jsx(\"div\", { className: \"text-gray-300\", children: subtitle }), !!timestamp && _jsx(\"div\", { children: formatTimestamp(timestamp) })] }));\n const handleMouseEnter = () => {\n if (hasContent) {\n setOpen(true);\n }\n };\n const handleMouseLeave = () => {\n setOpen(false);\n };\n return (_jsxs(\"div\", { className: \"relative\", onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [isSelected && (_jsx(Icon, { name: \"TimelineCaret\", color: \"#4EA9FF\", size: 10, className: \"absolute top-[-11px] z-40\" })), _jsx(Tooltip, { className: \"rounded-md bg-gray-900 text-white\", content: tooltipContent, open: open && hasContent, onOpenChange: setOpen, delayDuration: 0, side: \"bottom\", sideOffset: 5, children: _jsx(\"div\", { className: twMerge(\"mx-0.5 flex h-[25px] w-1.5 cursor-pointer flex-col items-center justify-center rounded-[2px] hover:bg-blue-300\", isSelected && \"bg-blue-300\", className), onClick: onClick, \"data-title\": title, \"data-subtitle\": subtitle, \"data-timestamp\": timestamp, children: _jsx(\"div\", { className: \"h-0.5 w-1 rounded-full bg-gray-500\" }) }) })] }));\n};\n//# sourceMappingURL=h-divider.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/* eslint-disable react/jsx-max-depth */\n/* eslint-disable react/jsx-no-bind */\nimport { Tooltip } from \"#connect\";\nimport { Icon } from \"#powerhouse\";\nimport { format, parseISO } from \"date-fns\";\nimport { useState } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nconst getBarHeight = (size = 0) => {\n switch (true) {\n case size <= 0:\n return \"h-[1px]\";\n case size === 1:\n return \"h-[3px]\";\n case size === 2:\n return \"h-[6px]\";\n case size === 3:\n return \"h-[9px]\";\n case size >= 4:\n return \"h-[12px]\";\n default:\n return \"h-[1px]\";\n }\n};\nconst formatTimestamp = (isoString) => {\n if (!isoString)\n return \"\";\n try {\n const date = parseISO(isoString);\n return format(date, \"HH:mm, dd, MMMM\");\n }\n catch {\n return isoString;\n }\n};\nexport const TimelineBar = ({ onClick, className, timestampUtcMs: timestamp, additions, deletions, addSize = 0, delSize = 0, isSelected = false, }) => {\n const [open, setOpen] = useState(false);\n const noChanges = addSize === 0 && delSize === 0;\n const addBarHeight = getBarHeight(addSize);\n const delBarHeight = getBarHeight(delSize);\n const tooltipContent = (_jsxs(\"div\", { className: \"flex flex-col text-xs\", children: [_jsx(\"div\", { children: formatTimestamp(timestamp) }), _jsx(\"div\", { className: \"text-green-900\", children: `${additions} additions +` }), _jsx(\"div\", { className: \"text-red-700\", children: `${deletions} deletions -` })] }));\n const handleMouseEnter = () => {\n if (!noChanges) {\n setOpen(true);\n }\n };\n const handleMouseLeave = () => {\n setOpen(false);\n };\n return (_jsxs(\"div\", { className: \"relative\", onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [isSelected && (_jsx(Icon, { name: \"TimelineCaret\", color: \"#4EA9FF\", size: 10, className: \"absolute left-[-2px] top-[-11px] z-40\" })), noChanges ? (_jsx(\"div\", { className: twMerge(\"flex h-[25px] w-1.5 cursor-pointer flex-col items-center justify-center rounded-[2px] hover:bg-blue-300\", className), \"data-timestamp\": timestamp, onClick: onClick, children: _jsx(\"div\", { className: \"size-[3px] rounded-full bg-gray-500\" }) })) : (_jsx(Tooltip, { className: \"rounded-md bg-gray-900 text-white\", content: tooltipContent, open: open, onOpenChange: setOpen, delayDuration: 0, side: \"bottom\", sideOffset: 5, children: _jsxs(\"div\", { className: twMerge(\"flex h-[25px] w-1.5 cursor-pointer flex-col items-center justify-center rounded-[2px] hover:bg-blue-300\", className, isSelected && \"bg-blue-300\"), \"data-timestamp\": timestamp, onClick: onClick, children: [_jsx(\"div\", { className: \"flex h-3 w-0.5 items-end\", children: _jsx(\"div\", { className: twMerge(\"h-3 w-0.5 rounded-t-full bg-green-600\", addBarHeight) }) }), _jsx(\"div\", { className: \"flex h-3 w-0.5 items-start\", children: _jsx(\"div\", { className: twMerge(\"h-3 w-0.5 rounded-b-full bg-red-600\", delBarHeight) }) })] }) }))] }));\n};\n//# sourceMappingURL=timeline-bar.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/* eslint-disable react/jsx-max-depth */\n/* eslint-disable react/jsx-no-bind */\nimport { TooltipProvider } from \"#connect\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { HDivider, TimelineBar, } from \"./components/index.js\";\nconst defaultTimeLineItem = {\n id: \"default\",\n type: \"bar\",\n addSize: 0,\n delSize: 0,\n};\nexport const DocumentTimeline = (props) => {\n const { timeline = [], onItemClick } = props;\n const [selectedItem, setSelectedItem] = useState(null);\n const scrollContainerRef = useRef(null);\n const handleClick = (item) => {\n if (item.id === selectedItem || item.id === defaultTimeLineItem.id) {\n onItemClick?.(null);\n setSelectedItem(null);\n }\n else {\n onItemClick?.(item);\n setSelectedItem(item.id);\n }\n };\n const mergedTimelineItems = [...timeline, defaultTimeLineItem];\n const [unselectedItems, selectedItems] = useMemo(() => {\n const indexSelected = mergedTimelineItems.findIndex((item) => item.id === selectedItem);\n return indexSelected === -1\n ? [mergedTimelineItems, []]\n : [\n mergedTimelineItems.slice(0, indexSelected),\n mergedTimelineItems.slice(indexSelected),\n ];\n }, [mergedTimelineItems, selectedItem]);\n const renderTimelineItems = useCallback((items) => {\n return items.map((item) => {\n if (item.type === \"divider\") {\n const { timestampUtcMs, title, subtitle } = item;\n return (_jsx(HDivider, { timestampUtcMs: timestampUtcMs, title: title, subtitle: subtitle, onClick: () => handleClick(item), isSelected: item.id === selectedItem }, item.id));\n }\n return (_jsx(TimelineBar, { timestampUtcMs: item.timestampUtcMs, addSize: item.addSize, delSize: item.delSize, additions: item.additions, deletions: item.deletions, isSelected: item.id === selectedItem, onClick: () => handleClick(item) }, item.id));\n });\n }, [handleClick, selectedItem]);\n const unselectedContent = useMemo(() => renderTimelineItems(unselectedItems), [unselectedItems, renderTimelineItems]);\n const selectedContent = useMemo(() => renderTimelineItems(selectedItems), [selectedItems, renderTimelineItems]);\n // Scroll to the end by default\n useEffect(() => {\n if (scrollContainerRef.current) {\n scrollContainerRef.current.scrollLeft =\n scrollContainerRef.current.scrollWidth;\n }\n }, []);\n return (_jsx(TooltipProvider, { delayDuration: 0, skipDelayDuration: 0, children: _jsxs(\"div\", { className: \"relative h-[36px] w-full\", children: [_jsx(\"div\", { className: \"absolute left-[0px] z-[20] h-[17px] w-[6px] bg-white\", children: _jsx(\"div\", { className: \"mt-[11px] h-[6px] w-[6px] rounded-tl-md bg-slate-50\" }) }), _jsx(\"div\", { className: \"absolute right-[0px] top-[11px] z-[20] h-[6px] w-[6px] bg-white\", children: _jsx(\"div\", { className: \"h-[6px] w-[6px] rounded-tr-md bg-slate-50\" }) }), _jsx(\"div\", { className: \"absolute inset-x-0 bottom-0 h-[25px] rounded-md bg-slate-50\" }), _jsx(\"div\", { className: \"absolute inset-x-0 bottom-0 h-[36px]\", children: _jsx(\"div\", { ref: scrollContainerRef, className: \"h-full overflow-x-auto rounded-md\", children: _jsxs(\"div\", { className: \"ml-auto flex h-[36px] w-max items-end px-2 pb-0\", children: [_jsx(\"div\", { className: \"flex\", children: unselectedContent }), _jsx(\"div\", { className: \"flex rounded-sm bg-blue-200\", children: selectedContent })] }) }) }), _jsx(\"div\", { className: \"pointer-events-none absolute bottom-0 left-0 z-10 h-[25px] w-2 rounded-l-md bg-slate-50\" }), _jsx(\"div\", { className: \"pointer-events-none absolute bottom-0 right-0 z-10 h-[25px] w-2 rounded-r-md bg-slate-50\" })] }) }));\n};\n//# sourceMappingURL=document-timeline.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/* eslint-disable react/jsx-no-bind */\n/* eslint-disable react/jsx-max-depth */\n/* eslint-disable react/button-has-type */\nimport { Icon } from \"#powerhouse\";\nimport { useEffect, useState } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport { DocumentTimeline, } from \"../document-timeline/document-timeline.js\";\nexport const DocumentToolbar = (props) => {\n const { undo, canUndo, redo, canRedo, title, onClose, onExport, className, onShowRevisionHistory, onSwitchboardLinkClick, timelineItems = [], onTimelineItemClick, initialTimelineVisible = false, timelineButtonVisible = false, } = props;\n const [showTimeline, setShowTimeline] = useState(initialTimelineVisible);\n const isUndoDisabled = !canUndo || !undo;\n const isRedoDisabled = !canRedo || !redo;\n const isExportDisabled = !onExport;\n const isSwitchboardLinkDisabled = !onSwitchboardLinkClick;\n const isRevisionHistoryDisabled = !onShowRevisionHistory;\n const isTimelineDisabled = timelineItems.length === 0;\n useEffect(() => {\n if (initialTimelineVisible) {\n setShowTimeline(true);\n }\n }, [initialTimelineVisible]);\n const handleTimelineToggle = () => {\n if (isTimelineDisabled)\n return;\n setShowTimeline(!showTimeline);\n };\n return (_jsxs(\"div\", { className: \"flex w-full flex-col\", children: [_jsxs(\"div\", { className: twMerge(\"flex h-12 w-full items-center justify-between rounded-xl border border-gray-200 bg-slate-50 px-4\", className), children: [_jsxs(\"div\", { className: \"flex items-center gap-x-2\", children: [_jsx(\"button\", { className: twMerge(\"grid size-8 place-items-center rounded-lg border border-gray-200 bg-white\", isUndoDisabled\n ? \"cursor-not-allowed\"\n : \"cursor-pointer active:opacity-70\"), onClick: undo, disabled: isUndoDisabled, children: _jsx(Icon, { name: \"ArrowCouterclockwise\", size: 16, className: isUndoDisabled ? \"text-gray-500\" : \"text-gray-900\" }) }), _jsx(\"button\", { className: twMerge(\"grid size-8 place-items-center rounded-lg border border-gray-200 bg-white\", isRedoDisabled\n ? \"cursor-not-allowed\"\n : \"cursor-pointer active:opacity-70\"), onClick: redo, disabled: isRedoDisabled, children: _jsx(\"div\", { className: \"-scale-x-100\", children: _jsx(Icon, { name: \"ArrowCouterclockwise\", size: 16, className: isRedoDisabled ? \"text-gray-500\" : \"text-gray-900\" }) }) }), _jsx(\"button\", { className: twMerge(\"flex h-8 items-center rounded-lg border border-gray-200 bg-white px-3 text-sm\", isExportDisabled\n ? \"cursor-not-allowed\"\n : \"cursor-pointer active:opacity-70\"), onClick: onExport, disabled: isExportDisabled, children: _jsx(\"span\", { className: isExportDisabled ? \"text-gray-500\" : \"text-gray-900\", children: \"Export\" }) })] }), _jsx(\"div\", { className: \"flex items-center\", children: _jsx(\"h1\", { className: \"text-sm font-medium text-gray-500\", children: title }) }), _jsxs(\"div\", { className: \"flex items-center gap-x-2\", children: [!isSwitchboardLinkDisabled ? (_jsx(\"button\", { className: twMerge(\"grid size-8 place-items-center rounded-lg border border-gray-200 bg-white\", \"cursor-pointer active:opacity-70\"), onClick: onSwitchboardLinkClick, disabled: isSwitchboardLinkDisabled, children: _jsx(Icon, { name: \"Drive\", size: 16, className: \"text-gray-900\" }) })) : null, _jsx(\"button\", { className: twMerge(\"grid size-8 place-items-center rounded-lg border border-gray-200 bg-white\", isRevisionHistoryDisabled\n ? \"cursor-not-allowed\"\n : \"cursor-pointer active:opacity-70\"), onClick: onShowRevisionHistory, disabled: isRevisionHistoryDisabled, children: _jsx(Icon, { name: \"History\", size: 16, className: isRevisionHistoryDisabled ? \"text-gray-500\" : \"text-gray-900\" }) }), timelineButtonVisible && (_jsx(\"button\", { className: twMerge(\"grid size-8 place-items-center rounded-lg border border-gray-200 bg-white\", isTimelineDisabled\n ? \"cursor-not-allowed\"\n : \"cursor-pointer active:opacity-70\"), onClick: handleTimelineToggle, disabled: isTimelineDisabled, \"aria-pressed\": showTimeline, children: _jsx(Icon, { name: \"Timeline\", size: 16, className: twMerge(\"text-gray-900\", isTimelineDisabled && \"opacity-50\", showTimeline && \"text-blue-600\") }) })), _jsx(\"button\", { className: \"grid size-8 cursor-pointer place-items-center rounded-lg border border-gray-200 bg-white active:opacity-70\", onClick: onClose, children: _jsx(Icon, { name: \"XmarkLight\", size: 16, className: \"text-gray-900\" }) })] })] }), showTimeline && (_jsx(\"div\", { className: \"mt-2 w-full\", children: _jsx(DocumentTimeline, { timeline: timelineItems, onItemClick: onTimelineItemClick }) }))] }));\n};\n//# sourceMappingURL=document-toolbar.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Icon } from \"#powerhouse\";\nimport { twMerge } from \"tailwind-merge\";\nexport const HomeScreenItem = function HomeScreenItem(props) {\n const { icon, title, description, containerClassName, shareable, onClick } = props;\n return (_jsxs(\"div\", { className: twMerge(\"relative flex h-24 cursor-pointer flex-col items-center justify-center text-center text-sm text-black\", containerClassName, onClick && \"cursor-pointer\"), onClick: onClick, children: [_jsx(\"div\", { className: \"mx-auto pb-2\", children: icon || (_jsx(\"div\", { className: \"size-8 items-center justify-center rounded-lg bg-black pt-1\", children: _jsx(\"span\", { className: \"text-6 w-6 text-white\", children: title.slice(0, 1).toUpperCase() }) })) }), _jsxs(\"div\", { children: [_jsx(\"h3\", { children: title }), description && _jsx(\"p\", { className: \"text-gray-500\", children: description })] }), shareable && (_jsx(\"div\", { className: \"absolute left-2 top-0 mb-2\", children: _jsx(Icon, { name: \"PeopleFill\", width: 12, height: 12 }) }))] }));\n};\n//# sourceMappingURL=home-screen-item.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { Icon } from \"#powerhouse\";\nimport { HomeScreenItem } from \"../home-screen-item/index.js\";\nexport const HomeScreenAddDriveItem = function HomeScreenAddDriveItem(props) {\n const { containerClassName, onClick } = props;\n return (_jsx(HomeScreenItem, { title: \"Create New Drive\", icon: _jsx(Icon, { name: \"PlusSquare\", size: 32 }), onClick: onClick, containerClassName: containerClassName }));\n};\n//# sourceMappingURL=home-screen-add-drive-item.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Icon } from \"#powerhouse\";\nexport function Branch(props) {\n const { branch = \"main\" } = props;\n return (_jsxs(\"button\", { className: \"flex h-8 items-center gap-1 rounded-lg bg-slate-50 pl-1 pr-2 text-xs text-slate-100\", children: [_jsx(Icon, { name: \"Branch\" }), _jsx(\"span\", { children: \"BRANCH\" }), _jsx(\"span\", { className: \"text-gray-900\", children: branch })] }));\n}\n//# sourceMappingURL=branch.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Icon } from \"#powerhouse\";\nimport { useCopyToClipboard } from \"usehooks-ts\";\nexport function DocId(props) {\n const { docId } = props;\n const [, copy] = useCopyToClipboard();\n function handleCopy(text) {\n return () => {\n copy(text).catch((error) => {\n console.error(\"Failed to copy!\", error);\n });\n };\n }\n return (_jsxs(\"button\", { className: \"flex h-8 items-center gap-1 rounded-lg bg-slate-50 pl-1 pr-2 text-xs text-slate-100\", onClick: handleCopy(docId), children: [_jsx(Icon, { name: \"Link\" }), \"DOC ID\", _jsx(\"span\", { className: \"text-gray-900\", children: docId })] }));\n}\n//# sourceMappingURL=doc-id.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { Select } from \"../../select/index.js\";\nexport function Scope(props) {\n const { value, onChange } = props;\n const items = [\n { displayValue: \"Global scope\", value: \"global\" },\n { displayValue: \"Local scope\", value: \"local\" },\n ];\n return (_jsx(Select, { absolutePositionMenu: true, containerClassName: \"bg-slate-50 text-gray-500 rounded-lg w-fit text-xs z-10\", id: \"scope select\", itemClassName: \"py-2 text-gray-500 grid grid-cols-[auto,auto] gap-1\", items: items, menuClassName: \"min-w-0 text-gray-500\", onChange: onChange, value: value }));\n}\n//# sourceMappingURL=scope.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Icon } from \"#powerhouse\";\nimport { twMerge } from \"tailwind-merge\";\nimport { Branch } from \"./branch.js\";\nimport { DocId } from \"./doc-id.js\";\nimport { Scope } from \"./scope.js\";\nexport function Header(props) {\n const { title, docId, scope, onChangeScope, onClose, className, ...divProps } = props;\n return (_jsxs(\"header\", { className: twMerge(\"flex items-center justify-between bg-transparent\", className), ...divProps, children: [_jsxs(\"div\", { className: \"flex items-center gap-3\", children: [_jsx(\"button\", { className: \"shadow-button rounded-lg bg-gray-50 p-1 text-slate-100\", onClick: onClose, children: _jsx(Icon, { name: \"VariantArrowLeft\" }) }), _jsx(\"h1\", { className: \"text-xs\", children: title })] }), _jsxs(\"div\", { className: \"flex items-center gap-2\", children: [_jsx(DocId, { docId: docId }), _jsx(Branch, {}), _jsx(Scope, { onChange: onChangeScope, value: scope })] })] }));\n}\n//# sourceMappingURL=header.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { ENSAvatar, formatEthAddress, Tooltip } from \"#connect\";\nimport { Icon } from \"#powerhouse\";\nimport { useCopyToClipboard } from \"usehooks-ts\";\nexport function Address(props) {\n const { address, chainId } = props;\n const [, copy] = useCopyToClipboard();\n if (!address)\n return null;\n const shortenedAddress = formatEthAddress(address);\n function handleCopy(text) {\n return () => {\n copy(text).catch((error) => {\n console.error(\"Failed to copy!\", error);\n });\n };\n }\n const tooltipContent = (_jsxs(\"button\", { className: \"flex items-center gap-1\", onClick: handleCopy(address), children: [address, _jsx(Icon, { className: \"inline-block text-gray-600\", name: \"FilesEarmark\", size: 16 })] }));\n return (_jsx(Tooltip, { content: tooltipContent, children: _jsxs(\"span\", { className: \"flex w-fit cursor-pointer items-center gap-1 rounded-lg bg-gray-100 p-1 text-xs text-slate-100\", children: [_jsx(ENSAvatar, { address: address, chainId: chainId }), shortenedAddress] }) }));\n}\n//# sourceMappingURL=address.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Tooltip } from \"#connect\";\nimport { Icon } from \"#powerhouse\";\nimport { twMerge } from \"tailwind-merge\";\nexport function Errors(props) {\n const { errors } = props;\n const hasErrors = !!errors?.length;\n const color = hasErrors ? \"text-red-800\" : \"text-green-700\";\n const icon = hasErrors ? (_jsx(Icon, { name: \"Exclamation\", size: 16 })) : (_jsx(Icon, { name: \"Check\", size: 16 }));\n const text = hasErrors ? `Error: ${errors[0]}` : \"No errors\";\n const content = (_jsxs(\"span\", { className: twMerge(\"flex w-fit items-center rounded-lg border border-gray-200 px-2 py-1 text-xs\", color, hasErrors && \"cursor-pointer\"), children: [icon, _jsx(\"span\", { className: twMerge(\"inline-block max-w-36 truncate\"), children: text })] }));\n const tooltipContent = errors?.map((message, index) => (_jsxs(\"p\", { className: \"text-red-800\", children: [\"Error: \", message] }, index)));\n if (hasErrors)\n return _jsx(Tooltip, { content: tooltipContent, children: content });\n return content;\n}\n//# sourceMappingURL=errors.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Tooltip } from \"#connect\";\nimport { Icon } from \"#powerhouse\";\nexport function Operation(props) {\n const { operationType, operationInput } = props;\n const tooltipContent = (_jsx(\"code\", { children: _jsx(\"pre\", { children: JSON.stringify(operationInput, null, 2) }) }));\n return (_jsx(Tooltip, { content: tooltipContent, children: _jsxs(\"span\", { className: \"flex cursor-pointer items-center gap-2 text-xs\", children: [operationType, _jsx(Icon, { className: \"text-gray-300\", name: \"Braces\", size: 16 })] }) }));\n}\n//# sourceMappingURL=operation.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Tooltip } from \"#connect\";\nimport { Icon } from \"#powerhouse\";\nimport { useCopyToClipboard } from \"usehooks-ts\";\nexport function RevisionNumber(props) {\n const { operationIndex, eventId, stateHash } = props;\n const [, copy] = useCopyToClipboard();\n const revisionNumber = operationIndex + 1;\n const tooltipContent = (_jsxs(\"button\", { className: \"flex items-center gap-1\", onClick: handleCopy(stateHash), children: [\"Revision \", revisionNumber, \" - Event ID: \", eventId, \" - State Hash: \", stateHash, _jsx(Icon, { className: \"inline-block text-gray-600\", name: \"FilesEarmark\", size: 16 })] }));\n function handleCopy(text) {\n return () => {\n copy(text).catch((error) => {\n console.error(\"Failed to copy!\", error);\n });\n };\n }\n return (_jsx(Tooltip, { content: tooltipContent, children: _jsxs(\"span\", { className: \"flex cursor-pointer items-center gap-2 text-xs text-gray-600\", children: [\"Revision \", revisionNumber, \".\", _jsx(\"a\", { children: _jsx(Icon, { className: \"cursor-pointer text-slate-100\", name: \"Ellipsis\", size: 14 }) })] }) }));\n}\n//# sourceMappingURL=revision-number.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Tooltip } from \"#connect\";\nimport { Icon } from \"#powerhouse\";\nexport function Signature(props) {\n const { signatures } = props;\n if (!signatures?.length)\n return null;\n const tooltipContent = (_jsxs(\"div\", { className: \"text-xs text-slate-300\", children: [_jsx(\"h3\", { className: \"mb-2\", children: \"Signature details:\" }), signatures.map((signature, index) => (_jsxs(\"div\", { className: \"mb-2 last:mb-0\", children: [_jsxs(\"h4\", { children: [\"Signature #\", index + 1, \" -\", \" \", signature.isVerified ? \"verified\" : \"unverified\"] }), _jsx(\"code\", { children: _jsx(\"pre\", { children: JSON.stringify(signature, null, 2) }) })] }, signature.hash)))] }));\n return (_jsx(Tooltip, { content: tooltipContent, children: _jsxs(\"span\", { className: \"flex w-fit cursor-pointer items-center gap-1 rounded-lg border border-gray-200 px-2 py-1\", children: [_jsx(VerificationStatus, { signatures: signatures }), \" \", _jsx(Icon, { className: \"text-gray-300\", name: \"InfoSquare\", size: 16 })] }) }));\n}\nfunction VerificationStatus(props) {\n const { signatures } = props;\n if (!signatures?.length)\n return null;\n const signatureCount = signatures.length;\n const verifiedSignaturesCount = signatures.filter((signature) => signature.isVerified).length;\n const signatureText = signatureCount === 1 ? \"signature\" : \"signatures\";\n const verificationStatusText = `${verifiedSignaturesCount}/${signatureCount} ${signatureText} verified`;\n const color = verifiedSignaturesCount === 0\n ? \"text-red-800\"\n : verifiedSignaturesCount === signatureCount\n ? \"text-green-700\"\n : \"text-orange-700\";\n return _jsx(\"span\", { className: `text-xs ${color}`, children: verificationStatusText });\n}\n//# sourceMappingURL=signature.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Tooltip } from \"#connect\";\nimport { format } from \"date-fns\";\nexport function Timestamp(props) {\n const { timestampUtcMs: timestamp } = props;\n const timestampNumber = typeof timestamp === \"string\" && !timestamp.includes(\"-\")\n ? parseInt(timestamp)\n : timestamp;\n const date = new Date(timestampNumber);\n const shortDate = format(date, \"HH:mm 'UTC'\");\n const longDate = format(date, \"eee, dd MMM yyyy HH:mm:ss 'UTC'\");\n const tooltipContent = _jsx(\"div\", { children: longDate });\n return (_jsx(Tooltip, { content: tooltipContent, children: _jsxs(\"span\", { className: \"cursor-pointer text-xs\", children: [\"committed at \", shortDate] }) }));\n}\n//# sourceMappingURL=timestamp.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { memo } from \"react\";\nimport { Address } from \"./address.js\";\nimport { Errors } from \"./errors.js\";\nimport { Operation } from \"./operation.js\";\nimport { RevisionNumber } from \"./revision-number.js\";\nimport { Signature } from \"./signature.js\";\nimport { Timestamp } from \"./timestamp.js\";\nexport function _Revision(props) {\n return (_jsxs(\"article\", { className: \"flex items-center justify-between rounded-xl border border-gray-200 bg-white px-4 py-2\", children: [_jsxs(\"div\", { className: \"flex items-center gap-2\", children: [_jsx(RevisionNumber, { ...props }), _jsx(Operation, { ...props }), _jsx(Address, { ...props }), _jsx(Timestamp, { ...props })] }), _jsxs(\"div\", { className: \"flex items-center gap-1\", children: [_jsx(Signature, { ...props }), _jsx(Errors, { ...props })] })] }));\n}\nexport const Revision = memo(_Revision);\n//# sourceMappingURL=revision.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport function Skip(props) {\n const { operationIndex, skipCount } = props;\n const revisionNumber = operationIndex;\n const skippedRevisions = skipCount === 1\n ? `${revisionNumber}`\n : `${revisionNumber} - ${revisionNumber + 1 - skipCount}`;\n return (_jsxs(\"article\", { className: \"grid grid-cols-[1fr,auto,1fr] items-center py-2\", children: [_jsx(\"div\", { className: \"h-px rounded-full bg-slate-100\" }), _jsxs(\"div\", { className: \"mx-3 text-xs text-slate-100\", children: [\"[Skipped Revision \", skippedRevisions, \"]\"] }), _jsx(\"div\", { className: \"h-px rounded-full bg-slate-100\" })] }));\n}\n//# sourceMappingURL=skip.js.map","export function makeRows(operations) {\n const revisionsAndSkips = [];\n const seenDays = new Set();\n for (const operation of operations) {\n const day = operation.timestampUtcMs.split(\"T\")[0];\n if (!seenDays.has(day)) {\n seenDays.add(day);\n revisionsAndSkips.push({\n type: \"day\",\n height: 32,\n timestampUtcMs: day,\n });\n }\n revisionsAndSkips.push({\n type: \"revision\",\n height: 46,\n operationIndex: operation.index,\n eventId: operation.id ?? \"EVENT_ID_NOT_FOUND\",\n stateHash: operation.hash,\n operationType: operation.action.type,\n operationInput: operation.action.input ?? {},\n address: operation.action?.context?.signer?.user.address,\n chainId: operation.action?.context?.signer?.user.chainId,\n timestampUtcMs: operation.timestampUtcMs,\n signatures: makeSignatures(operation.action?.context?.signer?.signatures ?? []),\n errors: operation.error ? [operation.error] : undefined,\n });\n if (operation.skip > 0) {\n revisionsAndSkips.push({\n type: \"skip\",\n height: 34,\n operationIndex: operation.index,\n skipCount: operation.skip,\n timestampUtcMs: operation.timestampUtcMs,\n });\n }\n }\n return revisionsAndSkips;\n}\nexport function getUniqueDatesInOrder(operations) {\n const dates = new Set();\n for (const operation of operations) {\n const date = operation.timestampUtcMs.split(\"T\")[0];\n dates.add(date);\n }\n return Array.from(dates).sort((a, b) => new Date(b).getTime() - new Date(a).getTime());\n}\nfunction makeSignatureFromSignatureArray(signatureArray) {\n const [signerAddress, hash, prevStateHash, signatureBytes] = signatureArray;\n return {\n signerAddress,\n hash,\n prevStateHash,\n signatureBytes,\n isVerified: true,\n };\n}\nfunction makeSignatures(signaturesArray) {\n return signaturesArray?.map(makeSignatureFromSignatureArray);\n}\n//# sourceMappingURL=utils.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Icon } from \"#powerhouse\";\nimport { format } from \"date-fns\";\nexport function Day(props) {\n const { timestampUtcMs: timestamp } = props;\n const formattedDate = format(timestamp, \"MMM dd, yyyy\");\n return (_jsxs(\"h2\", { className: \"-ml-6 flex items-center gap-1 bg-slate-50 py-2 text-xs text-slate-100\", children: [_jsx(Icon, { name: \"Ring\", size: 16 }), \" Changes on \", formattedDate] }));\n}\n//# sourceMappingURL=day.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { createElement as _createElement } from \"react\";\nimport { useVirtualizer } from \"@tanstack/react-virtual\";\nimport { useEffect, useMemo, useRef, useState } from \"react\";\nimport { Revision } from \"../revision/index.js\";\nimport { Skip } from \"../skip/index.js\";\nimport { makeRows } from \"../utils.js\";\nimport { Day } from \"./day.js\";\nexport function Timeline(props) {\n const { localOperations, globalOperations, scope } = props;\n const operations = scope === \"local\" ? localOperations : globalOperations;\n const initialNumRowsToShow = 100;\n const allRows = useMemo(() => makeRows(operations), [operations]);\n const [scrollAmount, setScrollAmount] = useState(0);\n const [numRowsToShow, setNumRowsToShow] = useState(initialNumRowsToShow);\n const [rows, setRows] = useState(() => allRows.slice(0, numRowsToShow));\n const parentRef = useRef(null);\n const hasNextPage = rows.length < allRows.length;\n const rowVirtualizer = useVirtualizer({\n count: rows.length,\n getScrollElement: () => parentRef.current,\n estimateSize: (i) => allRows[i].height,\n gap: 8,\n });\n useEffect(() => {\n if (!hasNextPage)\n return;\n const ratio = Math.floor(scrollAmount / 46);\n const newNumRevisions = initialNumRowsToShow + ratio;\n setNumRowsToShow((prev) => newNumRevisions > prev ? newNumRevisions : prev);\n }, [scrollAmount, hasNextPage]);\n useEffect(() => {\n setRows(allRows.slice(0, numRowsToShow));\n }, [allRows, numRowsToShow]);\n const handleScroll = (e) => {\n setScrollAmount((prev) => {\n const n = prev + e.deltaY;\n if (n < 0) {\n return 0;\n }\n return n;\n });\n };\n useEffect(() => {\n window.addEventListener(\"wheel\", handleScroll);\n return () => {\n window.removeEventListener(\"wheel\", handleScroll);\n };\n }, []);\n return (_jsx(\"div\", { className: \"border-l border-slate-100\", ref: parentRef, style: {\n height: `${rowVirtualizer.getTotalSize()}px`,\n width: \"100%\",\n position: \"relative\",\n }, children: rowVirtualizer.getVirtualItems().map((virtualRow) => {\n const row = rows[virtualRow.index];\n return (_jsxs(\"div\", { style: {\n position: \"absolute\",\n top: 0,\n left: 16,\n width: \"100%\",\n height: `${virtualRow.size}px`,\n transform: `translateY(${virtualRow.start}px)`,\n }, children: [row.type === \"revision\" && (_createElement(Revision, { ...row, key: virtualRow.key })), row.type === \"skip\" && _jsx(Skip, { ...row }, virtualRow.key), row.type === \"day\" && _jsx(Day, { ...row }, virtualRow.key)] }, virtualRow.index));\n }) }));\n}\n//# sourceMappingURL=timeline.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { TooltipProvider } from \"#connect\";\nimport { Pagination, usePagination } from \"#powerhouse\";\nimport { garbageCollect, sortOperations } from \"document-model\";\nimport { useMemo, useState } from \"react\";\nimport { Header } from \"./header/index.js\";\nimport { Timeline } from \"./timeline/index.js\";\nexport function RevisionHistory(props) {\n const { documentTitle, documentId, globalOperations, localOperations, onClose, itemsPerPage = 100, } = props;\n const [scope, setScope] = useState(\"global\");\n const visibleOperations = useMemo(() => {\n const operations = scope === \"global\" ? globalOperations : localOperations;\n return garbageCollect(sortOperations(operations)).sort((a, b) => b.index - a.index);\n }, [globalOperations, localOperations, scope]);\n const { pageItems, pages, goToPage, goToNextPage, goToPreviousPage, goToFirstPage, goToLastPage, hiddenNextPages, isNextPageAvailable, isPreviousPageAvailable, } = usePagination(visibleOperations, {\n itemsPerPage,\n });\n function onChangeScope(scope) {\n goToFirstPage();\n setScope(scope);\n }\n const showPagination = visibleOperations.length > itemsPerPage;\n const PaginationComponent = showPagination ? (_jsx(\"div\", { className: \"mt-4 flex w-full justify-end\", children: _jsx(Pagination, { firstPageLabel: \"First Page\", goToFirstPage: goToFirstPage, goToLastPage: goToLastPage, goToNextPage: goToNextPage, goToPage: goToPage, goToPreviousPage: goToPreviousPage, hiddenNextPages: hiddenNextPages, isNextPageAvailable: isNextPageAvailable, isPreviousPageAvailable: isPreviousPageAvailable, lastPageLabel: \"Last Page\", nextPageLabel: \"Next\", pages: pages, previousPageLabel: \"Previous\" }) })) : (_jsx(\"hr\", { className: \"h-12 border-none\" }));\n return (_jsxs(TooltipProvider, { children: [_jsx(Header, { docId: documentId, onChangeScope: onChangeScope, onClose: onClose, scope: scope, title: documentTitle }), PaginationComponent, _jsx(\"div\", { className: \"mt-4 flex justify-center rounded-md bg-slate-50 p-4\", children: visibleOperations.length > 0 ? (_jsx(\"div\", { className: \"grid grid-cols-[minmax(min-content,1018px)]\", children: _jsx(Timeline, { globalOperations: scope === \"global\" ? pageItems : [], localOperations: scope === \"local\" ? pageItems : [], scope: scope }) })) : (_jsx(\"h3\", { className: \"my-40 text-gray-600\", children: \"This document has no recorded operations yet.\" })) }), PaginationComponent] }));\n}\n//# sourceMappingURL=revision-history.js.map","import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Content, Portal, Provider, Root, Trigger, } from \"@radix-ui/react-tooltip\";\nimport { twMerge } from \"tailwind-merge\";\nexport function Tooltip(props) {\n const { children, content, open, defaultOpen, onOpenChange, className, side = \"top\", sideOffset = 5, delayDuration, ...rest } = props;\n return (_jsxs(Root, { defaultOpen: defaultOpen, delayDuration: delayDuration, onOpenChange: onOpenChange, open: open, children: [_jsx(Trigger, { asChild: true, children: children }), _jsx(Portal, { children: _jsx(Content, { ...rest, side: side, sideOffset: sideOffset, className: twMerge(\"shadow-tooltip rounded-lg border border-gray-200 bg-white p-2 text-xs\", className), children: content }) })] }));\n}\nexport const TooltipProvider = Provider;\n//# sourceMappingURL=tooltip.js.map","export function formatEthAddress(address) {\n return `${address.slice(0, 7)}...${address.slice(-5)}`;\n}\n//# sourceMappingURL=address.js.map","import { compressToEncodedURIComponent } from \"lz-string\";\nexport async function getDriveIdBySlug(driveUrl, slug) {\n if (!driveUrl) {\n return;\n }\n const urlParts = driveUrl.split(\"/\");\n urlParts.pop(); // remove id\n urlParts.pop(); // remove /d\n urlParts.push(\"drives\"); // add /drives\n const drivesUrl = urlParts.join(\"/\");\n const result = await fetch(drivesUrl, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n query: `\n query getDriveIdBySlug($slug: String!) {\n driveIdBySlug(slug: $slug)\n }\n `,\n variables: {\n slug,\n },\n }),\n });\n const data = (await result.json());\n return data.data.driveIdBySlug;\n}\nexport function getSlugFromDriveUrl(driveUrl) {\n const urlParts = driveUrl.split(\"/\");\n return urlParts.pop();\n}\nexport function getSwitchboardGatewayUrlFromDriveUrl(driveUrl) {\n const urlParts = driveUrl.split(\"/\");\n urlParts.pop(); // remove id\n urlParts.pop(); // remove /d\n urlParts.push(\"graphql\"); // add /graphql\n return urlParts.join(\"/\");\n}\nexport function getDocumentGraphqlQuery(documentModel) {\n return `query getDocument($documentId: String!) {\n document(id: $documentId) {\n id\n lastModified\n name\n revision\n stateJSON\n }\n }\n`;\n}\nexport function buildDocumentSubgraphQuery(driveUrl, documentId, documentModel, authToken) {\n const driveSlug = getSlugFromDriveUrl(driveUrl);\n const query = getDocumentGraphqlQuery(documentModel);\n const variables = { documentId, driveId: driveSlug };\n const queryData = {\n document: query.trim(),\n variables: JSON.stringify(variables, null, 2),\n };\n if (authToken) {\n queryData.headers = JSON.stringify({\n Authorization: `Bearer ${authToken}`,\n });\n }\n return compressToEncodedURIComponent(JSON.stringify(queryData));\n}\nexport function buildDocumentSubgraphUrl(driveUrl, documentId, documentModel, authToken) {\n const encodedQuery = buildDocumentSubgraphQuery(driveUrl, documentId, documentModel, authToken);\n return `${driveUrl}?explorerURLState=${encodedQuery}`;\n}\n//# sourceMappingURL=switchboard.js.map","const openBrowserUrl = (url: string) => window.open(url, '_blank');\n\nexport const openUrl = openBrowserUrl;\n","import {\n type DocumentModelDocument,\n type PHDocument,\n validateInitialState,\n validateModules,\n validateStateSchemaName,\n type ValidationError,\n} from 'document-model';\nexport const validateDocument = (document: PHDocument) => {\n const errors: ValidationError[] = [];\n\n if (document.header.documentType !== 'powerhouse/document-model') {\n return errors;\n }\n\n const doc = document as DocumentModelDocument;\n const specs = doc.state.global.specifications[0];\n\n // validate initial state errors\n const initialStateErrors = Object.keys(specs.state).reduce<\n ValidationError[]\n >((acc, scopeKey) => {\n const scope = scopeKey as keyof typeof specs.state;\n\n return [\n ...acc,\n ...validateInitialState(\n specs.state[scope].initialValue,\n scope !== 'global',\n ).map(err => ({\n ...err,\n message: `${err.message}. Scope: ${scope}`,\n details: { ...err.details, scope },\n })),\n ];\n }, []);\n\n // validate schema state errors\n const schemaStateErrors = Object.keys(specs.state).reduce<\n ValidationError[]\n >((acc, scopeKey) => {\n const scope = scopeKey as keyof typeof specs.state;\n const isGlobalScope = scope === 'global';\n\n return [\n ...acc,\n ...validateStateSchemaName(\n specs.state[scope].schema,\n doc.header.name || doc.state.global?.name || '',\n !isGlobalScope ? scope : '',\n !isGlobalScope,\n ).map(err => ({\n ...err,\n message: `${err.message}. Scope: ${scope}`,\n details: { ...err.details, scope },\n })),\n ];\n }, []);\n\n // modules validation\n const modulesErrors = validateModules(specs.modules);\n\n return [...initialStateErrors, ...schemaStateErrors, ...modulesErrors];\n};\n","import { AnalyticsPath, } from \"@powerhousedao/analytics-engine-core\";\nimport { useMutation, useQuery, useQueryClient, } from \"@tanstack/react-query\";\nimport { useEffect } from \"react\";\nimport { getAnalyticsStore, useAnalyticsEngineAsync, useAnalyticsStoreAsync, useAnalyticsStoreOptions, } from \"./context.js\";\nfunction useAnalyticsQueryWrapper(options) {\n const { queryFn, ...queryOptions } = options;\n const { data: store } = useAnalyticsStoreAsync();\n const { data: engine } = useAnalyticsEngineAsync();\n const enabled = \"enabled\" in queryOptions ? queryOptions.enabled : !!store && !!engine;\n return useQuery({\n ...queryOptions,\n enabled,\n queryFn: async () => {\n if (!store || !engine) {\n throw new Error(\"No analytics store available. Use within an AnalyticsProvider.\");\n }\n return await queryFn({ store, engine });\n },\n });\n}\nfunction useAnalyticsMutationWrapper(options) {\n const { mutationFn, ...mutationOptions } = options;\n const storeOptions = useAnalyticsStoreOptions();\n return useMutation({\n ...mutationOptions,\n mutationFn: async (value) => {\n let store = null;\n try {\n store = await getAnalyticsStore(storeOptions);\n }\n catch (e) {\n console.error(e);\n }\n if (!store) {\n throw new Error(\"No analytics store available. Use within an AnalyticsProvider.\");\n }\n return await mutationFn(value, { store });\n },\n });\n}\nconst DEBOUNCE_INTERVAL = 200;\nexport function useAnalyticsQuery(query, options) {\n const { data: store } = useAnalyticsStoreAsync();\n const queryClient = useQueryClient();\n const sources = options?.sources ?? [];\n const result = useAnalyticsQueryWrapper({\n queryKey: [\"analytics\", \"query\", query],\n queryFn: ({ engine }) => engine.execute(query),\n ...options,\n });\n useEffect(() => {\n if (!sources.length || !store) {\n return;\n }\n const subscriptions = new Array();\n // Debounce invalidateQueries so it's not called too frequently\n let invalidateTimeout = null;\n const debouncedInvalidate = () => {\n if (invalidateTimeout)\n clearTimeout(invalidateTimeout);\n invalidateTimeout = setTimeout(() => {\n queryClient\n .invalidateQueries({\n queryKey: [\"analytics\", \"query\", query],\n })\n .catch((e) => {\n console.error(e);\n });\n }, DEBOUNCE_INTERVAL);\n };\n sources.forEach((path) => {\n const unsub = store.subscribeToSource(path, debouncedInvalidate);\n subscriptions.push(unsub);\n });\n // Unsubscribes from store when component unmounts or dependencies change\n return () => {\n subscriptions.forEach((unsub) => unsub());\n };\n }, [query, store, sources]);\n return result;\n}\nexport function useAnalyticsSeries(query, options) {\n return useAnalyticsQueryWrapper({\n queryKey: [\"analytics\", \"series\", query],\n queryFn: ({ store }) => store.getMatchingSeries(query),\n ...options,\n });\n}\nexport function useAddSeriesValue(options) {\n return useAnalyticsMutationWrapper({\n mutationKey: [\"analytics\", \"addSeries\"],\n mutationFn: async (value, { store }) => {\n return await store.addSeriesValue(value);\n },\n ...options,\n });\n}\nexport function useClearSeriesBySource(options) {\n return useAnalyticsMutationWrapper({\n mutationKey: [\"analytics\", \"clearSeries\"],\n mutationFn: async ({ source, cleanUpDimensions }, { store }) => {\n return store.clearSeriesBySource(source, cleanUpDimensions);\n },\n ...options,\n });\n}\nexport function useClearEmptyAnalyticsDimensions(options) {\n return useAnalyticsMutationWrapper({\n mutationKey: [\"analytics\", \"clearEmptyDimensions\"],\n mutationFn: async (_, { store }) => {\n return store.clearEmptyAnalyticsDimensions();\n },\n ...options,\n });\n}\nexport function useAddSeriesValues(options) {\n return useAnalyticsMutationWrapper({\n mutationKey: [\"analytics\", \"addSeriesValues\"],\n mutationFn: async (values, { store }) => {\n return store.addSeriesValues(values);\n },\n ...options,\n });\n}\nexport function useGetDimensions(options) {\n return useAnalyticsQueryWrapper({\n queryKey: [\"analytics\", \"dimensions\"],\n queryFn: ({ store }) => store.getDimensions(),\n ...options,\n });\n}\nexport function useMatchingSeries(query, options) {\n const result = useAnalyticsQueryWrapper({\n queryKey: [\"analytics\", \"matchingSeries\", query],\n queryFn: ({ store }) => store.getMatchingSeries(query),\n ...options,\n });\n return result;\n}\nexport function useQuerySources(query, options) {\n const { data: matchingSeries } = useMatchingSeries(query);\n return useQuery({\n queryKey: [\"analytics\", \"sources\", query],\n queryFn: () => {\n if (!matchingSeries?.length) {\n return [];\n }\n const uniqueSources = [\n ...new Set(matchingSeries.map((s) => s.source.toString())),\n ];\n return uniqueSources.map((source) => AnalyticsPath.fromString(source));\n },\n enabled: !!matchingSeries,\n ...options,\n });\n}\n//# sourceMappingURL=hooks.js.map","import { AnalyticsGranularity, AnalyticsPath, DateTime, useAnalyticsQuery, } from \"@powerhousedao/reactor-browser/analytics\";\nconst getBarSize = (value) => {\n if (value <= 0)\n return 0;\n if (value > 0 && value <= 50)\n return 1;\n if (value > 50 && value <= 100)\n return 2;\n if (value > 100 && value <= 250)\n return 3;\n return 4;\n};\nfunction addItemsDividers(items) {\n if (!items.length)\n return [];\n const result = [];\n items.forEach((item, index) => {\n result.push(item);\n // Check if there's a next item and if they're not in consecutive hours\n if (index < items.length - 1) {\n const currentDate = new Date(item.startDate);\n const nextDate = new Date(items[index + 1].startDate);\n const currentHour = currentDate.getHours();\n const nextHour = nextDate.getHours();\n // Get day parts (without time) for comparison\n const currentDay = currentDate.toDateString();\n const nextDay = nextDate.toDateString();\n // If different days or non-consecutive hours on the same day\n if (currentDay !== nextDay ||\n (currentDay === nextDay && Math.abs(nextHour - currentHour) > 1)) {\n result.push({\n id: `divider-${item.id}-${items[index + 1].id}`,\n type: \"divider\",\n revision: 0,\n });\n }\n }\n });\n return result;\n}\nfunction metricsToItems(metrics) {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!metrics)\n return [];\n const items = metrics\n .sort((a, b) => {\n const aDate = new Date(a.start);\n const bDate = new Date(b.start);\n return aDate.getTime() - bDate.getTime();\n })\n .filter((result) => {\n return result.rows.every((row) => row.value > 0);\n })\n .map((result) => {\n const { additions, deletions } = result.rows.reduce((acc, row) => {\n if (row.dimensions.changes.path ===\n \"ph/diff/changes/add\") {\n acc.additions += row.value;\n }\n else if (row.dimensions.changes.path ===\n \"ph/diff/changes/remove\") {\n acc.deletions += row.value;\n }\n return acc;\n }, { additions: 0, deletions: 0 });\n const startDate = new Date(result.start);\n return {\n id: startDate.toISOString(),\n type: \"bar\",\n addSize: getBarSize(additions),\n delSize: getBarSize(deletions),\n additions,\n deletions,\n timestampUtcMs: startDate.toISOString(),\n startDate: startDate,\n endDate: new Date(result.end),\n revision: 0,\n };\n });\n return addItemsDividers(items);\n}\nexport const useTimelineItems = (documentId, startTimestamp, driveId) => {\n const start = startTimestamp\n ? DateTime.fromISO(startTimestamp)\n : DateTime.now().startOf(\"day\");\n return useAnalyticsQuery({\n start,\n end: DateTime.now().endOf(\"day\"),\n granularity: AnalyticsGranularity.Hourly,\n metrics: [\"Count\"],\n select: {\n changes: [AnalyticsPath.fromString(`ph/diff/changes`)],\n document: [AnalyticsPath.fromString(`ph/diff/document/${documentId}`)],\n },\n lod: {\n changes: 4,\n },\n }, {\n sources: [AnalyticsPath.fromString(`ph/diff/${driveId}/${documentId}`)],\n select: metricsToItems,\n });\n};\n//# sourceMappingURL=useTimelineItems.js.map","export const getRevisionFromDate = (startDate, endDate, operations = []) => {\n if (!startDate || !endDate)\n return 0;\n const operation = operations.find((operation) => {\n const operationDate = new Date(operation.timestampUtcMs);\n return operationDate >= startDate && operationDate <= endDate;\n });\n return operation ? operation.index : 0;\n};\n//# sourceMappingURL=index.js.map","import { DefaultEditorLoader } from '@powerhousedao/design-system';\nimport {\n type ComponentProps,\n type ReactNode,\n useEffect,\n useState,\n} from 'react';\n\ntype Props = ComponentProps<typeof DefaultEditorLoader> & {\n loadingTimeout?: number;\n customEditorLoader?: ReactNode;\n};\nexport function EditorLoader(props: Props) {\n const [showLoading, setShowLoading] = useState(false);\n\n // only shows the loader after some time has passed\n useEffect(() => {\n setTimeout(() => {\n setShowLoading(true);\n }, props.loadingTimeout ?? 200);\n }, [props]);\n\n if (!showLoading) return null;\n\n const { customEditorLoader, ...defaultProps } = props;\n\n if (customEditorLoader) return <>{customEditorLoader}</>;\n\n return <DefaultEditorLoader {...defaultProps} />;\n}\n","import { useUndoRedoShortcuts } from '#hooks';\nimport { getRevisionFromDate, useTimelineItems } from '@powerhousedao/common';\nimport {\n Button,\n DocumentToolbar,\n RevisionHistory,\n type TimelineItem,\n} from '@powerhousedao/design-system';\nimport {\n useDocumentById,\n useDocumentModelModuleById,\n useEditorModuleById,\n useFallbackEditorModule,\n useUserPermissions,\n} from '@powerhousedao/reactor-browser';\nimport { type PHDocument, redo, undo } from 'document-model';\nimport { Suspense, useEffect, useState } from 'react';\nimport { ErrorBoundary, type FallbackProps } from 'react-error-boundary';\nimport { useNavigate } from 'react-router-dom';\nimport { EditorLoader } from './editor-loader.js';\nimport { useModal } from './modal/index.js';\n\ntype Props<TDocument extends PHDocument = PHDocument> = {\n document: TDocument;\n onClose: () => void;\n onExport: () => void;\n onOpenSwitchboardLink?: () => Promise<void>;\n};\n\nfunction EditorError({ message }: { message: React.ReactNode }) {\n return (\n <div className=\"flex size-full items-center justify-center\">\n <h3 className=\"text-lg font-semibold\">{message}</h3>\n </div>\n );\n}\n\nfunction FallbackEditorError(props: FallbackProps) {\n const message =\n props.error instanceof Error\n ? props.error.message\n : (props.error as string);\n return <EditorError message={message} />;\n}\n\nexport const DocumentEditor: React.FC<Props> = props => {\n const {\n document: initialDocument,\n onClose,\n onExport,\n onOpenSwitchboardLink,\n } = props;\n const [selectedTimelineItem, setSelectedTimelineItem] =\n useState<TimelineItem | null>(null);\n const [revisionHistoryVisible, setRevisionHistoryVisible] = useState(false);\n const [document, dispatch] = useDocumentById(initialDocument.header.id);\n const documentId = document?.header.id ?? undefined;\n const documentName = document?.header.name ?? undefined;\n const documentType = document?.header.documentType ?? undefined;\n const preferredEditor = document?.header.meta?.preferredEditor ?? undefined;\n const createdAt = document?.header.createdAtUtcIso ?? undefined;\n const globalOperations = document?.operations.global ?? [];\n const localOperations = document?.operations.local ?? [];\n const globalRevisionNumber = document?.header.revision.global ?? 0;\n const localRevisionNumber = document?.header.revision.local ?? 0;\n const documentModelModule = useDocumentModelModuleById(documentType);\n const preferredEditorModule = useEditorModuleById(preferredEditor);\n const fallbackEditorModule = useFallbackEditorModule(documentType);\n const editorModule = preferredEditorModule ?? fallbackEditorModule;\n\n const userPermissions = useUserPermissions();\n\n const timelineItems = useTimelineItems(documentId, createdAt);\n\n const isLoadingEditor =\n editorModule === undefined ||\n (editorModule &&\n documentType &&\n !editorModule.documentTypes.includes(documentType) &&\n !editorModule.documentTypes.includes('*'));\n\n const canUndo = globalRevisionNumber > 0 || localRevisionNumber > 0;\n const canRedo = !!document?.clipboard.length;\n const addUndoAction = () => dispatch(undo());\n const addRedoAction = () => dispatch(redo());\n useUndoRedoShortcuts({\n undo: addUndoAction,\n redo: addRedoAction,\n canUndo,\n canRedo,\n });\n\n useEffect(() => {\n return () => {\n window.documentEditorDebugTools?.clear();\n };\n }, []);\n\n const navigate = useNavigate();\n const { showModal } = useModal();\n\n const [editorError, setEditorError] = useState<\n | {\n error: any;\n info: React.ErrorInfo;\n documentId?: string;\n // clear: () => void;\n }\n | undefined\n >(undefined);\n\n useEffect(() => {\n if (editorError && editorError.documentId !== documentId) {\n setEditorError(undefined);\n }\n }, [editorError, documentId]);\n\n const handleEditorError = (error: Error, info: React.ErrorInfo) => {\n setEditorError({\n error,\n documentId,\n info,\n });\n };\n\n if (isLoadingEditor) {\n return <EditorLoader message=\"Loading editor\" />;\n }\n\n if (!documentModelModule) {\n return (\n <EditorError\n message={\n <div className=\"text-center leading-10\">\n <p>\n Unable to open the document because the document\n model \"{documentType}\" is not supported.\n </p>\n <p>\n Go to the{' '}\n <button\n type=\"button\"\n className=\"cursor-pointer underline\"\n onClick={() => {\n showModal('settingsModal', {\n onRefresh: () => navigate(0),\n });\n }}\n >\n package manager\n </button>{' '}\n to install this document model\n </p>\n </div>\n }\n />\n );\n }\n\n if (!editorModule) {\n return (\n <EditorError\n message={\n <div className=\"text-center leading-10\">\n <p>\n Unable to open the document because no editor has\n been found\n </p>\n <p>\n Go to the{' '}\n <button\n type=\"button\"\n className=\"cursor-pointer underline\"\n onClick={() => {\n showModal('settingsModal', {\n onRefresh: () => navigate(0),\n });\n }}\n >\n package manager\n </button>{' '}\n an editor for the \"${documentType}\" document type\n </p>\n </div>\n }\n />\n );\n }\n\n const EditorComponent = editorModule.Component;\n const {\n disableExternalControls,\n documentToolbarEnabled,\n showSwitchboardLink,\n timelineEnabled,\n } = editorModule.config;\n\n const handleSwitchboardLinkClick =\n showSwitchboardLink !== false ? onOpenSwitchboardLink : undefined;\n return (\n <div className=\"relative h-full\" id=\"document-editor-context\">\n {documentToolbarEnabled &&\n disableExternalControls &&\n !revisionHistoryVisible && (\n <DocumentToolbar\n onClose={onClose}\n onExport={onExport}\n onShowRevisionHistory={() =>\n setRevisionHistoryVisible(true)\n }\n title={documentName}\n onSwitchboardLinkClick={handleSwitchboardLinkClick}\n timelineButtonVisible={timelineEnabled}\n timelineItems={timelineItems.data}\n onTimelineItemClick={setSelectedTimelineItem}\n />\n )}\n {!disableExternalControls && (\n <div className=\"mb-4 flex justify-end gap-10\">\n <Button onClick={onExport}>Export</Button>\n <div className=\"flex gap-4\">\n <Button onClick={addUndoAction} disabled={!canUndo}>\n Undo\n </Button>\n <Button onClick={addRedoAction} disabled={!canRedo}>\n Redo\n </Button>\n </div>\n <div className=\"flex gap-4\">\n <Button onClick={onClose}>Close</Button>\n </div>\n </div>\n )}\n {revisionHistoryVisible ? (\n <RevisionHistory\n key={documentId}\n documentTitle={documentName ?? ''}\n documentId={documentId ?? ''}\n globalOperations={globalOperations}\n localOperations={localOperations}\n onClose={() => setRevisionHistoryVisible(false)}\n />\n ) : (\n <Suspense fallback={<EditorLoader />} name=\"EditorLoader\">\n <ErrorBoundary\n fallbackRender={FallbackEditorError}\n key={documentId}\n onError={handleEditorError}\n >\n {!editorError?.error && (\n <EditorComponent\n key={documentId}\n context={{\n readMode: !!selectedTimelineItem,\n selectedTimelineRevision:\n getRevisionFromDate(\n selectedTimelineItem?.startDate,\n selectedTimelineItem?.endDate,\n globalOperations,\n ),\n }}\n document={document}\n documentNodeName={documentName ?? ''}\n onClose={onClose}\n onExport={onExport}\n canUndo={canUndo}\n canRedo={canRedo}\n onSwitchboardLinkClick={\n handleSwitchboardLinkClick\n }\n onShowRevisionHistory={() =>\n setRevisionHistoryVisible(true)\n }\n isAllowedToCreateDocuments={\n userPermissions?.isAllowedToCreateDocuments ??\n false\n }\n isAllowedToEditDocuments={\n userPermissions?.isAllowedToEditDocuments ??\n false\n }\n />\n )}\n </ErrorBoundary>\n </Suspense>\n )}\n </div>\n );\n};\n","import { openUrl } from '#utils';\nimport {\n exportFile,\n setSelectedNode,\n useConnectCrypto,\n useDocumentModelModuleById,\n useDriveIsRemote,\n useDriveRemoteUrl,\n useParentFolder,\n useSelectedDocument,\n useSelectedDrive,\n useUser,\n} from '@powerhousedao/reactor-browser';\nimport { buildDocumentSubgraphUrl } from '@powerhousedao/reactor-browser/utils/switchboard';\nimport { type PHDocument } from 'document-model';\nimport { useMemo } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useModal } from '../components/modal/index.js';\nimport { validateDocument } from '../utils/validate-document.js';\nimport { DocumentEditor } from './editors.js';\n\nexport function DocumentEditorContainer() {\n const { t } = useTranslation();\n const { showModal } = useModal();\n const [selectedDrive] = useSelectedDrive();\n const [selectedDocument] = useSelectedDocument();\n const parentFolder = useParentFolder(selectedDocument?.header.id);\n const documentType = selectedDocument?.header.documentType;\n const isRemoteDrive = useDriveIsRemote(selectedDrive?.header.id);\n const remoteUrl = useDriveRemoteUrl(selectedDrive?.header.id);\n const documentModelModule = useDocumentModelModuleById(documentType);\n const connectCrypto = useConnectCrypto();\n const user = useUser();\n\n const exportDocument = (document: PHDocument) => {\n const validationErrors = validateDocument(document);\n\n if (validationErrors.length) {\n showModal('confirmationModal', {\n title: t('modals.exportDocumentWithErrors.title'),\n body: (\n <div>\n <p>{t('modals.exportDocumentWithErrors.body')}</p>\n <ul className=\"mt-4 flex list-disc flex-col items-start px-4 text-xs\">\n {validationErrors.map((error, index) => (\n <li key={index}>{error.message}</li>\n ))}\n </ul>\n </div>\n ),\n cancelLabel: t('common.cancel'),\n continueLabel: t('common.export'),\n onCancel(closeModal) {\n closeModal();\n },\n onContinue(closeModal) {\n closeModal();\n return exportFile(document);\n },\n });\n } else {\n return exportFile(document);\n }\n };\n\n const onExport = () => {\n if (selectedDocument) {\n return exportDocument(selectedDocument);\n }\n };\n\n // TODO: fix this mess\n const onOpenSwitchboardLink = useMemo(() => {\n return isRemoteDrive\n ? async () => {\n if (!selectedDocument?.header.id) {\n console.error('No selected document');\n return;\n }\n\n if (!remoteUrl) {\n console.error('No remote drive url found');\n return;\n }\n\n if (!documentModelModule) {\n console.error('No document model found');\n return;\n }\n\n // @todo: add environment variable for token expiration\n const token = user?.address\n ? await connectCrypto?.getBearerToken(\n remoteUrl,\n user.address,\n false,\n { expiresIn: 600 },\n )\n : undefined;\n\n const url = buildDocumentSubgraphUrl(\n remoteUrl,\n selectedDocument.header.id,\n documentModelModule.documentModel,\n token,\n );\n try {\n openUrl(url);\n } catch (e) {\n console.error('Error opening switchboard link', e);\n }\n }\n : undefined;\n }, [isRemoteDrive, remoteUrl, selectedDocument, documentModelModule]);\n\n if (!selectedDocument) return null;\n\n return (\n <div className=\"flex-1 rounded-2xl bg-gray-50 p-4\">\n <DocumentEditor\n document={selectedDocument}\n onClose={() => setSelectedNode(parentFolder)}\n onExport={onExport}\n onOpenSwitchboardLink={onOpenSwitchboardLink}\n />\n </div>\n );\n}\n","import connectConfig from '#connect-config';\nimport { useNodeActions, useShowDeleteNodeModal } from '#hooks';\nimport { GenericDriveExplorer } from '@powerhousedao/common';\nimport {\n useDefaultDriveEditorModule,\n useDriveEditorModuleById,\n useSelectedDrive,\n} from '@powerhousedao/reactor-browser';\nimport { type DocumentModelModule } from 'document-model';\nimport { useCallback } from 'react';\nimport { ErrorBoundary, type FallbackProps } from 'react-error-boundary';\nimport { useModal } from './modal/index.js';\n\nfunction DriveEditorError({ error }: FallbackProps) {\n return (\n <div className=\"mx-auto flex max-w-[80%] flex-1 flex-col items-center justify-center\">\n <h1 className=\"mb-2 text-xl font-semibold\">Error</h1>\n <i>{error instanceof Error ? error.message : error}</i>\n <pre>{JSON.stringify(error, null, 2)}</pre>\n </div>\n );\n}\n\nexport function DriveEditorContainer() {\n const [selectedDrive] = useSelectedDrive();\n const nodeActions = useNodeActions();\n const { showModal } = useModal();\n const showCreateDocumentModal = useCallback(\n (documentModel: DocumentModelModule) => {\n showModal('createDocument', {\n documentModel,\n });\n },\n [showModal],\n );\n const showDeleteNodeModal = useShowDeleteNodeModal();\n\n const driveEditor = useDriveEditorModuleById(\n selectedDrive?.header.meta?.preferredEditor,\n );\n const defaultDriveEditor = useDefaultDriveEditorModule();\n\n const DriveEditorComponent =\n driveEditor?.Component ??\n defaultDriveEditor?.Component ??\n GenericDriveExplorer.Component;\n\n if (!selectedDrive) return null;\n\n return (\n <ErrorBoundary\n fallbackRender={DriveEditorError}\n key={selectedDrive.header.id}\n >\n <DriveEditorComponent\n context={{\n ...nodeActions,\n showCreateDocumentModal,\n showDeleteNodeModal,\n }}\n document={selectedDrive}\n />\n </ErrorBoundary>\n );\n}\n","import { type TNodeActions } from '@powerhousedao/design-system';\nimport {\n addFile,\n addFolder,\n addTrigger,\n copyNode,\n moveNode,\n registerNewPullResponderTrigger,\n removeTrigger,\n renameNode,\n setSelectedNode,\n useSelectedDrive,\n useSelectedFolder,\n useSelectedParentFolder,\n} from '@powerhousedao/reactor-browser';\nimport { type Node } from 'document-drive';\nimport { useCallback, useMemo } from 'react';\nexport function useDebugHandlers() {\n const onAddTrigger = useCallback(\n async (driveId: string) => {\n const url = window.prompt('url') || '';\n\n const pullResponderTrigger = await registerNewPullResponderTrigger(\n driveId,\n url,\n { pullInterval: 6000 },\n );\n if (!pullResponderTrigger) return;\n await addTrigger(driveId, pullResponderTrigger);\n },\n [addTrigger, registerNewPullResponderTrigger],\n );\n\n const onRemoveTrigger = useCallback(\n async (driveId: string) => {\n const triggerId = window.prompt('triggerId:');\n\n if (triggerId) {\n await removeTrigger(driveId, triggerId);\n }\n },\n [removeTrigger],\n );\n\n const onAddInvalidTrigger = useCallback(\n async (driveId: string) => {\n const url = window.prompt('url') || '';\n\n await addTrigger(driveId, {\n id: 'some-invalid-id',\n type: 'PullResponder',\n data: {\n interval: '3000',\n listenerId: 'invalid-listener-id',\n url,\n },\n });\n },\n [addTrigger],\n );\n\n return {\n onAddTrigger,\n onRemoveTrigger,\n onAddInvalidTrigger,\n };\n}\n\nfunction resolveNode(driveId: string, node: Node | undefined) {\n return node?.id !== driveId ? node : undefined;\n}\n\nexport function useNodeActions(): TNodeActions {\n const [selectedDrive] = useSelectedDrive();\n const selectedFolder = useSelectedFolder();\n const selectedParentFolder = useSelectedParentFolder();\n const selectedDriveId = selectedDrive?.header.id;\n\n const onAddFile = useCallback(\n async (file: File, parent: Node | undefined) => {\n if (!selectedDriveId) return;\n\n const fileName = file.name.replace(/\\..+/gim, '');\n\n return await addFile(\n file,\n selectedDriveId,\n fileName,\n resolveNode(selectedDriveId, parent)?.id,\n );\n },\n [addFile, selectedDriveId],\n );\n\n const onAddFolder = useCallback(\n async (name: string, parent: Node | undefined) => {\n if (!selectedDriveId) return;\n\n return await addFolder(\n selectedDriveId,\n name,\n resolveNode(selectedDriveId, parent)?.id,\n );\n },\n [addFolder, selectedDriveId],\n );\n\n const onRenameNode = useCallback(\n async (newName: string, node: Node): Promise<Node | undefined> => {\n if (!selectedDriveId) return;\n\n const resolvedNode = resolveNode(selectedDriveId, node);\n if (!resolvedNode) {\n console.error(`Node ${node.id} not found`);\n return;\n }\n\n return await renameNode(selectedDriveId, node.id, newName);\n },\n [renameNode, selectedDriveId],\n );\n\n const onCopyNode = useCallback(\n async (src: Node, target: Node | undefined) => {\n if (!selectedDriveId) return;\n const resolvedSrc = resolveNode(selectedDriveId, src);\n if (!resolvedSrc) {\n console.error(`Node ${src.id} not found`);\n return;\n }\n const resolvedTarget = resolveNode(selectedDriveId, target);\n\n await copyNode(selectedDriveId, resolvedSrc, resolvedTarget);\n },\n [copyNode, selectedDriveId],\n );\n\n const onMoveNode = useCallback(\n async (src: Node, target: Node | undefined) => {\n if (!selectedDriveId) return;\n\n const resolvedSrc = resolveNode(selectedDriveId, src);\n if (!resolvedSrc) {\n console.error(`Node ${src.id} not found`);\n return;\n }\n const resolvedTarget = resolveNode(selectedDriveId, target);\n await moveNode(selectedDriveId, resolvedSrc, resolvedTarget);\n },\n [moveNode, selectedDriveId],\n );\n\n const onDuplicateNode = useCallback(\n async (src: Node) => {\n if (!selectedDriveId) return;\n\n const resolvedSrc = resolveNode(selectedDriveId, src);\n if (!resolvedSrc) {\n console.error(`Node ${src.id} not found`);\n return;\n }\n\n const target = resolveNode(\n selectedDriveId,\n selectedFolder ?? selectedParentFolder,\n );\n await copyNode(selectedDriveId, resolvedSrc, target);\n },\n [copyNode, selectedDriveId, selectedFolder, selectedParentFolder],\n );\n\n const onAddAndSelectNewFolder = useCallback(\n async (name: string) => {\n if (!name) return;\n if (!selectedDriveId) return;\n\n const resolvedTarget = resolveNode(\n selectedDriveId,\n selectedFolder ?? selectedParentFolder,\n );\n if (!resolvedTarget) return;\n\n const newFolder = await onAddFolder(name, resolvedTarget);\n\n if (newFolder) {\n setSelectedNode(newFolder);\n }\n },\n [\n onAddFolder,\n selectedDriveId,\n selectedFolder,\n selectedParentFolder,\n setSelectedNode,\n ],\n );\n\n return useMemo(\n () => ({\n onAddFile,\n onAddFolder,\n onRenameNode,\n onCopyNode,\n onMoveNode,\n onDuplicateNode,\n onAddAndSelectNewFolder,\n }),\n [\n onAddFolder,\n onAddFile,\n onCopyNode,\n onMoveNode,\n onRenameNode,\n onDuplicateNode,\n onAddAndSelectNewFolder,\n ],\n );\n}\n","import { useContext, createContext, useState, useCallback, useRef, useLayoutEffect, useEffect } from 'react';\nimport { jsx } from 'react/jsx-runtime';\n\nfunction _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\n\nvar reservedModifierKeywords = ['shift', 'alt', 'meta', 'mod', 'ctrl'];\nvar mappedKeys = {\n esc: 'escape',\n \"return\": 'enter',\n '.': 'period',\n ',': 'comma',\n '-': 'slash',\n ' ': 'space',\n '`': 'backquote',\n '#': 'backslash',\n '+': 'bracketright',\n ShiftLeft: 'shift',\n ShiftRight: 'shift',\n AltLeft: 'alt',\n AltRight: 'alt',\n MetaLeft: 'meta',\n MetaRight: 'meta',\n OSLeft: 'meta',\n OSRight: 'meta',\n ControlLeft: 'ctrl',\n ControlRight: 'ctrl'\n};\nfunction mapKey(key) {\n return (key && mappedKeys[key] || key || '').trim().toLowerCase().replace(/key|digit|numpad|arrow/, '');\n}\nfunction isHotkeyModifier(key) {\n return reservedModifierKeywords.includes(key);\n}\nfunction parseKeysHookInput(keys, splitKey) {\n if (splitKey === void 0) {\n splitKey = ',';\n }\n return keys.split(splitKey);\n}\nfunction parseHotkey(hotkey, combinationKey, description) {\n if (combinationKey === void 0) {\n combinationKey = '+';\n }\n var keys = hotkey.toLocaleLowerCase().split(combinationKey).map(function (k) {\n return mapKey(k);\n });\n var modifiers = {\n alt: keys.includes('alt'),\n ctrl: keys.includes('ctrl') || keys.includes('control'),\n shift: keys.includes('shift'),\n meta: keys.includes('meta'),\n mod: keys.includes('mod')\n };\n var singleCharKeys = keys.filter(function (k) {\n return !reservedModifierKeywords.includes(k);\n });\n return _extends({}, modifiers, {\n keys: singleCharKeys,\n description: description,\n hotkey: hotkey\n });\n}\n\n(function () {\n if (typeof document !== 'undefined') {\n document.addEventListener('keydown', function (e) {\n if (e.key === undefined) {\n // Synthetic event (e.g., Chrome autofill). Ignore.\n return;\n }\n pushToCurrentlyPressedKeys([mapKey(e.key), mapKey(e.code)]);\n });\n document.addEventListener('keyup', function (e) {\n if (e.key === undefined) {\n // Synthetic event (e.g., Chrome autofill). Ignore.\n return;\n }\n removeFromCurrentlyPressedKeys([mapKey(e.key), mapKey(e.code)]);\n });\n }\n if (typeof window !== 'undefined') {\n window.addEventListener('blur', function () {\n currentlyPressedKeys.clear();\n });\n }\n})();\nvar currentlyPressedKeys = /*#__PURE__*/new Set();\n// https://github.com/microsoft/TypeScript/issues/17002\nfunction isReadonlyArray(value) {\n return Array.isArray(value);\n}\nfunction isHotkeyPressed(key, splitKey) {\n if (splitKey === void 0) {\n splitKey = ',';\n }\n var hotkeyArray = isReadonlyArray(key) ? key : key.split(splitKey);\n return hotkeyArray.every(function (hotkey) {\n return currentlyPressedKeys.has(hotkey.trim().toLowerCase());\n });\n}\nfunction pushToCurrentlyPressedKeys(key) {\n var hotkeyArray = Array.isArray(key) ? key : [key];\n /*\r\n Due to a weird behavior on macOS we need to clear the set if the user pressed down the meta key and presses another key.\r\n https://stackoverflow.com/questions/11818637/why-does-javascript-drop-keyup-events-when-the-metakey-is-pressed-on-mac-browser\r\n Otherwise the set will hold all ever pressed keys while the meta key is down which leads to wrong results.\r\n */\n if (currentlyPressedKeys.has('meta')) {\n currentlyPressedKeys.forEach(function (key) {\n return !isHotkeyModifier(key) && currentlyPressedKeys[\"delete\"](key.toLowerCase());\n });\n }\n hotkeyArray.forEach(function (hotkey) {\n return currentlyPressedKeys.add(hotkey.toLowerCase());\n });\n}\nfunction removeFromCurrentlyPressedKeys(key) {\n var hotkeyArray = Array.isArray(key) ? key : [key];\n /*\r\n Due to a weird behavior on macOS we need to clear the set if the user pressed down the meta key and presses another key.\r\n https://stackoverflow.com/questions/11818637/why-does-javascript-drop-keyup-events-when-the-metakey-is-pressed-on-mac-browser\r\n Otherwise the set will hold all ever pressed keys while the meta key is down which leads to wrong results.\r\n */\n if (key === 'meta') {\n currentlyPressedKeys.clear();\n } else {\n hotkeyArray.forEach(function (hotkey) {\n return currentlyPressedKeys[\"delete\"](hotkey.toLowerCase());\n });\n }\n}\n\nfunction maybePreventDefault(e, hotkey, preventDefault) {\n if (typeof preventDefault === 'function' && preventDefault(e, hotkey) || preventDefault === true) {\n e.preventDefault();\n }\n}\nfunction isHotkeyEnabled(e, hotkey, enabled) {\n if (typeof enabled === 'function') {\n return enabled(e, hotkey);\n }\n return enabled === true || enabled === undefined;\n}\nfunction isKeyboardEventTriggeredByInput(ev) {\n return isHotkeyEnabledOnTag(ev, ['input', 'textarea', 'select']);\n}\nfunction isHotkeyEnabledOnTag(event, enabledOnTags) {\n if (enabledOnTags === void 0) {\n enabledOnTags = false;\n }\n var target = event.target,\n composed = event.composed;\n var targetTagName = null;\n if (isCustomElement(target) && composed) {\n targetTagName = event.composedPath()[0] && event.composedPath()[0].tagName;\n } else {\n targetTagName = target && target.tagName;\n }\n if (isReadonlyArray(enabledOnTags)) {\n return Boolean(targetTagName && enabledOnTags && enabledOnTags.some(function (tag) {\n var _targetTagName;\n return tag.toLowerCase() === ((_targetTagName = targetTagName) == null ? void 0 : _targetTagName.toLowerCase());\n }));\n }\n return Boolean(targetTagName && enabledOnTags && enabledOnTags);\n}\nfunction isCustomElement(element) {\n // We just do a basic check w/o any complex RegEx or validation against the list of legacy names containing a hyphen,\n // as none of them is likely to be an event target, and it won't hurt anyway if we miss.\n // see: https://html.spec.whatwg.org/multipage/custom-elements.html#prod-potentialcustomelementname\n return !!element.tagName && !element.tagName.startsWith(\"-\") && element.tagName.includes(\"-\");\n}\nfunction isScopeActive(activeScopes, scopes) {\n if (activeScopes.length === 0 && scopes) {\n console.warn('A hotkey has the \"scopes\" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>');\n return true;\n }\n if (!scopes) {\n return true;\n }\n return activeScopes.some(function (scope) {\n return scopes.includes(scope);\n }) || activeScopes.includes('*');\n}\nvar isHotkeyMatchingKeyboardEvent = function isHotkeyMatchingKeyboardEvent(e, hotkey, ignoreModifiers) {\n if (ignoreModifiers === void 0) {\n ignoreModifiers = false;\n }\n var alt = hotkey.alt,\n meta = hotkey.meta,\n mod = hotkey.mod,\n shift = hotkey.shift,\n ctrl = hotkey.ctrl,\n keys = hotkey.keys;\n var pressedKeyUppercase = e.key,\n code = e.code,\n ctrlKey = e.ctrlKey,\n metaKey = e.metaKey,\n shiftKey = e.shiftKey,\n altKey = e.altKey;\n var keyCode = mapKey(code);\n var pressedKey = pressedKeyUppercase.toLowerCase();\n if (!(keys != null && keys.includes(keyCode)) && !(keys != null && keys.includes(pressedKey)) && !['ctrl', 'control', 'unknown', 'meta', 'alt', 'shift', 'os'].includes(keyCode)) {\n return false;\n }\n if (!ignoreModifiers) {\n // We check the pressed keys for compatibility with the keyup event. In keyup events the modifier flags are not set.\n if (alt === !altKey && pressedKey !== 'alt') {\n return false;\n }\n if (shift === !shiftKey && pressedKey !== 'shift') {\n return false;\n }\n // Mod is a special key name that is checking for meta on macOS and ctrl on other platforms\n if (mod) {\n if (!metaKey && !ctrlKey) {\n return false;\n }\n } else {\n if (meta === !metaKey && pressedKey !== 'meta' && pressedKey !== 'os') {\n return false;\n }\n if (ctrl === !ctrlKey && pressedKey !== 'ctrl' && pressedKey !== 'control') {\n return false;\n }\n }\n }\n // All modifiers are correct, now check the key\n // If the key is set, we check for the key\n if (keys && keys.length === 1 && (keys.includes(pressedKey) || keys.includes(keyCode))) {\n return true;\n } else if (keys) {\n // Check if all keys are present in pressedDownKeys set\n return isHotkeyPressed(keys);\n } else if (!keys) {\n // If the key is not set, we only listen for modifiers, that check went alright, so we return true\n return true;\n }\n // There is nothing that matches.\n return false;\n};\n\nvar BoundHotkeysProxyProvider = /*#__PURE__*/createContext(undefined);\nvar useBoundHotkeysProxy = function useBoundHotkeysProxy() {\n return useContext(BoundHotkeysProxyProvider);\n};\nfunction BoundHotkeysProxyProviderProvider(_ref) {\n var addHotkey = _ref.addHotkey,\n removeHotkey = _ref.removeHotkey,\n children = _ref.children;\n return /*#__PURE__*/jsx(BoundHotkeysProxyProvider.Provider, {\n value: {\n addHotkey: addHotkey,\n removeHotkey: removeHotkey\n },\n children: children\n });\n}\n\nfunction deepEqual(x, y) {\n //@ts-ignore\n return x && y && typeof x === 'object' && typeof y === 'object' ? Object.keys(x).length === Object.keys(y).length &&\n //@ts-ignore\n Object.keys(x).reduce(function (isEqual, key) {\n return isEqual && deepEqual(x[key], y[key]);\n }, true) : x === y;\n}\n\nvar HotkeysContext = /*#__PURE__*/createContext({\n hotkeys: [],\n enabledScopes: [],\n toggleScope: function toggleScope() {},\n enableScope: function enableScope() {},\n disableScope: function disableScope() {}\n});\nvar useHotkeysContext = function useHotkeysContext() {\n return useContext(HotkeysContext);\n};\nvar HotkeysProvider = function HotkeysProvider(_ref) {\n var _ref$initiallyActiveS = _ref.initiallyActiveScopes,\n initiallyActiveScopes = _ref$initiallyActiveS === void 0 ? ['*'] : _ref$initiallyActiveS,\n children = _ref.children;\n var _useState = useState((initiallyActiveScopes == null ? void 0 : initiallyActiveScopes.length) > 0 ? initiallyActiveScopes : ['*']),\n internalActiveScopes = _useState[0],\n setInternalActiveScopes = _useState[1];\n var _useState2 = useState([]),\n boundHotkeys = _useState2[0],\n setBoundHotkeys = _useState2[1];\n var enableScope = useCallback(function (scope) {\n setInternalActiveScopes(function (prev) {\n if (prev.includes('*')) {\n return [scope];\n }\n return Array.from(new Set([].concat(prev, [scope])));\n });\n }, []);\n var disableScope = useCallback(function (scope) {\n setInternalActiveScopes(function (prev) {\n if (prev.filter(function (s) {\n return s !== scope;\n }).length === 0) {\n return ['*'];\n } else {\n return prev.filter(function (s) {\n return s !== scope;\n });\n }\n });\n }, []);\n var toggleScope = useCallback(function (scope) {\n setInternalActiveScopes(function (prev) {\n if (prev.includes(scope)) {\n if (prev.filter(function (s) {\n return s !== scope;\n }).length === 0) {\n return ['*'];\n } else {\n return prev.filter(function (s) {\n return s !== scope;\n });\n }\n } else {\n if (prev.includes('*')) {\n return [scope];\n }\n return Array.from(new Set([].concat(prev, [scope])));\n }\n });\n }, []);\n var addBoundHotkey = useCallback(function (hotkey) {\n setBoundHotkeys(function (prev) {\n return [].concat(prev, [hotkey]);\n });\n }, []);\n var removeBoundHotkey = useCallback(function (hotkey) {\n setBoundHotkeys(function (prev) {\n return prev.filter(function (h) {\n return !deepEqual(h, hotkey);\n });\n });\n }, []);\n return /*#__PURE__*/jsx(HotkeysContext.Provider, {\n value: {\n enabledScopes: internalActiveScopes,\n hotkeys: boundHotkeys,\n enableScope: enableScope,\n disableScope: disableScope,\n toggleScope: toggleScope\n },\n children: /*#__PURE__*/jsx(BoundHotkeysProxyProviderProvider, {\n addHotkey: addBoundHotkey,\n removeHotkey: removeBoundHotkey,\n children: children\n })\n });\n};\n\nfunction useDeepEqualMemo(value) {\n var ref = useRef(undefined);\n if (!deepEqual(ref.current, value)) {\n ref.current = value;\n }\n return ref.current;\n}\n\nvar stopPropagation = function stopPropagation(e) {\n e.stopPropagation();\n e.preventDefault();\n e.stopImmediatePropagation();\n};\nvar useSafeLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\nfunction useHotkeys(keys, callback, options, dependencies) {\n var _useState = useState(null),\n ref = _useState[0],\n setRef = _useState[1];\n var hasTriggeredRef = useRef(false);\n var _options = !(options instanceof Array) ? options : !(dependencies instanceof Array) ? dependencies : undefined;\n var _keys = isReadonlyArray(keys) ? keys.join(_options == null ? void 0 : _options.splitKey) : keys;\n var _deps = options instanceof Array ? options : dependencies instanceof Array ? dependencies : undefined;\n var memoisedCB = useCallback(callback, _deps != null ? _deps : []);\n var cbRef = useRef(memoisedCB);\n if (_deps) {\n cbRef.current = memoisedCB;\n } else {\n cbRef.current = callback;\n }\n var memoisedOptions = useDeepEqualMemo(_options);\n var _useHotkeysContext = useHotkeysContext(),\n enabledScopes = _useHotkeysContext.enabledScopes;\n var proxy = useBoundHotkeysProxy();\n useSafeLayoutEffect(function () {\n if ((memoisedOptions == null ? void 0 : memoisedOptions.enabled) === false || !isScopeActive(enabledScopes, memoisedOptions == null ? void 0 : memoisedOptions.scopes)) {\n return;\n }\n var listener = function listener(e, isKeyUp) {\n var _e$target;\n if (isKeyUp === void 0) {\n isKeyUp = false;\n }\n if (isKeyboardEventTriggeredByInput(e) && !isHotkeyEnabledOnTag(e, memoisedOptions == null ? void 0 : memoisedOptions.enableOnFormTags)) {\n return;\n }\n // TODO: SINCE THE EVENT IS NOW ATTACHED TO THE REF, THE ACTIVE ELEMENT CAN NEVER BE INSIDE THE REF. THE HOTKEY ONLY TRIGGERS IF THE\n // REF IS THE ACTIVE ELEMENT. THIS IS A PROBLEM SINCE FOCUSED SUB COMPONENTS WON'T TRIGGER THE HOTKEY.\n if (ref !== null) {\n var rootNode = ref.getRootNode();\n if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement !== ref && !ref.contains(rootNode.activeElement)) {\n stopPropagation(e);\n return;\n }\n }\n if ((_e$target = e.target) != null && _e$target.isContentEditable && !(memoisedOptions != null && memoisedOptions.enableOnContentEditable)) {\n return;\n }\n parseKeysHookInput(_keys, memoisedOptions == null ? void 0 : memoisedOptions.splitKey).forEach(function (key) {\n var _hotkey$keys;\n var hotkey = parseHotkey(key, memoisedOptions == null ? void 0 : memoisedOptions.combinationKey);\n if (isHotkeyMatchingKeyboardEvent(e, hotkey, memoisedOptions == null ? void 0 : memoisedOptions.ignoreModifiers) || (_hotkey$keys = hotkey.keys) != null && _hotkey$keys.includes('*')) {\n if (memoisedOptions != null && memoisedOptions.ignoreEventWhen != null && memoisedOptions.ignoreEventWhen(e)) {\n return;\n }\n if (isKeyUp && hasTriggeredRef.current) {\n return;\n }\n maybePreventDefault(e, hotkey, memoisedOptions == null ? void 0 : memoisedOptions.preventDefault);\n if (!isHotkeyEnabled(e, hotkey, memoisedOptions == null ? void 0 : memoisedOptions.enabled)) {\n stopPropagation(e);\n return;\n }\n // Execute the user callback for that hotkey\n cbRef.current(e, hotkey);\n if (!isKeyUp) {\n hasTriggeredRef.current = true;\n }\n }\n });\n };\n var handleKeyDown = function handleKeyDown(event) {\n if (event.key === undefined) {\n // Synthetic event (e.g., Chrome autofill). Ignore.\n return;\n }\n pushToCurrentlyPressedKeys(mapKey(event.code));\n if ((memoisedOptions == null ? void 0 : memoisedOptions.keydown) === undefined && (memoisedOptions == null ? void 0 : memoisedOptions.keyup) !== true || memoisedOptions != null && memoisedOptions.keydown) {\n listener(event);\n }\n };\n var handleKeyUp = function handleKeyUp(event) {\n if (event.key === undefined) {\n // Synthetic event (e.g., Chrome autofill). Ignore.\n return;\n }\n removeFromCurrentlyPressedKeys(mapKey(event.code));\n hasTriggeredRef.current = false;\n if (memoisedOptions != null && memoisedOptions.keyup) {\n listener(event, true);\n }\n };\n var domNode = ref || (_options == null ? void 0 : _options.document) || document;\n // @ts-ignore\n domNode.addEventListener('keyup', handleKeyUp, _options == null ? void 0 : _options.eventListenerOptions);\n // @ts-ignore\n domNode.addEventListener('keydown', handleKeyDown, _options == null ? void 0 : _options.eventListenerOptions);\n if (proxy) {\n parseKeysHookInput(_keys, memoisedOptions == null ? void 0 : memoisedOptions.splitKey).forEach(function (key) {\n return proxy.addHotkey(parseHotkey(key, memoisedOptions == null ? void 0 : memoisedOptions.combinationKey, memoisedOptions == null ? void 0 : memoisedOptions.description));\n });\n }\n return function () {\n // @ts-ignore\n domNode.removeEventListener('keyup', handleKeyUp, _options == null ? void 0 : _options.eventListenerOptions);\n // @ts-ignore\n domNode.removeEventListener('keydown', handleKeyDown, _options == null ? void 0 : _options.eventListenerOptions);\n if (proxy) {\n parseKeysHookInput(_keys, memoisedOptions == null ? void 0 : memoisedOptions.splitKey).forEach(function (key) {\n return proxy.removeHotkey(parseHotkey(key, memoisedOptions == null ? void 0 : memoisedOptions.combinationKey, memoisedOptions == null ? void 0 : memoisedOptions.description));\n });\n }\n };\n }, [ref, _keys, memoisedOptions, enabledScopes]);\n return setRef;\n}\n\nfunction useRecordHotkeys() {\n var _useState = useState(new Set()),\n keys = _useState[0],\n setKeys = _useState[1];\n var _useState2 = useState(false),\n isRecording = _useState2[0],\n setIsRecording = _useState2[1];\n var handler = useCallback(function (event) {\n if (event.key === undefined) {\n // Synthetic event (e.g., Chrome autofill). Ignore.\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n setKeys(function (prev) {\n var newKeys = new Set(prev);\n newKeys.add(mapKey(event.code));\n return newKeys;\n });\n }, []);\n var stop = useCallback(function () {\n if (typeof document !== 'undefined') {\n document.removeEventListener('keydown', handler);\n setIsRecording(false);\n }\n }, [handler]);\n var start = useCallback(function () {\n setKeys(new Set());\n if (typeof document !== 'undefined') {\n stop();\n document.addEventListener('keydown', handler);\n setIsRecording(true);\n }\n }, [handler, stop]);\n var resetKeys = useCallback(function () {\n setKeys(new Set());\n }, []);\n return [keys, {\n start: start,\n stop: stop,\n resetKeys: resetKeys,\n isRecording: isRecording\n }];\n}\n\nexport { HotkeysProvider, isHotkeyPressed, useHotkeys, useHotkeysContext, useRecordHotkeys };\n//# sourceMappingURL=react-hotkeys-hook.esm.js.map\n","import { useHotkeys } from 'react-hotkeys-hook';\n\nexport interface UseUndoRedoShortcutsProps {\n undo: () => void;\n redo: () => void;\n canUndo: boolean;\n canRedo: boolean;\n}\n\nexport const useUndoRedoShortcuts = (props: UseUndoRedoShortcutsProps) => {\n const { undo, redo, canRedo, canUndo } = props;\n const isMac = window.navigator.userAgent.includes('Mac');\n\n let undoShortcut = 'ctrl+z';\n let redoShortcut = 'ctrl+y';\n\n if (isMac) {\n undoShortcut = 'mod+z';\n redoShortcut = 'mod+shift+z';\n }\n\n // set handler for undo\n useHotkeys(\n undoShortcut,\n event => {\n event.preventDefault();\n if (canUndo) {\n undo();\n }\n },\n {},\n [canUndo, undo],\n );\n\n // set handler for redo\n useHotkeys(\n redoShortcut,\n event => {\n event.preventDefault();\n if (canRedo) {\n redo();\n }\n },\n {},\n [canRedo, redo],\n );\n};\n","import connectConfig from '#connect-config';\nimport { useShowAddDriveModal } from '#hooks';\nimport {\n HomeScreen,\n HomeScreenAddDriveItem,\n HomeScreenItem,\n} from '@powerhousedao/design-system';\nimport {\n setSelectedDrive,\n useDrives,\n useSelectedDocument,\n useSelectedDrive,\n useSelectedFolder,\n} from '@powerhousedao/reactor-browser';\nimport { DocumentEditorContainer } from '../components/document-editor-container.js';\nimport { DriveEditorContainer } from '../components/drive-editor-container.js';\nimport { DriveIcon } from '../components/drive-icon.js';\nexport default function Content() {\n const [selectedDrive] = useSelectedDrive();\n const selectedFolder = useSelectedFolder();\n const [selectedDocument] = useSelectedDocument();\n return (\n <ContentContainer>\n {selectedDocument && <DocumentEditorContainer />}\n {(!!selectedDrive || !!selectedFolder) && !selectedDocument && (\n <DriveEditorContainer />\n )}\n {!selectedDocument && !selectedDrive && <HomeScreenContainer />}\n </ContentContainer>\n );\n}\n\nfunction ContentContainer({ children }: { children: React.ReactNode }) {\n return (\n <div className=\"flex h-full flex-col overflow-auto\" id=\"content-view\">\n {children}\n </div>\n );\n}\n\nfunction HomeScreenContainer() {\n const drives = useDrives();\n const showAddDriveModal = useShowAddDriveModal();\n const config = connectConfig;\n\n return (\n <HomeScreen>\n {drives?.map(drive => {\n return (\n <HomeScreenItem\n key={drive.header.id}\n title={drive.state.global.name}\n description={'Drive Explorer App'}\n icon={<DriveIcon drive={drive} />}\n onClick={() => setSelectedDrive(drive)}\n />\n );\n })}\n {config.drives.addDriveEnabled && (\n <HomeScreenAddDriveItem onClick={showAddDriveModal} />\n )}\n </HomeScreen>\n );\n}\n"],"names":["PaginationButton","active","props","className","twMerge","_jsx","Button","mergeClassNameProps","Pagination","pages","goToFirstPage","goToLastPage","goToNextPage","goToPreviousPage","goToPage","isNextPageAvailable","isPreviousPageAvailable","hiddenNextPages","firstPageLabel","lastPageLabel","nextPageLabel","previousPageLabel","_jsxs","Icon","page","usePagination","items","options","itemsPerPage","initialPage","pageRange","currentPage","setCurrentPage","useState","pageCount","useCallback","prev","pageOffset","availableRange","maxStartIndex","startIndex","useMemo","range","i","pageItems","millisecondsInWeek","millisecondsInDay","millisecondsInMinute","millisecondsInHour","minutesInMonth","minutesInDay","constructFromSymbol","constructFrom","date","value","toDate","argument","context","defaultOptions","getDefaultOptions","startOfWeek","weekStartsOn","_b","_a","_d","_c","_date","day","diff","startOfISOWeek","getISOWeekYear","year","fourthOfJanuaryOfNextYear","startOfNextYear","fourthOfJanuaryOfThisYear","startOfThisYear","getTimezoneOffsetInMilliseconds","utcDate","normalizeDates","dates","normalize","startOfDay","differenceInCalendarDays","laterDate","earlierDate","laterDate_","earlierDate_","laterStartOfDay","earlierStartOfDay","laterTimestamp","earlierTimestamp","startOfISOWeekYear","fourthOfJanuary","compareAsc","dateLeft","dateRight","constructNow","isDate","isValid","differenceInCalendarMonths","yearsDiff","monthsDiff","getRoundingMethod","method","number","result","differenceInMilliseconds","endOfDay","endOfMonth","month","isLastDayOfMonth","differenceInMonths","workingLaterDate","sign","difference","isLastMonthNotFull","differenceInSeconds","startOfYear","date_","formatDistanceLocale","formatDistance","token","count","tokenValue","buildFormatLongFn","args","width","dateFormats","timeFormats","dateTimeFormats","formatLong","formatRelativeLocale","formatRelative","_baseDate","_options","buildLocalizeFn","valuesArray","defaultWidth","index","eraValues","quarterValues","monthValues","dayValues","dayPeriodValues","formattingDayPeriodValues","ordinalNumber","dirtyNumber","rem100","localize","quarter","buildMatchFn","string","matchPattern","matchResult","matchedString","parsePatterns","key","findIndex","pattern","findKey","rest","object","predicate","array","buildMatchPatternFn","parseResult","matchOrdinalNumberPattern","parseOrdinalNumberPattern","matchEraPatterns","parseEraPatterns","matchQuarterPatterns","parseQuarterPatterns","matchMonthPatterns","parseMonthPatterns","matchDayPatterns","parseDayPatterns","matchDayPeriodPatterns","parseDayPeriodPatterns","match","enUS","getDayOfYear","getISOWeek","getWeekYear","firstWeekContainsDate","firstWeekOfNextYear","firstWeekOfThisYear","startOfWeekYear","firstWeek","getWeek","addLeadingZeros","targetLength","output","lightFormatters","signedYear","dayPeriodEnumValue","numberOfDigits","milliseconds","fractionalSeconds","dayPeriodEnum","formatters","era","signedWeekYear","weekYear","twoDigitYear","isoWeekYear","week","isoWeek","dayOfYear","dayOfWeek","localDayOfWeek","isoDayOfWeek","hours","_localize","timezoneOffset","formatTimezoneWithOptionalMinutes","formatTimezone","formatTimezoneShort","timestamp","offset","delimiter","absOffset","minutes","dateLongFormatter","timeLongFormatter","dateTimeLongFormatter","datePattern","timePattern","dateTimeFormat","longFormatters","dayOfYearTokenRE","weekYearTokenRE","throwTokens","isProtectedDayOfYearToken","isProtectedWeekYearToken","warnOrThrowProtectedError","format","input","_message","message","subject","formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","formatStr","locale","defaultLocale","originalDate","parts","substring","firstCharacter","longFormatter","cleanEscapedString","formatterOptions","part","formatter","matched","minutesInAlmostTwoDays","comparison","localizeOptions","seconds","offsetInSeconds","months","days","nearestMonth","monthsSinceStartOfYear","years","formatDistanceToNow","parseISO","invalidDate","dateStrings","splitDateString","parseYearResult","parseYear","parseDate","time","parseTime","parseTimezone","tmpDate","patterns","dateRegex","timeRegex","timezoneRegex","dateString","timeString","additionalDigits","regex","captures","century","isWeekDate","parseDateUnit","validateWeekDate","dayOfISOWeekYear","validateDate","validateDayOfYearDate","parseTimeUnit","validateTime","timezoneString","validateTimezone","fourthOfJanuaryDay","daysInMonths","isLeapYearIndex","_year","_hours","LZString","f","keyStrBase64","keyStrUriSafe","baseReverseDic","getBaseValue","alphabet","character","res","a","compressed","uncompressed","buf","TotalLen","current_value","c","bitsPerChar","getCharFromInt","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data","context_data_val","context_data_position","ii","length","resetValue","getNextValue","dictionary","enlargeIn","dictSize","numBits","entry","w","bits","resb","maxpower","power","data","module","DefaultEditorLoader","divProps","AnimatedLoader","HDivider","title","subtitle","onClick","isSelected","open","setOpen","hasContent","useEffect","formatTimestamp","isoString","tooltipContent","Tooltip","getBarHeight","size","TimelineBar","additions","deletions","addSize","delSize","noChanges","addBarHeight","delBarHeight","defaultTimeLineItem","DocumentTimeline","timeline","onItemClick","selectedItem","setSelectedItem","scrollContainerRef","useRef","handleClick","item","mergedTimelineItems","unselectedItems","selectedItems","indexSelected","renderTimelineItems","timestampUtcMs","unselectedContent","selectedContent","TooltipProvider","DocumentToolbar","undo","canUndo","redo","canRedo","onClose","onExport","onShowRevisionHistory","onSwitchboardLinkClick","timelineItems","onTimelineItemClick","initialTimelineVisible","timelineButtonVisible","showTimeline","setShowTimeline","isUndoDisabled","isRedoDisabled","isExportDisabled","isSwitchboardLinkDisabled","isRevisionHistoryDisabled","isTimelineDisabled","handleTimelineToggle","HomeScreenItem","icon","description","containerClassName","shareable","HomeScreenAddDriveItem","Branch","branch","DocId","docId","copy","useCopyToClipboard","handleCopy","text","error","Scope","onChange","Select","Header","scope","onChangeScope","Address","address","chainId","shortenedAddress","formatEthAddress","ENSAvatar","Errors","errors","hasErrors","color","content","Operation","operationType","operationInput","RevisionNumber","operationIndex","eventId","stateHash","revisionNumber","Signature","signatures","signature","VerificationStatus","signatureCount","verifiedSignaturesCount","verificationStatusText","Timestamp","timestampNumber","shortDate","longDate","_Revision","Revision","memo","Skip","skipCount","skippedRevisions","makeRows","operations","revisionsAndSkips","seenDays","operation","_f","_e","makeSignatures","_i","_h","_g","makeSignatureFromSignatureArray","signatureArray","signerAddress","hash","prevStateHash","signatureBytes","signaturesArray","Day","formattedDate","Timeline","localOperations","globalOperations","initialNumRowsToShow","allRows","scrollAmount","setScrollAmount","numRowsToShow","setNumRowsToShow","rows","setRows","parentRef","hasNextPage","rowVirtualizer","useVirtualizer","ratio","newNumRevisions","handleScroll","e","n","virtualRow","row","_createElement","RevisionHistory","documentTitle","documentId","setScope","visibleOperations","garbageCollect","sortOperations","b","PaginationComponent","children","defaultOpen","onOpenChange","side","sideOffset","delayDuration","Root","Trigger","Portal","Content","Provider","getSlugFromDriveUrl","driveUrl","getDocumentGraphqlQuery","documentModel","buildDocumentSubgraphQuery","authToken","driveSlug","query","variables","queryData","compressToEncodedURIComponent","buildDocumentSubgraphUrl","encodedQuery","openBrowserUrl","url","openUrl","validateDocument","document","doc","specs","initialStateErrors","acc","scopeKey","validateInitialState","err","schemaStateErrors","isGlobalScope","validateStateSchemaName","modulesErrors","validateModules","useAnalyticsQueryWrapper","queryFn","queryOptions","store","useAnalyticsStoreAsync","engine","useAnalyticsEngineAsync","enabled","useQuery","DEBOUNCE_INTERVAL","useAnalyticsQuery","queryClient","useQueryClient","sources","subscriptions","invalidateTimeout","debouncedInvalidate","path","unsub","getBarSize","addItemsDividers","currentDate","nextDate","currentHour","nextHour","currentDay","nextDay","metricsToItems","metrics","aDate","bDate","startDate","useTimelineItems","startTimestamp","driveId","start","DateTime","AnalyticsGranularity","AnalyticsPath","getRevisionFromDate","endDate","operationDate","EditorLoader","showLoading","setShowLoading","customEditorLoader","defaultProps","jsx","Fragment","EditorError","FallbackEditorError","DocumentEditor","initialDocument","onOpenSwitchboardLink","selectedTimelineItem","setSelectedTimelineItem","revisionHistoryVisible","setRevisionHistoryVisible","dispatch","useDocumentById","documentName","documentType","preferredEditor","createdAt","globalRevisionNumber","localRevisionNumber","documentModelModule","useDocumentModelModuleById","preferredEditorModule","useEditorModuleById","fallbackEditorModule","useFallbackEditorModule","editorModule","userPermissions","useUserPermissions","isLoadingEditor","addUndoAction","addRedoAction","useUndoRedoShortcuts","navigate","useNavigate","showModal","useModal","editorError","setEditorError","handleEditorError","info","jsxs","EditorComponent","disableExternalControls","documentToolbarEnabled","showSwitchboardLink","timelineEnabled","handleSwitchboardLinkClick","Suspense","ErrorBoundary","DocumentEditorContainer","t","useTranslation","selectedDrive","useSelectedDrive","selectedDocument","useSelectedDocument","parentFolder","useParentFolder","isRemoteDrive","useDriveIsRemote","remoteUrl","useDriveRemoteUrl","connectCrypto","useConnectCrypto","user","useUser","exportDocument","validationErrors","closeModal","exportFile","setSelectedNode","DriveEditorError","DriveEditorContainer","nodeActions","useNodeActions","showCreateDocumentModal","showDeleteNodeModal","useShowDeleteNodeModal","driveEditor","useDriveEditorModuleById","defaultDriveEditor","useDefaultDriveEditorModule","DriveEditorComponent","GenericDriveExplorer","resolveNode","node","selectedFolder","useSelectedFolder","selectedParentFolder","useSelectedParentFolder","selectedDriveId","onAddFile","file","parent","fileName","addFile","onAddFolder","name","addFolder","onRenameNode","newName","renameNode","onCopyNode","src","target","resolvedSrc","resolvedTarget","copyNode","onMoveNode","moveNode","onDuplicateNode","onAddAndSelectNewFolder","newFolder","_extends","reservedModifierKeywords","mappedKeys","mapKey","isHotkeyModifier","parseKeysHookInput","keys","splitKey","parseHotkey","hotkey","combinationKey","k","modifiers","singleCharKeys","pushToCurrentlyPressedKeys","removeFromCurrentlyPressedKeys","currentlyPressedKeys","isReadonlyArray","isHotkeyPressed","hotkeyArray","maybePreventDefault","preventDefault","isHotkeyEnabled","isKeyboardEventTriggeredByInput","ev","isHotkeyEnabledOnTag","event","enabledOnTags","composed","targetTagName","isCustomElement","tag","_targetTagName","element","isScopeActive","activeScopes","scopes","isHotkeyMatchingKeyboardEvent","ignoreModifiers","alt","meta","mod","shift","ctrl","pressedKeyUppercase","code","ctrlKey","metaKey","shiftKey","altKey","keyCode","pressedKey","BoundHotkeysProxyProvider","createContext","useBoundHotkeysProxy","useContext","deepEqual","x","y","isEqual","HotkeysContext","useHotkeysContext","useDeepEqualMemo","ref","stopPropagation","useSafeLayoutEffect","useLayoutEffect","useHotkeys","callback","dependencies","_useState","setRef","hasTriggeredRef","_keys","_deps","memoisedCB","cbRef","memoisedOptions","_useHotkeysContext","enabledScopes","proxy","listener","isKeyUp","_e$target","rootNode","_hotkey$keys","handleKeyDown","handleKeyUp","domNode","isMac","undoShortcut","redoShortcut","ContentContainer","HomeScreenContainer","drives","useDrives","showAddDriveModal","useShowAddDriveModal","config","connectConfig","HomeScreen","drive","DriveIcon","setSelectedDrive"],"mappings":"25CAGO,MAAMA,EAAmB,CAAC,CAAE,OAAAC,EAAS,GAAO,GAAGC,CAAK,IAAO,CAC9D,MAAMC,EAAYC,EAAQ,6GAA8G,CAACH,GAAU,UAAU,EAC7J,OAAQI,EAAKC,EAAQ,CAAE,MAAO,QAAS,KAAM,QAAS,GAAGC,GAAoBL,EAAOC,CAAS,EAAG,SAAUD,EAAM,QAAQ,CAAE,CAC9H,ECHaM,GAAcN,GAAU,CACjC,KAA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AAA,EAE5D,CAER","x_google_ignoreList":[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,89]}
|