efficient-easel 20.2.1 → 21.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 (266) hide show
  1. package/README.md +30 -9
  2. package/dist/{CanvasDragLayer-ARfaivCu.d.ts → CanvasDragLayer-CFUcBbgc.d.ts} +2 -2
  3. package/dist/{ScreenDocumentContext-CFJeqqKk.d.ts → ScreenDocumentContext-1RgtGKWR.d.ts} +4 -0
  4. package/dist/blocks/index.d.ts +5 -3
  5. package/dist/{buckets-Tj-nkBpg.d.ts → buckets-Sw94ll9I.d.ts} +1 -1
  6. package/dist/canvas/index.d.ts +8 -6
  7. package/dist/canvas/index.js +1 -1
  8. package/dist/chunk-2C7W64S5.js +8 -0
  9. package/dist/chunk-2L6KWUBC.js +1 -0
  10. package/dist/chunk-467WWV4I.js +1 -0
  11. package/dist/chunk-4FD7TAOE.js +1 -0
  12. package/dist/chunk-67HCYOW4.js +1 -0
  13. package/dist/chunk-A2VVB4RH.js +0 -0
  14. package/dist/{chunk-2GVCAIPX.js → chunk-BDSLF5BR.js} +1 -1
  15. package/dist/{chunk-U66YKDAR.js → chunk-BIK3AO2V.js} +1 -1
  16. package/dist/chunk-BTDI7JAA.js +2 -0
  17. package/dist/chunk-DDH2DYQP.js +1 -0
  18. package/dist/{chunk-I7BROL77.js → chunk-DNQ7AF6K.js} +1 -1
  19. package/dist/{chunk-HK6I3NVO.js → chunk-E52W3M5I.js} +1 -1
  20. package/dist/chunk-EB6NI2VK.js +1 -0
  21. package/dist/chunk-FM6JO4WF.js +2 -0
  22. package/dist/{chunk-JQXD3TDE.js → chunk-GWYNMSIP.js} +1 -1
  23. package/dist/{chunk-7YVEYQDE.js → chunk-I67UW5UG.js} +3 -3
  24. package/dist/chunk-JACEEVVF.js +1 -0
  25. package/dist/{chunk-QAJAEWCZ.js → chunk-KFWNGPW3.js} +5 -5
  26. package/dist/{chunk-FGYJ5DJY.js → chunk-KWLHKKZO.js} +1 -1
  27. package/dist/chunk-MLQKNED6.js +1 -0
  28. package/dist/chunk-MZ5GSSZ3.js +7 -0
  29. package/dist/{chunk-43AEUUNQ.js → chunk-N3MJOHAG.js} +1 -1
  30. package/dist/{chunk-BVN33R76.js → chunk-N7E6264U.js} +1 -1
  31. package/dist/chunk-OHZHYROJ.js +5 -0
  32. package/dist/chunk-PFFH7ASD.js +21 -0
  33. package/dist/chunk-PRHBWA5V.js +0 -0
  34. package/dist/chunk-S3DUFDQ6.js +6 -0
  35. package/dist/chunk-SNF5764Q.js +1 -0
  36. package/dist/chunk-SSRYU3YG.js +1 -0
  37. package/dist/chunk-SWBADIQT.js +1 -0
  38. package/dist/{chunk-GOTN2KY4.js → chunk-TIAWIOGD.js} +1 -1
  39. package/dist/chunk-TQ5Y6S2X.js +1 -0
  40. package/dist/chunk-TUXLORVR.js +15 -0
  41. package/dist/{chunk-FGNR22NY.js → chunk-U5DNBT63.js} +1 -1
  42. package/dist/chunk-U7TFWHST.js +5 -0
  43. package/dist/chunk-WHS6Y55E.js +10 -0
  44. package/dist/chunk-WJJ7H42G.js +18 -0
  45. package/dist/{chunk-ZOBSIXRD.js → chunk-Y2T3JX7K.js} +1 -1
  46. package/dist/chunk-YIUE4US7.js +0 -0
  47. package/dist/{chunk-O7Q4DDJT.js → chunk-YM4UEGBV.js} +1 -1
  48. package/dist/chunk-YVFYWAYU.js +65 -0
  49. package/dist/{chunk-UJ46J7QW.js → chunk-ZOSEBPAI.js} +1 -1
  50. package/dist/copy/index.d.ts +2 -2
  51. package/dist/copy/index.js +13 -13
  52. package/dist/drag/drag.css +3 -9
  53. package/dist/drag/index.d.ts +3 -3
  54. package/dist/drag/index.js +1 -1
  55. package/dist/draw/client.d.ts +1 -1
  56. package/dist/draw/client.js +1 -1
  57. package/dist/draw/index.d.ts +9 -9
  58. package/dist/draw/index.js +1 -1
  59. package/dist/easel/easel.css +3 -1
  60. package/dist/easel/index.d.ts +2 -2
  61. package/dist/easel/index.js +1 -1
  62. package/dist/fields/fields.css +2 -2
  63. package/dist/fields/index.d.ts +5 -5
  64. package/dist/fields/index.js +1 -1
  65. package/dist/panel/index.d.ts +39 -140
  66. package/dist/panel/index.js +15 -15
  67. package/dist/panel/panel.css +53 -347
  68. package/dist/render/index.d.ts +2 -2
  69. package/dist/render/index.js +5 -5
  70. package/dist/{repeat-Czi-6zPX.d.ts → repeat-BNgSq2Nw.d.ts} +1 -1
  71. package/dist/screen/components/AddBlockRow.d.ts +1 -1
  72. package/dist/screen/components/AddBlockRow.js +1 -1
  73. package/dist/screen/components/AddSidePanel.d.ts +2 -2
  74. package/dist/screen/components/AddSidePanel.js +1 -1
  75. package/dist/screen/components/NodeContextMenu.d.ts +15 -15
  76. package/dist/screen/components/NodeContextMenu.js +1 -1
  77. package/dist/screen/components/PageEditGuardNotices.js +1 -1
  78. package/dist/screen/components/PreviewPartsContext.d.ts +2 -2
  79. package/dist/screen/components/PreviewPartsContext.js +1 -1
  80. package/dist/screen/components/SaveControls.d.ts +9 -9
  81. package/dist/screen/components/ScreenChrome.js +1 -1
  82. package/dist/screen/components/ScreenDocumentContext.d.ts +2 -2
  83. package/dist/screen/components/ScreenDocumentContext.js +1 -1
  84. package/dist/screen/components/ScreenMount.d.ts +9 -9
  85. package/dist/screen/components/ScreenMount.js +1 -1
  86. package/dist/screen/components/ScreenStoreProvider.d.ts +9 -9
  87. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  88. package/dist/screen/components/SectionScreenShell.js +17 -17
  89. package/dist/screen/components/SlotChildActionsContext.d.ts +1 -1
  90. package/dist/screen/components/usePartBridge.d.ts +9 -9
  91. package/dist/screen/components/usePartBridge.js +1 -1
  92. package/dist/screen/index.d.ts +10 -10
  93. package/dist/screen/index.js +1 -1
  94. package/dist/screen/lib/admin-bridge.d.ts +1 -1
  95. package/dist/screen/lib/admin-bridge.js +1 -1
  96. package/dist/screen/lib/content/view-tiers.d.ts +15 -3
  97. package/dist/screen/lib/content/view-tiers.js +1 -1
  98. package/dist/screen/lib/document/add-target-types.d.ts +55 -0
  99. package/dist/screen/lib/document/add-target-types.js +1 -0
  100. package/dist/screen/lib/document/block-choice.d.ts +64 -0
  101. package/dist/screen/lib/document/block-choice.js +1 -0
  102. package/dist/screen/lib/document/block-types-in.d.ts +39 -0
  103. package/dist/screen/lib/document/block-types-in.js +1 -0
  104. package/dist/screen/lib/document/content-tree.d.ts +222 -0
  105. package/dist/screen/lib/document/content-tree.js +1 -0
  106. package/dist/screen/lib/document/device-fields.d.ts +128 -0
  107. package/dist/screen/lib/document/device-fields.js +1 -0
  108. package/dist/screen/lib/document/field-buckets.d.ts +36 -0
  109. package/dist/screen/lib/document/field-buckets.js +1 -0
  110. package/dist/screen/lib/document/field-markers.d.ts +205 -0
  111. package/dist/screen/lib/document/field-markers.js +1 -0
  112. package/dist/screen/lib/document/hidable.d.ts +44 -0
  113. package/dist/screen/lib/document/hidable.js +1 -0
  114. package/dist/screen/lib/document/palette-sections.d.ts +103 -0
  115. package/dist/screen/lib/document/palette-sections.js +1 -0
  116. package/dist/screen/lib/document/panel-fields.d.ts +47 -0
  117. package/dist/screen/lib/document/panel-fields.js +1 -0
  118. package/dist/screen/lib/document/panel-no-control-mark.d.ts +74 -0
  119. package/dist/screen/lib/document/panel-no-control-mark.js +1 -0
  120. package/dist/screen/lib/document/part-id.d.ts +23 -0
  121. package/dist/screen/lib/document/part-id.js +1 -0
  122. package/dist/screen/lib/document/preview-click.d.ts +49 -0
  123. package/dist/screen/lib/document/preview-click.js +1 -0
  124. package/dist/screen/lib/document/preview-dom.d.ts +8 -0
  125. package/dist/screen/lib/document/preview-dom.js +1 -0
  126. package/dist/screen/lib/document/preview-events.d.ts +25 -0
  127. package/dist/screen/lib/document/preview-events.js +1 -0
  128. package/dist/screen/lib/document/preview-selection-context.d.ts +72 -0
  129. package/dist/screen/lib/document/preview-selection-context.js +1 -0
  130. package/dist/screen/lib/document/section-doc.d.ts +24 -0
  131. package/dist/screen/lib/document/section-doc.js +1 -0
  132. package/dist/screen/lib/document/slot-child-name.d.ts +225 -0
  133. package/dist/screen/lib/document/slot-child-name.js +1 -0
  134. package/dist/screen/lib/document/slot-heal.d.ts +5 -0
  135. package/dist/screen/lib/document/slot-heal.js +1 -0
  136. package/dist/screen/lib/document/slot-section-spec.d.ts +96 -0
  137. package/dist/screen/lib/document/slot-section-spec.js +1 -0
  138. package/dist/screen/lib/document/style-clipboard.d.ts +144 -0
  139. package/dist/screen/lib/document/style-clipboard.js +1 -0
  140. package/dist/screen/lib/document/text-control-kinds.d.ts +71 -0
  141. package/dist/screen/lib/document/text-control-kinds.js +1 -0
  142. package/dist/screen/lib/document/tree-reveal.d.ts +62 -0
  143. package/dist/screen/lib/document/tree-reveal.js +1 -0
  144. package/dist/screen/lib/document/use-section-ops.d.ts +110 -0
  145. package/dist/screen/lib/document/use-section-ops.js +1 -0
  146. package/dist/screen/lib/document-addressing.d.ts +2 -2
  147. package/dist/screen/lib/document-switch.d.ts +1 -1
  148. package/dist/screen/lib/host.d.ts +2 -2
  149. package/dist/screen/lib/key-scope.d.ts +1 -1
  150. package/dist/screen/lib/key-scope.js +1 -1
  151. package/dist/screen/lib/media-panel.d.ts +2 -2
  152. package/dist/screen/lib/media-picker.d.ts +2 -2
  153. package/dist/screen/lib/page-lock.d.ts +1 -1
  154. package/dist/screen/lib/puck/add-target-types.d.ts +3 -55
  155. package/dist/screen/lib/puck/add-target-types.js +1 -0
  156. package/dist/screen/lib/puck/block-choice.d.ts +1 -64
  157. package/dist/screen/lib/puck/block-choice.js +1 -1
  158. package/dist/screen/lib/puck/block-types-in.d.ts +1 -39
  159. package/dist/screen/lib/puck/block-types-in.js +1 -1
  160. package/dist/screen/lib/puck/content-tree.d.ts +1 -222
  161. package/dist/screen/lib/puck/content-tree.js +1 -1
  162. package/dist/screen/lib/puck/device-fields.d.ts +3 -127
  163. package/dist/screen/lib/puck/device-fields.js +1 -1
  164. package/dist/screen/lib/puck/field-buckets.d.ts +2 -36
  165. package/dist/screen/lib/puck/field-buckets.js +1 -1
  166. package/dist/screen/lib/puck/field-markers.d.ts +2 -205
  167. package/dist/screen/lib/puck/field-markers.js +1 -1
  168. package/dist/screen/lib/puck/hidable.d.ts +1 -44
  169. package/dist/screen/lib/puck/hidable.js +1 -1
  170. package/dist/screen/lib/puck/palette-sections.d.ts +2 -97
  171. package/dist/screen/lib/puck/palette-sections.js +1 -1
  172. package/dist/screen/lib/puck/panel-fields.d.ts +1 -47
  173. package/dist/screen/lib/puck/panel-fields.js +1 -1
  174. package/dist/screen/lib/puck/panel-no-control-mark.d.ts +2 -74
  175. package/dist/screen/lib/puck/panel-no-control-mark.js +1 -1
  176. package/dist/screen/lib/puck/part-id.d.ts +1 -23
  177. package/dist/screen/lib/puck/part-id.js +1 -1
  178. package/dist/screen/lib/puck/preview-click.d.ts +1 -49
  179. package/dist/screen/lib/puck/preview-click.js +1 -1
  180. package/dist/screen/lib/puck/preview-dom.d.ts +1 -8
  181. package/dist/screen/lib/puck/preview-dom.js +1 -1
  182. package/dist/screen/lib/puck/preview-events.d.ts +1 -25
  183. package/dist/screen/lib/puck/preview-events.js +1 -1
  184. package/dist/screen/lib/puck/preview-selection-context.d.ts +2 -72
  185. package/dist/screen/lib/puck/preview-selection-context.js +1 -1
  186. package/dist/screen/lib/puck/section-doc.d.ts +3 -18
  187. package/dist/screen/lib/puck/section-doc.js +1 -1
  188. package/dist/screen/lib/puck/slot-child-name.d.ts +1 -225
  189. package/dist/screen/lib/puck/slot-child-name.js +1 -1
  190. package/dist/screen/lib/puck/slot-heal.d.ts +2 -5
  191. package/dist/screen/lib/puck/slot-heal.js +1 -1
  192. package/dist/screen/lib/puck/slot-section-spec.d.ts +1 -96
  193. package/dist/screen/lib/puck/slot-section-spec.js +1 -0
  194. package/dist/screen/lib/puck/style-clipboard.d.ts +14 -116
  195. package/dist/screen/lib/puck/style-clipboard.js +1 -1
  196. package/dist/screen/lib/puck/text-control-kinds.d.ts +1 -71
  197. package/dist/screen/lib/puck/text-control-kinds.js +1 -1
  198. package/dist/screen/lib/puck/tree-reveal.d.ts +1 -62
  199. package/dist/screen/lib/puck/tree-reveal.js +1 -1
  200. package/dist/screen/lib/puck/use-section-ops.d.ts +4 -105
  201. package/dist/screen/lib/puck/use-section-ops.js +1 -1
  202. package/dist/screen/lib/screen-parts.d.ts +27 -20
  203. package/dist/screen/lib/screen-parts.js +1 -1
  204. package/dist/screen/lib/section-template-types.d.ts +1 -1
  205. package/dist/screen/lib/section-templates.d.ts +1 -1
  206. package/dist/screen/lib/section-templates.js +1 -1
  207. package/dist/screen/lib/session-context.d.ts +1 -1
  208. package/dist/screen/lib/session-context.js +1 -1
  209. package/dist/screen/lib/session.d.ts +3 -3
  210. package/dist/screen/lib/session.js +1 -1
  211. package/dist/screen/lib/shared-section-types.d.ts +1 -1
  212. package/dist/screen/lib/shared-sections.d.ts +1 -1
  213. package/dist/screen/lib/shared-sections.js +1 -1
  214. package/dist/screen/screen.css +5 -9
  215. package/dist/screen/words.d.ts +4 -0
  216. package/dist/screen/words.js +1 -1
  217. package/dist/strings/index.d.ts +4 -4
  218. package/dist/strings/index.js +2 -2
  219. package/dist/text-styles/index.js +33 -33
  220. package/dist/tree/index.d.ts +5 -5
  221. package/dist/tree/index.js +1 -1
  222. package/dist/{types-CDX6vd6A.d.ts → types-B8NwXKlE.d.ts} +1 -1
  223. package/dist/{types-Bqq6ya0y.d.ts → types-DBy3L69b.d.ts} +11 -4
  224. package/dist/{watch-BTYOJpQU.d.ts → watch-D8xZow3y.d.ts} +2 -2
  225. package/dist/{words-vhnV8sM7.d.ts → words-CFkb8XtN.d.ts} +5 -0
  226. package/dist/{words-BeX5eGq7.d.ts → words-CmEnDoOe.d.ts} +1 -1
  227. package/dist/{words-CvwYvkJm.d.ts → words-SD4neL0n.d.ts} +6 -0
  228. package/package.json +156 -12
  229. package/dist/chunk-23DYNW6S.js +0 -1
  230. package/dist/chunk-23VM4PMV.js +0 -7
  231. package/dist/chunk-276MBG5P.js +0 -2
  232. package/dist/chunk-6FWAE2RN.js +0 -1
  233. package/dist/chunk-7LYKFL3Q.js +0 -21
  234. package/dist/chunk-A6Z4SD3I.js +0 -10
  235. package/dist/chunk-BHRC3ASL.js +0 -1
  236. package/dist/chunk-EFHV56BO.js +0 -15
  237. package/dist/chunk-I54UCYOU.js +0 -1
  238. package/dist/chunk-JBOSEHIX.js +0 -1
  239. package/dist/chunk-KAML3KQH.js +0 -1
  240. package/dist/chunk-L2Y3PF2R.js +0 -4
  241. package/dist/chunk-LQV5FZTQ.js +0 -18
  242. package/dist/chunk-MEHLY5Q4.js +0 -1
  243. package/dist/chunk-PAOZMXEI.js +0 -5
  244. package/dist/chunk-QIDRJH3S.js +0 -1
  245. package/dist/chunk-R5KEFI55.js +0 -8
  246. package/dist/chunk-RC25EGHD.js +0 -5
  247. package/dist/chunk-RSCMJIWS.js +0 -1
  248. package/dist/chunk-TNGOL65V.js +0 -1
  249. package/dist/chunk-VANKQVOW.js +0 -8
  250. package/dist/chunk-WEIE2FBC.js +0 -1
  251. package/dist/chunk-WRFD4EXD.js +0 -1
  252. package/dist/chunk-XJ2WXGFJ.js +0 -65
  253. /package/dist/{chunk-MQNBD6AB.js → chunk-3QB2ZQXK.js} +0 -0
  254. /package/dist/{chunk-LER7RKTO.js → chunk-5XL2RXFU.js} +0 -0
  255. /package/dist/{chunk-6W7WLPZH.js → chunk-6UAEFOJ4.js} +0 -0
  256. /package/dist/{chunk-26OOWIJJ.js → chunk-7OCEPOEJ.js} +0 -0
  257. /package/dist/{chunk-IQ5TA7AM.js → chunk-AJ2SUSET.js} +0 -0
  258. /package/dist/{chunk-DUVRZ456.js → chunk-ANPOR6EY.js} +0 -0
  259. /package/dist/{chunk-5ZBY24K7.js → chunk-CPL43ZLJ.js} +0 -0
  260. /package/dist/{chunk-PIND6KE7.js → chunk-I6SK6ZDT.js} +0 -0
  261. /package/dist/{chunk-7F52SZOI.js → chunk-INRERJU4.js} +0 -0
  262. /package/dist/{chunk-R5L2E7JX.js → chunk-MGVI67QV.js} +0 -0
  263. /package/dist/{chunk-IYT6NN2J.js → chunk-R4AUZVA3.js} +0 -0
  264. /package/dist/{chunk-M2Z775ZC.js → chunk-RUQOIQWI.js} +0 -0
  265. /package/dist/{chunk-PLVEGYK6.js → chunk-TCAAOYQY.js} +0 -0
  266. /package/dist/{chunk-PA3PNTVV.js → chunk-VKPOH6MK.js} +0 -0
