efficient-easel 12.1.0 → 13.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/{chunk-NQXFINT2.js → chunk-52LIZZG4.js} +4 -4
  2. package/dist/chunk-6RLEHTMK.js +1 -0
  3. package/dist/{chunk-ZIFDZGY7.js → chunk-FBS75I6E.js} +1 -1
  4. package/dist/chunk-FUMIBYUU.js +57 -0
  5. package/dist/{chunk-ENXLPJ77.js → chunk-IWFVVCRN.js} +1 -1
  6. package/dist/{chunk-O5XI3WAQ.js → chunk-NW4LJ4G4.js} +1 -1
  7. package/dist/chunk-OG2SKSSK.js +2 -0
  8. package/dist/{chunk-WUSJ6SSF.js → chunk-YWUHPY5W.js} +1 -1
  9. package/dist/draw/client.js +1 -1
  10. package/dist/icons/index.d.ts +3 -2
  11. package/dist/icons/index.js +1 -1
  12. package/dist/icons/meanings.d.ts +1 -0
  13. package/dist/icons/meanings.js +1 -0
  14. package/dist/screen/components/AddSidePanel.js +1 -1
  15. package/dist/screen/components/MediaSidePanel.js +1 -1
  16. package/dist/screen/components/NodeContextMenu.d.ts +2 -2
  17. package/dist/screen/components/NodeContextMenu.js +1 -1
  18. package/dist/screen/components/PageEditGuardNotices.js +1 -1
  19. package/dist/screen/components/SaveControls.d.ts +2 -2
  20. package/dist/screen/components/ScreenChrome.js +1 -1
  21. package/dist/screen/components/ScreenDocumentContext.js +1 -1
  22. package/dist/screen/components/ScreenMount.d.ts +1 -1
  23. package/dist/screen/components/ScreenMount.js +1 -1
  24. package/dist/screen/components/ScreenStoreProvider.d.ts +2 -2
  25. package/dist/screen/components/SectionScreenShell.js +14 -14
  26. package/dist/screen/components/UiIcon.d.ts +3 -1
  27. package/dist/screen/components/UiIcon.js +1 -1
  28. package/dist/screen/components/usePartBridge.d.ts +2 -2
  29. package/dist/screen/index.d.ts +2 -2
  30. package/dist/screen/index.js +1 -1
  31. package/dist/screen/lib/puck/style-clipboard.d.ts +2 -2
  32. package/dist/screen/lib/puck/style-clipboard.js +1 -1
  33. package/dist/screen/lib/screen-parts.d.ts +2 -2
  34. package/dist/strings/catalogue.js +1 -1
  35. package/dist/strings/index.js +1 -1
  36. package/dist/tree/index.d.ts +3 -2
  37. package/dist/{types-BLRK6_JO.d.ts → types-D8P9q-BG.d.ts} +7 -2
  38. package/package.json +8 -3
  39. package/dist/chunk-5AIA5VIP.js +0 -1
  40. package/dist/chunk-6OA4UXKZ.js +0 -2
  41. package/dist/chunk-GYNIDJKN.js +0 -57
@@ -1,7 +1,7 @@
1
- import{clientOnly as r}from"./chunk-GXQCZJOP.js";import{ScreenChrome as n}from"./chunk-GYNIDJKN.js";import{ScreenStoreProvider as e}from"./chunk-J54OXLQF.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-ZIFDZGY7.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-VVPZMWJE.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 k=r(e),N=r(n);function C({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 k=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-FUMIBYUU.js";import{ScreenStoreProvider as e}from"./chunk-J54OXLQF.js";import{ScreenDocumentProvider as i,useScreenDocument as a}from"./chunk-FBS75I6E.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-VVPZMWJE.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 k=r(e),C=r(n);function j({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 k=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
- /* @__PURE__ */u(f,{variant:"primary",loading:a,onClick:()=>{k()},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 Z({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(),Z=t(()=>s(!g),[g]),D=c("screen",o);return l?/* @__PURE__ */u("div",{className:"sf-msg",children:D.loading}):d?/* @__PURE__ */u("div",{className:"sf-msg sf-msg--error",children:d}):m?i?e(
7
- /* @__PURE__ */u(k,{config:r,data:i,onChange:h,permissions:Z,parts:n,children:/* @__PURE__ */u(N,{})}),f&&/* @__PURE__ */u(C,{onCancel:p,onDiscard:v,onSave:j})):/* @__PURE__ */u("div",{className:"sf-msg",children:D.loading}):/* @__PURE__ */u("div",{className:"sf-msg",children:D.waitingForAuthorization})}export{Z as DocumentScreen,j as ScreenMount};
5
+ /* @__PURE__ */u(f,{variant:"primary",loading:a,onClick:()=>{k()},children:i.save})]}),children:i.body})}function y({target:r,addressing:n,onHostMessage:e,children:a}){/* @__PURE__ */
6
+ return u(i,{target:r,addressing:n,onHostMessage:e,children:a})}var N=(r,n)=>/* @__PURE__ */p(v,{children:[r,n]});function F({config:r,parts:n,wrap:e=N}){const{data:i,error:d,redirecting:l,ready:m,readOnly:g,onChange:h,pendingNav:f,cancelPendingNav:p,discardAndNavigate:v,saveAndNavigate:y}=a(),F=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(k,{config:r,data:i,onChange:h,permissions:F,parts:n,children:/* @__PURE__ */u(C,{})}),f&&/* @__PURE__ */u(j,{onCancel:p,onDiscard:v,onSave:y})):/* @__PURE__ */u("div",{className:"sf-msg",children:M.loading}):/* @__PURE__ */u("div",{className:"sf-msg",children:M.waitingForAuthorization})}export{F as DocumentScreen,y as ScreenMount};
@@ -0,0 +1 @@
1
+ import{DEFAULT_TEXT_STYLES_WORDS as o}from"./chunk-OGH6CC3E.js";import{DEFAULT_PICK_WORDS as r}from"./chunk-643PVCEG.js";import{DEFAULT_SCREEN_WORDS as t}from"./chunk-VVPZMWJE.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as m}from"./chunk-6WY6ZXJG.js";import{DEFAULT_NODE_MENU_WORDS as n}from"./chunk-WK3AFPXY.js";import{DEFAULT_CANVAS_WORDS as c}from"./chunk-TBY3DFKS.js";import{DEFAULT_TREE_WORDS as s}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as f}from"./chunk-KFV7N2DJ.js";import{DEFAULT_SAVE_WORDS as p}from"./chunk-H6DDIBQ4.js";import{DEFAULT_COPY_WORDS as e}from"./chunk-33C6ALT5.js";import{DEFAULT_FIELDS_WORDS as i}from"./chunk-WRFD4EXD.js";import{DEFAULT_CHROME_WORDS as u,DEFAULT_NOTICE_WORDS as k}from"./chunk-Z6PVRXVY.js";import{DEFAULT_LOCK_WORDS as j}from"./chunk-RE4LP46F.js";import{DEFAULT_RAIL_WORDS as h}from"./chunk-2OAZYSWJ.js";import{DEFAULT_DRAG_WORDS as l}from"./chunk-AYWN5NRH.js";var a={notice:k,lock:j,save:p,chrome:u,rail:h,tree:s,panel:f,fields:i,pick:r,drag:l,menu:n,styleClipboard:m,copy:e,canvas:c,textStyles:o,screen:t},Y=o=>"object"==typeof o&&null!==o;function y(o,r){const t={};for(const m of Object.keys(o)){const n=o[m],c=r[m];null==c?t[m]=n:Y(n)?t[m]=Y(c)?y(n,c):n:t[m]=typeof c==typeof n?c:n}return t}function D(o,r){return r?y(o,r):o}export{a as DEFAULT_EASEL_STRINGS,D as mergeEaselStrings};
@@ -1,2 +1,2 @@
1
- import{describeLoadFailure as e,hostLoadRefusal as r}from"./chunk-ERR437B5.js";import{editLockOf as n}from"./chunk-GMCZXMOV.js";import{saveStatusOf as t,resetForDocumentSwitch as o}from"./chunk-HNKB2ZYR.js";import{isExpiredSession as u,readEaselFailure as a}from"./chunk-CLOS6SSX.js";import{routeSharedHostMessage as s}from"./chunk-S4AWJX4Q.js";import{useAdminBridge as i}from"./chunk-VPFNZ7TB.js";import{NO_DOCUMENT_ADDRESSING as l}from"./chunk-RLBXE4EU.js";import{STATUS_UNREACHABLE as c}from"./chunk-KCOBHPN6.js";import{useEaselSession as d}from"./chunk-O7Q4DDJT.js";import{backendOf as f,setSessionDocumentSite as m}from"./chunk-RSCMJIWS.js";import{useEaselHost as k}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as g}from"./chunk-VVPZMWJE.js";import{useAutosave as v}from"./chunk-NDRZP6YR.js";import{canWriteDocument as p,newEaselClientId as h,reloadIfVersionMoved as y,openUnansweredClaim as w,FAIL_OPEN_RETRY_MS as S,CLAIM_FAIL_OPEN_MS as b,holderOf as P}from"./chunk-THWO5YVZ.js";import{useWords as I}from"./chunk-MFIRYGHW.js";import{createContext as j,useContext as R,useState as B,useMemo as O,useCallback as C,useEffect as E,useRef as H}from"react";import{jsx as T}from"react/jsx-runtime";var M={content:[],root:{},zones:{}};var V=j(null);function A(){const e=R(V);if(!e)throw new Error("useStorefrontDocument must be used within StorefrontDocumentProvider");return e}function D({target:j,addressing:R=l,onHostMessage:A,children:D}){const N=R,{homeSlug:F,entryMayBounce:L,entryBounce:W,onSwitch:Z,tellsHost:J,adapterFor:Y,migrateRenamedProps:U,describeMissing:X,onLoadFailed:x}=N,[G,K]=B(j),Q=k(),z=d(),_=O(()=>f(z),[z]),q=O(()=>n(z),[z]),$="template"===G.kind,ee="template"===G.kind?G.id:null,re="template"===G.kind?G.pageSlug??F??"":"document"===G.kind?G.slug??"":G.slug,ne="page"===G.kind?G.siteId??null:null,te=z.blocks,oe=O(()=>Y(G,_,te),[Y,_,te,G.kind,"template"===G.kind?G.id:"document"===G.kind?G.record:G.siteId]),ue=oe.capabilities,ae=C(e=>z.documentHooks?.stored?.(e)??e,[z]),se="page"===G.kind?G.originSlug??null:null;E(()=>{m(z,ne)},[z,ne]);const ie=H(G);E(()=>{ie.current=G},[G]);const{token:le,tokenRef:ce,capabilities:de}=i({onMessage:e=>{if(A?.(e)||s(e))return;const r=e;if("storefront-editor:navigate"===r?.type){const r=e;r?.target&&Or(r.target)}}}),fe=!z.usesBridgedToken||null!==le,me=oe.lock,ke=Boolean(_.lock),[ge,ve]=B(null),[pe,he]=B(null),[ye,we]=B(null),[Se,be]=B(null),Pe=I("screen",g),Ie=Se?function(e,r){if(null!==e.sentence)return e.sentence;if(!e.missing)return r.loadFailed({cause:e.cause});switch(e.target.kind){case"template":return r.missingTemplatePage;case"document":return r.missingDocument;default:return r.missingPage({slug:e.slug})}}(Se,Pe):null,[je,Re]=B(null),Be=H(null),Oe=H(null),[Ce,Ee]=B(!1),He=H(null),[Te,Me]=B(null),Ve=H(null),[Ae,De]=B(null),[Ne,Fe]=B(!1),Le=H(null);E(()=>{Le.current=Ae},[Ae]);const[We,Ze]=B(ue.hasEditLock?{kind:"checking"}:{kind:"editing"}),Je=H(We);E(()=>{Je.current=We},[We]);const Ye=H(()=>Promise.resolve(!1)),Ue=C(e=>{Oe.current=e,Ee(!0)},[]),Xe=v({save:async({id:e,data:r})=>{if(p(Je.current)){if(!await Ye.current(e,r)){if(!p(Je.current))return void Ue({id:e,data:r});throw new Error("page save did not land")}}else Ue({id:e,data:r})},onFailure:(e,r)=>{0===r&&Q.send("storefront-editor:save-failed")}}),{state:xe,push:Ge,flush:Ke,pause:Qe,resume:ze,stop:_e,reset:qe,retryNow:$e,hasPending:er}=Xe,rr=H(xe);E(()=>{rr.current=xe},[xe]);const nr=t(xe),tr=C(()=>{const e=Oe.current;e&&(Oe.current=null,Ee(!1),Ge(e))},[Ge]),or=H("");or.current||(or.current=h());const[ur,ar]=B(0),sr=H(!1),[ir,lr]=B(L(j)),cr=H(!1);E(()=>{if(cr.current)return;cr.current=!0;const e=Q.address.search(),r=W(j,e);r?Q.address.load(r):L(j)&&lr(!1)},[j,Q]);const dr=Q.send;E(()=>{if(!fe)return;let n=!1;const t=ie.current,o=oe.resolve(re),u=z.documentHooks?.opening?.({slug:re,isTemplate:$,capabilities:ue});return o.then(async e=>{if(n)return;if(!e)return"page"===t.kind&&null!==F&&re!==F?void Q.address.load({kind:"page",slug:F,siteId:ne??void 0}):(be({target:t,slug:re,missing:!0,sentence:X?.(t)??null}),void x?.(t,null));const r=e.readOnlyReason?e.readOnlyReason:null;Be.current=r,Re(r),ve(e.id),he(e.kind??null),Ve.current=e.version??null;const o=e.layout,a=o&&Object.keys(o).length?o:M,s=U(a),i=u?await u(s):s;n||we(i)}).catch(o=>{n||(console.error("[storefront-editor] document load failed",o),be({target:t,slug:re,missing:!1,sentence:r(o,{slug:re},z),cause:e(o,z)}),x?.(t,o))}),()=>{n=!0}},[fe,le,$,oe,re]);const fr=C(e=>new Promise(r=>{const n=Date.now(),t=setInterval(()=>{const o=ce.current;o&&o!==e?(clearInterval(t),r(o)):Date.now()-n>6e3&&(clearInterval(t),r(null))},200)}),[]),mr=C(async e=>{const r=ce.current;if(!r&&z.usesBridgedToken)return{ok:!1,error:new Error("no editor token")};try{return{ok:!0,value:await e(r??"")}}catch(n){if(u(n,z)){dr("storefront-editor:auth-expired");const n=r?await fr(r):null;if(n)try{return{ok:!0,value:await e(n)}}catch(e){return{ok:!1,error:e}}}return{ok:!1,error:n}}},[dr,fr,z]),kr=C(async e=>{const r=ce.current?await mr(e):{ok:!1};return r.ok||dr("storefront-editor:save-failed"),r.ok},[dr,mr]),gr=C(async(e,r,n=!1)=>{if(null!==Be.current)return!1;if(!p(Je.current))return!1;if(Le.current)return!1;const t=await mr(()=>oe.saveLayout(e,r,Ve.current,or.current));if(t.ok)return Ve.current=t.value.version??Ve.current,Fe(!1),!0;const o=q.readLockTaken(t.error);if(o){const e={kind:"takenover",holder:o};return Je.current=e,Ze(e),!1}const u=q.readSaveConflict(t.error);if(u){if(u.savedByYou&&!n&&oe.rereadVersion){const n=await mr(()=>oe.rereadVersion(e));if(n.ok&&n.value)return Ve.current=n.value,Ye.current(e,r,!0)}_e(),Le.current=u,De(u)}return Fe(a(t.error,z)?.status===c),!1},[oe,mr,_e,z]);E(()=>{Ye.current=gr},[gr]);const vr=C(e=>{if(null!==Be.current)return;if(dr("storefront-editor:dirty"),!ge)return;const r=ae(e);He.current=r,p(Je.current)?Ge({id:ge,data:r}):Ue({id:ge,data:r})},[ge,dr,Ue,Ge,ae]),pr=C(async()=>{p(Je.current)&&tr();return await Ke()&&null==Oe.current},[tr,Ke]),hr=H(pr);E(()=>{hr.current=pr},[pr]);const yr=H(mr);E(()=>{yr.current=mr},[mr]);const wr=C(()=>{Q.address.reload()},[Q]),Sr=H(()=>Promise.resolve(!1));E(()=>{Sr.current=()=>{const e=oe.rereadVersion;return ge&&e?y({ours:Ve.current,stored:async()=>{const r=await yr.current(()=>e(ge));return r.ok?r.value:null},hasPending:()=>null!=Oe.current||er(),reload:wr}):Promise.resolve(!1)}},[oe,ge,er,wr]);const br=null!==je;E(()=>{if(!me||!ge||!fe||br)return;let e=!1,r=null,n=null;const t=or.current,o={claim:async e=>{const r=await yr.current(()=>me.claim(ge,t,e));if(r.ok)return{heartbeat_seconds:r.value.heartbeatSeconds};throw r.error},cancelled:()=>e,currentAccess:()=>Je.current,heldWrite:()=>({pending:null!=Oe.current||er(),autoSaveEnabled:!rr.current.paused,saveConflict:null!=Le.current}),setAccess:e=>{Je.current=e,Ze(e)},releaseHeldWrite:()=>{hr.current()},startHeartbeat:e=>{r&&clearInterval(r),r=setInterval(()=>{u(!1)},e)},stopHeartbeat:()=>{r&&(clearInterval(r),r=null)},reloadIfMoved:()=>{Sr.current()}},u=q.makeClaimBeat(o),a=sr.current;return sr.current=!1,a||(Ze({kind:"checking"}),n=setTimeout(()=>{n=null,w(o)&&o.startHeartbeat(S)},b)),u(a).finally(()=>{n&&clearTimeout(n),n=null}),()=>{e=!0,n&&clearTimeout(n),r&&clearInterval(r),me.release(ge,t).catch(()=>{})}},[ge,me,fe,le,ur,br]);const Pr=C(()=>{me&&ge&&(sr.current=!0,ar(e=>e+1))},[ge,me]),Ir=C(()=>{Ze(e=>{const r="blocked"===e.kind||"takenover"===e.kind?e.holder:null;return r?{kind:"readonly",holder:r}:e})},[]),jr=C(()=>{rr.current.paused?(p(Je.current)&&tr(),ze()):Qe()},[tr,Qe,ze]),Rr=C(()=>{$e()},[$e]),Br=C(e=>{He.current=null,o("template"!==e.kind&&ke,{resetAutosave:()=>{qe(),Oe.current=null,Ee(!1)},setVersion:e=>{Ve.current=e},setSaveConflict:De,setAccess:Ze}),Z(e),K(e),Be.current=null,Re(null),ve(null),he(null),we(null),be(null),Q.address.show(e),"document"!==e.kind&&J(e)&&Q.send("storefront-editor:navigated",{target:e})},[qe,Q,ke,Z,J]),Or=C(e=>{if(function(e,r,n){if(e.kind!==r.kind)return!1;if("template"===e.kind){const t=r;return e.id===t.id&&(e.pageSlug??n)===(t.pageSlug??n)}if("document"===e.kind){const n=r;return e.record===n.record&&(e.slug??"")===(n.slug??"")}const t=r;return e.slug===t.slug&&e.siteId===t.siteId}(e,ie.current,F))return;const r=null!=Oe.current;if(!r&&!er())return void Br(e);const n=rr.current;r||n.paused||n.failed||n.stopped?Me(e):Ke().then(r=>{r?Br(e):Me(e)})},[Br,er,Ke,F]),Cr=C(()=>Me(null),[]),Er=C(()=>{Me(e=>(e&&Br(e),null))},[Br]),Hr=C(async()=>{const e=Te;if(!e)return;await pr()&&(Me(null),Br(e))},[Te,pr,Br]),Tr=C(async e=>{if(null!==Be.current)return;if(!ge)return;if(!p(Je.current)||Le.current)return;const r=ae(e);if(!await gr(ge,r))return void(Le.current||dr("storefront-editor:save-failed"));const n=oe.publish;if(!ue.canPublish||!n)return void dr("storefront-editor:saved");const t=await mr(()=>n(ge,Ve.current??void 0));t.ok?(Ve.current=t.value.version??Ve.current,dr("storefront-editor:published")):dr("storefront-editor:save-failed")},[ge,oe,ue.canPublish,dr,gr,mr,ae]);/* @__PURE__ */
1
+ import{describeLoadFailure as e,hostLoadRefusal as r}from"./chunk-ERR437B5.js";import{editLockOf as n}from"./chunk-GMCZXMOV.js";import{NO_DOCUMENT_ADDRESSING as t}from"./chunk-RLBXE4EU.js";import{saveStatusOf as o,resetForDocumentSwitch as u}from"./chunk-HNKB2ZYR.js";import{isExpiredSession as a,readEaselFailure as s}from"./chunk-CLOS6SSX.js";import{routeSharedHostMessage as i}from"./chunk-S4AWJX4Q.js";import{useAdminBridge as l}from"./chunk-VPFNZ7TB.js";import{STATUS_UNREACHABLE as c}from"./chunk-KCOBHPN6.js";import{useEaselSession as d}from"./chunk-O7Q4DDJT.js";import{backendOf as f,setSessionDocumentSite as m}from"./chunk-RSCMJIWS.js";import{useEaselHost as k}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as g}from"./chunk-VVPZMWJE.js";import{useAutosave as v}from"./chunk-NDRZP6YR.js";import{canWriteDocument as p,newEaselClientId as h,reloadIfVersionMoved as y,openUnansweredClaim as w,FAIL_OPEN_RETRY_MS as S,CLAIM_FAIL_OPEN_MS as b,holderOf as P}from"./chunk-THWO5YVZ.js";import{useWords as I}from"./chunk-MFIRYGHW.js";import{createContext as j,useContext as R,useState as B,useMemo as O,useCallback as C,useEffect as E,useRef as H}from"react";import{jsx as T}from"react/jsx-runtime";var M={content:[],root:{},zones:{}};var V=j(null);function A(){const e=R(V);if(!e)throw new Error("useStorefrontDocument must be used within StorefrontDocumentProvider");return e}function D({target:j,addressing:R=t,onHostMessage:A,children:D}){const N=R,{homeSlug:F,entryMayBounce:L,entryBounce:W,onSwitch:Z,tellsHost:J,adapterFor:Y,migrateRenamedProps:U,describeMissing:X,onLoadFailed:x}=N,[G,K]=B(j),Q=k(),z=d(),_=O(()=>f(z),[z]),q=O(()=>n(z),[z]),$="template"===G.kind,ee="template"===G.kind?G.id:null,re="template"===G.kind?G.pageSlug??F??"":"document"===G.kind?G.slug??"":G.slug,ne="page"===G.kind?G.siteId??null:null,te=z.blocks,oe=O(()=>Y(G,_,te),[Y,_,te,G.kind,"template"===G.kind?G.id:"document"===G.kind?G.record:G.siteId]),ue=oe.capabilities,ae=C(e=>z.documentHooks?.stored?.(e)??e,[z]),se="page"===G.kind?G.originSlug??null:null;E(()=>{m(z,ne)},[z,ne]);const ie=H(G);E(()=>{ie.current=G},[G]);const{token:le,tokenRef:ce,capabilities:de}=l({onMessage:e=>{if(A?.(e)||i(e))return;const r=e;if("storefront-editor:navigate"===r?.type){const r=e;r?.target&&Or(r.target)}}}),fe=!z.usesBridgedToken||null!==le,me=oe.lock,ke=Boolean(_.lock),[ge,ve]=B(null),[pe,he]=B(null),[ye,we]=B(null),[Se,be]=B(null),Pe=I("screen",g),Ie=Se?function(e,r){if(null!==e.sentence)return e.sentence;if(!e.missing)return r.loadFailed({cause:e.cause});switch(e.target.kind){case"template":return r.missingTemplatePage;case"document":return r.missingDocument;default:return r.missingPage({slug:e.slug})}}(Se,Pe):null,[je,Re]=B(null),Be=H(null),Oe=H(null),[Ce,Ee]=B(!1),He=H(null),[Te,Me]=B(null),Ve=H(null),[Ae,De]=B(null),[Ne,Fe]=B(!1),Le=H(null);E(()=>{Le.current=Ae},[Ae]);const[We,Ze]=B(ue.hasEditLock?{kind:"checking"}:{kind:"editing"}),Je=H(We);E(()=>{Je.current=We},[We]);const Ye=H(()=>Promise.resolve(!1)),Ue=C(e=>{Oe.current=e,Ee(!0)},[]),Xe=v({save:async({id:e,data:r})=>{if(p(Je.current)){if(!await Ye.current(e,r)){if(!p(Je.current))return void Ue({id:e,data:r});throw new Error("page save did not land")}}else Ue({id:e,data:r})},onFailure:(e,r)=>{0===r&&Q.send("storefront-editor:save-failed")}}),{state:xe,push:Ge,flush:Ke,pause:Qe,resume:ze,stop:_e,reset:qe,retryNow:$e,hasPending:er}=Xe,rr=H(xe);E(()=>{rr.current=xe},[xe]);const nr=o(xe),tr=C(()=>{const e=Oe.current;e&&(Oe.current=null,Ee(!1),Ge(e))},[Ge]),or=H("");or.current||(or.current=h());const[ur,ar]=B(0),sr=H(!1),[ir,lr]=B(L(j)),cr=H(!1);E(()=>{if(cr.current)return;cr.current=!0;const e=Q.address.search(),r=W(j,e);r?Q.address.load(r):L(j)&&lr(!1)},[j,Q]);const dr=Q.send;E(()=>{if(!fe)return;let n=!1;const t=ie.current,o=oe.resolve(re),u=z.documentHooks?.opening?.({slug:re,isTemplate:$,capabilities:ue});return o.then(async e=>{if(n)return;if(!e)return"page"===t.kind&&null!==F&&re!==F?void Q.address.load({kind:"page",slug:F,siteId:ne??void 0}):(be({target:t,slug:re,missing:!0,sentence:X?.(t)??null}),void x?.(t,null));const r=e.readOnlyReason?e.readOnlyReason:null;Be.current=r,Re(r),ve(e.id),he(e.kind??null),Ve.current=e.version??null;const o=e.layout,a=o&&Object.keys(o).length?o:M,s=U(a),i=u?await u(s):s;n||we(i)}).catch(o=>{n||(console.error("[storefront-editor] document load failed",o),be({target:t,slug:re,missing:!1,sentence:r(o,{slug:re},z),cause:e(o,z)}),x?.(t,o))}),()=>{n=!0}},[fe,le,$,oe,re]);const fr=C(e=>new Promise(r=>{const n=Date.now(),t=setInterval(()=>{const o=ce.current;o&&o!==e?(clearInterval(t),r(o)):Date.now()-n>6e3&&(clearInterval(t),r(null))},200)}),[]),mr=C(async e=>{const r=ce.current;if(!r&&z.usesBridgedToken)return{ok:!1,error:new Error("no editor token")};try{return{ok:!0,value:await e(r??"")}}catch(n){if(a(n,z)){dr("storefront-editor:auth-expired");const n=r?await fr(r):null;if(n)try{return{ok:!0,value:await e(n)}}catch(e){return{ok:!1,error:e}}}return{ok:!1,error:n}}},[dr,fr,z]),kr=C(async e=>{const r=ce.current?await mr(e):{ok:!1};return r.ok||dr("storefront-editor:save-failed"),r.ok},[dr,mr]),gr=C(async(e,r,n=!1)=>{if(null!==Be.current)return!1;if(!p(Je.current))return!1;if(Le.current)return!1;const t=await mr(()=>oe.saveLayout(e,r,Ve.current,or.current));if(t.ok)return Ve.current=t.value.version??Ve.current,Fe(!1),!0;const o=q.readLockTaken(t.error);if(o){const e={kind:"takenover",holder:o};return Je.current=e,Ze(e),!1}const u=q.readSaveConflict(t.error);if(u){if(u.savedByYou&&!n&&oe.rereadVersion){const n=await mr(()=>oe.rereadVersion(e));if(n.ok&&n.value)return Ve.current=n.value,Ye.current(e,r,!0)}_e(),Le.current=u,De(u)}return Fe(s(t.error,z)?.status===c),!1},[oe,mr,_e,z]);E(()=>{Ye.current=gr},[gr]);const vr=C(e=>{if(null!==Be.current)return;if(dr("storefront-editor:dirty"),!ge)return;const r=ae(e);He.current=r,p(Je.current)?Ge({id:ge,data:r}):Ue({id:ge,data:r})},[ge,dr,Ue,Ge,ae]),pr=C(async()=>{p(Je.current)&&tr();return await Ke()&&null==Oe.current},[tr,Ke]),hr=H(pr);E(()=>{hr.current=pr},[pr]);const yr=H(mr);E(()=>{yr.current=mr},[mr]);const wr=C(()=>{Q.address.reload()},[Q]),Sr=H(()=>Promise.resolve(!1));E(()=>{Sr.current=()=>{const e=oe.rereadVersion;return ge&&e?y({ours:Ve.current,stored:async()=>{const r=await yr.current(()=>e(ge));return r.ok?r.value:null},hasPending:()=>null!=Oe.current||er(),reload:wr}):Promise.resolve(!1)}},[oe,ge,er,wr]);const br=null!==je;E(()=>{if(!me||!ge||!fe||br)return;let e=!1,r=null,n=null;const t=or.current,o={claim:async e=>{const r=await yr.current(()=>me.claim(ge,t,e));if(r.ok)return{heartbeat_seconds:r.value.heartbeatSeconds};throw r.error},cancelled:()=>e,currentAccess:()=>Je.current,heldWrite:()=>({pending:null!=Oe.current||er(),autoSaveEnabled:!rr.current.paused,saveConflict:null!=Le.current}),setAccess:e=>{Je.current=e,Ze(e)},releaseHeldWrite:()=>{hr.current()},startHeartbeat:e=>{r&&clearInterval(r),r=setInterval(()=>{u(!1)},e)},stopHeartbeat:()=>{r&&(clearInterval(r),r=null)},reloadIfMoved:()=>{Sr.current()}},u=q.makeClaimBeat(o),a=sr.current;return sr.current=!1,a||(Ze({kind:"checking"}),n=setTimeout(()=>{n=null,w(o)&&o.startHeartbeat(S)},b)),u(a).finally(()=>{n&&clearTimeout(n),n=null}),()=>{e=!0,n&&clearTimeout(n),r&&clearInterval(r),me.release(ge,t).catch(()=>{})}},[ge,me,fe,le,ur,br]);const Pr=C(()=>{me&&ge&&(sr.current=!0,ar(e=>e+1))},[ge,me]),Ir=C(()=>{Ze(e=>{const r="blocked"===e.kind||"takenover"===e.kind?e.holder:null;return r?{kind:"readonly",holder:r}:e})},[]),jr=C(()=>{rr.current.paused?(p(Je.current)&&tr(),ze()):Qe()},[tr,Qe,ze]),Rr=C(()=>{$e()},[$e]),Br=C(e=>{He.current=null,u("template"!==e.kind&&ke,{resetAutosave:()=>{qe(),Oe.current=null,Ee(!1)},setVersion:e=>{Ve.current=e},setSaveConflict:De,setAccess:Ze}),Z(e),K(e),Be.current=null,Re(null),ve(null),he(null),we(null),be(null),Q.address.show(e),"document"!==e.kind&&J(e)&&Q.send("storefront-editor:navigated",{target:e})},[qe,Q,ke,Z,J]),Or=C(e=>{if(function(e,r,n){if(e.kind!==r.kind)return!1;if("template"===e.kind){const t=r;return e.id===t.id&&(e.pageSlug??n)===(t.pageSlug??n)}if("document"===e.kind){const n=r;return e.record===n.record&&(e.slug??"")===(n.slug??"")}const t=r;return e.slug===t.slug&&e.siteId===t.siteId}(e,ie.current,F))return;const r=null!=Oe.current;if(!r&&!er())return void Br(e);const n=rr.current;r||n.paused||n.failed||n.stopped?Me(e):Ke().then(r=>{r?Br(e):Me(e)})},[Br,er,Ke,F]),Cr=C(()=>Me(null),[]),Er=C(()=>{Me(e=>(e&&Br(e),null))},[Br]),Hr=C(async()=>{const e=Te;if(!e)return;await pr()&&(Me(null),Br(e))},[Te,pr,Br]),Tr=C(async e=>{if(null!==Be.current)return;if(!ge)return;if(!p(Je.current)||Le.current)return;const r=ae(e);if(!await gr(ge,r))return void(Le.current||dr("storefront-editor:save-failed"));const n=oe.publish;if(!ue.canPublish||!n)return void dr("storefront-editor:saved");const t=await mr(()=>n(ge,Ve.current??void 0));t.ok?(Ve.current=t.value.version??Ve.current,dr("storefront-editor:published")):dr("storefront-editor:save-failed")},[ge,oe,ue.canPublish,dr,gr,mr,ae]);/* @__PURE__ */
2
2
  return T(V.Provider,{value:{target:G,adapter:oe,capabilities:ue,templateId:ee,currentSlug:re,currentKind:pe,siteId:ne,ready:fe,token:le,tokenRef:ce,notifyParent:dr,bridgeCapabilities:de,runAuthed:kr,docId:ge,data:ye,getLiveData:()=>He.current??ye,footerOriginSlug:se,error:Ie,redirecting:ir,saveStatus:nr,saveState:xe,autoSaveEnabled:!xe.paused,autoSaveStoppedByConflict:xe.stopped,hasUnsavedEdits:xe.pending||Ce,toggleAutoSave:jr,retrySave:Rr,onChange:vr,flushSave:pr,onPublish:Tr,access:We,readOnly:null!==P(We)||null!==je||null!==Ae,readOnlyReason:je,takeOverEditing:Pr,viewReadOnly:Ir,saveConflict:Ae,saveUnreachable:Ne,reloadFromServer:wr,navigate:Or,pendingNav:Te,cancelPendingNav:Cr,discardAndNavigate:Er,saveAndNavigate:Hr},children:D})}export{V as ScreenDocumentContext,D as ScreenDocumentProvider,A as useScreenDocument};
