@wildmio/excalidraw-common 0.18.0-custom.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (379) hide show
  1. package/README.md +19 -0
  2. package/dist/dev/index.js +2695 -0
  3. package/dist/dev/index.js.map +7 -0
  4. package/dist/prod/index.js +4 -0
  5. package/dist/types/common/src/binary-heap.d.ts +12 -0
  6. package/dist/types/common/src/bounds.d.ts +10 -0
  7. package/dist/types/common/src/colors.d.ts +62 -0
  8. package/dist/types/common/src/constants.d.ts +352 -0
  9. package/dist/types/common/src/editorInterface.d.ts +34 -0
  10. package/dist/types/common/src/emitter.d.ts +16 -0
  11. package/dist/types/common/src/font-metadata.d.ts +46 -0
  12. package/dist/types/common/src/index.d.ts +15 -0
  13. package/dist/types/common/src/keys.d.ts +189 -0
  14. package/dist/types/common/src/points.d.ts +9 -0
  15. package/dist/types/common/src/promise-pool.d.ts +6 -0
  16. package/dist/types/common/src/queue.d.ts +9 -0
  17. package/dist/types/common/src/random.d.ts +3 -0
  18. package/dist/types/common/src/url.d.ts +7 -0
  19. package/dist/types/common/src/utility-types.d.ts +37 -0
  20. package/dist/types/common/src/utils.d.ts +279 -0
  21. package/dist/types/common/src/visualdebug.d.ts +41 -0
  22. package/dist/types/element/src/Scene.d.ts +80 -0
  23. package/dist/types/element/src/align.d.ts +8 -0
  24. package/dist/types/element/src/binding.d.ts +124 -0
  25. package/dist/types/element/src/bounds.d.ts +81 -0
  26. package/dist/types/element/src/collision.d.ts +36 -0
  27. package/dist/types/element/src/comparisons.d.ts +8 -0
  28. package/dist/types/element/src/containerCache.d.ts +11 -0
  29. package/dist/types/element/src/cropElement.d.ts +19 -0
  30. package/dist/types/element/src/delta.d.ts +228 -0
  31. package/dist/types/element/src/distance.d.ts +3 -0
  32. package/dist/types/element/src/distribute.d.ts +7 -0
  33. package/dist/types/element/src/dragElements.d.ts +33 -0
  34. package/dist/types/element/src/duplicate.d.ts +63 -0
  35. package/dist/types/element/src/elbowArrow.d.ts +17 -0
  36. package/dist/types/element/src/elementLink.d.ts +13 -0
  37. package/dist/types/element/src/embeddable.d.ts +10 -0
  38. package/dist/types/element/src/flowchart.d.ts +26 -0
  39. package/dist/types/element/src/fractionalIndex.d.ts +57 -0
  40. package/dist/types/element/src/frame.d.ts +74 -0
  41. package/dist/types/element/src/groups.d.ts +34 -0
  42. package/dist/types/element/src/heading.d.ts +16 -0
  43. package/dist/types/element/src/image.d.ts +22 -0
  44. package/dist/types/element/src/index.d.ts +56 -0
  45. package/dist/types/element/src/linearElementEditor.d.ts +113 -0
  46. package/dist/types/element/src/mutateElement.d.ts +23 -0
  47. package/dist/types/element/src/newElement.d.ts +62 -0
  48. package/dist/types/element/src/positionElementsOnGrid.d.ts +2 -0
  49. package/dist/types/element/src/renderElement.d.ts +31 -0
  50. package/dist/types/element/src/resizeElements.d.ts +32 -0
  51. package/dist/types/element/src/resizeTest.d.ts +16 -0
  52. package/dist/types/element/src/selection.d.ts +34 -0
  53. package/dist/types/element/src/shape.d.ts +42 -0
  54. package/dist/types/element/src/showSelectedShapeActions.d.ts +3 -0
  55. package/dist/types/element/src/sizeHelpers.d.ts +35 -0
  56. package/dist/types/element/src/sortElements.d.ts +2 -0
  57. package/dist/types/element/src/store.d.ts +237 -0
  58. package/dist/types/element/src/textElement.d.ts +40 -0
  59. package/dist/types/element/src/textMeasurements.d.ts +39 -0
  60. package/dist/types/element/src/textWrapping.d.ts +13 -0
  61. package/dist/types/element/src/transform.d.ts +81 -0
  62. package/dist/types/element/src/transformHandles.d.ts +36 -0
  63. package/dist/types/element/src/typeChecks.d.ts +54 -0
  64. package/dist/types/element/src/types.d.ts +291 -0
  65. package/dist/types/element/src/utils.d.ts +34 -0
  66. package/dist/types/element/src/zindex.d.ts +13 -0
  67. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +485 -0
  68. package/dist/types/excalidraw/actions/actionAlign.d.ts +109 -0
  69. package/dist/types/excalidraw/actions/actionBoundText.d.ts +360 -0
  70. package/dist/types/excalidraw/actions/actionCanvas.d.ts +2059 -0
  71. package/dist/types/excalidraw/actions/actionClipboard.d.ts +399 -0
  72. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +174 -0
  73. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +519 -0
  74. package/dist/types/excalidraw/actions/actionDistribute.d.ts +34 -0
  75. package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +17 -0
  76. package/dist/types/excalidraw/actions/actionElementLink.d.ts +194 -0
  77. package/dist/types/excalidraw/actions/actionElementLock.d.ts +346 -0
  78. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +171 -0
  79. package/dist/types/excalidraw/actions/actionExport.d.ts +683 -0
  80. package/dist/types/excalidraw/actions/actionFinalize.d.ts +13 -0
  81. package/dist/types/excalidraw/actions/actionFlip.d.ts +34 -0
  82. package/dist/types/excalidraw/actions/actionFrame.d.ts +1150 -0
  83. package/dist/types/excalidraw/actions/actionGroup.d.ts +350 -0
  84. package/dist/types/excalidraw/actions/actionHistory.d.ts +6 -0
  85. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +659 -0
  86. package/dist/types/excalidraw/actions/actionLink.d.ts +175 -0
  87. package/dist/types/excalidraw/actions/actionMenu.d.ts +163 -0
  88. package/dist/types/excalidraw/actions/actionNavigate.d.ts +20 -0
  89. package/dist/types/excalidraw/actions/actionProperties.d.ts +402 -0
  90. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +170 -0
  91. package/dist/types/excalidraw/actions/actionStyles.d.ts +188 -0
  92. package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +17 -0
  93. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +177 -0
  94. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +175 -0
  95. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +166 -0
  96. package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +19 -0
  97. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +174 -0
  98. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +175 -0
  99. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +175 -0
  100. package/dist/types/excalidraw/actions/actionZindex.d.ts +74 -0
  101. package/dist/types/excalidraw/actions/index.d.ts +28 -0
  102. package/dist/types/excalidraw/actions/manager.d.ts +21 -0
  103. package/dist/types/excalidraw/actions/register.d.ts +5 -0
  104. package/dist/types/excalidraw/actions/shortcuts.d.ts +4 -0
  105. package/dist/types/excalidraw/actions/types.d.ts +47 -0
  106. package/dist/types/excalidraw/analytics.d.ts +1 -0
  107. package/dist/types/excalidraw/animated-trail.d.ts +39 -0
  108. package/dist/types/excalidraw/animation-frame-handler.d.ts +16 -0
  109. package/dist/types/excalidraw/appState.d.ts +102 -0
  110. package/dist/types/excalidraw/charts.d.ts +27 -0
  111. package/dist/types/excalidraw/clients.d.ts +14 -0
  112. package/dist/types/excalidraw/clipboard.d.ts +105 -0
  113. package/dist/types/excalidraw/components/Actions.d.ts +47 -0
  114. package/dist/types/excalidraw/components/ActiveConfirmDialog.d.ts +4 -0
  115. package/dist/types/excalidraw/components/App.d.ts +563 -0
  116. package/dist/types/excalidraw/components/Avatar.d.ts +11 -0
  117. package/dist/types/excalidraw/components/BraveMeasureTextError.d.ts +2 -0
  118. package/dist/types/excalidraw/components/Button.d.ts +17 -0
  119. package/dist/types/excalidraw/components/ButtonIcon.d.ts +16 -0
  120. package/dist/types/excalidraw/components/ButtonSeparator.d.ts +1 -0
  121. package/dist/types/excalidraw/components/Card.d.ts +6 -0
  122. package/dist/types/excalidraw/components/CheckboxItem.d.ts +8 -0
  123. package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +10 -0
  124. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +23 -0
  125. package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +8 -0
  126. package/dist/types/excalidraw/components/ColorPicker/HotkeyLabel.d.ts +7 -0
  127. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +19 -0
  128. package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +10 -0
  129. package/dist/types/excalidraw/components/ColorPicker/PickerHeading.d.ts +5 -0
  130. package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +9 -0
  131. package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +9 -0
  132. package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +21 -0
  133. package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +20 -0
  134. package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +19 -0
  135. package/dist/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +2 -0
  136. package/dist/types/excalidraw/components/CommandPalette/types.d.ts +24 -0
  137. package/dist/types/excalidraw/components/ConfirmDialog.d.ts +10 -0
  138. package/dist/types/excalidraw/components/ContextMenu.d.ts +16 -0
  139. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +23 -0
  140. package/dist/types/excalidraw/components/DarkModeToggle.d.ts +7 -0
  141. package/dist/types/excalidraw/components/DefaultSidebar.d.ts +27 -0
  142. package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +4 -0
  143. package/dist/types/excalidraw/components/Dialog.d.ts +13 -0
  144. package/dist/types/excalidraw/components/DialogActionButton.d.ts +10 -0
  145. package/dist/types/excalidraw/components/ElementCanvasButtons.d.ts +7 -0
  146. package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +12 -0
  147. package/dist/types/excalidraw/components/Ellipsify.d.ts +3 -0
  148. package/dist/types/excalidraw/components/ErrorDialog.d.ts +5 -0
  149. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +15 -0
  150. package/dist/types/excalidraw/components/EyeButton.d.ts +8 -0
  151. package/dist/types/excalidraw/components/EyeDropper.d.ts +27 -0
  152. package/dist/types/excalidraw/components/FilledButton.d.ts +18 -0
  153. package/dist/types/excalidraw/components/FixedSideContainer.d.ts +9 -0
  154. package/dist/types/excalidraw/components/FollowMode/FollowMode.d.ts +10 -0
  155. package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +22 -0
  156. package/dist/types/excalidraw/components/FontPicker/FontPickerList.d.ts +26 -0
  157. package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +8 -0
  158. package/dist/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +13 -0
  159. package/dist/types/excalidraw/components/HandButton.d.ts +10 -0
  160. package/dist/types/excalidraw/components/HelpButton.d.ts +7 -0
  161. package/dist/types/excalidraw/components/HelpDialog.d.ts +4 -0
  162. package/dist/types/excalidraw/components/HintViewer.d.ts +11 -0
  163. package/dist/types/excalidraw/components/IconPicker.d.ts +15 -0
  164. package/dist/types/excalidraw/components/ImageExportDialog.d.ts +14 -0
  165. package/dist/types/excalidraw/components/InitializeApp.d.ts +10 -0
  166. package/dist/types/excalidraw/components/InlineIcon.d.ts +5 -0
  167. package/dist/types/excalidraw/components/Island.d.ts +10 -0
  168. package/dist/types/excalidraw/components/JSONExportDialog.d.ts +15 -0
  169. package/dist/types/excalidraw/components/LaserPointerButton.d.ts +10 -0
  170. package/dist/types/excalidraw/components/LayerUI.d.ts +32 -0
  171. package/dist/types/excalidraw/components/LibraryMenu.d.ts +10 -0
  172. package/dist/types/excalidraw/components/LibraryMenuBrowseButton.d.ts +7 -0
  173. package/dist/types/excalidraw/components/LibraryMenuControlButtons.d.ts +9 -0
  174. package/dist/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +17 -0
  175. package/dist/types/excalidraw/components/LibraryMenuItems.d.ts +14 -0
  176. package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +23 -0
  177. package/dist/types/excalidraw/components/LibraryUnit.d.ts +14 -0
  178. package/dist/types/excalidraw/components/LoadingMessage.d.ts +5 -0
  179. package/dist/types/excalidraw/components/LockButton.d.ts +10 -0
  180. package/dist/types/excalidraw/components/MagicButton.d.ts +10 -0
  181. package/dist/types/excalidraw/components/MobileMenu.d.ts +24 -0
  182. package/dist/types/excalidraw/components/MobileToolBar.d.ts +10 -0
  183. package/dist/types/excalidraw/components/Modal.d.ts +11 -0
  184. package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirm.d.ts +17 -0
  185. package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmActions.d.ts +17 -0
  186. package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +22 -0
  187. package/dist/types/excalidraw/components/PasteChartDialog.d.ts +8 -0
  188. package/dist/types/excalidraw/components/PenModeButton.d.ts +12 -0
  189. package/dist/types/excalidraw/components/Popover.d.ts +16 -0
  190. package/dist/types/excalidraw/components/ProjectName.d.ts +10 -0
  191. package/dist/types/excalidraw/components/PropertiesPopover.d.ts +16 -0
  192. package/dist/types/excalidraw/components/PublishLibrary.d.ts +16 -0
  193. package/dist/types/excalidraw/components/QuickSearch.d.ts +9 -0
  194. package/dist/types/excalidraw/components/RadioGroup.d.ts +13 -0
  195. package/dist/types/excalidraw/components/RadioSelection.d.ts +20 -0
  196. package/dist/types/excalidraw/components/Range.d.ts +8 -0
  197. package/dist/types/excalidraw/components/SVGLayer.d.ts +7 -0
  198. package/dist/types/excalidraw/components/ScrollableList.d.ts +8 -0
  199. package/dist/types/excalidraw/components/SearchMenu.d.ts +5 -0
  200. package/dist/types/excalidraw/components/Section.d.ts +6 -0
  201. package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +70 -0
  202. package/dist/types/excalidraw/components/Sidebar/SidebarHeader.d.ts +7 -0
  203. package/dist/types/excalidraw/components/Sidebar/SidebarTab.d.ts +8 -0
  204. package/dist/types/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +9 -0
  205. package/dist/types/excalidraw/components/Sidebar/SidebarTabTriggers.d.ts +6 -0
  206. package/dist/types/excalidraw/components/Sidebar/SidebarTabs.d.ts +6 -0
  207. package/dist/types/excalidraw/components/Sidebar/SidebarTrigger.d.ts +6 -0
  208. package/dist/types/excalidraw/components/Sidebar/common.d.ts +34 -0
  209. package/dist/types/excalidraw/components/Spinner.d.ts +8 -0
  210. package/dist/types/excalidraw/components/Stack.d.ts +15 -0
  211. package/dist/types/excalidraw/components/Stats/Angle.d.ts +11 -0
  212. package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +10 -0
  213. package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +10 -0
  214. package/dist/types/excalidraw/components/Stats/Dimension.d.ts +11 -0
  215. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +44 -0
  216. package/dist/types/excalidraw/components/Stats/FontSize.d.ts +11 -0
  217. package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +11 -0
  218. package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +14 -0
  219. package/dist/types/excalidraw/components/Stats/MultiFontSize.d.ts +12 -0
  220. package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +14 -0
  221. package/dist/types/excalidraw/components/Stats/Position.d.ts +12 -0
  222. package/dist/types/excalidraw/components/Stats/index.d.ts +35 -0
  223. package/dist/types/excalidraw/components/Stats/utils.d.ts +19 -0
  224. package/dist/types/excalidraw/components/Switch.d.ts +9 -0
  225. package/dist/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +6 -0
  226. package/dist/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +29 -0
  227. package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +9 -0
  228. package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +7 -0
  229. package/dist/types/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +17 -0
  230. package/dist/types/excalidraw/components/TTDDialog/TTDDialogPanels.d.ts +4 -0
  231. package/dist/types/excalidraw/components/TTDDialog/TTDDialogSubmitShortcut.d.ts +1 -0
  232. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTab.d.ts +7 -0
  233. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTrigger.d.ts +8 -0
  234. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTriggers.d.ts +6 -0
  235. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabs.d.ts +11 -0
  236. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +8 -0
  237. package/dist/types/excalidraw/components/TTDDialog/common.d.ts +32 -0
  238. package/dist/types/excalidraw/components/TextField.d.ts +22 -0
  239. package/dist/types/excalidraw/components/Toast.d.ts +9 -0
  240. package/dist/types/excalidraw/components/ToolButton.d.ts +49 -0
  241. package/dist/types/excalidraw/components/ToolPopover.d.ts +25 -0
  242. package/dist/types/excalidraw/components/Tooltip.d.ts +18 -0
  243. package/dist/types/excalidraw/components/Trans.d.ts +9 -0
  244. package/dist/types/excalidraw/components/UnlockPopup.d.ts +8 -0
  245. package/dist/types/excalidraw/components/UserList.d.ts +18 -0
  246. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +33 -0
  247. package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +14 -0
  248. package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +19 -0
  249. package/dist/types/excalidraw/components/canvases/index.d.ts +3 -0
  250. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +84 -0
  251. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +16 -0
  252. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuGroup.d.ts +11 -0
  253. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +38 -0
  254. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +8 -0
  255. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +17 -0
  256. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.d.ts +7 -0
  257. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +16 -0
  258. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSeparator.d.ts +5 -0
  259. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuTrigger.d.ts +10 -0
  260. package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +6 -0
  261. package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +3 -0
  262. package/dist/types/excalidraw/components/footer/Footer.d.ts +17 -0
  263. package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +8 -0
  264. package/dist/types/excalidraw/components/hoc/withInternalFallback.d.ts +4 -0
  265. package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +19 -0
  266. package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +10 -0
  267. package/dist/types/excalidraw/components/icons.d.ts +237 -0
  268. package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +11 -0
  269. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +64 -0
  270. package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +76 -0
  271. package/dist/types/excalidraw/components/shapes.d.ts +190 -0
  272. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +58 -0
  273. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +19 -0
  274. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +84 -0
  275. package/dist/types/excalidraw/context/tunnels.d.ts +21 -0
  276. package/dist/types/excalidraw/context/ui-appState.d.ts +4 -0
  277. package/dist/types/excalidraw/cursor.d.ts +5 -0
  278. package/dist/types/excalidraw/data/EditorLocalStorage.d.ts +8 -0
  279. package/dist/types/excalidraw/data/blob.d.ts +57 -0
  280. package/dist/types/excalidraw/data/encode.d.ts +55 -0
  281. package/dist/types/excalidraw/data/encryption.d.ts +9 -0
  282. package/dist/types/excalidraw/data/filesystem.d.ts +21 -0
  283. package/dist/types/excalidraw/data/image.d.ts +9 -0
  284. package/dist/types/excalidraw/data/index.d.ts +22 -0
  285. package/dist/types/excalidraw/data/json.d.ts +18 -0
  286. package/dist/types/excalidraw/data/library.d.ts +127 -0
  287. package/dist/types/excalidraw/data/reconcile.d.ts +7 -0
  288. package/dist/types/excalidraw/data/resave.d.ts +5 -0
  289. package/dist/types/excalidraw/data/restore.d.ts +35 -0
  290. package/dist/types/excalidraw/data/types.d.ts +48 -0
  291. package/dist/types/excalidraw/deburr.d.ts +1 -0
  292. package/dist/types/excalidraw/editor-jotai.d.ts +56 -0
  293. package/dist/types/excalidraw/eraser/index.d.ts +12 -0
  294. package/dist/types/excalidraw/errors.d.ts +29 -0
  295. package/dist/types/excalidraw/fonts/Cascadia/index.d.ts +2 -0
  296. package/dist/types/excalidraw/fonts/ComicShanns/index.d.ts +2 -0
  297. package/dist/types/excalidraw/fonts/Emoji/index.d.ts +2 -0
  298. package/dist/types/excalidraw/fonts/ExcalidrawFontFace.d.ts +25 -0
  299. package/dist/types/excalidraw/fonts/Excalifont/index.d.ts +2 -0
  300. package/dist/types/excalidraw/fonts/Fonts.d.ts +79 -0
  301. package/dist/types/excalidraw/fonts/Helvetica/index.d.ts +2 -0
  302. package/dist/types/excalidraw/fonts/Liberation/index.d.ts +2 -0
  303. package/dist/types/excalidraw/fonts/Lilita/index.d.ts +2 -0
  304. package/dist/types/excalidraw/fonts/Nunito/index.d.ts +2 -0
  305. package/dist/types/excalidraw/fonts/Virgil/index.d.ts +2 -0
  306. package/dist/types/excalidraw/fonts/Xiaolai/index.d.ts +8 -0
  307. package/dist/types/excalidraw/fonts/index.d.ts +1 -0
  308. package/dist/types/excalidraw/gesture.d.ts +6 -0
  309. package/dist/types/excalidraw/history.d.ts +48 -0
  310. package/dist/types/excalidraw/hooks/useCallbackRefState.d.ts +1 -0
  311. package/dist/types/excalidraw/hooks/useCopiedIndicator.d.ts +5 -0
  312. package/dist/types/excalidraw/hooks/useCreatePortalContainer.d.ts +4 -0
  313. package/dist/types/excalidraw/hooks/useEmitter.d.ts +2 -0
  314. package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +11 -0
  315. package/dist/types/excalidraw/hooks/useOutsideClick.d.ts +21 -0
  316. package/dist/types/excalidraw/hooks/useScrollPosition.d.ts +1 -0
  317. package/dist/types/excalidraw/hooks/useStable.d.ts +1 -0
  318. package/dist/types/excalidraw/hooks/useStableCallback.d.ts +4 -0
  319. package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
  320. package/dist/types/excalidraw/hooks/useTransition.d.ts +2 -0
  321. package/dist/types/excalidraw/i18n.d.ts +24 -0
  322. package/dist/types/excalidraw/index.d.ts +45 -0
  323. package/dist/types/excalidraw/laser-trails.d.ts +20 -0
  324. package/dist/types/excalidraw/lasso/index.d.ts +16 -0
  325. package/dist/types/excalidraw/lasso/utils.d.ts +13 -0
  326. package/dist/types/excalidraw/mermaid.d.ts +2 -0
  327. package/dist/types/excalidraw/polyfill.d.ts +2 -0
  328. package/dist/types/excalidraw/reactUtils.d.ts +14 -0
  329. package/dist/types/excalidraw/renderer/animation.d.ts +12 -0
  330. package/dist/types/excalidraw/renderer/helpers.d.ts +16 -0
  331. package/dist/types/excalidraw/renderer/interactiveScene.d.ts +14 -0
  332. package/dist/types/excalidraw/renderer/renderNewElementScene.d.ts +7 -0
  333. package/dist/types/excalidraw/renderer/renderSnaps.d.ts +2 -0
  334. package/dist/types/excalidraw/renderer/roundRect.d.ts +11 -0
  335. package/dist/types/excalidraw/renderer/staticScene.d.ts +14 -0
  336. package/dist/types/excalidraw/renderer/staticSvgScene.d.ts +5 -0
  337. package/dist/types/excalidraw/scene/Renderer.d.ts +30 -0
  338. package/dist/types/excalidraw/scene/export.d.ts +36 -0
  339. package/dist/types/excalidraw/scene/index.d.ts +4 -0
  340. package/dist/types/excalidraw/scene/normalize.d.ts +4 -0
  341. package/dist/types/excalidraw/scene/scroll.d.ts +18 -0
  342. package/dist/types/excalidraw/scene/scrollbars.d.ts +11 -0
  343. package/dist/types/excalidraw/scene/types.d.ts +132 -0
  344. package/dist/types/excalidraw/scene/zoom.d.ts +12 -0
  345. package/dist/types/excalidraw/shortcut.d.ts +1 -0
  346. package/dist/types/excalidraw/snapping.d.ts +111 -0
  347. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-bindings.d.ts +45 -0
  348. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-loader.d.ts +13 -0
  349. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-wasm.d.ts +2 -0
  350. package/dist/types/excalidraw/subset/subset-main.d.ts +12 -0
  351. package/dist/types/excalidraw/subset/subset-shared.chunk.d.ts +32 -0
  352. package/dist/types/excalidraw/subset/subset-worker.chunk.d.ts +15 -0
  353. package/dist/types/excalidraw/subset/woff2/woff2-bindings.d.ts +31 -0
  354. package/dist/types/excalidraw/subset/woff2/woff2-loader.d.ts +14 -0
  355. package/dist/types/excalidraw/subset/woff2/woff2-wasm.d.ts +2 -0
  356. package/dist/types/excalidraw/types.d.ts +744 -0
  357. package/dist/types/excalidraw/workers.d.ts +36 -0
  358. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +24 -0
  359. package/dist/types/math/src/angle.d.ts +19 -0
  360. package/dist/types/math/src/constants.d.ts +3 -0
  361. package/dist/types/math/src/curve.d.ts +74 -0
  362. package/dist/types/math/src/ellipse.d.ts +44 -0
  363. package/dist/types/math/src/index.d.ts +13 -0
  364. package/dist/types/math/src/line.d.ts +17 -0
  365. package/dist/types/math/src/point.d.ts +122 -0
  366. package/dist/types/math/src/polygon.d.ts +6 -0
  367. package/dist/types/math/src/range.d.ts +44 -0
  368. package/dist/types/math/src/rectangle.d.ts +5 -0
  369. package/dist/types/math/src/segment.d.ts +40 -0
  370. package/dist/types/math/src/triangle.d.ts +11 -0
  371. package/dist/types/math/src/types.d.ts +106 -0
  372. package/dist/types/math/src/utils.d.ts +7 -0
  373. package/dist/types/math/src/vector.d.ts +94 -0
  374. package/dist/types/utils/src/bbox.d.ts +9 -0
  375. package/dist/types/utils/src/export.d.ts +35 -0
  376. package/dist/types/utils/src/index.d.ts +4 -0
  377. package/dist/types/utils/src/shape.d.ts +58 -0
  378. package/dist/types/utils/src/withinBounds.d.ts +19 -0
  379. package/package.json +59 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["<define:import.meta.env>", "../../../../node_modules/es6-promise-pool/es6-promise-pool.js", "../../../../node_modules/@braintree/sanitize-url/dist/index.js", "../../src/index.ts", "../../src/binary-heap.ts", "../../src/bounds.ts", "../../src/colors.ts", "../../../../node_modules/open-color/open-color.json", "../../src/constants.ts", "../../src/font-metadata.ts", "../../src/queue.ts", "../../src/keys.ts", "../../src/editorInterface.ts", "../../src/points.ts", "../../src/promise-pool.ts", "../../src/random.ts", "../../../../node_modules/nanoid/index.browser.js", "../../../../node_modules/nanoid/url-alphabet/index.js", "../../../../node_modules/roughjs/bin/math.js", "../../src/utils.ts", "../../src/url.ts", "../../src/emitter.ts", "../../src/visualdebug.ts"],
