efficient-easel 21.1.0 → 23.0.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 (205) hide show
  1. package/README.md +45 -37
  2. package/dist/{CanvasDragLayer-CFUcBbgc.d.ts → CanvasDragLayer-NZpaX6aq.d.ts} +15 -4
  3. package/dist/{ScreenDocumentContext-1RgtGKWR.d.ts → ScreenDocumentContext-BDLUYzlM.d.ts} +4 -4
  4. package/dist/blocks/index.d.ts +16 -18
  5. package/dist/{buckets-Sw94ll9I.d.ts → buckets-_MGDYJlb.d.ts} +1 -1
  6. package/dist/canvas/index.d.ts +22 -12
  7. package/dist/canvas/index.js +1 -1
  8. package/dist/{canvas-typing-Be4FO4q7.d.ts → canvas-typing-DOBx8dD3.d.ts} +12 -2
  9. package/dist/{chunk-I67UW5UG.js → chunk-3P735WOM.js} +4 -4
  10. package/dist/{chunk-KWLHKKZO.js → chunk-4YUC7B7E.js} +1 -1
  11. package/dist/chunk-6F5GO337.js +1 -0
  12. package/dist/{chunk-3S5N4HLJ.js → chunk-6NJHYXJM.js} +1 -1
  13. package/dist/{chunk-BTDI7JAA.js → chunk-A6ZP5II4.js} +2 -2
  14. package/dist/{chunk-IWCKVZHS.js → chunk-AGWKB77Q.js} +1 -1
  15. package/dist/chunk-AT4DDMJS.js +1 -0
  16. package/dist/chunk-FF54HWSE.js +8 -0
  17. package/dist/{chunk-MLQKNED6.js → chunk-FOOK54T2.js} +1 -1
  18. package/dist/{chunk-SWBADIQT.js → chunk-G3HAKQUF.js} +1 -1
  19. package/dist/{chunk-ZOSEBPAI.js → chunk-GKG3M5QK.js} +1 -1
  20. package/dist/chunk-GXRS52JD.js +5 -0
  21. package/dist/{chunk-U7TFWHST.js → chunk-HLMQ34GP.js} +1 -1
  22. package/dist/chunk-HZSZT3BE.js +7 -0
  23. package/dist/{chunk-EB6NI2VK.js → chunk-IYHO4XQX.js} +1 -1
  24. package/dist/chunk-IZGFJWH4.js +1 -0
  25. package/dist/chunk-KXM6YRG2.js +1 -0
  26. package/dist/chunk-KXTXYINN.js +16 -0
  27. package/dist/chunk-LN43DP2A.js +18 -0
  28. package/dist/{chunk-PFFH7ASD.js → chunk-MXECWHRJ.js} +17 -17
  29. package/dist/chunk-OXZDSOZV.js +1 -0
  30. package/dist/{chunk-BSHIQIZC.js → chunk-RPMSET77.js} +1 -1
  31. package/dist/{chunk-K7BTCBWD.js → chunk-TGZCD6IP.js} +1 -1
  32. package/dist/{chunk-U5DNBT63.js → chunk-UMBNBCL4.js} +1 -1
  33. package/dist/chunk-VZUXOZGP.js +64 -0
  34. package/dist/{chunk-GWYNMSIP.js → chunk-XJ23ULBP.js} +1 -1
  35. package/dist/{chunk-DNQ7AF6K.js → chunk-YHEYJKQL.js} +1 -1
  36. package/dist/chunk-YU3WHLGI.js +1 -0
  37. package/dist/copy/index.d.ts +21 -7
  38. package/dist/copy/index.js +29 -29
  39. package/dist/data/index.d.ts +30 -22
  40. package/dist/data/index.js +1 -1
  41. package/dist/drag/drag.css +10 -1
  42. package/dist/drag/index.d.ts +5 -5
  43. package/dist/drag/index.js +1 -1
  44. package/dist/draw/index.d.ts +2 -2
  45. package/dist/easel/easel.css +15 -10
  46. package/dist/easel/index.d.ts +97 -60
  47. package/dist/easel/index.js +1 -1
  48. package/dist/edit-lock/index.d.ts +5 -5
  49. package/dist/fields/fields.css +1 -1
  50. package/dist/fields/index.d.ts +17 -17
  51. package/dist/fields/index.js +1 -1
  52. package/dist/node-ops/index.d.ts +3 -3
  53. package/dist/node-ops/index.js +1 -1
  54. package/dist/panel/index.d.ts +4 -4
  55. package/dist/panel/panel.css +6 -1
  56. package/dist/pick/index.d.ts +5 -5
  57. package/dist/{plan-CZS902DV.d.ts → plan-D0DgSLnY.d.ts} +5 -5
  58. package/dist/render/index.d.ts +19 -19
  59. package/dist/render/index.js +5 -5
  60. package/dist/{repeat-BNgSq2Nw.d.ts → repeat-D65bJS8d.d.ts} +1 -1
  61. package/dist/{resolve-D68pb3Bx.d.ts → resolve-Bz4mszpL.d.ts} +5 -5
  62. package/dist/screen/components/AddBlockRow.js +1 -1
  63. package/dist/screen/components/AddSidePanel.d.ts +2 -2
  64. package/dist/screen/components/AddSidePanel.js +1 -1
  65. package/dist/screen/components/NodeContextMenu.d.ts +17 -20
  66. package/dist/screen/components/NodeContextMenu.js +1 -1
  67. package/dist/screen/components/PageEditGuardNotices.js +1 -1
  68. package/dist/screen/components/PreviewDeviceContext.d.ts +1 -1
  69. package/dist/screen/components/PreviewPartsContext.d.ts +2 -2
  70. package/dist/screen/components/SaveControls.d.ts +8 -8
  71. package/dist/screen/components/ScreenChrome.js +1 -1
  72. package/dist/screen/components/ScreenDocumentContext.d.ts +5 -5
  73. package/dist/screen/components/ScreenDocumentContext.js +1 -1
  74. package/dist/screen/components/ScreenMount.d.ts +8 -8
  75. package/dist/screen/components/ScreenMount.js +1 -1
  76. package/dist/screen/components/ScreenStoreProvider.d.ts +12 -12
  77. package/dist/screen/components/ScreenStoreProvider.js +1 -1
  78. package/dist/screen/components/SectionScreenShell.js +17 -17
  79. package/dist/screen/components/usePartBridge.d.ts +10 -10
  80. package/dist/screen/components/usePartBridge.js +1 -1
  81. package/dist/screen/index.d.ts +8 -8
  82. package/dist/screen/index.js +1 -1
  83. package/dist/screen/lib/admin-bridge.d.ts +4 -4
  84. package/dist/screen/lib/document/add-target-types.js +0 -1
  85. package/dist/screen/lib/document/block-types-in.d.ts +2 -1
  86. package/dist/screen/lib/document/block-types-in.js +1 -1
  87. package/dist/screen/lib/document/content-tree.d.ts +8 -8
  88. package/dist/screen/lib/document/device-fields.d.ts +7 -7
  89. package/dist/screen/lib/document/device-fields.js +1 -1
  90. package/dist/screen/lib/document/field-buckets.d.ts +1 -1
  91. package/dist/screen/lib/document/field-markers.d.ts +5 -5
  92. package/dist/screen/lib/document/palette-sections.d.ts +5 -5
  93. package/dist/screen/lib/document/panel-fields.d.ts +6 -6
  94. package/dist/screen/lib/document/panel-no-control-mark.d.ts +4 -5
  95. package/dist/screen/lib/document/part-id.d.ts +1 -1
  96. package/dist/screen/lib/document/preview-events.d.ts +2 -2
  97. package/dist/screen/lib/document/preview-selection-context.d.ts +2 -2
  98. package/dist/screen/lib/document/section-doc.d.ts +5 -5
  99. package/dist/screen/lib/document/section-doc.js +1 -1
  100. package/dist/screen/lib/document/slot-child-name.d.ts +1 -1
  101. package/dist/screen/lib/document/slot-section-spec.d.ts +1 -1
  102. package/dist/screen/lib/document/slot-section-spec.js +0 -1
  103. package/dist/screen/lib/document/style-clipboard.d.ts +8 -8
  104. package/dist/screen/lib/document/style-clipboard.js +1 -1
  105. package/dist/screen/lib/document/tree-reveal.d.ts +6 -6
  106. package/dist/screen/lib/document/tree-reveal.js +1 -1
  107. package/dist/screen/lib/document/use-section-ops.d.ts +6 -6
  108. package/dist/screen/lib/document/use-section-ops.js +1 -1
  109. package/dist/screen/lib/document-addressing.d.ts +5 -5
  110. package/dist/screen/lib/document-hooks.d.ts +4 -4
  111. package/dist/screen/lib/host.d.ts +5 -5
  112. package/dist/screen/lib/key-scope.d.ts +1 -1
  113. package/dist/screen/lib/key-scope.js +1 -1
  114. package/dist/screen/lib/media-panel.d.ts +5 -5
  115. package/dist/screen/lib/media-picker.d.ts +6 -6
  116. package/dist/screen/lib/page-lock.d.ts +4 -4
  117. package/dist/screen/lib/screen-parts.d.ts +25 -16
  118. package/dist/screen/lib/screen-parts.js +1 -1
  119. package/dist/screen/lib/section-templates.d.ts +4 -4
  120. package/dist/screen/lib/session-context.d.ts +4 -4
  121. package/dist/screen/lib/session.d.ts +5 -5
  122. package/dist/screen/lib/shared-sections.d.ts +4 -4
  123. package/dist/screen/screen.css +15 -15
  124. package/dist/screen/words.d.ts +4 -3
  125. package/dist/screen/words.js +1 -1
  126. package/dist/{session-DSQFmIvx.d.ts → session-EsjORLQ0.d.ts} +1 -1
  127. package/dist/shell/shell.css +2 -2
  128. package/dist/strings/index.d.ts +4 -4
  129. package/dist/strings/index.js +2 -2
  130. package/dist/style-clipboard/index.d.ts +2 -2
  131. package/dist/text-styles/index.d.ts +3 -3
  132. package/dist/text-styles/index.js +21 -21
  133. package/dist/text-styles/model.d.ts +1 -1
  134. package/dist/{types-B8NwXKlE.d.ts → types-BIytwvvH.d.ts} +3 -3
  135. package/dist/{types-Cq53lL8d.d.ts → types-BljCVdzR.d.ts} +18 -18
  136. package/dist/{types-41704JE4.d.ts → types-Dq180WRV.d.ts} +8 -8
  137. package/dist/{useNodeOps-fIDWzftn.d.ts → useNodeOps-igxrnEhq.d.ts} +2 -2
  138. package/dist/{watch-D8xZow3y.d.ts → watch-Unf6SfUf.d.ts} +3 -3
  139. package/dist/{words-gIDCeRv3.d.ts → words-B5Gb7KFq.d.ts} +1 -1
  140. package/dist/{words-BpTjCfqO.d.ts → words-Cf5VT2Ic.d.ts} +2 -2
  141. package/dist/{words-CmEnDoOe.d.ts → words-fbR9IwxH.d.ts} +1 -1
  142. package/package.json +3 -147
  143. package/dist/chunk-2C7W64S5.js +0 -8
  144. package/dist/chunk-2L6KWUBC.js +0 -1
  145. package/dist/chunk-4FD7TAOE.js +0 -1
  146. package/dist/chunk-67HCYOW4.js +0 -1
  147. package/dist/chunk-A2VVB4RH.js +0 -0
  148. package/dist/chunk-BDSLF5BR.js +0 -1
  149. package/dist/chunk-CPL43ZLJ.js +0 -1
  150. package/dist/chunk-L55YIXDC.js +0 -1
  151. package/dist/chunk-MZ5GSSZ3.js +0 -7
  152. package/dist/chunk-OHZHYROJ.js +0 -5
  153. package/dist/chunk-PRHBWA5V.js +0 -0
  154. package/dist/chunk-TUXLORVR.js +0 -15
  155. package/dist/chunk-WJJ7H42G.js +0 -18
  156. package/dist/chunk-YIUE4US7.js +0 -0
  157. package/dist/chunk-YVFYWAYU.js +0 -65
  158. package/dist/screen/lib/puck/add-target-types.d.ts +0 -3
  159. package/dist/screen/lib/puck/add-target-types.js +0 -1
  160. package/dist/screen/lib/puck/block-choice.d.ts +0 -1
  161. package/dist/screen/lib/puck/block-choice.js +0 -1
  162. package/dist/screen/lib/puck/block-types-in.d.ts +0 -1
  163. package/dist/screen/lib/puck/block-types-in.js +0 -1
  164. package/dist/screen/lib/puck/content-tree.d.ts +0 -1
  165. package/dist/screen/lib/puck/content-tree.js +0 -1
  166. package/dist/screen/lib/puck/device-fields.d.ts +0 -4
  167. package/dist/screen/lib/puck/device-fields.js +0 -1
  168. package/dist/screen/lib/puck/field-buckets.d.ts +0 -2
  169. package/dist/screen/lib/puck/field-buckets.js +0 -1
  170. package/dist/screen/lib/puck/field-markers.d.ts +0 -2
  171. package/dist/screen/lib/puck/field-markers.js +0 -1
  172. package/dist/screen/lib/puck/hidable.d.ts +0 -1
  173. package/dist/screen/lib/puck/hidable.js +0 -1
  174. package/dist/screen/lib/puck/palette-sections.d.ts +0 -8
  175. package/dist/screen/lib/puck/palette-sections.js +0 -1
  176. package/dist/screen/lib/puck/panel-fields.d.ts +0 -1
  177. package/dist/screen/lib/puck/panel-fields.js +0 -1
  178. package/dist/screen/lib/puck/panel-no-control-mark.d.ts +0 -2
  179. package/dist/screen/lib/puck/panel-no-control-mark.js +0 -1
  180. package/dist/screen/lib/puck/part-id.d.ts +0 -1
  181. package/dist/screen/lib/puck/part-id.js +0 -1
  182. package/dist/screen/lib/puck/preview-click.d.ts +0 -1
  183. package/dist/screen/lib/puck/preview-click.js +0 -1
  184. package/dist/screen/lib/puck/preview-dom.d.ts +0 -1
  185. package/dist/screen/lib/puck/preview-dom.js +0 -1
  186. package/dist/screen/lib/puck/preview-events.d.ts +0 -1
  187. package/dist/screen/lib/puck/preview-events.js +0 -1
  188. package/dist/screen/lib/puck/preview-selection-context.d.ts +0 -2
  189. package/dist/screen/lib/puck/preview-selection-context.js +0 -1
  190. package/dist/screen/lib/puck/section-doc.d.ts +0 -9
  191. package/dist/screen/lib/puck/section-doc.js +0 -1
  192. package/dist/screen/lib/puck/slot-child-name.d.ts +0 -1
  193. package/dist/screen/lib/puck/slot-child-name.js +0 -1
  194. package/dist/screen/lib/puck/slot-heal.d.ts +0 -2
  195. package/dist/screen/lib/puck/slot-heal.js +0 -1
  196. package/dist/screen/lib/puck/slot-section-spec.d.ts +0 -1
  197. package/dist/screen/lib/puck/slot-section-spec.js +0 -1
  198. package/dist/screen/lib/puck/style-clipboard.d.ts +0 -42
  199. package/dist/screen/lib/puck/style-clipboard.js +0 -1
  200. package/dist/screen/lib/puck/text-control-kinds.d.ts +0 -1
  201. package/dist/screen/lib/puck/text-control-kinds.js +0 -1
  202. package/dist/screen/lib/puck/tree-reveal.d.ts +0 -1
  203. package/dist/screen/lib/puck/tree-reveal.js +0 -1
  204. package/dist/screen/lib/puck/use-section-ops.d.ts +0 -9
  205. package/dist/screen/lib/puck/use-section-ops.js +0 -1