@@ -0,0 +1,57 @@
1
+ import{styleClipboardOf as e}from"./chunk-M4CNCPHA.js";import{markedTreeNodeId as n,revealSelectedTreeRow as t,sameSelector as o}from"./chunk-FGNR22NY.js";import{cloneNodeWithFreshIds as r}from"./chunk-2GVCAIPX.js";import{dedupeSlotChildren as i}from"./chunk-26OOWIJJ.js";import{ScreenSaveIcon as l,ScreenMainButton as s}from"./chunk-W4U4SHKW.js";import{useBrowserOffline as d}from"./chunk-RKTF5XLP.js";import{scrollPreviewToSection as c,gotoPreviewSlide as a,scrollPreviewToTop as p}from"./chunk-3Z2MVLCD.js";import{useEaselKeyTarget as u,useEaselUndoKeys as f,useEaselSaveKey as h,editorRootFocus as m}from"./chunk-4EI6UGGH.js";import{SlotChildActionsProvider as g}from"./chunk-KCBEE2MC.js";import{screenStorageKeys as y,DEFAULT_PANEL_W as k,clampPanelWidth as S}from"./chunk-TZIIRGVY.js";import{usePartBridge as v}from"./chunk-H5QI34FV.js";import{useSectionOps as b}from"./chunk-S2MMPHKD.js";import{AddChildRow as w}from"./chunk-5545A3PC.js";import{AddSidePanel as x}from"./chunk-YWUHPY5W.js";import{SidePanelHead as z,PanelShowStrip as C}from"./chunk-62VPYC7F.js";import{MediaSidePanel as I}from"./chunk-J2JDC3EZ.js";import{useScreenSaveSwitch as B,useScreenNodeKeys as N,useScreenPinned as P,useScreenDocumentLabel as O,useScreenCanvasFrame as $,useScreenInspectorPanel as M,useScreenDevices as j,useScreenPickFollowsSelection as A,useScreenLeftView as T,SELECTION_MODE as L,sameInspectorMode as E,useScreenBridges as R,useScreenBlockRules as V,useScreenBlockLook as F,useScreenStorageNamespace as W,useScreenNotify as H,useScreenCanvasHead as D,isSlotMode as J,useScreenStyleClipboard as U,useScreenDocumentPass as G,useScreenCanvasDrag as Y,ScreenCanvasTargetProvider as K,isPinnedFirst as X,isPinnedLast as Z,screenSlotsOf as q}from"./chunk-FZ3Y3QTQ.js";import{useNodeClipboard as _,useNodeContextMenu as Q}from"./chunk-NW4LJ4G4.js";import{PageEditGuardNotices as ee}from"./chunk-IWFVVCRN.js";import{useScreenDocument as ne}from"./chunk-FBS75I6E.js";import{requestMediaPick as te}from"./chunk-KG7RJWOK.js";import{useMediaPanel as oe,usePanelPick as re,useCancelPanelPick as ie}from"./chunk-R6WTQWAC.js";import{useEaselSession as le}from"./chunk-O7Q4DDJT.js";import{useEaselHost as se,useHostEscape as de}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as ce}from"./chunk-VVPZMWJE.js";import{heldStyle as ae,styleShortcut as pe}from"./chunk-V7U33NF2.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as ue}from"./chunk-6WY6ZXJG.js";import{DEFAULT_NODE_MENU_WORDS as fe}from"./chunk-WK3AFPXY.js";import{rootRowName as he,slotChildRowName as me,slotChildRenameProp as ge,sectionRenameProp as ye}from"./chunk-TBF5CVPA.js";import{ROOT_ZONE as ke,blockNodeActions as Se,TREE_MAX_DEPTH as ve,childSlotsOf as be,slotFieldsOf as we,slotChildrenIn as xe,nestsInTree as ze,newNodeId as Ce}from"./chunk-PLVEGYK6.js";import{useEasel as Ie,useEaselApi as Be,CanvasPassThroughContext as Ne}from"./chunk-PVAIOBBE.js";import{toItemSelector as Pe,useNodeOps as Oe,clickPick as $e}from"./chunk-ECM5F6JJ.js";import{TreeRow as Me,Subtree as je,LayersTree as Ae,TreeGroupLabel as Te,TreeRowAction as Le,TreeSeam as Ee}from"./chunk-4JSBIW5H.js";import{DEFAULT_TREE_WORDS as Re}from"./chunk-K56YDHYQ.js";import{LayersIcon as Ve,MediaIcon as Fe}from"./chunk-4VJATVVR.js";import{EaselTopBar as We,TopBarRail as He,TopBarCluster as De,EaselIconButton as Je,TopBarDivider as Ue,DeviceSwitch as Ge,InspectorIconButton as Ye,PanelResizeHandle as Ke,MAX_PANEL_W as Xe,MIN_PANEL_W as Ze,panelWidthVars as qe}from"./chunk-IE55HNMA.js";import{DEFAULT_NOTICE_WORDS as _e,DEFAULT_CHROME_WORDS as Qe}from"./chunk-Z6PVRXVY.js";import{holderOf as en,nameOrSomeone as nn}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as tn}from"./chunk-RE4LP46F.js";import{useWords as on}from"./chunk-MFIRYGHW.js";import{insertSeams as rn,CanvasDragLayer as ln,CanvasInsert as sn}from"./chunk-QFVRMARS.js";import{DEFAULT_DRAG_WORDS as dn}from"./chunk-AYWN5NRH.js";import{createDragSession as cn,useTreeDrag as an,gapToMoveIndex as pn}from"./chunk-67GNT6PF.js";import{useCanvasFrame as un,LIST_SELECTOR as fn,BLOCK_SELECTOR as hn,useCanvasEvent as mn,nodeIdAt as gn,frameRectToHost as yn,BLOCK_ATTRIBUTE as kn,drawnBox as Sn}from"./chunk-ILXP5VX5.js";import{ROOT_ID as vn,ROOT_SLOT as bn,zoneKey as wn,parseZoneKey as xn,find as zn,DataError as Cn}from"./chunk-KRXQM65X.js";import{useRef as In,useMemo as Bn,useState as Nn,useEffect as Pn,useCallback as On,useLayoutEffect as $n,Fragment as Mn}from"react";import{ColoredBadge as jn,toast as An,groupColors as Tn}from"efficient-shell/ui";import{UndoIcon as Ln,RedoIcon as En,RefreshIcon as Rn,AddIcon as Vn,TrashIcon as Fn,EyeOffIcon as Wn,EyeIcon as Hn,DuplicateIcon as Dn}from"efficient-shell/icons/efficient";import{jsx as Jn,jsxs as Un,Fragment as Gn}from"react/jsx-runtime";var Yn=/* @__PURE__ */new WeakSet;function Kn(e,n,t){const o=zn(e,n,t);if(!o)return null;const r=o.path.find(e=>"root"!==e.parentId);return r?r.parentId:t}function Xn({canvas:e,tabs:n,onSelect:t}){const o=In(null),[r,i]=Nn({}),l=n.map(e=>`${e.id}:${e.below?1:0}`).join("|");return $n(()=>{const t=e?.document,r=e?.window,l=e?.frame;if(!t||!r||!l||0===n.length)return void i({});let s=0;const d=()=>{s=0;const e=o.current;if(!e)return;const d=yn(l,{left:0,top:0,width:r.innerWidth,height:r.innerHeight},e),c={};for(const o of n){const n=t.querySelector(`[${kn}="${r.CSS?.escape?r.CSS.escape(o.id):o.id}"]`),i=n?Sn(n):null;if(!i||0===i.height){c[o.id]=null;continue}const s=yn(l,{left:i.left,top:i.top,width:i.width,height:i.height},e),a=s.top+s.height;if(a<d.top||s.top>d.top+d.height){c[o.id]=null;continue}const p=o.below?a+4:Math.max(s.top,d.top)+6;c[o.id]={left:Math.max(s.left,d.left)+6,top:p}}i(c)},c=()=>{s||(s=r.requestAnimationFrame(d))};d(),r.addEventListener("scroll",c,!0),r.addEventListener("resize",c);const a=new r.MutationObserver(c);return a.observe(t.body,{childList:!0,subtree:!0,attributes:!0}),()=>{s&&r.cancelAnimationFrame(s),r.removeEventListener("scroll",c,!0),r.removeEventListener("resize",c),a.disconnect()}},[e,l]),/* @__PURE__ */Jn("div",{ref:o,className:"es-band-tabs","aria-hidden":"true",children:n.map(e=>{const n=r[e.id];return n?/* @__PURE__ */Jn("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:/* @__PURE__ */Jn(jn,{colorClass:Tn("info","solid"),size:"sm",children:e.label})},e.id):null})})}function Zn({expand:e}){/* @__PURE__ */
2
+ return Jn("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */Un(Gn,e?{children:[
3
+ /* @__PURE__ */Jn("path",{d:"M8 9l4-4 4 4"}),
4
+ /* @__PURE__ */Jn("path",{d:"M8 15l4 4 4-4"})]}:{children:[
5
+ /* @__PURE__ */Jn("path",{d:"M8 4l4 4 4-4"}),
6
+ /* @__PURE__ */Jn("path",{d:"M8 20l4-4 4 4"}),
7
+ /* @__PURE__ */Jn("path",{d:"M5 12h14"})]})})}var qn=`${fn}, ${hn}`;function _n(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 Qn="__rungs";var et="screen:band",nt={duplicate:!0,delete:!0};function tt(){const fn=se(),{target:yn,docId:kn,capabilities:Sn,currentSlug:Tn,siteId:tt,onPublish:ot,saveState:rt,saveConflict:it,retrySave:lt,toggleAutoSave:st,flushSave:dt,access:ct,saveUnreachable:at=!1,readOnly:pt,readOnlyReason:ut=null}=ne(),ft=B(),ht=N(),{mediaEditing:mt,hasEditGuard:gt,hasPinnedChrome:yt}=Sn,{appState:kt,dispatch:St,history:vt,selectedItem:bt,getSelectorForId:wt,config:xt}=Ie(e=>e),zt=P(),{first:Ct,firstGroup:It,lastGroup:Bt,isSectionGroup:Nt,sectionGroupZone:Pt,panelOf:Ot}=zt,$t=Ot(Ct),Mt=e=>X(zt,e),jt=e=>Z(zt,e),At="node"===zt.firstRow,Tt=zt.band??null,Lt=on("screen",ce),Et=on("tree",Re),Rt=on("drag",dn),Vt=on("notice",_e),Ft=on("lock",tn),Wt=on("menu",fe),Ht=on("styleClipboard",ue),Dt=on("chrome",Qe),Jt=O()??`/${Tn}`,Ut=$(),Gt=M(),Yt=b({readOnly:pt}),Kt=b({readOnly:pt,foldIntoHistory:!0}),Xt=In(null),Zt=Be(),qt=Bn(()=>({...Yt,select:e=>{Xt.current=e,Yt.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=Zt.config;Xt.current=Pe(e,t,n)}Yt.commitDocument(e,n)}}),[Yt,Zt]),_t=kt.ui,Qt=_t.leftSideBarVisible,eo=_t.rightSideBarVisible,{options:no,widths:to,initial:oo,fluid:ro,fit:io}=j(),[lo,so]=Nn(oo),co=oe(),ao=mt&&null!==co,po=re(),uo=ie();A(bt?.props.id);const{read:fo,write:ho,forSelection:mo}=T(),[go,yo]=Nn(fo);Pn(()=>{ho(go)},[go]);const[ko,So]=Nn(0),vo=In(null),bo=In(null),wo=un(bo,{readySelector:qn}),xo=u(bo);f(bo,wo);const zo=d(),Co=en(ct),Io={state:rt,offline:zo||rt.failed&&at,readOnlyReason:ut,editing:Co?Vt.editing({name:nn(Co.name,Ft),noun:Lt.noun}):null,conflict:null!=it,notSaving:Lt.bar.notSaving},Bo=()=>{pt||(rt.failed?lt():dt())};h(bo,wo,Bo);const[No,Po]=Nn(!1),Oo=In(!1),$o=In(!1),[Mo,jo]=Nn(null),[Ao,To]=Nn([]),[Lo,Eo]=Nn(L),Ro="puck"===Lo.kind,Vo=n(Lo,bt?.props.id),[Fo,Wo]=Nn(null);Pn(()=>{Fo&&(t(),Wo(null))},[Fo]);const Ho=In(wt);Ho.current=wt;const Do=On((e,{scroll:n})=>{yo(n=>mo(e,n)),n&&Wo(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=Ho.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&Sr(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),Jo=In(null);Pn(()=>{const e=Jo.current;Jo.current=null;const n=null==bt?.props.id?null:String(bt.props.id);Eo(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:Ot(bt?.type)??L);const t=bt?.props.id,r=Xt.current;if(Xt.current=null,!t)return;const i=wt(t);Do(String(t),{scroll:!o(r,i??null,ke)})},[bt?.props.id,Do]);const Uo=On(e=>{Eo(n=>E(n,e)?n:e),St({type:"setUi",ui:{rightSideBarVisible:!0}})},[St]),Go=In(()=>{});Go.current=(e,n)=>{const t=e?ui(e.zone??ke)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==bt?.props.id?null:String(bt.props.id);Eo(e=>E(e,n)?e:n),o!==r&&(Jo.current={id:o,mode:n},qt.select(e))};const Yo=On((e,n)=>Go.current(e,n),[]),Ko={kind:Lo.kind,mode:Lo,open:Uo,show:e=>Eo(e),reveal:()=>{eo||St({type:"setUi",ui:{rightSideBarVisible:!0}})},select:Yo},Xo=R(Ko,{data:kt.data,selected:bt??null,zoneOf:e=>wt(e)?.zone,readOnly:Boolean(pt),select:e=>{Eo(L),qt.select({index:e})},replace:(e,n)=>qt.replaceComponent(ke,e,n),scrollTo:e=>Ei(e)},{device:lo,refreshes:ko},{setView:yo,reveal:()=>{Qt||St({type:"setUi",ui:{leftSideBarVisible:!0}})}}),Zo=Xo.pinnedSource??!1,qo=Xo.resolveLeftView?Xo.resolveLeftView(go,ao):"media"===go&&ao?go:"sections",_o=V(),{isLockedBlock:Qo,duplicateBlocked:er,nestDepth:nr,newSectionNode:tr,canAddTo:or,blockIsOffered:rr}=_o,ir=F(),{labelAtLevel:lr,Icon:sr,useProducts:dr}=ir,cr=ir.rowName?(e,n,t)=>ir.rowName(e,n,t):void 0,ar=On(e=>{St({type:"setUi",ui:{rightSideBarVisible:!0}}),c(e),Do(e,{scroll:!0})},[St,Do]),{selectNode:pr,openPartId:ur}=v({mode:Lo,setMode:Eo,onOpenPart:ar}),[fr,hr]=Nn(null);de(null!==fr,()=>hr(null));const mr=y(W()),gr=mr.collapsed,yr=mr.panelWidths,[kr,Sr]=Nn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(gr);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
8
+ return new Set}});Pn(()=>{try{window.localStorage.setItem(gr,JSON.stringify([...kr]))}catch{}},[kr]);const[vr,br]=Nn(()=>{if("undefined"==typeof window)return{...k};try{const e=window.localStorage.getItem(yr);if(!e)return{...k};const n=JSON.parse(e);return{left:S(Number(n.left)||k.left),right:S(Number(n.right)||k.right)}}catch{return{...k}}});Pn(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(yr,JSON.stringify(vr))}catch{}},300);return()=>clearTimeout(e)},[vr]);const wr=On((e,n)=>br(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),xr=On(e=>wr("left",e),[wr]),zr=On(e=>wr("right",e),[wr]),Cr=e=>kr.has(e),Ir=e=>Sr(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Br=In(!1),Nr=In(null);Pn(()=>{if(Br.current&&!No){const e=Nr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??bo.current?.querySelector(`button[aria-label="${CSS.escape(Lt.add.title)}"]`))?.focus(),Nr.current=null}Br.current=No},[No]),Pn(()=>{if(!No||!xo)return;const e=e=>{"Escape"===e.key&&Ui()};return xo.addEventListener("keydown",e),()=>xo.removeEventListener("keydown",e)},[No,xo]),de(No,()=>Ui()),Pn(()=>{!Qt&&No&&(Po(!1),jo(null),Oo.current=!1)},[Qt]),Pn(()=>{if(!po)return $o.current&&St({type:"setUi",ui:{leftSideBarVisible:!1}}),void($o.current=!1);No&&(Po(!1),jo(null),$o.current=Oo.current,Oo.current=!1),Qt||($o.current=!0,St({type:"setUi",ui:{leftSideBarVisible:!0}}))},[po]),Pn(()=>{!Qt&&po&&($o.current=!1,uo())},[Qt]),Pn(()=>{if(!po||!xo)return;const e=e=>{"Escape"===e.key&&uo()};return xo.addEventListener("keydown",e),()=>xo.removeEventListener("keydown",e)},[po,xo]),de(null!==po,()=>uo());const Pr=H(),Or=(e,n="success",t)=>{if(Pr)return void(t?Pr(e,"error"===n?"error":"info",t):Pr(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?An.error(e,{...o,duration:t?.duration??3200}):An.success(e,{...o,duration:t?.duration??1900})},$r=In(null),[Mr,jr]=Nn(0),[Ar,Tr]=Nn(0),Lr=D(),Er=In(null),Rr=e=>Math.max(0,e.clientHeight-(Er.current?.offsetHeight??0));Pn(()=>{const e=$r.current;if(!e)return;const n=()=>{jr(e.clientWidth),Tr(Rr(e))};n();const t=new ResizeObserver(n);return t.observe(e),Er.current&&t.observe(Er.current),()=>t.disconnect()},[]),$n(()=>{$r.current&&(jr($r.current.clientWidth),Tr(Rr($r.current)))},[vr,Qt,eo]);const Vr=lo===ro?Mr>0?Mr:to[ro]:to[lo],Fr=Mr>0?Math.min(Mr/Vr,"shrink"===io?1:2):1,Wr=Vr*Fr,Hr=Mr>0&&Wr>Mr+1,Dr={width:Wr,height:Ar||"100%",flex:"none",position:"relative"},Jr={width:Vr,height:Ar?Ar/Fr:"100%",maxHeight:"none",transform:1!==Fr?`scale(${Fr})`:void 0,transformOrigin:"top left"},Ur=()=>St({type:"setUi",ui:{leftSideBarVisible:!Qt}}),Gr=()=>St({type:"setUi",ui:{rightSideBarVisible:!eo}}),Yr=e=>{No&&(Po(!1),jo(null),Oo.current=!1,Qt&&go===e)||po&&($o.current=!1,uo(),Qt&&go===e)||(Qt&&go===e?Ur():(yo(e),Qt||St({type:"setUi",ui:{leftSideBarVisible:!0}})))},Kr=()=>{te(fn,{accept:"image/*",title:Dt.mediaLibrary})},Xr=()=>{Eo(L),qt.select(null),p()},Zr=()=>{Eo($t??L),eo||St({type:"setUi",ui:{rightSideBarVisible:!0}})},qr=kt.data.content??[],_r=()=>{const e=qr.findIndex(Mt),n=qr.findIndex(jt);return{floor:e>=0?e+1:0,cap:n>=0?n:qr.length}},Qr=xt,ei=_o.stripCopy,ni=e=>r(e,ei),ti=_(),oi=Oe({data:kt.data,config:Qr,readOnly:Boolean(pt),clipboard:ti,strip:ei?e=>ei(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==vn||e.slot!==bn)return{min:0,max:n-1};const{floor:t,cap:o}=_r();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&Eo(L);const t=void 0===n||"node"===n?.kind?n:null;qt.commitDocument(e,t)}}),ri=e=>{const n=zn(kt.data,xt,e);if(!n)return!1;const t=wn(n.place),o=n.node,r=t===ke?ci(o):xi(o);return!!oi.remove(e)&&(Or(Lt.deleted({name:r}),"success",{duration:8e3,action:{label:Lt.bar.undo,onClick:()=>{oi.restore(n.node,n.place)}}}),!0)},ii={...oi,remove:ri},li=e=>lr(e,"block",xt.components[e]?.label??e),si=On(e=>xt.components[e]?.defaultProps??{},[xt]),di=e=>lr(e,"section",li(e)),ci=e=>he({type:e.type,props:e.props??{}},di(e.type),cr),{nodeAddresses:ai,zoneItems:pi}=Bn(()=>{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>=ve)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of be(xt,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(qr,ke,0),{nodeAddresses:e,zoneItems:n}},[qr,xt]),ui=On(e=>pi.get(e)??[],[pi]),fi=e=>{const n=ai.get(e);return n?ui(n.zone)[n.index]:void 0},hi=e=>q(_o,xt,e),mi=e=>{if(!_o.slotsOf||e===ke)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=fi(e.slice(0,n));if(!t)return null;const o=hi(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}},gi=(()=>{if(!J(Lo))return null;const e=`${Lo.nodeId}:${Lo.slot}`;return mi(e)?.slot.panel===Lo.kind?e:null})(),yi=In(null);Pn(()=>{const e=yi.current;if(yi.current=null,!gi||!J(Lo))return;const n=Lo.nodeId;Do(n,{scroll:e!==gi}),Sr(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[Lo]);const ki=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=ai.get(e);n&&(n.zone===ke?Ri(n.index):ul(n.zone,n.index,e,fi(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&gi!==i&&(yi.current=i),Yo(null,r),eo||St({type:"setUi",ui:{rightSideBarVisible:!0}}),Ei(o)},Si=(e,n,t)=>{const o=`${e}:${n}`;if(Sr(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;gi!==o&&(yi.current=o);Yo(null,{kind:t,nodeId:e,slot:n})},vi=(e,n,t)=>{if(pt||!_o.moveSlot)return;const o=fi(e),r=o?hi(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:Qn,index:n},s=pn(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=_o.moveSlot(e,n,s);"string"==typeof d&&Si(e,d,i.panel)},bi=dr(),wi=Bn(()=>{const e=/* @__PURE__ */new Map;for(const n of bi??[])e.set(n.slug,n.name);return e},[bi]),xi=e=>me(e,li,ir.plainText,e=>wi.get(e),ir.rowName),zi=(e,n)=>{const t=xt.components[e.type]?.fields,o=n===ke||jl(n)?"section":"block",r=n===ke&&(Mt(e)||jt(e)||Nt(e.type)),i="block"===o?ge(t):r?null:ye(t);return ir.renamePropOf?ir.renamePropOf(e,o,i):i},Ci=(e,n,t,o)=>{if(!(!pt&&fr?.zone===e&&fr.index===n))return;const r=(t,o)=>{hr(null),o&&((e,n,t)=>{const o=ui(e)[n];if(!o)return;const r=zi(o,e);r&&qt.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
9
+ return Jn("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":Lt.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)},Ii=e(U(),Ht),Bi=Ii.scope({target:yn,siteId:tt,docId:kn}),Ni=xt,Pi=(e,n)=>n===ke?di(e):li(e),Oi=(e,n,t)=>{const o=Ii.plan(Bi,t,Pi(t.type,e),Ni);o&&(o.changed&&qt.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Or(o.message))},$i=Q({nodesIn:ui,nodeAt:(e,n)=>ui(e)[n]??null,labelOf:(e,n)=>n===ke?di(e):li(e),renamePropOf:zi,beginRename:(e,n)=>hr({zone:e,index:n}),history:{hasPast:vt.hasPast,hasFuture:vt.hasFuture,back:()=>vt.back(),forward:()=>vt.forward()},openPageSettings:()=>{qt.select(null),Eo(L)},pageSettingsLabel:Lt.pageSettings,words:{menu:Wt,styleClipboard:Ht,screen:Lt.menu},readOnly:Boolean(pt),collapseAll:()=>Sr(new Set(ui(ke).map(e=>String(e.props.id)))),onPasteRefused:e=>Or(e?Lt.pasteRefused({name:e.label}):Lt.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>Ll(e,n),menuRows:Xo.menuRows,isLocked:e=>Qo(e.type),duplicateBlocked:e=>er(kt.data,e),permits:e=>Se(xt,e.type),nodeOps:ii,isPinned:(e,n)=>n===ke&&(Mt(e)||jt(e)),sectionBand:_r,locate:e=>ai.get(e)??null,rowNameOf:(e,n)=>n===ke?ci(e):xi(e),selectAt:(e,n,t,o)=>{e===ke?Ri(n):ul(e,n,t,o??"")},slotRung:e=>{const n=mi(e);return n?.slot.panel?{label:n.slot.label,select:()=>ki(n.node,n.slot,!1)}:null},style:{held:()=>ae(Bi),canCopy:e=>Ii.rows(Ni,e).some(e=>!1!==e.counted),copy:(e,n)=>Ii.copy(Bi,e,Pi(e.type,n),Ni),paste:(e,n,t)=>Oi(e,n,t)},keys:ht?{target:xo,selected:()=>{const e=kt.ui.itemSelector;return e?{zone:e.zone??ke,index:e.index}:null},held:()=>ti.get(),readOnly:Boolean(pt),onDone:({done:e,name:n})=>{"copied"===e&&Or(Lt.copied({name:n}))}}:void 0},wo),Mi=In({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});Pn(()=>{Mi.current={copy:(e,n)=>Ii.copy(Bi,e,Pi(e.type,n),Ni),paste:Oi,at:()=>{const e=kt.ui.itemSelector;if(!e)return null;const n=e.zone??ke,t=ui(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(pt)}});const ji=On(e=>{const n=pe(e);if(!n)return;const t=Mi.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))},[]);Pn(()=>{if(!xo)return;const e=e=>ji(e);return xo.addEventListener("keydown",e),()=>xo.removeEventListener("keydown",e)},[ji,xo]),mn(wo,"keydown",ji);const Ai=qr.map(e=>e.props.id).join("|");Pn(()=>{const e=wo?.document??null,n=wo?.window??null;let t=0;const o=[],r=()=>{if(!e)return void To(e=>e.length?[]:e);const n=qr.findIndex(jt),t=n>=0?n:qr.length,o=n=>{const t=qr[n]?.props?.id;return null==t?null:e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(hn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=qr.length>0&&!Mt(qr[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=_n(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})}To(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()}},[wo,Ai,lo,Fr,Qt,eo,bt?.props.id]);const Ti=wo?.document??null,Li=wo?.window??null;Pn(()=>{const e=vo.current;if(!e||!Ti||!Li)return;const n=[],t=()=>{const n=Ti.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&Li.scrollTo({left:Li.scrollX,top:Li.scrollY+t,behavior:"instant"}),!0};return vo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[Ti,Li]);const Ei=e=>{Xo.holdCanvasOn?Xo.holdCanvasOn(e):c(e)},Ri=e=>{Eo(L),qt.select({index:e}),Xo.sectionPressed?.(qr[e]);const n=qr[e]?.props?.id;n&&Ei(n)},Vi=e=>{const{floor:n,cap:t}=_r(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=bt&&Lo.kind!==$t?.kind?qr.findIndex(e=>e.props.id===bt.props.id):-1;return o(r>=0?r+1:t)},Fi=(e,n)=>{const{floor:t,cap:o}=_r(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(qt.reorderComponent(ke,e,i),qt.select({index:i}),{moved:!0,dest:i})},Wi=(e,n,t,o)=>{Eo(L),qt.select(o?{index:o.index,zone:o.zone}:{index:e}),c(n),Or(Lt.sectionAdded({name:t}))},Hi=(e,n)=>{const t=Vi(n),o=tr(e,{nodeDefaults:si,newNodeId:Ce,sectionLabel:di,blockIsOffered:rr}),r=o?qt.insertNode(ke,t,o):qt.insertSection(e,t);return Wi(t,r,di(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:c}of be(xt,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=or(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:c,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},Di=e=>Ji(ke,e),Ji=(e,n)=>{Nr.current=document.activeElement??null,po&&(Oo.current=$o.current,$o.current=!1,uo()),jo(null===n?null:{zone:e,index:n}),Po(!0),Qt||(Oo.current=!0,St({type:"setUi",ui:{leftSideBarVisible:!0}}))},Ui=()=>{Po(!1),jo(null),Oo.current&&St({type:"setUi",ui:{leftSideBarVisible:!1}}),Oo.current=!1},Gi=(e,n)=>ir.rowName?n?Mt(e)?ir.rowName(e,"section",Lt.header):jt(e)?ir.rowName(e,"section",Lt.footer):Nt(e.type)?ir.rowName(e,"section",li(e.type)):ci(e):xi(e):n?di(e.type):li(e.type),Yi=e=>n=>{e()},Ki=()=>Xo.editPinnedSource?.(),Xi=(e,n,t)=>{if(pt)return null;const o=ui(e)[n];return o&&!Se(xt,o.type).delete?null:/* @__PURE__ */Jn(Le,{kind:"delete",label:Lt.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=ui(e)[n]?.props?.id;null!=t&&ri(String(t))})(e,n),children:/* @__PURE__ */Jn(Fn,{size:15})})},Zi=e=>ir.rowPreview?.(e)||void 0,qi=e=>ir.rowMarks?.(e)??void 0,_i=(e,n,t)=>ir.rowActions?.(e,n,t)??null,Qi=(e,n,t,o)=>{if(pt)return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
10
+ return Jn(Le,{kind:"eye",label:r?Lt.showNamed({name:o}):Lt.hideNamed({name:o}),onClick:()=>nl(e,n,t),children:/* @__PURE__ */Jn(r?Wn:Hn,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},el=e=>fs(ke,e),nl=(e,n,t)=>{qt.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},tl=e=>we(xt,e),ol=e=>be(xt,e),rl=e=>_o.slotsOf?hi(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:xe(e,n.slot)})):[{slot:null,rung:null,kids:ol(e)}],il=e=>_o.slotsOf?rl(e).flatMap(e=>e.kids):ol(e),ll=e=>Boolean(_o.slotsOf)&&hi(e).some(e=>e.rung),sl=(e,n,t)=>null===t?void 0===n?or(e):or(e,n):or(e,n,t),dl=(e,n,t)=>{const o=ze(xt,e.type,n)&&(t||il(e).length>0||ll(e));return{collapsible:o,folded:o&&Cr(String(e.props.id))}},cl=(e,n,t)=>rl(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>dl(e,r,t(e.type)).collapsible?[String(e.props.id),...cl(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),al=e=>il(e).length>0||ll(e)||Boolean(or(e.type)),pl=e=>Boolean(or(e)),ul=(e,n,t,o)=>{if(Eo(L),or(o)?.spec?.slider){const t=e.split(":")[0];a(t,n),qt.select({index:n,zone:e}),c(t)}else qt.select({index:n,zone:e}),Ei(t)},fl=(e,n,t,o,r)=>{const i=`${e}:${n}`;qt.insertComponent(i,t,o),or(r)?.spec?.slider?requestAnimationFrame(()=>{a(e,o),qt.select({index:o,zone:i})}):qt.select({index:o,zone:i})},hl=In(/* @__PURE__ */new Set);Pn(()=>{qr.forEach(e=>{const n=or(e.type)?.spec;if(!n)return;const t=e.props.id;if(hl.current.has(t))return;hl.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(si)).forEach((e,t)=>Kt.seedChild(o,t,n.childType,e))})},[qr,Kt,si]);const ml=In(/* @__PURE__ */new Set);Pn(()=>{qr.forEach((e,n)=>{const t=e.props.id;if(ml.current.has(t))return;const o=i(e,tl(e.type));ml.current.add(t),o&&Kt.replaceComponent(ke,n,{...e,props:o})})},[qr,Kt]),G(Kt,xt);const gl=qr.findIndex(jt),yl=gl>=0?qr[gl]:null,kl=At?qr.findIndex(Mt):-1,Sl=kl>=0?qr[kl]:null,vl=zt.groupTab,bl=Bn(()=>vl?e=>Nt(e.type):void 0,[vl]),wl=Boolean(zt.groupBadge),xl=zt.groupBadge?/* @__PURE__ */Jn("span",{className:"es-tree-group-badge",children:/* @__PURE__ */Jn(jn,{tone:"info",size:"xs",children:zt.groupBadge})}):void 0,zl=qr.find(e=>e.type===It)??null,Cl=qr.find(e=>e.type===Bt)??null,Il=gl>=0?gl:qr.length,Bl=[];qr.forEach(e=>{jt(e)||(al(e)&&Bl.push(String(e.props.id)),Bl.push(...cl(e,1,pl)))}),yl&&(Bl.push(String(yl.props.id)),Bl.push(...cl(yl,1,pl)));const Nl=Bl.length>0&&Bl.every(e=>kr.has(e)),Pl=e=>{const n=ir.blockRowName(e,li);return ir.rowName?ir.rowName(e,"block",n):n},Ol=(e,n,t,o)=>{const r=ui(e)[t];if(!r)return;const i={...xn(e),index:t},l={...xn(n),index:Math.min(Math.max(o,0),ui(n).length)},s=pn(i,l);if(e!==n||s!==t)try{oi.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof Cn))throw e}},$l=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of ol(e))n.add(r),t(o)};for(const t of tl(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},Ml=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=ai.get(n);if(!e)return null;if(e.zone===ke)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},jl=e=>{const n=e.slice(0,e.indexOf(":")),t=qr.find(e=>Nt(e.type)&&String(e.props.id)===n);return t&&Pt(n)===e?t:null},Al=(e,n)=>{const t=jl(e);return!t||(!zt.groupAccepts||zt.groupAccepts(t.type,n,ui(e).length))},Tl=(e,n,t)=>{if(e.rung){const t=fi(e.rung.nodeId),o=t?hi(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===Qn&&n.index>=0&&n.index<=o}if(n.slot===Qn)return!1;if(e.add)return Vl(e.add,n);const o=wn(n);if(Nt(e.type))return!1;const r=jl(o),i=jl(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!Al(o,e.type))&&(n.index>=0&&n.index<=ui(o).length));if(e.zone===ke||o===ke){if(e.zone!==o)return!1;const{floor:t,cap:r}=_r();return n.index>=t&&n.index<=r}if(n.index<0||n.index>ui(o).length)return!1;if(e.zone===o)return!0;const l=yl&&!zt.lastIsOpen?String(yl.props.id):null;return(!l||Ml(e.zone)!==l&&Ml(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??ui(e)[t];if(!r)return!1;const i=n.split(":")[0],l=ai.get(i),s=l?ui(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&$l(r).has(n))return!1;const d=or(s.type,nr(kt?.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?.(ui(n),r))})(e.zone,o,e.index,t)},Ll=(e,n)=>{const t=wn(e.from),o=e.node;return t===wn(n)?Al(t,o.type):Tl({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},El=e=>{const n=e.slice(0,e.indexOf(":")),t=ai.get(n),o=t?ui(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=or(o.type,nr(kt?.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=r.choices??(r.spec?[{type:r.spec.childType,label:li(r.spec.childType)}]:[]),l=mi(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:Gi(o,t.zone===ke)}},Rl=(e,n)=>{if("section"!==e.kind)return e;const t=wn(n);return t===ke||jl(t)?e:El(t)?.choices.some(n=>n.type===e.type)?{kind:"block",type:e.type}:e},Vl=(e,n)=>{const t=Rl(e,n),o=wn(n);if("block"!==t.kind){if(jl(o)){const e="section"===t.kind?t.type:t.template.node.type;return Al(o,e)&&n.index>=0&&n.index<=ui(o).length}if(o!==ke)return!1;const{floor:e,cap:r}=_r();return n.index>=e&&n.index<=r}if(o===ke)return!1;const r=El(o);return!(!r||!r.choices.some(e=>e.type===t.type))&&!r.target.spec?.addBlocked?.(ui(o))},Fl=(e,n)=>{const t=Rl(e,n);if("block"!==t.kind&&jl(wn(n)))return void((e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&Al(n,o)){if("section"===e.kind)qt.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;qt.insertNode(n,t,ni(e.template.node))}Eo(L),qt.select({index:t,zone:n})}})(t,wn(n),n.index);if("section"===t.kind)return void Hi(t.type,n.index);if("template"===t.kind)return void((e,n,t)=>{const o=Vi(t),r=qt.insertNode(ke,o,n);Wi(o,r,e)})(t.template.name,ni(t.template.node),n.index);const o=wn(n),r=El(o);r&&(r.target.spec?fl(r.parentId,r.target.slot,t.type,n.index,r.parent.type):((e,n,t)=>{qt.insertComponent(e,n,t),Eo(L),qt.select({index:t,zone:e})})(o,t.type,n.index))},Wl=(e,n)=>{e.rung?vi(e.rung.nodeId,e.index,n.index):e.add?Fl(e.add,n):e.zone===ke?Fi(e.index,n.index):Ol(e.zone,wn(n),e.index,n.index)},[Hl]=Nn(()=>cn()),Dl=an({keyOf:e=>e.id,readOnly:Boolean(pt),session:Hl,canDrop:Tl,onDrop:Wl,onStep:(e,n)=>{e.rung?vi(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===ke?((e,n)=>{const t=di(qr[e]?.type??""),o=Fi(e,n<0?e-1:e+2);if(!o.moved)return void Or(n<0?Lt.sectionFirst({name:t}):Lt.sectionLast({name:t}));const{floor:r,cap:i}=_r();Or(Lt.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):Ol(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),Jl=On(e=>{const{floor:n,cap:t}=_r(),o=[];for(const r of e.nodes){const e=wn(r.place),i=ui(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(Mt(i)||jt(i)||Qo(i.type))continue;if(Nt(i.type))continue;const l=Boolean(jl(e)),s=e===ke||l;e===ke&&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?di(i.type):xi(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=wn(e.list);if(n===ke&&0===e.children.length)return[{...e,addLabel:Lt.addSection,addAlways:!0}];const t=El(n),o=t?.target.spec?.addLabel;return e.children.length>0||Boolean(t?.choices.length)||Boolean(jl(n))?[o?{...e,addLabel:o}:e]:[]}),i=r.flatMap(e=>{const n=wn(e.list),t=n===ke||jl(n)?null:El(n);return t?.choices.length?rn(e,t.target.spec?.addLabel??Lt.addBlockHere):[]});return{sources:o,zones:r,seams:i}},[kt.data]),Ul=null==bt?.props.id?null:String(bt.props.id),Gl=On(e=>{const n=xt,t=e=>!e.item.rung&&null!==zn(kt.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(Ul);return i||(r($e(kt.data,n,o.item.id,Ul,bl))??o)},[kt.data,xt,Ul,bl]),[Yl,Kl]=Nn(null);mn(wo,"mouseover",e=>{if(!vl)return;const n=gn(e.target),t=n?Kn(kt.data,xt,n):null;t!==Yl&&Kl(t)}),mn(wo,"mouseout",e=>{vl&&!e.relatedTarget&&Kl(null)});const Xl=e=>Mt(e)||jt(e)||Nt(e.type),Zl=[];if(vl){const e=Ul?Kn(kt.data,xt,Ul):null;for(const n of/* @__PURE__ */new Set([e,Yl])){const e=n?qr.find(e=>String(e.props.id)===n):void 0;if(!e||!Xl(e))continue;const t=vl(e);t&&Zl.push({id:String(e.props.id),label:t,below:Mt(e)||e.type===It})}}const ql=le(),_l=In(null);Pn(()=>{const e=zt.changeNotice;if(!e)return;const n=JSON.stringify(qr.filter(Xl)),t=_l.current;if(_l.current={doc:kn,bands:n,index:vt.index},!t||t.doc!==kn||t.bands===n)return;vt.hasPast&&vt.index>=t.index&&!Yn.has(ql)&&(Yn.add(ql),Or(e,"success",{action:{label:Lt.bar.undo,onClick:()=>vt.back()},duration:8e3}))},[qr]);const Ql=e=>{Eo(L),qt.select(e.zone===ke?{index:e.index}:{index:e.index,zone:e.zone})},es=Y(),ns=()=>({data:kt.data,device:lo,ops:qt,inspector:Ko}),ts=es?.model,os=Bn(()=>ts?e=>ts(e,Jl(e),ns()):Jl,[ts,Jl,lo]),rs=es?.measure,is=rs?(e,n)=>rs(e,n,ns()):void 0,ls=es?.canDrop,ss=ls?(e,n)=>ls(e,n,Tl,ns()):Tl,ds=es?.drop,cs=ds?(e,n)=>ds(e,n,Wl,ns()):Wl,as=es?.pick,ps=as?e=>as(e,Ql,ns()):Ql,us=e=>{const n=wn(e),t=mi(n);t&&ki(t.node,t.slot,!1),Ji(n,e.index)},fs=(e,n)=>/* @__PURE__ */Jn(Ee,{...pt?{}:Dl.seam({place:{...xn(e),index:n}})},`seam:${e}:${n}`),hs={rowClick:Yi,isCollapsed:Cr,toggleCollapse:Ir},ms=e=>{const n=String(e.props.id),t=qr.findIndex(e=>String(e.props.id)===n),o=Pt(n),r=ui(o),i=Cr(n),l=li(e.type),s=ir.rowName?ir.rowName(e,"section",l):l,d=e=>fs(o,e);/* @__PURE__ */
11
+ return Un(Gn,{children:[
12
+ /* @__PURE__ */Jn(Me,{words:Et,icon:/* @__PURE__ */Jn(sr,{type:e.type,size:13}),name:s,preview:Zi(e),marks:qi(e),onSelect:()=>Ri(t),nameSlot:Ci(ke,t,n,s),selected:Vo===n,badge:xl,actions:_i(e,ke,t)??void 0,rowProps:{"data-node-id":n,onClick:Yi(()=>Ri(t))},fold:{open:!i,label:"section",onToggle:()=>Ir(n)}}),!i&&/* @__PURE__ */Un(je,{children:[r.map((n,t)=>{const r=String(n.props.id),i=ci(n),l=al(n),s=l&&Cr(r),c=()=>ul(o,t,r,e.type),{rowProps:a,...p}=Dl.row({item:{id:r,zone:o,index:t,type:n.type},place:{...xn(o),index:t}},{"data-node-id":r,onClick:Yi(c)});/* @__PURE__ */
13
+ return Un(Mn,{children:[d(t),
14
+ /* @__PURE__ */Jn(Me,{words:Et,icon:/* @__PURE__ */Jn(sr,{type:n.type,size:13}),name:i,preview:Zi(n),marks:qi(n),onSelect:c,nameSlot:Ci(o,t,r,i),selected:Vo===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Ir(r)}:void 0,actions:/* @__PURE__ */Un(Gn,{children:[Xi(o,t,i),_i(n,o,t),Qi(o,t,n,i)]}),rowProps:a}),l&&!s&&/* @__PURE__ */Jn(je,{children:ks(n,2)})]},r)}),d(r.length)]})]})},gs=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=Dl.dragging,d=!Cr(l)&&s?.rung?.nodeId!==i,c={...xn(l),index:0},a=s&&!s.rung&&Tl(s,c)?c:void 0,p=()=>ki(e,n,!0),{rowProps:u,...f}=Dl.row({item:{id:`rung:${l}`,zone:`${i}:${Qn}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:Qn,index:t},into:a,canDrag:Boolean(_o.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:Yi(p)}),h=pt?null:_o.slotActions?.(e,n.slot);/* @__PURE__ */
15
+ return Un(Mn,{children:[n.heading,
16
+ /* @__PURE__ */Jn(Me,{words:Et,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:gi===l,...f,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Ir(l)},actions:h&&h.length>0?/* @__PURE__ */Jn(Gn,{children:h.map((t,o)=>/* @__PURE__ */Jn(Le,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(pt||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&Si(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__ */Jn(Fn,{size:15}):/* @__PURE__ */Jn(Dn,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */Jn(je,{children:r})]},l)},ys=(e,n)=>{const t=rl(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
17
+ return Jn(Gn,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=sl(e.type,void 0,t.slot),d=s?`${e.props.id}:${s.slot}`:null,c=null===t.slot?null:`${e.props.id}:${t.slot}`,a=(e,n)=>fs(e,n),p=/* @__PURE__ */Un(Gn,{children:[i.map(({child:n,zone:t,index:o})=>{const r=Vo===String(n.props.id),{collapsible:i,folded:s}=dl(n,l,pl(n.type)),d=String(n.props.id),c=Pl(n),p=()=>ul(t,o,d,e.type),{rowProps:u,...f}=Dl.row({item:{id:d,zone:t,index:o,type:n.type},place:{...xn(t),index:o}},{"data-node-id":d,onClick:Yi(p)});/* @__PURE__ */
18
+ return Un(Mn,{children:[0===o&&a(t,0),
19
+ /* @__PURE__ */Jn(Me,{words:Et,icon:/* @__PURE__ */Jn(sr,{type:n.type,size:13}),name:c,preview:Zi(n),marks:qi(n),onSelect:p,nameSlot:Ci(t,o,d,c),selected:r,hidden:Boolean(n.props._hidden),...f,fold:i?{open:!s,label:"group",onToggle:()=>Ir(d)}:void 0,actions:/* @__PURE__ */Un(Gn,{children:[Xi(t,o,c),_i(n,t,o),Qi(t,o,n,c)]}),rowProps:u}),i&&!s&&/* @__PURE__ */Jn(je,{children:ys(n,l+1)}),a(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===c?d&&!i.some(e=>e.zone===d)?a(d,0):null:0!==i.length||!t.rung&&d!==c?null:a(c,0)]});return t.rung?gs(e,t.rung,r++,o,p):/* @__PURE__ */Jn(Mn,{children:p},t.slot??"")})})},ks=(e,n)=>{const t=nr(kt?.data,e.type,String(e.props.id)),o=rl(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
20
+ return Jn(Gn,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=sl(e.type,t,o.slot),c=d?.spec??null,a=c&&Array.isArray(e.props[c.slot])?e.props[c.slot]:[],p=d&&d.choices?{slot:d.slot,choices:d.choices}:null,u=String(e.props.id),f=c&&!c.fixed?`${u}:${c.slot}`:null,h=p?`${u}:${p.slot}`:null,m=(e,n)=>fs(e,n),g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(c&&!c.fixed&&(null===g||g===f)),k=/* @__PURE__ */Un(Gn,{children:[l.map(({child:n,zone:t,index:o})=>{const r=Vo===String(n.props.id),i=xi(n),l=String(n.props.id),{collapsible:d,folded:c}=dl(n,s,pl(n.type)),a=tl(n.type),p=1===a.length?`${l}:${a[0]}`:null,u=p?{...xn(p),index:ui(p).length}:void 0,f=Dl.dragging,h=u&&f&&Tl(f,u)?u:void 0,g=()=>ul(t,o,l,e.type),{rowProps:y,...k}=Dl.row({item:{id:l,zone:t,index:o,type:n.type},place:{...xn(t),index:o},into:h,canDrag:!Qo(n.type)},{"data-node-id":l,onClick:Yi(g)});/* @__PURE__ */
21
+ return Un(Mn,{children:[0===o&&m(t,0),
22
+ /* @__PURE__ */Jn(Me,{words:Et,icon:/* @__PURE__ */Jn(sr,{type:n.type,size:13}),name:i,preview:Zi(n),marks:qi(n),onSelect:g,nameSlot:Ci(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...k,fold:d?{open:!c,label:"group",onToggle:()=>Ir(l)}:void 0,actions:Qo(n.type)?_i(n,t,o)??void 0:/* @__PURE__ */Un(Gn,{children:[Xi(t,o,i),_i(n,t,o),Qi(t,o,n,i)]}),rowProps:y}),d&&!c&&/* @__PURE__ */Jn(je,{children:ks(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&c&&
23
+ /* @__PURE__ */Jn(w,{small:!0,label:c.addLabel,blocked:c.addBlocked?.(a)??null,onAdd:()=>fl(e.props.id,c.slot,c.childType,a.length,e.type)}),null===g?h&&!l.some(e=>e.zone===h)?m(h,0):null:0!==l.length||(o.rung?y:g!==h)?null:m(g,0)]});return o.rung?gs(e,o.rung,i++,r,k):/* @__PURE__ */Jn(Mn,{children:k},o.slot??"")})})},Ss=No||null!==po,vs=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:Qt&&!Ss&&qo===e.id,onSelect:()=>Yr(e.id)}:e,bs=[...(Xo.railLead??[]).map(vs),{id:"sections",label:Lt.layers,icon:/* @__PURE__ */Jn(Ve,{}),active:Qt&&!Ss&&"sections"===qo,onSelect:()=>Yr("sections")},...(Xo.railTrail??[]).map(vs)];ao?bs.push({id:"media",label:Lt.railMedia,icon:/* @__PURE__ */Jn(Fe,{}),active:Qt&&!No&&(null!==po||"media"===qo),onSelect:()=>Yr("media")}):mt&&bs.push({id:"media",label:Lt.railMedia,icon:/* @__PURE__ */Jn(Fe,{}),onSelect:Kr});const ws=[...Xo.railLead??[],...Xo.railTrail??[]].find(e=>"panel"in e&&e.id===qo),xs=Boolean(Tt?.foldable)&&!Zo,zs=Tt?.label??(gt?Lt.pageSections:Lt.templateSections),Cs=xs&&Cr(et),Is=/* @__PURE__ */Un(Gn,{children:[qr.map((e,n)=>{if(Mt(e)||jt(e)||Nt(e.type))return null;const t=Vo===String(e.props.id),o=Boolean(e.props._hidden);ol(e);const r=String(e.props.id),i=Xo.hasOwnRows?.(e)??!1,l=al(e)||i,s=l&&Cr(r),d=tl(e.type),c=1===d.length?`${r}:${d[0]}`:null,a=c?{...xn(c),index:ui(c).length}:void 0,p=Dl.dragging,u=a&&p&&Tl(p,a)?a:void 0,{rowProps:f,...h}=Dl.row({item:{id:r,zone:ke,index:n,type:e.type},place:{...xn(ke),index:n},into:u},{"data-node-id":r,onClick:Yi(()=>Ri(n))});/* @__PURE__ */
24
+ return Un(Mn,{children:[n>0&&el(n),
25
+ /* @__PURE__ */Jn(Me,{words:Et,icon:/* @__PURE__ */Jn(sr,{type:e.type,size:13}),name:ci(e),preview:Zi(e),marks:qi(e),onSelect:()=>Ri(n),nameSlot:Ci(ke,n,r,ci(e)),selected:t,hidden:o,...h,fold:l?{open:!s,label:"section",onToggle:()=>Ir(r)}:void 0,actions:/* @__PURE__ */Un(Gn,{children:[Xi(ke,n,ci(e)),_i(e,ke,n),Qi(ke,n,e,ci(e))]}),rowProps:f}),al(e)&&!s&&/* @__PURE__ */Un(je,{children:[ks(e,1),Xo.partRows?.(e,hs)]}),i&&!s&&/* @__PURE__ */Jn(je,{children:Xo.ownRows?.(e,n,hs)})]},String(e.props.id??n))}),!Zo&&Il>0&&el(Il)]}),Bs=(e,n,t)=>{const o=String(e.props.id),r=il(e).length>0||ll(e)||Boolean(or(e.type)),i=r&&Cr(o),l="header"===t?Lt.header:Lt.footer,s=ir.rowName?ir.rowName(e,"section",l):l;/* @__PURE__ */
26
+ return Un(Gn,{children:[
27
+ /* @__PURE__ */Jn(Me,{words:Et,icon:/* @__PURE__ */Jn(sr,{type:t,size:13}),name:s,preview:Zi(e),marks:qi(e),badge:xl,onSelect:()=>Ri(n),nameSlot:Ci(ke,n,o,s),selected:Vo===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Ir(o)}:void 0,actions:_i(e,ke,n)??void 0,rowProps:{"data-node-id":o,onClick:Yi(()=>Ri(n))}}),r&&!i&&/* @__PURE__ */Jn(je,{children:ys(e,1)})]})};return(Xo.wrap??(e=>e))(
28
+ /* @__PURE__ */Jn(K,{target:wo,children:/* @__PURE__ */Un("div",{ref:bo,className:"sf-editor es-editor",style:qe(vr),onContextMenu:$i.onEditorContextMenu,...m(fn),children:[
29
+ /* @__PURE__ */Un(We,{children:[
30
+ /* @__PURE__ */Jn(He,{items:bs,ariaLabel:Lt.bar.views}),
31
+ /* @__PURE__ */Un(De,{children:[
32
+ /* @__PURE__ */Jn(Je,{label:Lt.bar.undo,disabled:Boolean(pt)||!vt.hasPast,onClick:()=>vt.back(),children:/* @__PURE__ */Jn(Ln,{})}),
33
+ /* @__PURE__ */Jn(Je,{label:Lt.bar.redo,disabled:Boolean(pt)||!vt.hasFuture,onClick:()=>vt.forward(),children:/* @__PURE__ */Jn(En,{})}),
34
+ /* @__PURE__ */Jn(Ue,{}),
35
+ /* @__PURE__ */Jn(Ge,{devices:no,value:lo,onChange:so}),
36
+ /* @__PURE__ */Jn(Je,{label:Lt.bar.refresh,tip:Lt.bar.refreshTip,onClick:()=>{vo.current=(()=>{const e=wo?.document;if(!e)return null;const n=qr.findIndex(jt),t=n>=0?n:qr.length;let o=null;for(let n=0;n<t;n++){const t=qr[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??qr[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),So(e=>e+1)},children:/* @__PURE__ */Jn(Rn,{})})]}),
37
+ /* @__PURE__ */Un(De,{kind:"right",style:{minWidth:300},children:[
38
+ /* @__PURE__ */Jn(l,{input:Io,words:Lt.saveStatus}),Xo.barLead?.(),Xo.barTrail?.(),Xo.mainAction||!Xo.barMain?/* @__PURE__ */Jn(s,{input:Io,action:Xo.mainAction??{label:Lt.done,onPress:()=>{ot(kt.data)}},readOnly:Boolean(pt),saveSwitch:ft,onToggleAutoSave:st,onSaveNow:Bo,bar:Lt.bar,words:Lt.saveStatus}):Xo.barMain()]})]}),
39
+ /* @__PURE__ */Jn(ee,{}),
40
+ /* @__PURE__ */Un("div",{className:"sf-body",children:[Qt?/* @__PURE__ */Un(Gn,{children:[
41
+ /* @__PURE__ */Jn("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":Lt.leftPanel,children:No?/* @__PURE__ */Jn(x,{at:Mo?{label:(e=>{const n=jl(e.zone);if(n)return Lt.add.addingTo({name:ir.rowName?Gi(n,!0):li(n.type)});if(e.zone===ke){const n=qr[e.index];return n&&!jt(n)?Lt.add.addingBefore({name:Gi(n,!0)}):Lt.add.addingAtEnd}const t=El(e.zone);return t?Lt.add.addingTo({name:t.parentName}):Lt.add.addingHere})(Mo),onClear:()=>jo(null)}:void 0,placeBlocks:Mo&&Mo.zone!==ke?El(Mo.zone)?.choices:void 0,canTake:Mo?e=>{if(!Mo)return null;const n={...xn(Mo.zone),index:Mo.index};if(Vl(e,n))return null;const t=jl(Mo.zone);if(t)return Lt.add.notInside({name:Gi(t,!0)});if(Mo.zone===ke)return Lt.add.onlySections;const o=El(Mo.zone);return o?Lt.add.notInside({name:o.parentName}):Lt.add.onlySections}:void 0,onPick:Mo?e=>{if(!Mo)return;const n={...xn(Mo.zone),index:Mo.index};Vl(e,n)&&(Fl(e,n),Ui())}:void 0,itemFor:e=>({id:`new:${e.kind}:${"template"===e.kind?e.template.id:e.type}`,zone:"",index:-1,type:"template"===e.kind?e.template.node.type:e.type,add:e}),session:Hl,siteWide:Xo.addPanelRow?.(Ui),onClose:Ui,onHide:Ur,readOnly:Boolean(pt)}):po&&co?
42
+ /* @__PURE__ */Jn(I,{panel:co,pick:po,onHide:Ur}):ws?ws.panel({onHide:Ur,notify:Or}):"media"===qo&&co?/* @__PURE__ */Jn(I,{panel:co,pick:null,onHide:Ur}):/* @__PURE__ */Un(Gn,{children:[
43
+ /* @__PURE__ */Jn(z,{icon:/* @__PURE__ */Jn(Ve,{}),title:Lt.layers,context:Jt,actions:/* @__PURE__ */Un(Gn,{children:[!pt&&/* @__PURE__ */Jn(Ye,{label:Lt.add.title,onClick:()=>Di(null),children:/* @__PURE__ */Jn(Vn,{size:15})}),
44
+ /* @__PURE__ */Jn(Ye,{label:Nl?Lt.expandAll:Lt.collapseAll,title:0===Bl.length?Lt.nothingToFold:void 0,disabled:0===Bl.length,onClick:()=>Sr(e=>{const n=new Set(Bl);return Nl?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Bl])}),children:/* @__PURE__ */Jn(Zn,{expand:Nl})})]}),onHide:Ur}),
45
+ /* @__PURE__ */Un(Ae,{className:"sf-tree sf-scroll",words:Et,children:[
46
+ /* @__PURE__ */Jn(Me,{words:Et,icon:/* @__PURE__ */Jn(sr,{type:"page",size:13}),name:Lt.pageSettings,onSelect:Xr,selected:!bt&&Ro,rowProps:{onClick:Yi(Xr)}}),zl&&/* @__PURE__ */Un(Gn,{children:[!wl&&/* @__PURE__ */Jn(Te,{children:Lt.header}),ms(zl)]}),!Zo&&yt&&!(wl&&zl)&&/* @__PURE__ */Un(Gn,{children:[!wl&&/* @__PURE__ */Jn(Te,{children:Lt.header}),!At&&/* @__PURE__ */Jn(Me,{words:Et,icon:/* @__PURE__ */Jn(sr,{type:"header",size:13}),name:Lt.header,badge:xl,onSelect:Zr,selected:Lo.kind===$t?.kind,rowProps:{onClick:Yi(Zr)}})]}),!Zo&&Sl&&!(wl&&zl)&&Bs(Sl,kl,"header"),!Zo&&!xs&&/* @__PURE__ */Jn(Te,{children:zs}),xs?/* @__PURE__ */Un(Gn,{children:[
47
+ /* @__PURE__ */Jn(Me,{words:Et,icon:null,name:zs,fold:{open:!Cs,label:zs,onToggle:()=>Ir(et)}}),!Cs&&/* @__PURE__ */Jn(je,{children:Is})]}):Is,yt&&!wl&&/* @__PURE__ */Jn(Te,{children:Lt.footer}),yl&&!(wl&&Cl)&&Bs(yl,gl,"footer"),!Zo&&!yl&&yt&&!wl&&/* @__PURE__ */Jn(Me,{words:Et,icon:/* @__PURE__ */Jn(sr,{type:"footer",size:13}),name:Lt.footer,onSelect:Ki,rowProps:{onClick:Yi(Ki),title:Lt.editFooter}}),Cl&&ms(Cl),Xo.treeFoot?.()]})]})}),
48
+ /* @__PURE__ */Jn(Ke,{side:"left",width:vr.left,min:Ze,max:Xe,defaultWidth:k.left,label:Lt.resizeLeftPanel,onResize:xr})]}):/* @__PURE__ */Jn(C,{side:"left",onShow:Ur}),
49
+ /* @__PURE__ */Un("div",{ref:$r,className:"sf-center sf-scroll","data-sf-canvas-head":Lr?"":void 0,style:{overflowX:Hr?"auto":"hidden",overflowY:"hidden"},children:[Lr&&/* @__PURE__ */Jn("div",{ref:Er,className:"sf-canvas-head",children:/* @__PURE__ */Jn(Lr,{device:lo})}),
50
+ /* @__PURE__ */Un("div",{className:"sf-frame-scaler",style:Dr,children:[
51
+ /* @__PURE__ */Jn("div",{className:"sf-frame "+(lo===ro?"":`sf-frame--${lo}`),style:Jr,children:/* @__PURE__ */Un("div",{className:"sf-preview-host",children:[
52
+ /* @__PURE__ */Jn(Ne.Provider,{value:bl,children:/* @__PURE__ */Jn(Ut,{},ko)}),
53
+ /* @__PURE__ */Jn(ln,{canvas:wo,session:Hl,model:os,measure:is,canDrop:ss,onDrop:cs,choose:Gl,onPick:ps,onZoneAdd:us,onSeamAdd:us,zoneAddLabel:Lt.canvasAddBlock,words:Rt.canvas,readOnly:Boolean(pt),revision:kt.data}),Ao.length>0&&/* @__PURE__ */Jn("div",{className:"sf-preview-gaps",children:Ao.map(e=>
54
+ /* @__PURE__ */Jn(sn,{index:e.index,label:Lt.addSectionHere,onInsert:()=>Di(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))})]})}),vl?/* @__PURE__ */Jn(Xn,{canvas:wo,tabs:Zl,onSelect:e=>{const n=qr.findIndex(n=>String(n.props.id)===e);n>=0&&Ri(n)}}):null]})]}),eo?/* @__PURE__ */Un(Gn,{children:[
55
+ /* @__PURE__ */Jn(g,{value:{selectChild:ul,addChild:fl,childRowName:xi,blockRowName:Pl},children:/* @__PURE__ */Jn(Gt,{mode:Lo,onOpenWebsiteSettings:Xo.openSettings??(()=>{}),onOpenSiteStyles:Xo.openStyles,onSelectNode:pr,onNotify:Or,onHidePanel:Gr,nodeActions:bt?Se(xt,bt.type):nt})}),
56
+ /* @__PURE__ */Jn(Ke,{side:"right",width:vr.right,min:Ze,max:Xe,defaultWidth:k.right,label:Lt.resizeSettingsPanel,onResize:zr})]}):
57
+ /* @__PURE__ */Jn(C,{side:"right",onShow:Gr})]}),$i.menu]})}))}export{tt as ScreenChrome};
@@ -1 +1 @@
1
- import{useScreenDocument as n}from"./chunk-ZIFDZGY7.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-VVPZMWJE.js";import{EditNotice as r}from"./chunk-IE55HNMA.js";import{useWords as e}from"./chunk-MFIRYGHW.js";import{jsx as i}from"react/jsx-runtime";function t(){const{capabilities:t,access:c,takeOverEditing:a,viewReadOnly:s,saveConflict:m,reloadFromServer:u}=n(),{noun:l}=e("screen",o);return t.hasEditGuard?/* @__PURE__ */i(r,{access:c,conflict:m,noun:l,onTakeOver:a,onViewReadOnly:s,onReload:u}):null}export{t as PageEditGuardNotices};
1
+ import{useScreenDocument as n}from"./chunk-FBS75I6E.js";import{DEFAULT_SCREEN_WORDS as o}from"./chunk-VVPZMWJE.js";import{EditNotice as r}from"./chunk-IE55HNMA.js";import{useWords as e}from"./chunk-MFIRYGHW.js";import{jsx as i}from"react/jsx-runtime";function t(){const{capabilities:t,access:c,takeOverEditing:a,viewReadOnly:s,saveConflict:m,reloadFromServer:u}=n(),{noun:l}=e("screen",o);return t.hasEditGuard?/* @__PURE__ */i(r,{access:c,conflict:m,noun:l,onTakeOver:a,onViewReadOnly:s,onReload:u}):null}export{t as PageEditGuardNotices};
@@ -1 +1 @@
1
- import{useEaselSession as e}from"./chunk-O7Q4DDJT.js";import{styleMenuItems as n}from"./chunk-V7U33NF2.js";import{useHostEscape as t}from"./chunk-U3JP4VGF.js";import{createNodeClipboard as o,nodeMenuItems as l}from"./chunk-OSPUG6S6.js";import{DEFAULT_NODE_MENU_WORDS as r}from"./chunk-WK3AFPXY.js";import{DEFAULT_SCREEN_WORDS as i}from"./chunk-VVPZMWJE.js";import{ROOT_ZONE as c}from"./chunk-PLVEGYK6.js";import{EaselMenuItems as s,menuLabel as a}from"./chunk-EA2HTX37.js";import{isTypingTarget as u,useCanvasEvent as d,framePointToHost as p}from"./chunk-ILXP5VX5.js";import{zoneKey as f,ROOT_SLOT as m,ROOT_ID as h}from"./chunk-KRXQM65X.js";import{useState as y,useCallback as k,useRef as b,useEffect as v}from"react";import{ContextMenu as g}from"efficient-shell/ui";import{UndoIcon as w,RedoIcon as x,PasteIcon as C,SettingsIcon as P,LayersIcon as z,CopyIcon as O}from"efficient-shell/icons/efficient";import{jsx as A}from"react/jsx-runtime";function D(e,n){const t=[],o=/* @__PURE__ */new Set;let l={zone:n.zone,index:n.index};for(;l;){const n=e.nodeAt(l.zone,l.index);if(!n||o.has(n.props.id))break;if(o.add(n.props.id),t.push({zone:l.zone,index:l.index,node:n,parentType:null}),l.zone===c)break;const r=l.zone.lastIndexOf(":");if(r<=0)break;l=e.locate(l.zone.slice(0,r))}for(let e=0;e<t.length-1;e+=1)t[e].parentType=t[e+1].node.type;return t}var K=o(),X=/* @__PURE__ */new WeakMap;function j(e){if(e.claimsPage)return K;const n=e.registry;if(!n)return e.cache("easel:node-clipboard",o);let t=X.get(n);return t||(t=o(),X.set(n,t)),t}function M(){return j(e())}function S(e,n,t){if(n===c){const{floor:n,cap:o}=e.sectionBand();return{parentId:h,slot:m,index:Math.min(Math.max(t,n),o)}}const o=n.lastIndexOf(":");return{parentId:n.slice(0,o),slot:n.slice(o+1),index:t}}function T(e,n,t){const o=e.isPinned(n,t),l=!o&&!e.isLocked(n)&&!e.duplicateBlocked(n),r=e.permits?.(n)??{duplicate:!0,delete:!0};return{copy:!o&&r.duplicate,cut:l&&r.duplicate&&r.delete,delete:l&&r.delete}}function E(e,n,t){const o=e.canPasteAt;if(!o)return f(n.from)===t.zone?S(e,t.zone,t.index+1):null;for(const l of D(e,t)){const t=S(e,l.zone,l.index+1);if(o(n,t))return t}return null}function V(e){if(e.defaultPrevented||e.altKey||e.shiftKey)return null;if(u(e.target))return null;const n=e.target,t=n&&"ownerDocument"in n?n.ownerDocument??n:null,o=t?.getSelection?.();if(o&&!o.isCollapsed&&o.toString().trim())return null;if(!e.metaKey&&!e.ctrlKey)return"Delete"===e.key||"Backspace"===e.key?"delete":null;const l=e.code||(1===e.key.length?`Key${e.key.toUpperCase()}`:"");return"KeyC"===l?"copy":"KeyX"===l?"cut":"KeyV"===l?"paste":null}function L(e,n,t,o){const l=e.nodeAt(t.zone,t.index);if(!l)return null;const r=l.props.id,i=e.labelOf(l.type,t.zone),c=T(e,l,t.zone);if("copy"===n)return c.copy?(e.nodeOps.copy(r,i),{done:"copied",name:i}):null;if(o.readOnly)return null;if("cut"===n)return c.cut?(e.nodeOps.cut(r,i),{done:"cut",name:i}):null;if("delete"===n)return c.delete?(e.nodeOps.remove(r),{done:"deleted",name:i}):null;const s=o.held;if(!s)return null;const a=e.isPinned(l,t.zone)?null:E(e,s,t);return a?(e.nodeOps.paste(a),{done:"pasted",name:s.label}):(e.onPasteRefused(s),{done:"refused",name:s.label})}function I(e,t){const{zone:o,index:r}=t,i=e.nodeAt(o,r);if(!i)return[];const s=i.props.id,a=e.labelOf(i.type,o),u=Boolean(i.props._hidden),d=e.nodeOps,p=e.isPinned(i,o),f=e.isLocked(i),m=!p&&!f&&!e.duplicateBlocked(i),h=e.permits?.(i)??{duplicate:!0,delete:!0},y=T(e,i,o),k=D(e,t),b=d.held,v=b&&!p?E(e,b,t):null,g=!e.readOnly,w=e.style?n({held:g?e.style.held():null,canCopy:e.style.canCopy(i,o),onCopy:()=>e.style?.copy(i,o),onPaste:()=>e.style?.paste(o,r,i),words:e.words?.styleClipboard}):[];return l({title:a,words:e.words?.menu,layer:{group:"pick",items:k.flatMap((n,t)=>{const o={label:e.rowNameOf(n.node,n.zone),checked:0===t,onClick:()=>e.selectAt(n.zone,n.index,n.node.props.id,n.parentType)},l=n.zone===c?null:e.slotRung?.(n.zone)??null;return l?[o,{label:l.label,checked:!1,onClick:l.select}]:[o]})},actions:{duplicate:g&&m&&h.duplicate?()=>d.duplicate(s):void 0,moveUp:g&&d.canStep(s,-1)?()=>d.step(s,-1):void 0,moveDown:g&&d.canStep(s,1)?()=>d.step(s,1):void 0,copy:y.copy?()=>d.copy(s,a):void 0,cut:g&&y.cut?()=>d.cut(s,a):void 0,paste:g&&b&&v?{label:b.label,run:()=>d.paste(v)}:void 0,rename:g&&e.renamePropOf(i,o)?()=>e.beginRename(o,r):void 0,hide:!g||f||p?void 0:{hidden:u,run:()=>d.setProps(s,{_hidden:!u})},delete:g&&m&&h.delete?()=>d.remove(s):void 0},style:w,extras:e.menuRows?.(i,o,r)??void 0,pinnedLine:p?R(e).pinned:void 0})}var R=e=>e.words?.screen??i.menu;function B(e){const n=R(e),t=!e.readOnly,o=[];t&&e.history.hasPast&&o.push({label:n.undo,icon:/* @__PURE__ */A(w,{}),shortcut:"⌘Z",onClick:e.history.back}),t&&e.history.hasFuture&&o.push({label:n.redo,icon:/* @__PURE__ */A(x,{}),shortcut:"⇧⌘Z",onClick:e.history.forward});const l=[],s=e.nodeOps.held,a=S(e,c,e.sectionBand().cap);if(t&&s&&(e.canPasteAt?e.canPasteAt(s,a):f(s.from)===c)){const n=a,t=e.words?.menu??r;l.push({label:t.pasteNamed({paste:t.paste,label:s.label}),icon:/* @__PURE__ */A(C,{}),shortcut:"⌘V",onClick:()=>e.nodeOps.paste(n)})}const u=[o,l,[{label:e.pageSettingsLabel??i.pageSettings,icon:/* @__PURE__ */A(P,{}),onClick:e.openPageSettings},{label:n.collapseAll,icon:/* @__PURE__ */A(z,{}),onClick:e.collapseAll}]].filter(e=>e.length>0),d={label:"—",onClick:()=>{}};return u.flatMap((e,n)=>n?[d,...e]:e)}function U(e,n){const t=n.selectionStart??0,o=n.selectionEnd??0,l=n.value.slice(t,o),i=e=>{n.focus(),n.setRangeText(e,t,o,"end"),n.dispatchEvent(new Event("input",{bubbles:!0}))},c=e.words?.menu??r,s=R(e),a=[];l&&(a.push({label:c.copy,icon:/* @__PURE__ */A(O,{}),shortcut:"⌘C",onClick:()=>navigator.clipboard?.writeText(l)}),a.push({label:c.cut,icon:/* @__PURE__ */A(O,{}),shortcut:"⌘X",onClick:()=>{navigator.clipboard?.writeText(l),i("")}})),a.push({label:c.paste,icon:/* @__PURE__ */A(C,{}),shortcut:"⌘V",onClick:()=>{navigator.clipboard?.readText().then(e=>{e&&i(e)}).catch(()=>e.onPasteRefused())}});const u=[a,n.value?[{label:s.selectAll,shortcut:"⌘A",onClick:()=>{n.focus(),n.select()}}]:[]].filter(e=>e.length>0),d={label:"—",onClick:()=>{}};return u.flatMap((e,n)=>n?[d,...e]:e)}function Y(e){return e.shiftKey}function N(e,n){const[o,l]=y(null),r=k(()=>l(null),[]);t(null!==o,r);const i=b(e);i.current=e;const c=k(e=>{const n=i.current,t=n.keys;if(!t)return;const o=V(e);if(!o)return;const l=t.selected();if(!l)return;const r=L(n,o,l,{readOnly:t.readOnly,held:t.held()});r&&(e.preventDefault(),t.onDone?.(r))},[]),s=e.keys?.target??null;v(()=>{if(!s)return;const e=e=>c(e);return s.addEventListener("keydown",e),()=>s.removeEventListener("keydown",e)},[s,c]),d(n,"keydown",c);const a=k(n=>{if(Y(n))return;const t=n.target;if(t?.closest?.("[data-slot-zone]"))return n.preventDefault(),void l(null);const o=function(e){const n=e?.closest?.("input, textarea");return n&&("INPUT"!==n.tagName||["text","search","url","email","tel","number",""].includes(n.type))?n:null}(t);if(o)return n.preventDefault(),void l({kind:"input",x:n.clientX,y:n.clientY,el:o,owner:t});const r=t?.closest?.("[data-node-id]")?.getAttribute("data-node-id"),i=r?e.locate(r):null;n.preventDefault(),l(i?{kind:"node",x:n.clientX,y:n.clientY,...i,owner:t}:{kind:"empty",x:n.clientX,y:n.clientY,owner:t})},[e]);d(n,"contextmenu",t=>{if(Y(t)||!n)return;const o=t.target?.closest?.("[data-puck-component]")??null,r=o?.getAttribute("data-puck-component"),i=r?e.locate(r):null;t.preventDefault();const c=p(n.frame,t.clientX,t.clientY),s=n.frame;l(i?{kind:"node",...c,...i,owner:s}:{kind:"empty",...c,owner:s})}),d(n,"mousedown",r),d(n,"scroll",r,{on:"window"});return{onEditorContextMenu:a,menu:o?/* @__PURE__ */A(F,{host:e,target:o,onClose:r}):null,closeMenu:r}}function F({host:e,target:n,onClose:t}){const o="node"===n.kind?I(e,n):"input"===n.kind?U(e,n.el):B(e);return 0===o.length?null:/* @__PURE__ */A(g,{at:{x:n.x,y:n.y},owner:n.owner??null,onClose:t,"aria-label":a(o),children:/* @__PURE__ */A(s,{items:o,onClose:t})})}export{K as EASEL_NODE_CLIPBOARD,D as ancestorChain,j as nodeClipboardOf,T as nodeClipboardRules,I as nodeMenuItems,V as nodeShortcut,B as pageMenuItems,E as pastePlace,L as runNodeShortcut,U as textMenuItems,M as useNodeClipboard,N as useNodeContextMenu};
1
+ import{useEaselSession as e}from"./chunk-O7Q4DDJT.js";import{useHostEscape as n}from"./chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as t}from"./chunk-VVPZMWJE.js";import{styleMenuItems as o}from"./chunk-V7U33NF2.js";import{createNodeClipboard as l,nodeMenuItems as r}from"./chunk-OSPUG6S6.js";import{DEFAULT_NODE_MENU_WORDS as i}from"./chunk-WK3AFPXY.js";import{ROOT_ZONE as c}from"./chunk-PLVEGYK6.js";import{EaselMenuItems as s,menuLabel as a}from"./chunk-EA2HTX37.js";import{isTypingTarget as u,useCanvasEvent as d,framePointToHost as p}from"./chunk-ILXP5VX5.js";import{zoneKey as f,ROOT_SLOT as m,ROOT_ID as h}from"./chunk-KRXQM65X.js";import{useState as y,useCallback as k,useRef as b,useEffect as v}from"react";import{ContextMenu as g}from"efficient-shell/ui";import{UndoIcon as w,RedoIcon as x,PasteIcon as C,SettingsIcon as P,LayersIcon as z,CopyIcon as O}from"efficient-shell/icons/efficient";import{jsx as A}from"react/jsx-runtime";function D(e,n){const t=[],o=/* @__PURE__ */new Set;let l={zone:n.zone,index:n.index};for(;l;){const n=e.nodeAt(l.zone,l.index);if(!n||o.has(n.props.id))break;if(o.add(n.props.id),t.push({zone:l.zone,index:l.index,node:n,parentType:null}),l.zone===c)break;const r=l.zone.lastIndexOf(":");if(r<=0)break;l=e.locate(l.zone.slice(0,r))}for(let e=0;e<t.length-1;e+=1)t[e].parentType=t[e+1].node.type;return t}var K=l(),X=/* @__PURE__ */new WeakMap;function j(e){if(e.claimsPage)return K;const n=e.registry;if(!n)return e.cache("easel:node-clipboard",l);let t=X.get(n);return t||(t=l(),X.set(n,t)),t}function M(){return j(e())}function S(e,n,t){if(n===c){const{floor:n,cap:o}=e.sectionBand();return{parentId:h,slot:m,index:Math.min(Math.max(t,n),o)}}const o=n.lastIndexOf(":");return{parentId:n.slice(0,o),slot:n.slice(o+1),index:t}}function T(e,n,t){const o=e.isPinned(n,t),l=!o&&!e.isLocked(n)&&!e.duplicateBlocked(n),r=e.permits?.(n)??{duplicate:!0,delete:!0};return{copy:!o&&r.duplicate,cut:l&&r.duplicate&&r.delete,delete:l&&r.delete}}function E(e,n,t){const o=e.canPasteAt;if(!o)return f(n.from)===t.zone?S(e,t.zone,t.index+1):null;for(const l of D(e,t)){const t=S(e,l.zone,l.index+1);if(o(n,t))return t}return null}function V(e){if(e.defaultPrevented||e.altKey||e.shiftKey)return null;if(u(e.target))return null;const n=e.target,t=n&&"ownerDocument"in n?n.ownerDocument??n:null,o=t?.getSelection?.();if(o&&!o.isCollapsed&&o.toString().trim())return null;if(!e.metaKey&&!e.ctrlKey)return"Delete"===e.key||"Backspace"===e.key?"delete":null;const l=e.code||(1===e.key.length?`Key${e.key.toUpperCase()}`:"");return"KeyC"===l?"copy":"KeyX"===l?"cut":"KeyV"===l?"paste":null}function L(e,n,t,o){const l=e.nodeAt(t.zone,t.index);if(!l)return null;const r=l.props.id,i=e.labelOf(l.type,t.zone),c=T(e,l,t.zone);if("copy"===n)return c.copy?(e.nodeOps.copy(r,i),{done:"copied",name:i}):null;if(o.readOnly)return null;if("cut"===n)return c.cut?(e.nodeOps.cut(r,i),{done:"cut",name:i}):null;if("delete"===n)return c.delete?(e.nodeOps.remove(r),{done:"deleted",name:i}):null;const s=o.held;if(!s)return null;const a=e.isPinned(l,t.zone)?null:E(e,s,t);return a?(e.nodeOps.paste(a),{done:"pasted",name:s.label}):(e.onPasteRefused(s),{done:"refused",name:s.label})}function I(e,n){const{zone:t,index:l}=n,i=e.nodeAt(t,l);if(!i)return[];const s=i.props.id,a=e.labelOf(i.type,t),u=Boolean(i.props._hidden),d=e.nodeOps,p=e.isPinned(i,t),f=e.isLocked(i),m=!p&&!f&&!e.duplicateBlocked(i),h=e.permits?.(i)??{duplicate:!0,delete:!0},y=T(e,i,t),k=D(e,n),b=d.held,v=b&&!p?E(e,b,n):null,g=!e.readOnly,w=e.style?o({held:g?e.style.held():null,canCopy:e.style.canCopy(i,t),onCopy:()=>e.style?.copy(i,t),onPaste:()=>e.style?.paste(t,l,i),words:e.words?.styleClipboard}):[];return r({title:a,words:e.words?.menu,layer:{group:"pick",items:k.flatMap((n,t)=>{const o={label:e.rowNameOf(n.node,n.zone),checked:0===t,onClick:()=>e.selectAt(n.zone,n.index,n.node.props.id,n.parentType)},l=n.zone===c?null:e.slotRung?.(n.zone)??null;return l?[o,{label:l.label,checked:!1,onClick:l.select}]:[o]})},actions:{duplicate:g&&m&&h.duplicate?()=>d.duplicate(s):void 0,moveUp:g&&d.canStep(s,-1)?()=>d.step(s,-1):void 0,moveDown:g&&d.canStep(s,1)?()=>d.step(s,1):void 0,copy:y.copy?()=>d.copy(s,a):void 0,cut:g&&y.cut?()=>d.cut(s,a):void 0,paste:g&&b&&v?{label:b.label,run:()=>d.paste(v)}:void 0,rename:g&&e.renamePropOf(i,t)?()=>e.beginRename(t,l):void 0,hide:!g||f||p?void 0:{hidden:u,run:()=>d.setProps(s,{_hidden:!u})},delete:g&&m&&h.delete?()=>d.remove(s):void 0},style:w,extras:e.menuRows?.(i,t,l)??void 0,pinnedLine:p?R(e).pinned:void 0})}var R=e=>e.words?.screen??t.menu;function B(e){const n=R(e),o=!e.readOnly,l=[];o&&e.history.hasPast&&l.push({label:n.undo,icon:/* @__PURE__ */A(w,{}),shortcut:"⌘Z",onClick:e.history.back}),o&&e.history.hasFuture&&l.push({label:n.redo,icon:/* @__PURE__ */A(x,{}),shortcut:"⇧⌘Z",onClick:e.history.forward});const r=[],s=e.nodeOps.held,a=S(e,c,e.sectionBand().cap);if(o&&s&&(e.canPasteAt?e.canPasteAt(s,a):f(s.from)===c)){const n=a,t=e.words?.menu??i;r.push({label:t.pasteNamed({paste:t.paste,label:s.label}),icon:/* @__PURE__ */A(C,{}),shortcut:"⌘V",onClick:()=>e.nodeOps.paste(n)})}const u=[l,r,[{label:e.pageSettingsLabel??t.pageSettings,icon:/* @__PURE__ */A(P,{}),onClick:e.openPageSettings},{label:n.collapseAll,icon:/* @__PURE__ */A(z,{}),onClick:e.collapseAll}]].filter(e=>e.length>0),d={label:"—",onClick:()=>{}};return u.flatMap((e,n)=>n?[d,...e]:e)}function U(e,n){const t=n.selectionStart??0,o=n.selectionEnd??0,l=n.value.slice(t,o),r=e=>{n.focus(),n.setRangeText(e,t,o,"end"),n.dispatchEvent(new Event("input",{bubbles:!0}))},c=e.words?.menu??i,s=R(e),a=[];l&&(a.push({label:c.copy,icon:/* @__PURE__ */A(O,{}),shortcut:"⌘C",onClick:()=>navigator.clipboard?.writeText(l)}),a.push({label:c.cut,icon:/* @__PURE__ */A(O,{}),shortcut:"⌘X",onClick:()=>{navigator.clipboard?.writeText(l),r("")}})),a.push({label:c.paste,icon:/* @__PURE__ */A(C,{}),shortcut:"⌘V",onClick:()=>{navigator.clipboard?.readText().then(e=>{e&&r(e)}).catch(()=>e.onPasteRefused())}});const u=[a,n.value?[{label:s.selectAll,shortcut:"⌘A",onClick:()=>{n.focus(),n.select()}}]:[]].filter(e=>e.length>0),d={label:"—",onClick:()=>{}};return u.flatMap((e,n)=>n?[d,...e]:e)}function Y(e){return e.shiftKey}function N(e,t){const[o,l]=y(null),r=k(()=>l(null),[]);n(null!==o,r);const i=b(e);i.current=e;const c=k(e=>{const n=i.current,t=n.keys;if(!t)return;const o=V(e);if(!o)return;const l=t.selected();if(!l)return;const r=L(n,o,l,{readOnly:t.readOnly,held:t.held()});r&&(e.preventDefault(),t.onDone?.(r))},[]),s=e.keys?.target??null;v(()=>{if(!s)return;const e=e=>c(e);return s.addEventListener("keydown",e),()=>s.removeEventListener("keydown",e)},[s,c]),d(t,"keydown",c);const a=k(n=>{if(Y(n))return;const t=n.target;if(t?.closest?.("[data-slot-zone]"))return n.preventDefault(),void l(null);const o=function(e){const n=e?.closest?.("input, textarea");return n&&("INPUT"!==n.tagName||["text","search","url","email","tel","number",""].includes(n.type))?n:null}(t);if(o)return n.preventDefault(),void l({kind:"input",x:n.clientX,y:n.clientY,el:o,owner:t});const r=t?.closest?.("[data-node-id]")?.getAttribute("data-node-id"),i=r?e.locate(r):null;n.preventDefault(),l(i?{kind:"node",x:n.clientX,y:n.clientY,...i,owner:t}:{kind:"empty",x:n.clientX,y:n.clientY,owner:t})},[e]);d(t,"contextmenu",n=>{if(Y(n)||!t)return;const o=n.target?.closest?.("[data-puck-component]")??null,r=o?.getAttribute("data-puck-component"),i=r?e.locate(r):null;n.preventDefault();const c=p(t.frame,n.clientX,n.clientY),s=t.frame;l(i?{kind:"node",...c,...i,owner:s}:{kind:"empty",...c,owner:s})}),d(t,"mousedown",r),d(t,"scroll",r,{on:"window"});return{onEditorContextMenu:a,menu:o?/* @__PURE__ */A(F,{host:e,target:o,onClose:r}):null,closeMenu:r}}function F({host:e,target:n,onClose:t}){const o="node"===n.kind?I(e,n):"input"===n.kind?U(e,n.el):B(e);return 0===o.length?null:/* @__PURE__ */A(g,{at:{x:n.x,y:n.y},owner:n.owner??null,onClose:t,"aria-label":a(o),children:/* @__PURE__ */A(s,{items:o,onClose:t})})}export{K as EASEL_NODE_CLIPBOARD,D as ancestorChain,j as nodeClipboardOf,T as nodeClipboardRules,I as nodeMenuItems,V as nodeShortcut,B as pageMenuItems,E as pastePlace,L as runNodeShortcut,U as textMenuItems,M as useNodeClipboard,N as useNodeContextMenu};
@@ -0,0 +1,2 @@
1
+ import{ChevronRightIcon as e,TrashIcon as r,RenameIcon as i,ExternalIcon as t,SearchIcon as o,EyeOffIcon as n,EyeIcon as s}from"efficient-shell/icons/efficient-glyphs";import{jsx as a}from"react/jsx-runtime";var c={eye:s,"eye-off":n,search:o,"external-link":t,pencil:i,trash:r,"chevron-right":e};function l({name:e,size:r,strokeWidth:i=1.8,rounded:t=!1,className:o,style:n}){/* @__PURE__ */
2
+ return a(c[e],{size:r,strokeWidth:i,strokeLinecap:t?"round":void 0,strokeLinejoin:t?"round":void 0,className:o,style:n})}export{l as UiIcon};
@@ -1,4 +1,4 @@
1
- import{buildPaletteSections as e,pinnedSection as t,categoryLabel as o}from"./chunk-PA3PNTVV.js";import{blockTypesIn as n}from"./chunk-5ZBY24K7.js";import{sectionTemplatesOf as s}from"./chunk-BVN33R76.js";import{SidePanelHead as i,PanelModeExit as r}from"./chunk-62VPYC7F.js";import{useEaselSession as l}from"./chunk-O7Q4DDJT.js";import{blockRuns as c}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as a,useScreenBlockRules as p}from"./chunk-FZ3Y3QTQ.js";import{DEFAULT_SCREEN_WORDS as m}from"./chunk-VVPZMWJE.js";import{useEasel as d}from"./chunk-PVAIOBBE.js";import{useWords as f}from"./chunk-MFIRYGHW.js";import{AddPanel as y}from"./chunk-QFVRMARS.js";import{DEFAULT_DRAG_WORDS as h}from"./chunk-AYWN5NRH.js";import{useState as u,useEffect as k,useMemo as b}from"react";import{AddIcon as g}from"efficient-shell/icons/efficient";import{jsx as j,jsxs as v,Fragment as V}from"react/jsx-runtime";var A=e=>`section:${e}`,B=e=>`block:${e}`,E=e=>`template:${e}`;function O({at:O,placeBlocks:R,canTake:$,onPick:w,itemFor:F,session:I,siteWide:N,onClose:P,onHide:T,readOnly:x}){const H=d(e=>e.config),Q=a(),{labelAtLevel:W,categoryLabel:Y,firstSection:C,Icon:L,Thumbnail:M}=Q,{blockIsOffered:D,canAddTo:S}=p(),Z=f("screen",m).add,z=f("drag",h).add,J=l(),[G,K]=u([]);k(()=>{let e=!1;const t=e=>D(e,J);return s(J).list().then(o=>{if(e)return;const s=H.components;K(o.filter(e=>e.node?.type&&s[e.node.type]&&n(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[H,J]);const q=b(()=>e(H,Q),[H]),U=e=>({type:A(e.type),label:e.name,cover:/* @__PURE__ */j(M,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:Z.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),X=e=>{const t=e.indexOf(":"),o=e.slice(0,t),n=e.slice(t+1);if("section"===o)return{kind:"section",type:n};if("block"===o)return{kind:"block",type:n};if("template"===o){const e=G.find(e=>e.id===n);return e?{kind:"template",template:e}:null}return null},_=e=>/* @__PURE__ */j("span",{className:"es-add-glyph-cover",children:/* @__PURE__ */j(L,{type:e,size:26})}),ee=b(()=>{const e=t(q,C),n=/* @__PURE__ */new Map,s=e=>{!n.has(e.type)&&D(e.type,J)&&n.set(e.type,e)};for(const t of e?[e]:q){const e=S(t.type)?.choices??[];e.forEach(s),e.forEach(e=>S(e.type,1)?.choices?.forEach(s))}R?.forEach(s);const i=new Set(q.map(e=>e.type)),r=[...n.values()].filter(e=>!i.has(e.type)),l=e=>({type:B(e.type),label:e.label,cover:_(e.type),title:Z.tile({name:e.label}),keywords:[e.group??"",e.type].filter(Boolean)}),a=e=>n.has(e.type)?{...U(e),cover:_(e.type)}:U(e),p=[];G.length>0&&p.push({key:"templates",title:Z.templates,tiles:G.map(e=>{return{type:E(e.id),label:e.name,cover:/* @__PURE__ */j(M,{type:e.node.type}),keywords:[(t=e.node.type,W(t,"section",H.components[t]?.label??t)),e.node.type]};var t})});const m=r.filter(e=>!e.group);let d=!1;for(const t of Object.keys(H.categories??{})){const n=q.filter(e=>e.cat===t);if(0===n.length)continue;const s=e&&n.some(t=>t.type===e.type)?e:null,i=(s?[s,...n.filter(e=>e.type!==s.type)]:n).map(a);s&&!d&&(i.splice(1,0,...m.map(l)),d=!0),p.push({key:`category:${t}`,title:o(H,t,Y),tiles:i})}const f=p.find(e=>e.key?.startsWith("category:"));if(!d&&f&&m.length>0&&(f.tiles=[...f.tiles,...m.map(l)],d=!0),c(r.filter(e=>e.group||!d)).forEach((e,t)=>{p.push({key:`blocks:${t}`,title:e.group??"",tiles:e.items.map(l)})}),!$)return p;const y=p.map(e=>({...e,tiles:e.tiles.map(e=>{const t=X(e.type),o=t?$(t):null;return o?{...e,disabled:!0,disabledReason:o}:e})})),h=e=>e.tiles.some(e=>!e.disabled);return[...y.filter(h),...y.filter(e=>!h(e))]},[G,q,H,Z,$,R,J]);/* @__PURE__ */
1
+ import{buildPaletteSections as e,pinnedSection as t,categoryLabel as o}from"./chunk-PA3PNTVV.js";import{sectionTemplatesOf as n}from"./chunk-BVN33R76.js";import{blockTypesIn as s}from"./chunk-5ZBY24K7.js";import{SidePanelHead as i,PanelModeExit as r}from"./chunk-62VPYC7F.js";import{blockRuns as l}from"./chunk-HQ4VVRIC.js";import{useScreenBlockLook as c,useScreenBlockRules as a}from"./chunk-FZ3Y3QTQ.js";import{useEaselSession as p}from"./chunk-O7Q4DDJT.js";import{DEFAULT_SCREEN_WORDS as m}from"./chunk-VVPZMWJE.js";import{useEasel as d}from"./chunk-PVAIOBBE.js";import{useWords as f}from"./chunk-MFIRYGHW.js";import{AddPanel as y}from"./chunk-QFVRMARS.js";import{DEFAULT_DRAG_WORDS as h}from"./chunk-AYWN5NRH.js";import{useState as u,useEffect as k,useMemo as b}from"react";import{AddIcon as g}from"efficient-shell/icons/efficient";import{jsx as j,jsxs as v,Fragment as V}from"react/jsx-runtime";var A=e=>`section:${e}`,B=e=>`block:${e}`,E=e=>`template:${e}`;function O({at:O,placeBlocks:R,canTake:$,onPick:w,itemFor:F,session:I,siteWide:N,onClose:P,onHide:T,readOnly:x}){const H=d(e=>e.config),Q=c(),{labelAtLevel:W,categoryLabel:Y,firstSection:C,Icon:L,Thumbnail:M}=Q,{blockIsOffered:D,canAddTo:S}=a(),Z=f("screen",m).add,z=f("drag",h).add,J=p(),[G,K]=u([]);k(()=>{let e=!1;const t=e=>D(e,J);return n(J).list().then(o=>{if(e)return;const n=H.components;K(o.filter(e=>e.node?.type&&n[e.node.type]&&s(e.node).every(t)))}).catch(()=>{}),()=>{e=!0}},[H,J]);const q=b(()=>e(H,Q),[H]),U=e=>({type:A(e.type),label:e.name,cover:/* @__PURE__ */j(M,{type:e.type}),title:e.desc?`${e.name} — ${e.desc}`:Z.tile({name:e.name}),keywords:[e.alias??"",e.desc,e.type,e.catLabel].filter(Boolean)}),X=e=>{const t=e.indexOf(":"),o=e.slice(0,t),n=e.slice(t+1);if("section"===o)return{kind:"section",type:n};if("block"===o)return{kind:"block",type:n};if("template"===o){const e=G.find(e=>e.id===n);return e?{kind:"template",template:e}:null}return null},_=e=>/* @__PURE__ */j("span",{className:"es-add-glyph-cover",children:/* @__PURE__ */j(L,{type:e,size:26})}),ee=b(()=>{const e=t(q,C),n=/* @__PURE__ */new Map,s=e=>{!n.has(e.type)&&D(e.type,J)&&n.set(e.type,e)};for(const t of e?[e]:q){const e=S(t.type)?.choices??[];e.forEach(s),e.forEach(e=>S(e.type,1)?.choices?.forEach(s))}R?.forEach(s);const i=new Set(q.map(e=>e.type)),r=[...n.values()].filter(e=>!i.has(e.type)),c=e=>({type:B(e.type),label:e.label,cover:_(e.type),title:Z.tile({name:e.label}),keywords:[e.group??"",e.type].filter(Boolean)}),a=e=>n.has(e.type)?{...U(e),cover:_(e.type)}:U(e),p=[];G.length>0&&p.push({key:"templates",title:Z.templates,tiles:G.map(e=>{return{type:E(e.id),label:e.name,cover:/* @__PURE__ */j(M,{type:e.node.type}),keywords:[(t=e.node.type,W(t,"section",H.components[t]?.label??t)),e.node.type]};var t})});const m=r.filter(e=>!e.group);let d=!1;for(const t of Object.keys(H.categories??{})){const n=q.filter(e=>e.cat===t);if(0===n.length)continue;const s=e&&n.some(t=>t.type===e.type)?e:null,i=(s?[s,...n.filter(e=>e.type!==s.type)]:n).map(a);s&&!d&&(i.splice(1,0,...m.map(c)),d=!0),p.push({key:`category:${t}`,title:o(H,t,Y),tiles:i})}const f=p.find(e=>e.key?.startsWith("category:"));if(!d&&f&&m.length>0&&(f.tiles=[...f.tiles,...m.map(c)],d=!0),l(r.filter(e=>e.group||!d)).forEach((e,t)=>{p.push({key:`blocks:${t}`,title:e.group??"",tiles:e.items.map(c)})}),!$)return p;const y=p.map(e=>({...e,tiles:e.tiles.map(e=>{const t=X(e.type),o=t?$(t):null;return o?{...e,disabled:!0,disabledReason:o}:e})})),h=e=>e.tiles.some(e=>!e.disabled);return[...y.filter(h),...y.filter(e=>!h(e))]},[G,q,H,Z,$,R,J]);/* @__PURE__ */
2
2
  return v(V,{children:[
3
3
  /* @__PURE__ */j(i,{icon:/* @__PURE__ */j(g,{size:15}),title:Z.title,context:Z.contextAll,actions:/* @__PURE__ */j(r,{label:Z.done,description:Z.doneDescription,onClick:P}),onHide:T}),
4
4
  /* @__PURE__ */v("div",{className:"sf-addside sf-scroll",children:[
@@ -1 +1 @@
1
- export{UiIcon}from"../chunk-6OA4UXKZ.js";export{PreviewDeviceContext,usePreviewDevice}from"../chunk-BSPCSC45.js";export{PreviewPartsProvider,usePreviewParts}from"../chunk-I54UCYOU.js";export{createPreviewSelectionContext,useSelectHandler}from"../chunk-GOTN2KY4.js";import"../chunk-R5L2E7JX.js";
1
+ export{UiIcon}from"../chunk-OG2SKSSK.js";export{PreviewPartsProvider,usePreviewParts}from"../chunk-I54UCYOU.js";export{createPreviewSelectionContext,useSelectHandler}from"../chunk-GOTN2KY4.js";import"../chunk-R5L2E7JX.js";export{PreviewDeviceContext,usePreviewDevice}from"../chunk-BSPCSC45.js";
@@ -1,3 +1,4 @@
1
- export * from 'efficient-shell/icons/efficient';
2
- export { EfficientIconName as IconName, EfficientIconProps as IconProps, efficientIconMeanings as iconMeanings } from 'efficient-shell/icons/efficient';
1
+ export * from 'efficient-shell/icons/efficient-glyphs';
2
+ export { EfficientIconName as IconName, EfficientIconProps as IconProps } from 'efficient-shell/icons/efficient-glyphs';
3
+ import 'efficient-shell/icons/efficient-meanings';
3
4
  import 'efficient-shell/markup';
@@ -1 +1 @@
1
- export*from"efficient-shell/icons/efficient";export{efficientIconMeanings as iconMeanings}from"efficient-shell/icons/efficient";
1
+ export*from"efficient-shell/icons/efficient-glyphs";
@@ -0,0 +1 @@
1
+ export { efficientIconMeanings as iconMeanings } from 'efficient-shell/icons/efficient-meanings';
@@ -0,0 +1 @@
1
+ export{efficientIconMeanings as iconMeanings}from"efficient-shell/icons/efficient-meanings";
@@ -1 +1 @@
1
- export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-WUSJ6SSF.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-62VPYC7F.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-FZ3Y3QTQ.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-VVPZMWJE.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-PVAIOBBE.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-BPZQ7S2Z.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-EA2HTX37.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-NY7HHUGB.js";import"../../chunk-33C6ALT5.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-QFVRMARS.js";import"../../chunk-AYWN5NRH.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{blockKey,AddSidePanel as default,sectionKey,templateKey}from"../../chunk-YWUHPY5W.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-62VPYC7F.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-FZ3Y3QTQ.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-VVPZMWJE.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-PVAIOBBE.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-BPZQ7S2Z.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-EA2HTX37.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-NY7HHUGB.js";import"../../chunk-33C6ALT5.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-QFVRMARS.js";import"../../chunk-AYWN5NRH.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{MediaSidePanel as default}from"../../chunk-J2JDC3EZ.js";import"../../chunk-FZ3Y3QTQ.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-PVAIOBBE.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-BPZQ7S2Z.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-EA2HTX37.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-NY7HHUGB.js";import"../../chunk-33C6ALT5.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-ILXP5VX5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{MediaSidePanel as default}from"../../chunk-J2JDC3EZ.js";import"../../chunk-FZ3Y3QTQ.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-PVAIOBBE.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-BPZQ7S2Z.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-EA2HTX37.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-NY7HHUGB.js";import"../../chunk-33C6ALT5.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -22,7 +22,8 @@ import '../../panelWidths-D9hTLR25.js';
22
22
  import '../../CanvasDragLayer-CLb7j-CZ.js';
23
23
  import '../../session-DSQFmIvx.js';
24
24
  import '../../words-BDignMl_.js';
25
- import '../../types-BLRK6_JO.js';
25
+ import '../../types-D8P9q-BG.js';
26
+ import 'efficient-shell/ui';
26
27
  import '../../words-Cl9xMUYY.js';
27
28
  import './AddSidePanel.js';
28
29
  import '../lib/section-template-types.js';
@@ -35,7 +36,6 @@ import '../../engine-CvXpFE86.js';
35
36
  import '../lib/admin-bridge.js';
36
37
  import '../lib/host-chrome.js';
37
38
  import '../lib/links/link-filters.js';
38
- import 'efficient-shell/ui';
39
39
  import '../lib/puck/add-target-types.js';
40
40
  import '../lib/puck/slot-section-spec.js';
41
41
  import '../lib/backend-error.js';
@@ -1 +1 @@
1
- export{EASEL_NODE_CLIPBOARD,ancestorChain,nodeClipboardOf,nodeClipboardRules,nodeMenuItems,nodeShortcut,pageMenuItems,pastePlace,runNodeShortcut,textMenuItems,useNodeClipboard,useNodeContextMenu}from"../../chunk-O5XI3WAQ.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-BXMXTO36.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-VVPZMWJE.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ILXP5VX5.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-NW4LJ4G4.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-VVPZMWJE.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-BXMXTO36.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-EA2HTX37.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{PageEditGuardNotices as default}from"../../chunk-ENXLPJ77.js";import"../../chunk-ZIFDZGY7.js";import"../../chunk-ERR437B5.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-VVPZMWJE.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-MFIRYGHW.js";
1
+ export{PageEditGuardNotices as default}from"../../chunk-IWFVVCRN.js";import"../../chunk-FBS75I6E.js";import"../../chunk-ERR437B5.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-KG7RJWOK.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-VVPZMWJE.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-MFIRYGHW.js";
@@ -21,7 +21,8 @@ import '../../words-BDignMl_.js';
21
21
  import '../../types-BsyPh6EW.js';
22
22
  import '../../style-clipboard/index.js';
23
23
  import '../../words-CnnHb9jo.js';
24
- import '../../types-BLRK6_JO.js';
24
+ import '../../types-D8P9q-BG.js';
25
+ import 'efficient-shell/ui';
25
26
  import '../../words-Cl9xMUYY.js';
26
27
  import './AddSidePanel.js';
27
28
  import '../lib/section-template-types.js';
@@ -33,7 +34,6 @@ import '../lib/session.js';
33
34
  import '../lib/backend-error.js';
34
35
  import '../lib/host-chrome.js';
35
36
  import '../lib/links/link-filters.js';
36
- import 'efficient-shell/ui';
37
37
  import '../lib/document-hooks.js';
38
38
  import '../lib/document-switch.js';
39
39
  import '../lib/admin-bridge.js';
@@ -1 +1 @@
1
- export{ScreenChrome as default}from"../../chunk-GYNIDJKN.js";import"../../chunk-M4CNCPHA.js";import"../../chunk-FGNR22NY.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-NBDMTIU2.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-7F52SZOI.js";import"../../chunk-W4U4SHKW.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-3Z2MVLCD.js";import"../../chunk-4EI6UGGH.js";import"../../chunk-TZIIRGVY.js";import"../../chunk-H5QI34FV.js";import"../../chunk-S2MMPHKD.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-5545A3PC.js";import"../../chunk-WUSJ6SSF.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-62VPYC7F.js";import"../../chunk-J2JDC3EZ.js";import"../../chunk-O5XI3WAQ.js";import"../../chunk-ENXLPJ77.js";import"../../chunk-ZIFDZGY7.js";import"../../chunk-ERR437B5.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-FZ3Y3QTQ.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-BXMXTO36.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-VVPZMWJE.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-PVAIOBBE.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-BPZQ7S2Z.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-EA2HTX37.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-4VJATVVR.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-NY7HHUGB.js";import"../../chunk-33C6ALT5.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-QFVRMARS.js";import"../../chunk-AYWN5NRH.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{ScreenChrome as default}from"../../chunk-FUMIBYUU.js";import"../../chunk-M4CNCPHA.js";import"../../chunk-FGNR22NY.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-NBDMTIU2.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-7F52SZOI.js";import"../../chunk-W4U4SHKW.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-3Z2MVLCD.js";import"../../chunk-4EI6UGGH.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-TZIIRGVY.js";import"../../chunk-H5QI34FV.js";import"../../chunk-S2MMPHKD.js";import"../../chunk-5545A3PC.js";import"../../chunk-YWUHPY5W.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-62VPYC7F.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-J2JDC3EZ.js";import"../../chunk-FZ3Y3QTQ.js";import"../../chunk-NW4LJ4G4.js";import"../../chunk-IWFVVCRN.js";import"../../chunk-FBS75I6E.js";import"../../chunk-ERR437B5.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-KG7RJWOK.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-UMDQ6CLQ.js";import"../../chunk-VVPZMWJE.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-BXMXTO36.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-BSPCSC45.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-PVAIOBBE.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-BPZQ7S2Z.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-EA2HTX37.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-4VJATVVR.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-NY7HHUGB.js";import"../../chunk-33C6ALT5.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-QFVRMARS.js";import"../../chunk-AYWN5NRH.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -1 +1 @@
1
- export{ScreenDocumentContext,ScreenDocumentProvider,useScreenDocument}from"../../chunk-ZIFDZGY7.js";import"../../chunk-ERR437B5.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-VVPZMWJE.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MFIRYGHW.js";
1
+ export{ScreenDocumentContext,ScreenDocumentProvider,useScreenDocument}from"../../chunk-FBS75I6E.js";import"../../chunk-ERR437B5.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-KG7RJWOK.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-VVPZMWJE.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MFIRYGHW.js";
@@ -32,7 +32,7 @@ import '../../words-BDignMl_.js';
32
32
  import '../../types-BsyPh6EW.js';
33
33
  import '../../style-clipboard/index.js';
34
34
  import '../../words-CnnHb9jo.js';
35
- import '../../types-BLRK6_JO.js';
35
+ import '../../types-D8P9q-BG.js';
36
36
  import '../../words-Cl9xMUYY.js';
37
37
  import './AddSidePanel.js';
38
38
  import '../lib/puck/block-choice.js';
@@ -1 +1 @@
1
- export{DocumentScreen,ScreenMount as default}from"../../chunk-NQXFINT2.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-GYNIDJKN.js";import"../../chunk-M4CNCPHA.js";import"../../chunk-FGNR22NY.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-NBDMTIU2.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-7F52SZOI.js";import"../../chunk-W4U4SHKW.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-J54OXLQF.js";import"../../chunk-3Z2MVLCD.js";import"../../chunk-4EI6UGGH.js";import"../../chunk-TZIIRGVY.js";import"../../chunk-H5QI34FV.js";import"../../chunk-S2MMPHKD.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-5545A3PC.js";import"../../chunk-WUSJ6SSF.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-BVN33R76.js";import"../../chunk-62VPYC7F.js";import"../../chunk-J2JDC3EZ.js";import"../../chunk-O5XI3WAQ.js";import"../../chunk-ENXLPJ77.js";import"../../chunk-ZIFDZGY7.js";import"../../chunk-ERR437B5.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-UMDQ6CLQ.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-FZ3Y3QTQ.js";import"../../chunk-R6WTQWAC.js";import"../../chunk-U3JP4VGF.js";import"../../chunk-BXMXTO36.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-VVPZMWJE.js";import"../../chunk-BSPCSC45.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-PVAIOBBE.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-BPZQ7S2Z.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-EA2HTX37.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-4VJATVVR.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-NY7HHUGB.js";import"../../chunk-33C6ALT5.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-QFVRMARS.js";import"../../chunk-AYWN5NRH.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
1
+ export{DocumentScreen,ScreenMount as default}from"../../chunk-52LIZZG4.js";import"../../chunk-GXQCZJOP.js";import"../../chunk-FUMIBYUU.js";import"../../chunk-M4CNCPHA.js";import"../../chunk-FGNR22NY.js";import"../../chunk-2GVCAIPX.js";import"../../chunk-26OOWIJJ.js";import"../../chunk-NBDMTIU2.js";import"../../chunk-MQNBD6AB.js";import"../../chunk-ZE7I3PLX.js";import"../../chunk-7F52SZOI.js";import"../../chunk-W4U4SHKW.js";import"../../chunk-RKTF5XLP.js";import"../../chunk-J54OXLQF.js";import"../../chunk-3Z2MVLCD.js";import"../../chunk-4EI6UGGH.js";import"../../chunk-KCBEE2MC.js";import"../../chunk-TZIIRGVY.js";import"../../chunk-H5QI34FV.js";import"../../chunk-S2MMPHKD.js";import"../../chunk-5545A3PC.js";import"../../chunk-YWUHPY5W.js";import"../../chunk-PA3PNTVV.js";import"../../chunk-BVN33R76.js";import"../../chunk-5ZBY24K7.js";import"../../chunk-62VPYC7F.js";import"../../chunk-HQ4VVRIC.js";import"../../chunk-J2JDC3EZ.js";import"../../chunk-FZ3Y3QTQ.js";import"../../chunk-NW4LJ4G4.js";import"../../chunk-IWFVVCRN.js";import"../../chunk-FBS75I6E.js";import"../../chunk-ERR437B5.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-KG7RJWOK.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-UMDQ6CLQ.js";import"../../chunk-VVPZMWJE.js";import"../../chunk-V7U33NF2.js";import"../../chunk-6WY6ZXJG.js";import"../../chunk-BXMXTO36.js";import"../../chunk-OSPUG6S6.js";import"../../chunk-WK3AFPXY.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-BSPCSC45.js";import"../../chunk-IQ5TA7AM.js";import"../../chunk-TBF5CVPA.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-IYT6NN2J.js";import"../../chunk-PLVEGYK6.js";import"../../chunk-PVAIOBBE.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-BPZQ7S2Z.js";import"../../chunk-XWFH2NHZ.js";import"../../chunk-4JSBIW5H.js";import"../../chunk-K56YDHYQ.js";import"../../chunk-EA2HTX37.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-4VJATVVR.js";import"../../chunk-NDRZP6YR.js";import"../../chunk-H6DDIBQ4.js";import"../../chunk-NY7HHUGB.js";import"../../chunk-33C6ALT5.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-MFIRYGHW.js";import"../../chunk-QFVRMARS.js";import"../../chunk-AYWN5NRH.js";import"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-ILXP5VX5.js";import"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";
@@ -19,7 +19,8 @@ import '../../words-BDignMl_.js';
19
19
  import '../../types-BsyPh6EW.js';
20
20
  import '../../style-clipboard/index.js';
21
21
  import '../../words-CnnHb9jo.js';
22
- import '../../types-BLRK6_JO.js';
22
+ import '../../types-D8P9q-BG.js';
23
+ import 'efficient-shell/ui';
23
24
  import '../../words-Cl9xMUYY.js';
24
25
  import './AddSidePanel.js';
25
26
  import '../lib/section-template-types.js';
@@ -31,7 +32,6 @@ import '../lib/session.js';
31
32
  import '../lib/backend-error.js';
32
33
  import '../lib/host-chrome.js';
33
34
  import '../lib/links/link-filters.js';
34
- import 'efficient-shell/ui';
35
35
  import '../lib/document-hooks.js';
36
36
  import '../lib/document-switch.js';
37
37
  import '../../engine-CvXpFE86.js';
@@ -1,16 +1,16 @@
1
- import{AddBlockRow as e}from"../../chunk-TLDRFVD2.js";import{scrollPreviewToSection as n,gotoPreviewSlide as o}from"../../chunk-3Z2MVLCD.js";import{useEaselUndoKeys as r}from"../../chunk-4EI6UGGH.js";import{DEFAULT_PANEL_W as t}from"../../chunk-TZIIRGVY.js";import{usePartBridge as s}from"../../chunk-H5QI34FV.js";import{useSectionOps as i}from"../../chunk-S2MMPHKD.js";import{SlotChildActionsProvider as c}from"../../chunk-KCBEE2MC.js";import{MediaSidePanel as p}from"../../chunk-J2JDC3EZ.js";import{useScreenDocument as l}from"../../chunk-ZIFDZGY7.js";import"../../chunk-ERR437B5.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-KCOBHPN6.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import"../../chunk-HQ4VVRIC.js";import{SELECTION_MODE as m,useScreenPinned as d,useScreenCanvasFrame as a,useScreenInspectorPanel as u,useScreenPickFollowsSelection as h,sameInspectorMode as k,useStandaloneScreenBridges as f,useScreenBlockLook as j,useScreenBlockRules as y}from"../../chunk-FZ3Y3QTQ.js";import{useMediaPanel as N,usePanelPick as S,useCancelPanelPick as C}from"../../chunk-R6WTQWAC.js";import{useHostEscape as R}from"../../chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as P}from"../../chunk-VVPZMWJE.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-IQ5TA7AM.js";import{slotChildRowName as x}from"../../chunk-TBF5CVPA.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-IYT6NN2J.js";import{slotFieldsOf as A,nestsInTree as H}from"../../chunk-PLVEGYK6.js";import{useEasel as M}from"../../chunk-PVAIOBBE.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-BPZQ7S2Z.js";import"../../chunk-XWFH2NHZ.js";import{LayersTree as V,Subtree as v,TreeRow as D,TreeRowAction as E,TreeSeam as g}from"../../chunk-4JSBIW5H.js";import{DEFAULT_TREE_WORDS as B}from"../../chunk-K56YDHYQ.js";import"../../chunk-EA2HTX37.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-NDRZP6YR.js";import{DEFAULT_SAVE_WORDS as Z,saveIndicator as w}from"../../chunk-H6DDIBQ4.js";import{SaveState as z,panelWidthVars as F}from"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import"../../chunk-NY7HHUGB.js";import"../../chunk-33C6ALT5.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import{useWords as b}from"../../chunk-MFIRYGHW.js";import"../../chunk-QFVRMARS.js";import"../../chunk-AYWN5NRH.js";import{useTreeDrag as I}from"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-ILXP5VX5.js";import{zoneKey as W,parseZoneKey as Y}from"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";import{useState as L,useRef as O,useEffect as T,useCallback as G,Fragment as J}from"react";import{Tooltip as X}from"efficient-shell/ui";import{TrashIcon as K}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}=l(),re=i(),{appState:te,selectedItem:se,config:ie}=M(e=>e),[ce,pe]=L(m),le=b("screen",P),me=b("tree",B),de=b("save",Z),{first:ae,last:ue,panelOf:he}=d(),ke=he(ae),fe=a(),je=u(),ye=te.data.content?.[0]??null,Ne=ye?.props.id??null,Se=ye?.type===ae,Ce=ye?.type===ue,Re=O(null),Pe=O(null);r(Pe);const xe=N(),Ae=S(),He=C();h(se?.props.id),T(()=>{const e=Pe.current;if(!Ae||!e)return;const n=e=>{"Escape"===e.key&&He()};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[Ae]),R(null!==Ae,()=>He()),T(()=>{Ne&&Re.current!==Ne&&(Re.current=Ne,Se?pe(ke??m):se||re.select({index:0}))},[Ne,se,re,Se]);const Me=G(e=>pe(n=>k(n,e)?n:e),[]),Ve=f({kind:ce.kind,mode:ce,open:Me,show:e=>pe(e),reveal:()=>{},select:(e,n)=>{pe(e=>k(e,n)?e:n),re.select(e)}}),{selectNode:ve}=s({mode:ce,setMode:pe,onOpenPart:n}),De=j(),{labelAtLevel:Ee,Icon:ge}=De,{canAddTo:Be}=y(),Ze=e=>Ee(e,"block",ie.components[e]?.label??e),we=e=>Ee(e,"section",Ze(e)),ze=!Se&&"puck"===ce.kind&&se?.props.id===Ne,Fe=ye?Be(ye.type)?.spec??null:null,be=ye&&Fe?`${ye.props.id}:${Fe.slot}`:null,Ie=ye&&Fe&&Array.isArray(ye.props[Fe.slot])?ye.props[Fe.slot]:[],We=e=>x(e,Ze,De.plainText),Ye=(e,r)=>{ye&&Fe&&be&&(pe(m),Fe.slider?(o(String(ye.props.id),e),re.select({index:e,zone:be}),n(String(ye.props.id))):(re.select({index:e,zone:be}),n(r)))},Le=()=>{if(!ye||!Fe||!be)return;const e=Ie.length;re.insertComponent(be,Fe.childType,e),pe(m),Fe.slider?requestAnimationFrame(()=>{o(String(ye.props.id),e),re.select({index:e,zone:be})}):re.select({index:e,zone:be})},Oe=e=>A(ie,e),Te=e=>{const{parentId:n,slot:o}=Y(e),r=e=>{if(!e)return null;if(String(e.props.id)===n)return e;for(const n of Oe(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(ye)?.props[o];return Array.isArray(t)?t.length:0},Ge=(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(m),re.select({index:t,zone:e}))},Je=I({keyOf:e=>e.id,readOnly:Boolean(ne),canDrop:(e,n)=>W(n)===e.zone&&n.index>=0&&n.index<=Te(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)}),Xe=(e,n)=>/* @__PURE__ */$(g,{...ne?{}:Je.seam({place:{...Y(e),index:n}})},`seam:${e}:${n}`),Ke=e=>De.blockRowName(e,Ze),Qe=(e,o,r)=>{pe(m),re.select({index:o,zone:e}),n(r)},$e=(e,n,o)=>{re.insertComponent(e,n,o),pe(m),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=Oe((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=Be(e.type),s=t?.choices??null,i="footer"===t?.source?Ke:We;/* @__PURE__ */
2
- return Q(U,{children:[o.map(({child:e,zone:o,index:r})=>{const t=se?.props.id===e.props.id,s=H(ie,e.type,n),c=i(e),p=String(e.props.id),l=()=>Qe(o,r,p),{rowProps:d,...a}=Je.row({item:{id:p,zone:o,index:r},place:{...Y(o),index:r}},{onClick:q(l)});/* @__PURE__ */
3
- return Q(J,{children:[0===r&&Xe(o,0),
4
- /* @__PURE__ */$(D,{words:me,icon:/* @__PURE__ */$(ge,{type:e.type,size:13}),name:c,selected:t,onSelect:l,...a,actions:/* @__PURE__ */$(E,{kind:"delete",label:le.deleteNamed({name:c}),onClick:()=>{return e=o,n=r,re.removeComponent(e,n),pe(m),void re.select(null);var e,n},children:/* @__PURE__ */$(K,{size:13})}),rowProps:d}),s&&/* @__PURE__ */$(v,{children:qe(e,n+1)}),Xe(o,r+1)]},String(e.props.id??`${o}-${r}`))}),t&&s?Ue(`${e.props.id}:${t.slot}`,o.length,s):null]})},_e="HeroSingle"===ye?.type,en=Boolean(ye)&&(Boolean(Be(ye.type))||Oe(ye.type).length>0),nn=Boolean(ye)&&(Boolean(Fe)||Ce||Se||_e||en);/* @__PURE__ */
5
- return Q("div",{ref:Pe,className:"sf-editor es-editor",style:F(t),children:[
6
- /* @__PURE__ */$("div",{className:"sf-section-bar",children:/* @__PURE__ */$(z,null!==oe?{tone:"off",label:oe,role:"status"}:{...w(ee,de),role:"status"})}),
1
+ import{AddBlockRow as e}from"../../chunk-TLDRFVD2.js";import{scrollPreviewToSection as n,gotoPreviewSlide as o}from"../../chunk-3Z2MVLCD.js";import{useEaselUndoKeys as r}from"../../chunk-4EI6UGGH.js";import{SlotChildActionsProvider as t}from"../../chunk-KCBEE2MC.js";import{DEFAULT_PANEL_W as s}from"../../chunk-TZIIRGVY.js";import{usePartBridge as i}from"../../chunk-H5QI34FV.js";import{useSectionOps as c}from"../../chunk-S2MMPHKD.js";import"../../chunk-HQ4VVRIC.js";import{MediaSidePanel as p}from"../../chunk-J2JDC3EZ.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-FZ3Y3QTQ.js";import{useScreenDocument as y}from"../../chunk-FBS75I6E.js";import"../../chunk-ERR437B5.js";import"../../chunk-GMCZXMOV.js";import"../../chunk-RLBXE4EU.js";import"../../chunk-HNKB2ZYR.js";import"../../chunk-CLOS6SSX.js";import"../../chunk-S4AWJX4Q.js";import"../../chunk-KG7RJWOK.js";import"../../chunk-VPFNZ7TB.js";import"../../chunk-LOMEH6DG.js";import"../../chunk-KCOBHPN6.js";import{useMediaPanel as N,usePanelPick as S,useCancelPanelPick as C}from"../../chunk-R6WTQWAC.js";import"../../chunk-O7Q4DDJT.js";import"../../chunk-RSCMJIWS.js";import{useHostEscape as R}from"../../chunk-U3JP4VGF.js";import{DEFAULT_SCREEN_WORDS as P}from"../../chunk-VVPZMWJE.js";import"../../chunk-I54UCYOU.js";import"../../chunk-GOTN2KY4.js";import"../../chunk-R5L2E7JX.js";import"../../chunk-IQ5TA7AM.js";import{slotChildRowName as x}from"../../chunk-TBF5CVPA.js";import"../../chunk-DUVRZ456.js";import"../../chunk-6W7WLPZH.js";import"../../chunk-IYT6NN2J.js";import{slotFieldsOf as A,nestsInTree as H}from"../../chunk-PLVEGYK6.js";import{useEasel as M}from"../../chunk-PVAIOBBE.js";import"../../chunk-TBY3DFKS.js";import"../../chunk-ECM5F6JJ.js";import"../../chunk-BPZQ7S2Z.js";import"../../chunk-XWFH2NHZ.js";import{LayersTree as V,Subtree as v,TreeRow as E,TreeRowAction as B,TreeSeam as D}from"../../chunk-4JSBIW5H.js";import{DEFAULT_TREE_WORDS as g}from"../../chunk-K56YDHYQ.js";import"../../chunk-EA2HTX37.js";import"../../chunk-RC25EGHD.js";import"../../chunk-KFV7N2DJ.js";import"../../chunk-YRLPFZW3.js";import"../../chunk-NDRZP6YR.js";import{DEFAULT_SAVE_WORDS as w,saveIndicator as z}from"../../chunk-H6DDIBQ4.js";import"../../chunk-NY7HHUGB.js";import"../../chunk-33C6ALT5.js";import"../../chunk-2XMHLXMA.js";import"../../chunk-G3GWAP5R.js";import"../../chunk-WRFD4EXD.js";import"../../chunk-36LVP5WD.js";import{SaveState as F,panelWidthVars as b}from"../../chunk-IE55HNMA.js";import"../../chunk-Z6PVRXVY.js";import"../../chunk-THWO5YVZ.js";import"../../chunk-RE4LP46F.js";import"../../chunk-MJM6SFD3.js";import"../../chunk-2OAZYSWJ.js";import{useWords as I}from"../../chunk-MFIRYGHW.js";import"../../chunk-QFVRMARS.js";import"../../chunk-AYWN5NRH.js";import{useTreeDrag as W}from"../../chunk-67GNT6PF.js";import"../../chunk-P2VEMZH5.js";import"../../chunk-ILXP5VX5.js";import{zoneKey as Z,parseZoneKey as L}from"../../chunk-KRXQM65X.js";import"../../chunk-NKB3KVAB.js";import{useState as O,useRef as T,useEffect as Y,useCallback as J,Fragment as G}from"react";import{Tooltip as X}from"efficient-shell/ui";import{TrashIcon as K}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}=y(),re=c(),{appState:te,selectedItem:se,config:ie}=M(e=>e),[ce,pe]=O(l),le=I("screen",P),me=I("tree",g),de=I("save",w),{first:ae,last:ue,panelOf:he}=m(),ke=he(ae),fe=d(),je=a(),ye=te.data.content?.[0]??null,Ne=ye?.props.id??null,Se=ye?.type===ae,Ce=ye?.type===ue,Re=T(null),Pe=T(null);r(Pe);const xe=N(),Ae=S(),He=C();u(se?.props.id),Y(()=>{const e=Pe.current;if(!Ae||!e)return;const n=e=>{"Escape"===e.key&&He()};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[Ae]),R(null!==Ae,()=>He()),Y(()=>{Ne&&Re.current!==Ne&&(Re.current=Ne,Se?pe(ke??l):se||re.select({index:0}))},[Ne,se,re,Se]);const Me=J(e=>pe(n=>h(n,e)?n:e),[]),Ve=k({kind:ce.kind,mode:ce,open:Me,show:e=>pe(e),reveal:()=>{},select:(e,n)=>{pe(e=>h(e,n)?e:n),re.select(e)}}),{selectNode:ve}=i({mode:ce,setMode:pe,onOpenPart:n}),Ee=f(),{labelAtLevel:Be,Icon:De}=Ee,{canAddTo:ge}=j(),we=e=>Be(e,"block",ie.components[e]?.label??e),ze=e=>Be(e,"section",we(e)),Fe=!Se&&"puck"===ce.kind&&se?.props.id===Ne,be=ye?ge(ye.type)?.spec??null:null,Ie=ye&&be?`${ye.props.id}:${be.slot}`:null,We=ye&&be&&Array.isArray(ye.props[be.slot])?ye.props[be.slot]:[],Ze=e=>x(e,we,Ee.plainText),Le=(e,r)=>{ye&&be&&Ie&&(pe(l),be.slider?(o(String(ye.props.id),e),re.select({index:e,zone:Ie}),n(String(ye.props.id))):(re.select({index:e,zone:Ie}),n(r)))},Oe=()=>{if(!ye||!be||!Ie)return;const e=We.length;re.insertComponent(Ie,be.childType,e),pe(l),be.slider?requestAnimationFrame(()=>{o(String(ye.props.id),e),re.select({index:e,zone:Ie})}):re.select({index:e,zone:Ie})},Te=e=>A(ie,e),Ye=e=>{const{parentId:n,slot:o}=L(e),r=e=>{if(!e)return null;if(String(e.props.id)===n)return e;for(const n of Te(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(ye)?.props[o];return Array.isArray(t)?t.length:0},Je=(e,n,o)=>{const r=Math.min(Math.max(o,0),Ye(e)),t=n<r?r-1:r;t!==n&&(re.reorderComponent(e,n,t),pe(l),re.select({index:t,zone:e}))},Ge=W({keyOf:e=>e.id,readOnly:Boolean(ne),canDrop:(e,n)=>Z(n)===e.zone&&n.index>=0&&n.index<=Ye(e.zone),onDrop:(e,n)=>Je(e.zone,e.index,n.index),onStep:(e,n)=>Je(e.zone,e.index,n<0?e.index-1:e.index+2)}),Xe=(e,n)=>/* @__PURE__ */$(D,{...ne?{}:Ge.seam({place:{...L(e),index:n}})},`seam:${e}:${n}`),Ke=e=>Ee.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=Te((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=ge(e.type),s=t?.choices??null,i="footer"===t?.source?Ke:Ze;/* @__PURE__ */
2
+ return Q(U,{children:[o.map(({child:e,zone:o,index:r})=>{const t=se?.props.id===e.props.id,s=H(ie,e.type,n),c=i(e),p=String(e.props.id),m=()=>Qe(o,r,p),{rowProps:d,...a}=Ge.row({item:{id:p,zone:o,index:r},place:{...L(o),index:r}},{onClick:q(m)});/* @__PURE__ */
3
+ return Q(G,{children:[0===r&&Xe(o,0),
4
+ /* @__PURE__ */$(E,{words:me,icon:/* @__PURE__ */$(De,{type:e.type,size:13}),name:c,selected:t,onSelect:m,...a,actions:/* @__PURE__ */$(B,{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__ */$(K,{size:13})}),rowProps:d}),s&&/* @__PURE__ */$(v,{children:qe(e,n+1)}),Xe(o,r+1)]},String(e.props.id??`${o}-${r}`))}),t&&s?Ue(`${e.props.id}:${t.slot}`,o.length,s):null]})},_e="HeroSingle"===ye?.type,en=Boolean(ye)&&(Boolean(ge(ye.type))||Te(ye.type).length>0),nn=Boolean(ye)&&(Boolean(be)||Ce||Se||_e||en);/* @__PURE__ */
5
+ return Q("div",{ref:Pe,className:"sf-editor es-editor",style:b(s),children:[
6
+ /* @__PURE__ */$("div",{className:"sf-section-bar",children:/* @__PURE__ */$(F,null!==oe?{tone:"off",label:oe,role:"status"}:{...z(ee,de),role:"status"})}),
7
7
  /* @__PURE__ */Q("div",{className:"sf-body",children:[Ae&&xe?/* @__PURE__ */$("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:/* @__PURE__ */$(p,{panel:xe,pick:Ae})}):nn&&ye&&/* @__PURE__ */Q("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left",children:[
8
- /* @__PURE__ */$("div",{className:"sf-panel-head",children:/* @__PURE__ */$(X,{content:Se?le.headerSettings:le.sectionSettings({name:we(ye.type)}),side:"bottom",children:/* @__PURE__ */$("button",{type:"button",className:"sf-panel-title sf-panel-title--btn "+(ze?"is-selected":""),"aria-pressed":ze,onClick:()=>{Se?pe(ke??m):(pe(m),re.select({index:0}))},children:we(ye.type)})})}),
9
- /* @__PURE__ */$(V,{className:"sf-tree sf-scroll",rootProps:Je.rootProps(),words:me,children:/* @__PURE__ */$(v,{children:Se?
10
- /* @__PURE__ */$(D,{words:me,icon:/* @__PURE__ */$(ge,{type:"header",size:13}),name:le.headerSettings,selected:ce.kind===ke?.kind,onSelect:()=>pe(ke??m),rowProps:{onClick:q(()=>pe(ke??m))}}):Fe?/* @__PURE__ */Q(U,{children:[Ie.map((e,n)=>{const o=se?.props.id===e.props.id,r=We(e),t=String(e.props.id),s=()=>Ye(n,t),{rowProps:i,...c}=Je.row({item:{id:t,zone:be,index:n},place:{...Y(be),index:n}},{onClick:q(s)});/* @__PURE__ */
11
- return Q(J,{children:[0===n&&Xe(be,0),
12
- /* @__PURE__ */$(D,{words:me,icon:/* @__PURE__ */$(ge,{type:e.type,size:13}),name:r,selected:o,onSelect:s,...c,actions:/* @__PURE__ */$(E,{kind:"delete",label:le.deleteNamed({name:r}),onClick:()=>{return e=n,void(be&&(re.removeComponent(be,e),pe(m),re.select(null)));var e},children:/* @__PURE__ */$(K,{size:13})}),rowProps:i}),Xe(be,n+1)]},String(e.props.id??n))}),
13
- /* @__PURE__ */Q("button",{type:"button",className:"sf-add-card",onClick:Le,children:[
14
- /* @__PURE__ */$("span",{className:"sf-plus sf-plus--sm",children:"+"}),Fe.addLabel]}),Ne?Ve.partRows?.(ye,_):null]}):qe(ye,1)})})]}),
8
+ /* @__PURE__ */$("div",{className:"sf-panel-head",children:/* @__PURE__ */$(X,{content:Se?le.headerSettings:le.sectionSettings({name:ze(ye.type)}),side:"bottom",children:/* @__PURE__ */$("button",{type:"button",className:"sf-panel-title sf-panel-title--btn "+(Fe?"is-selected":""),"aria-pressed":Fe,onClick:()=>{Se?pe(ke??l):(pe(l),re.select({index:0}))},children:ze(ye.type)})})}),
9
+ /* @__PURE__ */$(V,{className:"sf-tree sf-scroll",rootProps:Ge.rootProps(),words:me,children:/* @__PURE__ */$(v,{children:Se?
10
+ /* @__PURE__ */$(E,{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))}}):be?/* @__PURE__ */Q(U,{children:[We.map((e,n)=>{const o=se?.props.id===e.props.id,r=Ze(e),t=String(e.props.id),s=()=>Le(n,t),{rowProps:i,...c}=Ge.row({item:{id:t,zone:Ie,index:n},place:{...L(Ie),index:n}},{onClick:q(s)});/* @__PURE__ */
11
+ return Q(G,{children:[0===n&&Xe(Ie,0),
12
+ /* @__PURE__ */$(E,{words:me,icon:/* @__PURE__ */$(De,{type:e.type,size:13}),name:r,selected:o,onSelect:s,...c,actions:/* @__PURE__ */$(B,{kind:"delete",label:le.deleteNamed({name:r}),onClick:()=>{return e=n,void(Ie&&(re.removeComponent(Ie,e),pe(l),re.select(null)));var e},children:/* @__PURE__ */$(K,{size:13})}),rowProps:i}),Xe(Ie,n+1)]},String(e.props.id??n))}),
13
+ /* @__PURE__ */Q("button",{type:"button",className:"sf-add-card",onClick:Oe,children:[
14
+ /* @__PURE__ */$("span",{className:"sf-plus sf-plus--sm",children:"+"}),be.addLabel]}),Ne?Ve.partRows?.(ye,_):null]}):qe(ye,1)})})]}),
15
15
  /* @__PURE__ */$("div",{className:"sf-center",children:/* @__PURE__ */$("div",{className:"sf-preview-host",children:/* @__PURE__ */$(fe,{})})}),
16
- /* @__PURE__ */$(c,{value:{selectChild:(e,n,o,r)=>"section"===Be(r)?.source?Ye(n,o):Qe(e,n,o),addChild:(e,n,o,r,t)=>"section"===Be(t)?.source?Le():$e(`${e}:${n}`,o,r),childRowName:We,blockRowName:Ke},children:/* @__PURE__ */$(je,{mode:ce,onOpenWebsiteSettings:Ve.openSettings??(()=>{}),onSelectNode:ve,hideNodeActions:!0})})]})]})}export{ee as default};
16
+ /* @__PURE__ */$(t,{value:{selectChild:(e,n,o,r)=>"section"===ge(r)?.source?Le(n,o):Qe(e,n,o),addChild:(e,n,o,r,t)=>"section"===ge(t)?.source?Oe():$e(`${e}:${n}`,o,r),childRowName:Ze,blockRowName:Ke},children:/* @__PURE__ */$(je,{mode:ce,onOpenWebsiteSettings:Ve.openSettings??(()=>{}),onSelectNode:ve,hideNodeActions:!0})})]})]})}export{ee as default};
@@ -10,7 +10,9 @@ import { CSSProperties } from 'react';
10
10
  * package's one set (`efficient-easel/icons`) already held — the icons there
11
11
  * were lifted from here, path for path. Now the names map onto that set and
12
12
  * nothing is drawn twice; the subpath and its names stay because the
13
- * website builder and the storefront import them.
13
+ * website builder and the storefront import them. It reads the drawings
14
+ * (`efficient-shell/icons/efficient-glyphs`), never the meanings, because
15
+ * shopper pages reach it through the draw/client leaf.
14
16
  *
15
17
  * WRAPPER ATTRIBUTES ARE THE CALLER'S. Size, stroke weight and cap style are
16
18
  * passed in rather than fixed, because they legitimately differ — a 10px caret
@@ -1 +1 @@
1
- export{UiIcon as default}from"../../chunk-6OA4UXKZ.js";
1
+ export{UiIcon as default}from"../../chunk-OG2SKSSK.js";
@@ -18,7 +18,8 @@ import '../../words-BDignMl_.js';
18
18
  import '../../types-BsyPh6EW.js';
19
19
  import '../../style-clipboard/index.js';
20
20
  import '../../words-CnnHb9jo.js';
21
- import '../../types-BLRK6_JO.js';
21
+ import '../../types-D8P9q-BG.js';
22
+ import 'efficient-shell/ui';
22
23
  import '../../words-Cl9xMUYY.js';
23
24
  import './AddSidePanel.js';
24
25
  import '../lib/section-template-types.js';
@@ -30,7 +31,6 @@ import '../lib/session.js';
30
31
  import '../lib/backend-error.js';
31
32
  import '../lib/host-chrome.js';
32
33
  import '../lib/links/link-filters.js';
33
- import 'efficient-shell/ui';
34
34
  import '../lib/document-hooks.js';
35
35
  import '../lib/document-switch.js';
36
36
  import '../../engine-CvXpFE86.js';
@@ -24,7 +24,8 @@ import '../words-BDignMl_.js';
24
24
  import '../types-BsyPh6EW.js';
25
25
  import '../style-clipboard/index.js';
26
26
  import '../words-CnnHb9jo.js';
27
- import '../types-BLRK6_JO.js';
27
+ import '../types-D8P9q-BG.js';
28
+ import 'efficient-shell/ui';
28
29
  import '../words-Cl9xMUYY.js';
29
30
  import './components/AddSidePanel.js';
30
31
  import './lib/section-template-types.js';
@@ -32,7 +33,6 @@ import './lib/puck/content-tree.js';
32
33
  import './lib/puck/block-choice.js';
33
34
  import './lib/host-chrome.js';
34
35
  import './lib/links/link-filters.js';
35
- import 'efficient-shell/ui';
36
36
  import './lib/puck/add-target-types.js';
37
37
  import './lib/puck/slot-section-spec.js';
38
38
  import './lib/backend-error.js';
@@ -1 +1 @@
1
- import"../chunk-GZO72N3Q.js";export{DocumentScreen,ScreenMount}from"../chunk-NQXFINT2.js";import"../chunk-GXQCZJOP.js";import"../chunk-GYNIDJKN.js";import"../chunk-M4CNCPHA.js";import"../chunk-FGNR22NY.js";import"../chunk-2GVCAIPX.js";import"../chunk-26OOWIJJ.js";import"../chunk-NBDMTIU2.js";import"../chunk-MQNBD6AB.js";import"../chunk-ZE7I3PLX.js";import"../chunk-7F52SZOI.js";import"../chunk-W4U4SHKW.js";import"../chunk-RKTF5XLP.js";export{ScreenStoreProvider}from"../chunk-J54OXLQF.js";import"../chunk-3Z2MVLCD.js";import"../chunk-4EI6UGGH.js";import"../chunk-TZIIRGVY.js";import"../chunk-H5QI34FV.js";import"../chunk-S2MMPHKD.js";import"../chunk-KCBEE2MC.js";import"../chunk-5545A3PC.js";import"../chunk-WUSJ6SSF.js";import"../chunk-PA3PNTVV.js";import"../chunk-5ZBY24K7.js";import"../chunk-BVN33R76.js";import"../chunk-62VPYC7F.js";import"../chunk-J2JDC3EZ.js";import"../chunk-O5XI3WAQ.js";import"../chunk-ENXLPJ77.js";import"../chunk-ZIFDZGY7.js";import"../chunk-ERR437B5.js";import"../chunk-GMCZXMOV.js";import"../chunk-HNKB2ZYR.js";import"../chunk-CLOS6SSX.js";import"../chunk-S4AWJX4Q.js";import"../chunk-KG7RJWOK.js";import"../chunk-VPFNZ7TB.js";import"../chunk-LOMEH6DG.js";export{NO_DOCUMENT_ADDRESSING}from"../chunk-RLBXE4EU.js";import"../chunk-KCOBHPN6.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";import"../chunk-UMDQ6CLQ.js";import"../chunk-V7U33NF2.js";import"../chunk-6WY6ZXJG.js";import"../chunk-HQ4VVRIC.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-FZ3Y3QTQ.js";import"../chunk-R6WTQWAC.js";export{DETACHED_EASEL_HOST,EaselHostContext,EaselHostProvider,createEaselHost,useEaselHost,useHostEscape}from"../chunk-U3JP4VGF.js";import"../chunk-BXMXTO36.js";import"../chunk-OSPUG6S6.js";import"../chunk-WK3AFPXY.js";import"../chunk-VVPZMWJE.js";import"../chunk-BSPCSC45.js";import"../chunk-I54UCYOU.js";import"../chunk-GOTN2KY4.js";import"../chunk-R5L2E7JX.js";import"../chunk-IQ5TA7AM.js";import"../chunk-TBF5CVPA.js";import"../chunk-DUVRZ456.js";import"../chunk-6W7WLPZH.js";import"../chunk-IYT6NN2J.js";import"../chunk-PLVEGYK6.js";import"../chunk-PVAIOBBE.js";import"../chunk-TBY3DFKS.js";import"../chunk-ECM5F6JJ.js";import"../chunk-BPZQ7S2Z.js";import"../chunk-XWFH2NHZ.js";import"../chunk-4JSBIW5H.js";import"../chunk-K56YDHYQ.js";import"../chunk-EA2HTX37.js";import"../chunk-RC25EGHD.js";import"../chunk-KFV7N2DJ.js";import"../chunk-YRLPFZW3.js";import"../chunk-4VJATVVR.js";import"../chunk-NDRZP6YR.js";import"../chunk-H6DDIBQ4.js";import"../chunk-IE55HNMA.js";import"../chunk-Z6PVRXVY.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";import"../chunk-MJM6SFD3.js";import"../chunk-2OAZYSWJ.js";import"../chunk-NY7HHUGB.js";import"../chunk-33C6ALT5.js";import"../chunk-2XMHLXMA.js";import"../chunk-G3GWAP5R.js";import"../chunk-WRFD4EXD.js";import"../chunk-36LVP5WD.js";import"../chunk-MFIRYGHW.js";import"../chunk-QFVRMARS.js";import"../chunk-AYWN5NRH.js";import"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-ILXP5VX5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
1
+ import"../chunk-GZO72N3Q.js";export{DocumentScreen,ScreenMount}from"../chunk-52LIZZG4.js";import"../chunk-GXQCZJOP.js";import"../chunk-FUMIBYUU.js";import"../chunk-M4CNCPHA.js";import"../chunk-FGNR22NY.js";import"../chunk-2GVCAIPX.js";import"../chunk-26OOWIJJ.js";import"../chunk-NBDMTIU2.js";import"../chunk-MQNBD6AB.js";import"../chunk-ZE7I3PLX.js";import"../chunk-7F52SZOI.js";import"../chunk-W4U4SHKW.js";import"../chunk-RKTF5XLP.js";export{ScreenStoreProvider}from"../chunk-J54OXLQF.js";import"../chunk-3Z2MVLCD.js";import"../chunk-4EI6UGGH.js";import"../chunk-KCBEE2MC.js";import"../chunk-TZIIRGVY.js";import"../chunk-H5QI34FV.js";import"../chunk-S2MMPHKD.js";import"../chunk-5545A3PC.js";import"../chunk-YWUHPY5W.js";import"../chunk-PA3PNTVV.js";import"../chunk-BVN33R76.js";import"../chunk-5ZBY24K7.js";import"../chunk-62VPYC7F.js";import"../chunk-HQ4VVRIC.js";import"../chunk-J2JDC3EZ.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-FZ3Y3QTQ.js";import"../chunk-NW4LJ4G4.js";import"../chunk-IWFVVCRN.js";import"../chunk-FBS75I6E.js";import"../chunk-ERR437B5.js";import"../chunk-GMCZXMOV.js";export{NO_DOCUMENT_ADDRESSING}from"../chunk-RLBXE4EU.js";import"../chunk-HNKB2ZYR.js";import"../chunk-CLOS6SSX.js";import"../chunk-S4AWJX4Q.js";import"../chunk-KG7RJWOK.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-UMDQ6CLQ.js";import"../chunk-VVPZMWJE.js";import"../chunk-V7U33NF2.js";import"../chunk-6WY6ZXJG.js";import"../chunk-BXMXTO36.js";import"../chunk-OSPUG6S6.js";import"../chunk-WK3AFPXY.js";import"../chunk-I54UCYOU.js";import"../chunk-GOTN2KY4.js";import"../chunk-R5L2E7JX.js";import"../chunk-BSPCSC45.js";import"../chunk-IQ5TA7AM.js";import"../chunk-TBF5CVPA.js";import"../chunk-DUVRZ456.js";import"../chunk-6W7WLPZH.js";import"../chunk-IYT6NN2J.js";import"../chunk-PLVEGYK6.js";import"../chunk-PVAIOBBE.js";import"../chunk-TBY3DFKS.js";import"../chunk-ECM5F6JJ.js";import"../chunk-BPZQ7S2Z.js";import"../chunk-XWFH2NHZ.js";import"../chunk-4JSBIW5H.js";import"../chunk-K56YDHYQ.js";import"../chunk-EA2HTX37.js";import"../chunk-RC25EGHD.js";import"../chunk-KFV7N2DJ.js";import"../chunk-YRLPFZW3.js";import"../chunk-4VJATVVR.js";import"../chunk-NDRZP6YR.js";import"../chunk-H6DDIBQ4.js";import"../chunk-NY7HHUGB.js";import"../chunk-33C6ALT5.js";import"../chunk-2XMHLXMA.js";import"../chunk-G3GWAP5R.js";import"../chunk-WRFD4EXD.js";import"../chunk-36LVP5WD.js";import"../chunk-IE55HNMA.js";import"../chunk-Z6PVRXVY.js";import"../chunk-THWO5YVZ.js";import"../chunk-RE4LP46F.js";import"../chunk-MJM6SFD3.js";import"../chunk-2OAZYSWJ.js";import"../chunk-MFIRYGHW.js";import"../chunk-QFVRMARS.js";import"../chunk-AYWN5NRH.js";import"../chunk-67GNT6PF.js";import"../chunk-P2VEMZH5.js";import"../chunk-ILXP5VX5.js";import"../chunk-KRXQM65X.js";import"../chunk-NKB3KVAB.js";
@@ -19,7 +19,8 @@ import '../../../panelWidths-D9hTLR25.js';
19
19
  import '../../../CanvasDragLayer-CLb7j-CZ.js';
20
20
  import '../../../session-DSQFmIvx.js';
21
21
  import '../../../words-BDignMl_.js';
22
- import '../../../types-BLRK6_JO.js';
22
+ import '../../../types-D8P9q-BG.js';
23
+ import 'efficient-shell/ui';
23
24
  import '../../../words-Cl9xMUYY.js';
24
25
  import '../../components/AddSidePanel.js';
25
26
  import '../section-template-types.js';
@@ -31,7 +32,6 @@ import '../session.js';
31
32
  import '../backend-error.js';
32
33
  import '../host-chrome.js';
33
34
  import '../links/link-filters.js';
34
- import 'efficient-shell/ui';
35
35
  import '../document-hooks.js';
36
36
  import '../document-switch.js';
37
37
  import '../../../engine-CvXpFE86.js';
@@ -1 +1 @@
1
- export{copyNodeStyle,nodeStyleRows,planNodePaste,shopFieldKind,siteStyleScope,styleClipboardOf}from"../../../chunk-M4CNCPHA.js";import"../../../chunk-NBDMTIU2.js";import"../../../chunk-MQNBD6AB.js";import"../../../chunk-ZE7I3PLX.js";import"../../../chunk-7F52SZOI.js";import"../../../chunk-V7U33NF2.js";import"../../../chunk-6WY6ZXJG.js";import"../../../chunk-VVPZMWJE.js";import"../../../chunk-BSPCSC45.js";import"../../../chunk-DUVRZ456.js";import"../../../chunk-MFIRYGHW.js";
1
+ export{copyNodeStyle,nodeStyleRows,planNodePaste,shopFieldKind,siteStyleScope,styleClipboardOf}from"../../../chunk-M4CNCPHA.js";import"../../../chunk-NBDMTIU2.js";import"../../../chunk-MQNBD6AB.js";import"../../../chunk-ZE7I3PLX.js";import"../../../chunk-7F52SZOI.js";import"../../../chunk-VVPZMWJE.js";import"../../../chunk-V7U33NF2.js";import"../../../chunk-6WY6ZXJG.js";import"../../../chunk-BSPCSC45.js";import"../../../chunk-DUVRZ456.js";import"../../../chunk-MFIRYGHW.js";
@@ -8,7 +8,7 @@ import { M as MeasuredCanvas, C as CanvasDragModel } from '../../CanvasDragLayer
8
8
  import { E as EaselContextMenuItem } from '../../types-BsyPh6EW.js';
9
9
  import { a as EaselRailItem } from '../../types-CsgMwHHa.js';
10
10
  import { StyleRow } from '../../style-clipboard/index.js';
11
- import { T as TreeRowMark } from '../../types-BLRK6_JO.js';
11
+ import { T as TreeRowMark } from '../../types-D8P9q-BG.js';
12
12
  import { AddKey } from '../components/AddSidePanel.js';
13
13
  import { k as AnyScreenTarget } from '../../host-GOlVK3LX.js';
14
14
  import { HostProduct } from './host-chrome.js';
@@ -25,6 +25,7 @@ import '../../session-DSQFmIvx.js';
25
25
  import '../../words-BDignMl_.js';
26
26
  import '../../wordFit-7XpmhcaW.js';
27
27
  import '../../words-CnnHb9jo.js';
28
+ import 'efficient-shell/ui';
28
29
  import '../../words-Cl9xMUYY.js';
29
30
  import './section-template-types.js';
30
31
  import './puck/block-choice.js';
@@ -34,7 +35,6 @@ import '../../engine-CvXpFE86.js';
34
35
  import './admin-bridge.js';
35
36
  import './backend-error.js';
36
37
  import './links/link-filters.js';
37
- import 'efficient-shell/ui';
38
38
  import './document-hooks.js';
39
39
  import './puck/slot-section-spec.js';
40
40
 
@@ -1 +1 @@
1
- export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-5AIA5VIP.js";import"../chunk-OGH6CC3E.js";import"../chunk-643PVCEG.js";import"../chunk-6WY6ZXJG.js";import"../chunk-WK3AFPXY.js";import"../chunk-VVPZMWJE.js";import"../chunk-TBY3DFKS.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";import"../chunk-H6DDIBQ4.js";import"../chunk-Z6PVRXVY.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-33C6ALT5.js";import"../chunk-WRFD4EXD.js";import"../chunk-AYWN5NRH.js";
1
+ export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-6RLEHTMK.js";import"../chunk-OGH6CC3E.js";import"../chunk-643PVCEG.js";import"../chunk-VVPZMWJE.js";import"../chunk-6WY6ZXJG.js";import"../chunk-WK3AFPXY.js";import"../chunk-TBY3DFKS.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";import"../chunk-H6DDIBQ4.js";import"../chunk-33C6ALT5.js";import"../chunk-WRFD4EXD.js";import"../chunk-Z6PVRXVY.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-AYWN5NRH.js";
@@ -1,2 +1,2 @@
1
- import{DEFAULT_EASEL_STRINGS as r,mergeEaselStrings as n}from"../chunk-5AIA5VIP.js";export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-5AIA5VIP.js";import"../chunk-OGH6CC3E.js";import"../chunk-643PVCEG.js";import"../chunk-6WY6ZXJG.js";import"../chunk-WK3AFPXY.js";import"../chunk-VVPZMWJE.js";import"../chunk-TBY3DFKS.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";import"../chunk-H6DDIBQ4.js";import"../chunk-Z6PVRXVY.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import"../chunk-33C6ALT5.js";import"../chunk-WRFD4EXD.js";import{stringsContext as o}from"../chunk-MFIRYGHW.js";import"../chunk-AYWN5NRH.js";import{useContext as t,useMemo as c}from"react";import{jsx as i}from"react/jsx-runtime";function s({value:s,locale:u,children:m}){const e=o(),p=t(e),h=p?.strings??r,j=u??p?.locale??"en",k=c(()=>({strings:n(h,s),locale:j}),[h,s,j]);/* @__PURE__ */
1
+ import{DEFAULT_EASEL_STRINGS as r,mergeEaselStrings as n}from"../chunk-6RLEHTMK.js";export{DEFAULT_EASEL_STRINGS,mergeEaselStrings}from"../chunk-6RLEHTMK.js";import"../chunk-OGH6CC3E.js";import"../chunk-643PVCEG.js";import"../chunk-VVPZMWJE.js";import"../chunk-6WY6ZXJG.js";import"../chunk-WK3AFPXY.js";import"../chunk-TBY3DFKS.js";import"../chunk-K56YDHYQ.js";import"../chunk-KFV7N2DJ.js";import"../chunk-H6DDIBQ4.js";import"../chunk-33C6ALT5.js";import"../chunk-WRFD4EXD.js";import"../chunk-Z6PVRXVY.js";import"../chunk-RE4LP46F.js";import"../chunk-2OAZYSWJ.js";import{stringsContext as o}from"../chunk-MFIRYGHW.js";import"../chunk-AYWN5NRH.js";import{useContext as t,useMemo as c}from"react";import{jsx as i}from"react/jsx-runtime";function s({value:s,locale:u,children:m}){const e=o(),p=t(e),h=p?.strings??r,j=u??p?.locale??"en",k=c(()=>({strings:n(h,s),locale:j}),[h,s,j]);/* @__PURE__ */
2
2
  return i(e.Provider,{value:k,children:m})}function u(){return t(o())?.strings??r}function m(){return t(o())?.locale??"en"}export{s as EaselStringsProvider,m as useEaselLocale,u as useEaselStrings};
@@ -1,7 +1,8 @@
1
1
  import * as react from 'react';
2
- import { L as LayersTreeProps, S as SubtreeProps, a as TreeGroupLabelProps, b as TreeEmptySlotProps, c as TreeRowProps, d as TreeRowActionProps, e as TreeSeamProps } from '../types-BLRK6_JO.js';
3
- export { f as TreeRowFold, T as TreeRowMark } from '../types-BLRK6_JO.js';
2
+ import { L as LayersTreeProps, S as SubtreeProps, a as TreeGroupLabelProps, b as TreeEmptySlotProps, c as TreeRowProps, d as TreeRowActionProps, e as TreeSeamProps } from '../types-D8P9q-BG.js';
3
+ export { f as TreeRowFold, T as TreeRowMark } from '../types-D8P9q-BG.js';
4
4
  export { T as TreeWords } from '../words-Cl9xMUYY.js';
5
+ import 'efficient-shell/ui';
5
6
 
6
7
  /**
7
8
  * The Layers tree's container: the shell's `Tree` (`role="tree"`, its roving tab
@@ -1,4 +1,5 @@
1
1
  import { ReactNode, HTMLAttributes } from 'react';
2
+ import { TreeBadge } from 'efficient-shell/ui';
2
3
  import { T as TreeWords } from './words-Cl9xMUYY.js';
3
4
 
4
5
  type LayersTreeProps = {
@@ -76,8 +77,12 @@ type TreeRowProps = {
76
77
  onSelect?: () => void;
77
78
  /** Named state glyphs drawn right after the name — "Hidden on phones". */
78
79
  marks?: ReadonlyArray<TreeRowMark>;
79
- /** A count or position pill after the name — "1 of 2". */
80
- badge?: ReactNode;
80
+ /**
81
+ * The pill after the name: a count or position ("1 of 2"), or a tag with a
82
+ * status tone (`{ label: 'Dynamic', tone: 'info' }`), or several tags. The
83
+ * shell's one pill draws all three (efficient-shell 7.70.0, `TreeBadge`).
84
+ */
85
+ badge?: ReactNode | TreeBadge | readonly TreeBadge[];
81
86
  /** A non-interactive named mark — the Lock on a pinned section. Drawn after the marks. */
82
87
  trailing?: {
83
88
  label: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efficient-easel",
3
- "version": "12.1.0",
3
+ "version": "13.0.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",
@@ -38,6 +38,11 @@
38
38
  "import": "./dist/icons/index.js",
39
39
  "default": "./dist/icons/index.js"
40
40
  },
41
+ "./icons/meanings": {
42
+ "types": "./dist/icons/meanings.d.ts",
43
+ "import": "./dist/icons/meanings.js",
44
+ "default": "./dist/icons/meanings.js"
45
+ },
41
46
  "./menu": {
42
47
  "types": "./dist/menu/index.d.ts",
43
48
  "import": "./dist/menu/index.js",
@@ -542,7 +547,7 @@
542
547
  "dist"
543
548
  ],
544
549
  "peerDependencies": {
545
- "efficient-shell": "^7.69.1",
550
+ "efficient-shell": "^7.71.0",
546
551
  "react": ">=18",
547
552
  "react-dom": ">=18"
548
553
  },
@@ -552,7 +557,7 @@
552
557
  "@types/node": "^22.0.0",
553
558
  "@types/react": "^18.2.0",
554
559
  "@types/react-dom": "^18.2.0",
555
- "efficient-shell": "^7.69.1",
560
+ "efficient-shell": "^7.71.0",
556
561
  "esbuild": "^0.27.0",
557
562
  "jsdom": "^26.1.0",
558
563
  "react": "^18.2.0",
@@ -1 +0,0 @@
1
- import{DEFAULT_TEXT_STYLES_WORDS as o}from"./chunk-OGH6CC3E.js";import{DEFAULT_PICK_WORDS as r}from"./chunk-643PVCEG.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as t}from"./chunk-6WY6ZXJG.js";import{DEFAULT_NODE_MENU_WORDS as m}from"./chunk-WK3AFPXY.js";import{DEFAULT_SCREEN_WORDS as n}from"./chunk-VVPZMWJE.js";import{DEFAULT_CANVAS_WORDS as c}from"./chunk-TBY3DFKS.js";import{DEFAULT_TREE_WORDS as s}from"./chunk-K56YDHYQ.js";import{DEFAULT_PANEL_WORDS as f}from"./chunk-KFV7N2DJ.js";import{DEFAULT_SAVE_WORDS as p}from"./chunk-H6DDIBQ4.js";import{DEFAULT_CHROME_WORDS as e,DEFAULT_NOTICE_WORDS as i}from"./chunk-Z6PVRXVY.js";import{DEFAULT_LOCK_WORDS as u}from"./chunk-RE4LP46F.js";import{DEFAULT_RAIL_WORDS as k}from"./chunk-2OAZYSWJ.js";import{DEFAULT_COPY_WORDS as j}from"./chunk-33C6ALT5.js";import{DEFAULT_FIELDS_WORDS as h}from"./chunk-WRFD4EXD.js";import{DEFAULT_DRAG_WORDS as l}from"./chunk-AYWN5NRH.js";var a={notice:i,lock:u,save:p,chrome:e,rail:k,tree:s,panel:f,fields:h,pick:r,drag:l,menu:m,styleClipboard:t,copy:j,canvas:c,textStyles:o,screen:n},Y=o=>"object"==typeof o&&null!==o;function y(o,r){const t={};for(const m of Object.keys(o)){const n=o[m],c=r[m];null==c?t[m]=n:Y(n)?t[m]=Y(c)?y(n,c):n:t[m]=typeof c==typeof n?c:n}return t}function D(o,r){return r?y(o,r):o}export{a as DEFAULT_EASEL_STRINGS,D as mergeEaselStrings};
@@ -1,2 +0,0 @@
1
- import{ChevronRightIcon as e,TrashIcon as r,RenameIcon as i,ExternalIcon as t,SearchIcon as o,EyeOffIcon as n,EyeIcon as s}from"efficient-shell/icons/efficient";import{jsx as a}from"react/jsx-runtime";var c={eye:s,"eye-off":n,search:o,"external-link":t,pencil:i,trash:r,"chevron-right":e};function f({name:e,size:r,strokeWidth:i=1.8,rounded:t=!1,className:o,style:n}){/* @__PURE__ */
2
- return a(c[e],{size:r,strokeWidth:i,strokeLinecap:t?"round":void 0,strokeLinejoin:t?"round":void 0,className:o,style:n})}export{f as UiIcon};
@@ -1,57 +0,0 @@
1
- import{styleClipboardOf as e}from"./chunk-M4CNCPHA.js";import{markedTreeNodeId as n,revealSelectedTreeRow as t,sameSelector as o}from"./chunk-FGNR22NY.js";import{cloneNodeWithFreshIds as r}from"./chunk-2GVCAIPX.js";import{dedupeSlotChildren as i}from"./chunk-26OOWIJJ.js";import{ScreenSaveIcon as l,ScreenMainButton as s}from"./chunk-W4U4SHKW.js";import{useBrowserOffline as d}from"./chunk-RKTF5XLP.js";import{scrollPreviewToSection as c,gotoPreviewSlide as a,scrollPreviewToTop as p}from"./chunk-3Z2MVLCD.js";import{useEaselKeyTarget as u,useEaselUndoKeys as f,useEaselSaveKey as h,editorRootFocus as m}from"./chunk-4EI6UGGH.js";import{screenStorageKeys as g,DEFAULT_PANEL_W as y,clampPanelWidth as S}from"./chunk-TZIIRGVY.js";import{usePartBridge as k}from"./chunk-H5QI34FV.js";import{useSectionOps as v}from"./chunk-S2MMPHKD.js";import{SlotChildActionsProvider as b}from"./chunk-KCBEE2MC.js";import{AddChildRow as w}from"./chunk-5545A3PC.js";import{AddSidePanel as x}from"./chunk-WUSJ6SSF.js";import{SidePanelHead as z,PanelShowStrip as C}from"./chunk-62VPYC7F.js";import{MediaSidePanel as I}from"./chunk-J2JDC3EZ.js";import{useNodeClipboard as B,useNodeContextMenu as N}from"./chunk-O5XI3WAQ.js";import{PageEditGuardNotices as O}from"./chunk-ENXLPJ77.js";import{useScreenDocument as P}from"./chunk-ZIFDZGY7.js";import{requestMediaPick as $}from"./chunk-KG7RJWOK.js";import{useEaselSession as M}from"./chunk-O7Q4DDJT.js";import{heldStyle as j,styleShortcut as A}from"./chunk-V7U33NF2.js";import{DEFAULT_STYLE_CLIPBOARD_WORDS as T}from"./chunk-6WY6ZXJG.js";import{useScreenSaveSwitch as L,useScreenNodeKeys as E,useScreenPinned as R,useScreenDocumentLabel as V,useScreenCanvasFrame as F,useScreenInspectorPanel as H,useScreenDevices as W,useScreenPickFollowsSelection as D,useScreenLeftView as J,SELECTION_MODE as U,sameInspectorMode as G,useScreenBridges as Y,useScreenBlockRules as X,useScreenBlockLook as Z,useScreenStorageNamespace as K,useScreenNotify as q,useScreenCanvasHead as Q,isSlotMode as _,useScreenStyleClipboard as ee,useScreenDocumentPass as ne,useScreenCanvasDrag as te,ScreenCanvasTargetProvider as oe,isPinnedFirst as re,isPinnedLast as ie,screenSlotsOf as le}from"./chunk-FZ3Y3QTQ.js";import{useMediaPanel as se,usePanelPick as de,useCancelPanelPick as ce}from"./chunk-R6WTQWAC.js";import{useEaselHost as ae,useHostEscape as pe}from"./chunk-U3JP4VGF.js";import{DEFAULT_NODE_MENU_WORDS as ue}from"./chunk-WK3AFPXY.js";import{DEFAULT_SCREEN_WORDS as fe}from"./chunk-VVPZMWJE.js";import{rootRowName as he,slotChildRowName as me,slotChildRenameProp as ge,sectionRenameProp as ye}from"./chunk-TBF5CVPA.js";import{ROOT_ZONE as Se,blockNodeActions as ke,TREE_MAX_DEPTH as ve,childSlotsOf as be,slotFieldsOf as we,slotChildrenIn as xe,nestsInTree as ze,newNodeId as Ce}from"./chunk-PLVEGYK6.js";import{useEasel as Ie,useEaselApi as Be,CanvasPassThroughContext as Ne}from"./chunk-PVAIOBBE.js";import{toItemSelector as Oe,useNodeOps as Pe,clickPick as $e}from"./chunk-ECM5F6JJ.js";import{TreeRow as Me,Subtree as je,LayersTree as Ae,TreeGroupLabel as Te,TreeRowAction as Le,TreeSeam as Ee}from"./chunk-4JSBIW5H.js";import{DEFAULT_TREE_WORDS as Re}from"./chunk-K56YDHYQ.js";import{LayersIcon as Ve,MediaIcon as Fe}from"./chunk-4VJATVVR.js";import{EaselTopBar as He,TopBarRail as We,TopBarCluster as De,EaselIconButton as Je,TopBarDivider as Ue,DeviceSwitch as Ge,InspectorIconButton as Ye,PanelResizeHandle as Xe,MAX_PANEL_W as Ze,MIN_PANEL_W as Ke,panelWidthVars as qe}from"./chunk-IE55HNMA.js";import{DEFAULT_NOTICE_WORDS as Qe,DEFAULT_CHROME_WORDS as _e}from"./chunk-Z6PVRXVY.js";import{holderOf as en,nameOrSomeone as nn}from"./chunk-THWO5YVZ.js";import{DEFAULT_LOCK_WORDS as tn}from"./chunk-RE4LP46F.js";import{useWords as on}from"./chunk-MFIRYGHW.js";import{insertSeams as rn,CanvasDragLayer as ln,CanvasInsert as sn}from"./chunk-QFVRMARS.js";import{DEFAULT_DRAG_WORDS as dn}from"./chunk-AYWN5NRH.js";import{createDragSession as cn,useTreeDrag as an,gapToMoveIndex as pn}from"./chunk-67GNT6PF.js";import{useCanvasFrame as un,LIST_SELECTOR as fn,BLOCK_SELECTOR as hn,useCanvasEvent as mn,nodeIdAt as gn,frameRectToHost as yn,BLOCK_ATTRIBUTE as Sn,drawnBox as kn}from"./chunk-ILXP5VX5.js";import{ROOT_ID as vn,ROOT_SLOT as bn,zoneKey as wn,parseZoneKey as xn,find as zn,DataError as Cn}from"./chunk-KRXQM65X.js";import{useRef as In,useMemo as Bn,useState as Nn,useEffect as On,useCallback as Pn,useLayoutEffect as $n,Fragment as Mn}from"react";import{ColoredBadge as jn,toast as An,groupColors as Tn}from"efficient-shell/ui";import{UndoIcon as Ln,RedoIcon as En,RefreshIcon as Rn,AddIcon as Vn,TrashIcon as Fn,EyeOffIcon as Hn,EyeIcon as Wn,DuplicateIcon as Dn}from"efficient-shell/icons/efficient";import{jsx as Jn,jsxs as Un,Fragment as Gn}from"react/jsx-runtime";var Yn=/* @__PURE__ */new WeakSet;function Xn(e,n,t){const o=zn(e,n,t);if(!o)return null;const r=o.path.find(e=>"root"!==e.parentId);return r?r.parentId:t}function Zn({canvas:e,tabs:n,onSelect:t}){const o=In(null),[r,i]=Nn({}),l=n.map(e=>`${e.id}:${e.below?1:0}`).join("|");return $n(()=>{const t=e?.document,r=e?.window,l=e?.frame;if(!t||!r||!l||0===n.length)return void i({});let s=0;const d=()=>{s=0;const e=o.current;if(!e)return;const d=yn(l,{left:0,top:0,width:r.innerWidth,height:r.innerHeight},e),c={};for(const o of n){const n=t.querySelector(`[${Sn}="${r.CSS?.escape?r.CSS.escape(o.id):o.id}"]`),i=n?kn(n):null;if(!i||0===i.height){c[o.id]=null;continue}const s=yn(l,{left:i.left,top:i.top,width:i.width,height:i.height},e),a=s.top+s.height;if(a<d.top||s.top>d.top+d.height){c[o.id]=null;continue}const p=o.below?a+4:Math.max(s.top,d.top)+6;c[o.id]={left:Math.max(s.left,d.left)+6,top:p}}i(c)},c=()=>{s||(s=r.requestAnimationFrame(d))};d(),r.addEventListener("scroll",c,!0),r.addEventListener("resize",c);const a=new r.MutationObserver(c);return a.observe(t.body,{childList:!0,subtree:!0,attributes:!0}),()=>{s&&r.cancelAnimationFrame(s),r.removeEventListener("scroll",c,!0),r.removeEventListener("resize",c),a.disconnect()}},[e,l]),/* @__PURE__ */Jn("div",{ref:o,className:"es-band-tabs","aria-hidden":"true",children:n.map(e=>{const n=r[e.id];return n?/* @__PURE__ */Jn("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:/* @__PURE__ */Jn(jn,{colorClass:Tn("info","solid"),size:"sm",children:e.label})},e.id):null})})}function Kn({expand:e}){/* @__PURE__ */
2
- return Jn("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */Un(Gn,e?{children:[
3
- /* @__PURE__ */Jn("path",{d:"M8 9l4-4 4 4"}),
4
- /* @__PURE__ */Jn("path",{d:"M8 15l4 4 4-4"})]}:{children:[
5
- /* @__PURE__ */Jn("path",{d:"M8 4l4 4 4-4"}),
6
- /* @__PURE__ */Jn("path",{d:"M8 20l4-4 4 4"}),
7
- /* @__PURE__ */Jn("path",{d:"M5 12h14"})]})})}var qn=`${fn}, ${hn}`;function Qn(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 _n="__rungs";var et="screen:band",nt={duplicate:!0,delete:!0};function tt(){const fn=ae(),{target:yn,docId:Sn,capabilities:kn,currentSlug:Tn,siteId:tt,onPublish:ot,saveState:rt,saveConflict:it,retrySave:lt,toggleAutoSave:st,flushSave:dt,access:ct,saveUnreachable:at=!1,readOnly:pt,readOnlyReason:ut=null}=P(),ft=L(),ht=E(),{mediaEditing:mt,hasEditGuard:gt,hasPinnedChrome:yt}=kn,{appState:St,dispatch:kt,history:vt,selectedItem:bt,getSelectorForId:wt,config:xt}=Ie(e=>e),zt=R(),{first:Ct,firstGroup:It,lastGroup:Bt,isSectionGroup:Nt,sectionGroupZone:Ot,panelOf:Pt}=zt,$t=Pt(Ct),Mt=e=>re(zt,e),jt=e=>ie(zt,e),At="node"===zt.firstRow,Tt=zt.band??null,Lt=on("screen",fe),Et=on("tree",Re),Rt=on("drag",dn),Vt=on("notice",Qe),Ft=on("lock",tn),Ht=on("menu",ue),Wt=on("styleClipboard",T),Dt=on("chrome",_e),Jt=V()??`/${Tn}`,Ut=F(),Gt=H(),Yt=v({readOnly:pt}),Xt=v({readOnly:pt,foldIntoHistory:!0}),Zt=In(null),Kt=Be(),qt=Bn(()=>({...Yt,select:e=>{Zt.current=e,Yt.select(e)},commitDocument:(e,n)=>{if(void 0!==n){const t=Kt.config;Zt.current=Oe(e,t,n)}Yt.commitDocument(e,n)}}),[Yt,Kt]),Qt=St.ui,_t=Qt.leftSideBarVisible,eo=Qt.rightSideBarVisible,{options:no,widths:to,initial:oo,fluid:ro,fit:io}=W(),[lo,so]=Nn(oo),co=se(),ao=mt&&null!==co,po=de(),uo=ce();D(bt?.props.id);const{read:fo,write:ho,forSelection:mo}=J(),[go,yo]=Nn(fo);On(()=>{ho(go)},[go]);const[So,ko]=Nn(0),vo=In(null),bo=In(null),wo=un(bo,{readySelector:qn}),xo=u(bo);f(bo,wo);const zo=d(),Co=en(ct),Io={state:rt,offline:zo||rt.failed&&at,readOnlyReason:ut,editing:Co?Vt.editing({name:nn(Co.name,Ft),noun:Lt.noun}):null,conflict:null!=it,notSaving:Lt.bar.notSaving},Bo=()=>{pt||(rt.failed?lt():dt())};h(bo,wo,Bo);const[No,Oo]=Nn(!1),Po=In(!1),$o=In(!1),[Mo,jo]=Nn(null),[Ao,To]=Nn([]),[Lo,Eo]=Nn(U),Ro="puck"===Lo.kind,Vo=n(Lo,bt?.props.id),[Fo,Ho]=Nn(null);On(()=>{Fo&&(t(),Ho(null))},[Fo]);const Wo=In(wt);Wo.current=wt;const Do=Pn((e,{scroll:n})=>{yo(n=>mo(e,n)),n&&Ho(e);const t=[];let o=e;for(let e=0;e<4;e++){const e=Wo.current(o)?.zone;if(!e||!e.includes(":"))break;const n=e.split(":")[0];t.push(n),t.push(e),o=n}0!==t.length&&kr(e=>{if(t.every(n=>!e.has(n)))return e;const n=new Set(e);return t.forEach(e=>n.delete(e)),n})},[]),Jo=In(null);On(()=>{const e=Jo.current;Jo.current=null;const n=null==bt?.props.id?null:String(bt.props.id);Eo(t=>e&&e.id===n?e.mode:"part"===t.kind&&"nodeId"in t&&t.nodeId===n?t:Pt(bt?.type)??U);const t=bt?.props.id,r=Zt.current;if(Zt.current=null,!t)return;const i=wt(t);Do(String(t),{scroll:!o(r,i??null,Se)})},[bt?.props.id,Do]);const Uo=Pn(e=>{Eo(n=>G(n,e)?n:e),kt({type:"setUi",ui:{rightSideBarVisible:!0}})},[kt]),Go=In(()=>{});Go.current=(e,n)=>{const t=e?ui(e.zone??Se)[e.index]?.props.id:null,o=null==t?null:String(t),r=null==bt?.props.id?null:String(bt.props.id);Eo(e=>G(e,n)?e:n),o!==r&&(Jo.current={id:o,mode:n},qt.select(e))};const Yo=Pn((e,n)=>Go.current(e,n),[]),Xo={kind:Lo.kind,mode:Lo,open:Uo,show:e=>Eo(e),reveal:()=>{eo||kt({type:"setUi",ui:{rightSideBarVisible:!0}})},select:Yo},Zo=Y(Xo,{data:St.data,selected:bt??null,zoneOf:e=>wt(e)?.zone,readOnly:Boolean(pt),select:e=>{Eo(U),qt.select({index:e})},replace:(e,n)=>qt.replaceComponent(Se,e,n),scrollTo:e=>Ei(e)},{device:lo,refreshes:So},{setView:yo,reveal:()=>{_t||kt({type:"setUi",ui:{leftSideBarVisible:!0}})}}),Ko=Zo.pinnedSource??!1,qo=Zo.resolveLeftView?Zo.resolveLeftView(go,ao):"media"===go&&ao?go:"sections",Qo=X(),{isLockedBlock:_o,duplicateBlocked:er,nestDepth:nr,newSectionNode:tr,canAddTo:or,blockIsOffered:rr}=Qo,ir=Z(),{labelAtLevel:lr,Icon:sr,useProducts:dr}=ir,cr=ir.rowName?(e,n,t)=>ir.rowName(e,n,t):void 0,ar=Pn(e=>{kt({type:"setUi",ui:{rightSideBarVisible:!0}}),c(e),Do(e,{scroll:!0})},[kt,Do]),{selectNode:pr,openPartId:ur}=k({mode:Lo,setMode:Eo,onOpenPart:ar}),[fr,hr]=Nn(null);pe(null!==fr,()=>hr(null));const mr=g(K()),gr=mr.collapsed,yr=mr.panelWidths,[Sr,kr]=Nn(()=>{if("undefined"==typeof window)/* @__PURE__ */return new Set;try{const e=window.localStorage.getItem(gr);return new Set(e?JSON.parse(e):[])}catch{/* @__PURE__ */
8
- return new Set}});On(()=>{try{window.localStorage.setItem(gr,JSON.stringify([...Sr]))}catch{}},[Sr]);const[vr,br]=Nn(()=>{if("undefined"==typeof window)return{...y};try{const e=window.localStorage.getItem(yr);if(!e)return{...y};const n=JSON.parse(e);return{left:S(Number(n.left)||y.left),right:S(Number(n.right)||y.right)}}catch{return{...y}}});On(()=>{const e=setTimeout(()=>{try{window.localStorage.setItem(yr,JSON.stringify(vr))}catch{}},300);return()=>clearTimeout(e)},[vr]);const wr=Pn((e,n)=>br(t=>{const o="function"==typeof n?n(t[e]):n;return t[e]===o?t:{...t,[e]:o}}),[]),xr=Pn(e=>wr("left",e),[wr]),zr=Pn(e=>wr("right",e),[wr]),Cr=e=>Sr.has(e),Ir=e=>kr(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),Br=In(!1),Nr=In(null);On(()=>{if(Br.current&&!No){const e=Nr.current,n=e&&e.isConnected&&!e.closest('[aria-hidden="true"]')?e:null;(n??bo.current?.querySelector(`button[aria-label="${CSS.escape(Lt.add.title)}"]`))?.focus(),Nr.current=null}Br.current=No},[No]),On(()=>{if(!No||!xo)return;const e=e=>{"Escape"===e.key&&Ui()};return xo.addEventListener("keydown",e),()=>xo.removeEventListener("keydown",e)},[No,xo]),pe(No,()=>Ui()),On(()=>{!_t&&No&&(Oo(!1),jo(null),Po.current=!1)},[_t]),On(()=>{if(!po)return $o.current&&kt({type:"setUi",ui:{leftSideBarVisible:!1}}),void($o.current=!1);No&&(Oo(!1),jo(null),$o.current=Po.current,Po.current=!1),_t||($o.current=!0,kt({type:"setUi",ui:{leftSideBarVisible:!0}}))},[po]),On(()=>{!_t&&po&&($o.current=!1,uo())},[_t]),On(()=>{if(!po||!xo)return;const e=e=>{"Escape"===e.key&&uo()};return xo.addEventListener("keydown",e),()=>xo.removeEventListener("keydown",e)},[po,xo]),pe(null!==po,()=>uo());const Or=q(),Pr=(e,n="success",t)=>{if(Or)return void(t?Or(e,"error"===n?"error":"info",t):Or(e,"error"===n?"error":"info"));const o={sound:!1,action:t?.action,onClose:t?.onClose};"error"===n?An.error(e,{...o,duration:t?.duration??3200}):An.success(e,{...o,duration:t?.duration??1900})},$r=In(null),[Mr,jr]=Nn(0),[Ar,Tr]=Nn(0),Lr=Q(),Er=In(null),Rr=e=>Math.max(0,e.clientHeight-(Er.current?.offsetHeight??0));On(()=>{const e=$r.current;if(!e)return;const n=()=>{jr(e.clientWidth),Tr(Rr(e))};n();const t=new ResizeObserver(n);return t.observe(e),Er.current&&t.observe(Er.current),()=>t.disconnect()},[]),$n(()=>{$r.current&&(jr($r.current.clientWidth),Tr(Rr($r.current)))},[vr,_t,eo]);const Vr=lo===ro?Mr>0?Mr:to[ro]:to[lo],Fr=Mr>0?Math.min(Mr/Vr,"shrink"===io?1:2):1,Hr=Vr*Fr,Wr=Mr>0&&Hr>Mr+1,Dr={width:Hr,height:Ar||"100%",flex:"none",position:"relative"},Jr={width:Vr,height:Ar?Ar/Fr:"100%",maxHeight:"none",transform:1!==Fr?`scale(${Fr})`:void 0,transformOrigin:"top left"},Ur=()=>kt({type:"setUi",ui:{leftSideBarVisible:!_t}}),Gr=()=>kt({type:"setUi",ui:{rightSideBarVisible:!eo}}),Yr=e=>{No&&(Oo(!1),jo(null),Po.current=!1,_t&&go===e)||po&&($o.current=!1,uo(),_t&&go===e)||(_t&&go===e?Ur():(yo(e),_t||kt({type:"setUi",ui:{leftSideBarVisible:!0}})))},Xr=()=>{$(fn,{accept:"image/*",title:Dt.mediaLibrary})},Zr=()=>{Eo(U),qt.select(null),p()},Kr=()=>{Eo($t??U),eo||kt({type:"setUi",ui:{rightSideBarVisible:!0}})},qr=St.data.content??[],Qr=()=>{const e=qr.findIndex(Mt),n=qr.findIndex(jt);return{floor:e>=0?e+1:0,cap:n>=0?n:qr.length}},_r=xt,ei=Qo.stripCopy,ni=e=>r(e,ei),ti=B(),oi=Pe({data:St.data,config:_r,readOnly:Boolean(pt),clipboard:ti,strip:ei?e=>ei(e):void 0,afterRemove:"none",stepBounds:(e,n)=>{if(e.parentId!==vn||e.slot!==bn)return{min:0,max:n-1};const{floor:t,cap:o}=Qr();return{min:t,max:o-1}},commit:(e,{select:n})=>{void 0!==n&&Eo(U);const t=void 0===n||"node"===n?.kind?n:null;qt.commitDocument(e,t)}}),ri=e=>{const n=zn(St.data,xt,e);if(!n)return!1;const t=wn(n.place),o=n.node,r=t===Se?ci(o):xi(o);return!!oi.remove(e)&&(Pr(Lt.deleted({name:r}),"success",{duration:8e3,action:{label:Lt.bar.undo,onClick:()=>{oi.restore(n.node,n.place)}}}),!0)},ii={...oi,remove:ri},li=e=>lr(e,"block",xt.components[e]?.label??e),si=Pn(e=>xt.components[e]?.defaultProps??{},[xt]),di=e=>lr(e,"section",li(e)),ci=e=>he({type:e.type,props:e.props??{}},di(e.type),cr),{nodeAddresses:ai,zoneItems:pi}=Bn(()=>{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>=ve)return;const s=/* @__PURE__ */new Map;for(const{child:e,zone:t}of be(xt,n))s.set(t,[...s.get(t)??[],e]);for(const[e,n]of s)t(n,e,i+1)})};return t(qr,Se,0),{nodeAddresses:e,zoneItems:n}},[qr,xt]),ui=Pn(e=>pi.get(e)??[],[pi]),fi=e=>{const n=ai.get(e);return n?ui(n.zone)[n.index]:void 0},hi=e=>le(Qo,xt,e),mi=e=>{if(!Qo.slotsOf||e===Se)return null;const n=e.lastIndexOf(":");if(n<=0)return null;const t=fi(e.slice(0,n));if(!t)return null;const o=hi(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}},gi=(()=>{if(!_(Lo))return null;const e=`${Lo.nodeId}:${Lo.slot}`;return mi(e)?.slot.panel===Lo.kind?e:null})(),yi=In(null);On(()=>{const e=yi.current;if(yi.current=null,!gi||!_(Lo))return;const n=Lo.nodeId;Do(n,{scroll:e!==gi}),kr(e=>{if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t})},[Lo]);const Si=(e,n,t)=>{const o=String(e.props.id);if(!n.panel)return void(e=>{const n=ai.get(e);n&&(n.zone===Se?Ri(n.index):ul(n.zone,n.index,e,fi(n.zone.slice(0,n.zone.lastIndexOf(":")))?.type??""))})(o);const r={kind:n.panel,nodeId:o,slot:n.slot},i=`${o}:${n.slot}`;t&&gi!==i&&(yi.current=i),Yo(null,r),eo||kt({type:"setUi",ui:{rightSideBarVisible:!0}}),Ei(o)},ki=(e,n,t)=>{const o=`${e}:${n}`;if(kr(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;gi!==o&&(yi.current=o);Yo(null,{kind:t,nodeId:e,slot:n})},vi=(e,n,t)=>{if(pt||!Qo.moveSlot)return;const o=fi(e),r=o?hi(o).filter(e=>e.rung):[],i=r[n];if(!i)return;const l={parentId:e,slot:_n,index:n},s=pn(l,{...l,index:Math.min(Math.max(t,0),r.length)});if(s===n)return;const d=Qo.moveSlot(e,n,s);"string"==typeof d&&ki(e,d,i.panel)},bi=dr(),wi=Bn(()=>{const e=/* @__PURE__ */new Map;for(const n of bi??[])e.set(n.slug,n.name);return e},[bi]),xi=e=>me(e,li,ir.plainText,e=>wi.get(e),ir.rowName),zi=(e,n)=>{const t=xt.components[e.type]?.fields,o=n===Se||jl(n)?"section":"block",r=n===Se&&(Mt(e)||jt(e)||Nt(e.type)),i="block"===o?ge(t):r?null:ye(t);return ir.renamePropOf?ir.renamePropOf(e,o,i):i},Ci=(e,n,t,o)=>{if(!(!pt&&fr?.zone===e&&fr.index===n))return;const r=(t,o)=>{hr(null),o&&((e,n,t)=>{const o=ui(e)[n];if(!o)return;const r=zi(o,e);r&&qt.replaceComponent(e,n,{...o,props:{...o.props,[r]:t.trim()}})})(e,n,t)};/* @__PURE__ */
9
- return Jn("input",{className:"es-tree-rename",defaultValue:o,autoFocus:!0,"aria-label":Lt.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)},Ii=e(ee(),Wt),Bi=Ii.scope({target:yn,siteId:tt,docId:Sn}),Ni=xt,Oi=(e,n)=>n===Se?di(e):li(e),Pi=(e,n,t)=>{const o=Ii.plan(Bi,t,Oi(t.type,e),Ni);o&&(o.changed&&qt.replaceComponent(e,n,{...t,props:{...o.props,id:t.props.id}}),Pr(o.message))},$i=N({nodesIn:ui,nodeAt:(e,n)=>ui(e)[n]??null,labelOf:(e,n)=>n===Se?di(e):li(e),renamePropOf:zi,beginRename:(e,n)=>hr({zone:e,index:n}),history:{hasPast:vt.hasPast,hasFuture:vt.hasFuture,back:()=>vt.back(),forward:()=>vt.forward()},openPageSettings:()=>{qt.select(null),Eo(U)},pageSettingsLabel:Lt.pageSettings,words:{menu:Ht,styleClipboard:Wt,screen:Lt.menu},readOnly:Boolean(pt),collapseAll:()=>kr(new Set(ui(Se).map(e=>String(e.props.id)))),onPasteRefused:e=>Pr(e?Lt.pasteRefused({name:e.label}):Lt.menu.clipboardRefused,"error"),canPasteAt:(e,n)=>Ll(e,n),menuRows:Zo.menuRows,isLocked:e=>_o(e.type),duplicateBlocked:e=>er(St.data,e),permits:e=>ke(xt,e.type),nodeOps:ii,isPinned:(e,n)=>n===Se&&(Mt(e)||jt(e)),sectionBand:Qr,locate:e=>ai.get(e)??null,rowNameOf:(e,n)=>n===Se?ci(e):xi(e),selectAt:(e,n,t,o)=>{e===Se?Ri(n):ul(e,n,t,o??"")},slotRung:e=>{const n=mi(e);return n?.slot.panel?{label:n.slot.label,select:()=>Si(n.node,n.slot,!1)}:null},style:{held:()=>j(Bi),canCopy:e=>Ii.rows(Ni,e).some(e=>!1!==e.counted),copy:(e,n)=>Ii.copy(Bi,e,Oi(e.type,n),Ni),paste:(e,n,t)=>Pi(e,n,t)},keys:ht?{target:xo,selected:()=>{const e=St.ui.itemSelector;return e?{zone:e.zone??Se,index:e.index}:null},held:()=>ti.get(),readOnly:Boolean(pt),onDone:({done:e,name:n})=>{"copied"===e&&Pr(Lt.copied({name:n}))}}:void 0},wo),Mi=In({copy:(e,n)=>{},paste:(e,n,t)=>{},at:()=>null,readOnly:!1});On(()=>{Mi.current={copy:(e,n)=>Ii.copy(Bi,e,Oi(e.type,n),Ni),paste:Pi,at:()=>{const e=St.ui.itemSelector;if(!e)return null;const n=e.zone??Se,t=ui(n)[e.index];return t?{zone:n,index:e.index,node:t}:null},readOnly:Boolean(pt)}});const ji=Pn(e=>{const n=A(e);if(!n)return;const t=Mi.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))},[]);On(()=>{if(!xo)return;const e=e=>ji(e);return xo.addEventListener("keydown",e),()=>xo.removeEventListener("keydown",e)},[ji,xo]),mn(wo,"keydown",ji);const Ai=qr.map(e=>e.props.id).join("|");On(()=>{const e=wo?.document??null,n=wo?.window??null;let t=0;const o=[],r=()=>{if(!e)return void To(e=>e.length?[]:e);const n=qr.findIndex(jt),t=n>=0?n:qr.length,o=n=>{const t=qr[n]?.props?.id;return null==t?null:e.querySelector(`[data-puck-component="${CSS.escape(String(t))}"]`)},r=e=>e?[...e.querySelectorAll(hn)].map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0):[],i=[];for(let e=qr.length>0&&!Mt(qr[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=Qn(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})}To(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()}},[wo,Ai,lo,Fr,_t,eo,bt?.props.id]);const Ti=wo?.document??null,Li=wo?.window??null;On(()=>{const e=vo.current;if(!e||!Ti||!Li)return;const n=[],t=()=>{const n=Ti.querySelector(`[data-puck-component="${CSS.escape(e.id)}"]`);if(!n)return!1;const t=n.getBoundingClientRect().top-e.offset;return Math.abs(t)>1&&Li.scrollTo({left:Li.scrollX,top:Li.scrollY+t,behavior:"instant"}),!0};return vo.current=null,t()&&n.push(setTimeout(t,150),setTimeout(t,450)),()=>n.forEach(clearTimeout)},[Ti,Li]);const Ei=e=>{Zo.holdCanvasOn?Zo.holdCanvasOn(e):c(e)},Ri=e=>{Eo(U),qt.select({index:e}),Zo.sectionPressed?.(qr[e]);const n=qr[e]?.props?.id;n&&Ei(n)},Vi=e=>{const{floor:n,cap:t}=Qr(),o=e=>Math.min(Math.max(n,e),t);if("number"==typeof e)return o(e);const r=bt&&Lo.kind!==$t?.kind?qr.findIndex(e=>e.props.id===bt.props.id):-1;return o(r>=0?r+1:t)},Fi=(e,n)=>{const{floor:t,cap:o}=Qr(),r=Math.min(Math.max(n,t),o),i=e<r?r-1:r;return i===e?{moved:!1,dest:e}:(qt.reorderComponent(Se,e,i),qt.select({index:i}),{moved:!0,dest:i})},Hi=(e,n,t,o)=>{Eo(U),qt.select(o?{index:o.index,zone:o.zone}:{index:e}),c(n),Pr(Lt.sectionAdded({name:t}))},Wi=(e,n)=>{const t=Vi(n),o=tr(e,{nodeDefaults:si,newNodeId:Ce,sectionLabel:di,blockIsOffered:rr}),r=o?qt.insertNode(Se,t,o):qt.insertSection(e,t);return Hi(t,r,di(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:c}of be(xt,e)){if(s.type===t&&(!o.at||n>o.at.depth)){const r=or(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:c,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},Di=e=>Ji(Se,e),Ji=(e,n)=>{Nr.current=document.activeElement??null,po&&(Po.current=$o.current,$o.current=!1,uo()),jo(null===n?null:{zone:e,index:n}),Oo(!0),_t||(Po.current=!0,kt({type:"setUi",ui:{leftSideBarVisible:!0}}))},Ui=()=>{Oo(!1),jo(null),Po.current&&kt({type:"setUi",ui:{leftSideBarVisible:!1}}),Po.current=!1},Gi=(e,n)=>ir.rowName?n?Mt(e)?ir.rowName(e,"section",Lt.header):jt(e)?ir.rowName(e,"section",Lt.footer):Nt(e.type)?ir.rowName(e,"section",li(e.type)):ci(e):xi(e):n?di(e.type):li(e.type),Yi=e=>n=>{e()},Xi=()=>Zo.editPinnedSource?.(),Zi=(e,n,t)=>{if(pt)return null;const o=ui(e)[n];return o&&!ke(xt,o.type).delete?null:/* @__PURE__ */Jn(Le,{kind:"delete",label:Lt.deleteNamed({name:t}),onClick:()=>((e,n)=>{const t=ui(e)[n]?.props?.id;null!=t&&ri(String(t))})(e,n),children:/* @__PURE__ */Jn(Fn,{size:15})})},Ki=e=>ir.rowPreview?.(e)||void 0,qi=e=>ir.rowMarks?.(e)??void 0,Qi=(e,n,t)=>ir.rowActions?.(e,n,t)??null,_i=(e,n,t,o)=>{if(pt)return null;const r=Boolean(t.props._hidden);/* @__PURE__ */
10
- return Jn(Le,{kind:"eye",label:r?Lt.showNamed({name:o}):Lt.hideNamed({name:o}),onClick:()=>nl(e,n,t),children:/* @__PURE__ */Jn(r?Hn:Wn,{size:14,strokeWidth:1.8,strokeLinecap:void 0,strokeLinejoin:void 0})})},el=e=>fs(Se,e),nl=(e,n,t)=>{qt.replaceComponent(e,n,{...t,props:{...t.props,_hidden:!t.props._hidden}})},tl=e=>we(xt,e),ol=e=>be(xt,e),rl=e=>Qo.slotsOf?hi(e).map(n=>({slot:n.slot,rung:n.rung?n:null,kids:xe(e,n.slot)})):[{slot:null,rung:null,kids:ol(e)}],il=e=>Qo.slotsOf?rl(e).flatMap(e=>e.kids):ol(e),ll=e=>Boolean(Qo.slotsOf)&&hi(e).some(e=>e.rung),sl=(e,n,t)=>null===t?void 0===n?or(e):or(e,n):or(e,n,t),dl=(e,n,t)=>{const o=ze(xt,e.type,n)&&(t||il(e).length>0||ll(e));return{collapsible:o,folded:o&&Cr(String(e.props.id))}},cl=(e,n,t)=>rl(e).flatMap(o=>{const r=o.rung?n+1:n,i=o.kids.flatMap(({child:e})=>dl(e,r,t(e.type)).collapsible?[String(e.props.id),...cl(e,r+1,t)]:[]);return o.rung?[`${e.props.id}:${o.rung.slot}`,...i]:i}),al=e=>il(e).length>0||ll(e)||Boolean(or(e.type)),pl=e=>Boolean(or(e)),ul=(e,n,t,o)=>{if(Eo(U),or(o)?.spec?.slider){const t=e.split(":")[0];a(t,n),qt.select({index:n,zone:e}),c(t)}else qt.select({index:n,zone:e}),Ei(t)},fl=(e,n,t,o,r)=>{const i=`${e}:${n}`;qt.insertComponent(i,t,o),or(r)?.spec?.slider?requestAnimationFrame(()=>{a(e,o),qt.select({index:o,zone:i})}):qt.select({index:o,zone:i})},hl=In(/* @__PURE__ */new Set);On(()=>{qr.forEach(e=>{const n=or(e.type)?.spec;if(!n)return;const t=e.props.id;if(hl.current.has(t))return;hl.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(si)).forEach((e,t)=>Xt.seedChild(o,t,n.childType,e))})},[qr,Xt,si]);const ml=In(/* @__PURE__ */new Set);On(()=>{qr.forEach((e,n)=>{const t=e.props.id;if(ml.current.has(t))return;const o=i(e,tl(e.type));ml.current.add(t),o&&Xt.replaceComponent(Se,n,{...e,props:o})})},[qr,Xt]),ne(Xt,xt);const gl=qr.findIndex(jt),yl=gl>=0?qr[gl]:null,Sl=At?qr.findIndex(Mt):-1,kl=Sl>=0?qr[Sl]:null,vl=zt.groupTab,bl=Bn(()=>vl?e=>Nt(e.type):void 0,[vl]),wl=Boolean(zt.groupBadge),xl=zt.groupBadge?/* @__PURE__ */Jn("span",{className:"es-tree-group-badge",children:/* @__PURE__ */Jn(jn,{tone:"info",size:"xs",children:zt.groupBadge})}):void 0,zl=qr.find(e=>e.type===It)??null,Cl=qr.find(e=>e.type===Bt)??null,Il=gl>=0?gl:qr.length,Bl=[];qr.forEach(e=>{jt(e)||(al(e)&&Bl.push(String(e.props.id)),Bl.push(...cl(e,1,pl)))}),yl&&(Bl.push(String(yl.props.id)),Bl.push(...cl(yl,1,pl)));const Nl=Bl.length>0&&Bl.every(e=>Sr.has(e)),Ol=e=>{const n=ir.blockRowName(e,li);return ir.rowName?ir.rowName(e,"block",n):n},Pl=(e,n,t,o)=>{const r=ui(e)[t];if(!r)return;const i={...xn(e),index:t},l={...xn(n),index:Math.min(Math.max(o,0),ui(n).length)},s=pn(i,l);if(e!==n||s!==t)try{oi.move(String(r.props.id),{...l,index:s})}catch(e){if(!(e instanceof Cn))throw e}},$l=e=>{const n=/* @__PURE__ */new Set,t=e=>{for(const{child:o,zone:r}of ol(e))n.add(r),t(o)};for(const t of tl(e.type))n.add(`${e.props.id}:${t}`);return t(e),n},Ml=e=>{let n=e.slice(0,e.indexOf(":"));for(let e=0;e<64;e++){const e=ai.get(n);if(!e)return null;if(e.zone===Se)return n;n=e.zone.slice(0,e.zone.indexOf(":"))}return null},jl=e=>{const n=e.slice(0,e.indexOf(":")),t=qr.find(e=>Nt(e.type)&&String(e.props.id)===n);return t&&Ot(n)===e?t:null},Al=(e,n)=>{const t=jl(e);return!t||(!zt.groupAccepts||zt.groupAccepts(t.type,n,ui(e).length))},Tl=(e,n,t)=>{if(e.rung){const t=fi(e.rung.nodeId),o=t?hi(t).filter(e=>e.rung).length:0;return n.parentId===e.rung.nodeId&&n.slot===_n&&n.index>=0&&n.index<=o}if(n.slot===_n)return!1;if(e.add)return Vl(e.add,n);const o=wn(n);if(Nt(e.type))return!1;const r=jl(o),i=jl(e.zone);if(r||i)return!(!r||!i)&&(!(r!==i&&!Al(o,e.type))&&(n.index>=0&&n.index<=ui(o).length));if(e.zone===Se||o===Se){if(e.zone!==o)return!1;const{floor:t,cap:r}=Qr();return n.index>=t&&n.index<=r}if(n.index<0||n.index>ui(o).length)return!1;if(e.zone===o)return!0;const l=yl&&!zt.lastIsOpen?String(yl.props.id):null;return(!l||Ml(e.zone)!==l&&Ml(o)!==l)&&((e,n,t,o)=>{if(e===n)return!0;const r=o??ui(e)[t];if(!r)return!1;const i=n.split(":")[0],l=ai.get(i),s=l?ui(l.zone)[l.index]:void 0;if(!s)return!1;if(!o&&$l(r).has(n))return!1;const d=or(s.type,nr(St?.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?.(ui(n),r))})(e.zone,o,e.index,t)},Ll=(e,n)=>{const t=wn(e.from),o=e.node;return t===wn(n)?Al(t,o.type):Tl({id:String(o.props?.id??""),zone:t,index:-1,type:o.type},n,o)},El=e=>{const n=e.slice(0,e.indexOf(":")),t=ai.get(n),o=t?ui(t.zone)[t.index]:void 0;if(!t||!o)return null;const r=or(o.type,nr(St?.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=r.choices??(r.spec?[{type:r.spec.childType,label:li(r.spec.childType)}]:[]),l=mi(e);return{parent:o,parentId:n,target:r,choices:i,parentName:l?l.slot.label:Gi(o,t.zone===Se)}},Rl=(e,n)=>{if("section"!==e.kind)return e;const t=wn(n);return t===Se||jl(t)?e:El(t)?.choices.some(n=>n.type===e.type)?{kind:"block",type:e.type}:e},Vl=(e,n)=>{const t=Rl(e,n),o=wn(n);if("block"!==t.kind){if(jl(o)){const e="section"===t.kind?t.type:t.template.node.type;return Al(o,e)&&n.index>=0&&n.index<=ui(o).length}if(o!==Se)return!1;const{floor:e,cap:r}=Qr();return n.index>=e&&n.index<=r}if(o===Se)return!1;const r=El(o);return!(!r||!r.choices.some(e=>e.type===t.type))&&!r.target.spec?.addBlocked?.(ui(o))},Fl=(e,n)=>{const t=Rl(e,n);if("block"!==t.kind&&jl(wn(n)))return void((e,n,t)=>{const o="section"===e.kind?e.type:"template"===e.kind?e.template.node.type:null;if(o&&Al(n,o)){if("section"===e.kind)qt.insertComponent(n,e.type,t);else{if("template"!==e.kind)return;qt.insertNode(n,t,ni(e.template.node))}Eo(U),qt.select({index:t,zone:n})}})(t,wn(n),n.index);if("section"===t.kind)return void Wi(t.type,n.index);if("template"===t.kind)return void((e,n,t)=>{const o=Vi(t),r=qt.insertNode(Se,o,n);Hi(o,r,e)})(t.template.name,ni(t.template.node),n.index);const o=wn(n),r=El(o);r&&(r.target.spec?fl(r.parentId,r.target.slot,t.type,n.index,r.parent.type):((e,n,t)=>{qt.insertComponent(e,n,t),Eo(U),qt.select({index:t,zone:e})})(o,t.type,n.index))},Hl=(e,n)=>{e.rung?vi(e.rung.nodeId,e.index,n.index):e.add?Fl(e.add,n):e.zone===Se?Fi(e.index,n.index):Pl(e.zone,wn(n),e.index,n.index)},[Wl]=Nn(()=>cn()),Dl=an({keyOf:e=>e.id,readOnly:Boolean(pt),session:Wl,canDrop:Tl,onDrop:Hl,onStep:(e,n)=>{e.rung?vi(e.rung.nodeId,e.index,n<0?e.index-1:e.index+2):e.zone===Se?((e,n)=>{const t=di(qr[e]?.type??""),o=Fi(e,n<0?e-1:e+2);if(!o.moved)return void Pr(n<0?Lt.sectionFirst({name:t}):Lt.sectionLast({name:t}));const{floor:r,cap:i}=Qr();Pr(Lt.sectionMoved({name:t,n:o.dest-r+1,total:i-r}))})(e.index,n):Pl(e.zone,e.zone,e.index,n<0?e.index-1:e.index+2)}}),Jl=Pn(e=>{const{floor:n,cap:t}=Qr(),o=[];for(const r of e.nodes){const e=wn(r.place),i=ui(e)[r.place.index];if(!i||String(i.props.id)!==r.id)continue;if(Mt(i)||jt(i)||_o(i.type))continue;if(Nt(i.type))continue;const l=Boolean(jl(e)),s=e===Se||l;e===Se&&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?di(i.type):xi(i),from:r.place})}const r=e.zones.flatMap(e=>{const n=wn(e.list);if(n===Se&&0===e.children.length)return[{...e,addLabel:Lt.addSection,addAlways:!0}];const t=El(n),o=t?.target.spec?.addLabel;return e.children.length>0||Boolean(t?.choices.length)||Boolean(jl(n))?[o?{...e,addLabel:o}:e]:[]}),i=r.flatMap(e=>{const n=wn(e.list),t=n===Se||jl(n)?null:El(n);return t?.choices.length?rn(e,t.target.spec?.addLabel??Lt.addBlockHere):[]});return{sources:o,zones:r,seams:i}},[St.data]),Ul=null==bt?.props.id?null:String(bt.props.id),Gl=Pn(e=>{const n=xt,t=e=>!e.item.rung&&null!==zn(St.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(Ul);return i||(r($e(St.data,n,o.item.id,Ul,bl))??o)},[St.data,xt,Ul,bl]),[Yl,Xl]=Nn(null);mn(wo,"mouseover",e=>{if(!vl)return;const n=gn(e.target),t=n?Xn(St.data,xt,n):null;t!==Yl&&Xl(t)}),mn(wo,"mouseout",e=>{vl&&!e.relatedTarget&&Xl(null)});const Zl=e=>Mt(e)||jt(e)||Nt(e.type),Kl=[];if(vl){const e=Ul?Xn(St.data,xt,Ul):null;for(const n of/* @__PURE__ */new Set([e,Yl])){const e=n?qr.find(e=>String(e.props.id)===n):void 0;if(!e||!Zl(e))continue;const t=vl(e);t&&Kl.push({id:String(e.props.id),label:t,below:Mt(e)||e.type===It})}}const ql=M(),Ql=In(null);On(()=>{const e=zt.changeNotice;if(!e)return;const n=JSON.stringify(qr.filter(Zl)),t=Ql.current;if(Ql.current={doc:Sn,bands:n,index:vt.index},!t||t.doc!==Sn||t.bands===n)return;vt.hasPast&&vt.index>=t.index&&!Yn.has(ql)&&(Yn.add(ql),Pr(e,"success",{action:{label:Lt.bar.undo,onClick:()=>vt.back()},duration:8e3}))},[qr]);const _l=e=>{Eo(U),qt.select(e.zone===Se?{index:e.index}:{index:e.index,zone:e.zone})},es=te(),ns=()=>({data:St.data,device:lo,ops:qt,inspector:Xo}),ts=es?.model,os=Bn(()=>ts?e=>ts(e,Jl(e),ns()):Jl,[ts,Jl,lo]),rs=es?.measure,is=rs?(e,n)=>rs(e,n,ns()):void 0,ls=es?.canDrop,ss=ls?(e,n)=>ls(e,n,Tl,ns()):Tl,ds=es?.drop,cs=ds?(e,n)=>ds(e,n,Hl,ns()):Hl,as=es?.pick,ps=as?e=>as(e,_l,ns()):_l,us=e=>{const n=wn(e),t=mi(n);t&&Si(t.node,t.slot,!1),Ji(n,e.index)},fs=(e,n)=>/* @__PURE__ */Jn(Ee,{...pt?{}:Dl.seam({place:{...xn(e),index:n}})},`seam:${e}:${n}`),hs={rowClick:Yi,isCollapsed:Cr,toggleCollapse:Ir},ms=e=>{const n=String(e.props.id),t=qr.findIndex(e=>String(e.props.id)===n),o=Ot(n),r=ui(o),i=Cr(n),l=li(e.type),s=ir.rowName?ir.rowName(e,"section",l):l,d=e=>fs(o,e);/* @__PURE__ */
11
- return Un(Gn,{children:[
12
- /* @__PURE__ */Jn(Me,{words:Et,icon:/* @__PURE__ */Jn(sr,{type:e.type,size:13}),name:s,preview:Ki(e),marks:qi(e),onSelect:()=>Ri(t),nameSlot:Ci(Se,t,n,s),selected:Vo===n,badge:xl,actions:Qi(e,Se,t)??void 0,rowProps:{"data-node-id":n,onClick:Yi(()=>Ri(t))},fold:{open:!i,label:"section",onToggle:()=>Ir(n)}}),!i&&/* @__PURE__ */Un(je,{children:[r.map((n,t)=>{const r=String(n.props.id),i=ci(n),l=al(n),s=l&&Cr(r),c=()=>ul(o,t,r,e.type),{rowProps:a,...p}=Dl.row({item:{id:r,zone:o,index:t,type:n.type},place:{...xn(o),index:t}},{"data-node-id":r,onClick:Yi(c)});/* @__PURE__ */
13
- return Un(Mn,{children:[d(t),
14
- /* @__PURE__ */Jn(Me,{words:Et,icon:/* @__PURE__ */Jn(sr,{type:n.type,size:13}),name:i,preview:Ki(n),marks:qi(n),onSelect:c,nameSlot:Ci(o,t,r,i),selected:Vo===r,hidden:Boolean(n.props._hidden),...p,fold:l?{open:!s,label:"section",onToggle:()=>Ir(r)}:void 0,actions:/* @__PURE__ */Un(Gn,{children:[Zi(o,t,i),Qi(n,o,t),_i(o,t,n,i)]}),rowProps:a}),l&&!s&&/* @__PURE__ */Jn(je,{children:Ss(n,2)})]},r)}),d(r.length)]})]})},gs=(e,n,t,o,r)=>{const i=String(e.props.id),l=`${i}:${n.slot}`,s=Dl.dragging,d=!Cr(l)&&s?.rung?.nodeId!==i,c={...xn(l),index:0},a=s&&!s.rung&&Tl(s,c)?c:void 0,p=()=>Si(e,n,!0),{rowProps:u,...f}=Dl.row({item:{id:`rung:${l}`,zone:`${i}:${_n}`,index:t,type:e.type,rung:{nodeId:i,slot:n.slot}},place:{parentId:i,slot:_n,index:t},into:a,canDrag:Boolean(Qo.moveSlot)&&!1!==n.movable&&o>1},{"data-slot-zone":l,onClick:Yi(p)}),h=pt?null:Qo.slotActions?.(e,n.slot);/* @__PURE__ */
15
- return Un(Mn,{children:[n.heading,
16
- /* @__PURE__ */Jn(Me,{words:Et,icon:n.glyph??null,name:n.label,badge:n.badge,onSelect:p,selected:gi===l,...f,dragHint:n.dragHint,fold:{open:d,label:n.label,onToggle:()=>Ir(l)},actions:h&&h.length>0?/* @__PURE__ */Jn(Gn,{children:h.map((t,o)=>/* @__PURE__ */Jn(Le,{kind:"delete"===t.kind?"delete":"plain",label:t.label,disabled:t.disabled,onClick:()=>((e,n,t)=>{if(pt||t.disabled)return;const o=String(e.props.id),r=e=>{"string"==typeof e&&ki(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__ */Jn(Fn,{size:15}):/* @__PURE__ */Jn(Dn,{size:15})},`${o}:${t.kind}`))}):void 0,rowProps:u}),d&&/* @__PURE__ */Jn(je,{children:r})]},l)},ys=(e,n)=>{const t=rl(e),o=t.filter(e=>e.rung).length;let r=0;/* @__PURE__ */
17
- return Jn(Gn,{children:t.map(t=>{const i=t.kids,l=t.rung?n+1:n,s=sl(e.type,void 0,t.slot),d=s?`${e.props.id}:${s.slot}`:null,c=null===t.slot?null:`${e.props.id}:${t.slot}`,a=(e,n)=>fs(e,n),p=/* @__PURE__ */Un(Gn,{children:[i.map(({child:n,zone:t,index:o})=>{const r=Vo===String(n.props.id),{collapsible:i,folded:s}=dl(n,l,pl(n.type)),d=String(n.props.id),c=Ol(n),p=()=>ul(t,o,d,e.type),{rowProps:u,...f}=Dl.row({item:{id:d,zone:t,index:o,type:n.type},place:{...xn(t),index:o}},{"data-node-id":d,onClick:Yi(p)});/* @__PURE__ */
18
- return Un(Mn,{children:[0===o&&a(t,0),
19
- /* @__PURE__ */Jn(Me,{words:Et,icon:/* @__PURE__ */Jn(sr,{type:n.type,size:13}),name:c,preview:Ki(n),marks:qi(n),onSelect:p,nameSlot:Ci(t,o,d,c),selected:r,hidden:Boolean(n.props._hidden),...f,fold:i?{open:!s,label:"group",onToggle:()=>Ir(d)}:void 0,actions:/* @__PURE__ */Un(Gn,{children:[Zi(t,o,c),Qi(n,t,o),_i(t,o,n,c)]}),rowProps:u}),i&&!s&&/* @__PURE__ */Jn(je,{children:ys(n,l+1)}),a(t,o+1)]},String(n.props.id??`${t}-${o}`))}),null===c?d&&!i.some(e=>e.zone===d)?a(d,0):null:0!==i.length||!t.rung&&d!==c?null:a(c,0)]});return t.rung?gs(e,t.rung,r++,o,p):/* @__PURE__ */Jn(Mn,{children:p},t.slot??"")})})},Ss=(e,n)=>{const t=nr(St?.data,e.type,String(e.props.id)),o=rl(e),r=o.filter(e=>e.rung).length;let i=0;/* @__PURE__ */
20
- return Jn(Gn,{children:o.map(o=>{const l=o.kids,s=o.rung?n+1:n,d=sl(e.type,t,o.slot),c=d?.spec??null,a=c&&Array.isArray(e.props[c.slot])?e.props[c.slot]:[],p=d&&d.choices?{slot:d.slot,choices:d.choices}:null,u=String(e.props.id),f=c&&!c.fixed?`${u}:${c.slot}`:null,h=p?`${u}:${p.slot}`:null,m=(e,n)=>fs(e,n),g=null===o.slot?null:`${u}:${o.slot}`,y=Boolean(c&&!c.fixed&&(null===g||g===f)),S=/* @__PURE__ */Un(Gn,{children:[l.map(({child:n,zone:t,index:o})=>{const r=Vo===String(n.props.id),i=xi(n),l=String(n.props.id),{collapsible:d,folded:c}=dl(n,s,pl(n.type)),a=tl(n.type),p=1===a.length?`${l}:${a[0]}`:null,u=p?{...xn(p),index:ui(p).length}:void 0,f=Dl.dragging,h=u&&f&&Tl(f,u)?u:void 0,g=()=>ul(t,o,l,e.type),{rowProps:y,...S}=Dl.row({item:{id:l,zone:t,index:o,type:n.type},place:{...xn(t),index:o},into:h,canDrag:!_o(n.type)},{"data-node-id":l,onClick:Yi(g)});/* @__PURE__ */
21
- return Un(Mn,{children:[0===o&&m(t,0),
22
- /* @__PURE__ */Jn(Me,{words:Et,icon:/* @__PURE__ */Jn(sr,{type:n.type,size:13}),name:i,preview:Ki(n),marks:qi(n),onSelect:g,nameSlot:Ci(t,o,l,i),selected:r,hidden:Boolean(n.props._hidden),...S,fold:d?{open:!c,label:"group",onToggle:()=>Ir(l)}:void 0,actions:_o(n.type)?Qi(n,t,o)??void 0:/* @__PURE__ */Un(Gn,{children:[Zi(t,o,i),Qi(n,t,o),_i(t,o,n,i)]}),rowProps:y}),d&&!c&&/* @__PURE__ */Jn(je,{children:Ss(n,s+1)}),m(t,o+1)]},String(n.props.id??`${t}-${o}`))}),y&&c&&
23
- /* @__PURE__ */Jn(w,{small:!0,label:c.addLabel,blocked:c.addBlocked?.(a)??null,onAdd:()=>fl(e.props.id,c.slot,c.childType,a.length,e.type)}),null===g?h&&!l.some(e=>e.zone===h)?m(h,0):null:0!==l.length||(o.rung?y:g!==h)?null:m(g,0)]});return o.rung?gs(e,o.rung,i++,r,S):/* @__PURE__ */Jn(Mn,{children:S},o.slot??"")})})},ks=No||null!==po,vs=e=>"panel"in e?{id:e.id,label:e.label,icon:e.icon,active:_t&&!ks&&qo===e.id,onSelect:()=>Yr(e.id)}:e,bs=[...(Zo.railLead??[]).map(vs),{id:"sections",label:Lt.layers,icon:/* @__PURE__ */Jn(Ve,{}),active:_t&&!ks&&"sections"===qo,onSelect:()=>Yr("sections")},...(Zo.railTrail??[]).map(vs)];ao?bs.push({id:"media",label:Lt.railMedia,icon:/* @__PURE__ */Jn(Fe,{}),active:_t&&!No&&(null!==po||"media"===qo),onSelect:()=>Yr("media")}):mt&&bs.push({id:"media",label:Lt.railMedia,icon:/* @__PURE__ */Jn(Fe,{}),onSelect:Xr});const ws=[...Zo.railLead??[],...Zo.railTrail??[]].find(e=>"panel"in e&&e.id===qo),xs=Boolean(Tt?.foldable)&&!Ko,zs=Tt?.label??(gt?Lt.pageSections:Lt.templateSections),Cs=xs&&Cr(et),Is=/* @__PURE__ */Un(Gn,{children:[qr.map((e,n)=>{if(Mt(e)||jt(e)||Nt(e.type))return null;const t=Vo===String(e.props.id),o=Boolean(e.props._hidden);ol(e);const r=String(e.props.id),i=Zo.hasOwnRows?.(e)??!1,l=al(e)||i,s=l&&Cr(r),d=tl(e.type),c=1===d.length?`${r}:${d[0]}`:null,a=c?{...xn(c),index:ui(c).length}:void 0,p=Dl.dragging,u=a&&p&&Tl(p,a)?a:void 0,{rowProps:f,...h}=Dl.row({item:{id:r,zone:Se,index:n,type:e.type},place:{...xn(Se),index:n},into:u},{"data-node-id":r,onClick:Yi(()=>Ri(n))});/* @__PURE__ */
24
- return Un(Mn,{children:[n>0&&el(n),
25
- /* @__PURE__ */Jn(Me,{words:Et,icon:/* @__PURE__ */Jn(sr,{type:e.type,size:13}),name:ci(e),preview:Ki(e),marks:qi(e),onSelect:()=>Ri(n),nameSlot:Ci(Se,n,r,ci(e)),selected:t,hidden:o,...h,fold:l?{open:!s,label:"section",onToggle:()=>Ir(r)}:void 0,actions:/* @__PURE__ */Un(Gn,{children:[Zi(Se,n,ci(e)),Qi(e,Se,n),_i(Se,n,e,ci(e))]}),rowProps:f}),al(e)&&!s&&/* @__PURE__ */Un(je,{children:[Ss(e,1),Zo.partRows?.(e,hs)]}),i&&!s&&/* @__PURE__ */Jn(je,{children:Zo.ownRows?.(e,n,hs)})]},String(e.props.id??n))}),!Ko&&Il>0&&el(Il)]}),Bs=(e,n,t)=>{const o=String(e.props.id),r=il(e).length>0||ll(e)||Boolean(or(e.type)),i=r&&Cr(o),l="header"===t?Lt.header:Lt.footer,s=ir.rowName?ir.rowName(e,"section",l):l;/* @__PURE__ */
26
- return Un(Gn,{children:[
27
- /* @__PURE__ */Jn(Me,{words:Et,icon:/* @__PURE__ */Jn(sr,{type:t,size:13}),name:s,preview:Ki(e),marks:qi(e),badge:xl,onSelect:()=>Ri(n),nameSlot:Ci(Se,n,o,s),selected:Vo===String(e.props.id),fold:r?{open:!i,label:"section",onToggle:()=>Ir(o)}:void 0,actions:Qi(e,Se,n)??void 0,rowProps:{"data-node-id":o,onClick:Yi(()=>Ri(n))}}),r&&!i&&/* @__PURE__ */Jn(je,{children:ys(e,1)})]})};return(Zo.wrap??(e=>e))(
28
- /* @__PURE__ */Jn(oe,{target:wo,children:/* @__PURE__ */Un("div",{ref:bo,className:"sf-editor es-editor",style:qe(vr),onContextMenu:$i.onEditorContextMenu,...m(fn),children:[
29
- /* @__PURE__ */Un(He,{children:[
30
- /* @__PURE__ */Jn(We,{items:bs,ariaLabel:Lt.bar.views}),
31
- /* @__PURE__ */Un(De,{children:[
32
- /* @__PURE__ */Jn(Je,{label:Lt.bar.undo,disabled:Boolean(pt)||!vt.hasPast,onClick:()=>vt.back(),children:/* @__PURE__ */Jn(Ln,{})}),
33
- /* @__PURE__ */Jn(Je,{label:Lt.bar.redo,disabled:Boolean(pt)||!vt.hasFuture,onClick:()=>vt.forward(),children:/* @__PURE__ */Jn(En,{})}),
34
- /* @__PURE__ */Jn(Ue,{}),
35
- /* @__PURE__ */Jn(Ge,{devices:no,value:lo,onChange:so}),
36
- /* @__PURE__ */Jn(Je,{label:Lt.bar.refresh,tip:Lt.bar.refreshTip,onClick:()=>{vo.current=(()=>{const e=wo?.document;if(!e)return null;const n=qr.findIndex(jt),t=n>=0?n:qr.length;let o=null;for(let n=0;n<t;n++){const t=qr[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??qr[0]?.props?.id;null!=e&&(o={id:String(e),offset:0})}return o})(),ko(e=>e+1)},children:/* @__PURE__ */Jn(Rn,{})})]}),
37
- /* @__PURE__ */Un(De,{kind:"right",style:{minWidth:300},children:[
38
- /* @__PURE__ */Jn(l,{input:Io,words:Lt.saveStatus}),Zo.barLead?.(),Zo.barTrail?.(),Zo.mainAction||!Zo.barMain?/* @__PURE__ */Jn(s,{input:Io,action:Zo.mainAction??{label:Lt.done,onPress:()=>{ot(St.data)}},readOnly:Boolean(pt),saveSwitch:ft,onToggleAutoSave:st,onSaveNow:Bo,bar:Lt.bar,words:Lt.saveStatus}):Zo.barMain()]})]}),
39
- /* @__PURE__ */Jn(O,{}),
40
- /* @__PURE__ */Un("div",{className:"sf-body",children:[_t?/* @__PURE__ */Un(Gn,{children:[
41
- /* @__PURE__ */Jn("aside",{className:"es-sidepanel es-sidepanel--left sf-panel sf-panel--left","aria-label":Lt.leftPanel,children:No?/* @__PURE__ */Jn(x,{at:Mo?{label:(e=>{const n=jl(e.zone);if(n)return Lt.add.addingTo({name:ir.rowName?Gi(n,!0):li(n.type)});if(e.zone===Se){const n=qr[e.index];return n&&!jt(n)?Lt.add.addingBefore({name:Gi(n,!0)}):Lt.add.addingAtEnd}const t=El(e.zone);return t?Lt.add.addingTo({name:t.parentName}):Lt.add.addingHere})(Mo),onClear:()=>jo(null)}:void 0,placeBlocks:Mo&&Mo.zone!==Se?El(Mo.zone)?.choices:void 0,canTake:Mo?e=>{if(!Mo)return null;const n={...xn(Mo.zone),index:Mo.index};if(Vl(e,n))return null;const t=jl(Mo.zone);if(t)return Lt.add.notInside({name:Gi(t,!0)});if(Mo.zone===Se)return Lt.add.onlySections;const o=El(Mo.zone);return o?Lt.add.notInside({name:o.parentName}):Lt.add.onlySections}:void 0,onPick:Mo?e=>{if(!Mo)return;const n={...xn(Mo.zone),index:Mo.index};Vl(e,n)&&(Fl(e,n),Ui())}:void 0,itemFor:e=>({id:`new:${e.kind}:${"template"===e.kind?e.template.id:e.type}`,zone:"",index:-1,type:"template"===e.kind?e.template.node.type:e.type,add:e}),session:Wl,siteWide:Zo.addPanelRow?.(Ui),onClose:Ui,onHide:Ur,readOnly:Boolean(pt)}):po&&co?
42
- /* @__PURE__ */Jn(I,{panel:co,pick:po,onHide:Ur}):ws?ws.panel({onHide:Ur,notify:Pr}):"media"===qo&&co?/* @__PURE__ */Jn(I,{panel:co,pick:null,onHide:Ur}):/* @__PURE__ */Un(Gn,{children:[
43
- /* @__PURE__ */Jn(z,{icon:/* @__PURE__ */Jn(Ve,{}),title:Lt.layers,context:Jt,actions:/* @__PURE__ */Un(Gn,{children:[!pt&&/* @__PURE__ */Jn(Ye,{label:Lt.add.title,onClick:()=>Di(null),children:/* @__PURE__ */Jn(Vn,{size:15})}),
44
- /* @__PURE__ */Jn(Ye,{label:Nl?Lt.expandAll:Lt.collapseAll,title:0===Bl.length?Lt.nothingToFold:void 0,disabled:0===Bl.length,onClick:()=>kr(e=>{const n=new Set(Bl);return Nl?new Set([...e].filter(e=>!n.has(e))):/* @__PURE__ */new Set([...e,...Bl])}),children:/* @__PURE__ */Jn(Kn,{expand:Nl})})]}),onHide:Ur}),
45
- /* @__PURE__ */Un(Ae,{className:"sf-tree sf-scroll",words:Et,children:[
46
- /* @__PURE__ */Jn(Me,{words:Et,icon:/* @__PURE__ */Jn(sr,{type:"page",size:13}),name:Lt.pageSettings,onSelect:Zr,selected:!bt&&Ro,rowProps:{onClick:Yi(Zr)}}),zl&&/* @__PURE__ */Un(Gn,{children:[!wl&&/* @__PURE__ */Jn(Te,{children:Lt.header}),ms(zl)]}),!Ko&&yt&&!(wl&&zl)&&/* @__PURE__ */Un(Gn,{children:[!wl&&/* @__PURE__ */Jn(Te,{children:Lt.header}),!At&&/* @__PURE__ */Jn(Me,{words:Et,icon:/* @__PURE__ */Jn(sr,{type:"header",size:13}),name:Lt.header,badge:xl,onSelect:Kr,selected:Lo.kind===$t?.kind,rowProps:{onClick:Yi(Kr)}})]}),!Ko&&kl&&!(wl&&zl)&&Bs(kl,Sl,"header"),!Ko&&!xs&&/* @__PURE__ */Jn(Te,{children:zs}),xs?/* @__PURE__ */Un(Gn,{children:[
47
- /* @__PURE__ */Jn(Me,{words:Et,icon:null,name:zs,fold:{open:!Cs,label:zs,onToggle:()=>Ir(et)}}),!Cs&&/* @__PURE__ */Jn(je,{children:Is})]}):Is,yt&&!wl&&/* @__PURE__ */Jn(Te,{children:Lt.footer}),yl&&!(wl&&Cl)&&Bs(yl,gl,"footer"),!Ko&&!yl&&yt&&!wl&&/* @__PURE__ */Jn(Me,{words:Et,icon:/* @__PURE__ */Jn(sr,{type:"footer",size:13}),name:Lt.footer,onSelect:Xi,rowProps:{onClick:Yi(Xi),title:Lt.editFooter}}),Cl&&ms(Cl),Zo.treeFoot?.()]})]})}),
48
- /* @__PURE__ */Jn(Xe,{side:"left",width:vr.left,min:Ke,max:Ze,defaultWidth:y.left,label:Lt.resizeLeftPanel,onResize:xr})]}):/* @__PURE__ */Jn(C,{side:"left",onShow:Ur}),
49
- /* @__PURE__ */Un("div",{ref:$r,className:"sf-center sf-scroll","data-sf-canvas-head":Lr?"":void 0,style:{overflowX:Wr?"auto":"hidden",overflowY:"hidden"},children:[Lr&&/* @__PURE__ */Jn("div",{ref:Er,className:"sf-canvas-head",children:/* @__PURE__ */Jn(Lr,{device:lo})}),
50
- /* @__PURE__ */Un("div",{className:"sf-frame-scaler",style:Dr,children:[
51
- /* @__PURE__ */Jn("div",{className:"sf-frame "+(lo===ro?"":`sf-frame--${lo}`),style:Jr,children:/* @__PURE__ */Un("div",{className:"sf-preview-host",children:[
52
- /* @__PURE__ */Jn(Ne.Provider,{value:bl,children:/* @__PURE__ */Jn(Ut,{},So)}),
53
- /* @__PURE__ */Jn(ln,{canvas:wo,session:Wl,model:os,measure:is,canDrop:ss,onDrop:cs,choose:Gl,onPick:ps,onZoneAdd:us,onSeamAdd:us,zoneAddLabel:Lt.canvasAddBlock,words:Rt.canvas,readOnly:Boolean(pt),revision:St.data}),Ao.length>0&&/* @__PURE__ */Jn("div",{className:"sf-preview-gaps",children:Ao.map(e=>
54
- /* @__PURE__ */Jn(sn,{index:e.index,label:Lt.addSectionHere,onInsert:()=>Di(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))})]})}),vl?/* @__PURE__ */Jn(Zn,{canvas:wo,tabs:Kl,onSelect:e=>{const n=qr.findIndex(n=>String(n.props.id)===e);n>=0&&Ri(n)}}):null]})]}),eo?/* @__PURE__ */Un(Gn,{children:[
55
- /* @__PURE__ */Jn(b,{value:{selectChild:ul,addChild:fl,childRowName:xi,blockRowName:Ol},children:/* @__PURE__ */Jn(Gt,{mode:Lo,onOpenWebsiteSettings:Zo.openSettings??(()=>{}),onOpenSiteStyles:Zo.openStyles,onSelectNode:pr,onNotify:Pr,onHidePanel:Gr,nodeActions:bt?ke(xt,bt.type):nt})}),
56
- /* @__PURE__ */Jn(Xe,{side:"right",width:vr.right,min:Ke,max:Ze,defaultWidth:y.right,label:Lt.resizeSettingsPanel,onResize:zr})]}):
57
- /* @__PURE__ */Jn(C,{side:"right",onShow:Gr})]}),$i.menu]})}))}export{tt as ScreenChrome};