4
+ "sourcesContent": ["", "(function (root, factory) {\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define([], factory)\n } else if (typeof exports === 'object') {\n module.exports = factory()\n } else {\n root.PromisePool = factory()\n // Legacy API\n root.promisePool = root.PromisePool\n }\n})(this, function () {\n 'use strict'\n\n var EventTarget = function () {\n this._listeners = {}\n }\n\n EventTarget.prototype.addEventListener = function (type, listener) {\n this._listeners[type] = this._listeners[type] || []\n if (this._listeners[type].indexOf(listener) < 0) {\n this._listeners[type].push(listener)\n }\n }\n\n EventTarget.prototype.removeEventListener = function (type, listener) {\n if (this._listeners[type]) {\n var p = this._listeners[type].indexOf(listener)\n if (p >= 0) {\n this._listeners[type].splice(p, 1)\n }\n }\n }\n\n EventTarget.prototype.dispatchEvent = function (evt) {\n if (this._listeners[evt.type] && this._listeners[evt.type].length) {\n var listeners = this._listeners[evt.type].slice()\n for (var i = 0, l = listeners.length; i < l; ++i) {\n listeners[i].call(this, evt)\n }\n }\n }\n\n var isGenerator = function (func) {\n return (typeof func.constructor === 'function' &&\n func.constructor.name === 'GeneratorFunction')\n }\n\n var functionToIterator = function (func) {\n return {\n next: function () {\n var promise = func()\n return promise ? {value: promise} : {done: true}\n }\n }\n }\n\n var promiseToIterator = function (promise) {\n var called = false\n return {\n next: function () {\n if (called) {\n return {done: true}\n }\n called = true\n return {value: promise}\n }\n }\n }\n\n var toIterator = function (obj, Promise) {\n var type = typeof obj\n if (type === 'object') {\n if (typeof obj.next === 'function') {\n return obj\n }\n /* istanbul ignore else */\n if (typeof obj.then === 'function') {\n return promiseToIterator(obj)\n }\n }\n if (type === 'function') {\n return isGenerator(obj) ? obj() : functionToIterator(obj)\n }\n return promiseToIterator(Promise.resolve(obj))\n }\n\n var PromisePoolEvent = function (target, type, data) {\n this.target = target\n this.type = type\n this.data = data\n }\n\n var PromisePool = function (source, concurrency, options) {\n EventTarget.call(this)\n if (typeof concurrency !== 'number' ||\n Math.floor(concurrency) !== concurrency ||\n concurrency < 1) {\n throw new Error('Invalid concurrency')\n }\n this._concurrency = concurrency\n this._options = options || {}\n this._options.promise = this._options.promise || Promise\n this._iterator = toIterator(source, this._options.promise)\n this._done = false\n this._size = 0\n this._promise = null\n this._callbacks = null\n }\n PromisePool.prototype = new EventTarget()\n PromisePool.prototype.constructor = PromisePool\n\n PromisePool.prototype.concurrency = function (value) {\n if (typeof value !== 'undefined') {\n this._concurrency = value\n if (this.active()) {\n this._proceed()\n }\n }\n return this._concurrency\n }\n\n PromisePool.prototype.size = function () {\n return this._size\n }\n\n PromisePool.prototype.active = function () {\n return !!this._promise\n }\n\n PromisePool.prototype.promise = function () {\n return this._promise\n }\n\n PromisePool.prototype.start = function () {\n var that = this\n var Promise = this._options.promise\n this._promise = new Promise(function (resolve, reject) {\n that._callbacks = {\n reject: reject,\n resolve: resolve\n }\n that._proceed()\n })\n return this._promise\n }\n\n PromisePool.prototype._fireEvent = function (type, data) {\n this.dispatchEvent(new PromisePoolEvent(this, type, data))\n }\n\n PromisePool.prototype._settle = function (error) {\n if (error) {\n this._callbacks.reject(error)\n } else {\n this._callbacks.resolve()\n }\n this._promise = null\n this._callbacks = null\n }\n\n PromisePool.prototype._onPooledPromiseFulfilled = function (promise, result) {\n this._size--\n if (this.active()) {\n this._fireEvent('fulfilled', {\n promise: promise,\n result: result\n })\n this._proceed()\n }\n }\n\n PromisePool.prototype._onPooledPromiseRejected = function (promise, error) {\n this._size--\n if (this.active()) {\n this._fireEvent('rejected', {\n promise: promise,\n error: error\n })\n this._settle(error || new Error('Unknown error'))\n }\n }\n\n PromisePool.prototype._trackPromise = function (promise) {\n var that = this\n promise\n .then(function (result) {\n that._onPooledPromiseFulfilled(promise, result)\n }, function (error) {\n that._onPooledPromiseRejected(promise, error)\n })['catch'](function (err) {\n that._settle(new Error('Promise processing failed: ' + err))\n })\n }\n\n PromisePool.prototype._proceed = function () {\n if (!this._done) {\n var result = { done: false }\n while (this._size < this._concurrency &&\n !(result = this._iterator.next()).done) {\n this._size++\n this._trackPromise(result.value)\n }\n this._done = (result === null || !!result.done)\n }\n if (this._done && this._size === 0) {\n this._settle()\n }\n }\n\n PromisePool.PromisePoolEvent = PromisePoolEvent\n // Legacy API\n PromisePool.PromisePool = PromisePool\n\n return PromisePool\n})\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sanitizeUrl = void 0;\nvar invalidProtocolRegex = /^([^\\w]*)(javascript|data|vbscript)/im;\nvar htmlEntitiesRegex = /&#(\\w+)(^\\w|;)?/g;\nvar htmlCtrlEntityRegex = /&(newline|tab);/gi;\nvar ctrlCharactersRegex = /[\\u0000-\\u001F\\u007F-\\u009F\\u2000-\\u200D\\uFEFF]/gim;\nvar urlSchemeRegex = /^.+(:|&colon;)/gim;\nvar relativeFirstCharacters = [\".\", \"/\"];\nfunction isRelativeUrlWithoutProtocol(url) {\n return relativeFirstCharacters.indexOf(url[0]) > -1;\n}\n// adapted from https://stackoverflow.com/a/29824550/2601552\nfunction decodeHtmlCharacters(str) {\n return str.replace(htmlEntitiesRegex, function (match, dec) {\n return String.fromCharCode(dec);\n });\n}\nfunction sanitizeUrl(url) {\n var sanitizedUrl = decodeHtmlCharacters(url || \"\")\n .replace(htmlCtrlEntityRegex, \"\")\n .replace(ctrlCharactersRegex, \"\")\n .trim();\n if (!sanitizedUrl) {\n return \"about:blank\";\n }\n if (isRelativeUrlWithoutProtocol(sanitizedUrl)) {\n return sanitizedUrl;\n }\n var urlSchemeParseResults = sanitizedUrl.match(urlSchemeRegex);\n if (!urlSchemeParseResults) {\n return sanitizedUrl;\n }\n var urlScheme = urlSchemeParseResults[0];\n if (invalidProtocolRegex.test(urlScheme)) {\n return \"about:blank\";\n }\n return sanitizedUrl;\n}\nexports.sanitizeUrl = sanitizeUrl;\n", "export * from \"./binary-heap\";\nexport * from \"./bounds\";\nexport * from \"./colors\";\nexport * from \"./constants\";\nexport * from \"./font-metadata\";\nexport * from \"./queue\";\nexport * from \"./keys\";\nexport * from \"./points\";\nexport * from \"./promise-pool\";\nexport * from \"./random\";\nexport * from \"./url\";\nexport * from \"./utils\";\nexport * from \"./emitter\";\nexport * from \"./visualdebug\";\nexport * from \"./editorInterface\";\n", "export class BinaryHeap<T> {\n private content: T[] = [];\n\n constructor(private scoreFunction: (node: T) => number) {}\n\n sinkDown(idx: number) {\n const node = this.content[idx];\n const nodeScore = this.scoreFunction(node);\n while (idx > 0) {\n const parentN = ((idx + 1) >> 1) - 1;\n const parent = this.content[parentN];\n if (nodeScore < this.scoreFunction(parent)) {\n this.content[idx] = parent;\n idx = parentN; // TODO: Optimize\n } else {\n break;\n }\n }\n this.content[idx] = node;\n }\n\n bubbleUp(idx: number) {\n const length = this.content.length;\n const node = this.content[idx];\n const score = this.scoreFunction(node);\n\n while (true) {\n const child1N = ((idx + 1) << 1) - 1;\n const child2N = child1N + 1;\n let smallestIdx = idx;\n let smallestScore = score;\n\n // Check left child\n if (child1N < length) {\n const child1Score = this.scoreFunction(this.content[child1N]);\n if (child1Score < smallestScore) {\n smallestIdx = child1N;\n smallestScore = child1Score;\n }\n }\n\n // Check right child\n if (child2N < length) {\n const child2Score = this.scoreFunction(this.content[child2N]);\n if (child2Score < smallestScore) {\n smallestIdx = child2N;\n }\n }\n\n if (smallestIdx === idx) {\n break;\n }\n\n // Move the smaller child up, continue finding position for node\n this.content[idx] = this.content[smallestIdx];\n idx = smallestIdx;\n }\n\n // Place node in its final position\n this.content[idx] = node;\n }\n\n push(node: T) {\n this.content.push(node);\n this.sinkDown(this.content.length - 1);\n }\n\n pop(): T | null {\n if (this.content.length === 0) {\n return null;\n }\n\n const result = this.content[0];\n const end = this.content.pop()!;\n\n if (this.content.length > 0) {\n this.content[0] = end;\n this.bubbleUp(0);\n }\n\n return result;\n }\n\n remove(node: T) {\n if (this.content.length === 0) {\n return;\n }\n\n const i = this.content.indexOf(node);\n const end = this.content.pop()!;\n\n if (i < this.content.length) {\n this.content[i] = end;\n\n if (this.scoreFunction(end) < this.scoreFunction(node)) {\n this.sinkDown(i);\n } else {\n this.bubbleUp(i);\n }\n }\n }\n\n size(): number {\n return this.content.length;\n }\n\n rescoreElement(node: T) {\n this.sinkDown(this.content.indexOf(node));\n }\n}\n", "/**\n * x and y position of top left corner, x and y position of bottom right corner\n */\nexport type Bounds = readonly [\n minX: number,\n minY: number,\n maxX: number,\n maxY: number,\n];\n\nexport const isBounds = (box: unknown): box is Bounds =>\n Array.isArray(box) &&\n box.length === 4 &&\n typeof box[0] === \"number\" &&\n typeof box[1] === \"number\" &&\n typeof box[2] === \"number\" &&\n typeof box[3] === \"number\";\n", "import oc from \"open-color\";\n\nimport type { Merge } from \"./utility-types\";\n\nexport const COLOR_OUTLINE_CONTRAST_THRESHOLD = 240;\n\n// FIXME can't put to utils.ts rn because of circular dependency\nconst pick = <R extends Record<string, any>, K extends readonly (keyof R)[]>(\n source: R,\n keys: K,\n) => {\n return keys.reduce((acc, key: K[number]) => {\n if (key in source) {\n acc[key] = source[key];\n }\n return acc;\n }, {} as Pick<R, K[number]>) as Pick<R, K[number]>;\n};\n\nexport type ColorPickerColor =\n | Exclude<keyof oc, \"indigo\" | \"lime\">\n | \"transparent\"\n | \"bronze\";\nexport type ColorTuple = readonly [string, string, string, string, string];\nexport type ColorPalette = Merge<\n Record<ColorPickerColor, ColorTuple>,\n { black: \"#1e1e1e\"; white: \"#ffffff\"; transparent: \"transparent\" }\n>;\n\n// used general type instead of specific type (ColorPalette) to support custom colors\nexport type ColorPaletteCustom = { [key: string]: ColorTuple | string };\nexport type ColorShadesIndexes = [number, number, number, number, number];\n\nexport const MAX_CUSTOM_COLORS_USED_IN_CANVAS = 5;\nexport const COLORS_PER_ROW = 5;\n\nexport const DEFAULT_CHART_COLOR_INDEX = 4;\n\nexport const DEFAULT_ELEMENT_STROKE_COLOR_INDEX = 4;\nexport const DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX = 1;\nexport const ELEMENTS_PALETTE_SHADE_INDEXES = [0, 2, 4, 6, 8] as const;\nexport const CANVAS_PALETTE_SHADE_INDEXES = [0, 1, 2, 3, 4] as const;\n\nexport const getSpecificColorShades = (\n color: Exclude<\n ColorPickerColor,\n \"transparent\" | \"white\" | \"black\" | \"bronze\"\n >,\n indexArr: Readonly<ColorShadesIndexes>,\n) => {\n return indexArr.map((index) => oc[color][index]) as any as ColorTuple;\n};\n\nexport const COLOR_PALETTE = {\n transparent: \"transparent\",\n black: \"#1e1e1e\",\n white: \"#ffffff\",\n // open-colors\n gray: getSpecificColorShades(\"gray\", ELEMENTS_PALETTE_SHADE_INDEXES),\n red: getSpecificColorShades(\"red\", ELEMENTS_PALETTE_SHADE_INDEXES),\n pink: getSpecificColorShades(\"pink\", ELEMENTS_PALETTE_SHADE_INDEXES),\n grape: getSpecificColorShades(\"grape\", ELEMENTS_PALETTE_SHADE_INDEXES),\n violet: getSpecificColorShades(\"violet\", ELEMENTS_PALETTE_SHADE_INDEXES),\n blue: getSpecificColorShades(\"blue\", ELEMENTS_PALETTE_SHADE_INDEXES),\n cyan: getSpecificColorShades(\"cyan\", ELEMENTS_PALETTE_SHADE_INDEXES),\n teal: getSpecificColorShades(\"teal\", ELEMENTS_PALETTE_SHADE_INDEXES),\n green: getSpecificColorShades(\"green\", ELEMENTS_PALETTE_SHADE_INDEXES),\n yellow: getSpecificColorShades(\"yellow\", ELEMENTS_PALETTE_SHADE_INDEXES),\n orange: getSpecificColorShades(\"orange\", ELEMENTS_PALETTE_SHADE_INDEXES),\n // radix bronze shades 3,5,7,9,11\n bronze: [\"#f8f1ee\", \"#eaddd7\", \"#d2bab0\", \"#a18072\", \"#846358\"],\n} as ColorPalette;\n\nconst COMMON_ELEMENT_SHADES = pick(COLOR_PALETTE, [\n \"cyan\",\n \"blue\",\n \"violet\",\n \"grape\",\n \"pink\",\n \"green\",\n \"teal\",\n \"yellow\",\n \"orange\",\n \"red\",\n]);\n\n// -----------------------------------------------------------------------------\n// quick picks defaults\n// -----------------------------------------------------------------------------\n\n// ORDER matters for positioning in quick picker\nexport const DEFAULT_ELEMENT_STROKE_PICKS = [\n COLOR_PALETTE.black,\n COLOR_PALETTE.red[DEFAULT_ELEMENT_STROKE_COLOR_INDEX],\n COLOR_PALETTE.green[DEFAULT_ELEMENT_STROKE_COLOR_INDEX],\n COLOR_PALETTE.blue[DEFAULT_ELEMENT_STROKE_COLOR_INDEX],\n COLOR_PALETTE.yellow[DEFAULT_ELEMENT_STROKE_COLOR_INDEX],\n] as ColorTuple;\n\n// ORDER matters for positioning in quick picker\nexport const DEFAULT_ELEMENT_BACKGROUND_PICKS = [\n COLOR_PALETTE.transparent,\n COLOR_PALETTE.red[DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX],\n COLOR_PALETTE.green[DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX],\n COLOR_PALETTE.blue[DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX],\n COLOR_PALETTE.yellow[DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX],\n] as ColorTuple;\n\n// ORDER matters for positioning in quick picker\nexport const DEFAULT_CANVAS_BACKGROUND_PICKS = [\n COLOR_PALETTE.white,\n // radix slate2\n \"#f8f9fa\",\n // radix blue2\n \"#f5faff\",\n // radix yellow2\n \"#fffce8\",\n // radix bronze2\n \"#fdf8f6\",\n] as ColorTuple;\n\n// -----------------------------------------------------------------------------\n// palette defaults\n// -----------------------------------------------------------------------------\n\nexport const DEFAULT_ELEMENT_STROKE_COLOR_PALETTE = {\n // 1st row\n transparent: COLOR_PALETTE.transparent,\n white: COLOR_PALETTE.white,\n gray: COLOR_PALETTE.gray,\n black: COLOR_PALETTE.black,\n bronze: COLOR_PALETTE.bronze,\n // rest\n ...COMMON_ELEMENT_SHADES,\n} as const;\n\n// ORDER matters for positioning in pallete (5x3 grid)s\nexport const DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE = {\n transparent: COLOR_PALETTE.transparent,\n white: COLOR_PALETTE.white,\n gray: COLOR_PALETTE.gray,\n black: COLOR_PALETTE.black,\n bronze: COLOR_PALETTE.bronze,\n\n ...COMMON_ELEMENT_SHADES,\n} as const;\n\n// -----------------------------------------------------------------------------\n// helpers\n// -----------------------------------------------------------------------------\n\n// !!!MUST BE WITHOUT GRAY, TRANSPARENT AND BLACK!!!\nexport const getAllColorsSpecificShade = (index: 0 | 1 | 2 | 3 | 4) =>\n [\n // 2nd row\n COLOR_PALETTE.cyan[index],\n COLOR_PALETTE.blue[index],\n COLOR_PALETTE.violet[index],\n COLOR_PALETTE.grape[index],\n COLOR_PALETTE.pink[index],\n\n // 3rd row\n COLOR_PALETTE.green[index],\n COLOR_PALETTE.teal[index],\n COLOR_PALETTE.yellow[index],\n COLOR_PALETTE.orange[index],\n COLOR_PALETTE.red[index],\n ] as const;\n\nexport const rgbToHex = (r: number, g: number, b: number) =>\n `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)}`;\n\n// -----------------------------------------------------------------------------\n", "{\n \"white\": \"#ffffff\",\n \"black\": \"#000000\",\n \"gray\": [\n \"#f8f9fa\",\n \"#f1f3f5\",\n \"#e9ecef\",\n \"#dee2e6\",\n \"#ced4da\",\n \"#adb5bd\",\n \"#868e96\",\n \"#495057\",\n \"#343a40\",\n \"#212529\"\n ],\n \"red\": [\n \"#fff5f5\",\n \"#ffe3e3\",\n \"#ffc9c9\",\n \"#ffa8a8\",\n \"#ff8787\",\n \"#ff6b6b\",\n \"#fa5252\",\n \"#f03e3e\",\n \"#e03131\",\n \"#c92a2a\"\n ],\n \"pink\": [\n \"#fff0f6\",\n \"#ffdeeb\",\n \"#fcc2d7\",\n \"#faa2c1\",\n \"#f783ac\",\n \"#f06595\",\n \"#e64980\",\n \"#d6336c\",\n \"#c2255c\",\n \"#a61e4d\"\n ],\n \"grape\": [\n \"#f8f0fc\",\n \"#f3d9fa\",\n \"#eebefa\",\n \"#e599f7\",\n \"#da77f2\",\n \"#cc5de8\",\n \"#be4bdb\",\n \"#ae3ec9\",\n \"#9c36b5\",\n \"#862e9c\"\n ],\n \"violet\": [\n \"#f3f0ff\",\n \"#e5dbff\",\n \"#d0bfff\",\n \"#b197fc\",\n \"#9775fa\",\n \"#845ef7\",\n \"#7950f2\",\n \"#7048e8\",\n \"#6741d9\",\n \"#5f3dc4\"\n ],\n \"indigo\": [\n \"#edf2ff\",\n \"#dbe4ff\",\n \"#bac8ff\",\n \"#91a7ff\",\n \"#748ffc\",\n \"#5c7cfa\",\n \"#4c6ef5\",\n \"#4263eb\",\n \"#3b5bdb\",\n \"#364fc7\"\n ],\n \"blue\": [\n \"#e7f5ff\",\n \"#d0ebff\",\n \"#a5d8ff\",\n \"#74c0fc\",\n \"#4dabf7\",\n \"#339af0\",\n \"#228be6\",\n \"#1c7ed6\",\n \"#1971c2\",\n \"#1864ab\"\n ],\n \"cyan\": [\n \"#e3fafc\",\n \"#c5f6fa\",\n \"#99e9f2\",\n \"#66d9e8\",\n \"#3bc9db\",\n \"#22b8cf\",\n \"#15aabf\",\n \"#1098ad\",\n \"#0c8599\",\n \"#0b7285\"\n ],\n \"teal\": [\n \"#e6fcf5\",\n \"#c3fae8\",\n \"#96f2d7\",\n \"#63e6be\",\n \"#38d9a9\",\n \"#20c997\",\n \"#12b886\",\n \"#0ca678\",\n \"#099268\",\n \"#087f5b\"\n ],\n \"green\": [\n \"#ebfbee\",\n \"#d3f9d8\",\n \"#b2f2bb\",\n \"#8ce99a\",\n \"#69db7c\",\n \"#51cf66\",\n \"#40c057\",\n \"#37b24d\",\n \"#2f9e44\",\n \"#2b8a3e\"\n ],\n \"lime\": [\n \"#f4fce3\",\n \"#e9fac8\",\n \"#d8f5a2\",\n \"#c0eb75\",\n \"#a9e34b\",\n \"#94d82d\",\n \"#82c91e\",\n \"#74b816\",\n \"#66a80f\",\n \"#5c940d\"\n ],\n \"yellow\": [\n \"#fff9db\",\n \"#fff3bf\",\n \"#ffec99\",\n \"#ffe066\",\n \"#ffd43b\",\n \"#fcc419\",\n \"#fab005\",\n \"#f59f00\",\n \"#f08c00\",\n \"#e67700\"\n ],\n \"orange\": [\n \"#fff4e6\",\n \"#ffe8cc\",\n \"#ffd8a8\",\n \"#ffc078\",\n \"#ffa94d\",\n \"#ff922b\",\n \"#fd7e14\",\n \"#f76707\",\n \"#e8590c\",\n \"#d9480f\"\n ]\n}", "import type {\n ExcalidrawElement,\n FontFamilyValues,\n} from \"@excalidraw/element/types\";\nimport type { AppProps, AppState } from \"@excalidraw/excalidraw/types\";\n\nimport { COLOR_PALETTE } from \"./colors\";\n\nexport const supportsResizeObserver =\n typeof window !== \"undefined\" && \"ResizeObserver\" in window;\n\nexport const APP_NAME = \"Excalidraw\";\n\n// distance when creating text before it's considered `autoResize: false`\n// we're using higher threshold so that clicks that end up being drags\n// don't unintentionally create text elements that are wrapped to a few chars\n// (happens a lot with fast clicks with the text tool)\nexport const TEXT_AUTOWRAP_THRESHOLD = 36; // px\nexport const DRAGGING_THRESHOLD = 10; // px\nexport const MINIMUM_ARROW_SIZE = 20; // px\nexport const LINE_CONFIRM_THRESHOLD = 8; // px\nexport const ELEMENT_SHIFT_TRANSLATE_AMOUNT = 5;\nexport const ELEMENT_TRANSLATE_AMOUNT = 1;\nexport const TEXT_TO_CENTER_SNAP_THRESHOLD = 30;\nexport const SHIFT_LOCKING_ANGLE = Math.PI / 12;\nexport const DEFAULT_LASER_COLOR = \"red\";\nexport const CURSOR_TYPE = {\n TEXT: \"text\",\n CROSSHAIR: \"crosshair\",\n GRABBING: \"grabbing\",\n GRAB: \"grab\",\n POINTER: \"pointer\",\n MOVE: \"move\",\n AUTO: \"\",\n};\nexport const POINTER_BUTTON = {\n MAIN: 0,\n WHEEL: 1,\n SECONDARY: 2,\n TOUCH: -1,\n ERASER: 5,\n} as const;\n\nexport const POINTER_EVENTS = {\n enabled: \"all\",\n disabled: \"none\",\n // asserted as any so it can be freely assigned to React Element\n // \"pointerEnvets\" CSS prop\n inheritFromUI: \"var(--ui-pointerEvents)\" as any,\n} as const;\n\nexport enum EVENT {\n COPY = \"copy\",\n PASTE = \"paste\",\n CUT = \"cut\",\n KEYDOWN = \"keydown\",\n KEYUP = \"keyup\",\n MOUSE_MOVE = \"mousemove\",\n RESIZE = \"resize\",\n UNLOAD = \"unload\",\n FOCUS = \"focus\",\n BLUR = \"blur\",\n DRAG_OVER = \"dragover\",\n DROP = \"drop\",\n GESTURE_END = \"gestureend\",\n BEFORE_UNLOAD = \"beforeunload\",\n GESTURE_START = \"gesturestart\",\n GESTURE_CHANGE = \"gesturechange\",\n POINTER_MOVE = \"pointermove\",\n POINTER_DOWN = \"pointerdown\",\n POINTER_UP = \"pointerup\",\n STATE_CHANGE = \"statechange\",\n WHEEL = \"wheel\",\n TOUCH_START = \"touchstart\",\n TOUCH_END = \"touchend\",\n HASHCHANGE = \"hashchange\",\n VISIBILITY_CHANGE = \"visibilitychange\",\n SCROLL = \"scroll\",\n // custom events\n EXCALIDRAW_LINK = \"excalidraw-link\",\n MENU_ITEM_SELECT = \"menu.itemSelect\",\n MESSAGE = \"message\",\n FULLSCREENCHANGE = \"fullscreenchange\",\n}\n\nexport const YOUTUBE_STATES = {\n UNSTARTED: -1,\n ENDED: 0,\n PLAYING: 1,\n PAUSED: 2,\n BUFFERING: 3,\n CUED: 5,\n} as const;\n\nexport const ENV = {\n TEST: \"test\",\n DEVELOPMENT: \"development\",\n PRODUCTION: \"production\",\n};\n\nexport const CLASSES = {\n SIDEBAR: \"sidebar\",\n SHAPE_ACTIONS_MENU: \"App-menu__left\",\n ZOOM_ACTIONS: \"zoom-actions\",\n SEARCH_MENU_INPUT_WRAPPER: \"layer-ui__search-inputWrapper\",\n CONVERT_ELEMENT_TYPE_POPUP: \"ConvertElementTypePopup\",\n SHAPE_ACTIONS_THEME_SCOPE: \"shape-actions-theme-scope\",\n FRAME_NAME: \"frame-name\",\n};\n\nexport const FONT_SIZES = {\n sm: 16,\n md: 20,\n lg: 28,\n xl: 36,\n} as const;\n\nexport const CJK_HAND_DRAWN_FALLBACK_FONT = \"Xiaolai\";\nexport const WINDOWS_EMOJI_FALLBACK_FONT = \"Segoe UI Emoji\";\n\n/**\n * // TODO: shouldn't be really `const`, likely neither have integers as values, due to value for the custom fonts, which should likely be some hash.\n *\n * Let's think this through and consider:\n * - https://developer.mozilla.org/en-US/docs/Web/CSS/generic-family\n * - https://drafts.csswg.org/css-fonts-4/#font-family-prop\n * - https://learn.microsoft.com/en-us/typography/opentype/spec/ibmfc\n */\nexport const FONT_FAMILY = {\n Virgil: 1,\n Helvetica: 2,\n Cascadia: 3,\n // leave 4 unused as it was historically used for Assistant (which we don't use anymore) or custom font (Obsidian)\n Excalifont: 5,\n Nunito: 6,\n \"Lilita One\": 7,\n \"Comic Shanns\": 8,\n \"Liberation Sans\": 9,\n Assistant: 10,\n};\n\n// Segoe UI Emoji fails to properly fallback for some glyphs: \u221E, \u222B, \u2260\n// so we need to have generic font fallback before it\nexport const SANS_SERIF_GENERIC_FONT = \"sans-serif\";\nexport const MONOSPACE_GENERIC_FONT = \"monospace\";\n\nexport const FONT_FAMILY_GENERIC_FALLBACKS = {\n [SANS_SERIF_GENERIC_FONT]: 998,\n [MONOSPACE_GENERIC_FONT]: 999,\n};\n\nexport const FONT_FAMILY_FALLBACKS = {\n [CJK_HAND_DRAWN_FALLBACK_FONT]: 100,\n ...FONT_FAMILY_GENERIC_FALLBACKS,\n [WINDOWS_EMOJI_FALLBACK_FONT]: 1000,\n};\n\nexport function getGenericFontFamilyFallback(\n fontFamily: number,\n): keyof typeof FONT_FAMILY_GENERIC_FALLBACKS {\n switch (fontFamily) {\n case FONT_FAMILY.Cascadia:\n case FONT_FAMILY[\"Comic Shanns\"]:\n return MONOSPACE_GENERIC_FONT;\n\n default:\n return SANS_SERIF_GENERIC_FONT;\n }\n}\n\nexport const getFontFamilyFallbacks = (\n fontFamily: number,\n): Array<keyof typeof FONT_FAMILY_FALLBACKS> => {\n const genericFallbackFont = getGenericFontFamilyFallback(fontFamily);\n\n switch (fontFamily) {\n case FONT_FAMILY.Excalifont:\n return [\n CJK_HAND_DRAWN_FALLBACK_FONT,\n genericFallbackFont,\n WINDOWS_EMOJI_FALLBACK_FONT,\n ];\n default:\n return [genericFallbackFont, WINDOWS_EMOJI_FALLBACK_FONT];\n }\n};\n\nexport const THEME = {\n LIGHT: \"light\",\n DARK: \"dark\",\n} as const;\n\nexport const FRAME_STYLE = {\n strokeColor: \"#bbb\" as ExcalidrawElement[\"strokeColor\"],\n strokeWidth: 2 as ExcalidrawElement[\"strokeWidth\"],\n strokeStyle: \"solid\" as ExcalidrawElement[\"strokeStyle\"],\n fillStyle: \"solid\" as ExcalidrawElement[\"fillStyle\"],\n roughness: 0 as ExcalidrawElement[\"roughness\"],\n roundness: null as ExcalidrawElement[\"roundness\"],\n backgroundColor: \"transparent\" as ExcalidrawElement[\"backgroundColor\"],\n radius: 8,\n nameOffsetY: 3,\n nameColorLightTheme: \"#999999\",\n nameColorDarkTheme: \"#7a7a7a\",\n nameFontSize: 14,\n nameLineHeight: 1.25,\n};\n\nexport const MIN_FONT_SIZE = 1;\nexport const DEFAULT_FONT_SIZE = 20;\nexport const DEFAULT_FONT_FAMILY: FontFamilyValues = FONT_FAMILY.Excalifont;\nexport const DEFAULT_TEXT_ALIGN = \"left\";\nexport const DEFAULT_VERTICAL_ALIGN = \"top\";\nexport const DEFAULT_VERSION = \"{version}\";\nexport const DEFAULT_TRANSFORM_HANDLE_SPACING = 2;\n\nexport const SIDE_RESIZING_THRESHOLD = 2 * DEFAULT_TRANSFORM_HANDLE_SPACING;\n// a small epsilon to make side resizing always take precedence\n// (avoids an increase in renders and changes to tests)\nexport const EPSILON = 0.00001;\nexport const DEFAULT_COLLISION_THRESHOLD =\n 2 * SIDE_RESIZING_THRESHOLD - EPSILON;\n\nexport const COLOR_WHITE = \"#ffffff\";\nexport const COLOR_CHARCOAL_BLACK = \"#1e1e1e\";\n// keep this in sync with CSS\nexport const COLOR_VOICE_CALL = \"#a2f1a6\";\n\nexport const CANVAS_ONLY_ACTIONS = [\"selectAll\"];\n\nexport const DEFAULT_GRID_SIZE = 20;\nexport const DEFAULT_GRID_STEP = 5;\n\nexport const IMAGE_MIME_TYPES = {\n svg: \"image/svg+xml\",\n png: \"image/png\",\n jpg: \"image/jpeg\",\n gif: \"image/gif\",\n webp: \"image/webp\",\n bmp: \"image/bmp\",\n ico: \"image/x-icon\",\n avif: \"image/avif\",\n jfif: \"image/jfif\",\n} as const;\n\nexport const STRING_MIME_TYPES = {\n text: \"text/plain\",\n html: \"text/html\",\n json: \"application/json\",\n // excalidraw data\n excalidraw: \"application/vnd.excalidraw+json\",\n // LEGACY: fully-qualified library JSON data\n excalidrawlib: \"application/vnd.excalidrawlib+json\",\n // list of excalidraw library item ids\n excalidrawlibIds: \"application/vnd.excalidrawlib.ids+json\",\n} as const;\n\nexport const MIME_TYPES = {\n ...STRING_MIME_TYPES,\n // image-encoded excalidraw data\n \"excalidraw.svg\": \"image/svg+xml\",\n \"excalidraw.png\": \"image/png\",\n // binary\n binary: \"application/octet-stream\",\n // image\n ...IMAGE_MIME_TYPES,\n} as const;\n\nexport const ALLOWED_PASTE_MIME_TYPES = [\n MIME_TYPES.text,\n MIME_TYPES.html,\n ...Object.values(IMAGE_MIME_TYPES),\n] as const;\n\nexport const EXPORT_IMAGE_TYPES = {\n png: \"png\",\n svg: \"svg\",\n clipboard: \"clipboard\",\n} as const;\n\nexport const EXPORT_DATA_TYPES = {\n excalidraw: \"excalidraw\",\n excalidrawClipboard: \"excalidraw/clipboard\",\n excalidrawLibrary: \"excalidrawlib\",\n excalidrawClipboardWithAPI: \"excalidraw-api/clipboard\",\n} as const;\n\nexport const getExportSource = () =>\n window.EXCALIDRAW_EXPORT_SOURCE || window.location.origin;\n\n// time in milliseconds\nexport const IMAGE_RENDER_TIMEOUT = 500;\nexport const TAP_TWICE_TIMEOUT = 300;\nexport const TOUCH_CTX_MENU_TIMEOUT = 500;\nexport const TITLE_TIMEOUT = 10000;\nexport const VERSION_TIMEOUT = 30000;\nexport const SCROLL_TIMEOUT = 100;\nexport const ZOOM_STEP = 0.1;\nexport const MIN_ZOOM = 0.1;\nexport const MAX_ZOOM = 30;\nexport const HYPERLINK_TOOLTIP_DELAY = 300;\n\n// Report a user inactive after IDLE_THRESHOLD milliseconds\nexport const IDLE_THRESHOLD = 60_000;\n// Report a user active each ACTIVE_THRESHOLD milliseconds\nexport const ACTIVE_THRESHOLD = 3_000;\n\n// duplicates --theme-filter, should be removed soon\nexport const THEME_FILTER = \"invert(93%) hue-rotate(180deg)\";\n\nexport const URL_QUERY_KEYS = {\n addLibrary: \"addLibrary\",\n} as const;\n\nexport const URL_HASH_KEYS = {\n addLibrary: \"addLibrary\",\n} as const;\n\nexport const DEFAULT_UI_OPTIONS: AppProps[\"UIOptions\"] = {\n canvasActions: {\n changeViewBackgroundColor: true,\n clearCanvas: true,\n export: { saveFileToDisk: true },\n loadScene: true,\n saveToActiveFile: true,\n toggleTheme: null,\n saveAsImage: true,\n },\n tools: {\n image: true,\n },\n toolBar: {\n lockEnabled: true,\n moreToolsEnabled: true,\n hintViewerEnabled: true,\n },\n topLeftMenuEnabled: true,\n libraryEnabled: true,\n footer: {\n helpEnabled: true,\n },\n fontPicker: {\n familyChangeEnabled: true,\n },\n shapeControl: {\n sloppinessChangeEnabled: true,\n },\n viewModeControlEnabled: true,\n hideAnnotationsControlEnabled: true,\n undoRedoPosition: \"footer\",\n swapTopMenuAndFooter: false,\n};\n\nexport const MAX_DECIMALS_FOR_SVG_EXPORT = 2;\n\nexport const EXPORT_SCALES = [1, 2, 3];\nexport const DEFAULT_EXPORT_PADDING = 10; // px\n\nexport const DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT = 1440;\n\nexport const MAX_ALLOWED_FILE_BYTES = 4 * 1024 * 1024;\n\nexport const SVG_NS = \"http://www.w3.org/2000/svg\";\nexport const SVG_DOCUMENT_PREAMBLE = `<?xml version=\"1.0\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n`;\n\nexport const ENCRYPTION_KEY_BITS = 128;\n\nexport const VERSIONS = {\n excalidraw: 2,\n excalidrawLibrary: 2,\n} as const;\n\nexport const BOUND_TEXT_PADDING = 5;\nexport const ARROW_LABEL_WIDTH_FRACTION = 0.7;\nexport const ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO = 11;\n\nexport const VERTICAL_ALIGN = {\n TOP: \"top\",\n MIDDLE: \"middle\",\n BOTTOM: \"bottom\",\n};\n\nexport const TEXT_ALIGN = {\n LEFT: \"left\",\n CENTER: \"center\",\n RIGHT: \"right\",\n};\n\nexport const ELEMENT_READY_TO_ERASE_OPACITY = 20;\n\n// Radius represented as 25% of element's largest side (width/height).\n// Used for LEGACY and PROPORTIONAL_RADIUS algorithms, or when the element is\n// below the cutoff size.\nexport const DEFAULT_PROPORTIONAL_RADIUS = 0.25;\n// Fixed radius for the ADAPTIVE_RADIUS algorithm. In pixels.\nexport const DEFAULT_ADAPTIVE_RADIUS = 32;\n// roundness type (algorithm)\nexport const ROUNDNESS = {\n // Used for legacy rounding (rectangles), which currently works the same\n // as PROPORTIONAL_RADIUS, but we need to differentiate for UI purposes and\n // forwards-compat.\n LEGACY: 1,\n\n // Used for linear elements & diamonds\n PROPORTIONAL_RADIUS: 2,\n\n // Current default algorithm for rectangles, using fixed pixel radius.\n // It's working similarly to a regular border-radius, but attemps to make\n // radius visually similar across differnt element sizes, especially\n // very large and very small elements.\n //\n // NOTE right now we don't allow configuration and use a constant radius\n // (see DEFAULT_ADAPTIVE_RADIUS constant)\n ADAPTIVE_RADIUS: 3,\n} as const;\n\nexport const ROUGHNESS = {\n architect: 0,\n artist: 1,\n cartoonist: 2,\n} as const;\n\nexport const STROKE_WIDTH = {\n thin: 1,\n bold: 2,\n extraBold: 4,\n} as const;\n\nexport const DEFAULT_ELEMENT_PROPS: {\n strokeColor: ExcalidrawElement[\"strokeColor\"];\n backgroundColor: ExcalidrawElement[\"backgroundColor\"];\n fillStyle: ExcalidrawElement[\"fillStyle\"];\n strokeWidth: ExcalidrawElement[\"strokeWidth\"];\n strokeStyle: ExcalidrawElement[\"strokeStyle\"];\n roughness: ExcalidrawElement[\"roughness\"];\n opacity: ExcalidrawElement[\"opacity\"];\n locked: ExcalidrawElement[\"locked\"];\n} = {\n strokeColor: COLOR_PALETTE.black,\n backgroundColor: COLOR_PALETTE.transparent,\n fillStyle: \"solid\",\n strokeWidth: 2,\n strokeStyle: \"solid\",\n roughness: ROUGHNESS.artist,\n opacity: 100,\n locked: false,\n};\n\nexport const LIBRARY_SIDEBAR_TAB = \"library\";\nexport const CANVAS_SEARCH_TAB = \"search\";\n\nexport const DEFAULT_SIDEBAR = {\n name: \"default\",\n defaultTab: LIBRARY_SIDEBAR_TAB,\n} as const;\n\nexport const LIBRARY_DISABLED_TYPES = new Set([\n \"iframe\",\n \"embeddable\",\n \"image\",\n] as const);\n\n// use these constants to easily identify reference sites\nexport const TOOL_TYPE = {\n selection: \"selection\",\n lasso: \"lasso\",\n rectangle: \"rectangle\",\n diamond: \"diamond\",\n ellipse: \"ellipse\",\n arrow: \"arrow\",\n line: \"line\",\n freedraw: \"freedraw\",\n text: \"text\",\n image: \"image\",\n eraser: \"eraser\",\n hand: \"hand\",\n frame: \"frame\",\n magicframe: \"magicframe\",\n embeddable: \"embeddable\",\n laser: \"laser\",\n} as const;\n\nexport const EDITOR_LS_KEYS = {\n OAI_API_KEY: \"excalidraw-oai-api-key\",\n // legacy naming (non)scheme\n MERMAID_TO_EXCALIDRAW: \"mermaid-to-excalidraw\",\n PUBLISH_LIBRARY: \"publish-library-data\",\n} as const;\n\n/**\n * not translated as this is used only in public, stateless API as default value\n * where filename is optional and we can't retrieve name from app state\n */\nexport const DEFAULT_FILENAME = \"Untitled\";\n\nexport const STATS_PANELS = { generalStats: 1, elementProperties: 2 } as const;\n\nexport const MIN_WIDTH_OR_HEIGHT = 1;\n\nexport const ARROW_TYPE: { [T in AppState[\"currentItemArrowType\"]]: T } = {\n sharp: \"sharp\",\n round: \"round\",\n elbow: \"elbow\",\n};\n\nexport const DEFAULT_REDUCED_GLOBAL_ALPHA = 0.3;\nexport const ELEMENT_LINK_KEY = \"element\";\n\n/** used in tests */\nexport const ORIG_ID = Symbol.for(\"__test__originalId__\");\n\nexport enum UserIdleState {\n ACTIVE = \"active\",\n AWAY = \"away\",\n IDLE = \"idle\",\n}\n\n/**\n * distance at which we merge points instead of adding a new merge-point\n * when converting a line to a polygon (merge currently means overlaping\n * the start and end points)\n */\nexport const LINE_POLYGON_POINT_MERGE_DISTANCE = 20;\n\nexport const DOUBLE_TAP_POSITION_THRESHOLD = 35;\n\nexport const BIND_MODE_TIMEOUT = 700; // ms\n\n// glass background for mobile action buttons\nexport const MOBILE_ACTION_BUTTON_BG = {\n background: \"var(--mobile-action-button-bg)\",\n} as const;\n", "import type {\n ExcalidrawTextElement,\n FontFamilyValues,\n} from \"@excalidraw/element/types\";\n\nimport { FONT_FAMILY, FONT_FAMILY_FALLBACKS } from \"./constants\";\n\n/**\n * Encapsulates font metrics with additional font metadata.\n * */\nexport interface FontMetadata {\n /** for head & hhea metrics read the woff2 with https://fontdrop.info/ */\n metrics: {\n /** head.unitsPerEm metric */\n unitsPerEm: 1000 | 1024 | 2048;\n /** hhea.ascender metric */\n ascender: number;\n /** hhea.descender metric */\n descender: number;\n /** harcoded unitless line-height, https://github.com/excalidraw/excalidraw/pull/6360#issuecomment-1477635971 */\n lineHeight: number;\n };\n /** flag to indicate a deprecated font */\n deprecated?: true;\n /**\n * whether this is a font that users can use (= shown in font picker)\n */\n private?: true;\n /** flag to indiccate a local-only font */\n local?: true;\n /** flag to indicate a fallback font */\n fallback?: true;\n}\n\nexport const FONT_METADATA: Record<number, FontMetadata> = {\n [FONT_FAMILY.Excalifont]: {\n metrics: {\n unitsPerEm: 1000,\n ascender: 886,\n descender: -374,\n lineHeight: 1.25,\n },\n },\n [FONT_FAMILY.Nunito]: {\n metrics: {\n unitsPerEm: 1000,\n ascender: 1011,\n descender: -353,\n lineHeight: 1.25,\n },\n },\n [FONT_FAMILY[\"Lilita One\"]]: {\n metrics: {\n unitsPerEm: 1000,\n ascender: 923,\n descender: -220,\n lineHeight: 1.15,\n },\n },\n [FONT_FAMILY[\"Comic Shanns\"]]: {\n metrics: {\n unitsPerEm: 1000,\n ascender: 750,\n descender: -250,\n lineHeight: 1.25,\n },\n },\n [FONT_FAMILY.Virgil]: {\n metrics: {\n unitsPerEm: 1000,\n ascender: 886,\n descender: -374,\n lineHeight: 1.25,\n },\n deprecated: true,\n },\n [FONT_FAMILY.Helvetica]: {\n metrics: {\n unitsPerEm: 2048,\n ascender: 1577,\n descender: -471,\n lineHeight: 1.15,\n },\n deprecated: true,\n local: true,\n },\n [FONT_FAMILY.Cascadia]: {\n metrics: {\n unitsPerEm: 2048,\n ascender: 1900,\n descender: -480,\n lineHeight: 1.2,\n },\n deprecated: true,\n },\n [FONT_FAMILY[\"Liberation Sans\"]]: {\n metrics: {\n unitsPerEm: 2048,\n ascender: 1854,\n descender: -434,\n lineHeight: 1.15,\n },\n private: true,\n },\n [FONT_FAMILY.Assistant]: {\n metrics: {\n unitsPerEm: 2048,\n ascender: 1021,\n descender: -287,\n lineHeight: 1.25,\n },\n private: true,\n },\n [FONT_FAMILY_FALLBACKS.Xiaolai]: {\n metrics: {\n unitsPerEm: 1000,\n ascender: 880,\n descender: -144,\n lineHeight: 1.25,\n },\n fallback: true,\n },\n [FONT_FAMILY_FALLBACKS[\"Segoe UI Emoji\"]]: {\n metrics: {\n // reusing Excalifont metrics\n unitsPerEm: 1000,\n ascender: 886,\n descender: -374,\n lineHeight: 1.25,\n },\n local: true,\n fallback: true,\n },\n};\n\n/** Unicode ranges defined by google fonts */\nexport const GOOGLE_FONTS_RANGES = {\n LATIN:\n \"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD\",\n LATIN_EXT:\n \"U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF\",\n CYRILIC_EXT:\n \"U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F\",\n CYRILIC: \"U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116\",\n VIETNAMESE:\n \"U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB\",\n};\n\n/** local protocol to skip the local font from registering or inlining */\nexport const LOCAL_FONT_PROTOCOL = \"local:\";\n\n/**\n * Calculates vertical offset for a text with alphabetic baseline.\n */\nexport const getVerticalOffset = (\n fontFamily: ExcalidrawTextElement[\"fontFamily\"],\n fontSize: ExcalidrawTextElement[\"fontSize\"],\n lineHeightPx: number,\n) => {\n const { unitsPerEm, ascender, descender } =\n FONT_METADATA[fontFamily]?.metrics ||\n FONT_METADATA[FONT_FAMILY.Excalifont].metrics;\n\n const fontSizeEm = fontSize / unitsPerEm;\n const lineGap =\n (lineHeightPx - fontSizeEm * ascender + fontSizeEm * descender) / 2;\n\n const verticalOffset = fontSizeEm * ascender + lineGap;\n return verticalOffset;\n};\n\n/**\n * Gets line height for a selected family.\n */\nexport const getLineHeight = (fontFamily: FontFamilyValues) => {\n const { lineHeight } =\n FONT_METADATA[fontFamily]?.metrics ||\n FONT_METADATA[FONT_FAMILY.Excalifont].metrics;\n\n return lineHeight as ExcalidrawTextElement[\"lineHeight\"];\n};\n", "import { promiseTry, resolvablePromise } from \".\";\n\nimport type { ResolvablePromise } from \".\";\n\nimport type { MaybePromise } from \"./utility-types\";\n\ntype Job<T, TArgs extends unknown[]> = (...args: TArgs) => MaybePromise<T>;\n\ntype QueueJob<T, TArgs extends unknown[]> = {\n jobFactory: Job<T, TArgs>;\n promise: ResolvablePromise<T>;\n args: TArgs;\n};\n\nexport class Queue {\n private jobs: QueueJob<any, any[]>[] = [];\n private running = false;\n\n private tick() {\n if (this.running) {\n return;\n }\n const job = this.jobs.shift();\n if (job) {\n this.running = true;\n job.promise.resolve(\n promiseTry(job.jobFactory, ...job.args).finally(() => {\n this.running = false;\n this.tick();\n }),\n );\n } else {\n this.running = false;\n }\n }\n\n push<TValue, TArgs extends unknown[]>(\n jobFactory: Job<TValue, TArgs>,\n ...args: TArgs\n ): Promise<TValue> {\n const promise = resolvablePromise<TValue>();\n this.jobs.push({ jobFactory, promise, args });\n\n this.tick();\n\n return promise;\n }\n}\n", "import { isDarwin } from \"./editorInterface\";\n\nimport type { ValueOf } from \"./utility-types\";\n\nexport const CODES = {\n EQUAL: \"Equal\",\n MINUS: \"Minus\",\n NUM_ADD: \"NumpadAdd\",\n NUM_SUBTRACT: \"NumpadSubtract\",\n NUM_ZERO: \"Numpad0\",\n BRACKET_RIGHT: \"BracketRight\",\n BRACKET_LEFT: \"BracketLeft\",\n ONE: \"Digit1\",\n TWO: \"Digit2\",\n THREE: \"Digit3\",\n NINE: \"Digit9\",\n QUOTE: \"Quote\",\n ZERO: \"Digit0\",\n SLASH: \"Slash\",\n C: \"KeyC\",\n D: \"KeyD\",\n H: \"KeyH\",\n V: \"KeyV\",\n Z: \"KeyZ\",\n Y: \"KeyY\",\n R: \"KeyR\",\n S: \"KeyS\",\n} as const;\n\nexport const KEYS = {\n ARROW_DOWN: \"ArrowDown\",\n ARROW_LEFT: \"ArrowLeft\",\n ARROW_RIGHT: \"ArrowRight\",\n ARROW_UP: \"ArrowUp\",\n PAGE_UP: \"PageUp\",\n PAGE_DOWN: \"PageDown\",\n BACKSPACE: \"Backspace\",\n ALT: \"Alt\",\n CTRL_OR_CMD: isDarwin ? \"metaKey\" : \"ctrlKey\",\n DELETE: \"Delete\",\n ENTER: \"Enter\",\n ESCAPE: \"Escape\",\n QUESTION_MARK: \"?\",\n SPACE: \" \",\n TAB: \"Tab\",\n CHEVRON_LEFT: \"<\",\n CHEVRON_RIGHT: \">\",\n PERIOD: \".\",\n COMMA: \",\",\n SUBTRACT: \"-\",\n SLASH: \"/\",\n\n A: \"a\",\n C: \"c\",\n D: \"d\",\n E: \"e\",\n F: \"f\",\n G: \"g\",\n H: \"h\",\n I: \"i\",\n L: \"l\",\n O: \"o\",\n P: \"p\",\n Q: \"q\",\n R: \"r\",\n S: \"s\",\n T: \"t\",\n V: \"v\",\n X: \"x\",\n Y: \"y\",\n Z: \"z\",\n K: \"k\",\n W: \"w\",\n\n 0: \"0\",\n 1: \"1\",\n 2: \"2\",\n 3: \"3\",\n 4: \"4\",\n 5: \"5\",\n 6: \"6\",\n 7: \"7\",\n 8: \"8\",\n 9: \"9\",\n} as const;\n\nexport type Key = keyof typeof KEYS;\n\n// defines key code mapping for matching codes as fallback to respective keys on non-latin keyboard layouts\nexport const KeyCodeMap = new Map<ValueOf<typeof KEYS>, ValueOf<typeof CODES>>([\n [KEYS.Z, CODES.Z],\n [KEYS.Y, CODES.Y],\n]);\n\nexport const isLatinChar = (key: string) => /^[a-z]$/.test(key.toLowerCase());\n\n/**\n * Used to match key events for any keyboard layout, especially on Windows and Linux,\n * where non-latin character with modified (CMD) is not substituted with latin-based alternative.\n *\n * Uses `event.key` when it's latin, otherwise fallbacks to `event.code` (if mapping exists).\n *\n * Example of pressing \"z\" on different layouts, with the chosen key or code highlighted in []:\n *\n * Layout | Code | Key | Comment\n * --------------------- | ----- | --- | -------\n * U.S. | KeyZ | [z] |\n * Czech | KeyY | [z] |\n * Turkish | KeyN | [z] |\n * French | KeyW | [z] |\n * Macedonian | [KeyZ] | \u0437 | z with cmd; \u0437 is Cyrillic equivalent of z\n * Russian | [KeyZ] | \u044F | z with cmd\n * Serbian | [KeyZ] | \u0455 | z with cmd\n * Greek | [KeyZ] | \u03B6 | z with cmd; also \u03B6 is Greek equivalent of z\n * Hebrew | [KeyZ] | \u05D6 | z with cmd; also \u05D6 is Hebrew equivalent of z\n * Pinyin - Simplified | KeyZ | [z] | due to IME\n * Cangije - Traditional | [KeyZ] | \u91CD | z with cmd\n * Japanese | [KeyZ] | \u3064 | z with cmd\n * 2-Set Korean | [KeyZ] | \u314B | z with cmd\n *\n * More details in https://github.com/excalidraw/excalidraw/pull/5944\n */\nexport const matchKey = (\n event: KeyboardEvent | React.KeyboardEvent<Element>,\n key: ValueOf<typeof KEYS>,\n): boolean => {\n // for latin layouts use key\n if (key === event.key.toLowerCase()) {\n return true;\n }\n\n // non-latin layouts fallback to code\n const code = KeyCodeMap.get(key);\n return Boolean(code && !isLatinChar(event.key) && event.code === code);\n};\n\nexport const isArrowKey = (key: string) =>\n key === KEYS.ARROW_LEFT ||\n key === KEYS.ARROW_RIGHT ||\n key === KEYS.ARROW_DOWN ||\n key === KEYS.ARROW_UP;\n\nexport const shouldResizeFromCenter = (event: MouseEvent | KeyboardEvent) =>\n event.altKey;\n\nexport const shouldMaintainAspectRatio = (event: MouseEvent | KeyboardEvent) =>\n event.shiftKey;\n\nexport const shouldRotateWithDiscreteAngle = (\n event: MouseEvent | KeyboardEvent | React.PointerEvent<HTMLCanvasElement>,\n) => event.shiftKey;\n", "export type StylesPanelMode = \"compact\" | \"full\" | \"mobile\";\n\nexport type EditorInterface = Readonly<{\n formFactor: \"phone\" | \"tablet\" | \"desktop\";\n desktopUIMode: \"compact\" | \"full\";\n userAgent: Readonly<{\n isMobileDevice: boolean;\n platform: \"ios\" | \"android\" | \"other\" | \"unknown\";\n }>;\n isTouchScreen: boolean;\n canFitSidebar: boolean;\n isLandscape: boolean;\n}>;\n\n// storage key\nconst DESKTOP_UI_MODE_STORAGE_KEY = \"excalidraw.desktopUIMode\";\n\n// breakpoints\n// mobile: up to 699px\nexport const MQ_MAX_MOBILE = 599;\n\nexport const MQ_MAX_WIDTH_LANDSCAPE = 1000;\nexport const MQ_MAX_HEIGHT_LANDSCAPE = 500;\n\n// tablets\nexport const MQ_MIN_TABLET = MQ_MAX_MOBILE + 1; // lower bound (excludes phones)\nexport const MQ_MAX_TABLET = 1400; // upper bound (excludes laptops/desktops)\n\n// desktop/laptop\nexport const MQ_MIN_WIDTH_DESKTOP = 1440;\n\n// sidebar\nexport const MQ_RIGHT_SIDEBAR_MIN_WIDTH = 1229;\n\n// -----------------------------------------------------------------------------\n\n// user agent detections\nexport const isDarwin = /Mac|iPod|iPhone|iPad/.test(navigator.platform);\nexport const isWindows = /^Win/.test(navigator.platform);\nexport const isAndroid = /\\b(android)\\b/i.test(navigator.userAgent);\nexport const isFirefox =\n typeof window !== \"undefined\" &&\n \"netscape\" in window &&\n navigator.userAgent.indexOf(\"rv:\") > 1 &&\n navigator.userAgent.indexOf(\"Gecko\") > 1;\nexport const isChrome = navigator.userAgent.indexOf(\"Chrome\") !== -1;\nexport const isSafari =\n !isChrome && navigator.userAgent.indexOf(\"Safari\") !== -1;\nexport const isIOS =\n /iPad|iPhone/i.test(navigator.platform) ||\n // iPadOS 13+\n (navigator.userAgent.includes(\"Mac\") && \"ontouchend\" in document);\n// keeping function so it can be mocked in test\nexport const isBrave = () =>\n (navigator as any).brave?.isBrave?.name === \"isBrave\";\n\n// export const isMobile =\n// isIOS ||\n// /android|webos|ipod|blackberry|iemobile|opera mini/i.test(\n// navigator.userAgent,\n// ) ||\n// /android|ios|ipod|blackberry|windows phone/i.test(navigator.platform);\n\n// utilities\nexport const isMobileBreakpoint = (width: number, height: number) => {\n return (\n width <= MQ_MAX_MOBILE ||\n (height < MQ_MAX_HEIGHT_LANDSCAPE && width < MQ_MAX_WIDTH_LANDSCAPE)\n );\n};\n\nexport const isTabletBreakpoint = (\n editorWidth: number,\n editorHeight: number,\n) => {\n const minSide = Math.min(editorWidth, editorHeight);\n const maxSide = Math.max(editorWidth, editorHeight);\n\n return minSide >= MQ_MIN_TABLET && maxSide <= MQ_MAX_TABLET;\n};\n\nconst isMobileOrTablet = (): boolean => {\n const ua = navigator.userAgent || \"\";\n const platform = navigator.platform || \"\";\n const uaData = (navigator as any).userAgentData as\n | { mobile?: boolean; platform?: string }\n | undefined;\n\n // --- 1) chromium: prefer ua client hints -------------------------------\n if (uaData) {\n const plat = (uaData.platform || \"\").toLowerCase();\n const isDesktopOS =\n plat === \"windows\" ||\n plat === \"macos\" ||\n plat === \"linux\" ||\n plat === \"chrome os\";\n if (uaData.mobile === true) {\n return true;\n }\n if (uaData.mobile === false && plat === \"android\") {\n const looksTouchTablet =\n matchMedia?.(\"(hover: none)\").matches &&\n matchMedia?.(\"(pointer: coarse)\").matches;\n return looksTouchTablet;\n }\n if (isDesktopOS) {\n return false;\n }\n }\n\n // --- 2) ios (includes ipad) --------------------------------------------\n if (isIOS) {\n return true;\n }\n\n // --- 3) android legacy ua fallback -------------------------------------\n if (isAndroid) {\n const isAndroidPhone = /Mobile/i.test(ua);\n const isAndroidTablet = !isAndroidPhone;\n if (isAndroidPhone || isAndroidTablet) {\n const looksTouchTablet =\n matchMedia?.(\"(hover: none)\").matches &&\n matchMedia?.(\"(pointer: coarse)\").matches;\n return looksTouchTablet;\n }\n }\n\n // --- 4) last resort desktop exclusion ----------------------------------\n const looksDesktopPlatform =\n /Win|Linux|CrOS|Mac/.test(platform) ||\n /Windows NT|X11|CrOS|Macintosh/.test(ua);\n if (looksDesktopPlatform) {\n return false;\n }\n return false;\n};\n\nexport const getFormFactor = (\n editorWidth: number,\n editorHeight: number,\n): EditorInterface[\"formFactor\"] => {\n if (isMobileBreakpoint(editorWidth, editorHeight)) {\n return \"phone\";\n }\n\n if (isTabletBreakpoint(editorWidth, editorHeight)) {\n return \"tablet\";\n }\n\n return \"desktop\";\n};\n\nexport const deriveStylesPanelMode = (\n editorInterface: EditorInterface,\n): StylesPanelMode => {\n if (editorInterface.formFactor === \"phone\") {\n return \"mobile\";\n }\n\n if (editorInterface.formFactor === \"tablet\") {\n return \"compact\";\n }\n\n return editorInterface.desktopUIMode;\n};\n\nexport const createUserAgentDescriptor = (\n userAgentString: string,\n): EditorInterface[\"userAgent\"] => {\n const normalizedUA = userAgentString ?? \"\";\n let platform: EditorInterface[\"userAgent\"][\"platform\"] = \"unknown\";\n\n if (isIOS) {\n platform = \"ios\";\n } else if (isAndroid) {\n platform = \"android\";\n } else if (normalizedUA) {\n platform = \"other\";\n }\n\n return {\n isMobileDevice: isMobileOrTablet(),\n platform,\n } as const;\n};\n\nexport const loadDesktopUIModePreference = () => {\n if (typeof window === \"undefined\") {\n return null;\n }\n\n try {\n const stored = window.localStorage.getItem(DESKTOP_UI_MODE_STORAGE_KEY);\n if (stored === \"compact\" || stored === \"full\") {\n return stored as EditorInterface[\"desktopUIMode\"];\n }\n } catch (error) {\n // ignore storage access issues (e.g., Safari private mode)\n }\n\n return null;\n};\n\nconst persistDesktopUIMode = (mode: EditorInterface[\"desktopUIMode\"]) => {\n if (typeof window === \"undefined\") {\n return;\n }\n try {\n window.localStorage.setItem(DESKTOP_UI_MODE_STORAGE_KEY, mode);\n } catch (error) {\n // ignore storage access issues (e.g., Safari private mode)\n }\n};\n\nexport const setDesktopUIMode = (mode: EditorInterface[\"desktopUIMode\"]) => {\n if (mode !== \"compact\" && mode !== \"full\") {\n return;\n }\n\n persistDesktopUIMode(mode);\n\n return mode;\n};\n", "import {\n pointFromPair,\n type GlobalPoint,\n type LocalPoint,\n} from \"@excalidraw/math\";\n\nimport type { NullableGridSize } from \"@excalidraw/excalidraw/types\";\n\nexport const getSizeFromPoints = (\n points: readonly (GlobalPoint | LocalPoint)[],\n) => {\n const xs = points.map((point) => point[0]);\n const ys = points.map((point) => point[1]);\n return {\n width: Math.max(...xs) - Math.min(...xs),\n height: Math.max(...ys) - Math.min(...ys),\n };\n};\n\n/** @arg dimension, 0 for rescaling only x, 1 for y */\nexport const rescalePoints = <Point extends GlobalPoint | LocalPoint>(\n dimension: 0 | 1,\n newSize: number,\n points: readonly Point[],\n normalize: boolean,\n): Point[] => {\n const coordinates = points.map((point) => point[dimension]);\n const maxCoordinate = Math.max(...coordinates);\n const minCoordinate = Math.min(...coordinates);\n const size = maxCoordinate - minCoordinate;\n const scale = size === 0 ? 1 : newSize / size;\n\n let nextMinCoordinate = Infinity;\n\n const scaledPoints = points.map((point): Point => {\n const newCoordinate = point[dimension] * scale;\n const newPoint = [...point];\n newPoint[dimension] = newCoordinate;\n if (newCoordinate < nextMinCoordinate) {\n nextMinCoordinate = newCoordinate;\n }\n return newPoint as Point;\n });\n\n if (!normalize) {\n return scaledPoints;\n }\n\n if (scaledPoints.length === 2) {\n // we don't translate two-point lines\n return scaledPoints;\n }\n\n const translation = minCoordinate - nextMinCoordinate;\n\n const nextPoints = scaledPoints.map((scaledPoint) =>\n pointFromPair<Point>(\n scaledPoint.map((value, currentDimension) => {\n return currentDimension === dimension ? value + translation : value;\n }) as [number, number],\n ),\n );\n\n return nextPoints;\n};\n\n// TODO: Rounding this point causes some shake when free drawing\nexport const getGridPoint = (\n x: number,\n y: number,\n gridSize: NullableGridSize,\n): [number, number] => {\n if (gridSize) {\n return [\n Math.round(x / gridSize) * gridSize,\n Math.round(y / gridSize) * gridSize,\n ];\n }\n return [x, y];\n};\n", "import Pool from \"es6-promise-pool\";\n\n// extending the missing types\n// relying on the [Index, T] to keep a correct order\ntype TPromisePool<T, Index = number> = Pool<[Index, T][]> & {\n addEventListener: (\n type: \"fulfilled\",\n listener: (event: { data: { result: [Index, T] } }) => void,\n ) => (event: { data: { result: [Index, T] } }) => void;\n removeEventListener: (\n type: \"fulfilled\",\n listener: (event: { data: { result: [Index, T] } }) => void,\n ) => void;\n};\n\nexport class PromisePool<T> {\n private readonly pool: TPromisePool<T>;\n private readonly entries: Record<number, T> = {};\n\n constructor(\n source: IterableIterator<Promise<void | readonly [number, T]>>,\n concurrency: number,\n ) {\n this.pool = new Pool(\n source as unknown as () => void | PromiseLike<[number, T][]>,\n concurrency,\n ) as TPromisePool<T>;\n }\n\n public all() {\n const listener = (event: { data: { result: void | [number, T] } }) => {\n if (event.data.result) {\n // by default pool does not return the results, so we are gathering them manually\n // with the correct call order (represented by the index in the tuple)\n const [index, value] = event.data.result;\n this.entries[index] = value;\n }\n };\n\n this.pool.addEventListener(\"fulfilled\", listener);\n\n return this.pool.start().then(() => {\n setTimeout(() => {\n this.pool.removeEventListener(\"fulfilled\", listener);\n });\n\n return Object.values(this.entries);\n });\n }\n}\n", "import { nanoid } from \"nanoid\";\nimport { Random } from \"roughjs/bin/math\";\n\nimport { isTestEnv } from \"./utils\";\n\nlet random = new Random(Date.now());\nlet testIdBase = 0;\n\nexport const randomInteger = () => Math.floor(random.next() * 2 ** 31);\n\nexport const reseed = (seed: number) => {\n random = new Random(seed);\n testIdBase = 0;\n};\n\nexport const randomId = () => (isTestEnv() ? `id${testIdBase++}` : nanoid());\n", "// This file replaces `index.js` in bundlers like webpack or Rollup,\n// according to `browser` config in `package.json`.\n\nimport { urlAlphabet } from './url-alphabet/index.js'\n\nlet random = bytes => crypto.getRandomValues(new Uint8Array(bytes))\n\nlet customRandom = (alphabet, defaultSize, getRandom) => {\n // First, a bitmask is necessary to generate the ID. The bitmask makes bytes\n // values closer to the alphabet size. The bitmask calculates the closest\n // `2^31 - 1` number, which exceeds the alphabet size.\n // For example, the bitmask for the alphabet size 30 is 31 (00011111).\n // `Math.clz32` is not used, because it is not available in browsers.\n let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1\n // Though, the bitmask solution is not perfect since the bytes exceeding\n // the alphabet size are refused. Therefore, to reliably generate the ID,\n // the random bytes redundancy has to be satisfied.\n\n // Note: every hardware random generator call is performance expensive,\n // because the system call for entropy collection takes a lot of time.\n // So, to avoid additional system calls, extra bytes are requested in advance.\n\n // Next, a step determines how many random bytes to generate.\n // The number of random bytes gets decided upon the ID size, mask,\n // alphabet size, and magic number 1.6 (using 1.6 peaks at performance\n // according to benchmarks).\n\n // `-~f => Math.ceil(f)` if f is a float\n // `-~i => i + 1` if i is an integer\n let step = -~((1.6 * mask * defaultSize) / alphabet.length)\n\n return (size = defaultSize) => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n // A compact alternative for `for (var i = 0; i < step; i++)`.\n let j = step | 0\n while (j--) {\n // Adding `|| ''` refuses a random byte that exceeds the alphabet size.\n id += alphabet[bytes[j] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\n\nlet customAlphabet = (alphabet, size = 21) =>\n customRandom(alphabet, size, random)\n\nlet nanoid = (size = 21) =>\n crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {\n // It is incorrect to use bytes exceeding the alphabet size.\n // The following mask reduces the random byte in the 0-255 value\n // range to the 0-63 value range. Therefore, adding hacks, such\n // as empty string fallback or magic numbers, is unneccessary because\n // the bitmask trims bytes down to the alphabet size.\n byte &= 63\n if (byte < 36) {\n // `0-9a-z`\n id += byte.toString(36)\n } else if (byte < 62) {\n // `A-Z`\n id += (byte - 26).toString(36).toUpperCase()\n } else if (byte > 62) {\n id += '-'\n } else {\n id += '_'\n }\n return id\n }, '')\n\nexport { nanoid, customAlphabet, customRandom, urlAlphabet, random }\n", "// This alphabet uses `A-Za-z0-9_-` symbols.\n// The order of characters is optimized for better gzip and brotli compression.\n// Same as in non-secure/index.js\nlet urlAlphabet =\n 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'\n\nexport { urlAlphabet }\n", "export function randomSeed() {\n return Math.floor(Math.random() * 2 ** 31);\n}\nexport class Random {\n constructor(seed) {\n this.seed = seed;\n }\n next() {\n if (this.seed) {\n return ((2 ** 31 - 1) & (this.seed = Math.imul(48271, this.seed))) / 2 ** 31;\n }\n else {\n return Math.random();\n }\n }\n}\n", "import { average } from \"@excalidraw/math\";\n\nimport type { FontFamilyValues, FontString } from \"@excalidraw/element/types\";\n\nimport type {\n ActiveTool,\n AppState,\n ToolType,\n UnsubscribeCallback,\n Zoom,\n} from \"@excalidraw/excalidraw/types\";\n\nimport { COLOR_PALETTE } from \"./colors\";\nimport {\n DEFAULT_VERSION,\n ENV,\n FONT_FAMILY,\n getFontFamilyFallbacks,\n WINDOWS_EMOJI_FALLBACK_FONT,\n} from \"./constants\";\n\nimport type { MaybePromise, ResolutionType } from \"./utility-types\";\n\nimport type { EVENT } from \"./constants\";\n\nlet mockDateTime: string | null = null;\n\nexport const setDateTimeForTests = (dateTime: string) => {\n mockDateTime = dateTime;\n};\n\nexport const getDateTime = () => {\n if (mockDateTime) {\n return mockDateTime;\n }\n\n const date = new Date();\n const year = date.getFullYear();\n const month = `${date.getMonth() + 1}`.padStart(2, \"0\");\n const day = `${date.getDate()}`.padStart(2, \"0\");\n const hr = `${date.getHours()}`.padStart(2, \"0\");\n const min = `${date.getMinutes()}`.padStart(2, \"0\");\n\n return `${year}-${month}-${day}-${hr}${min}`;\n};\n\nexport const capitalizeString = (str: string) =>\n str.charAt(0).toUpperCase() + str.slice(1);\n\nexport const isToolIcon = (\n target: Element | EventTarget | null,\n): target is HTMLElement =>\n target instanceof HTMLElement && target.className.includes(\"ToolIcon\");\n\nexport const isInputLike = (\n target: Element | EventTarget | null,\n): target is\n | HTMLInputElement\n | HTMLTextAreaElement\n | HTMLSelectElement\n | HTMLBRElement\n | HTMLDivElement =>\n (target instanceof HTMLElement && target.dataset.type === \"wysiwyg\") ||\n target instanceof HTMLBRElement || // newline in wysiwyg\n target instanceof HTMLInputElement ||\n target instanceof HTMLTextAreaElement ||\n target instanceof HTMLSelectElement;\n\nexport const isInteractive = (target: Element | EventTarget | null) => {\n return (\n isInputLike(target) ||\n (target instanceof Element && !!target.closest(\"label, button\"))\n );\n};\n\nexport const isWritableElement = (\n target: Element | EventTarget | null,\n): target is\n | HTMLInputElement\n | HTMLTextAreaElement\n | HTMLBRElement\n | HTMLDivElement =>\n (target instanceof HTMLElement && target.dataset.type === \"wysiwyg\") ||\n target instanceof HTMLBRElement || // newline in wysiwyg\n target instanceof HTMLTextAreaElement ||\n (target instanceof HTMLInputElement &&\n (target.type === \"text\" ||\n target.type === \"number\" ||\n target.type === \"password\" ||\n target.type === \"search\"));\n\nexport const getFontFamilyString = ({\n fontFamily,\n}: {\n fontFamily: FontFamilyValues;\n}) => {\n for (const [fontFamilyString, id] of Object.entries(FONT_FAMILY)) {\n if (id === fontFamily) {\n return `${fontFamilyString}${getFontFamilyFallbacks(id)\n .map((x) => `, ${x}`)\n .join(\"\")}`;\n }\n }\n return WINDOWS_EMOJI_FALLBACK_FONT;\n};\n\n/** returns fontSize+fontFamily string for assignment to DOM elements */\nexport const getFontString = ({\n fontSize,\n fontFamily,\n}: {\n fontSize: number;\n fontFamily: FontFamilyValues;\n}) => {\n return `${fontSize}px ${getFontFamilyString({ fontFamily })}` as FontString;\n};\n\n/** executes callback in the frame that's after the current one */\nexport const nextAnimationFrame = async (cb: () => any) => {\n requestAnimationFrame(() => requestAnimationFrame(cb));\n};\n\nexport const debounce = <T extends any[]>(\n fn: (...args: T) => void,\n timeout: number,\n) => {\n let handle = 0;\n let lastArgs: T | null = null;\n const ret = (...args: T) => {\n lastArgs = args;\n clearTimeout(handle);\n handle = window.setTimeout(() => {\n lastArgs = null;\n fn(...args);\n }, timeout);\n };\n ret.flush = () => {\n clearTimeout(handle);\n if (lastArgs) {\n const _lastArgs = lastArgs;\n lastArgs = null;\n fn(..._lastArgs);\n }\n };\n ret.cancel = () => {\n lastArgs = null;\n clearTimeout(handle);\n };\n return ret;\n};\n\n// throttle callback to execute once per animation frame\nexport const throttleRAF = <T extends any[]>(\n fn: (...args: T) => void,\n opts?: { trailing?: boolean },\n) => {\n let timerId: number | null = null;\n let lastArgs: T | null = null;\n let lastArgsTrailing: T | null = null;\n\n const scheduleFunc = (args: T) => {\n timerId = window.requestAnimationFrame(() => {\n timerId = null;\n fn(...args);\n lastArgs = null;\n if (lastArgsTrailing) {\n lastArgs = lastArgsTrailing;\n lastArgsTrailing = null;\n scheduleFunc(lastArgs);\n }\n });\n };\n\n const ret = (...args: T) => {\n if (isTestEnv()) {\n fn(...args);\n return;\n }\n lastArgs = args;\n if (timerId === null) {\n scheduleFunc(lastArgs);\n } else if (opts?.trailing) {\n lastArgsTrailing = args;\n }\n };\n ret.flush = () => {\n if (timerId !== null) {\n cancelAnimationFrame(timerId);\n timerId = null;\n }\n if (lastArgs) {\n fn(...(lastArgsTrailing || lastArgs));\n lastArgs = lastArgsTrailing = null;\n }\n };\n ret.cancel = () => {\n lastArgs = lastArgsTrailing = null;\n if (timerId !== null) {\n cancelAnimationFrame(timerId);\n timerId = null;\n }\n };\n return ret;\n};\n\n/**\n * Exponential ease-out method\n *\n * @param {number} k - The value to be tweened.\n * @returns {number} The tweened value.\n */\nexport const easeOut = (k: number) => {\n return 1 - Math.pow(1 - k, 4);\n};\n\nconst easeOutInterpolate = (from: number, to: number, progress: number) => {\n return (to - from) * easeOut(progress) + from;\n};\n\n/**\n * Animates values from `fromValues` to `toValues` using the requestAnimationFrame API.\n * Executes the `onStep` callback on each step with the interpolated values.\n * Returns a function that can be called to cancel the animation.\n *\n * @example\n * // Example usage:\n * const fromValues = { x: 0, y: 0 };\n * const toValues = { x: 100, y: 200 };\n * const onStep = ({x, y}) => {\n * setState(x, y)\n * };\n * const onCancel = () => {\n * console.log(\"Animation canceled\");\n * };\n *\n * const cancelAnimation = easeToValuesRAF({\n * fromValues,\n * toValues,\n * onStep,\n * onCancel,\n * });\n *\n * // To cancel the animation:\n * cancelAnimation();\n */\nexport const easeToValuesRAF = <\n T extends Record<keyof T, number>,\n K extends keyof T,\n>({\n fromValues,\n toValues,\n onStep,\n duration = 250,\n interpolateValue,\n onStart,\n onEnd,\n onCancel,\n}: {\n fromValues: T;\n toValues: T;\n /**\n * Interpolate a single value.\n * Return undefined to be handled by the default interpolator.\n */\n interpolateValue?: (\n fromValue: number,\n toValue: number,\n /** no easing applied */\n progress: number,\n key: K,\n ) => number | undefined;\n onStep: (values: T) => void;\n duration?: number;\n onStart?: () => void;\n onEnd?: () => void;\n onCancel?: () => void;\n}) => {\n let canceled = false;\n let frameId = 0;\n let startTime: number;\n\n function step(timestamp: number) {\n if (canceled) {\n return;\n }\n if (startTime === undefined) {\n startTime = timestamp;\n onStart?.();\n }\n\n const elapsed = Math.min(timestamp - startTime, duration);\n const factor = easeOut(elapsed / duration);\n\n const newValues = {} as T;\n\n Object.keys(fromValues).forEach((key) => {\n const _key = key as keyof T;\n const result = ((toValues[_key] - fromValues[_key]) * factor +\n fromValues[_key]) as T[keyof T];\n newValues[_key] = result;\n });\n\n onStep(newValues);\n\n if (elapsed < duration) {\n const progress = elapsed / duration;\n\n const newValues = {} as T;\n\n Object.keys(fromValues).forEach((key) => {\n const _key = key as K;\n const startValue = fromValues[_key];\n const endValue = toValues[_key];\n\n let result;\n\n result = interpolateValue\n ? interpolateValue(startValue, endValue, progress, _key)\n : easeOutInterpolate(startValue, endValue, progress);\n\n if (result == null) {\n result = easeOutInterpolate(startValue, endValue, progress);\n }\n\n newValues[_key] = result as T[K];\n });\n onStep(newValues);\n\n frameId = window.requestAnimationFrame(step);\n } else {\n onStep(toValues);\n onEnd?.();\n }\n }\n\n frameId = window.requestAnimationFrame(step);\n\n return () => {\n onCancel?.();\n canceled = true;\n window.cancelAnimationFrame(frameId);\n };\n};\n\n// https://github.com/lodash/lodash/blob/es/chunk.js\nexport const chunk = <T extends any>(\n array: readonly T[],\n size: number,\n): T[][] => {\n if (!array.length || size < 1) {\n return [];\n }\n let index = 0;\n let resIndex = 0;\n const result = Array(Math.ceil(array.length / size));\n while (index < array.length) {\n result[resIndex++] = array.slice(index, (index += size));\n }\n return result;\n};\n\nexport const selectNode = (node: Element) => {\n const selection = window.getSelection();\n if (selection) {\n const range = document.createRange();\n range.selectNodeContents(node);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n};\n\nexport const removeSelection = () => {\n const selection = window.getSelection();\n if (selection) {\n selection.removeAllRanges();\n }\n};\n\nexport const distance = (x: number, y: number) => Math.abs(x - y);\n\nexport const isSelectionLikeTool = (type: ToolType | \"custom\") => {\n return type === \"selection\" || type === \"lasso\";\n};\n\nexport const updateActiveTool = (\n appState: Pick<AppState, \"activeTool\">,\n data: ((\n | {\n type: ToolType;\n }\n | { type: \"custom\"; customType: string }\n ) & { locked?: boolean; fromSelection?: boolean }) & {\n lastActiveToolBeforeEraser?: ActiveTool | null;\n },\n): AppState[\"activeTool\"] => {\n if (data.type === \"custom\") {\n return {\n ...appState.activeTool,\n type: \"custom\",\n customType: data.customType,\n locked: data.locked ?? appState.activeTool.locked,\n };\n }\n\n return {\n ...appState.activeTool,\n lastActiveTool:\n data.lastActiveToolBeforeEraser === undefined\n ? appState.activeTool.lastActiveTool\n : data.lastActiveToolBeforeEraser,\n type: data.type,\n customType: null,\n locked: data.locked ?? appState.activeTool.locked,\n fromSelection: data.fromSelection ?? false,\n };\n};\n\nexport const isFullScreen = () =>\n document.fullscreenElement?.nodeName === \"HTML\";\n\nexport const allowFullScreen = () =>\n document.documentElement.requestFullscreen();\n\nexport const exitFullScreen = () => document.exitFullscreen();\n\nexport const viewportCoordsToSceneCoords = (\n { clientX, clientY }: { clientX: number; clientY: number },\n {\n zoom,\n offsetLeft,\n offsetTop,\n scrollX,\n scrollY,\n }: {\n zoom: Zoom;\n offsetLeft: number;\n offsetTop: number;\n scrollX: number;\n scrollY: number;\n },\n) => {\n const x = (clientX - offsetLeft) / zoom.value - scrollX;\n const y = (clientY - offsetTop) / zoom.value - scrollY;\n\n return { x, y };\n};\n\nexport const sceneCoordsToViewportCoords = (\n { sceneX, sceneY }: { sceneX: number; sceneY: number },\n {\n zoom,\n offsetLeft,\n offsetTop,\n scrollX,\n scrollY,\n }: {\n zoom: Zoom;\n offsetLeft: number;\n offsetTop: number;\n scrollX: number;\n scrollY: number;\n },\n) => {\n const x = (sceneX + scrollX) * zoom.value + offsetLeft;\n const y = (sceneY + scrollY) * zoom.value + offsetTop;\n return { x, y };\n};\n\nexport const getGlobalCSSVariable = (name: string) =>\n getComputedStyle(document.documentElement).getPropertyValue(`--${name}`);\n\nconst RS_LTR_CHARS =\n \"A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02B8\\u0300-\\u0590\\u0800-\\u1FFF\" +\n \"\\u2C00-\\uFB1C\\uFDFE-\\uFE6F\\uFEFD-\\uFFFF\";\nconst RS_RTL_CHARS = \"\\u0591-\\u07FF\\uFB1D-\\uFDFD\\uFE70-\\uFEFC\";\nconst RE_RTL_CHECK = new RegExp(`^[^${RS_LTR_CHARS}]*[${RS_RTL_CHARS}]`);\n/**\n * Checks whether first directional character is RTL. Meaning whether it starts\n * with RTL characters, or indeterminate (numbers etc.) characters followed by\n * RTL.\n * See https://github.com/excalidraw/excalidraw/pull/1722#discussion_r436340171\n */\nexport const isRTL = (text: string) => RE_RTL_CHECK.test(text);\n\nexport const tupleToCoors = (\n xyTuple: readonly [number, number],\n): { x: number; y: number } => {\n const [x, y] = xyTuple;\n return { x, y };\n};\n\n/** use as a rejectionHandler to mute filesystem Abort errors */\nexport const muteFSAbortError = (error?: Error) => {\n if (error?.name === \"AbortError\") {\n console.warn(error);\n return;\n }\n throw error;\n};\n\nexport const findIndex = <T>(\n array: readonly T[],\n cb: (element: T, index: number, array: readonly T[]) => boolean,\n fromIndex: number = 0,\n) => {\n if (fromIndex < 0) {\n fromIndex = array.length + fromIndex;\n }\n fromIndex = Math.min(array.length, Math.max(fromIndex, 0));\n let index = fromIndex - 1;\n while (++index < array.length) {\n if (cb(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n};\n\nexport const findLastIndex = <T>(\n array: readonly T[],\n cb: (element: T, index: number, array: readonly T[]) => boolean,\n fromIndex: number = array.length - 1,\n) => {\n if (fromIndex < 0) {\n fromIndex = array.length + fromIndex;\n }\n fromIndex = Math.min(array.length - 1, Math.max(fromIndex, 0));\n let index = fromIndex + 1;\n while (--index > -1) {\n if (cb(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n};\n\n/** returns the first non-null mapped value */\nexport const mapFind = <T, K>(\n collection: readonly T[],\n iteratee: (value: T, index: number) => K | undefined | null,\n): K | undefined => {\n for (let idx = 0; idx < collection.length; idx++) {\n const result = iteratee(collection[idx], idx);\n if (result != null) {\n return result;\n }\n }\n return undefined;\n};\n\nexport const isTransparent = (color: string) => {\n const isRGBTransparent = color.length === 5 && color.substr(4, 1) === \"0\";\n const isRRGGBBTransparent = color.length === 9 && color.substr(7, 2) === \"00\";\n return (\n isRGBTransparent ||\n isRRGGBBTransparent ||\n color === COLOR_PALETTE.transparent\n );\n};\n\nexport type ResolvablePromise<T> = Promise<T> & {\n resolve: [T] extends [undefined]\n ? (value?: MaybePromise<Awaited<T>>) => void\n : (value: MaybePromise<Awaited<T>>) => void;\n reject: (error: Error) => void;\n};\nexport const resolvablePromise = <T>() => {\n let resolve!: any;\n let reject!: any;\n const promise = new Promise((_resolve, _reject) => {\n resolve = _resolve;\n reject = _reject;\n });\n (promise as any).resolve = resolve;\n (promise as any).reject = reject;\n return promise as ResolvablePromise<T>;\n};\n\n//https://stackoverflow.com/a/9462382/8418\nexport const nFormatter = (num: number, digits: number): string => {\n const si = [\n { value: 1, symbol: \"b\" },\n { value: 1e3, symbol: \"k\" },\n { value: 1e6, symbol: \"M\" },\n { value: 1e9, symbol: \"G\" },\n ];\n const rx = /\\.0+$|(\\.[0-9]*[1-9])0+$/;\n let index;\n for (index = si.length - 1; index > 0; index--) {\n if (num >= si[index].value) {\n break;\n }\n }\n return (\n (num / si[index].value).toFixed(digits).replace(rx, \"$1\") + si[index].symbol\n );\n};\n\nexport const getVersion = () => {\n return (\n document.querySelector<HTMLMetaElement>('meta[name=\"version\"]')?.content ||\n DEFAULT_VERSION\n );\n};\n\n// Adapted from https://github.com/Modernizr/Modernizr/blob/master/feature-detects/emoji.js\nexport const supportsEmoji = () => {\n const canvas = document.createElement(\"canvas\");\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) {\n return false;\n }\n const offset = 12;\n ctx.fillStyle = \"#f00\";\n ctx.textBaseline = \"top\";\n ctx.font = \"32px Arial\";\n // Modernizr used \uD83D\uDC28, but it is sort of supported on Windows 7.\n // Luckily \uD83D\uDE00 isn't supported.\n ctx.fillText(\"\uD83D\uDE00\", 0, 0);\n return ctx.getImageData(offset, offset, 1, 1).data[0] !== 0;\n};\n\nexport const getNearestScrollableContainer = (\n element: HTMLElement,\n): HTMLElement | Document => {\n let parent = element.parentElement;\n while (parent) {\n if (parent === document.body) {\n return document;\n }\n const { overflowY } = window.getComputedStyle(parent);\n const hasScrollableContent = parent.scrollHeight > parent.clientHeight;\n if (\n hasScrollableContent &&\n (overflowY === \"auto\" ||\n overflowY === \"scroll\" ||\n overflowY === \"overlay\")\n ) {\n return parent;\n }\n parent = parent.parentElement;\n }\n return document;\n};\n\nexport const focusNearestParent = (element: HTMLInputElement) => {\n let parent = element.parentElement;\n while (parent) {\n if (parent.tabIndex > -1) {\n parent.focus();\n return;\n }\n parent = parent.parentElement;\n }\n};\n\nexport const preventUnload = (event: BeforeUnloadEvent) => {\n event.preventDefault();\n // NOTE: modern browsers no longer allow showing a custom message here\n event.returnValue = \"\";\n};\n\nexport const bytesToHexString = (bytes: Uint8Array) => {\n return Array.from(bytes)\n .map((byte) => `0${byte.toString(16)}`.slice(-2))\n .join(\"\");\n};\n\nexport const getUpdatedTimestamp = () => (isTestEnv() ? 1 : Date.now());\n\n/**\n * Transforms array of objects containing `id` attribute,\n * or array of ids (strings), into a Map, keyd by `id`.\n */\nexport const arrayToMap = <T extends { id: string } | string>(\n items: readonly T[] | Map<string, T>,\n) => {\n if (items instanceof Map) {\n return items;\n }\n return items.reduce((acc: Map<string, T>, element) => {\n acc.set(typeof element === \"string\" ? element : element.id, element);\n return acc;\n }, new Map() as Map<string, T>);\n};\n\nexport const arrayToMapWithIndex = <T extends { id: string }>(\n elements: readonly T[],\n) =>\n elements.reduce((acc, element: T, idx) => {\n acc.set(element.id, [element, idx]);\n return acc;\n }, new Map<string, [element: T, index: number]>());\n\n/**\n * Transform array into an object, use only when array order is irrelevant.\n */\nexport const arrayToObject = <T>(\n array: readonly T[],\n groupBy?: (value: T) => string | number,\n) =>\n array.reduce((acc, value, idx) => {\n acc[groupBy ? groupBy(value) : idx] = value;\n return acc;\n }, {} as { [key: string]: T });\n\n/** Doubly linked node */\nexport type Node<T> = T & {\n prev: Node<T> | null;\n next: Node<T> | null;\n};\n\n/**\n * Creates a circular doubly linked list by adding `prev` and `next` props to the existing array nodes.\n */\nexport const arrayToList = <T>(array: readonly T[]): Node<T>[] =>\n array.reduce((acc, curr, index) => {\n const node: Node<T> = { ...curr, prev: null, next: null };\n\n // no-op for first item, we don't want circular references on a single item\n if (index !== 0) {\n const prevNode = acc[index - 1];\n node.prev = prevNode;\n prevNode.next = node;\n\n if (index === array.length - 1) {\n // make the references circular and connect head & tail\n const firstNode = acc[0];\n node.next = firstNode;\n firstNode.prev = node;\n }\n }\n\n acc.push(node);\n\n return acc;\n }, [] as Node<T>[]);\n\n/**\n * Converts a readonly array or map into an iterable.\n * Useful for avoiding entry allocations when iterating object / map on each iteration.\n */\nexport const toIterable = <T>(\n values: readonly T[] | ReadonlyMap<string, T>,\n): Iterable<T> => {\n return Array.isArray(values) ? values : values.values();\n};\n\n/**\n * Converts a readonly array or map into an array.\n */\nexport const toArray = <T>(\n values: readonly T[] | ReadonlyMap<string, T>,\n): T[] => {\n return Array.isArray(values) ? values : Array.from(toIterable(values));\n};\n\nexport const isTestEnv = () => import.meta.env.MODE === ENV.TEST;\n\nexport const isDevEnv = () => import.meta.env.MODE === ENV.DEVELOPMENT;\n\nexport const isProdEnv = () => import.meta.env.MODE === ENV.PRODUCTION;\n\nexport const isServerEnv = () =>\n typeof process !== \"undefined\" && !!process?.env?.NODE_ENV;\n\nexport const wrapEvent = <T extends Event>(name: EVENT, nativeEvent: T) => {\n return new CustomEvent(name, {\n detail: {\n nativeEvent,\n },\n cancelable: true,\n });\n};\n\nexport const updateObject = <T extends Record<string, any>>(\n obj: T,\n updates: Partial<T>,\n): T => {\n let didChange = false;\n for (const key in updates) {\n const value = (updates as any)[key];\n if (typeof value !== \"undefined\") {\n if (\n (obj as any)[key] === value &&\n // if object, always update because its attrs could have changed\n (typeof value !== \"object\" || value === null)\n ) {\n continue;\n }\n didChange = true;\n }\n }\n\n if (!didChange) {\n return obj;\n }\n\n return {\n ...obj,\n ...updates,\n };\n};\n\nexport const isPrimitive = (val: any) => {\n const type = typeof val;\n return val == null || (type !== \"object\" && type !== \"function\");\n};\n\nexport const getFrame = () => {\n try {\n return window.self === window.top ? \"top\" : \"iframe\";\n } catch (error) {\n return \"iframe\";\n }\n};\n\nexport const isRunningInIframe = () => getFrame() === \"iframe\";\n\nexport const isPromiseLike = (\n value: any,\n): value is Promise<ResolutionType<typeof value>> => {\n return (\n !!value &&\n typeof value === \"object\" &&\n \"then\" in value &&\n \"catch\" in value &&\n \"finally\" in value\n );\n};\n\nexport const queryFocusableElements = (container: HTMLElement | null) => {\n const focusableElements = container?.querySelectorAll<HTMLElement>(\n \"button, a, input, select, textarea, div[tabindex], label[tabindex]\",\n );\n\n return focusableElements\n ? Array.from(focusableElements).filter(\n (element) =>\n element.tabIndex > -1 && !(element as HTMLInputElement).disabled,\n )\n : [];\n};\n\n/** use as a fallback after identity check (for perf reasons) */\nconst _defaultIsShallowComparatorFallback = (a: any, b: any): boolean => {\n // consider two empty arrays equal\n if (\n Array.isArray(a) &&\n Array.isArray(b) &&\n a.length === 0 &&\n b.length === 0\n ) {\n return true;\n }\n return a === b;\n};\n\n/**\n * Returns whether object/array is shallow equal.\n * Considers empty object/arrays as equal (whether top-level or second-level).\n */\nexport const isShallowEqual = <\n T extends Record<string, any>,\n K extends readonly unknown[],\n>(\n objA: T,\n objB: T,\n comparators?:\n | { [key in keyof T]?: (a: T[key], b: T[key]) => boolean }\n | (keyof T extends K[number]\n ? K extends readonly (keyof T)[]\n ? K\n : {\n _error: \"keys are either missing or include keys not in compared obj\";\n }\n : {\n _error: \"keys are either missing or include keys not in compared obj\";\n }),\n debug = false,\n) => {\n const aKeys = Object.keys(objA);\n const bKeys = Object.keys(objB);\n if (aKeys.length !== bKeys.length) {\n if (debug) {\n console.warn(\n `%cisShallowEqual: objects don't have same properties ->`,\n \"color: #8B4000\",\n objA,\n objB,\n );\n }\n return false;\n }\n\n if (comparators && Array.isArray(comparators)) {\n for (const key of comparators) {\n const ret =\n objA[key] === objB[key] ||\n _defaultIsShallowComparatorFallback(objA[key], objB[key]);\n if (!ret) {\n if (debug) {\n console.warn(\n `%cisShallowEqual: ${key} not equal ->`,\n \"color: #8B4000\",\n objA[key],\n objB[key],\n );\n }\n return false;\n }\n }\n return true;\n }\n\n return aKeys.every((key) => {\n const comparator = (\n comparators as { [key in keyof T]?: (a: T[key], b: T[key]) => boolean }\n )?.[key as keyof T];\n const ret = comparator\n ? comparator(objA[key], objB[key])\n : objA[key] === objB[key] ||\n _defaultIsShallowComparatorFallback(objA[key], objB[key]);\n\n if (!ret && debug) {\n console.warn(\n `%cisShallowEqual: ${key} not equal ->`,\n \"color: #8B4000\",\n objA[key],\n objB[key],\n );\n }\n return ret;\n });\n};\n\n// taken from Radix UI\n// https://github.com/radix-ui/primitives/blob/main/packages/core/primitive/src/primitive.tsx\nexport const composeEventHandlers = <E>(\n originalEventHandler?: (event: E) => void,\n ourEventHandler?: (event: E) => void,\n { checkForDefaultPrevented = true } = {},\n) => {\n return function handleEvent(event: E) {\n originalEventHandler?.(event);\n\n if (\n !checkForDefaultPrevented ||\n !(event as unknown as Event)?.defaultPrevented\n ) {\n return ourEventHandler?.(event);\n }\n };\n};\n\n/**\n * supply `null` as message if non-never value is valid, you just need to\n * typecheck against it\n */\nexport const assertNever = (\n value: never,\n message: string | null,\n softAssert?: boolean,\n): never => {\n if (!message) {\n return value;\n }\n if (softAssert) {\n console.error(message);\n return value;\n }\n\n throw new Error(message);\n};\n\nexport function invariant(condition: any, message: string): asserts condition {\n if (!condition) {\n throw new Error(message);\n }\n}\n\n/**\n * Memoizes on values of `opts` object (strict equality).\n */\nexport const memoize = <T extends Record<string, any>, R extends any>(\n func: (opts: T) => R,\n) => {\n let lastArgs: Map<string, any> | undefined;\n let lastResult: R | undefined;\n\n const ret = function (opts: T) {\n const currentArgs = Object.entries(opts);\n\n if (lastArgs) {\n let argsAreEqual = true;\n for (const [key, value] of currentArgs) {\n if (lastArgs.get(key) !== value) {\n argsAreEqual = false;\n break;\n }\n }\n if (argsAreEqual) {\n return lastResult;\n }\n }\n\n const result = func(opts);\n\n lastArgs = new Map(currentArgs);\n lastResult = result;\n\n return result;\n };\n\n ret.clear = () => {\n lastArgs = undefined;\n lastResult = undefined;\n };\n\n return ret as typeof func & { clear: () => void };\n};\n\n/** Checks if value is inside given collection. Useful for type-safety. */\nexport const isMemberOf = <T extends string>(\n /** Set/Map/Array/Object */\n collection: Set<T> | readonly T[] | Record<T, any> | Map<T, any>,\n /** value to look for */\n value: string,\n): value is T => {\n return collection instanceof Set || collection instanceof Map\n ? collection.has(value as T)\n : \"includes\" in collection\n ? collection.includes(value as T)\n : collection.hasOwnProperty(value);\n};\n\nexport const cloneJSON = <T>(obj: T): T => JSON.parse(JSON.stringify(obj));\n\nexport const updateStable = <T extends any[] | Record<string, any>>(\n prevValue: T,\n nextValue: T,\n) => {\n if (isShallowEqual(prevValue, nextValue)) {\n return prevValue;\n }\n return nextValue;\n};\n\n// Window\nexport function addEventListener<K extends keyof WindowEventMap>(\n target: Window & typeof globalThis,\n type: K,\n listener: (this: Window, ev: WindowEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions,\n): UnsubscribeCallback;\nexport function addEventListener(\n target: Window & typeof globalThis,\n type: string,\n listener: (this: Window, ev: Event) => any,\n options?: boolean | AddEventListenerOptions,\n): UnsubscribeCallback;\n// Document\nexport function addEventListener<K extends keyof DocumentEventMap>(\n target: Document,\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions,\n): UnsubscribeCallback;\nexport function addEventListener(\n target: Document,\n type: string,\n listener: (this: Document, ev: Event) => any,\n options?: boolean | AddEventListenerOptions,\n): UnsubscribeCallback;\n// FontFaceSet (document.fonts)\nexport function addEventListener<K extends keyof FontFaceSetEventMap>(\n target: FontFaceSet,\n type: K,\n listener: (this: FontFaceSet, ev: FontFaceSetEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions,\n): UnsubscribeCallback;\n// HTMLElement / mix\nexport function addEventListener<K extends keyof HTMLElementEventMap>(\n target:\n | Document\n | (Window & typeof globalThis)\n | HTMLElement\n | undefined\n | null\n | false,\n type: K,\n listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions,\n): UnsubscribeCallback;\n// implem\nexport function addEventListener(\n /**\n * allows for falsy values so you don't have to type check when adding\n * event listeners to optional elements\n */\n target:\n | Document\n | (Window & typeof globalThis)\n | FontFaceSet\n | HTMLElement\n | undefined\n | null\n | false,\n type: keyof WindowEventMap | keyof DocumentEventMap | string,\n listener: (ev: Event) => any,\n options?: boolean | AddEventListenerOptions,\n): UnsubscribeCallback {\n if (!target) {\n return () => {};\n }\n target?.addEventListener?.(type, listener, options);\n return () => {\n target?.removeEventListener?.(type, listener, options);\n };\n}\n\nexport function getSvgPathFromStroke(points: number[][], closed = true) {\n const len = points.length;\n\n if (len < 4) {\n return ``;\n }\n\n let a = points[0];\n let b = points[1];\n const c = points[2];\n\n let result = `M${a[0].toFixed(2)},${a[1].toFixed(2)} Q${b[0].toFixed(\n 2,\n )},${b[1].toFixed(2)} ${average(b[0], c[0]).toFixed(2)},${average(\n b[1],\n c[1],\n ).toFixed(2)} T`;\n\n for (let i = 2, max = len - 1; i < max; i++) {\n a = points[i];\n b = points[i + 1];\n result += `${average(a[0], b[0]).toFixed(2)},${average(a[1], b[1]).toFixed(\n 2,\n )} `;\n }\n\n if (closed) {\n result += \"Z\";\n }\n\n return result;\n}\n\nexport const normalizeEOL = (str: string) => {\n return str.replace(/\\r?\\n|\\r/g, \"\\n\");\n};\n\n// -----------------------------------------------------------------------------\ntype HasBrand<T> = {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n [K in keyof T]: K extends `~brand${infer _}` ? true : never;\n}[keyof T];\n\ntype RemoveAllBrands<T> = HasBrand<T> extends true\n ? {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n [K in keyof T as K extends `~brand~${infer _}` ? never : K]: T[K];\n }\n : never;\n\n// adapted from https://github.com/colinhacks/zod/discussions/1994#discussioncomment-6068940\n// currently does not cover all types (e.g. tuples, promises...)\ntype Unbrand<T> = T extends Map<infer E, infer F>\n ? Map<E, F>\n : T extends Set<infer E>\n ? Set<E>\n : T extends Array<infer E>\n ? Array<E>\n : RemoveAllBrands<T>;\n\n/**\n * Makes type into a branded type, ensuring that value is assignable to\n * the base ubranded type. Optionally you can explicitly supply current value\n * type to combine both (useful for composite branded types. Make sure you\n * compose branded types which are not composite themselves.)\n */\nexport const toBrandedType = <BrandedType, CurrentType = BrandedType>(\n value: Unbrand<BrandedType>,\n) => {\n return value as CurrentType & BrandedType;\n};\n\n// -----------------------------------------------------------------------------\n\n// Promise.try, adapted from https://github.com/sindresorhus/p-try\nexport const promiseTry = async <TValue, TArgs extends unknown[]>(\n fn: (...args: TArgs) => PromiseLike<TValue> | TValue,\n ...args: TArgs\n): Promise<TValue> => {\n return new Promise((resolve) => {\n resolve(fn(...args));\n });\n};\n\nexport const isAnyTrue = (...args: boolean[]): boolean =>\n Math.max(...args.map((arg) => (arg ? 1 : 0))) > 0;\n\nexport const safelyParseJSON = (json: string): Record<string, any> | null => {\n try {\n return JSON.parse(json);\n } catch {\n return null;\n }\n};\n\n/**\n * use when you need to render unsafe string as HTML attribute, but MAKE SURE\n * the attribute is double-quoted when constructing the HTML string\n */\nexport const escapeDoubleQuotes = (str: string) => {\n return str.replace(/\"/g, \"&quot;\");\n};\n\nexport const castArray = <T>(value: T | T[]): T[] =>\n Array.isArray(value) ? value : [value];\n\n/** hack for Array.isArray type guard not working with readonly value[] */\nexport const isReadonlyArray = (value?: any): value is readonly any[] => {\n return Array.isArray(value);\n};\n\nexport const sizeOf = (\n value:\n | readonly unknown[]\n | Readonly<Map<string, unknown>>\n | Readonly<Record<string, unknown>>\n | ReadonlySet<unknown>,\n): number => {\n return isReadonlyArray(value)\n ? value.length\n : value instanceof Map || value instanceof Set\n ? value.size\n : Object.keys(value).length;\n};\n\nexport const reduceToCommonValue = <T, R = T>(\n collection: readonly T[] | ReadonlySet<T>,\n getValue?: (item: T) => R,\n): R | null => {\n if (sizeOf(collection) === 0) {\n return null;\n }\n\n const valueExtractor = getValue || ((item: T) => item as unknown as R);\n\n let commonValue: R | null = null;\n\n for (const item of collection) {\n const value = valueExtractor(item);\n if ((commonValue === null || commonValue === value) && value != null) {\n commonValue = value;\n } else {\n return null;\n }\n }\n\n return commonValue;\n};\n\ntype FEATURE_FLAGS = {\n COMPLEX_BINDINGS: boolean;\n};\n\nconst FEATURE_FLAGS_STORAGE_KEY = \"excalidraw-feature-flags\";\nconst DEFAULT_FEATURE_FLAGS: FEATURE_FLAGS = {\n COMPLEX_BINDINGS: false,\n};\nlet featureFlags: FEATURE_FLAGS | null = null;\n\nexport const getFeatureFlag = <F extends keyof FEATURE_FLAGS>(\n flag: F,\n): FEATURE_FLAGS[F] => {\n if (!featureFlags) {\n try {\n const serializedFlags = localStorage.getItem(FEATURE_FLAGS_STORAGE_KEY);\n if (serializedFlags) {\n const flags = JSON.parse(serializedFlags);\n featureFlags = flags ?? DEFAULT_FEATURE_FLAGS;\n }\n } catch {}\n }\n\n return (featureFlags || DEFAULT_FEATURE_FLAGS)[flag];\n};\n\nexport const setFeatureFlag = <F extends keyof FEATURE_FLAGS>(\n flag: F,\n value: FEATURE_FLAGS[F],\n) => {\n try {\n featureFlags = {\n ...(featureFlags || DEFAULT_FEATURE_FLAGS),\n [flag]: value,\n };\n localStorage.setItem(\n FEATURE_FLAGS_STORAGE_KEY,\n JSON.stringify(featureFlags),\n );\n } catch (e) {\n console.error(\"unable to set feature flag\", e);\n }\n};\n", "import { sanitizeUrl } from \"@braintree/sanitize-url\";\n\nimport { escapeDoubleQuotes } from \"./utils\";\n\nexport const normalizeLink = (link: string) => {\n link = link.trim();\n if (!link) {\n return link;\n }\n return sanitizeUrl(escapeDoubleQuotes(link));\n};\n\nexport const isLocalLink = (link: string | null) => {\n return !!(link?.includes(location.origin) || link?.startsWith(\"/\"));\n};\n\n/**\n * Returns URL sanitized and safe for usage in places such as\n * iframe's src attribute or <a> href attributes.\n */\nexport const toValidURL = (link: string) => {\n link = normalizeLink(link);\n\n // make relative links into fully-qualified urls\n if (link.startsWith(\"/\")) {\n return `${location.origin}${link}`;\n }\n\n try {\n new URL(link);\n } catch {\n // if link does not parse as URL, assume invalid and return blank page\n return \"about:blank\";\n }\n\n return link;\n};\n", "import type { UnsubscribeCallback } from \"@excalidraw/excalidraw/types\";\n\ntype Subscriber<T extends any[]> = (...payload: T) => void;\n\nexport class Emitter<T extends any[] = []> {\n public subscribers: Subscriber<T>[] = [];\n\n /**\n * Attaches subscriber\n *\n * @returns unsubscribe function\n */\n on(...handlers: Subscriber<T>[] | Subscriber<T>[][]): UnsubscribeCallback {\n const _handlers = handlers\n .flat()\n .filter((item) => typeof item === \"function\");\n\n this.subscribers.push(..._handlers);\n\n return () => this.off(_handlers);\n }\n\n once(...handlers: Subscriber<T>[] | Subscriber<T>[][]): UnsubscribeCallback {\n const _handlers = handlers\n .flat()\n .filter((item) => typeof item === \"function\");\n\n _handlers.push(() => detach());\n\n const detach = this.on(..._handlers);\n return detach;\n }\n\n off(...handlers: Subscriber<T>[] | Subscriber<T>[][]) {\n const _handlers = handlers.flat();\n this.subscribers = this.subscribers.filter(\n (handler) => !_handlers.includes(handler),\n );\n }\n\n trigger(...payload: T) {\n for (const handler of this.subscribers) {\n handler(...payload);\n }\n return this;\n }\n\n clear() {\n this.subscribers = [];\n }\n}\n", "import {\n isLineSegment,\n lineSegment,\n pointFrom,\n type GlobalPoint,\n type LocalPoint,\n} from \"@excalidraw/math\";\n\nimport type { Curve } from \"@excalidraw/math\";\nimport type { LineSegment } from \"@excalidraw/utils\";\n\nimport { type Bounds, isBounds } from \"./bounds\";\n\n// The global data holder to collect the debug operations\ndeclare global {\n interface Window {\n visualDebug?: {\n data: DebugElement[][];\n currentFrame?: number;\n };\n }\n}\n\nexport type DebugElement = {\n color: string;\n data: LineSegment<GlobalPoint> | Curve<GlobalPoint>;\n permanent: boolean;\n};\n\nexport const debugDrawCubicBezier = (\n c: Curve<GlobalPoint>,\n opts?: {\n color?: string;\n permanent?: boolean;\n },\n) => {\n addToCurrentFrame({\n color: opts?.color ?? \"purple\",\n permanent: !!opts?.permanent,\n data: c,\n });\n};\n\nexport const debugDrawLine = (\n segment: LineSegment<GlobalPoint> | LineSegment<GlobalPoint>[],\n opts?: {\n color?: string;\n permanent?: boolean;\n },\n) => {\n const segments = (\n isLineSegment(segment) ? [segment] : segment\n ) as LineSegment<GlobalPoint>[];\n\n segments.forEach((data) =>\n addToCurrentFrame({\n color: opts?.color ?? \"red\",\n data,\n permanent: !!opts?.permanent,\n }),\n );\n};\n\nexport const debugDrawPoint = (\n p: GlobalPoint,\n opts?: {\n color?: string;\n permanent?: boolean;\n fuzzy?: boolean;\n },\n) => {\n const xOffset = opts?.fuzzy ? Math.random() * 3 : 0;\n const yOffset = opts?.fuzzy ? Math.random() * 3 : 0;\n\n debugDrawLine(\n lineSegment(\n pointFrom<GlobalPoint>(p[0] + xOffset - 10, p[1] + yOffset - 10),\n pointFrom<GlobalPoint>(p[0] + xOffset + 10, p[1] + yOffset + 10),\n ),\n {\n color: opts?.color ?? \"cyan\",\n permanent: opts?.permanent,\n },\n );\n debugDrawLine(\n lineSegment(\n pointFrom<GlobalPoint>(p[0] + xOffset - 10, p[1] + yOffset + 10),\n pointFrom<GlobalPoint>(p[0] + xOffset + 10, p[1] + yOffset - 10),\n ),\n {\n color: opts?.color ?? \"cyan\",\n permanent: opts?.permanent,\n },\n );\n};\n\nexport const debugDrawBounds = (\n box: Bounds | Bounds[],\n opts?: {\n color?: string;\n permanent?: boolean;\n },\n) => {\n (isBounds(box) ? [box] : box).forEach((bbox) =>\n debugDrawLine(\n [\n lineSegment(\n pointFrom<GlobalPoint>(bbox[0], bbox[1]),\n pointFrom<GlobalPoint>(bbox[2], bbox[1]),\n ),\n lineSegment(\n pointFrom<GlobalPoint>(bbox[2], bbox[1]),\n pointFrom<GlobalPoint>(bbox[2], bbox[3]),\n ),\n lineSegment(\n pointFrom<GlobalPoint>(bbox[2], bbox[3]),\n pointFrom<GlobalPoint>(bbox[0], bbox[3]),\n ),\n lineSegment(\n pointFrom<GlobalPoint>(bbox[0], bbox[3]),\n pointFrom<GlobalPoint>(bbox[0], bbox[1]),\n ),\n ],\n {\n color: opts?.color ?? \"green\",\n permanent: !!opts?.permanent,\n },\n ),\n );\n};\n\nexport const debugDrawPoints = (\n {\n x,\n y,\n points,\n }: {\n x: number;\n y: number;\n points: readonly LocalPoint[];\n },\n options?: any,\n) => {\n points.forEach((p) =>\n debugDrawPoint(pointFrom<GlobalPoint>(x + p[0], y + p[1]), options),\n );\n};\n\nexport const debugCloseFrame = () => {\n window.visualDebug?.data.push([]);\n};\n\nexport const debugClear = () => {\n if (window.visualDebug?.data) {\n window.visualDebug.data = [];\n }\n};\n\nconst addToCurrentFrame = (element: DebugElement) => {\n if (window.visualDebug?.data && window.visualDebug.data.length === 0) {\n window.visualDebug.data[0] = [];\n }\n window.visualDebug?.data &&\n window.visualDebug.data[window.visualDebug.data.length - 1].push(element);\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,uCAAC,KAAM,KAAI;AAAA;AAAA;;;ACAX;AAAA;AAAA;AAAA,KAAC,SAAU,MAAM,SAAS;AAExB,UAAI,OAAO,WAAW,cAAc,OAAO,KAAK;AAC9C,eAAO,CAAC,GAAG,OAAO;AAAA,MACpB,WAAW,OAAO,YAAY,UAAU;AACtC,eAAO,UAAU,QAAQ;AAAA,MAC3B,OAAO;AACL,aAAK,cAAc,QAAQ;AAE3B,aAAK,cAAc,KAAK;AAAA,MAC1B;AAAA,IACF,GAAG,SAAM,WAAY;AACnB;AAEA,UAAI,cAAc,WAAY;AAC5B,aAAK,aAAa,CAAC;AAAA,MACrB;AAEA,kBAAY,UAAU,mBAAmB,SAAU,MAAM,UAAU;AACjE,aAAK,WAAW,IAAI,IAAI,KAAK,WAAW,IAAI,KAAK,CAAC;AAClD,YAAI,KAAK,WAAW,IAAI,EAAE,QAAQ,QAAQ,IAAI,GAAG;AAC/C,eAAK,WAAW,IAAI,EAAE,KAAK,QAAQ;AAAA,QACrC;AAAA,MACF;AAEA,kBAAY,UAAU,sBAAsB,SAAU,MAAM,UAAU;AACpE,YAAI,KAAK,WAAW,IAAI,GAAG;AACzB,cAAI,IAAI,KAAK,WAAW,IAAI,EAAE,QAAQ,QAAQ;AAC9C,cAAI,KAAK,GAAG;AACV,iBAAK,WAAW,IAAI,EAAE,OAAO,GAAG,CAAC;AAAA,UACnC;AAAA,QACF;AAAA,MACF;AAEA,kBAAY,UAAU,gBAAgB,SAAU,KAAK;AACnD,YAAI,KAAK,WAAW,IAAI,IAAI,KAAK,KAAK,WAAW,IAAI,IAAI,EAAE,QAAQ;AACjE,cAAI,YAAY,KAAK,WA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ACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,MAAQ;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,OAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,QAAU;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,QAAU;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,MAAQ;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,MAAQ;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,MAAQ;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,OAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,MAAQ;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA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C,UAAuB,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC;AAAA,QACzC;AAAA,QACA;AAAA,UACE,UAAuB,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC;AAAA,UACvC,UAAuB,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC;AAAA,QACzC;AAAA,MACF;AAAA,MACA;AAAA,QACE,OAAO,MAAM,SAAS;AAAA,QACtB,WAAW,CAAC,CAAC,MAAM;AAAA,MACrB;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,kBAAkB,CAC7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AACF,GAKA,YACG;AACH,SAAO;AAAA,IAAQ,CAAC,MACd,eAAe,UAAuB,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,GAAG,OAAO;AAAA,EACpE;AACF;AAEO,IAAM,kBAAkB,MAAM;AACnC,SAAO,aAAa,KAAK,KAAK,CAAC,CAAC;AAClC;AAEO,IAAM,aAAa,MAAM;AAC9B,MAAI,OAAO,aAAa,MAAM;AAC5B,WAAO,YAAY,OAAO,CAAC;AAAA,EAC7B;AACF;AAEA,IAAM,oBAAoB,CAAC,YAA0B;AACnD,MAAI,OAAO,aAAa,QAAQ,OAAO,YAAY,KAAK,WAAW,GAAG;AACpE,WAAO,YAAY,KAAK,CAAC,IAAI,CAAC;AAAA,EAChC;AACA,SAAO,aAAa,QAClB,OAAO,YAAY,KAAK,OAAO,YAAY,KAAK,SAAS,CAAC,EAAE,KAAK,OAAO;AAC5E;",
6
+ "names": ["Promise", "PromisePool", "sanitizeUrl", "EVENT", "UserIdleState", "Pool", "newValues"]
7
+ }
@@ -0,0 +1,4 @@
1
+ var Ie=Object.create;var $=Object.defineProperty;var Ce=Object.getOwnPropertyDescriptor;var Pe=Object.getOwnPropertyNames;var De=Object.getPrototypeOf,Ue=Object.prototype.hasOwnProperty;var Ne=(e,t)=>()=>(e&&(t=e(e=0)),t);var j=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ke=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Pe(t))!Ue.call(e,r)&&r!==n&&$(e,r,{get:()=>t[r],enumerable:!(o=Ce(t,r))||o.enumerable});return e};var Z=(e,t,n)=>(n=e!=null?Ie(De(e)):{},ke(t||!e||!e.__esModule?$(n,"default",{value:e,enumerable:!0}):n,e));var f,c=Ne(()=>{f={PROD:!0}});var be=j((Y,Te)=>{c();(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof Y=="object"?Te.exports=t():(e.PromisePool=t(),e.promisePool=e.PromisePool)})(Y,function(){"use strict";var e=function(){this._listeners={}};e.prototype.addEventListener=function(s,i){this._listeners[s]=this._listeners[s]||[],this._listeners[s].indexOf(i)<0&&this._listeners[s].push(i)},e.prototype.removeEventListener=function(s,i){if(this._listeners[s]){var p=this._listeners[s].indexOf(i);p>=0&&this._listeners[s].splice(p,1)}},e.prototype.dispatchEvent=function(s){if(this._listeners[s.type]&&this._listeners[s.type].length)for(var i=this._listeners[s.type].slice(),p=0,T=i.length;p<T;++p)i[p].call(this,s)};var t=function(s){return typeof s.constructor=="function"&&s.constructor.name==="GeneratorFunction"},n=function(s){return{next:function(){var i=s();return i?{value:i}:{done:!0}}}},o=function(s){var i=!1;return{next:function(){return i?{done:!0}:(i=!0,{value:s})}}},r=function(s,i){var p=typeof s;if(p==="object"){if(typeof s.next=="function")return s;if(typeof s.then=="function")return o(s)}return p==="function"?t(s)?s():n(s):o(i.resolve(s))},l=function(s,i,p){this.target=s,this.type=i,this.data=p},a=function(s,i,p){if(e.call(this),typeof i!="number"||Math.floor(i)!==i||i<1)throw new Error("Invalid concurrency");this._concurrency=i,this._options=p||{},this._options.promise=this._options.promise||Promise,this._iterator=r(s,this._options.promise),this._done=!1,this._size=0,this._promise=null,this._callbacks=null};return a.prototype=new e,a.prototype.constructor=a,a.prototype.concurrency=function(s){return typeof s<"u"&&(this._concurrency=s,this.active()&&this._proceed()),this._concurrency},a.prototype.size=function(){return this._size},a.prototype.active=function(){return!!this._promise},a.prototype.promise=function(){return this._promise},a.prototype.start=function(){var s=this,i=this._options.promise;return this._promise=new i(function(p,T){s._callbacks={reject:T,resolve:p},s._proceed()}),this._promise},a.prototype._fireEvent=function(s,i){this.dispatchEvent(new l(this,s,i))},a.prototype._settle=function(s){s?this._callbacks.reject(s):this._callbacks.resolve(),this._promise=null,this._callbacks=null},a.prototype._onPooledPromiseFulfilled=function(s,i){this._size--,this.active()&&(this._fireEvent("fulfilled",{promise:s,result:i}),this._proceed())},a.prototype._onPooledPromiseRejected=function(s,i){this._size--,this.active()&&(this._fireEvent("rejected",{promise:s,error:i}),this._settle(i||new Error("Unknown error")))},a.prototype._trackPromise=function(s){var i=this;s.then(function(p){i._onPooledPromiseFulfilled(s,p)},function(p){i._onPooledPromiseRejected(s,p)}).catch(function(p){i._settle(new Error("Promise processing failed: "+p))})},a.prototype._proceed=function(){if(!this._done){for(var s={done:!1};this._size<this._concurrency&&!(s=this._iterator.next()).done;)this._size++,this._trackPromise(s.value);this._done=s===null||!!s.done}this._done&&this._size===0&&this._settle()},a.PromisePoolEvent=l,a.PromisePool=a,a})});var ve=j(k=>{"use strict";c();Object.defineProperty(k,"__esModule",{value:!0});k.sanitizeUrl=void 0;var Tt=/^([^\w]*)(javascript|data|vbscript)/im,bt=/&#(\w+)(^\w|;)?/g,xt=/&(newline|tab);/gi,_t=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,At=/^.+(:|&colon;)/gim,yt=[".","/"];function ht(e){return yt.indexOf(e[0])>-1}function gt(e){return e.replace(bt,function(t,n){return String.fromCharCode(n)})}function St(e){var t=gt(e||"").replace(xt,"").replace(_t,"").trim();if(!t)return"about:blank";if(ht(t))return t;var n=t.match(At);if(!n)return t;var o=n[0];return Tt.test(o)?"about:blank":t}k.sanitizeUrl=St});c();c();var Q=class{constructor(t){this.scoreFunction=t}content=[];sinkDown(t){let n=this.content[t],o=this.scoreFunction(n);for(;t>0;){let r=(t+1>>1)-1,l=this.content[r];if(o<this.scoreFunction(l))this.content[t]=l,t=r;else break}this.content[t]=n}bubbleUp(t){let n=this.content.length,o=this.content[t],r=this.scoreFunction(o);for(;;){let l=(t+1<<1)-1,a=l+1,s=t,i=r;if(l<n){let p=this.scoreFunction(this.content[l]);p<i&&(s=l,i=p)}if(a<n&&this.scoreFunction(this.content[a])<i&&(s=a),s===t)break;this.content[t]=this.content[s],t=s}this.content[t]=o}push(t){this.content.push(t),this.sinkDown(this.content.length-1)}pop(){if(this.content.length===0)return null;let t=this.content[0],n=this.content.pop();return this.content.length>0&&(this.content[0]=n,this.bubbleUp(0)),t}remove(t){if(this.content.length===0)return;let n=this.content.indexOf(t),o=this.content.pop();n<this.content.length&&(this.content[n]=o,this.scoreFunction(o)<this.scoreFunction(t)?this.sinkDown(n):this.bubbleUp(n))}size(){return this.content.length}rescoreElement(t){this.sinkDown(this.content.indexOf(t))}};c();var q=e=>Array.isArray(e)&&e.length===4&&typeof e[0]=="number"&&typeof e[1]=="number"&&typeof e[2]=="number"&&typeof e[3]=="number";c();var J={white:"#ffffff",black:"#000000",gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]};var Ut=240,Be=(e,t)=>t.reduce((n,o)=>(o in e&&(n[o]=e[o]),n),{}),Nt=5,kt=5,Ht=4,I=4,C=1,b=[0,2,4,6,8],Gt=[0,1,2,3,4],x=(e,t)=>t.map(n=>J[e][n]),u={transparent:"transparent",black:"#1e1e1e",white:"#ffffff",gray:x("gray",b),red:x("red",b),pink:x("pink",b),grape:x("grape",b),violet:x("violet",b),blue:x("blue",b),cyan:x("cyan",b),teal:x("teal",b),green:x("green",b),yellow:x("yellow",b),orange:x("orange",b),bronze:["#f8f1ee","#eaddd7","#d2bab0","#a18072","#846358"]},ee=Be(u,["cyan","blue","violet","grape","pink","green","teal","yellow","orange","red"]),Bt=[u.black,u.red[I],u.green[I],u.blue[I],u.yellow[I]],Kt=[u.transparent,u.red[C],u.green[C],u.blue[C],u.yellow[C]],Wt=[u.white,"#f8f9fa","#f5faff","#fffce8","#fdf8f6"],Yt={transparent:u.transparent,white:u.white,gray:u.gray,black:u.black,bronze:u.bronze,...ee},Xt={transparent:u.transparent,white:u.white,gray:u.gray,black:u.black,bronze:u.bronze,...ee},Vt=e=>[u.cyan[e],u.blue[e],u.violet[e],u.grape[e],u.pink[e],u.green[e],u.teal[e],u.yellow[e],u.orange[e],u.red[e]],zt=(e,t,n)=>`#${((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)}`;c();var Qt=typeof window<"u"&&"ResizeObserver"in window,qt="Excalidraw",Jt=36,en=10,tn=20,nn=8,on=5,rn=1,sn=30,an=Math.PI/12,ln="red",cn={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},un={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1,ERASER:5},pn={enabled:"all",disabled:"none",inheritFromUI:"var(--ui-pointerEvents)"},Ke=(d=>(d.COPY="copy",d.PASTE="paste",d.CUT="cut",d.KEYDOWN="keydown",d.KEYUP="keyup",d.MOUSE_MOVE="mousemove",d.RESIZE="resize",d.UNLOAD="unload",d.FOCUS="focus",d.BLUR="blur",d.DRAG_OVER="dragover",d.DROP="drop",d.GESTURE_END="gestureend",d.BEFORE_UNLOAD="beforeunload",d.GESTURE_START="gesturestart",d.GESTURE_CHANGE="gesturechange",d.POINTER_MOVE="pointermove",d.POINTER_DOWN="pointerdown",d.POINTER_UP="pointerup",d.STATE_CHANGE="statechange",d.WHEEL="wheel",d.TOUCH_START="touchstart",d.TOUCH_END="touchend",d.HASHCHANGE="hashchange",d.VISIBILITY_CHANGE="visibilitychange",d.SCROLL="scroll",d.EXCALIDRAW_LINK="excalidraw-link",d.MENU_ITEM_SELECT="menu.itemSelect",d.MESSAGE="message",d.FULLSCREENCHANGE="fullscreenchange",d))(Ke||{}),dn={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},P={TEST:"test",DEVELOPMENT:"development",PRODUCTION:"production"},fn={SIDEBAR:"sidebar",SHAPE_ACTIONS_MENU:"App-menu__left",ZOOM_ACTIONS:"zoom-actions",SEARCH_MENU_INPUT_WRAPPER:"layer-ui__search-inputWrapper",CONVERT_ELEMENT_TYPE_POPUP:"ConvertElementTypePopup",SHAPE_ACTIONS_THEME_SCOPE:"shape-actions-theme-scope",FRAME_NAME:"frame-name"},mn={sm:16,md:20,lg:28,xl:36},ne="Xiaolai",R="Segoe UI Emoji",m={Virgil:1,Helvetica:2,Cascadia:3,Excalifont:5,Nunito:6,"Lilita One":7,"Comic Shanns":8,"Liberation Sans":9,Assistant:10},oe="sans-serif",re="monospace",We={[oe]:998,[re]:999},W={[ne]:100,...We,[R]:1e3};function Ye(e){switch(e){case m.Cascadia:case m["Comic Shanns"]:return re;default:return oe}}var se=e=>{let t=Ye(e);switch(e){case m.Excalifont:return[ne,t,R];default:return[t,R]}},En={LIGHT:"light",DARK:"dark"},Tn={strokeColor:"#bbb",strokeWidth:2,strokeStyle:"solid",fillStyle:"solid",roughness:0,roundness:null,backgroundColor:"transparent",radius:8,nameOffsetY:3,nameColorLightTheme:"#999999",nameColorDarkTheme:"#7a7a7a",nameFontSize:14,nameLineHeight:1.25},bn=1,xn=20,_n=m.Excalifont,An="left",yn="top",ae="{version}",Xe=2,Ve=2*Xe,ze=1e-5,hn=2*Ve-ze,gn="#ffffff",Sn="#1e1e1e",Ln="#a2f1a6",On=["selectAll"],Rn=20,vn=5,ie={svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",ico:"image/x-icon",avif:"image/avif",jfif:"image/jfif"},$e={text:"text/plain",html:"text/html",json:"application/json",excalidraw:"application/vnd.excalidraw+json",excalidrawlib:"application/vnd.excalidrawlib+json",excalidrawlibIds:"application/vnd.excalidrawlib.ids+json"},te={...$e,"excalidraw.svg":"image/svg+xml","excalidraw.png":"image/png",binary:"application/octet-stream",...ie},Fn=[te.text,te.html,...Object.values(ie)],Mn={png:"png",svg:"svg",clipboard:"clipboard"},wn={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib",excalidrawClipboardWithAPI:"excalidraw-api/clipboard"},In=()=>window.EXCALIDRAW_EXPORT_SOURCE||window.location.origin,Cn=500,Pn=300,Dn=500,Un=1e4,Nn=3e4,kn=100,Hn=.1,Gn=.1,Bn=30,Kn=300,Wn=6e4,Yn=3e3,Xn="invert(93%) hue-rotate(180deg)",Vn={addLibrary:"addLibrary"},zn={addLibrary:"addLibrary"},$n={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,toggleTheme:null,saveAsImage:!0},tools:{image:!0},toolBar:{lockEnabled:!0,moreToolsEnabled:!0,hintViewerEnabled:!0},topLeftMenuEnabled:!0,libraryEnabled:!0,footer:{helpEnabled:!0},fontPicker:{familyChangeEnabled:!0},shapeControl:{sloppinessChangeEnabled:!0},viewModeControlEnabled:!0,hideAnnotationsControlEnabled:!0,undoRedoPosition:"footer",swapTopMenuAndFooter:!1},jn=2,Zn=[1,2,3],Qn=10,qn=1440,Jn=4*1024*1024,eo="http://www.w3.org/2000/svg",to=`<?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ `,no=128,oo={excalidraw:2,excalidrawLibrary:2},ro=5,so=.7,ao=11,io={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},lo={LEFT:"left",CENTER:"center",RIGHT:"right"},co=20,uo=.25,po=32,fo={LEGACY:1,PROPORTIONAL_RADIUS:2,ADAPTIVE_RADIUS:3},je={architect:0,artist:1,cartoonist:2},mo={thin:1,bold:2,extraBold:4},Eo={strokeColor:u.black,backgroundColor:u.transparent,fillStyle:"solid",strokeWidth:2,strokeStyle:"solid",roughness:je.artist,opacity:100,locked:!1},Ze="library",To="search",bo={name:"default",defaultTab:Ze},xo=new Set(["iframe","embeddable","image"]),_o={selection:"selection",lasso:"lasso",rectangle:"rectangle",diamond:"diamond",ellipse:"ellipse",arrow:"arrow",line:"line",freedraw:"freedraw",text:"text",image:"image",eraser:"eraser",hand:"hand",frame:"frame",magicframe:"magicframe",embeddable:"embeddable",laser:"laser"},Ao={OAI_API_KEY:"excalidraw-oai-api-key",MERMAID_TO_EXCALIDRAW:"mermaid-to-excalidraw",PUBLISH_LIBRARY:"publish-library-data"},yo="Untitled",ho={generalStats:1,elementProperties:2},go=1,So={sharp:"sharp",round:"round",elbow:"elbow"},Lo=.3,Oo="element",Ro=Symbol.for("__test__originalId__"),Qe=(o=>(o.ACTIVE="active",o.AWAY="away",o.IDLE="idle",o))(Qe||{}),vo=20,Fo=35,Mo=700,wo={background:"var(--mobile-action-button-bg)"};c();var D={[m.Excalifont]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25}},[m.Nunito]:{metrics:{unitsPerEm:1e3,ascender:1011,descender:-353,lineHeight:1.25}},[m["Lilita One"]]:{metrics:{unitsPerEm:1e3,ascender:923,descender:-220,lineHeight:1.15}},[m["Comic Shanns"]]:{metrics:{unitsPerEm:1e3,ascender:750,descender:-250,lineHeight:1.25}},[m.Virgil]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},deprecated:!0},[m.Helvetica]:{metrics:{unitsPerEm:2048,ascender:1577,descender:-471,lineHeight:1.15},deprecated:!0,local:!0},[m.Cascadia]:{metrics:{unitsPerEm:2048,ascender:1900,descender:-480,lineHeight:1.2},deprecated:!0},[m["Liberation Sans"]]:{metrics:{unitsPerEm:2048,ascender:1854,descender:-434,lineHeight:1.15},private:!0},[m.Assistant]:{metrics:{unitsPerEm:2048,ascender:1021,descender:-287,lineHeight:1.25},private:!0},[W.Xiaolai]:{metrics:{unitsPerEm:1e3,ascender:880,descender:-144,lineHeight:1.25},fallback:!0},[W["Segoe UI Emoji"]]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},local:!0,fallback:!0}},Do={LATIN:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD",LATIN_EXT:"U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF",CYRILIC_EXT:"U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F",CYRILIC:"U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116",VIETNAMESE:"U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB"},Uo="local:",No=(e,t,n)=>{let{unitsPerEm:o,ascender:r,descender:l}=D[e]?.metrics||D[m.Excalifont].metrics,a=t/o,s=(n-a*r+a*l)/2;return a*r+s},ko=e=>{let{lineHeight:t}=D[e]?.metrics||D[m.Excalifont].metrics;return t};c();var le=class{jobs=[];running=!1;tick(){if(this.running)return;let t=this.jobs.shift();t?(this.running=!0,t.promise.resolve(ue(t.jobFactory,...t.args).finally(()=>{this.running=!1,this.tick()}))):this.running=!1}push(t,...n){let o=ce();return this.jobs.push({jobFactory:t,promise:o,args:n}),this.tick(),o}};c();c();var pe="excalidraw.desktopUIMode",Yo=599,Xo=1e3,Vo=500,zo=600,$o=1400,jo=1440,Zo=1229,de=/Mac|iPod|iPhone|iPad/.test(navigator.platform),Qo=/^Win/.test(navigator.platform),fe=/\b(android)\b/i.test(navigator.userAgent),qo=typeof window<"u"&&"netscape"in window&&navigator.userAgent.indexOf("rv:")>1&&navigator.userAgent.indexOf("Gecko")>1,qe=navigator.userAgent.indexOf("Chrome")!==-1,Jo=!qe&&navigator.userAgent.indexOf("Safari")!==-1,me=/iPad|iPhone/i.test(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,er=()=>navigator.brave?.isBrave?.name==="isBrave",Je=(e,t)=>e<=599||t<500&&e<1e3,et=(e,t)=>{let n=Math.min(e,t),o=Math.max(e,t);return n>=600&&o<=1400},tt=()=>{let e=navigator.userAgent||"",t=navigator.platform||"",n=navigator.userAgentData;if(n){let r=(n.platform||"").toLowerCase(),l=r==="windows"||r==="macos"||r==="linux"||r==="chrome os";if(n.mobile===!0)return!0;if(n.mobile===!1&&r==="android")return matchMedia?.("(hover: none)").matches&&matchMedia?.("(pointer: coarse)").matches;if(l)return!1}if(me)return!0;if(fe){let r=/Mobile/i.test(e);if(r||!r)return matchMedia?.("(hover: none)").matches&&matchMedia?.("(pointer: coarse)").matches}return/Win|Linux|CrOS|Mac/.test(t)||/Windows NT|X11|CrOS|Macintosh/.test(e),!1},tr=(e,t)=>Je(e,t)?"phone":et(e,t)?"tablet":"desktop",nr=e=>e.formFactor==="phone"?"mobile":e.formFactor==="tablet"?"compact":e.desktopUIMode,or=e=>{let t=e??"",n="unknown";return me?n="ios":fe?n="android":t&&(n="other"),{isMobileDevice:tt(),platform:n}},rr=()=>{if(typeof window>"u")return null;try{let e=window.localStorage.getItem(pe);if(e==="compact"||e==="full")return e}catch{}return null},nt=e=>{if(!(typeof window>"u"))try{window.localStorage.setItem(pe,e)}catch{}},sr=e=>{if(!(e!=="compact"&&e!=="full"))return nt(e),e};var Ee={EQUAL:"Equal",MINUS:"Minus",NUM_ADD:"NumpadAdd",NUM_SUBTRACT:"NumpadSubtract",NUM_ZERO:"Numpad0",BRACKET_RIGHT:"BracketRight",BRACKET_LEFT:"BracketLeft",ONE:"Digit1",TWO:"Digit2",THREE:"Digit3",NINE:"Digit9",QUOTE:"Quote",ZERO:"Digit0",SLASH:"Slash",C:"KeyC",D:"KeyD",H:"KeyH",V:"KeyV",Z:"KeyZ",Y:"KeyY",R:"KeyR",S:"KeyS"},g={ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",BACKSPACE:"Backspace",ALT:"Alt",CTRL_OR_CMD:de?"metaKey":"ctrlKey",DELETE:"Delete",ENTER:"Enter",ESCAPE:"Escape",QUESTION_MARK:"?",SPACE:" ",TAB:"Tab",CHEVRON_LEFT:"<",CHEVRON_RIGHT:">",PERIOD:".",COMMA:",",SUBTRACT:"-",SLASH:"/",A:"a",C:"c",D:"d",E:"e",F:"f",G:"g",H:"h",I:"i",L:"l",O:"o",P:"p",Q:"q",R:"r",S:"s",T:"t",V:"v",X:"x",Y:"y",Z:"z",K:"k",W:"w",0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9"},ot=new Map([[g.Z,Ee.Z],[g.Y,Ee.Y]]),rt=e=>/^[a-z]$/.test(e.toLowerCase()),cr=(e,t)=>{if(t===e.key.toLowerCase())return!0;let n=ot.get(t);return!!(n&&!rt(e.key)&&e.code===n)},ur=e=>e===g.ARROW_LEFT||e===g.ARROW_RIGHT||e===g.ARROW_DOWN||e===g.ARROW_UP,pr=e=>e.altKey,dr=e=>e.shiftKey,fr=e=>e.shiftKey;c();import{pointFromPair as st}from"@excalidraw/math";var br=e=>{let t=e.map(o=>o[0]),n=e.map(o=>o[1]);return{width:Math.max(...t)-Math.min(...t),height:Math.max(...n)-Math.min(...n)}},xr=(e,t,n,o)=>{let r=n.map(_=>_[e]),l=Math.max(...r),a=Math.min(...r),s=l-a,i=s===0?1:t/s,p=1/0,T=n.map(_=>{let A=_[e]*i,y=[..._];return y[e]=A,A<p&&(p=A),y});if(!o||T.length===2)return T;let F=a-p;return T.map(_=>st(_.map((A,y)=>y===e?A+F:A)))},_r=(e,t,n)=>n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t];c();var _e=Z(be(),1),xe=class{pool;entries={};constructor(t,n){this.pool=new _e.default(t,n)}all(){let t=n=>{if(n.data.result){let[o,r]=n.data.result;this.entries[o]=r}};return this.pool.addEventListener("fulfilled",t),this.pool.start().then(()=>(setTimeout(()=>{this.pool.removeEventListener("fulfilled",t)}),Object.values(this.entries)))}};c();c();c();var Ae=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");c();var v=class{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}};c();import{average as U}from"@excalidraw/math";var X=null,Ur=e=>{X=e},Nr=()=>{if(X)return X;let e=new Date,t=e.getFullYear(),n=`${e.getMonth()+1}`.padStart(2,"0"),o=`${e.getDate()}`.padStart(2,"0"),r=`${e.getHours()}`.padStart(2,"0"),l=`${e.getMinutes()}`.padStart(2,"0");return`${t}-${n}-${o}-${r}${l}`},kr=e=>e.charAt(0).toUpperCase()+e.slice(1),Hr=e=>e instanceof HTMLElement&&e.className.includes("ToolIcon"),at=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement,Gr=e=>at(e)||e instanceof Element&&!!e.closest("label, button"),Br=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&(e.type==="text"||e.type==="number"||e.type==="password"||e.type==="search"),it=({fontFamily:e})=>{for(let[t,n]of Object.entries(m))if(n===e)return`${t}${se(n).map(o=>`, ${o}`).join("")}`;return R},Kr=({fontSize:e,fontFamily:t})=>`${e}px ${it({fontFamily:t})}`,Wr=async e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},Yr=(e,t)=>{let n=0,o=null,r=(...l)=>{o=l,clearTimeout(n),n=window.setTimeout(()=>{o=null,e(...l)},t)};return r.flush=()=>{if(clearTimeout(n),o){let l=o;o=null,e(...l)}},r.cancel=()=>{o=null,clearTimeout(n)},r},Xr=(e,t)=>{let n=null,o=null,r=null,l=s=>{n=window.requestAnimationFrame(()=>{n=null,e(...s),o=null,r&&(o=r,r=null,l(o))})},a=(...s)=>{if(N()){e(...s);return}o=s,n===null?l(o):t?.trailing&&(r=s)};return a.flush=()=>{n!==null&&(cancelAnimationFrame(n),n=null),o&&(e(...r||o),o=r=null)},a.cancel=()=>{o=r=null,n!==null&&(cancelAnimationFrame(n),n=null)},a},ge=e=>1-Math.pow(1-e,4),ye=(e,t,n)=>(t-e)*ge(n)+e,Vr=({fromValues:e,toValues:t,onStep:n,duration:o=250,interpolateValue:r,onStart:l,onEnd:a,onCancel:s})=>{let i=!1,p=0,T;function F(H){if(i)return;T===void 0&&(T=H,l?.());let _=Math.min(H-T,o),A=ge(_/o),y={};if(Object.keys(e).forEach(O=>{let h=O,G=(t[h]-e[h])*A+e[h];y[h]=G}),n(y),_<o){let O=_/o,h={};Object.keys(e).forEach(G=>{let M=G,B=e[M],K=t[M],w;w=r?r(B,K,O,M):ye(B,K,O),w==null&&(w=ye(B,K,O)),h[M]=w}),n(h),p=window.requestAnimationFrame(F)}else n(t),a?.()}return p=window.requestAnimationFrame(F),()=>{s?.(),i=!0,window.cancelAnimationFrame(p)}},zr=(e,t)=>{if(!e.length||t<1)return[];let n=0,o=0,r=Array(Math.ceil(e.length/t));for(;n<e.length;)r[o++]=e.slice(n,n+=t);return r},$r=e=>{let t=window.getSelection();if(t){let n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}},jr=()=>{let e=window.getSelection();e&&e.removeAllRanges()},Zr=(e,t)=>Math.abs(e-t),Qr=e=>e==="selection"||e==="lasso",qr=(e,t)=>t.type==="custom"?{...e.activeTool,type:"custom",customType:t.customType,locked:t.locked??e.activeTool.locked}:{...e.activeTool,lastActiveTool:t.lastActiveToolBeforeEraser===void 0?e.activeTool.lastActiveTool:t.lastActiveToolBeforeEraser,type:t.type,customType:null,locked:t.locked??e.activeTool.locked,fromSelection:t.fromSelection??!1},Jr=()=>document.fullscreenElement?.nodeName==="HTML",es=()=>document.documentElement.requestFullscreen(),ts=()=>document.exitFullscreen(),ns=({clientX:e,clientY:t},{zoom:n,offsetLeft:o,offsetTop:r,scrollX:l,scrollY:a})=>{let s=(e-o)/n.value-l,i=(t-r)/n.value-a;return{x:s,y:i}},os=({sceneX:e,sceneY:t},{zoom:n,offsetLeft:o,offsetTop:r,scrollX:l,scrollY:a})=>{let s=(e+l)*n.value+o,i=(t+a)*n.value+r;return{x:s,y:i}},rs=e=>getComputedStyle(document.documentElement).getPropertyValue(`--${e}`),lt="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u2C00-\uFB1C\uFDFE-\uFE6F\uFEFD-\uFFFF",ct="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",ut=new RegExp(`^[^${lt}]*[${ct}]`),ss=e=>ut.test(e),as=e=>{let[t,n]=e;return{x:t,y:n}},is=e=>{if(e?.name==="AbortError"){console.warn(e);return}throw e},ls=(e,t,n=0)=>{n<0&&(n=e.length+n),n=Math.min(e.length,Math.max(n,0));let o=n-1;for(;++o<e.length;)if(t(e[o],o,e))return o;return-1},cs=(e,t,n=e.length-1)=>{n<0&&(n=e.length+n),n=Math.min(e.length-1,Math.max(n,0));let o=n+1;for(;--o>-1;)if(t(e[o],o,e))return o;return-1},us=(e,t)=>{for(let n=0;n<e.length;n++){let o=t(e[n],n);if(o!=null)return o}},ps=e=>{let t=e.length===5&&e.substr(4,1)==="0",n=e.length===9&&e.substr(7,2)==="00";return t||n||e===u.transparent},ce=()=>{let e,t,n=new Promise((o,r)=>{e=o,t=r});return n.resolve=e,n.reject=t,n},ds=(e,t)=>{let n=[{value:1,symbol:"b"},{value:1e3,symbol:"k"},{value:1e6,symbol:"M"},{value:1e9,symbol:"G"}],o=/\.0+$|(\.[0-9]*[1-9])0+$/,r;for(r=n.length-1;r>0&&!(e>=n[r].value);r--);return(e/n[r].value).toFixed(t).replace(o,"$1")+n[r].symbol},fs=()=>document.querySelector('meta[name="version"]')?.content||ae,ms=()=>{let t=document.createElement("canvas").getContext("2d");if(!t)return!1;let n=12;return t.fillStyle="#f00",t.textBaseline="top",t.font="32px Arial",t.fillText("\u{1F600}",0,0),t.getImageData(n,n,1,1).data[0]!==0},Es=e=>{let t=e.parentElement;for(;t;){if(t===document.body)return document;let{overflowY:n}=window.getComputedStyle(t);if(t.scrollHeight>t.clientHeight&&(n==="auto"||n==="scroll"||n==="overlay"))return t;t=t.parentElement}return document},Ts=e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1){t.focus();return}t=t.parentElement}},bs=e=>{e.preventDefault(),e.returnValue=""},xs=e=>Array.from(e).map(t=>`0${t.toString(16)}`.slice(-2)).join(""),_s=()=>N()?1:Date.now(),As=e=>e instanceof Map?e:e.reduce((t,n)=>(t.set(typeof n=="string"?n:n.id,n),t),new Map),ys=e=>e.reduce((t,n,o)=>(t.set(n.id,[n,o]),t),new Map),hs=(e,t)=>e.reduce((n,o,r)=>(n[t?t(o):r]=o,n),{}),gs=e=>e.reduce((t,n,o)=>{let r={...n,prev:null,next:null};if(o!==0){let l=t[o-1];if(r.prev=l,l.next=r,o===e.length-1){let a=t[0];r.next=a,a.prev=r}}return t.push(r),t},[]),pt=e=>Array.isArray(e)?e:e.values(),Ss=e=>Array.isArray(e)?e:Array.from(pt(e)),N=()=>f.MODE===P.TEST,Ls=()=>f.MODE===P.DEVELOPMENT,Os=()=>f.MODE===P.PRODUCTION,Rs=()=>typeof process<"u"&&!0,vs=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),Fs=(e,t)=>{let n=!1;for(let o in t){let r=t[o];if(typeof r<"u"){if(e[o]===r&&(typeof r!="object"||r===null))continue;n=!0}}return n?{...e,...t}:e},Ms=e=>{let t=typeof e;return e==null||t!=="object"&&t!=="function"},dt=()=>{try{return window.self===window.top?"top":"iframe"}catch{return"iframe"}},ws=()=>dt()==="iframe",Is=e=>!!e&&typeof e=="object"&&"then"in e&&"catch"in e&&"finally"in e,Cs=e=>{let t=e?.querySelectorAll("button, a, input, select, textarea, div[tabindex], label[tabindex]");return t?Array.from(t).filter(n=>n.tabIndex>-1&&!n.disabled):[]},he=(e,t)=>Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t,ft=(e,t,n,o=!1)=>{let r=Object.keys(e),l=Object.keys(t);if(r.length!==l.length)return o&&console.warn("%cisShallowEqual: objects don't have same properties ->","color: #8B4000",e,t),!1;if(n&&Array.isArray(n)){for(let a of n)if(!(e[a]===t[a]||he(e[a],t[a])))return o&&console.warn(`%cisShallowEqual: ${a} not equal ->`,"color: #8B4000",e[a],t[a]),!1;return!0}return r.every(a=>{let s=n?.[a],i=s?s(e[a],t[a]):e[a]===t[a]||he(e[a],t[a]);return!i&&o&&console.warn(`%cisShallowEqual: ${a} not equal ->`,"color: #8B4000",e[a],t[a]),i})},Ps=(e,t,{checkForDefaultPrevented:n=!0}={})=>function(r){if(e?.(r),!n||!r?.defaultPrevented)return t?.(r)},Ds=(e,t,n)=>{if(!t)return e;if(n)return console.error(t),e;throw new Error(t)};function Us(e,t){if(!e)throw new Error(t)}var Ns=e=>{let t,n,o=function(r){let l=Object.entries(r);if(t){let s=!0;for(let[i,p]of l)if(t.get(i)!==p){s=!1;break}if(s)return n}let a=e(r);return t=new Map(l),n=a,a};return o.clear=()=>{t=void 0,n=void 0},o},ks=(e,t)=>e instanceof Set||e instanceof Map?e.has(t):"includes"in e?e.includes(t):e.hasOwnProperty(t),Hs=e=>JSON.parse(JSON.stringify(e)),Gs=(e,t)=>ft(e,t)?e:t;function Bs(e,t,n,o){return e?(e?.addEventListener?.(t,n,o),()=>{e?.removeEventListener?.(t,n,o)}):()=>{}}function Ks(e,t=!0){let n=e.length;if(n<4)return"";let o=e[0],r=e[1],l=e[2],a=`M${o[0].toFixed(2)},${o[1].toFixed(2)} Q${r[0].toFixed(2)},${r[1].toFixed(2)} ${U(r[0],l[0]).toFixed(2)},${U(r[1],l[1]).toFixed(2)} T`;for(let s=2,i=n-1;s<i;s++)o=e[s],r=e[s+1],a+=`${U(o[0],r[0]).toFixed(2)},${U(o[1],r[1]).toFixed(2)} `;return t&&(a+="Z"),a}var Ws=e=>e.replace(/\r?\n|\r/g,`
4
+ `),Ys=e=>e,ue=async(e,...t)=>new Promise(n=>{n(e(...t))}),Xs=(...e)=>Math.max(...e.map(t=>t?1:0))>0,Vs=e=>{try{return JSON.parse(e)}catch{return null}},Se=e=>e.replace(/"/g,"&quot;"),zs=e=>Array.isArray(e)?e:[e],mt=e=>Array.isArray(e),Et=e=>mt(e)?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length,$s=(e,t)=>{if(Et(e)===0)return null;let n=t||(r=>r),o=null;for(let r of e){let l=n(r);if((o===null||o===l)&&l!=null)o=l;else return null}return o},Le="excalidraw-feature-flags",V={COMPLEX_BINDINGS:!1},S=null,js=e=>{if(!S)try{let t=localStorage.getItem(Le);t&&(S=JSON.parse(t)??V)}catch{}return(S||V)[e]},Zs=(e,t)=>{try{S={...S||V,[e]:t},localStorage.setItem(Le,JSON.stringify(S))}catch(n){console.error("unable to set feature flag",n)}};var Oe=new v(Date.now()),Re=0,na=()=>Math.floor(Oe.next()*2**31),oa=e=>{Oe=new v(e),Re=0},ra=()=>N()?`id${Re++}`:Ae();c();var Fe=Z(ve(),1);var Lt=e=>(e=e.trim(),e&&(0,Fe.sanitizeUrl)(Se(e))),ua=e=>!!(e?.includes(location.origin)||e?.startsWith("/")),pa=e=>{if(e=Lt(e),e.startsWith("/"))return`${location.origin}${e}`;try{new URL(e)}catch{return"about:blank"}return e};c();var Me=class{subscribers=[];on(...t){let n=t.flat().filter(o=>typeof o=="function");return this.subscribers.push(...n),()=>this.off(n)}once(...t){let n=t.flat().filter(r=>typeof r=="function");n.push(()=>o());let o=this.on(...n);return o}off(...t){let n=t.flat();this.subscribers=this.subscribers.filter(o=>!n.includes(o))}trigger(...t){for(let n of this.subscribers)n(...t);return this}clear(){this.subscribers=[]}};c();import{isLineSegment as Ot,lineSegment as L,pointFrom as E}from"@excalidraw/math";var xa=(e,t)=>{we({color:t?.color??"purple",permanent:!!t?.permanent,data:e})},z=(e,t)=>{(Ot(e)?[e]:e).forEach(o=>we({color:t?.color??"red",data:o,permanent:!!t?.permanent}))},Rt=(e,t)=>{let n=t?.fuzzy?Math.random()*3:0,o=t?.fuzzy?Math.random()*3:0;z(L(E(e[0]+n-10,e[1]+o-10),E(e[0]+n+10,e[1]+o+10)),{color:t?.color??"cyan",permanent:t?.permanent}),z(L(E(e[0]+n-10,e[1]+o+10),E(e[0]+n+10,e[1]+o-10)),{color:t?.color??"cyan",permanent:t?.permanent})},_a=(e,t)=>{(q(e)?[e]:e).forEach(n=>z([L(E(n[0],n[1]),E(n[2],n[1])),L(E(n[2],n[1]),E(n[2],n[3])),L(E(n[2],n[3]),E(n[0],n[3])),L(E(n[0],n[3]),E(n[0],n[1]))],{color:t?.color??"green",permanent:!!t?.permanent}))},Aa=({x:e,y:t,points:n},o)=>{n.forEach(r=>Rt(E(e+r[0],t+r[1]),o))},ya=()=>{window.visualDebug?.data.push([])},ha=()=>{window.visualDebug?.data&&(window.visualDebug.data=[])},we=e=>{window.visualDebug?.data&&window.visualDebug.data.length===0&&(window.visualDebug.data[0]=[]),window.visualDebug?.data&&window.visualDebug.data[window.visualDebug.data.length-1].push(e)};export{Yn as ACTIVE_THRESHOLD,Fn as ALLOWED_PASTE_MIME_TYPES,qt as APP_NAME,ao as ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO,so as ARROW_LABEL_WIDTH_FRACTION,So as ARROW_TYPE,Mo as BIND_MODE_TIMEOUT,ro as BOUND_TEXT_PADDING,Q as BinaryHeap,On as CANVAS_ONLY_ACTIONS,Gt as CANVAS_PALETTE_SHADE_INDEXES,To as CANVAS_SEARCH_TAB,ne as CJK_HAND_DRAWN_FALLBACK_FONT,fn as CLASSES,Ee as CODES,kt as COLORS_PER_ROW,Sn as COLOR_CHARCOAL_BLACK,Ut as COLOR_OUTLINE_CONTRAST_THRESHOLD,u as COLOR_PALETTE,Ln as COLOR_VOICE_CALL,gn as COLOR_WHITE,cn as CURSOR_TYPE,po as DEFAULT_ADAPTIVE_RADIUS,Wt as DEFAULT_CANVAS_BACKGROUND_PICKS,Ht as DEFAULT_CHART_COLOR_INDEX,hn as DEFAULT_COLLISION_THRESHOLD,C as DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX,Xt as DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE,Kt as DEFAULT_ELEMENT_BACKGROUND_PICKS,Eo as DEFAULT_ELEMENT_PROPS,I as DEFAULT_ELEMENT_STROKE_COLOR_INDEX,Yt as DEFAULT_ELEMENT_STROKE_COLOR_PALETTE,Bt as DEFAULT_ELEMENT_STROKE_PICKS,Qn as DEFAULT_EXPORT_PADDING,yo as DEFAULT_FILENAME,_n as DEFAULT_FONT_FAMILY,xn as DEFAULT_FONT_SIZE,Rn as DEFAULT_GRID_SIZE,vn as DEFAULT_GRID_STEP,ln as DEFAULT_LASER_COLOR,qn as DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT,uo as DEFAULT_PROPORTIONAL_RADIUS,Lo as DEFAULT_REDUCED_GLOBAL_ALPHA,bo as DEFAULT_SIDEBAR,An as DEFAULT_TEXT_ALIGN,Xe as DEFAULT_TRANSFORM_HANDLE_SPACING,$n as DEFAULT_UI_OPTIONS,ae as DEFAULT_VERSION,yn as DEFAULT_VERTICAL_ALIGN,Fo as DOUBLE_TAP_POSITION_THRESHOLD,en as DRAGGING_THRESHOLD,Ao as EDITOR_LS_KEYS,b as ELEMENTS_PALETTE_SHADE_INDEXES,Oo as ELEMENT_LINK_KEY,co as ELEMENT_READY_TO_ERASE_OPACITY,on as ELEMENT_SHIFT_TRANSLATE_AMOUNT,rn as ELEMENT_TRANSLATE_AMOUNT,no as ENCRYPTION_KEY_BITS,P as ENV,ze as EPSILON,Ke as EVENT,wn as EXPORT_DATA_TYPES,Mn as EXPORT_IMAGE_TYPES,Zn as EXPORT_SCALES,Me as Emitter,m as FONT_FAMILY,W as FONT_FAMILY_FALLBACKS,We as FONT_FAMILY_GENERIC_FALLBACKS,D as FONT_METADATA,mn as FONT_SIZES,Tn as FRAME_STYLE,Do as GOOGLE_FONTS_RANGES,Kn as HYPERLINK_TOOLTIP_DELAY,Wn as IDLE_THRESHOLD,ie as IMAGE_MIME_TYPES,Cn as IMAGE_RENDER_TIMEOUT,g as KEYS,ot as KeyCodeMap,xo as LIBRARY_DISABLED_TYPES,Ze as LIBRARY_SIDEBAR_TAB,nn as LINE_CONFIRM_THRESHOLD,vo as LINE_POLYGON_POINT_MERGE_DISTANCE,Uo as LOCAL_FONT_PROTOCOL,Jn as MAX_ALLOWED_FILE_BYTES,Nt as MAX_CUSTOM_COLORS_USED_IN_CANVAS,jn as MAX_DECIMALS_FOR_SVG_EXPORT,Bn as MAX_ZOOM,te as MIME_TYPES,tn as MINIMUM_ARROW_SIZE,bn as MIN_FONT_SIZE,go as MIN_WIDTH_OR_HEIGHT,Gn as MIN_ZOOM,wo as MOBILE_ACTION_BUTTON_BG,re as MONOSPACE_GENERIC_FONT,Vo as MQ_MAX_HEIGHT_LANDSCAPE,Yo as MQ_MAX_MOBILE,$o as MQ_MAX_TABLET,Xo as MQ_MAX_WIDTH_LANDSCAPE,zo as MQ_MIN_TABLET,jo as MQ_MIN_WIDTH_DESKTOP,Zo as MQ_RIGHT_SIDEBAR_MIN_WIDTH,Ro as ORIG_ID,un as POINTER_BUTTON,pn as POINTER_EVENTS,xe as PromisePool,le as Queue,je as ROUGHNESS,fo as ROUNDNESS,oe as SANS_SERIF_GENERIC_FONT,kn as SCROLL_TIMEOUT,an as SHIFT_LOCKING_ANGLE,Ve as SIDE_RESIZING_THRESHOLD,ho as STATS_PANELS,$e as STRING_MIME_TYPES,mo as STROKE_WIDTH,to as SVG_DOCUMENT_PREAMBLE,eo as SVG_NS,Pn as TAP_TWICE_TIMEOUT,lo as TEXT_ALIGN,Jt as TEXT_AUTOWRAP_THRESHOLD,sn as TEXT_TO_CENTER_SNAP_THRESHOLD,En as THEME,Xn as THEME_FILTER,Un as TITLE_TIMEOUT,_o as TOOL_TYPE,Dn as TOUCH_CTX_MENU_TIMEOUT,zn as URL_HASH_KEYS,Vn as URL_QUERY_KEYS,Qe as UserIdleState,oo as VERSIONS,Nn as VERSION_TIMEOUT,io as VERTICAL_ALIGN,R as WINDOWS_EMOJI_FALLBACK_FONT,dn as YOUTUBE_STATES,Hn as ZOOM_STEP,Bs as addEventListener,es as allowFullScreen,gs as arrayToList,As as arrayToMap,ys as arrayToMapWithIndex,hs as arrayToObject,Ds as assertNever,xs as bytesToHexString,kr as capitalizeString,zs as castArray,zr as chunk,Hs as cloneJSON,Ps as composeEventHandlers,or as createUserAgentDescriptor,Yr as debounce,ha as debugClear,ya as debugCloseFrame,_a as debugDrawBounds,xa as debugDrawCubicBezier,z as debugDrawLine,Rt as debugDrawPoint,Aa as debugDrawPoints,nr as deriveStylesPanelMode,Zr as distance,ge as easeOut,Vr as easeToValuesRAF,Se as escapeDoubleQuotes,ts as exitFullScreen,ls as findIndex,cs as findLastIndex,Ts as focusNearestParent,Vt as getAllColorsSpecificShade,Nr as getDateTime,In as getExportSource,js as getFeatureFlag,se as getFontFamilyFallbacks,it as getFontFamilyString,Kr as getFontString,tr as getFormFactor,dt as getFrame,Ye as getGenericFontFamilyFallback,rs as getGlobalCSSVariable,_r as getGridPoint,ko as getLineHeight,Es as getNearestScrollableContainer,br as getSizeFromPoints,x as getSpecificColorShades,Ks as getSvgPathFromStroke,_s as getUpdatedTimestamp,fs as getVersion,No as getVerticalOffset,Us as invariant,fe as isAndroid,Xs as isAnyTrue,ur as isArrowKey,q as isBounds,er as isBrave,qe as isChrome,de as isDarwin,Ls as isDevEnv,qo as isFirefox,Jr as isFullScreen,me as isIOS,at as isInputLike,Gr as isInteractive,rt as isLatinChar,ua as isLocalLink,ks as isMemberOf,Je as isMobileBreakpoint,Ms as isPrimitive,Os as isProdEnv,Is as isPromiseLike,ss as isRTL,mt as isReadonlyArray,ws as isRunningInIframe,Jo as isSafari,Qr as isSelectionLikeTool,Rs as isServerEnv,ft as isShallowEqual,et as isTabletBreakpoint,N as isTestEnv,Hr as isToolIcon,ps as isTransparent,Qo as isWindows,Br as isWritableElement,rr as loadDesktopUIModePreference,us as mapFind,cr as matchKey,Ns as memoize,is as muteFSAbortError,ds as nFormatter,Wr as nextAnimationFrame,Ws as normalizeEOL,Lt as normalizeLink,bs as preventUnload,ue as promiseTry,Cs as queryFocusableElements,ra as randomId,na as randomInteger,$s as reduceToCommonValue,jr as removeSelection,xr as rescalePoints,oa as reseed,ce as resolvablePromise,zt as rgbToHex,Vs as safelyParseJSON,os as sceneCoordsToViewportCoords,$r as selectNode,Ur as setDateTimeForTests,sr as setDesktopUIMode,Zs as setFeatureFlag,dr as shouldMaintainAspectRatio,pr as shouldResizeFromCenter,fr as shouldRotateWithDiscreteAngle,Et as sizeOf,ms as supportsEmoji,Qt as supportsResizeObserver,Xr as throttleRAF,Ss as toArray,Ys as toBrandedType,pt as toIterable,pa as toValidURL,as as tupleToCoors,qr as updateActiveTool,Fs as updateObject,Gs as updateStable,ns as viewportCoordsToSceneCoords,vs as wrapEvent};
@@ -0,0 +1,12 @@
1
+ export declare class BinaryHeap<T> {
2
+ private scoreFunction;
3
+ private content;
4
+ constructor(scoreFunction: (node: T) => number);
5
+ sinkDown(idx: number): void;
6
+ bubbleUp(idx: number): void;
7
+ push(node: T): void;
8
+ pop(): T | null;
9
+ remove(node: T): void;
10
+ size(): number;
11
+ rescoreElement(node: T): void;
12
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * x and y position of top left corner, x and y position of bottom right corner
3
+ */
4
+ export type Bounds = readonly [
5
+ minX: number,
6
+ minY: number,
7
+ maxX: number,
8
+ maxY: number
9
+ ];
10
+ export declare const isBounds: (box: unknown) => box is Bounds;
@@ -0,0 +1,62 @@
1
+ import oc from "open-color";
2
+ import type { Merge } from "./utility-types";
3
+ export declare const COLOR_OUTLINE_CONTRAST_THRESHOLD = 240;
4
+ export type ColorPickerColor = Exclude<keyof oc, "indigo" | "lime"> | "transparent" | "bronze";
5
+ export type ColorTuple = readonly [string, string, string, string, string];
6
+ export type ColorPalette = Merge<Record<ColorPickerColor, ColorTuple>, {
7
+ black: "#1e1e1e";
8
+ white: "#ffffff";
9
+ transparent: "transparent";
10
+ }>;
11
+ export type ColorPaletteCustom = {
12
+ [key: string]: ColorTuple | string;
13
+ };
14
+ export type ColorShadesIndexes = [number, number, number, number, number];
15
+ export declare const MAX_CUSTOM_COLORS_USED_IN_CANVAS = 5;
16
+ export declare const COLORS_PER_ROW = 5;
17
+ export declare const DEFAULT_CHART_COLOR_INDEX = 4;
18
+ export declare const DEFAULT_ELEMENT_STROKE_COLOR_INDEX = 4;
19
+ export declare const DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX = 1;
20
+ export declare const ELEMENTS_PALETTE_SHADE_INDEXES: readonly [0, 2, 4, 6, 8];
21
+ export declare const CANVAS_PALETTE_SHADE_INDEXES: readonly [0, 1, 2, 3, 4];
22
+ export declare const getSpecificColorShades: (color: Exclude<ColorPickerColor, "transparent" | "white" | "black" | "bronze">, indexArr: Readonly<ColorShadesIndexes>) => ColorTuple;
23
+ export declare const COLOR_PALETTE: ColorPalette;
24
+ export declare const DEFAULT_ELEMENT_STROKE_PICKS: ColorTuple;
25
+ export declare const DEFAULT_ELEMENT_BACKGROUND_PICKS: ColorTuple;
26
+ export declare const DEFAULT_CANVAS_BACKGROUND_PICKS: ColorTuple;
27
+ export declare const DEFAULT_ELEMENT_STROKE_COLOR_PALETTE: {
28
+ readonly red: ColorTuple;
29
+ readonly pink: ColorTuple;
30
+ readonly grape: ColorTuple;
31
+ readonly violet: ColorTuple;
32
+ readonly blue: ColorTuple;
33
+ readonly cyan: ColorTuple;
34
+ readonly teal: ColorTuple;
35
+ readonly green: ColorTuple;
36
+ readonly yellow: ColorTuple;
37
+ readonly orange: ColorTuple;
38
+ readonly transparent: "transparent";
39
+ readonly white: "#ffffff";
40
+ readonly gray: ColorTuple;
41
+ readonly black: "#1e1e1e";
42
+ readonly bronze: ColorTuple;
43
+ };
44
+ export declare const DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE: {
45
+ readonly red: ColorTuple;
46
+ readonly pink: ColorTuple;
47
+ readonly grape: ColorTuple;
48
+ readonly violet: ColorTuple;
49
+ readonly blue: ColorTuple;
50
+ readonly cyan: ColorTuple;
51
+ readonly teal: ColorTuple;
52
+ readonly green: ColorTuple;
53
+ readonly yellow: ColorTuple;
54
+ readonly orange: ColorTuple;
55
+ readonly transparent: "transparent";
56
+ readonly white: "#ffffff";
57
+ readonly gray: ColorTuple;
58
+ readonly black: "#1e1e1e";
59
+ readonly bronze: ColorTuple;
60
+ };
61
+ export declare const getAllColorsSpecificShade: (index: 0 | 1 | 2 | 3 | 4) => readonly [string, string, string, string, string, string, string, string, string, string];
62
+ export declare const rgbToHex: (r: number, g: number, b: number) => string;