@yuzhouu/canvas-standard 0.1.0

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 (3256) hide show
  1. package/README.md +39 -0
  2. package/_vendor/plugin-arrow/_vendor/canvas-core/bindings/bindingManager.d.ts +33 -0
  3. package/_vendor/plugin-arrow/_vendor/canvas-core/bindings/bindingUtil.d.ts +69 -0
  4. package/_vendor/plugin-arrow/_vendor/canvas-core/bindings/bindingUtilRegistry.d.ts +8 -0
  5. package/_vendor/plugin-arrow/_vendor/canvas-core/bindings/terminalBinding.d.ts +28 -0
  6. package/_vendor/plugin-arrow/_vendor/canvas-core/bindings/terminalPorts.d.ts +67 -0
  7. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/clipboard.d.ts +43 -0
  8. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/clipboardAssets.d.ts +6 -0
  9. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/commands/assetCommands.d.ts +7 -0
  10. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/commands/bindingCommands.d.ts +12 -0
  11. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/commands/commandTypes.d.ts +149 -0
  12. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/commands/commands.d.ts +5 -0
  13. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/commands/documentCommands.d.ts +9 -0
  14. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/commands/sessionCommands.d.ts +13 -0
  15. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/commands/shapeCommands.d.ts +9 -0
  16. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/commands/shapeFlags.d.ts +10 -0
  17. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/commands/shapeRemoval.d.ts +10 -0
  18. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/commands/shapeRepair.d.ts +11 -0
  19. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/createEditor.d.ts +6 -0
  20. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/editor.d.ts +356 -0
  21. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/events/canvasNavigationInteraction.d.ts +2 -0
  22. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/events/eventRouter.d.ts +16 -0
  23. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/events/events.d.ts +81 -0
  24. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/events/inputsManager.d.ts +49 -0
  25. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/events/interactions.d.ts +84 -0
  26. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/events/keyboardShortcuts.d.ts +23 -0
  27. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/events/pointerClickRecognizer.d.ts +11 -0
  28. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/history/historyManager.d.ts +40 -0
  29. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/history/operationManager.d.ts +77 -0
  30. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/internal.d.ts +7 -0
  31. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/queries/bindingQueryCache.d.ts +28 -0
  32. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/queries/bindingQueryState.d.ts +11 -0
  33. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/queries/draftBindingIndex.d.ts +19 -0
  34. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/queries/shapeGeometryQueryCache.d.ts +34 -0
  35. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +43 -0
  36. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/queries/shapeTreeIndex.d.ts +27 -0
  37. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/queries/shapeTreeIndexState.d.ts +11 -0
  38. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/queries/spatialIndexManager.d.ts +34 -0
  39. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/records/documentSnapshots.d.ts +14 -0
  40. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/records/editorRecordFactory.d.ts +19 -0
  41. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/records/recordQueries.d.ts +3 -0
  42. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/selection/resizeGeometry.d.ts +117 -0
  43. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/selection/selection.d.ts +223 -0
  44. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/selection/selectionBindingSegments.d.ts +7 -0
  45. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/selection/selectionGeometry.d.ts +28 -0
  46. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/selection/selectionHandleHitTest.d.ts +8 -0
  47. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/selection/selectionLayout.d.ts +20 -0
  48. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/selection/selectionOverlay.d.ts +25 -0
  49. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/selection/selectionOverlayEquality.d.ts +8 -0
  50. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/selection/selectionOverlayManager.d.ts +34 -0
  51. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/selection/selectionResizeCapabilities.d.ts +11 -0
  52. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/selection/selectionSet.d.ts +9 -0
  53. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/selection/selectionTargets.d.ts +10 -0
  54. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/selection/selectionTransforms.d.ts +6 -0
  55. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/shapes/shapeContainment.d.ts +14 -0
  56. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/shapes/shapeEditingManager.d.ts +33 -0
  57. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/shapes/shapeExportTraversal.d.ts +3 -0
  58. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +21 -0
  59. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/shapes/shapeGrouping.d.ts +22 -0
  60. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/shapes/shapeOrder.d.ts +32 -0
  61. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/shapes/shapeReparenting.d.ts +21 -0
  62. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/shapes/shapeSignalManager.d.ts +35 -0
  63. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/shapes/shapeTransformSpace.d.ts +6 -0
  64. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/shapes/shapeTreeQueries.d.ts +12 -0
  65. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/snapping/gapSnap.d.ts +6 -0
  66. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/snapping/pointSnap.d.ts +5 -0
  67. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/snapping/resizeSnap.d.ts +11 -0
  68. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/snapping/snapDecision.d.ts +2 -0
  69. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/snapping/snapGeometry.d.ts +26 -0
  70. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/snapping/snapIndicators.d.ts +22 -0
  71. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/snapping/snapManager.d.ts +54 -0
  72. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/snapping/snapResults.d.ts +58 -0
  73. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/snapping/snapSnapshotBuilder.d.ts +22 -0
  74. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/snapping/snapTypes.d.ts +114 -0
  75. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/state/editorReadModels.d.ts +34 -0
  76. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/state/editorSignals.d.ts +82 -0
  77. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/state/editorStateUtils.d.ts +9 -0
  78. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/state/interactionTransientManager.d.ts +35 -0
  79. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/viewport/camera.d.ts +3 -0
  80. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/viewport/cameraManager.d.ts +56 -0
  81. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/viewport/cameraPanSession.d.ts +9 -0
  82. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/viewport/edgeScroll.d.ts +5 -0
  83. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/viewport/renderWindow.d.ts +30 -0
  84. package/_vendor/plugin-arrow/_vendor/canvas-core/editor/viewport/renderWindowManager.d.ts +33 -0
  85. package/_vendor/plugin-arrow/_vendor/canvas-core/exports/integrity.d.ts +32 -0
  86. package/_vendor/plugin-arrow/_vendor/canvas-core/exports/svg.d.ts +52 -0
  87. package/_vendor/plugin-arrow/_vendor/canvas-core/geometry/box.d.ts +20 -0
  88. package/_vendor/plugin-arrow/_vendor/canvas-core/geometry/contentCutout.d.ts +8 -0
  89. package/_vendor/plugin-arrow/_vendor/canvas-core/geometry/ellipse2d.d.ts +16 -0
  90. package/_vendor/plugin-arrow/_vendor/canvas-core/geometry/geometry2d.d.ts +15 -0
  91. package/_vendor/plugin-arrow/_vendor/canvas-core/geometry/index.d.ts +9 -0
  92. package/_vendor/plugin-arrow/_vendor/canvas-core/geometry/mat.d.ts +31 -0
  93. package/_vendor/plugin-arrow/_vendor/canvas-core/geometry/polygon.d.ts +7 -0
  94. package/_vendor/plugin-arrow/_vendor/canvas-core/geometry/polyline2d.d.ts +14 -0
  95. package/_vendor/plugin-arrow/_vendor/canvas-core/geometry/rectangle2d.d.ts +16 -0
  96. package/_vendor/plugin-arrow/_vendor/canvas-core/geometry/segments.d.ts +5 -0
  97. package/_vendor/plugin-arrow/_vendor/canvas-core/geometry/vec.d.ts +35 -0
  98. package/_vendor/plugin-arrow/_vendor/canvas-core/index.d.ts +64 -0
  99. package/_vendor/plugin-arrow/_vendor/canvas-core/plugins/editorRuntimePlugin.d.ts +19 -0
  100. package/_vendor/plugin-arrow/_vendor/canvas-core/plugins/editorRuntimeRegistry.d.ts +15 -0
  101. package/_vendor/plugin-arrow/_vendor/canvas-core/plugins/index.d.ts +2 -0
  102. package/_vendor/plugin-arrow/_vendor/canvas-core/reactivity.d.ts +8 -0
  103. package/_vendor/plugin-arrow/_vendor/canvas-core/schema/records.d.ts +115 -0
  104. package/_vendor/plugin-arrow/_vendor/canvas-core/schema/snapshots.d.ts +22 -0
  105. package/_vendor/plugin-arrow/_vendor/canvas-core/shapes/childTransformPolicy.d.ts +16 -0
  106. package/_vendor/plugin-arrow/_vendor/canvas-core/shapes/colors.d.ts +26 -0
  107. package/_vendor/plugin-arrow/_vendor/canvas-core/shapes/shapeUtil.d.ts +245 -0
  108. package/_vendor/plugin-arrow/_vendor/canvas-core/shapes/shapeUtilGeometry.d.ts +6 -0
  109. package/_vendor/plugin-arrow/_vendor/canvas-core/shapes/shapeUtilRegistry.d.ts +9 -0
  110. package/_vendor/plugin-arrow/_vendor/canvas-core/shapes/types.d.ts +2 -0
  111. package/_vendor/plugin-arrow/_vendor/canvas-core/tools/hand/handTool.d.ts +5 -0
  112. package/_vendor/plugin-arrow/_vendor/canvas-core/tools/select/selectContainment.d.ts +12 -0
  113. package/_vendor/plugin-arrow/_vendor/canvas-core/tools/select/selectTool.d.ts +5 -0
  114. package/_vendor/plugin-arrow/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +170 -0
  115. package/_vendor/plugin-arrow/_vendor/canvas-core/tools/select/states/brushingState.d.ts +19 -0
  116. package/_vendor/plugin-arrow/_vendor/canvas-core/tools/select/states/draggingPluginInteractionState.d.ts +15 -0
  117. package/_vendor/plugin-arrow/_vendor/canvas-core/tools/select/states/idleState.d.ts +8 -0
  118. package/_vendor/plugin-arrow/_vendor/canvas-core/tools/select/states/index.d.ts +11 -0
  119. package/_vendor/plugin-arrow/_vendor/canvas-core/tools/select/states/pointingCanvasState.d.ts +11 -0
  120. package/_vendor/plugin-arrow/_vendor/canvas-core/tools/select/states/pointingResizeHandleState.d.ts +10 -0
  121. package/_vendor/plugin-arrow/_vendor/canvas-core/tools/select/states/pointingRotateHandleState.d.ts +10 -0
  122. package/_vendor/plugin-arrow/_vendor/canvas-core/tools/select/states/pointingSelectionHandleInteractionState.d.ts +11 -0
  123. package/_vendor/plugin-arrow/_vendor/canvas-core/tools/select/states/pointingShapeState.d.ts +12 -0
  124. package/_vendor/plugin-arrow/_vendor/canvas-core/tools/select/states/resizingState.d.ts +16 -0
  125. package/_vendor/plugin-arrow/_vendor/canvas-core/tools/select/states/rotatingState.d.ts +14 -0
  126. package/_vendor/plugin-arrow/_vendor/canvas-core/tools/select/states/selectStateNode.d.ts +60 -0
  127. package/_vendor/plugin-arrow/_vendor/canvas-core/tools/select/states/translatingState.d.ts +16 -0
  128. package/_vendor/plugin-arrow/_vendor/canvas-core/tools/stateNode.d.ts +30 -0
  129. package/_vendor/plugin-arrow/_vendor/canvas-core/tools/toolManager.d.ts +24 -0
  130. package/_vendor/plugin-arrow/_vendor/canvas-core/utils/equality.d.ts +9 -0
  131. package/_vendor/plugin-arrow/_vendor/canvas-extension-contracts/contributions.d.ts +92 -0
  132. package/_vendor/plugin-arrow/_vendor/canvas-extension-contracts/index.d.ts +6 -0
  133. package/_vendor/plugin-arrow/_vendor/canvas-extension-contracts/operations.d.ts +131 -0
  134. package/_vendor/plugin-arrow/_vendor/canvas-extension-contracts/persistence.d.ts +16 -0
  135. package/_vendor/plugin-arrow/_vendor/canvas-extension-contracts/plugin.d.ts +37 -0
  136. package/_vendor/plugin-arrow/_vendor/canvas-extension-contracts/shape.d.ts +5 -0
  137. package/_vendor/plugin-arrow/_vendor/canvas-extension-contracts/tokens.d.ts +12 -0
  138. package/_vendor/plugin-arrow/_vendor/canvas-react/components/CanvasView.d.ts +7 -0
  139. package/_vendor/plugin-arrow/_vendor/canvas-react/components/DefaultGrid.d.ts +1 -0
  140. package/_vendor/plugin-arrow/_vendor/canvas-react/components/OverlayLayer.d.ts +1 -0
  141. package/_vendor/plugin-arrow/_vendor/canvas-react/components/PageSpace.d.ts +6 -0
  142. package/_vendor/plugin-arrow/_vendor/canvas-react/components/ShapeLayer.d.ts +1 -0
  143. package/_vendor/plugin-arrow/_vendor/canvas-react/components/canvasKeyboardEvents.d.ts +13 -0
  144. package/_vendor/plugin-arrow/_vendor/canvas-react/components/index.d.ts +3 -0
  145. package/_vendor/plugin-arrow/_vendor/canvas-react/components/overlays/BindingGuide.d.ts +24 -0
  146. package/_vendor/plugin-arrow/_vendor/canvas-react/components/overlays/BindingPreviewOverlay.d.ts +1 -0
  147. package/_vendor/plugin-arrow/_vendor/canvas-react/components/overlays/BrushBoxOverlay.d.ts +1 -0
  148. package/_vendor/plugin-arrow/_vendor/canvas-react/components/overlays/OverlaySvgRoot.d.ts +1 -0
  149. package/_vendor/plugin-arrow/_vendor/canvas-react/components/overlays/SelectionFrameOverlay.d.ts +1 -0
  150. package/_vendor/plugin-arrow/_vendor/canvas-react/components/overlays/SelectionHandlesOverlay.d.ts +1 -0
  151. package/_vendor/plugin-arrow/_vendor/canvas-react/components/overlays/SelectionOverlaySvg.d.ts +1 -0
  152. package/_vendor/plugin-arrow/_vendor/canvas-react/components/overlays/SelectionPathOverlay.d.ts +8 -0
  153. package/_vendor/plugin-arrow/_vendor/canvas-react/components/overlays/ShapeOutlineOverlay.d.ts +8 -0
  154. package/_vendor/plugin-arrow/_vendor/canvas-react/components/overlays/SnapIndicatorsOverlay.d.ts +1 -0
  155. package/_vendor/plugin-arrow/_vendor/canvas-react/components/overlays/TerminalBindingGuidesOverlay.d.ts +1 -0
  156. package/_vendor/plugin-arrow/_vendor/canvas-react/components/shape-layer/ShapeClipStack.d.ts +11 -0
  157. package/_vendor/plugin-arrow/_vendor/canvas-react/components/shape-layer/ShapeDecorations.d.ts +2 -0
  158. package/_vendor/plugin-arrow/_vendor/canvas-react/components/shape-layer/ShapeForegroundItem.d.ts +5 -0
  159. package/_vendor/plugin-arrow/_vendor/canvas-react/components/shape-layer/ShapeItem.d.ts +5 -0
  160. package/_vendor/plugin-arrow/_vendor/canvas-react/components/shape-layer/ShapeRenderList.d.ts +1 -0
  161. package/_vendor/plugin-arrow/_vendor/canvas-react/components/shape-layer/ShapeRenderer.d.ts +12 -0
  162. package/_vendor/plugin-arrow/_vendor/canvas-react/components/shape-layer/shapeFrame.d.ts +11 -0
  163. package/_vendor/plugin-arrow/_vendor/canvas-react/components/useCanvasDomEvents.d.ts +23 -0
  164. package/_vendor/plugin-arrow/_vendor/canvas-react/contextMenuRequest.d.ts +19 -0
  165. package/_vendor/plugin-arrow/_vendor/canvas-react/dom.d.ts +10 -0
  166. package/_vendor/plugin-arrow/_vendor/canvas-react/hooks/useEditor.d.ts +3 -0
  167. package/_vendor/plugin-arrow/_vendor/canvas-react/hooks/useValue.d.ts +2 -0
  168. package/_vendor/plugin-arrow/_vendor/canvas-react/host/canvasRenderBindings.d.ts +21 -0
  169. package/_vendor/plugin-arrow/_vendor/canvas-react/host/canvasRenderBindingsContext.d.ts +5 -0
  170. package/_vendor/plugin-arrow/_vendor/canvas-react/host/canvasRenderPlugin.d.ts +81 -0
  171. package/_vendor/plugin-arrow/_vendor/canvas-react/host/index.d.ts +5 -0
  172. package/_vendor/plugin-arrow/_vendor/canvas-react/index.d.ts +5 -0
  173. package/_vendor/plugin-arrow/_vendor/signals/atom.d.ts +11 -0
  174. package/_vendor/plugin-arrow/_vendor/signals/computed.d.ts +13 -0
  175. package/_vendor/plugin-arrow/_vendor/signals/core.d.ts +35 -0
  176. package/_vendor/plugin-arrow/_vendor/signals/effect.d.ts +5 -0
  177. package/_vendor/plugin-arrow/_vendor/signals/index.d.ts +8 -0
  178. package/_vendor/plugin-arrow/_vendor/signals/types.d.ts +22 -0
  179. package/_vendor/plugin-arrow/_vendor/store/diff.d.ts +9 -0
  180. package/_vendor/plugin-arrow/_vendor/store/history.d.ts +22 -0
  181. package/_vendor/plugin-arrow/_vendor/store/index.d.ts +5 -0
  182. package/_vendor/plugin-arrow/_vendor/store/store.d.ts +40 -0
  183. package/_vendor/plugin-arrow/_vendor/store/types.d.ts +27 -0
  184. package/_vendor/plugin-arrow/api.d.ts +54 -0
  185. package/_vendor/plugin-arrow/arrowBindingAnchors.d.ts +5 -0
  186. package/_vendor/plugin-arrow/arrowBindingGeometry.d.ts +28 -0
  187. package/_vendor/plugin-arrow/arrowBindingTargets.d.ts +3 -0
  188. package/_vendor/plugin-arrow/arrowBindingUtil.d.ts +27 -0
  189. package/_vendor/plugin-arrow/arrowGeometry.d.ts +77 -0
  190. package/_vendor/plugin-arrow/arrowHeadGeometry.d.ts +8 -0
  191. package/_vendor/plugin-arrow/arrowShapeUtil.d.ts +24 -0
  192. package/_vendor/plugin-arrow/arrowStrokeStyle.d.ts +2 -0
  193. package/_vendor/plugin-arrow/arrowTerminalBindingResolver.d.ts +20 -0
  194. package/_vendor/plugin-arrow/arrowTerminalCommands.d.ts +13 -0
  195. package/_vendor/plugin-arrow/arrowTool.d.ts +4 -0
  196. package/_vendor/plugin-arrow/canvasRender.d.ts +2 -0
  197. package/_vendor/plugin-arrow/editorRuntime.d.ts +7 -0
  198. package/_vendor/plugin-arrow/feature.d.ts +3 -0
  199. package/_vendor/plugin-arrow/index.d.ts +14 -0
  200. package/_vendor/plugin-arrow/selectionHandleInteractions.d.ts +3 -0
  201. package/_vendor/plugin-arrow/types.d.ts +35 -0
  202. package/_vendor/plugin-connector/_vendor/canvas-core/bindings/bindingManager.d.ts +33 -0
  203. package/_vendor/plugin-connector/_vendor/canvas-core/bindings/bindingUtil.d.ts +69 -0
  204. package/_vendor/plugin-connector/_vendor/canvas-core/bindings/bindingUtilRegistry.d.ts +8 -0
  205. package/_vendor/plugin-connector/_vendor/canvas-core/bindings/terminalBinding.d.ts +28 -0
  206. package/_vendor/plugin-connector/_vendor/canvas-core/bindings/terminalPorts.d.ts +67 -0
  207. package/_vendor/plugin-connector/_vendor/canvas-core/editor/clipboard.d.ts +43 -0
  208. package/_vendor/plugin-connector/_vendor/canvas-core/editor/clipboardAssets.d.ts +6 -0
  209. package/_vendor/plugin-connector/_vendor/canvas-core/editor/commands/assetCommands.d.ts +7 -0
  210. package/_vendor/plugin-connector/_vendor/canvas-core/editor/commands/bindingCommands.d.ts +12 -0
  211. package/_vendor/plugin-connector/_vendor/canvas-core/editor/commands/commandTypes.d.ts +149 -0
  212. package/_vendor/plugin-connector/_vendor/canvas-core/editor/commands/commands.d.ts +5 -0
  213. package/_vendor/plugin-connector/_vendor/canvas-core/editor/commands/documentCommands.d.ts +9 -0
  214. package/_vendor/plugin-connector/_vendor/canvas-core/editor/commands/sessionCommands.d.ts +13 -0
  215. package/_vendor/plugin-connector/_vendor/canvas-core/editor/commands/shapeCommands.d.ts +9 -0
  216. package/_vendor/plugin-connector/_vendor/canvas-core/editor/commands/shapeFlags.d.ts +10 -0
  217. package/_vendor/plugin-connector/_vendor/canvas-core/editor/commands/shapeRemoval.d.ts +10 -0
  218. package/_vendor/plugin-connector/_vendor/canvas-core/editor/commands/shapeRepair.d.ts +11 -0
  219. package/_vendor/plugin-connector/_vendor/canvas-core/editor/createEditor.d.ts +6 -0
  220. package/_vendor/plugin-connector/_vendor/canvas-core/editor/editor.d.ts +356 -0
  221. package/_vendor/plugin-connector/_vendor/canvas-core/editor/events/canvasNavigationInteraction.d.ts +2 -0
  222. package/_vendor/plugin-connector/_vendor/canvas-core/editor/events/eventRouter.d.ts +16 -0
  223. package/_vendor/plugin-connector/_vendor/canvas-core/editor/events/events.d.ts +81 -0
  224. package/_vendor/plugin-connector/_vendor/canvas-core/editor/events/inputsManager.d.ts +49 -0
  225. package/_vendor/plugin-connector/_vendor/canvas-core/editor/events/interactions.d.ts +84 -0
  226. package/_vendor/plugin-connector/_vendor/canvas-core/editor/events/keyboardShortcuts.d.ts +23 -0
  227. package/_vendor/plugin-connector/_vendor/canvas-core/editor/events/pointerClickRecognizer.d.ts +11 -0
  228. package/_vendor/plugin-connector/_vendor/canvas-core/editor/history/historyManager.d.ts +40 -0
  229. package/_vendor/plugin-connector/_vendor/canvas-core/editor/history/operationManager.d.ts +77 -0
  230. package/_vendor/plugin-connector/_vendor/canvas-core/editor/internal.d.ts +7 -0
  231. package/_vendor/plugin-connector/_vendor/canvas-core/editor/queries/bindingQueryCache.d.ts +28 -0
  232. package/_vendor/plugin-connector/_vendor/canvas-core/editor/queries/bindingQueryState.d.ts +11 -0
  233. package/_vendor/plugin-connector/_vendor/canvas-core/editor/queries/draftBindingIndex.d.ts +19 -0
  234. package/_vendor/plugin-connector/_vendor/canvas-core/editor/queries/shapeGeometryQueryCache.d.ts +34 -0
  235. package/_vendor/plugin-connector/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +43 -0
  236. package/_vendor/plugin-connector/_vendor/canvas-core/editor/queries/shapeTreeIndex.d.ts +27 -0
  237. package/_vendor/plugin-connector/_vendor/canvas-core/editor/queries/shapeTreeIndexState.d.ts +11 -0
  238. package/_vendor/plugin-connector/_vendor/canvas-core/editor/queries/spatialIndexManager.d.ts +34 -0
  239. package/_vendor/plugin-connector/_vendor/canvas-core/editor/records/documentSnapshots.d.ts +14 -0
  240. package/_vendor/plugin-connector/_vendor/canvas-core/editor/records/editorRecordFactory.d.ts +19 -0
  241. package/_vendor/plugin-connector/_vendor/canvas-core/editor/records/recordQueries.d.ts +3 -0
  242. package/_vendor/plugin-connector/_vendor/canvas-core/editor/selection/resizeGeometry.d.ts +117 -0
  243. package/_vendor/plugin-connector/_vendor/canvas-core/editor/selection/selection.d.ts +223 -0
  244. package/_vendor/plugin-connector/_vendor/canvas-core/editor/selection/selectionBindingSegments.d.ts +7 -0
  245. package/_vendor/plugin-connector/_vendor/canvas-core/editor/selection/selectionGeometry.d.ts +28 -0
  246. package/_vendor/plugin-connector/_vendor/canvas-core/editor/selection/selectionHandleHitTest.d.ts +8 -0
  247. package/_vendor/plugin-connector/_vendor/canvas-core/editor/selection/selectionLayout.d.ts +20 -0
  248. package/_vendor/plugin-connector/_vendor/canvas-core/editor/selection/selectionOverlay.d.ts +25 -0
  249. package/_vendor/plugin-connector/_vendor/canvas-core/editor/selection/selectionOverlayEquality.d.ts +8 -0
  250. package/_vendor/plugin-connector/_vendor/canvas-core/editor/selection/selectionOverlayManager.d.ts +34 -0
  251. package/_vendor/plugin-connector/_vendor/canvas-core/editor/selection/selectionResizeCapabilities.d.ts +11 -0
  252. package/_vendor/plugin-connector/_vendor/canvas-core/editor/selection/selectionSet.d.ts +9 -0
  253. package/_vendor/plugin-connector/_vendor/canvas-core/editor/selection/selectionTargets.d.ts +10 -0
  254. package/_vendor/plugin-connector/_vendor/canvas-core/editor/selection/selectionTransforms.d.ts +6 -0
  255. package/_vendor/plugin-connector/_vendor/canvas-core/editor/shapes/shapeContainment.d.ts +14 -0
  256. package/_vendor/plugin-connector/_vendor/canvas-core/editor/shapes/shapeEditingManager.d.ts +33 -0
  257. package/_vendor/plugin-connector/_vendor/canvas-core/editor/shapes/shapeExportTraversal.d.ts +3 -0
  258. package/_vendor/plugin-connector/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +21 -0
  259. package/_vendor/plugin-connector/_vendor/canvas-core/editor/shapes/shapeGrouping.d.ts +22 -0
  260. package/_vendor/plugin-connector/_vendor/canvas-core/editor/shapes/shapeOrder.d.ts +32 -0
  261. package/_vendor/plugin-connector/_vendor/canvas-core/editor/shapes/shapeReparenting.d.ts +21 -0
  262. package/_vendor/plugin-connector/_vendor/canvas-core/editor/shapes/shapeSignalManager.d.ts +35 -0
  263. package/_vendor/plugin-connector/_vendor/canvas-core/editor/shapes/shapeTransformSpace.d.ts +6 -0
  264. package/_vendor/plugin-connector/_vendor/canvas-core/editor/shapes/shapeTreeQueries.d.ts +12 -0
  265. package/_vendor/plugin-connector/_vendor/canvas-core/editor/snapping/gapSnap.d.ts +6 -0
  266. package/_vendor/plugin-connector/_vendor/canvas-core/editor/snapping/pointSnap.d.ts +5 -0
  267. package/_vendor/plugin-connector/_vendor/canvas-core/editor/snapping/resizeSnap.d.ts +11 -0
  268. package/_vendor/plugin-connector/_vendor/canvas-core/editor/snapping/snapDecision.d.ts +2 -0
  269. package/_vendor/plugin-connector/_vendor/canvas-core/editor/snapping/snapGeometry.d.ts +26 -0
  270. package/_vendor/plugin-connector/_vendor/canvas-core/editor/snapping/snapIndicators.d.ts +22 -0
  271. package/_vendor/plugin-connector/_vendor/canvas-core/editor/snapping/snapManager.d.ts +54 -0
  272. package/_vendor/plugin-connector/_vendor/canvas-core/editor/snapping/snapResults.d.ts +58 -0
  273. package/_vendor/plugin-connector/_vendor/canvas-core/editor/snapping/snapSnapshotBuilder.d.ts +22 -0
  274. package/_vendor/plugin-connector/_vendor/canvas-core/editor/snapping/snapTypes.d.ts +114 -0
  275. package/_vendor/plugin-connector/_vendor/canvas-core/editor/state/editorReadModels.d.ts +34 -0
  276. package/_vendor/plugin-connector/_vendor/canvas-core/editor/state/editorSignals.d.ts +82 -0
  277. package/_vendor/plugin-connector/_vendor/canvas-core/editor/state/editorStateUtils.d.ts +9 -0
  278. package/_vendor/plugin-connector/_vendor/canvas-core/editor/state/interactionTransientManager.d.ts +35 -0
  279. package/_vendor/plugin-connector/_vendor/canvas-core/editor/viewport/camera.d.ts +3 -0
  280. package/_vendor/plugin-connector/_vendor/canvas-core/editor/viewport/cameraManager.d.ts +56 -0
  281. package/_vendor/plugin-connector/_vendor/canvas-core/editor/viewport/cameraPanSession.d.ts +9 -0
  282. package/_vendor/plugin-connector/_vendor/canvas-core/editor/viewport/edgeScroll.d.ts +5 -0
  283. package/_vendor/plugin-connector/_vendor/canvas-core/editor/viewport/renderWindow.d.ts +30 -0
  284. package/_vendor/plugin-connector/_vendor/canvas-core/editor/viewport/renderWindowManager.d.ts +33 -0
  285. package/_vendor/plugin-connector/_vendor/canvas-core/exports/integrity.d.ts +32 -0
  286. package/_vendor/plugin-connector/_vendor/canvas-core/exports/svg.d.ts +52 -0
  287. package/_vendor/plugin-connector/_vendor/canvas-core/geometry/box.d.ts +20 -0
  288. package/_vendor/plugin-connector/_vendor/canvas-core/geometry/contentCutout.d.ts +8 -0
  289. package/_vendor/plugin-connector/_vendor/canvas-core/geometry/ellipse2d.d.ts +16 -0
  290. package/_vendor/plugin-connector/_vendor/canvas-core/geometry/geometry2d.d.ts +15 -0
  291. package/_vendor/plugin-connector/_vendor/canvas-core/geometry/index.d.ts +9 -0
  292. package/_vendor/plugin-connector/_vendor/canvas-core/geometry/mat.d.ts +31 -0
  293. package/_vendor/plugin-connector/_vendor/canvas-core/geometry/polygon.d.ts +7 -0
  294. package/_vendor/plugin-connector/_vendor/canvas-core/geometry/polyline2d.d.ts +14 -0
  295. package/_vendor/plugin-connector/_vendor/canvas-core/geometry/rectangle2d.d.ts +16 -0
  296. package/_vendor/plugin-connector/_vendor/canvas-core/geometry/segments.d.ts +5 -0
  297. package/_vendor/plugin-connector/_vendor/canvas-core/geometry/vec.d.ts +35 -0
  298. package/_vendor/plugin-connector/_vendor/canvas-core/index.d.ts +64 -0
  299. package/_vendor/plugin-connector/_vendor/canvas-core/plugins/editorRuntimePlugin.d.ts +19 -0
  300. package/_vendor/plugin-connector/_vendor/canvas-core/plugins/editorRuntimeRegistry.d.ts +15 -0
  301. package/_vendor/plugin-connector/_vendor/canvas-core/plugins/index.d.ts +2 -0
  302. package/_vendor/plugin-connector/_vendor/canvas-core/reactivity.d.ts +8 -0
  303. package/_vendor/plugin-connector/_vendor/canvas-core/schema/records.d.ts +115 -0
  304. package/_vendor/plugin-connector/_vendor/canvas-core/schema/snapshots.d.ts +22 -0
  305. package/_vendor/plugin-connector/_vendor/canvas-core/shapes/childTransformPolicy.d.ts +16 -0
  306. package/_vendor/plugin-connector/_vendor/canvas-core/shapes/colors.d.ts +26 -0
  307. package/_vendor/plugin-connector/_vendor/canvas-core/shapes/shapeUtil.d.ts +245 -0
  308. package/_vendor/plugin-connector/_vendor/canvas-core/shapes/shapeUtilGeometry.d.ts +6 -0
  309. package/_vendor/plugin-connector/_vendor/canvas-core/shapes/shapeUtilRegistry.d.ts +9 -0
  310. package/_vendor/plugin-connector/_vendor/canvas-core/shapes/types.d.ts +2 -0
  311. package/_vendor/plugin-connector/_vendor/canvas-core/tools/hand/handTool.d.ts +5 -0
  312. package/_vendor/plugin-connector/_vendor/canvas-core/tools/select/selectContainment.d.ts +12 -0
  313. package/_vendor/plugin-connector/_vendor/canvas-core/tools/select/selectTool.d.ts +5 -0
  314. package/_vendor/plugin-connector/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +170 -0
  315. package/_vendor/plugin-connector/_vendor/canvas-core/tools/select/states/brushingState.d.ts +19 -0
  316. package/_vendor/plugin-connector/_vendor/canvas-core/tools/select/states/draggingPluginInteractionState.d.ts +15 -0
  317. package/_vendor/plugin-connector/_vendor/canvas-core/tools/select/states/idleState.d.ts +8 -0
  318. package/_vendor/plugin-connector/_vendor/canvas-core/tools/select/states/index.d.ts +11 -0
  319. package/_vendor/plugin-connector/_vendor/canvas-core/tools/select/states/pointingCanvasState.d.ts +11 -0
  320. package/_vendor/plugin-connector/_vendor/canvas-core/tools/select/states/pointingResizeHandleState.d.ts +10 -0
  321. package/_vendor/plugin-connector/_vendor/canvas-core/tools/select/states/pointingRotateHandleState.d.ts +10 -0
  322. package/_vendor/plugin-connector/_vendor/canvas-core/tools/select/states/pointingSelectionHandleInteractionState.d.ts +11 -0
  323. package/_vendor/plugin-connector/_vendor/canvas-core/tools/select/states/pointingShapeState.d.ts +12 -0
  324. package/_vendor/plugin-connector/_vendor/canvas-core/tools/select/states/resizingState.d.ts +16 -0
  325. package/_vendor/plugin-connector/_vendor/canvas-core/tools/select/states/rotatingState.d.ts +14 -0
  326. package/_vendor/plugin-connector/_vendor/canvas-core/tools/select/states/selectStateNode.d.ts +60 -0
  327. package/_vendor/plugin-connector/_vendor/canvas-core/tools/select/states/translatingState.d.ts +16 -0
  328. package/_vendor/plugin-connector/_vendor/canvas-core/tools/stateNode.d.ts +30 -0
  329. package/_vendor/plugin-connector/_vendor/canvas-core/tools/toolManager.d.ts +24 -0
  330. package/_vendor/plugin-connector/_vendor/canvas-core/utils/equality.d.ts +9 -0
  331. package/_vendor/plugin-connector/_vendor/canvas-extension-contracts/contributions.d.ts +92 -0
  332. package/_vendor/plugin-connector/_vendor/canvas-extension-contracts/index.d.ts +6 -0
  333. package/_vendor/plugin-connector/_vendor/canvas-extension-contracts/operations.d.ts +131 -0
  334. package/_vendor/plugin-connector/_vendor/canvas-extension-contracts/persistence.d.ts +16 -0
  335. package/_vendor/plugin-connector/_vendor/canvas-extension-contracts/plugin.d.ts +37 -0
  336. package/_vendor/plugin-connector/_vendor/canvas-extension-contracts/shape.d.ts +5 -0
  337. package/_vendor/plugin-connector/_vendor/canvas-extension-contracts/tokens.d.ts +12 -0
  338. package/_vendor/plugin-connector/_vendor/canvas-react/components/CanvasView.d.ts +7 -0
  339. package/_vendor/plugin-connector/_vendor/canvas-react/components/DefaultGrid.d.ts +1 -0
  340. package/_vendor/plugin-connector/_vendor/canvas-react/components/OverlayLayer.d.ts +1 -0
  341. package/_vendor/plugin-connector/_vendor/canvas-react/components/PageSpace.d.ts +6 -0
  342. package/_vendor/plugin-connector/_vendor/canvas-react/components/ShapeLayer.d.ts +1 -0
  343. package/_vendor/plugin-connector/_vendor/canvas-react/components/canvasKeyboardEvents.d.ts +13 -0
  344. package/_vendor/plugin-connector/_vendor/canvas-react/components/index.d.ts +3 -0
  345. package/_vendor/plugin-connector/_vendor/canvas-react/components/overlays/BindingGuide.d.ts +24 -0
  346. package/_vendor/plugin-connector/_vendor/canvas-react/components/overlays/BindingPreviewOverlay.d.ts +1 -0
  347. package/_vendor/plugin-connector/_vendor/canvas-react/components/overlays/BrushBoxOverlay.d.ts +1 -0
  348. package/_vendor/plugin-connector/_vendor/canvas-react/components/overlays/OverlaySvgRoot.d.ts +1 -0
  349. package/_vendor/plugin-connector/_vendor/canvas-react/components/overlays/SelectionFrameOverlay.d.ts +1 -0
  350. package/_vendor/plugin-connector/_vendor/canvas-react/components/overlays/SelectionHandlesOverlay.d.ts +1 -0
  351. package/_vendor/plugin-connector/_vendor/canvas-react/components/overlays/SelectionOverlaySvg.d.ts +1 -0
  352. package/_vendor/plugin-connector/_vendor/canvas-react/components/overlays/SelectionPathOverlay.d.ts +8 -0
  353. package/_vendor/plugin-connector/_vendor/canvas-react/components/overlays/ShapeOutlineOverlay.d.ts +8 -0
  354. package/_vendor/plugin-connector/_vendor/canvas-react/components/overlays/SnapIndicatorsOverlay.d.ts +1 -0
  355. package/_vendor/plugin-connector/_vendor/canvas-react/components/overlays/TerminalBindingGuidesOverlay.d.ts +1 -0
  356. package/_vendor/plugin-connector/_vendor/canvas-react/components/shape-layer/ShapeClipStack.d.ts +11 -0
  357. package/_vendor/plugin-connector/_vendor/canvas-react/components/shape-layer/ShapeDecorations.d.ts +2 -0
  358. package/_vendor/plugin-connector/_vendor/canvas-react/components/shape-layer/ShapeForegroundItem.d.ts +5 -0
  359. package/_vendor/plugin-connector/_vendor/canvas-react/components/shape-layer/ShapeItem.d.ts +5 -0
  360. package/_vendor/plugin-connector/_vendor/canvas-react/components/shape-layer/ShapeRenderList.d.ts +1 -0
  361. package/_vendor/plugin-connector/_vendor/canvas-react/components/shape-layer/ShapeRenderer.d.ts +12 -0
  362. package/_vendor/plugin-connector/_vendor/canvas-react/components/shape-layer/shapeFrame.d.ts +11 -0
  363. package/_vendor/plugin-connector/_vendor/canvas-react/components/useCanvasDomEvents.d.ts +23 -0
  364. package/_vendor/plugin-connector/_vendor/canvas-react/contextMenuRequest.d.ts +19 -0
  365. package/_vendor/plugin-connector/_vendor/canvas-react/dom.d.ts +10 -0
  366. package/_vendor/plugin-connector/_vendor/canvas-react/hooks/useEditor.d.ts +3 -0
  367. package/_vendor/plugin-connector/_vendor/canvas-react/hooks/useValue.d.ts +2 -0
  368. package/_vendor/plugin-connector/_vendor/canvas-react/host/canvasRenderBindings.d.ts +21 -0
  369. package/_vendor/plugin-connector/_vendor/canvas-react/host/canvasRenderBindingsContext.d.ts +5 -0
  370. package/_vendor/plugin-connector/_vendor/canvas-react/host/canvasRenderPlugin.d.ts +81 -0
  371. package/_vendor/plugin-connector/_vendor/canvas-react/host/index.d.ts +5 -0
  372. package/_vendor/plugin-connector/_vendor/canvas-react/index.d.ts +5 -0
  373. package/_vendor/plugin-connector/_vendor/plugin-geo/api.d.ts +43 -0
  374. package/_vendor/plugin-connector/_vendor/plugin-geo/canvasRender.d.ts +2 -0
  375. package/_vendor/plugin-connector/_vendor/plugin-geo/editorRuntime.d.ts +7 -0
  376. package/_vendor/plugin-connector/_vendor/plugin-geo/feature.d.ts +1 -0
  377. package/_vendor/plugin-connector/_vendor/plugin-geo/geoCreationRuntime.d.ts +20 -0
  378. package/_vendor/plugin-connector/_vendor/plugin-geo/geoGeometry.d.ts +64 -0
  379. package/_vendor/plugin-connector/_vendor/plugin-geo/geoShapeUtil.d.ts +16 -0
  380. package/_vendor/plugin-connector/_vendor/plugin-geo/geoStrokeStyle.d.ts +2 -0
  381. package/_vendor/plugin-connector/_vendor/plugin-geo/geoTools.d.ts +51 -0
  382. package/_vendor/plugin-connector/_vendor/plugin-geo/index.d.ts +9 -0
  383. package/_vendor/plugin-connector/_vendor/plugin-geo/svgPathGeometry.d.ts +7 -0
  384. package/_vendor/plugin-connector/_vendor/plugin-geo/types.d.ts +22 -0
  385. package/_vendor/plugin-connector/_vendor/signals/atom.d.ts +11 -0
  386. package/_vendor/plugin-connector/_vendor/signals/computed.d.ts +13 -0
  387. package/_vendor/plugin-connector/_vendor/signals/core.d.ts +35 -0
  388. package/_vendor/plugin-connector/_vendor/signals/effect.d.ts +5 -0
  389. package/_vendor/plugin-connector/_vendor/signals/index.d.ts +8 -0
  390. package/_vendor/plugin-connector/_vendor/signals/types.d.ts +22 -0
  391. package/_vendor/plugin-connector/_vendor/store/diff.d.ts +9 -0
  392. package/_vendor/plugin-connector/_vendor/store/history.d.ts +22 -0
  393. package/_vendor/plugin-connector/_vendor/store/index.d.ts +5 -0
  394. package/_vendor/plugin-connector/_vendor/store/store.d.ts +40 -0
  395. package/_vendor/plugin-connector/_vendor/store/types.d.ts +27 -0
  396. package/_vendor/plugin-connector/api.d.ts +28 -0
  397. package/_vendor/plugin-connector/canvasRender.d.ts +2 -0
  398. package/_vendor/plugin-connector/connectorBindingUtil.d.ts +28 -0
  399. package/_vendor/plugin-connector/connectorBindings.d.ts +8 -0
  400. package/_vendor/plugin-connector/connectorGeometry.d.ts +70 -0
  401. package/_vendor/plugin-connector/connectorHandles.d.ts +12 -0
  402. package/_vendor/plugin-connector/connectorInteractions.d.ts +3 -0
  403. package/_vendor/plugin-connector/connectorMarker.d.ts +7 -0
  404. package/_vendor/plugin-connector/connectorModel.d.ts +43 -0
  405. package/_vendor/plugin-connector/connectorPortInteraction.d.ts +13 -0
  406. package/_vendor/plugin-connector/connectorPorts.d.ts +23 -0
  407. package/_vendor/plugin-connector/connectorRuntime.d.ts +63 -0
  408. package/_vendor/plugin-connector/connectorShapeUtil.d.ts +29 -0
  409. package/_vendor/plugin-connector/connectorTool.d.ts +4 -0
  410. package/_vendor/plugin-connector/constants.d.ts +17 -0
  411. package/_vendor/plugin-connector/editorRuntime.d.ts +7 -0
  412. package/_vendor/plugin-connector/feature.d.ts +5 -0
  413. package/_vendor/plugin-connector/index.d.ts +20 -0
  414. package/_vendor/plugin-connector/orthogonalRoute.d.ts +9 -0
  415. package/_vendor/plugin-connector/quickConnect.d.ts +29 -0
  416. package/_vendor/plugin-connector/types.d.ts +52 -0
  417. package/_vendor/plugin-draw/DrawShapeRenderer.d.ts +13 -0
  418. package/_vendor/plugin-draw/_vendor/canvas-core/bindings/bindingManager.d.ts +33 -0
  419. package/_vendor/plugin-draw/_vendor/canvas-core/bindings/bindingUtil.d.ts +69 -0
  420. package/_vendor/plugin-draw/_vendor/canvas-core/bindings/bindingUtilRegistry.d.ts +8 -0
  421. package/_vendor/plugin-draw/_vendor/canvas-core/bindings/terminalBinding.d.ts +28 -0
  422. package/_vendor/plugin-draw/_vendor/canvas-core/bindings/terminalPorts.d.ts +67 -0
  423. package/_vendor/plugin-draw/_vendor/canvas-core/editor/clipboard.d.ts +43 -0
  424. package/_vendor/plugin-draw/_vendor/canvas-core/editor/clipboardAssets.d.ts +6 -0
  425. package/_vendor/plugin-draw/_vendor/canvas-core/editor/commands/assetCommands.d.ts +7 -0
  426. package/_vendor/plugin-draw/_vendor/canvas-core/editor/commands/bindingCommands.d.ts +12 -0
  427. package/_vendor/plugin-draw/_vendor/canvas-core/editor/commands/commandTypes.d.ts +149 -0
  428. package/_vendor/plugin-draw/_vendor/canvas-core/editor/commands/commands.d.ts +5 -0
  429. package/_vendor/plugin-draw/_vendor/canvas-core/editor/commands/documentCommands.d.ts +9 -0
  430. package/_vendor/plugin-draw/_vendor/canvas-core/editor/commands/sessionCommands.d.ts +13 -0
  431. package/_vendor/plugin-draw/_vendor/canvas-core/editor/commands/shapeCommands.d.ts +9 -0
  432. package/_vendor/plugin-draw/_vendor/canvas-core/editor/commands/shapeFlags.d.ts +10 -0
  433. package/_vendor/plugin-draw/_vendor/canvas-core/editor/commands/shapeRemoval.d.ts +10 -0
  434. package/_vendor/plugin-draw/_vendor/canvas-core/editor/commands/shapeRepair.d.ts +11 -0
  435. package/_vendor/plugin-draw/_vendor/canvas-core/editor/createEditor.d.ts +6 -0
  436. package/_vendor/plugin-draw/_vendor/canvas-core/editor/editor.d.ts +356 -0
  437. package/_vendor/plugin-draw/_vendor/canvas-core/editor/events/canvasNavigationInteraction.d.ts +2 -0
  438. package/_vendor/plugin-draw/_vendor/canvas-core/editor/events/eventRouter.d.ts +16 -0
  439. package/_vendor/plugin-draw/_vendor/canvas-core/editor/events/events.d.ts +81 -0
  440. package/_vendor/plugin-draw/_vendor/canvas-core/editor/events/inputsManager.d.ts +49 -0
  441. package/_vendor/plugin-draw/_vendor/canvas-core/editor/events/interactions.d.ts +84 -0
  442. package/_vendor/plugin-draw/_vendor/canvas-core/editor/events/keyboardShortcuts.d.ts +23 -0
  443. package/_vendor/plugin-draw/_vendor/canvas-core/editor/events/pointerClickRecognizer.d.ts +11 -0
  444. package/_vendor/plugin-draw/_vendor/canvas-core/editor/history/historyManager.d.ts +40 -0
  445. package/_vendor/plugin-draw/_vendor/canvas-core/editor/history/operationManager.d.ts +77 -0
  446. package/_vendor/plugin-draw/_vendor/canvas-core/editor/internal.d.ts +7 -0
  447. package/_vendor/plugin-draw/_vendor/canvas-core/editor/queries/bindingQueryCache.d.ts +28 -0
  448. package/_vendor/plugin-draw/_vendor/canvas-core/editor/queries/bindingQueryState.d.ts +11 -0
  449. package/_vendor/plugin-draw/_vendor/canvas-core/editor/queries/draftBindingIndex.d.ts +19 -0
  450. package/_vendor/plugin-draw/_vendor/canvas-core/editor/queries/shapeGeometryQueryCache.d.ts +34 -0
  451. package/_vendor/plugin-draw/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +43 -0
  452. package/_vendor/plugin-draw/_vendor/canvas-core/editor/queries/shapeTreeIndex.d.ts +27 -0
  453. package/_vendor/plugin-draw/_vendor/canvas-core/editor/queries/shapeTreeIndexState.d.ts +11 -0
  454. package/_vendor/plugin-draw/_vendor/canvas-core/editor/queries/spatialIndexManager.d.ts +34 -0
  455. package/_vendor/plugin-draw/_vendor/canvas-core/editor/records/documentSnapshots.d.ts +14 -0
  456. package/_vendor/plugin-draw/_vendor/canvas-core/editor/records/editorRecordFactory.d.ts +19 -0
  457. package/_vendor/plugin-draw/_vendor/canvas-core/editor/records/recordQueries.d.ts +3 -0
  458. package/_vendor/plugin-draw/_vendor/canvas-core/editor/selection/resizeGeometry.d.ts +117 -0
  459. package/_vendor/plugin-draw/_vendor/canvas-core/editor/selection/selection.d.ts +223 -0
  460. package/_vendor/plugin-draw/_vendor/canvas-core/editor/selection/selectionBindingSegments.d.ts +7 -0
  461. package/_vendor/plugin-draw/_vendor/canvas-core/editor/selection/selectionGeometry.d.ts +28 -0
  462. package/_vendor/plugin-draw/_vendor/canvas-core/editor/selection/selectionHandleHitTest.d.ts +8 -0
  463. package/_vendor/plugin-draw/_vendor/canvas-core/editor/selection/selectionLayout.d.ts +20 -0
  464. package/_vendor/plugin-draw/_vendor/canvas-core/editor/selection/selectionOverlay.d.ts +25 -0
  465. package/_vendor/plugin-draw/_vendor/canvas-core/editor/selection/selectionOverlayEquality.d.ts +8 -0
  466. package/_vendor/plugin-draw/_vendor/canvas-core/editor/selection/selectionOverlayManager.d.ts +34 -0
  467. package/_vendor/plugin-draw/_vendor/canvas-core/editor/selection/selectionResizeCapabilities.d.ts +11 -0
  468. package/_vendor/plugin-draw/_vendor/canvas-core/editor/selection/selectionSet.d.ts +9 -0
  469. package/_vendor/plugin-draw/_vendor/canvas-core/editor/selection/selectionTargets.d.ts +10 -0
  470. package/_vendor/plugin-draw/_vendor/canvas-core/editor/selection/selectionTransforms.d.ts +6 -0
  471. package/_vendor/plugin-draw/_vendor/canvas-core/editor/shapes/shapeContainment.d.ts +14 -0
  472. package/_vendor/plugin-draw/_vendor/canvas-core/editor/shapes/shapeEditingManager.d.ts +33 -0
  473. package/_vendor/plugin-draw/_vendor/canvas-core/editor/shapes/shapeExportTraversal.d.ts +3 -0
  474. package/_vendor/plugin-draw/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +21 -0
  475. package/_vendor/plugin-draw/_vendor/canvas-core/editor/shapes/shapeGrouping.d.ts +22 -0
  476. package/_vendor/plugin-draw/_vendor/canvas-core/editor/shapes/shapeOrder.d.ts +32 -0
  477. package/_vendor/plugin-draw/_vendor/canvas-core/editor/shapes/shapeReparenting.d.ts +21 -0
  478. package/_vendor/plugin-draw/_vendor/canvas-core/editor/shapes/shapeSignalManager.d.ts +35 -0
  479. package/_vendor/plugin-draw/_vendor/canvas-core/editor/shapes/shapeTransformSpace.d.ts +6 -0
  480. package/_vendor/plugin-draw/_vendor/canvas-core/editor/shapes/shapeTreeQueries.d.ts +12 -0
  481. package/_vendor/plugin-draw/_vendor/canvas-core/editor/snapping/gapSnap.d.ts +6 -0
  482. package/_vendor/plugin-draw/_vendor/canvas-core/editor/snapping/pointSnap.d.ts +5 -0
  483. package/_vendor/plugin-draw/_vendor/canvas-core/editor/snapping/resizeSnap.d.ts +11 -0
  484. package/_vendor/plugin-draw/_vendor/canvas-core/editor/snapping/snapDecision.d.ts +2 -0
  485. package/_vendor/plugin-draw/_vendor/canvas-core/editor/snapping/snapGeometry.d.ts +26 -0
  486. package/_vendor/plugin-draw/_vendor/canvas-core/editor/snapping/snapIndicators.d.ts +22 -0
  487. package/_vendor/plugin-draw/_vendor/canvas-core/editor/snapping/snapManager.d.ts +54 -0
  488. package/_vendor/plugin-draw/_vendor/canvas-core/editor/snapping/snapResults.d.ts +58 -0
  489. package/_vendor/plugin-draw/_vendor/canvas-core/editor/snapping/snapSnapshotBuilder.d.ts +22 -0
  490. package/_vendor/plugin-draw/_vendor/canvas-core/editor/snapping/snapTypes.d.ts +114 -0
  491. package/_vendor/plugin-draw/_vendor/canvas-core/editor/state/editorReadModels.d.ts +34 -0
  492. package/_vendor/plugin-draw/_vendor/canvas-core/editor/state/editorSignals.d.ts +82 -0
  493. package/_vendor/plugin-draw/_vendor/canvas-core/editor/state/editorStateUtils.d.ts +9 -0
  494. package/_vendor/plugin-draw/_vendor/canvas-core/editor/state/interactionTransientManager.d.ts +35 -0
  495. package/_vendor/plugin-draw/_vendor/canvas-core/editor/viewport/camera.d.ts +3 -0
  496. package/_vendor/plugin-draw/_vendor/canvas-core/editor/viewport/cameraManager.d.ts +56 -0
  497. package/_vendor/plugin-draw/_vendor/canvas-core/editor/viewport/cameraPanSession.d.ts +9 -0
  498. package/_vendor/plugin-draw/_vendor/canvas-core/editor/viewport/edgeScroll.d.ts +5 -0
  499. package/_vendor/plugin-draw/_vendor/canvas-core/editor/viewport/renderWindow.d.ts +30 -0
  500. package/_vendor/plugin-draw/_vendor/canvas-core/editor/viewport/renderWindowManager.d.ts +33 -0
  501. package/_vendor/plugin-draw/_vendor/canvas-core/exports/integrity.d.ts +32 -0
  502. package/_vendor/plugin-draw/_vendor/canvas-core/exports/svg.d.ts +52 -0
  503. package/_vendor/plugin-draw/_vendor/canvas-core/geometry/box.d.ts +20 -0
  504. package/_vendor/plugin-draw/_vendor/canvas-core/geometry/contentCutout.d.ts +8 -0
  505. package/_vendor/plugin-draw/_vendor/canvas-core/geometry/ellipse2d.d.ts +16 -0
  506. package/_vendor/plugin-draw/_vendor/canvas-core/geometry/geometry2d.d.ts +15 -0
  507. package/_vendor/plugin-draw/_vendor/canvas-core/geometry/index.d.ts +9 -0
  508. package/_vendor/plugin-draw/_vendor/canvas-core/geometry/mat.d.ts +31 -0
  509. package/_vendor/plugin-draw/_vendor/canvas-core/geometry/polygon.d.ts +7 -0
  510. package/_vendor/plugin-draw/_vendor/canvas-core/geometry/polyline2d.d.ts +14 -0
  511. package/_vendor/plugin-draw/_vendor/canvas-core/geometry/rectangle2d.d.ts +16 -0
  512. package/_vendor/plugin-draw/_vendor/canvas-core/geometry/segments.d.ts +5 -0
  513. package/_vendor/plugin-draw/_vendor/canvas-core/geometry/vec.d.ts +35 -0
  514. package/_vendor/plugin-draw/_vendor/canvas-core/index.d.ts +64 -0
  515. package/_vendor/plugin-draw/_vendor/canvas-core/plugins/editorRuntimePlugin.d.ts +19 -0
  516. package/_vendor/plugin-draw/_vendor/canvas-core/plugins/editorRuntimeRegistry.d.ts +15 -0
  517. package/_vendor/plugin-draw/_vendor/canvas-core/plugins/index.d.ts +2 -0
  518. package/_vendor/plugin-draw/_vendor/canvas-core/reactivity.d.ts +8 -0
  519. package/_vendor/plugin-draw/_vendor/canvas-core/schema/records.d.ts +115 -0
  520. package/_vendor/plugin-draw/_vendor/canvas-core/schema/snapshots.d.ts +22 -0
  521. package/_vendor/plugin-draw/_vendor/canvas-core/shapes/childTransformPolicy.d.ts +16 -0
  522. package/_vendor/plugin-draw/_vendor/canvas-core/shapes/colors.d.ts +26 -0
  523. package/_vendor/plugin-draw/_vendor/canvas-core/shapes/shapeUtil.d.ts +245 -0
  524. package/_vendor/plugin-draw/_vendor/canvas-core/shapes/shapeUtilGeometry.d.ts +6 -0
  525. package/_vendor/plugin-draw/_vendor/canvas-core/shapes/shapeUtilRegistry.d.ts +9 -0
  526. package/_vendor/plugin-draw/_vendor/canvas-core/shapes/types.d.ts +2 -0
  527. package/_vendor/plugin-draw/_vendor/canvas-core/tools/hand/handTool.d.ts +5 -0
  528. package/_vendor/plugin-draw/_vendor/canvas-core/tools/select/selectContainment.d.ts +12 -0
  529. package/_vendor/plugin-draw/_vendor/canvas-core/tools/select/selectTool.d.ts +5 -0
  530. package/_vendor/plugin-draw/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +170 -0
  531. package/_vendor/plugin-draw/_vendor/canvas-core/tools/select/states/brushingState.d.ts +19 -0
  532. package/_vendor/plugin-draw/_vendor/canvas-core/tools/select/states/draggingPluginInteractionState.d.ts +15 -0
  533. package/_vendor/plugin-draw/_vendor/canvas-core/tools/select/states/idleState.d.ts +8 -0
  534. package/_vendor/plugin-draw/_vendor/canvas-core/tools/select/states/index.d.ts +11 -0
  535. package/_vendor/plugin-draw/_vendor/canvas-core/tools/select/states/pointingCanvasState.d.ts +11 -0
  536. package/_vendor/plugin-draw/_vendor/canvas-core/tools/select/states/pointingResizeHandleState.d.ts +10 -0
  537. package/_vendor/plugin-draw/_vendor/canvas-core/tools/select/states/pointingRotateHandleState.d.ts +10 -0
  538. package/_vendor/plugin-draw/_vendor/canvas-core/tools/select/states/pointingSelectionHandleInteractionState.d.ts +11 -0
  539. package/_vendor/plugin-draw/_vendor/canvas-core/tools/select/states/pointingShapeState.d.ts +12 -0
  540. package/_vendor/plugin-draw/_vendor/canvas-core/tools/select/states/resizingState.d.ts +16 -0
  541. package/_vendor/plugin-draw/_vendor/canvas-core/tools/select/states/rotatingState.d.ts +14 -0
  542. package/_vendor/plugin-draw/_vendor/canvas-core/tools/select/states/selectStateNode.d.ts +60 -0
  543. package/_vendor/plugin-draw/_vendor/canvas-core/tools/select/states/translatingState.d.ts +16 -0
  544. package/_vendor/plugin-draw/_vendor/canvas-core/tools/stateNode.d.ts +30 -0
  545. package/_vendor/plugin-draw/_vendor/canvas-core/tools/toolManager.d.ts +24 -0
  546. package/_vendor/plugin-draw/_vendor/canvas-core/utils/equality.d.ts +9 -0
  547. package/_vendor/plugin-draw/_vendor/canvas-extension-contracts/contributions.d.ts +92 -0
  548. package/_vendor/plugin-draw/_vendor/canvas-extension-contracts/index.d.ts +6 -0
  549. package/_vendor/plugin-draw/_vendor/canvas-extension-contracts/operations.d.ts +131 -0
  550. package/_vendor/plugin-draw/_vendor/canvas-extension-contracts/persistence.d.ts +16 -0
  551. package/_vendor/plugin-draw/_vendor/canvas-extension-contracts/plugin.d.ts +37 -0
  552. package/_vendor/plugin-draw/_vendor/canvas-extension-contracts/shape.d.ts +5 -0
  553. package/_vendor/plugin-draw/_vendor/canvas-extension-contracts/tokens.d.ts +12 -0
  554. package/_vendor/plugin-draw/_vendor/canvas-react/components/CanvasView.d.ts +7 -0
  555. package/_vendor/plugin-draw/_vendor/canvas-react/components/DefaultGrid.d.ts +1 -0
  556. package/_vendor/plugin-draw/_vendor/canvas-react/components/OverlayLayer.d.ts +1 -0
  557. package/_vendor/plugin-draw/_vendor/canvas-react/components/PageSpace.d.ts +6 -0
  558. package/_vendor/plugin-draw/_vendor/canvas-react/components/ShapeLayer.d.ts +1 -0
  559. package/_vendor/plugin-draw/_vendor/canvas-react/components/canvasKeyboardEvents.d.ts +13 -0
  560. package/_vendor/plugin-draw/_vendor/canvas-react/components/index.d.ts +3 -0
  561. package/_vendor/plugin-draw/_vendor/canvas-react/components/overlays/BindingGuide.d.ts +24 -0
  562. package/_vendor/plugin-draw/_vendor/canvas-react/components/overlays/BindingPreviewOverlay.d.ts +1 -0
  563. package/_vendor/plugin-draw/_vendor/canvas-react/components/overlays/BrushBoxOverlay.d.ts +1 -0
  564. package/_vendor/plugin-draw/_vendor/canvas-react/components/overlays/OverlaySvgRoot.d.ts +1 -0
  565. package/_vendor/plugin-draw/_vendor/canvas-react/components/overlays/SelectionFrameOverlay.d.ts +1 -0
  566. package/_vendor/plugin-draw/_vendor/canvas-react/components/overlays/SelectionHandlesOverlay.d.ts +1 -0
  567. package/_vendor/plugin-draw/_vendor/canvas-react/components/overlays/SelectionOverlaySvg.d.ts +1 -0
  568. package/_vendor/plugin-draw/_vendor/canvas-react/components/overlays/SelectionPathOverlay.d.ts +8 -0
  569. package/_vendor/plugin-draw/_vendor/canvas-react/components/overlays/ShapeOutlineOverlay.d.ts +8 -0
  570. package/_vendor/plugin-draw/_vendor/canvas-react/components/overlays/SnapIndicatorsOverlay.d.ts +1 -0
  571. package/_vendor/plugin-draw/_vendor/canvas-react/components/overlays/TerminalBindingGuidesOverlay.d.ts +1 -0
  572. package/_vendor/plugin-draw/_vendor/canvas-react/components/shape-layer/ShapeClipStack.d.ts +11 -0
  573. package/_vendor/plugin-draw/_vendor/canvas-react/components/shape-layer/ShapeDecorations.d.ts +2 -0
  574. package/_vendor/plugin-draw/_vendor/canvas-react/components/shape-layer/ShapeForegroundItem.d.ts +5 -0
  575. package/_vendor/plugin-draw/_vendor/canvas-react/components/shape-layer/ShapeItem.d.ts +5 -0
  576. package/_vendor/plugin-draw/_vendor/canvas-react/components/shape-layer/ShapeRenderList.d.ts +1 -0
  577. package/_vendor/plugin-draw/_vendor/canvas-react/components/shape-layer/ShapeRenderer.d.ts +12 -0
  578. package/_vendor/plugin-draw/_vendor/canvas-react/components/shape-layer/shapeFrame.d.ts +11 -0
  579. package/_vendor/plugin-draw/_vendor/canvas-react/components/useCanvasDomEvents.d.ts +23 -0
  580. package/_vendor/plugin-draw/_vendor/canvas-react/contextMenuRequest.d.ts +19 -0
  581. package/_vendor/plugin-draw/_vendor/canvas-react/dom.d.ts +10 -0
  582. package/_vendor/plugin-draw/_vendor/canvas-react/hooks/useEditor.d.ts +3 -0
  583. package/_vendor/plugin-draw/_vendor/canvas-react/hooks/useValue.d.ts +2 -0
  584. package/_vendor/plugin-draw/_vendor/canvas-react/host/canvasRenderBindings.d.ts +21 -0
  585. package/_vendor/plugin-draw/_vendor/canvas-react/host/canvasRenderBindingsContext.d.ts +5 -0
  586. package/_vendor/plugin-draw/_vendor/canvas-react/host/canvasRenderPlugin.d.ts +81 -0
  587. package/_vendor/plugin-draw/_vendor/canvas-react/host/index.d.ts +5 -0
  588. package/_vendor/plugin-draw/_vendor/canvas-react/index.d.ts +5 -0
  589. package/_vendor/plugin-draw/_vendor/signals/atom.d.ts +11 -0
  590. package/_vendor/plugin-draw/_vendor/signals/computed.d.ts +13 -0
  591. package/_vendor/plugin-draw/_vendor/signals/core.d.ts +35 -0
  592. package/_vendor/plugin-draw/_vendor/signals/effect.d.ts +5 -0
  593. package/_vendor/plugin-draw/_vendor/signals/index.d.ts +8 -0
  594. package/_vendor/plugin-draw/_vendor/signals/types.d.ts +22 -0
  595. package/_vendor/plugin-draw/_vendor/store/diff.d.ts +9 -0
  596. package/_vendor/plugin-draw/_vendor/store/history.d.ts +22 -0
  597. package/_vendor/plugin-draw/_vendor/store/index.d.ts +5 -0
  598. package/_vendor/plugin-draw/_vendor/store/store.d.ts +40 -0
  599. package/_vendor/plugin-draw/_vendor/store/types.d.ts +27 -0
  600. package/_vendor/plugin-draw/api.d.ts +13 -0
  601. package/_vendor/plugin-draw/canvasRender.d.ts +2 -0
  602. package/_vendor/plugin-draw/drawGeometry.d.ts +42 -0
  603. package/_vendor/plugin-draw/drawHitTest.d.ts +11 -0
  604. package/_vendor/plugin-draw/drawInterpolation.d.ts +5 -0
  605. package/_vendor/plugin-draw/drawPath.d.ts +43 -0
  606. package/_vendor/plugin-draw/drawSegments.d.ts +11 -0
  607. package/_vendor/plugin-draw/drawSelectionTransform.d.ts +18 -0
  608. package/_vendor/plugin-draw/drawShapeGeometry.d.ts +33 -0
  609. package/_vendor/plugin-draw/drawShapeUtil.d.ts +21 -0
  610. package/_vendor/plugin-draw/drawStrokeGeometry.d.ts +17 -0
  611. package/_vendor/plugin-draw/drawTool.d.ts +6 -0
  612. package/_vendor/plugin-draw/editorRuntime.d.ts +7 -0
  613. package/_vendor/plugin-draw/feature.d.ts +3 -0
  614. package/_vendor/plugin-draw/index.d.ts +15 -0
  615. package/_vendor/plugin-draw/types.d.ts +23 -0
  616. package/_vendor/plugin-eraser/_vendor/canvas-core/bindings/bindingManager.d.ts +33 -0
  617. package/_vendor/plugin-eraser/_vendor/canvas-core/bindings/bindingUtil.d.ts +69 -0
  618. package/_vendor/plugin-eraser/_vendor/canvas-core/bindings/bindingUtilRegistry.d.ts +8 -0
  619. package/_vendor/plugin-eraser/_vendor/canvas-core/bindings/terminalBinding.d.ts +28 -0
  620. package/_vendor/plugin-eraser/_vendor/canvas-core/bindings/terminalPorts.d.ts +67 -0
  621. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/clipboard.d.ts +43 -0
  622. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/clipboardAssets.d.ts +6 -0
  623. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/commands/assetCommands.d.ts +7 -0
  624. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/commands/bindingCommands.d.ts +12 -0
  625. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/commands/commandTypes.d.ts +149 -0
  626. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/commands/commands.d.ts +5 -0
  627. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/commands/documentCommands.d.ts +9 -0
  628. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/commands/sessionCommands.d.ts +13 -0
  629. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/commands/shapeCommands.d.ts +9 -0
  630. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/commands/shapeFlags.d.ts +10 -0
  631. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/commands/shapeRemoval.d.ts +10 -0
  632. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/commands/shapeRepair.d.ts +11 -0
  633. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/createEditor.d.ts +6 -0
  634. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/editor.d.ts +356 -0
  635. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/events/canvasNavigationInteraction.d.ts +2 -0
  636. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/events/eventRouter.d.ts +16 -0
  637. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/events/events.d.ts +81 -0
  638. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/events/inputsManager.d.ts +49 -0
  639. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/events/interactions.d.ts +84 -0
  640. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/events/keyboardShortcuts.d.ts +23 -0
  641. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/events/pointerClickRecognizer.d.ts +11 -0
  642. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/history/historyManager.d.ts +40 -0
  643. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/history/operationManager.d.ts +77 -0
  644. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/internal.d.ts +7 -0
  645. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/queries/bindingQueryCache.d.ts +28 -0
  646. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/queries/bindingQueryState.d.ts +11 -0
  647. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/queries/draftBindingIndex.d.ts +19 -0
  648. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/queries/shapeGeometryQueryCache.d.ts +34 -0
  649. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +43 -0
  650. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/queries/shapeTreeIndex.d.ts +27 -0
  651. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/queries/shapeTreeIndexState.d.ts +11 -0
  652. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/queries/spatialIndexManager.d.ts +34 -0
  653. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/records/documentSnapshots.d.ts +14 -0
  654. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/records/editorRecordFactory.d.ts +19 -0
  655. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/records/recordQueries.d.ts +3 -0
  656. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/selection/resizeGeometry.d.ts +117 -0
  657. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/selection/selection.d.ts +223 -0
  658. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/selection/selectionBindingSegments.d.ts +7 -0
  659. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/selection/selectionGeometry.d.ts +28 -0
  660. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/selection/selectionHandleHitTest.d.ts +8 -0
  661. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/selection/selectionLayout.d.ts +20 -0
  662. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/selection/selectionOverlay.d.ts +25 -0
  663. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/selection/selectionOverlayEquality.d.ts +8 -0
  664. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/selection/selectionOverlayManager.d.ts +34 -0
  665. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/selection/selectionResizeCapabilities.d.ts +11 -0
  666. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/selection/selectionSet.d.ts +9 -0
  667. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/selection/selectionTargets.d.ts +10 -0
  668. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/selection/selectionTransforms.d.ts +6 -0
  669. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/shapes/shapeContainment.d.ts +14 -0
  670. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/shapes/shapeEditingManager.d.ts +33 -0
  671. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/shapes/shapeExportTraversal.d.ts +3 -0
  672. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +21 -0
  673. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/shapes/shapeGrouping.d.ts +22 -0
  674. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/shapes/shapeOrder.d.ts +32 -0
  675. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/shapes/shapeReparenting.d.ts +21 -0
  676. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/shapes/shapeSignalManager.d.ts +35 -0
  677. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/shapes/shapeTransformSpace.d.ts +6 -0
  678. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/shapes/shapeTreeQueries.d.ts +12 -0
  679. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/snapping/gapSnap.d.ts +6 -0
  680. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/snapping/pointSnap.d.ts +5 -0
  681. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/snapping/resizeSnap.d.ts +11 -0
  682. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/snapping/snapDecision.d.ts +2 -0
  683. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/snapping/snapGeometry.d.ts +26 -0
  684. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/snapping/snapIndicators.d.ts +22 -0
  685. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/snapping/snapManager.d.ts +54 -0
  686. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/snapping/snapResults.d.ts +58 -0
  687. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/snapping/snapSnapshotBuilder.d.ts +22 -0
  688. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/snapping/snapTypes.d.ts +114 -0
  689. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/state/editorReadModels.d.ts +34 -0
  690. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/state/editorSignals.d.ts +82 -0
  691. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/state/editorStateUtils.d.ts +9 -0
  692. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/state/interactionTransientManager.d.ts +35 -0
  693. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/viewport/camera.d.ts +3 -0
  694. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/viewport/cameraManager.d.ts +56 -0
  695. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/viewport/cameraPanSession.d.ts +9 -0
  696. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/viewport/edgeScroll.d.ts +5 -0
  697. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/viewport/renderWindow.d.ts +30 -0
  698. package/_vendor/plugin-eraser/_vendor/canvas-core/editor/viewport/renderWindowManager.d.ts +33 -0
  699. package/_vendor/plugin-eraser/_vendor/canvas-core/exports/integrity.d.ts +32 -0
  700. package/_vendor/plugin-eraser/_vendor/canvas-core/exports/svg.d.ts +52 -0
  701. package/_vendor/plugin-eraser/_vendor/canvas-core/geometry/box.d.ts +20 -0
  702. package/_vendor/plugin-eraser/_vendor/canvas-core/geometry/contentCutout.d.ts +8 -0
  703. package/_vendor/plugin-eraser/_vendor/canvas-core/geometry/ellipse2d.d.ts +16 -0
  704. package/_vendor/plugin-eraser/_vendor/canvas-core/geometry/geometry2d.d.ts +15 -0
  705. package/_vendor/plugin-eraser/_vendor/canvas-core/geometry/index.d.ts +9 -0
  706. package/_vendor/plugin-eraser/_vendor/canvas-core/geometry/mat.d.ts +31 -0
  707. package/_vendor/plugin-eraser/_vendor/canvas-core/geometry/polygon.d.ts +7 -0
  708. package/_vendor/plugin-eraser/_vendor/canvas-core/geometry/polyline2d.d.ts +14 -0
  709. package/_vendor/plugin-eraser/_vendor/canvas-core/geometry/rectangle2d.d.ts +16 -0
  710. package/_vendor/plugin-eraser/_vendor/canvas-core/geometry/segments.d.ts +5 -0
  711. package/_vendor/plugin-eraser/_vendor/canvas-core/geometry/vec.d.ts +35 -0
  712. package/_vendor/plugin-eraser/_vendor/canvas-core/index.d.ts +64 -0
  713. package/_vendor/plugin-eraser/_vendor/canvas-core/plugins/editorRuntimePlugin.d.ts +19 -0
  714. package/_vendor/plugin-eraser/_vendor/canvas-core/plugins/editorRuntimeRegistry.d.ts +15 -0
  715. package/_vendor/plugin-eraser/_vendor/canvas-core/plugins/index.d.ts +2 -0
  716. package/_vendor/plugin-eraser/_vendor/canvas-core/reactivity.d.ts +8 -0
  717. package/_vendor/plugin-eraser/_vendor/canvas-core/schema/records.d.ts +115 -0
  718. package/_vendor/plugin-eraser/_vendor/canvas-core/schema/snapshots.d.ts +22 -0
  719. package/_vendor/plugin-eraser/_vendor/canvas-core/shapes/childTransformPolicy.d.ts +16 -0
  720. package/_vendor/plugin-eraser/_vendor/canvas-core/shapes/colors.d.ts +26 -0
  721. package/_vendor/plugin-eraser/_vendor/canvas-core/shapes/shapeUtil.d.ts +245 -0
  722. package/_vendor/plugin-eraser/_vendor/canvas-core/shapes/shapeUtilGeometry.d.ts +6 -0
  723. package/_vendor/plugin-eraser/_vendor/canvas-core/shapes/shapeUtilRegistry.d.ts +9 -0
  724. package/_vendor/plugin-eraser/_vendor/canvas-core/shapes/types.d.ts +2 -0
  725. package/_vendor/plugin-eraser/_vendor/canvas-core/tools/hand/handTool.d.ts +5 -0
  726. package/_vendor/plugin-eraser/_vendor/canvas-core/tools/select/selectContainment.d.ts +12 -0
  727. package/_vendor/plugin-eraser/_vendor/canvas-core/tools/select/selectTool.d.ts +5 -0
  728. package/_vendor/plugin-eraser/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +170 -0
  729. package/_vendor/plugin-eraser/_vendor/canvas-core/tools/select/states/brushingState.d.ts +19 -0
  730. package/_vendor/plugin-eraser/_vendor/canvas-core/tools/select/states/draggingPluginInteractionState.d.ts +15 -0
  731. package/_vendor/plugin-eraser/_vendor/canvas-core/tools/select/states/idleState.d.ts +8 -0
  732. package/_vendor/plugin-eraser/_vendor/canvas-core/tools/select/states/index.d.ts +11 -0
  733. package/_vendor/plugin-eraser/_vendor/canvas-core/tools/select/states/pointingCanvasState.d.ts +11 -0
  734. package/_vendor/plugin-eraser/_vendor/canvas-core/tools/select/states/pointingResizeHandleState.d.ts +10 -0
  735. package/_vendor/plugin-eraser/_vendor/canvas-core/tools/select/states/pointingRotateHandleState.d.ts +10 -0
  736. package/_vendor/plugin-eraser/_vendor/canvas-core/tools/select/states/pointingSelectionHandleInteractionState.d.ts +11 -0
  737. package/_vendor/plugin-eraser/_vendor/canvas-core/tools/select/states/pointingShapeState.d.ts +12 -0
  738. package/_vendor/plugin-eraser/_vendor/canvas-core/tools/select/states/resizingState.d.ts +16 -0
  739. package/_vendor/plugin-eraser/_vendor/canvas-core/tools/select/states/rotatingState.d.ts +14 -0
  740. package/_vendor/plugin-eraser/_vendor/canvas-core/tools/select/states/selectStateNode.d.ts +60 -0
  741. package/_vendor/plugin-eraser/_vendor/canvas-core/tools/select/states/translatingState.d.ts +16 -0
  742. package/_vendor/plugin-eraser/_vendor/canvas-core/tools/stateNode.d.ts +30 -0
  743. package/_vendor/plugin-eraser/_vendor/canvas-core/tools/toolManager.d.ts +24 -0
  744. package/_vendor/plugin-eraser/_vendor/canvas-core/utils/equality.d.ts +9 -0
  745. package/_vendor/plugin-eraser/_vendor/canvas-extension-contracts/contributions.d.ts +92 -0
  746. package/_vendor/plugin-eraser/_vendor/canvas-extension-contracts/index.d.ts +6 -0
  747. package/_vendor/plugin-eraser/_vendor/canvas-extension-contracts/operations.d.ts +131 -0
  748. package/_vendor/plugin-eraser/_vendor/canvas-extension-contracts/persistence.d.ts +16 -0
  749. package/_vendor/plugin-eraser/_vendor/canvas-extension-contracts/plugin.d.ts +37 -0
  750. package/_vendor/plugin-eraser/_vendor/canvas-extension-contracts/shape.d.ts +5 -0
  751. package/_vendor/plugin-eraser/_vendor/canvas-extension-contracts/tokens.d.ts +12 -0
  752. package/_vendor/plugin-eraser/_vendor/canvas-react/components/CanvasView.d.ts +7 -0
  753. package/_vendor/plugin-eraser/_vendor/canvas-react/components/DefaultGrid.d.ts +1 -0
  754. package/_vendor/plugin-eraser/_vendor/canvas-react/components/OverlayLayer.d.ts +1 -0
  755. package/_vendor/plugin-eraser/_vendor/canvas-react/components/PageSpace.d.ts +6 -0
  756. package/_vendor/plugin-eraser/_vendor/canvas-react/components/ShapeLayer.d.ts +1 -0
  757. package/_vendor/plugin-eraser/_vendor/canvas-react/components/canvasKeyboardEvents.d.ts +13 -0
  758. package/_vendor/plugin-eraser/_vendor/canvas-react/components/index.d.ts +3 -0
  759. package/_vendor/plugin-eraser/_vendor/canvas-react/components/overlays/BindingGuide.d.ts +24 -0
  760. package/_vendor/plugin-eraser/_vendor/canvas-react/components/overlays/BindingPreviewOverlay.d.ts +1 -0
  761. package/_vendor/plugin-eraser/_vendor/canvas-react/components/overlays/BrushBoxOverlay.d.ts +1 -0
  762. package/_vendor/plugin-eraser/_vendor/canvas-react/components/overlays/OverlaySvgRoot.d.ts +1 -0
  763. package/_vendor/plugin-eraser/_vendor/canvas-react/components/overlays/SelectionFrameOverlay.d.ts +1 -0
  764. package/_vendor/plugin-eraser/_vendor/canvas-react/components/overlays/SelectionHandlesOverlay.d.ts +1 -0
  765. package/_vendor/plugin-eraser/_vendor/canvas-react/components/overlays/SelectionOverlaySvg.d.ts +1 -0
  766. package/_vendor/plugin-eraser/_vendor/canvas-react/components/overlays/SelectionPathOverlay.d.ts +8 -0
  767. package/_vendor/plugin-eraser/_vendor/canvas-react/components/overlays/ShapeOutlineOverlay.d.ts +8 -0
  768. package/_vendor/plugin-eraser/_vendor/canvas-react/components/overlays/SnapIndicatorsOverlay.d.ts +1 -0
  769. package/_vendor/plugin-eraser/_vendor/canvas-react/components/overlays/TerminalBindingGuidesOverlay.d.ts +1 -0
  770. package/_vendor/plugin-eraser/_vendor/canvas-react/components/shape-layer/ShapeClipStack.d.ts +11 -0
  771. package/_vendor/plugin-eraser/_vendor/canvas-react/components/shape-layer/ShapeDecorations.d.ts +2 -0
  772. package/_vendor/plugin-eraser/_vendor/canvas-react/components/shape-layer/ShapeForegroundItem.d.ts +5 -0
  773. package/_vendor/plugin-eraser/_vendor/canvas-react/components/shape-layer/ShapeItem.d.ts +5 -0
  774. package/_vendor/plugin-eraser/_vendor/canvas-react/components/shape-layer/ShapeRenderList.d.ts +1 -0
  775. package/_vendor/plugin-eraser/_vendor/canvas-react/components/shape-layer/ShapeRenderer.d.ts +12 -0
  776. package/_vendor/plugin-eraser/_vendor/canvas-react/components/shape-layer/shapeFrame.d.ts +11 -0
  777. package/_vendor/plugin-eraser/_vendor/canvas-react/components/useCanvasDomEvents.d.ts +23 -0
  778. package/_vendor/plugin-eraser/_vendor/canvas-react/contextMenuRequest.d.ts +19 -0
  779. package/_vendor/plugin-eraser/_vendor/canvas-react/dom.d.ts +10 -0
  780. package/_vendor/plugin-eraser/_vendor/canvas-react/hooks/useEditor.d.ts +3 -0
  781. package/_vendor/plugin-eraser/_vendor/canvas-react/hooks/useValue.d.ts +2 -0
  782. package/_vendor/plugin-eraser/_vendor/canvas-react/host/canvasRenderBindings.d.ts +21 -0
  783. package/_vendor/plugin-eraser/_vendor/canvas-react/host/canvasRenderBindingsContext.d.ts +5 -0
  784. package/_vendor/plugin-eraser/_vendor/canvas-react/host/canvasRenderPlugin.d.ts +81 -0
  785. package/_vendor/plugin-eraser/_vendor/canvas-react/host/index.d.ts +5 -0
  786. package/_vendor/plugin-eraser/_vendor/canvas-react/index.d.ts +5 -0
  787. package/_vendor/plugin-eraser/_vendor/signals/atom.d.ts +11 -0
  788. package/_vendor/plugin-eraser/_vendor/signals/computed.d.ts +13 -0
  789. package/_vendor/plugin-eraser/_vendor/signals/core.d.ts +35 -0
  790. package/_vendor/plugin-eraser/_vendor/signals/effect.d.ts +5 -0
  791. package/_vendor/plugin-eraser/_vendor/signals/index.d.ts +8 -0
  792. package/_vendor/plugin-eraser/_vendor/signals/types.d.ts +22 -0
  793. package/_vendor/plugin-eraser/_vendor/store/diff.d.ts +9 -0
  794. package/_vendor/plugin-eraser/_vendor/store/history.d.ts +22 -0
  795. package/_vendor/plugin-eraser/_vendor/store/index.d.ts +5 -0
  796. package/_vendor/plugin-eraser/_vendor/store/store.d.ts +40 -0
  797. package/_vendor/plugin-eraser/_vendor/store/types.d.ts +27 -0
  798. package/_vendor/plugin-eraser/canvasRender.d.ts +2 -0
  799. package/_vendor/plugin-eraser/editorRuntime.d.ts +2 -0
  800. package/_vendor/plugin-eraser/eraserRuntime.d.ts +13 -0
  801. package/_vendor/plugin-eraser/eraserTool.d.ts +5 -0
  802. package/_vendor/plugin-eraser/feature.d.ts +2 -0
  803. package/_vendor/plugin-eraser/index.d.ts +5 -0
  804. package/_vendor/plugin-flow/_vendor/canvas-core/bindings/bindingManager.d.ts +33 -0
  805. package/_vendor/plugin-flow/_vendor/canvas-core/bindings/bindingUtil.d.ts +69 -0
  806. package/_vendor/plugin-flow/_vendor/canvas-core/bindings/bindingUtilRegistry.d.ts +8 -0
  807. package/_vendor/plugin-flow/_vendor/canvas-core/bindings/terminalBinding.d.ts +28 -0
  808. package/_vendor/plugin-flow/_vendor/canvas-core/bindings/terminalPorts.d.ts +67 -0
  809. package/_vendor/plugin-flow/_vendor/canvas-core/editor/clipboard.d.ts +43 -0
  810. package/_vendor/plugin-flow/_vendor/canvas-core/editor/clipboardAssets.d.ts +6 -0
  811. package/_vendor/plugin-flow/_vendor/canvas-core/editor/commands/assetCommands.d.ts +7 -0
  812. package/_vendor/plugin-flow/_vendor/canvas-core/editor/commands/bindingCommands.d.ts +12 -0
  813. package/_vendor/plugin-flow/_vendor/canvas-core/editor/commands/commandTypes.d.ts +149 -0
  814. package/_vendor/plugin-flow/_vendor/canvas-core/editor/commands/commands.d.ts +5 -0
  815. package/_vendor/plugin-flow/_vendor/canvas-core/editor/commands/documentCommands.d.ts +9 -0
  816. package/_vendor/plugin-flow/_vendor/canvas-core/editor/commands/sessionCommands.d.ts +13 -0
  817. package/_vendor/plugin-flow/_vendor/canvas-core/editor/commands/shapeCommands.d.ts +9 -0
  818. package/_vendor/plugin-flow/_vendor/canvas-core/editor/commands/shapeFlags.d.ts +10 -0
  819. package/_vendor/plugin-flow/_vendor/canvas-core/editor/commands/shapeRemoval.d.ts +10 -0
  820. package/_vendor/plugin-flow/_vendor/canvas-core/editor/commands/shapeRepair.d.ts +11 -0
  821. package/_vendor/plugin-flow/_vendor/canvas-core/editor/createEditor.d.ts +6 -0
  822. package/_vendor/plugin-flow/_vendor/canvas-core/editor/editor.d.ts +356 -0
  823. package/_vendor/plugin-flow/_vendor/canvas-core/editor/events/canvasNavigationInteraction.d.ts +2 -0
  824. package/_vendor/plugin-flow/_vendor/canvas-core/editor/events/eventRouter.d.ts +16 -0
  825. package/_vendor/plugin-flow/_vendor/canvas-core/editor/events/events.d.ts +81 -0
  826. package/_vendor/plugin-flow/_vendor/canvas-core/editor/events/inputsManager.d.ts +49 -0
  827. package/_vendor/plugin-flow/_vendor/canvas-core/editor/events/interactions.d.ts +84 -0
  828. package/_vendor/plugin-flow/_vendor/canvas-core/editor/events/keyboardShortcuts.d.ts +23 -0
  829. package/_vendor/plugin-flow/_vendor/canvas-core/editor/events/pointerClickRecognizer.d.ts +11 -0
  830. package/_vendor/plugin-flow/_vendor/canvas-core/editor/history/historyManager.d.ts +40 -0
  831. package/_vendor/plugin-flow/_vendor/canvas-core/editor/history/operationManager.d.ts +77 -0
  832. package/_vendor/plugin-flow/_vendor/canvas-core/editor/internal.d.ts +7 -0
  833. package/_vendor/plugin-flow/_vendor/canvas-core/editor/queries/bindingQueryCache.d.ts +28 -0
  834. package/_vendor/plugin-flow/_vendor/canvas-core/editor/queries/bindingQueryState.d.ts +11 -0
  835. package/_vendor/plugin-flow/_vendor/canvas-core/editor/queries/draftBindingIndex.d.ts +19 -0
  836. package/_vendor/plugin-flow/_vendor/canvas-core/editor/queries/shapeGeometryQueryCache.d.ts +34 -0
  837. package/_vendor/plugin-flow/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +43 -0
  838. package/_vendor/plugin-flow/_vendor/canvas-core/editor/queries/shapeTreeIndex.d.ts +27 -0
  839. package/_vendor/plugin-flow/_vendor/canvas-core/editor/queries/shapeTreeIndexState.d.ts +11 -0
  840. package/_vendor/plugin-flow/_vendor/canvas-core/editor/queries/spatialIndexManager.d.ts +34 -0
  841. package/_vendor/plugin-flow/_vendor/canvas-core/editor/records/documentSnapshots.d.ts +14 -0
  842. package/_vendor/plugin-flow/_vendor/canvas-core/editor/records/editorRecordFactory.d.ts +19 -0
  843. package/_vendor/plugin-flow/_vendor/canvas-core/editor/records/recordQueries.d.ts +3 -0
  844. package/_vendor/plugin-flow/_vendor/canvas-core/editor/selection/resizeGeometry.d.ts +117 -0
  845. package/_vendor/plugin-flow/_vendor/canvas-core/editor/selection/selection.d.ts +223 -0
  846. package/_vendor/plugin-flow/_vendor/canvas-core/editor/selection/selectionBindingSegments.d.ts +7 -0
  847. package/_vendor/plugin-flow/_vendor/canvas-core/editor/selection/selectionGeometry.d.ts +28 -0
  848. package/_vendor/plugin-flow/_vendor/canvas-core/editor/selection/selectionHandleHitTest.d.ts +8 -0
  849. package/_vendor/plugin-flow/_vendor/canvas-core/editor/selection/selectionLayout.d.ts +20 -0
  850. package/_vendor/plugin-flow/_vendor/canvas-core/editor/selection/selectionOverlay.d.ts +25 -0
  851. package/_vendor/plugin-flow/_vendor/canvas-core/editor/selection/selectionOverlayEquality.d.ts +8 -0
  852. package/_vendor/plugin-flow/_vendor/canvas-core/editor/selection/selectionOverlayManager.d.ts +34 -0
  853. package/_vendor/plugin-flow/_vendor/canvas-core/editor/selection/selectionResizeCapabilities.d.ts +11 -0
  854. package/_vendor/plugin-flow/_vendor/canvas-core/editor/selection/selectionSet.d.ts +9 -0
  855. package/_vendor/plugin-flow/_vendor/canvas-core/editor/selection/selectionTargets.d.ts +10 -0
  856. package/_vendor/plugin-flow/_vendor/canvas-core/editor/selection/selectionTransforms.d.ts +6 -0
  857. package/_vendor/plugin-flow/_vendor/canvas-core/editor/shapes/shapeContainment.d.ts +14 -0
  858. package/_vendor/plugin-flow/_vendor/canvas-core/editor/shapes/shapeEditingManager.d.ts +33 -0
  859. package/_vendor/plugin-flow/_vendor/canvas-core/editor/shapes/shapeExportTraversal.d.ts +3 -0
  860. package/_vendor/plugin-flow/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +21 -0
  861. package/_vendor/plugin-flow/_vendor/canvas-core/editor/shapes/shapeGrouping.d.ts +22 -0
  862. package/_vendor/plugin-flow/_vendor/canvas-core/editor/shapes/shapeOrder.d.ts +32 -0
  863. package/_vendor/plugin-flow/_vendor/canvas-core/editor/shapes/shapeReparenting.d.ts +21 -0
  864. package/_vendor/plugin-flow/_vendor/canvas-core/editor/shapes/shapeSignalManager.d.ts +35 -0
  865. package/_vendor/plugin-flow/_vendor/canvas-core/editor/shapes/shapeTransformSpace.d.ts +6 -0
  866. package/_vendor/plugin-flow/_vendor/canvas-core/editor/shapes/shapeTreeQueries.d.ts +12 -0
  867. package/_vendor/plugin-flow/_vendor/canvas-core/editor/snapping/gapSnap.d.ts +6 -0
  868. package/_vendor/plugin-flow/_vendor/canvas-core/editor/snapping/pointSnap.d.ts +5 -0
  869. package/_vendor/plugin-flow/_vendor/canvas-core/editor/snapping/resizeSnap.d.ts +11 -0
  870. package/_vendor/plugin-flow/_vendor/canvas-core/editor/snapping/snapDecision.d.ts +2 -0
  871. package/_vendor/plugin-flow/_vendor/canvas-core/editor/snapping/snapGeometry.d.ts +26 -0
  872. package/_vendor/plugin-flow/_vendor/canvas-core/editor/snapping/snapIndicators.d.ts +22 -0
  873. package/_vendor/plugin-flow/_vendor/canvas-core/editor/snapping/snapManager.d.ts +54 -0
  874. package/_vendor/plugin-flow/_vendor/canvas-core/editor/snapping/snapResults.d.ts +58 -0
  875. package/_vendor/plugin-flow/_vendor/canvas-core/editor/snapping/snapSnapshotBuilder.d.ts +22 -0
  876. package/_vendor/plugin-flow/_vendor/canvas-core/editor/snapping/snapTypes.d.ts +114 -0
  877. package/_vendor/plugin-flow/_vendor/canvas-core/editor/state/editorReadModels.d.ts +34 -0
  878. package/_vendor/plugin-flow/_vendor/canvas-core/editor/state/editorSignals.d.ts +82 -0
  879. package/_vendor/plugin-flow/_vendor/canvas-core/editor/state/editorStateUtils.d.ts +9 -0
  880. package/_vendor/plugin-flow/_vendor/canvas-core/editor/state/interactionTransientManager.d.ts +35 -0
  881. package/_vendor/plugin-flow/_vendor/canvas-core/editor/viewport/camera.d.ts +3 -0
  882. package/_vendor/plugin-flow/_vendor/canvas-core/editor/viewport/cameraManager.d.ts +56 -0
  883. package/_vendor/plugin-flow/_vendor/canvas-core/editor/viewport/cameraPanSession.d.ts +9 -0
  884. package/_vendor/plugin-flow/_vendor/canvas-core/editor/viewport/edgeScroll.d.ts +5 -0
  885. package/_vendor/plugin-flow/_vendor/canvas-core/editor/viewport/renderWindow.d.ts +30 -0
  886. package/_vendor/plugin-flow/_vendor/canvas-core/editor/viewport/renderWindowManager.d.ts +33 -0
  887. package/_vendor/plugin-flow/_vendor/canvas-core/exports/integrity.d.ts +32 -0
  888. package/_vendor/plugin-flow/_vendor/canvas-core/exports/svg.d.ts +52 -0
  889. package/_vendor/plugin-flow/_vendor/canvas-core/geometry/box.d.ts +20 -0
  890. package/_vendor/plugin-flow/_vendor/canvas-core/geometry/contentCutout.d.ts +8 -0
  891. package/_vendor/plugin-flow/_vendor/canvas-core/geometry/ellipse2d.d.ts +16 -0
  892. package/_vendor/plugin-flow/_vendor/canvas-core/geometry/geometry2d.d.ts +15 -0
  893. package/_vendor/plugin-flow/_vendor/canvas-core/geometry/index.d.ts +9 -0
  894. package/_vendor/plugin-flow/_vendor/canvas-core/geometry/mat.d.ts +31 -0
  895. package/_vendor/plugin-flow/_vendor/canvas-core/geometry/polygon.d.ts +7 -0
  896. package/_vendor/plugin-flow/_vendor/canvas-core/geometry/polyline2d.d.ts +14 -0
  897. package/_vendor/plugin-flow/_vendor/canvas-core/geometry/rectangle2d.d.ts +16 -0
  898. package/_vendor/plugin-flow/_vendor/canvas-core/geometry/segments.d.ts +5 -0
  899. package/_vendor/plugin-flow/_vendor/canvas-core/geometry/vec.d.ts +35 -0
  900. package/_vendor/plugin-flow/_vendor/canvas-core/index.d.ts +64 -0
  901. package/_vendor/plugin-flow/_vendor/canvas-core/plugins/editorRuntimePlugin.d.ts +19 -0
  902. package/_vendor/plugin-flow/_vendor/canvas-core/plugins/editorRuntimeRegistry.d.ts +15 -0
  903. package/_vendor/plugin-flow/_vendor/canvas-core/plugins/index.d.ts +2 -0
  904. package/_vendor/plugin-flow/_vendor/canvas-core/reactivity.d.ts +8 -0
  905. package/_vendor/plugin-flow/_vendor/canvas-core/schema/records.d.ts +115 -0
  906. package/_vendor/plugin-flow/_vendor/canvas-core/schema/snapshots.d.ts +22 -0
  907. package/_vendor/plugin-flow/_vendor/canvas-core/shapes/childTransformPolicy.d.ts +16 -0
  908. package/_vendor/plugin-flow/_vendor/canvas-core/shapes/colors.d.ts +26 -0
  909. package/_vendor/plugin-flow/_vendor/canvas-core/shapes/shapeUtil.d.ts +245 -0
  910. package/_vendor/plugin-flow/_vendor/canvas-core/shapes/shapeUtilGeometry.d.ts +6 -0
  911. package/_vendor/plugin-flow/_vendor/canvas-core/shapes/shapeUtilRegistry.d.ts +9 -0
  912. package/_vendor/plugin-flow/_vendor/canvas-core/shapes/types.d.ts +2 -0
  913. package/_vendor/plugin-flow/_vendor/canvas-core/tools/hand/handTool.d.ts +5 -0
  914. package/_vendor/plugin-flow/_vendor/canvas-core/tools/select/selectContainment.d.ts +12 -0
  915. package/_vendor/plugin-flow/_vendor/canvas-core/tools/select/selectTool.d.ts +5 -0
  916. package/_vendor/plugin-flow/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +170 -0
  917. package/_vendor/plugin-flow/_vendor/canvas-core/tools/select/states/brushingState.d.ts +19 -0
  918. package/_vendor/plugin-flow/_vendor/canvas-core/tools/select/states/draggingPluginInteractionState.d.ts +15 -0
  919. package/_vendor/plugin-flow/_vendor/canvas-core/tools/select/states/idleState.d.ts +8 -0
  920. package/_vendor/plugin-flow/_vendor/canvas-core/tools/select/states/index.d.ts +11 -0
  921. package/_vendor/plugin-flow/_vendor/canvas-core/tools/select/states/pointingCanvasState.d.ts +11 -0
  922. package/_vendor/plugin-flow/_vendor/canvas-core/tools/select/states/pointingResizeHandleState.d.ts +10 -0
  923. package/_vendor/plugin-flow/_vendor/canvas-core/tools/select/states/pointingRotateHandleState.d.ts +10 -0
  924. package/_vendor/plugin-flow/_vendor/canvas-core/tools/select/states/pointingSelectionHandleInteractionState.d.ts +11 -0
  925. package/_vendor/plugin-flow/_vendor/canvas-core/tools/select/states/pointingShapeState.d.ts +12 -0
  926. package/_vendor/plugin-flow/_vendor/canvas-core/tools/select/states/resizingState.d.ts +16 -0
  927. package/_vendor/plugin-flow/_vendor/canvas-core/tools/select/states/rotatingState.d.ts +14 -0
  928. package/_vendor/plugin-flow/_vendor/canvas-core/tools/select/states/selectStateNode.d.ts +60 -0
  929. package/_vendor/plugin-flow/_vendor/canvas-core/tools/select/states/translatingState.d.ts +16 -0
  930. package/_vendor/plugin-flow/_vendor/canvas-core/tools/stateNode.d.ts +30 -0
  931. package/_vendor/plugin-flow/_vendor/canvas-core/tools/toolManager.d.ts +24 -0
  932. package/_vendor/plugin-flow/_vendor/canvas-core/utils/equality.d.ts +9 -0
  933. package/_vendor/plugin-flow/_vendor/canvas-extension-contracts/contributions.d.ts +92 -0
  934. package/_vendor/plugin-flow/_vendor/canvas-extension-contracts/index.d.ts +6 -0
  935. package/_vendor/plugin-flow/_vendor/canvas-extension-contracts/operations.d.ts +131 -0
  936. package/_vendor/plugin-flow/_vendor/canvas-extension-contracts/persistence.d.ts +16 -0
  937. package/_vendor/plugin-flow/_vendor/canvas-extension-contracts/plugin.d.ts +37 -0
  938. package/_vendor/plugin-flow/_vendor/canvas-extension-contracts/shape.d.ts +5 -0
  939. package/_vendor/plugin-flow/_vendor/canvas-extension-contracts/tokens.d.ts +12 -0
  940. package/_vendor/plugin-flow/_vendor/canvas-react/components/CanvasView.d.ts +7 -0
  941. package/_vendor/plugin-flow/_vendor/canvas-react/components/DefaultGrid.d.ts +1 -0
  942. package/_vendor/plugin-flow/_vendor/canvas-react/components/OverlayLayer.d.ts +1 -0
  943. package/_vendor/plugin-flow/_vendor/canvas-react/components/PageSpace.d.ts +6 -0
  944. package/_vendor/plugin-flow/_vendor/canvas-react/components/ShapeLayer.d.ts +1 -0
  945. package/_vendor/plugin-flow/_vendor/canvas-react/components/canvasKeyboardEvents.d.ts +13 -0
  946. package/_vendor/plugin-flow/_vendor/canvas-react/components/index.d.ts +3 -0
  947. package/_vendor/plugin-flow/_vendor/canvas-react/components/overlays/BindingGuide.d.ts +24 -0
  948. package/_vendor/plugin-flow/_vendor/canvas-react/components/overlays/BindingPreviewOverlay.d.ts +1 -0
  949. package/_vendor/plugin-flow/_vendor/canvas-react/components/overlays/BrushBoxOverlay.d.ts +1 -0
  950. package/_vendor/plugin-flow/_vendor/canvas-react/components/overlays/OverlaySvgRoot.d.ts +1 -0
  951. package/_vendor/plugin-flow/_vendor/canvas-react/components/overlays/SelectionFrameOverlay.d.ts +1 -0
  952. package/_vendor/plugin-flow/_vendor/canvas-react/components/overlays/SelectionHandlesOverlay.d.ts +1 -0
  953. package/_vendor/plugin-flow/_vendor/canvas-react/components/overlays/SelectionOverlaySvg.d.ts +1 -0
  954. package/_vendor/plugin-flow/_vendor/canvas-react/components/overlays/SelectionPathOverlay.d.ts +8 -0
  955. package/_vendor/plugin-flow/_vendor/canvas-react/components/overlays/ShapeOutlineOverlay.d.ts +8 -0
  956. package/_vendor/plugin-flow/_vendor/canvas-react/components/overlays/SnapIndicatorsOverlay.d.ts +1 -0
  957. package/_vendor/plugin-flow/_vendor/canvas-react/components/overlays/TerminalBindingGuidesOverlay.d.ts +1 -0
  958. package/_vendor/plugin-flow/_vendor/canvas-react/components/shape-layer/ShapeClipStack.d.ts +11 -0
  959. package/_vendor/plugin-flow/_vendor/canvas-react/components/shape-layer/ShapeDecorations.d.ts +2 -0
  960. package/_vendor/plugin-flow/_vendor/canvas-react/components/shape-layer/ShapeForegroundItem.d.ts +5 -0
  961. package/_vendor/plugin-flow/_vendor/canvas-react/components/shape-layer/ShapeItem.d.ts +5 -0
  962. package/_vendor/plugin-flow/_vendor/canvas-react/components/shape-layer/ShapeRenderList.d.ts +1 -0
  963. package/_vendor/plugin-flow/_vendor/canvas-react/components/shape-layer/ShapeRenderer.d.ts +12 -0
  964. package/_vendor/plugin-flow/_vendor/canvas-react/components/shape-layer/shapeFrame.d.ts +11 -0
  965. package/_vendor/plugin-flow/_vendor/canvas-react/components/useCanvasDomEvents.d.ts +23 -0
  966. package/_vendor/plugin-flow/_vendor/canvas-react/contextMenuRequest.d.ts +19 -0
  967. package/_vendor/plugin-flow/_vendor/canvas-react/dom.d.ts +10 -0
  968. package/_vendor/plugin-flow/_vendor/canvas-react/hooks/useEditor.d.ts +3 -0
  969. package/_vendor/plugin-flow/_vendor/canvas-react/hooks/useValue.d.ts +2 -0
  970. package/_vendor/plugin-flow/_vendor/canvas-react/host/canvasRenderBindings.d.ts +21 -0
  971. package/_vendor/plugin-flow/_vendor/canvas-react/host/canvasRenderBindingsContext.d.ts +5 -0
  972. package/_vendor/plugin-flow/_vendor/canvas-react/host/canvasRenderPlugin.d.ts +81 -0
  973. package/_vendor/plugin-flow/_vendor/canvas-react/host/index.d.ts +5 -0
  974. package/_vendor/plugin-flow/_vendor/canvas-react/index.d.ts +5 -0
  975. package/_vendor/plugin-flow/_vendor/plugin-connector/api.d.ts +28 -0
  976. package/_vendor/plugin-flow/_vendor/plugin-connector/canvasRender.d.ts +2 -0
  977. package/_vendor/plugin-flow/_vendor/plugin-connector/connectorBindingUtil.d.ts +28 -0
  978. package/_vendor/plugin-flow/_vendor/plugin-connector/connectorBindings.d.ts +8 -0
  979. package/_vendor/plugin-flow/_vendor/plugin-connector/connectorGeometry.d.ts +70 -0
  980. package/_vendor/plugin-flow/_vendor/plugin-connector/connectorHandles.d.ts +12 -0
  981. package/_vendor/plugin-flow/_vendor/plugin-connector/connectorInteractions.d.ts +3 -0
  982. package/_vendor/plugin-flow/_vendor/plugin-connector/connectorMarker.d.ts +7 -0
  983. package/_vendor/plugin-flow/_vendor/plugin-connector/connectorModel.d.ts +43 -0
  984. package/_vendor/plugin-flow/_vendor/plugin-connector/connectorPortInteraction.d.ts +13 -0
  985. package/_vendor/plugin-flow/_vendor/plugin-connector/connectorPorts.d.ts +23 -0
  986. package/_vendor/plugin-flow/_vendor/plugin-connector/connectorRuntime.d.ts +63 -0
  987. package/_vendor/plugin-flow/_vendor/plugin-connector/connectorShapeUtil.d.ts +29 -0
  988. package/_vendor/plugin-flow/_vendor/plugin-connector/connectorTool.d.ts +4 -0
  989. package/_vendor/plugin-flow/_vendor/plugin-connector/constants.d.ts +17 -0
  990. package/_vendor/plugin-flow/_vendor/plugin-connector/editorRuntime.d.ts +7 -0
  991. package/_vendor/plugin-flow/_vendor/plugin-connector/feature.d.ts +3 -0
  992. package/_vendor/plugin-flow/_vendor/plugin-connector/index.d.ts +20 -0
  993. package/_vendor/plugin-flow/_vendor/plugin-connector/orthogonalRoute.d.ts +9 -0
  994. package/_vendor/plugin-flow/_vendor/plugin-connector/quickConnect.d.ts +29 -0
  995. package/_vendor/plugin-flow/_vendor/plugin-connector/types.d.ts +52 -0
  996. package/_vendor/plugin-flow/_vendor/plugin-geo/api.d.ts +43 -0
  997. package/_vendor/plugin-flow/_vendor/plugin-geo/canvasRender.d.ts +2 -0
  998. package/_vendor/plugin-flow/_vendor/plugin-geo/editorRuntime.d.ts +7 -0
  999. package/_vendor/plugin-flow/_vendor/plugin-geo/feature.d.ts +1 -0
  1000. package/_vendor/plugin-flow/_vendor/plugin-geo/geoCreationRuntime.d.ts +20 -0
  1001. package/_vendor/plugin-flow/_vendor/plugin-geo/geoGeometry.d.ts +64 -0
  1002. package/_vendor/plugin-flow/_vendor/plugin-geo/geoShapeUtil.d.ts +16 -0
  1003. package/_vendor/plugin-flow/_vendor/plugin-geo/geoStrokeStyle.d.ts +2 -0
  1004. package/_vendor/plugin-flow/_vendor/plugin-geo/geoTools.d.ts +51 -0
  1005. package/_vendor/plugin-flow/_vendor/plugin-geo/index.d.ts +9 -0
  1006. package/_vendor/plugin-flow/_vendor/plugin-geo/svgPathGeometry.d.ts +7 -0
  1007. package/_vendor/plugin-flow/_vendor/plugin-geo/types.d.ts +22 -0
  1008. package/_vendor/plugin-flow/_vendor/plugin-image/host/api.d.ts +61 -0
  1009. package/_vendor/plugin-flow/_vendor/plugin-image/host/asset/blobDataUrl.d.ts +1 -0
  1010. package/_vendor/plugin-flow/_vendor/plugin-image/host/asset/imageAssetOperations.d.ts +44 -0
  1011. package/_vendor/plugin-flow/_vendor/plugin-image/host/asset/imageAssetService.d.ts +17 -0
  1012. package/_vendor/plugin-flow/_vendor/plugin-image/host/asset/imageBlobStore.d.ts +31 -0
  1013. package/_vendor/plugin-flow/_vendor/plugin-image/host/asset/imageFileHelpers.d.ts +47 -0
  1014. package/_vendor/plugin-flow/_vendor/plugin-image/host/asset/indexedDb.d.ts +4 -0
  1015. package/_vendor/plugin-flow/_vendor/plugin-image/host/createImageHostApi.d.ts +15 -0
  1016. package/_vendor/plugin-flow/_vendor/plugin-image/host/export/imageSvgResourceInliner.d.ts +3 -0
  1017. package/_vendor/plugin-flow/_vendor/plugin-image/host/index.d.ts +14 -0
  1018. package/_vendor/plugin-flow/_vendor/plugin-image/host/plugin.d.ts +8 -0
  1019. package/_vendor/plugin-flow/_vendor/plugin-image/host/smudge/confirm.d.ts +10 -0
  1020. package/_vendor/plugin-flow/_vendor/plugin-image/image/api.d.ts +40 -0
  1021. package/_vendor/plugin-flow/_vendor/plugin-image/image/cornerRadius.d.ts +6 -0
  1022. package/_vendor/plugin-flow/_vendor/plugin-image/image/crop/interactions.d.ts +3 -0
  1023. package/_vendor/plugin-flow/_vendor/plugin-image/image/crop/model.d.ts +112 -0
  1024. package/_vendor/plugin-flow/_vendor/plugin-image/image/crop/session.d.ts +6 -0
  1025. package/_vendor/plugin-flow/_vendor/plugin-image/image/editor/imageShapeUtil.d.ts +13 -0
  1026. package/_vendor/plugin-flow/_vendor/plugin-image/image/editor/imageSvgExporter.d.ts +6 -0
  1027. package/_vendor/plugin-flow/_vendor/plugin-image/image/editor/plugin.d.ts +3 -0
  1028. package/_vendor/plugin-flow/_vendor/plugin-image/image/index.d.ts +14 -0
  1029. package/_vendor/plugin-flow/_vendor/plugin-image/image/plugin.d.ts +1 -0
  1030. package/_vendor/plugin-flow/_vendor/plugin-image/image/render/plugin.d.ts +2 -0
  1031. package/_vendor/plugin-flow/_vendor/plugin-image/image/smudge/interactions.d.ts +2 -0
  1032. package/_vendor/plugin-flow/_vendor/plugin-image/image/smudge/session.d.ts +61 -0
  1033. package/_vendor/plugin-flow/_vendor/plugin-image/image/types.d.ts +46 -0
  1034. package/_vendor/plugin-flow/_vendor/plugin-image/index.d.ts +2 -0
  1035. package/_vendor/plugin-flow/_vendor/plugin-text/api.d.ts +45 -0
  1036. package/_vendor/plugin-flow/_vendor/plugin-text/canvasRender.d.ts +10 -0
  1037. package/_vendor/plugin-flow/_vendor/plugin-text/editorRichTextLinks.d.ts +7 -0
  1038. package/_vendor/plugin-flow/_vendor/plugin-text/editorRuntime.d.ts +5 -0
  1039. package/_vendor/plugin-flow/_vendor/plugin-text/feature.d.ts +10 -0
  1040. package/_vendor/plugin-flow/_vendor/plugin-text/geoLabelBindingUtil.d.ts +48 -0
  1041. package/_vendor/plugin-flow/_vendor/plugin-text/host/RichTextEditingBox.d.ts +12 -0
  1042. package/_vendor/plugin-flow/_vendor/plugin-text/host/TiptapTextEditor.d.ts +29 -0
  1043. package/_vendor/plugin-flow/_vendor/plugin-text/host/blobDataUrl.d.ts +1 -0
  1044. package/_vendor/plugin-flow/_vendor/plugin-text/host/browserRichTextLink.d.ts +1 -0
  1045. package/_vendor/plugin-flow/_vendor/plugin-text/host/initialTextBackground.d.ts +2 -0
  1046. package/_vendor/plugin-flow/_vendor/plugin-text/host/richTextRendering.d.ts +17 -0
  1047. package/_vendor/plugin-flow/_vendor/plugin-text/host/textDomSelection.d.ts +7 -0
  1048. package/_vendor/plugin-flow/_vendor/plugin-text/host/textEditingBoxStyle.d.ts +4 -0
  1049. package/_vendor/plugin-flow/_vendor/plugin-text/host/textEntryFocus.d.ts +23 -0
  1050. package/_vendor/plugin-flow/_vendor/plugin-text/host/textFontLoader.d.ts +3 -0
  1051. package/_vendor/plugin-flow/_vendor/plugin-text/host/textFormattingApi.d.ts +16 -0
  1052. package/_vendor/plugin-flow/_vendor/plugin-text/host/textMeasurement.d.ts +21 -0
  1053. package/_vendor/plugin-flow/_vendor/plugin-text/host/textMeasurementSync.d.ts +11 -0
  1054. package/_vendor/plugin-flow/_vendor/plugin-text/host/textRangeSelection.d.ts +14 -0
  1055. package/_vendor/plugin-flow/_vendor/plugin-text/host/textShapeRendererRuntime.d.ts +12 -0
  1056. package/_vendor/plugin-flow/_vendor/plugin-text/host/textShapeSync.d.ts +19 -0
  1057. package/_vendor/plugin-flow/_vendor/plugin-text/host/textSvgAssetInliner.d.ts +3 -0
  1058. package/_vendor/plugin-flow/_vendor/plugin-text/host/textSvgExportPlugin.d.ts +5 -0
  1059. package/_vendor/plugin-flow/_vendor/plugin-text/host/tiptapTextEditorController.d.ts +38 -0
  1060. package/_vendor/plugin-flow/_vendor/plugin-text/index.d.ts +21 -0
  1061. package/_vendor/plugin-flow/_vendor/plugin-text/pathLabelBindingUtil.d.ts +55 -0
  1062. package/_vendor/plugin-flow/_vendor/plugin-text/richTextLinks.d.ts +12 -0
  1063. package/_vendor/plugin-flow/_vendor/plugin-text/richTextUtils.d.ts +26 -0
  1064. package/_vendor/plugin-flow/_vendor/plugin-text/shapeWideTextFormatting.d.ts +18 -0
  1065. package/_vendor/plugin-flow/_vendor/plugin-text/textFonts.d.ts +49 -0
  1066. package/_vendor/plugin-flow/_vendor/plugin-text/textFormatting.d.ts +50 -0
  1067. package/_vendor/plugin-flow/_vendor/plugin-text/textFormattingSession.d.ts +6 -0
  1068. package/_vendor/plugin-flow/_vendor/plugin-text/textInteractions.d.ts +4 -0
  1069. package/_vendor/plugin-flow/_vendor/plugin-text/textLabelHelpers.d.ts +72 -0
  1070. package/_vendor/plugin-flow/_vendor/plugin-text/textLinkPopoverPresentation.d.ts +20 -0
  1071. package/_vendor/plugin-flow/_vendor/plugin-text/textSearch.d.ts +19 -0
  1072. package/_vendor/plugin-flow/_vendor/plugin-text/textShapeHelpers.d.ts +21 -0
  1073. package/_vendor/plugin-flow/_vendor/plugin-text/textShapeSvgExporter.d.ts +9 -0
  1074. package/_vendor/plugin-flow/_vendor/plugin-text/textShapeUtil.d.ts +24 -0
  1075. package/_vendor/plugin-flow/_vendor/plugin-text/textStyle.d.ts +18 -0
  1076. package/_vendor/plugin-flow/_vendor/plugin-text/textTool.d.ts +4 -0
  1077. package/_vendor/plugin-flow/_vendor/plugin-text/textTypes.d.ts +29 -0
  1078. package/_vendor/plugin-flow/_vendor/signals/atom.d.ts +11 -0
  1079. package/_vendor/plugin-flow/_vendor/signals/computed.d.ts +13 -0
  1080. package/_vendor/plugin-flow/_vendor/signals/core.d.ts +35 -0
  1081. package/_vendor/plugin-flow/_vendor/signals/effect.d.ts +5 -0
  1082. package/_vendor/plugin-flow/_vendor/signals/index.d.ts +8 -0
  1083. package/_vendor/plugin-flow/_vendor/signals/types.d.ts +22 -0
  1084. package/_vendor/plugin-flow/_vendor/store/diff.d.ts +9 -0
  1085. package/_vendor/plugin-flow/_vendor/store/history.d.ts +22 -0
  1086. package/_vendor/plugin-flow/_vendor/store/index.d.ts +5 -0
  1087. package/_vendor/plugin-flow/_vendor/store/store.d.ts +40 -0
  1088. package/_vendor/plugin-flow/_vendor/store/types.d.ts +27 -0
  1089. package/_vendor/plugin-flow/canvasRender.d.ts +3 -0
  1090. package/_vendor/plugin-flow/feature.d.ts +4 -0
  1091. package/_vendor/plugin-flow/index.d.ts +5 -0
  1092. package/_vendor/plugin-flow/nodeCreation.d.ts +9 -0
  1093. package/_vendor/plugin-flow/types.d.ts +4 -0
  1094. package/_vendor/plugin-frame/_vendor/canvas-core/bindings/bindingManager.d.ts +33 -0
  1095. package/_vendor/plugin-frame/_vendor/canvas-core/bindings/bindingUtil.d.ts +69 -0
  1096. package/_vendor/plugin-frame/_vendor/canvas-core/bindings/bindingUtilRegistry.d.ts +8 -0
  1097. package/_vendor/plugin-frame/_vendor/canvas-core/bindings/terminalBinding.d.ts +28 -0
  1098. package/_vendor/plugin-frame/_vendor/canvas-core/bindings/terminalPorts.d.ts +67 -0
  1099. package/_vendor/plugin-frame/_vendor/canvas-core/editor/clipboard.d.ts +43 -0
  1100. package/_vendor/plugin-frame/_vendor/canvas-core/editor/clipboardAssets.d.ts +6 -0
  1101. package/_vendor/plugin-frame/_vendor/canvas-core/editor/commands/assetCommands.d.ts +7 -0
  1102. package/_vendor/plugin-frame/_vendor/canvas-core/editor/commands/bindingCommands.d.ts +12 -0
  1103. package/_vendor/plugin-frame/_vendor/canvas-core/editor/commands/commandTypes.d.ts +149 -0
  1104. package/_vendor/plugin-frame/_vendor/canvas-core/editor/commands/commands.d.ts +5 -0
  1105. package/_vendor/plugin-frame/_vendor/canvas-core/editor/commands/documentCommands.d.ts +9 -0
  1106. package/_vendor/plugin-frame/_vendor/canvas-core/editor/commands/sessionCommands.d.ts +13 -0
  1107. package/_vendor/plugin-frame/_vendor/canvas-core/editor/commands/shapeCommands.d.ts +9 -0
  1108. package/_vendor/plugin-frame/_vendor/canvas-core/editor/commands/shapeFlags.d.ts +10 -0
  1109. package/_vendor/plugin-frame/_vendor/canvas-core/editor/commands/shapeRemoval.d.ts +10 -0
  1110. package/_vendor/plugin-frame/_vendor/canvas-core/editor/commands/shapeRepair.d.ts +11 -0
  1111. package/_vendor/plugin-frame/_vendor/canvas-core/editor/createEditor.d.ts +6 -0
  1112. package/_vendor/plugin-frame/_vendor/canvas-core/editor/editor.d.ts +356 -0
  1113. package/_vendor/plugin-frame/_vendor/canvas-core/editor/events/canvasNavigationInteraction.d.ts +2 -0
  1114. package/_vendor/plugin-frame/_vendor/canvas-core/editor/events/eventRouter.d.ts +16 -0
  1115. package/_vendor/plugin-frame/_vendor/canvas-core/editor/events/events.d.ts +81 -0
  1116. package/_vendor/plugin-frame/_vendor/canvas-core/editor/events/inputsManager.d.ts +49 -0
  1117. package/_vendor/plugin-frame/_vendor/canvas-core/editor/events/interactions.d.ts +84 -0
  1118. package/_vendor/plugin-frame/_vendor/canvas-core/editor/events/keyboardShortcuts.d.ts +23 -0
  1119. package/_vendor/plugin-frame/_vendor/canvas-core/editor/events/pointerClickRecognizer.d.ts +11 -0
  1120. package/_vendor/plugin-frame/_vendor/canvas-core/editor/history/historyManager.d.ts +40 -0
  1121. package/_vendor/plugin-frame/_vendor/canvas-core/editor/history/operationManager.d.ts +77 -0
  1122. package/_vendor/plugin-frame/_vendor/canvas-core/editor/internal.d.ts +7 -0
  1123. package/_vendor/plugin-frame/_vendor/canvas-core/editor/queries/bindingQueryCache.d.ts +28 -0
  1124. package/_vendor/plugin-frame/_vendor/canvas-core/editor/queries/bindingQueryState.d.ts +11 -0
  1125. package/_vendor/plugin-frame/_vendor/canvas-core/editor/queries/draftBindingIndex.d.ts +19 -0
  1126. package/_vendor/plugin-frame/_vendor/canvas-core/editor/queries/shapeGeometryQueryCache.d.ts +34 -0
  1127. package/_vendor/plugin-frame/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +43 -0
  1128. package/_vendor/plugin-frame/_vendor/canvas-core/editor/queries/shapeTreeIndex.d.ts +27 -0
  1129. package/_vendor/plugin-frame/_vendor/canvas-core/editor/queries/shapeTreeIndexState.d.ts +11 -0
  1130. package/_vendor/plugin-frame/_vendor/canvas-core/editor/queries/spatialIndexManager.d.ts +34 -0
  1131. package/_vendor/plugin-frame/_vendor/canvas-core/editor/records/documentSnapshots.d.ts +14 -0
  1132. package/_vendor/plugin-frame/_vendor/canvas-core/editor/records/editorRecordFactory.d.ts +19 -0
  1133. package/_vendor/plugin-frame/_vendor/canvas-core/editor/records/recordQueries.d.ts +3 -0
  1134. package/_vendor/plugin-frame/_vendor/canvas-core/editor/selection/resizeGeometry.d.ts +117 -0
  1135. package/_vendor/plugin-frame/_vendor/canvas-core/editor/selection/selection.d.ts +223 -0
  1136. package/_vendor/plugin-frame/_vendor/canvas-core/editor/selection/selectionBindingSegments.d.ts +7 -0
  1137. package/_vendor/plugin-frame/_vendor/canvas-core/editor/selection/selectionGeometry.d.ts +28 -0
  1138. package/_vendor/plugin-frame/_vendor/canvas-core/editor/selection/selectionHandleHitTest.d.ts +8 -0
  1139. package/_vendor/plugin-frame/_vendor/canvas-core/editor/selection/selectionLayout.d.ts +20 -0
  1140. package/_vendor/plugin-frame/_vendor/canvas-core/editor/selection/selectionOverlay.d.ts +25 -0
  1141. package/_vendor/plugin-frame/_vendor/canvas-core/editor/selection/selectionOverlayEquality.d.ts +8 -0
  1142. package/_vendor/plugin-frame/_vendor/canvas-core/editor/selection/selectionOverlayManager.d.ts +34 -0
  1143. package/_vendor/plugin-frame/_vendor/canvas-core/editor/selection/selectionResizeCapabilities.d.ts +11 -0
  1144. package/_vendor/plugin-frame/_vendor/canvas-core/editor/selection/selectionSet.d.ts +9 -0
  1145. package/_vendor/plugin-frame/_vendor/canvas-core/editor/selection/selectionTargets.d.ts +10 -0
  1146. package/_vendor/plugin-frame/_vendor/canvas-core/editor/selection/selectionTransforms.d.ts +6 -0
  1147. package/_vendor/plugin-frame/_vendor/canvas-core/editor/shapes/shapeContainment.d.ts +14 -0
  1148. package/_vendor/plugin-frame/_vendor/canvas-core/editor/shapes/shapeEditingManager.d.ts +33 -0
  1149. package/_vendor/plugin-frame/_vendor/canvas-core/editor/shapes/shapeExportTraversal.d.ts +3 -0
  1150. package/_vendor/plugin-frame/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +21 -0
  1151. package/_vendor/plugin-frame/_vendor/canvas-core/editor/shapes/shapeGrouping.d.ts +22 -0
  1152. package/_vendor/plugin-frame/_vendor/canvas-core/editor/shapes/shapeOrder.d.ts +32 -0
  1153. package/_vendor/plugin-frame/_vendor/canvas-core/editor/shapes/shapeReparenting.d.ts +21 -0
  1154. package/_vendor/plugin-frame/_vendor/canvas-core/editor/shapes/shapeSignalManager.d.ts +35 -0
  1155. package/_vendor/plugin-frame/_vendor/canvas-core/editor/shapes/shapeTransformSpace.d.ts +6 -0
  1156. package/_vendor/plugin-frame/_vendor/canvas-core/editor/shapes/shapeTreeQueries.d.ts +12 -0
  1157. package/_vendor/plugin-frame/_vendor/canvas-core/editor/snapping/gapSnap.d.ts +6 -0
  1158. package/_vendor/plugin-frame/_vendor/canvas-core/editor/snapping/pointSnap.d.ts +5 -0
  1159. package/_vendor/plugin-frame/_vendor/canvas-core/editor/snapping/resizeSnap.d.ts +11 -0
  1160. package/_vendor/plugin-frame/_vendor/canvas-core/editor/snapping/snapDecision.d.ts +2 -0
  1161. package/_vendor/plugin-frame/_vendor/canvas-core/editor/snapping/snapGeometry.d.ts +26 -0
  1162. package/_vendor/plugin-frame/_vendor/canvas-core/editor/snapping/snapIndicators.d.ts +22 -0
  1163. package/_vendor/plugin-frame/_vendor/canvas-core/editor/snapping/snapManager.d.ts +54 -0
  1164. package/_vendor/plugin-frame/_vendor/canvas-core/editor/snapping/snapResults.d.ts +58 -0
  1165. package/_vendor/plugin-frame/_vendor/canvas-core/editor/snapping/snapSnapshotBuilder.d.ts +22 -0
  1166. package/_vendor/plugin-frame/_vendor/canvas-core/editor/snapping/snapTypes.d.ts +114 -0
  1167. package/_vendor/plugin-frame/_vendor/canvas-core/editor/state/editorReadModels.d.ts +34 -0
  1168. package/_vendor/plugin-frame/_vendor/canvas-core/editor/state/editorSignals.d.ts +82 -0
  1169. package/_vendor/plugin-frame/_vendor/canvas-core/editor/state/editorStateUtils.d.ts +9 -0
  1170. package/_vendor/plugin-frame/_vendor/canvas-core/editor/state/interactionTransientManager.d.ts +35 -0
  1171. package/_vendor/plugin-frame/_vendor/canvas-core/editor/viewport/camera.d.ts +3 -0
  1172. package/_vendor/plugin-frame/_vendor/canvas-core/editor/viewport/cameraManager.d.ts +56 -0
  1173. package/_vendor/plugin-frame/_vendor/canvas-core/editor/viewport/cameraPanSession.d.ts +9 -0
  1174. package/_vendor/plugin-frame/_vendor/canvas-core/editor/viewport/edgeScroll.d.ts +5 -0
  1175. package/_vendor/plugin-frame/_vendor/canvas-core/editor/viewport/renderWindow.d.ts +30 -0
  1176. package/_vendor/plugin-frame/_vendor/canvas-core/editor/viewport/renderWindowManager.d.ts +33 -0
  1177. package/_vendor/plugin-frame/_vendor/canvas-core/exports/integrity.d.ts +32 -0
  1178. package/_vendor/plugin-frame/_vendor/canvas-core/exports/svg.d.ts +52 -0
  1179. package/_vendor/plugin-frame/_vendor/canvas-core/geometry/box.d.ts +20 -0
  1180. package/_vendor/plugin-frame/_vendor/canvas-core/geometry/contentCutout.d.ts +8 -0
  1181. package/_vendor/plugin-frame/_vendor/canvas-core/geometry/ellipse2d.d.ts +16 -0
  1182. package/_vendor/plugin-frame/_vendor/canvas-core/geometry/geometry2d.d.ts +15 -0
  1183. package/_vendor/plugin-frame/_vendor/canvas-core/geometry/index.d.ts +9 -0
  1184. package/_vendor/plugin-frame/_vendor/canvas-core/geometry/mat.d.ts +31 -0
  1185. package/_vendor/plugin-frame/_vendor/canvas-core/geometry/polygon.d.ts +7 -0
  1186. package/_vendor/plugin-frame/_vendor/canvas-core/geometry/polyline2d.d.ts +14 -0
  1187. package/_vendor/plugin-frame/_vendor/canvas-core/geometry/rectangle2d.d.ts +16 -0
  1188. package/_vendor/plugin-frame/_vendor/canvas-core/geometry/segments.d.ts +5 -0
  1189. package/_vendor/plugin-frame/_vendor/canvas-core/geometry/vec.d.ts +35 -0
  1190. package/_vendor/plugin-frame/_vendor/canvas-core/index.d.ts +64 -0
  1191. package/_vendor/plugin-frame/_vendor/canvas-core/plugins/editorRuntimePlugin.d.ts +19 -0
  1192. package/_vendor/plugin-frame/_vendor/canvas-core/plugins/editorRuntimeRegistry.d.ts +15 -0
  1193. package/_vendor/plugin-frame/_vendor/canvas-core/plugins/index.d.ts +2 -0
  1194. package/_vendor/plugin-frame/_vendor/canvas-core/reactivity.d.ts +8 -0
  1195. package/_vendor/plugin-frame/_vendor/canvas-core/schema/records.d.ts +115 -0
  1196. package/_vendor/plugin-frame/_vendor/canvas-core/schema/snapshots.d.ts +22 -0
  1197. package/_vendor/plugin-frame/_vendor/canvas-core/shapes/childTransformPolicy.d.ts +16 -0
  1198. package/_vendor/plugin-frame/_vendor/canvas-core/shapes/colors.d.ts +26 -0
  1199. package/_vendor/plugin-frame/_vendor/canvas-core/shapes/shapeUtil.d.ts +245 -0
  1200. package/_vendor/plugin-frame/_vendor/canvas-core/shapes/shapeUtilGeometry.d.ts +6 -0
  1201. package/_vendor/plugin-frame/_vendor/canvas-core/shapes/shapeUtilRegistry.d.ts +9 -0
  1202. package/_vendor/plugin-frame/_vendor/canvas-core/shapes/types.d.ts +2 -0
  1203. package/_vendor/plugin-frame/_vendor/canvas-core/tools/hand/handTool.d.ts +5 -0
  1204. package/_vendor/plugin-frame/_vendor/canvas-core/tools/select/selectContainment.d.ts +12 -0
  1205. package/_vendor/plugin-frame/_vendor/canvas-core/tools/select/selectTool.d.ts +5 -0
  1206. package/_vendor/plugin-frame/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +170 -0
  1207. package/_vendor/plugin-frame/_vendor/canvas-core/tools/select/states/brushingState.d.ts +19 -0
  1208. package/_vendor/plugin-frame/_vendor/canvas-core/tools/select/states/draggingPluginInteractionState.d.ts +15 -0
  1209. package/_vendor/plugin-frame/_vendor/canvas-core/tools/select/states/idleState.d.ts +8 -0
  1210. package/_vendor/plugin-frame/_vendor/canvas-core/tools/select/states/index.d.ts +11 -0
  1211. package/_vendor/plugin-frame/_vendor/canvas-core/tools/select/states/pointingCanvasState.d.ts +11 -0
  1212. package/_vendor/plugin-frame/_vendor/canvas-core/tools/select/states/pointingResizeHandleState.d.ts +10 -0
  1213. package/_vendor/plugin-frame/_vendor/canvas-core/tools/select/states/pointingRotateHandleState.d.ts +10 -0
  1214. package/_vendor/plugin-frame/_vendor/canvas-core/tools/select/states/pointingSelectionHandleInteractionState.d.ts +11 -0
  1215. package/_vendor/plugin-frame/_vendor/canvas-core/tools/select/states/pointingShapeState.d.ts +12 -0
  1216. package/_vendor/plugin-frame/_vendor/canvas-core/tools/select/states/resizingState.d.ts +16 -0
  1217. package/_vendor/plugin-frame/_vendor/canvas-core/tools/select/states/rotatingState.d.ts +14 -0
  1218. package/_vendor/plugin-frame/_vendor/canvas-core/tools/select/states/selectStateNode.d.ts +60 -0
  1219. package/_vendor/plugin-frame/_vendor/canvas-core/tools/select/states/translatingState.d.ts +16 -0
  1220. package/_vendor/plugin-frame/_vendor/canvas-core/tools/stateNode.d.ts +30 -0
  1221. package/_vendor/plugin-frame/_vendor/canvas-core/tools/toolManager.d.ts +24 -0
  1222. package/_vendor/plugin-frame/_vendor/canvas-core/utils/equality.d.ts +9 -0
  1223. package/_vendor/plugin-frame/_vendor/canvas-extension-contracts/contributions.d.ts +92 -0
  1224. package/_vendor/plugin-frame/_vendor/canvas-extension-contracts/index.d.ts +6 -0
  1225. package/_vendor/plugin-frame/_vendor/canvas-extension-contracts/operations.d.ts +131 -0
  1226. package/_vendor/plugin-frame/_vendor/canvas-extension-contracts/persistence.d.ts +16 -0
  1227. package/_vendor/plugin-frame/_vendor/canvas-extension-contracts/plugin.d.ts +37 -0
  1228. package/_vendor/plugin-frame/_vendor/canvas-extension-contracts/shape.d.ts +5 -0
  1229. package/_vendor/plugin-frame/_vendor/canvas-extension-contracts/tokens.d.ts +12 -0
  1230. package/_vendor/plugin-frame/_vendor/canvas-react/components/CanvasView.d.ts +7 -0
  1231. package/_vendor/plugin-frame/_vendor/canvas-react/components/DefaultGrid.d.ts +1 -0
  1232. package/_vendor/plugin-frame/_vendor/canvas-react/components/OverlayLayer.d.ts +1 -0
  1233. package/_vendor/plugin-frame/_vendor/canvas-react/components/PageSpace.d.ts +6 -0
  1234. package/_vendor/plugin-frame/_vendor/canvas-react/components/ShapeLayer.d.ts +1 -0
  1235. package/_vendor/plugin-frame/_vendor/canvas-react/components/canvasKeyboardEvents.d.ts +13 -0
  1236. package/_vendor/plugin-frame/_vendor/canvas-react/components/index.d.ts +3 -0
  1237. package/_vendor/plugin-frame/_vendor/canvas-react/components/overlays/BindingGuide.d.ts +24 -0
  1238. package/_vendor/plugin-frame/_vendor/canvas-react/components/overlays/BindingPreviewOverlay.d.ts +1 -0
  1239. package/_vendor/plugin-frame/_vendor/canvas-react/components/overlays/BrushBoxOverlay.d.ts +1 -0
  1240. package/_vendor/plugin-frame/_vendor/canvas-react/components/overlays/OverlaySvgRoot.d.ts +1 -0
  1241. package/_vendor/plugin-frame/_vendor/canvas-react/components/overlays/SelectionFrameOverlay.d.ts +1 -0
  1242. package/_vendor/plugin-frame/_vendor/canvas-react/components/overlays/SelectionHandlesOverlay.d.ts +1 -0
  1243. package/_vendor/plugin-frame/_vendor/canvas-react/components/overlays/SelectionOverlaySvg.d.ts +1 -0
  1244. package/_vendor/plugin-frame/_vendor/canvas-react/components/overlays/SelectionPathOverlay.d.ts +8 -0
  1245. package/_vendor/plugin-frame/_vendor/canvas-react/components/overlays/ShapeOutlineOverlay.d.ts +8 -0
  1246. package/_vendor/plugin-frame/_vendor/canvas-react/components/overlays/SnapIndicatorsOverlay.d.ts +1 -0
  1247. package/_vendor/plugin-frame/_vendor/canvas-react/components/overlays/TerminalBindingGuidesOverlay.d.ts +1 -0
  1248. package/_vendor/plugin-frame/_vendor/canvas-react/components/shape-layer/ShapeClipStack.d.ts +11 -0
  1249. package/_vendor/plugin-frame/_vendor/canvas-react/components/shape-layer/ShapeDecorations.d.ts +2 -0
  1250. package/_vendor/plugin-frame/_vendor/canvas-react/components/shape-layer/ShapeForegroundItem.d.ts +5 -0
  1251. package/_vendor/plugin-frame/_vendor/canvas-react/components/shape-layer/ShapeItem.d.ts +5 -0
  1252. package/_vendor/plugin-frame/_vendor/canvas-react/components/shape-layer/ShapeRenderList.d.ts +1 -0
  1253. package/_vendor/plugin-frame/_vendor/canvas-react/components/shape-layer/ShapeRenderer.d.ts +12 -0
  1254. package/_vendor/plugin-frame/_vendor/canvas-react/components/shape-layer/shapeFrame.d.ts +11 -0
  1255. package/_vendor/plugin-frame/_vendor/canvas-react/components/useCanvasDomEvents.d.ts +23 -0
  1256. package/_vendor/plugin-frame/_vendor/canvas-react/contextMenuRequest.d.ts +19 -0
  1257. package/_vendor/plugin-frame/_vendor/canvas-react/dom.d.ts +10 -0
  1258. package/_vendor/plugin-frame/_vendor/canvas-react/hooks/useEditor.d.ts +3 -0
  1259. package/_vendor/plugin-frame/_vendor/canvas-react/hooks/useValue.d.ts +2 -0
  1260. package/_vendor/plugin-frame/_vendor/canvas-react/host/canvasRenderBindings.d.ts +21 -0
  1261. package/_vendor/plugin-frame/_vendor/canvas-react/host/canvasRenderBindingsContext.d.ts +5 -0
  1262. package/_vendor/plugin-frame/_vendor/canvas-react/host/canvasRenderPlugin.d.ts +81 -0
  1263. package/_vendor/plugin-frame/_vendor/canvas-react/host/index.d.ts +5 -0
  1264. package/_vendor/plugin-frame/_vendor/canvas-react/index.d.ts +5 -0
  1265. package/_vendor/plugin-frame/_vendor/signals/atom.d.ts +11 -0
  1266. package/_vendor/plugin-frame/_vendor/signals/computed.d.ts +13 -0
  1267. package/_vendor/plugin-frame/_vendor/signals/core.d.ts +35 -0
  1268. package/_vendor/plugin-frame/_vendor/signals/effect.d.ts +5 -0
  1269. package/_vendor/plugin-frame/_vendor/signals/index.d.ts +8 -0
  1270. package/_vendor/plugin-frame/_vendor/signals/types.d.ts +22 -0
  1271. package/_vendor/plugin-frame/_vendor/store/diff.d.ts +9 -0
  1272. package/_vendor/plugin-frame/_vendor/store/history.d.ts +22 -0
  1273. package/_vendor/plugin-frame/_vendor/store/index.d.ts +5 -0
  1274. package/_vendor/plugin-frame/_vendor/store/store.d.ts +40 -0
  1275. package/_vendor/plugin-frame/_vendor/store/types.d.ts +27 -0
  1276. package/_vendor/plugin-frame/api.d.ts +46 -0
  1277. package/_vendor/plugin-frame/canvasRender.d.ts +9 -0
  1278. package/_vendor/plugin-frame/editorRuntime.d.ts +7 -0
  1279. package/_vendor/plugin-frame/feature.d.ts +3 -0
  1280. package/_vendor/plugin-frame/frameShapeUtil.d.ts +35 -0
  1281. package/_vendor/plugin-frame/frameTool.d.ts +6 -0
  1282. package/_vendor/plugin-frame/index.d.ts +8 -0
  1283. package/_vendor/plugin-geo/_vendor/canvas-core/bindings/bindingManager.d.ts +33 -0
  1284. package/_vendor/plugin-geo/_vendor/canvas-core/bindings/bindingUtil.d.ts +69 -0
  1285. package/_vendor/plugin-geo/_vendor/canvas-core/bindings/bindingUtilRegistry.d.ts +8 -0
  1286. package/_vendor/plugin-geo/_vendor/canvas-core/bindings/terminalBinding.d.ts +28 -0
  1287. package/_vendor/plugin-geo/_vendor/canvas-core/bindings/terminalPorts.d.ts +67 -0
  1288. package/_vendor/plugin-geo/_vendor/canvas-core/editor/clipboard.d.ts +43 -0
  1289. package/_vendor/plugin-geo/_vendor/canvas-core/editor/clipboardAssets.d.ts +6 -0
  1290. package/_vendor/plugin-geo/_vendor/canvas-core/editor/commands/assetCommands.d.ts +7 -0
  1291. package/_vendor/plugin-geo/_vendor/canvas-core/editor/commands/bindingCommands.d.ts +12 -0
  1292. package/_vendor/plugin-geo/_vendor/canvas-core/editor/commands/commandTypes.d.ts +149 -0
  1293. package/_vendor/plugin-geo/_vendor/canvas-core/editor/commands/commands.d.ts +5 -0
  1294. package/_vendor/plugin-geo/_vendor/canvas-core/editor/commands/documentCommands.d.ts +9 -0
  1295. package/_vendor/plugin-geo/_vendor/canvas-core/editor/commands/sessionCommands.d.ts +13 -0
  1296. package/_vendor/plugin-geo/_vendor/canvas-core/editor/commands/shapeCommands.d.ts +9 -0
  1297. package/_vendor/plugin-geo/_vendor/canvas-core/editor/commands/shapeFlags.d.ts +10 -0
  1298. package/_vendor/plugin-geo/_vendor/canvas-core/editor/commands/shapeRemoval.d.ts +10 -0
  1299. package/_vendor/plugin-geo/_vendor/canvas-core/editor/commands/shapeRepair.d.ts +11 -0
  1300. package/_vendor/plugin-geo/_vendor/canvas-core/editor/createEditor.d.ts +6 -0
  1301. package/_vendor/plugin-geo/_vendor/canvas-core/editor/editor.d.ts +356 -0
  1302. package/_vendor/plugin-geo/_vendor/canvas-core/editor/events/canvasNavigationInteraction.d.ts +2 -0
  1303. package/_vendor/plugin-geo/_vendor/canvas-core/editor/events/eventRouter.d.ts +16 -0
  1304. package/_vendor/plugin-geo/_vendor/canvas-core/editor/events/events.d.ts +81 -0
  1305. package/_vendor/plugin-geo/_vendor/canvas-core/editor/events/inputsManager.d.ts +49 -0
  1306. package/_vendor/plugin-geo/_vendor/canvas-core/editor/events/interactions.d.ts +84 -0
  1307. package/_vendor/plugin-geo/_vendor/canvas-core/editor/events/keyboardShortcuts.d.ts +23 -0
  1308. package/_vendor/plugin-geo/_vendor/canvas-core/editor/events/pointerClickRecognizer.d.ts +11 -0
  1309. package/_vendor/plugin-geo/_vendor/canvas-core/editor/history/historyManager.d.ts +40 -0
  1310. package/_vendor/plugin-geo/_vendor/canvas-core/editor/history/operationManager.d.ts +77 -0
  1311. package/_vendor/plugin-geo/_vendor/canvas-core/editor/internal.d.ts +7 -0
  1312. package/_vendor/plugin-geo/_vendor/canvas-core/editor/queries/bindingQueryCache.d.ts +28 -0
  1313. package/_vendor/plugin-geo/_vendor/canvas-core/editor/queries/bindingQueryState.d.ts +11 -0
  1314. package/_vendor/plugin-geo/_vendor/canvas-core/editor/queries/draftBindingIndex.d.ts +19 -0
  1315. package/_vendor/plugin-geo/_vendor/canvas-core/editor/queries/shapeGeometryQueryCache.d.ts +34 -0
  1316. package/_vendor/plugin-geo/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +43 -0
  1317. package/_vendor/plugin-geo/_vendor/canvas-core/editor/queries/shapeTreeIndex.d.ts +27 -0
  1318. package/_vendor/plugin-geo/_vendor/canvas-core/editor/queries/shapeTreeIndexState.d.ts +11 -0
  1319. package/_vendor/plugin-geo/_vendor/canvas-core/editor/queries/spatialIndexManager.d.ts +34 -0
  1320. package/_vendor/plugin-geo/_vendor/canvas-core/editor/records/documentSnapshots.d.ts +14 -0
  1321. package/_vendor/plugin-geo/_vendor/canvas-core/editor/records/editorRecordFactory.d.ts +19 -0
  1322. package/_vendor/plugin-geo/_vendor/canvas-core/editor/records/recordQueries.d.ts +3 -0
  1323. package/_vendor/plugin-geo/_vendor/canvas-core/editor/selection/resizeGeometry.d.ts +117 -0
  1324. package/_vendor/plugin-geo/_vendor/canvas-core/editor/selection/selection.d.ts +223 -0
  1325. package/_vendor/plugin-geo/_vendor/canvas-core/editor/selection/selectionBindingSegments.d.ts +7 -0
  1326. package/_vendor/plugin-geo/_vendor/canvas-core/editor/selection/selectionGeometry.d.ts +28 -0
  1327. package/_vendor/plugin-geo/_vendor/canvas-core/editor/selection/selectionHandleHitTest.d.ts +8 -0
  1328. package/_vendor/plugin-geo/_vendor/canvas-core/editor/selection/selectionLayout.d.ts +20 -0
  1329. package/_vendor/plugin-geo/_vendor/canvas-core/editor/selection/selectionOverlay.d.ts +25 -0
  1330. package/_vendor/plugin-geo/_vendor/canvas-core/editor/selection/selectionOverlayEquality.d.ts +8 -0
  1331. package/_vendor/plugin-geo/_vendor/canvas-core/editor/selection/selectionOverlayManager.d.ts +34 -0
  1332. package/_vendor/plugin-geo/_vendor/canvas-core/editor/selection/selectionResizeCapabilities.d.ts +11 -0
  1333. package/_vendor/plugin-geo/_vendor/canvas-core/editor/selection/selectionSet.d.ts +9 -0
  1334. package/_vendor/plugin-geo/_vendor/canvas-core/editor/selection/selectionTargets.d.ts +10 -0
  1335. package/_vendor/plugin-geo/_vendor/canvas-core/editor/selection/selectionTransforms.d.ts +6 -0
  1336. package/_vendor/plugin-geo/_vendor/canvas-core/editor/shapes/shapeContainment.d.ts +14 -0
  1337. package/_vendor/plugin-geo/_vendor/canvas-core/editor/shapes/shapeEditingManager.d.ts +33 -0
  1338. package/_vendor/plugin-geo/_vendor/canvas-core/editor/shapes/shapeExportTraversal.d.ts +3 -0
  1339. package/_vendor/plugin-geo/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +21 -0
  1340. package/_vendor/plugin-geo/_vendor/canvas-core/editor/shapes/shapeGrouping.d.ts +22 -0
  1341. package/_vendor/plugin-geo/_vendor/canvas-core/editor/shapes/shapeOrder.d.ts +32 -0
  1342. package/_vendor/plugin-geo/_vendor/canvas-core/editor/shapes/shapeReparenting.d.ts +21 -0
  1343. package/_vendor/plugin-geo/_vendor/canvas-core/editor/shapes/shapeSignalManager.d.ts +35 -0
  1344. package/_vendor/plugin-geo/_vendor/canvas-core/editor/shapes/shapeTransformSpace.d.ts +6 -0
  1345. package/_vendor/plugin-geo/_vendor/canvas-core/editor/shapes/shapeTreeQueries.d.ts +12 -0
  1346. package/_vendor/plugin-geo/_vendor/canvas-core/editor/snapping/gapSnap.d.ts +6 -0
  1347. package/_vendor/plugin-geo/_vendor/canvas-core/editor/snapping/pointSnap.d.ts +5 -0
  1348. package/_vendor/plugin-geo/_vendor/canvas-core/editor/snapping/resizeSnap.d.ts +11 -0
  1349. package/_vendor/plugin-geo/_vendor/canvas-core/editor/snapping/snapDecision.d.ts +2 -0
  1350. package/_vendor/plugin-geo/_vendor/canvas-core/editor/snapping/snapGeometry.d.ts +26 -0
  1351. package/_vendor/plugin-geo/_vendor/canvas-core/editor/snapping/snapIndicators.d.ts +22 -0
  1352. package/_vendor/plugin-geo/_vendor/canvas-core/editor/snapping/snapManager.d.ts +54 -0
  1353. package/_vendor/plugin-geo/_vendor/canvas-core/editor/snapping/snapResults.d.ts +58 -0
  1354. package/_vendor/plugin-geo/_vendor/canvas-core/editor/snapping/snapSnapshotBuilder.d.ts +22 -0
  1355. package/_vendor/plugin-geo/_vendor/canvas-core/editor/snapping/snapTypes.d.ts +114 -0
  1356. package/_vendor/plugin-geo/_vendor/canvas-core/editor/state/editorReadModels.d.ts +34 -0
  1357. package/_vendor/plugin-geo/_vendor/canvas-core/editor/state/editorSignals.d.ts +82 -0
  1358. package/_vendor/plugin-geo/_vendor/canvas-core/editor/state/editorStateUtils.d.ts +9 -0
  1359. package/_vendor/plugin-geo/_vendor/canvas-core/editor/state/interactionTransientManager.d.ts +35 -0
  1360. package/_vendor/plugin-geo/_vendor/canvas-core/editor/viewport/camera.d.ts +3 -0
  1361. package/_vendor/plugin-geo/_vendor/canvas-core/editor/viewport/cameraManager.d.ts +56 -0
  1362. package/_vendor/plugin-geo/_vendor/canvas-core/editor/viewport/cameraPanSession.d.ts +9 -0
  1363. package/_vendor/plugin-geo/_vendor/canvas-core/editor/viewport/edgeScroll.d.ts +5 -0
  1364. package/_vendor/plugin-geo/_vendor/canvas-core/editor/viewport/renderWindow.d.ts +30 -0
  1365. package/_vendor/plugin-geo/_vendor/canvas-core/editor/viewport/renderWindowManager.d.ts +33 -0
  1366. package/_vendor/plugin-geo/_vendor/canvas-core/exports/integrity.d.ts +32 -0
  1367. package/_vendor/plugin-geo/_vendor/canvas-core/exports/svg.d.ts +52 -0
  1368. package/_vendor/plugin-geo/_vendor/canvas-core/geometry/box.d.ts +20 -0
  1369. package/_vendor/plugin-geo/_vendor/canvas-core/geometry/contentCutout.d.ts +8 -0
  1370. package/_vendor/plugin-geo/_vendor/canvas-core/geometry/ellipse2d.d.ts +16 -0
  1371. package/_vendor/plugin-geo/_vendor/canvas-core/geometry/geometry2d.d.ts +15 -0
  1372. package/_vendor/plugin-geo/_vendor/canvas-core/geometry/index.d.ts +9 -0
  1373. package/_vendor/plugin-geo/_vendor/canvas-core/geometry/mat.d.ts +31 -0
  1374. package/_vendor/plugin-geo/_vendor/canvas-core/geometry/polygon.d.ts +7 -0
  1375. package/_vendor/plugin-geo/_vendor/canvas-core/geometry/polyline2d.d.ts +14 -0
  1376. package/_vendor/plugin-geo/_vendor/canvas-core/geometry/rectangle2d.d.ts +16 -0
  1377. package/_vendor/plugin-geo/_vendor/canvas-core/geometry/segments.d.ts +5 -0
  1378. package/_vendor/plugin-geo/_vendor/canvas-core/geometry/vec.d.ts +35 -0
  1379. package/_vendor/plugin-geo/_vendor/canvas-core/index.d.ts +64 -0
  1380. package/_vendor/plugin-geo/_vendor/canvas-core/plugins/editorRuntimePlugin.d.ts +19 -0
  1381. package/_vendor/plugin-geo/_vendor/canvas-core/plugins/editorRuntimeRegistry.d.ts +15 -0
  1382. package/_vendor/plugin-geo/_vendor/canvas-core/plugins/index.d.ts +2 -0
  1383. package/_vendor/plugin-geo/_vendor/canvas-core/reactivity.d.ts +8 -0
  1384. package/_vendor/plugin-geo/_vendor/canvas-core/schema/records.d.ts +115 -0
  1385. package/_vendor/plugin-geo/_vendor/canvas-core/schema/snapshots.d.ts +22 -0
  1386. package/_vendor/plugin-geo/_vendor/canvas-core/shapes/childTransformPolicy.d.ts +16 -0
  1387. package/_vendor/plugin-geo/_vendor/canvas-core/shapes/colors.d.ts +26 -0
  1388. package/_vendor/plugin-geo/_vendor/canvas-core/shapes/shapeUtil.d.ts +245 -0
  1389. package/_vendor/plugin-geo/_vendor/canvas-core/shapes/shapeUtilGeometry.d.ts +6 -0
  1390. package/_vendor/plugin-geo/_vendor/canvas-core/shapes/shapeUtilRegistry.d.ts +9 -0
  1391. package/_vendor/plugin-geo/_vendor/canvas-core/shapes/types.d.ts +2 -0
  1392. package/_vendor/plugin-geo/_vendor/canvas-core/tools/hand/handTool.d.ts +5 -0
  1393. package/_vendor/plugin-geo/_vendor/canvas-core/tools/select/selectContainment.d.ts +12 -0
  1394. package/_vendor/plugin-geo/_vendor/canvas-core/tools/select/selectTool.d.ts +5 -0
  1395. package/_vendor/plugin-geo/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +170 -0
  1396. package/_vendor/plugin-geo/_vendor/canvas-core/tools/select/states/brushingState.d.ts +19 -0
  1397. package/_vendor/plugin-geo/_vendor/canvas-core/tools/select/states/draggingPluginInteractionState.d.ts +15 -0
  1398. package/_vendor/plugin-geo/_vendor/canvas-core/tools/select/states/idleState.d.ts +8 -0
  1399. package/_vendor/plugin-geo/_vendor/canvas-core/tools/select/states/index.d.ts +11 -0
  1400. package/_vendor/plugin-geo/_vendor/canvas-core/tools/select/states/pointingCanvasState.d.ts +11 -0
  1401. package/_vendor/plugin-geo/_vendor/canvas-core/tools/select/states/pointingResizeHandleState.d.ts +10 -0
  1402. package/_vendor/plugin-geo/_vendor/canvas-core/tools/select/states/pointingRotateHandleState.d.ts +10 -0
  1403. package/_vendor/plugin-geo/_vendor/canvas-core/tools/select/states/pointingSelectionHandleInteractionState.d.ts +11 -0
  1404. package/_vendor/plugin-geo/_vendor/canvas-core/tools/select/states/pointingShapeState.d.ts +12 -0
  1405. package/_vendor/plugin-geo/_vendor/canvas-core/tools/select/states/resizingState.d.ts +16 -0
  1406. package/_vendor/plugin-geo/_vendor/canvas-core/tools/select/states/rotatingState.d.ts +14 -0
  1407. package/_vendor/plugin-geo/_vendor/canvas-core/tools/select/states/selectStateNode.d.ts +60 -0
  1408. package/_vendor/plugin-geo/_vendor/canvas-core/tools/select/states/translatingState.d.ts +16 -0
  1409. package/_vendor/plugin-geo/_vendor/canvas-core/tools/stateNode.d.ts +30 -0
  1410. package/_vendor/plugin-geo/_vendor/canvas-core/tools/toolManager.d.ts +24 -0
  1411. package/_vendor/plugin-geo/_vendor/canvas-core/utils/equality.d.ts +9 -0
  1412. package/_vendor/plugin-geo/_vendor/canvas-extension-contracts/contributions.d.ts +92 -0
  1413. package/_vendor/plugin-geo/_vendor/canvas-extension-contracts/index.d.ts +6 -0
  1414. package/_vendor/plugin-geo/_vendor/canvas-extension-contracts/operations.d.ts +131 -0
  1415. package/_vendor/plugin-geo/_vendor/canvas-extension-contracts/persistence.d.ts +16 -0
  1416. package/_vendor/plugin-geo/_vendor/canvas-extension-contracts/plugin.d.ts +37 -0
  1417. package/_vendor/plugin-geo/_vendor/canvas-extension-contracts/shape.d.ts +5 -0
  1418. package/_vendor/plugin-geo/_vendor/canvas-extension-contracts/tokens.d.ts +12 -0
  1419. package/_vendor/plugin-geo/_vendor/canvas-react/components/CanvasView.d.ts +7 -0
  1420. package/_vendor/plugin-geo/_vendor/canvas-react/components/DefaultGrid.d.ts +1 -0
  1421. package/_vendor/plugin-geo/_vendor/canvas-react/components/OverlayLayer.d.ts +1 -0
  1422. package/_vendor/plugin-geo/_vendor/canvas-react/components/PageSpace.d.ts +6 -0
  1423. package/_vendor/plugin-geo/_vendor/canvas-react/components/ShapeLayer.d.ts +1 -0
  1424. package/_vendor/plugin-geo/_vendor/canvas-react/components/canvasKeyboardEvents.d.ts +13 -0
  1425. package/_vendor/plugin-geo/_vendor/canvas-react/components/index.d.ts +3 -0
  1426. package/_vendor/plugin-geo/_vendor/canvas-react/components/overlays/BindingGuide.d.ts +24 -0
  1427. package/_vendor/plugin-geo/_vendor/canvas-react/components/overlays/BindingPreviewOverlay.d.ts +1 -0
  1428. package/_vendor/plugin-geo/_vendor/canvas-react/components/overlays/BrushBoxOverlay.d.ts +1 -0
  1429. package/_vendor/plugin-geo/_vendor/canvas-react/components/overlays/OverlaySvgRoot.d.ts +1 -0
  1430. package/_vendor/plugin-geo/_vendor/canvas-react/components/overlays/SelectionFrameOverlay.d.ts +1 -0
  1431. package/_vendor/plugin-geo/_vendor/canvas-react/components/overlays/SelectionHandlesOverlay.d.ts +1 -0
  1432. package/_vendor/plugin-geo/_vendor/canvas-react/components/overlays/SelectionOverlaySvg.d.ts +1 -0
  1433. package/_vendor/plugin-geo/_vendor/canvas-react/components/overlays/SelectionPathOverlay.d.ts +8 -0
  1434. package/_vendor/plugin-geo/_vendor/canvas-react/components/overlays/ShapeOutlineOverlay.d.ts +8 -0
  1435. package/_vendor/plugin-geo/_vendor/canvas-react/components/overlays/SnapIndicatorsOverlay.d.ts +1 -0
  1436. package/_vendor/plugin-geo/_vendor/canvas-react/components/overlays/TerminalBindingGuidesOverlay.d.ts +1 -0
  1437. package/_vendor/plugin-geo/_vendor/canvas-react/components/shape-layer/ShapeClipStack.d.ts +11 -0
  1438. package/_vendor/plugin-geo/_vendor/canvas-react/components/shape-layer/ShapeDecorations.d.ts +2 -0
  1439. package/_vendor/plugin-geo/_vendor/canvas-react/components/shape-layer/ShapeForegroundItem.d.ts +5 -0
  1440. package/_vendor/plugin-geo/_vendor/canvas-react/components/shape-layer/ShapeItem.d.ts +5 -0
  1441. package/_vendor/plugin-geo/_vendor/canvas-react/components/shape-layer/ShapeRenderList.d.ts +1 -0
  1442. package/_vendor/plugin-geo/_vendor/canvas-react/components/shape-layer/ShapeRenderer.d.ts +12 -0
  1443. package/_vendor/plugin-geo/_vendor/canvas-react/components/shape-layer/shapeFrame.d.ts +11 -0
  1444. package/_vendor/plugin-geo/_vendor/canvas-react/components/useCanvasDomEvents.d.ts +23 -0
  1445. package/_vendor/plugin-geo/_vendor/canvas-react/contextMenuRequest.d.ts +19 -0
  1446. package/_vendor/plugin-geo/_vendor/canvas-react/dom.d.ts +10 -0
  1447. package/_vendor/plugin-geo/_vendor/canvas-react/hooks/useEditor.d.ts +3 -0
  1448. package/_vendor/plugin-geo/_vendor/canvas-react/hooks/useValue.d.ts +2 -0
  1449. package/_vendor/plugin-geo/_vendor/canvas-react/host/canvasRenderBindings.d.ts +21 -0
  1450. package/_vendor/plugin-geo/_vendor/canvas-react/host/canvasRenderBindingsContext.d.ts +5 -0
  1451. package/_vendor/plugin-geo/_vendor/canvas-react/host/canvasRenderPlugin.d.ts +81 -0
  1452. package/_vendor/plugin-geo/_vendor/canvas-react/host/index.d.ts +5 -0
  1453. package/_vendor/plugin-geo/_vendor/canvas-react/index.d.ts +5 -0
  1454. package/_vendor/plugin-geo/_vendor/signals/atom.d.ts +11 -0
  1455. package/_vendor/plugin-geo/_vendor/signals/computed.d.ts +13 -0
  1456. package/_vendor/plugin-geo/_vendor/signals/core.d.ts +35 -0
  1457. package/_vendor/plugin-geo/_vendor/signals/effect.d.ts +5 -0
  1458. package/_vendor/plugin-geo/_vendor/signals/index.d.ts +8 -0
  1459. package/_vendor/plugin-geo/_vendor/signals/types.d.ts +22 -0
  1460. package/_vendor/plugin-geo/_vendor/store/diff.d.ts +9 -0
  1461. package/_vendor/plugin-geo/_vendor/store/history.d.ts +22 -0
  1462. package/_vendor/plugin-geo/_vendor/store/index.d.ts +5 -0
  1463. package/_vendor/plugin-geo/_vendor/store/store.d.ts +40 -0
  1464. package/_vendor/plugin-geo/_vendor/store/types.d.ts +27 -0
  1465. package/_vendor/plugin-geo/api.d.ts +43 -0
  1466. package/_vendor/plugin-geo/canvasRender.d.ts +2 -0
  1467. package/_vendor/plugin-geo/editorRuntime.d.ts +7 -0
  1468. package/_vendor/plugin-geo/feature.d.ts +3 -0
  1469. package/_vendor/plugin-geo/geoCreationRuntime.d.ts +20 -0
  1470. package/_vendor/plugin-geo/geoGeometry.d.ts +64 -0
  1471. package/_vendor/plugin-geo/geoShapeUtil.d.ts +16 -0
  1472. package/_vendor/plugin-geo/geoStrokeStyle.d.ts +2 -0
  1473. package/_vendor/plugin-geo/geoTools.d.ts +51 -0
  1474. package/_vendor/plugin-geo/index.d.ts +9 -0
  1475. package/_vendor/plugin-geo/svgPathGeometry.d.ts +7 -0
  1476. package/_vendor/plugin-geo/types.d.ts +22 -0
  1477. package/_vendor/plugin-group/_vendor/canvas-core/bindings/bindingManager.d.ts +33 -0
  1478. package/_vendor/plugin-group/_vendor/canvas-core/bindings/bindingUtil.d.ts +69 -0
  1479. package/_vendor/plugin-group/_vendor/canvas-core/bindings/bindingUtilRegistry.d.ts +8 -0
  1480. package/_vendor/plugin-group/_vendor/canvas-core/bindings/terminalBinding.d.ts +28 -0
  1481. package/_vendor/plugin-group/_vendor/canvas-core/bindings/terminalPorts.d.ts +67 -0
  1482. package/_vendor/plugin-group/_vendor/canvas-core/editor/clipboard.d.ts +43 -0
  1483. package/_vendor/plugin-group/_vendor/canvas-core/editor/clipboardAssets.d.ts +6 -0
  1484. package/_vendor/plugin-group/_vendor/canvas-core/editor/commands/assetCommands.d.ts +7 -0
  1485. package/_vendor/plugin-group/_vendor/canvas-core/editor/commands/bindingCommands.d.ts +12 -0
  1486. package/_vendor/plugin-group/_vendor/canvas-core/editor/commands/commandTypes.d.ts +149 -0
  1487. package/_vendor/plugin-group/_vendor/canvas-core/editor/commands/commands.d.ts +5 -0
  1488. package/_vendor/plugin-group/_vendor/canvas-core/editor/commands/documentCommands.d.ts +9 -0
  1489. package/_vendor/plugin-group/_vendor/canvas-core/editor/commands/sessionCommands.d.ts +13 -0
  1490. package/_vendor/plugin-group/_vendor/canvas-core/editor/commands/shapeCommands.d.ts +9 -0
  1491. package/_vendor/plugin-group/_vendor/canvas-core/editor/commands/shapeFlags.d.ts +10 -0
  1492. package/_vendor/plugin-group/_vendor/canvas-core/editor/commands/shapeRemoval.d.ts +10 -0
  1493. package/_vendor/plugin-group/_vendor/canvas-core/editor/commands/shapeRepair.d.ts +11 -0
  1494. package/_vendor/plugin-group/_vendor/canvas-core/editor/createEditor.d.ts +6 -0
  1495. package/_vendor/plugin-group/_vendor/canvas-core/editor/editor.d.ts +356 -0
  1496. package/_vendor/plugin-group/_vendor/canvas-core/editor/events/canvasNavigationInteraction.d.ts +2 -0
  1497. package/_vendor/plugin-group/_vendor/canvas-core/editor/events/eventRouter.d.ts +16 -0
  1498. package/_vendor/plugin-group/_vendor/canvas-core/editor/events/events.d.ts +81 -0
  1499. package/_vendor/plugin-group/_vendor/canvas-core/editor/events/inputsManager.d.ts +49 -0
  1500. package/_vendor/plugin-group/_vendor/canvas-core/editor/events/interactions.d.ts +84 -0
  1501. package/_vendor/plugin-group/_vendor/canvas-core/editor/events/keyboardShortcuts.d.ts +23 -0
  1502. package/_vendor/plugin-group/_vendor/canvas-core/editor/events/pointerClickRecognizer.d.ts +11 -0
  1503. package/_vendor/plugin-group/_vendor/canvas-core/editor/history/historyManager.d.ts +40 -0
  1504. package/_vendor/plugin-group/_vendor/canvas-core/editor/history/operationManager.d.ts +77 -0
  1505. package/_vendor/plugin-group/_vendor/canvas-core/editor/internal.d.ts +7 -0
  1506. package/_vendor/plugin-group/_vendor/canvas-core/editor/queries/bindingQueryCache.d.ts +28 -0
  1507. package/_vendor/plugin-group/_vendor/canvas-core/editor/queries/bindingQueryState.d.ts +11 -0
  1508. package/_vendor/plugin-group/_vendor/canvas-core/editor/queries/draftBindingIndex.d.ts +19 -0
  1509. package/_vendor/plugin-group/_vendor/canvas-core/editor/queries/shapeGeometryQueryCache.d.ts +34 -0
  1510. package/_vendor/plugin-group/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +43 -0
  1511. package/_vendor/plugin-group/_vendor/canvas-core/editor/queries/shapeTreeIndex.d.ts +27 -0
  1512. package/_vendor/plugin-group/_vendor/canvas-core/editor/queries/shapeTreeIndexState.d.ts +11 -0
  1513. package/_vendor/plugin-group/_vendor/canvas-core/editor/queries/spatialIndexManager.d.ts +34 -0
  1514. package/_vendor/plugin-group/_vendor/canvas-core/editor/records/documentSnapshots.d.ts +14 -0
  1515. package/_vendor/plugin-group/_vendor/canvas-core/editor/records/editorRecordFactory.d.ts +19 -0
  1516. package/_vendor/plugin-group/_vendor/canvas-core/editor/records/recordQueries.d.ts +3 -0
  1517. package/_vendor/plugin-group/_vendor/canvas-core/editor/selection/resizeGeometry.d.ts +117 -0
  1518. package/_vendor/plugin-group/_vendor/canvas-core/editor/selection/selection.d.ts +223 -0
  1519. package/_vendor/plugin-group/_vendor/canvas-core/editor/selection/selectionBindingSegments.d.ts +7 -0
  1520. package/_vendor/plugin-group/_vendor/canvas-core/editor/selection/selectionGeometry.d.ts +28 -0
  1521. package/_vendor/plugin-group/_vendor/canvas-core/editor/selection/selectionHandleHitTest.d.ts +8 -0
  1522. package/_vendor/plugin-group/_vendor/canvas-core/editor/selection/selectionLayout.d.ts +20 -0
  1523. package/_vendor/plugin-group/_vendor/canvas-core/editor/selection/selectionOverlay.d.ts +25 -0
  1524. package/_vendor/plugin-group/_vendor/canvas-core/editor/selection/selectionOverlayEquality.d.ts +8 -0
  1525. package/_vendor/plugin-group/_vendor/canvas-core/editor/selection/selectionOverlayManager.d.ts +34 -0
  1526. package/_vendor/plugin-group/_vendor/canvas-core/editor/selection/selectionResizeCapabilities.d.ts +11 -0
  1527. package/_vendor/plugin-group/_vendor/canvas-core/editor/selection/selectionSet.d.ts +9 -0
  1528. package/_vendor/plugin-group/_vendor/canvas-core/editor/selection/selectionTargets.d.ts +10 -0
  1529. package/_vendor/plugin-group/_vendor/canvas-core/editor/selection/selectionTransforms.d.ts +6 -0
  1530. package/_vendor/plugin-group/_vendor/canvas-core/editor/shapes/shapeContainment.d.ts +14 -0
  1531. package/_vendor/plugin-group/_vendor/canvas-core/editor/shapes/shapeEditingManager.d.ts +33 -0
  1532. package/_vendor/plugin-group/_vendor/canvas-core/editor/shapes/shapeExportTraversal.d.ts +3 -0
  1533. package/_vendor/plugin-group/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +21 -0
  1534. package/_vendor/plugin-group/_vendor/canvas-core/editor/shapes/shapeGrouping.d.ts +22 -0
  1535. package/_vendor/plugin-group/_vendor/canvas-core/editor/shapes/shapeOrder.d.ts +32 -0
  1536. package/_vendor/plugin-group/_vendor/canvas-core/editor/shapes/shapeReparenting.d.ts +21 -0
  1537. package/_vendor/plugin-group/_vendor/canvas-core/editor/shapes/shapeSignalManager.d.ts +35 -0
  1538. package/_vendor/plugin-group/_vendor/canvas-core/editor/shapes/shapeTransformSpace.d.ts +6 -0
  1539. package/_vendor/plugin-group/_vendor/canvas-core/editor/shapes/shapeTreeQueries.d.ts +12 -0
  1540. package/_vendor/plugin-group/_vendor/canvas-core/editor/snapping/gapSnap.d.ts +6 -0
  1541. package/_vendor/plugin-group/_vendor/canvas-core/editor/snapping/pointSnap.d.ts +5 -0
  1542. package/_vendor/plugin-group/_vendor/canvas-core/editor/snapping/resizeSnap.d.ts +11 -0
  1543. package/_vendor/plugin-group/_vendor/canvas-core/editor/snapping/snapDecision.d.ts +2 -0
  1544. package/_vendor/plugin-group/_vendor/canvas-core/editor/snapping/snapGeometry.d.ts +26 -0
  1545. package/_vendor/plugin-group/_vendor/canvas-core/editor/snapping/snapIndicators.d.ts +22 -0
  1546. package/_vendor/plugin-group/_vendor/canvas-core/editor/snapping/snapManager.d.ts +54 -0
  1547. package/_vendor/plugin-group/_vendor/canvas-core/editor/snapping/snapResults.d.ts +58 -0
  1548. package/_vendor/plugin-group/_vendor/canvas-core/editor/snapping/snapSnapshotBuilder.d.ts +22 -0
  1549. package/_vendor/plugin-group/_vendor/canvas-core/editor/snapping/snapTypes.d.ts +114 -0
  1550. package/_vendor/plugin-group/_vendor/canvas-core/editor/state/editorReadModels.d.ts +34 -0
  1551. package/_vendor/plugin-group/_vendor/canvas-core/editor/state/editorSignals.d.ts +82 -0
  1552. package/_vendor/plugin-group/_vendor/canvas-core/editor/state/editorStateUtils.d.ts +9 -0
  1553. package/_vendor/plugin-group/_vendor/canvas-core/editor/state/interactionTransientManager.d.ts +35 -0
  1554. package/_vendor/plugin-group/_vendor/canvas-core/editor/viewport/camera.d.ts +3 -0
  1555. package/_vendor/plugin-group/_vendor/canvas-core/editor/viewport/cameraManager.d.ts +56 -0
  1556. package/_vendor/plugin-group/_vendor/canvas-core/editor/viewport/cameraPanSession.d.ts +9 -0
  1557. package/_vendor/plugin-group/_vendor/canvas-core/editor/viewport/edgeScroll.d.ts +5 -0
  1558. package/_vendor/plugin-group/_vendor/canvas-core/editor/viewport/renderWindow.d.ts +30 -0
  1559. package/_vendor/plugin-group/_vendor/canvas-core/editor/viewport/renderWindowManager.d.ts +33 -0
  1560. package/_vendor/plugin-group/_vendor/canvas-core/exports/integrity.d.ts +32 -0
  1561. package/_vendor/plugin-group/_vendor/canvas-core/exports/svg.d.ts +52 -0
  1562. package/_vendor/plugin-group/_vendor/canvas-core/geometry/box.d.ts +20 -0
  1563. package/_vendor/plugin-group/_vendor/canvas-core/geometry/contentCutout.d.ts +8 -0
  1564. package/_vendor/plugin-group/_vendor/canvas-core/geometry/ellipse2d.d.ts +16 -0
  1565. package/_vendor/plugin-group/_vendor/canvas-core/geometry/geometry2d.d.ts +15 -0
  1566. package/_vendor/plugin-group/_vendor/canvas-core/geometry/index.d.ts +9 -0
  1567. package/_vendor/plugin-group/_vendor/canvas-core/geometry/mat.d.ts +31 -0
  1568. package/_vendor/plugin-group/_vendor/canvas-core/geometry/polygon.d.ts +7 -0
  1569. package/_vendor/plugin-group/_vendor/canvas-core/geometry/polyline2d.d.ts +14 -0
  1570. package/_vendor/plugin-group/_vendor/canvas-core/geometry/rectangle2d.d.ts +16 -0
  1571. package/_vendor/plugin-group/_vendor/canvas-core/geometry/segments.d.ts +5 -0
  1572. package/_vendor/plugin-group/_vendor/canvas-core/geometry/vec.d.ts +35 -0
  1573. package/_vendor/plugin-group/_vendor/canvas-core/index.d.ts +64 -0
  1574. package/_vendor/plugin-group/_vendor/canvas-core/plugins/editorRuntimePlugin.d.ts +19 -0
  1575. package/_vendor/plugin-group/_vendor/canvas-core/plugins/editorRuntimeRegistry.d.ts +15 -0
  1576. package/_vendor/plugin-group/_vendor/canvas-core/plugins/index.d.ts +2 -0
  1577. package/_vendor/plugin-group/_vendor/canvas-core/reactivity.d.ts +8 -0
  1578. package/_vendor/plugin-group/_vendor/canvas-core/schema/records.d.ts +115 -0
  1579. package/_vendor/plugin-group/_vendor/canvas-core/schema/snapshots.d.ts +22 -0
  1580. package/_vendor/plugin-group/_vendor/canvas-core/shapes/childTransformPolicy.d.ts +16 -0
  1581. package/_vendor/plugin-group/_vendor/canvas-core/shapes/colors.d.ts +26 -0
  1582. package/_vendor/plugin-group/_vendor/canvas-core/shapes/shapeUtil.d.ts +245 -0
  1583. package/_vendor/plugin-group/_vendor/canvas-core/shapes/shapeUtilGeometry.d.ts +6 -0
  1584. package/_vendor/plugin-group/_vendor/canvas-core/shapes/shapeUtilRegistry.d.ts +9 -0
  1585. package/_vendor/plugin-group/_vendor/canvas-core/shapes/types.d.ts +2 -0
  1586. package/_vendor/plugin-group/_vendor/canvas-core/tools/hand/handTool.d.ts +5 -0
  1587. package/_vendor/plugin-group/_vendor/canvas-core/tools/select/selectContainment.d.ts +12 -0
  1588. package/_vendor/plugin-group/_vendor/canvas-core/tools/select/selectTool.d.ts +5 -0
  1589. package/_vendor/plugin-group/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +170 -0
  1590. package/_vendor/plugin-group/_vendor/canvas-core/tools/select/states/brushingState.d.ts +19 -0
  1591. package/_vendor/plugin-group/_vendor/canvas-core/tools/select/states/draggingPluginInteractionState.d.ts +15 -0
  1592. package/_vendor/plugin-group/_vendor/canvas-core/tools/select/states/idleState.d.ts +8 -0
  1593. package/_vendor/plugin-group/_vendor/canvas-core/tools/select/states/index.d.ts +11 -0
  1594. package/_vendor/plugin-group/_vendor/canvas-core/tools/select/states/pointingCanvasState.d.ts +11 -0
  1595. package/_vendor/plugin-group/_vendor/canvas-core/tools/select/states/pointingResizeHandleState.d.ts +10 -0
  1596. package/_vendor/plugin-group/_vendor/canvas-core/tools/select/states/pointingRotateHandleState.d.ts +10 -0
  1597. package/_vendor/plugin-group/_vendor/canvas-core/tools/select/states/pointingSelectionHandleInteractionState.d.ts +11 -0
  1598. package/_vendor/plugin-group/_vendor/canvas-core/tools/select/states/pointingShapeState.d.ts +12 -0
  1599. package/_vendor/plugin-group/_vendor/canvas-core/tools/select/states/resizingState.d.ts +16 -0
  1600. package/_vendor/plugin-group/_vendor/canvas-core/tools/select/states/rotatingState.d.ts +14 -0
  1601. package/_vendor/plugin-group/_vendor/canvas-core/tools/select/states/selectStateNode.d.ts +60 -0
  1602. package/_vendor/plugin-group/_vendor/canvas-core/tools/select/states/translatingState.d.ts +16 -0
  1603. package/_vendor/plugin-group/_vendor/canvas-core/tools/stateNode.d.ts +30 -0
  1604. package/_vendor/plugin-group/_vendor/canvas-core/tools/toolManager.d.ts +24 -0
  1605. package/_vendor/plugin-group/_vendor/canvas-core/utils/equality.d.ts +9 -0
  1606. package/_vendor/plugin-group/_vendor/canvas-extension-contracts/contributions.d.ts +92 -0
  1607. package/_vendor/plugin-group/_vendor/canvas-extension-contracts/index.d.ts +6 -0
  1608. package/_vendor/plugin-group/_vendor/canvas-extension-contracts/operations.d.ts +131 -0
  1609. package/_vendor/plugin-group/_vendor/canvas-extension-contracts/persistence.d.ts +16 -0
  1610. package/_vendor/plugin-group/_vendor/canvas-extension-contracts/plugin.d.ts +37 -0
  1611. package/_vendor/plugin-group/_vendor/canvas-extension-contracts/shape.d.ts +5 -0
  1612. package/_vendor/plugin-group/_vendor/canvas-extension-contracts/tokens.d.ts +12 -0
  1613. package/_vendor/plugin-group/_vendor/canvas-react/components/CanvasView.d.ts +7 -0
  1614. package/_vendor/plugin-group/_vendor/canvas-react/components/DefaultGrid.d.ts +1 -0
  1615. package/_vendor/plugin-group/_vendor/canvas-react/components/OverlayLayer.d.ts +1 -0
  1616. package/_vendor/plugin-group/_vendor/canvas-react/components/PageSpace.d.ts +6 -0
  1617. package/_vendor/plugin-group/_vendor/canvas-react/components/ShapeLayer.d.ts +1 -0
  1618. package/_vendor/plugin-group/_vendor/canvas-react/components/canvasKeyboardEvents.d.ts +13 -0
  1619. package/_vendor/plugin-group/_vendor/canvas-react/components/index.d.ts +3 -0
  1620. package/_vendor/plugin-group/_vendor/canvas-react/components/overlays/BindingGuide.d.ts +24 -0
  1621. package/_vendor/plugin-group/_vendor/canvas-react/components/overlays/BindingPreviewOverlay.d.ts +1 -0
  1622. package/_vendor/plugin-group/_vendor/canvas-react/components/overlays/BrushBoxOverlay.d.ts +1 -0
  1623. package/_vendor/plugin-group/_vendor/canvas-react/components/overlays/OverlaySvgRoot.d.ts +1 -0
  1624. package/_vendor/plugin-group/_vendor/canvas-react/components/overlays/SelectionFrameOverlay.d.ts +1 -0
  1625. package/_vendor/plugin-group/_vendor/canvas-react/components/overlays/SelectionHandlesOverlay.d.ts +1 -0
  1626. package/_vendor/plugin-group/_vendor/canvas-react/components/overlays/SelectionOverlaySvg.d.ts +1 -0
  1627. package/_vendor/plugin-group/_vendor/canvas-react/components/overlays/SelectionPathOverlay.d.ts +8 -0
  1628. package/_vendor/plugin-group/_vendor/canvas-react/components/overlays/ShapeOutlineOverlay.d.ts +8 -0
  1629. package/_vendor/plugin-group/_vendor/canvas-react/components/overlays/SnapIndicatorsOverlay.d.ts +1 -0
  1630. package/_vendor/plugin-group/_vendor/canvas-react/components/overlays/TerminalBindingGuidesOverlay.d.ts +1 -0
  1631. package/_vendor/plugin-group/_vendor/canvas-react/components/shape-layer/ShapeClipStack.d.ts +11 -0
  1632. package/_vendor/plugin-group/_vendor/canvas-react/components/shape-layer/ShapeDecorations.d.ts +2 -0
  1633. package/_vendor/plugin-group/_vendor/canvas-react/components/shape-layer/ShapeForegroundItem.d.ts +5 -0
  1634. package/_vendor/plugin-group/_vendor/canvas-react/components/shape-layer/ShapeItem.d.ts +5 -0
  1635. package/_vendor/plugin-group/_vendor/canvas-react/components/shape-layer/ShapeRenderList.d.ts +1 -0
  1636. package/_vendor/plugin-group/_vendor/canvas-react/components/shape-layer/ShapeRenderer.d.ts +12 -0
  1637. package/_vendor/plugin-group/_vendor/canvas-react/components/shape-layer/shapeFrame.d.ts +11 -0
  1638. package/_vendor/plugin-group/_vendor/canvas-react/components/useCanvasDomEvents.d.ts +23 -0
  1639. package/_vendor/plugin-group/_vendor/canvas-react/contextMenuRequest.d.ts +19 -0
  1640. package/_vendor/plugin-group/_vendor/canvas-react/dom.d.ts +10 -0
  1641. package/_vendor/plugin-group/_vendor/canvas-react/hooks/useEditor.d.ts +3 -0
  1642. package/_vendor/plugin-group/_vendor/canvas-react/hooks/useValue.d.ts +2 -0
  1643. package/_vendor/plugin-group/_vendor/canvas-react/host/canvasRenderBindings.d.ts +21 -0
  1644. package/_vendor/plugin-group/_vendor/canvas-react/host/canvasRenderBindingsContext.d.ts +5 -0
  1645. package/_vendor/plugin-group/_vendor/canvas-react/host/canvasRenderPlugin.d.ts +81 -0
  1646. package/_vendor/plugin-group/_vendor/canvas-react/host/index.d.ts +5 -0
  1647. package/_vendor/plugin-group/_vendor/canvas-react/index.d.ts +5 -0
  1648. package/_vendor/plugin-group/_vendor/signals/atom.d.ts +11 -0
  1649. package/_vendor/plugin-group/_vendor/signals/computed.d.ts +13 -0
  1650. package/_vendor/plugin-group/_vendor/signals/core.d.ts +35 -0
  1651. package/_vendor/plugin-group/_vendor/signals/effect.d.ts +5 -0
  1652. package/_vendor/plugin-group/_vendor/signals/index.d.ts +8 -0
  1653. package/_vendor/plugin-group/_vendor/signals/types.d.ts +22 -0
  1654. package/_vendor/plugin-group/_vendor/store/diff.d.ts +9 -0
  1655. package/_vendor/plugin-group/_vendor/store/history.d.ts +22 -0
  1656. package/_vendor/plugin-group/_vendor/store/index.d.ts +5 -0
  1657. package/_vendor/plugin-group/_vendor/store/store.d.ts +40 -0
  1658. package/_vendor/plugin-group/_vendor/store/types.d.ts +27 -0
  1659. package/_vendor/plugin-group/canvasRender.d.ts +9 -0
  1660. package/_vendor/plugin-group/editorRuntime.d.ts +7 -0
  1661. package/_vendor/plugin-group/feature.d.ts +2 -0
  1662. package/_vendor/plugin-group/groupShapeUtil.d.ts +35 -0
  1663. package/_vendor/plugin-group/index.d.ts +5 -0
  1664. package/_vendor/plugin-html/_vendor/canvas-core/bindings/bindingManager.d.ts +33 -0
  1665. package/_vendor/plugin-html/_vendor/canvas-core/bindings/bindingUtil.d.ts +69 -0
  1666. package/_vendor/plugin-html/_vendor/canvas-core/bindings/bindingUtilRegistry.d.ts +8 -0
  1667. package/_vendor/plugin-html/_vendor/canvas-core/bindings/terminalBinding.d.ts +28 -0
  1668. package/_vendor/plugin-html/_vendor/canvas-core/bindings/terminalPorts.d.ts +67 -0
  1669. package/_vendor/plugin-html/_vendor/canvas-core/editor/clipboard.d.ts +43 -0
  1670. package/_vendor/plugin-html/_vendor/canvas-core/editor/clipboardAssets.d.ts +6 -0
  1671. package/_vendor/plugin-html/_vendor/canvas-core/editor/commands/assetCommands.d.ts +7 -0
  1672. package/_vendor/plugin-html/_vendor/canvas-core/editor/commands/bindingCommands.d.ts +12 -0
  1673. package/_vendor/plugin-html/_vendor/canvas-core/editor/commands/commandTypes.d.ts +149 -0
  1674. package/_vendor/plugin-html/_vendor/canvas-core/editor/commands/commands.d.ts +5 -0
  1675. package/_vendor/plugin-html/_vendor/canvas-core/editor/commands/documentCommands.d.ts +9 -0
  1676. package/_vendor/plugin-html/_vendor/canvas-core/editor/commands/sessionCommands.d.ts +13 -0
  1677. package/_vendor/plugin-html/_vendor/canvas-core/editor/commands/shapeCommands.d.ts +9 -0
  1678. package/_vendor/plugin-html/_vendor/canvas-core/editor/commands/shapeFlags.d.ts +10 -0
  1679. package/_vendor/plugin-html/_vendor/canvas-core/editor/commands/shapeRemoval.d.ts +10 -0
  1680. package/_vendor/plugin-html/_vendor/canvas-core/editor/commands/shapeRepair.d.ts +11 -0
  1681. package/_vendor/plugin-html/_vendor/canvas-core/editor/createEditor.d.ts +6 -0
  1682. package/_vendor/plugin-html/_vendor/canvas-core/editor/editor.d.ts +356 -0
  1683. package/_vendor/plugin-html/_vendor/canvas-core/editor/events/canvasNavigationInteraction.d.ts +2 -0
  1684. package/_vendor/plugin-html/_vendor/canvas-core/editor/events/eventRouter.d.ts +16 -0
  1685. package/_vendor/plugin-html/_vendor/canvas-core/editor/events/events.d.ts +81 -0
  1686. package/_vendor/plugin-html/_vendor/canvas-core/editor/events/inputsManager.d.ts +49 -0
  1687. package/_vendor/plugin-html/_vendor/canvas-core/editor/events/interactions.d.ts +84 -0
  1688. package/_vendor/plugin-html/_vendor/canvas-core/editor/events/keyboardShortcuts.d.ts +23 -0
  1689. package/_vendor/plugin-html/_vendor/canvas-core/editor/events/pointerClickRecognizer.d.ts +11 -0
  1690. package/_vendor/plugin-html/_vendor/canvas-core/editor/history/historyManager.d.ts +40 -0
  1691. package/_vendor/plugin-html/_vendor/canvas-core/editor/history/operationManager.d.ts +77 -0
  1692. package/_vendor/plugin-html/_vendor/canvas-core/editor/internal.d.ts +7 -0
  1693. package/_vendor/plugin-html/_vendor/canvas-core/editor/queries/bindingQueryCache.d.ts +28 -0
  1694. package/_vendor/plugin-html/_vendor/canvas-core/editor/queries/bindingQueryState.d.ts +11 -0
  1695. package/_vendor/plugin-html/_vendor/canvas-core/editor/queries/draftBindingIndex.d.ts +19 -0
  1696. package/_vendor/plugin-html/_vendor/canvas-core/editor/queries/shapeGeometryQueryCache.d.ts +34 -0
  1697. package/_vendor/plugin-html/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +43 -0
  1698. package/_vendor/plugin-html/_vendor/canvas-core/editor/queries/shapeTreeIndex.d.ts +27 -0
  1699. package/_vendor/plugin-html/_vendor/canvas-core/editor/queries/shapeTreeIndexState.d.ts +11 -0
  1700. package/_vendor/plugin-html/_vendor/canvas-core/editor/queries/spatialIndexManager.d.ts +34 -0
  1701. package/_vendor/plugin-html/_vendor/canvas-core/editor/records/documentSnapshots.d.ts +14 -0
  1702. package/_vendor/plugin-html/_vendor/canvas-core/editor/records/editorRecordFactory.d.ts +19 -0
  1703. package/_vendor/plugin-html/_vendor/canvas-core/editor/records/recordQueries.d.ts +3 -0
  1704. package/_vendor/plugin-html/_vendor/canvas-core/editor/selection/resizeGeometry.d.ts +117 -0
  1705. package/_vendor/plugin-html/_vendor/canvas-core/editor/selection/selection.d.ts +223 -0
  1706. package/_vendor/plugin-html/_vendor/canvas-core/editor/selection/selectionBindingSegments.d.ts +7 -0
  1707. package/_vendor/plugin-html/_vendor/canvas-core/editor/selection/selectionGeometry.d.ts +28 -0
  1708. package/_vendor/plugin-html/_vendor/canvas-core/editor/selection/selectionHandleHitTest.d.ts +8 -0
  1709. package/_vendor/plugin-html/_vendor/canvas-core/editor/selection/selectionLayout.d.ts +20 -0
  1710. package/_vendor/plugin-html/_vendor/canvas-core/editor/selection/selectionOverlay.d.ts +25 -0
  1711. package/_vendor/plugin-html/_vendor/canvas-core/editor/selection/selectionOverlayEquality.d.ts +8 -0
  1712. package/_vendor/plugin-html/_vendor/canvas-core/editor/selection/selectionOverlayManager.d.ts +34 -0
  1713. package/_vendor/plugin-html/_vendor/canvas-core/editor/selection/selectionResizeCapabilities.d.ts +11 -0
  1714. package/_vendor/plugin-html/_vendor/canvas-core/editor/selection/selectionSet.d.ts +9 -0
  1715. package/_vendor/plugin-html/_vendor/canvas-core/editor/selection/selectionTargets.d.ts +10 -0
  1716. package/_vendor/plugin-html/_vendor/canvas-core/editor/selection/selectionTransforms.d.ts +6 -0
  1717. package/_vendor/plugin-html/_vendor/canvas-core/editor/shapes/shapeContainment.d.ts +14 -0
  1718. package/_vendor/plugin-html/_vendor/canvas-core/editor/shapes/shapeEditingManager.d.ts +33 -0
  1719. package/_vendor/plugin-html/_vendor/canvas-core/editor/shapes/shapeExportTraversal.d.ts +3 -0
  1720. package/_vendor/plugin-html/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +21 -0
  1721. package/_vendor/plugin-html/_vendor/canvas-core/editor/shapes/shapeGrouping.d.ts +22 -0
  1722. package/_vendor/plugin-html/_vendor/canvas-core/editor/shapes/shapeOrder.d.ts +32 -0
  1723. package/_vendor/plugin-html/_vendor/canvas-core/editor/shapes/shapeReparenting.d.ts +21 -0
  1724. package/_vendor/plugin-html/_vendor/canvas-core/editor/shapes/shapeSignalManager.d.ts +35 -0
  1725. package/_vendor/plugin-html/_vendor/canvas-core/editor/shapes/shapeTransformSpace.d.ts +6 -0
  1726. package/_vendor/plugin-html/_vendor/canvas-core/editor/shapes/shapeTreeQueries.d.ts +12 -0
  1727. package/_vendor/plugin-html/_vendor/canvas-core/editor/snapping/gapSnap.d.ts +6 -0
  1728. package/_vendor/plugin-html/_vendor/canvas-core/editor/snapping/pointSnap.d.ts +5 -0
  1729. package/_vendor/plugin-html/_vendor/canvas-core/editor/snapping/resizeSnap.d.ts +11 -0
  1730. package/_vendor/plugin-html/_vendor/canvas-core/editor/snapping/snapDecision.d.ts +2 -0
  1731. package/_vendor/plugin-html/_vendor/canvas-core/editor/snapping/snapGeometry.d.ts +26 -0
  1732. package/_vendor/plugin-html/_vendor/canvas-core/editor/snapping/snapIndicators.d.ts +22 -0
  1733. package/_vendor/plugin-html/_vendor/canvas-core/editor/snapping/snapManager.d.ts +54 -0
  1734. package/_vendor/plugin-html/_vendor/canvas-core/editor/snapping/snapResults.d.ts +58 -0
  1735. package/_vendor/plugin-html/_vendor/canvas-core/editor/snapping/snapSnapshotBuilder.d.ts +22 -0
  1736. package/_vendor/plugin-html/_vendor/canvas-core/editor/snapping/snapTypes.d.ts +114 -0
  1737. package/_vendor/plugin-html/_vendor/canvas-core/editor/state/editorReadModels.d.ts +34 -0
  1738. package/_vendor/plugin-html/_vendor/canvas-core/editor/state/editorSignals.d.ts +82 -0
  1739. package/_vendor/plugin-html/_vendor/canvas-core/editor/state/editorStateUtils.d.ts +9 -0
  1740. package/_vendor/plugin-html/_vendor/canvas-core/editor/state/interactionTransientManager.d.ts +35 -0
  1741. package/_vendor/plugin-html/_vendor/canvas-core/editor/viewport/camera.d.ts +3 -0
  1742. package/_vendor/plugin-html/_vendor/canvas-core/editor/viewport/cameraManager.d.ts +56 -0
  1743. package/_vendor/plugin-html/_vendor/canvas-core/editor/viewport/cameraPanSession.d.ts +9 -0
  1744. package/_vendor/plugin-html/_vendor/canvas-core/editor/viewport/edgeScroll.d.ts +5 -0
  1745. package/_vendor/plugin-html/_vendor/canvas-core/editor/viewport/renderWindow.d.ts +30 -0
  1746. package/_vendor/plugin-html/_vendor/canvas-core/editor/viewport/renderWindowManager.d.ts +33 -0
  1747. package/_vendor/plugin-html/_vendor/canvas-core/exports/integrity.d.ts +32 -0
  1748. package/_vendor/plugin-html/_vendor/canvas-core/exports/svg.d.ts +52 -0
  1749. package/_vendor/plugin-html/_vendor/canvas-core/geometry/box.d.ts +20 -0
  1750. package/_vendor/plugin-html/_vendor/canvas-core/geometry/contentCutout.d.ts +8 -0
  1751. package/_vendor/plugin-html/_vendor/canvas-core/geometry/ellipse2d.d.ts +16 -0
  1752. package/_vendor/plugin-html/_vendor/canvas-core/geometry/geometry2d.d.ts +15 -0
  1753. package/_vendor/plugin-html/_vendor/canvas-core/geometry/index.d.ts +9 -0
  1754. package/_vendor/plugin-html/_vendor/canvas-core/geometry/mat.d.ts +31 -0
  1755. package/_vendor/plugin-html/_vendor/canvas-core/geometry/polygon.d.ts +7 -0
  1756. package/_vendor/plugin-html/_vendor/canvas-core/geometry/polyline2d.d.ts +14 -0
  1757. package/_vendor/plugin-html/_vendor/canvas-core/geometry/rectangle2d.d.ts +16 -0
  1758. package/_vendor/plugin-html/_vendor/canvas-core/geometry/segments.d.ts +5 -0
  1759. package/_vendor/plugin-html/_vendor/canvas-core/geometry/vec.d.ts +35 -0
  1760. package/_vendor/plugin-html/_vendor/canvas-core/index.d.ts +64 -0
  1761. package/_vendor/plugin-html/_vendor/canvas-core/plugins/editorRuntimePlugin.d.ts +19 -0
  1762. package/_vendor/plugin-html/_vendor/canvas-core/plugins/editorRuntimeRegistry.d.ts +15 -0
  1763. package/_vendor/plugin-html/_vendor/canvas-core/plugins/index.d.ts +2 -0
  1764. package/_vendor/plugin-html/_vendor/canvas-core/reactivity.d.ts +8 -0
  1765. package/_vendor/plugin-html/_vendor/canvas-core/schema/records.d.ts +115 -0
  1766. package/_vendor/plugin-html/_vendor/canvas-core/schema/snapshots.d.ts +22 -0
  1767. package/_vendor/plugin-html/_vendor/canvas-core/shapes/childTransformPolicy.d.ts +16 -0
  1768. package/_vendor/plugin-html/_vendor/canvas-core/shapes/colors.d.ts +26 -0
  1769. package/_vendor/plugin-html/_vendor/canvas-core/shapes/shapeUtil.d.ts +245 -0
  1770. package/_vendor/plugin-html/_vendor/canvas-core/shapes/shapeUtilGeometry.d.ts +6 -0
  1771. package/_vendor/plugin-html/_vendor/canvas-core/shapes/shapeUtilRegistry.d.ts +9 -0
  1772. package/_vendor/plugin-html/_vendor/canvas-core/shapes/types.d.ts +2 -0
  1773. package/_vendor/plugin-html/_vendor/canvas-core/tools/hand/handTool.d.ts +5 -0
  1774. package/_vendor/plugin-html/_vendor/canvas-core/tools/select/selectContainment.d.ts +12 -0
  1775. package/_vendor/plugin-html/_vendor/canvas-core/tools/select/selectTool.d.ts +5 -0
  1776. package/_vendor/plugin-html/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +170 -0
  1777. package/_vendor/plugin-html/_vendor/canvas-core/tools/select/states/brushingState.d.ts +19 -0
  1778. package/_vendor/plugin-html/_vendor/canvas-core/tools/select/states/draggingPluginInteractionState.d.ts +15 -0
  1779. package/_vendor/plugin-html/_vendor/canvas-core/tools/select/states/idleState.d.ts +8 -0
  1780. package/_vendor/plugin-html/_vendor/canvas-core/tools/select/states/index.d.ts +11 -0
  1781. package/_vendor/plugin-html/_vendor/canvas-core/tools/select/states/pointingCanvasState.d.ts +11 -0
  1782. package/_vendor/plugin-html/_vendor/canvas-core/tools/select/states/pointingResizeHandleState.d.ts +10 -0
  1783. package/_vendor/plugin-html/_vendor/canvas-core/tools/select/states/pointingRotateHandleState.d.ts +10 -0
  1784. package/_vendor/plugin-html/_vendor/canvas-core/tools/select/states/pointingSelectionHandleInteractionState.d.ts +11 -0
  1785. package/_vendor/plugin-html/_vendor/canvas-core/tools/select/states/pointingShapeState.d.ts +12 -0
  1786. package/_vendor/plugin-html/_vendor/canvas-core/tools/select/states/resizingState.d.ts +16 -0
  1787. package/_vendor/plugin-html/_vendor/canvas-core/tools/select/states/rotatingState.d.ts +14 -0
  1788. package/_vendor/plugin-html/_vendor/canvas-core/tools/select/states/selectStateNode.d.ts +60 -0
  1789. package/_vendor/plugin-html/_vendor/canvas-core/tools/select/states/translatingState.d.ts +16 -0
  1790. package/_vendor/plugin-html/_vendor/canvas-core/tools/stateNode.d.ts +30 -0
  1791. package/_vendor/plugin-html/_vendor/canvas-core/tools/toolManager.d.ts +24 -0
  1792. package/_vendor/plugin-html/_vendor/canvas-core/utils/equality.d.ts +9 -0
  1793. package/_vendor/plugin-html/_vendor/canvas-extension-contracts/contributions.d.ts +92 -0
  1794. package/_vendor/plugin-html/_vendor/canvas-extension-contracts/index.d.ts +6 -0
  1795. package/_vendor/plugin-html/_vendor/canvas-extension-contracts/operations.d.ts +131 -0
  1796. package/_vendor/plugin-html/_vendor/canvas-extension-contracts/persistence.d.ts +16 -0
  1797. package/_vendor/plugin-html/_vendor/canvas-extension-contracts/plugin.d.ts +37 -0
  1798. package/_vendor/plugin-html/_vendor/canvas-extension-contracts/shape.d.ts +5 -0
  1799. package/_vendor/plugin-html/_vendor/canvas-extension-contracts/tokens.d.ts +12 -0
  1800. package/_vendor/plugin-html/_vendor/canvas-react/components/CanvasView.d.ts +7 -0
  1801. package/_vendor/plugin-html/_vendor/canvas-react/components/DefaultGrid.d.ts +1 -0
  1802. package/_vendor/plugin-html/_vendor/canvas-react/components/OverlayLayer.d.ts +1 -0
  1803. package/_vendor/plugin-html/_vendor/canvas-react/components/PageSpace.d.ts +6 -0
  1804. package/_vendor/plugin-html/_vendor/canvas-react/components/ShapeLayer.d.ts +1 -0
  1805. package/_vendor/plugin-html/_vendor/canvas-react/components/canvasKeyboardEvents.d.ts +13 -0
  1806. package/_vendor/plugin-html/_vendor/canvas-react/components/index.d.ts +3 -0
  1807. package/_vendor/plugin-html/_vendor/canvas-react/components/overlays/BindingGuide.d.ts +24 -0
  1808. package/_vendor/plugin-html/_vendor/canvas-react/components/overlays/BindingPreviewOverlay.d.ts +1 -0
  1809. package/_vendor/plugin-html/_vendor/canvas-react/components/overlays/BrushBoxOverlay.d.ts +1 -0
  1810. package/_vendor/plugin-html/_vendor/canvas-react/components/overlays/OverlaySvgRoot.d.ts +1 -0
  1811. package/_vendor/plugin-html/_vendor/canvas-react/components/overlays/SelectionFrameOverlay.d.ts +1 -0
  1812. package/_vendor/plugin-html/_vendor/canvas-react/components/overlays/SelectionHandlesOverlay.d.ts +1 -0
  1813. package/_vendor/plugin-html/_vendor/canvas-react/components/overlays/SelectionOverlaySvg.d.ts +1 -0
  1814. package/_vendor/plugin-html/_vendor/canvas-react/components/overlays/SelectionPathOverlay.d.ts +8 -0
  1815. package/_vendor/plugin-html/_vendor/canvas-react/components/overlays/ShapeOutlineOverlay.d.ts +8 -0
  1816. package/_vendor/plugin-html/_vendor/canvas-react/components/overlays/SnapIndicatorsOverlay.d.ts +1 -0
  1817. package/_vendor/plugin-html/_vendor/canvas-react/components/overlays/TerminalBindingGuidesOverlay.d.ts +1 -0
  1818. package/_vendor/plugin-html/_vendor/canvas-react/components/shape-layer/ShapeClipStack.d.ts +11 -0
  1819. package/_vendor/plugin-html/_vendor/canvas-react/components/shape-layer/ShapeDecorations.d.ts +2 -0
  1820. package/_vendor/plugin-html/_vendor/canvas-react/components/shape-layer/ShapeForegroundItem.d.ts +5 -0
  1821. package/_vendor/plugin-html/_vendor/canvas-react/components/shape-layer/ShapeItem.d.ts +5 -0
  1822. package/_vendor/plugin-html/_vendor/canvas-react/components/shape-layer/ShapeRenderList.d.ts +1 -0
  1823. package/_vendor/plugin-html/_vendor/canvas-react/components/shape-layer/ShapeRenderer.d.ts +12 -0
  1824. package/_vendor/plugin-html/_vendor/canvas-react/components/shape-layer/shapeFrame.d.ts +11 -0
  1825. package/_vendor/plugin-html/_vendor/canvas-react/components/useCanvasDomEvents.d.ts +23 -0
  1826. package/_vendor/plugin-html/_vendor/canvas-react/contextMenuRequest.d.ts +19 -0
  1827. package/_vendor/plugin-html/_vendor/canvas-react/dom.d.ts +10 -0
  1828. package/_vendor/plugin-html/_vendor/canvas-react/hooks/useEditor.d.ts +3 -0
  1829. package/_vendor/plugin-html/_vendor/canvas-react/hooks/useValue.d.ts +2 -0
  1830. package/_vendor/plugin-html/_vendor/canvas-react/host/canvasRenderBindings.d.ts +21 -0
  1831. package/_vendor/plugin-html/_vendor/canvas-react/host/canvasRenderBindingsContext.d.ts +5 -0
  1832. package/_vendor/plugin-html/_vendor/canvas-react/host/canvasRenderPlugin.d.ts +81 -0
  1833. package/_vendor/plugin-html/_vendor/canvas-react/host/index.d.ts +5 -0
  1834. package/_vendor/plugin-html/_vendor/canvas-react/index.d.ts +5 -0
  1835. package/_vendor/plugin-html/_vendor/signals/atom.d.ts +11 -0
  1836. package/_vendor/plugin-html/_vendor/signals/computed.d.ts +13 -0
  1837. package/_vendor/plugin-html/_vendor/signals/core.d.ts +35 -0
  1838. package/_vendor/plugin-html/_vendor/signals/effect.d.ts +5 -0
  1839. package/_vendor/plugin-html/_vendor/signals/index.d.ts +8 -0
  1840. package/_vendor/plugin-html/_vendor/signals/types.d.ts +22 -0
  1841. package/_vendor/plugin-html/_vendor/store/diff.d.ts +9 -0
  1842. package/_vendor/plugin-html/_vendor/store/history.d.ts +22 -0
  1843. package/_vendor/plugin-html/_vendor/store/index.d.ts +5 -0
  1844. package/_vendor/plugin-html/_vendor/store/store.d.ts +40 -0
  1845. package/_vendor/plugin-html/_vendor/store/types.d.ts +27 -0
  1846. package/_vendor/plugin-html/api.d.ts +22 -0
  1847. package/_vendor/plugin-html/editorPlugin.d.ts +2 -0
  1848. package/_vendor/plugin-html/feature.d.ts +6 -0
  1849. package/_vendor/plugin-html/htmlInteractions.d.ts +4 -0
  1850. package/_vendor/plugin-html/htmlShapeUtil.d.ts +11 -0
  1851. package/_vendor/plugin-html/index.d.ts +11 -0
  1852. package/_vendor/plugin-html/renderPlugin.d.ts +6 -0
  1853. package/_vendor/plugin-html/types.d.ts +9 -0
  1854. package/_vendor/plugin-image/_vendor/canvas-core/bindings/bindingManager.d.ts +33 -0
  1855. package/_vendor/plugin-image/_vendor/canvas-core/bindings/bindingUtil.d.ts +69 -0
  1856. package/_vendor/plugin-image/_vendor/canvas-core/bindings/bindingUtilRegistry.d.ts +8 -0
  1857. package/_vendor/plugin-image/_vendor/canvas-core/bindings/terminalBinding.d.ts +28 -0
  1858. package/_vendor/plugin-image/_vendor/canvas-core/bindings/terminalPorts.d.ts +67 -0
  1859. package/_vendor/plugin-image/_vendor/canvas-core/editor/clipboard.d.ts +43 -0
  1860. package/_vendor/plugin-image/_vendor/canvas-core/editor/clipboardAssets.d.ts +6 -0
  1861. package/_vendor/plugin-image/_vendor/canvas-core/editor/commands/assetCommands.d.ts +7 -0
  1862. package/_vendor/plugin-image/_vendor/canvas-core/editor/commands/bindingCommands.d.ts +12 -0
  1863. package/_vendor/plugin-image/_vendor/canvas-core/editor/commands/commandTypes.d.ts +149 -0
  1864. package/_vendor/plugin-image/_vendor/canvas-core/editor/commands/commands.d.ts +5 -0
  1865. package/_vendor/plugin-image/_vendor/canvas-core/editor/commands/documentCommands.d.ts +9 -0
  1866. package/_vendor/plugin-image/_vendor/canvas-core/editor/commands/sessionCommands.d.ts +13 -0
  1867. package/_vendor/plugin-image/_vendor/canvas-core/editor/commands/shapeCommands.d.ts +9 -0
  1868. package/_vendor/plugin-image/_vendor/canvas-core/editor/commands/shapeFlags.d.ts +10 -0
  1869. package/_vendor/plugin-image/_vendor/canvas-core/editor/commands/shapeRemoval.d.ts +10 -0
  1870. package/_vendor/plugin-image/_vendor/canvas-core/editor/commands/shapeRepair.d.ts +11 -0
  1871. package/_vendor/plugin-image/_vendor/canvas-core/editor/createEditor.d.ts +6 -0
  1872. package/_vendor/plugin-image/_vendor/canvas-core/editor/editor.d.ts +356 -0
  1873. package/_vendor/plugin-image/_vendor/canvas-core/editor/events/canvasNavigationInteraction.d.ts +2 -0
  1874. package/_vendor/plugin-image/_vendor/canvas-core/editor/events/eventRouter.d.ts +16 -0
  1875. package/_vendor/plugin-image/_vendor/canvas-core/editor/events/events.d.ts +81 -0
  1876. package/_vendor/plugin-image/_vendor/canvas-core/editor/events/inputsManager.d.ts +49 -0
  1877. package/_vendor/plugin-image/_vendor/canvas-core/editor/events/interactions.d.ts +84 -0
  1878. package/_vendor/plugin-image/_vendor/canvas-core/editor/events/keyboardShortcuts.d.ts +23 -0
  1879. package/_vendor/plugin-image/_vendor/canvas-core/editor/events/pointerClickRecognizer.d.ts +11 -0
  1880. package/_vendor/plugin-image/_vendor/canvas-core/editor/history/historyManager.d.ts +40 -0
  1881. package/_vendor/plugin-image/_vendor/canvas-core/editor/history/operationManager.d.ts +77 -0
  1882. package/_vendor/plugin-image/_vendor/canvas-core/editor/internal.d.ts +7 -0
  1883. package/_vendor/plugin-image/_vendor/canvas-core/editor/queries/bindingQueryCache.d.ts +28 -0
  1884. package/_vendor/plugin-image/_vendor/canvas-core/editor/queries/bindingQueryState.d.ts +11 -0
  1885. package/_vendor/plugin-image/_vendor/canvas-core/editor/queries/draftBindingIndex.d.ts +19 -0
  1886. package/_vendor/plugin-image/_vendor/canvas-core/editor/queries/shapeGeometryQueryCache.d.ts +34 -0
  1887. package/_vendor/plugin-image/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +43 -0
  1888. package/_vendor/plugin-image/_vendor/canvas-core/editor/queries/shapeTreeIndex.d.ts +27 -0
  1889. package/_vendor/plugin-image/_vendor/canvas-core/editor/queries/shapeTreeIndexState.d.ts +11 -0
  1890. package/_vendor/plugin-image/_vendor/canvas-core/editor/queries/spatialIndexManager.d.ts +34 -0
  1891. package/_vendor/plugin-image/_vendor/canvas-core/editor/records/documentSnapshots.d.ts +14 -0
  1892. package/_vendor/plugin-image/_vendor/canvas-core/editor/records/editorRecordFactory.d.ts +19 -0
  1893. package/_vendor/plugin-image/_vendor/canvas-core/editor/records/recordQueries.d.ts +3 -0
  1894. package/_vendor/plugin-image/_vendor/canvas-core/editor/selection/resizeGeometry.d.ts +117 -0
  1895. package/_vendor/plugin-image/_vendor/canvas-core/editor/selection/selection.d.ts +223 -0
  1896. package/_vendor/plugin-image/_vendor/canvas-core/editor/selection/selectionBindingSegments.d.ts +7 -0
  1897. package/_vendor/plugin-image/_vendor/canvas-core/editor/selection/selectionGeometry.d.ts +28 -0
  1898. package/_vendor/plugin-image/_vendor/canvas-core/editor/selection/selectionHandleHitTest.d.ts +8 -0
  1899. package/_vendor/plugin-image/_vendor/canvas-core/editor/selection/selectionLayout.d.ts +20 -0
  1900. package/_vendor/plugin-image/_vendor/canvas-core/editor/selection/selectionOverlay.d.ts +25 -0
  1901. package/_vendor/plugin-image/_vendor/canvas-core/editor/selection/selectionOverlayEquality.d.ts +8 -0
  1902. package/_vendor/plugin-image/_vendor/canvas-core/editor/selection/selectionOverlayManager.d.ts +34 -0
  1903. package/_vendor/plugin-image/_vendor/canvas-core/editor/selection/selectionResizeCapabilities.d.ts +11 -0
  1904. package/_vendor/plugin-image/_vendor/canvas-core/editor/selection/selectionSet.d.ts +9 -0
  1905. package/_vendor/plugin-image/_vendor/canvas-core/editor/selection/selectionTargets.d.ts +10 -0
  1906. package/_vendor/plugin-image/_vendor/canvas-core/editor/selection/selectionTransforms.d.ts +6 -0
  1907. package/_vendor/plugin-image/_vendor/canvas-core/editor/shapes/shapeContainment.d.ts +14 -0
  1908. package/_vendor/plugin-image/_vendor/canvas-core/editor/shapes/shapeEditingManager.d.ts +33 -0
  1909. package/_vendor/plugin-image/_vendor/canvas-core/editor/shapes/shapeExportTraversal.d.ts +3 -0
  1910. package/_vendor/plugin-image/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +21 -0
  1911. package/_vendor/plugin-image/_vendor/canvas-core/editor/shapes/shapeGrouping.d.ts +22 -0
  1912. package/_vendor/plugin-image/_vendor/canvas-core/editor/shapes/shapeOrder.d.ts +32 -0
  1913. package/_vendor/plugin-image/_vendor/canvas-core/editor/shapes/shapeReparenting.d.ts +21 -0
  1914. package/_vendor/plugin-image/_vendor/canvas-core/editor/shapes/shapeSignalManager.d.ts +35 -0
  1915. package/_vendor/plugin-image/_vendor/canvas-core/editor/shapes/shapeTransformSpace.d.ts +6 -0
  1916. package/_vendor/plugin-image/_vendor/canvas-core/editor/shapes/shapeTreeQueries.d.ts +12 -0
  1917. package/_vendor/plugin-image/_vendor/canvas-core/editor/snapping/gapSnap.d.ts +6 -0
  1918. package/_vendor/plugin-image/_vendor/canvas-core/editor/snapping/pointSnap.d.ts +5 -0
  1919. package/_vendor/plugin-image/_vendor/canvas-core/editor/snapping/resizeSnap.d.ts +11 -0
  1920. package/_vendor/plugin-image/_vendor/canvas-core/editor/snapping/snapDecision.d.ts +2 -0
  1921. package/_vendor/plugin-image/_vendor/canvas-core/editor/snapping/snapGeometry.d.ts +26 -0
  1922. package/_vendor/plugin-image/_vendor/canvas-core/editor/snapping/snapIndicators.d.ts +22 -0
  1923. package/_vendor/plugin-image/_vendor/canvas-core/editor/snapping/snapManager.d.ts +54 -0
  1924. package/_vendor/plugin-image/_vendor/canvas-core/editor/snapping/snapResults.d.ts +58 -0
  1925. package/_vendor/plugin-image/_vendor/canvas-core/editor/snapping/snapSnapshotBuilder.d.ts +22 -0
  1926. package/_vendor/plugin-image/_vendor/canvas-core/editor/snapping/snapTypes.d.ts +114 -0
  1927. package/_vendor/plugin-image/_vendor/canvas-core/editor/state/editorReadModels.d.ts +34 -0
  1928. package/_vendor/plugin-image/_vendor/canvas-core/editor/state/editorSignals.d.ts +82 -0
  1929. package/_vendor/plugin-image/_vendor/canvas-core/editor/state/editorStateUtils.d.ts +9 -0
  1930. package/_vendor/plugin-image/_vendor/canvas-core/editor/state/interactionTransientManager.d.ts +35 -0
  1931. package/_vendor/plugin-image/_vendor/canvas-core/editor/viewport/camera.d.ts +3 -0
  1932. package/_vendor/plugin-image/_vendor/canvas-core/editor/viewport/cameraManager.d.ts +56 -0
  1933. package/_vendor/plugin-image/_vendor/canvas-core/editor/viewport/cameraPanSession.d.ts +9 -0
  1934. package/_vendor/plugin-image/_vendor/canvas-core/editor/viewport/edgeScroll.d.ts +5 -0
  1935. package/_vendor/plugin-image/_vendor/canvas-core/editor/viewport/renderWindow.d.ts +30 -0
  1936. package/_vendor/plugin-image/_vendor/canvas-core/editor/viewport/renderWindowManager.d.ts +33 -0
  1937. package/_vendor/plugin-image/_vendor/canvas-core/exports/integrity.d.ts +32 -0
  1938. package/_vendor/plugin-image/_vendor/canvas-core/exports/svg.d.ts +52 -0
  1939. package/_vendor/plugin-image/_vendor/canvas-core/geometry/box.d.ts +20 -0
  1940. package/_vendor/plugin-image/_vendor/canvas-core/geometry/contentCutout.d.ts +8 -0
  1941. package/_vendor/plugin-image/_vendor/canvas-core/geometry/ellipse2d.d.ts +16 -0
  1942. package/_vendor/plugin-image/_vendor/canvas-core/geometry/geometry2d.d.ts +15 -0
  1943. package/_vendor/plugin-image/_vendor/canvas-core/geometry/index.d.ts +9 -0
  1944. package/_vendor/plugin-image/_vendor/canvas-core/geometry/mat.d.ts +31 -0
  1945. package/_vendor/plugin-image/_vendor/canvas-core/geometry/polygon.d.ts +7 -0
  1946. package/_vendor/plugin-image/_vendor/canvas-core/geometry/polyline2d.d.ts +14 -0
  1947. package/_vendor/plugin-image/_vendor/canvas-core/geometry/rectangle2d.d.ts +16 -0
  1948. package/_vendor/plugin-image/_vendor/canvas-core/geometry/segments.d.ts +5 -0
  1949. package/_vendor/plugin-image/_vendor/canvas-core/geometry/vec.d.ts +35 -0
  1950. package/_vendor/plugin-image/_vendor/canvas-core/index.d.ts +64 -0
  1951. package/_vendor/plugin-image/_vendor/canvas-core/plugins/editorRuntimePlugin.d.ts +19 -0
  1952. package/_vendor/plugin-image/_vendor/canvas-core/plugins/editorRuntimeRegistry.d.ts +15 -0
  1953. package/_vendor/plugin-image/_vendor/canvas-core/plugins/index.d.ts +2 -0
  1954. package/_vendor/plugin-image/_vendor/canvas-core/reactivity.d.ts +8 -0
  1955. package/_vendor/plugin-image/_vendor/canvas-core/schema/records.d.ts +115 -0
  1956. package/_vendor/plugin-image/_vendor/canvas-core/schema/snapshots.d.ts +22 -0
  1957. package/_vendor/plugin-image/_vendor/canvas-core/shapes/childTransformPolicy.d.ts +16 -0
  1958. package/_vendor/plugin-image/_vendor/canvas-core/shapes/colors.d.ts +26 -0
  1959. package/_vendor/plugin-image/_vendor/canvas-core/shapes/shapeUtil.d.ts +245 -0
  1960. package/_vendor/plugin-image/_vendor/canvas-core/shapes/shapeUtilGeometry.d.ts +6 -0
  1961. package/_vendor/plugin-image/_vendor/canvas-core/shapes/shapeUtilRegistry.d.ts +9 -0
  1962. package/_vendor/plugin-image/_vendor/canvas-core/shapes/types.d.ts +2 -0
  1963. package/_vendor/plugin-image/_vendor/canvas-core/tools/hand/handTool.d.ts +5 -0
  1964. package/_vendor/plugin-image/_vendor/canvas-core/tools/select/selectContainment.d.ts +12 -0
  1965. package/_vendor/plugin-image/_vendor/canvas-core/tools/select/selectTool.d.ts +5 -0
  1966. package/_vendor/plugin-image/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +170 -0
  1967. package/_vendor/plugin-image/_vendor/canvas-core/tools/select/states/brushingState.d.ts +19 -0
  1968. package/_vendor/plugin-image/_vendor/canvas-core/tools/select/states/draggingPluginInteractionState.d.ts +15 -0
  1969. package/_vendor/plugin-image/_vendor/canvas-core/tools/select/states/idleState.d.ts +8 -0
  1970. package/_vendor/plugin-image/_vendor/canvas-core/tools/select/states/index.d.ts +11 -0
  1971. package/_vendor/plugin-image/_vendor/canvas-core/tools/select/states/pointingCanvasState.d.ts +11 -0
  1972. package/_vendor/plugin-image/_vendor/canvas-core/tools/select/states/pointingResizeHandleState.d.ts +10 -0
  1973. package/_vendor/plugin-image/_vendor/canvas-core/tools/select/states/pointingRotateHandleState.d.ts +10 -0
  1974. package/_vendor/plugin-image/_vendor/canvas-core/tools/select/states/pointingSelectionHandleInteractionState.d.ts +11 -0
  1975. package/_vendor/plugin-image/_vendor/canvas-core/tools/select/states/pointingShapeState.d.ts +12 -0
  1976. package/_vendor/plugin-image/_vendor/canvas-core/tools/select/states/resizingState.d.ts +16 -0
  1977. package/_vendor/plugin-image/_vendor/canvas-core/tools/select/states/rotatingState.d.ts +14 -0
  1978. package/_vendor/plugin-image/_vendor/canvas-core/tools/select/states/selectStateNode.d.ts +60 -0
  1979. package/_vendor/plugin-image/_vendor/canvas-core/tools/select/states/translatingState.d.ts +16 -0
  1980. package/_vendor/plugin-image/_vendor/canvas-core/tools/stateNode.d.ts +30 -0
  1981. package/_vendor/plugin-image/_vendor/canvas-core/tools/toolManager.d.ts +24 -0
  1982. package/_vendor/plugin-image/_vendor/canvas-core/utils/equality.d.ts +9 -0
  1983. package/_vendor/plugin-image/_vendor/canvas-extension-contracts/contributions.d.ts +92 -0
  1984. package/_vendor/plugin-image/_vendor/canvas-extension-contracts/index.d.ts +6 -0
  1985. package/_vendor/plugin-image/_vendor/canvas-extension-contracts/operations.d.ts +131 -0
  1986. package/_vendor/plugin-image/_vendor/canvas-extension-contracts/persistence.d.ts +16 -0
  1987. package/_vendor/plugin-image/_vendor/canvas-extension-contracts/plugin.d.ts +37 -0
  1988. package/_vendor/plugin-image/_vendor/canvas-extension-contracts/shape.d.ts +5 -0
  1989. package/_vendor/plugin-image/_vendor/canvas-extension-contracts/tokens.d.ts +12 -0
  1990. package/_vendor/plugin-image/_vendor/canvas-react/components/CanvasView.d.ts +7 -0
  1991. package/_vendor/plugin-image/_vendor/canvas-react/components/DefaultGrid.d.ts +1 -0
  1992. package/_vendor/plugin-image/_vendor/canvas-react/components/OverlayLayer.d.ts +1 -0
  1993. package/_vendor/plugin-image/_vendor/canvas-react/components/PageSpace.d.ts +6 -0
  1994. package/_vendor/plugin-image/_vendor/canvas-react/components/ShapeLayer.d.ts +1 -0
  1995. package/_vendor/plugin-image/_vendor/canvas-react/components/canvasKeyboardEvents.d.ts +13 -0
  1996. package/_vendor/plugin-image/_vendor/canvas-react/components/index.d.ts +3 -0
  1997. package/_vendor/plugin-image/_vendor/canvas-react/components/overlays/BindingGuide.d.ts +24 -0
  1998. package/_vendor/plugin-image/_vendor/canvas-react/components/overlays/BindingPreviewOverlay.d.ts +1 -0
  1999. package/_vendor/plugin-image/_vendor/canvas-react/components/overlays/BrushBoxOverlay.d.ts +1 -0
  2000. package/_vendor/plugin-image/_vendor/canvas-react/components/overlays/OverlaySvgRoot.d.ts +1 -0
  2001. package/_vendor/plugin-image/_vendor/canvas-react/components/overlays/SelectionFrameOverlay.d.ts +1 -0
  2002. package/_vendor/plugin-image/_vendor/canvas-react/components/overlays/SelectionHandlesOverlay.d.ts +1 -0
  2003. package/_vendor/plugin-image/_vendor/canvas-react/components/overlays/SelectionOverlaySvg.d.ts +1 -0
  2004. package/_vendor/plugin-image/_vendor/canvas-react/components/overlays/SelectionPathOverlay.d.ts +8 -0
  2005. package/_vendor/plugin-image/_vendor/canvas-react/components/overlays/ShapeOutlineOverlay.d.ts +8 -0
  2006. package/_vendor/plugin-image/_vendor/canvas-react/components/overlays/SnapIndicatorsOverlay.d.ts +1 -0
  2007. package/_vendor/plugin-image/_vendor/canvas-react/components/overlays/TerminalBindingGuidesOverlay.d.ts +1 -0
  2008. package/_vendor/plugin-image/_vendor/canvas-react/components/shape-layer/ShapeClipStack.d.ts +11 -0
  2009. package/_vendor/plugin-image/_vendor/canvas-react/components/shape-layer/ShapeDecorations.d.ts +2 -0
  2010. package/_vendor/plugin-image/_vendor/canvas-react/components/shape-layer/ShapeForegroundItem.d.ts +5 -0
  2011. package/_vendor/plugin-image/_vendor/canvas-react/components/shape-layer/ShapeItem.d.ts +5 -0
  2012. package/_vendor/plugin-image/_vendor/canvas-react/components/shape-layer/ShapeRenderList.d.ts +1 -0
  2013. package/_vendor/plugin-image/_vendor/canvas-react/components/shape-layer/ShapeRenderer.d.ts +12 -0
  2014. package/_vendor/plugin-image/_vendor/canvas-react/components/shape-layer/shapeFrame.d.ts +11 -0
  2015. package/_vendor/plugin-image/_vendor/canvas-react/components/useCanvasDomEvents.d.ts +23 -0
  2016. package/_vendor/plugin-image/_vendor/canvas-react/contextMenuRequest.d.ts +19 -0
  2017. package/_vendor/plugin-image/_vendor/canvas-react/dom.d.ts +10 -0
  2018. package/_vendor/plugin-image/_vendor/canvas-react/hooks/useEditor.d.ts +3 -0
  2019. package/_vendor/plugin-image/_vendor/canvas-react/hooks/useValue.d.ts +2 -0
  2020. package/_vendor/plugin-image/_vendor/canvas-react/host/canvasRenderBindings.d.ts +21 -0
  2021. package/_vendor/plugin-image/_vendor/canvas-react/host/canvasRenderBindingsContext.d.ts +5 -0
  2022. package/_vendor/plugin-image/_vendor/canvas-react/host/canvasRenderPlugin.d.ts +81 -0
  2023. package/_vendor/plugin-image/_vendor/canvas-react/host/index.d.ts +5 -0
  2024. package/_vendor/plugin-image/_vendor/canvas-react/index.d.ts +5 -0
  2025. package/_vendor/plugin-image/_vendor/signals/atom.d.ts +11 -0
  2026. package/_vendor/plugin-image/_vendor/signals/computed.d.ts +13 -0
  2027. package/_vendor/plugin-image/_vendor/signals/core.d.ts +35 -0
  2028. package/_vendor/plugin-image/_vendor/signals/effect.d.ts +5 -0
  2029. package/_vendor/plugin-image/_vendor/signals/index.d.ts +8 -0
  2030. package/_vendor/plugin-image/_vendor/signals/types.d.ts +22 -0
  2031. package/_vendor/plugin-image/_vendor/store/diff.d.ts +9 -0
  2032. package/_vendor/plugin-image/_vendor/store/history.d.ts +22 -0
  2033. package/_vendor/plugin-image/_vendor/store/index.d.ts +5 -0
  2034. package/_vendor/plugin-image/_vendor/store/store.d.ts +40 -0
  2035. package/_vendor/plugin-image/_vendor/store/types.d.ts +27 -0
  2036. package/_vendor/plugin-image/host/api.d.ts +61 -0
  2037. package/_vendor/plugin-image/host/asset/blobDataUrl.d.ts +1 -0
  2038. package/_vendor/plugin-image/host/asset/imageAssetOperations.d.ts +44 -0
  2039. package/_vendor/plugin-image/host/asset/imageAssetService.d.ts +17 -0
  2040. package/_vendor/plugin-image/host/asset/imageBlobStore.d.ts +31 -0
  2041. package/_vendor/plugin-image/host/asset/imageFileHelpers.d.ts +47 -0
  2042. package/_vendor/plugin-image/host/asset/indexedDb.d.ts +4 -0
  2043. package/_vendor/plugin-image/host/createImageHostApi.d.ts +15 -0
  2044. package/_vendor/plugin-image/host/export/imageSvgResourceInliner.d.ts +3 -0
  2045. package/_vendor/plugin-image/host/index.d.ts +14 -0
  2046. package/_vendor/plugin-image/host/plugin.d.ts +8 -0
  2047. package/_vendor/plugin-image/host/smudge/confirm.d.ts +10 -0
  2048. package/_vendor/plugin-image/image/api.d.ts +40 -0
  2049. package/_vendor/plugin-image/image/cornerRadius.d.ts +6 -0
  2050. package/_vendor/plugin-image/image/crop/interactions.d.ts +3 -0
  2051. package/_vendor/plugin-image/image/crop/model.d.ts +112 -0
  2052. package/_vendor/plugin-image/image/crop/session.d.ts +6 -0
  2053. package/_vendor/plugin-image/image/editor/imageShapeUtil.d.ts +13 -0
  2054. package/_vendor/plugin-image/image/editor/imageSvgExporter.d.ts +6 -0
  2055. package/_vendor/plugin-image/image/editor/plugin.d.ts +3 -0
  2056. package/_vendor/plugin-image/image/index.d.ts +14 -0
  2057. package/_vendor/plugin-image/image/plugin.d.ts +3 -0
  2058. package/_vendor/plugin-image/image/render/plugin.d.ts +2 -0
  2059. package/_vendor/plugin-image/image/smudge/interactions.d.ts +2 -0
  2060. package/_vendor/plugin-image/image/smudge/session.d.ts +61 -0
  2061. package/_vendor/plugin-image/image/types.d.ts +46 -0
  2062. package/_vendor/plugin-image/index.d.ts +2 -0
  2063. package/_vendor/plugin-laser/_vendor/canvas-core/bindings/bindingManager.d.ts +33 -0
  2064. package/_vendor/plugin-laser/_vendor/canvas-core/bindings/bindingUtil.d.ts +69 -0
  2065. package/_vendor/plugin-laser/_vendor/canvas-core/bindings/bindingUtilRegistry.d.ts +8 -0
  2066. package/_vendor/plugin-laser/_vendor/canvas-core/bindings/terminalBinding.d.ts +28 -0
  2067. package/_vendor/plugin-laser/_vendor/canvas-core/bindings/terminalPorts.d.ts +67 -0
  2068. package/_vendor/plugin-laser/_vendor/canvas-core/editor/clipboard.d.ts +43 -0
  2069. package/_vendor/plugin-laser/_vendor/canvas-core/editor/clipboardAssets.d.ts +6 -0
  2070. package/_vendor/plugin-laser/_vendor/canvas-core/editor/commands/assetCommands.d.ts +7 -0
  2071. package/_vendor/plugin-laser/_vendor/canvas-core/editor/commands/bindingCommands.d.ts +12 -0
  2072. package/_vendor/plugin-laser/_vendor/canvas-core/editor/commands/commandTypes.d.ts +149 -0
  2073. package/_vendor/plugin-laser/_vendor/canvas-core/editor/commands/commands.d.ts +5 -0
  2074. package/_vendor/plugin-laser/_vendor/canvas-core/editor/commands/documentCommands.d.ts +9 -0
  2075. package/_vendor/plugin-laser/_vendor/canvas-core/editor/commands/sessionCommands.d.ts +13 -0
  2076. package/_vendor/plugin-laser/_vendor/canvas-core/editor/commands/shapeCommands.d.ts +9 -0
  2077. package/_vendor/plugin-laser/_vendor/canvas-core/editor/commands/shapeFlags.d.ts +10 -0
  2078. package/_vendor/plugin-laser/_vendor/canvas-core/editor/commands/shapeRemoval.d.ts +10 -0
  2079. package/_vendor/plugin-laser/_vendor/canvas-core/editor/commands/shapeRepair.d.ts +11 -0
  2080. package/_vendor/plugin-laser/_vendor/canvas-core/editor/createEditor.d.ts +6 -0
  2081. package/_vendor/plugin-laser/_vendor/canvas-core/editor/editor.d.ts +356 -0
  2082. package/_vendor/plugin-laser/_vendor/canvas-core/editor/events/canvasNavigationInteraction.d.ts +2 -0
  2083. package/_vendor/plugin-laser/_vendor/canvas-core/editor/events/eventRouter.d.ts +16 -0
  2084. package/_vendor/plugin-laser/_vendor/canvas-core/editor/events/events.d.ts +81 -0
  2085. package/_vendor/plugin-laser/_vendor/canvas-core/editor/events/inputsManager.d.ts +49 -0
  2086. package/_vendor/plugin-laser/_vendor/canvas-core/editor/events/interactions.d.ts +84 -0
  2087. package/_vendor/plugin-laser/_vendor/canvas-core/editor/events/keyboardShortcuts.d.ts +23 -0
  2088. package/_vendor/plugin-laser/_vendor/canvas-core/editor/events/pointerClickRecognizer.d.ts +11 -0
  2089. package/_vendor/plugin-laser/_vendor/canvas-core/editor/history/historyManager.d.ts +40 -0
  2090. package/_vendor/plugin-laser/_vendor/canvas-core/editor/history/operationManager.d.ts +77 -0
  2091. package/_vendor/plugin-laser/_vendor/canvas-core/editor/internal.d.ts +7 -0
  2092. package/_vendor/plugin-laser/_vendor/canvas-core/editor/queries/bindingQueryCache.d.ts +28 -0
  2093. package/_vendor/plugin-laser/_vendor/canvas-core/editor/queries/bindingQueryState.d.ts +11 -0
  2094. package/_vendor/plugin-laser/_vendor/canvas-core/editor/queries/draftBindingIndex.d.ts +19 -0
  2095. package/_vendor/plugin-laser/_vendor/canvas-core/editor/queries/shapeGeometryQueryCache.d.ts +34 -0
  2096. package/_vendor/plugin-laser/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +43 -0
  2097. package/_vendor/plugin-laser/_vendor/canvas-core/editor/queries/shapeTreeIndex.d.ts +27 -0
  2098. package/_vendor/plugin-laser/_vendor/canvas-core/editor/queries/shapeTreeIndexState.d.ts +11 -0
  2099. package/_vendor/plugin-laser/_vendor/canvas-core/editor/queries/spatialIndexManager.d.ts +34 -0
  2100. package/_vendor/plugin-laser/_vendor/canvas-core/editor/records/documentSnapshots.d.ts +14 -0
  2101. package/_vendor/plugin-laser/_vendor/canvas-core/editor/records/editorRecordFactory.d.ts +19 -0
  2102. package/_vendor/plugin-laser/_vendor/canvas-core/editor/records/recordQueries.d.ts +3 -0
  2103. package/_vendor/plugin-laser/_vendor/canvas-core/editor/selection/resizeGeometry.d.ts +117 -0
  2104. package/_vendor/plugin-laser/_vendor/canvas-core/editor/selection/selection.d.ts +223 -0
  2105. package/_vendor/plugin-laser/_vendor/canvas-core/editor/selection/selectionBindingSegments.d.ts +7 -0
  2106. package/_vendor/plugin-laser/_vendor/canvas-core/editor/selection/selectionGeometry.d.ts +28 -0
  2107. package/_vendor/plugin-laser/_vendor/canvas-core/editor/selection/selectionHandleHitTest.d.ts +8 -0
  2108. package/_vendor/plugin-laser/_vendor/canvas-core/editor/selection/selectionLayout.d.ts +20 -0
  2109. package/_vendor/plugin-laser/_vendor/canvas-core/editor/selection/selectionOverlay.d.ts +25 -0
  2110. package/_vendor/plugin-laser/_vendor/canvas-core/editor/selection/selectionOverlayEquality.d.ts +8 -0
  2111. package/_vendor/plugin-laser/_vendor/canvas-core/editor/selection/selectionOverlayManager.d.ts +34 -0
  2112. package/_vendor/plugin-laser/_vendor/canvas-core/editor/selection/selectionResizeCapabilities.d.ts +11 -0
  2113. package/_vendor/plugin-laser/_vendor/canvas-core/editor/selection/selectionSet.d.ts +9 -0
  2114. package/_vendor/plugin-laser/_vendor/canvas-core/editor/selection/selectionTargets.d.ts +10 -0
  2115. package/_vendor/plugin-laser/_vendor/canvas-core/editor/selection/selectionTransforms.d.ts +6 -0
  2116. package/_vendor/plugin-laser/_vendor/canvas-core/editor/shapes/shapeContainment.d.ts +14 -0
  2117. package/_vendor/plugin-laser/_vendor/canvas-core/editor/shapes/shapeEditingManager.d.ts +33 -0
  2118. package/_vendor/plugin-laser/_vendor/canvas-core/editor/shapes/shapeExportTraversal.d.ts +3 -0
  2119. package/_vendor/plugin-laser/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +21 -0
  2120. package/_vendor/plugin-laser/_vendor/canvas-core/editor/shapes/shapeGrouping.d.ts +22 -0
  2121. package/_vendor/plugin-laser/_vendor/canvas-core/editor/shapes/shapeOrder.d.ts +32 -0
  2122. package/_vendor/plugin-laser/_vendor/canvas-core/editor/shapes/shapeReparenting.d.ts +21 -0
  2123. package/_vendor/plugin-laser/_vendor/canvas-core/editor/shapes/shapeSignalManager.d.ts +35 -0
  2124. package/_vendor/plugin-laser/_vendor/canvas-core/editor/shapes/shapeTransformSpace.d.ts +6 -0
  2125. package/_vendor/plugin-laser/_vendor/canvas-core/editor/shapes/shapeTreeQueries.d.ts +12 -0
  2126. package/_vendor/plugin-laser/_vendor/canvas-core/editor/snapping/gapSnap.d.ts +6 -0
  2127. package/_vendor/plugin-laser/_vendor/canvas-core/editor/snapping/pointSnap.d.ts +5 -0
  2128. package/_vendor/plugin-laser/_vendor/canvas-core/editor/snapping/resizeSnap.d.ts +11 -0
  2129. package/_vendor/plugin-laser/_vendor/canvas-core/editor/snapping/snapDecision.d.ts +2 -0
  2130. package/_vendor/plugin-laser/_vendor/canvas-core/editor/snapping/snapGeometry.d.ts +26 -0
  2131. package/_vendor/plugin-laser/_vendor/canvas-core/editor/snapping/snapIndicators.d.ts +22 -0
  2132. package/_vendor/plugin-laser/_vendor/canvas-core/editor/snapping/snapManager.d.ts +54 -0
  2133. package/_vendor/plugin-laser/_vendor/canvas-core/editor/snapping/snapResults.d.ts +58 -0
  2134. package/_vendor/plugin-laser/_vendor/canvas-core/editor/snapping/snapSnapshotBuilder.d.ts +22 -0
  2135. package/_vendor/plugin-laser/_vendor/canvas-core/editor/snapping/snapTypes.d.ts +114 -0
  2136. package/_vendor/plugin-laser/_vendor/canvas-core/editor/state/editorReadModels.d.ts +34 -0
  2137. package/_vendor/plugin-laser/_vendor/canvas-core/editor/state/editorSignals.d.ts +82 -0
  2138. package/_vendor/plugin-laser/_vendor/canvas-core/editor/state/editorStateUtils.d.ts +9 -0
  2139. package/_vendor/plugin-laser/_vendor/canvas-core/editor/state/interactionTransientManager.d.ts +35 -0
  2140. package/_vendor/plugin-laser/_vendor/canvas-core/editor/viewport/camera.d.ts +3 -0
  2141. package/_vendor/plugin-laser/_vendor/canvas-core/editor/viewport/cameraManager.d.ts +56 -0
  2142. package/_vendor/plugin-laser/_vendor/canvas-core/editor/viewport/cameraPanSession.d.ts +9 -0
  2143. package/_vendor/plugin-laser/_vendor/canvas-core/editor/viewport/edgeScroll.d.ts +5 -0
  2144. package/_vendor/plugin-laser/_vendor/canvas-core/editor/viewport/renderWindow.d.ts +30 -0
  2145. package/_vendor/plugin-laser/_vendor/canvas-core/editor/viewport/renderWindowManager.d.ts +33 -0
  2146. package/_vendor/plugin-laser/_vendor/canvas-core/exports/integrity.d.ts +32 -0
  2147. package/_vendor/plugin-laser/_vendor/canvas-core/exports/svg.d.ts +52 -0
  2148. package/_vendor/plugin-laser/_vendor/canvas-core/geometry/box.d.ts +20 -0
  2149. package/_vendor/plugin-laser/_vendor/canvas-core/geometry/contentCutout.d.ts +8 -0
  2150. package/_vendor/plugin-laser/_vendor/canvas-core/geometry/ellipse2d.d.ts +16 -0
  2151. package/_vendor/plugin-laser/_vendor/canvas-core/geometry/geometry2d.d.ts +15 -0
  2152. package/_vendor/plugin-laser/_vendor/canvas-core/geometry/index.d.ts +9 -0
  2153. package/_vendor/plugin-laser/_vendor/canvas-core/geometry/mat.d.ts +31 -0
  2154. package/_vendor/plugin-laser/_vendor/canvas-core/geometry/polygon.d.ts +7 -0
  2155. package/_vendor/plugin-laser/_vendor/canvas-core/geometry/polyline2d.d.ts +14 -0
  2156. package/_vendor/plugin-laser/_vendor/canvas-core/geometry/rectangle2d.d.ts +16 -0
  2157. package/_vendor/plugin-laser/_vendor/canvas-core/geometry/segments.d.ts +5 -0
  2158. package/_vendor/plugin-laser/_vendor/canvas-core/geometry/vec.d.ts +35 -0
  2159. package/_vendor/plugin-laser/_vendor/canvas-core/index.d.ts +64 -0
  2160. package/_vendor/plugin-laser/_vendor/canvas-core/plugins/editorRuntimePlugin.d.ts +19 -0
  2161. package/_vendor/plugin-laser/_vendor/canvas-core/plugins/editorRuntimeRegistry.d.ts +15 -0
  2162. package/_vendor/plugin-laser/_vendor/canvas-core/plugins/index.d.ts +2 -0
  2163. package/_vendor/plugin-laser/_vendor/canvas-core/reactivity.d.ts +8 -0
  2164. package/_vendor/plugin-laser/_vendor/canvas-core/schema/records.d.ts +115 -0
  2165. package/_vendor/plugin-laser/_vendor/canvas-core/schema/snapshots.d.ts +22 -0
  2166. package/_vendor/plugin-laser/_vendor/canvas-core/shapes/childTransformPolicy.d.ts +16 -0
  2167. package/_vendor/plugin-laser/_vendor/canvas-core/shapes/colors.d.ts +26 -0
  2168. package/_vendor/plugin-laser/_vendor/canvas-core/shapes/shapeUtil.d.ts +245 -0
  2169. package/_vendor/plugin-laser/_vendor/canvas-core/shapes/shapeUtilGeometry.d.ts +6 -0
  2170. package/_vendor/plugin-laser/_vendor/canvas-core/shapes/shapeUtilRegistry.d.ts +9 -0
  2171. package/_vendor/plugin-laser/_vendor/canvas-core/shapes/types.d.ts +2 -0
  2172. package/_vendor/plugin-laser/_vendor/canvas-core/tools/hand/handTool.d.ts +5 -0
  2173. package/_vendor/plugin-laser/_vendor/canvas-core/tools/select/selectContainment.d.ts +12 -0
  2174. package/_vendor/plugin-laser/_vendor/canvas-core/tools/select/selectTool.d.ts +5 -0
  2175. package/_vendor/plugin-laser/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +170 -0
  2176. package/_vendor/plugin-laser/_vendor/canvas-core/tools/select/states/brushingState.d.ts +19 -0
  2177. package/_vendor/plugin-laser/_vendor/canvas-core/tools/select/states/draggingPluginInteractionState.d.ts +15 -0
  2178. package/_vendor/plugin-laser/_vendor/canvas-core/tools/select/states/idleState.d.ts +8 -0
  2179. package/_vendor/plugin-laser/_vendor/canvas-core/tools/select/states/index.d.ts +11 -0
  2180. package/_vendor/plugin-laser/_vendor/canvas-core/tools/select/states/pointingCanvasState.d.ts +11 -0
  2181. package/_vendor/plugin-laser/_vendor/canvas-core/tools/select/states/pointingResizeHandleState.d.ts +10 -0
  2182. package/_vendor/plugin-laser/_vendor/canvas-core/tools/select/states/pointingRotateHandleState.d.ts +10 -0
  2183. package/_vendor/plugin-laser/_vendor/canvas-core/tools/select/states/pointingSelectionHandleInteractionState.d.ts +11 -0
  2184. package/_vendor/plugin-laser/_vendor/canvas-core/tools/select/states/pointingShapeState.d.ts +12 -0
  2185. package/_vendor/plugin-laser/_vendor/canvas-core/tools/select/states/resizingState.d.ts +16 -0
  2186. package/_vendor/plugin-laser/_vendor/canvas-core/tools/select/states/rotatingState.d.ts +14 -0
  2187. package/_vendor/plugin-laser/_vendor/canvas-core/tools/select/states/selectStateNode.d.ts +60 -0
  2188. package/_vendor/plugin-laser/_vendor/canvas-core/tools/select/states/translatingState.d.ts +16 -0
  2189. package/_vendor/plugin-laser/_vendor/canvas-core/tools/stateNode.d.ts +30 -0
  2190. package/_vendor/plugin-laser/_vendor/canvas-core/tools/toolManager.d.ts +24 -0
  2191. package/_vendor/plugin-laser/_vendor/canvas-core/utils/equality.d.ts +9 -0
  2192. package/_vendor/plugin-laser/_vendor/canvas-extension-contracts/contributions.d.ts +92 -0
  2193. package/_vendor/plugin-laser/_vendor/canvas-extension-contracts/index.d.ts +6 -0
  2194. package/_vendor/plugin-laser/_vendor/canvas-extension-contracts/operations.d.ts +131 -0
  2195. package/_vendor/plugin-laser/_vendor/canvas-extension-contracts/persistence.d.ts +16 -0
  2196. package/_vendor/plugin-laser/_vendor/canvas-extension-contracts/plugin.d.ts +37 -0
  2197. package/_vendor/plugin-laser/_vendor/canvas-extension-contracts/shape.d.ts +5 -0
  2198. package/_vendor/plugin-laser/_vendor/canvas-extension-contracts/tokens.d.ts +12 -0
  2199. package/_vendor/plugin-laser/_vendor/canvas-react/components/CanvasView.d.ts +7 -0
  2200. package/_vendor/plugin-laser/_vendor/canvas-react/components/DefaultGrid.d.ts +1 -0
  2201. package/_vendor/plugin-laser/_vendor/canvas-react/components/OverlayLayer.d.ts +1 -0
  2202. package/_vendor/plugin-laser/_vendor/canvas-react/components/PageSpace.d.ts +6 -0
  2203. package/_vendor/plugin-laser/_vendor/canvas-react/components/ShapeLayer.d.ts +1 -0
  2204. package/_vendor/plugin-laser/_vendor/canvas-react/components/canvasKeyboardEvents.d.ts +13 -0
  2205. package/_vendor/plugin-laser/_vendor/canvas-react/components/index.d.ts +3 -0
  2206. package/_vendor/plugin-laser/_vendor/canvas-react/components/overlays/BindingGuide.d.ts +24 -0
  2207. package/_vendor/plugin-laser/_vendor/canvas-react/components/overlays/BindingPreviewOverlay.d.ts +1 -0
  2208. package/_vendor/plugin-laser/_vendor/canvas-react/components/overlays/BrushBoxOverlay.d.ts +1 -0
  2209. package/_vendor/plugin-laser/_vendor/canvas-react/components/overlays/OverlaySvgRoot.d.ts +1 -0
  2210. package/_vendor/plugin-laser/_vendor/canvas-react/components/overlays/SelectionFrameOverlay.d.ts +1 -0
  2211. package/_vendor/plugin-laser/_vendor/canvas-react/components/overlays/SelectionHandlesOverlay.d.ts +1 -0
  2212. package/_vendor/plugin-laser/_vendor/canvas-react/components/overlays/SelectionOverlaySvg.d.ts +1 -0
  2213. package/_vendor/plugin-laser/_vendor/canvas-react/components/overlays/SelectionPathOverlay.d.ts +8 -0
  2214. package/_vendor/plugin-laser/_vendor/canvas-react/components/overlays/ShapeOutlineOverlay.d.ts +8 -0
  2215. package/_vendor/plugin-laser/_vendor/canvas-react/components/overlays/SnapIndicatorsOverlay.d.ts +1 -0
  2216. package/_vendor/plugin-laser/_vendor/canvas-react/components/overlays/TerminalBindingGuidesOverlay.d.ts +1 -0
  2217. package/_vendor/plugin-laser/_vendor/canvas-react/components/shape-layer/ShapeClipStack.d.ts +11 -0
  2218. package/_vendor/plugin-laser/_vendor/canvas-react/components/shape-layer/ShapeDecorations.d.ts +2 -0
  2219. package/_vendor/plugin-laser/_vendor/canvas-react/components/shape-layer/ShapeForegroundItem.d.ts +5 -0
  2220. package/_vendor/plugin-laser/_vendor/canvas-react/components/shape-layer/ShapeItem.d.ts +5 -0
  2221. package/_vendor/plugin-laser/_vendor/canvas-react/components/shape-layer/ShapeRenderList.d.ts +1 -0
  2222. package/_vendor/plugin-laser/_vendor/canvas-react/components/shape-layer/ShapeRenderer.d.ts +12 -0
  2223. package/_vendor/plugin-laser/_vendor/canvas-react/components/shape-layer/shapeFrame.d.ts +11 -0
  2224. package/_vendor/plugin-laser/_vendor/canvas-react/components/useCanvasDomEvents.d.ts +23 -0
  2225. package/_vendor/plugin-laser/_vendor/canvas-react/contextMenuRequest.d.ts +19 -0
  2226. package/_vendor/plugin-laser/_vendor/canvas-react/dom.d.ts +10 -0
  2227. package/_vendor/plugin-laser/_vendor/canvas-react/hooks/useEditor.d.ts +3 -0
  2228. package/_vendor/plugin-laser/_vendor/canvas-react/hooks/useValue.d.ts +2 -0
  2229. package/_vendor/plugin-laser/_vendor/canvas-react/host/canvasRenderBindings.d.ts +21 -0
  2230. package/_vendor/plugin-laser/_vendor/canvas-react/host/canvasRenderBindingsContext.d.ts +5 -0
  2231. package/_vendor/plugin-laser/_vendor/canvas-react/host/canvasRenderPlugin.d.ts +81 -0
  2232. package/_vendor/plugin-laser/_vendor/canvas-react/host/index.d.ts +5 -0
  2233. package/_vendor/plugin-laser/_vendor/canvas-react/index.d.ts +5 -0
  2234. package/_vendor/plugin-laser/_vendor/signals/atom.d.ts +11 -0
  2235. package/_vendor/plugin-laser/_vendor/signals/computed.d.ts +13 -0
  2236. package/_vendor/plugin-laser/_vendor/signals/core.d.ts +35 -0
  2237. package/_vendor/plugin-laser/_vendor/signals/effect.d.ts +5 -0
  2238. package/_vendor/plugin-laser/_vendor/signals/index.d.ts +8 -0
  2239. package/_vendor/plugin-laser/_vendor/signals/types.d.ts +22 -0
  2240. package/_vendor/plugin-laser/_vendor/store/diff.d.ts +9 -0
  2241. package/_vendor/plugin-laser/_vendor/store/history.d.ts +22 -0
  2242. package/_vendor/plugin-laser/_vendor/store/index.d.ts +5 -0
  2243. package/_vendor/plugin-laser/_vendor/store/store.d.ts +40 -0
  2244. package/_vendor/plugin-laser/_vendor/store/types.d.ts +27 -0
  2245. package/_vendor/plugin-laser/canvasRender.d.ts +2 -0
  2246. package/_vendor/plugin-laser/editorRuntime.d.ts +2 -0
  2247. package/_vendor/plugin-laser/feature.d.ts +2 -0
  2248. package/_vendor/plugin-laser/index.d.ts +5 -0
  2249. package/_vendor/plugin-laser/laserRuntime.d.ts +18 -0
  2250. package/_vendor/plugin-laser/laserTool.d.ts +4 -0
  2251. package/_vendor/plugin-path/PathDraftOverlay.d.ts +1 -0
  2252. package/_vendor/plugin-path/PathEditInsertPreviewOverlay.d.ts +1 -0
  2253. package/_vendor/plugin-path/PathShapeRenderer.d.ts +15 -0
  2254. package/_vendor/plugin-path/_vendor/canvas-core/bindings/bindingManager.d.ts +33 -0
  2255. package/_vendor/plugin-path/_vendor/canvas-core/bindings/bindingUtil.d.ts +69 -0
  2256. package/_vendor/plugin-path/_vendor/canvas-core/bindings/bindingUtilRegistry.d.ts +8 -0
  2257. package/_vendor/plugin-path/_vendor/canvas-core/bindings/terminalBinding.d.ts +28 -0
  2258. package/_vendor/plugin-path/_vendor/canvas-core/bindings/terminalPorts.d.ts +67 -0
  2259. package/_vendor/plugin-path/_vendor/canvas-core/editor/clipboard.d.ts +43 -0
  2260. package/_vendor/plugin-path/_vendor/canvas-core/editor/clipboardAssets.d.ts +6 -0
  2261. package/_vendor/plugin-path/_vendor/canvas-core/editor/commands/assetCommands.d.ts +7 -0
  2262. package/_vendor/plugin-path/_vendor/canvas-core/editor/commands/bindingCommands.d.ts +12 -0
  2263. package/_vendor/plugin-path/_vendor/canvas-core/editor/commands/commandTypes.d.ts +149 -0
  2264. package/_vendor/plugin-path/_vendor/canvas-core/editor/commands/commands.d.ts +5 -0
  2265. package/_vendor/plugin-path/_vendor/canvas-core/editor/commands/documentCommands.d.ts +9 -0
  2266. package/_vendor/plugin-path/_vendor/canvas-core/editor/commands/sessionCommands.d.ts +13 -0
  2267. package/_vendor/plugin-path/_vendor/canvas-core/editor/commands/shapeCommands.d.ts +9 -0
  2268. package/_vendor/plugin-path/_vendor/canvas-core/editor/commands/shapeFlags.d.ts +10 -0
  2269. package/_vendor/plugin-path/_vendor/canvas-core/editor/commands/shapeRemoval.d.ts +10 -0
  2270. package/_vendor/plugin-path/_vendor/canvas-core/editor/commands/shapeRepair.d.ts +11 -0
  2271. package/_vendor/plugin-path/_vendor/canvas-core/editor/createEditor.d.ts +6 -0
  2272. package/_vendor/plugin-path/_vendor/canvas-core/editor/editor.d.ts +356 -0
  2273. package/_vendor/plugin-path/_vendor/canvas-core/editor/events/canvasNavigationInteraction.d.ts +2 -0
  2274. package/_vendor/plugin-path/_vendor/canvas-core/editor/events/eventRouter.d.ts +16 -0
  2275. package/_vendor/plugin-path/_vendor/canvas-core/editor/events/events.d.ts +81 -0
  2276. package/_vendor/plugin-path/_vendor/canvas-core/editor/events/inputsManager.d.ts +49 -0
  2277. package/_vendor/plugin-path/_vendor/canvas-core/editor/events/interactions.d.ts +84 -0
  2278. package/_vendor/plugin-path/_vendor/canvas-core/editor/events/keyboardShortcuts.d.ts +23 -0
  2279. package/_vendor/plugin-path/_vendor/canvas-core/editor/events/pointerClickRecognizer.d.ts +11 -0
  2280. package/_vendor/plugin-path/_vendor/canvas-core/editor/history/historyManager.d.ts +40 -0
  2281. package/_vendor/plugin-path/_vendor/canvas-core/editor/history/operationManager.d.ts +77 -0
  2282. package/_vendor/plugin-path/_vendor/canvas-core/editor/internal.d.ts +7 -0
  2283. package/_vendor/plugin-path/_vendor/canvas-core/editor/queries/bindingQueryCache.d.ts +28 -0
  2284. package/_vendor/plugin-path/_vendor/canvas-core/editor/queries/bindingQueryState.d.ts +11 -0
  2285. package/_vendor/plugin-path/_vendor/canvas-core/editor/queries/draftBindingIndex.d.ts +19 -0
  2286. package/_vendor/plugin-path/_vendor/canvas-core/editor/queries/shapeGeometryQueryCache.d.ts +34 -0
  2287. package/_vendor/plugin-path/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +43 -0
  2288. package/_vendor/plugin-path/_vendor/canvas-core/editor/queries/shapeTreeIndex.d.ts +27 -0
  2289. package/_vendor/plugin-path/_vendor/canvas-core/editor/queries/shapeTreeIndexState.d.ts +11 -0
  2290. package/_vendor/plugin-path/_vendor/canvas-core/editor/queries/spatialIndexManager.d.ts +34 -0
  2291. package/_vendor/plugin-path/_vendor/canvas-core/editor/records/documentSnapshots.d.ts +14 -0
  2292. package/_vendor/plugin-path/_vendor/canvas-core/editor/records/editorRecordFactory.d.ts +19 -0
  2293. package/_vendor/plugin-path/_vendor/canvas-core/editor/records/recordQueries.d.ts +3 -0
  2294. package/_vendor/plugin-path/_vendor/canvas-core/editor/selection/resizeGeometry.d.ts +117 -0
  2295. package/_vendor/plugin-path/_vendor/canvas-core/editor/selection/selection.d.ts +223 -0
  2296. package/_vendor/plugin-path/_vendor/canvas-core/editor/selection/selectionBindingSegments.d.ts +7 -0
  2297. package/_vendor/plugin-path/_vendor/canvas-core/editor/selection/selectionGeometry.d.ts +28 -0
  2298. package/_vendor/plugin-path/_vendor/canvas-core/editor/selection/selectionHandleHitTest.d.ts +8 -0
  2299. package/_vendor/plugin-path/_vendor/canvas-core/editor/selection/selectionLayout.d.ts +20 -0
  2300. package/_vendor/plugin-path/_vendor/canvas-core/editor/selection/selectionOverlay.d.ts +25 -0
  2301. package/_vendor/plugin-path/_vendor/canvas-core/editor/selection/selectionOverlayEquality.d.ts +8 -0
  2302. package/_vendor/plugin-path/_vendor/canvas-core/editor/selection/selectionOverlayManager.d.ts +34 -0
  2303. package/_vendor/plugin-path/_vendor/canvas-core/editor/selection/selectionResizeCapabilities.d.ts +11 -0
  2304. package/_vendor/plugin-path/_vendor/canvas-core/editor/selection/selectionSet.d.ts +9 -0
  2305. package/_vendor/plugin-path/_vendor/canvas-core/editor/selection/selectionTargets.d.ts +10 -0
  2306. package/_vendor/plugin-path/_vendor/canvas-core/editor/selection/selectionTransforms.d.ts +6 -0
  2307. package/_vendor/plugin-path/_vendor/canvas-core/editor/shapes/shapeContainment.d.ts +14 -0
  2308. package/_vendor/plugin-path/_vendor/canvas-core/editor/shapes/shapeEditingManager.d.ts +33 -0
  2309. package/_vendor/plugin-path/_vendor/canvas-core/editor/shapes/shapeExportTraversal.d.ts +3 -0
  2310. package/_vendor/plugin-path/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +21 -0
  2311. package/_vendor/plugin-path/_vendor/canvas-core/editor/shapes/shapeGrouping.d.ts +22 -0
  2312. package/_vendor/plugin-path/_vendor/canvas-core/editor/shapes/shapeOrder.d.ts +32 -0
  2313. package/_vendor/plugin-path/_vendor/canvas-core/editor/shapes/shapeReparenting.d.ts +21 -0
  2314. package/_vendor/plugin-path/_vendor/canvas-core/editor/shapes/shapeSignalManager.d.ts +35 -0
  2315. package/_vendor/plugin-path/_vendor/canvas-core/editor/shapes/shapeTransformSpace.d.ts +6 -0
  2316. package/_vendor/plugin-path/_vendor/canvas-core/editor/shapes/shapeTreeQueries.d.ts +12 -0
  2317. package/_vendor/plugin-path/_vendor/canvas-core/editor/snapping/gapSnap.d.ts +6 -0
  2318. package/_vendor/plugin-path/_vendor/canvas-core/editor/snapping/pointSnap.d.ts +5 -0
  2319. package/_vendor/plugin-path/_vendor/canvas-core/editor/snapping/resizeSnap.d.ts +11 -0
  2320. package/_vendor/plugin-path/_vendor/canvas-core/editor/snapping/snapDecision.d.ts +2 -0
  2321. package/_vendor/plugin-path/_vendor/canvas-core/editor/snapping/snapGeometry.d.ts +26 -0
  2322. package/_vendor/plugin-path/_vendor/canvas-core/editor/snapping/snapIndicators.d.ts +22 -0
  2323. package/_vendor/plugin-path/_vendor/canvas-core/editor/snapping/snapManager.d.ts +54 -0
  2324. package/_vendor/plugin-path/_vendor/canvas-core/editor/snapping/snapResults.d.ts +58 -0
  2325. package/_vendor/plugin-path/_vendor/canvas-core/editor/snapping/snapSnapshotBuilder.d.ts +22 -0
  2326. package/_vendor/plugin-path/_vendor/canvas-core/editor/snapping/snapTypes.d.ts +114 -0
  2327. package/_vendor/plugin-path/_vendor/canvas-core/editor/state/editorReadModels.d.ts +34 -0
  2328. package/_vendor/plugin-path/_vendor/canvas-core/editor/state/editorSignals.d.ts +82 -0
  2329. package/_vendor/plugin-path/_vendor/canvas-core/editor/state/editorStateUtils.d.ts +9 -0
  2330. package/_vendor/plugin-path/_vendor/canvas-core/editor/state/interactionTransientManager.d.ts +35 -0
  2331. package/_vendor/plugin-path/_vendor/canvas-core/editor/viewport/camera.d.ts +3 -0
  2332. package/_vendor/plugin-path/_vendor/canvas-core/editor/viewport/cameraManager.d.ts +56 -0
  2333. package/_vendor/plugin-path/_vendor/canvas-core/editor/viewport/cameraPanSession.d.ts +9 -0
  2334. package/_vendor/plugin-path/_vendor/canvas-core/editor/viewport/edgeScroll.d.ts +5 -0
  2335. package/_vendor/plugin-path/_vendor/canvas-core/editor/viewport/renderWindow.d.ts +30 -0
  2336. package/_vendor/plugin-path/_vendor/canvas-core/editor/viewport/renderWindowManager.d.ts +33 -0
  2337. package/_vendor/plugin-path/_vendor/canvas-core/exports/integrity.d.ts +32 -0
  2338. package/_vendor/plugin-path/_vendor/canvas-core/exports/svg.d.ts +52 -0
  2339. package/_vendor/plugin-path/_vendor/canvas-core/geometry/box.d.ts +20 -0
  2340. package/_vendor/plugin-path/_vendor/canvas-core/geometry/contentCutout.d.ts +8 -0
  2341. package/_vendor/plugin-path/_vendor/canvas-core/geometry/ellipse2d.d.ts +16 -0
  2342. package/_vendor/plugin-path/_vendor/canvas-core/geometry/geometry2d.d.ts +15 -0
  2343. package/_vendor/plugin-path/_vendor/canvas-core/geometry/index.d.ts +9 -0
  2344. package/_vendor/plugin-path/_vendor/canvas-core/geometry/mat.d.ts +31 -0
  2345. package/_vendor/plugin-path/_vendor/canvas-core/geometry/polygon.d.ts +7 -0
  2346. package/_vendor/plugin-path/_vendor/canvas-core/geometry/polyline2d.d.ts +14 -0
  2347. package/_vendor/plugin-path/_vendor/canvas-core/geometry/rectangle2d.d.ts +16 -0
  2348. package/_vendor/plugin-path/_vendor/canvas-core/geometry/segments.d.ts +5 -0
  2349. package/_vendor/plugin-path/_vendor/canvas-core/geometry/vec.d.ts +35 -0
  2350. package/_vendor/plugin-path/_vendor/canvas-core/index.d.ts +64 -0
  2351. package/_vendor/plugin-path/_vendor/canvas-core/plugins/editorRuntimePlugin.d.ts +19 -0
  2352. package/_vendor/plugin-path/_vendor/canvas-core/plugins/editorRuntimeRegistry.d.ts +15 -0
  2353. package/_vendor/plugin-path/_vendor/canvas-core/plugins/index.d.ts +2 -0
  2354. package/_vendor/plugin-path/_vendor/canvas-core/reactivity.d.ts +8 -0
  2355. package/_vendor/plugin-path/_vendor/canvas-core/schema/records.d.ts +115 -0
  2356. package/_vendor/plugin-path/_vendor/canvas-core/schema/snapshots.d.ts +22 -0
  2357. package/_vendor/plugin-path/_vendor/canvas-core/shapes/childTransformPolicy.d.ts +16 -0
  2358. package/_vendor/plugin-path/_vendor/canvas-core/shapes/colors.d.ts +26 -0
  2359. package/_vendor/plugin-path/_vendor/canvas-core/shapes/shapeUtil.d.ts +245 -0
  2360. package/_vendor/plugin-path/_vendor/canvas-core/shapes/shapeUtilGeometry.d.ts +6 -0
  2361. package/_vendor/plugin-path/_vendor/canvas-core/shapes/shapeUtilRegistry.d.ts +9 -0
  2362. package/_vendor/plugin-path/_vendor/canvas-core/shapes/types.d.ts +2 -0
  2363. package/_vendor/plugin-path/_vendor/canvas-core/tools/hand/handTool.d.ts +5 -0
  2364. package/_vendor/plugin-path/_vendor/canvas-core/tools/select/selectContainment.d.ts +12 -0
  2365. package/_vendor/plugin-path/_vendor/canvas-core/tools/select/selectTool.d.ts +5 -0
  2366. package/_vendor/plugin-path/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +170 -0
  2367. package/_vendor/plugin-path/_vendor/canvas-core/tools/select/states/brushingState.d.ts +19 -0
  2368. package/_vendor/plugin-path/_vendor/canvas-core/tools/select/states/draggingPluginInteractionState.d.ts +15 -0
  2369. package/_vendor/plugin-path/_vendor/canvas-core/tools/select/states/idleState.d.ts +8 -0
  2370. package/_vendor/plugin-path/_vendor/canvas-core/tools/select/states/index.d.ts +11 -0
  2371. package/_vendor/plugin-path/_vendor/canvas-core/tools/select/states/pointingCanvasState.d.ts +11 -0
  2372. package/_vendor/plugin-path/_vendor/canvas-core/tools/select/states/pointingResizeHandleState.d.ts +10 -0
  2373. package/_vendor/plugin-path/_vendor/canvas-core/tools/select/states/pointingRotateHandleState.d.ts +10 -0
  2374. package/_vendor/plugin-path/_vendor/canvas-core/tools/select/states/pointingSelectionHandleInteractionState.d.ts +11 -0
  2375. package/_vendor/plugin-path/_vendor/canvas-core/tools/select/states/pointingShapeState.d.ts +12 -0
  2376. package/_vendor/plugin-path/_vendor/canvas-core/tools/select/states/resizingState.d.ts +16 -0
  2377. package/_vendor/plugin-path/_vendor/canvas-core/tools/select/states/rotatingState.d.ts +14 -0
  2378. package/_vendor/plugin-path/_vendor/canvas-core/tools/select/states/selectStateNode.d.ts +60 -0
  2379. package/_vendor/plugin-path/_vendor/canvas-core/tools/select/states/translatingState.d.ts +16 -0
  2380. package/_vendor/plugin-path/_vendor/canvas-core/tools/stateNode.d.ts +30 -0
  2381. package/_vendor/plugin-path/_vendor/canvas-core/tools/toolManager.d.ts +24 -0
  2382. package/_vendor/plugin-path/_vendor/canvas-core/utils/equality.d.ts +9 -0
  2383. package/_vendor/plugin-path/_vendor/canvas-extension-contracts/contributions.d.ts +92 -0
  2384. package/_vendor/plugin-path/_vendor/canvas-extension-contracts/index.d.ts +6 -0
  2385. package/_vendor/plugin-path/_vendor/canvas-extension-contracts/operations.d.ts +131 -0
  2386. package/_vendor/plugin-path/_vendor/canvas-extension-contracts/persistence.d.ts +16 -0
  2387. package/_vendor/plugin-path/_vendor/canvas-extension-contracts/plugin.d.ts +37 -0
  2388. package/_vendor/plugin-path/_vendor/canvas-extension-contracts/shape.d.ts +5 -0
  2389. package/_vendor/plugin-path/_vendor/canvas-extension-contracts/tokens.d.ts +12 -0
  2390. package/_vendor/plugin-path/_vendor/canvas-react/components/CanvasView.d.ts +7 -0
  2391. package/_vendor/plugin-path/_vendor/canvas-react/components/DefaultGrid.d.ts +1 -0
  2392. package/_vendor/plugin-path/_vendor/canvas-react/components/OverlayLayer.d.ts +1 -0
  2393. package/_vendor/plugin-path/_vendor/canvas-react/components/PageSpace.d.ts +6 -0
  2394. package/_vendor/plugin-path/_vendor/canvas-react/components/ShapeLayer.d.ts +1 -0
  2395. package/_vendor/plugin-path/_vendor/canvas-react/components/canvasKeyboardEvents.d.ts +13 -0
  2396. package/_vendor/plugin-path/_vendor/canvas-react/components/index.d.ts +3 -0
  2397. package/_vendor/plugin-path/_vendor/canvas-react/components/overlays/BindingGuide.d.ts +24 -0
  2398. package/_vendor/plugin-path/_vendor/canvas-react/components/overlays/BindingPreviewOverlay.d.ts +1 -0
  2399. package/_vendor/plugin-path/_vendor/canvas-react/components/overlays/BrushBoxOverlay.d.ts +1 -0
  2400. package/_vendor/plugin-path/_vendor/canvas-react/components/overlays/OverlaySvgRoot.d.ts +1 -0
  2401. package/_vendor/plugin-path/_vendor/canvas-react/components/overlays/SelectionFrameOverlay.d.ts +1 -0
  2402. package/_vendor/plugin-path/_vendor/canvas-react/components/overlays/SelectionHandlesOverlay.d.ts +1 -0
  2403. package/_vendor/plugin-path/_vendor/canvas-react/components/overlays/SelectionOverlaySvg.d.ts +1 -0
  2404. package/_vendor/plugin-path/_vendor/canvas-react/components/overlays/SelectionPathOverlay.d.ts +8 -0
  2405. package/_vendor/plugin-path/_vendor/canvas-react/components/overlays/ShapeOutlineOverlay.d.ts +8 -0
  2406. package/_vendor/plugin-path/_vendor/canvas-react/components/overlays/SnapIndicatorsOverlay.d.ts +1 -0
  2407. package/_vendor/plugin-path/_vendor/canvas-react/components/overlays/TerminalBindingGuidesOverlay.d.ts +1 -0
  2408. package/_vendor/plugin-path/_vendor/canvas-react/components/shape-layer/ShapeClipStack.d.ts +11 -0
  2409. package/_vendor/plugin-path/_vendor/canvas-react/components/shape-layer/ShapeDecorations.d.ts +2 -0
  2410. package/_vendor/plugin-path/_vendor/canvas-react/components/shape-layer/ShapeForegroundItem.d.ts +5 -0
  2411. package/_vendor/plugin-path/_vendor/canvas-react/components/shape-layer/ShapeItem.d.ts +5 -0
  2412. package/_vendor/plugin-path/_vendor/canvas-react/components/shape-layer/ShapeRenderList.d.ts +1 -0
  2413. package/_vendor/plugin-path/_vendor/canvas-react/components/shape-layer/ShapeRenderer.d.ts +12 -0
  2414. package/_vendor/plugin-path/_vendor/canvas-react/components/shape-layer/shapeFrame.d.ts +11 -0
  2415. package/_vendor/plugin-path/_vendor/canvas-react/components/useCanvasDomEvents.d.ts +23 -0
  2416. package/_vendor/plugin-path/_vendor/canvas-react/contextMenuRequest.d.ts +19 -0
  2417. package/_vendor/plugin-path/_vendor/canvas-react/dom.d.ts +10 -0
  2418. package/_vendor/plugin-path/_vendor/canvas-react/hooks/useEditor.d.ts +3 -0
  2419. package/_vendor/plugin-path/_vendor/canvas-react/hooks/useValue.d.ts +2 -0
  2420. package/_vendor/plugin-path/_vendor/canvas-react/host/canvasRenderBindings.d.ts +21 -0
  2421. package/_vendor/plugin-path/_vendor/canvas-react/host/canvasRenderBindingsContext.d.ts +5 -0
  2422. package/_vendor/plugin-path/_vendor/canvas-react/host/canvasRenderPlugin.d.ts +81 -0
  2423. package/_vendor/plugin-path/_vendor/canvas-react/host/index.d.ts +5 -0
  2424. package/_vendor/plugin-path/_vendor/canvas-react/index.d.ts +5 -0
  2425. package/_vendor/plugin-path/_vendor/signals/atom.d.ts +11 -0
  2426. package/_vendor/plugin-path/_vendor/signals/computed.d.ts +13 -0
  2427. package/_vendor/plugin-path/_vendor/signals/core.d.ts +35 -0
  2428. package/_vendor/plugin-path/_vendor/signals/effect.d.ts +5 -0
  2429. package/_vendor/plugin-path/_vendor/signals/index.d.ts +8 -0
  2430. package/_vendor/plugin-path/_vendor/signals/types.d.ts +22 -0
  2431. package/_vendor/plugin-path/_vendor/store/diff.d.ts +9 -0
  2432. package/_vendor/plugin-path/_vendor/store/history.d.ts +22 -0
  2433. package/_vendor/plugin-path/_vendor/store/index.d.ts +5 -0
  2434. package/_vendor/plugin-path/_vendor/store/store.d.ts +40 -0
  2435. package/_vendor/plugin-path/_vendor/store/types.d.ts +27 -0
  2436. package/_vendor/plugin-path/api.d.ts +37 -0
  2437. package/_vendor/plugin-path/canvasRender.d.ts +2 -0
  2438. package/_vendor/plugin-path/editorRuntime.d.ts +7 -0
  2439. package/_vendor/plugin-path/feature.d.ts +3 -0
  2440. package/_vendor/plugin-path/index.d.ts +11 -0
  2441. package/_vendor/plugin-path/pathBoolean.d.ts +13 -0
  2442. package/_vendor/plugin-path/pathDraft.d.ts +10 -0
  2443. package/_vendor/plugin-path/pathEditPreview.d.ts +11 -0
  2444. package/_vendor/plugin-path/pathEditSelection.d.ts +24 -0
  2445. package/_vendor/plugin-path/pathEditSnap.d.ts +6 -0
  2446. package/_vendor/plugin-path/pathGeometry.d.ts +74 -0
  2447. package/_vendor/plugin-path/pathHandles.d.ts +18 -0
  2448. package/_vendor/plugin-path/pathHistory.d.ts +13 -0
  2449. package/_vendor/plugin-path/pathInteractions.d.ts +7 -0
  2450. package/_vendor/plugin-path/pathShapeUtil.d.ts +30 -0
  2451. package/_vendor/plugin-path/pathSvg.d.ts +3 -0
  2452. package/_vendor/plugin-path/pathTool.d.ts +43 -0
  2453. package/_vendor/plugin-path/types.d.ts +36 -0
  2454. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/bindings/bindingManager.d.ts +33 -0
  2455. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/bindings/bindingUtil.d.ts +69 -0
  2456. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/bindings/bindingUtilRegistry.d.ts +8 -0
  2457. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/bindings/terminalBinding.d.ts +28 -0
  2458. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/bindings/terminalPorts.d.ts +67 -0
  2459. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/clipboard.d.ts +43 -0
  2460. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/clipboardAssets.d.ts +6 -0
  2461. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/commands/assetCommands.d.ts +7 -0
  2462. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/commands/bindingCommands.d.ts +12 -0
  2463. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/commands/commandTypes.d.ts +149 -0
  2464. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/commands/commands.d.ts +5 -0
  2465. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/commands/documentCommands.d.ts +9 -0
  2466. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/commands/sessionCommands.d.ts +13 -0
  2467. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/commands/shapeCommands.d.ts +9 -0
  2468. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/commands/shapeFlags.d.ts +10 -0
  2469. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/commands/shapeRemoval.d.ts +10 -0
  2470. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/commands/shapeRepair.d.ts +11 -0
  2471. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/createEditor.d.ts +6 -0
  2472. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/editor.d.ts +356 -0
  2473. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/events/canvasNavigationInteraction.d.ts +2 -0
  2474. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/events/eventRouter.d.ts +16 -0
  2475. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/events/events.d.ts +81 -0
  2476. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/events/inputsManager.d.ts +49 -0
  2477. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/events/interactions.d.ts +84 -0
  2478. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/events/keyboardShortcuts.d.ts +23 -0
  2479. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/events/pointerClickRecognizer.d.ts +11 -0
  2480. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/history/historyManager.d.ts +40 -0
  2481. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/history/operationManager.d.ts +77 -0
  2482. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/internal.d.ts +7 -0
  2483. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/queries/bindingQueryCache.d.ts +28 -0
  2484. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/queries/bindingQueryState.d.ts +11 -0
  2485. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/queries/draftBindingIndex.d.ts +19 -0
  2486. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/queries/shapeGeometryQueryCache.d.ts +34 -0
  2487. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +43 -0
  2488. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/queries/shapeTreeIndex.d.ts +27 -0
  2489. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/queries/shapeTreeIndexState.d.ts +11 -0
  2490. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/queries/spatialIndexManager.d.ts +34 -0
  2491. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/records/documentSnapshots.d.ts +14 -0
  2492. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/records/editorRecordFactory.d.ts +19 -0
  2493. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/records/recordQueries.d.ts +3 -0
  2494. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/selection/resizeGeometry.d.ts +117 -0
  2495. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/selection/selection.d.ts +223 -0
  2496. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/selection/selectionBindingSegments.d.ts +7 -0
  2497. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/selection/selectionGeometry.d.ts +28 -0
  2498. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/selection/selectionHandleHitTest.d.ts +8 -0
  2499. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/selection/selectionLayout.d.ts +20 -0
  2500. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/selection/selectionOverlay.d.ts +25 -0
  2501. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/selection/selectionOverlayEquality.d.ts +8 -0
  2502. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/selection/selectionOverlayManager.d.ts +34 -0
  2503. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/selection/selectionResizeCapabilities.d.ts +11 -0
  2504. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/selection/selectionSet.d.ts +9 -0
  2505. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/selection/selectionTargets.d.ts +10 -0
  2506. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/selection/selectionTransforms.d.ts +6 -0
  2507. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/shapes/shapeContainment.d.ts +14 -0
  2508. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/shapes/shapeEditingManager.d.ts +33 -0
  2509. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/shapes/shapeExportTraversal.d.ts +3 -0
  2510. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +21 -0
  2511. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/shapes/shapeGrouping.d.ts +22 -0
  2512. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/shapes/shapeOrder.d.ts +32 -0
  2513. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/shapes/shapeReparenting.d.ts +21 -0
  2514. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/shapes/shapeSignalManager.d.ts +35 -0
  2515. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/shapes/shapeTransformSpace.d.ts +6 -0
  2516. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/shapes/shapeTreeQueries.d.ts +12 -0
  2517. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/snapping/gapSnap.d.ts +6 -0
  2518. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/snapping/pointSnap.d.ts +5 -0
  2519. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/snapping/resizeSnap.d.ts +11 -0
  2520. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/snapping/snapDecision.d.ts +2 -0
  2521. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/snapping/snapGeometry.d.ts +26 -0
  2522. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/snapping/snapIndicators.d.ts +22 -0
  2523. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/snapping/snapManager.d.ts +54 -0
  2524. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/snapping/snapResults.d.ts +58 -0
  2525. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/snapping/snapSnapshotBuilder.d.ts +22 -0
  2526. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/snapping/snapTypes.d.ts +114 -0
  2527. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/state/editorReadModels.d.ts +34 -0
  2528. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/state/editorSignals.d.ts +82 -0
  2529. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/state/editorStateUtils.d.ts +9 -0
  2530. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/state/interactionTransientManager.d.ts +35 -0
  2531. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/viewport/camera.d.ts +3 -0
  2532. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/viewport/cameraManager.d.ts +56 -0
  2533. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/viewport/cameraPanSession.d.ts +9 -0
  2534. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/viewport/edgeScroll.d.ts +5 -0
  2535. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/viewport/renderWindow.d.ts +30 -0
  2536. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/editor/viewport/renderWindowManager.d.ts +33 -0
  2537. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/exports/integrity.d.ts +32 -0
  2538. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/exports/svg.d.ts +52 -0
  2539. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/geometry/box.d.ts +20 -0
  2540. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/geometry/contentCutout.d.ts +8 -0
  2541. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/geometry/ellipse2d.d.ts +16 -0
  2542. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/geometry/geometry2d.d.ts +15 -0
  2543. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/geometry/index.d.ts +9 -0
  2544. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/geometry/mat.d.ts +31 -0
  2545. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/geometry/polygon.d.ts +7 -0
  2546. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/geometry/polyline2d.d.ts +14 -0
  2547. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/geometry/rectangle2d.d.ts +16 -0
  2548. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/geometry/segments.d.ts +5 -0
  2549. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/geometry/vec.d.ts +35 -0
  2550. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/index.d.ts +64 -0
  2551. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/plugins/editorRuntimePlugin.d.ts +19 -0
  2552. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/plugins/editorRuntimeRegistry.d.ts +15 -0
  2553. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/plugins/index.d.ts +2 -0
  2554. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/reactivity.d.ts +8 -0
  2555. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/schema/records.d.ts +115 -0
  2556. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/schema/snapshots.d.ts +22 -0
  2557. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/shapes/childTransformPolicy.d.ts +16 -0
  2558. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/shapes/colors.d.ts +26 -0
  2559. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/shapes/shapeUtil.d.ts +245 -0
  2560. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/shapes/shapeUtilGeometry.d.ts +6 -0
  2561. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/shapes/shapeUtilRegistry.d.ts +9 -0
  2562. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/shapes/types.d.ts +2 -0
  2563. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/tools/hand/handTool.d.ts +5 -0
  2564. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/tools/select/selectContainment.d.ts +12 -0
  2565. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/tools/select/selectTool.d.ts +5 -0
  2566. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +170 -0
  2567. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/tools/select/states/brushingState.d.ts +19 -0
  2568. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/tools/select/states/draggingPluginInteractionState.d.ts +15 -0
  2569. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/tools/select/states/idleState.d.ts +8 -0
  2570. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/tools/select/states/index.d.ts +11 -0
  2571. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/tools/select/states/pointingCanvasState.d.ts +11 -0
  2572. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/tools/select/states/pointingResizeHandleState.d.ts +10 -0
  2573. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/tools/select/states/pointingRotateHandleState.d.ts +10 -0
  2574. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/tools/select/states/pointingSelectionHandleInteractionState.d.ts +11 -0
  2575. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/tools/select/states/pointingShapeState.d.ts +12 -0
  2576. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/tools/select/states/resizingState.d.ts +16 -0
  2577. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/tools/select/states/rotatingState.d.ts +14 -0
  2578. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/tools/select/states/selectStateNode.d.ts +60 -0
  2579. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/tools/select/states/translatingState.d.ts +16 -0
  2580. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/tools/stateNode.d.ts +30 -0
  2581. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/tools/toolManager.d.ts +24 -0
  2582. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-core/utils/equality.d.ts +9 -0
  2583. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-extension-contracts/contributions.d.ts +92 -0
  2584. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-extension-contracts/index.d.ts +6 -0
  2585. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-extension-contracts/operations.d.ts +131 -0
  2586. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-extension-contracts/persistence.d.ts +16 -0
  2587. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-extension-contracts/plugin.d.ts +37 -0
  2588. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-extension-contracts/shape.d.ts +5 -0
  2589. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-extension-contracts/tokens.d.ts +12 -0
  2590. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/CanvasView.d.ts +7 -0
  2591. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/DefaultGrid.d.ts +1 -0
  2592. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/OverlayLayer.d.ts +1 -0
  2593. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/PageSpace.d.ts +6 -0
  2594. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/ShapeLayer.d.ts +1 -0
  2595. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/canvasKeyboardEvents.d.ts +13 -0
  2596. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/index.d.ts +3 -0
  2597. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/overlays/BindingGuide.d.ts +24 -0
  2598. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/overlays/BindingPreviewOverlay.d.ts +1 -0
  2599. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/overlays/BrushBoxOverlay.d.ts +1 -0
  2600. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/overlays/OverlaySvgRoot.d.ts +1 -0
  2601. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/overlays/SelectionFrameOverlay.d.ts +1 -0
  2602. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/overlays/SelectionHandlesOverlay.d.ts +1 -0
  2603. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/overlays/SelectionOverlaySvg.d.ts +1 -0
  2604. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/overlays/SelectionPathOverlay.d.ts +8 -0
  2605. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/overlays/ShapeOutlineOverlay.d.ts +8 -0
  2606. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/overlays/SnapIndicatorsOverlay.d.ts +1 -0
  2607. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/overlays/TerminalBindingGuidesOverlay.d.ts +1 -0
  2608. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/shape-layer/ShapeClipStack.d.ts +11 -0
  2609. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/shape-layer/ShapeDecorations.d.ts +2 -0
  2610. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/shape-layer/ShapeForegroundItem.d.ts +5 -0
  2611. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/shape-layer/ShapeItem.d.ts +5 -0
  2612. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/shape-layer/ShapeRenderList.d.ts +1 -0
  2613. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/shape-layer/ShapeRenderer.d.ts +12 -0
  2614. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/shape-layer/shapeFrame.d.ts +11 -0
  2615. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/components/useCanvasDomEvents.d.ts +23 -0
  2616. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/contextMenuRequest.d.ts +19 -0
  2617. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/dom.d.ts +10 -0
  2618. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/hooks/useEditor.d.ts +3 -0
  2619. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/hooks/useValue.d.ts +2 -0
  2620. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/host/canvasRenderBindings.d.ts +21 -0
  2621. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/host/canvasRenderBindingsContext.d.ts +5 -0
  2622. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/host/canvasRenderPlugin.d.ts +81 -0
  2623. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/host/index.d.ts +5 -0
  2624. package/_vendor/plugin-runtime-clipboard/_vendor/canvas-react/index.d.ts +5 -0
  2625. package/_vendor/plugin-runtime-clipboard/_vendor/signals/atom.d.ts +11 -0
  2626. package/_vendor/plugin-runtime-clipboard/_vendor/signals/computed.d.ts +13 -0
  2627. package/_vendor/plugin-runtime-clipboard/_vendor/signals/core.d.ts +35 -0
  2628. package/_vendor/plugin-runtime-clipboard/_vendor/signals/effect.d.ts +5 -0
  2629. package/_vendor/plugin-runtime-clipboard/_vendor/signals/index.d.ts +8 -0
  2630. package/_vendor/plugin-runtime-clipboard/_vendor/signals/types.d.ts +22 -0
  2631. package/_vendor/plugin-runtime-clipboard/_vendor/store/diff.d.ts +9 -0
  2632. package/_vendor/plugin-runtime-clipboard/_vendor/store/history.d.ts +22 -0
  2633. package/_vendor/plugin-runtime-clipboard/_vendor/store/index.d.ts +5 -0
  2634. package/_vendor/plugin-runtime-clipboard/_vendor/store/store.d.ts +40 -0
  2635. package/_vendor/plugin-runtime-clipboard/_vendor/store/types.d.ts +27 -0
  2636. package/_vendor/plugin-runtime-clipboard/api.d.ts +21 -0
  2637. package/_vendor/plugin-runtime-clipboard/clipboardService.d.ts +12 -0
  2638. package/_vendor/plugin-runtime-clipboard/index.d.ts +3 -0
  2639. package/_vendor/plugin-runtime-clipboard/plugin.d.ts +8 -0
  2640. package/_vendor/plugin-runtime-export/_vendor/canvas-core/bindings/bindingManager.d.ts +33 -0
  2641. package/_vendor/plugin-runtime-export/_vendor/canvas-core/bindings/bindingUtil.d.ts +69 -0
  2642. package/_vendor/plugin-runtime-export/_vendor/canvas-core/bindings/bindingUtilRegistry.d.ts +8 -0
  2643. package/_vendor/plugin-runtime-export/_vendor/canvas-core/bindings/terminalBinding.d.ts +28 -0
  2644. package/_vendor/plugin-runtime-export/_vendor/canvas-core/bindings/terminalPorts.d.ts +67 -0
  2645. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/clipboard.d.ts +43 -0
  2646. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/clipboardAssets.d.ts +6 -0
  2647. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/commands/assetCommands.d.ts +7 -0
  2648. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/commands/bindingCommands.d.ts +12 -0
  2649. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/commands/commandTypes.d.ts +149 -0
  2650. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/commands/commands.d.ts +5 -0
  2651. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/commands/documentCommands.d.ts +9 -0
  2652. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/commands/sessionCommands.d.ts +13 -0
  2653. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/commands/shapeCommands.d.ts +9 -0
  2654. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/commands/shapeFlags.d.ts +10 -0
  2655. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/commands/shapeRemoval.d.ts +10 -0
  2656. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/commands/shapeRepair.d.ts +11 -0
  2657. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/createEditor.d.ts +6 -0
  2658. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/editor.d.ts +356 -0
  2659. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/events/canvasNavigationInteraction.d.ts +2 -0
  2660. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/events/eventRouter.d.ts +16 -0
  2661. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/events/events.d.ts +81 -0
  2662. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/events/inputsManager.d.ts +49 -0
  2663. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/events/interactions.d.ts +84 -0
  2664. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/events/keyboardShortcuts.d.ts +23 -0
  2665. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/events/pointerClickRecognizer.d.ts +11 -0
  2666. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/history/historyManager.d.ts +40 -0
  2667. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/history/operationManager.d.ts +77 -0
  2668. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/internal.d.ts +7 -0
  2669. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/queries/bindingQueryCache.d.ts +28 -0
  2670. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/queries/bindingQueryState.d.ts +11 -0
  2671. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/queries/draftBindingIndex.d.ts +19 -0
  2672. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/queries/shapeGeometryQueryCache.d.ts +34 -0
  2673. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +43 -0
  2674. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/queries/shapeTreeIndex.d.ts +27 -0
  2675. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/queries/shapeTreeIndexState.d.ts +11 -0
  2676. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/queries/spatialIndexManager.d.ts +34 -0
  2677. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/records/documentSnapshots.d.ts +14 -0
  2678. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/records/editorRecordFactory.d.ts +19 -0
  2679. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/records/recordQueries.d.ts +3 -0
  2680. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/selection/resizeGeometry.d.ts +117 -0
  2681. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/selection/selection.d.ts +223 -0
  2682. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/selection/selectionBindingSegments.d.ts +7 -0
  2683. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/selection/selectionGeometry.d.ts +28 -0
  2684. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/selection/selectionHandleHitTest.d.ts +8 -0
  2685. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/selection/selectionLayout.d.ts +20 -0
  2686. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/selection/selectionOverlay.d.ts +25 -0
  2687. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/selection/selectionOverlayEquality.d.ts +8 -0
  2688. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/selection/selectionOverlayManager.d.ts +34 -0
  2689. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/selection/selectionResizeCapabilities.d.ts +11 -0
  2690. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/selection/selectionSet.d.ts +9 -0
  2691. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/selection/selectionTargets.d.ts +10 -0
  2692. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/selection/selectionTransforms.d.ts +6 -0
  2693. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/shapes/shapeContainment.d.ts +14 -0
  2694. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/shapes/shapeEditingManager.d.ts +33 -0
  2695. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/shapes/shapeExportTraversal.d.ts +3 -0
  2696. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +21 -0
  2697. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/shapes/shapeGrouping.d.ts +22 -0
  2698. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/shapes/shapeOrder.d.ts +32 -0
  2699. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/shapes/shapeReparenting.d.ts +21 -0
  2700. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/shapes/shapeSignalManager.d.ts +35 -0
  2701. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/shapes/shapeTransformSpace.d.ts +6 -0
  2702. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/shapes/shapeTreeQueries.d.ts +12 -0
  2703. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/snapping/gapSnap.d.ts +6 -0
  2704. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/snapping/pointSnap.d.ts +5 -0
  2705. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/snapping/resizeSnap.d.ts +11 -0
  2706. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/snapping/snapDecision.d.ts +2 -0
  2707. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/snapping/snapGeometry.d.ts +26 -0
  2708. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/snapping/snapIndicators.d.ts +22 -0
  2709. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/snapping/snapManager.d.ts +54 -0
  2710. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/snapping/snapResults.d.ts +58 -0
  2711. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/snapping/snapSnapshotBuilder.d.ts +22 -0
  2712. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/snapping/snapTypes.d.ts +114 -0
  2713. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/state/editorReadModels.d.ts +34 -0
  2714. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/state/editorSignals.d.ts +82 -0
  2715. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/state/editorStateUtils.d.ts +9 -0
  2716. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/state/interactionTransientManager.d.ts +35 -0
  2717. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/viewport/camera.d.ts +3 -0
  2718. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/viewport/cameraManager.d.ts +56 -0
  2719. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/viewport/cameraPanSession.d.ts +9 -0
  2720. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/viewport/edgeScroll.d.ts +5 -0
  2721. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/viewport/renderWindow.d.ts +30 -0
  2722. package/_vendor/plugin-runtime-export/_vendor/canvas-core/editor/viewport/renderWindowManager.d.ts +33 -0
  2723. package/_vendor/plugin-runtime-export/_vendor/canvas-core/exports/integrity.d.ts +32 -0
  2724. package/_vendor/plugin-runtime-export/_vendor/canvas-core/exports/svg.d.ts +52 -0
  2725. package/_vendor/plugin-runtime-export/_vendor/canvas-core/geometry/box.d.ts +20 -0
  2726. package/_vendor/plugin-runtime-export/_vendor/canvas-core/geometry/contentCutout.d.ts +8 -0
  2727. package/_vendor/plugin-runtime-export/_vendor/canvas-core/geometry/ellipse2d.d.ts +16 -0
  2728. package/_vendor/plugin-runtime-export/_vendor/canvas-core/geometry/geometry2d.d.ts +15 -0
  2729. package/_vendor/plugin-runtime-export/_vendor/canvas-core/geometry/index.d.ts +9 -0
  2730. package/_vendor/plugin-runtime-export/_vendor/canvas-core/geometry/mat.d.ts +31 -0
  2731. package/_vendor/plugin-runtime-export/_vendor/canvas-core/geometry/polygon.d.ts +7 -0
  2732. package/_vendor/plugin-runtime-export/_vendor/canvas-core/geometry/polyline2d.d.ts +14 -0
  2733. package/_vendor/plugin-runtime-export/_vendor/canvas-core/geometry/rectangle2d.d.ts +16 -0
  2734. package/_vendor/plugin-runtime-export/_vendor/canvas-core/geometry/segments.d.ts +5 -0
  2735. package/_vendor/plugin-runtime-export/_vendor/canvas-core/geometry/vec.d.ts +35 -0
  2736. package/_vendor/plugin-runtime-export/_vendor/canvas-core/index.d.ts +64 -0
  2737. package/_vendor/plugin-runtime-export/_vendor/canvas-core/plugins/editorRuntimePlugin.d.ts +19 -0
  2738. package/_vendor/plugin-runtime-export/_vendor/canvas-core/plugins/editorRuntimeRegistry.d.ts +15 -0
  2739. package/_vendor/plugin-runtime-export/_vendor/canvas-core/plugins/index.d.ts +2 -0
  2740. package/_vendor/plugin-runtime-export/_vendor/canvas-core/reactivity.d.ts +8 -0
  2741. package/_vendor/plugin-runtime-export/_vendor/canvas-core/schema/records.d.ts +115 -0
  2742. package/_vendor/plugin-runtime-export/_vendor/canvas-core/schema/snapshots.d.ts +22 -0
  2743. package/_vendor/plugin-runtime-export/_vendor/canvas-core/shapes/childTransformPolicy.d.ts +16 -0
  2744. package/_vendor/plugin-runtime-export/_vendor/canvas-core/shapes/colors.d.ts +26 -0
  2745. package/_vendor/plugin-runtime-export/_vendor/canvas-core/shapes/shapeUtil.d.ts +245 -0
  2746. package/_vendor/plugin-runtime-export/_vendor/canvas-core/shapes/shapeUtilGeometry.d.ts +6 -0
  2747. package/_vendor/plugin-runtime-export/_vendor/canvas-core/shapes/shapeUtilRegistry.d.ts +9 -0
  2748. package/_vendor/plugin-runtime-export/_vendor/canvas-core/shapes/types.d.ts +2 -0
  2749. package/_vendor/plugin-runtime-export/_vendor/canvas-core/tools/hand/handTool.d.ts +5 -0
  2750. package/_vendor/plugin-runtime-export/_vendor/canvas-core/tools/select/selectContainment.d.ts +12 -0
  2751. package/_vendor/plugin-runtime-export/_vendor/canvas-core/tools/select/selectTool.d.ts +5 -0
  2752. package/_vendor/plugin-runtime-export/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +170 -0
  2753. package/_vendor/plugin-runtime-export/_vendor/canvas-core/tools/select/states/brushingState.d.ts +19 -0
  2754. package/_vendor/plugin-runtime-export/_vendor/canvas-core/tools/select/states/draggingPluginInteractionState.d.ts +15 -0
  2755. package/_vendor/plugin-runtime-export/_vendor/canvas-core/tools/select/states/idleState.d.ts +8 -0
  2756. package/_vendor/plugin-runtime-export/_vendor/canvas-core/tools/select/states/index.d.ts +11 -0
  2757. package/_vendor/plugin-runtime-export/_vendor/canvas-core/tools/select/states/pointingCanvasState.d.ts +11 -0
  2758. package/_vendor/plugin-runtime-export/_vendor/canvas-core/tools/select/states/pointingResizeHandleState.d.ts +10 -0
  2759. package/_vendor/plugin-runtime-export/_vendor/canvas-core/tools/select/states/pointingRotateHandleState.d.ts +10 -0
  2760. package/_vendor/plugin-runtime-export/_vendor/canvas-core/tools/select/states/pointingSelectionHandleInteractionState.d.ts +11 -0
  2761. package/_vendor/plugin-runtime-export/_vendor/canvas-core/tools/select/states/pointingShapeState.d.ts +12 -0
  2762. package/_vendor/plugin-runtime-export/_vendor/canvas-core/tools/select/states/resizingState.d.ts +16 -0
  2763. package/_vendor/plugin-runtime-export/_vendor/canvas-core/tools/select/states/rotatingState.d.ts +14 -0
  2764. package/_vendor/plugin-runtime-export/_vendor/canvas-core/tools/select/states/selectStateNode.d.ts +60 -0
  2765. package/_vendor/plugin-runtime-export/_vendor/canvas-core/tools/select/states/translatingState.d.ts +16 -0
  2766. package/_vendor/plugin-runtime-export/_vendor/canvas-core/tools/stateNode.d.ts +30 -0
  2767. package/_vendor/plugin-runtime-export/_vendor/canvas-core/tools/toolManager.d.ts +24 -0
  2768. package/_vendor/plugin-runtime-export/_vendor/canvas-core/utils/equality.d.ts +9 -0
  2769. package/_vendor/plugin-runtime-export/_vendor/canvas-extension-contracts/contributions.d.ts +92 -0
  2770. package/_vendor/plugin-runtime-export/_vendor/canvas-extension-contracts/index.d.ts +6 -0
  2771. package/_vendor/plugin-runtime-export/_vendor/canvas-extension-contracts/operations.d.ts +131 -0
  2772. package/_vendor/plugin-runtime-export/_vendor/canvas-extension-contracts/persistence.d.ts +16 -0
  2773. package/_vendor/plugin-runtime-export/_vendor/canvas-extension-contracts/plugin.d.ts +37 -0
  2774. package/_vendor/plugin-runtime-export/_vendor/canvas-extension-contracts/shape.d.ts +5 -0
  2775. package/_vendor/plugin-runtime-export/_vendor/canvas-extension-contracts/tokens.d.ts +12 -0
  2776. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/CanvasView.d.ts +7 -0
  2777. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/DefaultGrid.d.ts +1 -0
  2778. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/OverlayLayer.d.ts +1 -0
  2779. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/PageSpace.d.ts +6 -0
  2780. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/ShapeLayer.d.ts +1 -0
  2781. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/canvasKeyboardEvents.d.ts +13 -0
  2782. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/index.d.ts +3 -0
  2783. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/overlays/BindingGuide.d.ts +24 -0
  2784. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/overlays/BindingPreviewOverlay.d.ts +1 -0
  2785. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/overlays/BrushBoxOverlay.d.ts +1 -0
  2786. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/overlays/OverlaySvgRoot.d.ts +1 -0
  2787. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/overlays/SelectionFrameOverlay.d.ts +1 -0
  2788. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/overlays/SelectionHandlesOverlay.d.ts +1 -0
  2789. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/overlays/SelectionOverlaySvg.d.ts +1 -0
  2790. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/overlays/SelectionPathOverlay.d.ts +8 -0
  2791. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/overlays/ShapeOutlineOverlay.d.ts +8 -0
  2792. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/overlays/SnapIndicatorsOverlay.d.ts +1 -0
  2793. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/overlays/TerminalBindingGuidesOverlay.d.ts +1 -0
  2794. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/shape-layer/ShapeClipStack.d.ts +11 -0
  2795. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/shape-layer/ShapeDecorations.d.ts +2 -0
  2796. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/shape-layer/ShapeForegroundItem.d.ts +5 -0
  2797. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/shape-layer/ShapeItem.d.ts +5 -0
  2798. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/shape-layer/ShapeRenderList.d.ts +1 -0
  2799. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/shape-layer/ShapeRenderer.d.ts +12 -0
  2800. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/shape-layer/shapeFrame.d.ts +11 -0
  2801. package/_vendor/plugin-runtime-export/_vendor/canvas-react/components/useCanvasDomEvents.d.ts +23 -0
  2802. package/_vendor/plugin-runtime-export/_vendor/canvas-react/contextMenuRequest.d.ts +19 -0
  2803. package/_vendor/plugin-runtime-export/_vendor/canvas-react/dom.d.ts +10 -0
  2804. package/_vendor/plugin-runtime-export/_vendor/canvas-react/hooks/useEditor.d.ts +3 -0
  2805. package/_vendor/plugin-runtime-export/_vendor/canvas-react/hooks/useValue.d.ts +2 -0
  2806. package/_vendor/plugin-runtime-export/_vendor/canvas-react/host/canvasRenderBindings.d.ts +21 -0
  2807. package/_vendor/plugin-runtime-export/_vendor/canvas-react/host/canvasRenderBindingsContext.d.ts +5 -0
  2808. package/_vendor/plugin-runtime-export/_vendor/canvas-react/host/canvasRenderPlugin.d.ts +81 -0
  2809. package/_vendor/plugin-runtime-export/_vendor/canvas-react/host/index.d.ts +5 -0
  2810. package/_vendor/plugin-runtime-export/_vendor/canvas-react/index.d.ts +5 -0
  2811. package/_vendor/plugin-runtime-export/_vendor/signals/atom.d.ts +11 -0
  2812. package/_vendor/plugin-runtime-export/_vendor/signals/computed.d.ts +13 -0
  2813. package/_vendor/plugin-runtime-export/_vendor/signals/core.d.ts +35 -0
  2814. package/_vendor/plugin-runtime-export/_vendor/signals/effect.d.ts +5 -0
  2815. package/_vendor/plugin-runtime-export/_vendor/signals/index.d.ts +8 -0
  2816. package/_vendor/plugin-runtime-export/_vendor/signals/types.d.ts +22 -0
  2817. package/_vendor/plugin-runtime-export/_vendor/store/diff.d.ts +9 -0
  2818. package/_vendor/plugin-runtime-export/_vendor/store/history.d.ts +22 -0
  2819. package/_vendor/plugin-runtime-export/_vendor/store/index.d.ts +5 -0
  2820. package/_vendor/plugin-runtime-export/_vendor/store/store.d.ts +40 -0
  2821. package/_vendor/plugin-runtime-export/_vendor/store/types.d.ts +27 -0
  2822. package/_vendor/plugin-runtime-export/blobDataUrl.d.ts +1 -0
  2823. package/_vendor/plugin-runtime-export/canvasExportApi.d.ts +24 -0
  2824. package/_vendor/plugin-runtime-export/index.d.ts +8 -0
  2825. package/_vendor/plugin-runtime-export/plugin.d.ts +2 -0
  2826. package/_vendor/plugin-runtime-export/pngExport.d.ts +15 -0
  2827. package/_vendor/plugin-runtime-export/svgExport.d.ts +40 -0
  2828. package/_vendor/plugin-text/_vendor/canvas-core/bindings/bindingManager.d.ts +33 -0
  2829. package/_vendor/plugin-text/_vendor/canvas-core/bindings/bindingUtil.d.ts +69 -0
  2830. package/_vendor/plugin-text/_vendor/canvas-core/bindings/bindingUtilRegistry.d.ts +8 -0
  2831. package/_vendor/plugin-text/_vendor/canvas-core/bindings/terminalBinding.d.ts +28 -0
  2832. package/_vendor/plugin-text/_vendor/canvas-core/bindings/terminalPorts.d.ts +67 -0
  2833. package/_vendor/plugin-text/_vendor/canvas-core/editor/clipboard.d.ts +43 -0
  2834. package/_vendor/plugin-text/_vendor/canvas-core/editor/clipboardAssets.d.ts +6 -0
  2835. package/_vendor/plugin-text/_vendor/canvas-core/editor/commands/assetCommands.d.ts +7 -0
  2836. package/_vendor/plugin-text/_vendor/canvas-core/editor/commands/bindingCommands.d.ts +12 -0
  2837. package/_vendor/plugin-text/_vendor/canvas-core/editor/commands/commandTypes.d.ts +149 -0
  2838. package/_vendor/plugin-text/_vendor/canvas-core/editor/commands/commands.d.ts +5 -0
  2839. package/_vendor/plugin-text/_vendor/canvas-core/editor/commands/documentCommands.d.ts +9 -0
  2840. package/_vendor/plugin-text/_vendor/canvas-core/editor/commands/sessionCommands.d.ts +13 -0
  2841. package/_vendor/plugin-text/_vendor/canvas-core/editor/commands/shapeCommands.d.ts +9 -0
  2842. package/_vendor/plugin-text/_vendor/canvas-core/editor/commands/shapeFlags.d.ts +10 -0
  2843. package/_vendor/plugin-text/_vendor/canvas-core/editor/commands/shapeRemoval.d.ts +10 -0
  2844. package/_vendor/plugin-text/_vendor/canvas-core/editor/commands/shapeRepair.d.ts +11 -0
  2845. package/_vendor/plugin-text/_vendor/canvas-core/editor/createEditor.d.ts +6 -0
  2846. package/_vendor/plugin-text/_vendor/canvas-core/editor/editor.d.ts +356 -0
  2847. package/_vendor/plugin-text/_vendor/canvas-core/editor/events/canvasNavigationInteraction.d.ts +2 -0
  2848. package/_vendor/plugin-text/_vendor/canvas-core/editor/events/eventRouter.d.ts +16 -0
  2849. package/_vendor/plugin-text/_vendor/canvas-core/editor/events/events.d.ts +81 -0
  2850. package/_vendor/plugin-text/_vendor/canvas-core/editor/events/inputsManager.d.ts +49 -0
  2851. package/_vendor/plugin-text/_vendor/canvas-core/editor/events/interactions.d.ts +84 -0
  2852. package/_vendor/plugin-text/_vendor/canvas-core/editor/events/keyboardShortcuts.d.ts +23 -0
  2853. package/_vendor/plugin-text/_vendor/canvas-core/editor/events/pointerClickRecognizer.d.ts +11 -0
  2854. package/_vendor/plugin-text/_vendor/canvas-core/editor/history/historyManager.d.ts +40 -0
  2855. package/_vendor/plugin-text/_vendor/canvas-core/editor/history/operationManager.d.ts +77 -0
  2856. package/_vendor/plugin-text/_vendor/canvas-core/editor/internal.d.ts +7 -0
  2857. package/_vendor/plugin-text/_vendor/canvas-core/editor/queries/bindingQueryCache.d.ts +28 -0
  2858. package/_vendor/plugin-text/_vendor/canvas-core/editor/queries/bindingQueryState.d.ts +11 -0
  2859. package/_vendor/plugin-text/_vendor/canvas-core/editor/queries/draftBindingIndex.d.ts +19 -0
  2860. package/_vendor/plugin-text/_vendor/canvas-core/editor/queries/shapeGeometryQueryCache.d.ts +34 -0
  2861. package/_vendor/plugin-text/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +43 -0
  2862. package/_vendor/plugin-text/_vendor/canvas-core/editor/queries/shapeTreeIndex.d.ts +27 -0
  2863. package/_vendor/plugin-text/_vendor/canvas-core/editor/queries/shapeTreeIndexState.d.ts +11 -0
  2864. package/_vendor/plugin-text/_vendor/canvas-core/editor/queries/spatialIndexManager.d.ts +34 -0
  2865. package/_vendor/plugin-text/_vendor/canvas-core/editor/records/documentSnapshots.d.ts +14 -0
  2866. package/_vendor/plugin-text/_vendor/canvas-core/editor/records/editorRecordFactory.d.ts +19 -0
  2867. package/_vendor/plugin-text/_vendor/canvas-core/editor/records/recordQueries.d.ts +3 -0
  2868. package/_vendor/plugin-text/_vendor/canvas-core/editor/selection/resizeGeometry.d.ts +117 -0
  2869. package/_vendor/plugin-text/_vendor/canvas-core/editor/selection/selection.d.ts +223 -0
  2870. package/_vendor/plugin-text/_vendor/canvas-core/editor/selection/selectionBindingSegments.d.ts +7 -0
  2871. package/_vendor/plugin-text/_vendor/canvas-core/editor/selection/selectionGeometry.d.ts +28 -0
  2872. package/_vendor/plugin-text/_vendor/canvas-core/editor/selection/selectionHandleHitTest.d.ts +8 -0
  2873. package/_vendor/plugin-text/_vendor/canvas-core/editor/selection/selectionLayout.d.ts +20 -0
  2874. package/_vendor/plugin-text/_vendor/canvas-core/editor/selection/selectionOverlay.d.ts +25 -0
  2875. package/_vendor/plugin-text/_vendor/canvas-core/editor/selection/selectionOverlayEquality.d.ts +8 -0
  2876. package/_vendor/plugin-text/_vendor/canvas-core/editor/selection/selectionOverlayManager.d.ts +34 -0
  2877. package/_vendor/plugin-text/_vendor/canvas-core/editor/selection/selectionResizeCapabilities.d.ts +11 -0
  2878. package/_vendor/plugin-text/_vendor/canvas-core/editor/selection/selectionSet.d.ts +9 -0
  2879. package/_vendor/plugin-text/_vendor/canvas-core/editor/selection/selectionTargets.d.ts +10 -0
  2880. package/_vendor/plugin-text/_vendor/canvas-core/editor/selection/selectionTransforms.d.ts +6 -0
  2881. package/_vendor/plugin-text/_vendor/canvas-core/editor/shapes/shapeContainment.d.ts +14 -0
  2882. package/_vendor/plugin-text/_vendor/canvas-core/editor/shapes/shapeEditingManager.d.ts +33 -0
  2883. package/_vendor/plugin-text/_vendor/canvas-core/editor/shapes/shapeExportTraversal.d.ts +3 -0
  2884. package/_vendor/plugin-text/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +21 -0
  2885. package/_vendor/plugin-text/_vendor/canvas-core/editor/shapes/shapeGrouping.d.ts +22 -0
  2886. package/_vendor/plugin-text/_vendor/canvas-core/editor/shapes/shapeOrder.d.ts +32 -0
  2887. package/_vendor/plugin-text/_vendor/canvas-core/editor/shapes/shapeReparenting.d.ts +21 -0
  2888. package/_vendor/plugin-text/_vendor/canvas-core/editor/shapes/shapeSignalManager.d.ts +35 -0
  2889. package/_vendor/plugin-text/_vendor/canvas-core/editor/shapes/shapeTransformSpace.d.ts +6 -0
  2890. package/_vendor/plugin-text/_vendor/canvas-core/editor/shapes/shapeTreeQueries.d.ts +12 -0
  2891. package/_vendor/plugin-text/_vendor/canvas-core/editor/snapping/gapSnap.d.ts +6 -0
  2892. package/_vendor/plugin-text/_vendor/canvas-core/editor/snapping/pointSnap.d.ts +5 -0
  2893. package/_vendor/plugin-text/_vendor/canvas-core/editor/snapping/resizeSnap.d.ts +11 -0
  2894. package/_vendor/plugin-text/_vendor/canvas-core/editor/snapping/snapDecision.d.ts +2 -0
  2895. package/_vendor/plugin-text/_vendor/canvas-core/editor/snapping/snapGeometry.d.ts +26 -0
  2896. package/_vendor/plugin-text/_vendor/canvas-core/editor/snapping/snapIndicators.d.ts +22 -0
  2897. package/_vendor/plugin-text/_vendor/canvas-core/editor/snapping/snapManager.d.ts +54 -0
  2898. package/_vendor/plugin-text/_vendor/canvas-core/editor/snapping/snapResults.d.ts +58 -0
  2899. package/_vendor/plugin-text/_vendor/canvas-core/editor/snapping/snapSnapshotBuilder.d.ts +22 -0
  2900. package/_vendor/plugin-text/_vendor/canvas-core/editor/snapping/snapTypes.d.ts +114 -0
  2901. package/_vendor/plugin-text/_vendor/canvas-core/editor/state/editorReadModels.d.ts +34 -0
  2902. package/_vendor/plugin-text/_vendor/canvas-core/editor/state/editorSignals.d.ts +82 -0
  2903. package/_vendor/plugin-text/_vendor/canvas-core/editor/state/editorStateUtils.d.ts +9 -0
  2904. package/_vendor/plugin-text/_vendor/canvas-core/editor/state/interactionTransientManager.d.ts +35 -0
  2905. package/_vendor/plugin-text/_vendor/canvas-core/editor/viewport/camera.d.ts +3 -0
  2906. package/_vendor/plugin-text/_vendor/canvas-core/editor/viewport/cameraManager.d.ts +56 -0
  2907. package/_vendor/plugin-text/_vendor/canvas-core/editor/viewport/cameraPanSession.d.ts +9 -0
  2908. package/_vendor/plugin-text/_vendor/canvas-core/editor/viewport/edgeScroll.d.ts +5 -0
  2909. package/_vendor/plugin-text/_vendor/canvas-core/editor/viewport/renderWindow.d.ts +30 -0
  2910. package/_vendor/plugin-text/_vendor/canvas-core/editor/viewport/renderWindowManager.d.ts +33 -0
  2911. package/_vendor/plugin-text/_vendor/canvas-core/exports/integrity.d.ts +32 -0
  2912. package/_vendor/plugin-text/_vendor/canvas-core/exports/svg.d.ts +52 -0
  2913. package/_vendor/plugin-text/_vendor/canvas-core/geometry/box.d.ts +20 -0
  2914. package/_vendor/plugin-text/_vendor/canvas-core/geometry/contentCutout.d.ts +8 -0
  2915. package/_vendor/plugin-text/_vendor/canvas-core/geometry/ellipse2d.d.ts +16 -0
  2916. package/_vendor/plugin-text/_vendor/canvas-core/geometry/geometry2d.d.ts +15 -0
  2917. package/_vendor/plugin-text/_vendor/canvas-core/geometry/index.d.ts +9 -0
  2918. package/_vendor/plugin-text/_vendor/canvas-core/geometry/mat.d.ts +31 -0
  2919. package/_vendor/plugin-text/_vendor/canvas-core/geometry/polygon.d.ts +7 -0
  2920. package/_vendor/plugin-text/_vendor/canvas-core/geometry/polyline2d.d.ts +14 -0
  2921. package/_vendor/plugin-text/_vendor/canvas-core/geometry/rectangle2d.d.ts +16 -0
  2922. package/_vendor/plugin-text/_vendor/canvas-core/geometry/segments.d.ts +5 -0
  2923. package/_vendor/plugin-text/_vendor/canvas-core/geometry/vec.d.ts +35 -0
  2924. package/_vendor/plugin-text/_vendor/canvas-core/index.d.ts +64 -0
  2925. package/_vendor/plugin-text/_vendor/canvas-core/plugins/editorRuntimePlugin.d.ts +19 -0
  2926. package/_vendor/plugin-text/_vendor/canvas-core/plugins/editorRuntimeRegistry.d.ts +15 -0
  2927. package/_vendor/plugin-text/_vendor/canvas-core/plugins/index.d.ts +2 -0
  2928. package/_vendor/plugin-text/_vendor/canvas-core/reactivity.d.ts +8 -0
  2929. package/_vendor/plugin-text/_vendor/canvas-core/schema/records.d.ts +115 -0
  2930. package/_vendor/plugin-text/_vendor/canvas-core/schema/snapshots.d.ts +22 -0
  2931. package/_vendor/plugin-text/_vendor/canvas-core/shapes/childTransformPolicy.d.ts +16 -0
  2932. package/_vendor/plugin-text/_vendor/canvas-core/shapes/colors.d.ts +26 -0
  2933. package/_vendor/plugin-text/_vendor/canvas-core/shapes/shapeUtil.d.ts +245 -0
  2934. package/_vendor/plugin-text/_vendor/canvas-core/shapes/shapeUtilGeometry.d.ts +6 -0
  2935. package/_vendor/plugin-text/_vendor/canvas-core/shapes/shapeUtilRegistry.d.ts +9 -0
  2936. package/_vendor/plugin-text/_vendor/canvas-core/shapes/types.d.ts +2 -0
  2937. package/_vendor/plugin-text/_vendor/canvas-core/tools/hand/handTool.d.ts +5 -0
  2938. package/_vendor/plugin-text/_vendor/canvas-core/tools/select/selectContainment.d.ts +12 -0
  2939. package/_vendor/plugin-text/_vendor/canvas-core/tools/select/selectTool.d.ts +5 -0
  2940. package/_vendor/plugin-text/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +170 -0
  2941. package/_vendor/plugin-text/_vendor/canvas-core/tools/select/states/brushingState.d.ts +19 -0
  2942. package/_vendor/plugin-text/_vendor/canvas-core/tools/select/states/draggingPluginInteractionState.d.ts +15 -0
  2943. package/_vendor/plugin-text/_vendor/canvas-core/tools/select/states/idleState.d.ts +8 -0
  2944. package/_vendor/plugin-text/_vendor/canvas-core/tools/select/states/index.d.ts +11 -0
  2945. package/_vendor/plugin-text/_vendor/canvas-core/tools/select/states/pointingCanvasState.d.ts +11 -0
  2946. package/_vendor/plugin-text/_vendor/canvas-core/tools/select/states/pointingResizeHandleState.d.ts +10 -0
  2947. package/_vendor/plugin-text/_vendor/canvas-core/tools/select/states/pointingRotateHandleState.d.ts +10 -0
  2948. package/_vendor/plugin-text/_vendor/canvas-core/tools/select/states/pointingSelectionHandleInteractionState.d.ts +11 -0
  2949. package/_vendor/plugin-text/_vendor/canvas-core/tools/select/states/pointingShapeState.d.ts +12 -0
  2950. package/_vendor/plugin-text/_vendor/canvas-core/tools/select/states/resizingState.d.ts +16 -0
  2951. package/_vendor/plugin-text/_vendor/canvas-core/tools/select/states/rotatingState.d.ts +14 -0
  2952. package/_vendor/plugin-text/_vendor/canvas-core/tools/select/states/selectStateNode.d.ts +60 -0
  2953. package/_vendor/plugin-text/_vendor/canvas-core/tools/select/states/translatingState.d.ts +16 -0
  2954. package/_vendor/plugin-text/_vendor/canvas-core/tools/stateNode.d.ts +30 -0
  2955. package/_vendor/plugin-text/_vendor/canvas-core/tools/toolManager.d.ts +24 -0
  2956. package/_vendor/plugin-text/_vendor/canvas-core/utils/equality.d.ts +9 -0
  2957. package/_vendor/plugin-text/_vendor/canvas-extension-contracts/contributions.d.ts +92 -0
  2958. package/_vendor/plugin-text/_vendor/canvas-extension-contracts/index.d.ts +6 -0
  2959. package/_vendor/plugin-text/_vendor/canvas-extension-contracts/operations.d.ts +131 -0
  2960. package/_vendor/plugin-text/_vendor/canvas-extension-contracts/persistence.d.ts +16 -0
  2961. package/_vendor/plugin-text/_vendor/canvas-extension-contracts/plugin.d.ts +37 -0
  2962. package/_vendor/plugin-text/_vendor/canvas-extension-contracts/shape.d.ts +5 -0
  2963. package/_vendor/plugin-text/_vendor/canvas-extension-contracts/tokens.d.ts +12 -0
  2964. package/_vendor/plugin-text/_vendor/canvas-react/components/CanvasView.d.ts +7 -0
  2965. package/_vendor/plugin-text/_vendor/canvas-react/components/DefaultGrid.d.ts +1 -0
  2966. package/_vendor/plugin-text/_vendor/canvas-react/components/OverlayLayer.d.ts +1 -0
  2967. package/_vendor/plugin-text/_vendor/canvas-react/components/PageSpace.d.ts +6 -0
  2968. package/_vendor/plugin-text/_vendor/canvas-react/components/ShapeLayer.d.ts +1 -0
  2969. package/_vendor/plugin-text/_vendor/canvas-react/components/canvasKeyboardEvents.d.ts +13 -0
  2970. package/_vendor/plugin-text/_vendor/canvas-react/components/index.d.ts +3 -0
  2971. package/_vendor/plugin-text/_vendor/canvas-react/components/overlays/BindingGuide.d.ts +24 -0
  2972. package/_vendor/plugin-text/_vendor/canvas-react/components/overlays/BindingPreviewOverlay.d.ts +1 -0
  2973. package/_vendor/plugin-text/_vendor/canvas-react/components/overlays/BrushBoxOverlay.d.ts +1 -0
  2974. package/_vendor/plugin-text/_vendor/canvas-react/components/overlays/OverlaySvgRoot.d.ts +1 -0
  2975. package/_vendor/plugin-text/_vendor/canvas-react/components/overlays/SelectionFrameOverlay.d.ts +1 -0
  2976. package/_vendor/plugin-text/_vendor/canvas-react/components/overlays/SelectionHandlesOverlay.d.ts +1 -0
  2977. package/_vendor/plugin-text/_vendor/canvas-react/components/overlays/SelectionOverlaySvg.d.ts +1 -0
  2978. package/_vendor/plugin-text/_vendor/canvas-react/components/overlays/SelectionPathOverlay.d.ts +8 -0
  2979. package/_vendor/plugin-text/_vendor/canvas-react/components/overlays/ShapeOutlineOverlay.d.ts +8 -0
  2980. package/_vendor/plugin-text/_vendor/canvas-react/components/overlays/SnapIndicatorsOverlay.d.ts +1 -0
  2981. package/_vendor/plugin-text/_vendor/canvas-react/components/overlays/TerminalBindingGuidesOverlay.d.ts +1 -0
  2982. package/_vendor/plugin-text/_vendor/canvas-react/components/shape-layer/ShapeClipStack.d.ts +11 -0
  2983. package/_vendor/plugin-text/_vendor/canvas-react/components/shape-layer/ShapeDecorations.d.ts +2 -0
  2984. package/_vendor/plugin-text/_vendor/canvas-react/components/shape-layer/ShapeForegroundItem.d.ts +5 -0
  2985. package/_vendor/plugin-text/_vendor/canvas-react/components/shape-layer/ShapeItem.d.ts +5 -0
  2986. package/_vendor/plugin-text/_vendor/canvas-react/components/shape-layer/ShapeRenderList.d.ts +1 -0
  2987. package/_vendor/plugin-text/_vendor/canvas-react/components/shape-layer/ShapeRenderer.d.ts +12 -0
  2988. package/_vendor/plugin-text/_vendor/canvas-react/components/shape-layer/shapeFrame.d.ts +11 -0
  2989. package/_vendor/plugin-text/_vendor/canvas-react/components/useCanvasDomEvents.d.ts +23 -0
  2990. package/_vendor/plugin-text/_vendor/canvas-react/contextMenuRequest.d.ts +19 -0
  2991. package/_vendor/plugin-text/_vendor/canvas-react/dom.d.ts +10 -0
  2992. package/_vendor/plugin-text/_vendor/canvas-react/hooks/useEditor.d.ts +3 -0
  2993. package/_vendor/plugin-text/_vendor/canvas-react/hooks/useValue.d.ts +2 -0
  2994. package/_vendor/plugin-text/_vendor/canvas-react/host/canvasRenderBindings.d.ts +21 -0
  2995. package/_vendor/plugin-text/_vendor/canvas-react/host/canvasRenderBindingsContext.d.ts +5 -0
  2996. package/_vendor/plugin-text/_vendor/canvas-react/host/canvasRenderPlugin.d.ts +81 -0
  2997. package/_vendor/plugin-text/_vendor/canvas-react/host/index.d.ts +5 -0
  2998. package/_vendor/plugin-text/_vendor/canvas-react/index.d.ts +5 -0
  2999. package/_vendor/plugin-text/_vendor/signals/atom.d.ts +11 -0
  3000. package/_vendor/plugin-text/_vendor/signals/computed.d.ts +13 -0
  3001. package/_vendor/plugin-text/_vendor/signals/core.d.ts +35 -0
  3002. package/_vendor/plugin-text/_vendor/signals/effect.d.ts +5 -0
  3003. package/_vendor/plugin-text/_vendor/signals/index.d.ts +8 -0
  3004. package/_vendor/plugin-text/_vendor/signals/types.d.ts +22 -0
  3005. package/_vendor/plugin-text/_vendor/store/diff.d.ts +9 -0
  3006. package/_vendor/plugin-text/_vendor/store/history.d.ts +22 -0
  3007. package/_vendor/plugin-text/_vendor/store/index.d.ts +5 -0
  3008. package/_vendor/plugin-text/_vendor/store/store.d.ts +40 -0
  3009. package/_vendor/plugin-text/_vendor/store/types.d.ts +27 -0
  3010. package/_vendor/plugin-text/api.d.ts +45 -0
  3011. package/_vendor/plugin-text/canvasRender.d.ts +10 -0
  3012. package/_vendor/plugin-text/editorRichTextLinks.d.ts +7 -0
  3013. package/_vendor/plugin-text/editorRuntime.d.ts +5 -0
  3014. package/_vendor/plugin-text/feature.d.ts +10 -0
  3015. package/_vendor/plugin-text/geoLabelBindingUtil.d.ts +48 -0
  3016. package/_vendor/plugin-text/host/RichTextEditingBox.d.ts +12 -0
  3017. package/_vendor/plugin-text/host/TiptapTextEditor.d.ts +29 -0
  3018. package/_vendor/plugin-text/host/blobDataUrl.d.ts +1 -0
  3019. package/_vendor/plugin-text/host/browserRichTextLink.d.ts +1 -0
  3020. package/_vendor/plugin-text/host/initialTextBackground.d.ts +2 -0
  3021. package/_vendor/plugin-text/host/richTextRendering.d.ts +17 -0
  3022. package/_vendor/plugin-text/host/textDomSelection.d.ts +7 -0
  3023. package/_vendor/plugin-text/host/textEditingBoxStyle.d.ts +4 -0
  3024. package/_vendor/plugin-text/host/textEntryFocus.d.ts +23 -0
  3025. package/_vendor/plugin-text/host/textFontLoader.d.ts +3 -0
  3026. package/_vendor/plugin-text/host/textFormattingApi.d.ts +16 -0
  3027. package/_vendor/plugin-text/host/textMeasurement.d.ts +21 -0
  3028. package/_vendor/plugin-text/host/textMeasurementSync.d.ts +11 -0
  3029. package/_vendor/plugin-text/host/textRangeSelection.d.ts +14 -0
  3030. package/_vendor/plugin-text/host/textShapeRendererRuntime.d.ts +12 -0
  3031. package/_vendor/plugin-text/host/textShapeSync.d.ts +19 -0
  3032. package/_vendor/plugin-text/host/textSvgAssetInliner.d.ts +3 -0
  3033. package/_vendor/plugin-text/host/textSvgExportPlugin.d.ts +5 -0
  3034. package/_vendor/plugin-text/host/tiptapTextEditorController.d.ts +38 -0
  3035. package/_vendor/plugin-text/index.d.ts +21 -0
  3036. package/_vendor/plugin-text/pathLabelBindingUtil.d.ts +55 -0
  3037. package/_vendor/plugin-text/richTextLinks.d.ts +12 -0
  3038. package/_vendor/plugin-text/richTextUtils.d.ts +26 -0
  3039. package/_vendor/plugin-text/shapeWideTextFormatting.d.ts +18 -0
  3040. package/_vendor/plugin-text/textFonts.d.ts +49 -0
  3041. package/_vendor/plugin-text/textFormatting.d.ts +50 -0
  3042. package/_vendor/plugin-text/textFormattingSession.d.ts +6 -0
  3043. package/_vendor/plugin-text/textInteractions.d.ts +4 -0
  3044. package/_vendor/plugin-text/textLabelHelpers.d.ts +72 -0
  3045. package/_vendor/plugin-text/textLinkPopoverPresentation.d.ts +20 -0
  3046. package/_vendor/plugin-text/textSearch.d.ts +19 -0
  3047. package/_vendor/plugin-text/textShapeHelpers.d.ts +21 -0
  3048. package/_vendor/plugin-text/textShapeSvgExporter.d.ts +9 -0
  3049. package/_vendor/plugin-text/textShapeUtil.d.ts +24 -0
  3050. package/_vendor/plugin-text/textStyle.d.ts +18 -0
  3051. package/_vendor/plugin-text/textTool.d.ts +4 -0
  3052. package/_vendor/plugin-text/textTypes.d.ts +29 -0
  3053. package/_vendor/plugin-video/_vendor/canvas-core/bindings/bindingManager.d.ts +33 -0
  3054. package/_vendor/plugin-video/_vendor/canvas-core/bindings/bindingUtil.d.ts +69 -0
  3055. package/_vendor/plugin-video/_vendor/canvas-core/bindings/bindingUtilRegistry.d.ts +8 -0
  3056. package/_vendor/plugin-video/_vendor/canvas-core/bindings/terminalBinding.d.ts +28 -0
  3057. package/_vendor/plugin-video/_vendor/canvas-core/bindings/terminalPorts.d.ts +67 -0
  3058. package/_vendor/plugin-video/_vendor/canvas-core/editor/clipboard.d.ts +43 -0
  3059. package/_vendor/plugin-video/_vendor/canvas-core/editor/clipboardAssets.d.ts +6 -0
  3060. package/_vendor/plugin-video/_vendor/canvas-core/editor/commands/assetCommands.d.ts +7 -0
  3061. package/_vendor/plugin-video/_vendor/canvas-core/editor/commands/bindingCommands.d.ts +12 -0
  3062. package/_vendor/plugin-video/_vendor/canvas-core/editor/commands/commandTypes.d.ts +149 -0
  3063. package/_vendor/plugin-video/_vendor/canvas-core/editor/commands/commands.d.ts +5 -0
  3064. package/_vendor/plugin-video/_vendor/canvas-core/editor/commands/documentCommands.d.ts +9 -0
  3065. package/_vendor/plugin-video/_vendor/canvas-core/editor/commands/sessionCommands.d.ts +13 -0
  3066. package/_vendor/plugin-video/_vendor/canvas-core/editor/commands/shapeCommands.d.ts +9 -0
  3067. package/_vendor/plugin-video/_vendor/canvas-core/editor/commands/shapeFlags.d.ts +10 -0
  3068. package/_vendor/plugin-video/_vendor/canvas-core/editor/commands/shapeRemoval.d.ts +10 -0
  3069. package/_vendor/plugin-video/_vendor/canvas-core/editor/commands/shapeRepair.d.ts +11 -0
  3070. package/_vendor/plugin-video/_vendor/canvas-core/editor/createEditor.d.ts +6 -0
  3071. package/_vendor/plugin-video/_vendor/canvas-core/editor/editor.d.ts +356 -0
  3072. package/_vendor/plugin-video/_vendor/canvas-core/editor/events/canvasNavigationInteraction.d.ts +2 -0
  3073. package/_vendor/plugin-video/_vendor/canvas-core/editor/events/eventRouter.d.ts +16 -0
  3074. package/_vendor/plugin-video/_vendor/canvas-core/editor/events/events.d.ts +81 -0
  3075. package/_vendor/plugin-video/_vendor/canvas-core/editor/events/inputsManager.d.ts +49 -0
  3076. package/_vendor/plugin-video/_vendor/canvas-core/editor/events/interactions.d.ts +84 -0
  3077. package/_vendor/plugin-video/_vendor/canvas-core/editor/events/keyboardShortcuts.d.ts +23 -0
  3078. package/_vendor/plugin-video/_vendor/canvas-core/editor/events/pointerClickRecognizer.d.ts +11 -0
  3079. package/_vendor/plugin-video/_vendor/canvas-core/editor/history/historyManager.d.ts +40 -0
  3080. package/_vendor/plugin-video/_vendor/canvas-core/editor/history/operationManager.d.ts +77 -0
  3081. package/_vendor/plugin-video/_vendor/canvas-core/editor/internal.d.ts +7 -0
  3082. package/_vendor/plugin-video/_vendor/canvas-core/editor/queries/bindingQueryCache.d.ts +28 -0
  3083. package/_vendor/plugin-video/_vendor/canvas-core/editor/queries/bindingQueryState.d.ts +11 -0
  3084. package/_vendor/plugin-video/_vendor/canvas-core/editor/queries/draftBindingIndex.d.ts +19 -0
  3085. package/_vendor/plugin-video/_vendor/canvas-core/editor/queries/shapeGeometryQueryCache.d.ts +34 -0
  3086. package/_vendor/plugin-video/_vendor/canvas-core/editor/queries/shapeTransforms.d.ts +43 -0
  3087. package/_vendor/plugin-video/_vendor/canvas-core/editor/queries/shapeTreeIndex.d.ts +27 -0
  3088. package/_vendor/plugin-video/_vendor/canvas-core/editor/queries/shapeTreeIndexState.d.ts +11 -0
  3089. package/_vendor/plugin-video/_vendor/canvas-core/editor/queries/spatialIndexManager.d.ts +34 -0
  3090. package/_vendor/plugin-video/_vendor/canvas-core/editor/records/documentSnapshots.d.ts +14 -0
  3091. package/_vendor/plugin-video/_vendor/canvas-core/editor/records/editorRecordFactory.d.ts +19 -0
  3092. package/_vendor/plugin-video/_vendor/canvas-core/editor/records/recordQueries.d.ts +3 -0
  3093. package/_vendor/plugin-video/_vendor/canvas-core/editor/selection/resizeGeometry.d.ts +117 -0
  3094. package/_vendor/plugin-video/_vendor/canvas-core/editor/selection/selection.d.ts +223 -0
  3095. package/_vendor/plugin-video/_vendor/canvas-core/editor/selection/selectionBindingSegments.d.ts +7 -0
  3096. package/_vendor/plugin-video/_vendor/canvas-core/editor/selection/selectionGeometry.d.ts +28 -0
  3097. package/_vendor/plugin-video/_vendor/canvas-core/editor/selection/selectionHandleHitTest.d.ts +8 -0
  3098. package/_vendor/plugin-video/_vendor/canvas-core/editor/selection/selectionLayout.d.ts +20 -0
  3099. package/_vendor/plugin-video/_vendor/canvas-core/editor/selection/selectionOverlay.d.ts +25 -0
  3100. package/_vendor/plugin-video/_vendor/canvas-core/editor/selection/selectionOverlayEquality.d.ts +8 -0
  3101. package/_vendor/plugin-video/_vendor/canvas-core/editor/selection/selectionOverlayManager.d.ts +34 -0
  3102. package/_vendor/plugin-video/_vendor/canvas-core/editor/selection/selectionResizeCapabilities.d.ts +11 -0
  3103. package/_vendor/plugin-video/_vendor/canvas-core/editor/selection/selectionSet.d.ts +9 -0
  3104. package/_vendor/plugin-video/_vendor/canvas-core/editor/selection/selectionTargets.d.ts +10 -0
  3105. package/_vendor/plugin-video/_vendor/canvas-core/editor/selection/selectionTransforms.d.ts +6 -0
  3106. package/_vendor/plugin-video/_vendor/canvas-core/editor/shapes/shapeContainment.d.ts +14 -0
  3107. package/_vendor/plugin-video/_vendor/canvas-core/editor/shapes/shapeEditingManager.d.ts +33 -0
  3108. package/_vendor/plugin-video/_vendor/canvas-core/editor/shapes/shapeExportTraversal.d.ts +3 -0
  3109. package/_vendor/plugin-video/_vendor/canvas-core/editor/shapes/shapeGeometry.d.ts +21 -0
  3110. package/_vendor/plugin-video/_vendor/canvas-core/editor/shapes/shapeGrouping.d.ts +22 -0
  3111. package/_vendor/plugin-video/_vendor/canvas-core/editor/shapes/shapeOrder.d.ts +32 -0
  3112. package/_vendor/plugin-video/_vendor/canvas-core/editor/shapes/shapeReparenting.d.ts +21 -0
  3113. package/_vendor/plugin-video/_vendor/canvas-core/editor/shapes/shapeSignalManager.d.ts +35 -0
  3114. package/_vendor/plugin-video/_vendor/canvas-core/editor/shapes/shapeTransformSpace.d.ts +6 -0
  3115. package/_vendor/plugin-video/_vendor/canvas-core/editor/shapes/shapeTreeQueries.d.ts +12 -0
  3116. package/_vendor/plugin-video/_vendor/canvas-core/editor/snapping/gapSnap.d.ts +6 -0
  3117. package/_vendor/plugin-video/_vendor/canvas-core/editor/snapping/pointSnap.d.ts +5 -0
  3118. package/_vendor/plugin-video/_vendor/canvas-core/editor/snapping/resizeSnap.d.ts +11 -0
  3119. package/_vendor/plugin-video/_vendor/canvas-core/editor/snapping/snapDecision.d.ts +2 -0
  3120. package/_vendor/plugin-video/_vendor/canvas-core/editor/snapping/snapGeometry.d.ts +26 -0
  3121. package/_vendor/plugin-video/_vendor/canvas-core/editor/snapping/snapIndicators.d.ts +22 -0
  3122. package/_vendor/plugin-video/_vendor/canvas-core/editor/snapping/snapManager.d.ts +54 -0
  3123. package/_vendor/plugin-video/_vendor/canvas-core/editor/snapping/snapResults.d.ts +58 -0
  3124. package/_vendor/plugin-video/_vendor/canvas-core/editor/snapping/snapSnapshotBuilder.d.ts +22 -0
  3125. package/_vendor/plugin-video/_vendor/canvas-core/editor/snapping/snapTypes.d.ts +114 -0
  3126. package/_vendor/plugin-video/_vendor/canvas-core/editor/state/editorReadModels.d.ts +34 -0
  3127. package/_vendor/plugin-video/_vendor/canvas-core/editor/state/editorSignals.d.ts +82 -0
  3128. package/_vendor/plugin-video/_vendor/canvas-core/editor/state/editorStateUtils.d.ts +9 -0
  3129. package/_vendor/plugin-video/_vendor/canvas-core/editor/state/interactionTransientManager.d.ts +35 -0
  3130. package/_vendor/plugin-video/_vendor/canvas-core/editor/viewport/camera.d.ts +3 -0
  3131. package/_vendor/plugin-video/_vendor/canvas-core/editor/viewport/cameraManager.d.ts +56 -0
  3132. package/_vendor/plugin-video/_vendor/canvas-core/editor/viewport/cameraPanSession.d.ts +9 -0
  3133. package/_vendor/plugin-video/_vendor/canvas-core/editor/viewport/edgeScroll.d.ts +5 -0
  3134. package/_vendor/plugin-video/_vendor/canvas-core/editor/viewport/renderWindow.d.ts +30 -0
  3135. package/_vendor/plugin-video/_vendor/canvas-core/editor/viewport/renderWindowManager.d.ts +33 -0
  3136. package/_vendor/plugin-video/_vendor/canvas-core/exports/integrity.d.ts +32 -0
  3137. package/_vendor/plugin-video/_vendor/canvas-core/exports/svg.d.ts +52 -0
  3138. package/_vendor/plugin-video/_vendor/canvas-core/geometry/box.d.ts +20 -0
  3139. package/_vendor/plugin-video/_vendor/canvas-core/geometry/contentCutout.d.ts +8 -0
  3140. package/_vendor/plugin-video/_vendor/canvas-core/geometry/ellipse2d.d.ts +16 -0
  3141. package/_vendor/plugin-video/_vendor/canvas-core/geometry/geometry2d.d.ts +15 -0
  3142. package/_vendor/plugin-video/_vendor/canvas-core/geometry/index.d.ts +9 -0
  3143. package/_vendor/plugin-video/_vendor/canvas-core/geometry/mat.d.ts +31 -0
  3144. package/_vendor/plugin-video/_vendor/canvas-core/geometry/polygon.d.ts +7 -0
  3145. package/_vendor/plugin-video/_vendor/canvas-core/geometry/polyline2d.d.ts +14 -0
  3146. package/_vendor/plugin-video/_vendor/canvas-core/geometry/rectangle2d.d.ts +16 -0
  3147. package/_vendor/plugin-video/_vendor/canvas-core/geometry/segments.d.ts +5 -0
  3148. package/_vendor/plugin-video/_vendor/canvas-core/geometry/vec.d.ts +35 -0
  3149. package/_vendor/plugin-video/_vendor/canvas-core/index.d.ts +64 -0
  3150. package/_vendor/plugin-video/_vendor/canvas-core/plugins/editorRuntimePlugin.d.ts +19 -0
  3151. package/_vendor/plugin-video/_vendor/canvas-core/plugins/editorRuntimeRegistry.d.ts +15 -0
  3152. package/_vendor/plugin-video/_vendor/canvas-core/plugins/index.d.ts +2 -0
  3153. package/_vendor/plugin-video/_vendor/canvas-core/reactivity.d.ts +8 -0
  3154. package/_vendor/plugin-video/_vendor/canvas-core/schema/records.d.ts +115 -0
  3155. package/_vendor/plugin-video/_vendor/canvas-core/schema/snapshots.d.ts +22 -0
  3156. package/_vendor/plugin-video/_vendor/canvas-core/shapes/childTransformPolicy.d.ts +16 -0
  3157. package/_vendor/plugin-video/_vendor/canvas-core/shapes/colors.d.ts +26 -0
  3158. package/_vendor/plugin-video/_vendor/canvas-core/shapes/shapeUtil.d.ts +245 -0
  3159. package/_vendor/plugin-video/_vendor/canvas-core/shapes/shapeUtilGeometry.d.ts +6 -0
  3160. package/_vendor/plugin-video/_vendor/canvas-core/shapes/shapeUtilRegistry.d.ts +9 -0
  3161. package/_vendor/plugin-video/_vendor/canvas-core/shapes/types.d.ts +2 -0
  3162. package/_vendor/plugin-video/_vendor/canvas-core/tools/hand/handTool.d.ts +5 -0
  3163. package/_vendor/plugin-video/_vendor/canvas-core/tools/select/selectContainment.d.ts +12 -0
  3164. package/_vendor/plugin-video/_vendor/canvas-core/tools/select/selectTool.d.ts +5 -0
  3165. package/_vendor/plugin-video/_vendor/canvas-core/tools/select/selectToolHelpers.d.ts +170 -0
  3166. package/_vendor/plugin-video/_vendor/canvas-core/tools/select/states/brushingState.d.ts +19 -0
  3167. package/_vendor/plugin-video/_vendor/canvas-core/tools/select/states/draggingPluginInteractionState.d.ts +15 -0
  3168. package/_vendor/plugin-video/_vendor/canvas-core/tools/select/states/idleState.d.ts +8 -0
  3169. package/_vendor/plugin-video/_vendor/canvas-core/tools/select/states/index.d.ts +11 -0
  3170. package/_vendor/plugin-video/_vendor/canvas-core/tools/select/states/pointingCanvasState.d.ts +11 -0
  3171. package/_vendor/plugin-video/_vendor/canvas-core/tools/select/states/pointingResizeHandleState.d.ts +10 -0
  3172. package/_vendor/plugin-video/_vendor/canvas-core/tools/select/states/pointingRotateHandleState.d.ts +10 -0
  3173. package/_vendor/plugin-video/_vendor/canvas-core/tools/select/states/pointingSelectionHandleInteractionState.d.ts +11 -0
  3174. package/_vendor/plugin-video/_vendor/canvas-core/tools/select/states/pointingShapeState.d.ts +12 -0
  3175. package/_vendor/plugin-video/_vendor/canvas-core/tools/select/states/resizingState.d.ts +16 -0
  3176. package/_vendor/plugin-video/_vendor/canvas-core/tools/select/states/rotatingState.d.ts +14 -0
  3177. package/_vendor/plugin-video/_vendor/canvas-core/tools/select/states/selectStateNode.d.ts +60 -0
  3178. package/_vendor/plugin-video/_vendor/canvas-core/tools/select/states/translatingState.d.ts +16 -0
  3179. package/_vendor/plugin-video/_vendor/canvas-core/tools/stateNode.d.ts +30 -0
  3180. package/_vendor/plugin-video/_vendor/canvas-core/tools/toolManager.d.ts +24 -0
  3181. package/_vendor/plugin-video/_vendor/canvas-core/utils/equality.d.ts +9 -0
  3182. package/_vendor/plugin-video/_vendor/canvas-extension-contracts/contributions.d.ts +92 -0
  3183. package/_vendor/plugin-video/_vendor/canvas-extension-contracts/index.d.ts +6 -0
  3184. package/_vendor/plugin-video/_vendor/canvas-extension-contracts/operations.d.ts +131 -0
  3185. package/_vendor/plugin-video/_vendor/canvas-extension-contracts/persistence.d.ts +16 -0
  3186. package/_vendor/plugin-video/_vendor/canvas-extension-contracts/plugin.d.ts +37 -0
  3187. package/_vendor/plugin-video/_vendor/canvas-extension-contracts/shape.d.ts +5 -0
  3188. package/_vendor/plugin-video/_vendor/canvas-extension-contracts/tokens.d.ts +12 -0
  3189. package/_vendor/plugin-video/_vendor/canvas-react/components/CanvasView.d.ts +7 -0
  3190. package/_vendor/plugin-video/_vendor/canvas-react/components/DefaultGrid.d.ts +1 -0
  3191. package/_vendor/plugin-video/_vendor/canvas-react/components/OverlayLayer.d.ts +1 -0
  3192. package/_vendor/plugin-video/_vendor/canvas-react/components/PageSpace.d.ts +6 -0
  3193. package/_vendor/plugin-video/_vendor/canvas-react/components/ShapeLayer.d.ts +1 -0
  3194. package/_vendor/plugin-video/_vendor/canvas-react/components/canvasKeyboardEvents.d.ts +13 -0
  3195. package/_vendor/plugin-video/_vendor/canvas-react/components/index.d.ts +3 -0
  3196. package/_vendor/plugin-video/_vendor/canvas-react/components/overlays/BindingGuide.d.ts +24 -0
  3197. package/_vendor/plugin-video/_vendor/canvas-react/components/overlays/BindingPreviewOverlay.d.ts +1 -0
  3198. package/_vendor/plugin-video/_vendor/canvas-react/components/overlays/BrushBoxOverlay.d.ts +1 -0
  3199. package/_vendor/plugin-video/_vendor/canvas-react/components/overlays/OverlaySvgRoot.d.ts +1 -0
  3200. package/_vendor/plugin-video/_vendor/canvas-react/components/overlays/SelectionFrameOverlay.d.ts +1 -0
  3201. package/_vendor/plugin-video/_vendor/canvas-react/components/overlays/SelectionHandlesOverlay.d.ts +1 -0
  3202. package/_vendor/plugin-video/_vendor/canvas-react/components/overlays/SelectionOverlaySvg.d.ts +1 -0
  3203. package/_vendor/plugin-video/_vendor/canvas-react/components/overlays/SelectionPathOverlay.d.ts +8 -0
  3204. package/_vendor/plugin-video/_vendor/canvas-react/components/overlays/ShapeOutlineOverlay.d.ts +8 -0
  3205. package/_vendor/plugin-video/_vendor/canvas-react/components/overlays/SnapIndicatorsOverlay.d.ts +1 -0
  3206. package/_vendor/plugin-video/_vendor/canvas-react/components/overlays/TerminalBindingGuidesOverlay.d.ts +1 -0
  3207. package/_vendor/plugin-video/_vendor/canvas-react/components/shape-layer/ShapeClipStack.d.ts +11 -0
  3208. package/_vendor/plugin-video/_vendor/canvas-react/components/shape-layer/ShapeDecorations.d.ts +2 -0
  3209. package/_vendor/plugin-video/_vendor/canvas-react/components/shape-layer/ShapeForegroundItem.d.ts +5 -0
  3210. package/_vendor/plugin-video/_vendor/canvas-react/components/shape-layer/ShapeItem.d.ts +5 -0
  3211. package/_vendor/plugin-video/_vendor/canvas-react/components/shape-layer/ShapeRenderList.d.ts +1 -0
  3212. package/_vendor/plugin-video/_vendor/canvas-react/components/shape-layer/ShapeRenderer.d.ts +12 -0
  3213. package/_vendor/plugin-video/_vendor/canvas-react/components/shape-layer/shapeFrame.d.ts +11 -0
  3214. package/_vendor/plugin-video/_vendor/canvas-react/components/useCanvasDomEvents.d.ts +23 -0
  3215. package/_vendor/plugin-video/_vendor/canvas-react/contextMenuRequest.d.ts +19 -0
  3216. package/_vendor/plugin-video/_vendor/canvas-react/dom.d.ts +10 -0
  3217. package/_vendor/plugin-video/_vendor/canvas-react/hooks/useEditor.d.ts +3 -0
  3218. package/_vendor/plugin-video/_vendor/canvas-react/hooks/useValue.d.ts +2 -0
  3219. package/_vendor/plugin-video/_vendor/canvas-react/host/canvasRenderBindings.d.ts +21 -0
  3220. package/_vendor/plugin-video/_vendor/canvas-react/host/canvasRenderBindingsContext.d.ts +5 -0
  3221. package/_vendor/plugin-video/_vendor/canvas-react/host/canvasRenderPlugin.d.ts +81 -0
  3222. package/_vendor/plugin-video/_vendor/canvas-react/host/index.d.ts +5 -0
  3223. package/_vendor/plugin-video/_vendor/canvas-react/index.d.ts +5 -0
  3224. package/_vendor/plugin-video/_vendor/signals/atom.d.ts +11 -0
  3225. package/_vendor/plugin-video/_vendor/signals/computed.d.ts +13 -0
  3226. package/_vendor/plugin-video/_vendor/signals/core.d.ts +35 -0
  3227. package/_vendor/plugin-video/_vendor/signals/effect.d.ts +5 -0
  3228. package/_vendor/plugin-video/_vendor/signals/index.d.ts +8 -0
  3229. package/_vendor/plugin-video/_vendor/signals/types.d.ts +22 -0
  3230. package/_vendor/plugin-video/_vendor/store/diff.d.ts +9 -0
  3231. package/_vendor/plugin-video/_vendor/store/history.d.ts +22 -0
  3232. package/_vendor/plugin-video/_vendor/store/index.d.ts +5 -0
  3233. package/_vendor/plugin-video/_vendor/store/store.d.ts +40 -0
  3234. package/_vendor/plugin-video/_vendor/store/types.d.ts +27 -0
  3235. package/_vendor/plugin-video/host/api.d.ts +34 -0
  3236. package/_vendor/plugin-video/host/createVideoHostApi.d.ts +13 -0
  3237. package/_vendor/plugin-video/host/index.d.ts +13 -0
  3238. package/_vendor/plugin-video/host/plugin.d.ts +8 -0
  3239. package/_vendor/plugin-video/host/storage/indexedDb.d.ts +4 -0
  3240. package/_vendor/plugin-video/host/storage/videoBlobStore.d.ts +29 -0
  3241. package/_vendor/plugin-video/host/videoAssetOperations.d.ts +39 -0
  3242. package/_vendor/plugin-video/host/videoAssetService.d.ts +17 -0
  3243. package/_vendor/plugin-video/host/videoFileHelpers.d.ts +39 -0
  3244. package/_vendor/plugin-video/index.d.ts +2 -0
  3245. package/_vendor/plugin-video/video/api.d.ts +18 -0
  3246. package/_vendor/plugin-video/video/cornerRadius.d.ts +6 -0
  3247. package/_vendor/plugin-video/video/editorPlugin.d.ts +2 -0
  3248. package/_vendor/plugin-video/video/index.d.ts +8 -0
  3249. package/_vendor/plugin-video/video/plugin.d.ts +2 -0
  3250. package/_vendor/plugin-video/video/renderPlugin.d.ts +2 -0
  3251. package/_vendor/plugin-video/video/types.d.ts +35 -0
  3252. package/_vendor/plugin-video/video/videoShapeUtil.d.ts +20 -0
  3253. package/actions.d.ts +6 -0
  3254. package/index.d.ts +46 -0
  3255. package/index.mjs +168 -0
  3256. package/package.json +28 -0
package/index.mjs ADDED
@@ -0,0 +1,168 @@
1
+ import{applyCanvasActionShortcutOverrides as e}from"@yuzhouu/canvas-kit";var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,i=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,a=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),l=(e,a,l)=>(l=null!=e?t(i(e)):{},((e,t,i,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var l,c=o(t),d=0,u=c.length;d<u;d++)l=c[d],s.call(e,l)||l===i||n(e,l,{get:(e=>t[e]).bind(null,l),enumerable:!(a=r(t,l))||a.enumerable});return e})(!a&&e&&e.__esModule?l:n(l,"default",{value:e,enumerable:!0}),e));function c(e){return!!e&&"shape"===e.typeName}function d(e){return!!e&&"asset"===e.typeName}var u=class{},p=class e{x;y;constructor(e,t){this.x=e,this.y=t}add(t){return new e(this.x+t.x,this.y+t.y)}sub(t){return new e(this.x-t.x,this.y-t.y)}mul(t){return new e(this.x*t,this.y*t)}div(t){return new e(this.x/t,this.y/t)}len2(){return this.x*this.x+this.y*this.y}len(){return Math.sqrt(this.len2())}dist2(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}dist(e){return Math.sqrt(this.dist2(e))}rot(t){const n=Math.cos(t),r=Math.sin(t);return new e(this.x*n-this.y*r,this.x*r+this.y*n)}per(){return new e(-this.y,this.x)}normalize(){const t=this.len();return 0===t?new e(0,0):this.div(t)}equals(e){return this.x===e.x&&this.y===e.y}clone(){return new e(this.x,this.y)}static From(t,n){return new e(t,n)}static Zero(){return new e(0,0)}static Med(t,n){return new e((t.x+n.x)/2,(t.y+n.y)/2)}static Lrp(t,n,r){return new e(t.x+(n.x-t.x)*r,t.y+(n.y-t.y)*r)}static Dist(e,t){return e.dist(t)}static Dist2(e,t){return e.dist2(t)}static Angle(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}static Nudge(e,t,n){const r=t.sub(e),o=r.len();return 0===o?e.clone():e.add(r.mul(n/o))}static RotWith(t,n,r){const o=t.x-n.x,i=t.y-n.y,s=Math.cos(r),a=Math.sin(r);return new e(n.x+o*s-i*a,n.y+o*a+i*s)}static IsNaN(e){return isNaN(e.x)||isNaN(e.y)}},h=class e{x;y;w;h;constructor(e,t,n,r){this.x=e,this.y=t,this.w=n,this.h=r}get minX(){return this.x}get minY(){return this.y}get maxX(){return this.x+this.w}get maxY(){return this.y+this.h}get center(){return new p(this.x+this.w/2,this.y+this.h/2)}containsPoint(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}containsBox(e){return e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return this.minX<e.maxX&&this.maxX>e.minX&&this.minY<e.maxY&&this.maxY>e.minY}expand(t){return new e(this.x-t,this.y-t,this.w+2*t,this.h+2*t)}clone(){return new e(this.x,this.y,this.w,this.h)}static FromPoints(t){let n=1/0,r=1/0,o=-1/0,i=-1/0;for(const e of t)n=Math.min(n,e.x),r=Math.min(r,e.y),o=Math.max(o,e.x),i=Math.max(i,e.y);return new e(n,r,o-n,i-r)}};function f(e,t,n){const r=t.sub(e),o=n.sub(e),i=r.x*r.x+r.y*r.y;if(0===i)return e;const s=Math.max(0,Math.min(1,(o.x*r.x+o.y*r.y)/i));return new p(e.x+r.x*s,e.y+r.y*s)}function m(e,t,n){return e.dist(f(t,n,e))}function g(e,t,n,r){const o=t.sub(e),i=r.sub(n),s=o.x*i.y-o.y*i.x;if(Math.abs(s)<1e-8)return!1;const a=n.sub(e),l=(a.x*i.y-a.y*i.x)/s,c=(a.x*o.y-a.y*o.x)/s;return l>=0&&l<=1&&c>=0&&c<=1}function y(e,t,n,r){return g(e,t,n,r)?0:Math.min(m(e,n,r),m(t,n,r),m(n,e,t),m(r,e,t))}function x(e,t){if(!function(e){return e.length>=3&&e.every(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}(t))return!1;let n=!1;for(let r=0;r<t.length;r+=1){const o=t[r],i=t[(r+t.length-1)%t.length];if(m(e,i,o)<=1e-8)return!0;o.y>e.y!=i.y>e.y&&e.x<(i.x-o.x)*(e.y-o.y)/(i.y-o.y)+o.x&&(n=!n)}return n}var b=["fill-blue","fill-green","fill-red","fill-amber","fill-white","fill-slate","stroke-blue","stroke-green","stroke-red","stroke-orange","stroke-slate","stroke-muted","text-slate","text-blue","text-green","text-red"],w=Object.fromEntries(b.map(e=>[e,`--land-shape-${e}`])),v={"fill-blue":"#dbeafe","fill-green":"#dcfce7","fill-red":"#fee2e2","fill-amber":"#fff7ed","fill-white":"#f8fafc","fill-slate":"#e2e8f0","stroke-blue":"#1d4ed8","stroke-green":"#15803d","stroke-red":"#dc2626","stroke-orange":"#ea580c","stroke-slate":"#334155","stroke-muted":"#94a3b8","text-slate":"#0f172a","text-blue":"#1d4ed8","text-green":"#15803d","text-red":"#dc2626"};function k(e){return{kind:"theme",slot:e}}function S(e){return{kind:"custom",value:e}}function P(e){return function(e){return!!e&&"object"==typeof e&&"theme"===e.kind&&b.includes(e.slot)}(e)||function(e){return!!e&&"object"==typeof e&&"custom"===e.kind&&"string"==typeof e.value}(e)}function M(e){return w[e]}function I(e,t){return P(e)?e:t}function E(e){return"custom"===e.kind?e.value:`var(${M(e.slot)}, ${v[e.slot]})`}function T(e,t){if("custom"===e.kind)return e.value;const n=M(e.slot),r=v[e.slot];return t?.(n,r)??r}function C(e){if("custom"!==e.kind)return!1;const t=e.value.trim().toLowerCase();return"transparent"===t||/^#[0-9a-f]{6}00$/.test(t)}function O(e,t){return e===t||!(!e||!t)&&(e.kind===t.kind&&("theme"===e.kind?e.slot===t.slot:e.value===t.value))}var A=class e{a;b;c;d;e;f;constructor(e,t,n,r,o,i){this.a=e,this.b=t,this.c=n,this.d=r,this.e=o,this.f=i}static Identity(){return new e(1,0,0,1,0,0)}static Translate(t,n){return new e(1,0,0,1,t,n)}static Rotate(t){const n=Math.cos(t),r=Math.sin(t);return new e(n,r,-r,n,0,0)}static Scale(t,n){return new e(t,0,0,n,0,0)}compose(t){return new e(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.e+this.c*t.f+this.e,this.b*t.e+this.d*t.f+this.f)}applyToPoint(e){return new p(this.a*e.x+this.c*e.y+this.e,this.b*e.x+this.d*e.y+this.f)}determinant(){return this.a*this.d-this.b*this.c}getMaximumLinearScale(){const e=this.a*this.a+this.b*this.b+this.c*this.c+this.d*this.d,t=this.determinant(),n=Math.max(0,e*e-4*t*t);return Math.sqrt((e+Math.sqrt(n))/2)}tryInvert(t=0){const n=this.determinant(),r=Number.isFinite(t)?Math.max(0,t):0;if(!Number.isFinite(n)||Math.abs(n)<=r)return null;const o=1/n;return new e(this.d*o,-this.b*o,-this.c*o,this.a*o,(this.c*this.f-this.d*this.e)*o,(this.b*this.e-this.a*this.f)*o)}invert(){return this.tryInvert()??e.Identity()}toCssString(){return`matrix(${this.a},${this.b},${this.c},${this.d},${this.e},${this.f})`}toSvgString(){return`matrix(${this.a} ${this.b} ${this.c} ${this.d} ${this.e} ${this.f})`}static ForShape(t,n,r,o=1,i=1){const s=e.Translate(t,n),a=0===r?e.Identity():e.Rotate(r),l=1===o&&1===i?e.Identity():e.Scale(o,i);return s.compose(a).compose(l)}};function R(e){return{id:e}}function N(e){return void 0!==e&&e<0?-1:1}function L(e,t){if(void 0===t)return e;const n=2*Math.PI;return e+Math.round((t-e)/n)*n}function $(e,t){const n=2*Math.PI,r=((e-t+Math.PI)%n+n)%n-Math.PI;return Math.abs(r)}function D(e,t,n={}){if(!function(e){return[e.a,e.b,e.c,e.d,e.e,e.f].every(Number.isFinite)}(e)||![t.x,t.y,t.w,t.h].every(Number.isFinite))return null;const r=Number.isFinite(n.epsilon)?Math.max(0,n.epsilon??0):1e-8,o=Math.hypot(e.a,e.b),i=Math.hypot(e.c,e.d),s=e.determinant(),a=({rotation:n,scaleX:r,scaleY:o})=>{const i=t.center,s=e.applyToPoint(i),a={x:s.x-i.x,y:s.y-i.y,rotation:n,scaleX:r,scaleY:o};return Object.values(a).every(Number.isFinite)?a:null},l=r*Math.max(1,o,i),c=o<=l,d=i<=l;if(c||d){if(c&&d)return a({rotation:n.preferredRotation??0,scaleX:0,scaleY:0});if(c){const t=i*N(n.preferredScaleYSign);return a({rotation:L(Math.atan2(-e.c/t,e.d/t),n.preferredRotation),scaleX:0,scaleY:t})}const t=o*N(n.preferredScaleXSign);return a({rotation:L(Math.atan2(e.b/t,e.a/t),n.preferredRotation),scaleX:t,scaleY:0})}if(Math.abs(e.a*e.c+e.b*e.d)/(o*i)>r)return null;if(Math.abs(s)<=r*o*i)return null;const u=Math.atan2(e.b,e.a),p=o,h=i*(s<0?-1:1),f=[{rotation:L(u,n.preferredRotation),scaleX:p,scaleY:h},{rotation:L(u+Math.PI,n.preferredRotation),scaleX:-p,scaleY:-h}],m=N(n.preferredScaleXSign),g=N(n.preferredScaleYSign),y=e=>{let t=0;return void 0!==n.preferredScaleXSign&&N(e.scaleX)===m&&(t+=1),void 0!==n.preferredScaleYSign&&N(e.scaleY)===g&&(t+=1),{signMatches:t,rotationDistance:void 0===n.preferredRotation?0:$(e.rotation,n.preferredRotation)}},x=y(f[0]),b=y(f[1]),w=b.signMatches>x.signMatches||b.signMatches===x.signMatches&&b.rotationDistance<x.rotationDistance?f[1]:f[0];return a({rotation:w.rotation,scaleX:w.scaleX,scaleY:w.scaleY})}new p(24,24);function j(e,t,n){const r=e.shapes.get(t);if(!r)return;const o=e.layers.getContainingParentIdForShape(r);o&&o!==r.parentId&&e.commands.reparentShapes({ids:[t],parentId:o},n)}var B=["top_left","top","top_right","right","bottom_right","bottom","bottom_left","left"],z=["top_left","top_right","bottom_right","bottom_left"],_=["free","aspect_ratio_locked"],F=["free"],W=["aspect_ratio_locked"];function H(e,t){return 0===t.rotation?e.clone():p.RotWith(e,t.rotationCenter,t.rotation)}function U({axis:e,bounds:t,point:n}){return"horizontal"===e?new p(t.minX+t.maxX-n.x,n.y):new p(n.x,t.minY+t.maxY-n.y)}function V({localWidth:e,localHeight:t,scaleX:n,scaleY:r}){return{width:Math.abs(n)*e,height:Math.abs(r)*t}}function K({width:e,height:t,scaleX:n,scaleY:r}){const o=Math.abs(n),i=Math.abs(r);return{width:0===o?e:e/o,height:0===i?t:t/i}}function q({requestedBounds:e,handleId:t,actualWidth:n,actualHeight:r,scaleX:o,scaleY:i,isResizingFromCenter:s}){return new h(s?e.center.x-n/2:function(e){return"top_left"===e||"left"===e||"bottom_left"===e}(t)?o<0?e.minX:e.maxX-n:function(e){return"top_right"===e||"right"===e||"bottom_right"===e}(t)?o<0?e.maxX-n:e.minX:e.center.x-n/2,s?e.center.y-r/2:function(e){return"top_left"===e||"top"===e||"top_right"===e}(t)?i<0?e.minY:e.maxY-r:function(e){return"bottom_left"===e||"bottom"===e||"bottom_right"===e}(t)?i<0?e.maxY-r:e.minY:e.center.y-r/2,n,r)}function Y({outputBounds:e,cutoutLocalPolygons:t,localToOutput:n}){const r=t.filter(e=>e.length>=3);return 0===r.length?null:[X((o=e.expand(100),[new p(o.minX,o.minY),new p(o.maxX,o.minY),new p(o.maxX,o.maxY),new p(o.minX,o.maxY)])),...r.map(e=>X(e,n))].join(" ");var o}function X(e,t){const n=t?e.map(e=>t.applyToPoint(e)):e,r=n[0];return r?[`M ${J(r.x)} ${J(r.y)}`,...n.slice(1).map(e=>`L ${J(e.x)} ${J(e.y)}`),"Z"].join(" "):""}function J(e){return Number.isFinite(e)?Number(e.toFixed(3)).toString():"0"}var G=[{id:"top",normalizedAnchor:{x:.5,y:0},outwardNormal:{x:0,y:-1}},{id:"right",normalizedAnchor:{x:1,y:.5},outwardNormal:{x:1,y:0}},{id:"bottom",normalizedAnchor:{x:.5,y:1},outwardNormal:{x:0,y:1}},{id:"left",normalizedAnchor:{x:0,y:.5},outwardNormal:{x:-1,y:0}}];function Z(e,t){return e.shapes.getUtil(t).getTerminalBindingPorts(t,{editor:e}).flatMap(n=>{const r=ee(e,t,n);return r?[r]:[]})}function Q(e,t,n){const r=e.shapes.getUtil(t).getTerminalBindingPorts(t,{editor:e}).find(e=>e.id===n);return r?ee(e,t,r):null}function ee(e,t,n){const r=e.shapes.getUtil(t),o=r.getLocalBounds(t),i=e.shapes.computeLocalToPageTransform(t),s=function(e,t){const n=e.determinant();return!Number.isFinite(n)||Math.abs(n)<1e-12?p.Zero():new p((e.d*t.x-e.b*t.y)/n,(-e.c*t.x+e.a*t.y)/n).normalize()}(i,new p(n.outwardNormal.x,n.outwardNormal.y));if(s.len2()<1e-12)return null;const a=new p(o.x+o.w*n.normalizedAnchor.x,o.y+o.h*n.normalizedAnchor.y),l=i.applyToPoint(a),c=Math.max(64,o.w*i.getMaximumLinearScale(),o.h*i.getMaximumLinearScale()),d=r.resolveBindingPoint(t,{editor:e,rawPagePoint:l.add(s.mul(c)),oppositePagePoint:l.sub(s.mul(c))});return{id:n.id,normalizedAnchor:{...n.normalizedAnchor},pagePoint:d,pageOutwardNormal:s}}function te(e){return[new p(e.minX,e.minY),new p(e.maxX,e.minY),new p(e.maxX,e.maxY),new p(e.minX,e.maxY)]}function ne(e,t,n,r){const o=t.sub(e),i=r.sub(n),s=o.x*i.y-o.y*i.x;if(Math.abs(s)<1e-8)return null;const a=n.sub(e),l=(a.x*i.y-a.y*i.x)/s,c=(a.x*o.y-a.y*o.x)/s;return l>=0&&l<=1&&c>=0&&c<=1?l:null}function re(e,t,n){const r=e[t];return"number"==typeof r&&Number.isFinite(r)?r:n}var oe=class{getPositionedBounds(e){const t=this.getLocalBounds(e);return new h(t.x+e.x,t.y+e.y,t.w,t.h)}getRenderBounds(e){return this.getLocalBounds(e)}getPointHitTestBounds(e,t){return this.getPositionedBounds(e)}getExportBounds(e){return this.getRenderBounds(e)}getChildClipLocalBounds(e){return null}getChildClipLocalPolygons(e){const t=this.getChildClipLocalBounds(e);return t?[te(t)]:null}getChildExportClipLocalBounds(e){return this.getChildClipLocalBounds(e)}getChildExportClipLocalPolygons(e){const t=this.getChildExportClipLocalBounds(e);return t?[te(t)]:null}getSelectionResizeLocalBounds(e){return this.getLocalBounds(e)}resizeSelectionBounds(e,t){const n=this.getSelectionResizeLocalBounds(e);if(0!==n.x||0!==n.y)throw new Error(`Shape util "${this.type}" must implement resizeSelectionBounds for non-origin local bounds`);const r=K({width:t.selectionLocalBounds.w,height:t.selectionLocalBounds.h,scaleX:e.scaleX,scaleY:e.scaleY}),o=t.scaleX<0!=t.scaleY<0?2*t.selectionRotation-e.rotation:e.rotation,i=this.validateProps({...e.props,w:r.width,h:r.height}),s=re(i,"w",r.width),a=re(i,"h",r.height),l=V({localWidth:s,localHeight:a,scaleX:e.scaleX,scaleY:e.scaleY}),c=H(q({requestedBounds:t.selectionLocalBounds,handleId:t.handleId,actualWidth:l.width,actualHeight:l.height,scaleX:t.scaleX,scaleY:t.scaleY,isResizingFromCenter:t.isResizingFromCenter}).center,{rotation:t.selectionRotation,rotationCenter:t.selectionRotationCenter});return{id:e.id,x:c.x-s/2,y:c.y-a/2,rotation:o,scaleX:t.scaleX<0?-e.scaleX:e.scaleX,scaleY:t.scaleY<0?-e.scaleY:e.scaleY,props:i}}getAllowedSelectionResizeModes(e,t){return _}getSelectionResizeHandleIds(e,t){return B}flipSelectionBounds(e,t){const n=this.getSelectionPagePoints(e);if(n){const r=n.map(e=>{const n=0===t.selectionRotation?e.clone():p.RotWith(e,t.selectionRotationCenter,-t.selectionRotation),r=U({axis:t.axis,bounds:t.selectionBounds,point:n});return 0===t.selectionRotation?r:p.RotWith(r,t.selectionRotationCenter,t.selectionRotation)}),o=this.getSelectionPageMiddlePoint(e),i=o?(()=>{const e=0===t.selectionRotation?o.clone():p.RotWith(o,t.selectionRotationCenter,-t.selectionRotation),n=U({axis:t.axis,bounds:t.selectionBounds,point:e});return 0===t.selectionRotation?n:p.RotWith(n,t.selectionRotationCenter,t.selectionRotation)})():void 0;return this.updateSelectionPagePoints(e,{pagePoints:[r[0],r[1]],pageMiddlePoint:i})}const r=this.getSelectionResizeLocalBounds(e),o=0===t.selectionRotation?t.selectionLocalBounds.center:p.RotWith(t.selectionLocalBounds.center,t.selectionRotationCenter,t.selectionRotation);return{id:e.id,x:o.x-r.center.x,y:o.y-r.center.y,rotation:2*t.selectionRotation-e.rotation,scaleX:"horizontal"===t.axis?-e.scaleX:e.scaleX,scaleY:"vertical"===t.axis?-e.scaleY:e.scaleY}}updateSelectionPagePoints(e,t){throw new Error(`Shape util "${this.type}" must implement updateSelectionPagePoints before selection can transform point-defined geometry`)}getSelectionPagePoints(e){return null}getSelectionPageMiddlePoint(e){return null}contributesToSelectionFrame(e,t){return!0}canParticipateInSelectionResize(e,t){return!0}canParticipateInSelectionFlip(e,t){return this.canParticipateInSelectionResize(e,t)}canParticipateInSelectionRotation(e,t){return!0}canUseSelectionResizeHandles(e,t){return this.canParticipateInSelectionResize(e,t)}canUseSelectionRotateHandle(e,t){return this.canParticipateInSelectionRotation(e,t)}canParticipateInSelectionTranslation(e,t){return!0}getSelectionTargetId(e,t){return e.id}getHoverTargetId(e,t){return e.id}getHoverDecorationTargetId(e,t){return e.id}getTranslateTargetId(e,t){return e.id}isSelectionTransformContainer(e){return!1}shouldRotateDescendants(e){return this.isSelectionTransformContainer(e)}shouldResizeDescendants(e){return!1}getResizeToFitDescendantsProps(e,t){return null}getMinimumChildCount(e){return 0}contributesToExportBounds(e){return!0}canUngroupChildren(e){return!1}getGroupingShapeCreateInput(e){return null}canStartTranslateFromSelectionBounds(e,t){return!0}canSnap(e,t){return!0}canSnapChildrenToSelf(e){return!1}getBoundsSnapGeometry(e){return{}}getHandleSnapGeometry(e){return{outline:te(this.getLocalBounds(e))}}getPositionedOutlineVertices(e){const t=this.getPositionedBounds(e);return[new p(t.minX,t.minY),new p(t.maxX,t.minY),new p(t.maxX,t.maxY),new p(t.minX,t.maxY)]}getSelectionFramePositionedOutlineVertices(e,t){return null}getSelectionHandleAnchors(e,t){return{terminalHandleAnchors:[],middleHandleAnchors:[]}}getSelectionOverlayInfo(e,t){return{usesSelectionPathOverlay:!1,startPagePoint:null,endPagePoint:null,middlePagePoint:null,path:null,pathStyle:null,bindingSegments:[]}}getLabelPathGeometry(e,t){return null}isWrappedByBrush(e,t){return 0===t.pageOutlineVertices.length?!!t.pageBounds&&t.brushBounds.containsBox(t.pageBounds):t.pageOutlineVertices.every(e=>t.brushBounds.containsPoint(e))}canSelectByBrush(e,t){return!t.isWrapping||this.isWrappedByBrush(e,t)}getLocalTransform(e){const t=this.getLocalBounds(e).center;return A.Translate(e.x+t.x,e.y+t.y).compose(A.Rotate(e.rotation)).compose(A.Scale(e.scaleX,e.scaleY)).compose(A.Translate(-t.x,-t.y))}getPositionedTransform(e){const t=this.getLocalBounds(e).center,n=new p(e.x+t.x,e.y+t.y);return A.Translate(n.x,n.y).compose(A.Rotate(e.rotation)).compose(A.Scale(e.scaleX,e.scaleY)).compose(A.Translate(-n.x,-n.y))}canEdit(e){return!1}canReceiveChildren(e){return!1}getChildTransformPolicy(e){return"isometry"}canReceiveChild(e,t){return this.canReceiveChildren(e)}isChildVisible(e,t,n){return!0}getChildPlacementMeta(e,t,n){return t.meta}canAutomaticallyReceiveChildren(e){return this.canReceiveChildren(e)}canBeDirectlyBrushSelected(e){return!0}canReceiveTerminalBinding(e,t){return!1}getTerminalBindingPorts(e,t){return this.canReceiveTerminalBinding(e,t)?G:[]}getTerminalBindingOutlines(e,t){return this.canReceiveTerminalBinding(e,t)?[{points:this.getPositionedOutlineVertices(e),closed:!0}]:[]}canCopyToClipboard(e,t){return!0}onEditEnd(e,t){}hitTest(e,t,n){return this.getPositionedBounds(e).containsPoint(t)}hitTestBindingTarget(e,t,n){return this.hitTest(e,t,n)}hitTestLineSegment(e,t){return function(e,t,n){if(n.containsPoint(e)||n.containsPoint(t))return!0;const r=te(n);for(let o=0;o<r.length;o+=1){const n=r[o],i=r[(o+1)%r.length];if(n&&i&&null!==ne(e,t,n,i))return!0}return!1}(t.positionedStart,t.positionedEnd,this.getPositionedBounds(e).expand(t.positionedMargin))}resolveBindingPoint(e,t){this.getPositionedBounds(e);const n=t.editor.shapes.computePositionedToPageTransform(e),r=n.tryInvert();if(!r)return t.rawPagePoint;const o=function(e,t,n){if(n.length<2)return null;let r=Number.POSITIVE_INFINITY;const o=t.sub(e);for(let i=0;i<n.length;i+=1){const o=n[i],s=n[(i+1)%n.length]??n[0];if(!o||!s)continue;const a=ne(e,t,o,s);null===a||a<=1e-6||a>=r||(r=a)}return Number.isFinite(r)?e.add(o.mul(r)):null}(r.applyToPoint(t.rawPagePoint),r.applyToPoint(t.oppositePagePoint),this.getPositionedOutlineVertices(e));return o?n.applyToPoint(o):t.rawPagePoint}},ie=class{editor;id;parent;children=new Map;currentChild=null;initial=null;constructor(e,t,n){this.editor=e,this.id=t,this.parent=n}addChild(e){this.children.set(e.id,e)}enter(e){if(this.onEnter(e),!this.initial)return;const t=this.children.get(this.initial);if(!t)throw new Error(`Missing child state "${this.initial}" on "${this.id}"`);this.currentChild=t,t.enter(e)}exit(e){this.currentChild&&(this.currentChild.exit(e),this.currentChild=null),this.onExit(e)}transition(e,t){if(!this.parent){const n=this.children.get(e);if(!n)throw new Error(`Missing root child state "${e}" on tool "${this.id}"`);if(this.currentChild===n)return;return this.currentChild?.exit(t),this.currentChild=n,void n.enter(t)}this.parent.transition(e,t)}isInInitialState(){return!this.currentChild||!!this.initial&&(this.currentChild.id===this.initial&&this.currentChild.isInInitialState())}dispatch(e,t){if(this.currentChild)return this.currentChild.dispatch(e,t);switch(e.type){case"pointer":return this.handlePointerEvent(e,t);case"keyboard":return this.handleKeyboardEvent(e,t);case"wheel":return this.onWheel(e,t);case"tick":return this.onTick(e,t);case"cancel":return this.onCancel(e,t)}}onEnter(e){}onExit(e){}onPointerDown(e,t){}onPointerMove(e,t){}onPointerUp(e,t){}onCancel(e,t){}onKeyDown(e,t){}onKeyUp(e,t){}onWheel(e,t){}onTick(e,t){}handlePointerEvent(e,t){switch(e.name){case"pointer_down":return this.onPointerDown(e,t);case"pointer_move":return this.onPointerMove(e,t);case"pointer_up":return this.onPointerUp(e,t);case"pointer_cancel":return this.onCancel({type:"cancel",reason:"pointer_cancel"},t)}}handleKeyboardEvent(e,t){return"key_down"===e.name?this.onKeyDown(e,t):this.onKeyUp(e,t)}};function se(e){return Math.min(1,Math.max(0,(96-e)/96))}function ae(e,t,n){if(t.w<=0||t.h<=0||n<=0)return p.Zero();const r=Math.min(n,32),o=se(e.x),i=se(t.w-e.x),s=se(e.y),a=1.25*(i-o)*r,l=1.25*(se(t.h-e.y)-s)*r;return 0===a&&0===l?p.Zero():new p(a,l)}Math.PI,Math.PI,Math.PI;function le(e,t,n,r={}){let o=!0;return t.graph.effect(e,()=>{t.get(),o&&!1===r.fireImmediately?o=!1:(o=!1,n())})}function ce(e){return Math.max(0,Math.min(1,e))}function de(e,t,n){return e.shapes.computePositionedToPageTransform(t).applyToPoint(function(e,t,n){const r=e.shapes.computePositionedBounds(t);return new p(r.minX+r.w*n.x,r.minY+r.h*n.y)}(e,t,n))}function ue(e,t,n,r){return function(e,t,n,r){return e.shapes.getUtil(t).resolveBindingPoint(t,{editor:e,rawPagePoint:n,oppositePagePoint:r})}(e,t,de(e,t,n),r)}var pe=2*Math.PI;function he(e,t){const n="start"===t?e.props.start:e.props.end;return function(e,t){if(0===e.rotation&&1===e.scaleX&&1===e.scaleY)return t;const n=new p(e.x+e.props.w/2,e.y+e.props.h/2),r=t.sub(n),o=new p(r.x*e.scaleX,r.y*e.scaleY);return n.add(o.rot(e.rotation))}(e,new p(e.x+n.x,e.y+n.y))}function fe(e,t,n){const r="start"===n?t.props.start:t.props.end;return e.shapes.computeLocalToPageTransform(t).applyToPoint(new p(r.x,r.y))}function me(e){return"start"===e?"end":"start"}function ge(e,t,n,r){const o=e.shapes.computeLocalToPageTransform(t).tryInvert();if(!o)return null;const i=xe(o.applyToPoint(n),o.applyToPoint(r)),s=e.shapes.getUtil(t),a={...t,props:{...t.props,w:i.w,h:i.h,start:i.start,end:i.end}},l=D(s.getLocalTransform(t).compose(A.Translate(i.x,i.y)),s.getLocalBounds(a),{preferredRotation:t.rotation,preferredScaleXSign:t.scaleX,preferredScaleYSign:t.scaleY});return l?{...a,...l}:null}function ye(e,t,n,r){return ge(e,t,"start"===n?r:fe(e,t,"start"),"end"===n?r:fe(e,t,"end"))}function xe(e,t){const n=Ie(e.x,t.x),r=Ie(e.y,t.y);return{x:n.origin,y:r.origin,w:n.size,h:r.size,start:{x:n.startOffset,y:r.startOffset},end:{x:n.endOffset,y:r.endOffset}}}function be(e){return Ce(new p(e.props.start.x,e.props.start.y).add(new p(e.x,e.y)),new p(e.props.end.x,e.props.end.y).add(new p(e.x,e.y)),e.props.bend)}function we(e){return Ce(new p(e.props.start.x,e.props.start.y),new p(e.props.end.x,e.props.end.y),e.props.bend)}function ve(e,t,n){const r=p.Med(e,t),o=t.sub(e);if(o.len()<1e-6)return 0;const i=o.per().normalize();return-De(n.sub(r),i)}function ke(e){const t="curved"===e.type&&e.path.includes(" A "),n=t?null:function(e){const t=[];let n=0;for(let r=1;r<e.length;r+=1){const o=e[r-1].dist(e[r]);t.push(o),n+=o}return{length:n,segmentLengths:t}}(e.points),r=t?e.arc.length:n?.length??0,o=n?Se(e.points,n,e.middle,.5):.5;return{length:r,defaultPosition:.5,getPointAt(r){const i=Me(r);return t?Ne(e.start.point,e.end.point,e.arc,i):function(e,t,n){const r=e[0]??p.Zero();if(!t||t.length<=1e-6)return r.clone();const o=t.length*n;let i=0;for(let s=0;s<t.segmentLengths.length;s+=1){const n=t.segmentLengths[s];if(o<=i+n||s===t.segmentLengths.length-1){const t=e[s],r=e[s+1],a=n<=1e-6?0:(o-i)/n;return t.add(r.sub(t).mul(Me(a)))}i+=n}return(e[e.length-1]??r).clone()}(e.points,n,Pe(i,o))},getNearestPosition:(r,i)=>t?function(e,t,n=.5){const r=t.sub(e.arc.center);if(r.len2()<=1e-12)return Me(n);const o=e.arc.center.add(r.normalize().mul(e.arc.radius)),i=Re(e.start.point,e.end.point,e.arc);if(Math.abs(i)<=1e-6)return Me(n);const s=Re(e.start.point,o,e.arc);if(Math.abs(s)<=Math.abs(i)+1e-6)return Me(s/i);const a=t.dist2(e.start.point),l=t.dist2(e.end.point);return Math.abs(a-l)<=1e-8?n<=.5?0:1:a<l?0:1}(e,r,i?.hintPosition):function(e,t){const n=Me(e),r=Me(t);return n<=r?r<=1e-6?.5:n/r*.5:1-r<=1e-6?.5:.5+(n-r)/(1-r)*.5}(Se(e.points,n,r,Pe(i?.hintPosition??.5,o)),o)}}function Se(e,t,n,r=.5){if(!t||t.length<=1e-6)return Me(r);let o=0,i=Me(r),s=1/0;for(let a=0;a<t.segmentLengths.length;a+=1){const l=e[a],c=e[a+1],d=t.segmentLengths[a],u=c.sub(l),p=d<=1e-6?0:Me(De(n.sub(l),u)/u.len2()),h=l.add(u.mul(p)),f=(o+d*p)/t.length,m=h.dist2(n),g=m<s-1e-8,y=Math.abs(m-s)<=1e-8&&Math.abs(f-r)<Math.abs(i-r);(g||y)&&(s=m,i=f),o+=d}return Me(i)}function Pe(e,t){const n=Me(e),r=Me(t);return n<=.5?r*n*2:r+(1-r)*(n-.5)*2}function Me(e){return Math.max(0,Math.min(1,e))}function Ie(e,t){const n=Math.min(e,t),r=Math.max(e,t);return Math.abs(r-n)<1e-6?{origin:n-.5,size:1,startOffset:.5,endOffset:.5}:{origin:n,size:r-n,startOffset:e-n,endOffset:t-n}}function Ee(e){return Number.isFinite(e)?Number(e.toFixed(3)).toString():"0"}function Te(e,t=0){return function(e,t){return"number"==typeof e&&Number.isFinite(e)?e:t}(e,t)}function Ce(e,t,n){const r=Te(n,0),o=function(e,t,n){const r=p.Med(e,t),o=t.sub(e),i=o.len()?o.per().normalize():new p(0,-1);return r.add(i.mul(-n))}(e,t,r),i=function(e,t,n){const r=function(e,t,n){const r=-2*(e.x*(t.y-n.y)-e.y*(t.x-n.x)+t.x*n.y-n.x*t.y);if(Math.abs(r)<1e-6)return null;const o=((e.x*e.x+e.y*e.y)*(n.y-t.y)+(t.x*t.x+t.y*t.y)*(e.y-n.y)+(n.x*n.x+n.y*n.y)*(t.y-e.y))/r,i=((e.x*e.x+e.y*e.y)*(t.x-n.x)+(t.x*t.x+t.y*t.y)*(n.x-e.x)+(n.x*n.x+n.y*n.y)*(e.x-t.x))/r;return Number.isFinite(o)&&Number.isFinite(i)?new p(o,i):null}(e,t,n);if(!r)return null;const o=r.dist(e);if(o<1e-6)return null;const i=(a=e,l=t,c=n,(c.x-a.x)*(l.y-a.y)-(l.x-a.x)*(c.y-a.y)<0?1:0),s=function(e,t,n){const r=e.dist(n),o=n.dist(t),i=t.dist(e);if(o<1e-6||i<1e-6)return 0;const s=(o*o+i*i-r*r)/(2*o*i);return 2*Math.acos(Math.max(-1,Math.min(1,s)))}(e,t,n);var a,l,c;if(!Number.isFinite(s))return null;const d=Math.PI>s?1:0,u=(pe-s)*(i?1:-1);return{center:r,radius:o,largeArcFlag:d,sweepFlag:i,size:u,length:Math.abs(u*o)}}(e,o,t),s=Math.abs(r)<1e-6||null===i||0===i.length||!Number.isFinite(i.length)||!Number.isFinite(i.radius),a=s?[e,t]:Ae(e,t,i,24),l=s||null===i?`M ${Ee(e.x)} ${Ee(e.y)} L ${Ee(t.x)} ${Ee(t.y)}`:`M ${Ee(e.x)} ${Ee(e.y)} A ${Ee(i.radius)} ${Ee(i.radius)} 0 ${i.largeArcFlag} ${i.sweepFlag} ${Ee(t.x)} ${Ee(t.y)}`,c={start:{terminal:"start",point:e,handle:e},end:{terminal:"end",point:t,handle:t},middle:o,bend:r,points:a,bounds:h.FromPoints(a),path:l};return s?{type:"straight",...c,arc:null}:{type:"curved",...c,arc:i}}function Oe({start:e,end:t,middle:n,bend:r,arc:o,startHandle:i=e,endHandle:s=t}){const a=Re(e,t,o);if(Math.abs(a)<1e-6||!Number.isFinite(a)||!Number.isFinite(o.radius)||o.radius<1e-6){const o=Ce(e,t,0);return{...o,start:{...o.start,handle:i},end:{...o.end,handle:s},middle:n,bend:r}}const l={center:o.center,radius:o.radius,largeArcFlag:Math.abs(a)>Math.PI?1:0,sweepFlag:o.sweepFlag,size:a,length:Math.abs(a*o.radius)},c=Ae(e,t,l,24),d=`M ${Ee(e.x)} ${Ee(e.y)} A ${Ee(l.radius)} ${Ee(l.radius)} 0 ${l.largeArcFlag} ${l.sweepFlag} ${Ee(t.x)} ${Ee(t.y)}`;return{type:"curved",start:{terminal:"start",point:e,handle:i},end:{terminal:"end",point:t,handle:s},middle:n,arc:l,bend:r,points:c,bounds:h.FromPoints(c),path:d}}function Ae(e,t,n,r){const o=[],i=p.Angle(n.center,e),s=Re(e,t,n);for(let a=0;a<=r;a++){const e=a/r;o.push(Le(n.center,n.radius,i+s*e))}return o}function Re(e,t,n){return function(e,t,n){const r=t-e;return n?(r%pe+pe)%pe:-((e-t)%pe+pe)%pe}(p.Angle(n.center,e),p.Angle(n.center,t),n.sweepFlag)}function Ne(e,t,n,r){const o=p.Angle(n.center,e),i=Re(e,t,n);return Le(n.center,n.radius,o+i*r)}function Le(e,t,n){return e.add(new p(Math.cos(n)*t,Math.sin(n)*t))}function $e(e,t,n){const r=n.sub(t),o=r.x*r.x+r.y*r.y;if(0===o)return e.dist(t);const i=e.sub(t),s=Math.max(0,Math.min(1,De(i,r)/o)),a=t.add(r.mul(s));return e.dist(a)}function De(e,t){return e.x*t.x+e.y*t.y}var je=["solid","dashed","dotted"];function Be(e){return"string"==typeof e&&je.includes(e)}function ze(e){return!!e&&"shape"===e.typeName&&"arrow"===e.type}function _e(e){return!!e&&"binding"===e.typeName&&"arrow"===e.type}function Fe(e,t,n){return e.bindings.getFromShape(t.id).find(e=>_e(e)&&e.props.terminal===n)??null}function We(e,t,n){const r=fe(e,t,n),o=Fe(e,t,n);if(!o)return{terminal:n,binding:null,target:null,handlePagePoint:r,boundaryPagePoint:r,isArcBoundaryPoint:!0};const i=e.shapes.get(o.toId);return!i||ze(i)?{terminal:n,binding:o,target:null,handlePagePoint:r,boundaryPagePoint:r,isArcBoundaryPoint:!0}:{terminal:n,binding:o,target:i,handlePagePoint:de(e,i,o.props.normalizedAnchor),boundaryPagePoint:r,isArcBoundaryPoint:!1}}function He(e,t){const n=We(e,t,"start"),r=We(e,t,"end"),o=qe(e,t,n.handlePagePoint,r.handlePagePoint);return"curved"===o.type&&(Ze(e,n,o,"start"),Ze(e,r,o,"end")),{info:Ye(o,n,r),fullInfo:o,bindingSegments:[Qe(n,o),Qe(r,o)].filter(e=>null!==e)}}function Ue(e,t){if(!Fe(e,t,"start")&&!Fe(e,t,"end"))return we(t);const n=e.shapes.computeLocalToPageTransform(t).tryInvert();return n?function(e,t,n){const r=Ke(t.info,n);if("curved"!==t.info.type)return r;const o=Ce(n.applyToPoint(t.fullInfo.start.point),n.applyToPoint(t.fullInfo.end.point),e.props.bend);if("curved"!==o.type)return r;const i=n.applyToPoint(t.info.start.point),s=n.applyToPoint(t.info.end.point),a=function(e,t,n){const r=t.sub(e);if(r.len2()<1e-12)return null;const o=p.Med(e,t),i=r.per().normalize(),s=n.sub(o),a=s.x*i.x+s.y*i.y;return o.add(i.mul(a))}(i,s,o.arc.center);if(!a)return r;const l={center:a,radius:a.dist(i),sweepFlag:o.arc.sweepFlag},c=Ne(i,s,l,.5);return Oe({start:i,end:s,middle:c,bend:ve(i,s,c),arc:l,startHandle:n.applyToPoint(t.info.start.handle),endHandle:n.applyToPoint(t.info.end.handle)})}(t,He(e,t),n):Ce(new p(t.props.start.x,t.props.start.y),new p(t.props.end.x,t.props.end.y),t.props.bend)}function Ve(e,t,n){return{...e,start:{...e.start,handle:t},end:{...e.end,handle:n}}}function Ke(e,t){const n=e=>t.applyToPoint(e),r=n(e.start.point),o=n(e.end.point),i=n(e.middle),s=e.points.map(n),a=s.map((e,t)=>`${0===t?"M":"L"} ${Ge(e.x)} ${Ge(e.y)}`).join(" "),l={start:{...e.start,point:r,handle:n(e.start.handle)},end:{...e.end,point:o,handle:n(e.end.handle)},middle:i,bend:ve(r,o,i),points:s,bounds:h.FromPoints(s),path:a};if("straight"===e.type)return{...e,...l};const c=n(e.arc.center),d={...e.arc,center:c,radius:c.dist(r),sweepFlag:t.determinant()<0?1===e.arc.sweepFlag?0:1:e.arc.sweepFlag};return function(e){const t=Math.hypot(e.a,e.b),n=Math.hypot(e.c,e.d),r=Math.max(1,t,n);return Math.abs(t-n)<=1e-8*r&&Math.abs(e.a*e.c+e.b*e.d)<=1e-8*r*r}(t)?Oe({start:r,end:o,middle:i,bend:l.bend,arc:d,startHandle:l.start.handle,endHandle:l.end.handle}):{...e,...l,arc:d}}function qe(e,t,n,r){const o=e.shapes.computeLocalToPageTransform(t),i=o.tryInvert();return i?Ke(Ce(i.applyToPoint(n),i.applyToPoint(r),t.props.bend),o):Ce(n,r,t.props.bend)}function Ye(e,t,n){if(t.boundaryPagePoint.dist2(e.start.point)<1e-10&&n.boundaryPagePoint.dist2(e.end.point)<1e-10)return Ve(e,t.handlePagePoint,n.handlePagePoint);if("straight"===e.type)return Ve(Ce(t.boundaryPagePoint,n.boundaryPagePoint,0),t.handlePagePoint,n.handlePagePoint);if(e.path.includes(" A "))return Oe({start:t.boundaryPagePoint,end:n.boundaryPagePoint,middle:Ne(t.boundaryPagePoint,n.boundaryPagePoint,e.arc,.5),bend:e.bend,arc:e.arc,startHandle:t.handlePagePoint,endHandle:n.handlePagePoint});const r=Xe(e.points,t.boundaryPagePoint),o=Xe(e.points,n.boundaryPagePoint),i=[t.boundaryPagePoint];for(let a=Math.floor(r)+1;a<=Math.floor(o);a+=1){const t=e.points[a];t&&a<o&&i.push(t)}i.push(n.boundaryPagePoint);const s=function(e){if(0===e.length)return p.Zero();const t=[];let n=0;for(let o=0;o<e.length-1;o+=1){const r=e[o].dist(e[o+1]);t.push(r),n+=r}let r=n/2;for(let o=0;o<t.length;o+=1){const n=t[o];if(r<=n){const t=e[o];return t.add(e[o+1].sub(t).mul(0===n?0:r/n))}r-=n}return e[e.length-1]}(i);return{...e,start:{...e.start,point:t.boundaryPagePoint,handle:t.handlePagePoint},end:{...e.end,point:n.boundaryPagePoint,handle:n.handlePagePoint},middle:s,points:i,bounds:h.FromPoints(i),path:Je(i),bend:ve(t.boundaryPagePoint,n.boundaryPagePoint,s)}}function Xe(e,t){let n=0,r=1/0;for(let o=0;o<e.length-1;o+=1){const i=e[o],s=e[o+1].sub(i),a=s.len2(),l=0===a?0:Math.max(0,Math.min(1,((t.x-i.x)*s.x+(t.y-i.y)*s.y)/a)),c=i.add(s.mul(l)).dist2(t);c<r&&(r=c,n=o+l)}return n}function Je(e){return e.map((e,t)=>`${0===t?"M":"L"} ${Ge(e.x)} ${Ge(e.y)}`).join(" ")}function Ge(e){return Number(e.toFixed(3)).toString()}function Ze(e,t,n,r){if(!t.target)return void(t.isArcBoundaryPoint=!0);const o=nt(e.shapes.getPageOutlineVertices(t.target.id),n,r);o?(t.boundaryPagePoint=o,t.isArcBoundaryPoint=!0):t.isArcBoundaryPoint=!1}function Qe(e,t){if(!e.binding)return null;const n=function(e,t){return{terminal:e.terminal,anchorPagePoint:e.handlePagePoint,boundaryPagePoint:e.boundaryPagePoint,guidePath:"curved"===t.type&&e.isArcBoundaryPoint?tt(e.terminal,e.handlePagePoint,e.boundaryPagePoint,t):null}}(e,t);return{terminal:n.terminal,anchorPagePoint:n.anchorPagePoint,boundaryPagePoint:n.boundaryPagePoint,guidePath:n.guidePath}}function et(e,{arrow:t,terminal:n,target:r,anchorPagePoint:o,fallbackBoundaryPagePoint:i}){const s=function(e,t,n){return We(e,t,n).handlePagePoint}(e,t,me(n)),a=qe(e,t,"start"===n?o:s,"end"===n?o:s);if("curved"!==a.type)return{terminal:n,anchorPagePoint:o,boundaryPagePoint:i,guidePath:null};const l=nt(e.shapes.getPageOutlineVertices(r.id),a,n);return l?{terminal:n,anchorPagePoint:o,boundaryPagePoint:l,guidePath:tt(n,o,l,a)}:{terminal:n,anchorPagePoint:o,boundaryPagePoint:i,guidePath:null}}function tt(e,t,n,r){if(r.path.includes(" A "))return function({terminal:e,handlePagePoint:t,boundaryPagePoint:n,fullInfo:r}){if(t.dist(n)<1e-6)return null;const o="start"===e?r.arc.sweepFlag:function(e){return e?0:1}(r.arc.sweepFlag),i={center:r.arc.center,radius:r.arc.radius,sweepFlag:o};return Oe({start:t,end:n,middle:Ne(t,n,i,.5),bend:r.bend,arc:i}).path}({terminal:e,handlePagePoint:t,boundaryPagePoint:n,fullInfo:r});const o=Xe(r.points,n),i=[t];if("start"===e)for(let s=1;s<=Math.floor(o);s+=1){const e=r.points[s];e&&s<o&&i.push(e)}else for(let s=r.points.length-2;s>=Math.ceil(o);s-=1){const e=r.points[s];e&&s>o&&i.push(e)}return i.push(n),Je(i)}function nt(e,t,n){const r=[];for(let o=0;o<t.points.length-1;o+=1){const n=t.points[o],i=t.points[o+1];for(let t=0;t<e.length;t+=1){const s=e[t],a=e[(t+1)%e.length];if(!s||!a)continue;const l=rt(n,i,s,a);l&&r.push({point:l.point,position:o+l.t})}}return 0===r.length?null:(r.sort((e,t)=>e.position-t.position),"start"===n?r[0].point:r[r.length-1].point)}function rt(e,t,n,r){const o=t.sub(e),i=r.sub(n),s=o.x*i.y-o.y*i.x;if(Math.abs(s)<1e-9)return null;const a=n.sub(e),l=(a.x*i.y-a.y*i.x)/s,c=(a.x*o.y-a.y*o.x)/s;return l<-1e-9||l>1.000000001||c<-1e-9||c>1.000000001?null:{point:e.add(o.mul(Math.max(0,Math.min(1,l)))),t:Math.max(0,Math.min(1,l))}}function ot(e,t){const n=e.shapes.getPageBounds(t.id)??e.shapes.computePageBounds(t);return n.w*n.h}function it(e,t){return e.shapes.getUtil(t).canReceiveChildren(t)}function st(e,t){return!(!t||ze(t))&&e.shapes.getUtil(t).canReceiveTerminalBinding(t,{editor:e})}function at(e,t,n){const r=it(e,t),o=it(e,n);if(r!==o)return r?1:-1;if(r&&o){const r=ot(e,t)-ot(e,n);if(Math.abs(r)>1e-6)return r}return 0}function lt(e,t){return"number"==typeof e&&Number.isFinite(e)?e:t}function ct(e){if(e)return{shapes:[e]}}var dt=class extends u{type="arrow";getDefaultProps(){return{terminal:"start",normalizedAnchor:{x:.5,y:.5}}}validateProps(e){const t=e&&"object"==typeof e?e:{},n=this.getDefaultProps(),r=t.normalizedAnchor&&"object"==typeof t.normalizedAnchor?t.normalizedAnchor:n.normalizedAnchor;return{terminal:"end"===t.terminal?"end":n.terminal,normalizedAnchor:{x:Math.min(1,Math.max(0,lt(r.x,n.normalizedAnchor.x))),y:Math.min(1,Math.max(0,lt(r.y,n.normalizedAnchor.y)))}}}canBind(e,t,n){return ze(n.fromShape)&&st(e,n.toShape)}getExclusiveBindingKey(e){return`${e.fromId}:${e.props.terminal}`}onBindingCreate(e,t){return ct(this.syncArrowTerminal(e,t))}onBindingUpdate(e,t,n){return ct(this.syncArrowTerminal(e,n))}onBindingLoad(e,t){return ct(this.syncArrowTerminal(e,t))}getGeometryDependentShapeIds(e,t,n){return"to"===n.role?[t.fromId]:[]}onAfterShapeChange(e,t,n){return ct(this.syncArrowTerminal(e,t))}onBeforeDeleteShape(e,t,n){if("from"===n.role)return{deleteBindingIds:[t.id]};const r=e.shapes.get(t.fromId);if(!ze(r))return{deleteBindingIds:[t.id]};const o=this.resolveTerminalPagePoint(e,t);return{shapes:[o?ye(e,r,t.props.terminal,o)??r:r],deleteBindingIds:[t.id]}}onBeforeDeleteBinding(e,t){const n=e.shapes.get(t.fromId);if(!ze(n))return{deleteBindingIds:[t.id]};const r=this.resolveTerminalPagePoint(e,t);return{shapes:[r?ye(e,n,t.props.terminal,r)??n:n],deleteBindingIds:[t.id]}}syncArrowTerminal(e,t){if(!_e(t))return null;const n=e.shapes.get(t.fromId);if(!ze(n))return null;const r=this.resolveTerminalPagePoint(e,t);return r?fe(e,n,t.props.terminal).dist(r)<1e-6?null:ye(e,n,t.props.terminal,r):null}resolveTerminalPagePoint(e,t){if(!_e(t))return null;const n=e.shapes.get(t.fromId),r=e.shapes.get(t.toId);if(!ze(n)||!r||ze(r))return null;const o=fe(e,n,me(t.props.terminal)),i=ue(e,r,t.props.normalizedAnchor,o);return et(e,{arrow:n,terminal:t.props.terminal,target:r,anchorPagePoint:de(e,r,t.props.normalizedAnchor),fallbackBoundaryPagePoint:i}).boundaryPagePoint}};function ut(e){return Object.freeze({id:e,kind:"api"})}function pt(e,t,n="user"){if(t.parentId?.startsWith("shape:")){const n=e.shapes.get(t.parentId);if(!n||!e.shapes.computeLocalToPageTransform(n).tryInvert())throw new Error("Cannot create an arrow inside a singular parent transform")}const[r]=e.commands.createShapes([{type:"arrow",x:t.startPagePoint.x,y:t.startPagePoint.y,parentId:t.parentId,props:t.props,meta:t.meta}],{source:n,autoReparent:!1});if(!ze(r))throw new Error("Failed to create arrow shape");const o=ge(e,r,t.startPagePoint,t.endPagePoint);if(!o)throw new Error("Cannot create an arrow inside a singular parent transform");e.commands.updateShapes([{id:r.id,x:o.x,y:o.y,rotation:o.rotation,scaleX:o.scaleX,scaleY:o.scaleY,props:{...o.props}}],{source:n}),t.startBinding&&e.commands.createBinding({type:"arrow",fromId:o.id,toId:t.startBinding.targetShapeId,props:{terminal:"start",normalizedAnchor:t.startBinding.normalizedAnchor}},{source:n}),t.endBinding&&e.commands.createBinding({type:"arrow",fromId:o.id,toId:t.endBinding.targetShapeId,props:{terminal:"end",normalizedAnchor:t.endBinding.normalizedAnchor}},{source:n});const i=e.shapes.get(o.id);if(!ze(i))throw new Error("Failed to create arrow shape");return i}function ht(e,t,n,r,o="user"){if(!t)return e.interaction.setBindingPreview(r.preview),null;let i=null;return i=function(e,t,n){const r=e.shapes.get(t.shapeId);if(!ze(r))return null;const o=ye(e,r,t.terminal,t.pagePoint);if(!o)return null;e.commands.updateShapes([{id:r.id,x:o.x,y:o.y,rotation:o.rotation,scaleX:o.scaleX,scaleY:o.scaleY,props:{...o.props}}],{source:n});const i=e.bindings.getFromShape(r.id).find(e=>_e(e)&&e.props.terminal===t.terminal)??null;t.binding?_e(i)?e.commands.updateBinding({id:i.id,toId:t.binding.targetShapeId,props:{terminal:t.terminal,normalizedAnchor:t.binding.normalizedAnchor}},{source:n}):(i&&e.commands.deleteBinding(i.id,{source:n}),e.commands.createBinding({type:"arrow",fromId:r.id,toId:t.binding.targetShapeId,props:{terminal:t.terminal,normalizedAnchor:t.binding.normalizedAnchor}},{source:n})):i&&(e.commands.deleteBinding(i.id,{source:n}),e.commands.updateShapes([{id:r.id,x:o.x,y:o.y,rotation:o.rotation,scaleX:o.scaleX,scaleY:o.scaleY,props:{...o.props}}],{source:n}));const s=e.shapes.get(r.id);return ze(s)?s:o}(e,{shapeId:t,terminal:n,pagePoint:r.pagePoint,binding:r.binding},o),e.interaction.setBindingPreview(r.preview),i}var ft=ut("plugin-arrow.api");function mt({editor:e}){return function({editor:e}){return{create(t){const n=e.shapes.getDefaultProps("arrow"),r=pt(e,{startPagePoint:new p(t.start.x,t.start.y),endPagePoint:new p(t.end.x,t.end.y),startBinding:t.startBinding?{targetShapeId:t.startBinding.targetShapeId,normalizedAnchor:t.startBinding.normalizedAnchor}:null,endBinding:t.endBinding?{targetShapeId:t.endBinding.targetShapeId,normalizedAnchor:t.endBinding.normalizedAnchor}:null,meta:t.meta?{...t.meta}:void 0,props:{...n,bend:t.bend??n.bend,stroke:t.stroke??n.stroke,strokeStyle:t.strokeStyle??n.strokeStyle,strokeWidth:t.strokeWidth??n.strokeWidth,headStart:t.headStart??n.headStart,headEnd:t.headEnd??n.headEnd}});return{id:r.id,type:r.type}},getSelectionStyle(){const t=e.state.selectedShapes.get().filter(ze);return 0===t.length?null:{stroke:gt(t.map(e=>e.props.stroke)),strokeStyle:gt(t.map(e=>e.props.strokeStyle)),strokeWidth:gt(t.map(e=>e.props.strokeWidth)),headStart:gt(t.map(e=>e.props.headStart)),headEnd:gt(t.map(e=>e.props.headEnd))}},setSelectionStyle(t){const n=e.state.selectedShapes.get().filter(ze).filter(e=>!e.isLocked).map(e=>({id:e.id,props:{...t}}));return n.length>0&&e.commands.updateShapes(n,{source:"user"}),n.map(({id:e})=>e)},getToolDefaults:()=>e.shapes.getDefaultProps("arrow"),setToolDefaults:t=>(e.shapes.updateDefaultProps("arrow",t),e.shapes.getDefaultProps("arrow"))}}({editor:e})}function gt(e){const[t,...n]=e;return void 0!==t&&n.every(e=>e===t)?t:null}function yt(e,t){const n=[];return"arrow"===t.headStart&&n.push(bt(e,"start",t.strokeWidth)),"arrow"===t.headEnd&&n.push(bt(e,"end",t.strokeWidth)),{path:n.length>0?n.map(xt).join(" "):null,points:n.flat()}}function xt([e,t,n]){return[`M ${wt(e.x)} ${wt(e.y)}`,`L ${wt(t.x)} ${wt(t.y)}`,`L ${wt(n.x)} ${wt(n.y)}`].join(" ")}function bt(e,t,n){const r=e[t].point,o=function(e,t){if("curved"===e.type){const n=e[t].point.sub(e.arc.center).per().mul(1===e.arc.sweepFlag?1:-1).normalize();if(n.len2()>0)return n}const n=e.end.point.sub(e.start.point).normalize();return n.len2()>0?n:new p(1,0)}(e,t),i=3.45*n*("start"===t?1:-1),s=o.per().mul(2*n),a=r.add(o.mul(i));return[a.sub(s),r,a.add(s)]}function wt(e){return Number.isFinite(e)?Number(e.toFixed(3)).toString():"0"}function vt(e,t){switch(e){case"dashed":return`${4*t} ${2*t}`;case"dotted":return"0 "+2*t;default:return}}function kt(e,t){const n=e&&"object"==typeof e?e:void 0;return{x:St(n?.x,t.x),y:St(n?.y,t.y)}}function St(e,t){return"number"==typeof e&&Number.isFinite(e)?e:t}function Pt(e,t,n){const r=n.sub(t),o=r.len2();if(0===o)return e.dist(t);const i=e.sub(t),s=Math.max(0,Math.min(1,(i.x*r.x+i.y*r.y)/o));return e.dist(t.add(r.mul(s)))}function Mt(e,t,n,r){return function(e,t,n,r){const o=t.sub(e),i=r.sub(n),s=o.x*i.y-o.y*i.x;if(Math.abs(s)<1e-8)return!1;const a=n.sub(e),l=(a.x*i.y-a.y*i.x)/s,c=(a.x*o.y-a.y*o.x)/s;return l>=0&&l<=1&&c>=0&&c<=1}(e,t,n,r)?0:Math.min(Pt(e,n,r),Pt(t,n,r),Pt(n,e,t),Pt(r,e,t))}var It=class extends oe{type="arrow";getDefaultProps(){return{w:160,h:48,start:{x:8,y:24},end:{x:152,y:24},bend:0,stroke:k("stroke-slate"),strokeStyle:"solid",strokeWidth:2,headStart:"none",headEnd:"arrow"}}validateProps(e){const t=e&&"object"==typeof e?e:{},n=this.getDefaultProps();return{w:Math.max(1,St(t.w,n.w)),h:Math.max(1,St(t.h,n.h)),start:kt(t.start,n.start),end:kt(t.end,n.end),bend:St(t.bend,n.bend),stroke:I(t.stroke,n.stroke),strokeStyle:Be(t.strokeStyle)?t.strokeStyle:n.strokeStyle,strokeWidth:Math.max(1,St(t.strokeWidth,n.strokeWidth)),headStart:"arrow"===t.headStart?"arrow":"none",headEnd:"none"===t.headEnd?"none":"arrow"}}getPositionedBounds(e){const t=be(e),n=Math.max(6,.5*e.props.strokeWidth+4);return t.bounds.expand(n)}getPointHitTestBounds(e,t){const n=Math.max(8,e.props.strokeWidth+4);if(!t?.editor)return be(e).bounds.expand(n);const r=He(t.editor,e).info,o=t.editor.shapes.computePositionedToPageTransform(e).tryInvert();if(!o||0===r.points.length)return be(e).bounds.expand(n);const i=n*Math.sqrt(o.a*o.a+o.b*o.b+o.c*o.c+o.d*o.d);return h.FromPoints(r.points.map(e=>o.applyToPoint(e))).expand(i)}getLocalBounds(e){return new h(0,0,e.props.w,e.props.h)}getExportBounds(e){const t=we(e),n=Math.max(6,.5*e.props.strokeWidth+4);return t.bounds.expand(n)}updateSelectionPagePoints(e,t){const n=this.getSelectionPageMiddlePoint(e);if(t.pageMiddlePoint&&n){const r=this.getSelectionPagePoints(e),o=function(e,t){const n=e[1].sub(e[0]),r=e[2].sub(e[0]),o=n.x*r.y-n.y*r.x;if(Math.abs(o)<1e-9)return null;const i=new A(r.y/o,-n.y/o,-r.x/o,n.x/o,0,0),s=t[1].sub(t[0]),a=t[2].sub(t[0]),l=new A(s.x,s.y,a.x,a.y,0,0).compose(i);return new A(l.a,l.b,l.c,l.d,t[0].x-l.a*e[0].x-l.c*e[0].y,t[0].y-l.b*e[0].x-l.d*e[0].y)}([r[0],r[1],n],[t.pagePoints[0],t.pagePoints[1],t.pageMiddlePoint]);if(o){const t=D(o.compose(this.getLocalTransform(e)),this.getLocalBounds(e),{preferredRotation:e.rotation,preferredScaleXSign:e.scaleX,preferredScaleYSign:e.scaleY});if(t)return{id:e.id,...t}}}const r=function(e,t,n){const r=xe(t,n);return{...e,x:r.x,y:r.y,rotation:0,scaleX:1,scaleY:1,props:{...e.props,w:r.w,h:r.h,start:r.start,end:r.end,bend:e.props.bend}}}(e,t.pagePoints[0],t.pagePoints[1]);return{id:e.id,x:r.x,y:r.y,rotation:r.rotation,scaleX:r.scaleX,scaleY:r.scaleY,props:{w:r.props.w,h:r.props.h,start:r.props.start,end:r.props.end,bend:t.pageMiddlePoint?ve(t.pagePoints[0],t.pagePoints[1],t.pageMiddlePoint):r.props.bend}}}isWrappedByBrush(e,t){return t.pageOutlineVertices.every(e=>t.brushBounds.containsPoint(e))}getSelectionPagePoints(e){return[he(e,"start"),he(e,"end")]}getSelectionPageMiddlePoint(e){return this.getLocalTransform(e).applyToPoint(we(e).middle)}contributesToSelectionFrame(e,t){return t.editor.selection.getIds().length>1}canUseSelectionResizeHandles(e,t){return t.editor.selection.getIds().length>1}canUseSelectionRotateHandle(e,t){return t.editor.selection.getIds().length>1}canStartTranslateFromSelectionBounds(e,t){return t.editor.selection.getIds().length>1}getSelectionHandleAnchors(e,t){if(!t.isOnlySelected)return{terminalHandleAnchors:[],middleHandleAnchors:[]};const n=He(t.editor,e).info;return{terminalHandleAnchors:[{kind:"binding_terminal",terminal:"start",point:n.start.handle},{kind:"binding_terminal",terminal:"end",point:n.end.handle}],middleHandleAnchors:n.middle?[{kind:"binding_middle",point:n.middle}]:[]}}getSelectionOverlayInfo(e,t){const n=He(t.editor,e),r=n.info,o=Ue(t.editor,e),i=yt(o,e.props),s=t.editor.shapes.computeLocalToPageTransform(e);return{usesSelectionPathOverlay:!0,startPagePoint:r.start.point,endPagePoint:r.end.point,middlePagePoint:r.middle,path:r.path,pathStyle:{localPath:o.path,localDecorationPaths:i.path?[i.path]:[],localBounds:h.FromPoints([...o.points,...i.points]),localToPage:s,strokeWidth:e.props.strokeWidth,strokeDasharray:vt(e.props.strokeStyle,e.props.strokeWidth)},pageClipPath:Y({outputBounds:r.bounds,cutoutLocalPolygons:t.editor.shapes.getContentCutoutLocalPolygonsSignal(e.id).get(),localToOutput:s}),bindingSegments:n.bindingSegments}}getLabelPathGeometry(e,t){return ke(He(t.editor,e).info)}hitTest(e,t,n){return function(e,t){let n=1/0;for(let r=0;r<e.points.length-1;r++)n=Math.min(n,$e(t,e.points[r],e.points[r+1]));return Number.isFinite(n)?n:t.dist(e.start.point)}(n?.editor?He(n.editor,e).info:be(e),n?.pagePoint??t)<=Math.max(8,e.props.strokeWidth+4)}hitTestLineSegment(e,t){const n=t.editor?He(t.editor,e).info:be(e),r=Math.max(8,e.props.strokeWidth+4,t.editor?t.pageMargin:t.positionedMargin),o=t.editor?t.pageStart:t.positionedStart,i=t.editor?t.pageEnd:t.positionedEnd;if(1===n.points.length)return Pt(n.points[0],o,i)<=r;for(let s=0;s<n.points.length-1;s+=1){const e=n.points[s],t=n.points[s+1];if(e&&t&&Mt(o,i,e,t)<=r)return!0}return!1}};function Et(e,t,n,r){const o=function(e,t){let n=null;for(const r of t)(!n||at(e,r,n)<0)&&(n=r);return n}(e,e.shapes.hitTestPoint(t,{hitTest:"bindingTarget",filter:t=>t.id!==r?.excludeShapeId&&st(e,t)}));if(!o)return null;const i=function(e,t,n){const r=e.shapes.computePositionedToPageTransform(t).tryInvert(),o=e.shapes.computePositionedBounds(t);if(!r)return{x:.5,y:.5};const i=r.applyToPoint(n),s=o.w<=1e-6?.5:(i.x-o.minX)/o.w,a=o.h<=1e-6?.5:(i.y-o.minY)/o.h;return{x:ce(s),y:ce(a)}}(e,o,t);return{targetShape:o,normalizedAnchor:i,resolvedPagePoint:ue(e,o,i,n),rawPagePoint:t.clone()}}function Tt(e,{terminal:t,rawPagePoint:n,oppositePagePoint:r,excludeShapeId:o,ignoreTargets:i=!1}){if(i)return{pagePoint:n.clone(),binding:null,preview:null};const s=Et(e,n,r,{excludeShapeId:o});return{pagePoint:s?.resolvedPagePoint??n.clone(),binding:At(s),preview:Rt(t,s)}}function Ct(e,{terminal:t,rawPagePoint:n,ignoreTargets:r=!1}){return Tt(e,{terminal:t,rawPagePoint:n,oppositePagePoint:n.add(new p(1,0)),ignoreTargets:r})}function Ot(e,{arrow:t,terminal:n,rawPagePoint:r,ignoreTargets:o=!1}){const i=Tt(e,{terminal:n,rawPagePoint:r,oppositePagePoint:fe(e,t,me(n)),excludeShapeId:t.id,ignoreTargets:o});if(!i.preview)return i;const s=function(e,{arrow:t,terminal:n,rawPagePoint:r,preview:o}){const i=e.shapes.get(o.targetShapeId);if(!i||ze(i))return o;const s=et(e,{arrow:t,terminal:n,target:i,anchorPagePoint:r,fallbackBoundaryPagePoint:o.resolvedPagePoint});return{...o,resolvedPagePoint:s.boundaryPagePoint,guidePath:s.guidePath}}(e,{arrow:t,terminal:n,rawPagePoint:r,preview:i.preview});return{...i,pagePoint:s.resolvedPagePoint,preview:s}}function At(e){return e?{targetShapeId:e.targetShape.id,normalizedAnchor:e.normalizedAnchor}:null}function Rt(e,t){return t?{terminal:e,targetShapeId:t.targetShape.id,rawPagePoint:t.rawPagePoint,resolvedPagePoint:t.resolvedPagePoint}:null}var Nt=class extends ie{constructor(e){super(e,"arrow"),this.initial="idle",this.addChild(new Lt(e,this)),this.addChild(new $t(e,this))}},Lt=class extends ie{constructor(e,t){super(e,"idle",t)}onEnter(){this.editor.interaction.clearSelection()}onPointerDown(e){const t=this.editor.shapes.getDefaultProps("arrow"),n=Ct(this.editor,{terminal:"start",rawPagePoint:e.pagePoint,ignoreTargets:e.accelKey});this.transition("creating",{startPagePoint:n.pagePoint,startScreenPoint:e.screenPoint.clone(),currentPagePoint:n.pagePoint.clone(),shapeId:null,startBinding:n.binding,props:t})}},$t=class extends ie{info=null;operation=null;isClickCreating=!1;constructor(e,t){super(e,"creating",t)}onEnter(e){if(this.info=e,this.isClickCreating=!1,!this.info)return;this.operation=this.editor.operations.begin({kind:"arrow.create",label:"shape.create",source:"user",history:"record"});const t=pt(this.editor,{startPagePoint:this.info.startPagePoint,endPagePoint:this.info.startPagePoint,startBinding:this.info.startBinding,props:{stroke:this.info.props.stroke,strokeStyle:this.info.props.strokeStyle,strokeWidth:this.info.props.strokeWidth,headStart:this.info.props.headStart,headEnd:this.info.props.headEnd}},"user");this.info.shapeId=t.id,this.editor.commands.setSelectedShapeIds([t.id],{source:"system"}),this.editor.interaction.setBindingPreview(null),this.updateCreationBindingGuides(t)}onPointerDown(e){this.isClickCreating&&this.updateShape(e.pagePoint)}onPointerMove(e){this.updateShape(e.pagePoint)}onTick(e){if(!this.info)return;const t=this.editor.inputs.state.get();if("dragging"!==t.dragPhase||!t.currentPagePoint||!t.currentScreenPoint)return;const n=ae(t.currentScreenPoint,this.editor.state.viewportScreenSize.get(),e.elapsed);0===n.x&&0===n.y||(this.editor.viewport.pan(n),this.updateShape(this.editor.viewport.screenToPage(t.currentScreenPoint)))}onPointerUp(e){if(this.info)return this.updateShape(e.pagePoint),this.info.shapeId?this.info.startScreenPoint.dist(e.screenPoint)<10?this.isClickCreating?(this.cancelOperation(),this.transition("idle"),{clickSequence:"break"}):void(this.isClickCreating=!0):(j(this.editor,this.info.shapeId,{source:"user"}),this.commitOperation(),this.editor.state.tool.get().isToolLocked?(this.transition("idle"),{clickSequence:"break"}):(this.editor.commands.setActiveTool("select",{source:"system"}),{clickSequence:"break"})):(this.cancelOperation(),void this.transition("idle"));this.transition("idle")}onCancel(){this.cancelOperation(),this.transition("idle")}onExit(){this.cancelOperation(),this.editor.interaction.setTerminalBindingGuides(null),this.info=null,this.isClickCreating=!1}commitOperation(){const e=this.operation;this.operation=null,e?.commit()}cancelOperation(){const e=this.operation;this.operation=null,e?.isActive&&e.cancel()}updateShape(e){if(!this.info)return;this.info.currentPagePoint=e.clone();const t=this.info.shapeId,n=t?this.editor.shapes.get(t):null,r=ze(n)?Ot(this.editor,{arrow:n,terminal:"end",rawPagePoint:e,ignoreTargets:this.editor.inputs.state.get().accelKey}):Tt(this.editor,{terminal:"end",rawPagePoint:e,oppositePagePoint:this.info.startPagePoint,ignoreTargets:this.editor.inputs.state.get().accelKey}),o=this.info.startBinding&&r.binding?.targetShapeId===this.info.startBinding.targetShapeId?{pagePoint:e,binding:null,preview:null}:r,i=ht(this.editor,t,"end",o,"user")??(t?this.editor.shapes.get(t):null);this.updateCreationBindingGuides(ze(i)?i:null)}updateCreationBindingGuides(e){if(!e)return void this.editor.interaction.setTerminalBindingGuides(null);const t=new Map(this.editor.bindings.getFromShape(e.id).filter(_e).map(e=>[e.props.terminal,e.toId])),n=He(this.editor,e).bindingSegments.map(n=>({...n,ownerShapeId:e.id,targetShapeId:t.get(n.terminal)??null}));this.editor.interaction.setTerminalBindingGuides(n)}};function Dt({shapeId:e}){return{shapeId:e,operationKind:"select.binding_middle_drag",update({editor:t,pagePoint:n,accelKey:r,source:o}){const i=t.shapes.get(e);if(!ze(i))return"stop";const s=function(e,t){return{start:We(e,t,"start").handlePagePoint,end:We(e,t,"end").handlePagePoint}}(t,i),a=ve(s.start,s.end,n),l=t.shapes.computeLocalToPageTransform(i).tryInvert();if(!l)return"stop";const c=ve(l.applyToPoint(s.start),l.applyToPoint(s.end),l.applyToPoint(n)),d=0===function({bend:e,bypassSnap:t,zoom:n}){return t?e:Math.abs(e)*n<=6?0:e}({bend:a,bypassSnap:r,zoom:t.state.cameraZoom.get()})?0:c;return t.commands.updateShapes([{id:i.id,props:{bend:d}}],{source:o}),"continue"}}}function jt(){return{createSession:(e,{handle:t,shape:n})=>ze(n)?"binding_terminal"===t.kind?function({handle:e,shapeId:t,terminal:n}){return{shapeId:t,operationKind:"select.binding_terminal_drag",handleSnapMode:"point",handleSnapContext:{shapeId:t,handle:e},shouldClearBindingPreviewOnExit:!0,update({editor:e,pagePoint:r,accelKey:o,source:i}){const s=e.shapes.get(t);if(!ze(s))return{status:"stop",finalPagePoint:null};const a=Ot(e,{arrow:s,terminal:n,rawPagePoint:r,ignoreTargets:o}),l=ht(e,s.id,n,a,i);return{status:"continue",finalPagePoint:l?fe(e,l,n):a.pagePoint}}}}({handle:t,shapeId:n.id,terminal:t.terminal}):"binding_middle"===t.kind?Dt({shapeId:n.id}):null:null}}function Bt(){return{id:"land.arrow.interactions",selectionHandle:jt()}}var zt=class{type="arrow";toSvg(e,t){const n=t.resolveColor(e.props.stroke),r=Ue(t.editor,e),o=Y({outputBounds:r.bounds,cutoutLocalPolygons:t.editor.shapes.getContentCutoutLocalPolygonsSignal(e.id).get()}),i=o?t.addDef({tag:"clipPath",attrs:{clipPathUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{d:o,"clip-rule":"evenodd","fill-rule":"evenodd"}}]}):void 0,s="arrow"===e.props.headStart?`url(#${t.addDef(Ft("start",n))})`:void 0,a="arrow"===e.props.headEnd?`url(#${t.addDef(Ft("end",n))})`:void 0;return{tag:"path",attrs:{d:r.path,fill:"none",stroke:n,"stroke-width":e.props.strokeWidth,"stroke-dasharray":vt(e.props.strokeStyle,e.props.strokeWidth),"stroke-linecap":"round","stroke-linejoin":"round","marker-start":s,"marker-end":a,"clip-path":i?`url(#${i})`:void 0}}}};function _t(){return{id:"land.arrow",shapeUtils:[new It],shapeSvgExporters:[new zt],bindingUtils:[new dt],interactionHandlers:[Bt()],setup(e){e.bindings.setTerminalResolver(Tt),e.tools.register("arrow",e=>new Nt(e))}}}function Ft(e,t){return{tag:"marker",attrs:{markerWidth:12,markerHeight:12,viewBox:"0 0 24 24",refX:"start"===e?2:22,refY:12,orient:"auto",markerUnits:"strokeWidth"},children:[{tag:"path",attrs:{d:"start"===e?"M8.9,8 L2,12 L8.9,16":"M15.1,8 L22,12 L15.1,16",fill:"none",stroke:t,"stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"}}]}}var Wt=a(e=>{var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),h=Symbol.iterator;var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,g={};function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||f}function x(){}function b(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||f}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},x.prototype=y.prototype;var w=b.prototype=new x;w.constructor=b,m(w,y.prototype),w.isPureReactComponent=!0;var v=Array.isArray;function k(){}var S={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function M(e,n,r){var o=r.ref;return{$$typeof:t,type:e,key:n,ref:void 0!==o?o:null,props:r}}function I(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}var E=/\/+/g;function T(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(n=""+e.key,r={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var n,r}function C(e,r,o,i,s){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var l,c,d=!1;if(null===e)d=!0;else switch(a){case"bigint":case"string":case"number":d=!0;break;case"object":switch(e.$$typeof){case t:case n:d=!0;break;case u:return C((d=e._init)(e._payload),r,o,i,s)}}if(d)return s=s(e),d=""===i?"."+T(e,0):i,v(s)?(o="",null!=d&&(o=d.replace(E,"$&/")+"/"),C(s,r,o,"",function(e){return e})):null!=s&&(I(s)&&(l=s,c=o+(null==s.key||e&&e.key===s.key?"":(""+s.key).replace(E,"$&/")+"/")+d,s=M(l.type,c,l.props)),r.push(s)),1;d=0;var p,f=""===i?".":i+":";if(v(e))for(var m=0;m<e.length;m++)d+=C(i=e[m],r,o,a=f+T(i,m),s);else if("function"==typeof(m=null===(p=e)||"object"!=typeof p?null:"function"==typeof(p=h&&p[h]||p["@@iterator"])?p:null))for(e=m.call(e),m=0;!(i=e.next()).done;)d+=C(i=i.value,r,o,a=f+T(i,m++),s);else if("object"===a){if("function"==typeof e.then)return C(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(k,k):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(e),r,o,i,s);throw r=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===r?"object with keys {"+Object.keys(e).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.")}return d}function O(e,t,n){if(null==e)return e;var r=[],o=0;return C(e,r,"","",function(e){return t.call(n,e,o++)}),r}function A(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var R="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},N={map:O,forEach:function(e,t,n){O(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return O(e,function(){t++}),t},toArray:function(e){return O(e,function(e){return e})||[]},only:function(e){if(!I(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};e.Activity=p,e.Children=N,e.Component=y,e.Fragment=r,e.Profiler=i,e.PureComponent=b,e.StrictMode=o,e.Suspense=c,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=S,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return S.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var r=m({},e.props),o=e.key;if(null!=t)for(i in void 0!==t.key&&(o=""+t.key),t)!P.call(t,i)||"key"===i||"__self"===i||"__source"===i||"ref"===i&&void 0===t.ref||(r[i]=t[i]);var i=arguments.length-2;if(1===i)r.children=n;else if(1<i){for(var s=Array(i),a=0;a<i;a++)s[a]=arguments[a+2];r.children=s}return M(e.type,o,r)},e.createContext=function(e){return(e={$$typeof:a,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:s,_context:e},e},e.createElement=function(e,t,n){var r,o={},i=null;if(null!=t)for(r in void 0!==t.key&&(i=""+t.key),t)P.call(t,r)&&"key"!==r&&"__self"!==r&&"__source"!==r&&(o[r]=t[r]);var s=arguments.length-2;if(1===s)o.children=n;else if(1<s){for(var a=Array(s),l=0;l<s;l++)a[l]=arguments[l+2];o.children=a}if(e&&e.defaultProps)for(r in s=e.defaultProps)void 0===o[r]&&(o[r]=s[r]);return M(e,i,o)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:l,render:e}},e.isValidElement=I,e.lazy=function(e){return{$$typeof:u,_payload:{_status:-1,_result:e},_init:A}},e.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},e.startTransition=function(e){var t=S.T,n={};S.T=n;try{var r=e(),o=S.S;null!==o&&o(n,r),"object"==typeof r&&null!==r&&"function"==typeof r.then&&r.then(k,R)}catch(i){R(i)}finally{null!==t&&null!==n.types&&(t.types=n.types),S.T=t}},e.unstable_useCacheRefresh=function(){return S.H.useCacheRefresh()},e.use=function(e){return S.H.use(e)},e.useActionState=function(e,t,n){return S.H.useActionState(e,t,n)},e.useCallback=function(e,t){return S.H.useCallback(e,t)},e.useContext=function(e){return S.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return S.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return S.H.useEffect(e,t)},e.useEffectEvent=function(e){return S.H.useEffectEvent(e)},e.useId=function(){return S.H.useId()},e.useImperativeHandle=function(e,t,n){return S.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return S.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return S.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return S.H.useMemo(e,t)},e.useOptimistic=function(e,t){return S.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return S.H.useReducer(e,t,n)},e.useRef=function(e){return S.H.useRef(e)},e.useState=function(e){return S.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return S.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return S.H.useTransition()},e.version="19.2.6"}),Ht=a((e,t)=>{"production"!==process.env.NODE_ENV&&function(){function n(e,t){Object.defineProperty(o.prototype,e,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})}function r(e,t){var n=(e=(e=e.constructor)&&(e.displayName||e.name)||"ReactClass")+"."+t;U[n]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,e),U[n]=!0)}function o(e,t,n){this.props=e,this.context=t,this.refs=q,this.updater=n||V}function i(){}function s(e,t,n){this.props=e,this.context=t,this.refs=q,this.updater=n||V}function a(){}function l(e){return""+e}function c(e){try{l(e);var t=!1}catch(o){t=!0}if(t){var n=(t=console).error,r="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",r),l(e)}}function d(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===Z?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case R:return"Fragment";case L:return"Profiler";case N:return"StrictMode";case B:return"Suspense";case z:return"SuspenseList";case W:return"Activity"}if("object"==typeof e)switch("number"==typeof e.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case A:return"Portal";case D:return e.displayName||"Context";case $:return(e._context.displayName||"Context")+".Consumer";case j:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case _:return null!==(t=e.displayName||null)?t:d(e.type)||"Memo";case F:t=e._payload,e=e._init;try{return d(e(t))}catch(n){}}return null}function u(e){if(e===R)return"<>";if("object"==typeof e&&null!==e&&e.$$typeof===F)return"<...>";try{var t=d(e);return t?"<"+t+">":"<...>"}catch(n){return"<...>"}}function p(){var e=Q.A;return null===e?null:e.getOwner()}function h(){return Error("react-stack-top-frame")}function f(e){if(ee.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}function m(){var e=d(this.type);return ne[e]||(ne[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),void 0!==(e=this.props.ref)?e:null}function g(e,t,n,r,o,i){var s=n.ref;return e={$$typeof:O,type:e,key:t,props:n,_owner:r},null!==(void 0!==s?s:null)?Object.defineProperty(e,"ref",{enumerable:!1,get:m}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:o}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:i}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function y(e){x(e)?e._store&&(e._store.validated=1):"object"==typeof e&&null!==e&&e.$$typeof===F&&("fulfilled"===e._payload.status?x(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function x(e){return"object"==typeof e&&null!==e&&e.$$typeof===O}function b(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(c(e.key),n=""+e.key,r={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var n,r}function w(e,t,n,r,o){var i=typeof e;"undefined"!==i&&"boolean"!==i||(e=null);var s,l,d,u=!1;if(null===e)u=!0;else switch(i){case"bigint":case"string":case"number":u=!0;break;case"object":switch(e.$$typeof){case O:case A:u=!0;break;case F:return w((u=e._init)(e._payload),t,n,r,o)}}if(u){o=o(u=e);var p=""===r?"."+b(u,0):r;return G(o)?(n="",null!=p&&(n=p.replace(se,"$&/")+"/"),w(o,t,n,"",function(e){return e})):null!=o&&(x(o)&&(null!=o.key&&(u&&u.key===o.key||c(o.key)),s=o,l=n+(null==o.key||u&&u.key===o.key?"":(""+o.key).replace(se,"$&/")+"/")+p,l=g(s.type,l,s.props,s._owner,s._debugStack,s._debugTask),s._store&&(l._store.validated=s._store.validated),n=l,""!==r&&null!=u&&x(u)&&null==u.key&&u._store&&!u._store.validated&&(n._store.validated=2),o=n),t.push(o)),1}if(u=0,p=""===r?".":r+":",G(e))for(var h=0;h<e.length;h++)u+=w(r=e[h],t,n,i=p+b(r,h),o);else if("function"==typeof(h=null===(d=e)||"object"!=typeof d?null:"function"==typeof(d=H&&d[H]||d["@@iterator"])?d:null))for(h===e.entries&&(ie||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),ie=!0),e=h.call(e),h=0;!(r=e.next()).done;)u+=w(r=r.value,t,n,i=p+b(r,h++),o);else if("object"===i){if("function"==typeof e.then)return w(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(a,a):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(e),t,n,r,o);throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return u}function v(e,t,n){if(null==e)return e;var r=[],o=0;return w(e,r,"","",function(e){return t.call(n,e,o++)}),r}function k(e){if(-1===e._status){var t=e._ioInfo;null!=t&&(t.start=t.end=performance.now());var n=(t=e._result)();if(n.then(function(t){if(0===e._status||-1===e._status){e._status=1,e._result=t;var r=e._ioInfo;null!=r&&(r.end=performance.now()),void 0===n.status&&(n.status="fulfilled",n.value=t)}},function(t){if(0===e._status||-1===e._status){e._status=2,e._result=t;var r=e._ioInfo;null!=r&&(r.end=performance.now()),void 0===n.status&&(n.status="rejected",n.reason=t)}}),null!=(t=e._ioInfo)){t.value=n;var r=n.displayName;"string"==typeof r&&(t.name=r)}-1===e._status&&(e._status=0,e._result=n)}if(1===e._status)return void 0===(t=e._result)&&console.error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",t),"default"in t||console.error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",t),t.default;throw e._result}function S(){var e=Q.H;return null===e&&console.error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."),e}function P(){Q.asyncTransitions--}function M(e){if(null===ce)try{var n=("require"+Math.random()).slice(0,7);ce=(t&&t[n]).call(t,"timers").setImmediate}catch(r){ce=function(e){!1===le&&(le=!0,"undefined"==typeof MessageChannel&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(void 0)}}return ce(e)}function I(e){return 1<e.length&&"function"==typeof AggregateError?new AggregateError(e):e[0]}function E(e,t){t!==de-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),de=t}function T(e,t,n){var r=Q.actQueue;if(null!==r)if(0!==r.length)try{return C(r),void M(function(){return T(e,t,n)})}catch(o){Q.thrownErrors.push(o)}else Q.actQueue=null;0<Q.thrownErrors.length?(r=I(Q.thrownErrors),Q.thrownErrors.length=0,n(r)):t(e)}function C(e){if(!pe){pe=!0;var t=0;try{for(;t<e.length;t++)for(var n=e[t];;){Q.didUsePromise=!1;var r=n(!1);if(null===r)break;if(Q.didUsePromise)return e[t]=n,void e.splice(0,t);n=r}e.length=0}catch(o){e.splice(0,t+1),Q.thrownErrors.push(o)}finally{pe=!1}}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var O=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),$=Symbol.for("react.consumer"),D=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),H=Symbol.iterator,U={},V={isMounted:function(){return!1},enqueueForceUpdate:function(e){r(e,"forceUpdate")},enqueueReplaceState:function(e){r(e,"replaceState")},enqueueSetState:function(e){r(e,"setState")}},K=Object.assign,q={};Object.freeze(q),o.prototype.isReactComponent={},o.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},o.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var Y={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(fe in Y)Y.hasOwnProperty(fe)&&n(fe,Y[fe]);i.prototype=o.prototype,(Y=s.prototype=new i).constructor=s,K(Y,o.prototype),Y.isPureReactComponent=!0;var X,J,G=Array.isArray,Z=Symbol.for("react.client.reference"),Q={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},ee=Object.prototype.hasOwnProperty,te=console.createTask?console.createTask:function(){return null},ne={},re=(Y={react_stack_bottom_frame:function(e){return e()}}).react_stack_bottom_frame.bind(Y,h)(),oe=te(u(h)),ie=!1,se=/\/+/g,ae="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},le=!1,ce=null,de=0,ue=!1,pe=!1,he="function"==typeof queueMicrotask?function(e){queueMicrotask(function(){return queueMicrotask(e)})}:M;Y=Object.freeze({__proto__:null,c:function(e){return S().useMemoCache(e)}});var fe={map:v,forEach:function(e,t,n){v(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return v(e,function(){t++}),t},toArray:function(e){return v(e,function(e){return e})||[]},only:function(e){if(!x(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};e.Activity=W,e.Children=fe,e.Component=o,e.Fragment=R,e.Profiler=L,e.PureComponent=s,e.StrictMode=N,e.Suspense=B,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Q,e.__COMPILER_RUNTIME=Y,e.act=function(e){var t=Q.actQueue,n=de;de++;var r=Q.actQueue=null!==t?t:[],o=!1;try{var i=e()}catch(l){Q.thrownErrors.push(l)}if(0<Q.thrownErrors.length)throw E(0,n),e=I(Q.thrownErrors),Q.thrownErrors.length=0,e;if(null!==i&&"object"==typeof i&&"function"==typeof i.then){var s=i;return he(function(){o||ue||(ue=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(e,t){o=!0,s.then(function(o){if(E(0,n),0===n){try{C(r),M(function(){return T(o,e,t)})}catch(s){Q.thrownErrors.push(s)}if(0<Q.thrownErrors.length){var i=I(Q.thrownErrors);Q.thrownErrors.length=0,t(i)}}else e(o)},function(e){E(0,n),0<Q.thrownErrors.length?(e=I(Q.thrownErrors),Q.thrownErrors.length=0,t(e)):t(e)})}}}var a=i;if(E(0,n),0===n&&(C(r),0!==r.length&&he(function(){o||ue||(ue=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),Q.actQueue=null),0<Q.thrownErrors.length)throw e=I(Q.thrownErrors),Q.thrownErrors.length=0,e;return{then:function(e,t){o=!0,0===n?(Q.actQueue=r,M(function(){return T(a,e,t)})):e(a)}}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.captureOwnerStack=function(){var e=Q.getCurrentStack;return null===e?null:e()},e.cloneElement=function(e,t,n){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var r,o=K({},e.props),i=e.key,s=e._owner;if(null!=t)for(a in(r=!(ee.call(t,"ref")&&(r=Object.getOwnPropertyDescriptor(t,"ref").get)&&r.isReactWarning)&&void 0!==t.ref)&&(s=p()),f(t)&&(c(t.key),i=""+t.key),t)!ee.call(t,a)||"key"===a||"__self"===a||"__source"===a||"ref"===a&&void 0===t.ref||(o[a]=t[a]);var a=arguments.length-2;if(1===a)o.children=n;else if(1<a){r=Array(a);for(var l=0;l<a;l++)r[l]=arguments[l+2];o.children=r}for(o=g(e.type,i,o,s,e._debugStack,e._debugTask),i=2;i<arguments.length;i++)y(arguments[i]);return o},e.createContext=function(e){return(e={$$typeof:D,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:$,_context:e},e._currentRenderer=null,e._currentRenderer2=null,e},e.createElement=function(e,t,n){for(var r=2;r<arguments.length;r++)y(arguments[r]);r={};var o=null;if(null!=t)for(l in J||!("__self"in t)||"key"in t||(J=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),f(t)&&(c(t.key),o=""+t.key),t)ee.call(t,l)&&"key"!==l&&"__self"!==l&&"__source"!==l&&(r[l]=t[l]);var i=arguments.length-2;if(1===i)r.children=n;else if(1<i){for(var s=Array(i),a=0;a<i;a++)s[a]=arguments[a+2];Object.freeze&&Object.freeze(s),r.children=s}if(e&&e.defaultProps)for(l in i=e.defaultProps)void 0===r[l]&&(r[l]=i[l]);o&&function(e,t){function n(){X||(X=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(r,"function"==typeof e?e.displayName||e.name||"Unknown":e);var l=1e4>Q.recentlyCreatedOwnerStacks++;return g(e,o,r,p(),l?Error("react-stack-top-frame"):re,l?te(u(e)):oe)},e.createRef=function(){var e={current:null};return Object.seal(e),e},e.forwardRef=function(e){null!=e&&e.$$typeof===_?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?console.error("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&null!=e.defaultProps&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var t,n={$$typeof:j,render:e};return Object.defineProperty(n,"displayName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(n){t=n,e.name||e.displayName||(Object.defineProperty(e,"name",{value:n}),e.displayName=n)}}),n},e.isValidElement=x,e.lazy=function(e){var t={$$typeof:F,_payload:e={_status:-1,_result:e},_init:k},n={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return e._ioInfo=n,t._debugInfo=[{awaited:n}],t},e.memo=function(e,t){var n;return e??console.error("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),t={$$typeof:_,type:e,compare:void 0===t?null:t},Object.defineProperty(t,"displayName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(t){n=t,e.name||e.displayName||(Object.defineProperty(e,"name",{value:t}),e.displayName=t)}}),t},e.startTransition=function(e){var t=Q.T,n={};n._updatedFibers=new Set,Q.T=n;try{var r=e(),o=Q.S;null!==o&&o(n,r),"object"==typeof r&&null!==r&&"function"==typeof r.then&&(Q.asyncTransitions++,r.then(P,P),r.then(a,ae))}catch(i){ae(i)}finally{null===t&&n._updatedFibers&&(e=n._updatedFibers.size,n._updatedFibers.clear(),10<e&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),null!==t&&null!==n.types&&(null!==t.types&&t.types!==n.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),t.types=n.types),Q.T=t}},e.unstable_useCacheRefresh=function(){return S().useCacheRefresh()},e.use=function(e){return S().use(e)},e.useActionState=function(e,t,n){return S().useActionState(e,t,n)},e.useCallback=function(e,t){return S().useCallback(e,t)},e.useContext=function(e){var t=S();return e.$$typeof===$&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),t.useContext(e)},e.useDebugValue=function(e,t){return S().useDebugValue(e,t)},e.useDeferredValue=function(e,t){return S().useDeferredValue(e,t)},e.useEffect=function(e,t){return e??console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),S().useEffect(e,t)},e.useEffectEvent=function(e){return S().useEffectEvent(e)},e.useId=function(){return S().useId()},e.useImperativeHandle=function(e,t,n){return S().useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return e??console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),S().useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return e??console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),S().useLayoutEffect(e,t)},e.useMemo=function(e,t){return S().useMemo(e,t)},e.useOptimistic=function(e,t){return S().useOptimistic(e,t)},e.useReducer=function(e,t,n){return S().useReducer(e,t,n)},e.useRef=function(e){return S().useRef(e)},e.useState=function(e){return S().useState(e)},e.useSyncExternalStore=function(e,t,n){return S().useSyncExternalStore(e,t,n)},e.useTransition=function(){return S().useTransition()},e.version="19.2.6","undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()}),Ut=a((e,t)=>{"production"===process.env.NODE_ENV?t.exports=Wt():t.exports=Ht()}),Vt=l(Ut()),Kt=(0,Vt.createContext)(null);function qt(){const e=(0,Vt.useContext)(Kt);if(!e)throw new Error("useEditor must be used within EditorContext.Provider");return e}var Yt=a(e=>{var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(e,n,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==n.key&&(o=""+n.key),"key"in n)for(var i in r={},n)"key"!==i&&(r[i]=n[i]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:o,ref:void 0!==n?n:null,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r}),Xt=a(e=>{"production"!==process.env.NODE_ENV&&function(){function t(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===M?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case f:return"Fragment";case g:return"Profiler";case m:return"StrictMode";case w:return"Suspense";case v:return"SuspenseList";case P:return"Activity"}if("object"==typeof e)switch("number"==typeof e.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case h:return"Portal";case x:return e.displayName||"Context";case y:return(e._context.displayName||"Context")+".Consumer";case b:var n=e.render;return(e=e.displayName)||(e=""!==(e=n.displayName||n.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case k:return null!==(n=e.displayName||null)?n:t(e.type)||"Memo";case S:n=e._payload,e=e._init;try{return t(e(n))}catch(r){}}return null}function n(e){return""+e}function r(e){try{n(e);var t=!1}catch(i){t=!0}if(t){var r=(t=console).error,o="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),n(e)}}function o(e){if(e===f)return"<>";if("object"==typeof e&&null!==e&&e.$$typeof===S)return"<...>";try{var n=t(e);return n?"<"+n+">":"<...>"}catch(r){return"<...>"}}function i(){return Error("react-stack-top-frame")}function s(){var e=t(this.type);return O[e]||(O[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),void 0!==(e=this.props.ref)?e:null}function a(e,n,o,i,a,c){var u,h=n.children;if(void 0!==h)if(i)if(T(h)){for(i=0;i<h.length;i++)l(h[i]);Object.freeze&&Object.freeze(h)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else l(h);if(E.call(n,"key")){h=t(e);var f=Object.keys(n).filter(function(e){return"key"!==e});i=0<f.length?"{key: someKey, "+f.join(": ..., ")+": ...}":"{key: someKey}",N[h+i]||(f=0<f.length?"{"+f.join(": ..., ")+": ...}":"{}",console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',i,h,f,h),N[h+i]=!0)}if(h=null,void 0!==o&&(r(o),h=""+o),function(e){if(E.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(n)&&(r(n.key),h=""+n.key),"key"in n)for(var m in o={},n)"key"!==m&&(o[m]=n[m]);else o=n;return h&&function(e,t){function n(){d||(d=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(o,"function"==typeof e?e.displayName||e.name||"Unknown":e),function(e,t,n,r,o,i){var a=n.ref;return e={$$typeof:p,type:e,key:t,props:n,_owner:r},null!==(void 0!==a?a:null)?Object.defineProperty(e,"ref",{enumerable:!1,get:s}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:o}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:i}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}(e,h,o,null===(u=I.A)?null:u.getOwner(),a,c)}function l(e){c(e)?e._store&&(e._store.validated=1):"object"==typeof e&&null!==e&&e.$$typeof===S&&("fulfilled"===e._payload.status?c(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function c(e){return"object"==typeof e&&null!==e&&e.$$typeof===p}var d,u=Ut(),p=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),y=Symbol.for("react.consumer"),x=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),M=Symbol.for("react.client.reference"),I=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,E=Object.prototype.hasOwnProperty,T=Array.isArray,C=console.createTask?console.createTask:function(){return null},O={},A=(u={react_stack_bottom_frame:function(e){return e()}}).react_stack_bottom_frame.bind(u,i)(),R=C(o(i)),N={};e.Fragment=f,e.jsx=function(e,t,n){var r=1e4>I.recentlyCreatedOwnerStacks++;return a(e,t,n,!1,r?Error("react-stack-top-frame"):A,r?C(o(e)):R)},e.jsxs=function(e,t,n){var r=1e4>I.recentlyCreatedOwnerStacks++;return a(e,t,n,!0,r?Error("react-stack-top-frame"):A,r?C(o(e)):R)}}()}),Jt=a((e,t)=>{"production"===process.env.NODE_ENV?t.exports=Yt():t.exports=Xt()})();function Gt(e,t,n,r){if(e.has(t))throw new Error(`Duplicate ${r}: ${t}.`);e.set(t,n)}function Zt(e,t,n){if(e.has(t))throw new Error(`Duplicate ${n}: ${t}.`);e.add(t)}function Qt(e,t){return(e.order??0)-(t.order??0)}var en=function(e){const t=new Set,n=new Map,r=[],o=new Set,i=new Map,s=new Map,a=[],l=new Set,c=[],d=new Set;for(const m of e){Zt(t,m.id,"canvas render plugin id");for(const e of m.shapeRenderers??[])Gt(n,e.type,e,"shape renderer type");for(const e of m.shapeOpacityModifiers??[])Zt(o,e.id,"shape opacity modifier id"),r.push(e);for(const e of m.canvasOverlays??[])Gt(i,e.id,e,"canvas overlay id");for(const e of m.selectionCustomHandleRenderers??[])Gt(s,e.type,e,"selection handle renderer type");for(const e of m.domEventGuards??[])Zt(l,e.id,"DOM event guard id"),a.push(e);for(const e of m.canvasComponents??[])Zt(d,e.id,"canvas component id"),c.push(e)}const u=Object.freeze([...i.values()].sort(Qt)),p=Object.freeze({getShapeRenderer:e=>n.get(e)??null,getShapeOpacityValue(e,t){const n=r.map(n=>n.getOpacityValue(e,t));return Object.freeze({graph:e.signals,get:()=>n.reduce((e,t)=>e*t.get(),1)})}}),h=Object.freeze({getCanvasOverlays:()=>u,getSelectionCustomHandleRenderer:e=>s.get(e)??null}),f=Object.freeze({handle(e){for(const t of a)if("handled"===t.handle(e))return"handled";return"continue"},getCursor(e){for(const t of a){const n=t.getCursor?.(e);if(void 0!==n)return n}}});return Object.freeze({canvasComponents:Object.freeze(c),renderers:p,overlays:h,domEventGuards:f})}([]),tn=(0,Vt.createContext)(en);function nn(){return(0,Vt.useContext)(tn)}function rn(){return nn().renderers}function on(){return nn().overlays}function sn(e){const t=(0,Vt.useCallback)(t=>le("useValue",e,t,{fireImmediately:!1}),[e]),n=(0,Vt.useCallback)(()=>e.get(),[e]);return(0,Vt.useSyncExternalStore)(t,n,n)}function an({children:e,clipAncestorIds:t,shapeElementToPage:n}){return 0===t.length? (0,Jt.jsx)(Jt.Fragment,{children:e}):t.reduceRight((e,t)=> (0,Jt.jsx)(ln,{ancestorId:t,shapeElementToPage:n,children:e},t),e)}function ln({ancestorId:e,children:t,shapeElementToPage:n}){const r=qt(),o=sn(r.shapes.getSignal(e));if(!o) return(0,Jt.jsx)(Jt.Fragment,{children:t});const i=function(e,t,n){const r=e.shapes.getUtil(t).getChildClipLocalPolygons(t);if(!r)return null;const o=e.shapes.computeRenderToPageTransform(t),i=n.tryInvert();if(!i)return null;const s=r.filter(e=>e.length>=3).map(e=>e.map(e=>i.applyToPoint(o.applyToPoint(e)))).filter(e=>e.every(e=>Number.isFinite(e.x)&&Number.isFinite(e.y)));return 0===s.length?null:1===s.length?`polygon(${s[0].map(dn).join(", ")})`:`path("${s.map(cn).join(" ")}")`}(r,o,n);return i? (0,Jt.jsx)("div",{"data-ui":"shape-clip-boundary","data-clip-ancestor-id":e,style:{position:"absolute",inset:0,width:"100%",height:"100%",clipPath:i,WebkitClipPath:i,overflow:"visible"},children:t}): (0,Jt.jsx)(Jt.Fragment,{children:t})}function cn(e){return e.map((e,t)=>`${0===t?"M":"L"} ${un(e.x)} ${un(e.y)}`).concat("Z").join(" ")}function dn(e){return`${un(e.x)}px ${un(e.y)}px`}function un(e){return Number.isFinite(e)?Number(e.toFixed(3)).toString():"0"}var pn="var(--land-shape-hover, var(--land-selection, #2563eb))",hn=(0,Vt.memo)(function(e){const{Component:t,editor:n,isSelected:r,shape:o,shapeEditingSession:i}=e;
2
+ return(0,Jt.jsx)(t,{editor:n,isSelected:r,shape:o,shapeEditingSession:i})});function fn({Component:e,editor:t,shape:n}){
3
+ return(0,Jt.jsx)("div",{"aria-hidden":"true","data-ui":"shape-hover-decoration",style:{position:"absolute",inset:0,pointerEvents:"none"},children: (0,Jt.jsx)(e,{shape:n,editor:t,strokeWidth:2/sn(t.state.cameraZoom)})})}function mn(e,t,n){const r=e.shapes.computeRenderBounds(t),o=n.compose(A.Translate(r.x,r.y));return{left:0,top:0,width:r.w,height:r.h,transform:o.toCssString(),transformOrigin:"0 0",elementToPage:o}}var gn=(0,Vt.memo)(function({shapeId:e,stackingOrder:t}){const n=qt(),r=sn(n.shapes.getSignal(e)),o=sn(n.shapes.getLocalToPageTransformSignal(e)),i=sn(n.shapes.getRenderVisibleSignal(e)),s=sn(n.shapes.getSelectedSignal(e)),a=sn(n.shapes.getEditingSessionSignal(e)),l=sn(n.shapes.getEffectiveOpacitySignal(e)),c=sn(n.shapes.getClipAncestorIdsSignal(e)),d=rn(),u=sn((0,Vt.useMemo)(()=>d.getShapeOpacityValue(n,e),[n,d,e]));if(!r||!o)return null;const p=d.getShapeRenderer(r.type)?.foregroundComponent;if(!p)return null;const h=mn(n,r,o),f=l*u;
4
+ return(0,Jt.jsx)("div",{"data-ui":"shape-foreground","data-owner-shape-id":r.id,"data-owner-shape-type":r.type,style:{position:"absolute",display:i?void 0:"none",left:h.left,top:h.top,width:h.width,height:h.height,opacity:1===f?void 0:f,transform:h.transform,transformOrigin:h.transformOrigin,pointerEvents:"none",zIndex:t+1},children:i? (0,Jt.jsx)(an,{clipAncestorIds:c,shapeElementToPage:h.elementToPage,children: (0,Jt.jsx)(hn,{Component:p,shape:r,editor:n,isSelected:s,shapeEditingSession:a})}):null})});function yn(){
5
+ return(0,Jt.jsx)("div",{"data-ui":"transform-descendant-ancestor-boundary",style:{position:"absolute",inset:0,border:"1px dashed #64748b",pointerEvents:"none"}})}function xn(){
6
+ return(0,Jt.jsx)("div",{"data-ui":"shape-drop-target-label",style:{position:"absolute",left:10,top:10,display:"flex",alignItems:"center",height:24,padding:"0 10px",borderRadius:999,background:"#2563eb",color:"white",fontFamily:"Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",fontSize:12,fontWeight:700,lineHeight:"24px",boxShadow:"0 10px 24px rgba(37, 99, 235, 0.24)",whiteSpace:"nowrap",pointerEvents:"none"},children:"Drop into container"})}var bn=(0,Vt.memo)(function({shapeId:e,stackingOrder:t}){const n=qt(),r=sn(n.shapes.getSignal(e)),o=sn(n.shapes.getLocalToPageTransformSignal(e)),i=sn(n.shapes.getHoveredSignal(e)),s=sn(n.state.selectionCount),a=sn(n.render.interaction.brushBoxActive),l=sn(n.shapes.getRenderVisibleSignal(e)),c=sn(n.state.tool).activeToolId,d=sn(n.shapes.getSelectedSignal(e)),u="select"===c&&d,p=sn(n.shapes.getEditingSessionSignal(e)),h=sn(n.shapes.getRenderOrderSignal(e)),f=sn(n.shapes.getDropTargetSignal(e)),m=sn(n.shapes.getEffectiveOpacitySignal(e)),g=sn(n.shapes.getSelectedDescendantTransformAncestorSignal(e)),y=sn(n.shapes.getClipAncestorIdsSignal(e)),x=rn(),b=sn((0,Vt.useMemo)(()=>x.getShapeOpacityValue(n,e),[n,x,e]));if(!r||!o)return null;const w=x.getShapeRenderer(r.type);if(!w)return null;const v=w.component,k=w.hoverComponent,S=i&&!(1===s&&u)&&!a,P=mn(n,r,o),M=m*b;
7
+ return(0,Jt.jsxs)("div",{"data-ui":"shape-instance","data-shape-id":r.id,"data-shape-type":r.type,"data-selected":u?"true":"false","data-hovered":S?"true":"false","data-drop-target":f?"true":"false","data-visible":l?"true":"false","data-render-order":h>=0?String(h):void 0,"data-clip-ancestor-count":y.length,style:{position:"absolute",display:l?void 0:"none",left:P.left,top:P.top,width:P.width,height:P.height,opacity:1===M?void 0:M,transform:P.transform,transformOrigin:P.transformOrigin,pointerEvents:"none",outline:f?"2px solid #2563eb":void 0,outlineOffset:f?4:void 0,boxShadow:f?"0 0 0 6px rgba(37, 99, 235, 0.16)":void 0,zIndex:t+1},children:[l? (0,Jt.jsxs)(an,{clipAncestorIds:y,shapeElementToPage:P.elementToPage,children:[ (0,Jt.jsx)(hn,{Component:v,shape:r,editor:n,isSelected:u,shapeEditingSession:p}),S&&k? (0,Jt.jsx)(fn,{Component:k,editor:n,shape:r}):null]}):null,l&&f? (0,Jt.jsx)(xn,{}):null,l&&g? (0,Jt.jsx)(yn,{}):null]})});(0,Vt.memo)(function(){const e=qt();return function(e,t,n){const r=[],o=[],i=new Map(t.map(e=>[e.id,e]));for(const s of e){const e=i.get(s);if(e){for(;o.length>0&&!wn(o[o.length-1],e,i);)r.push({layer:"foreground",shapeId:o.pop()});r.push({layer:"shape",shapeId:s}),n.getShapeRenderer(e.type)?.foregroundComponent&&o.push(s)}}for(;o.length>0;)r.push({layer:"foreground",shapeId:o.pop()});return r}(sn(e.render.viewport.retainedShapeIds),sn(e.state.currentPageShapeTree),rn()).map((e,t)=>"shape"===e.layer? (0,Jt.jsx)(bn,{shapeId:e.shapeId,stackingOrder:t},e.shapeId): (0,Jt.jsx)(gn,{shapeId:e.shapeId,stackingOrder:t},`${e.shapeId}:foreground`))});function wn(e,t,n){const r=new Set;let o=t.parentId;for(;o.startsWith("shape:");){const t=o;if(t===e)return!0;if(r.has(t))return!1;r.add(t);const i=n.get(t);if(!i)return!1;o=i.parentId}return!1}var vn="rgba(100, 116, 139, 0.82)",kn="rgba(255, 255, 255, 0.84)";function Sn(e,t){return"binding-preview"===e?{underlay:{"data-binding-preview-segment-underlay":t},segment:{"data-binding-preview-segment":t}}:"terminal-binding-guide"===e?{underlay:{"data-terminal-binding-guide-underlay":t},segment:{"data-terminal-binding-guide":t}}:{underlay:{"data-selection-binding-segment-underlay":t},segment:{"data-selection-binding-segment":t}}}function Pn({start:e,end:t,startInset:n,endInset:r,strokeWidth:o,dashSize:i,gapSize:s,kind:a,terminal:l}){const c=function({start:e,end:t,startInset:n,endInset:r}){const o=t.x-e.x,i=t.y-e.y,s=Math.hypot(o,i);if(s<1e-6)return null;const a=Math.max(0,s/2-.001),l=Math.min(n,a),c=Math.min(r,a),d=o/s,u=i/s;return{start:{x:e.x+d*l,y:e.y+u*l},end:{x:t.x-d*c,y:t.y-u*c}}}({start:e,end:t,startInset:n,endInset:r});if(!c)return null;const d=Sn(a,l);
8
+ return(0,Jt.jsxs)("g",{style:{pointerEvents:"none"},children:[ (0,Jt.jsx)("line",{...d.underlay,x1:c.start.x,y1:c.start.y,x2:c.end.x,y2:c.end.y,fill:"none",stroke:kn,strokeLinecap:"round",strokeWidth:2.2*o}), (0,Jt.jsx)("line",{...d.segment,x1:c.start.x,y1:c.start.y,x2:c.end.x,y2:c.end.y,fill:"none",stroke:vn,strokeDasharray:`${i} ${s}`,strokeLinecap:"round",strokeWidth:o})]})}function Mn({path:e,strokeWidth:t,dashSize:n,gapSize:r,kind:o,terminal:i}){const s=Sn(o,i);
9
+ return(0,Jt.jsxs)("g",{style:{pointerEvents:"none"},children:[ (0,Jt.jsx)("path",{...s.underlay,d:e,fill:"none",stroke:kn,strokeLinecap:"round",strokeWidth:2.2*t}), (0,Jt.jsx)("path",{...s.segment,d:e,fill:"none",stroke:vn,strokeDasharray:`${n} ${r}`,strokeLinecap:"round",strokeWidth:t})]})}function In({editor:e,shape:t,stroke:n,fill:r,strokeWidth:o}){const i=e.shapes.getPageOutlineVertices(t.id);return 0===i.length?null: (0,Jt.jsx)("polygon",{points:i.map(e=>`${e.x},${e.y}`).join(" "),fill:r,stroke:n,strokeWidth:o,strokeLinejoin:"round",strokeLinecap:"round"})}var En=(0,Vt.memo)(function(){return sn(qt().render.interaction.bindingPreviewActive)? (0,Jt.jsx)(Tn,{}):null}),Tn=(0,Vt.memo)(function(){const e=qt(),t=sn(e.render.interaction.bindingPreview),n=sn(e.render.interaction.terminalBindingGuides);if(!t)return null;const r=n.some(e=>e.terminal===t.terminal&&e.targetShapeId===t.targetShapeId);
10
+ return(0,Jt.jsxs)(Jt.Fragment,{children:[ (0,Jt.jsx)(Cn,{targetShapeId:t.targetShapeId}), (0,Jt.jsx)(On,{bindingPreview:t,showGuide:!r})]})}),Cn=(0,Vt.memo)(function({targetShapeId:e}){const t=qt(),n=sn(t.state.cameraZoom),r=sn(t.shapes.getSignal(e));return r? (0,Jt.jsx)(In,{editor:t,shape:r,stroke:"rgba(14, 165, 233, 0.78)",fill:"rgba(14, 165, 233, 0.08)",strokeWidth:2/n}):null}),On=(0,Vt.memo)(function({bindingPreview:e,showGuide:t}){const n=sn(qt().state.cameraZoom),r=2/n,o=6/n,i=4/n;
11
+ return(0,Jt.jsxs)(Jt.Fragment,{children:[t?e.guidePath? (0,Jt.jsx)(Mn,{path:e.guidePath,strokeWidth:r,dashSize:o,gapSize:i,kind:"binding-preview",terminal:e.terminal}): (0,Jt.jsx)(Pn,{start:e.rawPagePoint,end:e.resolvedPagePoint,startInset:8/n,endInset:6/n,strokeWidth:r,dashSize:o,gapSize:i,kind:"binding-preview",terminal:e.terminal}):null,
12
+
13
+ (0,Jt.jsx)("circle",{"data-binding-preview-point":"raw",cx:e.rawPagePoint.x,cy:e.rawPagePoint.y,r:6,fill:"rgba(255,255,255,0.96)",stroke:"rgba(14, 165, 233, 0.8)",strokeWidth:2}),
14
+
15
+ (0,Jt.jsx)("circle",{"data-binding-preview-point":"resolved",cx:e.resolvedPagePoint.x,cy:e.resolvedPagePoint.y,r:7,fill:"rgba(14, 165, 233, 0.18)",stroke:"rgba(2, 132, 199, 0.9)",strokeWidth:2})]})}),An=(0,Vt.memo)(function(){return sn(qt().render.interaction.brushBoxActive)? (0,Jt.jsx)(Rn,{}):null}),Rn=(0,Vt.memo)(function(){const e=sn(qt().render.interaction.brushBox);return e? (0,Jt.jsx)("rect",{"data-ui":"brush-box-overlay",x:e.x,y:e.y,width:e.w,height:e.h,fill:"rgba(59, 130, 246, 0.14)",stroke:"rgba(37, 99, 235, 0.92)",strokeDasharray:"4 3",strokeWidth:1}):null}),Nn=(0,Vt.memo)(function(){const e=qt(),t=sn(e.render.overlay.frameGeometry),n=sn(e.render.overlay.companionFrameGeometries);return t||0!==n.length? (0,Jt.jsxs)(Jt.Fragment,{children:[t? (0,Jt.jsx)(Ln,{frameGeometry:t}):null,n.map((e,t)=> (0,Jt.jsx)(Ln,{frameGeometry:e},`companion-${t}`))]}):null}),Ln=(0,Vt.memo)(function({frameGeometry:e}){const t=sn(qt().render.overlay.frameStyle),{bounds:n,rotation:r,rotationCenter:o}=e,{cornerRadius:i,strokeWidth:s}=t,a=s/2,l=180*r/Math.PI;
16
+ return(0,Jt.jsx)("g",{transform:0===r?void 0:`rotate(${l} ${o.x} ${o.y})`,children: (0,Jt.jsx)("rect",{"data-selection-overlay":"bounds",x:n.x-a,y:n.y-a,width:n.w+s,height:n.h+s,rx:i+a,ry:i+a,fill:"none",stroke:"rgba(37, 99, 235, 0.88)",strokeWidth:s})})}),$n=new Set(z),Dn=(0,Vt.memo)(function(){const e=qt(),t=sn(e.state.readonly),n=sn(e.render.overlay.handleAnchors);return t||!n?null: (0,Jt.jsx)(jn,{anchors:n})}),jn=(0,Vt.memo)(function({anchors:e}){const t=qt(),n=sn(t.render.overlay.handles),r=sn(t.render.overlay.frameGeometry),o=on(),i=sn(t.state.cameraZoom);if(!n)return null;const{resizeHandles:s,rotateHandles:a,strokeWidth:l,terminalHandles:c,middleHandles:d,customHandles:u}=n,p=s.filter(e=>$n.has(e.id)),h=s.filter(e=>!$n.has(e.id)),f=r?.rotation??0,m=180*f/Math.PI,g=r&&0!==f?`rotate(${m} ${r.rotationCenter.x} ${r.rotationCenter.y})`:void 0;
17
+ return(0,Jt.jsxs)(Jt.Fragment,{children:[r? (0,Jt.jsx)("g",{transform:g,children:h.map(e=> (0,Jt.jsx)(Bn,{frame:r,handleId:e.id,zoom:i},e.id))}):null,p.map(e=> (0,Jt.jsx)("rect",{"data-selection-resize-handle":e.id,x:e.bounds.x,y:e.bounds.y,width:e.bounds.w,height:e.bounds.h,rx:2/i,ry:2/i,fill:"rgba(255,255,255,0.98)",stroke:"rgba(37, 99, 235, 0.92)",strokeWidth:l,style:{cursor:_n(e.id,f),pointerEvents:"auto"}},e.id)),a.map(e=> (0,Jt.jsxs)("g",{"data-selection-rotate-handle":e.id,transform:`translate(${e.bounds.center.x-6/i} ${e.bounds.center.y-6/i}) scale(${.6/i})`,fill:"none",stroke:"rgba(37, 99, 235, 0.96)",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[ (0,Jt.jsx)("path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"}), (0,Jt.jsx)("path",{d:"M21 3v5h-5"})]},e.id)),c.map(e=> (0,Jt.jsx)("circle",{"data-selection-terminal":e.terminal,cx:e.bounds.center.x,cy:e.bounds.center.y,r:Math.min(e.bounds.w,e.bounds.h)/2,fill:"rgba(255,255,255,0.98)",stroke:"rgba(37, 99, 235, 0.92)",strokeWidth:l,style:{cursor:"grab",pointerEvents:"auto"}},e.terminal)),d.map(e=> (0,Jt.jsx)("rect",{"data-selection-binding-middle":"true",x:e.bounds.x,y:e.bounds.y,width:e.bounds.w,height:e.bounds.h,rx:2,ry:2,fill:"rgba(255,255,255,0.98)",stroke:"rgba(37, 99, 235, 0.92)",strokeWidth:l,transform:`rotate(45 ${e.bounds.center.x} ${e.bounds.center.y})`,style:{cursor:"grab",pointerEvents:"auto"}},"middle")),u.map(e=>{const t=o.getSelectionCustomHandleRenderer(e.type);if(t){const n=t.component;
18
+ return(0,Jt.jsx)(n,{handle:e,strokeWidth:l},`${e.type}:${e.id}`)}
19
+ return(0,Jt.jsx)(Fn,{handle:e,strokeWidth:l},`${e.type}:${e.id}`)})]})});function Bn({frame:e,handleId:t,zoom:n}){const r=function(e,t){const{bounds:n}=e;switch(t){case"top":return{x1:n.minX,y1:n.minY,x2:n.maxX,y2:n.minY};case"right":return{x1:n.maxX,y1:n.minY,x2:n.maxX,y2:n.maxY};case"bottom":return{x1:n.minX,y1:n.maxY,x2:n.maxX,y2:n.maxY};case"left":return{x1:n.minX,y1:n.minY,x2:n.minX,y2:n.maxY};default:return null}}(e,t);return r? (0,Jt.jsx)("line",{"data-selection-resize-border":t,x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,fill:"none",stroke:"transparent",strokeWidth:12/n,strokeLinecap:"butt",style:{cursor:_n(t,e.rotation),pointerEvents:"stroke"}}):null}var zn=["ew-resize","nwse-resize","ns-resize","nesw-resize"];function _n(e,t){const n=((function(e){switch(e){case"top_left":case"bottom_right":return Math.PI/4;case"top":case"bottom":return Math.PI/2;case"top_right":case"bottom_left":return 3*Math.PI/4;case"right":case"left":return 0}}(e)+t)%Math.PI+Math.PI)%Math.PI/(Math.PI/4);return zn[Math.round(n)%zn.length]??"default"}function Fn({handle:e,strokeWidth:t}){
20
+ return(0,Jt.jsx)("rect",{"data-selection-custom-handle":e.id,"data-selection-custom-handle-type":e.type,"data-selection-custom-handle-id":e.id,"data-selection-custom-handle-visual":"default",x:e.bounds.x,y:e.bounds.y,width:e.bounds.w,height:e.bounds.h,rx:3,ry:3,fill:"rgba(255,255,255,0.98)",stroke:"rgba(37, 99, 235, 0.92)",strokeWidth:t,style:{cursor:e.cursor??"grab",pointerEvents:"auto"}})}var Wn=1e-6,Hn=(0,Vt.memo)(function(){const e=qt(),t=sn(e.render.overlay.path),n=sn(e.render.overlay.pageClipPath),r=sn(e.render.overlay.bindingSegments),o=sn(e.render.overlay.selectedShapeItems),i=sn(e.render.overlay.frameStyle),s=(0,Vt.useId)().replace(/[^a-zA-Z0-9_-]/g,"-"),a=`selection-content-clip-${s}`,l=`selection-path-halo-${s}`,c=1===o.length?o[0]?.pathStyle??null:null,d=c?function(e,t){const n=e.localToPage.getMaximumLinearScale(),r=n>Wn?Math.abs(e.localToPage.determinant())/n:0,o=r>Wn?r:n>Wn?n:1;return e.strokeWidth+2*t/o}(c,i.strokeWidth):null,u=c&&null!==d?c.localBounds.expand(d):null;return t? (0,Jt.jsxs)(Jt.Fragment,{children:[
21
+
22
+ (0,Jt.jsx)(Vn,{bindingSegments:r,strokeWidth:i.strokeWidth}),n||c&&u? (0,Jt.jsxs)("defs",{children:[n? (0,Jt.jsx)("clipPath",{id:a,clipPathUnits:"userSpaceOnUse",children: (0,Jt.jsx)("path",{d:n,clipRule:"evenodd",fillRule:"evenodd"})}):null,c&&null!==d&&u? (0,Jt.jsxs)("mask",{id:l,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse",x:u.x,y:u.y,width:u.w,height:u.h,children:[ (0,Jt.jsx)(Un,{dataPrefix:"path-halo-mask-outer",pathStyle:c,stroke:"white",strokeWidth:d}), (0,Jt.jsx)(Un,{dataPrefix:"path-halo-mask-center",pathStyle:c,stroke:"black",strokeWidth:c.strokeWidth})]}):null]}):null,
23
+
24
+ (0,Jt.jsx)("g",{"data-selection-overlay":"lines",clipPath:n?`url(#${a})`:void 0,children:c&&null!==d? (0,Jt.jsx)("g",{"data-selection-overlay":"path-halo-transform",transform:c.localToPage.toSvgString(),children: (0,Jt.jsx)("g",{mask:`url(#${l})`,children: (0,Jt.jsx)(Un,{dataPrefix:"path-halo",pathStyle:c,stroke:"rgba(37, 99, 235, 0.45)",strokeWidth:d})})}): (0,Jt.jsxs)(Jt.Fragment,{children:[ (0,Jt.jsx)("path",{"data-selection-overlay":"path-underlay",d:t,fill:"none",stroke:"rgba(255,255,255,0.92)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2*i.strokeWidth}), (0,Jt.jsx)("path",{"data-selection-overlay":"path",d:t,fill:"none",stroke:"rgba(37, 99, 235, 0.88)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:i.strokeWidth})]})})]}):null});function Un({dataPrefix:e,pathStyle:t,stroke:n,strokeWidth:r}){
25
+ return(0,Jt.jsxs)(Jt.Fragment,{children:[ (0,Jt.jsx)("path",{"data-selection-overlay":e,d:t.localPath,fill:"none",stroke:n,strokeWidth:r,strokeDasharray:t.strokeDasharray,strokeLinecap:"round",strokeLinejoin:"round",pointerEvents:"none"}),t.localDecorationPaths.map((t,o)=> (0,Jt.jsx)("path",{"data-selection-overlay":`${e}-decoration`,d:t,fill:"none",stroke:n,strokeWidth:r,strokeLinecap:"round",strokeLinejoin:"round",pointerEvents:"none"},`${o}:${t}`))]})}var Vn=(0,Vt.memo)(function({bindingSegments:e,kind:t="selection-binding",strokeWidth:n}){if(0===e.length)return null;const r=3*n,o=2*n,i=4*n,s=3*n;
26
+ return(0,Jt.jsx)(Jt.Fragment,{children:e.map(e=>e.guidePath? (0,Jt.jsx)(Mn,{path:e.guidePath,strokeWidth:n,dashSize:r,gapSize:o,kind:t,terminal:e.terminal},e.terminal): (0,Jt.jsx)(Pn,{start:e.anchorPagePoint,end:e.boundaryPagePoint,startInset:i,endInset:s,strokeWidth:n,dashSize:r,gapSize:o,kind:t,terminal:e.terminal},e.terminal))})}),Kn=(0,Vt.memo)(function(){return sn(qt().render.interaction.selectionTranslationActive)?null: (0,Jt.jsxs)(Jt.Fragment,{children:[
27
+
28
+ (0,Jt.jsx)(Hn,{}),
29
+
30
+ (0,Jt.jsx)(Nn,{}),
31
+
32
+ (0,Jt.jsx)(Dn,{})]})}),qn="rgba(37, 99, 235, 0.9)",Yn=(0,Vt.memo)(function(){const e=qt(),t=sn(e.state.readonly),n=sn(e.render.interaction.snapIndicators);return t||0===n.length?null: (0,Jt.jsx)(Xn,{indicators:n})}),Xn=(0,Vt.memo)(function({indicators:e}){const t=sn(qt().state.cameraZoom);
33
+ return(0,Jt.jsx)(Jt.Fragment,{children:e.map(e=>"points"===e.type? (0,Jt.jsx)(Jn,{indicator:e,zoom:t},e.id): (0,Jt.jsx)(Zn,{indicator:e,zoom:t},e.id))})}),Jn=(0,Vt.memo)(function({indicator:e,zoom:t}){const n=2.5/t,r=1/t,[o,i]=e.line,s=`M ${o.x} ${o.y} L ${i.x} ${i.y}`,a=180*e.rotation/Math.PI;
34
+ return(0,Jt.jsxs)("g",{"data-ui":"snap-indicator",transform:0===e.rotation?void 0:`rotate(${a} ${e.rotationCenter.x} ${e.rotationCenter.y})`,children:[ (0,Jt.jsx)("path",{"data-ui":"snap-indicator-line",d:s,fill:"none",stroke:qn,strokeWidth:r,strokeLinecap:"round"}),e.points.map((t,o)=> (0,Jt.jsx)("path",{"data-ui":"snap-indicator-cross",d:`M ${t.x-n} ${t.y-n} L ${t.x+n} ${t.y+n} M ${t.x-n} ${t.y+n} L ${t.x+n} ${t.y-n}`,fill:"none",stroke:qn,strokeWidth:r,strokeLinecap:"round"},`${e.id}:${o}`))]})});function Gn(e,t){const n=Math.max(e[0],t[0]),r=Math.min(e[1],t[1]);return n<=r?[n,r]:null}var Zn=(0,Vt.memo)(function({indicator:e,zoom:t}){if(0===e.gaps.length)return null;const n="horizontal"===e.direction;let r=[Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY];for(const d of e.gaps){const e=Gn(r,[n?d.startEdge[0].y:d.startEdge[0].x,n?d.startEdge[1].y:d.startEdge[1].x]);e&&(r=e);const t=Gn(r,[n?d.endEdge[0].y:d.endEdge[0].x,n?d.endEdge[1].y:d.endEdge[1].x]);t&&(r=t)}if(!Number.isFinite(r[0])||!Number.isFinite(r[1]))return null;const o=(r[0]+r[1])/2,i=3.5/t,s=2*i,a=[];for(const{startEdge:d,endEdge:u}of e.gaps)if(n){a.push(`M ${d[0].x} ${o-s} L ${d[1].x} ${o+s}`,`M ${u[0].x} ${o-s} L ${u[1].x} ${o+s}`,`M ${d[0].x} ${o} L ${u[0].x} ${o}`);const e=(d[0].x+u[0].x)/2;a.push(`M ${e} ${o-i} L ${e} ${o+i}`)}else{a.push(`M ${o-s} ${d[0].y} L ${o+s} ${d[1].y}`,`M ${o-s} ${u[0].y} L ${o+s} ${u[1].y}`,`M ${o} ${d[0].y} L ${o} ${u[0].y}`);const e=(d[0].y+u[0].y)/2;a.push(`M ${o-i} ${e} L ${o+i} ${e}`)}const l=180*e.rotation/Math.PI,c=0===e.rotation?void 0:`rotate(${l} ${e.rotationCenter.x} ${e.rotationCenter.y})`;
35
+ return(0,Jt.jsx)("path",{"data-ui":"snap-gap-indicator",d:a.join(" "),transform:c,fill:"none",stroke:qn,strokeWidth:1/t,strokeLinecap:"round",strokeLinejoin:"round"})}),Qn=(0,Vt.memo)(function(){const e=qt(),t=sn(e.render.interaction.terminalBindingGuides),n=sn(e.render.overlay.frameStyle);return 0===t.length?null: (0,Jt.jsx)(Vn,{bindingSegments:t,kind:"terminal-binding-guide",strokeWidth:n.strokeWidth})}),er=((0,Vt.memo)(function(){
36
+ return(0,Jt.jsxs)("svg",{width:"100%",height:"100%",style:{display:"block",width:"100%",height:"100%",overflow:"visible"},children:[
37
+
38
+ (0,Jt.jsx)("style",{children:'\n [data-selection-terminal],\n [data-selection-binding-middle],\n [data-selection-custom-handle-visual="default"] {\n transition: fill 120ms ease, stroke 120ms ease;\n }\n [data-selection-terminal]:hover,\n [data-selection-binding-middle]:hover,\n [data-selection-custom-handle-visual="default"]:hover {\n fill: rgba(219, 234, 254, 0.98);\n stroke: rgba(29, 78, 216, 0.98);\n }\n [data-selection-terminal]:active,\n [data-selection-binding-middle]:active,\n [data-selection-custom-handle]:active {\n cursor: grabbing;\n }\n '}),
39
+
40
+ (0,Jt.jsx)(Yn,{}),
41
+
42
+ (0,Jt.jsx)(Qn,{}),
43
+
44
+ (0,Jt.jsx)(En,{}),
45
+
46
+ (0,Jt.jsx)(An,{}),
47
+
48
+ (0,Jt.jsx)(Kn,{}),
49
+
50
+ (0,Jt.jsx)(er,{})]})}),(0,Vt.memo)(function(){const e=on().getCanvasOverlays();return 0===e.length?null: (0,Jt.jsx)(Jt.Fragment,{children:e.map(({id:e,component:t})=> (0,Jt.jsx)(t,{},e))})}));function tr(){return{id:"land.arrow.react",shapeRenderers:[{type:"arrow",component:nr,hoverComponent:rr}]}}function nr({shape:e,editor:t}){
51
+ return(0,Jt.jsx)(or,{shape:e,editor:t,idPrefix:"arrow",stroke:E(e.props.stroke),strokeWidth:e.props.strokeWidth})}function rr({shape:e,editor:t,strokeWidth:n}){
52
+ return(0,Jt.jsx)(or,{dataUi:"arrow-hover-outline",shape:e,editor:t,idPrefix:"arrow-hover",stroke:pn,strokeWidth:n,vectorEffect:"non-scaling-stroke"})}function or({dataUi:e,editor:t,idPrefix:n,shape:r,stroke:o,strokeWidth:i,vectorEffect:s}){const a=`${n}-content-clip-${r.id.replace(/[^a-zA-Z0-9_-]/g,"-")}`,l=Ue(t,r),c=yt(l,r.props),d=sn(t.shapes.getContentCutoutLocalPolygonsSignal(r.id)),u=Y({outputBounds:l.bounds,cutoutLocalPolygons:d});
53
+ return(0,Jt.jsxs)("svg",{"data-ui":e,width:"100%",height:"100%",viewBox:`0 0 ${r.props.w} ${r.props.h}`,overflow:"visible",children:[u? (0,Jt.jsx)("defs",{children: (0,Jt.jsx)("clipPath",{id:a,clipPathUnits:"userSpaceOnUse",children: (0,Jt.jsx)("path",{d:u,clipRule:"evenodd",fillRule:"evenodd"})})}):null, (0,Jt.jsxs)("g",{clipPath:u?`url(#${a})`:void 0,children:[ (0,Jt.jsx)("path",{"data-arrow-path":"body",d:l.path,fill:"none",stroke:o,strokeWidth:i,strokeDasharray:vt(r.props.strokeStyle,i),strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:s}),c.path? (0,Jt.jsx)("path",{"data-arrow-path":"heads",d:c.path,fill:"none",stroke:o,strokeWidth:i,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:s}):null]})]})}var ir={id:"arrow",editor:_t(),render:tr(),api:ft,setup:({editor:e})=>({api:mt({editor:e})})},sr={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}},ar=(e,t,n,r)=>{const o=(0,Vt.forwardRef)(({color:n="currentColor",size:o=24,stroke:i=2,title:s,className:a,children:l,...c},d)=>(0,Vt.createElement)("svg",{ref:d,...sr[e],width:o,height:o,className:["tabler-icon",`tabler-icon-${t}`,a].join(" "),..."filled"===e?{fill:n}:{strokeWidth:i,stroke:n},...c},[s&&(0,Vt.createElement)("title",{key:"svg-title"},s),...r.map(([e,t])=>(0,Vt.createElement)(e,t)),...Array.isArray(l)?l:[l]]));return o.displayName=`${n}`,o},lr=ar("outline","arrow-right","ArrowRight",[["path",{d:"M5 12l14 0",key:"svg-0"}],["path",{d:"M13 18l6 -6",key:"svg-1"}],["path",{d:"M13 6l6 6",key:"svg-2"}]]),cr=ar("outline","photo","Photo",[["path",{d:"M15 8h.01",key:"svg-0"}],["path",{d:"M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12",key:"svg-1"}],["path",{d:"M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5",key:"svg-2"}],["path",{d:"M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3",key:"svg-3"}]]),dr=ar("outline","plus","Plus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]),ur=ar("outline","typography","Typography",[["path",{d:"M4 20l3 0",key:"svg-0"}],["path",{d:"M14 20l7 0",key:"svg-1"}],["path",{d:"M6.9 15l6.9 0",key:"svg-2"}],["path",{d:"M10.2 6.3l5.8 13.7",key:"svg-3"}],["path",{d:"M5 20l6 -16l2 0l7 16",key:"svg-4"}]]),pr=36,hr=36,fr=4,mr=12,gr=8,yr=15,xr=12,br=20,wr=12,vr=10,kr=8,Sr=8,Pr=320,Mr=160,Ir=96,Er=48,Tr="8 6";function Cr(e){return c(e)&&"connector"===e.type}function Or(e){return function(e){return!!e&&"binding"===e.typeName}(e)&&"connector"===e.type}function Ar(e,t){let n=null,r=null;for(const o of e.bindings.getFromShape(t))Or(o)&&("start"===o.props.terminal?n=o:r=o);return{start:n,end:r}}function Rr(e,t){return e.bindings.getFromShape(t).filter(Or)}var Nr=.001;function Lr(e,t){const n=$r(e),r=$r(t);let o;if(n&&(n.needsWinding=Kr(n,t.point)),r&&(r.needsWinding=Kr(r,e.point)),n||r)if(n&&r){if(void 0!==e.obstacleId&&e.obstacleId===t.obstacleId)return o=function(e,t,n,r){const o=to(e.bounds,t.bounds),i=Math.max(36,36),s=new h(o.minX-i,o.minY-i,o.w+2*i,o.h+2*i),a=Dr(e,s),l=Dr(t,s);return function(e,t){const n=e.filter(e=>!function(e,t){for(let n=1;n<e.length;n+=1){const r=e[n-1],o=e[n];if(Math.abs(r.y-o.y)<Nr){if(r.y>t.minY+Nr&&r.y<t.maxY-Nr&&Math.max(r.x,o.x)>t.minX+Nr&&Math.min(r.x,o.x)<t.maxX-Nr)return!0}else if(r.x>t.minX+Nr&&r.x<t.maxX-Nr&&Math.max(r.y,o.y)>t.minY+Nr&&Math.min(r.y,o.y)<t.maxY-Nr)return!0}return!1}(e,t)&&!function(e){for(let t=1;t<e.length;t+=1)for(let n=t+2;n<e.length;n+=1)if(Vr(e[t-1],e[t],e[n-1],e[n]))return!0;return!1}(e));return[...n.length>0?n:e].sort(_r)[0]}([no([n,...jr(a,e.side,l,t.side,s),r]),no([n,...jr(l,t.side,a,e.side,s).reverse(),r])],o)}(n,r,e.point,t.point),no(o);o=n.needsWinding&&r.needsWinding?Yr(n,r,e.point,t.point):n.needsWinding?qr(n,r,e.point,t.point):r.needsWinding?qr(r,n,t.point,e.point).reverse():function(e,t,n,r){if(Jr(n,r))return[n,r];if(e.axis===t.axis){if("horizontal"===e.axis){const o=(e.point.x+t.point.x)/2;return[n,new p(o,n.y),new p(o,r.y),r]}const o=(e.point.y+t.point.y)/2;return[n,new p(n.x,o),new p(r.x,o),r]}return"horizontal"===e.axis?[n,new p(r.x,n.y),r]:[n,new p(n.x,r.y),r]}(n,r,e.point,t.point)}else{const i=n??r,s=n?e.point:t.point,a=n?t.point:e.point;o=i.needsWinding?function(e,t,n){const{bounds:r,neighborPoint:o}=e;if("horizontal"===e.axis){if(n.y<r.minY||n.y>r.maxY)return[t,o,new p(o.x,n.y),n];const e=n.y+t.y>r.minY+r.maxY?r.maxY+36:r.minY-36;return[t,o,new p(o.x,e),new p(n.x,e),n]}if(n.x<r.minX||n.x>r.maxX)return[t,o,new p(n.x,o.y),n];const i=n.x+t.x>r.minX+r.maxX?r.maxX+36:r.minX-36;return[t,o,new p(i,o.y),new p(i,n.y),n]}(i,s,a):function(e,t,n){if(Jr(t,n))return[t,n];const r=n.sub(t);if("horizontal"===e.axis){if(Math.abs(r.x)<=Math.abs(r.y))return[t,new p(n.x,t.y),n];const e=t.x+r.x/2;return[t,new p(e,t.y),new p(e,n.y),n]}if(Math.abs(r.x)>Math.abs(r.y))return[t,new p(t.x,n.y),n];const o=t.y+r.y/2;return[t,new p(t.x,o),new p(n.x,o),n]}(i,s,a),n||o.reverse()}else o=function(e,t){if(Jr(e,t))return[e,t];const n=t.sub(e);if(Math.abs(n.x)>Math.abs(n.y)){const r=e.x+n.x/2;return[e,new p(r,e.y),new p(r,t.y),t]}const r=e.y+n.y/2;return[e,new p(e.x,r),new p(t.x,r),t]}(e.point,t.point);return no(o)}function $r(e){if(!e.obstacleBounds)return null;const t=function(e){return Math.abs(e.x)>=Math.abs(e.y)?"horizontal":"vertical"}(e.direction),n=function(e,t){return"horizontal"===t?new p(e.x>=0?1:-1,0):new p(0,e.y>=0?1:-1)}(e.direction,t);return{point:e.point,neighborPoint:e.point.add(n.mul(36)),bounds:e.obstacleBounds,axis:t,side:Xr(n,t),needsWinding:!1}}function Dr(e,t){switch(e.side){case"top":return new p(e.point.x,t.minY);case"right":return new p(t.maxX,e.point.y);case"bottom":return new p(e.point.x,t.maxY);case"left":return new p(t.minX,e.point.y)}}function jr(e,t,n,r,o){const i=2*(o.w+o.h);if(i<=Nr)return[e,n];const s=Br(e,t,o),a=zr(Br(n,r,o)-s,i),l=[e],c=[{position:0,point:new p(o.minX,o.minY)},{position:o.w,point:new p(o.maxX,o.minY)},{position:o.w+o.h,point:new p(o.maxX,o.maxY)},{position:2*o.w+o.h,point:new p(o.minX,o.maxY)}].map(e=>({...e,travel:zr(e.position-s,i)})).filter(e=>e.travel>Nr&&e.travel<a-Nr).sort((e,t)=>e.travel-t.travel);return l.push(...c.map(e=>e.point)),l.push(n),l}function Br(e,t,n){switch(t){case"top":return e.x-n.minX;case"right":return n.w+e.y-n.minY;case"bottom":return n.w+n.h+n.maxX-e.x;case"left":return 2*n.w+n.h+n.maxY-e.y}}function zr(e,t){return(e%t+t)%t}function _r(e,t){const n=Fr(e)-Fr(t);if(0!==n)return n;const r=Wr(e)-Wr(t);return Math.abs(r)>Nr?r:Ur(Hr(e),Hr(t))}function Fr(e){let t=0;for(let n=1;n<e.length-1;n+=1){const r=e[n].sub(e[n-1]),o=e[n+1].sub(e[n]);Math.abs(r.x*o.y-r.y*o.x)>Nr&&(t+=1)}return t}function Wr(e){let t=0;for(let n=1;n<e.length;n+=1){const r=e[n-1],o=e[n];t+=Math.abs(o.x-r.x)+Math.abs(o.y-r.y)}return t}function Hr(e){const t=e.flatMap(e=>[e.x,e.y]),n=[...e].reverse().flatMap(e=>[e.x,e.y]);return Ur(t,n)<=0?t:n}function Ur(e,t){const n=Math.min(e.length,t.length);for(let r=0;r<n;r+=1){const n=e[r]-t[r];if(Math.abs(n)>Nr)return n}return e.length-t.length}function Vr(e,t,n,r){const o=Math.abs(e.y-t.y)<Nr,i=Math.abs(n.y-r.y)<Nr;if(o&&i)return Math.abs(e.y-n.y)<Nr&&Math.max(Math.min(e.x,t.x),Math.min(n.x,r.x))<=Math.min(Math.max(e.x,t.x),Math.max(n.x,r.x))+Nr;if(!o&&!i)return Math.abs(e.x-n.x)<Nr&&Math.max(Math.min(e.y,t.y),Math.min(n.y,r.y))<=Math.min(Math.max(e.y,t.y),Math.max(n.y,r.y))+Nr;const s=o?e:n,a=o?t:r,l=o?n:e,c=o?r:t;return l.x>=Math.min(s.x,a.x)-Nr&&l.x<=Math.max(s.x,a.x)+Nr&&s.y>=Math.min(l.y,c.y)-Nr&&s.y<=Math.max(l.y,c.y)+Nr}function Kr(e,t){return!function(e,t){return e.x>=t.minX&&e.x<=t.maxX&&e.y>=t.minY&&e.y<=t.maxY}(t,e.bounds)&&(n=e.neighborPoint.sub(e.point),r=t.sub(e.point),n.x*r.x+n.y*r.y<=0);var n,r}function qr(e,t,n,r){const o=e.neighborPoint,i=to(e.bounds,t.bounds);if("horizontal"===e.axis){if("horizontal"===t.axis&&function(e,t){return e.y<t.minY||e.y>t.maxY}(r,e.bounds))return[n,o,new p(o.x,r.y),r];if("horizontal"===t.axis){const i=r.y+n.y>e.bounds.minY+e.bounds.maxY?e.bounds.maxY+36:e.bounds.minY-36,s=Qr(e.bounds,t.bounds);return[n,o,new p(o.x,i),new p(s,i),new p(s,r.y),r]}if(Zr(e.bounds,t.bounds)){const i=eo(e.bounds,t.bounds);return[n,o,new p(o.x,i),new p(r.x,i),r]}const s=t.neighborPoint.y>r.y?i.maxY+36:i.minY-36;return[n,o,new p(o.x,s),new p(r.x,s),r]}if("horizontal"===t.axis&&function(e,t){return e.x<t.minX||e.x>t.maxX}(r,e.bounds))return[n,o,new p(r.x,o.y),r];if("vertical"===t.axis){if(Gr(e.bounds,t.bounds)){const i=Qr(e.bounds,t.bounds);return[n,o,new p(i,o.y),new p(i,r.y),r]}const s=t.neighborPoint.x>r.x?i.maxX+36:i.minX-36;return[n,o,new p(s,o.y),new p(s,r.y),r]}const s=r.x+n.x>e.bounds.minX+e.bounds.maxX?e.bounds.maxX+36:e.bounds.minX-36,a=eo(e.bounds,t.bounds);return[n,o,new p(s,o.y),new p(s,a),new p(r.x,a),r]}function Yr(e,t,n,r){const o=e.neighborPoint,i=t.neighborPoint,s=to(e.bounds,t.bounds);if("horizontal"===e.axis&&"horizontal"===t.axis){if(Math.abs(n.x-r.x)<Nr&&Math.abs(o.x-i.x)<Nr)return[n,o,i,r];let a,l,c;return Zr(e.bounds,t.bounds)?(a=o.x,l=i.x,c=eo(e.bounds,t.bounds)):o.x>n.x?(a=s.maxX+36,l=s.minX-36,c=s.minY-36):(a=s.minX-36,l=s.maxX+36,c=s.maxY+36),[n,new p(a,n.y),new p(a,c),new p(l,c),new p(l,r.y),r]}if(e.axis!==t.axis){if("horizontal"===e.axis){const e=o.x>n.x?s.maxX+36:s.minX-36,t=i.y>r.y?s.maxY+36:s.minY-36;return[n,new p(e,n.y),new p(e,t),new p(r.x,t),r]}return Yr(t,e,r,n).reverse()}if(Math.abs(n.y-r.y)<Nr&&Math.abs(o.y-i.y)<Nr)return[n,o,i,r];let a,l,c;return Gr(e.bounds,t.bounds)?(a=o.y,l=i.y,c=Qr(e.bounds,t.bounds)):o.y>n.y?(a=s.maxY+36,l=s.minY-36,c=s.maxX+36):(a=s.minY-36,l=s.maxY+36,c=s.minX-36),[n,new p(n.x,a),new p(c,a),new p(c,l),new p(r.x,l),r]}function Xr(e,t){return"horizontal"===t?e.x>=0?"right":"left":e.y>=0?"bottom":"top"}function Jr(e,t){return Math.abs(e.x-t.x)<Nr||Math.abs(e.y-t.y)<Nr}function Gr(e,t){return e.maxX<=t.minX||t.maxX<=e.minX}function Zr(e,t){return e.maxY<=t.minY||t.maxY<=e.minY}function Qr(e,t){return t.minX>=e.maxX?e.maxX+(t.minX-e.maxX)/2:t.maxX+(e.minX-t.maxX)/2}function eo(e,t){return t.minY>=e.maxY?e.maxY+(t.minY-e.maxY)/2:t.maxY+(e.minY-t.maxY)/2}function to(e,t){const n=Math.min(e.minX,t.minX),r=Math.min(e.minY,t.minY),o=Math.max(e.maxX,t.maxX),i=Math.max(e.maxY,t.maxY);return new h(n,r,o-n,i-r)}function no(e){const t=[];for(const n of e){const e=t[t.length-1];if(e&&e.dist(n)<Nr)continue;const r=t[t.length-2];r&&e&&(Math.abs(r.x-e.x)<Nr&&Math.abs(e.x-n.x)<Nr||Math.abs(r.y-e.y)<Nr&&Math.abs(e.y-n.y)<Nr)?t[t.length-1]=n:t.push(n)}return t}var ro="border:";function oo(e,t){const n=e.shapes.computePositionedToPageTransform(t);return e.shapes.getUtil(t).getTerminalBindingOutlines(t,{editor:e}).map(e=>({points:e.points.map(e=>n.applyToPoint(e)),closed:e.closed})).filter(e=>e.points.length>0)}function io(e,t,n,r){const o=co(e,t,n);if(!o)return null;const i=function(e,t){return[...e].sort((e,n)=>e.pagePoint.dist(t)-n.pagePoint.dist(t)||e.id.localeCompare(n.id))[0]??null}(Z(e,t),o.point),s=i?co(e,t,i.pagePoint):null;if(i&&s&&s.distance<=1e-4&&i.pagePoint.dist(o.point)<=r)return{port:i,borderDistance:o.distance};const a=function(e,t,n){const r=e.shapes.computePositionedToPageTransform(t).tryInvert(),o=e.shapes.computePositionedBounds(t);if(!r)return{x:.5,y:.5};const i=r.applyToPoint(n);return{x:po(o.w<=1e-6?.5:(i.x-o.minX)/o.w),y:po(o.h<=1e-6?.5:(i.y-o.minY)/o.h)}}(e,t,o.point);return{port:{id:uo(a),normalizedAnchor:a,pagePoint:o.point,pageOutwardNormal:o.outwardNormal},borderDistance:o.distance}}function so(e,t,n){if(!n.normalizedAnchor||!n.portId.startsWith(ro))return Q(e,t,n.portId);const r=co(e,t,function(e,t,n){const r=e.shapes.computePositionedBounds(t);return e.shapes.computePositionedToPageTransform(t).applyToPoint(new p(r.minX+r.w*n.x,r.minY+r.h*n.y))}(e,t,n.normalizedAnchor));return r?{id:n.portId,normalizedAnchor:{...n.normalizedAnchor},pagePoint:r.point,pageOutwardNormal:r.outwardNormal}:null}function ao(e){return e.id.startsWith(ro)?{kind:"border",normalizedAnchor:{...e.normalizedAnchor}}:{kind:"port",portId:e.id}}function lo(e,t){return{terminal:e,portId:t.id,...t.id.startsWith(ro)?{normalizedAnchor:{...t.normalizedAnchor}}:{}}}function co(e,t,n){const r=oo(e,t);if(0===r.length)return null;const o=e.shapes.getPageCenter(t.id)??n;let i=null,s=0;for(const a of r){if(1===a.points.length){const e=a.points[0],t=e.sub(o).normalize(),r={point:e.clone(),outwardNormal:t.len2()>0?t:new p(1,0),distance:e.dist(n),index:s};(!i||r.distance<i.distance)&&(i=r),s+=1;continue}const e=a.closed?a.points.length:a.points.length-1;for(let t=0;t<e;t+=1){const e=a.points[t],r=a.points[(t+1)%a.points.length];if(!e||!r)continue;const l=f(e,r,n),c=l.dist(n),d=r.sub(e);if(d.len2()<=1e-12)continue;let u=new p(-d.y,d.x).normalize();const h=l.sub(o);u.x*h.x+u.y*h.y<0&&(u=u.mul(-1)),(!i||c<i.distance||c===i.distance&&s<i.index)&&(i={point:l,outwardNormal:u,distance:c,index:s}),s+=1}}return i}function uo(e){return`${ro}${e.x.toFixed(6)}:${e.y.toFixed(6)}`}function po(e){return Math.max(0,Math.min(1,e))}var ho=3;function fo(e){return 3.5+(Math.max(0,e)<=1?2:0)}function mo(e){const t=Math.max(0,e);return t*fo(t)}function go(e){const t=Math.max(0,e);return t*(fo(t)-.5)}function yo(e,t,n=1){return("start"===e?2:22)+2*("start"===e?1:-1)*fo(t)*Math.max(0,n)}function xo(e,t,n=1){const r="start"===e?2:22,o="start"===e?1:-1,i=2*(fo(t)-.5)*Math.max(0,n),s=r+o*i;return`M${s},${12-i} L${r},12 L${s},${12+i} M${yo(e,t,n)},12 L${r},12`}function bo(e,t){const n=Math.max(0,Math.min(1,t)),r=1-n;return"line"===e.type?e.start.add(e.end.sub(e.start).mul(n)):"quadratic"===e.type?e.start.mul(r*r).add(e.control.mul(2*r*n)).add(e.end.mul(n*n)):e.start.mul(r*r*r).add(e.control1.mul(3*r*r*n)).add(e.control2.mul(3*r*n*n)).add(e.end.mul(n*n*n))}function wo(e){const t=function(e){const t=[];let n=null,r=0;return e.forEach((e,o)=>{const i="cubic"===e.type?32:"quadratic"===e.type?16:1;for(let s=0;s<=i;s+=1){const a=s/i,l=bo(e,a);n&&(r+=n.dist(l)),t.push({point:l,distance:r,segmentIndex:o,segmentPosition:a}),n=l}}),t}(e.segments),n=t[t.length-1]?.distance??0;return{length:n,defaultPosition:.5,getPointAt:r=>function(e,t,n,r){const o=t[0];if(!o)return e.startPagePoint.clone();if(n<=Eo)return o.point.clone();const i=n*r;for(let s=1;s<t.length;s+=1){const n=t[s-1],r=t[s];if(r.distance<i)continue;const o=r.distance-n.distance;if(o<=Eo)continue;const a=Math.max(0,Math.min(1,(i-n.distance)/o));if(n.segmentIndex!==r.segmentIndex)return n.point.add(r.point.sub(n.point).mul(a));const l=e.segments[n.segmentIndex];return l?bo(l,n.segmentPosition+(r.segmentPosition-n.segmentPosition)*a):n.point.add(r.point.sub(n.point).mul(a))}return t[t.length-1].point.clone()}(e,t,n,Po(r)),getNearestPosition:(r,o)=>function(e,t,n,r,o){const i=Po(o);if(n<=Eo)return i;let s=i,a=1/0;for(let l=1;l<t.length;l+=1){const o=t[l-1],c=t[l],d=c.point.sub(o.point),u=d.len2();if(u<=Eo*Eo)continue;const p=Math.max(0,Math.min(1,Go(r.sub(o.point),d)/u)),h=o.segmentIndex===c.segmentIndex?e.segments[o.segmentIndex]:null,f=h?vo(h,r,o.segmentPosition,c.segmentPosition,p):0,m=h?(f-o.segmentPosition)/Math.max(Eo,c.segmentPosition-o.segmentPosition):p,g=h?bo(h,f):o.point.add(d.mul(p)),y=(o.distance+(c.distance-o.distance)*m)/n,x=g.dist2(r),b=x<a-1e-8,w=Math.abs(x-a)<=1e-8&&Math.abs(y-i)<Math.abs(s-i);(b||w)&&(a=x,s=y)}return Po(s)}(e,t,n,r,o?.hintPosition??.5)}}function vo(e,t,n,r,o){if("line"===e.type)return n+(r-n)*o;let i=n+(r-n)*o;for(let s=0;s<8;s+=1){const o=bo(e,i),s=ko(e,i),a=o.sub(t),l=s.len2()+Go(a,So(e,i));if(Math.abs(l)<=Eo)break;const c=Math.max(n,Math.min(r,i-Go(a,s)/l));if(Math.abs(c-i)<=1e-10){i=c;break}i=c}return[n,i,r].reduce((n,r)=>bo(e,r).dist2(t)<bo(e,n).dist2(t)?r:n,i)}function ko(e,t){const n=1-t;return"quadratic"===e.type?e.control.sub(e.start).mul(2*n).add(e.end.sub(e.control).mul(2*t)):e.control1.sub(e.start).mul(3*n*n).add(e.control2.sub(e.control1).mul(6*n*t)).add(e.end.sub(e.control2).mul(3*t*t))}function So(e,t){if("quadratic"===e.type)return e.end.sub(e.control.mul(2)).add(e.start).mul(2);const n=1-t;return e.control2.sub(e.control1.mul(2)).add(e.start).mul(6*n).add(e.end.sub(e.control2.mul(2)).add(e.control1).mul(6*t))}function Po(e){return Math.max(0,Math.min(1,e))}var Mo=new WeakMap,Io=.4,Eo=1e-6;function To(e){const t=e.tryInvert();return t?({point:n,direction:r,along:o,perpendicular:i})=>{const s=t.applyToPoint(n),a=ti(t,n,r);if(a.len()<=Eo)return Ho({point:n,direction:r,along:o,perpendicular:i});const l=new p(-a.y,a.x),c=a.mul(o).add(l.mul(i));return e.applyToPoint(s.add(c)).sub(n)}:Ho}function Co(e,t){const n=Ar(e,t.id),r=n.start?e.shapes.get(n.start.toId):null,o=n.end?e.shapes.get(n.end.toId):null,i=r&&n.start?so(e,r,n.start.props):null,s=o&&n.end?so(e,o,n.end.props):null,a=e.shapes.computeLocalToPageTransform(t),l=r?e.shapes.getPageBounds(r.id)??void 0:void 0,c=o?e.shapes.getPageBounds(o.id)??void 0:void 0,d=i&&n.start?n.start.toId:void 0,u=s&&n.end?n.end.toId:void 0,h=function({transform:e,startPoint:t,startNormal:n,startObstacleId:r,startObstacleBounds:o,endPoint:i,endNormal:s,endObstacleId:a,endObstacleBounds:l}){return[e.a,e.b,e.c,e.d,e.e,e.f,...Oo(t),...Oo(n),r??"",...Ao(o),...Oo(i),...Oo(s),a??"",...Ao(l)]}({transform:a,startPoint:i?.pagePoint,startNormal:i?.pageOutwardNormal,startObstacleId:d,startObstacleBounds:l,endPoint:s?.pagePoint,endNormal:s?.pageOutwardNormal,endObstacleId:u,endObstacleBounds:c}),f=Mo.get(t);if(f&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}(f.signature,h))return f.info;const m=t.props.curveWaypoints.map(e=>a.applyToPoint(new p(e.x,e.y))),g=t.props.orthogonalBends.map(e=>a.applyToPoint(new p(e.x,e.y))),y=a.applyToPoint(new p(t.props.start.x,t.props.start.y)),x=a.applyToPoint(new p(t.props.end.x,t.props.end.y)),b=i?.pagePoint??y,w=s?.pagePoint??x,v=w.sub(b).normalize(),k=b.sub(w).normalize(),S=No({start:i?{point:i.pagePoint,outwardNormal:i.pageOutwardNormal,obstacleId:d,obstacleBounds:l}:{point:b,outwardNormal:v.len()>Eo?v:new p(1,0)},end:s?{point:s.pagePoint,outwardNormal:s.pageOutwardNormal,obstacleId:u,obstacleBounds:c}:{point:w,outwardNormal:k.len()>Eo?k:new p(-1,0)},routing:t.props.routing,cornerRadius:t.props.cornerRadius,headStart:t.props.headStart,headEnd:t.props.headEnd,strokeWidth:t.props.strokeWidth,terminalOffsetMapper:To(a),curveWaypoints:m,orthogonalBends:g});return Mo.set(t,{signature:h,info:S}),S}function Oo(e){return e?[1,e.x,e.y]:[0,0,0]}function Ao(e){return e?[1,e.x,e.y,e.w,e.h]:[0,0,0,0,0]}function Ro(e,t){const n=Co(e,t),r=e.shapes.computeLocalToPageTransform(t).tryInvert();return r?Qo(n,r):n}function No({start:e,end:t,routing:n,cornerRadius:r,headStart:o="none",headEnd:i="none",strokeWidth:s=2,terminalOffsetMapper:a=Ho,curveWaypoints:l=[],orthogonalBends:c=[]}){return"curved"===n?function(e,t,n,r){const o=[e.point,...n.map(e=>e.clone()),t.point],i=function(e,t,n){const r=function(e,t,n){if(e.length<2)return[];const r=e.map(e=>({point:e,incoming:p.Zero(),outgoing:p.Zero()}));if(r[0].outgoing=qo(t,e[1]),r[r.length-1].incoming=qo(n,e[e.length-2]),e.length>2){const t=function(e){const t=[];for(let n=0;n<e.length-1;n+=1){let r=e[n],o=e[n+1];r<o?o=r+(o-r)/2:r=o+(r-o)/2,t.push([r*Io,o*Io])}return t}(e.slice(1).map((t,n)=>t.dist(e[n])));for(let e=1;e<r.length-1;e+=1){const n=r[e],o=Yo(n.point,r[e-1].point,r[e+1].point),i=r[e-1].point.sub(n.point),s=Zo(o.bisector,i)*Zo(o.bisector,o.normal)>0?1:-1,[a,l]=t[e-1];n.incoming=o.normal.mul(s*a),n.outgoing=o.normal.mul(-s*l)}for(let e=1;e<r.length-1;e+=1){const n=r[e-1],o=r[e],i=r[e+1],s=Yo(o.point,n.point.add(n.outgoing),i.point.add(i.incoming)),a=o.point.add(s.normal),l=o.point.sub(s.normal),c=a.dist(n.point)+l.dist(i.point)<a.dist(i.point)+l.dist(n.point)?1:-1,[d,u]=t[e-1];o.incoming=s.normal.mul(c*d),o.outgoing=s.normal.mul(-c*u)}}return r.slice(1).map((e,t)=>{const n=r[t];return{type:"cubic",start:n.point,control1:n.point.add(n.outgoing),control2:e.point.add(e.incoming),end:e.point}})}(e,t,n);if(2!==e.length||1!==r.length)return r;const o=r[0],i=o.end.sub(o.start),s=i.len();if(s<=Eo)return r;const a=i.normalize(),l=Math.abs(Zo(a,o.control1.sub(o.start))),c=Math.abs(Zo(a,o.control2.sub(o.start)));if(l>Eo||c>Eo)return r;const d=(Math.abs(i.x)>Math.abs(i.y)?new p(Math.sign(i.x),0):new p(0,Math.sign(i.y))).mul(s*Io);return[{...o,control1:o.start.add(d),control2:o.end.sub(d)}]}(o,e,t),s=i[0],a=i[i.length-1],l=(u=i,h=Do(e,s?Vo(s):Uo(e,t.point),r.headStart,r),f=Do(t,a?Ko(a).mul(-1):Uo(t,e.point),r.headEnd,r),u.length<=1?Lo(u[0]?jo(u[0]):0,h,f):{start:$o(jo(u[0]),h),end:$o(jo(u[u.length-1]),f)}),c=_o(e,s?Vo(s):Uo(e,t.point),r.headStart,r.strokeWidth,r.terminalOffsetMapper,l.start),d=_o(t,a?Ko(a).mul(-1):Uo(t,e.point),r.headEnd,r.strokeWidth,r.terminalOffsetMapper,l.end);var u,h,f;return Fo({start:e,end:t,segments:i.map((n,r,o)=>{const i=0===r?c.routePoint.sub(e.point):p.Zero(),s=r===o.length-1?d.routePoint.sub(t.point):p.Zero();return{...n,start:n.start.add(i),control1:n.control1.add(i),control2:n.control2.add(s),end:n.end.add(s)}}),markerSegments:[...c.markerSegments,...d.markerSegments],startArrowScale:l.start,endArrowScale:l.end,routePoints:o})}(e,t,l,{headStart:o,headEnd:i,strokeWidth:s,terminalOffsetMapper:a}):"orthogonal"===n?function(e,t,n,r,o){const i=si(e.outwardNormal),s=si(t.outwardNormal),a=function(e,t,n,r,o){return zo([...zo(e,t,n)].reverse(),r,o).reverse()}(function(e,t,n,r,o){if(0===o.length)return null;const i=o.map(e=>e.clone()),s=i[0],a=i[i.length-1];if(!s||!a)return null;0!==n.x?s.y=e.y:s.x=e.x;0!==r.x?a.y=t.y:a.x=t.x;const l=ii([e,...i,t]);if(l.length<2)return null;for(let c=1;c<l.length;c+=1){const e=l[c-1],t=l[c];if(e.x!==t.x&&e.y!==t.y)return null}return l}(e.point,t.point,i,s,r)??Lr({...e,direction:i},{...t,direction:s}),e,i,t,s),l=Bo(a,e,"start",i),c=Bo(a,t,"end",s),d=(f=a,m=Do(e,l,o.headStart,o),g=Do(t,c,o.headEnd,o),f.length<=2?Lo(f[0]?.dist(f[f.length-1])??0,m,g):{start:$o(f[0].dist(f[1]),m),end:$o(f[f.length-2].dist(f[f.length-1]),g)}),u=_o(e,l,o.headStart,o.strokeWidth,o.terminalOffsetMapper,d.start),p=_o(t,c,o.headEnd,o.strokeWidth,o.terminalOffsetMapper,d.end),h=a.map(e=>e.clone());var f,m,g;h.length>0&&(h[0]=u.routePoint,h[h.length-1]=p.routePoint);return Fo({start:e,end:t,segments:oi(h,n).segments,markerSegments:[...u.markerSegments,...p.markerSegments],startArrowScale:d.start,endArrowScale:d.end,routePoints:a,startTangent:l,endTangent:c.mul(-1)})}(e,t,r,c,{headStart:o,headEnd:i,strokeWidth:s,terminalOffsetMapper:a}):function(e,t,n){const r=t.point.sub(e.point).normalize(),o=r.len()>Eo?r:Uo(e,t.point),i=r.len()>Eo?r.mul(-1):Uo(t,e.point),s=Lo(e.point.dist(t.point),Do(e,o,n.headStart,n),Do(t,i,n.headEnd,n)),a=_o(e,o,n.headStart,n.strokeWidth,n.terminalOffsetMapper,s.start),l=_o(t,i,n.headEnd,n.strokeWidth,n.terminalOffsetMapper,s.end);return Fo({start:e,end:t,segments:[{type:"line",start:a.routePoint,end:l.routePoint}],markerSegments:[...a.markerSegments,...l.markerSegments],startArrowScale:s.start,endArrowScale:s.end,routePoints:[e.point,t.point]})}(e,t,{headStart:o,headEnd:i,strokeWidth:s,terminalOffsetMapper:a})}function Lo(e,t,n){const r=t+n;if(r<=Eo)return{start:0,end:0};const o=Math.min(1,Math.max(0,e-.01)/r);return{start:t>0?o:0,end:n>0?o:0}}function $o(e,t){return t<=Eo?0:Math.min(1,Math.max(0,e-.01)/t)}function Do(e,t,n,r){return"arrow"!==n?0:r.terminalOffsetMapper({point:e.point,direction:t,along:3+mo(r.strokeWidth),perpendicular:0}).len()}function jo(e){const t=Wo(e,"cubic"===e.type?16:"quadratic"===e.type?8:1);return t.slice(1).reduce((e,n,r)=>e+n.dist(t[r]),0)}function Bo(e,t,n,r){if(t.obstacleBounds||e.length<2)return r;const o="start"===n?e[1].sub(e[0]):e[e.length-2].sub(e[e.length-1]);return o.len()>Eo?si(o):r}function zo(e,t,n){if(!t.obstacleBounds||e.length<2)return[...e];const r=e[0],o=e[1],i=o.sub(r);if(i.len()<=Eo)return[...e];if(Math.abs(Zo(i,n))<=Eo&&i.x*n.x+i.y*n.y>0)return[...e];const s=t.point.add(n.mul(36)),a=0!==n.x?new p(s.x,o.y):new p(o.x,s.y);return ii([t.point,s,a,...e.slice(1)])}function _o(e,t,n,r,o,i){if("arrow"!==n||i<=0)return{tipPoint:e.point,routePoint:e.point,markerSegments:[]};const s=t.normalize().len()>Eo?t.normalize():Uo(e,e.point),a=(t,n=0)=>o({point:e.point,direction:s,along:t,perpendicular:n}),l=e.point.add(a(3*i)),c=e.point.add(a((3+mo(r))*i)),d=go(r)*i,u=3*i;return{tipPoint:l,routePoint:c,markerSegments:[{type:"line",start:e.point.add(a(u+d,d)),end:l},{type:"line",start:l,end:e.point.add(a(u+d,-d))},{type:"line",start:c,end:l}]}}function Fo({start:e,end:t,segments:n,markerSegments:r,startArrowScale:o,endArrowScale:i,routePoints:s,startTangent:a,endTangent:l}){const c=[];n.forEach((e,t)=>{const n="cubic"===e.type?function(e,t,n,r,o){const i=[];for(let s=0;s<=o;s+=1){const a=s/o,l=1-a;i.push(e.mul(l*l*l).add(t.mul(3*l*l*a)).add(n.mul(3*l*a*a)).add(r.mul(a*a*a)))}return i}(e.start,e.control1,e.control2,e.end,16):"quadratic"===e.type?Wo(e,8):[e.start,e.end];c.push(...0===t?n:n.slice(1))});const d=n[0],u=n[n.length-1],p=[...ei(n),...r.flatMap(e=>[e.start,e.end]),e.point,t.point];return{path:ni(n),startPagePoint:e.point,endPagePoint:t.point,startTangent:a??(d?Vo(d):t.point.sub(e.point).normalize()),endTangent:l??(u?Ko(u):t.point.sub(e.point).normalize()),startArrowScale:o,endArrowScale:i,pageBounds:h.FromPoints(p),segments:n,markerSegments:r,points:c,routePoints:s}}function Wo(e,t){return Array.from({length:t+1},(n,r)=>bo(e,r/t))}function Ho({direction:e,along:t,perpendicular:n}){const r=e.normalize(),o=new p(-r.y,r.x);return r.mul(t).add(o.mul(n))}function Uo(e,t){const n=e.outwardNormal.normalize();return n.len()>Eo?n:t.sub(e.point).normalize()}function Vo(e){return"line"===e.type?e.end.sub(e.start).normalize():("cubic"===e.type?e.control1:e.control).sub(e.start).normalize()}function Ko(e){return"line"===e.type?e.end.sub(e.start).normalize():e.end.sub("cubic"===e.type?e.control2:e.control).normalize()}function qo(e,t){const n=t.sub(e.point).normalize(),r=e.outwardNormal.normalize(),o=r.len()>Eo?r:n,i=t.sub(e.point),s=Math.abs(Go(i,o)),a=i.len();if(a<Eo)return p.Zero();const l=s<.001?Math.min(150,a):Math.min(Math.max(s,100),a);return o.mul(l*Io)}function Yo(e,t,n){const r=t.dist(e),o=e.dist(n);if(r<Eo||o<Eo)return{normal:p.Zero(),bisector:p.Zero()};const i=r/(r+o),s=t.add(n.sub(t).mul(i)),a=e.sub(s),l=a.len();if(l<Eo)return{normal:p.Zero(),bisector:p.Zero()};const c=a.div(l);return{normal:new p(-c.y,c.x),bisector:a}}function Xo(e){const t=[];for(const n of e){const e=new Set([0,1]);for(const t of Jo(n.start.x,n.control1.x,n.control2.x,n.end.x))e.add(t);for(const t of Jo(n.start.y,n.control1.y,n.control2.y,n.end.y))e.add(t);for(const r of e)t.push(bo(n,r))}return t}function Jo(e,t,n,r){const o=3*(3*t-e-3*n+r),i=2*(3*e-6*t+3*n),s=-3*e+3*t;if(Math.abs(o)<Eo){if(Math.abs(i)<Eo)return[];const e=-s/i;return e>0&&e<1?[e]:[]}const a=i*i-4*o*s;if(a<0)return[];const l=Math.sqrt(a);return[(-i+l)/(2*o),(-i-l)/(2*o)].filter(e=>e>0&&e<1)}function Go(e,t){return e.x*t.x+e.y*t.y}function Zo(e,t){return e.x*t.y-e.y*t.x}function Qo(e,t){const n=e=>t.applyToPoint(e),r=e.segments.map(e=>"line"===e.type?{type:"line",start:n(e.start),end:n(e.end)}:"quadratic"===e.type?{type:"quadratic",start:n(e.start),control:n(e.control),end:n(e.end)}:{type:"cubic",start:n(e.start),control1:n(e.control1),control2:n(e.control2),end:n(e.end)}),o=e.markerSegments.map(e=>({type:"line",start:n(e.start),end:n(e.end)})),i=e.points.map(n),s=n(e.startPagePoint),a=n(e.endPagePoint),l=[...ei(r),...o.flatMap(e=>[e.start,e.end]),s,a];return{...e,path:ni(r),startPagePoint:s,endPagePoint:a,startTangent:ti(t,e.startPagePoint,e.startTangent),endTangent:ti(t,e.endPagePoint,e.endTangent),pageBounds:h.FromPoints(l.length>0?l:i),segments:r,markerSegments:o,points:i,routePoints:e.routePoints.map(n)}}function ei(e){const t=[];for(const n of e)"cubic"===n.type?t.push(...Xo([n])):"quadratic"===n.type?t.push(n.start,n.control,n.end):t.push(n.start,n.end);return t}function ti(e,t,n){return e.applyToPoint(t.add(n)).sub(e.applyToPoint(t)).normalize()}function ni(e){const t=e[0];if(!t)return"";const n=[`M ${ai(t.start)}`];for(const r of e)n.push("line"===r.type?`L ${ai(r.end)}`:"quadratic"===r.type?`Q ${ai(r.control)} ${ai(r.end)}`:`C ${ai(r.control1)} ${ai(r.control2)} ${ai(r.end)}`);return n.join(" ")}function ri(e){const t=[];for(let n=0;n<e.length;n+=1){const r=e[n],o=e[n+1];o&&r.end.equals(o.start)?(t.push(`M ${ai(r.start)} L ${ai(r.end)} L ${ai(o.end)}`),n+=1):t.push(`M ${ai(r.start)} L ${ai(r.end)}`)}return t.join(" ")}function oi(e,t){if(e.length<2)return{path:"",segments:[],points:[...e]};if(2===e.length||t<=0){const t=e.slice(1).map((t,n)=>({type:"line",start:e[n],end:t}));return{path:ni(t),segments:t,points:[...e]}}const n=[],r=[e[0]];let o=e[0];for(let s=1;s<e.length-1;s+=1){const i=e[s-1],a=e[s],l=e[s+1],c=Math.min(Math.max(0,t),i.dist(a)/2,a.dist(l)/2),d=p.Nudge(a,i,c),u=p.Nudge(a,l,c);o.equals(d)||(n.push({type:"line",start:o,end:d}),r.push(d)),n.push({type:"quadratic",start:d,control:a,end:u}),r.push(a,u),o=u}const i=e[e.length-1];return o.equals(i)||(n.push({type:"line",start:o,end:i}),r.push(i)),{path:ni(n),segments:n,points:r}}function ii(e){const t=function(e){const t=[];for(const n of e)t[t.length-1]?.equals(n)||t.push(n);return t}(e);if(t.length<=2)return t;const n=[t[0]];for(let r=1;r<t.length-1;r+=1){const e=n[n.length-1],o=t[r],i=t[r+1];e.x===o.x&&o.x===i.x||e.y===o.y&&o.y===i.y||n.push(o)}return n.push(t[t.length-1]),n}function si(e){return Math.abs(e.x)>=Math.abs(e.y)?new p(e.x>=0?1:-1,0):new p(0,e.y>=0?1:-1)}function ai(e){return`${li(e.x)} ${li(e.y)}`}function li(e){return Number(e.toFixed(3)).toString()}var ci="connector.curve-waypoint",di="connector.curve-insert",ui="connector.orthogonal-segment";function pi(e){return`waypoint:${e}`}function hi(e){return`segment:${e}`}function fi(e,t){return`segment:${e}:${t}`}function mi(e,t){const n=new RegExp(`^${t}:(\\d+)$`).exec(e);if(!n)return null;const r=Number(n[1]);return Number.isSafeInteger(r)?r:null}function gi(e){const t=/^segment:(\d+):(horizontal|vertical)$/.exec(e);if(!t)return null;const n=Number(t[1]);return Number.isSafeInteger(n)?{index:n,axis:t[2]}:null}var yi=R("plugin.connector.runtime");function xi(e){return e.runtime.require(yi)}function bi(e,t){return{kind:"bound",shapeId:e,attachment:ao(t)}}function wi(e,t){if("free"===t.kind)return{draft:t,pagePoint:t.pagePoint.clone(),shape:null,port:null};const n=e.shapes.get(t.shapeId);if(!n||Cr(n)||e.shapes.isHidden(n.id)||null===e.shapes.getClippedPageBounds(n.id)||!e.shapes.getUtil(n).canReceiveTerminalBinding(n,{editor:e}))return null;const r=function(e,t,n){return"port"===n.kind?Q(e,t,n.portId):so(e,t,{portId:uo(n.normalizedAnchor),normalizedAnchor:n.normalizedAnchor})}(e,n,t.attachment);return r?{draft:t,pagePoint:r.pagePoint.clone(),shape:n,port:r,obstacleBounds:e.shapes.getPageBounds(n.id)??void 0}:null}function vi(e,t,n,r){const o=wi(e,t),i=wi(e,n);if(!o||!i)return"missing_endpoint";if(o.shape&&e.layers.isOrAncestorLocked(o.shape.id))return"locked_source";const s=e.pages.getCurrentId(),a=o.shape?e.layers.getPageId(o.shape.id):s,l=i.shape?e.layers.getPageId(i.shape.id):s;if(!a||a!==l||a!==s)return"cross_page";if(o.shape&&o.port&&i.shape&&i.port){if(Ri(o.shape.id,o.port.id,i.shape.id,i.port.id))return"same_attachment";if(Ai(e,o.shape.id,o.port.id,i.shape.id,i.port.id,r))return"duplicate"}return Li(e,o,i)?null:"invalid_parent"}function ki(e,t,n="user"){if(vi(e,t.start,t.end))return null;const r=wi(e,t.start),o=wi(e,t.end);if(!r||!o)return null;const i=Li(e,r,o);if(!i)return null;const s={...e.shapes.getDefaultProps("connector"),...t.props},a=Di({editor:e,parentId:i,start:Ci(r,o,"start"),end:Ci(o,r,"end"),props:s}),l=e.operations.begin({kind:"connector.commit",label:"shape.create",source:n,history:"user"===n?"record":"ignore"});try{const i=e.commands.createShapes([a],{source:n,autoReparent:!1})[0];if(!Cr(i))return l.cancel(),null;if(r.shape&&r.port&&Oi(e,i.id,"start",{shape:r.shape,port:r.port},n),o.shape&&o.port&&Oi(e,i.id,"end",{shape:o.shape,port:o.port},n),"none"!==t.selectionAfter){const r=Array.isArray(t.selectionAfter)?[...t.selectionAfter]:[i.id];e.commands.setSelectedShapeIds(r,{source:n})}const s=e.shapes.get(i.id);return Cr(s)?(l.commit(),s):(l.cancel(),null)}catch(c){throw l.isActive&&l.cancel(),c}}function Si(e,t){return Mi(e,t)}function Pi(e,t,n,r){return Mi(e,t,{[n]:r})}function Mi(e,t,n={}){const r=Ar(e,t.id),o=e.shapes.computeLocalToPageTransform(t),i=o.applyToPoint(new p(t.props.start.x,t.props.start.y)),s=o.applyToPoint(new p(t.props.end.x,t.props.end.y)),a=Ii(e,r.start),l=Ii(e,r.end),c=n.start??a?.port.pagePoint??i,d=n.end??l?.port.pagePoint??s,u=!n.start&&a?Ei(e,a):Ti(c,d,"start"),h=!n.end&&l?Ei(e,l):Ti(d,c,"end"),f=a&&l?Ni(e,a.shape,l.shape):t.parentId;if(!f||!e.layers.canReceiveChildren(f))return null;const m=Di({editor:e,parentId:f,start:u,end:h,props:t.props,manualPageGeometry:{curveWaypoints:t.props.curveWaypoints.map(e=>o.applyToPoint(new p(e.x,e.y))),orthogonalBends:t.props.orthogonalBends.map(e=>o.applyToPoint(new p(e.x,e.y)))}});return{...t,parentId:f,x:m.x,y:m.y,rotation:0,scaleX:1,scaleY:1,props:{...t.props,...m.props}}}function Ii(e,t){if(!t)return null;const n=e.shapes.get(t.toId);if(!n)return null;const r=so(e,n,t.props);return r?{shape:n,port:r}:null}function Ei(e,t){return{point:t.port.pagePoint,outwardNormal:t.port.pageOutwardNormal,obstacleId:t.shape.id,obstacleBounds:e.shapes.getPageBounds(t.shape.id)??void 0}}function Ti(e,t,n){const r=t.sub(e).normalize();return{point:e,outwardNormal:r.len()>0?r:new p("start"===n?1:-1,0)}}function Ci(e,t,n){return e.shape&&e.port?{point:e.pagePoint,outwardNormal:e.port.pageOutwardNormal,obstacleId:e.shape.id,obstacleBounds:e.obstacleBounds}:Ti(e.pagePoint,t.pagePoint,n)}function Oi(e,t,n,r,o){e.commands.createBinding({type:"connector",fromId:t,toId:r.shape.id,props:lo(n,r.port)},{source:o})}function Ai(e,t,n,r,o,i){for(const s of e.state.currentPageShapeIds.get()){if(s===i)continue;const a=e.shapes.get(s);if(!Cr(a))continue;const l=Ar(e,a.id);if(l.start?.toId===t&&l.start.props.portId===n&&l.end?.toId===r&&l.end.props.portId===o)return!0}return!1}function Ri(e,t,n,r){return e===n&&t===r}function Ni(e,t,n){const r=e.layers.getPageId(t.id);if(!r||r!==e.layers.getPageId(n.id))return null;const o=new Set(ji(e,n));for(const i of ji(e,t))if(o.has(i)&&e.layers.canReceiveChildren(i))return i;return r}function Li(e,t,n){if(t.shape&&n.shape)return Ni(e,t.shape,n.shape);const r=e.pages.getCurrentId(),o=t.shape??n.shape,i=t.shape?n.pagePoint:t.pagePoint;if(o){for(const t of ji(e,o)){if(!t.startsWith("shape:"))return t;const n=e.shapes.get(t);if(n&&$i(e,n,[i]))return n.id}return e.layers.getPageId(o.id)??r}let s=null;const a=new Map(e.state.currentPageShapeIds.get().map((e,t)=>[e,t]));for(const l of e.state.currentPageShapeIds.get()){const r=e.shapes.get(l);if(!r||Cr(r)||!$i(e,r,[t.pagePoint,n.pagePoint]))continue;const o=e.shapes.getPageBounds(r.id);if(!o)continue;const i={shape:r,area:o.w*o.h,order:a.get(r.id)??-1};(!s||i.area<s.area||i.area===s.area&&i.order>s.order)&&(s=i)}return s?.shape.id??r}function $i(e,t,n){if(e.shapes.isHidden(t.id)||e.layers.isOrAncestorLocked(t.id)||null===e.shapes.getClippedPageBounds(t.id))return!1;const r=e.shapes.getUtil(t);if(!r.canReceiveChildren(t)||!r.canAutomaticallyReceiveChildren(t))return!1;const o=e.shapes.computeLocalToPageTransform(t).tryInvert();if(!o)return!1;const i=r.getChildClipLocalPolygons(t),s=r.getLocalBounds(t);return n.every(n=>{if(!e.shapes.isPagePointInClip(t.id,n))return!1;const r=o.applyToPoint(n);return i?function(e,t){return t.some(t=>x(e,t))}(r,i):s.containsPoint(r)})}function Di({editor:e,parentId:t,start:n,end:r,props:o,manualPageGeometry:i}){const s=i?.curveWaypoints??[],a=i?.orthogonalBends??[],l=t.startsWith("shape:")?e.shapes.get(t):null,c=l?e.shapes.computeLocalToPageTransform(l):A.Identity(),d=No({start:n,end:r,routing:o.routing,cornerRadius:o.cornerRadius,headStart:o.headStart,headEnd:o.headEnd,strokeWidth:o.strokeWidth,terminalOffsetMapper:To(c),curveWaypoints:s,orthogonalBends:a}),u=function(e,t,n){const r=t.startsWith("shape:")?e.shapes.get(t):null,o=(r?e.shapes.computeLocalToPageTransform(r):A.Identity()).tryInvert();return o?{bounds:h.FromPoints(n.map(e=>o.applyToPoint(e))),pageToParent:o}:null}(e,t,[n.point,...d.points,r.point]),p=u?.pageToParent??A.Identity(),f=u?.bounds??d.pageBounds,m=p.applyToPoint(n.point),g=p.applyToPoint(r.point);return{type:"connector",parentId:t,x:f.x,y:f.y,props:{...o,w:Math.max(1,f.w),h:Math.max(1,f.h),start:{x:m.x-f.x,y:m.y-f.y},end:{x:g.x-f.x,y:g.y-f.y},curveWaypoints:s.map(e=>{const t=p.applyToPoint(e);return{x:t.x-f.x,y:t.y-f.y}}),orthogonalBends:a.map(e=>{const t=p.applyToPoint(e);return{x:t.x-f.x,y:t.y-f.y}})}}}function ji(e,t){const n=[],r=new Set;let o=t.parentId;for(;o.startsWith("shape:");){const t=o;if(r.has(t))break;r.add(t),n.push(t);const i=e.shapes.get(t);if(!i)break;o=i.parentId}return n.push(o),n}var Bi=["rectangle","ellipse","message-circle","summary","summary-left","burst","rhombus","triangle","pentagon","hexagon","star","trapezoid","arrow-left","arrow-right"],zi=["solid","dashed","dotted","none"];function _i(e){return c(e)&&"geo"===e.type}function Fi(e){return"string"==typeof e&&Bi.includes(e)}function Wi(e){return"string"==typeof e&&zi.includes(e)}var Hi=R("plugin.geo.creation-runtime");function Ui(e){return e.runtime.require(Hi)}function Vi(e,t){return new h(e.x,e.y,t.w,t.h)}var Ki=class extends ie{kind;constructor(e,t,n){super(e,t),this.kind=n,this.initial="idle",this.addChild(new qi(e,this)),this.addChild(new Yi(e,this))}getDefaultProps(){return{...this.editor.shapes.getDefaultProps("geo"),kind:this.kind}}onEnter(){this.editor.shapes.updateDefaultProps("geo",{kind:this.kind})}},qi=class extends ie{tool;constructor(e,t){super(e,"idle",t),this.tool=t}onEnter(){this.editor.interaction.clearSelection()}onExit(){Ui(this.editor).clearHover()}onPointerMove(e){const t=Ui(this.editor);"touch"!==e.pointerType&&0===e.buttons?t.setHover({pagePoint:e.pagePoint,timestamp:e.timestamp}):t.clearHover()}onPointerDown(e){this.transition("creating",{originPagePoint:e.pagePoint.clone(),originScreenPoint:e.screenPoint.clone(),shapeId:null,props:this.tool.getDefaultProps(),isDragCreating:!1})}},Yi=class extends ie{info=null;operation=null;constructor(e,t){super(e,"creating",t)}onEnter(e){if(this.info=e,this.info){this.operation=this.editor.operations.begin({kind:"geo.create",label:"shape.create",source:"user",history:"record"});try{const e=this.createShape(Vi(this.info.originPagePoint,this.info.props),this.info.props);this.info.shapeId=e.id}catch(t){throw this.cancelOperation(),t}}}onPointerMove(e){this.updateShape(e.pagePoint,e.screenPoint,e.shiftKey)}onPointerUp(e){this.info?(this.updateShape(e.pagePoint,e.screenPoint,e.shiftKey),this.info.shapeId&&j(this.editor,this.info.shapeId,{source:"user"}),this.commitOperation(),this.editor.state.tool.get().isToolLocked?this.transition("idle"):this.editor.commands.setActiveTool("select",{source:"system"})):this.transition("idle")}onCancel(){this.cancelOperation(),this.transition("idle")}onExit(){this.cancelOperation(),this.info=null}commitOperation(){const e=this.operation;this.operation=null,e?.commit()}cancelOperation(){const e=this.operation;this.operation=null,e?.isActive&&e.cancel()}updateShape(e,t,n){if(!this.info)return;const r=this.info.originScreenPoint.dist(t);if(!this.info.isDragCreating){if(r<4)return;this.info.isDragCreating=!0}const o=function(e,t,n){let r=t.x-e.x,o=t.y-e.y;if(n){const e=Math.max(Math.abs(r),Math.abs(o));r=(r<0?-1:1)*e,o=(o<0?-1:1)*e}const i=new p(e.x+r,e.y+o);return new h(Math.min(e.x,i.x),Math.min(e.y,i.y),Math.max(Math.abs(i.x-e.x),1),Math.max(Math.abs(i.y-e.y),1))}(this.info.originPagePoint,e,n),i=this.info.shapeId;i&&this.editor.commands.updateShapes([{id:i,x:o.x,y:o.y,props:{w:o.w,h:o.h}}],{source:"user"})}createShape(e,t){const[n]=this.editor.commands.createShapes([{type:"geo",x:e.x,y:e.y,props:{...t,w:e.w,h:e.h}}],{source:"user",autoReparent:!1});if(!n)throw new Error("Failed to create geo shape");return this.editor.commands.setSelectedShapeIds([n.id],{source:"system"}),n}},Xi=class extends Ki{constructor(e){super(e,"rectangle","rectangle")}},Ji=class extends Ki{constructor(e){super(e,"ellipse","ellipse")}},Gi=class extends Ki{constructor(e){super(e,"message-circle","message-circle")}},Zi=class extends Ki{constructor(e){super(e,"summary","summary")}},Qi=class extends Ki{constructor(e){super(e,"summary-left","summary-left")}},es=class extends Ki{constructor(e){super(e,"burst","burst")}},ts=class extends Ki{constructor(e){super(e,"rhombus","rhombus")}},ns=class extends Ki{constructor(e){super(e,"triangle","triangle")}},rs=class extends Ki{constructor(e){super(e,"pentagon","pentagon")}},is=class extends Ki{constructor(e){super(e,"hexagon","hexagon")}},ss=class extends Ki{constructor(e){super(e,"star","star")}},as=class extends Ki{constructor(e){super(e,"trapezoid","trapezoid")}},ls=class extends Ki{constructor(e){super(e,"arrow-left","arrow-left")}},cs=class extends Ki{constructor(e){super(e,"arrow-right","arrow-right")}},ds=ut("plugin-geo.api");function us({editor:e}){return function({editor:e}){return{create:t=>function(e,t){const n=e.shapes.getDefaultProps("geo"),[r]=e.commands.createShapes([{type:"geo",x:t.x,y:t.y,meta:t.meta?{...t.meta}:void 0,props:{...n,kind:t.kind,w:t.w??n.w,h:t.h??n.h,fill:t.fill??n.fill,stroke:t.stroke??n.stroke,strokeStyle:t.strokeStyle??n.strokeStyle,strokeWidth:t.strokeWidth??n.strokeWidth,cornerRadiusPercent:t.cornerRadiusPercent??n.cornerRadiusPercent}}],{source:"user"});return"geo"===r?.type?{id:r.id,type:r.type}:null}(e,t),getSelectionStyle:()=>function(e){const t=e.state.selectedShapes.get().filter(_i);return 0===t.length?null:{kind:ps(t.map(e=>e.props.kind)),fill:ps(t.map(e=>e.props.fill)),stroke:ps(t.map(e=>e.props.stroke)),strokeStyle:ps(t.map(e=>e.props.strokeStyle)),strokeWidth:ps(t.map(e=>e.props.strokeWidth)),cornerRadiusPercent:ps(t.map(e=>e.props.cornerRadiusPercent))}}(e),setSelectionStyle(t){const n=e.state.selectedShapes.get().filter(_i).filter(e=>!e.isLocked).map(e=>({id:e.id,props:{...t}}));return n.length>0&&e.commands.updateShapes(n,{source:"user"}),n.map(({id:e})=>e)},getToolDefaults:()=>e.shapes.getDefaultProps("geo"),setToolDefaults:t=>(e.shapes.updateDefaultProps("geo",{...t}),e.shapes.getDefaultProps("geo"))}}({editor:e})}function ps(e){const[t,...n]=e;return void 0!==t&&n.every(e=>e===t)?t:null}var hs=/[AaCcHhLlMmVvZz]|[-+]?(?:\d+\.\d*|\.\d+|\d+)(?:[eE][-+]?\d+)?/g,fs=/^[AaCcHhLlMmVvZz]$/,ms=Math.PI/6,gs=1e-8;function ys(e){const t=e.match(hs)??[],n=e.replace(hs,"").replace(/[\s,]/g,"");if(n.length>0)throw new Error(`Unsupported SVG path content: ${n}`);const r=[];let o=null,i=null,s=new p(0,0),a=0;for(;a<t.length;){const e=t[a];if(e&&fs.test(e)&&(i=e,a+=1,"z"===i.toLowerCase())){if(!o)throw new Error("SVG path closes before starting a subpath.");o.closed=!0,s=o.start.clone(),i=null;continue}if(!i)throw new Error("SVG path data is missing a command.");const n=i,l=xs(n),c=bs(t,a,l);a+=l;const d=n===n.toLowerCase();switch(n.toLowerCase()){case"m":s=vs(s,c[0],c[1],d),o={start:s.clone(),segments:[],closed:!1},r.push(o),i=d?"l":"L";break;case"l":{const e=vs(s,c[0],c[1],d);ks(o,{type:"line",start:s,end:e}),s=e;break}case"h":{const e=new p(d?s.x+c[0]:c[0],s.y);ks(o,{type:"line",start:s,end:e}),s=e;break}case"v":{const e=new p(s.x,d?s.y+c[0]:c[0]);ks(o,{type:"line",start:s,end:e}),s=e;break}case"c":{const e=vs(s,c[0],c[1],d),t=vs(s,c[2],c[3],d),n=vs(s,c[4],c[5],d);ks(o,{type:"cubic",start:s,control1:e,control2:t,end:n}),s=n;break}case"a":{const e=ws(c[3]),t=ws(c[4]),n=vs(s,c[5],c[6],d);ks(o,{type:"arc",start:s,end:n,radiusX:Math.abs(c[0]),radiusY:Math.abs(c[1]),rotation:c[2],largeArc:e,sweep:t}),s=n;break}}}return r}function xs(e){switch(e.toLowerCase()){case"m":case"l":return 2;case"h":case"v":return 1;case"c":return 6;case"a":return 7;default:throw new Error(`Unsupported SVG path command: ${e}`)}}function bs(e,t,n){const r=[];for(let o=0;o<n;o+=1){const n=e[t+o];if(!n||fs.test(n))throw new Error("SVG path command has incomplete numeric values.");const i=Number(n);if(!Number.isFinite(i))throw new Error(`Invalid SVG path number: ${n}`);r.push(i)}return r}function ws(e){if(0!==e&&1!==e)throw new Error(`SVG arc flag must be 0 or 1, received ${e}.`);return 1===e}function vs(e,t,n,r){return r?new p(e.x+t,e.y+n):new p(t,n)}function ks(e,t){if(!e)throw new Error("SVG path draws before starting a subpath.");e.segments.push(t)}function Ss(e){const t=[e.start.clone()];for(const n of e.segments)switch(n.type){case"line":Ns(t,n.end);break;case"cubic":{const e=[...Array.from({length:8},(e,t)=>(t+1)/8),...Ms(n)].sort((e,t)=>e-t).filter((e,t,n)=>0===t||Math.abs(e-(n[t-1]??e))>gs);for(const r of e)Ns(t,Ps(n,r));break}case"arc":for(const e of Es(n))Ns(t,e)}return e.closed&&t.length>1&&Ls(t[0],t[t.length-1])&&t.pop(),t}function Ps(e,t){const n=1-t,r=n*n*n,o=3*n*n*t,i=3*n*t*t,s=t*t*t;return new p(e.start.x*r+e.control1.x*o+e.control2.x*i+e.end.x*s,e.start.y*r+e.control1.y*o+e.control2.y*i+e.end.y*s)}function Ms(e){return[...Is(e.start.x,e.control1.x,e.control2.x,e.end.x),...Is(e.start.y,e.control1.y,e.control2.y,e.end.y)].filter(e=>e>0&&e<1).sort((e,t)=>e-t).filter((e,t,n)=>0===t||Math.abs(e-(n[t-1]??e))>gs)}function Is(e,t,n,r){const o=3*t-e-3*n+r,i=2*(e-2*t+n),s=t-e;if(Math.abs(o)<=gs)return Math.abs(i)<=gs?[]:[-s/i];const a=i*i-4*o*s;if(a<-1e-8)return[];const l=Math.sqrt(Math.max(0,a));return[(-i-l)/(2*o),(-i+l)/(2*o)]}function Es(e){const t=Ts(e);if(!t)return[e.end.clone()];const n=Math.max(1,Math.ceil(Math.abs(t.deltaAngle)/ms)),r=[...Array.from({length:n},(e,t)=>(t+1)/n),...Cs(t).map(e=>function(e,t){return Os(e,t)/Math.abs(e.deltaAngle)}(t,e))].filter(e=>e>0&&e<=1).sort((e,t)=>e-t).filter((e,t,n)=>0===t||Math.abs(e-(n[t-1]??e))>gs),o=[];for(const i of r){const e=t.startAngle+t.deltaAngle*i;o.push(Rs(t,e))}return o[o.length-1]=e.end.clone(),o}function Ts(e){if(0===e.radiusX||0===e.radiusY||Ls(e.start,e.end))return null;const t=e.rotation*Math.PI/180,n=Math.cos(t),r=Math.sin(t),o=(e.start.x-e.end.x)/2,i=(e.start.y-e.end.y)/2,s=n*o+r*i,a=-r*o+n*i;let l=e.radiusX,c=e.radiusY;const d=s*s/(l*l)+a*a/(c*c);if(d>1){const e=Math.sqrt(d);l*=e,c*=e}const u=l*l,p=c*c,h=s*s,f=a*a,m=u*f+p*h,g=Math.max(0,u*p-u*f-p*h),y=e.largeArc===e.sweep?-1:1,x=0===m?0:y*Math.sqrt(g/m),b=x*(l*a/c),w=x*(-c*s/l),v=n*b-r*w+(e.start.x+e.end.x)/2,k=r*b+n*w+(e.start.y+e.end.y)/2,S=(s-b)/l,P=(a-w)/c,M=(-s-b)/l,I=(-a-w)/c,E=Math.atan2(P,S);let T=(C=S,O=P,A=M,R=I,Math.atan2(C*R-O*A,C*A+O*R));var C,O,A,R;return!e.sweep&&T>0?T-=2*Math.PI:e.sweep&&T<0&&(T+=2*Math.PI),{centerX:v,centerY:k,radiusX:l,radiusY:c,cosRotation:n,sinRotation:r,startAngle:E,deltaAngle:T}}function Cs(e){const{radiusX:t,radiusY:n,cosRotation:r,sinRotation:o}=e,i=Math.atan2(-n*o,t*r),s=Math.atan2(n*r,t*o);return[i,i+Math.PI,s,s+Math.PI].filter(t=>function(e,t){return Os(e,t)<=Math.abs(e.deltaAngle)+gs}(e,t))}function Os(e,t){return e.deltaAngle>=0?As(t-e.startAngle):As(e.startAngle-t)}function As(e){const t=2*Math.PI;return(e%t+t)%t}function Rs(e,t){const n=e.radiusX*Math.cos(t),r=e.radiusY*Math.sin(t);return new p(e.centerX+e.cosRotation*n-e.sinRotation*r,e.centerY+e.sinRotation*n+e.cosRotation*r)}function Ns(e,t){const n=e[e.length-1];n&&Ls(n,t)||e.push(t.clone())}function Ls(e,t){return Math.abs(e.x-t.x)<=gs&&Math.abs(e.y-t.y)<=gs}var $s=24,Ds=3.222,js=12.443999999999999+Math.max(3.191,3.19)+1,Bs="m19.8415 12.945 1.827 1.428h-2.26a1 1 0 0 0-.972 1.232l.676 2.828-2.462-2.204a1 1 0 0 0-1.66.624l-.386 3.152-1.548-2.838c-.417-.765-1.545-.668-1.825.158l-1.064 3.138-.215-2.358a1 1 0 0 0-1.535-.751l-1.482.95.437-1.803a1 1 0 0 0-1.099-1.228l-2.962.38 1.446-1.17a1 1 0 0 0 .036-1.525L2.1425 10.6l3.088-.791a1 1 0 0 0 .534-1.592l-2-2.513L7.7425 7.879a1 1 0 0 0 1.434-.578l.775-2.464 1.377 2.067a1 1 0 0 0 1.635.042l2.539-3.41-.115 2.574a1 1 0 0 0 1.16 1.031l2.59-.42-.804 1.34a1 1 0 0 0 .67 1.496l2.853.544-1.93 1.207a1 1 0 0 0-.085 1.636Z",zs=function(e){const t=function(e){return ys(e).map(e=>({closed:e.closed,points:Ss(e)}))}(e),[n]=t;if(1!==t.length||!n||!n.closed)throw new Error("Geo path must contain exactly one closed subpath.");return n.points}(Bs),_s=function(e){const t=[];for(const n of ys(e)){t.push(n.start.clone());for(const e of n.segments)switch(t.push(e.end.clone()),e.type){case"line":break;case"cubic":for(const n of Ms(e))t.push(Ps(e,n));break;case"arc":{const n=Ts(e);if(!n)break;for(const e of Cs(n))t.push(Rs(n,e));break}}}if(0===t.length)throw new Error("SVG path does not contain any points.");return h.FromPoints(t)}(Bs),Fs=[[3.383,17.776],[4.46,19.1],[19.54,19.1],[20.617,17.776],[18.117,5.776],[17.04,4.9],[6.96,4.9],[5.883,5.776]],Ws=[[12.444,3.002],[12.444,7.316],[20.709,7.316],[20.809,7.416],[20.809,15.871],[20.709,15.971],[12.444,15.971],[12.444,20.285],[12.275,20.357],[3.222,11.716],[3.222,11.571],[12.275,2.93]],Hs=[[11.556,3.002],[11.556,7.316],[3.29,7.316],[3.19,7.416],[3.19,15.87],[3.29,15.97],[11.556,15.97],[11.556,20.285],[11.725,20.357],[20.778,11.716],[20.778,11.571],[11.725,2.93]];function Us(e,t,n={}){switch(t){case"ellipse":return function(e,t=32){const n=[];for(let r=0;r<t;r+=1){const o=r/t*Math.PI*2;n.push(new p(e.center.x+e.w/2*Math.cos(o),e.center.y+e.h/2*Math.sin(o)))}return n}(e);case"message-circle":return function(e){const t=[da(e,Xs),da(e,Js)];let n=Js;for(const r of Gs){for(let o=1;o<=Ys;o+=1)t.push(da(e,ca(n,r.control1,r.control2,r.end,o/Ys)));n=r.end}return t}(e);case"summary":case"summary-left":return ga(e);case"burst":return function(e){return zs.map(t=>ha(e,(t.x-_s.minX)/_s.w,(t.y-_s.minY)/_s.h))}(e);case"rhombus":return[new p(e.center.x,e.minY),new p(e.maxX,e.center.y),new p(e.center.x,e.maxY),new p(e.minX,e.center.y)];case"triangle":return[new p(e.center.x,e.minY),new p(e.maxX,e.maxY),new p(e.minX,e.maxY)];case"pentagon":return function(e,t){const n=[];for(let r=0;r<t;r+=1){const e=-Math.PI/2+r*Math.PI*2/t;n.push(new p(Math.cos(e),Math.sin(e)))}return fa(n,e)}(e,5);case"hexagon":return[new p(e.minX+.25*e.w,e.minY),new p(e.maxX-.25*e.w,e.minY),new p(e.maxX,e.center.y),new p(e.maxX-.25*e.w,e.maxY),new p(e.minX+.25*e.w,e.maxY),new p(e.minX,e.center.y)];case"star":return function(e){const t=[];for(let n=0;n<10;n+=1){const e=-Math.PI/2+n*Math.PI/5,r=n%2==0?1:.48;t.push(new p(Math.cos(e)*r,Math.sin(e)*r))}return fa(t,e)}(e);case"trapezoid":return function(e){return Fs.map(([t,n])=>ha(e,t/$s,n/$s))}(e);case"arrow-left":return ra(e,"left").outline;case"arrow-right":return ra(e,"right").outline;case"rectangle":return function(e,t=Ks(e),n=4){const r=Math.min(Math.max(0,t),Math.max(0,e.w)/2,Math.max(0,e.h)/2);if(0===r)return ga(e);const o=[];return ma(o,{centerX:e.maxX-r,centerY:e.minY+r,radius:r,startAngle:-Math.PI/2,endAngle:0,segments:n}),ma(o,{centerX:e.maxX-r,centerY:e.maxY-r,radius:r,startAngle:0,endAngle:Math.PI/2,segments:n}),ma(o,{centerX:e.minX+r,centerY:e.maxY-r,radius:r,startAngle:Math.PI/2,endAngle:Math.PI,segments:n}),ma(o,{centerX:e.minX+r,centerY:e.minY+r,radius:r,startAngle:Math.PI,endAngle:3*Math.PI/2,segments:n}),o}(e,Ks({cornerRadiusPercent:n.cornerRadiusPercent,w:e.w,h:e.h}))}return xa(t)}function Vs(e,t=12){return Math.min(50,Math.max(0,"number"==typeof e&&Number.isFinite(e)?e:t))}function Ks({cornerRadiusPercent:e=12,h:t,w:n}){return Math.min(Math.max(0,n),Math.max(0,t))*Vs(e)/100}var qs=24,Ys=8,Xs=new p(3,20),Js=new p(4.3,16.1),Gs=[{control1:new p(1.976,12.663),control2:new p(2.874,8.228),end:new p(6.4,5.726)},{control1:new p(9.926,3.225),control2:new p(14.99,3.43),end:new p(18.245,6.206)},{control1:new p(21.5,8.983),control2:new p(21.94,13.472),end:new p(19.274,16.707)},{control1:new p(16.608,19.942),control2:new p(11.659,20.922),end:new p(7.7,19)}];function Zs(e){const t=da(e,Xs),n=da(e,Js),r=[`M${ua(t)}`,`L${ua(n)}`];for(const o of Gs)r.push(`C${ua(da(e,o.control1))} ${ua(da(e,o.control2))} ${ua(da(e,o.end))}`);return r.push(`L${ua(t)}`),r.join(" ")}function Qs(e){const t=e.w/$s,n=e.h/$s;return`translate(${pa(e.x)} ${pa(e.y)}) scale(${pa(t)} ${pa(n)})`}function ea(e){const t=e.w/_s.w,n=e.h/_s.h,r=e.minX-_s.minX*t,o=e.minY-_s.minY*n;return`translate(${pa(r)} ${pa(o)}) scale(${pa(t)} ${pa(n)})`}function ta(e,t){const n=Math.min(e.w/$s,e.h/18),r=e.h/18,o="left"===t?e.minX-3*n:e.maxX-20*n,i=e.minY-3*r;return`translate(${pa(o)} ${pa(i)}) scale(${pa(n)} ${pa(r)})`}function na(e,t,n={}){switch(t){case"ellipse":return{tag:"ellipse",cx:e.center.x,cy:e.center.y,rx:e.w/2,ry:e.h/2};case"message-circle":return{tag:"path",d:Zs(e)};case"summary":return{tag:"path",d:"M16 15a3.2 3.2 0 0 0-1.618-2.783L14 12l.382-.217C15.382 11.213 16 10.15 16 9V7a4 4 0 0 1 4-4M16 15v2a4 4 0 0 0 4 4",fill:"none",transform:ta(e,"right"),vectorEffect:"non-scaling-stroke"};case"summary-left":return{tag:"path",d:"M7 15c0-1.151.618-2.214 1.618-2.783L9 12l-.382-.217A3.2 3.2 0 0 1 7 9V7a4 4 0 0 0-4-4M7 15v2a4 4 0 0 1-4 4",fill:"none",transform:ta(e,"left"),vectorEffect:"non-scaling-stroke"};case"burst":return{tag:"path",d:Bs,transform:ea(e),vectorEffect:"non-scaling-stroke"};case"trapezoid":return{tag:"path",d:"M3.383 17.776A1.1 1.1 0 0 0 4.46 19.1h15.08a1.1 1.1 0 0 0 1.077-1.324l-2.5-12A1.1 1.1 0 0 0 17.04 4.9H6.96a1.1 1.1 0 0 0-1.077.876z",transform:Qs(e),vectorEffect:"non-scaling-stroke"};case"arrow-left":return{tag:"path",d:ra(e,"left").path};case"arrow-right":return{tag:"path",d:ra(e,"right").path};case"rectangle":{const t=Ks({cornerRadiusPercent:n.cornerRadiusPercent,w:e.w,h:e.h});return{tag:"rect",x:e.x,y:e.y,width:e.w,height:e.h,rx:t,ry:t}}case"rhombus":case"triangle":case"pentagon":case"hexagon":case"star":return{tag:"polygon",points:Us(e,t,n)}}return xa(t)}function ra(e,t){const n=Math.min(e.h/$s,e.w/js),r=e.center.y-12*n,o="left"===t?e.minX+Ds*n:e.maxX-Ds*n,i="left"===t?o+9.222*n:o-9.222*n;return{outline:("left"===t?Ws:Hs).map(([o,s])=>function(e,t,n){const{neckX:r,originY:o,scale:i,x:s,y:a}=n;let l;l="left"===t?s<=12.444?r+(s-12.444)*i:s>=20.709?e.maxX-($s-s)*i:sa(s,12.444,20.709,r,e.maxX-3.2910000000000004*i):s>=11.556?r+(s-11.556)*i:s<=3.29?e.minX+s*i:sa(s,3.29,11.556,e.minX+3.29*i,r);return new p(l,o+a*i)}(e,t,{neckX:i,originY:r,scale:n,x:o,y:s})),path:"left"===t?oa(e,{neckX:i,originY:r,scale:n}):ia(e,{neckX:i,originY:r,scale:n})}}function oa(e,t){if(la(e))return"M12.444 6.416v.9h8.265a.1.1 0 0 1 .1.1v8.455a.1.1 0 0 1-.1.1h-8.265v4.314c0 .034-.008.048-.014.056a.1.1 0 0 1-.047.036.1.1 0 0 1-.058.009c-.01-.002-.025-.005-.05-.029l-9.053-8.641a.1.1 0 0 1 0-.145l9.053-8.641c.025-.024.04-.028.05-.03a.1.1 0 0 1 .058.01.1.1 0 0 1 .047.036c.006.008.014.022.014.056z";const{neckX:n,originY:r,scale:o}=t,i=e.maxX-3.2910000000000004*o;return[`M${ua(new p(n,r+6.416*o))}`,`v${pa(.9*o)}`,`H${pa(i)}`,`a${aa(o,[.1,.1,0,0,1,.1,.1])}`,`v${pa(8.455*o)}`,`a${aa(o,[.1,.1,0,0,1,-.1,.1])}`,`H${pa(n)}`,`v${pa(4.314*o)}`,`c${aa(o,[0,.034,-.008,.048,-.014,.056])}`,`a${aa(o,[.1,.1,0,0,1,-.047,.036])}`,`a${aa(o,[.1,.1,0,0,1,-.058,.009])}`,`c${aa(o,[-.01,-.002,-.025,-.005,-.05,-.029])}`,`l${aa(o,[-9.053,-8.641])}`,`a${aa(o,[.1,.1,0,0,1,0,-.145])}`,`l${aa(o,[9.053,-8.641])}`,`c${aa(o,[.025,-.024,.04,-.028,.05,-.03])}`,`a${aa(o,[.1,.1,0,0,1,.058,.01])}`,`a${aa(o,[.1,.1,0,0,1,.047,.036])}`,`c${aa(o,[.006,.008,.014,.022,.014,.056])}`,"z"].join(" ")}function ia(e,t){if(la(e))return"M10.656 7.316h.9V3.002c0-.034.008-.048.014-.056a.1.1 0 0 1 .046-.036.1.1 0 0 1 .059-.01c.01.002.025.006.05.03l9.053 8.641a.1.1 0 0 1 0 .145l-9.053 8.641c-.025.024-.04.027-.05.029a.1.1 0 0 1-.059-.01.1.1 0 0 1-.046-.035c-.006-.008-.014-.022-.014-.056V15.97H3.29a.1.1 0 0 1-.1-.1V7.416a.1.1 0 0 1 .1-.1z";const{neckX:n,originY:r,scale:o}=t,i=e.minX+3.29*o;return[`M${ua(new p(n-.9*o,r+7.316*o))}`,`H${pa(n)}`,`V${pa(r+3.002*o)}`,`c${aa(o,[0,-.034,.008,-.048,.014,-.056])}`,`a${aa(o,[.1,.1,0,0,1,.046,-.036])}`,`a${aa(o,[.1,.1,0,0,1,.059,-.01])}`,`c${aa(o,[.01,.002,.025,.006,.05,.03])}`,`l${aa(o,[9.053,8.641])}`,`a${aa(o,[.1,.1,0,0,1,0,.145])}`,`l${aa(o,[-9.053,8.641])}`,`c${aa(o,[-.025,.024,-.04,.027,-.05,.029])}`,`a${aa(o,[.1,.1,0,0,1,-.059,-.01])}`,`a${aa(o,[.1,.1,0,0,1,-.046,-.035])}`,`c${aa(o,[-.006,-.008,-.014,-.022,-.014,-.056])}`,`V${pa(r+15.97*o)}`,`H${pa(i)}`,`a${aa(o,[.1,.1,0,0,1,-.1,-.1])}`,`V${pa(r+7.416*o)}`,`a${aa(o,[.1,.1,0,0,1,.1,-.1])}`,"z"].join(" ")}function sa(e,t,n,r,o){const i=n-t;return 0===i?r:r+(e-t)/i*(o-r)}function aa(e,t){const n=7===t.length;return t.map((t,r)=>pa(n&&r>=2&&r<=4?t:t*e)).join(" ")}function la(e){return 0===e.x&&0===e.y&&e.w===$s&&e.h===$s}function ca(e,t,n,r,o){const i=1-o,s=i*i*i,a=3*i*i*o,l=3*i*o*o,c=o*o*o;return new p(e.x*s+t.x*a+n.x*l+r.x*c,e.y*s+t.y*a+n.y*l+r.y*c)}function da(e,t){return ha(e,t.x/qs,t.y/qs)}function ua(e){return`${pa(e.x)} ${pa(e.y)}`}function pa(e){return Number.isFinite(e)?Number(e.toFixed(4)).toString():"0"}function ha(e,t,n){return new p(e.minX+e.w*t,e.minY+e.h*n)}function fa(e,t){const n=h.FromPoints([...e]);return 0===n.w||0===n.h?[t.center]:e.map(e=>new p(t.minX+(e.x-n.minX)/n.w*t.w,t.minY+(e.y-n.minY)/n.h*t.h))}function ma(e,{centerX:t,centerY:n,endAngle:r,radius:o,segments:i,startAngle:s}){const a=Math.max(1,Math.floor(i));for(let l=0;l<=a;l+=1){const i=s+(r-s)*(l/a);e.push(new p(t+Math.cos(i)*o,n+Math.sin(i)*o))}}function ga(e){return[new p(e.minX,e.minY),new p(e.maxX,e.minY),new p(e.maxX,e.maxY),new p(e.minX,e.maxY)]}function ya(e,t,n){const r=n.sub(t),o=r.len2();if(0===o)return e.dist(t);const i=e.sub(t),s=Math.max(0,Math.min(1,(i.x*r.x+i.y*r.y)/o));return e.dist(t.add(r.mul(s)))}function xa(e){throw new Error(`Unsupported geo shape kind: ${String(e)}`)}function ba(e,t){return"number"==typeof e&&Number.isFinite(e)?e:t}function wa(e,t){return e.x*t.y-e.y*t.x}function va(e,t,n){const r=n.sub(t),o=r.len2();if(0===o)return e.dist(t);const i=e.sub(t),s=Math.max(0,Math.min(1,(i.x*r.x+i.y*r.y)/o));return e.dist(t.add(r.mul(s)))}function ka(e,t,n,r){return Sa(e,t,n,r)?0:Math.min(va(e,n,r),va(t,n,r),va(n,e,t),va(r,e,t))}function Sa(e,t,n,r){const o=t.sub(e),i=r.sub(n),s=wa(o,i);if(Math.abs(s)<1e-8)return null;const a=n.sub(e),l=wa(a,i)/s,c=wa(a,o)/s;return l<0||l>1||c<0||c>1?null:{point:e.add(o.mul(l)),t:l}}function Pa(e,t,n){const r=new h(e.x,e.y,e.props.w,e.props.h);return"ellipse"===e.props.kind?function(e,t,n){const r=e.center,o=e.w/2,i=e.h/2;if(o<=0||i<=0)return null;const s=t.sub(r),a=n.sub(t),l=a.x/o,c=a.y/i,d=s.x/o,u=s.y/i,p=l*l+c*c,h=2*(d*l+u*c),f=h*h-4*p*(d*d+u*u-1);if(0===p||f<0)return null;const m=Math.sqrt(f),g=[(-h-m)/(2*p),(-h+m)/(2*p)].filter(e=>e>1e-6&&e<=1).sort((e,t)=>e-t)[0];return void 0===g?null:t.add(a.mul(g))}(r,t,n):function(e,t,n){let r=null;for(let o=0;o<n.length;o+=1){const i=n[o],s=n[(o+1)%n.length]??n[0];if(!i||!s)continue;const a=Sa(e,t,i,s);!a||a.t<=1e-6||(!r||a.t<r.t)&&(r=a)}return r?.point??null}(t,n,Us(r,e.props.kind,{cornerRadiusPercent:e.props.cornerRadiusPercent}))}function Ma(e){return Us(new h(0,0,e.props.w,e.props.h),e.props.kind,{cornerRadiusPercent:e.props.cornerRadiusPercent})}var Ia=["corner","edge_midpoint","corner","edge_midpoint","center","edge_midpoint","corner","edge_midpoint","corner"];function Ea(e){const t=new h(0,0,e.props.w,e.props.h);return[new p(t.minX,t.minY),new p(t.center.x,t.minY),new p(t.maxX,t.minY),new p(t.minX,t.center.y),t.center,new p(t.maxX,t.center.y),new p(t.minX,t.maxY),new p(t.center.x,t.maxY),new p(t.maxX,t.maxY)].map((e,t)=>({point:e,kind:Ia[t]??"custom"}))}function Ta(e){return"arrow-left"===e.props.kind||"arrow-right"===e.props.kind}function Ca(e){return h.FromPoints(Us(new h(0,0,e.w,e.h),e.kind,{cornerRadiusPercent:e.cornerRadiusPercent}))}var Oa=class extends oe{type="geo";getDefaultProps(){return{w:160,h:108,kind:"rectangle",fill:k("fill-slate"),stroke:k("stroke-slate"),strokeStyle:"solid",strokeWidth:2,cornerRadiusPercent:12}}validateProps(e){const t=e&&"object"==typeof e?e:{},n=this.getDefaultProps();return{w:Math.max(24,ba(t.w,n.w)),h:Math.max(24,ba(t.h,n.h)),kind:Fi(t.kind)?t.kind:n.kind,fill:I(t.fill,n.fill),stroke:I(t.stroke,n.stroke),strokeStyle:Wi(t.strokeStyle)?t.strokeStyle:n.strokeStyle,strokeWidth:Math.max(1,ba(t.strokeWidth,n.strokeWidth)),cornerRadiusPercent:Vs(t.cornerRadiusPercent,n.cornerRadiusPercent)}}getLocalBounds(e){return new h(0,0,e.props.w,e.props.h)}canReceiveTerminalBinding(e){return!0}getPositionedOutlineVertices(e){return Us(this.getPositionedBounds(e),e.props.kind,{cornerRadiusPercent:e.props.cornerRadiusPercent})}getSelectionResizeLocalBounds(e){return Ta(e)?Ca(e.props):this.getLocalBounds(e)}resizeSelectionBounds(e,t){if(!Ta(e))return super.resizeSelectionBounds(e,t);const n=Ca(e.props).w*Math.abs(t.scaleX),r=Math.max(24,e.props.h*Math.abs(t.scaleY)),o=function({direction:e,height:t,selectionWidth:n}){const r=Ds+("left"===e?3.191:3.19),o=t/$s,i=n+r*o;return i>=js*o?i:n/(1-r/js)}({direction:"arrow-left"===e.props.kind?"left":"right",height:r,selectionWidth:n}),i=this.validateProps({...e.props,w:o,h:r}),s=Ca(i),a=V({localWidth:s.w,localHeight:s.h,scaleX:e.scaleX,scaleY:e.scaleY}),l=H(q({requestedBounds:t.selectionLocalBounds,handleId:t.handleId,actualWidth:a.width,actualHeight:a.height,scaleX:t.scaleX,scaleY:t.scaleY,isResizingFromCenter:t.isResizingFromCenter}).center,{rotation:t.selectionRotation,rotationCenter:t.selectionRotationCenter}),c=t.scaleX<0!=t.scaleY<0?2*t.selectionRotation-e.rotation:e.rotation,d=t.scaleX<0?-e.scaleX:e.scaleX,u=t.scaleY<0?-e.scaleY:e.scaleY,f=new h(0,0,i.w,i.h).center,m=s.center.sub(f),g=new p(m.x*d,m.y*u).rot(c);return{id:e.id,x:l.x-f.x-g.x,y:l.y-f.y-g.y,rotation:c,scaleX:d,scaleY:u,props:i}}getHandleSnapGeometry(e){return{points:Ea(e),outline:Ma(e)}}hitTest(e,t){const n=this.getPositionedBounds(e);if("ellipse"===e.props.kind){const e=n.w/2,r=n.h/2;if(e<=0||r<=0)return!1;const o=t.x-n.center.x,i=t.y-n.center.y;return o*o/(e*e)+i*i/(r*r)<=1}return function(e,t){if(t.length<3)return!1;let n=!1;for(let r=0,o=t.length-1;r<t.length;o=r,r+=1){const i=t[r],s=t[o];if(!i||!s)continue;if(ya(e,i,s)<=1e-6)return!0;if(i.y>e.y==s.y>e.y)continue;const a=(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x;e.x<a&&(n=!n)}return n}(t,Us(n,e.props.kind,{cornerRadiusPercent:e.props.cornerRadiusPercent}))}hitTestLineSegment(e,t){const n=this.getPositionedBounds(e);if("ellipse"===e.props.kind)return function(e,t,n,r){const o=e.center,i=e.w/2+r,s=e.h/2+r;if(i<=0||s<=0)return!1;const a=n.sub(t),l=t.sub(o),c=a.x/i,d=a.y/s,u=l.x/i,p=l.y/s,h=c*c+d*d,f=2*(u*c+p*d),m=u*u+p*p-1;if(m<=0)return!0;const g=f*f-4*h*m;if(0===h||g<0)return!1;const y=Math.sqrt(g),x=(-f-y)/(2*h),b=(-f+y)/(2*h);return x>=0&&x<=1||b>=0&&b<=1}(n,t.positionedStart,t.positionedEnd,t.positionedMargin);{const r=Us(n,e.props.kind,{cornerRadiusPercent:e.props.cornerRadiusPercent});return this.hitTest(e,t.positionedStart)||this.hitTest(e,t.positionedEnd)||function(e,t,n,r){if(n.length<3)return!1;for(let o=0;o<n.length;o+=1){const i=n[o],s=n[(o+1)%n.length];if(i&&s&&ka(e,t,i,s)<=r)return!0}return!1}(t.positionedStart,t.positionedEnd,r,t.positionedMargin)}}resolveBindingPoint(e,t){const n=t.editor.shapes.computePositionedToPageTransform(e),r=n.tryInvert();if(!r)return t.rawPagePoint;const o=Pa(e,r.applyToPoint(t.rawPagePoint),r.applyToPoint(t.oppositePagePoint));return o?n.applyToPoint(o):t.rawPagePoint}};function Aa(e,t){switch(e){case"dashed":return`${4*t} ${2*t}`;case"dotted":return"0 "+2*t;default:return}}var Ra=class{type="geo";toSvg(e,t){const{kind:n,fill:r,stroke:o,strokeStyle:i,strokeWidth:s,w:a,h:l}=e.props,c="none"===i?0:s,d=c/2,u=Math.max(a-c,0),p=Math.max(l-c,0),f={fill:t.resolveColor(r),stroke:"none"===i?"none":t.resolveColor(o),"stroke-width":c,"stroke-dasharray":Aa(i,s),"stroke-linejoin":"round","stroke-linecap":"round"};return function(e,t){switch(e.tag){case"ellipse":return{tag:"ellipse",attrs:{...t,cx:e.cx,cy:e.cy,rx:e.rx,ry:e.ry}};case"path":return{tag:"path",attrs:{...t,fill:e.fill??t.fill,d:e.d,transform:e.transform,"vector-effect":e.vectorEffect}};case"polygon":return{tag:"polygon",attrs:{...t,points:e.points.map(e=>`${La(e.x)},${La(e.y)}`).join(" ")}};case"rect":return{tag:"rect",attrs:{...t,x:e.x,y:e.y,width:e.width,height:e.height,rx:e.rx,ry:e.ry}}}}(na(new h(d,d,u,p),n,{cornerRadiusPercent:e.props.cornerRadiusPercent}),f)}};function Na(){return{id:"land.geo",shapeUtils:[new Oa],shapeSvgExporters:[new Ra],setup(e){e.runtime.provide(Hi,function(e){const t=e.signals.atom("geo.creation-hover",null,{isEqual:(e,t)=>e===t||null!==e&&null!==t&&e.timestamp===t.timestamp&&e.pagePoint.equals(t.pagePoint)});return{preview:e.signals.computed("geo.creation-preview",()=>{const n=t.get(),r=e.inputs.state.get(),o=e.state.tool.get();if(!n||e.state.readonly.get()||e.inputs.isSpacePressed.get()||r.isPointing||r.currentTimestamp!==n.timestamp||!r.currentPagePoint?.equals(n.pagePoint)||!Fi(o.activeToolId))return null;const i={...e.shapes.getDefaultProps("geo"),kind:o.activeToolId};return{bounds:Vi(n.pagePoint,i),props:i}}),setHover(e){t.set({pagePoint:e.pagePoint.clone(),timestamp:e.timestamp})},clearHover(){null!==t.get()&&t.set(null)}}}(e)),e.tools.register("rectangle",e=>new Xi(e)),e.tools.register("ellipse",e=>new Ji(e)),e.tools.register("message-circle",e=>new Gi(e)),e.tools.register("summary",e=>new Zi(e)),e.tools.register("summary-left",e=>new Qi(e)),e.tools.register("burst",e=>new es(e)),e.tools.register("rhombus",e=>new ts(e)),e.tools.register("triangle",e=>new ns(e)),e.tools.register("pentagon",e=>new rs(e)),e.tools.register("hexagon",e=>new is(e)),e.tools.register("star",e=>new ss(e)),e.tools.register("trapezoid",e=>new as(e)),e.tools.register("arrow-left",e=>new ls(e)),e.tools.register("arrow-right",e=>new cs(e))}}}function La(e){return Number.isFinite(e)?Number(e.toFixed(4)).toString():"0"}function $a(){return{id:"land.geo.react",canvasOverlays:[{id:"land.geo.creation-preview",component:za,order:10}],shapeRenderers:[{type:"geo",component:Da,hoverComponent:_a}]}}function Da({shape:e}){
54
+ return(0,Jt.jsx)(Ba,{props:e.props})}function ja({geometry:e,fill:t,stroke:n,strokeWidth:r,strokeDasharray:o,vectorEffect:i}){const s={fill:"path"===e.tag&&"none"===e.fill?"none":t,stroke:n,strokeWidth:r,strokeDasharray:o,strokeLinejoin:"round",strokeLinecap:"round",vectorEffect:"path"===e.tag&&e.vectorEffect?e.vectorEffect:i};switch(e.tag){case"ellipse": return(0,Jt.jsx)("ellipse",{...s,cx:e.cx,cy:e.cy,rx:e.rx,ry:e.ry});case"path": return(0,Jt.jsx)("path",{...s,d:e.d,transform:e.transform});case"polygon": return(0,Jt.jsx)("polygon",{...s,points:e.points.map(e=>`${e.x},${e.y}`).join(" ")});case"rect": return(0,Jt.jsx)("rect",{...s,x:e.x,y:e.y,width:e.width,height:e.height,rx:e.rx,ry:e.ry})}}function Ba({props:e,fill:t=e.fill,stroke:n=e.stroke,strokeStyle:r=e.strokeStyle,strokeWidth:o=e.strokeWidth,width:i="100%",height:s="100%"}){const a="none"===r?0:o,l=a/2,c=na(new h(l,l,Math.max(e.w-a,0),Math.max(e.h-a,0)),e.kind,{cornerRadiusPercent:e.cornerRadiusPercent});
55
+ return(0,Jt.jsx)("svg",{width:i,height:s,viewBox:`0 0 ${e.w} ${e.h}`,style:{display:"block",overflow:"visible"},shapeRendering:"geometricPrecision",children: (0,Jt.jsx)(ja,{geometry:c,fill:E(t),stroke:"none"===r?"none":E(n),strokeWidth:a,strokeDasharray:Aa(r,o)})})}var za=(0,Vt.memo)(function(){const e=sn(Ui(qt()).preview);return e? (0,Jt.jsx)("g",{"data-ui":"geo-creation-preview",transform:`translate(${e.bounds.x} ${e.bounds.y})`,opacity:.48,pointerEvents:"none",children: (0,Jt.jsx)(Ba,{props:e.props,width:e.bounds.w,height:e.bounds.h})}):null});function _a({shape:e,strokeWidth:t}){const{h:n,w:r}=e.props,o=na(new h(0,0,r,n),e.props.kind,{cornerRadiusPercent:e.props.cornerRadiusPercent});
56
+ return(0,Jt.jsx)("svg",{"data-ui":"geo-hover-outline",width:"100%",height:"100%",viewBox:`0 0 ${r} ${n}`,style:{display:"block",overflow:"visible",pointerEvents:"none"},shapeRendering:"geometricPrecision",children: (0,Jt.jsx)(ja,{geometry:o,fill:"none",stroke:pn,strokeWidth:t,strokeDasharray:void 0,vectorEffect:"non-scaling-stroke"})})}var Fa={id:"geo",editor:Na(),render:$a(),api:ds,setup:({editor:e})=>({api:us({editor:e})})};function Wa(e,t){return e.pagePoint.add(e.pageOutwardNormal.mul(20/Math.max(t,1e-4)))}function Ha(e,t,n){return t.dist(Wa(e,n))}function Ua(e,t,n={}){const r=e.state.cameraZoom.get(),o=12/Math.max(r,1e-4),i=o+("target"===n.mode?0:20/Math.max(r,1e-4)),s=e.shapes.getInBounds(new h(t.x-i,t.y-i,2*i,2*i),n.pageId?{pageId:n.pageId}:void 0);let a=null,l=null,c=o,d=Number.POSITIVE_INFINITY;for(const u of s){if(n.excludeShapeIds?.has(u.id)||Cr(u)||e.shapes.isHidden(u.id)||null===e.shapes.getClippedPageBounds(u.id))continue;const i=Z(e,u);if("target"===n.mode){if(0===i.length)continue;const r=io(e,u,t,o);if(!r)continue;const{borderDistance:s,port:p}=r,h=u.id===n.allowInteriorShapeId&&e.shapes.hitTestPoint(t,{hitTest:"bindingTarget",pageId:n.pageId??void 0,filter:e=>e.id===u.id}).length>0;if(s>o&&h){l={shape:u,port:p};continue}if(s>c||s>o)continue;const f=p.pagePoint.dist(t),m=`${u.index}:${u.id}:${p.id}`,g=`${a?.shape.index}:${a?.shape.id}:${a?.port.id}`;(s<c||s===c&&f<d||s===c&&f===d&&m<g)&&(a={shape:u,port:p},c=s,d=f);continue}for(const e of i){const n=Ha(e,t,r);(n<c||n===c&&`${u.index}:${u.id}:${e.id}`<`${a?.shape.index}:${a?.shape.id}:${a?.port.id}`)&&(a={shape:u,port:e},c=n)}}return a??l}function Va(e,t,n,r){const o=Ka(e,t,n);return!!o&&("connect"===o.kind?!!ki(e,{start:bi(t.shape.id,t.port),end:bi(o.target.shape.id,o.target.port),props:r,selectionAfter:[o.target.shape.id]}):function(e,t,n,r){const o=e.commands.createShapes([n.nodeInput],{source:"user",autoReparent:!1})[0];if(!o)return!1;const i=Ja(e,o,t.port);if(!i)return e.commands.deleteShapes([o.id],{source:"user"}),!1;if(!ki(e,{start:bi(t.shape.id,t.port),end:bi(o.id,i),props:r,selectionAfter:[o.id]}))return e.commands.deleteShapes([o.id],{source:"user"}),!1;return!0}(e,t,o,r))}function Ka(e,t,n){const r=Za(e,t),o=new Set(r.map(e=>e.id)),i=Ya(e,t);for(const c of i)if(!o.has(c.shape.id)&&!Ai(e,t.shape.id,t.port.id,c.shape.id,c.port.id))return{kind:"connect",target:c};const s=function(e,t,n,r){const o=t.shape.parentId,i=nl(e,t.shape),s=o.startsWith("shape:")?e.shapes.get(o):null,a=s?e.shapes.computeLocalToPageTransform(s):A.Identity(),l=t.port.pageOutwardNormal.normalize(),c=new p(i.w/2,i.h/2),d=a.applyToPoint(c),u=a.applyToPoint(c.add(new p(i.w/2,0))),h=a.applyToPoint(c.add(new p(0,i.h/2))),f=Math.abs(rl(u.sub(d),l))+Math.abs(rl(h.sub(d),l)),m=t.port.pagePoint.add(l.mul(96+f)),g=n.createNode({editor:e,sourceShape:t.shape,sourcePortId:t.port.id,pageCenter:m,parentId:o});return 0===r.length?g:Qa({branchTargets:r,editor:e,input:g,source:t})}(e,t,n,r),a=tl(e,s),l=Ja(e,a,t.port);return l?{kind:"create",nodeInput:s,previewShape:a,targetPort:l}:null}function qa(e,t,n){const r=Za(e,t);return 0===r.length?n:Qa({branchTargets:r,editor:e,input:n,source:t})}function Ya(e,t){const n=t.port.pageOutwardNormal.normalize(),r=t.port.pagePoint.add(n.mul(320)),o=h.FromPoints([t.port.pagePoint,r]).expand(160),i=e.layers.getPageId(t.shape.id);if(!i)return[];const s=new Map(e.state.currentPageShapeIds.get().map((e,t)=>[e,t])),a=e.shapes.getInBounds(o,{pageId:i}).filter(n=>n.id!==t.shape.id&&!Cr(n)&&!e.shapes.isHidden(n.id)&&null!==e.shapes.getClippedPageBounds(n.id)&&e.shapes.getUtil(n).canReceiveTerminalBinding(n,{editor:e})).flatMap(r=>{const o=e.shapes.getPageCenter(r.id);if(!o)return[];const i=o.sub(t.port.pagePoint),a=rl(i,n),l=Math.abs((d=n,(c=i).x*d.y-c.y*d.x));var c,d;const u=i.len();if(a<=0||a>320||l>160)return[];const p=Xa(e,r,t.port.pagePoint);return p?[{shape:r,port:p,distance:u,forward:a,cross:l,order:s.get(r.id)??1/0}]:[]});return a.sort((e,t)=>e.distance-t.distance||e.cross-t.cross||e.forward-t.forward||e.order-t.order||e.shape.id.localeCompare(t.shape.id)||e.port.id.localeCompare(t.port.id)),a.map(({shape:e,port:t})=>({shape:e,port:t}))}function Xa(e,t,n){return[...Z(e,t)].sort((e,t)=>{const r=n.sub(e.pagePoint).normalize(),o=n.sub(t.pagePoint).normalize(),i=rl(e.pageOutwardNormal,r);return rl(t.pageOutwardNormal,o)-i||e.pagePoint.dist(n)-t.pagePoint.dist(n)||e.id.localeCompare(t.id)})[0]??null}function Ja(e,t,n){const r=n.pageOutwardNormal.normalize();return[...Z(e,t)].sort((e,t)=>rl(e.pageOutwardNormal.normalize(),r)-rl(t.pageOutwardNormal.normalize(),r)||e.pagePoint.dist(n.pagePoint)-t.pagePoint.dist(n.pagePoint)||e.id.localeCompare(t.id))[0]??null}function Ga(){return{createNode({editor:e,sourceShape:t,pageCenter:n,parentId:r}){const o=nl(e,t),i=r.startsWith("shape:")?e.shapes.get(r):null,s=(i?e.shapes.computeLocalToPageTransform(i):A.Identity()).tryInvert()?.applyToPoint(n)??n;return{type:"geo",parentId:r,x:s.x-o.w/2,y:s.y-o.h/2,rotation:0,props:{...o}}}}}function Za(e,t){const n=[],r=new Set;for(const o of e.state.currentPageShapeIds.get()){const i=e.shapes.get(o);if(!Cr(i))continue;const s=Ar(e,i.id),a=s.start?.toId===t.shape.id&&s.start.props.portId===t.port.id?s.end:s.end?.toId===t.shape.id&&s.end.props.portId===t.port.id?s.start:null;if(!a)continue;const l=e.shapes.get(a.toId);!l||r.has(l.id)||Cr(l)||e.shapes.isHidden(l.id)||null===e.shapes.getClippedPageBounds(l.id)||(r.add(l.id),n.push(l))}return n}function Qa({branchTargets:e,editor:t,input:n,source:r}){const o=tl(t,n),i=t.shapes.computePageCenter(o),s=new p(-r.port.pageOutwardNormal.y,r.port.pageOutwardNormal.x).normalize();if(0===s.len2())return n;const a=rl(r.port.pagePoint,s),l=el(t,o,s,a),c=(l.max-l.min)/2,d=function(e,t){const n=e.map(({min:e,max:n})=>({min:e-48-t,max:n+48+t})).sort((e,t)=>e.min-t.min||e.max-t.max),r=[];for(const s of n){const e=r[r.length-1];!e||s.min>e.max+1e-6?r.push({...s}):e.max=Math.max(e.max,s.max)}const o=r.find(({min:e,max:t})=>e<-1e-6&&t>1e-6);if(!o)return 0;const i=e.reduce((e,t)=>e+(t.min+t.max)/2,0);return[o.min,o.max].sort((e,t)=>Math.abs(i+e)-Math.abs(i+t)||Math.abs(e)-Math.abs(t)||t-e)[0]}(e.map(e=>el(t,e,s,a)),c)-(rl(i,s)-a);if(Math.abs(d)<=1e-6)return n;const u=n.parentId??r.shape.parentId,h=u.startsWith("shape:")?t.shapes.get(u):null,f=(h?t.shapes.computeLocalToPageTransform(h):A.Identity()).tryInvert();if(!f)return n;const m=i.add(s.mul(d)),g=f.applyToPoint(i),y=f.applyToPoint(m).sub(g);return{...n,x:n.x+y.x,y:n.y+y.y}}function el(e,t,n,r){const o=e.shapes.computePageCorners(t).map(e=>rl(e,n)-r);return{min:Math.min(...o),max:Math.max(...o)}}function tl(e,t){const n={id:"shape:connector-quick-create-preview",typeName:"shape",scope:"document",type:t.type,parentId:t.parentId??e.pages.getCurrentId(),index:t.index??"preview",x:t.x,y:t.y,rotation:t.rotation??0,scaleX:t.scaleX??1,scaleY:t.scaleY??1,opacity:t.opacity??1,isHidden:t.isHidden??!1,isLocked:t.isLocked??!1,props:{...e.shapes.getDefaultProps(t.type),...t.props},meta:t.meta??{}};return{...n,props:e.shapes.getUtil(n).validateProps(n.props)}}function nl(e,t){return _i(t)?{w:t.props.w,h:t.props.h,kind:t.props.kind,fill:t.props.fill,stroke:t.props.stroke,strokeStyle:t.props.strokeStyle,strokeWidth:t.props.strokeWidth,cornerRadiusPercent:t.props.cornerRadiusPercent}:e.shapes.getDefaultProps("geo")}function rl(e,t){return e.x*t.x+e.y*t.y}function ol(e){const t={visibleShapes:[],sourceShapeIds:new Set,targetShapeId:null,highlightedPortId:null};if(e.state.readonly.get()||e.state.shapeEditingSession.get()||e.inputs.isSpacePressed.get())return t;const n=xi(e).previewSignal.get();if(n){const t=new Map;for(const o of[n.start,n.end]){if(!o.shapeId)continue;const n=e.shapes.get(o.shapeId);n&&sl(e,n,"target")&&t.set(n.id,n)}const r=n[n.movingTerminal];return{visibleShapes:[...t.values()],sourceShapeIds:new Set,targetShapeId:r.shapeId,highlightedPortId:r.portId}}const r=e.state.tool.get().activeToolId;let o=null;if("select"===r){const t=e.state.selectedShapes.get();o=1===t.length?t[0]??null:null}else if("connector"===r){const t=e.render.interaction.hoveredShapeId.get();o=t?e.shapes.get(t)??null:null}return o&&sl(e,o,"source")?{visibleShapes:[o],sourceShapeIds:new Set([o.id]),targetShapeId:null,highlightedPortId:null}:t}function il(e,t){const n=ol(e),r=xi(e),o=Math.max(e.state.cameraZoom.get(),1e-4),i=12/o;let s=null;for(const a of n.visibleShapes)if(n.sourceShapeIds.has(a.id))for(const n of Z(e,a)){if(!r.isPortVisible(n.id))continue;const e=Ha(n,t,o);e<=i+1e-6&&(!s||e<s.distance||e===s.distance&&`${a.index}:${a.id}:${n.id}`<`${s.shape.index}:${s.shape.id}:${s.port.id}`)&&(s={shape:a,port:n,distance:e})}return s?{shape:s.shape,port:s.port}:null}function sl(e,t,n){const r=Z(e,t);return!Cr(t)&&!e.shapes.isHidden(t.id)&&null!==e.shapes.getClippedPageBounds(t.id)&&("target"===n||!e.layers.isOrAncestorLocked(t.id))&&e.shapes.getUtil(t).canReceiveTerminalBinding(t,{editor:e})&&("target"===n?r.length>0:r.some(t=>xi(e).isPortVisible(t.id)))}function al(){return{id:"land.connector.react",shapeRenderers:[{type:"connector",component:ul,hoverComponent:pl}],selectionCustomHandleRenderers:[{type:ci,component:ll},{type:di,component:cl},{type:ui,component:dl}],canvasOverlays:[{id:"land.connector.ports-overlay",order:100,component:fl}]}}function ll({handle:e,strokeWidth:t}){
57
+ return(0,Jt.jsx)("circle",{"data-selection-custom-handle":e.id,"data-selection-custom-handle-type":e.type,"data-selection-custom-handle-id":e.id,cx:e.point.x,cy:e.point.y,r:Math.max(e.bounds.w,e.bounds.h)/2,fill:"rgba(255,255,255,0.98)",stroke:"var(--land-selection, #2563eb)",strokeWidth:t,style:{cursor:e.cursor??"move",pointerEvents:"auto"}})}function cl({handle:e}){const t=.75*Math.max(e.bounds.w,e.bounds.h),n=.36*Math.max(e.bounds.w,e.bounds.h);
58
+ return(0,Jt.jsxs)("g",{children:[ (0,Jt.jsx)("circle",{"data-selection-custom-handle":e.id,"data-selection-custom-handle-type":e.type,"data-selection-custom-handle-id":e.id,cx:e.point.x,cy:e.point.y,r:t,fill:"transparent",style:{cursor:e.cursor??"move",pointerEvents:"all"}}), (0,Jt.jsx)("circle",{cx:e.point.x,cy:e.point.y,r:n,fill:"rgba(96, 165, 250, 0.72)",pointerEvents:"none"})]})}function dl({handle:e,strokeWidth:t}){const n=gi(e.id);if(!n)return null;const r=Math.max(e.bounds.w,e.bounds.h),o="horizontal"===n.axis,i=1.35*r+2*t,s=.4*r,a=o?i:s,l=o?s:i,c=1.8*r;
59
+ return(0,Jt.jsxs)("g",{children:[ (0,Jt.jsx)("rect",{"data-selection-custom-handle":e.id,"data-selection-custom-handle-type":e.type,"data-selection-custom-handle-id":e.id,x:e.point.x-c/2,y:e.point.y-c/2,width:c,height:c,fill:"transparent",style:{cursor:e.cursor??"grab",pointerEvents:"all"}}), (0,Jt.jsx)("rect",{x:e.point.x-a/2,y:e.point.y-l/2,width:a,height:l,rx:Math.min(a,l)/2,ry:Math.min(a,l)/2,fill:"rgba(255,255,255,0.98)",stroke:"var(--land-selection, #2563eb)",strokeWidth:t,pointerEvents:"none"})]})}function ul({shape:e,editor:t}){
60
+ return(0,Jt.jsx)(hl,{shape:e,editor:t,idPrefix:"connector",stroke:E(e.props.stroke),strokeWidth:e.props.strokeWidth})}function pl({shape:e,editor:t,strokeWidth:n}){
61
+ return(0,Jt.jsx)(hl,{dataUi:"connector-hover-outline",shape:e,editor:t,idPrefix:"connector-hover",stroke:pn,strokeWidth:n,vectorEffect:"non-scaling-stroke"})}function hl({dataUi:e,editor:t,idPrefix:n,shape:r,stroke:o,strokeWidth:i,vectorEffect:s}){const a=`${n}-content-clip-${r.id.replace(/[^a-zA-Z0-9_-]/g,"-")}`,l=Ro(t,r),c=ri(l.markerSegments),d=t.shapes.computeRenderBounds(r),u=sn(t.shapes.getContentCutoutLocalPolygonsSignal(r.id)),p=Y({outputBounds:l.pageBounds,cutoutLocalPolygons:u});
62
+ return(0,Jt.jsxs)("svg",{"data-ui":e,width:"100%",height:"100%",viewBox:`${d.x} ${d.y} ${d.w} ${d.h}`,overflow:"visible",children:[p? (0,Jt.jsx)("defs",{children: (0,Jt.jsx)("clipPath",{id:a,clipPathUnits:"userSpaceOnUse",children: (0,Jt.jsx)("path",{d:p,clipRule:"evenodd",fillRule:"evenodd"})})}):null, (0,Jt.jsxs)("g",{clipPath:p?`url(#${a})`:void 0,children:[ (0,Jt.jsx)("path",{"data-connector-path":"body",d:l.path,fill:"none",stroke:o,strokeWidth:i,strokeDasharray:"dashed"===r.props.strokeStyle?"8 6":void 0,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:s}),c? (0,Jt.jsx)("path",{"data-connector-path":"markers",d:c,fill:"none",stroke:o,strokeWidth:i,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:s}):null]})]})}var fl=(0,Vt.memo)(function(){const e=qt(),t=sn(e.state.readonly),n=sn(e.state.tool).activeToolId;sn(e.state.selectedShapes),sn(e.render.interaction.hoveredShapeId);const r=sn(e.state.shapeEditingSession),o=sn(e.inputs.isSpacePressed),i=sn(e.render.interaction.selectionTranslationActive),s=sn(e.state.cameraZoom),a=xi(e),l=sn(a.previewSignal);if(t||r||o||i)return null;const c=ol(e),d=new Map(c.visibleShapes.map(e=>[e.id,e])),u=c.targetShapeId?e.shapes.get(c.targetShapeId)??null:null,p=l?u:"connector"===n?c.visibleShapes[0]:null,f=p&&!Cr(p)?p:null;if(0===d.size&&!l)return null;const m=Math.max(s,1e-4),g=c.targetShapeId&&c.highlightedPortId?`${c.targetShapeId}:${c.highlightedPortId}`:null,y=l?{point:l.start.pagePoint,outwardNormal:l.start.pageOutwardNormal,obstacleId:l.start.shapeId??void 0,obstacleBounds:l.start.obstacleBounds}:null,x=l?{point:l.end.pagePoint,outwardNormal:l.end.pageOutwardNormal,obstacleId:l.end.shapeId??void 0,obstacleBounds:l.end.obstacleBounds}:null,b=l?No({start:y,end:x,routing:l.geometry.routing,cornerRadius:l.geometry.cornerRadius,headStart:l.geometry.headStart,headEnd:l.geometry.headEnd,strokeWidth:l.geometry.strokeWidth,curveWaypoints:l.geometry.curveWaypoints,orthogonalBends:l.geometry.orthogonalBends,terminalOffsetMapper:To(l.geometry.localToPageTransform)}):null,w=l&&b?function(e,t){const n=e.geometry.localToPageTransform,r=n.tryInvert();if(!r)return{info:t,localToPageTransform:A.Identity()};const o=Qo(t,r);if("rebind"===e.kind)return{info:o,localToPageTransform:n};const i=h.FromPoints([o.startPagePoint,...o.points,o.endPagePoint]);return{info:Qo(o,A.Translate(-i.x,-i.y)),localToPageTransform:n.compose(A.Translate(i.x,i.y))}}(l,b):null,v=l?l.start.pagePoint:null,k=l?l.end.pagePoint:null,S=l?E(l.geometry.stroke):"var(--land-selection, #2563eb)",P=l?.geometry.strokeWidth??2,M=l?.geometry.strokeStyle??"solid",I=f?kl(e,f):null,T=l?l[l.movingTerminal]:null;
63
+ return(0,Jt.jsxs)("g",{"data-ui":"connector-ports-overlay",children:[
64
+
65
+ (0,Jt.jsx)("style",{children:"\n [data-connector-port-idle],\n [data-connector-port-hover-preview] {\n transition: opacity 100ms ease;\n }\n [data-connector-port-hover-preview] {\n opacity: 0;\n }\n [data-connector-port]:hover [data-connector-port-idle] {\n opacity: 0;\n }\n [data-connector-port]:hover [data-connector-port-hover-preview] {\n opacity: 1;\n }\n "}),I? (0,Jt.jsx)("path",{"data-ui":"connector-target-border-highlight",d:I,fill:"none",stroke:pn,strokeWidth:2/m,strokeLinecap:"round",strokeLinejoin:"round",pointerEvents:"none"}):null,w? (0,Jt.jsx)("g",{"data-ui":"connector-creation-preview",pointerEvents:"none",opacity:.78,children: (0,Jt.jsxs)("g",{"data-ui":"connector-creation-preview-geometry",transform:w.localToPageTransform.toSvgString(),children:[ (0,Jt.jsx)("path",{"data-ui":"connector-creation-preview-path",d:w.info.path,fill:"none",stroke:S,strokeWidth:P,strokeDasharray:"dashed"===M?"8 6":void 0,strokeLinecap:"round",strokeLinejoin:"round"}),w.info.markerSegments.length>0? (0,Jt.jsx)("path",{"data-ui":"connector-creation-preview-markers",d:w.info.markerSegments.map(e=>`M ${e.start.x} ${e.start.y} L ${e.end.x} ${e.end.y}`).join(" "),fill:"none",stroke:S,strokeWidth:P,strokeLinecap:"round",strokeLinejoin:"round"}):null]})}):null,[...d.values()].flatMap(t=>Z(e,t).map(n=>a.isPortVisible(n.id)? (0,Jt.jsx)(xl,{editor:e,shape:t,port:n,zoom:m,highlighted:g===`${t.id}:${n.id}`,targetMode:f?.id===t.id,quickCreateNodeFactory:a.quickCreateNodeFactory},`${t.id}:${n.id}`):null)),T?.shapeId? (0,Jt.jsx)(gl,{point:T.pagePoint,zoom:m}):!l&&"connector"===n&&f? (0,Jt.jsx)(ml,{shape:f,zoom:m}):null,v&&k? (0,Jt.jsx)(yl,{start:v,end:k,zoom:m}):null]})});function ml({shape:e,zoom:t}){const n=qt(),r=sn(n.inputs.state);if(!r.currentPagePoint||r.accelKey)return null;const o=12/t,i=io(n,e,r.currentPagePoint,o);return!i||i.borderDistance>o?null: (0,Jt.jsx)(gl,{point:i.port.pagePoint,zoom:t})}function gl({point:e,zoom:t}){
66
+ return(0,Jt.jsx)("circle",{"data-ui":"connector-border-snap-preview",cx:e.x,cy:e.y,r:5/t,fill:"var(--land-selection, #2563eb)",stroke:"#ffffff",strokeWidth:1.5/t,pointerEvents:"none"})}function yl({start:e,end:t,zoom:n}){const r=4/n,o=1/n;
67
+ return(0,Jt.jsx)("g",{"data-ui":"connector-creation-terminal-handles",pointerEvents:"none",children:[{terminal:"start",point:e},{terminal:"end",point:t}].map(({terminal:e,point:t})=> (0,Jt.jsx)("circle",{"data-connector-creation-terminal":e,cx:t.x,cy:t.y,r:r,fill:"rgba(255,255,255,0.98)",stroke:"rgba(37, 99, 235, 0.92)",strokeWidth:o},e))})}function xl({editor:e,shape:t,port:n,zoom:r,highlighted:o,targetMode:i,quickCreateNodeFactory:s}){const[a,l]=(0,Vt.useState)(!1),c=i?n.pagePoint:Wa(n,r),d=4/r,u=12/r,p=15/r,h=12/r,f=180*Math.atan2(n.pageOutwardNormal.y,n.pageOutwardNormal.x)/Math.PI;
68
+ return(0,Jt.jsxs)("g",{"data-ui":"connector-port","data-connector-port":"true","data-connector-port-shape-id":t.id,"data-connector-port-id":n.id,"data-connector-port-target":i?"true":void 0,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[a&&!i? (0,Jt.jsx)(bl,{editor:e,source:{shape:t,port:n},quickCreateNodeFactory:s,zoom:r}):null,
69
+
70
+ (0,Jt.jsx)("circle",{"data-connector-port-hit-area":"true",cx:c.x,cy:c.y,r:h,fill:"transparent",pointerEvents:"all",cursor:"crosshair"}),
71
+
72
+ (0,Jt.jsx)("circle",{"data-connector-port-idle":"true",cx:c.x,cy:c.y,r:o?1.2*d:d,fill:o?"var(--land-selection, #2563eb)":"rgba(37, 99, 235, 0.28)",pointerEvents:"none"}),i?null: (0,Jt.jsxs)("g",{"data-connector-port-hover-preview":"true",pointerEvents:"none",children:[ (0,Jt.jsx)("circle",{cx:c.x,cy:c.y,r:u,fill:"var(--land-selection, #2563eb)"}), (0,Jt.jsx)(lr,{"data-connector-port-hover-arrow":"true",x:c.x-p/2,y:c.y-p/2,width:p,height:p,color:"#ffffff",strokeWidth:2.4,transform:`rotate(${f} ${c.x} ${c.y})`})]})]})}function bl({editor:e,source:t,quickCreateNodeFactory:n,zoom:r}){const o=Ka(e,t,n);if(!o)return null;const i=e.shapes.getDefaultProps("connector"),s=function(e){return"connect"===e.kind?e.target:{shape:e.previewShape,port:e.targetPort}}(o),a="create"===o.kind?t.shape.parentId:Ni(e,t.shape,s.shape);if(!a)return null;const l=a.startsWith("shape:")?e.shapes.get(a):null,c=l?e.shapes.computeLocalToPageTransform(l):A.Identity(),d=No({start:{point:t.port.pagePoint,outwardNormal:t.port.pageOutwardNormal,obstacleId:t.shape.id,obstacleBounds:e.shapes.getPageBounds(t.shape.id)??void 0},end:{point:s.port.pagePoint,outwardNormal:s.port.pageOutwardNormal,obstacleId:s.shape.id,obstacleBounds:"create"===o.kind?e.shapes.computePageBounds(s.shape):e.shapes.getPageBounds(s.shape.id)??void 0},routing:i.routing,cornerRadius:i.cornerRadius,headStart:i.headStart,headEnd:i.headEnd,strokeWidth:i.strokeWidth,terminalOffsetMapper:To(c),curveWaypoints:[],orthogonalBends:[]}),u=E(i.stroke);
73
+ return(0,Jt.jsxs)("g",{"data-ui":"connector-port-quick-connect-preview","data-connector-port-quick-connect-kind":o.kind,pointerEvents:"none",children:[ (0,Jt.jsxs)("g",{opacity:.58,children:[ (0,Jt.jsx)("path",{"data-ui":"connector-port-quick-connect-path",d:d.path,fill:"none",stroke:u,strokeWidth:i.strokeWidth,strokeDasharray:"dashed"===i.strokeStyle?"8 6":void 0,strokeLinecap:"round",strokeLinejoin:"round"}),d.markerSegments.length>0? (0,Jt.jsx)("path",{"data-ui":"connector-port-quick-connect-markers",d:d.markerSegments.map(e=>`M ${e.start.x} ${e.start.y} L ${e.end.x} ${e.end.y}`).join(" "),fill:"none",stroke:u,strokeWidth:i.strokeWidth,strokeLinecap:"round",strokeLinejoin:"round"}):null]}),"create"===o.kind? (0,Jt.jsx)(wl,{editor:e,shape:o.previewShape,zoom:r}):null]})}function wl({editor:e,shape:t,zoom:n}){const r=rn().getShapeRenderer(t.type)?.component,o=e.shapes.computeRenderBounds(t),i=e.shapes.computeLocalToPageTransform(t).compose(A.Translate(o.x,o.y)),s=kl(e,t);
74
+ return(0,Jt.jsxs)("g",{"data-ui":"connector-port-quick-create-shape",children:[r? (0,Jt.jsx)("foreignObject",{"data-ui":"connector-port-quick-create-shape-content",width:o.w,height:o.h,overflow:"visible",opacity:.52,transform:i.toSvgString(),children: (0,Jt.jsx)("div",{style:{height:"100%",overflow:"visible",pointerEvents:"none",width:"100%"},children: (0,Jt.jsx)(vl,{Renderer:r,editor:e,shape:t})})}):s? (0,Jt.jsx)("path",{"data-ui":"connector-port-quick-create-shape-fallback",d:s,fill:"rgba(37, 99, 235, 0.1)",stroke:"none"}):null,s? (0,Jt.jsx)("path",{"data-ui":"connector-port-quick-create-shape-outline",d:s,fill:"none",stroke:"var(--land-selection, #2563eb)",strokeWidth:1.5/n,strokeDasharray:`${5/n} ${4/n}`,strokeLinecap:"round",strokeLinejoin:"round"}):null]})}function vl({Renderer:e,editor:t,shape:n}){
75
+ return(0,Jt.jsx)(e,{editor:t,isSelected:!1,shape:n,shapeEditingSession:null})}function kl(e,t){const n=[];for(const r of oo(e,t)){const[e,...t]=r.points;if(e){n.push(`M ${e.x} ${e.y}`);for(const e of t)n.push(`L ${e.x} ${e.y}`);r.closed&&r.points.length>2&&n.push("Z")}}return n.length>0?n.join(" "):null}var Sl=class extends u{type="connector";getDefaultProps(){return{terminal:"start",portId:"top"}}validateProps(e){const t=e&&"object"==typeof e?e:{},n=t.normalizedAnchor&&"object"==typeof t.normalizedAnchor?t.normalizedAnchor:null;return{terminal:"end"===t.terminal?"end":"start",portId:"string"==typeof t.portId&&t.portId.length>0?t.portId:"top",...n?{normalizedAnchor:{x:Pl(n.x),y:Pl(n.y)}}:{}}}canBind(e,t,n){return Cr(n.fromShape)&&!Cr(n.toShape)&&e.layers.getPageId(n.fromShape.id)===e.layers.getPageId(n.toShape.id)&&null!==so(e,n.toShape,t.props)}getExclusiveBindingKey(e){return`${e.fromId}:${e.props.terminal}`}onBindingCreate(e,t){return this.getSyncEffect(e,t.fromId)}onBindingUpdate(e,t,n){return this.getSyncEffect(e,n.fromId)}onBindingLoad(e,t){return this.getSyncEffect(e,t.fromId)}onAfterShapeChange(e,t,n){if("from"!==n.role||"start"===t.props.terminal)return this.getSyncEffect(e,t.fromId)}onBeforeDeleteShape(e,t,n){return"from"===n.role?{deleteBindingIds:Rr(e,t.fromId).map(e=>e.id)}:e.shapes.get(t.fromId)?{deleteShapeIds:[t.fromId]}:{}}onBeforeDeleteBinding(e,t){return this.getDetachEffect(e,t)}getExportShapeIds(e,t){return[t.fromId]}getGeometryDependentShapeIds(e,t,n){return"to"===n.role?[t.fromId]:[]}getSyncEffect(e,t){const n=e.shapes.get(t);if(!Cr(n))return;const r=Si(e,n);var o,i;return r&&(i=r,(o=n).parentId!==i.parentId||o.x!==i.x||o.y!==i.y||o.rotation!==i.rotation||o.scaleX!==i.scaleX||o.scaleY!==i.scaleY||JSON.stringify(o.props)!==JSON.stringify(i.props))?{shapes:[r],suppressBindingIds:Rr(e,t).map(e=>e.id)}:void 0}getDetachEffect(e,t){const n=e.shapes.get(t.fromId);if(!Cr(n))return{deleteBindingIds:[t.id]};const r=Co(e,n),o="start"===t.props.terminal?r.startPagePoint:r.endPagePoint,i=Pi(e,n,t.props.terminal,o);return{shapes:i?[i]:void 0,deleteBindingIds:[t.id],suppressBindingIds:Rr(e,t.fromId).map(e=>e.id)}}};function Pl(e){return"number"==typeof e&&Number.isFinite(e)?Math.max(0,Math.min(1,e)):.5}var Ml="connector.rebind",Il={propagation:"stop"},El={propagation:"stop",clickSequence:"break"},Tl=class{editor;origin;quickCreateNodeFactory;pointerId;originScreenPoint;preview;initialSelectedShapeIds;props;didClearSelection=!1;operation;constructor(e,t,n,r,o){this.editor=e,this.origin=t,this.quickCreateNodeFactory=o,this.pointerId=r,this.originScreenPoint=n.clone(),this.initialSelectedShapeIds=e.selection.getIds(),this.props=e.shapes.getDefaultProps("connector");const i=wi(e,t.start);if(!i)throw new Error("Connector creation requires a resolvable start endpoint");const s=wi(e,{kind:"free",pagePoint:i.pagePoint.clone()});this.preview={kind:"create",origin:t.kind,start:Al(i,s,"start"),end:Al(s,i,"end"),invalidReason:null,isDragging:!1,movingTerminal:"end",geometry:jl(this.props,Nl(e,i,s))},this.operation=e.operations.begin({kind:"connector.create",label:"shape.create",source:"user",history:"record"}),xi(e).setPreview(this.preview)}update(e,t,n){const r=this.originScreenPoint.dist(e)>10;r&&!this.didClearSelection&&(this.initialSelectedShapeIds.length>0&&this.editor.commands.setSelectedShapeIds([],{source:"user"}),this.didClearSelection=!0);const o=r&&!n?Ua(this.editor,t,{allowInteriorShapeId:"bound"===this.origin.start.kind?this.origin.start.shapeId:void 0,mode:"target",pageId:this.editor.pages.getCurrentId()}):null,i=wi(this.editor,this.origin.start);if(!i)return void this.cancel("command");const s=Rl(this.editor,i,t,this.props.routing,n),a=o?bi(o.shape.id,o.port):{kind:"free",pagePoint:s},l=wi(this.editor,a);if(!l)return void this.cancel("command");const c=vi(this.editor,this.origin.start,a);Object.assign(this.preview,{start:Al(i,l,"start"),end:Al(l,i,"end"),invalidReason:c,isDragging:r,geometry:{...this.preview.geometry,localToPageTransform:Nl(this.editor,i,l)}}),xi(this.editor).setPreview({...this.preview})}complete(e,t,n){if(this.update(e,t,n),xi(this.editor).pointerSession!==this)return!1;let r=!1;if(this.preview.isDragging)this.preview.invalidReason||(r=!!ki(this.editor,{start:this.preview.start.draft,end:this.preview.end.draft,props:this.props,selectionAfter:"connector"}));else{if("canvas"===this.origin.kind)return!1;const e=wi(this.editor,this.origin.start);r=!!(e?.shape&&e.port&&Va(this.editor,{shape:e.shape,port:e.port},this.quickCreateNodeFactory,this.props))}return this.clear(),r?(this.operation.commit(),"canvas"!==this.origin.kind||this.editor.state.tool.get().isToolLocked||this.editor.commands.setActiveTool("select",{source:"system"})):(this.operation.cancel(),this.restoreInitialSelection()),r}cancel(e){this.clear(),this.operation.isActive&&this.operation.cancel(),this.restoreInitialSelection()}clear(){const e=xi(this.editor);e.setPreview(null),e.setPointerSession(null),this.editor.interaction.setHoveredShapeId(null)}restoreInitialSelection(){this.didClearSelection&&this.editor.commands.setSelectedShapeIds(this.initialSelectedShapeIds,{source:"system"})}};function Cl(e){return{id:"land.connector.interactions",editorEvent:{handleEvent(t,n){const r=xi(t),o=r.pointerSession;if("cancel"===n.type)return o?.cancel(n.reason),t.interaction.setHoveredShapeId(null),o?Il:void 0;if(t.state.readonly.get())return;if(o){if("tick"===n.type){const e=t.inputs.state.get();if(o.preview.isDragging&&e.pointerId===o.pointerId&&e.currentScreenPoint){const r=ae(e.currentScreenPoint,t.state.viewportScreenSize.get(),n.elapsed);0===r.x&&0===r.y||(t.viewport.pan(r),o.update(e.currentScreenPoint,t.viewport.screenToPage(e.currentScreenPoint),e.accelKey))}return Il}if("pointer"!==n.type)return Il;if(n.pointerId!==o.pointerId)return Il;if("pointer_move"===n.name)o.update(n.screenPoint,n.pagePoint,n.accelKey);else{if("pointer_up"===n.name)return o.complete(n.screenPoint,n.pagePoint,n.accelKey)?El:Il;"pointer_cancel"===n.name&&o.cancel("pointer_cancel")}return Il}if("pointer"!==n.type)return;if("pointer_move"===n.name&&"connector"===t.state.tool.get().activeToolId)return void t.interaction.setHoveredShapeId(function(e,t){if(e.state.readonly.get())return null;const n=e.shapes.hitTest(t),r=n?e.shapes.getUtil(n).getHoverTargetId(n,{editor:e}):null,o=r?e.shapes.get(r)??null:null;return o&&sl(e,o,"source")?o:null}(t,n.pagePoint)?.id??null);if("pointer_down"!==n.name||0!==n.button||t.inputs.isSpacePressed.get()||t.state.shapeEditingSession.get())return;const i=t.state.tool.get().activeToolId;let s=null;if("select"===i){const e=il(t,n.pagePoint);e&&(s={kind:"port",start:bi(e.shape.id,e.port)})}else"connector"===i&&(s={kind:"canvas",start:Ol(t,n)});if(!s)return;const a=new Tl(t,s,n.screenPoint,n.pointerId,e);return r.setPointerSession(a),Il}},selectionHandle:{createSession:(e,{handle:t,shape:n})=>e.state.readonly.get()?null:Cr(n)?"binding_terminal"===t.kind?function(e,t,n){if(!Cr(e.shapes.get(t)))return null;const r=n.terminal,o="start"===r?"end":"start";let i=null;return{shapeId:t,operationKind:Ml,shouldClearBindingPreviewOnExit:!0,onDragStart(){xi(e).setSelectionHandlesHidden(!0)},update({pagePoint:n,accelKey:s,source:a}){const l=Ar(e,t)[o],c=s?null:Ua(e,n,{allowInteriorShapeId:l?.toId,mode:"target",pageId:l?e.layers.getPageId(l.toId):e.pages.getCurrentId()});if(c&&l&&Ri(c.shape.id,c.port.id,l.toId,l.props.portId))return{status:"continue",finalPagePoint:c?.port.pagePoint};const d=c,u=!!d&&(l&&"start"===r?Ai(e,d.shape.id,d.port.id,l.toId,l.props.portId,t):!!l&&Ai(e,l.toId,l.props.portId,d.shape.id,d.port.id,t));i=d&&!u?d:null;let h=Ar(e,t)[r];!i&&h&&(e.commands.deleteBinding(h.id,{source:a}),h=null);const f=e.shapes.get(t);if(!Cr(f))return{status:"stop"};const m=l?e.shapes.get(l.toId):null,g=m&&l?so(e,m,l.props):null,y=m&&g?wi(e,bi(m.id,g)):null,x=i?.port.pagePoint??(!c&&y?Rl(e,y,n,f.props.routing,s):n),b=Pi(e,f,r,x);b&&function(e,t,n){const r=new Set(Rr(e,t.id).map(e=>e.id));e.commands.updateShapes([{id:t.id,parentId:t.parentId,x:t.x,y:t.y,rotation:t.rotation,scaleX:t.scaleX,scaleY:t.scaleY,props:t.props}],{source:n,suppressBindingIds:r})}(e,b,a),i&&(h=Ar(e,t)[r],h?h.toId===i.shape.id&&h.props.portId===i.port.id||e.commands.updateBinding({id:h.id,toId:i.shape.id,props:lo(r,i.port)},{source:a}):e.commands.createBinding({type:"connector",fromId:t,toId:i.shape.id,props:lo(r,i.port)},{source:a}));const w=Ar(e,t)[o],v=w?e.shapes.get(w.toId):null,k=v&&w?so(e,v,w.props):null;if(v&&k){const n=e.shapes.get(t);Cr(n)&&function(e,t,n,r,o,i,s){const a=e.shapes.get(t.id),l=Cr(a)?a:t,c=e.shapes.computeLocalToPageTransform(l),d=bi(r,o),u=i?bi(i.shape.id,i.port):{kind:"free",pagePoint:s.clone()},h=wi(e,d),f=wi(e,u);if(!h||!f)return void xi(e).setPreview(null);const m="start"===n?f:h,g="end"===n?f:h;xi(e).setPreview({kind:"rebind",start:Al(m,g,"start"),end:Al(g,m,"end"),isDragging:!0,movingTerminal:n,geometry:jl(l.props,c,{curveWaypoints:l.props.curveWaypoints.map(e=>c.applyToPoint(new p(e.x,e.y))),orthogonalBends:l.props.orthogonalBends.map(e=>c.applyToPoint(new p(e.x,e.y)))})})}(e,n,r,v.id,k,i,x)}else xi(e).setPreview(null);return{status:"continue",finalPagePoint:x}},onCancel(){const t=xi(e);t.setPreview(null),t.setSelectionHandlesHidden(!1)},onComplete(){const t=xi(e);t.setPreview(null),t.setSelectionHandlesHidden(!1)}}}(e,n.id,t):"custom"===t.kind?function(e,t,n){const r=Co(e,t);if("connector.curve-waypoint"===n.type&&"curved"===t.props.routing){const o=mi(n.id,"waypoint"),i=r.routePoints.slice(1,-1).map(e=>e.clone());return null!==o&&i[o]?Ll(e,t.id,(n,r)=>{const s=i.map(e=>e.clone());s[o]=n.clone(),$l(e,t.id,"curveWaypoints",s,r)},n=>{$l(e,t.id,"curveWaypoints",i.filter((e,t)=>t!==o),n)}):null}if("connector.curve-insert"===n.type&&"curved"===t.props.routing){const o=mi(n.id,"segment"),i=r.routePoints.slice(1,-1).map(e=>e.clone());return null===o||o>i.length?null:Ll(e,t.id,(n,r)=>{const s=i.map(e=>e.clone());s.splice(o,0,n.clone()),$l(e,t.id,"curveWaypoints",s,r)})}if("connector.orthogonal-segment"===n.type&&"orthogonal"===t.props.routing){const o=gi(n.id);if(!o||!r.routePoints[o.index+1])return null;const i=r.routePoints.map(e=>e.clone()),s=e.shapes.computeLocalToPageTransform(t),a=t.props.orthogonalBends.map(e=>s.applyToPoint(new p(e.x,e.y)));return Ll(e,t.id,(n,r)=>{const s=function(e,t,n,r,o){const i=e[t];if(!i)return r;const s="horizontal"===n?r.y:r.x,a=["horizontal"===n?i.y:i.x],l=e[t-1];t>=2&&l&&a.push("horizontal"===n?l.y:l.x);const c=e[t+2];t<=e.length-4&&c&&a.push("horizontal"===n?c.y:c.x);const d=a.reduce((e,t)=>Math.abs(t-s)<Math.abs(e-s)?t:e);return Math.abs(d-s)>o?r:"horizontal"===n?new p(r.x,d):new p(d,r.y)}(i,o.index,o.axis,n,8/Math.max(e.state.cameraZoom.get(),1e-4)),l=i[o.index],c=("horizontal"===o.axis?s.y===l.y:s.x===l.x)?a:ii(function(e,t,n,r){const o=e[t],i=e[t+1];if(!o||!i)return e.map(e=>e.clone());const s="horizontal"===n?o.y:o.x;if(("horizontal"===n?r.y:r.x)===s)return e.map(e=>e.clone());const a=e=>"horizontal"===n?new p(e.x,r.y):new p(r.x,e.y),l=e.length-2;if(0===t){const t=Dl(o,i);return[o.clone(),t,a(t),a(i),...e.slice(2).map(e=>e.clone())]}if(t===l){const t=Dl(i,o);return[...e.slice(0,-2).map(e=>e.clone()),a(o),a(t),t,i.clone()]}const c=e.map(e=>e.clone());return c[t]=a(o),c[t+1]=a(i),c}(i,o.index,o.axis,s)).slice(1,-1);$l(e,t.id,"orthogonalBends",c,r)})}return null}(e,n,t):null:null}}}function Ol(e,t){if(t.accelKey)return{kind:"free",pagePoint:t.pagePoint.clone()};const n=Ua(e,t.pagePoint,{mode:"target",pageId:e.pages.getCurrentId()})??Ua(e,t.pagePoint,{pageId:e.pages.getCurrentId()});return!n||e.layers.isOrAncestorLocked(n.shape.id)?{kind:"free",pagePoint:t.pagePoint.clone()}:bi(n.shape.id,n.port)}function Al(e,t,n){const r=Ci(e,t,n);return{draft:e.draft,pagePoint:e.pagePoint.clone(),pageOutwardNormal:r.outwardNormal.clone(),shapeId:e.shape?.id??null,portId:e.port?.id??null,obstacleBounds:e.obstacleBounds}}function Rl(e,t,n,r,o){if("orthogonal"!==r||o||!t.port)return n.clone();const i=t.port.pageOutwardNormal,s=n.sub(t.pagePoint);if(s.x*i.x+s.y*i.y<=0)return n.clone();const a=Math.abs(i.x)>=Math.abs(i.y),l=a?s.y:s.x,c=8/Math.max(e.state.cameraZoom.get(),1e-4);return Math.abs(l)>c?n.clone():a?new p(n.x,t.pagePoint.y):new p(t.pagePoint.x,n.y)}function Nl(e,t,n){const r=Li(e,t,n);if(!r?.startsWith("shape:"))return A.Identity();const o=e.shapes.get(r);return o?e.shapes.computeLocalToPageTransform(o):A.Identity()}function Ll(e,t,n,r){const o={shapeId:t,operationKind:"connector.adjust",onDragStart(){xi(e).setSelectionHandlesHidden(!0)},update:({pagePoint:e,source:t})=>(n(e,t),{status:"continue",finalPagePoint:e}),onCancel(){xi(e).setSelectionHandlesHidden(!1)},onComplete(){xi(e).setSelectionHandlesHidden(!1)}};return r&&(o.onDoubleClick=({source:e})=>r(e)),o}function $l(e,t,n,r,o){const i=e.shapes.get(t);if(!Cr(i))return;const s=e.shapes.computeLocalToPageTransform(i).tryInvert();if(!s)return;const a={...i.props,[n]:r.map(e=>{const t=s.applyToPoint(e);return{x:t.x,y:t.y}})},l=Si(e,{...i,props:a});if(!l)return;const c=Ar(e,i.id),d=new Set([c.start?.id,c.end?.id].filter(e=>!!e));e.commands.updateShapes([{id:i.id,parentId:l.parentId,x:l.x,y:l.y,rotation:l.rotation,scaleX:l.scaleX,scaleY:l.scaleY,props:l.props}],{source:o,suppressBindingIds:d})}function Dl(e,t){const n=t.sub(e),r=n.len();return 0===r?e.clone():e.add(n.mul(Math.min(24,r/2)/r))}function jl(e,t,n={curveWaypoints:[],orthogonalBends:[]}){return{routing:e.routing,cornerRadius:e.cornerRadius,headStart:e.headStart,headEnd:e.headEnd,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeStyle:e.strokeStyle,...n,localToPageTransform:t}}var Bl=new Set(["straight","orthogonal","curved"]),zl=new Set(["solid","dashed"]),_l=new Set(["none","arrow"]);function Fl(e,t,n=-1/0){return"number"==typeof e&&Number.isFinite(e)?Math.max(n,e):t}function Wl(e,t){const n=e&&"object"==typeof e?e:{};return{x:Fl(n.x,t.x),y:Fl(n.y,t.y)}}function Hl(e){return Array.isArray(e)?e.flatMap(e=>{if(!e||"object"!=typeof e)return[];const t=e;return"number"==typeof t.x&&Number.isFinite(t.x)&&"number"==typeof t.y&&Number.isFinite(t.y)?[{x:t.x,y:t.y}]:[]}):[]}function Ul(e,t,n){const r=t.sub(e).normalize();return{point:e,outwardNormal:r.len()>0?r:new p("start"===n?1:-1,0)}}var Vl=class extends oe{type="connector";getDefaultProps(){return{w:1,h:1,start:{x:0,y:.5},end:{x:1,y:.5},routing:"orthogonal",stroke:k("stroke-slate"),strokeWidth:2,strokeStyle:"solid",headStart:"none",headEnd:"arrow",cornerRadius:8,curveWaypoints:[],orthogonalBends:[]}}validateProps(e){const t=e&&"object"==typeof e?e:{},n=this.getDefaultProps();return{w:Fl(t.w,n.w,1),h:Fl(t.h,n.h,1),start:Wl(t.start,n.start),end:Wl(t.end,n.end),routing:Bl.has(t.routing)?t.routing:n.routing,stroke:P(t.stroke)?I(t.stroke,n.stroke):n.stroke,strokeWidth:Fl(t.strokeWidth,n.strokeWidth,.5),strokeStyle:zl.has(t.strokeStyle)?t.strokeStyle:n.strokeStyle,headStart:_l.has(t.headStart)?t.headStart:n.headStart,headEnd:_l.has(t.headEnd)?t.headEnd:n.headEnd,cornerRadius:Fl(t.cornerRadius,n.cornerRadius,0),curveWaypoints:Hl(t.curveWaypoints),orthogonalBends:Hl(t.orthogonalBends)}}getLocalBounds(e){const t="arrow"===e.props.headStart||"arrow"===e.props.headEnd?go(e.props.strokeWidth)+e.props.strokeWidth/2:e.props.strokeWidth/2;return new h(0,0,e.props.w,e.props.h).expand(t)}getPointHitTestBounds(e,t){const n=Math.max(8,e.props.strokeWidth+4);if(!t?.editor)return h.FromPoints([new p(e.x+e.props.start.x,e.y+e.props.start.y),new p(e.x+e.props.end.x,e.y+e.props.end.y)]).expand(n);const r=Co(t.editor,e),o=[...r.points,...r.markerSegments.flatMap(e=>[e.start,e.end])],i=t.editor.shapes.computePositionedToPageTransform(e).tryInvert();if(!i||0===o.length)return super.getPointHitTestBounds(e,t).expand(n);const s=Kl(t.editor,e)*i.getMaximumLinearScale();return h.FromPoints(o.map(e=>i.applyToPoint(e))).expand(s)}canSnap(){return!1}canParticipateInSelectionResize(e,t){return!1===t.isOnlyAffectedShape}resizeSelectionBounds(e,t){const n=this.getLocalTransform(e),r=n.applyToPoint(this.getSelectionResizeLocalBounds(e).center),o=A.Translate(t.pageCenter.x,t.pageCenter.y).compose(A.Rotate(t.selectionRotation)).compose(A.Scale(t.scaleX,t.scaleY)).compose(A.Rotate(-t.selectionRotation)).compose(A.Translate(-r.x,-r.y)).compose(n),i=o.applyToPoint(new p(e.props.start.x,e.props.start.y)),s=o.applyToPoint(new p(e.props.end.x,e.props.end.y)),a=e.props.curveWaypoints.map(e=>o.applyToPoint(new p(e.x,e.y))),l=e.props.orthogonalBends.map(e=>o.applyToPoint(new p(e.x,e.y))),c=No({start:Ul(i,s,"start"),end:Ul(s,i,"end"),routing:e.props.routing,cornerRadius:e.props.cornerRadius,headStart:e.props.headStart,headEnd:e.props.headEnd,strokeWidth:e.props.strokeWidth,curveWaypoints:a,orthogonalBends:l}),d=h.FromPoints([i,...c.points,s]),u=e=>({x:e.x-d.x,y:e.y-d.y});return{id:e.id,x:d.x,y:d.y,rotation:0,scaleX:1,scaleY:1,props:{w:Math.max(1,d.w),h:Math.max(1,d.h),start:u(i),end:u(s),curveWaypoints:a.map(u),orthogonalBends:l.map(u)}}}canParticipateInSelectionFlip(){return!0}canParticipateInSelectionRotation(){return!1}canParticipateInSelectionTranslation(){return!1}contributesToSelectionFrame(e,t){return!0}canUseSelectionResizeHandles(e,t){return t.editor.selection.getIds().length>1}canUseSelectionRotateHandle(e,t){return t.editor.selection.getIds().length>1}canStartTranslateFromSelectionBounds(e,t){return t.editor.selection.getIds().length>1}getSelectionHandleAnchors(e,t){if(!t.isOnlySelected)return{terminalHandleAnchors:[],middleHandleAnchors:[]};if(xi(t.editor).selectionHandlesHiddenSignal.get())return{terminalHandleAnchors:[],middleHandleAnchors:[],customHandleAnchors:[]};const n=Co(t.editor,e),r=[];if("curved"===e.props.routing){for(let t=1;t<n.routePoints.length-1;t+=1)r.push({kind:"custom",type:ci,id:pi(t-1),point:n.routePoints[t],cursor:"move"});let e=0;n.segments.forEach(t=>{"cubic"===t.type&&(r.push({kind:"custom",type:di,id:hi(e),point:bo(t,.5),cursor:"move"}),e+=1)})}else if("orthogonal"===e.props.routing){const e=Math.max(t.editor.state.cameraZoom.get(),1e-4);for(let t=0;t<n.routePoints.length-1;t+=1){const o=n.routePoints[t],i=n.routePoints[t+1];if(o.dist(i)*e<36)continue;const s=o.y===i.y?"horizontal":"vertical";r.push({kind:"custom",type:ui,id:fi(t,s),point:p.Med(o,i),cursor:"horizontal"===s?"ns-resize":"ew-resize"})}}return{terminalHandleAnchors:[{kind:"binding_terminal",terminal:"start",point:n.startPagePoint},{kind:"binding_terminal",terminal:"end",point:n.endPagePoint}],middleHandleAnchors:[],customHandleAnchors:r}}getSelectionOverlayInfo(e,t){const n=Co(t.editor,e),r=Ro(t.editor,e),o=ri(r.markerSegments),i=t.editor.shapes.computeLocalToPageTransform(e);return{usesSelectionPathOverlay:!0,startPagePoint:n.startPagePoint,endPagePoint:n.endPagePoint,middlePagePoint:null,path:n.path,pathStyle:{localPath:r.path,localDecorationPaths:o?[o]:[],localBounds:r.pageBounds,localToPage:i,strokeWidth:e.props.strokeWidth,strokeDasharray:"dashed"===e.props.strokeStyle?"8 6":void 0},pageClipPath:Y({outputBounds:n.pageBounds,cutoutLocalPolygons:t.editor.shapes.getContentCutoutLocalPolygonsSignal(e.id).get(),localToOutput:i}),bindingSegments:[]}}getLabelPathGeometry(e,t){return wo(Co(t.editor,e))}canCopyToClipboard(e,t){const n=Ar(t.editor,e.id);return(!n.start||t.copiedShapeIds.has(n.start.toId))&&(!n.end||t.copiedShapeIds.has(n.end.toId))}isWrappedByBrush(e,t){return Co(t.editor,e).points.every(e=>t.brushBounds.containsPoint(e))}hitTest(e,t,n){const r=n?.editor?Co(n.editor,e):null,o=r?r.points:[new p(e.x+e.props.start.x,e.y+e.props.start.y),new p(e.x+e.props.end.x,e.y+e.props.end.y)],i=n?.pagePoint??t,s=n?.editor?Kl(n.editor,e):Math.max(8,e.props.strokeWidth+4);return ql(o,i)<=s||(r?.markerSegments.some(e=>ql([e.start,e.end],i)<=s)??!1)}hitTestLineSegment(e,t){const n=t.editor?Co(t.editor,e):null,r=n?n.points:[new p(e.x+e.props.start.x,e.y+e.props.start.y),new p(e.x+e.props.end.x,e.y+e.props.end.y)],o=t.editor?t.pageStart:t.positionedStart,i=t.editor?t.pageEnd:t.positionedEnd,s=t.editor?Math.max(Kl(t.editor,e),t.pageMargin):Math.max(e.props.strokeWidth+4,t.positionedMargin);for(let a=1;a<r.length;a+=1)if(Xl(r[a-1],r[a],o,i)<=s)return!0;for(const a of n?.markerSegments??[])if(Xl(a.start,a.end,o,i)<=s)return!0;return!1}};function Kl(e,t){const n=Math.max(e.state.cameraZoom.get(),1e-4),r=e.shapes.computePositionedToPageTransform(t).getMaximumLinearScale(),o=t.props.strokeWidth*r/2;return Math.max(12/n,o)}function ql(e,t){let n=1/0;for(let r=1;r<e.length;r+=1)n=Math.min(n,Yl(t,e[r-1],e[r]));return n}function Yl(e,t,n){const r=n.sub(t),o=r.len2();if(0===o)return e.dist(t);const i=e.sub(t),s=Math.max(0,Math.min(1,(i.x*r.x+i.y*r.y)/o));return e.dist(t.add(r.mul(s)))}function Xl(e,t,n,r){return Math.min(Yl(e,n,r),Yl(t,n,r),Yl(n,e,t),Yl(r,e,t))}var Jl=class extends ie{constructor(e){super(e,"connector")}},Gl=class{type="connector";toSvg(e,t){const n=t.resolveColor(e.props.stroke),r=Ro(t.editor,e),o=Y({outputBounds:r.pageBounds,cutoutLocalPolygons:t.editor.shapes.getContentCutoutLocalPolygonsSignal(e.id).get()}),i=o?t.addDef({tag:"clipPath",attrs:{clipPathUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{d:o,"clip-rule":"evenodd","fill-rule":"evenodd"}}]}):void 0,s="arrow"===e.props.headStart&&r.startArrowScale>0?`url(#${t.addDef(Ql("start",n,e.props.strokeWidth,r.startArrowScale))})`:void 0,a="arrow"===e.props.headEnd&&r.endArrowScale>0?`url(#${t.addDef(Ql("end",n,e.props.strokeWidth,r.endArrowScale))})`:void 0;return{tag:"path",attrs:{d:r.path,fill:"none",stroke:n,"stroke-width":e.props.strokeWidth,"stroke-dasharray":"dashed"===e.props.strokeStyle?"8 6":void 0,"stroke-linecap":"round","stroke-linejoin":"round","marker-start":s,"marker-end":a,"clip-path":i?`url(#${i})`:void 0}}}};function Zl(e,t){return{id:"land.connector",shapeUtils:[new Vl],shapeSvgExporters:[new Gl],bindingUtils:[new Sl],interactionHandlers:[Cl(e)],setup(n){n.runtime.provide(yi,function(e,t,n){const r=e.signals.atom("connector.preview",null),o=e.signals.atom("connector.selectionHandlesHidden",!1),i=n?new Set(n):null;let s=null;return{previewSignal:r,quickCreateNodeFactory:t,selectionHandlesHiddenSignal:o,get pointerSession(){return s},isPortVisible:e=>i?.has(e)??!0,setPointerSession(e){s=e},setPreview(e){r.set(e)},setSelectionHandlesHidden(e){o.get()!==e&&o.set(e)},dispose(){s?.cancel("dispose"),s=null,r.set(null),o.set(!1)}}}(n,e,t),e=>e.dispose()),n.tools.register("connector",e=>new Jl(e))}}}function Ql(e,t,n,r){return{tag:"marker",attrs:{markerWidth:12,markerHeight:12,viewBox:"0 0 24 24",refX:yo(e,n,r),refY:12,orient:"auto",markerUnits:"strokeWidth"},children:[{tag:"path",attrs:{d:xo(e,n,r),fill:"none",stroke:t,"stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"}}]}}var ec=ut("plugin-connector.api");function tc({editor:e}){return function({editor:e}){return{getSelectionStyle(){const t=e.state.selectedShapes.get().filter(Cr);return 0===t.length?null:{routing:nc(t.map(e=>e.props.routing)),stroke:rc(t.map(e=>e.props.stroke)),strokeWidth:nc(t.map(e=>e.props.strokeWidth)),strokeStyle:nc(t.map(e=>e.props.strokeStyle)),headStart:nc(t.map(e=>e.props.headStart)),headEnd:nc(t.map(e=>e.props.headEnd))}},setSelectionStyle(t){const n=e.state.selectedShapes.get().filter(Cr).filter(e=>!e.isLocked).map(e=>({id:e.id,props:{...t}}));return n.length>0&&e.commands.updateShapes(n,{source:"user"}),n.map(({id:e})=>e)},getToolDefaults:()=>e.shapes.getDefaultProps("connector"),setToolDefaults:t=>(e.shapes.updateDefaultProps("connector",t),e.shapes.getDefaultProps("connector"))}}({editor:e})}function nc(e){const[t,...n]=e;return void 0!==t&&n.every(e=>e===t)?t:null}function rc(e){const[t,...n]=e;return void 0!==t&&n.every(e=>O(t,e))?t:null}function oc(e={}){const t=e.quickCreateNodeFactory??Ga(),n=e.visiblePortIds?[...e.visiblePortIds]:void 0;return{id:"connector",requires:[Fa],editor:Zl(t,n),render:al(),api:ec,setup:({editor:e})=>({api:tc({editor:e})})}}var ic=oc();function sc(e){return Number.isInteger(e)?`${e}`:`${Number(e.toFixed(2))}`}function ac(e,t,n){return Math.max(t,Math.min(n,e))}function lc(e){return e?640:480}function cc(e,t){return e.x===t.x&&e.y===t.y&&e.pressure===t.pressure&&e.segment===t.segment}function dc(e){return new p(e.x,e.y)}function uc(e){return{x:e.x,y:e.y,...void 0===e.pressure?null:{pressure:e.pressure},...void 0===e.segment?null:{segment:e.segment}}}function pc(e){const t=[];for(const n of e)t.push(...n.points.map(uc));return t}function hc(e){return[{points:e.map(uc)}]}function fc(e){if(void 0!==e&&Number.isFinite(e))return ac(e,.05,1)}function mc(e,t,n,r,o={}){const i=uc(t),s=e[e.length-1];if(!s)return e.push(i),{anchorPoint:uc(i),hasProvisionalPoint:!1};if(cc(s,i))return o.force&&r.hasProvisionalPoint?{anchorPoint:uc(i),hasProvisionalPoint:!1}:r;if(cc(r.anchorPoint,i))return r.hasProvisionalPoint&&e.pop(),{anchorPoint:uc(r.anchorPoint),hasProvisionalPoint:!1};const a=function(e,t){if(e<=t.softMaxPointCount)return t.minPointDistance;const n=ac((e-t.softMaxPointCount)/Math.max(t.hardMaxPointCount-t.softMaxPointCount,1),0,1);return t.minPointDistance*(1+n*t.maxDistanceMultiplier)}(e.length,n),l=i.x-r.anchorPoint.x,c=i.y-r.anchorPoint.y,d=Math.abs((i.pressure??0)-(r.anchorPoint.pressure??0)),u=!0===o.force||l*l+c*c>=a*a||d>=n.pressureDeltaThreshold;return r.hasProvisionalPoint?e[e.length-1]=i:e.push(i),u?{anchorPoint:uc(i),hasProvisionalPoint:!1}:{anchorPoint:uc(r.anchorPoint),hasProvisionalPoint:!0}}function gc(e,t){const n=Math.max(2,Math.floor(t));if(e.length<=n)return e.map(uc);const r=function(e,t){let n=yc(e,!0);n.length<t&&(n=yc(e,!1));return new Set(n.slice(0,t).map(e=>e.index))}(e,e.length-n);return e.filter((e,t)=>!r.has(t)).map(uc)}function yc(e,t){const n=[];for(let r=1;r<e.length-1;r+=1){if(t&&xc(e,r))continue;const o=e[r],i=e[r-1],s=e[r+1];o&&i&&s&&n.push({index:r,score:bc(o,i,s)})}return n.sort((e,t)=>e.score-t.score||e.index-t.index),n}function xc(e,t){return"straight"===e[t]?.segment||"straight"===e[t+1]?.segment}function bc(e,t,n){const r=function(e,t,n){const r=n.x-t.x,o=n.y-t.y,i=r*r+o*o;if(0===i){const n=e.x-t.x,r=e.y-t.y;return n*n+r*r}const s=ac(((e.x-t.x)*r+(e.y-t.y)*o)/i,0,1),a=t.x+r*s,l=t.y+o*s,c=e.x-a,d=e.y-l;return c*c+d*d}(e,t,n),o=function(e,t,n){if(void 0===e.pressure)return 0;const r=t.pressure??e.pressure,o=n.pressure??e.pressure;return 8*Math.abs(e.pressure-(r+o)/2)}(e,t,n);return r+o*o}function wc(e){if(0===e.length)return null;if(1===e.length){const t=e[0];return`M ${sc(t.x)} ${sc(t.y)}`}if(2===e.length){const t=e[0],n=e[1];return[`M ${sc(t.x)} ${sc(t.y)}`,`L ${sc(n.x)} ${sc(n.y)}`].join(" ")}const t=[],n=e[0];t.push(`M ${sc(n.x)} ${sc(n.y)}`);for(let r=1;r<e.length;r+=1){const n=e[r];if(!n)continue;if("straight"===n.segment){t.push(`L ${sc(n.x)} ${sc(n.y)}`);continue}const o=e[r+1];if(!o||"straight"===o.segment){if(vc(e,r)){const o=e[r-1];t.push(`Q ${sc(o.x)} ${sc(o.y)} ${sc(n.x)} ${sc(n.y)}`)}else t.push(`L ${sc(n.x)} ${sc(n.y)}`);continue}const i=p.Med(dc(n),dc(o));t.push(`Q ${sc(n.x)} ${sc(n.y)} ${sc(i.x)} ${sc(i.y)}`)}return t.join(" ")}function vc(e,t){return t>=2&&"straight"!==e[t-1]?.segment&&"straight"!==e[t-2]?.segment}function kc(e){if(e.length<3)return function(e){if(0===e.length)return null;const[t,...n]=e;return t?[`M ${sc(t.x)} ${sc(t.y)}`,...n.map(e=>`L ${sc(e.x)} ${sc(e.y)}`),"Z"].join(" "):null}(e);const t=e[0],n=e[e.length-1];if(!t||!n)return null;const r=p.Med(n,t),o=[`M ${sc(r.x)} ${sc(r.y)}`];for(let i=0;i<e.length;i+=1){const t=e[i],n=e[(i+1)%e.length];if(!t||!n)continue;const r=p.Med(t,n);o.push(`Q ${sc(t.x)} ${sc(t.y)} ${sc(r.x)} ${sc(r.y)}`)}return o.push("Z"),o.join(" ")}function Sc(e){return e.map(uc)}function Pc(e){return e.map(Mc)}function Mc(e){return function(e){return{points:e.points.map(uc)}}(e)}function Ic(e,t,n){return e.map(e=>({x:e.x+t,y:e.y+n,...void 0===e.pressure?null:{pressure:e.pressure},...void 0===e.segment?null:{segment:e.segment}}))}function Ec(e,t,n){return e.map(e=>({points:Ic(e.points,t,n)}))}function Tc(e,t){return e.map((e,n)=>({points:e.points.map((e,r)=>{const o=t(dc(e),n,r);return{x:o.x,y:o.y,...void 0===e.pressure?null:{pressure:e.pressure},...void 0===e.segment?null:{segment:e.segment}}})}))}function Cc(e,t,n){const r=0===t.w?1:t.w,o=0===t.h?1:t.h,i=0===n.w?1:n.w,s=0===n.h?1:n.h;return e.map(e=>({x:n.minX+(e.x-t.minX)/r*i,y:n.minY+(e.y-t.minY)/o*s,...void 0===e.pressure?null:{pressure:e.pressure},...void 0===e.segment?null:{segment:e.segment}}))}function Oc(e,t,n){return e.map(e=>({points:Cc(e.points,t,n)}))}function Ac(e){return{rotation:e.selectionRotation,rotationCenter:e.selectionRotationCenter}}function Rc(e,t){const n=Ac(t);return Tc(e,e=>function(e,t){return 0===t.rotation?e.clone():p.RotWith(e,t.rotationCenter,-t.rotation)}(e,n))}function Nc(e,t){const n=Ac(t);return Tc(e,e=>H(e,n))}function Lc(e,t){return Tc(e,e=>U({axis:t.axis,bounds:t.selectionMirrorBounds,point:e}))}var $c=.08;function Dc(e,t,n){return Math.max(t,Math.min(n,e))}function jc(e,t,n){return e+(t-e)*n}function Bc(e,t,n){if(e.length<=1)return new p(1,0);if(n&&e.length>=3){const n=e[t],r=e[(t-1+e.length)%e.length],o=e[(t+1)%e.length],i=n.sub(r).normalize(),s=o.sub(n).normalize(),a=i.add(s);return a.len2()>1e-6?a.normalize():s.len2()>0?s:i.len2()>0?i:new p(1,0)}const r=e[t],o=e[t-1]??r,i=e[t+1]??r,s=r.sub(o).normalize(),a=i.sub(r).normalize();if(0===t)return a.len2()>0?a:new p(1,0);if(t===e.length-1)return s.len2()>0?s:new p(1,0);const l=s.add(a);return l.len2()>1e-6?l.normalize():a.len2()>0?a:s.len2()>0?s:new p(1,0)}function zc(e,t){return e.x*t.x+e.y*t.y}function _c(e,t,n,r,o,i,s,a){if(n.simulatePressure)return function({distanceFromPrevious:e,previousPressure:t,runningLength:n,totalLength:r,strokeWidth:o,isClosed:i}){const s=Dc(e/Math.max(1.5*o,1),0,1),a=Dc(1-s,$c,1),l=null===t?jc(.5,a,.275):jc(t,a,.275*Math.max(s,.36));if(i)return Dc(l,$c,1);const c=Dc(n/Math.max(1.8*o,1),0,1),d=Dc((r-n)/Math.max(2.6*o,1),0,1);return Dc(l*jc(.72,1,Math.min(c,d)),$c,1)}({distanceFromPrevious:o,previousPressure:t,runningLength:i,totalLength:s,strokeWidth:r,isClosed:a});const l="number"==typeof e.pressure&&Number.isFinite(e.pressure)?Dc(e.pressure,.05,1):t??.55;return null===t?l:jc(t,l,.68)}function Fc(e,t,n,r,o={}){if(0===e.length)return[];const i=function(e,t){const n=Math.max(e+1,1.6);return{baseRadius:n,minRadius:Math.max(.6,.32*n),minRadiusScale:t?.5:.48,maxRadiusScale:t?1.22:1.24,startTaper:Math.max(1.8*e,2.5),endTaper:Math.max(2.3*e,3.5),simulatePressure:!t}}(t,n),s=e.map(dc),a=[0];let l=0;for(let u=1;u<s.length;u+=1)l+=s[u].dist(s[u-1]),a.push(l);let c=null;const d=e.map((e,n)=>{const d=a[n]??0,u=0===n?0:s[n].dist(s[n-1]),p=_c(e,c,i,t,u,d,l,r);c=p;const h=o.taperStart??!0,f=o.taperEnd??!0,m=r||s.length<=1?1:Math.min(h?Dc(d/i.startTaper,0,1):1,f?Dc((l-d)/i.endTaper,0,1):1),g=jc(i.minRadiusScale,i.maxRadiusScale,p),y=Math.max(i.minRadius,i.baseRadius*g*jc(.7,1,m));return{point:s[n],direction:Bc(s,n,r),pressure:p,radius:y,runningLength:d}});return l<.5*i.baseRadius?d.map(e=>({...e,radius:Math.max(e.radius,.92*i.baseRadius)})):d}function Wc(e,t){const n=e[e.length-1];n&&n.dist2(t)<.04?e[e.length-1]=t:e.push(t)}function Hc(e,t,n){const r=e.dist(t);if(0===r)return[];const o=p.Angle(e,t),i=[];for(let s=1;s<n;s+=1){const t=o-Math.PI*(s/n);i.push(new p(e.x+Math.cos(t)*r,e.y+Math.sin(t)*r))}return i}function Uc(e,t,n={}){if(0===e.length)return[];if(1===e.length)return function(e,t,n){const r=[];for(let o=0;o<n;o+=1){const i=2*Math.PI*o/n;r.push(new p(e.x+Math.cos(i)*t,e.y+Math.sin(i)*t))}return r}(e[0].point,e[0].radius,16);const r=[],o=[];let i=.12;for(const c of e)i=Math.max(i,.38*c.radius);const s=i**2;let a=null;for(let c=0;c<e.length;c+=1){const t=e[c],n=e[c+1]??t,i=t.direction,l=n.direction,d=zc(i,l);let u=0===c||c===e.length-1?i.per().normalize():p.Lrp(l,i,d).per().normalize();u.len2()<1e-6&&(u=a??new p(0,1)),a=u,Vc(r,t.point.add(u.mul(t.radius)),s,{force:c===e.length-1}),Vc(o,t.point.sub(u.mul(t.radius)),s,{force:c===e.length-1})}if(t&&e.length>=3){const e=[];for(const t of r)Wc(e,t);for(let t=o.length-1;t>=0;t-=1){Wc(e,o[t])}return e}const l=[];for(const c of r)Wc(l,c);if(n.capEnd??1){const t=e[e.length-1];for(const e of Hc(t.point,r[r.length-1],8))Wc(l,e)}for(let c=o.length-1;c>=0;c-=1){Wc(l,o[c])}if(n.capStart??1){const t=e[0];for(const e of Hc(t.point,o[0],8))Wc(l,e)}return l}function Vc(e,t,n,r={}){const o=e[e.length-1];(!o||!0===r.force||o.dist2(t)>n)&&Wc(e,t)}var Kc=new WeakMap;function qc(e){return{...e}}function Yc(e,t,n){return e.map(e=>new p(e.x+t,e.y+n))}function Xc(e,t,n){return e.map(e=>Yc(e,t,n))}function Jc({segments:e,outlineVertices:t,outlinePolygons:n,strokeWidth:r,sampling:o,isClosed:i}){const s=pc(e),a=s.map(dc),l=a.length>0?h.FromPoints(a):new h(0,0,1,1),c=t.length>0?h.FromPoints([...t]):l.expand(Math.max(r/2,1)),d=i&&s.length>=3?function(e){if(e.length<3)return null;const t=wc(e);return t?`${t} Z`:null}(s):null,u=void 0!==n?function(e){const t=e.map(e=>kc(e)).filter(e=>null!==e);return t.length>0?t.join(" "):null}(n):kc(t);return{normalizedSegments:Pc(e),normalizedPoints:Sc(s),pointBounds:l,path:u,selectionPath:d??wc(s),fillPath:d,localBounds:c,renderBounds:c.clone(),outlineVertices:t.map(e=>e.clone()),outlinePolygons:n?n.map(e=>e.map(e=>e.clone())):[t.map(e=>e.clone())],sampling:qc(o)}}function Gc(e,t,n,r){const o=function({strokeWidth:e,isPen:t}){return[e,t?"pen":"pointer"].join(":")}({strokeWidth:n,isPen:r}),i=Kc.get(e),s=i?.get(o);if(s)return{normalizedSegment:Mc(s.normalizedSegment),sampling:qc(s.sampling)};const a=function(e,t){if(e.length<=1)return{points:e.map(uc),rawPointCount:e.length,sampledPointCount:e.length,maxPointCount:t.maxPointCount,reduced:!1,capped:!1};const n=[uc(e[0])],r=t.minPointDistance*t.minPointDistance;let o=dc(e[0]),i=fc(e[0].pressure);for(let l=1;l<e.length;l+=1){const s=e[l];if(!s)continue;const a=dc(s),c=fc(s.pressure),d=l===e.length-1,u="straight"===s.segment,h=d||u?a:p.Lrp(o,a,t.positionBlend),f=u?c:void 0===c?void 0:void 0===i?c:i+(c-i)*t.pressureBlend;o=h,i=f;const m=void 0===f?{x:h.x,y:h.y,...void 0===s.segment?null:{segment:s.segment}}:{x:h.x,y:h.y,pressure:f,...void 0===s.segment?null:{segment:s.segment}},g=n[n.length-1];if(!g){n.push(m);continue}const y=m.x-g.x,x=m.y-g.y,b=Math.abs((m.pressure??0)-(g.pressure??0));if(y*y+x*x<r){if(u){if(cc(g,m))continue;n.push(m);continue}(b>.08||d)&&(n[n.length-1]=m)}else n.push(m)}const s=n.length>t.maxPointCount,a=gc(n,t.maxPointCount);return{points:a,rawPointCount:e.length,sampledPointCount:a.length,maxPointCount:t.maxPointCount,reduced:a.length<e.length,capped:s}}(e.points,t),l={normalizedSegment:{points:Sc(a.points)},sampling:{rawPointCount:a.rawPointCount,sampledPointCount:a.sampledPointCount,sampledPointLimit:a.maxPointCount,reduced:a.reduced,capped:a.capped}},c=i??new Map;return c.set(o,{normalizedSegment:Mc(l.normalizedSegment),sampling:qc(l.sampling)}),i||Kc.set(e,c),l}function Zc(e,t,n=!1,r=!1){const o=function(e,t){return{minPointDistance:t?Math.max(.35,.18*e):Math.max(.55,.28*e),positionBlend:t?.68:.66,pressureBlend:t?.68:.45,maxPointCount:lc(t)}}(t,n),i=[],s=[],a=e.filter(e=>e.points.length>0);for(let p=0;p<a.length;p+=1){const e=Gc(a[p],o,t,n);i.push(Mc(e.normalizedSegment)),s.push(qc(e.sampling))}const l=Uc(Fc(pc(i),t,n,r),r),c=(d=s,u=o.maxPointCount,{rawPointCount:d.reduce((e,t)=>e+t.rawPointCount,0),sampledPointCount:d.reduce((e,t)=>e+t.sampledPointCount,0),sampledPointLimit:u,reduced:d.some(e=>e.reduced),capped:d.some(e=>e.capped)});var d,u;return Jc({segments:i,outlineVertices:l,outlinePolygons:l.length>0?[l]:[],strokeWidth:t,sampling:c,isClosed:r})}var Qc=new WeakMap,ed=new WeakMap;function td(e){return e.segments}function nd(e,t,n){return function(e,t){const n=Math.max(0,e.w-t.left-t.right),r=Math.max(0,e.h-t.top-t.bottom);return new h(e.x+t.left,e.y+t.top,n,r)}(n,{left:e.minX-t.minX,right:t.maxX-e.maxX,top:e.minY-t.minY,bottom:t.maxY-e.maxY})}function rd(e){const t=e,n=Qc.get(t);if(n)return n;const r=Zc(td(e.props),e.props.strokeWidth,e.props.isPen??!1,e.props.isClosed);return Qc.set(t,r),r}function od(e,t,n=!1,r=!1){const o=Zc(e,t,n,r),i=o.pointBounds,s=Zc(Tc(o.normalizedSegments,e=>new p(e.x-i.x,e.y-i.y)),t,n,r);return{x:i.x,y:i.y,segments:s.normalizedSegments,pointBounds:s.pointBounds,localBounds:s.localBounds,renderBounds:s.renderBounds,path:s.path,selectionPath:s.selectionPath,fillPath:s.fillPath,outlineVertices:s.outlineVertices,outlinePolygons:s.outlinePolygons,sampling:s.sampling}}function id(e,t,n=!1,r=!1){return function(e,t,n=!1,r=!1){return od(hc(e),t,n,r)}(e,t,n,r)}function sd(e,t,n=!1,r=!1){return od(e,t,n,r)}function ad(e){const t=e,n=ed.get(t);if(n)return n;const r=function(e,t,n,r,o){return Jc({segments:Ec(e.normalizedSegments,n,r),outlineVertices:Yc(e.outlineVertices,n,r),outlinePolygons:Xc(e.outlinePolygons,n,r),strokeWidth:t,sampling:e.sampling,isClosed:o})}(rd(e),e.props.strokeWidth,e.x,e.y,e.props.isClosed);return ed.set(t,r),r}function ld(e){return pc(cd(e))}function cd(e){const t=function(e,t){return new p(e.x+t.localBounds.center.x,e.y+t.localBounds.center.y)}(e,rd(e));return Tc(function(e){return Ec(td(e.props),e.x,e.y)}(e),n=>function(e,t,n){if(0===e.rotation&&1===e.scaleX&&1===e.scaleY)return t;const r=t.sub(n),o=new p(r.x*e.scaleX,r.y*e.scaleY);return n.add(o.rot(e.rotation))}(e,n,t))}function dd(e,t){let n=function({segments:e,strokeWidth:t,isPen:n,isClosed:r,targetSelectionStrokeBounds:o}){let i=Pc(e);for(let s=0;s<2;s+=1){const e=Zc(i,t,n,r),s=nd(e.pointBounds,e.localBounds,o);i=Oc(i,e.pointBounds,s)}return i}({segments:Rc(cd(e),t),strokeWidth:e.props.strokeWidth,isPen:e.props.isPen??!1,isClosed:e.props.isClosed,targetSelectionStrokeBounds:t.targetSelectionStrokeBounds});return t.scaleX<0&&(n=Lc(n,{axis:"horizontal",selectionMirrorBounds:t.targetSelectionStrokeBounds,selectionRotation:t.selectionRotation,selectionRotationCenter:t.selectionRotationCenter})),t.scaleY<0&&(n=Lc(n,{axis:"vertical",selectionMirrorBounds:t.targetSelectionStrokeBounds,selectionRotation:t.selectionRotation,selectionRotationCenter:t.selectionRotationCenter})),sd(Nc(n,t),e.props.strokeWidth,e.props.isPen??!1,e.props.isClosed)}function ud(e,t){return sd(Nc(Lc(Rc(cd(e),t),t),t),e.props.strokeWidth,e.props.isPen??!1,e.props.isClosed)}function pd(e){return Pc(e)}function hd(e){const t=rd(e);return{...t.sampling,hasPath:null!==t.path,hasSelectionPath:null!==t.selectionPath,outlineVertexCount:t.outlineVertices.length}}var fd=class extends ie{constructor(e){super(e,"draw"),this.initial="idle",this.addChild(new md(e,this)),this.addChild(new gd(e,this))}getDefaultProps(){return this.editor.shapes.getDefaultProps("draw")}},md=class extends ie{constructor(e,t){super(e,"idle",t)}onEnter(){this.editor.interaction.clearSelection()}onPointerDown(e){const t=this.parent.getDefaultProps(),n=function(e,t){const n=e.pages.getCurrentId();let r=null,o=1/0,i=-1;const s=e.state.currentPageShapeIds.get();for(let a=0;a<s.length;a+=1){const n=e.shapes.get(s[a]);if(!n||e.shapes.isHidden(n.id))continue;const l=e.shapes.getUtil(n);if(!l.canAutomaticallyReceiveChildren(n))continue;if(!e.layers.canReceiveChildren(n.id))continue;if(!e.shapes.isPagePointInClip(n.id,t))continue;const c=l.getChildClipLocalBounds(n)??l.getLocalBounds(n),d=e.shapes.computeLocalToPageTransform(n).invert().applyToPoint(t);if(!c.containsPoint(d))continue;const u=e.shapes.computePageBounds(n),p=u.w*u.h;(!r||p<o||p===o&&a>i)&&(r=n,o=p,i=a)}return r?.id??n}(this.editor,e.pagePoint),r=n.startsWith("shape:")?this.editor.shapes.get(n):null,o=r?this.editor.shapes.computeLocalToPageTransform(r).invert():A.Identity(),i=o.applyToPoint(e.pagePoint),s=yd(i,i,e.pressure,"pen"===e.pointerType);var a,l;this.transition("drawing",{originPagePoint:e.pagePoint.clone(),originScreenPoint:e.screenPoint.clone(),originParentPoint:i,pageToParent:o,parentId:n,shapeId:null,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,isClosed:t.isClosed,isPen:"pen"===e.pointerType,pointGuard:(a=t.strokeWidth,l="pen"===e.pointerType,l?{minPointDistance:Math.max(.12,.08*a),pressureDeltaThreshold:.035,softMaxPointCount:1600,hardMaxPointCount:3200,maxDistanceMultiplier:2.5}:{minPointDistance:Math.max(.3,.14*a),pressureDeltaThreshold:.08,softMaxPointCount:900,hardMaxPointCount:2200,maxDistanceMultiplier:6}),pointGuardState:{anchorPoint:xd(s),hasProvisionalPoint:!1},straightSegmentAnchorPoint:null,preserveStraightEndpointOnNextFreePoint:!1,segments:[{points:[s]}]})}},gd=class extends ie{tool;info=null;pendingUpdateFrame=null;operation=null;constructor(e,t){super(e,"drawing",t),this.tool=t}onEnter(e){this.info=e,this.editor.interaction.clearSelection(),this.editor.commands.setSelectedShapeIds([],{source:"system"}),this.operation=this.editor.operations.begin({kind:"draw.create",label:"shape.create",source:"user",history:"record"})}onPointerMove(e){this.appendPoint(e,!1)}onPointerUp(e){this.appendPoint(e,!0),this.flushShapeUpdate();const t=this.info?.shapeId??null;if(!t)return this.cancelOperation(),void this.transition("idle");this.info?.parentId.startsWith("shape:")||j(this.editor,t,{source:"user"}),this.commitOperation(),this.transition("idle")}onCancel(){this.cancelScheduledShapeUpdate(),this.cancelOperation(),this.transition("idle")}onExit(){this.cancelScheduledShapeUpdate(),this.cancelOperation(),this.info=null}commitOperation(){const e=this.operation;this.operation=null,e?.commit()}cancelOperation(){const e=this.operation;this.operation=null,e?.isActive&&e.cancel()}appendPoint(e,t){if(!this.info)return;const n=yd(this.info.pageToParent.applyToPoint(e.pagePoint),this.info.originParentPoint,e.pressure,this.info.isPen);if(e.shiftKey?this.appendStraightSegmentPoint(n):(this.exitStraightSegmentMode(),this.info.preserveStraightEndpointOnNextFreePoint?this.appendDistinctCurrentPoint(n)&&(this.info.preserveStraightEndpointOnNextFreePoint=!1):this.appendGuardedCurrentPoint(n,{force:t})),this.splitCurrentSegmentAtLimit(),!this.info.shapeId){const n=this.info.originScreenPoint.dist(e.screenPoint);if(!t&&n<2)return;const r=this.createShape();return void(this.info.shapeId=r.id)}this.scheduleShapeUpdate()}scheduleShapeUpdate(){var e;null===this.pendingUpdateFrame&&(this.pendingUpdateFrame=(e=()=>{this.pendingUpdateFrame=null,this.flushShapeUpdate()},"function"==typeof requestAnimationFrame?{type:"animation",id:requestAnimationFrame(e)}:{type:"timeout",id:setTimeout(e,16)}))}cancelScheduledShapeUpdate(){null!==this.pendingUpdateFrame&&(!function(e){if("animation"===e.type)return void cancelAnimationFrame(e.id);clearTimeout(e.id)}(this.pendingUpdateFrame),this.pendingUpdateFrame=null)}flushShapeUpdate(){this.cancelScheduledShapeUpdate(),this.info?.shapeId&&this.editor.commands.updateShapes([{id:this.info.shapeId,props:vd(this.info.segments)}],{source:"user"})}createShape(){const e=this.tool.getDefaultProps(),t=function(e,t){return t&&e.layers.canReceiveChildren(t)?t:e.pages.getCurrentId()}(this.editor,this.info?.parentId);this.info&&(this.info.parentId=t);const[n]=this.editor.commands.createShapes([{type:"draw",x:this.info?.originParentPoint.x??0,y:this.info?.originParentPoint.y??0,...t.startsWith("shape:")?{parentId:t}:{},props:{...e,stroke:this.info?.stroke??e.stroke,strokeWidth:this.info?.strokeWidth??e.strokeWidth,fill:this.info?.fill??e.fill,isClosed:this.info?.isClosed??e.isClosed,...vd(this.info?.segments??[]),isPen:this.info?.isPen??!1}}],{source:"user"});if(!n||"draw"!==n.type)throw new Error("Failed to create draw shape");return n}appendStraightSegmentPoint(e){if(!this.info)return;this.info.preserveStraightEndpointOnNextFreePoint=!1;const t=bd(this.info),n=t[t.length-1];if(!this.info.straightSegmentAnchorPoint){if(!n)return this.replaceCurrentSegmentPoints([{...e,segment:"straight"}]),void this.resetPointGuard(e);this.info.straightSegmentAnchorPoint=xd(n)}const r={...e,segment:"straight"};if("straight"===n?.segment)return this.replaceCurrentSegmentPoints([...t.slice(0,-1),r]),void this.resetPointGuard(r);this.replaceCurrentSegmentPoints([...t,r]),this.resetPointGuard(r)}exitStraightSegmentMode(){this.info?.straightSegmentAnchorPoint&&(this.info.straightSegmentAnchorPoint=null,this.info.preserveStraightEndpointOnNextFreePoint=!0)}appendDistinctCurrentPoint(e){if(!this.info)return!1;const t=bd(this.info),n=t[t.length-1];return(!n||(o=e,(r=n).x!==o.x||r.y!==o.y||r.pressure!==o.pressure||r.segment!==o.segment))&&(this.replaceCurrentSegmentPoints([...t,xd(e)]),this.resetPointGuard(e),!0);var r,o}appendGuardedCurrentPoint(e,t={}){if(!this.info)return;const n=bd(this.info).map(xd);this.info.pointGuardState=mc(n,e,this.info.pointGuard,this.info.pointGuardState,t),this.replaceCurrentSegmentPoints(n)}resetPointGuard(e){this.info&&(this.info.pointGuardState={anchorPoint:xd(e),hasProvisionalPoint:!1})}replaceCurrentSegmentPoints(e){if(!this.info)return;const t=wd(this.info.segments);this.info.segments=[...t.slice(0,-1),{points:e.map(xd)}]}splitCurrentSegmentAtLimit(){if(!this.info)return;const e=lc(this.info.isPen);let t=wd(this.info.segments),n=t[t.length-1];for(;n.points.length>e;){const r=n.points.slice(0,e).map(xd),o=r[r.length-1],i=n.points.slice(e).map(xd);if(!o||0===i.length)break;const s={points:[xd(o),...i]};t=[...t.slice(0,-1),{points:r},s],n=s}this.info.segments=t}};function yd(e,t,n,r){return{x:e.x-t.x,y:e.y-t.y,...r&&n>0?{pressure:n}:null}}function xd(e){return{x:e.x,y:e.y,...void 0===e.pressure?null:{pressure:e.pressure},...void 0===e.segment?null:{segment:e.segment}}}function bd(e){const t=wd(e.segments),n=t[t.length-1];return n?n.points.map(xd):[]}function wd(e){return e.length>0?[...e]:[{points:[]}]}function vd(e){return{segments:pd(wd(e))}}function kd(e){return c(e)&&"draw"===e.type}var Sd=ut("plugin-draw.api");function Pd({editor:e}){return function({editor:e}){return{getSelectionStyle(){const t=e.state.selectedShapes.get().filter(kd);return 0===t.length?null:{fill:Md(t.map(e=>e.props.fill)),stroke:Md(t.map(e=>e.props.stroke)),strokeWidth:Md(t.map(e=>e.props.strokeWidth)),isClosed:Md(t.map(e=>e.props.isClosed))}},setSelectionStyle(t){const n=e.state.selectedShapes.get().filter(kd).filter(e=>!e.isLocked).map(e=>({id:e.id,props:{...t}}));return n.length>0&&e.commands.updateShapes(n,{source:"user"}),n.map(({id:e})=>e)},getToolDefaults:()=>e.shapes.getDefaultProps("draw"),setToolDefaults:t=>(e.shapes.updateDefaultProps("draw",t),e.shapes.getDefaultProps("draw"))}}({editor:e})}function Md(e){const[t,...n]=e;return void 0!==t&&n.every(e=>e===t)?t:void 0}function Id(e,t,n){const r=n.sub(t),o=r.len2();if(0===o)return e.dist(t);const i=Math.max(0,Math.min(1,((e.x-t.x)*r.x+(e.y-t.y)*r.y)/o)),s=new p(t.x+r.x*i,t.y+r.y*i);return e.dist(s)}function Ed(e,t,n,r){return function(e,t,n,r){const o=t.sub(e),i=r.sub(n),s=o.x*i.y-o.y*i.x;if(Math.abs(s)<1e-8)return!1;const a=n.sub(e),l=(a.x*i.y-a.y*i.x)/s,c=(a.x*o.y-a.y*o.x)/s;return l>=0&&l<=1&&c>=0&&c<=1}(e,t,n,r)?0:Math.min(Id(e,n,r),Id(t,n,r),Id(n,e,t),Id(r,e,t))}function Td(e,t){let n=!1;for(let r=0,o=t.length-1;r<t.length;o=r,r+=1){const i=t[r],s=t[o];i&&s&&(i.y>e.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(n=!n))}return n}function Cd(e,t){if(0===t.length)return Number.POSITIVE_INFINITY;let n=Number.POSITIVE_INFINITY;for(let r=0;r<t.length;r+=1){const o=t[r],i=t[(r+1)%t.length];o&&i&&(n=Math.min(n,Id(e,o,i)))}return n}function Od(e,t,n,r){if(0===n.length)return!1;if(Td(e,n)||Td(t,n))return!0;for(let o=0;o<n.length;o+=1){const i=n[o],s=n[(o+1)%n.length];if(i&&s&&Ed(e,t,i,s)<=r)return!0}return!1}function Ad(e,t,n,r={}){if(r.isClosed&&void 0!==r.fill&&!C(r.fill)&&e.normalizedPoints.length>=3&&Td(n,e.normalizedPoints.map(dc)))return!0;if(r.isClosed&&function(e,t,n){if(0===t.length)return Number.POSITIVE_INFINITY;if(1===t.length)return e.dist(dc(t[0]));let r=Number.POSITIVE_INFINITY;for(let o=1;o<t.length;o+=1){const n=t[o-1],i=t[o];n&&i&&(r=Math.min(r,Id(e,dc(n),dc(i))))}return n&&t.length>=3&&(r=Math.min(r,Id(e,dc(t[t.length-1]),dc(t[0])))),r}(n,e.normalizedPoints,!0)<=Math.max(4,.5*t))return!0;if(0===e.outlineVertices.length)return!1;for(const o of e.outlinePolygons){if(Td(n,o))return!0;if(Cd(n,o)<=Math.max(4,.5*t))return!0}return!1}function Rd(e,t){return"number"==typeof e&&Number.isFinite(e)?e:t}function Nd(e){if(!e||"object"!=typeof e)return null;const t=e,n=Rd(t.x,NaN),r=Rd(t.y,NaN);if(!Number.isFinite(n)||!Number.isFinite(r))return null;const o=Rd(t.pressure,NaN);return t.x!==n||t.y!==r||void 0!==t.pressure&&t.pressure!==o||void 0!==t.segment&&"straight"!==t.segment?{x:n,y:r,...Number.isFinite(o)?{pressure:o}:null,..."straight"===t.segment?{segment:"straight"}:null}:e}function Ld(e){if(!e||"object"!=typeof e)return null;const t=e,n=function(e,t){if(!Array.isArray(e))return t;let n=!1;const r=[];for(const o of e){const e=Nd(o);e?(n=n||e!==o,r.push(e)):n=!0}return 0===r.length?t:n?r:e}(t.points,[]);return 0===n.length?null:n===t.points?e:{points:n}}function $d(e,t){if(!Array.isArray(e))return t;let n=!1;const r=[];for(const o of e){const e=Ld(o);e?(n=n||e!==o,r.push(e)):n=!0}return 0===r.length?t:n?r:e}var Dd=class extends oe{type="draw";getDefaultProps(){return{segments:hc([{x:0,y:0},{x:24,y:12}]),stroke:k("stroke-slate"),strokeWidth:4,fill:S("transparent"),isClosed:!1,isPen:!1}}validateProps(e){const t=e&&"object"==typeof e?e:{},n=this.getDefaultProps();return{segments:$d(t.segments,n.segments),stroke:I(t.stroke,n.stroke),strokeWidth:Math.max(4,Rd(t.strokeWidth,n.strokeWidth)),fill:I(t.fill,n.fill),isClosed:"boolean"==typeof t.isClosed?t.isClosed:n.isClosed,isPen:"boolean"==typeof t.isPen?t.isPen:n.isPen}}getPositionedBounds(e){const t=rd(e);return new h(e.x+t.localBounds.x,e.y+t.localBounds.y,t.localBounds.w,t.localBounds.h)}getLocalBounds(e){return rd(e).localBounds}getRenderBounds(e){return rd(e).renderBounds}getExportBounds(e){return this.getRenderBounds(e)}canReceiveTerminalBinding(e){return!0}getSelectionResizeLocalBounds(e){return this.getLocalBounds(e)}resizeSelectionBounds(e,t){const n=dd(e,{targetSelectionStrokeBounds:t.selectionLocalBounds,scaleX:t.scaleX,scaleY:t.scaleY,selectionRotation:t.selectionRotation,selectionRotationCenter:t.selectionRotationCenter});return{id:e.id,x:n.x,y:n.y,rotation:0,scaleX:1,scaleY:1,props:{segments:pd(n.segments)}}}flipSelectionBounds(e,t){const n=ud(e,{axis:t.axis,selectionMirrorBounds:t.selectionBounds,selectionRotation:t.selectionRotation,selectionRotationCenter:t.selectionRotationCenter});return{id:e.id,x:n.x,y:n.y,rotation:0,scaleX:1,scaleY:1,props:{segments:pd(n.segments)}}}getSelectionOverlayInfo(e){return{usesSelectionPathOverlay:!1,startPagePoint:null,endPagePoint:null,middlePagePoint:null,path:null,pathStyle:null}}isWrappedByBrush(e,t){return t.pageOutlineVertices.every(e=>t.brushBounds.containsPoint(e))}canSelectByBrush(e,t){if(this.isWrappedByBrush(e,t))return!0;if(t.isWrapping)return!1;const n=t.pageOutlineVertices;return!!n.some(e=>t.brushBounds.containsPoint(e))||function(e){const t=new p(e.minX,e.minY),n=new p(e.maxX,e.minY),r=new p(e.maxX,e.maxY),o=new p(e.minX,e.maxY);return[[t,n],[n,r],[r,o],[o,t]]}(t.brushBounds).some(([e,t])=>{for(let r=0;r<n.length;r+=1){const o=n[r],i=n[(r+1)%n.length];if(o&&i&&g(e,t,o,i))return!0}return!1})}getPositionedOutlineVertices(e){return ad(e).outlineVertices}hitTest(e,t){return Ad(ad(e),e.props.strokeWidth,t,{fill:e.props.fill,isClosed:e.props.isClosed})}hitTestLineSegment(e,t){return function(e,t,n,r,o={}){const i=Math.max(4,.5*t,o.margin??0);return!!(o.isClosed&&void 0!==o.fill&&!C(o.fill)&&e.normalizedPoints.length>=3&&Od(n,r,e.normalizedPoints.map(dc),i))||0!==e.outlineVertices.length&&e.outlinePolygons.some(e=>Od(n,r,e,i))}(ad(e),e.props.strokeWidth,t.positionedStart,t.positionedEnd,{fill:e.props.fill,isClosed:e.props.isClosed,margin:t.positionedMargin})}},jd=class{type="draw";toSvg(e,t){const n=rd(e);if(!n.path&&!n.selectionPath)return null;const r=[];return n.fillPath&&!C(e.props.fill)&&r.push({tag:"path",attrs:{d:n.fillPath,fill:t.resolveColor(e.props.fill),stroke:"none"}}),e.props.isClosed&&n.selectionPath?r.push({tag:"path",attrs:{d:n.selectionPath,fill:"none",stroke:t.resolveColor(e.props.stroke),"stroke-width":e.props.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round"}}):n.path&&r.push({tag:"path",attrs:{d:n.path,fill:t.resolveColor(e.props.stroke),stroke:"none"}}),{tag:"g",children:r}}};function Bd(){return{id:"land.draw",shapeUtils:[new Dd],shapeSvgExporters:[new jd],setup(e){e.tools.register("draw",e=>new fd(e))}}}function zd({shape:e,stroke:t=e.props.stroke,strokeWidth:n=e.props.strokeWidth}){const{fillPath:r,renderBounds:o,path:i,selectionPath:s}=rd({props:{...e.props,strokeWidth:n}});if(!i&&!s)return null;const a=E(t);
76
+ return(0,Jt.jsxs)("svg",{width:"100%",height:"100%",viewBox:`${o.x} ${o.y} ${Math.max(o.w,1)} ${Math.max(o.h,1)}`,style:{display:"block",overflow:"visible"},shapeRendering:"geometricPrecision",children:[r&&!C(e.props.fill)? (0,Jt.jsx)("path",{d:r,fill:E(e.props.fill),stroke:"none"}):null,e.props.isClosed&&s? (0,Jt.jsx)("path",{d:s,fill:"none",stroke:a,strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"}):i? (0,Jt.jsx)("path",{d:i,fill:a,stroke:"none"}):null]})}function _d({shape:e,strokeWidth:t}){const{path:n,renderBounds:r,selectionPath:o}=rd(e),i=o??n;return i? (0,Jt.jsx)("svg",{"data-ui":"draw-hover-outline",width:"100%",height:"100%",viewBox:`${r.x} ${r.y} ${Math.max(r.w,1)} ${Math.max(r.h,1)}`,style:{display:"block",overflow:"visible",pointerEvents:"none"},shapeRendering:"geometricPrecision",children: (0,Jt.jsx)("path",{d:i,fill:"none",stroke:pn,strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})}):null}function Fd(){return{id:"land.draw.react",shapeRenderers:[{type:"draw",component:Wd,hoverComponent:Hd}]}}function Wd({shape:e}){
77
+ return(0,Jt.jsx)(zd,{shape:e})}function Hd({shape:e,strokeWidth:t}){
78
+ return(0,Jt.jsx)(_d,{shape:e,strokeWidth:t})}var Ud={id:"draw",editor:Bd(),render:Fd(),api:Sd,setup:({editor:e})=>({api:Pd({editor:e})})};function Vd(e,t,n){return Math.max(t,Math.min(n,e))}function Kd(e,t,n){return e+(t-e)*n}function qd(e,t,n){if(void 0!==e||void 0!==t)return Kd(e??t??0,t??e??0,n)}function Yd(e,t,n){const r=Math.max(2,Math.round(t));if(0===e.length)return[];if(1===e.length)return Array.from({length:r},()=>({point:uc(e[0]),segmentWeight:0}));const o=function(e,t){const n=[];for(let r=1;r<e.length;r+=1){const t=e[r-1],o=e[r];t&&o&&n.push({start:t,end:o,length:dc(t).dist(dc(o)),segmentWeight:"straight"===o.segment?1:0})}if(t&&e.length>=3){const t=e[e.length-1],r=e[0];t&&r&&n.push({start:t,end:r,length:dc(t).dist(dc(r)),segmentWeight:1})}return n}(e,n),i=o.reduce((e,t)=>e+t.length,0);return 0===o.length||i<=1e-6?Array.from({length:r},()=>({point:uc(e[0]),segmentWeight:0})):Array.from({length:r},(e,t)=>{let s=n?t/r*i:t/Math.max(r-1,1)*i,a=o[o.length-1];for(const n of o){if(s<=n.length||n===a){a=n;break}s-=n.length}const l=a.length<=1e-6?0:Vd(s/a.length,0,1),c=dc(a.start),d=dc(a.end),u=p.Lrp(c,d,l),h=qd(a.start.pressure,a.end.pressure,l);return{point:{x:u.x,y:u.y,...void 0===h?null:{pressure:h}},segmentWeight:a.segmentWeight}})}function Xd(e,t,n,r={}){if(e.parentId!==t.parentId)throw new Error("Cannot interpolate draw shapes with different parents");const o=Vd(n,0,1),i=e.props.isClosed&&t.props.isClosed,s=ld(e),a=ld(t),l=(c=s.length,d=a.length,"number"==typeof(u=r.pointCount)&&Number.isFinite(u)?Math.max(2,Math.round(u)):Math.max(2,c,d,12));var c,d,u;const h=Yd(s,l,i),f=Yd(a,l,i),m=h.map((e,t)=>{const n=f[t]??f[f.length-1]??e,r=p.Lrp(dc(e.point),dc(n.point),o),i=qd(e.point.pressure,n.point.pressure,o),s=Kd(e.segmentWeight,n.segmentWeight,o);return{x:r.x,y:r.y,...void 0===i?null:{pressure:i},...t>0&&s>=.5?{segment:"straight"}:null}}),g=o<.5?e.props.isClosed:t.props.isClosed,y=o<.5?e.props.isPen??!1:t.props.isPen??!1,x=Math.max(1,Kd(e.props.strokeWidth,t.props.strokeWidth,o)),b=id(m,x,y,g),w=o<.5?e:t;return{...w,id:e.id,x:b.x,y:b.y,rotation:0,scaleX:1,scaleY:1,opacity:Kd(e.opacity,t.opacity,o),props:{...w.props,segments:Pc(b.segments),strokeWidth:x,isClosed:g,isPen:y}}}var Jd=R("plugin.eraser.runtime");function Gd(e,t){if(e.length!==t.length)return!1;const n=new Set(t);return e.every(e=>n.has(e))}function Zd(e){return e.runtime.require(Jd)}function Qd(e){return 4/e.state.camera.get().z}function eu(e,t,n,r){const o=[new p(t.minX,t.minY),new p(t.maxX,t.minY),new p(t.maxX,t.maxY),new p(t.minX,t.maxY)].map(e=>n.applyToPoint(e));let i=0,s=Number.POSITIVE_INFINITY;for(let a=0;a<o.length;a+=1){const t=o[a],n=o[(a+1)%o.length].sub(t),r=e.sub(t),l=n.x*r.y-n.y*r.x;if(Math.abs(l)<=1e-8)return!1;const c=Math.sign(l);if(0===i)i=c;else if(c!==i)return!1;const d=n.len2(),u=0===d?0:Math.max(0,Math.min(1,(r.x*n.x+r.y*n.y)/d));s=Math.min(s,e.dist(t.add(n.mul(u))))}return s>r}function tu(e,t){const n=new Set,r=Qd(e);for(const o of e.shapes.hitTestPoint(t,{hitTest:"bindingTarget"})){const i=e.shapes.getUtil(o);if(!i.canReceiveChildren(o))continue;const s=i.getChildClipLocalBounds(o);s&&(eu(t,s,e.shapes.computeLocalToPageTransform(o),r)&&n.add(o.id))}return n}function nu(e,t,n){return n.protectedContainerIds.has(t.id)||e.layers.isOrAncestorLocked(t.id)||e.shapes.getUtil(t).canReceiveChildren(t)&&e.layers.hasLockedDescendant(t.id)?null:t.id}function ru(e,t,n,r){const o=r.topMostOnly?n.slice(0,1):n;for(const i of o){const n=nu(e,i,t);n&&t.erasingShapeIds.add(n)}}function ou(e,t,n){ru(e,t,e.shapes.hitTestPoint(n.pagePoint),{topMostOnly:n.accelKey})}function iu(e,t,n){ru(e,t,e.shapes.hitTestLineSegment(t.previousPagePoint,n.pagePoint,{margin:Qd(e)}),{topMostOnly:n.accelKey})}function su(e,t){const n=e.trail[e.trail.length-1];n&&n.dist2(t)<=1e-6||e.trail.push(t.clone())}function au(e,t){Zd(e).setPreview(Array.from(t.erasingShapeIds),t.trail)}function lu(e){Zd(e).clear()}var cu=class extends ie{constructor(e){super(e,"eraser"),this.initial="idle",this.addChild(new du(e,this)),this.addChild(new uu(e,this)),this.addChild(new pu(e,this))}onExit(){lu(this.editor)}},du=class extends ie{constructor(e,t){super(e,"idle",t)}onEnter(){lu(this.editor)}onPointerDown(e){0===e.button&&this.transition("pointing",function(e,t){const n={originScreenPoint:t.screenPoint.clone(),previousPagePoint:t.pagePoint.clone(),protectedContainerIds:tu(e,t.pagePoint),erasingShapeIds:new Set,trail:[t.pagePoint.clone()]};return ou(e,n,t),au(e,n),n}(this.editor,e))}},uu=class extends ie{info=null;constructor(e,t){super(e,"pointing",t)}onEnter(e){this.info=e}onPointerMove(e){this.info&&function(e,t){return e.dist2(t)>=9}(this.info.originScreenPoint,e.screenPoint)&&(iu(this.editor,this.info,e),su(this.info,e.pagePoint),this.info.previousPagePoint=e.pagePoint.clone(),au(this.editor,this.info),this.transition("erasing",this.info))}onPointerUp(e){this.info&&(ou(this.editor,this.info,e),au(this.editor,this.info),hu(this.editor,this.info)),this.transition("idle")}onCancel(){lu(this.editor),this.transition("idle")}onExit(){this.info=null}},pu=class extends ie{info=null;constructor(e,t){super(e,"erasing",t)}onEnter(e){this.info=e}onPointerMove(e){this.update(e)}onPointerUp(e){this.update(e),this.info&&hu(this.editor,this.info),this.transition("idle")}onCancel(){lu(this.editor),this.transition("idle")}onExit(){this.info=null}update(e){this.info&&(iu(this.editor,this.info,e),su(this.info,e.pagePoint),this.info.previousPagePoint=e.pagePoint.clone(),au(this.editor,this.info))}};function hu(e,t){const n=Array.from(t.erasingShapeIds);lu(e),0!==n.length&&e.commands.deleteShapes(n,{source:"user"})}function fu(){return{id:"land.eraser.react",canvasOverlays:[{id:"land.eraser.trail-overlay",component:mu}],shapeOpacityModifiers:[{id:"land.eraser.preview-opacity",getOpacityValue(e,t){const n=Zd(e).erasingShapeIdSetSignal;return{graph:e.signals,get:()=>e.layers.isOrAncestorInSet(t,n.get())?.32:1}}}]}}var mu=(0,Vt.memo)(function(){return sn(Zd(qt()).trailActiveSignal)? (0,Jt.jsx)(gu,{}):null}),gu=(0,Vt.memo)(function(){const e=qt(),t=sn(Zd(e).trailSignal),n=sn(e.state.cameraZoom),r=Math.max(n,1e-4),o=function(){const[e,t]=(0,Vt.useState)(()=>Cu());return(0,Vt.useEffect)(()=>{if("undefined"==typeof window)return;let e=0;const n=r=>{t(r),e=window.requestAnimationFrame(n)};return e=window.requestAnimationFrame(n),()=>{window.cancelAnimationFrame(e)}},[]),e}(),i=(0,Vt.useRef)({samples:[],sourceLength:0}),s=Math.max(o,Cu());!function(e,t,n,r){Au(e,r),t.length<e.sourceLength&&(e.samples=[],e.sourceLength=0);if(t.length===e.sourceLength)return;const o=e.sourceLength,i=t.length-o,s=e.samples[e.samples.length-1]?.time??r-Pu*i;for(let a=o;a<t.length;a++){const l=t[a],c=(a-o+1)/i;Ou(e,{x:l.x,y:l.y},n,Wu(s,r,c))}e.sourceLength=t.length,Au(e,r)}(i.current,t,r,s);const a=function(e,t){const n=Ru(e,t);return function(e,t){if(e.length<=1)return[...e];const n=.15+.85*(1-t),r=[e[0]];for(let o=1;o<e.length;o++)r.push(Fu(r[r.length-1],e[o],n));return r}(n.length>xu?n.slice(-48):n,vu)}(i.current.samples,s);if(0===a.length)return null;const l=(d=wu/r,0===(c=a).length||d<=0?null:1===c.length?Vu(Lu(c[0],d/2,Su))??"":Vu(function(e){if(0===e.length)return[];if(1===e.length)return Lu(e[0].point,Math.max(e[0].radius,.01),Su);const t=[],n=[];for(const a of e){const e=ju(a.direction);Uu(t,zu(a.point,_u(e,a.radius))),Uu(n,Bu(a.point,_u(e,a.radius)))}const r=[];for(const a of t)Uu(r,a);const o=e[e.length-1],i=ju(o.direction),s=function({center:e,direction:t,normal:n,radius:r}){if(r<=0)return[];const o=[];for(let i=1;i<ku;i++){const s=i/ku;o.push(Bu(e,Bu(_u(t,Math.sin(Math.PI*s)*r),_u(n,-Math.cos(Math.PI*s)*r))))}return o}({center:o.point,direction:o.direction,normal:i,radius:o.radius});for(const a of s)Uu(r,a);for(let a=n.length-1;a>=0;a--)Uu(r,n[a]);return r}(function(e,t){const n=function(e){const t=[0];for(let n=1;n<e.length;n++)t.push(t[n-1]+$u(e[n-1],e[n]));return t}(e),r=n[n.length-1]??0,o=Math.max(t,r);return e.map((r,i)=>{const s=n[i]??0,a=Hu(s/o,0,1);return{point:r,direction:Nu(e,i),radius:t/2*a,runningLength:s}})}(c,d))));var c,d;return l? (0,Jt.jsx)("g",{"data-ui":"eraser-trail-overlay",children: (0,Jt.jsx)("path",{"data-ui":"eraser-trail-scribble",d:l,fill:yu})}):null}),yu="rgba(142, 142, 142, 0.16)",xu=48,bu=1,wu=12,vu=.32,ku=8,Su=13,Pu=16,Mu=8,Iu=180,Eu=180,Tu=680;function Cu(){return"undefined"==typeof performance?Date.now():performance.now()}function Ou(e,t,n,r){const o=e.samples[e.samples.length-1];if(!o)return void e.samples.push({...t,time:r,velocity:0});const i=bu/n,s=$u(o,t);if(s<i)return void(e.samples[e.samples.length-1]={...o,...t,time:r});const a=s*n/Math.max(Mu,r-o.time);e.samples.push({...t,time:r,velocity:Wu(o.velocity,a,.68)})}function Au(e,t){e.samples=Ru(e.samples,t)}function Ru(e,t){const n=e[e.length-1];if(!n)return[];const r=t-Hu(Iu+n.velocity*Eu,Iu,Tu);if(n.time<r)return[];const o=e.findIndex(e=>e.time>=r);if(-1===o)return[];const i=e.slice(o),s=e[o-1],a=i[0];return s&&a.time>r?[(l=s,c=a,d=Hu((r-s.time)/(a.time-s.time),0,1),{...Fu(l,c,d),time:Wu(l.time,c.time,d),velocity:Wu(l.velocity,c.velocity,d)}),...i]:i;var l,c,d}function Nu(e,t){if(e.length<=1)return{x:1,y:0};const n=e[t-1]??e[t],r=e[t+1]??e[t];return function(e){const t=Math.sqrt(e.x*e.x+e.y*e.y);return t<=0?{x:1,y:0}:{x:e.x/t,y:e.y/t}}(0===t?zu(r,e[t]):t===e.length-1?zu(e[t],n):zu(r,n))}function Lu(e,t,n){const r=[];for(let o=0;o<n;o++){const i=2*Math.PI*o/n;r.push({x:e.x+Math.cos(i)*t,y:e.y+Math.sin(i)*t})}return r}function $u(e,t){return Math.sqrt(Du(e,t))}function Du(e,t){const n=e.x-t.x,r=e.y-t.y;return n*n+r*r}function ju(e){return{x:-e.y,y:e.x}}function Bu(e,t){return{x:e.x+t.x,y:e.y+t.y}}function zu(e,t){return{x:e.x-t.x,y:e.y-t.y}}function _u(e,t){return{x:e.x*t,y:e.y*t}}function Fu(e,t,n){return{x:Wu(e.x,t.x,n),y:Wu(e.y,t.y,n)}}function Wu(e,t,n){return e+(t-e)*n}function Hu(e,t,n){return Math.max(t,Math.min(n,e))}function Uu(e,t){const n=e[e.length-1];!n||Du(n,t)>.04?e.push(t):e[e.length-1]=t}function Vu(e){if(e.length<2)return null;if(2===e.length)return`M ${qu(e[0])} L ${qu(e[1])} Z`;const t=[`M ${qu(Ku(e[0],e[1]))}`];for(let n=1;n<e.length;n++){const r=e[n],o=e[(n+1)%e.length];t.push(`Q ${qu(r)} ${qu(Ku(r,o))}`)}return t.push("Z"),t.join(" ")}function Ku(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}function qu(e){return`${Yu(e.x)},${Yu(e.y)}`}function Yu(e){return Number.isInteger(e)?`${e}`:e.toFixed(3)}function Xu(){return{id:"land.eraser",setup(e){e.runtime.provide(Jd,function(e){const{atom:t,computed:n}=e.signals,r=t("eraser.shapeIds",[],{isEqual:Gd}),o=n("eraser.shapeIdSet",()=>new Set(r.get())),i=t("eraser.trail",[]);return{erasingShapeIdsSignal:r,erasingShapeIdSetSignal:o,trailSignal:i,trailActiveSignal:n("eraser.trailActive",()=>i.get().length>1),setPreview(e,t){r.set(Array.from(new Set(e))),i.set(t.map(e=>e.clone()))},clear(){r.set([]),i.get().length>0&&i.set([])}}}(e)),e.tools.register("eraser",e=>new cu(e))}}}var Ju={id:"eraser",editor:Xu(),render:fu()};function Gu(e){return/^\s*$/.test(e)?"Frame":e}function Zu(e){return new h(0,-34,e.props.w,e.props.h+34)}function Qu(e,t){return"number"==typeof e&&Number.isFinite(e)?e:t}function ep(e){return new h(e.x,e.y-34,e.props.w,34)}function tp(e,t,n){const r=n/2;return!!e.expand(r).containsPoint(t)&&(Math.abs(t.x-e.minX)<=r||Math.abs(t.x-e.maxX)<=r||Math.abs(t.y-e.minY)<=r||Math.abs(t.y-e.maxY)<=r)}var np=class extends oe{type="frame";getDefaultProps(){return{w:640,h:360,name:"",fill:S("transparent"),stroke:k("stroke-muted"),strokeWidth:1}}validateProps(e){const t=e&&"object"==typeof e?e:{},n=this.getDefaultProps();return{w:Math.max(1,Qu(t.w,n.w)),h:Math.max(1,Qu(t.h,n.h)),name:"string"==typeof t.name?t.name:n.name,fill:I(t.fill,n.fill),stroke:I(t.stroke,n.stroke),strokeWidth:Math.max(0,Qu(t.strokeWidth,n.strokeWidth))}}getLocalBounds(e){return new h(0,0,e.props.w,e.props.h)}getRenderBounds(e){return Zu(e)}getPointHitTestBounds(e){const t=this.getPositionedBounds(e).expand(3),n=ep(e);return h.FromPoints([new p(t.minX,t.minY),new p(t.maxX,t.maxY),new p(n.minX,n.minY),new p(n.maxX,n.maxY)])}canEdit(e){return!0}canReceiveChildren(e){return!0}canSnapChildrenToSelf(e){return!0}canReceiveTerminalBinding(e){return!0}getSelectionResizeHandleIds(e,t){return z}shouldRotateDescendants(e){return!0}getChildClipLocalBounds(e){return this.getLocalBounds(e)}canSelectByBrush(e,t){return super.isWrappedByBrush(e,t)}hitTest(e,t){return ep(e).containsPoint(t)||tp(this.getPositionedBounds(e),t,6)}hitTestBindingTarget(e,t){return this.getPositionedBounds(e).containsPoint(t)}hitTestLineSegment(e,t){return function(e,t,n,r){const o=r/2;if(tp(e,t,r)||tp(e,n,r))return!0;const i=[new p(e.minX,e.minY),new p(e.maxX,e.minY),new p(e.maxX,e.maxY),new p(e.minX,e.maxY)];for(let s=0;s<i.length;s+=1){const e=i[s],r=i[(s+1)%i.length];if(e&&r&&y(t,n,e,r)<=o)return!0}return!1}(this.getPositionedBounds(e),t.positionedStart,t.positionedEnd,Math.max(6,t.positionedMargin))}},rp=ut("plugin-frame.api");function op({editor:e}){return function({editor:e}){return{create(t){const n=e.shapes.getDefaultProps("frame"),[r]=e.commands.createShapes([{type:"frame",x:t.x,y:t.y,meta:t.meta?{...t.meta}:void 0,props:{...n,w:t.w??n.w,h:t.h??n.h,name:t.name??n.name,fill:t.fill??n.fill,stroke:t.stroke??n.stroke,strokeWidth:t.strokeWidth??n.strokeWidth}}],{source:"user"});return"frame"===r?.type?{id:r.id,type:r.type}:null},moveShapesToFrame(t,n){const r=e.shapes.get(n);if(!r||"frame"!==r.type)return[];const o=t.filter(t=>{const n=e.shapes.get(t);return!!n&&!n.isLocked});return o.length>0&&e.commands.reparentShapes({ids:[...o],parentId:n},{source:"user"}),o},getSelectionStyle(){const t=e.state.selectedShapes.get().filter(ip);return 0===t.length?null:{name:sp(t.map(e=>e.props.name)),fill:ap(t.map(e=>e.props.fill)),stroke:ap(t.map(e=>e.props.stroke)),strokeWidth:sp(t.map(e=>e.props.strokeWidth))}},setSelectionStyle(t){const n=e.state.selectedShapes.get().filter(ip).filter(e=>!e.isLocked).map(e=>({id:e.id,props:{...t}}));return n.length>0&&e.commands.updateShapes(n,{source:"user"}),n.map(({id:e})=>e)},getToolDefaults:()=>e.shapes.getDefaultProps("frame"),setToolDefaults:t=>(e.shapes.updateDefaultProps("frame",t),e.shapes.getDefaultProps("frame")),getSelectedChildOrderState(){const t=e.layers.getSelectionSiblingOrderState();if(!t||!t.parentId.startsWith("shape:"))return null;const n=e.shapes.get(t.parentId);return n&&"frame"===n.type?{index:t.index,count:t.count,canMoveBackward:e.layers.canMoveSelectionWithinParent("backward"),canMoveForward:e.layers.canMoveSelectionWithinParent("forward")}:null},moveSelectedChild:t=>e.layers.move(e.selection.getIds(),t,"user")}}({editor:e})}function ip(e){return"frame"===e.type}function sp(e){const t=e[0];return void 0!==t&&e.every(e=>e===t)?t:null}function ap(e){const t=e[0];return t&&e.every(e=>O(e,t))?t:null}var lp=class extends ie{constructor(e){super(e,"frame"),this.initial="idle",this.addChild(new cp(e,this)),this.addChild(new dp(e,this))}getDefaultProps(){return this.editor.shapes.getDefaultProps("frame")}},cp=class extends ie{constructor(e,t){super(e,"idle",t)}onEnter(){this.editor.interaction.clearSelection()}onPointerDown(e){this.transition("creating",{originPagePoint:e.pagePoint.clone(),originScreenPoint:e.screenPoint.clone(),currentPagePoint:e.pagePoint.clone(),shapeId:null,shiftKey:e.shiftKey})}},dp=class extends ie{tool;info=null;operation=null;constructor(e,t){super(e,"creating",t),this.tool=t}onEnter(e){this.info=e,this.operation=this.editor.operations.begin({kind:"frame.create",label:"shape.create",source:"user",history:"record"})}onPointerMove(e){this.updateShape(e.pagePoint,e.screenPoint,e.shiftKey)}onPointerUp(e){this.info?(this.updateShape(e.pagePoint,e.screenPoint,e.shiftKey,!0),this.commitOperation(),this.editor.state.tool.get().isToolLocked?this.transition("idle"):this.editor.commands.setActiveTool("select",{source:"system"})):this.transition("idle")}onCancel(){this.cancelOperation(),this.transition("idle")}onExit(){this.cancelOperation(),this.info=null}commitOperation(){const e=this.operation;this.operation=null,e?.commit()}cancelOperation(){const e=this.operation;this.operation=null,e?.isActive&&e.cancel()}updateShape(e,t,n,r=!1){if(!this.info)return;this.info.currentPagePoint=e.clone(),this.info.shiftKey=n;const o=this.info.originScreenPoint.dist(t);if(!this.info.shapeId&&o<4){if(!r)return;const t=function(e,t){return new h(e.x-t.w/2,e.y-t.h/2,t.w,t.h)}(e,this.tool.getDefaultProps()),n=this.createShape(t);return void(this.info.shapeId=n.id)}const i=function(e,t,n,r){let o=t.x-e.x,i=t.y-e.y;if(n){const e=r.w/r.h,t=Math.abs(o),n=Math.abs(i);0===n||t/Math.max(n,1)>=e?i=t/e*(i<0?-1:1):o=n*e*(o<0?-1:1)}const s=new p(e.x+o,e.y+i);return new h(Math.min(e.x,s.x),Math.min(e.y,s.y),Math.max(Math.abs(s.x-e.x),1),Math.max(Math.abs(s.y-e.y),1))}(this.info.originPagePoint,e,n,this.tool.getDefaultProps());if(!this.info.shapeId){const e=this.createShape(i);return void(this.info.shapeId=e.id)}this.editor.commands.updateShapes([{id:this.info.shapeId,x:i.x,y:i.y,props:{w:i.w,h:i.h}}],{source:"user"})}createShape(e){const[t]=this.editor.commands.createShapes([{type:"frame",x:e.x,y:e.y,props:{...this.tool.getDefaultProps(),w:e.w,h:e.h}}],{source:"user",autoReparent:!1});if(!t||"frame"!==t.type)throw new Error("Failed to create frame shape");return this.editor.commands.setSelectedShapeIds([t.id],{source:"system"}),t}};var up=class{type="frame";toSvg(e,t){const{fill:n,stroke:r,strokeWidth:o,w:i,h:s,name:a}=e.props,l=t.resolveColor(r),c=o/2;return{tag:"g",children:[{tag:"rect",attrs:{x:c,y:c,width:Math.max(i-o,0),height:Math.max(s-o,0),fill:t.resolveColor(n),stroke:l,"stroke-width":o,"stroke-linejoin":"round","stroke-linecap":"round"}},{tag:"text",attrs:{x:0,y:-8,fill:l,"font-family":"Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif","font-size":12,"font-weight":400},children:[Gu(a)]}]}}};function pp(){return{id:"land.frame",shapeUtils:[new np],shapeSvgExporters:[new up],setup(e){e.tools.register("frame",e=>new lp(e))}}}var hp='[data-ui="frame-canvas-name"]',fp=["Inter","ui-sans-serif","system-ui","-apple-system","BlinkMacSystemFont","'Segoe UI'","sans-serif"].join(", "),mp={id:"land.frame.name.dom-events",handle({event:e}){const t=e.target;return t instanceof Element&&t.closest(hp)?"handled":"continue"},getCursor:({element:e})=>e?.closest(hp)?"text":void 0};function gp(){return{id:"land.frame.react",domEventGuards:[mp],shapeRenderers:[{type:"frame",component:yp,hoverComponent:bp}]}}function yp({editor:e,shape:t,shapeEditingSession:n}){const r=n?.shapeId===t.id;
79
+ return(0,Jt.jsxs)("div",{style:{height:"100%",overflow:"visible",position:"relative",width:"100%"},children:[ (0,Jt.jsx)(xp,{shape:t,hideName:!0}), (0,Jt.jsx)(wp,{editor:e,shape:t,isEditing:r})]})}function xp({shape:e,hideName:t=!1}){const{fill:n,h:r,name:o,stroke:i,strokeWidth:s,w:a}=e.props,l=s/2,c=Math.max(a-s,0),d=Math.max(r-s,0),u=Gu(o),p=Zu(e);
80
+ return(0,Jt.jsxs)("svg",{width:"100%",height:"100%",viewBox:`${p.x} ${p.y} ${p.w} ${p.h}`,style:{display:"block",overflow:"visible"},shapeRendering:"geometricPrecision",children:[ (0,Jt.jsx)("rect",{x:l,y:l,width:c,height:d,fill:E(n),stroke:E(i),strokeWidth:s,strokeLinejoin:"round",strokeLinecap:"round"}),t?null: (0,Jt.jsx)("text",{x:0,y:-8,fill:E(i),fontFamily:fp,fontSize:12,fontWeight:400,style:{userSelect:"none"},children:u})]})}function bp({shape:e,strokeWidth:t}){const{h:n,w:r}=e.props,o=Zu(e);
81
+ return(0,Jt.jsx)("svg",{"data-ui":"frame-hover-outline",width:"100%",height:"100%",viewBox:`${o.x} ${o.y} ${o.w} ${o.h}`,style:{display:"block",overflow:"visible",pointerEvents:"none"},shapeRendering:"geometricPrecision",children: (0,Jt.jsx)("rect",{x:0,y:0,width:r,height:n,fill:"none",stroke:pn,strokeWidth:t,strokeLinejoin:"round",strokeLinecap:"round",vectorEffect:"non-scaling-stroke"})})}function wp({editor:e,shape:t,isEditing:n}){const r=(0,Vt.useRef)(null),[o,i]=(0,Vt.useState)(!1),s=sn(e.state.cameraZoom),a=sn(e.shapes.getLocalToPageTransformSignal(t.id)),l=Math.max(s,1e-4),c=Math.min(1/l,3.5),d=function(e){const t=2*Math.PI,n=(e%t+t)%t;return Math.floor(2*(n+Math.PI/4)/Math.PI%4)}(a?Math.atan2(a.b,a.a):0),u=0===d||2===d?t.props.w:t.props.h,p=function(e,t){switch(t){case 0:return"";case 1:return`translate(0px, ${e.props.h}px) rotate(270deg)`;case 2:return`translate(${e.props.w}px, ${e.props.h}px) rotate(180deg)`;case 3:return`translate(${e.props.w}px, 0px) rotate(90deg)`}}(t,d),h=Gu(t.props.name);(0,Vt.useEffect)(()=>{const e=r.current;n&&e&&(e.focus(),e.select())},[n]);const f=(0,Vt.useCallback)(()=>{e.editing.canEditShape(t)&&e.editing.start({shapeId:t.id,entryMode:"selectAll",operationKind:"frame.edit"},"user")},[e,t]),m=(0,Vt.useCallback)(n=>{e.commands.updateShapes([{id:t.id,props:{name:n.currentTarget.value}}],{source:"user"})},[e,t.id]),g=(0,Vt.useCallback)(t=>{e.editing.complete("user")},[e]),y=(0,Vt.useCallback)(t=>{e.editing.setComposition(!0,"system")},[e]),x=(0,Vt.useCallback)(t=>{e.editing.setComposition(!1,"system")},[e]),b=(0,Vt.useCallback)(t=>{if(t.stopPropagation(),!t.nativeEvent.isComposing)return"Enter"===t.key?(t.preventDefault(),void e.editing.complete("user")):void("Escape"===t.key&&(t.preventDefault(),e.editing.cancel("user")))},[e]),w=(0,Vt.useCallback)(e=>{e.stopPropagation()},[]),v=(0,Vt.useCallback)(e=>{e.stopPropagation(),n||f()},[n,f]);
82
+ return(0,Jt.jsx)("div",{style:{height:0,left:0,overflow:"visible",pointerEvents:"none",position:"absolute",top:34,width:0},children: (0,Jt.jsx)("div",{"data-ui":"frame-canvas-heading","data-shape-id":t.id,style:{alignItems:"center",bottom:0,display:"flex",fontFamily:fp,fontSize:12,fontWeight:400,maxWidth:u*l+24,minWidth:32,overflow:"visible",paddingBottom:4,pointerEvents:t.isLocked?"none":"auto",position:"absolute",transform:`${p} scale(${c}) translateX(-7px)`,transformOrigin:"0 100%",userSelect:"none",whiteSpace:"pre"},children: (0,Jt.jsxs)("div",{style:{alignItems:"center",background:"var(--land-canvas-bg, white)",borderRadius:4,boxShadow:"inset 0 0 0 1px var(--land-canvas-bg, white)",color:"var(--land-text-primary, #0f172a)",display:"flex",height:24,pointerEvents:"auto",width:"100%"},children:[ (0,Jt.jsx)("div",{"aria-hidden":"true","data-ui":"frame-drag-handle",onPointerEnter:()=>i(!0),onPointerLeave:()=>i(!1),style:{alignItems:"center",backgroundColor:o?"rgba(37, 99, 235, 0.12)":"transparent",borderRadius:4,boxShadow:o?"inset 0 0 0 1px rgba(37, 99, 235, 0.28)":"none",cursor:"grab",display:"flex",flex:"0 0 28px",height:28,justifyContent:"center",pointerEvents:"auto",transition:"background-color 120ms ease, box-shadow 120ms ease"},children: (0,Jt.jsxs)("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"currentColor",children:[
83
+
84
+ (0,Jt.jsx)("circle",{cx:"3",cy:"3",r:"1"}),
85
+
86
+ (0,Jt.jsx)("circle",{cx:"7",cy:"3",r:"1"}),
87
+
88
+ (0,Jt.jsx)("circle",{cx:"3",cy:"7",r:"1"}),
89
+
90
+ (0,Jt.jsx)("circle",{cx:"7",cy:"7",r:"1"}),
91
+
92
+ (0,Jt.jsx)("circle",{cx:"3",cy:"11",r:"1"}),
93
+
94
+ (0,Jt.jsx)("circle",{cx:"7",cy:"11",r:"1"})]})}), (0,Jt.jsxs)("div",{"data-ui":"frame-canvas-name","data-shape-id":t.id,role:n?void 0:"button","aria-label":n?void 0:`Edit frame name: ${h}`,onClick:v,onPointerDown:w,style:{background:n?"var(--land-surface-bg, white)":void 0,borderRadius:4,boxShadow:n?"inset 0 0 0 1.5px var(--land-selection, #2563eb)":void 0,color:n?"transparent":"inherit",cursor:"text",height:n?"100%":void 0,minWidth:n?32:void 0,overflow:n?"visible":"hidden",padding:"0 6px 0 0",pointerEvents:"auto",position:"relative",textOverflow:"ellipsis",whiteSpace:"pre",width:n?"auto":void 0},children:[ (0,Jt.jsx)("input",{ref:r,"data-ui":"frame-canvas-name-input","data-shape-id":t.id,"aria-label":"Frame name",value:t.props.name,autoComplete:"off",disabled:!n,readOnly:!n,spellCheck:!1,onBlur:g,onChange:m,onCompositionStart:y,onCompositionEnd:x,onKeyDown:b,onPointerDown:w,style:{background:"none",border:0,borderRadius:4,boxSizing:"border-box",color:"var(--land-text-primary, #0f172a)",cursor:"text",display:n?void 0:"none",font:"inherit",height:"100%",inset:0,lineHeight:"24px",minWidth:0,outline:0,padding:"0 6px",position:"absolute",userSelect:"text",width:"100%"}}),h+String.fromCharCode(8203)]})]})})})}var vp={id:"frame",editor:pp(),render:gp(),api:rp,setup:({editor:e})=>({api:op({editor:e})})},kp=1e-4,Sp=1e-4,Pp="image.crop",Mp=[{label:"1:1",value:"1:1",ratio:1},{label:"4:3",value:"4:3",ratio:4/3},{label:"16:9",value:"16:9",ratio:16/9}],Ip={top_left:"nwse-resize",top:"ns-resize",top_right:"nesw-resize",right:"ew-resize",bottom_right:"nwse-resize",bottom:"ns-resize",bottom_left:"nesw-resize",left:"ew-resize"},Ep=["top_left","top","top_right","right","bottom_right","bottom","bottom_left","left"];function Tp(e){return Math.min(1,Math.max(0,e))}function Cp(e,t,n){return Math.min(n,Math.max(t,e))}function Op(e){return!!e&&"object"==typeof e&&"number"==typeof e.x&&Number.isFinite(e.x)&&"number"==typeof e.y&&Number.isFinite(e.y)}function Ap(e,t){const n=Tp(e),r=Tp(t);let o=Math.min(n,r),i=Math.max(n,r);if(i-o<kp){const e=(o+i)/2;o=Math.max(0,Math.min(.9999,e-5e-5)),i=o+kp}return{min:o,max:i}}function Rp(e){if(!e||"object"!=typeof e)return null;const t=e;if(!Op(t.topLeft)||!Op(t.bottomRight))return null;const n=Ap(t.topLeft.x,t.bottomRight.x),r=Ap(t.topLeft.y,t.bottomRight.y);return{topLeft:{x:n.min,y:r.min},bottomRight:{x:n.max,y:r.max}}}function Np(e){const t=Rp(e);if(!t)return null;const n=t.topLeft.x,r=t.topLeft.y,o=t.bottomRight.x,i=t.bottomRight.y;return{left:n,top:r,right:o,bottom:i,width:o-n,height:i-r}}function Lp(e){return Np(e)??{left:0,top:0,right:1,bottom:1,width:1,height:1}}function $p(e,t){return Math.abs(e.left-t.left)<=Sp&&Math.abs(e.top-t.top)<=Sp&&Math.abs(e.right-t.right)<=Sp&&Math.abs(e.bottom-t.bottom)<=Sp}function Dp(e){return function(e){return Math.abs(e.left)<=Sp&&Math.abs(e.top)<=Sp&&Math.abs(1-e.right)<=Sp&&Math.abs(1-e.bottom)<=Sp}(e)?null:Rp({topLeft:{x:e.left,y:e.top},bottomRight:{x:e.right,y:e.bottom}})}function jp({centerX:e,centerY:t,height:n,width:r}){const o=Cp(r,kp,1),i=Cp(n,kp,1),s=Cp(e-o/2,0,1-o),a=Cp(t-i/2,0,1-i);return{left:s,top:a,right:s+o,bottom:a+i,width:o,height:i}}function Bp(e){return{x:e.left+e.width/2,y:e.top+e.height/2}}function zp({crop:e,shape:t}){const n=Lp(e);return{w:t.props.w/n.width,h:t.props.h/n.height}}function _p(e){const t=e.props.w/e.props.h;for(const n of Mp)if(Math.abs(t-n.ratio)<=.01)return n.value;return null}function Fp(e,t){return t===Wp(e.id)}function Wp(e){return`image.crop:edit:${e}`}function Hp({localToPage:e,shape:t}){const n=t.props.w,r=t.props.h,o=(0+n)/2,i=(0+r)/2,s={top_left:new p(0,0),top:new p(o,0),top_right:new p(n,0),right:new p(n,i),bottom_right:new p(n,r),bottom:new p(o,r),bottom_left:new p(0,r),left:new p(0,i)};return Ep.map(t=>{return{kind:"custom",type:Pp,id:t,point:e.applyToPoint(s[t]),cursor:(n=t,Ip[n])};var n})}function Up({change:e,crop:t,shape:n}){const r=zp({crop:t,shape:n}),o=t.bottomRight.x-t.topLeft.x,i=t.bottomRight.y-t.topLeft.y,s=Cp(t.topLeft.x-e.x/r.w,0,1-o),a=Cp(t.topLeft.y-e.y/r.h,0,1-i),l=Rp({topLeft:{x:s,y:a},bottomRight:{x:s+o,y:a+i}});return l?{id:n.id,props:{crop:l}}:null}function Vp({preset:e,shape:t}){const n=Bp(Lp(t.props.crop)),r=zp({crop:t.props.crop,shape:t}),o=Mp.find(t=>t.value===e)?.ratio??null;if(!o)return null;const i=o*(r.h/r.w);let s=1,a=s/i;return a>1&&(a=1,s=a*i),function({nextRect:e,shape:t}){const n=Lp(t.props.crop);if($p(n,e))return null;const r=zp({crop:t.props.crop,shape:t}),o=new p((e.left-n.left)*r.w,(e.top-n.top)*r.h).rot(t.rotation);return{id:t.id,x:t.x+o.x,y:t.y+o.y,props:{w:e.width*r.w,h:e.height*r.h,crop:Dp(e)}}}({nextRect:jp({centerX:n.x,centerY:n.y,width:s,height:a}),shape:t})}function Kp(e){return Number.isFinite(e)?Number(e.toFixed(4)).toString():"0"}var qp=new WeakMap;function Yp(e,t){return qp.get(e)?.get(t)??null}function Xp(e,t){const n=qp.get(e);n&&(n.delete(t),0===n.size&&qp.delete(e))}function Jp(e){return d(e)&&"image"===e.type}function Gp(e){return c(e)&&"image"===e.type}var Zp={propagation:"stop"};function Qp({handleId:e,shapeId:t,startPagePoint:n,startPageToLocal:r,startShape:o,startCrop:i}){return{shapeId:t,operationKind:"image.crop.handle",update({editor:s,pagePoint:a,source:l}){if(!Gp(s.shapes.get(t)))return"stop";const c=function({handleId:e,pageToLocal:t,shape:n,startCrop:r,startPagePoint:o,currentPagePoint:i}){const s=Rp(r)??{topLeft:{x:0,y:0},bottomRight:{x:1,y:1}},a=zp({crop:s,shape:n});if(a.w<8||a.h<8)return null;const l=t.applyToPoint(o),c=t.applyToPoint(i).sub(l);if(0===c.x&&0===c.y)return null;const d={x:s.topLeft.x*a.w,y:s.topLeft.y*a.h,w:(s.bottomRight.x-s.topLeft.x)*a.w,h:(s.bottomRight.y-s.topLeft.y)*a.h},u=d.x+d.w,h=d.y+d.h;let f=d.x,m=d.y,g=d.w,y=d.h;!function(e){return"top_left"===e||"left"===e||"bottom_left"===e}(e)?function(e){return"top_right"===e||"right"===e||"bottom_right"===e}(e)&&(g=Cp(u+c.x,d.x+8,a.w)-f):(f=Cp(f+c.x,0,u-8),g=u-f),function(e){return"top_left"===e||"top"===e||"top_right"===e}(e)?(m=Cp(m+c.y,0,h-8),y=h-m):function(e){return"bottom_left"===e||"bottom"===e||"bottom_right"===e}(e)&&(y=Cp(h+c.y,d.y+8,a.h)-m);const x=Rp({topLeft:{x:f/a.w,y:m/a.h},bottomRight:{x:(f+g)/a.w,y:(m+y)/a.h}});if(!x)return null;const b=new p(f-s.topLeft.x*a.w,m-s.topLeft.y*a.h).rot(n.rotation);return{id:n.id,x:n.x+b.x,y:n.y+b.y,props:{w:g,h:y,crop:x}}}({handleId:e,currentPagePoint:a,pageToLocal:r,shape:o,startCrop:i,startPagePoint:n});return c?(s.commands.updateShapes([c],{source:l}),"continue"):"continue"}}}function eh(){return{createSession(e,{handle:t,shape:n,originPagePoint:r}){return Gp(n)&&"custom"===t.kind&&"image.crop"===t.type&&(o=t.id,Ep.some(e=>e===o))?Qp({handleId:t.id,shapeId:n.id,startPagePoint:r,startPageToLocal:e.shapes.computeLocalToPageTransform(n).invert(),startShape:n,startCrop:n.props.crop}):null;var o}}}function th(){let e=null;const t=()=>{e?.operation?.isActive&&e.operation.cancel(),e=null};return{id:"land.image.crop.interactions",editorEvent:{handleEvent(n,r){if("cancel"!==r.type){if("keyboard"===r.type)return function(e,t){if("key_down"!==t.name)return;const n=nh(e);if(!n)return;if("Escape"===t.key&&!t.altKey&&!t.accelKey)return e.editing.cancel("user")&&Xp(e,n.id),Zp;if("Enter"===t.key&&!t.altKey&&!t.accelKey)return e.editing.complete("user")&&Xp(e,n.id),Zp;const r=function(e){if(e.altKey||e.accelKey)return null;const t=e.shiftKey?10:1;switch(e.key){case"ArrowLeft":return new p(t,0);case"ArrowRight":return new p(-t,0);case"ArrowUp":return new p(0,t);case"ArrowDown":return new p(0,-t);default:return null}}(t);if(r){const t=function({pageDelta:e,shape:t,startCrop:n}){const r=Rp(n);return!r||e.equals(p.Zero())?null:Up({change:e.rot(-t.rotation),crop:r,shape:t})}({pageDelta:r,shape:n,startCrop:n.props.crop});return t&&e.commands.updateShapes([t],{source:"user"}),Zp}}(n,r);if("pointer"===r.type)if("pointer_cancel"!==r.name){if("pointer_down"===r.name){if(t(),0!==r.button||"select"!==n.state.tool.get().activeToolId||!n.tools.isInInitialState())return;if(n.selection.hitTestHandle(r.pagePoint))return;const o=nh(n);if(!o)return;return function(e,t,n){const r=e.shapes.computeLocalToPageTransform(t).invert().applyToPoint(n.pagePoint);return r.x>=0&&r.y>=0&&r.x<=t.props.w&&r.y<=t.props.h}(n,o,r)?(e={pointerId:r.pointerId,shapeId:o.id,startCrop:o.props.crop,startPagePoint:r.pagePoint.clone(),startScreenPoint:r.screenPoint.clone(),startPageToLocal:n.shapes.computeLocalToPageTransform(o).invert(),startShape:o,hasDragged:!1,operation:null},Zp):n.editing.complete("user")?(Xp(n,o.id),n.handleEvent(r),Zp):void 0}if(e&&r.pointerId===e.pointerId)return"pointer_move"===r.name?(rh(n,r,e),Zp):"pointer_up"===r.name?(rh(n,r,e),e.operation?.isActive&&e.operation.commit(),t(),Zp):void 0}else t()}else t()}},selectionHandle:eh()}}function nh(e){const[t]=e.state.selectedShapes.get();if(!Gp(t))return null;const n=e.state.shapeEditingSession.get();return n&&n.shapeId===t.id&&Fp(t,n.operationKind)?t:null}function rh(e,t,n){if(!n.hasDragged){if(n.startScreenPoint.dist2(t.screenPoint)<9)return;n.operation=e.operations.begin({kind:"image.crop.translate",label:"shape.edit",source:"user",history:"record"}),n.hasDragged=!0}if(!Gp(e.shapes.get(n.shapeId)))return;const r=function({currentPagePoint:e,pageToLocal:t,shape:n,startCrop:r,startPagePoint:o,shiftKey:i}){const s=Rp(r);if(!s)return null;const a=t.applyToPoint(o);let l=t.applyToPoint(e).sub(a);return i&&(l=Math.abs(l.x)<Math.abs(l.y)?new p(0,l.y):new p(l.x,0)),0===l.x&&0===l.y?null:Up({change:l,crop:s,shape:n})}({currentPagePoint:t.pagePoint,pageToLocal:n.startPageToLocal,shape:n.startShape,shiftKey:t.shiftKey,startCrop:n.startCrop,startPagePoint:n.startPagePoint});r&&e.commands.updateShapes([r],{source:"user"})}function oh(e,t=0){return Math.max(0,"number"==typeof e&&Number.isFinite(e)?e:t)}function ih({cornerRadius:e,h:t,w:n}){return Math.min(oh(e),Math.max(0,n)/2,Math.max(0,t)/2)}var sh=24,ah="#ffff00",lh=1,ch=128,dh=24,uh=ah,ph=.45,hh=class{editor;confirmHandler=null;deactivateHistoryScope=null;session=null;snapshot=null;subscribers=new Set;constructor(e){this.editor=e,le("image.smudgeSession.lifecycle",e.state.shapeEditingSession,()=>{this.clearIfEditingSessionInvalid()},{fireImmediately:!1})}start(e,t){if(e.isLocked)return!1;const n=yh(e.id),r=this.editor.state.shapeEditingSession.get();if(r&&(r.shapeId!==e.id||r.operationKind!==n))return!1;if(this.session&&r?.shapeId===e.id&&xh(e,r.operationKind))return this.updateSession({...this.session,brush:bh({...this.session.brush,...t})}),!0;this.clear();const o=this.editor.editing.start({shapeId:e.id,operationKind:n,entryMode:"focusEnd"},"user");return!(!o||o.shapeId!==e.id||o.operationKind!==n)&&(this.setSession({shapeId:e.id,brush:bh(t),strokes:[],activeStroke:null,redoStrokes:[],nextStrokeIndex:1}),this.activateHistoryScope(),!0)}cancel(){const e=this.session?.shapeId??null;this.clear();const t=this.editor.state.shapeEditingSession.get();e&&t?.shapeId===e&&t.operationKind===yh(e)&&this.editor.editing.cancel("user")}complete(){const e=this.session?.shapeId??null;this.clear();const t=this.editor.state.shapeEditingSession.get();e&&t?.shapeId===e&&t.operationKind===yh(e)&&this.editor.editing.complete("user")}cancelIfActive(){return!!this.getActiveSession()&&(this.cancel(),!0)}clearForShape(e){this.session?.shapeId===e&&this.clear()}updateBrush(e){if(!this.getActiveSession()||!this.session)return!1;const t=bh({...this.session.brush,...e});return t.size===this.session.brush.size&&t.color===this.session.brush.color&&t.opacity===this.session.brush.opacity||this.updateSession({...this.session,brush:t}),!0}getSnapshot(e){const t=this.getActiveSession();return t&&t.shapeId===e?this.snapshot:null}getActiveSession(){if(!this.session)return null;const e=this.editor.shapes.get(this.session.shapeId),t=this.editor.state.shapeEditingSession.get();return e&&t&&t.shapeId===this.session.shapeId&&t.operationKind===yh(this.session.shapeId)?this.snapshot:(this.clear(),null)}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}beginStroke(e){if(!this.session)return;const t=fh(this.session),n={id:`${t.shapeId}:smudge:${t.nextStrokeIndex}`,points:[Ah(e)],brush:{...t.brush}};this.updateSession({...t,activeStroke:n,nextStrokeIndex:t.nextStrokeIndex+1})}appendPoint(e){if(!this.session?.activeStroke)return;const t=this.session.activeStroke.points[this.session.activeStroke.points.length-1];t&&Math.hypot(t.x-e.x,t.y-e.y)<.5||this.updateSession({...this.session,activeStroke:{...this.session.activeStroke,points:[...this.session.activeStroke.points,Ah(e)]}})}endStroke(){this.session?.activeStroke&&this.updateSession(fh(this.session))}cancelStroke(){this.session?.activeStroke&&this.updateSession({...this.session,activeStroke:null})}undo(){if(!this.getActiveSession()||!this.session)return!1;if(this.session.activeStroke&&this.updateSession(fh(this.session)),!this.session||0===this.session.strokes.length)return!1;const e=this.session.strokes[this.session.strokes.length-1];return!!e&&(this.updateSession({...this.session,strokes:this.session.strokes.slice(0,-1),redoStrokes:[...this.session.redoStrokes,e]}),!0)}redo(){if(!this.getActiveSession()||!this.session)return!1;if(this.session.activeStroke||0===this.session.redoStrokes.length)return!1;const e=this.session.redoStrokes[this.session.redoStrokes.length-1];return!!e&&(this.updateSession({...this.session,strokes:[...this.session.strokes,e],redoStrokes:this.session.redoStrokes.slice(0,-1)}),!0)}registerConfirmHandler(e){return this.confirmHandler=e,()=>{this.confirmHandler===e&&(this.confirmHandler=null)}}requestConfirm(e){return this.confirmHandler?this.confirmHandler(e):Promise.resolve(null)}clear(){this.session&&(this.session=null,this.snapshot=null,this.deactivateHistoryScope?.(),this.deactivateHistoryScope=null,this.notify())}clearIfEditingSessionInvalid(){if(!this.session)return;const e=this.editor.state.shapeEditingSession.get();e?.shapeId===this.session.shapeId&&e.operationKind===yh(this.session.shapeId)||this.clear()}activateHistoryScope(){const e={getState:()=>this.getHistoryScopeState(),subscribe:e=>this.subscribe(e),undo:()=>this.undo(),redo:()=>this.redo()};this.deactivateHistoryScope=this.editor.history.activateScope(e)}getHistoryScopeState(){const e=this.session?.activeStroke?1:0,t=this.session?.activeStroke?0:this.session?.redoStrokes.length??0;return{canUndo:(this.session?.strokes.length??0)+e>0,canRedo:t>0}}setSession(e){this.session=e,this.snapshot=function(e){return{shapeId:e.shapeId,brush:e.brush,strokes:e.activeStroke?[...e.strokes,e.activeStroke]:e.strokes,canUndo:e.strokes.length>0||!!e.activeStroke,canRedo:!e.activeStroke&&e.redoStrokes.length>0}}(e),this.notify()}updateSession(e){this.setSession(e)}notify(){for(const e of this.subscribers)e()}};function fh(e){return e.activeStroke?{...e,strokes:[...e.strokes,e.activeStroke],activeStroke:null,redoStrokes:[]}:e}var mh=new WeakMap;function gh(e){const t=mh.get(e);if(t)return t;const n=new hh(e);return mh.set(e,n),n}function yh(e){return`image.smudge:edit:${e}`}function xh(e,t){return t===yh(e.id)}function bh(e){const t="number"==typeof e?.size&&Number.isFinite(e.size)?e.size:dh,n="number"==typeof e?.opacity&&Number.isFinite(e.opacity)?e.opacity:ph??.45;return{size:Math.min(128,Math.max(1,t)),color:"string"==typeof e?.color&&e.color.trim().length>0?e.color:uh,opacity:Math.min(1,Math.max(0,n))}}function wh({brush:e,editor:t,shape:n}){return gh(t).start(n,e)}function vh(e){gh(e).cancel()}function kh(e){gh(e).complete()}function Sh(e){return gh(e).cancelIfActive()}function Ph(e,t){return gh(e).updateBrush(t)}function Mh(e){return gh(e).getActiveSession()}function Ih(e){return gh(e).undo()}function Eh(e){return gh(e).redo()}function Th(e,t){return gh(e).registerConfirmHandler(t)}async function Ch(e,t){return gh(e).requestConfirm(t)}function Oh(e){return e.map(e=>({id:e.id,brush:{...e.brush},points:e.points.map(Ah)}))}function Ah(e){return{x:e.x,y:e.y,...void 0===e.pressure?{}:{pressure:e.pressure}}}function Rh(e,t){return"number"==typeof e&&Number.isFinite(e)?e:t}var Nh=class extends oe{type="image";getDefaultProps(){return{w:240,h:180,assetId:null,crop:null,cornerRadius:0,altText:""}}validateProps(e){const t=e&&"object"==typeof e?e:{},n=this.getDefaultProps();return{w:Math.max(24,Rh(t.w,n.w)),h:Math.max(24,Rh(t.h,n.h)),assetId:(r=t.assetId,"string"==typeof r&&r.startsWith("asset:")?t.assetId:null),crop:Rp(t.crop),cornerRadius:oh(t.cornerRadius,n.cornerRadius),altText:"string"==typeof t.altText?t.altText:n.altText};var r}getLocalBounds(e){return new h(0,0,e.props.w,e.props.h)}canReceiveTerminalBinding(e){return!0}getAllowedSelectionResizeModes(e,t){return W}canEdit(e){return!0}onEditEnd(e,t){var n,r;n=t.editor,r=e.id,gh(n).clearForShape(r)}getSelectionHandleAnchors(e,t){const n={terminalHandleAnchors:[],middleHandleAnchors:[],customHandleAnchors:[]};if(!t.isOnlySelected)return n;const r=t.editor.state.shapeEditingSession.get();return r&&r.shapeId===e.id&&Fp(e,r.operationKind)?{terminalHandleAnchors:[],middleHandleAnchors:[],customHandleAnchors:Hp({crop:e.props.crop,localToPage:t.editor.shapes.computeLocalToPageTransform(e),shape:e})}:n}},Lh=class{type="image";toSvg(e,t){const{assetId:n,altText:r,crop:o,h:i,w:s}=e.props;if(!n)return null;const a=t.resolveAssetUrl(n);if(!a)return null;const l=Np(o),c=l?{tag:"svg",attrs:{x:0,y:0,width:s,height:i,viewBox:(d=l,[Kp(d.left),Kp(d.top),Kp(d.width),Kp(d.height)].join(" ")),preserveAspectRatio:"none",overflow:"hidden"},children:[{tag:"image",attrs:{href:a,x:0,y:0,width:1,height:1,preserveAspectRatio:"none","aria-label":r||void 0}}]}:{tag:"image",attrs:{href:a,width:s,height:i,preserveAspectRatio:"none","aria-label":r||void 0}};var d;const u=ih({cornerRadius:e.props.cornerRadius,h:i,w:s});return u<=0?c:{tag:"g",attrs:{"clip-path":`url(#${t.addDef({tag:"clipPath",attrs:{clipPathUnits:"userSpaceOnUse"},children:[{tag:"rect",attrs:{x:0,y:0,width:s,height:i,rx:u,ry:u}}]})})`},children:[c]}}},$h={propagation:"stop"};function Dh(){let e=null;const t=t=>{e=null,function(e){gh(e).endStroke()}(t)},n=t=>{e=null,function(e){gh(e).cancelStroke()}(t)};return{id:"land.image.smudge.interactions",editorEvent:{handleEvent(r,o){if("keyboard"===o.type)return(Bh(o)||jh(o))&&zh(r)&&t(r),function(e,t){if("key_down"!==t.name)return;if(!zh(e))return;if("Escape"===t.key&&!t.altKey&&!t.accelKey)return vh(e),$h;if(jh(t))return Ch(e,{replace:!0}),$h;if(Bh(t))return t.shiftKey?e.history.redo():e.history.undo(),$h;return $h}(r,o);if("cancel"===o.type)return zh(r)?(n(r),"command"!==o.reason&&vh(r),$h):void 0;if("pointer"!==o.type)return;const i=zh(r);if(i){if("pointer_down"===o.name){if(t(r),0!==o.button)return 1===o.button?void 0:$h;const n=Fh(r,i,o.pagePoint),s=Wh(n,i);return e={mode:s?"draw":"pan",originCamera:s?null:r.state.camera.get(),originScreenPoint:s?null:o.screenPoint.clone(),pointerId:o.pointerId,acceptsDrawPoints:s},s&&function(e,t){gh(e).beginStroke(t)}(r,{x:n.x,y:n.y,pressure:o.pressure}),$h}return e&&e.pointerId===o.pointerId?"pointer_move"===o.name?("draw"===e.mode&&1&o.buttons?e.acceptsDrawPoints&&(e.acceptsDrawPoints=_h(r,i,o)):"pan"===e.mode&&e.originCamera&&e.originScreenPoint&&1&o.buttons?Hh(r,o,e):t(r),$h):"pointer_up"===o.name?("draw"===e.mode&&e.acceptsDrawPoints?_h(r,i,o):"pan"===e.mode&&Hh(r,o,e),t(r),$h):"pointer_cancel"===o.name?(n(r),$h):$h:$h}n(r)}}}}function jh(e){return"key_down"===e.name&&"Enter"===e.key&&!e.altKey&&!e.accelKey}function Bh(e){return"key_down"===e.name&&"z"===e.key.toLowerCase()&&e.accelKey&&!e.altKey}function zh(e){const[t]=e.state.selectedShapes.get();if(!Gp(t))return null;const n=e.state.shapeEditingSession.get();return n&&n.shapeId===t.id&&xh(t,n.operationKind)?t:null}function _h(e,t,n){const r=Fh(e,t,n.pagePoint);return!!Wh(r,t)&&(function(e,t){gh(e).appendPoint(t)}(e,{x:r.x,y:r.y,pressure:n.pressure}),!0)}function Fh(e,t,n){return e.shapes.computeLocalToPageTransform(t).invert().applyToPoint(n)}function Wh(e,t){return e.x>=0&&e.y>=0&&e.x<=t.props.w&&e.y<=t.props.h}function Hh(e,t,n){if(!n.originCamera||!n.originScreenPoint)return;const r=t.screenPoint.sub(n.originScreenPoint),o=n.originCamera.z;e.viewport.setCamera({x:n.originCamera.x-r.x/o,y:n.originCamera.y-r.y/o},{source:"user"})}function Uh(){return{id:"land.image",shapeUtils:[new Nh],shapeSvgExporters:[new Lh],interactionHandlers:[th(),Dh()],setup:e=>function(e){let t=null;return le("image.cropSession.lifecycle",e.state.shapeEditingSession,()=>{const n=e.state.shapeEditingSession.get(),r=n?.shapeId,o=r&&n?.operationKind===Wp(r)?r:null;t&&t!==o&&Xp(e,t),t=o})}(e)}}var Vh={id:"land.image.crop.dom-events",handle:()=>"continue",getCursor({clientPoint:e,editor:t,element:n,container:r}){const o=function(e){const[t]=e.state.selectedShapes.get();if(!Gp(t))return null;const n=e.state.shapeEditingSession.get();return n&&n.shapeId===t.id&&Fp(t,n.operationKind)?t:null}(t);if(!o)return;if(n?.closest('[data-selection-custom-handle-type="image.crop"]'))return;if(!e)return;const i=r.getBoundingClientRect(),s=new p(e.x-i.left,e.y-i.top);return tf(t,o,t.viewport.screenToPage(s))?0!==t.inputs.state.get().buttons?"grabbing":"grab":void 0}},Kh={id:"land.image.smudge.dom-events",handle:()=>"continue",getCursor({clientPoint:e,container:t,editor:n}){const r=function(e){const[t]=e.state.selectedShapes.get();if(!Gp(t))return null;const n=e.state.shapeEditingSession.get();return n&&n.shapeId===t.id&&xh(t,n.operationKind)?t:null}(n);if(!r||!e)return;const o=t.getBoundingClientRect(),i=new p(e.x-o.left,e.y-o.top);return tf(n,r,n.viewport.screenToPage(i))?"crosshair":0!==n.inputs.state.get().buttons?"grabbing":"grab"}};function qh(){return{id:"land.image.react",domEventGuards:[Vh,Kh],selectionCustomHandleRenderers:[{type:Pp,component:Zh}],shapeRenderers:[{type:"image",component:Yh,hoverComponent:Gh}]}}function Yh({editor:e,shape:t,shapeEditingSession:n}){const{altText:r,assetId:o,crop:i,h:s,w:a}=t.props,l=o?e.assets.resolveUrl(o):null,c=ih({cornerRadius:t.props.cornerRadius,h:s,w:a}),d=function(e,t){return(0,Vt.useSyncExternalStore)(t=>function(e,t){return gh(e).subscribe(t)}(e,t),()=>function(e,t){return gh(e).getSnapshot(t)}(e,t),()=>null)}(e,t.id);if(!l) return(0,Jt.jsx)("div",{"aria-label":"Empty image","data-ui":"image-shape-missing-asset",role:"img",style:{alignItems:"center",background:"#f8fafc",border:"1px solid #cbd5e1",borderRadius:c,boxSizing:"border-box",color:"#cbd5e1",display:"flex",height:s,justifyContent:"center",overflow:"hidden",width:a},children: (0,Jt.jsxs)("svg",{"aria-hidden":"true",className:"lucide lucide-sparkles-icon lucide-sparkles",fill:"none",height:"40",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"40",xmlns:"http://www.w3.org/2000/svg",children:[
95
+
96
+ (0,Jt.jsx)("path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z"}),
97
+
98
+ (0,Jt.jsx)("path",{d:"M20 2v4"}),
99
+
100
+ (0,Jt.jsx)("path",{d:"M22 4h-4"}),
101
+
102
+ (0,Jt.jsx)("circle",{cx:"4",cy:"20",r:"2"})]})});const u=function({crop:e,shapeHeight:t,shapeWidth:n}){const r=Np(e);if(!r)return null;const o=n/r.width,i=t/r.height;return{imageX:-r.left*o,imageY:-r.top*i,imageWidth:o,imageHeight:i,rect:r}}({crop:i,shapeHeight:s,shapeWidth:a});if(u){const e=n?.shapeId===t.id&&Fp(t,n.operationKind),o={display:"block",height:u.imageHeight,left:u.imageX,maxWidth:"none",objectFit:"fill",pointerEvents:"none",position:"absolute",top:u.imageY,userSelect:"none",width:u.imageWidth};
103
+ return(0,Jt.jsxs)("div",{"data-ui":"image-shape",style:{display:"block",height:s,overflow:e?"visible":"hidden",pointerEvents:"none",position:"relative",userSelect:"none",width:a},children:[e? (0,Jt.jsx)("img",{alt:"","aria-hidden":"true","data-ui":"image-crop-preview",draggable:!1,src:l,style:{...o,opacity:.1}}):null, (0,Jt.jsxs)("div",{"data-ui":"image-crop-window",style:{height:s,overflow:"hidden",position:"absolute",borderRadius:c,inset:0,width:a},children:[ (0,Jt.jsx)("img",{alt:r,draggable:!1,src:l,style:o}), (0,Jt.jsx)(Xh,{shape:t,session:d})]})]})}
104
+ return(0,Jt.jsxs)("div",{"data-ui":"image-shape",style:{borderRadius:c,display:"block",height:s,overflow:"hidden",pointerEvents:"none",position:"relative",userSelect:"none",width:a},children:[ (0,Jt.jsx)("img",{alt:r,draggable:!1,src:l,style:{display:"block",height:s,objectFit:"fill",width:a}}), (0,Jt.jsx)(Xh,{shape:t,session:d})]})}function Xh({shape:e,session:t}){return t&&t.shapeId===e.id&&0!==t.strokes.length? (0,Jt.jsx)("svg",{"aria-hidden":"true","data-ui":"image-smudge-preview",viewBox:`0 0 ${e.props.w} ${e.props.h}`,style:{display:"block",height:e.props.h,inset:0,overflow:"hidden",pointerEvents:"none",position:"absolute",width:e.props.w},children:t.strokes.map(e=> (0,Jt.jsx)(Jh,{stroke:e},e.id))}):null}function Jh({stroke:e}){const t=e.points[0];if(!t)return null;const n=e.brush.color??"#ffff00",r=e.brush.opacity??.45,o=e.brush.size;if(1===e.points.length) return(0,Jt.jsx)("circle",{cx:t.x,cy:t.y,r:o/2,fill:n,opacity:r});const i=function(e){const[t,...n]=e.points;return t?[`M ${ef(t.x)} ${ef(t.y)}`,...n.map(e=>`L ${ef(e.x)} ${ef(e.y)}`)].join(" "):null}(e);return i? (0,Jt.jsx)("path",{d:i,fill:"none",opacity:r,stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:o}):null}function Gh({shape:e,strokeWidth:t}){
105
+ return(0,Jt.jsx)("div",{"data-ui":"image-hover-outline",style:{borderRadius:ih({cornerRadius:e.props.cornerRadius,h:e.props.h,w:e.props.w}),boxShadow:`inset 0 0 0 ${t}px ${pn}`,inset:0,position:"absolute"}})}function Zh({handle:e,strokeWidth:t}){const{x:n,y:r,w:o,h:i,center:s}=e.bounds,a=1.35*Math.max(o,i),l=Math.max(2.5*t,2),c=l/2,d={fill:"none",stroke:"rgba(37, 99, 235, 0.96)",strokeLinecap:"butt",strokeLinejoin:"miter",strokeWidth:l,pointerEvents:"none"},u=function({id:e,extension:t,outwardOffset:n,centerX:r,centerY:o}){switch(e){case"top_left":return{kind:"corner",points:[Qh(r-n,o+t),Qh(r-n,o-n),Qh(r+t,o-n)].join(" ")};case"top":return{kind:"edge",x1:r-t,y1:o-n,x2:r+t,y2:o-n};case"top_right":return{kind:"corner",points:[Qh(r-t,o-n),Qh(r+n,o-n),Qh(r+n,o+t)].join(" ")};case"right":return{kind:"edge",x1:r+n,y1:o-t,x2:r+n,y2:o+t};case"bottom_right":return{kind:"corner",points:[Qh(r+n,o-t),Qh(r+n,o+n),Qh(r-t,o+n)].join(" ")};case"bottom":return{kind:"edge",x1:r-t,y1:o+n,x2:r+t,y2:o+n};case"bottom_left":return{kind:"corner",points:[Qh(r+t,o+n),Qh(r-n,o+n),Qh(r-n,o-t)].join(" ")};case"left":return{kind:"edge",x1:r-n,y1:o-t,x2:r-n,y2:o+t};default:return{kind:"edge",x1:r,y1:o,x2:r,y2:o}}}({id:e.id,extension:a,outwardOffset:c,centerX:s.x,centerY:s.y});
106
+ return(0,Jt.jsxs)("g",{children:[ (0,Jt.jsx)("rect",{"data-selection-custom-handle":e.id,"data-selection-custom-handle-type":e.type,"data-selection-custom-handle-id":e.id,x:n-.8*o,y:r-.8*i,width:2.6*o,height:2.6*i,fill:"transparent",style:{cursor:e.cursor??"grab",pointerEvents:"auto"}}),"corner"===u.kind? (0,Jt.jsx)("polyline",{points:u.points,...d}): (0,Jt.jsx)("line",{x1:u.x1,y1:u.y1,x2:u.x2,y2:u.y2,...d})]})}function Qh(e,t){return`${e},${t}`}function ef(e){return Number.isFinite(e)?Number(e.toFixed(2)).toString():"0"}function tf(e,t,n){const r=e.shapes.computeLocalToPageTransform(t).invert().applyToPoint(n);return r.x>=0&&r.y>=0&&r.x<=t.props.w&&r.y<=t.props.h}var nf=ut("plugin-image.api");function rf({editor:e}){return function({editor:e}){return{getSelectionState(){const t=af(e);if(!t)return null;const n=e.state.shapeEditingSession.get();return{shapeId:t.id,cornerRadius:oh(t.props.cornerRadius),crop:t.props.crop,cropPreset:_p(t),isCropping:n?.shapeId===t.id&&Fp(t,n.operationKind),smudge:Mh(e)}},setSelectionStyle(t){const n=e.state.selectedShapes.get().filter(Gp).filter(e=>!e.isLocked).map(e=>({id:e.id,props:{...void 0===t.cornerRadius?{}:{cornerRadius:oh(t.cornerRadius)}}}));return n.length>0&&e.commands.updateShapes(n,{source:"user"}),n.map(({id:e})=>e)},startCrop(t){const n=sf(e,t);return!(!n||n.isLocked)&&(!!e.editing.start({shapeId:n.id,operationKind:Wp(n.id),entryMode:"focusEnd"},"user")&&(function(e,t){const n=qp.get(e)??new Map;qp.set(e,n),n.set(t.id,{...t,props:{...t.props,crop:t.props.crop?{topLeft:{...t.props.crop.topLeft},bottomRight:{...t.props.crop.bottomRight}}:null},meta:{...t.meta}})}(e,n),!0))},finishCrop(){const t=af(e);if(!t||!lf(e,t))return!1;const n=e.editing.complete("user");return n&&Xp(e,t.id),n},cancelCrop(){const t=af(e);if(!t||!lf(e,t))return!1;const n=e.editing.cancel("user");return n&&Xp(e,t.id),n},zoomCrop:t=>of(e,e=>function({direction:e,shape:t}){const n=Lp(t.props.crop),r=Bp(n),o=Cp("in"===e?.8:1.25,Math.max(kp/n.width,kp/n.height),Math.min(1/n.width,1/n.height)),i=jp({centerX:r.x,centerY:r.y,width:n.width*o,height:n.height*o});return $p(n,i)?null:{id:t.id,props:{crop:Dp(i)}}}({direction:t,shape:e})),setCropAspectRatio:t=>of(e,e=>Vp({preset:t,shape:e})),resetCrop:()=>of(e,t=>function({baselineShape:e,shape:t}){const n=e.x,r=e.y,o=e.props.w,i=e.props.h,s=Rp(e.props.crop);return Math.abs(t.x-n)<=Sp&&Math.abs(t.y-r)<=Sp&&Math.abs(t.props.w-o)<=Sp&&Math.abs(t.props.h-i)<=Sp&&(null===t.props.crop&&null===s||null!==t.props.crop&&null!==s&&Math.abs(t.props.crop.topLeft.x-s.topLeft.x)<=Sp&&Math.abs(t.props.crop.topLeft.y-s.topLeft.y)<=Sp&&Math.abs(t.props.crop.bottomRight.x-s.bottomRight.x)<=Sp&&Math.abs(t.props.crop.bottomRight.y-s.bottomRight.y)<=Sp)?null:{id:t.id,x:n,y:r,props:{w:o,h:i,crop:s}}}({baselineShape:Yp(e,t.id)??t,shape:t})),smudge:{start(t){const n=sf(e,t?.shapeId);return!!n&&!!n.props.assetId&&!n.isLocked&&wh({brush:t?.brush,editor:e,shape:n})},setBrush:t=>Ph(e,t),cancel(){vh(e)},undo:()=>Ih(e),redo:()=>Eh(e),getSnapshot:()=>Mh(e)}}}({editor:e})}function of(e,t){const n=af(e);if(!n||n.isLocked||!lf(e,n))return!1;const r=t(n);return!!r&&(e.commands.updateShapes([r],{source:"user"}),!0)}function sf(e,t){const n=t?e.shapes.get(t):e.state.selectedShapes.get()[0];return Gp(n)?n:null}function af(e){return 1===e.selection.getIds().length?sf(e):null}function lf(e,t){const n=e.state.shapeEditingSession.get();return n?.shapeId===t.id&&Fp(t,n.operationKind)}var cf={id:"image",editor:Uh(),render:qh(),api:nf,setup:({editor:e})=>({api:rf({editor:e})})},df=ut("image.host-api");async function uf(e){const t=new Uint8Array(await e.arrayBuffer());let n="";for(let r=0;r<t.length;r+=32768)n+=String.fromCharCode(...t.subarray(r,r+32768));return`data:${e.type||"application/octet-stream"};base64,${btoa(n)}`}var pf="blobs",hf=null;function ff(){return"undefined"==typeof indexedDB?Promise.resolve(null):(hf||(hf=new Promise((e,t)=>{const n=indexedDB.open("land.plugin-image",1);n.addEventListener("upgradeneeded",()=>{n.result.objectStoreNames.contains(pf)||n.result.createObjectStore(pf)}),n.addEventListener("success",()=>{const t=n.result;t.addEventListener("versionchange",()=>{t.close(),hf=null}),e(t)}),n.addEventListener("error",()=>{hf=null,t(n.error)})})),hf)}var mf="image-blob:";function gf(){return"undefined"!=typeof crypto&&"randomUUID"in crypto?`${mf}${crypto.randomUUID()}`:`${mf}${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}async function yf(e){const t=gf();if("undefined"==typeof indexedDB)throw new Error("IndexedDB is not available for image storage.");return await async function(e,t){const n=await ff();n&&await new Promise((r,o)=>{const i=n.transaction(pf,"readwrite");i.addEventListener("complete",()=>r()),i.addEventListener("abort",()=>o(i.error)),i.addEventListener("error",()=>o(i.error)),i.objectStore(pf).put(t,e)})}(t,e),{storageKey:t}}async function xf(e){const t=await async function(e){const t=await ff();return t?new Promise((n,r)=>{const o=t.transaction(pf,"readonly").objectStore(pf).get(e);o.addEventListener("success",()=>{n(o.result??null)}),o.addEventListener("error",()=>r(o.error))}):null}(e);return t instanceof Blob?t:null}async function bf(e){const t=await xf(e);return t?uf(t):null}async function wf(e){await async function(e){const t=await ff();t&&await new Promise((n,r)=>{const o=t.transaction(pf,"readwrite");o.addEventListener("complete",()=>n()),o.addEventListener("abort",()=>r(o.error)),o.addEventListener("error",()=>r(o.error)),o.objectStore(pf).delete(e)})}(e)}async function vf(){return(await async function(){const e=await ff();return e?new Promise((t,n)=>{const r=e.transaction(pf,"readonly").objectStore(pf).getAllKeys();r.addEventListener("success",()=>t([...r.result])),r.addEventListener("error",()=>n(r.error))}):null}())?.map(String)??[]}function kf(e,t){const n=e.assets.get(t);if(!Jp(n)||"local"!==n.props.source.kind)return null;const{storageKey:r}=n.props.source;return r.length>0?r:null}function Sf(e,t){const n=e.assets.get(t);return Jp(n)&&"remote"===n.props.source.kind&&n.props.source.url.length>0?n.props.source.url:null}function Pf(e){const t=new Set;for(const n of e.assets.getAll())Jp(n)&&"local"===n.props.source.kind&&n.props.source.storageKey.length>0&&t.add(n.props.source.storageKey);return t}async function Mf({editor:e,objectUrls:t}){const n=Pf(e),r=await vf(),o=[];for(const i of r)n.has(i)||(t?.release(i),await wf(i),o.push(i));return o}function If(){const e=new Map,t=new Map;let n=0,r=!1;const o=async(o,i={})=>{if(i.signal?.throwIfAborted(),r)return null;const s=e.get(o);if(s)return s;const a=t.get(o);if(a)return a;const l=n,c=xf(o).then(t=>{if(i.signal?.throwIfAborted(),!t||r||l!==n)return null;const s=URL.createObjectURL(t);return e.set(o,s),s}).finally(()=>{t.delete(o)});return t.set(o,c),c};return{async preloadForEditor(e,t={}){t.signal?.throwIfAborted(),await Promise.all(Array.from(Pf(e)).map(e=>o(e,t)))},preload:o,resolve:t=>e.get(t)??null,resolveAssetUrl(t,n){const r=Sf(t,n);if(r)return r;const o=kf(t,n);return o?e.get(o)??null:null},release(n){const r=e.get(n);r&&(URL.revokeObjectURL(r),e.delete(n)),t.delete(n)},releaseAll(){r=!0,n+=1;for(const t of e.values())URL.revokeObjectURL(t);e.clear(),t.clear()}}}function Ef(){const e=If(),t={objectUrls:e,async cleanupAfterRestore(t,{signal:n}){n.throwIfAborted(),await Mf({editor:t,objectUrls:e}),n.throwIfAborted()},preloadForEditor:(t,{signal:n})=>e.preloadForEditor(t,{signal:n}),resolveAssetUrl:(t,n)=>e.resolveAssetUrl(t,n)};return{value:t,dispose(){t.objectUrls.releaseAll()}}}function Tf(e,{signal:t}={}){return t?.throwIfAborted(),new Promise((n,r)=>{const o=new Image,i=()=>{o.removeEventListener("load",s),o.removeEventListener("error",a),t?.removeEventListener("abort",l)},s=()=>{i(),n({width:o.naturalWidth||o.width,height:o.naturalHeight||o.height})},a=()=>{i(),r(new Error("Could not decode image file."))},l=()=>{i(),r(t?.reason)};o.addEventListener("load",s),o.addEventListener("error",a),t?.addEventListener("abort",l,{once:!0}),o.src=e,t?.aborted&&l()})}async function Cf(e,{signal:t}={}){t?.throwIfAborted();const n=Af(e)?e:e.blob,r=(Af(e),e.name),o=Af(e)?e.type:e.mimeType||e.blob.type,i=URL.createObjectURL(n),s=await Tf(i,{signal:t}).finally(()=>{URL.revokeObjectURL(i)});t?.throwIfAborted();const{storageKey:a}=await yf(n);try{t?.throwIfAborted()}catch(l){try{await wf(a)}catch(c){throw new AggregateError([l,c],"Could not discard an aborted image blob write.")}throw l}return{name:r||"Image",source:{kind:"local",storageKey:a,...!Af(e)&&e.originalUrl?{originalUrl:e.originalUrl}:{}},mimeType:o||"image/png",fileSize:n.size,width:s.width,height:s.height}}async function Of({name:e,signal:t,url:n}){const r=await Tf(n,{signal:t});return{name:e||Rf(n)||"Image",source:{kind:"remote",url:n},mimeType:null,width:r.width,height:r.height}}function Af(e){return"undefined"!=typeof File&&e instanceof File}function Rf(e){try{const t=new URL(e).pathname.split("/").filter(Boolean).at(-1);return t?decodeURIComponent(t):null}catch{return null}}function Nf(e){for(const t of e)if(t.type.startsWith("image/"))return t;return null}function Lf({filename:e,url:t}){const n=document.createElement("a");n.href=t,n.download=e,n.click()}async function $f({blob:e,filename:t}){const n=URL.createObjectURL(e);try{Lf({filename:t,url:n})}finally{window.setTimeout(()=>URL.revokeObjectURL(n),0)}}var Df=1;function jf(e,t){return e.commands.createAsset({type:"image",props:{w:t.width,h:t.height,name:t.name,source:t.source,mimeType:t.mimeType,fileSize:t.fileSize,isAnimated:"image/gif"===t.mimeType}},{source:"user"})}async function Bf({editor:e,imageObjectUrls:t,pagePoint:n,signal:r,size:o,source:i}){return"file"===i.type?Vf(i.file)?zf({editor:e,imageObjectUrls:t,input:await Cf(i.file,{signal:r}),pagePoint:n,size:o,signal:r}):null:"blob"===i.type?Vf(i.blob)?zf({editor:e,imageObjectUrls:t,input:await Cf(i,{signal:r}),pagePoint:n,size:o,signal:r}):null:async function({editor:e,imageObjectUrls:t,pagePoint:n,signal:r,size:o,source:i}){return zf({editor:e,imageObjectUrls:t,input:await Of({...i,signal:r}),pagePoint:n,size:o,signal:r,altText:i.altText})}({editor:e,imageObjectUrls:t,source:i,pagePoint:n,size:o,signal:r})}async function zf({editor:e,imageObjectUrls:t,input:n,pagePoint:r,size:o,signal:i,altText:s}){const a="local"===n.source.kind?n.source.storageKey:null;a&&await t.preload(a,{signal:i}),i.throwIfAborted();let l=null;try{try{const t=jf(e,n);l=t.id;const i=o??function({height:e,width:t}){const n=Math.min(1,360/Math.max(t,e));return{w:Math.max(24,Math.round(t*n)),h:Math.max(24,Math.round(e*n))}}({width:t.props.w,height:t.props.h}),a=e.state.viewportPageBounds.get(),c=r??a?.center??e.viewport.screenToPage(new p(360,240)),[d]=e.commands.createShapes([{type:"image",x:Math.round(c.x-i.w/2),y:Math.round(c.y-i.h/2),props:{...i,assetId:t.id,crop:null,altText:s??n.name}}],{source:"user"});return d?(e.commands.setSelectedShapeIds([d.id],{source:"user"}),d.id):null}catch(c){throw l&&e.commands.deleteAsset(l,{source:"system"}),c}}catch(c){throw a&&(t.release(a),await wf(a)),c}}async function _f({editor:e,file:t,imageObjectUrls:n,signal:r}){if(!Vf(t))return;const[o]=e.state.selectedShapes.get();if(!Gp(o)||o.isLocked)return;const i=await Cf(t,{signal:r});await Wf({editor:e,imageObjectUrls:n,input:i,nextProps:{crop:null,altText:i.name},signal:r,shape:o})}async function Ff({editor:e,imageObjectUrls:t,onError:n}){const[r]=e.state.selectedShapes.get();if(!Gp(r)||!r.props.assetId)return;const o=e.assets.get(r.props.assetId);if(!Jp(o))return;const i="string"==typeof o.props.name&&o.props.name.length>0?o.props.name:"land-image";if("remote"===o.props.source.kind)return void(await async function({filename:e,onError:t,url:n}){try{const t=await fetch(n);if(!t.ok)throw new Error(`Could not download image URL (${t.status}).`);await $f({blob:await t.blob(),filename:e})}catch(r){t?.(new Error("Could not download remote image; opening URL instead.",{cause:r})),function(e){const t=document.createElement("a");t.href=e,t.rel="noreferrer",t.target="_blank",t.click()}(n)}}({filename:i,onError:n,url:o.props.source.url}));const s=o.props.source.storageKey;if(!s)return;const a=await xf(s);if(a)return void(await $f({blob:a,filename:i}));const l=t.resolve(s);l&&Lf({filename:i,url:l})}async function Wf({canCommit:e,editor:t,imageObjectUrls:n,input:r,nextProps:o,shape:i,signal:s}){const a=i.props.assetId,l="local"===r.source.kind?r.source.storageKey:null;try{s.throwIfAborted(),l&&await n.preload(l,{signal:s}),s.throwIfAborted()}catch(c){throw await Hf({imageObjectUrls:n,storageKey:l}),c}try{const s=t.shapes.get(i.id);if(!Gp(s)||s.isLocked||s.props.assetId!==a||e&&!e())return await Hf({imageObjectUrls:n,storageKey:l}),null;const d=`image.asset.replace:${i.id}:${Df++}`,u=t.operations.begin({kind:d,label:"image.asset.replace",source:"user",history:"record"});try{const e=jf(t,r);return t.commands.updateShapes([{id:i.id,props:{assetId:e.id,...o}}],{source:"user"}),a&&!function(e,t){return e.snapshots.getDocument().records.some(e=>"shape"===e.typeName&&e.props.assetId===t)}(t,a)&&t.commands.deleteAsset(a,{source:"user"}),u.commit(),{assetId:e.id,storageKey:l}}catch(c){throw u.isActive&&u.cancel(),c}}catch(c){throw await Hf({imageObjectUrls:n,storageKey:l}),c}}async function Hf({imageObjectUrls:e,storageKey:t}){t&&(e.release(t),await wf(t))}async function Uf(e){try{const t=await fetch(e);if(!t.ok)return null;const n=await t.blob();return Vf(n)?n:null}catch{return null}}function Vf(e){return!e.type||e.type.startsWith("image/")}var Kf=new WeakSet;async function qf({editor:e,imageObjectUrls:t,replace:n=!0,signal:r}){r.throwIfAborted();const o=Mh(e);if(!o)return null;const i=Oh(o.strokes);if(0===i.length)return kh(e),null;if(Kf.has(o))return null;Kf.add(o);try{return await async function({editor:e,imageObjectUrls:t,replace:n,session:r,signal:o,strokes:i}){o.throwIfAborted();const s=e.shapes.get(r.shapeId);if(!Gp(s)||s.isLocked||!s.props.assetId)return null;const a=e.assets.get(s.props.assetId);if(!Jp(a))return null;const l=s.props.assetId,c=await async function({asset:e,imageObjectUrls:t}){if("remote"===e.props.source.kind)return Uf(e.props.source.url);const n=e.props.source.storageKey,r=await xf(n);if(r)return r;const o=t.resolve(n);return o?Uf(o):null}({asset:a,imageObjectUrls:t});if(o.throwIfAborted(),!c)return null;if(!Yf(e,r,l,s)||e.assets.get(l)!==a)return null;const{imageBlob:d,maskBlob:u,height:p,width:h}=await async function({crop:e,shape:t,signal:n,sourceBlob:r,strokes:o}){n.throwIfAborted();const i=await async function(e){if("function"==typeof createImageBitmap){const t=await createImageBitmap(e);return{source:t,width:t.width,height:t.height,dispose(){t.close()}}}const t=URL.createObjectURL(e),n=new Image;n.decoding="async",n.src=t,"function"==typeof n.decode?await n.decode():await new Promise((e,t)=>{n.onload=()=>e(),n.onerror=()=>t(new Error("Could not decode image."))});return{source:n,width:n.naturalWidth||n.width,height:n.naturalHeight||n.height,dispose(){URL.revokeObjectURL(t)}}}(r);try{n.throwIfAborted();const r=i.width,s=i.height,a=Xf(r,s);a.context.drawImage(i.source,0,0,r,s),Jf({context:a.context,crop:e,imageHeight:s,imageWidth:r,mask:!1,shape:t,strokes:o});const l=Xf(r,s);Jf({context:l.context,crop:e,imageHeight:s,imageWidth:r,mask:!0,shape:t,strokes:o});const c=await a.toBlob("image/png");n.throwIfAborted();const d=await l.toBlob("image/png");return n.throwIfAborted(),{imageBlob:c,maskBlob:d,width:r,height:s}}finally{i.dispose()}}({crop:s.props.crop,shape:s,signal:o,sourceBlob:c,strokes:i});if(o.throwIfAborted(),!Yf(e,r,l,s)||e.assets.get(l)!==a)return null;const f={shapeId:s.id,sourceAssetId:l,imageBlob:d,maskBlob:u,width:h,height:p,crop:s.props.crop?{topLeft:{...s.props.crop.topLeft},bottomRight:{...s.props.crop.bottomRight}}:null,strokes:i};if(n){o.throwIfAborted();const n=await async function({blob:e,canCommit:t,editor:n,imageObjectUrls:r,name:o,shape:i,signal:s}){s.throwIfAborted();const a=await Cf({blob:e,name:o},{signal:s});return s.throwIfAborted(),Wf({editor:n,imageObjectUrls:r,input:a,nextProps:{},shape:i,canCommit:t,signal:s})}({blob:d,canCommit:()=>!o.aborted&&Yf(e,r,l,s)&&e.assets.get(l)===a,editor:e,imageObjectUrls:t,name:Qf(a.props.name),shape:s,signal:o});if(o.throwIfAborted(),!n)return null;if(!Yf(e,r,n.assetId,s)){const o=Mh(e),i=e.shapes.get(r.shapeId);return o?.shapeId===r.shapeId&&Gp(i)&&i.props.assetId===n.assetId&&vh(e),await async function({assetId:e,editor:t,imageObjectUrls:n,storageKey:r}){if(!r||e&&t.assets.get(e))return;n.release(r),await wf(r)}({assetId:n.assetId,editor:e,imageObjectUrls:t,storageKey:n.storageKey}),null}return o.throwIfAborted(),kh(e),f}return o.throwIfAborted(),kh(e),f}({editor:e,imageObjectUrls:t,replace:n,session:o,signal:r,strokes:i})}finally{Kf.delete(o)}}function Yf(e,t,n,r){if(Mh(e)!==t)return!1;const o=e.shapes.get(t.shapeId);return Gp(o)&&!o.isLocked&&o.props.assetId===n&&function(e,t){if(e.props.w!==t.props.w||e.props.h!==t.props.h)return!1;const n=e.props.crop,r=t.props.crop;return n&&r?n.topLeft.x===r.topLeft.x&&n.topLeft.y===r.topLeft.y&&n.bottomRight.x===r.bottomRight.x&&n.bottomRight.y===r.bottomRight.y:n===r}(o,r)}function Xf(e,t){if("undefined"!=typeof OffscreenCanvas){const n=new OffscreenCanvas(e,t),r=n.getContext("2d");if(!r)throw new Error("Could not create image smudge canvas context.");return{context:r,toBlob:e=>n.convertToBlob({type:e})}}const n=document.createElement("canvas");n.width=e,n.height=t;const r=n.getContext("2d");if(!r)throw new Error("Could not create image smudge canvas context.");return{context:r,toBlob:e=>new Promise((t,r)=>{n.toBlob(e=>{e?t(e):r(new Error("Could not encode image smudge canvas."))},e)})}}function Jf({context:e,crop:t,imageHeight:n,imageWidth:r,mask:o,shape:i,strokes:s}){if(0===s.length)return;const a=Lp(t),l={x:a.left*r,y:a.top*n,w:a.width*r,h:a.height*n},c=l.w/i.props.w,d=l.h/i.props.h,u=(Math.abs(c)+Math.abs(d))/2;e.save(),e.beginPath(),e.rect(l.x,l.y,l.w,l.h),e.clip(),e.lineCap="round",e.lineJoin="round";for(const p of s){const t=p.points[0];if(!t)continue;const n=Zf(p.brush.opacity),r=Math.max(1,p.brush.size*u),i=p.brush.color??"#ffff00";e.globalAlpha=n,e.strokeStyle=o?"#ffffff":i,e.fillStyle=o?"#ffffff":i,e.lineWidth=r;const s=Gf({cropPixelRect:l,point:t,scaleX:c,scaleY:d});if(1!==p.points.length){e.beginPath(),e.moveTo(s.x,s.y);for(const t of p.points.slice(1)){const n=Gf({cropPixelRect:l,point:t,scaleX:c,scaleY:d});e.lineTo(n.x,n.y)}e.stroke()}else e.beginPath(),e.arc(s.x,s.y,r/2,0,2*Math.PI),e.fill()}e.restore()}function Gf({cropPixelRect:e,point:t,scaleX:n,scaleY:r}){return{x:e.x+t.x*n,y:e.y+t.y*r}}function Zf(e){return"number"==typeof e&&Number.isFinite(e)?Math.min(1,Math.max(0,e)):.45}function Qf(e){const t=e.trim();if(!t)return"Image smudged.png";const n=t.lastIndexOf(".");return n<=0?`${t} smudged.png`:`${t.slice(0,n)} smudged.png`}function em({editor:e,imageAssetService:t,imageApi:n,onError:r,tasks:o}){let i,s=!1;const a=tm(e=>i.insert({source:{type:"file",file:e}}),r),l=tm(e=>i.replaceSelection({file:e}),r),c={start:e=>n.smudge.start(e),setBrush:e=>n.smudge.setBrush(e),cancel(){n.smudge.cancel()},confirm:n=>o.run(async r=>{const o=await qf({editor:e,imageObjectUrls:t.objectUrls,replace:n?.replace??!0,signal:r});return r.throwIfAborted(),o}),isActive:()=>null!==n.smudge.getSnapshot()};i={openInsertFilePicker(){a.open()},openReplaceFilePicker(){l.open()},insert:({source:n,pagePoint:r,size:i})=>o.run(async o=>{o.throwIfAborted();const s=await Bf({editor:e,imageObjectUrls:t.objectUrls,source:n,pagePoint:r,size:i,signal:o});return o.throwIfAborted(),s}),replaceSelection:({file:n})=>o.run(async r=>{if(!n.type.startsWith("image/"))return!1;const[o]=e.state.selectedShapes.get();return!(!Gp(o)||o.isLocked)&&(await _f({editor:e,file:n,imageObjectUrls:t.objectUrls,signal:r}),r.throwIfAborted(),!0)}),downloadSelectionOriginal:()=>o.run(async n=>{await Ff({editor:e,imageObjectUrls:t.objectUrls,onError:r}),n.throwIfAborted()}),smudge:c};const d=Th(e,e=>c.confirm(e));return{value:i,dispose(){s||(s=!0,a.dispose(),l.dispose(),d())}}}function tm(e,t){let n=null,r=!1;return{open(){if(!r){if(!globalThis.document)throw new Error("Image file selection requires a browser document.");n??=function(){const n=document.createElement("input");return n.type="file",n.accept="image/*",n.hidden=!0,n.onchange=()=>{const o=n.files?.[0]??null;n.value="",o&&!r&&e(o).catch(e=>{t?.(new Error("Image file selection failed.",{cause:e}))})},n}(),n.click()}},dispose(){r=!0,n&&(n.onchange=null),n=null}}}function nm(e){return{kind:"svg-inliner",id:"image.svg-inliner",async prepare({editor:t,requestedShapeIds:n}){const r=rm(t,t.layers.getExportTraversalIds(n).flatMap(e=>{const n=t.shapes.get(e);return n?[n]:[]})),o=new Set;for(const i of r.values()){if("local"!==i.props.source.kind)continue;const{storageKey:t}=i.props.source;if(!o.has(t)&&(o.add(t),0===t.length||!(await e.objectUrls.preload(t))))throw new Error(`Could not load image asset "${i.id}".`)}},async inline({editor:t,exportedShapes:n,svg:r}){let o=r;const i=rm(t,n),s=new Set;for(const a of i.values()){const t=im(a,e);if(!t)throw new Error(`Could not resolve image asset "${a.id}".`);if(s.has(t))continue;const n=await om(a,t);if(n.href===n.dataUrl){s.add(t);continue}const r=`href="${sm(n.href)}"`;if(!o.includes(r))throw new Error(`Could not find image asset "${a.id}" in the generated SVG.`);o=o.split(r).join(`href="${n.dataUrl}"`),s.add(t)}return o}}}function rm(e,t){const n=new Map;for(const r of t){if(!Gp(r)||!r.props.assetId)continue;const t=e.assets.get(r.props.assetId);if(!Jp(t))throw new Error(`Image asset "${r.props.assetId}" is unavailable.`);n.set(t.id,t)}return n}async function om(e,t){const{source:n}=e.props;if("local"===n.kind){const r=await bf(n.storageKey);if(!r)throw new Error(`Could not embed local image asset "${e.id}".`);return{href:t,dataUrl:r}}if(t.startsWith("data:"))return{href:t,dataUrl:t};let r;try{r=await fetch(t)}catch(i){throw new Error(`Could not download image asset "${e.id}".`,{cause:i})}if(!r.ok)throw new Error(`Could not download image asset "${e.id}" (${r.status}).`);const o=await uf(await r.blob());if(!o)throw new Error(`Could not embed remote image asset "${e.id}".`);return{href:t,dataUrl:o}}function im(e,t){return"local"===e.props.source.kind?t.objectUrls.resolve(e.props.source.storageKey):e.props.source.url}function sm(e){return e.replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;").replaceAll(">","&gt;")}function am(e={}){return{id:"image.host",requires:[cf],api:df,setup({apis:t,editor:n,tasks:r}){const o=(e.createAssetService??Ef)();let i=null;try{const s=em({editor:n,imageApi:t.require(nf),imageAssetService:o.value,onError:e.onError,tasks:r});return i=s.dispose,{api:s.value,imports:[{id:"image.host-import",order:100,acceptsPreview:e=>e.fileTypes.some(e=>e.startsWith("image/"))||e.dataTypes.some(e=>{const t=e.toLowerCase();return"files"===t||"text/uri-list"===t}),accepts:e=>null!==Nf(e.files)||(e.urls?.some(lm)??!1),async import(e){const t=Nf(e.files),n=e.urls?.find(lm);return(t||n)&&await s.value.insert({source:t?{type:"file",file:t}:{type:"url",url:n},pagePoint:e.pagePoint})?"handled":"ignored"}}],assetResolvers:[{id:"image.host.asset-resolver",resolve:e=>o.value.resolveAssetUrl(n,e),preload:({signal:e})=>o.value.preloadForEditor(n,{signal:e}),cleanupAfterRestore:({signal:e})=>o.value.cleanupAfterRestore(n,{signal:e})}],exports:[nm(o.value)],dispose(){i?.(),o.dispose()}}}catch(s){throw i?.(),o.dispose(),s}}}}function lm(e){return e.startsWith("data:image/")||/\.(?:avif|bmp|gif|jpe?g|png|svg|webp)(?:[?#].*)?$/i.test(e)}var cm="land:",dm="shape";function um(e){const t=e.trim();if(!t)return null;const n=function(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)}(t)?t:`https://${t}`;return pm(n)?n:null}function pm(e){return null!==mm(e)||hm(e)}function hm(e){try{const t=new URL(e);return"http:"===t.protocol||"https:"===t.protocol||"mailto:"===t.protocol}catch{return!1}}function fm(e){return`${cm}//${dm}/${encodeURIComponent(e)}`}function mm(e){try{const t=new URL(e);if(t.protocol!==cm||t.hostname!==dm||t.username||t.password||t.port||t.search||t.hash||!t.pathname.startsWith("/"))return null;const n=decodeURIComponent(t.pathname.slice(1));return n.startsWith("shape:")&&n.length>6?n:null}catch{return null}}function gm({href:e,openExternal:t,openInternal:n}){const r=mm(e);r?n?.(r):hm(e)&&t(e)}var ym=/[;{}<>\u0000-\u001f\u007f]/u,xm=/(?:url|expression)\s*\(|!\s*important|@\s*import|javascript\s*:/iu,bm=/^((?:\d+(?:\.\d{1,3})?)|(?:\.\d{1,3}))(px|em|rem|%)?$/iu;function wm(e){return{type:"doc",content:e.split("\n").map(e=>({type:"paragraph",content:e.length>0?[{type:"text",text:e}]:[]}))}}function vm(e){return e.content.map(e=>Em(e)).join("\n")}function km(e){if(!e||"object"!=typeof e)return wm("");const t=e,n=Array.isArray(t.content)?t.content.map(e=>Nm(e,0)).filter(e=>null!==e):[];return{type:"doc",attrs:Fm(t.attrs),content:n}}function Sm(e){return"text"===e.type&&"string"==typeof e.text}function Pm(e){if("paragraph"===e.type)return _m(e.attrs?.textAlign)}function Mm(e,t){const n=e?.some(e=>"code"===e.type)?void 0:t;if(!(e&&0!==e.length||n))return;const r=n?{backgroundColor:n}:{},o=new Set;for(const i of e??[])switch(i.type){case"bold":case"strong":r.fontWeight=700;break;case"italic":case"em":r.fontStyle="italic";break;case"strike":case"s":o.add("line-through");break;case"underline":case"u":o.add("underline");break;case"textStyle":{const e=Dm(i.attrs);void 0!==e?.color&&(r.color=e.color),void 0!==e?.backgroundColor&&(r.backgroundColor=e.backgroundColor),void 0!==e?.fontFamily&&(r.fontFamily=e.fontFamily),void 0!==e?.fontSize&&(r.fontSize=e.fontSize),void 0!==e?.lineHeight&&(r.lineHeight=e.lineHeight);break}}return o.size>0&&(r.textDecorationLine=["line-through","underline"].filter(e=>o.has(e)).join(" ")),Object.keys(r).length>0?r:void 0}function Im(e){if(e&&0!==e.length)for(const t of e){if("link"!==t.type)continue;const e=t.attrs?.href;return"string"==typeof e?e:void 0}}function Em(e){return Sm(e)?e.text:e.content?.map(e=>Em(e)).join("")??""}function Tm(e){const t=[];return void 0!==e.color&&t.push(`color:${e.color}`),void 0!==e.backgroundColor&&t.push(`background-color:${e.backgroundColor}`),void 0!==e.fontFamily&&t.push(`font-family:${e.fontFamily}`),void 0!==e.fontSize&&t.push(`font-size:${e.fontSize}`),void 0!==e.fontWeight&&t.push(`font-weight:${String(e.fontWeight)}`),void 0!==e.fontStyle&&t.push(`font-style:${e.fontStyle}`),void 0!==e.lineHeight&&t.push(`line-height:${e.lineHeight}`),void 0!==e.textDecorationLine&&t.push(`text-decoration-line:${e.textDecorationLine}`),t.join(";")}function Cm(e){const t=e.content?.map(e=>function(e){if(Sm(e)){const t=Mm(e.marks),n=Im(e.marks),r=Om(e.text),o=t?`<span style="${Am(Tm(t))}">${r}</span>`:r;return n&&hm(n)?`<a href="${Am(n)}" target="_blank" rel="noopener noreferrer">${o}</a>`:t?o:r}return"hardBreak"===e.type?"<br>":Cm(e)}(e)).join("")??"";if("bulletList"===e.type)return`<ul style="margin:0;padding-inline-start:1.5em;list-style-type:disc">${t}</ul>`;if("orderedList"===e.type)return`<ol style="margin:0;padding-inline-start:1.5em;list-style-type:decimal">${t}</ol>`;if("listItem"===e.type)return`<li>${t}</li>`;if("blockquote"===e.type)return`<blockquote style="margin:0;padding-inline-start:0.75em;border-inline-start:2px solid currentColor">${t}</blockquote>`;const n=Pm(e);return`<p style="${n?`margin:0;text-align:${n}`:"margin:0"}">${t.length>0?t:"<br>"}</p>`}function Om(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}function Am(e){return Om(e).replaceAll('"',"&quot;")}function Rm(e,t){if(!e||"object"!=typeof e||t>8)return null;const n=e;if("text"===n.type){const e=function(e){return{type:"text",text:"string"==typeof e.text?e.text:"",marks:Array.isArray(e.marks)?e.marks.map(Lm).filter(e=>null!==e):void 0}}(n);return e.text.length>0?e:null}return Nm(n,t)}function Nm(e,t){if(!e||"object"!=typeof e)return null;const n=e,r="string"==typeof n.type?n.type:"paragraph",o=Array.isArray(n.content)?n.content.map(e=>Rm(e,t+1)).filter(e=>null!==e):[];return{type:r,attrs:$m(r,n.attrs),content:o}}function Lm(e){if(!e||"object"!=typeof e)return null;const t=e;if("string"!=typeof t.type)return null;if("link"===t.type){const e=Fm(t.attrs),n=e?.href;return"string"==typeof n&&pm(n)?{type:"link",attrs:{...e,href:n}}:null}if("textStyle"===t.type){const e=Dm(t.attrs);return e?{type:"textStyle",attrs:e}:null}return{type:t.type,attrs:Fm(t.attrs)}}function $m(e,t){const n=Fm(t);if("paragraph"!==e)return n;const r={...n};delete r.textAlign;const o=t&&"object"==typeof t&&!Array.isArray(t)?_m(t.textAlign):void 0;return void 0!==o&&(r.textAlign=o),Object.keys(r).length>0?r:void 0}function Dm(e){if(!e||"object"!=typeof e||Array.isArray(e))return;const t=e,n={color:jm(t.color,128),backgroundColor:jm(t.backgroundColor,128),fontFamily:jm(t.fontFamily,256),fontSize:Bm(t.fontSize),lineHeight:zm(t.lineHeight)},r=Object.entries(n).filter(e=>void 0!==e[1]);return r.length>0?Object.fromEntries(r):void 0}function jm(e,t){if("string"!=typeof e)return;const n=e.trim();return 0===n.length||n.length>t||ym.test(n)||xm.test(n)?void 0:n}function Bm(e){const t="string"==typeof e?bm.exec(e.trim()):null;if(!t||"px"!==t[2]?.toLowerCase())return;const n=Number(t[1]);return n>=1&&n<=512?`${String(n)}px`:void 0}function zm(e){const t="string"==typeof e?bm.exec(e.trim()):null;if(!t)return;const n=Number(t[1]),r=t[2]?.toLowerCase()??"";return("px"===r?n>=1&&n<=1024:"%"===r?n>=50&&n<=1e3:n>=.5&&n<=10)?`${String(n)}${r}`:void 0}function _m(e){return"left"===e||"center"===e||"right"===e?e:void 0}function Fm(e){if(!e||"object"!=typeof e)return;const t=Object.entries(e).map(([e,t])=>[e,Wm(t)]).filter(e=>void 0!==e[1]);return t.length>0?Object.fromEntries(t):void 0}function Wm(e,t=0){if(null===e||"string"==typeof e||"number"==typeof e||"boolean"==typeof e)return e;if(!(t>8)){if(Array.isArray(e))return e.map(e=>Wm(e,t+1)).filter(e=>void 0!==e);if(e&&"object"==typeof e){const n=Object.entries(e).map(([e,n])=>[e,Wm(n,t+1)]).filter(e=>void 0!==e[1]);return Object.fromEntries(n)}}}function Hm(e){return c(e)&&"text"===e.type}function Um(e){return{richText:e.richText,w:e.w,h:e.h,autoSize:e.autoSize,scale:e.scale,font:e.font,size:e.size,color:e.color,backgroundColor:e.backgroundColor,textAlign:e.textAlign}}function Vm(e){return Um(e.shapes.getDefaultProps("text"))}function Km(e,t,n="user"){const r={...Vm(e),...t.props,richText:t.props?.richText??wm("")},[o]=e.commands.createShapes([{type:"text",x:t.x,y:t.y,parentId:t.parentId,index:t.index,rotation:t.rotation,scaleX:t.scaleX,scaleY:t.scaleY,meta:t.meta,props:{richText:r.richText,w:r.w,h:r.h,autoSize:r.autoSize,scale:r.scale,font:r.font,size:r.size,color:r.color,backgroundColor:r.backgroundColor,textAlign:r.textAlign}}],{source:n});if(!Hm(o))throw new Error("Failed to create text shape");return o}function qm(e,t,n,r,o="user"){const i=e.shapes.get(t);Hm(i)&&e.commands.updateShapes([{id:i.id,props:{richText:n,..."number"==typeof r?.w?{w:r.w}:null,..."number"==typeof r?.h?{h:r.h}:null}}],{source:o})}var Ym="path-label",Xm="geo-label",Jm={[Ym]:{selectionTarget:"owner",hoverTarget:"owner",hoverDecorationTarget:"owner",translateTarget:"owner",canSnap:!1,canReceiveTerminalBinding:!1,contributesToSelectionFrame:!0,canUseSelectionResizeHandles:!1,canUseSelectionRotateHandle:!1,canPlaceCaretWhenOwnerSelected:!0,showsCompanionFrameWhenOwnerSelected:!0},[Xm]:{selectionTarget:"owner",hoverTarget:"owner",hoverDecorationTarget:"label",translateTarget:"owner",canSnap:!1,canReceiveTerminalBinding:!1,contributesToSelectionFrame:!1,canUseSelectionResizeHandles:!0,canUseSelectionRotateHandle:!0,canPlaceCaretWhenOwnerSelected:!0,showsCompanionFrameWhenOwnerSelected:!1}};function Gm(e,t){return e?Math.min(e.paddingInline,Math.max(0,(t-1)/2)):0}function Zm(e,t){return D(e.shapes.computeLocalToPageTransform(t),e.shapes.computeLocalBounds(t),{preferredRotation:t.rotation,preferredScaleXSign:t.scaleX,preferredScaleYSign:t.scaleY})?.rotation??t.rotation}function Qm(e,t,n,r){const o=e.shapes.getUtil(t),i=D(e.shapes.computeLocalToPageTransform(t),e.shapes.computeLocalBounds(t),{preferredRotation:t.rotation,preferredScaleXSign:t.scaleX,preferredScaleYSign:t.scaleY});if(!i)return null;const s={...t,...i,x:r.x,y:r.y,rotation:r.rotation,props:o.validateProps({...t.props,...r.props})},a=n.startsWith("shape:")?e.shapes.get(n):null;if(n.startsWith("shape:")&&!a)return null;const l=(a?e.shapes.computeLocalToPageTransform(a):A.Identity()).tryInvert();return l?D(l.compose(o.getLocalTransform(s)),o.getLocalBounds(s),{preferredRotation:t.rotation,preferredScaleXSign:t.scaleX,preferredScaleYSign:t.scaleY}):null}function eg(e,t,n){const r=e.bindings.getToShape(t).find(e=>e.type===n);if(!r)return null;const o=e.shapes.get(r.fromId);return Hm(o)?o:null}function tg(e,t){const n={...Vm(e),...t.layout.props,autoSize:!1,textAlign:"middle"},r=Qm(e,{id:"shape:draft-label",typeName:"shape",scope:"document",type:"text",parentId:t.owner.parentId,index:t.index,x:0,y:0,rotation:0,scaleX:1,scaleY:1,opacity:1,isHidden:!1,isLocked:!1,meta:{},props:n},t.owner.parentId,t.layout);if(!r)return null;const o=e.operations.begin({kind:t.operationKind,label:"shape.create",source:"user",history:"record"});try{const o=Km(e,{x:r.x,y:r.y,parentId:t.owner.parentId,index:t.index,rotation:r.rotation,scaleX:r.scaleX,scaleY:r.scaleY,props:n},"user");return e.commands.createBinding({type:t.bindingType,fromId:o.id,toId:t.owner.id,props:t.bindingProps},{source:"user"}),o}catch(i){throw o.cancel(),i}}function ng(e,t){const n=e.shapes.get(t);if(!Hm(n))return null;const r=e.bindings.getFromShape(t).find(e=>e.type in Jm);if(!r)return null;const o=r.type;return{label:n,ownerId:r.toId,bindingType:o,behavior:Jm[o]}}function rg(e,t,n,r){if("path-label"===r)return{minWidth:24,maxWidth:120,paddingInline:4.25};const o=Math.max(.01,t.props.scale),i=e.shapes.computeLocalBounds(n),s="geo"===n.type?n.props.kind:null,a="summary"===s||"summary-left"===s?.75:1;return{minWidth:16,maxWidth:Math.max(16,i.w*a/o),paddingInline:16,normalizedCenterX:"summary-left"===s?1-a/2:a/2}}function og(e,t){const n=ng(e,t.id);if(!n)return null;const r=e.shapes.get(n.ownerId);return r?rg(e,t,r,n.bindingType):null}function ig(e,t,n){e.editing.start({shapeId:t.id,entryMode:n.entryMode??"selectAll",operationKind:n.isExisting?n.editOperationKind:n.createOperationKind,reuseActiveOperation:!n.isExisting},"user")}function sg(e,t={}){const n={offset:0};return e.content.map((e,r)=>(r>0&&(n.offset+=1),ag(e,`block:${r}`,n,t)))}function ag(e,t,n,r){const o="codeBlock"===e.type?void 0:r.defaultBackgroundColor,i=function(e,t,n,r){return e.content?.map((e,o)=>function(e,t,n,r){if(Sm(e)){const o=n.offset;n.offset+=e.text.length;const i=function(e,t,n){const r=t+e.length,o=n.searchRanges?.filter(e=>e.from<r&&e.to>t);if(!o||0===o.length)return e;const i=[];let s=0;for(const a of o){const o=Math.max(a.from,t)-t,l=Math.min(a.to,r)-t;o>s&&i.push(e.slice(s,o)),i.push( (0,Jt.jsx)("mark",{className:"land-text-search-match","data-active":n.activeSearchRange?.from===a.from&&n.activeSearchRange.to===a.to?"true":void 0,children:e.slice(o,l)},`search:${a.from}:${a.to}:${t}`)),s=l}s<e.length&&i.push(e.slice(s));return i}(e.text,o,r),s=Mm(e.marks,r.defaultBackgroundColor),a=Im(e.marks);return a&&pm(a)? (0,Jt.jsx)("span",{"data-rich-text-link":"true","data-rich-text-link-href":a,onPointerEnter:e=>{r.linkHandlers?.onPointerEnter?.({href:a,element:e.currentTarget})},onPointerLeave:()=>{r.linkHandlers?.onPointerLeave?.()},style:{...s,cursor:r.linkHandlers?"pointer":void 0,pointerEvents:r.linkHandlers?"auto":"none",textDecorationLine:lg(s?.textDecorationLine)},children:i},t): (0,Jt.jsx)("span",{style:s,children:i},t)}return"hardBreak"===e.type? (0,Jt.jsx)("br",{},t):ag(e,t,n,{...r,defaultBackgroundColor:"codeBlock"===e.type?void 0:r.defaultBackgroundColor})}(e,`${t}:${o}`,n,r))??[]}(e,t,n,{...r,defaultBackgroundColor:o});return"bulletList"===e.type? (0,Jt.jsx)("ul",{style:{listStyleType:"disc",margin:0,paddingInlineStart:"1.5em"},children:i},t):"orderedList"===e.type? (0,Jt.jsx)("ol",{style:{listStyleType:"decimal",margin:0,paddingInlineStart:"1.5em"},children:i},t):"listItem"===e.type? (0,Jt.jsx)("li",{children:i},t):"blockquote"===e.type? (0,Jt.jsx)("blockquote",{style:{borderInlineStart:"2px solid currentColor",margin:0,paddingInlineStart:"0.75em"},children:i},t): (0,Jt.jsx)("p",{style:{margin:0,textAlign:Pm(e)},children:i.length>0?i: (0,Jt.jsx)("br",{})},t)}function lg(e){const t=new Set(e?.split(/\s+/u)??[]);return t.add("underline"),["line-through","underline"].filter(e=>t.has(e)).join(" ")}var cg="default",dg={id:"host-default",label:"Host default",cssFamily:"inherit",source:{kind:"system"}};function ug(){return{defaultFont:dg,defaultFontLabel:"Default",fonts:[]}}function pg(){return hg(ug())}function hg(e){const t=new Map;for(const r of e.fonts)fg(r.id)&&"default"!==r.id&&t.set(r.id,r);const n={id:cg,label:e.defaultFontLabel,cssFamily:e.defaultFont.cssFamily,source:e.defaultFont.source};return{defaultFont:e.defaultFont,defaultFontLabel:e.defaultFontLabel,fontOptions:[n,...t.values()],fontsById:t}}function fg(e){return"string"==typeof e&&e.trim().length>0}function mg(e,t){return"default"===t?e.defaultFont:e.fontsById.get(t)??e.defaultFont}var gg=new WeakMap;function yg(e,t,n){const r=mg(t,e),o=n??("undefined"==typeof document?void 0:document);if(!o||!xg(r.source))return Promise.resolve();const i=function(e){const{source:t}=e;return t&&"system"!==t.kind?"stylesheet"===t.kind?`${e.id}:stylesheet:${t.cssUrl}`:`${e.id}:font-face:${t.family}:${String(t.src)}`:e.id}(r),s=function(e){const t=gg.get(e);if(t)return t;const n=new Map;return gg.set(e,n),n}(o),a=s.get(i);if(a)return a;const l=async function(e,t){const{source:n}=t;if(!xg(n))return;if("stylesheet"===n.kind)return await function(e,t,n){return Array.from(e.querySelectorAll("link[data-land-text-font]")).find(e=>e.dataset.landTextFont===t.id)?Promise.resolve():new Promise(r=>{const o=e.createElement("link");o.rel="stylesheet",o.href=n.cssUrl,o.dataset.landTextFont=t.id;const i=()=>r();o.addEventListener("load",i,{once:!0}),o.addEventListener("error",i,{once:!0}),(e.head??e.documentElement).appendChild(o)})}(e,t,n),void(await bg(e,n));await async function(e,t){const{fonts:n}=e,r=e.defaultView?.FontFace;if(!n||!r)return;if(Array.from(n).filter(e=>e.family===t.family&&"loaded"===e.status).length>0)return;const o=await new r(t.family,t.src,t.descriptors).load();n.add(o)}(e,n),await bg(e,n)}(o,r).catch(()=>{s.delete(i)});return s.set(i,l),l}function xg(e){return!!e&&"system"!==e.kind}async function bg(e,t){const{fonts:n}=e;if(!n)return;const r=function(e){if(e.weights)return e.weights;if("font-face"===e.kind){const t=e.descriptors?.weight;if("string"==typeof t&&/^\d+$/.test(t))return[Number(t)]}return[400]}(t),o=t.sampleText??"Aa";await Promise.all(r.map(e=>n.load(`${e} 16px "${t.family}"`,o)))}var wg=a(e=>{var t=Ut();function n(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var o={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},i=Symbol.for("react.portal");var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(e,t){return"font"===e?"":"string"==typeof t?"use-credentials"===t?t:"":void 0}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,e.createPortal=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType)throw Error(n(299));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:i,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=o.p;try{if(s.T=null,o.p=2,e)return e()}finally{s.T=t,o.p=n,o.d.f()}},e.preconnect=function(e,t){"string"==typeof e&&(t?t="string"==typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:t=null,o.d.C(e,t))},e.prefetchDNS=function(e){"string"==typeof e&&o.d.D(e)},e.preinit=function(e,t){if("string"==typeof e&&t&&"string"==typeof t.as){var n=t.as,r=a(n,t.crossOrigin),i="string"==typeof t.integrity?t.integrity:void 0,s="string"==typeof t.fetchPriority?t.fetchPriority:void 0;"style"===n?o.d.S(e,"string"==typeof t.precedence?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:s}):"script"===n&&o.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:s,nonce:"string"==typeof t.nonce?t.nonce:void 0})}},e.preinitModule=function(e,t){if("string"==typeof e)if("object"==typeof t&&null!==t){if(null==t.as||"script"===t.as){var n=a(t.as,t.crossOrigin);o.d.M(e,{crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0})}}else t??o.d.M(e)},e.preload=function(e,t){if("string"==typeof e&&"object"==typeof t&&null!==t&&"string"==typeof t.as){var n=t.as,r=a(n,t.crossOrigin);o.d.L(e,n,{crossOrigin:r,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,type:"string"==typeof t.type?t.type:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"==typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"==typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"==typeof t.imageSizes?t.imageSizes:void 0,media:"string"==typeof t.media?t.media:void 0})}},e.preloadModule=function(e,t){if("string"==typeof e)if(t){var n=a(t.as,t.crossOrigin);o.d.m(e,{as:"string"==typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0})}else o.d.m(e)},e.requestFormReset=function(e){o.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version="19.2.6"}),vg=a(e=>{"production"!==process.env.NODE_ENV&&function(){function t(){}function n(e){return""+e}function r(e,t){return"font"===e?"":"string"==typeof t?"use-credentials"===t?t:"":void 0}function o(e){return null===e?"`null`":void 0===e?"`undefined`":""===e?"an empty string":'something with type "'+typeof e+'"'}function i(e){return null===e?"`null`":void 0===e?"`undefined`":""===e?"an empty string":"string"==typeof e?JSON.stringify(e):"number"==typeof e?"`"+e+"`":'something with type "'+typeof e+'"'}function s(){var e=d.H;return null===e&&console.error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."),e}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var a=Ut(),l={d:{f:t,r:function(){throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React.")},D:t,C:t,L:t,m:t,X:t,S:t,M:t},p:0,findDOMNode:null},c=Symbol.for("react.portal"),d=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;"function"==typeof Map&&null!=Map.prototype&&"function"==typeof Map.prototype.forEach&&"function"==typeof Set&&null!=Set.prototype&&"function"==typeof Set.prototype.clear&&"function"==typeof Set.prototype.forEach||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,e.createPortal=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType)throw Error("Target container is not a DOM element.");return function(e,t,r){var o=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;try{n(o);var i=!1}catch(s){i=!0}return i&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.","function"==typeof Symbol&&Symbol.toStringTag&&o[Symbol.toStringTag]||o.constructor.name||"Object"),n(o)),{$$typeof:c,key:null==o?null:""+o,children:e,containerInfo:t,implementation:r}}(e,t,null,r)},e.flushSync=function(e){var t=d.T,n=l.p;try{if(d.T=null,l.p=2,e)return e()}finally{d.T=t,l.p=n,l.d.f()&&console.error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.")}},e.preconnect=function(e,t){"string"==typeof e&&e?null!=t&&"object"!=typeof t?console.error("ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",i(t)):null!=t&&"string"!=typeof t.crossOrigin&&console.error("ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",o(t.crossOrigin)):console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",o(e)),"string"==typeof e&&(t?t="string"==typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:t=null,l.d.C(e,t))},e.prefetchDNS=function(e){if("string"==typeof e&&e){if(1<arguments.length){var t=arguments[1];"object"==typeof t&&t.hasOwnProperty("crossOrigin")?console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",i(t)):console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",i(t))}}else console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",o(e));"string"==typeof e&&l.d.D(e)},e.preinit=function(e,t){if("string"==typeof e&&e?null==t||"object"!=typeof t?console.error("ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",i(t)):"style"!==t.as&&"script"!==t.as&&console.error('ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',i(t.as)):console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",o(e)),"string"==typeof e&&t&&"string"==typeof t.as){var n=t.as,s=r(n,t.crossOrigin),a="string"==typeof t.integrity?t.integrity:void 0,c="string"==typeof t.fetchPriority?t.fetchPriority:void 0;"style"===n?l.d.S(e,"string"==typeof t.precedence?t.precedence:void 0,{crossOrigin:s,integrity:a,fetchPriority:c}):"script"===n&&l.d.X(e,{crossOrigin:s,integrity:a,fetchPriority:c,nonce:"string"==typeof t.nonce?t.nonce:void 0})}},e.preinitModule=function(e,t){var n="";if("string"==typeof e&&e||(n+=" The `href` argument encountered was "+o(e)+"."),void 0!==t&&"object"!=typeof t?n+=" The `options` argument encountered was "+o(t)+".":t&&"as"in t&&"script"!==t.as&&(n+=" The `as` option encountered was "+i(t.as)+"."),n)console.error("ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",n);else if("script"===(n=t&&"string"==typeof t.as?t.as:"script"));else n=i(n),console.error('ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',n,e);"string"==typeof e&&("object"==typeof t&&null!==t?null!=t.as&&"script"!==t.as||(n=r(t.as,t.crossOrigin),l.d.M(e,{crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0})):t??l.d.M(e))},e.preload=function(e,t){var n="";if("string"==typeof e&&e||(n+=" The `href` argument encountered was "+o(e)+"."),null==t||"object"!=typeof t?n+=" The `options` argument encountered was "+o(t)+".":"string"==typeof t.as&&t.as||(n+=" The `as` option encountered was "+o(t.as)+"."),n&&console.error('ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',n),"string"==typeof e&&"object"==typeof t&&null!==t&&"string"==typeof t.as){var i=r(n=t.as,t.crossOrigin);l.d.L(e,n,{crossOrigin:i,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,type:"string"==typeof t.type?t.type:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"==typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"==typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"==typeof t.imageSizes?t.imageSizes:void 0,media:"string"==typeof t.media?t.media:void 0})}},e.preloadModule=function(e,t){var n="";"string"==typeof e&&e||(n+=" The `href` argument encountered was "+o(e)+"."),void 0!==t&&"object"!=typeof t?n+=" The `options` argument encountered was "+o(t)+".":t&&"as"in t&&"string"!=typeof t.as&&(n+=" The `as` option encountered was "+o(t.as)+"."),n&&console.error('ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',n),"string"==typeof e&&(t?(n=r(t.as,t.crossOrigin),l.d.m(e,{as:"string"==typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0})):l.d.m(e))},e.requestFormReset=function(e){l.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s().useFormState(e,t,n)},e.useFormStatus=function(){return s().useHostTransitionStatus()},e.version="19.2.6","undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()}),kg=a((e,t)=>{"production"===process.env.NODE_ENV?(!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){if("production"!==process.env.NODE_ENV)throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}}(),t.exports=wg()):t.exports=vg()}),Sg=a(e=>{var t=Ut();var n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=t.useState,o=t.useEffect,i=t.useLayoutEffect,s=t.useDebugValue;function a(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch(o){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),l=r({inst:{value:n,getSnapshot:t}}),c=l[0].inst,d=l[1];return i(function(){c.value=n,c.getSnapshot=t,a(c)&&d({inst:c})},[e,n,t]),o(function(){return a(c)&&d({inst:c}),e(function(){a(c)&&d({inst:c})})},[e]),s(n),n};e.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:l}),Pg=a(e=>{"production"!==process.env.NODE_ENV&&function(){function t(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(o){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=Ut(),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useState,i=n.useEffect,s=n.useLayoutEffect,a=n.useDebugValue,l=!1,c=!1,d="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,d){l||void 0===n.startTransition||(l=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var u=d();if(!c){var p=d();r(u,p)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var h=(p=o({inst:{value:u,getSnapshot:d}}))[0].inst,f=p[1];return s(function(){h.value=u,h.getSnapshot=d,t(h)&&f({inst:h})},[e,u,d]),i(function(){return t(h)&&f({inst:h}),e(function(){t(h)&&f({inst:h})})},[e]),a(u),u};e.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:d,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()}),Mg=a((e,t)=>{"production"===process.env.NODE_ENV?t.exports=Sg():t.exports=Pg()});function Ig(e){this.content=e}function Eg(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(r),i=t.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){let e=o.text,t=i.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&Og(e.charCodeAt(r-1))&&Cg(e.charCodeAt(r))&&n--,n}if(o.content.size||i.content.size){let e=Eg(o.content,i.content,n+1);if(null!=e)return e}n+=o.nodeSize}else n+=o.nodeSize}}function Tg(e,t,n,r){for(let o=e.childCount,i=t.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let s=e.child(--o),a=t.child(--i),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let e=s.text,t=a.text,o=e.length,i=t.length;for(;o>0&&i>0&&e[o-1]==t[i-1];)o--,i--,n--,r--;return o&&i&&o<e.length&&Og(e.charCodeAt(o-1))&&Cg(e.charCodeAt(o))&&(n++,r++),{a:n,b:r}}if(s.content.size||a.content.size){let e=Tg(s.content,a.content,n-1,r-1);if(e)return e}n-=l,r-=l}else n-=l,r-=l}}function Cg(e){return e>=56320&&e<57344}function Og(e){return e>=55296&&e<56320}Ig.prototype={constructor:Ig,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,o=r.find(e),i=r.content.slice();return-1==o?i.push(n||e,t):(i[o+1]=t,n&&(i[o]=n)),new Ig(i)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new Ig(n)},addToStart:function(e,t){return new Ig([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Ig(n)},addBefore:function(e,t,n){var r=this.remove(t),o=r.content.slice(),i=r.find(e);return o.splice(-1==i?o.length:i,0,t,n),new Ig(o)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=Ig.from(e)).size?new Ig(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=Ig.from(e)).size?new Ig(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Ig.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},Ig.from=function(e){if(e instanceof Ig)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Ig(t)};var Ag=class e{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,r=0,o){for(let i=0,s=0;s<t;i++){let a=this.content[i],l=s+a.nodeSize;if(l>e&&!1!==n(a,r+s,o||null,i)&&a.content.size){let o=s+1;a.nodesBetween(Math.max(0,e-o),Math.min(a.content.size,t-o),n,r+o)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let o="",i=!0;return this.nodesBetween(e,t,(s,a)=>{let l=s.isText?s.text.slice(Math.max(e,a)-a,t-a):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&l||s.isTextblock)&&n&&(i?i=!1:o+=n),o+=l},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i<t.content.length;i++)o.push(t.content[i]);return new e(o,this.size+t.size)}cut(t,n=this.size){if(0==t&&n==this.size)return this;let r=[],o=0;if(n>t)for(let e=0,i=0;i<n;e++){let s=this.content[e],a=i+s.nodeSize;a>t&&((i<t||a>n)&&(s=s.isText?s.cut(Math.max(0,t-i),Math.min(s.text.length,n-i)):s.cut(Math.max(0,t-i-1),Math.min(s.content.size,n-i-1))),r.push(s),o+=s.nodeSize),i=a}return new e(r,o)}cutByIndex(t,n){return t==n?e.empty:0==t&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[t]=n,new e(o,i)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return Eg(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Tg(this,e,t,n)}findIndex(e){if(0==e)return Ng(0,e);if(e==this.size)return Ng(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=n+this.child(t).nodeSize;if(r>=e)return r==e?Ng(t+1,r):Ng(t,n);n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let o=t[e];r+=o.nodeSize,e&&o.isText&&t[e-1].sameMarkup(o)?(n||(n=t.slice(0,e)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};Ag.empty=new Ag([],0);var Rg={index:0,offset:0};function Ng(e,t){return Rg.index=e,Rg.offset=t,Rg}function Lg(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!Lg(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Lg(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var $g=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Lg(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&0==t.length)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};$g.none=[];var Dg=class extends Error{},jg=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=zg(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(Bg(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,o=n.openEnd||0;if("number"!=typeof r||"number"!=typeof o)throw new RangeError("Invalid input for Slice.fromJSON");return new e(Ag.fromJSON(t,n.content),r,o)}static maxOpen(t,n=!0){let r=0,o=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)o++;return new e(t,r,o)}};function Bg(e,t,n){let{index:r,offset:o}=e.findIndex(t),i=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(o==t||i.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,i.copy(Bg(i.content,t-o-1,n-o-1)))}function zg(e,t,n,r,o,i){let{index:s,offset:a}=e.findIndex(t),l=e.maybeChild(s);if(a==t||l.isText)return i&&r<=0&&o<=0&&!i.canReplace(s,s,n)?null:e.cut(0,t).append(n).append(e.cut(t));let c=zg(l.content,t-a-1,n,0==s?r-1:0,s==e.childCount-1?o-1:0,l);return c&&e.replaceChild(s,l.copy(c))}function _g(e,t,n){if(n.openStart>e.depth)throw new Dg("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Dg("Inconsistent open depths");return Fg(e,t,n,0)}function Fg(e,t,n,r){let o=e.index(r),i=e.node(r);if(o==t.index(r)&&r<e.depth-n.openStart){let s=Fg(e,t,n,r+1);return i.copy(i.content.replaceChild(o,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:o,end:s}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let o=n-1;o>=0;o--)r=t.node(o).copy(Ag.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return Kg(i,qg(e,o,s,t,r))}{let r=e.parent,o=r.content;return Kg(r,o.cut(0,e.parentOffset).append(n.content).append(o.cut(t.parentOffset)))}}return Kg(i,Yg(e,t,r))}function Wg(e,t){if(!t.type.compatibleContent(e.type))throw new Dg("Cannot join "+t.type.name+" onto "+e.type.name)}function Hg(e,t,n){let r=e.node(n);return Wg(r,t.node(n)),r}function Ug(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Vg(e,t,n,r){let o=(t||e).node(n),i=0,s=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(Ug(e.nodeAfter,r),i++));for(let a=i;a<s;a++)Ug(o.child(a),r);t&&t.depth==n&&t.textOffset&&Ug(t.nodeBefore,r)}function Kg(e,t){if(!e.type.validContent(t))throw new Dg("Invalid content for node "+e.type.name);return e.copy(t)}function qg(e,t,n,r,o){let i=e.depth>o&&Hg(e,t,o+1),s=r.depth>o&&Hg(n,r,o+1),a=[];return Vg(null,e,o,a),i&&s&&t.index(o)==n.index(o)?(Wg(i,s),Ug(Kg(i,qg(e,t,n,r,o+1)),a)):(i&&Ug(Kg(i,Yg(e,t,o+1)),a),Vg(t,n,o,a),s&&Ug(Kg(s,Yg(n,r,o+1)),a)),Vg(r,null,o,a),new Ag(a)}function Yg(e,t,n){let r=[];return Vg(null,e,n,r),e.depth>n&&Ug(Kg(Hg(e,t,n+1),Yg(e,t,n+1)),r),Vg(t,null,n,r),new Ag(r)}jg.empty=new jg(Ag.empty,0,0);var Xg=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let o=0;o<e;o++)r+=n.child(o).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return $g.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let o=n.marks;for(var i=0;i<o.length;i++)!1!==o[i].type.spec.inclusive||r&&o[i].isInSet(r.marks)||(o=o[i--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Qg(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(i),s=i-n;if(r.push(e,t,o+n),!s)break;if(e=e.child(t),e.isText)break;i=s-1,o+=n+1}return new e(n,r,i)}static resolveCached(t,n){let r=Zg.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Zg.set(t,r=new Jg);let o=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%Gg,o}},Jg=class{constructor(){this.elts=[],this.i=0}},Gg=12,Zg=new WeakMap,Qg=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},ey=Object.create(null),ty=class e{constructor(e,t,n,r=$g.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||Ag.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&Lg(this.attrs,t||e.defaultAttrs||ey)&&$g.sameSet(this.marks,n||$g.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return jg.empty;let r=this.resolve(e),o=this.resolve(t),i=n?0:r.sharedDepth(t),s=r.start(i);return new jg(r.node(i).content.cut(r.pos-s,o.pos-s),r.depth-i,o.depth-i)}replace(e,t,n){return _g(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Xg.resolveCached(this,e)}resolveNoCache(e){return Xg.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),ry(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=Ag.empty,r=0,o=n.childCount){let i=this.contentMatchAt(e).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let a=r;a<o;a++)if(!this.type.allowsMarks(n.child(a).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(e).matchType(n),i=o&&o.matchFragment(this.content,t);return!!i&&i.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=$g.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!$g.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=Ag.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,r,n);return o.type.checkAttrs(o.attrs),o}};ty.prototype.text=void 0;var ny=class e extends ty{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ry(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function ry(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}var oy=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new iy(t,n);if(null==r.next)return e.empty;let o=sy(r);r.next&&r.err("Unexpected trailing text");let i=hy(function(e){let t=[[]];return o(i(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let o={term:r,to:n};return t[e].push(o),o}function o(e,t){e.forEach(e=>e.to=t)}function i(e,t){if("choice"==e.type)return e.exprs.reduce((e,n)=>e.concat(i(n,t)),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return r(t,s),o(i(e.expr,s),s),[r(s)]}if("plus"==e.type){let s=n();return o(i(e.expr,t),s),o(i(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(t)].concat(i(e.expr,t));if("range"==e.type){let s=t;for(let t=0;t<e.min;t++){let t=n();o(i(e.expr,s),t),s=t}if(-1==e.max)o(i(e.expr,s),s);else for(let t=e.min;t<e.max;t++){let t=n();r(s,t),o(i(e.expr,s),t),s=t}return[r(s)]}if("name"==e.type)return[r(t,void 0,e.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=i(e.exprs[r],t);if(r==e.exprs.length-1)return s;o(s,t=n())}}}(o));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],o=!e.validEnd,i=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];i.push(n.name),!o||n.isText||n.hasRequiredAttrs()||(o=!1),-1==r.indexOf(s)&&r.push(s)}o&&t.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let o=t;r&&o<n;o++)r=r.matchType(e.child(o).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function o(i,s){let a=i.matchFragment(e,n);if(a&&(!t||a.validEnd))return Ag.from(s.map(e=>e.createAndFill()));for(let e=0;e<i.next.length;e++){let{type:t,next:n}=i.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=o(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),o=r.match;if(o.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<o.next.length;e++){let{type:i,next:s}=o.next[e];i.isLeaf||i.hasRequiredAttrs()||i.name in t||r.type&&!s.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),t[i.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let o=0;o<t.next.length;o++)r+=(o?", ":"")+t.next[o].type.name+"->"+e.indexOf(t.next[o].next);return r}).join("\n")}};oy.empty=new oy(!0);var iy=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}};function sy(e){let t=[];do{t.push(ay(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function ay(e){let t=[];do{t.push(ly(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function ly(e){let t=function(e){if(e.eat("(")){let t=sy(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let o=[];for(let i in n){let e=n[i];e.isInGroup(t)&&o.push(e)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(e,e.next).map(t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=dy(e,t)}return t}function cy(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function dy(e,t){let n=cy(e),r=n;return e.eat(",")&&(r="}"!=e.next?cy(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function uy(e,t){return t-e}function py(e,t){let n=[];return function t(r){let o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(let e=0;e<o.length;e++){let{term:r,to:i}=o[e];r||-1!=n.indexOf(i)||t(i)}}(t),n.sort(uy)}function hy(e){let t=Object.create(null);return function n(r){let o=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<o.length;e++)o[e][0]==t&&(r=o[e][1]);py(e,n).forEach(e=>{r||o.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)})})});let i=t[r.join(",")]=new oy(r.indexOf(e.length-1)>-1);for(let e=0;e<o.length;e++){let r=o[e][1].sort(uy);i.next.push({type:o[e][0],next:t[r.join(",")]||n(r)})}return i}(py(e,0))}function fy(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function my(e,t){let n=Object.create(null);for(let r in e){let o=t&&t[r];if(void 0===o){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=t.default}n[r]=o}return n}function gy(e,t,n,r){for(let o in t)if(!(o in e))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${r}`);for(let o in e)e[o].validate&&e[o].validate(t[o])}function yy(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new by(e,r,t[r]);return n}var xy=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=yy(e,n.attrs),this.defaultAttrs=fy(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==oy.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:my(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ty(this,this.computeAttrs(e),Ag.from(t),$g.setFrom(n))}createChecked(e=null,t,n){return t=Ag.from(t),this.checkContent(t),new ty(this,this.computeAttrs(e),t,$g.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=Ag.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),o=r&&r.fillBefore(Ag.empty,!0);return o?new ty(this,e,t.append(o),$g.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){gy(this.attrs,e,"node",this.name)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:$g.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,o)=>r[t]=new e(t,n,o));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let e in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};var by=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let r=n.split("|");return n=>{let o=null===n?"null":typeof n;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${o}`)}}(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},wy=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=yy(e,r.attrs),this.excluded=null;let o=fy(this.attrs);this.instance=o?new $g(this,o):null}create(e=null){return!e&&this.instance?this.instance:new $g(this,my(this.attrs,e))}static compile(t,n){let r=Object.create(null),o=0;return t.forEach((t,i)=>r[t]=new e(t,o++,n,i)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){gy(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},vy=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let r in e)t[r]=e[r];t.nodes=Ig.from(e.nodes),t.marks=Ig.from(e.marks||{}),this.nodes=xy.compile(this.spec.nodes,this),this.marks=wy.compile(this.spec.marks,this);let n=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let e=this.nodes[r],t=e.spec.content||"",o=e.spec.marks;if(e.contentMatch=n[t]||(n[t]=oy.parse(t,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!e.isInline||!e.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=e}e.markSet="_"==o?null:o?ky(this,o.split(" ")):""!=o&&e.inlineContent?null:[]}for(let r in this.marks){let e=this.marks[r],t=e.spec.excludes;e.excluded=null==t?[e]:""==t?[]:ky(this,t.split(" "))}this.nodeFromJSON=e=>ty.fromJSON(this,e),this.markFromJSON=e=>$g.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof xy))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new ny(n,n.defaultAttrs,e,$g.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}};function ky(e,t){let n=[];for(let r=0;r<t.length;r++){let o=t[r],i=e.marks[o],s=i;if(i)n.push(i);else for(let t in e.marks){let r=e.marks[t];("_"==o||r.spec.group&&r.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}var Sy=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(function(e){return null!=e.tag}(e))this.tags.push(e);else if(function(e){return null!=e.style}(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new Cy(this,t,!1);return n.addAll(e,$g.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Cy(this,t,!0);return n.addAll(e,$g.none,t.from,t.to),jg.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(Oy(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let r=this.styles[o],i=r.style;if(!(0!=i.indexOf(e)||r.context&&!n.matchesContext(r.context)||i.length>e.length&&(61!=i.charCodeAt(e.length)||i.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let r in e.marks){let t=e.marks[r].spec.parseDOM;t&&t.forEach(e=>{n(e=Ay(e)),e.mark||e.ignore||e.clearMark||(e.mark=r)})}for(let r in e.nodes){let t=e.nodes[r].spec.parseDOM;t&&t.forEach(e=>{n(e=Ay(e)),e.node||e.ignore||e.mark||(e.node=r)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},Py={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},My={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Iy={ol:!0,ul:!0};function Ey(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}var Ty=class{constructor(e,t,n,r,o,i){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=i,this.content=[],this.activeMarks=$g.none,this.match=o||(4&i?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(Ag.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=Ag.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(Ag.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Py.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},Cy=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r,o=t.topNode,i=Ey(null,t.preserveWhitespace,0)|(n?4:0);r=o?new Ty(o.type,o.attrs,$g.none,!0,t.topMatch||o.type.contentMatch,i):new Ty(n?null:e.schema.topNodeType,null,$g.none,!0,null,i),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,o=2&r.options?"full":this.localPreserveWS||(1&r.options)>0,{schema:i}=this.parser;if("full"===o||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(o)if("full"===o)n=n.replace(/\r\n?/g,"\n");else if(i.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(i.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(i.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(i.text(e[n]),t,!/\S/.test(e[n]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],o=e.previousSibling;(!t||o&&"BR"==o.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(i.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,o=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let i,s=e.nodeName.toLowerCase();Iy.hasOwnProperty(s)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&Iy.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,n));e:if(a?a.ignore:My.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let n,r=this.needsBlock;if(Py.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),n=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let i=a&&a.skip?t:this.readStyles(e,t);i&&this.addAll(e,i),n&&this.sync(o),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,a,n,!1===a.consuming?i:void 0)}this.localPreserveWS=r}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let r=0;r<this.parser.matchedStyles.length;r++){let e=this.parser.matchedStyles[r],o=n.getPropertyValue(e);if(o)for(let n;;){let r=this.parser.matchStyle(e,o,this,n);if(!r)break;if(r.ignore)return null;if(t=r.clearMark?t.filter(e=>!r.clearMark(e)):t.concat(this.parser.schema.marks[r.mark].create(r.attrs)),!1!==r.consuming)break;n=r}}return t}addElementByRule(e,t,n,r){let o,i;if(t.node)if(i=this.parser.schema.nodes[t.node],i.isLeaf)this.insertNode(i.create(t.attrs),n,"BR"==e.nodeName)||this.leafFallback(e,n);else{let e=this.enter(i,t.attrs||null,n,t.preserveWhitespace);e&&(o=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let s=this.top;if(i&&i.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}o&&this.sync(s)&&this.open--}addAll(e,t,n,r){let o=n||0;for(let i=n?e.childNodes[n]:e.firstChild,s=null==r?null:e.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i,t);this.findAtPoint(e,o)}findPlace(e,t,n){let r,o;for(let i=this.open,s=0;i>=0;i--){let t=this.nodes[i],a=t.findWrapping(e);if(a&&(!r||r.length>a.length+s)&&(r=a,o=t,!a.length))break;if(t.solid){if(n)break;s+=2}}if(!r)return null;this.sync(o);for(let i=0;i<r.length;i++)t=this.enterInner(r[i],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&(t.match=t.match.matchType(e.type));let n=$g.none;for(let o of r.concat(e.marks))(t.type?t.type.allowsMarkType(o.type):Ry(o.type,e.type))&&(n=o.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let o=this.findPlace(e.create(t),n,!1);return o&&(o=this.enterInner(e,t,n,!0,r)),o}enterInner(e,t,n,r=!1,o){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(e);let s=Ey(e,o,i.options);4&i.options&&0==i.content.length&&(s|=4);let a=$g.none;return n=n.filter(t=>!(i.type?i.type.allowsMarkType(t.type):Ry(t.type,e))||(a=t.addToSet(a),!1)),this.nodes.push(new Ty(e,t,a,r,null,s)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!(!this.isOpen&&!this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=1)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),o=-(n?n.depth+1:0)+(r?0:1),i=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=o;s--)if(i(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!e||e.name!=a&&!e.isInGroup(a))return!1;s--}}return!0};return i(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}};function Oy(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Ay(e){let t={};for(let n in e)t[n]=e[n];return t}function Ry(e,t){let n=t.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(e))continue;let i=[],s=e=>{i.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:o}=e.edge(n);if(r==t)return!0;if(i.indexOf(o)<0&&s(o))return!0}};if(s(o.contentMatch))return!0}}var Ny=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=$y(t).createDocumentFragment());let r=n,o=[];return e.forEach(e=>{if(o.length||e.marks.length){let n=0,i=0;for(;n<o.length&&i<e.marks.length;){let t=e.marks[i];if(this.marks[t.type.name]){if(!t.eq(o[n][0])||!1===t.type.spec.spanning)break;n++,i++}else i++}for(;n<o.length;)r=o.pop()[1];for(;i<e.marks.length;){let n=e.marks[i++],s=this.serializeMark(n,e.isInline,t);s&&(o.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){if(e.isText)return $y(t).createTextNode(e.text);let{dom:n,contentDOM:r}=By($y(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&By($y(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return"string"==typeof t?{dom:e.createTextNode(t)}:By(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=Ly(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return Ly(e.marks)}};function Ly(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function $y(e){return e.document||window.document}var Dy=new WeakMap;function jy(e){let t=Dy.get(e);return void 0===t&&Dy.set(e,t=function(e){let t=null;function n(e){if(e&&"object"==typeof e)if(Array.isArray(e))if("string"==typeof e[0])t||(t=[]),t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}(e)),t}function By(e,t,n,r){if(1==t.nodeType)return{dom:t};if(t.dom&&1==t.dom.nodeType)return t;let o,i=t[0];if("string"!=typeof i)throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=jy(r))&&o.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s,a=i.indexOf(" ");a>0&&(n=i.slice(0,a),i=i.slice(a+1));let l=n?e.createElementNS(n,i):e.createElement(i),c=t[1],d=1;if(c&&"object"==typeof c&&null==c.nodeType&&!Array.isArray(c)){d=2;for(let e in c)if(null!=c[e]){let t=e.indexOf(" ");t>0?l.setAttributeNS(e.slice(0,t),e.slice(t+1),c[e]):"style"==e&&l.style?l.style.cssText=c[e]:l.setAttribute(e,c[e])}}for(let u=d;u<t.length;u++){let o=t[u];if(0===o){if(u<t.length-1||u>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}if("string"==typeof o)l.appendChild(e.createTextNode(o));else{let{dom:t,contentDOM:i}=By(e,o,n,r);if(l.appendChild(t),i){if(s)throw new RangeError("Multiple content holes");s=i}}}return{dom:l,contentDOM:s}}var zy=Math.pow(2,16);function _y(e,t){return e+t*zy}function Fy(e){return 65535&e}var Wy=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}},Hy=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=Fy(e);if(!this.inverted)for(let r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/zy}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>e)break;let l=this.ranges[s+o],c=this.ranges[s+i],d=a+l;if(e<=d){let o=a+r+((l?e==a?-1:e==d?1:t:t)<0?0:c);if(n)return o;let i=e==(t<0?a:d)?null:_y(s/3,e-a),u=e==a?2:e==d?1:4;return(t<0?e!=a:e!=d)&&(u|=8),new Wy(o,u,i)}r+=c-l}return n?e+r:new Wy(e+r,0,null)}touches(e,t){let n=0,r=Fy(t),o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let t=this.ranges[s]-(this.inverted?n:0);if(t>e)break;let a=this.ranges[s+o];if(e<=t+a&&s==3*r)return!0;n+=this.ranges[s+i]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],s=i-(this.inverted?o:0),a=i+(this.inverted?0:o),l=this.ranges[r+t],c=this.ranges[r+n];e(s,s+l,a,a+c),o+=c-l}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};Hy.empty=new Hy([]);var Uy=class e{constructor(e,t,n=0,r=(e?e.length:0)){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=t&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let o=this.from;o<this.to;o++){let n=this._maps[o].mapResult(e,t);if(null!=n.recover){let t=this.getMirror(o);if(null!=t&&t>o&&t<this.to){o=t,e=this._maps[t].recover(n.recover);continue}}r|=n.delInfo,e=n.pos}return n?e:new Wy(e,r,null)}},Vy=Object.create(null),Ky=class{getMap(){return Hy.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Vy[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Vy)throw new RangeError("Duplicate use of step JSON ID "+e);return Vy[e]=t,t.prototype.jsonID=e,t}},qy=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,o){try{return e.ok(t.replace(n,r,o))}catch(i){if(i instanceof Dg)return e.fail(i.message);throw i}}};function Yy(e,t,n){let r=[];for(let o=0;o<e.childCount;o++){let i=e.child(o);i.content.size&&(i=i.copy(Yy(i.content,t,i))),i.isInline&&(i=t(i,n,o)),r.push(i)}return Ag.fromArray(r)}var Xy=class e extends Ky{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),o=new jg(Yy(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,r),t.openStart,t.openEnd);return qy.fromReplace(e,this.from,this.to,o)}invert(){return new Jy(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}};Ky.jsonID("addMark",Xy);var Jy=class e extends Ky{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new jg(Yy(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return qy.fromReplace(e,this.from,this.to,n)}invert(){return new Xy(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}};Ky.jsonID("removeMark",Jy);var Gy=class e extends Ky{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return qy.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return qy.fromReplace(e,this.pos,this.pos+1,new jg(Ag.from(n),0,t.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new Zy(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new e(n.pos,t.markFromJSON(n.mark))}};Ky.jsonID("addNodeMark",Gy);var Zy=class e extends Ky{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return qy.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return qy.fromReplace(e,this.pos,this.pos+1,new jg(Ag.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new Gy(this.pos,this.mark):this}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new e(n.pos,t.markFromJSON(n.mark))}};Ky.jsonID("removeNodeMark",Zy);var Qy=class e extends Ky{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&tx(e,this.from,this.to)?qy.fail("Structure replace would overwrite content"):qy.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Hy([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let n=this.slice.size+t.slice.size==0?jg.empty:new jg(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}}{let n=this.slice.size+t.slice.size==0?jg.empty:new jg(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new e(n.from,n.to,jg.fromJSON(t,n.slice),!!n.structure)}};Qy.MAP_BIAS=1,Ky.jsonID("replace",Qy);var ex=class e extends Ky{constructor(e,t,n,r,o,i,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=s}apply(e){if(this.structure&&(tx(e,this.from,this.gapFrom)||tx(e,this.gapTo,this.to)))return qy.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return qy.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?qy.fromReplace(e,this.from,this.to,n):qy.fail("Content does not fit in gap")}getMap(){return new Hy([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||i>r.pos?null:new e(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new e(n.from,n.to,n.gapFrom,n.gapTo,jg.fromJSON(t,n.slice),n.insert,!!n.structure)}};function tx(e,t,n){let r=e.resolve(t),o=n-t,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let e=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,o--}}return!1}function nx(e,t,n,r=n.contentMatch,o=!0){let i=e.doc.nodeAt(t),s=[],a=t+1;for(let l=0;l<i.childCount;l++){let t=i.child(l),c=a+t.nodeSize,d=r.matchType(t.type);if(d){r=d;for(let r=0;r<t.marks.length;r++)n.allowsMarkType(t.marks[r].type)||e.step(new Jy(a,c,t.marks[r]));if(o&&t.isText&&"pre"!=n.whitespace){let e,r,o=/\r?\n|\r/g;for(;e=o.exec(t.text);)r||(r=new jg(Ag.from(n.schema.text(" ",n.allowedMarks(t.marks))),0,0)),s.push(new Qy(a+e.index,a+e.index+e[0].length,r))}}else s.push(new Qy(a,c,jg.empty));a=c}if(!r.validEnd){let t=r.fillBefore(Ag.empty,!0);e.replace(a,a,new jg(t,0,0))}for(let l=s.length-1;l>=0;l--)e.step(s[l])}function rx(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function ox(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,o=0;;--n){let i=e.$from.node(n),s=e.$from.index(n)+r,a=e.$to.indexAfter(n)-o;if(n<e.depth&&i.canReplace(s,a,t))return n;if(0==n||i.type.spec.isolating||!rx(i,s,a))break;s&&(r=1),a<i.childCount&&(o=1)}return null}function ix(e,t,n=null,r=e){let o=function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;let s=i.length?i[0]:t;return n.canReplaceWith(r,o,s)?i:null}(e,t),i=o&&function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.child(r),s=t.contentMatch.findWrapping(i.type);if(!s)return null;let a=(s.length?s[s.length-1]:t).contentMatch;for(let l=r;a&&l<o;l++)a=a.matchType(n.child(l).type);return a&&a.validEnd?s:null}(r,t);return i?o.map(sx).concat({type:t,attrs:n}).concat(i.map(sx)):null}function sx(e){return{type:e,attrs:null}}function ax(e,t,n,r){t.forEach((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let o=e.mapping.slice(r).map(n+1+i+s.index);e.replaceWith(o,o+1,t.type.schema.linebreakReplacement.create())}}})}function lx(e,t,n,r){t.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let o=e.mapping.slice(r).map(n+1+i);e.replaceWith(o,o+1,t.type.schema.text("\n"))}})}function cx(e,t,n=1,r){let o=e.resolve(t),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,d=n-2;c>i;c--,d--){let e=o.node(c),t=o.index(c);if(e.type.spec.isolating)return!1;let n=e.content.cutByIndex(t,e.childCount),i=r&&r[d+1];i&&(n=n.replaceChild(0,i.type.create(i.attrs)));let s=r&&r[d]||e;if(!e.canReplace(t+1,e.childCount)||!s.type.validContent(n))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function dx(e,t){let n=e.resolve(t),r=n.index();return ux(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function ux(e,t){return!(!e||!t||e.isLeaf||!function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let o=0;o<t.childCount;o++){let i=t.child(o),s=i.type==r?e.type.schema.nodes.text:i.type;if(n=n.matchType(s),!n)return!1;if(!e.type.allowsMarks(i.marks))return!1}return n.validEnd}(e,t))}function px(e,t,n=-1){let r=e.resolve(t);for(let o=r.depth;;o--){let e,i,s=r.index(o);if(o==r.depth?(e=r.nodeBefore,i=r.nodeAfter):n>0?(e=r.node(o+1),s++,i=r.node(o).maybeChild(s)):(e=r.node(o).maybeChild(s-1),i=r.node(o+1)),e&&!e.isTextblock&&ux(e,i)&&r.node(o).canReplace(s,s+1))return t;if(0==o)break;t=n<0?r.before(o):r.after(o)}}function hx(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let i=0;i<n.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(0==n.openStart&&n.size?2:1);i++)for(let e=r.depth;e>=0;e--){let t=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,n=r.index(e)+(t>0?1:0),s=r.node(e),a=!1;if(1==i)a=s.canReplace(n,n,o);else{let e=s.contentMatchAt(n).findWrapping(o.firstChild.type);a=e&&s.canReplaceWith(n,n,e[0])}if(a)return 0==t?r.pos:t<0?r.before(e+1):r.after(e+1)}return null}function fx(e,t,n=t,r=jg.empty){if(t==n&&!r.size)return null;let o=e.resolve(t),i=e.resolve(n);return mx(o,i,r)?new Qy(t,n,r):new gx(o,i,r).fit()}function mx(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Ky.jsonID("replaceAround",ex);var gx=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=Ag.empty;for(let r=0;r<=e.depth;r++){let t=e.node(r);this.frontier.push({type:t.type,match:t.contentMatchAt(e.indexAfter(r))})}for(let r=e.depth;r>0;r--)this.placed=Ag.from(e.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let o=this.placed,i=n.depth,s=r.depth;for(;i&&s&&1==o.childCount;)o=o.firstChild.content,i--,s--;let a=new jg(o,i,s);return e>-1?new ex(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new Qy(n.pos,r.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let o=t.firstChild;if(t.childCount>1&&(r=0),o.type.spec.isolating&&r<=n){e=n;break}t=o.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=bx(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let o=e.firstChild;for(let i=this.depth;i>=0;i--){let e,{type:s,match:a}=this.frontier[i],l=null;if(1==t&&(o?a.matchType(o.type)||(l=a.fillBefore(Ag.from(o),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:i,parent:r,inject:l};if(2==t&&o&&(e=a.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:i,parent:r,wrap:e};if(r&&a.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=bx(e,t);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new jg(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=bx(e,t);if(r.childCount<=1&&t>0){let o=e.size-t<=t+r.size;this.unplaced=new jg(yx(e,t-1,1),t-1,o?t-1:n)}else this.unplaced=new jg(yx(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let f=0;f<o.length;f++)this.openFrontierNode(o[f]);let i=this.unplaced,s=n?n.content:i.content,a=i.openStart-e,l=0,c=[],{match:d,type:u}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)c.push(r.child(e));d=d.matchFragment(r)}let p=s.size+e-(i.content.size-i.openEnd);for(;l<s.childCount;){let e=s.child(l),t=d.matchType(e.type);if(!t)break;l++,(l>1||0==a||e.content.size)&&(d=t,c.push(wx(e.mark(u.allowedMarks(e.marks)),1==l?a:0,l==s.childCount?p:-1)))}let h=l==s.childCount;h||(p=-1),this.placed=xx(this.placed,t,Ag.from(c)),this.frontier[t].match=d,h&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let f=0,m=s;f<p;f++){let e=m.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),m=e.content}this.unplaced=h?0==e?jg.empty:new jg(yx(i.content,e-1,1),e-1,p<0?i.openEnd:e-1):new jg(yx(i.content,e,l),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!vx(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),i=vx(e,t,r,n,o);if(i){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],o=vx(e,n,r,t,!0);if(!o||o.childCount)continue e}return{depth:t,fit:i,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=xx(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=xx(this.placed,this.depth,Ag.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(Ag.empty,!0);e.childCount&&(this.placed=xx(this.placed,this.frontier.length,e))}};function yx(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(yx(e.firstChild.content,t-1,n)))}function xx(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(xx(e.lastChild.content,t-1,n)))}function bx(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function wx(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,wx(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(Ag.empty,!0)))),e.copy(r)}function vx(e,t,n,r,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,i.content,s)?a:null}function kx(e){return e.spec.defining||e.spec.definingForContent}function Sx(e,t,n,r,o){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(Sx(o.content,t+1,n,r,o)))}if(t>r){let t=o.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(Ag.empty,!0))}return e}function Px(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let o=e.start(r);if(o<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(o==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==o-1)&&n.push(r)}return n}var Mx=class e extends Ky{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return qy.fail("No node at attribute step's position");let n=Object.create(null);for(let o in t.attrs)n[o]=t.attrs[o];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return qy.fromReplace(e,this.pos,this.pos+1,new jg(Ag.from(r),0,t.isLeaf?0:1))}getMap(){return Hy.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if("number"!=typeof n.pos||"string"!=typeof n.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new e(n.pos,n.attr,n.value)}};Ky.jsonID("attr",Mx);var Ix=class e extends Ky{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let r in e.attrs)t[r]=e.attrs[r];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return qy.ok(n)}getMap(){return Hy.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if("string"!=typeof n.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new e(n.attr,n.value)}};Ky.jsonID("docAttr",Ix);var Ex=Error;Ex=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(Ex.prototype=Object.create(Error.prototype)).constructor=Ex,Ex.prototype.name="TransformError";var Tx=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Uy}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Ex(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,o,i)=>{e=Math.min(e,o),t=Math.max(t,i)})}return 1e9==e?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=jg.empty){let r=fx(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new jg(Ag.from(n),0,0))}delete(e,t){return this.replace(e,t,jg.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let o=e.doc.resolve(t),i=e.doc.resolve(n);if(mx(o,i,r))return e.step(new Qy(t,n,r));let s=Px(o,i);0==s[s.length-1]&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let p=o.depth,h=o.pos-1;p>0;p--,h--){let e=o.node(p).type.spec;if(e.defining||e.definingAsContext||e.isolating)break;s.indexOf(p)>-1?a=p:o.before(p)==h&&s.splice(1,0,-p)}let l=s.indexOf(a),c=[],d=r.openStart;for(let p=r.content,h=0;;h++){let e=p.firstChild;if(c.push(e),h==r.openStart)break;p=e.content}for(let p=d-1;p>=0;p--){let e=c[p],t=kx(e.type);if(t&&!e.sameMarkup(o.node(Math.abs(a)-1)))d=p;else if(t||!e.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let t=(p+d+1)%(r.openStart+1),a=c[t];if(a)for(let c=0;c<s.length;c++){let d=s[(c+l)%s.length],u=!0;d<0&&(u=!1,d=-d);let p=o.node(d-1),h=o.index(d-1);if(p.canReplaceWith(h,h,a.type,a.marks))return e.replace(o.before(d),u?i.after(d):n,new jg(Sx(r.content,0,r.openStart,t),t,r.openEnd))}}let u=e.steps.length;for(let p=s.length-1;p>=0&&(e.replace(t,n,r),!(e.steps.length>u));p--){let e=s[p];e<0||(t=o.before(e),n=i.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let o=r.depth-1;o>=0;o--){let e=r.index(o);if(r.node(o).canReplaceWith(e,e,n))return r.before(o+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let e=r.indexAfter(o);if(r.node(o).canReplaceWith(e,e,n))return r.after(o+1);if(e<r.node(o).childCount)return null}return null}(e.doc,t,r.type);null!=o&&(t=n=o)}e.replaceRange(t,n,new jg(Ag.from(r),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),o=e.doc.resolve(n);if(r.parent.isTextblock&&o.parent.isTextblock&&r.start()!=o.start()&&0==r.parentOffset&&0==o.parentOffset){let i=r.sharedDepth(n),s=!1;for(let e=r.depth;e>i;e--)r.node(e).type.spec.isolating&&(s=!0);for(let e=o.depth;e>i;e--)o.node(e).type.spec.isolating&&(s=!0);if(!s){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=o.depth;e>0&&n==o.start(e);e--)n=o.before(e);r=e.doc.resolve(t),o=e.doc.resolve(n)}}let i=Px(r,o);for(let s=0;s<i.length;s++){let t=i[s],n=s==i.length-1;if(n&&0==t||r.node(t).type.contentMatch.validEnd)return e.delete(r.start(t),o.end(t));if(t>0&&(n||r.node(t-1).canReplace(r.index(t-1),o.indexAfter(t-1))))return e.delete(r.before(t),o.after(t))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s&&r.start(s-1)==o.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),o.index(s-1)))return e.delete(r.before(s),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:r,$to:o,depth:i}=t,s=r.before(i+1),a=o.after(i+1),l=s,c=a,d=Ag.empty,u=0;for(let f=i,m=!1;f>n;f--)m||r.index(f)>0?(m=!0,d=Ag.from(r.node(f).copy(d)),u++):l--;let p=Ag.empty,h=0;for(let f=i,m=!1;f>n;f--)m||o.after(f+1)<o.end(f)?(m=!0,p=Ag.from(o.node(f).copy(p)),h++):c++;e.step(new ex(l,c,s,a,new jg(d.append(p),u,h),d.size-u,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let r=null,{linebreakReplacement:o}=e.doc.type.schema,i=e.doc.resolve(t-n),s=i.node().type;if(o&&s.inlineContent){let e="pre"==s.whitespace,t=!!s.contentMatch.matchType(o);e&&!t?r=!1:!e&&t&&(r=!0)}let a=e.steps.length;if(!1===r){let r=e.doc.resolve(t+n);lx(e,r.node(),r.before(),a)}s.inlineContent&&nx(e,t+n-1,s,i.node().contentMatchAt(i.index()),null==r);let l=e.mapping.slice(a),c=l.map(t-n);if(e.step(new Qy(c,l.map(t+n,-1),jg.empty,!0)),!0===r){let t=e.doc.resolve(c);ax(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return function(e,t,n){let r=Ag.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let e=n[s].type.contentMatch.matchFragment(r);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Ag.from(n[s].type.create(n[s].attrs,r))}let o=t.start,i=t.end;e.step(new ex(o,i,o,i,new jg(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let s="function"==typeof o?o(t):o;if(t.isTextblock&&!t.hasMarkup(r,s)&&function(e,t,n){let r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(e.doc,e.mapping.slice(i).map(n),r)){let o=null;if(r.schema.linebreakReplacement){let e="pre"==r.whitespace,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?o=!1:!e&&t&&(o=!0)}!1===o&&lx(e,t,n,i),nx(e,e.mapping.slice(i).map(n,1),r,void 0,null===o);let a=e.mapping.slice(i),l=a.map(n,1),c=a.map(n+t.nodeSize,1);return e.step(new ex(l,c,l+1,c-1,new jg(Ag.from(r.create(s,null,t.marks)),0,0),1,!0)),!0===o&&ax(e,t,n,i),!1}})}(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return function(e,t,n,r,o){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new ex(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new jg(Ag.from(s),0,0),1,!0))}(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new Mx(e,t,n)),this}setDocAttribute(e,t){return this.step(new Ix(e,t)),this}addNodeMark(e,t){return this.step(new Gy(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t instanceof $g)t.isInSet(n.marks)&&this.step(new Zy(e,t));else{let r,o=n.marks,i=[];for(;r=t.isInSet(o);)i.push(new Zy(e,r)),o=r.removeFromSet(o);for(let e=i.length-1;e>=0;e--)this.step(i[e])}return this}split(e,t=1,n){return function(e,t,n=1,r){let o=e.doc.resolve(t),i=Ag.empty,s=Ag.empty;for(let a=o.depth,l=o.depth-n,c=n-1;a>l;a--,c--){i=Ag.from(o.node(a).copy(i));let e=r&&r[c];s=Ag.from(e?e.type.create(e.attrs,s):o.node(a).copy(s))}e.step(new Qy(t,t,new jg(i.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let o,i,s=[],a=[];e.doc.nodesBetween(t,n,(e,l,c)=>{if(!e.isInline)return;let d=e.marks;if(!r.isInSet(d)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,t),u=Math.min(l+e.nodeSize,n),p=r.addToSet(d);for(let e=0;e<d.length;e++)d[e].isInSet(p)||(o&&o.to==c&&o.mark.eq(d[e])?o.to=u:s.push(o=new Jy(c,u,d[e])));i&&i.to==c?i.to=u:a.push(i=new Xy(c,u,r))}}),s.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,r){let o=[],i=0;e.doc.nodesBetween(t,n,(e,s)=>{if(!e.isInline)return;i++;let a=null;if(r instanceof wy){let t,n=e.marks;for(;t=r.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(a=[r]):a=e.marks;if(a&&a.length){let r=Math.min(s+e.nodeSize,n);for(let e=0;e<a.length;e++){let n,l=a[e];for(let e=0;e<o.length;e++){let t=o[e];t.step==i-1&&l.eq(o[e].style)&&(n=t)}n?(n.to=r,n.step=i):o.push({style:l,from:Math.max(s,t),to:r,step:i})}}}),o.forEach(t=>e.step(new Jy(t.from,t.to,t.style)))}(this,e,t,n),this}clearIncompatible(e,t,n){return nx(this,e,t,n),this}},Cx=Object.create(null),Ox=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Ax(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=jg.empty){let n=t.content.lastChild,r=null;for(let s=0;s<t.openEnd;s++)r=n,n=n.lastChild;let o=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:l}=i[s],c=e.mapping.slice(o);e.replaceRange(c.map(a.pos),c.map(l.pos),s?jg.empty:t),0==s&&Fx(e,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],a=e.mapping.slice(n),l=a.map(i.pos),c=a.map(s.pos);o?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),Fx(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new Lx(e):_x(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let o=e.depth-1;o>=0;o--){let r=t<0?_x(e.node(0),e.node(o),e.before(o+1),e.index(o),t,n):_x(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,n);if(r)return r}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Bx(e.node(0))}static atStart(e){return _x(e,e,0,0,1)||new Bx(e)}static atEnd(e){return _x(e,e,e.content.size,e.childCount,-1)||new Bx(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Cx[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Cx)throw new RangeError("Duplicate use of selection JSON ID "+e);return Cx[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Lx.between(this.$anchor,this.$head).getBookmark()}};Ox.prototype.visible=!0;var Ax=class{constructor(e,t){this.$from=e,this.$to=t}},Rx=!1;function Nx(e){Rx||e.parent.inlineContent||(Rx=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}var Lx=class e extends Ox{constructor(e,t=e){Nx(e),Nx(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return Ox.near(r);let o=t.resolve(n.map(this.anchor));return new e(o.parent.inlineContent?o:r,r)}replace(e,t=jg.empty){if(super.replace(e,t),t==jg.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new $x(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let o=t.pos-n.pos;if(r&&!o||(r=o>=0?1:-1),!n.parent.inlineContent){let e=Ox.findFrom(n,r,!0)||Ox.findFrom(n,-r,!0);if(!e)return Ox.near(n,r);n=e.$head}return t.parent.inlineContent||(0==o||(t=(Ox.findFrom(t,-r,!0)||Ox.findFrom(t,r,!0)).$anchor).pos<n.pos!=o<0)&&(t=n),new e(t,n)}};Ox.jsonID("text",Lx);var $x=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return Lx.between(e.resolve(this.anchor),e.resolve(this.head))}},Dx=class e extends Ox{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),i=t.resolve(o);return r?Ox.near(i):new e(i)}content(){return new jg(Ag.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new jx(this.anchor)}static fromJSON(t,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}};Dx.prototype.visible=!1,Ox.jsonID("node",Dx);var jx=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new $x(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&Dx.isSelectable(n)?new Dx(t):Ox.near(t)}},Bx=class e extends Ox{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=jg.empty){if(t==jg.empty){e.delete(0,e.doc.content.size);let t=Ox.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return zx}};Ox.jsonID("all",Bx);var zx={map(){return this},resolve:e=>new Bx(e)};function _x(e,t,n,r,o,i=!1){if(t.inlineContent)return Lx.create(e,n);for(let s=r-(o>0?0:1);o>0?s<t.childCount:s>=0;s+=o){let r=t.child(s);if(r.isAtom){if(!i&&Dx.isSelectable(r))return Dx.create(e,n-(o<0?r.nodeSize:0))}else{let t=_x(e,r,n+o,o<0?r.childCount:0,o,i);if(t)return t}n+=r.nodeSize*o}return null}function Fx(e,t,n){let r=e.steps.length-1;if(r<t)return;let o,i=e.steps[r];(i instanceof Qy||i instanceof ex)&&(e.mapping.maps[r].forEach((e,t,n,r)=>{null==o&&(o=r)}),e.setSelection(Ox.near(e.doc.resolve(o),n)))}var Wx=class extends Tx{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return $g.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||$g.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),!e)return this.deleteRange(t,n);let o=this.storedMarks;if(!o){let e=this.doc.resolve(t);o=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.selection.to!=t+e.length||this.setSelection(Ox.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}};function Hx(e,t){return t&&e?e.bind(t):e}var Ux=class{constructor(e,t,n){this.name=e,this.init=Hx(t.init,n),this.apply=Hx(t.apply,n)}},Vx=[new Ux("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new Ux("selection",{init:(e,t)=>e.selection||Ox.atStart(t.doc),apply:e=>e.selection}),new Ux("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new Ux("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})],Kx=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Vx.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new Ux(e.key,e.spec.state,e))})}},qx=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let o=!1;for(let i=0;i<this.config.plugins.length;i++){let s=this.config.plugins[i];if(s.spec.appendTransaction){let a=r?r[i].n:0,l=r?r[i].state:this,c=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<i?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),o=!0}r&&(r[i]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let o=r[e];n[o.name]=o.apply(t,this[o.name],this,n)}return n}get tr(){return new Wx(this)}static create(t){let n=new Kx(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new Kx(this.schema,t.plugins),r=n.fields,o=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;o[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,o)}return o}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],o=r.spec.state;o&&o.toJSON&&(t[n]=o.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new Kx(t.schema,t.plugins),i=new e(o);return o.fields.forEach(e=>{if("doc"==e.name)i.doc=ty.fromJSON(t.schema,n.doc);else if("selection"==e.name)i.selection=Ox.fromJSON(i.doc,n.selection);else if("storedMarks"==e.name)n.storedMarks&&(i.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let o in r){let s=r[o],a=s.spec.state;if(s.key==e.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(n,o))return void(i[e.name]=a.fromJSON.call(s,t,n[o],i))}i[e.name]=e.init(t,i)}}),i}};function Yx(e,t,n){for(let r in e){let o=e[r];o instanceof Function?o=o.bind(t):"handleDOMEvents"==r&&(o=Yx(o,t,{})),n[r]=o}return n}var Xx=class{constructor(e){this.spec=e,this.props={},e.props&&Yx(e.props,this,this.props),this.key=e.key?e.key.key:Gx("plugin")}getState(e){return e[this.key]}},Jx=Object.create(null);function Gx(e){return e in Jx?e+"$"+ ++Jx[e]:(Jx[e]=0,e+"$")}var Zx=class{constructor(e="key"){this.key=Gx(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},Qx=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function eb(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}var tb=(e,t,n)=>{let r=eb(e,n);if(!r)return!1;let o=ib(r);if(!o){let n=r.blockRange(),o=n&&ox(n);return null!=o&&(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(yb(e,o,t,-1))return!0;if(0==r.parent.content.size&&(rb(i,"end")||Dx.isSelectable(i)))for(let s=r.depth;;s--){let n=fx(e.doc,r.before(s),r.after(s),jg.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(rb(i,"end")?Ox.findFrom(r.doc.resolve(r.mapping.map(o.pos,-1)),-1):Dx.create(r.doc,o.pos-i.nodeSize)),t(r.scrollIntoView())}return!0}if(1==s||r.node(s-1).childCount>1)break}return!(!i.isAtom||o.depth!=r.depth-1)&&(t&&t(e.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0)};function nb(e,t,n){let r=t.nodeBefore,o=t.pos-1;for(;!r.isTextblock;o--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let i=t.nodeAfter,s=t.pos+1;for(;!i.isTextblock;s++){if(i.type.spec.isolating)return!1;let e=i.firstChild;if(!e)return!1;i=e}let a=fx(e.doc,o,s,jg.empty);if(!a||a.from!=o||a instanceof Qy&&a.slice.size>=s-o)return!1;if(n){let t=e.tr.step(a);t.setSelection(Lx.create(t.doc,o)),n(t.scrollIntoView())}return!0}function rb(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}var ob=(e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;i=ib(r)}let s=i&&i.nodeBefore;return!(!s||!Dx.isSelectable(s))&&(t&&t(e.tr.setSelection(Dx.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function ib(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function sb(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}var ab=(e,t,n)=>{let r=sb(e,n);if(!r)return!1;let o=cb(r);if(!o)return!1;let i=o.nodeAfter;if(yb(e,o,t,1))return!0;if(0==r.parent.content.size&&(rb(i,"start")||Dx.isSelectable(i))){let n=fx(e.doc,r.before(),r.after(),jg.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(rb(i,"start")?Ox.findFrom(r.doc.resolve(r.mapping.map(o.pos)),1):Dx.create(r.doc,r.mapping.map(o.pos))),t(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1)&&(t&&t(e.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0)},lb=(e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;i=cb(r)}let s=i&&i.nodeAfter;return!(!s||!Dx.isSelectable(s))&&(t&&t(e.tr.setSelection(Dx.create(e.doc,i.pos)).scrollIntoView()),!0)};function cb(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var db=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)};function ub(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var pb=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=ub(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let r=n.after(),o=e.tr.replaceWith(r,r,s.createAndFill());o.setSelection(Ox.near(o.doc.resolve(r),1)),t(o.scrollIntoView())}return!0},hb=(e,t)=>{let n=e.selection,{$from:r,$to:o}=n;if(n instanceof Bx||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=ub(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=e.tr.insert(n,i.createAndFill());s.setSelection(Lx.create(s.doc,n+1)),t(s.scrollIntoView())}return!0},fb=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(cx(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&ox(r);return null!=o&&(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)};var mb,gb=(e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof Dx&&e.selection.node.isBlock)return!(!n.parentOffset||!cx(e.doc,n.pos)||(t&&t(e.tr.split(n.pos).scrollIntoView()),0));if(!n.depth)return!1;let o,i,s=[],a=!1,l=!1;for(let p=n.depth;;p--){if(n.node(p).isBlock){a=n.end(p)==n.pos+(n.depth-p),l=n.start(p)==n.pos-(n.depth-p),i=ub(n.node(p-1).contentMatchAt(n.indexAfter(p-1)));let e=mb&&mb(r.parent,a,n);s.unshift(e||(a&&i?{type:i}:null)),o=p;break}if(1==p)return!1;s.unshift(null)}let c=e.tr;(e.selection instanceof Lx||e.selection instanceof Bx)&&c.deleteSelection();let d=c.mapping.map(n.pos),u=cx(c.doc,d,s.length,s);if(u||(s[0]=i?{type:i}:null,u=cx(c.doc,d,s.length,s)),!u)return!1;if(c.split(d,s.length,s),!a&&l&&n.node(o).type!=i){let e=c.mapping.map(n.before(o)),t=c.doc.resolve(e);i&&n.node(o-1).canReplaceWith(t.index(),t.index()+1,i)&&c.setNodeMarkup(c.mapping.map(n.before(o)),i)}return t&&t(c.scrollIntoView()),!0};function yb(e,t,n,r){let o,i,s=t.nodeBefore,a=t.nodeAfter,l=s.type.spec.isolating||a.type.spec.isolating;if(!l&&function(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(i,i+1)||!o.isTextblock&&!dx(e.doc,t.pos)||(n&&n(e.tr.join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let c=!l&&t.parent.canReplace(t.index(),t.index()+1);if(c&&(o=(i=s.contentMatchAt(s.childCount)).findWrapping(a.type))&&i.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,i=Ag.empty;for(let e=o.length-1;e>=0;e--)i=Ag.from(o[e].create(null,i));i=Ag.from(s.copy(i));let l=e.tr.step(new ex(t.pos-1,r,t.pos,r,new jg(i,1,0),o.length,!0)),c=l.doc.resolve(r+2*o.length);c.nodeAfter&&c.nodeAfter.type==s.type&&dx(l.doc,c.pos)&&l.join(c.pos),n(l.scrollIntoView())}return!0}let d=a.type.spec.isolating||r>0&&l?null:Ox.findFrom(t,1),u=d&&d.$from.blockRange(d.$to),p=u&&ox(u);if(null!=p&&p>=t.depth)return n&&n(e.tr.lift(u,p).scrollIntoView()),!0;if(c&&rb(a,"start",!0)&&rb(s,"end")){let r=s,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let i=a,l=1;for(;!i.isTextblock;i=i.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,i.content)){if(n){let r=Ag.empty;for(let e=o.length-1;e>=0;e--)r=Ag.from(o[e].copy(r));n(e.tr.step(new ex(t.pos-o.length,t.pos+a.nodeSize,t.pos+l,t.pos+a.nodeSize-l,new jg(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function xb(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(t.tr.setSelection(Lx.create(t.doc,e<0?o.start(i):o.end(i)))),!0)}}var bb=xb(-1),wb=xb(1);function vb(e,t=null){return function(n,r){let o=!1;for(let i=0;i<n.selection.ranges.length&&!o;i++){let{$from:{pos:r},$to:{pos:s}}=n.selection.ranges[i];n.doc.nodesBetween(r,s,(r,i)=>{if(o)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)o=!0;else{let t=n.doc.resolve(i),r=t.index();o=t.parent.canReplaceWith(r,r+1,e)}})}if(!o)return!1;if(r){let o=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];o.setBlockType(i,s,e,t)}r(o.scrollIntoView())}return!0}}function kb(...e){return function(t,n,r){for(let o=0;o<e.length;o++)if(e[o](t,n,r))return!0;return!1}}var Sb=kb(Qx,tb,ob),Pb=kb(Qx,ab,lb),Mb={Enter:kb(db,hb,fb,gb),"Mod-Enter":pb,Backspace:Sb,"Mod-Backspace":Sb,"Shift-Backspace":Sb,Delete:Pb,"Mod-Delete":Pb,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new Bx(e.doc))),!0)},Ib={"Ctrl-h":Mb.Backspace,"Alt-Backspace":Mb["Mod-Backspace"],"Ctrl-d":Mb.Delete,"Ctrl-Alt-Backspace":Mb["Mod-Delete"],"Alt-Delete":Mb["Mod-Delete"],"Alt-d":Mb["Mod-Delete"],"Ctrl-a":bb,"Ctrl-e":wb};for(let os in Mb)Ib[os]=Mb[os];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();function Eb(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i);if(!s)return!1;let a=r?n.tr:null;return!!function(e,t,n,r=null){let o=!1,i=t,s=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&0==t.startIndex){if(0==t.$from.index(t.depth-1))return!1;let e=s.resolve(t.start-2);i=new Qg(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new Qg(t.$from,s.resolve(t.$to.end(t.depth)),t.depth)),o=!0}let a=ix(i,n,r,t);if(!a)return!1;e&&function(e,t,n,r,o){let i=Ag.empty;for(let d=n.length-1;d>=0;d--)i=Ag.from(n[d].type.create(n[d].attrs,i));e.step(new ex(t.start-(r?2:0),t.end,t.start,t.end,new jg(i,0,0),n.length,!0));let s=0;for(let d=0;d<n.length;d++)n[d].type==o&&(s=d+1);let a=n.length-s,l=t.start+n.length-(r?2:0),c=t.parent;for(let d=t.startIndex,u=t.endIndex,p=!0;d<u;d++,p=!1)!p&&cx(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=c.child(d).nodeSize}(e,t,a,o,n);return!0}(a,s,e,t)&&(r&&r(a.scrollIntoView()),!0)}}function Tb(e){return function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,t=>t.childCount>0&&t.firstChild.type==e);return!!i&&(!n||(r.node(i.depth-1).type==e?function(e,t,n,r){let o=e.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new ex(i-1,s,i,s,new jg(Ag.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Qg(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const a=ox(r);if(null==a)return!1;o.lift(r,a);let l=o.doc.resolve(o.mapping.map(i,-1)-1);dx(o.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&o.join(l.pos);return t(o.scrollIntoView()),!0}(t,n,e,i):function(e,t,n){let r=e.tr,o=n.parent;for(let h=n.end,f=n.endIndex-1,m=n.startIndex;f>m;f--)h-=o.child(f).nodeSize,r.delete(h-1,h+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==o.childCount,c=i.node(-1),d=i.index(-1);if(!c.canReplace(d+(a?0:1),d+1,s.content.append(l?Ag.empty:Ag.from(o))))return!1;let u=i.pos,p=u+s.nodeSize;return r.step(new ex(u-(a?1:0),p+(l?1:0),u+1,p-1,new jg((a?Ag.empty:Ag.from(o.copy(Ag.empty))).append(l?Ag.empty:Ag.from(o.copy(Ag.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}(t,n,i)))}}var Cb=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},Ob=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},Ab=null,Rb=function(e,t,n){let r=Ab||(Ab=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},Nb=function(e,t,n,r){return n&&($b(e,t,n,r,-1)||$b(e,t,n,r,1))},Lb=/^(img|br|input|textarea|hr)$/i;function $b(e,t,n,r,o){for(var i;;){if(e==n&&t==r)return!0;if(t==(o<0?0:Db(e))){let n=e.parentNode;if(!n||1!=n.nodeType||jb(e)||Lb.test(e.nodeName)||"false"==e.contentEditable)return!1;t=Cb(e)+(o<0?0:1),e=n}else{if(1!=e.nodeType)return!1;{let n=e.childNodes[t+(o<0?-1:0)];if(1==n.nodeType&&"false"==n.contentEditable){if(!(null===(i=n.pmViewDesc)||void 0===i?void 0:i.ignoreForSelection))return!1;t+=o}else e=n,t=o<0?Db(e):0}}}}function Db(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function jb(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var Bb=function(e){return e.focusNode&&Nb(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function zb(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}var _b="undefined"!=typeof navigator?navigator:null,Fb="undefined"!=typeof document?document:null,Wb=_b&&_b.userAgent||"",Hb=/Edge\/(\d+)/.exec(Wb),Ub=/MSIE \d/.exec(Wb),Vb=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Wb),Kb=!!(Ub||Vb||Hb),qb=Ub?document.documentMode:Vb?+Vb[1]:Hb?+Hb[1]:0,Yb=!Kb&&/gecko\/(\d+)/i.test(Wb);Yb&&(/Firefox\/(\d+)/.exec(Wb)||[0,0])[1];var Xb=!Kb&&/Chrome\/(\d+)/.exec(Wb),Jb=!!Xb,Gb=Xb?+Xb[1]:0,Zb=!Kb&&!!_b&&/Apple Computer/.test(_b.vendor),Qb=Zb&&(/Mobile\/\w+/.test(Wb)||!!_b&&_b.maxTouchPoints>2),ew=Qb||!!_b&&/Mac/.test(_b.platform),tw=!!_b&&/Win/.test(_b.platform),nw=/Android \d/.test(Wb),rw=!!Fb&&"webkitFontSmoothing"in Fb.documentElement.style,ow=rw?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function iw(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function sw(e,t){return"number"==typeof e?e:e[t]}function aw(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function lw(e,t,n){let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=n||e.dom;s;){if(1!=s.nodeType){s=Ob(s);continue}let e=s,n=e==i.body,a=n?iw(i):aw(e),l=0,c=0;if(t.top<a.top+sw(r,"top")?c=-(a.top-t.top+sw(o,"top")):t.bottom>a.bottom-sw(r,"bottom")&&(c=t.bottom-t.top>a.bottom-a.top?t.top+sw(o,"top")-a.top:t.bottom-a.bottom+sw(o,"bottom")),t.left<a.left+sw(r,"left")?l=-(a.left-t.left+sw(o,"left")):t.right>a.right-sw(r,"right")&&(l=t.right-a.right+sw(o,"right")),l||c)if(n)i.defaultView.scrollBy(l,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),l&&(e.scrollLeft+=l);let o=e.scrollLeft-n,i=e.scrollTop-r;t={left:t.left-o,top:t.top-i,right:t.right-o,bottom:t.bottom-i}}let d=n?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(d))break;s="absolute"==d?s.offsetParent:Ob(s)}}function cw(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Ob(r));return t}function dw(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:o,left:i}=e[n];r.scrollTop!=o+t&&(r.scrollTop=o+t),r.scrollLeft!=i&&(r.scrollLeft=i)}}var uw=null;function pw(e,t){let n,r,o,i,s=2e8,a=0,l=t.top,c=t.top;for(let d=e.firstChild,u=0;d;d=d.nextSibling,u++){let e;if(1==d.nodeType)e=d.getClientRects();else{if(3!=d.nodeType)continue;e=Rb(d).getClientRects()}for(let p=0;p<e.length;p++){let h=e[p];if(h.top<=l&&h.bottom>=c){l=Math.max(h.bottom,l),c=Math.min(h.top,c);let e=h.left>t.left?h.left-t.left:h.right<t.left?t.left-h.right:0;if(e<s){n=d,s=e,r=e&&3==n.nodeType?{left:h.right<t.left?h.right:h.left,top:t.top}:t,1==d.nodeType&&e&&(a=u+(t.left>=(h.left+h.right)/2?1:0));continue}}else h.top>t.top&&!o&&h.left<=t.left&&h.right>=t.left&&(o=d,i={left:Math.max(h.left,Math.min(h.right,t.left)),top:h.top});!n&&(t.left>=h.right&&t.top>=h.top||t.left>=h.left&&t.top>=h.bottom)&&(a=u+1)}}return!n&&o&&(n=o,r=i,s=0),n&&3==n.nodeType?function(e,t){let n,r=e.nodeValue.length,o=document.createRange();for(let i=0;i<r;i++){o.setEnd(e,i+1),o.setStart(e,i);let r=yw(o,1);if(r.top!=r.bottom&&hw(t,r)){n={node:e,offset:i+(t.left>=(r.left+r.right)/2?1:0)};break}}return o.detach(),n||{node:e,offset:0}}(n,r):!n||s&&1==n.nodeType?{node:e,offset:a}:pw(n,r)}function hw(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function fw(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let n=e.childNodes[i];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let o=e[r];if(hw(t,o))return fw(n,t,o)}}if((i=(i+1)%r)==o)break}return e}function mw(e,t){let n,r=e.dom.ownerDocument,o=0,i=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(Db(r.offsetNode),r.offset)}}catch(r){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(Db(r.startContainer),r.startOffset)}}}(r,t.left,t.top);i&&({node:n,offset:o}=i);let s,a=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top);if(!a||!e.dom.contains(1!=a.nodeType?a.parentNode:a)){let n=e.dom.getBoundingClientRect();if(!hw(t,n))return null;if(a=fw(e.dom,t,n),!a)return null}if(Zb)for(let c=a;n&&c;c=Ob(c))c.draggable&&(n=void 0);if(a=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(a,t),n){if(Yb&&1==n.nodeType&&(o=Math.min(o,n.childNodes.length),o<n.childNodes.length)){let e,r=n.childNodes[o];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&o++}let r;rw&&o&&1==n.nodeType&&1==(r=n.childNodes[o-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=t.top&&o--,n==e.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(s=function(e,t,n,r){let o=-1;for(let i=t,s=!1;i!=e.dom;){let t,n=e.docView.nearestDesc(i,!0);if(!n)return null;if(1==n.dom.nodeType&&(n.node.isBlock&&n.parent||!n.contentDOM)&&((t=n.dom.getBoundingClientRect()).width||t.height)&&(n.node.isBlock&&n.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(n.dom.nodeName)&&(!s&&t.left>r.left||t.top>r.top?o=n.posBefore:(!s&&t.right<r.left||t.bottom<r.top)&&(o=n.posAfter),s=!0),!n.contentDOM&&o<0&&!n.node.isText))return(n.node.isBlock?r.top<(t.top+t.bottom)/2:r.left<(t.left+t.right)/2)?n.posBefore:n.posAfter;i=n.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,-1)}(e,n,o,t))}null==s&&(s=function(e,t,n){let{node:r,offset:o}=pw(t,n),i=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();i=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,o,i)}(e,a,t));let l=e.docView.nearestDesc(a,!0);return{pos:s,inside:l?l.posAtStart-l.border:-1}}function gw(e){return e.top<e.bottom||e.left<e.right}function yw(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(gw(e))return e}return Array.prototype.find.call(n,gw)||e.getBoundingClientRect()}var xw=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function bw(e,t,n){let{node:r,offset:o,atom:i}=e.docView.domFromPos(t,n<0?-1:1),s=rw||Yb;if(3==r.nodeType){if(!s||!xw.test(r.nodeValue)&&(n<0?o:o!=r.nodeValue.length)){let e=o,t=o,i=n<0?1:-1;return n<0&&!o?(t++,i=-1):n>=0&&o==r.nodeValue.length?(e--,i=1):n<0?e--:t++,ww(yw(Rb(r,e,t),i),i<0)}{let e=yw(Rb(r,o,o),n);if(Yb&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let t=yw(Rb(r,o-1,o-1),-1);if(t.top==e.top){let n=yw(Rb(r,o,o+1),-1);if(n.top!=e.top)return ww(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(null==i&&o&&(n<0||o==Db(r))){let e=r.childNodes[o-1];if(1==e.nodeType)return vw(e.getBoundingClientRect(),!1)}if(null==i&&o<Db(r)){let e=r.childNodes[o];if(1==e.nodeType)return vw(e.getBoundingClientRect(),!0)}return vw(r.getBoundingClientRect(),n>=0)}if(null==i&&o&&(n<0||o==Db(r))){let e=r.childNodes[o-1],t=3==e.nodeType?Rb(e,Db(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return ww(yw(t,1),!1)}if(null==i&&o<Db(r)){let e=r.childNodes[o];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?Rb(e,0,s?0:1):1==e.nodeType?e:null:null;if(t)return ww(yw(t,-1),!0)}return ww(yw(3==r.nodeType?Rb(r):r,-n),n>=0)}function ww(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function vw(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function kw(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}var Sw=/[\u0590-\u08ac]/;var Pw=null,Mw=null,Iw=!1;function Ew(e,t,n){return Pw==t&&Mw==n?Iw:(Pw=t,Mw=n,Iw="up"==n||"down"==n?function(e,t,n){let r=t.selection,o="up"==n?r.$from:r.$to;return kw(e,t,()=>{let{node:t}=e.docView.domFromPos(o.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=bw(e,o.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=Rb(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let o=t[e];if(o.bottom>o.top+1&&("up"==n?r.top-o.top>2*(o.bottom-r.top):o.bottom-r.bottom>2*(r.bottom-o.top)))return!1}}return!0})}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=e.domSelection();return a?Sw.test(r.parent.textContent)&&a.modify?kw(e,t,()=>{let{focusNode:t,focusOffset:o,anchorNode:i,anchorOffset:s}=e.domSelectionRange(),l=a.caretBidiLevel;a.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:d,focusOffset:u}=e.domSelectionRange(),p=d&&!c.contains(1==d.nodeType?d:d.parentNode)||t==d&&o==u;try{a.collapse(i,s),t&&(t!=i||o!=s)&&a.extend&&a.extend(t,o)}catch(h){}return null!=l&&(a.caretBidiLevel=l),p}):"left"==n||"backward"==n?i:s:r.pos==r.start()||r.pos==r.end()}(e,t,n))}var Tw=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>Cb(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let o,i=this.getDesc(r);if(i&&(!t||i.node)){if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return i;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let n=t;n;n=n.parent)if(n==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],o=n+r.size;if(n==e&&o!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<o)return r.descAt(e-n-r.border);n=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let o=0;n<this.children.length;n++){let t=this.children[n],i=o+t.size;if(i>e||t instanceof $w){r=e-o;break}o=i}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let o;n&&!(o=this.children[n-1]).size&&o instanceof Cw&&o.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?Cb(e.dom)+1:0}}{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,e&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?Cb(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,o=-1;for(let i=n,s=0;;s++){let n=this.children[s],a=i+n.size;if(-1==r&&e<=a){let o=i+n.border;if(e>=o&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,o);e=i;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=Cb(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(a>t||s==this.children.length-1)){t=a;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){o=Cb(n.dom);break}t+=n.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=a}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let o=Math.min(e,t),i=Math.max(e,t);for(let h=0,f=0;h<this.children.length;h++){let s=this.children[h],a=f+s.size;if(o>f&&i<a)return s.setSelection(e-f-s.border,t-f-s.border,n,r);f=a}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),l=n.root.getSelection(),c=n.domSelectionRange(),d=!1;if((Yb||Zb)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if(d=!(!t||"\n"!=e.nodeValue[t-1]),d&&t==e.nodeValue.length)for(let n,r=e;r;r=r.parentNode){if(n=r.nextSibling){"BR"==n.nodeName&&(s=a={node:n.parentNode,offset:Cb(n)+1});break}let e=r.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];d=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(Yb&&c.focusNode&&c.focusNode!=a.node&&1==c.focusNode.nodeType){let e=c.focusNode.childNodes[c.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||d&&Zb)&&Nb(s.node,s.offset,c.anchorNode,c.anchorOffset)&&Nb(a.node,a.offset,c.focusNode,c.focusOffset))return;let u=!1;if((l.extend||e==t)&&(!d||!Yb)){l.collapse(s.node,s.offset);try{e!=t&&l.extend(a.node,a.offset),u=!0}catch(p){}}if(!u){if(e>t){let e=s;s=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let o=this.children[r],i=n+o.size;if(n==i?e<=i&&t>=n:e<i&&t>n){let r=n+o.border,s=i-o.border;if(e>=r&&t<=s)return this.dirty=e==n||t==i?2:1,void(e!=r||t!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-r,t-r):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},Cw=class extends Tw{constructor(e,t,n,r){let o,i=t.type.toDOM;if("function"==typeof i&&(i=i(n,()=>o?o.parent?o.parent.posBeforeChild(o):void 0:r)),!t.type.spec.raw){if(1!=i.nodeType){let e=document.createElement("span");e.appendChild(i),i=e}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},Ow=class extends Tw{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}},Aw=class e extends Tw{constructor(e,t,n,r,o){super(e,[],n,r),this.mark=t,this.spec=o}static create(t,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return s&&s.dom||(s=Ny.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(t,n,r){let o=e.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=Yw(i,n,s,r)),t>0&&(i=Yw(i,0,t,r));for(let e=0;e<i.length;e++)i[e].parent=o;return o.children=i,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},Rw=class e extends Tw{constructor(e,t,n,r,o,i,s){super(e,[],o,i),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s}static create(t,n,r,o,i,s){let a,l=i.nodeViews[n.type.name],c=l&&l(n,i,()=>a?a.parent?a.parent.posBeforeChild(a):void 0:s,r,o),d=c&&c.dom,u=c&&c.contentDOM;if(n.isText)if(d){if(3!=d.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else d=document.createTextNode(n.text);else if(!d){let e=Ny.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:d,contentDOM:u}=e)}u||n.isText||"BR"==d.nodeName||(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let p=d;return d=Hw(d,r,n),c?a=new Dw(t,n,r,o,d,u||null,p,c):n.isText?new Lw(t,n,r,o,d,p):new e(t,n,r,o,d,u||null,p)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Ag.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&Uw(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,o=e.composing?this.localCompositionInfo(e,t):null,i=o&&o.pos>-1?o:null,s=o&&o.pos<0,a=new Kw(this,i&&i.node,e);!function(e,t,n,r){let o=t.locals(e),i=0;if(0==o.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,o,t.forChild(i,s),n),i+=s.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let d,u,p,h;for(;s<o.length&&o[s].to==i;){let e=o[s++];e.widget&&(d?(u||(u=[d])).push(e):d=e)}if(d)if(u){u.sort(qw);for(let e=0;e<u.length;e++)n(u[e],c,!!l)}else n(d,c,!!l);if(l)h=-1,p=l,l=null;else{if(!(c<e.childCount))break;h=c,p=e.child(c++)}for(let e=0;e<a.length;e++)a[e].to<=i&&a.splice(e--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let f=i+p.nodeSize;if(p.isText){let e=f;s<o.length&&o[s].from<e&&(e=o[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<f&&(l=p.cut(e-i),p=p.cut(0,e-i),f=e,h=-1)}else for(;s<o.length&&o[s].to<f;)s++;r(p,p.isInline&&!p.isLeaf?a.filter(e=>!e.inline):a.slice(),t.forChild(i,p),h),i=f}}(this.node,this.innerDeco,(t,o,i)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e,o):t.type.side>=0&&!i&&a.syncToMarks(o==this.node.childCount?$g.none:this.node.child(o).marks,n,e,o),a.placeWidget(t,e,r)},(t,i,l,c)=>{let d;a.syncToMarks(t.marks,n,e,c),a.findNodeMatch(t,i,l,c)||s&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(d=a.findIndexWithChild(o.node))>-1&&a.updateNodeAt(t,i,l,d,e)||a.updateNextNode(t,i,l,e,c,r)||a.addNode(t,i,l,e,r),r+=t.nodeSize}),a.syncToMarks([],n,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(i&&this.protectLocalComposition(e,i),jw(this.contentDOM,this.children,e),Qb&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof Lx)||n<t||r>t+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let e=o.nodeValue,i=function(e,t,n,r){for(let o=0,i=0;o<e.childCount&&i<=r;){let s=e.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<e.childCount;){let t=e.child(o++);if(i+=t.nodeSize,!t.isText)break;l+=t.text}if(i>=n){if(i>=r&&l.slice(r-t.length-a,r-a)==t)return r-t.length;let e=a<r?l.lastIndexOf(t,r-a-1):-1;if(e>=0&&e+t.length+a>=n)return a+e;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}(this.node.content,e,n-t,r-t);return i<0?null:{node:o,pos:i,text:e}}return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let i=new Ow(this,o,t,r);e.input.compositionNodes.push(i),this.children=Yw(this.children,n,n+r.length,e,i)}update(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(Uw(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Fw(this.dom,this.nodeDOM,_w(this.outerDeco,this.node,t),_w(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}};function Nw(e,t,n,r,o){Hw(r,t,e);let i=new Rw(void 0,e,t,n,r,r,r);return i.contentDOM&&i.updateChildren(o,0),i}var Lw=class e extends Rw{constructor(e,t,n,r,o,i){super(e,t,n,r,o,null,i)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(t,n,r){let o=this.node.cut(t,n),i=document.createTextNode(o.text);return new e(this.parent,o,this.outerDeco,this.innerDeco,i,i)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}},$w=class extends Tw{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}},Dw=class extends Rw{constructor(e,t,n,r,o,i,s,a){super(e,t,n,r,o,i,s),this.spec=a}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,t,n);return o&&this.updateInner(e,t,n,r),o}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function jw(e,t,n){let r=e.firstChild,o=!1;for(let i=0;i<t.length;i++){let s=t[i],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=Vw(r),o=!0;r=r.nextSibling}else o=!0,e.insertBefore(a,r);if(s instanceof Aw){let t=r?r.previousSibling:e.lastChild;jw(s.contentDOM,s.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Vw(r),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}var Bw=function(e){e&&(this.nodeName=e)};Bw.prototype=Object.create(null);var zw=[new Bw];function _w(e,t,n){if(0==e.length)return zw;let r=n?zw[0]:new Bw,o=[r];for(let i=0;i<e.length;i++){let s=e[i].type.attrs;if(s){s.nodeName&&o.push(r=new Bw(s.nodeName));for(let e in s){let i=s[e];null!=i&&(n&&1==o.length&&o.push(r=new Bw(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+i:"style"==e?r.style=(r.style?r.style+";":"")+i:"nodeName"!=e&&(r[e]=i))}}}return o}function Fw(e,t,n,r){if(n==zw&&r==zw)return t;let o=t;for(let i=0;i<r.length;i++){let t=r[i],s=n[i];if(i){let n;s&&s.nodeName==t.nodeName&&o!=e&&(n=o.parentNode)&&n.nodeName.toLowerCase()==t.nodeName||(n=document.createElement(t.nodeName),n.pmIsDeco=!0,n.appendChild(o),s=zw[0]),o=n}Ww(o,s||zw[0],t)}return o}function Ww(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==o.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<o.length;t++)-1==r.indexOf(o[t])&&e.classList.add(o[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function Hw(e,t,n){return Fw(e,e,zw,_w(t,n,1!=e.nodeType))}function Uw(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Vw(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var Kw=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,o=e.childCount,i=new Map,s=[];e:for(;o>0;){let a;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof Aw)){a=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let o=0,i=this.stack.length>>1,s=Math.min(i,e.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&!1!==e[o].type.spec.spanning;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let o=-1,s=this.top.children.length;r<this.preMatch.index&&(s=Math.min(this.index+3,s));for(let t=this.index;t<s;t++){let n=this.top.children[t];if(n.matchesMark(e[i])&&!this.isLocked(n.dom)){o=t;break}}if(o<0&&this.index<this.top.children.length){let t=this.top.children[this.index];t instanceof Aw&&3!=t.dirty&&t.mark.type==e[i].type&&t.spec.update&&!this.isLocked(t.dom)&&t.spec.update(e[i])&&(t.mark=e[i],o=this.index,this.changed=!0)}if(o>-1)o>this.index&&(this.changed=!0,this.destroyBetween(this.index,o)),this.top=this.top.children[this.index];else{let r=Aw.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(let s=this.index,a=Math.min(this.top.children.length,s+5);s<a;s++){let r=this.top.children[s];if(r.matchesNode(e,t,n)&&!this.preMatch.matched.has(r)){i=s;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,o){let i=this.top.children[r];return 3==i.dirty&&i.dom==i.contentDOM&&(i.dirty=2),!!i.update(e,t,n,o)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,r,o,i){for(let s=this.index;s<this.top.children.length;s++){let a=this.top.children[s];if(a instanceof Rw){let l=this.preMatch.matched.get(a);if(null!=l&&l!=o)return!1;let c,d=a.dom,u=this.isLocked(d)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&3!=a.dirty&&Uw(t,a.outerDeco));if(!u&&a.update(e,t,n,r))return this.destroyBetween(this.index,s),a.dom!=d&&(this.changed=!0),this.index++,!0;if(!u&&(c=this.recreateWrapper(a,e,t,n,r,i)))return this.destroyBetween(this.index,s),this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(r,i+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,o,i){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!Uw(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let s=Rw.create(this.top,t,n,r,o,i);if(s.contentDOM){s.children=e.children,e.children=[];for(let e of s.children)e.parent=s}return e.destroy(),s}addNode(e,t,n,r,o){let i=Rw.create(this.top,e,t,n,r,o);i.contentDOM&&i.updateChildren(r,o+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){let r=new Cw(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Aw;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Lw)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Zb||Jb)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new $w(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}};function qw(e,t){return e.type.side-t.type.side}function Yw(e,t,n,r,o){let i=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],c=a,d=a+=l.size;c>=n||d<=t?i.push(l):(c<t&&i.push(l.slice(0,t-c,r)),o&&(i.push(o),o=void 0),d>n&&i.push(l.slice(n-c,l.size,r)))}return i}function Xw(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=r.resolve(s);if(Bb(n)){for(a=s;o&&!o.node;)o=o.parent;let e=o.node;if(o&&e.isAtom&&Dx.isSelectable(e)&&o.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,o=t==Db(e);r||o;){if(e==n)return!0;let t=Cb(e);if(!(e=e.parentNode))return!1;r=r&&0==t,o=o&&t==Db(e)}}(n.focusNode,n.focusOffset,o.dom))){let e=o.posBefore;l=new Dx(s==e?c:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=s,o=s;for(let r=0;r<n.rangeCount;r++){let i=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(i.startContainer,i.startOffset,1)),o=Math.max(o,e.docView.posFromDOM(i.endContainer,i.endOffset,-1))}if(t<0)return null;[a,s]=o==e.state.selection.anchor?[o,t]:[t,o],c=r.resolve(s)}else a=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(a<0)return null}let d=r.resolve(a);if(!l){l=ov(e,d,c,"pointer"==t||e.state.selection.head<c.pos&&!i?1:-1)}return l}function Jw(e){return e.editable?e.hasFocus():sv(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Gw(e,t=!1){let n=e.state.selection;if(nv(e,n),!Jw(e))return;let r=e.input.mouseDown;if(!t&&Jb&&r){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&Nb(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)&&r.delaySelUpdate())return void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r="IMG"==n.nodeName;r?t.collapse(n.parentNode,Cb(n)+1):t.collapse(n,0);!r&&!e.state.selection.visible&&Kb&&qb<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{let r,o,{anchor:i,head:s}=n;!Zw||n instanceof Lx||(n.$from.parent.inlineContent||(r=Qw(e,n.from)),n.empty||n.$from.parent.inlineContent||(o=Qw(e,n.to))),e.docView.setSelection(i,s,e,t),Zw&&(r&&tv(r),o&&tv(o)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==o||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{Jw(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")},20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}var Zw=Zb||Jb&&Gb<63;function Qw(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(Zb&&o&&"false"==o.contentEditable)return ev(o);if(!(o&&"false"!=o.contentEditable||i&&"false"!=i.contentEditable)){if(o)return ev(o);if(i)return ev(i)}}function ev(e){return e.contentEditable="true",Zb&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function tv(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function nv(e,t){if(t instanceof Dx){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(rv(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else rv(e)}function rv(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function ov(e,t,n,r){return e.someProp("createSelectionBetween",r=>r(e,t,n))||Lx.between(t,n,r)}function iv(e){return!(e.editable&&!e.hasFocus())&&sv(e)}function sv(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(n){return!1}}function av(e,t){let{$anchor:n,$head:r}=e.selection,o=t>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&Ox.findFrom(i,t)}function lv(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function cv(e,t,n){let r=e.state.selection;if(!(r instanceof Lx)){if(r instanceof Dx&&r.node.isInline)return lv(e,new Lx(t>0?r.$to:r.$from));{let n=av(e.state,t);return!!n&&lv(e,n)}}if(n.indexOf("s")>-1){let{$head:n}=r,o=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let i=e.state.doc.resolve(n.pos+o.nodeSize*(t<0?-1:1));return lv(e,new Lx(r.$anchor,i))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=av(e.state,t);return!!(n&&n instanceof Dx)&&lv(e,n)}if(!(ew&&n.indexOf("m")>-1)){let n,o=r.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText)return!1;let s=t<0?o.pos-i.nodeSize:o.pos;return!!(i.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(Dx.isSelectable(i)?lv(e,new Dx(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):!!rw&&lv(e,new Lx(e.state.doc.resolve(t<0?s:s+i.nodeSize))))}}function dv(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function uv(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function pv(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=!1;Yb&&1==n.nodeType&&r<dv(n)&&uv(n.childNodes[r],-1)&&(s=!0);for(;;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(uv(e,-1))o=n,i=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(hv(n))break;{let t=n.previousSibling;for(;t&&uv(t,-1);)o=n.parentNode,i=Cb(t),t=t.previousSibling;if(t)n=t,r=dv(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?fv(e,n,r):o&&fv(e,o,i)}(e):function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=dv(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!uv(n.childNodes[r],1))break;o=n,i=++r}else{if(hv(n))break;{let t=n.nextSibling;for(;t&&uv(t,1);)o=t.parentNode,i=Cb(t)+1,t=t.nextSibling;if(t)n=t,r=0,s=dv(n);else{if(n=n.parentNode,n==e.dom)break;r=s=0}}}o&&fv(e,o,i)}(e)}function hv(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function fv(e,t,n){if(3!=t.nodeType){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!jb(e);)t=Cb(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!jb(e);)t=Cb(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(Bb(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:o}=e;setTimeout(()=>{e.state==o&&Gw(e)},50)}function mv(e,t){let n=e.state.doc.resolve(t);if(!Jb&&!tw&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function gv(e,t,n){let r=e.state.selection;if(r instanceof Lx&&!r.empty||n.indexOf("s")>-1)return!1;if(ew&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=av(e.state,t);if(n&&n instanceof Dx)return lv(e,n)}if(!o.parent.inlineContent){let n=t<0?o:i,s=r instanceof Bx?Ox.near(n,t):Ox.findFrom(n,t);return!!s&&lv(e,s)}return!1}function yv(e,t){if(!(e.state.selection instanceof Lx))return!0;let{$head:n,$anchor:r,empty:o}=e.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let r=e.state.tr;return t<0?r.delete(n.pos-i.nodeSize,n.pos):r.delete(n.pos,n.pos+i.nodeSize),e.dispatch(r),!0}return!1}function xv(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function bv(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);if(8==n||ew&&72==n&&"c"==r)return yv(e,-1)||pv(e,-1);if(46==n&&!t.shiftKey||ew&&68==n&&"c"==r)return yv(e,1)||pv(e,1);if(13==n||27==n)return!0;if(37==n||ew&&66==n&&"c"==r){let t=37==n?"ltr"==mv(e,e.state.selection.from)?-1:1:-1;return cv(e,t,r)||pv(e,t)}if(39==n||ew&&70==n&&"c"==r){let t=39==n?"ltr"==mv(e,e.state.selection.from)?1:-1:1;return cv(e,t,r)||pv(e,t)}return 38==n||ew&&80==n&&"c"==r?gv(e,-1,r)||pv(e,-1):40==n||ew&&78==n&&"c"==r?function(e){if(!Zb||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;xv(e,n,"true"),setTimeout(()=>xv(e,n,"false"),20)}return!1}(e)||gv(e,1,r)||pv(e,1):r==(ew?"m":"c")&&(66==n||73==n||89==n||90==n)}function wv(e,t){e.someProp("transformCopied",n=>{t=n(t,e)});let n=[],{content:r,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||Ny.fromSchema(e.state.schema),a=Cv(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c,d=l.firstChild,u=0;for(;d&&1==d.nodeType&&(c=Tv[d.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=a.createElement(c[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),u++}d=l.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice",`${o} ${i}${u?` -${u}`:""} ${JSON.stringify(n)}`),{dom:l,text:e.someProp("clipboardTextSerializer",n=>n(t,e))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function vv(e,t,n,r,o){let i,s,a=o.parent.type.spec.code;if(!n&&!t)return null;let l=!!t&&(r||a||!n);if(l){if(e.someProp("transformPastedText",n=>{t=n(t,a||r,e)}),a)return s=new jg(Ag.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{s=t(s,e,!0)}),s;let n=e.someProp("clipboardTextParser",n=>n(t,o,r,e));if(n)s=n;else{let n=o.marks(),{schema:r}=e.state,s=Ny.fromSchema(r);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=i.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))})}}else e.someProp("transformPastedHTML",t=>{n=t(n,e)}),i=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=Cv(),o=r.body,i=/<([a-z][^>\s]+)/i.exec(e);(n=i&&Tv[i[1].toLowerCase()])&&(e=n.map(e=>"<"+e+">").join("")+e+n.map(e=>"</"+e+">").reverse().join(""));if(o.innerHTML=function(e){let t=window.trustedTypes;if(!t)return e;Ov||(Ov=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e}));return Ov.createHTML(e)}(e),n)for(let s=0;s<n.length;s++)o=o.querySelector(n[s])||o;for(let s=0;s<r.styleSheets.length;s++){let e=r.styleSheets[s];for(let t=0;t<e.rules.length;t++){let n=e.rules[t];if(n instanceof CSSStyleRule){let e=o.querySelectorAll(n.selectorText);for(let t=0;t<e.length;t++)e[t].style.cssText+=n.style.cssText}}}return o}(n),rw&&function(e){let t=e.querySelectorAll(Jb?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(i);let c=i&&i.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let u=+d[3];u>0;u--){let e=i.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;i=e}if(s||(s=(e.someProp("clipboardParser")||e.someProp("domParser")||Sy.fromSchema(e.state.schema)).parseSlice(i,{preserveWhitespace:!(!l&&!d),context:o,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||kv.test(e.parentNode.nodeName)?null:{ignore:!0}})),d)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(a){return e}let{content:o,openStart:i,openEnd:s}=e;for(let l=n.length-2;l>=0;l-=2){let e=r.nodes[n[l]];if(!e||e.hasRequiredAttrs())break;o=Ag.from(e.create(n[l+1],o)),i++,s++}return new jg(o,i,s)}(Ev(s,+d[1],+d[2]),d[4]);else if(s=jg.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,o=t.node(n).contentMatchAt(t.index(n)),i=[];if(e.forEach(e=>{if(!i)return;let t,n=o.findWrapping(e.type);if(!n)return i=null;if(t=i.length&&r.length&&Pv(n,r,e,i[i.length-1],0))i[i.length-1]=t;else{i.length&&(i[i.length-1]=Mv(i[i.length-1],r.length));let t=Sv(e,n);i.push(t),o=o.matchType(t.type),r=n}}),i)return Ag.from(i)}return e}(s.content,o),!0),s.openStart||s.openEnd){let e=0,t=0;for(let n=s.content.firstChild;e<s.openStart&&!n.type.spec.isolating;e++,n=n.firstChild);for(let n=s.content.lastChild;t<s.openEnd&&!n.type.spec.isolating;t++,n=n.lastChild);s=Ev(s,e,t)}return e.someProp("transformPasted",t=>{s=t(s,e,l)}),s}var kv=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Sv(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,Ag.from(e));return e}function Pv(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){let i=Pv(e,t,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?n.type:e[o+1]))return r.copy(r.content.append(Ag.from(Sv(n,e,o+1))))}}function Mv(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,Mv(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(Ag.empty,!0);return e.copy(n.append(r))}function Iv(e,t,n,r,o,i){let s=t<0?e.firstChild:e.lastChild,a=s.content;return e.childCount>1&&(i=0),o<r-1&&(a=Iv(a,t,n,r,o+1,i)),o>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(Ag.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function Ev(e,t,n){return t<e.openStart&&(e=new jg(Iv(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new jg(Iv(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var Tv={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function Cv(){return document.implementation.createHTMLDocument("title")}var Ov=null;var Av={},Rv={},Nv={touchstart:!0,touchmove:!0},Lv=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function $v(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Dv(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>jv(e,t))})}function jv(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)})}function Bv(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function zv(e){return{left:e.clientX,top:e.clientY}}function _v(e,t,n,r,o){if(-1==r)return!1;let i=e.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(e.someProp(t,t=>s>i.depth?t(e,n,i.nodeAfter,i.before(s),o,!0):t(e,n,i.node(s),i.before(s),o,!1)))return!0;return!1}function Fv(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Wv(e,t,n,r,o){return _v(e,"handleClickOn",t,n,r)||e.someProp("handleClick",n=>n(e,t,r))||(o?function(e,t){if(-1==t)return!1;let n,r,o=e.state.selection;o instanceof Dx&&(n=o.node);let i=e.state.doc.resolve(t);for(let s=i.depth+1;s>0;s--){let e=s>i.depth?i.nodeAfter:i.node(s);if(Dx.isSelectable(e)){r=n&&o.$from.depth>0&&s>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(s);break}}return null!=r&&(Fv(e,Dx.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&Dx.isSelectable(r))&&(Fv(e,new Dx(n),"pointer"),!0)}(e,n))}function Hv(e,t,n,r){return _v(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",n=>n(e,t,r))}function Uv(e,t,n,r){return _v(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",n=>n(e,t,r))||function(e,t,n){if(0!=n.button)return!1;let r=Vv(e,t,!0),o=e.state.doc;if(!r)return!1;Fv(e,r,"pointer"),r instanceof Lx&&o.eq(e.state.doc)&&(e.input.mouseDown=new Jv(e,r));return!0}(e,n,r)}function Vv(e,t,n){let r=e.state.doc;if(-1==t)return r.inlineContent?Lx.create(r,0,r.content.size):null;let o=r.resolve(t);for(let i=o.depth+1;i>0;i--){let e=i>o.depth?o.nodeAfter:o.node(i),t=o.before(i);if(e.inlineContent)return Lx.create(r,t+1,t+1+e.content.size);if(n&&Dx.isSelectable(e))return Dx.create(r,t)}return null}function Kv(e){return nk(e)}Rv.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Gv(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!nw||!Jb||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!Qb||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",t=>t(e,n))||bv(e,n)?n.preventDefault():$v(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",t=>t(e,zb(13,"Enter"))),e.input.lastIOSEnter=0)},200)}},Rv.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},Rv.keypress=(e,t)=>{let n=t;if(Gv(e)||!n.charCode||n.ctrlKey&&!n.altKey||ew&&n.metaKey)return;if(e.someProp("handleKeyPress",t=>t(e,n)))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof Lx&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode),o=()=>e.state.tr.insertText(t).scrollIntoView();/[\r\n]/.test(t)||e.someProp("handleTextInput",n=>n(e,r.$from.pos,r.$to.pos,t,o))||e.dispatch(o()),n.preventDefault()}};var qv=ew?"metaKey":"ctrlKey";Av.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Kv(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[qv]&&e.input.lastClick.button==n.button&&("singleClick"==e.input.lastClick.type?i="doubleClick":"doubleClick"==e.input.lastClick.type&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let s=e.posAtCoords(zv(n));s&&("singleClick"==i?e.input.mouseDown=new Xv(e,s,n,!!r):("doubleClick"==i?Hv:Uv)(e,s.pos,s.inside,n)?n.preventDefault():$v(e,"pointer"))};var Yv=class{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){0==e.buttons&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}},Xv=class extends Yv{constructor(e,t,n,r){let o,i;if(super(e),this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[qv],this.allowDefault=n.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),i=t.inside;else{let n=e.state.doc.resolve(t.pos);o=n.parent,i=n.depth?n.before():0}const s=r?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a&&1==a.nodeDOM.nodeType?a.nodeDOM:null;let{selection:l}=e.state;0==n.button&&(o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof Dx&&l.from<=i&&l.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Yb||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),$v(e,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||Gw(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(zv(e))),this.updateAllowDefault(e),this.allowDefault||!t?$v(this.view,"pointer"):Wv(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Zb&&this.mightDrag&&!this.mightDrag.node.isAtom||Jb&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Fv(this.view,Ox.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):$v(this.view,"pointer")}move(e){this.updateAllowDefault(e),$v(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return!!this.allowDefault&&(this.delayedSelectionSync=!0,!0)}},Jv=class extends Yv{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(0==e.buttons||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc))return void this.done();e.preventDefault(),$v(this.view,"pointer");let t=this.view.posAtCoords(zv(e)),n=t&&Vv(this.view,t.inside,!1);if(!n)return;let{doc:r}=this.view.state,o=this.startSelection,[i,s]=n.from<o.from?[o.to,n.from]:[o.from,n.to];Fv(this.view,Lx.create(r,i,s),"pointer")}};function Gv(e,t){return!!e.composing||!!(Zb&&Math.abs(Date.now()-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}Av.touchstart=e=>{e.input.lastTouch=Date.now(),Kv(e),$v(e,"pointer")},Av.touchmove=e=>{e.input.lastTouch=Date.now(),$v(e,"pointer")},Av.contextmenu=e=>Kv(e);var Zv=nw?5e3:-1;function Qv(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>nk(e),t))}function ek(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function tk(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=Db(e=e.childNodes[t-1])}else{if(!e.parentNode||jb(e))return null;t=Cb(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||jb(e))return null;t=Cb(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,o=e.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(e&&e.isText(n.nodeValue))return r}}return n||r}function nk(e,t=!1){if(!(nw&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),ek(e),t||e.docView&&e.docView.dirty){let n=Xw(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):!e.markCursor&&!t||r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.updateState(e.state):e.dispatch(e.state.tr.deleteSelection()),!0}return!1}}Rv.compositionstart=Rv.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof Lx&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||Jb&&tw&&function(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||1!=t.nodeType||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return 1==r.nodeType&&"false"==r.contentEditable}(e)))e.markCursor=e.state.storedMarks||n.marks(),nk(e,!0),e.markCursor=null;else if(nk(e,!t.selection.empty),Yb&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}Qv(e,Zv)},Rv.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,Qv(e,20))};var rk=Kb&&qb<15||Qb&&ow<604;function ok(e,t,n,r,o){let i=vv(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,o,i||jg.empty)))return!0;if(!i)return!1;let s=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),a=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(i);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function ik(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Av.copy=Rv.cut=(e,t)=>{let n=t,r=e.state.selection,o="cut"==n.type;if(r.empty)return;let i=rk?null:n.clipboardData,{dom:s,text:a}=wv(e,r.content());i?(n.preventDefault(),i.clearData(),i.setData("text/html",s.innerHTML),i.setData("text/plain",a)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}(e,s),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Rv.paste=(e,t)=>{let n=t;if(e.composing&&!nw)return;let r=rk?null:n.clipboardData,o=e.input.shiftKey&&45!=e.input.lastKeyCode;r&&ok(e,ik(r),r.getData("text/html"),o,n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ok(e,r.value,null,o,t):ok(e,r.textContent,r.innerHTML,o,t)},50)}(e,n)};var sk=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},ak=ew?"altKey":"ctrlKey";function lk(e,t){let n;return e.someProp("dragCopies",e=>{n=n||e(t)}),null!=n?!n:!t[ak]}Av.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o,i=e.state.selection,s=i.empty?null:e.posAtCoords(zv(n));if(s&&s.pos>=i.from&&s.pos<=(i instanceof Dx?i.to-1:i.to));else if(r&&r.mightDrag)o=Dx.create(e.state.doc,r.mightDrag.pos);else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=Dx.create(e.state.doc,t.posBefore))}let{dom:a,text:l,slice:c}=wv(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!Jb||Gb>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(rk?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",rk||n.dataTransfer.setData("text/plain",l),e.dragging=new sk(c,lk(e,n),o)},Av.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},Rv.dragover=Rv.dragenter=(e,t)=>t.preventDefault(),Rv.drop=(e,t)=>{try{!function(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(zv(t));if(!r)return;let o=e.state.doc.resolve(r.pos),i=n&&n.slice;i?e.someProp("transformPasted",t=>{i=t(i,e,!1)}):i=vv(e,ik(t.dataTransfer),rk?null:t.dataTransfer.getData("text/html"),!1,o);let s=!(!n||!lk(e,t));if(e.someProp("handleDrop",n=>n(e,t,i||jg.empty,s)))return void t.preventDefault();if(!i)return;t.preventDefault();let a=i?hx(e.state.doc,o.pos,i):o.pos;null==a&&(a=o.pos);let l=e.state.tr;if(s){let{node:e}=n;e?e.replace(l):l.deleteSelection()}let c=l.mapping.map(a),d=0==i.openStart&&0==i.openEnd&&1==i.content.childCount,u=l.doc;d?l.replaceRangeWith(c,c,i.content.firstChild):l.replaceRange(c,c,i);if(l.doc.eq(u))return;let p=l.doc.resolve(c);if(d&&Dx.isSelectable(i.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new Dx(p));else{let t=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((e,n,r,o)=>t=o),l.setSelection(ov(e,p,l.doc.resolve(t)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}(e,t,e.dragging)}finally{e.dragging=null}},Av.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Gw(e)},20))},Av.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},Av.beforeinput=(e,t)=>{if(Jb&&nw&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",t=>t(e,zb(8,"Backspace"))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let os in Rv)Av[os]=Rv[os];function ck(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var dk=class e{constructor(e,t){this.toDOM=e,this.spec=t||mk,this.side=this.spec.side||0}map(e,t,n,r){let{pos:o,deleted:i}=e.mapResult(t.from+r,this.side<0?-1:1);return i?null:new hk(o-n,o-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&ck(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},uk=class e{constructor(e,t){this.attrs=e,this.spec=t||mk}map(e,t,n,r){let o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new hk(o,i,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&ck(this.attrs,t.attrs)&&ck(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},pk=class e{constructor(e,t){this.attrs=e,this.spec=t||mk}map(e,t,n,r){let o=e.mapResult(t.from+r,1);if(o.deleted)return null;let i=e.mapResult(t.to+r,-1);return i.deleted||i.pos<=o.pos?null:new hk(o.pos-n,i.pos-n,this)}valid(e,t){let n,{index:r,offset:o}=e.content.findIndex(t.from);return o==t.from&&!(n=e.child(r)).isText&&o+n.nodeSize==t.to}eq(t){return this==t||t instanceof e&&ck(this.attrs,t.attrs)&&ck(this.spec,t.spec)}destroy(){}},hk=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new dk(n,r))}static inline(t,n,r,o){return new e(t,n,new uk(r,o))}static node(t,n,r,o){return new e(t,n,new pk(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof uk}get widget(){return this.type instanceof dk}},fk=[],mk={},gk=class e{constructor(e,t){this.local=e.length?e:fk,this.children=t.length?t:fk}static create(e,t){return t.length?Sk(t,e,0,mk):yk}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,o){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=t&&s.to>=e&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<t&&this.children[i+1]>e){let s=this.children[i]+1;this.children[i+2].findInner(e-s,t-s,n,r+s,o)}}map(e,t,n){return this==yk||0==e.maps.length?this:this.mapInner(e,t,0,0,n||mk)}mapInner(t,n,r,o,i){let s;for(let e=0;e<this.local.length;e++){let a=this.local[e].map(t,r,o);a&&a.type.valid(n,a)?(s||(s=[])).push(a):i.onRemove&&i.onRemove(this.local[e].spec)}return this.children.length?bk(this.children,s||[],t,n,r,o,i):s?new e(s.sort(Pk),fk):yk}add(t,n){return n.length?this==yk?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let o,i=0;t.forEach((e,t)=>{let s,a=t+r;if(s=vk(n,e,a)){for(o||(o=this.children.slice());i<o.length&&o[i]<t;)i+=3;o[i]==t?o[i+2]=o[i+2].addInner(e,s,a+1):o.splice(i,0,t,t+e.nodeSize,Sk(s,e,a+1,mk)),i+=3}});let s=wk(i?kk(n):n,-r);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||s.splice(e--,1);return new e(s.length?this.local.concat(s).sort(Pk):this.local,o||this.children)}remove(e){return 0==e.length||this==yk?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,o=this.local;for(let e=0;e<r.length;e+=3){let o,i=r[e]+n,s=r[e+1]+n;for(let e,n=0;n<t.length;n++)(e=t[n])&&e.from>i&&e.to<s&&(t[n]=null,(o||(o=[])).push(e));if(!o)continue;r==this.children&&(r=this.children.slice());let a=r[e+2].removeInner(o,i+1);a!=yk?r[e+2]=a:(r.splice(e,3),e-=3)}if(o.length)for(let e,i=0;i<t.length;i++)if(e=t[i])for(let t=0;t<o.length;t++)o[t].eq(e,n)&&(o==this.local&&(o=this.local.slice()),o.splice(t--,1));return r==this.children&&o==this.local?this:o.length||r.length?new e(o,r):yk}forChild(t,n){if(this==yk)return this;if(n.isLeaf)return e.empty;let r,o;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let i=t+1,s=i+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<s&&t.to>i&&t.type instanceof uk){let e=Math.max(i,t.from)-i,n=Math.min(s,t.to)-i;e<n&&(o||(o=[])).push(t.copy(e,n))}}if(o){let t=new e(o.sort(Pk),fk);return r?new xk([t,r]):t}return r||yk}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return Mk(this.localsInner(e))}localsInner(e){if(this==yk)return fk;if(e.inlineContent||!this.local.some(uk.is))return this.local;let t=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof uk||t.push(this.local[n]);return t}forEachSet(e){e(this)}};gk.empty=new gk([],[]),gk.removeOverlap=Mk;var yk=gk.empty,xk=class e{constructor(e){this.members=e}map(t,n){const r=this.members.map(e=>e.map(t,n,mk));return e.from(r)}forChild(t,n){if(n.isLeaf)return gk.empty;let r=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(t,n);i!=yk&&(i instanceof e?r=r.concat(i.members):r.push(i))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<o.length;e++)t.push(o[e])}else t=o}return t?Mk(n?t:t.sort(Pk)):fk}static from(t){switch(t.length){case 0:return yk;case 1:return t[0];default:return new e(t.every(e=>e instanceof gk)?t:t.reduce((e,t)=>e.concat(t instanceof gk?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function bk(e,t,n,r,o,i,s){let a=e.slice();for(let c=0,d=i;c<n.maps.length;c++){let e=0;n.maps[c].forEach((t,n,r,o)=>{let i=o-r-(n-t);for(let s=0;s<a.length;s+=3){let r=a[s+1];if(r<0||t>r+d-e)continue;let o=a[s]+d-e;n>=o?a[s+1]=t<=o?-2:-1:t>=d&&i&&(a[s]+=i,a[s+1]+=i)}e+=i}),d=n.maps[c].map(d,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(-2==a[c+1]){l=!0,a[c+1]=-1;continue}let t=n.map(e[c]+i),d=t-o;if(d<0||d>=r.content.size){l=!0;continue}let u=n.map(e[c+1]+i,-1)-o,{index:p,offset:h}=r.content.findIndex(d),f=r.maybeChild(p);if(f&&h==d&&h+f.nodeSize==u){let r=a[c+2].mapInner(n,f,t+1,e[c]+i+1,s);r!=yk?(a[c]=d,a[c+1]=u,a[c+2]=r):(a[c+1]=-2,l=!0)}else l=!0}if(l){let l=Sk(function(e,t,n,r,o,i,s){function a(e,t){for(let i=0;i<e.local.length;i++){let a=e.local[i].map(r,o,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[i].spec)}for(let n=0;n<e.children.length;n+=3)a(e.children[n+2],e.children[n]+t+1)}for(let l=0;l<e.length;l+=3)-1==e[l+1]&&a(e[l+2],t[l]+i+1);return n}(a,e,t,n,o,i,s),r,0,s);t=l.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<l.children.length;e+=3){let n=l.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,l.children[e],l.children[e+1],l.children[e+2])}}return new gk(t.sort(Pk),a)}function wk(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let o=e[r];n.push(new hk(o.from+t,o.to+t,o.type))}return n}function vk(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,o=null;for(let i,s=0;s<e.length;s++)(i=e[s])&&i.from>n&&i.to<r&&((o||(o=[])).push(i),e[s]=null);return o}function kk(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Sk(e,t,n,r){let o=[],i=!1;t.forEach((t,s)=>{let a=vk(e,t,s+n);if(a){i=!0;let e=Sk(a,t,n+s+1,r);e!=yk&&o.push(s,s+t.nodeSize,e)}});let s=wk(i?kk(e):e,-n).sort(Pk);for(let a=0;a<s.length;a++)s[a].type.valid(t,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||o.length?new gk(s,o):yk}function Pk(e,t){return e.from-t.from||e.to-t.to}function Mk(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let o=n+1;o<t.length;o++){let i=t[o];if(i.from!=r.from){i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),Ik(t,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),Ik(t,o+1,i.copy(r.to,i.to)))}}return t}function Ik(e,t,n){for(;t<e.length&&Pk(n,e[t])>0;)t++;e.splice(t,0,n)}function Ek(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=yk&&t.push(r)}),e.cursorWrapper&&t.push(gk.create(e.state.doc,[e.cursorWrapper.deco])),xk.from(t)}var Tk={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Ck=Kb&&qb<=11,Ok=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},Ak=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Ok,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);Kb&&qb<=11&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():Zb&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Ck&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Tk)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(iv(this.view)){if(this.suppressingSelectionUpdates)return Gw(this.view);if(Kb&&qb<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Nb(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t,n=new Set;for(let o=e.focusNode;o;o=Ob(o))n.add(o);for(let o=e.anchorNode;o;o=Ob(o))if(n.has(o)){t=o;break}let r=t&&this.view.docView.nearestDesc(t);return r&&r.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&iv(e)&&!this.ignoreSelectionChange(n),o=-1,i=-1,s=!1,a=[];if(e.editable)for(let c=0;c<t.length;c++){let e=this.registerMutation(t[c],a);e&&(o=o<0?e.from:Math.min(e.from,o),i=i<0?e.to:Math.max(e.to,i),e.typeOver&&(s=!0))}if(a.some(e=>"BR"==e.nodeName)&&(8==e.input.lastKeyCode||46==e.input.lastKeyCode||Jb&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(e=>"childList"==e.type&&e.removedNodes.length))){for(let c of a)if("BR"==c.nodeName&&c.parentNode){let e=c.nextSibling;for(;e&&1==e.nodeType;){if("false"==e.contentEditable){c.parentNode.removeChild(c);break}e=e.firstChild}}}else if(Yb&&a.length){let t=a.filter(e=>"BR"==e.nodeName);if(2==t.length){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;!t||"LI"!=t.nodeName||n&&$k(e,n)==t||r.remove()}}}let l=null;o<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Bb(n)&&(l=Xw(e))&&l.eq(Ox.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Gw(e),this.currentSelection.set(n),e.scrollToSelection()):(o>-1||r)&&(o>-1&&(e.docView.markDirty(o,i),function(e){if(Rk.has(e))return;if(Rk.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)){if(e.requiresGeckoHackNode=Yb,Nk)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Nk=!0}}(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,function(e,t){var n;let{focusNode:r,focusOffset:o}=e.domSelectionRange();for(let i of t)if("TR"==(null===(n=i.parentNode)||void 0===n?void 0:n.nodeName)){let t=i.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let n=t;for(;;){let e=n.firstChild;if(!e||1!=e.nodeType||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;n=e}n.insertBefore(i,n.firstChild),r==i&&e.domSelection().collapse(i,o)}else i.parentNode.removeChild(i)}}(e,a)),this.handleDOMChange(o,i,s,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Gw(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),3==r.nodeType&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,o=e.nextSibling;if(Kb&&qb<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:i}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!i||Array.prototype.indexOf.call(e.addedNodes,i)<0)&&(o=i)}let i=r&&r.parentNode==e.target?Cb(r)+1:0,s=n.localPosFromDOM(e.target,i,-1),a=o&&o.parentNode==e.target?Cb(o):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,a,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}},Rk=new WeakMap,Nk=!1;function Lk(e,t){let n=t.startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return Nb(s.node,s.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function $k(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function Dk(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Zb&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||Zb&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}var jk=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Bk(e,t,n,r,o){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Xw(e,t);if(n&&!e.state.selection.eq(n)){if(Jb&&nw&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,zb(13,"Enter"))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),i&&r.setMeta("composition",i),e.dispatch(r)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(n);t=s.before(a+1),n=e.state.doc.resolve(n).after(a+1);let l,c,d=e.state.selection,u=function(e,t,n){let r,{node:o,fromOffset:i,toOffset:s,from:a,to:l}=e.docView.parseRange(t,n),c=e.domSelectionRange(),d=c.anchorNode;if(d&&e.dom.contains(1==d.nodeType?d:d.parentNode)&&(r=[{node:d,offset:c.anchorOffset}],Bb(c)||r.push({node:c.focusNode,offset:c.focusOffset})),Jb&&8===e.input.lastKeyCode)for(let g=s;g>i;g--){let e=o.childNodes[g-1],t=e.pmViewDesc;if("BR"==e.nodeName&&!t){s=g;break}if(!t||t.size)break}let u=e.state.doc,p=e.someProp("domParser")||Sy.fromSchema(e.state.schema),h=u.resolve(a),f=null,m=p.parse(o,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:s,preserveWhitespace:"pre"!=h.parent.type.whitespace||"full",findPositions:r,ruleFromNode:Dk,context:h});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),f={anchor:e+a,head:t+a}}return{doc:m,sel:f,from:a,to:l}}(e,t,n),p=e.state.doc,h=p.slice(u.from,u.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(l=e.state.selection.to,c="end"):(l=e.state.selection.from,c="start"),e.input.lastKeyCode=null;let f=function(e,t,n,r,o){let i=e.findDiffStart(t,n),s=n+e.size,a=n+t.size;if(null==i)return null;let{a:l,b:c}=e.findDiffEnd(t,s,a);if("end"==o){r-=l+Math.max(0,i-Math.min(l,c))-i}if(l<i&&s<a){i-=r<=i&&r>=l?i-r:0,c=i+(c-l),l=i}else if(c<i){i-=r<=i&&r>=c?i-r:0,l=i+(l-c),c=i}return{start:i,endA:l,endB:c}}(h.content,u.doc.content,u.from,l,c);if(f&&e.input.domChangeCount++,(Qb&&e.input.lastIOSEnter>Date.now()-225||nw)&&o.some(e=>1==e.nodeType&&!jk.test(e.nodeName))&&(!f||f.endA>=f.endB)&&e.someProp("handleKeyDown",t=>t(e,zb(13,"Enter"))))return void(e.input.lastIOSEnter=0);if(!f){if(!(r&&d instanceof Lx&&!d.empty&&d.$head.sameParent(d.$anchor))||e.composing||u.sel&&u.sel.anchor!=u.sel.head){if(u.sel){let t=zk(e,e.state.doc,u.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);i&&n.setMeta("composition",i),e.dispatch(n)}}return}f={start:d.from,endA:d.to,endB:d.to}}e.state.selection.from<e.state.selection.to&&f.start==f.endB&&e.state.selection instanceof Lx&&(f.start>e.state.selection.from&&f.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?f.start=e.state.selection.from:f.endA<e.state.selection.to&&f.endA>=e.state.selection.to-2&&e.state.selection.to<=u.to&&(f.endB+=e.state.selection.to-f.endA,f.endA=e.state.selection.to)),Kb&&qb<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>u.from&&"  "==u.doc.textBetween(f.start-u.from-1,f.start-u.from+1)&&(f.start--,f.endA--,f.endB--);let m=u.doc.resolveNoCache(f.start-u.from),g=u.doc.resolveNoCache(f.endB-u.from),y=p.resolve(f.start),x=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=f.endA;if((Qb&&e.input.lastIOSEnter>Date.now()-225&&(!x||o.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!x&&m.pos<u.doc.content.size&&(!m.sameParent(g)||!m.parent.inlineContent)&&m.pos<g.pos&&!/\S/.test(u.doc.textBetween(m.pos,g.pos,"","")))&&e.someProp("handleKeyDown",t=>t(e,zb(13,"Enter"))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>f.start&&function(e,t,n,r,o){if(n-t<=o.pos-r.pos||_k(r,!0,!1)<o.pos)return!1;let i=e.resolve(t);if(!r.parent.isTextblock){let e=i.nodeAfter;return null!=e&&n==t+e.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=e.resolve(_k(i,!0,!0));return!(!s.parent.isTextblock||s.pos>n||_k(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(p,f.start,f.endA,m,g)&&e.someProp("handleKeyDown",t=>t(e,zb(8,"Backspace"))))return void(nw&&Jb&&e.domObserver.suppressSelectionUpdates());Jb&&f.endB==f.start&&(e.input.lastChromeDelete=Date.now()),nw&&!x&&m.start()!=g.start()&&0==g.parentOffset&&m.depth==g.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==f.endA&&(f.endB-=2,g=u.doc.resolveNoCache(f.endB-u.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,zb(13,"Enter"))})},20));let b,w=f.start,v=f.endA,k=t=>{let n=t||e.state.tr.replace(w,v,u.doc.slice(f.start-u.from,f.endB-u.from));if(u.sel){let t=zk(e,n.doc,u.sel);t&&!(Jb&&e.composing&&t.empty&&(f.start!=f.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==w||t.head==n.mapping.map(v)-1)||Kb&&t.empty&&t.head==w)&&n.setSelection(t)}return i&&n.setMeta("composition",i),n.scrollIntoView()};if(x)if(m.pos==g.pos){Kb&&qb<=11&&0==m.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Gw(e),20));let t=k(e.state.tr.delete(w,v)),n=p.resolve(f.start).marksAcross(p.resolve(f.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(f.endA==f.endB&&(b=function(e,t){let n,r,o,i=e.firstChild.marks,s=t.firstChild.marks,a=i,l=s;for(let d=0;d<s.length;d++)a=s[d].removeFromSet(a);for(let d=0;d<i.length;d++)l=i[d].removeFromSet(l);if(1==a.length&&0==l.length)r=a[0],n="add",o=e=>e.mark(r.addToSet(e.marks));else{if(0!=a.length||1!=l.length)return null;r=l[0],n="remove",o=e=>e.mark(r.removeFromSet(e.marks))}let c=[];for(let d=0;d<t.childCount;d++)c.push(o(t.child(d)));if(Ag.from(c).eq(e))return{mark:r,type:n}}(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,f.endA-y.start())))){let t=k(e.state.tr);"add"==b.type?t.addMark(w,v,b.mark):t.removeMark(w,v,b.mark),e.dispatch(t)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let t=m.parent.textBetween(m.parentOffset,g.parentOffset),n=()=>k(e.state.tr.insertText(t,w,v));e.someProp("handleTextInput",r=>r(e,w,v,t,n))||e.dispatch(n())}else e.dispatch(k());else e.dispatch(k())}function zk(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:ov(e,t.resolve(n.anchor),t.resolve(n.head))}function _k(e,t,n){let r=e.depth,o=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,o++}return o}var Fk=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Lv,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Kk),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Uk(this),Hk(this),this.nodeViews=Vk(this),this.docView=Nw(this.state.doc,Wk(this),Ek(this),this.dom,this),this.domObserver=new Ak(this,(e,t,n,r)=>Bk(this,e,t,n,r)),this.domObserver.start(),function(e){for(let t in Av){let n=Av[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!Bv(e,t)||jv(e,t)||!e.editable&&t.type in Rv||n(e,t)},Nv[t]?{passive:!0}:void 0)}Zb&&e.dom.addEventListener("input",()=>null),Dv(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Dv(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Kk),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let n in this._props)t[n]=this._props[n];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n;let r=this.state,o=!1,i=!1;e.storedMarks&&this.composing&&(ek(this),i=!0),this.state=e;let s=r.plugins!=e.plugins||this._props.plugins!=t.plugins;if(s||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=Vk(this);(function(e,t){let n=0,r=0;for(let o in e){if(e[o]!=t[o])return!0;n++}for(let o in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,o=!0)}(s||t.handleDOMEvents!=this._props.handleDOMEvents)&&Dv(this),this.editable=Uk(this),Hk(this);let a=Ek(this),l=Wk(this),c=r.plugins==e.plugins||r.doc.eq(e.doc)?e.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",d=o||!this.docView.matchesNode(e.doc,l,a);!d&&e.selection.eq(r.selection)||(i=!0);let u="preserve"==c&&i&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top);for(let i=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(i,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=o-20){t=r,n=a.top;break}}return{refDOM:t,refTop:n,stack:cw(e.dom)}}(this);if(i){this.domObserver.stop();let t=d&&(Kb||Jb)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(r.selection,e.selection);if(d){let n=Jb?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=tk(this)),!o&&this.docView.update(e.doc,l,a,this)||(this.docView.updateOuterDeco(l),this.docView.destroy(),this.docView=Nw(e.doc,l,a,this.dom,this)),!n||this.trackWrites&&this.dom.contains(this.trackWrites)||(t=!0)}let n=this.input.mouseDown;t||!(n&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Nb(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this)&&n.delaySelUpdate())?Gw(this,t):(nv(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():u&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;dw(n,0==r?0:r-t)}(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode))if(this.someProp("handleScrollToSelection",e=>e(this)));else if(this.state.selection instanceof Dx){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&lw(this,t.getBoundingClientRect(),e)}else lw(this,this.coordsAtPos(this.state.selection.head,1),e);else;}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new sk(e.slice,e.move,r<0?void 0:Dx.create(this.state.doc,r))}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let i=0;i<this.directPlugins.length;i++){let r=this.directPlugins[i].props[e];if(null!=r&&(n=t?t(r):r))return n}let o=this.state.plugins;if(o)for(let i=0;i<o.length;i++){let r=o[i].props[e];if(null!=r&&(n=t?t(r):r))return n}}hasFocus(){if(Kb){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(uw)return e.focus(uw);let t=cw(e);e.focus(null==uw?{get preventScroll(){return uw={preventScroll:!0},!0}}:void 0),uw||(uw=!1,dw(t,0))}(this.dom),Gw(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let t=this.dom.parentNode;t;t=t.parentNode)if(9==t.nodeType||11==t.nodeType&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t;return e||document}updateRoot(){this._root=null}posAtCoords(e){return mw(this,e)}coordsAtPos(e,t=1){return bw(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return Ew(this,t||this.state,e)}pasteHTML(e,t){return ok(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return ok(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return wv(this,e)}destroy(){this.docView&&(!function(e){e.input.mouseDown&&e.input.mouseDown.done(),e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ek(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Ab=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){jv(e,t)||!Av[t.type]||!e.editable&&t.type in Rv||Av[t.type](e,t)}(this,e)}domSelectionRange(){let e=this.domSelection();return e?Zb&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return Lk(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?Lk(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};function Wk(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))}),t.translate||(t.translate="no"),[hk.node(0,e.state.doc.content.size,t)]}function Hk(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:hk.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Uk(e){return!e.someProp("editable",t=>!1===t(e.state))}function Vk(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function Kk(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}Fk.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};for(var qk={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Yk={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Xk="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Jk="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Gk=0;Gk<10;Gk++)qk[48+Gk]=qk[96+Gk]=String(Gk);for(Gk=1;Gk<=24;Gk++)qk[Gk+111]="F"+Gk;for(Gk=65;Gk<=90;Gk++)qk[Gk]=String.fromCharCode(Gk+32),Yk[Gk]=String.fromCharCode(Gk);for(var Zk in qk)Yk.hasOwnProperty(Zk)||(Yk[Zk]=qk[Zk]);var Qk="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),eS="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function tS(e){let t,n,r,o,i=e.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let a=0;a<i.length-1;a++){let e=i[a];if(/^(cmd|meta|m)$/i.test(e))o=!0;else if(/^a(lt)?$/i.test(e))t=!0;else if(/^(c|ctrl|control)$/i.test(e))n=!0;else if(/^s(hift)?$/i.test(e))r=!0;else{if(!/^mod$/i.test(e))throw new Error("Unrecognized modifier name: "+e);Qk?o=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function nS(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function rS(e){let t=function(e){let t=Object.create(null);for(let n in e)t[tS(n)]=e[n];return t}(e);return function(e,n){let r,o=function(e){var t=!(Xk&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Jk&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?Yk:qk)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),i=t[nS(o,n)];if(i&&i(e.state,e.dispatch,e))return!0;if(1==o.length&&" "!=o){if(n.shiftKey){let r=t[nS(o,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(eS&&n.ctrlKey&&n.altKey)&&(r=qk[n.keyCode])&&r!=o){let o=t[nS(r,n)];if(o&&o(e.state,e.dispatch,e))return!0}}return!1}}var oS=l(kg(),1),iS=Mg(),sS=Object.defineProperty,aS=(e,t)=>{for(var n in t)sS(e,n,{get:t[n],enumerable:!0})};function lS(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}var cS=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:o}=n,i=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{const n=t(...e)(i);return o.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(o),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s=[],a=!!e,l=e||o.tr,c={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{const r=this.buildProps(l,t),o=n(...e)(r);return s.push(o),c}])),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(l),s.every(e=>!0===e))};return c}createCan(e){const{rawCommands:t,state:n}=this,r=!1,o=e||n.tr,i=this.buildProps(o,r);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(o,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s={tr:e,editor:r,view:i,state:lS({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(s)]))}};return s}},dS={};aS(dS,{blur:()=>uS,clearContent:()=>pS,clearNodes:()=>hS,command:()=>fS,createParagraphNear:()=>mS,cut:()=>gS,deleteCurrentNode:()=>yS,deleteNode:()=>bS,deleteRange:()=>wS,deleteSelection:()=>kS,enter:()=>SS,exitCode:()=>PS,extendMarkRange:()=>AS,first:()=>RS,focus:()=>BS,forEach:()=>zS,insertContent:()=>_S,insertContentAt:()=>US,joinBackward:()=>qS,joinDown:()=>KS,joinForward:()=>YS,joinItemBackward:()=>XS,joinItemForward:()=>JS,joinTextblockBackward:()=>GS,joinTextblockForward:()=>ZS,joinUp:()=>VS,keyboardShortcut:()=>eP,lift:()=>nP,liftEmptyBlock:()=>rP,liftListItem:()=>oP,newlineInCode:()=>iP,resetAttributes:()=>lP,scrollIntoView:()=>cP,selectAll:()=>dP,selectNodeBackward:()=>uP,selectNodeForward:()=>pP,selectParentNode:()=>hP,selectTextblockEnd:()=>fP,selectTextblockStart:()=>mP,setContent:()=>yP,setMark:()=>ZP,setMeta:()=>QP,setNode:()=>eM,setNodeSelection:()=>tM,setTextDirection:()=>nM,setTextSelection:()=>rM,sinkListItem:()=>oM,splitBlock:()=>sM,splitListItem:()=>aM,toggleList:()=>pM,toggleMark:()=>hM,toggleNode:()=>fM,toggleWrap:()=>mM,undoInputRule:()=>gM,unsetAllMarks:()=>yM,unsetMark:()=>xM,unsetTextDirection:()=>bM,updateAttributes:()=>wM,wrapIn:()=>vM,wrapInList:()=>kM});var uS=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())}),!0),pS=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),hS=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:o}=r;return!n||(o.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;const{doc:r,mapping:o}=t,i=r.resolve(o.map(n)),s=r.resolve(o.map(n+e.nodeSize)),a=i.blockRange(s);if(!a)return;const l=ox(a);if(e.type.isTextblock){const{defaultType:e}=i.parent.contentMatchAt(i.index());t.setNodeMarkup(a.start,e)}(l||0===l)&&t.lift(a,l)})}),!0)},fS=e=>t=>e(t),mS=()=>({state:e,dispatch:t})=>hb(e,t),gS=(e,t)=>({editor:n,tr:r})=>{const{state:o}=n,i=o.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const s=r.mapping.map(t);return r.insert(s,i.content),r.setSelection(new Lx(r.doc.resolve(Math.max(s-1,0)))),!0},yS=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const o=e.selection.$anchor;for(let i=o.depth;i>0;i-=1)if(o.node(i).type===r.type){if(t){const t=o.before(i),n=o.after(i);e.delete(t,n).scrollIntoView()}return!0}return!1};function xS(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var bS=e=>({tr:t,state:n,dispatch:r})=>{const o=xS(e,n.schema),i=t.selection.$anchor;for(let e=i.depth;e>0;e-=1)if(i.node(e).type===o){if(r){const n=i.before(e),r=i.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},wS=e=>({tr:t,dispatch:n})=>{const{from:r,to:o}=e;return n&&t.delete(r,o),!0},vS=(e,t,n)=>{if(!e.parent.isInline)return e.pos;if("left"===n&&e.pos>e.start()||"right"===n&&e.pos<e.end())return e.pos;const r=t.nodes[e.parent.type.name].spec;return(o=r).content&&/^text(\*|\+)/.test(o.content)?"left"===n?e.start()-1:e.end()+1:e.pos;var o},kS=()=>({state:e,dispatch:t})=>{if(e.selection.empty)return!1;if(t){const n=e.tr,{ranges:r}=e.selection,o=n.steps.length;r.forEach(t=>{const r=n.mapping.slice(o),{from:i,to:s}=(a=n.doc.resolve(r.map(t.$from.pos)),l=n.doc.resolve(r.map(t.$to.pos)),c=e.schema,{from:vS(a,c,"left"),to:vS(l,c,"right")});var a,l,c;n.deleteRange(i,s)}),n.scrollIntoView(),t(n)}return!0},SS=()=>({commands:e})=>e.keyboardShortcut("Enter"),PS=()=>({state:e,dispatch:t})=>pb(e,t);function MS(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function IS(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:MS(t[r])?t[r].test(e[r]):t[r]===e[r])}function ES(e,t,n={}){return e.find(e=>e.type===t&&IS(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function TS(e,t,n={}){return!!ES(e,t,n)}function CS(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(r.node&&r.node.marks.some(e=>e.type===t)||(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){const e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!ES([...r.node.marks],t,n))return;let o=r.index,i=e.start()+r.offset,s=o+1,a=i+r.node.nodeSize;for(;o>0&&TS([...e.parent.child(o-1).marks],t,n);)o-=1,i-=e.parent.child(o).nodeSize;for(;s<e.parent.childCount&&TS([...e.parent.child(s).marks],t,n);)a+=e.parent.child(s).nodeSize,s+=1;return{from:i,to:a}}function OS(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var AS=(e,t)=>({tr:n,state:r,dispatch:o})=>{const i=OS(e,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:d}=a;if(o){const e=CS(l,i,t);if(e&&e.from<=c&&e.to>=d){const t=Lx.create(s,e.from,e.to);n.setSelection(t)}}return!0},RS=e=>t=>{const n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function NS(e){return e instanceof Lx}function LS(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function $S(e,t=null){if(!t)return null;const n=Ox.atStart(e),r=Ox.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;const o=n.from,i=r.to;return"all"===t?Lx.create(e,LS(0,o,i),LS(e.content.size,o,i)):Lx.create(e,LS(t,o,i),LS(t,o,i))}function DS(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function jS(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var BS=(e=null,t={})=>({editor:n,view:r,tr:o,dispatch:i})=>{t={scrollIntoView:!0,...t};const s=()=>{(jS()||DS())&&r.dom.focus(),"undefined"==typeof navigator||!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||jS()||DS()||r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&null===e||!1===e)return!0}catch{return!1}if(i&&null===e&&!NS(n.state.selection))return s(),!0;const a=$S(o.doc,e)||n.state.selection,l=n.state.selection.eq(a);return i&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},zS=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),_S=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),FS=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&FS(r)}return e};function WS(e){if("undefined"==typeof window)throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`<body>${e}</body>`,n=(new window.DOMParser).parseFromString(t,"text/html").body;return FS(n)}function HS(e,t,n){if(e instanceof ty||e instanceof Ag)return e;n={slice:!0,parseOptions:{},...n};const r="string"==typeof e;if("object"==typeof e&&null!==e)try{if(Array.isArray(e)&&e.length>0)return Ag.fromArray(e.map(e=>t.nodeFromJSON(e)));const r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",o),HS("",t,n)}if(r){if(n.errorOnInvalidContent){let r=!1,o="";const i=new vy({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:e=>(r=!0,o="string"==typeof e?e:e.outerHTML,null)}]}})});if(n.slice?Sy.fromSchema(i).parseSlice(WS(e),n.parseOptions):Sy.fromSchema(i).parse(WS(e),n.parseOptions),n.errorOnInvalidContent&&r)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${o}`)})}const r=Sy.fromSchema(t);return n.slice?r.parseSlice(WS(e),n.parseOptions).content:r.parse(WS(e),n.parseOptions)}return HS("",t,n)}var US=(e,t,n)=>({tr:r,dispatch:o,editor:i})=>{var s,a;if(o){let o;const c=e=>{i.emit("contentError",{editor:i,error:e,disableCollaboration:()=>{"collaboration"in i.storage&&"object"==typeof i.storage.collaboration&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},d={preserveWhitespace:"full",...(n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n}).parseOptions};if(!n.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{HS(t,i.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(l){c(l)}try{o=HS(t,i.schema,{parseOptions:d,errorOnInvalidContent:null!=(s=n.errorOnInvalidContent)?s:i.options.enableContentCheck})}catch(l){return c(l),!1}let u,{from:p,to:h}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},f=!0,m=!0;if((a=o,"type"in a?[o]:o).forEach(e=>{e.check(),f=!!f&&(e.isText&&0===e.marks.length),m=!!m&&e.isBlock}),p===h&&m){const{parent:e}=r.doc.resolve(p);!e.isTextblock||e.type.spec.code||e.childCount||(p-=1,h+=1)}if(f){if(Array.isArray(t))u=t.map(e=>e.text||"").join("");else if(t instanceof Ag){let e="";t.forEach(t=>{t.text&&(e+=t.text)}),u=e}else u="object"==typeof t&&t&&t.text?t.text:t;r.insertText(u,p,h)}else{u=o;const e=r.doc.resolve(p),t=e.node(),n=0===e.parentOffset,i=t.isText||t.isTextblock,s=t.content.size>0;n&&i&&s&&m&&(p=Math.max(0,p-1)),r.replaceWith(p,h,u)}n.updateSelection&&function(e,t,n){const r=e.steps.length-1;if(r<t)return;const o=e.steps[r];if(!(o instanceof Qy||o instanceof ex))return;const i=e.mapping.maps[r];let s=0;i.forEach((e,t,n,r)=>{0===s&&(s=r)}),e.setSelection(Ox.near(e.doc.resolve(s),n))}(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:p,text:u}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:p,text:u})}return!0},VS=()=>({state:e,dispatch:t})=>((e,t)=>{let n,r=e.selection,o=r instanceof Dx;if(o){if(r.node.isTextblock||!dx(e.doc,r.from))return!1;n=r.from}else if(n=px(e.doc,r.from,-1),null==n)return!1;if(t){let r=e.tr.join(n);o&&r.setSelection(Dx.create(r.doc,n-e.doc.resolve(n).nodeBefore.nodeSize)),t(r.scrollIntoView())}return!0})(e,t),KS=()=>({state:e,dispatch:t})=>((e,t)=>{let n,r=e.selection;if(r instanceof Dx){if(r.node.isTextblock||!dx(e.doc,r.to))return!1;n=r.to}else if(n=px(e.doc,r.to,1),null==n)return!1;return t&&t(e.tr.join(n).scrollIntoView()),!0})(e,t),qS=()=>({state:e,dispatch:t})=>tb(e,t),YS=()=>({state:e,dispatch:t})=>ab(e,t),XS=()=>({state:e,dispatch:t,tr:n})=>{try{const r=px(e.doc,e.selection.$from.pos,-1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},JS=()=>({state:e,dispatch:t,tr:n})=>{try{const r=px(e.doc,e.selection.$from.pos,1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},GS=()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=eb(e,n);if(!r)return!1;let o=ib(r);return!!o&&nb(e,o,t)})(e,t),ZS=()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=sb(e,n);if(!r)return!1;let o=cb(r);return!!o&&nb(e,o,t)})(e,t);function QS(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var eP=e=>({editor:t,view:n,tr:r,dispatch:o})=>{const i=function(e){const t=e.split(/-(?!$)/);let n,r,o,i,s=t[t.length-1];"Space"===s&&(s=" ");for(let a=0;a<t.length-1;a+=1){const e=t[a];if(/^(cmd|meta|m)$/i.test(e))i=!0;else if(/^a(lt)?$/i.test(e))n=!0;else if(/^(c|ctrl|control)$/i.test(e))r=!0;else if(/^s(hift)?$/i.test(e))o=!0;else{if(!/^mod$/i.test(e))throw new Error(`Unrecognized modifier name: ${e}`);jS()||QS()?i=!0:r=!0}}return n&&(s=`Alt-${s}`),r&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),o&&(s=`Shift-${s}`),s}(e).split(/-(?!$)/),s=i.find(e=>!["Alt","Ctrl","Meta","Shift"].includes(e)),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp("handleKeyDown",e=>e(n,a))})?.steps.forEach(e=>{const t=e.map(r.mapping);t&&o&&r.maybeStep(t)}),!0};function tP(e,t,n={}){const{from:r,to:o,empty:i}=e.selection,s=t?xS(t,e.schema):null,a=[];e.doc.nodesBetween(r,o,(e,t)=>{if(e.isText)return;const n=Math.max(r,t),i=Math.min(o,t+e.nodeSize);a.push({node:e,from:n,to:i})});const l=o-r,c=a.filter(e=>!s||s.name===e.node.type.name).filter(e=>IS(e.node.attrs,n,{strict:!1}));return i?!!c.length:c.reduce((e,t)=>e+t.to-t.from,0)>=l}var nP=(e,t={})=>({state:n,dispatch:r})=>!!tP(n,xS(e,n.schema),t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,o=n.blockRange(r),i=o&&ox(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)})(n,r),rP=()=>({state:e,dispatch:t})=>fb(e,t),oP=e=>({state:t,dispatch:n})=>Tb(xS(e,t.schema))(t,n),iP=()=>({state:e,dispatch:t})=>db(e,t);function sP(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function aP(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var lP=(e,t)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=sP("string"==typeof e?e:e.name,r.schema);if(!a)return!1;"node"===a&&(i=xS(e,r.schema)),"mark"===a&&(s=OS(e,r.schema));let l=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{i&&i===e.type&&(l=!0,o&&n.setNodeMarkup(r,void 0,aP(e.attrs,t))),s&&e.marks.length&&e.marks.forEach(i=>{s===i.type&&(l=!0,o&&n.addMark(r,r+e.nodeSize,s.create(aP(i.attrs,t))))})})}),l},cP=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),dP=()=>({tr:e,dispatch:t})=>{if(t){const t=new Bx(e.doc);e.setSelection(t)}return!0},uP=()=>({state:e,dispatch:t})=>ob(e,t),pP=()=>({state:e,dispatch:t})=>lb(e,t),hP=()=>({state:e,dispatch:t})=>((e,t)=>{let n,{$from:r,to:o}=e.selection,i=r.sharedDepth(o);return 0!=i&&(n=r.before(i),t&&t(e.tr.setSelection(Dx.create(e.doc,n))),!0)})(e,t),fP=()=>({state:e,dispatch:t})=>wb(e,t),mP=()=>({state:e,dispatch:t})=>bb(e,t);function gP(e,t,n={},r={}){return HS(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var yP=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:o,tr:i,dispatch:s,commands:a})=>{const{doc:l}=i;if("full"!==r.preserveWhitespace){const a=gP(e,o.schema,r,{errorOnInvalidContent:null!=t?t:o.options.enableContentCheck});return s&&i.replaceWith(0,l.content.size,a).setMeta("preventUpdate",!n),!0}return s&&i.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=t?t:o.options.enableContentCheck})};function xP(e,t){const n=OS(t,e.schema),{from:r,to:o,empty:i}=e.selection,s=[];i?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,o,e=>{s.push(...e.marks)});const a=s.find(e=>e.type.name===n.name);return a?{...a.attrs}:{}}function bP(e,t){const n=new Tx(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function wP(e){return t=>function(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}(t.$from,e)}function vP(e,t,n){return void 0===e.config[t]&&e.parent?vP(e.parent,t,n):"function"==typeof e.config[t]?e.config[t].bind({...n,parent:e.parent?vP(e.parent,t,n):null}):e.config[t]}function kP(e){return e.map(e=>{const t=vP(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...kP(t())]:e}).flat(10)}function SP(e,t){const n=Ny.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function PP(e){return"function"==typeof e}function MP(e,t=void 0,...n){return PP(e)?t?e.bind(t)(...n):e(...n):e}function IP(e){return{baseExtensions:e.filter(e=>"extension"===e.type),nodeExtensions:e.filter(e=>"node"===e.type),markExtensions:e.filter(e=>"mark"===e.type)}}function EP(e){const t=[],{nodeExtensions:n,markExtensions:r}=IP(e),o=[...n,...r],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},s=n.filter(e=>"text"!==e.name).map(e=>e.name),a=r.map(e=>e.name),l=[...s,...a];return e.forEach(e=>{const n=vP(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage,extensions:o});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:"*"===e.types?l:"nodes"===e.types?s:"marks"===e.types?a:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...i,...r}})})})})}),o.forEach(e=>{const n=vP(e,"addAttributes",{name:e.name,options:e.options,storage:e.storage});if(!n)return;const r=n();Object.entries(r).forEach(([n,r])=>{const o={...i,...r};"function"==typeof(null==o?void 0:o.default)&&(o.default=o.default()),(null==o?void 0:o.isRequired)&&void 0===(null==o?void 0:o.default)&&delete o.default,t.push({type:e.name,name:n,attribute:o})})}),t}function TP(e){const t=[],n=function(e){const t=[];let n="",r=!1,o=!1,i=0;const s=e.length;for(let a=0;a<s;a+=1){const s=e[a];if("'"!==s||o)if('"'!==s||r){if(!r&&!o){if("("===s){i+=1,n+=s;continue}if(")"===s&&i>0){i-=1,n+=s;continue}if(";"===s&&0===i){t.push(n),n="";continue}}n+=s}else o=!o,n+=s;else r=!r,n+=s}return n&&t.push(n),t}(e||""),r=n.length;for(let o=0;o<r;o+=1){const e=n[o],r=e.indexOf(":");if(-1===r)continue;const i=e.slice(0,r).trim(),s=e.slice(r+1).trim();i&&s&&t.push([i,s])}return t}function CP(...e){return e.filter(e=>!!e).reduce((e,t)=>{const n={...e};return Object.entries(t).forEach(([e,t])=>{if(n[e])if("class"===e){const r=t?String(t).split(" "):[],o=n[e]?n[e].split(" "):[],i=r.filter(e=>!o.includes(e));n[e]=[...o,...i].join(" ")}else if("style"===e){const r=new Map([...TP(n[e]),...TP(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join("; ")}else n[e]=t;else n[e]=t}),n},{})}function OP(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>CP(e,t),{})}function AP(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const o=t.reduce((e,t)=>{const r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!=typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null==r?e:{...e,[t.name]:r}},{});return{...r,...o}}}}function RP(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>("attrs"!==e||!function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t))}function NP(e){var t,n;const r={};return!(null==(t=null==e?void 0:e.attribute)?void 0:t.isRequired)&&"default"in((null==e?void 0:e.attribute)||{})&&(r.default=e.attribute.default),void 0!==(null==(n=null==e?void 0:e.attribute)?void 0:n.validate)&&(r.validate=e.attribute.validate),[e.name,r]}function LP(e){return e.sort((e,t)=>{const n=vP(e,"priority")||100,r=vP(t,"priority")||100;return n>r?-1:n<r?1:0})}function $P(e){const t=LP(kP(e)),n=function(e){const t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(", ")}]. This can lead to issues.`),t}function DP(e,t,n){const{from:r,to:o}=t,{blockSeparator:i="\n\n",textSerializers:s={}}=n||{};let a="";return e.nodesBetween(r,o,(e,n,l,c)=>{var d;e.isBlock&&n>r&&(a+=i);const u=null==s?void 0:s[e.type.name];if(u)return l&&(a+=u({node:e,pos:n,parent:l,index:c,range:t})),!1;e.isText&&(a+=null==(d=null==e?void 0:e.text)?void 0:d.slice(Math.max(r,n)-n,o-n))}),a}function jP(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function BP(e,t){const n=sP("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){const n=xS(t,e.schema),{from:r,to:o}=e.selection,i=[];e.doc.nodesBetween(r,o,e=>{i.push(e)});const s=i.reverse().find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}(e,t):"mark"===n?xP(e,t):{}}function zP(e){const t=function(e,t=JSON.stringify){const n={};return e.filter(e=>{const r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)})}(e);return 1===t.length?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function _P(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,o)=>{const i=[];if(e.ranges.length)e.forEach((e,t)=>{i.push({from:e,to:t})});else{const{from:e,to:t}=n[o];if(void 0===e||void 0===t)return;i.push({from:e,to:t})}i.forEach(({from:e,to:n})=>{const i=t.slice(o).map(e,-1),s=t.slice(o).map(n),a=t.invert().map(i,-1),l=t.invert().map(s);r.push({oldRange:{from:a,to:l},newRange:{from:i,to:s}})})}),zP(r)}function FP(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(t=>{const o=CS(n.resolve(e),t.type);o&&r.push({mark:t,...o})}):n.nodesBetween(e,t,(e,t)=>{e&&void 0!==(null==e?void 0:e.nodeSize)&&r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}function WP(e,t){return t.nodes[e]||t.marks[e]||null}function HP(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{const r=e.find(e=>e.type===t&&e.name===n);return!!r&&r.attribute.keepOnSplit}))}function UP(e,t,n={}){const{empty:r,ranges:o}=e.selection,i=t?OS(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!i||i.name===e.type.name).find(e=>IS(e.attrs,n,{strict:!1}));let s=0;const a=[];if(o.forEach(({$from:t,$to:n})=>{const r=t.pos,o=n.pos;e.doc.nodesBetween(r,o,(e,t)=>{if(i&&e.inlineContent&&!e.type.allowsMarkType(i))return!1;if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),l=Math.min(o,t+e.nodeSize);s+=l-n,a.push(...e.marks.map(e=>({mark:e,from:n,to:l})))})}),0===s)return!1;const l=a.filter(e=>!i||i.name===e.mark.type.name).filter(e=>IS(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),c=a.filter(e=>!i||e.mark.type!==i&&e.mark.type.excludes(i)).reduce((e,t)=>e+t.to-t.from,0);return(l>0?l+c:l)>=s}function VP(e,t){return Array.isArray(t)?t.some(t=>("string"==typeof t?t:t.name)===e.name):t}function KP(e,t){const{nodeExtensions:n}=IP(t),r=n.find(t=>t.name===e);if(!r)return!1;const o=MP(vP(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof o&&o.split(" ").includes("list")}function qP(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if("hardBreak"===e.type.name)return!0;if(e.isText)return!/\S/.test(null!=(r=e.text)?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let r=!0;return e.content.forEach(e=>{!1!==r&&(qP(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function YP(e){return e instanceof Dx}var XP=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function JP(e,t){const n=t.mapping.mapResult(e.position);return{position:new XP(n.pos),mapResult:n}}function GP(e){return new XP(e)}var ZP=(e,t={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:a}=i,l=OS(e,r.schema);if(o)if(s){const e=xP(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach(e=>{const o=e.$from.pos,i=e.$to.pos;r.doc.nodesBetween(o,i,(e,r)=>{const s=Math.max(r,o),a=Math.min(r+e.nodeSize,i);e.marks.find(e=>e.type===l)?e.marks.forEach(e=>{l===e.type&&n.addMark(s,a,l.create({...e.attrs,...t}))}):n.addMark(s,a,l.create(t))})});return function(e,t,n){var r;const{selection:o}=t;let i=null;if(NS(o)&&(i=o.$cursor),i){const t=null!=(r=e.storedMarks)?r:i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}const{ranges:s}=o;return s.some(({$from:t,$to:r})=>{let o=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(o)return!1;if(e.isInline){const t=!r||r.type.allowsMarkType(n),i=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));o=t&&i}return!o}),o})}(r,n,l)},QP=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),eM=(e,t={})=>({state:n,dispatch:r,chain:o})=>{const i=xS(e,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),i.isTextblock?o().command(({commands:e})=>!!vb(i,{...s,...t})(n)||e.clearNodes()).command(({state:e})=>vb(i,{...s,...t})(e,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},tM=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,r=LS(e,0,n.content.size),o=Dx.create(n,r);t.setSelection(o)}return!0},nM=(e,t)=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=r;let s,a;return"number"==typeof t?(s=t,a=t):t&&"from"in t&&"to"in t?(s=t.from,a=t.to):(s=i.from,a=i.to),o&&n.doc.nodesBetween(s,a,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},rM=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:o}="number"==typeof e?{from:e,to:e}:e,i=Lx.atStart(n).from,s=Lx.atEnd(n).to,a=LS(r,i,s),l=LS(o,i,s),c=Lx.create(n,a,l);t.setSelection(c)}return!0},oM=e=>({state:t,dispatch:n})=>{return(r=xS(e,t.schema),function(e,t){let{$from:n,$to:o}=e.selection,i=n.blockRange(o,e=>e.childCount>0&&e.firstChild.type==r);if(!i)return!1;let s=i.startIndex;if(0==s)return!1;let a=i.parent,l=a.child(s-1);if(l.type!=r)return!1;if(t){let n=l.lastChild&&l.lastChild.type==a.type,o=Ag.from(n?r.create():null),s=new jg(Ag.from(r.create(null,Ag.from(a.type.create(null,o)))),n?3:1,0),c=i.start,d=i.end;t(e.tr.step(new ex(c-(n?3:1),d,c,d,s,1,!0)).scrollIntoView())}return!0})(t,n);var r};function iM(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(e=>null==t?void 0:t.includes(e.type.name));e.tr.ensureMarks(r)}}var sM=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=t,{$from:a,$to:l}=i,c=HP(o.extensionManager.attributes,a.node().type.name,a.node().attrs);if(i instanceof Dx&&i.node.isBlock)return!(!a.parentOffset||!cx(s,a.pos))&&(r&&(e&&iM(n,o.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,u=0===a.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let p=d&&u?[{type:u,attrs:c}]:void 0,h=cx(t.doc,t.mapping.map(a.pos),1,p);if(p||h||!cx(t.doc,t.mapping.map(a.pos),1,u?[{type:u}]:void 0)||(h=!0,p=u?[{type:u,attrs:c}]:void 0),r){if(h&&(i instanceof Lx&&t.deleteSelection(),t.split(t.mapping.map(a.pos),1,p),u&&!d&&!a.parentOffset&&a.parent.type!==u)){const e=t.mapping.map(a.before()),n=t.doc.resolve(e);a.node(-1).canReplaceWith(n.index(),n.index()+1,u)&&t.setNodeMarkup(t.mapping.map(a.before()),u)}e&&iM(n,o.extensionManager.splittableMarks),t.scrollIntoView()}return h},aM=(e,t={})=>({tr:n,state:r,dispatch:o,editor:i})=>{var s;const a=xS(e,r.schema),{$from:l,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;const u=l.node(-1);if(u.type!==a)return!1;const p=i.extensionManager.attributes;if(0===l.parent.content.size&&l.node(-1).childCount===l.indexAfter(-1)){if(2===l.depth||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(o){let e=Ag.empty;const r=l.index(-1)?1:l.index(-2)?2:3;for(let t=l.depth-r;t>=l.depth-3;t-=1)e=Ag.from(l.node(t).copy(e));const o=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,i={...HP(p,l.node().type.name,l.node().attrs),...t},c=(null==(s=a.contentMatch.defaultType)?void 0:s.createAndFill(i))||void 0;e=e.append(Ag.from(a.createAndFill(null,c)||void 0));const d=l.before(l.depth-(r-1));n.replace(d,l.after(-o),new jg(e,4-r,0));let u=-1;n.doc.nodesBetween(d,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&0===e.content.size&&(u=t+1)}),u>-1&&n.setSelection(Lx.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}const h=c.pos===l.end()?u.contentMatchAt(0).defaultType:null,f={...HP(p,u.type.name,u.attrs),...t},m={...HP(p,l.node().type.name,l.node().attrs),...t};n.delete(l.pos,c.pos);const g=h?[{type:a,attrs:f},{type:h,attrs:m}]:[{type:a,attrs:f}];if(!cx(n.doc,l.pos,2))return!1;if(o){const{selection:e,storedMarks:t}=r,{splittableMarks:s}=i.extensionManager,a=t||e.$to.parentOffset&&e.$from.marks();if(n.split(l.pos,2,g).scrollIntoView(),!a||!o)return!0;const c=a.filter(e=>s.includes(e.type.name));n.ensureMarks(c)}return!0};function lM(e){return e&&"1"!==e?e:null}function cM(e,t){return lM(e)===lM(t)}var dM=(e,t)=>{const n=wP(e=>e.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const o=e.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!dx(e.doc,n.pos)||(!cM(n.node.attrs.type,null==o?void 0:o.attrs.type)||(e.join(n.pos),!0))},uM=(e,t)=>{const n=wP(e=>e.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const o=e.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!dx(e.doc,r)||(!cM(n.node.attrs.type,null==o?void 0:o.attrs.type)||(e.join(r),!0))};var pM=(e,t,n,r={})=>({editor:o,tr:i,state:s,dispatch:a,chain:l,commands:c,can:d})=>{const{extensions:u,splittableMarks:p}=o.extensionManager,h=xS(e,s.schema),f=xS(t,s.schema),{selection:m,storedMarks:g}=s,{$from:y,$to:x}=m,b=y.blockRange(x),w=g||m.$to.parentOffset&&m.$from.marks();if(!b)return!1;const v=wP(e=>KP(e.type.name,u))(m),k=0===m.from&&m.to===s.doc.content.size,S=s.doc.content.content,P=1===S.length?S[0]:null,M=k&&P&&KP(P.type.name,u)?{node:P,pos:0,depth:0}:null,I=null!=v?v:M,E=!!M;if((!!v&&b.depth>=1&&b.depth-v.depth<=1||E)&&I){if(I.node.type===h)return k&&E?l().command(({tr:e,dispatch:t})=>{const n=function(e){const t=e.doc,n=t.firstChild;if(!n)return null;const r=t.resolve(1),o=t.resolve(n.nodeSize-1);return Lx.between(r,o)}(e);return!!n&&(e.setSelection(n),t&&t(e),!0)}).liftListItem(f).run():c.liftListItem(f);if(KP(I.node.type.name,u)&&h.validContent(I.node.content))return l().command(()=>(i.setNodeMarkup(I.pos,h),!0)).command(()=>dM(i,h)).command(()=>uM(i,h)).run()}return n&&w&&a?l().command(()=>{const e=d().wrapInList(h,r),t=w.filter(e=>p.includes(e.type.name));return i.ensureMarks(t),!!e||c.clearNodes()}).wrapInList(h,r).command(()=>dM(i,h)).command(()=>uM(i,h)).run():l().command(()=>!!d().wrapInList(h,r)||c.clearNodes()).wrapInList(h,r).command(()=>dM(i,h)).command(()=>uM(i,h)).run()},hM=(e,t={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=OS(e,r.schema);return UP(r,s,t)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,t)},fM=(e,t,n={})=>({state:r,commands:o})=>{const i=xS(e,r.schema),s=xS(t,r.schema),a=tP(r,i,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?o.setNode(s,l):o.setNode(i,{...l,...n})},mM=(e,t={})=>({state:n,commands:r})=>{const o=xS(e,n.schema);return tP(n,o,t)?r.lift(o):r.wrapIn(o,t)},gM=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(e))){if(t){const t=e.tr,n=i.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(i.text){const n=t.doc.resolve(i.from).marks();t.replaceWith(i.from,i.to,e.schema.text(i.text,n))}else t.delete(i.from,i.to)}return!0}}return!1},yM=(e={})=>({tr:t,dispatch:n,editor:r})=>{const{ignoreClearable:o=!1}=e,{selection:i}=t,{empty:s,ranges:a}=i;if(s)return!0;const{nonClearableMarks:l}=r.extensionManager;if(n){const e=Object.values(r.schema.marks).filter(e=>o||!l.includes(e.name));a.forEach(n=>{for(const r of e)t.removeMark(n.$from.pos,n.$to.pos,r)})}return!0},xM=(e,t={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,l=OS(e,r.schema),{$from:c,empty:d,ranges:u}=a;if(!o)return!0;if(d&&s){let{from:e,to:t}=a;const r=CS(c,l,null==(i=c.marks().find(e=>e.type===l))?void 0:i.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,l)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,l)});return n.removeStoredMark(l),!0},bM=e=>({tr:t,state:n,dispatch:r})=>{const{selection:o}=n;let i,s;return"number"==typeof e?(i=e,s=e):e&&"from"in e&&"to"in e?(i=e.from,s=e.to):(i=o.from,s=o.to),r&&t.doc.nodesBetween(i,s,(e,n)=>{if(e.isText)return;const r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},wM=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=sP("string"==typeof e?e:e.name,r.schema);if(!a)return!1;"node"===a&&(i=xS(e,r.schema)),"mark"===a&&(s=OS(e,r.schema));let l=!1;return n.selection.ranges.forEach(e=>{const a=e.$from.pos,c=e.$to.pos;let d,u,p,h;n.selection.empty?r.doc.nodesBetween(a,c,(e,t)=>{i&&i===e.type&&(l=!0,p=Math.max(t,a),h=Math.min(t+e.nodeSize,c),d=t,u=e)}):r.doc.nodesBetween(a,c,(e,r)=>{r<a&&i&&i===e.type&&(l=!0,p=Math.max(r,a),h=Math.min(r+e.nodeSize,c),d=r,u=e),r>=a&&r<=c&&(i&&i===e.type&&(l=!0,o&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),s&&e.marks.length&&e.marks.forEach(i=>{if(s===i.type&&(l=!0,o)){const o=Math.max(r,a),l=Math.min(r+e.nodeSize,c);n.addMark(o,l,s.create({...i.attrs,...t}))}}))}),u&&(void 0!==d&&o&&n.setNodeMarkup(d,void 0,{...u.attrs,...t}),s&&u.marks.length&&u.marks.forEach(e=>{s===e.type&&o&&n.addMark(p,h,s.create({...e.attrs,...t}))}))}),l},vM=(e,t={})=>({state:n,dispatch:r})=>function(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=s&&ix(s,e,t);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}(xS(e,n.schema),t)(n,r),kM=(e,t={})=>({state:n,dispatch:r})=>Eb(xS(e,n.schema),t)(n,r),SM=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){const n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}};function PM(e,t,n){const r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(null!==r)return r;const o=document.createElement("style");return t&&o.setAttribute("nonce",t),o.setAttribute("data-tiptap-style"+(n?`-${n}`:""),""),o.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(o),o}function MM(e,t){const n=e.getAttribute("style");if(!n)return null;const r=n.split(";").map(e=>e.trim()).filter(Boolean),o=t.toLowerCase();for(let i=r.length-1;i>=0;i-=1){const e=r[i],t=e.indexOf(":");if(-1!==t&&e.slice(0,t).trim().toLowerCase()===o)return e.slice(t+1).trim()}return null}function IM(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function EM(e){if(!(null==e?void 0:e.trim()))return{};const t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),o=r.match(/(?:^|\s)\.([\w-]+)/g);o&&(t.class=o.map(e=>e.trim().slice(1)).join(" "));const i=r.match(/(?:^|\s)#([\w-]+)/);i&&(t.id=i[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{var o;const i=n[parseInt((null==(o=r.match(/__QUOTED_(\d+)__/))?void 0:o[1])||"0",10)];i&&(t[e]=i.slice(1,-1))});const s=r.replace(/(?:^|\s)\.([\w-]+)/g,"").replace(/(?:^|\s)#([\w-]+)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return s&&s.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function TM(e){if(!e||0===Object.keys(e).length)return"";const t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{"class"!==e&&"id"!==e&&(!0===n?t.push(e):!1!==n&&null!=n&&t.push(`${e}="${String(n)}"`))}),t.join(" ")}function CM(e){const{nodeName:t,name:n,parseAttributes:r=EM,serializeAttributes:o=TM,defaultAttributes:i={},requiredAttributes:s=[],allowedAttributes:a}=e,l=n||t;return{parseMarkdown:(e,n)=>{const r={...i,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${l}(?:\\s|$)`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,o){const i=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),a=e.match(i);if(!a)return;const c=r(a[1]||"");return s.find(e=>!(e in c))?void 0:{type:t,raw:a[0],attributes:c}}},renderMarkdown:e=>{const t=o((e=>{if(!a)return e;const t={};return a.forEach(n=>{n in e&&(t[n]=e[n])}),t})(e.attrs||{}));return`:::${l}${t?` {${t}}`:""} :::`}}}function OM(e){const{nodeName:t,name:n,getContent:r,parseAttributes:o=EM,serializeAttributes:i=TM,defaultAttributes:s={},content:a="block",allowedAttributes:l}=e,c=n||t;return{parseMarkdown:(e,n)=>{let o;if(r){const t=r(e);o="string"==typeof t?[{type:"text",text:t}]:t}else o="block"===a?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);const i={...s,...e.attributes};return n.createNode(t,i,o)},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${c}`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,r){var i;const s=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),l=e.match(s);if(!l)return;const[d,u=""]=l,p=o(u);let h=1;const f=d.length;let m="";const g=/^:::([\w-]*)(\s.*)?/gm,y=e.slice(f);for(g.lastIndex=0;;){const n=g.exec(y);if(null===n)break;const o=n.index,s=n[1];if(!(null==(i=n[2])?void 0:i.endsWith(":::")))if(s)h+=1;else if(h-=1,0===h){const i=y.slice(0,o);m=i.trim();const s=e.slice(0,f+o+n[0].length);let l=[];if(m)if("block"===a)for(l=r.blockTokens(i),l.forEach(e=>{!e.text||e.tokens&&0!==e.tokens.length||(e.tokens=r.inlineTokens(e.text))});l.length>0;){const e=l[l.length-1];if("paragraph"!==e.type||e.text&&""!==e.text.trim())break;l.pop()}else l=r.inlineTokens(m);return{type:t,raw:s,attributes:p,content:m,tokens:l}}}}},renderMarkdown:(e,t)=>{const n=i((e=>{if(!l)return e;const t={};return l.forEach(n=>{n in e&&(t[n]=e[n])}),t})(e.attrs||{}));return`:::${c}${n?` {${n}}`:""}\n\n${t.renderChildren(e.content||[],"\n\n")}\n\n:::`}}}function AM(e){if(!e.trim())return{};const t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(e);for(;null!==r;){const[,o,i,s]=r;t[o]=i||s,r=n.exec(e)}return t}function RM(e){return Object.entries(e).filter(([,e])=>null!=e).map(([e,t])=>`${e}="${t}"`).join(" ")}function NM(e){const{nodeName:t,name:n,getContent:r,parseAttributes:o=AM,serializeAttributes:i=RM,defaultAttributes:s={},selfClosing:a=!1,allowedAttributes:l}=e,c=n||t,d=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(e,n)=>{const o={...s,...e.attributes};if(a)return n.createNode(t,o);const i=r?r(e):e.content||"";return i?n.createNode(t,o,[n.createTextNode(i)]):n.createNode(t,o,[])},markdownTokenizer:{name:t,level:"inline",start(e){const t=a?new RegExp(`\\[${d}\\s*[^\\]]*\\]`):new RegExp(`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t),r=null==n?void 0:n.index;return void 0!==r?r:-1},tokenize(e,n,r){const i=a?new RegExp(`^\\[${d}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),s=e.match(i);if(!s)return;let l="",c="";if(a){const[,e]=s;c=e}else{const[,e,t]=s;c=e,l=t||""}const u=o(c.trim());return{type:t,raw:s[0],content:l.trim(),attributes:u}}},renderMarkdown:e=>{let t="";r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>"text"===e.type).map(e=>e.text).join(""));const n=i((e=>{if(!l)return e;const t={};return l.forEach(n=>{const r="string"==typeof n?n:n.name,o="string"==typeof n?void 0:n.skipIfDefault;if(r in e){const n=e[r];if(void 0!==o&&n===o)return;t[r]=n}}),t})(e.attrs||{})),o=n?` ${n}`:"";return a?`[${c}${o}]`:`[${c}${o}]${t}[/${c}]`}}}function LM(e,t,n){var r,o,i,s;const a=e.split("\n"),l=[];let c="",d=0;const u=t.baseIndentSize||2;for(;d<a.length;){const e=a[d],p=e.match(t.itemPattern);if(!p){if(l.length>0)break;if(""===e.trim()){d+=1,c=`${c}${e}\n`;continue}return}const h=t.extractItemData(p),{indentLevel:f,mainContent:m}=h;c=`${c}${e}\n`;const g=[m];for(d+=1;d<a.length;){const e=a[d];if(""===e.trim()){const t=a.slice(d+1).findIndex(e=>""!==e.trim());if(-1===t)break;if(((null==(o=null==(r=a[d+1+t].match(/^(\s*)/))?void 0:r[1])?void 0:o.length)||0)>f){g.push(e),c=`${c}${e}\n`,d+=1;continue}break}if(!(((null==(s=null==(i=e.match(/^(\s*)/))?void 0:i[1])?void 0:s.length)||0)>f))break;g.push(e),c=`${c}${e}\n`,d+=1}let y;const x=g.slice(1);if(x.length>0){const e=x.map(e=>e.slice(f+u)).join("\n");e.trim()&&(y=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}const b=t.createToken(h,y);l.push(b)}if(0!==l.length)return{items:l,raw:c}}function $M(e,t,n,r){if(!e||!Array.isArray(e.content))return"";const o="function"==typeof n?n(r):n,[i,...s]=e.content;let a=`${o}${t.renderChildren([i])}`;return s&&s.length>0&&s.forEach((e,n)=>{var r,o;const i=null!=(o=null==(r=t.renderChild)?void 0:r.call(t,e,n+1))?o:t.renderChildren([e]);if(null!=i){const n=i.split("\n").map(e=>e?t.indent(e):t.indent("")).join("\n");a+="paragraph"===e.type?`\n\n${n}`:`\n${n}`}}),a}function DM(e,t){const n={...e};return IM(e)&&IM(t)&&Object.keys(t).forEach(r=>{IM(t[r])&&IM(e[r])?n[r]=DM(e[r],t[r]):n[r]=t[r]}),n}aS({},{createAtomBlockMarkdownSpec:()=>CM,createBlockMarkdownSpec:()=>OM,createInlineMarkdownSpec:()=>NM,parseAttributes:()=>EM,parseIndentedBlocks:()=>LM,renderNestedMarkdownContent:()=>$M,serializeAttributes:()=>TM});var jM=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=null==(t=e.undoable)||t}};function BM(e){var t;const{editor:n,from:r,to:o,text:i,rules:s,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null==(t=c.nodeBefore||c.nodeAfter)?void 0:t.marks.find(e=>e.type.spec.code)))return!1;let d=!1;const u=((e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,o,i)=>{var s,a;const l=(null==(a=(s=e.type.spec).toText)?void 0:a.call(s,{node:e,pos:t,parent:o,index:i}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?l:l.slice(0,Math.max(0,r-t))}),n})(c)+i;return s.forEach(e=>{if(d)return;const t=((e,t)=>{if(MS(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r})(u,e.find);if(!t)return;const s=l.state.tr,c=lS({state:l.state,transaction:s}),p={from:r-(t[0].length-i.length),to:o},{commands:h,chain:f,can:m}=new cS({editor:n,state:c});null!==e.handler({state:c,range:p,match:t,commands:h,chain:f,can:m})&&s.steps.length&&(e.undoable&&s.setMeta(a,{transform:s,from:r,to:o,text:i}),l.dispatch(s),d=!0)}),d}var zM=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...MP(vP(this,"addOptions",{name:this.name}))}}get storage(){return{...MP(vP(this,"addStorage",{name:this.name,options:this.options}))}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>DM(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){const t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},_M=class e extends zM{constructor(){super(...arguments),this.type="mark"}static create(t={}){return new e("function"==typeof t?t():t)}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const o=r.marks();if(!o.find(e=>(null==e?void 0:e.type.name)===t.name))return!1;const i=o.find(e=>(null==e?void 0:e.type.name)===t.name);return i&&n.removeStoredMark(i),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}},FM=class{constructor(e){this.find=e.find,this.handler=e.handler}};function WM(e){const{editor:t,state:n,from:r,to:o,rule:i,pasteEvent:s,dropEvent:a}=e,{commands:l,chain:c,can:d}=new cS({editor:t,state:n}),u=[];return n.doc.nodesBetween(r,o,(e,t)=>{var p,h,f,m,g;if((null==(h=null==(p=e.type)?void 0:p.spec)?void 0:h.code)||!(e.isText||e.isTextblock||e.isInline))return;const y=null!=(g=null!=(m=null==(f=e.content)?void 0:f.size)?m:e.nodeSize)?g:0,x=Math.max(r,t),b=Math.min(o,t+y);x>=b||((e,t,n)=>{if(MS(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(t=>{const n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n}):[]})(e.isText?e.text||"":e.textBetween(x-t,b-t,void 0,""),i.find,s).forEach(e=>{if(void 0===e.index)return;const t=x+e.index+1,r=t+e[0].length,o={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},p=i.handler({state:n,range:o,match:e,commands:l,chain:c,can:d,pasteEvent:s,dropEvent:a});u.push(p)})}),u.every(e=>null!==e)}var HM=null;function UM(e){const{editor:t,rules:n}=e;let r,o=null,i=!1,s=!1,a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}const l=({state:e,from:n,to:o,rule:i,pasteEvt:s})=>{const l=e.tr;if(WM({editor:t,state:lS({state:e,transaction:l}),from:Math.max(n-1,0),to:o.b-1,rule:i,pasteEvent:s,dropEvent:r})&&l.steps.length){try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}return a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,l}};return n.map(e=>new Xx({view(e){const n=n=>{var r;o=(null==(r=e.dom.parentElement)?void 0:r.contains(n.target))?e.dom.parentElement:null,o&&(HM=t)},r=()=>{HM&&(HM=null)};return window.addEventListener("dragstart",n),window.addEventListener("dragend",r),{destroy(){window.removeEventListener("dragstart",n),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(s=o===e.dom.parentElement,r=t,!s){const e=HM;(null==e?void 0:e.isEditable)&&setTimeout(()=>{const t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{var n;const r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return a=t,i=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{const o=t[0],c="paste"===o.getMeta("uiEvent")&&!i,d="drop"===o.getMeta("uiEvent")&&!s,u=o.getMeta("applyPasteRules"),p=!!u;if(!c&&!d&&!p)return;if(p){let{text:t}=u;"string"==typeof t||(t=SP(Ag.from(t),r.schema));const{from:n}=u,o=n+t.length,i=(e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(t=n.clipboardData)||t.setData("text/html",e),n})(t);return l({rule:e,state:r,from:n,to:{b:o},pasteEvt:i})}const h=n.doc.content.findDiffStart(r.doc.content),f=n.doc.content.findDiffEnd(r.doc.content);return"number"==typeof h&&f&&h!==f.b?l({rule:e,state:r,from:h,to:f,pasteEvt:a}):void 0}}))}var VM=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=$P(e),this.schema=function(e,t){var n;const r=EP(e),{nodeExtensions:o,markExtensions:i}=IP(e);return new vy({topNode:null==(n=o.find(e=>vP(e,"topNode")))?void 0:n.name,nodes:Object.fromEntries(o.map(n=>{const o=r.filter(e=>e.type===n.name),i={name:n.name,options:n.options,storage:n.storage,editor:t},s=RP({...e.reduce((e,t)=>{const r=vP(t,"extendNodeSchema",i);return{...e,...r?r(n):{}}},{}),content:MP(vP(n,"content",i)),marks:MP(vP(n,"marks",i)),group:MP(vP(n,"group",i)),inline:MP(vP(n,"inline",i)),atom:MP(vP(n,"atom",i)),selectable:MP(vP(n,"selectable",i)),draggable:MP(vP(n,"draggable",i)),code:MP(vP(n,"code",i)),whitespace:MP(vP(n,"whitespace",i)),linebreakReplacement:MP(vP(n,"linebreakReplacement",i)),defining:MP(vP(n,"defining",i)),isolating:MP(vP(n,"isolating",i)),attrs:Object.fromEntries(o.map(NP))}),a=MP(vP(n,"parseHTML",i));a&&(s.parseDOM=a.map(e=>AP(e,o)));const l=vP(n,"renderHTML",i);l&&(s.toDOM=e=>l({node:e,HTMLAttributes:OP(e,o)}));const c=vP(n,"renderText",i);return c&&(s.toText=c),[n.name,s]})),marks:Object.fromEntries(i.map(n=>{const o=r.filter(e=>e.type===n.name),i={name:n.name,options:n.options,storage:n.storage,editor:t},s=RP({...e.reduce((e,t)=>{const r=vP(t,"extendMarkSchema",i);return{...e,...r?r(n):{}}},{}),inclusive:MP(vP(n,"inclusive",i)),excludes:MP(vP(n,"excludes",i)),group:MP(vP(n,"group",i)),spanning:MP(vP(n,"spanning",i)),code:MP(vP(n,"code",i)),attrs:Object.fromEntries(o.map(NP))}),a=MP(vP(n,"parseHTML",i));a&&(s.parseDOM=a.map(e=>AP(e,o)));const l=vP(n,"renderHTML",i);return l&&(s.toDOM=e=>l({mark:e,HTMLAttributes:OP(e,o)})),[n.name,s]}))})}(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{const n=vP(t,"addCommands",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:WP(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){const{editor:e}=this;return LP([...this.extensions].reverse()).flatMap(t=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:WP(t.name,this.schema)},r=[],o=vP(t,"addKeyboardShortcuts",n);let i={};if("mark"===t.type&&vP(t,"exitable",n)&&(i.ArrowRight=()=>_M.handleExit({editor:e,mark:t})),o){const t=Object.fromEntries(Object.entries(o()).map(([t,n])=>[t,()=>n({editor:e})]));i={...i,...t}}const s=new Xx({props:{handleKeyDown:rS(i)}});r.push(s);const a=vP(t,"addInputRules",n);if(VP(t,e.options.enableInputRules)&&a){const t=a();if(t&&t.length){const n=function(e){const{editor:t,rules:n}=e,r=new Xx({state:{init:()=>null,apply(e,o,i){const s=e.getMeta(r);if(s)return s;const a=e.getMeta("applyInputRules");return a&&setTimeout(()=>{let{text:e}=a;"string"==typeof e||(e=SP(Ag.from(e),i.schema));const{from:o}=a;BM({editor:t,from:o,to:o+e.length,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:o}},props:{handleTextInput:(e,o,i,s)=>BM({editor:t,from:o,to:i,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout(()=>{const{$cursor:o}=e.state.selection;o&&BM({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(e,o){if("Enter"!==o.key)return!1;const{$cursor:i}=e.state.selection;return!!i&&BM({editor:t,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:t}),o=Array.isArray(n)?n:[n];r.push(...o)}}const l=vP(t,"addPasteRules",n);if(VP(t,e.options.enablePasteRules)&&l){const t=l();if(t&&t.length){const n=UM({editor:e,rules:t});r.push(...n)}}const c=vP(t,"addProseMirrorPlugins",n);if(c){const e=c();r.push(...e)}return r})}get attributes(){return EP(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=IP(this.extensions);return Object.fromEntries(t.filter(e=>!!vP(e,"addNodeView")).map(t=>{const n=this.attributes.filter(e=>e.type===t.name),r=vP(t,"addNodeView",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:xS(t.name,this.schema)});if(!r)return[];const o=r();if(!o)return[];return[t.name,(r,i,s,a,l)=>o({node:r,view:i,getPos:s,decorations:a,innerDecorations:l,editor:e,extension:t,HTMLAttributes:OP(r,n)})]}))}dispatchTransaction(e){const{editor:t}=this;return LP([...this.extensions].reverse()).reduceRight((e,n)=>{const r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:WP(n.name,this.schema)},o=vP(n,"dispatchTransaction",r);return o?t=>{o.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){const{editor:t}=this;return LP([...this.extensions]).reduce((e,n)=>{const r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:WP(n.name,this.schema)},o=vP(n,"transformPastedHTML",r);return o?(t,n)=>{const i=e(t,n);return o.call(r,i)}:e},e||(e=>e))}get markViews(){const{editor:e}=this,{markExtensions:t}=IP(this.extensions);return Object.fromEntries(t.filter(e=>!!vP(e,"addMarkView")).map(t=>{const n=this.attributes.filter(e=>e.type===t.name),r=vP(t,"addMarkView",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:OS(t.name,this.schema)});if(!r)return[];return[t.name,(o,i,s)=>{const a=OP(o,n);return r()({mark:o,view:i,inline:s,editor:e,extension:t,HTMLAttributes:a,updateAttributes:t=>{!function(e,t,n={}){const{state:r}=t,{doc:o,tr:i}=r,s=e;o.descendants((t,r)=>{const o=i.mapping.map(r),a=i.mapping.map(r)+t.nodeSize;let l=null;if(t.marks.forEach(e=>{if(e!==s)return!1;l=e}),!l)return;let c=!1;if(Object.keys(n).forEach(e=>{n[e]!==l.attrs[e]&&(c=!0)}),c){const t=e.type.create({...e.attrs,...n});i.removeMark(o,a,e.type),i.addMark(o,a,t)}}),i.docChanged&&t.view.dispatch(i)}(o,e,t)}})}]}))}destroy(){this.extensions.forEach(e=>{let t=e;for(;t.parent;){const e=t.parent;e.child===t&&(e.child=null),t=e}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{var t,n;const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:WP(e.name,this.schema)};"mark"===e.type&&((null==(t=MP(vP(e,"keepOnSplit",r)))||t)&&this.splittableMarks.push(e.name),null==(n=MP(vP(e,"clearable",r)))||n||this.nonClearableMarks.push(e.name));const o=vP(e,"onBeforeCreate",r),i=vP(e,"onCreate",r),s=vP(e,"onUpdate",r),a=vP(e,"onSelectionUpdate",r),l=vP(e,"onTransaction",r),c=vP(e,"onFocus",r),d=vP(e,"onBlur",r),u=vP(e,"onDestroy",r);o&&this.editor.on("beforeCreate",o),i&&this.editor.on("create",i),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),c&&this.editor.on("focus",c),d&&this.editor.on("blur",d),u&&this.editor.on("destroy",u)})}};VM.resolve=$P,VM.sort=LP,VM.flatten=kP;aS({},{ClipboardTextSerializer:()=>qM,Commands:()=>YM,Delete:()=>XM,Drop:()=>JM,Editable:()=>GM,FocusEvents:()=>QM,Keymap:()=>eI,Paste:()=>tI,Tabindex:()=>nI,TextDirection:()=>rI,focusEventsPluginKey:()=>ZM});var KM=class e extends zM{constructor(){super(...arguments),this.type="extension"}static create(t={}){return new e("function"==typeof t?t():t)}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}},qM=KM.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new Xx({key:new Zx("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:o}=t,i=jP(n),{blockSeparator:s}=this.options,a={...void 0!==s?{blockSeparator:s}:{},textSerializers:i};return[...o.ranges].sort((e,t)=>e.$from.pos-t.$from.pos).map(({$from:e,$to:t})=>DP(r,{from:e.pos,to:t.pos},a)).join(null!=s?s:"\n\n")}}})]}}),YM=KM.create({name:"commands",addCommands:()=>({...dS})}),XM=KM.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,o;const i=()=>{var n,r,o,i;if(null!=(i=null==(o=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.filterTransaction)?void 0:o.call(r,e))?i:e.getMeta("y-sync$"))return;const s=bP(e.before,[e,...t]);_P(s).forEach(t=>{s.mapping.mapResult(t.oldRange.from).deletedAfter&&s.mapping.mapResult(t.oldRange.to).deletedBefore&&s.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{const o=r+n.nodeSize-2,i=t.oldRange.from<=r&&o<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:o,newFrom:s.mapping.map(r),newTo:s.mapping.map(o),deletedRange:t.oldRange,newRange:t.newRange,partial:!i,editor:this.editor,transaction:e,combinedTransform:s})})});const a=s.mapping;s.steps.forEach((t,n)=>{var r,o;if(t instanceof Jy){const i=a.slice(n).map(t.from,-1),l=a.slice(n).map(t.to),c=a.invert().map(i,-1),d=a.invert().map(l),u=i>0&&(null==(r=s.doc.nodeAt(i-1))?void 0:r.marks.some(e=>e.eq(t.mark))),p=null==(o=s.doc.nodeAt(l))?void 0:o.marks.some(e=>e.eq(t.mark));this.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:c,to:d},newRange:{from:i,to:l},partial:Boolean(p||u),editor:this.editor,transaction:e,combinedTransform:s})}})};null==(o=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.async)||o?setTimeout(i,0):i()}}),JM=KM.create({name:"drop",addProseMirrorPlugins(){return[new Xx({key:new Zx("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),GM=KM.create({name:"editable",addProseMirrorPlugins(){return[new Xx({key:new Zx("editable"),props:{editable:()=>this.editor.options.editable}})]}}),ZM=new Zx("focusEvents"),QM=KM.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Xx({key:ZM,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),eI=KM.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{const{selection:n,doc:r}=t,{empty:o,$anchor:i}=n,{pos:s,parent:a}=i,l=i.parent.isTextblock&&s>0?t.doc.resolve(s-1):i,c=l.parent.type.spec.isolating,d=i.pos-i.parentOffset,u=c&&1===l.parent.childCount?d===i.pos:Ox.atStart(r).from===s;return!(!o||!a.type.isTextblock||a.textContent.length||!u||u&&"paragraph"===i.parent.type.name)&&e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return jS()||QS()?o:r},addProseMirrorPlugins(){return[new Xx({key:new Zx("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta("composition")))return;const r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),o=e.some(e=>e.getMeta("preventClearDocument"));if(!r||o)return;const{empty:i,from:s,to:a}=t.selection,l=Ox.atStart(t.doc).from,c=Ox.atEnd(t.doc).to;if(i||s!==l||a!==c)return;if(!qP(n.doc))return;const d=n.tr,u=lS({state:n,transaction:d}),{commands:p}=new cS({editor:this.editor,state:u});return p.clearNodes(),d.steps.length?d:void 0}})]}}),tI=KM.create({name:"paste",addProseMirrorPlugins(){return[new Xx({key:new Zx("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),nI=KM.create({name:"tabindex",addOptions:()=>({value:void 0}),addProseMirrorPlugins(){return[new Xx({key:new Zx("tabindex"),props:{attributes:()=>{var e;return this.editor.isEditable||void 0!==this.options.value?{tabindex:null!=(e=this.options.value)?e:"0"}:{}}}})]}}),rI=KM.create({name:"textDirection",addOptions:()=>({direction:void 0}),addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:e}=IP(this.extensions);return[{types:e.filter(e=>"text"!==e.name).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const t=e.getAttribute("dir");return!t||"ltr"!==t&&"rtl"!==t&&"auto"!==t?this.options.direction:t},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new Xx({key:new Zx("textDirection"),props:{attributes:()=>{const e=this.options.direction;return e?{dir:e}:{}}}})]}}),oI=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return null!=(e=this.actualDepth)?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(0===this.content.size)return void console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(0===this.depth)return null;const t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){const t=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,s=n.isInline,a=this.pos+r+(i?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(a);if(!o&&!s&&l.depth<=this.depth)return;const c=new e(l,this.editor,o,o||s?n:null);o&&(c.actualDepth=this.depth+1),t.push(c)}),t}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){const e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];if(e[o]!==t[o])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||0===this.children.length)return r;const o=Object.keys(t);return this.children.forEach(i=>{n&&r.length>0||(i.node.type.name===e&&o.every(e=>t[e]===i.node.attrs[e])&&r.push(i),n&&r.length>0||(r=r.concat(i.querySelectorAll(e,t,n))))}),r}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},iI=class extends SM{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:"undefined"!=typeof document?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:JP,createMappablePosition:GP},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on("paste",({event:e,slice:t})=>this.options.onPaste(e,t)),this.on("delete",this.options.onDelete);const t=this.createDoc(),n=$S(t,this.options.autofocus);this.editorState=qx.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if("undefined"==typeof document)throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(!1!==this.options.autofocus&&null!==this.options.autofocus&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const e=this.editorView.dom;(null==e?void 0:e.editor)&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{"function"==typeof this.css.remove?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&"undefined"!=typeof document&&(this.css=PM('.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}',this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if("state"===t)return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){const n=PP(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let n=t;if([].concat(e).forEach(e=>{const t="string"==typeof e?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t,n,r;const o=[...this.options.enableCoreExtensions?[GM,qM.configure({blockSeparator:null==(t=null==(e=this.options.coreExtensionOptions)?void 0:e.clipboardTextSerializer)?void 0:t.blockSeparator}),YM,QM,eI,nI.configure({value:null==(r=null==(n=this.options.coreExtensionOptions)?void 0:n.tabindex)?void 0:r.value}),JM,tI,XM,rI.configure({direction:this.options.textDirection})].filter(e=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[e.name]):[],...this.options.extensions].filter(e=>["extension","node","mark"].includes(null==e?void 0:e.type));this.extensionManager=new VM(o,this)}createCommandManager(){this.commandManager=new cS({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=gP(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error&&["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message)))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&"object"==typeof this.storage.collaboration&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>"collaboration"!==e.name),this.createExtensionManager()}}),e=gP(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){const{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),o=n?this.extensionManager.dispatchTransaction(r):r,i=t.transformPastedHTML,s=this.extensionManager.transformPastedHTML(i);this.editorView=new Fk(e,{...t,attributes:{role:"textbox",...null==t?void 0:t.attributes},dispatchTransaction:o,transformPastedHTML:s,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS();this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction)return this.capturedTransaction?void e.steps.forEach(e=>{var t;return null==(t=this.capturedTransaction)?void 0:t.step(e)}):void(this.capturedTransaction=e);const{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),o=n.includes(e),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!o)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const s=n.findLast(e=>e.getMeta("focus")||e.getMeta("blur")),a=null==s?void 0:s.getMeta("focus"),l=null==s?void 0:s.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:s}),l&&this.emit("blur",{editor:this,event:l.event,transaction:s}),e.getMeta("preventUpdate")||!n.some(e=>e.docChanged)||i.doc.eq(t.doc)||this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return BP(this.state,e)}isActive(e,t){const n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return tP(e,null,n)||UP(e,null,n);const r=sP(t,e.schema);return"node"===r?tP(e,t,n):"mark"===r&&UP(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return SP(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return function(e,t){return DP(e,{from:0,to:e.content.size},t)}(this.state.doc,{blockSeparator:t,textSerializers:{...jP(this.schema),...n}})}get isEmpty(){return qP(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var e,t;return null==(t=null==(e=this.editorView)?void 0:e.isDestroyed)||t}$node(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText?t.nodeAfter:null;return new oI(t,this,!1,n)}get $doc(){return this.$pos(0)}};function sI(e){return new jM({find:e.find,handler:({state:t,range:n,match:r})=>{const o=MP(e.getAttributes,void 0,r);if(!1===o||null===o)return null;const{tr:i}=t,s=r[r.length-1],a=r[0];if(s){const r=a.search(/\S/),l=n.from+a.indexOf(s),c=l+s.length;if(FP(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>l).length)return null;c<n.to&&i.delete(c,n.to),l>n.from&&i.delete(n.from+r,l);const d=n.from+r+s.length;i.addMark(n.from+r,d,e.type.create(o||{})),i.removeStoredMark(e.type)}},undoable:e.undoable})}function aI(e){return new jM({find:e.find,handler:({state:t,range:n,match:r})=>{const o=t.doc.resolve(n.from),i=MP(e.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,i)},undoable:e.undoable})}function lI(e){return new jM({find:e.find,handler:({state:t,range:n,match:r,chain:o})=>{const i=MP(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),a=s.doc.resolve(n.from).blockRange(),l=a&&ix(a,e.type,i);if(!l)return null;if(s.wrap(a,l),e.keepMarks&&e.editor){const{selection:n,storedMarks:r}=t,{splittableMarks:o}=e.editor.extensionManager,i=r||n.$to.parentOffset&&n.$from.marks();if(i){const e=i.filter(e=>o.includes(e.type.name));s.ensureMarks(e)}}if(e.keepAttributes){const t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";o().updateAttributes(t,i).run()}const c=s.doc.resolve(n.from-1).nodeBefore;c&&c.type===e.type&&dx(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,c))&&s.join(n.from-1)},undoable:e.undoable})}var cI=class e extends zM{constructor(){super(...arguments),this.type="node"}static create(t={}){return new e("function"==typeof t?t():t)}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}};function dI(e){return new FM({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:o})=>{const i=MP(e.getAttributes,void 0,r,o);if(!1===i||null===i)return null;const{tr:s}=t,a=r[r.length-1],l=r[0];let c=n.to;if(a){const o=l.search(/\S/),d=n.from+l.indexOf(a),u=d+a.length;if(FP(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>d).length)return null;u<n.to&&s.delete(u,n.to),d>n.from&&s.delete(n.from+o,d),c=n.from+o+a.length,s.addMark(n.from+o,c,e.type.create(i||{})),void 0!==r.index&&void 0!==r.input&&r.index+r[0].length>=r.input.length||s.removeStoredMark(e.type)}}})}var{getOwnPropertyNames:uI,getOwnPropertySymbols:pI}=Object,{hasOwnProperty:hI}=Object.prototype;function fI(e,t){return function(n,r,o){return e(n,r,o)&&t(n,r,o)}}function mI(e){return function(t,n,r){if(!t||!n||"object"!=typeof t||"object"!=typeof n)return e(t,n,r);const{cache:o}=r,i=o.get(t),s=o.get(n);if(i&&s)return i===n&&s===t;o.set(t,n),o.set(n,t);const a=e(t,n,r);return o.delete(t),o.delete(n),a}}function gI(e){return uI(e).concat(pI(e))}var yI=Object.hasOwn||((e,t)=>hI.call(e,t));function xI(e,t){return e===t||!e&&!t&&e!=e&&t!=t}var{getOwnPropertyDescriptor:bI,keys:wI}=Object;function vI(e,t){return e.byteLength===t.byteLength&&LI(new Uint8Array(e),new Uint8Array(t))}function kI(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function SI(e,t){return e.byteLength===t.byteLength&&LI(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function PI(e,t){return xI(e.getTime(),t.getTime())}function MI(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function II(e,t){return e===t}function EI(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const o=new Array(r),i=e.entries();let s,a,l=0;for(;(s=i.next())&&!s.done;){const r=t.entries();let i=!1,c=0;for(;(a=r.next())&&!a.done;){if(o[c]){c++;continue}const r=s.value,d=a.value;if(n.equals(r[0],d[0],l,c,e,t,n)&&n.equals(r[1],d[1],r[0],d[0],e,t,n)){i=o[c]=!0;break}c++}if(!i)return!1;l++}return!0}var TI=xI;function CI(e,t,n){const r=wI(e);let o=r.length;if(wI(t).length!==o)return!1;for(;o-- >0;)if(!DI(e,t,n,r[o]))return!1;return!0}function OI(e,t,n){const r=gI(e);let o,i,s,a=r.length;if(gI(t).length!==a)return!1;for(;a-- >0;){if(o=r[a],!DI(e,t,n,o))return!1;if(i=bI(e,o),s=bI(t,o),(i||s)&&(!i||!s||i.configurable!==s.configurable||i.enumerable!==s.enumerable||i.writable!==s.writable))return!1}return!0}function AI(e,t){return xI(e.valueOf(),t.valueOf())}function RI(e,t){return e.source===t.source&&e.flags===t.flags}function NI(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const o=new Array(r),i=e.values();let s,a;for(;(s=i.next())&&!s.done;){const r=t.values();let i=!1,l=0;for(;(a=r.next())&&!a.done;){if(!o[l]&&n.equals(s.value,a.value,s.value,a.value,e,t,n)){i=o[l]=!0;break}l++}if(!i)return!1}return!0}function LI(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function $I(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function DI(e,t,n,r){return!("_owner"!==r&&"__o"!==r&&"__v"!==r||!e.$$typeof&&!t.$$typeof)||yI(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var jI={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},BI=Object.prototype.toString;function zI({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:o,areFunctionsEqual:i,areMapsEqual:s,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:c,areRegExpsEqual:d,areSetsEqual:u,areTypedArraysEqual:p,areUrlsEqual:h,unknownTagComparators:f}){return function(m,g,y){if(m===g)return!0;if(null==m||null==g)return!1;const x=typeof m;if(x!==typeof g)return!1;if("object"!==x)return"number"===x?a(m,g,y):"function"===x&&i(m,g,y);const b=m.constructor;if(b!==g.constructor)return!1;if(b===Object)return l(m,g,y);if(Array.isArray(m))return t(m,g,y);if(b===Date)return r(m,g,y);if(b===RegExp)return d(m,g,y);if(b===Map)return s(m,g,y);if(b===Set)return u(m,g,y);const w=BI.call(m);if("[object Date]"===w)return r(m,g,y);if("[object RegExp]"===w)return d(m,g,y);if("[object Map]"===w)return s(m,g,y);if("[object Set]"===w)return u(m,g,y);if("[object Object]"===w)return"function"!=typeof m.then&&"function"!=typeof g.then&&l(m,g,y);if("[object URL]"===w)return h(m,g,y);if("[object Error]"===w)return o(m,g,y);if("[object Arguments]"===w)return l(m,g,y);if(jI[w])return p(m,g,y);if("[object ArrayBuffer]"===w)return e(m,g,y);if("[object DataView]"===w)return n(m,g,y);if("[object Boolean]"===w||"[object Number]"===w||"[object String]"===w)return c(m,g,y);if(f){let e=f[w];if(!e){const t=null!=(v=m)?v[Symbol.toStringTag]:void 0;t&&(e=f[t])}if(e)return e(m,g,y)}var v;return!1}}var _I=FI();FI({strict:!0}),FI({circular:!0}),FI({circular:!0,strict:!0}),FI({createInternalComparator:()=>xI}),FI({strict:!0,createInternalComparator:()=>xI}),FI({circular:!0,createInternalComparator:()=>xI}),FI({circular:!0,createInternalComparator:()=>xI,strict:!0});function FI(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:o=!1}=e,i=zI(function({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:vI,areArraysEqual:n?OI:kI,areDataViewsEqual:SI,areDatesEqual:PI,areErrorsEqual:MI,areFunctionsEqual:II,areMapsEqual:n?fI(EI,OI):EI,areNumbersEqual:TI,areObjectsEqual:n?OI:CI,arePrimitiveWrappersEqual:AI,areRegExpsEqual:RI,areSetsEqual:n?fI(NI,OI):NI,areTypedArraysEqual:n?fI(LI,OI):LI,areUrlsEqual:$I,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const e=mI(r.areArraysEqual),t=mI(r.areMapsEqual),n=mI(r.areObjectsEqual),o=mI(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:o})}return r}(e));return function({circular:e,comparator:t,createState:n,equals:r,strict:o}){if(n)return function(i,s){const{cache:a=(e?new WeakMap:void 0),meta:l}=n();return t(i,s,{cache:a,equals:r,meta:l,strict:o})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:o})};const i={cache:void 0,equals:r,meta:void 0,strict:o};return function(e,n){return t(e,n,i)}}({circular:t,comparator:i,createState:r,equals:n?n(i):(s=i,function(e,t,n,r,o,i,a){return s(e,t,a)}),strict:o});var s}var WI=a(e=>{var t=Ut(),n=Mg();var r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,c,d){var u=i(null);if(null===u.current){var p={hasValue:!1,value:null};u.current=p}else p=u.current;u=a(function(){function e(e){if(!s){if(s=!0,o=e,e=c(e),void 0!==d&&p.hasValue){var t=p.value;if(d(t,e))return i=t}return i=e}if(t=i,r(o,e))return t;var n=c(e);return void 0!==d&&d(t,n)?(o=e,t):(o=e,i=n)}var o,i,s=!1,a=void 0===n?null:n;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]},[t,n,c,d]);var h=o(e,u[0],u[1]);return s(function(){p.hasValue=!0,p.value=h},[h]),l(h),h}}),HI=a(e=>{"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=Ut(),n=Mg(),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,c,d){var u=i(null);if(null===u.current){var p={hasValue:!1,value:null};u.current=p}else p=u.current;u=a(function(){function e(e){if(!s){if(s=!0,o=e,e=c(e),void 0!==d&&p.hasValue){var t=p.value;if(d(t,e))return i=t}return i=e}if(t=i,r(o,e))return t;var n=c(e);return void 0!==d&&d(t,n)?(o=e,t):(o=e,i=n)}var o,i,s=!1,a=void 0===n?null:n;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]},[t,n,c,d]);var h=o(e,u[0],u[1]);return s(function(){p.hasValue=!0,p.value=h},[h]),l(h),h},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()}),UI=a((e,t)=>{"production"===process.env.NODE_ENV?t.exports=WI():t.exports=HI()})(),VI=(...e)=>t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})},KI=({contentComponent:e})=>{const t=(0,iS.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);
107
+ return(0,Jt.jsx)(Jt.Fragment,{children:Object.values(t)})};var qI=class extends Vt.Component{constructor(e){super(e),this.editorContentRef=Vt.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;const t=this.props.editor;if(t&&!t.isDestroyed&&(null==(e=t.view.dom)?void 0:e.parentNode)){if(t.contentComponent)return;const e=this.editorContentRef.current;e.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:e}),t.contentComponent=function(){const e=new Set;let t={};return{subscribe:t=>(e.add(t),()=>{e.delete(t)}),getSnapshot:()=>t,getServerSnapshot:()=>t,setRenderer(n,r){t={...t,[n]:oS.createPortal(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach(e=>e())}}}(),t.createNodeViews(),t.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var e;const t=this.props.editor;if(t){t.isEditorContentInitialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null;try{if(!(null==(e=t.view.dom)?void 0:e.parentNode))return;const n=document.createElement("div");n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n})}catch{}}}render(){const{editor:e,innerRef:t,...n}=this.props;
108
+ return(0,Jt.jsxs)(Jt.Fragment,{children:[ (0,Jt.jsx)("div",{ref:VI(t,this.editorContentRef),...n}),(null==e?void 0:e.contentComponent)&& (0,Jt.jsx)(KI,{contentComponent:e.contentComponent})]})}},YI=(0,Vt.forwardRef)((e,t)=>{const n=Vt.useMemo(()=>Math.floor(4294967295*Math.random()).toString(),[e.editor]);return Vt.createElement(qI,{key:n,innerRef:t,...e})}),XI=Vt.memo(YI),JI="undefined"!=typeof window?Vt.useLayoutEffect:Vt.useEffect,GI=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}};var ZI="production"!==process.env.NODE_ENV,QI="undefined"==typeof window,eE=QI||Boolean("undefined"!=typeof window&&window.next),tE=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){const e=this.options.current.immediatelyRender;let t=null==e||e;return QI?(t&&ZI&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),t=!1):eE&&void 0===e&&(t=!1,ZI&&console.warn("Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.")),t?this.createEditor():null}createEditor(){return new iI({...this.options.current,onBeforeCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBeforeCreate)?void 0:n.call(t,...e)},onBlur:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBlur)?void 0:n.call(t,...e)},onCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onCreate)?void 0:n.call(t,...e)},onDestroy:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDestroy)?void 0:n.call(t,...e)},onFocus:(...e)=>{var t,n;return null==(n=(t=this.options.current).onFocus)?void 0:n.call(t,...e)},onSelectionUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onSelectionUpdate)?void 0:n.call(t,...e)},onTransaction:(...e)=>{var t,n;return null==(n=(t=this.options.current).onTransaction)?void 0:n.call(t,...e)},onUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onUpdate)?void 0:n.call(t,...e)},onContentError:(...e)=>{var t,n;return null==(n=(t=this.options.current).onContentError)?void 0:n.call(t,...e)},onDrop:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDrop)?void 0:n.call(t,...e)},onPaste:(...e)=>{var t,n;return null==(n=(t=this.options.current).onPaste)?void 0:n.call(t,...e)},onDelete:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDelete)?void 0:n.call(t,...e)}})}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)||("extensions"===n&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every((e,n)=>{var r;return e===(null==(r=t.extensions)?void 0:r[n])}):e[n]===t[n]))}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===t.length?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps)return void(this.previousDeps=e);if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{this.isComponentMounted&&this.instanceId===e?t&&t.setOptions(this.options.current):t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function nE(e={},t=[]){const n=(0,Vt.useRef)(e);n.current=e;const[r]=(0,Vt.useState)(()=>new tE(n)),o=(0,iS.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,Vt.useDebugValue)(o),(0,Vt.useEffect)(r.onRender(t)),function(e){var t;const[n]=(0,Vt.useState)(()=>new GI(e.editor)),r=(0,UI.useSyncExternalStoreWithSelector)(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,null!=(t=e.equalityFn)?t:_I);JI(()=>n.watch(e.editor),[e.editor,n]),(0,Vt.useDebugValue)(r)}({editor:o,selector:({transactionNumber:t})=>!1===e.shouldRerenderOnTransaction||void 0===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===t?0:t+1}),o}var rE=(0,Vt.createContext)({editor:null}),oE=(rE.Consumer,(0,Vt.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}})),iE=(Vt.forwardRef((e,t)=>{const{onDragStart:n}=(0,Vt.useContext)(oE);
109
+ return(0,Jt.jsx)(e.as||"div",{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})}),Vt.createContext({markViewContentRef:()=>{}}),(0,Vt.createContext)({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}}));iE.displayName="TiptapContext";function sE({children:e,...t}){const n="editor"in t?t.editor:t.instance;if(!n)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const r=(0,Vt.useMemo)(()=>({editor:n}),[n]),o=(0,Vt.useMemo)(()=>({editor:n}),[n]);
110
+ return(0,Jt.jsx)(rE.Provider,{value:o,children: (0,Jt.jsx)(iE.Provider,{value:r,children:e})})}function aE({...e}){const{editor:t}=(0,Vt.useContext)(iE);
111
+ return(0,Jt.jsx)(XI,{editor:t,...e})}sE.displayName="Tiptap",aE.displayName="Tiptap.Content";Object.assign(sE,{Content:aE});var lE=(e,t)=>{if("slot"===e)return 0;if(e instanceof Function)return e(t);const{children:n,...r}=null!=t?t:{};if("svg"===e)throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,r,n]},cE=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,dE=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,uE=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,pE=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,hE=_M.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){
112
+ return lE("strong",{...CP(this.options.HTMLAttributes,e),children:lE("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[sI({find:cE,type:this.type}),sI({find:uE,type:this.type})]},addPasteRules(){return[dI({find:dE,type:this.type}),dI({find:pE,type:this.type})]}}),fE=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,mE=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,gE=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,yE=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,xE=_M.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",CP(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,t)=>t.applyMark("italic",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[sI({find:fE,type:this.type}),sI({find:gE,type:this.type})]},addPasteRules(){return[dI({find:mE,type:this.type}),dI({find:yE,type:this.type})]}}),bE="numeric",wE="ascii",vE="alpha",kE="asciinumeric",SE="alphanumeric",PE="domain",ME="emoji",IE="scheme",EE="slashscheme",TE="whitespace";function CE(e,t){return e in t||(t[e]=[]),t[e]}function OE(e,t,n){t[bE]&&(t[kE]=!0,t[SE]=!0),t[wE]&&(t[kE]=!0,t[vE]=!0),t[kE]&&(t[SE]=!0),t[vE]&&(t[SE]=!0),t[SE]&&(t[PE]=!0),t[ME]&&(t[PE]=!0);for(const r in t){const t=CE(r,n);t.indexOf(e)<0&&t.push(e)}}function AE(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}AE.groups={},AE.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let r=0;r<t.jr.length;r++){const n=t.jr[r][0],o=t.jr[r][1];if(o&&n.test(e))return o}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let o=0;o<e.length;o++)this.tt(e[o],t,n,r)},tr(e,t,n,r){let o;return r=r||AE.groups,t&&t.j?o=t:(o=new AE(t),n&&r&&OE(t,n,r)),this.jr.push([e,o]),o},ts(e,t,n,r){let o=this;const i=e.length;if(!i)return o;for(let s=0;s<i-1;s++)o=o.tt(e[s]);return o.tt(e[i-1],t,n,r)},tt(e,t,n,r){r=r||AE.groups;const o=this;if(t&&t.j)return o.j[e]=t,t;const i=t;let s,a=o.go(e);return a?(s=new AE,Object.assign(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new AE,i&&(r&&(s.t&&"string"==typeof s.t?OE(i,Object.assign(function(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}(s.t,r),n),r):n&&OE(i,n,r)),s.t=i),o.j[e]=s,s}};var RE=(e,t,n,r,o)=>e.ta(t,n,r,o),NE=(e,t,n,r,o)=>e.tr(t,n,r,o),LE=(e,t,n,r,o)=>e.ts(t,n,r,o),$E=(e,t,n,r,o)=>e.tt(t,n,r,o),DE="WORD",jE="UWORD",BE="ASCIINUMERICAL",zE="ALPHANUMERICAL",_E="LOCALHOST",FE="TLD",WE="UTLD",HE="SCHEME",UE="SLASH_SCHEME",VE="NUM",KE="WS",qE="NL",YE="OPENBRACE",XE="CLOSEBRACE",JE="OPENBRACKET",GE="CLOSEBRACKET",ZE="OPENPAREN",QE="CLOSEPAREN",eT="OPENANGLEBRACKET",tT="CLOSEANGLEBRACKET",nT="FULLWIDTHLEFTPAREN",rT="FULLWIDTHRIGHTPAREN",oT="LEFTCORNERBRACKET",iT="RIGHTCORNERBRACKET",sT="LEFTWHITECORNERBRACKET",aT="RIGHTWHITECORNERBRACKET",lT="FULLWIDTHLESSTHAN",cT="FULLWIDTHGREATERTHAN",dT="AMPERSAND",uT="APOSTROPHE",pT="ASTERISK",hT="AT",fT="BACKSLASH",mT="BACKTICK",gT="CARET",yT="COLON",xT="COMMA",bT="DOLLAR",wT="DOT",vT="EQUALS",kT="EXCLAMATION",ST="HYPHEN",PT="PERCENT",MT="PIPE",IT="PLUS",ET="POUND",TT="QUERY",CT="QUOTE",OT="FULLWIDTHMIDDLEDOT",AT="SEMI",RT="SLASH",NT="TILDE",LT="UNDERSCORE",$T="EMOJI",DT="SYM",jT=Object.freeze({__proto__:null,ALPHANUMERICAL:zE,AMPERSAND:dT,APOSTROPHE:uT,ASCIINUMERICAL:BE,ASTERISK:pT,AT:hT,BACKSLASH:fT,BACKTICK:mT,CARET:gT,CLOSEANGLEBRACKET:tT,CLOSEBRACE:XE,CLOSEBRACKET:GE,CLOSEPAREN:QE,COLON:yT,COMMA:xT,DOLLAR:bT,DOT:wT,EMOJI:$T,EQUALS:vT,EXCLAMATION:kT,FULLWIDTHGREATERTHAN:cT,FULLWIDTHLEFTPAREN:nT,FULLWIDTHLESSTHAN:lT,FULLWIDTHMIDDLEDOT:OT,FULLWIDTHRIGHTPAREN:rT,HYPHEN:ST,LEFTCORNERBRACKET:oT,LEFTWHITECORNERBRACKET:sT,LOCALHOST:_E,NL:qE,NUM:VE,OPENANGLEBRACKET:eT,OPENBRACE:YE,OPENBRACKET:JE,OPENPAREN:ZE,PERCENT:PT,PIPE:MT,PLUS:IT,POUND:ET,QUERY:TT,QUOTE:CT,RIGHTCORNERBRACKET:iT,RIGHTWHITECORNERBRACKET:aT,SCHEME:HE,SEMI:AT,SLASH:RT,SLASH_SCHEME:UE,SYM:DT,TILDE:NT,TLD:FE,UNDERSCORE:LT,UTLD:WE,UWORD:jE,WORD:DE,WS:KE}),BT=/[a-z]/,zT=/\p{L}/u,_T=/\p{Emoji}/u,FT=/\d/,WT=/\s/,HT=null,UT=null;function VT(e,t){const n=function(e){const t=[],n=e.length;let r=0;for(;r<n;){let o,i=e.charCodeAt(r),s=i<55296||i>56319||r+1===n||(o=e.charCodeAt(r+1))<56320||o>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,o=[];let i=0,s=0;for(;s<r;){let a=e,l=null,c=0,d=null,u=-1,p=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(u=0,p=0,d=a):u>=0&&(u+=n[s].length,p++),c+=n[s].length,i+=n[s].length,s++;i-=u,s-=p,c-=u,o.push({t:d.t,v:t.slice(i-c,i),s:i-c,e:i})}return o}function KT(e,t,n,r,o){let i;const s=t.length;for(let a=0;a<s-1;a++){const n=t[a];e.j[n]?i=e.j[n]:(i=new AE(r),i.jr=o.slice(),e.j[n]=i),e=i}return i=new AE(n),i.jr=o.slice(),e.j[t[s-1]]=i,i}function qT(e){const t=[],n=[];let r=0;for(;r<e.length;){let o=0;for(;"0123456789".indexOf(e[r+o])>=0;)o++;if(o>0){t.push(n.join(""));for(let t=parseInt(e.substring(r,r+o),10);t>0;t--)n.pop();r+=o}else n.push(e[r]),r++}return t}var YT={defaultProtocol:"http",events:null,format:JT,formatHref:JT,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function XT(e,t=null){let n=Object.assign({},YT);e&&(n=Object.assign(n,e instanceof XT?e.o:e));const r=n.ignoreTags,o=[];for(let i=0;i<r.length;i++)o.push(r[i].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=o}function JT(e){return e}function GT(e,t){this.t="token",this.v=e,this.tk=t}function ZT(e,t){class n extends GT{constructor(t,n){super(t,n),this.t=e}}for(const r in t)n.prototype[r]=t[r];return n.t=e,n}XT.prototype={o:YT,ignoreTags:[],defaultRender:e=>e,check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=null!=t;let o=this.o[e];return o?("object"==typeof o?(o=n.t in o?o[n.t]:YT[e],"function"==typeof o&&r&&(o=o(t,n))):"function"==typeof o&&r&&(o=o(t,n.t,n)),o):o},getObj(e,t,n){let r=this.o[e];return"function"==typeof r&&null!=t&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}},GT.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=YT.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),o=e.get("tagName",n,t),i=this.toFormattedString(e),s={},a=e.get("className",n,t),l=e.get("target",n,t),c=e.get("rel",n,t),d=e.getObj("attributes",n,t),u=e.getObj("events",n,t);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),d&&Object.assign(s,d),{tagName:o,attributes:s,content:i,eventListeners:u}}};var QT=ZT("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),eC=ZT("text"),tC=ZT("nl"),nC=ZT("url",{isLink:!0,toHref(e=YT.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==_E&&e[1].t===yT}}),rC=e=>new AE(e);function oC(e,t,n){const r=n[0].s,o=n[n.length-1].e;return new e(t.slice(r,o),n)}var iC="undefined"!=typeof console&&console&&console.warn||(()=>{}),sC={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function aC(e,t=!1){if(sC.initialized&&iC(`linkifyjs: already initialized - will not register custom scheme "${e}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error('linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or "-"\n2. Cannot start or end with "-"\n3. "-" cannot repeat');sC.customSchemes.push([e,t])}function lC(){sC.scanner=function(e=[]){const t={};AE.groups=t;const n=new AE;null==HT&&(HT=qT("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==UT&&(UT=qT("ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2")),$E(n,"'",uT),$E(n,"{",YE),$E(n,"}",XE),$E(n,"[",JE),$E(n,"]",GE),$E(n,"(",ZE),$E(n,")",QE),$E(n,"<",eT),$E(n,">",tT),$E(n,"(",nT),$E(n,")",rT),$E(n,"「",oT),$E(n,"」",iT),$E(n,"『",sT),$E(n,"』",aT),$E(n,"<",lT),$E(n,">",cT),$E(n,"&",dT),$E(n,"*",pT),$E(n,"@",hT),$E(n,"`",mT),$E(n,"^",gT),$E(n,":",yT),$E(n,",",xT),$E(n,"$",bT),$E(n,".",wT),$E(n,"=",vT),$E(n,"!",kT),$E(n,"-",ST),$E(n,"%",PT),$E(n,"|",MT),$E(n,"+",IT),$E(n,"#",ET),$E(n,"?",TT),$E(n,'"',CT),$E(n,"/",RT),$E(n,";",AT),$E(n,"~",NT),$E(n,"_",LT),$E(n,"\\",fT),$E(n,"・",OT);const r=NE(n,FT,VE,{[bE]:!0});NE(r,FT,r);const o=NE(r,BT,BE,{[kE]:!0}),i=NE(r,zT,zE,{[SE]:!0}),s=NE(n,BT,DE,{[wE]:!0});NE(s,FT,o),NE(s,BT,s),NE(o,FT,o),NE(o,BT,o);const a=NE(n,zT,jE,{[vE]:!0});NE(a,BT),NE(a,FT,i),NE(a,zT,a),NE(i,FT,i),NE(i,BT),NE(i,zT,i);const l=$E(n,"\n",qE,{[TE]:!0}),c=$E(n,"\r",KE,{[TE]:!0}),d=NE(n,WT,KE,{[TE]:!0});$E(n,"",d),$E(c,"\n",l),$E(c,"",d),NE(c,WT,d),$E(d,"\r"),$E(d,"\n"),NE(d,WT,d),$E(d,"",d);const u=NE(n,_T,$T,{[ME]:!0});$E(u,"#"),NE(u,_T,u),$E(u,"️",u);const p=$E(u,"‍");$E(p,"#"),NE(p,_T,u);const h=[[BT,s],[FT,o]],f=[[BT,null],[zT,a],[FT,i]];for(let m=0;m<HT.length;m++)KT(n,HT[m],FE,DE,h);for(let m=0;m<UT.length;m++)KT(n,UT[m],WE,jE,f);OE(FE,{tld:!0,ascii:!0},t),OE(WE,{utld:!0,alpha:!0},t),KT(n,"file",HE,DE,h),KT(n,"mailto",HE,DE,h),KT(n,"http",UE,DE,h),KT(n,"https",UE,DE,h),KT(n,"ftp",UE,DE,h),KT(n,"ftps",UE,DE,h),OE(HE,{scheme:!0,ascii:!0},t),OE(UE,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let m=0;m<e.length;m++){const t=e[m][0],r=e[m][1]?{[IE]:!0}:{[EE]:!0};t.indexOf("-")>=0?r[PE]=!0:BT.test(t)?FT.test(t)?r[kE]=!0:r[wE]=!0:r[bE]=!0,LE(n,t,t,r)}return LE(n,"localhost",_E,{ascii:!0}),n.jd=new AE(DT),{start:n,tokens:Object.assign({groups:t},jT)}}(sC.customSchemes);for(let e=0;e<sC.tokenQueue.length;e++)sC.tokenQueue[e][1]({scanner:sC.scanner});sC.parser=function({groups:e}){const t=e.domain.concat([dT,pT,hT,fT,mT,gT,bT,vT,ST,VE,PT,MT,IT,ET,RT,DT,NT,LT]),n=[uT,yT,xT,wT,kT,PT,TT,CT,AT,eT,tT,YE,XE,GE,JE,ZE,QE,nT,rT,oT,iT,sT,aT,lT,cT],r=[dT,uT,pT,fT,mT,gT,bT,vT,ST,YE,XE,PT,MT,IT,ET,TT,RT,DT,NT,LT],o=rC(),i=$E(o,NT);RE(i,r,i),RE(i,e.domain,i);const s=rC(),a=rC(),l=rC();RE(o,e.domain,s),RE(o,e.scheme,a),RE(o,e.slashscheme,l),RE(s,r,i),RE(s,e.domain,s);const c=$E(s,hT);$E(i,hT,c),$E(a,hT,c),$E(l,hT,c);const d=$E(i,wT);RE(d,r,i),RE(d,e.domain,i);const u=rC();RE(c,e.domain,u),RE(u,e.domain,u);const p=$E(u,wT);RE(p,e.domain,u);const h=rC(QT);RE(p,e.tld,h),RE(p,e.utld,h),$E(c,_E,h);const f=$E(u,ST);$E(f,ST,f),RE(f,e.domain,u),RE(h,e.domain,u),$E(h,wT,p),$E(h,ST,f);const m=$E(s,ST),g=$E(s,wT);$E(m,ST,m),RE(m,e.domain,s),RE(g,r,i),RE(g,e.domain,s);const y=rC(nC);RE(g,e.tld,y),RE(g,e.utld,y),RE(y,e.domain,s),RE(y,r,i),$E(y,wT,g),$E(y,ST,m),$E(y,hT,c);const x=$E(y,yT),b=rC(nC);RE(x,e.numeric,b);const w=rC(nC),v=rC();RE(w,t,w),RE(w,n,v),RE(v,t,w),RE(v,n,v),$E(y,RT,w),$E(b,RT,w);const k=$E(a,yT),S=$E($E($E(l,yT),RT),RT);RE(a,e.domain,s),$E(a,wT,g),$E(a,ST,m),RE(l,e.domain,s),$E(l,wT,g),$E(l,ST,m),RE(k,e.domain,w),$E(k,RT,w),$E(k,TT,w),RE(S,e.domain,w),RE(S,t,w),$E(S,RT,w);const P=[[YE,XE],[JE,GE],[ZE,QE],[eT,tT],[nT,rT],[oT,iT],[sT,aT],[lT,cT]];for(let M=0;M<P.length;M++){const[e,r]=P[M],o=$E(w,e);$E(v,e,o);const i=rC(nC);RE(o,t,i);const s=rC();RE(o,n,s),$E(o,r,w),RE(i,t,i),RE(i,n,s),RE(s,t,i),RE(s,n,s),$E(i,r,w),$E(s,r,w)}return $E(o,_E,y),$E(o,qE,tC),{start:o,tokens:jT}}(sC.scanner.tokens);for(let e=0;e<sC.pluginQueue.length;e++)sC.pluginQueue[e][1]({scanner:sC.scanner,parser:sC.parser});return sC.initialized=!0,sC}function cC(e){return sC.initialized||lC(),function(e,t,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let a=e,l=null,c=null,d=0,u=null,p=-1;for(;o<r&&!(l=a.go(n[o].t));)s.push(n[o++]);for(;o<r&&(c=l||a.go(n[o].t));)l=null,a=c,a.accepts()?(p=0,u=a):p>=0&&p++,o++,d++;if(p<0)o-=d,o<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(oC(eC,t,s)),s=[]),o-=p,d-=p;const e=u.t,r=n.slice(o-d,o);i.push(oC(e,t,r))}}return s.length>0&&i.push(oC(eC,t,s)),i}(sC.parser.start,e,VT(sC.scanner.start,e))}function dC(e,t=null,n=null){if(t&&"object"==typeof t){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new XT(n),o=cC(e),i=[];for(let s=0;s<o.length;s++){const e=o[s];!e.isLink||t&&e.t!==t||!r.check(e)||i.push(e.toFormattedObject(r))}return i}cC.scan=VT;var uC="[\0-   ᠎ -\u2029  ]",pC=new RegExp(uC),hC=new RegExp(`${uC}$`),fC=new RegExp(uC,"g");function mC(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(e=>{const t="string"==typeof e?e:e.scheme;t&&n.push(t)}),!e||e.replace(fC,"").match(new RegExp(`^(?:(?:${n.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}var gC=_M.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{"string"!=typeof e?aC(e.scheme,e.optionalSlashes):aC(e)})},onDestroy(){AE.groups={},sC.scanner=null,sC.parser=null,sC.tokenQueue=[],sC.pluginQueue=[],sC.customSchemes=[],sC.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!mC(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{const t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes("@"))return!0;const r=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!/^\d{1,3}(\.\d{1,3}){3}$/.test(r)&&!!/\./.test(r)}}),addAttributes(){var e,t,n;return{href:{default:null,parseHTML:e=>e.getAttribute("href")},target:{default:null!=(e=this.options.HTMLAttributes.target)?e:null},rel:{default:null!=(t=this.options.HTMLAttributes.rel)?t:null},class:{default:null!=(n=this.options.HTMLAttributes.class)?n:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!(!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!mC(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!mC(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",CP(this.options.HTMLAttributes,e),0]:["a",CP(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,t)=>t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{var n,r,o,i;const s=null!=(r=null==(n=e.attrs)?void 0:n.href)?r:"",a=null!=(i=null==(o=e.attrs)?void 0:o.title)?i:"",l=t.renderChildren(e);return a?`[${l}](${s} "${a}")`:`[${l}](${s})`},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!mC(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().setMark(this.name,e).setMeta("preventAutolink",!0).run()},toggleLink:e=>({chain:t})=>{const{href:n}=e||{};return!(n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!mC(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[dI({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,o=dC(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!mC(e,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>{var t;return{href:null==(t=e.data)?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;var r;return this.options.autolink&&e.push((r={type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!mC(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink},new Xx({key:new Zx("autolink"),appendTransaction:(e,t,n)=>{const o=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta("preventAutolink"));if(!o||i)return;const{tr:s}=n;return _P(bP(t.doc,[...e])).forEach(({newRange:e})=>{const t=function(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}(n.doc,e,e=>e.isTextblock);let o,i;if(t.length>1)o=t[0],i=n.doc.textBetween(o.pos,o.pos+o.node.nodeSize,void 0," ");else if(t.length){const r=n.doc.textBetween(e.from,e.to," "," ");if(!hC.test(r))return;o=t[0],i=n.doc.textBetween(o.pos,e.to,void 0," ")}if(o&&i){const e=i.split(pC).filter(Boolean);if(e.length<=0)return!1;const t=e[e.length-1],l=o.pos+i.lastIndexOf(t);if(!t)return!1;const c=cC(t).map(e=>e.toObject(r.defaultProtocol));if(!(1===(a=c).length?a[0].isLink:3===a.length&&a[1].isLink&&["()","[]"].includes(a[0].value+a[2].value)))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:l+e.start+1,to:l+e.end+1})).filter(e=>!n.schema.marks.code||!n.doc.rangeHasMark(e.from,e.to,n.schema.marks.code)).filter(e=>r.validate(e.value)).filter(e=>r.shouldAutoLink(e.value)).forEach(e=>{FP(e.from,e.to,n.doc).some(e=>e.mark.type===r.type)||s.addMark(e.from,e.to,r.type.create({href:e.href}))})}var a}),s.steps.length?s:void 0}}))),e.push(function(e){return new Xx({key:new Zx("handleClickLink"),props:{handleClick:(t,n,r)=>{var o,i;if(0!==r.button)return!1;if(!t.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{const t=r.target;if(!t)return!1;const n=e.editor.view.dom;s=t.closest("a"),s&&!n.contains(s)&&(s=null)}if(!s)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){const n=BP(t.state,e.type.name),r=null!=(o=s.href)?o:n.href,l=null!=(i=s.target)?i:n.target;r&&(window.open(r,l),a=!0)}return a}}})}({type:this.type,editor:this.editor,openOnClick:"whenNotEditable"===this.options.openOnClick||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(function(e){return new Xx({key:new Zx("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{shouldAutoLink:o}=e,{state:i}=t,{selection:s}=i,{empty:a}=s;if(a)return!1;let l="";r.content.forEach(e=>{l+=e.textContent});const c=dC(l,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===l);return!(!l||!c||void 0!==o&&!o(c.value))&&e.editor.commands.setMark(e.type,{href:c.href})}}})}({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),yC=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,xC=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,bC=_M.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",CP(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[sI({find:yC,type:this.type})]},addPasteRules(){return[dI({find:xC,type:this.type})]}}),wC=KM.create({name:"textAlign",addOptions:()=>({types:[],alignments:["left","center","right","justify"],defaultAlignment:null}),addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{const t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>!!this.options.alignments.includes(e)&&this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).some(e=>e),unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,"textAlign")).some(e=>e),toggleTextAlign:e=>({editor:t,commands:n})=>!!this.options.alignments.includes(e)&&(t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),vC=(e,t=0)=>{const n=[];return!e.children.length||t>20||Array.from(e.children).forEach(e=>{"SPAN"===e.tagName?n.push(e):e.children.length&&n.push(...vC(e,t+1))}),n},kC=_M.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{},mergeNestedSpanStyles:!0}),parseHTML(){return[{tag:"span",consuming:!1,getAttrs:e=>!!e.hasAttribute("style")&&(this.options.mergeNestedSpanStyles&&(e=>{if(!e.children.length)return;const t=vC(e);t&&t.forEach(e=>{var t,n;const r=e.getAttribute("style"),o=null==(n=null==(t=e.parentElement)?void 0:t.closest("span"))?void 0:n.getAttribute("style");e.setAttribute("style",`${o};${r}`)})})(e),{})}]},renderHTML({HTMLAttributes:e}){return["span",CP(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleTextStyle:e=>({commands:t})=>t.toggleMark(this.name,e),removeEmptyTextStyle:()=>({tr:e})=>{const{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,(t,n)=>{if(t.isTextblock)return!0;t.marks.filter(e=>e.type===this.type).some(e=>Object.values(e.attrs).some(e=>!!e))||e.removeMark(n,n+t.nodeSize,this.type)}),!0}}}}),SC=KM.create({name:"backgroundColor",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:e=>{var t;const n=null!=(t=MM(e,"background-color"))?t:e.style.backgroundColor;return null==n?void 0:n.replace(/['"]+/g,"")},renderHTML:e=>e.backgroundColor?{style:`background-color: ${e.backgroundColor}`}:{}}}}]},addCommands:()=>({setBackgroundColor:e=>({chain:t})=>t().setMark("textStyle",{backgroundColor:e}).run(),unsetBackgroundColor:()=>({chain:e})=>e().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()})}),PC=KM.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{var t;const n=null!=(t=MM(e,"color"))?t:e.style.color;return null==n?void 0:n.replace(/['"]+/g,"")},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands:()=>({setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})}),MC=KM.create({name:"fontFamily",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:e=>{var t;return null!=(t=MM(e,"font-family"))?t:e.style.fontFamily},renderHTML:e=>e.fontFamily?{style:`font-family: ${e.fontFamily}`}:{}}}}]},addCommands:()=>({setFontFamily:e=>({chain:t})=>t().setMark("textStyle",{fontFamily:e}).run(),unsetFontFamily:()=>({chain:e})=>e().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()})}),IC=KM.create({name:"fontSize",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>{var t;return null!=(t=MM(e,"font-size"))?t:e.style.fontSize},renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]},addCommands:()=>({setFontSize:e=>({chain:t})=>t().setMark("textStyle",{fontSize:e}).run(),unsetFontSize:()=>({chain:e})=>e().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()})}),EC=KM.create({name:"lineHeight",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>{var t;return null!=(t=MM(e,"line-height"))?t:e.style.lineHeight},renderHTML:e=>e.lineHeight?{style:`line-height: ${e.lineHeight}`}:{}}}}]},addCommands:()=>({setLineHeight:e=>({chain:t})=>t().setMark("textStyle",{lineHeight:e}).run(),unsetLineHeight:()=>({chain:e})=>e().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()})}),TC=(KM.create({name:"textStyleKit",addExtensions(){const e=[];return!1!==this.options.backgroundColor&&e.push(SC.configure(this.options.backgroundColor)),!1!==this.options.color&&e.push(PC.configure(this.options.color)),!1!==this.options.fontFamily&&e.push(MC.configure(this.options.fontFamily)),!1!==this.options.fontSize&&e.push(IC.configure(this.options.fontSize)),!1!==this.options.lineHeight&&e.push(EC.configure(this.options.lineHeight)),!1!==this.options.textStyle&&e.push(kC.configure(this.options.textStyle)),e}}),_M.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",CP(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown:(e,t)=>`++${t.renderChildren(e)}++`,markdownTokenizer:{name:"underline",level:"inline",start:e=>e.indexOf("++"),tokenize(e,t,n){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;const o=r[2].trim();return{type:"underline",raw:r[0],text:o,tokens:n.inlineTokens(o)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}})),CC=KM.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){const{editor:e,options:t}=this;return e.options.injectCSS&&"undefined"!=typeof document&&PM(".ProseMirror:not(.ProseMirror-focused) *::selection {\n background: transparent;\n}\n\n.ProseMirror:not(.ProseMirror-focused) *::-moz-selection {\n background: transparent;\n}",e.options.injectNonce,"selection"),[new Xx({key:new Zx("selection"),props:{decorations:n=>n.selection.empty||e.isFocused||!e.isEditable||YP(n.selection)||e.view.dragging?null:gk.create(n.doc,[hk.inline(n.selection.from,n.selection.to,{class:t.className})])}})]}});function OC(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(r),i=t.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){let e=o.text,t=i.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&NC(e.charCodeAt(r-1))&&RC(e.charCodeAt(r))&&n--,n}if(o.content.size||i.content.size){let e=OC(o.content,i.content,n+1);if(null!=e)return e}n+=o.nodeSize}else n+=o.nodeSize}}function AC(e,t,n,r){for(let o=e.childCount,i=t.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let s=e.child(--o),a=t.child(--i),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let e=s.text,t=a.text,o=e.length,i=t.length;for(;o>0&&i>0&&e[o-1]==t[i-1];)o--,i--,n--,r--;return o&&i&&o<e.length&&NC(e.charCodeAt(o-1))&&RC(e.charCodeAt(o))&&(n++,r++),{a:n,b:r}}if(s.content.size||a.content.size){let e=AC(s.content,a.content,n-1,r-1);if(e)return e}n-=l,r-=l}else n-=l,r-=l}}function RC(e){return e>=56320&&e<57344}function NC(e){return e>=55296&&e<56320}var LC=class e{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,r=0,o){for(let i=0,s=0;s<t;i++){let a=this.content[i],l=s+a.nodeSize;if(l>e&&!1!==n(a,r+s,o||null,i)&&a.content.size){let o=s+1;a.nodesBetween(Math.max(0,e-o),Math.min(a.content.size,t-o),n,r+o)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let o="",i=!0;return this.nodesBetween(e,t,(s,a)=>{let l=s.isText?s.text.slice(Math.max(e,a)-a,t-a):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&l||s.isTextblock)&&n&&(i?i=!1:o+=n),o+=l},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i<t.content.length;i++)o.push(t.content[i]);return new e(o,this.size+t.size)}cut(t,n=this.size){if(0==t&&n==this.size)return this;let r=[],o=0;if(n>t)for(let e=0,i=0;i<n;e++){let s=this.content[e],a=i+s.nodeSize;a>t&&((i<t||a>n)&&(s=s.isText?s.cut(Math.max(0,t-i),Math.min(s.text.length,n-i)):s.cut(Math.max(0,t-i-1),Math.min(s.content.size,n-i-1))),r.push(s),o+=s.nodeSize),i=a}return new e(r,o)}cutByIndex(t,n){return t==n?e.empty:0==t&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[t]=n,new e(o,i)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return OC(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return AC(this,e,t,n)}findIndex(e){if(0==e)return DC(0,e);if(e==this.size)return DC(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=n+this.child(t).nodeSize;if(r>=e)return r==e?DC(t+1,r):DC(t,n);n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let o=t[e];r+=o.nodeSize,e&&o.isText&&t[e-1].sameMarkup(o)?(n||(n=t.slice(0,e)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};LC.empty=new LC([],0);var $C={index:0,offset:0};function DC(e,t){return $C.index=e,$C.offset=t,$C}function jC(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!jC(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!jC(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var BC=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&jC(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&0==t.length)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};BC.none=[];var zC=class extends Error{},_C=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=WC(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(FC(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,o=n.openEnd||0;if("number"!=typeof r||"number"!=typeof o)throw new RangeError("Invalid input for Slice.fromJSON");return new e(LC.fromJSON(t,n.content),r,o)}static maxOpen(t,n=!0){let r=0,o=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)o++;return new e(t,r,o)}};function FC(e,t,n){let{index:r,offset:o}=e.findIndex(t),i=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(o==t||i.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,i.copy(FC(i.content,t-o-1,n-o-1)))}function WC(e,t,n,r,o,i){let{index:s,offset:a}=e.findIndex(t),l=e.maybeChild(s);if(a==t||l.isText)return i&&r<=0&&o<=0&&!i.canReplace(s,s,n)?null:e.cut(0,t).append(n).append(e.cut(t));let c=WC(l.content,t-a-1,n,0==s?r-1:0,s==e.childCount-1?o-1:0,l);return c&&e.replaceChild(s,l.copy(c))}_C.empty=new _C(LC.empty,0,0);var HC=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new UC(t,n);if(null==r.next)return e.empty;let o=VC(r);r.next&&r.err("Unexpected trailing text");let i=function(e){let t=Object.create(null);return n(GC(e,0));function n(r){let o=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<o.length;e++)o[e][0]==t&&(r=o[e][1]);GC(e,n).forEach(e=>{r||o.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)})})});let i=t[r.join(",")]=new HC(r.indexOf(e.length-1)>-1);for(let e=0;e<o.length;e++){let r=o[e][1].sort(JC);i.next.push({type:o[e][0],next:t[r.join(",")]||n(r)})}return i}}(function(e){let t=[[]];return o(i(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let o={term:r,to:n};return t[e].push(o),o}function o(e,t){e.forEach(e=>e.to=t)}function i(e,t){if("choice"==e.type)return e.exprs.reduce((e,n)=>e.concat(i(n,t)),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return r(t,s),o(i(e.expr,s),s),[r(s)]}if("plus"==e.type){let s=n();return o(i(e.expr,t),s),o(i(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(t)].concat(i(e.expr,t));if("range"==e.type){let s=t;for(let t=0;t<e.min;t++){let t=n();o(i(e.expr,s),t),s=t}if(-1==e.max)o(i(e.expr,s),s);else for(let t=e.min;t<e.max;t++){let t=n();r(s,t),o(i(e.expr,s),t),s=t}return[r(s)]}if("name"==e.type)return[r(t,void 0,e.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=i(e.exprs[r],t);if(r==e.exprs.length-1)return s;o(s,t=n())}}}(o));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],o=!e.validEnd,i=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];i.push(n.name),!o||n.isText||n.hasRequiredAttrs()||(o=!1),-1==r.indexOf(s)&&r.push(s)}o&&t.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let o=t;r&&o<n;o++)r=r.matchType(e.child(o).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function o(i,s){let a=i.matchFragment(e,n);if(a&&(!t||a.validEnd))return LC.from(s.map(e=>e.createAndFill()));for(let e=0;e<i.next.length;e++){let{type:t,next:n}=i.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=o(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),o=r.match;if(o.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<o.next.length;e++){let{type:i,next:s}=o.next[e];i.isLeaf||i.hasRequiredAttrs()||i.name in t||r.type&&!s.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),t[i.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let o=0;o<t.next.length;o++)r+=(o?", ":"")+t.next[o].type.name+"->"+e.indexOf(t.next[o].next);return r}).join("\n")}};HC.empty=new HC(!0);var UC=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}};function VC(e){let t=[];do{t.push(KC(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function KC(e){let t=[];do{t.push(qC(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function qC(e){let t=function(e){if(e.eat("(")){let t=VC(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let o=[];for(let i in n){let e=n[i];e.isInGroup(t)&&o.push(e)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(e,e.next).map(t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=XC(e,t)}return t}function YC(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function XC(e,t){let n=YC(e),r=n;return e.eat(",")&&(r="}"!=e.next?YC(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function JC(e,t){return t-e}function GC(e,t){let n=[];return function t(r){let o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(let e=0;e<o.length;e++){let{term:r,to:i}=o[e];r||-1!=n.indexOf(i)||t(i)}}(t),n.sort(JC)}var ZC=Math.pow(2,16);function QC(e,t){return e+t*ZC}function eO(e){return 65535&e}var tO=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}},nO=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=eO(e);if(!this.inverted)for(let r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/ZC}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>e)break;let l=this.ranges[s+o],c=this.ranges[s+i],d=a+l;if(e<=d){let o=a+r+((l?e==a?-1:e==d?1:t:t)<0?0:c);if(n)return o;let i=e==(t<0?a:d)?null:QC(s/3,e-a),u=e==a?2:e==d?1:4;return(t<0?e!=a:e!=d)&&(u|=8),new tO(o,u,i)}r+=c-l}return n?e+r:new tO(e+r,0,null)}touches(e,t){let n=0,r=eO(t),o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let t=this.ranges[s]-(this.inverted?n:0);if(t>e)break;let a=this.ranges[s+o];if(e<=t+a&&s==3*r)return!0;n+=this.ranges[s+i]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],s=i-(this.inverted?o:0),a=i+(this.inverted?0:o),l=this.ranges[r+t],c=this.ranges[r+n];e(s,s+l,a,a+c),o+=c-l}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};nO.empty=new nO([]);var rO=Object.create(null),oO=class{getMap(){return nO.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=rO[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in rO)throw new RangeError("Duplicate use of step JSON ID "+e);return rO[e]=t,t.prototype.jsonID=e,t}},iO=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,o){try{return e.ok(t.replace(n,r,o))}catch(i){if(i instanceof zC)return e.fail(i.message);throw i}}};function sO(e,t,n){let r=[];for(let o=0;o<e.childCount;o++){let i=e.child(o);i.content.size&&(i=i.copy(sO(i.content,t,i))),i.isInline&&(i=t(i,n,o)),r.push(i)}return LC.fromArray(r)}var aO=class e extends oO{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),o=new _C(sO(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,r),t.openStart,t.openEnd);return iO.fromReplace(e,this.from,this.to,o)}invert(){return new lO(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}};oO.jsonID("addMark",aO);var lO=class e extends oO{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new _C(sO(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return iO.fromReplace(e,this.from,this.to,n)}invert(){return new aO(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}};oO.jsonID("removeMark",lO);var cO=class e extends oO{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return iO.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return iO.fromReplace(e,this.pos,this.pos+1,new _C(LC.from(n),0,t.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new dO(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new e(n.pos,t.markFromJSON(n.mark))}};oO.jsonID("addNodeMark",cO);var dO=class e extends oO{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return iO.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return iO.fromReplace(e,this.pos,this.pos+1,new _C(LC.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new cO(this.pos,this.mark):this}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new e(n.pos,t.markFromJSON(n.mark))}};oO.jsonID("removeNodeMark",dO);var uO=class e extends oO{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&hO(e,this.from,this.to)?iO.fail("Structure replace would overwrite content"):iO.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new nO([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let n=this.slice.size+t.slice.size==0?_C.empty:new _C(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}}{let n=this.slice.size+t.slice.size==0?_C.empty:new _C(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new e(n.from,n.to,_C.fromJSON(t,n.slice),!!n.structure)}};uO.MAP_BIAS=1,oO.jsonID("replace",uO);var pO=class e extends oO{constructor(e,t,n,r,o,i,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=s}apply(e){if(this.structure&&(hO(e,this.from,this.gapFrom)||hO(e,this.gapTo,this.to)))return iO.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return iO.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?iO.fromReplace(e,this.from,this.to,n):iO.fail("Content does not fit in gap")}getMap(){return new nO([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||i>r.pos?null:new e(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new e(n.from,n.to,n.gapFrom,n.gapTo,_C.fromJSON(t,n.slice),n.insert,!!n.structure)}};function hO(e,t,n){let r=e.resolve(t),o=n-t,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let e=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,o--}}return!1}oO.jsonID("replaceAround",pO);oO.jsonID("attr",class e extends oO{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return iO.fail("No node at attribute step's position");let n=Object.create(null);for(let o in t.attrs)n[o]=t.attrs[o];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return iO.fromReplace(e,this.pos,this.pos+1,new _C(LC.from(r),0,t.isLeaf?0:1))}getMap(){return nO.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if("number"!=typeof n.pos||"string"!=typeof n.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new e(n.pos,n.attr,n.value)}});oO.jsonID("docAttr",class e extends oO{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let r in e.attrs)t[r]=e.attrs[r];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return iO.ok(n)}getMap(){return nO.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if("string"!=typeof n.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new e(n.attr,n.value)}});var fO=Error;((fO=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype)).constructor=fO,fO.prototype.name="TransformError";var mO=Object.create(null),gO=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new yO(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=_C.empty){let n=t.content.lastChild,r=null;for(let s=0;s<t.openEnd;s++)r=n,n=n.lastChild;let o=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:l}=i[s],c=e.mapping.slice(o);e.replaceRange(c.map(a.pos),c.map(l.pos),s?_C.empty:t),0==s&&EO(e,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],a=e.mapping.slice(n),l=a.map(i.pos),c=a.map(s.pos);o?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),EO(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new wO(e):IO(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let o=e.depth-1;o>=0;o--){let r=t<0?IO(e.node(0),e.node(o),e.before(o+1),e.index(o),t,n):IO(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,n);if(r)return r}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new PO(e.node(0))}static atStart(e){return IO(e,e,0,0,1)||new PO(e)}static atEnd(e){return IO(e,e,e.content.size,e.childCount,-1)||new PO(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=mO[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in mO)throw new RangeError("Duplicate use of selection JSON ID "+e);return mO[e]=t,t.prototype.jsonID=e,t}getBookmark(){return wO.between(this.$anchor,this.$head).getBookmark()}};gO.prototype.visible=!0;var yO=class{constructor(e,t){this.$from=e,this.$to=t}},xO=!1;function bO(e){xO||e.parent.inlineContent||(xO=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}var wO=class e extends gO{constructor(e,t=e){bO(e),bO(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return gO.near(r);let o=t.resolve(n.map(this.anchor));return new e(o.parent.inlineContent?o:r,r)}replace(e,t=_C.empty){if(super.replace(e,t),t==_C.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new vO(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let o=t.pos-n.pos;if(r&&!o||(r=o>=0?1:-1),!n.parent.inlineContent){let e=gO.findFrom(n,r,!0)||gO.findFrom(n,-r,!0);if(!e)return gO.near(n,r);n=e.$head}return t.parent.inlineContent||(0==o||(t=(gO.findFrom(t,-r,!0)||gO.findFrom(t,r,!0)).$anchor).pos<n.pos!=o<0)&&(t=n),new e(t,n)}};gO.jsonID("text",wO);var vO=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return wO.between(e.resolve(this.anchor),e.resolve(this.head))}},kO=class e extends gO{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),i=t.resolve(o);return r?gO.near(i):new e(i)}content(){return new _C(LC.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new SO(this.anchor)}static fromJSON(t,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}};kO.prototype.visible=!1,gO.jsonID("node",kO);var SO=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new vO(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&kO.isSelectable(n)?new kO(t):gO.near(t)}},PO=class e extends gO{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=_C.empty){if(t==_C.empty){e.delete(0,e.doc.content.size);let t=gO.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return MO}};gO.jsonID("all",PO);var MO={map(){return this},resolve:e=>new PO(e)};function IO(e,t,n,r,o,i=!1){if(t.inlineContent)return wO.create(e,n);for(let s=r-(o>0?0:1);o>0?s<t.childCount:s>=0;s+=o){let r=t.child(s);if(r.isAtom){if(!i&&kO.isSelectable(r))return kO.create(e,n-(o<0?r.nodeSize:0))}else{let t=IO(e,r,n+o,o<0?r.childCount:0,o,i);if(t)return t}n+=r.nodeSize*o}return null}function EO(e,t,n){let r=e.steps.length-1;if(r<t)return;let o,i=e.steps[r];(i instanceof uO||i instanceof pO)&&(e.mapping.maps[r].forEach((e,t,n,r)=>{null==o&&(o=r)}),e.setSelection(gO.near(e.doc.resolve(o),n)))}function TO(e,t){return t&&e?e.bind(t):e}var CO=class{constructor(e,t,n){this.name=e,this.init=TO(t.init,n),this.apply=TO(t.apply,n)}};new CO("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new CO("selection",{init:(e,t)=>e.selection||gO.atStart(t.doc),apply:e=>e.selection}),new CO("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new CO("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t});var OO=/^\s*>\s$/,AO=cI.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){
113
+ return lE("blockquote",{...CP(this.options.HTMLAttributes,e),children:lE("slot",{})})},parseMarkdown:(e,t)=>{var n;const r=null!=(n=t.parseBlockChildren)?n:t.parseChildren;return t.createNode("blockquote",void 0,r(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return"";const n=[];return e.content.forEach((e,r)=>{var o,i;const s=(null!=(i=null==(o=t.renderChild)?void 0:o.call(t,e,r))?i:t.renderChildren([e])).split("\n").map(e=>""===e.trim()?">":`> ${e}`);n.push(s.join("\n"))}),n.join("\n>\n")},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>((e,t)=>{var n;const{state:r,view:o}=e,{selection:i}=r;if(!i.empty)return!1;const{$from:s}=i;if(0!==s.parentOffset)return!1;const a=s.depth-1,l=s.node(a),c=s.index(a);if(0===c)return!1;if(l.type===t)return e.commands.lift(t.name);const d=l.child(c-1);if(d.type!==t||!(null==(n=d.lastChild)?void 0:n.isTextblock))return!1;const u=s.before(),p=u-1-1,{tr:h}=r;return h.delete(u,s.after()).insert(p,s.parent.content),h.setSelection(wO.create(h.doc,p)),o.dispatch(h.scrollIntoView()),!0})(this.editor,this.type)}},addInputRules(){return[lI({find:OO,type:this.type})]}}),RO=e=>{const t=/`([^`]+)`(?!`)$/.exec(e);return t?t.index>0&&"`"===e[t.index-1]?null:{index:t.index,text:t[0],replaceWith:t[1]}:null},NO=e=>{const t=/`([^`]+)`(?!`)/g,n=[];let r;for(;null!==(r=t.exec(e));)r.index>0&&"`"===e[r.index-1]||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n},LO=_M.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",CP(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[sI({find:RO,type:this.type})]},addPasteRules(){return[dI({find:NO,type:this.type})]}}),$O=/^```([a-z]+)?[\s\n]$/,DO=/^~~~([a-z]+)?[\s\n]$/,jO=cI.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options;if(!n)return null;const r=[...(null==(t=e.firstElementChild)?void 0:t.classList)||[]].filter(e=>e.startsWith(n)).map(e=>e.replace(n,""))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",CP(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var n,r;return!1===(null==(n=e.raw)?void 0:n.startsWith("```"))&&!1===(null==(r=e.raw)?void 0:r.startsWith("~~~"))&&"indented"!==e.codeBlockStyle?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:(e,t)=>{var n;let r="";const o=(null==(n=e.attrs)?void 0:n.language)||"";return r=e.content?[`\`\`\`${o}`,t.renderChildren(e.content),"```"].join("\n"):`\`\`\`${o}\n\n\`\`\``,r},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!n&&t.parent.textContent.length)&&this.editor.commands.clearNodes())},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=null!=(t=this.options.tabSize)?t:4,{state:r}=e,{selection:o}=r,{$from:i,empty:s}=o;if(i.parent.type!==this.type)return!1;const a=" ".repeat(n);return s?e.commands.insertContent(a):e.commands.command(({tr:e})=>{const{from:t,to:n}=o,i=r.doc.textBetween(t,n,"\n","\n").split("\n").map(e=>a+e).join("\n");return e.replaceWith(t,n,r.schema.text(i)),!0})},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=null!=(t=this.options.tabSize)?t:4,{state:r}=e,{selection:o}=r,{$from:i,empty:s}=o;return i.parent.type===this.type&&(s?e.commands.command(({tr:e})=>{var t;const{pos:o}=i,s=i.start(),a=i.end(),l=r.doc.textBetween(s,a,"\n","\n").split("\n");let c=0,d=0;const u=o-s;for(let n=0;n<l.length;n+=1){if(d+l[n].length>=u){c=n;break}d+=l[n].length+1}const p=(null==(t=l[c].match(/^ */))?void 0:t[0])||"",h=Math.min(p.length,n);if(0===h)return!0;let f=s;for(let n=0;n<c;n+=1)f+=l[n].length+1;return e.delete(f,f+h),o-f<=h&&e.setSelection(Lx.create(e.doc,f)),!0}):e.commands.command(({tr:e})=>{const{from:t,to:i}=o,s=r.doc.textBetween(t,i,"\n","\n").split("\n").map(e=>{var t;const r=(null==(t=e.match(/^ */))?void 0:t[0])||"",o=Math.min(r.length,n);return e.slice(o)}).join("\n");return e.replaceWith(t,i,r.schema.text(s)),!0}))},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!(!i||!s)&&e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type)return!1;if(o.parentOffset!==o.parent.nodeSize-2)return!1;const s=o.after();return void 0!==s&&(r.nodeAt(s)?e.commands.command(({tr:e})=>(e.setSelection(Ox.near(r.resolve(s))),!0)):e.commands.exitCode())}}},addInputRules(){return[aI({find:$O,type:this.type,getAttributes:e=>({language:e[1]})}),aI({find:DO,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Xx({key:new Zx("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=null==o?void 0:o.mode;if(!n||!i)return!1;const{tr:s,schema:a}=e.state,l=a.text(n.replace(/\r\n?/g,"\n"));return s.replaceSelectionWith(this.type.create({language:i},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(Lx.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),BO=cI.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n\n"):""}),zO=cI.create({name:"hardBreak",markdownTokenName:"br",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",CP(this.options.HTMLAttributes,e)]},renderText:()=>"\n",renderMarkdown:()=>" \n",parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:e,storedMarks:o}=n;if(e.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:s}=r.extensionManager,a=o||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&a&&i){const t=a.filter(e=>s.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),_O=cI.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,CP(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var n;const r=(null==(n=e.attrs)?void 0:n.level)?parseInt(e.attrs.level,10):1,o="#".repeat(r);return e.content?`${o} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>aI({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),FO=cI.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{},nextNodeType:"paragraph"}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",CP(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!function(e,t){const{selection:n}=e,{$from:r}=n;if(n instanceof Dx){const e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let o=r.depth;for(;o>=0;){const e=r.index(o);if(r.node(o).contentMatchAt(e).matchType(t))return!0;o-=1}return!1}(t,t.schema.nodes[this.name]))return!1;const{selection:n}=t,{$to:r}=n,o=e();return YP(n)?o.insertContentAt(r.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({state:e,tr:t,dispatch:n})=>{if(n){const{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(Lx.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(Dx.create(t.doc,n.pos)):t.setSelection(Lx.create(t.doc,n.pos));else{const o=e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType,i=null==o?void 0:o.create();i&&(t.insert(r,i),t.setSelection(Lx.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[(e={find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type},new jM({find:e.find,handler:({state:t,range:n,match:r})=>{const o=MP(e.getAttributes,void 0,r)||{},{tr:i}=t,s=n.from;let a=n.to;const l=e.type.create(o);if(r[1]){let e=s+r[0].lastIndexOf(r[1]);e>a?e=a:a=e+r[1].length;const t=r[0][r[0].length-1];i.insertText(t,s+r[0].length-1),i.replaceWith(e,a,l)}else if(r[0]){const t=e.type.isInline?s:s-1;i.insert(t,e.type.create(o)).delete(i.mapping.map(s),i.mapping.map(a))}i.scrollIntoView()},undoable:e.undoable}))];var e}}),WO=Object.defineProperty,HO="textStyle",UO=/^\s*([-+*])\s$/,VO=cI.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",CP(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>"list"!==e.type||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(HO)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=lI({find:UO,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=lI({find:UO,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(HO),editor:this.editor})),[e]}}),KO=(e,t,n)=>((e,t,n,r)=>{const o=((e,t,n)=>{const{selection:r}=e;if(!r.empty)return null;const{$from:o}=r;if(!o.parent.isTextblock)return null;if(o.parentOffset!==o.parent.content.size)return null;let i=-1;for(let h=o.depth;h>0;h-=1)if(o.node(h).type.name===t){i=h;break}if(i<0)return null;const s=o.node(i),a=o.index(i);if(a+1>=s.childCount)return null;const l=s.child(a+1);if(!n.includes(l.type.name))return null;const c=e.schema.nodes[t];let d=!1;if(l.forEach(e=>{e.type===c&&e.childCount>1&&(d=!0)}),!d)return null;const u=e.doc.resolve(o.after()).nodeAfter;if(!u||!n.includes(u.type.name))return null;const p=[];return u.forEach(e=>{p.push(e)}),0===p.length?null:{listItemDepth:i,nestedList:u,nestedListPos:o.after(),insertPos:o.after(i),items:p}})(e,n,r);if(!o)return!1;const{selection:i}=e,{nestedList:s,nestedListPos:a,insertPos:l,items:c}=o,d=e.tr;d.delete(a,a+s.nodeSize);const u=d.mapping.map(l);return d.insert(u,Ag.from(c)),d.setSelection(i.map(d.doc,d.mapping)),t&&t(d),!0})(e.state,e.view.dispatch,t,n),qO=(e,t)=>KM.create({name:`${e}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const n=()=>KO(this.editor,e,t);return{Delete:n,"Mod-Delete":n}}}),YO=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],XO="abcdefghijklmnopqrstuvwxyz",JO=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function GO(e){let t=e,n="";for(const[r,o]of YO)for(;t>=r;)n+=o,t-=r;return n}function ZO(e){return GO(e).toUpperCase()}function QO(e){const t=e.toLowerCase();let n=0,r=0;for(;n<t.length;){let e=!1;for(const[o,i]of YO)if(t.startsWith(i,n)){r+=o,n+=i.length,e=!0;break}if(!e)return 0}return r}function eA(e){if(e<=26)return XO[e-1];const t=Math.floor((e-1)/26)-1,n=(e-1)%26;return t<0?XO[n]:XO[t]+XO[n]}function tA(e){if(e&&!/^\d+$/.test(e))return function(e){if(!/^[ivxlcdmIVXLCDM]+$/.test(e))return!1;const t=QO(e);return!(t<=0)&&(e===e.toLowerCase()?GO(t):ZO(t))===e}(e)?e===e.toLowerCase()?"i":"I":/^[a-z]{1,2}$/.test(e)?"a":/^[A-Z]{1,2}$/.test(e)?"A":void 0}function nA(e){if(/^\d+$/.test(e))return parseInt(e,10);const t=tA(e);if("i"===t||"I"===t)return QO(e);if("a"===t||"A"===t){const t=function(e){const t=e.toLowerCase();if(1===t.length)return t.charCodeAt(0)-"a".charCodeAt(0)+1;if(2===t.length)return 26*(t.charCodeAt(0)-"a".charCodeAt(0)+1)+(t.charCodeAt(1)-"a".charCodeAt(0))+1;return 0}(e);return t>0?t:1}const n=parseInt(e,10);return Number.isNaN(n)?1:n}function rA(e,t){if("numeric"===e)return String(t);switch(e){case"a":return eA(t);case"A":return eA(t).toUpperCase();case"i":return GO(t);case"I":return ZO(t);default:return String(t)}}function oA(e){const{type:t,start:n}=function(e){return{type:tA(e),start:nA(e)}}(e),r={};return t&&(r.type=t),1!==n&&(r.start=n),r}function iA(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:"text",raw:e,text:e}])}var sA=cI.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",CP(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{var n;if("list_item"!==e.type)return[];const r=null!=(n=t.parseBlockChildren)?n:t.parseChildren;let o=[];if(e.tokens&&e.tokens.length>0){if(function(e){var t,n;const r=null==(t=e.tokens)?void 0:t[0];return Boolean(e.text&&1===(null==(n=e.tokens)?void 0:n.length)&&"list"===(null==r?void 0:r.type)&&r.ordered&&r.raw===e.text)}(e))return{type:"listItem",content:[{type:"paragraph",content:iA(e.text||"",t)}]};if(e.tokens.some(e=>"paragraph"===e.type))o=r(e.tokens);else{const n=e.tokens[0];if(n&&"text"===n.type&&n.tokens&&n.tokens.length>0){if(o=[{type:"paragraph",content:t.parseInline(n.tokens)}],e.tokens.length>1){const t=r(e.tokens.slice(1));o.push(...t)}}else o=r(e.tokens)}}return 0===o.length&&(o=[{type:"paragraph",content:[]}]),{type:"listItem",content:o}},renderMarkdown:(e,t,n)=>$M(e,t,e=>{var t,n,r,o;if("bulletList"===e.parentType)return"- ";if("orderedList"===e.parentType){const i=(null==(n=null==(t=e.meta)?void 0:t.parentAttrs)?void 0:n.start)||1;return function(e,t,n=". "){const r=t+1;if(!e||"1"===e)return`${r}${n}`;switch(e){case"a":return`${eA(r)}${n}`;case"A":return`${eA(r).toUpperCase()}${n}`;case"i":return`${GO(r)}${n}`;case"I":return`${ZO(r)}${n}`;default:return`${r}${n}`}}(null==(o=null==(r=e.meta)?void 0:r.parentAttrs)?void 0:o.type,i-1+(e.index||0),". ")}return"- "},n),addExtensions(){return[qO(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});((e,t)=>{for(var n in t)WO(e,n,{get:t[n],enumerable:!0})})({},{findListItemPos:()=>aA,getNextListDepth:()=>lA,handleBackspace:()=>dA,handleDelete:()=>hA,hasListBefore:()=>cA,hasListItemAfter:()=>fA,hasListItemBefore:()=>mA,listItemHasSubList:()=>gA,nextListIsDeeper:()=>uA,nextListIsHigher:()=>pA});var aA=(e,t)=>{const{$from:n}=t.selection,r=xS(e,t.schema);let o=null,i=n.depth,s=n.pos,a=null;for(;i>0&&null===a;)o=n.node(i),o.type===r?a=i:(i-=1,s-=1);return null===a?null:{$pos:t.doc.resolve(s),depth:a}},lA=(e,t)=>{const n=aA(e,t);if(!n)return!1;const[,r]=((e,t,n,r=20)=>{const o=e.doc.resolve(n);let i=r,s=null;for(;i>0&&null===s;){const e=o.node(i);(null==e?void 0:e.type.name)===t?s=e:i-=1}return[s,i]})(t,e,n.$pos.pos+4);return r},cA=(e,t,n)=>{const{$anchor:r}=e.selection,o=Math.max(0,r.pos-2),i=e.doc.resolve(o).node();return!(!i||!n.includes(i.type.name))},dA=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!tP(e.state,t)&&cA(e.state,t,n)){const{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),o=[];r.node().descendants((e,n)=>{e.type.name===t&&o.push({node:e,pos:n})});const i=o.at(-1);if(!i)return!1;const s=e.state.doc.resolve(r.start()+i.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},s.end()).joinForward().run()}return!!tP(e.state,t)&&(!!(e=>{const{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)})(e.state)&&e.chain().liftListItem(t).run())},uA=(e,t)=>{const n=lA(e,t),r=aA(e,t);return!(!r||!n)&&n>r.depth},pA=(e,t)=>{const n=lA(e,t),r=aA(e,t);return!(!r||!n)&&n<r.depth},hA=(e,t)=>{if(!tP(e.state,t))return!1;if(!((e,t)=>{const{$from:n,$to:r,$anchor:o}=e.selection;if(t){const n=wP(e=>e.type.name===t)(e.selection);if(!n)return!1;const r=e.doc.resolve(n.pos+1);return o.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)})(e.state,t))return!1;const{selection:n}=e.state,{$from:r,$to:o}=n;return!(!n.empty&&r.sameParent(o))&&(uA(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():pA(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward())},fA=(e,t)=>{var n;const{$anchor:r}=t.selection,o=t.doc.resolve(r.pos-r.parentOffset-2);return o.index()!==o.parent.childCount-1&&(null==(n=o.nodeAfter)?void 0:n.type.name)===e},mA=(e,t)=>{var n;const{$anchor:r}=t.selection,o=t.doc.resolve(r.pos-2);return 0!==o.index()&&(null==(n=o.nodeBefore)?void 0:n.type.name)===e},gA=(e,t,n)=>{if(!n)return!1;const r=xS(e,t.schema);let o=!1;return n.descendants(e=>{e.type===r&&(o=!0)}),o},yA=KM.create({name:"listKeymap",addOptions:()=>({listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}),addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&hA(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&hA(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&dA(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&dA(e,n,r)&&(t=!0)}),t}}}}),xA=new RegExp(`^(\\s*)(${JO})([.)])\\s+(.*)$`),bA=new RegExp(`^(\\s*)(${JO})([.)])\\s+`),wA=/^\s/,vA={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function kA(e){const t=e.trimStart();return vA.bulletItem.test(t)||function(e){return xA.test(e.trimStart())}(t)||vA.heading.test(t)||vA.thematicBreak.test(t)&&!t.startsWith("-")||/^>\s?/.test(t)||vA.codeFence.test(t)}function SA(e){return Object.values(vA).some(t=>t.test(e))}function PA(e){const t=[],n=[];let r=!1;return e.forEach(e=>{if(!r)return""===e.trim()||t.length>0&&kA(e)?(r=!0,void n.push(e)):void t.push(e);n.push(e)}),{paragraphLines:t,blockLines:n}}var MA=new RegExp(`^(${JO})([.)])\\s+(.+)$`);function IA(e){const t=e.split("\n").filter(e=>e.trim().length>0);if(0===t.length)return null;const n=[];for(const r of t){const e=r.trim().match(MA);if(!e)return null;n.push({marker:e[1],content:e[3]})}return function(e){var t;if(0===e.length)return!1;const n=null!=(t=tA(e[0]))?t:"numeric",r=nA(e[0]);if(r<1)return!1;for(let o=0;o<e.length;o++){const t=rA(n,r+o);if(e[o]!==t)return!1}return!0}(n.map(e=>e.marker))?{type:"orderedList",attrs:oA(n[0].marker),content:n.map(e=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:e.content}]}]}))}:null}function EA(e,t,n){const r=[];let o=0;for(;o<e.length;){const i=e[o];if(i.indent===t){const{paragraphLines:s,blockLines:a}=PA(i.contentLines),l=s.join("\n").trim(),c=[];l&&c.push({type:"paragraph",raw:l,tokens:n.inlineTokens(l)});const d=a.join("\n").trim();if(d){const e=n.blockTokens(d);c.push(...e)}let u=o+1;const p=[];for(;u<e.length&&e[u].indent>t;)p.push(e[u]),u+=1;if(p.length>0){const e=EA(p,Math.min(...p.map(e=>e.indent)),n);c.push({type:"list",ordered:!0,start:p[0].number,typeMarker:p[0].type,items:e,raw:p.map(e=>e.raw).join("\n")})}r.push({type:"list_item",raw:i.raw,tokens:c}),o=u}else o+=1}return r}var TA="textStyle",CA=/^(\d+)\.\s$/;function OA(e){const t=e.match(/list-style-type\s*:\s*([^;]+)/i);if(!t)return null;switch(t[1].trim().toLowerCase()){case"upper-roman":return"I";case"lower-roman":return"i";case"upper-alpha":case"upper-latin":return"A";case"lower-alpha":case"lower-latin":return"a";default:return null}}var AA=cI.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>{const t=e.getAttribute("type");if(t)return t;const n=e.getAttribute("style");if(n){const e=OA(n);if(e)return e}const r=e.querySelector("li");if(r){const e=r.getAttribute("style");if(e){const t=OA(e);if(t)return t}}return null}}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,type:n,...r}=e,o=CP(this.options.HTMLAttributes,r);return 1!==t&&(o.start=t),n&&"1"!==n&&(o.type=n),["ol",o,0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{if("list"!==e.type||!e.ordered)return[];const n=e.start||1,r=e.typeMarker,o=e.items?function(e,t){return e.map(e=>{if("list_item"!==e.type)return t.parseChildren([e])[0];const n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if("paragraph"===e.type||"list"===e.type||"blockquote"===e.type||"code"===e.type)n.push(...t.parseChildren([e]));else if("text"===e.type&&e.tokens){const r=t.parseChildren([e]);n.push({type:"paragraph",content:r})}else{const r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:"listItem",content:n}})}(e.items,t):[],i={};return 1!==n&&(i.start=n),r&&(i.type=r),Object.keys(i).length>0?{type:"orderedList",attrs:i,content:o}:{type:"orderedList",content:o}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownTokenizer:{name:"orderedList",level:"block",start:e=>{const t=e.match(bA),n=null==t?void 0:t.index;return void 0!==n?n:-1},tokenize:(e,t,n)=>{var r,o;const i=e.split("\n"),[s,a]=function(e){const t=[];let n=0,r=0;for(;n<e.length;){const o=e[n],i=o.match(xA);if(!i)break;const[,s,a,l,c]=i,d=s.length,u=parseInt(a,10),p=isNaN(u)?tA(a):void 0,h=isNaN(u)?nA(a):u,f=[c];let m=n+1;const g=[o];let y=!1;for(;m<e.length;){const t=e[m];if(t.match(xA))break;if(""===t.trim())g.push(t),f.push(""),y=!0,m+=1;else if(t.match(wA)){const e=t.length-t.trimStart().length,n=d+a.length+1;g.push(t),f.push(t.slice(Math.min(e,n))),m+=1}else{if(y||SA(t))break;g.push(t),f.push(t),m+=1}}t.push({indent:d,number:h,type:p,content:f.join("\n").trim(),contentLines:f,raw:g.join("\n")}),r=m,n=m}return[t,r]}(i);if(0===s.length)return;const l=EA(s,s[0].indent,n);return 0!==l.length?{type:"list",ordered:!0,start:(null==(r=s[0])?void 0:r.number)||1,typeMarker:null==(o=s[0])?void 0:o.type,items:l,raw:i.slice(0,a).join("\n")}:void 0}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(TA)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins:()=>[new Xx({props:{handlePaste:(e,t)=>{var n,r;const o=null==(n=t.clipboardData)?void 0:n.getData("text/html");if(null==o?void 0:o.trim())return!1;const i=null==(r=t.clipboardData)?void 0:r.getData("text/plain");if(!i)return!1;const s=IA(i);if(!s)return!1;try{const t=e.state.schema.nodeFromJSON(s),n=e.state.tr.replaceSelectionWith(t);return e.dispatch(n),!0}catch{return!1}}}})],addInputRules(){const e=(e,t)=>(!t.attrs.type||"1"===t.attrs.type)&&t.childCount+t.attrs.start===+e[1];let t=lI({find:CA,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:e});return(this.options.keepMarks||this.options.keepAttributes)&&(t=lI({find:CA,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(TA)}),joinPredicate:e,editor:this.editor})),[t]}}),RA=/^\s*(\[([( |x])?\])\s$/,NA=cI.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{const t=e.getAttribute("data-checked");return""===t||"true"===t},renderHTML:e=>({"data-checked":e.checked})}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",CP(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{const n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode("paragraph",{},t.parseInline(e.tokens))):e.text?n.push(t.createNode("paragraph",{},[t.createNode("text",{text:e.text})])):n.push(t.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){const r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{var n;return $M(e,t,`- [${(null==(n=e.attrs)?void 0:n.checked)?"x":" "}] `)},addExtensions(){return this.options.nested?[qO(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{const o=document.createElement("li"),i=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),c=e=>{var t,n;a.ariaLabel=(null==(n=null==(t=this.options.a11y)?void 0:t.checkboxLabel)?void 0:n.call(t,e,a.checked))||`Task item checkbox for ${e.textContent||"empty task item"}`};c(e),i.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",e=>e.preventDefault()),a.addEventListener("change",t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked)return void(a.checked=!a.checked);const{checked:o}=t.target;r.isEditable&&"function"==typeof n&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{const t=n();if("number"!=typeof t)return!1;const r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...null==r?void 0:r.attrs,checked:o}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,o)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{o.setAttribute(e,t)}),o.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,i.append(a,s),o.append(i,l),Object.entries(t).forEach(([e,t])=>{o.setAttribute(e,t)});let d=new Set(Object.keys(t));return{dom:o,contentDOM:l,update:e=>{if(e.type!==this.type)return!1;o.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,c(e);const t=OP(e,r.extensionManager.attributes),n=new Set(Object.keys(t)),i=this.options.HTMLAttributes;return d.forEach(e=>{n.has(e)||(e in i?o.setAttribute(e,i[e]):o.removeAttribute(e))}),Object.entries(t).forEach(([e,t])=>{null==t?e in i?o.setAttribute(e,i[e]):o.removeAttribute(e):o.setAttribute(e,t)}),d=n,!0}}}},addInputRules(){return[lI({find:RA,type:this.type,getAttributes:e=>({checked:"x"===e[e.length-1]})})]}}),LA=cI.create({name:"taskList",addOptions:()=>({itemTypeName:"taskItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",CP(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode("taskList",{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;const n=null==(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))?void 0:t.index;return void 0!==n?n:-1},tokenize(e,t,n){const r=e=>{const t=LM(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),createToken:(e,t)=>({type:"taskItem",raw:"",mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:"taskList",raw:t.raw,items:t.items}]:n.blockTokens(e)},o=LM(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),createToken:(e,t)=>({type:"taskItem",raw:"",mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(o)return{type:"taskList",raw:o.raw,items:o.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),$A=(KM.create({name:"listKit",addExtensions(){const e=[];return!1!==this.options.bulletList&&e.push(VO.configure(this.options.bulletList)),!1!==this.options.listItem&&e.push(sA.configure(this.options.listItem)),!1!==this.options.listKeymap&&e.push(yA.configure(this.options.listKeymap)),!1!==this.options.orderedList&&e.push(AA.configure(this.options.orderedList)),!1!==this.options.taskItem&&e.push(NA.configure(this.options.taskItem)),!1!==this.options.taskList&&e.push(LA.configure(this.options.taskList)),e}}),"&nbsp;"),DA=cI.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",CP(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{const n=e.tokens||[];if(1===n.length&&"image"===n[0].type)return t.parseChildren([n[0]]);const r=t.parseInline(n);return 1!==n.length||"text"!==n[0].type||n[0].raw!==$A&&n[0].text!==$A&&" "!==n[0].raw&&" "!==n[0].text||1!==r.length||"text"!==r[0].type||r[0].text!==$A&&" "!==r[0].text?t.createNode("paragraph",void 0,r):t.createNode("paragraph",void 0,[])},renderMarkdown:(e,t,n)=>{var r,o;if(!e)return"";const i=Array.isArray(e.content)?e.content:[];if(0===i.length){const e=Array.isArray(null==(r=null==n?void 0:n.previousNode)?void 0:r.content)?n.previousNode.content:[];return"paragraph"===(null==(o=null==n?void 0:n.previousNode)?void 0:o.type)&&0===e.length?$A:""}return t.renderChildren(i)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),jA=cI.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""});function BA(e={}){return new Xx({view:t=>new zA(t,e)})}var zA=class{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(n=t.width)&&void 0!==n?n:1,this.color=!1===t.color?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r=this.editorView.dom,o=r.getBoundingClientRect(),i=o.width/r.offsetWidth,s=o.height/r.offsetHeight;if(n){let n=t.nodeBefore,r=t.nodeAfter;if(n||r){let t=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(t){let o=t.getBoundingClientRect(),i=n?o.bottom:o.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let a=this.width/2*s;e={left:o.left,right:o.right,top:i-a,bottom:i+a}}}}if(!e){let t=this.editorView.coordsAtPos(this.cursorPos),n=this.width/2*i;e={left:t.left-n,right:t.left+n,top:t.top,bottom:t.bottom}}let a,l,c=this.editorView.dom.offsetParent;if(this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n),!c||c==document.body&&"static"==getComputedStyle(c).position)a=-pageXOffset,l=-pageYOffset;else{let e=c.getBoundingClientRect(),t=e.width/c.offsetWidth,n=e.height/c.offsetHeight;a=e.left-c.scrollLeft*t,l=e.top-c.scrollTop*n}this.element.style.left=(e.left-a)/i+"px",this.element.style.top=(e.top-l)/s+"px",this.element.style.width=(e.right-e.left)/i+"px",this.element.style.height=(e.bottom-e.top)/s+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,t,e):r;if(t&&!o){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=hx(this.editorView.state.doc,e,this.editorView.dragging.slice);null!=t&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},_A=class e extends Ox{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):Ox.near(r)}content(){return jg.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new e(t.resolve(n.pos))}getBookmark(){return new FA(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0!=n)for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||WA(e.type))return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||WA(e.type))return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&e.valid(t))return t;let o=t.pos,i=null;for(let r=t.depth;;r--){let s=t.node(r);if(n>0?t.indexAfter(r)<s.childCount:t.index(r)>0){i=s.child(n>0?t.indexAfter(r):t.index(r)-1);break}if(0==r)return null;o+=n;let a=t.doc.resolve(o);if(e.valid(a))return a}for(;;){let s=n>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!Dx.isSelectable(i)){t=t.doc.resolve(o+i.nodeSize*n),r=!1;continue e}break}i=s,o+=n;let a=t.doc.resolve(o);if(e.valid(a))return a}return null}}};_A.prototype.visible=!1,_A.findFrom=_A.findGapCursorFrom,Ox.jsonID("gapcursor",_A);var FA=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return _A.valid(t)?new _A(t):Ox.near(t)}};function WA(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}var HA=rS({ArrowLeft:UA("horiz",-1),ArrowRight:UA("horiz",1),ArrowUp:UA("vert",-1),ArrowDown:UA("vert",1)});function UA(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,o){let i=e.selection,s=t>0?i.$to:i.$from,a=i.empty;if(i instanceof Lx){if(!o.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=e.doc.resolve(t>0?s.after():s.before())}let l=_A.findGapCursorFrom(s,t,a);return!!l&&(r&&r(e.tr.setSelection(new _A(l))),!0)}}function VA(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!_A.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&Dx.isSelectable(e.state.doc.nodeAt(o.inside)))&&(e.dispatch(e.state.tr.setSelection(new _A(r))),!0)}function KA(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof _A))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let o=Ag.empty;for(let s=r.length-1;s>=0;s--)o=Ag.from(r[s].createAndFill(null,o));let i=e.state.tr.replace(n.pos,n.pos,new jg(o,0,0));return i.setSelection(Lx.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function qA(e){if(!(e.selection instanceof _A))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",gk.create(e.doc,[hk.widget(e.selection.head,t,{key:"gapcursor"})])}var YA=200,XA=function(){};XA.prototype.append=function(e){return e.length?(e=XA.from(e),!this.length&&e||e.length<YA&&this.leafAppend(e)||this.length<YA&&e.leafPrepend(this)||this.appendInner(e)):this},XA.prototype.prepend=function(e){return e.length?XA.from(e).append(this):this},XA.prototype.appendInner=function(e){return new GA(this,e)},XA.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?XA.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},XA.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},XA.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},XA.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},XA.from=function(e){return e instanceof XA?e:e&&e.length?new JA(e):XA.empty};var JA=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o<n;o++)if(!1===e(this.values[o],r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var o=t-1;o>=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=YA)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=YA)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(XA);XA.empty=new JA([]);var GA=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var o=this.left.length;return!(t<o&&!1===this.left.forEachInner(e,t,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(e,Math.min(t,o),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(XA),ZA=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(0==this.eventCount)return null;let r,o,i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}n&&(r=this.remapping(i,this.items.length),o=r.maps.length);let s,a,l=t.tr,c=[],d=[];return this.items.forEach((t,n)=>{if(!t.step)return r||(r=this.remapping(i,n+1),o=r.maps.length),o--,void d.push(t);if(r){d.push(new QA(t.map));let e,n=t.step.map(r.slice(o));n&&l.maybeStep(n).doc&&(e=l.mapping.maps[l.mapping.maps.length-1],c.push(new QA(e,void 0,void 0,c.length+d.length))),o--,e&&r.appendMap(e,o)}else l.maybeStep(t.step);return t.selection?(s=r?t.selection.map(r.slice(o)):t.selection,a=new e(this.items.slice(0,i).append(d.reverse().concat(c)),this.eventCount-1),!1):void 0},this.items.length,0),{remaining:a,transform:l,selection:s}}addTransform(t,n,r,o){let i=[],s=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let e=0;e<t.steps.length;e++){let r,c=t.steps[e].invert(t.docs[e]),d=new QA(t.mapping.maps[e],c,n);(r=l&&l.merge(d))&&(d=r,e?i.pop():a=a.slice(0,a.length-1)),i.push(d),n&&(s++,n=void 0),o||(l=d)}let c=s-r.depth;return c>tR&&(a=function(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&0==t--)return n=r,!1}),e.slice(n)}(a,c),s-=c),new e(a.append(i),s)}remapping(e,t){let n=new Uy;return this.items.forEach((t,r)=>{let o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,o)},e,t),n}addMaps(t){return 0==this.eventCount?this:new e(this.items.append(t.map(e=>new QA(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),i=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(e=>{e.selection&&a--},o);let l=n;this.items.forEach(e=>{let n=i.getMirror(--l);if(null==n)return;s=Math.min(s,n);let o=i.maps[n];if(e.step){let s=t.steps[n].invert(t.docs[n]),c=e.selection&&e.selection.map(i.slice(l+1,n));c&&a++,r.push(new QA(o,s,c))}else r.push(new QA(o))},o);let c=[];for(let e=n;e<s;e++)c.push(new QA(i.maps[e]));let d=new e(this.items.slice(0,o).append(c).append(r),a);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,o=[],i=0;return this.items.forEach((e,s)=>{if(s>=t)o.push(e),e.selection&&i++;else if(e.step){let t=e.step.map(n.slice(r)),s=t&&t.getMap();if(r--,s&&n.appendMap(s,r),t){let a=e.selection&&e.selection.map(n.slice(r));a&&i++;let l,c=new QA(s.invert(),t,a),d=o.length-1;(l=o.length&&o[d].merge(c))?o[d]=l:o.push(c)}}else e.map&&r--},this.items.length,0),new e(XA.from(o.reverse()),i)}};ZA.empty=new ZA(XA.empty,0);var QA=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},eR=class{constructor(e,t,n,r,o){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}},tR=20;function nR(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach((e,n,r,o)=>t.push(r,o));return t}function rR(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}var oR=!1,iR=null;function sR(e){let t=e.plugins;if(iR!=t){oR=!1,iR=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){oR=!0;break}}return oR}var aR=new Zx("history"),lR=new Zx("closeHistory");function cR(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Xx({key:aR,state:{init:()=>new eR(ZA.empty,ZA.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let o,i=n.getMeta(aR);if(i)return i.historyState;n.getMeta(lR)&&(e=new eR(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(aR))return s.getMeta(aR).redo?new eR(e.done.addTransform(n,void 0,r,sR(t)),e.undone,nR(n.mapping.maps),e.prevTime,e.prevComposition):new eR(e.done,e.undone.addTransform(n,void 0,r,sR(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new eR(e.done.rebased(n,o),e.undone.rebased(n,o),rR(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new eR(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),rR(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let o=n.getMeta("composition"),i=0==e.prevTime||!s&&e.prevComposition!=o&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let o=0;o<t.length;o+=2)e<=t[o+1]&&r>=t[o]&&(n=!0)}),n}(n,e.prevRanges)),a=s?rR(e.prevRanges,n.mapping):nR(n.mapping.maps);return new eR(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,sR(t)),ZA.empty,a,n.time,null==o?e.prevComposition:o)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?uR:"historyRedo"==n?pR:null;return!(!r||!e.editable)&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function dR(e,t){return(n,r)=>{let o=aR.getState(n);if(!o||0==(e?o.undone:o.done).eventCount)return!1;if(r){let i=function(e,t,n){let r=sR(t),o=aR.get(t).spec.config,i=(n?e.undone:e.done).popEvent(t,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),a=(n?e.done:e.undone).addTransform(i.transform,t.selection.getBookmark(),o,r),l=new eR(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(s).setMeta(aR,{redo:n,historyState:l})}(o,n,e);i&&r(t?i.scrollIntoView():i)}return!0}}var uR=dR(!1,!0),pR=dR(!0,!0),hR=(dR(!1,!1),dR(!0,!1),KM.create({name:"characterCount",addOptions:()=>({limit:null,autoTrim:!0,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(e=>""!==e).length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){const e=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new Xx({key:new Zx("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const o=this.options.limit,i=this.options.autoTrim;if(null==o||0===o||!1===i)return void(e=!0);const s=this.storage.characters({node:r.doc});if(s>o){const t=0,n=s-o;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const i=r.tr.deleteRange(t,n);return e=!0,i}e=!0},filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;const r=this.storage.characters({node:t.doc}),o=this.storage.characters({node:e.doc});if(o<=n)return!0;if(r>n&&o>n&&o<=r)return!0;if(r>n&&o>n&&o>r)return!1;if(!e.getMeta("paste"))return!1;const i=e.selection.$head.pos,s=i-(o-n),a=i;return e.deleteRange(s,a),!(this.storage.characters({node:e.doc})>n)}})]}}),KM.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[BA(this.options)]}})),fR=(KM.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new Xx({key:new Zx("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=t,i=[];if(!n||!r)return gk.create(e,[]);let s=0;"deepest"===this.options.mode&&e.descendants((e,t)=>{if(!e.isText)return o>=t&&o<=t+e.nodeSize-1&&void(s+=1)});let a=0;return e.descendants((e,t)=>!e.isText&&(o>=t&&o<=t+e.nodeSize-1&&(a+=1,"deepest"===this.options.mode&&s-a>0||"shallowest"===this.options.mode&&a>1?"deepest"===this.options.mode:void i.push(hk.node(t,t+e.nodeSize,{class:this.options.className}))))),gk.create(e,i)}}})]}}),KM.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Xx({props:{decorations:qA,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&_A.valid(n)?new _A(n):null,handleClick:VA,handleKeyDown:HA,handleDOMEvents:{beforeinput:KA}}})],extendNodeSchema(e){var t;return{allowGapCursor:null!=(t=MP(vP(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))?t:null}}})),mR="placeholder",gR=new Zx("tiptap__placeholder");function yR(e){const{editor:t,placeholder:n,dataAttribute:r,pos:o,node:i,isEmptyDoc:s,hasAnchor:a,classes:{emptyNode:l,emptyEditor:c}}=e,d=[l];return s&&d.push(c),hk.node(o,o+i.nodeSize,{class:d.join(" "),[r]:"function"==typeof n?n({editor:t,node:i,pos:o,hasAnchor:a}):n})}function xR(e,t){return"function"==typeof e?e(t):e}function bR({editor:e,options:t,dataAttribute:n,doc:r,selection:o,from:i,to:s}){const{anchor:a}=o,l=[],c=e.isEmpty;return r.nodesBetween(i,s,(r,o)=>{const i=a>=o&&a<=o+r.nodeSize,s=!r.isLeaf&&qP(r);return r.type.isTextblock?(!i&&t.showOnlyCurrent||!s||l.push(yR({editor:e,isEmptyDoc:c,dataAttribute:n,hasAnchor:i,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:xR(t.emptyNodeClass,{editor:e,node:r,pos:o,hasAnchor:i})},node:r,pos:o})),t.includeChildren):t.includeChildren}),l}function wR({editor:e,options:t,dataAttribute:n,doc:r,selection:o}){if(!e.isEditable&&t.showOnlyWhenEditable)return null;const{anchor:i}=o,s=[],a=e.isEmpty;if(t.showOnlyCurrent&&!t.includeChildren){const o=r.resolve(i),l=o.depth>0?o.node(1):o.nodeAfter,c=o.depth>0?o.before(1):i;if(l&&l.type.isTextblock&&qP(l)){const r=i>=c&&i<=c+l.nodeSize;s.push(yR({editor:e,isEmptyDoc:a,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:xR(t.emptyNodeClass,{editor:e,node:l,pos:c,hasAnchor:r})},node:l,pos:c}))}}else s.push(...bR({editor:e,options:t,dataAttribute:n,doc:r,selection:o,from:0,to:r.content.size}));return gk.create(r,s)}function vR(e,t){var n;const r=e.resolve(t);if(0===r.depth){const e=null!=(n=r.nodeAfter)?n:r.nodeBefore;if(!e)return{from:t,to:t};const o=r.nodeAfter?t:t-e.nodeSize;return{from:o,to:o+e.nodeSize}}const o=r.before(1);return{from:o,to:o+r.node(1).nodeSize}}function kR(e,t){return{from:Math.max(0,t.from-1),to:Math.min(e.content.size,t.to-1)}}function SR(e,t){const n=function(e,t,n){const r=[];return e.forEach((e,o)=>{const i=o,s=i+e.nodeSize;i+1<n&&s+1>t&&r.push({from:i,to:s})}),r}(e,t.from,t.to);return n.push(kR(e,vR(e,t.from))),t.to>t.from?n.push(kR(e,vR(e,Math.min(t.to,e.content.size+1)-1))):t.from<e.content.size+1&&n.push(kR(e,vR(e,Math.min(t.from+1,e.content.size)))),n}function PR(e,t,n){const r=[];if(e.docChanged){const t=_P(e);for(const e of t)r.push(...SR(n.doc,e.newRange))}return e.selectionSet&&(r.push(kR(n.doc,vR(n.doc,e.mapping.map(t.selection.anchor)))),r.push(kR(n.doc,vR(n.doc,n.selection.anchor)))),function(e){if(0===e.length)return[];const t=[...e].sort((e,t)=>e.from-t.from),n=[{...t[0]}];for(let r=1;r<t.length;r+=1){const e=n[n.length-1],o=t[r];o.from<=e.to?e.to=Math.max(e.to,o.to):n.push({...o})}return n}(r)}function MR(e,t,n){const r=Math.max(0,Math.min(e,n.content.size));return{from:r,to:Math.max(r,Math.min(t,n.content.size))}}function IR({editor:e,options:t,dataAttribute:n}){return{init(r,o){const i=wR({editor:e,options:t,dataAttribute:n,doc:o.doc,selection:o.selection});return null!=i?i:gk.empty},apply:(r,o,i,s)=>r.docChanged||r.selectionSet?function({decorations:e,ranges:t,editor:n,options:r,dataAttribute:o,doc:i,selection:s}){let a=e;for(const l of t){const{from:e,to:t}=MR(l.from,l.to,i),c=a.find(e,t).filter(n=>n.from>=e&&n.to<=t);c.length&&(a=a.remove(c));const d=bR({editor:n,options:r,dataAttribute:o,doc:i,selection:s,from:e,to:t});d.length&&(a=a.add(i,d))}return a}({decorations:o.map(r.mapping,r.doc),ranges:PR(r,i,s),editor:e,options:t,dataAttribute:n,doc:s.doc,selection:s.selection}):o}}function ER({editor:e,options:t}){const n=t.dataAttribute?`data-${r=t.dataAttribute,r.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}`:`data-${mR}`;var r;const o=t.showOnlyCurrent&&!t.includeChildren;return new Xx({key:gR,...o?{}:{state:IR({editor:e,options:t,dataAttribute:n})},props:{decorations:o?({doc:r,selection:o})=>wR({editor:e,options:t,dataAttribute:n,doc:r,selection:o}):n=>{var r;return t.showOnlyWhenEditable&&!e.isEditable?gk.empty:null!=(r=gR.getState(n))?r:gk.empty}}})}KM.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:mR,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[ER({editor:this.editor,options:this.options})]}}),KM.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){const{editor:e,options:t}=this;return e.options.injectCSS&&"undefined"!=typeof document&&PM(".ProseMirror:not(.ProseMirror-focused) *::selection {\n background: transparent;\n}\n\n.ProseMirror:not(.ProseMirror-focused) *::-moz-selection {\n background: transparent;\n}",e.options.injectNonce,"selection"),[new Xx({key:new Zx("selection"),props:{decorations:n=>n.selection.empty||e.isFocused||!e.isEditable||YP(n.selection)||e.view.dragging?null:gk.create(n.doc,[hk.inline(n.selection.from,n.selection.to,{class:t.className})])}})]}});function TR({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(null==t?void 0:t.type)===e}var CR=KM.create({name:"trailingNode",addOptions:()=>({node:void 0,notAfter:[]}),addProseMirrorPlugins(){var e;const t=new Zx(this.name),n=this.options.node||(null==(e=this.editor.schema.topNodeType.contentMatch.defaultType)?void 0:e.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(n).includes(e.name));return[new Xx({key:t,appendTransaction:(e,r,o)=>{const{doc:i,tr:s,schema:a}=o,l=t.getState(o),c=i.content.size,d=a.nodes[n];if(!e.some(e=>e.getMeta("skipTrailingNode"))&&l)return s.insert(c,d.create())},state:{init:(e,t)=>!TR({node:t.tr.doc.lastChild,types:r}),apply:(e,t)=>{if(!e.docChanged)return t;if(e.getMeta("__uniqueIDTransaction"))return t;return!TR({node:e.doc.lastChild,types:r})}}})]}}),OR=KM.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>uR(e,t),redo:()=>({state:e,dispatch:t})=>pR(e,t)}),addProseMirrorPlugins(){return[cR(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),AR=KM.create({name:"starterKit",addExtensions(){var e,t,n,r;const o=[];return!1!==this.options.bold&&o.push(hE.configure(this.options.bold)),!1!==this.options.blockquote&&o.push(AO.configure(this.options.blockquote)),!1!==this.options.bulletList&&o.push(VO.configure(this.options.bulletList)),!1!==this.options.code&&o.push(LO.configure(this.options.code)),!1!==this.options.codeBlock&&o.push(jO.configure(this.options.codeBlock)),!1!==this.options.document&&o.push(BO.configure(this.options.document)),!1!==this.options.dropcursor&&o.push(hR.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&o.push(fR.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&o.push(zO.configure(this.options.hardBreak)),!1!==this.options.heading&&o.push(_O.configure(this.options.heading)),!1!==this.options.undoRedo&&o.push(OR.configure(this.options.undoRedo)),!1!==this.options.horizontalRule&&o.push(FO.configure(this.options.horizontalRule)),!1!==this.options.italic&&o.push(xE.configure(this.options.italic)),!1!==this.options.listItem&&o.push(sA.configure(this.options.listItem)),!1!==this.options.listKeymap&&o.push(yA.configure(null==(e=this.options)?void 0:e.listKeymap)),!1!==this.options.link&&o.push(gC.configure(null==(t=this.options)?void 0:t.link)),!1!==this.options.orderedList&&o.push(AA.configure(this.options.orderedList)),!1!==this.options.paragraph&&o.push(DA.configure(this.options.paragraph)),!1!==this.options.strike&&o.push(bC.configure(this.options.strike)),!1!==this.options.text&&o.push(jA.configure(this.options.text)),!1!==this.options.underline&&o.push(TC.configure(null==(n=this.options)?void 0:n.underline)),!1!==this.options.trailingNode&&o.push(CR.configure(null==(r=this.options)?void 0:r.trailingNode)),o}}),RR=new WeakMap;function NR(e,t){const n=function(e){const t=RR.get(e);if(t)return t;const n={api:null,disposeApiSubscription:null,listeners:new Set};return RR.set(e,n),n}(e);return n.disposeApiSubscription?.(),n.api=t,n.disposeApiSubscription=t.subscribe(()=>{$R(n)}),$R(n),()=>{n.api===t&&(n.disposeApiSubscription?.(),n.disposeApiSubscription=null,n.api=null,$R(n))}}function LR(e){return RR.get(e)?.api??null}function $R(e){for(const t of e.listeners)t()}function DR(e){const t=e.content.map(e=>"orderedList"===e.type||"bulletList"===e.type?{blockType:e.type,isEmptyTrailingParagraph:!1}:"blockquote"===e.type?{blockType:"blockquote",isEmptyTrailingParagraph:!1}:"paragraph"===e.type?{blockType:"paragraph",isEmptyTrailingParagraph:0===(e.content?.length??0)}:null).filter(e=>null!==e);if(0===t.length)return"paragraph";const n=t.some(({blockType:e})=>"paragraph"!==e)?t.filter(({isEmptyTrailingParagraph:e})=>!e):t,r=n[0]?.blockType??"paragraph";return n.every(({blockType:e})=>e===r)?r:"mixed"}function jR(e,t){if(DR(e)===t)return e;const n=function(e){const t=[],n=e=>{if("paragraph"!==e.type)if("codeBlock"!==e.type)for(const t of e.content??[])n(t);else t.push({type:"paragraph",content:e.content??[]});else t.push(e)},r=e.at(-1),o=e.length>1&&"paragraph"===r?.type&&0===(r.content?.length??0)&&e.slice(0,-1).some(e=>"orderedList"===e.type||"bulletList"===e.type||"blockquote"===e.type)?e.slice(0,-1):e;for(const i of o)n(i);return t.length>0?t:[{type:"paragraph"}]}(e.content),r="paragraph"===t?n:"blockquote"===t?[{type:"blockquote",content:n}]:[{type:t,content:n.map(e=>({type:"listItem",content:[e]}))}];return km({...e,content:r})}var BR={bold:["bold","strong"],italic:["italic","em"],strike:["strike","s"],underline:["underline","u"]};function zR(e,t){const n=BR[t];let r=!1,o=!1;return HR(e.content,(e,t)=>{"text"!==e.type||!e.text||t.insideCodeBlock||e.marks?.some(e=>"code"===e.type)||(e.marks?.some(e=>n.includes(e.type))?r=!0:o=!0)}),r&&o?"mixed":r}function _R(e,t,n){const r=BR[t],o=UR(e.content,(e,o)=>{if("text"!==e.type||!e.text)return e;const i=e.marks??[],s=i.filter(e=>r.includes(e.type));if(n&&(o.insideCodeBlock||i.some(e=>"code"===e.type)))return e;if(n&&1===s.length&&s[0]?.type===t)return e;const a=i.filter(e=>!r.includes(e.type)),l=n?[...a,{type:t}]:a;return i.length===l.length&&i.every((e,t)=>e===l[t])?e:{...e,marks:l.length>0?l:void 0}});return o.changed?km({...e,content:o.nodes}):e}function FR(e,t){const n=UR(e.content,(e,n)=>{if("text"!==e.type||!e.text)return e;const r=e.marks??[],o=r.filter(e=>"link"===e.type);if(null===t){if(0===o.length)return e;const t=r.filter(e=>"link"!==e.type);return{...e,marks:t.length>0?t:void 0}}if(n.insideCodeBlock||r.some(e=>"code"===e.type))return e;if(1===o.length&&o[0]?.attrs?.href===t)return e;const i=o[0];return{...e,marks:[...r.filter(e=>"link"!==e.type),{type:"link",attrs:{...i?.attrs,href:t}}]}});return n.changed?km({...e,content:n.nodes}):e}function WR(e){const t=UR(e.content,e=>"text"===e.type&&e.marks&&e.marks.length>0?{...e,marks:void 0}:function(e){if("paragraph"!==e.type||void 0===e.attrs?.textAlign)return e;const t={...e.attrs};return delete t.textAlign,{...e,attrs:Object.keys(t).length>0?t:void 0}}(e));return t.changed?km({...e,content:t.nodes}):e}function HR(e,t,n=!1){for(const r of e)t(r,{insideCodeBlock:n}),r.content&&HR(r.content,t,n||"codeBlock"===r.type)}function UR(e,t,n=!1){let r=!1;return{nodes:e.map(e=>{const o=t(e,{insideCodeBlock:n}),i=o.content;if(!i)return o!==e&&(r=!0),o;const s=UR(i,t,n||"codeBlock"===o.type);return s.changed?(r=!0,{...o,content:s.nodes}):(o!==e&&(r=!0),o)}),changed:r}}function VR(e){try{return e.view.dom.isConnected}catch{return!1}}function KR(e){!e.isDestroyed&&VR(e)&&(e.view.dom.focus(),e.view.focus())}function qR(e){if(!VR(e))return{type:null,text:null};const t=function(e){if(!e)return{type:null,text:null};const t=window.getSelection();if(!t||0===t.rangeCount)return{type:t?.type??null,text:null};const n=t.anchorNode,r=t.focusNode,o=e instanceof HTMLElement?e:e.parentElement,i=!!n&&!!r&&null!==o&&o.contains(n)&&o.contains(r);return{type:i?t.type:null,text:i?t.toString():null}}(e.view.dom);if(null!==t.type)return t;const n=e.state.selection;return{type:n.empty?"Caret":"Range",text:n.empty?"":e.state.doc.textBetween(n.from,n.to,"\n")}}var YR={s:14,m:16,l:20,xl:28},XR=YR.m,JR={[YR.s]:20,[YR.m]:24,[YR.l]:28,[YR.xl]:36};function GR(e,t=XR){return"number"==typeof e&&Number.isFinite(e)?Math.max(1,e):t}function ZR(e,t){return mg(t,e).cssFamily}function QR(e){return GR(e)}function eN(e){const t=GR(e);return JR[t]??Math.ceil(1.4*t)}function tN(e,t=1){return Math.max(1,Math.ceil(eN(e)*t))}function nN(e){switch(e){case"middle":return"center";case"end":return"right";default:return"left"}}function rN(e,t,n,r){if(0===e.getText().trim().length)return iN(t,r);const o=function(e,t){const n=e.ownerDocument.defaultView?.getComputedStyle(e);return dN(e.ownerDocument).measureElement(e,t,n)}(e.view.dom,{shape:t,fontCatalog:n,...aN(t,r)});return!r&&e.view.dom.scrollHeight>t.props.h+1&&(o.h=Math.max(o.h,e.view.dom.scrollHeight)),sN(t,o,r)}function oN(e,t,n,r){return 0===vm(e).trim().length?iN(t,r):sN(t,(o=function(e){return e.content.map(e=>Cm(e)).join("")}(e),i={...aN(t,r),shape:t,fontCatalog:n},dN(document).measureHtml(o,i)),r);var o,i}function iN(e,t){const n=t?t.minWidth:e.props.autoSize?16:e.props.w,r=tN(e.props.size);if(e.props.w!==n||e.props.h!==r)return{w:n,h:r}}function sN(e,t,n){const r=n?Math.min(n.maxWidth,Math.max(n.minWidth,Math.ceil(t.w+2*n.paddingInline))):e.props.autoSize?Math.max(16,Math.ceil(t.w)):e.props.w,o=Math.max(tN(e.props.size),Math.ceil(t.h));if(r!==e.props.w||o!==e.props.h)return{w:r,h:o}}function aN(e,t){if(t){const e=Gm(t,t.maxWidth);return{maxWidth:Math.max(1,t.maxWidth-2*e)}}return e.props.autoSize?{}:{width:e.props.w}}var lN=class{ownerDocument;element;constructor(e){this.ownerDocument=e,this.element=e.createElement("div"),this.element.setAttribute("aria-hidden","true"),this.element.style.position="absolute",this.element.style.left="-10000px",this.element.style.top="0",this.element.style.visibility="hidden",this.element.style.pointerEvents="none",e.body.appendChild(this.element)}measureHtml(e,t){const n=this.prepareElement(t);return n.innerHTML=e,this.measurePreparedElement(n)}measureElement(e,t,n){const r=this.prepareElement(t);return r.replaceChildren(...Array.from(e.childNodes).map(e=>e.cloneNode(!0))),uN(r,"whiteSpace",n?.whiteSpace),uN(r,"overflowWrap",n?.overflowWrap),uN(r,"lineHeight",n?.lineHeight),uN(r,"letterSpacing",n?.letterSpacing),uN(r,"textAlign",n?.textAlign),this.measurePreparedElement(r)}prepareElement(e){const t=this.element;return t.removeAttribute("contenteditable"),t.className="",t.textContent="",e?.shape&&e.fontCatalog&&function(e,t,n){e.className="land-text-editor__content",e.dir="auto",e.style.color=E(t.props.color),e.style.fontFamily=ZR(t.props.font,n),e.style.fontSize=`${QR(t.props.size)}px`,e.style.lineHeight=`${eN(t.props.size)}px`,e.style.textAlign=nN(t.props.textAlign)}(t,e.shape,e.fontCatalog),t.style.position="absolute",t.style.left="-10000px",t.style.top="0",t.style.visibility="hidden",t.style.pointerEvents="none",t.style.width="number"==typeof e?.width?`${e.width}px`:"max-content",t.style.minWidth="0",t.style.height="auto",t.style.minHeight="0",t.style.maxHeight="none",t.style.maxWidth="number"==typeof e?.width?`${e.width}px`:"number"==typeof e?.maxWidth?`${e.maxWidth}px`:"none",t}measurePreparedElement(e){return e.querySelectorAll("p").forEach(e=>{e instanceof HTMLElement&&(e.style.margin="0")}),[e,...Array.from(e.querySelectorAll("*")).filter(e=>e instanceof HTMLElement)].reduce((e,t)=>{const n=t.getBoundingClientRect();return{w:Math.max(e.w,n.width,t.scrollWidth,t.offsetWidth),h:Math.max(e.h,n.height,t.scrollHeight,t.offsetHeight)}},{w:0,h:0})}},cN=new WeakMap;function dN(e){const t=cN.get(e);if(t)return t;const n=new lN(e);return cN.set(e,n),n}function uN(e,t,n){n&&"normal"!==n&&"auto"!==n&&(e.style[t]=n)}function pN(e,t,n){if(t.isDestroyed()||!t.isConnected())return;const r=t.measure(n);r&&fN(e,n,r,"user")}function hN(e,t,n,r="system"){const o=oN(t.props.richText,t,n,og(e,t));o&&fN(e,t,o,r)}function fN(e,t,n,r){const o=e.shapes.get(t.id);Hm(o)&&o.props.w===n.w&&o.props.h===n.h||e.commands.updateShapes([{id:t.id,props:n}],{source:r})}var mN=/[;{}<>\u0000-\u001f\u007f]/u,gN=/(?:url|expression)\s*\(|!\s*important|@\s*import|javascript\s*:/iu;function yN({editor:e,fontCatalog:t,landEditor:n,shapeId:r}){const o=()=>{const e=n.shapes.get(r);return Hm(e)?e:null},i={shapeId:r,getSnapshot(){if(e.isDestroyed)return null;const n=o();return n?function({editor:e,fontCatalog:t,shape:n}){const r=e.state.selection,o=function(e){const{selection:t,doc:n}=e.state;return t.empty?{from:0,to:n.content.size}:{from:t.from,to:t.to}}(e),i=r.empty?"shape":"selection",s=T(n.props.color),a=C(n.props.backgroundColor)?null:T(n.props.backgroundColor),l=n.props.textAlign;return{shapeId:n.id,target:i,bold:SN(e,o,"bold"),italic:SN(e,o,"italic"),strike:SN(e,o,"strike"),underline:SN(e,o,"underline"),blockType:PN(e,o),color:MN(e,o,"color",s),backgroundColor:MN(e,o,"backgroundColor",0===e.state.doc.textContent.length?a:null),font:CN(MN(e,o,"fontFamily",n.props.font),e=>function(e,t){return t.fontOptions.find(t=>t.cssFamily===e)?.id??e}(e,t)),size:CN(MN(e,o,"fontSize",n.props.size),e=>function(e,t){if("number"==typeof e)return e;const n=Number.parseFloat(e);return Number.isFinite(n)&&n>0?n:t}(e,n.props.size)),textAlign:IN(e,o,l),linkHref:EN(e,o),canSetLink:!r.empty||e.state.doc.textContent.length>0}}({editor:e,fontCatalog:t,shape:n}):null},subscribe(t){if(e.isDestroyed)return()=>{};const o=()=>t();e.on("transaction",o),e.on("focus",o),e.on("blur",o);const i=le(`TextFormattingApi(${r})`,n.shapes.getSignal(r),o,{fireImmediately:!1});return()=>{i(),e.off("transaction",o),e.off("focus",o),e.off("blur",o)}},focus(){e.isDestroyed||e.commands.focus()},toggle:t=>function(e,t,n){if(e.isDestroyed||void 0===e.schema.marks[t])return!1;const r=e.state.selection;if(!r.empty)return e.chain().focus().toggleMark(t).run();const o=!0!==n?.[t];if(0===e.state.doc.textContent.length){const n=e.chain().focus();return(o?n.setMark(t):n.unsetMark(t)).run()}let i=e.chain().focus().selectAll();return i=o?i.setMark(t):i.unsetMark(t),i=i.setTextSelection(kN(r)),i=o?i.setMark(t):i.unsetMark(t),i.run()}(e,t,i.getSnapshot()),setBlockType:t=>function(e,t){if(e.isDestroyed)return!1;const n=e.state.selection;if(n.empty&&e.state.doc.textContent.length>0){const r=e.getJSON(),o=jR(r,t);if(o===r)return!1;const i=function(e,t,n){const r=e.schema.nodeFromJSON(t);let o=Math.max(0,n),i=1,s=!1;return r.descendants((e,t)=>!s&&e.isText&&e.text?o<=e.text.length?(i=t+o,s=!0,!1):(o-=e.text.length,i=t+e.text.length,!1):!s),i}(e,o,function(e,t){let n=0,r=!1;return e.state.doc.descendants((e,o)=>!r&&e.isText&&e.text?t<=o+e.text.length?(n+=Math.max(0,t-o),r=!0,!1):(n+=e.text.length,!1):!r),n}(e,n.from));return e.chain().focus().setContent(o).setTextSelection(i).run()}let r=e.chain().focus();r=r.clearNodes(),r="orderedList"===t?r.toggleOrderedList():"bulletList"===t?r.toggleBulletList():"blockquote"===t?r.toggleBlockquote():r.setParagraph();return r.run()}(e,t),setColor(t){if(null!==t&&!ON(t))return!1;const r=o();return!!r&&function({editor:e,landEditor:t,shape:n,color:r}){if(e.isDestroyed||void 0===e.schema.marks.textStyle)return!1;if(!e.state.selection.empty)return null===r?e.chain().focus().unsetColor().run():e.chain().focus().setColor(r).run();const o=bN(e,"color");null!==r&&vN(t,n,{color:S(r)});return o||null!==r}({editor:e,landEditor:n,shape:r,color:t})},setBackgroundColor(t){if(null!==t&&!ON(t))return!1;const r=o();return!!r&&function({editor:e,landEditor:t,shape:n,color:r}){if(e.isDestroyed||void 0===e.schema.marks.textStyle)return!1;const o=e.state.selection,i=e=>null===r?e.unsetBackgroundColor():e.setBackgroundColor(r);if(!o.empty)return vN(t,n,{backgroundColor:S("transparent")}),i(e.chain().focus()).run();const s=i(i(e.chain().focus().selectAll()).setTextSelection(kN(o))).run();return vN(t,n,{backgroundColor:S(r??"transparent")}),s}({editor:e,landEditor:n,shape:r,color:t})},setFont(r){const i=o();if(!i)return!1;if(null===r)return xN({editor:e,font:null,fontFamily:null,landEditor:n,shape:i});const s=t.fontOptions.find(e=>e.id===r);return!!s&&(yg(r,t).then(()=>{if(e.isDestroyed)return;const r=o();r&&hN(n,r,t,"system")}),xN({editor:e,fontFamily:s.cssFamily,font:r,landEditor:n,shape:i}))},setSize(t){const r=null===t?null:Math.round(1e3*t)/1e3;if(null!==t&&(!Number.isFinite(t)||t<1||t>512||null===r||Math.abs(t-r)>Number.EPSILON*Math.max(1,Math.abs(t))))return!1;const i=o();return!!i&&function({editor:e,landEditor:t,shape:n,size:r}){if(e.isDestroyed||void 0===e.schema.marks.textStyle)return!1;const o=e.state.selection,i=null===r?null:`${r}px`,s=null===r?null:`${eN(r)}px`,a=e=>null===i||null===s?e.unsetFontSize().unsetLineHeight():e.setFontSize(i).setLineHeight(s);if(!o.empty)return a(e.chain().focus()).run();const l=function(e){const t=e.state.selection;let n=e.chain().focus();e.state.doc.textContent.length>0&&(n=n.selectAll());return wN(n.unsetFontSize().unsetLineHeight().setTextSelection(kN(t)).unsetFontSize().unsetLineHeight()).run()}(e);null!==r&&vN(t,n,{size:r});return l||null!==r}({editor:e,landEditor:n,shape:i,size:r})},setTextAlign(t){const r=o();return!!r&&function({editor:e,landEditor:t,shape:n,align:r}){if(e.isDestroyed)return!1;const o=function(e){switch(e){case"middle":return"center";case"end":return"right";default:return"left"}}(r),i=e.state.selection;if(!i.empty)return e.chain().focus().setTextAlign(o).run();const s=e.chain().focus().selectAll().unsetTextAlign().setTextSelection(kN(i)).run();return vN(t,n,{textAlign:r}),s||n.props.textAlign!==r}({editor:e,landEditor:n,shape:r,align:t})},setLink(t){if(e.isDestroyed||void 0===e.schema.marks.link)return!1;const n=null===t?null:um(t);if(null!==t&&null===n)return!1;const r=e.state.selection;if(!r.empty)return null===n?!!e.isActive("link")&&e.chain().focus().unsetLink().run():e.chain().focus().setLink({href:n}).run();if(0===e.state.doc.textContent.length)return!1;const o=e.chain().focus().selectAll();return(null===n?o.unsetLink():o.setLink({href:n})).setTextSelection(kN(r)).run()},clearFormatting(){if(e.isDestroyed)return!1;const t=o();t&&vN(n,t,{backgroundColor:S("transparent")});const r=e.state.selection;return r.empty?e.chain().focus().selectAll().unsetAllMarks().unsetTextAlign().setTextSelection(kN(r)).command(({tr:e})=>(e.setStoredMarks([]),!0)).run():e.chain().focus().unsetAllMarks().unsetTextAlign().run()},getUnsafeTiptapEditor:()=>e.isDestroyed?null:e};return i}function xN({editor:e,font:t,fontFamily:n,landEditor:r,shape:o}){if(e.isDestroyed||void 0===e.schema.marks.textStyle)return!1;if(!e.state.selection.empty)return null===n?e.chain().focus().unsetFontFamily().run():e.chain().focus().setFontFamily(n).run();const i=bN(e,"fontFamily");return null!==t&&r&&o&&vN(r,o,{font:t}),i||null!==t}function bN(e,t){const n=e.state.selection;let r=e.chain().focus();return e.state.doc.textContent.length>0&&(r=r.selectAll()),r="color"===t?r.unsetColor():r.unsetFontFamily(),r=r.setTextSelection(kN(n)),r="color"===t?r.unsetColor():r.unsetFontFamily(),wN(r).run()}function wN(e){return e.command(({state:e,tr:t})=>{const n=e.schema.marks.textStyle;if(!n)return!0;const r=(t.storedMarks??e.storedMarks)?.find(e=>e.type===n);return r&&Object.values(r.attrs).every(e=>null==e||""===e)&&t.removeStoredMark(n),!0})}function vN(e,t,n){e.commands.updateShapes([{id:t.id,props:n}],{source:"user"})}function kN(e){return e.from===e.to?e.from:{from:e.from,to:e.to}}function SN(e,t,n){if(!e.schema.marks[n])return!1;const r=[];return e.state.doc.nodesBetween(t.from,t.to,(e,t,o)=>{const i=o?.type.schema.marks[n];e.isText&&i&&o?.type.allowsMarkType(i)&&!e.marks.some(e=>"code"===e.type.name)&&r.push(e.marks.some(e=>e.type.name===n))}),0===r.length?(e.state.storedMarks??e.state.selection.$from.marks()).some(e=>e.type.name===n):TN(r)??!1}function PN(e,t){const n=[];return e.state.doc.nodesBetween(t.from,t.to,(t,r)=>{if(!t.isTextblock)return;const o=e.state.doc.resolve(Math.min(r+1,e.state.doc.content.size));let i="paragraph";for(let e=o.depth;e>=0;e-=1){const t=o.node(e).type.name;if("orderedList"===t||"bulletList"===t){i=t;break}if("blockquote"===t){i="blockquote";break}}n.push({blockType:i,isEmptyTrailingParagraph:"paragraph"===i&&0===t.content.size})}),TN((n.some(({blockType:e})=>"paragraph"!==e)?n.filter(({isEmptyTrailingParagraph:e})=>!e):n).map(({blockType:e})=>e))??"paragraph"}function MN(e,t,n,r){const o=[];if(e.state.doc.nodesBetween(t.from,t.to,(e,t,i)=>{if(!e.isText)return;if("backgroundColor"===n&&(e.marks.some(e=>"code"===e.type.name)||"codeBlock"===i?.type.name))return;const s=e.marks.find(e=>"textStyle"===e.type.name)?.attrs[n];o.push("string"==typeof s&&s.length>0?s:r)}),0===o.length){const t=(e.state.storedMarks??e.state.selection.$from.marks()).find(e=>"textStyle"===e.type.name)?.attrs[n];return"string"==typeof t&&t.length>0?t:r}return TN(o)}function IN(e,t,n){const r=[];return e.state.doc.nodesBetween(t.from,t.to,e=>{e.isTextblock&&r.push(function(e,t){switch(e){case"center":return"middle";case"right":return"end";case"left":return"start";default:return t}}(e.attrs.textAlign,n))}),TN(r)??n}function EN(e,t){const n=[];if(e.state.doc.nodesBetween(t.from,t.to,(e,t,r)=>{if(!e.isText||"codeBlock"===r?.type.name||e.marks.some(e=>"code"===e.type.name))return;const o=e.marks.find(e=>"link"===e.type.name)?.attrs.href;n.push("string"==typeof o&&o.length>0?o:null)}),0===n.length)return null;const r=n[0]??null;return n.every(e=>e===r)?r:"mixed"}function TN(e){if(0===e.length)return null;const t=e[0];return e.every(e=>Object.is(e,t))?t:"mixed"}function CN(e,t){return null===e?null:"mixed"===e?"mixed":t(e)}function ON(e){const t=e.trim();return t.length>0&&t.length<=128&&!mN.test(t)&&!gN.test(t)}function AN({shapeId:e,editor:t,fontCatalog:n,landEditor:r}){return{shapeId:e,formatting:yN({editor:t,fontCatalog:n,landEditor:r,shapeId:e}),isDestroyed:()=>t.isDestroyed,isConnected:()=>!t.isDestroyed&&VR(t),isFocused:()=>!t.isDestroyed&&VR(t)&&t.view.dom.contains(document.activeElement),getValue:()=>km(t.getJSON()),setValue(e){t.commands.setContent(e)},focus(){KR(t)},focusEnd(){!t.isDestroyed&&VR(t)&&t.commands.focus("end")},focusSelectAll(){!t.isDestroyed&&VR(t)&&(KR(t),t.chain().focus().selectAll().run())},focusAtPagePoint(e,n){!function(e,t,n){KR(t);const r=e.viewport.pageToScreen(new p(n.x,n.y)),o=t.view.posAtCoords({left:r.x,top:r.y})?.pos;if(o)return void t.chain().focus().setTextSelection(o).run();t.chain().focus().selectAll().run()}(e,t,n)},getSelectionSnapshot:()=>t.isDestroyed||!VR(t)?{type:null,text:null}:qR(t),collapseSelectionAtClientPoint(e,n){!t.isDestroyed&&VR(t)&&("Range"===qR(t).type&&function(e,t,n){if(e.isDestroyed||!VR(e))return;const r=e.view.posAtCoords({left:t,top:n})?.pos;"number"!=typeof r?e.commands.focus("end"):e.chain().focus().setTextSelection(r).run()}(t,e,n))},measure(e){if(!t.isDestroyed&&VR(t))return rN(t,e,n,og(r,e))},onCompositionStateChange(e){if(t.isDestroyed)return()=>{};const n=t.view.dom,r=()=>e(!0),o=()=>e(!1);return n.addEventListener("compositionstart",r),n.addEventListener("compositionend",o),()=>{n.removeEventListener("compositionstart",r),n.removeEventListener("compositionend",o),e(!1)}}}}var RN=gC.extend({inclusive:!1,renderHTML({HTMLAttributes:e}){const{href:t,target:n,rel:r,...o}=e;return["span",CP(o,{"data-rich-text-link-href":t,style:"text-decoration-line: underline;"}),0]}}),NN=[AR.configure({bold:!1,italic:!1,link:!1,strike:!1,underline:!1}),hE.extend({keepOnSplit:!0}),xE.extend({keepOnSplit:!0}),bC.extend({keepOnSplit:!0}),TC.extend({keepOnSplit:!0}),kC,PC,SC,MC,IC,EC,wC.configure({types:["paragraph"],alignments:["left","center","right"]}),CC.configure({className:"land-rich-text-selection"}),RN.configure({autolink:!0,defaultProtocol:"https",openOnClick:!1,protocols:["mailto","land"],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer",class:"land-rich-text-link"}})];function LN({landEditor:e,shape:t,fontCatalog:n,initialRichText:r,className:o,editorStyle:i,formattingToolbar:s,onTiptapEditorChange:a,onReady:l,onDispose:c,onRichTextChange:d}){const u=(0,Vt.useRef)(null),p=C(t.props.backgroundColor)?null:T(t.props.backgroundColor),h=p&&r.content.length>0?function(e,t){const n=UR(e.content,(e,n)=>{if("text"!==e.type||!e.text||n.insideCodeBlock||e.marks?.some(e=>"code"===e.type))return e;const r=e.marks??[],o=r.findIndex(e=>"textStyle"===e.type);if(o<0)return{...e,marks:[...r,{type:"textStyle",attrs:{backgroundColor:t}}]};const i=r[o]?.attrs?.backgroundColor;return"string"==typeof i&&i.length>0?e:{...e,marks:r.map((e,n)=>n===o?{...e,attrs:{...e.attrs,backgroundColor:t}}:e)}});return n.changed?km({...e,content:n.nodes}):e}(r,p):r,f=(0,Vt.useCallback)(r=>{const o=u.current;if(o?.editor===r)return o.controller;const i=AN({shapeId:t.id,editor:r,fontCatalog:n,landEditor:e});return u.current={editor:r,controller:i},i},[n,e,t.id]),m=nE({extensions:NN,content:h,autofocus:!1,editable:!0,immediatelyRender:!0,shouldRerenderOnTransaction:!1,editorProps:{attributes:{"data-ui":"rich-text-editor",class:"land-text-editor__content",dir:"auto"},handleKeyDown:(t,n)=>(n.stopPropagation(),!n.isComposing&&("Escape"===n.key?(n.preventDefault(),e.editing.cancel("user"),!0):!("Enter"!==n.key||!n.metaKey&&!n.ctrlKey)&&(n.preventDefault(),e.editing.complete("user"),!0)))},onUpdate:({editor:e})=>{const t=f(e);d({editor:e,controller:t,richText:t.getValue()})}},[t.id]);return(0,Vt.useEffect)(()=>{if(!m||m.isDestroyed)return;const n=f(m),r={shapeId:t.id,editor:m,controller:n,formatting:n.formatting},o={shapeId:t.id,formatting:n.formatting},i=!1===s?()=>{}:NR(e,n.formatting);return l(r),a?.(o),()=>{i(),u.current?.editor===m&&(u.current=null),c(r),a?.(null)}},[f,s,e,c,l,a,t.id,m]), (0,Jt.jsx)(XI,{editor:m,className:o,style:i})}function $N({editor:e,controller:t,shapeId:n,request:r,onApplied:o,attempt:i=0}){if(!t.isDestroyed())if(t.isConnected())!function({editor:e,controller:t,shapeId:n,request:r,onApplied:o}){if(t.isDestroyed())return;if(t.focus(),!r||r.shapeId!==n)return t.focusEnd(),void o?.(r);if("selectAll"===r.entryMode)return window.requestAnimationFrame(()=>{!t.isDestroyed()&&t.isConnected()&&t.focusSelectAll()}),e.editing.consumeEntryRequest(r.id),void o?.(r);if("placeCaret"===r.entryMode&&r.caretPagePoint)return t.focusAtPagePoint(e,r.caretPagePoint),e.editing.consumeEntryRequest(r.id),void o?.(r);t.focusEnd(),e.editing.consumeEntryRequest(r.id),o?.(r)}({editor:e,controller:t,shapeId:n,request:r,onApplied:o});else{if(i>=4)return;window.requestAnimationFrame(()=>{$N({editor:e,controller:t,shapeId:n,request:r,onApplied:o,attempt:i+1})})}}function DN({editor:e,shape:t,tiptapEditor:n,richTextController:r,latestShapeRef:o,fontCatalog:i}){const s=(0,Vt.useRef)(t.props.richText),a=(0,Vt.useRef)(!1),l=(0,Vt.useRef)(null),c=(0,Vt.useCallback)(({controller:n,richText:r})=>{if(a.current||!n.isConnected())return;const c=km(r);s.current=c,qm(e,t.id,c,n.measure(o.current)??oN(c,o.current,i,og(e,o.current)),"user"),function(e,t,n,r){null!==r.current&&window.clearTimeout(r.current),r.current=window.setTimeout(()=>{r.current=null,pN(e,t,n.current)},0)}(e,n,o,l)},[e,i,o,t.id]);return(0,Vt.useEffect)(()=>()=>{null!==l.current&&(window.clearTimeout(l.current),l.current=null)},[]),(0,Vt.useLayoutEffect)(()=>{n&&r&&!n.isDestroyed&&r.isConnected()&&pN(e,r,t)},[e,r,t,n]),(0,Vt.useEffect)(()=>{if(!n||!r||!r.isConnected())return;const e=t.props.richText;e!==s.current&&(JSON.stringify(s.current)!==JSON.stringify(e)?(a.current=!0,r.setValue(e),s.current=e,a.current=!1):s.current=e)},[r,t.props.richText,n]),(0,Vt.useEffect)(()=>{if(r)return r.onCompositionStateChange(t=>{e.editing.setComposition(t,"system")})},[e,r]),(0,Vt.useEffect)(()=>{if(!r||!r.isConnected())return;let n=!1;return yg(t.props.font,i).then(()=>{!n&&r.isConnected()&&pN(e,r,o.current)}),()=>{n=!0}},[e,i,o,r,t.props.font]),c}function jN({editor:e,href:t,openExternal:n}){gm({href:t,openExternal:n,openInternal(t){e.viewport.centerOnShape(t,{source:"user",animation:{durationMs:240}})&&e.commands.setSelectedShapeIds([t],{source:"user"})}})}function BN({shapeId:e,operationKind:t,fontCatalog:n,formattingToolbar:r,openLink:o=()=>{},onTiptapEditorChange:i}){const s=qt(),a=sn(s.shapes.getSignal(e)),l=sn(s.state.shapeEditing).session;return Hm(a)&&l?.shapeId===a.id? (0,Jt.jsx)(zN,{shape:a,session:l,fontCatalog:n,formattingToolbar:r,openLink:o,onTiptapEditorChange:i},`${a.id}:${t}`):null}function zN({shape:e,session:t,fontCatalog:n,formattingToolbar:r,openLink:o,onTiptapEditorChange:i}){const s=qt(),a=(0,Vt.useRef)(e.props.richText),l=function(e){const t=(0,Vt.useRef)(e);return(0,Vt.useEffect)(()=>{t.current=e},[e]),t}(e),c=sn(s.state.shapeEditingEntryRequest),d=(0,Vt.useRef)(null),[u,p]=(0,Vt.useState)(null),[h,f]=(0,Vt.useState)(null),m=(0,Vt.useCallback)(({editor:e,controller:t})=>{p(e.isDestroyed?null:e),f(t)},[]),g=(0,Vt.useCallback)(({editor:e,controller:t})=>{p(t=>t===e?null:t),f(e=>e===t?null:e)},[]),y=DN({editor:s,shape:e,tiptapEditor:u,richTextController:h,latestShapeRef:l,fontCatalog:n}),x=(0,Vt.useCallback)(()=>{u&&function(e,t){!(!t||e.isDestroyed||e.state.doc.textContent.length>0||e.getAttributes("textStyle").backgroundColor===t)&&e.commands.setBackgroundColor(t)}(u,C(e.props.backgroundColor)?null:T(e.props.backgroundColor))},[e.props.backgroundColor,u]);!function({editor:e,shapeId:t,session:n,tiptapEditor:r,richTextController:o,entryRequest:i,consumedEntryRequestIdRef:s,onEntryFocusApplied:a}){const l=(0,Vt.useRef)(null),c=(0,Vt.useRef)(null);(0,Vt.useEffect)(()=>{if(!o||o.isDestroyed()||!o.isConnected())return;let e=!1,t=null,n=0;const r=()=>{e||o.isDestroyed()||null===s.current&&(o.isFocused()||(o.focus(),n+=1,o.isFocused()||n>=4||(t=window.setTimeout(r,16))))},i=window.requestAnimationFrame(()=>{r()});return()=>{e=!0,window.cancelAnimationFrame(i),null!==t&&window.clearTimeout(t)}},[s,o,t]),(0,Vt.useEffect)(()=>{r&&!r.isDestroyed&&o&&null===s.current&&c.current!==n.operationKind&&(c.current=n.operationKind,window.setTimeout(()=>{$N({editor:e,controller:o,shapeId:t,request:{id:-1,shapeId:n.shapeId,entryMode:n.entryMode,caretPagePoint:n.caretPagePoint},onApplied:a})},0))},[s,e,o,n.caretPagePoint,n.entryMode,n.operationKind,n.shapeId,t,r,a]),(0,Vt.useEffect)(()=>{r&&!r.isDestroyed&&o&&i&&i.shapeId===t&&s.current!==i.id&&$N({editor:e,controller:o,shapeId:t,request:i,onApplied(e){e&&(s.current=e.id),a?.()}})},[s,e,i,o,t,r,a]),(0,Vt.useEffect)(()=>{if(!r||!o||r.isDestroyed||!o.isConnected())return;const t=o;"selectAll"===n.entryMode&&window.requestAnimationFrame(()=>{"Range"!==t.getSelectionSnapshot().type&&t.focusSelectAll()});const i=l.current,s=n.caretPagePoint;if("placeCaret"===n.entryMode&&s&&(i?.operationKind!==n.operationKind||i.entryMode!==n.entryMode)){l.current={operationKind:n.operationKind,entryMode:n.entryMode};const r={x:s.x,y:s.y};window.requestAnimationFrame(()=>{$N({editor:e,controller:t,shapeId:n.shapeId,request:{id:-1,shapeId:n.shapeId,entryMode:"placeCaret",caretPagePoint:r},onApplied:a})})}},[e,n.caretPagePoint,n.entryMode,n.operationKind,n.shapeId,o,r,a])}({editor:s,shapeId:e.id,session:t,tiptapEditor:u,richTextController:h,entryRequest:c,consumedEntryRequestIdRef:d,onEntryFocusApplied:x});const b=function({editor:e,shapeId:t,richTextController:n}){const r=(0,Vt.useRef)(null);return{onPointerDownCapture:(0,Vt.useCallback)(o=>{if(0!==o.button||1!==o.detail||!n||n.isDestroyed())return void(r.current=null);const i=e.state.shapeEditingSession.get();i&&i.shapeId===t&&!i.isComposing&&"Range"===n.getSelectionSnapshot().type?r.current={pointerId:o.pointerId,clientX:o.clientX,clientY:o.clientY,moved:!1}:r.current=null},[e,n,t]),onPointerMoveCapture:(0,Vt.useCallback)(e=>{const t=r.current;if(!t||t.pointerId!==e.pointerId)return;const n=e.clientX-t.clientX,o=e.clientY-t.clientY;n*n+o*o>=16&&(t.moved=!0)},[]),onPointerUpCapture:(0,Vt.useCallback)(o=>{const i=r.current;if(r.current=null,!i||i.pointerId!==o.pointerId||i.moved||!n||n.isDestroyed())return;const s=e.state.shapeEditingSession.get();if(!s||s.shapeId!==t||s.isComposing)return;const a=o.clientX,l=o.clientY;window.setTimeout(()=>{n.isDestroyed()||"Range"!==n.getSelectionSnapshot().type||n.collapseSelectionAtClientPoint(a,l)},0)},[e,n,t]),onPointerCancel:(0,Vt.useCallback)(()=>{r.current=null},[])}}({editor:s,shapeId:e.id,richTextController:h}),w=function(e,t,n=0){return(0,Vt.useMemo)(()=>({color:E(e.props.color),fontFamily:ZR(e.props.font,t),fontSize:QR(e.props.size),lineHeight:`${eN(e.props.size)}px`,textAlign:nN(e.props.textAlign),pointerEvents:"auto",userSelect:"text",cursor:"text",boxSizing:"border-box",position:"absolute",inset:0,width:"100%",height:"100%",paddingInline:n}),[e.props.color,e.props.font,e.props.size,e.props.textAlign,t,n])}(e,n,Gm(og(s,e),e.props.w)),v=(0,Vt.useCallback)(e=>{if(!e.ctrlKey&&!e.metaKey)return;const t=function(e){const t=e.target;return t instanceof Element?t.closest("[data-rich-text-link-href]")?.getAttribute("data-rich-text-link-href")??null:null}(e.nativeEvent);t&&u&&!u.isDestroyed&&(e.preventDefault(),e.stopPropagation(),jN({editor:s,href:t,openExternal:o}))},[s,o,u]);
114
+ return(0,Jt.jsx)("div",{"data-ui":"text-editing-box","data-shape-id":e.id,"data-mount-target-kind":"shape",onPointerDown:e=>{e.stopPropagation()},onClickCapture:v,onPointerDownCapture:b.onPointerDownCapture,onPointerMoveCapture:b.onPointerMoveCapture,onPointerUpCapture:b.onPointerUpCapture,onPointerCancel:b.onPointerCancel,onContextMenu:e=>{e.stopPropagation()},onDragStart:e=>{e.preventDefault()},style:w,children: (0,Jt.jsx)(LN,{landEditor:s,shape:e,fontCatalog:n,initialRichText:a.current,className:"land-text-editor__content",formattingToolbar:r,editorStyle:{height:"100%",minHeight:"100%"},onReady:m,onDispose:g,onTiptapEditorChange:i,onRichTextChange:y})})}function _N(e,t,n,r,o,i){const s=sn(e.state.shapeEditing).session,a=s?.shapeId===t.id,l=s&&a? (0,Jt.jsx)(BN,{shapeId:s.shapeId,operationKind:s.operationKind,fontCatalog:n,formattingToolbar:r,openLink:o,onTiptapEditorChange:i},s.shapeId+":"+s.operationKind):null;return function({editor:e,shape:t,isEditingThisShape:n,fontCatalog:r}){(0,Vt.useLayoutEffect)(()=>{if(n)return;hN(e,t,r);let o=!1;return yg(t.props.font,r).then(()=>{if(o)return;const n=e.shapes.get(t.id);Hm(n)&&n.props.font===t.props.font&&hN(e,n,r)}),()=>{o=!0}},[e,r,n,t,t.props.autoSize,t.props.font,t.props.richText,t.props.scale,t.props.size,t.props.textAlign,t.props.w])}({editor:e,shape:t,isEditingThisShape:a,fontCatalog:n}),{hasEditingSession:null!==s,isEditingThisShape:a,editingHost:l}}var FN=(0,Vt.createContext)(null);function WN({children:e,presenter:t}){
115
+ return(0,Jt.jsx)(FN.Provider,{value:t,children:e})}var HN=(0,Vt.createContext)({query:"",activeMatch:null});function UN({activeMatch:e,children:t,query:n}){const r=(0,Vt.useMemo)(()=>({activeMatch:e,query:n}),[e,n]);
116
+ return(0,Jt.jsx)(HN.Provider,{value:r,children:t})}function VN(e,t){if(0===t.length)return[];const n=[],r=vm(e),o=new RegExp(t.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),"giu");for(const i of r.matchAll(o)){const e=i.index,t=i[0];void 0!==e&&0!==t.length&&n.push({from:e,to:e+t.length})}return n}var KN=new Set(["key_down","key_up","pointer_cancel","pointer_down","pointer_move","pointer_up"]),qN={id:"land.text.dom-events",handle({event:e,name:t}){if(!KN.has(t))return"continue";const n=e.target;return n instanceof HTMLElement&&n.closest('[data-ui="text-editing-box"]')?"handled":"continue"},getCursor:({element:e})=>e?.closest('[data-ui="text-editing-box"]')?"text":void 0};function YN({fontCatalog:e=pg(),formattingToolbar:t,openLink:n=()=>{},onTiptapEditorChange:r}={}){return{id:"land.text.react",domEventGuards:[qN],canvasComponents:[{id:"land.text.styles",component:XN},{id:"land.text.default-font-preload",component:function(){
117
+ return(0,Jt.jsx)(JN,{fontCatalog:e})}}],shapeRenderers:[{type:"text",hoverComponent:ZN,component:function(o){
118
+ return(0,Jt.jsx)(GN,{...o,fontCatalog:e,formattingToolbar:t,openLink:n,onTiptapEditorChange:r})}}]}}function XN(){
119
+ return(0,Jt.jsx)("style",{"data-land-plugin":"text",children:'\n.land-text-editor__content {\n width: 100%;\n height: 100%;\n min-height: 100%;\n outline: none;\n white-space: pre-wrap;\n overflow-wrap: break-word;\n}\n\n.land-text-editor__content p {\n margin: 0;\n}\n\n.land-text-editor__content ul,\n.land-text-editor__content ol {\n margin: 0;\n padding-inline-start: 1.5em;\n}\n\n.land-text-editor__content ul {\n list-style: disc;\n}\n\n.land-text-editor__content ol {\n list-style: decimal;\n}\n\n.land-text-editor__content blockquote {\n margin: 0;\n padding-inline-start: 0.75em;\n border-inline-start: 2px solid currentColor;\n}\n\n.land-text-editor__content .land-rich-text-selection {\n background: color-mix(\n in srgb,\n var(--land-selection, #2563eb) 24%,\n transparent\n );\n}\n\n.land-text-search-match {\n border-radius: 2px;\n background: var(--land-text-search-match, #fde68a);\n color: inherit;\n padding: 0;\n}\n\n.land-text-search-match[data-active="true"] {\n background: var(--land-text-search-match-active, #f59e0b);\n}\n'})}function JN({fontCatalog:e}){return(0,Vt.useEffect)(()=>{yg(cg,e)},[e]),null}function GN({shape:e,editor:t,fontCatalog:n,formattingToolbar:r,openLink:o,onTiptapEditorChange:i}){const[s,a]=(0,Vt.useState)(null),l=(0,Vt.useRef)(null),c=sn(t.state.selectedShapeIds),d=(0,Vt.useContext)(HN),u=(0,Vt.useMemo)(()=>VN(e.props.richText,d.query),[e.props.richText,d.query]),p=d.activeMatch?.shapeId===e.id?d.activeMatch:null,h=(0,Vt.useContext)(FN),{hasEditingSession:f,isEditingThisShape:m,editingHost:g}=_N(t,e,n,r,o,i),y=Gm(og(t,e),e.props.w),x=null!==h&&function({isEditing:e,isOnlySelected:t}){return!e&&!t}({isEditing:f,isOnlySelected:1===c.length&&c[0]===e.id}),b=s?mm(s.href):null,w=null!==b&&void 0===t.shapes.get(b),v=(0,Vt.useCallback)(()=>{null!==l.current&&(window.clearTimeout(l.current),l.current=null)},[]),k=(0,Vt.useCallback)(()=>{v(),l.current=window.setTimeout(()=>{a(null),l.current=null},160)},[v]);return(0,Vt.useEffect)(()=>()=>{v()},[v]),(0,Vt.useEffect)(()=>{x||(v(),a(null))},[x,v]), (0,Jt.jsxs)("div",{"data-editing-hidden":m?"true":void 0,style:{position:"relative",boxSizing:"border-box",width:e.props.w,minHeight:e.props.h,transform:`scale(${e.props.scale})`,transformOrigin:"top left",color:E(e.props.color),fontFamily:ZR(e.props.font,n),fontSize:QR(e.props.size),lineHeight:`${eN(e.props.size)}px`,textAlign:nN(e.props.textAlign),whiteSpace:"pre-wrap",overflowWrap:"break-word",userSelect:"none",pointerEvents:"none"},children:[
120
+
121
+ (0,Jt.jsx)("div",{style:{boxSizing:"border-box",opacity:m?0:void 0,paddingInline:y,width:"100%"},children:sg(e.props.richText,{linkHandlers:x?{onPointerEnter({href:e,element:t}){v(),a({anchorElement:t,href:e})},onPointerLeave(){k()}}:void 0,defaultBackgroundColor:C(e.props.backgroundColor)?void 0:E(e.props.backgroundColor),searchRanges:u,activeSearchRange:p})}),x&&s&&h? (0,Jt.jsx)(h,{anchorElement:s.anchorElement,href:s.href,kind:b?"internal":"external",unavailable:w,onOpen:()=>{jN({editor:t,href:s.href,openExternal:o})},onPopoverPointerEnter:v,onPopoverPointerLeave:k}):null,
122
+
123
+ (0,Jt.jsx)("div",{"data-ui":"text-editor-host-slot","data-shape-id":e.id,"data-active":m?"true":"false","aria-hidden":"true",style:{position:"absolute",inset:0,pointerEvents:"none"},children:g})]})}function ZN({strokeWidth:e}){
124
+ return(0,Jt.jsx)("div",{"data-ui":"text-hover-outline",style:{boxShadow:`inset 0 0 0 ${e}px ${pn}`,inset:0,position:"absolute"}})}var QN="text.create",eL=class extends ie{constructor(e){super(e,"text"),this.initial="idle",this.addChild(new tL(e,this)),this.addChild(new nL(e,this))}},tL=class extends ie{constructor(e,t){super(e,"idle",t)}onEnter(){this.editor.interaction.clearSelection()}onPointerDown(e){this.transition("pointing",{originPagePoint:e.pagePoint.clone(),originScreenPoint:e.screenPoint.clone(),shapeId:null})}},nL=class extends ie{info=null;operation=null;isHandingOffOperation=!1;constructor(e,t){super(e,"pointing",t)}onEnter(e){this.info=e,this.operation=this.editor.operations.begin({kind:QN,label:"shape.create",source:"user",history:"record"})}onPointerMove(e){this.updateFixedWidthShape(e.pagePoint,e.screenPoint)}onPointerUp(e){if(!this.info)return void this.transition("idle");const t=null!==this.info.shapeId?this.editor.shapes.get(this.info.shapeId):this.createTextShape(e.pagePoint);if(!Hm(t))return this.cancelOperation(),void this.transition("idle");let n;j(this.editor,t.id,{source:"user"}),this.editor.state.tool.get().isToolLocked||(this.isHandingOffOperation=!0,this.transition("idle"),this.editor.commands.setActiveTool("select",{source:"system"}));try{n=this.editor.editing.start({shapeId:t.id,entryMode:"focusEnd",operationKind:QN,reuseActiveOperation:!0,preserveInteraction:!0},"user")}catch(r){throw this.cancelOperation(),r}finally{this.isHandingOffOperation=!1}n?this.operation=null:this.cancelOperation(),this.editor.state.tool.get().isToolLocked&&this.transition("idle")}onCancel(){this.cancelOperation(),this.transition("idle")}onExit(){this.isHandingOffOperation||this.cancelOperation(),this.info=null}cancelOperation(){const e=this.operation;this.operation=null,e?.isActive&&e.cancel()}updateFixedWidthShape(e,t){if(!this.info)return;const n=function(e,t,n,r,o){const i=Math.abs(r.x-n.x);return n.dist(r)<4||i<8?null:{x:Math.min(e.x,t.x),y:e.y-o.h/2,props:{...rL(o),w:Math.max(16,Math.abs(t.x-e.x)),autoSize:!1}}}(this.info.originPagePoint,e,this.info.originScreenPoint,t,this.getDefaultTextProps());if(n){if(!this.info.shapeId){const e=this.createTextShapeAt(n);return void(this.info.shapeId=e.id)}this.editor.commands.updateShapes([{id:this.info.shapeId,x:n.x,y:n.y,props:{w:n.props.w,h:n.props.h,autoSize:!1}}],{source:"user"})}}createTextShape(e){return this.createTextShapeAt(function(e,t){return{x:e.x,y:e.y-t.h/2,props:rL(t)}}(e,this.getDefaultTextProps()))}createTextShapeAt({x:e,y:t,props:n}){const r=Km(this.editor,{x:e,y:t,props:n},"user");return this.editor.commands.setSelectedShapeIds([r.id],{source:"system"}),r}getDefaultTextProps(){return Vm(this.editor)}};function rL(e){return Um(e)}var oL=["start","middle","end"];function iL(e,t){return"number"==typeof e&&Number.isFinite(e)?e:t}function sL(e){return Math.max(.01,e.props.scale)}function aL(e){return e.props.w*sL(e)}function lL(e){return e.props.h*sL(e)}function cL(e){return new h(0,0,aL(e),lL(e))}function dL(e){return"left"===e||"right"===e}function uL(e,t){const n=function(e){return V({localWidth:aL(e),localHeight:lL(e),scaleX:e.scaleX,scaleY:e.scaleY})}(e),r=t.selectionLocalBounds.w/Math.max(1,n.width),o=t.selectionLocalBounds.h/Math.max(1,n.height);switch(t.handleId){case"left":case"right":return r;case"top":case"bottom":return o;default:return Math.max(r,o)}}var pL=class extends oe{type="text";getDefaultProps(){return{richText:wm(""),w:16,h:tN(XR),autoSize:!0,scale:1,font:cg,size:XR,color:k("text-slate"),backgroundColor:S("transparent"),textAlign:"start"}}validateProps(e){const t=e&&"object"==typeof e?e:{},n=this.getDefaultProps();return{richText:km(t.richText),w:Math.max(1,iL(t.w,n.w)),h:Math.max(1,iL(t.h,n.h)),autoSize:"boolean"==typeof t.autoSize?t.autoSize:n.autoSize,scale:Math.max(.01,iL(t.scale,n.scale)),font:fg(t.font)?t.font:n.font,size:GR(t.size,n.size),color:I(t.color,n.color),backgroundColor:I(t.backgroundColor,n.backgroundColor),textAlign:(r=t.textAlign,"string"==typeof r&&oL.includes(r)?t.textAlign:n.textAlign)};var r}getPositionedBounds(e){return function(e){return new h(e.x,e.y,aL(e),lL(e))}(e)}getLocalBounds(e){return cL(e)}getRenderBounds(e){return cL(e)}getExportBounds(e){return cL(e)}canSnap(e,t){return!t||(n=t.editor,r=e.id,ng(n,r)?.behavior.canSnap??null??!0);var n,r}canReceiveTerminalBinding(e,t){return!t||(n=t.editor,r=e.id,ng(n,r)?.behavior.canReceiveTerminalBinding??null??!0);var n,r}canEdit(e){return!0}contributesToSelectionFrame(e,t){return n=t.editor,r=e.id,ng(n,r)?.behavior.contributesToSelectionFrame??null??!0;var n,r}canUseSelectionResizeHandles(e,t){return t.editor.state.shapeEditingSession.get()?.shapeId!==e.id&&(n=t.editor,r=e.id,ng(n,r)?.behavior.canUseSelectionResizeHandles??null??!0);var n,r}canUseSelectionRotateHandle(e,t){return t.editor.state.shapeEditingSession.get()?.shapeId!==e.id&&(n=t.editor,r=e.id,ng(n,r)?.behavior.canUseSelectionRotateHandle??null??!0);var n,r}getSelectionTargetId(e,t){return function(e,t){const n=ng(e,t);return n?"owner"===n.behavior.selectionTarget?n.ownerId:t:null}(t.editor,e.id)??e.id}getHoverTargetId(e,t){return function(e,t){const n=ng(e,t);return n?"owner"===n.behavior.hoverTarget?n.ownerId:t:null}(t.editor,e.id)??e.id}getHoverDecorationTargetId(e,t){return function(e,t){const n=ng(e,t);return n?"owner"===n.behavior.hoverDecorationTarget?n.ownerId:t:null}(t.editor,e.id)??e.id}getTranslateTargetId(e,t){return function(e,t){const n=ng(e,t);return n?"owner"===n.behavior.translateTarget?n.ownerId:t:null}(t.editor,e.id)??e.id}resizeSelectionBounds(e,t){const n={};if(t.isOnlyResizeTarget&&dL(t.handleId)){const r=K({width:t.selectionLocalBounds.w,height:t.selectionLocalBounds.h,scaleX:e.scaleX,scaleY:e.scaleY});n.w=Math.max(16,r.width/sL(e)),n.autoSize=!1}else n.scale=Math.max(.01,e.props.scale*uL(e,t));const r=n.scale??sL(e),o=(n.w??e.props.w)*r,i=e.props.h*r,s=V({localWidth:o,localHeight:i,scaleX:e.scaleX,scaleY:e.scaleY}),a=function(e,t){return 0===t.selectionRotation?e.clone():p.RotWith(e,t.selectionRotationCenter,t.selectionRotation)}(q({handleId:t.handleId,requestedBounds:t.selectionLocalBounds,actualWidth:s.width,actualHeight:s.height,scaleX:t.scaleX,scaleY:t.scaleY,isResizingFromCenter:t.isResizingFromCenter}).center,t),l=t.scaleX<0!=t.scaleY<0;return{id:e.id,x:a.x-o/2,y:a.y-i/2,rotation:l?2*t.selectionRotation-e.rotation:e.rotation,scaleX:t.scaleX<0?-e.scaleX:e.scaleX,scaleY:t.scaleY<0?-e.scaleY:e.scaleY,props:n}}getAllowedSelectionResizeModes(e,t){return t.isOnlyResizeTarget&&dL(t.handleId)?F:W}onEditEnd(e){if(!(vm(e.props.richText).trim().length>0))return{deleteShapeIds:[e.id]}}},hL=class{fontCatalog;type="text";constructor(e){this.fontCatalog=e}toSvg(e,t){if(0===vm(e.props.richText).trim().length)return null;const n=Gm(og(t.editor,e),e.props.w);return{tag:"foreignObject",attrs:{x:0,y:0,width:e.props.w*e.props.scale,height:e.props.h*e.props.scale},children:[{tag:"div",attrs:{xmlns:"http://www.w3.org/1999/xhtml",dir:"auto",style:mL(e,t,this.fontCatalog,n)},children:(r=e.props.richText,o=C(e.props.backgroundColor)?void 0:t.resolveColor(e.props.backgroundColor),r.content.map(e=>fL(e,o)))}]};var r,o}};function fL(e,t){const n="codeBlock"===e.type?void 0:t,r=e.content?.map(e=>function(e,t){if(Sm(e)){const n=function(e,t){const n=Mm(e.marks,t);return n?Tm(n):void 0}(e,t);return n?{tag:"span",attrs:{style:n},children:[e.text]}:e.text}return"hardBreak"===e.type?{tag:"br"}:fL(e,t)}(e,n))??[];if("bulletList"===e.type||"orderedList"===e.type)return{tag:"bulletList"===e.type?"ul":"ol",attrs:{style:"bulletList"===e.type?"margin:0;padding-inline-start:1.5em;list-style-type:disc":"margin:0;padding-inline-start:1.5em;list-style-type:decimal"},children:r};if("listItem"===e.type)return{tag:"li",children:r};if("blockquote"===e.type)return{tag:"blockquote",attrs:{style:"margin:0;padding-inline-start:0.75em;border-inline-start:2px solid currentColor"},children:r};const o=Pm(e);return{tag:"p",attrs:{style:o?`margin:0;text-align:${o}`:"margin:0"},children:r.length>0?r:[{tag:"br"}]}}function mL(e,t,n,r){return[`color:${t.resolveColor(e.props.color)}`,`font-family:${ZR(e.props.font,n)}`,`font-size:${QR(e.props.size)}px`,`line-height:${eN(e.props.size)}px`,`text-align:${nN(e.props.textAlign)}`,"white-space:pre-wrap","overflow-wrap:break-word","box-sizing:border-box",`padding-inline:${r}px`,`width:${e.props.w}px`,`height:${e.props.h}px`,`transform:scale(${e.props.scale})`,"transform-origin:top left"].join(";")}var gL=".label";function yL(e){return"binding"===e?.typeName&&"path-label"===e.type}function xL(e,t){return"number"==typeof e&&Number.isFinite(e)?Math.min(1,Math.max(0,e)):t}var bL=class extends u{type=Ym;getDefaultProps(){return{labelPosition:.5}}validateProps(e){const t=this.getDefaultProps();return{labelPosition:xL((e&&"object"==typeof e?e:{}).labelPosition,t.labelPosition)}}canBind(e,t,n){return this.canUseShapeCompanion(t,n,e)}canUseShapeCompanion(e,t,n){return Hm(t.fromShape)&&(!n||null!==vL(n,t.toShape))}getExclusiveBindingKey(e){return e.toId}onBindingCreate(e,t){return this.syncLabelPosition(e,t)}onBindingUpdate(e,t,n){return this.syncLabelPosition(e,n)}onBindingLoad(e,t){return this.syncLabelPosition(e,t)}getGeometryDependentShapeIds(e,t,n){return"to"===n.role?[t.fromId]:[]}getTargetShapeContentCutoutLocalPolygons(e,t,n){if(!Hm(n.fromShape)||!vL(e,n.toShape))return[];const r=e.shapes.computeLocalToPageTransform(n.toShape).tryInvert();if(!r)return[];const o=e.shapes.computeLocalBounds(n.fromShape),i=r.compose(e.shapes.computeLocalToPageTransform(n.fromShape));return[[new p(o.minX,o.minY),new p(o.maxX,o.minY),new p(o.maxX,o.maxY),new p(o.minX,o.maxY)].map(e=>i.applyToPoint(e))]}onAfterShapeChange(e,t,n){return this.syncLabelPosition(e,t)}onBeforeDeleteShape(e,t,n){return"from"===n.role?{deleteBindingIds:[t.id]}:{deleteShapeIds:[t.fromId],deleteBindingIds:[t.id]}}onBeforeDeleteBinding(e,t){return{deleteBindingIds:[t.id]}}getExportShapeIds(e,t){return[t.fromId]}getShapeCompanionRootId(e,t){return t===e.fromId?e.toId:null}getSelectionCompanionFrameGeometries(e,t,n){if(t.toId!==n.selectedShape.id)return[];if(!0!==function(e,t){return ng(e,t)?.behavior.showsCompanionFrameWhenOwnerSelected??null}(e,t.fromId))return[];const r=e.shapes.get(t.fromId),o=e.shapes.get(t.toId);if(!Hm(r)||!o||!vL(e,o))return[];const i=e.shapes.computeGeometry(r),s=e.shapes.computeLocalToPageTransform(r),a=Math.atan2(s.b,s.a);return[{bounds:h.FromPoints(i.outlineVertices.map(e=>p.RotWith(e,i.center,-a))),rotation:a,rotationCenter:i.center}]}syncLabelPosition(e,t){if(!yL(t))return;const n=e.shapes.get(t.fromId),r=e.shapes.get(t.toId);if(!Hm(n)||!r||!vL(e,r))return{deleteBindingIds:[t.id]};const o=function(e,t,n,r){const o=wL(e,t,n,r),i=n.parentId,s=`${n.index}${gL}`,a=!1,l=Qm(e,t,i,o);return l?t.x===l.x&&t.y===l.y&&t.rotation===l.rotation&&t.scaleX===l.scaleX&&t.scaleY===l.scaleY&&t.parentId===i&&t.index===s&&t.props.w===o.props.w&&t.props.autoSize===a?null:{id:t.id,...l,parentId:i,index:s,props:{w:o.props.w,autoSize:a}}:null}(e,n,r,t.props.labelPosition);return o?{shapes:[{...n,...o,props:{...n.props,...o.props}}]}:void 0}};function wL(e,t,n,r=.5){const o=vL(e,n),i=o?kL(e,t,o):{start:0,end:1},s=Math.min(i.end,Math.max(i.start,r)),a=o?.getPointAt(s)??e.shapes.computePageCenter(n),l=rg(e,t,n,Ym),c=Math.min(l.maxWidth,Math.max(l.minWidth,t.props.w));return{x:a.x-c*t.props.scale/2,y:a.y-t.props.h*t.props.scale/2,rotation:Zm(e,n),props:{w:c}}}function vL(e,t){return e.shapes.getUtil(t).getLabelPathGeometry(t,{editor:e})}function kL(e,t,n){if(n.length<=1e-6)return{start:.5,end:.5};const r=e.shapes.getPageBounds(t.id);if(!r)return{start:0,end:1};const o=Math.hypot(r.w,r.h)/2,i=Math.min(.5,(o+8)/n.length);return{start:i,end:1-i}}var SL=".label";function PL(e){return"shape"===e?.typeName&&"geo"===e.type}function ML(e,t){return"number"==typeof e&&Number.isFinite(e)?Math.min(1,Math.max(0,e)):t}var IL=class extends u{type=Xm;getDefaultProps(){return{normalizedAnchor:{x:.5,y:.5},ownerBaseHeight:0}}validateProps(e){const t=this.getDefaultProps(),n=e&&"object"==typeof e?e:{},r=n.normalizedAnchor&&"object"==typeof n.normalizedAnchor?n.normalizedAnchor:t.normalizedAnchor;return{normalizedAnchor:{x:ML(r.x,t.normalizedAnchor.x),y:ML(r.y,t.normalizedAnchor.y)},ownerBaseHeight:EL(n.ownerBaseHeight,t.ownerBaseHeight)}}canBind(e,t,n){return this.canUseShapeCompanion(t,n)}canUseShapeCompanion(e,t){return Hm(t.fromShape)&&PL(t.toShape)}getExclusiveBindingKey(e){return e.toId}onBindingCreate(e,t){return this.syncLabelPosition(e,t)}onBindingUpdate(e,t,n){return this.syncLabelPosition(e,n,t.toId===n.toId?void 0:{role:"to"})}onBindingLoad(e,t){return this.syncLabelPosition(e,t)}getGeometryDependentShapeIds(e,t,n){return"from"===n.role?[t.toId]:[t.fromId]}onAfterShapeChange(e,t,n){return this.syncLabelPosition(e,t,n)}onBeforeDeleteShape(e,t,n){if("from"===n.role){const n=e.shapes.get(t.toId),r=n?CL(n,t):null;return{shapes:r?[r]:void 0,deleteBindingIds:[t.id]}}return{deleteShapeIds:[t.fromId],deleteBindingIds:[t.id]}}onBeforeDeleteBinding(e,t){const n=e.shapes.get(t.toId),r=n?CL(n,t):null;return{shapes:r?[r]:void 0,deleteBindingIds:[t.id]}}getExportShapeIds(e,t){return[t.fromId]}getShapeCompanionRootId(e,t){return t===e.fromId?e.toId:null}syncLabelPosition(e,t,n){if(r=t,"binding"!==r?.typeName||"geo-label"!==r.type)return;var r;const o=e.shapes.get(t.fromId),i=e.shapes.get(t.toId);if(!Hm(o)||!PL(i))return{deleteBindingIds:[t.id]};const s=function(e,t,n){const r=TL(t,"h")??1;return"to"===n?.role?r:e.props.ownerBaseHeight>0?e.props.ownerBaseHeight:r}(t,i,n),a=t.props.ownerBaseHeight===s?null:{...t,props:{...t.props,ownerBaseHeight:s}},l=function(e,t,n){const r=TL(e,"h");if(!r)return null;const o=Math.max(n,function(e){return Math.max(1,e.props.h*e.props.scale+32)}(t));return r===o?null:{...e,props:{...e.props,h:o}}}(i,o,s),c=function(e,t,n){const r=OL(e,t,n),o=n.parentId,i=`${n.index}${SL}`,s=!1,a=Qm(e,t,o,r);return a?t.x===a.x&&t.y===a.y&&t.rotation===a.rotation&&t.scaleX===a.scaleX&&t.scaleY===a.scaleY&&t.parentId===o&&t.index===i&&t.props.w===r.props.w&&t.props.autoSize===s?null:{id:t.id,...a,parentId:o,index:i,props:{w:r.props.w,autoSize:s}}:null}(e,o,l??i),d=[];return l&&d.push(l),c&&d.push({...o,...c,props:{...o.props,...c.props}}),d.length>0||a?{shapes:d.length>0?d:void 0,bindings:a?[a]:void 0}:void 0}};function EL(e,t){return"number"==typeof e&&Number.isFinite(e)&&e>0?e:t}function TL(e,t){const n=e.props[t];return"number"==typeof n&&Number.isFinite(n)?n:null}function CL(e,t){const n=TL(e,"h");return!n||t.props.ownerBaseHeight<=0||n===t.props.ownerBaseHeight?null:{...e,props:{...e.props,h:t.props.ownerBaseHeight}}}function OL(e,t,n){const r=e.shapes.computePageCenter(n),o=rg(e,t,n,Xm),i=Math.min(o.maxWidth,Math.max(o.minWidth,t.props.w)),s=e.shapes.computeLocalBounds(n),a=void 0===o.normalizedCenterX||.5===o.normalizedCenterX?r:e.shapes.computeLocalToPageTransform(n).applyToPoint(new p(s.minX+s.w*o.normalizedCenterX,s.center.y));return{x:a.x-i*t.props.scale/2,y:a.y-t.props.h*t.props.scale/2,rotation:Zm(e,n),props:{w:i}}}var AL="text.edit",RL="path-label.create",NL="path-label.drag",LL="geo-label.edit",$L="geo-label.create",DL={propagation:"stop"};function jL(){let e=null,t=null;const n=()=>{e=null,t=null};return{id:"land.text.interactions",editorEvent:{handleEvent(r,o,i){if("cancel"!==o.type){if("select"===r.state.tool.get().activeToolId)if("pointer"!==o.type||"pointer_move"!==o.name||"dragging"!==r.inputs.state.get().dragPhase){if("pointer"===o.type&&"pointer_up"===o.name){const n=i.pointer?.clickCount??1;return function(e,t,n,r,o){if(!r||r.pointerId!==t.pointerId)return void o();if(o(),n>=2)return;const i=t.screenPoint.x-r.originScreenPoint.x,s=t.screenPoint.y-r.originScreenPoint.y;if(i*i+s*s>9)return;const a=e.shapes.get(r.shapeId);if(!a||!Hm(a)||!e.editing.canEditShape(a))return;e.editing.start({shapeId:a.id,entryMode:"placeCaret",caretPagePoint:t.pagePoint,operationKind:AL,preserveInteraction:!0},"user")}(r,o,n,e,()=>{e=null}),void function(e,t,n,r,o){if(!r||r.pointerId!==t.pointerId)return void o();if(o(),n>=2)return;const i=t.screenPoint.x-r.originScreenPoint.x,s=t.screenPoint.y-r.originScreenPoint.y;if(i*i+s*s>9)return;const a=e.shapes.get(r.shapeId),l=e.selection.getIds();if(!a||!_L(a)||a.isLocked||e.state.shapeEditingSession.get()||1!==l.length||l[0]!==a.id||eg(e,a.id,"geo-label"))return;const c=WL(e,a);c&&ig(e,c,{editOperationKind:LL,createOperationKind:$L,isExisting:!1,entryMode:"focusEnd"})}(r,o,n,t,()=>{t=null})}if("pointer"!==o.type||"pointer_cancel"!==o.name){if(r.tools.isInInitialState()){if("keyboard"===o.type&&"key_down"===o.name){if(r.state.shapeEditingSession.get())return;if("Enter"!==o.key||o.altKey||o.accelKey)return;const e=r.selection.getIds(),[t]=r.state.selectedShapes.get();if(1!==e.length||!t||!Hm(t)||!r.editing.canEditShape(t))return;return r.editing.start({shapeId:t.id,entryMode:"selectAll",operationKind:AL},"user"),DL}if("double_click"===o.type)return n(),function(e,t){const n=e.shapes.hitTest(t.pagePoint);if(!n)return!1;if(Hm(n))return!!e.editing.canEditShape(n)&&(e.editing.start({shapeId:n.id,entryMode:"selectAll",operationKind:AL},"user"),!0);return _L(n)?function(e,t){return!t.isLocked&&(zL(e,t.id),!0)}(e,n):!!vL(e,n)&&function(e,t,n){return!t.isLocked&&(BL(e,t.id,n),!0)}(e,n,t.pagePoint)}(r,o)?DL:void 0;if("pointer"===o.type&&"pointer_down"===o.name){n();const s=function(e,t,n,r){const o=e.shapes.hitTest(t.pagePoint);if(!o||!Hm(o)||!e.editing.canEditShape(o))return;const i=e.state.shapeEditingSession.get();if(i&&i.shapeId!==o.id)return e.editing.complete("user")?(e.editing.start({shapeId:o.id,entryMode:"placeCaret",caretPagePoint:t.pagePoint,operationKind:AL,preserveInteraction:!0},"user"),DL):DL;!i&&n<2&&function(e,t){const n=e.selection.getIds();if(1!==n.length)return!1;if(n[0]===t)return!0;const r=ng(e,t);return!!r&&r.behavior.canPlaceCaretWhenOwnerSelected&&n[0]===r.ownerId}(e,o.id)&&r({pointerId:t.pointerId,shapeId:o.id,originScreenPoint:{x:t.screenPoint.x,y:t.screenPoint.y}})}(r,o,i.pointer?.clickCount??1,t=>{e=t});return"stop"===s?.propagation||e?s:void function(e,t,n,r){const o=e.shapes.hitTest(t.pagePoint),i=e.selection.getIds();if(!o||!_L(o)||o.isLocked||e.state.shapeEditingSession.get()||t.shiftKey||t.altKey||t.accelKey||n>=2||1!==i.length||i[0]!==o.id||eg(e,o.id,"geo-label"))return;r({pointerId:t.pointerId,shapeId:o.id,originScreenPoint:{x:t.screenPoint.x,y:t.screenPoint.y}})}(r,o,i.pointer?.clickCount??1,e=>{t=e})}}}else n()}else n()}else n()}},shapePointer:{createSession:(e,t)=>function(e,t){if(t.event.shiftKey||t.event.accelKey||e.state.shapeEditingSession.get()||!Hm(t.shape))return null;const n=e.bindings.getFromShape(t.shape.id).find(yL);if(!n||n.toId!==t.selectionTargetId)return null;const r=e.shapes.get(n.toId),o=e.shapes.getPageBounds(t.shape.id);if(!r||!o||e.layers.isOrAncestorLocked(r.id)||!vL(e,r))return null;const i=o.center.sub(t.originPagePoint);return{shapeId:r.id,operationKind:NL,onDragStart({editor:e}){e.commands.setSelectedShapeIds([r.id],{source:"system"})},update({editor:e,pagePoint:t,source:r}){const o=e.bindings.get(n.id),s=e.shapes.get(n.fromId),a=e.shapes.get(n.toId);if(!yL(o)||!Hm(s)||!a)return"stop";const l=vL(e,a);if(!l)return"stop";const c=FL({editor:e,label:s,pathGeometry:l,pagePoint:t.add(i),hintPosition:o.props.labelPosition,snapToDefault:!0});return Math.abs(c-o.props.labelPosition)>1e-6&&e.commands.updateBinding({id:o.id,props:{labelPosition:c}},{source:r}),{status:"continue",finalPagePoint:l.getPointAt(c)}}}}(e,t)}}}function BL(e,t,n){const r=e.shapes.get(t);if(!r||r.isLocked)return!1;const o=vL(e,r);if(!o)return!1;const i=eg(e,r.id,Ym),s=i??function(e,t,n){const r=vL(e,t);if(!r)return null;const o=HL(t,{...Vm(e),autoSize:!1,textAlign:"middle"}),i=r.getNearestPosition(n,{hintPosition:r.defaultPosition}),s=wL(e,o,t,i),a=tg(e,{bindingType:Ym,owner:t,operationKind:RL,index:`${t.index}${gL}`,layout:s,bindingProps:{labelPosition:i}});if(!a)return null;const l=e.shapes.get(a.id),c=e.bindings.getFromShape(a.id).find(yL);if(!Hm(l)||!c)return a;const d=FL({editor:e,label:l,pathGeometry:r,pagePoint:n,hintPosition:i,snapToDefault:!1});Math.abs(d-i)>1e-6&&e.commands.updateBinding({id:c.id,props:{labelPosition:d}},{source:"user"});return a}(e,r,n??o.getPointAt(o.defaultPosition));return!!s&&(ig(e,s,{editOperationKind:"path-label.edit",createOperationKind:RL,isExisting:!!i}),!0)}function zL(e,t){const n=e.shapes.get(t);if(!n||!_L(n)||n.isLocked)return!1;const r=eg(e,n.id,Xm),o=r??WL(e,n);return!!o&&(ig(e,o,{editOperationKind:LL,createOperationKind:$L,isExisting:!!r,entryMode:r?"selectAll":"focusEnd"}),!0)}function _L(e){return"geo"===e.type}function FL({editor:e,label:t,pathGeometry:n,pagePoint:r,hintPosition:o,snapToDefault:i}){let s=n.getNearestPosition(r,{hintPosition:o});if(i){const t=n.defaultPosition,r=n.getPointAt(t),o=n.getPointAt(s),i=Math.max(e.state.cameraZoom.get(),1e-4);o.dist(r)*i<=10&&(s=t)}const a=kL(e,t,n);return Math.min(a.end,Math.max(a.start,s))}function WL(e,t){const n=OL(e,HL(t,{...Vm(e),autoSize:!1,textAlign:"middle"}),t);return tg(e,{bindingType:Xm,owner:t,operationKind:$L,index:`${t.index}${SL}`,layout:n,bindingProps:{normalizedAnchor:{x:.5,y:.5}}})}function HL(e,t){return{id:"shape:draft",typeName:"shape",scope:"document",type:"text",parentId:e.parentId,index:`${e.index}.label`,x:0,y:0,rotation:0,scaleX:1,scaleY:1,opacity:1,isHidden:!1,isLocked:!1,meta:{},props:t}}function UL({fontCatalog:e=pg()}={}){return{id:"land.text",shapeUtils:[new pL],shapeSvgExporters:[new hL(e)],bindingUtils:[new IL,new bL],interactionHandlers:[jL()],setup(e){e.tools.register("text",e=>new eL(e))}}}var VL=ut("plugin-text.api");function KL({editor:e}){return function({editor:e}){return{create(t){const n=e.shapes.getDefaultProps("text"),[r]=e.commands.createShapes([{type:"text",x:t.x,y:t.y,meta:t.meta?{...t.meta}:void 0,props:{...n,w:t.w??n.w,h:t.h??n.h,font:t.font??n.font,color:t.color??n.color,size:t.size??n.size,textAlign:t.textAlign??n.textAlign,richText:wm(t.text)}}],{source:"user"});return"text"===r?.type?{id:r.id,type:r.type}:null},startEditing(t){const n=t??e.selection.getIds()[0],r=n?e.shapes.get(n):null;return!(!r||"text"!==r.type||r.isLocked)&&(e.editing.start({shapeId:r.id,entryMode:"focusEnd"},"user"),!0)},startEditingGeoLabel(t){const n=e.selection.getIds(),r=t??(1===n.length?n[0]:void 0);return!!r&&zL(e,r)},startEditingPathLabel(t){const n=e.selection.getIds(),r=t??(1===n.length?n[0]:void 0);return!!r&&BL(e,r)},getBoundTextLabel(t){const n=eg(e,t,"geo-label")??eg(e,t,"path-label");return n&&vm(n.props.richText).trim().length>0?{id:n.id,type:n.type}:null},getFormattingSnapshot:()=>function(e){return LR(e)?.getSnapshot()??null}(e),setSelectionStyle(t,n){const r=n?null:LR(e);if(r)return void 0!==t.color&&r.setColor(YL(t.color)),void 0!==t.backgroundColor&&r.setBackgroundColor(YL(t.backgroundColor)),void 0!==t.font&&r.setFont(t.font),void 0!==t.size&&r.setSize(t.size),void 0!==t.textAlign&&r.setTextAlign(t.textAlign),[r.shapeId];const o=qL(e,n).filter(e=>!e.isLocked).map(e=>({id:e.id,props:{...t}}));return o.length>0&&e.commands.updateShapes(o.map(({id:e,props:t})=>({id:e,props:{...t}})),{source:"user"}),o.map(({id:e})=>e)},getInlineFormatState(t,n){const r=n?null:LR(e);if(r)return r.getSnapshot()?.[t]??!1;const o=qL(e,n).map(e=>zR(e.props.richText,t));if(0===o.length)return!1;const i=o[0]??!1;return o.every(e=>e===i)?i:"mixed"},toggleInlineFormat(t,n){const r=n?null:LR(e);if(r)return r.toggle(t);const o=qL(e,n).filter(e=>!e.isLocked),i=!o.every(e=>!0===zR(e.props.richText,t)),s=o.map(e=>({shape:e,richText:_R(e.props.richText,t,i)})).filter(({shape:e,richText:t})=>t!==e.props.richText);return 0!==s.length&&(e.commands.updateShapes(s.map(({shape:e,richText:t})=>({id:e.id,props:{richText:t}})),{source:"user"}),!0)},getBlockType(t){const n=t?null:LR(e);if(n)return n.getSnapshot()?.blockType??null;const r=qL(e,t).map(e=>DR(e.props.richText));if(0===r.length)return null;const o=r[0]??null;return r.every(e=>e===o)?o:"mixed"},setBlockType(t,n){const r=n?null:LR(e);if(r)return r.setBlockType(t);const o=qL(e,n).filter(e=>!e.isLocked).map(e=>({shape:e,richText:jR(e.props.richText,t)})).filter(({shape:e,richText:t})=>t!==e.props.richText);return 0!==o.length&&(e.commands.updateShapes(o.map(({shape:e,richText:t})=>({id:e.id,props:{richText:t}})),{source:"user"}),!0)},clearFormatting(){const t=LR(e);if(t)return t.clearFormatting();const n=e.state.selectedShapes.get().filter(Hm).filter(e=>!e.isLocked).map(e=>({shape:e,richText:WR(e.props.richText)})).filter(({shape:e,richText:t})=>t!==e.props.richText||!C(e.props.backgroundColor));return 0!==n.length&&(e.commands.updateShapes(n.map(({shape:e,richText:t})=>({id:e.id,props:{richText:t,backgroundColor:S("transparent")}})),{source:"user"}),!0)},getLinkHref(){const t=LR(e);if(t)return t.getSnapshot()?.linkHref??null;const n=e.state.selectedShapes.get().filter(Hm).map(e=>function(e){const t=[];if(HR(e.content,(e,n)=>{if("text"!==e.type||!e.text||n.insideCodeBlock||e.marks?.some(e=>"code"===e.type))return;const r=e.marks?.find(e=>"link"===e.type)?.attrs?.href;t.push("string"==typeof r&&r.length>0?r:null)}),0===t.length)return null;const n=t[0]??null;return t.every(e=>e===n)?n:"mixed"}(e.props.richText));if(0===n.length)return null;const r=n[0]??null;return n.every(e=>e===r)?r:"mixed"},setLink(t){const n=LR(e);if(n)return n.setLink(t);const r=null===t?null:um(t);if(null!==t&&null===r)return!1;const o=e.state.selectedShapes.get().filter(Hm).filter(e=>!e.isLocked).map(e=>({shape:e,richText:FR(e.props.richText,r)})).filter(({shape:e,richText:t})=>t!==e.props.richText);return 0!==o.length&&(e.commands.updateShapes(o.map(({shape:e,richText:t})=>({id:e.id,props:{richText:t}})),{source:"user"}),!0)},getToolDefaults:()=>e.shapes.getDefaultProps("text"),setToolDefaults:t=>(e.shapes.updateDefaultProps("text",t),e.shapes.getDefaultProps("text"))}}({editor:e})}function qL(e,t){if(t){const n=e.shapes.get(t);return Hm(n)?[n]:[]}return e.state.selectedShapes.get().filter(Hm)}function YL(e){const t=T(e);return"transparent"===t?null:t}function XL(e={}){const{fontCatalog:t,openLink:n,...r}=e,o={...ug(),...r},i=t??hg(o);return{id:"text",editor:UL({fontCatalog:i}),render:YN({fontCatalog:i,formattingToolbar:o.formattingToolbar,openLink:n,onTiptapEditorChange:o.onTiptapEditorChange}),api:VL,setup:({editor:e})=>({api:KL({editor:e})})}}var JL=XL();function GL(e){return{kind:"svg-inliner",id:"text.svg-inliner",async inline({exportedShapes:t,svg:n}){const r=t.filter(Hm),o=r.map(e=>vm(e.props.richText)).join(""),i=new Set(r.map(e=>e.props.font)),s=[e.defaultFont,...e.fontsById.values()].filter(t=>function({definition:e,isDefault:t,svg:n,usedFontIds:r}){return!!e.source&&"system"!==e.source.kind&&(t&&r.has("default")||r.has(e.id)||n.includes(`font-family:${o=e.cssFamily,o.replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;").replaceAll(">","&gt;")}`));var o}({definition:t,isDefault:t===e.defaultFont,svg:n,usedFontIds:i})),a=(await Promise.all(s.map(e=>async function(e,t){const{source:n}=e;if(!n||"system"===n.kind)return"";if("stylesheet"===n.kind){const r=function(e,t){const n=r$(e);if(t.length>0&&"fonts.googleapis.com"===n.hostname&&!n.searchParams.has("text")){const e=Array.from(new Set(t)).join("");encodeURIComponent(e).length<=1500&&n.searchParams.set("text",e)}return n.href}(n.cssUrl,t),o=await t$(r,e.id);return e$(QL(await ZL(await o.text(),o.url||r,e.id)),e.id)}return async function(e,t){const n="string"==typeof e.src?e$(QL(await ZL(e.src,void 0,t)),t):`url("${await n$(new Blob([e.src],{type:"application/octet-stream"}),t)}")`,r=function(e){return e?[["ascent-override",e.ascentOverride],["descent-override",e.descentOverride],["font-display",e.display],["font-feature-settings",e.featureSettings],["line-gap-override",e.lineGapOverride],["font-stretch",e.stretch],["font-style",e.style],["unicode-range",e.unicodeRange],["font-weight",e.weight]].flatMap(([e,t])=>t?[`;${e}:${t}`]:[]).join(""):""}(e.descriptors);return`@font-face{font-family:${o=e.family,`"${o.replaceAll("\\","\\\\").replaceAll('"','\\"')}"`};src:${n}${r}}`;var o}(n,e.id)}(e,o)))).filter(e=>e.length>0);return a.length>0?function(e,t){const n=e.match(/^<svg\b[^>]*>/u);if(!n)throw new Error("Could not embed font resources in the generated SVG.");const r=`<style type="text/css">${o=t,o.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}</style>`;var o;return`${n[0]}${r}${e.slice(n[0].length)}`}(n,a.join("\n")):n}}}async function ZL(e,t,n){const r=Array.from(e.matchAll(/\burl\(\s*(["']?)(.*?)\1\s*\)/giu),e=>e[2]?.trim()).filter(e=>!!e),o=new Map;for(const i of new Set(r)){if(i.startsWith("data:")||i.startsWith("#"))continue;const e=r$(i,t).href,r=await n$(await(await t$(e,n)).blob(),n);o.set(i,r)}return e.replace(/\burl\(\s*(["']?)(.*?)\1\s*\)/giu,(e,t,n)=>{const r=o.get(n.trim());return r?`url(${t}${r}${t})`:e})}function QL(e){const t=String.raw`\blocal\(\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^)]*)\s*\)`;return e.replace(new RegExp(`${t}\\s*,\\s*`,"giu"),"").replace(new RegExp(`\\s*,\\s*${t}`,"giu"),"").replace(new RegExp(t,"giu"),"")}function e$(e,t){if(!/\burl\(\s*["']?data:/iu.test(e))throw new Error(`Font resource "${t}" has no embeddable source.`);return e}async function t$(e,t){let n;try{n=await fetch(e)}catch(r){throw new Error(`Could not download font resource "${t}".`,{cause:r})}if(!n.ok)throw new Error(`Could not download font resource "${t}" (${n.status}).`);return n}async function n$(e,t){const n=await async function(e){const t=new Uint8Array(await e.arrayBuffer());let n="";for(let r=0;r<t.length;r+=32768)n+=String.fromCharCode(...t.subarray(r,r+32768));return`data:${e.type||"application/octet-stream"};base64,${btoa(n)}`}(e);if(!n)throw new Error(`Could not embed font resource "${t}".`);return n}function r$(e,t){try{return t?new URL(e,t):new URL(e,globalThis.location?.href)}catch(n){throw new Error(`Could not resolve font resource URL "${e}".`,{cause:n})}}function o$({fontCatalog:e}){return{id:"text.svg-export",requires:[JL],setup:()=>({exports:[GL(e)]})}}function i$(e){hm(e)&&window.open(e,"_blank","noopener,noreferrer")}var s$=96;function a$(e,t,n){if(e.state.readonly.get())return null;const r=e.shapes.get(t.shape.id);if(!r||e.layers.isOrAncestorLocked(r.id)||e.shapes.isHidden(r.id))return null;const o=Q(e,r,t.port.id);if(!o)return null;const i=qa(e,{shape:r,port:o},function(e,t,n,r){const o=function(e,t){if("text"===t){const t=e.shapes.getDefaultProps("text"),n=160,r=t.h;return{w:n,h:r,props:{...t,w:n,h:r,autoSize:!1,richText:wm("文字生成"),textAlign:"middle"}}}const n=e.shapes.getDefaultProps("image");return{w:n.w,h:n.h,props:{...n,altText:"图片生成"}}}(e,r),i=t.parentId,s=i.startsWith("shape:")?e.shapes.get(i):null,a=s?e.shapes.computeLocalToPageTransform(s):A.Identity(),l=a.tryInvert(),c=n.pageOutwardNormal.normalize(),d=new p(o.w/2,o.h/2),u=a.applyToPoint(d),h=a.applyToPoint(d.add(new p(o.w/2,0))),f=a.applyToPoint(d.add(new p(0,o.h/2))),m=Math.abs(l$(h.sub(u),c))+Math.abs(l$(f.sub(u),c)),g=n.pagePoint.add(c.mul(96+m)),y=l?.applyToPoint(g)??g;return{type:r,parentId:i,x:y.x-o.w/2,y:y.y-o.h/2,rotation:0,props:o.props}}(e,r,o,n)),s=e.operations.begin({kind:`flow.create-${n}-node`,label:"shape.create",source:"user",history:"record"});try{const t=e.commands.createShapes([i],{source:"user",autoReparent:!1})[0];if(!t||t.type!==n)return s.cancel(),null;const a=Xa(e,t,o.pagePoint);if(!a)return s.cancel(),null;const l=ki(e,{start:bi(r.id,o),end:bi(t.id,a),props:{routing:"curved"},selectionAfter:[t.id]});return l?(s.commit(),{connectorId:l.id,nodeId:t.id}):(s.cancel(),null)}catch(a){throw s.isActive&&s.cancel(),a}}function l$(e,t){return e.x*t.x+e.y*t.y}var c$=184,d$=["left","right"],u$={id:"land.flow.dom-events",handle:({event:e})=>w$(e.target)?"handled":"continue",getCursor:({element:e})=>e?.closest("[data-flow-connector-port]")?"pointer":void 0};function p$(e={}){const t=new Set(e.visiblePortIds??d$);return{id:"land.flow.react",canvasOverlays:[{id:"land.flow.connector-ports",order:110,component:()=> (0,Jt.jsx)(h$,{visiblePortIds:t})}],domEventGuards:[u$]}}var h$=(0,Vt.memo)(function({visiblePortIds:e}){const t=qt(),n=sn(t.state.readonly),r=sn(t.state.tool).activeToolId;sn(t.state.selectedShapes);const o=sn(t.state.shapeEditingSession),i=sn(t.inputs.isSpacePressed),s=sn(t.render.interaction.selectionTranslationActive),a=sn(t.state.cameraZoom),[l,c]=(0,Vt.useState)(null),d=Math.max(a,1e-4),u=ol(t),p="select"===r?u.visibleShapes.filter(e=>u.sourceShapeIds.has(e.id)):[],h=l?function(e,t,n,r){const o=t.find(e=>e.id===n.shapeId);if(!o)return null;const i=Q(e,o,n.portId);return i&&y$(i,r)?{shape:o,port:i}:null}(t,p,l,e):null,f=null!==h,m=null!==l&&null===h;(0,Vt.useEffect)(()=>{m&&c(null)},[m]),(0,Vt.useEffect)(()=>{if(!f)return;const e=e=>{w$(e.target)||c(null)},t=e=>{"Escape"===e.key&&c(null)};return document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t)}},[f]);const g=(0,Vt.useCallback)(e=>{c(t=>t?.shapeId===e.shapeId&&t.portId===e.portId?null:e)},[]),y=(0,Vt.useCallback)(e=>{h&&(a$(t,h,e),c(null))},[t,h]);return n||o||i||s||0===p.length?null: (0,Jt.jsxs)("g",{"data-ui":"flow-connector-ports-overlay",children:[
125
+
126
+ (0,Jt.jsx)("style",{children:v$}),p.flatMap(n=>Z(t,n).map(t=>{if(!y$(t,e))return null;const r={shapeId:n.id,portId:t.id};
127
+ return(0,Jt.jsx)(f$,{isOpen:l?.shapeId===n.id&&l.portId===t.id,onToggle:()=>g(r),port:t,shape:n,zoom:d},`${n.id}:${t.id}`)})),h? (0,Jt.jsx)(m$,{onCreate:y,port:h.port,zoom:d}):null]})});function f$({isOpen:e,onToggle:t,port:n,shape:r,zoom:o}){const i=Wa(n,o),s=24;
128
+ return(0,Jt.jsx)("foreignObject",{"data-flow-connector-port":"true","data-flow-connector-port-id":n.id,"data-flow-connector-port-shape-id":r.id,height:s/o,overflow:"visible",pointerEvents:"all",width:s/o,x:i.x-12/o,y:i.y-12/o,children: (0,Jt.jsx)("div",{style:{height:s,transform:`scale(${1/o})`,transformOrigin:"top left",width:s},children: (0,Jt.jsx)("button",{"aria-expanded":e,"aria-haspopup":"menu","aria-label":"新增节点","data-flow-port-button":"true","data-flow-ui":"true",onClick:t,onPointerDown:e=>{e.preventDefault(),e.stopPropagation()},style:k$,type:"button",children: (0,Jt.jsx)("span",{"data-flow-port-visual":"true",style:S$,children: (0,Jt.jsx)(dr,{"aria-hidden":"true","data-flow-port-plus-icon":"true",size:14,strokeWidth:2.5})})})})})}function m$({onCreate:e,port:t,zoom:n}){const r=qt(),o=sn(r.state.viewportScreenSize),i=function(e,t,n,r){const o=e.viewport.pageToScreen(new p(t.x,t.y)),i=c$,s=120,a=16,l=8,c=n.pageOutwardNormal;let d,u;if(Math.abs(c.x)>=Math.abs(c.y)){const e=c.x>=0?o.x+a:o.x-a-i,t=c.x>=0?o.x-a-i:o.x+a;d=x$(e,i,r.w,l)?e:t,u=o.y-s/2}else{const e=c.y>=0?o.y+a:o.y-a-s,t=c.y>=0?o.y-a-s:o.y+a;d=o.x-i/2,u=x$(e,s,r.h,l)?e:t}const h=e.viewport.screenToPage(new p(b$(d,i,r.w,l),b$(u,s,r.h,l)));return{x:h.x,y:h.y}}(r,Wa(t,n),t,o);
129
+ return(0,Jt.jsx)("foreignObject",{"data-flow-node-menu":"true",height:120/n,overflow:"visible",pointerEvents:"all",width:c$/n,x:i.x,y:i.y,children: (0,Jt.jsxs)("div",{"aria-label":"新增节点","data-flow-ui":"true",onPointerDown:e=>{e.stopPropagation()},role:"menu",style:{...P$,transform:`scale(${1/n})`},children:[
130
+
131
+ (0,Jt.jsx)("div",{"data-flow-menu-title":"true",style:M$,children:"新增节点"}),
132
+
133
+ (0,Jt.jsx)(g$,{icon:ur,label:"文字生成",onSelect:()=>e("text")}),
134
+
135
+ (0,Jt.jsx)(g$,{icon:cr,label:"图片生成",onSelect:()=>e("image")})]})})}function g$({icon:e,label:t,onSelect:n}){
136
+ return(0,Jt.jsxs)("button",{"data-flow-menu-item":t,onClick:n,role:"menuitem",style:I$,type:"button",children:[ (0,Jt.jsx)(e,{"aria-hidden":"true",size:16,strokeWidth:2}), (0,Jt.jsx)("span",{children:t})]})}function y$(e,t){return t.has(e.id)}function x$(e,t,n,r){return e>=r&&e+t<=n-r}function b$(e,t,n,r){return Math.min(Math.max(e,r),Math.max(r,n-t-r))}function w$(e){return e instanceof Element&&!!e.closest("[data-flow-ui]")}var v$='\n [data-flow-port-visual] {\n transition: transform 120ms ease, box-shadow 120ms ease;\n }\n [data-flow-port-button]:hover [data-flow-port-visual],\n [data-flow-port-button][aria-expanded="true"] [data-flow-port-visual],\n [data-flow-port-button]:focus-visible [data-flow-port-visual] {\n transform: scale(1.2);\n }\n [data-flow-port-button]:focus-visible [data-flow-port-visual] {\n box-shadow: 0 0 0 2px var(--popover, #ffffff), 0 0 0 4px var(--land-selection, #2563eb);\n }\n [data-flow-menu-item]:hover,\n [data-flow-menu-item]:focus-visible {\n background: rgba(37, 99, 235, 0.1) !important;\n }\n @media (prefers-reduced-motion: reduce) {\n [data-flow-port-visual] {\n transition: none;\n }\n }\n',k$={alignItems:"center",background:"transparent",border:0,cursor:"pointer",display:"flex",height:"100%",justifyContent:"center",outline:"none",padding:0,width:"100%"},S$={alignItems:"center",background:"var(--land-selection, #2563eb)",borderRadius:"999px",boxShadow:"0 1px 3px rgba(15, 23, 42, 0.24)",color:"#ffffff",display:"flex",height:20,justifyContent:"center",transformOrigin:"center",width:20},P$={background:"var(--popover, #ffffff)",border:"1px solid var(--border, #e2e8f0)",borderRadius:10,boxShadow:"0 12px 30px rgba(15, 23, 42, 0.16)",boxSizing:"border-box",color:"var(--popover-foreground, #0f172a)",display:"flex",flexDirection:"column",fontFamily:"Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",gap:2,padding:6,transformOrigin:"top left",width:c$},M$={color:"var(--muted-foreground, #64748b)",fontSize:12,fontWeight:600,lineHeight:"18px",padding:"2px 8px 4px"},I$={alignItems:"center",background:"transparent",border:0,borderRadius:7,color:"inherit",cursor:"pointer",display:"flex",flexShrink:0,font:"inherit",fontSize:13,fontWeight:500,gap:9,height:34,outline:"none",padding:"0 8px",textAlign:"left",width:"100%"};function E$(e={}){const t=e.visiblePortIds?[...e.visiblePortIds]:void 0;return{id:"flow",requires:[ic,cf,JL],render:p$({visiblePortIds:t})}}var T$=E$();function C$(e,t){return"number"==typeof e&&Number.isFinite(e)?Math.max(1,e):t}var O$=class extends oe{type="group";getGroupingShapeCreateInput({parentId:e,parentLocalBounds:t}){return{type:this.type,x:t.x,y:t.y,parentId:e,props:{w:t.w,h:t.h}}}getDefaultProps(){return{w:1,h:1}}validateProps(e){const t=e&&"object"==typeof e?e:{},n=this.getDefaultProps();return{w:C$(t.w,n.w),h:C$(t.h,n.h)}}getLocalBounds(e){return new h(0,0,e.props.w,e.props.h)}hitTest(e,t){return!1}hitTestLineSegment(e,t){return!1}isSelectionTransformContainer(e){return!0}canUngroupChildren(e){return!0}shouldResizeDescendants(e){return!0}getResizeToFitDescendantsProps(e,t){return this.validateProps({...e.props,w:t.w,h:t.h})}getMinimumChildCount(e){return 2}contributesToExportBounds(e){return!1}canReceiveChildren(e){return!0}canAutomaticallyReceiveChildren(e){return!1}canBeDirectlyBrushSelected(e){return!1}},A$=class{type="group";toSvg(e){return{tag:"g"}}};function R$(){return{id:"land.group",shapeUtils:[new O$],shapeSvgExporters:[new A$]}}function N$(){return{id:"land.group.react",shapeRenderers:[{type:"group",component:L$,hoverComponent:D$}]}}function L$({shape:e,isSelected:t}){
137
+ return(0,Jt.jsx)($$,{shape:e,isSelected:t})}function $$({shape:e,isSelected:t=!1}){const{h:n,w:r}=e.props,o=E(S("#64748b"));
138
+ return(0,Jt.jsx)("svg",{width:"100%",height:"100%",viewBox:`0 0 ${r} ${n}`,style:{display:"block",overflow:"visible"},shapeRendering:"geometricPrecision",children:t? (0,Jt.jsx)("rect",{x:.5,y:.5,width:Math.max(r-1,0),height:Math.max(n-1,0),fill:"none",stroke:o,strokeDasharray:"4 4",strokeWidth:1,vectorEffect:"non-scaling-stroke"}):null})}function D$({shape:e,strokeWidth:t}){const{h:n,w:r}=e.props;
139
+ return(0,Jt.jsx)("svg",{"data-ui":"group-hover-outline",width:"100%",height:"100%",viewBox:`0 0 ${r} ${n}`,style:{display:"block",overflow:"visible",pointerEvents:"none"},shapeRendering:"geometricPrecision",children: (0,Jt.jsx)("rect",{x:0,y:0,width:r,height:n,fill:"none",stroke:pn,strokeWidth:t,vectorEffect:"non-scaling-stroke"})})}var j$={id:"group",editor:R$(),render:N$()};function B$(e){return c(e)&&"html"===e.type}var z$="html.interact",_$={propagation:"stop"};function F$(e,t){const n=e.shapes.get(t);return!(!B$(n)||!e.editing.canEditShape(n))&&!!e.editing.start({shapeId:t,entryMode:"focusEnd",operationKind:z$},"user")}function W$(){return{id:"land.html.interactions",editorEvent:{handleEvent(e,t){if("select"===e.state.tool.get().activeToolId){if("keyboard"===t.type&&"key_down"===t.name&&"Enter"===t.key&&!t.altKey&&!t.accelKey&&!e.state.shapeEditingSession.get()){const t=e.selection.getIds();return 1===t.length&&F$(e,t[0])?_$:void 0}if("double_click"===t.type){const n=e.shapes.hitTest(t.pagePoint);if(n&&F$(e,n.id))return _$}}}}}}var H$=ut("plugin-html.api");function U$({editor:e}){return{create(t){const n=e.shapes.getDefaultProps("html"),[r]=e.commands.createShapes([{type:"html",x:t.x,y:t.y,meta:t.meta?{...t.meta}:void 0,props:{...n,w:t.w??n.w,h:t.h??n.h,html:t.html,title:t.title??n.title}}],{source:"user"});return"html"===r?.type?{id:r.id,type:r.type}:null},update(t,n){const r=e.shapes.get(t);return!(!B$(r)||r.isLocked)&&(e.commands.updateShapes([{id:t,props:{...n}}],{source:"user"}),!0)},startInteracting:t=>F$(e,t)}}function V$(e,t){return"number"==typeof e&&Number.isFinite(e)?Math.max(32,e):t}var K$=class extends oe{type="html";getDefaultProps(){return{w:480,h:320,html:"",title:""}}validateProps(e){const t=e&&"object"==typeof e?e:{},n=this.getDefaultProps();return{w:V$(t.w,n.w),h:V$(t.h,n.h),html:"string"==typeof t.html?t.html:n.html,title:"string"==typeof t.title?t.title:n.title}}getLocalBounds(e){return new h(0,0,e.props.w,e.props.h)}canEdit(e){return!0}canReceiveTerminalBinding(e){return!0}};function q$(e){return e.trim()||"Embedded HTML"}function Y$(){return{id:"land.html",shapeUtils:[new K$],interactionHandlers:[W$()]}}var X$="allow-forms allow-pointer-lock allow-presentation allow-scripts";function J$(e={}){return{id:"land.html.react",shapeRenderers:[{type:"html",component:(t=e.sandbox??"allow-forms allow-pointer-lock allow-presentation allow-scripts",function({editor:e,shape:n,shapeEditingSession:r}){const o=(0,Vt.useRef)(null),i=sn(e.state.readonly),s=i||r?.shapeId===n.id;return(0,Vt.useEffect)(()=>{s&&!i&&o.current?.focus()},[s,i]), (0,Jt.jsx)("iframe",{ref:o,"data-ui":"html-shape-frame",loading:"lazy",referrerPolicy:"no-referrer",sandbox:t,srcDoc:n.props.html,tabIndex:s?0:-1,title:q$(n.props.title),style:{background:"#fff",border:0,display:"block",height:n.props.h,pointerEvents:s?"auto":"none",width:n.props.w}})}),hoverComponent:G$}]};var t}function G$({shape:e,strokeWidth:t}){
140
+ return(0,Jt.jsx)("svg",{"aria-hidden":"true","data-ui":"html-hover-outline",width:"100%",height:"100%",viewBox:`0 0 ${e.props.w} ${e.props.h}`,style:{display:"block",overflow:"visible",pointerEvents:"none"},children: (0,Jt.jsx)("rect",{x:0,y:0,width:e.props.w,height:e.props.h,fill:"none",stroke:pn,strokeWidth:t,vectorEffect:"non-scaling-stroke"})})}function Z$(e={}){return{id:"html",editor:Y$(),render:J$(e),api:H$,setup:({editor:e})=>({api:U$({editor:e})})}}var Q$=Z$(),eD=R("plugin.laser.runtime");function tD(e){return e.runtime.require(eD)}function nD(e,t){const n=e.trail[e.trail.length-1];n&&n.dist2(t)<=1e-6||e.trail.push(t.clone())}function rD(e,t){tD(e).set(t.sessionId,t.trail)}var oD=class extends ie{constructor(e){super(e,"laser"),this.initial="idle",this.addChild(new iD(e,this)),this.addChild(new sD(e,this)),this.addChild(new aD(e,this))}},iD=class extends ie{constructor(e,t){super(e,"idle",t)}onPointerDown(e){0===e.button&&this.transition("pointing",function(e,t){const n={sessionId:tD(e).start(),originScreenPoint:t.screenPoint.clone(),trail:[t.pagePoint.clone()]};return rD(e,n),n}(this.editor,e))}},sD=class extends ie{info=null;constructor(e,t){super(e,"pointing",t)}onEnter(e){this.info=e}onPointerMove(e){this.info&&function(e,t){return e.dist2(t)>=9}(this.info.originScreenPoint,e.screenPoint)&&(nD(this.info,e.pagePoint),rD(this.editor,this.info),this.transition("drawing",this.info))}onPointerUp(){this.info&&tD(this.editor).finish(this.info.sessionId),this.transition("idle")}onCancel(){this.info&&tD(this.editor).finish(this.info.sessionId),this.transition("idle")}onExit(){this.info&&tD(this.editor).finish(this.info.sessionId),this.info=null}},aD=class extends ie{info=null;constructor(e,t){super(e,"drawing",t)}onEnter(e){this.info=e}onPointerMove(e){this.info&&(nD(this.info,e.pagePoint),rD(this.editor,this.info))}onPointerUp(){this.info&&tD(this.editor).finish(this.info.sessionId),this.transition("idle")}onCancel(){this.info&&tD(this.editor).finish(this.info.sessionId),this.transition("idle")}onExit(){this.info&&tD(this.editor).finish(this.info.sessionId),this.info=null}};function lD(){return{id:"land.laser.react",canvasOverlays:[{id:"land.laser.trail-overlay",component:cD}]}}var cD=(0,Vt.memo)(function(){return sn(tD(qt()).activeSignal)? (0,Jt.jsx)(dD,{}):null}),dD=(0,Vt.memo)(function(){const e=qt(),t=tD(e),n=sn(t.trailSignal),r=sn(e.state.cameraZoom),o=Math.max(r,1e-4),i=function(){const[e,t]=(0,Vt.useState)(()=>ID());return(0,Vt.useEffect)(()=>{if("undefined"==typeof window)return;let e=0;const n=r=>{t(r),e=window.requestAnimationFrame(n)};return e=window.requestAnimationFrame(n),()=>{window.cancelAnimationFrame(e)}},[]),e}(),s=(0,Vt.useRef)({sessionId:0,samples:[],sourceLength:0}),a=Math.max(i,ID());let l,c=[];n&&(!function(e,t,n,r){t.sessionId!==e.sessionId&&(e.sessionId=t.sessionId,e.samples=[],e.sourceLength=0);const o=t.points;TD(e,r),o.length<e.sourceLength&&(e.samples=[],e.sourceLength=0);if(o.length===e.sourceLength)return;const i=e.sourceLength,s=o.length-i,a=e.samples[e.samples.length-1]?.time??r-wD*s;for(let l=i;l<o.length;l++){const t=o[l],c=(l-i+1)/s;ED(e,{x:t.x,y:t.y},n,zD(a,r,c))}e.sourceLength=o.length,TD(e,r)}(s.current,n,o,a),c=function(e,t){const n=CD(e,t);return function(e,t){if(e.length<=1)return[...e];const n=.15+.85*(1-t),r=[e[0]];for(let o=1;o<e.length;o++)r.push(BD(r[r.length-1],e[o],n));return r}(n.length>fD?n.slice(-64):n,yD)}(s.current.samples,a),l=s.current.samples[s.current.samples.length-1]?.time);const d="ending"===n?.phase,u=0===c.length,p=d&&u?n.sessionId:null;if((0,Vt.useEffect)(()=>{null!==p&&t.clear(p)},[p,t]),!n||u)return null;const h=d&&void 0!==l?_D(1-(a-l)/MD,0,1):1,f=(g=gD/o,0===(m=c).length||g<=0?null:1===m.length?WD(AD(m[0],g/2,bD))??"":WD(function(e){if(0===e.length)return[];if(1===e.length)return AD(e[0].point,Math.max(e[0].radius,.01),bD);const t=[],n=[];for(const a of e){const e=LD(a.direction);FD(t,DD(a.point,jD(e,a.radius))),FD(n,$D(a.point,jD(e,a.radius)))}const r=[];for(const a of t)FD(r,a);const o=e[e.length-1],i=LD(o.direction),s=function({center:e,direction:t,normal:n,radius:r}){if(r<=0)return[];const o=[];for(let i=1;i<xD;i++){const s=i/xD;o.push($D(e,$D(jD(t,Math.sin(Math.PI*s)*r),jD(n,-Math.cos(Math.PI*s)*r))))}return o}({center:o.point,direction:o.direction,normal:i,radius:o.radius});for(const a of s)FD(r,a);for(let a=n.length-1;a>=0;a--)FD(r,n[a]);return r}(function(e,t){const n=function(e){const t=[0];for(let n=1;n<e.length;n++)t.push(t[n-1]+RD(e[n-1],e[n]));return t}(e),r=n[n.length-1]??0,o=Math.max(t,r);return e.map((r,i)=>{const s=n[i]??0,a=_D(s/o,0,1);return{point:r,direction:OD(e,i),radius:t/2*a,runningLength:s}})}(m,g))));var m,g;return f? (0,Jt.jsxs)("g",{"data-ui":"laser-trail-overlay",style:{opacity:h},children:[ (0,Jt.jsx)("path",{"data-ui":"laser-trail-glow",d:f,fill:pD,style:{filter:`blur(${hD/o}px)`}}), (0,Jt.jsx)("path",{"data-ui":"laser-trail-beam",d:f,fill:uD})]}):null}),uD="rgb(255, 38, 38)",pD="rgba(255, 48, 48, 0.55)",hD=4,fD=64,mD=1,gD=12,yD=.32,xD=8,bD=13,wD=16,vD=8,kD=600,SD=300,PD=1400,MD=400;function ID(){return"undefined"==typeof performance?Date.now():performance.now()}function ED(e,t,n,r){const o=e.samples[e.samples.length-1];if(!o)return void e.samples.push({...t,time:r,velocity:0});const i=mD/n,s=RD(o,t);if(s<i)return void(e.samples[e.samples.length-1]={...o,...t,time:r});const a=s*n/Math.max(vD,r-o.time);e.samples.push({...t,time:r,velocity:zD(o.velocity,a,.68)})}function TD(e,t){e.samples=CD(e.samples,t)}function CD(e,t){const n=e[e.length-1];if(!n)return[];const r=t-_D(kD+n.velocity*SD,kD,PD);if(n.time<r)return[];const o=e.findIndex(e=>e.time>=r);if(-1===o)return[];const i=e.slice(o),s=e[o-1],a=i[0];return s&&a.time>r?[(l=s,c=a,d=_D((r-s.time)/(a.time-s.time),0,1),{...BD(l,c,d),time:zD(l.time,c.time,d),velocity:zD(l.velocity,c.velocity,d)}),...i]:i;var l,c,d}function OD(e,t){if(e.length<=1)return{x:1,y:0};const n=e[t-1]??e[t],r=e[t+1]??e[t];return function(e){const t=Math.sqrt(e.x*e.x+e.y*e.y);return t<=0?{x:1,y:0}:{x:e.x/t,y:e.y/t}}(0===t?DD(r,e[t]):t===e.length-1?DD(e[t],n):DD(r,n))}function AD(e,t,n){const r=[];for(let o=0;o<n;o++){const i=2*Math.PI*o/n;r.push({x:e.x+Math.cos(i)*t,y:e.y+Math.sin(i)*t})}return r}function RD(e,t){return Math.sqrt(ND(e,t))}function ND(e,t){const n=e.x-t.x,r=e.y-t.y;return n*n+r*r}function LD(e){return{x:-e.y,y:e.x}}function $D(e,t){return{x:e.x+t.x,y:e.y+t.y}}function DD(e,t){return{x:e.x-t.x,y:e.y-t.y}}function jD(e,t){return{x:e.x*t,y:e.y*t}}function BD(e,t,n){return{x:zD(e.x,t.x,n),y:zD(e.y,t.y,n)}}function zD(e,t,n){return e+(t-e)*n}function _D(e,t,n){return Math.max(t,Math.min(n,e))}function FD(e,t){const n=e[e.length-1];!n||ND(n,t)>.04?e.push(t):e[e.length-1]=t}function WD(e){if(e.length<2)return null;if(2===e.length)return`M ${UD(e[0])} L ${UD(e[1])} Z`;const t=[`M ${UD(HD(e[0],e[1]))}`];for(let n=1;n<e.length;n++){const r=e[n],o=e[(n+1)%e.length];t.push(`Q ${UD(r)} ${UD(HD(r,o))}`)}return t.push("Z"),t.join(" ")}function HD(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}function UD(e){return`${VD(e.x)},${VD(e.y)}`}function VD(e){return Number.isInteger(e)?`${e}`:e.toFixed(3)}function KD(){return{id:"land.laser",setup(e){e.runtime.provide(eD,function(e){const{atom:t,computed:n}=e.signals,r=t("laser.trail",null);let o=1;return{trailSignal:r,activeSignal:n("laser.active",()=>null!==r.get()),start(){const e=o++;return r.set({sessionId:e,phase:"active",points:[]}),e},set(e,t){const n=r.get();n&&n.sessionId===e&&r.set({sessionId:e,phase:"active",points:t.map(e=>e.clone())})},finish(e){const t=r.get();t&&t.sessionId===e&&r.set({...t,phase:"ending"})},clear(e){r.get()?.sessionId===e&&r.set(null)}}}(e)),e.tools.register("laser",e=>new oD(e))}}}var qD={id:"laser",editor:KD(),render:lD()},YD="path.node",XD="path.control";function JD(e,t){return["node",e,t].map(encodeURIComponent).join("|")}function GD(e,t,n){return["control",n,e,t].map(encodeURIComponent).join("|")}function ZD(e,t){const n=t.split("|").map(e=>{try{return decodeURIComponent(e)}catch{return""}});return"path.node"===e&&3===n.length&&"node"===n[0]?{type:YD,subpathId:n[1],nodeId:n[2]}:"path.control"!==e||4!==n.length||"control"!==n[0]||"in"!==n[1]&&"out"!==n[1]?null:{type:XD,handle:n[1],subpathId:n[2],nodeId:n[3]}}var QD=new WeakMap;function ej(e,t){t?QD.set(e,tj(t)):QD.delete(e)}function tj(e){return{...e,pagePoint:e.pagePoint.clone()}}var nj=["nonzero","evenodd"],rj=["corner","smooth","symmetric"];function oj(e){return c(e)&&"path"===e.type}function ij(e){return"string"==typeof e&&nj.includes(e)}function sj(e){return"string"==typeof e&&rj.includes(e)}function aj(){const e=qt(),t=sn(e.state.tool),n=sn(e.state.shapeEditingSession),r=sn(e.state.selectedShapes),o=sn(e.state.camera);if(sn(e.inputs.state),"select"!==t.activeToolId||!n)return null;const i=1===r.length?r[0]:null;if(!oj(i)||i.id!==n.shapeId)return null;const s=function(e){const t=QD.get(e);return t?tj(t):null}(e);if(!s||s.shapeId!==i.id)return null;const a=8/o.z,l=a/2,c=1.5/o.z;
141
+ return(0,Jt.jsx)("g",{"data-ui":"path-edit-insert-preview",pointerEvents:"none",children: (0,Jt.jsx)("rect",{"data-ui":"path-edit-insert-preview-control-point",x:s.pagePoint.x-l,y:s.pagePoint.y-l,width:a,height:a,rx:2,ry:2,fill:"rgba(219, 234, 254, 0.72)",stroke:"var(--land-selection, #2563eb)",strokeDasharray:`${3/o.z} ${2/o.z}`,strokeWidth:c})})}function lj(e){return Number.isInteger(e)?`${e}`:`${Number(e.toFixed(2))}`}function cj(e){return new p(e.x,e.y)}function dj(e,t){const n=cj(t);if(!function(e,t){return!!e.out||!!t.in}(e,t))return`L ${lj(n.x)} ${lj(n.y)}`;const r=function(e){const t=cj(e);return e.out?t.add(new p(e.out.dx,e.out.dy)):t}(e),o=function(e){const t=cj(e);return e.in?t.add(new p(e.in.dx,e.in.dy)):t}(t);return["C",lj(r.x),lj(r.y),lj(o.x),lj(o.y),lj(n.x),lj(n.y)].join(" ")}function uj(e){const t=e.nodes[0];if(!t)return null;const n=[`M ${lj(t.x)} ${lj(t.y)}`];for(let r=1;r<e.nodes.length;r+=1){const t=e.nodes[r-1],o=e.nodes[r];t&&o&&n.push(dj(t,o))}if(e.closed&&e.nodes.length>1){const r=e.nodes[e.nodes.length-1];r&&n.push(dj(r,t)),n.push("Z")}return n.join(" ")}function pj(e){const t=e.map(uj).filter(e=>null!==e);return t.length>0?t.join(" "):null}var hj=1e-6,fj=1/3,mj=Math.PI/8,gj=new WeakMap;function yj(e){return Number.isFinite(e)}function xj(e){return{dx:e.dx,dy:e.dy}}function bj(e){return{id:e.id,x:e.x,y:e.y,kind:e.kind,...e.in?{in:xj(e.in)}:null,...e.out?{out:xj(e.out)}:null}}function wj(e){return{id:e.id,closed:e.closed,nodes:e.nodes.map(bj)}}function vj(e){return e.map(wj)}function kj(e){return new p(e.x,e.y)}function Sj(e){const t=kj(e);return e.in?t.add(new p(e.in.dx,e.in.dy)):t}function Pj(e){const t=kj(e);return e.out?t.add(new p(e.out.dx,e.out.dy)):t}function Mj(e,t,n,r,o){const i=1-o,s=i*i*i,a=3*i*i*o,l=3*i*o*o,c=o*o*o;return new p(e.x*s+t.x*a+n.x*l+r.x*c,e.y*s+t.y*a+n.y*l+r.y*c)}function Ij(e,t,n){return new p(e.x+(t.x-e.x)*n,e.y+(t.y-e.y)*n)}function Ej(e,t){return[kj(e),Pj(e),Sj(t),kj(t)]}function Tj(e,t){return!!e.out||!!t.in}function Cj(e,t,n){return Tj(e,t)?Mj(...Ej(e,t),n):Ij(kj(e),kj(t),n)}function Oj(e,t,n){const r=kj(t),o=Pj(t),i=Sj(n),s=kj(n);if(t.out||n.in)for(let a=1;a<=18;a+=1)e.push(Mj(r,o,i,s,a/18));else e.push(s)}function Aj(e){const t=e.nodes[0];if(!t)return{id:e.id,closed:e.closed,points:[]};const n=[kj(t)];for(let r=1;r<e.nodes.length;r+=1){const t=e.nodes[r-1],o=e.nodes[r];t&&o&&Oj(n,t,o)}if(e.closed&&e.nodes.length>1){const r=e.nodes[e.nodes.length-1];r&&Oj(n,r,t)}return{id:e.id,closed:e.closed,points:n}}function Rj(e){const t=e.props,n=gj.get(t);if(n)return n;const r=Nj(e.props);return gj.set(t,r),r}function Nj(e){const t=e.subpaths.map(Aj),n=t.flatMap(e=>e.points),r=e.subpaths.flatMap(e=>e.nodes.flatMap(e=>[kj(e),...e.in?[Sj(e)]:[],...e.out?[Pj(e)]:[]])),o=r.length>0?h.FromPoints(r):new h(0,0,1,1),i=Math.max(e.strokeWidth/2,1),s=n.length>0?h.FromPoints(n).expand(i):o.expand(i),a=new h(s.x,s.y,Math.max(s.w,1),Math.max(s.h,1));return{path:pj(e.subpaths),pointBounds:o,localBounds:s,renderBounds:a,outlineVertices:n.map(e=>e.clone()),flattenedSubpaths:t}}function Lj(e,t){return e.map(e=>({...e,nodes:e.nodes.map(e=>function(e,t){const n=t(kj(e)),r=e.in?t(Sj(e)):null,o=e.out?t(Pj(e)):null;return{...e,x:n.x,y:n.y,...r?{in:{dx:r.x-n.x,dy:r.y-n.y}}:{in:null},...o?{out:{dx:o.x-n.x,dy:o.y-n.y}}:{out:null}}}(e,t))}))}function $j(e,t){const n=Nj({...t,subpaths:vj(e)}).pointBounds,r=Number.isFinite(n.x)?n.x:0,o=Number.isFinite(n.y)?n.y:0,i=function(e,t,n){return Lj(e,e=>new p(e.x+t,e.y+n))}(e,-r,-o);return{x:r,y:o,subpaths:i,geometry:Nj({...t,subpaths:i})}}function Dj(e,t){return Lj(e.props.subpaths,e=>t.applyToPoint(e))}function jj(e,t){return pj(Dj(e,t))}function Bj(e,t,n){const r=n.sub(t),o=r.len2();if(0===o)return{distanceSquared:e.dist2(t),t:0};const i=e.sub(t),s=Math.max(0,Math.min(1,(i.x*r.x+i.y*r.y)/o)),a=t.add(r.mul(s));return{distanceSquared:e.dist2(a),t:s}}function zj(e,t,n){return Bj(e,t,n).distanceSquared}function _j(e,t,n){const r=n*n;let o=null;for(const i of e){if(i.nodes.length<2)continue;const e=i.closed?i.nodes.length:i.nodes.length-1;for(let n=0;n<e;n+=1){const e=i.nodes[n],s=i.nodes[(n+1)%i.nodes.length];if(!e||!s)continue;const a=Tj(e,s)?32:1;let l=kj(e);for(let n=1;n<=a;n+=1){const c=Cj(e,s,n/a),d=Bj(t,l,c),u=(n-1+d.t)/a;u>.02&&u<.98&&d.distanceSquared<=r&&(!o||d.distanceSquared<o.distanceSquared)&&(o={subpathId:i.id,startNodeId:e.id,endNodeId:s.id,t:u,point:Cj(e,s,u),distanceSquared:d.distanceSquared}),l=c}}}return o?{subpathId:o.subpathId,startNodeId:o.startNodeId,endNodeId:o.endNodeId,t:o.t,point:o.point.clone(),distance:Math.sqrt(o.distanceSquared)}:null}function Fj(e,t){return e.find(e=>e.id===t)??null}function Wj(e,t,n){return Fj(e,t)?.nodes.find(e=>e.id===n)??null}function Hj(e,t,n,r){return e.map(e=>e.id!==t?wj(e):{...e,nodes:e.nodes.map(e=>e.id===n?r(bj(e)):bj(e))})}function Uj(e,t,n){const r=Xj(t);return 0===r.size?vj(e):e.map(e=>{const t=r.get(e.id);return t?{...e,nodes:e.nodes.map(e=>t.has(e.id)?n(bj(e)):bj(e))}:wj(e)})}function Vj(e,t,n){return e.map(e=>{if(e.id!==t)return wj(e);const r=e.nodes.findIndex(e=>e.id===n),o=e.nodes[r];if(!o)return wj(e);const i=r>0?e.nodes[r-1]:e.closed?e.nodes[e.nodes.length-1]:null,s=r<e.nodes.length-1?e.nodes[r+1]:e.closed?e.nodes[0]:null,a=kj(o),l=function(e,t,n){const r=t?kj(t):null,o=n?kj(n):null;if(r&&o){const t=o.sub(r);if(t.len()<=hj)return null;const n=t.normalize();return function(e,t){const n=Math.abs(e.x*t.y-e.y*t.x),r=e.len()*t.len();return r<=hj||n/r<=.001}(r.sub(e),o.sub(e))?n.rot(mj):n}const i=o?o.sub(e):r?e.sub(r):null;return!i||i.len()<=hj?null:i.normalize().rot(mj)}(a,i,s),c=e.nodes.map(bj);return c[r]={...bj(o),kind:"smooth",in:i&&l?aB(l.mul(-a.dist(kj(i))*fj)):null,out:s&&l?aB(l.mul(a.dist(kj(s))*fj)):null},{...e,nodes:c}})}function Kj(e,t,n){return Hj(e,t,n,e=>({...e,kind:"corner",in:null,out:null}))}function qj(e,t,n){return null!==Yj(e,t,n)}function Yj(e,t,n,r=t.at(-1)??null){if(!function(e){const t=new Set;for(const n of e){if(!n.id||t.has(n.id))return!1;t.add(n.id);const e=new Set;for(const t of n.nodes){if(!t.id||e.has(t.id))return!1;e.add(t.id)}}return!0}(e))return null;const o=function(e){const t=new Set,n=[];for(const r of e){const e=JSON.stringify([r.subpathId,r.nodeId]);t.has(e)||(t.add(e),n.push({subpathId:r.subpathId,nodeId:r.nodeId}))}return n}(t);if(o.length<2)return null;let i;switch(n){case"merge":i=function(e,t){const n=Jj(t);if(null!==n)return function(e,t,n){const r=e.findIndex(e=>e.id===t),o=e[r];if(!o)return null;const i=function(e,t){const n=t.map(t=>e.nodes.findIndex(e=>e.id===t.nodeId));if(n.some(e=>e<0))return null;const r=Array.from(new Set(n)).sort((e,t)=>e-t);if(r.length!==t.length)return null;if(!e.closed)return r.every((e,t)=>0===t||e===r[t-1]+1)?r:null;if(r.length===e.nodes.length)return r;const o=r.flatMap((t,n)=>{const o=r[(n+1)%r.length];return(t+1)%e.nodes.length===o?[]:[n]});if(1!==o.length)return null;const i=(o[0]+1)%r.length;return[...r.slice(i),...r.slice(0,i)]}(o,n);if(!i||i.length<2)return null;const s=new Set(i),a=i.map(e=>o.nodes[e]),l=i[0],c=a[0],d=a[a.length-1],u=a.reduce((e,t)=>e.add(kj(t)),p.Zero()).div(a.length),h={...bj(c),x:u.x,y:u.y,kind:"corner",in:rB(c.in,kj(c),u),out:rB(d.out,kj(d),u)},f=o.nodes.flatMap((e,t)=>s.has(t)?t===l?[h]:[]:[bj(e)]),m=o.closed&&f.length>=3;o.closed&&!m&&nB(f);return{subpaths:iB(e,r,[{...o,closed:m,nodes:f}]),selectedNodes:[{subpathId:t,nodeId:h.id}]}}(e,n,t);const r=Gj(e,t);return r?function(e,t){const[n,r]=t,o=Qj(n),i=eB(r),s=o[o.length-1],a=i[0],l=kj(s).add(kj(a)).div(2),c={...bj(s),x:l.x,y:l.y,kind:"corner",in:rB(s.in,kj(s),l),out:rB(a.out,kj(a),l)},{nodes:d}=oB(i.slice(1),new Set([...o.slice(0,-1).map(e=>e.id),c.id]),"merged"),u={...n.subpath,closed:!1,nodes:[...o.slice(0,-1),c,...d]};return{subpaths:sB(e,t,u),selectedNodes:[{subpathId:u.id,nodeId:c.id}]}}(e,r):null}(e,o);break;case"join":i=function(e,t){if(2!==t.length)return null;const n=Jj(t);if(null!==n)return function(e,t,n){const r=e.findIndex(e=>e.id===t),o=e[r];if(!o||o.closed||o.nodes.length<3)return null;const i=new Set([o.nodes[0].id,o.nodes[o.nodes.length-1].id]);if(2!==n.length||n.some(e=>!i.has(e.nodeId)))return null;const s=o.nodes.map(bj);return s[0]={...s[0],kind:"corner",in:null},s[s.length-1]={...s[s.length-1],kind:"corner",out:null},{subpaths:iB(e,r,[{...o,closed:!0,nodes:s}]),selectedNodes:n.map(e=>({...e}))}}(e,n,t);const r=Gj(e,t);return r?function(e,t){const[n,r]=t,o=Qj(n),{nodes:i,nodeIdMap:s}=oB(eB(r),new Set(o.map(e=>e.id)),"joined"),a=o[o.length-1],l=i[0];o[o.length-1]={...a,kind:"corner",out:null},i[0]={...l,kind:"corner",in:null};const c={...n.subpath,closed:!1,nodes:[...o,...i]};return{subpaths:sB(e,t,c),selectedNodes:[{subpathId:c.id,nodeId:n.node.id},{subpathId:c.id,nodeId:s.get(r.node.id)??r.node.id}]}}(e,r):null}(e,o);break;case"separate":i=function(e,t){if(2!==t.length)return null;const n=Jj(t);if(null===n)return null;const r=e.findIndex(e=>e.id===n),o=e[r];if(!o||o.nodes.length<2)return null;const i=function(e,t){const[n,r]=t.map(t=>e.nodes.findIndex(e=>e.id===t.nodeId));return void 0===n||void 0===r||n<0||r<0?-1:r===n+1?n:n===r+1?r:e.closed?n===e.nodes.length-1&&0===r?n:r===e.nodes.length-1&&0===n?r:-1:-1}(o,t);if(i<0)return null;if(o.closed){const n=[...o.nodes.slice(i+1).map(bj),...o.nodes.slice(0,i+1).map(bj)];return nB(n),{subpaths:iB(e,r,[{...o,closed:!1,nodes:n}]),selectedNodes:t.map(e=>({...e}))}}const s=o.nodes.slice(0,i+1).map(bj),a=o.nodes.slice(i+1).map(bj);nB(s),nB(a);const l=s.length>=2?{...o,closed:!1,nodes:s}:null,c=function(e,t){const n=new Set(e.map(e=>e.id));if(!n.has(t))return t;let r=2;for(;n.has(`${t}:${r}`);)r+=1;return`${t}:${r}`}(e,`${o.id}:split`),d=a.length>=2?{...o,id:c,closed:!1,nodes:a}:null,u=[l,d].filter(e=>null!==e),p=new Set(s.map(e=>e.id)),h=new Set(a.map(e=>e.id)),f=t.flatMap(e=>l&&p.has(e.nodeId)?[{subpathId:l.id,nodeId:e.nodeId}]:d&&h.has(e.nodeId)?[{subpathId:d.id,nodeId:e.nodeId}]:[]);return{subpaths:iB(e,r,u),selectedNodes:f}}(e,o)}if(!i)return null;const s=r?o.findIndex(e=>{return n=r,(t=e).subpathId===n.subpathId&&t.nodeId===n.nodeId;var t,n}):-1;return{...i,primaryNode:i.selectedNodes[s]??i.selectedNodes.at(-1)??null}}function Xj(e){const t=new Map;for(const n of e){const e=t.get(n.subpathId)??new Set;e.add(n.nodeId),t.set(n.subpathId,e)}return t}function Jj(e){const t=e[0];return t&&e.every(e=>e.subpathId===t.subpathId)?t.subpathId:null}function Gj(e,t){if(2!==t.length)return null;const n=Zj(e,t[0]),r=Zj(e,t[1]);return n&&r&&n.subpathIndex!==r.subpathIndex?[n,r]:null}function Zj(e,t){const n=e.findIndex(e=>e.id===t.subpathId),r=e[n];if(!r||r.closed)return null;const o=r.nodes.findIndex(e=>e.id===t.nodeId),i=r.nodes[o];return!i||0!==o&&o!==r.nodes.length-1?null:{subpath:r,subpathIndex:n,endpoint:0===o?"start":"end",node:i}}function Qj(e){return"end"===e.endpoint?e.subpath.nodes.map(bj):tB(e.subpath.nodes)}function eB(e){return"start"===e.endpoint?e.subpath.nodes.map(bj):tB(e.subpath.nodes)}function tB(e){return[...e].reverse().map(e=>({...bj(e),in:e.out?xj(e.out):null,out:e.in?xj(e.in):null}))}function nB(e){0!==e.length&&(e[0]={...e[0],kind:"corner",in:null},e[e.length-1]={...e[e.length-1],kind:"corner",out:null})}function rB(e,t,n){return e?aB(t.add(new p(e.dx,e.dy)).sub(n)):null}function oB(e,t,n){const r=new Map;return{nodes:e.map(e=>{let o=e.id;if(t.has(o)){let r=1,i=`${o}:${n}`;for(;t.has(i);)r+=1,i=`${e.id}:${n}:${r}`;o=i}return t.add(o),r.set(e.id,o),{...bj(e),id:o}}),nodeIdMap:r}}function iB(e,t,n){return e.flatMap((e,r)=>r===t?n.map(wj):[wj(e)])}function sB(e,t,n){const r=Math.min(t[0].subpathIndex,t[1].subpathIndex),o=new Set([t[0].subpathIndex,t[1].subpathIndex]);return e.flatMap((e,t)=>t===r?[n]:o.has(t)?[]:[wj(e)])}function aB(e){return e.len2()<=1e-12?null:{dx:e.x,dy:e.y}}function lB(e,t,n){return e.map(e=>{if(e.id!==t.subpathId)return wj(e);const r=e.nodes.findIndex(e=>e.id===t.startNodeId);if(r<0)return wj(e);const o=(r+1)%e.nodes.length,i=e.nodes[r],s=e.nodes[o];if(!i||!s||s.id!==t.endNodeId)return wj(e);const a=function(e,t,n,r){if(!Tj(e,t)){const o=Ij(kj(e),kj(t),n);return{start:bj(e),node:{id:r,x:o.x,y:o.y,kind:"corner"},end:bj(t)}}const[o,i,s,a]=Ej(e,t),l=Ij(o,i,n),c=Ij(i,s,n),d=Ij(s,a,n),u=Ij(l,c,n),p=Ij(c,d,n),h=Ij(u,p,n);return{start:{...bj(e),out:aB(l.sub(o))},node:{id:r,x:h.x,y:h.y,kind:"smooth",in:aB(u.sub(h)),out:aB(p.sub(h))},end:{...bj(t),in:aB(d.sub(a))}}}(i,s,t.t,n),l=e.nodes.map(bj);return l[r]=a.start,l[o]=a.end,l.splice(r+1,0,a.node),{...e,nodes:l}})}var cB=new WeakMap;function dB(e){const t=cB.get(e);return t?function(e){return{shapeId:e.shapeId,nodes:e.nodes.map(e=>({...e})),primary:{...e.primary}}}(t):null}function uB(e){const t=cB.get(e);if(!t)return null;if(e.state.shapeEditingSession.get()?.shapeId!==t.shapeId)return null;const n=e.shapes.get(t.shapeId);if(!oj(n))return null;const r=t.nodes.flatMap(e=>{const t=Fj(n.props.subpaths,e.subpathId)?.nodes.find(t=>t.id===e.nodeId);return t?[{ref:{...e},node:t}]:[]});if(0===r.length)return null;const o=r.some(({ref:e})=>xB(e,t.primary))?t.primary:r[r.length-1].ref;return{selection:{shapeId:n.id,nodes:r.map(({ref:e})=>({...e})),primary:{...o}},shape:n,entries:r}}function pB(e){const t=cB.get(e);cB.delete(e),e.state.shapeEditingSession.get()?.shapeId===t?.shapeId&&yB(e,null)}function hB(e,t,n,r){const o={subpathId:n,nodeId:r};fB(e,t,[o],o)}function fB(e,t,n,r=n.at(-1)??null){const o=function(e,t,n){const r=function(e){const t=new Set,n=[];for(const r of e){const e=JSON.stringify([r.subpathId,r.nodeId]);t.has(e)||(t.add(e),n.push({...r}))}return n}(t).filter(t=>null!==gB(e,t));if(0===r.length)return null;const o=(n&&r.find(e=>xB(e,n)))??r[r.length-1];return{shapeId:e.id,nodes:r,primary:{...o}}}(t,n,r);if(!o)return void pB(e);cB.set(e,o);const i=gB(t,o.primary);yB(e,i?e.shapes.computeLocalToPageTransform(t).applyToPoint(kj(i)):null)}function mB(e,t,n){return e.nodes.some(e=>e.subpathId===t&&e.nodeId===n)}function gB(e,t){return Fj(e.props.subpaths,t.subpathId)?.nodes.find(e=>e.id===t.nodeId)??null}function yB(e,t){const n=e.state.shapeEditingSession.get();n&&e.session.update({shapeEditingSession:{...n,caretPagePoint:t?{x:t.x,y:t.y}:void 0}},"system")}function xB(e,t){return e.subpathId===t.subpathId&&e.nodeId===t.nodeId}var bB="land.path.draftSubpathId",wB="land.path.previewNodeId";function vB(e){const t=e.meta[bB],n=e.meta[wB];return{subpathId:"string"==typeof t?t:null,previewNodeId:"string"==typeof n?n:null}}function kB(e,t){const n=SB(e);return t.subpathId&&(n[bB]=t.subpathId),t.previewNodeId&&(n[wB]=t.previewNodeId),n}function SB(e){const t={...e};return delete t[bB],delete t[wB],t}var PB="var(--land-selection, #2563eb)",MB="rgba(255, 255, 255, 0.98)";function IB(){const e=qt(),t=sn(e.state.tool),n=sn(e.inputs.state),r=sn(e.state.selectedShapes),o=sn(e.state.camera);if("path"!==t.activeToolId)return null;const i=1===r.length?r[0]:null,s=oj(i)?i:null,a=8/o.z,l=1.5/o.z,c=6/o.z,d=1/o.z,u=n.currentPagePoint;if(!s)return u? (0,Jt.jsx)(CB,{point:u,size:a,strokeWidth:l,variant:"candidate"}):null;const p=function(e,t){const n=vB(t);if(!n.subpathId)return null;const r=Fj(Dj(t,e.shapes.computeLocalToPageTransform(t)),n.subpathId);if(!r)return null;const o=n.previewNodeId?r.nodes.findIndex(e=>e.id===n.previewNodeId):-1,i=o>=0?r.nodes[o]??null:null,s=o>0?r.nodes[o-1]??null:null,a=s&&i?uj({id:`${r.id}:preview`,closed:!1,nodes:[s,i]}):null;return{closed:r.closed,committedNodes:r.nodes.filter(e=>e.id!==n.previewNodeId),previewNode:i,previewPath:a}}(e,s);if(!p)return u? (0,Jt.jsx)(CB,{point:u,size:a,strokeWidth:l,variant:"candidate"}):null;const h=p.previewNode?kj(p.previewNode):n.isPointing?null:u,f=h&&!p.committedNodes.some(e=>kj(e).dist2(h)<=.25/(o.z*o.z));
142
+ return(0,Jt.jsxs)("g",{"data-ui":"path-draft-overlay",pointerEvents:"none",children:[p.previewPath? (0,Jt.jsx)("path",{"data-ui":"path-draft-preview-segment",d:p.previewPath,fill:"none",stroke:PB,strokeWidth:Math.max(l,1/o.z),strokeDasharray:`${6/o.z} ${4/o.z}`,strokeLinecap:"round",strokeLinejoin:"round"}):null,f? (0,Jt.jsx)(CB,{point:h,size:a,strokeWidth:l,variant:"candidate"}):null,p.committedNodes.map((e,t)=> (0,Jt.jsx)(EB,{node:e,showIn:p.closed||t>0,size:c,strokeWidth:d},e.id)),p.committedNodes.map(e=> (0,Jt.jsx)(CB,{point:kj(e),size:a,strokeWidth:l,variant:"committed"},e.id))]})}function EB({node:e,showIn:t,size:n,strokeWidth:r}){const o=kj(e);
143
+ return(0,Jt.jsxs)(Jt.Fragment,{children:[t&&e.in? (0,Jt.jsx)(TB,{anchor:o,point:Sj(e),size:n,strokeWidth:r,variant:"in"}):null,e.out? (0,Jt.jsx)(TB,{anchor:o,point:Pj(e),size:n,strokeWidth:r,variant:"out"}):null]})}function TB({anchor:e,point:t,size:n,strokeWidth:r,variant:o}){const i=n/2;
144
+ return(0,Jt.jsxs)("g",{"data-ui":"path-draft-curve-handle","data-path-draft-curve-handle":o,children:[ (0,Jt.jsx)("line",{"data-ui":"path-draft-control-line",x1:e.x,y1:e.y,x2:t.x,y2:t.y,stroke:"rgba(37, 99, 235, 0.44)",strokeWidth:r}), (0,Jt.jsx)("rect",{"data-ui":"path-draft-control-handle",x:t.x-i,y:t.y-i,width:n,height:n,fill:MB,stroke:PB,strokeWidth:r})]})}function CB({point:e,size:t,strokeWidth:n,variant:r}){const o=t/2;
145
+ return(0,Jt.jsx)("rect",{"data-ui":"path-draft-control-point","data-path-draft-control-point":r,x:e.x-o,y:e.y-o,width:t,height:t,rx:2,ry:2,fill:"candidate"===r?"rgba(219, 234, 254, 0.98)":MB,stroke:PB,strokeWidth:n})}function OB({shape:e,shapeEditingSession:t=null,fill:n=e.props.fill,stroke:r=e.props.stroke,strokeWidth:o=e.props.strokeWidth}){const{renderBounds:i}=Rj({props:{...e.props,strokeWidth:o}}),s=RB(e);if(!s)return null;const a=t?.shapeId===e.id;
146
+ return(0,Jt.jsxs)("svg",{width:"100%",height:"100%",viewBox:`${i.x} ${i.y} ${Math.max(i.w,1)} ${Math.max(i.h,1)}`,style:{display:"block",overflow:"visible"},shapeRendering:"geometricPrecision",children:[C(n)?null: (0,Jt.jsx)("path",{d:s,fill:E(n),fillRule:e.props.fillRule,clipRule:e.props.fillRule,stroke:"none"}),
147
+
148
+ (0,Jt.jsx)("path",{d:s,fill:"none",stroke:E(r),strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),a? (0,Jt.jsx)(NB,{shape:e}):null]})}function AB({shape:e,strokeWidth:t}){const{renderBounds:n}=Rj(e),r=RB(e);return r? (0,Jt.jsx)("svg",{"data-ui":"path-hover-outline",width:"100%",height:"100%",viewBox:`${n.x} ${n.y} ${Math.max(n.w,1)} ${Math.max(n.h,1)}`,style:{display:"block",overflow:"visible",pointerEvents:"none"},shapeRendering:"geometricPrecision",children: (0,Jt.jsx)("path",{d:r,fill:"none",stroke:pn,strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})}):null}function RB(e){const t=function(e){return vB(e).previewNodeId}(e);return pj(function(e,t){return t?e.map(e=>({...e,nodes:e.nodes.filter(e=>e.id!==t).map(e=>({...e}))})).filter(e=>e.nodes.length>0):e.map(e=>({...e,nodes:e.nodes.map(e=>({...e}))}))}(e.props.subpaths,t))}function NB({shape:e}){
149
+ return(0,Jt.jsx)(Jt.Fragment,{children:e.props.subpaths.flatMap(e=>e.nodes.flatMap(t=>{const n=kj(t),r=[];if(t.in){const o=Sj(t);r.push( (0,Jt.jsx)("line",{x1:n.x,y1:n.y,x2:o.x,y2:o.y,stroke:"rgba(37, 99, 235, 0.44)",strokeWidth:1,strokeDasharray:"4 3",vectorEffect:"non-scaling-stroke"},`${e.id}:${t.id}:in`))}if(t.out){const o=Pj(t);r.push( (0,Jt.jsx)("line",{x1:n.x,y1:n.y,x2:o.x,y2:o.y,stroke:"rgba(37, 99, 235, 0.44)",strokeWidth:1,strokeDasharray:"4 3",vectorEffect:"non-scaling-stroke"},`${e.id}:${t.id}:out`))}return r}))})}function LB(){return{id:"land.path.react",canvasOverlays:[{id:"land.path.draft-overlay",component:IB,order:20},{id:"land.path.edit-insert-preview-overlay",component:aj,order:21}],shapeRenderers:[{type:"path",component:$B,hoverComponent:DB}],selectionCustomHandleRenderers:[{type:YD,component:jB},{type:XD,component:BB}]}}function $B({shape:e,shapeEditingSession:t}){
150
+ return(0,Jt.jsx)(OB,{shape:e,shapeEditingSession:t})}function DB({shape:e,strokeWidth:t}){
151
+ return(0,Jt.jsx)(AB,{shape:e,strokeWidth:t})}function jB({handle:e,strokeWidth:t}){const n=zB(e.type,e.id);
152
+ return(0,Jt.jsx)("rect",{"data-selection-custom-handle":e.id,"data-selection-custom-handle-type":e.type,"data-selection-custom-handle-id":e.id,x:e.bounds.x,y:e.bounds.y,width:e.bounds.w,height:e.bounds.h,rx:2,ry:2,fill:n?"rgba(219, 234, 254, 0.98)":"rgba(255,255,255,0.98)",stroke:n?"rgba(29, 78, 216, 1)":"rgba(37, 99, 235, 0.94)",strokeWidth:n?1.5*t:t,style:{cursor:e.cursor??"grab",pointerEvents:"auto"}})}function BB({handle:e,strokeWidth:t}){const n=zB(e.type,e.id);
153
+ return(0,Jt.jsx)("circle",{"data-selection-custom-handle":e.id,"data-selection-custom-handle-type":e.type,"data-selection-custom-handle-id":e.id,cx:e.point.x,cy:e.point.y,r:Math.max(e.bounds.w,e.bounds.h)/2,fill:n?"rgba(29, 78, 216, 1)":"rgba(37, 99, 235, 0.92)",stroke:"rgba(255,255,255,0.96)",strokeWidth:n?1.5*t:t,style:{cursor:e.cursor??"grab",pointerEvents:"auto"}})}function zB(e,t){const n=qt();sn(n.state.shapeEditingSession);const r=dB(n),o=ZD(e,t);return!!r&&!!o&&mB(r,o.subpathId,o.nodeId)}var _B=class{editor;deactivateHistoryScope=null;session=null;subscribers=new Set;constructor(e){this.editor=e}start(e,t,n){const r=this.editor.shapes.get(t);if(!oj(r))return!1;if(this.session?.mode===e&&this.session.shapeId===t)return!0;this.clear();const o=[FB(this.editor,r,e)];this.session={mode:e,shapeId:t,snapshots:o,index:o.length-1,initialShapeSignature:WB(r),onApply:n?.onApply,onBoundaryUndo:n?.onBoundaryUndo};const i={getState:()=>this.getState(),subscribe:e=>this.subscribe(e),undo:()=>this.undo(),redo:()=>this.redo()};return this.deactivateHistoryScope=this.editor.history.activateScope(i),this.notify(),!0}record(e){const t=this.session,n=this.editor.shapes.get(e);if(!t||t.shapeId!==e||!oj(n))return!1;const r=FB(this.editor,n,t.mode);return t.snapshots[t.index]?.signature===r.signature?(t.snapshots[t.index]=r,!1):(t.snapshots=[...t.snapshots.slice(0,t.index+1),r],t.index=t.snapshots.length-1,this.notify(),!0)}replaceCurrent(e){const t=this.session,n=this.editor.shapes.get(e);if(!t||t.shapeId!==e||!oj(n))return!1;const r=FB(this.editor,n,t.mode),o=t.snapshots[t.index];return t.snapshots[t.index]=r,o?.signature!==r.signature&&(this.notify(),!0)}end(e,t){return this.session?.mode===e&&this.session.shapeId===t&&(this.clear(),!0)}hasNetChanges(e,t){const n=this.session,r=this.editor.shapes.get(t);return!(!n||n.mode!==e||n.shapeId!==t)&&(!oj(r)||n.initialShapeSignature!==WB(r))}undo(){const e=this.session;return!!e&&(e.index<=0?e.onBoundaryUndo?.()??!1:this.applySnapshot(e.index-1))}redo(){const e=this.session;return!(!e||e.index>=e.snapshots.length-1)&&this.applySnapshot(e.index+1)}applySnapshot(e){const t=this.session,n=t?.snapshots[e];if(!t||!n)return!1;const r=this.editor.shapes.get(t.shapeId);if(!oj(r))return this.clear(),!1;t.index=e;const o=dB(this.editor);this.editor.commands.updateShapes([{id:t.shapeId,..."create"===t.mode&&n.draftMeta?{meta:kB(r.meta,n.draftMeta)}:{},props:{subpaths:vj(n.subpaths)}}],{source:"user"});const i=this.editor.shapes.get(t.shapeId);oj(i)&&t.onApply?.(i);const s=n.selection??o;return s&&oj(i)&&this.editor.state.shapeEditingSession.get()?.shapeId===t.shapeId?fB(this.editor,i,s.nodes,s.primary):pB(this.editor),this.notify(),!0}getState(){const e=this.session?.index??0,t=(this.session?.snapshots.length??1)-1;return{canUndo:e+(this.session?.onBoundaryUndo?1:0)>0,canRedo:e<t}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}clear(){(this.session||this.deactivateHistoryScope)&&(this.session=null,this.deactivateHistoryScope?.(),this.deactivateHistoryScope=null,this.notify())}notify(){for(const e of this.subscribers)e()}};function FB(e,t,n){const r=vj(t.props.subpaths),o="create"===n?vB(t):null;return{subpaths:r,draftMeta:o,selection:dB(e),signature:JSON.stringify({subpaths:r,draftMeta:o})}}function WB(e){return JSON.stringify(function(e){return{...e,meta:{...e.meta},props:{...e.props,fill:{...e.props.fill},stroke:{...e.props.stroke},subpaths:vj(e.props.subpaths)}}}(e))}var HB=new WeakMap;function UB(e){const t=HB.get(e);if(t)return t;const n=new _B(e);return HB.set(e,n),n}function VB(e,t,n,r){return UB(e).start(t,n,r)}function KB(e,t){return UB(e).record(t)}function qB(e,t,n){return UB(e).end(t,n)}var YB=new WeakMap;function XB(e){return YB.get(e)??!1}function JB(e){return function(e,t){const n=e.state.shapeEditingSession.get(),r=n?e.shapes.get(n.shapeId):null;return!(!n||!oj(r))&&(XB(e)===t||(YB.set(e,t),t||e.snaps.clearIndicators(),e.session.update({shapeEditingSession:{...n}},"system")),t)}(e,!XB(e))}function GB(e){YB.delete(e),e.snaps.clearIndicators()}function ZB(e){let t=null;const n=le("path.editSnap.lifecycle",e.state.shapeEditingSession,()=>{const n=e.state.shapeEditingSession.get(),r=n?e.shapes.get(n.shapeId):null,o=oj(r)?r.id:null;if(o!==t){if(t){const n=function(e,t,n){return UB(e).hasNetChanges(t,n)}(e,"edit",t);qB(e,"edit",t),n||e.editing.cancelOperation()}t=o,pB(e),GB(e),o&&VB(e,"edit",o,{onBoundaryUndo:()=>{if(e.state.shapeEditingSession.get()?.shapeId!==o)return!1;const t=e.editing.complete("user");return t&&"select"!==e.state.tool.get().activeToolId&&e.commands.setActiveTool("select",{source:"system"}),t}})}});return()=>{n(),t&&qB(e,"edit",t),pB(e),GB(e)}}var QB="path.edit",ez=Math.PI/4,tz={propagation:"stop"},nz=1,rz=new WeakMap,oz=new WeakMap;function iz(e){const t=e.state.shapeEditingSession.get();if(!t)return null;const n=e.shapes.get(t.shapeId);return oj(n)?n:null}function sz(e,t,n){return e.shapes.computeLocalToPageTransform(t).invert().applyToPoint(n)}function az(e){ej(e,null)}function lz(e){az(e),pB(e)}function cz(e){return e.shiftKey}function dz(e){return JSON.stringify([e.subpathId,e.nodeId])}function uz(e,t){const n=rz.get(e);if(!n)return;if(t.pointerId!==n.pointerId)return;const r=e.shapes.get(n.shapeId);if(!oj(r))return void pz(e);if(!(n.isActive||(o=n.originScreenPoint,i=t.screenPoint,o.dist2(i)>=9)))return;var o,i;n.isActive=!0;const s=function(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y),o=Math.max(e.x,t.x),i=Math.max(e.y,t.y);return new h(n,r,o-n,i-r)}(n.originPagePoint,t.pagePoint),a=function(e,t,n){const r=e.shapes.computeLocalToPageTransform(t);return t.props.subpaths.flatMap(e=>e.nodes.flatMap(t=>{const o=r.applyToPoint(kj(t));return n.containsPoint(o)?[{subpathId:e.id,nodeId:t.id}]:[]}))}(e,r,s),l=cz(t)?function(e,t){const n=new Map(e.map(e=>[dz(e),{...e}]));for(const r of t){const e=dz(r);n.has(e)?n.delete(e):n.set(e,{...r})}return Array.from(n.values())}(n.previousEntries,a):a;e.interaction.setBrushBox(s),fB(e,r,l,l.at(-1)??null)}function pz(e){const t=rz.get(e);if(!t)return;const n=e.shapes.get(t.shapeId);oj(n)&&e.state.shapeEditingSession.get()?.shapeId===t.shapeId?fB(e,n,t.previousEntries,t.previousPrimary):pB(e),rz.delete(e),e.interaction.setBrushBox(null)}function hz(e,t,n,r){const o=e.shapes.get(t);oj(o)&&fB(e,o,n,r)}function fz(e){return e.filter(e=>e.nodes.length>=2)}function mz(e,t){e.editing.complete("user"),e.shapes.get(t.id)&&e.operations.run({kind:"path.shape-delete",label:"shape.delete",source:"user",history:"record"},()=>{e.commands.deleteShapes([t.id],{source:"user"})})}function gz(e,t,n){const r=fz(function(e,t){const n=Xj(t);return 0===n.size?vj(e):e.map(e=>{const t=n.get(e.id);if(!t)return wj(e);const r=e.nodes.filter(e=>!t.has(e.id)).map(bj),o=e.closed&&r.length>=3;return e.closed&&!o&&nB(r),{...e,closed:o,nodes:r}}).filter(e=>e.nodes.length>0)}(t.props.subpaths,n));0!==r.length?(e.commands.updateShapes([{id:t.id,props:{subpaths:r}}],{source:"user"}),pB(e),KB(e,t.id)):mz(e,t)}function yz(e,t){const n=uB(e);if(!n||n.shape.isLocked)return!1;const{shape:r,selection:o}=n,i=Yj(r.props.subpaths,o.nodes,t,o.primary);if(!i)return!1;const s=fz(i.subpaths);return 0===s.length?(mz(e,r),!0):(e.operations.run({kind:"path.node-operation",label:"shape.edit",source:"user",history:"record"},()=>{e.commands.updateShapes([{id:r.id,props:{subpaths:s}}],{source:"user"}),hz(e,r.id,i.selectedNodes,i.primaryNode)}),KB(e,r.id),!0)}function xz(e,t){const n=uB(e);if(!n||n.shape.isLocked)return!1;const{shape:r,selection:o}=n,i=function(e,t,n){const r=e.shapes.computeLocalToPageTransform(t).invert(),o=r.applyToPoint(new p(0,0));return r.applyToPoint(n).sub(o)}(e,r,t),s=Uj(r.props.subpaths,o.nodes,e=>kz(e,i));return e.operations.run({kind:"path.node-nudge",label:"shape.edit",source:"user",history:"record"},()=>{e.commands.updateShapes([{id:r.id,props:{subpaths:s}}],{source:"user"}),hz(e,r.id,o.nodes,o.primary)}),KB(e,r.id),!0}function bz(e,t,n){const r=iz(e);if(r&&e.tools.isInInitialState()&&("Enter"===t.key||"Escape"===t.key)&&!t.altKey&&!t.ctrlKey&&!t.metaKey&&!t.accelKey)return e.editing.complete("user");if(!(r||"Enter"!==t.key||t.altKey||t.ctrlKey||t.metaKey||t.accelKey))return function(e){if(e.state.shapeEditingSession.get()||"select"!==e.state.tool.get().activeToolId||!e.tools.isInInitialState())return!1;const t=e.selection.getIds(),[n]=e.state.selectedShapes.get();return!(1!==t.length||!oj(n)||!e.editing.canEditShape(n)||(lz(e),GB(e),!e.editing.start({shapeId:n.id,operationKind:QB,entryMode:"focusEnd"},"user")))}(e);if(r&&t.accelKey&&"z"===t.key.toLowerCase()&&!t.altKey)return t.shiftKey?e.history.redo():e.history.undo();if(t.accelKey&&("'"===t.key||"Quote"===t.code)&&r&&!r.isLocked)return JB(e),e.inputs.state.get().isPointing&&e.tools.dispatch(t,n),!0;if(t.accelKey&&"j"===t.key.toLowerCase()&&!t.altKey&&r&&!r.isLocked)return yz(e,"merge");const o=function(e){if(e.altKey||e.ctrlKey||e.metaKey||e.accelKey)return null;const t=e.shiftKey?10:1;switch(e.key){case"ArrowLeft":return new p(-t,0);case"ArrowRight":return new p(t,0);case"ArrowUp":return new p(0,-t);case"ArrowDown":return new p(0,t);default:return null}}(t);if(o)return xz(e,o);if(t.altKey||t.ctrlKey||t.metaKey||t.accelKey)return!1;const i=uB(e);if(!i||i.shape.isLocked)return!1;const s=t.key.toLowerCase();return"backspace"===s||"delete"===s?(gz(e,i.shape,i.selection.nodes),!0):"c"===s?function(e,t,n){const r=n.filter(e=>{const n=Wj(t.props.subpaths,e.subpathId,e.nodeId);return!!n&&!n.in&&!n.out});if(0===r.length)return!1;const o=r.reduce((e,t)=>Vj(e,t.subpathId,t.nodeId),t.props.subpaths);return e.commands.updateShapes([{id:t.id,props:{subpaths:o}}],{source:"user"}),hz(e,t.id,n,n.at(-1)??null),KB(e,t.id),!0}(e,i.shape,i.selection.nodes):"x"===s?(function(e,t,n){const r=n.reduce((e,t)=>Kj(e,t.subpathId,t.nodeId),t.props.subpaths);e.commands.updateShapes([{id:t.id,props:{subpaths:r}}],{source:"user"}),hz(e,t.id,n,n.at(-1)??null),KB(e,t.id)}(e,i.shape,i.selection.nodes),!0):"j"===s?yz(e,"join"):"k"===s&&yz(e,"separate")}function wz(e,t,n){const r=n?e.len():t?.len()??e.len();if(0===r)return null;const o=e.normalize().mul(-r);return{dx:o.x,dy:o.y}}function vz(e,t){const n=t.sub(e),r=n.len();if(0===r)return t.clone();const o=Math.round(Math.atan2(n.y,n.x)/ez)*ez;return e.add(new p(Math.cos(o)*r,Math.sin(o)*r))}function kz(e,t){return{...e,x:e.x+t.x,y:e.y+t.y}}function Sz(){return{createSession(e,{handle:t,shape:n,originPagePoint:r}){if(!oj(n)||"custom"!==t.kind)return null;const o=ZD(t.type,t.id);if(!o)return null;if(e.state.shapeEditingSession.get()?.shapeId!==n.id)return null;const i=oz.get(e),s="path.node"===o.type&&i?.shapeId===n.id&&i.nodeId===o.nodeId;s&&oz.delete(e);const a=n,l=Wj(a.props.subpaths,o.subpathId,o.nodeId),c=sz(e,a,r),d=uB(e),u=d?.selection.shapeId===n.id?d.selection.nodes.map(e=>({...e})):[],p=d?.selection.shapeId===n.id?{...d.selection.primary}:null,h={subpathId:o.subpathId,nodeId:o.nodeId},f=!!d&&d.selection.shapeId===n.id&&mB(d.selection,o.subpathId,o.nodeId),m="path.node"===o.type&&f,g="path.node"===o.type&&e.inputs.state.get().shiftKey,y=g&&!m?[...d?.selection.shapeId===n.id?d.selection.nodes:[],h]:null;y?fB(e,n,y,h):e.inputs.state.get().shiftKey||f||hB(e,n,o.subpathId,o.nodeId);const x="path.node"===o.type&&(y||m)?y??d.selection.nodes:[h],b=e.shapes.computeLocalToPageTransform(a),w=l?b.applyToPoint(kj(l)):r,v=t.point.sub(r),k="path.node"===o.type?x.flatMap(e=>{const t=Wj(a.props.subpaths,e.subpathId,e.nodeId);return t?[b.applyToPoint(kj(t))]:[]}):[t.point],S=(k.length>0?k:[t.point]).map(e=>e.sub(r)),P=function(e,t,n){const r=new Set(n.map(dz)),o=e.shapes.computeLocalToPageTransform(t);return{points:t.props.subpaths.flatMap(e=>e.nodes.flatMap(n=>{const i={subpathId:e.id,nodeId:n.id};return r.has(dz(i))?[]:[{id:`${t.id}:${e.id}:${n.id}`,nodeId:t.id,point:o.applyToPoint(kj(n)),kind:"custom"}]})),outlines:[]}}(e,a,"path.node"===o.type?x:[]);return{shapeId:n.id,operationKind:"path.handle",onClick:g&&m?({editor:e})=>{const t=e.shapes.get(n.id);oj(t)&&function(e,t,n,r){const o=dB(e);if(!o||o.shapeId!==t.id)return void hB(e,t,n,r);const i={subpathId:n,nodeId:r},s=mB(o,n,r),a=s?o.nodes.filter(e=>!xB(e,i)):[...o.nodes,i];fB(e,t,a,s?a.at(-1)??null:i)}(e,t,o.subpathId,o.nodeId)}:void 0,onCancel({editor:e,reason:t}){if("pointer_cancel"!==t&&"escape"!==t)return;const r=e.shapes.get(n.id);oj(r)&&e.state.shapeEditingSession.get()?.shapeId===n.id&&(0!==u.length?fB(e,r,u,p):pB(e))},onComplete({editor:e}){s?function(e,t){UB(e).replaceCurrent(t)}(e,n.id):KB(e,n.id)},update({editor:e,pagePoint:t,accelKey:i,source:s}){if(!oj(e.shapes.get(n.id)))return"stop";const d=e.inputs.state.get(),u=d.shiftKey?"path.node"===o.type?vz(r,t):vz(w,t.add(v)).sub(v):t,p=XB(e)&&!i&&!d.shiftKey&&P.points.length>0,h=p?e.snaps.snapHandle({mode:"align",pagePoint:u,sourcePointOffsets:S,snapshot:P,threshold:10/e.state.camera.get().z}):null;p||e.snaps.clearIndicators();const f=h?.snappedPagePoint??u,m=sz(e,a,"path.node"===o.type?f:f.add(v)),g="path.node"===o.type?l?Uj(a.props.subpaths,x,e=>kz(e,m.sub(c))):vj(a.props.subpaths):Hj(a.props.subpaths,o.subpathId,o.nodeId,e=>function(e,t,n,r){const o=kj(e),i=r.altKey?{...e,kind:"corner"}:{...e},s=n.sub(o);return"in"===t?(i.in={dx:s.x,dy:s.y},r.altKey||"corner"===e.kind||(i.out=wz(s,e.out?Pj(e).sub(o):null,"symmetric"===e.kind))):(i.out={dx:s.x,dy:s.y},r.altKey||"corner"===e.kind||(i.in=wz(s,e.in?Sj(e).sub(o):null,"symmetric"===e.kind))),i}(e,o.handle,m,{altKey:d.altKey}));if(e.commands.updateShapes([{id:n.id,props:{subpaths:g}}],{source:s}),"path.node"===o.type){const t=e.shapes.get(n.id);oj(t)&&fB(e,t,x,{subpathId:o.subpathId,nodeId:o.nodeId})}return"continue"}}}}}function Pz(){return{id:"land.path.interactions",editorEvent:{handleEvent(e,t,n){if("pointer"===t.type&&"pointer_move"===t.name&&rz.get(e)?.pointerId===t.pointerId)return az(e),uz(e,t),tz;if("pointer"===t.type&&"pointer_up"===t.name&&(oz.delete(e),az(e),rz.get(e)?.pointerId===t.pointerId))return function(e,t){const n=rz.get(e);n&&(n.isActive?uz(e,t):cz(t)||pB(e),rz.delete(e),e.interaction.setBrushBox(null))}(e,t),tz;if("pointer"===t.type&&"pointer_cancel"===t.name&&(oz.delete(e),az(e),rz.get(e)?.pointerId===t.pointerId))return pz(e),tz;if("double_click"===t.type&&!t.shiftKey&&!t.altKey&&!t.accelKey){lz(e);const n=e.shapes.hitTest(t.pagePoint);if(oj(n))return GB(e),e.editing.start({shapeId:n.id,operationKind:QB,entryMode:"focusEnd"},"user"),tz}if("cancel"===t.type)return oz.delete(e),rz.has(e)?(pz(e),tz):"command"===t.reason?void az(e):"escape"===t.reason&&e.tools.isInInitialState()&&iz(e)&&e.editing.complete("user")?tz:void lz(e);if("keyboard"===t.type&&"key_down"===t.name)return bz(e,t,n)?tz:void 0;if("pointer"!==t.type||"pointer_move"!==t.name){if("pointer"===t.type&&"pointer_down"===t.name&&0===t.button&&t.altKey){az(e);const n=iz(e);if(!n)return;const r=e.selection.hitTestHandle(t.pagePoint);if("custom"===r?.kind&&"path.node"===r.type){const t=ZD(r.type,r.id);if("path.node"===t?.type){const r=uB(e);return gz(e,n,r?.selection.shapeId===n.id&&mB(r.selection,t.subpathId,t.nodeId)?r.selection.nodes:[{subpathId:t.subpathId,nodeId:t.nodeId}]),tz}}}if("pointer"===t.type&&"pointer_down"===t.name&&0===t.button&&!t.altKey){az(e);const n=iz(e);if(!n)return;const r=e.selection.hitTestHandle(t.pagePoint);if("custom"===r?.kind)return void(ZD(r.type,r.id)||pB(e));const o=sz(e,n,t.pagePoint),i=_j(n.props.subpaths,o,7/e.state.camera.get().z);if(!i)return function(e,t,n){const r=uB(e);rz.set(e,{shapeId:t.id,pointerId:n.pointerId,originPagePoint:n.pagePoint.clone(),originScreenPoint:n.screenPoint.clone(),previousEntries:r?.selection.shapeId===t.id?r.selection.nodes.map(e=>({...e})):[],previousPrimary:r?.selection.shapeId===t.id?{...r.selection.primary}:null,isActive:!1})}(e,n,t),tz;const s=`insert-node:${nz+=1}`;return e.operations.run({kind:"path.insert-node",label:"shape.edit",source:"user",history:"record"},()=>{const t=lB(n.props.subpaths,i,s);e.commands.updateShapes([{id:n.id,props:{subpaths:t}}],{source:"user"});const r=e.shapes.get(n.id);oj(r)&&hB(e,r,i.subpathId,s)}),KB(e,n.id),void oz.set(e,{shapeId:n.id,nodeId:s})}}else"mouse"!==t.pointerType||0!==t.buttons||t.altKey?az(e):function(e,t){const n=iz(e);if(!n||"select"!==e.state.tool.get().activeToolId||!e.tools.isInInitialState())return void az(e);if("custom"===e.selection.hitTestHandle(t.pagePoint)?.kind)return void az(e);const r=sz(e,n,t.pagePoint),o=_j(n.props.subpaths,r,7/e.state.camera.get().z);if(!o)return void az(e);const i=e.shapes.computeLocalToPageTransform(n);ej(e,{shapeId:n.id,subpathId:o.subpathId,startNodeId:o.startNodeId,endNodeId:o.endNodeId,t:o.t,pagePoint:i.applyToPoint(o.point)})}(e,t)}},selectionHandle:Sz()}}function Mz(e,t){return"number"==typeof e&&Number.isFinite(e)?e:t}function Iz(e){if(!e||"object"!=typeof e)return null;const t=e,n=Mz(t.dx,NaN),r=Mz(t.dy,NaN);return Number.isFinite(n)&&Number.isFinite(r)?t.dx===n&&t.dy===r?e:{dx:n,dy:r}:null}function Ez(e,t,n){if(!e||"object"!=typeof e)return null;const r=e,o=new Set,i=Array.isArray(r.nodes)?r.nodes.map((e,t)=>function(e,t,n){if(!e||"object"!=typeof e)return null;const r=e,o=Mz(r.x,NaN),i=Mz(r.y,NaN);return Number.isFinite(o)&&Number.isFinite(i)?{id:Cz("string"==typeof r.id&&r.id.length>0?r.id:`node:${t}`,n),x:o,y:i,kind:sj(r.kind)?r.kind:"corner",in:Iz(r.in),out:Iz(r.out)}:null}(e,t,o)).filter(e=>null!==e):[];return 0===i.length?null:{id:Cz("string"==typeof r.id&&r.id.length>0?r.id:`subpath:${t}`,n),closed:"boolean"==typeof r.closed&&r.closed,nodes:i}}function Tz(e,t){if(!Array.isArray(e))return t;const n=new Set,r=e.map((e,t)=>Ez(e,t,n)).filter(e=>null!==e);return r.length>0?r:t}function Cz(e,t){if(!t.has(e))return t.add(e),e;let n=2;for(;t.has(`${e}:${n}`);)n+=1;const r=`${e}:${n}`;return t.add(r),r}function Oz(e,t,n){const r=n.sub(t),o=r.len2();if(0===o)return e.dist2(t);const i=e.sub(t),s=Math.max(0,Math.min(1,(i.x*r.x+i.y*r.y)/o));return e.dist2(t.add(r.mul(s)))}var Az=class extends oe{type="path";getDefaultProps(){return{subpaths:[{id:"subpath:default",closed:!1,nodes:[{id:"node:0",x:0,y:0,kind:"corner"},{id:"node:1",x:96,y:0,kind:"corner"}]}],fill:S("transparent"),stroke:k("stroke-slate"),strokeWidth:3,fillRule:"nonzero"}}validateProps(e){const t=e&&"object"==typeof e?e:{},n=this.getDefaultProps();return{subpaths:(r=Tz(t.subpaths,n.subpaths),r.map(e=>({...e,nodes:e.nodes.filter(e=>yj(e.x)&&yj(e.y))})).filter(e=>e.nodes.length>0).map(wj)),fill:I(t.fill,n.fill),stroke:I(t.stroke,n.stroke),strokeWidth:Math.max(1,Mz(t.strokeWidth,n.strokeWidth)),fillRule:ij(t.fillRule)?t.fillRule:n.fillRule};var r}getPositionedBounds(e){const t=Rj(e).localBounds;return new h(e.x+t.x,e.y+t.y,t.w,t.h)}getLocalBounds(e){return Rj(e).localBounds}getRenderBounds(e){return Rj(e).renderBounds}getExportBounds(e){return this.getRenderBounds(e)}getSelectionResizeLocalBounds(e){return Rj(e).pointBounds}resizeSelectionBounds(e,t){const n=Dj(e,this.getLocalTransform(e)).map(e=>({...e,nodes:e.nodes.map(e=>Nz(e,e=>function(e,t){return 0===t.selectionRotation?e:p.RotWith(e,t.selectionRotationCenter,-t.selectionRotation)}(e,t)))})),r=$j(function(e,t){const n=Rj(e).pointBounds,r=0===n.w?1:t.w/Math.max(n.w,1e-6),o=0===n.h?1:t.h/Math.max(n.h,1e-6);return Lj(e.props.subpaths,e=>new p(0===n.w?t.center.x:t.x+(e.x-n.x)*r,0===n.h?t.center.y:t.y+(e.y-n.y)*o))}({...e,x:0,y:0,rotation:0,scaleX:1,scaleY:1,props:{...e.props,subpaths:n}},t.selectionLocalBounds).map(e=>({...e,nodes:e.nodes.map(e=>Nz(e,e=>function(e,t){return 0===t.selectionRotation?e:p.RotWith(e,t.selectionRotationCenter,t.selectionRotation)}(e,t)))})),e.props);return{id:e.id,x:r.x,y:r.y,rotation:0,scaleX:1,scaleY:1,props:{subpaths:r.subpaths}}}getPositionedOutlineVertices(e){return Rj(e).outlineVertices.map(t=>new p(e.x+t.x,e.y+t.y))}getTerminalBindingOutlines(e){return Rj(e).flattenedSubpaths.filter(e=>e.points.length>0).map(t=>({points:t.points.map(t=>new p(e.x+t.x,e.y+t.y)),closed:t.closed}))}resolveBindingPoint(e,t){const n=t.editor.shapes.computePositionedToPageTransform(e),r=n.tryInvert();if(!r)return t.rawPagePoint;const o=r.applyToPoint(t.rawPagePoint),i=r.applyToPoint(t.oppositePagePoint),s=i.sub(o);let a=Number.POSITIVE_INFINITY;for(const l of this.getTerminalBindingOutlines(e)){const e=l.closed?l.points.length:Math.max(0,l.points.length-1);for(let t=0;t<e;t+=1){const e=l.points[t],n=l.points[(t+1)%l.points.length];if(!e||!n)continue;const r=Rz(o,i,e,n);null!==r&&r>1e-6&&r<a&&(a=r)}}return Number.isFinite(a)?n.applyToPoint(o.add(s.mul(a))):t.rawPagePoint}getHandleSnapGeometry(e){return{points:e.props.subpaths.flatMap(e=>e.nodes.flatMap(e=>[{point:kj(e),kind:"custom"},...e.in?[{point:Sj(e),kind:"custom"}]:[],...e.out?[{point:Pj(e),kind:"custom"}]:[]])),outline:Rj(e).outlineVertices}}canReceiveTerminalBinding(e){return!0}canEdit(e){return!0}canUseSelectionResizeHandles(e,t){return t.editor.state.shapeEditingSession.get()?.shapeId!==e.id}canUseSelectionRotateHandle(e,t){return t.editor.state.shapeEditingSession.get()?.shapeId!==e.id}getSelectionHandleAnchors(e,t){const n={terminalHandleAnchors:[],middleHandleAnchors:[],customHandleAnchors:[]};if(!t.isOnlySelected)return n;const r=t.editor.state.shapeEditingSession.get();if(!r||r.shapeId!==e.id)return n;const o=t.editor.shapes.computeLocalToPageTransform(e);return{terminalHandleAnchors:[],middleHandleAnchors:[],customHandleAnchors:e.props.subpaths.flatMap(e=>e.nodes.flatMap(t=>{const n=[{kind:"custom",type:YD,id:JD(e.id,t.id),point:o.applyToPoint(kj(t)),cursor:"grab"}];return t.in&&n.push({kind:"custom",type:XD,id:GD(e.id,t.id,"in"),point:o.applyToPoint(Sj(t)),cursor:"grab"}),t.out&&n.push({kind:"custom",type:XD,id:GD(e.id,t.id,"out"),point:o.applyToPoint(Pj(t)),cursor:"grab"}),n}))}}getSelectionOverlayInfo(e,t){const n=t.editor.state.shapeEditingSession.get();return n&&n.shapeId===e.id?{usesSelectionPathOverlay:!0,startPagePoint:null,endPagePoint:null,middlePagePoint:null,path:jj(e,t.editor.shapes.computeLocalToPageTransform(e)),pathStyle:null,bindingSegments:[]}:{usesSelectionPathOverlay:!1,startPagePoint:null,endPagePoint:null,middlePagePoint:null,path:null,pathStyle:null,bindingSegments:[]}}hitTest(e,t,n){const r=new p(t.x-e.x,t.y-e.y),o=Rj(e);return!C(e.props.fill)&&function(e,t,n){let r=0,o=0;for(const i of e)if(i.closed&&!(i.points.length<3))for(let e=0;e<i.points.length;e+=1){const n=i.points[e],s=i.points[(e+1)%i.points.length];n&&s&&(n.y<=t.y&&s.y>t.y||n.y>t.y&&s.y<=t.y)&&n.x+(t.y-n.y)/(s.y-n.y)*(s.x-n.x)>t.x&&(o+=1,r+=s.y>n.y?1:-1)}return"evenodd"===n?o%2==1:0!==r}(o.flattenedSubpaths,r,e.props.fillRule)||function(e,t,n){const r=n*n;for(const o of e)for(let e=1;e<o.points.length;e+=1){const n=o.points[e-1],i=o.points[e];if(n&&i&&zj(t,n,i)<=r)return!0}return!1}(o.flattenedSubpaths,r,e.props.strokeWidth/2+6)}hitTestLineSegment(e,t){const n=new p(t.positionedStart.x-e.x,t.positionedStart.y-e.y),r=new p(t.positionedEnd.x-e.x,t.positionedEnd.y-e.y),o=t.positionedMargin+e.props.strokeWidth/2;return Rj(e).flattenedSubpaths.some(e=>function(e,t,n,r){const o=r*r;for(let i=1;i<n.length;i+=1){const r=n[i-1],s=n[i];if(r&&s&&(Oz(r,e,t)<=o||Oz(s,e,t)<=o||Oz(e,r,s)<=o||Oz(t,r,s)<=o))return!0}return!1}(n,r,e.points,o))}isWrappedByBrush(e,t){const n=t.pageOutlineVertices;return 0===n.length?!!t.pageBounds&&t.brushBounds.containsBox(t.pageBounds):n.every(e=>t.brushBounds.containsPoint(e))}canSelectByBrush(e,t){return t.isWrapping?this.isWrappedByBrush(e,t):t.pageBounds?.intersects(t.brushBounds)??!1}onEditEnd(e){if(e.props.subpaths.every(e=>e.nodes.length<2))return{deleteShapeIds:[e.id]}}};function Rz(e,t,n,r){const o=t.sub(e),i=r.sub(n),s=o.x*i.y-o.y*i.x;if(Math.abs(s)<1e-8)return null;const a=n.sub(e),l=(a.x*i.y-a.y*i.x)/s,c=(a.x*o.y-a.y*o.x)/s;return l>=0&&l<=1&&c>=0&&c<=1?l:null}function Nz(e,t){const n=t(kj(e)),r=e.in?t(Sj(e)):null,o=e.out?t(Pj(e)):null;return{...bj(e),x:n.x,y:n.y,in:r?{dx:r.x-n.x,dy:r.y-n.y}:null,out:o?{dx:o.x-n.x,dy:o.y-n.y}:null}}var Lz=Math.PI/4,$z=1,Dz=1;function jz(){return`node:${$z+=1}`}function Bz(e,t,n){return e.shapes.computeLocalToPageTransform(t).invert().applyToPoint(n)}function zz(e,t,n,r){const o=(Fj(t.props.subpaths,n)?.nodes.filter(e=>e.id!==r))?.at(-1);return o?e.shapes.computeLocalToPageTransform(t).applyToPoint(new p(o.x,o.y)):null}function _z(e,t){const n=t.sub(e),r=n.len();if(0===r)return t.clone();const o=Math.round(Math.atan2(n.y,n.x)/Lz)*Lz;return e.add(new p(Math.cos(o)*r,Math.sin(o)*r))}function Fz(e,t,n,r,o){const i=function(e,t,n){const r=Fj(t.props.subpaths,n)?.nodes[0];return r?e.shapes.computeLocalToPageTransform(t).applyToPoint(new p(r.x,r.y)):null}(e,t,n),s=Fj(t.props.subpaths,n),a=s?.nodes.filter(e=>e.id!==r).length??0;return!(!i||!s||a<3)&&i.dist(o)<=10/e.state.camera.get().z}function Wz(e,t){return t.previewNodeId?e.map(e=>e.id===t.subpathId?{...e,nodes:e.nodes.filter(e=>e.id!==t.previewNodeId)}:e):vj(e)}function Hz(e,t){return Fj(e.props.subpaths,t.subpathId)?.nodes.filter(e=>e.id!==t.previewNodeId).length??0}var Uz=class extends ie{draft=null;operation=null;constructor(e){super(e,"path"),this.initial="idle",this.addChild(new Vz(e,this)),this.addChild(new Kz(e,this))}onEnter(){this.editor.interaction.clearSelection()}onExit(){this.draft&&(this.canFinishDraft()?this.finishDraft({switchToSelect:!1}):this.cancelDraft())}isInInitialState(){return!this.hasDraft()&&super.isInInitialState()}startOrExtend(e,t,n){if(!this.draft){this.operation=this.editor.operations.begin({kind:"path.create",label:"shape.create",source:"user",history:"record"});const n=this.editor.shapes.getDefaultProps("path"),r=`subpath:${Dz+=1}`,o=jz(),i={id:o,x:0,y:0,kind:"corner"},[s]=this.editor.commands.createShapes([{type:"path",x:e.x,y:e.y,meta:kB({},{subpathId:r,previewNodeId:null}),props:{...n,subpaths:[{id:r,closed:!1,nodes:[i]}]}}],{source:"user",autoReparent:!1});if(!oj(s))throw this.cancelOperation(),new Error("Failed to create path shape");return this.editor.commands.setSelectedShapeIds([s.id],{source:"system"}),this.draft={shapeId:s.id,subpathId:r,lastNodeId:o,createdShape:!0,previewNodeId:null},VB(this.editor,"create",s.id,{onBoundaryUndo:()=>this.draft?.shapeId===s.id&&(this.cancelDraft(),this.editor.commands.setActiveTool("select",{source:"system"}),!0),onApply:e=>{const t=this.draft;if(!t||t.shapeId!==e.id)return;const n=Fj(e.props.subpaths,t.subpathId);this.draft={...t,lastNodeId:n?.nodes.at(-1)?.id??t.lastNodeId,previewNodeId:null}}}),{shapeId:s.id,subpathId:r,nodeId:o,originPagePoint:e.clone(),originScreenPoint:t.clone(),startNode:bj(i),finishOnPointerUp:!1}}const r=this.editor.shapes.get(this.draft.shapeId);if(!oj(r))return this.cancelDraft(),null;const o=n.shiftKey?zz(this.editor,r,this.draft.subpathId,this.draft.previewNodeId)??e:e,i=n.shiftKey?_z(o,e):e;if(Fz(this.editor,r,this.draft.subpathId,this.draft.previewNodeId,e)){const n=this.draft,o=Fj(r.props.subpaths,n.subpathId)?.nodes.find(e=>e.id!==n.previewNodeId);return o?(this.editor.commands.updateShapes([{id:r.id,meta:kB(r.meta,{subpathId:n.subpathId,previewNodeId:null}),props:{subpaths:Wz(r.props.subpaths,n).map(e=>e.id===n.subpathId?{...e,closed:!0}:e)}}],{source:"user"}),this.draft={...n,previewNodeId:null},{shapeId:r.id,subpathId:n.subpathId,nodeId:o.id,originPagePoint:e.clone(),originScreenPoint:t.clone(),startNode:bj(o),finishOnPointerUp:!0}):null}const s=Bz(this.editor,r,i),a=this.draft.previewNodeId??jz(),l=r.props.subpaths.map(e=>e.id===this.draft?.subpathId?this.draft.previewNodeId?{...e,nodes:e.nodes.map(e=>e.id===this.draft?.previewNodeId?{id:a,x:s.x,y:s.y,kind:"corner"}:e)}:{...e,nodes:[...e.nodes,{id:a,x:s.x,y:s.y,kind:"corner"}]}:e);return this.editor.commands.updateShapes([{id:r.id,meta:kB(r.meta,{subpathId:this.draft.subpathId,previewNodeId:null}),props:{subpaths:l}}],{source:"user"}),this.draft={...this.draft,lastNodeId:a,previewNodeId:null},{shapeId:r.id,subpathId:this.draft.subpathId,nodeId:a,originPagePoint:e.clone(),originScreenPoint:t.clone(),startNode:{id:a,x:s.x,y:s.y,kind:"corner"},finishOnPointerUp:!1}}updateNodeDrag(e,t,n,r){const o=this.editor.shapes.get(e.shapeId);if(!oj(o))return;const i=r.shiftKey?_z(e.originPagePoint,t):t,s=Bz(this.editor,o,e.originPagePoint),a=Bz(this.editor,o,i),l=e.originScreenPoint.dist(n)>=3,c=Hj(o.props.subpaths,e.subpathId,e.nodeId,()=>l?function(e,t,n){return{...e,kind:n.altKey?"smooth":"symmetric",in:{dx:-t.x,dy:-t.y},out:{dx:t.x,dy:t.y}}}(e.startNode,a.sub(s),r):bj(e.startNode));this.editor.commands.updateShapes([{id:o.id,meta:kB(o.meta,{subpathId:e.subpathId,previewNodeId:this.draft?.previewNodeId??null}),props:{subpaths:c}}],{source:"user"})}updatePreview(e,t){if(!this.draft)return;const n=this.editor.shapes.get(this.draft.shapeId);if(!oj(n)||Hz(n,this.draft)<1)return;const r=t.shiftKey?zz(this.editor,n,this.draft.subpathId,this.draft.previewNodeId):null,o=r?_z(r,e):e,i=Bz(this.editor,n,o),s=this.draft.previewNodeId??jz(),a=n.props.subpaths.map(e=>e.id!==this.draft?.subpathId?e:this.draft.previewNodeId?{...e,nodes:e.nodes.map(e=>e.id===this.draft?.previewNodeId?{id:s,x:i.x,y:i.y,kind:"corner"}:e)}:{...e,nodes:[...e.nodes,{id:s,x:i.x,y:i.y,kind:"corner"}]});this.editor.commands.updateShapes([{id:n.id,meta:kB(n.meta,{subpathId:this.draft.subpathId,previewNodeId:s}),props:{subpaths:a}}],{source:"user"}),this.draft={...this.draft,previewNodeId:s}}canFinishDraft(){if(!this.draft)return!1;const e=this.editor.shapes.get(this.draft.shapeId);return!!oj(e)&&Hz(e,this.draft)>=2}finishDraft(e={}){if(!this.draft)return;const t=e.switchToSelect??!0,n=this.editor.shapes.get(this.draft.shapeId);if(oj(n)){const e=Wz(n.props.subpaths,this.draft),t=$j(Dj({...n,props:{...n.props,subpaths:e}},this.editor.shapes.computeLocalToPageTransform(n)),n.props);this.editor.commands.updateShapes([{id:n.id,x:t.x,y:t.y,rotation:0,scaleX:1,scaleY:1,meta:SB(n.meta),props:{subpaths:t.subpaths}}],{source:"user"}),this.draft.createdShape&&j(this.editor,n.id,{source:"user"})}qB(this.editor,"create",this.draft.shapeId),this.commitOperation(),this.draft=null,t&&!this.editor.state.tool.get().isToolLocked&&this.editor.commands.setActiveTool("select",{source:"system"})}finishDraftAndEdit(){const e=this.draft?.shapeId;if(e){if(!this.canFinishDraft())return this.cancelDraft(),void(this.editor.state.tool.get().isToolLocked||this.editor.commands.setActiveTool("select",{source:"system"}));this.finishDraft({switchToSelect:!1}),oj(this.editor.shapes.get(e))&&(this.editor.commands.setActiveTool("select",{source:"system"}),this.editor.editing.start({shapeId:e,operationKind:"path.edit",entryMode:"focusEnd"},"user"))}}cancelDraft(){this.draft&&(qB(this.editor,"create",this.draft.shapeId),this.cancelOperation(),this.draft=null)}hasDraft(){return null!==this.draft}commitOperation(){const e=this.operation;this.operation=null,e?.commit()}cancelOperation(){const e=this.operation;this.operation=null,e?.isActive&&e.cancel()}},Vz=class extends ie{tool;constructor(e,t){super(e,"idle",t),this.tool=t}onPointerDown(e){if(0!==e.button)return;const t=this.tool.startOrExtend(e.pagePoint,e.screenPoint,{altKey:e.altKey,shiftKey:e.shiftKey});t&&this.transition("dragging_node",t)}onPointerMove(e){this.tool.updatePreview(e.pagePoint,{shiftKey:e.shiftKey})}onKeyDown(e){("Enter"===e.key&&this.tool.hasDraft()||"Escape"===e.key&&this.tool.hasDraft())&&this.tool.finishDraftAndEdit()}onCancel(e){"escape"===e.reason&&this.tool.hasDraft()&&this.tool.finishDraftAndEdit()}},Kz=class extends ie{tool;info=null;constructor(e,t){super(e,"dragging_node",t),this.tool=t}onEnter(e){this.info=e}onPointerMove(e){this.info&&this.tool.updateNodeDrag(this.info,e.pagePoint,e.screenPoint,{altKey:e.altKey,shiftKey:e.shiftKey})}onPointerUp(e){const t=this.info;t&&(this.tool.updateNodeDrag(t,e.pagePoint,e.screenPoint,{altKey:e.altKey,shiftKey:e.shiftKey}),KB(this.editor,t.shapeId)),this.transition("idle"),t?.finishOnPointerUp&&this.tool.finishDraft()}onCancel(){this.tool.cancelDraft(),this.transition("idle")}onExit(){this.info=null}},qz=class{type="path";toSvg(e,t){const n=Rj(e);return n.path?{tag:"path",attrs:{d:n.path,fill:C(e.props.fill)?"none":t.resolveColor(e.props.fill),"fill-rule":e.props.fillRule,"clip-rule":e.props.fillRule,stroke:t.resolveColor(e.props.stroke),"stroke-width":e.props.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round"}}:null}};function Yz(){return{id:"land.path",shapeUtils:[new Az],shapeSvgExporters:[new qz],interactionHandlers:[Pz()],setup(e){const t=ZB(e);return e.tools.register("path",e=>new Uz(e)),t}}}var Xz=a((e,t)=>{var n,r;n=e,r=function(){function e(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(a){i=[6,a],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var t=function(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null};function n(e,t){return e>t?1:e<t?-1:0}function r(e,n,r){for(var o=new t(null,null),i=o,s=o;;){var a=r(e,n.key);if(a<0){if(null===n.left)break;if(r(e,n.left.key)<0){var l=n.left;if(n.left=l.right,l.right=n,null===(n=l).left)break}s.left=n,s=n,n=n.left}else{if(!(a>0))break;if(null===n.right)break;if(r(e,n.right.key)>0&&(l=n.right,n.right=l.left,l.left=n,null===(n=l).right))break;i.right=n,i=n,n=n.right}}return i.right=n.left,s.left=n.right,n.left=o.right,n.right=o.left,n}function o(e,n,o,i){var s=new t(e,n);if(null===o)return s.left=s.right=null,s;var a=i(e,(o=r(e,o,i)).key);return a<0?(s.left=o.left,s.right=o,o.left=null):a>=0&&(s.right=o.right,s.left=o,o.right=null),s}function i(e,t,n){var o=null,i=null;if(t){var s=n((t=r(e,t,n)).key,e);0===s?(o=t.left,i=t.right):s<0?(i=t.right,t.right=null,o=t):(o=t.left,t.left=null,i=t)}return{left:o,right:i}}function s(e,t,n,r,o){if(e){r(t+(n?"└── ":"├── ")+o(e)+"\n");var i=t+(n?" ":"│ ");e.left&&s(e.left,i,!1,r,o),e.right&&s(e.right,i,!0,r,o)}}var a=function(){function a(e){void 0===e&&(e=n),this._root=null,this._size=0,this._comparator=e}return a.prototype.insert=function(e,t){return this._size++,this._root=o(e,t,this._root,this._comparator)},a.prototype.add=function(e,n){var o=new t(e,n);null===this._root&&(o.left=o.right=null,this._size++,this._root=o);var i=this._comparator,s=r(e,this._root,i),a=i(e,s.key);return 0===a?this._root=s:(a<0?(o.left=s.left,o.right=s,s.left=null):a>0&&(o.right=s.right,o.left=s,s.right=null),this._size++,this._root=o),this._root},a.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},a.prototype._remove=function(e,t,n){var o;return null===t?null:0===n(e,(t=r(e,t,n)).key)?(null===t.left?o=t.right:(o=r(e,t.left,n)).right=t.right,this._size--,o):t},a.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=r(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},a.prototype.findStatic=function(e){for(var t=this._root,n=this._comparator;t;){var r=n(e,t.key);if(0===r)return t;t=r<0?t.left:t.right}return null},a.prototype.find=function(e){return this._root&&(this._root=r(e,this._root,this._comparator),0!==this._comparator(e,this._root.key))?null:this._root},a.prototype.contains=function(e){for(var t=this._root,n=this._comparator;t;){var r=n(e,t.key);if(0===r)return!0;t=r<0?t.left:t.right}return!1},a.prototype.forEach=function(e,t){for(var n=this._root,r=[],o=!1;!o;)null!==n?(r.push(n),n=n.left):0!==r.length?(n=r.pop(),e.call(t,n),n=n.right):o=!0;return this},a.prototype.range=function(e,t,n,r){for(var o=[],i=this._comparator,s=this._root;0!==o.length||s;)if(s)o.push(s),s=s.left;else{if(i((s=o.pop()).key,t)>0)break;if(i(s.key,e)>=0&&n.call(r,s))return this;s=s.right}return this},a.prototype.keys=function(){var e=[];return this.forEach(function(t){var n=t.key;return e.push(n)}),e},a.prototype.values=function(){var e=[];return this.forEach(function(t){var n=t.data;return e.push(n)}),e},a.prototype.min=function(){return this._root?this.minNode(this._root).key:null},a.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},a.prototype.minNode=function(e){if(void 0===e&&(e=this._root),e)for(;e.left;)e=e.left;return e},a.prototype.maxNode=function(e){if(void 0===e&&(e=this._root),e)for(;e.right;)e=e.right;return e},a.prototype.at=function(e){for(var t=this._root,n=!1,r=0,o=[];!n;)if(t)o.push(t),t=t.left;else if(o.length>0){if(t=o.pop(),r===e)return t;r++,t=t.right}else n=!0;return null},a.prototype.next=function(e){var t=this._root,n=null;if(e.right){for(n=e.right;n.left;)n=n.left;return n}for(var r=this._comparator;t;){var o=r(e.key,t.key);if(0===o)break;o<0?(n=t,t=t.left):t=t.right}return n},a.prototype.prev=function(e){var t=this._root,n=null;if(null!==e.left){for(n=e.left;n.right;)n=n.right;return n}for(var r=this._comparator;t;){var o=r(e.key,t.key);if(0===o)break;o<0?t=t.left:(n=t,t=t.right)}return n},a.prototype.clear=function(){return this._root=null,this._size=0,this},a.prototype.toList=function(){return function(e){for(var n=e,r=[],o=!1,i=new t(null,null),s=i;!o;)n?(r.push(n),n=n.left):r.length>0?n=(n=s=s.next=r.pop()).right:o=!0;return s.next=null,i.next}(this._root)},a.prototype.load=function(e,n,r){void 0===n&&(n=[]),void 0===r&&(r=!1);var o=e.length,i=this._comparator;if(r&&d(e,n,0,o-1,i),null===this._root)this._root=l(e,n,0,o),this._size=o;else{var s=function(e,n,r){for(var o=new t(null,null),i=o,s=e,a=n;null!==s&&null!==a;)r(s.key,a.key)<0?(i.next=s,s=s.next):(i.next=a,a=a.next),i=i.next;return null!==s?i.next=s:null!==a&&(i.next=a),o.next}(this.toList(),function(e,n){for(var r=new t(null,null),o=r,i=0;i<e.length;i++)o=o.next=new t(e[i],n[i]);return o.next=null,r.next}(e,n),i);o=this._size+o,this._root=c({head:s},0,o)}return this},a.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(a.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),a.prototype.toString=function(e){void 0===e&&(e=function(e){return String(e.key)});var t=[];return s(this._root,"",!0,function(e){return t.push(e)},e),t.join("")},a.prototype.update=function(e,t,n){var s=this._comparator,a=i(e,this._root,s),l=a.left,c=a.right;s(e,t)<0?c=o(t,n,c,s):l=o(t,n,l,s),this._root=function(e,t,n){return null===t?e:(null===e||((t=r(e.key,t,n)).left=e),t)}(l,c,s)},a.prototype.split=function(e){return i(e,this._root,this._comparator)},a.prototype[Symbol.iterator]=function(){var t,n,r;return e(this,function(e){switch(e.label){case 0:t=this._root,n=[],r=!1,e.label=1;case 1:return r?[3,6]:null===t?[3,2]:(n.push(t),t=t.left,[3,5]);case 2:return 0===n.length?[3,4]:[4,t=n.pop()];case 3:return e.sent(),t=t.right,[3,5];case 4:r=!0,e.label=5;case 5:return[3,1];case 6:return[2]}})},a}();function l(e,n,r,o){var i=o-r;if(i>0){var s=r+Math.floor(i/2),a=e[s],c=n[s],d=new t(a,c);return d.left=l(e,n,r,s),d.right=l(e,n,s+1,o),d}return null}function c(e,t,n){var r=n-t;if(r>0){var o=t+Math.floor(r/2),i=c(e,t,o),s=e.head;return s.left=i,e.head=e.head.next,s.right=c(e,o+1,n),s}return null}function d(e,t,n,r,o){if(!(n>=r)){for(var i=e[n+r>>1],s=n-1,a=r+1;;){do{s++}while(o(e[s],i)<0);do{a--}while(o(e[a],i)>0);if(s>=a)break;var l=e[s];e[s]=e[a],e[a]=l,l=t[s],t[s]=t[a],t[a]=l}d(e,t,n,a,o),d(e,t,a+1,r,o)}}const u=(e,t)=>e.ll.x<=t.x&&t.x<=e.ur.x&&e.ll.y<=t.y&&t.y<=e.ur.y,p=(e,t)=>{if(t.ur.x<e.ll.x||e.ur.x<t.ll.x||t.ur.y<e.ll.y||e.ur.y<t.ll.y)return null;const n=e.ll.x<t.ll.x?t.ll.x:e.ll.x,r=e.ur.x<t.ur.x?e.ur.x:t.ur.x;return{ll:{x:n,y:e.ll.y<t.ll.y?t.ll.y:e.ll.y},ur:{x:r,y:e.ur.y<t.ur.y?e.ur.y:t.ur.y}}};let h=Number.EPSILON;void 0===h&&(h=Math.pow(2,-52));const f=h*h,m=(e,t)=>{if(-h<e&&e<h&&-h<t&&t<h)return 0;const n=e-t;return n*n<f*e*t?0:e<t?-1:1};class g{constructor(){this.tree=new a,this.round(0)}round(e){const t=this.tree.add(e),n=this.tree.prev(t);if(null!==n&&0===m(t.key,n.key))return this.tree.remove(e),n.key;const r=this.tree.next(t);return null!==r&&0===m(t.key,r.key)?(this.tree.remove(e),r.key):e}}const y=new class{constructor(){this.reset()}reset(){this.xRounder=new g,this.yRounder=new g}round(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}},x=134217729;function b(e,t,n,r,o){let i,s,a,l,c=t[0],d=r[0],u=0,p=0;d>c==d>-c?(i=c,c=t[++u]):(i=d,d=r[++p]);let h=0;if(u<e&&p<n)for(d>c==d>-c?(s=c+i,a=i-(s-c),c=t[++u]):(s=d+i,a=i-(s-d),d=r[++p]),i=s,0!==a&&(o[h++]=a);u<e&&p<n;)d>c==d>-c?(s=i+c,l=s-i,a=i-(s-l)+(c-l),c=t[++u]):(s=i+d,l=s-i,a=i-(s-l)+(d-l),d=r[++p]),i=s,0!==a&&(o[h++]=a);for(;u<e;)s=i+c,l=s-i,a=i-(s-l)+(c-l),c=t[++u],i=s,0!==a&&(o[h++]=a);for(;p<n;)s=i+d,l=s-i,a=i-(s-l)+(d-l),d=r[++p],i=s,0!==a&&(o[h++]=a);return 0===i&&0!==h||(o[h++]=i),h}function w(e){return new Float64Array(e)}const v=w(4),k=w(8),S=w(12),P=w(16),M=w(4);function I(e,t,n,r,o,i){const s=(t-i)*(n-o),a=(e-o)*(r-i),l=s-a,c=Math.abs(s+a);return Math.abs(l)>=33306690738754716e-32*c?l:-function(e,t,n,r,o,i,s){let a,l,c,d,u,p,h,f,m,g,y,w,I,E,T,C,O,A;const R=e-o,N=n-o,L=t-i,$=r-i;E=R*$,p=x*R,h=p-(p-R),f=R-h,p=x*$,m=p-(p-$),g=$-m,T=f*g-(E-h*m-f*m-h*g),C=L*N,p=x*L,h=p-(p-L),f=L-h,p=x*N,m=p-(p-N),g=N-m,O=f*g-(C-h*m-f*m-h*g),y=T-O,u=T-y,v[0]=T-(y+u)+(u-O),w=E+y,u=w-E,I=E-(w-u)+(y-u),y=I-C,u=I-y,v[1]=I-(y+u)+(u-C),A=w+y,u=A-w,v[2]=w-(A-u)+(y-u),v[3]=A;let D=function(e,t){let n=t[0];for(let r=1;r<e;r++)n+=t[r];return n}(4,v),j=22204460492503146e-32*s;if(D>=j||-D>=j)return D;if(u=e-R,a=e-(R+u)+(u-o),u=n-N,c=n-(N+u)+(u-o),u=t-L,l=t-(L+u)+(u-i),u=r-$,d=r-($+u)+(u-i),0===a&&0===l&&0===c&&0===d)return D;if(j=11093356479670487e-47*s+33306690738754706e-32*Math.abs(D),D+=R*d+$*a-(L*c+N*l),D>=j||-D>=j)return D;E=a*$,p=x*a,h=p-(p-a),f=a-h,p=x*$,m=p-(p-$),g=$-m,T=f*g-(E-h*m-f*m-h*g),C=l*N,p=x*l,h=p-(p-l),f=l-h,p=x*N,m=p-(p-N),g=N-m,O=f*g-(C-h*m-f*m-h*g),y=T-O,u=T-y,M[0]=T-(y+u)+(u-O),w=E+y,u=w-E,I=E-(w-u)+(y-u),y=I-C,u=I-y,M[1]=I-(y+u)+(u-C),A=w+y,u=A-w,M[2]=w-(A-u)+(y-u),M[3]=A;const B=b(4,v,4,M,k);E=R*d,p=x*R,h=p-(p-R),f=R-h,p=x*d,m=p-(p-d),g=d-m,T=f*g-(E-h*m-f*m-h*g),C=L*c,p=x*L,h=p-(p-L),f=L-h,p=x*c,m=p-(p-c),g=c-m,O=f*g-(C-h*m-f*m-h*g),y=T-O,u=T-y,M[0]=T-(y+u)+(u-O),w=E+y,u=w-E,I=E-(w-u)+(y-u),y=I-C,u=I-y,M[1]=I-(y+u)+(u-C),A=w+y,u=A-w,M[2]=w-(A-u)+(y-u),M[3]=A;const z=b(B,k,4,M,S);return E=a*d,p=x*a,h=p-(p-a),f=a-h,p=x*d,m=p-(p-d),g=d-m,T=f*g-(E-h*m-f*m-h*g),C=l*c,p=x*l,h=p-(p-l),f=l-h,p=x*c,m=p-(p-c),g=c-m,O=f*g-(C-h*m-f*m-h*g),y=T-O,u=T-y,M[0]=T-(y+u)+(u-O),w=E+y,u=w-E,I=E-(w-u)+(y-u),y=I-C,u=I-y,M[1]=I-(y+u)+(u-C),A=w+y,u=A-w,M[2]=w-(A-u)+(y-u),M[3]=A,P[b(z,S,4,M,P)-1]}(e,t,n,r,o,i,c)}const E=(e,t)=>e.x*t.y-e.y*t.x,T=(e,t)=>e.x*t.x+e.y*t.y,C=(e,t,n)=>{const r=I(e.x,e.y,t.x,t.y,n.x,n.y);return r>0?-1:r<0?1:0},O=e=>Math.sqrt(T(e,e)),A=(e,t,n)=>{const r={x:t.x-e.x,y:t.y-e.y},o={x:n.x-e.x,y:n.y-e.y};return E(o,r)/O(o)/O(r)},R=(e,t,n)=>{const r={x:t.x-e.x,y:t.y-e.y},o={x:n.x-e.x,y:n.y-e.y};return T(o,r)/O(o)/O(r)},N=(e,t,n)=>0===t.y?null:{x:e.x+t.x/t.y*(n-e.y),y:n},L=(e,t,n)=>0===t.x?null:{x:n,y:e.y+t.y/t.x*(n-e.x)};class ${static compare(e,t){const n=$.comparePoints(e.point,t.point);return 0!==n?n:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:j.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0}constructor(e,t){void 0===e.events?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");const t=e.point.events;for(let n=0,r=t.length;n<r;n++){const e=t[n];this.point.events.push(e),e.point=this.point}this.checkForConsuming()}checkForConsuming(){const e=this.point.events.length;for(let t=0;t<e;t++){const n=this.point.events[t];if(void 0===n.segment.consumedBy)for(let r=t+1;r<e;r++){const e=this.point.events[r];void 0===e.consumedBy&&n.otherSE.point.events===e.otherSE.point.events&&n.segment.consume(e.segment)}}}getAvailableLinkedEvents(){const e=[];for(let t=0,n=this.point.events.length;t<n;t++){const n=this.point.events[t];n!==this&&!n.segment.ringOut&&n.segment.isInResult()&&e.push(n)}return e}getLeftmostComparator(e){const t=new Map,n=n=>{const r=n.otherSE;t.set(n,{sine:A(this.point,e.point,r.point),cosine:R(this.point,e.point,r.point)})};return(e,r)=>{t.has(e)||n(e),t.has(r)||n(r);const{sine:o,cosine:i}=t.get(e),{sine:s,cosine:a}=t.get(r);return o>=0&&s>=0?i<a?1:i>a?-1:0:o<0&&s<0?i<a?-1:i>a?1:0:s<o?-1:s>o?1:0}}}let D=0;class j{static compare(e,t){const n=e.leftSE.point.x,r=t.leftSE.point.x,o=e.rightSE.point.x,i=t.rightSE.point.x;if(i<n)return 1;if(o<r)return-1;const s=e.leftSE.point.y,a=t.leftSE.point.y,l=e.rightSE.point.y,c=t.rightSE.point.y;if(n<r){if(a<s&&a<l)return 1;if(a>s&&a>l)return-1;const n=e.comparePoint(t.leftSE.point);if(n<0)return 1;if(n>0)return-1;const r=t.comparePoint(e.rightSE.point);return 0!==r?r:-1}if(n>r){if(s<a&&s<c)return-1;if(s>a&&s>c)return 1;const n=t.comparePoint(e.leftSE.point);if(0!==n)return n;const r=e.comparePoint(t.rightSE.point);return r<0?1:r>0?-1:1}if(s<a)return-1;if(s>a)return 1;if(o<i){const n=t.comparePoint(e.rightSE.point);if(0!==n)return n}if(o>i){const n=e.comparePoint(t.rightSE.point);if(n<0)return 1;if(n>0)return-1}if(o!==i){const e=l-s,t=o-n,d=c-a,u=i-r;if(e>t&&d<u)return 1;if(e<t&&d>u)return-1}return o>i?1:o<i||l<c?-1:l>c?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,n,r){this.id=++D,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=n,this.windings=r}static fromRing(e,t,n){let r,o,i;const s=$.comparePoints(e,t);if(s<0)r=e,o=t,i=1;else{if(!(s>0))throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);r=t,o=e,i=-1}return new j(new $(r,!0),new $(o,!1),[n],[i])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<t?e:t},ur:{x:this.rightSE.point.x,y:e>t?e:t}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}comparePoint(e){if(this.isAnEndpoint(e))return 0;const t=this.leftSE.point,n=this.rightSE.point,r=this.vector();if(t.x===n.x)return e.x===t.x?0:e.x<t.x?1:-1;const o=(e.y-t.y)/r.y,i=t.x+o*r.x;if(e.x===i)return 0;const s=(e.x-t.x)/r.x,a=t.y+s*r.y;return e.y===a?0:e.y<a?-1:1}getIntersection(e){const t=this.bbox(),n=e.bbox(),r=p(t,n);if(null===r)return null;const o=this.leftSE.point,i=this.rightSE.point,s=e.leftSE.point,a=e.rightSE.point,l=u(t,s)&&0===this.comparePoint(s),c=u(n,o)&&0===e.comparePoint(o),d=u(t,a)&&0===this.comparePoint(a),h=u(n,i)&&0===e.comparePoint(i);if(c&&l)return h&&!d?i:!h&&d?a:null;if(c)return d&&o.x===a.x&&o.y===a.y?null:o;if(l)return h&&i.x===s.x&&i.y===s.y?null:s;if(h&&d)return null;if(h)return i;if(d)return a;const f=((e,t,n,r)=>{if(0===t.x)return L(n,r,e.x);if(0===r.x)return L(e,t,n.x);if(0===t.y)return N(n,r,e.y);if(0===r.y)return N(e,t,n.y);const o=E(t,r);if(0==o)return null;const i={x:n.x-e.x,y:n.y-e.y},s=E(i,t)/o,a=E(i,r)/o;return{x:(e.x+a*t.x+(n.x+s*r.x))/2,y:(e.y+a*t.y+(n.y+s*r.y))/2}})(o,this.vector(),s,e.vector());return null===f?null:u(r,f)?y.round(f.x,f.y):null}split(e){const t=[],n=void 0!==e.events,r=new $(e,!0),o=new $(e,!1),i=this.rightSE;this.replaceRightSE(o),t.push(o),t.push(r);const s=new j(r,i,this.rings.slice(),this.windings.slice());return $.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),$.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),o.checkForConsuming()),t}swapEvents(){const e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,n=this.windings.length;t<n;t++)this.windings[t]*=-1}consume(e){let t=this,n=e;for(;t.consumedBy;)t=t.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const r=j.compare(t,n);if(0!==r){if(r>0){const e=t;t=n,n=e}if(t.prev===n){const e=t;t=n,n=e}for(let e=0,r=n.rings.length;e<r;e++){const r=n.rings[e],o=n.windings[e],i=t.rings.indexOf(r);-1===i?(t.rings.push(r),t.windings.push(o)):t.windings[i]+=o}n.rings=null,n.windings=null,n.consumedBy=t,n.leftSE.consumedBy=t.leftSE,n.rightSE.consumedBy=t.rightSE}}prevInResult(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}beforeState(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){const e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}afterState(){if(void 0!==this._afterState)return this._afterState;const e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};const t=this._afterState.rings,n=this._afterState.windings,r=this._afterState.multiPolys;for(let s=0,a=this.rings.length;s<a;s++){const e=this.rings[s],r=this.windings[s],o=t.indexOf(e);-1===o?(t.push(e),n.push(r)):n[o]+=r}const o=[],i=[];for(let s=0,a=t.length;s<a;s++){if(0===n[s])continue;const e=t[s],r=e.poly;if(-1===i.indexOf(r))if(e.isExterior)o.push(r);else{-1===i.indexOf(r)&&i.push(r);const t=o.indexOf(e.poly);-1!==t&&o.splice(t,1)}}for(let s=0,a=o.length;s<a;s++){const e=o[s].multiPoly;-1===r.indexOf(e)&&r.push(e)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;const e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(q.type){case"union":{const n=0===e.length,r=0===t.length;this._isInResult=n!==r;break}case"intersection":{let n,r;e.length<t.length?(n=e.length,r=t.length):(n=t.length,r=e.length),this._isInResult=r===q.numMultiPolys&&n<r;break}case"xor":{const n=Math.abs(e.length-t.length);this._isInResult=n%2==1;break}case"difference":{const n=e=>1===e.length&&e[0].isSubject;this._isInResult=n(e)!==n(t);break}default:throw new Error(`Unrecognized operation type found ${q.type}`)}return this._isInResult}}class B{constructor(e,t,n){if(!Array.isArray(e)||0===e.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=n,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const r=y.round(e[0][0],e[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};let o=r;for(let i=1,s=e.length;i<s;i++){if("number"!=typeof e[i][0]||"number"!=typeof e[i][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let t=y.round(e[i][0],e[i][1]);t.x===o.x&&t.y===o.y||(this.segments.push(j.fromRing(o,t,this)),t.x<this.bbox.ll.x&&(this.bbox.ll.x=t.x),t.y<this.bbox.ll.y&&(this.bbox.ll.y=t.y),t.x>this.bbox.ur.x&&(this.bbox.ur.x=t.x),t.y>this.bbox.ur.y&&(this.bbox.ur.y=t.y),o=t)}r.x===o.x&&r.y===o.y||this.segments.push(j.fromRing(o,r,this))}getSweepEvents(){const e=[];for(let t=0,n=this.segments.length;t<n;t++){const n=this.segments[t];e.push(n.leftSE),e.push(n.rightSE)}return e}}class z{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new B(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let n=1,r=e.length;n<r;n++){const t=new B(e[n],this,!1);t.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=t.bbox.ll.x),t.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=t.bbox.ll.y),t.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=t.bbox.ur.x),t.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=t.bbox.ur.y),this.interiorRings.push(t)}this.multiPoly=t}getSweepEvents(){const e=this.exteriorRing.getSweepEvents();for(let t=0,n=this.interiorRings.length;t<n;t++){const n=this.interiorRings[t].getSweepEvents();for(let t=0,r=n.length;t<r;t++)e.push(n[t])}return e}}class _{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof e[0][0][0]&&(e=[e])}catch(n){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let r=0,o=e.length;r<o;r++){const t=new z(e[r],this);t.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=t.bbox.ll.x),t.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=t.bbox.ll.y),t.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=t.bbox.ur.x),t.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=t.bbox.ur.y),this.polys.push(t)}this.isSubject=t}getSweepEvents(){const e=[];for(let t=0,n=this.polys.length;t<n;t++){const n=this.polys[t].getSweepEvents();for(let t=0,r=n.length;t<r;t++)e.push(n[t])}return e}}class F{static factory(e){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];if(!r.isInResult()||r.ringOut)continue;let o=null,i=r.leftSE,s=r.rightSE;const a=[i],l=i.point,c=[];for(;o=i,i=s,a.push(i),i.point!==l;)for(;;){const e=i.getAvailableLinkedEvents();if(0===e.length){const e=a[0].point,t=a[a.length-1].point;throw new Error(`Unable to complete output ring starting at [${e.x}, ${e.y}]. Last matching segment found ends at [${t.x}, ${t.y}].`)}if(1===e.length){s=e[0].otherSE;break}let n=null;for(let t=0,o=c.length;t<o;t++)if(c[t].point===i.point){n=t;break}if(null!==n){const e=c.splice(n)[0],r=a.splice(e.index);r.unshift(r[0].otherSE),t.push(new F(r.reverse()));continue}c.push({index:a.length,point:i.point});const r=i.getLeftmostComparator(o);s=e.sort(r)[0].otherSE;break}t.push(new F(a))}return t}constructor(e){this.events=e;for(let t=0,n=e.length;t<n;t++)e[t].segment.ringOut=this;this.poly=null}getGeom(){let e=this.events[0].point;const t=[e];for(let l=1,c=this.events.length-1;l<c;l++){const n=this.events[l].point,r=this.events[l+1].point;0!==C(n,e,r)&&(t.push(n),e=n)}if(1===t.length)return null;const n=t[0],r=t[1];0===C(n,e,r)&&t.shift(),t.push(t[0]);const o=this.isExteriorRing()?1:-1,i=this.isExteriorRing()?0:t.length-1,s=this.isExteriorRing()?t.length:-1,a=[];for(let l=i;l!=s;l+=o)a.push([t[l].x,t[l].y]);return a}isExteriorRing(){if(void 0===this._isExteriorRing){const e=this.enclosingRing();this._isExteriorRing=!e||!e.isExteriorRing()}return this._isExteriorRing}enclosingRing(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let r=1,o=this.events.length;r<o;r++){const t=this.events[r];$.compare(e,t)>0&&(e=t)}let t=e.segment.prevInResult(),n=t?t.prevInResult():null;for(;;){if(!t)return null;if(!n)return t.ringOut;if(n.ringOut!==t.ringOut)return n.ringOut.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut.enclosingRing();t=n.prevInResult(),n=t?t.prevInResult():null}}}class W{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){const e=[this.exteriorRing.getGeom()];if(null===e[0])return null;for(let t=0,n=this.interiorRings.length;t<n;t++){const n=this.interiorRings[t].getGeom();null!==n&&e.push(n)}return e}}class H{constructor(e){this.rings=e,this.polys=this._composePolys(e)}getGeom(){const e=[];for(let t=0,n=this.polys.length;t<n;t++){const n=this.polys[t].getGeom();null!==n&&e.push(n)}return e}_composePolys(e){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];if(!r.poly)if(r.isExteriorRing())t.push(new W(r));else{const e=r.enclosingRing();e.poly||t.push(new W(e)),e.poly.addInterior(r)}}return t}}class U{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:j.compare;this.queue=e,this.tree=new a(t),this.segments=[]}process(e){const t=e.segment,n=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),n;const r=e.isLeft?this.tree.add(t):this.tree.find(t);if(!r)throw new Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let o,i,s=r,a=r;for(;void 0===o;)s=this.tree.prev(s),null===s?o=null:void 0===s.key.consumedBy&&(o=s.key);for(;void 0===i;)a=this.tree.next(a),null===a?i=null:void 0===a.key.consumedBy&&(i=a.key);if(e.isLeft){let r=null;if(o){const e=o.getIntersection(t);if(null!==e&&(t.isAnEndpoint(e)||(r=e),!o.isAnEndpoint(e))){const t=this._splitSafely(o,e);for(let e=0,r=t.length;e<r;e++)n.push(t[e])}}let s=null;if(i){const e=i.getIntersection(t);if(null!==e&&(t.isAnEndpoint(e)||(s=e),!i.isAnEndpoint(e))){const t=this._splitSafely(i,e);for(let e=0,r=t.length;e<r;e++)n.push(t[e])}}if(null!==r||null!==s){let e=null;e=null===r?s:null===s||$.comparePoints(r,s)<=0?r:s,this.queue.remove(t.rightSE),n.push(t.rightSE);const o=t.split(e);for(let t=0,r=o.length;t<r;t++)n.push(o[t])}n.length>0?(this.tree.remove(t),n.push(e)):(this.segments.push(t),t.prev=o)}else{if(o&&i){const e=o.getIntersection(i);if(null!==e){if(!o.isAnEndpoint(e)){const t=this._splitSafely(o,e);for(let e=0,r=t.length;e<r;e++)n.push(t[e])}if(!i.isAnEndpoint(e)){const t=this._splitSafely(i,e);for(let e=0,r=t.length;e<r;e++)n.push(t[e])}}}this.tree.remove(t)}return n}_splitSafely(e,t){this.tree.remove(e);const n=e.rightSE;this.queue.remove(n);const r=e.split(t);return r.push(n),void 0===e.consumedBy&&this.tree.add(e),r}}const V="undefined"!=typeof process&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,K="undefined"!=typeof process&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,q=new class{run(e,t,n){q.type=e,y.reset();const r=[new _(t,!0)];for(let a=0,c=n.length;a<c;a++)r.push(new _(n[a],!1));if(q.numMultiPolys=r.length,"difference"===q.type){const e=r[0];let t=1;for(;t<r.length;)null!==p(r[t].bbox,e.bbox)?t++:r.splice(t,1)}if("intersection"===q.type)for(let a=0,c=r.length;a<c;a++){const e=r[a];for(let t=a+1,n=r.length;t<n;t++)if(null===p(e.bbox,r[t].bbox))return[]}const o=new a($.compare);for(let a=0,c=r.length;a<c;a++){const e=r[a].getSweepEvents();for(let t=0,n=e.length;t<n;t++)if(o.insert(e[t]),o.size>V)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const i=new U(o);let s=o.size,l=o.pop();for(;l;){const e=l.key;if(o.size===s){const t=e.segment;throw new Error(`Unable to pop() ${e.isLeft?"left":"right"} SweepEvent [${e.point.x}, ${e.point.y}] from segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] from queue.`)}if(o.size>V)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(i.segments.length>K)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const t=i.process(e);for(let n=0,r=t.length;n<r;n++){const e=t[n];void 0===e.consumedBy&&o.insert(e)}s=o.size,l=o.pop()}return y.reset(),new H(F.factory(i.segments)).getGeom()}};return{union:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return q.run("union",e,n)},intersection:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return q.run("intersection",e,n)},xor:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return q.run("xor",e,n)},difference:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return q.run("difference",e,n)}}},"object"==typeof e&&void 0!==t?t.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).polygonClipping=r()}),Jz=Xz(),Gz=1,Zz=1;function Qz(e,t){return Math.abs(e[0]-t[0])<1e-6&&Math.abs(e[1]-t[1])<1e-6}function e_(e){return Dj(e.shape,e.localToPage).filter(e=>e.closed&&e.nodes.length>=3).map(e=>function(e){const t=[];for(const n of e){const e=[n.x,n.y],r=t[t.length-1];r&&Qz(r,e)||t.push(e)}return t.length>1&&Qz(t[0],t[t.length-1])&&t.pop(),t.length>=3?t:null}(Aj(e).points)).filter(e=>null!==e).map(e=>[e])}function t_(e){const t=e.length>1&&Qz(e[0],e[e.length-1])?e.slice(0,-1):e;return t.length<3?null:{id:`boolean-subpath:${Gz+=1}`,closed:!0,nodes:t.map(([e,t])=>({id:`boolean-node:${Zz+=1}`,x:e,y:t,kind:"corner"}))}}function n_(e,t){const n=t.map(e_).filter(e=>e.length>0);return 0===n.length?[]:function(e,t){const[n,...r]=t;if(!n)return[];if(0===r.length)return n;switch(e){case"union":return(0,Jz.union)(n,...r);case"subtract":return(0,Jz.difference)(n,...r);case"intersect":return(0,Jz.intersection)(n,...r);case"xor":return(0,Jz.xor)(n,...r)}}(e,n).flatMap(e=>e).map(t_).filter(e=>null!==e)}var r_=ut("plugin-path.api");function o_({editor:e}){return function({editor:e}){return{getSelectionStyle:()=>function(e){const t=e.state.selectedShapes.get().filter(oj);return 0===t.length?null:{fill:u_(t.map(e=>e.props.fill)),stroke:u_(t.map(e=>e.props.stroke)),strokeWidth:d_(t.map(e=>e.props.strokeWidth))}}(e),setSelectionStyle(t){const n=e.state.selectedShapes.get().filter(oj).filter(e=>!e.isLocked).map(e=>({id:e.id,props:{...t}}));return n.length>0&&e.commands.updateShapes(n,{source:"user"}),n.map(({id:e})=>e)},getToolDefaults:()=>e.shapes.getDefaultProps("path"),setToolDefaults:t=>(e.shapes.updateDefaultProps("path",t),e.shapes.getDefaultProps("path")),canBeginEdit:()=>null!==i_(e),beginEdit(){const t=i_(e);return!!t&&(pB(e),GB(e),e.editing.start({shapeId:t.id,operationKind:"path.edit",entryMode:"focusEnd"},"user"),!0)},isEditing:()=>null!==s_(e),completeEdit:()=>!!s_(e)&&(e.editing.complete("user"),!0),isNodeSnapEnabled:()=>XB(e),canToggleNodeSnap:()=>{const t=s_(e);return!!t&&!t.isLocked},toggleNodeSnap(){const t=s_(e);return!(!t||t.isLocked)&&(JB(e),!0)},canDeleteSelectedNodes:()=>a_(e,()=>!0),deleteSelectedNodes(){const t=uB(e);return!(!t||t.shape.isLocked)&&(gz(e,t.shape,t.selection.nodes),!0)},canMakeSelectedNodesCurve:()=>a_(e,e=>e.entries.some(({node:e})=>!e.in&&!e.out)),makeSelectedNodesCurve:()=>l_(e,"make-curve"),canRemoveSelectedNodeHandles:()=>a_(e,e=>e.entries.some(({node:e})=>!!e.in||!!e.out)),removeSelectedNodeHandles:()=>l_(e,"remove-handles"),canRunSelectedNodeOperation:t=>a_(e,e=>qj(e.shape.props.subpaths,e.selection.nodes,t)),runSelectedNodeOperation(t){const n=uB(e);return!(!n||n.shape.isLocked||!qj(n.shape.props.subpaths,n.selection.nodes,t))&&(yz(e,t),!0)},canRunBooleanOperation:()=>c_(e).length>=2,runBooleanOperation:t=>function(e,t){const n=c_(e),r=n[0];if(!r||n.length<2)return null;const o=function(e,t,n){const r=n_(e,t);return 0===r.length?null:$j(r,{...n,fillRule:"evenodd"})}(t,n.map(t=>({shape:t,localToPage:e.shapes.computeLocalToPageTransform(t)})),{fill:r.props.fill,stroke:r.props.stroke,strokeWidth:r.props.strokeWidth});if(!o)return null;let i=null;return e.operations.run({kind:`path.boolean.${t}`,label:"shape.boolean",source:"user",history:"record"},()=>{const[t]=e.commands.createShapes([{type:"path",x:o.x,y:o.y,parentId:r.parentId,props:{...r.props,subpaths:o.subpaths,fillRule:"evenodd"}}],{source:"user"});e.commands.deleteShapes(n.map(e=>e.id),{source:"user"}),t&&(i=t.id,e.commands.setSelectedShapeIds([t.id],{source:"system"}))}),i}(e,t)}}({editor:e})}function i_(e){const t=e.state.selectedShapes.get(),n=1===t.length?t[0]:null;return oj(n)&&!n.isLocked?n:null}function s_(e){const t=e.state.shapeEditingSession.get(),n=t?e.shapes.get(t.shapeId):null;return oj(n)?n:null}function a_(e,t){const n=uB(e);return!!n&&!n.shape.isLocked&&t(n)}function l_(e,t){const n=uB(e);if(!n||n.shape.isLocked)return!1;const r="make-curve"===t?n.entries.filter(({node:e})=>!e.in&&!e.out).reduce((e,{ref:t})=>Vj(e,t.subpathId,t.nodeId),n.shape.props.subpaths):n.selection.nodes.reduce((e,t)=>Kj(e,t.subpathId,t.nodeId),n.shape.props.subpaths);e.commands.updateShapes([{id:n.shape.id,props:{subpaths:r}}],{source:"user"});const o=e.shapes.get(n.shape.id);return oj(o)&&fB(e,o,n.selection.nodes,n.selection.primary),KB(e,n.shape.id),!0}function c_(e){return e.state.selectedShapes.get().filter(oj).filter(e=>!e.isLocked&&!e.isHidden)}function d_(e){const[t,...n]=e;return void 0!==t&&n.every(e=>e===t)?t:null}function u_(e){const[t,...n]=e;return void 0!==t&&n.every(e=>O(t,e))?t:null}var p_={id:"path",editor:Yz(),render:LB(),api:r_,setup:({editor:e})=>({api:o_({editor:e})})},h_=ut("canvas-kit.clipboard");function f_({clipboard:e,editor:t,tasks:n}){return function({clipboard:e,editor:t,tasks:n}){return{hasContent:()=>null!==e.getMemoryPayload(),copy:()=>n.run(async n=>{const r=t.selection.createClipboardPayload();return r?(await e.write(r),n.throwIfAborted(),r):null}),cut:()=>n.run(async n=>{const r=t.selection.createClipboardPayload();return!!r&&(await e.write(r),n.throwIfAborted(),t.selection.delete("user"),!0)}),paste:(r={})=>n.run(async n=>{const o=await e.read();return n.throwIfAborted(),!!o&&(t.selection.pasteClipboardPayload({payload:o,pagePoint:r.pagePoint?m_(r.pagePoint):t.state.viewportPageBounds.get()?.center??void 0,source:"user"}),!0)})}}({clipboard:e,editor:t,tasks:n})}function m_(e){return new p(e.x,e.y)}function g_(){let e=null;const t=new Set;return{value:{async write(n){e=n;for(const e of t)e()},read:async()=>e,getMemoryPayload:()=>e,subscribe:e=>(t.add(e),()=>t.delete(e))},dispose(){t.clear(),e=null}}}function y_(e={}){return{id:"canvas-kit.clipboard-runtime",api:h_,setup({editor:t,tasks:n}){const r=e.createClipboard?.()??g_();try{return{api:f_({clipboard:r.value,editor:t,tasks:n}),dispose:()=>r.dispose?.()}}catch(o){throw Promise.resolve(r.dispose?.()).catch(()=>{}),o}}}}var x_=y_();function b_(e){return new Promise((t,n)=>{const r=new FileReader;r.addEventListener("load",()=>{t("string"==typeof r.result?r.result:null)}),r.addEventListener("error",()=>{n(r.error)}),r.readAsDataURL(e)})}async function w_({assetInliners:e=[],editor:t,padding:n=16,resolveThemeColor:r,shapeIds:o}){t.exports.repairIntegrity(o);const i=Array.from(t.shapeSvgExporters.values(),e=>e.type).sort();let s,a=t.exports.getIntegrityReport(o);try{s=await async function({assetInliners:e,editor:t,padding:n,resolveThemeColor:r,shapeIds:o}){const i=3;for(let a=0;a<i;a+=1){const i=t.store.getRevision();try{for(const n of e)await(n.prepare?.({editor:t,requestedShapeIds:o}))}catch(s){if(t.store.getRevision()!==i)continue;throw s}if(t.store.getRevision()!==i)continue;const a=t.exports.getSvgString(o,{padding:n,resolveThemeColor:r}),l=a?.exportedShapeIds.flatMap(e=>{const n=t.shapes.get(e);return n?[n]:[]})??[];if(t.store.getRevision()===i)return{exportedShapes:l,result:a}}throw new Error("The document changed repeatedly during SVG export.")}({assetInliners:e,editor:t,padding:n,resolveThemeColor:r,shapeIds:o})}catch(p){return a=t.exports.getIntegrityReport(o),v_({cause:p,integrity:a,supportedShapeTypes:i})}a=t.exports.getIntegrityReport(o);const l=function({integrity:e,supportedShapeTypes:t}){const n=function(e){const t=Object.entries(e).filter(e=>"number"==typeof e[1]);return 0===t.length?"none":t.map(([e,t])=>`${e} ${t}`).join(", ")}(function(e){const t={};for(const n of e.issues)t[n.kind]=(t[n.kind]??0)+1;return t}(e));return 0===e.fatalIssueCount&&0===e.issues.length?{tone:"success",title:"SVG export ready",details:`${e.requestedShapeIds.length} shape(s) ready. Issues: ${n}.`,integrity:e,supportedShapeTypes:t}:e.canExport?{tone:"warning",title:"SVG export repaired",details:`${e.requestedShapeIds.length} shape(s) exportable. Issues: ${n}.`,integrity:e,supportedShapeTypes:t}:{tone:"error",title:"SVG export blocked",details:`Fatal export issue(s): ${n}.`,integrity:e,supportedShapeTypes:t}}({integrity:a,supportedShapeTypes:i}),{exportedShapes:c,result:d}=s;if(!d)return{status:{...l,tone:"error",title:"SVG export blocked",details:`${l.details} No exportable SVG content was produced.`},svg:null,width:null,height:null,exportedShapeIds:[],skippedShapes:[]};let u=d.svg;try{for(const n of e)u=await n.inline({editor:t,exportedShapes:c,exportedShapeIds:d.exportedShapeIds,svg:u});!function(e){const t=new Set,n=/<([a-z][\w:-]*)\b([^>]*)>/giu,r=/<style\b[^>]*>([\s\S]*?)<\/style>/giu,o=/\burl\(\s*(["']?)(.*?)\1\s*\)/giu,i=Array.from(e.matchAll(n));for(const a of i){const e=M_(a[1]??""),n=E_(a[2]??"");for(const r of I_(e)){const e=n.get(r)?.trim();if(!e)continue;const o="srcset"===r?T_(e):[e];for(const n of o)C_(n)||t.add(n)}}const s=[...i.map(e=>e[0]),...Array.from(e.matchAll(r),e=>e[1]??"")];for(const a of s){for(const e of a.matchAll(o)){const n=e[2]?.trim();n&&!C_(n)&&t.add(n)}/@import\b/iu.test(a)&&t.add("CSS @import"),/\blocal\(/iu.test(a)&&t.add("CSS local() font source")}if(t.size>0)throw new Error(`${t.size} external SVG resource(s) remain after embedding.`)}(u)}catch(p){return v_({cause:p,exportedShapeIds:d.exportedShapeIds,integrity:a,skippedShapes:d.skippedShapes,supportedShapeTypes:i})}return{status:l,svg:u,width:d.width,height:d.height,exportedShapeIds:d.exportedShapeIds,skippedShapes:d.skippedShapes}}function v_({cause:e,exportedShapeIds:t=[],integrity:n,skippedShapes:r=[],supportedShapeTypes:o}){return{status:{tone:"error",title:"SVG export blocked",details:`Resource embedding failed: ${e instanceof Error&&e.message.trim().length>0?e.message:"An SVG resource could not be embedded."}`,integrity:n,supportedShapeTypes:o},svg:null,width:null,height:null,exportedShapeIds:t,skippedShapes:r}}var k_={audio:["src"],embed:["src"],iframe:["src"],img:["src","srcset"],input:["src"],object:["data"],script:["src"],source:["src","srcset"],track:["src"],video:["poster","src"]},S_=["href","xlink:href"],P_=new Set(["a","area"]);function M_(e){return(e.split(":").pop()??e).toLowerCase()}function I_(e){const t=k_[e]??[];return P_.has(e)?t:[...S_,...t]}function E_(e){const t=new Map;for(const n of e.matchAll(/([^\s=/>]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+))/gu)){const e=n[1]?.toLowerCase(),r=n[2]??n[3]??n[4];e&&void 0!==r&&t.set(e,r)}return t}function T_(e){const t=[];let n=0;for(;n<e.length;){for(;n<e.length&&(","===e[n]||/\s/u.test(e[n]??""));)n+=1;if(n>=e.length)break;const r="data:"===e.slice(n,n+5).toLowerCase(),o=n;for(;n<e.length&&!/\s/u.test(e[n]??"")&&(r||","!==e[n]);)n+=1;let i=e.slice(o,n);const s=r&&i.endsWith(",");if(s&&(i=i.replace(/,+$/u,"")),i&&t.push(i),!s)for(;n<e.length&&","!==e[n];)n+=1}return t}function C_(e){return e.startsWith("#")||/^data:/iu.test(e)}var O_=16384,A_=67108864;async function R_({background:e,pixelRatio:t=2,...n}){const r=await w_(n);if(!r.svg||null===r.width||null===r.height)return{status:"error"===r.status.tone?L_(r.status):{...r.status,tone:"error",title:"PNG export blocked",details:`${r.status.details} No exportable SVG content was produced.`},blob:null,width:null,height:null,exportedShapeIds:r.exportedShapeIds,skippedShapes:r.skippedShapes};try{const n=await async function({background:e,height:t,pixelRatio:n,svg:r,width:o}){const i=Math.ceil(o*n),s=Math.ceil(t*n);if(function({height:e,pixelRatio:t,sourceHeight:n,sourceWidth:r,width:o}){if(!Number.isFinite(t)||t<=0||!Number.isFinite(r)||r<=0||!Number.isFinite(n)||n<=0)throw new Error("PNG dimensions and pixel ratio must be positive numbers.");if(o>O_||e>O_||o*e>A_)throw new Error(`PNG dimensions ${o}×${e} exceed the browser export limit.`)}({height:s,pixelRatio:n,sourceHeight:t,sourceWidth:o,width:i}),"undefined"==typeof document||"undefined"==typeof Image||"undefined"==typeof FileReader)throw new Error("PNG export requires a browser environment.");const a=await b_(new Blob([r],{type:"image/svg+xml;charset=utf-8"}));if(!a)throw new Error("The exported SVG could not be encoded as a data URL.");const l=await(d=a,new Promise((e,t)=>{const n=new Image;n.onload=()=>e(n),n.onerror=()=>t(new Error("The exported SVG could not be decoded.")),n.src=d})),c=document.createElement("canvas");var d;c.width=i,c.height=s;const u=c.getContext("2d");if(!u)throw new Error("A 2D canvas context is unavailable.");e&&(u.fillStyle=e,u.fillRect(0,0,i,s));return u.drawImage(l,0,0,i,s),{blob:await N_(c),width:i,height:s}}({background:e,height:r.height,pixelRatio:t,svg:r.svg,width:r.width});return{status:L_(r.status,`${n.width}×${n.height} px.`),blob:n.blob,width:n.width,height:n.height,exportedShapeIds:r.exportedShapeIds,skippedShapes:r.skippedShapes}}catch(o){const e=o instanceof Error&&o.message.trim().length>0?o.message:"The SVG could not be rasterized.";return{status:{...r.status,tone:"error",title:"PNG export blocked",details:`Rasterization failed: ${e}`},blob:null,width:null,height:null,exportedShapeIds:r.exportedShapeIds,skippedShapes:r.skippedShapes}}}function N_(e){return new Promise((t,n)=>{e.toBlob(e=>{e?t(e):n(new Error("The browser did not produce a PNG blob."))},"image/png")})}function L_(e,t){return{...e,title:"success"===e.tone?"PNG export ready":"warning"===e.tone?"PNG export repaired":"PNG export blocked",details:t?`${e.details} ${t}`:e.details}}async function $_(e,t){return(await e.export("svg",{...__(t),options:t})).result}async function D_(e,t){return(await e.export("png",{...__(t),options:t})).result}function j_(){return{kind:"provider",id:"canvas-kit.export.svg",format:"svg",label:"SVG",mimeType:"image/svg+xml;charset=utf-8",fileExtension:"svg",async export({editor:e,options:t,shapeIds:n},r){const o=t??{},i=await w_({assetInliners:[z_(n,r.inlineSvg)],editor:e,padding:o.padding,resolveThemeColor:o.appearance?.resolveThemeColor,shapeIds:n});return{data:i.svg,result:i,status:i.status}}}}function B_(){return{kind:"provider",id:"canvas-kit.export.png",format:"png",label:"PNG",mimeType:"image/png",fileExtension:"png",async export({editor:e,options:t,shapeIds:n},r){const o=t??{},i=await R_({assetInliners:[z_(n,r.inlineSvg)],background:o.background,editor:e,padding:o.padding,pixelRatio:o.pixelRatio,resolveThemeColor:o.appearance?.resolveThemeColor,shapeIds:n});return{data:i.blob,result:i,status:i.status}}}}function z_(e,t){return{inline:n=>t({...n,requestedShapeIds:e})}}function __(e){return e.scope?{scope:e.scope}:{shapeIds:e.shapeIds}}function F_(){return{id:"canvas-kit.export",setup:()=>({exports:[j_(),B_()]})}}function W_(e,t=0){return Math.max(0,"number"==typeof e&&Number.isFinite(e)?e:t)}function H_({cornerRadius:e,h:t,w:n}){return Math.min(W_(e),Math.max(0,n)/2,Math.max(0,t)/2)}function U_(e){return d(e)&&"video"===e.type}function V_(e){return c(e)&&"video"===e.type}var K_=ut("plugin-video.api");function q_({editor:e}){return{getSelectionState(){if(1!==e.selection.getIds().length)return null;const[t]=e.state.selectedShapes.get();return V_(t)?{shapeId:t.id,cornerRadius:W_(t.props.cornerRadius),loop:t.props.loop}:null},setSelectionStyle(t){const n=e.state.selectedShapes.get().filter(V_).filter(e=>!e.isLocked).map(e=>({id:e.id,props:{...void 0===t.cornerRadius?{}:{cornerRadius:W_(t.cornerRadius)},...void 0===t.loop?{}:{loop:t.loop}}}));return n.length>0&&e.commands.updateShapes(n,{source:"user"}),n.map(({id:e})=>e)}}}function Y_(e,t){return"number"==typeof e&&Number.isFinite(e)?e:t}var X_=class extends oe{type="video";getDefaultProps(){return{w:320,h:180,assetId:null,name:"",loop:!1,cornerRadius:0}}validateProps(e){const t=e&&"object"==typeof e?e:{},n=this.getDefaultProps();return{w:Math.max(64,Y_(t.w,n.w)),h:Math.max(36,Y_(t.h,n.h)),assetId:(r=t.assetId,"string"==typeof r&&r.startsWith("asset:")?t.assetId:null),name:"string"==typeof t.name?t.name:"",loop:!0===t.loop,cornerRadius:W_(t.cornerRadius)};var r}getLocalBounds(e){return new h(0,0,e.props.w,e.props.h)}getRenderBounds(e){return Q_(e)}getExportBounds(e){return this.getLocalBounds(e)}getPointHitTestBounds(e){const t=Q_(e);return new h(t.x+e.x,t.y+e.y,t.w,t.h)}canEdit(e){return!0}hitTest(e,t){return this.getPointHitTestBounds(e).containsPoint(t)}hitTestBindingTarget(e,t){return this.getPositionedBounds(e).containsPoint(t)}canReceiveTerminalBinding(e){return!0}getAllowedSelectionResizeModes(e,t){return W}},J_="Video",G_=34;function Z_(e){return/^\s*$/.test(e)?J_:e}function Q_(e){return new h(0,-34,e.props.w,e.props.h+34)}function eF(){return{id:"land.video",shapeUtils:[new X_]}}var tF='[data-ui="video-canvas-name"]',nF='[data-ui="video-shape-player"]',rF=new Set(["key_down","key_up","pointer_cancel","pointer_down","pointer_move","pointer_up"]),oF=["Inter","ui-sans-serif","system-ui","-apple-system","BlinkMacSystemFont","'Segoe UI'","sans-serif"].join(", "),iF={id:"land.video.player.dom-events",handle({event:e,name:t}){if(!rF.has(t))return"continue";const n=e.target;return n instanceof Element&&n.closest(nF)?"handled":"continue"},getCursor:({element:e})=>e?.closest(nF)?"default":void 0},sF={id:"land.video.name.dom-events",handle({event:e}){const t=e.target;return t instanceof Element&&t.closest(tF)?"handled":"continue"},getCursor:({element:e})=>e?.closest(tF)?"text":void 0};function aF(){return{id:"land.video.react",domEventGuards:[iF,sF],shapeRenderers:[{type:"video",component:lF,hoverComponent:cF}]}}function lF({editor:e,isSelected:t,shape:n,shapeEditingSession:r}){const{assetId:o,h:i,loop:s,name:a,w:l}=n.props,c=o?e.assets.resolveUrl(o):null,d=r?.shapeId===n.id;
154
+ return(0,Jt.jsxs)("div",{style:{height:"100%",overflow:"visible",pointerEvents:"none",position:"relative",width:"100%"},children:[ (0,Jt.jsx)("div",{"data-ui":"video-shape",style:{background:"#000",borderRadius:H_(n.props),display:"block",height:i,left:0,overflow:"hidden",pointerEvents:"none",position:"absolute",top:34,width:l},children:c? (0,Jt.jsx)("video",{"aria-label":Z_(a),controls:t,"data-ui":"video-shape-player",draggable:!1,loop:s,playsInline:!0,preload:"metadata",src:c,style:{display:"block",height:i,objectFit:"contain",pointerEvents:t?"auto":"none",userSelect:"none",width:l}}): (0,Jt.jsx)("div",{"data-ui":"video-shape-missing-asset",style:{alignItems:"center",background:"#0f172a",border:"1px solid #334155",boxSizing:"border-box",color:"#cbd5e1",display:"flex",fontFamily:oF,fontSize:12,height:i,justifyContent:"center",overflow:"hidden",width:l},children:"Missing video"})}), (0,Jt.jsx)(dF,{editor:e,shape:n,isEditing:d})]})}function cF({shape:e,strokeWidth:t}){const n=Q_(e);
155
+ return(0,Jt.jsx)("svg",{"aria-hidden":"true","data-ui":"video-hover-outline",width:"100%",height:"100%",viewBox:`${n.x} ${n.y} ${n.w} ${n.h}`,style:{display:"block",overflow:"visible",pointerEvents:"none"},children: (0,Jt.jsx)("rect",{x:0,y:0,width:e.props.w,height:e.props.h,rx:H_(e.props),ry:H_(e.props),fill:"none",stroke:pn,strokeWidth:t,vectorEffect:"non-scaling-stroke"})})}function dF({editor:e,shape:t,isEditing:n}){const r=(0,Vt.useRef)(null),[o,i]=(0,Vt.useState)(!1),s=sn(e.state.cameraZoom),a=sn(e.shapes.getLocalToPageTransformSignal(t.id)),l=Math.max(s,1e-4),c=Math.min(1/l,3.5),d=function(e){const t=2*Math.PI,n=(e%t+t)%t;return Math.floor(2*(n+Math.PI/4)/Math.PI%4)}(a?Math.atan2(a.b,a.a):0),u=0===d||2===d?t.props.w:t.props.h,p=function(e,t){switch(t){case 0:return"";case 1:return`translate(0px, ${e.props.h}px) rotate(270deg)`;case 2:return`translate(${e.props.w}px, ${e.props.h}px) rotate(180deg)`;case 3:return`translate(${e.props.w}px, 0px) rotate(90deg)`}}(t,d),h=Z_(t.props.name);(0,Vt.useEffect)(()=>{const e=r.current;n&&e&&(e.focus(),e.select())},[n]);const f=(0,Vt.useCallback)(()=>{e.editing.canEditShape(t)&&e.editing.start({shapeId:t.id,entryMode:"selectAll",operationKind:"video.edit"},"user")},[e,t]),m=(0,Vt.useCallback)(n=>{e.commands.updateShapes([{id:t.id,props:{name:n.currentTarget.value}}],{source:"user"})},[e,t.id]),g=(0,Vt.useCallback)(t=>{e.editing.complete("user")},[e]),y=(0,Vt.useCallback)(t=>{e.editing.setComposition(!0,"system")},[e]),x=(0,Vt.useCallback)(t=>{e.editing.setComposition(!1,"system")},[e]),b=(0,Vt.useCallback)(t=>{if(t.stopPropagation(),!t.nativeEvent.isComposing)return"Enter"===t.key?(t.preventDefault(),void e.editing.complete("user")):void("Escape"===t.key&&(t.preventDefault(),e.editing.cancel("user")))},[e]),w=(0,Vt.useCallback)(e=>{e.stopPropagation()},[]),v=(0,Vt.useCallback)(e=>{e.stopPropagation(),n||f()},[n,f]);
156
+ return(0,Jt.jsx)("div",{style:{height:0,left:0,overflow:"visible",pointerEvents:"none",position:"absolute",top:34,width:0},children: (0,Jt.jsx)("div",{"data-ui":"video-canvas-heading","data-shape-id":t.id,style:{alignItems:"center",bottom:0,display:"flex",fontFamily:oF,fontSize:12,fontWeight:400,maxWidth:u*l+24,minWidth:32,overflow:"visible",paddingBottom:4,pointerEvents:t.isLocked?"none":"auto",position:"absolute",transform:`${p} scale(${c}) translateX(-7px)`,transformOrigin:"0 100%",userSelect:"none",whiteSpace:"pre"},children: (0,Jt.jsxs)("div",{style:{alignItems:"center",background:"var(--land-canvas-bg, white)",borderRadius:4,boxShadow:"inset 0 0 0 1px var(--land-canvas-bg, white)",color:"var(--land-text-primary, #0f172a)",display:"flex",height:24,pointerEvents:"auto",width:"100%"},children:[ (0,Jt.jsx)("div",{"aria-hidden":"true","data-ui":"video-drag-handle",onPointerEnter:()=>i(!0),onPointerLeave:()=>i(!1),style:{alignItems:"center",backgroundColor:o?"rgba(37, 99, 235, 0.12)":"transparent",borderRadius:4,boxShadow:o?"inset 0 0 0 1px rgba(37, 99, 235, 0.28)":"none",cursor:"grab",display:"flex",flex:"0 0 28px",height:28,justifyContent:"center",pointerEvents:"auto",transition:"background-color 120ms ease, box-shadow 120ms ease"},children: (0,Jt.jsxs)("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"currentColor",children:[
157
+
158
+ (0,Jt.jsx)("circle",{cx:"3",cy:"3",r:"1"}),
159
+
160
+ (0,Jt.jsx)("circle",{cx:"7",cy:"3",r:"1"}),
161
+
162
+ (0,Jt.jsx)("circle",{cx:"3",cy:"7",r:"1"}),
163
+
164
+ (0,Jt.jsx)("circle",{cx:"7",cy:"7",r:"1"}),
165
+
166
+ (0,Jt.jsx)("circle",{cx:"3",cy:"11",r:"1"}),
167
+
168
+ (0,Jt.jsx)("circle",{cx:"7",cy:"11",r:"1"})]})}), (0,Jt.jsxs)("div",{"data-ui":"video-canvas-name","data-shape-id":t.id,role:n?void 0:"button","aria-label":n?void 0:`Edit video name: ${h}`,onClick:v,onPointerDown:w,style:{background:n?"var(--land-surface-bg, white)":void 0,borderRadius:4,boxShadow:n?"inset 0 0 0 1.5px var(--land-selection, #2563eb)":void 0,color:n?"transparent":"inherit",cursor:"text",height:n?"100%":void 0,minWidth:n?32:void 0,overflow:n?"visible":"hidden",padding:"0 6px 0 0",pointerEvents:"auto",position:"relative",textOverflow:"ellipsis",whiteSpace:"pre",width:n?"auto":void 0},children:[ (0,Jt.jsx)("input",{ref:r,"data-ui":"video-canvas-name-input","data-shape-id":t.id,"aria-label":"Video name",value:t.props.name,autoComplete:"off",disabled:!n,readOnly:!n,spellCheck:!1,onBlur:g,onChange:m,onCompositionStart:y,onCompositionEnd:x,onKeyDown:b,onPointerDown:w,style:{background:"none",border:0,borderRadius:4,boxSizing:"border-box",color:"var(--land-text-primary, #0f172a)",cursor:"text",display:n?void 0:"none",font:"inherit",height:"100%",inset:0,lineHeight:"24px",minWidth:0,outline:0,padding:"0 6px",position:"absolute",userSelect:"text",width:"100%"}}),h+String.fromCharCode(8203)]})]})})})}var uF={id:"video",editor:eF(),render:aF(),api:K_,setup:({editor:e})=>({api:q_({editor:e})})},pF=ut("video.host-api"),hF="blobs",fF=null;function mF(){return"undefined"==typeof indexedDB?Promise.resolve(null):(fF||(fF=new Promise((e,t)=>{const n=indexedDB.open("land.plugin-video",1);n.addEventListener("upgradeneeded",()=>{n.result.objectStoreNames.contains(hF)||n.result.createObjectStore(hF)}),n.addEventListener("success",()=>{const t=n.result;t.addEventListener("versionchange",()=>{t.close(),fF=null}),e(t)}),n.addEventListener("error",()=>{fF=null,t(n.error)})})),fF)}var gF="video-blob:";function yF(){return"undefined"!=typeof crypto&&"randomUUID"in crypto?`${gF}${crypto.randomUUID()}`:`${gF}${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}async function xF(e){if("undefined"==typeof indexedDB)throw new Error("IndexedDB is not available for video storage.");const t=yF();return await async function(e,t){const n=await mF();n&&await new Promise((r,o)=>{const i=n.transaction(hF,"readwrite");i.addEventListener("complete",()=>r()),i.addEventListener("abort",()=>o(i.error)),i.addEventListener("error",()=>o(i.error)),i.objectStore(hF).put(t,e)})}(t,e),{storageKey:t}}async function bF(e){const t=await async function(e){const t=await mF();return t?new Promise((n,r)=>{const o=t.transaction(hF,"readonly").objectStore(hF).get(e);o.addEventListener("success",()=>n(o.result??null)),o.addEventListener("error",()=>r(o.error))}):null}(e);return t instanceof Blob?t:null}async function wF(e){await async function(e){const t=await mF();t&&await new Promise((n,r)=>{const o=t.transaction(hF,"readwrite");o.addEventListener("complete",()=>n()),o.addEventListener("abort",()=>r(o.error)),o.addEventListener("error",()=>r(o.error)),o.objectStore(hF).delete(e)})}(e)}async function vF(){return(await async function(){const e=await mF();return e?new Promise((t,n)=>{const r=e.transaction(hF,"readonly").objectStore(hF).getAllKeys();r.addEventListener("success",()=>t([...r.result])),r.addEventListener("error",()=>n(r.error))}):null}())?.map(String)??[]}function kF(e,t){const n=e.assets.get(t);return U_(n)&&"local"===n.props.source.kind&&n.props.source.storageKey||null}function SF(e,t){const n=e.assets.get(t);return U_(n)&&"remote"===n.props.source.kind&&n.props.source.url||null}function PF(e){const t=new Set;for(const n of e.assets.getAll())U_(n)&&"local"===n.props.source.kind&&n.props.source.storageKey&&t.add(n.props.source.storageKey);return t}async function MF({editor:e,objectUrls:t}){const n=PF(e),r=await vF(),o=[];for(const i of r)n.has(i)||(t?.release(i),await wF(i),o.push(i));return o}function IF(){const e=new Map,t=new Map;let n=0,r=!1;const o=async(o,i={})=>{if(i.signal?.throwIfAborted(),r)return null;const s=e.get(o);if(s)return s;const a=t.get(o);if(a)return a;const l=n,c=bF(o).then(t=>{if(i.signal?.throwIfAborted(),!t||r||l!==n)return null;const s=URL.createObjectURL(t);return e.set(o,s),s}).finally(()=>{t.delete(o)});return t.set(o,c),c};return{async preloadForEditor(e,t={}){t.signal?.throwIfAborted(),await Promise.all(Array.from(PF(e)).map(e=>o(e,t)))},preload:o,resolve:t=>e.get(t)??null,resolveAssetUrl(t,n){const r=SF(t,n);if(r)return r;const o=kF(t,n);return o?e.get(o)??null:null},release(n){const r=e.get(n);r&&(URL.revokeObjectURL(r),e.delete(n)),t.delete(n)},releaseAll(){r=!0,n+=1;for(const t of e.values())URL.revokeObjectURL(t);e.clear(),t.clear()}}}async function EF(e,{signal:t}){if("url"===e.type)return{...await TF(e.url,{signal:t}),name:e.name||LF(e.url)||"Video",source:{kind:"remote",url:e.url},mimeType:null};const n="file"===e.type?e.file:e.blob;if(!AF(n))throw new Error("The selected file is not a video.");const r=URL.createObjectURL(n),o=await TF(r,{signal:t}).finally(()=>URL.revokeObjectURL(r));t.throwIfAborted();const{storageKey:i}=await xF(n);try{t.throwIfAborted()}catch(s){throw await wF(i),s}return{...o,name:"file"===e.type?e.file.name||"Video":e.name||"Video",source:{kind:"local",storageKey:i},mimeType:"file"===e.type?e.file.type||"video/mp4":e.mimeType||e.blob.type||"video/mp4",fileSize:n.size}}function TF(e,{signal:t}={}){return t?.throwIfAborted(),new Promise((n,r)=>{const o=document.createElement("video"),i=()=>{o.removeEventListener("loadedmetadata",s),o.removeEventListener("error",a),t?.removeEventListener("abort",l),o.removeAttribute("src"),o.load()},s=()=>{const e=o.videoWidth||320,t=o.videoHeight||180,r=Number.isFinite(o.duration)&&o.duration>=0?o.duration:null;i(),n({width:e,height:t,duration:r})},a=()=>{i(),r(new Error("Could not decode video metadata."))},l=()=>{i(),r(t?.reason??new Error("Video metadata decoding aborted."))};o.preload="metadata",o.addEventListener("loadedmetadata",s),o.addEventListener("error",a),t?.addEventListener("abort",l,{once:!0}),o.src=e,o.load(),t?.aborted&&l()})}function CF({height:e,width:t}){const n=t>0&&Number.isFinite(t)?t:320,r=e>0&&Number.isFinite(e)?e:180,o=Math.min(1,480/Math.max(n,r));return{w:Math.max(64,Math.round(n*o)),h:Math.max(36,Math.round(r*o))}}function OF(e){for(const t of e)if(t.type.startsWith("video/"))return t;return null}function AF(e){return!e.type||e.type.startsWith("video/")}function RF({filename:e,url:t}){const n=document.createElement("a");n.href=t,n.download=e,n.click()}async function NF({blob:e,filename:t}){const n=URL.createObjectURL(e);try{RF({filename:t,url:n})}finally{window.setTimeout(()=>URL.revokeObjectURL(n),0)}}function LF(e){try{const t=new URL(e).pathname.split("/").filter(Boolean).at(-1);return t?decodeURIComponent(t):null}catch{return null}}var $F=1;function DF(e,t){return e.commands.createAsset({type:"video",props:{w:t.width,h:t.height,duration:t.duration,name:t.name,source:t.source,mimeType:t.mimeType,fileSize:t.fileSize}},{source:"user"})}async function jF({editor:e,objectUrls:t,pagePoint:n,signal:r,size:o,source:i}){return BF({editor:e,input:await EF(i,{signal:r}),objectUrls:t,pagePoint:n,signal:r,size:o})}async function BF({editor:e,input:t,objectUrls:n,pagePoint:r,signal:o,size:i}){const s="local"===t.source.kind?t.source.storageKey:null;try{s&&await n.preload(s,{signal:o}),o.throwIfAborted()}catch(l){throw await FF({objectUrls:n,storageKey:s}),l}let a=null;try{const o=DF(e,t);a=o.id;const l=function(e){return!e||!Number.isFinite(e.w)||!Number.isFinite(e.h)||e.w<=0||e.h<=0?null:{w:Math.max(64,e.w),h:Math.max(36,e.h)}}(i)??CF({width:o.props.w,height:o.props.h}),c=e.state.viewportPageBounds.get(),d=r??c?.center??e.viewport.screenToPage(new p(360,240)),[u]=e.commands.createShapes([{type:"video",x:Math.round(d.x-l.w/2),y:Math.round(d.y-l.h/2),props:{...l,assetId:o.id,name:t.name}}],{source:"user"});return u?(e.commands.setSelectedShapeIds([u.id],{source:"user"}),u.id):(e.commands.deleteAsset(o.id,{source:"system"}),a=null,await FF({objectUrls:n,storageKey:s}),null)}catch(l){throw a&&e.commands.deleteAsset(a,{source:"system"}),await FF({objectUrls:n,storageKey:s}),l}}async function zF({editor:e,file:t,objectUrls:n,signal:r}){if(!AF(t))return!1;const[o]=e.state.selectedShapes.get();return!(1!==e.selection.getIds().length||!V_(o)||o.isLocked)&&async function({editor:e,input:t,objectUrls:n,shape:r,signal:o}){const i=r.props.assetId,s="local"===t.source.kind?t.source.storageKey:null;try{o.throwIfAborted(),s&&await n.preload(s,{signal:o}),o.throwIfAborted()}catch(a){throw await FF({objectUrls:n,storageKey:s}),a}try{const o=e.shapes.get(r.id);if(!V_(o)||o.isLocked||o.props.assetId!==i)return await FF({objectUrls:n,storageKey:s}),!1;const l=e.operations.begin({kind:`video.asset.replace:${r.id}:${$F++}`,label:"video.asset.replace",source:"user",history:"record"});try{const n=DF(e,t);return e.commands.updateShapes([{id:r.id,props:{assetId:n.id,name:t.name}}],{source:"user"}),i&&!function(e,t){return e.snapshots.getDocument().records.some(e=>"shape"===e.typeName&&e.props.assetId===t)}(e,i)&&e.commands.deleteAsset(i,{source:"user"}),l.commit(),!0}catch(a){throw l.isActive&&l.cancel(),a}}catch(a){throw await FF({objectUrls:n,storageKey:s}),a}}({editor:e,input:await EF({type:"file",file:t},{signal:r}),objectUrls:n,shape:o,signal:r})}async function _F({editor:e,objectUrls:t,onError:n}){if(1!==e.selection.getIds().length)return;const[r]=e.state.selectedShapes.get();if(!V_(r)||!r.props.assetId)return;const o=e.assets.get(r.props.assetId);if(!U_(o))return;const i=o.props.name||"land-video";if("remote"===o.props.source.kind)return void(await async function({filename:e,onError:t,url:n}){try{const t=await fetch(n);if(!t.ok)throw new Error(`Could not download video URL (${t.status}).`);await NF({blob:await t.blob(),filename:e})}catch(r){t?.(new Error("Could not download remote video; opening URL instead.",{cause:r})),function(e){const t=document.createElement("a");t.href=e,t.rel="noreferrer",t.target="_blank",t.click()}(n)}}({filename:i,onError:n,url:o.props.source.url}));const s=o.props.source.storageKey,a=await bF(s);if(a)return void(await NF({blob:a,filename:i}));const l=t.resolve(s);l&&RF({filename:i,url:l})}async function FF({objectUrls:e,storageKey:t}){t&&(e.release(t),await wF(t))}function WF({editor:e,onError:t,tasks:n,videoAssetService:r}){let o;const i=HF(e=>o.insert({source:{type:"file",file:e}}),t),s=HF(e=>o.replaceSelection({file:e}),t);return o={openInsertFilePicker(){i.open()},openReplaceFilePicker(){s.open()},insert:({pagePoint:t,size:o,source:i})=>n.run(async n=>{n.throwIfAborted();const s=await jF({editor:e,objectUrls:r.objectUrls,pagePoint:t,signal:n,size:o,source:i});return n.throwIfAborted(),s}),replaceSelection:({file:t})=>n.run(async n=>{if(!t.type.startsWith("video/"))return!1;const[o]=e.state.selectedShapes.get();if(!V_(o)||o.isLocked)return!1;const i=await zF({editor:e,file:t,objectUrls:r.objectUrls,signal:n});return n.throwIfAborted(),i}),downloadSelectionOriginal:()=>n.run(async n=>{await _F({editor:e,objectUrls:r.objectUrls,onError:t}),n.throwIfAborted()})},{value:o,dispose(){i.dispose(),s.dispose()}}}function HF(e,t){let n=null,r=!1;return{open(){if(!r){if(!globalThis.document)throw new Error("Video file selection requires a browser document.");n??=function(){const n=document.createElement("input");return n.type="file",n.accept="video/*",n.hidden=!0,n.onchange=()=>{const o=n.files?.[0]??null;n.value="",o&&!r&&e(o).catch(e=>{t?.(new Error("Video file selection failed.",{cause:e}))})},n}(),n.click()}},dispose(){r=!0,n&&(n.onchange=null),n=null}}}function UF(){const e=IF();return{value:{objectUrls:e,async cleanupAfterRestore(t,{signal:n}){n.throwIfAborted(),await MF({editor:t,objectUrls:e}),n.throwIfAborted()},preloadForEditor:(t,{signal:n})=>e.preloadForEditor(t,{signal:n}),resolveAssetUrl:(t,n)=>e.resolveAssetUrl(t,n)},dispose(){e.releaseAll()}}}function VF(e={}){return{id:"video.host",requires:[uF],api:pF,setup({editor:t,tasks:n}){const r=(e.createAssetService??UF)();let o=null;try{const i=WF({editor:t,onError:e.onError,tasks:n,videoAssetService:r.value});return o=i.dispose,{api:i.value,imports:[{id:"video.host-import",order:100,acceptsPreview:e=>e.fileTypes.some(e=>e.startsWith("video/"))||e.dataTypes.some(e=>{const t=e.toLowerCase();return"files"===t||"text/uri-list"===t}),accepts:e=>null!==OF(e.files)||(e.urls?.some(KF)??!1),async import(e){const t=OF(e.files),n=e.urls?.find(KF);return(t||n)&&await i.value.insert({source:t?{type:"file",file:t}:{type:"url",url:n},pagePoint:e.pagePoint})?"handled":"ignored"}}],assetResolvers:[{id:"video.host.asset-resolver",resolve:e=>r.value.resolveAssetUrl(t,e),preload:({signal:e})=>r.value.preloadForEditor(t,{signal:e}),cleanupAfterRestore:({signal:e})=>r.value.cleanupAfterRestore(t,{signal:e})}],dispose(){o?.(),r.dispose()}}}catch(i){throw o?.(),r.dispose(),i}}}}function KF(e){return e.startsWith("data:video/")||/\.(?:m4v|mov|mp4|ogv|webm)(?:[?#].*)?$/i.test(e)}function qF({toolIds:t,shortcutOverrides:n}){return e([...t.map(YF),{id:"standard.history.undo",shortcut:{key:"z",accelKey:!0},isEnabled:e=>JF(e)&&e.history.state.getSnapshot().canUndo,run:e=>{e.history.undo()}},{id:"standard.history.redo",shortcut:{key:"z",accelKey:!0,shiftKey:!0},isEnabled:e=>JF(e)&&e.history.state.getSnapshot().canRedo,run:e=>{e.history.redo()}},{id:"standard.selection.select-all",shortcut:{key:"a",accelKey:!0},isEnabled:e=>e.pages.state.getSnapshot().currentPageShapeIds.length>0,run:e=>e.selection.selectAll()},{id:"standard.selection.duplicate",shortcut:{key:"d",accelKey:!0},isEnabled:e=>JF(e)&&GF(e),run:e=>{e.selection.duplicate()}},{id:"standard.selection.delete",shortcut:["Backspace","Delete"],isEnabled:e=>JF(e)&&GF(e),run:e=>e.selection.delete()},{id:"standard.layer.move-selection-backward",shortcut:{key:"ArrowDown",altKey:!0},isEnabled:e=>JF(e)&&ZF(e).canMoveBackward,run:e=>{e.layers.move(e.selection.state.getSnapshot().ids,"backward")}},{id:"standard.layer.move-selection-forward",shortcut:{key:"ArrowUp",altKey:!0},isEnabled:e=>JF(e)&&ZF(e).canMoveForward,run:e=>{e.layers.move(e.selection.state.getSnapshot().ids,"forward")}},{id:"standard.clipboard.copy",shortcut:{key:"c",accelKey:!0},isEnabled:GF,run:async e=>{await(e.api(h_)?.copy())}},{id:"standard.clipboard.cut",shortcut:{key:"x",accelKey:!0},isEnabled:e=>JF(e)&&GF(e),run:async e=>{await(e.api(h_)?.cut())}},{id:"standard.clipboard.paste",shortcut:{key:"v",accelKey:!0},isEnabled:e=>JF(e)&&(e.api(h_)?.hasContent()??!1),run:async e=>{await(e.api(h_)?.paste())}},{id:"standard.view.zoom-in",shortcut:{key:"="},isEnabled:()=>!0,run:e=>e.viewport.zoomIn()},{id:"standard.view.zoom-out",shortcut:{key:"-"},isEnabled:()=>!0,run:e=>e.viewport.zoomOut()},{id:"standard.view.reset-zoom",shortcut:{key:"0",accelKey:!0},isEnabled:()=>!0,run:e=>e.viewport.resetZoom()}],n)}function YF(e){return{id:`standard.tool.${e}`,shortcut:QF(e),isEnabled:t=>JF(t)||XF.has(e),run:t=>t.tools.setCurrent(e)}}var XF=new Set(["select","hand","laser"]);function JF(e){return!e.document.readonlyState.getSnapshot()}function GF(e){return e.selection.state.getSnapshot().ids.length>0}function ZF(e){return e.layers.getActionState(e.selection.state.getSnapshot().ids)}function QF(e){const t=eW[e];return t?{key:t}:void 0}var eW={select:"v",hand:"h",rectangle:"r",ellipse:"o",rhombus:"d",triangle:"3",pentagon:"5",hexagon:"6",star:"8",draw:"p",arrow:"a",eraser:"e",laser:"l",path:"b",text:"t",frame:"f"};function tW(e={}){const t=!1!==e.geo&&!1!==e.connector,n=t&&!1!==e.flow&&!1!==e.image&&!1!==e.text,r="object"==typeof e.connector?oc(e.connector):ic,o="object"==typeof e.flow?E$(e.flow):T$,i="object"==typeof e.text?{...ug(),...e.text}:ug(),s=hg(i),a=XL({...i,fontCatalog:s}),l=!1===e.image?null:am({onError:e.onError}),c=!1===e.video?null:VF({onError:e.onError}),d=["select","hand",...!1===e.geo?[]:Bi,...!1===e.draw?[]:["draw"],...!1===e.arrow?[]:["arrow"],...t?["connector"]:[],...!1===e.eraser?[]:["eraser"],...!1===e.laser?[]:["laser"],...!1===e.path?[]:["path"],...!1===e.text?[]:["text"],...!1===e.frame?[]:["frame"]];return{plugins:[...!1===e.geo?[]:[Fa],...!1===e.draw?[]:[Ud],...!1===e.arrow?[]:[ir],...t?[r]:[],...!1===e.eraser?[]:[Ju],...!1===e.laser?[]:[qD],...!1===e.path?[]:[p_],...!1===e.html?[]:[Q$],...l?[cf,l]:[],...c?[uF,c]:[],...!1===e.text?[]:[a,o$({fontCatalog:s})],...n?[o]:[],...!1===e.frame?[]:[vp],...!1===e.group?[]:[j$],x_,F_()],actions:qF({toolIds:d,shortcutOverrides:e.shortcutOverrides})}}export{je as ARROW_STROKE_STYLES,ir as Arrow,dt as ArrowBindingUtil,ls as ArrowLeftTool,cs as ArrowRightTool,zt as ArrowShapeSvgExporter,It as ArrowShapeUtil,Nt as ArrowTool,es as BurstTool,ho as CONNECTOR_ARROW_TERMINAL_PADDING,vr as CONNECTOR_CLICK_DRAG_THRESHOLD_SCREEN,di as CONNECTOR_CURVE_INSERT_HANDLE_TYPE,ci as CONNECTOR_CURVE_WAYPOINT_HANDLE_TYPE,Tr as CONNECTOR_DASH_ARRAY,wr as CONNECTOR_LINE_HIT_RADIUS_SCREEN,hr as CONNECTOR_ORTHOGONAL_OBSTACLE_CLEARANCE_PAGE,ui as CONNECTOR_ORTHOGONAL_SEGMENT_HANDLE_TYPE,Sr as CONNECTOR_ORTHOGONAL_SEGMENT_SNAP_SCREEN,pr as CONNECTOR_ORTHOGONAL_STUB_PAGE,kr as CONNECTOR_ORTHOGONAL_TERMINAL_SNAP_SCREEN,xr as CONNECTOR_PORT_HIT_RADIUS_SCREEN,gr as CONNECTOR_PORT_HOVER_GAP_SCREEN,yr as CONNECTOR_PORT_HOVER_ICON_SCREEN,mr as CONNECTOR_PORT_HOVER_RADIUS_SCREEN,br as CONNECTOR_PORT_VISUAL_OFFSET_SCREEN,fr as CONNECTOR_PORT_VISUAL_RADIUS_SCREEN,Mr as CONNECTOR_QUICK_CONNECT_CROSS_AXIS_PAGE,Pr as CONNECTOR_QUICK_CONNECT_DISTANCE_PAGE,Er as CONNECTOR_QUICK_CREATE_CROSS_GAP_PAGE,Ir as CONNECTOR_QUICK_CREATE_GAP_PAGE,ic as Connector,Sl as ConnectorBindingUtil,Gl as ConnectorShapeSvgExporter,Vl as ConnectorShapeUtil,Jl as ConnectorTool,X$ as DEFAULT_HTML_IFRAME_SANDBOX,ah as DEFAULT_IMAGE_SMUDGE_BRUSH_COLOR,sh as DEFAULT_IMAGE_SMUDGE_BRUSH_SIZE,cg as DEFAULT_TEXT_FONT,x_ as DefaultClipboardRuntimePlugin,Ud as Draw,zd as DrawShapeSvg,jd as DrawShapeSvgExporter,Dd as DrawShapeUtil,fd as DrawTool,Ji as EllipseTool,Ju as Eraser,cu as EraserTool,s$ as FLOW_NODE_GAP_PAGE,T$ as Flow,vp as Frame,up as FrameShapeSvgExporter,np as FrameShapeUtil,lp as FrameTool,Bi as GEO_SHAPE_KINDS,zi as GEO_STROKE_STYLES,Fa as Geo,Ra as GeoShapeSvgExporter,Oa as GeoShapeUtil,j$ as Group,A$ as GroupShapeSvgExporter,O$ as GroupShapeUtil,dg as HOST_TEXT_FONT,z$ as HTML_INTERACTION_OPERATION_KIND,is as HexagonTool,Q$ as Html,K$ as HtmlShapeUtil,Mp as IMAGE_CROP_ASPECT_RATIO_PRESETS,ch as IMAGE_SMUDGE_BRUSH_SIZE_MAX,lh as IMAGE_SMUDGE_BRUSH_SIZE_MIN,cf as Image,Lh as ImageShapeSvgExporter,Nh as ImageShapeUtil,qD as Laser,oD as LaserTool,Gi as MessageCircleTool,XD as PATH_CONTROL_HANDLE_TYPE,nj as PATH_FILL_RULES,YD as PATH_NODE_HANDLE_TYPE,rj as PATH_NODE_KINDS,p_ as Path,qz as PathShapeSvgExporter,Az as PathShapeUtil,Uz as PathTool,rs as PentagonTool,Xi as RectangleTool,ts as RhombusTool,ss as StarTool,Qi as SummaryLeftTool,Zi as SummaryTool,YR as TEXT_SIZE_PRESETS,JL as Text,WN as TextLinkPopoverPresenterProvider,UN as TextSearchHighlightProvider,as as TrapezoidTool,ns as TriangleTool,J_ as VIDEO_NAME_FALLBACK,G_ as VIDEO_NAME_RENDER_HEIGHT,uF as Video,X_ as VideoShapeUtil,ft as arrowApiToken,vh as cancelImageSmudgeSession,Sh as cancelImageSmudgeSessionIfActive,h_ as canvasClipboardApiToken,Xa as chooseFacingPort,Mf as cleanupUnreferencedImageBlobs,MF as cleanupUnreferencedVideoBlobs,Oh as cloneImageSmudgeStrokes,ki as commitConnectorCreation,kh as completeImageSmudgeSession,qf as confirmImageSmudgeSession,ec as connectorApiToken,pt as createArrow,tr as createArrowCanvasRenderPlugin,_t as createArrowEditorPlugin,Bt as createArrowInteractionHandler,jt as createArrowSelectionHandleInteractionHandler,fm as createCanvasShapeLinkHref,y_ as createClipboardRuntimePlugin,bi as createConnectorBoundEndpoint,al as createConnectorCanvasRenderPlugin,hi as createConnectorCurveInsertHandleId,pi as createConnectorCurveWaypointHandleId,Zl as createConnectorEditorPlugin,fi as createConnectorOrthogonalSegmentHandleId,oc as createConnectorPlugin,To as createConnectorTerminalOffsetMapper,F_ as createDefaultCanvasExportPlugin,Ga as createDefaultConnectorQuickCreateNodeFactory,pg as createDefaultTextFontCatalog,ug as createDefaultTextPluginOptions,Fd as createDrawCanvasRenderPlugin,Bd as createDrawEditorPlugin,fu as createEraserCanvasRenderPlugin,Xu as createEraserEditorPlugin,p$ as createFlowCanvasRenderPlugin,a$ as createFlowNodeFromPort,E$ as createFlowPlugin,gp as createFrameCanvasRenderPlugin,pp as createFrameEditorPlugin,$a as createGeoCanvasRenderPlugin,Na as createGeoEditorPlugin,N$ as createGroupCanvasRenderPlugin,R$ as createGroupEditorPlugin,J$ as createHtmlCanvasRenderPlugin,Y$ as createHtmlEditorPlugin,W$ as createHtmlInteractionHandler,Z$ as createHtmlPlugin,U$ as createHtmlPluginApi,qh as createImageCanvasRenderPlugin,th as createImageCropInteractionHandler,eh as createImageCropSelectionHandleInteractionHandler,Uh as createImageEditorPlugin,em as createImageHostApi,am as createImageHostPlugin,If as createImageObjectUrlStore,Dh as createImageSmudgeInteractionHandler,gf as createImageStorageKey,nm as createImageSvgAssetInliner,lD as createLaserCanvasRenderPlugin,KD as createLaserEditorPlugin,Ef as createLocalImageAssetService,UF as createLocalVideoAssetService,g_ as createMemoryCanvasClipboard,LB as createPathCanvasRenderPlugin,GD as createPathControlHandleId,Yz as createPathEditorPlugin,JD as createPathNodeHandleId,B_ as createPngExportFormatProvider,wm as createRichTextFromPlainText,qF as createStandardCanvasActions,tW as createStandardCanvasKitProfile,j_ as createSvgExportFormatProvider,YN as createTextCanvasRenderPlugin,UL as createTextEditorPlugin,hg as createTextFontCatalog,XL as createTextPlugin,o$ as createTextSvgExportPlugin,aF as createVideoCanvasRenderPlugin,eF as createVideoEditorPlugin,WF as createVideoHostApi,VF as createVideoHostPlugin,IF as createVideoObjectUrlStore,yF as createVideoStorageKey,TF as decodeVideoMetadata,wf as deleteImageBlob,wF as deleteVideoBlob,Ff as downloadSelectedImageOriginal,_F as downloadSelectedVideoOriginal,Sd as drawApiToken,D_ as exportCanvasPng,$_ as exportCanvasSvg,R_ as exportEditorPng,w_ as exportEditorSvg,Ya as findQuickConnectTargets,VN as findRichTextSearchMatches,CF as fitVideoSize,ud as flipDrawShapeInSelectionBounds,rp as frameApiToken,ds as geoApiToken,Mh as getActiveImageSmudgeSession,vf as getAllImageBlobStorageKeys,vF as getAllVideoBlobStorageKeys,de as getArrowBindingAnchorPagePoint,fe as getArrowTerminalPagePoint,qa as getBalancedConnectorBranchNodeInput,go as getConnectorArrowGlyphLength,mo as getConnectorArrowLength,fo as getConnectorArrowMagnification,vi as getConnectorCreationInvalidReason,No as getConnectorInfo,xo as getConnectorMarkerPath,yo as getConnectorMarkerRefX,Ni as getConnectorParentId,ol as getConnectorPortInteractionState,bo as getConnectorSegmentPoint,Wa as getConnectorVisualPortPoint,hd as getDrawShapeDiagnostics,ld as getDrawShapeParentPoints,cd as getDrawShapeParentSegments,Zd as getEraserRuntime,Nf as getFirstImageFile,OF as getFirstVideoFile,q$ as getHtmlDisplayTitle,Wp as getImageCropModeOperationKind,Lp as getImageCropRectOrDefault,yh as getImageSmudgeModeOperationKind,tD as getLaserRuntime,kf as getLocalImageAssetStorageKey,kF as getLocalVideoAssetStorageKey,Ua as getNearestConnectorPortAtPoint,vm as getPlainTextFromRichText,Pf as getReferencedImageStorageKeys,PF as getReferencedVideoStorageKeys,Sf as getRemoteImageAssetUrl,SF as getRemoteVideoAssetUrl,Ro as getResolvedConnectorLocalInfo,Co as getResolvedConnectorPageInfo,Z_ as getVideoDisplayName,Q_ as getVideoRenderBounds,il as getVisibleConnectorSourcePortAtPoint,Ai as hasDirectedConnector,H$ as htmlApiToken,nf as imageApiToken,df as imageHostApiToken,Bf as insertImageIntoEditor,BF as insertPreparedVideoIntoEditor,jF as insertVideoIntoEditor,Xd as interpolateDrawShapeRecords,pm as isAllowedRichTextLinkHref,_e as isArrowBindingRecord,ze as isArrowShapeRecord,Be as isArrowStrokeStyle,Or as isConnectorBindingRecord,Cr as isConnectorShapeRecord,kd as isDrawShapeRecord,hm as isExternalRichTextLinkHref,Fi as isGeoShapeKind,_i as isGeoShapeRecord,Wi as isGeoStrokeStyle,B$ as isHtmlShapeRecord,Jp as isImageAssetRecord,Gp as isImageShapeRecord,xh as isImageSmudgeModeForShape,ij as isPathFillRule,sj as isPathNodeKind,oj as isPathShapeRecord,Hm as isTextShapeRecord,U_ as isVideoAssetRecord,AF as isVideoBlob,V_ as isVideoShapeRecord,um as normalizeRichTextLinkHref,i$ as openBrowserRichTextLink,gm as openRichTextLink,mm as parseCanvasShapeLinkHref,mi as parseConnectorIndexedHandleId,gi as parseConnectorOrthogonalSegmentHandleId,ZD as parsePathHandle,r_ as pathApiToken,EF as prepareVideoAssetInput,Va as quickConnectFromPort,b_ as readBlobAsDataUrl,xf as readImageBlob,bf as readImageBlobAsDataUrl,bF as readVideoBlob,Eh as redoImageSmudgeStroke,Th as registerImageSmudgeConfirmHandler,_f as replaceSelectedImageFromFile,zF as replaceSelectedVideoFromFile,Ch as requestImageSmudgeConfirm,ue as resolveArrowBindingPagePoint,Tt as resolveArrowTerminalBindingAtPoint,Ct as resolveArrowTerminalBindingAtStartPoint,Ot as resolveArrowTerminalBindingForArrow,wi as resolveConnectorDraftEndpoint,Li as resolveConnectorDraftParentId,Pi as setConnectorTerminalPagePoint,wh as startImageSmudgeSession,F$ as startInteractingWithHtmlShape,VL as textApiToken,Ih as undoImageSmudgeStroke,Ph as updateImageSmudgeBrush,qm as updateTextShapeRichText,km as validateRichTextDocument,K_ as videoApiToken,pF as videoHostApiToken,yf as writeImageBlob,xF as writeVideoBlob};