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../core/src/modules/explorer/views/sections/tags/empty.tsx","webpack://@affine/web/../core/src/modules/explorer/views/sections/tags/index.tsx","webpack://@affine/web/../core/src/modules/explorer/views/sections/tags/styles.css.ts","webpack://@affine/web/../core/src/components/root-app-sidebar/import-page.tsx","webpack://@affine/web/../core/src/components/root-app-sidebar/index.css.ts","webpack://@affine/web/../core/src/components/root-app-sidebar/journal-button.tsx","webpack://@affine/web/../core/src/components/root-app-sidebar/trash-button.tsx","webpack://@affine/web/../core/src/components/root-app-sidebar/unknow-user.tsx","webpack://@affine/web/../core/src/components/root-app-sidebar/user-info.tsx","webpack://@affine/web/../core/src/components/root-app-sidebar/index.tsx","webpack://@affine/web/../core/src/components/workspace-upgrade/upgrade-icon.tsx","webpack://@affine/web/../core/src/components/workspace-upgrade/upgrade.tsx","webpack://@affine/web/../core/src/components/workspace-upgrade/upgrade.css.ts","webpack://@affine/web/../core/src/modules/app-tabs-header/services/app-tabs-header-service.ts","webpack://@affine/web/../core/src/components/pure/header/windows-app-controls.tsx","webpack://@affine/web/../core/src/modules/workbench/constants.tsx","webpack://@affine/web/../core/src/modules/app-tabs-header/views/app-tabs-header.tsx","webpack://@affine/web/../core/src/modules/app-tabs-header/views/styles.css.ts","webpack://@affine/web/../core/src/providers/swr-config-provider.tsx","webpack://@affine/web/../core/src/layouts/workspace-layout.tsx","webpack://@affine/web/../core/src/hooks/use-register-workspace-commands.ts","webpack://@affine/web/../core/src/modules/navigation/view/use-register-navigation-commands.ts","webpack://@affine/web/../core/src/hooks/affine/use-register-find-in-page-commands.ts","webpack://@affine/web/../core/src/layouts/styles.css.ts","webpack://@affine/web/../core/src/pages/workspace/index.tsx"],"sourcesContent":["import { useLiveData, useService, WorkspaceService } from '@toeverything/infra';\nimport { useEffect } from 'react';\n\nimport { AuthService } from '../../../modules/cloud';\n\nconst SyncAwarenessInnerLoggedIn = () => {\n const authService = useService(AuthService);\n const account = useLiveData(authService.session.account$);\n const currentWorkspace = useService(WorkspaceService).workspace;\n\n useEffect(() => {\n if (account && currentWorkspace) {\n currentWorkspace.docCollection.awarenessStore.awareness.setLocalStateField(\n 'user',\n {\n name: account.label,\n // TODO(@eyhn): add avatar?\n }\n );\n\n return () => {\n currentWorkspace.docCollection.awarenessStore.awareness.setLocalStateField(\n 'user',\n null\n );\n };\n }\n return;\n }, [currentWorkspace, account]);\n\n return null;\n};\n\nconst SyncAwarenessInner = () => {\n const session = useService(AuthService).session;\n const loginStatus = useLiveData(session.status$);\n\n if (loginStatus === 'authenticated') {\n return ;\n }\n\n return null;\n};\n\n// TODO(@eyhn): we could do something more interesting here, e.g., show where the current user is\nexport const SyncAwareness = () => {\n return ;\n};\n","import { useI18n } from '@affine/i18n';\nimport { TagIcon } from '@blocksuite/icons/rc';\n\nimport { ExplorerEmptySection } from '../../layouts/empty-section';\n\nexport const RootEmpty = () => {\n const t = useI18n();\n\n return (\n \n );\n};\n","import { IconButton } from '@affine/component';\nimport { track } from '@affine/core/mixpanel';\nimport { ExplorerTreeRoot } from '@affine/core/modules/explorer/views/tree';\nimport type { Tag } from '@affine/core/modules/tag';\nimport { TagService } from '@affine/core/modules/tag';\nimport { useI18n } from '@affine/i18n';\nimport { PlusIcon } from '@blocksuite/icons/rc';\nimport { useLiveData, useServices } from '@toeverything/infra';\nimport { useCallback, useEffect, useState } from 'react';\n\nimport { ExplorerService } from '../../../services/explorer';\nimport { CollapsibleSection } from '../../layouts/collapsible-section';\nimport { ExplorerTagNode } from '../../nodes/tag';\nimport { RootEmpty } from './empty';\nimport * as styles from './styles.css';\n\nexport const ExplorerTags = () => {\n const { tagService, explorerService } = useServices({\n TagService,\n ExplorerService,\n });\n const explorerSection = explorerService.sections.tags;\n const collapsed = useLiveData(explorerSection.collapsed$);\n const [createdTag, setCreatedTag] = useState(null);\n const tags = useLiveData(tagService.tagList.tags$);\n\n const t = useI18n();\n\n const handleCreateNewFavoriteDoc = useCallback(() => {\n const newTags = tagService.tagList.createTag(\n t['com.arms.rootAppSidebar.tags.new-tag'](),\n tagService.randomTagColor()\n );\n setCreatedTag(newTags);\n track.$.navigationPanel.organize.createOrganizeItem({ type: 'tag' });\n explorerSection.setCollapsed(false);\n }, [explorerSection, t, tagService]);\n\n useEffect(() => {\n if (collapsed) setCreatedTag(null); // reset created tag to clear the renaming state\n }, [collapsed]);\n\n return (\n \n \n \n }\n >\n }>\n {tags.map(tag => (\n \n ))}\n \n \n );\n};\n","import \"../core/src/modules/explorer/views/sections/tags/styles.css.ts.vanilla.css!=!../../../../../../../../../node_modules/@vanilla-extract/webpack-plugin/virtualFileLoader/dist/vanilla-extract-webpack-plugin-virtualFileLoader.cjs.js?{\\\"fileName\\\":\\\"../core/src/modules/explorer/views/sections/tags/styles.css.ts.vanilla.css\\\",\\\"source\\\":\\\"LnJoejdsaDBbZGF0YS1kcmFnZ2VkLW92ZXI9InRydWUiXSB7CiAgYmFja2dyb3VuZDogdmFyKC0tYWZmaW5lLWhvdmVyLWNvbG9yKTsKICBib3JkZXItcmFkaXVzOiA0cHg7Cn0=\\\"}!../../../../../../../../../node_modules/@vanilla-extract/webpack-plugin/extracted.js\"\nexport var draggedOverHighlight = 'rhz7lh0';","import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';\nimport { track } from '@affine/core/mixpanel';\nimport { useI18n } from '@affine/i18n';\nimport { ImportIcon } from '@blocksuite/icons/rc';\n\nimport type { DocCollection } from '../../shared';\nimport { MenuItem } from '../app-sidebar';\nimport { usePageHelper } from '../blocksuite/block-suite-page-list/utils';\n\nconst ImportPage = ({ docCollection }: { docCollection: DocCollection }) => {\n const t = useI18n();\n const { importFile } = usePageHelper(docCollection);\n\n const onImportFile = useAsyncCallback(async () => {\n const options = await importFile();\n track.$.navigationPanel.workspaceList[\n options.isWorkspaceFile ? 'createWorkspace' : 'createDoc'\n ]({\n control: 'import',\n });\n }, [importFile]);\n\n return (\n } onClick={onImportFile}>\n {t['Import']()}\n \n );\n};\n\nexport default ImportPage;\n","import \"../core/src/components/root-app-sidebar/index.css.ts.vanilla.css!=!../../../../../../node_modules/@vanilla-extract/webpack-plugin/virtualFileLoader/dist/vanilla-extract-webpack-plugin-virtualFileLoader.cjs.js?{\\\"fileName\\\":\\\"../core/src/components/root-app-sidebar/index.css.ts.vanilla.css\\\",\\\"source\\\":\\\"#H4sIAAAAAAAAA51Ty27bMBC8+yvYAAXiAw3ZlVObBvojRQ6UuJI2kUiCXPnRIv9eiJQfktU06cUylsPZmd3hoky32022ZL9njCn0tpYnwYoajrsZY7LGUnMkaLxgOWgC15VfWk9YnHhuNIEmwbyVOfAM6ACgO0QprWAbe9zN3maL2GL1qRYTBN8CwQEVVYIlHajjEGx5g0k/gFlPC+m+XKGDnNBowXJTt83VTDrQsmY/mMK90IYefypJkivcowL3PA/sjXQlap4ZItMIlrAv2FjjSGraXY/J2PHZpcPT/6tkLDNOgeNOKmz9WPv3wGylUqhLwZareCdvnTdOMGswLuF6ITq0zjzfX40/5z83tzZDbHqP2AZEYTTxA2BZkWBpEpZWowZe9bVVEgUGoMdfINheukfOZVF0uFA/+nkwYerOw+Cc4EjcQ260kq4LbW1cAN8N99+5nkzrxZAMhv6qwTpshgr6HLhoNFmsobmhywLdeQzLZHK361g1e3BFbQ6CVahUFGuNx5gSB7Uk3EPoiZr3D2T1lAwWkgmRQWEc9D76KTw8DNlk5k3dUmBD7YH6p5bJ/LV0ptWKT80gq2X+GmwbK3OkU+c4SW/65yPDydcJw6grcEjvNYxsyfyGWg2oz5G6pDOxx/feziil65jSjwRyMslT07GtA36okGA+tDbGjUL09geYXmjMwgUAAA==\\\"}!../../../../../../node_modules/@vanilla-extract/webpack-plugin/extracted.js\"\nexport var aiUsageBlock = 'g4998b7';\nexport var cloudUsageBar = 'g4998bb';\nexport var cloudUsageBarInner = 'g4998bc';\nexport var cloudUsageBlock = 'g4998b8';\nexport var freeTag = 'g4998bd';\nexport var operationMenu = 'g4998b5';\nexport var progressColorVar = 'var(--g4998b0)';\nexport var quickSearch = 'g4998b3';\nexport var quickSearchAndNewPage = 'g4998b2';\nexport var usageBlock = 'g4998b6';\nexport var usageLabel = 'g4998b9';\nexport var usageLabelTitle = 'g4998ba';\nexport var workspaceAndUserWrapper = 'g4998b1';\nexport var workspaceWrapper = 'g4998b4';","import { useCatchEventCallback } from '@affine/core/hooks/use-catch-event-hook';\nimport {\n useJournalInfoHelper,\n useJournalRouteHelper,\n} from '@affine/core/hooks/use-journal';\nimport { WorkbenchService } from '@affine/core/modules/workbench';\nimport type { DocCollection } from '@affine/core/shared';\nimport { isNewTabTrigger } from '@affine/core/utils';\nimport { useI18n } from '@affine/i18n';\nimport { TodayIcon, TomorrowIcon, YesterdayIcon } from '@blocksuite/icons/rc';\nimport { useLiveData, useService } from '@toeverything/infra';\nimport { type MouseEvent } from 'react';\n\nimport { MenuItem } from '../app-sidebar';\n\ninterface AppSidebarJournalButtonProps {\n docCollection: DocCollection;\n}\n\nexport const AppSidebarJournalButton = ({\n docCollection,\n}: AppSidebarJournalButtonProps) => {\n const t = useI18n();\n const workbench = useService(WorkbenchService).workbench;\n const location = useLiveData(workbench.location$);\n const { openToday } = useJournalRouteHelper(docCollection);\n const { journalDate, isJournal } = useJournalInfoHelper(\n docCollection,\n location.pathname.split('/')[1]\n );\n\n const handleOpenToday = useCatchEventCallback(\n (e: MouseEvent) => {\n openToday(isNewTabTrigger(e));\n },\n [openToday]\n );\n\n const Icon =\n isJournal && journalDate\n ? journalDate.isBefore(new Date(), 'day')\n ? YesterdayIcon\n : journalDate.isAfter(new Date(), 'day')\n ? TomorrowIcon\n : TodayIcon\n : TodayIcon;\n\n return (\n }\n >\n {t['com.arms.journal.app-sidebar-title']()}\n \n );\n};\n","import {\n AnimatedDeleteIcon,\n useConfirmModal,\n useDropTarget,\n} from '@affine/component';\nimport type { AffineDNDData } from '@affine/core/types/dnd';\nimport { useI18n } from '@affine/i18n';\nimport {\n DocsService,\n GlobalContextService,\n useLiveData,\n useService,\n} from '@toeverything/infra';\n\nimport { MenuLinkItem } from '../app-sidebar';\n\nexport const TrashButton = () => {\n const t = useI18n();\n const docsService = useService(DocsService);\n const { openConfirmModal } = useConfirmModal();\n const globalContextService = useService(GlobalContextService);\n const trashActive = useLiveData(globalContextService.globalContext.isTrash.$);\n\n const { dropTargetRef, draggedOver } = useDropTarget(\n () => ({\n data: {\n at: 'app-sidebar:trash',\n },\n canDrop(data) {\n return data.source.data.entity?.type === 'doc';\n },\n onDrop(data) {\n if (data.source.data.entity?.type === 'doc') {\n const docId = data.source.data.entity.id;\n const docRecord = docsService.list.doc$(docId).value;\n if (docRecord) {\n openConfirmModal({\n title: t['com.arms.moveToTrash.confirmModal.title'](),\n description: t['com.arms.moveToTrash.confirmModal.description']({\n title: docRecord.title$.value || t['Untitled'](),\n }),\n confirmText: t.Delete(),\n confirmButtonOptions: {\n variant: 'error',\n },\n onConfirm() {\n docRecord.moveToTrash();\n },\n });\n }\n }\n },\n }),\n [docsService.list, openConfirmModal, t]\n );\n\n return (\n }\n active={trashActive || draggedOver}\n to={'/trash'}\n >\n \n {t['com.arms.workspaceSubPath.trash']()}\n \n \n );\n};\n","import { memo } from 'react';\n\nexport const UnknownUserIcon = memo(\n ({ width = 20, height = 20 }: { width?: number; height?: number }) => {\n const svgRaw = `\n \n \n \n \n \n \n \n \n \n \n`;\n\n return (\n \n );\n }\n);\nUnknownUserIcon.displayName = 'UnknownUserIcon';\n","import {\n Avatar,\n Divider,\n ErrorMessage,\n IconButton,\n Menu,\n MenuIcon,\n MenuItem,\n type MenuProps,\n Skeleton,\n} from '@affine/component';\nimport {\n authAtom,\n openSettingModalAtom,\n openSignOutModalAtom,\n} from '@affine/core/atoms';\nimport { track } from '@affine/core/mixpanel';\nimport { useI18n } from '@affine/i18n';\nimport { AccountIcon, SignOutIcon } from '@blocksuite/icons/rc';\nimport { useLiveData, useService } from '@toeverything/infra';\nimport { cssVar } from '@toeverything/theme';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport clsx from 'clsx';\nimport { useSetAtom } from 'jotai';\nimport { useCallback, useEffect } from 'react';\n\nimport {\n type AuthAccountInfo,\n AuthService,\n ServerConfigService,\n SubscriptionService,\n UserCopilotQuotaService,\n UserQuotaService,\n} from '../../modules/cloud';\nimport { UserPlanButton } from '../affine/auth/user-plan-button';\nimport * as styles from './index.css';\nimport { UnknownUserIcon } from './unknow-user';\n\nexport const UserInfo = () => {\n const session = useService(AuthService).session;\n const account = useLiveData(session.account$);\n return account ? (\n \n ) : (\n \n );\n};\n\nconst menuContentOptions: MenuProps['contentOptions'] = {\n className: styles.operationMenu,\n};\nconst AuthorizedUserInfo = ({ account }: { account: AuthAccountInfo }) => {\n return (\n } contentOptions={menuContentOptions}>\n \n \n \n \n );\n};\n\nconst UnauthorizedUserInfo = () => {\n const setOpen = useSetAtom(authAtom);\n\n const openSignInModal = useCallback(() => {\n setOpen(state => ({ ...state, openModal: true }));\n }, [setOpen]);\n\n return (\n \n \n \n );\n};\n\nconst AccountMenu = () => {\n const setSettingModalAtom = useSetAtom(openSettingModalAtom);\n const setOpenSignOutModalAtom = useSetAtom(openSignOutModalAtom);\n\n const onOpenAccountSetting = useCallback(() => {\n track.$.navigationPanel.profileAndBadge.openSettings({ to: 'account' });\n setSettingModalAtom(prev => ({\n ...prev,\n open: true,\n activeTab: 'account',\n }));\n }, [setSettingModalAtom]);\n\n const onOpenSignOutModal = useCallback(() => {\n setOpenSignOutModalAtom(true);\n }, [setOpenSignOutModalAtom]);\n\n const t = useI18n();\n\n return (\n <>\n \n \n \n }\n data-testid=\"workspace-modal-account-settings-option\"\n onClick={onOpenAccountSetting}\n >\n {t['com.arms.workspace.cloud.account.settings']()}\n \n \n \n \n }\n data-testid=\"workspace-modal-sign-out-option\"\n onClick={onOpenSignOutModal}\n >\n {t['com.arms.workspace.cloud.account.logout']()}\n \n >\n );\n};\n\nconst CloudUsage = () => {\n const t = useI18n();\n const quota = useService(UserQuotaService).quota;\n const quotaError = useLiveData(quota.error$);\n\n useEffect(() => {\n // revalidate quota to get the latest status\n quota.revalidate();\n }, [quota]);\n const color = useLiveData(quota.color$);\n const usedFormatted = useLiveData(quota.usedFormatted$);\n const maxFormatted = useLiveData(quota.maxFormatted$);\n const percent = useLiveData(quota.percent$);\n\n if (percent === null) {\n if (quotaError) {\n return Failed to load quota;\n }\n return (\n \n \n \n \n );\n }\n\n return (\n \n \n \n \n {t['com.arms.user-info.usage.cloud']()}\n \n {usedFormatted}\n / \n {maxFormatted}\n \n \n \n\n \n \n \n \n );\n};\n\nconst AIUsage = () => {\n const t = useI18n();\n const copilotQuotaService = useService(UserCopilotQuotaService);\n const subscriptionService = useService(SubscriptionService);\n\n useEffect(() => {\n // revalidate latest subscription status\n subscriptionService.subscription.revalidate();\n }, [subscriptionService]);\n useEffect(() => {\n copilotQuotaService.copilotQuota.revalidate();\n }, [copilotQuotaService]);\n\n const copilotActionLimit = useLiveData(\n copilotQuotaService.copilotQuota.copilotActionLimit$\n );\n const copilotActionUsed = useLiveData(\n copilotQuotaService.copilotQuota.copilotActionUsed$\n );\n const loading = copilotActionLimit === null || copilotActionUsed === null;\n const loadError = useLiveData(copilotQuotaService.copilotQuota.error$);\n\n const setSettingModalAtom = useSetAtom(openSettingModalAtom);\n\n const goToAIPlanPage = useCallback(() => {\n setSettingModalAtom({\n open: true,\n activeTab: 'plans',\n scrollAnchor: 'aiPricingPlan',\n });\n }, [setSettingModalAtom]);\n\n const goToAccountSetting = useCallback(() => {\n setSettingModalAtom({\n open: true,\n activeTab: 'account',\n });\n }, [setSettingModalAtom]);\n\n if (loading) {\n if (loadError) console.error(loadError);\n return null;\n }\n\n // unlimited\n if (copilotActionLimit === 'unlimited') {\n return (\n \n \n \n {t['com.arms.user-info.usage.ai']()}\n \n \n \n {t['com.arms.payment.ai.usage-description-purchased']()}\n \n \n );\n }\n\n const percent = Math.min(\n 100,\n Math.max(\n 0.5,\n Number(((copilotActionUsed / copilotActionLimit) * 100).toFixed(4))\n )\n );\n\n const color = percent > 80 ? cssVar('errorColor') : cssVar('processingColor');\n\n return (\n \n \n \n \n {t['com.arms.user-info.usage.ai']()}\n \n {copilotActionUsed}\n / \n {copilotActionLimit}\n \n\n Free\n \n\n \n \n \n \n );\n};\n\nconst OperationMenu = () => {\n const serverConfigService = useService(ServerConfigService);\n const serverFeatures = useLiveData(\n serverConfigService.serverConfig.features$\n );\n\n return (\n <>\n {serverFeatures?.copilot ? : null}\n \n \n \n >\n );\n};\n","import { openSettingModalAtom } from '@affine/core/atoms';\nimport { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';\nimport { track } from '@affine/core/mixpanel';\nimport {\n ExplorerCollections,\n ExplorerFavorites,\n ExplorerMigrationFavorites,\n ExplorerOrganize,\n} from '@affine/core/modules/explorer';\nimport { ExplorerTags } from '@affine/core/modules/explorer/views/sections/tags';\nimport { CMDKQuickSearchService } from '@affine/core/modules/quicksearch/services/cmdk';\nimport { isNewTabTrigger } from '@affine/core/utils';\nimport { events } from '@affine/electron-api';\nimport { useI18n } from '@affine/i18n';\nimport { AllDocsIcon, SettingsIcon } from '@blocksuite/icons/rc';\nimport type { Doc } from '@blocksuite/store';\nimport type { Workspace } from '@toeverything/infra';\nimport { useLiveData, useService, WorkspaceService } from '@toeverything/infra';\nimport { useSetAtom } from 'jotai';\nimport type { MouseEvent, ReactElement } from 'react';\nimport { useCallback, useEffect } from 'react';\n\nimport { useAppSettingHelper } from '../../hooks/affine/use-app-setting-helper';\nimport { WorkbenchService } from '../../modules/workbench';\nimport {\n AddPageButton,\n AppSidebar,\n CategoryDivider,\n MenuItem,\n MenuLinkItem,\n QuickSearchInput,\n SidebarContainer,\n SidebarScrollableContainer,\n} from '../app-sidebar';\nimport { usePageHelper } from '../blocksuite/block-suite-page-list/utils';\nimport { WorkspaceSelector } from '../workspace-selector';\nimport ImportPage from './import-page';\nimport {\n quickSearch,\n quickSearchAndNewPage,\n workspaceAndUserWrapper,\n workspaceWrapper,\n} from './index.css';\nimport { AppSidebarJournalButton } from './journal-button';\nimport { TrashButton } from './trash-button';\nimport { UserInfo } from './user-info';\n\nexport type RootAppSidebarProps = {\n isPublicWorkspace: boolean;\n onOpenQuickSearchModal: () => void;\n onOpenSettingModal: () => void;\n currentWorkspace: Workspace;\n openPage: (pageId: string) => void;\n createPage: () => Doc;\n paths: {\n all: (workspaceId: string) => string;\n trash: (workspaceId: string) => string;\n shared: (workspaceId: string) => string;\n };\n};\n\n/**\n * This is for the whole affine app sidebar.\n * This component wraps the app sidebar in `@affine/component` with logic and data.\n *\n */\nexport const RootAppSidebar = (): ReactElement => {\n const currentWorkspace = useService(WorkspaceService).workspace;\n const { appSettings } = useAppSettingHelper();\n const docCollection = currentWorkspace.docCollection;\n const t = useI18n();\n const workbench = useService(WorkbenchService).workbench;\n const currentPath = useLiveData(\n workbench.location$.map(location => location.pathname)\n );\n const cmdkQuickSearchService = useService(CMDKQuickSearchService);\n const onOpenQuickSearchModal = useCallback(() => {\n cmdkQuickSearchService.toggle();\n }, [cmdkQuickSearchService]);\n\n const allPageActive = currentPath === '/all';\n\n const pageHelper = usePageHelper(currentWorkspace.docCollection);\n\n const onClickNewPage = useAsyncCallback(\n async (e?: MouseEvent) => {\n const page = pageHelper.createPage(isNewTabTrigger(e) ? 'new-tab' : true);\n page.load();\n track.$.navigationPanel.$.createDoc();\n },\n [pageHelper]\n );\n useEffect(() => {\n if (environment.isDesktop) {\n return events?.applicationMenu.onNewPageAction(() => onClickNewPage());\n }\n return;\n }, [onClickNewPage]);\n\n const setOpenSettingModalAtom = useSetAtom(openSettingModalAtom);\n\n const onOpenSettingModal = useCallback(() => {\n setOpenSettingModalAtom({\n activeTab: 'appearance',\n open: true,\n });\n track.$.navigationPanel.$.openSettings();\n }, [setOpenSettingModalAtom]);\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n } active={allPageActive} to={'/all'}>\n \n {t['com.arms.workspaceSubPath.all']()}\n \n \n \n }\n onClick={onOpenSettingModal}\n >\n \n {t['com.arms.settingSidebar.title']()}\n \n \n \n \n \n {runtimeConfig.enableOrganize && }\n \n \n \n \n \n \n \n \n \n\n {/* removed download button */}\n {/* \n {environment.isDesktop ? : }\n */}\n \n );\n};\n\nRootAppSidebar.displayName = 'memo(RootAppSidebar)';\n","import type React from 'react';\n\n/**\n * TODO(@eyhn): move to icons package\n */\nexport const ArrowCircleIcon = (props: React.SVGProps) => {\n return (\n \n \n \n );\n};\n\nexport const HeartBreakIcon = (props: React.SVGProps) => {\n return (\n \n \n \n );\n};\n","import { Button } from '@affine/component/ui/button';\nimport { AffineShapeIcon } from '@affine/core/components/page-list'; // TODO(@eyhn): import from page-list temporarily, need to defined common svg icon/images management.\nimport { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';\nimport { useNavigateHelper } from '@affine/core/hooks/use-navigate-helper';\nimport { track } from '@affine/core/mixpanel';\nimport { WorkspaceSubPath } from '@affine/core/shared';\nimport { useI18n } from '@affine/i18n';\nimport { useLiveData, useService, WorkspaceService } from '@toeverything/infra';\nimport { useState } from 'react';\n\nimport * as styles from './upgrade.css';\nimport { ArrowCircleIcon, HeartBreakIcon } from './upgrade-icon';\n\n/**\n * TODO(@eyhn): Help info is not implemented yet.\n */\nexport const WorkspaceUpgrade = function WorkspaceUpgrade() {\n const [error, setError] = useState(null);\n const currentWorkspace = useService(WorkspaceService).workspace;\n const upgrading = useLiveData(currentWorkspace.upgrade.upgrading$);\n const t = useI18n();\n const { openPage } = useNavigateHelper();\n\n const onButtonClick = useAsyncCallback(async () => {\n if (upgrading) {\n return;\n }\n\n track.workspace.$.$.upgradeWorkspace();\n\n try {\n const newWorkspace = await currentWorkspace.upgrade.upgrade();\n if (newWorkspace) {\n openPage(newWorkspace.id, WorkspaceSubPath.ALL);\n } else {\n // blocksuite may enter an incorrect state, reload to reset it.\n location.reload();\n }\n } catch (error) {\n setError(error instanceof Error ? error.message : '' + error);\n }\n }, [upgrading, currentWorkspace.upgrade, openPage]);\n\n return (\n \n \n \n \n {error ? error : t['com.arms.upgrade.tips.normal']()}\n \n : }\n variant={error ? 'error' : 'secondary'}\n >\n {error\n ? t['com.arms.upgrade.button-text.error']()\n : upgrading\n ? t['com.arms.upgrade.button-text.upgrading']()\n : t['com.arms.upgrade.button-text.pending']()}\n \n \n \n );\n};\n","import \"../core/src/components/workspace-upgrade/upgrade.css.ts.vanilla.css!=!../../../../../../node_modules/@vanilla-extract/webpack-plugin/virtualFileLoader/dist/vanilla-extract-webpack-plugin-virtualFileLoader.cjs.js?{\\\"fileName\\\":\\\"../core/src/components/workspace-upgrade/upgrade.css.ts.vanilla.css\\\",\\\"source\\\":\\\"Ll8xM2F4ZDRtMCB7CiAgbWFyZ2luOiA4MHB4IGF1dG87CiAgbWF4LXdpZHRoOiA1MzZweDsKfQouXzEzYXhkNG0xIHsKICBwYWRkaW5nOiA0OHB4IDUycHg7CiAgZGlzcGxheTogZmxleDsKICBmbGV4LWRpcmVjdGlvbjogY29sdW1uOwogIGFsaWduLWl0ZW1zOiBjZW50ZXI7Cn0KLl8xM2F4ZDRtMiB7CiAgbWFyZ2luOiAyMHB4IDA7CiAgY29sb3I6IHZhcigtLWFmZmluZS10ZXh0LXNlY29uZGFyeS1jb2xvcik7CiAgZm9udC1zaXplOiAxMnB4OwogIGZvbnQtc3R5bGU6IG5vcm1hbDsKICBmb250LXdlaWdodDogNDAwOwogIGxpbmUtaGVpZ2h0OiAyMHB4OwogIHRleHQtYWxpZ246IGNlbnRlcjsKfQ==\\\"}!../../../../../../node_modules/@vanilla-extract/webpack-plugin/extracted.js\"\nexport var layout = '_13axd4m0';\nexport var upgradeBox = '_13axd4m1';\nexport var upgradeTips = '_13axd4m2';","import { apis, events } from '@affine/electron-api';\nimport { LiveData, Service } from '@toeverything/infra';\nimport { Observable } from 'rxjs';\n\nexport type TabStatus = Parameters<\n Parameters['ui']['onTabsStatusChange']>[0]\n>[0][number];\n\nexport class AppTabsHeaderService extends Service {\n constructor() {\n super();\n }\n\n tabsStatus$ = LiveData.from(\n new Observable(subscriber => {\n let unsub: (() => void) | undefined;\n apis?.ui\n .getTabsStatus()\n .then(tabs => {\n subscriber.next(tabs);\n unsub = events?.ui.onTabsStatusChange(tabs => {\n subscriber.next(tabs);\n });\n })\n .catch(console.error);\n\n return () => {\n unsub?.();\n };\n }),\n []\n );\n\n showContextMenu = apis?.ui.showTabContextMenu;\n\n activateView = apis?.ui.activateView;\n\n closeTab = apis?.ui.closeTab;\n\n onAddTab = apis?.ui.addTab;\n\n onAddDocTab = async (\n docId: string,\n targetTabId?: string,\n edge?: 'left' | 'right'\n ) => {\n await apis?.ui.addTab({\n view: {\n path: {\n pathname: '/' + docId,\n },\n },\n target: targetTabId,\n edge,\n });\n };\n\n onAddTagTab = async (\n tagId: string,\n targetTabId?: string,\n edge?: 'left' | 'right'\n ) => {\n await apis?.ui.addTab({\n view: {\n path: {\n pathname: '/tag/' + tagId,\n },\n },\n target: targetTabId,\n edge,\n });\n };\n\n onAddCollectionTab = async (\n collectionId: string,\n targetTabId?: string,\n edge?: 'left' | 'right'\n ) => {\n await apis?.ui.addTab({\n view: {\n path: {\n pathname: '/collection/' + collectionId,\n },\n },\n target: targetTabId,\n edge,\n });\n };\n\n onToggleRightSidebar = apis?.ui.toggleRightSidebar;\n\n moveTab = apis?.ui.moveTab;\n}\n","import { apis, events } from '@affine/electron-api';\nimport { useAtomValue } from 'jotai';\nimport { atomWithObservable } from 'jotai/utils';\nimport { useCallback } from 'react';\nimport { combineLatest, map, Observable } from 'rxjs';\n\nimport * as style from './style.css';\n\nconst maximized$ = new Observable(subscriber => {\n subscriber.next(false);\n if (events) {\n return events.ui.onMaximized(res => {\n subscriber.next(res);\n });\n }\n return () => {};\n});\n\nconst fullscreen$ = new Observable(subscriber => {\n subscriber.next(false);\n if (events) {\n return events.ui.onFullScreen(res => {\n subscriber.next(res);\n });\n }\n return () => {};\n});\n\nconst maximizedAtom = atomWithObservable(() => {\n return combineLatest([maximized$, fullscreen$]).pipe(\n map(([maximized, fullscreen]) => maximized || fullscreen)\n );\n});\n\nconst minimizeSVG = (\n \n \n \n);\n\nconst closeSVG = (\n \n \n \n);\n\nconst maximizeSVG = (\n \n \n \n);\n\nconst unmaximizedSVG = (\n \n \n \n);\n\nexport const WindowsAppControls = () => {\n const handleMinimizeApp = useCallback(() => {\n apis?.ui.handleMinimizeApp().catch(err => {\n console.error(err);\n });\n }, []);\n const handleMaximizeApp = useCallback(() => {\n apis?.ui.handleMaximizeApp().catch(err => {\n console.error(err);\n });\n }, []);\n const handleCloseApp = useCallback(() => {\n apis?.ui.handleCloseApp().catch(err => {\n console.error(err);\n });\n }, []);\n\n const maximized = useAtomValue(maximizedAtom);\n\n return (\n \n \n {minimizeSVG}\n \n \n {maximized ? unmaximizedSVG : maximizeSVG}\n \n \n {closeSVG}\n \n \n );\n};\n","import {\n AllDocsIcon,\n DeleteIcon,\n EdgelessIcon,\n PageIcon,\n TagIcon,\n TodayIcon,\n ViewLayersIcon,\n} from '@blocksuite/icons/rc';\nimport type { ReactNode } from 'react';\n\nexport const iconNameToIcon = {\n allDocs: ,\n collection: ,\n doc: ,\n page: ,\n edgeless: ,\n journal: ,\n tag: ,\n trash: ,\n} satisfies Record;\n\nexport type ViewIconName = keyof typeof iconNameToIcon;\n","import {\n type DropTargetDropEvent,\n type DropTargetOptions,\n IconButton,\n Loading,\n useDraggable,\n useDropTarget,\n} from '@affine/component';\nimport {\n appSidebarOpenAtom,\n appSidebarResizingAtom,\n} from '@affine/core/components/app-sidebar';\nimport { appSidebarWidthAtom } from '@affine/core/components/app-sidebar/index.jotai';\nimport { WindowsAppControls } from '@affine/core/components/pure/header/windows-app-controls';\nimport { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';\nimport { useCatchEventCallback } from '@affine/core/hooks/use-catch-event-hook';\nimport { track } from '@affine/core/mixpanel';\nimport type { AffineDNDData } from '@affine/core/types/dnd';\nimport { apis, events } from '@affine/electron-api';\nimport { useI18n } from '@affine/i18n';\nimport { CloseIcon, PlusIcon, RightSidebarIcon } from '@blocksuite/icons/rc';\nimport {\n useLiveData,\n useService,\n useServiceOptional,\n} from '@toeverything/infra';\nimport clsx from 'clsx';\nimport { useAtomValue } from 'jotai';\nimport { partition } from 'lodash-es';\nimport {\n Fragment,\n type MouseEventHandler,\n type ReactNode,\n useEffect,\n useState,\n} from 'react';\n\nimport { iconNameToIcon } from '../../workbench/constants';\nimport { DesktopStateSynchronizer } from '../../workbench/services/desktop-state-synchronizer';\nimport {\n AppTabsHeaderService,\n type TabStatus,\n} from '../services/app-tabs-header-service';\nimport * as styles from './styles.css';\n\nconst TabSupportType = ['collection', 'tag', 'doc'];\n\nconst tabCanDrop =\n (tab?: TabStatus): NonNullable['canDrop']> =>\n ctx => {\n if (\n ctx.source.data.from?.at === 'app-header:tabs' &&\n ctx.source.data.from.tabId !== tab?.id\n ) {\n return true;\n }\n\n if (\n ctx.source.data.entity?.type &&\n TabSupportType.includes(ctx.source.data.entity?.type)\n ) {\n return true;\n }\n\n return false;\n };\n\nconst WorkbenchTab = ({\n workbench,\n active: tabActive,\n tabsLength,\n dnd,\n onDrop,\n}: {\n workbench: TabStatus;\n active: boolean;\n tabsLength: number;\n dnd?: boolean;\n onDrop?: (data: DropTargetDropEvent) => void;\n}) => {\n useServiceOptional(DesktopStateSynchronizer);\n const tabsHeaderService = useService(AppTabsHeaderService);\n const activeViewIndex = workbench.activeViewIndex ?? 0;\n const onContextMenu = useAsyncCallback(\n async (viewIdx: number) => {\n const action = await tabsHeaderService.showContextMenu?.(\n workbench.id,\n viewIdx\n );\n switch (action?.type) {\n case 'open-in-split-view': {\n track.$.appTabsHeader.$.tabAction({\n control: 'contextMenu',\n action: 'openInSplitView',\n });\n break;\n }\n case 'separate-view': {\n track.$.appTabsHeader.$.tabAction({\n control: 'contextMenu',\n action: 'separateTabs',\n });\n break;\n }\n case 'pin-tab': {\n if (action.payload.shouldPin) {\n track.$.appTabsHeader.$.tabAction({\n control: 'contextMenu',\n action: 'pin',\n });\n } else {\n track.$.appTabsHeader.$.tabAction({\n control: 'contextMenu',\n action: 'unpin',\n });\n }\n break;\n }\n // fixme: when close tab the view may already be gc'ed\n case 'close-tab': {\n track.$.appTabsHeader.$.tabAction({\n control: 'contextMenu',\n action: 'close',\n });\n break;\n }\n default:\n break;\n }\n },\n [tabsHeaderService, workbench.id]\n );\n const onActivateView = useAsyncCallback(\n async (viewIdx: number) => {\n await tabsHeaderService.activateView?.(workbench.id, viewIdx);\n if (tabActive) {\n track.$.appTabsHeader.$.tabAction({\n control: 'click',\n action: 'switchSplitView',\n });\n } else {\n track.$.appTabsHeader.$.tabAction({\n control: 'click',\n action: 'switchTab',\n });\n }\n },\n [tabActive, tabsHeaderService, workbench.id]\n );\n const handleAuxClick: MouseEventHandler = useCatchEventCallback(\n async e => {\n if (e.button === 1) {\n await tabsHeaderService.closeTab?.(workbench.id);\n track.$.appTabsHeader.$.tabAction({\n control: 'midClick',\n action: 'close',\n });\n }\n },\n [tabsHeaderService, workbench.id]\n );\n\n const handleCloseTab = useCatchEventCallback(async () => {\n await tabsHeaderService.closeTab?.(workbench.id);\n track.$.appTabsHeader.$.tabAction({\n control: 'xButton',\n action: 'close',\n });\n }, [tabsHeaderService, workbench.id]);\n\n const { dropTargetRef, closestEdge } = useDropTarget(\n () => ({\n closestEdge: {\n allowedEdges: ['left', 'right'],\n },\n onDrop,\n dropEffect: 'move',\n canDrop: tabCanDrop(workbench),\n isSticky: true,\n }),\n [onDrop, workbench]\n );\n\n const { dragRef } = useDraggable(\n () => ({\n canDrag: dnd,\n data: {\n from: {\n at: 'app-header:tabs',\n tabId: workbench.id,\n },\n },\n dragPreviewPosition: 'pointer-outside',\n }),\n [dnd, workbench.id]\n );\n\n return (\n {\n dropTargetRef.current = node;\n dragRef.current = node;\n }}\n >\n 1 && !workbench.pinned}\n className={styles.tab}\n >\n {workbench.views.map((view, viewIdx) => {\n return (\n \n {\n onContextMenu(viewIdx);\n }}\n onAuxClick={handleAuxClick}\n onClick={e => {\n e.stopPropagation();\n onActivateView(viewIdx);\n }}\n >\n \n {workbench.ready || !workbench.loaded ? (\n iconNameToIcon[view.iconName ?? 'allDocs']\n ) : (\n \n )}\n \n {workbench.pinned || !view.title ? null : (\n \n {view.title}\n \n )}\n \n\n {viewIdx !== workbench.views.length - 1 ? (\n \n ) : null}\n \n );\n })}\n {!workbench.pinned ? (\n \n {tabsLength > 1 ? (\n \n \n \n ) : null}\n \n ) : null}\n \n \n \n );\n};\n\nconst useIsFullScreen = () => {\n const [fullScreen, setFullScreen] = useState(false);\n\n useEffect(() => {\n apis?.ui\n .isFullScreen()\n .then(setFullScreen)\n .then(() => {\n events?.ui.onFullScreen(setFullScreen);\n })\n .catch(console.error);\n }, []);\n return fullScreen;\n};\n\nexport const AppTabsHeader = ({\n style,\n mode = 'app',\n className,\n left,\n}: {\n style?: React.CSSProperties;\n mode?: 'app' | 'shell';\n className?: string;\n left?: ReactNode;\n}) => {\n const t = useI18n();\n const sidebarWidth = useAtomValue(appSidebarWidthAtom);\n const sidebarOpen = useAtomValue(appSidebarOpenAtom);\n const sidebarResizing = useAtomValue(appSidebarResizingAtom);\n const isMacosDesktop = environment.isDesktop && environment.isMacOs;\n const fullScreen = useIsFullScreen();\n\n const tabsHeaderService = useService(AppTabsHeaderService);\n const tabs = useLiveData(tabsHeaderService.tabsStatus$);\n\n const [pinned, unpinned] = partition(tabs, tab => tab.pinned);\n\n const onAddTab = useAsyncCallback(async () => {\n await tabsHeaderService.onAddTab?.();\n track.$.appTabsHeader.$.tabAction({\n control: 'click',\n action: 'openInNewTab',\n });\n }, [tabsHeaderService]);\n\n const onToggleRightSidebar = useAsyncCallback(async () => {\n await tabsHeaderService.onToggleRightSidebar?.();\n }, [tabsHeaderService]);\n\n useEffect(() => {\n if (mode === 'app') {\n apis?.ui.pingAppLayoutReady().catch(console.error);\n }\n }, [mode]);\n\n const onDrop = useAsyncCallback(\n async (data: DropTargetDropEvent, targetId?: string) => {\n const edge = data.closestEdge ?? 'right';\n targetId = targetId ?? tabs.at(-1)?.id;\n\n if (!targetId || edge === 'top' || edge === 'bottom') {\n return;\n }\n\n if (data.source.data.from?.at === 'app-header:tabs') {\n if (targetId === data.source.data.from.tabId) {\n return;\n }\n track.$.appTabsHeader.$.tabAction({\n control: 'dnd',\n action: 'moveTab',\n });\n return await tabsHeaderService.moveTab?.(\n data.source.data.from.tabId,\n targetId,\n edge\n );\n }\n\n if (data.source.data.entity?.type === 'doc') {\n track.$.appTabsHeader.$.tabAction({\n control: 'dnd',\n action: 'openInNewTab',\n type: 'doc',\n });\n return await tabsHeaderService.onAddDocTab?.(\n data.source.data.entity.id,\n targetId,\n edge\n );\n }\n\n if (data.source.data.entity?.type === 'tag') {\n track.$.appTabsHeader.$.tabAction({\n type: 'tag',\n control: 'dnd',\n action: 'openInNewTab',\n });\n return await tabsHeaderService.onAddTagTab?.(\n data.source.data.entity.id,\n targetId,\n edge\n );\n }\n\n if (data.source.data.entity?.type === 'collection') {\n track.$.appTabsHeader.$.tabAction({\n type: 'collection',\n control: 'dnd',\n action: 'openInNewTab',\n });\n return await tabsHeaderService.onAddCollectionTab?.(\n data.source.data.entity.id,\n targetId,\n edge\n );\n }\n },\n [tabs, tabsHeaderService]\n );\n\n const { dropTargetRef: spacerDropTargetRef, draggedOver } =\n useDropTarget(\n () => ({\n onDrop,\n dropEffect: 'move',\n canDrop: tabCanDrop(),\n }),\n [onDrop]\n );\n\n const trafficLightOffset = isMacosDesktop && !fullScreen ? 70 : 0;\n\n return (\n \n \n {left}\n \n \n {pinned.map(tab => {\n return (\n onDrop(data, tab.id)}\n active={tab.active}\n />\n );\n })}\n {pinned.length > 0 && unpinned.length > 0 && (\n \n )}\n {unpinned.map(tab => {\n return (\n onDrop(data, tab.id)}\n active={tab.active}\n />\n );\n })}\n \n \n }\n />\n \n \n \n \n {environment.isDesktop && environment.isWindows ? (\n \n ) : null}\n \n );\n};\n","import \"../core/src/modules/app-tabs-header/views/styles.css.ts.vanilla.css!=!../../../../../../../node_modules/@vanilla-extract/webpack-plugin/virtualFileLoader/dist/vanilla-extract-webpack-plugin-virtualFileLoader.cjs.js?{\\\"fileName\\\":\\\"../core/src/modules/app-tabs-header/views/styles.css.ts.vanilla.css\\\",\\\"source\\\":\\\"#H4sIAAAAAAAAA61X0WrrOBB971eIwIUUquCkSZqr0v9YWMoiW2NHW0cSklI3u+y/L5LsxJZlk14uhdCMo5k5Z87MyKu/1s1JGMsz9O8DQg1n9kjQOst+vD4gdAReHS1Bu436ct8ZN6qmF4LKGryB1rwSmFs4GYIKEBa0M7vHmHENheVSEKRl48wVVQQdgiv5CbqsZUNQUXPlLEpydx7DJwhrCKJnK50dN5B/cIupUlhD5R0yTavXh/8eVtf0/2TUUswNbrhgsjFvi5LWBhbvHpeijHFRYR3w+Bx6p9f+RyN0HkZIskUwgffvs7G8vOBCCgvCEmQULQDnYBsA8TpOYN0S6hlZZ+oWzhw1Fx8EZSl4J8ngbUGVWryjKHmrqTA80E3rGmWrZzNwsZnBOC7VBNAORg2lnSllp5ugo34SAYfiQgB7W1h97io0A/7Z/yCnxUel5Vkwgj6pXmJMy5ILwLyQAhsopGBUXx5fezIO+V2z2ad5RuhEdcXFlDq28/FzqRloXMha6rnobU/NAN2lSzRRi9hxqqM6RWioqeWf0KshQRlqCQnwnQHvI+x7n1IX6rmV7YkL3KK8muhXZ9pk2ZQwpkm8PriVskfpiJNRxwVaLdV2hjLvMIps4csmY54NaGyghsISJKTw5LXF1pTxsyFoG4CmiU4NLiHxaHbtUET3vBz3oYdo4eIMeugedpXmpyHOXDo9UubqNDgVjHj9mAo/GGiDLKJRt8nS+X9vBuzCIcddxUV1PRYx18eS+b+1+hqiignoBXkJ7I/F3WuZQ7qrRwL1k72VRymFxU23S7NsTqFnbZxEGZT0XNtheqSmxmJZYntRkOJ6yNkhhuMDe73fOhPqmivDTbpfmyO3gP02c9ptNFXf7iOP3vB/IDrg7V8mKgE5uixQBGIy4Fw1k31yh+M5n8MSRM4iagOJvdM/J0Mmdti9a2A0CbtHvcB0cLnbT6zFW52mNuUku47cHrf0l7gdePS3t/dYDdOOPYMJr3nok+hu2Y3z2+CmuZH12XrrrZsQslK1/+XSWnlqv8T9362+7dTmu7ecUUe3/tLrDgQbTlbCzXJclycUaHy88ZgTIe2SwEnZy2NfHNuJaZ2ucz5aOzUXQDWu3IIEYZebl4xB9XTnOkK7zeqw//GEdJXT5Wa3e0K3j2yVZY+e8ORCGujmd6YYzzS0361e1tckt9sn1H7MJFkkZdi94kx1ZrxcOtl+pwHuF0WRun72PLHbkq600/b6rk04IfT2khPeJPBh+iLVz6B3CwDmR21AQ2hpQbfDoW2RxWK6w31Xd+9d8e22TWkXvvWHQdfl4Ul0F+ysU5ewmdHXLvNkqnF2g9TvSUgqWnB76abYr6QXaAdWwdvCsdPe166evRD8G2gp9YmEf2tq4Y+lo3HGm2e3dddn+i7XP4Pr/wF5EDxwxBAAAA==\\\"}!../../../../../../../node_modules/@vanilla-extract/webpack-plugin/extracted.js\"\nexport var dropIndicator = '_1wmnstie';\nexport var headerLeft = '_1wmnsti1';\nexport var labelIcon = '_1wmnstia _1wmnsti9';\nexport var pinSeparator = '_1wmnsti3';\nexport var root = '_1wmnsti0';\nexport var spacer = '_1wmnstid';\nexport var splitViewLabel = '_1wmnsti7';\nexport var splitViewLabelText = '_1wmnsti8';\nexport var splitViewSeparator = '_1wmnsti4';\nexport var tab = '_1wmnsti6';\nexport var tabCloseButton = '_1wmnstic _1wmnsti9';\nexport var tabCloseButtonWrapper = '_1wmnstib';\nexport var tabIcon = '_1wmnsti9';\nexport var tabWrapper = '_1wmnsti5';\nexport var tabs = '_1wmnsti2';","import { notify } from '@affine/component';\nimport { GraphQLError } from '@affine/graphql';\nimport { assertExists } from '@blocksuite/global/utils';\nimport type { PropsWithChildren, ReactNode } from 'react';\nimport { useCallback } from 'react';\nimport type { SWRConfiguration } from 'swr';\nimport { SWRConfig } from 'swr';\n\nconst swrConfig: SWRConfiguration = {\n suspense: true,\n use: [\n useSWRNext => (key, fetcher, config) => {\n const fetcherWrapper = useCallback(\n async (...args: any[]) => {\n assertExists(fetcher);\n const d = fetcher(...args);\n if (d instanceof Promise) {\n return d.catch(e => {\n if (\n e instanceof GraphQLError ||\n (Array.isArray(e) && e[0] instanceof GraphQLError)\n ) {\n const graphQLError = e instanceof GraphQLError ? e : e[0];\n notify.error({\n title: 'GraphQL Error',\n message: graphQLError.toString(),\n });\n } else {\n notify.error({\n title: 'Error',\n message: e.toString(),\n });\n }\n throw e;\n });\n }\n return d;\n },\n [fetcher]\n );\n return useSWRNext(key, fetcher ? fetcherWrapper : fetcher, config);\n },\n ],\n};\n\nexport const SWRConfigProvider = (props: PropsWithChildren): ReactNode => {\n return {props.children};\n};\n","import { toast } from '@affine/component';\nimport {\n pushGlobalLoadingEventAtom,\n resolveGlobalLoadingEventAtom,\n} from '@affine/component/global-loading';\nimport { useI18n } from '@affine/i18n';\nimport { ZipTransformer } from '@blocksuite/blocks';\nimport {\n type DocMode,\n DocsService,\n effect,\n fromPromise,\n LiveData,\n onStart,\n throwIfAborted,\n useLiveData,\n useService,\n WorkspaceService,\n} from '@toeverything/infra';\nimport { useAtomValue, useSetAtom } from 'jotai';\nimport type { PropsWithChildren } from 'react';\nimport { useEffect } from 'react';\nimport {\n catchError,\n EMPTY,\n finalize,\n mergeMap,\n switchMap,\n timeout,\n} from 'rxjs';\nimport { Map as YMap } from 'yjs';\n\nimport { AIProvider } from '../blocksuite/presets/ai';\n// import { WorkspaceAIOnboarding } from '../components/affine/ai-onboarding'; 24-10-02 삭제\nimport { AppContainer } from '../components/affine/app-container';\nimport { SyncAwareness } from '../components/affine/awareness';\nimport {\n appSidebarResizingAtom,\n SidebarSwitch,\n} from '../components/app-sidebar';\n// import { AIIsland } from '../components/pure/ai-island'; 24-10-02 삭제\nimport { RootAppSidebar } from '../components/root-app-sidebar';\nimport { MainContainer } from '../components/workspace';\nimport { WorkspaceUpgrade } from '../components/workspace-upgrade';\nimport { useRegisterFindInPageCommands } from '../hooks/affine/use-register-find-in-page-commands';\nimport { useSubscriptionNotifyReader } from '../hooks/affine/use-subscription-notify';\nimport { useRegisterWorkspaceCommands } from '../hooks/use-register-workspace-commands';\nimport { AppTabsHeader } from '../modules/app-tabs-header';\nimport { NavigationButtons } from '../modules/navigation';\nimport { useRegisterNavigationCommands } from '../modules/navigation/view/use-register-navigation-commands';\nimport { QuickSearchContainer } from '../modules/quicksearch';\nimport { WorkbenchService } from '../modules/workbench';\nimport {\n AllWorkspaceModals,\n CurrentWorkspaceModals,\n} from '../providers/modal-provider';\nimport { SWRConfigProvider } from '../providers/swr-config-provider';\nimport * as styles from './styles.css';\n\nexport const WorkspaceLayout = function WorkspaceLayout({\n children,\n}: PropsWithChildren) {\n return (\n \n {/* load all workspaces is costly, do not block the whole UI */}\n \n \n {children}\n {/* should show after workspace loaded */}\n {/* 24-10-24 삭제 */}\n {/* 24-10-24 삭제 */}\n \n );\n};\n\nconst WorkspaceLayoutProviders = ({ children }: PropsWithChildren) => {\n const t = useI18n();\n const pushGlobalLoadingEvent = useSetAtom(pushGlobalLoadingEventAtom);\n const resolveGlobalLoadingEvent = useSetAtom(resolveGlobalLoadingEventAtom);\n const currentWorkspace = useService(WorkspaceService).workspace;\n const docsList = useService(DocsService).list;\n\n const workbench = useService(WorkbenchService).workbench;\n useEffect(() => {\n const insertTemplate = effect(\n switchMap(({ template, mode }: { template: string; mode: string }) => {\n return fromPromise(async abort => {\n const templateZip = await fetch(template, { signal: abort });\n const templateBlob = await templateZip.blob();\n throwIfAborted(abort);\n const [doc] = await ZipTransformer.importDocs(\n currentWorkspace.docCollection,\n templateBlob\n );\n if (doc) {\n doc.resetHistory();\n }\n\n return { doc, mode };\n }).pipe(\n timeout(10000 /* 10s */),\n mergeMap(({ mode, doc }) => {\n if (doc) {\n docsList.setMode(doc.id, mode as DocMode);\n workbench.openDoc(doc.id);\n }\n return EMPTY;\n }),\n onStart(() => {\n pushGlobalLoadingEvent({\n key: 'insert-template',\n });\n }),\n catchError(err => {\n console.error(err);\n toast(t['com.arms.ai.template-insert.failed']());\n return EMPTY;\n }),\n finalize(() => {\n resolveGlobalLoadingEvent('insert-template');\n })\n );\n })\n );\n\n const disposable = AIProvider.slots.requestInsertTemplate.on(\n ({ template, mode }) => {\n insertTemplate({ template, mode });\n }\n );\n return () => {\n disposable.dispose();\n insertTemplate.unsubscribe();\n };\n }, [\n currentWorkspace.docCollection,\n docsList,\n pushGlobalLoadingEvent,\n resolveGlobalLoadingEvent,\n t,\n workbench,\n ]);\n\n useSubscriptionNotifyReader();\n useRegisterWorkspaceCommands();\n useRegisterNavigationCommands();\n useRegisterFindInPageCommands();\n\n useEffect(() => {\n // hotfix for blockVersions\n // this is a mistake in the\n // 0.8.0 ~ 0.8.1\n // 0.8.0-beta.0 ~ 0.8.0-beta.3\n // 0.8.0-canary.17 ~ 0.9.0-canary.3\n const meta = currentWorkspace.docCollection.doc.getMap('meta');\n const blockVersions = meta.get('blockVersions');\n if (\n !(blockVersions instanceof YMap) &&\n blockVersions !== null &&\n blockVersions !== undefined &&\n typeof blockVersions === 'object'\n ) {\n meta.set(\n 'blockVersions',\n new YMap(Object.entries(blockVersions as Record))\n );\n }\n }, [currentWorkspace.docCollection.doc]);\n\n return (\n <>\n {/* This DndContext is used for drag page from all-pages list into a folder in sidebar */}\n {children}\n \n \n >\n );\n};\n\nconst DesktopLayout = ({ children }: PropsWithChildren) => {\n return (\n \n \n \n \n \n >\n }\n />\n \n \n \n {children}\n \n \n );\n};\n\nconst BrowserLayout = ({ children }: PropsWithChildren) => {\n return (\n \n \n {children}\n \n );\n};\n\n/**\n * Wraps the workspace layout main router view\n */\nconst WorkspaceLayoutUIContainer = ({ children }: PropsWithChildren) => {\n const workbench = useService(WorkbenchService).workbench;\n const currentPath = useLiveData(\n LiveData.computed(get => {\n return get(workbench.basename$) + get(workbench.location$).pathname;\n })\n );\n\n const resizing = useAtomValue(appSidebarResizingAtom);\n const LayoutComponent = environment.isDesktop ? DesktopLayout : BrowserLayout;\n\n return (\n \n {children}\n \n );\n};\nexport const WorkspaceLayoutInner = ({ children }: PropsWithChildren) => {\n const currentWorkspace = useService(WorkspaceService).workspace;\n\n const upgrading = useLiveData(currentWorkspace.upgrade.upgrading$);\n const needUpgrade = useLiveData(currentWorkspace.upgrade.needUpgrade$);\n\n return (\n \n \n {needUpgrade || upgrading ? : children}\n \n \n );\n};\n","import { useI18n } from '@affine/i18n';\nimport type { AffineEditorContainer } from '@blocksuite/presets';\nimport { useService, WorkspaceService } from '@toeverything/infra';\nimport { useStore } from 'jotai';\nimport { useTheme } from 'next-themes';\nimport { useEffect } from 'react';\n\nimport {\n PreconditionStrategy,\n registerAffineCommand,\n registerAffineCreationCommands,\n registerAffineHelpCommands,\n registerAffineLayoutCommands,\n registerAffineNavigationCommands,\n registerAffineSettingsCommands,\n registerAffineUpdatesCommands,\n} from '../commands';\nimport { usePageHelper } from '../components/blocksuite/block-suite-page-list/utils';\nimport { CMDKQuickSearchService } from '../modules/quicksearch/services/cmdk';\nimport { useLanguageHelper } from './affine/use-language-helper';\nimport { useActiveBlocksuiteEditor } from './use-block-suite-editor';\nimport { useNavigateHelper } from './use-navigate-helper';\n\nfunction hasLinkPopover(editor: AffineEditorContainer | null) {\n const textSelection = editor?.host?.std.selection.find('text');\n if (editor && textSelection && textSelection.from.length > 0) {\n const formatBar = editor.host?.querySelector('affine-format-bar-widget');\n if (formatBar) {\n return true;\n }\n }\n return false;\n}\n\nfunction registerCMDKCommand(\n service: CMDKQuickSearchService,\n editor: AffineEditorContainer | null\n) {\n return registerAffineCommand({\n id: 'affine:show-quick-search',\n preconditionStrategy: PreconditionStrategy.Never,\n category: 'affine:general',\n keyBinding: {\n binding: '$mod+K',\n capture: true,\n },\n label: '',\n icon: '',\n run() {\n // Due to a conflict with the shortcut for creating a link after selecting text in blocksuite,\n // opening the quick search modal is disabled when link-popup is visitable.\n if (hasLinkPopover(editor)) {\n return;\n }\n service.toggle();\n },\n });\n}\n\nexport function useRegisterWorkspaceCommands() {\n const store = useStore();\n const t = useI18n();\n const theme = useTheme();\n const currentWorkspace = useService(WorkspaceService).workspace;\n const languageHelper = useLanguageHelper();\n const pageHelper = usePageHelper(currentWorkspace.docCollection);\n const navigationHelper = useNavigateHelper();\n const [editor] = useActiveBlocksuiteEditor();\n const cmdkQuickSearchService = useService(CMDKQuickSearchService);\n\n useEffect(() => {\n const unsub = registerCMDKCommand(cmdkQuickSearchService, editor);\n\n return () => {\n unsub();\n };\n }, [cmdkQuickSearchService, editor]);\n\n // register AffineUpdatesCommands\n useEffect(() => {\n const unsub = registerAffineUpdatesCommands({\n store,\n t,\n });\n\n return () => {\n unsub();\n };\n }, [store, t]);\n\n // register AffineNavigationCommands\n useEffect(() => {\n const unsub = registerAffineNavigationCommands({\n store,\n t,\n docCollection: currentWorkspace.docCollection,\n navigationHelper,\n });\n\n return () => {\n unsub();\n };\n }, [store, t, currentWorkspace.docCollection, navigationHelper]);\n\n // register AffineSettingsCommands\n useEffect(() => {\n const unsub = registerAffineSettingsCommands({\n store,\n t,\n theme,\n languageHelper,\n editor,\n });\n\n return () => {\n unsub();\n };\n }, [store, t, theme, languageHelper, editor]);\n\n // register AffineLayoutCommands\n useEffect(() => {\n const unsub = registerAffineLayoutCommands({ t, store });\n\n return () => {\n unsub();\n };\n }, [store, t]);\n\n // register AffineCreationCommands\n useEffect(() => {\n const unsub = registerAffineCreationCommands({\n store,\n pageHelper: pageHelper,\n t,\n });\n\n return () => {\n unsub();\n };\n }, [store, pageHelper, t]);\n\n // register AffineHelpCommands\n useEffect(() => {\n const unsub = registerAffineHelpCommands({\n store,\n t,\n });\n\n return () => {\n unsub();\n };\n }, [store, t]);\n}\n","import {\n PreconditionStrategy,\n registerAffineCommand,\n} from '@affine/core/commands';\nimport { track } from '@affine/core/mixpanel';\nimport { useService } from '@toeverything/infra';\nimport { useEffect } from 'react';\n\nimport { NavigatorService } from '../services/navigator';\n\nexport function useRegisterNavigationCommands() {\n const navigator = useService(NavigatorService).navigator;\n useEffect(() => {\n const unsubs: Array<() => void> = [];\n\n unsubs.push(\n registerAffineCommand({\n id: 'affine:shortcut-history-go-back',\n category: 'affine:general',\n preconditionStrategy: PreconditionStrategy.Never,\n icon: 'none',\n label: 'go back',\n keyBinding: {\n binding: '$mod+[',\n },\n run() {\n track.$.cmdk.general.goBack();\n\n navigator.back();\n },\n })\n );\n unsubs.push(\n registerAffineCommand({\n id: 'affine:shortcut-history-go-forward',\n category: 'affine:general',\n preconditionStrategy: PreconditionStrategy.Never,\n icon: 'none',\n label: 'go forward',\n keyBinding: {\n binding: '$mod+]',\n },\n run() {\n track.$.cmdk.general.goForward();\n\n navigator.forward();\n },\n })\n );\n\n return () => {\n unsubs.forEach(unsub => unsub());\n };\n }, [navigator]);\n}\n","import {\n PreconditionStrategy,\n registerAffineCommand,\n} from '@affine/core/commands';\nimport { track } from '@affine/core/mixpanel';\nimport { FindInPageService } from '@affine/core/modules/find-in-page/services/find-in-page';\nimport { useService } from '@toeverything/infra';\nimport { useCallback, useEffect } from 'react';\n\nexport function useRegisterFindInPageCommands() {\n const findInPage = useService(FindInPageService).findInPage;\n const toggleVisible = useCallback(() => {\n // get the selected text in page\n const selection = window.getSelection();\n const selectedText = selection?.toString();\n\n findInPage.toggleVisible(selectedText);\n }, [findInPage]);\n\n useEffect(() => {\n if (!environment.isDesktop) {\n return;\n }\n const unsubs: Array<() => void> = [];\n unsubs.push(\n registerAffineCommand({\n preconditionStrategy: PreconditionStrategy.Never,\n id: `affine:find-in-page`,\n keyBinding: {\n binding: '$mod+f',\n },\n icon: null,\n label: '',\n run() {\n track.$.cmdk.general.findInPage();\n\n toggleVisible();\n },\n })\n );\n\n return () => {\n unsubs.forEach(unsub => unsub());\n };\n }, [toggleVisible]);\n}\n","import \"../core/src/layouts/styles.css.ts.vanilla.css!=!../../../../../node_modules/@vanilla-extract/webpack-plugin/virtualFileLoader/dist/vanilla-extract-webpack-plugin-virtualFileLoader.cjs.js?{\\\"fileName\\\":\\\"../core/src/layouts/styles.css.ts.vanilla.css\\\",\\\"source\\\":\\\"LmhveTR4NDAgewogIGRpc3BsYXk6IGZsZXg7CiAgZmxleC1mbG93OiByb3c7CiAgaGVpZ2h0OiAxMDAlOwogIHdpZHRoOiAxMDAlOwogIHBvc2l0aW9uOiByZWxhdGl2ZTsKfQouaG95NHg0MSB7CiAgZGlzcGxheTogZmxleDsKICBmbGV4LWZsb3c6IGNvbHVtbjsKICBoZWlnaHQ6IDEwMCU7CiAgd2lkdGg6IDEwMCU7Cn0KLmhveTR4NDIgewogIGRpc3BsYXk6IGZsZXg7CiAgZmxleC1mbG93OiByb3c7CiAgd2lkdGg6IDEwMCU7CiAgaGVpZ2h0OiBjYWxjKDEwMCUgLSA1MnB4KTsKICBwb3NpdGlvbjogcmVsYXRpdmU7Cn0KLmhveTR4NDMgewogIGRpc3BsYXk6IGZsZXg7CiAgZmxleC1mbG93OiByb3c7CiAgaGVpZ2h0OiA1MnB4OwogIHotaW5kZXg6IDE7CiAgd2lkdGg6IDEwMCU7CiAgb3ZlcmZsb3c6IGhpZGRlbjsKfQ==\\\"}!../../../../../node_modules/@vanilla-extract/webpack-plugin/extracted.js\"\nexport var browserAppViewContainer = 'hoy4x40';\nexport var desktopAppViewContainer = 'hoy4x41';\nexport var desktopAppViewMain = 'hoy4x42';\nexport var desktopTabsHeader = 'hoy4x43';","import { AppFallback } from '@affine/core/components/affine/app-container';\nimport { useWorkspace } from '@affine/core/hooks/use-workspace';\nimport { ZipTransformer } from '@blocksuite/blocks';\nimport type { Workspace } from '@toeverything/infra';\nimport {\n FrameworkScope,\n GlobalContextService,\n useLiveData,\n useService,\n WorkspacesService,\n} from '@toeverything/infra';\nimport type { ReactElement } from 'react';\nimport { useEffect, useMemo, useState } from 'react';\nimport { useParams } from 'react-router-dom';\n\nimport { AffineErrorBoundary } from '../../components/affine/affine-error-boundary';\nimport { WorkspaceLayout } from '../../layouts/workspace-layout';\nimport { WorkbenchRoot } from '../../modules/workbench';\nimport { AllWorkspaceModals } from '../../providers/modal-provider';\nimport { performanceRenderLogger } from '../../shared';\nimport { PageNotFound } from '../404';\n\ndeclare global {\n /**\n * @internal debug only\n */\n // eslint-disable-next-line no-var\n var currentWorkspace: Workspace | undefined;\n // eslint-disable-next-line no-var\n var exportWorkspaceSnapshot: (docs?: string[]) => Promise;\n // eslint-disable-next-line no-var\n var importWorkspaceSnapshot: () => Promise;\n interface WindowEventMap {\n 'affine:workspace:change': CustomEvent<{ id: string }>;\n }\n}\n\nexport const Component = (): ReactElement => {\n performanceRenderLogger.debug('WorkspaceLayout');\n\n const params = useParams();\n\n const [showNotFound, setShowNotFound] = useState(false);\n const workspacesService = useService(WorkspacesService);\n const listLoading = useLiveData(workspacesService.list.isLoading$);\n const workspaces = useLiveData(workspacesService.list.workspaces$);\n\n const meta = useMemo(() => {\n return workspaces.find(({ id }) => id === params.workspaceId);\n }, [workspaces, params.workspaceId]);\n\n const workspace = useWorkspace(meta);\n const globalContext = useService(GlobalContextService).globalContext;\n\n useEffect(() => {\n workspacesService.list.revalidate();\n }, [workspacesService]);\n\n useEffect(() => {\n if (workspace) {\n // for debug purpose\n window.currentWorkspace = workspace ?? undefined;\n window.dispatchEvent(\n new CustomEvent('affine:workspace:change', {\n detail: {\n id: workspace.id,\n },\n })\n );\n window.exportWorkspaceSnapshot = async (docs?: string[]) => {\n const zip = await ZipTransformer.exportDocs(\n workspace.docCollection,\n Array.from(workspace.docCollection.docs.values())\n .filter(doc => (docs ? docs.includes(doc.id) : true))\n .map(doc => doc.getDoc())\n );\n const url = URL.createObjectURL(zip);\n // download url\n const a = document.createElement('a');\n a.href = url;\n a.download = `${workspace.docCollection.meta.name}.zip`;\n a.click();\n URL.revokeObjectURL(url);\n };\n window.importWorkspaceSnapshot = async () => {\n const input = document.createElement('input');\n input.type = 'file';\n input.accept = '.zip';\n input.onchange = async () => {\n if (input.files && input.files.length > 0) {\n const file = input.files[0];\n const blob = new Blob([file], { type: 'application/zip' });\n const newDocs = await ZipTransformer.importDocs(\n workspace.docCollection,\n blob\n );\n console.log(\n 'imported docs',\n newDocs\n .filter(doc => !!doc)\n .map(doc => ({\n id: doc.id,\n title: doc.meta?.title,\n }))\n );\n }\n };\n input.click();\n };\n localStorage.setItem('last_workspace_id', workspace.id);\n globalContext.workspaceId.set(workspace.id);\n return () => {\n window.currentWorkspace = undefined;\n globalContext.workspaceId.set(null);\n };\n }\n return;\n }, [globalContext, meta, workspace]);\n\n // avoid doing operation, before workspace is loaded\n const isRootDocReady =\n useLiveData(workspace?.engine.rootDocState$.map(v => v.ready)) ?? false;\n\n // if listLoading is false, we can show 404 page, otherwise we should show loading page.\n useEffect(() => {\n if (listLoading === false && meta === undefined) {\n setShowNotFound(true);\n }\n if (meta) {\n setShowNotFound(false);\n }\n }, [listLoading, meta, workspacesService]);\n\n useEffect(() => {\n if (showNotFound) {\n const timer = setInterval(() => {\n workspacesService.list.revalidate();\n }, 3000);\n return () => {\n clearInterval(timer);\n };\n }\n return;\n }, [showNotFound, workspacesService]);\n\n if (showNotFound) {\n return ;\n }\n if (!workspace) {\n return ;\n }\n\n if (!isRootDocReady) {\n return (\n \n \n \n \n );\n }\n\n return (\n \n \n \n \n \n \n \n );\n};\n"],"names":["SyncAwarenessInnerLoggedIn","authService","useService","AuthService","account","useLiveData","session","account$","currentWorkspace","WorkspaceService","workspace","useEffect","docCollection","awarenessStore","awareness","setLocalStateField","name","label","SyncAwarenessInner","status$","SyncAwareness","RootEmpty","t","useI18n","ExplorerEmptySection","icon","TagIcon","message","messageTestId","ExplorerTags","tagService","explorerService","useServices","TagService","ExplorerService","explorerSection","sections","tags","collapsed","collapsed$","createdTag","setCreatedTag","useState","tagList","tags$","handleCreateNewFavoriteDoc","useCallback","createTag","randomTagColor","track","$","navigationPanel","organize","createOrganizeItem","type","setCollapsed","CollapsibleSection","headerClassName","title","actions","IconButton","data-testid","onClick","size","tooltip","PlusIcon","ExplorerTreeRoot","placeholder","map","tag","ExplorerTagNode","tagId","id","reorderable","location","at","defaultRenaming","importFile","usePageHelper","onImportFile","useAsyncCallback","options","workspaceList","isWorkspaceFile","control","MenuItem","ImportIcon","aiUsageBlock","cloudUsageBar","cloudUsageBarInner","progressColorVar","usageBlock","usageLabel","usageLabelTitle","AppSidebarJournalButton","workbench","WorkbenchService","location$","openToday","useJournalRouteHelper","journalDate","isJournal","useJournalInfoHelper","pathname","split","handleOpenToday","useCatchEventCallback","isNewTabTrigger","e","Icon","isBefore","Date","YesterdayIcon","isAfter","TomorrowIcon","TodayIcon","active","onAuxClick","TrashButton","docsService","DocsService","openConfirmModal","useConfirmModal","globalContextService","GlobalContextService","trashActive","globalContext","isTrash","dropTargetRef","draggedOver","useDropTarget","data","canDrop","source","entity","onDrop","docId","docRecord","list","doc$","value","description","title$","confirmText","Delete","confirmButtonOptions","variant","onConfirm","moveToTrash","MenuLinkItem","ref","AnimatedDeleteIcon","closed","to","span","UnknownUserIcon","memo","width","height","svgRaw","div","style","lineHeight","dangerouslySetInnerHTML","__html","displayName","UserInfo","AuthorizedUserInfo","UnauthorizedUserInfo","menuContentOptions","className","Menu","items","OperationMenu","contentOptions","Avatar","url","avatar","setOpen","useSetAtom","authAtom","openSignInModal","state","openModal","AccountMenu","setSettingModalAtom","openSettingModalAtom","setOpenSignOutModalAtom","openSignOutModalAtom","onOpenAccountSetting","profileAndBadge","openSettings","prev","open","activeTab","onOpenSignOutModal","preFix","MenuIcon","AccountIcon","SignOutIcon","CloudUsage","quota","UserQuotaService","quotaError","error$","revalidate","color","color$","usedFormatted","usedFormatted$","maxFormatted","maxFormatted$","percent","percent$","ErrorMessage","Skeleton","marginTop","clsx","styles","assignInlineVars","UserPlanButton","AIUsage","copilotQuotaService","UserCopilotQuotaService","subscriptionService","SubscriptionService","subscription","copilotQuota","copilotActionLimit","copilotActionLimit$","copilotActionUsed","copilotActionUsed$","loading","loadError","goToAIPlanPage","scrollAnchor","goToAccountSetting","console","error","data-pro","Math","min","max","Number","toFixed","cssVar","serverConfigService","ServerConfigService","serverFeatures","serverConfig","features$","copilot","Divider","RootAppSidebar","appSettings","useAppSettingHelper","currentPath","cmdkQuickSearchService","CMDKQuickSearchService","onOpenQuickSearchModal","toggle","pageHelper","onClickNewPage","page","createPage","load","createDoc","environment","isDesktop","events","applicationMenu","onNewPageAction","setOpenSettingModalAtom","onOpenSettingModal","AppSidebar","clientBorder","translucentUI","enableBlurBackground","SidebarContainer","WorkspaceSelector","QuickSearchInput","data-event-props","AddPageButton","AllDocsIcon","SettingsIcon","SidebarScrollableContainer","ExplorerFavorites","ExplorerOrganize","ExplorerMigrationFavorites","ExplorerCollections","CategoryDivider","padding","ImportPage","ArrowCircleIcon","svg","viewBox","fill","xmlns","props","path","fillRule","clipRule","d","HeartBreakIcon","WorkspaceUpgrade","setError","upgrading","upgrade","upgrading$","openPage","useNavigateHelper","onButtonClick","upgradeWorkspace","newWorkspace","WorkspaceSubPath","ALL","reload","Error","AffineShapeIcon","p","Button","prefix","AppTabsHeaderService","Service","constructor","tabsStatus$","LiveData","from","Observable","subscriber","unsub","apis","ui","getTabsStatus","then","tabs","next","onTabsStatusChange","catch","showContextMenu","showTabContextMenu","activateView","closeTab","onAddTab","addTab","onAddDocTab","targetTabId","edge","view","target","onAddTagTab","onAddCollectionTab","collectionId","onToggleRightSidebar","toggleRightSidebar","moveTab","maximized$","onMaximized","res","fullscreen$","onFullScreen","maximizedAtom","atomWithObservable","combineLatest","pipe","maximized","fullscreen","minimizeSVG","closeSVG","maximizeSVG","unmaximizedSVG","WindowsAppControls","handleMinimizeApp","err","handleMaximizeApp","handleCloseApp","useAtomValue","data-platform-target","button","data-type","iconNameToIcon","allDocs","collection","ViewLayersIcon","doc","PageIcon","edgeless","EdgelessIcon","journal","trash","DeleteIcon","TabSupportType","tabCanDrop","ctx","tabId","tab","includes","WorkbenchTab","tabActive","tabsLength","dnd","useServiceOptional","DesktopStateSynchronizer","tabsHeaderService","activeViewIndex","onContextMenu","viewIdx","action","appTabsHeader","tabAction","payload","shouldPin","onActivateView","handleAuxClick","handleCloseTab","closestEdge","allowedEdges","dropEffect","isSticky","dragRef","useDraggable","canDrag","dragPreviewPosition","node","current","data-active","data-pinned","pinned","data-padding-right","views","Fragment","stopPropagation","ready","loaded","iconName","Loading","length","CloseIcon","data-edge","useIsFullScreen","fullScreen","setFullScreen","isFullScreen","AppTabsHeader","mode","left","sidebarWidth","appSidebarWidthAtom","sidebarOpen","appSidebarOpenAtom","sidebarResizing","appSidebarResizingAtom","isMacosDesktop","isMacOs","unpinned","partition","pingAppLayoutReady","targetId","spacerDropTargetRef","trafficLightOffset","data-mode","data-is-windows","isWindows","transition","undefined","paddingLeft","marginRight","data-dragged-over","tooltipShortcut","RightSidebarIcon","swrConfig","suspense","use","useSWRNext","key","fetcher","config","fetcherWrapper","args","assertExists","Promise","GraphQLError","Array","isArray","graphQLError","notify","toString","SWRConfigProvider","SWRConfig","children","WorkspaceLayout","AllWorkspaceModals","CurrentWorkspaceModals","WorkspaceLayoutInner","WorkspaceLayoutProviders","pushGlobalLoadingEvent","pushGlobalLoadingEventAtom","resolveGlobalLoadingEvent","resolveGlobalLoadingEventAtom","docsList","insertTemplate","effect","switchMap","template","fromPromise","abort","templateZip","fetch","signal","templateBlob","blob","throwIfAborted","ZipTransformer","importDocs","resetHistory","timeout","mergeMap","setMode","openDoc","EMPTY","onStart","catchError","toast","finalize","disposable","AIProvider","slots","requestInsertTemplate","on","dispose","unsubscribe","useSubscriptionNotifyReader","useRegisterWorkspaceCommands","store","useStore","theme","useTheme","languageHelper","useLanguageHelper","navigationHelper","editor","useActiveBlocksuiteEditor","registerAffineCommand","preconditionStrategy","PreconditionStrategy","Never","category","keyBinding","binding","capture","run","hasLinkPopover","textSelection","host","std","selection","find","querySelector","service","registerAffineUpdatesCommands","registerAffineNavigationCommands","registerAffineSettingsCommands","registerAffineLayoutCommands","registerAffineCreationCommands","registerAffineHelpCommands","useRegisterNavigationCommands","navigator","NavigatorService","unsubs","push","cmdk","general","goBack","back","goForward","forward","forEach","useRegisterFindInPageCommands","findInPage","FindInPageService","toggleVisible","window","getSelection","selectedText","meta","getMap","blockVersions","get","YMap","set","Object","entries","QuickSearchContainer","DesktopLayout","SidebarSwitch","show","NavigationButtons","MainContainer","BrowserLayout","WorkspaceLayoutUIContainer","computed","basename$","resizing","LayoutComponent","AppContainer","data-current-path","needUpgrade","needUpgrade$","Component","performanceRenderLogger","debug","params","useParams","showNotFound","setShowNotFound","workspacesService","WorkspacesService","listLoading","isLoading$","workspaces","workspaces$","useMemo","workspaceId","useWorkspace","dispatchEvent","CustomEvent","detail","exportWorkspaceSnapshot","docs","zip","exportDocs","values","filter","getDoc","URL","createObjectURL","a","document","createElement","href","download","click","revokeObjectURL","importWorkspaceSnapshot","input","accept","onchange","files","Blob","log","newDocs","localStorage","setItem","isRootDocReady","engine","rootDocState$","v","timer","setInterval","clearInterval","PageNotFound","noPermission","FrameworkScope","scope","AffineErrorBoundary","WorkbenchRoot","AppFallback"],"sourceRoot":""}
\n {error ? error : t['com.arms.upgrade.tips.normal']()}\n