@@ -1 +1 @@
1
- import{isRecord as t,fieldsFrom as n,blockOf as o,topLevelSlotKeys as e,slotLocations as r,setIn as s,fieldsOf as i,isNode as c,defaultsFrom as p}from"./chunk-L55YIXDC.js";var f=()=>({lastChange:{}});function a(t,n){if(t===n)return!0;if(!t||!n||"object"!=typeof t||"object"!=typeof n)return t!=t&&n!=n;if(Array.isArray(t)!==Array.isArray(n))return!1;if(Array.isArray(t)){const o=n;if(t.length!==o.length)return!1;for(let n=0;n<t.length;n++)if(!a(t[n],o[n]))return!1;return!0}const o=Object.keys(t),e=Object.keys(n);if(o.length!==e.length)return!1;for(const e of o){if(!Object.prototype.hasOwnProperty.call(n,e))return!1;if(!a(t[e],n[e]))return!1}return!0}function l(t,n){if(!t)return{};const o=t.props??{},e=n?.props??{},r={};for(const t of Object.keys(o))r[t]=!a(e[t],o[t]);return r}async function u(i,c,p={}){const{metadata:d={},trigger:h="replace",cache:y=f(),onResolveStart:g,onResolveEnd:m}=p,w=function(t,n){return t.type&&"root"!==t.type?n.components[t.type]:n.root}(i,c);let b={...i};const v=Boolean(w?.resolveData&&i.props),j=t(i.props)&&"id"in i.props?String(i.props.id):"root";if(v){const t=y.lastChange[j];if("force"!==h&&t&&a(i,t.item))return{node:t.resolved,didChange:!1};const n=l(i,t?.item??null);g?.(i);const o=await w.resolveData(i,{changed:n,lastData:t?.item??null,metadata:{...d,...w.metadata??{}},trigger:h})??{};b.props={...i.props,...o.props??{}},o.readOnly&&Object.keys(o.readOnly).length&&(b.readOnly=o.readOnly)}const $=n(i.type&&"root"!==i.type?o(c,i.type):c.root);if(w)for(const t of e($))void 0===b.props[t]&&(b={...b,props:{...b.props,[t]:[]}});for(const t of r(b.props,$)){if(!t.present)continue;const n=await Promise.all(t.content.map(async t=>(await u(t,c,{metadata:d,trigger:h,cache:y,onResolveStart:g,onResolveEnd:m})).node));b={...b,props:s(b.props,t.segments,n)}}return v&&m?.(b),y.lastChange[j]={item:i,resolved:b},{node:b,didChange:!a(i,b)}}var d="root";function h(t){if(void 0===t)return"u";if("string"==typeof t)return`s${t.length.toString(36)}.${y(t)}`;const n=g(t);return`j${n.length.toString(36)}.${y(n)}`}function y(t){let n=2166136261;for(let o=0;o<t.length;o++)n^=t.charCodeAt(o),n=Math.imul(n,16777619);return(n>>>0).toString(36)}function g(t){if(null===t||"object"!=typeof t)return JSON.stringify(t)??"null";if(Array.isArray(t))return`[${t.map(g).join(",")}]`;const n=t;return`{${Object.keys(n).filter(t=>void 0!==n[t]).sort().map(t=>`${JSON.stringify(t)}:${g(n[t])}`).join(",")}}`}var m=(t,n)=>Object.prototype.hasOwnProperty.call(t,n);function w(t,n){return t&&m(t,n)?t[n]:void 0}var b=t=>Object.keys(t).length>0,v=n=>t(n)&&"string"==typeof n.src&&void 0!==n.v,j=t=>null==t||"string"==typeof t&&""===t.trim(),$=t=>"text"===t||"textarea"===t,O=(t,n)=>"boolean"==typeof t.translatable?t.translatable:n;function k(n,o){const e=w(n,o);return t(e)?e:void 0}function A(t,n){const o=[];return x(t,n,[],[],[],void 0,o),o}function x(n,o,e,r,s,i,c){for(const p of Object.keys(o)){const f=o[p];if(!f||"slot"===f.type)continue;if(0===e.length&&"id"===p)continue;const a=[...e,p],l=[...r,p],u=w(n,p),d=O(f,i);if("object"===f.type&&f.objectFields)null==u?x({},f.objectFields,a,l,s,d,c):t(u)&&x(u,f.objectFields,a,l,s,d,c);else if("array"===f.type&&f.arrayFields){if(!Array.isArray(u))continue;const n=f.arrayFields;u.forEach((o,e)=>{t(o)&&x(o,n,[...a,e],[...l,"*"],[...s,e],d,c)})}else(d??$(f.type))&&c.push({path:a.join("."),segments:a,pattern:l.join("."),indices:s,value:u})}}function z(t,n){const o=t.split("."),e=[],r=[];let s,i=n,c=0;for(;c<o.length;){const t=w(i,o[c]);if(!t||"slot"===t.type)return null;if(0===c&&"id"===o[c])return null;e.push(o[c]),c+=1;const n=O(t,s);if("object"===t.type&&t.objectFields)i=t.objectFields,s=n;else{if("array"!==t.type||!t.arrayFields)return c!==o.length?null:n??$(t.type)?{pattern:e.join("."),indices:r}:null;{const p=o[c];if(void 0===p||!/^(0|[1-9]\d*)$/.test(p))return null;r.push(Number(p)),e.push("*"),c+=1,i=t.arrayFields,s=n}}}return null}function I(n,o){return A(t(n?.props)?n.props:{},i(o,n?.type??d)).map(({path:t,value:n})=>({path:t,value:n}))}function S(t,n,o){const e=A(t,n),r=/* @__PURE__ */new Map,s=[],i=[];if(!o)return{positions:e,hits:r,orphans:s,beaten:i};const c=/* @__PURE__ */new Map;for(const t of e)c.set(t.path,t);const p=/* @__PURE__ */new Map,f=t=>{let n=p.get(t);return void 0===n&&(n=h(t.value),p.set(t,n)),n},a=[];for(const t of Object.keys(o)){const e=o[t],p=c.get(t);if(!v(e)){(p?i:s).push(t);continue}if(p&&f(p)===e.src){r.set(t,{position:p,entry:e,from:t,stale:!1,applied:!0});continue}const l=p??z(t,n);l?l.indices.length>0?a.push({path:t,entry:e,own:p,pattern:l.pattern,indices:l.indices}):p?r.set(t,{position:p,entry:e,from:t,stale:!0,applied:!0}):s.push(t):s.push(t)}a.sort((t,n)=>function(t,n){const o=Math.min(t.length,n.length);for(let e=0;e<o;e++)if(t[e]!==n[e])return t[e]-n[e];return t.length-n.length}(t.indices,n.indices)||(t.path<n.path?-1:t.path>n.path?1:0));const l=[];for(const t of a){let n,o=-1;for(const s of e){if(s.pattern!==t.pattern||r.has(s.path))continue;if(f(s)!==t.entry.src)continue;const e=F(s.indices,t.indices);e>o&&(n=s,o=e)}n?r.set(n.path,{position:n,entry:t.entry,from:t.path,stale:!1,applied:!0}):l.push(t)}for(const t of l)t.own?r.has(t.path)?i.push(t.path):r.set(t.path,{position:t.own,entry:t.entry,from:t.path,stale:!0,applied:!1}):s.push(t.path);return{positions:e,hits:r,orphans:s,beaten:i}}function F(t,n){let o=0;for(;o<t.length&&o<n.length&&t[o]===n[o];)o+=1;return o}function M(n,o,e){const p=t=>{if(!Array.isArray(t))return t;let n=null;return t.forEach((o,r)=>{if(!c(o))return;const s=f(e(o.props.id,o.type,o.props),o.type);s!==o.props&&(n??=[...t],n[r]={...o,props:s})}),n??t},f=(t,n)=>{let e=t;for(const c of r(t,i(o,n))){if(!c.present)continue;const t=p(c.content);t!==c.content&&(e=s(e,c.segments,t))}return e};let a=n;const l=t(n.root?.props)?n.root.props:{},u=e(d,d,l),h=p(n.content);h!==n.content&&(a={...a,content:h});const y=f(u,d);y!==l&&(a={...a,root:{...a.root,props:y}});const g=n.zones;if(t(g)){let t=g;for(const n of Object.keys(g)){if(-1===n.indexOf(":"))continue;const o=p(g[n]);o!==g[n]&&(t={...t,[n]:o})}t!==g&&(a={...a,zones:t})}return a}function E(t,n){const o=/* @__PURE__ */new Map;return M(t,n,(t,n,e)=>(o.has(t)||o.set(t,{type:n,props:e}),e)),o}function N(t,n,o){return o&&b(o)?M(t,n,(t,e,r)=>{const c=k(o,t);if(!c)return r;const p=S(r,i(n,e),c);let f=r;for(const t of p.positions){const n=p.hits.get(t.path);n&&n.applied&&!a(t.value,n.entry.v)&&(f=s(f,t.segments,n.entry.v))}return f}):t}function D(t,n,o){const e={total:0,missing:[],stale:[]};return M(t,n,(t,r,s)=>{const c=S(s,i(n,r),k(o,t));for(const n of c.positions){const o=c.hits.get(n.path);!o&&j(n.value)||(e.total+=1,o?o.stale&&e.stale.push({id:t,path:n.path}):e.missing.push({id:t,path:n.path}))}return s}),e}function C(n,o){let e=n;for(let n=0;n<o.length-1;n++){const r=o[n];if("number"==typeof r){if(!Array.isArray(e)||r>=e.length)return{held:!1,value:void 0};e=e[r]}else{if(!t(e))return{held:!1,value:void 0};e=w(e,r)}}return t(e)?{held:!0,value:w(e,String(o[o.length-1]))}:{held:!1,value:void 0}}function J(n,e,r,s){const c=E(e,r),p={},f=/* @__PURE__ */new Set;if(M(n,r,(t,n,e)=>{if(f.has(t))return e;f.add(t);const l=k(s,t),u=c.get(t);if(!u||u.type!==n||!o(r,n))return l&&(p[t]=l),e;const d=S(e,i(r,n),l),y={};for(const t of d.positions){const n=d.hits.get(t.path),{held:o,value:e}=C(u.props,t.segments),r=n&&n.applied?n.entry.v:t.value;!o||void 0!==e&&a(e,r)?n&&(y[t.path]=n.entry):void 0===e||a(e,t.value)||(y[t.path]={v:e,src:h(t.value)})}if(l)for(const t of d.orphans)m(y,t)||(y[t]=l[t]);return b(y)&&(p[t]=l&&P(y,l)?l:y),e}),!s)return p;for(const n of Object.keys(s))f.has(n)||m(p,n)||!t(s[n])||(p[n]=s[n]);return P(p,s)?s:p}function P(t,n){const o=Object.keys(t);return o.length===Object.keys(n).length&&o.every(o=>m(n,o)&&t[o]===n[o])}function R(t,n,e){const r={},s=/* @__PURE__ */new Set;let c=!1;M(t,n,(t,p,f)=>{if(m(r,t))return f;const a=k(e,t);if(!o(n,p))return U(f,s),a&&(r[t]=a),f;if(!a)return f;const l=function(t,n){let o=0===t.orphans.length&&0===t.beaten.length;const e={};for(const n of t.positions){const r=t.hits.get(n.path);r&&(e[n.path]=r.entry,r.from!==n.path&&(o=!1))}return o?n:e}(S(f,i(n,p),a),a);return l!==a&&(c=!0),b(l)&&(r[t]=l),f});for(const t of s){const n=k(e,t);n&&!m(r,t)&&(r[t]=n)}return c||Object.keys(r).length!==Object.keys(e).length?r:e}function U(n,o){if(Array.isArray(n))for(const t of n)U(t,o);else if(t(n)){c(n)&&"string"==typeof n.props.id&&o.add(n.props.id);for(const t of Object.keys(n))U(n[t],o)}}function B(n,e,r,s){if(!t(s)||!b(s))return s;const c=E(e,r),p=/* @__PURE__ */new Map;if(M(n,r,(t,n,e)=>{if(p.has(t))return e;const f=k(s,t),a=c.get(t);if(!f||!a||a.type!==n||!o(r,n))return e;const l=function(t,n,o,e){const r=S(t,o,e),s=/* @__PURE__ */new Map,i=/* @__PURE__ */new Map;L(t,n,o,"","",void 0,s,i);const c={};let p=0===r.beaten.length;for(const t of r.positions){const n=r.hits.get(t.path);if(!n)continue;const o=s.get(t.path)?.[0];void 0!==o?(c[o]=n.entry,o!==n.from&&(p=!1)):p=!1}for(const t of r.positions){const n=r.hits.get(t.path);if(n)for(const o of i.get(t.path)??[])m(c,o)||(c[o]=n.entry,p=!1)}for(const t of[...r.orphans].sort())m(c,t)?p=!1:c[t]=e[t];return p?e:c}(e,a.props,i(r,n),f);return l!==f&&p.set(t,l),e}),0===p.size)return s;const f={};for(const t of Object.keys(s)){const n=p.get(t);n?b(n)&&(f[t]=n):f[t]=s[t]}return f}function L(n,o,e,r,s,i,c,p){for(const f of Object.keys(e)){const a=e[f];if(!a||"slot"===a.type)continue;if(""===r&&"id"===f)continue;const l=""===r?f:`${r}.${f}`,u=""===s?f:`${s}.${f}`,d=w(n,f),h=w(o,f),y=O(a,i);if("object"===a.type&&a.objectFields){if(null!=d&&!t(d))continue;L(t(d)?d:{},t(h)?h:{},a.objectFields,l,u,y,c,p)}else if("array"===a.type&&a.arrayFields){if(!Array.isArray(d))continue;const n=Array.isArray(h)?h:[];for(const o of T(d,n)){const e=d[o.from];if(!t(e))continue;const r="edited"===o.kind?n[o.to]:e;L(e,t(r)?r:{},a.arrayFields,`${l}.${o.from}`,`${u}.${o.to}`,y,"copy"===o.kind?p:c,p)}}else if(y??$(a.type)){const t=c.get(l);t?t.push(u):c.set(l,[u])}}}function T(t,n){const o=t.map(g),e=n.map(g),r=o.map(()=>!1),s=e.map(()=>!1),i=[],c=Math.min(o.length,e.length);for(let t=0;t<c;t++)o[t]===e[t]&&(i.push({from:t,to:t,kind:"same"}),r[t]=s[t]=!0);for(let t=0;t<e.length;t++){if(s[t])continue;const n=o.findIndex((n,o)=>!r[o]&&n===e[t]);-1!==n&&(i.push({from:n,to:t,kind:"same"}),r[n]=s[t]=!0)}for(let t=0;t<c;t++)r[t]||s[t]||(i.push({from:t,to:t,kind:"edited"}),r[t]=s[t]=!0);for(let t=0;t<e.length;t++){if(s[t])continue;const n=o.indexOf(e[t]);-1!==n&&i.push({from:n,to:t,kind:"copy"})}return i}function X(t,n,o){const e={},s=(t,n)=>{if(t.type!==n.type)return;e[t.props.id]=n.props.id;const p=r(n.props,i(o,n.type));for(const n of r(t.props,i(o,t.type))){const t=p.find(t=>t.slot===n.slot);t&&n.content.forEach((n,o)=>{const e=t.content[o];c(n)&&c(e)&&s(n,e)})}};return c(t)&&c(n)&&s(t,n),e}function Y(t,n){const o={};if(!t)return o;for(const e of Object.keys(n)){const r=k(t,e),s=n[e];r&&b(r)&&"string"==typeof s&&(o[s]={...r})}return o}var q="root",G="default-zone",H={parentId:q,slot:G},K=({parentId:t,slot:n})=>`${t}:${n}`;function Q(t){const n=t.indexOf(":");if(-1===n)throw new W("no-slot",`"${t}" is not a zone key`);return{parentId:t.slice(0,n),slot:t.slice(n+1)}}var V=t=>t.parentId===q&&t.slot===G,W=class extends Error{code;constructor(t,n){super(n),this.name="DataError",this.code=t}};function Z(t){try{const n=globalThis.crypto;if(n&&"function"==typeof n.randomUUID)return`${t}-${n.randomUUID()}`}catch{}return`${t}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function _(t,n){return r(t.props,i(n,t.type)).map(({slot:t,content:n})=>({slot:t,content:n}))}function tt(t,o){return r(nt(t),n(o.root))}function nt(n){return t(n.root?.props)?n.root.props:{}}function ot(t,n,o){const e=(t,n,e,r,s)=>{if(!Array.isArray(t))return t;const i=[...e,n];let f=null;return t.forEach((e,a)=>{if(!c(e))return;const l={place:{...n,index:a},path:i,parent:r,depth:s};let u=o(e,l)??e;if(u!==e&&u.props.id!==e.props.id)throw new W("id-change",`walk: ${e.props.id} came back as ${u.props.id}`);u=p(u,i,s+1),u!==e&&(f??=[...t],f[a]=u)}),f??t},p=(t,o,c)=>{let p=t.props;for(const f of r(t.props,i(n,t.type))){if(!f.present)continue;const n=e(f.content,{parentId:t.props.id,slot:f.slot},o,t,c);n!==f.content&&(p=s(p,f.segments,n))}return p===t.props?t:{...t,props:p}};let f=t;const a=e(t.content,H,[],null,0);a!==t.content&&(f={...f,content:a});let l=nt(f);for(const t of tt(f,n)){if(!t.present)continue;const n=e(t.content,{parentId:q,slot:t.slot},[],null,0);n!==t.content&&(l=s(l,t.segments,n))}l!==nt(f)&&(f={...f,root:{...f.root,props:l}});const u=f.zones;if(u){let t=u;for(const n of Object.keys(u)){const o=et(n);if(!o)continue;const r=e(u[n],o,[],null,0);r!==u[n]&&(t={...t,[n]:r})}t!==u&&(f={...f,zones:t})}return f}function et(t){const n=t.indexOf(":");return-1===n?null:{parentId:t.slice(0,n),slot:t.slice(n+1)}}function rt(t,n,o){let e=null;const r={};try{ot(t,n,(t,n)=>{if(t.props.id===o)throw e={node:t,place:n.place,path:n.path},r})}catch(t){if(t!==r)throw t}return e}function st(t,n,o){if(V(o))return Array.isArray(t.content)?t.content:[];const e=t.zones?.[K(o)];if(o.parentId===q){const r=tt(t,n).find(t=>t.slot===o.slot);return r?r.content:e??null}const s=rt(t,n,o.parentId);if(s){const t=r(s.node.props,i(n,s.node.type)).find(t=>t.slot===o.slot);if(t)return t.content}return e??null}function it(t,n){const o=/* @__PURE__ */new Set;return ot(t,n,t=>{o.add(t.props.id)}),o}function ct(t,n){const o=/* @__PURE__ */new Set([t.props.id]),e=t=>{for(const{content:r}of _(t,n))for(const t of r)c(t)&&(o.add(t.props.id),e(t))};return e(t),o}function pt(t,n,o,e){if(V(o)){const n=Array.isArray(t.content)?t.content:[];return{...t,content:e(n)}}const c=K(o),p=!!t.zones&&Array.isArray(t.zones[c]);if(o.parentId===q){const r=tt(t,n).find(t=>t.slot===o.slot);if(r){const n=s(nt(t),r.segments,e(r.content));return{...t,root:{...t.root,props:n}}}}else{const c=rt(t,n,o.parentId);if(c){const p=r(c.node.props,i(n,c.node.type)).find(t=>t.slot===o.slot);if(p)return ft(t,n,c,t=>({...t,props:s(t.props,p.segments,e(p.content))}))}else if(!p)throw new W("not-found",`no node ${o.parentId}`)}if(p)return{...t,zones:{...t.zones,[c]:e(t.zones[c])}};throw new W("no-slot",`no slot "${o.slot}" on ${o.parentId}`)}function ft(t,n,o,e){return pt(t,n,o.place,t=>{const n=[...t];return n[o.place.index]=e(t[o.place.index]),n})}function at(t,n,o){const e=rt(t,n,o);if(!e)throw new W("not-found",`no node ${o}`);return e}function lt(t,n,o){const e=st(t,n,o);if(e)return e;if(o.parentId!==q&&!rt(t,n,o.parentId))throw new W("not-found",`no node ${o.parentId}`);throw new W("no-slot",`no slot "${o.slot}" on ${o.parentId}`)}function ut(t,n,o){if(!Number.isInteger(t)||t<0||t>n)throw new W("bad-index",`${o}: index ${t} is outside 0…${n}`)}function dt(t,i){const c=o(i,t.type);if(!c)return t;const p=n(c);let f=t.props;for(const t of e(p))null==f[t]&&(f={...f,[t]:[]});for(const t of r(f,p)){if(!t.present)continue;const n=ht(t.content,i);n!==t.content&&(f=s(f,t.segments,n))}return f===t.props?t:{...t,props:f}}function ht(n,o){let e=null;return n.forEach((r,s)=>{if(!t(r)||"string"!=typeof r.type)return;let i=r;if(t(i.props)){if("string"!=typeof i.props.id||""===i.props.id){const{id:t,...n}=i.props;i={...i,props:{id:Z(i.type),...n}}}}else i={...i,props:{id:Z(i.type)}};const c=dt(i,o);c!==r&&(e??=[...n],e[s]=c)}),e??n}function yt(t,o){const i=n(o.root);let c=t.props;for(const t of e(i))null==c[t]&&(c={...c,[t]:[]});for(const t of r(c,i)){if(!t.present)continue;const n=ht(t.content,o);n!==t.content&&(c=s(c,t.segments,n))}return c===t.props?t:{...t,props:c}}function gt(n,o){let e=t(n)?n:{};const r=e.root;if(t(r)){if(!t(r.props)){const t=Object.keys(r).filter(t=>"props"!==t);e={...e,root:t.length?{props:{...wt(r,t)}}:{props:{}}}}}else e={...e,root:{props:{}}};const s=p(o.root);if(s){const t=Object.keys(s).filter(t=>!(t in e.root.props));if(t.length){const n=bt(wt(s,t));e={...e,root:{...e.root,props:{...e.root.props,...n}}}}}const i=yt(e.root,o);i!==e.root&&(e={...e,root:i}),Array.isArray(e.content)||(e={...e,content:[]});const c=ht(e.content,o);return c!==e.content&&(e={...e,content:c}),e=t(e.zones)?function(t,n){let o=t;for(const e of Object.keys(t.zones??{})){const t=o.zones[e];if(!Array.isArray(t)||0===t.length)continue;const r=et(e);if(!r||V(r))continue;const s=mt(o,n,r);if(!s||s.content.length>0)continue;const{[e]:i,...c}=o.zones;o=pt({...o,zones:c},n,r,()=>ht(t,n))}const e=o.zones;let r=e;for(const t of Object.keys(e)){if(!Array.isArray(e[t]))continue;const o=ht(e[t],n);o!==e[t]&&(r={...r,[t]:o})}return r===e?o:{...o,zones:r}}(e,o):{...e,zones:{}},e}function mt(t,n,o){if(o.parentId===q)return tt(t,n).find(t=>t.slot===o.slot);const e=rt(t,n,o.parentId);return e?r(e.node.props,i(n,e.node.type)).find(t=>t.slot===o.slot):void 0}function wt(t,n){const o={};for(const e of n)o[e]=t[e];return o}function bt(t){return void 0===t?t:JSON.parse(JSON.stringify(t))}function vt(t,n,o={},e={}){const r=t.components[n];if(!r)throw new W("unknown-type",`no block type "${n}" in the config`);return dt({type:n,props:{...bt(p(r)??{}),...bt(o),id:e.id??Z(n)}},t)}function jt(n,o,e,r){if(!c(r))throw new W("unknown-type","insert: not a node");const s=lt(n,o,e);ut(e.index,s.length,"insert");const i=dt(t(r.props)&&"string"==typeof r.props.id&&r.props.id?r:{...r,props:{...r.props,id:Z(r.type)}},o),p=it(n,o);for(const t of ct(i,o))if(p.has(t))throw new W("duplicate-id",`insert: ${t} is already in the document`);return pt(n,o,e,t=>[...t.slice(0,e.index),i,...t.slice(e.index)])}function $t(t,n,o){const e=at(t,n,o);let r=pt(t,n,e.place,t=>[...t.slice(0,e.place.index),...t.slice(e.place.index+1)]);if(r.zones&&Object.keys(r.zones).length){const t=ct(e.node,n),o=Object.keys(r.zones).filter(n=>!t.has(n.split(":")[0]));o.length!==Object.keys(r.zones).length&&(r={...r,zones:wt(r.zones,o)})}return r}function Ot(t,n,o,e){const r=at(t,n,o);if(ct(r.node,n).has(e.parentId))throw new W("cycle",`move: ${o} cannot go inside itself`);if(r.place.parentId===e.parentId&&r.place.slot===e.slot){const o=lt(t,n,e);return ut(e.index,o.length-1,"move"),e.index===r.place.index?t:pt(t,n,e,t=>{const n=[...t],[o]=n.splice(r.place.index,1);return n.splice(e.index,0,o),n})}ut(e.index,lt(t,n,e).length,"move");const s=pt(t,n,r.place,t=>[...t.slice(0,r.place.index),...t.slice(r.place.index+1)]);return pt(s,n,e,t=>[...t.slice(0,e.index),r.node,...t.slice(e.index)])}function kt(t,n,o,e={}){const r=at(t,n,o),s=xt(bt(r.node),n,e.strip,e.id);return pt(t,n,r.place,t=>[...t.slice(0,r.place.index+1),s,...t.slice(r.place.index+1)])}function At(t,n,o={}){return xt(bt(t),n,o.strip,o.id)}function xt(t,n,o,e){let p={...t,props:{...t.props,id:e??Z(t.type)}};if(o){const t=o(p);if(t.props.id!==p.props.id)throw new W("id-change","duplicate: strip must not change the id");p=t}let f=p.props;for(const t of r(f,i(n,p.type))){if(!t.present)continue;const e=t.content.map(t=>c(t)?xt(t,n,o):t);f=s(f,t.segments,e)}return dt({...p,props:f},n)}function zt(t,n,o,e){if("id"in e&&e.id!==o)throw new W("id-change",`setProps: ${o} cannot become ${String(e.id)}`);const r=at(t,n,o);return Ft(r.node.props,e)?ft(t,n,r,t=>dt({...t,props:{...t.props,...e,id:o}},n)):t}function It(t,n,o,e){if(!c(e))throw new W("unknown-type","replaceNode: not a node");if(e.props.id!==o)throw new W("id-change",`replaceNode: ${o} cannot become ${String(e.props.id)}`);const r=at(t,n,o),s=dt(e,n),i=it(t,n);for(const t of ct(r.node,n))i.delete(t);for(const t of ct(s,n))if(i.has(t))throw new W("duplicate-id",`replaceNode: ${t} is already in the document`);return ft(t,n,r,()=>s)}function St(t,n,o){const e=nt(t);if(!Ft(e,o))return t;const r=yt({...t.root,props:{...e,...o}},n);return{...t,root:r}}function Ft(t,n){return Object.keys(n).some(o=>!(o in t)||!Object.is(t[o],n[o]))}export{W as DataError,q as ROOT_ID,H as ROOT_LIST,G as ROOT_SLOT,N as applyTranslation,l as changedProps,At as copyNode,Y as copyTranslation,vt as createNode,f as createResolveCache,a as deepEqual,kt as duplicate,J as extractTranslation,rt as find,st as getList,jt as insert,X as mapIds,Ot as move,Z as newId,gt as normalizeData,Q as parseZoneKey,R as pruneTranslation,B as rebaseTranslation,$t as remove,It as replaceNode,u as resolveNodeData,zt as setProps,St as setRoot,_ as slotsOf,I as translatablePaths,h as translationFingerprint,D as translationStatus,ot as walk,K as zoneKey};
1
+ import{isRecord as t,fieldsFrom as n,blockOf as o,topLevelSlotKeys as e,slotLocations as r,setIn as s,fieldsOf as i,isNode as c,defaultsFrom as p}from"./chunk-KXM6YRG2.js";var f=()=>({lastChange:{}});function a(t,n){if(t===n)return!0;if(!t||!n||"object"!=typeof t||"object"!=typeof n)return t!=t&&n!=n;if(Array.isArray(t)!==Array.isArray(n))return!1;if(Array.isArray(t)){const o=n;if(t.length!==o.length)return!1;for(let n=0;n<t.length;n++)if(!a(t[n],o[n]))return!1;return!0}const o=Object.keys(t),e=Object.keys(n);if(o.length!==e.length)return!1;for(const e of o){if(!Object.prototype.hasOwnProperty.call(n,e))return!1;if(!a(t[e],n[e]))return!1}return!0}function l(t,n){if(!t)return{};const o=t.props??{},e=n?.props??{},r={};for(const t of Object.keys(o))r[t]=!a(e[t],o[t]);return r}async function u(i,c,p={}){const{metadata:d={},trigger:h="replace",cache:y=f(),onResolveStart:g,onResolveEnd:m}=p,w=function(t,n){return t.type&&"root"!==t.type?n.components[t.type]:n.root}(i,c);let b={...i};const v=Boolean(w?.resolveData&&i.props),j=t(i.props)&&"id"in i.props?String(i.props.id):"root";if(v){const t=y.lastChange[j];if("force"!==h&&t&&a(i,t.item))return{node:t.resolved,didChange:!1};const n=l(i,t?.item??null);g?.(i);const o=await w.resolveData(i,{changed:n,lastData:t?.item??null,metadata:{...d,...w.metadata??{}},trigger:h})??{};b.props={...i.props,...o.props??{}},o.readOnly&&Object.keys(o.readOnly).length&&(b.readOnly=o.readOnly)}const $=n(i.type&&"root"!==i.type?o(c,i.type):c.root);if(w)for(const t of e($))void 0===b.props[t]&&(b={...b,props:{...b.props,[t]:[]}});for(const t of r(b.props,$)){if(!t.present)continue;const n=await Promise.all(t.content.map(async t=>(await u(t,c,{metadata:d,trigger:h,cache:y,onResolveStart:g,onResolveEnd:m})).node));b={...b,props:s(b.props,t.segments,n)}}return v&&m?.(b),y.lastChange[j]={item:i,resolved:b},{node:b,didChange:!a(i,b)}}var d="root";function h(t){if(void 0===t)return"u";if("string"==typeof t)return`s${t.length.toString(36)}.${y(t)}`;const n=g(t);return`j${n.length.toString(36)}.${y(n)}`}function y(t){let n=2166136261;for(let o=0;o<t.length;o++)n^=t.charCodeAt(o),n=Math.imul(n,16777619);return(n>>>0).toString(36)}function g(t){if(null===t||"object"!=typeof t)return JSON.stringify(t)??"null";if(Array.isArray(t))return`[${t.map(g).join(",")}]`;const n=t;return`{${Object.keys(n).filter(t=>void 0!==n[t]).sort().map(t=>`${JSON.stringify(t)}:${g(n[t])}`).join(",")}}`}var m=(t,n)=>Object.prototype.hasOwnProperty.call(t,n);function w(t,n){return t&&m(t,n)?t[n]:void 0}var b=t=>Object.keys(t).length>0,v=n=>t(n)&&"string"==typeof n.src&&void 0!==n.v,j=t=>null==t||"string"==typeof t&&""===t.trim(),$=t=>"text"===t||"textarea"===t,O=(t,n)=>"boolean"==typeof t.translatable?t.translatable:n;function k(n,o){const e=w(n,o);return t(e)?e:void 0}function A(t,n){const o=[];return x(t,n,[],[],[],void 0,o),o}function x(n,o,e,r,s,i,c){for(const p of Object.keys(o)){const f=o[p];if(!f||"slot"===f.type)continue;if(0===e.length&&"id"===p)continue;const a=[...e,p],l=[...r,p],u=w(n,p),d=O(f,i);if("object"===f.type&&f.objectFields)null==u?x({},f.objectFields,a,l,s,d,c):t(u)&&x(u,f.objectFields,a,l,s,d,c);else if("array"===f.type&&f.arrayFields){if(!Array.isArray(u))continue;const n=f.arrayFields;u.forEach((o,e)=>{t(o)&&x(o,n,[...a,e],[...l,"*"],[...s,e],d,c)})}else(d??$(f.type))&&c.push({path:a.join("."),segments:a,pattern:l.join("."),indices:s,value:u})}}function z(t,n){const o=t.split("."),e=[],r=[];let s,i=n,c=0;for(;c<o.length;){const t=w(i,o[c]);if(!t||"slot"===t.type)return null;if(0===c&&"id"===o[c])return null;e.push(o[c]),c+=1;const n=O(t,s);if("object"===t.type&&t.objectFields)i=t.objectFields,s=n;else{if("array"!==t.type||!t.arrayFields)return c!==o.length?null:n??$(t.type)?{pattern:e.join("."),indices:r}:null;{const p=o[c];if(void 0===p||!/^(0|[1-9]\d*)$/.test(p))return null;r.push(Number(p)),e.push("*"),c+=1,i=t.arrayFields,s=n}}}return null}function I(n,o){return A(t(n?.props)?n.props:{},i(o,n?.type??d)).map(({path:t,value:n})=>({path:t,value:n}))}function S(t,n,o){const e=A(t,n),r=/* @__PURE__ */new Map,s=[],i=[];if(!o)return{positions:e,hits:r,orphans:s,beaten:i};const c=/* @__PURE__ */new Map;for(const t of e)c.set(t.path,t);const p=/* @__PURE__ */new Map,f=t=>{let n=p.get(t);return void 0===n&&(n=h(t.value),p.set(t,n)),n},a=[];for(const t of Object.keys(o)){const e=o[t],p=c.get(t);if(!v(e)){(p?i:s).push(t);continue}if(p&&f(p)===e.src){r.set(t,{position:p,entry:e,from:t,stale:!1,applied:!0});continue}const l=p??z(t,n);l?l.indices.length>0?a.push({path:t,entry:e,own:p,pattern:l.pattern,indices:l.indices}):p?r.set(t,{position:p,entry:e,from:t,stale:!0,applied:!0}):s.push(t):s.push(t)}a.sort((t,n)=>function(t,n){const o=Math.min(t.length,n.length);for(let e=0;e<o;e++)if(t[e]!==n[e])return t[e]-n[e];return t.length-n.length}(t.indices,n.indices)||(t.path<n.path?-1:t.path>n.path?1:0));const l=[];for(const t of a){let n,o=-1;for(const s of e){if(s.pattern!==t.pattern||r.has(s.path))continue;if(f(s)!==t.entry.src)continue;const e=F(s.indices,t.indices);e>o&&(n=s,o=e)}n?r.set(n.path,{position:n,entry:t.entry,from:t.path,stale:!1,applied:!0}):l.push(t)}for(const t of l)t.own?r.has(t.path)?i.push(t.path):r.set(t.path,{position:t.own,entry:t.entry,from:t.path,stale:!0,applied:!1}):s.push(t.path);return{positions:e,hits:r,orphans:s,beaten:i}}function F(t,n){let o=0;for(;o<t.length&&o<n.length&&t[o]===n[o];)o+=1;return o}function M(n,o,e){const p=t=>{if(!Array.isArray(t))return t;let n=null;return t.forEach((o,r)=>{if(!c(o))return;const s=f(e(o.props.id,o.type,o.props),o.type);s!==o.props&&(n??=[...t],n[r]={...o,props:s})}),n??t},f=(t,n)=>{let e=t;for(const c of r(t,i(o,n))){if(!c.present)continue;const t=p(c.content);t!==c.content&&(e=s(e,c.segments,t))}return e};let a=n;const l=t(n.root?.props)?n.root.props:{},u=e(d,d,l),h=p(n.content);h!==n.content&&(a={...a,content:h});const y=f(u,d);y!==l&&(a={...a,root:{...a.root,props:y}});const g=n.zones;if(t(g)){let t=g;for(const n of Object.keys(g)){if(-1===n.indexOf(":"))continue;const o=p(g[n]);o!==g[n]&&(t={...t,[n]:o})}t!==g&&(a={...a,zones:t})}return a}function E(t,n){const o=/* @__PURE__ */new Map;return M(t,n,(t,n,e)=>(o.has(t)||o.set(t,{type:n,props:e}),e)),o}function N(t,n,o){return o&&b(o)?M(t,n,(t,e,r)=>{const c=k(o,t);if(!c)return r;const p=S(r,i(n,e),c);let f=r;for(const t of p.positions){const n=p.hits.get(t.path);n&&n.applied&&!a(t.value,n.entry.v)&&(f=s(f,t.segments,n.entry.v))}return f}):t}function D(t,n,o){const e={total:0,missing:[],stale:[]};return M(t,n,(t,r,s)=>{const c=S(s,i(n,r),k(o,t));for(const n of c.positions){const o=c.hits.get(n.path);!o&&j(n.value)||(e.total+=1,o?o.stale&&e.stale.push({id:t,path:n.path}):e.missing.push({id:t,path:n.path}))}return s}),e}function C(n,o){let e=n;for(let n=0;n<o.length-1;n++){const r=o[n];if("number"==typeof r){if(!Array.isArray(e)||r>=e.length)return{held:!1,value:void 0};e=e[r]}else{if(!t(e))return{held:!1,value:void 0};e=w(e,r)}}return t(e)?{held:!0,value:w(e,String(o[o.length-1]))}:{held:!1,value:void 0}}function R(n,e,r,s){const c=E(e,r),p={},f=/* @__PURE__ */new Set;if(M(n,r,(t,n,e)=>{if(f.has(t))return e;f.add(t);const l=k(s,t),u=c.get(t);if(!u||u.type!==n||!o(r,n))return l&&(p[t]=l),e;const d=S(e,i(r,n),l),y={};for(const t of d.positions){const n=d.hits.get(t.path),{held:o,value:e}=C(u.props,t.segments),r=n&&n.applied?n.entry.v:t.value;!o||void 0!==e&&a(e,r)?n&&(y[t.path]=n.entry):void 0===e||a(e,t.value)||(y[t.path]={v:e,src:h(t.value)})}if(l)for(const t of d.orphans)m(y,t)||(y[t]=l[t]);return b(y)&&(p[t]=l&&J(y,l)?l:y),e}),!s)return p;for(const n of Object.keys(s))f.has(n)||m(p,n)||!t(s[n])||(p[n]=s[n]);return J(p,s)?s:p}function J(t,n){const o=Object.keys(t);return o.length===Object.keys(n).length&&o.every(o=>m(n,o)&&t[o]===n[o])}function P(t,n,e){const r={},s=/* @__PURE__ */new Set;let c=!1;M(t,n,(t,p,f)=>{if(m(r,t))return f;const a=k(e,t);if(!o(n,p))return U(f,s),a&&(r[t]=a),f;if(!a)return f;const l=function(t,n){let o=0===t.orphans.length&&0===t.beaten.length;const e={};for(const n of t.positions){const r=t.hits.get(n.path);r&&(e[n.path]=r.entry,r.from!==n.path&&(o=!1))}return o?n:e}(S(f,i(n,p),a),a);return l!==a&&(c=!0),b(l)&&(r[t]=l),f});for(const t of s){const n=k(e,t);n&&!m(r,t)&&(r[t]=n)}return c||Object.keys(r).length!==Object.keys(e).length?r:e}function U(n,o){if(Array.isArray(n))for(const t of n)U(t,o);else if(t(n)){c(n)&&"string"==typeof n.props.id&&o.add(n.props.id);for(const t of Object.keys(n))U(n[t],o)}}function B(n,e,r,s){if(!t(s)||!b(s))return s;const c=E(e,r),p=/* @__PURE__ */new Map;if(M(n,r,(t,n,e)=>{if(p.has(t))return e;const f=k(s,t),a=c.get(t);if(!f||!a||a.type!==n||!o(r,n))return e;const l=function(t,n,o,e){const r=S(t,o,e),s=/* @__PURE__ */new Map,i=/* @__PURE__ */new Map;G(t,n,o,"","",void 0,s,i);const c={};let p=0===r.beaten.length;for(const t of r.positions){const n=r.hits.get(t.path);if(!n)continue;const o=s.get(t.path)?.[0];void 0!==o?(c[o]=n.entry,o!==n.from&&(p=!1)):p=!1}for(const t of r.positions){const n=r.hits.get(t.path);if(n)for(const o of i.get(t.path)??[])m(c,o)||(c[o]=n.entry,p=!1)}for(const t of[...r.orphans].sort())m(c,t)?p=!1:c[t]=e[t];return p?e:c}(e,a.props,i(r,n),f);return l!==f&&p.set(t,l),e}),0===p.size)return s;const f={};for(const t of Object.keys(s)){const n=p.get(t);n?b(n)&&(f[t]=n):f[t]=s[t]}return f}function G(n,o,e,r,s,i,c,p){for(const f of Object.keys(e)){const a=e[f];if(!a||"slot"===a.type)continue;if(""===r&&"id"===f)continue;const l=""===r?f:`${r}.${f}`,u=""===s?f:`${s}.${f}`,d=w(n,f),h=w(o,f),y=O(a,i);if("object"===a.type&&a.objectFields){if(null!=d&&!t(d))continue;G(t(d)?d:{},t(h)?h:{},a.objectFields,l,u,y,c,p)}else if("array"===a.type&&a.arrayFields){if(!Array.isArray(d))continue;const n=Array.isArray(h)?h:[];for(const o of K(d,n)){const e=d[o.from];if(!t(e))continue;const r="edited"===o.kind?n[o.to]:e;G(e,t(r)?r:{},a.arrayFields,`${l}.${o.from}`,`${u}.${o.to}`,y,"copy"===o.kind?p:c,p)}}else if(y??$(a.type)){const t=c.get(l);t?t.push(u):c.set(l,[u])}}}function K(t,n){const o=t.map(g),e=n.map(g),r=o.map(()=>!1),s=e.map(()=>!1),i=[],c=Math.min(o.length,e.length);for(let t=0;t<c;t++)o[t]===e[t]&&(i.push({from:t,to:t,kind:"same"}),r[t]=s[t]=!0);for(let t=0;t<e.length;t++){if(s[t])continue;const n=o.findIndex((n,o)=>!r[o]&&n===e[t]);-1!==n&&(i.push({from:n,to:t,kind:"same"}),r[n]=s[t]=!0)}for(let t=0;t<c;t++)r[t]||s[t]||(i.push({from:t,to:t,kind:"edited"}),r[t]=s[t]=!0);for(let t=0;t<e.length;t++){if(s[t])continue;const n=o.indexOf(e[t]);-1!==n&&i.push({from:n,to:t,kind:"copy"})}return i}function T(t,n,o){const e={},s=(t,n)=>{if(t.type!==n.type)return;e[t.props.id]=n.props.id;const p=r(n.props,i(o,n.type));for(const n of r(t.props,i(o,t.type))){const t=p.find(t=>t.slot===n.slot);t&&n.content.forEach((n,o)=>{const e=t.content[o];c(n)&&c(e)&&s(n,e)})}};return c(t)&&c(n)&&s(t,n),e}function X(t,n){const o={};if(!t)return o;for(const e of Object.keys(n)){const r=k(t,e),s=n[e];r&&b(r)&&"string"==typeof s&&(o[s]={...r})}return o}var Y="root",q="default-zone",H={parentId:Y,slot:q},L=({parentId:t,slot:n})=>`${t}:${n}`;function Q(t){const n=t.indexOf(":");if(-1===n)throw new W("no-slot",`"${t}" is not a zone key`);return{parentId:t.slice(0,n),slot:t.slice(n+1)}}var V=t=>t.parentId===Y&&t.slot===q,W=class extends Error{code;constructor(t,n){super(n),this.name="DataError",this.code=t}};function Z(t){try{const n=globalThis.crypto;if(n&&"function"==typeof n.randomUUID)return`${t}-${n.randomUUID()}`}catch{}return`${t}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function _(t,n){return r(t.props,i(n,t.type)).map(({slot:t,content:n})=>({slot:t,content:n}))}function tt(t,o){return r(nt(t),n(o.root))}function nt(n){return t(n.root?.props)?n.root.props:{}}function ot(t,n,o){const e=(t,n,e,r,s)=>{if(!Array.isArray(t))return t;const i=[...e,n];let f=null;return t.forEach((e,a)=>{if(!c(e))return;const l={place:{...n,index:a},path:i,parent:r,depth:s};let u=o(e,l)??e;if(u!==e&&u.props.id!==e.props.id)throw new W("id-change",`walk: ${e.props.id} came back as ${u.props.id}`);u=p(u,i,s+1),u!==e&&(f??=[...t],f[a]=u)}),f??t},p=(t,o,c)=>{let p=t.props;for(const f of r(t.props,i(n,t.type))){if(!f.present)continue;const n=e(f.content,{parentId:t.props.id,slot:f.slot},o,t,c);n!==f.content&&(p=s(p,f.segments,n))}return p===t.props?t:{...t,props:p}};let f=t;const a=e(t.content,H,[],null,0);a!==t.content&&(f={...f,content:a});let l=nt(f);for(const t of tt(f,n)){if(!t.present)continue;const n=e(t.content,{parentId:Y,slot:t.slot},[],null,0);n!==t.content&&(l=s(l,t.segments,n))}l!==nt(f)&&(f={...f,root:{...f.root,props:l}});const u=f.zones;if(u){let t=u;for(const n of Object.keys(u)){const o=et(n);if(!o)continue;const r=e(u[n],o,[],null,0);r!==u[n]&&(t={...t,[n]:r})}t!==u&&(f={...f,zones:t})}return f}function et(t){const n=t.indexOf(":");return-1===n?null:{parentId:t.slice(0,n),slot:t.slice(n+1)}}function rt(t,n,o){let e=null;const r={};try{ot(t,n,(t,n)=>{if(t.props.id===o)throw e={node:t,place:n.place,path:n.path},r})}catch(t){if(t!==r)throw t}return e}function st(t,n,o){if(V(o))return Array.isArray(t.content)?t.content:[];const e=t.zones?.[L(o)];if(o.parentId===Y){const r=tt(t,n).find(t=>t.slot===o.slot);return r?r.content:e??null}const s=rt(t,n,o.parentId);if(s){const t=r(s.node.props,i(n,s.node.type)).find(t=>t.slot===o.slot);if(t)return t.content}return e??null}function it(t,n){const o=/* @__PURE__ */new Set;return ot(t,n,t=>{o.add(t.props.id)}),o}function ct(t,n){const o=/* @__PURE__ */new Set([t.props.id]),e=t=>{for(const{content:r}of _(t,n))for(const t of r)c(t)&&(o.add(t.props.id),e(t))};return e(t),o}function pt(t,n,o,e){if(V(o)){const n=Array.isArray(t.content)?t.content:[];return{...t,content:e(n)}}const c=L(o),p=!!t.zones&&Array.isArray(t.zones[c]);if(o.parentId===Y){const r=tt(t,n).find(t=>t.slot===o.slot);if(r){const n=s(nt(t),r.segments,e(r.content));return{...t,root:{...t.root,props:n}}}}else{const c=rt(t,n,o.parentId);if(c){const p=r(c.node.props,i(n,c.node.type)).find(t=>t.slot===o.slot);if(p)return ft(t,n,c,t=>({...t,props:s(t.props,p.segments,e(p.content))}))}else if(!p)throw new W("not-found",`no node ${o.parentId}`)}if(p)return{...t,zones:{...t.zones,[c]:e(t.zones[c])}};throw new W("no-slot",`no slot "${o.slot}" on ${o.parentId}`)}function ft(t,n,o,e){return pt(t,n,o.place,t=>{const n=[...t];return n[o.place.index]=e(t[o.place.index]),n})}function at(t,n,o){const e=rt(t,n,o);if(!e)throw new W("not-found",`no node ${o}`);return e}function lt(t,n,o){const e=st(t,n,o);if(e)return e;if(o.parentId!==Y&&!rt(t,n,o.parentId))throw new W("not-found",`no node ${o.parentId}`);throw new W("no-slot",`no slot "${o.slot}" on ${o.parentId}`)}function ut(t,n,o){if(!Number.isInteger(t)||t<0||t>n)throw new W("bad-index",`${o}: index ${t} is outside 0…${n}`)}function dt(t,i){const c=o(i,t.type);if(!c)return t;const p=n(c);let f=t.props;for(const t of e(p))null==f[t]&&(f={...f,[t]:[]});for(const t of r(f,p)){if(!t.present)continue;const n=ht(t.content,i);n!==t.content&&(f=s(f,t.segments,n))}return f===t.props?t:{...t,props:f}}function ht(n,o){let e=null;return n.forEach((r,s)=>{if(!t(r)||"string"!=typeof r.type)return;let i=r;if(t(i.props)){if("string"!=typeof i.props.id||""===i.props.id){const{id:t,...n}=i.props;i={...i,props:{id:Z(i.type),...n}}}}else i={...i,props:{id:Z(i.type)}};const c=dt(i,o);c!==r&&(e??=[...n],e[s]=c)}),e??n}function yt(t,o){const i=n(o.root);let c=t.props;for(const t of e(i))null==c[t]&&(c={...c,[t]:[]});for(const t of r(c,i)){if(!t.present)continue;const n=ht(t.content,o);n!==t.content&&(c=s(c,t.segments,n))}return c===t.props?t:{...t,props:c}}function gt(n,o){let e=t(n)?n:{};const r=e.root;if(t(r)){if(!t(r.props)){const t=Object.keys(r).filter(t=>"props"!==t);e={...e,root:t.length?{props:{...wt(r,t)}}:{props:{}}}}}else e={...e,root:{props:{}}};const s=p(o.root);if(s){const t=Object.keys(s).filter(t=>!(t in e.root.props));if(t.length){const n=bt(wt(s,t));e={...e,root:{...e.root,props:{...e.root.props,...n}}}}}const i=yt(e.root,o);i!==e.root&&(e={...e,root:i}),Array.isArray(e.content)||(e={...e,content:[]});const c=ht(e.content,o);return c!==e.content&&(e={...e,content:c}),e=t(e.zones)?function(t,n){let o=t;for(const e of Object.keys(t.zones??{})){const t=o.zones[e];if(!Array.isArray(t)||0===t.length)continue;const r=et(e);if(!r||V(r))continue;const s=mt(o,n,r);if(!s||s.content.length>0)continue;const{[e]:i,...c}=o.zones;o=pt({...o,zones:c},n,r,()=>ht(t,n))}const e=o.zones;let r=e;for(const t of Object.keys(e)){if(!Array.isArray(e[t]))continue;const o=ht(e[t],n);o!==e[t]&&(r={...r,[t]:o})}return r===e?o:{...o,zones:r}}(e,o):{...e,zones:{}},e}function mt(t,n,o){if(o.parentId===Y)return tt(t,n).find(t=>t.slot===o.slot);const e=rt(t,n,o.parentId);return e?r(e.node.props,i(n,e.node.type)).find(t=>t.slot===o.slot):void 0}function wt(t,n){const o={};for(const e of n)o[e]=t[e];return o}function bt(t){return void 0===t?t:JSON.parse(JSON.stringify(t))}function vt(t,n,o={},e={}){const r=t.components[n];if(!r)throw new W("unknown-type",`no block type "${n}" in the config`);return dt({type:n,props:{...bt(p(r)??{}),...bt(o),id:e.id??Z(n)}},t)}function jt(n,o,e,r){if(!c(r))throw new W("unknown-type","insert: not a node");const s=lt(n,o,e);ut(e.index,s.length,"insert");const i=dt(t(r.props)&&"string"==typeof r.props.id&&r.props.id?r:{...r,props:{...r.props,id:Z(r.type)}},o),p=it(n,o);for(const t of ct(i,o))if(p.has(t))throw new W("duplicate-id",`insert: ${t} is already in the document`);return pt(n,o,e,t=>[...t.slice(0,e.index),i,...t.slice(e.index)])}function $t(t,n,o){const e=at(t,n,o);let r=pt(t,n,e.place,t=>[...t.slice(0,e.place.index),...t.slice(e.place.index+1)]);if(r.zones&&Object.keys(r.zones).length){const t=ct(e.node,n),o=Object.keys(r.zones).filter(n=>!t.has(n.split(":")[0]));o.length!==Object.keys(r.zones).length&&(r={...r,zones:wt(r.zones,o)})}return r}function Ot(t,n,o,e){const r=at(t,n,o);if(ct(r.node,n).has(e.parentId))throw new W("cycle",`move: ${o} cannot go inside itself`);if(r.place.parentId===e.parentId&&r.place.slot===e.slot){const o=lt(t,n,e);return ut(e.index,o.length-1,"move"),e.index===r.place.index?t:pt(t,n,e,t=>{const n=[...t],[o]=n.splice(r.place.index,1);return n.splice(e.index,0,o),n})}ut(e.index,lt(t,n,e).length,"move");const s=pt(t,n,r.place,t=>[...t.slice(0,r.place.index),...t.slice(r.place.index+1)]);return pt(s,n,e,t=>[...t.slice(0,e.index),r.node,...t.slice(e.index)])}function kt(t,n,o,e={}){const r=at(t,n,o),s=xt(bt(r.node),n,e.strip,e.id);return pt(t,n,r.place,t=>[...t.slice(0,r.place.index+1),s,...t.slice(r.place.index+1)])}function At(t,n,o={}){return xt(bt(t),n,o.strip,o.id)}function xt(t,n,o,e){let p={...t,props:{...t.props,id:e??Z(t.type)}};if(o){const t=o(p);if(t.props.id!==p.props.id)throw new W("id-change","duplicate: strip must not change the id");p=t}let f=p.props;for(const t of r(f,i(n,p.type))){if(!t.present)continue;const e=t.content.map(t=>c(t)?xt(t,n,o):t);f=s(f,t.segments,e)}return dt({...p,props:f},n)}function zt(t,n,o,e){if("id"in e&&e.id!==o)throw new W("id-change",`setProps: ${o} cannot become ${String(e.id)}`);const r=at(t,n,o);return Ft(r.node.props,e)?ft(t,n,r,t=>dt({...t,props:{...t.props,...e,id:o}},n)):t}function It(t,n,o,e){if(!c(e))throw new W("unknown-type","replaceNode: not a node");if(e.props.id!==o)throw new W("id-change",`replaceNode: ${o} cannot become ${String(e.props.id)}`);const r=at(t,n,o),s=dt(e,n),i=it(t,n);for(const t of ct(r.node,n))i.delete(t);for(const t of ct(s,n))if(i.has(t))throw new W("duplicate-id",`replaceNode: ${t} is already in the document`);return ft(t,n,r,()=>s)}function St(t,n,o){const e=nt(t);if(!Ft(e,o))return t;const r=yt({...t.root,props:{...e,...o}},n);return{...t,root:r}}function Ft(t,n){return Object.keys(n).some(o=>!(o in t)||!Object.is(t[o],n[o]))}export{W as DataError,Y as ROOT_ID,H as ROOT_LIST,q as ROOT_SLOT,N as applyTranslation,l as changedProps,At as copyNode,X as copyTranslation,vt as createNode,f as createResolveCache,a as deepEqual,kt as duplicate,R as extractTranslation,rt as find,st as getList,jt as insert,T as mapIds,Ot as move,Z as newId,gt as normalizeData,Q as parseZoneKey,P as pruneTranslation,B as rebaseTranslation,$t as remove,It as replaceNode,u as resolveNodeData,zt as setProps,St as setRoot,_ as slotsOf,I as translatablePaths,h as translationFingerprint,D as translationStatus,ot as walk,L as zoneKey};
@@ -1 +1 @@
1
- function e(e,n,t){return!(!e||!n)&&(e.index===n.index&&(e.zone??t)===(n.zone??t))}function n(e=("undefined"==typeof document?void 0:document)){const n=e?.querySelector(".es-tree"),t=n?.querySelector(".es-tree-row.is-selected");return!!t&&(function(e,n){if("function"!=typeof e.getBoundingClientRect)return!1;if("function"!=typeof n.getBoundingClientRect)return!1;const t=e.getBoundingClientRect(),o=n.getBoundingClientRect();return!(!t.height||!o.height)&&o.top>=t.top&&o.bottom<=t.bottom}(n,t)||t.scrollIntoView({block:"center",inline:"nearest"}),!0)}function t(e,n){return"part"===e.kind?e.nodeId??null:"selection"!==e.kind&&"puck"!==e.kind||null==n?null:String(n)}export{t as markedTreeNodeId,n as revealSelectedTreeRow,e as sameSelector};
1
+ function e(e,n,t){return!(!e||!n)&&(e.index===n.index&&(e.zone??t)===(n.zone??t))}function n(e=("undefined"==typeof document?void 0:document)){const n=e?.querySelector(".es-tree"),t=n?.querySelector(".es-tree-row.is-selected");return!!t&&(function(e,n){if("function"!=typeof e.getBoundingClientRect)return!1;if("function"!=typeof n.getBoundingClientRect)return!1;const t=e.getBoundingClientRect(),o=n.getBoundingClientRect();return!(!t.height||!o.height)&&o.top>=t.top&&o.bottom<=t.bottom}(n,t)||t.scrollIntoView({block:"center",inline:"nearest"}),!0)}function t(e,n){return"part"===e.kind?e.nodeId??null:"selection"!==e.kind||null==n?null:String(n)}export{t as markedTreeNodeId,n as revealSelectedTreeRow,e as sameSelector};
@@ -0,0 +1,64 @@
1
+ import{cloneNodeWithFreshIds as e}from"./chunk-OXZDSOZV.js";import{dedupeSlotChildren as n}from"./chunk-7OCEPOEJ.js";import{styleClipboardOf as t}from"./chunk-G3HAKQUF.js";import{markedTreeNodeId as o,revealSelectedTreeRow as r,sameSelector as i}from"./chunk-UMBNBCL4.js";import{scrollPreviewToSection as l,gotoPreviewSlide as s}from"./chunk-DDH2DYQP.js";import{useEaselKeyTarget as d,useEaselUndoKeys as a,useEaselSaveKey as c,editorRootFocus as p}from"./chunk-YHEYJKQL.js";import{SlotChildActionsProvider as u}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as h,DEFAULT_PANEL_W as f,clampPanelWidth as m}from"./chunk-C56MPJBH.js";import{usePartBridge as g}from"./chunk-6F5GO337.js";import{useSectionOps as y}from"./chunk-FOOK54T2.js";import{ScreenSaveIcon as v,ScreenMainButton as b}from"./chunk-PY7OOQEZ.js";import{useBrowserOffline as k}from"./chunk-RKTF5XLP.js";import{AddChildRow as S}from"./chunk-5545A3PC.js";import{AddSidePanel as w}from"./chunk-FF54HWSE.js";import{keepsSharedSections as x,sharedSectionsOf as z}from"./chunk-N3MJOHAG.js";import{PanelHideButton as C,SidePanelHead as O,PanelShowStrip as N}from"./chunk-SINAM2IT.js";import{offeredChoices as I}from"./chunk-RUQOIQWI.js";import{useScreenSaveSwitch as P,useScreenNodeKeys as B,useScreenPinned as M,useScreenDocumentLabel as $,useScreenCanvasFrame as j,useScreenInspectorPanel as T,useScreenDevices as A,useScreenPickFollowsSelection as L,useScreenLeftView as E,SELECTION_MODE as F,isSelectionMode as R,sameInspectorMode as D,useScreenBridges as H,useScreenBlockRules as V,useScreenBlockLook as Y,useScreenStorageNamespace as W,useScreenNotify as U,useScreenCanvasHead as G,isSlotMode as J,useScreenStyleClipboard as X,useScreenDocumentPass as K,useScreenCanvasDrag as Q,ScreenCanvasTargetProvider as Z,isPinnedFirst as _,isPinnedLast as q,screenSlotsOf as ee}from"./chunk-GXRS52JD.js";import{MediaPopup as ne}from"./chunk-2G6MAXPY.js";import{useNodeClipboard as te,useNodeContextMenu as oe}from"./chunk-AT4DDMJS.js";import{PageEditGuardNotices as re}from"./chunk-GKG3M5QK.js";import{useScreenDocument as ie}from"./chunk-A6ZP5II4.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-YM4UEGBV.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-IYHO4XQX.js";import{heldStyle as ve,styleShortcut as be}from"./chunk-V7U33NF2.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as ke}from"./chunk-6WY6ZXJG.js";import{rootRowName as Se,slotChildRowName as we,slotChildRenameProp as xe,sectionRenameProp as ze}from"./chunk-SSRYU3YG.js";import{ROOT_ZONE as Ce,blockNodeActions as Oe,TREE_MAX_DEPTH as Ne,childSlotsOf as Ie,slotFieldsOf as Pe,newNodeId as Be,slotChildrenIn as Me,nestsInTree as $e}from"./chunk-TCAAOYQY.js";import{useEasel as je,useEaselApi as Te,CanvasPartsContext as Ae,partHasOwnBox as Le,CanvasPassThroughContext as Ee,CanvasSharedContext as Fe}from"./chunk-KXTXYINN.js";import{TreeRow as Re,Subtree as De,LayersTree as He,TreeGroupLabel as Ve,TreeRowAction as Ye,TreeSeam as We}from"./chunk-WHS6Y55E.js";import{DEFAULT_TREE_WORDS as Ue}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as Ge}from"./chunk-WK3AFPXY.js";import{toItemSelector as Je,useNodeOps as Xe,clickPick as Ke}from"./chunk-RPMSET77.js";import{EaselTopBar as Qe,EaselIconButton as Ze,TopBarCluster as _e,DeviceSwitch as qe,InspectorIconButton as en,PanelResizeHandle as nn,MAX_PANEL_W as tn,MIN_PANEL_W_BY_SIDE as on,panelWidthVars as rn}from"./chunk-ZG6PVMC3.js";import{DEFAULT_NOTICE_WORDS as ln,DEFAULT_CHROME_WORDS as sn}from"./chunk-AJSDWWJW.js";import{holderOf as dn,nameOrSomeone as an}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as cn}from"./chunk-RE4LP46F.js";import{useWords as pn}from"./chunk-MFIRYGHW.js";import{insertSeams as un,CanvasDragLayer as hn,CanvasInsert as fn}from"./chunk-LN43DP2A.js";import{DEFAULT_DRAG_WORDS as mn}from"./chunk-TQ5Y6S2X.js";import{createDragSession as gn,useTreeDrag as yn,gapToMoveIndex as vn}from"./chunk-6NJHYXJM.js";import{useCanvasFrame as bn,LIST_SELECTOR as kn,BLOCK_SELECTOR as Sn,useCanvasTyping as wn,useCanvasEvent as xn,nodeIdAt as zn,frameRectToHost as Cn,BLOCK_ATTRIBUTE as On,drawnBox as Nn}from"./chunk-YU3WHLGI.js";import{queryMainCopy as In}from"./chunk-LF3FUSCQ.js";import{ROOT_ID as Pn,ROOT_SLOT as Bn,zoneKey as Mn,parseZoneKey as $n,find as jn,DataError as Tn}from"./chunk-TGZCD6IP.js";import{useRef as An,useMemo as Ln,useState as En,useEffect as Fn,useCallback as Rn,useLayoutEffect as Dn,useContext as Hn,Fragment as Vn,useId as Yn}from"react";import{ColoredBadge as Wn,Button as Un,Tabs as Gn,toast as Jn,readMediaFileDrag as Xn,Tooltip as Kn,groupColors as Qn,Dialog as Zn,FormField as _n,Input as qn,MEDIA_FILE_DRAG_TYPE as et}from"efficient-shell/ui";import{UndoIcon as nt,RedoIcon as tt,RefreshIcon as ot,AddIcon as rt,TrashIcon as it,EyeOffIcon as lt,EyeIcon as st,SharedIcon as dt,DuplicateIcon as at}from"efficient-shell/icons/efficient";import{jsx as ct,jsxs as pt,Fragment as ut}from"react/jsx-runtime";var ht="media-file";function ft({name:e,onMake:n,onCancel:t}){const o=pn("screen",ye).shared,[r,i]=En(e),[l,s]=En(!1),d=Yn(),a=An(null),c=async()=>{const e=r.trim();if(e&&!l){s(!0);try{await n(e)}finally{s(!1)}}};/* @__PURE__ */
2
+ return ct(Zn,{open:!0,size:"sm",title:o.makeShared,description:o.makeSharedHint,onClose:t,initialFocus:a,footer:/* @__PURE__ */pt(ut,{children:[
3
+ /* @__PURE__ */ct(Un,{variant:"secondary",onClick:t,children:o.cancel}),
4
+ /* @__PURE__ */ct(Un,{variant:"primary",loading:l,disabled:!r.trim(),onClick:()=>{c()},children:o.makeShared})]}),children:/* @__PURE__ */ct("form",{onSubmit:e=>{e.preventDefault(),c()},children:/* @__PURE__ */ct(_n,{label:o.name,htmlFor:d,children:/* @__PURE__ */ct(qn,{id:d,ref:a,value:r,onChange:e=>i(e.target.value)})})})})}var mt=/* @__PURE__ */new WeakSet;function gt(e,n,t){const o=jn(e,n,t);if(!o)return null;const r=o.path.find(e=>"root"!==e.parentId);return r?r.parentId:t}function yt({canvas:e,tabs:n,onSelect:t}){const o=An(null),[r,i]=En({}),l=n.map(e=>`${e.id}:${e.below?1:0}`).join("|");return Dn(()=>{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=Cn(l,{left:0,top:0,width:r.innerWidth,height:r.innerHeight},e),a={};for(const o of n){const n=In(t,`[${On}="${r.CSS?.escape?r.CSS.escape(o.id):o.id}"]`),i=n?Nn(n):null;if(!i||0===i.height){a[o.id]=null;continue}const s=Cn(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__ */ct("div",{ref:o,className:"es-band-tabs","aria-hidden":"true",children:n.map(e=>{const n=r[e.id];return n?/* @__PURE__ */ct("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__ */ct(Kn,{content:e.reach,children:/* @__PURE__ */pt(Wn,{colorClass:Qn("success","solid"),size:"sm",children:[
6
+ /* @__PURE__ */ct("span",{className:"es-band-tab-mark",children:/* @__PURE__ */ct(dt,{size:12})}),e.label]})}):/* @__PURE__ */ct(Wn,{colorClass:Qn("info","solid"),size:"sm",children:e.label})},e.id):null})})}function vt({expand:e}){/* @__PURE__ */
7
+ return ct("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */pt(ut,e?{children:[
8
+ /* @__PURE__ */ct("path",{d:"M8 9l4-4 4 4"}),
9
+ /* @__PURE__ */ct("path",{d:"M8 15l4 4 4-4"})]}:{children:[
10
+ /* @__PURE__ */ct("path",{d:"M8 4l4 4 4-4"}),
11
+ /* @__PURE__ */ct("path",{d:"M8 20l4-4 4 4"}),
12
+ /* @__PURE__ */ct("path",{d:"M5 12h14"})]})})}var bt=`${kn}, ${Sn}`;function kt(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 St="__rungs";var wt="screen:band",xt={duplicate:!0,delete:!0},zt=()=>null;function Ct(){const kn=he(),Cn=kn.panels?.Toolbar,On=(kn.panels?.useRight??zt)(),{target:Nn,docId:Yn,capabilities:Kn,currentSlug:Qn,siteId:Zn,onPublish:_n,saveState:qn,saveConflict:dt,retrySave:Ct,toggleAutoSave:Ot,flushSave:Nt,access:It,saveUnreachable:Pt=!1,readOnly:Bt,readOnlyReason:Mt=null}=ie(),$t=P(),jt=B(),{mediaEditing:Tt,hasEditGuard:At,hasPinnedChrome:Lt}=Kn,{appState:Et,dispatch:Ft,history:Rt,selectedItem:Dt,getSelectorForId:Ht,config:Vt}=je(e=>e),Yt=M(),{first:Wt,firstGroup:Ut,lastGroup:Gt,isSectionGroup:Jt,sectionGroupZone:Xt,panelOf:Kt}=Yt,Qt=Kt(Wt),Zt=e=>_(Yt,e),_t=e=>q(Yt,e),qt="node"===Yt.firstRow,eo=Yt.band??null,no=pn("screen",ye),to=pn("tree",Ue),oo=pn("drag",mn),ro=pn("notice",ln),io=pn("lock",cn),lo=pn("menu",Ge),so=pn("styleClipboard",ke),ao=pn("chrome",sn),co=$()??`/${Qn}`,po=j(),uo=T(),ho=y({readOnly:Bt}),fo=y({readOnly:Bt,foldIntoHistory:!0}),mo=An(null),go=Te(),yo=Ln(()=>({...ho,select:e=>{mo.current=e,ho.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=go.config;mo.current=Je(e,t,n)}ho.commitDocument(e,n)}}),[ho,go]),vo=Et.ui,bo=vo.leftSideBarVisible,ko=vo.rightSideBarVisible,{options:So,widths:wo,initial:xo,fluid:zo,fit:Co}=A(),[Oo,No]=En(xo),Io=se(),Po=Tt&&null!==Io;de(),ae();const Bo=ce();L(Dt?.props.id);const{read:Mo,write:$o,forSelection:jo}=E(),[To,Ao]=En(Mo);Fn(()=>{$o(To)},[To]);const[Lo,Eo]=En(0),Fo=An(null),Ro=An(null),Do=bn(Ro,{readySelector:bt}),Ho=wn(Do),Vo=d(Ro);a(Ro,Do);const Yo=k(),Wo=dn(It),Uo={state:qn,offline:Yo||qn.failed&&Pt,readOnlyReason:Mt,editing:Wo?ro.editing({name:an(Wo.name,io),noun:no.noun}):null,conflict:null!=dt,notSaving:no.bar.notSaving},Go=()=>{Bt||(qn.failed?Ct():Nt())};c(Ro,Do,Go);const[Jo,Xo]=En(!1),Ko=An(!1),[Qo,Zo]=En(null),[_o,qo]=En([]),[er,nr]=En(F);R(er);const tr=o(er,Dt?.props.id),[or,rr]=En(null);Fn(()=>{or&&(r(),rr(null))},[or]);const ir=An(Ht);ir.current=Ht;const lr=Rn((e,{scroll:n})=>{Ao(n=>jo(e,n)),n&&rr(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=ir.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Ar(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),sr=An(null);Fn(()=>{const e=sr.current;sr.current=null;const n=null==Dt?.props.id?null:String(Dt.props.id);nr(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:Kt(Dt?.type)??F);const t=Dt?.props.id,o=mo.current;if(mo.current=null,!t)return;const r=Ht(t);lr(String(t),{scroll:!i(o,r??null,Ce)})},[Dt?.props.id,lr]);const dr=Rn(e=>{nr(n=>D(n,e)?n:e),Ft({type:"setUi",ui:{rightSideBarVisible:!0}})},[Ft]),ar=An(()=>{});ar.current=(e,n)=>{const t=e?Bi(e.zone??Ce)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==Dt?.props.id?null:String(Dt.props.id);nr(e=>D(e,n)?e:n),o!==r&&(sr.current={id:o,mode:n},yo.select(e))};const cr=Rn((e,n)=>ar.current(e,n),[]),pr={kind:er.kind,mode:er,open:dr,show:e=>nr(e),reveal:()=>{ko||Ft({type:"setUi",ui:{rightSideBarVisible:!0}})},select:cr},ur=H(pr,{data:Et.data,selected:Dt??null,zoneOf:e=>Ht(e)?.zone,readOnly:Boolean(Bt),select:e=>{nr(F),yo.select({index:e})},replace:(e,n)=>yo.replaceComponent(Ce,e,n),scrollTo:e=>l(e)},{device:Oo,refreshes:Lo},{setView:Ao,reveal:()=>{bo||Ft({type:"setUi",ui:{leftSideBarVisible:!0}})}}),hr=ur.resolveLeftView?ur.resolveLeftView(To):"sections",fr=V(),{isLockedBlock:mr,duplicateBlocked:gr,nestDepth:yr,newSectionNode:vr,canAddTo:br,blockIsOffered:kr}=fr,Sr=Y(),{labelAtLevel:wr,Icon:xr,useProducts:zr}=Sr,Cr=Sr.rowName?(e,n,t)=>Sr.rowName(e,n,t):void 0,Or=Rn(e=>{Ft({type:"setUi",ui:{rightSideBarVisible:!0}}),l(e),lr(e,{scroll:!0})},[Ft,lr]),{selectNode:Nr,openPartId:Ir}=g({mode:er,setMode:nr,onOpenPart:Or}),[Pr,Br]=En(null);fe(null!==Pr,()=>Br(null));const Mr=h(W()),$r=Mr.collapsed,jr=Mr.panelWidths,[Tr,Ar]=En(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem($r);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
13
+ return new Set}});Fn(()=>{try{window.localStorage.setItem($r,JSON.stringify([...Tr]))}catch{}},[Tr]);const[Lr,Er]=En(()=>{if("undefined"==typeof window)return{...f};try{const e=window.localStorage.getItem(jr);if(!e)return{...f};const n=JSON.parse(e);return{left:m(Number(n.left)||f.left,"left"),right:m(Number(n.right)||f.right,"right")}}catch{return{...f}}});Fn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(jr,JSON.stringify(Lr))}catch{}},300);return()=>clearTimeout(e)},[Lr]);const Fr=Rn((e,n)=>Er(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Rr=Rn(e=>Fr("left",e),[Fr]),Dr=Rn(e=>Fr("right",e),[Fr]),Hr=e=>Tr.has(e),Vr=e=>Ar(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Yr=An(!1),Wr=An(null);Fn(()=>{if(Yr.current&&!Jo){const e=Wr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??Ro.current?.querySelector(`button[aria-label="${CSS.escape(no.add.title)}"]`))?.focus(),Wr.current=null}Yr.current=Jo},[Jo]),Fn(()=>{if(!Jo||!Vo)return;const e=e=>{"Escape"===e.key&&dl()};return Vo.addEventListener("keydown",e),()=>Vo.removeEventListener("keydown",e)},[Jo,Vo]),fe(Jo,()=>dl()),Fn(()=>{!bo&&Jo&&(Xo(!1),Zo(null),Ko.current=!1)},[bo]);const Ur=U(),Gr=(e,n="success",t)=>{if(Ur)return void(t?Ur(e,"error"===n?"error":"info",t):Ur(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?Jn.error(e,{...o,duration:t?.duration??3200}):Jn.success(e,{...o,duration:t?.duration??1900})},Jr=An(null),[Xr,Kr]=En(0),[Qr,Zr]=En(0),_r=G(),qr=An(null),ei=e=>Math.max(0,e.clientHeight-(qr.current?.offsetHeight??0));Fn(()=>{const e=Jr.current;if(!e)return;const n=()=>{Kr(e.clientWidth),Zr(ei(e))};n();const t=new ResizeObserver(n);return t.observe(e),qr.current&&t.observe(qr.current),()=>t.disconnect()},[]),Dn(()=>{Jr.current&&(Kr(Jr.current.clientWidth),Zr(ei(Jr.current)))},[Lr,bo,ko]);const ni=Oo===zo?Xr>0?Xr:wo[zo]:wo[Oo],ti=Xr>0?Math.min(Xr/ni,"shrink"===Co?1:2):1,oi=ni*ti,ri=Xr>0&&oi>Xr+1,ii={width:oi,height:Qr||"100%",flex:"none",position:"relative"},li={width:ni,height:Qr?Qr/ti:"100%",maxHeight:"none",transform:1!==ti?`scale(${ti})`:void 0,transformOrigin:"top left"},si=()=>Ft({type:"setUi",ui:{leftSideBarVisible:!bo}}),di=()=>Ft({type:"setUi",ui:{rightSideBarVisible:!ko}}),ai=e=>{Jo&&(Xo(!1),Zo(null),Ko.current=!1,bo&&To===e)||(Ao(e),bo||Ft({type:"setUi",ui:{leftSideBarVisible:!0}}))},ci=()=>{nr(Qt??F),ko||Ft({type:"setUi",ui:{rightSideBarVisible:!0}})},pi=Et.data.content??[],ui=()=>{const e=pi.findIndex(Zt),n=pi.findIndex(_t);return{floor:e>=0?e+1:0,cap:n>=0?n:pi.length}},hi=Vt,fi=fr.stripCopy,mi=n=>e(n,fi),gi=te(),yi=Xe({data:Et.data,config:hi,readOnly:Boolean(Bt),clipboard:gi,strip:fi?e=>fi(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==Pn||e.slot!==Bn)return{min:0,max:n-1};const{floor:t,cap:o}=ui();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&nr(F);const t=void 0===n||"node"===n?.kind?n:null;yo.commitDocument(e,t)}}),vi=ue(),[bi,ki]=En(null),Si=e=>{const n=pi.find(n=>String(n.props.id)===e),t=Yt.shared;n&&t&&yi.swap(e,t.detach(n))},wi=e=>{const n=jn(Et.data,Vt,e);if(!n)return!1;const t=Mn(n.place),o=n.node,r=t===Ce?Ni(o):Hi(o),i=t===Ce?Yt.shared?.usedOn(o):null;return!!yi.remove(e)&&(Gr(i?no.shared.removed({count:Math.max(0,i.length-1)}):no.deleted({name:r}),"success",{duration:8e3,action:{label:no.bar.undo,onClick:()=>{yi.restore(n.node,n.place)}}}),!0)},xi={...yi,remove:wi},zi=e=>wr(e,"block",Vt.components[e]?.label??e),Ci=Rn(e=>Vt.components[e]?.defaultProps??{},[Vt]),Oi=e=>wr(e,"section",zi(e)),Ni=e=>Se({type:e.type,props:e.props??{}},Oi(e.type),Cr),{nodeAddresses:Ii,zoneItems:Pi}=Ln(()=>{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>=Ne)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of Ie(Vt,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(pi,Ce,0),{nodeAddresses:e,zoneItems:n}},[pi,Vt]),Bi=Rn(e=>Pi.get(e)??[],[Pi]),Mi=e=>{const n=Ii.get(e);return n?Bi(n.zone)[n.index]:void 0},$i=e=>ee(fr,Vt,e),ji=e=>{if(!fr.slotsOf||e===Ce)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=Mi(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}},Ti=(()=>{if(!J(er))return null;const e=`${er.nodeId}:${er.slot}`;return ji(e)?.slot.panel===er.kind?e:null})(),Ai=An(null);Fn(()=>{const e=Ai.current;if(Ai.current=null,!Ti||!J(er))return;const n=er.nodeId;lr(n,{scroll:e!==Ti}),Ar(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[er]);const Li=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=Ii.get(e);n&&(n.zone===Ce?nl(n.index):Il(n.zone,n.index,e,Mi(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&Ti!==i&&(Ai.current=i),cr(null,r),ko||Ft({type:"setUi",ui:{rightSideBarVisible:!0}}),l(o)},Ei=(e,n,t)=>{const o=`${e}:${n}`;if(Ar(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;Ti!==o&&(Ai.current=o);cr(null,{kind:t,nodeId:e,slot:n})},Fi=(e,n,t)=>{if(Bt||!fr.moveSlot)return;const o=Mi(e),r=o?$i(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:St,index:n},s=vn(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=fr.moveSlot(e,n,s);"string"==typeof d&&Ei(e,d,i.panel)},Ri=zr(),Di=Ln(()=>{const e=/* @__PURE__ */new Map;for(const n of Ri??[])e.set(n.slug,n.name);return e},[Ri]),Hi=e=>we(e,zi,Sr.plainText,e=>Di.get(e),Sr.rowName),Vi=(e,n)=>{const t=Vt.components[e.type]?.fields,o=n===Ce||es(n)?"section":"block",r=n===Ce&&(Zt(e)||_t(e)||Jt(e.type)),i="block"===o?xe(t):r?null:ze(t);return Sr.renamePropOf?Sr.renamePropOf(e,o,i):i},Yi=(e,n,t,o)=>{if(!(!Bt&&Pr?.zone===e&&Pr.index===n))return;const r=(t,o)=>{Br(null),o&&((e,n,t)=>{const o=Bi(e)[n];if(!o)return;const r=Vi(o,e);r&&yo.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
14
+ return ct("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":no.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(X(),so),Ui=Wi.scope({target:Nn,siteId:Zn,docId:Yn}),Gi=Vt,Ji=(e,n)=>n===Ce?Oi(e):zi(e),Xi=(e,n,t)=>{const o=Wi.plan(Ui,t,Ji(t.type,e),Gi);o&&(o.changed&&yo.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Gr(o.message))},Ki=oe({nodesIn:Bi,nodeAt:(e,n)=>Bi(e)[n]??null,labelOf:(e,n)=>n===Ce?Oi(e):zi(e),renamePropOf:Vi,beginRename:(e,n)=>Br({zone:e,index:n}),history:{hasPast:Rt.hasPast,hasFuture:Rt.hasFuture,back:()=>Rt.back(),forward:()=>Rt.forward()},openPageStyles:ur.openPageStyles,pageStylesLabel:no.pageStyles,words:{menu:lo,styleClipboard:so,screen:no.menu},readOnly:Boolean(Bt),collapseAll:()=>Ar(new Set(Bi(Ce).map(e=>String(e.props.id)))),onPasteRefused:e=>Gr(e?no.pasteRefused({name:e.label}):no.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>os(e,n),menuRows:(e,n,t)=>{const o=ur.menuRows?.(e,n,t)??null,r=((e,n)=>{const t=Yt.shared;if(!t||n!==Ce)return null;const o=t.usedOn(e);if(o){const n={pick:[{label:no.shared.onPages({count:o.length}),onClick:()=>{},children:o.map(e=>({label:e.title,onClick:()=>t.openPage(e)}))}]};return Bt||mr(e.type,e)?n:{...n,change:[{label:no.shared.detach,onClick:()=>Si(e.props.id)}],remove:[{label:no.shared.removeFromPage,danger:!0,onClick:()=>{wi(e.props.id)}}]}}return Bt||Zt(e)||_t(e)||Jt(e.type)?null:x(vi)?{change:[{label:no.shared.makeShared,onClick:()=>ki({id:e.props.id,name:Ni(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=>mr(e.type,e),duplicateBlocked:e=>gr(Et.data,e),permits:e=>{const n=Oe(Vt,e.type);return Yt.shared?.usedOn(e)?{...n,delete:!1}:n},nodeOps:xi,isPinned:(e,n)=>n===Ce&&(Zt(e)||_t(e)),sectionBand:ui,locate:e=>Ii.get(e)??null,rowNameOf:(e,n)=>n===Ce?Ni(e):Hi(e),selectAt:(e,n,t,o)=>{e===Ce?nl(n):Il(e,n,t,o??"")},slotRung:e=>{const n=ji(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(Gi,e).some(e=>!1!==e.counted),copy:(e,n)=>Wi.copy(Ui,e,Ji(e.type,n),Gi),paste:(e,n,t)=>Xi(e,n,t)},keys:jt?{target:Vo,selected:()=>{const e=Et.ui.itemSelector;return e?{zone:e.zone??Ce,index:e.index}:null},held:()=>gi.get(),readOnly:Boolean(Bt),onDone:({done:e,name:n})=>{"copied"===e&&Gr(no.copied({name:n}))}}:void 0},Do),Qi=An({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});Fn(()=>{Qi.current={copy:(e,n)=>Wi.copy(Ui,e,Ji(e.type,n),Gi),paste:Xi,at:()=>{const e=Et.ui.itemSelector;if(!e)return null;const n=e.zone??Ce,t=Bi(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(Bt)}});const Zi=Rn(e=>{const n=be(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))},[]);Fn(()=>{if(!Vo)return;const e=e=>Zi(e);return Vo.addEventListener("keydown",e),()=>Vo.removeEventListener("keydown",e)},[Zi,Vo]),xn(Do,"keydown",Zi);const _i=pi.map(e=>e.props.id).join("|");Fn(()=>{const e=Do?.document??null,n=Do?.window??null;let t=0;const o=[],r=()=>{if(!e)return void qo(e=>e.length?[]:e);const n=pi.findIndex(_t),t=n>=0?n:pi.length,o=n=>{const t=pi[n]?.props?.id;return null==t?null:In(e,`[data-easel-block="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(Sn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=pi.length>0&&!Zt(pi[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=kt(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})}qo(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()}},[Do,_i,Oo,ti,bo,ko,Dt?.props.id]);const qi=Do?.document??null,el=Do?.window??null;Fn(()=>{const e=Fo.current;if(!e||!qi||!el)return;const n=[],t=()=>{const n=In(qi,`[data-easel-block="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&el.scrollTo({left:el.scrollX,top:el.scrollY+t,behavior:"instant"}),!0};return Fo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[qi,el]);const nl=e=>{nr(F),yo.select({index:e}),ur.sectionPressed?.(pi[e]);const n=pi[e]?.props?.id;n&&l(n)},tl=e=>{const{floor:n,cap:t}=ui(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=Dt&&er.kind!==Qt?.kind?pi.findIndex(e=>e.props.id===Dt.props.id):-1;return o(r>=0?r+1:t)},ol=(e,n)=>{const{floor:t,cap:o}=ui(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(yo.reorderComponent(Ce,e,i),yo.select({index:i}),{moved:!0,dest:i})},rl=(e,n,t,o)=>{nr(F),yo.select(o?{index:o.index,zone:o.zone}:{index:e}),l(n),Gr(no.sectionAdded({name:t}))},il=(e,n)=>{const t=tl(n),o=vr(e,{nodeDefaults:Ci,newNodeId:Be,sectionLabel:Oi,blockIsOffered:kr}),r=o?yo.insertNode(Ce,t,o):yo.insertSection(e,t);return rl(t,r,Oi(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 Ie(Vt,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=br(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},ll=e=>sl(Ce,e),sl=(e,n)=>{Wr.current=document.activeElement??null,Zo(null===n?null:{zone:e,index:n}),Xo(!0),bo||(Ko.current=!0,Ft({type:"setUi",ui:{leftSideBarVisible:!0}}))},dl=()=>{Xo(!1),Zo(null),Ko.current&&Ft({type:"setUi",ui:{leftSideBarVisible:!1}}),Ko.current=!1},al=(e,n)=>Sr.rowName?n?Zt(e)?Sr.rowName(e,"section",no.header):_t(e)?Sr.rowName(e,"section",no.footer):Jt(e.type)?Sr.rowName(e,"section",zi(e.type)):Ni(e):Hi(e):n?Oi(e.type):zi(e.type),cl=e=>n=>{e()},pl=(e,n,t)=>{if(Bt)return null;const o=Bi(e)[n];return o&&!Oe(Vt,o.type).delete||o&&mr(o.type,o)?null:/* @__PURE__ */ct(Ye,{kind:"delete",label:e===Ce&&o&&Yt.shared?.usedOn(o)?no.shared.removeFromPage:no.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=Bi(e)[n]?.props?.id;null!=t&&wi(String(t))})(e,n),children:/* @__PURE__ */ct(it,{size:15})})},ul=e=>Sr.rowPreview?.(e)||void 0,hl=e=>Sr.rowMarks?.(e)??void 0,fl=(e,n,t)=>Sr.rowActions?.(e,n,t)??null,ml=(e,n,t,o)=>{if(Bt)return null;if(mr(t.type,t))return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
15
+ return ct(Ye,{kind:"eye",label:r?no.showNamed({name:o}):no.hideNamed({name:o}),onClick:()=>yl(e,n,t),children:/* @__PURE__ */ct(r?lt:st,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},gl=e=>Xs(Ce,e),yl=(e,n,t)=>{yo.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},vl=e=>Pe(Vt,e),bl=e=>Ie(Vt,e),kl=e=>fr.slotsOf?$i(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:Me(e,n.slot)})):[{slot:null,rung:null,kids:bl(e)}],Sl=e=>fr.slotsOf?kl(e).flatMap(e=>e.kids):bl(e),wl=e=>Boolean(fr.slotsOf)&&$i(e).some(e=>e.rung),xl=(e,n,t)=>null===t?void 0===n?br(e):br(e,n):br(e,n,t),zl=(e,n,t)=>{const o=$e(Vt,e.type,n)&&(t||Sl(e).length>0||wl(e));return{collapsible:o,folded:o&&Hr(String(e.props.id))}},Cl=(e,n,t)=>kl(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>zl(e,r,t(e.type)).collapsible?[String(e.props.id),...Cl(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),Ol=e=>Sl(e).length>0||wl(e)||Boolean(br(e.type)),Nl=e=>Boolean(br(e)),Il=(e,n,t,o)=>{if(nr(F),br(o)?.spec?.slider){const t=e.split(":")[0];s(t,n),yo.select({index:n,zone:e}),l(t)}else yo.select({index:n,zone:e}),l(t)},Pl=(e,n,t,o,r)=>{const i=`${e}:${n}`;yo.insertComponent(i,t,o),br(r)?.spec?.slider?requestAnimationFrame(()=>{s(e,o),yo.select({index:o,zone:i})}):yo.select({index:o,zone:i})},Bl=An(/* @__PURE__ */new Set);Fn(()=>{pi.forEach(e=>{const n=br(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(Ci)).forEach((e,t)=>fo.seedChild(o,t,n.childType,e))})},[pi,fo,Ci]);const Ml=An(/* @__PURE__ */new Set);Fn(()=>{pi.forEach((e,t)=>{const o=e.props.id;if(Ml.current.has(o))return;const r=n(e,vl(e.type));Ml.current.add(o),r&&fo.replaceComponent(Ce,t,{...e,props:r})})},[pi,fo]),K(fo,Vt);const $l=pi.findIndex(_t),jl=$l>=0?pi[$l]:null,Tl=qt?pi.findIndex(Zt):-1,Al=Tl>=0?pi[Tl]:null,Ll=Yt.groupTab,El=Ln(()=>Ll?e=>Jt(e.type):void 0,[Ll]),Fl=Boolean(Yt.groupBadge),Rl=Yt.sharedReach,Dl=e=>Rl?.(e)??void 0,Hl=Ln(()=>Rl?new Set(pi.filter(e=>Dl(e)).map(e=>String(e.props.id))):null,[pi,Rl]),Vl=Ln(()=>Hl?e=>Hl.has(e):void 0,[Hl]),Yl=Yt.first?Rl?.({type:Yt.first,props:{id:""}})??void 0:void 0,Wl=Yt.groupBadge?/* @__PURE__ */ct("span",{className:"es-tree-group-badge",children:/* @__PURE__ */ct(Wn,{tone:"info",size:"xs",children:Yt.groupBadge})}):void 0,Ul=pi.find(e=>e.type===Ut)??null,Gl=pi.find(e=>e.type===Gt)??null,Jl=$l>=0?$l:pi.length,Xl=[];pi.forEach(e=>{_t(e)||(Ol(e)&&Xl.push(String(e.props.id)),Xl.push(...Cl(e,1,Nl)))}),jl&&(Xl.push(String(jl.props.id)),Xl.push(...Cl(jl,1,Nl)));const Kl=Xl.length>0&&Xl.every(e=>Tr.has(e)),Ql=e=>{const n=Sr.blockRowName(e,zi);return Sr.rowName?Sr.rowName(e,"block",n):n},Zl=(e,n,t,o)=>{const r=Bi(e)[t];if(!r)return;const i={...$n(e),index:t},l={...$n(n),index:Math.min(Math.max(o,0),Bi(n).length)},s=vn(i,l);if(e!==n||s!==t)try{yi.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof Tn))throw e}},_l=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of bl(e))n.add(r),t(o)};for(const t of vl(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},ql=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Ii.get(n);if(!e)return null;if(e.zone===Ce)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},es=e=>{const n=e.slice(0,e.indexOf(":")),t=pi.find(e=>Jt(e.type)&&String(e.props.id)===n);return t&&Xt(n)===e?t:null},ns=(e,n)=>{const t=es(e);return!t||(!Yt.groupAccepts||Yt.groupAccepts(t.type,n,Bi(e).length))},ts=(e,n,t)=>{if(e.rung){const t=Mi(e.rung.nodeId),o=t?$i(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===St&&n.index>=0&&n.index<=o}if(n.slot===St)return!1;if(e.add)return ls(e.add,n);const o=Mn(n);if(Jt(e.type))return!1;const r=es(o),i=es(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!ns(o,e.type))&&(n.index>=0&&n.index<=Bi(o).length));if(e.zone===Ce||o===Ce){if(e.zone!==o)return!1;const{floor:t,cap:r}=ui();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=jl&&!Yt.lastIsOpen?String(jl.props.id):null;return(!l||ql(e.zone)!==l&&ql(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=Ii.get(i),s=l?Bi(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&_l(r).has(n))return!1;const d=br(s.type,yr(Et?.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)},os=(e,n)=>{const t=Mn(e.from),o=e.node;return t===Mn(n)?ns(t,o.type):ts({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},rs=e=>{const n=e.slice(0,e.indexOf(":")),t=Ii.get(n),o=t?Bi(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=br(o.type,yr(Et?.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=I(r.choices??(r.spec?[{type:r.spec.childType,label:zi(r.spec.childType)}]:[])),l=ji(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:al(o,t.zone===Ce)}},is=(e,n)=>{if("section"!==e.kind)return e;const t=Mn(n);return t===Ce||es(t)?e:rs(t)?.choices.some(n=>n.type===e.type)?{kind:"block",type:e.type}:e},ls=(e,n)=>{const t=is(e,n),o=Mn(n);if("shared"===t.kind){if(o!==Ce||!Yt.shared?.nodeOf(t.section))return!1;const{floor:e,cap:r}=ui();return n.index>=e&&n.index<=r}if("block"!==t.kind){if(es(o)){const e="section"===t.kind?t.type:t.template.node.type;return ns(o,e)&&n.index>=0&&n.index<=Bi(o).length}if(o!==Ce)return!1;const{floor:e,cap:r}=ui();return n.index>=e&&n.index<=r}if(o===Ce)return!1;const r=rs(o);return!(!r||!r.choices.some(e=>e.type===t.type))&&!r.target.spec?.addBlocked?.(Bi(o))},ss=(e,n)=>{const t=is(e,n);if("block"!==t.kind&&es(Mn(n)))return void((e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&ns(n,o)){if("section"===e.kind)yo.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;yo.insertNode(n,t,mi(e.template.node))}nr(F),yo.select({index:t,zone:n})}})(t,Mn(n),n.index);if("section"===t.kind)return void il(t.type,n.index);if("template"===t.kind)return void((e,n,t)=>{const o=tl(t),r=yo.insertNode(Ce,o,n);rl(o,r,e)})(t.template.name,mi(t.template.node),n.index);if("shared"===t.kind){const e=Yt.shared?.nodeOf(t.section);if(!e)return;const o=tl(n.index);return void(yi.restore(e,{parentId:Pn,slot:Bn,index:o})&&rl(o,e.props.id,t.section.title))}const o=Mn(n),r=rs(o);r&&(r.target.spec?Pl(r.parentId,r.target.slot,t.type,n.index,r.parent.type):((e,n,t)=>{yo.insertComponent(e,n,t),nr(F),yo.select({index:t,zone:e})})(o,t.type,n.index))},ds=(e,n)=>{e.media?function(e){const n=Ys();if(!n||!Ds)return;Us(n).then(n=>{n&&function(e,n){if(!Ds)return;const t=Ds.create(e,{nodeDefaults:Ci,newNodeId:Be,sectionLabel:Oi,blockIsOffered:kr}),o=Mn(n);if(o===Ce){const e=tl(n.index),o=yo.insertNode(Ce,e,t);return void rl(e,o,Oi(t.type))}yo.insertNode(o,n.index,t),nr(F),yo.select({index:n.index,zone:o})}(n,e)})}(n):e.rung?Fi(e.rung.nodeId,e.index,n.index):e.add?ss(e.add,n):e.zone===Ce?ol(e.index,n.index):Zl(e.zone,Mn(n),e.index,n.index)},[as]=En(()=>gn()),cs=yn({keyOf:e=>e.id,readOnly:Boolean(Bt),session:as,canDrop:ts,onDrop:ds,onStep:(e,n)=>{e.rung?Fi(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===Ce?((e,n)=>{const t=Oi(pi[e]?.type??""),o=ol(e,n<0?e-1:e+2);if(!o.moved)return void Gr(n<0?no.sectionFirst({name:t}):no.sectionLast({name:t}));const{floor:r,cap:i}=ui();Gr(no.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)}}),ps=Rn(e=>{const{floor:n,cap:t}=ui(),o=[];for(const r of e.nodes){const e=Mn(r.place),i=Bi(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(Zt(i)||_t(i)||mr(i.type,i))continue;if(Jt(i.type))continue;const l=Boolean(es(e)),s=e===Ce||l;e===Ce&&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?Oi(i.type):Hi(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=Mn(e.list);if(n===Ce&&0===e.children.length)return[{...e,addLabel:no.addSection,addAlways:!0}];const t=rs(n),o=t?.target.spec?.addLabel;return e.children.length>0||Boolean(t?.choices.length)||Boolean(es(n))?[o?{...e,addLabel:o}:e]:[]}),i=r.flatMap(e=>{const n=Mn(e.list),t=n===Ce||es(n)?null:rs(n);return t?.choices.length?un(e,t.target.spec?.addLabel??no.addBlockHere):[]});return{sources:o,zones:r,seams:i}},[Et.data]),us=null==Dt?.props.id?null:String(Dt.props.id),hs=Hn(Ae),fs=hs?.selected()&&Do?.document&&us?hs.selectedPart?.(Do.document)??null:null,ms=fs&&us&&Le(Et.data,Vt,us,fs)?fs:null,gs=ms?.label?{element:ms.element,label:ms.label}:null,ys=null!==ms,vs=Rn(e=>{const n=Vt,t=e=>!e.item.rung&&null!==jn(Et.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(us);return i?ys?null:i:r(Ke(Et.data,n,o.item.id,us,El))??o},[Et.data,Vt,us,El,ys]),[bs,ks]=En(null),Ss=Boolean(Ll||Rl);xn(Do,"mouseover",e=>{if(!Ss)return;const n=zn(e.target),t=n?gt(Et.data,Vt,n):null;t!==bs&&ks(t)}),xn(Do,"mouseout",e=>{Ss&&!e.relatedTarget&&ks(null)});const ws=e=>Zt(e)||_t(e)||Jt(e.type),xs=e=>{const n=Jt(e.type)?zi(e.type):Zt(e)?no.header:_t(e)?no.footer:null;return null===n?Ni(e):Sr.rowName?Sr.rowName(e,"section",n):n},zs=[];if(Ss){const e=us?gt(Et.data,Vt,us):null;for(const n of/* @__PURE__ */new Set([e,bs])){const e=n?pi.find(e=>String(e.props.id)===n):void 0;if(!e)continue;const t=Zt(e)||e.type===Ut,o=Dl(e);if(o){zs.push({id:String(e.props.id),label:xs(e),below:t,reach:o});continue}if(!Ll||!ws(e))continue;const r=Ll(e);r&&zs.push({id:String(e.props.id),label:r,below:t})}}const Cs=ue(),Os=An(null);Fn(()=>{const e=Yt.changeNotice;if(!e)return;const n=JSON.stringify(pi.filter(ws)),t=Os.current;if(Os.current={doc:Yn,bands:n,index:Rt.index},!t||t.doc!==Yn||t.bands===n)return;Rt.hasPast&&Rt.index>=t.index&&!mt.has(Cs)&&(mt.add(Cs),Gr(e,"success",{action:{label:no.bar.undo,onClick:()=>Rt.back()},duration:8e3}))},[pi]);const Ns=e=>{nr(F),yo.select(e.zone===Ce?{index:e.index}:{index:e.index,zone:e.zone})},Is=Q(),Ps=()=>({data:Et.data,device:Oo,ops:yo,inspector:pr}),Bs=Is?.model,Ms=Ln(()=>Bs?e=>Bs(e,ps(e),Ps()):ps,[Bs,ps,Oo]),$s=Is?.measure,js=$s?(e,n)=>$s(e,n,Ps()):void 0,Ts=Is?.canDrop,As=Ts?(e,n)=>Ts(e,n,ts,Ps()):ts,Ls=Is?.drop,Es=Ls?(e,n)=>Ls(e,n,ds,Ps()):ds,Fs=Is?.pick,Rs=Fs?e=>Fs(e,Ns,Ps()):Ns,Ds=Is?.media??null,Hs=An(null),Vs=Ln(()=>Ds?{id:ht,zone:"",index:-1,type:Ds.adds.type,add:{kind:Ds.adds.kind,type:Ds.adds.type},media:!0}:null,[Ds]);Fn(()=>{if(!Vs||Bt||"undefined"==typeof document)return;const e=e=>{(e=>Array.from(e.dataTransfer?.types??[]).includes(et))(e)&&(Hs.current=null,as.start({key:ht,item:Vs}))},n=e=>{as.get()?.item.media&&(Hs.current=Xn(e.dataTransfer))},t=()=>{as.get()?.item.media&&as.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)}},[Vs,Bt,as]);const Ys=()=>{const e=Hs.current;return Hs.current=null,e},Ws=pe(),Us=async e=>{if(!Ws)return e;const n=await Ws(e);return n?{...e,id:n.id,url:n.url}:null};const Gs=(e,n)=>{if(!Ds)return;const t=jn(go.getState().appState.data,hi,n);if(!t)return;const o=t.node;yo.replaceComponent(Mn(t.place),t.place.index,{...o,props:{...Ds.replace(o,e),id:o.props.id}})},Js=e=>{const n=Mn(e),t=ji(n);t&&Li(t.node,t.slot,!1),sl(n,e.index)},Xs=(e,n)=>/* @__PURE__ */ct(We,{...Bt?{}:cs.seam({place:{...$n(e),index:n}})},`seam:${e}:${n}`),Ks={rowClick:cl,isCollapsed:Hr,toggleCollapse:Vr},Qs=e=>{const n=String(e.props.id),t=pi.findIndex(e=>String(e.props.id)===n),o=Xt(n),r=Bi(o),i=Hr(n),l=zi(e.type),s=Sr.rowName?Sr.rowName(e,"section",l):l,d=e=>Xs(o,e);/* @__PURE__ */
16
+ return pt(ut,{children:[
17
+ /* @__PURE__ */ct(Re,{words:to,icon:/* @__PURE__ */ct(xr,{type:e.type,size:13}),name:s,preview:ul(e),marks:hl(e),onSelect:()=>nl(t),nameSlot:Yi(Ce,t,n,s),selected:tr===n,badge:Dl(e)?void 0:Wl,shared:Dl(e),actions:fl(e,Ce,t)??void 0,rowProps:{"data-node-id":n,onClick:cl(()=>nl(t))},fold:{open:!i,label:"section",onToggle:()=>Vr(n)}}),!i&&/* @__PURE__ */pt(De,{children:[r.map((n,t)=>{const r=String(n.props.id),i=Ni(n),l=Ol(n),s=l&&Hr(r),a=()=>Il(o,t,r,e.type),{rowProps:c,...p}=cs.row({item:{id:r,zone:o,index:t,type:n.type},place:{...$n(o),index:t}},{"data-node-id":r,onClick:cl(a)});/* @__PURE__ */
18
+ return pt(Vn,{children:[d(t),
19
+ /* @__PURE__ */ct(Re,{words:to,icon:/* @__PURE__ */ct(xr,{type:n.type,size:13}),name:i,preview:ul(n),marks:hl(n),onSelect:a,nameSlot:Yi(o,t,r,i),selected:tr===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Vr(r)}:void 0,actions:/* @__PURE__ */pt(ut,{children:[pl(o,t,i),fl(n,o,t),ml(o,t,n,i)]}),rowProps:c}),l&&!s&&/* @__PURE__ */ct(De,{children:qs(n,2)})]},r)}),d(r.length)]})]})},Zs=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=cs.dragging,d=!Hr(l)&&s?.rung?.nodeId!==i,a={...$n(l),index:0},c=s&&!s.rung&&ts(s,a)?a:void 0,p=()=>Li(e,n,!0),{rowProps:u,...h}=cs.row({item:{id:`rung:${l}`,zone:`${i}:${St}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:St,index:t},into:c,canDrag:Boolean(fr.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:cl(p)}),f=Bt?null:fr.slotActions?.(e,n.slot);/* @__PURE__ */
20
+ return pt(Vn,{children:[n.heading,
21
+ /* @__PURE__ */ct(Re,{words:to,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:Ti===l,...h,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Vr(l)},actions:f&&f.length>0?/* @__PURE__ */ct(ut,{children:f.map((t,o)=>/* @__PURE__ */ct(Ye,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(Bt||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Ei(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__ */ct(it,{size:15}):/* @__PURE__ */ct(at,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */ct(De,{children:r})]},l)},_s=(e,n)=>{const t=kl(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
22
+ return ct(ut,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=xl(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)=>Xs(e,n),p=/* @__PURE__ */pt(ut,{children:[i.map(({child:n,zone:t,index:o})=>{const r=tr===String(n.props.id),{collapsible:i,folded:s}=zl(n,l,Nl(n.type)),d=String(n.props.id),a=Ql(n),p=()=>Il(t,o,d,e.type),{rowProps:u,...h}=cs.row({item:{id:d,zone:t,index:o,type:n.type},place:{...$n(t),index:o}},{"data-node-id":d,onClick:cl(p)});/* @__PURE__ */
23
+ return pt(Vn,{children:[0===o&&c(t,0),
24
+ /* @__PURE__ */ct(Re,{words:to,icon:/* @__PURE__ */ct(xr,{type:n.type,size:13}),name:a,preview:ul(n),marks:hl(n),onSelect:p,nameSlot:Yi(t,o,d,a),selected:r,hidden:Boolean(n.props._hidden),...h,fold:i?{open:!s,label:"group",onToggle:()=>Vr(d)}:void 0,actions:/* @__PURE__ */pt(ut,{children:[pl(t,o,a),fl(n,t,o),ml(t,o,n,a)]}),rowProps:u}),i&&!s&&/* @__PURE__ */ct(De,{children:_s(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?Zs(e,t.rung,r++,o,p):/* @__PURE__ */ct(Vn,{children:p},t.slot??"")})})},qs=(e,n)=>{const t=yr(Et?.data,e.type,String(e.props.id)),o=kl(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
25
+ return ct(ut,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=xl(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)=>Xs(e,n),g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(a&&!a.fixed&&(null===g||g===h)),v=/* @__PURE__ */pt(ut,{children:[l.map(({child:n,zone:t,index:o})=>{const r=tr===String(n.props.id),i=Hi(n),l=String(n.props.id),{collapsible:d,folded:a}=zl(n,s,Nl(n.type)),c=vl(n.type),p=1===c.length?`${l}:${c[0]}`:null,u=p?{...$n(p),index:Bi(p).length}:void 0,h=cs.dragging,f=u&&h&&ts(h,u)?u:void 0,g=()=>Il(t,o,l,e.type),{rowProps:y,...v}=cs.row({item:{id:l,zone:t,index:o,type:n.type},place:{...$n(t),index:o},into:f,canDrag:!mr(n.type,n)},{"data-node-id":l,onClick:cl(g)});/* @__PURE__ */
26
+ return pt(Vn,{children:[0===o&&m(t,0),
27
+ /* @__PURE__ */ct(Re,{words:to,icon:/* @__PURE__ */ct(xr,{type:n.type,size:13}),name:i,preview:ul(n),marks:hl(n),onSelect:g,nameSlot:Yi(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...v,fold:d?{open:!a,label:"group",onToggle:()=>Vr(l)}:void 0,actions:mr(n.type,n)?fl(n,t,o)??void 0:/* @__PURE__ */pt(ut,{children:[pl(t,o,i),fl(n,t,o),ml(t,o,n,i)]}),rowProps:y}),d&&!a&&/* @__PURE__ */ct(De,{children:qs(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&a&&
28
+ /* @__PURE__ */ct(S,{small:!0,label:a.addLabel,blocked:a.addBlocked?.(c)??null,onAdd:()=>Pl(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?Zs(e,o.rung,i++,r,v):/* @__PURE__ */ct(Vn,{children:v},o.slot??"")})})},ed=Jo,nd=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:bo&&!ed&&hr===e.id,onSelect:()=>ai(e.id)}:e,td=[...(ur.railLead??[]).map(nd),{id:"sections",label:no.layers,icon:/* @__PURE__ */ct(me,{}),active:bo&&!ed&&"sections"===hr,onSelect:()=>ai("sections")},...(ur.railTrail??[]).map(nd)],od=Po?{onPress:Bo}:Tt?{onPress:()=>{le(kn,{accept:"image/*",title:ao.mediaLibrary})}}:null,rd={value:td.find(e=>!0===e.active)?.id??"",press:e=>{const n=td.find(n=>n.id===e);n&&!n.disabled&&!0!==n.active&&n.onSelect?.()},items:td.map(e=>({id:e.id,icon:e.icon,label:/* @__PURE__ */ct("span",{className:"sr-only",children:e.label}),tooltip:e.label,disabled:e.disabled}))},id=[...ur.railLead??[],...ur.railTrail??[]].find(e=>"panel"in e&&e.id===hr),ld=Boolean(eo?.foldable),sd=eo?.label??(At?no.pageSections:no.templateSections),dd=ld&&Hr(wt),ad=/* @__PURE__ */pt(ut,{children:[pi.map((e,n)=>{if(Zt(e)||_t(e)||Jt(e.type))return null;const t=tr===String(e.props.id),o=Boolean(e.props._hidden);bl(e);const r=String(e.props.id),i=ur.hasOwnRows?.(e)??!1,l=Ol(e)||i,s=l&&Hr(r),d=vl(e.type),a=1===d.length?`${r}:${d[0]}`:null,c=a?{...$n(a),index:Bi(a).length}:void 0,p=cs.dragging,u=c&&p&&ts(p,c)?c:void 0,{rowProps:h,...f}=cs.row({item:{id:r,zone:Ce,index:n,type:e.type},place:{...$n(Ce),index:n},into:u,canDrag:!mr(e.type,e)},{"data-node-id":r,onClick:cl(()=>nl(n))});/* @__PURE__ */
29
+ return pt(Vn,{children:[n>0&&gl(n),
30
+ /* @__PURE__ */ct(Re,{words:to,icon:/* @__PURE__ */ct(xr,{type:e.type,size:13}),name:Ni(e),preview:ul(e),marks:hl(e),shared:Dl(e),onSelect:()=>nl(n),nameSlot:Yi(Ce,n,r,Ni(e)),selected:t,hidden:o,...f,fold:l?{open:!s,label:"section",onToggle:()=>Vr(r)}:void 0,actions:/* @__PURE__ */pt(ut,{children:[pl(Ce,n,Ni(e)),fl(e,Ce,n),ml(Ce,n,e,Ni(e))]}),rowProps:h}),Ol(e)&&!s&&/* @__PURE__ */pt(De,{children:[qs(e,1),ur.partRows?.(e,Ks)]}),i&&!s&&/* @__PURE__ */ct(De,{children:ur.ownRows?.(e,n,Ks)})]},String(e.props.id??n))}),Jl>0&&gl(Jl)]}),cd=(e,n,t)=>{const o=String(e.props.id),r=Sl(e).length>0||wl(e)||Boolean(br(e.type)),i=r&&Hr(o),l="header"===t?no.header:no.footer,s=Sr.rowName?Sr.rowName(e,"section",l):l;/* @__PURE__ */
31
+ return pt(ut,{children:[
32
+ /* @__PURE__ */ct(Re,{words:to,icon:/* @__PURE__ */ct(xr,{type:t,size:13}),name:s,preview:ul(e),marks:hl(e),badge:Dl(e)?void 0:Wl,shared:Dl(e),onSelect:()=>nl(n),nameSlot:Yi(Ce,n,o,s),selected:tr===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Vr(o)}:void 0,actions:fl(e,Ce,n)??void 0,rowProps:{"data-node-id":o,onClick:cl(()=>nl(n))}}),r&&!i&&/* @__PURE__ */ct(De,{children:_s(e,1)})]})};return(ur.wrap??(e=>e))(
33
+ /* @__PURE__ */ct(Z,{target:Do,children:/* @__PURE__ */pt("div",{ref:Ro,className:"sf-editor es-editor",style:rn(Lr),onContextMenu:Ki.onEditorContextMenu,...p(kn),children:[
34
+ /* @__PURE__ */pt(Qe,{children:[
35
+ /* @__PURE__ */pt("div",{className:"es-cluster es-cluster--left",children:[od?/* @__PURE__ */ct(Un,{variant:"secondary",className:"es-barbtn",leftIcon:/* @__PURE__ */ct(ge,{}),onClick:od.onPress,children:no.railMedia}):null,
36
+ /* @__PURE__ */ct(Ze,{label:no.bar.undo,disabled:Boolean(Bt)||!Rt.hasPast,onClick:()=>Rt.back(),children:/* @__PURE__ */ct(nt,{})}),
37
+ /* @__PURE__ */ct(Ze,{label:no.bar.redo,disabled:Boolean(Bt)||!Rt.hasFuture,onClick:()=>Rt.forward(),children:/* @__PURE__ */ct(tt,{})})]}),
38
+ /* @__PURE__ */pt(_e,{children:[
39
+ /* @__PURE__ */ct(qe,{devices:So,value:Oo,onChange:No}),
40
+ /* @__PURE__ */ct(Ze,{label:no.bar.refresh,tip:no.bar.refreshTip,onClick:()=>{Fo.current=(()=>{const e=Do?.document;if(!e)return null;const n=pi.findIndex(_t),t=n>=0?n:pi.length;let o=null;for(let n=0;n<t;n++){const t=pi[n]?.props?.id;if(null==t)continue;const r=In(e,`[data-easel-block="${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=Dt?.props?.id??pi[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Eo(e=>e+1)},children:/* @__PURE__ */ct(ot,{})}),ur.barView?.()]}),
41
+ /* @__PURE__ */pt(_e,{kind:"right",style:{minWidth:300},children:[
42
+ /* @__PURE__ */ct(v,{input:Uo,words:no.saveStatus}),Cn?/* @__PURE__ */ct(Cn,{}):null,ur.barLead?.(),ur.barTrail?.(),ur.mainAction||!ur.barMain?/* @__PURE__ */ct(b,{input:Uo,action:ur.mainAction??{label:no.done,onPress:()=>{_n(Et.data)}},readOnly:Boolean(Bt),saveSwitch:$t,onToggleAutoSave:Ot,onSaveNow:Go,bar:no.bar,words:no.saveStatus}):ur.barMain()]})]}),
43
+ /* @__PURE__ */ct(re,{}),
44
+ /* @__PURE__ */pt("div",{className:"sf-body",children:[bo?/* @__PURE__ */pt(ut,{children:[
45
+ /* @__PURE__ */pt("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":no.leftPanel,children:[
46
+ /* @__PURE__ */pt("div",{className:"es-paneltabs es-paneltabs--with-hide",children:[
47
+ /* @__PURE__ */ct(C,{side:"left",onHide:si}),
48
+ /* @__PURE__ */ct("span",{className:"es-paneltabs-divider","aria-hidden":"true"}),
49
+ /* @__PURE__ */ct(Gn,{variant:"underline",block:!0,"aria-label":no.bar.views,value:rd.value,onChange:rd.press,items:rd.items})]}),Jo?/* @__PURE__ */ct(w,{at:Qo?{label:(e=>{const n=es(e.zone);if(n)return no.add.addingTo({name:Sr.rowName?al(n,!0):zi(n.type)});if(e.zone===Ce){const n=pi[e.index];return n&&!_t(n)?no.add.addingBefore({name:al(n,!0)}):no.add.addingAtEnd}const t=rs(e.zone);return t?no.add.addingTo({name:t.parentName}):no.add.addingHere})(Qo),onClear:()=>Zo(null)}:void 0,placeBlocks:Qo&&Qo.zone!==Ce?rs(Qo.zone)?.choices:void 0,canTake:Qo?e=>{if(!Qo)return null;const n={...$n(Qo.zone),index:Qo.index};if(ls(e,n))return null;if("shared"===e.kind&&Qo.zone===Ce&&!Yt.shared?.nodeOf(e.section))return no.shared.alreadyHere;const t=es(Qo.zone);if(t)return no.add.notInside({name:al(t,!0)});if(Qo.zone===Ce)return no.add.onlySections;const o=rs(Qo.zone);return o?no.add.notInside({name:o.parentName}):no.add.onlySections}:void 0,onPick:Qo?e=>{if(!Qo)return;const n={...$n(Qo.zone),index:Qo.index};ls(e,n)&&(ss(e,n),dl())}: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:as,siteWide:ur.addPanelRow?.(dl),onClose:dl,readOnly:Boolean(Bt)}):id?id.panel({onHide:si,notify:Gr}):/* @__PURE__ */pt(ut,{children:[
50
+ /* @__PURE__ */ct(O,{icon:/* @__PURE__ */ct(me,{}),title:no.layers,context:co,actions:/* @__PURE__ */pt(ut,{children:[!Bt&&/* @__PURE__ */ct(en,{label:no.add.title,onClick:()=>ll(null),children:/* @__PURE__ */ct(rt,{size:15})}),
51
+ /* @__PURE__ */ct(en,{label:Kl?no.expandAll:no.collapseAll,title:0===Xl.length?no.nothingToFold:void 0,disabled:0===Xl.length,onClick:()=>Ar(e=>{const n=new Set(Xl);return Kl?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Xl])}),children:/* @__PURE__ */ct(vt,{expand:Kl})})]})}),
52
+ /* @__PURE__ */pt(He,{className:"sf-tree sf-scroll",words:to,children:[Ul&&/* @__PURE__ */pt(ut,{children:[!Fl&&/* @__PURE__ */ct(Ve,{children:no.header}),Qs(Ul)]}),Lt&&!(Fl&&Ul)&&/* @__PURE__ */pt(ut,{children:[!Fl&&/* @__PURE__ */ct(Ve,{children:no.header}),!qt&&/* @__PURE__ */ct(Re,{words:to,icon:/* @__PURE__ */ct(xr,{type:"header",size:13}),name:no.header,badge:Yl?void 0:Wl,shared:Yl,onSelect:ci,selected:er.kind===Qt?.kind,rowProps:{onClick:cl(ci)}})]}),Al&&!(Fl&&Ul)&&cd(Al,Tl,"header"),!ld&&/* @__PURE__ */ct(Ve,{children:sd}),ld?/* @__PURE__ */pt(ut,{children:[
53
+ /* @__PURE__ */ct(Re,{words:to,icon:null,name:sd,fold:{open:!dd,label:sd,onToggle:()=>Vr(wt)}}),!dd&&/* @__PURE__ */ct(De,{children:ad})]}):ad,Lt&&!Fl&&/* @__PURE__ */ct(Ve,{children:no.footer}),jl&&!(Fl&&Gl)&&cd(jl,$l,"footer"),Gl&&Qs(Gl),ur.treeFoot?.()]})]})]}),
54
+ /* @__PURE__ */ct(nn,{side:"left",width:Lr.left,min:on.left,max:tn,defaultWidth:f.left,label:no.resizeLeftPanel,onResize:Rr})]}):/* @__PURE__ */ct(N,{side:"left",onShow:si}),
55
+ /* @__PURE__ */pt("div",{ref:Jr,className:"sf-center sf-scroll","data-sf-canvas-head":_r?"":void 0,style:{overflowX:ri?"auto":"hidden",overflowY:"hidden"},children:[_r&&/* @__PURE__ */ct("div",{ref:qr,className:"sf-canvas-head",children:/* @__PURE__ */ct(_r,{device:Oo})}),
56
+ /* @__PURE__ */pt("div",{className:"sf-frame-scaler",style:ii,children:[
57
+ /* @__PURE__ */ct("div",{className:"sf-frame "+(Oo===zo?"":`sf-frame--${Oo}`),style:li,children:/* @__PURE__ */pt("div",{className:"sf-preview-host",children:[
58
+ /* @__PURE__ */ct(Ee.Provider,{value:El,children:/* @__PURE__ */ct(Fe.Provider,{value:Vl,children:/* @__PURE__ */ct(po,{},Lo)})}),
59
+ /* @__PURE__ */ct(hn,{canvas:Do,session:as,model:Ms,measure:js,canDrop:As,onDrop:Es,choose:vs,tag:gs,onPick:Rs,dropOn:Ds?{accepts:(e,n)=>{if(!e.media||!Ds||n.item.rung)return!1;const t=jn(Et.data,hi,n.item.id);return null!==t&&Ds.takes(t.node)},onDrop:(e,n)=>(e=>{const n=Ys();n&&Ds&&Us(n).then(n=>{n&&Gs(n,e.item.id)})})(n),label:()=>no.canvasReplaceImage}:void 0,onZoneAdd:Js,onSeamAdd:Js,zoneAddLabel:no.canvasAddBlock,words:oo.canvas,readOnly:Boolean(Bt),revision:Et.data}),_o.length>0&&!Ho&&/* @__PURE__ */ct("div",{className:"sf-preview-gaps",children:_o.map(e=>
60
+ /* @__PURE__ */ct(fn,{index:e.index,label:no.addSectionHere,onInsert:()=>ll(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))})]})}),Ss?/* @__PURE__ */ct(yt,{canvas:Do,tabs:zs,onSelect:e=>{const n=pi.findIndex(n=>String(n.props.id)===e);n>=0&&nl(n)}}):null]})]}),ko?/* @__PURE__ */pt(ut,{children:[On?
61
+ /* @__PURE__ */ct("div",{className:"es-sidepanel es-sidepanel--right","data-es-host-panel":"",children:On}):/* @__PURE__ */ct(ut,{children:/* @__PURE__ */ct(u,{value:{selectChild:Il,addChild:Pl,childRowName:Hi,blockRowName:Ql},children:/* @__PURE__ */ct(uo,{mode:er,onOpenWebsiteSettings:ur.openSettings??(()=>{}),onOpenSiteStyles:ur.openStyles,onOpenPageStyles:ur.openPageStyles,onSelectNode:Nr,onNotify:Gr,onHidePanel:di,nodeActions:Dt?Oe(Vt,Dt.type):xt})})}),
62
+ /* @__PURE__ */ct(nn,{side:"right",width:Lr.right,min:on.right,max:tn,defaultWidth:f.right,label:no.resizeSettingsPanel,onResize:Dr})]}):
63
+ /* @__PURE__ */ct(N,{side:"right",onShow:di})]}),Ki.menu,
64
+ /* @__PURE__ */ct(ne,{}),bi?/* @__PURE__ */ct(ft,{name:bi.name,onMake:e=>(async(e,n)=>{const t=pi.find(n=>String(n.props.id)===e),o=Yt.shared;if(!t||!o)return;let r;try{r=await z(vi).create(n,t)}catch{return void Gr(no.shared.makeFailed,"error")}o.adopt(t,r),ki(null)})(bi.id,e),onCancel:()=>ki(null)}):null]})}))}export{Ct as ScreenChrome};
@@ -1,2 +1,2 @@
1
- import{ScreenPartsProvider as t}from"./chunk-OHZHYROJ.js";import{useEaselHost as e}from"./chunk-MQA7OFRA.js";import{createEasel as r,EaselProvider as o}from"./chunk-TUXLORVR.js";import{useState as n,useEffect as s}from"react";import{jsx as a}from"react/jsx-runtime";function i({config:i,data:c,onChange:m,permissions:p,parts:f,children:u}){const[d]=n(()=>r({config:i,data:c,permissions:p}));s(()=>{d.setConfig(i)},[d,i]),s(()=>{if(!m)return;let t=d.getState().appState.data,e=!1;return d.subscribe(()=>{const r=d.getState().appState.data;r!==t&&(t=r,(e||r!==d.loaded)&&(e=!0,m(r)))})},[d,m]),s(()=>{p&&d.setPermissions(p)},[d,p]);const h=e();/* @__PURE__ */
1
+ import{ScreenPartsProvider as t}from"./chunk-GXRS52JD.js";import{useEaselHost as e}from"./chunk-MQA7OFRA.js";import{createEasel as r,EaselProvider as o}from"./chunk-KXTXYINN.js";import{useState as n,useEffect as s}from"react";import{jsx as a}from"react/jsx-runtime";function i({config:i,data:c,onChange:m,permissions:p,parts:f,children:u}){const[d]=n(()=>r({config:i,data:c,permissions:p}));s(()=>{d.setConfig(i)},[d,i]),s(()=>{if(!m)return;let t=d.getState().appState.data,e=!1;return d.subscribe(()=>{const r=d.getState().appState.data;r!==t&&(t=r,(e||r!==d.loaded)&&(e=!0,m(r)))})},[d,m]),s(()=>{p&&d.setPermissions(p)},[d,p]);const h=e();/* @__PURE__ */
2
2
  return a(o,{easel:d,hotkeys:h.ownsDocument,children:/* @__PURE__ */a(t,{parts:f,children:u})})}export{i as ScreenStoreProvider};
@@ -1 +1 @@
1
- import{useEaselHost as n}from"./chunk-MQA7OFRA.js";import{useEaselApi as e,bindUndoKeys as t}from"./chunk-TUXLORVR.js";import{useState as r,useEffect as o,useRef as u}from"react";function c(e){const t=n(),[u,c]=r(null);return o(()=>c(e.current),[e]),t.ownsDocument?"undefined"==typeof document?null:document:u}function i(r,u){const i=n(),s=e(),f=c(r);o(()=>{if(!i.ownsDocument&&f)return t(f,s,{leaveTyping:!0})},[i,s,f]);const m=u?.document??null;o(()=>{if(!i.ownsDocument&&m)return t(m,s,{leaveTyping:!0})},[i,s,m])}function s(n){return n.ownsDocument?{}:{tabIndex:-1}}function f(n){return!n.altKey&&!n.shiftKey&&(!(!n.metaKey&&!n.ctrlKey)&&("s"===n.key||"S"===n.key||"KeyS"===n.code))}function m(n,e,t){const r=c(n),i=u(t);o(()=>{i.current=t}),o(()=>{if(!r)return;const n=n=>{f(n)&&(n.preventDefault(),i.current())};return r.addEventListener("keydown",n),()=>r.removeEventListener("keydown",n)},[r]);const s=e?.document??null;o(()=>{if(!s)return;const n=n=>{f(n)&&(n.preventDefault(),i.current())};return s.addEventListener("keydown",n),()=>s.removeEventListener("keydown",n)},[s])}export{s as editorRootFocus,f as isSaveShortcut,c as useEaselKeyTarget,m as useEaselSaveKey,i as useEaselUndoKeys};
1
+ import{useEaselHost as n}from"./chunk-MQA7OFRA.js";import{useEaselApi as e,bindUndoKeys as t}from"./chunk-KXTXYINN.js";import{useState as r,useEffect as o,useRef as u}from"react";function c(e){const t=n(),[u,c]=r(null);return o(()=>c(e.current),[e]),t.ownsDocument?"undefined"==typeof document?null:document:u}function i(r,u){const i=n(),s=e(),f=c(r);o(()=>{if(!i.ownsDocument&&f)return t(f,s,{leaveTyping:!0})},[i,s,f]);const m=u?.document??null;o(()=>{if(!i.ownsDocument&&m)return t(m,s,{leaveTyping:!0})},[i,s,m])}function s(n){return n.ownsDocument?{}:{tabIndex:-1}}function f(n){return!n.altKey&&!n.shiftKey&&(!(!n.metaKey&&!n.ctrlKey)&&("s"===n.key||"S"===n.key||"KeyS"===n.code))}function m(n,e,t){const r=c(n),i=u(t);o(()=>{i.current=t}),o(()=>{if(!r)return;const n=n=>{f(n)&&(n.preventDefault(),i.current())};return r.addEventListener("keydown",n),()=>r.removeEventListener("keydown",n)},[r]);const s=e?.document??null;o(()=>{if(!s)return;const n=n=>{f(n)&&(n.preventDefault(),i.current())};return s.addEventListener("keydown",n),()=>s.removeEventListener("keydown",n)},[s])}export{s as editorRootFocus,f as isSaveShortcut,c as useEaselKeyTarget,m as useEaselSaveKey,i as useEaselUndoKeys};
@@ -0,0 +1 @@
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-easel-block";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=u(e);t.width<=0||t.height<=0||(n=Math.min(n,t.left),o=Math.min(o,t.top),r=Math.max(r,t.left+t.width),i=Math.max(i,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 s(t,e){return t===e||t.contains(e)||e.contains(t)}var l=4;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=t.getBoundingClientRect(),r=n?.getBoundingClientRect()??{left:0,top:0},i=a(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 f(t){const e=t.offsetWidth;if(!e)return 1;const n=t.getBoundingClientRect().width;return n>0?n/e:1}function h(t,e,n){const o=d(t,e,n),r=f(n);return{left:o.left/r,top:o.top/r,width:o.width/r,height:o.height/r}}function m(t,e,n){const o=t.getBoundingClientRect(),r=f(t);return{x:(e-o.left)/r,y:(n-o.top)/r}}function w(t,e,n,o){const{left:r,top:i}=d(t,{left:e,top:n,width:0,height:0},o);return{x:r,y:i}}function b({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 g="data-es-canvas-style",v=/* @__PURE__ */new WeakMap;function p(t,e){e?v.set(t,e):v.delete(t)}function y(t,e,n){const o=t.head??t.documentElement;let r=A(t,e);if(!r){r=t.createElement("style"),r.setAttribute(g,e);const n=v.get(t);n&&r.setAttribute("nonce",n),o.appendChild(r)}return r.textContent!==n&&(r.textContent=n),r}function E(t,e){A(t,e)?.remove()}function A(t,e){for(const n of Array.from(t.querySelectorAll(`style[${g}]`)))if(n.getAttribute(g)===e)return n;return null}var C="[data-easel-block]",L="[data-easel-dropzone]",x="iframe#preview-frame";function M(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 S(t,e,{selector:n=x,readySelector:o}={}){let r=null,i=null,c=!1,u=!1,s=null;const l=()=>{s?.observer.disconnect(),s=null},a=()=>{if(u)return;let t=null;if(r&&M(r)){const e=r.contentDocument;(t=>{if(!o||t.querySelector(o))return l(),!0;if(s?.doc!==t){l();const e=t.defaultView?.MutationObserver;if(e){const n=new e(()=>a());n.observe(t,{childList:!0,subtree:!0}),s={doc:t,observer:n}}}return!1})(e)&&(t={frame:r,document:e,window:r.contentWindow})}else l();(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(),l(),r?.removeEventListener("load",d),r=null}}function R(n,{selector:o,readySelector:r}={}){const[i,c]=t(null);return e(()=>{const t=n.current;if(!t)return;const e=S(t,c,{selector:o,readySelector:r});return()=>{e(),c(null)}},[n,o,r]),i}var B="easel:canvas-typing",W="easel:canvas-typable";function k(t,o,r,{on:i="document",capture:c=!1}={}){const u=n(r);u.current=r;const s=t?.document??null,l=t?.window??null;e(()=>{const t="window"===i?l:s;if(!t)return;const e=t=>u.current(t);return t.addEventListener(o,e,c),()=>t.removeEventListener(o,e,c)},[s,l,o,i,c])}function q(e){const[n,o]=t(!1);return k(e,B,t=>o(Boolean(t.detail?.typing))),n}function N(t,n,o){const r=t?.document??null;e(()=>{if(!r)return;if(!o)return void E(r,n);const t=y(r,n,o),e=r.defaultView?.MutationObserver,i=e?new e(()=>{t.isConnected||y(r,n,o)}):null;return i?.observe(r.head??r.documentElement,{childList:!0}),()=>{i?.disconnect(),E(r,n)}},[r,n,o])}function T(n,{settle:o=[150,450]}={}){const[r,i]=t(0),c=n?.frame??null,u=n?.document??null,s=n?.window??null,l=o.join(",");return e(()=>{if(!c||!u||!s)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()},l=[],a=(t,e)=>{t.addEventListener(e,r,!0),l.push(()=>t.removeEventListener(e,r,!0))};a(u,"scroll"),a(s,"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),l.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}),l.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 l)t();for(const t of w)clearTimeout(t);n&&t?.cancelAnimationFrame&&t.cancelAnimationFrame(n)}},[c,u,s,l]),r}export{i as BLOCK_ATTRIBUTE,C as BLOCK_SELECTOR,x as CANVAS_SELECTOR,W as CANVAS_TYPABLE_EVENT,B as CANVAS_TYPING_EVENT,L as LIST_SELECTOR,l as WORDS_CLEAR,m as clientPointToLayer,u as drawnBox,f as elementScale,b as fitCanvas,w as framePointToHost,d as frameRectToHost,h as frameRectToLayer,a as frameScale,M as isFrameReady,r as isTypingTarget,c as nodeIdAt,s as related,E as removeCanvasStyle,p as setCanvasNonce,y as upsertCanvasStyle,k as useCanvasEvent,R as useCanvasFrame,T as useCanvasLayout,N as useCanvasStyle,q as useCanvasTyping,S as watchCanvasFrame};
@@ -1,17 +1,31 @@
1
1
  import * as react from 'react';
2
- import { c as CopyBoxProps, d as CopyCell, T as TextBoxHandle } from '../canvas-typing-Be4FO4q7.js';
3
- export { e as COPY_CELLS, b as CanvasTypingEnd, f as CanvasTypingOptions, g as CanvasTypingSession, h as ColorWindow, i as CopyBoxAlign, j as CopyBoxFooter, C as CopyBoxLastTool, k as CopyCase, l as CopyCellPreset, m as CopyCells, a as CopyThemeColor, M as MarkWriter, S as SelectionSource, n as TextAreaHandle, o as TextMap, p as ToolbarMark, q as colorRunOf, r as insertSelection, s as markSelection, t as startCanvasTyping, u as textMap } from '../canvas-typing-Be4FO4q7.js';
2
+ import { c as CopyBoxProps, d as CopyCell, T as TextBoxHandle } from '../canvas-typing-DOBx8dD3.js';
3
+ export { e as COPY_CELLS, b as CanvasTypingEnd, f as CanvasTypingOptions, g as CanvasTypingSession, h as ColorWindow, i as CopyBoxAlign, j as CopyBoxFooter, C as CopyBoxLastTool, k as CopyCase, l as CopyCellPreset, m as CopyCells, a as CopyThemeColor, M as MarkWriter, S as SelectionSource, n as TextAreaHandle, o as TextMap, p as ToolbarMark, q as colorRunOf, r as insertSelection, s as markSelection, t as startCanvasTyping, u as textMap } from '../canvas-typing-DOBx8dD3.js';
4
4
  import { TextAlign } from 'efficient-shell/ui';
5
5
  export { TextToolbar, TextToolbarProps } from 'efficient-shell/ui';
6
- import { F as FieldOption } from '../types-B8NwXKlE.js';
6
+ import { F as FieldOption } from '../types-BIytwvvH.js';
7
7
  import { TextStyleCase } from '../text-styles/model.js';
8
8
  import { InlineRule, MarkStyle, MarkedLine, WrapResult } from 'efficient-shell/markup';
9
- export { C as CopyWords } from '../words-BpTjCfqO.js';
10
- import '../buckets-Sw94ll9I.js';
11
- import '../words-gIDCeRv3.js';
9
+ export { C as CopyWords } from '../words-Cf5VT2Ic.js';
10
+ import '../buckets-_MGDYJlb.js';
11
+ import '../words-B5Gb7KFq.js';
12
12
 
13
13
  declare function CopyBox({ value, onChange, onCommit, onCancel, multiline, placeholder, ariaLabel, className, readOnly, rules, tools, writeMark, align, actions, toolbar, barLabel, renderFooter, inputRef, barShows, richText, defaultShowMarks, colors, cells, letterCase, lastTool, }: CopyBoxProps): react.JSX.Element;
14
14
 
15
+ /**
16
+ * The range Clear formatting acts on, in one place: the selected words, or —
17
+ * with none selected (a caret, or a field never focused) — the whole value,
18
+ * which the field stands for. The copy box and the website editor's field bar
19
+ * both read it from here (Lewis 2026-10-26: one Clear button, by the range).
20
+ */
21
+ declare function clearRangeOf(sel: {
22
+ start: number;
23
+ end: number;
24
+ } | null, length: number): {
25
+ start: number;
26
+ end: number;
27
+ };
28
+
15
29
  /** Whether the lines are a list, and which kind. */
16
30
  type TextList = 'none' | 'bullet' | 'number';
17
31
  /** How the letters are drawn: as typed, all capitals, each word capitalized,
@@ -323,4 +337,4 @@ interface CaretEdit {
323
337
  */
324
338
  declare function useCaretEdit({ target, onChange }: CaretEdit): (edit: (el: HTMLInputElement | HTMLTextAreaElement | null) => WrapResult) => void;
325
339
 
326
- export { type CaretEdit, CopyBox, CopyBoxProps, CopyCell, type History, MARKUP_CLIPBOARD_TYPE, type PasteData, type PasteOptions, RichBox, type RichBoxProps, type RichEdit, type RichHandle, type RichInputEvent, type RichInputResult, type RichInsert, type RichLayout, type RichLine, type RichPending, type Snapshot, TYPING_BURST_MS, TextBoxHandle, type TextCase, type TextList, TextPartPanel, type TextPartPanelProps, type TextPartStrip, createHistory, editVisible, markupOfRange, newLine, pasteToMarkup, richInput, richLayout, selectionToSource, selectionToVisible, setBullet, toSource, toSourceStart, toVisible, useCaretEdit };
340
+ export { type CaretEdit, CopyBox, CopyBoxProps, CopyCell, type History, MARKUP_CLIPBOARD_TYPE, type PasteData, type PasteOptions, RichBox, type RichBoxProps, type RichEdit, type RichHandle, type RichInputEvent, type RichInputResult, type RichInsert, type RichLayout, type RichLine, type RichPending, type Snapshot, TYPING_BURST_MS, TextBoxHandle, type TextCase, type TextList, TextPartPanel, type TextPartPanelProps, type TextPartStrip, clearRangeOf, createHistory, editVisible, markupOfRange, newLine, pasteToMarkup, richInput, richLayout, selectionToSource, selectionToVisible, setBullet, toSource, toSourceStart, toVisible, useCaretEdit };