@@ -1,15 +0,0 @@
1
- import{DEFAULT_CANVAS_WORDS as e}from"./chunk-TBY3DFKS.js";import{useResolvedFields as t}from"./chunk-IWCKVZHS.js";import{toItemSelector as n,fromItemSelector as o,useNodeOps as r,parentStep as i,clickPickPart as l,clickPick as s}from"./chunk-BSHIQIZC.js";import{selectionBox as a,placeWindow as c,offsetOrigin as d,colorRunOf as u,ColorWindow as p,startCanvasTyping as f,textMap as h}from"./chunk-23VM4PMV.js";import{DEFAULT_COPY_WORDS as m}from"./chunk-KRL3IUV3.js";import{useWords as g}from"./chunk-MFIRYGHW.js";import{find as v,ROOT_ID as y,getList as w,remove as b,parseZoneKey as k,move as S,duplicate as C,replaceNode as I,createNode as D,insert as E,normalizeData as x,createResolveCache as O,resolveNodeData as A,ROOT_SLOT as M}from"./chunk-K7BTCBWD.js";import{topLevelSlotKeys as z,fieldsFrom as R,drawnBlockCount as V,defaultsFrom as B}from"./chunk-L55YIXDC.js";import{setCanvasNonce as L,CANVAS_TYPABLE_EVENT as P,isTypingTarget as $,frameRectToHost as j,CANVAS_TYPING_EVENT as N,drawnBox as K}from"./chunk-QIDRJH3S.js";import{queryAllCopies as Z}from"./chunk-LF3FUSCQ.js";import{createContext as F,useEffect as H,useContext as T,useRef as W,useSyncExternalStore as Y,useState as q,useMemo as U,useCallback as Q,useLayoutEffect as X}from"react";import{jsx as G,jsxs as J,Fragment as _}from"react/jsx-runtime";import{createPortal as ee}from"react-dom";import{registerModalEscapeInterceptor as te,FloatingBar as ne,TextToolbar as oe,LinkPicker as re}from"efficient-shell/ui";function ie(e){return!["setData","setUi","set"].includes(e.type)}var le=(e,t,n,o)=>{const r=w(e,t,k(n));return r?.[o]??null},se=(e,t,n,o,r)=>{const i=le(e,t,n,o);if(!i)throw new Error(`${r}: nothing at ${n}[${o}]`);return i};function ae(e,t){const{selection:o}=e;return{...e.ui,itemSelector:n(e.data,t,o),selectedSlot:o&&"slot"===o.kind?{parentId:o.parentId,slot:o.slot}:null}}function ce(e,t,n){return n?"node"===n.kind?v(e,t,n.id)?n:null:n.parentId===y?w(e,t,n)?n:null:v(e,t,n.parentId)&&w(e,t,n)?n:null:null}function de(e,t,n,r=!1){const{itemSelector:i,selectedSlot:l,...s}=n;let a=e.selection;var c;return"itemSelector"in n&&(a=o(e.data,t,i??null)),"selectedSlot"in n&&(l?a=(c=l)?{kind:"slot",parentId:c.parentId,slot:c.slot}:null:"slot"===a?.kind&&(a=null)),{...e,selection:a,ui:r?s:{...e.ui,...s}}}function ue(e,t,n){const o=pe(e,t,n);if(o===e)return e;const r=ce(o.data,n,o.selection);return r===o.selection?o:{...o,selection:r}}function pe(e,t,n){const{data:o}=e;switch(t.type){case"setData":{const n="function"==typeof t.data?t.data(o):t.data;return{...e,data:{...o,...n}}}case"setUi":return de(e,n,"function"==typeof t.ui?t.ui(ae(e,n)):t.ui);case"set":{const r={data:o,ui:ae(e,n)},i="function"==typeof t.state?t.state(r):t.state;let l=i.data?{...e,data:i.data}:e;return i.ui&&(l=de(l,n,i.ui,!0)),l}case"insert":{const r={...k(t.destinationZone),index:t.destinationIndex},i=D(n,t.componentType,{},t.id?{id:t.id}:{});return{...e,data:E(o,n,r,i)}}case"replace":{const r=se(o,n,t.destinationZone,t.destinationIndex,"replace");if(r.props.id!==t.data.props.id)throw new Error("Can't change the id during a replace action. Use remove and insert for a new node.");return{...e,data:I(o,n,r.props.id,t.data)}}case"replaceRoot":{const n={...o.root,props:{...o.root.props,...t.root.props},readOnly:t.root.readOnly};return{...e,data:{...o,root:n}}}case"duplicate":{const r=se(o,n,t.sourceZone,t.sourceIndex,"duplicate"),i=C(o,n,r.props.id),l=le(i,n,t.sourceZone,t.sourceIndex+1);return{...e,data:i,selection:l?{kind:"node",id:l.props.id}:e.selection}}case"reorder":return pe(e,{...t,type:"move",sourceZone:t.destinationZone},n);case"move":{if(t.sourceZone===t.destinationZone&&t.sourceIndex===t.destinationIndex)return e;const r=le(o,n,t.sourceZone,t.sourceIndex);if(!r)return e;const i={...k(t.destinationZone),index:t.destinationIndex};return{...e,data:S(o,n,r.props.id,i)}}case"remove":{const r=se(o,n,t.zone,t.index,"remove");return{...e,data:b(o,n,r.props.id)}}default:return e}}var fe={drag:!0,duplicate:!0,delete:!0,edit:!0,insert:!0},he={leftSideBarVisible:!0,rightSideBarVisible:!0,arrayState:{},componentList:{},isDragging:!1,previewMode:"edit",viewports:{current:{width:360,height:"auto"},options:[],controlsVisible:!0},field:{focus:null}},me=0,ge=()=>`history-${me+=1}`;function ve(e){let t=e.config;const r=e.now??(()=>Date.now()),i=e.historyCoalesceMs??250;let l=e.permissions??{};const s=x(e.data,t);let a=s,c={data:s,selection:null,ui:{...he}};if(e.ui){const{itemSelector:n,selectedSlot:r,...i}=e.ui;c={data:s,selection:r?{kind:"slot",...r}:o(s,t,n??null),ui:{...he,...i}}}let d=[{core:c,at:-1/0,sealed:!0,id:ge()}],u=0;const p=e=>{const t=d[u],n=r();!e&&u===d.length-1&&u>0&&!t.sealed&&n-t.at<i?d=[...d.slice(0,u),{...t,core:c,at:n}]:(d=[...d.slice(0,u+1),{core:c,at:n,sealed:e,id:ge()}],u=d.length-1)},f=/* @__PURE__ */new Set;let h=null,m=null,g=0,y=null,b=!1;const k=()=>{for(const e of[...f])e()},S=()=>{d=[...d.slice(0,u),{...d[u],core:c},...d.slice(u+1)]},C=(t,n)=>{g>0?b=b||n:(n?p(!1):c!==t&&S(),c.data!==t.data&&e.onChange?.(c.data),c!==t&&k())},D=e=>{const n=c;if(c=ue(c,e,t),c===n)return;const o=e.recordHistory??ie(e);C(n,o&&c.data!==n.data)},E=t=>{0===g&&(y=c,b=!1),g+=1;try{t()}catch(e){throw g-=1,0===g&&y&&(c=y,y=null),e}if(g-=1,g>0||!y)return;const n=y;y=null,b&&c.data!==n.data?p(!0):c!==n&&S(),c.data!==n.data&&e.onChange?.(c.data),c!==n&&k()},M=e=>{const n=c,o=ce(c.data,t,e);var r,i;(r=o,i=c.selection,r===i||r&&i&&r.kind===i.kind&&("node"===r.kind&&"node"===i.kind?r.id===i.id:"slot"===r.kind&&"slot"===i.kind&&r.parentId===i.parentId&&r.slot===i.slot))||(c={...c,selection:o},C(n,!1))},z=t=>{const n=c;u=t,c=d[u].core,c.data!==n.data&&e.onChange?.(c.data),c!==n&&k()},R=()=>(e={})=>{const n=e.root?t.root?.permissions:t.components[e.item?.type??e.type??""]?.permissions;return{...fe,...l,...n}};let V=R();const B=O(),L={resolveCache:B,async resolveAll({trigger:e="load",metadata:n}={}){const o=c.data,r={type:"root",props:{...o.root.props??{}}},i=[...o.content,...Object.values(o.zones??{}).flat()],[l,...s]=await Promise.all([A(r,t,{cache:B,trigger:e,metadata:n}),...i.map(o=>A(o,t,{cache:B,trigger:e,metadata:n}))]);E(()=>{const n=c;let r=c.data;s.forEach((e,n)=>{if(!e.didChange)return;const l=i[n].props.id,s=v(r,t,l)?.node;s&&s===v(o,t,l)?.node&&(r=I(r,t,l,e.node))}),l.didChange&&r.root===o.root&&(r={...r,root:{...r.root,props:l.node.props,readOnly:l.node.readOnly??r.root.readOnly}}),r!==c.data&&("load"===e&&c.data===a&&(a=r),c={...c,data:r,selection:ce(r,t,c.selection)},C(n,!1))})},async resolveNode(e,{trigger:n="replace",metadata:o}={}){const r=v(c.data,t,e)?.node;if(!r)return!1;const i=await A(r,t,{cache:B,trigger:n,metadata:o});if(!i.didChange)return!1;let l=!1;return E(()=>{const n=c;if(v(c.data,t,e)?.node!==r)return;const o=I(c.data,t,e,i.node);o!==c.data&&(c={...c,data:o,selection:ce(o,t,c.selection)},C(n,!1),l=!0)}),l},get config(){return t},get loaded(){return a},getState(){if(h&&m===c)return h;const e=c,o={data:e.data,ui:ae(e,t)},r="node"===e.selection?.kind?v(e.data,t,e.selection.id)?.node??null:null;return h={appState:o,selection:e.selection,selectedItem:r,config:t,dispatch:D,history:{back:()=>L.undo(),forward:()=>L.redo(),hasPast:u>0,hasFuture:u<d.length-1,histories:d.map(e=>({id:e.id,state:{data:e.core.data,ui:ae(e.core,t)}})),index:u,setHistoryIndex:e=>{e>=0&&e<d.length&&e!==u&&z(e)}},getPermissions:V,getItemById:n=>v(e.data,t,n)?.node,getItemBySelector:n=>function(e,t,n){const[o,r]=(n.zone??"root:default-zone").split(/:(.*)/s);return w(e,t,{parentId:o,slot:r})?.[n.index]}(e.data,t,n),getSelectorForId:o=>{const r=n(e.data,t,{kind:"node",id:o});return r?{index:r.index,zone:r.zone??"root:default-zone"}:void 0}},m=e,h},subscribe:e=>(f.add(e),()=>{f.delete(e)}),dispatch:D,batch:E,group:()=>{const e=u,t=d[e].id;let n=!0;return{close:()=>{if(!n)return;if(n=!1,d[e]?.id!==t)return;if(u<=e+1)return void(u===e+1&&(d=[...d.slice(0,u),{...d[u],sealed:!0},...d.slice(u+1)]));const o=d[u];d=[...d.slice(0,e+1),{...o,sealed:!0},...d.slice(u+1)],u=e+1}}},select:e=>M(e?{kind:"node",id:e}:null),selectSlot:e=>M(e?{kind:"slot",parentId:e.parentId,slot:e.slot}:null),run(e){E(()=>{const n=c,o=void 0===e.select?c.selection:e.select;c={...c,data:e.data,selection:ce(e.data,t,o)},C(n,e.data!==n.data)})},load(e,n={}){const o=c,r=x(e,t);c={...c,data:r,selection:ce(r,t,n.selection??c.selection)},a=r,n.keepHistory||(d=[{core:c,at:-1/0,sealed:!0,id:ge()}],u=0),c!==o&&k()},undo(){u>0&&z(u-1)},redo(){u<d.length-1&&z(u+1)},setPermissions(e){(function(e,t){if(e===t)return!0;const n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>e[n]===t[n])})(e,l)||(l=e,V=R(),h=null,k())},setConfig(e){e!==t&&(t=e,V=R(),h=null,k())}};return L}function ye(e,t,n={}){const o=e=>{if(e.altKey)return;if(!(e.metaKey!==e.ctrlKey))return;const o="KeyZ"===e.code,r="KeyY"===e.code&&!e.shiftKey;(o||r)&&(n.leaveTyping&&$(e.target)||!1!==t.getState?.().getPermissions().edit&&(e.preventDefault(),r||e.shiftKey?t.redo():t.undo()))};return e.addEventListener("keydown",o),()=>e.removeEventListener("keydown",o)}var we=F(null),be=F(!0);function ke({easel:e,hotkeys:t=!0,resolveOnMount:n=!0,children:o}){return H(()=>{n&&e.resolveAll()},[e,n]),H(()=>{if(t&&"undefined"!=typeof document)return ye(document,e)},[e,t]),/* @__PURE__ */G(we.Provider,{value:e,children:/* @__PURE__ */G(be.Provider,{value:t,children:o})})}function Se(){const e=T(we);if(!e)throw new Error("useEasel: no <EaselProvider> above this component");return e}function Ce(e){const t=Se(),n=W({view:null,selector:null,value:void 0,has:!1}),o=()=>{const o=t.getState(),r=n.current;if(r.has&&r.view===o&&r.selector===e)return r.value;const i=e(o);return r.has&&Object.is(r.value,i)?(n.current={view:o,selector:e,value:r.value,has:!0},r.value):(n.current={view:o,selector:e,value:i,has:!0},i)};return Y(t.subscribe,o,o)}function Ie(){return function(e){return Ce(e)}}var De="data-puck-component",Ee="data-puck-dropzone",xe={},Oe="data-es-mirror",Ae="undefined"==typeof window?H:X;function Me(e,t,n){for(const e of Array.from(t.head.querySelectorAll(`[${Oe}]`)))e.remove();for(const o of Array.from(e.head.querySelectorAll('style, link[rel="stylesheet"]'))){const e=o.cloneNode(!0);e.setAttribute(Oe,""),n&&e.setAttribute("nonce",n),t.head.appendChild(e)}}function ze({children:t,id:n="preview-frame",title:o,className:r,style:i,mirrorStyles:l=!0,onDocument:s,height:a="auto",nonce:c}){const d=g("canvas",e),u=W(null),[p,f]=q(null);return Ae(()=>{const e=u.current,t=p?.ownerDocument.defaultView;if("auto"!==a||!e||!p||!t)return;const n=()=>{e.style.height=`${Math.ceil(p.getBoundingClientRect().height)}px`};n();const o=t.ResizeObserver,r=o?new o(n):null;return r?.observe(p),()=>r?.disconnect()},[p,a]),Ae(()=>{let e=u.current?.contentDocument;if(!e)return;"CSS1Compat"!==e.compatMode&&(e.open(),e.write("<!DOCTYPE html><html><head></head><body></body></html>"),e.close(),e=u.current?.contentDocument??e),e.body||e.documentElement.appendChild(e.createElement("body")),e.body.style.margin="0";const t=e.createElement("div");t.setAttribute("data-puck-entry",""),t.id="frame-root","fill"===a&&t.classList.add("es-frame-fill"),e.body.appendChild(t),L(e,c),f(t),s?.(e);let n=null;const o=u.current?.ownerDocument;if(l&&o){Me(o,e,c);const t=o.defaultView;t&&"MutationObserver"in t&&(n=new t.MutationObserver(()=>Me(o,e,c)),n.observe(o.head,{childList:!0,subtree:!0,characterData:!0}))}return()=>{n?.disconnect(),t.remove(),f(null),s?.(null)}},[]),/* @__PURE__ */G("iframe",{ref:u,id:n,title:o??d.frame,className:["es-canvas-frame","fill"===a?"is-fill":"",r??""].filter(Boolean).join(" "),style:i,children:p?ee(t,p):null})}var Re=F(null),Ve=F(xe),Be=[];function Le({parentId:e,slot:t,className:n,style:o,minEmptyHeight:r=128,minEmptyWidth:i=120}){const l=Se(),s=Ce(n=>w(n.appState.data,l.config,{parentId:e,slot:t})??Be),a=Ce(t=>"node"===t.selection?.kind&&t.selection.id===e&&e!==y),c=Ce(n=>"slot"===n.selection?.kind&&n.selection.parentId===e&&n.selection.slot===t),d=T(Re),u=["es-zone"];return s.length&&u.push("has-children"),e===y&&u.push("is-root"),(a||c)&&u.push("is-area-selected"),null!==d&&d===e&&e!==y&&u.push("is-hovering-area"),n&&u.push(n),/* @__PURE__ */G("div",{className:u.join(" "),[Ee]:`${e}:${t}`,style:{...o,"--min-empty-height":`${r}px`,"--min-empty-width":`${i}px`},children:s.map(e=>/* @__PURE__ */G(He,{node:e},e.props.id))})}function Pe(e,t,n,o){const r=U(()=>{const n={};for(const o of z(R(e)))n[o]=Object.assign(function(e={}){/* @__PURE__ */
2
- return G(Le,{parentId:t,slot:o,...e})},{blockCount:0});return n},[e,t]);for(const e of Object.keys(r))r[e].blockCount=V(n[e],o);return r}function $e(e){return U(()=>function({zone:t,...n}){/* @__PURE__ */
3
- return G(Le,{parentId:e,slot:t,...n})},[e])}var je=["top","bottom","zIndex"];function Ne(e,t,n){e.style[t]!==n&&(e.style[t]=n)}function Ke(e){const t=function(e){const t=e?.ownerDocument.defaultView?.getComputedStyle(e);if(!t||"sticky"!==t.position)return null;const n=e=>"auto"===e?"":e;return{top:n(t.top),bottom:n(t.bottom),zIndex:n(t.zIndex)}}(function(e){const t=e.ownerDocument.defaultView;let n=null;for(const o of Array.from(e.children))if("none"!==t?.getComputedStyle(o).display){if(n)return null;n=o}return n}(e));Ne(e,"position",t?"sticky":"relative");for(const n of je)Ne(e,n,t?.[n]??"");return!!t}var Ze="data-es-canvas-relative";function Fe(e){e.hasAttribute(Ze)&&("relative"===e.style.position&&(e.style.position=""),e.removeAttribute(Ze));const t=e.ownerDocument.defaultView?.getComputedStyle(e).position;return t&&"static"!==t?"sticky"===t:(e.style.position||(e.style.position="relative",e.setAttribute(Ze,"")),!1)}function He({node:e}){const t=Se().config,n=t.components[e.type],o=e.props.id,r=W(null),i=function(e,t){return U(()=>n=>{const o=t.current;o&&o!==n&&(o.removeAttribute(De),o.removeAttribute("data-puck-dnd")),t.current=n,n&&(n.setAttribute(De,e),n.setAttribute("data-puck-dnd",e),Fe(n))},[e,t])}(o,r),l=W(null),s=!!n?.inline;!function(e,t){const n=W(!1),o=W(()=>{});o.current=()=>{const o=e(),i=n.current;n.current=!!o&&t(o),i!==n.current&&r.current()};const r=W(()=>{});Ae(()=>o.current()),Ae(()=>{const t=e(),i=t?.ownerDocument.defaultView;if(!t||!i)return;const l=()=>o.current();i.addEventListener("resize",l);const s=i.ResizeObserver,a=s?new s(l):null;a?.observe(t);let c=null;return r.current=()=>{c?.disconnect(),c=null;const e=t.ownerDocument.documentElement;n.current&&e&&i.MutationObserver&&(c=new i.MutationObserver(l),c.observe(e,{attributes:!0}))},r.current(),()=>{i.removeEventListener("resize",l),a?.disconnect(),c?.disconnect(),r.current=()=>{}}},[])}(()=>s?r.current:l.current,e=>s?Fe(e):Ke(e));const a=T(Ve),c=Pe(n,o,e.props,t.components),d=$e(o);if(!n?.render)return null;const u=n.render,p={...B(n),...e.props,...c},f={renderDropZone:d,isEditing:!0,dragRef:n.inline?i:null,metadata:{...a,...n.metadata}};return n.inline?/* @__PURE__ */G(u,{...p,puck:f,editMode:!0}):
4
- /* @__PURE__ */G("div",{ref:l,[De]:o,"data-puck-dnd":o,style:{position:"relative"},children:/* @__PURE__ */G(u,{...p,puck:f,editMode:!0})})}function Te({metadata:e}){const t=Ce(e=>e.config),n=Ce(e=>e.appState.data.root).props??{},o=t.root?.render,r=Pe(t.root,y,n,t.components),i=$e(y),l=/* @__PURE__ */G(Le,{parentId:y,slot:M}),s=o?/* @__PURE__ */G(o,{id:"puck-root",...n,...r,puck:{renderDropZone:i,isEditing:!0,dragRef:null,metadata:e??{}},editMode:!0,children:l}):l;/* @__PURE__ */
5
- return G(Ve.Provider,{value:e??xe,children:s})}var We=F(void 0),Ye=F(void 0),qe=F(void 0);function Ue({element:e}){const t=W(null),n=Qe(t,e?()=>e:null,e);/* @__PURE__ */
6
- return G("div",{ref:t,"aria-hidden":"true",className:"es-canvas-outline is-hover is-hover-part",style:n?{position:"absolute",top:n.top,left:n.left,width:n.width,height:n.height}:{display:"none"}})}function Qe(e,t,n){return Ge(e,t?e=>{const n=t(e);return n?[n]:[]}:null,n)[0]??null}var Xe=[];function Ge(e,t,n){const[o,r]=q(Xe),i=W(t);return i.current=t,Ae(()=>{const t=e.current?.ownerDocument,n=t?.defaultView;if(!t||!n||!i.current)return void r(Xe);let o=0;const l=()=>{o=0;const n=e.current?.parentElement??null,l=(i.current?i.current(t):[]).map(e=>function(e,t){if(!e||!t)return null;const n=K(e),o=t.getBoundingClientRect();return{top:n.top-o.top,left:n.left-o.left,width:n.width,height:n.height}}(e,n)).filter(e=>null!==e);r(e=>{return(t=e)===(n=l)||t.length===n.length&&t.every((e,t)=>function(e,t){return e===t||!!e&&!!t&&e.top===t.top&&e.left===t.left&&e.width===t.width&&e.height===t.height}(e,n[t]))?e:l.length?l:Xe;var t,n})},s=()=>{o||(o=(n.requestAnimationFrame??(e=>n.setTimeout(e,16)))(l))};l();const a="MutationObserver"in n?new n.MutationObserver(s):null;a?.observe(t.body,{childList:!0,subtree:!0,attributes:!0,characterData:!0});const c="ResizeObserver"in n?new n.ResizeObserver(s):null;return c?.observe(t.documentElement),n.addEventListener("resize",s),()=>{a?.disconnect(),c?.disconnect(),n.removeEventListener("resize",s),o&&(n.cancelAnimationFrame??n.clearTimeout)(o)}},[n]),o}function Je({id:e,kind:t,overlay:n}){const o=W(null),r=T(Ye),i=null!==e&&!0===r?.(e),l=Ge(o,e?t=>Z(t,`[${De}="${t.defaultView?.CSS?.escape?t.defaultView.CSS.escape(e):e}"]`):null,e),[s,...a]=l,c=`es-canvas-outline is-${t}${i?" is-shared":""}`,d=e=>({position:"absolute",top:e.top,left:e.left,width:e.width,height:e.height}),u=/* @__PURE__ */J(_,{children:[
7
- /* @__PURE__ */G("div",{ref:o,"aria-hidden":"true",className:c,style:s?d(s):{display:"none"}}),a.map((e,t)=>/* @__PURE__ */G("div",{"aria-hidden":"true",className:c,style:d(e)},t))]});return n&&e?/* @__PURE__ */G(n,{componentId:e,kind:t,children:u}):u}function _e(e,t,n){const o=h(e,n),r=o.text.length,i=e.ownerDocument;if(!t)return[r,r];let l=null;const s=i.caretPositionFromPoint?.(t.x,t.y);if(s&&e.contains(s.offsetNode))l=o.at(s.offsetNode,s.offset);else{const n=i.caretRangeFromPoint?.(t.x,t.y);n&&e.contains(n.startContainer)&&(l=o.at(n.startContainer,n.startOffset))}if(null===l)return[r,r];const a=o.text;let c=l,d=l;for(;c>0&&!/\s/.test(a[c-1]);)c-=1;for(;d<a.length&&!/\s/.test(a[d]);)d+=1;return[c,d]}function et({s:e,element:t,toolbar:n,label:o,keys:r}){const i=g("copy",m),l=e.pressed(),s=new Set(n.offered),f=n.colors&&n.colors.length>0?n.colors:null,h=W(null),[v,y]=q(!1),[w,b]=q(null),k=v||null!==w,S=()=>{e.hold(),y(!1),b({href:e.pressed().href})},C=()=>{y(!1),b(null),e.resume()};X(()=>{r.current={escape:()=>!!k&&(C(),!0),link:()=>!!s.has("link")&&(S(),!0)}}),X(()=>()=>{r.current=null},[r]);const I=W(C);I.current=C,H(()=>{if(v)return te(e=>{const t=h.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(I.current(),!0)},()=>h.current?.querySelector(".es-copy-colors"))},[v]),H(()=>{const n=h.current;if(!k||!n)return;const o=/* @__PURE__ */new Set([n.ownerDocument]),r=t();r&&o.add(r.ownerDocument);const i=o=>{const r=o.target;if(r&&n.contains(r))return;y(!1),b(null);const i=t();r&&i&&i.contains(r)?e.release():e.stop("outside")};for(const e of o)e.addEventListener("pointerdown",i,!0);return()=>{for(const e of o)e.removeEventListener("pointerdown",i,!0)}},[k,e,t]),X(()=>{const e=h.current,n=e?.querySelector(".rosh-tb-wrap > .es-copy-pop"),o=t();if(!(k&&e&&n&&o))return;const r=o.ownerDocument.defaultView?.getSelection()??null,i=r&&r.rangeCount>0&&o.contains(r.getRangeAt(0).startContainer)?r.getRangeAt(0):null,l=(i?a(i,o):null)??(()=>{const e=o.getBoundingClientRect();return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}})(),s=o.ownerDocument.defaultView?.frameElement,u=s?j(s,{left:l.left,top:l.top,width:l.right-l.left,height:l.bottom-l.top}):{left:l.left,top:l.top,width:l.right-l.left,height:l.bottom-l.top},p=o.getBoundingClientRect(),f=s?j(s,{left:p.left,top:p.top,width:p.width,height:p.height}):{left:p.left,top:p.top,width:p.width,height:p.height},m=(e.closest("[data-floating-bar]")??e).getBoundingClientRect(),g={left:u.left,right:u.left+u.width,top:Math.min(u.top,f.top-6,m.top),bottom:Math.max(u.top+u.height,f.top+f.height+6,m.bottom)},v=e.ownerDocument.documentElement,y=(s??o.closest(".es-canvas")??o).getBoundingClientRect(),w={left:Math.max(0,y.left),top:Math.max(0,y.top),right:Math.min(v.clientWidth||y.right,y.right),bottom:Math.min(v.clientHeight||y.bottom,y.bottom)};if(w.right<=w.left||w.bottom<=w.top||0===n.offsetWidth)return;const b=c({anchor:g,size:{width:n.offsetWidth,height:n.offsetHeight},within:{left:y.left,top:y.top,right:y.right,bottom:y.bottom},clip:w,parent:d(n)});n.style.top=`${b.top}px`,n.style.left=`${b.left}px`,n.style.setProperty("--es-pop-point",`${b.point}px`),n.dataset.side=b.above?"above":"below"});const D=f?{run:u(l.color,f),open:v,onToggle:()=>{b(null),v?C():(e.hold(),y(!0))}}:void 0;/* @__PURE__ */
8
- return G(ne,{anchor:()=>{const e=t();if(!e)return null;const n=e.getBoundingClientRect(),o=e.ownerDocument.defaultView?.frameElement,r=o?j(o,{left:n.left,top:n.top,width:n.width,height:n.height}):{left:n.left,top:n.top,width:n.width,height:n.height};return{left:r.left-6,top:r.top-6,right:r.left+r.width+6,bottom:r.top+r.height+6}},bounds:()=>{const e=t(),n=e?.ownerDocument.defaultView?.frameElement,o=(n??e?.closest(".es-canvas")??e)?.getBoundingClientRect();return o?{left:o.left,top:o.top,right:o.right,bottom:o.bottom}:{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}},"aria-label":o,children:/* @__PURE__ */G("div",{ref:h,children:/* @__PURE__ */G(oe,{layout:"row",offered:s,pressed:l.marks,onMark:t=>{"link"===t?S():e.press(t)},color:D,linkOpen:null!==w,list:{pressed:l.list,onList:t=>e.list(t)},alignment:n.alignment,letterCase:n.letterCase,last:n.lastTool?.({className:"rosh-tb-btn",disabled:!1,selected:l.selected,keepCaret:t=>{t.preventDefault(),e.hold()},insert:t=>e.insert(t)}),windows:/* @__PURE__ */J(_,{children:[v&&f?/* @__PURE__ */G(p,{colors:f,current:l.color,words:i.colors??m.colors,onPick:t=>e.color(t)}):null,w?
9
- /* @__PURE__ */G(re,{className:"es-copy-link es-copy-pop",value:w.href??"",onApply:t=>{b(null),e.link(t)},onRemove:null!==w.href?()=>{b(null),e.link(null)}:void 0,onCancel:C}):null]})})})})}function tt({element:e}){const t=W(null),n=Qe(t,()=>e(),e);/* @__PURE__ */
10
- return G("div",{ref:t,"aria-hidden":"true",className:"es-canvas-outline is-typing",style:n?{position:"absolute",top:n.top,left:n.left,width:n.width,height:n.height}:{display:"none"}})}function nt({frame:t=!0,className:n,style:o,metadata:r,mirrorStyles:a,onDocument:c,height:d,title:u,nonce:p,hotkeys:h,frameWrapper:m,overlay:v,children:y,typing:w,passThrough:b}){const k=Se(),S=T(We),C=b??S,I=T(be),D=g("canvas",e),E=h??I,[x,O]=q(void 0),A=Ce(e=>"node"===e.selection?.kind?e.selection.id:null),[M,z]=q(null),[R,V]=q(null),B=T(qe),[L,$]=q(null),j=W(null),[,K]=q(0),Z=W(w);Z.current=w;const F=W(null),Y=W(null),U=Ce(e=>e.appState.data);H(()=>{const e=Y.current?.ownerDocument,t=e?.defaultView?.CustomEvent;if(!e||!t)return;const n=A&&!L&&Z.current?.atSelection?.()?A:null;e.dispatchEvent(new t(P,{detail:{id:n}}))},[A,L,U]);const Q=e=>{const t=Y.current?.ownerDocument,n=t?.defaultView?.CustomEvent;t&&n&&t.dispatchEvent(new n(N,{detail:{typing:e}}))},X=(e,t)=>{j.current?.s.stop("stop");const n=e.element();if(!n)return!1;const o=k.group(),r=e.element,i=f({element:r,value:e.value,rules:e.rules,multiline:e.multiline,skip:e.skip,caret:_e(n,t,e.skip),write:e.write,remount:e.remount,onSelect:()=>K(e=>e+1),onEscape:()=>F.current?.escape()??!1,onLinkKey:()=>F.current?.link()??!1,end:e=>{o.close(),j.current?.element===r&&(j.current=null),$(null),Q(!1),Z.current?.onChange?.({typing:!1,why:e})}});if(!i)return o.close(),!1;const l=n.closest?.(`[${De}]`)?.getAttribute(De);return l&&k.select(l),j.current={s:i,element:r,target:e},$(()=>r),z(null),Q(!0),Z.current?.onChange?.({typing:!0,element:n}),!0};H(()=>()=>j.current?.s.stop("stop"),[]);const _=e=>{const t=j.current?.element();return Boolean(t&&t.contains(e))},ee=e=>{const t=e.closest?.(`[${De}]`)?.getAttribute(De);if(!t)return;const n=k.getState(),o="node"===n.selection?.kind?n.selection.id:null,r=B?.partAt(e,t)??null;if(r){const e=l(n.appState.data,k.config,t,r.id,o,B?.selected()??null,C);if(e)return{node:e.node,part:e.part?r:null}}return{node:s(n.appState.data,k.config,t,o,C)??t,part:null}},te=e=>{if("Enter"!==e.key||e.defaultPrevented||e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return;if(j.current)return;const t=e.target;if(t?.isContentEditable||t?.closest?.("input, textarea, select, button"))return;const n=Z.current?.atSelection?.();n&&X(n,null)&&e.preventDefault()},ne=/* @__PURE__ */J("div",{ref:Y,className:"es-canvas-content",style:{position:"relative"},onClick:e=>{const t=e.target;if(t.closest?.("a[href]")&&e.preventDefault(),j.current){if(_(t))return;j.current.s.stop("outside")}const n=t.ownerDocument?.getSelection?.();n&&n.rangeCount>0&&n.isCollapsed&&n.removeAllRanges();const o=ee(t);if(void 0!==o)return k.select(o.node),void(B&&(o.part?.id??null)!==B.selected()&&B.select(o.part?.id??null));t.hasAttribute?.(Ee)||(k.select(null),B?.selected()&&B.select(null))},onDoubleClick:e=>{const t=Z.current;if(!t||_(e.target))return;const n=t.at(e.target);n&&X(n,{x:e.clientX,y:e.clientY})&&e.preventDefault()},onKeyDown:e=>te(e),onMouseOver:e=>{if(j.current)return;const t=ee(e.target),n=t?.part&&t.part.id!==B?.selected()?t.part.element:null,o=t&&!t.part?t.node:null;o!==M&&z(o),n!==R&&V(n)},onMouseLeave:()=>{z(null),V(null)},children:[
11
- /* @__PURE__ */G(Re.Provider,{value:M,children:/* @__PURE__ */G(Te,{metadata:r})}),
12
- /* @__PURE__ */J("div",{className:"es-canvas-outlines",style:{position:"absolute",top:0,left:0,pointerEvents:"none"},children:[
13
- /* @__PURE__ */G(Je,{id:!L&&M&&M!==A?M:null,kind:"hover",overlay:v}),B?/* @__PURE__ */G(Ue,{element:L?null:R}):null,
14
- /* @__PURE__ */G(Je,{id:L?null:A,kind:"selected",overlay:v}),L?/* @__PURE__ */G(tt,{element:L}):null]}),y]}),oe=m?/* @__PURE__ */G(m,{document:x,children:ne}):ne;H(()=>{if(x&&E)return ye(x,k)},[x,E,k]),H(()=>{if(!x)return;const e=e=>{if("Enter"===e.key)return void te(e);if("Escape"!==e.key||e.defaultPrevented)return;const t=e.target;if(t?.isContentEditable||t?.closest?.("input, textarea, select"))return;const n=k.getState();if("node"!==n.selection?.kind)return;if(B?.selected())return void B.select(null);const o=i(n.appState.data,k.config,n.selection);"node"===o?.kind&&k.select(o.id)};return x.addEventListener("keydown",e),()=>x.removeEventListener("keydown",e)},[x,k,B]);/* @__PURE__ */
15
- return J("div",{className:"es-canvas"+(n?` ${n}`:""),style:o,"data-puck-preview":"","data-es-typing":L?"":void 0,children:[L&&j.current?.target.toolbar?/* @__PURE__ */G(et,{s:j.current.s,element:j.current.element,toolbar:j.current.target.toolbar,label:D.textTools,keys:F}):null,t?/* @__PURE__ */G(ze,{mirrorStyles:a,onDocument:e=>{O(e??void 0),c?.(e)},height:d,title:u,nonce:p,children:oe}):/* @__PURE__ */G("div",{id:"preview-frame","data-puck-entry":"",children:oe})]})}function ot(e={}){const t=Se(),n=Ce(e=>e.appState.data);return r({...e,data:n,config:t.config,commit:(e,{select:n})=>t.run({data:e,select:n})})}function rt(){const e=Se(),n=Ce(e=>e.config),o=e.resolveCache,r=Ce(e=>e.selectedItem),i=Ce(e=>e.appState.data.root),l=r?r.props.id:"root",s=i.props??{},a=U(()=>r||{type:"root",props:s},[r,s]),c=r?n.components[r.type]:n.root,d=e.getState(),u=r?v(d.appState.data,n,l):null,p=u&&"root"!==u.place.parentId?u.place.parentId:null,f=p?d.getItemById(p)??null:null,{fields:h}=t({id:l,node:a,block:c,parent:f,appState:d.appState}),m=Ce(e=>!1===e.getPermissions(r?{item:r}:{root:!0}).edit),g=Q(t=>{(async()=>{const r=e.getState();if("root"!==l){const i=r.getItemById(l),s=r.getSelectorForId(l);if(!i||!s)return;const a={...i,props:{...i.props,...t}},{node:c}=await A(a,n,{cache:o,trigger:"replace"}),d=e.getState().getSelectorForId(l);if(!d)return;return void e.dispatch({type:"replace",destinationZone:d.zone??"root:default-zone",destinationIndex:d.index,data:c})}const i=r.appState.data.root.props??{},{node:s}=await A({type:"root",props:{...i,...t}},n,{cache:o,trigger:"replace"});e.dispatch({type:"replaceRoot",root:{props:s.props,readOnly:s.readOnly},recordHistory:!0})})()},[e,n,o,l]),y=Q((e,t)=>g({[e]:t}),[g]);return{id:l,node:a,fields:h,values:a.props,readOnly:m,onChange:y,onChangeMany:g}}export{ze as CanvasFrame,qe as CanvasPartsContext,We as CanvasPassThroughContext,Ye as CanvasSharedContext,he as DEFAULT_UI,nt as EaselCanvas,ke as EaselProvider,Te as EditDocument,ye as bindUndoKeys,ve as createEasel,Ie as createUseEasel,ie as recordsByDefault,ue as reduce,ae as uiView,Ce as useEasel,Se as useEaselApi,ot as useEaselNodeOps,rt as useSelectedFields,ce as validSelection};
@@ -1 +0,0 @@
1
- import{createPreviewSelectionContext as e}from"./chunk-GOTN2KY4.js";var{Provider:r,useSelection:o}=e("selectedPartId");export{r as PreviewPartsProvider,o as usePreviewParts};
@@ -1 +0,0 @@
1
- import{panelFieldsOf as t}from"./chunk-LER7RKTO.js";import{withoutDeviceGate as o,deviceMetaOf as n}from"./chunk-FGYJ5DJY.js";import{DESIGN_GROUP_KEY as e,BUCKET_KEY as r}from"./chunk-MQNBD6AB.js";import{STYLE_KIND as s,fieldKind as c,copyStyle as i,heldStyle as p,planPaste as u,pasteMessage as a}from"./chunk-V7U33NF2.js";import{ANCHOR_FIELD_KEYS as f,foldMetaOf as l,MEDIA_FIELD_MARKER as m,TEXT_FIELD_MARKER as h,LINK_FIELD_MARKER as y}from"./chunk-DUVRZ456.js";var j=/* @__PURE__ */new Set([e.Size,e.Design,e.Layout,e.Position]),w=new Set(Object.values(e)),b=new Set(Object.values(r)),S=new Set(f),g=/* @__PURE__ */new Set(["focal","imageFocal"]),k=[m,h,y];function v(t){return`site:${t??""}`}function D(t){if(!t||"object"!=typeof t)return null;const n=t,e=o(t)??t,r=n[s]??e[s];if("string"==typeof r)return r;const i=n.options??e.options;if(Array.isArray(i)){return`choice:${i.map(t=>String(t?.value)).sort().join("|")}`}return c(e)}function O(t){const n=t,e=o(t);return k.some(t=>t in n||e&&t in e)}function d(o,e){const s=t(o,e)??{},c=[];let i=!0,p=!1;for(const[t,o]of Object.entries(s))b.has(t)?(i=t===r.Design,p=!1):w.has(t)?i&&(p=j.has(t)):p&&o&&"object"==typeof o&&!t.startsWith("_")&&(l(o)||S.has(t)||g.has(t)||O(o)||"slot"!==o.type&&c.push({path:[t],kind:D(o),counted:"mobile"!==n(o)?.tier}));return c}function A(t,o,n,e,r){i({scope:n,type:e.type,label:r,rows:t(o,e),props:e.props})}function F(t,o,n,e,r,s){const c=p(n);if(!c)return null;const i=u(c,{type:e.type,rows:t(o,e),props:e.props});return{...i,message:a(i,c.sourceLabel,r,s)}}function L(t,o,n,e){A(d,t,o,n,e)}function R(t,o,n,e,r){return F(d,t,o,n,e,r)}var B={scope:t=>v(t.siteId),rows:(t,o)=>d(t,o),copy:(t,o,n,e)=>L(e,t,o,n),plan:(t,o,n,e)=>R(e,t,o,n)};function J(t,o){if(!t&&!o)return B;const n=t?.rows,e=n?(t,o)=>n(t,o):d;return{scope:t?.scope??B.scope,rows:(t,o)=>e(t,o),copy:t?.copy??((t,o,n,r)=>A(e,r,t,o,n)),plan:t?.plan??((t,n,r,s)=>F(e,s,t,n,r,o))}}export{L as copyNodeStyle,d as nodeStyleRows,R as planNodePaste,D as shopFieldKind,v as siteStyleScope,J as styleClipboardOf};
@@ -1 +0,0 @@
1
- var e={add:{stop:"Stop adding here",hint:"Drag onto the page.",search:"Search blocks",searchPlaceholder:({label:e})=>e,clearSearch:"Clear search",nothing:({query:e})=>`Nothing matches “${e}”`,tryAnother:"Try another word.",tile:({label:e})=>`Add ${e}`},canvas:{addSection:"Add section",addBlock:"Add block",addButton:({label:e})=>`+ ${e}`,handle:({label:e})=>`Drag to move this ${e.toLowerCase()}`,typeHint:"Double-click to edit"}};export{e as DEFAULT_DRAG_WORDS};
@@ -1,4 +0,0 @@
1
- import{blockRuns as e,offeredChoices as r}from"./chunk-M2Z775ZC.js";import{useScreenBlockLook as s}from"./chunk-PAOZMXEI.js";import{DEFAULT_SCREEN_WORDS as t}from"./chunk-23DYNW6S.js";import{useWords as n}from"./chunk-MFIRYGHW.js";import{DropdownMenu as c}from"efficient-shell/ui";import{jsxs as i,Fragment as o,jsx as l}from"react/jsx-runtime";function p({choices:p,onPick:a}){const{Icon:m}=s(),u=n("screen",t),f=e(r(p)).flatMap(e=>[...e.group?[{type:"label",key:`group:${e.group}`,label:/* @__PURE__ */i(o,{children:[e.group," ",
2
- /* @__PURE__ */l("span",{className:"sf-menugroup-count",children:e.items.length})]})}]:[],...e.items.map(e=>({key:e.type,label:e.label,icon:/* @__PURE__ */l("span",{className:"sf-chip",children:/* @__PURE__ */l(m,{type:e.type,size:13})}),onSelect:()=>a(e.type)}))]);/* @__PURE__ */
3
- return l(c,{align:"start",triggerClassName:"sf-add-card",items:f,trigger:/* @__PURE__ */i(o,{children:[
4
- /* @__PURE__ */l("span",{className:"sf-plus sf-plus--sm",children:"+"}),u.addBlockMenu]})})}export{p as AddBlockRow};
@@ -1,18 +0,0 @@
1
- import{DEFAULT_DRAG_WORDS as e}from"./chunk-KAML3KQH.js";import{dropEffectFor as t,scrollBoxOf as n,frameScrollBox as l,startAutoScroll as a,isNoOpDrop as r}from"./chunk-3S5N4HLJ.js";import{withTip as o}from"./chunk-P2VEMZH5.js";import{parseZoneKey as s,ROOT_ID as i}from"./chunk-K7BTCBWD.js";import{useCanvasLayout as c,useCanvasTyping as d,useCanvasEvent as u,CANVAS_TYPABLE_EVENT as h,framePointToHost as f,elementScale as p,frameRectToLayer as m,clientPointToLayer as g}from"./chunk-QIDRJH3S.js";import{isRepeatCopy as x}from"./chunk-LF3FUSCQ.js";import{useRef as b,useEffect as y,useState as v,useCallback as w,useMemo as k,useSyncExternalStore as N,useId as D,useLayoutEffect as A}from"react";import{Tooltip as z,IconButton as T,solidSurfaceStyle as M,Input as C}from"efficient-shell/ui";import{AddIcon as S,CloseIcon as $,SearchIcon as E}from"efficient-shell/icons/efficient";import{jsxs as L,jsx as j}from"react/jsx-runtime";function B({label:e,onInsert:t,style:n,axis:l="y",className:a,index:r}){const o=["es-canvas-insert","x"===l?"is-x":"",a??""].filter(Boolean).join(" ");/* @__PURE__ */
2
- return L("div",{className:o,style:n,"data-index":r,children:[
3
- /* @__PURE__ */j("span",{className:"es-canvas-insert-line","aria-hidden":"true"}),
4
- /* @__PURE__ */j("span",{className:"es-canvas-insert-chip",children:/* @__PURE__ */j(z,{content:e,children:/* @__PURE__ */j(T,{variant:"ghost",size:"sm","aria-label":e,onClick:t,children:/* @__PURE__ */j(S,{})})})})]})}var K=(e,t,n)=>t>=e.left&&t<=e.left+e.width&&n>=e.top&&n<=e.top+e.height,O=e=>e.width*e.height;function I(e,t,n){return e.map((e,t)=>({s:e,at:t})).filter(({s:e})=>K(e.box,t,n)).sort((e,t)=>O(t.s.box)-O(e.s.box)||e.at-t.at).map(({s:e})=>e)}function q(e,t,n){return I(e,t,n).at(-1)??null}function H(e,t,n){const l="x"===e.axis?t:n;let a=0;for(const t of e.children){l>("x"===e.axis?t.left+t.width/2:t.top+t.height/2)&&(a+=1)}return a}function X(e,t){const n=e.children;if("x"===e.axis){const l=n[t-1],a=n[t],r=l&&a?(l.left+l.width+a.left)/2:l?l.left+l.width:a?a.left:e.box.left,o=a??l??e.box;return{left:r-1,top:o.top,width:2,height:o.height}}const l=n[t-1],a=n[t],r=l&&a?(l.top+l.height+a.top)/2:l?l.top+l.height:a?a.top:e.box.top;return{left:e.box.left,top:r-1,width:e.box.width,height:2}}function Y(e,t,n,l,a=()=>!1,r=()=>!0){const o=e.filter(e=>K(e.box,t,n)).sort((e,t)=>O(e.box)-O(t.box));for(const e of o){const o=H(e,t,n),s={...e.list,index:o};if(a(s))return null;if(l(s))return{zone:e,to:s,line:X(e,o)};if(!r(s))return null}return null}function F(e,t,n=12){const l=e.children;if(0===l.length)return[];const a=e.box,r="x"===e.axis,o=r?a.left:a.top,s=o+(r?a.width:a.height),i=e=>r?e.left:e.top,c=e=>r?e.left+e.width:e.top+e.height,d=[];for(let a=0;a<=l.length;a++){const u=l[a-1],h=l[a];let f,p;if(u&&h)f=c(u),p=Math.max(i(h)-f,0);else{const e=u?(c(u)+s)/2:(o+i(h))/2,t=Math.min(Math.max(e,o+n),s-n);f=u?Math.max(t,c(u)):Math.min(t,i(h)),p=0}const m=[u,h].filter(e=>Boolean(e)),g=Math.min(...m.map(e=>r?e.top:e.left)),x=Math.max(...m.map(e=>r?e.top+e.height:e.left+e.width)),b=r?{left:f,top:g,width:p,height:x-g}:{left:g,top:f,width:x-g,height:p};d.push({key:`${e.key}:+${a}`,place:{...e.list,index:a},box:b,axis:e.axis,label:t})}return d}function P(e,t=e.key){const n=[];for(let l=1;l<e.children.length;l++){const a=e.children[l-1],r=e.children[l],o=a.top+a.height;n.push({key:`${t}:${l}`,place:{...e.list,index:l},box:{left:e.box.left,top:o,width:e.box.width,height:Math.max(r.top-o,0)}})}return n}var Q={nodes:[],zones:[]},R="data-puck-dropzone",Z="data-puck-component";function J(e,t){if(e.length>=2){const[t,n]=e;return Math.abs(n.top-t.top)<Math.min(t.height,n.height)/2&&n.left>t.left?"x":"y"}const n=t.ownerDocument.defaultView?.getComputedStyle(t);return n&&n.display.includes("flex")&&n.flexDirection.startsWith("row")?"x":"y"}function V(e,t){const{frame:n,document:l}=e,a=e=>m(n,function(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top,width:t.width,height:t.height}}(e),t),r=[],o=[];for(const e of l.querySelectorAll(`[${R}]`)){if(x(e))continue;const t=e.getAttribute(R)??"";let n;try{n=s(t)}catch{continue}const l=[...e.querySelectorAll(`[${Z}]`)].filter(t=>t.parentElement?.closest(`[${R}]`)===e&&!x(t)),i=l.map(a);o.push({key:t,list:n,box:a(e),axis:J(i,e),children:i}),l.forEach((e,t)=>{const l=e.getAttribute(Z);l&&r.push({id:l,place:{...n,index:t},box:i[t]})})}return{nodes:r,zones:o}}var W="data-es-empty-cell",U="data-puck-dropzone",G=140;var _=e=>({left:e.left,top:e.top,width:e.width,height:e.height});function ee(o){const{canvas:s,session:m,readOnly:x,words:D=e.canvas}=o,T=b(o);y(()=>{T.current=o});const C=b(null),S=c(s),[$,E]=v(0),K=w(()=>E(e=>e+1),[]),[O,q]=v(Q);y(()=>{const e=C.current;s&&e&&q((T.current.measure??V)(s,e))},[s,S,o.revision,$]);const H=o.model,X=k(()=>H(O),[H,O]),F=N(m.subscribe,m.shown,m.shown),P=o.choose,R=(e,t)=>{const n=I(X.sources,e,t);return 0===n.length?null:P?P(n):n[n.length-1]},[Z,J]=v(null),[G,ee]=v(null),[te,ne]=v(null),le=b(null),ae=()=>{le.current&&clearTimeout(le.current),le.current=null},re=()=>{ae(),le.current=setTimeout(()=>{m.get()||J(null)},140)};y(()=>ae,[]);const oe=b(null),se=d(s),ie=b(!1);ie.current=se,y(()=>{se&&(ae(),J(null))},[se]);const[ce,de]=v(null);u(s,h,e=>de(e.detail?.id??null));const ue=!ce||se||x||F?null:O.nodes.find(e=>e.id===ce)?.box??null;u(s,"mousemove",e=>{const t=C.current;if(!s||!t)return;const n=f(s.frame,e.clientX,e.clientY,t),l=p(t),a={x:n.x/l,y:n.y/l};if(oe.current=a,T.current.readOnly||m.get()||ie.current)return;ae();const r=R(a.x,a.y);J(e=>e?.key===r?.key&&e?.box===r?.box?e:r)}),u(s,"mouseout",e=>{e.relatedTarget||(oe.current=null,re())}),u(s,"mouseover",e=>{e.relatedTarget||K()});const he=b(null),fe=w(()=>{he.current?.(),he.current=null,ee(null),ne(null)},[]);y(()=>m.subscribe(()=>{m.get()?K():fe()}),[m,fe,K]),y(()=>fe,[fe]),("undefined"==typeof document?y:A)(()=>{if(m.get())return;const e=oe.current;J(t=>x||ie.current?null:e?R(e.x,e.y):t?X.sources.find(e=>e.key===t.key)??null:null)},[X,F,m,x,P]);const pe=e=>{const t=m.get(),n=C.current,l=T.current.dropOn;if(!t||!n||!l)return null;const a=g(n,e.clientX,e.clientY);oe.current=a;const r=I(X.sources,a.x,a.y);for(let e=r.length-1;e>=0;e-=1)if(l.accepts(t.item,r[e]))return{h:t,source:r[e]};return null},me=e=>{const t=m.get(),n=C.current;if(!t||!n)return null;const l=g(n,e.clientX,e.clientY);oe.current=l;const a=Y(X.zones,l.x,l.y,e=>T.current.canDrop(t.item,e),e=>!!t.from&&r(t.from,e),e=>T.current.fallThrough?.(t.item,e,t.from)??!0);return a?{h:t,t:a}:null},ge={onDragEnter:e=>{if(he.current)return;const t=n(e.currentTarget.parentElement?.parentElement??null),r=s?l(s.document):null,o=[];t&&o.push(a(t)),r&&s&&o.push(a(r,s.frame)),he.current=o.length?()=>o.forEach(e=>e()):null},onDragOver:e=>{const n=pe(e);if(n)return e.preventDefault(),e.dataTransfer.dropEffect=t(e.dataTransfer.effectAllowed),ee(null),void ne(e=>e&&e.key===n.source.key&&e.box===n.source.box?e:n.source);ne(null);const l=me(e);if(!l)return void ee(null);e.preventDefault(),e.dataTransfer.dropEffect=t(e.dataTransfer.effectAllowed);const a={zoneKey:l.t.zone.key,line:l.t.line,axis:l.t.zone.axis};ee(e=>e&&e.zoneKey===a.zoneKey&&e.line.left===a.line.left&&e.line.top===a.line.top?e:a)},onDragLeave:e=>{const t=e.relatedTarget;t&&e.currentTarget.contains(t)||(oe.current=null,ee(null),ne(null))},onDrop:e=>{const t=pe(e);if(t)return e.preventDefault(),m.end(),fe(),void T.current.dropOn.onDrop(t.h.item,t.source);const n=me(e);n&&(e.preventDefault(),m.end(),fe(),T.current.onDrop(n.h.item,n.t.to))}},xe={draggable:!x&&!!Z,onMouseEnter:ae,onMouseLeave:()=>!m.get()&&re(),onDragStart:e=>{if(Z&&!x){m.start({key:Z.key,item:Z.item,from:Z.from}),e.dataTransfer.effectAllowed="move";try{e.dataTransfer.setData("text/plain",Z.key)}catch{}}else e.preventDefault()},onDragEnd:()=>{m.end(),fe()},onClick:()=>{Z&&!x&&T.current.onPick?.(Z.item)}},{seams:be=[]}=X,ye=X.zones.filter(e=>0===e.children.length),ve=!o.onZoneAdd||x||se?[]:ye,we=ve.map(e=>e.key).join("\n");return y(()=>{const e=s?.document;if(!e)return;const t=new Set(we?we.split("\n"):[]);for(const n of e.querySelectorAll(`[${U}]`))n.toggleAttribute(W,t.has(n.getAttribute(U)??""));return()=>{for(const t of e.querySelectorAll(`[${W}]`))t.removeAttribute(W)}},[s,we,O,S,$]),/* @__PURE__ */L("div",{ref:C,className:"es-canvas-layer",children:[F||!o.onSeamAdd||x||se?null:be.map(e=>
5
- /* @__PURE__ */j(B,{className:"es-canvas-seam",axis:e.axis,index:e.place.index,label:e.label??o.seamLabel??D.addSection,onInsert:()=>o.onSeamAdd?.(e.place),style:"x"===e.axis?{left:e.box.left+e.box.width/2-12,top:e.box.top,width:24,height:e.box.height}:{left:e.box.left,top:e.box.top+e.box.height/2-12,width:e.box.width,height:24}},e.key)),ve.length?ve.map(e=>/* @__PURE__ */j("button",{type:"button",className:["es-canvas-empty",e.addAlways?"is-always":"",G?.zoneKey===e.key?"is-over":""].filter(Boolean).join(" "),style:_(e.box),"data-node-id":e.list.parentId===i?void 0:e.list.parentId,onClick:()=>o.onZoneAdd?.({...e.list,index:0}),children:/* @__PURE__ */j("span",{className:"es-canvas-empty-add",children:D.addButton({label:e.addLabel??o.zoneAddLabel??D.addBlock})})},e.key)):null,F?/* @__PURE__ */j("div",{className:"es-canvas-catch",...ge}):null,te&&F?/* @__PURE__ */j("div",{className:"es-canvas-target",style:_(te.box),children:o.dropOn?.label?/* @__PURE__ */j("span",{className:"es-canvas-target-label",style:M(),children:o.dropOn.label(F.item,te)}):null}):null,G&&!ye.some(e=>e.key===G.zoneKey)?/* @__PURE__ */j("div",{className:`es-canvas-line is-${G.axis}`,style:_(G.line)}):null,ue?/* @__PURE__ */j("span",{className:"es-canvas-hint"+(ue.width<200?" is-below":""),style:{...M(),left:ue.left+ue.width,top:ue.width<200?ue.top+ue.height:ue.top},children:D.typeHint}):null,
6
- /* @__PURE__ */j("div",{className:"es-canvas-handle-spot",style:Z?{"--es-handle-x":`${Z.box.left+2}px`,"--es-handle-y":`${Math.max(Z.box.top-11,0)}px`}:void 0,children:/* @__PURE__ */j(z,{className:"es-canvas-handle-tip",side:"top",content:!Z||x||F?null:Z.title??D.handle({label:Z.label}),children:/* @__PURE__ */L("div",{className:["es-canvas-handle",Z&&!x?"is-shown":"",F?"is-dragging":""].filter(Boolean).join(" "),...xe,children:[
7
- /* @__PURE__ */j("span",{className:"es-canvas-grip","aria-hidden":"true",children:"⋮⋮"}),Z?.label]})})})]})}var te=e=>e.tiles.length>0&&e.tiles.every(e=>null!=e.cover);function ne({groups:t,session:n,itemFor:l,onInsert:a,onTileMenu:r,at:s,hint:i,searchLabel:c,readOnly:d,words:u=e.add}){const h=i??u.hint,f=c??u.search,[p,m]=v(""),g=D(),x=p.trim().toLowerCase(),b=function(e){const t=/* @__PURE__ */new Map;return e.map(e=>{const n=e.key??e.title,l=t.get(n)??0;return t.set(n,l+1),0===l?n:`${n}\0${l}`})}(t),y=t.map((e,t)=>({...e,key:b[t],tiles:x?e.tiles.filter(e=>((e,t)=>e.label.toLowerCase().includes(t)||(e.keywords??[]).some(e=>e.toLowerCase().includes(t)))(e,x)):e.tiles})).filter(e=>e.tiles.length>0),w=(e,t)=>a=>{if(t)a.preventDefault();else{n.start({key:`new:${e}`,item:l(e)}),a.dataTransfer.effectAllowed="copy";try{a.dataTransfer.setData("text/plain",e)}catch{}}};/* @__PURE__ */
8
- return L("div",{className:"es-add",children:[s?/* @__PURE__ */L("div",{className:"es-add-at",role:"status",children:[
9
- /* @__PURE__ */j("span",{children:s.label}),o(u.stop,/* @__PURE__ */j("button",{type:"button",className:"es-add-at-clear","aria-label":u.stop,onClick:s.onClear,children:/* @__PURE__ */j($,{size:12,"aria-hidden":"true"})}))]}):null,
10
- /* @__PURE__ */j("p",{className:"es-add-hint",children:h}),
11
- /* @__PURE__ */j("div",{className:"es-add-find",children:/* @__PURE__ */j(C,{id:g,type:"search","aria-label":f,placeholder:u.searchPlaceholder({label:f}),value:p,onChange:e=>m(e.target.value),leftIcon:/* @__PURE__ */j(E,{size:16,"aria-hidden":"true"}),rightAdornment:p?/* @__PURE__ */j(T,{size:"sm","aria-label":u.clearSearch,onClick:()=>m(""),children:/* @__PURE__ */j($,{size:12,"aria-hidden":"true"})}):void 0})}),0===y.length?/* @__PURE__ */L("div",{className:"es-add-empty",role:"status",children:[
12
- /* @__PURE__ */j("div",{className:"es-add-empty-title",children:u.nothing({query:p.trim()})}),
13
- /* @__PURE__ */j("div",{className:"es-add-empty-sub",children:u.tryAnother})]}):y.map(e=>/* @__PURE__ */L("section",{className:"es-add-group","aria-label":e.title,children:[
14
- /* @__PURE__ */L("div",{className:"es-add-group-head",children:[
15
- /* @__PURE__ */j("span",{className:"es-add-group-title",children:e.title}),
16
- /* @__PURE__ */j("span",{className:"es-add-group-count",children:e.tiles.length})]}),
17
- /* @__PURE__ */j("div",{className:te(e)?"es-add-grid is-cards":"es-add-grid",children:e.tiles.map(e=>{const t=Boolean(d||e.disabled),l=d?void 0:e.disabled?e.disabledReason:e.title??u.tile({label:e.label});return o(l,/* @__PURE__ */L("button",{type:"button",className:null!=e.cover?"es-add-tile has-cover":"es-add-tile",draggable:!t,"aria-disabled":t||void 0,"aria-label":u.tile({label:e.label}),onDragStart:w(e.type,t),onDragEnd:()=>n.end(),onClick:()=>!t&&a?.(e.type),onContextMenu:r?t=>{r(e.type,{x:t.clientX,y:t.clientY,owner:t.currentTarget})&&t.preventDefault()}:void 0,children:[null!=e.cover?/* @__PURE__ */j("span",{className:"es-add-tile-cover","aria-hidden":"true",children:e.cover}):e.icon?/* @__PURE__ */j("span",{className:"es-add-tile-glyph","aria-hidden":"true",children:e.icon}):null,
18
- /* @__PURE__ */L("span",{className:"es-add-tile-label",children:[e.label,null!=e.mark?/* @__PURE__ */j("span",{className:"es-add-tile-mark","aria-hidden":"true",children:e.mark}):null]})]},e.type))})})]},e.key))]})}export{ne as AddPanel,ee as CanvasDragLayer,B as CanvasInsert,Q as EMPTY_MEASURE,G as HANDLE_GRACE_MS,Y as canvasTarget,K as contains,H as gapInZone,X as gapLine,F as insertSeams,V as measureCanvas,q as pickSource,P as seamsBetween,I as sourcesAt};
@@ -1 +0,0 @@
1
- import{useSectionOps as o}from"./chunk-WEIE2FBC.js";import{SELECTION_MODE as e}from"./chunk-PAOZMXEI.js";import{useEasel as r}from"./chunk-EFHV56BO.js";import{usePreviewParts as t}from"./chunk-I54UCYOU.js";import{decodePartId as n,encodePartId as p}from"./chunk-IYT6NN2J.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:I}){const{getSelectorForId:a}=r(o=>o),u=o(),{setSelectedPartId:f,setSelectHandler:k}=t(),l=d(o=>{const r=n(o);if(!r)return;const{nodeId:t,propKey:p}=r;p?(i(o=>s(o)&&o.nodeId===t&&o.propKey===p?o:{kind:"part",nodeId:t,propKey:p}),I?.(t)):i(o=>"part"===o.kind?e:o)},[i,I]);c(()=>{k(l)},[k,l]);const h=s(m)?p(m.nodeId,m.propKey):null;c(()=>{f(h)},[h,f]);return{selectNode:d(o=>{i(()=>e);const r=a(o);r&&u.select(r)},[i,a,u]),openPartId:h}}export{m as usePartBridge};
@@ -1,5 +0,0 @@
1
- import{usePickFollowsSelection as n}from"./chunk-FHCKFOCD.js";import{EaselCanvas as e,useSelectedFields as t}from"./chunk-EFHV56BO.js";import{Inspector as r}from"./chunk-7LYKFL3Q.js";import{slotFieldsOf as i}from"./chunk-PLVEGYK6.js";import{createContext as o,useContext as u}from"react";import{DesktopIcon as l}from"efficient-shell/icons/efficient";import{jsx as s}from"react/jsx-runtime";var c={kind:"puck"};function f(n,e){const t=n,r=e,i=Object.keys(t);return i.length===Object.keys(r).length&&i.every(n=>Object.is(t[n],r[n]))}function a(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function d(n,e,t){const r=n.slotsOf?.(t);return r||i(e,t.type).map(n=>({slot:n,label:n,rung:!1}))}function p(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function m(n,e){return n.isLast?n.isLast(e):e.type===n.last}var k={},h=()=>k,v=()=>"",g=()=>null,y=()=>{},b={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},O={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},L={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */s(l,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},j={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},w={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function C(){/* @__PURE__ */
2
- return s(e,{height:"fill"})}function F(){const{id:n,fields:e,values:i,readOnly:o,onChange:u}=t();/* @__PURE__ */
3
- return s("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */s(r,{fields:e,values:i,onChange:u,readOnly:o,idPrefix:n})})}var S=o({});function D({parts:n,children:e}){/* @__PURE__ */
4
- return s(S.Provider,{value:n,children:e})}function P(){return u(S)}function B(){return(P().useOwnerName??v)()}function G(){return(P().useDocumentLabel??g)()}function N(n,e,t,r){return(P().useBridges??h)(n,e,t,r)}function x(n){return(P().useStandaloneBridges??h)(n)}function I(n,e){(P().useDocumentPass??y)(n,e)}function K(){return P().blockRules??b}function H(){return P().blockLook??O}function T(){return P().devices??L}function V(){return P().leftView??j}function A(){return P().pinned??w}function E(){return P().saveSwitch??!0}function R(e){n(!0===P().pickFollowsSelection,e)}function Y(){return P().storageNamespace||void 0}function Q(){return P().styleClipboard??null}function Z(){return P().nodeKeys??!0}function q(){return P().notify??null}function z(){return P().Canvas??C}function J(){return P().CanvasHead??null}function M(){return P().canvasDrag??null}var U=o(null);function W({target:n,children:e}){/* @__PURE__ */
5
- return s(U.Provider,{value:n,children:e})}function X(){return u(U)}function $(){return P().Inspector??F}export{c as SELECTION_MODE,W as ScreenCanvasTargetProvider,D as ScreenPartsProvider,p as isPinnedFirst,m as isPinnedLast,a as isSlotMode,f as sameInspectorMode,d as screenSlotsOf,H as useScreenBlockLook,K as useScreenBlockRules,N as useScreenBridges,M as useScreenCanvasDrag,z as useScreenCanvasFrame,J as useScreenCanvasHead,X as useScreenCanvasTarget,T as useScreenDevices,G as useScreenDocumentLabel,I as useScreenDocumentPass,$ as useScreenInspectorPanel,V as useScreenLeftView,Z as useScreenNodeKeys,q as useScreenNotify,B as useScreenOwnerName,P as useScreenParts,R as useScreenPickFollowsSelection,A as useScreenPinned,E as useScreenSaveSwitch,Y as useScreenStorageNamespace,Q as useScreenStyleClipboard,x as useStandaloneScreenBridges};
@@ -1 +0,0 @@
1
- import{useState as t,useEffect as e,useRef as n}from"react";var o=/* @__PURE__ */new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]);function r(t){const e=t;if(!e||"string"!=typeof e.tagName)return!1;const n=e.tagName.toUpperCase();if("TEXTAREA"===n||"SELECT"===n)return!0;if("INPUT"===n)return!o.has(String(e.type??"text").toLowerCase());if(e.isContentEditable)return!0;const r=e.closest?.("[contenteditable]");return!(!r||"false"===r.getAttribute("contenteditable"))||null!=e.closest?.('[role="textbox"]')}var i="data-puck-component";function c(t,e=i){const n=t;return n&&"function"==typeof n.closest?n.closest(`[${e}]`)?.getAttribute(e)??null:null}function u(t){const e=t.getBoundingClientRect();if(e.width>0&&e.height>0)return{left:e.left,top:e.top,width:e.width,height:e.height};let n=1/0,o=1/0,r=-1/0,i=-1/0;for(const e of Array.from(t.children)){const t=e.getBoundingClientRect();t.width<=0||t.height<=0||(n=Math.min(n,t.left),o=Math.min(o,t.top),r=Math.max(r,t.right??t.left+t.width),i=Math.max(i,t.bottom??t.top+t.height))}return n===1/0?{left:e.left,top:e.top,width:e.width,height:e.height}:{left:n,top:o,width:r-n,height:i-o}}function l(t){const e=t.offsetWidth;if(!e)return 1;const n=t.getBoundingClientRect().width;return n>0?n/e:1}function s(t,e,n){const o=t.getBoundingClientRect(),r=n?.getBoundingClientRect()??{left:0,top:0},i=l(t);return{left:o.left-r.left+e.left*i,top:o.top-r.top+e.top*i,width:e.width*i,height:e.height*i}}function a(t){const e=t.offsetWidth;if(!e)return 1;const n=t.getBoundingClientRect().width;return n>0?n/e:1}function d(t,e,n){const o=s(t,e,n),r=a(n);return{left:o.left/r,top:o.top/r,width:o.width/r,height:o.height/r}}function f(t,e,n){const o=t.getBoundingClientRect(),r=a(t);return{x:(e-o.left)/r,y:(n-o.top)/r}}function h(t,e,n,o){const{left:r,top:i}=s(t,{left:e,top:n,width:0,height:0},o);return{x:r,y:i}}function m({available:t,width:e,maxScale:n=1}){const o=Math.max(0,t);if(!e||e<=0)return{width:o,scale:1,shownWidth:o};const r=o>0?Math.min(o/e,n):1;return{width:e,scale:r,shownWidth:e*r}}var w="data-es-canvas-style",g=/* @__PURE__ */new WeakMap;function p(t,e){e?g.set(t,e):g.delete(t)}function b(t,e,n){const o=t.head??t.documentElement;let r=y(t,e);if(!r){r=t.createElement("style"),r.setAttribute(w,e);const n=g.get(t);n&&r.setAttribute("nonce",n),o.appendChild(r)}return r.textContent!==n&&(r.textContent=n),r}function v(t,e){y(t,e)?.remove()}function y(t,e){for(const n of Array.from(t.querySelectorAll(`style[${w}]`)))if(n.getAttribute(w)===e)return n;return null}var E="[data-puck-component]",A="[data-puck-dropzone]",C="iframe#preview-frame";function L(t){const e=t.contentDocument;if(!e||!t.contentWindow||"loading"===e.readyState||!e.body)return!1;if(t.hasAttribute("srcdoc"))return"about:srcdoc"===e.URL;const n=t.getAttribute("src");return!n||"about:blank"===n||"about:blank"!==e.URL}function x(t,e,{selector:n=C,readySelector:o}={}){let r=null,i=null,c=!1,u=!1,l=null;const s=()=>{l?.observer.disconnect(),l=null},a=()=>{if(u)return;let t=null;if(r&&L(r)){const e=r.contentDocument;(t=>{if(!o||t.querySelector(o))return s(),!0;if(l?.doc!==t){s();const e=t.defaultView?.MutationObserver;if(e){const n=new e(()=>a());n.observe(t,{childList:!0,subtree:!0}),l={doc:t,observer:n}}}return!1})(e)&&(t={frame:r,document:e,window:r.contentWindow})}else s();(t===i||!!t&&!!i&&t.frame===i.frame&&t.document===i.document)&&c||(c=!0,i=t,e(i))},d=()=>a(),f=()=>{const e=t.querySelector?.(n);e!==r?(r?.removeEventListener("load",d),r=e,r?.addEventListener("load",d),a()):a()},h=t.ownerDocument?.defaultView??t.defaultView,m=h?.MutationObserver,w=m?new m(t=>(t=>null!==r&&!r.isConnected||t.some(t=>[...t.addedNodes,...t.removedNodes].some(t=>"IFRAME"===t.nodeName||!!t.querySelector?.("iframe"))))(t)&&f()):null;return w?.observe(t,{childList:!0,subtree:!0}),f(),()=>{u=!0,w?.disconnect(),s(),r?.removeEventListener("load",d),r=null}}function M(n,{selector:o,readySelector:r}={}){const[i,c]=t(null);return e(()=>{const t=n.current;if(!t)return;const e=x(t,c,{selector:o,readySelector:r});return()=>{e(),c(null)}},[n,o,r]),i}var R="easel:canvas-typing",S="easel:canvas-typable";function B(t,o,r,{on:i="document",capture:c=!1}={}){const u=n(r);u.current=r;const l=t?.document??null,s=t?.window??null;e(()=>{const t="window"===i?s:l;if(!t)return;const e=t=>u.current(t);return t.addEventListener(o,e,c),()=>t.removeEventListener(o,e,c)},[l,s,o,i,c])}function k(e){const[n,o]=t(!1);return B(e,R,t=>o(Boolean(t.detail?.typing))),n}function W(t,n,o){const r=t?.document??null;e(()=>{if(!r)return;if(!o)return void v(r,n);const t=b(r,n,o),e=r.defaultView?.MutationObserver,i=e?new e(()=>{t.isConnected||b(r,n,o)}):null;return i?.observe(r.head??r.documentElement,{childList:!0}),()=>{i?.disconnect(),v(r,n)}},[r,n,o])}function q(n,{settle:o=[150,450]}={}){const[r,i]=t(0),c=n?.frame??null,u=n?.document??null,l=n?.window??null,s=o.join(",");return e(()=>{if(!c||!u||!l)return;const t=c.ownerDocument.defaultView;let e=!1,n=0;const r=()=>{if(e)return;e=!0;const o=()=>{e=!1,i(t=>t+1)};t?.requestAnimationFrame?n=t.requestAnimationFrame(o):o()},s=[],a=(t,e)=>{t.addEventListener(e,r,!0),s.push(()=>t.removeEventListener(e,r,!0))};a(u,"scroll"),a(l,"resize"),t&&(a(t,"scroll"),a(t,"resize"));const d=t?.ResizeObserver;if(d){const t=new d(r);t.observe(c),u.documentElement&&t.observe(u.documentElement),s.push(()=>t.disconnect())}const f=u.defaultView?.MutationObserver,h=u.body??u.documentElement;if(f&&h){const t=new f(r);t.observe(u===c.ownerDocument?c:h,{childList:!0,subtree:!0}),s.push(()=>t.disconnect())}const m=u.fonts;m&&a(m,"loadingdone");const w=o.map(t=>setTimeout(r,t));return r(),()=>{for(const t of s)t();for(const t of w)clearTimeout(t);n&&t?.cancelAnimationFrame&&t.cancelAnimationFrame(n)}},[c,u,l,s]),r}export{i as BLOCK_ATTRIBUTE,E as BLOCK_SELECTOR,C as CANVAS_SELECTOR,S as CANVAS_TYPABLE_EVENT,R as CANVAS_TYPING_EVENT,A as LIST_SELECTOR,f as clientPointToLayer,u as drawnBox,a as elementScale,m as fitCanvas,h as framePointToHost,s as frameRectToHost,d as frameRectToLayer,l as frameScale,L as isFrameReady,r as isTypingTarget,c as nodeIdAt,v as removeCanvasStyle,p as setCanvasNonce,b as upsertCanvasStyle,B as useCanvasEvent,M as useCanvasFrame,q as useCanvasLayout,W as useCanvasStyle,k as useCanvasTyping,x as watchCanvasFrame};
@@ -1,8 +0,0 @@
1
- import{buildPaletteSections as e,pinnedSection as t,categoryLabel as n}from"./chunk-PA3PNTVV.js";import{blockTypesIn as o}from"./chunk-5ZBY24K7.js";import{sectionTemplatesOf as l}from"./chunk-BVN33R76.js";import{sharedSectionsOf as r}from"./chunk-43AEUUNQ.js";import{SidePanelHead as i,PanelModeExit as s}from"./chunk-SINAM2IT.js";import{blockRuns as c}from"./chunk-M2Z775ZC.js";import{useScreenBlockLook as a,useScreenBlockRules as d,useScreenPinned as p}from"./chunk-PAOZMXEI.js";import{useEaselSession as m}from"./chunk-O7Q4DDJT.js";import{DEFAULT_SCREEN_WORDS as f}from"./chunk-23DYNW6S.js";import{useEasel as u}from"./chunk-EFHV56BO.js";import{easelMenuEntries as y}from"./chunk-FIVU2COQ.js";import{useWords as h}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-LQV5FZTQ.js";import{DEFAULT_DRAG_WORDS as g}from"./chunk-KAML3KQH.js";import{useState as b,useEffect as v,useMemo as j,useRef as w}from"react";import{SharedIcon as C,AddIcon as O}from"efficient-shell/icons/efficient";import{ContextMenu as T,toast as A,Dialog as E,Button as F}from"efficient-shell/ui";import{jsx as I,jsxs as M,Fragment as $}from"react/jsx-runtime";function x({name:e,pages:t,onDelete:n,onCancel:o}){const l=h("screen",f).shared,[r,i]=b(!1),s=w(null);/* @__PURE__ */
2
- return I(E,{open:!0,role:"alertdialog",size:"sm",title:l.deleteTitle({name:e}),onClose:o,initialFocus:s,footer:/* @__PURE__ */M($,{children:[
3
- /* @__PURE__ */I(F,{ref:s,variant:"secondary",onClick:o,children:l.cancel}),
4
- /* @__PURE__ */I(F,{variant:"danger",loading:r,onClick:()=>{(async()=>{i(!0);try{await n()}finally{i(!1)}})()},children:l.deleteShared})]}),children:l.deleteMessage({count:t})})}var N=e=>`section:${e}`,B=e=>`block:${e}`,D=e=>`template:${e}`,L=e=>`shared:${e}`;function Q({at:w,placeBlocks:E,canTake:F,onPick:Q,itemFor:S,session:V,siteWide:H,onClose:P,onHide:Z,readOnly:z}){const W=u(e=>e.config),K=a(),{labelAtLevel:R,categoryLabel:U,firstSection:Y,Icon:_,Thumbnail:G}=K,{blockIsOffered:J,canAddTo:X}=d(),q=h("screen",f).add,ee=h("drag",g).add,te=m(),[ne,oe]=b([]);v(()=>{let e=!1;const t=e=>J(e,te);return l(te).list().then(n=>{if(e)return;const l=W.components;oe(n.filter(e=>e.node?.type&&l[e.node.type]&&o(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[W,te]);const le=p().shared,re=h("screen",f).shared,[ie,se]=b([]),[ce,ae]=b(0);v(()=>{if(!le)return;let e=!1;const t=e=>J(e,te);return r(te).list().then(n=>{if(e)return;const l=W.components;se(n.filter(e=>e.node?.type&&l[e.node.type]&&o(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[W,te,ce]);const[de,pe]=b(null),[me,fe]=b(null),ue=j(()=>e(W,K),[W]),ye=e=>R(e,"section",W.components[e]?.label??e),he=e=>({type:N(e.type),label:e.name,cover:/* @__PURE__ */I(G,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:q.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),ke=e=>{const t=e.indexOf(":"),n=e.slice(0,t),o=e.slice(t+1);if("section"===n)return{kind:"section",type:o};if("block"===n)return{kind:"block",type:o};if("template"===n){const e=ne.find(e=>e.id===o);return e?{kind:"template",template:e}:null}if("shared"===n){const e=ie.find(e=>e.id===o);return e?{kind:"shared",section:e}:null}return null},ge=e=>/* @__PURE__ */I("span",{className:"es-add-glyph-cover",children:/* @__PURE__ */I(_,{type:e,size:26})}),be=j(()=>{const e=t(ue,Y),o=/* @__PURE__ */new Map,l=e=>{e.retired||o.has(e.type)||!J(e.type,te)||o.set(e.type,e)};for(const t of e?[e]:ue){const e=X(t.type)?.choices??[];e.forEach(l),e.forEach(e=>X(e.type,1)?.choices?.forEach(l))}E?.forEach(l);const r=new Set(ue.map(e=>e.type)),i=[...o.values()].filter(e=>!r.has(e.type)),s=e=>({type:B(e.type),label:e.label,cover:ge(e.type),title:q.tile({name:e.label}),keywords:[e.group??"",e.type].filter(Boolean)}),a=e=>o.has(e.type)?{...he(e),cover:ge(e.type)}:he(e),d=[];ie.length>0&&d.push({key:"shared",title:re.group,tiles:ie.map(e=>({type:L(e.id),label:e.title,cover:/* @__PURE__ */I(G,{type:e.node.type}),mark:/* @__PURE__ */I(C,{size:12}),title:re.onPages({count:e.used_on.length}),keywords:[ye(e.node.type),e.node.type]}))}),ne.length>0&&d.push({key:"templates",title:q.templates,tiles:ne.map(e=>({type:D(e.id),label:e.name,cover:/* @__PURE__ */I(G,{type:e.node.type}),keywords:[ye(e.node.type),e.node.type]}))});const p=i.filter(e=>!e.group);let m=!1;for(const t of Object.keys(W.categories??{})){const o=ue.filter(e=>e.cat===t);if(0===o.length)continue;const l=e&&o.some(t=>t.type===e.type)?e:null,r=(l?[l,...o.filter(e=>e.type!==l.type)]:o).map(a);l&&!m&&(r.splice(1,0,...p.map(s)),m=!0),d.push({key:`category:${t}`,title:n(W,t,U),tiles:r})}const f=d.find(e=>e.key?.startsWith("category:"));if(!m&&f&&p.length>0&&(f.tiles=[...f.tiles,...p.map(s)],m=!0),c(i.filter(e=>e.group||!m)).forEach((e,t)=>{d.push({key:`blocks:${t}`,title:e.group??"",tiles:e.items.map(s)})}),!F)return d;const u=d.map(e=>({...e,tiles:e.tiles.map(e=>{const t=ke(e.type),n=t?F(t):null;return n?{...e,disabled:!0,disabledReason:n}:e})})),y=e=>e.tiles.some(e=>!e.disabled);return[...u.filter(y),...u.filter(e=>!y(e))]},[ne,ie,re,ue,W,q,F,E,te]);/* @__PURE__ */
5
- return M($,{children:[
6
- /* @__PURE__ */I(i,{icon:/* @__PURE__ */I(O,{size:15}),title:q.title,context:q.contextAll,actions:/* @__PURE__ */I(s,{label:q.done,description:q.doneDescription,onClick:P}),onHide:Z}),
7
- /* @__PURE__ */M("div",{className:"sf-addside sf-scroll",children:[
8
- /* @__PURE__ */I(k,{groups:be,session:V,itemFor:e=>S(ke(e)??{kind:"section",type:e}),onInsert:Q?e=>{const t=ke(e);t&&Q(t)}:void 0,onTileMenu:(e,t)=>{const n=ke(e);return"shared"===n?.kind&&!z&&(pe({section:n.section,...t}),!0)},at:w,hint:q.hint,searchLabel:q.search,readOnly:z,words:ee}),H??null]}),de?/* @__PURE__ */I(T,{at:{x:de.x,y:de.y},owner:de.owner,onClose:()=>pe(null),"aria-label":de.section.title,items:y([{label:re.deleteShared,danger:!0,onClick:()=>{fe(de.section),pe(null)}}])}):null,me?/* @__PURE__ */I(x,{name:me.title,pages:me.used_on.length,onDelete:()=>(async e=>{try{await r(te).remove(e.id)}catch{return void A.error(re.deleteFailed)}fe(null),le?.removed?.(e),se(t=>t.filter(t=>t.id!==e.id)),ae(e=>e+1)})(me),onCancel:()=>fe(null)}):null]})}export{Q as AddSidePanel,B as blockKey,N as sectionKey,L as sharedKey,D as templateKey};
@@ -1,5 +0,0 @@
1
- import{jsxs as e,jsx as n}from"react/jsx-runtime";function o({title:o,open:i,onToggle:r,count:s,level:a=3,id:t,children:c,className:l}){const d=t?`${t}-body`:void 0;/* @__PURE__ */
2
- return e("div",{className:l?`es-group ${l}`:"es-group",children:[
3
- /* @__PURE__ */n(`h${a}`,{className:"es-group-title",children:/* @__PURE__ */e("button",{type:"button",id:t,"aria-expanded":i,"aria-controls":d,className:"es-group-head",onClick:()=>r(!i),children:[o,"number"==typeof s&&s>0?/* @__PURE__ */n("span",{className:"es-group-count",children:s}):null,
4
- /* @__PURE__ */n("span",{className:"es-group-sign","aria-hidden":"true"})]})}),
5
- /* @__PURE__ */n("div",{id:d,className:"es-group-body",hidden:!i,children:c})]})}var i=Object.freeze(["Design","Animation"]),r=Object.freeze(["Content","Size","Design","Layout","Position","Anchor"]);export{r as DESIGN_GROUPS,i as SETTINGS_BUCKETS,o as SettingsGroup};
@@ -1 +0,0 @@
1
- var e=/* @__PURE__ */Symbol.for("efficient-web.efficient-backend");function n(n){return!!n&&!0===n[e]}function t(e){return e?.trim()||null}var r=null,i=/* @__PURE__ */new WeakMap,o=/* @__PURE__ */new WeakMap;function l(e){r=e}function u(e=k()){if(e.hostBackend)return e.hostBackend;let n=i.get(e);if(!n){const t=o.get(e)??r;if(!t)throw new Error("efficient-web-builder: this editor was given no backend, and its host named no default one. Pass `backend`, or load the host's default backend first (the storefront's is lib/efficient-backend).");n=t(e),i.set(e,n)}return n}function s(e){if(!e.registry)throw new Error("efficient-web-builder: this editor was mounted with no block registry. Pass `registry` to createEditorSession (the storefront's is lib/puck/config).");return e.registry}function d(e={}){const t=e.backend??null,r=null===t?e.defaultBackend??null:null,i=/* @__PURE__ */new Map,l={documentId:null,bridgedId:null},s={hostBackend:t,usesBridgedToken:null===t||n(t),blocks:e.blocks??null,registry:e.registry??null,chrome:e.chrome??null,documentHooks:e.documentHooks??null,claimsPage:e.claimsPage??!0,hostFailures:e.hostFailures??null,auth:{token:null,brandId:null},site:l,siteId:()=>l.documentId??l.bridgedId,cache:(e,n)=>(i.has(e)||i.set(e,n()),i.get(e)),forget(e){void 0===e?i.clear():i.delete(e)}};return r&&(o.set(s,r),Object.defineProperty(s,"usesBridgedToken",{get:()=>n(u(s)),enumerable:!0})),s}function c(e,n){e.site.documentId=t(n)}function a(e,n){e.site.bridgedId=t(n)}var f=d(),b=null,g=/* @__PURE__ */new Set;function k(){return b??f}function h(e){e.claimsPage&&(g.delete(e),b=e)}function m(e){e.claimsPage&&(g.add(e),queueMicrotask(()=>{g.delete(e)&&b===e&&(b=null)}))}function w(){return k().usesBridgedToken}function y(){f=d()}export{e as EFFICIENT_BACKEND,h as activateEaselSession,u as backendOf,d as createEaselSession,k as currentEaselSession,m as deactivateEaselSession,w as efficientClientOpen,n as isEfficientBackend,l as provideDefaultBackend,y as resetAmbientEaselSession,s as sessionRegistry,a as setSessionBridgedSite,c as setSessionDocumentSite};
@@ -1 +0,0 @@
1
- import{isPreviewClick as t}from"./chunk-R5L2E7JX.js";import{HERO_SLIDER_GOTO_EVENT as n}from"./chunk-IQ5TA7AM.js";import{queryMainCopy as o}from"./chunk-LF3FUSCQ.js";var e=()=>document.querySelector(".sf-editor #preview-frame");function r(n){t()||requestAnimationFrame(()=>{const t=e()?.contentDocument;t&&o(t,`[data-puck-component="${CSS.escape(n)}"]`)?.scrollIntoView({behavior:"smooth",block:"start"})})}function c(t,o){const r=e()?.contentWindow;if(!r)return;const c={id:t,index:o};r.dispatchEvent(new CustomEvent(n,{detail:c}))}function i(){requestAnimationFrame(()=>{e()?.contentWindow?.scrollTo({top:0,behavior:"smooth"})})}function u(t,{passes:n=[150,400],onPinned:o}={}){let r=0,c=!1;const i=[],u=()=>{const r=e(),s=r?.contentWindow,l=r?.contentDocument;if(!s||!l)return!1;const m=t(s,l);if(null==m)return!1;if(s.scrollTo({left:s.scrollX,top:m,behavior:"instant"}),!c){c=!0,o?.();for(const t of n)i.push(setTimeout(u,t))}return!0},s=()=>{!u()&&r++<150&&i.push(setTimeout(s,32))};return s(),()=>i.forEach(clearTimeout)}function s(t){return u((n,e)=>{const r=o(e,`[data-puck-component="${CSS.escape(t)}"]`);return r?n.scrollY+r.getBoundingClientRect().top:null})}function l(t){return u((t,n)=>{if(!n.querySelector("[data-puck-component]"))return null;const o=Math.max(n.documentElement.scrollHeight,n.body?.scrollHeight??0);return o<=n.documentElement.clientHeight?null:o},{passes:[150,400,800,1300,2e3],onPinned:t})}export{c as gotoPreviewSlide,l as pinPreviewToBottom,s as pinPreviewToSection,e as previewFrame,r as scrollPreviewToSection,i as scrollPreviewToTop};
@@ -1,8 +0,0 @@
1
- import{isValidElement as e}from"react";import{jsxs as l,jsx as s,Fragment as i}from"react/jsx-runtime";import{Segmented as a,Tooltip as n}from"efficient-shell/ui";function d(l){return Array.isArray(l)?l.some(d):e(l)}function r({label:e,labelId:a,icon:n,value:r,hint:c,changed:t,htmlFor:o,action:h,children:m,className:u}){const f=d(m),p=d(h);if(!f&&!p)return null;const b=["es-field"];f||b.push("is-inline"),t&&b.push("is-changed"),u&&b.push(u);const N=/* @__PURE__ */l(i,{children:[n?/* @__PURE__ */s("span",{className:"es-field-icon","aria-hidden":"true",children:n}):null,
2
- /* @__PURE__ */s("span",{className:"es-field-label",id:a,children:e})]});/* @__PURE__ */
3
- return l("div",{className:b.join(" "),children:[
4
- /* @__PURE__ */l("div",{className:"es-field-head",children:[o?/* @__PURE__ */s("label",{className:"es-field-name",htmlFor:o,children:N}):/* @__PURE__ */s("span",{className:"es-field-name",children:N}),null!=r?/* @__PURE__ */s("span",{className:"es-field-value",children:r}):null,p?h:null]}),f?/* @__PURE__ */s("div",{className:"es-field-ctl",children:m}):null,c?/* @__PURE__ */s("p",{className:"es-field-hint",children:c}):null]})}function c({options:e,value:i,onChange:d,ariaLabel:r,fit:c,disabled:t=!1,className:o}){const h=c&&function(e,l){return{"--es-fit-count":e,"--es-fit-labels":`${l.labelsPx}px`,"--es-fit-widest":`${l.widestLabelPx}px`}}(e.length,c),m=e.findIndex(e=>e.id===i);
5
- /* @__PURE__ */
6
- return s("div",{className:"es-segs-fit","data-disabled":t||void 0,style:h,children:/* @__PURE__ */s(a,{size:"sm",label:r,className:`es-segs${h?" is-measured":""}${o?` ${o}`:""}`,value:m<0?"":String(m),onChange:l=>d(e[Number(l)].id),options:e.map((e,i)=>{const a=e.title??("string"==typeof e.label?e.label:void 0),d="string"!=typeof e.label,r=l=>a&&(e.icon||d)?/* @__PURE__ */s(n,{content:a,children:l}):l;return{value:String(i),disabled:t||!0===e.disabled,icon:e.icon?r(
7
- /* @__PURE__ */s("span",{className:"es-seg-icon","aria-hidden":"true",children:e.icon})):void 0,label:d?/* @__PURE__ */l("span",{className:"es-seg-word",children:[r(/* @__PURE__ */s("span",{"aria-hidden":"true",children:e.label})),
8
- /* @__PURE__ */s("span",{className:"es-vh",children:a})]}):/* @__PURE__ */s("span",{className:"es-seg-word",children:e.label})}})})})}export{r as SettingsField,c as SettingsSegmented};
@@ -1 +0,0 @@
1
- import{useScreenBlockRules as e}from"./chunk-PAOZMXEI.js";import{useEasel as t,useEaselApi as n}from"./chunk-EFHV56BO.js";import{newNodeId as o,ROOT_ZONE as r}from"./chunk-PLVEGYK6.js";import{useMemo as s}from"react";function i(i={}){const{dispatch:p}=t(e=>e),d=n(),c=!0===i.readOnly,a=e().resolveOnInsert,l=!0===(i.resolveOnInsert??a),m=!0===i.foldIntoHistory;return s(()=>{const e=m?e=>p({...e,recordHistory:!1}):p,t=(t,n,r)=>{const s=o(n);return c||e({type:"insert",componentType:n,destinationZone:t,destinationIndex:r,id:s}),s},n=e=>(l&&!c&&d.resolveNode(e,{trigger:"insert"}),e),s=(t,n,o)=>{c||e({type:"replace",destinationZone:t,destinationIndex:n,data:o})},i=(e,o,r)=>n(t(e,o,r));return{insertComponent:i,insertSection:(e,t)=>i(r,e,t),replaceComponent:s,seedChild:(e,o,r,i)=>{const p=t(e,r,o);s(e,o,{type:r,props:{id:p,...i}}),n(p)},insertNode:(e,o,r)=>{const i=t(e,r.type,o);return s(e,o,{type:r.type,props:{...r.props,id:i}}),n(i)},removeComponent:(t,n)=>{c||e({type:"remove",index:n,zone:t})},reorderComponent:(t,n,o)=>{c||e({type:"reorder",sourceIndex:n,destinationIndex:o,destinationZone:t})},duplicateComponent:(t,n)=>{c||e({type:"duplicate",sourceIndex:n,sourceZone:t})},select:e=>p({type:"setUi",ui:{itemSelector:e}}),setDocument:t=>{c||e({type:"setData",data:t})},commitDocument:(t,n)=>{c||(m?d.batch(()=>{e({type:"setData",data:t}),void 0!==n&&("slot"===n?.kind?d.selectSlot({parentId:n.parentId,slot:n.slot}):d.select(n?n.id:null))}):d.run({data:t,select:n}))}}},[p,c,l,d,m])}export{i as useSectionOps};
@@ -1 +0,0 @@
1
- var e={less:"Less",more:"More",choose:"Choose",search:"Search",noMatches:"No matches",list:{item:"item",itemName:({noun:e,n:o})=>{return`${t=e,t?t[0].toUpperCase()+t.slice(1):t} ${o}`;var t},position:({n:e,total:o})=>`${e} of ${o}`,duplicate:"Duplicate",duplicateItem:({noun:e})=>`Duplicate ${e}`,deleteItem:({noun:e})=>`Delete ${e}`,add:({noun:e})=>`+ Add ${e}`,addHere:({noun:e})=>`Add ${e} here`,moveUp:"Move up",moveDown:"Move down",delete:"Delete",locked:"This one cannot be removed",moved:({n:e,total:o})=>`Moved to ${e} of ${o}`}};export{e as DEFAULT_FIELDS_WORDS};
@@ -1,65 +0,0 @@
1
- import{cloneNodeWithFreshIds as e}from"./chunk-2GVCAIPX.js";import{dedupeSlotChildren as n}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as t}from"./chunk-JBOSEHIX.js";import{markedTreeNodeId as o,revealSelectedTreeRow as r,sameSelector as i}from"./chunk-FGNR22NY.js";import{scrollPreviewToSection as l,gotoPreviewSlide as s,scrollPreviewToTop as d}from"./chunk-TNGOL65V.js";import{useEaselKeyTarget as a,useEaselUndoKeys as c,useEaselSaveKey as p,editorRootFocus as u}from"./chunk-I7BROL77.js";import{SlotChildActionsProvider as h}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as f,DEFAULT_PANEL_W as m,clampPanelWidth as g}from"./chunk-C56MPJBH.js";import{usePartBridge as y}from"./chunk-MEHLY5Q4.js";import{useSectionOps as v}from"./chunk-WEIE2FBC.js";import{ScreenSaveIcon as k,ScreenMainButton as b}from"./chunk-PY7OOQEZ.js";import{useBrowserOffline as S}from"./chunk-RKTF5XLP.js";import{AddChildRow as w}from"./chunk-5545A3PC.js";import{AddSidePanel as x}from"./chunk-R5KEFI55.js";import{keepsSharedSections as z,sharedSectionsOf as C}from"./chunk-43AEUUNQ.js";import{PanelHideButton as I,SidePanelHead as N,PanelShowStrip as O}from"./chunk-SINAM2IT.js";import{offeredChoices as B}from"./chunk-M2Z775ZC.js";import{useScreenSaveSwitch as P,useScreenNodeKeys as $,useScreenPinned as M,useScreenDocumentLabel as j,useScreenCanvasFrame as A,useScreenInspectorPanel as L,useScreenDevices as T,useScreenPickFollowsSelection as E,useScreenLeftView as R,SELECTION_MODE as F,sameInspectorMode as D,useScreenBridges as H,useScreenBlockRules as V,useScreenBlockLook as W,useScreenStorageNamespace as U,useScreenNotify as J,useScreenCanvasHead as Y,isSlotMode as G,useScreenStyleClipboard as K,useScreenDocumentPass as Q,useScreenCanvasDrag as Z,ScreenCanvasTargetProvider as X,isPinnedFirst as _,isPinnedLast as q,screenSlotsOf as ee}from"./chunk-PAOZMXEI.js";import{MediaPopup as ne}from"./chunk-2G6MAXPY.js";import{useNodeClipboard as te,useNodeContextMenu as oe}from"./chunk-6FWAE2RN.js";import{PageEditGuardNotices as re}from"./chunk-UJ46J7QW.js";import{useScreenDocument as ie}from"./chunk-276MBG5P.js";import{requestMediaPick as le}from"./chunk-UNVKPVZW.js";import{useMediaPanel as se,usePanelPick as de,useMediaBrowsing as ae,useOpenMediaBrowse as ce,useMediaPlace as pe}from"./chunk-FHCKFOCD.js";import{useEaselSession as ue}from"./chunk-O7Q4DDJT.js";import{useEaselHost as he,useHostEscape as fe}from"./chunk-MQA7OFRA.js";import{LayersIcon as me,MediaIcon as ge}from"./chunk-XFYFKITX.js";import{DEFAULT_SCREEN_WORDS as ye}from"./chunk-23DYNW6S.js";import{heldStyle as ve,styleShortcut as ke}from"./chunk-V7U33NF2.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as be}from"./chunk-6WY6ZXJG.js";import{useEasel as Se,useEaselApi as we,CanvasPassThroughContext as xe,CanvasSharedContext as ze}from"./chunk-EFHV56BO.js";import{TreeRow as Ce,Subtree as Ie,LayersTree as Ne,TreeGroupLabel as Oe,TreeRowAction as Be,TreeSeam as Pe}from"./chunk-A6Z4SD3I.js";import{DEFAULT_TREE_WORDS as $e}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as Me}from"./chunk-WK3AFPXY.js";import{toItemSelector as je,useNodeOps as Ae,clickPick as Le}from"./chunk-BSHIQIZC.js";import{EaselTopBar as Te,EaselIconButton as Ee,TopBarCluster as Re,DeviceSwitch as Fe,InspectorIconButton as De,PanelResizeHandle as He,MAX_PANEL_W as Ve,MIN_PANEL_W_BY_SIDE as We,panelWidthVars as Ue}from"./chunk-ZG6PVMC3.js";import{DEFAULT_NOTICE_WORDS as Je,DEFAULT_CHROME_WORDS as Ye}from"./chunk-AJSDWWJW.js";import{holderOf as Ge,nameOrSomeone as Ke}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as Qe}from"./chunk-RE4LP46F.js";import{useWords as Ze}from"./chunk-MFIRYGHW.js";import{insertSeams as Xe,CanvasDragLayer as _e,CanvasInsert as qe}from"./chunk-LQV5FZTQ.js";import{DEFAULT_DRAG_WORDS as en}from"./chunk-KAML3KQH.js";import{createDragSession as nn,useTreeDrag as tn,gapToMoveIndex as on}from"./chunk-3S5N4HLJ.js";import{ROOT_ID as rn,ROOT_SLOT as ln,zoneKey as sn,parseZoneKey as dn,find as an,DataError as cn}from"./chunk-K7BTCBWD.js";import{useCanvasFrame as pn,LIST_SELECTOR as un,BLOCK_SELECTOR as hn,useCanvasTyping as fn,useCanvasEvent as mn,nodeIdAt as gn,frameRectToHost as yn,BLOCK_ATTRIBUTE as vn,drawnBox as kn}from"./chunk-QIDRJH3S.js";import{rootRowName as bn,slotChildRowName as Sn,slotChildRenameProp as wn,sectionRenameProp as xn}from"./chunk-BHRC3ASL.js";import{ROOT_ZONE as zn,blockNodeActions as Cn,TREE_MAX_DEPTH as In,childSlotsOf as Nn,slotFieldsOf as On,newNodeId as Bn,slotChildrenIn as Pn,nestsInTree as $n}from"./chunk-PLVEGYK6.js";import{queryMainCopy as Mn}from"./chunk-LF3FUSCQ.js";import{useRef as jn,useMemo as An,useState as Ln,useEffect as Tn,useCallback as En,useLayoutEffect as Rn,Fragment as Fn,useId as Dn}from"react";import{ColoredBadge as Hn,Button as Vn,Tabs as Wn,toast as Un,readMediaFileDrag as Jn,Tooltip as Yn,groupColors as Gn,Dialog as Kn,FormField as Qn,Input as Zn,MEDIA_FILE_DRAG_TYPE as Xn}from"efficient-shell/ui";import{UndoIcon as _n,RedoIcon as qn,RefreshIcon as et,AddIcon as nt,TrashIcon as tt,EyeOffIcon as ot,EyeIcon as rt,SharedIcon as it,DuplicateIcon as lt}from"efficient-shell/icons/efficient";import{jsx as st,jsxs as dt,Fragment as at}from"react/jsx-runtime";var ct="media-file";function pt({name:e,onMake:n,onCancel:t}){const o=Ze("screen",ye).shared,[r,i]=Ln(e),[l,s]=Ln(!1),d=Dn(),a=jn(null),c=async()=>{const e=r.trim();if(e&&!l){s(!0);try{await n(e)}finally{s(!1)}}};/* @__PURE__ */
2
- return st(Kn,{open:!0,size:"sm",title:o.makeShared,description:o.makeSharedHint,onClose:t,initialFocus:a,footer:/* @__PURE__ */dt(at,{children:[
3
- /* @__PURE__ */st(Vn,{variant:"secondary",onClick:t,children:o.cancel}),
4
- /* @__PURE__ */st(Vn,{variant:"primary",loading:l,disabled:!r.trim(),onClick:()=>{c()},children:o.makeShared})]}),children:/* @__PURE__ */st("form",{onSubmit:e=>{e.preventDefault(),c()},children:/* @__PURE__ */st(Qn,{label:o.name,htmlFor:d,children:/* @__PURE__ */st(Zn,{id:d,ref:a,value:r,onChange:e=>i(e.target.value)})})})})}var ut=/* @__PURE__ */new WeakSet;function ht(e,n,t){const o=an(e,n,t);if(!o)return null;const r=o.path.find(e=>"root"!==e.parentId);return r?r.parentId:t}function ft({canvas:e,tabs:n,onSelect:t}){const o=jn(null),[r,i]=Ln({}),l=n.map(e=>`${e.id}:${e.below?1:0}`).join("|");return Rn(()=>{const t=e?.document,r=e?.window,l=e?.frame;if(!t||!r||!l||0===n.length)return void i({});let s=0;const d=()=>{s=0;const e=o.current;if(!e)return;const d=yn(l,{left:0,top:0,width:r.innerWidth,height:r.innerHeight},e),a={};for(const o of n){const n=Mn(t,`[${vn}="${r.CSS?.escape?r.CSS.escape(o.id):o.id}"]`),i=n?kn(n):null;if(!i||0===i.height){a[o.id]=null;continue}const s=yn(l,{left:i.left,top:i.top,width:i.width,height:i.height},e),c=s.top+s.height;if(c<d.top||s.top>d.top+d.height){a[o.id]=null;continue}const p=o.below?c+4:Math.max(s.top,d.top)+6;a[o.id]={left:Math.max(s.left,d.left)+6,top:p}}i(a)},a=()=>{s||(s=r.requestAnimationFrame(d))};d(),r.addEventListener("scroll",a,!0),r.addEventListener("resize",a);const c=new r.MutationObserver(a);return c.observe(t.body,{childList:!0,subtree:!0,attributes:!0}),()=>{s&&r.cancelAnimationFrame(s),r.removeEventListener("scroll",a,!0),r.removeEventListener("resize",a),c.disconnect()}},[e,l]),/* @__PURE__ */st("div",{ref:o,className:"es-band-tabs","aria-hidden":"true",children:n.map(e=>{const n=r[e.id];return n?/* @__PURE__ */st("span",{className:"es-band-tab","data-band-tab":e.id,style:{left:n.left,top:n.top},onClick:n=>{n.stopPropagation(),t(e.id)},children:e.reach?
5
- /* @__PURE__ */st(Yn,{content:e.reach,children:/* @__PURE__ */dt(Hn,{colorClass:Gn("success","solid"),size:"sm",children:[
6
- /* @__PURE__ */st("span",{className:"es-band-tab-mark",children:/* @__PURE__ */st(it,{size:12})}),e.label]})}):/* @__PURE__ */st(Hn,{colorClass:Gn("info","solid"),size:"sm",children:e.label})},e.id):null})})}function mt({expand:e}){/* @__PURE__ */
7
- return st("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */dt(at,e?{children:[
8
- /* @__PURE__ */st("path",{d:"M8 9l4-4 4 4"}),
9
- /* @__PURE__ */st("path",{d:"M8 15l4 4 4-4"})]}:{children:[
10
- /* @__PURE__ */st("path",{d:"M8 4l4 4 4-4"}),
11
- /* @__PURE__ */st("path",{d:"M8 20l4-4 4 4"}),
12
- /* @__PURE__ */st("path",{d:"M5 12h14"})]})})}var gt=`${un}, ${hn}`;function yt(e,n,t){const o=t-n;if(o<6)return null;if(o<24)return{top:Math.round((n+t)/2),height:Math.round(o)};return{top:Math.round(Math.min(Math.max(e,n+12),t-12))}}var vt="__rungs";var kt="screen:band",bt={duplicate:!0,delete:!0},St=()=>null;function wt(){const un=he(),yn=un.panels?.Toolbar,vn=(un.panels?.useRight??St)(),{target:kn,docId:Dn,capabilities:Yn,currentSlug:Gn,siteId:Kn,onPublish:Qn,saveState:Zn,saveConflict:it,retrySave:wt,toggleAutoSave:xt,flushSave:zt,access:Ct,saveUnreachable:It=!1,readOnly:Nt,readOnlyReason:Ot=null}=ie(),Bt=P(),Pt=$(),{mediaEditing:$t,hasEditGuard:Mt,hasPinnedChrome:jt}=Yn,{appState:At,dispatch:Lt,history:Tt,selectedItem:Et,getSelectorForId:Rt,config:Ft}=Se(e=>e),Dt=M(),{first:Ht,firstGroup:Vt,lastGroup:Wt,isSectionGroup:Ut,sectionGroupZone:Jt,panelOf:Yt}=Dt,Gt=Yt(Ht),Kt=e=>_(Dt,e),Qt=e=>q(Dt,e),Zt="node"===Dt.firstRow,Xt=Dt.band??null,_t=Ze("screen",ye),qt=Ze("tree",$e),eo=Ze("drag",en),no=Ze("notice",Je),to=Ze("lock",Qe),oo=Ze("menu",Me),ro=Ze("styleClipboard",be),io=Ze("chrome",Ye),lo=j()??`/${Gn}`,so=A(),ao=L(),co=v({readOnly:Nt}),po=v({readOnly:Nt,foldIntoHistory:!0}),uo=jn(null),ho=we(),fo=An(()=>({...co,select:e=>{uo.current=e,co.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=ho.config;uo.current=je(e,t,n)}co.commitDocument(e,n)}}),[co,ho]),mo=At.ui,go=mo.leftSideBarVisible,yo=mo.rightSideBarVisible,{options:vo,widths:ko,initial:bo,fluid:So,fit:wo}=T(),[xo,zo]=Ln(bo),Co=se(),Io=$t&&null!==Co;de(),ae();const No=ce();E(Et?.props.id);const{read:Oo,write:Bo,forSelection:Po}=R(),[$o,Mo]=Ln(Oo);Tn(()=>{Bo($o)},[$o]);const[jo,Ao]=Ln(0),Lo=jn(null),To=jn(null),Eo=pn(To,{readySelector:gt}),Ro=fn(Eo),Fo=a(To);c(To,Eo);const Do=S(),Ho=Ge(Ct),Vo={state:Zn,offline:Do||Zn.failed&&It,readOnlyReason:Ot,editing:Ho?no.editing({name:Ke(Ho.name,to),noun:_t.noun}):null,conflict:null!=it,notSaving:_t.bar.notSaving},Wo=()=>{Nt||(Zn.failed?wt():zt())};p(To,Eo,Wo);const[Uo,Jo]=Ln(!1),Yo=jn(!1),[Go,Ko]=Ln(null),[Qo,Zo]=Ln([]),[Xo,_o]=Ln(F),qo="puck"===Xo.kind,er=o(Xo,Et?.props.id),[nr,tr]=Ln(null);Tn(()=>{nr&&(r(),tr(null))},[nr]);const or=jn(Rt);or.current=Rt;const rr=En((e,{scroll:n})=>{Mo(n=>Po(e,n)),n&&tr(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=or.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&jr(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),ir=jn(null);Tn(()=>{const e=ir.current;ir.current=null;const n=null==Et?.props.id?null:String(Et.props.id);_o(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:Yt(Et?.type)??F);const t=Et?.props.id,o=uo.current;if(uo.current=null,!t)return;const r=Rt(t);rr(String(t),{scroll:!i(o,r??null,zn)})},[Et?.props.id,rr]);const lr=En(e=>{_o(n=>D(n,e)?n:e),Lt({type:"setUi",ui:{rightSideBarVisible:!0}})},[Lt]),sr=jn(()=>{});sr.current=(e,n)=>{const t=e?Bi(e.zone??zn)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==Et?.props.id?null:String(Et.props.id);_o(e=>D(e,n)?e:n),o!==r&&(ir.current={id:o,mode:n},fo.select(e))};const dr=En((e,n)=>sr.current(e,n),[]),ar={kind:Xo.kind,mode:Xo,open:lr,show:e=>_o(e),reveal:()=>{yo||Lt({type:"setUi",ui:{rightSideBarVisible:!0}})},select:dr},cr=H(ar,{data:At.data,selected:Et??null,zoneOf:e=>Rt(e)?.zone,readOnly:Boolean(Nt),select:e=>{_o(F),fo.select({index:e})},replace:(e,n)=>fo.replaceComponent(zn,e,n),scrollTo:e=>l(e)},{device:xo,refreshes:jo},{setView:Mo,reveal:()=>{go||Lt({type:"setUi",ui:{leftSideBarVisible:!0}})}}),pr=cr.resolveLeftView?cr.resolveLeftView($o):"sections",ur=V(),{isLockedBlock:hr,duplicateBlocked:fr,nestDepth:mr,newSectionNode:gr,canAddTo:yr,blockIsOffered:vr}=ur,kr=W(),{labelAtLevel:br,Icon:Sr,useProducts:wr}=kr,xr=kr.rowName?(e,n,t)=>kr.rowName(e,n,t):void 0,zr=En(e=>{Lt({type:"setUi",ui:{rightSideBarVisible:!0}}),l(e),rr(e,{scroll:!0})},[Lt,rr]),{selectNode:Cr,openPartId:Ir}=y({mode:Xo,setMode:_o,onOpenPart:zr}),[Nr,Or]=Ln(null);fe(null!==Nr,()=>Or(null));const Br=f(U()),Pr=Br.collapsed,$r=Br.panelWidths,[Mr,jr]=Ln(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(Pr);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
13
- return new Set}});Tn(()=>{try{window.localStorage.setItem(Pr,JSON.stringify([...Mr]))}catch{}},[Mr]);const[Ar,Lr]=Ln(()=>{if("undefined"==typeof window)return{...m};try{const e=window.localStorage.getItem($r);if(!e)return{...m};const n=JSON.parse(e);return{left:g(Number(n.left)||m.left,"left"),right:g(Number(n.right)||m.right,"right")}}catch{return{...m}}});Tn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem($r,JSON.stringify(Ar))}catch{}},300);return()=>clearTimeout(e)},[Ar]);const Tr=En((e,n)=>Lr(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Er=En(e=>Tr("left",e),[Tr]),Rr=En(e=>Tr("right",e),[Tr]),Fr=e=>Mr.has(e),Dr=e=>jr(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Hr=jn(!1),Vr=jn(null);Tn(()=>{if(Hr.current&&!Uo){const e=Vr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??To.current?.querySelector(`button[aria-label="${CSS.escape(_t.add.title)}"]`))?.focus(),Vr.current=null}Hr.current=Uo},[Uo]),Tn(()=>{if(!Uo||!Fo)return;const e=e=>{"Escape"===e.key&&sl()};return Fo.addEventListener("keydown",e),()=>Fo.removeEventListener("keydown",e)},[Uo,Fo]),fe(Uo,()=>sl()),Tn(()=>{!go&&Uo&&(Jo(!1),Ko(null),Yo.current=!1)},[go]);const Wr=J(),Ur=(e,n="success",t)=>{if(Wr)return void(t?Wr(e,"error"===n?"error":"info",t):Wr(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?Un.error(e,{...o,duration:t?.duration??3200}):Un.success(e,{...o,duration:t?.duration??1900})},Jr=jn(null),[Yr,Gr]=Ln(0),[Kr,Qr]=Ln(0),Zr=Y(),Xr=jn(null),_r=e=>Math.max(0,e.clientHeight-(Xr.current?.offsetHeight??0));Tn(()=>{const e=Jr.current;if(!e)return;const n=()=>{Gr(e.clientWidth),Qr(_r(e))};n();const t=new ResizeObserver(n);return t.observe(e),Xr.current&&t.observe(Xr.current),()=>t.disconnect()},[]),Rn(()=>{Jr.current&&(Gr(Jr.current.clientWidth),Qr(_r(Jr.current)))},[Ar,go,yo]);const qr=xo===So?Yr>0?Yr:ko[So]:ko[xo],ei=Yr>0?Math.min(Yr/qr,"shrink"===wo?1:2):1,ni=qr*ei,ti=Yr>0&&ni>Yr+1,oi={width:ni,height:Kr||"100%",flex:"none",position:"relative"},ri={width:qr,height:Kr?Kr/ei:"100%",maxHeight:"none",transform:1!==ei?`scale(${ei})`:void 0,transformOrigin:"top left"},ii=()=>Lt({type:"setUi",ui:{leftSideBarVisible:!go}}),li=()=>Lt({type:"setUi",ui:{rightSideBarVisible:!yo}}),si=e=>{Uo&&(Jo(!1),Ko(null),Yo.current=!1,go&&$o===e)||(Mo(e),go||Lt({type:"setUi",ui:{leftSideBarVisible:!0}}))},di=()=>{_o(F),fo.select(null),d()},ai=()=>{_o(Gt??F),yo||Lt({type:"setUi",ui:{rightSideBarVisible:!0}})},ci=At.data.content??[],pi=()=>{const e=ci.findIndex(Kt),n=ci.findIndex(Qt);return{floor:e>=0?e+1:0,cap:n>=0?n:ci.length}},ui=Ft,hi=ur.stripCopy,fi=n=>e(n,hi),mi=te(),gi=Ae({data:At.data,config:ui,readOnly:Boolean(Nt),clipboard:mi,strip:hi?e=>hi(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==rn||e.slot!==ln)return{min:0,max:n-1};const{floor:t,cap:o}=pi();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&_o(F);const t=void 0===n||"node"===n?.kind?n:null;fo.commitDocument(e,t)}}),yi=ue(),[vi,ki]=Ln(null),bi=e=>{const n=ci.find(n=>String(n.props.id)===e),t=Dt.shared;n&&t&&gi.swap(e,t.detach(n))},Si=e=>{const n=an(At.data,Ft,e);if(!n)return!1;const t=sn(n.place),o=n.node,r=t===zn?Ii(o):Di(o),i=t===zn?Dt.shared?.usedOn(o):null;return!!gi.remove(e)&&(Ur(i?_t.shared.removed({count:Math.max(0,i.length-1)}):_t.deleted({name:r}),"success",{duration:8e3,action:{label:_t.bar.undo,onClick:()=>{gi.restore(n.node,n.place)}}}),!0)},wi={...gi,remove:Si},xi=e=>br(e,"block",Ft.components[e]?.label??e),zi=En(e=>Ft.components[e]?.defaultProps??{},[Ft]),Ci=e=>br(e,"section",xi(e)),Ii=e=>bn({type:e.type,props:e.props??{}},Ci(e.type),xr),{nodeAddresses:Ni,zoneItems:Oi}=An(()=>{const e=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map,t=(o,r,i)=>{n.set(r,o),o.forEach((n,o)=>{const l=String(n.props?.id??"");if(l&&e.set(l,{zone:r,index:o}),i>=In)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of Nn(Ft,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(ci,zn,0),{nodeAddresses:e,zoneItems:n}},[ci,Ft]),Bi=En(e=>Oi.get(e)??[],[Oi]),Pi=e=>{const n=Ni.get(e);return n?Bi(n.zone)[n.index]:void 0},$i=e=>ee(ur,Ft,e),Mi=e=>{if(!ur.slotsOf||e===zn)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=Pi(e.slice(0,n));if(!t)return null;const o=$i(t).filter(e=>e.rung),r=o.findIndex(t=>t.slot===e.slice(n+1));return r<0?null:{node:t,slot:o[r],position:r}},ji=(()=>{if(!G(Xo))return null;const e=`${Xo.nodeId}:${Xo.slot}`;return Mi(e)?.slot.panel===Xo.kind?e:null})(),Ai=jn(null);Tn(()=>{const e=Ai.current;if(Ai.current=null,!ji||!G(Xo))return;const n=Xo.nodeId;rr(n,{scroll:e!==ji}),jr(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[Xo]);const Li=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=Ni.get(e);n&&(n.zone===zn?el(n.index):Nl(n.zone,n.index,e,Pi(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&ji!==i&&(Ai.current=i),dr(null,r),yo||Lt({type:"setUi",ui:{rightSideBarVisible:!0}}),l(o)},Ti=(e,n,t)=>{const o=`${e}:${n}`;if(jr(n=>{if(!n.has(o)&&!n.has(e))return n;const t=new Set(n);return t.delete(o),t.delete(e),t}),!t)return;ji!==o&&(Ai.current=o);dr(null,{kind:t,nodeId:e,slot:n})},Ei=(e,n,t)=>{if(Nt||!ur.moveSlot)return;const o=Pi(e),r=o?$i(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:vt,index:n},s=on(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=ur.moveSlot(e,n,s);"string"==typeof d&&Ti(e,d,i.panel)},Ri=wr(),Fi=An(()=>{const e=/* @__PURE__ */new Map;for(const n of Ri??[])e.set(n.slug,n.name);return e},[Ri]),Di=e=>Sn(e,xi,kr.plainText,e=>Fi.get(e),kr.rowName),Hi=(e,n)=>{const t=Ft.components[e.type]?.fields,o=n===zn||ql(n)?"section":"block",r=n===zn&&(Kt(e)||Qt(e)||Ut(e.type)),i="block"===o?wn(t):r?null:xn(t);return kr.renamePropOf?kr.renamePropOf(e,o,i):i},Vi=(e,n,t,o)=>{if(!(!Nt&&Nr?.zone===e&&Nr.index===n))return;const r=(t,o)=>{Or(null),o&&((e,n,t)=>{const o=Bi(e)[n];if(!o)return;const r=Hi(o,e);r&&fo.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
14
- return st("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":_t.rename,onClick:e=>e.stopPropagation(),onBlur:e=>r(e.currentTarget.value,!0),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),r(e.currentTarget.value,!0)):"Escape"===e.key&&(e.preventDefault(),r("",!1))}},t)},Wi=t(K(),ro),Ui=Wi.scope({target:kn,siteId:Kn,docId:Dn}),Ji=Ft,Yi=(e,n)=>n===zn?Ci(e):xi(e),Gi=(e,n,t)=>{const o=Wi.plan(Ui,t,Yi(t.type,e),Ji);o&&(o.changed&&fo.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Ur(o.message))},Ki=oe({nodesIn:Bi,nodeAt:(e,n)=>Bi(e)[n]??null,labelOf:(e,n)=>n===zn?Ci(e):xi(e),renamePropOf:Hi,beginRename:(e,n)=>Or({zone:e,index:n}),history:{hasPast:Tt.hasPast,hasFuture:Tt.hasFuture,back:()=>Tt.back(),forward:()=>Tt.forward()},openPageSettings:()=>{fo.select(null),_o(F)},pageSettingsLabel:_t.pageSettings,words:{menu:oo,styleClipboard:ro,screen:_t.menu},readOnly:Boolean(Nt),collapseAll:()=>jr(new Set(Bi(zn).map(e=>String(e.props.id)))),onPasteRefused:e=>Ur(e?_t.pasteRefused({name:e.label}):_t.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>ts(e,n),menuRows:(e,n,t)=>{const o=cr.menuRows?.(e,n,t)??null,r=((e,n)=>{const t=Dt.shared;if(!t||n!==zn)return null;const o=t.usedOn(e);if(o){const n={pick:[{label:_t.shared.onPages({count:o.length}),onClick:()=>{},children:o.map(e=>({label:e.title,onClick:()=>t.openPage(e)}))}]};return Nt||hr(e.type,e)?n:{...n,change:[{label:_t.shared.detach,onClick:()=>bi(e.props.id)}],remove:[{label:_t.shared.removeFromPage,danger:!0,onClick:()=>{Si(e.props.id)}}]}}return Nt||Kt(e)||Qt(e)||Ut(e.type)?null:z(yi)?{change:[{label:_t.shared.makeShared,onClick:()=>ki({id:e.props.id,name:Ii(e)})}]}:null})(e,n);if(!r)return o;return Object.fromEntries(["pick","make","change","remove"].map(e=>[e,[...o?.[e]??[],...r[e]??[]]]).filter(([,e])=>e.length>0))},isLocked:e=>hr(e.type,e),duplicateBlocked:e=>fr(At.data,e),permits:e=>{const n=Cn(Ft,e.type);return Dt.shared?.usedOn(e)?{...n,delete:!1}:n},nodeOps:wi,isPinned:(e,n)=>n===zn&&(Kt(e)||Qt(e)),sectionBand:pi,locate:e=>Ni.get(e)??null,rowNameOf:(e,n)=>n===zn?Ii(e):Di(e),selectAt:(e,n,t,o)=>{e===zn?el(n):Nl(e,n,t,o??"")},slotRung:e=>{const n=Mi(e);return n?.slot.panel?{label:n.slot.label,select:()=>Li(n.node,n.slot,!1)}:null},style:{held:()=>ve(Ui),canCopy:e=>Wi.rows(Ji,e).some(e=>!1!==e.counted),copy:(e,n)=>Wi.copy(Ui,e,Yi(e.type,n),Ji),paste:(e,n,t)=>Gi(e,n,t)},keys:Pt?{target:Fo,selected:()=>{const e=At.ui.itemSelector;return e?{zone:e.zone??zn,index:e.index}:null},held:()=>mi.get(),readOnly:Boolean(Nt),onDone:({done:e,name:n})=>{"copied"===e&&Ur(_t.copied({name:n}))}}:void 0},Eo),Qi=jn({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});Tn(()=>{Qi.current={copy:(e,n)=>Wi.copy(Ui,e,Yi(e.type,n),Ji),paste:Gi,at:()=>{const e=At.ui.itemSelector;if(!e)return null;const n=e.zone??zn,t=Bi(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(Nt)}});const Zi=En(e=>{const n=ke(e);if(!n)return;const t=Qi.current,o=t.at();o&&(e.preventDefault(),"copy"===n?t.copy(o.node,o.zone):t.readOnly||t.paste(o.zone,o.index,o.node))},[]);Tn(()=>{if(!Fo)return;const e=e=>Zi(e);return Fo.addEventListener("keydown",e),()=>Fo.removeEventListener("keydown",e)},[Zi,Fo]),mn(Eo,"keydown",Zi);const Xi=ci.map(e=>e.props.id).join("|");Tn(()=>{const e=Eo?.document??null,n=Eo?.window??null;let t=0;const o=[],r=()=>{if(!e)return void Zo(e=>e.length?[]:e);const n=ci.findIndex(Qt),t=n>=0?n:ci.length,o=n=>{const t=ci[n]?.props?.id;return null==t?null:Mn(e,`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(hn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=ci.length>0&&!Kt(ci[0])?0:1;e<=t;e++){const n=o(e),t=o(e-1),l=n?.getBoundingClientRect()??null,s=t?.getBoundingClientRect()??null;if(!l&&!s)continue;const d=yt(l&&s?(s.bottom+l.top)/2:l?0===e?l.top+12:l.top:s.bottom,Math.max(0===e?0:-1/0,...r(t).map(e=>e.bottom)),Math.min(1/0,...r(n).map(e=>e.top)));d&&i.push({...d,index:e})}Zo(e=>function(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t].top!==n[t].top||e[t].index!==n[t].index||e[t].height!==n[t].height)return!1;return!0}(e,i)?e:i)},i=()=>{cancelAnimationFrame(t),t=requestAnimationFrame(r)};if(!e||!n)return void r();n.addEventListener("scroll",i,{passive:!0});const l=new ResizeObserver(i);return l.observe(e.documentElement),r(),o.push(setTimeout(r,150),setTimeout(r,450)),()=>{cancelAnimationFrame(t),o.forEach(clearTimeout),n.removeEventListener("scroll",i),l.disconnect()}},[Eo,Xi,xo,ei,go,yo,Et?.props.id]);const _i=Eo?.document??null,qi=Eo?.window??null;Tn(()=>{const e=Lo.current;if(!e||!_i||!qi)return;const n=[],t=()=>{const n=Mn(_i,`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&qi.scrollTo({left:qi.scrollX,top:qi.scrollY+t,behavior:"instant"}),!0};return Lo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[_i,qi]);const el=e=>{_o(F),fo.select({index:e}),cr.sectionPressed?.(ci[e]);const n=ci[e]?.props?.id;n&&l(n)},nl=e=>{const{floor:n,cap:t}=pi(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=Et&&Xo.kind!==Gt?.kind?ci.findIndex(e=>e.props.id===Et.props.id):-1;return o(r>=0?r+1:t)},tl=(e,n)=>{const{floor:t,cap:o}=pi(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(fo.reorderComponent(zn,e,i),fo.select({index:i}),{moved:!0,dest:i})},ol=(e,n,t,o)=>{_o(F),fo.select(o?{index:o.index,zone:o.zone}:{index:e}),l(n),Ur(_t.sectionAdded({name:t}))},rl=(e,n)=>{const t=nl(n),o=gr(e,{nodeDefaults:zi,newNodeId:Bn,sectionLabel:Ci,blockIsOffered:vr}),r=o?fo.insertNode(zn,t,o):fo.insertSection(e,t);return ol(t,r,Ci(e),o?((e,n,t)=>{if(e.type===t)return null;const o={at:null},r=(e,n,i)=>{const l=i.filter(n=>n===e.type).length;for(const{child:s,zone:d,index:a}of Nn(Ft,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=yr(e.type,l,d.slice(d.lastIndexOf(":")+1)),i=r?.choices??(r?.spec?[{type:r.spec.childType,label:r.spec.childType}]:[]);null!==r&&"footer"!==r.source&&`${e.props.id}:${r.slot}`===d&&i.some(e=>e.type===t)&&(o.at={zone:d,index:a,depth:n})}r(s,n+1,[...i,e.type])}};return r({type:e.type,props:{...e.props,id:n}},1,[]),o.at?{zone:o.at.zone,index:o.at.index}:null})(o,r,e):null),t},il=e=>ll(zn,e),ll=(e,n)=>{Vr.current=document.activeElement??null,Ko(null===n?null:{zone:e,index:n}),Jo(!0),go||(Yo.current=!0,Lt({type:"setUi",ui:{leftSideBarVisible:!0}}))},sl=()=>{Jo(!1),Ko(null),Yo.current&&Lt({type:"setUi",ui:{leftSideBarVisible:!1}}),Yo.current=!1},dl=(e,n)=>kr.rowName?n?Kt(e)?kr.rowName(e,"section",_t.header):Qt(e)?kr.rowName(e,"section",_t.footer):Ut(e.type)?kr.rowName(e,"section",xi(e.type)):Ii(e):Di(e):n?Ci(e.type):xi(e.type),al=e=>n=>{e()},cl=(e,n,t)=>{if(Nt)return null;const o=Bi(e)[n];return o&&!Cn(Ft,o.type).delete||o&&hr(o.type,o)?null:/* @__PURE__ */st(Be,{kind:"delete",label:e===zn&&o&&Dt.shared?.usedOn(o)?_t.shared.removeFromPage:_t.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=Bi(e)[n]?.props?.id;null!=t&&Si(String(t))})(e,n),children:/* @__PURE__ */st(tt,{size:15})})},pl=e=>kr.rowPreview?.(e)||void 0,ul=e=>kr.rowMarks?.(e)??void 0,hl=(e,n,t)=>kr.rowActions?.(e,n,t)??null,fl=(e,n,t,o)=>{if(Nt)return null;if(hr(t.type,t))return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
15
- return st(Be,{kind:"eye",label:r?_t.showNamed({name:o}):_t.hideNamed({name:o}),onClick:()=>gl(e,n,t),children:/* @__PURE__ */st(r?ot:rt,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},ml=e=>Vs(zn,e),gl=(e,n,t)=>{fo.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},yl=e=>On(Ft,e),vl=e=>Nn(Ft,e),kl=e=>ur.slotsOf?$i(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:Pn(e,n.slot)})):[{slot:null,rung:null,kids:vl(e)}],bl=e=>ur.slotsOf?kl(e).flatMap(e=>e.kids):vl(e),Sl=e=>Boolean(ur.slotsOf)&&$i(e).some(e=>e.rung),wl=(e,n,t)=>null===t?void 0===n?yr(e):yr(e,n):yr(e,n,t),xl=(e,n,t)=>{const o=$n(Ft,e.type,n)&&(t||bl(e).length>0||Sl(e));return{collapsible:o,folded:o&&Fr(String(e.props.id))}},zl=(e,n,t)=>kl(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>xl(e,r,t(e.type)).collapsible?[String(e.props.id),...zl(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),Cl=e=>bl(e).length>0||Sl(e)||Boolean(yr(e.type)),Il=e=>Boolean(yr(e)),Nl=(e,n,t,o)=>{if(_o(F),yr(o)?.spec?.slider){const t=e.split(":")[0];s(t,n),fo.select({index:n,zone:e}),l(t)}else fo.select({index:n,zone:e}),l(t)},Ol=(e,n,t,o,r)=>{const i=`${e}:${n}`;fo.insertComponent(i,t,o),yr(r)?.spec?.slider?requestAnimationFrame(()=>{s(e,o),fo.select({index:o,zone:i})}):fo.select({index:o,zone:i})},Bl=jn(/* @__PURE__ */new Set);Tn(()=>{ci.forEach(e=>{const n=yr(e.type)?.spec;if(!n)return;const t=e.props.id;if(Bl.current.has(t))return;Bl.current.add(t);if((Array.isArray(e.props[n.slot])?e.props[n.slot]:[]).length>0)return;if(n.skipSeed?.(e.props))return;const o=`${t}:${n.slot}`,r=n.legacy?.(e.props)??[];(r.length?r:n.seeds(zi)).forEach((e,t)=>po.seedChild(o,t,n.childType,e))})},[ci,po,zi]);const Pl=jn(/* @__PURE__ */new Set);Tn(()=>{ci.forEach((e,t)=>{const o=e.props.id;if(Pl.current.has(o))return;const r=n(e,yl(e.type));Pl.current.add(o),r&&po.replaceComponent(zn,t,{...e,props:r})})},[ci,po]),Q(po,Ft);const $l=ci.findIndex(Qt),Ml=$l>=0?ci[$l]:null,jl=Zt?ci.findIndex(Kt):-1,Al=jl>=0?ci[jl]:null,Ll=Dt.groupTab,Tl=An(()=>Ll?e=>Ut(e.type):void 0,[Ll]),El=Boolean(Dt.groupBadge),Rl=Dt.sharedReach,Fl=e=>Rl?.(e)??void 0,Dl=An(()=>Rl?new Set(ci.filter(e=>Fl(e)).map(e=>String(e.props.id))):null,[ci,Rl]),Hl=An(()=>Dl?e=>Dl.has(e):void 0,[Dl]),Vl=Dt.first?Rl?.({type:Dt.first,props:{id:""}})??void 0:void 0,Wl=Dt.groupBadge?/* @__PURE__ */st("span",{className:"es-tree-group-badge",children:/* @__PURE__ */st(Hn,{tone:"info",size:"xs",children:Dt.groupBadge})}):void 0,Ul=ci.find(e=>e.type===Vt)??null,Jl=ci.find(e=>e.type===Wt)??null,Yl=$l>=0?$l:ci.length,Gl=[];ci.forEach(e=>{Qt(e)||(Cl(e)&&Gl.push(String(e.props.id)),Gl.push(...zl(e,1,Il)))}),Ml&&(Gl.push(String(Ml.props.id)),Gl.push(...zl(Ml,1,Il)));const Kl=Gl.length>0&&Gl.every(e=>Mr.has(e)),Ql=e=>{const n=kr.blockRowName(e,xi);return kr.rowName?kr.rowName(e,"block",n):n},Zl=(e,n,t,o)=>{const r=Bi(e)[t];if(!r)return;const i={...dn(e),index:t},l={...dn(n),index:Math.min(Math.max(o,0),Bi(n).length)},s=on(i,l);if(e!==n||s!==t)try{gi.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof cn))throw e}},Xl=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of vl(e))n.add(r),t(o)};for(const t of yl(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},_l=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Ni.get(n);if(!e)return null;if(e.zone===zn)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},ql=e=>{const n=e.slice(0,e.indexOf(":")),t=ci.find(e=>Ut(e.type)&&String(e.props.id)===n);return t&&Jt(n)===e?t:null},es=(e,n)=>{const t=ql(e);return!t||(!Dt.groupAccepts||Dt.groupAccepts(t.type,n,Bi(e).length))},ns=(e,n,t)=>{if(e.rung){const t=Pi(e.rung.nodeId),o=t?$i(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===vt&&n.index>=0&&n.index<=o}if(n.slot===vt)return!1;if(e.add)return is(e.add,n);const o=sn(n);if(Ut(e.type))return!1;const r=ql(o),i=ql(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!es(o,e.type))&&(n.index>=0&&n.index<=Bi(o).length));if(e.zone===zn||o===zn){if(e.zone!==o)return!1;const{floor:t,cap:r}=pi();return n.index>=t&&n.index<=r}if(n.index<0||n.index>Bi(o).length)return!1;if(e.zone===o)return!0;const l=Ml&&!Dt.lastIsOpen?String(Ml.props.id):null;return(!l||_l(e.zone)!==l&&_l(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??Bi(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Ni.get(i),s=l?Bi(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&Xl(r).has(n))return!1;const d=yr(s.type,mr(At?.data,s.type,i),n.slice(n.lastIndexOf(":")+1));return!!d&&(!!(d.choices?d.choices.some(e=>e.type===r.type):d.spec?.childType===r.type)&&!d.spec?.addBlocked?.(Bi(n),r))})(e.zone,o,e.index,t)},ts=(e,n)=>{const t=sn(e.from),o=e.node;return t===sn(n)?es(t,o.type):ns({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},os=e=>{const n=e.slice(0,e.indexOf(":")),t=Ni.get(n),o=t?Bi(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=yr(o.type,mr(At?.data,o.type,n),e.slice(e.lastIndexOf(":")+1));if(!r||`${n}:${r.slot}`!==e)return null;if("footer"===r.source)return null;const i=B(r.choices??(r.spec?[{type:r.spec.childType,label:xi(r.spec.childType)}]:[])),l=Mi(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:dl(o,t.zone===zn)}},rs=(e,n)=>{if("section"!==e.kind)return e;const t=sn(n);return t===zn||ql(t)?e:os(t)?.choices.some(n=>n.type===e.type)?{kind:"block",type:e.type}:e},is=(e,n)=>{const t=rs(e,n),o=sn(n);if("shared"===t.kind){if(o!==zn||!Dt.shared?.nodeOf(t.section))return!1;const{floor:e,cap:r}=pi();return n.index>=e&&n.index<=r}if("block"!==t.kind){if(ql(o)){const e="section"===t.kind?t.type:t.template.node.type;return es(o,e)&&n.index>=0&&n.index<=Bi(o).length}if(o!==zn)return!1;const{floor:e,cap:r}=pi();return n.index>=e&&n.index<=r}if(o===zn)return!1;const r=os(o);return!(!r||!r.choices.some(e=>e.type===t.type))&&!r.target.spec?.addBlocked?.(Bi(o))},ls=(e,n)=>{const t=rs(e,n);if("block"!==t.kind&&ql(sn(n)))return void((e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&es(n,o)){if("section"===e.kind)fo.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;fo.insertNode(n,t,fi(e.template.node))}_o(F),fo.select({index:t,zone:n})}})(t,sn(n),n.index);if("section"===t.kind)return void rl(t.type,n.index);if("template"===t.kind)return void((e,n,t)=>{const o=nl(t),r=fo.insertNode(zn,o,n);ol(o,r,e)})(t.template.name,fi(t.template.node),n.index);if("shared"===t.kind){const e=Dt.shared?.nodeOf(t.section);if(!e)return;const o=nl(n.index);return void(gi.restore(e,{parentId:rn,slot:ln,index:o})&&ol(o,e.props.id,t.section.title))}const o=sn(n),r=os(o);r&&(r.target.spec?Ol(r.parentId,r.target.slot,t.type,n.index,r.parent.type):((e,n,t)=>{fo.insertComponent(e,n,t),_o(F),fo.select({index:t,zone:e})})(o,t.type,n.index))},ss=(e,n)=>{e.media?function(e){const n=Es();if(!n||!As)return;Fs(n).then(n=>{n&&function(e,n){if(!As)return;const t=As.create(e,{nodeDefaults:zi,newNodeId:Bn,sectionLabel:Ci,blockIsOffered:vr}),o=sn(n);if(o===zn){const e=nl(n.index),o=fo.insertNode(zn,e,t);return void ol(e,o,Ci(t.type))}fo.insertNode(o,n.index,t),_o(F),fo.select({index:n.index,zone:o})}(n,e)})}(n):e.rung?Ei(e.rung.nodeId,e.index,n.index):e.add?ls(e.add,n):e.zone===zn?tl(e.index,n.index):Zl(e.zone,sn(n),e.index,n.index)},[ds]=Ln(()=>nn()),as=tn({keyOf:e=>e.id,readOnly:Boolean(Nt),session:ds,canDrop:ns,onDrop:ss,onStep:(e,n)=>{e.rung?Ei(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===zn?((e,n)=>{const t=Ci(ci[e]?.type??""),o=tl(e,n<0?e-1:e+2);if(!o.moved)return void Ur(n<0?_t.sectionFirst({name:t}):_t.sectionLast({name:t}));const{floor:r,cap:i}=pi();Ur(_t.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):Zl(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),cs=En(e=>{const{floor:n,cap:t}=pi(),o=[];for(const r of e.nodes){const e=sn(r.place),i=Bi(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(Kt(i)||Qt(i)||hr(i.type,i))continue;if(Ut(i.type))continue;const l=Boolean(ql(e)),s=e===zn||l;e===zn&&t-n<2||o.push({key:r.id,item:{id:r.id,zone:e,index:r.place.index,type:i.type},box:r.box,label:s?Ci(i.type):Di(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=sn(e.list);if(n===zn&&0===e.children.length)return[{...e,addLabel:_t.addSection,addAlways:!0}];const t=os(n),o=t?.target.spec?.addLabel;return e.children.length>0||Boolean(t?.choices.length)||Boolean(ql(n))?[o?{...e,addLabel:o}:e]:[]}),i=r.flatMap(e=>{const n=sn(e.list),t=n===zn||ql(n)?null:os(n);return t?.choices.length?Xe(e,t.target.spec?.addLabel??_t.addBlockHere):[]});return{sources:o,zones:r,seams:i}},[At.data]),ps=null==Et?.props.id?null:String(Et.props.id),us=En(e=>{const n=Ft,t=e=>!e.item.rung&&null!==an(At.data,n,e.item.id),o=e[e.length-1];if(!t(o))return o;const r=n=>e.find(e=>t(e)&&e.item.id===n),i=r(ps);return i||(r(Le(At.data,n,o.item.id,ps,Tl))??o)},[At.data,Ft,ps,Tl]),[hs,fs]=Ln(null),ms=Boolean(Ll||Rl);mn(Eo,"mouseover",e=>{if(!ms)return;const n=gn(e.target),t=n?ht(At.data,Ft,n):null;t!==hs&&fs(t)}),mn(Eo,"mouseout",e=>{ms&&!e.relatedTarget&&fs(null)});const gs=e=>Kt(e)||Qt(e)||Ut(e.type),ys=e=>{const n=Ut(e.type)?xi(e.type):Kt(e)?_t.header:Qt(e)?_t.footer:null;return null===n?Ii(e):kr.rowName?kr.rowName(e,"section",n):n},vs=[];if(ms){const e=ps?ht(At.data,Ft,ps):null;for(const n of/* @__PURE__ */new Set([e,hs])){const e=n?ci.find(e=>String(e.props.id)===n):void 0;if(!e)continue;const t=Kt(e)||e.type===Vt,o=Fl(e);if(o){vs.push({id:String(e.props.id),label:ys(e),below:t,reach:o});continue}if(!Ll||!gs(e))continue;const r=Ll(e);r&&vs.push({id:String(e.props.id),label:r,below:t})}}const ks=ue(),bs=jn(null);Tn(()=>{const e=Dt.changeNotice;if(!e)return;const n=JSON.stringify(ci.filter(gs)),t=bs.current;if(bs.current={doc:Dn,bands:n,index:Tt.index},!t||t.doc!==Dn||t.bands===n)return;Tt.hasPast&&Tt.index>=t.index&&!ut.has(ks)&&(ut.add(ks),Ur(e,"success",{action:{label:_t.bar.undo,onClick:()=>Tt.back()},duration:8e3}))},[ci]);const Ss=e=>{_o(F),fo.select(e.zone===zn?{index:e.index}:{index:e.index,zone:e.zone})},ws=Z(),xs=()=>({data:At.data,device:xo,ops:fo,inspector:ar}),zs=ws?.model,Cs=An(()=>zs?e=>zs(e,cs(e),xs()):cs,[zs,cs,xo]),Is=ws?.measure,Ns=Is?(e,n)=>Is(e,n,xs()):void 0,Os=ws?.canDrop,Bs=Os?(e,n)=>Os(e,n,ns,xs()):ns,Ps=ws?.drop,$s=Ps?(e,n)=>Ps(e,n,ss,xs()):ss,Ms=ws?.pick,js=Ms?e=>Ms(e,Ss,xs()):Ss,As=ws?.media??null,Ls=jn(null),Ts=An(()=>As?{id:ct,zone:"",index:-1,type:As.adds.type,add:{kind:As.adds.kind,type:As.adds.type},media:!0}:null,[As]);Tn(()=>{if(!Ts||Nt||"undefined"==typeof document)return;const e=e=>{(e=>Array.from(e.dataTransfer?.types??[]).includes(Xn))(e)&&(Ls.current=null,ds.start({key:ct,item:Ts}))},n=e=>{ds.get()?.item.media&&(Ls.current=Jn(e.dataTransfer))},t=()=>{ds.get()?.item.media&&ds.end()};return document.addEventListener("dragstart",e),document.addEventListener("drop",n,!0),document.addEventListener("dragend",t,!0),()=>{document.removeEventListener("dragstart",e),document.removeEventListener("drop",n,!0),document.removeEventListener("dragend",t,!0)}},[Ts,Nt,ds]);const Es=()=>{const e=Ls.current;return Ls.current=null,e},Rs=pe(),Fs=async e=>{if(!Rs)return e;const n=await Rs(e);return n?{...e,id:n.id,url:n.url}:null};const Ds=(e,n)=>{if(!As)return;const t=an(ho.getState().appState.data,ui,n);if(!t)return;const o=t.node;fo.replaceComponent(sn(t.place),t.place.index,{...o,props:{...As.replace(o,e),id:o.props.id}})},Hs=e=>{const n=sn(e),t=Mi(n);t&&Li(t.node,t.slot,!1),ll(n,e.index)},Vs=(e,n)=>/* @__PURE__ */st(Pe,{...Nt?{}:as.seam({place:{...dn(e),index:n}})},`seam:${e}:${n}`),Ws={rowClick:al,isCollapsed:Fr,toggleCollapse:Dr},Us=e=>{const n=String(e.props.id),t=ci.findIndex(e=>String(e.props.id)===n),o=Jt(n),r=Bi(o),i=Fr(n),l=xi(e.type),s=kr.rowName?kr.rowName(e,"section",l):l,d=e=>Vs(o,e);/* @__PURE__ */
16
- return dt(at,{children:[
17
- /* @__PURE__ */st(Ce,{words:qt,icon:/* @__PURE__ */st(Sr,{type:e.type,size:13}),name:s,preview:pl(e),marks:ul(e),onSelect:()=>el(t),nameSlot:Vi(zn,t,n,s),selected:er===n,badge:Fl(e)?void 0:Wl,shared:Fl(e),actions:hl(e,zn,t)??void 0,rowProps:{"data-node-id":n,onClick:al(()=>el(t))},fold:{open:!i,label:"section",onToggle:()=>Dr(n)}}),!i&&/* @__PURE__ */dt(Ie,{children:[r.map((n,t)=>{const r=String(n.props.id),i=Ii(n),l=Cl(n),s=l&&Fr(r),a=()=>Nl(o,t,r,e.type),{rowProps:c,...p}=as.row({item:{id:r,zone:o,index:t,type:n.type},place:{...dn(o),index:t}},{"data-node-id":r,onClick:al(a)});/* @__PURE__ */
18
- return dt(Fn,{children:[d(t),
19
- /* @__PURE__ */st(Ce,{words:qt,icon:/* @__PURE__ */st(Sr,{type:n.type,size:13}),name:i,preview:pl(n),marks:ul(n),onSelect:a,nameSlot:Vi(o,t,r,i),selected:er===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Dr(r)}:void 0,actions:/* @__PURE__ */dt(at,{children:[cl(o,t,i),hl(n,o,t),fl(o,t,n,i)]}),rowProps:c}),l&&!s&&/* @__PURE__ */st(Ie,{children:Gs(n,2)})]},r)}),d(r.length)]})]})},Js=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=as.dragging,d=!Fr(l)&&s?.rung?.nodeId!==i,a={...dn(l),index:0},c=s&&!s.rung&&ns(s,a)?a:void 0,p=()=>Li(e,n,!0),{rowProps:u,...h}=as.row({item:{id:`rung:${l}`,zone:`${i}:${vt}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:vt,index:t},into:c,canDrag:Boolean(ur.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:al(p)}),f=Nt?null:ur.slotActions?.(e,n.slot);/* @__PURE__ */
20
- return dt(Fn,{children:[n.heading,
21
- /* @__PURE__ */st(Ce,{words:qt,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:ji===l,...h,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Dr(l)},actions:f&&f.length>0?/* @__PURE__ */st(at,{children:f.map((t,o)=>/* @__PURE__ */st(Be,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(Nt||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Ti(o,e,n.panel)},i=t.run();i&&"function"==typeof i.then?i.then(r):r(i)})(e,n,t),children:"delete"===t.kind?/* @__PURE__ */st(tt,{size:15}):/* @__PURE__ */st(lt,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */st(Ie,{children:r})]},l)},Ys=(e,n)=>{const t=kl(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
22
- return st(at,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=wl(e.type,void 0,t.slot),d=s?`${e.props.id}:${s.slot}`:null,a=null===t.slot?null:`${e.props.id}:${t.slot}`,c=(e,n)=>Vs(e,n),p=/* @__PURE__ */dt(at,{children:[i.map(({child:n,zone:t,index:o})=>{const r=er===String(n.props.id),{collapsible:i,folded:s}=xl(n,l,Il(n.type)),d=String(n.props.id),a=Ql(n),p=()=>Nl(t,o,d,e.type),{rowProps:u,...h}=as.row({item:{id:d,zone:t,index:o,type:n.type},place:{...dn(t),index:o}},{"data-node-id":d,onClick:al(p)});/* @__PURE__ */
23
- return dt(Fn,{children:[0===o&&c(t,0),
24
- /* @__PURE__ */st(Ce,{words:qt,icon:/* @__PURE__ */st(Sr,{type:n.type,size:13}),name:a,preview:pl(n),marks:ul(n),onSelect:p,nameSlot:Vi(t,o,d,a),selected:r,hidden:Boolean(n.props._hidden),...h,fold:i?{open:!s,label:"group",onToggle:()=>Dr(d)}:void 0,actions:/* @__PURE__ */dt(at,{children:[cl(t,o,a),hl(n,t,o),fl(t,o,n,a)]}),rowProps:u}),i&&!s&&/* @__PURE__ */st(Ie,{children:Ys(n,l+1)}),c(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===a?d&&!i.some(e=>e.zone===d)?c(d,0):null:0!==i.length||!t.rung&&d!==a?null:c(a,0)]});return t.rung?Js(e,t.rung,r++,o,p):/* @__PURE__ */st(Fn,{children:p},t.slot??"")})})},Gs=(e,n)=>{const t=mr(At?.data,e.type,String(e.props.id)),o=kl(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
25
- return st(at,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=wl(e.type,t,o.slot),a=d?.spec??null,c=a&&Array.isArray(e.props[a.slot])?e.props[a.slot]:[],p=d&&d.choices?{slot:d.slot,choices:d.choices}:null,u=String(e.props.id),h=a&&!a.fixed?`${u}:${a.slot}`:null,f=p?`${u}:${p.slot}`:null,m=(e,n)=>Vs(e,n),g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(a&&!a.fixed&&(null===g||g===h)),v=/* @__PURE__ */dt(at,{children:[l.map(({child:n,zone:t,index:o})=>{const r=er===String(n.props.id),i=Di(n),l=String(n.props.id),{collapsible:d,folded:a}=xl(n,s,Il(n.type)),c=yl(n.type),p=1===c.length?`${l}:${c[0]}`:null,u=p?{...dn(p),index:Bi(p).length}:void 0,h=as.dragging,f=u&&h&&ns(h,u)?u:void 0,g=()=>Nl(t,o,l,e.type),{rowProps:y,...v}=as.row({item:{id:l,zone:t,index:o,type:n.type},place:{...dn(t),index:o},into:f,canDrag:!hr(n.type,n)},{"data-node-id":l,onClick:al(g)});/* @__PURE__ */
26
- return dt(Fn,{children:[0===o&&m(t,0),
27
- /* @__PURE__ */st(Ce,{words:qt,icon:/* @__PURE__ */st(Sr,{type:n.type,size:13}),name:i,preview:pl(n),marks:ul(n),onSelect:g,nameSlot:Vi(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...v,fold:d?{open:!a,label:"group",onToggle:()=>Dr(l)}:void 0,actions:hr(n.type,n)?hl(n,t,o)??void 0:/* @__PURE__ */dt(at,{children:[cl(t,o,i),hl(n,t,o),fl(t,o,n,i)]}),rowProps:y}),d&&!a&&/* @__PURE__ */st(Ie,{children:Gs(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&a&&
28
- /* @__PURE__ */st(w,{small:!0,label:a.addLabel,blocked:a.addBlocked?.(c)??null,onAdd:()=>Ol(e.props.id,a.slot,a.childType,c.length,e.type)}),null===g?f&&!l.some(e=>e.zone===f)?m(f,0):null:0!==l.length||(o.rung?y:g!==f)?null:m(g,0)]});return o.rung?Js(e,o.rung,i++,r,v):/* @__PURE__ */st(Fn,{children:v},o.slot??"")})})},Ks=Uo,Qs=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:go&&!Ks&&pr===e.id,onSelect:()=>si(e.id)}:e,Zs=[...(cr.railLead??[]).map(Qs),{id:"sections",label:_t.layers,icon:/* @__PURE__ */st(me,{}),active:go&&!Ks&&"sections"===pr,onSelect:()=>si("sections")},...(cr.railTrail??[]).map(Qs)],Xs=Io?{onPress:No}:$t?{onPress:()=>{le(un,{accept:"image/*",title:io.mediaLibrary})}}:null,_s={value:Zs.find(e=>!0===e.active)?.id??"",press:e=>{const n=Zs.find(n=>n.id===e);n&&!n.disabled&&!0!==n.active&&n.onSelect?.()},items:Zs.map(e=>({id:e.id,icon:e.icon,label:/* @__PURE__ */st("span",{className:"sr-only",children:e.label}),tooltip:e.label,disabled:e.disabled}))},qs=[...cr.railLead??[],...cr.railTrail??[]].find(e=>"panel"in e&&e.id===pr),ed=Boolean(Xt?.foldable),nd=Xt?.label??(Mt?_t.pageSections:_t.templateSections),td=ed&&Fr(kt),od=/* @__PURE__ */dt(at,{children:[ci.map((e,n)=>{if(Kt(e)||Qt(e)||Ut(e.type))return null;const t=er===String(e.props.id),o=Boolean(e.props._hidden);vl(e);const r=String(e.props.id),i=cr.hasOwnRows?.(e)??!1,l=Cl(e)||i,s=l&&Fr(r),d=yl(e.type),a=1===d.length?`${r}:${d[0]}`:null,c=a?{...dn(a),index:Bi(a).length}:void 0,p=as.dragging,u=c&&p&&ns(p,c)?c:void 0,{rowProps:h,...f}=as.row({item:{id:r,zone:zn,index:n,type:e.type},place:{...dn(zn),index:n},into:u,canDrag:!hr(e.type,e)},{"data-node-id":r,onClick:al(()=>el(n))});/* @__PURE__ */
29
- return dt(Fn,{children:[n>0&&ml(n),
30
- /* @__PURE__ */st(Ce,{words:qt,icon:/* @__PURE__ */st(Sr,{type:e.type,size:13}),name:Ii(e),preview:pl(e),marks:ul(e),shared:Fl(e),onSelect:()=>el(n),nameSlot:Vi(zn,n,r,Ii(e)),selected:t,hidden:o,...f,fold:l?{open:!s,label:"section",onToggle:()=>Dr(r)}:void 0,actions:/* @__PURE__ */dt(at,{children:[cl(zn,n,Ii(e)),hl(e,zn,n),fl(zn,n,e,Ii(e))]}),rowProps:h}),Cl(e)&&!s&&/* @__PURE__ */dt(Ie,{children:[Gs(e,1),cr.partRows?.(e,Ws)]}),i&&!s&&/* @__PURE__ */st(Ie,{children:cr.ownRows?.(e,n,Ws)})]},String(e.props.id??n))}),Yl>0&&ml(Yl)]}),rd=(e,n,t)=>{const o=String(e.props.id),r=bl(e).length>0||Sl(e)||Boolean(yr(e.type)),i=r&&Fr(o),l="header"===t?_t.header:_t.footer,s=kr.rowName?kr.rowName(e,"section",l):l;/* @__PURE__ */
31
- return dt(at,{children:[
32
- /* @__PURE__ */st(Ce,{words:qt,icon:/* @__PURE__ */st(Sr,{type:t,size:13}),name:s,preview:pl(e),marks:ul(e),badge:Fl(e)?void 0:Wl,shared:Fl(e),onSelect:()=>el(n),nameSlot:Vi(zn,n,o,s),selected:er===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Dr(o)}:void 0,actions:hl(e,zn,n)??void 0,rowProps:{"data-node-id":o,onClick:al(()=>el(n))}}),r&&!i&&/* @__PURE__ */st(Ie,{children:Ys(e,1)})]})};return(cr.wrap??(e=>e))(
33
- /* @__PURE__ */st(X,{target:Eo,children:/* @__PURE__ */dt("div",{ref:To,className:"sf-editor es-editor",style:Ue(Ar),onContextMenu:Ki.onEditorContextMenu,...u(un),children:[
34
- /* @__PURE__ */dt(Te,{children:[
35
- /* @__PURE__ */dt("div",{className:"es-cluster es-cluster--left",children:[Xs?/* @__PURE__ */st(Vn,{variant:"secondary",className:"es-barbtn",leftIcon:/* @__PURE__ */st(ge,{}),onClick:Xs.onPress,children:_t.railMedia}):null,
36
- /* @__PURE__ */st(Ee,{label:_t.bar.undo,disabled:Boolean(Nt)||!Tt.hasPast,onClick:()=>Tt.back(),children:/* @__PURE__ */st(_n,{})}),
37
- /* @__PURE__ */st(Ee,{label:_t.bar.redo,disabled:Boolean(Nt)||!Tt.hasFuture,onClick:()=>Tt.forward(),children:/* @__PURE__ */st(qn,{})})]}),
38
- /* @__PURE__ */dt(Re,{children:[
39
- /* @__PURE__ */st(Fe,{devices:vo,value:xo,onChange:zo}),
40
- /* @__PURE__ */st(Ee,{label:_t.bar.refresh,tip:_t.bar.refreshTip,onClick:()=>{Lo.current=(()=>{const e=Eo?.document;if(!e)return null;const n=ci.findIndex(Qt),t=n>=0?n:ci.length;let o=null;for(let n=0;n<t;n++){const t=ci[n]?.props?.id;if(null==t)continue;const r=Mn(e,`[data-puck-component="${CSS.escape(String(t))}"]`);if(!r)continue;const i=r.getBoundingClientRect().top;i<=4&&(null===o||i>o.offset)&&(o={id:String(t),offset:i})}if(!o){const e=Et?.props?.id??ci[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Ao(e=>e+1)},children:/* @__PURE__ */st(et,{})}),cr.barView?.()]}),
41
- /* @__PURE__ */dt(Re,{kind:"right",style:{minWidth:300},children:[
42
- /* @__PURE__ */st(k,{input:Vo,words:_t.saveStatus}),yn?/* @__PURE__ */st(yn,{}):null,cr.barLead?.(),cr.barTrail?.(),cr.mainAction||!cr.barMain?/* @__PURE__ */st(b,{input:Vo,action:cr.mainAction??{label:_t.done,onPress:()=>{Qn(At.data)}},readOnly:Boolean(Nt),saveSwitch:Bt,onToggleAutoSave:xt,onSaveNow:Wo,bar:_t.bar,words:_t.saveStatus}):cr.barMain()]})]}),
43
- /* @__PURE__ */st(re,{}),
44
- /* @__PURE__ */dt("div",{className:"sf-body",children:[go?/* @__PURE__ */dt(at,{children:[
45
- /* @__PURE__ */dt("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":_t.leftPanel,children:[
46
- /* @__PURE__ */dt("div",{className:"es-paneltabs es-paneltabs--with-hide",children:[
47
- /* @__PURE__ */st(I,{side:"left",onHide:ii}),
48
- /* @__PURE__ */st("span",{className:"es-paneltabs-divider","aria-hidden":"true"}),
49
- /* @__PURE__ */st(Wn,{variant:"underline",block:!0,"aria-label":_t.bar.views,value:_s.value,onChange:_s.press,items:_s.items})]}),Uo?/* @__PURE__ */st(x,{at:Go?{label:(e=>{const n=ql(e.zone);if(n)return _t.add.addingTo({name:kr.rowName?dl(n,!0):xi(n.type)});if(e.zone===zn){const n=ci[e.index];return n&&!Qt(n)?_t.add.addingBefore({name:dl(n,!0)}):_t.add.addingAtEnd}const t=os(e.zone);return t?_t.add.addingTo({name:t.parentName}):_t.add.addingHere})(Go),onClear:()=>Ko(null)}:void 0,placeBlocks:Go&&Go.zone!==zn?os(Go.zone)?.choices:void 0,canTake:Go?e=>{if(!Go)return null;const n={...dn(Go.zone),index:Go.index};if(is(e,n))return null;if("shared"===e.kind&&Go.zone===zn&&!Dt.shared?.nodeOf(e.section))return _t.shared.alreadyHere;const t=ql(Go.zone);if(t)return _t.add.notInside({name:dl(t,!0)});if(Go.zone===zn)return _t.add.onlySections;const o=os(Go.zone);return o?_t.add.notInside({name:o.parentName}):_t.add.onlySections}:void 0,onPick:Go?e=>{if(!Go)return;const n={...dn(Go.zone),index:Go.index};is(e,n)&&(ls(e,n),sl())}:void 0,itemFor:e=>({id:`new:${e.kind}:${"template"===e.kind?e.template.id:"shared"===e.kind?e.section.id:e.type}`,zone:"",index:-1,type:"template"===e.kind?e.template.node.type:"shared"===e.kind?e.section.node.type:e.type,add:e}),session:ds,siteWide:cr.addPanelRow?.(sl),onClose:sl,readOnly:Boolean(Nt)}):qs?qs.panel({onHide:ii,notify:Ur}):/* @__PURE__ */dt(at,{children:[
50
- /* @__PURE__ */st(N,{icon:/* @__PURE__ */st(me,{}),title:_t.layers,context:lo,actions:/* @__PURE__ */dt(at,{children:[!Nt&&/* @__PURE__ */st(De,{label:_t.add.title,onClick:()=>il(null),children:/* @__PURE__ */st(nt,{size:15})}),
51
- /* @__PURE__ */st(De,{label:Kl?_t.expandAll:_t.collapseAll,title:0===Gl.length?_t.nothingToFold:void 0,disabled:0===Gl.length,onClick:()=>jr(e=>{const n=new Set(Gl);return Kl?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Gl])}),children:/* @__PURE__ */st(mt,{expand:Kl})})]})}),
52
- /* @__PURE__ */dt(Ne,{className:"sf-tree sf-scroll",words:qt,children:[
53
- /* @__PURE__ */st(Ce,{words:qt,icon:/* @__PURE__ */st(Sr,{type:"page",size:13}),name:_t.pageSettings,onSelect:di,selected:!Et&&qo,rowProps:{onClick:al(di)}}),Ul&&/* @__PURE__ */dt(at,{children:[!El&&/* @__PURE__ */st(Oe,{children:_t.header}),Us(Ul)]}),jt&&!(El&&Ul)&&/* @__PURE__ */dt(at,{children:[!El&&/* @__PURE__ */st(Oe,{children:_t.header}),!Zt&&/* @__PURE__ */st(Ce,{words:qt,icon:/* @__PURE__ */st(Sr,{type:"header",size:13}),name:_t.header,badge:Vl?void 0:Wl,shared:Vl,onSelect:ai,selected:Xo.kind===Gt?.kind,rowProps:{onClick:al(ai)}})]}),Al&&!(El&&Ul)&&rd(Al,jl,"header"),!ed&&/* @__PURE__ */st(Oe,{children:nd}),ed?/* @__PURE__ */dt(at,{children:[
54
- /* @__PURE__ */st(Ce,{words:qt,icon:null,name:nd,fold:{open:!td,label:nd,onToggle:()=>Dr(kt)}}),!td&&/* @__PURE__ */st(Ie,{children:od})]}):od,jt&&!El&&/* @__PURE__ */st(Oe,{children:_t.footer}),Ml&&!(El&&Jl)&&rd(Ml,$l,"footer"),Jl&&Us(Jl),cr.treeFoot?.()]})]})]}),
55
- /* @__PURE__ */st(He,{side:"left",width:Ar.left,min:We.left,max:Ve,defaultWidth:m.left,label:_t.resizeLeftPanel,onResize:Er})]}):/* @__PURE__ */st(O,{side:"left",onShow:ii}),
56
- /* @__PURE__ */dt("div",{ref:Jr,className:"sf-center sf-scroll","data-sf-canvas-head":Zr?"":void 0,style:{overflowX:ti?"auto":"hidden",overflowY:"hidden"},children:[Zr&&/* @__PURE__ */st("div",{ref:Xr,className:"sf-canvas-head",children:/* @__PURE__ */st(Zr,{device:xo})}),
57
- /* @__PURE__ */dt("div",{className:"sf-frame-scaler",style:oi,children:[
58
- /* @__PURE__ */st("div",{className:"sf-frame "+(xo===So?"":`sf-frame--${xo}`),style:ri,children:/* @__PURE__ */dt("div",{className:"sf-preview-host",children:[
59
- /* @__PURE__ */st(xe.Provider,{value:Tl,children:/* @__PURE__ */st(ze.Provider,{value:Hl,children:/* @__PURE__ */st(so,{},jo)})}),
60
- /* @__PURE__ */st(_e,{canvas:Eo,session:ds,model:Cs,measure:Ns,canDrop:Bs,onDrop:$s,choose:us,onPick:js,dropOn:As?{accepts:(e,n)=>{if(!e.media||!As||n.item.rung)return!1;const t=an(At.data,ui,n.item.id);return null!==t&&As.takes(t.node)},onDrop:(e,n)=>(e=>{const n=Es();n&&As&&Fs(n).then(n=>{n&&Ds(n,e.item.id)})})(n),label:()=>_t.canvasReplaceImage}:void 0,onZoneAdd:Hs,onSeamAdd:Hs,zoneAddLabel:_t.canvasAddBlock,words:eo.canvas,readOnly:Boolean(Nt),revision:At.data}),Qo.length>0&&!Ro&&/* @__PURE__ */st("div",{className:"sf-preview-gaps",children:Qo.map(e=>
61
- /* @__PURE__ */st(qe,{index:e.index,label:_t.addSectionHere,onInsert:()=>il(e.index),className:void 0===e.height?"sf-preview-gap":"sf-preview-gap sf-preview-gap--tight",style:void 0===e.height?{top:e.top}:{top:e.top,height:e.height}},e.index))})]})}),ms?/* @__PURE__ */st(ft,{canvas:Eo,tabs:vs,onSelect:e=>{const n=ci.findIndex(n=>String(n.props.id)===e);n>=0&&el(n)}}):null]})]}),yo?/* @__PURE__ */dt(at,{children:[vn?
62
- /* @__PURE__ */st("div",{className:"es-sidepanel es-sidepanel--right","data-es-host-panel":"",children:vn}):/* @__PURE__ */st(at,{children:/* @__PURE__ */st(h,{value:{selectChild:Nl,addChild:Ol,childRowName:Di,blockRowName:Ql},children:/* @__PURE__ */st(ao,{mode:Xo,onOpenWebsiteSettings:cr.openSettings??(()=>{}),onOpenSiteStyles:cr.openStyles,onSelectNode:Cr,onNotify:Ur,onHidePanel:li,nodeActions:Et?Cn(Ft,Et.type):bt})})}),
63
- /* @__PURE__ */st(He,{side:"right",width:Ar.right,min:We.right,max:Ve,defaultWidth:m.right,label:_t.resizeSettingsPanel,onResize:Rr})]}):
64
- /* @__PURE__ */st(O,{side:"right",onShow:li})]}),Ki.menu,
65
- /* @__PURE__ */st(ne,{}),vi?/* @__PURE__ */st(pt,{name:vi.name,onMake:e=>(async(e,n)=>{const t=ci.find(n=>String(n.props.id)===e),o=Dt.shared;if(!t||!o)return;let r;try{r=await C(yi).create(n,t)}catch{return void Ur(_t.shared.makeFailed,"error")}o.adopt(t,r),ki(null)})(vi.id,e),onCancel:()=>ki(null)}):null]})}))}export{wt as ScreenChrome};
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes