{
  "version": 3,
  "sources": ["../../../../src/lib/ui/context/actions.tsx"],
  "sourcesContent": ["import {\n\tdefineMessages,\n\tBox,\n\tDefaultColorStyle,\n\tDefaultFillStyle,\n\tEditor,\n\tGeoShapeGeoStyle,\n\tHALF_PI,\n\tPageRecordType,\n\tResult,\n\tStyleProp,\n\tTLEmbedShape,\n\tTLImageShape,\n\tTLShapeId,\n\tTLShapePartial,\n\tTLTextShape,\n\tTLVideoShape,\n\tVec,\n\tapproximately,\n\tcompact,\n\tcreateShapeId,\n\tfetch,\n\tkickoutOccludedShapes,\n\topenWindow,\n\tuseMaybeEditor,\n} from '@tldraw/editor'\nimport * as React from 'react'\nimport { defaultHandleExternalTextContent } from '../../defaultExternalContentHandlers'\nimport { createBookmarkFromUrl } from '../../shapes/bookmark/bookmarks'\nimport { downloadFile } from '../../utils/export/exportAs'\nimport { fitFrameToContent, getFrameableShapeIds, removeFrame } from '../../utils/frames/frames'\nimport { generateShapeAnnouncementMessage } from '../components/A11y'\nimport { EditLinkDialog } from '../components/EditLinkDialog'\nimport { EmbedDialog } from '../components/EmbedDialog'\nimport { useShowCollaborationUi } from '../hooks/useCollaborationStatus'\nimport { flattenShapesToImages } from '../hooks/useFlatten'\nimport { TLUiTranslationKey } from '../hooks/useTranslation/TLUiTranslationKey'\nimport { useTranslation } from '../hooks/useTranslation/useTranslation'\nimport { TLUiIconType } from '../icon-types'\nimport { TLUiOverrideHelpers, useDefaultHelpers } from '../overrides'\nimport { useA11y } from './a11y'\nimport {\n\tareAllSelectedFrameLike,\n\tcanApplySelectionAction as canApplySelection,\n\tcanApplyToUnlockedSelection,\n\tcanFitFrameToContent,\n\tcanFlatten,\n\tcanFrameSelection,\n\tcanReadClipboard,\n\tcanToggleAutoSize,\n\tcanWriteClipboard,\n\thasDownloadableMediaSelected,\n\thasLinkShapeSelected,\n\thasLockedShapesOnPage,\n\thasShapesOnPage,\n\thasThreeStackableShapes,\n\thasUnlockedSelection,\n\tisContentOffscreen,\n\tisGroupAllowed,\n\tisOnlyEmbeddableBookmarkSelected,\n\tisOnlyEmbedWithUrlSelected,\n\tisOnlyFlippableShapeSelected,\n\tisUngroupAllowed,\n\tsupportsDownloadingOriginal,\n} from './action-predicates'\nimport { useTldrawUiComponents } from './components'\nimport { TLUiEventSource, useUiEvents } from './events'\n\n// The action labels, declared so they reach the catalog. An action's `label` is data the menu\n// components translate, not an element, so these can't be `<F>`; referencing the descriptor's id\n// keeps the string extractable and the prop a plain key, which is what an app overriding one\n// passes.\nconst messages = defineMessages({\n\ta11yAdjustShapeStyles: { id: 'a11y.adjust-shape-styles', defaultMessage: 'Adjust shape styles' },\n\ta11yEnlargeShape: { id: 'a11y.enlarge-shape', defaultMessage: 'Enlarge shape' },\n\ta11yRepeatShape: { id: 'a11y.repeat-shape', defaultMessage: 'Repeat shape' },\n\ta11yShrinkShape: { id: 'a11y.shrink-shape', defaultMessage: 'Shrink shape' },\n\tactionAlignBottom: { id: 'action.align-bottom', defaultMessage: 'Align bottom' },\n\tactionAlignCenterHorizontal: {\n\t\tid: 'action.align-center-horizontal',\n\t\tdefaultMessage: 'Align horizontally',\n\t},\n\tactionAlignCenterHorizontalShort: {\n\t\tid: 'action.align-center-horizontal.short',\n\t\tdefaultMessage: 'Align H',\n\t},\n\tactionAlignCenterVertical: {\n\t\tid: 'action.align-center-vertical',\n\t\tdefaultMessage: 'Align vertically',\n\t},\n\tactionAlignCenterVerticalShort: {\n\t\tid: 'action.align-center-vertical.short',\n\t\tdefaultMessage: 'Align V',\n\t},\n\tactionAlignLeft: { id: 'action.align-left', defaultMessage: 'Align left' },\n\tactionAlignRight: { id: 'action.align-right', defaultMessage: 'Align right' },\n\tactionAlignTop: { id: 'action.align-top', defaultMessage: 'Align top' },\n\tactionBackToContent: { id: 'action.back-to-content', defaultMessage: 'Back to content' },\n\tactionBringForward: { id: 'action.bring-forward', defaultMessage: 'Bring forward' },\n\tactionBringToFront: { id: 'action.bring-to-front', defaultMessage: 'Bring to front' },\n\tactionConvertToBookmark: {\n\t\tid: 'action.convert-to-bookmark',\n\t\tdefaultMessage: 'Convert to bookmark',\n\t},\n\tactionConvertToEmbed: { id: 'action.convert-to-embed', defaultMessage: 'Convert to embed' },\n\tactionCopy: { id: 'action.copy', defaultMessage: 'Copy' },\n\tactionCopyAsJson: { id: 'action.copy-as-json', defaultMessage: 'Copy as JSON' },\n\tactionCopyAsJsonShort: { id: 'action.copy-as-json.short', defaultMessage: 'JSON' },\n\tactionCopyAsPng: { id: 'action.copy-as-png', defaultMessage: 'Copy as PNG' },\n\tactionCopyAsPngShort: { id: 'action.copy-as-png.short', defaultMessage: 'PNG' },\n\tactionCopyAsSvg: { id: 'action.copy-as-svg', defaultMessage: 'Copy as SVG' },\n\tactionCopyAsSvgShort: { id: 'action.copy-as-svg.short', defaultMessage: 'SVG' },\n\tactionCopyHoveredStyles: {\n\t\tid: 'action.copy-hovered-styles',\n\t\tdefaultMessage: 'Copy hovered styles',\n\t},\n\tactionCut: { id: 'action.cut', defaultMessage: 'Cut' },\n\tactionDelete: { id: 'action.delete', defaultMessage: 'Delete' },\n\tactionDistributeHorizontal: {\n\t\tid: 'action.distribute-horizontal',\n\t\tdefaultMessage: 'Distribute horizontally',\n\t},\n\tactionDistributeHorizontalShort: {\n\t\tid: 'action.distribute-horizontal.short',\n\t\tdefaultMessage: 'Distribute H',\n\t},\n\tactionDistributeVertical: {\n\t\tid: 'action.distribute-vertical',\n\t\tdefaultMessage: 'Distribute vertically',\n\t},\n\tactionDistributeVerticalShort: {\n\t\tid: 'action.distribute-vertical.short',\n\t\tdefaultMessage: 'Distribute V',\n\t},\n\tactionDownloadOriginal: { id: 'action.download-original', defaultMessage: 'Download original' },\n\tactionDuplicate: { id: 'action.duplicate', defaultMessage: 'Duplicate' },\n\tactionEditLink: { id: 'action.edit-link', defaultMessage: 'Edit link\u2026' },\n\tactionEnhancedA11yMode: {\n\t\tid: 'action.enhanced-a11y-mode',\n\t\tdefaultMessage: 'Toggle enhanced accessibility mode',\n\t},\n\tactionEnhancedA11yModeMenu: {\n\t\tid: 'action.enhanced-a11y-mode.menu',\n\t\tdefaultMessage: 'Enhanced accessibility mode',\n\t},\n\tactionExitPenMode: { id: 'action.exit-pen-mode', defaultMessage: 'Exit pen mode' },\n\tactionExportAllAsPng: { id: 'action.export-all-as-png', defaultMessage: 'Export as PNG' },\n\tactionExportAllAsPngShort: { id: 'action.export-all-as-png.short', defaultMessage: 'PNG' },\n\tactionExportAllAsSvg: { id: 'action.export-all-as-svg', defaultMessage: 'Export as SVG' },\n\tactionExportAllAsSvgShort: { id: 'action.export-all-as-svg.short', defaultMessage: 'SVG' },\n\tactionExportAsPng: { id: 'action.export-as-png', defaultMessage: 'Export as PNG' },\n\tactionExportAsPngShort: { id: 'action.export-as-png.short', defaultMessage: 'PNG' },\n\tactionExportAsSvg: { id: 'action.export-as-svg', defaultMessage: 'Export as SVG' },\n\tactionExportAsSvgShort: { id: 'action.export-as-svg.short', defaultMessage: 'SVG' },\n\tactionFitFrameToContent: { id: 'action.fit-frame-to-content', defaultMessage: 'Fit to content' },\n\tactionFlattenToImage: { id: 'action.flatten-to-image', defaultMessage: 'Flatten' },\n\tactionFlipHorizontal: { id: 'action.flip-horizontal', defaultMessage: 'Flip horizontally' },\n\tactionFlipHorizontalShort: { id: 'action.flip-horizontal.short', defaultMessage: 'Flip H' },\n\tactionFlipVertical: { id: 'action.flip-vertical', defaultMessage: 'Flip vertically' },\n\tactionFlipVerticalShort: { id: 'action.flip-vertical.short', defaultMessage: 'Flip V' },\n\tactionFrameSelection: { id: 'action.frame-selection', defaultMessage: 'Frame selection' },\n\tactionGroup: { id: 'action.group', defaultMessage: 'Group' },\n\tactionInsertEmbed: { id: 'action.insert-embed', defaultMessage: 'Insert embed\u2026' },\n\tactionInsertMedia: { id: 'action.insert-media', defaultMessage: 'Upload media\u2026' },\n\tactionOpenCursorChat: { id: 'action.open-cursor-chat', defaultMessage: 'Cursor chat' },\n\tactionOpenEmbedLink: { id: 'action.open-embed-link', defaultMessage: 'Open link' },\n\tactionOpenKbdShortcuts: { id: 'action.open-kbd-shortcuts', defaultMessage: 'Keyboard shortcuts' },\n\tactionPack: { id: 'action.pack', defaultMessage: 'Pack' },\n\tactionPaste: { id: 'action.paste', defaultMessage: 'Paste' },\n\tactionPasteErrorDescription: {\n\t\tid: 'action.paste-error-description',\n\t\tdefaultMessage:\n\t\t\t'Could not paste due to missing clipboard permissions. Please enable the permissions and try again.',\n\t},\n\tactionPasteErrorTitle: { id: 'action.paste-error-title', defaultMessage: 'Pasting failed' },\n\tactionPrint: { id: 'action.print', defaultMessage: 'Print\u2026' },\n\tactionRedo: { id: 'action.redo', defaultMessage: 'Redo' },\n\tactionRemoveFrame: { id: 'action.remove-frame', defaultMessage: 'Remove frame' },\n\tactionRotateCcw: { id: 'action.rotate-ccw', defaultMessage: 'Rotate counterclockwise' },\n\tactionRotateCw: { id: 'action.rotate-cw', defaultMessage: 'Rotate clockwise' },\n\tactionSelectAll: { id: 'action.select-all', defaultMessage: 'Select all' },\n\tactionSelectNone: { id: 'action.select-none', defaultMessage: 'Select none' },\n\tactionSelectZoomTool: { id: 'action.select-zoom-tool', defaultMessage: 'Zoom' },\n\tactionSendBackward: { id: 'action.send-backward', defaultMessage: 'Send backward' },\n\tactionSendToBack: { id: 'action.send-to-back', defaultMessage: 'Send to back' },\n\tactionStackHorizontal: { id: 'action.stack-horizontal', defaultMessage: 'Stack horizontally' },\n\tactionStackHorizontalShort: { id: 'action.stack-horizontal.short', defaultMessage: 'Stack H' },\n\tactionStackVertical: { id: 'action.stack-vertical', defaultMessage: 'Stack vertically' },\n\tactionStackVerticalShort: { id: 'action.stack-vertical.short', defaultMessage: 'Stack V' },\n\tactionStopFollowing: { id: 'action.stop-following', defaultMessage: 'Stop following' },\n\tactionStretchHorizontal: {\n\t\tid: 'action.stretch-horizontal',\n\t\tdefaultMessage: 'Stretch horizontally',\n\t},\n\tactionStretchHorizontalShort: {\n\t\tid: 'action.stretch-horizontal.short',\n\t\tdefaultMessage: 'Stretch H',\n\t},\n\tactionStretchVertical: { id: 'action.stretch-vertical', defaultMessage: 'Stretch vertically' },\n\tactionStretchVerticalShort: { id: 'action.stretch-vertical.short', defaultMessage: 'Stretch V' },\n\tactionToggleAutoSize: { id: 'action.toggle-auto-size', defaultMessage: 'Toggle auto size' },\n\tactionToggleDarkMode: { id: 'action.toggle-dark-mode', defaultMessage: 'Toggle dark mode' },\n\tactionToggleDarkModeMenu: { id: 'action.toggle-dark-mode.menu', defaultMessage: 'Dark mode' },\n\tactionToggleDebugMode: { id: 'action.toggle-debug-mode', defaultMessage: 'Toggle debug mode' },\n\tactionToggleDebugModeMenu: { id: 'action.toggle-debug-mode.menu', defaultMessage: 'Debug mode' },\n\tactionToggleDynamicSizeMode: {\n\t\tid: 'action.toggle-dynamic-size-mode',\n\t\tdefaultMessage: 'Toggle dynamic size',\n\t},\n\tactionToggleDynamicSizeModeMenu: {\n\t\tid: 'action.toggle-dynamic-size-mode.menu',\n\t\tdefaultMessage: 'Dynamic size',\n\t},\n\tactionToggleEdgeScrolling: {\n\t\tid: 'action.toggle-edge-scrolling',\n\t\tdefaultMessage: 'Toggle edge scrolling',\n\t},\n\tactionToggleEdgeScrollingMenu: {\n\t\tid: 'action.toggle-edge-scrolling.menu',\n\t\tdefaultMessage: 'Edge scrolling',\n\t},\n\tactionToggleFocusMode: { id: 'action.toggle-focus-mode', defaultMessage: 'Toggle focus mode' },\n\tactionToggleFocusModeMenu: { id: 'action.toggle-focus-mode.menu', defaultMessage: 'Focus mode' },\n\tactionToggleGrid: { id: 'action.toggle-grid', defaultMessage: 'Toggle grid' },\n\tactionToggleGridMenu: { id: 'action.toggle-grid.menu', defaultMessage: 'Show grid' },\n\tactionToggleInvertZoom: {\n\t\tid: 'action.toggle-invert-zoom',\n\t\tdefaultMessage: 'Toggle invert mouse zoom',\n\t},\n\tactionToggleInvertZoomMenu: {\n\t\tid: 'action.toggle-invert-zoom.menu',\n\t\tdefaultMessage: 'Invert mouse zoom',\n\t},\n\tactionToggleKeyboardShortcuts: {\n\t\tid: 'action.toggle-keyboard-shortcuts',\n\t\tdefaultMessage: 'Toggle keyboard shortcuts',\n\t},\n\tactionToggleKeyboardShortcutsMenu: {\n\t\tid: 'action.toggle-keyboard-shortcuts.menu',\n\t\tdefaultMessage: 'Enable keyboard shortcuts',\n\t},\n\tactionToggleLock: { id: 'action.toggle-lock', defaultMessage: 'Toggle locked' },\n\tactionTogglePasteAtCursor: {\n\t\tid: 'action.toggle-paste-at-cursor',\n\t\tdefaultMessage: 'Toggle paste at cursor',\n\t},\n\tactionTogglePasteAtCursorMenu: {\n\t\tid: 'action.toggle-paste-at-cursor.menu',\n\t\tdefaultMessage: 'Paste at cursor',\n\t},\n\tactionToggleReduceMotion: {\n\t\tid: 'action.toggle-reduce-motion',\n\t\tdefaultMessage: 'Toggle reduce motion',\n\t},\n\tactionToggleReduceMotionMenu: {\n\t\tid: 'action.toggle-reduce-motion.menu',\n\t\tdefaultMessage: 'Reduce motion',\n\t},\n\tactionToggleSnapMode: { id: 'action.toggle-snap-mode', defaultMessage: 'Toggle always snap' },\n\tactionToggleSnapModeMenu: { id: 'action.toggle-snap-mode.menu', defaultMessage: 'Always snap' },\n\tactionToggleToolLock: { id: 'action.toggle-tool-lock', defaultMessage: 'Toggle tool lock' },\n\tactionToggleToolLockMenu: { id: 'action.toggle-tool-lock.menu', defaultMessage: 'Tool lock' },\n\tactionToggleTransparent: {\n\t\tid: 'action.toggle-transparent',\n\t\tdefaultMessage: 'Toggle transparent background',\n\t},\n\tactionToggleTransparentContextMenu: {\n\t\tid: 'action.toggle-transparent.context-menu',\n\t\tdefaultMessage: 'Transparent',\n\t},\n\tactionToggleTransparentMenu: {\n\t\tid: 'action.toggle-transparent.menu',\n\t\tdefaultMessage: 'Transparent',\n\t},\n\tactionToggleWrapMode: { id: 'action.toggle-wrap-mode', defaultMessage: 'Toggle select on wrap' },\n\tactionToggleWrapModeMenu: {\n\t\tid: 'action.toggle-wrap-mode.menu',\n\t\tdefaultMessage: 'Select on wrap',\n\t},\n\tactionUndo: { id: 'action.undo', defaultMessage: 'Undo' },\n\tactionUngroup: { id: 'action.ungroup', defaultMessage: 'Ungroup' },\n\tactionUnlockAll: { id: 'action.unlock-all', defaultMessage: 'Unlock all' },\n\tactionZoomIn: { id: 'action.zoom-in', defaultMessage: 'Zoom in' },\n\tactionZoomOut: { id: 'action.zoom-out', defaultMessage: 'Zoom out' },\n\tactionZoomTo100: { id: 'action.zoom-to-100', defaultMessage: 'Zoom to 100%' },\n\tactionZoomToFit: { id: 'action.zoom-to-fit', defaultMessage: 'Zoom to fit' },\n\tactionZoomToSelection: { id: 'action.zoom-to-selection', defaultMessage: 'Zoom to selection' },\n\tcolorStyleWhite: { id: 'color-style.white', defaultMessage: 'White' },\n\tcontextPagesNewPage: { id: 'context.pages.new-page', defaultMessage: 'New page' },\n\tdocumentDefaultName: { id: 'document.default-name', defaultMessage: 'Untitled' },\n\tfillStyleFill: { id: 'fill-style.fill', defaultMessage: 'Fill' },\n\tfillStyleLinedFill: { id: 'fill-style.lined-fill', defaultMessage: 'Lined fill' },\n\tpageMenuNewPageInitialName: { id: 'page-menu.new-page-initial-name', defaultMessage: 'Page 1' },\n\ttoolReplaceMedia: { id: 'tool.replace-media', defaultMessage: 'Replace media\u2026' },\n})\n\n/** @public */\nexport interface TLUiActionItem<\n\tTransationKey extends string = string,\n\tIconType extends string = string,\n> {\n\ticon?: IconType | React.ReactElement\n\tid: string\n\tkbd?: string\n\tlabel?: TransationKey | { [key: string]: TransationKey }\n\treadonlyOk?: boolean\n\tcheckbox?: boolean\n\tisRequiredA11yAction?: boolean\n\t/**\n\t * Whether the action exists in the current context at all, e.g. clipboard support or debug\n\t * mode. Menus hide the item when it returns false (the keyboard shortcuts dialog still lists\n\t * it); keyboard shortcuts ignore it. Must be pure and read only editor state.\n\t */\n\tisAvailable?(editor: Editor): boolean\n\t/**\n\t * Whether the action can run now. Menus disable or hide the item when it returns false;\n\t * keyboard shortcuts ignore it. Must be pure and read only editor state: menus re-run it when\n\t * that state changes, so anything else it reads goes stale.\n\t */\n\tisEnabled?(editor: Editor): boolean\n\t/** For checkbox actions: whether the item shows as checked. Must be pure and read only editor state. */\n\tisChecked?(editor: Editor): boolean\n\tonSelect(source: TLUiEventSource): Promise<void> | void\n}\n\n/** @public */\nexport type TLUiActionsContextType = Record<string, TLUiActionItem>\n\n/** @internal */\nexport const ActionsContext = React.createContext<TLUiActionsContextType | null>(null)\n\n/**\n * The page point the context menu opened at, or null while it is closed. The context menu\n * writes it; actions that place content (paste) read it, since the pointer keeps moving\n * over the menu after it opens (#10423).\n *\n * @internal\n */\nexport const ContextMenuPagePointContext = React.createContext<{ current: Vec | null } | null>(null)\n\n/** @public */\nexport interface ActionsProviderProps {\n\toverrides?(\n\t\teditor: Editor,\n\t\tactions: TLUiActionsContextType,\n\t\thelpers: TLUiOverrideHelpers\n\t): TLUiActionsContextType\n\tchildren: React.ReactNode\n}\n\nfunction makeActions(actions: TLUiActionItem[]) {\n\treturn Object.fromEntries(actions.map((action) => [action.id, action])) as TLUiActionsContextType\n}\n\nfunction getExportName(editor: Editor, defaultName: string) {\n\t// When we don't have any shapes selected, we want to use the document name\n\tif (editor.getSelectedShapeIds().length === 0) {\n\t\treturn editor.getDocumentSettings().name || defaultName\n\t}\n\treturn undefined\n}\n\nfunction getSelectedOrAllShapeIds(editor: Editor) {\n\tconst ids = editor.getSelectedShapeIds()\n\treturn ids.length > 0 ? ids : Array.from(editor.getCurrentPageShapeIds())\n}\n\n/** @internal */\nexport function ActionsProvider({ overrides, children }: ActionsProviderProps) {\n\tconst _editor = useMaybeEditor()\n\tconst showCollaborationUi = useShowCollaborationUi()\n\tconst helpers = useDefaultHelpers()\n\tconst components = useTldrawUiComponents()\n\tconst trackEvent = useUiEvents()\n\tconst a11y = useA11y()\n\tconst msg = useTranslation()\n\n\tconst defaultDocumentName = helpers.msg(messages.documentDefaultName)\n\n\tconst rContextMenuPagePoint = React.useRef<Vec | null>(null)\n\n\t// should this be a useMemo? looks like it doesn't actually deref any reactive values\n\tconst actions = React.useMemo<TLUiActionsContextType>(() => {\n\t\tconst editor = _editor as Editor\n\t\tif (!editor) return {}\n\t\tfunction mustGoBackToSelectToolFirst() {\n\t\t\tif (!editor.isIn('select')) {\n\t\t\t\teditor.complete()\n\t\t\t\teditor.setCurrentTool('select')\n\t\t\t\treturn false // false will still let the action happen, true will stop it\n\t\t\t\t// todo: remove this return value once we're suuuuure\n\t\t\t}\n\n\t\t\treturn false\n\t\t}\n\n\t\tfunction canApplySelectionAction() {\n\t\t\treturn editor.isIn('select') && editor.getSelectedShapeIds().length > 0\n\t\t}\n\n\t\tfunction scaleShapes(scaleFactor: number) {\n\t\t\tif (!canApplySelectionAction()) return\n\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\teditor.markHistoryStoppingPoint('resize shapes')\n\n\t\t\teditor.run(() => {\n\t\t\t\tconst scaleOrigin = editor.getSelectionPageBounds()?.center\n\t\t\t\t// Re-reading the bounds after each resize would make the selection center drift.\n\t\t\t\tfor (const id of editor.getSelectedShapeIds()) {\n\t\t\t\t\teditor.resizeShape(id, new Vec(scaleFactor, scaleFactor), { scaleOrigin })\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tfunction updateSelectedShapes(markName: string, update: (ids: TLShapeId[]) => void) {\n\t\t\teditor.markHistoryStoppingPoint(markName)\n\t\t\teditor.run(() => {\n\t\t\t\tconst selectedShapeIds = editor.getSelectedShapeIds()\n\t\t\t\tupdate(selectedShapeIds)\n\t\t\t\tkickoutOccludedShapes(editor, selectedShapeIds)\n\t\t\t})\n\t\t}\n\n\t\tfunction setStyleShortcut<T extends string | number>(\n\t\t\tstyle: StyleProp<T>,\n\t\t\tvalue: T,\n\t\t\tmarkName: string,\n\t\t\tsource: TLUiEventSource\n\t\t) {\n\t\t\teditor.run(() => {\n\t\t\t\teditor.updateInstanceState({ isChangingStyle: true })\n\t\t\t\teditor.markHistoryStoppingPoint(markName)\n\t\t\t\tif (editor.isIn('select')) {\n\t\t\t\t\teditor.setStyleForSelectedShapes(style, value)\n\t\t\t\t}\n\t\t\t\teditor.setStyleForNextShapes(style, value)\n\t\t\t})\n\t\t\ttrackEvent('set-style', { source, id: style.id, value })\n\t\t}\n\n\t\tfunction readClipboard<T>(read: () => Promise<T> | undefined, onRead: (result: T) => void) {\n\t\t\tread()\n\t\t\t\t?.then(onRead)\n\t\t\t\t.catch(() => {\n\t\t\t\t\thelpers.addToast({\n\t\t\t\t\t\ttitle: helpers.msg(messages.actionPasteErrorTitle),\n\t\t\t\t\t\tdescription: helpers.msg(messages.actionPasteErrorDescription),\n\t\t\t\t\t\tseverity: 'error',\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t}\n\n\t\tconst actionItems: TLUiActionItem<TLUiTranslationKey, TLUiIconType>[] = [\n\t\t\t{\n\t\t\t\tid: 'edit-link',\n\t\t\t\tisEnabled: (editor) => editor.isIn('select') && hasLinkShapeSelected(editor),\n\t\t\t\tlabel: messages.actionEditLink.id,\n\t\t\t\ticon: 'link',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('edit-link', { source })\n\t\t\t\t\teditor.markHistoryStoppingPoint('edit-link')\n\t\t\t\t\thelpers.addDialog({ component: EditLinkDialog })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'insert-embed',\n\t\t\t\tlabel: messages.actionInsertEmbed.id,\n\t\t\t\tkbd: 'cmd+i,ctrl+i',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('insert-embed', { source })\n\t\t\t\t\thelpers.addDialog({ component: EmbedDialog })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'open-kbd-shortcuts',\n\t\t\t\tlabel: messages.actionOpenKbdShortcuts.id,\n\t\t\t\tkbd: 'cmd+alt+/,ctrl+alt+/',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tconst { KeyboardShortcutsDialog } = components\n\t\t\t\t\tif (!KeyboardShortcutsDialog) return\n\t\t\t\t\ttrackEvent('open-kbd-shortcuts', { source })\n\t\t\t\t\thelpers.addDialog({ component: KeyboardShortcutsDialog })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'insert-media',\n\t\t\t\tlabel: messages.actionInsertMedia.id,\n\t\t\t\tkbd: 'cmd+u,ctrl+u',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('insert-media', { source })\n\t\t\t\t\thelpers.insertMedia()\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'undo',\n\t\t\t\tisEnabled: (editor) => editor.getCanUndo(),\n\t\t\t\tlabel: messages.actionUndo.id,\n\t\t\t\ticon: 'undo',\n\t\t\t\tkbd: 'cmd+z,ctrl+z',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('undo', { source })\n\t\t\t\t\teditor.undo()\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'redo',\n\t\t\t\tisEnabled: (editor) => editor.getCanRedo(),\n\t\t\t\tlabel: messages.actionRedo.id,\n\t\t\t\ticon: 'redo',\n\t\t\t\tkbd: 'cmd+shift+z,ctrl+shift+z',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('redo', { source })\n\t\t\t\t\teditor.redo()\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'export-as-svg',\n\t\t\t\tisEnabled: hasShapesOnPage,\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionExportAsSvg.id,\n\t\t\t\t\tmenu: messages.actionExportAsSvgShort.id,\n\t\t\t\t\t['context-menu']: messages.actionExportAsSvgShort.id,\n\t\t\t\t},\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tconst ids = getSelectedOrAllShapeIds(editor)\n\t\t\t\t\tif (ids.length === 0) return\n\t\t\t\t\ttrackEvent('export-as', { format: 'svg', source })\n\t\t\t\t\thelpers.exportAs(ids, { format: 'svg', name: getExportName(editor, defaultDocumentName) })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'export-as-png',\n\t\t\t\tisEnabled: hasShapesOnPage,\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionExportAsPng.id,\n\t\t\t\t\tmenu: messages.actionExportAsPngShort.id,\n\t\t\t\t\t['context-menu']: messages.actionExportAsPngShort.id,\n\t\t\t\t},\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tconst ids = getSelectedOrAllShapeIds(editor)\n\t\t\t\t\tif (ids.length === 0) return\n\t\t\t\t\ttrackEvent('export-as', { format: 'png', source })\n\t\t\t\t\thelpers.exportAs(ids, { format: 'png', name: getExportName(editor, defaultDocumentName) })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'export-all-as-svg',\n\t\t\t\tisEnabled: hasShapesOnPage,\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionExportAllAsSvg.id,\n\t\t\t\t\tmenu: messages.actionExportAllAsSvgShort.id,\n\t\t\t\t\t['context-menu']: messages.actionExportAllAsSvgShort.id,\n\t\t\t\t},\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tconst ids = Array.from(editor.getCurrentPageShapeIds())\n\t\t\t\t\tif (ids.length === 0) return\n\t\t\t\t\ttrackEvent('export-all-as', { format: 'svg', source })\n\t\t\t\t\thelpers.exportAs(ids, { format: 'svg', name: getExportName(editor, defaultDocumentName) })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'export-all-as-png',\n\t\t\t\tisEnabled: hasShapesOnPage,\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionExportAllAsPng.id,\n\t\t\t\t\tmenu: messages.actionExportAllAsPngShort.id,\n\t\t\t\t\t['context-menu']: messages.actionExportAllAsPngShort.id,\n\t\t\t\t},\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tconst ids = Array.from(editor.getCurrentPageShapeIds())\n\t\t\t\t\tif (ids.length === 0) return\n\t\t\t\t\ttrackEvent('export-all-as', { format: 'png', source })\n\t\t\t\t\thelpers.exportAs(ids, { format: 'png', name: getExportName(editor, defaultDocumentName) })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'copy-as-svg',\n\t\t\t\tisEnabled: hasShapesOnPage,\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionCopyAsSvg.id,\n\t\t\t\t\tmenu: messages.actionCopyAsSvgShort.id,\n\t\t\t\t\t['context-menu']: messages.actionCopyAsSvgShort.id,\n\t\t\t\t},\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tconst ids = getSelectedOrAllShapeIds(editor)\n\t\t\t\t\tif (ids.length === 0) return\n\t\t\t\t\ttrackEvent('copy-as', { format: 'svg', source })\n\t\t\t\t\thelpers.copyAs(ids, 'svg')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'copy-as-png',\n\t\t\t\tisAvailable: canWriteClipboard,\n\t\t\t\tisEnabled: hasShapesOnPage,\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionCopyAsPng.id,\n\t\t\t\t\tmenu: messages.actionCopyAsPngShort.id,\n\t\t\t\t\t['context-menu']: messages.actionCopyAsPngShort.id,\n\t\t\t\t},\n\t\t\t\treadonlyOk: true,\n\t\t\t\tkbd: 'cmd+shift+c,ctrl+shift+c',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tconst ids = getSelectedOrAllShapeIds(editor)\n\t\t\t\t\tif (ids.length === 0) return\n\t\t\t\t\ttrackEvent('copy-as', { format: 'png', source })\n\t\t\t\t\thelpers.copyAs(ids, 'png')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'copy-as-json',\n\t\t\t\tisAvailable: (editor) => editor.getInstanceState().isDebugMode,\n\t\t\t\tisEnabled: hasShapesOnPage,\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionCopyAsJson.id,\n\t\t\t\t\tmenu: messages.actionCopyAsJsonShort.id,\n\t\t\t\t\t['context-menu']: messages.actionCopyAsJsonShort.id,\n\t\t\t\t},\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tconst ids = getSelectedOrAllShapeIds(editor)\n\t\t\t\t\tif (ids.length === 0) return\n\t\t\t\t\ttrackEvent('copy-as', { format: 'json', source })\n\t\t\t\t\thelpers.copyAs(ids, 'json')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-auto-size',\n\t\t\t\tisEnabled: (editor) => editor.isIn('select') && canToggleAutoSize(editor),\n\t\t\t\tlabel: messages.actionToggleAutoSize.id,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('toggle-auto-size', { source })\n\t\t\t\t\teditor.markHistoryStoppingPoint('toggling auto size')\n\t\t\t\t\teditor.run(() => {\n\t\t\t\t\t\tconst shapes = editor\n\t\t\t\t\t\t\t.getSelectedShapes()\n\t\t\t\t\t\t\t.filter(\n\t\t\t\t\t\t\t\t(shape): shape is TLTextShape =>\n\t\t\t\t\t\t\t\t\teditor.isShapeOfType(shape, 'text') && shape.props.autoSize === false\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\teditor.updateShapes(\n\t\t\t\t\t\t\tshapes.map((shape) => {\n\t\t\t\t\t\t\t\treturn { id: shape.id, type: shape.type, props: { w: 8, autoSize: true } }\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t\tkickoutOccludedShapes(\n\t\t\t\t\t\t\teditor,\n\t\t\t\t\t\t\tshapes.map((shape) => shape.id)\n\t\t\t\t\t\t)\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'open-embed-link',\n\t\t\t\tisEnabled: (editor) => {\n\t\t\t\t\tconst s = editor.getOnlySelectedShape()\n\t\t\t\t\treturn !!s && editor.isShapeOfType(s, 'embed')\n\t\t\t\t},\n\t\t\t\tlabel: messages.actionOpenEmbedLink.id,\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('open-embed-link', { source })\n\t\t\t\t\tconst ids = editor.getSelectedShapeIds()\n\t\t\t\t\tconst warnMsg = 'No embed shapes selected'\n\t\t\t\t\tif (ids.length !== 1) {\n\t\t\t\t\t\tconsole.error(warnMsg)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tconst shape = editor.getShape(ids[0])\n\t\t\t\t\tif (!shape || !editor.isShapeOfType(shape, 'embed')) {\n\t\t\t\t\t\tconsole.error(warnMsg)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\topenWindow(shape.props.url, '_blank')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'select-zoom-tool',\n\t\t\t\tlabel: messages.actionSelectZoomTool.id,\n\t\t\t\treadonlyOk: true,\n\t\t\t\tkbd: 'z, !z',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\t// Noop if user is actually cmd/ctrl+z'ing\n\t\t\t\t\tif (editor.inputs.getAccelKey()) return\n\n\t\t\t\t\t// Noop unless in the current tool's idle state\n\t\t\t\t\tconst path = editor.getPath()\n\t\t\t\t\tif (!path.endsWith('.idle')) return\n\n\t\t\t\t\t// Noop if already in zoom tool\n\t\t\t\t\tif (editor.root.getCurrent()?.id === 'zoom') return\n\n\t\t\t\t\ttrackEvent('zoom-tool', { source })\n\t\t\t\t\t// The editor ignores keys while a button holds focus, so zoom would never see the\n\t\t\t\t\t// Z key up that exits it. editor.focus() won't help: the button is already inside\n\t\t\t\t\t// the container, so the editor reads as focused.\n\t\t\t\t\teditor.getContainer().focus()\n\t\t\t\t\teditor.setCurrentTool('zoom', { onInteractionEnd: path })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'convert-to-bookmark',\n\t\t\t\tisEnabled: (editor) => editor.isIn('select') && isOnlyEmbedWithUrlSelected(editor),\n\t\t\t\tlabel: messages.actionConvertToBookmark.id,\n\t\t\t\tasync onSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('convert-to-bookmark', { source })\n\t\t\t\t\tconst shapes = editor.getSelectedShapes()\n\n\t\t\t\t\tconst markId = editor.markHistoryStoppingPoint('convert shapes to bookmark')\n\n\t\t\t\t\tconst creationPromises: Promise<Result<any, any>>[] = []\n\n\t\t\t\t\tfor (const shape of shapes) {\n\t\t\t\t\t\tif (!shape || !editor.isShapeOfType(shape, 'embed') || !shape.props.url) continue\n\n\t\t\t\t\t\tconst center = editor.getShapePageBounds(shape)?.center\n\n\t\t\t\t\t\tif (!center) continue\n\t\t\t\t\t\teditor.deleteShapes([shape.id])\n\n\t\t\t\t\t\tcreationPromises.push(\n\t\t\t\t\t\t\tcreateBookmarkFromUrl(editor, { url: shape.props.url, center }).then((res) => {\n\t\t\t\t\t\t\t\tif (!res.ok) {\n\t\t\t\t\t\t\t\t\tthrow new Error(res.error)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn res\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\n\t\t\t\t\tawait Promise.all(creationPromises).catch((error) => {\n\t\t\t\t\t\teditor.bailToMark(markId)\n\t\t\t\t\t\tconsole.error(error)\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'convert-to-embed',\n\t\t\t\tisEnabled: (editor) => editor.isIn('select') && isOnlyEmbeddableBookmarkSelected(editor),\n\t\t\t\tlabel: messages.actionConvertToEmbed.id,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('convert-to-embed', { source })\n\n\t\t\t\t\teditor.run(() => {\n\t\t\t\t\t\tconst createList: TLShapePartial[] = []\n\t\t\t\t\t\tconst deleteList: TLShapeId[] = []\n\t\t\t\t\t\tfor (const shape of editor.getSelectedShapes()) {\n\t\t\t\t\t\t\tif (!editor.isShapeOfType(shape, 'bookmark')) continue\n\n\t\t\t\t\t\t\tconst { url } = shape.props\n\n\t\t\t\t\t\t\tconst embedInfo = helpers.getEmbedDefinition(url)\n\t\t\t\t\t\t\tif (!embedInfo?.definition) continue\n\n\t\t\t\t\t\t\tconst { width, height } = embedInfo.definition\n\n\t\t\t\t\t\t\tconst newPos = new Vec(shape.x, shape.y)\n\t\t\t\t\t\t\tnewPos.rot(-shape.rotation)\n\t\t\t\t\t\t\tnewPos.add(new Vec(shape.props.w / 2 - width / 2, shape.props.h / 2 - height / 2))\n\t\t\t\t\t\t\tnewPos.rot(shape.rotation)\n\n\t\t\t\t\t\t\tconst shapeToCreate: TLShapePartial<TLEmbedShape> = {\n\t\t\t\t\t\t\t\tid: createShapeId(),\n\t\t\t\t\t\t\t\ttype: 'embed',\n\t\t\t\t\t\t\t\tx: newPos.x,\n\t\t\t\t\t\t\t\ty: newPos.y,\n\t\t\t\t\t\t\t\trotation: shape.rotation,\n\t\t\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\t\t\turl: url,\n\t\t\t\t\t\t\t\t\tw: width,\n\t\t\t\t\t\t\t\t\th: height,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcreateList.push(shapeToCreate)\n\t\t\t\t\t\t\tdeleteList.push(shape.id)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\teditor.markHistoryStoppingPoint('convert shapes to embed')\n\t\t\t\t\t\teditor.deleteShapes(deleteList)\n\t\t\t\t\t\teditor.createShapes(createList)\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'duplicate',\n\t\t\t\tisEnabled: (editor) => canApplyToUnlockedSelection(editor, 1),\n\t\t\t\tkbd: 'cmd+d,ctrl+d',\n\t\t\t\tlabel: messages.actionDuplicate.id,\n\t\t\t\ticon: 'duplicate',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('duplicate-shapes', { source })\n\t\t\t\t\tconst instanceState = editor.getInstanceState()\n\t\t\t\t\tlet ids: TLShapeId[]\n\t\t\t\t\tlet offset: { x: number; y: number }\n\n\t\t\t\t\tif (instanceState.duplicateProps) {\n\t\t\t\t\t\tids = instanceState.duplicateProps.shapeIds\n\t\t\t\t\t\toffset = instanceState.duplicateProps.offset\n\t\t\t\t\t} else {\n\t\t\t\t\t\tids = editor.getSelectedShapeIds()\n\t\t\t\t\t\tconst commonBounds = Box.Common(compact(ids.map((id) => editor.getShapePageBounds(id))))\n\t\t\t\t\t\toffset = editor.getCameraOptions().isLocked\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t// same as the adjacent note margin\n\t\t\t\t\t\t\t\t\tx: editor.options.adjacentShapeMargin,\n\t\t\t\t\t\t\t\t\ty: editor.options.adjacentShapeMargin,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\tx: commonBounds.width + editor.options.adjacentShapeMargin,\n\t\t\t\t\t\t\t\t\ty: 0,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\teditor.markHistoryStoppingPoint('duplicate shapes')\n\t\t\t\t\teditor.duplicateShapes(ids, offset)\n\n\t\t\t\t\tif (instanceState.duplicateProps) {\n\t\t\t\t\t\t// If we are using duplicate props then we update the shape ids to the\n\t\t\t\t\t\t// ids of the newly created shapes to keep the duplication going\n\t\t\t\t\t\teditor.updateInstanceState({\n\t\t\t\t\t\t\tduplicateProps: {\n\t\t\t\t\t\t\t\t...instanceState.duplicateProps,\n\t\t\t\t\t\t\t\tshapeIds: editor.getSelectedShapeIds(),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'ungroup',\n\t\t\t\tisEnabled: (editor) => editor.isIn('select') && isUngroupAllowed(editor),\n\t\t\t\tlabel: messages.actionUngroup.id,\n\t\t\t\tkbd: 'cmd+shift+g,ctrl+shift+g',\n\t\t\t\ticon: 'ungroup',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('ungroup-shapes', { source })\n\t\t\t\t\teditor.markHistoryStoppingPoint('ungroup')\n\t\t\t\t\teditor.ungroupShapes(editor.getSelectedShapeIds())\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'group',\n\t\t\t\tisEnabled: (editor) => editor.isIn('select') && isGroupAllowed(editor),\n\t\t\t\tlabel: messages.actionGroup.id,\n\t\t\t\tkbd: 'cmd+g,ctrl+g',\n\t\t\t\ticon: 'group',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('group-shapes', { source })\n\t\t\t\t\tconst onlySelectedShape = editor.getOnlySelectedShape()\n\t\t\t\t\tif (onlySelectedShape && editor.isShapeOfType(onlySelectedShape, 'group')) {\n\t\t\t\t\t\teditor.markHistoryStoppingPoint('ungroup')\n\t\t\t\t\t\teditor.ungroupShapes(editor.getSelectedShapeIds())\n\t\t\t\t\t} else {\n\t\t\t\t\t\teditor.markHistoryStoppingPoint('group')\n\t\t\t\t\t\teditor.groupShapes(editor.getSelectedShapeIds())\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'frame-selection',\n\t\t\t\tisEnabled: (editor) => editor.isIn('select') && canFrameSelection(editor),\n\t\t\t\tlabel: messages.actionFrameSelection.id,\n\t\t\t\tkbd: 'cmd+alt+g,ctrl+alt+g',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\tconst selectedShapes = editor.getSelectedShapes()\n\n\t\t\t\t\t// If all selected shapes are frames, remove them (toggle behavior)\n\t\t\t\t\tif (\n\t\t\t\t\t\tselectedShapes.length > 0 &&\n\t\t\t\t\t\tselectedShapes.every((shape) => editor.isShapeOfType(shape, 'frame'))\n\t\t\t\t\t) {\n\t\t\t\t\t\ttrackEvent('remove-frame', { source })\n\t\t\t\t\t\teditor.markHistoryStoppingPoint('remove-frame')\n\t\t\t\t\t\tremoveFrame(\n\t\t\t\t\t\t\teditor,\n\t\t\t\t\t\t\tselectedShapes.map((shape) => shape.id)\n\t\t\t\t\t\t)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\t// Unlike group, a single shape can be framed, so there is no two-shape minimum.\n\t\t\t\t\tconst ids = getFrameableShapeIds(editor, editor.getSelectedShapeIds())\n\t\t\t\t\tif (ids.length === 0) return\n\n\t\t\t\t\tconst shapes = compact(ids.map((id) => editor.getShape(id)))\n\t\t\t\t\tconst pageBounds = editor.getShapesPageBounds(ids)\n\t\t\t\t\tif (!pageBounds) return\n\t\t\t\t\t// Frame props reject zero dimensions, which a lone horizontal arrow or a dot has. The\n\t\t\t\t\t// frame is fitted to its content with padding below, so a placeholder size is fine here.\n\t\t\t\t\tconst { w, h } = Box.ZeroFix(pageBounds)\n\n\t\t\t\t\ttrackEvent('frame-selection', { source })\n\t\t\t\t\teditor.markHistoryStoppingPoint('frame-selection')\n\n\t\t\t\t\tconst parentId = editor.findCommonAncestor(shapes) ?? editor.getCurrentPageId()\n\n\t\t\t\t\tconst frameId = createShapeId()\n\t\t\t\t\tconst padding = 25 / editor.getZoomLevel()\n\n\t\t\t\t\teditor.run(() => {\n\t\t\t\t\t\teditor.createShapes([\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tid: frameId,\n\t\t\t\t\t\t\t\ttype: 'frame',\n\t\t\t\t\t\t\t\tparentId,\n\t\t\t\t\t\t\t\tx: pageBounds.x,\n\t\t\t\t\t\t\t\ty: pageBounds.y,\n\t\t\t\t\t\t\t\tprops: { w, h },\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t])\n\t\t\t\t\t\teditor.reparentShapes(ids, frameId)\n\t\t\t\t\t\tfitFrameToContent(editor, frameId, { padding })\n\t\t\t\t\t\teditor.select(frameId)\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'remove-frame',\n\t\t\t\tisEnabled: (editor) => editor.isIn('select') && areAllSelectedFrameLike(editor),\n\t\t\t\tlabel: messages.actionRemoveFrame.id,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\n\t\t\t\t\ttrackEvent('remove-frame', { source })\n\t\t\t\t\tconst selectedShapes = editor.getSelectedShapes()\n\t\t\t\t\tif (\n\t\t\t\t\t\tselectedShapes.length > 0 &&\n\t\t\t\t\t\tselectedShapes.every((shape) => editor.isShapeFrameLike(shape))\n\t\t\t\t\t) {\n\t\t\t\t\t\teditor.markHistoryStoppingPoint('remove-frame')\n\t\t\t\t\t\tremoveFrame(\n\t\t\t\t\t\t\teditor,\n\t\t\t\t\t\t\tselectedShapes.map((shape) => shape.id)\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'fit-frame-to-content',\n\t\t\t\tisEnabled: (editor) => editor.isIn('select') && canFitFrameToContent(editor),\n\t\t\t\tlabel: messages.actionFitFrameToContent.id,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\n\t\t\t\t\ttrackEvent('fit-frame-to-content', { source })\n\t\t\t\t\tconst onlySelectedShape = editor.getOnlySelectedShape()\n\t\t\t\t\tif (onlySelectedShape && editor.isShapeFrameLike(onlySelectedShape)) {\n\t\t\t\t\t\teditor.markHistoryStoppingPoint('fit-frame-to-content')\n\t\t\t\t\t\tfitFrameToContent(editor, onlySelectedShape.id)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'align-left',\n\t\t\t\tisEnabled: (editor) => canApplyToUnlockedSelection(editor, 2),\n\t\t\t\tlabel: messages.actionAlignLeft.id,\n\t\t\t\tkbd: 'alt+A',\n\t\t\t\ticon: 'align-left',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('align-shapes', { operation: 'left', source })\n\t\t\t\t\tupdateSelectedShapes('align left', (ids) => editor.alignShapes(ids, 'left'))\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'align-center-horizontal',\n\t\t\t\tisEnabled: (editor) => canApplyToUnlockedSelection(editor, 2),\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionAlignCenterHorizontal.id,\n\t\t\t\t\t['context-menu']: messages.actionAlignCenterHorizontalShort.id,\n\t\t\t\t},\n\t\t\t\tkbd: 'alt+H',\n\t\t\t\ticon: 'align-center-horizontal',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('align-shapes', { operation: 'center-horizontal', source })\n\t\t\t\t\tupdateSelectedShapes('align center horizontal', (ids) =>\n\t\t\t\t\t\teditor.alignShapes(ids, 'center-horizontal')\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'align-right',\n\t\t\t\tisEnabled: (editor) => canApplyToUnlockedSelection(editor, 2),\n\t\t\t\tlabel: messages.actionAlignRight.id,\n\t\t\t\tkbd: 'alt+D',\n\t\t\t\ticon: 'align-right',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('align-shapes', { operation: 'right', source })\n\t\t\t\t\tupdateSelectedShapes('align right', (ids) => editor.alignShapes(ids, 'right'))\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'align-center-vertical',\n\t\t\t\tisEnabled: (editor) => canApplyToUnlockedSelection(editor, 2),\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionAlignCenterVertical.id,\n\t\t\t\t\t['context-menu']: messages.actionAlignCenterVerticalShort.id,\n\t\t\t\t},\n\t\t\t\tkbd: 'alt+V',\n\t\t\t\ticon: 'align-center-vertical',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('align-shapes', { operation: 'center-vertical', source })\n\t\t\t\t\tupdateSelectedShapes('align center vertical', (ids) =>\n\t\t\t\t\t\teditor.alignShapes(ids, 'center-vertical')\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'align-top',\n\t\t\t\tisEnabled: (editor) => canApplyToUnlockedSelection(editor, 2),\n\t\t\t\tlabel: messages.actionAlignTop.id,\n\t\t\t\ticon: 'align-top',\n\t\t\t\tkbd: 'alt+W',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('align-shapes', { operation: 'top', source })\n\t\t\t\t\tupdateSelectedShapes('align top', (ids) => editor.alignShapes(ids, 'top'))\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'align-bottom',\n\t\t\t\tisEnabled: (editor) => canApplyToUnlockedSelection(editor, 2),\n\t\t\t\tlabel: messages.actionAlignBottom.id,\n\t\t\t\ticon: 'align-bottom',\n\t\t\t\tkbd: 'alt+S',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('align-shapes', { operation: 'bottom', source })\n\t\t\t\t\tupdateSelectedShapes('align bottom', (ids) => editor.alignShapes(ids, 'bottom'))\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'distribute-horizontal',\n\t\t\t\tisEnabled: (editor) => canApplyToUnlockedSelection(editor, 3),\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionDistributeHorizontal.id,\n\t\t\t\t\t['context-menu']: messages.actionDistributeHorizontalShort.id,\n\t\t\t\t},\n\t\t\t\ticon: 'distribute-horizontal',\n\t\t\t\tkbd: 'alt+shift+h',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('distribute-shapes', { operation: 'horizontal', source })\n\t\t\t\t\tupdateSelectedShapes('distribute horizontal', (ids) =>\n\t\t\t\t\t\teditor.distributeShapes(ids, 'horizontal')\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'distribute-vertical',\n\t\t\t\tisEnabled: (editor) => canApplyToUnlockedSelection(editor, 3),\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionDistributeVertical.id,\n\t\t\t\t\t['context-menu']: messages.actionDistributeVerticalShort.id,\n\t\t\t\t},\n\t\t\t\ticon: 'distribute-vertical',\n\t\t\t\tkbd: 'alt+shift+V',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('distribute-shapes', { operation: 'vertical', source })\n\t\t\t\t\tupdateSelectedShapes('distribute vertical', (ids) =>\n\t\t\t\t\t\teditor.distributeShapes(ids, 'vertical')\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'stretch-horizontal',\n\t\t\t\tisEnabled: (editor) => canApplyToUnlockedSelection(editor, 2),\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionStretchHorizontal.id,\n\t\t\t\t\t['context-menu']: messages.actionStretchHorizontalShort.id,\n\t\t\t\t},\n\t\t\t\ticon: 'stretch-horizontal',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('stretch-shapes', { operation: 'horizontal', source })\n\t\t\t\t\tupdateSelectedShapes('stretch horizontal', (ids) =>\n\t\t\t\t\t\teditor.stretchShapes(ids, 'horizontal')\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'stretch-vertical',\n\t\t\t\tisEnabled: (editor) => canApplyToUnlockedSelection(editor, 2),\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionStretchVertical.id,\n\t\t\t\t\t['context-menu']: messages.actionStretchVerticalShort.id,\n\t\t\t\t},\n\t\t\t\ticon: 'stretch-vertical',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('stretch-shapes', { operation: 'vertical', source })\n\t\t\t\t\tupdateSelectedShapes('stretch vertical', (ids) => editor.stretchShapes(ids, 'vertical'))\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'flip-horizontal',\n\t\t\t\tisEnabled: (editor) =>\n\t\t\t\t\teditor.isIn('select') &&\n\t\t\t\t\t(hasUnlockedSelection(editor, 2) || isOnlyFlippableShapeSelected(editor)),\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionFlipHorizontal.id,\n\t\t\t\t\t['context-menu']: messages.actionFlipHorizontalShort.id,\n\t\t\t\t},\n\t\t\t\tkbd: 'shift+h',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('flip-shapes', { operation: 'horizontal', source })\n\t\t\t\t\tupdateSelectedShapes('flip horizontal', (ids) => editor.flipShapes(ids, 'horizontal'))\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'flip-vertical',\n\t\t\t\tisEnabled: (editor) =>\n\t\t\t\t\teditor.isIn('select') &&\n\t\t\t\t\t(hasUnlockedSelection(editor, 2) || isOnlyFlippableShapeSelected(editor)),\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionFlipVertical.id,\n\t\t\t\t\t['context-menu']: messages.actionFlipVerticalShort.id,\n\t\t\t\t},\n\t\t\t\tkbd: 'shift+v',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('flip-shapes', { operation: 'vertical', source })\n\t\t\t\t\tupdateSelectedShapes('flip vertical', (ids) => editor.flipShapes(ids, 'vertical'))\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'pack',\n\t\t\t\tisEnabled: (editor) => canApplyToUnlockedSelection(editor, 2),\n\t\t\t\tlabel: messages.actionPack.id,\n\t\t\t\ticon: 'pack',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('pack-shapes', { source })\n\t\t\t\t\tupdateSelectedShapes('pack', (ids) =>\n\t\t\t\t\t\teditor.packShapes(ids, editor.options.adjacentShapeMargin)\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'stack-vertical',\n\t\t\t\tisEnabled: (editor) => editor.isIn('select') && hasThreeStackableShapes(editor),\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionStackVertical.id,\n\t\t\t\t\t['context-menu']: messages.actionStackVerticalShort.id,\n\t\t\t\t},\n\t\t\t\ticon: 'stack-vertical',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('stack-shapes', { operation: 'vertical', source })\n\t\t\t\t\tupdateSelectedShapes('stack-vertical', (ids) =>\n\t\t\t\t\t\teditor.stackShapes(ids, 'vertical', editor.options.adjacentShapeMargin)\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'stack-horizontal',\n\t\t\t\tisEnabled: (editor) => editor.isIn('select') && hasThreeStackableShapes(editor),\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionStackHorizontal.id,\n\t\t\t\t\t['context-menu']: messages.actionStackHorizontalShort.id,\n\t\t\t\t},\n\t\t\t\ticon: 'stack-horizontal',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('stack-shapes', { operation: 'horizontal', source })\n\t\t\t\t\tupdateSelectedShapes('stack-horizontal', (ids) =>\n\t\t\t\t\t\teditor.stackShapes(ids, 'horizontal', editor.options.adjacentShapeMargin)\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'bring-to-front',\n\t\t\t\tisEnabled: (editor) => canApplyToUnlockedSelection(editor, 1),\n\t\t\t\tlabel: messages.actionBringToFront.id,\n\t\t\t\tkbd: ']',\n\t\t\t\ticon: 'bring-to-front',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('reorder-shapes', { operation: 'toFront', source })\n\t\t\t\t\teditor.markHistoryStoppingPoint('bring to front')\n\t\t\t\t\teditor.bringToFront(editor.getSelectedShapeIds())\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'bring-forward',\n\t\t\t\tisEnabled: (editor) => canApplyToUnlockedSelection(editor, 1),\n\t\t\t\tlabel: messages.actionBringForward.id,\n\t\t\t\ticon: 'bring-forward',\n\t\t\t\tkbd: 'alt+]',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('reorder-shapes', { operation: 'forward', source })\n\t\t\t\t\teditor.markHistoryStoppingPoint('bring forward')\n\t\t\t\t\teditor.bringForward(editor.getSelectedShapeIds())\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'send-backward',\n\t\t\t\tisEnabled: (editor) => canApplyToUnlockedSelection(editor, 1),\n\t\t\t\tlabel: messages.actionSendBackward.id,\n\t\t\t\ticon: 'send-backward',\n\t\t\t\tkbd: 'alt+[',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('reorder-shapes', { operation: 'backward', source })\n\t\t\t\t\teditor.markHistoryStoppingPoint('send backward')\n\t\t\t\t\teditor.sendBackward(editor.getSelectedShapeIds())\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'send-to-back',\n\t\t\t\tisEnabled: (editor) => canApplyToUnlockedSelection(editor, 1),\n\t\t\t\tlabel: messages.actionSendToBack.id,\n\t\t\t\ticon: 'send-to-back',\n\t\t\t\tkbd: '[',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('reorder-shapes', { operation: 'toBack', source })\n\t\t\t\t\teditor.markHistoryStoppingPoint('send to back')\n\t\t\t\t\teditor.sendToBack(editor.getSelectedShapeIds())\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'cut',\n\t\t\t\tisEnabled: (editor) => canApplyToUnlockedSelection(editor, 1),\n\t\t\t\tlabel: messages.actionCut.id,\n\t\t\t\tkbd: 'cmd+x,ctrl+x',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\thelpers.cut(source)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'copy',\n\t\t\t\tisEnabled: canApplySelection,\n\t\t\t\tlabel: messages.actionCopy.id,\n\t\t\t\tkbd: 'cmd+c,ctrl+c',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\thelpers.copy(source)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'paste',\n\t\t\t\tisAvailable: canReadClipboard,\n\t\t\t\tlabel: messages.actionPaste.id,\n\t\t\t\tkbd: 'cmd+v,ctrl+v',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\t// Resolve the point before the clipboard read: the menu closes, and clears\n\t\t\t\t\t// its point, before the read settles.\n\t\t\t\t\tconst point =\n\t\t\t\t\t\tsource === 'context-menu'\n\t\t\t\t\t\t\t? (rContextMenuPagePoint.current ?? editor.inputs.getCurrentPagePoint())\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\treadClipboard(\n\t\t\t\t\t\t() => navigator.clipboard?.read(),\n\t\t\t\t\t\t(clipboardItems) => helpers.paste(clipboardItems, source, point)\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\t// Cmd+Option+V: paste at cursor (or center if paste-at-cursor pref is on)\n\t\t\t\tid: 'paste-at-cursor',\n\t\t\t\tlabel: messages.actionPaste.id,\n\t\t\t\tkbd: '$?v',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tconst pasteAtCursor = !editor.user.getIsPasteAtCursorMode()\n\t\t\t\t\tconst point = pasteAtCursor ? editor.inputs.getCurrentPagePoint() : undefined\n\t\t\t\t\treadClipboard(\n\t\t\t\t\t\t() => navigator.clipboard?.read(),\n\t\t\t\t\t\t(clipboardItems) => helpers.paste(clipboardItems, source, point)\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\t// Cmd+Shift+Option+V: paste plain text at cursor (or center if pref is on)\n\t\t\t\tid: 'paste-plain-text-at-cursor',\n\t\t\t\tlabel: messages.actionPaste.id,\n\t\t\t\tkbd: '$!?v',\n\t\t\t\tonSelect() {\n\t\t\t\t\tconst pasteAtCursor = !editor.user.getIsPasteAtCursorMode()\n\t\t\t\t\tconst point = pasteAtCursor\n\t\t\t\t\t\t? editor.inputs.getCurrentPagePoint()\n\t\t\t\t\t\t: editor.getViewportPageBounds().center\n\t\t\t\t\treadClipboard(\n\t\t\t\t\t\t() => navigator.clipboard?.readText(),\n\t\t\t\t\t\t(text) => {\n\t\t\t\t\t\t\tif (text?.trim()) {\n\t\t\t\t\t\t\t\teditor.markHistoryStoppingPoint('paste')\n\t\t\t\t\t\t\t\tdefaultHandleExternalTextContent(editor, { text, point })\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'select-all',\n\t\t\t\tisEnabled: hasShapesOnPage,\n\t\t\t\tlabel: messages.actionSelectAll.id,\n\t\t\t\tkbd: 'cmd+a,ctrl+a',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\teditor.run(() => {\n\t\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\t\ttrackEvent('select-all-shapes', { source })\n\n\t\t\t\t\t\teditor.markHistoryStoppingPoint('select all kbd')\n\t\t\t\t\t\teditor.selectAll()\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'select-none',\n\t\t\t\tisEnabled: canApplySelection,\n\t\t\t\tlabel: messages.actionSelectNone.id,\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('select-none-shapes', { source })\n\t\t\t\t\teditor.markHistoryStoppingPoint('select none')\n\t\t\t\t\teditor.selectNone()\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'delete',\n\t\t\t\tisEnabled: (editor) => canApplyToUnlockedSelection(editor, 1),\n\t\t\t\tlabel: messages.actionDelete.id,\n\t\t\t\tkbd: '\u232B,del',\n\t\t\t\ticon: 'trash',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('delete-shapes', { source })\n\t\t\t\t\teditor.markHistoryStoppingPoint('delete')\n\t\t\t\t\teditor.deleteShapes(editor.getSelectedShapeIds())\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'rotate-cw',\n\t\t\t\tisEnabled: (editor) => canApplyToUnlockedSelection(editor, 1),\n\t\t\t\tlabel: messages.actionRotateCw.id,\n\t\t\t\ticon: 'rotate-cw',\n\t\t\t\tkbd: 'shift+.,shift+alt+.',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\tconst isFine = editor.inputs.getAltKey()\n\t\t\t\t\ttrackEvent('rotate-cw', { source, fine: isFine })\n\t\t\t\t\tupdateSelectedShapes('rotate-cw', (ids) => {\n\t\t\t\t\t\tconst rotation = HALF_PI / (isFine ? 96 : 6)\n\t\t\t\t\t\tconst offset = editor.getSelectionRotation() % rotation\n\t\t\t\t\t\tconst dontUseOffset = approximately(offset, 0) || approximately(offset, rotation)\n\t\t\t\t\t\teditor.rotateShapesBy(ids, rotation - (dontUseOffset ? 0 : offset))\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'rotate-ccw',\n\t\t\t\tisEnabled: (editor) => canApplyToUnlockedSelection(editor, 1),\n\t\t\t\tlabel: messages.actionRotateCcw.id,\n\t\t\t\ticon: 'rotate-ccw',\n\t\t\t\t// omg double comma\n\t\t\t\tkbd: 'shift+,,shift+alt+,',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\tconst isFine = editor.inputs.getAltKey()\n\t\t\t\t\ttrackEvent('rotate-ccw', { source, fine: isFine })\n\t\t\t\t\tupdateSelectedShapes('rotate-ccw', (ids) => {\n\t\t\t\t\t\tconst rotation = HALF_PI / (isFine ? 96 : 6)\n\t\t\t\t\t\tconst offset = editor.getSelectionRotation() % rotation\n\t\t\t\t\t\tconst offsetCloseToZero = approximately(offset, 0)\n\t\t\t\t\t\teditor.rotateShapesBy(ids, offsetCloseToZero ? -rotation : -offset)\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'zoom-in',\n\t\t\t\tlabel: messages.actionZoomIn.id,\n\t\t\t\tkbd: 'cmd+=,ctrl+=,=',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('zoom-in', { source, towardsCursor: false })\n\t\t\t\t\teditor.zoomIn(undefined, {\n\t\t\t\t\t\tanimation: { duration: editor.options.animationMediumMs },\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'zoom-in-on-cursor',\n\t\t\t\tlabel: messages.actionZoomIn.id,\n\t\t\t\tkbd: 'shift+cmd+=,shift+ctrl+=,shift+=',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('zoom-in', { source, towardsCursor: true })\n\t\t\t\t\teditor.zoomIn(editor.inputs.getCurrentScreenPoint(), {\n\t\t\t\t\t\tanimation: { duration: editor.options.animationMediumMs },\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'zoom-out',\n\t\t\t\tlabel: messages.actionZoomOut.id,\n\t\t\t\tkbd: 'cmd+-,ctrl+-,-',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('zoom-out', { source, towardsCursor: false })\n\t\t\t\t\teditor.zoomOut(undefined, {\n\t\t\t\t\t\tanimation: { duration: editor.options.animationMediumMs },\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'zoom-out-on-cursor',\n\t\t\t\tlabel: messages.actionZoomOut.id,\n\t\t\t\tkbd: 'shift+cmd+-,shift+ctrl+-,shift+-',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('zoom-out', { source, towardsCursor: true })\n\t\t\t\t\teditor.zoomOut(editor.inputs.getCurrentScreenPoint(), {\n\t\t\t\t\t\tanimation: { duration: editor.options.animationMediumMs },\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'zoom-to-100',\n\t\t\t\tisEnabled: (editor) => editor.getEfficientZoomLevel() !== 1,\n\t\t\t\tlabel: messages.actionZoomTo100.id,\n\t\t\t\ticon: 'reset-zoom',\n\t\t\t\tkbd: 'shift+0',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('reset-zoom', { source })\n\t\t\t\t\teditor.resetZoom(undefined, {\n\t\t\t\t\t\tanimation: { duration: editor.options.animationMediumMs },\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'zoom-to-fit',\n\t\t\t\tisEnabled: hasShapesOnPage,\n\t\t\t\tlabel: messages.actionZoomToFit.id,\n\t\t\t\tkbd: 'shift+1',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('zoom-to-fit', { source })\n\t\t\t\t\teditor.zoomToFit({ animation: { duration: editor.options.animationMediumMs } })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'zoom-to-selection',\n\t\t\t\tisEnabled: canApplySelection,\n\t\t\t\tlabel: messages.actionZoomToSelection.id,\n\t\t\t\tkbd: 'shift+2',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tif (mustGoBackToSelectToolFirst()) return\n\n\t\t\t\t\ttrackEvent('zoom-to-selection', { source })\n\t\t\t\t\teditor.zoomToSelection({ animation: { duration: editor.options.animationMediumMs } })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-snap-mode',\n\t\t\t\tisChecked: (editor) => editor.user.getIsSnapMode(),\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionToggleSnapMode.id,\n\t\t\t\t\tmenu: messages.actionToggleSnapModeMenu.id,\n\t\t\t\t},\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-snap-mode', { source })\n\t\t\t\t\teditor.user.updateUserPreferences({ isSnapMode: !editor.user.getIsSnapMode() })\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-dark-mode',\n\t\t\t\tisChecked: (editor) => editor.user.getIsDarkMode(),\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionToggleDarkMode.id,\n\t\t\t\t\tmenu: messages.actionToggleDarkModeMenu.id,\n\t\t\t\t},\n\t\t\t\tkbd: 'cmd+/,ctrl+/',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tconst value = editor.user.getIsDarkMode() ? 'light' : 'dark'\n\t\t\t\t\ttrackEvent('color-scheme', { source, value })\n\t\t\t\t\teditor.user.updateUserPreferences({\n\t\t\t\t\t\tcolorScheme: value,\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-wrap-mode',\n\t\t\t\tisChecked: (editor) => editor.user.getIsWrapMode(),\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionToggleWrapMode.id,\n\t\t\t\t\tmenu: messages.actionToggleWrapModeMenu.id,\n\t\t\t\t},\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-wrap-mode', { source })\n\t\t\t\t\teditor.user.updateUserPreferences({\n\t\t\t\t\t\tisWrapMode: !editor.user.getIsWrapMode(),\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-dynamic-size-mode',\n\t\t\t\tisChecked: (editor) => editor.user.getIsDynamicResizeMode(),\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionToggleDynamicSizeMode.id,\n\t\t\t\t\tmenu: messages.actionToggleDynamicSizeModeMenu.id,\n\t\t\t\t},\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-dynamic-size-mode', { source })\n\t\t\t\t\teditor.user.updateUserPreferences({\n\t\t\t\t\t\tisDynamicSizeMode: !editor.user.getIsDynamicResizeMode(),\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-paste-at-cursor',\n\t\t\t\tisChecked: (editor) => editor.user.getIsPasteAtCursorMode(),\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionTogglePasteAtCursor.id,\n\t\t\t\t\tmenu: messages.actionTogglePasteAtCursorMenu.id,\n\t\t\t\t},\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-paste-at-cursor', { source })\n\t\t\t\t\teditor.user.updateUserPreferences({\n\t\t\t\t\t\tisPasteAtCursorMode: !editor.user.getIsPasteAtCursorMode(),\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-reduce-motion',\n\t\t\t\tisChecked: (editor) => editor.user.getAnimationSpeed() === 0,\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionToggleReduceMotion.id,\n\t\t\t\t\tmenu: messages.actionToggleReduceMotionMenu.id,\n\t\t\t\t},\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-reduce-motion', { source })\n\t\t\t\t\teditor.user.updateUserPreferences({\n\t\t\t\t\t\tanimationSpeed: editor.user.getAnimationSpeed() === 0 ? 1 : 0,\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-keyboard-shortcuts',\n\t\t\t\tisChecked: (editor) => editor.user.getAreKeyboardShortcutsEnabled(),\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionToggleKeyboardShortcuts.id,\n\t\t\t\t\tmenu: messages.actionToggleKeyboardShortcutsMenu.id,\n\t\t\t\t},\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-keyboard-shortcuts', { source })\n\t\t\t\t\teditor.user.updateUserPreferences({\n\t\t\t\t\t\tareKeyboardShortcutsEnabled: !editor.user.getAreKeyboardShortcutsEnabled(),\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'enhanced-a11y-mode',\n\t\t\t\tisChecked: (editor) => editor.user.getEnhancedA11yMode(),\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionEnhancedA11yMode.id,\n\t\t\t\t\tmenu: messages.actionEnhancedA11yModeMenu.id,\n\t\t\t\t},\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('enhanced-a11y-mode', { source })\n\t\t\t\t\teditor.user.updateUserPreferences({\n\t\t\t\t\t\tenhancedA11yMode: !editor.user.getEnhancedA11yMode(),\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-edge-scrolling',\n\t\t\t\tisChecked: (editor) => editor.user.getEdgeScrollSpeed() !== 0,\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionToggleEdgeScrolling.id,\n\t\t\t\t\tmenu: messages.actionToggleEdgeScrollingMenu.id,\n\t\t\t\t},\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-edge-scrolling', { source })\n\t\t\t\t\teditor.user.updateUserPreferences({\n\t\t\t\t\t\tedgeScrollSpeed: editor.user.getEdgeScrollSpeed() === 0 ? 1 : 0,\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-invert-zoom',\n\t\t\t\tisEnabled: (editor) => editor.user.getUserPreferences().inputMode === 'mouse',\n\t\t\t\tisChecked: (editor) => editor.user.getIsZoomDirectionInverted(),\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionToggleInvertZoom.id,\n\t\t\t\t\tmenu: messages.actionToggleInvertZoomMenu.id,\n\t\t\t\t},\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-invert-zoom', { source })\n\t\t\t\t\teditor.user.updateUserPreferences({\n\t\t\t\t\t\tisZoomDirectionInverted: !editor.user.getIsZoomDirectionInverted(),\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-transparent',\n\t\t\t\tisChecked: (editor) => !editor.getInstanceState().exportBackground,\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionToggleTransparent.id,\n\t\t\t\t\tmenu: messages.actionToggleTransparentMenu.id,\n\t\t\t\t\t['context-menu']: messages.actionToggleTransparentContextMenu.id,\n\t\t\t\t},\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-transparent', { source })\n\t\t\t\t\teditor.updateInstanceState({\n\t\t\t\t\t\texportBackground: !editor.getInstanceState().exportBackground,\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-tool-lock',\n\t\t\t\tisChecked: (editor) => editor.getInstanceState().isToolLocked,\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionToggleToolLock.id,\n\t\t\t\t\tmenu: messages.actionToggleToolLockMenu.id,\n\t\t\t\t},\n\t\t\t\tkbd: 'q',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-tool-lock', { source })\n\t\t\t\t\teditor.updateInstanceState({ isToolLocked: !editor.getInstanceState().isToolLocked })\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'unlock-all',\n\t\t\t\tisEnabled: hasLockedShapesOnPage,\n\t\t\t\tlabel: messages.actionUnlockAll.id,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('unlock-all', { source })\n\t\t\t\t\tconst updates = [] as TLShapePartial[]\n\t\t\t\t\tfor (const shape of editor.getCurrentPageShapes()) {\n\t\t\t\t\t\tif (shape.isLocked) {\n\t\t\t\t\t\t\tupdates.push({ id: shape.id, type: shape.type, isLocked: false })\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (updates.length > 0) {\n\t\t\t\t\t\teditor.markHistoryStoppingPoint('unlock all')\n\t\t\t\t\t\teditor.updateShapes(updates)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-focus-mode',\n\t\t\t\tisChecked: (editor) => editor.getInstanceState().isFocusMode,\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionToggleFocusMode.id,\n\t\t\t\t\tmenu: messages.actionToggleFocusModeMenu.id,\n\t\t\t\t},\n\t\t\t\treadonlyOk: true,\n\t\t\t\tkbd: 'cmd+.,ctrl+.',\n\t\t\t\tcheckbox: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\t// this needs to be deferred because it causes the menu\n\t\t\t\t\t// UI to unmount which puts us in a dodgy state\n\t\t\t\t\teditor.timers.requestAnimationFrame(() => {\n\t\t\t\t\t\teditor.run(() => {\n\t\t\t\t\t\t\ttrackEvent('toggle-focus-mode', { source })\n\t\t\t\t\t\t\thelpers.clearDialogs()\n\t\t\t\t\t\t\thelpers.clearToasts()\n\t\t\t\t\t\t\teditor.updateInstanceState({ isFocusMode: !editor.getInstanceState().isFocusMode })\n\t\t\t\t\t\t})\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-grid',\n\t\t\t\tisChecked: (editor) => editor.getInstanceState().isGridMode,\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionToggleGrid.id,\n\t\t\t\t\tmenu: messages.actionToggleGridMenu.id,\n\t\t\t\t},\n\t\t\t\treadonlyOk: true,\n\t\t\t\tkbd: \"cmd+',ctrl+'\",\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-grid-mode', { source })\n\t\t\t\t\teditor.updateInstanceState({ isGridMode: !editor.getInstanceState().isGridMode })\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-debug-mode',\n\t\t\t\tisChecked: (editor) => editor.getInstanceState().isDebugMode,\n\t\t\t\tlabel: {\n\t\t\t\t\tdefault: messages.actionToggleDebugMode.id,\n\t\t\t\t\tmenu: messages.actionToggleDebugModeMenu.id,\n\t\t\t\t},\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('toggle-debug-mode', { source })\n\t\t\t\t\teditor.updateInstanceState({\n\t\t\t\t\t\tisDebugMode: !editor.getInstanceState().isDebugMode,\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\tcheckbox: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'print',\n\t\t\t\tisEnabled: hasShapesOnPage,\n\t\t\t\tlabel: messages.actionPrint.id,\n\t\t\t\tkbd: 'cmd+p,ctrl+p',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('print', { source })\n\t\t\t\t\thelpers.printSelectionOrPages()\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'exit-pen-mode',\n\t\t\t\tisAvailable: (editor) => editor.getInstanceState().isPenMode,\n\t\t\t\tlabel: messages.actionExitPenMode.id,\n\t\t\t\ticon: 'cross-2',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('exit-pen-mode', { source })\n\t\t\t\t\teditor.updateInstanceState({ isPenMode: false })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'stop-following',\n\t\t\t\tisAvailable: (editor) => !!editor.getInstanceState().followingUserId,\n\t\t\t\tlabel: messages.actionStopFollowing.id,\n\t\t\t\ticon: 'cross-2',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('stop-following', { source })\n\t\t\t\t\teditor.stopFollowingUser()\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'back-to-content',\n\t\t\t\tisAvailable: isContentOffscreen,\n\t\t\t\tlabel: messages.actionBackToContent.id,\n\t\t\t\ticon: 'arrow-left',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('zoom-to-content', { source })\n\t\t\t\t\tconst bounds = editor.getSelectionPageBounds() ?? editor.getCurrentPageBounds()\n\t\t\t\t\tif (!bounds) return\n\t\t\t\t\teditor.zoomToBounds(bounds, {\n\t\t\t\t\t\ttargetZoom: Math.min(1, editor.getZoomLevel()),\n\t\t\t\t\t\tanimation: { duration: 220 },\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'toggle-lock',\n\t\t\t\tisEnabled: canApplySelection,\n\t\t\t\tlabel: messages.actionToggleLock.id,\n\t\t\t\tkbd: 'shift+l',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\teditor.markHistoryStoppingPoint('locking')\n\t\t\t\t\ttrackEvent('toggle-lock', { source })\n\t\t\t\t\teditor.toggleLock(editor.getSelectedShapeIds())\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'move-to-new-page',\n\t\t\t\tisEnabled: (editor) =>\n\t\t\t\t\thasUnlockedSelection(editor, 1) && editor.getPages().length < editor.options.maxPages,\n\t\t\t\tlabel: messages.contextPagesNewPage.id,\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tconst newPageId = PageRecordType.createId()\n\t\t\t\t\tconst ids = editor.getSelectedShapeIds()\n\t\t\t\t\teditor.run(() => {\n\t\t\t\t\t\teditor.markHistoryStoppingPoint('move_shapes_to_page')\n\t\t\t\t\t\teditor.createPage({\n\t\t\t\t\t\t\tname: helpers.msg(messages.pageMenuNewPageInitialName),\n\t\t\t\t\t\t\tid: newPageId,\n\t\t\t\t\t\t})\n\t\t\t\t\t\teditor.moveShapesToPage(ids, newPageId)\n\t\t\t\t\t})\n\t\t\t\t\ttrackEvent('move-to-new-page', { source })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'select-white-color',\n\t\t\t\tlabel: messages.colorStyleWhite.id,\n\t\t\t\tkbd: 'alt+t',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tsetStyleShortcut(DefaultColorStyle, 'white', 'change-color', source)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'select-fill-fill',\n\t\t\t\tlabel: messages.fillStyleFill.id,\n\t\t\t\tkbd: 'alt+f',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tsetStyleShortcut(DefaultFillStyle, 'fill', 'change-fill', source)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'select-fill-lined-fill',\n\t\t\t\tlabel: messages.fillStyleLinedFill.id,\n\t\t\t\tkbd: 'alt+shift+f',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\tsetStyleShortcut(DefaultFillStyle, 'lined-fill', 'change-fill', source)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'flatten-to-image',\n\t\t\t\tisEnabled: canFlatten,\n\t\t\t\tlabel: messages.actionFlattenToImage.id,\n\t\t\t\tkbd: 'shift+f',\n\t\t\t\tonSelect: async (source) => {\n\t\t\t\t\tconst ids = editor.getSelectedShapeIds()\n\t\t\t\t\tif (ids.length === 0) return\n\n\t\t\t\t\teditor.markHistoryStoppingPoint('flattening to image')\n\t\t\t\t\ttrackEvent('flatten-to-image', { source })\n\n\t\t\t\t\tconst newShapeIds = await flattenShapesToImages(\n\t\t\t\t\t\teditor,\n\t\t\t\t\t\tids,\n\t\t\t\t\t\teditor.options.flattenImageBoundsExpand\n\t\t\t\t\t)\n\n\t\t\t\t\tif (newShapeIds?.length) {\n\t\t\t\t\t\teditor.setSelectedShapes(newShapeIds)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'select-geo-tool',\n\t\t\t\tkbd: 'g',\n\t\t\t\tonSelect: async (source) => {\n\t\t\t\t\t// will select whatever the most recent geo tool was\n\t\t\t\t\ttrackEvent('select-tool', { source, id: `geo-previous` })\n\t\t\t\t\teditor.setCurrentTool('geo')\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'change-page-prev',\n\t\t\t\tkbd: 'alt+left,alt+up',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect: async (source) => {\n\t\t\t\t\t// will select whatever the most recent geo tool was\n\t\t\t\t\tconst pages = editor.getPages()\n\t\t\t\t\tconst currentPageIndex = pages.findIndex((page) => page.id === editor.getCurrentPageId())\n\t\t\t\t\tif (currentPageIndex < 1) return\n\t\t\t\t\ttrackEvent('change-page', { source, direction: 'prev' })\n\t\t\t\t\teditor.markHistoryStoppingPoint('change-page')\n\t\t\t\t\teditor.setCurrentPage(pages[currentPageIndex - 1].id)\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'change-page-next',\n\t\t\t\tkbd: 'alt+right,alt+down',\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect: async (source) => {\n\t\t\t\t\t// will select whatever the most recent geo tool was\n\t\t\t\t\tconst pages = editor.getPages()\n\t\t\t\t\tconst currentPageIndex = pages.findIndex((page) => page.id === editor.getCurrentPageId())\n\n\t\t\t\t\t// If we're on the last page...\n\t\t\t\t\tif (currentPageIndex === -1 || currentPageIndex >= pages.length - 1) {\n\t\t\t\t\t\t// if the current page is blank or if we're in readonly mode, do nothing\n\t\t\t\t\t\tif (editor.getCurrentPageShapes().length <= 0 || editor.getIsReadonly()) {\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Otherwise, create a new page\n\t\t\t\t\t\ttrackEvent('new-page', { source })\n\t\t\t\t\t\teditor.run(() => {\n\t\t\t\t\t\t\teditor.markHistoryStoppingPoint('creating page')\n\t\t\t\t\t\t\tconst newPageId = PageRecordType.createId()\n\t\t\t\t\t\t\teditor.createPage({\n\t\t\t\t\t\t\t\tname: helpers.msg(messages.pageMenuNewPageInitialName),\n\t\t\t\t\t\t\t\tid: newPageId,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\teditor.setCurrentPage(newPageId)\n\t\t\t\t\t\t})\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\teditor.markHistoryStoppingPoint('change-page')\n\t\t\t\t\teditor.setCurrentPage(pages[currentPageIndex + 1].id)\n\t\t\t\t\ttrackEvent('change-page', { source, direction: 'next' })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'adjust-shape-styles',\n\t\t\t\tlabel: messages.a11yAdjustShapeStyles.id,\n\t\t\t\tkbd: 'cmd+Enter,ctrl+Enter',\n\t\t\t\tisRequiredA11yAction: true,\n\t\t\t\tonSelect: async (source) => {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\n\t\t\t\t\tconst onlySelectedShape = editor.getOnlySelectedShape()\n\t\t\t\t\tif (\n\t\t\t\t\t\tonlySelectedShape &&\n\t\t\t\t\t\t(editor.isShapeOfType(onlySelectedShape, 'image') ||\n\t\t\t\t\t\t\teditor.isShapeOfType(onlySelectedShape, 'video'))\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst firstToolbarButton = editor\n\t\t\t\t\t\t\t.getContainer()\n\t\t\t\t\t\t\t.querySelector('.tlui-contextual-toolbar button:first-child') as HTMLElement | null\n\t\t\t\t\t\tfirstToolbarButton?.focus()\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\tconst firstButton = editor\n\t\t\t\t\t\t.getContainer()\n\t\t\t\t\t\t.querySelector('.tlui-style-panel button') as HTMLElement | null\n\t\t\t\t\tfirstButton?.focus()\n\t\t\t\t\ttrackEvent('adjust-shape-styles', { source })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'a11y-open-context-menu',\n\t\t\t\tkbd: 'cmd+shift+Enter,ctrl+shift+Enter',\n\t\t\t\tisRequiredA11yAction: true,\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect: async (source) => {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\n\t\t\t\t\t// For multiple shapes or a single shape, get the selection bounds\n\t\t\t\t\tconst selectionBounds = editor.getSelectionPageBounds()\n\t\t\t\t\tif (!selectionBounds) return\n\n\t\t\t\t\t// Convert page coordinates to screen coordinates\n\t\t\t\t\tconst screenPoint = editor.pageToScreen(selectionBounds.center)\n\n\t\t\t\t\t// Dispatch a contextmenu event directly at the center of the selection\n\t\t\t\t\teditor\n\t\t\t\t\t\t.getContainer()\n\t\t\t\t\t\t.querySelector('.tl-canvas')\n\t\t\t\t\t\t?.dispatchEvent(\n\t\t\t\t\t\t\tnew PointerEvent('contextmenu', {\n\t\t\t\t\t\t\t\tclientX: screenPoint.x,\n\t\t\t\t\t\t\t\tclientY: screenPoint.y,\n\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\n\t\t\t\t\ttrackEvent('open-context-menu', { source })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'enlarge-shapes',\n\t\t\t\tisEnabled: (editor) => canApplyToUnlockedSelection(editor, 1),\n\t\t\t\tlabel: messages.a11yEnlargeShape.id,\n\t\t\t\tkbd: 'cmd+alt+shift+=,ctrl+alt+shift+=',\n\t\t\t\tonSelect: async (source) => {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tscaleShapes(1.1)\n\t\t\t\t\ttrackEvent('enlarge-shapes', { source })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'shrink-shapes',\n\t\t\t\tisEnabled: (editor) => canApplyToUnlockedSelection(editor, 1),\n\t\t\t\tlabel: messages.a11yShrinkShape.id,\n\t\t\t\tkbd: 'cmd+alt+shift+-,ctrl+alt+shift+-',\n\t\t\t\tonSelect: async (source) => {\n\t\t\t\t\tif (!canApplySelectionAction()) return\n\t\t\t\t\tscaleShapes(1 / 1.1)\n\t\t\t\t\ttrackEvent('shrink-shapes', { source })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'a11y-repeat-shape-announce',\n\t\t\t\tkbd: 'alt+r',\n\t\t\t\tlabel: messages.a11yRepeatShape.id,\n\t\t\t\tisRequiredA11yAction: true,\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect: async (source) => {\n\t\t\t\t\tconst selectedShapeIds = editor.getSelectedShapeIds()\n\t\t\t\t\tif (!selectedShapeIds.length) return\n\t\t\t\t\tconst a11yLive = generateShapeAnnouncementMessage({\n\t\t\t\t\t\teditor,\n\t\t\t\t\t\tselectedShapeIds,\n\t\t\t\t\t\tmsg,\n\t\t\t\t\t})\n\n\t\t\t\t\tif (a11yLive) {\n\t\t\t\t\t\ta11y.announce({ msg: '' })\n\t\t\t\t\t\teditor.timers.requestAnimationFrame(() => {\n\t\t\t\t\t\t\ta11y.announce({ msg: a11yLive })\n\t\t\t\t\t\t})\n\t\t\t\t\t\ttrackEvent('a11y-repeat-shape-announce', { source })\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'image-replace',\n\t\t\t\tlabel: messages.toolReplaceMedia.id,\n\t\t\t\ticon: 'arrow-cycle',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect: async (source) => {\n\t\t\t\t\ttrackEvent('image-replace', { source })\n\t\t\t\t\thelpers.replaceImage()\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'video-replace',\n\t\t\t\tlabel: messages.toolReplaceMedia.id,\n\t\t\t\ticon: 'arrow-cycle',\n\t\t\t\treadonlyOk: false,\n\t\t\t\tonSelect: async (source) => {\n\t\t\t\t\ttrackEvent('video-replace', { source })\n\t\t\t\t\thelpers.replaceVideo()\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'download-original',\n\t\t\t\tisEnabled: hasDownloadableMediaSelected,\n\t\t\t\tlabel: messages.actionDownloadOriginal.id,\n\t\t\t\treadonlyOk: true,\n\t\t\t\tonSelect: async (source) => {\n\t\t\t\t\tconst selectedShapes = editor.getSelectedShapes()\n\t\t\t\t\tif (selectedShapes.length === 0) return\n\n\t\t\t\t\tconst mediaShapes = selectedShapes.filter((s): s is TLImageShape | TLVideoShape =>\n\t\t\t\t\t\tsupportsDownloadingOriginal(s, editor)\n\t\t\t\t\t)\n\n\t\t\t\t\tif (mediaShapes.length === 0) return\n\n\t\t\t\t\tfor (const mediaShape of mediaShapes) {\n\t\t\t\t\t\tconst asset = editor.getAsset(mediaShape.props.assetId!)\n\t\t\t\t\t\tif (!asset || !asset.props.src) continue\n\n\t\t\t\t\t\tconst url = await editor.resolveAssetUrl(asset.id, { shouldResolveToOriginal: true })\n\t\t\t\t\t\tif (!url) continue\n\n\t\t\t\t\t\tconst name =\n\t\t\t\t\t\t\t(asset.type === 'video' || asset.type === 'image') &&\n\t\t\t\t\t\t\t!asset.props.src.startsWith('asset:')\n\t\t\t\t\t\t\t\t? asset.props.name\n\t\t\t\t\t\t\t\t: 'download'\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst resp = await fetch(url)\n\t\t\t\t\t\t\tif (!resp.ok) throw new Error(`Failed to fetch asset: ${resp.status}`)\n\t\t\t\t\t\t\tconst blob = await resp.blob()\n\t\t\t\t\t\t\tdownloadFile(\n\t\t\t\t\t\t\t\tnew File([blob], name, { type: blob.type }),\n\t\t\t\t\t\t\t\teditor.getContainerDocument()\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t// Fallback: open in new tab (e.g. if CORS blocked)\n\t\t\t\t\t\t\topenWindow(url, '_blank')\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ttrackEvent('download-original', { source })\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'copy-hovered-styles',\n\t\t\t\tlabel: messages.actionCopyHoveredStyles.id,\n\t\t\t\tkbd: 'shift+q',\n\t\t\t\tasync onSelect(source) {\n\t\t\t\t\tconst shape = editor.getShapeAtPoint(editor.inputs.getCurrentPagePoint(), {\n\t\t\t\t\t\thitInside: false,\n\t\t\t\t\t\thitLabels: false,\n\t\t\t\t\t\thitLocked: editor.options.selectLockedShapes,\n\t\t\t\t\t\tmargin: editor.getHitTestMargin(),\n\t\t\t\t\t})\n\n\t\t\t\t\tconst path = editor.getPath()\n\t\t\t\t\tif (!shape || !path.endsWith('.idle')) return\n\n\t\t\t\t\t// Setting styles for the next shape is instance state, not document state, so it\n\t\t\t\t\t// isn't undoable and doesn't need a history stopping point.\n\t\t\t\t\teditor.run(() => {\n\t\t\t\t\t\tfor (const style of editor.styleProps[shape.type].keys()) {\n\t\t\t\t\t\t\tconst value = editor.getShapeStyleIfExists(shape, style)\n\t\t\t\t\t\t\tif (value === undefined || style === GeoShapeGeoStyle) continue\n\t\t\t\t\t\t\teditor.setStyleForNextShapes(style, value)\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\n\t\t\t\t\ttrackEvent('copy-hovered-styles', { source })\n\t\t\t\t},\n\t\t\t},\n\t\t]\n\n\t\tif (showCollaborationUi) {\n\t\t\tactionItems.push({\n\t\t\t\tid: 'open-cursor-chat',\n\t\t\t\tisAvailable: (editor) => !editor.getInstanceState().isCoarsePointer,\n\t\t\t\tisEnabled: (editor) => editor.isIn('select'),\n\t\t\t\tlabel: messages.actionOpenCursorChat.id,\n\t\t\t\treadonlyOk: true,\n\t\t\t\tkbd: '/',\n\t\t\t\tonSelect(source) {\n\t\t\t\t\ttrackEvent('open-cursor-chat', { source })\n\n\t\t\t\t\t// Don't open cursor chat if we're on a touch device\n\t\t\t\t\tif (editor.getInstanceState().isCoarsePointer) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\t// wait a frame before opening as otherwise the open context menu will close it\n\t\t\t\t\teditor.timers.requestAnimationFrame(() => {\n\t\t\t\t\t\teditor.updateInstanceState({ isChatting: true })\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t})\n\t\t}\n\n\t\tconst actions = makeActions(actionItems)\n\n\t\tif (overrides) {\n\t\t\treturn overrides(editor, actions, helpers)\n\t\t}\n\n\t\treturn actions\n\t}, [\n\t\thelpers,\n\t\t_editor,\n\t\ttrackEvent,\n\t\toverrides,\n\t\tdefaultDocumentName,\n\t\tshowCollaborationUi,\n\t\tmsg,\n\t\ta11y,\n\t\tcomponents,\n\t])\n\n\treturn (\n\t\t<ContextMenuPagePointContext.Provider value={rContextMenuPagePoint}>\n\t\t\t<ActionsContext.Provider value={asActions(actions)}>{children}</ActionsContext.Provider>\n\t\t</ContextMenuPagePointContext.Provider>\n\t)\n}\n\n/** @public */\nexport function useActions() {\n\tconst ctx = React.useContext(ActionsContext)\n\n\tif (!ctx) {\n\t\tthrow new Error('useTools must be used within a ToolProvider')\n\t}\n\n\treturn ctx\n}\n\nfunction asActions<T extends Record<string, TLUiActionItem>>(actions: T) {\n\treturn actions as Record<keyof typeof actions, TLUiActionItem>\n}\n\n/** @public */\nexport function unwrapLabel(label?: TLUiActionItem['label'], menuType?: string) {\n\treturn label\n\t\t? typeof label === 'string'\n\t\t\t? label\n\t\t\t: menuType\n\t\t\t\t? (label[menuType] ?? label['default'])\n\t\t\t\t: undefined\n\t\t: undefined\n}\n"],
  "mappings": "AA+rEG;AA/rEH;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EASA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,YAAY,WAAW;AACvB,SAAS,wCAAwC;AACjD,SAAS,6BAA6B;AACtC,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB,sBAAsB,mBAAmB;AACrE,SAAS,wCAAwC;AACjD,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAC5B,SAAS,8BAA8B;AACvC,SAAS,6BAA6B;AAEtC,SAAS,sBAAsB;AAE/B,SAA8B,yBAAyB;AACvD,SAAS,eAAe;AACxB;AAAA,EACC;AAAA,EACA,2BAA2B;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,6BAA6B;AACtC,SAA0B,mBAAmB;AAM7C,MAAM,WAAW,eAAe;AAAA,EAC/B,uBAAuB,EAAE,IAAI,4BAA4B,gBAAgB,sBAAsB;AAAA,EAC/F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