efficient-easel 18.0.0 → 18.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
- import{buildPaletteSections as e,pinnedSection as t,categoryLabel as n}from"./chunk-PA3PNTVV.js";import{blockTypesIn as o}from"./chunk-5ZBY24K7.js";import{sectionTemplatesOf as l}from"./chunk-BVN33R76.js";import{sharedSectionsOf as r}from"./chunk-43AEUUNQ.js";import{SidePanelHead as i,PanelModeExit as s}from"./chunk-XDZHKYQX.js";import{blockRuns as c}from"./chunk-M2Z775ZC.js";import{useScreenBlockLook as a,useScreenBlockRules as d,useScreenPinned as p}from"./chunk-XHSGRH42.js";import{useEaselSession as m}from"./chunk-O7Q4DDJT.js";import{DEFAULT_SCREEN_WORDS as f}from"./chunk-C2RHV42O.js";import{useEasel as u}from"./chunk-QEAUF632.js";import{easelMenuEntries as y}from"./chunk-BALFHI3G.js";import{useWords as h}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-LLDHIBYG.js";import{DEFAULT_DRAG_WORDS as g}from"./chunk-KAML3KQH.js";import{useState as b,useEffect as v,useMemo as j,useRef as w}from"react";import{SharedIcon as C,AddIcon as H}from"efficient-shell/icons/efficient";import{ContextMenu as A,toast as L,Dialog as $,Button as x}from"efficient-shell/ui";import{jsx as B,jsxs as D,Fragment as E}from"react/jsx-runtime";function F({name:e,pages:t,onDelete:n,onCancel:o}){const l=h("screen",f).shared,[r,i]=b(!1),s=w(null);/* @__PURE__ */
2
- return B($,{open:!0,role:"alertdialog",size:"sm",title:l.deleteTitle({name:e}),onClose:o,initialFocus:s,footer:/* @__PURE__ */D(E,{children:[
3
- /* @__PURE__ */B(x,{ref:s,variant:"secondary",onClick:o,children:l.cancel}),
4
- /* @__PURE__ */B(x,{variant:"danger",loading:r,onClick:()=>{(async()=>{i(!0);try{await n()}finally{i(!1)}})()},children:l.deleteShared})]}),children:l.deleteMessage({count:t})})}var O=e=>`section:${e}`,T=e=>`block:${e}`,I=e=>`template:${e}`,M=e=>`shared:${e}`;function N({at:w,placeBlocks:$,canTake:x,onPick:N,itemFor:Q,session:R,siteWide:S,onClose:z,onHide:G,readOnly:K}){const P=u(e=>e.config),V=a(),{labelAtLevel:Y,categoryLabel:Z,firstSection:U,Icon:W,Thumbnail:X}=V,{blockIsOffered:_,canAddTo:J}=d(),q=h("screen",f).add,ee=h("drag",g).add,te=m(),[ne,oe]=b([]);v(()=>{let e=!1;const t=e=>_(e,te);return l(te).list().then(n=>{if(e)return;const l=P.components;oe(n.filter(e=>e.node?.type&&l[e.node.type]&&o(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[P,te]);const le=p().shared,re=h("screen",f).shared,[ie,se]=b([]),[ce,ae]=b(0);v(()=>{if(!le)return;let e=!1;const t=e=>_(e,te);return r(te).list().then(n=>{if(e)return;const l=P.components;se(n.filter(e=>e.node?.type&&l[e.node.type]&&o(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[P,te,ce]);const[de,pe]=b(null),[me,fe]=b(null),ue=j(()=>e(P,V),[P]),ye=e=>Y(e,"section",P.components[e]?.label??e),he=e=>({type:O(e.type),label:e.name,cover:/* @__PURE__ */B(X,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:q.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),ke=e=>{const t=e.indexOf(":"),n=e.slice(0,t),o=e.slice(t+1);if("section"===n)return{kind:"section",type:o};if("block"===n)return{kind:"block",type:o};if("template"===n){const e=ne.find(e=>e.id===o);return e?{kind:"template",template:e}:null}if("shared"===n){const e=ie.find(e=>e.id===o);return e?{kind:"shared",section:e}:null}return null},ge=e=>/* @__PURE__ */B("span",{className:"es-add-glyph-cover",children:/* @__PURE__ */B(W,{type:e,size:26})}),be=j(()=>{const e=t(ue,U),o=/* @__PURE__ */new Map,l=e=>{e.retired||o.has(e.type)||!_(e.type,te)||o.set(e.type,e)};for(const t of e?[e]:ue){const e=J(t.type)?.choices??[];e.forEach(l),e.forEach(e=>J(e.type,1)?.choices?.forEach(l))}$?.forEach(l);const r=new Set(ue.map(e=>e.type)),i=[...o.values()].filter(e=>!r.has(e.type)),s=e=>({type:T(e.type),label:e.label,cover:ge(e.type),title:q.tile({name:e.label}),keywords:[e.group??"",e.type].filter(Boolean)}),a=e=>o.has(e.type)?{...he(e),cover:ge(e.type)}:he(e),d=[];ie.length>0&&d.push({key:"shared",title:re.group,tiles:ie.map(e=>({type:M(e.id),label:e.title,cover:/* @__PURE__ */B(X,{type:e.node.type}),mark:/* @__PURE__ */B(C,{size:12}),title:re.onPages({count:e.used_on.length}),keywords:[ye(e.node.type),e.node.type]}))}),ne.length>0&&d.push({key:"templates",title:q.templates,tiles:ne.map(e=>({type:I(e.id),label:e.name,cover:/* @__PURE__ */B(X,{type:e.node.type}),keywords:[ye(e.node.type),e.node.type]}))});const p=i.filter(e=>!e.group);let m=!1;for(const t of Object.keys(P.categories??{})){const o=ue.filter(e=>e.cat===t);if(0===o.length)continue;const l=e&&o.some(t=>t.type===e.type)?e:null,r=(l?[l,...o.filter(e=>e.type!==l.type)]:o).map(a);l&&!m&&(r.splice(1,0,...p.map(s)),m=!0),d.push({key:`category:${t}`,title:n(P,t,Z),tiles:r})}const f=d.find(e=>e.key?.startsWith("category:"));if(!m&&f&&p.length>0&&(f.tiles=[...f.tiles,...p.map(s)],m=!0),c(i.filter(e=>e.group||!m)).forEach((e,t)=>{d.push({key:`blocks:${t}`,title:e.group??"",tiles:e.items.map(s)})}),!x)return d;const u=d.map(e=>({...e,tiles:e.tiles.map(e=>{const t=ke(e.type),n=t?x(t):null;return n?{...e,disabled:!0,disabledReason:n}:e})})),y=e=>e.tiles.some(e=>!e.disabled);return[...u.filter(y),...u.filter(e=>!y(e))]},[ne,ie,re,ue,P,q,x,$,te]);/* @__PURE__ */
5
- return D(E,{children:[
6
- /* @__PURE__ */B(i,{icon:/* @__PURE__ */B(H,{size:15}),title:q.title,context:q.contextAll,actions:/* @__PURE__ */B(s,{label:q.done,description:q.doneDescription,onClick:z}),onHide:G}),
7
- /* @__PURE__ */D("div",{className:"sf-addside sf-scroll",children:[
8
- /* @__PURE__ */B(k,{groups:be,session:R,itemFor:e=>Q(ke(e)??{kind:"section",type:e}),onInsert:N?e=>{const t=ke(e);t&&N(t)}:void 0,onTileMenu:(e,t)=>{const n=ke(e);return"shared"===n?.kind&&!K&&(pe({section:n.section,...t}),!0)},at:w,hint:q.hint,searchLabel:q.search,readOnly:K,words:ee}),S??null]}),de?/* @__PURE__ */B(A,{at:{x:de.x,y:de.y},owner:de.owner,onClose:()=>pe(null),"aria-label":de.section.title,items:y([{label:re.deleteShared,danger:!0,onClick:()=>{fe(de.section),pe(null)}}])}):null,me?/* @__PURE__ */B(F,{name:me.title,pages:me.used_on.length,onDelete:()=>(async e=>{try{await r(te).remove(e.id)}catch{return void L.error(re.deleteFailed)}fe(null),le?.removed?.(e),se(t=>t.filter(t=>t.id!==e.id)),ae(e=>e+1)})(me),onCancel:()=>fe(null)}):null]})}export{N as AddSidePanel,T as blockKey,O as sectionKey,M as sharedKey,I as templateKey};
1
+ import{buildPaletteSections as e,pinnedSection as t,categoryLabel as n}from"./chunk-PA3PNTVV.js";import{blockTypesIn as o}from"./chunk-5ZBY24K7.js";import{sectionTemplatesOf as l}from"./chunk-BVN33R76.js";import{sharedSectionsOf as r}from"./chunk-43AEUUNQ.js";import{SidePanelHead as i,PanelModeExit as s}from"./chunk-XDZHKYQX.js";import{blockRuns as c}from"./chunk-M2Z775ZC.js";import{useScreenBlockLook as a,useScreenBlockRules as d,useScreenPinned as p}from"./chunk-W6SDWCOL.js";import{useEaselSession as m}from"./chunk-O7Q4DDJT.js";import{DEFAULT_SCREEN_WORDS as f}from"./chunk-C2RHV42O.js";import{useEasel as u}from"./chunk-QEAUF632.js";import{easelMenuEntries as y}from"./chunk-BALFHI3G.js";import{useWords as h}from"./chunk-MFIRYGHW.js";import{AddPanel as k}from"./chunk-LLDHIBYG.js";import{DEFAULT_DRAG_WORDS as g}from"./chunk-KAML3KQH.js";import{useState as b,useEffect as v,useMemo as j,useRef as C}from"react";import{SharedIcon as w,AddIcon as L}from"efficient-shell/icons/efficient";import{ContextMenu as A,toast as D,Dialog as H,Button as O}from"efficient-shell/ui";import{jsx as $,jsxs as x,Fragment as B}from"react/jsx-runtime";function E({name:e,pages:t,onDelete:n,onCancel:o}){const l=h("screen",f).shared,[r,i]=b(!1),s=C(null);/* @__PURE__ */
2
+ return $(H,{open:!0,role:"alertdialog",size:"sm",title:l.deleteTitle({name:e}),onClose:o,initialFocus:s,footer:/* @__PURE__ */x(B,{children:[
3
+ /* @__PURE__ */$(O,{ref:s,variant:"secondary",onClick:o,children:l.cancel}),
4
+ /* @__PURE__ */$(O,{variant:"danger",loading:r,onClick:()=>{(async()=>{i(!0);try{await n()}finally{i(!1)}})()},children:l.deleteShared})]}),children:l.deleteMessage({count:t})})}var F=e=>`section:${e}`,T=e=>`block:${e}`,I=e=>`template:${e}`,M=e=>`shared:${e}`;function N({at:C,placeBlocks:H,canTake:O,onPick:N,itemFor:Q,session:S,siteWide:W,onClose:z,onHide:K,readOnly:P}){const R=u(e=>e.config),V=a(),{labelAtLevel:Y,categoryLabel:Z,firstSection:G,Icon:U,Thumbnail:X}=V,{blockIsOffered:_,canAddTo:J}=d(),q=h("screen",f).add,ee=h("drag",g).add,te=m(),[ne,oe]=b([]);v(()=>{let e=!1;const t=e=>_(e,te);return l(te).list().then(n=>{if(e)return;const l=R.components;oe(n.filter(e=>e.node?.type&&l[e.node.type]&&o(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[R,te]);const le=p().shared,re=h("screen",f).shared,[ie,se]=b([]),[ce,ae]=b(0);v(()=>{if(!le)return;let e=!1;const t=e=>_(e,te);return r(te).list().then(n=>{if(e)return;const l=R.components;se(n.filter(e=>e.node?.type&&l[e.node.type]&&o(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[R,te,ce]);const[de,pe]=b(null),[me,fe]=b(null),ue=j(()=>e(R,V),[R]),ye=e=>Y(e,"section",R.components[e]?.label??e),he=e=>({type:F(e.type),label:e.name,cover:/* @__PURE__ */$(X,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:q.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),ke=e=>{const t=e.indexOf(":"),n=e.slice(0,t),o=e.slice(t+1);if("section"===n)return{kind:"section",type:o};if("block"===n)return{kind:"block",type:o};if("template"===n){const e=ne.find(e=>e.id===o);return e?{kind:"template",template:e}:null}if("shared"===n){const e=ie.find(e=>e.id===o);return e?{kind:"shared",section:e}:null}return null},ge=e=>/* @__PURE__ */$("span",{className:"es-add-glyph-cover",children:/* @__PURE__ */$(U,{type:e,size:26})}),be=j(()=>{const e=t(ue,G),o=/* @__PURE__ */new Map,l=e=>{e.retired||o.has(e.type)||!_(e.type,te)||o.set(e.type,e)};for(const t of e?[e]:ue){const e=J(t.type)?.choices??[];e.forEach(l),e.forEach(e=>J(e.type,1)?.choices?.forEach(l))}H?.forEach(l);const r=new Set(ue.map(e=>e.type)),i=[...o.values()].filter(e=>!r.has(e.type)),s=e=>({type:T(e.type),label:e.label,cover:ge(e.type),title:q.tile({name:e.label}),keywords:[e.group??"",e.type].filter(Boolean)}),a=e=>o.has(e.type)?{...he(e),cover:ge(e.type)}:he(e),d=[];ie.length>0&&d.push({key:"shared",title:re.group,tiles:ie.map(e=>({type:M(e.id),label:e.title,cover:/* @__PURE__ */$(X,{type:e.node.type}),mark:/* @__PURE__ */$(w,{size:12}),title:re.onPages({count:e.used_on.length}),keywords:[ye(e.node.type),e.node.type]}))}),ne.length>0&&d.push({key:"templates",title:q.templates,tiles:ne.map(e=>({type:I(e.id),label:e.name,cover:/* @__PURE__ */$(X,{type:e.node.type}),keywords:[ye(e.node.type),e.node.type]}))});const p=i.filter(e=>!e.group);let m=!1;for(const t of Object.keys(R.categories??{})){const o=ue.filter(e=>e.cat===t);if(0===o.length)continue;const l=e&&o.some(t=>t.type===e.type)?e:null,r=(l?[l,...o.filter(e=>e.type!==l.type)]:o).map(a);l&&!m&&(r.splice(1,0,...p.map(s)),m=!0),d.push({key:`category:${t}`,title:n(R,t,Z),tiles:r})}const f=d.find(e=>e.key?.startsWith("category:"));if(!m&&f&&p.length>0&&(f.tiles=[...f.tiles,...p.map(s)],m=!0),c(i.filter(e=>e.group||!m)).forEach((e,t)=>{d.push({key:`blocks:${t}`,title:e.group??"",tiles:e.items.map(s)})}),!O)return d;const u=d.map(e=>({...e,tiles:e.tiles.map(e=>{const t=ke(e.type),n=t?O(t):null;return n?{...e,disabled:!0,disabledReason:n}:e})})),y=e=>e.tiles.some(e=>!e.disabled);return[...u.filter(y),...u.filter(e=>!y(e))]},[ne,ie,re,ue,R,q,O,H,te]);/* @__PURE__ */
5
+ return x(B,{children:[
6
+ /* @__PURE__ */$(i,{icon:/* @__PURE__ */$(L,{size:15}),title:q.title,context:q.contextAll,actions:/* @__PURE__ */$(s,{label:q.done,description:q.doneDescription,onClick:z}),onHide:K}),
7
+ /* @__PURE__ */x("div",{className:"sf-addside sf-scroll",children:[
8
+ /* @__PURE__ */$(k,{groups:be,session:S,itemFor:e=>Q(ke(e)??{kind:"section",type:e}),onInsert:N?e=>{const t=ke(e);t&&N(t)}:void 0,onTileMenu:(e,t)=>{const n=ke(e);return"shared"===n?.kind&&!P&&(pe({section:n.section,...t}),!0)},at:C,hint:q.hint,searchLabel:q.search,readOnly:P,words:ee}),W??null]}),de?/* @__PURE__ */$(A,{at:{x:de.x,y:de.y},owner:de.owner,onClose:()=>pe(null),"aria-label":de.section.title,items:y([{label:re.deleteShared,danger:!0,onClick:()=>{fe(de.section),pe(null)}}])}):null,me?/* @__PURE__ */$(E,{name:me.title,pages:me.used_on.length,onDelete:()=>(async e=>{try{await r(te).remove(e.id)}catch{return void D.error(re.deleteFailed)}fe(null),le?.removed?.(e),se(t=>t.filter(t=>t.id!==e.id)),ae(e=>e+1)})(me),onCancel:()=>fe(null)}):null]})}export{N as AddSidePanel,T as blockKey,F as sectionKey,M as sharedKey,I as templateKey};
@@ -1,7 +1,7 @@
1
- import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenChrome as n}from"./chunk-N3VPBHR6.js";import{ScreenStoreProvider as e}from"./chunk-MPF5QZJ7.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-STWSCR25.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-C2RHV42O.js";import{documentPermissions as s}from"./chunk-THWO5YVZ.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{useMemo as t,useState as d,useRef as l,useEffect as m,useCallback as g}from"react";import{Dialog as h,Button as f}from"efficient-shell/ui";import{jsx as u,jsxs as p,Fragment as v}from"react/jsx-runtime";var C=r(e),k=r(n);function N({onCancel:r,onDiscard:n,onSave:e}){const i=c("screen",o).leave,[a,s]=d(!1),t=l(!0);m(()=>(t.current=!0,()=>{t.current=!1}),[]);const C=g(async()=>{s(!0);try{await e()}finally{t.current&&s(!1)}},[e]);/* @__PURE__ */
1
+ import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenChrome as n}from"./chunk-QNAPTJRM.js";import{ScreenStoreProvider as e}from"./chunk-DXROGLB5.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-STWSCR25.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-C2RHV42O.js";import{documentPermissions as s}from"./chunk-THWO5YVZ.js";import{useWords as c}from"./chunk-MFIRYGHW.js";import{useMemo as t,useState as d,useRef as l,useEffect as m,useCallback as g}from"react";import{Dialog as h,Button as f}from"efficient-shell/ui";import{jsx as u,jsxs as p,Fragment as v}from"react/jsx-runtime";var C=r(e),k=r(n);function N({onCancel:r,onDiscard:n,onSave:e}){const i=c("screen",o).leave,[a,s]=d(!1),t=l(!0);m(()=>(t.current=!0,()=>{t.current=!1}),[]);const C=g(async()=>{s(!0);try{await e()}finally{t.current&&s(!1)}},[e]);/* @__PURE__ */
2
2
  return u(h,{open:!0,role:"alertdialog",size:"sm",title:i.title,onClose:r,footer:/* @__PURE__ */p(v,{children:[
3
3
  /* @__PURE__ */u(f,{variant:"secondary",onClick:r,children:i.cancel}),
4
4
  /* @__PURE__ */u(f,{variant:"ghost-danger",onClick:n,children:i.discard}),
5
5
  /* @__PURE__ */u(f,{variant:"primary",loading:a,onClick:()=>{C()},children:i.save})]}),children:i.body})}function j({target:r,addressing:n,onHostMessage:e,children:a}){/* @__PURE__ */
6
- return u(i,{target:r,addressing:n,onHostMessage:e,children:a})}var y=(r,n)=>/* @__PURE__ */p(v,{children:[r,n]});function H({config:r,parts:n,wrap:e=y}){const{data:i,error:d,redirecting:l,ready:m,readOnly:g,onChange:h,pendingNav:f,cancelPendingNav:p,discardAndNavigate:v,saveAndNavigate:j}=a(),H=t(()=>s(!g),[g]),M=c("screen",o);return l?/* @__PURE__ */u("div",{className:"sf-msg",children:M.loading}):d?/* @__PURE__ */u("div",{className:"sf-msg sf-msg--error",children:d}):m?i?e(
7
- /* @__PURE__ */u(C,{config:r,data:i,onChange:h,permissions:H,parts:n,children:/* @__PURE__ */u(k,{})}),f&&/* @__PURE__ */u(N,{onCancel:p,onDiscard:v,onSave:j})):/* @__PURE__ */u("div",{className:"sf-msg",children:M.loading}):/* @__PURE__ */u("div",{className:"sf-msg",children:M.waitingForAuthorization})}export{H as DocumentScreen,j as ScreenMount};
6
+ return u(i,{target:r,addressing:n,onHostMessage:e,children:a})}var y=(r,n)=>/* @__PURE__ */p(v,{children:[r,n]});function H({config:r,parts:n,wrap:e=y}){const{data:i,error:d,redirecting:l,ready:m,readOnly:g,onChange:h,pendingNav:f,cancelPendingNav:p,discardAndNavigate:v,saveAndNavigate:j}=a(),H=t(()=>s(!g),[g]),O=c("screen",o);return l?/* @__PURE__ */u("div",{className:"sf-msg",children:O.loading}):d?/* @__PURE__ */u("div",{className:"sf-msg sf-msg--error",children:d}):m?i?e(
7
+ /* @__PURE__ */u(C,{config:r,data:i,onChange:h,permissions:H,parts:n,children:/* @__PURE__ */u(k,{})}),f&&/* @__PURE__ */u(N,{onCancel:p,onDiscard:v,onSave:j})):/* @__PURE__ */u("div",{className:"sf-msg",children:O.loading}):/* @__PURE__ */u("div",{className:"sf-msg",children:O.waitingForAuthorization})}export{H as DocumentScreen,j as ScreenMount};
@@ -1,4 +1,4 @@
1
- import{fieldIsShown as e,shownFields as n}from"./chunk-BPXEFVSQ.js";import{TreeSeam as t}from"./chunk-A6Z4SD3I.js";import{easelMenuEntries as l}from"./chunk-BALFHI3G.js";import{DEFAULT_TREE_WORDS as a}from"./chunk-K56YDHYQ.js";import{SETTINGS_BUCKETS as r,SettingsGroup as o}from"./chunk-RC25EGHD.js";import{DEFAULT_PANEL_WORDS as i}from"./chunk-KFV7N2DJ.js";import{FieldNumber as s}from"./chunk-2XMHLXMA.js";import{FieldSelect as c}from"./chunk-G3GWAP5R.js";import{DEFAULT_FIELDS_WORDS as d}from"./chunk-WRFD4EXD.js";import{SettingsField as u,SettingsSegmented as m}from"./chunk-36LVP5WD.js";import{useWords as h}from"./chunk-MFIRYGHW.js";import{useTreeDrag as p,gapToMoveIndex as f}from"./chunk-67GNT6PF.js";import{withTip as b}from"./chunk-P2VEMZH5.js";import{Textarea as g,Input as v,SortableList as y,ListRow as k,ContextMenu as x,tabPanelId as w,Tabs as C,tabButtonId as N}from"efficient-shell/ui";export{LinkPicker}from"efficient-shell/ui";import{useRef as O,useState as j,useLayoutEffect as D,useId as $}from"react";import{jsx as S,jsxs as I}from"react/jsx-runtime";import{ChevronIcon as P,LockIcon as L,MoveUpIcon as F,MoveDownIcon as M,DuplicateIcon as R,TrashIcon as A}from"efficient-shell/icons/efficient";function E({id:e,value:n,onChange:t,placeholder:l,multiline:a=!1,rows:r=3,readOnly:o=!1,ariaLabel:i,ariaLabelledBy:s}){const c=n??"";return a?/* @__PURE__ */S(g,{id:e,size:"sm",className:"es-fin",value:c,rows:r,placeholder:l,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>t(e.target.value)}):/* @__PURE__ */S(v,{id:e,size:"sm",className:"es-fin",type:"text",value:c,placeholder:l,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>t(e.target.value)})}function T(e,n,t){const l=e.slice();return l.splice(Math.max(0,Math.min(n,l.length)),0,t),l}function W(e,n,t){const l=e.slice(),[a]=l.splice(n,1);return l.splice(Math.max(0,Math.min(t,l.length)),0,a),l}function z(e,n){return e.filter((e,t)=>t!==n)}function H(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var B='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',G={parentId:"list",slot:"items"};function K({label:e,icon:n,noun:r,items:o,onChange:i,newItem:s,summary:c,itemName:u,thumb:m,min:g=0,max:v,readOnly:w=!1,open:C,onOpen:N,renderItem:$,renderRow:E,canRemove:K,lockedReason:V,fixed:X=!1,removeOnRow:Y=!0,canDuplicate:J,above:Z,head:q=!0}){const Q=h("fields",d).list,U=h("tree",a),_=r??Q.item,ee=!w&&!X&&("number"!=typeof v||o.length<v),ne=o.length<=g,te=e=>!!K&&!K(o[e],e),le=e=>!w&&!X&&Y&&!ne&&!te(e),ae=e=>ee&&(!J||J(o[e],e)),re=(e,n)=>u?u(e,n):Q.itemName({noun:_,n:n+1}),oe=O([]),ie=O(null),[se,ce]=j(null),de=O(null),[ue,me]=j(null),[he,pe]=j("");D(()=>{const e=ie.current;if(!e)return;ie.current=null;const n=oe.current[e.index]?.querySelectorAll(B)[e.nth]??oe.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const fe=(e,n)=>{if(n<0||n>=o.length||n===e)return;const t=oe.current[e],l=t?.ownerDocument.activeElement;if(t&&l&&t.contains(l)){const e=[...t.querySelectorAll(B)].indexOf(l),a=l;ie.current={index:n,nth:e,start:"number"==typeof a.selectionStart?a.selectionStart:null,end:"number"==typeof a.selectionEnd?a.selectionEnd:null}}i(W(o,e,n));const a=function(e,n,t){return null===e?null:e===n?t:n<e&&t>=e?e-1:n>e&&t<=e?e+1:e}(C,e,n);a!==C&&N(a),pe(Q.moved({n:n+1,total:o.length}))},be=e=>{ee&&(i(T(o,e,s())),E?(ie.current={index:e,nth:0,start:null,end:null},null!==C&&C>=e&&N(C+1)):N(e))},ge=e=>{le(e)&&(i(z(o,e)),C===e?N(null):null!==C&&C>e&&N(C-1))},ve=p({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===G.parentId&&n.slot===G.slot,onDrop:(e,n)=>{const t=f({...G,index:e},n);t!==e&&fe(e,t)},onStep:(e,n)=>fe(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<o.length,readOnly:w}),ye=e=>{const n=[];return e>0&&n.push({label:Q.moveUp,icon:/* @__PURE__ */S(F,{size:14}),shortcut:"⌥↑",onClick:()=>fe(e,e-1)}),e<o.length-1&&n.push({label:Q.moveDown,icon:/* @__PURE__ */S(M,{size:14}),shortcut:"⌥↓",onClick:()=>fe(e,e+1)}),ae(e)&&n.push({label:Q.duplicate,icon:/* @__PURE__ */S(R,{size:14}),onClick:()=>(e=>{ae(e)&&(i(T(o,e+1,H(o[e]))),null!==C&&C>e&&N(C+1))})(e)}),le(e)&&n.push({label:Q.delete,icon:/* @__PURE__ */S(A,{size:14}),danger:!0,onClick:()=>ge(e)}),n},ke=(e,n,t,l)=>{w||0===ye(e).length||me({index:e,x:n,y:t,owner:l})},xe=e=>n=>{const t=o.slice();t[e]=n,i(t)};/* @__PURE__ */
1
+ import{fieldIsShown as e,shownFields as n}from"./chunk-BPXEFVSQ.js";import{TreeSeam as t}from"./chunk-A6Z4SD3I.js";import{DEFAULT_TREE_WORDS as l}from"./chunk-K56YDHYQ.js";import{easelMenuEntries as a}from"./chunk-BALFHI3G.js";import{SETTINGS_BUCKETS as r,SettingsGroup as o}from"./chunk-RC25EGHD.js";import{DEFAULT_PANEL_WORDS as i}from"./chunk-KFV7N2DJ.js";import{FieldNumber as s}from"./chunk-2XMHLXMA.js";import{FieldSelect as c}from"./chunk-G3GWAP5R.js";import{DEFAULT_FIELDS_WORDS as d}from"./chunk-WRFD4EXD.js";import{SettingsField as u,SettingsSegmented as m}from"./chunk-36LVP5WD.js";import{useWords as h}from"./chunk-MFIRYGHW.js";import{useTreeDrag as p,gapToMoveIndex as f}from"./chunk-67GNT6PF.js";import{withTip as b}from"./chunk-P2VEMZH5.js";import{Textarea as g,Input as v,SortableList as y,ListRow as k,ContextMenu as x,tabPanelId as w,Tabs as C,tabButtonId as N}from"efficient-shell/ui";export{LinkPicker}from"efficient-shell/ui";import{useRef as O,useState as j,useLayoutEffect as D,useId as $}from"react";import{jsx as S,jsxs as I}from"react/jsx-runtime";import{ChevronIcon as P,LockIcon as L,MoveUpIcon as F,MoveDownIcon as M,DuplicateIcon as R,TrashIcon as A}from"efficient-shell/icons/efficient";function E({id:e,value:n,onChange:t,placeholder:l,multiline:a=!1,rows:r=3,readOnly:o=!1,ariaLabel:i,ariaLabelledBy:s}){const c=n??"";return a?/* @__PURE__ */S(g,{id:e,size:"sm",className:"es-fin",value:c,rows:r,placeholder:l,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>t(e.target.value)}):/* @__PURE__ */S(v,{id:e,size:"sm",className:"es-fin",type:"text",value:c,placeholder:l,readOnly:o,"aria-label":i,"aria-labelledby":s,onChange:e=>t(e.target.value)})}function T(e,n,t){const l=e.slice();return l.splice(Math.max(0,Math.min(n,l.length)),0,t),l}function W(e,n,t){const l=e.slice(),[a]=l.splice(n,1);return l.splice(Math.max(0,Math.min(t,l.length)),0,a),l}function z(e,n){return e.filter((e,t)=>t!==n)}function H(e){return null===e||"object"!=typeof e?e:JSON.parse(JSON.stringify(e))}var B='input, textarea, select, button, [contenteditable]:not([contenteditable="false"]), [tabindex]',G={parentId:"list",slot:"items"};function K({label:e,icon:n,noun:r,items:o,onChange:i,newItem:s,summary:c,itemName:u,thumb:m,min:g=0,max:v,readOnly:w=!1,open:C,onOpen:N,renderItem:$,renderRow:E,canRemove:K,lockedReason:V,fixed:X=!1,removeOnRow:Y=!0,canDuplicate:J,above:Z,head:q=!0}){const Q=h("fields",d).list,U=h("tree",l),_=r??Q.item,ee=!w&&!X&&("number"!=typeof v||o.length<v),ne=o.length<=g,te=e=>!!K&&!K(o[e],e),le=e=>!w&&!X&&Y&&!ne&&!te(e),ae=e=>ee&&(!J||J(o[e],e)),re=(e,n)=>u?u(e,n):Q.itemName({noun:_,n:n+1}),oe=O([]),ie=O(null),[se,ce]=j(null),de=O(null),[ue,me]=j(null),[he,pe]=j("");D(()=>{const e=ie.current;if(!e)return;ie.current=null;const n=oe.current[e.index]?.querySelectorAll(B)[e.nth]??oe.current[e.index];if(n?.focus(),n&&null!==e.start&&"setSelectionRange"in n)try{n.setSelectionRange(e.start,e.end)}catch{}});const fe=(e,n)=>{if(n<0||n>=o.length||n===e)return;const t=oe.current[e],l=t?.ownerDocument.activeElement;if(t&&l&&t.contains(l)){const e=[...t.querySelectorAll(B)].indexOf(l),a=l;ie.current={index:n,nth:e,start:"number"==typeof a.selectionStart?a.selectionStart:null,end:"number"==typeof a.selectionEnd?a.selectionEnd:null}}i(W(o,e,n));const a=function(e,n,t){return null===e?null:e===n?t:n<e&&t>=e?e-1:n>e&&t<=e?e+1:e}(C,e,n);a!==C&&N(a),pe(Q.moved({n:n+1,total:o.length}))},be=e=>{ee&&(i(T(o,e,s())),E?(ie.current={index:e,nth:0,start:null,end:null},null!==C&&C>=e&&N(C+1)):N(e))},ge=e=>{le(e)&&(i(z(o,e)),C===e?N(null):null!==C&&C>e&&N(C-1))},ve=p({keyOf:e=>String(e),canDrop:(e,n)=>n.parentId===G.parentId&&n.slot===G.slot,onDrop:(e,n)=>{const t=f({...G,index:e},n);t!==e&&fe(e,t)},onStep:(e,n)=>fe(e,e+n),canStep:(e,n)=>e+n>=0&&e+n<o.length,readOnly:w}),ye=e=>{const n=[];return e>0&&n.push({label:Q.moveUp,icon:/* @__PURE__ */S(F,{size:14}),shortcut:"⌥↑",onClick:()=>fe(e,e-1)}),e<o.length-1&&n.push({label:Q.moveDown,icon:/* @__PURE__ */S(M,{size:14}),shortcut:"⌥↓",onClick:()=>fe(e,e+1)}),ae(e)&&n.push({label:Q.duplicate,icon:/* @__PURE__ */S(R,{size:14}),onClick:()=>(e=>{ae(e)&&(i(T(o,e+1,H(o[e]))),null!==C&&C>e&&N(C+1))})(e)}),le(e)&&n.push({label:Q.delete,icon:/* @__PURE__ */S(A,{size:14}),danger:!0,onClick:()=>ge(e)}),n},ke=(e,n,t,l)=>{w||0===ye(e).length||me({index:e,x:n,y:t,owner:l})},xe=e=>n=>{const t=o.slice();t[e]=n,i(t)};/* @__PURE__ */
2
2
  return I("div",{className:"es-list",children:[q?/* @__PURE__ */I("div",{className:"es-list-head",children:[
3
3
  /* @__PURE__ */I("span",{className:"es-list-label",children:[n?/* @__PURE__ */S("span",{className:"es-field-icon","aria-hidden":"true",children:n}):null,e]}),
4
4
  /* @__PURE__ */S("span",{className:"es-list-count",children:o.length})]}):null,Z?/* @__PURE__ */S("div",{className:"es-list-above",children:Z}):null,o.length?/* @__PURE__ */I(y,{"aria-label":e,spacing:"comfortable",className:"es-list-rows",rootProps:ve.rootProps(),children:[o.map((e,n)=>{const l=ve.row({item:n,place:{...G,index:n}}),a=l.draggable&&se!==n,r=!E&&C===n,o=!w&&!X&&Y&&te(n),i=["es-list-row",E?"is-inline":"is-item",r?"is-open":"",a?"is-draggable":"",l.dragging?"is-dragging":"",l.drop?`is-drop-${l.drop}`:""].filter(Boolean).join(" ");return[n>0?/* @__PURE__ */S(t,{...ve.seam({place:{...G,index:n}}),onAdd:ee?()=>be(n):void 0,label:Q.addHere({noun:_})},`seam-${n}`):null,
@@ -7,7 +7,7 @@ return I("div",{className:"es-list",children:[q?/* @__PURE__ */I("div",{classNam
7
7
  /* @__PURE__ */S(P,{size:14,className:"es-list-chev","aria-hidden":"true"})]})},n)]}),
8
8
  /* @__PURE__ */S(t,{...ve.seam({place:{...G,index:o.length}})})]}):null,w||X?null:/* @__PURE__ */S("button",{type:"button",className:"es-list-add",disabled:!ee,onClick:()=>be(o.length),children:Q.add({noun:_})}),
9
9
  /* @__PURE__ */S("span",{className:"es-list-said","aria-live":"polite",children:he}),ue&&ue.index<o.length?
10
- /* @__PURE__ */S(x,{at:{x:ue.x,y:ue.y},owner:ue.owner,onClose:()=>me(null),items:l(ye(ue.index))}):null]})}var V=e=>e<6?e+1:6,X=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function Y({field:e,name:t,id:l,value:a,onChange:r,readOnly:i,context:s,showWhenContext:c,renderers:d,headingLevel:u=3}){const[m,h]=j(!0),p=a&&"object"==typeof a?a:{};/* @__PURE__ */
10
+ /* @__PURE__ */S(x,{at:{x:ue.x,y:ue.y},owner:ue.owner,onClose:()=>me(null),items:a(ye(ue.index))}):null]})}var V=e=>e<6?e+1:6,X=(e,n)=>"string"==typeof e.label&&e.label?e.label:n;function Y({field:e,name:t,id:l,value:a,onChange:r,readOnly:i,context:s,showWhenContext:c,renderers:d,headingLevel:u=3}){const[m,h]=j(!0),p=a&&"object"==typeof a?a:{};/* @__PURE__ */
11
11
  return S(o,{id:`${l}-group`,title:X(e,t),open:m,onToggle:h,level:u,children:Object.entries(n(e.objectFields,{values:p,context:c})).map(([e,n])=>/* @__PURE__ */S(Z,{field:n,name:`${t}.${e}`,id:`${l}-${e}`,value:p[e],onChange:n=>r({...p,[e]:n}),readOnly:i,context:s,showWhenContext:c,renderers:d,headingLevel:V(u)},e))})}function J({field:e,name:t,id:l,value:a,onChange:r,readOnly:o,context:i,showWhenContext:s,renderers:c,openItem:d,onOpenItem:u,headingLevel:m}){const[h,p]=j(null),f=u?d??null:h,b=u??p,g=Array.isArray(a)?a:[],v=e.getItemSummary;/* @__PURE__ */
12
12
  return S(K,{label:X(e,t),icon:e.icon,noun:"string"==typeof e.noun?e.noun:void 0,items:g,onChange:r,newItem:()=>H({...e.defaultItemProps??{}}),summary:v?(e,n)=>v(e,n):void 0,min:e.min,max:e.max,readOnly:o,open:f,onOpen:b,renderItem:(a,r,d)=>Object.entries(n(e.arrayFields,{values:a,context:s})).map(([e,n])=>/* @__PURE__ */S(Z,{field:n,name:`${t}[${r}].${e}`,id:`${l}-${r}-${e}`,value:a?.[e],onChange:n=>d({...a,[e]:n}),readOnly:o,context:i,showWhenContext:s,renderers:c,headingLevel:m},e))})}function Z(e){const{field:n,name:t,id:l,value:a,onChange:r,readOnly:o,context:i,renderers:d}=e;if(!n||n.marker||!1===n.visible)return null;const h=d?.[n.type];if(h)return h({field:n,name:t,id:l,value:a,onChange:r,readOnly:o});switch(n.type){case"custom":{const e={...i,field:n,name:t,id:l,value:a,onChange:r,readOnly:o};return n.render(e)}case"text":case"textarea":/* @__PURE__ */
13
13
  return S(u,{label:X(n,t),htmlFor:l,icon:n.icon,hint:n.hint,children:/* @__PURE__ */S(E,{id:l,value:"string"==typeof a?a:null==a?"":String(a),onChange:r,placeholder:n.placeholder,multiline:"textarea"===n.type,readOnly:o})});case"number":/* @__PURE__ */
@@ -1,2 +1,2 @@
1
- import{ScreenPartsProvider as t}from"./chunk-XHSGRH42.js";import{useEaselHost as r}from"./chunk-U3JP4VGF.js";import{createEasel as e,EaselProvider as n}from"./chunk-QEAUF632.js";import{useState as o,useEffect as s}from"react";import{jsx as i}from"react/jsx-runtime";function a({config:a,data:c,onChange:m,permissions:p,parts:f,children:u}){const[h]=o(()=>e({config:a,data:c,permissions:p}));s(()=>{h.setConfig(a)},[h,a]),s(()=>{if(!m)return;let t=h.getState().appState.data;return h.subscribe(()=>{const r=h.getState().appState.data;r!==t&&(t=r,m(r))})},[h,m]),s(()=>{p&&h.setPermissions(p)},[h,p]);const d=r();/* @__PURE__ */
1
+ import{ScreenPartsProvider as t}from"./chunk-W6SDWCOL.js";import{useEaselHost as r}from"./chunk-U3JP4VGF.js";import{createEasel as e,EaselProvider as n}from"./chunk-QEAUF632.js";import{useState as o,useEffect as s}from"react";import{jsx as i}from"react/jsx-runtime";function a({config:a,data:c,onChange:m,permissions:p,parts:f,children:u}){const[h]=o(()=>e({config:a,data:c,permissions:p}));s(()=>{h.setConfig(a)},[h,a]),s(()=>{if(!m)return;let t=h.getState().appState.data;return h.subscribe(()=>{const r=h.getState().appState.data;r!==t&&(t=r,m(r))})},[h,m]),s(()=>{p&&h.setPermissions(p)},[h,p]);const d=r();/* @__PURE__ */
2
2
  return i(n,{easel:h,hotkeys:d.ownsDocument,children:/* @__PURE__ */i(t,{parts:f,children:u})})}export{a as ScreenStoreProvider};
@@ -1,4 +1,4 @@
1
- import{blockRuns as e,offeredChoices as r}from"./chunk-M2Z775ZC.js";import{useScreenBlockLook as s}from"./chunk-XHSGRH42.js";import{DEFAULT_SCREEN_WORDS as t}from"./chunk-C2RHV42O.js";import{useWords as n}from"./chunk-MFIRYGHW.js";import{DropdownMenu as c}from"efficient-shell/ui";import{jsxs as i,Fragment as o,jsx as l}from"react/jsx-runtime";function p({choices:p,onPick:a}){const{Icon:m}=s(),u=n("screen",t),f=e(r(p)).flatMap(e=>[...e.group?[{type:"label",key:`group:${e.group}`,label:/* @__PURE__ */i(o,{children:[e.group," ",
1
+ import{blockRuns as e,offeredChoices as r}from"./chunk-M2Z775ZC.js";import{useScreenBlockLook as s}from"./chunk-W6SDWCOL.js";import{DEFAULT_SCREEN_WORDS as t}from"./chunk-C2RHV42O.js";import{useWords as n}from"./chunk-MFIRYGHW.js";import{DropdownMenu as c}from"efficient-shell/ui";import{jsxs as i,Fragment as o,jsx as l}from"react/jsx-runtime";function p({choices:p,onPick:a}){const{Icon:m}=s(),u=n("screen",t),f=e(r(p)).flatMap(e=>[...e.group?[{type:"label",key:`group:${e.group}`,label:/* @__PURE__ */i(o,{children:[e.group," ",
2
2
  /* @__PURE__ */l("span",{className:"sf-menugroup-count",children:e.items.length})]})}]:[],...e.items.map(e=>({key:e.type,label:e.label,icon:/* @__PURE__ */l("span",{className:"sf-chip",children:/* @__PURE__ */l(m,{type:e.type,size:13})}),onSelect:()=>a(e.type)}))]);/* @__PURE__ */
3
3
  return l(c,{align:"start",triggerClassName:"sf-add-card",items:f,trigger:/* @__PURE__ */i(o,{children:[
4
4
  /* @__PURE__ */l("span",{className:"sf-plus sf-plus--sm",children:"+"}),u.addBlockMenu]})})}export{p as AddBlockRow};
@@ -1,4 +1,4 @@
1
- import{useScreenOwnerName as e}from"./chunk-XHSGRH42.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-GWIVPLOX.js";import{jsxs as o,Fragment as r,jsx as t}from"react/jsx-runtime";function l({panel:l,pick:d,onHide:m}){const p=e();/* @__PURE__ */
1
+ import{useScreenOwnerName as e}from"./chunk-W6SDWCOL.js";import{settlePanelPick as n}from"./chunk-R6WTQWAC.js";import{MediaPanelHead as i,mediaPickKind as c}from"./chunk-GWIVPLOX.js";import{jsxs as o,Fragment as r,jsx as t}from"react/jsx-runtime";function l({panel:l,pick:d,onHide:m}){const p=e();/* @__PURE__ */
2
2
  return o(r,{children:[
3
3
  /* @__PURE__ */t(i,{context:p,pick:d?{kind:c(d.accept),field:d.title||void 0}:null,onCancel:()=>d&&n(d.requestId,null),onHide:m}),
4
4
  /* @__PURE__ */t("div",{className:"sf-media-panel",children:/* @__PURE__ */t(l,{pick:d,onPick:e=>d&&n(d.requestId,e)})})]})}export{l as MediaSidePanel};
@@ -1,62 +1,62 @@
1
- import{cloneNodeWithFreshIds as e}from"./chunk-2GVCAIPX.js";import{dedupeSlotChildren as n}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as t}from"./chunk-VEZPDGDQ.js";import{markedTreeNodeId as o,revealSelectedTreeRow as r,sameSelector as i}from"./chunk-FGNR22NY.js";import{scrollPreviewToSection as l,gotoPreviewSlide as s,scrollPreviewToTop as d}from"./chunk-4ES5JGGX.js";import{useEaselKeyTarget as a,useEaselUndoKeys as c,useEaselSaveKey as p,editorRootFocus as u}from"./chunk-YLQYEDUQ.js";import{SlotChildActionsProvider as h}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as f,DEFAULT_PANEL_W as m,clampPanelWidth as g}from"./chunk-U277UX5I.js";import{usePartBridge as y}from"./chunk-YI4QXOVJ.js";import{useSectionOps as k}from"./chunk-A7FF65FL.js";import{ScreenSaveIcon as v,ScreenMainButton as S}from"./chunk-7TOQCTHV.js";import{useBrowserOffline as b}from"./chunk-RKTF5XLP.js";import{AddChildRow as w}from"./chunk-5545A3PC.js";import{AddSidePanel as x}from"./chunk-BRMYJBMB.js";import{keepsSharedSections as z,sharedSectionsOf as C}from"./chunk-43AEUUNQ.js";import{SidePanelHead as O,PanelShowStrip as B}from"./chunk-XDZHKYQX.js";import{offeredChoices as I}from"./chunk-M2Z775ZC.js";import{MediaSidePanel as N}from"./chunk-WOETW3H6.js";import{useScreenSaveSwitch as P,useScreenNodeKeys as $,useScreenPinned as M,useScreenDocumentLabel as j,useScreenCanvasFrame as T,useScreenInspectorPanel as A,useScreenDevices as L,useScreenPickFollowsSelection as R,useScreenLeftView as E,SELECTION_MODE as F,sameInspectorMode as V,useScreenBridges as H,useScreenBlockRules as D,useScreenBlockLook as W,useScreenStorageNamespace as U,useScreenNotify as G,useScreenCanvasHead as Y,isSlotMode as X,useScreenStyleClipboard as J,useScreenDocumentPass as Q,useScreenCanvasDrag as K,ScreenCanvasTargetProvider as Z,isPinnedFirst as q,isPinnedLast as _,screenSlotsOf as ee}from"./chunk-XHSGRH42.js";import{useNodeClipboard as ne,useNodeContextMenu as te}from"./chunk-RFE7ZG3Y.js";import{PageEditGuardNotices as oe}from"./chunk-HGV3FWOB.js";import{useScreenDocument as re}from"./chunk-STWSCR25.js";import{requestMediaPick as ie}from"./chunk-KG7RJWOK.js";import{useMediaPanel as le,usePanelPick as se,useCancelPanelPick as de}from"./chunk-R6WTQWAC.js";import{useEaselSession as ae}from"./chunk-O7Q4DDJT.js";import{useEaselHost as ce,useHostEscape as pe}from"./chunk-U3JP4VGF.js";import{LayersIcon as ue,MediaIcon as he}from"./chunk-4VJATVVR.js";import{DEFAULT_SCREEN_WORDS as fe}from"./chunk-C2RHV42O.js";import{heldStyle as me,styleShortcut as ge}from"./chunk-V7U33NF2.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as ye}from"./chunk-6WY6ZXJG.js";import{rootRowName as ke,slotChildRowName as ve,slotChildRenameProp as Se,sectionRenameProp as be}from"./chunk-BHRC3ASL.js";import{ROOT_ZONE as we,blockNodeActions as xe,TREE_MAX_DEPTH as ze,childSlotsOf as Ce,slotFieldsOf as Oe,slotChildrenIn as Be,nestsInTree as Ie,newNodeId as Ne}from"./chunk-PLVEGYK6.js";import{useEasel as Pe,useEaselApi as $e,CanvasPassThroughContext as Me,CanvasSharedContext as je}from"./chunk-QEAUF632.js";import{TreeRow as Te,Subtree as Ae,LayersTree as Le,TreeGroupLabel as Re,TreeRowAction as Ee,TreeSeam as Fe}from"./chunk-A6Z4SD3I.js";import{DEFAULT_TREE_WORDS as Ve}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as He}from"./chunk-WK3AFPXY.js";import{toItemSelector as De,useNodeOps as We,clickPick as Ue}from"./chunk-X3TYRF5V.js";import{EaselTopBar as Ge,TopBarRail as Ye,TopBarCluster as Xe,EaselIconButton as Je,TopBarDivider as Qe,DeviceSwitch as Ke,InspectorIconButton as Ze,PanelResizeHandle as qe,MAX_PANEL_W as _e,MIN_PANEL_W as en,panelWidthVars as nn}from"./chunk-GWIVPLOX.js";import{DEFAULT_NOTICE_WORDS as tn,DEFAULT_CHROME_WORDS as on}from"./chunk-Z6PVRXVY.js";import{holderOf as rn,nameOrSomeone as ln}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as sn}from"./chunk-RE4LP46F.js";import{useWords as dn}from"./chunk-MFIRYGHW.js";import{insertSeams as an,CanvasDragLayer as cn,CanvasInsert as pn}from"./chunk-LLDHIBYG.js";import{DEFAULT_DRAG_WORDS as un}from"./chunk-KAML3KQH.js";import{createDragSession as hn,useTreeDrag as fn,gapToMoveIndex as mn}from"./chunk-67GNT6PF.js";import{useCanvasFrame as gn,LIST_SELECTOR as yn,BLOCK_SELECTOR as kn,useCanvasTyping as vn,useCanvasEvent as Sn,nodeIdAt as bn,frameRectToHost as wn,BLOCK_ATTRIBUTE as xn,drawnBox as zn}from"./chunk-X4T6JT3M.js";import{ROOT_ID as Cn,ROOT_SLOT as On,zoneKey as Bn,parseZoneKey as In,find as Nn,DataError as Pn}from"./chunk-KRXQM65X.js";import{useRef as $n,useMemo as Mn,useState as jn,useEffect as Tn,useCallback as An,useLayoutEffect as Ln,Fragment as Rn,useId as En}from"react";import{ColoredBadge as Fn,toast as Vn,Tooltip as Hn,groupColors as Dn,Dialog as Wn,FormField as Un,Input as Gn,Button as Yn}from"efficient-shell/ui";import{UndoIcon as Xn,RedoIcon as Jn,RefreshIcon as Qn,AddIcon as Kn,TrashIcon as Zn,EyeOffIcon as qn,EyeIcon as _n,SharedIcon as et,DuplicateIcon as nt}from"efficient-shell/icons/efficient";import{jsx as tt,jsxs as ot,Fragment as rt}from"react/jsx-runtime";function it({name:e,onMake:n,onCancel:t}){const o=dn("screen",fe).shared,[r,i]=jn(e),[l,s]=jn(!1),d=En(),a=$n(null),c=async()=>{const e=r.trim();if(e&&!l){s(!0);try{await n(e)}finally{s(!1)}}};/* @__PURE__ */
1
+ import{cloneNodeWithFreshIds as e}from"./chunk-2GVCAIPX.js";import{dedupeSlotChildren as n}from"./chunk-26OOWIJJ.js";import{styleClipboardOf as t}from"./chunk-VEZPDGDQ.js";import{markedTreeNodeId as o,revealSelectedTreeRow as r,sameSelector as i}from"./chunk-FGNR22NY.js";import{scrollPreviewToSection as l,gotoPreviewSlide as s,scrollPreviewToTop as d}from"./chunk-4ES5JGGX.js";import{useEaselKeyTarget as a,useEaselUndoKeys as c,useEaselSaveKey as p,editorRootFocus as u}from"./chunk-YLQYEDUQ.js";import{SlotChildActionsProvider as h}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as f,DEFAULT_PANEL_W as m,clampPanelWidth as g}from"./chunk-U277UX5I.js";import{usePartBridge as y}from"./chunk-X52NFKUS.js";import{useSectionOps as k}from"./chunk-SNB4LQMK.js";import{ScreenSaveIcon as v,ScreenMainButton as S}from"./chunk-7TOQCTHV.js";import{useBrowserOffline as b}from"./chunk-RKTF5XLP.js";import{AddChildRow as w}from"./chunk-5545A3PC.js";import{AddSidePanel as x}from"./chunk-2ZWA6ARJ.js";import{keepsSharedSections as z,sharedSectionsOf as C}from"./chunk-43AEUUNQ.js";import{SidePanelHead as O,PanelShowStrip as B}from"./chunk-XDZHKYQX.js";import{offeredChoices as I}from"./chunk-M2Z775ZC.js";import{MediaSidePanel as N}from"./chunk-OBIL7BZO.js";import{useScreenSaveSwitch as P,useScreenNodeKeys as $,useScreenPinned as M,useScreenDocumentLabel as j,useScreenCanvasFrame as T,useScreenInspectorPanel as A,useScreenDevices as L,useScreenPickFollowsSelection as R,useScreenLeftView as E,SELECTION_MODE as V,sameInspectorMode as F,useScreenBridges as D,useScreenBlockRules as H,useScreenBlockLook as W,useScreenStorageNamespace as U,useScreenNotify as G,useScreenCanvasHead as X,isSlotMode as Y,useScreenStyleClipboard as J,useScreenDocumentPass as K,useScreenCanvasDrag as Q,ScreenCanvasTargetProvider as Z,isPinnedFirst as q,isPinnedLast as _,screenSlotsOf as ee}from"./chunk-W6SDWCOL.js";import{useNodeClipboard as ne,useNodeContextMenu as te}from"./chunk-RFE7ZG3Y.js";import{PageEditGuardNotices as oe}from"./chunk-HGV3FWOB.js";import{useScreenDocument as re}from"./chunk-STWSCR25.js";import{requestMediaPick as ie}from"./chunk-KG7RJWOK.js";import{useMediaPanel as le,usePanelPick as se,useCancelPanelPick as de}from"./chunk-R6WTQWAC.js";import{useEaselSession as ae}from"./chunk-O7Q4DDJT.js";import{useEaselHost as ce,useHostEscape as pe}from"./chunk-U3JP4VGF.js";import{LayersIcon as ue,MediaIcon as he}from"./chunk-4VJATVVR.js";import{DEFAULT_SCREEN_WORDS as fe}from"./chunk-C2RHV42O.js";import{heldStyle as me,styleShortcut as ge}from"./chunk-V7U33NF2.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as ye}from"./chunk-6WY6ZXJG.js";import{rootRowName as ke,slotChildRowName as ve,slotChildRenameProp as Se,sectionRenameProp as be}from"./chunk-BHRC3ASL.js";import{ROOT_ZONE as we,blockNodeActions as xe,TREE_MAX_DEPTH as ze,childSlotsOf as Ce,slotFieldsOf as Oe,slotChildrenIn as Be,nestsInTree as Ie,newNodeId as Ne}from"./chunk-PLVEGYK6.js";import{useEasel as Pe,useEaselApi as $e,CanvasPassThroughContext as Me,CanvasSharedContext as je}from"./chunk-QEAUF632.js";import{TreeRow as Te,Subtree as Ae,LayersTree as Le,TreeGroupLabel as Re,TreeRowAction as Ee,TreeSeam as Ve}from"./chunk-A6Z4SD3I.js";import{DEFAULT_TREE_WORDS as Fe}from"./chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as De}from"./chunk-WK3AFPXY.js";import{toItemSelector as He,useNodeOps as We,clickPick as Ue}from"./chunk-X3TYRF5V.js";import{EaselTopBar as Ge,TopBarRail as Xe,TopBarCluster as Ye,EaselIconButton as Je,TopBarDivider as Ke,DeviceSwitch as Qe,InspectorIconButton as Ze,PanelResizeHandle as qe,MAX_PANEL_W as _e,MIN_PANEL_W as en,panelWidthVars as nn}from"./chunk-GWIVPLOX.js";import{DEFAULT_NOTICE_WORDS as tn,DEFAULT_CHROME_WORDS as on}from"./chunk-Z6PVRXVY.js";import{holderOf as rn,nameOrSomeone as ln}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as sn}from"./chunk-RE4LP46F.js";import{useWords as dn}from"./chunk-MFIRYGHW.js";import{insertSeams as an,CanvasDragLayer as cn,CanvasInsert as pn}from"./chunk-LLDHIBYG.js";import{DEFAULT_DRAG_WORDS as un}from"./chunk-KAML3KQH.js";import{createDragSession as hn,useTreeDrag as fn,gapToMoveIndex as mn}from"./chunk-67GNT6PF.js";import{useCanvasFrame as gn,LIST_SELECTOR as yn,BLOCK_SELECTOR as kn,useCanvasTyping as vn,useCanvasEvent as Sn,nodeIdAt as bn,frameRectToHost as wn,BLOCK_ATTRIBUTE as xn,drawnBox as zn}from"./chunk-X4T6JT3M.js";import{ROOT_ID as Cn,ROOT_SLOT as On,zoneKey as Bn,parseZoneKey as In,find as Nn,DataError as Pn}from"./chunk-KRXQM65X.js";import{useRef as $n,useMemo as Mn,useState as jn,useEffect as Tn,useCallback as An,useLayoutEffect as Ln,Fragment as Rn,useId as En}from"react";import{ColoredBadge as Vn,toast as Fn,Tooltip as Dn,groupColors as Hn,Dialog as Wn,FormField as Un,Input as Gn,Button as Xn}from"efficient-shell/ui";import{UndoIcon as Yn,RedoIcon as Jn,RefreshIcon as Kn,AddIcon as Qn,TrashIcon as Zn,EyeOffIcon as qn,EyeIcon as _n,SharedIcon as et,DuplicateIcon as nt}from"efficient-shell/icons/efficient";import{jsx as tt,jsxs as ot,Fragment as rt}from"react/jsx-runtime";function it({name:e,onMake:n,onCancel:t}){const o=dn("screen",fe).shared,[r,i]=jn(e),[l,s]=jn(!1),d=En(),a=$n(null),c=async()=>{const e=r.trim();if(e&&!l){s(!0);try{await n(e)}finally{s(!1)}}};/* @__PURE__ */
2
2
  return tt(Wn,{open:!0,size:"sm",title:o.makeShared,description:o.makeSharedHint,onClose:t,initialFocus:a,footer:/* @__PURE__ */ot(rt,{children:[
3
- /* @__PURE__ */tt(Yn,{variant:"secondary",onClick:t,children:o.cancel}),
4
- /* @__PURE__ */tt(Yn,{variant:"primary",loading:l,disabled:!r.trim(),onClick:()=>{c()},children:o.makeShared})]}),children:/* @__PURE__ */tt("form",{onSubmit:e=>{e.preventDefault(),c()},children:/* @__PURE__ */tt(Un,{label:o.name,htmlFor:d,children:/* @__PURE__ */tt(Gn,{id:d,ref:a,value:r,onChange:e=>i(e.target.value)})})})})}var lt=/* @__PURE__ */new WeakSet;function st(e,n,t){const o=Nn(e,n,t);if(!o)return null;const r=o.path.find(e=>"root"!==e.parentId);return r?r.parentId:t}function dt({canvas:e,tabs:n,onSelect:t}){const o=$n(null),[r,i]=jn({}),l=n.map(e=>`${e.id}:${e.below?1:0}`).join("|");return Ln(()=>{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=wn(l,{left:0,top:0,width:r.innerWidth,height:r.innerHeight},e),a={};for(const o of n){const n=t.querySelector(`[${xn}="${r.CSS?.escape?r.CSS.escape(o.id):o.id}"]`),i=n?zn(n):null;if(!i||0===i.height){a[o.id]=null;continue}const s=wn(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__ */tt("div",{ref:o,className:"es-band-tabs","aria-hidden":"true",children:n.map(e=>{const n=r[e.id];return n?/* @__PURE__ */tt("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__ */tt(Hn,{content:e.reach,children:/* @__PURE__ */ot(Fn,{colorClass:Dn("success","solid"),size:"sm",children:[
6
- /* @__PURE__ */tt("span",{className:"es-band-tab-mark",children:/* @__PURE__ */tt(et,{size:12})}),e.label]})}):/* @__PURE__ */tt(Fn,{colorClass:Dn("info","solid"),size:"sm",children:e.label})},e.id):null})})}function at({expand:e}){/* @__PURE__ */
3
+ /* @__PURE__ */tt(Xn,{variant:"secondary",onClick:t,children:o.cancel}),
4
+ /* @__PURE__ */tt(Xn,{variant:"primary",loading:l,disabled:!r.trim(),onClick:()=>{c()},children:o.makeShared})]}),children:/* @__PURE__ */tt("form",{onSubmit:e=>{e.preventDefault(),c()},children:/* @__PURE__ */tt(Un,{label:o.name,htmlFor:d,children:/* @__PURE__ */tt(Gn,{id:d,ref:a,value:r,onChange:e=>i(e.target.value)})})})})}var lt=/* @__PURE__ */new WeakSet;function st(e,n,t){const o=Nn(e,n,t);if(!o)return null;const r=o.path.find(e=>"root"!==e.parentId);return r?r.parentId:t}function dt({canvas:e,tabs:n,onSelect:t}){const o=$n(null),[r,i]=jn({}),l=n.map(e=>`${e.id}:${e.below?1:0}`).join("|");return Ln(()=>{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=wn(l,{left:0,top:0,width:r.innerWidth,height:r.innerHeight},e),a={};for(const o of n){const n=t.querySelector(`[${xn}="${r.CSS?.escape?r.CSS.escape(o.id):o.id}"]`),i=n?zn(n):null;if(!i||0===i.height){a[o.id]=null;continue}const s=wn(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__ */tt("div",{ref:o,className:"es-band-tabs","aria-hidden":"true",children:n.map(e=>{const n=r[e.id];return n?/* @__PURE__ */tt("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__ */tt(Dn,{content:e.reach,children:/* @__PURE__ */ot(Vn,{colorClass:Hn("success","solid"),size:"sm",children:[
6
+ /* @__PURE__ */tt("span",{className:"es-band-tab-mark",children:/* @__PURE__ */tt(et,{size:12})}),e.label]})}):/* @__PURE__ */tt(Vn,{colorClass:Hn("info","solid"),size:"sm",children:e.label})},e.id):null})})}function at({expand:e}){/* @__PURE__ */
7
7
  return tt("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */ot(rt,e?{children:[
8
8
  /* @__PURE__ */tt("path",{d:"M8 9l4-4 4 4"}),
9
9
  /* @__PURE__ */tt("path",{d:"M8 15l4 4 4-4"})]}:{children:[
10
10
  /* @__PURE__ */tt("path",{d:"M8 4l4 4 4-4"}),
11
11
  /* @__PURE__ */tt("path",{d:"M8 20l4-4 4 4"}),
12
- /* @__PURE__ */tt("path",{d:"M5 12h14"})]})})}var ct=`${yn}, ${kn}`;function pt(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 ut="__rungs";var ht="screen:band",ft={duplicate:!0,delete:!0};function mt(){const yn=ce(),{target:wn,docId:xn,capabilities:zn,currentSlug:En,siteId:Hn,onPublish:Dn,saveState:Wn,saveConflict:Un,retrySave:Gn,toggleAutoSave:Yn,flushSave:et,access:mt,saveUnreachable:gt=!1,readOnly:yt,readOnlyReason:kt=null}=re(),vt=P(),St=$(),{mediaEditing:bt,hasEditGuard:wt,hasPinnedChrome:xt}=zn,{appState:zt,dispatch:Ct,history:Ot,selectedItem:Bt,getSelectorForId:It,config:Nt}=Pe(e=>e),Pt=M(),{first:$t,firstGroup:Mt,lastGroup:jt,isSectionGroup:Tt,sectionGroupZone:At,panelOf:Lt}=Pt,Rt=Lt($t),Et=e=>q(Pt,e),Ft=e=>_(Pt,e),Vt="node"===Pt.firstRow,Ht=Pt.band??null,Dt=dn("screen",fe),Wt=dn("tree",Ve),Ut=dn("drag",un),Gt=dn("notice",tn),Yt=dn("lock",sn),Xt=dn("menu",He),Jt=dn("styleClipboard",ye),Qt=dn("chrome",on),Kt=j()??`/${En}`,Zt=T(),qt=A(),_t=k({readOnly:yt}),eo=k({readOnly:yt,foldIntoHistory:!0}),no=$n(null),to=$e(),oo=Mn(()=>({..._t,select:e=>{no.current=e,_t.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=to.config;no.current=De(e,t,n)}_t.commitDocument(e,n)}}),[_t,to]),ro=zt.ui,io=ro.leftSideBarVisible,lo=ro.rightSideBarVisible,{options:so,widths:ao,initial:co,fluid:po,fit:uo}=L(),[ho,fo]=jn(co),mo=le(),go=bt&&null!==mo,yo=se(),ko=de();R(Bt?.props.id);const{read:vo,write:So,forSelection:bo}=E(),[wo,xo]=jn(vo);Tn(()=>{So(wo)},[wo]);const[zo,Co]=jn(0),Oo=$n(null),Bo=$n(null),Io=gn(Bo,{readySelector:ct}),No=vn(Io),Po=a(Bo);c(Bo,Io);const $o=b(),Mo=rn(mt),jo={state:Wn,offline:$o||Wn.failed&&gt,readOnlyReason:kt,editing:Mo?Gt.editing({name:ln(Mo.name,Yt),noun:Dt.noun}):null,conflict:null!=Un,notSaving:Dt.bar.notSaving},To=()=>{yt||(Wn.failed?Gn():et())};p(Bo,Io,To);const[Ao,Lo]=jn(!1),Ro=$n(!1),Eo=$n(!1),[Fo,Vo]=jn(null),[Ho,Do]=jn([]),[Wo,Uo]=jn(F),Go="puck"===Wo.kind,Yo=o(Wo,Bt?.props.id),[Xo,Jo]=jn(null);Tn(()=>{Xo&&(r(),Jo(null))},[Xo]);const Qo=$n(It);Qo.current=It;const Ko=An((e,{scroll:n})=>{xo(n=>bo(e,n)),n&&Jo(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=Qo.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Cr(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),Zo=$n(null);Tn(()=>{const e=Zo.current;Zo.current=null;const n=null==Bt?.props.id?null:String(Bt.props.id);Uo(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:Lt(Bt?.type)??F);const t=Bt?.props.id,o=no.current;if(no.current=null,!t)return;const r=It(t);Ko(String(t),{scroll:!i(o,r??null,we)})},[Bt?.props.id,Ko]);const qo=An(e=>{Uo(n=>V(n,e)?n:e),Ct({type:"setUi",ui:{rightSideBarVisible:!0}})},[Ct]),_o=$n(()=>{});_o.current=(e,n)=>{const t=e?wi(e.zone??we)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==Bt?.props.id?null:String(Bt.props.id);Uo(e=>V(e,n)?e:n),o!==r&&(Zo.current={id:o,mode:n},oo.select(e))};const er=An((e,n)=>_o.current(e,n),[]),nr={kind:Wo.kind,mode:Wo,open:qo,show:e=>Uo(e),reveal:()=>{lo||Ct({type:"setUi",ui:{rightSideBarVisible:!0}})},select:er},tr=H(nr,{data:zt.data,selected:Bt??null,zoneOf:e=>It(e)?.zone,readOnly:Boolean(yt),select:e=>{Uo(F),oo.select({index:e})},replace:(e,n)=>oo.replaceComponent(we,e,n),scrollTo:e=>l(e)},{device:ho,refreshes:zo},{setView:xo,reveal:()=>{io||Ct({type:"setUi",ui:{leftSideBarVisible:!0}})}}),or=tr.resolveLeftView?tr.resolveLeftView(wo,go):"media"===wo&&go?wo:"sections",rr=D(),{isLockedBlock:ir,duplicateBlocked:lr,nestDepth:sr,newSectionNode:dr,canAddTo:ar,blockIsOffered:cr}=rr,pr=W(),{labelAtLevel:ur,Icon:hr,useProducts:fr}=pr,mr=pr.rowName?(e,n,t)=>pr.rowName(e,n,t):void 0,gr=An(e=>{Ct({type:"setUi",ui:{rightSideBarVisible:!0}}),l(e),Ko(e,{scroll:!0})},[Ct,Ko]),{selectNode:yr,openPartId:kr}=y({mode:Wo,setMode:Uo,onOpenPart:gr}),[vr,Sr]=jn(null);pe(null!==vr,()=>Sr(null));const br=f(U()),wr=br.collapsed,xr=br.panelWidths,[zr,Cr]=jn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(wr);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
13
- return new Set}});Tn(()=>{try{window.localStorage.setItem(wr,JSON.stringify([...zr]))}catch{}},[zr]);const[Or,Br]=jn(()=>{if("undefined"==typeof window)return{...m};try{const e=window.localStorage.getItem(xr);if(!e)return{...m};const n=JSON.parse(e);return{left:g(Number(n.left)||m.left),right:g(Number(n.right)||m.right)}}catch{return{...m}}});Tn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(xr,JSON.stringify(Or))}catch{}},300);return()=>clearTimeout(e)},[Or]);const Ir=An((e,n)=>Br(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Nr=An(e=>Ir("left",e),[Ir]),Pr=An(e=>Ir("right",e),[Ir]),$r=e=>zr.has(e),Mr=e=>Cr(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),jr=$n(!1),Tr=$n(null);Tn(()=>{if(jr.current&&!Ao){const e=Tr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??Bo.current?.querySelector(`button[aria-label="${CSS.escape(Dt.add.title)}"]`))?.focus(),Tr.current=null}jr.current=Ao},[Ao]),Tn(()=>{if(!Ao||!Po)return;const e=e=>{"Escape"===e.key&&el()};return Po.addEventListener("keydown",e),()=>Po.removeEventListener("keydown",e)},[Ao,Po]),pe(Ao,()=>el()),Tn(()=>{!io&&Ao&&(Lo(!1),Vo(null),Ro.current=!1)},[io]),Tn(()=>{if(!yo)return Eo.current&&Ct({type:"setUi",ui:{leftSideBarVisible:!1}}),void(Eo.current=!1);Ao&&(Lo(!1),Vo(null),Eo.current=Ro.current,Ro.current=!1),io||(Eo.current=!0,Ct({type:"setUi",ui:{leftSideBarVisible:!0}}))},[yo]),Tn(()=>{!io&&yo&&(Eo.current=!1,ko())},[io]),Tn(()=>{if(!yo||!Po)return;const e=e=>{"Escape"===e.key&&ko()};return Po.addEventListener("keydown",e),()=>Po.removeEventListener("keydown",e)},[yo,Po]),pe(null!==yo,()=>ko());const Ar=G(),Lr=(e,n="success",t)=>{if(Ar)return void(t?Ar(e,"error"===n?"error":"info",t):Ar(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?Vn.error(e,{...o,duration:t?.duration??3200}):Vn.success(e,{...o,duration:t?.duration??1900})},Rr=$n(null),[Er,Fr]=jn(0),[Vr,Hr]=jn(0),Dr=Y(),Wr=$n(null),Ur=e=>Math.max(0,e.clientHeight-(Wr.current?.offsetHeight??0));Tn(()=>{const e=Rr.current;if(!e)return;const n=()=>{Fr(e.clientWidth),Hr(Ur(e))};n();const t=new ResizeObserver(n);return t.observe(e),Wr.current&&t.observe(Wr.current),()=>t.disconnect()},[]),Ln(()=>{Rr.current&&(Fr(Rr.current.clientWidth),Hr(Ur(Rr.current)))},[Or,io,lo]);const Gr=ho===po?Er>0?Er:ao[po]:ao[ho],Yr=Er>0?Math.min(Er/Gr,"shrink"===uo?1:2):1,Xr=Gr*Yr,Jr=Er>0&&Xr>Er+1,Qr={width:Xr,height:Vr||"100%",flex:"none",position:"relative"},Kr={width:Gr,height:Vr?Vr/Yr:"100%",maxHeight:"none",transform:1!==Yr?`scale(${Yr})`:void 0,transformOrigin:"top left"},Zr=()=>Ct({type:"setUi",ui:{leftSideBarVisible:!io}}),qr=()=>Ct({type:"setUi",ui:{rightSideBarVisible:!lo}}),_r=e=>{Ao&&(Lo(!1),Vo(null),Ro.current=!1,io&&wo===e)||yo&&(Eo.current=!1,ko(),io&&wo===e)||(io&&wo===e?Zr():(xo(e),io||Ct({type:"setUi",ui:{leftSideBarVisible:!0}})))},ei=()=>{ie(yn,{accept:"image/*",title:Qt.mediaLibrary})},ni=()=>{Uo(F),oo.select(null),d()},ti=()=>{Uo(Rt??F),lo||Ct({type:"setUi",ui:{rightSideBarVisible:!0}})},oi=zt.data.content??[],ri=()=>{const e=oi.findIndex(Et),n=oi.findIndex(Ft);return{floor:e>=0?e+1:0,cap:n>=0?n:oi.length}},ii=Nt,li=rr.stripCopy,si=n=>e(n,li),di=ne(),ai=We({data:zt.data,config:ii,readOnly:Boolean(yt),clipboard:di,strip:li?e=>li(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==Cn||e.slot!==On)return{min:0,max:n-1};const{floor:t,cap:o}=ri();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&Uo(F);const t=void 0===n||"node"===n?.kind?n:null;oo.commitDocument(e,t)}}),ci=ae(),[pi,ui]=jn(null),hi=e=>{const n=oi.find(n=>String(n.props.id)===e),t=Pt.shared;n&&t&&ai.swap(e,t.detach(n))},fi=e=>{const n=Nn(zt.data,Nt,e);if(!n)return!1;const t=Bn(n.place),o=n.node,r=t===we?vi(o):ji(o),i=t===we?Pt.shared?.usedOn(o):null;return!!ai.remove(e)&&(Lr(i?Dt.shared.removed({count:Math.max(0,i.length-1)}):Dt.deleted({name:r}),"success",{duration:8e3,action:{label:Dt.bar.undo,onClick:()=>{ai.restore(n.node,n.place)}}}),!0)},mi={...ai,remove:fi},gi=e=>ur(e,"block",Nt.components[e]?.label??e),yi=An(e=>Nt.components[e]?.defaultProps??{},[Nt]),ki=e=>ur(e,"section",gi(e)),vi=e=>ke({type:e.type,props:e.props??{}},ki(e.type),mr),{nodeAddresses:Si,zoneItems:bi}=Mn(()=>{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>=ze)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of Ce(Nt,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(oi,we,0),{nodeAddresses:e,zoneItems:n}},[oi,Nt]),wi=An(e=>bi.get(e)??[],[bi]),xi=e=>{const n=Si.get(e);return n?wi(n.zone)[n.index]:void 0},zi=e=>ee(rr,Nt,e),Ci=e=>{if(!rr.slotsOf||e===we)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=xi(e.slice(0,n));if(!t)return null;const o=zi(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}},Oi=(()=>{if(!X(Wo))return null;const e=`${Wo.nodeId}:${Wo.slot}`;return Ci(e)?.slot.panel===Wo.kind?e:null})(),Bi=$n(null);Tn(()=>{const e=Bi.current;if(Bi.current=null,!Oi||!X(Wo))return;const n=Wo.nodeId;Ko(n,{scroll:e!==Oi}),Cr(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[Wo]);const Ii=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=Si.get(e);n&&(n.zone===we?Xi(n.index):Sl(n.zone,n.index,e,xi(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&Oi!==i&&(Bi.current=i),er(null,r),lo||Ct({type:"setUi",ui:{rightSideBarVisible:!0}}),l(o)},Ni=(e,n,t)=>{const o=`${e}:${n}`;if(Cr(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;Oi!==o&&(Bi.current=o);er(null,{kind:t,nodeId:e,slot:n})},Pi=(e,n,t)=>{if(yt||!rr.moveSlot)return;const o=xi(e),r=o?zi(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:ut,index:n},s=mn(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=rr.moveSlot(e,n,s);"string"==typeof d&&Ni(e,d,i.panel)},$i=fr(),Mi=Mn(()=>{const e=/* @__PURE__ */new Map;for(const n of $i??[])e.set(n.slug,n.name);return e},[$i]),ji=e=>ve(e,gi,pr.plainText,e=>Mi.get(e),pr.rowName),Ti=(e,n)=>{const t=Nt.components[e.type]?.fields,o=n===we||Yl(n)?"section":"block",r=n===we&&(Et(e)||Ft(e)||Tt(e.type)),i="block"===o?Se(t):r?null:be(t);return pr.renamePropOf?pr.renamePropOf(e,o,i):i},Ai=(e,n,t,o)=>{if(!(!yt&&vr?.zone===e&&vr.index===n))return;const r=(t,o)=>{Sr(null),o&&((e,n,t)=>{const o=wi(e)[n];if(!o)return;const r=Ti(o,e);r&&oo.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
14
- return tt("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":Dt.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)},Li=t(J(),Jt),Ri=Li.scope({target:wn,siteId:Hn,docId:xn}),Ei=Nt,Fi=(e,n)=>n===we?ki(e):gi(e),Vi=(e,n,t)=>{const o=Li.plan(Ri,t,Fi(t.type,e),Ei);o&&(o.changed&&oo.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Lr(o.message))},Hi=te({nodesIn:wi,nodeAt:(e,n)=>wi(e)[n]??null,labelOf:(e,n)=>n===we?ki(e):gi(e),renamePropOf:Ti,beginRename:(e,n)=>Sr({zone:e,index:n}),history:{hasPast:Ot.hasPast,hasFuture:Ot.hasFuture,back:()=>Ot.back(),forward:()=>Ot.forward()},openPageSettings:()=>{oo.select(null),Uo(F)},pageSettingsLabel:Dt.pageSettings,words:{menu:Xt,styleClipboard:Jt,screen:Dt.menu},readOnly:Boolean(yt),collapseAll:()=>Cr(new Set(wi(we).map(e=>String(e.props.id)))),onPasteRefused:e=>Lr(e?Dt.pasteRefused({name:e.label}):Dt.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>Ql(e,n),menuRows:(e,n,t)=>{const o=tr.menuRows?.(e,n,t)??null,r=((e,n)=>{const t=Pt.shared;if(!t||n!==we)return null;const o=t.usedOn(e);if(o){const n={pick:[{label:Dt.shared.onPages({count:o.length}),onClick:()=>{},children:o.map(e=>({label:e.title,onClick:()=>t.openPage(e)}))}]};return yt?n:{...n,change:[{label:Dt.shared.detach,onClick:()=>hi(e.props.id)}],remove:[{label:Dt.shared.removeFromPage,danger:!0,onClick:()=>{fi(e.props.id)}}]}}return yt||Et(e)||Ft(e)||Tt(e.type)?null:z(ci)?{change:[{label:Dt.shared.makeShared,onClick:()=>ui({id:e.props.id,name:vi(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=>ir(e.type),duplicateBlocked:e=>lr(zt.data,e),permits:e=>{const n=xe(Nt,e.type);return Pt.shared?.usedOn(e)?{...n,delete:!1}:n},nodeOps:mi,isPinned:(e,n)=>n===we&&(Et(e)||Ft(e)),sectionBand:ri,locate:e=>Si.get(e)??null,rowNameOf:(e,n)=>n===we?vi(e):ji(e),selectAt:(e,n,t,o)=>{e===we?Xi(n):Sl(e,n,t,o??"")},slotRung:e=>{const n=Ci(e);return n?.slot.panel?{label:n.slot.label,select:()=>Ii(n.node,n.slot,!1)}:null},style:{held:()=>me(Ri),canCopy:e=>Li.rows(Ei,e).some(e=>!1!==e.counted),copy:(e,n)=>Li.copy(Ri,e,Fi(e.type,n),Ei),paste:(e,n,t)=>Vi(e,n,t)},keys:St?{target:Po,selected:()=>{const e=zt.ui.itemSelector;return e?{zone:e.zone??we,index:e.index}:null},held:()=>di.get(),readOnly:Boolean(yt),onDone:({done:e,name:n})=>{"copied"===e&&Lr(Dt.copied({name:n}))}}:void 0},Io),Di=$n({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});Tn(()=>{Di.current={copy:(e,n)=>Li.copy(Ri,e,Fi(e.type,n),Ei),paste:Vi,at:()=>{const e=zt.ui.itemSelector;if(!e)return null;const n=e.zone??we,t=wi(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(yt)}});const Wi=An(e=>{const n=ge(e);if(!n)return;const t=Di.current,o=t.at();o&&(e.preventDefault(),"copy"===n?t.copy(o.node,o.zone):t.readOnly||t.paste(o.zone,o.index,o.node))},[]);Tn(()=>{if(!Po)return;const e=e=>Wi(e);return Po.addEventListener("keydown",e),()=>Po.removeEventListener("keydown",e)},[Wi,Po]),Sn(Io,"keydown",Wi);const Ui=oi.map(e=>e.props.id).join("|");Tn(()=>{const e=Io?.document??null,n=Io?.window??null;let t=0;const o=[],r=()=>{if(!e)return void Do(e=>e.length?[]:e);const n=oi.findIndex(Ft),t=n>=0?n:oi.length,o=n=>{const t=oi[n]?.props?.id;return null==t?null:e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(kn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=oi.length>0&&!Et(oi[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=pt(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})}Do(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()}},[Io,Ui,ho,Yr,io,lo,Bt?.props.id]);const Gi=Io?.document??null,Yi=Io?.window??null;Tn(()=>{const e=Oo.current;if(!e||!Gi||!Yi)return;const n=[],t=()=>{const n=Gi.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&Yi.scrollTo({left:Yi.scrollX,top:Yi.scrollY+t,behavior:"instant"}),!0};return Oo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[Gi,Yi]);const Xi=e=>{Uo(F),oo.select({index:e}),tr.sectionPressed?.(oi[e]);const n=oi[e]?.props?.id;n&&l(n)},Ji=e=>{const{floor:n,cap:t}=ri(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=Bt&&Wo.kind!==Rt?.kind?oi.findIndex(e=>e.props.id===Bt.props.id):-1;return o(r>=0?r+1:t)},Qi=(e,n)=>{const{floor:t,cap:o}=ri(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(oo.reorderComponent(we,e,i),oo.select({index:i}),{moved:!0,dest:i})},Ki=(e,n,t,o)=>{Uo(F),oo.select(o?{index:o.index,zone:o.zone}:{index:e}),l(n),Lr(Dt.sectionAdded({name:t}))},Zi=(e,n)=>{const t=Ji(n),o=dr(e,{nodeDefaults:yi,newNodeId:Ne,sectionLabel:ki,blockIsOffered:cr}),r=o?oo.insertNode(we,t,o):oo.insertSection(e,t);return Ki(t,r,ki(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 Ce(Nt,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=ar(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},qi=e=>_i(we,e),_i=(e,n)=>{Tr.current=document.activeElement??null,yo&&(Ro.current=Eo.current,Eo.current=!1,ko()),Vo(null===n?null:{zone:e,index:n}),Lo(!0),io||(Ro.current=!0,Ct({type:"setUi",ui:{leftSideBarVisible:!0}}))},el=()=>{Lo(!1),Vo(null),Ro.current&&Ct({type:"setUi",ui:{leftSideBarVisible:!1}}),Ro.current=!1},nl=(e,n)=>pr.rowName?n?Et(e)?pr.rowName(e,"section",Dt.header):Ft(e)?pr.rowName(e,"section",Dt.footer):Tt(e.type)?pr.rowName(e,"section",gi(e.type)):vi(e):ji(e):n?ki(e.type):gi(e.type),tl=e=>n=>{e()},ol=(e,n,t)=>{if(yt)return null;const o=wi(e)[n];return o&&!xe(Nt,o.type).delete?null:/* @__PURE__ */tt(Ee,{kind:"delete",label:e===we&&o&&Pt.shared?.usedOn(o)?Dt.shared.removeFromPage:Dt.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=wi(e)[n]?.props?.id;null!=t&&fi(String(t))})(e,n),children:/* @__PURE__ */tt(Zn,{size:15})})},rl=e=>pr.rowPreview?.(e)||void 0,il=e=>pr.rowMarks?.(e)??void 0,ll=(e,n,t)=>pr.rowActions?.(e,n,t)??null,sl=(e,n,t,o)=>{if(yt)return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
15
- return tt(Ee,{kind:"eye",label:r?Dt.showNamed({name:o}):Dt.hideNamed({name:o}),onClick:()=>al(e,n,t),children:/* @__PURE__ */tt(r?qn:_n,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},dl=e=>Is(we,e),al=(e,n,t)=>{oo.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},cl=e=>Oe(Nt,e),pl=e=>Ce(Nt,e),ul=e=>rr.slotsOf?zi(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:Be(e,n.slot)})):[{slot:null,rung:null,kids:pl(e)}],hl=e=>rr.slotsOf?ul(e).flatMap(e=>e.kids):pl(e),fl=e=>Boolean(rr.slotsOf)&&zi(e).some(e=>e.rung),ml=(e,n,t)=>null===t?void 0===n?ar(e):ar(e,n):ar(e,n,t),gl=(e,n,t)=>{const o=Ie(Nt,e.type,n)&&(t||hl(e).length>0||fl(e));return{collapsible:o,folded:o&&$r(String(e.props.id))}},yl=(e,n,t)=>ul(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>gl(e,r,t(e.type)).collapsible?[String(e.props.id),...yl(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),kl=e=>hl(e).length>0||fl(e)||Boolean(ar(e.type)),vl=e=>Boolean(ar(e)),Sl=(e,n,t,o)=>{if(Uo(F),ar(o)?.spec?.slider){const t=e.split(":")[0];s(t,n),oo.select({index:n,zone:e}),l(t)}else oo.select({index:n,zone:e}),l(t)},bl=(e,n,t,o,r)=>{const i=`${e}:${n}`;oo.insertComponent(i,t,o),ar(r)?.spec?.slider?requestAnimationFrame(()=>{s(e,o),oo.select({index:o,zone:i})}):oo.select({index:o,zone:i})},wl=$n(/* @__PURE__ */new Set);Tn(()=>{oi.forEach(e=>{const n=ar(e.type)?.spec;if(!n)return;const t=e.props.id;if(wl.current.has(t))return;wl.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(yi)).forEach((e,t)=>eo.seedChild(o,t,n.childType,e))})},[oi,eo,yi]);const xl=$n(/* @__PURE__ */new Set);Tn(()=>{oi.forEach((e,t)=>{const o=e.props.id;if(xl.current.has(o))return;const r=n(e,cl(e.type));xl.current.add(o),r&&eo.replaceComponent(we,t,{...e,props:r})})},[oi,eo]),Q(eo,Nt);const zl=oi.findIndex(Ft),Cl=zl>=0?oi[zl]:null,Ol=Vt?oi.findIndex(Et):-1,Bl=Ol>=0?oi[Ol]:null,Il=Pt.groupTab,Nl=Mn(()=>Il?e=>Tt(e.type):void 0,[Il]),Pl=Boolean(Pt.groupBadge),$l=Pt.sharedReach,Ml=e=>$l?.(e)??void 0,jl=Mn(()=>$l?new Set(oi.filter(e=>Ml(e)).map(e=>String(e.props.id))):null,[oi,$l]),Tl=Mn(()=>jl?e=>jl.has(e):void 0,[jl]),Al=Pt.first?$l?.({type:Pt.first,props:{id:""}})??void 0:void 0,Ll=Pt.groupBadge?/* @__PURE__ */tt("span",{className:"es-tree-group-badge",children:/* @__PURE__ */tt(Fn,{tone:"info",size:"xs",children:Pt.groupBadge})}):void 0,Rl=oi.find(e=>e.type===Mt)??null,El=oi.find(e=>e.type===jt)??null,Fl=zl>=0?zl:oi.length,Vl=[];oi.forEach(e=>{Ft(e)||(kl(e)&&Vl.push(String(e.props.id)),Vl.push(...yl(e,1,vl)))}),Cl&&(Vl.push(String(Cl.props.id)),Vl.push(...yl(Cl,1,vl)));const Hl=Vl.length>0&&Vl.every(e=>zr.has(e)),Dl=e=>{const n=pr.blockRowName(e,gi);return pr.rowName?pr.rowName(e,"block",n):n},Wl=(e,n,t,o)=>{const r=wi(e)[t];if(!r)return;const i={...In(e),index:t},l={...In(n),index:Math.min(Math.max(o,0),wi(n).length)},s=mn(i,l);if(e!==n||s!==t)try{ai.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof Pn))throw e}},Ul=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of pl(e))n.add(r),t(o)};for(const t of cl(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},Gl=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Si.get(n);if(!e)return null;if(e.zone===we)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},Yl=e=>{const n=e.slice(0,e.indexOf(":")),t=oi.find(e=>Tt(e.type)&&String(e.props.id)===n);return t&&At(n)===e?t:null},Xl=(e,n)=>{const t=Yl(e);return!t||(!Pt.groupAccepts||Pt.groupAccepts(t.type,n,wi(e).length))},Jl=(e,n,t)=>{if(e.rung){const t=xi(e.rung.nodeId),o=t?zi(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===ut&&n.index>=0&&n.index<=o}if(n.slot===ut)return!1;if(e.add)return ql(e.add,n);const o=Bn(n);if(Tt(e.type))return!1;const r=Yl(o),i=Yl(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!Xl(o,e.type))&&(n.index>=0&&n.index<=wi(o).length));if(e.zone===we||o===we){if(e.zone!==o)return!1;const{floor:t,cap:r}=ri();return n.index>=t&&n.index<=r}if(n.index<0||n.index>wi(o).length)return!1;if(e.zone===o)return!0;const l=Cl&&!Pt.lastIsOpen?String(Cl.props.id):null;return(!l||Gl(e.zone)!==l&&Gl(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??wi(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Si.get(i),s=l?wi(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&Ul(r).has(n))return!1;const d=ar(s.type,sr(zt?.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?.(wi(n),r))})(e.zone,o,e.index,t)},Ql=(e,n)=>{const t=Bn(e.from),o=e.node;return t===Bn(n)?Xl(t,o.type):Jl({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},Kl=e=>{const n=e.slice(0,e.indexOf(":")),t=Si.get(n),o=t?wi(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=ar(o.type,sr(zt?.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:gi(r.spec.childType)}]:[])),l=Ci(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:nl(o,t.zone===we)}},Zl=(e,n)=>{if("section"!==e.kind)return e;const t=Bn(n);return t===we||Yl(t)?e:Kl(t)?.choices.some(n=>n.type===e.type)?{kind:"block",type:e.type}:e},ql=(e,n)=>{const t=Zl(e,n),o=Bn(n);if("shared"===t.kind){if(o!==we||!Pt.shared?.nodeOf(t.section))return!1;const{floor:e,cap:r}=ri();return n.index>=e&&n.index<=r}if("block"!==t.kind){if(Yl(o)){const e="section"===t.kind?t.type:t.template.node.type;return Xl(o,e)&&n.index>=0&&n.index<=wi(o).length}if(o!==we)return!1;const{floor:e,cap:r}=ri();return n.index>=e&&n.index<=r}if(o===we)return!1;const r=Kl(o);return!(!r||!r.choices.some(e=>e.type===t.type))&&!r.target.spec?.addBlocked?.(wi(o))},_l=(e,n)=>{const t=Zl(e,n);if("block"!==t.kind&&Yl(Bn(n)))return void((e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&Xl(n,o)){if("section"===e.kind)oo.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;oo.insertNode(n,t,si(e.template.node))}Uo(F),oo.select({index:t,zone:n})}})(t,Bn(n),n.index);if("section"===t.kind)return void Zi(t.type,n.index);if("template"===t.kind)return void((e,n,t)=>{const o=Ji(t),r=oo.insertNode(we,o,n);Ki(o,r,e)})(t.template.name,si(t.template.node),n.index);if("shared"===t.kind){const e=Pt.shared?.nodeOf(t.section);if(!e)return;const o=Ji(n.index);return void(ai.restore(e,{parentId:Cn,slot:On,index:o})&&Ki(o,e.props.id,t.section.title))}const o=Bn(n),r=Kl(o);r&&(r.target.spec?bl(r.parentId,r.target.slot,t.type,n.index,r.parent.type):((e,n,t)=>{oo.insertComponent(e,n,t),Uo(F),oo.select({index:t,zone:e})})(o,t.type,n.index))},es=(e,n)=>{e.rung?Pi(e.rung.nodeId,e.index,n.index):e.add?_l(e.add,n):e.zone===we?Qi(e.index,n.index):Wl(e.zone,Bn(n),e.index,n.index)},[ns]=jn(()=>hn()),ts=fn({keyOf:e=>e.id,readOnly:Boolean(yt),session:ns,canDrop:Jl,onDrop:es,onStep:(e,n)=>{e.rung?Pi(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===we?((e,n)=>{const t=ki(oi[e]?.type??""),o=Qi(e,n<0?e-1:e+2);if(!o.moved)return void Lr(n<0?Dt.sectionFirst({name:t}):Dt.sectionLast({name:t}));const{floor:r,cap:i}=ri();Lr(Dt.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):Wl(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),os=An(e=>{const{floor:n,cap:t}=ri(),o=[];for(const r of e.nodes){const e=Bn(r.place),i=wi(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(Et(i)||Ft(i)||ir(i.type))continue;if(Tt(i.type))continue;const l=Boolean(Yl(e)),s=e===we||l;e===we&&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?ki(i.type):ji(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=Bn(e.list);if(n===we&&0===e.children.length)return[{...e,addLabel:Dt.addSection,addAlways:!0}];const t=Kl(n),o=t?.target.spec?.addLabel;return e.children.length>0||Boolean(t?.choices.length)||Boolean(Yl(n))?[o?{...e,addLabel:o}:e]:[]}),i=r.flatMap(e=>{const n=Bn(e.list),t=n===we||Yl(n)?null:Kl(n);return t?.choices.length?an(e,t.target.spec?.addLabel??Dt.addBlockHere):[]});return{sources:o,zones:r,seams:i}},[zt.data]),rs=null==Bt?.props.id?null:String(Bt.props.id),is=An(e=>{const n=Nt,t=e=>!e.item.rung&&null!==Nn(zt.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(rs);return i||(r(Ue(zt.data,n,o.item.id,rs,Nl))??o)},[zt.data,Nt,rs,Nl]),[ls,ss]=jn(null),ds=Boolean(Il||$l);Sn(Io,"mouseover",e=>{if(!ds)return;const n=bn(e.target),t=n?st(zt.data,Nt,n):null;t!==ls&&ss(t)}),Sn(Io,"mouseout",e=>{ds&&!e.relatedTarget&&ss(null)});const as=e=>Et(e)||Ft(e)||Tt(e.type),cs=e=>{const n=Tt(e.type)?gi(e.type):Et(e)?Dt.header:Ft(e)?Dt.footer:null;return null===n?vi(e):pr.rowName?pr.rowName(e,"section",n):n},ps=[];if(ds){const e=rs?st(zt.data,Nt,rs):null;for(const n of/* @__PURE__ */new Set([e,ls])){const e=n?oi.find(e=>String(e.props.id)===n):void 0;if(!e)continue;const t=Et(e)||e.type===Mt,o=Ml(e);if(o){ps.push({id:String(e.props.id),label:cs(e),below:t,reach:o});continue}if(!Il||!as(e))continue;const r=Il(e);r&&ps.push({id:String(e.props.id),label:r,below:t})}}const us=ae(),hs=$n(null);Tn(()=>{const e=Pt.changeNotice;if(!e)return;const n=JSON.stringify(oi.filter(as)),t=hs.current;if(hs.current={doc:xn,bands:n,index:Ot.index},!t||t.doc!==xn||t.bands===n)return;Ot.hasPast&&Ot.index>=t.index&&!lt.has(us)&&(lt.add(us),Lr(e,"success",{action:{label:Dt.bar.undo,onClick:()=>Ot.back()},duration:8e3}))},[oi]);const fs=e=>{Uo(F),oo.select(e.zone===we?{index:e.index}:{index:e.index,zone:e.zone})},ms=K(),gs=()=>({data:zt.data,device:ho,ops:oo,inspector:nr}),ys=ms?.model,ks=Mn(()=>ys?e=>ys(e,os(e),gs()):os,[ys,os,ho]),vs=ms?.measure,Ss=vs?(e,n)=>vs(e,n,gs()):void 0,bs=ms?.canDrop,ws=bs?(e,n)=>bs(e,n,Jl,gs()):Jl,xs=ms?.drop,zs=xs?(e,n)=>xs(e,n,es,gs()):es,Cs=ms?.pick,Os=Cs?e=>Cs(e,fs,gs()):fs,Bs=e=>{const n=Bn(e),t=Ci(n);t&&Ii(t.node,t.slot,!1),_i(n,e.index)},Is=(e,n)=>/* @__PURE__ */tt(Fe,{...yt?{}:ts.seam({place:{...In(e),index:n}})},`seam:${e}:${n}`),Ns={rowClick:tl,isCollapsed:$r,toggleCollapse:Mr},Ps=e=>{const n=String(e.props.id),t=oi.findIndex(e=>String(e.props.id)===n),o=At(n),r=wi(o),i=$r(n),l=gi(e.type),s=pr.rowName?pr.rowName(e,"section",l):l,d=e=>Is(o,e);/* @__PURE__ */
12
+ /* @__PURE__ */tt("path",{d:"M5 12h14"})]})})}var ct=`${yn}, ${kn}`;function pt(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 ut="__rungs";var ht="screen:band",ft={duplicate:!0,delete:!0};function mt(){const yn=ce(),{target:wn,docId:xn,capabilities:zn,currentSlug:En,siteId:Dn,onPublish:Hn,saveState:Wn,saveConflict:Un,retrySave:Gn,toggleAutoSave:Xn,flushSave:et,access:mt,saveUnreachable:gt=!1,readOnly:yt,readOnlyReason:kt=null}=re(),vt=P(),St=$(),{mediaEditing:bt,hasEditGuard:wt,hasPinnedChrome:xt}=zn,{appState:zt,dispatch:Ct,history:Ot,selectedItem:Bt,getSelectorForId:It,config:Nt}=Pe(e=>e),Pt=M(),{first:$t,firstGroup:Mt,lastGroup:jt,isSectionGroup:Tt,sectionGroupZone:At,panelOf:Lt}=Pt,Rt=Lt($t),Et=e=>q(Pt,e),Vt=e=>_(Pt,e),Ft="node"===Pt.firstRow,Dt=Pt.band??null,Ht=dn("screen",fe),Wt=dn("tree",Fe),Ut=dn("drag",un),Gt=dn("notice",tn),Xt=dn("lock",sn),Yt=dn("menu",De),Jt=dn("styleClipboard",ye),Kt=dn("chrome",on),Qt=j()??`/${En}`,Zt=T(),qt=A(),_t=k({readOnly:yt}),eo=k({readOnly:yt,foldIntoHistory:!0}),no=$n(null),to=$e(),oo=Mn(()=>({..._t,select:e=>{no.current=e,_t.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=to.config;no.current=He(e,t,n)}_t.commitDocument(e,n)}}),[_t,to]),ro=zt.ui,io=ro.leftSideBarVisible,lo=ro.rightSideBarVisible,{options:so,widths:ao,initial:co,fluid:po,fit:uo}=L(),[ho,fo]=jn(co),mo=le(),go=bt&&null!==mo,yo=se(),ko=de();R(Bt?.props.id);const{read:vo,write:So,forSelection:bo}=E(),[wo,xo]=jn(vo);Tn(()=>{So(wo)},[wo]);const[zo,Co]=jn(0),Oo=$n(null),Bo=$n(null),Io=gn(Bo,{readySelector:ct}),No=vn(Io),Po=a(Bo);c(Bo,Io);const $o=b(),Mo=rn(mt),jo={state:Wn,offline:$o||Wn.failed&&gt,readOnlyReason:kt,editing:Mo?Gt.editing({name:ln(Mo.name,Xt),noun:Ht.noun}):null,conflict:null!=Un,notSaving:Ht.bar.notSaving},To=()=>{yt||(Wn.failed?Gn():et())};p(Bo,Io,To);const[Ao,Lo]=jn(!1),Ro=$n(!1),Eo=$n(!1),[Vo,Fo]=jn(null),[Do,Ho]=jn([]),[Wo,Uo]=jn(V),Go="puck"===Wo.kind,Xo=o(Wo,Bt?.props.id),[Yo,Jo]=jn(null);Tn(()=>{Yo&&(r(),Jo(null))},[Yo]);const Ko=$n(It);Ko.current=It;const Qo=An((e,{scroll:n})=>{xo(n=>bo(e,n)),n&&Jo(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=Ko.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Cr(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),Zo=$n(null);Tn(()=>{const e=Zo.current;Zo.current=null;const n=null==Bt?.props.id?null:String(Bt.props.id);Uo(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:Lt(Bt?.type)??V);const t=Bt?.props.id,o=no.current;if(no.current=null,!t)return;const r=It(t);Qo(String(t),{scroll:!i(o,r??null,we)})},[Bt?.props.id,Qo]);const qo=An(e=>{Uo(n=>F(n,e)?n:e),Ct({type:"setUi",ui:{rightSideBarVisible:!0}})},[Ct]),_o=$n(()=>{});_o.current=(e,n)=>{const t=e?wi(e.zone??we)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==Bt?.props.id?null:String(Bt.props.id);Uo(e=>F(e,n)?e:n),o!==r&&(Zo.current={id:o,mode:n},oo.select(e))};const er=An((e,n)=>_o.current(e,n),[]),nr={kind:Wo.kind,mode:Wo,open:qo,show:e=>Uo(e),reveal:()=>{lo||Ct({type:"setUi",ui:{rightSideBarVisible:!0}})},select:er},tr=D(nr,{data:zt.data,selected:Bt??null,zoneOf:e=>It(e)?.zone,readOnly:Boolean(yt),select:e=>{Uo(V),oo.select({index:e})},replace:(e,n)=>oo.replaceComponent(we,e,n),scrollTo:e=>l(e)},{device:ho,refreshes:zo},{setView:xo,reveal:()=>{io||Ct({type:"setUi",ui:{leftSideBarVisible:!0}})}}),or=tr.resolveLeftView?tr.resolveLeftView(wo,go):"media"===wo&&go?wo:"sections",rr=H(),{isLockedBlock:ir,duplicateBlocked:lr,nestDepth:sr,newSectionNode:dr,canAddTo:ar,blockIsOffered:cr}=rr,pr=W(),{labelAtLevel:ur,Icon:hr,useProducts:fr}=pr,mr=pr.rowName?(e,n,t)=>pr.rowName(e,n,t):void 0,gr=An(e=>{Ct({type:"setUi",ui:{rightSideBarVisible:!0}}),l(e),Qo(e,{scroll:!0})},[Ct,Qo]),{selectNode:yr,openPartId:kr}=y({mode:Wo,setMode:Uo,onOpenPart:gr}),[vr,Sr]=jn(null);pe(null!==vr,()=>Sr(null));const br=f(U()),wr=br.collapsed,xr=br.panelWidths,[zr,Cr]=jn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(wr);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
13
+ return new Set}});Tn(()=>{try{window.localStorage.setItem(wr,JSON.stringify([...zr]))}catch{}},[zr]);const[Or,Br]=jn(()=>{if("undefined"==typeof window)return{...m};try{const e=window.localStorage.getItem(xr);if(!e)return{...m};const n=JSON.parse(e);return{left:g(Number(n.left)||m.left),right:g(Number(n.right)||m.right)}}catch{return{...m}}});Tn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(xr,JSON.stringify(Or))}catch{}},300);return()=>clearTimeout(e)},[Or]);const Ir=An((e,n)=>Br(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),Nr=An(e=>Ir("left",e),[Ir]),Pr=An(e=>Ir("right",e),[Ir]),$r=e=>zr.has(e),Mr=e=>Cr(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),jr=$n(!1),Tr=$n(null);Tn(()=>{if(jr.current&&!Ao){const e=Tr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??Bo.current?.querySelector(`button[aria-label="${CSS.escape(Ht.add.title)}"]`))?.focus(),Tr.current=null}jr.current=Ao},[Ao]),Tn(()=>{if(!Ao||!Po)return;const e=e=>{"Escape"===e.key&&el()};return Po.addEventListener("keydown",e),()=>Po.removeEventListener("keydown",e)},[Ao,Po]),pe(Ao,()=>el()),Tn(()=>{!io&&Ao&&(Lo(!1),Fo(null),Ro.current=!1)},[io]),Tn(()=>{if(!yo)return Eo.current&&Ct({type:"setUi",ui:{leftSideBarVisible:!1}}),void(Eo.current=!1);Ao&&(Lo(!1),Fo(null),Eo.current=Ro.current,Ro.current=!1),io||(Eo.current=!0,Ct({type:"setUi",ui:{leftSideBarVisible:!0}}))},[yo]),Tn(()=>{!io&&yo&&(Eo.current=!1,ko())},[io]),Tn(()=>{if(!yo||!Po)return;const e=e=>{"Escape"===e.key&&ko()};return Po.addEventListener("keydown",e),()=>Po.removeEventListener("keydown",e)},[yo,Po]),pe(null!==yo,()=>ko());const Ar=G(),Lr=(e,n="success",t)=>{if(Ar)return void(t?Ar(e,"error"===n?"error":"info",t):Ar(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?Fn.error(e,{...o,duration:t?.duration??3200}):Fn.success(e,{...o,duration:t?.duration??1900})},Rr=$n(null),[Er,Vr]=jn(0),[Fr,Dr]=jn(0),Hr=X(),Wr=$n(null),Ur=e=>Math.max(0,e.clientHeight-(Wr.current?.offsetHeight??0));Tn(()=>{const e=Rr.current;if(!e)return;const n=()=>{Vr(e.clientWidth),Dr(Ur(e))};n();const t=new ResizeObserver(n);return t.observe(e),Wr.current&&t.observe(Wr.current),()=>t.disconnect()},[]),Ln(()=>{Rr.current&&(Vr(Rr.current.clientWidth),Dr(Ur(Rr.current)))},[Or,io,lo]);const Gr=ho===po?Er>0?Er:ao[po]:ao[ho],Xr=Er>0?Math.min(Er/Gr,"shrink"===uo?1:2):1,Yr=Gr*Xr,Jr=Er>0&&Yr>Er+1,Kr={width:Yr,height:Fr||"100%",flex:"none",position:"relative"},Qr={width:Gr,height:Fr?Fr/Xr:"100%",maxHeight:"none",transform:1!==Xr?`scale(${Xr})`:void 0,transformOrigin:"top left"},Zr=()=>Ct({type:"setUi",ui:{leftSideBarVisible:!io}}),qr=()=>Ct({type:"setUi",ui:{rightSideBarVisible:!lo}}),_r=e=>{Ao&&(Lo(!1),Fo(null),Ro.current=!1,io&&wo===e)||yo&&(Eo.current=!1,ko(),io&&wo===e)||(io&&wo===e?Zr():(xo(e),io||Ct({type:"setUi",ui:{leftSideBarVisible:!0}})))},ei=()=>{ie(yn,{accept:"image/*",title:Kt.mediaLibrary})},ni=()=>{Uo(V),oo.select(null),d()},ti=()=>{Uo(Rt??V),lo||Ct({type:"setUi",ui:{rightSideBarVisible:!0}})},oi=zt.data.content??[],ri=()=>{const e=oi.findIndex(Et),n=oi.findIndex(Vt);return{floor:e>=0?e+1:0,cap:n>=0?n:oi.length}},ii=Nt,li=rr.stripCopy,si=n=>e(n,li),di=ne(),ai=We({data:zt.data,config:ii,readOnly:Boolean(yt),clipboard:di,strip:li?e=>li(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==Cn||e.slot!==On)return{min:0,max:n-1};const{floor:t,cap:o}=ri();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&Uo(V);const t=void 0===n||"node"===n?.kind?n:null;oo.commitDocument(e,t)}}),ci=ae(),[pi,ui]=jn(null),hi=e=>{const n=oi.find(n=>String(n.props.id)===e),t=Pt.shared;n&&t&&ai.swap(e,t.detach(n))},fi=e=>{const n=Nn(zt.data,Nt,e);if(!n)return!1;const t=Bn(n.place),o=n.node,r=t===we?vi(o):ji(o),i=t===we?Pt.shared?.usedOn(o):null;return!!ai.remove(e)&&(Lr(i?Ht.shared.removed({count:Math.max(0,i.length-1)}):Ht.deleted({name:r}),"success",{duration:8e3,action:{label:Ht.bar.undo,onClick:()=>{ai.restore(n.node,n.place)}}}),!0)},mi={...ai,remove:fi},gi=e=>ur(e,"block",Nt.components[e]?.label??e),yi=An(e=>Nt.components[e]?.defaultProps??{},[Nt]),ki=e=>ur(e,"section",gi(e)),vi=e=>ke({type:e.type,props:e.props??{}},ki(e.type),mr),{nodeAddresses:Si,zoneItems:bi}=Mn(()=>{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>=ze)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of Ce(Nt,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(oi,we,0),{nodeAddresses:e,zoneItems:n}},[oi,Nt]),wi=An(e=>bi.get(e)??[],[bi]),xi=e=>{const n=Si.get(e);return n?wi(n.zone)[n.index]:void 0},zi=e=>ee(rr,Nt,e),Ci=e=>{if(!rr.slotsOf||e===we)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=xi(e.slice(0,n));if(!t)return null;const o=zi(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}},Oi=(()=>{if(!Y(Wo))return null;const e=`${Wo.nodeId}:${Wo.slot}`;return Ci(e)?.slot.panel===Wo.kind?e:null})(),Bi=$n(null);Tn(()=>{const e=Bi.current;if(Bi.current=null,!Oi||!Y(Wo))return;const n=Wo.nodeId;Qo(n,{scroll:e!==Oi}),Cr(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[Wo]);const Ii=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=Si.get(e);n&&(n.zone===we?Yi(n.index):Sl(n.zone,n.index,e,xi(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&Oi!==i&&(Bi.current=i),er(null,r),lo||Ct({type:"setUi",ui:{rightSideBarVisible:!0}}),l(o)},Ni=(e,n,t)=>{const o=`${e}:${n}`;if(Cr(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;Oi!==o&&(Bi.current=o);er(null,{kind:t,nodeId:e,slot:n})},Pi=(e,n,t)=>{if(yt||!rr.moveSlot)return;const o=xi(e),r=o?zi(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:ut,index:n},s=mn(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=rr.moveSlot(e,n,s);"string"==typeof d&&Ni(e,d,i.panel)},$i=fr(),Mi=Mn(()=>{const e=/* @__PURE__ */new Map;for(const n of $i??[])e.set(n.slug,n.name);return e},[$i]),ji=e=>ve(e,gi,pr.plainText,e=>Mi.get(e),pr.rowName),Ti=(e,n)=>{const t=Nt.components[e.type]?.fields,o=n===we||Xl(n)?"section":"block",r=n===we&&(Et(e)||Vt(e)||Tt(e.type)),i="block"===o?Se(t):r?null:be(t);return pr.renamePropOf?pr.renamePropOf(e,o,i):i},Ai=(e,n,t,o)=>{if(!(!yt&&vr?.zone===e&&vr.index===n))return;const r=(t,o)=>{Sr(null),o&&((e,n,t)=>{const o=wi(e)[n];if(!o)return;const r=Ti(o,e);r&&oo.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
14
+ return tt("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":Ht.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)},Li=t(J(),Jt),Ri=Li.scope({target:wn,siteId:Dn,docId:xn}),Ei=Nt,Vi=(e,n)=>n===we?ki(e):gi(e),Fi=(e,n,t)=>{const o=Li.plan(Ri,t,Vi(t.type,e),Ei);o&&(o.changed&&oo.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Lr(o.message))},Di=te({nodesIn:wi,nodeAt:(e,n)=>wi(e)[n]??null,labelOf:(e,n)=>n===we?ki(e):gi(e),renamePropOf:Ti,beginRename:(e,n)=>Sr({zone:e,index:n}),history:{hasPast:Ot.hasPast,hasFuture:Ot.hasFuture,back:()=>Ot.back(),forward:()=>Ot.forward()},openPageSettings:()=>{oo.select(null),Uo(V)},pageSettingsLabel:Ht.pageSettings,words:{menu:Yt,styleClipboard:Jt,screen:Ht.menu},readOnly:Boolean(yt),collapseAll:()=>Cr(new Set(wi(we).map(e=>String(e.props.id)))),onPasteRefused:e=>Lr(e?Ht.pasteRefused({name:e.label}):Ht.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>Kl(e,n),menuRows:(e,n,t)=>{const o=tr.menuRows?.(e,n,t)??null,r=((e,n)=>{const t=Pt.shared;if(!t||n!==we)return null;const o=t.usedOn(e);if(o){const n={pick:[{label:Ht.shared.onPages({count:o.length}),onClick:()=>{},children:o.map(e=>({label:e.title,onClick:()=>t.openPage(e)}))}]};return yt||ir(e.type,e)?n:{...n,change:[{label:Ht.shared.detach,onClick:()=>hi(e.props.id)}],remove:[{label:Ht.shared.removeFromPage,danger:!0,onClick:()=>{fi(e.props.id)}}]}}return yt||Et(e)||Vt(e)||Tt(e.type)?null:z(ci)?{change:[{label:Ht.shared.makeShared,onClick:()=>ui({id:e.props.id,name:vi(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=>ir(e.type,e),duplicateBlocked:e=>lr(zt.data,e),permits:e=>{const n=xe(Nt,e.type);return Pt.shared?.usedOn(e)?{...n,delete:!1}:n},nodeOps:mi,isPinned:(e,n)=>n===we&&(Et(e)||Vt(e)),sectionBand:ri,locate:e=>Si.get(e)??null,rowNameOf:(e,n)=>n===we?vi(e):ji(e),selectAt:(e,n,t,o)=>{e===we?Yi(n):Sl(e,n,t,o??"")},slotRung:e=>{const n=Ci(e);return n?.slot.panel?{label:n.slot.label,select:()=>Ii(n.node,n.slot,!1)}:null},style:{held:()=>me(Ri),canCopy:e=>Li.rows(Ei,e).some(e=>!1!==e.counted),copy:(e,n)=>Li.copy(Ri,e,Vi(e.type,n),Ei),paste:(e,n,t)=>Fi(e,n,t)},keys:St?{target:Po,selected:()=>{const e=zt.ui.itemSelector;return e?{zone:e.zone??we,index:e.index}:null},held:()=>di.get(),readOnly:Boolean(yt),onDone:({done:e,name:n})=>{"copied"===e&&Lr(Ht.copied({name:n}))}}:void 0},Io),Hi=$n({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});Tn(()=>{Hi.current={copy:(e,n)=>Li.copy(Ri,e,Vi(e.type,n),Ei),paste:Fi,at:()=>{const e=zt.ui.itemSelector;if(!e)return null;const n=e.zone??we,t=wi(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(yt)}});const Wi=An(e=>{const n=ge(e);if(!n)return;const t=Hi.current,o=t.at();o&&(e.preventDefault(),"copy"===n?t.copy(o.node,o.zone):t.readOnly||t.paste(o.zone,o.index,o.node))},[]);Tn(()=>{if(!Po)return;const e=e=>Wi(e);return Po.addEventListener("keydown",e),()=>Po.removeEventListener("keydown",e)},[Wi,Po]),Sn(Io,"keydown",Wi);const Ui=oi.map(e=>e.props.id).join("|");Tn(()=>{const e=Io?.document??null,n=Io?.window??null;let t=0;const o=[],r=()=>{if(!e)return void Ho(e=>e.length?[]:e);const n=oi.findIndex(Vt),t=n>=0?n:oi.length,o=n=>{const t=oi[n]?.props?.id;return null==t?null:e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(kn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=oi.length>0&&!Et(oi[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=pt(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})}Ho(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()}},[Io,Ui,ho,Xr,io,lo,Bt?.props.id]);const Gi=Io?.document??null,Xi=Io?.window??null;Tn(()=>{const e=Oo.current;if(!e||!Gi||!Xi)return;const n=[],t=()=>{const n=Gi.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&Xi.scrollTo({left:Xi.scrollX,top:Xi.scrollY+t,behavior:"instant"}),!0};return Oo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[Gi,Xi]);const Yi=e=>{Uo(V),oo.select({index:e}),tr.sectionPressed?.(oi[e]);const n=oi[e]?.props?.id;n&&l(n)},Ji=e=>{const{floor:n,cap:t}=ri(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=Bt&&Wo.kind!==Rt?.kind?oi.findIndex(e=>e.props.id===Bt.props.id):-1;return o(r>=0?r+1:t)},Ki=(e,n)=>{const{floor:t,cap:o}=ri(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(oo.reorderComponent(we,e,i),oo.select({index:i}),{moved:!0,dest:i})},Qi=(e,n,t,o)=>{Uo(V),oo.select(o?{index:o.index,zone:o.zone}:{index:e}),l(n),Lr(Ht.sectionAdded({name:t}))},Zi=(e,n)=>{const t=Ji(n),o=dr(e,{nodeDefaults:yi,newNodeId:Ne,sectionLabel:ki,blockIsOffered:cr}),r=o?oo.insertNode(we,t,o):oo.insertSection(e,t);return Qi(t,r,ki(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 Ce(Nt,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=ar(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},qi=e=>_i(we,e),_i=(e,n)=>{Tr.current=document.activeElement??null,yo&&(Ro.current=Eo.current,Eo.current=!1,ko()),Fo(null===n?null:{zone:e,index:n}),Lo(!0),io||(Ro.current=!0,Ct({type:"setUi",ui:{leftSideBarVisible:!0}}))},el=()=>{Lo(!1),Fo(null),Ro.current&&Ct({type:"setUi",ui:{leftSideBarVisible:!1}}),Ro.current=!1},nl=(e,n)=>pr.rowName?n?Et(e)?pr.rowName(e,"section",Ht.header):Vt(e)?pr.rowName(e,"section",Ht.footer):Tt(e.type)?pr.rowName(e,"section",gi(e.type)):vi(e):ji(e):n?ki(e.type):gi(e.type),tl=e=>n=>{e()},ol=(e,n,t)=>{if(yt)return null;const o=wi(e)[n];return o&&!xe(Nt,o.type).delete||o&&ir(o.type,o)?null:/* @__PURE__ */tt(Ee,{kind:"delete",label:e===we&&o&&Pt.shared?.usedOn(o)?Ht.shared.removeFromPage:Ht.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=wi(e)[n]?.props?.id;null!=t&&fi(String(t))})(e,n),children:/* @__PURE__ */tt(Zn,{size:15})})},rl=e=>pr.rowPreview?.(e)||void 0,il=e=>pr.rowMarks?.(e)??void 0,ll=(e,n,t)=>pr.rowActions?.(e,n,t)??null,sl=(e,n,t,o)=>{if(yt)return null;if(ir(t.type,t))return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
15
+ return tt(Ee,{kind:"eye",label:r?Ht.showNamed({name:o}):Ht.hideNamed({name:o}),onClick:()=>al(e,n,t),children:/* @__PURE__ */tt(r?qn:_n,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},dl=e=>Is(we,e),al=(e,n,t)=>{oo.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},cl=e=>Oe(Nt,e),pl=e=>Ce(Nt,e),ul=e=>rr.slotsOf?zi(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:Be(e,n.slot)})):[{slot:null,rung:null,kids:pl(e)}],hl=e=>rr.slotsOf?ul(e).flatMap(e=>e.kids):pl(e),fl=e=>Boolean(rr.slotsOf)&&zi(e).some(e=>e.rung),ml=(e,n,t)=>null===t?void 0===n?ar(e):ar(e,n):ar(e,n,t),gl=(e,n,t)=>{const o=Ie(Nt,e.type,n)&&(t||hl(e).length>0||fl(e));return{collapsible:o,folded:o&&$r(String(e.props.id))}},yl=(e,n,t)=>ul(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>gl(e,r,t(e.type)).collapsible?[String(e.props.id),...yl(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),kl=e=>hl(e).length>0||fl(e)||Boolean(ar(e.type)),vl=e=>Boolean(ar(e)),Sl=(e,n,t,o)=>{if(Uo(V),ar(o)?.spec?.slider){const t=e.split(":")[0];s(t,n),oo.select({index:n,zone:e}),l(t)}else oo.select({index:n,zone:e}),l(t)},bl=(e,n,t,o,r)=>{const i=`${e}:${n}`;oo.insertComponent(i,t,o),ar(r)?.spec?.slider?requestAnimationFrame(()=>{s(e,o),oo.select({index:o,zone:i})}):oo.select({index:o,zone:i})},wl=$n(/* @__PURE__ */new Set);Tn(()=>{oi.forEach(e=>{const n=ar(e.type)?.spec;if(!n)return;const t=e.props.id;if(wl.current.has(t))return;wl.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(yi)).forEach((e,t)=>eo.seedChild(o,t,n.childType,e))})},[oi,eo,yi]);const xl=$n(/* @__PURE__ */new Set);Tn(()=>{oi.forEach((e,t)=>{const o=e.props.id;if(xl.current.has(o))return;const r=n(e,cl(e.type));xl.current.add(o),r&&eo.replaceComponent(we,t,{...e,props:r})})},[oi,eo]),K(eo,Nt);const zl=oi.findIndex(Vt),Cl=zl>=0?oi[zl]:null,Ol=Ft?oi.findIndex(Et):-1,Bl=Ol>=0?oi[Ol]:null,Il=Pt.groupTab,Nl=Mn(()=>Il?e=>Tt(e.type):void 0,[Il]),Pl=Boolean(Pt.groupBadge),$l=Pt.sharedReach,Ml=e=>$l?.(e)??void 0,jl=Mn(()=>$l?new Set(oi.filter(e=>Ml(e)).map(e=>String(e.props.id))):null,[oi,$l]),Tl=Mn(()=>jl?e=>jl.has(e):void 0,[jl]),Al=Pt.first?$l?.({type:Pt.first,props:{id:""}})??void 0:void 0,Ll=Pt.groupBadge?/* @__PURE__ */tt("span",{className:"es-tree-group-badge",children:/* @__PURE__ */tt(Vn,{tone:"info",size:"xs",children:Pt.groupBadge})}):void 0,Rl=oi.find(e=>e.type===Mt)??null,El=oi.find(e=>e.type===jt)??null,Vl=zl>=0?zl:oi.length,Fl=[];oi.forEach(e=>{Vt(e)||(kl(e)&&Fl.push(String(e.props.id)),Fl.push(...yl(e,1,vl)))}),Cl&&(Fl.push(String(Cl.props.id)),Fl.push(...yl(Cl,1,vl)));const Dl=Fl.length>0&&Fl.every(e=>zr.has(e)),Hl=e=>{const n=pr.blockRowName(e,gi);return pr.rowName?pr.rowName(e,"block",n):n},Wl=(e,n,t,o)=>{const r=wi(e)[t];if(!r)return;const i={...In(e),index:t},l={...In(n),index:Math.min(Math.max(o,0),wi(n).length)},s=mn(i,l);if(e!==n||s!==t)try{ai.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof Pn))throw e}},Ul=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of pl(e))n.add(r),t(o)};for(const t of cl(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},Gl=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=Si.get(n);if(!e)return null;if(e.zone===we)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},Xl=e=>{const n=e.slice(0,e.indexOf(":")),t=oi.find(e=>Tt(e.type)&&String(e.props.id)===n);return t&&At(n)===e?t:null},Yl=(e,n)=>{const t=Xl(e);return!t||(!Pt.groupAccepts||Pt.groupAccepts(t.type,n,wi(e).length))},Jl=(e,n,t)=>{if(e.rung){const t=xi(e.rung.nodeId),o=t?zi(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===ut&&n.index>=0&&n.index<=o}if(n.slot===ut)return!1;if(e.add)return ql(e.add,n);const o=Bn(n);if(Tt(e.type))return!1;const r=Xl(o),i=Xl(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!Yl(o,e.type))&&(n.index>=0&&n.index<=wi(o).length));if(e.zone===we||o===we){if(e.zone!==o)return!1;const{floor:t,cap:r}=ri();return n.index>=t&&n.index<=r}if(n.index<0||n.index>wi(o).length)return!1;if(e.zone===o)return!0;const l=Cl&&!Pt.lastIsOpen?String(Cl.props.id):null;return(!l||Gl(e.zone)!==l&&Gl(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??wi(e)[t];if(!r)return!1;const i=n.split(":")[0],l=Si.get(i),s=l?wi(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&Ul(r).has(n))return!1;const d=ar(s.type,sr(zt?.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?.(wi(n),r))})(e.zone,o,e.index,t)},Kl=(e,n)=>{const t=Bn(e.from),o=e.node;return t===Bn(n)?Yl(t,o.type):Jl({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},Ql=e=>{const n=e.slice(0,e.indexOf(":")),t=Si.get(n),o=t?wi(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=ar(o.type,sr(zt?.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:gi(r.spec.childType)}]:[])),l=Ci(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:nl(o,t.zone===we)}},Zl=(e,n)=>{if("section"!==e.kind)return e;const t=Bn(n);return t===we||Xl(t)?e:Ql(t)?.choices.some(n=>n.type===e.type)?{kind:"block",type:e.type}:e},ql=(e,n)=>{const t=Zl(e,n),o=Bn(n);if("shared"===t.kind){if(o!==we||!Pt.shared?.nodeOf(t.section))return!1;const{floor:e,cap:r}=ri();return n.index>=e&&n.index<=r}if("block"!==t.kind){if(Xl(o)){const e="section"===t.kind?t.type:t.template.node.type;return Yl(o,e)&&n.index>=0&&n.index<=wi(o).length}if(o!==we)return!1;const{floor:e,cap:r}=ri();return n.index>=e&&n.index<=r}if(o===we)return!1;const r=Ql(o);return!(!r||!r.choices.some(e=>e.type===t.type))&&!r.target.spec?.addBlocked?.(wi(o))},_l=(e,n)=>{const t=Zl(e,n);if("block"!==t.kind&&Xl(Bn(n)))return void((e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&Yl(n,o)){if("section"===e.kind)oo.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;oo.insertNode(n,t,si(e.template.node))}Uo(V),oo.select({index:t,zone:n})}})(t,Bn(n),n.index);if("section"===t.kind)return void Zi(t.type,n.index);if("template"===t.kind)return void((e,n,t)=>{const o=Ji(t),r=oo.insertNode(we,o,n);Qi(o,r,e)})(t.template.name,si(t.template.node),n.index);if("shared"===t.kind){const e=Pt.shared?.nodeOf(t.section);if(!e)return;const o=Ji(n.index);return void(ai.restore(e,{parentId:Cn,slot:On,index:o})&&Qi(o,e.props.id,t.section.title))}const o=Bn(n),r=Ql(o);r&&(r.target.spec?bl(r.parentId,r.target.slot,t.type,n.index,r.parent.type):((e,n,t)=>{oo.insertComponent(e,n,t),Uo(V),oo.select({index:t,zone:e})})(o,t.type,n.index))},es=(e,n)=>{e.rung?Pi(e.rung.nodeId,e.index,n.index):e.add?_l(e.add,n):e.zone===we?Ki(e.index,n.index):Wl(e.zone,Bn(n),e.index,n.index)},[ns]=jn(()=>hn()),ts=fn({keyOf:e=>e.id,readOnly:Boolean(yt),session:ns,canDrop:Jl,onDrop:es,onStep:(e,n)=>{e.rung?Pi(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===we?((e,n)=>{const t=ki(oi[e]?.type??""),o=Ki(e,n<0?e-1:e+2);if(!o.moved)return void Lr(n<0?Ht.sectionFirst({name:t}):Ht.sectionLast({name:t}));const{floor:r,cap:i}=ri();Lr(Ht.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):Wl(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),os=An(e=>{const{floor:n,cap:t}=ri(),o=[];for(const r of e.nodes){const e=Bn(r.place),i=wi(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(Et(i)||Vt(i)||ir(i.type,i))continue;if(Tt(i.type))continue;const l=Boolean(Xl(e)),s=e===we||l;e===we&&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?ki(i.type):ji(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=Bn(e.list);if(n===we&&0===e.children.length)return[{...e,addLabel:Ht.addSection,addAlways:!0}];const t=Ql(n),o=t?.target.spec?.addLabel;return e.children.length>0||Boolean(t?.choices.length)||Boolean(Xl(n))?[o?{...e,addLabel:o}:e]:[]}),i=r.flatMap(e=>{const n=Bn(e.list),t=n===we||Xl(n)?null:Ql(n);return t?.choices.length?an(e,t.target.spec?.addLabel??Ht.addBlockHere):[]});return{sources:o,zones:r,seams:i}},[zt.data]),rs=null==Bt?.props.id?null:String(Bt.props.id),is=An(e=>{const n=Nt,t=e=>!e.item.rung&&null!==Nn(zt.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(rs);return i||(r(Ue(zt.data,n,o.item.id,rs,Nl))??o)},[zt.data,Nt,rs,Nl]),[ls,ss]=jn(null),ds=Boolean(Il||$l);Sn(Io,"mouseover",e=>{if(!ds)return;const n=bn(e.target),t=n?st(zt.data,Nt,n):null;t!==ls&&ss(t)}),Sn(Io,"mouseout",e=>{ds&&!e.relatedTarget&&ss(null)});const as=e=>Et(e)||Vt(e)||Tt(e.type),cs=e=>{const n=Tt(e.type)?gi(e.type):Et(e)?Ht.header:Vt(e)?Ht.footer:null;return null===n?vi(e):pr.rowName?pr.rowName(e,"section",n):n},ps=[];if(ds){const e=rs?st(zt.data,Nt,rs):null;for(const n of/* @__PURE__ */new Set([e,ls])){const e=n?oi.find(e=>String(e.props.id)===n):void 0;if(!e)continue;const t=Et(e)||e.type===Mt,o=Ml(e);if(o){ps.push({id:String(e.props.id),label:cs(e),below:t,reach:o});continue}if(!Il||!as(e))continue;const r=Il(e);r&&ps.push({id:String(e.props.id),label:r,below:t})}}const us=ae(),hs=$n(null);Tn(()=>{const e=Pt.changeNotice;if(!e)return;const n=JSON.stringify(oi.filter(as)),t=hs.current;if(hs.current={doc:xn,bands:n,index:Ot.index},!t||t.doc!==xn||t.bands===n)return;Ot.hasPast&&Ot.index>=t.index&&!lt.has(us)&&(lt.add(us),Lr(e,"success",{action:{label:Ht.bar.undo,onClick:()=>Ot.back()},duration:8e3}))},[oi]);const fs=e=>{Uo(V),oo.select(e.zone===we?{index:e.index}:{index:e.index,zone:e.zone})},ms=Q(),gs=()=>({data:zt.data,device:ho,ops:oo,inspector:nr}),ys=ms?.model,ks=Mn(()=>ys?e=>ys(e,os(e),gs()):os,[ys,os,ho]),vs=ms?.measure,Ss=vs?(e,n)=>vs(e,n,gs()):void 0,bs=ms?.canDrop,ws=bs?(e,n)=>bs(e,n,Jl,gs()):Jl,xs=ms?.drop,zs=xs?(e,n)=>xs(e,n,es,gs()):es,Cs=ms?.pick,Os=Cs?e=>Cs(e,fs,gs()):fs,Bs=e=>{const n=Bn(e),t=Ci(n);t&&Ii(t.node,t.slot,!1),_i(n,e.index)},Is=(e,n)=>/* @__PURE__ */tt(Ve,{...yt?{}:ts.seam({place:{...In(e),index:n}})},`seam:${e}:${n}`),Ns={rowClick:tl,isCollapsed:$r,toggleCollapse:Mr},Ps=e=>{const n=String(e.props.id),t=oi.findIndex(e=>String(e.props.id)===n),o=At(n),r=wi(o),i=$r(n),l=gi(e.type),s=pr.rowName?pr.rowName(e,"section",l):l,d=e=>Is(o,e);/* @__PURE__ */
16
16
  return ot(rt,{children:[
17
- /* @__PURE__ */tt(Te,{words:Wt,icon:/* @__PURE__ */tt(hr,{type:e.type,size:13}),name:s,preview:rl(e),marks:il(e),onSelect:()=>Xi(t),nameSlot:Ai(we,t,n,s),selected:Yo===n,badge:Ml(e)?void 0:Ll,shared:Ml(e),actions:ll(e,we,t)??void 0,rowProps:{"data-node-id":n,onClick:tl(()=>Xi(t))},fold:{open:!i,label:"section",onToggle:()=>Mr(n)}}),!i&&/* @__PURE__ */ot(Ae,{children:[r.map((n,t)=>{const r=String(n.props.id),i=vi(n),l=kl(n),s=l&&$r(r),a=()=>Sl(o,t,r,e.type),{rowProps:c,...p}=ts.row({item:{id:r,zone:o,index:t,type:n.type},place:{...In(o),index:t}},{"data-node-id":r,onClick:tl(a)});/* @__PURE__ */
17
+ /* @__PURE__ */tt(Te,{words:Wt,icon:/* @__PURE__ */tt(hr,{type:e.type,size:13}),name:s,preview:rl(e),marks:il(e),onSelect:()=>Yi(t),nameSlot:Ai(we,t,n,s),selected:Xo===n,badge:Ml(e)?void 0:Ll,shared:Ml(e),actions:ll(e,we,t)??void 0,rowProps:{"data-node-id":n,onClick:tl(()=>Yi(t))},fold:{open:!i,label:"section",onToggle:()=>Mr(n)}}),!i&&/* @__PURE__ */ot(Ae,{children:[r.map((n,t)=>{const r=String(n.props.id),i=vi(n),l=kl(n),s=l&&$r(r),a=()=>Sl(o,t,r,e.type),{rowProps:c,...p}=ts.row({item:{id:r,zone:o,index:t,type:n.type},place:{...In(o),index:t}},{"data-node-id":r,onClick:tl(a)});/* @__PURE__ */
18
18
  return ot(Rn,{children:[d(t),
19
- /* @__PURE__ */tt(Te,{words:Wt,icon:/* @__PURE__ */tt(hr,{type:n.type,size:13}),name:i,preview:rl(n),marks:il(n),onSelect:a,nameSlot:Ai(o,t,r,i),selected:Yo===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Mr(r)}:void 0,actions:/* @__PURE__ */ot(rt,{children:[ol(o,t,i),ll(n,o,t),sl(o,t,n,i)]}),rowProps:c}),l&&!s&&/* @__PURE__ */tt(Ae,{children:js(n,2)})]},r)}),d(r.length)]})]})},$s=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=ts.dragging,d=!$r(l)&&s?.rung?.nodeId!==i,a={...In(l),index:0},c=s&&!s.rung&&Jl(s,a)?a:void 0,p=()=>Ii(e,n,!0),{rowProps:u,...h}=ts.row({item:{id:`rung:${l}`,zone:`${i}:${ut}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:ut,index:t},into:c,canDrag:Boolean(rr.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:tl(p)}),f=yt?null:rr.slotActions?.(e,n.slot);/* @__PURE__ */
19
+ /* @__PURE__ */tt(Te,{words:Wt,icon:/* @__PURE__ */tt(hr,{type:n.type,size:13}),name:i,preview:rl(n),marks:il(n),onSelect:a,nameSlot:Ai(o,t,r,i),selected:Xo===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Mr(r)}:void 0,actions:/* @__PURE__ */ot(rt,{children:[ol(o,t,i),ll(n,o,t),sl(o,t,n,i)]}),rowProps:c}),l&&!s&&/* @__PURE__ */tt(Ae,{children:js(n,2)})]},r)}),d(r.length)]})]})},$s=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=ts.dragging,d=!$r(l)&&s?.rung?.nodeId!==i,a={...In(l),index:0},c=s&&!s.rung&&Jl(s,a)?a:void 0,p=()=>Ii(e,n,!0),{rowProps:u,...h}=ts.row({item:{id:`rung:${l}`,zone:`${i}:${ut}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:ut,index:t},into:c,canDrag:Boolean(rr.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:tl(p)}),f=yt?null:rr.slotActions?.(e,n.slot);/* @__PURE__ */
20
20
  return ot(Rn,{children:[n.heading,
21
21
  /* @__PURE__ */tt(Te,{words:Wt,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:Oi===l,...h,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Mr(l)},actions:f&&f.length>0?/* @__PURE__ */tt(rt,{children:f.map((t,o)=>/* @__PURE__ */tt(Ee,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(yt||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Ni(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__ */tt(Zn,{size:15}):/* @__PURE__ */tt(nt,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */tt(Ae,{children:r})]},l)},Ms=(e,n)=>{const t=ul(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
22
- return tt(rt,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=ml(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)=>Is(e,n),p=/* @__PURE__ */ot(rt,{children:[i.map(({child:n,zone:t,index:o})=>{const r=Yo===String(n.props.id),{collapsible:i,folded:s}=gl(n,l,vl(n.type)),d=String(n.props.id),a=Dl(n),p=()=>Sl(t,o,d,e.type),{rowProps:u,...h}=ts.row({item:{id:d,zone:t,index:o,type:n.type},place:{...In(t),index:o}},{"data-node-id":d,onClick:tl(p)});/* @__PURE__ */
22
+ return tt(rt,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=ml(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)=>Is(e,n),p=/* @__PURE__ */ot(rt,{children:[i.map(({child:n,zone:t,index:o})=>{const r=Xo===String(n.props.id),{collapsible:i,folded:s}=gl(n,l,vl(n.type)),d=String(n.props.id),a=Hl(n),p=()=>Sl(t,o,d,e.type),{rowProps:u,...h}=ts.row({item:{id:d,zone:t,index:o,type:n.type},place:{...In(t),index:o}},{"data-node-id":d,onClick:tl(p)});/* @__PURE__ */
23
23
  return ot(Rn,{children:[0===o&&c(t,0),
24
24
  /* @__PURE__ */tt(Te,{words:Wt,icon:/* @__PURE__ */tt(hr,{type:n.type,size:13}),name:a,preview:rl(n),marks:il(n),onSelect:p,nameSlot:Ai(t,o,d,a),selected:r,hidden:Boolean(n.props._hidden),...h,fold:i?{open:!s,label:"group",onToggle:()=>Mr(d)}:void 0,actions:/* @__PURE__ */ot(rt,{children:[ol(t,o,a),ll(n,t,o),sl(t,o,n,a)]}),rowProps:u}),i&&!s&&/* @__PURE__ */tt(Ae,{children:Ms(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?$s(e,t.rung,r++,o,p):/* @__PURE__ */tt(Rn,{children:p},t.slot??"")})})},js=(e,n)=>{const t=sr(zt?.data,e.type,String(e.props.id)),o=ul(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
25
- return tt(rt,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=ml(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)=>Is(e,n),g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(a&&!a.fixed&&(null===g||g===h)),k=/* @__PURE__ */ot(rt,{children:[l.map(({child:n,zone:t,index:o})=>{const r=Yo===String(n.props.id),i=ji(n),l=String(n.props.id),{collapsible:d,folded:a}=gl(n,s,vl(n.type)),c=cl(n.type),p=1===c.length?`${l}:${c[0]}`:null,u=p?{...In(p),index:wi(p).length}:void 0,h=ts.dragging,f=u&&h&&Jl(h,u)?u:void 0,g=()=>Sl(t,o,l,e.type),{rowProps:y,...k}=ts.row({item:{id:l,zone:t,index:o,type:n.type},place:{...In(t),index:o},into:f,canDrag:!ir(n.type)},{"data-node-id":l,onClick:tl(g)});/* @__PURE__ */
25
+ return tt(rt,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=ml(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)=>Is(e,n),g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(a&&!a.fixed&&(null===g||g===h)),k=/* @__PURE__ */ot(rt,{children:[l.map(({child:n,zone:t,index:o})=>{const r=Xo===String(n.props.id),i=ji(n),l=String(n.props.id),{collapsible:d,folded:a}=gl(n,s,vl(n.type)),c=cl(n.type),p=1===c.length?`${l}:${c[0]}`:null,u=p?{...In(p),index:wi(p).length}:void 0,h=ts.dragging,f=u&&h&&Jl(h,u)?u:void 0,g=()=>Sl(t,o,l,e.type),{rowProps:y,...k}=ts.row({item:{id:l,zone:t,index:o,type:n.type},place:{...In(t),index:o},into:f,canDrag:!ir(n.type,n)},{"data-node-id":l,onClick:tl(g)});/* @__PURE__ */
26
26
  return ot(Rn,{children:[0===o&&m(t,0),
27
- /* @__PURE__ */tt(Te,{words:Wt,icon:/* @__PURE__ */tt(hr,{type:n.type,size:13}),name:i,preview:rl(n),marks:il(n),onSelect:g,nameSlot:Ai(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...k,fold:d?{open:!a,label:"group",onToggle:()=>Mr(l)}:void 0,actions:ir(n.type)?ll(n,t,o)??void 0:/* @__PURE__ */ot(rt,{children:[ol(t,o,i),ll(n,t,o),sl(t,o,n,i)]}),rowProps:y}),d&&!a&&/* @__PURE__ */tt(Ae,{children:js(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&a&&
28
- /* @__PURE__ */tt(w,{small:!0,label:a.addLabel,blocked:a.addBlocked?.(c)??null,onAdd:()=>bl(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?$s(e,o.rung,i++,r,k):/* @__PURE__ */tt(Rn,{children:k},o.slot??"")})})},Ts=Ao||null!==yo,As=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:io&&!Ts&&or===e.id,onSelect:()=>_r(e.id)}:e,Ls=[...(tr.railLead??[]).map(As),{id:"sections",label:Dt.layers,icon:/* @__PURE__ */tt(ue,{}),active:io&&!Ts&&"sections"===or,onSelect:()=>_r("sections")},...(tr.railTrail??[]).map(As)];go?Ls.push({id:"media",label:Dt.railMedia,icon:/* @__PURE__ */tt(he,{}),active:io&&!Ao&&(null!==yo||"media"===or),onSelect:()=>_r("media")}):bt&&Ls.push({id:"media",label:Dt.railMedia,icon:/* @__PURE__ */tt(he,{}),onSelect:ei});const Rs=[...tr.railLead??[],...tr.railTrail??[]].find(e=>"panel"in e&&e.id===or),Es=Boolean(Ht?.foldable),Fs=Ht?.label??(wt?Dt.pageSections:Dt.templateSections),Vs=Es&&$r(ht),Hs=/* @__PURE__ */ot(rt,{children:[oi.map((e,n)=>{if(Et(e)||Ft(e)||Tt(e.type))return null;const t=Yo===String(e.props.id),o=Boolean(e.props._hidden);pl(e);const r=String(e.props.id),i=tr.hasOwnRows?.(e)??!1,l=kl(e)||i,s=l&&$r(r),d=cl(e.type),a=1===d.length?`${r}:${d[0]}`:null,c=a?{...In(a),index:wi(a).length}:void 0,p=ts.dragging,u=c&&p&&Jl(p,c)?c:void 0,{rowProps:h,...f}=ts.row({item:{id:r,zone:we,index:n,type:e.type},place:{...In(we),index:n},into:u},{"data-node-id":r,onClick:tl(()=>Xi(n))});/* @__PURE__ */
27
+ /* @__PURE__ */tt(Te,{words:Wt,icon:/* @__PURE__ */tt(hr,{type:n.type,size:13}),name:i,preview:rl(n),marks:il(n),onSelect:g,nameSlot:Ai(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...k,fold:d?{open:!a,label:"group",onToggle:()=>Mr(l)}:void 0,actions:ir(n.type,n)?ll(n,t,o)??void 0:/* @__PURE__ */ot(rt,{children:[ol(t,o,i),ll(n,t,o),sl(t,o,n,i)]}),rowProps:y}),d&&!a&&/* @__PURE__ */tt(Ae,{children:js(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&a&&
28
+ /* @__PURE__ */tt(w,{small:!0,label:a.addLabel,blocked:a.addBlocked?.(c)??null,onAdd:()=>bl(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?$s(e,o.rung,i++,r,k):/* @__PURE__ */tt(Rn,{children:k},o.slot??"")})})},Ts=Ao||null!==yo,As=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:io&&!Ts&&or===e.id,onSelect:()=>_r(e.id)}:e,Ls=[...(tr.railLead??[]).map(As),{id:"sections",label:Ht.layers,icon:/* @__PURE__ */tt(ue,{}),active:io&&!Ts&&"sections"===or,onSelect:()=>_r("sections")},...(tr.railTrail??[]).map(As)];go?Ls.push({id:"media",label:Ht.railMedia,icon:/* @__PURE__ */tt(he,{}),active:io&&!Ao&&(null!==yo||"media"===or),onSelect:()=>_r("media")}):bt&&Ls.push({id:"media",label:Ht.railMedia,icon:/* @__PURE__ */tt(he,{}),onSelect:ei});const Rs=[...tr.railLead??[],...tr.railTrail??[]].find(e=>"panel"in e&&e.id===or),Es=Boolean(Dt?.foldable),Vs=Dt?.label??(wt?Ht.pageSections:Ht.templateSections),Fs=Es&&$r(ht),Ds=/* @__PURE__ */ot(rt,{children:[oi.map((e,n)=>{if(Et(e)||Vt(e)||Tt(e.type))return null;const t=Xo===String(e.props.id),o=Boolean(e.props._hidden);pl(e);const r=String(e.props.id),i=tr.hasOwnRows?.(e)??!1,l=kl(e)||i,s=l&&$r(r),d=cl(e.type),a=1===d.length?`${r}:${d[0]}`:null,c=a?{...In(a),index:wi(a).length}:void 0,p=ts.dragging,u=c&&p&&Jl(p,c)?c:void 0,{rowProps:h,...f}=ts.row({item:{id:r,zone:we,index:n,type:e.type},place:{...In(we),index:n},into:u,canDrag:!ir(e.type,e)},{"data-node-id":r,onClick:tl(()=>Yi(n))});/* @__PURE__ */
29
29
  return ot(Rn,{children:[n>0&&dl(n),
30
- /* @__PURE__ */tt(Te,{words:Wt,icon:/* @__PURE__ */tt(hr,{type:e.type,size:13}),name:vi(e),preview:rl(e),marks:il(e),shared:Ml(e),onSelect:()=>Xi(n),nameSlot:Ai(we,n,r,vi(e)),selected:t,hidden:o,...f,fold:l?{open:!s,label:"section",onToggle:()=>Mr(r)}:void 0,actions:/* @__PURE__ */ot(rt,{children:[ol(we,n,vi(e)),ll(e,we,n),sl(we,n,e,vi(e))]}),rowProps:h}),kl(e)&&!s&&/* @__PURE__ */ot(Ae,{children:[js(e,1),tr.partRows?.(e,Ns)]}),i&&!s&&/* @__PURE__ */tt(Ae,{children:tr.ownRows?.(e,n,Ns)})]},String(e.props.id??n))}),Fl>0&&dl(Fl)]}),Ds=(e,n,t)=>{const o=String(e.props.id),r=hl(e).length>0||fl(e)||Boolean(ar(e.type)),i=r&&$r(o),l="header"===t?Dt.header:Dt.footer,s=pr.rowName?pr.rowName(e,"section",l):l;/* @__PURE__ */
30
+ /* @__PURE__ */tt(Te,{words:Wt,icon:/* @__PURE__ */tt(hr,{type:e.type,size:13}),name:vi(e),preview:rl(e),marks:il(e),shared:Ml(e),onSelect:()=>Yi(n),nameSlot:Ai(we,n,r,vi(e)),selected:t,hidden:o,...f,fold:l?{open:!s,label:"section",onToggle:()=>Mr(r)}:void 0,actions:/* @__PURE__ */ot(rt,{children:[ol(we,n,vi(e)),ll(e,we,n),sl(we,n,e,vi(e))]}),rowProps:h}),kl(e)&&!s&&/* @__PURE__ */ot(Ae,{children:[js(e,1),tr.partRows?.(e,Ns)]}),i&&!s&&/* @__PURE__ */tt(Ae,{children:tr.ownRows?.(e,n,Ns)})]},String(e.props.id??n))}),Vl>0&&dl(Vl)]}),Hs=(e,n,t)=>{const o=String(e.props.id),r=hl(e).length>0||fl(e)||Boolean(ar(e.type)),i=r&&$r(o),l="header"===t?Ht.header:Ht.footer,s=pr.rowName?pr.rowName(e,"section",l):l;/* @__PURE__ */
31
31
  return ot(rt,{children:[
32
- /* @__PURE__ */tt(Te,{words:Wt,icon:/* @__PURE__ */tt(hr,{type:t,size:13}),name:s,preview:rl(e),marks:il(e),badge:Ml(e)?void 0:Ll,shared:Ml(e),onSelect:()=>Xi(n),nameSlot:Ai(we,n,o,s),selected:Yo===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Mr(o)}:void 0,actions:ll(e,we,n)??void 0,rowProps:{"data-node-id":o,onClick:tl(()=>Xi(n))}}),r&&!i&&/* @__PURE__ */tt(Ae,{children:Ms(e,1)})]})};return(tr.wrap??(e=>e))(
33
- /* @__PURE__ */tt(Z,{target:Io,children:/* @__PURE__ */ot("div",{ref:Bo,className:"sf-editor es-editor",style:nn(Or),onContextMenu:Hi.onEditorContextMenu,...u(yn),children:[
32
+ /* @__PURE__ */tt(Te,{words:Wt,icon:/* @__PURE__ */tt(hr,{type:t,size:13}),name:s,preview:rl(e),marks:il(e),badge:Ml(e)?void 0:Ll,shared:Ml(e),onSelect:()=>Yi(n),nameSlot:Ai(we,n,o,s),selected:Xo===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Mr(o)}:void 0,actions:ll(e,we,n)??void 0,rowProps:{"data-node-id":o,onClick:tl(()=>Yi(n))}}),r&&!i&&/* @__PURE__ */tt(Ae,{children:Ms(e,1)})]})};return(tr.wrap??(e=>e))(
33
+ /* @__PURE__ */tt(Z,{target:Io,children:/* @__PURE__ */ot("div",{ref:Bo,className:"sf-editor es-editor",style:nn(Or),onContextMenu:Di.onEditorContextMenu,...u(yn),children:[
34
34
  /* @__PURE__ */ot(Ge,{children:[
35
- /* @__PURE__ */tt(Ye,{items:Ls,ariaLabel:Dt.bar.views}),
36
- /* @__PURE__ */ot(Xe,{children:[
37
- /* @__PURE__ */tt(Je,{label:Dt.bar.undo,disabled:Boolean(yt)||!Ot.hasPast,onClick:()=>Ot.back(),children:/* @__PURE__ */tt(Xn,{})}),
38
- /* @__PURE__ */tt(Je,{label:Dt.bar.redo,disabled:Boolean(yt)||!Ot.hasFuture,onClick:()=>Ot.forward(),children:/* @__PURE__ */tt(Jn,{})}),
39
- /* @__PURE__ */tt(Qe,{}),
40
- /* @__PURE__ */tt(Ke,{devices:so,value:ho,onChange:fo}),
41
- /* @__PURE__ */tt(Je,{label:Dt.bar.refresh,tip:Dt.bar.refreshTip,onClick:()=>{Oo.current=(()=>{const e=Io?.document;if(!e)return null;const n=oi.findIndex(Ft),t=n>=0?n:oi.length;let o=null;for(let n=0;n<t;n++){const t=oi[n]?.props?.id;if(null==t)continue;const r=e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`);if(!r)continue;const i=r.getBoundingClientRect().top;i<=4&&(null===o||i>o.offset)&&(o={id:String(t),offset:i})}if(!o){const e=Bt?.props?.id??oi[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Co(e=>e+1)},children:/* @__PURE__ */tt(Qn,{})})]}),
42
- /* @__PURE__ */ot(Xe,{kind:"right",style:{minWidth:300},children:[
43
- /* @__PURE__ */tt(v,{input:jo,words:Dt.saveStatus}),tr.barLead?.(),tr.barTrail?.(),tr.mainAction||!tr.barMain?/* @__PURE__ */tt(S,{input:jo,action:tr.mainAction??{label:Dt.done,onPress:()=>{Dn(zt.data)}},readOnly:Boolean(yt),saveSwitch:vt,onToggleAutoSave:Yn,onSaveNow:To,bar:Dt.bar,words:Dt.saveStatus}):tr.barMain()]})]}),
35
+ /* @__PURE__ */tt(Xe,{items:Ls,ariaLabel:Ht.bar.views}),
36
+ /* @__PURE__ */ot(Ye,{children:[
37
+ /* @__PURE__ */tt(Je,{label:Ht.bar.undo,disabled:Boolean(yt)||!Ot.hasPast,onClick:()=>Ot.back(),children:/* @__PURE__ */tt(Yn,{})}),
38
+ /* @__PURE__ */tt(Je,{label:Ht.bar.redo,disabled:Boolean(yt)||!Ot.hasFuture,onClick:()=>Ot.forward(),children:/* @__PURE__ */tt(Jn,{})}),
39
+ /* @__PURE__ */tt(Ke,{}),
40
+ /* @__PURE__ */tt(Qe,{devices:so,value:ho,onChange:fo}),
41
+ /* @__PURE__ */tt(Je,{label:Ht.bar.refresh,tip:Ht.bar.refreshTip,onClick:()=>{Oo.current=(()=>{const e=Io?.document;if(!e)return null;const n=oi.findIndex(Vt),t=n>=0?n:oi.length;let o=null;for(let n=0;n<t;n++){const t=oi[n]?.props?.id;if(null==t)continue;const r=e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`);if(!r)continue;const i=r.getBoundingClientRect().top;i<=4&&(null===o||i>o.offset)&&(o={id:String(t),offset:i})}if(!o){const e=Bt?.props?.id??oi[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),Co(e=>e+1)},children:/* @__PURE__ */tt(Kn,{})})]}),
42
+ /* @__PURE__ */ot(Ye,{kind:"right",style:{minWidth:300},children:[
43
+ /* @__PURE__ */tt(v,{input:jo,words:Ht.saveStatus}),tr.barLead?.(),tr.barTrail?.(),tr.mainAction||!tr.barMain?/* @__PURE__ */tt(S,{input:jo,action:tr.mainAction??{label:Ht.done,onPress:()=>{Hn(zt.data)}},readOnly:Boolean(yt),saveSwitch:vt,onToggleAutoSave:Xn,onSaveNow:To,bar:Ht.bar,words:Ht.saveStatus}):tr.barMain()]})]}),
44
44
  /* @__PURE__ */tt(oe,{}),
45
45
  /* @__PURE__ */ot("div",{className:"sf-body",children:[io?/* @__PURE__ */ot(rt,{children:[
46
- /* @__PURE__ */tt("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":Dt.leftPanel,children:Ao?/* @__PURE__ */tt(x,{at:Fo?{label:(e=>{const n=Yl(e.zone);if(n)return Dt.add.addingTo({name:pr.rowName?nl(n,!0):gi(n.type)});if(e.zone===we){const n=oi[e.index];return n&&!Ft(n)?Dt.add.addingBefore({name:nl(n,!0)}):Dt.add.addingAtEnd}const t=Kl(e.zone);return t?Dt.add.addingTo({name:t.parentName}):Dt.add.addingHere})(Fo),onClear:()=>Vo(null)}:void 0,placeBlocks:Fo&&Fo.zone!==we?Kl(Fo.zone)?.choices:void 0,canTake:Fo?e=>{if(!Fo)return null;const n={...In(Fo.zone),index:Fo.index};if(ql(e,n))return null;if("shared"===e.kind&&Fo.zone===we&&!Pt.shared?.nodeOf(e.section))return Dt.shared.alreadyHere;const t=Yl(Fo.zone);if(t)return Dt.add.notInside({name:nl(t,!0)});if(Fo.zone===we)return Dt.add.onlySections;const o=Kl(Fo.zone);return o?Dt.add.notInside({name:o.parentName}):Dt.add.onlySections}:void 0,onPick:Fo?e=>{if(!Fo)return;const n={...In(Fo.zone),index:Fo.index};ql(e,n)&&(_l(e,n),el())}: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:ns,siteWide:tr.addPanelRow?.(el),onClose:el,onHide:Zr,readOnly:Boolean(yt)}):yo&&mo?
46
+ /* @__PURE__ */tt("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":Ht.leftPanel,children:Ao?/* @__PURE__ */tt(x,{at:Vo?{label:(e=>{const n=Xl(e.zone);if(n)return Ht.add.addingTo({name:pr.rowName?nl(n,!0):gi(n.type)});if(e.zone===we){const n=oi[e.index];return n&&!Vt(n)?Ht.add.addingBefore({name:nl(n,!0)}):Ht.add.addingAtEnd}const t=Ql(e.zone);return t?Ht.add.addingTo({name:t.parentName}):Ht.add.addingHere})(Vo),onClear:()=>Fo(null)}:void 0,placeBlocks:Vo&&Vo.zone!==we?Ql(Vo.zone)?.choices:void 0,canTake:Vo?e=>{if(!Vo)return null;const n={...In(Vo.zone),index:Vo.index};if(ql(e,n))return null;if("shared"===e.kind&&Vo.zone===we&&!Pt.shared?.nodeOf(e.section))return Ht.shared.alreadyHere;const t=Xl(Vo.zone);if(t)return Ht.add.notInside({name:nl(t,!0)});if(Vo.zone===we)return Ht.add.onlySections;const o=Ql(Vo.zone);return o?Ht.add.notInside({name:o.parentName}):Ht.add.onlySections}:void 0,onPick:Vo?e=>{if(!Vo)return;const n={...In(Vo.zone),index:Vo.index};ql(e,n)&&(_l(e,n),el())}: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:ns,siteWide:tr.addPanelRow?.(el),onClose:el,onHide:Zr,readOnly:Boolean(yt)}):yo&&mo?
47
47
  /* @__PURE__ */tt(N,{panel:mo,pick:yo,onHide:Zr}):Rs?Rs.panel({onHide:Zr,notify:Lr}):"media"===or&&mo?/* @__PURE__ */tt(N,{panel:mo,pick:null,onHide:Zr}):/* @__PURE__ */ot(rt,{children:[
48
- /* @__PURE__ */tt(O,{icon:/* @__PURE__ */tt(ue,{}),title:Dt.layers,context:Kt,actions:/* @__PURE__ */ot(rt,{children:[!yt&&/* @__PURE__ */tt(Ze,{label:Dt.add.title,onClick:()=>qi(null),children:/* @__PURE__ */tt(Kn,{size:15})}),
49
- /* @__PURE__ */tt(Ze,{label:Hl?Dt.expandAll:Dt.collapseAll,title:0===Vl.length?Dt.nothingToFold:void 0,disabled:0===Vl.length,onClick:()=>Cr(e=>{const n=new Set(Vl);return Hl?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Vl])}),children:/* @__PURE__ */tt(at,{expand:Hl})})]}),onHide:Zr}),
48
+ /* @__PURE__ */tt(O,{icon:/* @__PURE__ */tt(ue,{}),title:Ht.layers,context:Qt,actions:/* @__PURE__ */ot(rt,{children:[!yt&&/* @__PURE__ */tt(Ze,{label:Ht.add.title,onClick:()=>qi(null),children:/* @__PURE__ */tt(Qn,{size:15})}),
49
+ /* @__PURE__ */tt(Ze,{label:Dl?Ht.expandAll:Ht.collapseAll,title:0===Fl.length?Ht.nothingToFold:void 0,disabled:0===Fl.length,onClick:()=>Cr(e=>{const n=new Set(Fl);return Dl?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Fl])}),children:/* @__PURE__ */tt(at,{expand:Dl})})]}),onHide:Zr}),
50
50
  /* @__PURE__ */ot(Le,{className:"sf-tree sf-scroll",words:Wt,children:[
51
- /* @__PURE__ */tt(Te,{words:Wt,icon:/* @__PURE__ */tt(hr,{type:"page",size:13}),name:Dt.pageSettings,onSelect:ni,selected:!Bt&&Go,rowProps:{onClick:tl(ni)}}),Rl&&/* @__PURE__ */ot(rt,{children:[!Pl&&/* @__PURE__ */tt(Re,{children:Dt.header}),Ps(Rl)]}),xt&&!(Pl&&Rl)&&/* @__PURE__ */ot(rt,{children:[!Pl&&/* @__PURE__ */tt(Re,{children:Dt.header}),!Vt&&/* @__PURE__ */tt(Te,{words:Wt,icon:/* @__PURE__ */tt(hr,{type:"header",size:13}),name:Dt.header,badge:Al?void 0:Ll,shared:Al,onSelect:ti,selected:Wo.kind===Rt?.kind,rowProps:{onClick:tl(ti)}})]}),Bl&&!(Pl&&Rl)&&Ds(Bl,Ol,"header"),!Es&&/* @__PURE__ */tt(Re,{children:Fs}),Es?/* @__PURE__ */ot(rt,{children:[
52
- /* @__PURE__ */tt(Te,{words:Wt,icon:null,name:Fs,fold:{open:!Vs,label:Fs,onToggle:()=>Mr(ht)}}),!Vs&&/* @__PURE__ */tt(Ae,{children:Hs})]}):Hs,xt&&!Pl&&/* @__PURE__ */tt(Re,{children:Dt.footer}),Cl&&!(Pl&&El)&&Ds(Cl,zl,"footer"),El&&Ps(El),tr.treeFoot?.()]})]})}),
53
- /* @__PURE__ */tt(qe,{side:"left",width:Or.left,min:en,max:_e,defaultWidth:m.left,label:Dt.resizeLeftPanel,onResize:Nr})]}):/* @__PURE__ */tt(B,{side:"left",onShow:Zr}),
54
- /* @__PURE__ */ot("div",{ref:Rr,className:"sf-center sf-scroll","data-sf-canvas-head":Dr?"":void 0,style:{overflowX:Jr?"auto":"hidden",overflowY:"hidden"},children:[Dr&&/* @__PURE__ */tt("div",{ref:Wr,className:"sf-canvas-head",children:/* @__PURE__ */tt(Dr,{device:ho})}),
55
- /* @__PURE__ */ot("div",{className:"sf-frame-scaler",style:Qr,children:[
56
- /* @__PURE__ */tt("div",{className:"sf-frame "+(ho===po?"":`sf-frame--${ho}`),style:Kr,children:/* @__PURE__ */ot("div",{className:"sf-preview-host",children:[
51
+ /* @__PURE__ */tt(Te,{words:Wt,icon:/* @__PURE__ */tt(hr,{type:"page",size:13}),name:Ht.pageSettings,onSelect:ni,selected:!Bt&&Go,rowProps:{onClick:tl(ni)}}),Rl&&/* @__PURE__ */ot(rt,{children:[!Pl&&/* @__PURE__ */tt(Re,{children:Ht.header}),Ps(Rl)]}),xt&&!(Pl&&Rl)&&/* @__PURE__ */ot(rt,{children:[!Pl&&/* @__PURE__ */tt(Re,{children:Ht.header}),!Ft&&/* @__PURE__ */tt(Te,{words:Wt,icon:/* @__PURE__ */tt(hr,{type:"header",size:13}),name:Ht.header,badge:Al?void 0:Ll,shared:Al,onSelect:ti,selected:Wo.kind===Rt?.kind,rowProps:{onClick:tl(ti)}})]}),Bl&&!(Pl&&Rl)&&Hs(Bl,Ol,"header"),!Es&&/* @__PURE__ */tt(Re,{children:Vs}),Es?/* @__PURE__ */ot(rt,{children:[
52
+ /* @__PURE__ */tt(Te,{words:Wt,icon:null,name:Vs,fold:{open:!Fs,label:Vs,onToggle:()=>Mr(ht)}}),!Fs&&/* @__PURE__ */tt(Ae,{children:Ds})]}):Ds,xt&&!Pl&&/* @__PURE__ */tt(Re,{children:Ht.footer}),Cl&&!(Pl&&El)&&Hs(Cl,zl,"footer"),El&&Ps(El),tr.treeFoot?.()]})]})}),
53
+ /* @__PURE__ */tt(qe,{side:"left",width:Or.left,min:en,max:_e,defaultWidth:m.left,label:Ht.resizeLeftPanel,onResize:Nr})]}):/* @__PURE__ */tt(B,{side:"left",onShow:Zr}),
54
+ /* @__PURE__ */ot("div",{ref:Rr,className:"sf-center sf-scroll","data-sf-canvas-head":Hr?"":void 0,style:{overflowX:Jr?"auto":"hidden",overflowY:"hidden"},children:[Hr&&/* @__PURE__ */tt("div",{ref:Wr,className:"sf-canvas-head",children:/* @__PURE__ */tt(Hr,{device:ho})}),
55
+ /* @__PURE__ */ot("div",{className:"sf-frame-scaler",style:Kr,children:[
56
+ /* @__PURE__ */tt("div",{className:"sf-frame "+(ho===po?"":`sf-frame--${ho}`),style:Qr,children:/* @__PURE__ */ot("div",{className:"sf-preview-host",children:[
57
57
  /* @__PURE__ */tt(Me.Provider,{value:Nl,children:/* @__PURE__ */tt(je.Provider,{value:Tl,children:/* @__PURE__ */tt(Zt,{},zo)})}),
58
- /* @__PURE__ */tt(cn,{canvas:Io,session:ns,model:ks,measure:Ss,canDrop:ws,onDrop:zs,choose:is,onPick:Os,onZoneAdd:Bs,onSeamAdd:Bs,zoneAddLabel:Dt.canvasAddBlock,words:Ut.canvas,readOnly:Boolean(yt),revision:zt.data}),Ho.length>0&&!No&&/* @__PURE__ */tt("div",{className:"sf-preview-gaps",children:Ho.map(e=>
59
- /* @__PURE__ */tt(pn,{index:e.index,label:Dt.addSectionHere,onInsert:()=>qi(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))})]})}),ds?/* @__PURE__ */tt(dt,{canvas:Io,tabs:ps,onSelect:e=>{const n=oi.findIndex(n=>String(n.props.id)===e);n>=0&&Xi(n)}}):null]})]}),lo?/* @__PURE__ */ot(rt,{children:[
60
- /* @__PURE__ */tt(h,{value:{selectChild:Sl,addChild:bl,childRowName:ji,blockRowName:Dl},children:/* @__PURE__ */tt(qt,{mode:Wo,onOpenWebsiteSettings:tr.openSettings??(()=>{}),onOpenSiteStyles:tr.openStyles,onSelectNode:yr,onNotify:Lr,onHidePanel:qr,nodeActions:Bt?xe(Nt,Bt.type):ft})}),
61
- /* @__PURE__ */tt(qe,{side:"right",width:Or.right,min:en,max:_e,defaultWidth:m.right,label:Dt.resizeSettingsPanel,onResize:Pr})]}):
62
- /* @__PURE__ */tt(B,{side:"right",onShow:qr})]}),Hi.menu,pi?/* @__PURE__ */tt(it,{name:pi.name,onMake:e=>(async(e,n)=>{const t=oi.find(n=>String(n.props.id)===e),o=Pt.shared;if(!t||!o)return;let r;try{r=await C(ci).create(n,t)}catch{return void Lr(Dt.shared.makeFailed,"error")}o.adopt(t,r),ui(null)})(pi.id,e),onCancel:()=>ui(null)}):null]})}))}export{mt as ScreenChrome};
58
+ /* @__PURE__ */tt(cn,{canvas:Io,session:ns,model:ks,measure:Ss,canDrop:ws,onDrop:zs,choose:is,onPick:Os,onZoneAdd:Bs,onSeamAdd:Bs,zoneAddLabel:Ht.canvasAddBlock,words:Ut.canvas,readOnly:Boolean(yt),revision:zt.data}),Do.length>0&&!No&&/* @__PURE__ */tt("div",{className:"sf-preview-gaps",children:Do.map(e=>
59
+ /* @__PURE__ */tt(pn,{index:e.index,label:Ht.addSectionHere,onInsert:()=>qi(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))})]})}),ds?/* @__PURE__ */tt(dt,{canvas:Io,tabs:ps,onSelect:e=>{const n=oi.findIndex(n=>String(n.props.id)===e);n>=0&&Yi(n)}}):null]})]}),lo?/* @__PURE__ */ot(rt,{children:[
60
+ /* @__PURE__ */tt(h,{value:{selectChild:Sl,addChild:bl,childRowName:ji,blockRowName:Hl},children:/* @__PURE__ */tt(qt,{mode:Wo,onOpenWebsiteSettings:tr.openSettings??(()=>{}),onOpenSiteStyles:tr.openStyles,onSelectNode:yr,onNotify:Lr,onHidePanel:qr,nodeActions:Bt?xe(Nt,Bt.type):ft})}),
61
+ /* @__PURE__ */tt(qe,{side:"right",width:Or.right,min:en,max:_e,defaultWidth:m.right,label:Ht.resizeSettingsPanel,onResize:Pr})]}):
62
+ /* @__PURE__ */tt(B,{side:"right",onShow:qr})]}),Di.menu,pi?/* @__PURE__ */tt(it,{name:pi.name,onMake:e=>(async(e,n)=>{const t=oi.find(n=>String(n.props.id)===e),o=Pt.shared;if(!t||!o)return;let r;try{r=await C(ci).create(n,t)}catch{return void Lr(Ht.shared.makeFailed,"error")}o.adopt(t,r),ui(null)})(pi.id,e),onCancel:()=>ui(null)}):null]})}))}export{mt as ScreenChrome};
@@ -1 +1 @@
1
- import{useScreenBlockRules as e}from"./chunk-XHSGRH42.js";import{newNodeId as t,ROOT_ZONE as n}from"./chunk-PLVEGYK6.js";import{useEasel as o,useEaselApi as r}from"./chunk-QEAUF632.js";import{useMemo as s}from"react";function i(i={}){const{dispatch:p}=o(e=>e),d=r(),c=!0===i.readOnly,a=e().resolveOnInsert,l=!0===(i.resolveOnInsert??a),m=!0===i.foldIntoHistory;return s(()=>{const e=m?e=>p({...e,recordHistory:!1}):p,o=(n,o,r)=>{const s=t(o);return c||e({type:"insert",componentType:o,destinationZone:n,destinationIndex:r,id:s}),s},r=e=>(l&&!c&&d.resolveNode(e,{trigger:"insert"}),e),s=(t,n,o)=>{c||e({type:"replace",destinationZone:t,destinationIndex:n,data:o})},i=(e,t,n)=>r(o(e,t,n));return{insertComponent:i,insertSection:(e,t)=>i(n,e,t),replaceComponent:s,seedChild:(e,t,n,i)=>{const p=o(e,n,t);s(e,t,{type:n,props:{id:p,...i}}),r(p)},insertNode:(e,t,n)=>{const i=o(e,n.type,t);return s(e,t,{type:n.type,props:{...n.props,id:i}}),r(i)},removeComponent:(t,n)=>{c||e({type:"remove",index:n,zone:t})},reorderComponent:(t,n,o)=>{c||e({type:"reorder",sourceIndex:n,destinationIndex:o,destinationZone:t})},duplicateComponent:(t,n)=>{c||e({type:"duplicate",sourceIndex:n,sourceZone:t})},select:e=>p({type:"setUi",ui:{itemSelector:e}}),setDocument:t=>{c||e({type:"setData",data:t})},commitDocument:(t,n)=>{c||(m?d.batch(()=>{e({type:"setData",data:t}),void 0!==n&&("slot"===n?.kind?d.selectSlot({parentId:n.parentId,slot:n.slot}):d.select(n?n.id:null))}):d.run({data:t,select:n}))}}},[p,c,l,d,m])}export{i as useSectionOps};
1
+ import{useScreenBlockRules as e}from"./chunk-W6SDWCOL.js";import{newNodeId as t,ROOT_ZONE as n}from"./chunk-PLVEGYK6.js";import{useEasel as o,useEaselApi as r}from"./chunk-QEAUF632.js";import{useMemo as s}from"react";function i(i={}){const{dispatch:p}=o(e=>e),d=r(),c=!0===i.readOnly,a=e().resolveOnInsert,l=!0===(i.resolveOnInsert??a),m=!0===i.foldIntoHistory;return s(()=>{const e=m?e=>p({...e,recordHistory:!1}):p,o=(n,o,r)=>{const s=t(o);return c||e({type:"insert",componentType:o,destinationZone:n,destinationIndex:r,id:s}),s},r=e=>(l&&!c&&d.resolveNode(e,{trigger:"insert"}),e),s=(t,n,o)=>{c||e({type:"replace",destinationZone:t,destinationIndex:n,data:o})},i=(e,t,n)=>r(o(e,t,n));return{insertComponent:i,insertSection:(e,t)=>i(n,e,t),replaceComponent:s,seedChild:(e,t,n,i)=>{const p=o(e,n,t);s(e,t,{type:n,props:{id:p,...i}}),r(p)},insertNode:(e,t,n)=>{const i=o(e,n.type,t);return s(e,t,{type:n.type,props:{...n.props,id:i}}),r(i)},removeComponent:(t,n)=>{c||e({type:"remove",index:n,zone:t})},reorderComponent:(t,n,o)=>{c||e({type:"reorder",sourceIndex:n,destinationIndex:o,destinationZone:t})},duplicateComponent:(t,n)=>{c||e({type:"duplicate",sourceIndex:n,sourceZone:t})},select:e=>p({type:"setUi",ui:{itemSelector:e}}),setDocument:t=>{c||e({type:"setData",data:t})},commitDocument:(t,n)=>{c||(m?d.batch(()=>{e({type:"setData",data:t}),void 0!==n&&("slot"===n?.kind?d.selectSlot({parentId:n.parentId,slot:n.slot}):d.select(n?n.id:null))}):d.run({data:t,select:n}))}}},[p,c,l,d,m])}export{i as useSectionOps};
@@ -1,5 +1,5 @@
1
- import{usePickFollowsSelection as n}from"./chunk-R6WTQWAC.js";import{slotFieldsOf as e}from"./chunk-PLVEGYK6.js";import{EaselCanvas as t,useSelectedFields as r}from"./chunk-QEAUF632.js";import{Inspector as i}from"./chunk-5VD2LGIZ.js";import{createContext as o,useContext as u}from"react";import{DesktopIcon as l}from"efficient-shell/icons/efficient";import{jsx as s}from"react/jsx-runtime";var c={kind:"puck"};function f(n,e){const t=n,r=e,i=Object.keys(t);return i.length===Object.keys(r).length&&i.every(n=>Object.is(t[n],r[n]))}function a(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function d(n,t,r){const i=n.slotsOf?.(r);return i||e(t,r.type).map(n=>({slot:n,label:n,rung:!1}))}function p(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function m(n,e){return n.isLast?n.isLast(e):e.type===n.last}var k={},h=()=>k,v=()=>"",g=()=>null,y=()=>{},b={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},L={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},O={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */s(l,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},j={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},w={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function S(){/* @__PURE__ */
1
+ import{usePickFollowsSelection as n}from"./chunk-R6WTQWAC.js";import{slotFieldsOf as e}from"./chunk-PLVEGYK6.js";import{EaselCanvas as t,useSelectedFields as r}from"./chunk-QEAUF632.js";import{Inspector as i}from"./chunk-5ZBV5RA6.js";import{createContext as o,useContext as u}from"react";import{DesktopIcon as l}from"efficient-shell/icons/efficient";import{jsx as s}from"react/jsx-runtime";var c={kind:"puck"};function f(n,e){const t=n,r=e,i=Object.keys(t);return i.length===Object.keys(r).length&&i.every(n=>Object.is(t[n],r[n]))}function a(n){const e=n;return"string"==typeof e.nodeId&&"string"==typeof e.slot}function d(n,t,r){const i=n.slotsOf?.(r);return i||e(t,r.type).map(n=>({slot:n,label:n,rung:!1}))}function p(n,e){return n.isFirst?n.isFirst(e):e.type===n.first}function m(n,e){return n.isLast?n.isLast(e):e.type===n.last}var k={},h=()=>k,v=()=>"",g=()=>null,y=()=>{},b={isLockedBlock:()=>!1,duplicateBlocked:()=>null,nestDepth:()=>0,newSectionNode:()=>null,canAddTo:()=>null,blockIsOffered:()=>!0},O={labelAtLevel:(n,e,t)=>t,descriptions:{},categoryLabel:()=>{},firstSection:null,blockRowName:(n,e)=>e(n.type),plainText:n=>n,Icon:()=>null,Thumbnail:()=>null,useProducts:()=>null},j={options:[{id:"desktop",label:"Desktop",icon:/* @__PURE__ */s(l,{})}],initial:"desktop",fluid:"desktop",widths:{desktop:2e3}},w={read:()=>"sections",write:()=>{},forSelection:(n,e)=>n?"sections":e},L={first:null,last:null,firstGroup:null,lastGroup:null,isSectionGroup:()=>!1,sectionGroupZone:()=>"",panelOf:()=>null};function S(){/* @__PURE__ */
2
2
  return s(t,{height:"fill"})}function C(){const{id:n,fields:e,values:t,readOnly:o,onChange:u}=r();/* @__PURE__ */
3
- return s("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */s(i,{fields:e,values:t,onChange:u,readOnly:o,idPrefix:n})})}var D=o({});function G({parts:n,children:e}){/* @__PURE__ */
4
- return s(D.Provider,{value:n,children:e})}function P(){return u(D)}function I(){return(P().useOwnerName??v)()}function N(){return(P().useDocumentLabel??g)()}function x(n,e,t,r){return(P().useBridges??h)(n,e,t,r)}function A(n){return(P().useStandaloneBridges??h)(n)}function B(n,e){(P().useDocumentPass??y)(n,e)}function F(){return P().blockRules??b}function T(){return P().blockLook??L}function R(){return P().devices??O}function V(){return P().leftView??j}function E(){return P().pinned??w}function K(){return P().saveSwitch??!0}function Q(e){n(!0===P().pickFollowsSelection,e)}function W(){return P().storageNamespace||void 0}function Z(){return P().styleClipboard??null}function H(){return P().nodeKeys??!0}function U(){return P().notify??null}function Y(){return P().Canvas??S}function q(){return P().CanvasHead??null}function z(){return P().canvasDrag??null}var J=o(null);function M({target:n,children:e}){/* @__PURE__ */
5
- return s(J.Provider,{value:n,children:e})}function X(){return u(J)}function $(){return P().Inspector??C}export{c as SELECTION_MODE,M as ScreenCanvasTargetProvider,G as ScreenPartsProvider,p as isPinnedFirst,m as isPinnedLast,a as isSlotMode,f as sameInspectorMode,d as screenSlotsOf,T as useScreenBlockLook,F as useScreenBlockRules,x as useScreenBridges,z as useScreenCanvasDrag,Y as useScreenCanvasFrame,q as useScreenCanvasHead,X as useScreenCanvasTarget,R as useScreenDevices,N as useScreenDocumentLabel,B as useScreenDocumentPass,$ as useScreenInspectorPanel,V as useScreenLeftView,H as useScreenNodeKeys,U as useScreenNotify,I as useScreenOwnerName,P as useScreenParts,Q as useScreenPickFollowsSelection,E as useScreenPinned,K as useScreenSaveSwitch,W as useScreenStorageNamespace,Z as useScreenStyleClipboard,A as useStandaloneScreenBridges};
3
+ return s("div",{className:"es-sidepanel es-sidepanel--right",children:/* @__PURE__ */s(i,{fields:e,values:t,onChange:u,readOnly:o,idPrefix:n})})}var P=o({});function A({parts:n,children:e}){/* @__PURE__ */
4
+ return s(P.Provider,{value:n,children:e})}function B(){return u(P)}function D(){return(B().useOwnerName??v)()}function G(){return(B().useDocumentLabel??g)()}function N(n,e,t,r){return(B().useBridges??h)(n,e,t,r)}function x(n){return(B().useStandaloneBridges??h)(n)}function F(n,e){(B().useDocumentPass??y)(n,e)}function I(){return B().blockRules??b}function R(){return B().blockLook??O}function T(){return B().devices??j}function V(){return B().leftView??w}function E(){return B().pinned??L}function K(){return B().saveSwitch??!0}function Q(e){n(!0===B().pickFollowsSelection,e)}function W(){return B().storageNamespace||void 0}function Z(){return B().styleClipboard??null}function H(){return B().nodeKeys??!0}function U(){return B().notify??null}function Y(){return B().Canvas??S}function q(){return B().CanvasHead??null}function z(){return B().canvasDrag??null}var J=o(null);function M({target:n,children:e}){/* @__PURE__ */
5
+ return s(J.Provider,{value:n,children:e})}function X(){return u(J)}function $(){return B().Inspector??C}export{c as SELECTION_MODE,M as ScreenCanvasTargetProvider,A as ScreenPartsProvider,p as isPinnedFirst,m as isPinnedLast,a as isSlotMode,f as sameInspectorMode,d as screenSlotsOf,R as useScreenBlockLook,I as useScreenBlockRules,N as useScreenBridges,z as useScreenCanvasDrag,Y as useScreenCanvasFrame,q as useScreenCanvasHead,X as useScreenCanvasTarget,T as useScreenDevices,G as useScreenDocumentLabel,F as useScreenDocumentPass,$ as useScreenInspectorPanel,V as useScreenLeftView,H as useScreenNodeKeys,U as useScreenNotify,D as useScreenOwnerName,B as useScreenParts,Q as useScreenPickFollowsSelection,E as useScreenPinned,K as useScreenSaveSwitch,W as useScreenStorageNamespace,Z as useScreenStyleClipboard,x as useStandaloneScreenBridges};
@@ -1 +1 @@
1
- import{useSectionOps as o}from"./chunk-A7FF65FL.js";import{SELECTION_MODE as e}from"./chunk-XHSGRH42.js";import{decodePartId as r,encodePartId as t}from"./chunk-IYT6NN2J.js";import{useEasel as n}from"./chunk-QEAUF632.js";import{usePreviewParts as p}from"./chunk-I54UCYOU.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:a}){const{getSelectorForId:u}=n(o=>o),I=o(),{setSelectedPartId:f,setSelectHandler:k}=p(),l=d(o=>{const t=r(o);if(!t)return;const{nodeId:n,propKey:p}=t;p?(i(o=>s(o)&&o.nodeId===n&&o.propKey===p?o:{kind:"part",nodeId:n,propKey:p}),a?.(n)):i(o=>"part"===o.kind?e:o)},[i,a]);c(()=>{k(l)},[k,l]);const h=s(m)?t(m.nodeId,m.propKey):null;c(()=>{f(h)},[h,f]);return{selectNode:d(o=>{i(()=>e);const r=u(o);r&&I.select(r)},[i,u,I]),openPartId:h}}export{m as usePartBridge};
1
+ import{useSectionOps as o}from"./chunk-SNB4LQMK.js";import{SELECTION_MODE as e}from"./chunk-W6SDWCOL.js";import{decodePartId as r,encodePartId as t}from"./chunk-IYT6NN2J.js";import{useEasel as n}from"./chunk-QEAUF632.js";import{usePreviewParts as p}from"./chunk-I54UCYOU.js";import{useCallback as d,useEffect as c}from"react";var s=o=>"part"===o.kind;function m({mode:m,setMode:i,onOpenPart:a}){const{getSelectorForId:u}=n(o=>o),I=o(),{setSelectedPartId:f,setSelectHandler:k}=p(),l=d(o=>{const t=r(o);if(!t)return;const{nodeId:n,propKey:p}=t;p?(i(o=>s(o)&&o.nodeId===n&&o.propKey===p?o:{kind:"part",nodeId:n,propKey:p}),a?.(n)):i(o=>"part"===o.kind?e:o)},[i,a]);c(()=>{k(l)},[k,l]);const h=s(m)?t(m.nodeId,m.propKey):null;c(()=>{f(h)},[h,f]);return{selectNode:d(o=>{i(()=>e);const r=u(o);r&&I.select(r)},[i,u,I]),openPartId:h}}export{m as usePartBridge};
@@ -1 +1 @@
1
- export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-5VD2LGIZ.js";export{fieldIsShown,showWhenOf,shownFields,withShowWhen}from"../chunk-BPXEFVSQ.js";import"../chunk-A6Z4SD3I.js";import"../chunk-BALFHI3G.js";import"../chunk-K56YDHYQ.js";export{FieldSlider}from"../chunk-XWFH2NHZ.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";import"../chunk-RC25EGHD.js";import"../chunk-KFV7N2DJ.js";export{FieldNumber}from"../chunk-2XMHLXMA.js";export{FieldSelect,optionFor}from"../chunk-G3GWAP5R.js";import"../chunk-WRFD4EXD.js";import"../chunk-36LVP5WD.js";import"../chunk-MFIRYGHW.js";import"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
1
+ export{FieldText,Inspector,InspectorField,LinkPicker,ListField,bucketsOf,copyItem,insertAt,labelOf,moveTo,planFields,removeAt}from"../chunk-5ZBV5RA6.js";export{fieldIsShown,showWhenOf,shownFields,withShowWhen}from"../chunk-BPXEFVSQ.js";import"../chunk-A6Z4SD3I.js";import"../chunk-K56YDHYQ.js";export{FieldSlider}from"../chunk-XWFH2NHZ.js";export{useResolvedFields}from"../chunk-YRLPFZW3.js";import"../chunk-BALFHI3G.js";import"../chunk-RC25EGHD.js";import"../chunk-KFV7N2DJ.js";export{FieldNumber}from"../chunk-2XMHLXMA.js";export{FieldSelect,optionFor}from"../chunk-G3GWAP5R.js";import"../chunk-WRFD4EXD.js";import"../chunk-36LVP5WD.js";import"../chunk-MFIRYGHW.js";import"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{AddBlockRow as default}from"../../chunk-F7FDF6NS.js";import"../../chunk-M2Z775ZC.js";import"../../chunk-XHSGRH42.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-C2RHV42O.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-QEAUF632.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-5VD2LGIZ.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-A6Z4SD3I.js";import"../../chunk-BALFHI3G.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-X3TYRF5V.js";import"../../chunk-23VM4PMV.js";import"../../chunk-B4JN227A.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-X4T6JT3M.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{AddBlockRow as default}from"../../chunk-N5AN2RF2.js";import"../../chunk-M2Z775ZC.js";import"../../chunk-W6SDWCOL.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-C2RHV42O.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-QEAUF632.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-5ZBV5RA6.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-A6Z4SD3I.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BALFHI3G.js";import"../../chunk-X3TYRF5V.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-23VM4PMV.js";import"../../chunk-B4JN227A.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-X4T6JT3M.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{blockKey,AddSidePanel as default,sectionKey,sharedKey,templateKey}from"../../chunk-BRMYJBMB.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-43AEUUNQ.js";import"../../chunk-XDZHKYQX.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-M2Z775ZC.js";import"../../chunk-XHSGRH42.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-WXFZD7WC.js";import"../../chunk-C2RHV42O.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-QEAUF632.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-5VD2LGIZ.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-A6Z4SD3I.js";import"../../chunk-BALFHI3G.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-X3TYRF5V.js";import"../../chunk-GWIVPLOX.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-23VM4PMV.js";import"../../chunk-B4JN227A.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-LLDHIBYG.js";import"../../chunk-KAML3KQH.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-X4T6JT3M.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{blockKey,AddSidePanel as default,sectionKey,sharedKey,templateKey}from"../../chunk-2ZWA6ARJ.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-43AEUUNQ.js";import"../../chunk-XDZHKYQX.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-M2Z775ZC.js";import"../../chunk-W6SDWCOL.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-C2RHV42O.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-QEAUF632.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-5ZBV5RA6.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-A6Z4SD3I.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-WXFZD7WC.js";import"../../chunk-BALFHI3G.js";import"../../chunk-X3TYRF5V.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-23VM4PMV.js";import"../../chunk-B4JN227A.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-GWIVPLOX.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-LLDHIBYG.js";import"../../chunk-KAML3KQH.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-X4T6JT3M.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{MediaSidePanel as default}from"../../chunk-WOETW3H6.js";import"../../chunk-XHSGRH42.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-QEAUF632.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-5VD2LGIZ.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-A6Z4SD3I.js";import"../../chunk-BALFHI3G.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-X3TYRF5V.js";import"../../chunk-GWIVPLOX.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-23VM4PMV.js";import"../../chunk-B4JN227A.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-X4T6JT3M.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{MediaSidePanel as default}from"../../chunk-OBIL7BZO.js";import"../../chunk-W6SDWCOL.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-QEAUF632.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-5ZBV5RA6.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-A6Z4SD3I.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BALFHI3G.js";import"../../chunk-X3TYRF5V.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-23VM4PMV.js";import"../../chunk-B4JN227A.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-GWIVPLOX.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-X4T6JT3M.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{EASEL_NODE_CLIPBOARD,ancestorChain,nodeClipboardOf,nodeClipboardRules,nodeMenuItems,nodeShortcut,pageMenuItems,pastePlace,runNodeShortcut,textMenuItems,useNodeClipboard,useNodeContextMenu}from"../../chunk-RFE7ZG3Y.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-WXFZD7WC.js";import"../../chunk-C2RHV42O.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-BALFHI3G.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-X3TYRF5V.js";import"../../chunk-X4T6JT3M.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{EASEL_NODE_CLIPBOARD,ancestorChain,nodeClipboardOf,nodeClipboardRules,nodeMenuItems,nodeShortcut,pageMenuItems,pastePlace,runNodeShortcut,textMenuItems,useNodeClipboard,useNodeContextMenu}from"../../chunk-RFE7ZG3Y.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-C2RHV42O.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-WXFZD7WC.js";import"../../chunk-BALFHI3G.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-X3TYRF5V.js";import"../../chunk-X4T6JT3M.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{ScreenChrome as default}from"../../chunk-N3VPBHR6.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-VEZPDGDQ.js";import"../../chunk-FGNR22NY.js";import"../../chunk-LER7RKTO.js";import"../../chunk-XHHVMAGM.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-YLQYEDUQ.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-U277UX5I.js";import"../../chunk-YI4QXOVJ.js";import"../../chunk-A7FF65FL.js";import"../../chunk-7TOQCTHV.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-5545A3PC.js";import"../../chunk-BRMYJBMB.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-43AEUUNQ.js";import"../../chunk-XDZHKYQX.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-M2Z775ZC.js";import"../../chunk-WOETW3H6.js";import"../../chunk-XHSGRH42.js";import"../../chunk-RFE7ZG3Y.js";import"../../chunk-HGV3FWOB.js";import"../../chunk-STWSCR25.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-WXFZD7WC.js";import"../../chunk-4VJATVVR.js";import"../../chunk-C2RHV42O.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-BHRC3ASL.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-QEAUF632.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-5VD2LGIZ.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-A6Z4SD3I.js";import"../../chunk-BALFHI3G.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-X3TYRF5V.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-GWIVPLOX.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-23VM4PMV.js";import"../../chunk-B4JN227A.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-LLDHIBYG.js";import"../../chunk-KAML3KQH.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-X4T6JT3M.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";
1
+ export{ScreenChrome as default}from"../../chunk-QNAPTJRM.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-VEZPDGDQ.js";import"../../chunk-FGNR22NY.js";import"../../chunk-LER7RKTO.js";import"../../chunk-XHHVMAGM.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-YLQYEDUQ.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-U277UX5I.js";import"../../chunk-X52NFKUS.js";import"../../chunk-SNB4LQMK.js";import"../../chunk-7TOQCTHV.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-5545A3PC.js";import"../../chunk-2ZWA6ARJ.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-43AEUUNQ.js";import"../../chunk-XDZHKYQX.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-M2Z775ZC.js";import"../../chunk-OBIL7BZO.js";import"../../chunk-W6SDWCOL.js";import"../../chunk-RFE7ZG3Y.js";import"../../chunk-HGV3FWOB.js";import"../../chunk-STWSCR25.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-4VJATVVR.js";import"../../chunk-C2RHV42O.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-BHRC3ASL.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-QEAUF632.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-5ZBV5RA6.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-A6Z4SD3I.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-WXFZD7WC.js";import"../../chunk-BALFHI3G.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-X3TYRF5V.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-23VM4PMV.js";import"../../chunk-B4JN227A.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-GWIVPLOX.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-LLDHIBYG.js";import"../../chunk-KAML3KQH.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-X4T6JT3M.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";
@@ -1 +1 @@
1
- export{DocumentScreen,ScreenMount as default}from"../../chunk-W2GEGVUY.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-N3VPBHR6.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-VEZPDGDQ.js";import"../../chunk-FGNR22NY.js";import"../../chunk-LER7RKTO.js";import"../../chunk-XHHVMAGM.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-YLQYEDUQ.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-U277UX5I.js";import"../../chunk-YI4QXOVJ.js";import"../../chunk-A7FF65FL.js";import"../../chunk-7TOQCTHV.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-MPF5QZJ7.js";import"../../chunk-5545A3PC.js";import"../../chunk-BRMYJBMB.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-43AEUUNQ.js";import"../../chunk-XDZHKYQX.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-M2Z775ZC.js";import"../../chunk-WOETW3H6.js";import"../../chunk-XHSGRH42.js";import"../../chunk-RFE7ZG3Y.js";import"../../chunk-HGV3FWOB.js";import"../../chunk-STWSCR25.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-WXFZD7WC.js";import"../../chunk-4VJATVVR.js";import"../../chunk-C2RHV42O.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-BHRC3ASL.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-QEAUF632.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-5VD2LGIZ.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-A6Z4SD3I.js";import"../../chunk-BALFHI3G.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-X3TYRF5V.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-GWIVPLOX.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-23VM4PMV.js";import"../../chunk-B4JN227A.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-LLDHIBYG.js";import"../../chunk-KAML3KQH.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-X4T6JT3M.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";
1
+ export{DocumentScreen,ScreenMount as default}from"../../chunk-4QWTHRMD.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-QNAPTJRM.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-VEZPDGDQ.js";import"../../chunk-FGNR22NY.js";import"../../chunk-LER7RKTO.js";import"../../chunk-XHHVMAGM.js";import"../../chunk-7F52SZOI.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-4ES5JGGX.js";import"../../chunk-YLQYEDUQ.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-U277UX5I.js";import"../../chunk-X52NFKUS.js";import"../../chunk-SNB4LQMK.js";import"../../chunk-7TOQCTHV.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-DXROGLB5.js";import"../../chunk-5545A3PC.js";import"../../chunk-2ZWA6ARJ.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-43AEUUNQ.js";import"../../chunk-XDZHKYQX.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-M2Z775ZC.js";import"../../chunk-OBIL7BZO.js";import"../../chunk-W6SDWCOL.js";import"../../chunk-RFE7ZG3Y.js";import"../../chunk-HGV3FWOB.js";import"../../chunk-STWSCR25.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-4VJATVVR.js";import"../../chunk-C2RHV42O.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-BHRC3ASL.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-QEAUF632.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-5ZBV5RA6.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-A6Z4SD3I.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-WXFZD7WC.js";import"../../chunk-BALFHI3G.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-X3TYRF5V.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-23VM4PMV.js";import"../../chunk-B4JN227A.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-GWIVPLOX.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-LLDHIBYG.js";import"../../chunk-KAML3KQH.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-X4T6JT3M.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";
@@ -1 +1 @@
1
- export{ScreenStoreProvider as default}from"../../chunk-MPF5QZJ7.js";import"../../chunk-XHSGRH42.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-QEAUF632.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-5VD2LGIZ.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-A6Z4SD3I.js";import"../../chunk-BALFHI3G.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-X3TYRF5V.js";import"../../chunk-23VM4PMV.js";import"../../chunk-B4JN227A.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-X4T6JT3M.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{ScreenStoreProvider as default}from"../../chunk-DXROGLB5.js";import"../../chunk-W6SDWCOL.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-QEAUF632.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-5ZBV5RA6.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-A6Z4SD3I.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BALFHI3G.js";import"../../chunk-X3TYRF5V.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-23VM4PMV.js";import"../../chunk-B4JN227A.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-X4T6JT3M.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1,16 +1,16 @@
1
- import{AddBlockRow as e}from"../../chunk-F7FDF6NS.js";import{scrollPreviewToSection as n,gotoPreviewSlide as o}from"../../chunk-4ES5JGGX.js";import{useEaselUndoKeys as r}from"../../chunk-YLQYEDUQ.js";import{SlotChildActionsProvider as t}from"../../chunk-KCBEE2MC.js";import{DEFAULT_PANEL_W as s}from"../../chunk-U277UX5I.js";import{usePartBridge as i}from"../../chunk-YI4QXOVJ.js";import{useSectionOps as c}from"../../chunk-A7FF65FL.js";import"../../chunk-M2Z775ZC.js";import{MediaSidePanel as p}from"../../chunk-WOETW3H6.js";import{SELECTION_MODE as l,useScreenPinned as m,useScreenCanvasFrame as d,useScreenInspectorPanel as a,useScreenPickFollowsSelection as u,sameInspectorMode as h,useStandaloneScreenBridges as k,useScreenBlockLook as f,useScreenBlockRules as j}from"../../chunk-XHSGRH42.js";import{useScreenDocument as S}from"../../chunk-STWSCR25.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import{useMediaPanel as y,usePanelPick as N,useCancelPanelPick as R}from"../../chunk-R6WTQWAC.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import{useHostEscape as C}from"../../chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as x}from"../../chunk-C2RHV42O.js";import{slotChildRowName as A}from"../../chunk-BHRC3ASL.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-IYT6NN2J.js";import{slotFieldsOf as P,nestsInTree as v}from"../../chunk-PLVEGYK6.js";import{useEasel as F}from"../../chunk-QEAUF632.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-5VD2LGIZ.js";import"../../chunk-BPXEFVSQ.js";import{LayersTree as L,Subtree as D,TreeRow as H,TreeRowAction as M,TreeSeam as g}from"../../chunk-A6Z4SD3I.js";import"../../chunk-BALFHI3G.js";import{DEFAULT_TREE_WORDS as O}from"../../chunk-K56YDHYQ.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-X3TYRF5V.js";import"../../chunk-NDRZP6YR.js";import{DEFAULT_SAVE_WORDS as w,saveIndicator as z}from"../../chunk-H6DDIBQ4.js";import{SaveState as B,panelWidthVars as E}from"../../chunk-GWIVPLOX.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-23VM4PMV.js";import"../../chunk-B4JN227A.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import{useWords as V}from"../../chunk-MFIRYGHW.js";import"../../chunk-LLDHIBYG.js";import"../../chunk-KAML3KQH.js";import{useTreeDrag as W}from"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-X4T6JT3M.js";import{zoneKey as X,parseZoneKey as b}from"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import{useState as Y,useRef as G,useEffect as T,useCallback as I,Fragment as Z}from"react";import{Tooltip as K}from"efficient-shell/ui";import{TrashIcon as J}from"efficient-shell/icons/efficient";import{jsxs as Q,jsx as $,Fragment as U}from"react/jsx-runtime";var q=e=>n=>{n.target.closest("button, input")||e()},_={rowClick:q};function ee(){const{saveState:ee,readOnly:ne,readOnlyReason:oe=null}=S(),re=c(),{appState:te,selectedItem:se,config:ie}=F(e=>e),[ce,pe]=Y(l),le=V("screen",x),me=V("tree",O),de=V("save",w),{first:ae,last:ue,panelOf:he}=m(),ke=he(ae),fe=d(),je=a(),Se=te.data.content?.[0]??null,ye=Se?.props.id??null,Ne=Se?.type===ae,Re=Se?.type===ue,Ce=G(null),xe=G(null);r(xe);const Ae=y(),Pe=N(),ve=R();u(se?.props.id),T(()=>{const e=xe.current;if(!Pe||!e)return;const n=e=>{"Escape"===e.key&&ve()};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[Pe]),C(null!==Pe,()=>ve()),T(()=>{ye&&Ce.current!==ye&&(Ce.current=ye,Ne?pe(ke??l):se||re.select({index:0}))},[ye,se,re,Ne]);const Fe=I(e=>pe(n=>h(n,e)?n:e),[]),Le=k({kind:ce.kind,mode:ce,open:Fe,show:e=>pe(e),reveal:()=>{},select:(e,n)=>{pe(e=>h(e,n)?e:n),re.select(e)}}),{selectNode:De}=i({mode:ce,setMode:pe,onOpenPart:n}),He=f(),{labelAtLevel:Me,Icon:ge}=He,{canAddTo:Oe}=j(),we=e=>Me(e,"block",ie.components[e]?.label??e),ze=e=>Me(e,"section",we(e)),Be=!Ne&&"puck"===ce.kind&&se?.props.id===ye,Ee=Se?Oe(Se.type)?.spec??null:null,Ve=Se&&Ee?`${Se.props.id}:${Ee.slot}`:null,We=Se&&Ee&&Array.isArray(Se.props[Ee.slot])?Se.props[Ee.slot]:[],Xe=e=>A(e,we,He.plainText),be=(e,r)=>{Se&&Ee&&Ve&&(pe(l),Ee.slider?(o(String(Se.props.id),e),re.select({index:e,zone:Ve}),n(String(Se.props.id))):(re.select({index:e,zone:Ve}),n(r)))},Ye=()=>{if(!Se||!Ee||!Ve)return;const e=We.length;re.insertComponent(Ve,Ee.childType,e),pe(l),Ee.slider?requestAnimationFrame(()=>{o(String(Se.props.id),e),re.select({index:e,zone:Ve})}):re.select({index:e,zone:Ve})},Ge=e=>P(ie,e),Te=e=>{const{parentId:n,slot:o}=b(e),r=e=>{if(!e)return null;if(String(e.props.id)===n)return e;for(const n of Ge(e.type)){const o=Array.isArray(e.props[n])?e.props[n]:[];for(const e of o){const n=r(e);if(n)return n}}return null},t=r(Se)?.props[o];return Array.isArray(t)?t.length:0},Ie=(e,n,o)=>{const r=Math.min(Math.max(o,0),Te(e)),t=n<r?r-1:r;t!==n&&(re.reorderComponent(e,n,t),pe(l),re.select({index:t,zone:e}))},Ze=W({keyOf:e=>e.id,readOnly:Boolean(ne),canDrop:(e,n)=>X(n)===e.zone&&n.index>=0&&n.index<=Te(e.zone),onDrop:(e,n)=>Ie(e.zone,e.index,n.index),onStep:(e,n)=>Ie(e.zone,e.index,n<0?e.index-1:e.index+2)}),Ke=(e,n)=>/* @__PURE__ */$(g,{...ne?{}:Ze.seam({place:{...b(e),index:n}})},`seam:${e}:${n}`),Je=e=>He.blockRowName(e,we),Qe=(e,o,r)=>{pe(l),re.select({index:o,zone:e}),n(r)},$e=(e,n,o)=>{re.insertComponent(e,n,o),pe(l),re.select({index:o,zone:e})},Ue=(n,o,r)=>/* @__PURE__ */$(e,{choices:r,onPick:e=>$e(n,e,o)}),qe=(e,n)=>{const o=Ge((r=e).type).flatMap(e=>(Array.isArray(r.props[e])?r.props[e]:[]).map((n,o)=>({child:n,zone:`${r.props.id}:${e}`,index:o})));var r;const t=Oe(e.type),s=t?.choices??null,i="footer"===t?.source?Je:Xe;/* @__PURE__ */
2
- return Q(U,{children:[o.map(({child:e,zone:o,index:r})=>{const t=se?.props.id===e.props.id,s=v(ie,e.type,n),c=i(e),p=String(e.props.id),m=()=>Qe(o,r,p),{rowProps:d,...a}=Ze.row({item:{id:p,zone:o,index:r},place:{...b(o),index:r}},{onClick:q(m)});/* @__PURE__ */
3
- return Q(Z,{children:[0===r&&Ke(o,0),
4
- /* @__PURE__ */$(H,{words:me,icon:/* @__PURE__ */$(ge,{type:e.type,size:13}),name:c,selected:t,onSelect:m,...a,actions:/* @__PURE__ */$(M,{kind:"delete",label:le.deleteNamed({name:c}),onClick:()=>{return e=o,n=r,re.removeComponent(e,n),pe(l),void re.select(null);var e,n},children:/* @__PURE__ */$(J,{size:13})}),rowProps:d}),s&&/* @__PURE__ */$(D,{children:qe(e,n+1)}),Ke(o,r+1)]},String(e.props.id??`${o}-${r}`))}),t&&s?Ue(`${e.props.id}:${t.slot}`,o.length,s):null]})},_e="HeroSingle"===Se?.type,en=Boolean(Se)&&(Boolean(Oe(Se.type))||Ge(Se.type).length>0),nn=Boolean(Se)&&(Boolean(Ee)||Re||Ne||_e||en);/* @__PURE__ */
5
- return Q("div",{ref:xe,className:"sf-editor es-editor",style:E(s),children:[
6
- /* @__PURE__ */$("div",{className:"sf-section-bar",children:/* @__PURE__ */$(B,null!==oe?{tone:"off",label:oe,role:"status"}:{...z(ee,de),role:"status"})}),
7
- /* @__PURE__ */Q("div",{className:"sf-body",children:[Pe&&Ae?/* @__PURE__ */$("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:/* @__PURE__ */$(p,{panel:Ae,pick:Pe})}):nn&&Se&&/* @__PURE__ */Q("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:[
8
- /* @__PURE__ */$("div",{className:"sf-panel-head",children:/* @__PURE__ */$(K,{content:Ne?le.headerSettings:le.sectionSettings({name:ze(Se.type)}),side:"bottom",children:/* @__PURE__ */$("button",{type:"button",className:"sf-panel-title sf-panel-title--btn "+(Be?"is-selected":""),"aria-pressed":Be,onClick:()=>{Ne?pe(ke??l):(pe(l),re.select({index:0}))},children:ze(Se.type)})})}),
9
- /* @__PURE__ */$(L,{className:"sf-tree sf-scroll",rootProps:Ze.rootProps(),words:me,children:/* @__PURE__ */$(D,{children:Ne?
10
- /* @__PURE__ */$(H,{words:me,icon:/* @__PURE__ */$(ge,{type:"header",size:13}),name:le.headerSettings,selected:ce.kind===ke?.kind,onSelect:()=>pe(ke??l),rowProps:{onClick:q(()=>pe(ke??l))}}):Ee?/* @__PURE__ */Q(U,{children:[We.map((e,n)=>{const o=se?.props.id===e.props.id,r=Xe(e),t=String(e.props.id),s=()=>be(n,t),{rowProps:i,...c}=Ze.row({item:{id:t,zone:Ve,index:n},place:{...b(Ve),index:n}},{onClick:q(s)});/* @__PURE__ */
11
- return Q(Z,{children:[0===n&&Ke(Ve,0),
12
- /* @__PURE__ */$(H,{words:me,icon:/* @__PURE__ */$(ge,{type:e.type,size:13}),name:r,selected:o,onSelect:s,...c,actions:/* @__PURE__ */$(M,{kind:"delete",label:le.deleteNamed({name:r}),onClick:()=>{return e=n,void(Ve&&(re.removeComponent(Ve,e),pe(l),re.select(null)));var e},children:/* @__PURE__ */$(J,{size:13})}),rowProps:i}),Ke(Ve,n+1)]},String(e.props.id??n))}),
1
+ import{AddBlockRow as e}from"../../chunk-N5AN2RF2.js";import{scrollPreviewToSection as n,gotoPreviewSlide as o}from"../../chunk-4ES5JGGX.js";import{useEaselUndoKeys as r}from"../../chunk-YLQYEDUQ.js";import{SlotChildActionsProvider as t}from"../../chunk-KCBEE2MC.js";import{DEFAULT_PANEL_W as s}from"../../chunk-U277UX5I.js";import{usePartBridge as i}from"../../chunk-X52NFKUS.js";import{useSectionOps as c}from"../../chunk-SNB4LQMK.js";import"../../chunk-M2Z775ZC.js";import{MediaSidePanel as p}from"../../chunk-OBIL7BZO.js";import{SELECTION_MODE as l,useScreenPinned as m,useScreenCanvasFrame as d,useScreenInspectorPanel as a,useScreenPickFollowsSelection as u,sameInspectorMode as h,useStandaloneScreenBridges as k,useScreenBlockLook as f,useScreenBlockRules as j}from"../../chunk-W6SDWCOL.js";import{useScreenDocument as S}from"../../chunk-STWSCR25.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-ERR437B5.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import{useMediaPanel as y,usePanelPick as N,useCancelPanelPick as R}from"../../chunk-R6WTQWAC.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import{useHostEscape as C}from"../../chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as A}from"../../chunk-C2RHV42O.js";import{slotChildRowName as x}from"../../chunk-BHRC3ASL.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-DUVRZ456.js";import"../../chunk-IYT6NN2J.js";import{slotFieldsOf as P,nestsInTree as B}from"../../chunk-PLVEGYK6.js";import{useEasel as L}from"../../chunk-QEAUF632.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-5ZBV5RA6.js";import"../../chunk-BPXEFVSQ.js";import{LayersTree as v,Subtree as M,TreeRow as O,TreeRowAction as g,TreeSeam as D}from"../../chunk-A6Z4SD3I.js";import{DEFAULT_TREE_WORDS as w}from"../../chunk-K56YDHYQ.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BALFHI3G.js";import"../../chunk-X3TYRF5V.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-NDRZP6YR.js";import{DEFAULT_SAVE_WORDS as z,saveIndicator as W}from"../../chunk-H6DDIBQ4.js";import"../../chunk-23VM4PMV.js";import"../../chunk-B4JN227A.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import{SaveState as b,panelWidthVars as E}from"../../chunk-GWIVPLOX.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import{useWords as F}from"../../chunk-MFIRYGHW.js";import"../../chunk-LLDHIBYG.js";import"../../chunk-KAML3KQH.js";import{useTreeDrag as H}from"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-X4T6JT3M.js";import{zoneKey as V,parseZoneKey as X}from"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import{useState as Y,useRef as K,useEffect as Z,useCallback as G,Fragment as T}from"react";import{Tooltip as I}from"efficient-shell/ui";import{TrashIcon as J}from"efficient-shell/icons/efficient";import{jsxs as Q,jsx as $,Fragment as U}from"react/jsx-runtime";var q=e=>n=>{n.target.closest("button, input")||e()},_={rowClick:q};function ee(){const{saveState:ee,readOnly:ne,readOnlyReason:oe=null}=S(),re=c(),{appState:te,selectedItem:se,config:ie}=L(e=>e),[ce,pe]=Y(l),le=F("screen",A),me=F("tree",w),de=F("save",z),{first:ae,last:ue,panelOf:he}=m(),ke=he(ae),fe=d(),je=a(),Se=te.data.content?.[0]??null,ye=Se?.props.id??null,Ne=Se?.type===ae,Re=Se?.type===ue,Ce=K(null),Ae=K(null);r(Ae);const xe=y(),Pe=N(),Be=R();u(se?.props.id),Z(()=>{const e=Ae.current;if(!Pe||!e)return;const n=e=>{"Escape"===e.key&&Be()};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[Pe]),C(null!==Pe,()=>Be()),Z(()=>{ye&&Ce.current!==ye&&(Ce.current=ye,Ne?pe(ke??l):se||re.select({index:0}))},[ye,se,re,Ne]);const Le=G(e=>pe(n=>h(n,e)?n:e),[]),ve=k({kind:ce.kind,mode:ce,open:Le,show:e=>pe(e),reveal:()=>{},select:(e,n)=>{pe(e=>h(e,n)?e:n),re.select(e)}}),{selectNode:Me}=i({mode:ce,setMode:pe,onOpenPart:n}),Oe=f(),{labelAtLevel:ge,Icon:De}=Oe,{canAddTo:we}=j(),ze=e=>ge(e,"block",ie.components[e]?.label??e),We=e=>ge(e,"section",ze(e)),be=!Ne&&"puck"===ce.kind&&se?.props.id===ye,Ee=Se?we(Se.type)?.spec??null:null,Fe=Se&&Ee?`${Se.props.id}:${Ee.slot}`:null,He=Se&&Ee&&Array.isArray(Se.props[Ee.slot])?Se.props[Ee.slot]:[],Ve=e=>x(e,ze,Oe.plainText),Xe=(e,r)=>{Se&&Ee&&Fe&&(pe(l),Ee.slider?(o(String(Se.props.id),e),re.select({index:e,zone:Fe}),n(String(Se.props.id))):(re.select({index:e,zone:Fe}),n(r)))},Ye=()=>{if(!Se||!Ee||!Fe)return;const e=He.length;re.insertComponent(Fe,Ee.childType,e),pe(l),Ee.slider?requestAnimationFrame(()=>{o(String(Se.props.id),e),re.select({index:e,zone:Fe})}):re.select({index:e,zone:Fe})},Ke=e=>P(ie,e),Ze=e=>{const{parentId:n,slot:o}=X(e),r=e=>{if(!e)return null;if(String(e.props.id)===n)return e;for(const n of Ke(e.type)){const o=Array.isArray(e.props[n])?e.props[n]:[];for(const e of o){const n=r(e);if(n)return n}}return null},t=r(Se)?.props[o];return Array.isArray(t)?t.length:0},Ge=(e,n,o)=>{const r=Math.min(Math.max(o,0),Ze(e)),t=n<r?r-1:r;t!==n&&(re.reorderComponent(e,n,t),pe(l),re.select({index:t,zone:e}))},Te=H({keyOf:e=>e.id,readOnly:Boolean(ne),canDrop:(e,n)=>V(n)===e.zone&&n.index>=0&&n.index<=Ze(e.zone),onDrop:(e,n)=>Ge(e.zone,e.index,n.index),onStep:(e,n)=>Ge(e.zone,e.index,n<0?e.index-1:e.index+2)}),Ie=(e,n)=>/* @__PURE__ */$(D,{...ne?{}:Te.seam({place:{...X(e),index:n}})},`seam:${e}:${n}`),Je=e=>Oe.blockRowName(e,ze),Qe=(e,o,r)=>{pe(l),re.select({index:o,zone:e}),n(r)},$e=(e,n,o)=>{re.insertComponent(e,n,o),pe(l),re.select({index:o,zone:e})},Ue=(n,o,r)=>/* @__PURE__ */$(e,{choices:r,onPick:e=>$e(n,e,o)}),qe=(e,n)=>{const o=Ke((r=e).type).flatMap(e=>(Array.isArray(r.props[e])?r.props[e]:[]).map((n,o)=>({child:n,zone:`${r.props.id}:${e}`,index:o})));var r;const t=we(e.type),s=t?.choices??null,i="footer"===t?.source?Je:Ve;/* @__PURE__ */
2
+ return Q(U,{children:[o.map(({child:e,zone:o,index:r})=>{const t=se?.props.id===e.props.id,s=B(ie,e.type,n),c=i(e),p=String(e.props.id),m=()=>Qe(o,r,p),{rowProps:d,...a}=Te.row({item:{id:p,zone:o,index:r},place:{...X(o),index:r}},{onClick:q(m)});/* @__PURE__ */
3
+ return Q(T,{children:[0===r&&Ie(o,0),
4
+ /* @__PURE__ */$(O,{words:me,icon:/* @__PURE__ */$(De,{type:e.type,size:13}),name:c,selected:t,onSelect:m,...a,actions:/* @__PURE__ */$(g,{kind:"delete",label:le.deleteNamed({name:c}),onClick:()=>{return e=o,n=r,re.removeComponent(e,n),pe(l),void re.select(null);var e,n},children:/* @__PURE__ */$(J,{size:13})}),rowProps:d}),s&&/* @__PURE__ */$(M,{children:qe(e,n+1)}),Ie(o,r+1)]},String(e.props.id??`${o}-${r}`))}),t&&s?Ue(`${e.props.id}:${t.slot}`,o.length,s):null]})},_e="HeroSingle"===Se?.type,en=Boolean(Se)&&(Boolean(we(Se.type))||Ke(Se.type).length>0),nn=Boolean(Se)&&(Boolean(Ee)||Re||Ne||_e||en);/* @__PURE__ */
5
+ return Q("div",{ref:Ae,className:"sf-editor es-editor",style:E(s),children:[
6
+ /* @__PURE__ */$("div",{className:"sf-section-bar",children:/* @__PURE__ */$(b,null!==oe?{tone:"off",label:oe,role:"status"}:{...W(ee,de),role:"status"})}),
7
+ /* @__PURE__ */Q("div",{className:"sf-body",children:[Pe&&xe?/* @__PURE__ */$("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:/* @__PURE__ */$(p,{panel:xe,pick:Pe})}):nn&&Se&&/* @__PURE__ */Q("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:[
8
+ /* @__PURE__ */$("div",{className:"sf-panel-head",children:/* @__PURE__ */$(I,{content:Ne?le.headerSettings:le.sectionSettings({name:We(Se.type)}),side:"bottom",children:/* @__PURE__ */$("button",{type:"button",className:"sf-panel-title sf-panel-title--btn "+(be?"is-selected":""),"aria-pressed":be,onClick:()=>{Ne?pe(ke??l):(pe(l),re.select({index:0}))},children:We(Se.type)})})}),
9
+ /* @__PURE__ */$(v,{className:"sf-tree sf-scroll",rootProps:Te.rootProps(),words:me,children:/* @__PURE__ */$(M,{children:Ne?
10
+ /* @__PURE__ */$(O,{words:me,icon:/* @__PURE__ */$(De,{type:"header",size:13}),name:le.headerSettings,selected:ce.kind===ke?.kind,onSelect:()=>pe(ke??l),rowProps:{onClick:q(()=>pe(ke??l))}}):Ee?/* @__PURE__ */Q(U,{children:[He.map((e,n)=>{const o=se?.props.id===e.props.id,r=Ve(e),t=String(e.props.id),s=()=>Xe(n,t),{rowProps:i,...c}=Te.row({item:{id:t,zone:Fe,index:n},place:{...X(Fe),index:n}},{onClick:q(s)});/* @__PURE__ */
11
+ return Q(T,{children:[0===n&&Ie(Fe,0),
12
+ /* @__PURE__ */$(O,{words:me,icon:/* @__PURE__ */$(De,{type:e.type,size:13}),name:r,selected:o,onSelect:s,...c,actions:/* @__PURE__ */$(g,{kind:"delete",label:le.deleteNamed({name:r}),onClick:()=>{return e=n,void(Fe&&(re.removeComponent(Fe,e),pe(l),re.select(null)));var e},children:/* @__PURE__ */$(J,{size:13})}),rowProps:i}),Ie(Fe,n+1)]},String(e.props.id??n))}),
13
13
  /* @__PURE__ */Q("button",{type:"button",className:"sf-add-card",onClick:Ye,children:[
14
- /* @__PURE__ */$("span",{className:"sf-plus sf-plus--sm",children:"+"}),Ee.addLabel]}),ye?Le.partRows?.(Se,_):null]}):qe(Se,1)})})]}),
14
+ /* @__PURE__ */$("span",{className:"sf-plus sf-plus--sm",children:"+"}),Ee.addLabel]}),ye?ve.partRows?.(Se,_):null]}):qe(Se,1)})})]}),
15
15
  /* @__PURE__ */$("div",{className:"sf-center",children:/* @__PURE__ */$("div",{className:"sf-preview-host",children:/* @__PURE__ */$(fe,{})})}),
16
- /* @__PURE__ */$(t,{value:{selectChild:(e,n,o,r)=>"section"===Oe(r)?.source?be(n,o):Qe(e,n,o),addChild:(e,n,o,r,t)=>"section"===Oe(t)?.source?Ye():$e(`${e}:${n}`,o,r),childRowName:Xe,blockRowName:Je},children:/* @__PURE__ */$(je,{mode:ce,onOpenWebsiteSettings:Le.openSettings??(()=>{}),onSelectNode:De,hideNodeActions:!0})})]})]})}export{ee as default};
16
+ /* @__PURE__ */$(t,{value:{selectChild:(e,n,o,r)=>"section"===we(r)?.source?Xe(n,o):Qe(e,n,o),addChild:(e,n,o,r,t)=>"section"===we(t)?.source?Ye():$e(`${e}:${n}`,o,r),childRowName:Ve,blockRowName:Je},children:/* @__PURE__ */$(je,{mode:ce,onOpenWebsiteSettings:ve.openSettings??(()=>{}),onSelectNode:Me,hideNodeActions:!0})})]})]})}export{ee as default};
@@ -1 +1 @@
1
- export{usePartBridge}from"../../chunk-YI4QXOVJ.js";import"../../chunk-A7FF65FL.js";import"../../chunk-XHSGRH42.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-QEAUF632.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-5VD2LGIZ.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-A6Z4SD3I.js";import"../../chunk-BALFHI3G.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-X3TYRF5V.js";import"../../chunk-23VM4PMV.js";import"../../chunk-B4JN227A.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-X4T6JT3M.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";
1
+ export{usePartBridge}from"../../chunk-X52NFKUS.js";import"../../chunk-SNB4LQMK.js";import"../../chunk-W6SDWCOL.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-QEAUF632.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-5ZBV5RA6.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-A6Z4SD3I.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BALFHI3G.js";import"../../chunk-X3TYRF5V.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-23VM4PMV.js";import"../../chunk-B4JN227A.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-X4T6JT3M.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";
@@ -1 +1 @@
1
- import"../chunk-GZO72N3Q.js";export{DocumentScreen,ScreenMount}from"../chunk-W2GEGVUY.js";import"../chunk-GXQCZJOP.js";import"../chunk-N3VPBHR6.js";import"../chunk-2GVCAIPX.js";import"../chunk-26OOWIJJ.js";import"../chunk-VEZPDGDQ.js";import"../chunk-FGNR22NY.js";import"../chunk-LER7RKTO.js";import"../chunk-XHHVMAGM.js";import"../chunk-7F52SZOI.js";import"../chunk-MQNBD6AB.js";import"../chunk-4ES5JGGX.js";import"../chunk-YLQYEDUQ.js";import"../chunk-KCBEE2MC.js";import"../chunk-U277UX5I.js";import"../chunk-YI4QXOVJ.js";import"../chunk-A7FF65FL.js";import"../chunk-7TOQCTHV.js";import"../chunk-RKTF5XLP.js";export{ScreenStoreProvider}from"../chunk-MPF5QZJ7.js";import"../chunk-5545A3PC.js";import"../chunk-BRMYJBMB.js";import"../chunk-PA3PNTVV.js";import"../chunk-5ZBY24K7.js";import"../chunk-BVN33R76.js";import"../chunk-43AEUUNQ.js";import"../chunk-XDZHKYQX.js";import"../chunk-UMDQ6CLQ.js";import"../chunk-M2Z775ZC.js";import"../chunk-WOETW3H6.js";export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSlotMode,sameInspectorMode,screenSlotsOf,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../chunk-XHSGRH42.js";import"../chunk-RFE7ZG3Y.js";import"../chunk-HGV3FWOB.js";import"../chunk-STWSCR25.js";import"../chunk-S4AWJX4Q.js";import"../chunk-ERR437B5.js";import"../chunk-KG7RJWOK.js";import"../chunk-GMCZXMOV.js";export{NO_DOCUMENT_ADDRESSING}from"../chunk-RLBXE4EU.js";import"../chunk-HNKB2ZYR.js";import"../chunk-CLOS6SSX.js";import"../chunk-VPFNZ7TB.js";import"../chunk-LOMEH6DG.js";import"../chunk-KCOBHPN6.js";import"../chunk-R6WTQWAC.js";export{EaselSessionProvider,useEaselSession}from"../chunk-O7Q4DDJT.js";export{EFFICIENT_BACKEND,activateEaselSession,backendOf,createEaselSession,currentEaselSession,deactivateEaselSession,efficientClientOpen,isEfficientBackend,provideDefaultBackend,resetAmbientEaselSession,sessionRegistry,setSessionBridgedSite,setSessionDocumentSite}from"../chunk-RSCMJIWS.js";export{DETACHED_EASEL_HOST,EaselHostContext,EaselHostProvider,createEaselHost,useEaselHost,useHostEscape}from"../chunk-U3JP4VGF.js";import"../chunk-WXFZD7WC.js";import"../chunk-4VJATVVR.js";import"../chunk-C2RHV42O.js";import"../chunk-V7U33NF2.js";import"../chunk-6WY6ZXJG.js";import"../chunk-BHRC3ASL.js";import"../chunk-6W7WLPZH.js";import"../chunk-IQ5TA7AM.js";import"../chunk-DUVRZ456.js";import"../chunk-IYT6NN2J.js";import"../chunk-PLVEGYK6.js";import"../chunk-QEAUF632.js";import"../chunk-TBY3DFKS.js";import"../chunk-5VD2LGIZ.js";import"../chunk-BPXEFVSQ.js";import"../chunk-A6Z4SD3I.js";import"../chunk-BALFHI3G.js";import"../chunk-K56YDHYQ.js";import"../chunk-XWFH2NHZ.js";import"../chunk-YRLPFZW3.js";import"../chunk-RC25EGHD.js";import"../chunk-KFV7N2DJ.js";import"../chunk-OSPUG6S6.js";import"../chunk-WK3AFPXY.js";import"../chunk-X3TYRF5V.js";import"../chunk-NDRZP6YR.js";import"../chunk-H6DDIBQ4.js";import"../chunk-GWIVPLOX.js";import"../chunk-MJM6SFD3.js";import"../chunk-Z6PVRXVY.js";import"../chunk-2OAZYSWJ.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";import"../chunk-23VM4PMV.js";import"../chunk-B4JN227A.js";import"../chunk-2XMHLXMA.js";import"../chunk-G3GWAP5R.js";import"../chunk-WRFD4EXD.js";import"../chunk-36LVP5WD.js";import"../chunk-MFIRYGHW.js";import"../chunk-LLDHIBYG.js";import"../chunk-KAML3KQH.js";import"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-X4T6JT3M.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";import"../chunk-BSPCSC45.js";import"../chunk-I54UCYOU.js";import"../chunk-GOTN2KY4.js";import"../chunk-R5L2E7JX.js";
1
+ import"../chunk-GZO72N3Q.js";export{DocumentScreen,ScreenMount}from"../chunk-4QWTHRMD.js";import"../chunk-GXQCZJOP.js";import"../chunk-QNAPTJRM.js";import"../chunk-2GVCAIPX.js";import"../chunk-26OOWIJJ.js";import"../chunk-VEZPDGDQ.js";import"../chunk-FGNR22NY.js";import"../chunk-LER7RKTO.js";import"../chunk-XHHVMAGM.js";import"../chunk-7F52SZOI.js";import"../chunk-MQNBD6AB.js";import"../chunk-4ES5JGGX.js";import"../chunk-YLQYEDUQ.js";import"../chunk-KCBEE2MC.js";import"../chunk-U277UX5I.js";import"../chunk-X52NFKUS.js";import"../chunk-SNB4LQMK.js";import"../chunk-7TOQCTHV.js";import"../chunk-RKTF5XLP.js";export{ScreenStoreProvider}from"../chunk-DXROGLB5.js";import"../chunk-5545A3PC.js";import"../chunk-2ZWA6ARJ.js";import"../chunk-PA3PNTVV.js";import"../chunk-5ZBY24K7.js";import"../chunk-BVN33R76.js";import"../chunk-43AEUUNQ.js";import"../chunk-XDZHKYQX.js";import"../chunk-UMDQ6CLQ.js";import"../chunk-M2Z775ZC.js";import"../chunk-OBIL7BZO.js";export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSlotMode,sameInspectorMode,screenSlotsOf,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../chunk-W6SDWCOL.js";import"../chunk-RFE7ZG3Y.js";import"../chunk-HGV3FWOB.js";import"../chunk-STWSCR25.js";import"../chunk-S4AWJX4Q.js";import"../chunk-ERR437B5.js";import"../chunk-KG7RJWOK.js";import"../chunk-GMCZXMOV.js";export{NO_DOCUMENT_ADDRESSING}from"../chunk-RLBXE4EU.js";import"../chunk-HNKB2ZYR.js";import"../chunk-CLOS6SSX.js";import"../chunk-VPFNZ7TB.js";import"../chunk-LOMEH6DG.js";import"../chunk-KCOBHPN6.js";import"../chunk-R6WTQWAC.js";export{EaselSessionProvider,useEaselSession}from"../chunk-O7Q4DDJT.js";export{EFFICIENT_BACKEND,activateEaselSession,backendOf,createEaselSession,currentEaselSession,deactivateEaselSession,efficientClientOpen,isEfficientBackend,provideDefaultBackend,resetAmbientEaselSession,sessionRegistry,setSessionBridgedSite,setSessionDocumentSite}from"../chunk-RSCMJIWS.js";export{DETACHED_EASEL_HOST,EaselHostContext,EaselHostProvider,createEaselHost,useEaselHost,useHostEscape}from"../chunk-U3JP4VGF.js";import"../chunk-4VJATVVR.js";import"../chunk-C2RHV42O.js";import"../chunk-V7U33NF2.js";import"../chunk-6WY6ZXJG.js";import"../chunk-BHRC3ASL.js";import"../chunk-6W7WLPZH.js";import"../chunk-IQ5TA7AM.js";import"../chunk-DUVRZ456.js";import"../chunk-IYT6NN2J.js";import"../chunk-PLVEGYK6.js";import"../chunk-QEAUF632.js";import"../chunk-TBY3DFKS.js";import"../chunk-5ZBV5RA6.js";import"../chunk-BPXEFVSQ.js";import"../chunk-A6Z4SD3I.js";import"../chunk-K56YDHYQ.js";import"../chunk-XWFH2NHZ.js";import"../chunk-YRLPFZW3.js";import"../chunk-WXFZD7WC.js";import"../chunk-BALFHI3G.js";import"../chunk-OSPUG6S6.js";import"../chunk-WK3AFPXY.js";import"../chunk-X3TYRF5V.js";import"../chunk-RC25EGHD.js";import"../chunk-KFV7N2DJ.js";import"../chunk-NDRZP6YR.js";import"../chunk-H6DDIBQ4.js";import"../chunk-23VM4PMV.js";import"../chunk-B4JN227A.js";import"../chunk-2XMHLXMA.js";import"../chunk-G3GWAP5R.js";import"../chunk-WRFD4EXD.js";import"../chunk-36LVP5WD.js";import"../chunk-GWIVPLOX.js";import"../chunk-MJM6SFD3.js";import"../chunk-Z6PVRXVY.js";import"../chunk-2OAZYSWJ.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";import"../chunk-MFIRYGHW.js";import"../chunk-LLDHIBYG.js";import"../chunk-KAML3KQH.js";import"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-X4T6JT3M.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";import"../chunk-BSPCSC45.js";import"../chunk-I54UCYOU.js";import"../chunk-GOTN2KY4.js";import"../chunk-R5L2E7JX.js";
@@ -1 +1 @@
1
- export{useSectionOps}from"../../../chunk-A7FF65FL.js";import"../../../chunk-XHSGRH42.js";import"../../../chunk-R6WTQWAC.js";import"../../../chunk-U3JP4VGF.js";import"../../../chunk-PLVEGYK6.js";import"../../../chunk-QEAUF632.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-5VD2LGIZ.js";import"../../../chunk-BPXEFVSQ.js";import"../../../chunk-A6Z4SD3I.js";import"../../../chunk-BALFHI3G.js";import"../../../chunk-K56YDHYQ.js";import"../../../chunk-XWFH2NHZ.js";import"../../../chunk-YRLPFZW3.js";import"../../../chunk-RC25EGHD.js";import"../../../chunk-KFV7N2DJ.js";import"../../../chunk-X3TYRF5V.js";import"../../../chunk-23VM4PMV.js";import"../../../chunk-B4JN227A.js";import"../../../chunk-2XMHLXMA.js";import"../../../chunk-G3GWAP5R.js";import"../../../chunk-WRFD4EXD.js";import"../../../chunk-36LVP5WD.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-67GNT6PF.js";import"../../../chunk-P2VEMZH5.js";import"../../../chunk-X4T6JT3M.js";import"../../../chunk-KRXQM65X.js";import"../../../chunk-NKB3KVAB.js";
1
+ export{useSectionOps}from"../../../chunk-SNB4LQMK.js";import"../../../chunk-W6SDWCOL.js";import"../../../chunk-R6WTQWAC.js";import"../../../chunk-U3JP4VGF.js";import"../../../chunk-PLVEGYK6.js";import"../../../chunk-QEAUF632.js";import"../../../chunk-TBY3DFKS.js";import"../../../chunk-5ZBV5RA6.js";import"../../../chunk-BPXEFVSQ.js";import"../../../chunk-A6Z4SD3I.js";import"../../../chunk-K56YDHYQ.js";import"../../../chunk-XWFH2NHZ.js";import"../../../chunk-YRLPFZW3.js";import"../../../chunk-BALFHI3G.js";import"../../../chunk-X3TYRF5V.js";import"../../../chunk-RC25EGHD.js";import"../../../chunk-KFV7N2DJ.js";import"../../../chunk-23VM4PMV.js";import"../../../chunk-B4JN227A.js";import"../../../chunk-2XMHLXMA.js";import"../../../chunk-G3GWAP5R.js";import"../../../chunk-WRFD4EXD.js";import"../../../chunk-36LVP5WD.js";import"../../../chunk-MFIRYGHW.js";import"../../../chunk-67GNT6PF.js";import"../../../chunk-P2VEMZH5.js";import"../../../chunk-X4T6JT3M.js";import"../../../chunk-KRXQM65X.js";import"../../../chunk-NKB3KVAB.js";
@@ -600,8 +600,12 @@ interface ScreenNewNode {
600
600
  */
601
601
  interface ScreenBlockRules {
602
602
  /** A block that is what its section IS: it may be selected and edited, and
603
- * never removed, hidden, duplicated or dragged. */
604
- isLockedBlock: (type: string | undefined) => boolean;
603
+ * never removed, hidden, duplicated or dragged. `node` is the node itself,
604
+ * where the screen asks of one (every place it does, since 18.1.0): a rule
605
+ * that locks ONE node, not a whole type — a shared section another tab
606
+ * holds (Shared section design v4). A rule that reads the type alone locks
607
+ * by type, as it always did. */
608
+ isLockedBlock: (type: string | undefined, node?: ScreenNode) => boolean;
605
609
  /** Why a second one of this node cannot be made in this document, or null —
606
610
  * a rule of the block's own. */
607
611
  duplicateBlocked: (data: unknown, node: unknown) => string | null;
@@ -1 +1 @@
1
- export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSlotMode,sameInspectorMode,screenSlotsOf,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../../chunk-XHSGRH42.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-QEAUF632.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-5VD2LGIZ.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-A6Z4SD3I.js";import"../../chunk-BALFHI3G.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-X3TYRF5V.js";import"../../chunk-23VM4PMV.js";import"../../chunk-B4JN227A.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-X4T6JT3M.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{SELECTION_MODE,ScreenCanvasTargetProvider,ScreenPartsProvider,isPinnedFirst,isPinnedLast,isSlotMode,sameInspectorMode,screenSlotsOf,useScreenBlockLook,useScreenBlockRules,useScreenBridges,useScreenCanvasDrag,useScreenCanvasFrame,useScreenCanvasHead,useScreenCanvasTarget,useScreenDevices,useScreenDocumentLabel,useScreenDocumentPass,useScreenInspectorPanel,useScreenLeftView,useScreenNodeKeys,useScreenNotify,useScreenOwnerName,useScreenParts,useScreenPickFollowsSelection,useScreenPinned,useScreenSaveSwitch,useScreenStorageNamespace,useScreenStyleClipboard,useStandaloneScreenBridges}from"../../chunk-W6SDWCOL.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-QEAUF632.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-5ZBV5RA6.js";import"../../chunk-BPXEFVSQ.js";import"../../chunk-A6Z4SD3I.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-BALFHI3G.js";import"../../chunk-X3TYRF5V.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-23VM4PMV.js";import"../../chunk-B4JN227A.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-X4T6JT3M.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1,2 +1,2 @@
1
- import{DEFAULT_SCREEN_WORDS as r}from"../chunk-C2RHV42O.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as o}from"../chunk-6WY6ZXJG.js";import{DEFAULT_TEXT_STYLES_WORDS as n}from"../chunk-OGH6CC3E.js";import{DEFAULT_CANVAS_WORDS as t}from"../chunk-TBY3DFKS.js";import{DEFAULT_TREE_WORDS as c}from"../chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as e}from"../chunk-KFV7N2DJ.js";import{DEFAULT_PICK_WORDS as m}from"../chunk-OFBZOI6W.js";import{DEFAULT_NODE_MENU_WORDS as i}from"../chunk-WK3AFPXY.js";import{DEFAULT_SAVE_WORDS as s}from"../chunk-H6DDIBQ4.js";import{DEFAULT_CHROME_WORDS as u,DEFAULT_NOTICE_WORDS as f}from"../chunk-Z6PVRXVY.js";import{DEFAULT_RAIL_WORDS as p}from"../chunk-2OAZYSWJ.js";import{DEFAULT_LOCK_WORDS as l}from"../chunk-RE4LP46F.js";import{DEFAULT_COPY_WORDS as h}from"../chunk-B4JN227A.js";import{DEFAULT_FIELDS_WORDS as j}from"../chunk-WRFD4EXD.js";import{stringsContext as k}from"../chunk-MFIRYGHW.js";import{DEFAULT_DRAG_WORDS as a}from"../chunk-KAML3KQH.js";import{useContext as Y,useMemo as y}from"react";import{jsx as D}from"react/jsx-runtime";var F={notice:f,lock:l,save:s,chrome:u,rail:p,tree:c,panel:e,fields:j,pick:m,drag:a,menu:i,styleClipboard:o,copy:h,canvas:t,textStyles:n,screen:r},d=r=>"object"==typeof r&&null!==r;function v(r,o){const n={};for(const t of Object.keys(r)){const c=r[t],e=o[t];null==e?n[t]=c:d(c)?n[t]=d(e)?v(c,e):c:n[t]=typeof e==typeof c?e:c}return n}function H(r,o){return o?v(r,o):r}function K({value:r,locale:o,children:n}){const t=k(),c=Y(t),e=c?.strings??F,m=o??c?.locale??"en",i=y(()=>({strings:H(e,r),locale:m}),[e,r,m]);/* @__PURE__ */
1
+ import{DEFAULT_SCREEN_WORDS as r}from"../chunk-C2RHV42O.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as o}from"../chunk-6WY6ZXJG.js";import{DEFAULT_TEXT_STYLES_WORDS as n}from"../chunk-OGH6CC3E.js";import{DEFAULT_PICK_WORDS as t}from"../chunk-OFBZOI6W.js";import{DEFAULT_CANVAS_WORDS as c}from"../chunk-TBY3DFKS.js";import{DEFAULT_TREE_WORDS as e}from"../chunk-K56YDHYQ.js";import{DEFAULT_NODE_MENU_WORDS as m}from"../chunk-WK3AFPXY.js";import{DEFAULT_PANEL_WORDS as i}from"../chunk-KFV7N2DJ.js";import{DEFAULT_SAVE_WORDS as s}from"../chunk-H6DDIBQ4.js";import{DEFAULT_COPY_WORDS as u}from"../chunk-B4JN227A.js";import{DEFAULT_FIELDS_WORDS as f}from"../chunk-WRFD4EXD.js";import{DEFAULT_CHROME_WORDS as p,DEFAULT_NOTICE_WORDS as l}from"../chunk-Z6PVRXVY.js";import{DEFAULT_RAIL_WORDS as h}from"../chunk-2OAZYSWJ.js";import{DEFAULT_LOCK_WORDS as j}from"../chunk-RE4LP46F.js";import{stringsContext as k}from"../chunk-MFIRYGHW.js";import{DEFAULT_DRAG_WORDS as a}from"../chunk-KAML3KQH.js";import{useContext as Y,useMemo as y}from"react";import{jsx as D}from"react/jsx-runtime";var F={notice:l,lock:j,save:s,chrome:p,rail:h,tree:e,panel:i,fields:f,pick:t,drag:a,menu:m,styleClipboard:o,copy:u,canvas:c,textStyles:n,screen:r},d=r=>"object"==typeof r&&null!==r;function v(r,o){const n={};for(const t of Object.keys(r)){const c=r[t],e=o[t];null==e?n[t]=c:d(c)?n[t]=d(e)?v(c,e):c:n[t]=typeof e==typeof c?e:c}return n}function H(r,o){return o?v(r,o):r}function K({value:r,locale:o,children:n}){const t=k(),c=Y(t),e=c?.strings??F,m=o??c?.locale??"en",i=y(()=>({strings:H(e,r),locale:m}),[e,r,m]);/* @__PURE__ */
2
2
  return D(t.Provider,{value:i,children:n})}function O(){return Y(k())?.strings??F}function W(){return Y(k())?.locale??"en"}export{F as DEFAULT_EASEL_STRINGS,K as EaselStringsProvider,H as mergeEaselStrings,W as useEaselLocale,O as useEaselStrings};
@@ -1,32 +1,32 @@
1
- import{DEFAULT_TEXT_STYLES_WORDS as e}from"../chunk-OGH6CC3E.js";export{DEFAULT_TEXT_STYLES_WORDS}from"../chunk-OGH6CC3E.js";import{FieldSlider as s}from"../chunk-XWFH2NHZ.js";import{hexReadout as t,ColourWindow as a,typedHex as n}from"../chunk-U6LJ5UKD.js";import"../chunk-OFBZOI6W.js";import{TEXT_STYLE_KINDS as l,canAddTextStyle as i,TEXT_STYLE_MAX as r,isDefaultTextStyle as o,CAMPAIGN_TEXT_STYLE_SETTINGS as d,TEXT_STYLE_SETTINGS as c,textStyleRowSize as u,describeTextStyle as m,updateTextStyle as h,textStyleCaseCss as f,TEXT_STYLE_CASES as p,addTextStyle as v,removeTextStyle as y,TEXT_STYLE_RANGES as S}from"../chunk-YHZSBL2N.js";export{CAMPAIGN_TEXT_STYLE_SETTINGS,TEXT_STYLE_CASES,TEXT_STYLE_CASE_CSS,TEXT_STYLE_DEFAULT_COUNT,TEXT_STYLE_KINDS,TEXT_STYLE_MAX,TEXT_STYLE_RANGES,TEXT_STYLE_SETTINGS,addTextStyle,canAddTextStyle,defaultTextStyles,describeTextStyle,isDefaultTextStyle,isTextStyleCase,removeTextStyle,resolveTextStyle,textStyleCaseCss,textStyleCaseOfCss,textStyleRowSize,updateTextStyle,weightWord}from"../chunk-YHZSBL2N.js";import{FieldSelect as g}from"../chunk-G3GWAP5R.js";import"../chunk-WRFD4EXD.js";import{useWords as b}from"../chunk-MFIRYGHW.js";import{withTip as k}from"../chunk-P2VEMZH5.js";import{hsvToHex as N,Tooltip as C,ColorSwatch as x,IconButton as T}from"efficient-shell/ui";import{useState as w,useRef as z,useId as E,useEffect as O,Fragment as _}from"react";import{TrashIcon as L,ChevronIcon as A,BoldIcon as j,ItalicIcon as M,CaseLowerIcon as W,CaseCapitalizedIcon as $,CaseUpperIcon as D,CaseNormalIcon as X}from"efficient-shell/icons/efficient";import{jsxs as Y,jsx as I,Fragment as F}from"react/jsx-runtime";var G=`conic-gradient(${[0,60,120,180,240,300,0].map(e=>N({h:e,s:1,v:1})).join(", ")})`;function H({value:e,hex:s,colours:n,label:l,followsWord:i,anyWord:r,onChange:o,readOnly:d=!1}){const[c,u]=w(!1),m=z(null),h=z(null),f=E(),p=void 0!==e&&n.some(s=>s.key===e),v=void 0!==e&&!p;return O(()=>{if(!c)return;const e=m.current?.ownerDocument;if(!e)return;const s=e=>{m.current&&!m.current.contains(e.target)&&u(!1)};return e.addEventListener("click",s,!0),()=>e.removeEventListener("click",s,!0)},[c]),/* @__PURE__ */Y("div",{ref:m,className:"es-ts-set","data-ts-setting":"color",children:[
1
+ import{hexReadout as e,ColourWindow as s,typedHex as t}from"../chunk-U6LJ5UKD.js";import{DEFAULT_TEXT_STYLES_WORDS as a}from"../chunk-OGH6CC3E.js";export{DEFAULT_TEXT_STYLES_WORDS}from"../chunk-OGH6CC3E.js";import"../chunk-OFBZOI6W.js";import{FieldSlider as n}from"../chunk-XWFH2NHZ.js";import{TEXT_STYLE_KINDS as l,canAddTextStyle as i,TEXT_STYLE_MAX as r,isDefaultTextStyle as o,CAMPAIGN_TEXT_STYLE_SETTINGS as d,TEXT_STYLE_SETTINGS as c,textStyleRowSize as u,describeTextStyle as m,updateTextStyle as h,textStyleCaseCss as f,TEXT_STYLE_CASES as p,addTextStyle as v,removeTextStyle as y,TEXT_STYLE_RANGES as S}from"../chunk-YHZSBL2N.js";export{CAMPAIGN_TEXT_STYLE_SETTINGS,TEXT_STYLE_CASES,TEXT_STYLE_CASE_CSS,TEXT_STYLE_DEFAULT_COUNT,TEXT_STYLE_KINDS,TEXT_STYLE_MAX,TEXT_STYLE_RANGES,TEXT_STYLE_SETTINGS,addTextStyle,canAddTextStyle,defaultTextStyles,describeTextStyle,isDefaultTextStyle,isTextStyleCase,removeTextStyle,resolveTextStyle,textStyleCaseCss,textStyleCaseOfCss,textStyleRowSize,updateTextStyle,weightWord}from"../chunk-YHZSBL2N.js";import{FieldSelect as g}from"../chunk-G3GWAP5R.js";import"../chunk-WRFD4EXD.js";import{useWords as b}from"../chunk-MFIRYGHW.js";import{withTip as k}from"../chunk-P2VEMZH5.js";import{hsvToHex as N,Tooltip as C,ColorSwatch as x,IconButton as T}from"efficient-shell/ui";import{useState as w,useRef as z,useId as E,useEffect as O,Fragment as _}from"react";import{TrashIcon as L,ChevronIcon as A,BoldIcon as j,ItalicIcon as M,CaseLowerIcon as W,CaseCapitalizedIcon as $,CaseUpperIcon as D,CaseNormalIcon as X}from"efficient-shell/icons/efficient";import{jsxs as Y,jsx as I,Fragment as F}from"react/jsx-runtime";var G=`conic-gradient(${[0,60,120,180,240,300,0].map(e=>N({h:e,s:1,v:1})).join(", ")})`;function H({value:t,hex:a,colours:n,label:l,followsWord:i,anyWord:r,onChange:o,readOnly:d=!1}){const[c,u]=w(!1),m=z(null),h=z(null),f=E(),p=void 0!==t&&n.some(e=>e.key===t),v=void 0!==t&&!p;return O(()=>{if(!c)return;const e=m.current?.ownerDocument;if(!e)return;const s=e=>{m.current&&!m.current.contains(e.target)&&u(!1)};return e.addEventListener("click",s,!0),()=>e.removeEventListener("click",s,!0)},[c]),/* @__PURE__ */Y("div",{ref:m,className:"es-ts-set","data-ts-setting":"color",children:[
2
2
  /* @__PURE__ */Y("div",{className:"es-ts-top",children:[
3
3
  /* @__PURE__ */I("span",{className:"es-ts-sub",children:l}),
4
- /* @__PURE__ */I("span",{className:"es-ts-colour-read",children:s?t(s):i})]}),
5
- /* @__PURE__ */Y("div",{className:"es-ts-swatches",role:"group","aria-label":l,children:[n.map(s=>/* @__PURE__ */I(C,{content:`${s.name} · ${t(s.value)}`,children:/* @__PURE__ */I(x,{color:s.value,size:"sm",className:"es-ts-swatch","aria-label":s.name,selected:e===s.key,disabled:d,onClick:()=>o(s.key)})},s.key)),
6
- /* @__PURE__ */I(C,{content:r,children:/* @__PURE__ */I(x,{ref:h,color:G,size:"sm",className:"es-ts-swatch es-ts-swatch--any","aria-label":r,selected:v,"aria-expanded":c,"aria-controls":c?f:void 0,disabled:d,onClick:()=>u(e=>!e)})})]}),c?/* @__PURE__ */I(a,{id:f,value:s??"",onChange:e=>o(e),label:l,readOnly:d,onClose:()=>{u(!1),h.current?.focus()}}):null]})}function P({styles:s,onChange:t,fonts:a,colours:n=[],settings:c=d,auto:u=[],fallback:m,sample:h,openId:f,defaultOpenId:p=null,onOpenChange:S,onAdd:g,rowActions:N,onRemove:C,max:x=r,device:T="desktop",readOnly:_=!1}){const A=b("textStyles",e),j=E(),[M,W]=w(p),$=void 0!==f?f:M,D=e=>{void 0===f&&W(e),S?.(e)},X=z(null),[G,H]=w(null);O(()=>{if(!G||!X.current)return;const e=[...X.current.querySelectorAll(".es-ts-item")].find(e=>e.dataset.tsId===G.id),s=e?e.querySelector(".es-ts-row"):X.current.querySelector(`.es-ts-add[data-ts-kind="${G.kind}"]`);s?.focus(),H(null)},[G]);/* @__PURE__ */
7
- return I("div",{className:"es-ts",ref:X,children:l.map(e=>{const l=s.filter(s=>s.kind===e),r=!i(s,e,x),d=!_&&!r;/* @__PURE__ */
8
- return Y(R,{label:A.groups[e],children:[l.map(e=>{const l=N?.(e),i=null!=l&&!1!==l,r=Boolean(C)&&!_&&!o(e);/* @__PURE__ */
9
- return I(B,{style:e,fonts:a,colours:n,settings:c,auto:u,fallback:m,sample:h,device:T,readOnly:_,open:$===e.id,onOpenChange:s=>D(s?e.id:null),onChange:e=>t(s.map(s=>s.id===e.id?e:s)),actions:r||i?/* @__PURE__ */Y(F,{children:[r?k(A.remove,/* @__PURE__ */I("button",{type:"button",className:"es-ts-del","aria-label":A.removeNamed({name:e.name}),onClick:()=>(e=>{if(_||!C)return;const a=y(s,e.id,{name:A.styleName});if(!a)return;const n=s.filter(s=>s.kind===e.kind),l=n[n.indexOf(e)+1];$===e.id&&D(null),t(a.styles),C(a.removed),H({id:l?.id??null,kind:e.kind})})(e),children:/* @__PURE__ */I(L,{size:14,"aria-hidden":"true"})})):null,i?l:null]}):null},e.id)}),k(!_&&r?A.full({kind:e,max:x}):void 0,/* @__PURE__ */Y("button",{type:"button",className:"es-ts-add","data-ts-kind":e,disabled:_,"aria-disabled":!(_||!r)||void 0,"aria-describedby":!_&&r?`${j}-full-${e}`:void 0,onClick:()=>{d&&(e=>{if(_)return;const a=v(s,e,{max:x,name:A.styleName,make:g});a&&t(a.styles)})(e)},children:[
10
- /* @__PURE__ */I("span",{className:"es-ts-add-word",children:A.add[e]}),
11
- /* @__PURE__ */I("span",{className:"es-ts-count",children:A.count({n:l.length,max:x})})]})),_||!r?null:/* @__PURE__ */I("span",{id:`${j}-full-${e}`,className:"es-vh",children:A.full({kind:e,max:x})})]},e)})})}function R({label:e,children:s}){const t=E();/* @__PURE__ */
4
+ /* @__PURE__ */I("span",{className:"es-ts-colour-read",children:a?e(a):i})]}),
5
+ /* @__PURE__ */Y("div",{className:"es-ts-swatches",role:"group","aria-label":l,children:[n.map(s=>/* @__PURE__ */I(C,{content:`${s.name} · ${e(s.value)}`,children:/* @__PURE__ */I(x,{color:s.value,size:"sm",className:"es-ts-swatch","aria-label":s.name,selected:t===s.key,disabled:d,onClick:()=>o(s.key)})},s.key)),
6
+ /* @__PURE__ */I(C,{content:r,children:/* @__PURE__ */I(x,{ref:h,color:G,size:"sm",className:"es-ts-swatch es-ts-swatch--any","aria-label":r,selected:v,"aria-expanded":c,"aria-controls":c?f:void 0,disabled:d,onClick:()=>u(e=>!e)})})]}),c?/* @__PURE__ */I(s,{id:f,value:a??"",onChange:e=>o(e),label:l,readOnly:d,onClose:()=>{u(!1),h.current?.focus()}}):null]})}function P({styles:e,onChange:s,fonts:t,colours:n=[],settings:c=d,auto:u=[],fallback:m,sample:h,openId:f,defaultOpenId:p=null,onOpenChange:S,onAdd:g,rowActions:N,onRemove:C,max:x=r,device:T="desktop",readOnly:_=!1}){const A=b("textStyles",a),j=E(),[M,W]=w(p),$=void 0!==f?f:M,D=e=>{void 0===f&&W(e),S?.(e)},X=z(null),[G,H]=w(null);O(()=>{if(!G||!X.current)return;const e=[...X.current.querySelectorAll(".es-ts-item")].find(e=>e.dataset.tsId===G.id),s=e?e.querySelector(".es-ts-row"):X.current.querySelector(`.es-ts-add[data-ts-kind="${G.kind}"]`);s?.focus(),H(null)},[G]);/* @__PURE__ */
7
+ return I("div",{className:"es-ts",ref:X,children:l.map(a=>{const l=e.filter(e=>e.kind===a),r=!i(e,a,x),d=!_&&!r;/* @__PURE__ */
8
+ return Y(R,{label:A.groups[a],children:[l.map(a=>{const l=N?.(a),i=null!=l&&!1!==l,r=Boolean(C)&&!_&&!o(a);/* @__PURE__ */
9
+ return I(B,{style:a,fonts:t,colours:n,settings:c,auto:u,fallback:m,sample:h,device:T,readOnly:_,open:$===a.id,onOpenChange:e=>D(e?a.id:null),onChange:t=>s(e.map(e=>e.id===t.id?t:e)),actions:r||i?/* @__PURE__ */Y(F,{children:[r?k(A.remove,/* @__PURE__ */I("button",{type:"button",className:"es-ts-del","aria-label":A.removeNamed({name:a.name}),onClick:()=>(t=>{if(_||!C)return;const a=y(e,t.id,{name:A.styleName});if(!a)return;const n=e.filter(e=>e.kind===t.kind),l=n[n.indexOf(t)+1];$===t.id&&D(null),s(a.styles),C(a.removed),H({id:l?.id??null,kind:t.kind})})(a),children:/* @__PURE__ */I(L,{size:14,"aria-hidden":"true"})})):null,i?l:null]}):null},a.id)}),k(!_&&r?A.full({kind:a,max:x}):void 0,/* @__PURE__ */Y("button",{type:"button",className:"es-ts-add","data-ts-kind":a,disabled:_,"aria-disabled":!(_||!r)||void 0,"aria-describedby":!_&&r?`${j}-full-${a}`:void 0,onClick:()=>{d&&(t=>{if(_)return;const a=v(e,t,{max:x,name:A.styleName,make:g});a&&s(a.styles)})(a)},children:[
10
+ /* @__PURE__ */I("span",{className:"es-ts-add-word",children:A.add[a]}),
11
+ /* @__PURE__ */I("span",{className:"es-ts-count",children:A.count({n:l.length,max:x})})]})),_||!r?null:/* @__PURE__ */I("span",{id:`${j}-full-${a}`,className:"es-vh",children:A.full({kind:a,max:x})})]},a)})})}function R({label:e,children:s}){const t=E();/* @__PURE__ */
12
12
  return Y("section",{className:"es-ts-section","aria-labelledby":t,children:[
13
- /* @__PURE__ */I("div",{className:"es-ts-group",id:t,children:e}),s]})}function B({style:s,fonts:t,colours:a=[],settings:n=d,auto:l=[],fallback:i,sample:r,open:o,onOpenChange:f,onChange:p,actions:v,device:y="desktop",readOnly:S=!1}){const g=b("textStyles",e),k=`${E()}-open-${s.id}`,N=new Set(l),C=c.filter(e=>n.includes(e)),x={...i?.(s)??{},...s.values},T="phone"===y,w=T&&void 0!==s.values.sizePhone?{...x,size:s.values.sizePhone}:x,z=t.find(e=>e.value===x.font),O={fontFamily:z?.family,fontSize:`${u(w.size??16)}px`,fontWeight:x.weight,fontStyle:x.italic?"italic":void 0};/* @__PURE__ */
13
+ /* @__PURE__ */I("div",{className:"es-ts-group",id:t,children:e}),s]})}function B({style:e,fonts:s,colours:t=[],settings:n=d,auto:l=[],fallback:i,sample:r,open:o,onOpenChange:f,onChange:p,actions:v,device:y="desktop",readOnly:S=!1}){const g=b("textStyles",a),k=`${E()}-open-${e.id}`,N=new Set(l),C=c.filter(e=>n.includes(e)),x={...i?.(e)??{},...e.values},T="phone"===y,w=T&&void 0!==e.values.sizePhone?{...x,size:e.values.sizePhone}:x,z=s.find(e=>e.value===x.font),O={fontFamily:z?.family,fontSize:`${u(w.size??16)}px`,fontWeight:x.weight,fontStyle:x.italic?"italic":void 0};/* @__PURE__ */
14
14
  return Y(_,{children:[
15
- /* @__PURE__ */Y("div",{className:"es-ts-item","data-ts-id":s.id,children:[
15
+ /* @__PURE__ */Y("div",{className:"es-ts-item","data-ts-id":e.id,children:[
16
16
  /* @__PURE__ */Y("button",{type:"button",className:"es-ts-row","aria-expanded":o,"aria-controls":o?k:void 0,onClick:()=>f(!o),children:[
17
17
  /* @__PURE__ */I("span",{className:"es-ts-chev","aria-hidden":"true",children:/* @__PURE__ */I(A,{size:12})}),
18
- /* @__PURE__ */I("span",{className:"es-ts-name",style:O,children:s.name}),
19
- /* @__PURE__ */I("span",{className:"es-ts-meta",children:m(w,t,g,{autoSize:N.has("size")&&w===x&&void 0===s.values.size})})]}),v?/* @__PURE__ */I("div",{className:"es-ts-actions",children:v}):null]}),o?/* @__PURE__ */I("div",{className:"es-ts-open",id:k,children:/* @__PURE__ */I(Z,{style:s,values:x,fonts:t,colours:a,settings:C,autoSet:N,sample:r??g.sample,words:g,phone:T,readOnly:S,set:e=>p(h([s],s.id,e)[0])})}):null]})}var U={none:X,upper:D,capitalize:$,lower:W};function Z({style:e,values:t,fonts:a,colours:l,settings:i,autoSet:r,sample:o,words:d,phone:c,readOnly:u,set:m}){const h=e.values,p=a.find(e=>e.value===t.font),v=function(e,s){return e?s.find(s=>s.key===e)?.value??n(e)??void 0:void 0}(t.color,l),y=e=>"largestSize"===e||r.has(e),g=e=>y(e)?h[e]:t[e],b=g("size"),N=c&&void 0!==h.sizePhone?h.sizePhone:b,C=g("lineSpacing"),x=g("letterSpacing"),w=y("letterCase")?h.letterCase:t.letterCase,z={fontFamily:p?.family,fontSize:void 0===N?void 0:`${N}px`,fontWeight:t.weight,fontStyle:t.italic?"italic":void 0,lineHeight:void 0===C?void 0:String(C/100),letterSpacing:void 0===x?void 0:`${x}px`,color:v,textTransform:f(w)},E=e=>{const a=S[e],n=y(e);/* @__PURE__ */
20
- return I("div",{className:"es-ts-slider","data-ts-setting":e,children:/* @__PURE__ */I(s,{label:d.settings[e],value:h[e],onChange:s=>m({[e]:s}),min:a.min,max:a.max,step:a.step,shiftStep:a.shiftStep,sliderMin:a.sliderMin,sliderMax:a.sliderMax,unit:a.unit||void 0,styleValue:n?void 0:t[e],auto:n?d.auto:void 0,readOnly:u})},e)};/* @__PURE__ */
18
+ /* @__PURE__ */I("span",{className:"es-ts-name",style:O,children:e.name}),
19
+ /* @__PURE__ */I("span",{className:"es-ts-meta",children:m(w,s,g,{autoSize:N.has("size")&&w===x&&void 0===e.values.size})})]}),v?/* @__PURE__ */I("div",{className:"es-ts-actions",children:v}):null]}),o?/* @__PURE__ */I("div",{className:"es-ts-open",id:k,children:/* @__PURE__ */I(Z,{style:e,values:x,fonts:s,colours:t,settings:C,autoSet:N,sample:r??g.sample,words:g,phone:T,readOnly:S,set:s=>p(h([e],e.id,s)[0])})}):null]})}var U={none:X,upper:D,capitalize:$,lower:W};function Z({style:e,values:s,fonts:a,colours:l,settings:i,autoSet:r,sample:o,words:d,phone:c,readOnly:u,set:m}){const h=e.values,p=a.find(e=>e.value===s.font),v=function(e,s){return e?s.find(s=>s.key===e)?.value??t(e)??void 0:void 0}(s.color,l),y=e=>"largestSize"===e||r.has(e),g=e=>y(e)?h[e]:s[e],b=g("size"),N=c&&void 0!==h.sizePhone?h.sizePhone:b,C=g("lineSpacing"),x=g("letterSpacing"),w=y("letterCase")?h.letterCase:s.letterCase,z={fontFamily:p?.family,fontSize:void 0===N?void 0:`${N}px`,fontWeight:s.weight,fontStyle:s.italic?"italic":void 0,lineHeight:void 0===C?void 0:String(C/100),letterSpacing:void 0===x?void 0:`${x}px`,color:v,textTransform:f(w)},E=e=>{const t=S[e],a=y(e);/* @__PURE__ */
20
+ return I("div",{className:"es-ts-slider","data-ts-setting":e,children:/* @__PURE__ */I(n,{label:d.settings[e],value:h[e],onChange:s=>m({[e]:s}),min:t.min,max:t.max,step:t.step,shiftStep:t.shiftStep,sliderMin:t.sliderMin,sliderMax:t.sliderMax,unit:t.unit||void 0,styleValue:a?void 0:s[e],auto:a?d.auto:void 0,readOnly:u})},e)};/* @__PURE__ */
21
21
  return Y(F,{children:[
22
- /* @__PURE__ */I("div",{className:"es-ts-preview",style:z,"aria-label":d.preview,children:o}),i.map(n=>{switch(n){case"font":/* @__PURE__ */
23
- return I(q,{value:h.font,fonts:a,words:d,readOnly:u,set:m},n);case"color":/* @__PURE__ */
24
- return I(K,{value:h.color,hex:v,colours:l,words:d,readOnly:u,set:m},n);case"emphasis":{const e=(t.weight??400)>=600,s=!1!==p?.italic;/* @__PURE__ */
25
- return Y("div",{className:"es-ts-set","data-ts-setting":n,children:[
22
+ /* @__PURE__ */I("div",{className:"es-ts-preview",style:z,"aria-label":d.preview,children:o}),i.map(t=>{switch(t){case"font":/* @__PURE__ */
23
+ return I(q,{value:h.font,fonts:a,words:d,readOnly:u,set:m},t);case"color":/* @__PURE__ */
24
+ return I(K,{value:h.color,hex:v,colours:l,words:d,readOnly:u,set:m},t);case"emphasis":{const e=(s.weight??400)>=600,a=!1!==p?.italic;/* @__PURE__ */
25
+ return Y("div",{className:"es-ts-set","data-ts-setting":t,children:[
26
26
  /* @__PURE__ */I("span",{className:"es-ts-sub",children:d.settings.emphasis}),
27
- /* @__PURE__ */Y("div",{className:"es-ts-icons",children:[k(d.bold,/* @__PURE__ */I(T,{className:"es-ts-icon","aria-label":d.bold,"aria-pressed":e,disabled:u,onClick:()=>m({weight:e?400:700}),children:/* @__PURE__ */I(j,{size:16})})),u||s?k(d.italic,/* @__PURE__ */I(T,{className:"es-ts-icon","aria-label":d.italic,"aria-pressed":Boolean(t.italic),disabled:u,onClick:()=>m({italic:!t.italic||void 0}),children:/* @__PURE__ */I(M,{size:16})})):/* @__PURE__ */I(T,{className:"es-ts-icon","aria-label":d.italic,"aria-pressed":Boolean(t.italic),"aria-disabled":!0,disabledReason:d.italicMissing,children:/* @__PURE__ */I(M,{size:16})})]})]},n)}case"letterCase":/* @__PURE__ */
28
- return I(V,{value:h.letterCase??t.letterCase,auto:y("letterCase"),words:d,readOnly:u,set:m},n);case"largestSize":return"heading"===e.kind?E(n):null;case"size":return c?(()=>{const e=S.size;/* @__PURE__ */
29
- return I("div",{className:"es-ts-slider","data-ts-setting":"size","data-ts-device":"phone",children:/* @__PURE__ */I(s,{label:d.settings.size,value:h.sizePhone,onChange:e=>m({sizePhone:e}),min:e.min,max:e.max,step:e.step,shiftStep:e.shiftStep,sliderMin:e.sliderMin,sliderMax:e.sliderMax,unit:e.unit||void 0,styleValue:b,readOnly:u})},"size")})():E(n);default:return E(n)}})]})}function q({value:e,fonts:s,words:t,readOnly:a,set:n}){const l=E();/* @__PURE__ */
27
+ /* @__PURE__ */Y("div",{className:"es-ts-icons",children:[k(d.bold,/* @__PURE__ */I(T,{className:"es-ts-icon","aria-label":d.bold,"aria-pressed":e,disabled:u,onClick:()=>m({weight:e?400:700}),children:/* @__PURE__ */I(j,{size:16})})),u||a?k(d.italic,/* @__PURE__ */I(T,{className:"es-ts-icon","aria-label":d.italic,"aria-pressed":Boolean(s.italic),disabled:u,onClick:()=>m({italic:!s.italic||void 0}),children:/* @__PURE__ */I(M,{size:16})})):/* @__PURE__ */I(T,{className:"es-ts-icon","aria-label":d.italic,"aria-pressed":Boolean(s.italic),"aria-disabled":!0,disabledReason:d.italicMissing,children:/* @__PURE__ */I(M,{size:16})})]})]},t)}case"letterCase":/* @__PURE__ */
28
+ return I(V,{value:h.letterCase??s.letterCase,auto:y("letterCase"),words:d,readOnly:u,set:m},t);case"largestSize":return"heading"===e.kind?E(t):null;case"size":return c?(()=>{const e=S.size;/* @__PURE__ */
29
+ return I("div",{className:"es-ts-slider","data-ts-setting":"size","data-ts-device":"phone",children:/* @__PURE__ */I(n,{label:d.settings.size,value:h.sizePhone,onChange:e=>m({sizePhone:e}),min:e.min,max:e.max,step:e.step,shiftStep:e.shiftStep,sliderMin:e.sliderMin,sliderMax:e.sliderMax,unit:e.unit||void 0,styleValue:b,readOnly:u})},"size")})():E(t);default:return E(t)}})]})}function q({value:e,fonts:s,words:t,readOnly:a,set:n}){const l=E();/* @__PURE__ */
30
30
  return Y("div",{className:"es-ts-set","data-ts-setting":"font",children:[
31
31
  /* @__PURE__ */I("span",{className:"es-ts-sub",id:l,children:t.settings.font}),
32
32
  /* @__PURE__ */I(g,{value:e,options:s.map(e=>({label:e.label,value:e.value})),onChange:e=>n({font:e}),ariaLabelledBy:l,readOnly:a})]})}function K({value:e,hex:s,colours:t,words:a,readOnly:n,set:l}){/* @__PURE__ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-easel",
3
- "version": "18.0.0",
3
+ "version": "18.1.0",
4
4
  "description": "Efficient Easel: the EFFICIENT editors' shared engine and chrome: the saved document as pure functions, the published renderer, and the editor frame, panels, Layers tree, text grammar and type-in-place box. Published as editor-shell up to 0.66.0 and as efficient-editor up to 0.95.0.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Efficient Pty Ltd",