efficient-web-builder 59.3.0 → 61.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 (65) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/editor/lib/animation/hover-fields.js +1 -1
  3. package/dist/editor/lib/document/blocks/general/Footprint/fields.js +1 -1
  4. package/dist/editor/lib/document/blocks/general/ListSearch/fields.js +1 -1
  5. package/dist/editor/lib/document/canvas-typing.js +1 -1
  6. package/dist/editor/lib/document/card-display-chips.d.ts +4 -2
  7. package/dist/editor/lib/document/card-display-chips.js +1 -1
  8. package/dist/editor/lib/document/controls.js +1 -1
  9. package/dist/editor/lib/document/field-groups.js +1 -1
  10. package/dist/format/lib/animation/hover.d.ts +23 -1
  11. package/dist/format/lib/animation/hover.js +1 -1
  12. package/dist/format/lib/content/card-template.d.ts +9 -1
  13. package/dist/format/lib/content/card-template.js +1 -1
  14. package/dist/format/lib/content/footprint.d.ts +2 -0
  15. package/dist/format/lib/content/footprint.js +1 -1
  16. package/dist/format/lib/content/hover-media.d.ts +30 -0
  17. package/dist/format/lib/content/hover-media.js +1 -0
  18. package/dist/format/lib/content/ink.d.ts +3 -0
  19. package/dist/format/lib/content/ink.js +1 -1
  20. package/dist/format/lib/content/list-position.d.ts +3 -0
  21. package/dist/format/lib/content/list-position.js +1 -0
  22. package/dist/format/lib/content/list-query.d.ts +2 -0
  23. package/dist/format/lib/content/list-query.js +1 -1
  24. package/dist/format/lib/document/blocks/general/Footprint/card-seed.d.ts +3 -0
  25. package/dist/format/lib/document/blocks/general/Footprint/card-seed.js +1 -1
  26. package/dist/format/lib/document/blocks/general/text-part-shapes.json +7 -0
  27. package/dist/format/lib/document/card-content-switch.js +1 -1
  28. package/dist/format/lib/document/panel-only.d.ts +2 -0
  29. package/dist/format/lib/document/panel-only.js +1 -0
  30. package/dist/format/lib/document/seed-shape.d.ts +2 -0
  31. package/dist/format/lib/document/seed-shape.js +1 -0
  32. package/dist/format/lib/editor-words-catalogue.d.ts +14 -0
  33. package/dist/format/lib/editor-words-catalogue.js +4 -4
  34. package/dist/format/lib/editor-words-kept.js +1 -1
  35. package/dist/format/lib/source-rules/published-mounts.d.ts +11 -1
  36. package/dist/format/lib/source-rules/published-mounts.js +57 -9
  37. package/dist/format/lib/source-rules/support/panel-select-cascade.js +1 -2
  38. package/dist/format/lib/source-rules/support/ts-program.d.ts +4 -0
  39. package/dist/format/lib/source-rules/support/ts-program.js +2 -0
  40. package/dist/format/lib/theme.d.ts +1 -0
  41. package/dist/format/lib/theme.js +3 -3
  42. package/dist/render/components/CardRowContext.d.ts +5 -2
  43. package/dist/render/components/CardRowContext.js +1 -1
  44. package/dist/render/components/DealerFinder.js +1 -1
  45. package/dist/render/components/Flex.js +1 -1
  46. package/dist/render/components/Footprint.js +1 -1
  47. package/dist/render/components/HeroArrows.d.ts +6 -3
  48. package/dist/render/components/HeroArrows.js +1 -1
  49. package/dist/render/components/HoverMediaLayer.d.ts +9 -0
  50. package/dist/render/components/HoverMediaLayer.js +1 -0
  51. package/dist/render/components/ListSearchBox.d.ts +2 -1
  52. package/dist/render/components/ListSearchBox.js +1 -1
  53. package/dist/render/components/SideListLayout.d.ts +14 -0
  54. package/dist/render/components/SideListLayout.js +1 -0
  55. package/dist/render/lib/dealer-source.d.ts +3 -2
  56. package/dist/render/lib/dealer-source.js +1 -1
  57. package/dist/render/lib/document/blocks/general/CardList/render.js +1 -1
  58. package/dist/render/lib/document/blocks/general/ImageBlock/render.js +1 -1
  59. package/dist/render/lib/document/blocks/general/ListSearch/render.js +1 -1
  60. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +1 -0
  61. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
  62. package/dist/render/lib/document/blocks/general/section-to-box-rows-proof.js +1 -1
  63. package/dist/render/lib/document/text-parts.d.ts +1 -0
  64. package/dist/render/lib/document/text-parts.js +1 -1
  65. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,50 @@
1
1
  # Changelog
2
2
 
3
+ ## 61.0.0 - 2026-11-09
4
+
5
+ From main at `aba028f3`: #647, #648. A MAJOR: #648 has `!` (the peers narrow). No export, stored key or value moves.
6
+
7
+ **BREAKING (#648):** the peers move to `efficient-easel` `^30.0.0` (was `^29.0.0`) and `efficient-shell` `^12.18.0` (was `^12.17.0`). Peer and dev.
8
+
9
+ **For hosts:**
10
+ - Install easel 30.0.0 and shell 12.18.0 or later with this release. easel 30 removes `tileColumns` and `EFFECT_TILES_NARROW_PX` (0 users).
11
+ - **HOLD (#639, from 60.0.0): the storefront must NOT take 61.0.0 alone.** It takes it together with the storefront-blocks release that mounts `HoverMediaLayer` (eff-erp/efficient-storefront-blocks#437).
12
+ - storefront-blocks takes 61.0.0 in its next minor.
13
+
14
+ ### Changed
15
+
16
+ - **Peers `efficient-easel` `^30.0.0` and `efficient-shell` `^12.18.0`** (#648).
17
+ - **The published editor-words list now holds the keys of npm 60.0.0** (#647): 1469 keys, 14 added, 0 removed. Test data only.
18
+
19
+ ## 60.0.0 - 2026-11-08
20
+
21
+ From main at `c1e8dcab`: #634, #636, #638, #592, #637, #639, #641. A MAJOR: #634 has `!` (the `published-mounts` rule's input changes). The peers stay `efficient-easel` `^29.0.0` and `efficient-shell` `^12.17.0`. No stored key or value moves.
22
+
23
+ **BREAKING (#634):** a host that runs `mountProblems` or `publishedMounts` must hand in `ts` (the TypeScript compiler), name `inputs`, list `readers` as `{ name, from }`, and give `callFrom` (the import the target call is bound to). No host runs these today.
24
+
25
+ **For hosts:**
26
+ - **HOLD (#639): the storefront must NOT take 60.0.0 alone.** The card Hover "Show next image" draws nothing until storefront-blocks mounts `HoverMediaLayer` (eff-erp/efficient-storefront-blocks#437, due 2026-11-22), and a stored `nextImage` also stops the Rotate default. The storefront takes 60.0.0 together with that blocks release.
27
+ - storefront-blocks: `surfaceAccent` is now exported here (#641). Blocks deletes its own copy (#642, due 2026-11-22).
28
+ - storefront-blocks: the Events and Compatible Tyres panels get the Card image row's corner icon at their bump (#592).
29
+ - `locationsSearchShow` is `@deprecated` (#637). Delete it in a later major.
30
+
31
+ ### Added
32
+
33
+ - **A card Hover can show the next photo** (#639): Type, Group and Covers rows; `HoverMediaLayer`; the media zone word list is exported. The old card Hover hint stays as a deprecated phrase.
34
+ - **A Box filled from its card row picks readable words** (#638): `fillIsDark`, `rowFillInkStyle`, `ON_LIGHT_INK`, `ON_LIGHT_INK_STYLE` and `BOX_HIGHLIGHT_OVER_ROW_INK_CLASS`. 0 of 350 stored Boxes change.
35
+ - **Footprint offices in a typed side list with search** (#637), and a published editor-words guard with its fixture.
36
+ - **`surfaceAccent` export** (#641) from `render/lib/document/blocks/general/section-to-box-row-parts`.
37
+ - **`rowFieldSpec` export** (#636).
38
+
39
+ ### Fixed
40
+
41
+ - **A Card list copy picture keeps its alt and hover photo** (#636).
42
+ - **The Card image row shows the corner icon** (#592), with `CornerIcon` from easel.
43
+
44
+ ### Changed
45
+
46
+ - **The `published-mounts` rule reads the TypeScript syntax tree** (#634): the target call is bound by its import (`callFrom`), with one compiler helper. A fake or renamed target call now fails.
47
+
3
48
  ## 59.3.0 - 2026-11-08
4
49
 
5
50
  From main at `3d25076e`: #624, #625, #627, #629, #630, #632, #628. A minor: no `!` in any title, no declared export is removed (0 removed in `dist/**/*.d.ts` against npm 59.2.0), the peers stay `efficient-easel` `^29.0.0` and `efficient-shell` `^12.17.0`. No stored key or value moves. The history holds `8d9cdc24` (`feat(view)!:`), and `662d2753` reverts it before #628 merged, so the release is not a major.
@@ -1 +1 @@
1
- import{jsx as s}from"react/jsx-runtime";import{AccentIcon as U,ContrastIcon as F,NoSymbolIcon as I,HoverLiftIcon as X,HoverNextImageIcon as L,HoverRotateIcon as W,HoverZoomIcon as O,OpacityIcon as G}from"efficient-easel/icons";import{customize as z,describedAs as v,group as M}from"efficient-easel/screen/lib/document/box-fields";import{effectTiles as w}from"efficient-easel/screen/lib/document/effect-tiles";import{deviceField as r}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as Y,noControlField as j}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{BOX_DARKEN as p}from"../../../format/lib/content/box-background.js";import{cardTemplateField as Z,cardTemplateOwner as q,namedRowField as J}from"../../../format/lib/content/card-template.js";import{angleRow as Q,slider as T}from"../document/box-fields.js";import{say as d}from"../../../format/lib/editor-words.js";import{withShowWhen as a}from"../../../format/lib/document/show-when-attach.js";import{animationDelayField as N,animationDurationField as x,showsWhatRuns as _}from"./AnimationDurationRow.js";import{BOX_HIGHLIGHT as V,BOX_HOVER_KINDS as k,BOX_HOVER_LABELS as C,CARD_HOVER_KEYS as i,CARD_HOVER_KINDS as $,CARD_HOVER_TURN as oo,HOVER_KEY as l,HOVER_KIND_LABELS as S,NEXT_PICTURE_BLOCKS as eo,NEXT_PICTURE_HOVER_KINDS as to,OLD_SPIN_KEY as no,PART_HOVER_KINDS as D,PICTURE_HOVER_KEYS as K,PICTURE_HOVER_KINDS as ro,PICTURE_HOVER_ZOOM as u,cardHoverAngleOf as so,cardHoverKindOf as io,cardRotatesRule as ao,HOVER_GROUP_KEY as m,pictureHoverKindOf as co,pictureHoverMovesRule as po,pictureHoverRunsRule as b}from"../../../format/lib/animation/hover.js";const f=o=>r("desktop",M("Hover",{dot:o})),P=()=>r("desktop",z()),lo="What this does when a shopper points at it, or taps it on a phone.",uo="What this picture does when a shopper points at it. Black and white shows it in grey until then. A phone shows its colour.",ho="What this picture does when a shopper points at the card. Show next image fades to the card's next photo. Black and white shows it in grey until then. A phone shows the first photo in colour.",mo="What each card does when a shopper points at it, or taps it on a phone. Rotate turns the wheel picture.",fo={none:()=>s(I,{}),nextImage:()=>s(L,{}),rotate:()=>s(W,{}),zoom:()=>s(O,{}),lift:()=>s(X,{}),mono:()=>s(F,{})};function H(o,e){const n=w({label:d("Hover effect"),options:o.map(t=>({value:t,label:d(S[t]),picture:fo[t]()})),fallback:e});return v(n,{type:"select",label:"Hover effect",options:o.map(t=>({value:t,label:S[t]}))})}function bo(){return{[m]:f({field:l,in:D.filter(o=>o!=="none")}),[l]:r("desktop",{...H(D,"none"),description:lo})}}function Po(o){const e=ao(o),n=Q(oo);return{[m]:f(e),[i.kind]:r("desktop",{..._(H($,o),(t,c)=>io(c??{},o)),description:mo}),[no]:j({type:"custom",render:()=>s(Y,{})},"always"),_cHover:P(),[i.angle]:r("desktop",a(_(n,t=>so(t)),e)),[i.duration]:r("desktop",a(x("hover"),e)),[i.delay]:r("desktop",a(N("hover"),e))}}function Ro(o,e=""){const n=b(o);return{[m]:f(n),[i.kind]:g(ro,o,uo),_cHover:P(),...eo.includes(e)?_o():{},[i.duration]:r("desktop",a(x("hover"),n)),[i.delay]:r("desktop",a(N("hover"),n))}}function _o(){const o=po(),e=T("Zoom",s(O,{}),u.min,u.max,u.step,u.min,u.unit),n=T("Darken on hover",s(G,{}),p.min,p.max,p.step,p.fallback,p.unit);return{[K.zoom]:r("desktop",a(e,o)),[K.darken]:r("desktop",a(n,o))}}function g(o,e,n){const t=r("desktop",{..._(H(o,e),c=>co({[l]:c},e,o)),description:n});return Object.assign(t,{[y]:e})}const y="sfPictureResting",A=new WeakMap;function go(o,e,n){const t=o[i.kind],c=t?.[y];if(!t||!c)return o;const E=e.props?.[l]==="nextImage",R=E?null:q(n.appState,e.props?.id),B=R?Z(String(R.type),J(e.props),R):null;if(!E&&!B?.next)return o;let h=A.get(o);return h||(h={...o,[i.kind]:g(to,c,ho)},A.set(o,h)),h}const Ho="What this card does when a shopper points at it, or taps it on a phone. Highlight fills it with the surface color and turns its text the main color.",Eo={none:()=>s(I,{}),[V]:()=>s(U,{})},yo=r("desktop",{...v(w({label:d("Hover effect"),options:k.map(o=>({value:o,label:d(C[o]),picture:Eo[o]()})),fallback:"none"}),{type:"select",label:"Hover effect",options:k.map(o=>({value:o,label:C[o]}))}),description:Ho});function Ao(){const o={any:[b("none"),{field:l,is:V}]};return{...Ro("none"),[m]:f(o)}}export{yo as BOX_HIGHLIGHT_ROW,Ao as boxHoverFields,Po as cardHoverFields,bo as hoverFields,go as offerNextPicture,Ro as pictureHoverFields};
1
+ import{jsx as i}from"react/jsx-runtime";import{AccentIcon as F,ContrastIcon as M,ExpandIcon as G,FinishIcon as W,ImagesIcon as X,NoSymbolIcon as O,HoverLiftIcon as z,HoverNextImageIcon as Y,HoverRotateIcon as j,HoverZoomIcon as w,OpacityIcon as Z}from"efficient-easel/icons";import{customize as q,describedAs as v,group as J}from"efficient-easel/screen/lib/document/box-fields";import{effectTiles as V}from"efficient-easel/screen/lib/document/effect-tiles";import{deviceField as r}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as Q,noControlField as $}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{BOX_DARKEN as p}from"../../../format/lib/content/box-background.js";import{cardListFieldsOf as oo,cardTemplateOwner as eo,namedRowField as to,rowFieldSpec as no}from"../../../format/lib/content/card-template.js";import{angleRow as ro,segmented as N,select as so,slider as S}from"../document/box-fields.js";import{say as u}from"../../../format/lib/editor-words.js";import{withShowWhen as a}from"../../../format/lib/document/show-when-attach.js";import{animationDelayField as T,animationDurationField as D,showsWhatRuns as m}from"./AnimationDurationRow.js";import{BOX_HIGHLIGHT as A,BOX_HOVER_KINDS as k,BOX_HOVER_LABELS as x,CARD_HOVER_KEYS as c,CARD_HOVER_KINDS as io,CARD_HOVER_TURN as co,HOVER_KEY as h,HOVER_MEDIA_COVERS as ao,HOVER_MEDIA_COVER_LABELS as po,HOVER_MEDIA_DEFAULTS as f,HOVER_MEDIA_GROUPS as ho,HOVER_MEDIA_GROUP_LABELS as lo,HOVER_MEDIA_KINDS as _o,HOVER_MEDIA_KIND_LABELS as Eo,HOVER_KIND_LABELS as C,NEXT_PICTURE_BLOCKS as uo,NEXT_PICTURE_HOVER_KINDS as Ro,OLD_SPIN_KEY as Ho,PART_HOVER_KINDS as g,PICTURE_HOVER_KEYS as K,PICTURE_HOVER_KINDS as mo,PICTURE_HOVER_ZOOM as d,cardHoverAngleOf as fo,cardHoverKindOf as Io,cardRotatesRule as Oo,cardShowsNextRule as wo,HOVER_GROUP_KEY as R,pictureHoverKindOf as vo,pictureHoverMovesRule as Vo,pictureHoverRunsRule as P}from"../../../format/lib/animation/hover.js";const H=o=>r("desktop",J("Hover",{dot:o})),b=()=>r("desktop",q()),No="What this does when a shopper points at it, or taps it on a phone.",So="What this picture does when a shopper points at it. Black and white shows it in grey until then. A phone shows its colour.",To="What this picture does when a shopper points at the card. Show next image fades to the card's next photo. Black and white shows it in grey until then. A phone shows the first photo in colour.",Do="What each card does when a shopper points at it. Show next image covers the card with this product's photos, with arrows; a phone shows the card as it is. Rotate turns the wheel picture.",Ao="Which of the product's pictures the card shows.",ko="Same finish shows the photos of the finish the card shows, else the first group.",xo="Whole card hides the words under the photo. Picture keeps the words and swatches in view.",Co={none:()=>i(O,{}),nextImage:()=>i(Y,{}),rotate:()=>i(j,{}),zoom:()=>i(w,{}),lift:()=>i(z,{}),mono:()=>i(M,{})};function I(o,e){const t=V({label:u("Hover effect"),options:o.map(s=>({value:s,label:u(C[s]),picture:Co[s]()})),fallback:e});return v(t,{type:"select",label:"Hover effect",options:o.map(s=>({value:s,label:C[s]}))})}function Jo(){return{[R]:H({field:h,in:g.filter(o=>o!=="none")}),[h]:r("desktop",{...I(g,"none"),description:No})}}function Qo(o){const e=Oo(o),t=wo(),s=ro(co);return{[R]:H({any:[e,t]}),[c.kind]:r("desktop",{...m(I(io,o),(n,l)=>Io(l??{},o)),description:Do}),...go(t),[Ho]:$({type:"custom",render:()=>i(Q,{})},"always"),_cHover:b(),[c.angle]:r("desktop",a(m(s,n=>fo(n)),e)),[c.duration]:r("desktop",a(D("hover"),e)),[c.delay]:r("desktop",a(T("hover"),e))}}function go(o){const e=so("Type",i(X,{}),_o.map(n=>({value:n,label:Eo[n]})),f.kind),t=N("Group",i(W,{}),ho.map(n=>({value:n,label:lo[n]})),f.group),s=N("Covers",i(G,{}),ao.map(n=>({value:n,label:po[n]})),f.cover);return{[c.mediaKind]:r("desktop",a({...e,description:Ao},o)),[c.mediaGroup]:r("desktop",a({...t,description:ko},o)),[c.cover]:r("desktop",a({...s,description:xo},o))}}function Ko(o,e=""){const t=P(o);return{[R]:H(t),[c.kind]:y(mo,o,So),_cHover:b(),...uo.includes(e)?Po():{},[c.duration]:r("desktop",a(D("hover"),t)),[c.delay]:r("desktop",a(T("hover"),t))}}function Po(){const o=Vo(),e=S("Zoom",i(w,{}),d.min,d.max,d.step,d.min,d.unit),t=S("Darken on hover",i(Z,{}),p.min,p.max,p.step,p.fallback,p.unit);return{[K.zoom]:r("desktop",a(e,o)),[K.darken]:r("desktop",a(t,o))}}function y(o,e,t){const s=r("desktop",{...m(I(o,e),n=>vo({[h]:n},e,o)),description:t});return Object.assign(s,{[L]:e})}const L="sfPictureResting",U=new WeakMap;function $o(o,e,t){const s=o[c.kind],n=s?.[L];if(!s||!n)return o;const l=e.props?.[h]==="nextImage",_=l?null:eo(t.appState,e.props?.id),B=_?no({ownerType:String(_.type),owner:_,fields:oo(t.appState,_)},to(e.props)):null;if(!l&&!B?.next)return o;let E=U.get(o);return E||(E={...o,[c.kind]:y(Ro,n,To)},U.set(o,E)),E}const bo="What this card does when a shopper points at it, or taps it on a phone. Highlight fills it with the surface color and turns its text the main color.",yo={none:()=>i(O,{}),[A]:()=>i(F,{})},oe=r("desktop",{...v(V({label:u("Hover effect"),options:k.map(o=>({value:o,label:u(x[o]),picture:yo[o]()})),fallback:"none"}),{type:"select",label:"Hover effect",options:k.map(o=>({value:o,label:x[o]}))}),description:bo});function ee(){const o={any:[P("none"),{field:h,is:A}]};return{...Ko("none"),[R]:H(o)}}export{oe as BOX_HIGHLIGHT_ROW,ee as boxHoverFields,Qo as cardHoverFields,Jo as hoverFields,$o as offerNextPicture,Ko as pictureHoverFields};
@@ -1 +1 @@
1
- import{jsx as i}from"react/jsx-runtime";import{FOOTPRINT_DEFAULTS as O}from"../../../../../../format/lib/content/footprint.js";import{HeadquartersIcon as _,LayoutIcon as E,LocationIcon as I,SearchIcon as P,StoreIcon as k,ThemeIcon as C}from"efficient-easel/icons";import{CoordsField as x,copyText as D,plainText as l,sourceField as N,text as u,textarea as h,toggle as f}from"../../../controls.js";import{group as a,section as A}from"efficient-easel/screen/lib/document/box-fields";import{segmented as m}from"../../../box-fields.js";import{withShowWhen as n}from"../../../../../../render/lib/document/show-when.js";import{needsGeocodeWork as H,resolveGeocodeRows as B}from"../../../geocode-resolve.js";import{SPLITTABLE_SECTIONS as M,headFieldsForPlacement as W}from"../../../../../../format/lib/sections/section-head-placement.js";import{innerSpacingFields as U}from"../../shared-fields.js";import{BLOCK_SOURCE_PROP as g,blockSources as j,blockSourcesRevision as w}from"../../../../../../format/lib/content/block-sources.js";import{FOOTPRINT_PH as d,FootprintSlots as q}from"../../../../../../format/lib/document/blocks/general/Footprint/meta.js";const z={field:"source",is:"typed",default:"typed"},c={field:"source",is:"dealers",default:"typed"},b={all:[c,{field:"search",is:!0,default:!1}]},y=[{label:"Typed in",value:"typed"},{label:"Dealers",value:"dealers"}],G=new Set(y.map(e=>e.value)),R=e=>m("Source",i(k,{}),e,"typed");function v(e){const o=typeof e=="string"?e.trim():"";return o&&!G.has(o)&&/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/.test(o)?o:""}const S=new Map;let F=-1;function K(e){const o=j("Footprint"),t=e&&!o.some(s=>s.key===e)?e:"";if(!o.length&&!t)return null;F!==w()&&(F=w(),S.clear());let r=S.get(t);return r||(r=R([...y,...o.map(s=>({label:s.label,value:s.key})),...t?[{label:t,value:t}]:[]]),S.set(t,r)),r}const T=new WeakMap;function Q(e,o){const t=K(o);if(!t)return e;let r=T.get(e);r||T.set(e,r=new Map);let s=r.get(t);return s||(s={...e,source:t},r.set(t,s)),s}const ne={fields:{_gContent:a("Section"),sectionNumber:u("Section number",d.sectionNumber),heading:h("Heading",d.heading),tagline:h("Body",d.tagline),_gOffices:a("Offices"),source:R(y),offices:n({type:"array",label:"Offices",arrayFields:{role:l("Role"),city:l("City"),country:l("Region · country"),address:D("Address"),group:l("Group"),hq:f("HQ",!1,i(_,{})),geocode:N(x,{label:"Coordinates"})},defaultItemProps:{role:"Sales & Distribution",city:"City",country:"Country",address:"",group:"",hq:!1,lat:0,lng:0},getItemSummary:e=>e?.city||"Office"},z),...q,mapTheme:m("Map theme",i(C,{}),[{label:"Auto",value:"auto"},{label:"Dark",value:"dark"},{label:"Light",value:"light"}],O.mapTheme),_gSearch:a("Search"),search:n(f("Show",!1,i(P,{})),c),searchHint:n(u("Hint","Type a postcode or address"),b),noMatchText:n(u("No match","No place found. Try another postcode."),b),_gList:a("List"),listPosition:n(m("Position",i(E,{}),[{label:"Left",value:"left"},{label:"Right",value:"right"},{label:"Below",value:"below"}],"below"),c),showDistance:n(f("Distance",!0,i(I,{})),c),_dLayout:A("Layout"),...U("Footprint")},resolveData:async e=>{const o=v(e.props.source);(e.props[g]??"")!==o&&(e={...e,props:{...e.props,[g]:o}});const t=e.props,r=t.offices??[];if(!H(r))return e;const s=await B(r,p=>[p.address,p.city,p.country].map(L=>String(L??"").replace(/\*/g,"").trim()).filter(Boolean).join(", "));return{...e,props:{...t,offices:s}}},resolveFields:(e,{fields:o})=>W(Q(o,v(e.props.source)),e.props.headPlacement,M.Footprint.headRows)};export{ne as FootprintFields,v as footprintBlockSource};
1
+ import{jsx as n}from"react/jsx-runtime";import{FOOTPRINT_DEFAULTS as C}from"../../../../../../format/lib/content/footprint.js";import{HeadquartersIcon as x,LayoutIcon as D,LocationIcon as N,SearchIcon as A,StoreIcon as B,ThemeIcon as H}from"efficient-easel/icons";import{CoordsField as M,copyText as W,plainText as l,sourceField as U,text as p,textarea as w,toggle as u,withPanelOnly as b}from"../../../controls.js";import{group as f,section as j}from"efficient-easel/screen/lib/document/box-fields";import{segmented as d}from"../../../box-fields.js";import{withShowWhen as c}from"../../../../../../render/lib/document/show-when.js";import{needsGeocodeWork as q,resolveGeocodeRows as z}from"../../../geocode-resolve.js";import{deviceField as a}from"efficient-easel/screen/lib/document/device-fields";import{SPLITTABLE_SECTIONS as G,headFieldsForPlacement as K}from"../../../../../../format/lib/sections/section-head-placement.js";import{innerSpacingFields as Q}from"../../shared-fields.js";import{BLOCK_SOURCE_PROP as v,blockSources as V,blockSourcesRevision as F}from"../../../../../../format/lib/content/block-sources.js";import{FOOTPRINT_PH as m,FootprintSlots as Y}from"../../../../../../format/lib/document/blocks/general/Footprint/meta.js";import{withFootprintSideTemplate as $}from"../../../../../../format/lib/document/blocks/general/Footprint/card-seed.js";const J={field:"source",is:"typed",default:"typed"},R={field:"source",is:"dealers",default:"typed"},X={field:"listPosition",in:["left","right"],default:"below"},T={any:[R,X]},O={all:[T,{field:"search",is:!0,default:!1}]},h=[{label:"Typed in",value:"typed"},{label:"Dealers",value:"dealers"}],Z=new Set(h.map(e=>e.value)),P=e=>d("Source",n(B,{}),e,"typed");function k(e){const o=typeof e=="string"?e.trim():"";return o&&!Z.has(o)&&/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/.test(o)?o:""}const y=new Map;let L=-1;function ee(e){const o=V("Footprint"),t=e&&!o.some(s=>s.key===e)?e:"";if(!o.length&&!t)return null;L!==F()&&(L=F(),y.clear());let r=y.get(t);return r||(r=P([...h,...o.map(s=>({label:s.label,value:s.key})),...t?[{label:t,value:t}]:[]]),y.set(t,r)),r}const E=new WeakMap;function oe(e,o){const t=ee(o);if(!t)return e;let r=E.get(e);r||E.set(e,r=new Map);let s=r.get(t);return s||(s={...e,source:t},r.set(t,s)),s}const ye={fields:{_gContent:f("Section"),sectionNumber:p("Section number",m.sectionNumber),heading:w("Heading",m.heading),tagline:w("Body",m.tagline),_gOffices:f("Offices"),source:P(h),offices:c({type:"array",label:"Offices",arrayFields:{role:l("Role"),city:l("City"),country:l("Region · country"),address:W("Address"),phone:l("Phone"),group:l("Group"),hq:u("HQ",!1,n(x,{})),geocode:U(M,{label:"Coordinates"})},defaultItemProps:{role:"Sales & Distribution",city:"City",country:"Country",address:"",phone:"",group:"",hq:!1,lat:0,lng:0},getItemSummary:e=>e?.city||"Office"},J),...Y,mapTheme:d("Map theme",n(H,{}),[{label:"Auto",value:"auto"},{label:"Dark",value:"dark"},{label:"Light",value:"light"}],C.mapTheme),_gList:f("List"),listPosition:a("desktop",d("Position",n(D,{}),[{label:"Left",value:"left"},{label:"Right",value:"right"},{label:"Below",value:"below"}],"below")),search:a("desktop",c(u("Search",!1,n(A,{})),T)),searchHint:a("desktop",c(b(p("Hint","Type a postcode or address")),O)),noMatchText:a("desktop",c(b(p("No match","No place found. Try another postcode.")),O)),showDistance:c(u("Distance",!0,n(N,{})),R),_dLayout:j("Layout"),...Q("Footprint")},resolveData:async(e,o)=>{const t=o?.changed,r=e.props;if(t?.listPosition===!0||t?.source===!0){const i=$(r);i!==r&&(e={...e,props:i})}const s=k(e.props.source);(e.props[v]??"")!==s&&(e={...e,props:{...e.props,[v]:s}});const g=e.props,S=g.offices??[];if(!q(S))return e;const I=await z(S,i=>[i.address,i.city,i.country].map(_=>String(_??"").replace(/\*/g,"").trim()).filter(Boolean).join(", "));return{...e,props:{...g,offices:I}}},resolveFields:(e,{fields:o})=>K(oe(o,k(e.props.source)),e.props.headPlacement,G.Footprint.headRows)};export{ye as FootprintFields,k as footprintBlockSource};
@@ -1 +1 @@
1
- import{group as i}from"efficient-easel/screen/lib/document/box-fields";import{deviceField as t}from"efficient-easel/screen/lib/document/device-fields";import{text as o}from"../../../controls.js";import{LIST_SEARCH_PH as e}from"../../../../../../format/lib/document/blocks/general/ListSearch/meta.js";const d={fields:{_gContent:t("desktop",i("Content")),hint:t("desktop",o("Hint",e.hint)),noMatchText:t("desktop",o("No match",e.noMatchText))}};export{d as ListSearchFields};
1
+ import{group as n}from"efficient-easel/screen/lib/document/box-fields";import{deviceField as t}from"efficient-easel/screen/lib/document/device-fields";import{text as o,withPanelOnly as e}from"../../../controls.js";import{LIST_SEARCH_PH as i}from"../../../../../../format/lib/document/blocks/general/ListSearch/meta.js";const h={fields:{_gContent:t("desktop",n("Content")),hint:t("desktop",e(o("Hint",i.hint))),noMatchText:t("desktop",e(o("No match",i.noMatchText)))}};export{h as ListSearchFields};
@@ -1 +1 @@
1
- import{useSyncExternalStore as g}from"react";import{rowBound as P}from"../../../format/lib/content/card-template.js";import{linkedCount as O}from"../../../format/lib/content/count-numbers.js";import{SHOP_MARKUP as R}from"../../../format/lib/markup.js";import{readHidable as S,textFieldOffPage as k}from"./controls.js";import{decodePartId as v}from"efficient-easel/draw";import{canTypeOnCanvas as K,PART_ATTR as y}from"../../../render/lib/document/text-parts.js";import{partRowField as C}from"./part-row-field.js";import{decodePartKey as b,partRowValue as A}from"../../../render/lib/document/part-rows.js";import{isMultilineKind as E,typeInPlaceKind as _}from"../../../render/lib/document/part-text.js";import{commitPartText as w}from"./part-typing.js";import{consentWordsOf as F}from"../../../format/lib/content/consent-banner.js";import{KICKER_NUMBER_ATTR as I}from"../../../render/lib/content/page-contents.js";const B=`[${I}]`,L=["bold","italic","underline","strike","link","sup","sub"],M=["bullet","number"];function $(e,t){return e?[...L,...t?M:[]]:[]}function T(e,t){const r=v(e);if(!r?.propKey)return null;const{nodeId:u,propKey:s}=r,o=t.getItemById(u),c=t.getSelectorForId(u);if(!o||!c)return null;const{key:n,row:i}=b(s),a=t.components[o.type]?.fields?.[n],d=i?C(a,i):a,m=_(d);if(!m)return null;const l=o.props??{};if(F(l)!==null||!i&&P(o.type,l,n)||o.type==="Text"&&n==="text"&&O(l)||i&&!(Array.isArray(l[n])&&i.index<l[n].length))return null;const x=i?A(l[n],i):l[n];return{node:o,selector:c,propKey:s,kind:m,stored:x,offPage:k(d)}}function ee(e,t){const r=T(e,t);if(!r)return null;const{text:u,hidden:s}=S(r.stored);if(!K({offPage:r.offPage,hidden:!!s}))return null;const o=E(r.kind);return{partId:e,value:u,rules:R,multiline:o,skip:B,offered:$(r.kind!=="plainText",o),write:c=>{const n=T(e,t);n&&w({node:n.node,propKey:n.propKey,kind:n.kind,zone:n.selector.zone,index:n.selector.index},c,t.replace)}}}function te(e,t,r){return e?.isConnected&&e.getAttribute(y)===r?e:t?.querySelector(`[${y}="${h(r)}"]`)??null}function h(e){return e.replace(/["\\]/g,"\\$&")}function ne(e){const t=e.activeElement;return t?t.tagName==="IFRAME"||!!t.closest(".es-canvas"):!1}let f=null;const p=new Set;function N(){return f}function re(e){if(e!==f){f=e;for(const t of p)t()}}function W(e){return p.add(e),()=>{p.delete(e)}}function oe(){return g(W,N,()=>null)}export{N as canvasTypingPart,h as cssString,ne as keysOnCanvas,te as partElement,$ as partTextTools,ee as partTypingTarget,re as setCanvasTypingPart,W as subscribeCanvasTypingPart,oe as useCanvasTypingPart};
1
+ import{useSyncExternalStore as g}from"react";import{rowBound as O}from"../../../format/lib/content/card-template.js";import{linkedCount as P}from"../../../format/lib/content/count-numbers.js";import{SHOP_MARKUP as R}from"../../../format/lib/markup.js";import{readHidable as S,textFieldOffPage as k}from"./controls.js";import{decodePartId as v}from"efficient-easel/draw";import{canTypeOnCanvas as K,PART_ATTR as y}from"../../../render/lib/document/text-parts.js";import{fieldPanelOnly as C}from"../../../format/lib/document/panel-only.js";import{partRowField as b}from"./part-row-field.js";import{decodePartKey as A,partRowValue as E}from"../../../render/lib/document/part-rows.js";import{isMultilineKind as _,typeInPlaceKind as w}from"../../../render/lib/document/part-text.js";import{commitPartText as F}from"./part-typing.js";import{consentWordsOf as I}from"../../../format/lib/content/consent-banner.js";import{KICKER_NUMBER_ATTR as B}from"../../../render/lib/content/page-contents.js";const L=`[${B}]`,M=["bold","italic","underline","strike","link","sup","sub"],$=["bullet","number"];function h(e,n){return e?[...M,...n?$:[]]:[]}function T(e,n){const r=v(e);if(!r?.propKey)return null;const{nodeId:u,propKey:s}=r,o=n.getItemById(u),f=n.getSelectorForId(u);if(!o||!f)return null;const{key:t,row:i}=A(s),d=n.components[o.type]?.fields?.[t],c=i?b(d,i):d,m=w(c);if(!m)return null;const l=o.props??{};if(I(l)!==null||!i&&O(o.type,l,t)||o.type==="Text"&&t==="text"&&P(l)||i&&!(Array.isArray(l[t])&&i.index<l[t].length))return null;const x=i?E(l[t],i):l[t];return{node:o,selector:f,propKey:s,kind:m,stored:x,offPage:k(c),panelOnly:C(c)}}function te(e,n){const r=T(e,n);if(!r)return null;const{text:u,hidden:s}=S(r.stored);if(!K({offPage:r.offPage,hidden:!!s,panelOnly:r.panelOnly}))return null;const o=_(r.kind);return{partId:e,value:u,rules:R,multiline:o,skip:L,offered:h(r.kind!=="plainText",o),write:f=>{const t=T(e,n);t&&F({node:t.node,propKey:t.propKey,kind:t.kind,zone:t.selector.zone,index:t.selector.index},f,n.replace)}}}function re(e,n,r){return e?.isConnected&&e.getAttribute(y)===r?e:n?.querySelector(`[${y}="${N(r)}"]`)??null}function N(e){return e.replace(/["\\]/g,"\\$&")}function oe(e){const n=e.activeElement;return n?n.tagName==="IFRAME"||!!n.closest(".es-canvas"):!1}let p=null;const a=new Set;function W(){return p}function ie(e){if(e!==p){p=e;for(const n of a)n()}}function z(e){return a.add(e),()=>{a.delete(e)}}function le(){return g(z,W,()=>null)}export{W as canvasTypingPart,N as cssString,oe as keysOnCanvas,re as partElement,h as partTextTools,te as partTypingTarget,ie as setCanvasTypingPart,z as subscribeCanvasTypingPart,le as useCanvasTypingPart};
@@ -1,4 +1,5 @@
1
1
  import { type ViewTier } from "efficient-easel/draw";
2
+ import { type CardRowFieldSpec } from "../../../format/lib/content/card-template.js";
2
3
  import { type BlockShowWhenFacts, type ShowWhenRule } from "../../../format/lib/document/show-when-attach.js";
3
4
  export declare const NOT_CARD_OF_TEMPLATE = "notCardOfTemplate";
4
5
  export declare const ON_A_CARD: ShowWhenRule;
@@ -22,11 +23,12 @@ type ChipOwner = {
22
23
  type?: unknown;
23
24
  props?: Record<string, unknown>;
24
25
  } | null | undefined;
25
- export declare function cardChipLabel(child: Child, ownerType: string | undefined, layers: (child: Child) => string, owner?: ChipOwner): string;
26
- export declare function CardDisplayChips({ card, ownerType, owner, labelOf, write, readOnly, view, }: {
26
+ export declare function cardChipLabel(child: Child, ownerType: string | undefined, layers: (child: Child) => string, owner?: ChipOwner, fields?: readonly CardRowFieldSpec[]): string;
27
+ export declare function CardDisplayChips({ card, ownerType, owner, fields, labelOf, write, readOnly, view, }: {
27
28
  card: Card;
28
29
  ownerType: string | undefined;
29
30
  owner?: ChipOwner;
31
+ fields?: readonly CardRowFieldSpec[];
30
32
  labelOf: (type: string) => string;
31
33
  write: (next: (latest: Card) => Card) => void;
32
34
  readOnly?: boolean;
@@ -1 +1 @@
1
- "use client";import{jsx as c}from"react/jsx-runtime";import{isNodeList as b}from"efficient-easel/data";import{useEasel as N}from"efficient-easel/easel";import{hiddenInView as D,hiddenKeyOf as h,hidePatch as S,slotChildName as _,slotChildRowName as A}from"efficient-easel/draw";import{cardTemplateCardOwner as k,cardTemplateField as T,namedRowField as P}from"../../../format/lib/content/card-template.js";import{DisplayRow as g,useSelectedPatch as j}from"./controls.js";import{websiteNodeIsLocked as E}from"./locked-blocks.js";import{stripMarkup as F}from"../../../format/lib/markup.js";import{sourceRowName as L}from"../../../format/lib/document/source-row-name.js";import{withShowWhen as M}from"../../../format/lib/document/show-when-attach.js";import{deviceField as I}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as $}from"efficient-easel/screen/lib/document/panel-no-control-mark";const w="notCardOfTemplate",B={not:{context:w,is:!0}},ae={[w]:(e,n)=>{const t=k(n.appState,e.props?.id);return t===void 0?void 0:t===null}};function m(e){const n=e.props?.content;return b(n)?n:[]}const l=(e,n)=>D(e.props??{},n),H=(e,n)=>e.props?.[h(n)]!==void 0;function x(e,n=()=>!1,t="desktop"){return m(e).flatMap(o=>typeof o?.props?.id!="string"?[]:m(o).length&&!l(o,t)?x(o,n,t):n(o)?[]:[o])}function K(e,n,t,o="desktop"){const r=x(e,t,o).map(p=>({child:p,name:n(p)})),i=new Set(r.map(p=>p.name)),s=new Set;return r.map(({child:p,name:u})=>{let f=u;if(s.has(u)){let a=2;for(;i.has(`${u} ${a}`);)a+=1;f=`${u} ${a}`,i.add(f)}return s.add(u),{id:p.props.id,label:f,shown:!l(p,o)}})}function y(e,n,t){const o=r=>t==="desktop"?l(r,t):H(r,t);return m(e).flatMap(r=>o(r)?n(r)?[]:[r,...y(r,n,t)]:y(r,n,t))}function V(e,n){const t={...e};for(const[r,i]of Object.entries(n))i===void 0||r===h("desktop")&&i===!1?delete t[r]:t[r]=i;return Object.keys(t).length===Object.keys(e).length&&Object.keys(t).every(r=>t[r]===e[r])?e:t}function O(e,n,t){const o=m(e);let r=!1;const i=o.map(s=>{if(r)return s;let p=s;if(s?.props?.id===n){const u=V(s.props,t(s.props));u!==s.props&&(p={...s,props:u})}else p=O(s,n,t);return r=p!==s,p});return r?{...e,props:{...e.props,content:i}}:e}function R(e,n,t,o="desktop"){return O(e,n,r=>o==="desktop"&&l({props:r},o)===!t?{}:S(r,o,!t))}function W(e,n,t){return t==="desktop"?R(e,n,!0,t):O(e,n,()=>({[h(t)]:void 0}))}function X(e,n,t,o){return _(e).trim()?t(e):T(n,P(e.props),o)?.label??t(e)}const Y="This page is read-only.";function q({card:e,ownerType:n,owner:t,labelOf:o,write:r,readOnly:i,view:s="desktop"}){const p=a=>A(a,o,F,void 0,L),u=a=>E(a.type,a),f=K(e,a=>X(a,n,p,t),u,s);return f.length?c(g,{parts:f,changed:y(e,u,s).length>0,shown:a=>f.find(d=>d.id===a)?.shown??!0,disabledReason:i?Y:void 0,onPress:(a,d)=>r(C=>R(C,a,d,s)),onReset:()=>r(a=>y(a,u,s).reduce((d,C)=>W(d,String(C.props.id),s),a))}):c($,{})}function z(){try{const e=N(r=>r),n=e.config.components??{},t=e.selectedItem;if(!t)return null;const o=k(e.appState,t.props?.id);return{labelOf:r=>n[r]?.label??r,card:t,ownerType:typeof o?.type=="string"?o.type:void 0,owner:o}}catch{return null}}function G({readOnly:e,view:n}){const t=z(),o=j();return t?c(q,{...t,view:n,readOnly:e,write:r=>{e||o(i=>{const s={...t.card,props:i},p=r(s);return p===s?null:{content:p.props.content}})}}):c(g,{parts:[],changed:!1,shown:()=>!0,onPress:()=>{},onReset:()=>{}})}function ie(e){return M(I(e,{type:"custom",render:({readOnly:n})=>c(G,{readOnly:n,view:e})}),B)}export{ae as CARD_BOX_FACTS,q as CardDisplayChips,w as NOT_CARD_OF_TEMPLATE,B as ON_A_CARD,X as cardChipLabel,ie as cardDisplayField,K as cardDisplayItems,x as cardDisplayParts,R as withChildShown};
1
+ "use client";import{jsx as m}from"react/jsx-runtime";import{isNodeList as S}from"efficient-easel/data";import{useEasel as N}from"efficient-easel/easel";import{hiddenInView as D,hiddenKeyOf as h,hidePatch as _,slotChildName as A,slotChildRowName as T}from"efficient-easel/draw";import{cardListFieldsOf as F,cardTemplateCardOwner as w,namedRowField as P,rowFieldSpec as j}from"../../../format/lib/content/card-template.js";import{DisplayRow as g,useSelectedPatch as E}from"./controls.js";import{websiteNodeIsLocked as L}from"./locked-blocks.js";import{stripMarkup as M}from"../../../format/lib/markup.js";import{sourceRowName as I}from"../../../format/lib/document/source-row-name.js";import{withShowWhen as $}from"../../../format/lib/document/show-when-attach.js";import{deviceField as B}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as H}from"efficient-easel/screen/lib/document/panel-no-control-mark";const x="notCardOfTemplate",K={not:{context:x,is:!0}},ue={[x]:(e,n)=>{const t=w(n.appState,e.props?.id);return t===void 0?void 0:t===null}};function l(e){const n=e.props?.content;return S(n)?n:[]}const y=(e,n)=>D(e.props??{},n),V=(e,n)=>e.props?.[h(n)]!==void 0;function R(e,n=()=>!1,t="desktop"){return l(e).flatMap(o=>typeof o?.props?.id!="string"?[]:l(o).length&&!y(o,t)?R(o,n,t):n(o)?[]:[o])}function W(e,n,t,o="desktop"){const r=R(e,t,o).map(s=>({child:s,name:n(s)})),a=new Set(r.map(s=>s.name)),p=new Set;return r.map(({child:s,name:u})=>{let f=u;if(p.has(u)){let d=2;for(;a.has(`${u} ${d}`);)d+=1;f=`${u} ${d}`,a.add(f)}return p.add(u),{id:s.props.id,label:f,shown:!y(s,o)}})}function C(e,n,t){const o=r=>t==="desktop"?y(r,t):V(r,t);return l(e).flatMap(r=>o(r)?n(r)?[]:[r,...C(r,n,t)]:C(r,n,t))}function X(e,n){const t={...e};for(const[r,a]of Object.entries(n))a===void 0||r===h("desktop")&&a===!1?delete t[r]:t[r]=a;return Object.keys(t).length===Object.keys(e).length&&Object.keys(t).every(r=>t[r]===e[r])?e:t}function k(e,n,t){const o=l(e);let r=!1;const a=o.map(p=>{if(r)return p;let s=p;if(p?.props?.id===n){const u=X(p.props,t(p.props));u!==p.props&&(s={...p,props:u})}else s=k(p,n,t);return r=s!==p,s});return r?{...e,props:{...e.props,content:a}}:e}function b(e,n,t,o="desktop"){return k(e,n,r=>o==="desktop"&&y({props:r},o)===!t?{}:_(r,o,!t))}function Y(e,n,t){return t==="desktop"?b(e,n,!0,t):k(e,n,()=>({[h(t)]:void 0}))}function q(e,n,t,o,r){return A(e).trim()?t(e):j({ownerType:n,owner:o,fields:r},P(e.props))?.label??t(e)}const z="This page is read-only.";function G({card:e,ownerType:n,owner:t,fields:o,labelOf:r,write:a,readOnly:p,view:s="desktop"}){const u=i=>T(i,r,M,void 0,I),f=i=>L(i.type,i),d=W(e,i=>q(i,n,u,t,o),f,s);return d.length?m(g,{parts:d,changed:C(e,f,s).length>0,shown:i=>d.find(c=>c.id===i)?.shown??!0,disabledReason:p?z:void 0,onPress:(i,c)=>a(O=>b(O,i,c,s)),onReset:()=>a(i=>C(i,f,s).reduce((c,O)=>Y(c,String(O.props.id),s),i))}):m(H,{})}function J(){try{const e=N(r=>r),n=e.config.components??{},t=e.selectedItem;if(!t)return null;const o=w(e.appState,t.props?.id);return{labelOf:r=>n[r]?.label??r,card:t,ownerType:typeof o?.type=="string"?o.type:void 0,owner:o,fields:F(e.appState,o)}}catch{return null}}function Q({readOnly:e,view:n}){const t=J(),o=E();return t?m(G,{...t,view:n,readOnly:e,write:r=>{e||o(a=>{const p={...t.card,props:a},s=r(p);return s===p?null:{content:s.props.content}})}}):m(g,{parts:[],changed:!1,shown:()=>!0,onPress:()=>{},onReset:()=>{}})}function fe(e){return $(B(e,{type:"custom",render:({readOnly:n})=>m(Q,{readOnly:n,view:e})}),K)}export{ue as CARD_BOX_FACTS,G as CardDisplayChips,x as NOT_CARD_OF_TEMPLATE,K as ON_A_CARD,q as cardChipLabel,fe as cardDisplayField,W as cardDisplayItems,R as cardDisplayParts,b as withChildShown};
@@ -1 +1 @@
1
- "use client";import{jsx as i,jsxs as N,Fragment as k}from"react/jsx-runtime";import{cloneElement as Ge,createContext as zt,useContext as Me,useEffect as Yt,useId as Ue,useRef as V,useState as z}from"react";import{useEasel as te,useSelectedHost as M}from"efficient-easel/easel";import{toDateKey as qt,fromDateKey as Jt}from"efficient-shell/format";import{say as l,editorEaselWords as y}from"../../../format/lib/editor-words.js";import{LOADING_SHOWS_LABELS as We,firstFrameHint as Zt,loadingShowsOf as Qt,loadingStillHint as en}from"../../../format/lib/hero-video.js";import{pageFramesFor as tn,usePageVideoFrames as nn}from"../page-video-frames.js";import{ScreenDocumentContext as on}from"efficient-easel/screen/components/ScreenDocumentContext";import{readHidable as Ke,hidableText as $e}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as pe,LINK_FIELD_MARKER as Xe,MEDIA_FIELD_MARKER as je,SCAFFOLD_FIELD_MARKER as Ve,TEXT_FIELD_MARKER as O,foldMetaOf as fe,textFieldIdentifier as rn}from"efficient-easel/draw";import ln from"../../components/ApplyCornersToSiblings.js";import{withShowWhen as ze}from"../../../render/lib/document/show-when.js";import sn from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as an,CORNER_RADIUS_MAX as Ye,CORNER_RADIUS_MIN as U}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as cn,IMAGE_CORNERS_LABEL as dn}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as un}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as pn,GALLERY_LAYOUTS as ne,GALLERY_LAYOUT_KEYS as fn,galleryChoices as qe,galleryLayoutRatio as hn,galleryPictureCells as mn}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as gn}from"./shell-glyph.js";import{anchorSiblingsOf as bn,placementPoints as wn}from"../../../format/lib/hero-group-placement.js";import xn from"../../components/AnchorField.js";import Sn from"../../components/SourceStatus.js";import{AdjustIcon as yn,EyeIcon as Cn,AnimationIcon as _n,BackgroundIcon as Je,BorderAllIcon as Rn,BlockSectionIcon as Tn,ColumnWidthsIcon as he,ColumnsIcon as Ze,CornerIcon as On,DirectionDownIcon as In,DirectionLeftIcon as En,DirectionRightIcon as kn,DirectionUpIcon as Fn,EditIcon as An,GapIcon as Ln,GridIcon as Nn,GroundIcon as me,HashIcon as Qe,HeightIcon as Pn,ImageIcon as vn,ListIcon as Bn,LocationIcon as et,PaddingBottomIcon as tt,PaddingLeftIcon as nt,PaddingRightIcon as ot,PaddingTopIcon as rt,PageIcon as Dn,StickyIcon as Hn,SearchIcon as Gn,SquareIcon as Mn,TypeIcon as Un,WidthIcon as Wn}from"efficient-easel/icons";import{FieldGlyph as it}from"../../components/FieldGlyph.js";import{resolvePageBackground as Kn}from"../../../format/lib/content/page-background.js";import{boxFillOf as $n,boxFillSlot as ge}from"../../../format/lib/content/box-background.js";import{CORNER_SIDES as lt,CORNER_SIDE_POINTS as Xn,hasOwnSectionCorners as jn,normalizeCornerSides as st}from"../../../format/lib/content/section-corners.js";import{enclosingPath as Vn,enclosingSection as zn}from"./enclosing-section.js";import{SettingsDefaultReset as C,SettingsDrill as Yn,SettingsField as S,SettingsGroup as qn,SettingsGroupSub as Jn,SettingsSegmented as Zn,SettingsBorder as Qn,SettingsSidesEach as eo,SettingsSwitch as be,borderSides as to,borderStartEach as no}from"efficient-easel/panel";import{ListField as oo}from"efficient-easel/fields";import{DisplayChips as ro}from"efficient-shell/ui";import{desktopDisplayChanged as io,partShownOnDesktop as lo,partShownOnPhone as so,phoneDisplayChanged as ao,withDesktopPart as co,withPhonePart as uo}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as po,Checkbox as fo,ColorSwatch as ho,CornersInput as mo,DatePicker as go,DateTimePicker as bo,FOCAL_DEFAULT as wo,IconPicker as at,COLUMN_COUNT_MAX as ct,COLUMN_SHARE_MIN as xo,COLUMN_SHARES_EQUAL as So,resolveColumnShares as dt,WidthsBar as yo,useShellStrings as Co,IconButton as ut,InputNumber as pt,Slider as _o,Tooltip as we}from"efficient-shell/ui";import{LOOKUP_BUSY_NOTE as Ro}from"./geocode-resolve.js";import{ColourRow as oe,InheritedColourRow as ft}from"./ColourControl.js";import{fillThemeColors as To,slotFill as re}from"../../../format/lib/document/theme-slots.js";import{fillSlotNamed as xe}from"../../../format/lib/document/part-inks.js";import{keptByRow as Oo}from"efficient-easel/screen/lib/document/style-fields";import ht from"./MarkupToolbar.js";import{deviceField as R}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as Io,NoControlMark as Eo,noControlField as mt}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as ko}from"../../../format/lib/document/own-box.js";import{PHONE_CLEAR as Fo,resolvePhoneValue as Se}from"../../../format/lib/document/phone-override.js";import{phoneKey as F,tabletKey as W}from"efficient-easel/draw";import{SuppressibleText as Ao}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Lo,CARD_OUTLINE_OPTIONS as No,DEFAULT_CARD_INDEX_FORMAT as Po,DEFAULT_CARD_OUTLINE as vo}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as Bo,DEFAULT_COVER_INDEX as Do}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as Ho}from"efficient-easel/draw";import Go from"../../components/MediaUploadField.js";import Mo from"../../components/MultiSelectField.js";import Uo from"../../components/SectionThemePicker.js";import Wo from"../../components/SearchSelectField.js";import Ko from"../../components/StorefrontLinkField.js";import{UiIcon as gt}from"efficient-easel/draw/client";import{SECTION_PADDING as I}from"../../../render/lib/content/section-padding.js";import{buttonWordsSummary as $o}from"../../../render/lib/content/button-look.js";import{usePreviewParts as Xo}from"efficient-easel/draw/client";import{encodePartId as jo}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as Vo,useEaselStrings as zo}from"efficient-easel/strings";import{hasPhoneHeight as Yo,hasTabletHeight as ye,resolveSectionMinHeight as qo,resolveTabletHeight as Jo}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as ie,SECTION_STICK_LABEL as Ce,hasPhoneStick as Zo,hasTabletStick as Qo,resolveSectionStick as bt}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as er,SECTION_MIN_HEIGHT_GROUP_LABEL as Y,SECTION_SCREEN_PCT as tr}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as nr,resolveContainerDirection as wt}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as or,BOX_BLOCK_SPACING_POINTS as xt,BOX_PHONE_ROW_LABEL as St,BOX_COLUMNS_MAX as rr,BOX_COLUMNS_MIN as yt,BOX_PHONE_ROW_MAX as ir,BOX_PHONE_ROW_MIN as _e,BOX_SHARE_CHOICES as Ct,BOX_SHARE_LABEL as K,boxShareChoiceOf as _t,boxShareWidthsOf as Re,BOX_SHARE_PHONE_DEFAULT as lr,BOX_SHARE_PHONE_POINTS as sr}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as v}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as ar,borderBySide as Rt}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as cr,normalizeTheme as Tt,normalizeThemeColors as dr,sectionBandTone as ur,surfaceTwoTone as pr}from"../../../format/lib/theme.js";import{CONTAINER_GAP as Ot,CONTAINER_GAP_BUILT_IN as fr,CONTAINER_GAP_PHONE as Te,GAP_FIELD_CONTAINER as Oe,followsSitePhoneGap as hr,hasOwnContainerGap as mr,hasOwnPhoneGap as Ie,resolveContainerGap as It,resolvePhoneContainerGap as Et}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as gr,CARD_IMAGE_BG_OFF as br,CARD_IMAGE_BG_SWATCH_NAMES as wr,CARD_IMAGE_BG_SWATCHES as xr,isCardImageBackgroundInheriting as Sr,cardImageBackgroundChoice as yr,THEME_CARD_IMAGE_BG as Cr}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as _r,SECTION_BG_NO_FILL as Rr,sectionBackgroundChoice as Tr,THEME_SECTION_BG as Ee,isSectionBackgroundEmpty as Or,sectionBackgroundHex as kt}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as Ir,nestedAccentValue as Ft,resolveSectionAccent as le}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as Er,TYPE_SIZE_INHERIT as kr,isTypeSizeInheriting as Fr}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as Ar,WIDTH_CHOICE_LABEL as Lr,WIDTH_INHERIT as Nr}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as Pr}from"./panel-heading-scope.js";import{useEaselSession as vr}from"efficient-easel/screen/lib/session-context";import{backendOf as Br}from"../website-session.js";import{BOX_GAP as Dr,describedAs as E,group as T,iconOf as q,sharedStyleKinds as J}from"efficient-easel/screen/lib/document/box-fields";import{VIEW_KEY_ACCESS as ke,onDesktopWords as B,phoneTwinFields as se}from"efficient-easel/screen/lib/document/box-fields";import{directionField as Hr,gapField as Fe,iconPickerRow as Gr,pickerCellIcon as Mr,pickerNoneIcon as Ur,Segmented as Ae,segmented as Wr,select as Z,slider as $}from"./box-fields.js";function Ps({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function D(e,t){return l("{value} from {from}",{value:e,from:t})}function Kr(){const{blockGap:e}=v();return e===null?l("this container's own spacing"):D(`${e}px`,l("Styles"))}function $r({inherited:e,onReset:t,label:n}){return i(C,{words:y()?.panel,label:l(n),changed:!e,detail:Kr(),onReset:t})}function Xr(e){return Fe({...Dr,builtIn:fr[e],resolve:(t,n)=>It(e,t,n?.siteGap),action:(t,n)=>i($r,{inherited:!mr(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[Oe]:e}})}function jr(e){return ze(R("mobile",{[Oe]:e,type:"custom",render:t=>i(Yr,{container:e,...t})}),At)}function Vr(e){return ze(R("tablet",{[Oe]:e,type:"custom",render:t=>i(zr,{container:e,...t})}),At)}const At={not:{field:"gap",in:Array.from({length:-Ot.min},(e,t)=>Ot.min+t)}};function vs(e){return{gap:R("desktop",Xr(e)),[W("gap")]:Vr(e),[F("gap")]:jr(e)}}function zr({container:e,...t}){const[n]=A("gap"),{siteGap:o}=t.field??{},r=Math.max(Te.min,It(e,n,o));return Fe({...Te,builtIn:r,resolve:a=>Ie(a)?a:r,action:(a,c)=>i(C,{words:y()?.panel,label:l("Gap"),changed:Ie(a),detail:B(d=>l(d),`${r}px`),onReset:()=>c(void 0)})}).render(t)}function Yr({container:e,...t}){const[n]=A("gap"),{siteGap:o,siteGapPhone:r}=t.field??{},s=Et(e,void 0,n,o,r);return Fe({...Te,builtIn:s,resolve:c=>Et(e,c,n,o,r),action:(c,d)=>i(C,{words:y()?.panel,label:l("Gap"),changed:Ie(c),detail:D(`${s}px`,hr(e,n,r)?l("Styles"):l("Desktop")),onReset:()=>d(void 0)})}).render(t)}function Bs(e){return Hr({offered:nr(e),fallback:wt(e,void 0),resolve:t=>wt(e,t)})}function Ds(e,t){return wn(t?bn(e,t):[],t)}function qr({inherited:e,onReset:t,label:n}){return i(C,{words:y()?.panel,label:l(n),changed:!e,detail:D(l("Full"),l("the page")),onReset:t})}function H({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:s,hideable:a=!0,markup:c=!0}){const{text:d,hidden:f}=Ke(e),m=V(null),p=V(null),u=_=>t(a?{text:_,hidden:f}:_),g=()=>t({text:d,hidden:!f}),h=a&&f,w=Ue(),x=r?ti(r)?i("span",{className:"sf-hint-while-typing",children:l(r)}):l(r):void 0,b=f?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return i(S,{label:l(n),icon:i(Un,{}),htmlFor:w,className:h?"is-hidden":void 0,hint:x,action:a?i(we,{content:b,children:i(ut,{"aria-pressed":f,"aria-label":b,onClick:g,children:f?i(gt,{name:"eye-off",size:14}):i(gt,{name:"eye",size:14})})}):void 0,children:N("div",{className:"sf-copybox",children:[c&&i(ht,{target:s?p:m,value:d,onChange:u}),s?i("textarea",{id:w,ref:p,value:d,placeholder:o===void 0?void 0:l(o),onChange:_=>u(_.target.value)}):i("input",{id:w,ref:m,type:"text",value:d,placeholder:o===void 0?void 0:l(o),onChange:_=>u(_.target.value)})]})})}function Hs(e,t){return{...e,[Ve]:t}}function Gs(e){const t=e[O];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[O]:{...t,offPage:!0}}}function Ms(e){return!e||typeof e!="object"?!1:e[O]?.offPage===!0}const Lt="sfPanelOnly";function Us(e){if(!e[O])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Lt]:!0}}function Ws(e){return!!e&&typeof e=="object"&&e[Lt]===!0}function Ks(e){const t=e[O];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[O]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as nc,SCALAR_TEXT_CONTROLS as oc}from"efficient-easel/draw";function $s(e,t){if(!e[O])throw new Error("inOwnBox: the field holds no authored text");const{[Io]:o,...r}=e;return{...r,[ko]:!0,render:t}}const Jr=new Set(Ho),Q={type:"radio",options:[{value:!0},{value:!1}]},Nt={text:{type:"object",objectFields:{text:{type:"text"},hidden:Q}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:Q}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},G=(e,t)=>{const n=E({...t,[O]:e},{...Nt[e.control],label:e.label});if(!Jr.has(e.control))return n;const o=t.render;return{...mt(n,"authored-copy"),render:r=>i(Ao,{name:r.name,children:o(r)})}},Xs="Everything else on this block comes from the linked post. Unlink it to edit by hand.",Zr={field:"source.slug",set:!0},js={not:Zr},Qr="Select a word, then press the highlighter.",ei=new Set([Qr]),ti=e=>ei.has(e);function Vs(e,t,n){return G({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function zs(e,t,n){return G({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function Ys(e,t,n){return G({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function qs(e,t,n){return G({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function Js(e){return{type:"custom",[Xe]:{label:e},...E({},{type:"text",label:e}),render:({value:t,onChange:n})=>i(Ko,{value:$e(t),onChange:n,label:e})}}function Zs(e,t,n){return G({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const Qs={Design:yn,Animation:_n};function ea(e){return{type:"custom",render:()=>i(ni,{text:e})}}function ni({text:e}){return i("p",{className:"sf-note",children:l(e)})}function ta(e){return fe(e)!==null&&e?.tabs!==void 0}const Pt=new Map;function na(e,t){const n=`${e}\0${t?t.join(""):""}`,o=Pt.get(n)??{type:"custom",tabs:t,[pe]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(k,{})};return Pt.set(n,o),o}const vt=new Map;function oa(e){const t=vt.get(e)??{type:"custom",[pe]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(k,{})};return vt.set(e,t),t}function oi(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function ra(e,t){return oi(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(k,{})}}function ia(e){const t=e;if(t.marker===!0&&t.fold===void 0)return e;const{fold:n,...o}=e;return{...o,marker:!0,render:()=>i(k,{})}}function la({title:e,children:t}){const[n,o]=z(()=>!Le.has(e));return i(qn,{title:e,open:n,onToggle:r=>{o(r),r?Le.delete(e):Le.add(e)},children:t})}const Le=new Set;function sa({label:e}){return i(Jn,{title:l(e),level:Pr(2)})}function ri({swatches:e,current:t,onPick:n,names:o}){const r=e.find(c=>c.toLowerCase()===t.toLowerCase()),s=r?o?.[r]:void 0,a=s?l(s):t;return N("div",{className:"sf-swatches",children:[e.map(c=>{const d=o?.[c]?l(o[c]):c;return i(we,{content:d,children:i(ho,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":d})},c)}),i("span",{className:"sf-swatch-hex",children:a})]})}function aa(e,t,n=!1){return{type:"custom",render:({value:o,onChange:r})=>i(ii,{label:e,builtIn:t,followsBand:n,value:o,onChange:r})}}function ii({label:e,builtIn:t,followsBand:n,value:o,onChange:r}){const s=typeof o=="string"?o:void 0,{colors:a,n:c}=Be(),d={background:a.background,surface:a.surface,surface2:pr(a),band:ur(a)},f=n?Ee:t,m=Or(s,t,f),p=kt(void 0,f,d),u=n?_r:void 0,g=f===Ee?l("the theme's section background"):l("Theme {n} background",{n:c}),h=li(s,t,a,c,d,r),w=D(p.toUpperCase(),g),x=xe(s),b=x?re(x,a,c):null;return b?i(oe,{label:l(e),icon:i(Je,{}),value:b.hex,caption:b.words,onChange:r,changed:!0,onReset:()=>r(u),resetTo:w,choices:h}):i(ft,{label:l(e),icon:i(Je,{}),value:m?"":kt(s,t,d),inherited:p,resetTo:w,onChange:r,onReset:()=>r(u),choices:h})}function li(e,t,n,o,r,s){const a=Tr(e,t);return[{label:l("No fill"),color:"",selected:a==="none",onPick:()=>s(Rr)},{label:`${l("Section band")} · ${r.band.toUpperCase()}`,color:r.band,selected:a==="band",onPick:()=>s(Ee)},...ve(xe(e)??"",n,o,s)]}function si(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,s=Sr(r,t);return i(S,{label:l(e),icon:i(me,{}),changed:!s,action:i(C,{words:y()?.panel,label:l(e),changed:!s,detail:l("the theme's image stage"),onReset:()=>o(gr)}),children:ri({swatches:xr,current:s?Cr:yr(r,t),onPick:o,names:wr})})}}}function ca(e=n=>n,t){return J({_gSectionTheme:T(Ir),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(Uo,{value:e(n),onChange:o,followLabel:t})}})}function ee({min:e,max:t,step:n,value:o,onChange:r,suffix:s="",readout:a=!0,notch:c,ariaLabel:d,disabled:f=!1,placeholder:m,placeholderWord:p,onClear:u}){const g=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:g?"sf-slider has-notch":"sf-slider",style:g?{"--sf-notch":(c-e)/(t-e)}:void 0,children:i(_o,{min:e,max:t,step:n,value:o,...o===null&&m!==void 0?{placeholderValue:m}:{},...p?{emptyLabel:l(p)}:{},suffix:s||void 0,showInput:a,label:d===void 0?void 0:l(d),disabled:f,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:h=>{h===null?u?.():h!==o&&r(h)}})})}function Bt(e,t){const{min:n,max:o,step:r=1,unsetLabel:s,hint:a,restTrack:c,unsetMark:d,icon:f,unit:m="px"}=t;return{type:"custom",render:({value:p,onChange:u})=>{const g=typeof p=="number"?p:null,h=g===null;return i(S,{label:l(e),icon:f?q(f):void 0,value:h?d||s===void 0?void 0:l(s):`${g}${m}`,changed:!h,action:d?Ge(d,{changed:!h,onReset:()=>u(null)}):i(C,{words:y()?.panel,label:l(e),changed:!h,onReset:()=>u(null)}),hint:typeof a=="string"?l(a):a,children:c?c({min:n,max:o,step:r,px:g,label:e,onChange:u}):ee({min:n,max:o,step:r,value:g??n,readout:!1,ariaLabel:e,onChange:u})})}}}const ae="Corners";function Ne(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,r=o!==null;return i(S,{label:l(ae),icon:i(On,{}),changed:r,action:Ge(e.mark,{changed:r,onReset:()=>n(null)}),hint:e.hint,children:i(ci,{tier:e,px:o,onRadius:n})})}}}function A(e){const t=M();return[t?.values?.[e],n=>t?.onChange(e,n)]}function Dt(){return mt({type:"custom",render:()=>i(Eo,{})},"always")}function ai(){const e=M();return t=>e?.onChangeMany(t)}function ci({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),[r,s]=A(e.sidesKey),a=st(r)??[...lt];return i(mo,{label:l(ae),value:a,corners:Xn,onChange:c=>{const d=st(c)??[];s(d.length===lt.length?null:d)},radius:t,onRadiusChange:n,radiusMin:U,radiusMax:Ye,radiusStep:e.step??1,radiusPlaceholder:String(o)})}function Ht(){return Dt()}function di({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=v(),r=typeof o=="number"?`${o}px`:l("not set");return i(C,{words:y()?.panel,label:l(e),changed:t,detail:o==null?l("the built-in corners"):D(r,l("Styles")),onReset:n})}function ui(){const{cornerRadiusPx:e}=v();return typeof e=="number"?e:U}function pi(){return Ne({sidesKey:"sectionCornerSides",useFollowed:ui,mark:i(di,{label:ae}),hint:fi})}const fi="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function da(){return J({_gShape:T("Shape"),sectionCorners:pi(),sectionCornerSides:Ht(),...X("sectionBorder",Gt)})}const hi=()=>({width:l("Border width"),sides:{top:l("Border top"),right:l("Border right"),bottom:l("Border bottom"),left:l("Border left")},style:l("Border style"),styles:{solid:l("Solid"),dashed:l("Dashed"),dotted:l("Dotted")},color:l("Border color"),unit:"px"});function mi(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function gi(){let e;try{const t=Tt(v().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||cr.line}function bi({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:s=!0,above:a={}}){const c=e&&typeof e=="object"?e:{},[d,f]=z(()=>r?no(c,a):!1),m=hi(),p=u=>mi(r&&s?u:{width:u.width,color:u.color,...s?{style:u.style}:{}});return i(S,{label:l("Border"),icon:i(Rn,{}),action:r?i(eo,{each:d,label:l("Each side"),onChange:f}):void 0,children:i(Qn,{label:l("Border"),value:c,each:d,onChange:u=>t(p(u)),placeholder:n,presets:o,words:m,styles:s,max:ar})})}function wi({value:e,onChange:t,view:n}){const[o]=A("sectionBorder"),[r]=A(W("sectionBorder")),s=gi(),a=d=>d&&typeof d=="object"?d:{},c=n==="phone"?{...Rt(a(o)),...Rt(a(r))}:n==="tablet"?a(o):{};return i(bi,{value:e,onChange:t,placeholder:{sides:to(c),style:c.style??"solid",color:c.color||s},presets:[s],above:c})}function ua(e){return R(e,Gt(e==="mobile"?"phone":e))}function Gt(e){return{type:"custom",render:({value:t,onChange:n})=>i(wi,{value:t,onChange:n,view:e})}}function X(e,t){const n=(o,r)=>se(e,t(o),ke)[r];return{[e]:n("desktop",e),[W(e)]:n("tablet",W(e)),[F(e)]:n("phone",F(e))}}function pa(e){return{type:"custom",render:()=>i(xi,{partKey:e})}}function xi({partKey:e}){const[t]=A("id"),[n]=A("_partStyles"),{textStyles:o}=v(),r=zo();let s=null;try{s=Xo().select}catch{s=null}const a=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i(Yn,{name:l("Text"),preview:$o(a,c,{noStyle:l("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??Vo.copy.panel).cases}),onOpen:()=>{s&&typeof t=="string"&&s(jo(t,e))}})}function Mt(e){const{cornerRadiusPx:t}=v(),n=typeof t=="number"?t:e;let o=null;try{const{appState:s,selectedItem:a}=te(d=>d),c=a?.props?.id?String(a.props.id):void 0;o=c?zn(s?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return jn(r)?r:n}function Si({label:e,changed:t=!1,onReset:n=()=>{}}){const o=Mt(U);return i(C,{words:y()?.panel,label:l(e),changed:t,detail:D(`${o}px`,l("the section")),onReset:n})}function yi(){return i(k,{children:l("Follows the section's Corners until you set a number here.")})}function Ci(){return Ne({sidesKey:"cardCornerSides",useFollowed:()=>Mt(U),mark:i(Si,{label:ae}),hint:i(yi,{})})}function _i(){return{type:"custom",render:()=>i(ln,{})}}function fa(e){return{...e,render:t=>i(sn,{render:e.render,props:t})}}function ha(){return{_gShape:T("Shape"),cardCorners:Ci(),cardCornerSides:Ht(),cardCornersApplyAll:_i()}}function Ri(){return E({type:"custom",render:e=>i(Oi,{...e})},{type:"select",label:K,options:[{value:"content",label:"Fit content"},{value:"equal",label:"Equal"},{value:[50],label:"Custom: the width of each block in %, the last block left out"}]})}function Ti(e,t){const n=_t(e);if(n!=="custom")return l(Ct.find(r=>r.value===n)?.label??"");const o=dt(Re(e,t),t);return o?[...o,100-o.reduce((r,s)=>r+s,0)].join(" / "):l("Custom")}function Oi(e){const{value:t,onChange:n}=e,[o]=A("content"),r=Array.isArray(o)?o.length:0,s="follows"in e,a=t!=null,c=a?t:s?e.follows:void 0,d=_t(c),f=r>=2&&r<=ct,m=()=>[...So[r]??[]],p=V(null),u=b=>{const _=p.current;_&&JSON.stringify(b)===JSON.stringify(_.shares)?n(_.value):b&&n(b)},g=b=>{b===d||b==="custom"&&!f||n(b==="custom"?m():b)},h=l("The width bar works for 2 to {count} blocks.",{count:ct}),w=a&&(s||t!=="content"),x=Co().widths.hint(r,xo);return i(S,{label:l(K),icon:i(he,{}),changed:w,hint:d!=="custom"?void 0:f?x:h,action:i(C,{words:y()?.panel,label:l(K),changed:w,disabled:e.readOnly===!0,detail:s?B(b=>l(b),Ti(e.follows,r),e.followsView):l("Fit content"),onReset:()=>n(void 0)}),children:N("div",{className:"sf-share-row",children:[i("div",{className:"sf-share-pick",children:i(at,{label:l(K),value:d,options:Ct.map(b=>({value:b.value,label:b.value==="custom"&&!f?h:l(b.label),icon:Mr(i("span",{className:"sf-gallery-pic sf-share-pic",children:Ut(b.weights).map((_,j)=>i("i",{style:{gridColumn:`span ${_}`}},j))}),l(b.label),b.value==="custom"&&!f?h:l(b.label))})),onChange:g,columns:3,cell:Wt,tooltips:!1,disabled:e.readOnly===!0})}),d==="custom"&&f?i("div",{onFocus:()=>{p.current={value:t,shares:dt(Re(c,r),r)}},onBlur:()=>{p.current=null},children:i(yo,{label:l(K),count:r,value:Re(c,r),onChange:u,readOnly:e.readOnly===!0})}):null]})})}function Ut(e){if(!e)return[3,4];const t=e.reduce((n,o)=>n+o,0);return e.map(n=>Math.round(n/t*12))}function ma(){return Z(or,i(Ln,{}),xt,xt[0].value)}function ga(){return R("mobile",Gr(K,i(he,{}),sr.map(e=>({label:e.label,value:e.value,picture:i("span",{className:"sf-gallery-pic sf-share-pic",children:Ut(e.weights).map((t,n)=>i("i",{style:{gridColumn:`span ${t}`}},n))})})),lr,{columns:2,cell:Wt}))}const Wt={width:"5.75rem",height:"3.25rem"};function ba(){return se("share",Ri(),ke)[W("share")]}function Ii(){return R("mobile",$(St,i(Ze,{}),_e,ir,1,_e,"",{clear:{phoneFollows:!1,hint:_e}}))}const Kt={read:e=>e.phoneRow,write:(e,t,n)=>({phoneRow:n}),fieldKey:()=>"phoneRow",ownField:!0};function wa(){const e=$(St,i(Ze,{}),yt,rr,1,yt,"",{clear:{emptyLabel:"Auto"}}),t=se("columns",e,{...Kt,tablet:ke.tablet}),n=se("columns",e,Kt,{phoneRow:Ii()});return{...t,phoneRow:n.phoneRow}}function xa(e,t,n,o,r,s){return{type:"custom",render:({value:a,onChange:c})=>i(S,{label:l(e),icon:i(it,{noun:s}),action:i(C,{words:y()?.panel,label:l(e),changed:!Fr(a),detail:l("the Text style in Styles"),onReset:()=>c(kr),defaultAction:{onPress:()=>c(Er),title:l("Keep this section's own built-in size"),icon:i(Tn,{})}}),children:ee({min:t,max:n,step:o,value:typeof a=="number"?a:r,suffix:"px",ariaLabel:e,onChange:c})})}}function Sa(){return{_gCellWidth:T("Cell width"),gridSpan:Z("Positions",i(he,{}),[{label:"Auto",value:""},...Array.from({length:un},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function L(){let e=null,t=null;try{e=Me(Ei),t=te(n=>n).selectedItem}catch{t=null}return e??t?.props??{}}const Ei=zt(null);function ki({min:e,max:t,step:n,px:o,label:r,onChange:s,desktopKey:a,fallback:c}){const d=L()[a],f=Se(void 0,d,c);return i(k,{children:ee({min:e,max:t,step:n,value:Se(o,d,c),readout:!1,ariaLabel:r,notch:f,onChange:s})})}function Fi({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:s=()=>{}}){const a=L()[t],c=Se(void 0,a,n);return i(C,{words:y()?.panel,label:l(e),changed:r,detail:B(d=>l(d),`${c}${o}`),onReset:s})}function Ai(e){return Bt(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:i(Fi,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:t=>i(ki,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const Li={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Ni={Top:rt,Bottom:tt,Left:nt,Right:ot},Pi=e=>{const t=Ni[e];return i(t,{})};function ya(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=x=>Li[x],s=x=>$(r("Top"),i(rt,{}),I.min,I.max,I.step,x,"px"),a=(x,b,_,j=I)=>R("mobile",Ai({label:r(x),icon:Pi(x),desktopKey:b,min:j.min,max:j.max,step:j.step,fallback:_})),c=e.top??I.min,d=e.bottom??I.min,f="sectionPaddingLeft",m="sectionPaddingRight",p=e.sideBounds??I,u=e.side??p.min,g=e.sidePhone??u,h=e.phone===!0,w=x=>h?R("desktop",x):x;return J({...o?{_gSpacing:T("Padding")}:{},[t]:w(s(c)),...h?{[F(t)]:a("Top",t,c)}:{},...e.only==="top"?{}:{[n]:w($(r("Bottom"),i(tt,{}),I.min,I.max,I.step,d,"px")),...h?{[F(n)]:a("Bottom",n,d)}:{}},...e.sides?{[f]:w($(r("Left"),i(nt,{}),p.min,p.max,p.step,u,"px")),...h?{[F(f)]:a("Left",f,g,p)}:{},[m]:w($(r("Right"),i(ot,{}),p.min,p.max,p.step,u,"px")),...h?{[F(m)]:a("Right",m,g,p)}:{}}:{}})}function Ca(e,t){const n=Object.fromEntries(Object.entries(t).map(([s,a])=>[s,s in e&&fe(a)?e[s]:a])),o={};let r=!1;for(const[s,a]of Object.entries(e)){if(s in t){r||Object.assign(o,n),r=!0;continue}o[s]=a}return r||Object.assign(o,n),o}const ce="Width";function _a(e,t=Ar,n=!0){const o=t.map(r=>({label:Lr[r],value:r}));return J({...n?{_gWidth:T(ce)}:{},widthMode:{type:"custom",render:({onChange:r,field:s})=>i(S,{label:l(ce),icon:i(Wn,{}),action:n?i(qr,{inherited:s?.inherited??!1,onReset:()=>r(Nr),label:ce}):void 0,children:Ae({options:o,value:s?.currentValue||e,onChange:r,ariaLabel:ce})})}})}function Ra(){const e=(o,r)=>({type:"custom",render:({value:s,onChange:a})=>i(vi,{value:s,onChange:a,view:o,badge:r})}),t=o=>({type:"custom",render:({value:r,onChange:s,field:a})=>i(Di,{value:r,onChange:s,unit:a?.unit,view:o})}),n=o=>{const r=Wr("Unit",i(Qe,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");if(o==="desktop")return r;const s=r.render;return{...r,render:a=>i(Hi,{props:a,draw:s,view:o})}};return J({_gHeight:T(Y),...X("sectionHeightMode",o=>o==="desktop"?e(o):e(o,r=>i(Gi,{view:o,onClear:()=>r(void 0)}))),...X("sectionHeightValue",t),...X("sectionHeightUnit",n)})}function vi({value:e,onChange:t,view:n,badge:o}){const r=L(),s=c=>["auto","fixed","screen"].includes(c),a=de(n,r)?.mode??"auto";return i(S,{label:Y,icon:q(i(Pn,{})),action:o?o(t):void 0,children:Ae({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:s(e)?e:a,onChange:t,ariaLabel:Y})})}function $t(e,t){return e==="phone"&&ye(t)?Jo(t):qo(t)}function de(e,t){return e==="desktop"||(e==="tablet"?ye(t):Yo(t))?null:$t(e,t)}const P=(e,t)=>e==="tablet"?W(t):F(t);function Bi(e,t,n,o){const r=de(e,t);return!r||e==="desktop"?null:o===void 0?{}:{[P(e,"sectionHeightMode")]:r.mode,...r.mode==="fixed"?{[P(e,"sectionHeightUnit")]:r.unit}:{},...n==="sectionHeightUnit"?{[P(e,"sectionHeightValue")]:r.value}:{},[P(e,n)]:o}}function Xt(e,t,n){const o=M(),r=de(e,L());return!o||!r?{followed:null,write:n}:{followed:r,write:a=>o.onChangeMany(c=>{const d=Bi(e,c,t,a);return d===null?{[e==="desktop"?t:P(e,t)]:a}:Object.keys(d).length?d:null})}}function Di({value:e,onChange:t,unit:n,view:o}){const{followed:r,write:s}=Xt(o,"sectionHeightValue",t),a=(r?r.unit:n)==="%"?"%":"px",c=a==="%"?tr:er;return i("div",{className:"sf-field",children:ee({min:c.min,max:c.max,step:c.step,value:r?null:typeof e=="number"?e:c.fallback,...r?{placeholder:r.value}:{},suffix:a,ariaLabel:Y,onChange:s})})}function Hi({props:e,draw:t,view:n}){const{followed:o,write:r}=Xt(n,"sectionHeightUnit",e.onChange);return t({...e,...o?{value:void 0,storedValue:void 0,follows:o.unit}:{},onChange:r})}function Gi({view:e,onClear:t}){const n=L(),o=de(e,n)===null,r=e==="phone"&&ye(n),s=$t(e,n),a=B(c=>l(c),s.mode==="auto"?l("Auto"):`${s.value}${s.unit}`,r?"tablet":"desktop");return i(C,{words:y()?.panel,label:l(Y),changed:o,detail:a,onReset:t})}function Ta(){const e=n=>({type:"custom",render:({value:o,onChange:r,id:s,name:a})=>i(Wi,{value:o,onChange:r,labelId:`${s??a??"stickTop"}-label`,view:n})}),t=n=>({type:"custom",render:({value:o,onChange:r})=>i(Mi,{value:o,onChange:r,view:n})});return{_gStick:T(Ce),...X("stickTop",e),...X("stickTopDistance",t)}}function Mi({value:e,onChange:t,view:n}){const o=M(),r=L(),s=n==="desktop"||Pe(n,r)?null:jt(n,bt(r)),a=s&&o?c=>o.onChangeMany(d=>{const f=Ui(n,d,c);return f===null?{[P(n,"stickTopDistance")]:c}:Object.keys(f).length?f:null}):t;return i("div",{className:"sf-field",children:ee({min:ie.min,max:ie.max,step:ie.step,value:s?null:typeof e=="number"?e:ie.fallback,...s?{placeholder:s.distance}:{},suffix:"px",ariaLabel:l("Distance from top"),onChange:a})})}function Pe(e,t){return e==="tablet"?Qo(t):Zo(t)}function jt(e,t){return e==="phone"?{on:t.tablet,distance:t.tabletDistance}:{on:t.desktop,distance:t.desktopDistance}}function Ui(e,t,n){return e==="desktop"||Pe(e,t)?null:n===void 0?{}:{[P(e,"stickTop")]:!0,[P(e,"stickTopDistance")]:n}}function Wi({value:e,onChange:t,labelId:n,view:o}){const r=L(),s=bt(r),a=o==="phone"?s.phone:o==="tablet"?s.tablet:e===!0,c=o==="phone"&&s.ownTablet,d=o==="desktop"?null:jt(o,s),f=d?.on?`${d.distance}px`:l("Off");return i(S,{label:l(Ce),labelId:n,icon:q(i(Hn,{})),action:N(k,{children:[o!=="desktop"?i(C,{words:y()?.panel,label:l(Ce),changed:Pe(o,r),detail:B(m=>l(m),f,c?"tablet":"desktop"),onReset:()=>t(void 0)}):null,i(be,{checked:a,onChange:t,ariaLabelledBy:n})]})})}const Vt="e.g. about";function Oa(){return{_gAnchor:T("Anchor"),anchor:G({control:"plainText",label:"Name",placeholder:Vt},{type:"custom",render:({value:e,onChange:t})=>i(xn,{value:e,onChange:t,nameBox:(n,o)=>i(H,{value:n,onChange:o,label:"Name",placeholder:Vt,hideable:!1,markup:!1})})})}}function Ia(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:s,name:a})=>{const c=`${s??a??e}-datetime`,d=Date.parse(typeof o=="string"?o:"");return i(S,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(bo,{id:c,value:Number.isFinite(d)?new Date(d):null,onChange:f=>r(f?f.toISOString():"")})})}}}function Ea(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:s,name:a})=>{const c=`${s??a??e}-date`;return i(S,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(go,{id:c,value:Jt(typeof o=="string"?o:null),onChange:d=>r(d?qt(d):"")})})}}}function Ki(e,t,n,o){return{type:"custom",...E({},{...Q,label:e}),render:r=>{const{value:s,onChange:a,id:c,name:d}=r,f="follows"in r,m=r,p=typeof s=="boolean",u=typeof m.follows=="boolean"?m.follows:t,g=p?s:f?u:t,h=`${c??d??e}-label`,w=m.readOnly===!0,x=i(be,{checked:g,onChange:a,disabled:w,ariaLabelledBy:h});return i(S,{label:l(e),labelId:h,icon:n,hint:o===void 0?void 0:l(o),action:f?N(k,{children:[i(C,{words:y()?.panel,label:l(e),changed:p,detail:m.followsNoView?l(u?"On":"Off"):B(b=>l(b),l(u?"On":"Off"),m.followsView),disabled:w,onReset:()=>a(void 0)}),x]}):x})}}}function ka(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i($i,{label:"Background",icon:i(Dn,{}),id:r,value:e,shown:Kn(e),onChange:t})}}}function Fa(e,t){return{type:"custom",...E({},{...Q,label:e}),render:({value:n,onChange:o,id:r})=>{const s=typeof n=="boolean"?n:t,a=`${r??e}-checkbox`;return i(S,{label:l(e),htmlFor:a,className:"sf-checkbox",action:i(fo,{id:a,checked:s,onChange:o})})}}}function Aa(e,t,n){return{type:"custom",render:({value:o,onChange:r})=>i(oe,{label:l(e),icon:n,value:o||t,onChange:r})}}function $i({label:e,icon:t,id:n,value:o,shown:r,onChange:s}){const{colors:a,n:c}=Be(),d=xe(o),f=d?re(d,a,c):null;return i(oe,{label:l(e),icon:t,id:n,value:f?f.hex:r,caption:f?.words,onChange:s,choices:ve(d??"",a,c,s)})}function La(){return{type:"custom",render:e=>{const{value:t,onChange:n}=e,o=e;return i(Xi,{value:typeof t=="string"?t:"",onChange:n,twin:"follows"in e?{follows:o.follows,view:o.followsView}:void 0})}}}function ve(e,t,n,o){const r=ge(e);return To(t,n).map(s=>({label:s.label,color:s.value,selected:r===s.name,onPick:()=>o(s.name)}))}function Xi({value:e,onChange:t,twin:n}){const{colors:o,n:r}=Be(),s=o.background,a=D(s.toUpperCase(),l("Theme {n} background",{n:r})),c=ge(e),d=c?re(c,o,r):null,f=ve(e,o,r,t),m=n?()=>t(void 0):()=>t("");let p=s,u=a;if(n){const g=ge(n.follows),h=$n(n.follows),w=g?re(g,o,r):h?{hex:h,words:h.toUpperCase()}:null;p=w?.hex??s,u=B(x=>l(x),w?w.words:a,n.view)}return d?i(oe,{label:l("Fill"),icon:i(me,{}),value:d.hex,caption:d.words,onChange:t,changed:!0,onReset:m,resetTo:u,choices:f}):i(ft,{label:l("Fill"),icon:i(me,{}),value:e,inherited:p,resetTo:u,onChange:t,onReset:m,choices:f})}function ji(e,t,n){if((e?.content??[]).some(a=>a?.props?.id===t))return le(n);const r=Vn(e,t);if(r.length===0)return null;const s=le(Ft(n));if(s!==null)return s;for(let a=r.length-1;a>0;a-=1){const c=le(Ft(r[a].sectionAccent));if(c!==null)return c}return le(r[0].sectionAccent)}function Be(){const e=Tt(v().theme),[t]=A("sectionAccent");let n=null;try{const{appState:r,selectedItem:s}=te(c=>c),a=s?.props?.id?String(s.props.id):void 0;n=a?ji(r?.data,a,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{colors:dr(e.themes[o]),n:o+1}}const Vi=[{value:"0% 0%",label:"Top left"},{value:"50% 0%",label:"Top"},{value:"100% 0%",label:"Top right"},{value:"0% 50%",label:"Left"},{value:"50% 50%",label:"Center"},{value:"100% 50%",label:"Right"},{value:"0% 100%",label:"Bottom left"},{value:"50% 100%",label:"Bottom"},{value:"100% 100%",label:"Bottom right"}];function zi({label:e,value:t,onChange:n,points:o=Vi}){const r=o.map(s=>({...s,label:l(s.label),...s.title?{title:l(s.title)}:null}));return i(po,{label:l(e),value:t,points:r,onChange:n})}function Na(){return Dt()}const Pa={top:i(Fn,{}),right:i(kn,{}),bottom:i(In,{}),left:i(En,{})};function va(e,t,n,o,r,s,a){const c=p=>t.find(u=>u.value===p),d=p=>({value:p,label:"",disabled:!0,title:o}),f=p=>{const u=t.find(h=>h.cell===p);if(!u)return d(`missing-${p}`);const g=s?.[p];return g?{value:u.value,label:u.label,icon:g}:{value:u.value,label:u.label}},m=[d("corner-top-left"),f("top"),d("corner-top-right"),f("left"),d("centre"),f("right"),d("corner-bottom-left"),f("bottom"),d("corner-bottom-right")];return{type:"custom",render:({value:p,onChange:u})=>{const g=t.some(h=>h.value===p)?p:n;return i(S,{label:l(e),icon:r,value:c(g)?.label?l(c(g).label):a?l(a):"",children:zi({label:e,value:g,onChange:u,points:m})})}}}function Ba(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:s})=>i(Mo,{label:e,options:(s.options??t).map(a=>({...a,label:l(a.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:l(n)}:{}})}}function Da(e,t,n,o){return{type:"custom",options:t,fallback:n,...E({},{type:"select",label:e}),render:({value:r,onChange:s,field:a})=>i(Wo,{label:e,options:(a.options??t).map(c=>({...c,label:l(c.label)})),fallback:a.fallback??n,value:r,onChange:s,placeholder:o===void 0?void 0:l(o)})}}function Ha(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}const Ga=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function Ma(e,t,n){const o=Object.keys(We).map(r=>({label:We[r],value:r,picture:n[r]}));return{type:"custom",...E({},{type:"radio",label:e,options:o.map(r=>({value:r.value,label:r.label}))}),render:({onChange:r})=>i(qi,{label:e,icon:t,options:o,onChange:r})}}function Yi(e,t,n){const o=Zt(e,t,n);if(o!==void 0)return o==="save-makes-frame"?l("A frame is made from this video when you save the page."):o==="starts-dark"?l("This video starts dark, so no frame was made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="outside"?l("This video is on another website, so no frame can be made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="unsupported"?l("This video's file type gives no frame. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="failed"?l("No frame could be made from this video. It is tried again the next time you save the page. The slide shows its background colour while the video loads."):o==="image-no-frame"?l("The slide shows your Image while the video loads, because this video has no frame."):void 0;const r=en(e);return r==="frame-missing-image"?l("This video has no frame yet. The slide shows its image until one is made."):r==="frame-missing-surface"?l("This video has no frame yet. The slide shows its background colour until one is made."):r==="image-missing-frame"?l("No image yet. The slide shows the video's frame until you choose one."):r==="image-missing-surface"?l("No image yet. The slide shows its background colour until you choose one."):void 0}function qi({label:e,icon:t,options:n,onChange:o}){const r=M(),s=r?.values??{},a=Qt(s),c=Me(on),d=nn(c?.docId??null);let f=null;try{f=te(p=>p.appState.data)}catch{f=null}const m=tn(r?.id,f,d);return i(S,{label:l(e),icon:q(t),hint:Yi(s,m,c?.hasUnsavedEdits??!1),children:Ae({options:n,value:a,onChange:o,ariaLabel:e})})}function Ua(e,t,n,o={}){const r={type:"custom",[je]:!0,render:({value:s,onChange:a,name:c})=>i(Go,{value:s||"",onChange:a,fieldKey:c,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen,frameKey:o.frame}),...o.focus?{focusKey:o.focus}:{},...o.focusWhen?{focusWhen:o.focusWhen}:{}};return o.focus?R("each",r):r}const Wa={HeroSingle:["imageFocal"],HeroSlide:["videoFrame"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function Ji(e){const t=l(e.status??"");return e.ok&&typeof e.lat=="number"&&typeof e.lng=="number"?`${t} · ${e.lat.toFixed(4)}, ${e.lng.toFixed(4)}`:t}function Ka({value:e,onChange:t,label:n}){const o=e||{},r=M(),s=r?r.values!==r.node.props:!0,a=!!o.pending&&s,c=!!o.pending&&!s,d=!!Br(vr()).geocode,f=Ue(),m=(p,u)=>t({...o,[p]:u??void 0});return N(k,{children:[i(S,{label:l(n),icon:i(et,{}),action:d?i(we,{content:l("Find from the address (OpenStreetMap)"),children:i(ut,{"aria-label":l("Find from the address"),"aria-busy":a||void 0,disabled:a,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:i(Gn,{})})}):void 0,children:d&&o.status?i(Sn,{compact:!0,oneLine:!0,spaced:!1,status:a?"busy":o.ok&&!c?"found":"notfound",statusText:a?l("Finding…"):c?l(Ro):l(o.status),hint:Ji(o)}):null}),i(S,{label:l("Enter by hand"),labelId:f,icon:i(An,{}),action:i(be,{checked:!!o.manual,onChange:p=>t({...o,manual:p}),ariaLabelledBy:f})}),o.manual&&i(S,{label:l("Latitude, longitude"),icon:i(et,{}),children:N("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[i(pt,{value:typeof o.lat=="number"?o.lat:null,onChange:p=>m("lat",p),min:-90,max:90,step:1e-4,placeholder:l("Latitude")}),i(pt,{value:typeof o.lng=="number"?o.lng:null,onChange:p=>m("lng",p),min:-180,max:180,step:1e-4,placeholder:l("Longitude")})]})})]})}function Zi(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function Qi(e,t,n){const o=e.map(r=>({text:r?.text??""}));return t===null||t<0||t>=e.length?o:o.map((r,s)=>s===t?{text:n}:r)}function $a(e,t){return e===null?null:t>e?e:null}function el(e,t,n){if(n===null||n>=t.length)return null;for(let o=0;o<n;o+=1)if(e[o]!==t[o])return null;return e[n]!==t[n]&&t.includes(e[n])||e[n]!==t[n]&&t.length!==e.length?null:n}const Xa={label:"Ticker items",icon:i(Bn,{})};function ja(e,t,n,o){return{type:"custom",[O]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...E({},{...Nt.textList,label:e}),render:({value:r,onChange:s})=>i(tl,{label:e,icon:q(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:s,markup:o==="markup"})}}function tl({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:s=!1}){const a=V(null),[c,d]=z(null),f=p=>p.map(u=>({text:u?.text??""})),m=p=>{const u=el(n,p,c);u===null&&(a.current=null),d(u),r(f(p))};return i(oo,{label:l(e),icon:t,noun:l("item"),items:n,onChange:m,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:s?i(ht,{target:a,value:Zi(n,c),onChange:p=>r(Qi(n,c??-1,p)),disabled:c===null,label:c===null?l("Formatting — click a row first"):l("Formatting — row {n}",{n:c+1})}):void 0,renderRow:(p,u,g)=>i("input",{type:"text",className:s&&c===u?"sf-list-marking":void 0,value:p?.text??"",placeholder:l(o),"aria-label":l("{label} {n}",{label:l(e),n:u+1}),onChange:h=>g({text:h.target.value}),onFocus:h=>{a.current=h.currentTarget,d(u)}})})}function Va(e,t){const n=`${e.label} — row ${t+1}`;return G({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:l("{label} — row {n}",{label:l(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function za(e){return{_gCards:T("Cards"),coverIndex:Z("Cover image",i(vn,{}),Bo,String(Do),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:si("Image background",br),cardImage:rl()}}function Ya(){return{outline:Z("Card outline",i(Mn,{}),No,vo),indexBadge:Z("Card number",i(Qe,{}),Lo,Po),showBadge:Ki("Product badge",!0,i(it,{noun:"tag"}))}}function qa(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...Q,label:ue.find(s=>s.id===r).label}),o=r=>E(Oo(De),n(r));return{_gShowOnCard:T("Show on a card"),[De]:E({type:"custom",render:()=>i(nl,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(De)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const De="showCardPrice",ue=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function nl({rest:e}){const t=L(),n=ai(),o=a=>typeof t[a]=="boolean"?t[a]:void 0,r=a=>o(a)??e[a],s=ue.some(({id:a})=>o(a)!==void 0&&o(a)!==e[a]);return i(He,{parts:ue,changed:s,shown:r,onPress:(a,c)=>n({[a]:c}),onReset:()=>n(Object.fromEntries(ue.map(({id:a})=>[a,void 0])))})}function Ja(e,t="display"){const n=F(t);return{[t]:R("desktop",{type:"custom",render:({value:o,onChange:r})=>i(He,{parts:e,changed:io(o),shown:s=>lo(o,s),onPress:(s,a)=>r(co(o,s,a)),onReset:()=>r(void 0)})}),[n]:R("mobile",{type:"custom",render:({value:o,onChange:r})=>i(ol,{parts:e,desktopKey:t,value:o,onChange:r})})}}function He({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:s,disabledReason:a}){const c=l("Display");return i(S,{label:c,icon:i(Cn,{}),changed:t,action:i(C,{words:y()?.panel,label:c,changed:t,detail:s,onReset:r}),children:i(ro,{label:c,items:e.map(d=>({id:d.id,label:l(d.label),shown:n(d.id),...a?{disabled:!0,disabledReason:l(a)}:{}})),onChange:o})})}function ol({parts:e,desktopKey:t,value:n,onChange:o}){const r=L()[t];return i(He,{parts:e,changed:ao(n),shown:s=>so(r,n,s),onPress:(s,a)=>o(uo(n,s,a)),onReset:()=>o(Fo),detail:l("the same as Desktop")})}function rl(){return Bt("Card image",{min:U,max:Ye,step:an,hint:"Rounds the picture. The card's own corner is in Styles."})}function Za(){return Ne({sidesKey:"cornerSides",step:cn,useFollowed:()=>U,mark:i(il,{label:dn}),hint:l("Rounds the picture. Left alone it stays square.")})}function il({label:e,changed:t=!1,onReset:n=()=>{}}){return i(C,{words:y()?.panel,label:l(e),changed:t,onReset:n})}function Qa(){return{type:"custom",render:({value:e,onChange:t})=>i(cl,{value:typeof e=="string"?e:"",onChange:t})}}function ll({layout:e,width:t}){const n=hn(e),o=n?`${n[0]}/${n[1]}`:void 0;return i("span",{"aria-hidden":"true",style:{display:"grid",width:t,gridTemplateColumns:"repeat(12, minmax(0, 1fr))",gridAutoRows:o?"auto":6,gridAutoFlow:"row dense",gap:2},children:mn(e).map(([r,s],a)=>i("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${r}`,gridRow:`span ${s}`,aspectRatio:o}},a))})}const sl={width:"3.5rem",height:"2.5rem"},al=200;function cl({value:e,onChange:t}){const[n,o]=z(null),[r,s]=z(4),a=V(null);Yt(()=>{const u=a.current;if(!u||typeof ResizeObserver!="function")return;const g=()=>s(u.getBoundingClientRect().width>=al?4:3);g();const h=new ResizeObserver(g);return h.observe(u),()=>h.disconnect()},[]);const c=e&&e in ne?e:"",d=qe(n,c),f=qe(n,"").length,m=gn("no-symbol"),p=[{value:"",label:l("Not chosen"),icon:Ur(m,l("Not chosen"))},...d.map(u=>({value:u,label:l(ne[u].label),icon:i(ll,{layout:ne[u],width:40})}))];return i(S,{label:l("Layout"),icon:i(Nn,{}),value:c?l(ne[c].label):void 0,children:i("div",{ref:a,style:{flex:"1 1 auto",minWidth:0},children:i(at,{label:l("Layout"),value:c,options:p,onChange:t,columns:r,cell:sl,header:N("div",{className:"mb-2 flex flex-col gap-1",style:{minWidth:"11rem"},children:[i("span",{className:"text-2xs text-ink-faint",children:l("Photos in a row")}),i(Zn,{options:[{id:"all",label:l("All")},...pn.map(u=>({id:String(u),label:String(u)}))],value:n===null?"all":String(n),ariaLabel:l("Photos in a row"),onChange:u=>o(u==="all"?null:Number(u))}),i("span",{className:"text-2xs text-ink-faint",children:l("{n} of {total} layouts",{n:f,total:fn.length})})]})})})})}export{Zr as BOUND_TO_POST,Xs as BOUND_TO_POST_NOTE,Qs as BUCKET_ICONS,Wa as CUSTOM_FIELD_MEDIA,Ka as CoordsField,At as DESKTOP_GAP_NOT_OVERLAP,He as DisplayRow,Pa as EDGE_ARROWS,wo as FOCAL_DEFAULT,Vi as FOCAL_POINTS,pe as FOLD_FIELD_MARKER,zi as FocalPicker,sa as GroupLabel,Qr as HIGHLIGHT_HINT,H as HidableTextField,Xe as LINK_FIELD_MARKER,Ps as Label,je as MEDIA_FIELD_MARKER,Ga as MEDIA_TYPE_OPTIONS,js as NOT_BOUND_TO_POST,la as PanelBand,ni as PanelNoteLine,Ei as RowPropsContext,Ve as SCAFFOLD_FIELD_MARKER,oc as SCALAR_TEXT_CONTROLS,$r as SiteGapDefaultReset,ee as Slider,ri as Swatches,nc as TEXT_CONTROL_KINDS,O as TEXT_FIELD_MARKER,Xa as TICKER_ITEMS_ROW,tl as TextListField,$i as ThemeFillRow,ce as WIDTH_LABEL,qr as WidthDefaultReset,el as aimAfterListChange,Oa as anchorFields,D as backTo,aa as backgroundField,ma as boxBlockSpacingField,wa as boxColumnsFields,La as boxFillField,Ii as boxPhoneRowField,Ri as boxShareField,ga as boxSharePhoneField,ba as boxShareTabletField,ji as boxThemeIndexOf,na as bucketHeader,pa as buttonWordsEntryField,Ci as cardCornersField,si as cardImageBackgroundField,rl as cardImageField,za as cardMediaFields,ha as cardShapeFields,qa as cardShowFields,Ya as cardStyleFields,Sa as cellWidthFields,Fa as checkbox,Aa as colorInput,Bs as containerDirectionField,Xr as containerGapField,jr as containerGapPhoneField,vs as containerGapRows,Vr as containerGapTabletField,Ji as coordsResultTip,qs as copyText,Ht as cornerSidesField,Ne as cornersRowField,Ea as date,Ia as dateTime,oa as designGroupHeader,Ja as displayFields,va as edgePad,ve as fillSlotChoices,$a as focusAfterRemove,Na as focusKeptField,ra as foldMarker,fe as foldMetaOf,oi as foldTitleOf,Bi as followedHeightPatch,Ui as followedStickPatch,Qa as galleryLayoutField,Ra as heightFields,de as heightFollowedBy,Ds as heroGroupPlacementPoints,$e as hidableText,ti as hintIsWhileTyping,Za as imageCornersField,$s as inOwnBox,ta as isBucketHeader,Dt as keptBy,Js as linkField,Yi as loadingRowHint,Ma as loadingShowsField,Ba as multiSelect,ka as pageBackgroundField,ea as panelNote,Ai as phoneOverrideField,Ys as plainText,Zs as plainTextarea,Bt as pxField,ia as quietMarker,Ke as readHidable,Zi as rowText,Da as searchSelect,li as sectionBandChoices,ua as sectionBorderField,pi as sectionCornersField,da as sectionShapeFields,ca as sectionThemeFields,Qi as setRowText,xa as sizeField,Ha as sourceField,ya as spacingFields,Ta as stickFields,Ca as swapPadding,fa as templateField,Vs as text,rn as textFieldIdentifier,Ms as textFieldOffPage,Ws as textFieldPanelOnly,ja as textList,Va as textListRowField,zs as textarea,Ki as toggle,Ua as upload,ai as useSelectedPatch,L as useSelectedProps,A as useSelectedSibling,Kr as useSiteGapDetail,_a as widthField,Ks as withIdentifier,Gs as withOffPage,Us as withPanelOnly,Hs as withScaffold};
1
+ "use client";import{jsx as i,jsxs as A,Fragment as k}from"react/jsx-runtime";import{cloneElement as Ge,createContext as zt,useContext as Me,useEffect as Yt,useId as Ue,useRef as V,useState as z}from"react";import{useEasel as te,useSelectedHost as M}from"efficient-easel/easel";import{toDateKey as qt,fromDateKey as Jt}from"efficient-shell/format";import{say as l,editorEaselWords as y}from"../../../format/lib/editor-words.js";import{LOADING_SHOWS_LABELS as We,firstFrameHint as Zt,loadingShowsOf as Qt,loadingStillHint as en}from"../../../format/lib/hero-video.js";import{pageFramesFor as tn,usePageVideoFrames as nn}from"../page-video-frames.js";import{ScreenDocumentContext as on}from"efficient-easel/screen/components/ScreenDocumentContext";import{readHidable as Ke,hidableText as $e}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as pe,LINK_FIELD_MARKER as Xe,MEDIA_FIELD_MARKER as je,SCAFFOLD_FIELD_MARKER as Ve,TEXT_FIELD_MARKER as O,foldMetaOf as fe,textFieldIdentifier as rn}from"efficient-easel/draw";import ln from"../../components/ApplyCornersToSiblings.js";import{withShowWhen as ze}from"../../../render/lib/document/show-when.js";import sn from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as an,CORNER_RADIUS_MAX as Ye,CORNER_RADIUS_MIN as U}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as cn,IMAGE_CORNERS_LABEL as dn}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as un}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as pn,GALLERY_LAYOUTS as ne,GALLERY_LAYOUT_KEYS as fn,galleryChoices as qe,galleryLayoutRatio as hn,galleryPictureCells as mn}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as gn}from"./shell-glyph.js";import{anchorSiblingsOf as bn,placementPoints as wn}from"../../../format/lib/hero-group-placement.js";import xn from"../../components/AnchorField.js";import Sn from"../../components/SourceStatus.js";import{AdjustIcon as yn,EyeIcon as Cn,AnimationIcon as _n,BackgroundIcon as Je,BorderAllIcon as Rn,BlockSectionIcon as Tn,ColumnWidthsIcon as he,ColumnsIcon as Ze,CornerIcon as Qe,DirectionDownIcon as On,DirectionLeftIcon as In,DirectionRightIcon as En,DirectionUpIcon as kn,EditIcon as Fn,GapIcon as Ln,GridIcon as Nn,GroundIcon as me,HashIcon as et,HeightIcon as An,ImageIcon as Pn,ListIcon as vn,LocationIcon as tt,PaddingBottomIcon as nt,PaddingLeftIcon as ot,PaddingRightIcon as rt,PaddingTopIcon as it,PageIcon as Bn,StickyIcon as Dn,SearchIcon as Hn,SquareIcon as Gn,TypeIcon as Mn,WidthIcon as Un}from"efficient-easel/icons";import{FieldGlyph as lt}from"../../components/FieldGlyph.js";import{resolvePageBackground as Wn}from"../../../format/lib/content/page-background.js";import{boxFillOf as Kn,boxFillSlot as ge}from"../../../format/lib/content/box-background.js";import{CORNER_SIDES as st,CORNER_SIDE_POINTS as $n,hasOwnSectionCorners as Xn,normalizeCornerSides as at}from"../../../format/lib/content/section-corners.js";import{enclosingPath as jn,enclosingSection as Vn}from"./enclosing-section.js";import{SettingsDefaultReset as C,SettingsDrill as zn,SettingsField as S,SettingsGroup as Yn,SettingsGroupSub as qn,SettingsSegmented as Jn,SettingsBorder as Zn,SettingsSidesEach as Qn,SettingsSwitch as be,borderSides as eo,borderStartEach as to}from"efficient-easel/panel";import{ListField as no}from"efficient-easel/fields";import{DisplayChips as oo}from"efficient-shell/ui";import{desktopDisplayChanged as ro,partShownOnDesktop as io,partShownOnPhone as lo,phoneDisplayChanged as so,withDesktopPart as ao,withPhonePart as co}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as uo,Checkbox as po,ColorSwatch as fo,CornersInput as ho,DatePicker as mo,DateTimePicker as go,FOCAL_DEFAULT as bo,IconPicker as ct,COLUMN_COUNT_MAX as dt,COLUMN_SHARE_MIN as wo,COLUMN_SHARES_EQUAL as xo,resolveColumnShares as ut,WidthsBar as So,useShellStrings as yo,IconButton as pt,InputNumber as ft,Slider as Co,Tooltip as we}from"efficient-shell/ui";import{LOOKUP_BUSY_NOTE as _o}from"./geocode-resolve.js";import{ColourRow as oe,InheritedColourRow as ht}from"./ColourControl.js";import{fillThemeColors as Ro,slotFill as re}from"../../../format/lib/document/theme-slots.js";import{fillSlotNamed as xe}from"../../../format/lib/document/part-inks.js";import{keptByRow as To}from"efficient-easel/screen/lib/document/style-fields";import mt from"./MarkupToolbar.js";import{deviceField as R}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as Oo,NoControlMark as Io,noControlField as gt}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as Eo}from"../../../format/lib/document/own-box.js";import{fieldPanelOnly as ko,PANEL_ONLY_FIELD as Fo}from"../../../format/lib/document/panel-only.js";import{PHONE_CLEAR as Lo,resolvePhoneValue as Se}from"../../../format/lib/document/phone-override.js";import{phoneKey as F,tabletKey as W}from"efficient-easel/draw";import{SuppressibleText as No}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Ao,CARD_OUTLINE_OPTIONS as Po,DEFAULT_CARD_INDEX_FORMAT as vo,DEFAULT_CARD_OUTLINE as Bo}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as Do,DEFAULT_COVER_INDEX as Ho}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as Go}from"efficient-easel/draw";import Mo from"../../components/MediaUploadField.js";import Uo from"../../components/MultiSelectField.js";import Wo from"../../components/SectionThemePicker.js";import Ko from"../../components/SearchSelectField.js";import $o from"../../components/StorefrontLinkField.js";import{UiIcon as bt}from"efficient-easel/draw/client";import{SECTION_PADDING as I}from"../../../render/lib/content/section-padding.js";import{buttonWordsSummary as Xo}from"../../../render/lib/content/button-look.js";import{usePreviewParts as jo}from"efficient-easel/draw/client";import{encodePartId as Vo}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as zo,useEaselStrings as Yo}from"efficient-easel/strings";import{hasPhoneHeight as qo,hasTabletHeight as ye,resolveSectionMinHeight as Jo,resolveTabletHeight as Zo}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as ie,SECTION_STICK_LABEL as Ce,hasPhoneStick as Qo,hasTabletStick as er,resolveSectionStick as wt}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as tr,SECTION_MIN_HEIGHT_GROUP_LABEL as Y,SECTION_SCREEN_PCT as nr}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as or,resolveContainerDirection as xt}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as rr,BOX_BLOCK_SPACING_POINTS as St,BOX_PHONE_ROW_LABEL as yt,BOX_COLUMNS_MAX as ir,BOX_COLUMNS_MIN as Ct,BOX_PHONE_ROW_MAX as lr,BOX_PHONE_ROW_MIN as _e,BOX_SHARE_CHOICES as _t,BOX_SHARE_LABEL as K,boxShareChoiceOf as Rt,boxShareWidthsOf as Re,BOX_SHARE_PHONE_DEFAULT as sr,BOX_SHARE_PHONE_POINTS as ar}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as v}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as cr,borderBySide as Tt}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as dr,normalizeTheme as Ot,normalizeThemeColors as ur,sectionBandTone as pr,surfaceTwoTone as fr}from"../../../format/lib/theme.js";import{CONTAINER_GAP as It,CONTAINER_GAP_BUILT_IN as hr,CONTAINER_GAP_PHONE as Te,GAP_FIELD_CONTAINER as Oe,followsSitePhoneGap as mr,hasOwnContainerGap as gr,hasOwnPhoneGap as Ie,resolveContainerGap as Et,resolvePhoneContainerGap as kt}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as br,CARD_IMAGE_BG_OFF as wr,CARD_IMAGE_BG_SWATCH_NAMES as xr,CARD_IMAGE_BG_SWATCHES as Sr,isCardImageBackgroundInheriting as yr,cardImageBackgroundChoice as Cr,THEME_CARD_IMAGE_BG as _r}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as Rr,SECTION_BG_NO_FILL as Tr,sectionBackgroundChoice as Or,THEME_SECTION_BG as Ee,isSectionBackgroundEmpty as Ir,sectionBackgroundHex as Ft}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as Er,nestedAccentValue as Lt,resolveSectionAccent as le}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as kr,TYPE_SIZE_INHERIT as Fr,isTypeSizeInheriting as Lr}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as Nr,WIDTH_CHOICE_LABEL as Ar,WIDTH_INHERIT as Pr}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as vr}from"./panel-heading-scope.js";import{useEaselSession as Br}from"efficient-easel/screen/lib/session-context";import{backendOf as Dr}from"../website-session.js";import{BOX_GAP as Hr,describedAs as E,group as T,iconOf as q,sharedStyleKinds as J}from"efficient-easel/screen/lib/document/box-fields";import{VIEW_KEY_ACCESS as ke,onDesktopWords as B,phoneTwinFields as se}from"efficient-easel/screen/lib/document/box-fields";import{directionField as Gr,gapField as Fe,iconPickerRow as Mr,pickerCellIcon as Ur,pickerNoneIcon as Wr,Segmented as Le,segmented as Kr,select as Z,slider as $}from"./box-fields.js";function Bs({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function D(e,t){return l("{value} from {from}",{value:e,from:t})}function $r(){const{blockGap:e}=v();return e===null?l("this container's own spacing"):D(`${e}px`,l("Styles"))}function Xr({inherited:e,onReset:t,label:n}){return i(C,{words:y()?.panel,label:l(n),changed:!e,detail:$r(),onReset:t})}function jr(e){return Fe({...Hr,builtIn:hr[e],resolve:(t,n)=>Et(e,t,n?.siteGap),action:(t,n)=>i(Xr,{inherited:!gr(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[Oe]:e}})}function Vr(e){return ze(R("mobile",{[Oe]:e,type:"custom",render:t=>i(qr,{container:e,...t})}),Nt)}function zr(e){return ze(R("tablet",{[Oe]:e,type:"custom",render:t=>i(Yr,{container:e,...t})}),Nt)}const Nt={not:{field:"gap",in:Array.from({length:-It.min},(e,t)=>It.min+t)}};function Ds(e){return{gap:R("desktop",jr(e)),[W("gap")]:zr(e),[F("gap")]:Vr(e)}}function Yr({container:e,...t}){const[n]=L("gap"),{siteGap:o}=t.field??{},r=Math.max(Te.min,Et(e,n,o));return Fe({...Te,builtIn:r,resolve:a=>Ie(a)?a:r,action:(a,c)=>i(C,{words:y()?.panel,label:l("Gap"),changed:Ie(a),detail:B(d=>l(d),`${r}px`),onReset:()=>c(void 0)})}).render(t)}function qr({container:e,...t}){const[n]=L("gap"),{siteGap:o,siteGapPhone:r}=t.field??{},s=kt(e,void 0,n,o,r);return Fe({...Te,builtIn:s,resolve:c=>kt(e,c,n,o,r),action:(c,d)=>i(C,{words:y()?.panel,label:l("Gap"),changed:Ie(c),detail:D(`${s}px`,mr(e,n,r)?l("Styles"):l("Desktop")),onReset:()=>d(void 0)})}).render(t)}function Hs(e){return Gr({offered:or(e),fallback:xt(e,void 0),resolve:t=>xt(e,t)})}function Gs(e,t){return wn(t?bn(e,t):[],t)}function Jr({inherited:e,onReset:t,label:n}){return i(C,{words:y()?.panel,label:l(n),changed:!e,detail:D(l("Full"),l("the page")),onReset:t})}function H({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:s,hideable:a=!0,markup:c=!0}){const{text:d,hidden:f}=Ke(e),m=V(null),p=V(null),u=_=>t(a?{text:_,hidden:f}:_),g=()=>t({text:d,hidden:!f}),h=a&&f,w=Ue(),x=r?ni(r)?i("span",{className:"sf-hint-while-typing",children:l(r)}):l(r):void 0,b=f?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return i(S,{label:l(n),icon:i(Mn,{}),htmlFor:w,className:h?"is-hidden":void 0,hint:x,action:a?i(we,{content:b,children:i(pt,{"aria-pressed":f,"aria-label":b,onClick:g,children:f?i(bt,{name:"eye-off",size:14}):i(bt,{name:"eye",size:14})})}):void 0,children:A("div",{className:"sf-copybox",children:[c&&i(mt,{target:s?p:m,value:d,onChange:u}),s?i("textarea",{id:w,ref:p,value:d,placeholder:o===void 0?void 0:l(o),onChange:_=>u(_.target.value)}):i("input",{id:w,ref:m,type:"text",value:d,placeholder:o===void 0?void 0:l(o),onChange:_=>u(_.target.value)})]})})}function Ms(e,t){return{...e,[Ve]:t}}function Us(e){const t=e[O];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[O]:{...t,offPage:!0}}}function Ws(e){return!e||typeof e!="object"?!1:e[O]?.offPage===!0}function Ks(e){if(!e[O])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Fo]:!0}}function $s(e){return ko(e)}function Xs(e){const t=e[O];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[O]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as rc,SCALAR_TEXT_CONTROLS as ic}from"efficient-easel/draw";function js(e,t){if(!e[O])throw new Error("inOwnBox: the field holds no authored text");const{[Oo]:o,...r}=e;return{...r,[Eo]:!0,render:t}}const Zr=new Set(Go),Q={type:"radio",options:[{value:!0},{value:!1}]},At={text:{type:"object",objectFields:{text:{type:"text"},hidden:Q}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:Q}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},G=(e,t)=>{const n=E({...t,[O]:e},{...At[e.control],label:e.label});if(!Zr.has(e.control))return n;const o=t.render;return{...gt(n,"authored-copy"),render:r=>i(No,{name:r.name,children:o(r)})}},Vs="Everything else on this block comes from the linked post. Unlink it to edit by hand.",Qr={field:"source.slug",set:!0},zs={not:Qr},ei="Select a word, then press the highlighter.",ti=new Set([ei]),ni=e=>ti.has(e);function Ys(e,t,n){return G({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function qs(e,t,n){return G({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function Js(e,t,n){return G({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function Zs(e,t,n){return G({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function Qs(e){return{type:"custom",[Xe]:{label:e},...E({},{type:"text",label:e}),render:({value:t,onChange:n})=>i($o,{value:$e(t),onChange:n,label:e})}}function ea(e,t,n){return G({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const ta={Design:yn,Animation:_n};function na(e){return{type:"custom",render:()=>i(oi,{text:e})}}function oi({text:e}){return i("p",{className:"sf-note",children:l(e)})}function oa(e){return fe(e)!==null&&e?.tabs!==void 0}const Pt=new Map;function ra(e,t){const n=`${e}\0${t?t.join(""):""}`,o=Pt.get(n)??{type:"custom",tabs:t,[pe]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(k,{})};return Pt.set(n,o),o}const vt=new Map;function ia(e){const t=vt.get(e)??{type:"custom",[pe]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(k,{})};return vt.set(e,t),t}function ri(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function la(e,t){return ri(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(k,{})}}function sa(e){const t=e;if(t.marker===!0&&t.fold===void 0)return e;const{fold:n,...o}=e;return{...o,marker:!0,render:()=>i(k,{})}}function aa({title:e,children:t}){const[n,o]=z(()=>!Ne.has(e));return i(Yn,{title:e,open:n,onToggle:r=>{o(r),r?Ne.delete(e):Ne.add(e)},children:t})}const Ne=new Set;function ca({label:e}){return i(qn,{title:l(e),level:vr(2)})}function ii({swatches:e,current:t,onPick:n,names:o}){const r=e.find(c=>c.toLowerCase()===t.toLowerCase()),s=r?o?.[r]:void 0,a=s?l(s):t;return A("div",{className:"sf-swatches",children:[e.map(c=>{const d=o?.[c]?l(o[c]):c;return i(we,{content:d,children:i(fo,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":d})},c)}),i("span",{className:"sf-swatch-hex",children:a})]})}function da(e,t,n=!1){return{type:"custom",render:({value:o,onChange:r})=>i(li,{label:e,builtIn:t,followsBand:n,value:o,onChange:r})}}function li({label:e,builtIn:t,followsBand:n,value:o,onChange:r}){const s=typeof o=="string"?o:void 0,{colors:a,n:c}=Be(),d={background:a.background,surface:a.surface,surface2:fr(a),band:pr(a)},f=n?Ee:t,m=Ir(s,t,f),p=Ft(void 0,f,d),u=n?Rr:void 0,g=f===Ee?l("the theme's section background"):l("Theme {n} background",{n:c}),h=si(s,t,a,c,d,r),w=D(p.toUpperCase(),g),x=xe(s),b=x?re(x,a,c):null;return b?i(oe,{label:l(e),icon:i(Je,{}),value:b.hex,caption:b.words,onChange:r,changed:!0,onReset:()=>r(u),resetTo:w,choices:h}):i(ht,{label:l(e),icon:i(Je,{}),value:m?"":Ft(s,t,d),inherited:p,resetTo:w,onChange:r,onReset:()=>r(u),choices:h})}function si(e,t,n,o,r,s){const a=Or(e,t);return[{label:l("No fill"),color:"",selected:a==="none",onPick:()=>s(Tr)},{label:`${l("Section band")} · ${r.band.toUpperCase()}`,color:r.band,selected:a==="band",onPick:()=>s(Ee)},...ve(xe(e)??"",n,o,s)]}function ai(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,s=yr(r,t);return i(S,{label:l(e),icon:i(me,{}),changed:!s,action:i(C,{words:y()?.panel,label:l(e),changed:!s,detail:l("the theme's image stage"),onReset:()=>o(br)}),children:ii({swatches:Sr,current:s?_r:Cr(r,t),onPick:o,names:xr})})}}}function ua(e=n=>n,t){return J({_gSectionTheme:T(Er),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(Wo,{value:e(n),onChange:o,followLabel:t})}})}function ee({min:e,max:t,step:n,value:o,onChange:r,suffix:s="",readout:a=!0,notch:c,ariaLabel:d,disabled:f=!1,placeholder:m,placeholderWord:p,onClear:u}){const g=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:g?"sf-slider has-notch":"sf-slider",style:g?{"--sf-notch":(c-e)/(t-e)}:void 0,children:i(Co,{min:e,max:t,step:n,value:o,...o===null&&m!==void 0?{placeholderValue:m}:{},...p?{emptyLabel:l(p)}:{},suffix:s||void 0,showInput:a,label:d===void 0?void 0:l(d),disabled:f,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:h=>{h===null?u?.():h!==o&&r(h)}})})}function Bt(e,t){const{min:n,max:o,step:r=1,unsetLabel:s,hint:a,restTrack:c,unsetMark:d,icon:f,unit:m="px"}=t;return{type:"custom",render:({value:p,onChange:u})=>{const g=typeof p=="number"?p:null,h=g===null;return i(S,{label:l(e),icon:f?q(f):void 0,value:h?d||s===void 0?void 0:l(s):`${g}${m}`,changed:!h,action:d?Ge(d,{changed:!h,onReset:()=>u(null)}):i(C,{words:y()?.panel,label:l(e),changed:!h,onReset:()=>u(null)}),hint:typeof a=="string"?l(a):a,children:c?c({min:n,max:o,step:r,px:g,label:e,onChange:u}):ee({min:n,max:o,step:r,value:g??n,readout:!1,ariaLabel:e,onChange:u})})}}}const ae="Corners";function Ae(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,r=o!==null;return i(S,{label:l(ae),icon:i(Qe,{}),changed:r,action:Ge(e.mark,{changed:r,onReset:()=>n(null)}),hint:e.hint,children:i(di,{tier:e,px:o,onRadius:n})})}}}function L(e){const t=M();return[t?.values?.[e],n=>t?.onChange(e,n)]}function Dt(){return gt({type:"custom",render:()=>i(Io,{})},"always")}function ci(){const e=M();return t=>e?.onChangeMany(t)}function di({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),[r,s]=L(e.sidesKey),a=at(r)??[...st];return i(ho,{label:l(ae),value:a,corners:$n,onChange:c=>{const d=at(c)??[];s(d.length===st.length?null:d)},radius:t,onRadiusChange:n,radiusMin:U,radiusMax:Ye,radiusStep:e.step??1,radiusPlaceholder:String(o)})}function Ht(){return Dt()}function ui({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=v(),r=typeof o=="number"?`${o}px`:l("not set");return i(C,{words:y()?.panel,label:l(e),changed:t,detail:o==null?l("the built-in corners"):D(r,l("Styles")),onReset:n})}function pi(){const{cornerRadiusPx:e}=v();return typeof e=="number"?e:U}function fi(){return Ae({sidesKey:"sectionCornerSides",useFollowed:pi,mark:i(ui,{label:ae}),hint:hi})}const hi="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function pa(){return J({_gShape:T("Shape"),sectionCorners:fi(),sectionCornerSides:Ht(),...X("sectionBorder",Gt)})}const mi=()=>({width:l("Border width"),sides:{top:l("Border top"),right:l("Border right"),bottom:l("Border bottom"),left:l("Border left")},style:l("Border style"),styles:{solid:l("Solid"),dashed:l("Dashed"),dotted:l("Dotted")},color:l("Border color"),unit:"px"});function gi(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function bi(){let e;try{const t=Ot(v().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||dr.line}function wi({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:s=!0,above:a={}}){const c=e&&typeof e=="object"?e:{},[d,f]=z(()=>r?to(c,a):!1),m=mi(),p=u=>gi(r&&s?u:{width:u.width,color:u.color,...s?{style:u.style}:{}});return i(S,{label:l("Border"),icon:i(Rn,{}),action:r?i(Qn,{each:d,label:l("Each side"),onChange:f}):void 0,children:i(Zn,{label:l("Border"),value:c,each:d,onChange:u=>t(p(u)),placeholder:n,presets:o,words:m,styles:s,max:cr})})}function xi({value:e,onChange:t,view:n}){const[o]=L("sectionBorder"),[r]=L(W("sectionBorder")),s=bi(),a=d=>d&&typeof d=="object"?d:{},c=n==="phone"?{...Tt(a(o)),...Tt(a(r))}:n==="tablet"?a(o):{};return i(wi,{value:e,onChange:t,placeholder:{sides:eo(c),style:c.style??"solid",color:c.color||s},presets:[s],above:c})}function fa(e){return R(e,Gt(e==="mobile"?"phone":e))}function Gt(e){return{type:"custom",render:({value:t,onChange:n})=>i(xi,{value:t,onChange:n,view:e})}}function X(e,t){const n=(o,r)=>se(e,t(o),ke)[r];return{[e]:n("desktop",e),[W(e)]:n("tablet",W(e)),[F(e)]:n("phone",F(e))}}function ha(e){return{type:"custom",render:()=>i(Si,{partKey:e})}}function Si({partKey:e}){const[t]=L("id"),[n]=L("_partStyles"),{textStyles:o}=v(),r=Yo();let s=null;try{s=jo().select}catch{s=null}const a=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i(zn,{name:l("Text"),preview:Xo(a,c,{noStyle:l("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??zo.copy.panel).cases}),onOpen:()=>{s&&typeof t=="string"&&s(Vo(t,e))}})}function Mt(e){const{cornerRadiusPx:t}=v(),n=typeof t=="number"?t:e;let o=null;try{const{appState:s,selectedItem:a}=te(d=>d),c=a?.props?.id?String(a.props.id):void 0;o=c?Vn(s?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return Xn(r)?r:n}function yi({label:e,changed:t=!1,onReset:n=()=>{}}){const o=Mt(U);return i(C,{words:y()?.panel,label:l(e),changed:t,detail:D(`${o}px`,l("the section")),onReset:n})}function Ci(){return i(k,{children:l("Follows the section's Corners until you set a number here.")})}function _i(){return Ae({sidesKey:"cardCornerSides",useFollowed:()=>Mt(U),mark:i(yi,{label:ae}),hint:i(Ci,{})})}function Ri(){return{type:"custom",render:()=>i(ln,{})}}function ma(e){return{...e,render:t=>i(sn,{render:e.render,props:t})}}function ga(){return{_gShape:T("Shape"),cardCorners:_i(),cardCornerSides:Ht(),cardCornersApplyAll:Ri()}}function Ti(){return E({type:"custom",render:e=>i(Ii,{...e})},{type:"select",label:K,options:[{value:"content",label:"Fit content"},{value:"equal",label:"Equal"},{value:[50],label:"Custom: the width of each block in %, the last block left out"}]})}function Oi(e,t){const n=Rt(e);if(n!=="custom")return l(_t.find(r=>r.value===n)?.label??"");const o=ut(Re(e,t),t);return o?[...o,100-o.reduce((r,s)=>r+s,0)].join(" / "):l("Custom")}function Ii(e){const{value:t,onChange:n}=e,[o]=L("content"),r=Array.isArray(o)?o.length:0,s="follows"in e,a=t!=null,c=a?t:s?e.follows:void 0,d=Rt(c),f=r>=2&&r<=dt,m=()=>[...xo[r]??[]],p=V(null),u=b=>{const _=p.current;_&&JSON.stringify(b)===JSON.stringify(_.shares)?n(_.value):b&&n(b)},g=b=>{b===d||b==="custom"&&!f||n(b==="custom"?m():b)},h=l("The width bar works for 2 to {count} blocks.",{count:dt}),w=a&&(s||t!=="content"),x=yo().widths.hint(r,wo);return i(S,{label:l(K),icon:i(he,{}),changed:w,hint:d!=="custom"?void 0:f?x:h,action:i(C,{words:y()?.panel,label:l(K),changed:w,disabled:e.readOnly===!0,detail:s?B(b=>l(b),Oi(e.follows,r),e.followsView):l("Fit content"),onReset:()=>n(void 0)}),children:A("div",{className:"sf-share-row",children:[i("div",{className:"sf-share-pick",children:i(ct,{label:l(K),value:d,options:_t.map(b=>({value:b.value,label:b.value==="custom"&&!f?h:l(b.label),icon:Ur(i("span",{className:"sf-gallery-pic sf-share-pic",children:Ut(b.weights).map((_,j)=>i("i",{style:{gridColumn:`span ${_}`}},j))}),l(b.label),b.value==="custom"&&!f?h:l(b.label))})),onChange:g,columns:3,cell:Wt,tooltips:!1,disabled:e.readOnly===!0})}),d==="custom"&&f?i("div",{onFocus:()=>{p.current={value:t,shares:ut(Re(c,r),r)}},onBlur:()=>{p.current=null},children:i(So,{label:l(K),count:r,value:Re(c,r),onChange:u,readOnly:e.readOnly===!0})}):null]})})}function Ut(e){if(!e)return[3,4];const t=e.reduce((n,o)=>n+o,0);return e.map(n=>Math.round(n/t*12))}function ba(){return Z(rr,i(Ln,{}),St,St[0].value)}function wa(){return R("mobile",Mr(K,i(he,{}),ar.map(e=>({label:e.label,value:e.value,picture:i("span",{className:"sf-gallery-pic sf-share-pic",children:Ut(e.weights).map((t,n)=>i("i",{style:{gridColumn:`span ${t}`}},n))})})),sr,{columns:2,cell:Wt}))}const Wt={width:"5.75rem",height:"3.25rem"};function xa(){return se("share",Ti(),ke)[W("share")]}function Ei(){return R("mobile",$(yt,i(Ze,{}),_e,lr,1,_e,"",{clear:{phoneFollows:!1,hint:_e}}))}const Kt={read:e=>e.phoneRow,write:(e,t,n)=>({phoneRow:n}),fieldKey:()=>"phoneRow",ownField:!0};function Sa(){const e=$(yt,i(Ze,{}),Ct,ir,1,Ct,"",{clear:{emptyLabel:"Auto"}}),t=se("columns",e,{...Kt,tablet:ke.tablet}),n=se("columns",e,Kt,{phoneRow:Ei()});return{...t,phoneRow:n.phoneRow}}function ya(e,t,n,o,r,s){return{type:"custom",render:({value:a,onChange:c})=>i(S,{label:l(e),icon:i(lt,{noun:s}),action:i(C,{words:y()?.panel,label:l(e),changed:!Lr(a),detail:l("the Text style in Styles"),onReset:()=>c(Fr),defaultAction:{onPress:()=>c(kr),title:l("Keep this section's own built-in size"),icon:i(Tn,{})}}),children:ee({min:t,max:n,step:o,value:typeof a=="number"?a:r,suffix:"px",ariaLabel:e,onChange:c})})}}function Ca(){return{_gCellWidth:T("Cell width"),gridSpan:Z("Positions",i(he,{}),[{label:"Auto",value:""},...Array.from({length:un},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function N(){let e=null,t=null;try{e=Me(ki),t=te(n=>n).selectedItem}catch{t=null}return e??t?.props??{}}const ki=zt(null);function Fi({min:e,max:t,step:n,px:o,label:r,onChange:s,desktopKey:a,fallback:c}){const d=N()[a],f=Se(void 0,d,c);return i(k,{children:ee({min:e,max:t,step:n,value:Se(o,d,c),readout:!1,ariaLabel:r,notch:f,onChange:s})})}function Li({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:s=()=>{}}){const a=N()[t],c=Se(void 0,a,n);return i(C,{words:y()?.panel,label:l(e),changed:r,detail:B(d=>l(d),`${c}${o}`),onReset:s})}function Ni(e){return Bt(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:i(Li,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:t=>i(Fi,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const Ai={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Pi={Top:it,Bottom:nt,Left:ot,Right:rt},vi=e=>{const t=Pi[e];return i(t,{})};function _a(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=x=>Ai[x],s=x=>$(r("Top"),i(it,{}),I.min,I.max,I.step,x,"px"),a=(x,b,_,j=I)=>R("mobile",Ni({label:r(x),icon:vi(x),desktopKey:b,min:j.min,max:j.max,step:j.step,fallback:_})),c=e.top??I.min,d=e.bottom??I.min,f="sectionPaddingLeft",m="sectionPaddingRight",p=e.sideBounds??I,u=e.side??p.min,g=e.sidePhone??u,h=e.phone===!0,w=x=>h?R("desktop",x):x;return J({...o?{_gSpacing:T("Padding")}:{},[t]:w(s(c)),...h?{[F(t)]:a("Top",t,c)}:{},...e.only==="top"?{}:{[n]:w($(r("Bottom"),i(nt,{}),I.min,I.max,I.step,d,"px")),...h?{[F(n)]:a("Bottom",n,d)}:{}},...e.sides?{[f]:w($(r("Left"),i(ot,{}),p.min,p.max,p.step,u,"px")),...h?{[F(f)]:a("Left",f,g,p)}:{},[m]:w($(r("Right"),i(rt,{}),p.min,p.max,p.step,u,"px")),...h?{[F(m)]:a("Right",m,g,p)}:{}}:{}})}function Ra(e,t){const n=Object.fromEntries(Object.entries(t).map(([s,a])=>[s,s in e&&fe(a)?e[s]:a])),o={};let r=!1;for(const[s,a]of Object.entries(e)){if(s in t){r||Object.assign(o,n),r=!0;continue}o[s]=a}return r||Object.assign(o,n),o}const ce="Width";function Ta(e,t=Nr,n=!0){const o=t.map(r=>({label:Ar[r],value:r}));return J({...n?{_gWidth:T(ce)}:{},widthMode:{type:"custom",render:({onChange:r,field:s})=>i(S,{label:l(ce),icon:i(Un,{}),action:n?i(Jr,{inherited:s?.inherited??!1,onReset:()=>r(Pr),label:ce}):void 0,children:Le({options:o,value:s?.currentValue||e,onChange:r,ariaLabel:ce})})}})}function Oa(){const e=(o,r)=>({type:"custom",render:({value:s,onChange:a})=>i(Bi,{value:s,onChange:a,view:o,badge:r})}),t=o=>({type:"custom",render:({value:r,onChange:s,field:a})=>i(Hi,{value:r,onChange:s,unit:a?.unit,view:o})}),n=o=>{const r=Kr("Unit",i(et,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");if(o==="desktop")return r;const s=r.render;return{...r,render:a=>i(Gi,{props:a,draw:s,view:o})}};return J({_gHeight:T(Y),...X("sectionHeightMode",o=>o==="desktop"?e(o):e(o,r=>i(Mi,{view:o,onClear:()=>r(void 0)}))),...X("sectionHeightValue",t),...X("sectionHeightUnit",n)})}function Bi({value:e,onChange:t,view:n,badge:o}){const r=N(),s=c=>["auto","fixed","screen"].includes(c),a=de(n,r)?.mode??"auto";return i(S,{label:Y,icon:q(i(An,{})),action:o?o(t):void 0,children:Le({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:s(e)?e:a,onChange:t,ariaLabel:Y})})}function $t(e,t){return e==="phone"&&ye(t)?Zo(t):Jo(t)}function de(e,t){return e==="desktop"||(e==="tablet"?ye(t):qo(t))?null:$t(e,t)}const P=(e,t)=>e==="tablet"?W(t):F(t);function Di(e,t,n,o){const r=de(e,t);return!r||e==="desktop"?null:o===void 0?{}:{[P(e,"sectionHeightMode")]:r.mode,...r.mode==="fixed"?{[P(e,"sectionHeightUnit")]:r.unit}:{},...n==="sectionHeightUnit"?{[P(e,"sectionHeightValue")]:r.value}:{},[P(e,n)]:o}}function Xt(e,t,n){const o=M(),r=de(e,N());return!o||!r?{followed:null,write:n}:{followed:r,write:a=>o.onChangeMany(c=>{const d=Di(e,c,t,a);return d===null?{[e==="desktop"?t:P(e,t)]:a}:Object.keys(d).length?d:null})}}function Hi({value:e,onChange:t,unit:n,view:o}){const{followed:r,write:s}=Xt(o,"sectionHeightValue",t),a=(r?r.unit:n)==="%"?"%":"px",c=a==="%"?nr:tr;return i("div",{className:"sf-field",children:ee({min:c.min,max:c.max,step:c.step,value:r?null:typeof e=="number"?e:c.fallback,...r?{placeholder:r.value}:{},suffix:a,ariaLabel:Y,onChange:s})})}function Gi({props:e,draw:t,view:n}){const{followed:o,write:r}=Xt(n,"sectionHeightUnit",e.onChange);return t({...e,...o?{value:void 0,storedValue:void 0,follows:o.unit}:{},onChange:r})}function Mi({view:e,onClear:t}){const n=N(),o=de(e,n)===null,r=e==="phone"&&ye(n),s=$t(e,n),a=B(c=>l(c),s.mode==="auto"?l("Auto"):`${s.value}${s.unit}`,r?"tablet":"desktop");return i(C,{words:y()?.panel,label:l(Y),changed:o,detail:a,onReset:t})}function Ia(){const e=n=>({type:"custom",render:({value:o,onChange:r,id:s,name:a})=>i(Ki,{value:o,onChange:r,labelId:`${s??a??"stickTop"}-label`,view:n})}),t=n=>({type:"custom",render:({value:o,onChange:r})=>i(Ui,{value:o,onChange:r,view:n})});return{_gStick:T(Ce),...X("stickTop",e),...X("stickTopDistance",t)}}function Ui({value:e,onChange:t,view:n}){const o=M(),r=N(),s=n==="desktop"||Pe(n,r)?null:jt(n,wt(r)),a=s&&o?c=>o.onChangeMany(d=>{const f=Wi(n,d,c);return f===null?{[P(n,"stickTopDistance")]:c}:Object.keys(f).length?f:null}):t;return i("div",{className:"sf-field",children:ee({min:ie.min,max:ie.max,step:ie.step,value:s?null:typeof e=="number"?e:ie.fallback,...s?{placeholder:s.distance}:{},suffix:"px",ariaLabel:l("Distance from top"),onChange:a})})}function Pe(e,t){return e==="tablet"?er(t):Qo(t)}function jt(e,t){return e==="phone"?{on:t.tablet,distance:t.tabletDistance}:{on:t.desktop,distance:t.desktopDistance}}function Wi(e,t,n){return e==="desktop"||Pe(e,t)?null:n===void 0?{}:{[P(e,"stickTop")]:!0,[P(e,"stickTopDistance")]:n}}function Ki({value:e,onChange:t,labelId:n,view:o}){const r=N(),s=wt(r),a=o==="phone"?s.phone:o==="tablet"?s.tablet:e===!0,c=o==="phone"&&s.ownTablet,d=o==="desktop"?null:jt(o,s),f=d?.on?`${d.distance}px`:l("Off");return i(S,{label:l(Ce),labelId:n,icon:q(i(Dn,{})),action:A(k,{children:[o!=="desktop"?i(C,{words:y()?.panel,label:l(Ce),changed:Pe(o,r),detail:B(m=>l(m),f,c?"tablet":"desktop"),onReset:()=>t(void 0)}):null,i(be,{checked:a,onChange:t,ariaLabelledBy:n})]})})}const Vt="e.g. about";function Ea(){return{_gAnchor:T("Anchor"),anchor:G({control:"plainText",label:"Name",placeholder:Vt},{type:"custom",render:({value:e,onChange:t})=>i(xn,{value:e,onChange:t,nameBox:(n,o)=>i(H,{value:n,onChange:o,label:"Name",placeholder:Vt,hideable:!1,markup:!1})})})}}function ka(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:s,name:a})=>{const c=`${s??a??e}-datetime`,d=Date.parse(typeof o=="string"?o:"");return i(S,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(go,{id:c,value:Number.isFinite(d)?new Date(d):null,onChange:f=>r(f?f.toISOString():"")})})}}}function Fa(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:s,name:a})=>{const c=`${s??a??e}-date`;return i(S,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(mo,{id:c,value:Jt(typeof o=="string"?o:null),onChange:d=>r(d?qt(d):"")})})}}}function $i(e,t,n,o){return{type:"custom",...E({},{...Q,label:e}),render:r=>{const{value:s,onChange:a,id:c,name:d}=r,f="follows"in r,m=r,p=typeof s=="boolean",u=typeof m.follows=="boolean"?m.follows:t,g=p?s:f?u:t,h=`${c??d??e}-label`,w=m.readOnly===!0,x=i(be,{checked:g,onChange:a,disabled:w,ariaLabelledBy:h});return i(S,{label:l(e),labelId:h,icon:n,hint:o===void 0?void 0:l(o),action:f?A(k,{children:[i(C,{words:y()?.panel,label:l(e),changed:p,detail:m.followsNoView?l(u?"On":"Off"):B(b=>l(b),l(u?"On":"Off"),m.followsView),disabled:w,onReset:()=>a(void 0)}),x]}):x})}}}function La(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i(Xi,{label:"Background",icon:i(Bn,{}),id:r,value:e,shown:Wn(e),onChange:t})}}}function Na(e,t){return{type:"custom",...E({},{...Q,label:e}),render:({value:n,onChange:o,id:r})=>{const s=typeof n=="boolean"?n:t,a=`${r??e}-checkbox`;return i(S,{label:l(e),htmlFor:a,className:"sf-checkbox",action:i(po,{id:a,checked:s,onChange:o})})}}}function Aa(e,t,n){return{type:"custom",render:({value:o,onChange:r})=>i(oe,{label:l(e),icon:n,value:o||t,onChange:r})}}function Xi({label:e,icon:t,id:n,value:o,shown:r,onChange:s}){const{colors:a,n:c}=Be(),d=xe(o),f=d?re(d,a,c):null;return i(oe,{label:l(e),icon:t,id:n,value:f?f.hex:r,caption:f?.words,onChange:s,choices:ve(d??"",a,c,s)})}function Pa(){return{type:"custom",render:e=>{const{value:t,onChange:n}=e,o=e;return i(ji,{value:typeof t=="string"?t:"",onChange:n,twin:"follows"in e?{follows:o.follows,view:o.followsView}:void 0})}}}function ve(e,t,n,o){const r=ge(e);return Ro(t,n).map(s=>({label:s.label,color:s.value,selected:r===s.name,onPick:()=>o(s.name)}))}function ji({value:e,onChange:t,twin:n}){const{colors:o,n:r}=Be(),s=o.background,a=D(s.toUpperCase(),l("Theme {n} background",{n:r})),c=ge(e),d=c?re(c,o,r):null,f=ve(e,o,r,t),m=n?()=>t(void 0):()=>t("");let p=s,u=a;if(n){const g=ge(n.follows),h=Kn(n.follows),w=g?re(g,o,r):h?{hex:h,words:h.toUpperCase()}:null;p=w?.hex??s,u=B(x=>l(x),w?w.words:a,n.view)}return d?i(oe,{label:l("Fill"),icon:i(me,{}),value:d.hex,caption:d.words,onChange:t,changed:!0,onReset:m,resetTo:u,choices:f}):i(ht,{label:l("Fill"),icon:i(me,{}),value:e,inherited:p,resetTo:u,onChange:t,onReset:m,choices:f})}function Vi(e,t,n){if((e?.content??[]).some(a=>a?.props?.id===t))return le(n);const r=jn(e,t);if(r.length===0)return null;const s=le(Lt(n));if(s!==null)return s;for(let a=r.length-1;a>0;a-=1){const c=le(Lt(r[a].sectionAccent));if(c!==null)return c}return le(r[0].sectionAccent)}function Be(){const e=Ot(v().theme),[t]=L("sectionAccent");let n=null;try{const{appState:r,selectedItem:s}=te(c=>c),a=s?.props?.id?String(s.props.id):void 0;n=a?Vi(r?.data,a,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{colors:ur(e.themes[o]),n:o+1}}const zi=[{value:"0% 0%",label:"Top left"},{value:"50% 0%",label:"Top"},{value:"100% 0%",label:"Top right"},{value:"0% 50%",label:"Left"},{value:"50% 50%",label:"Center"},{value:"100% 50%",label:"Right"},{value:"0% 100%",label:"Bottom left"},{value:"50% 100%",label:"Bottom"},{value:"100% 100%",label:"Bottom right"}];function Yi({label:e,value:t,onChange:n,points:o=zi}){const r=o.map(s=>({...s,label:l(s.label),...s.title?{title:l(s.title)}:null}));return i(uo,{label:l(e),value:t,points:r,onChange:n})}function va(){return Dt()}const Ba={top:i(kn,{}),right:i(En,{}),bottom:i(On,{}),left:i(In,{})};function Da(e,t,n,o,r,s,a){const c=p=>t.find(u=>u.value===p),d=p=>({value:p,label:"",disabled:!0,title:o}),f=p=>{const u=t.find(h=>h.cell===p);if(!u)return d(`missing-${p}`);const g=s?.[p];return g?{value:u.value,label:u.label,icon:g}:{value:u.value,label:u.label}},m=[d("corner-top-left"),f("top"),d("corner-top-right"),f("left"),d("centre"),f("right"),d("corner-bottom-left"),f("bottom"),d("corner-bottom-right")];return{type:"custom",render:({value:p,onChange:u})=>{const g=t.some(h=>h.value===p)?p:n;return i(S,{label:l(e),icon:r,value:c(g)?.label?l(c(g).label):a?l(a):"",children:Yi({label:e,value:g,onChange:u,points:m})})}}}function Ha(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:s})=>i(Uo,{label:e,options:(s.options??t).map(a=>({...a,label:l(a.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:l(n)}:{}})}}function Ga(e,t,n,o){return{type:"custom",options:t,fallback:n,...E({},{type:"select",label:e}),render:({value:r,onChange:s,field:a})=>i(Ko,{label:e,options:(a.options??t).map(c=>({...c,label:l(c.label)})),fallback:a.fallback??n,value:r,onChange:s,placeholder:o===void 0?void 0:l(o)})}}function Ma(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}const Ua=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function Wa(e,t,n){const o=Object.keys(We).map(r=>({label:We[r],value:r,picture:n[r]}));return{type:"custom",...E({},{type:"radio",label:e,options:o.map(r=>({value:r.value,label:r.label}))}),render:({onChange:r})=>i(Ji,{label:e,icon:t,options:o,onChange:r})}}function qi(e,t,n){const o=Zt(e,t,n);if(o!==void 0)return o==="save-makes-frame"?l("A frame is made from this video when you save the page."):o==="starts-dark"?l("This video starts dark, so no frame was made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="outside"?l("This video is on another website, so no frame can be made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="unsupported"?l("This video's file type gives no frame. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="failed"?l("No frame could be made from this video. It is tried again the next time you save the page. The slide shows its background colour while the video loads."):o==="image-no-frame"?l("The slide shows your Image while the video loads, because this video has no frame."):void 0;const r=en(e);return r==="frame-missing-image"?l("This video has no frame yet. The slide shows its image until one is made."):r==="frame-missing-surface"?l("This video has no frame yet. The slide shows its background colour until one is made."):r==="image-missing-frame"?l("No image yet. The slide shows the video's frame until you choose one."):r==="image-missing-surface"?l("No image yet. The slide shows its background colour until you choose one."):void 0}function Ji({label:e,icon:t,options:n,onChange:o}){const r=M(),s=r?.values??{},a=Qt(s),c=Me(on),d=nn(c?.docId??null);let f=null;try{f=te(p=>p.appState.data)}catch{f=null}const m=tn(r?.id,f,d);return i(S,{label:l(e),icon:q(t),hint:qi(s,m,c?.hasUnsavedEdits??!1),children:Le({options:n,value:a,onChange:o,ariaLabel:e})})}function Ka(e,t,n,o={}){const r={type:"custom",[je]:!0,render:({value:s,onChange:a,name:c})=>i(Mo,{value:s||"",onChange:a,fieldKey:c,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen,frameKey:o.frame}),...o.focus?{focusKey:o.focus}:{},...o.focusWhen?{focusWhen:o.focusWhen}:{}};return o.focus?R("each",r):r}const $a={HeroSingle:["imageFocal"],HeroSlide:["videoFrame"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function Zi(e){const t=l(e.status??"");return e.ok&&typeof e.lat=="number"&&typeof e.lng=="number"?`${t} · ${e.lat.toFixed(4)}, ${e.lng.toFixed(4)}`:t}function Xa({value:e,onChange:t,label:n}){const o=e||{},r=M(),s=r?r.values!==r.node.props:!0,a=!!o.pending&&s,c=!!o.pending&&!s,d=!!Dr(Br()).geocode,f=Ue(),m=(p,u)=>t({...o,[p]:u??void 0});return A(k,{children:[i(S,{label:l(n),icon:i(tt,{}),action:d?i(we,{content:l("Find from the address (OpenStreetMap)"),children:i(pt,{"aria-label":l("Find from the address"),"aria-busy":a||void 0,disabled:a,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:i(Hn,{})})}):void 0,children:d&&o.status?i(Sn,{compact:!0,oneLine:!0,spaced:!1,status:a?"busy":o.ok&&!c?"found":"notfound",statusText:a?l("Finding…"):c?l(_o):l(o.status),hint:Zi(o)}):null}),i(S,{label:l("Enter by hand"),labelId:f,icon:i(Fn,{}),action:i(be,{checked:!!o.manual,onChange:p=>t({...o,manual:p}),ariaLabelledBy:f})}),o.manual&&i(S,{label:l("Latitude, longitude"),icon:i(tt,{}),children:A("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[i(ft,{value:typeof o.lat=="number"?o.lat:null,onChange:p=>m("lat",p),min:-90,max:90,step:1e-4,placeholder:l("Latitude")}),i(ft,{value:typeof o.lng=="number"?o.lng:null,onChange:p=>m("lng",p),min:-180,max:180,step:1e-4,placeholder:l("Longitude")})]})})]})}function Qi(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function el(e,t,n){const o=e.map(r=>({text:r?.text??""}));return t===null||t<0||t>=e.length?o:o.map((r,s)=>s===t?{text:n}:r)}function ja(e,t){return e===null?null:t>e?e:null}function tl(e,t,n){if(n===null||n>=t.length)return null;for(let o=0;o<n;o+=1)if(e[o]!==t[o])return null;return e[n]!==t[n]&&t.includes(e[n])||e[n]!==t[n]&&t.length!==e.length?null:n}const Va={label:"Ticker items",icon:i(vn,{})};function za(e,t,n,o){return{type:"custom",[O]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...E({},{...At.textList,label:e}),render:({value:r,onChange:s})=>i(nl,{label:e,icon:q(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:s,markup:o==="markup"})}}function nl({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:s=!1}){const a=V(null),[c,d]=z(null),f=p=>p.map(u=>({text:u?.text??""})),m=p=>{const u=tl(n,p,c);u===null&&(a.current=null),d(u),r(f(p))};return i(no,{label:l(e),icon:t,noun:l("item"),items:n,onChange:m,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:s?i(mt,{target:a,value:Qi(n,c),onChange:p=>r(el(n,c??-1,p)),disabled:c===null,label:c===null?l("Formatting — click a row first"):l("Formatting — row {n}",{n:c+1})}):void 0,renderRow:(p,u,g)=>i("input",{type:"text",className:s&&c===u?"sf-list-marking":void 0,value:p?.text??"",placeholder:l(o),"aria-label":l("{label} {n}",{label:l(e),n:u+1}),onChange:h=>g({text:h.target.value}),onFocus:h=>{a.current=h.currentTarget,d(u)}})})}function Ya(e,t){const n=`${e.label} — row ${t+1}`;return G({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:l("{label} — row {n}",{label:l(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function qa(e){return{_gCards:T("Cards"),coverIndex:Z("Cover image",i(Pn,{}),Do,String(Ho),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:ai("Image background",wr),cardImage:il()}}function Ja(){return{outline:Z("Card outline",i(Gn,{}),Po,Bo),indexBadge:Z("Card number",i(et,{}),Ao,vo),showBadge:$i("Product badge",!0,i(lt,{noun:"tag"}))}}function Za(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...Q,label:ue.find(s=>s.id===r).label}),o=r=>E(To(De),n(r));return{_gShowOnCard:T("Show on a card"),[De]:E({type:"custom",render:()=>i(ol,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(De)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const De="showCardPrice",ue=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function ol({rest:e}){const t=N(),n=ci(),o=a=>typeof t[a]=="boolean"?t[a]:void 0,r=a=>o(a)??e[a],s=ue.some(({id:a})=>o(a)!==void 0&&o(a)!==e[a]);return i(He,{parts:ue,changed:s,shown:r,onPress:(a,c)=>n({[a]:c}),onReset:()=>n(Object.fromEntries(ue.map(({id:a})=>[a,void 0])))})}function Qa(e,t="display"){const n=F(t);return{[t]:R("desktop",{type:"custom",render:({value:o,onChange:r})=>i(He,{parts:e,changed:ro(o),shown:s=>io(o,s),onPress:(s,a)=>r(ao(o,s,a)),onReset:()=>r(void 0)})}),[n]:R("mobile",{type:"custom",render:({value:o,onChange:r})=>i(rl,{parts:e,desktopKey:t,value:o,onChange:r})})}}function He({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:s,disabledReason:a}){const c=l("Display");return i(S,{label:c,icon:i(Cn,{}),changed:t,action:i(C,{words:y()?.panel,label:c,changed:t,detail:s,onReset:r}),children:i(oo,{label:c,items:e.map(d=>({id:d.id,label:l(d.label),shown:n(d.id),...a?{disabled:!0,disabledReason:l(a)}:{}})),onChange:o})})}function rl({parts:e,desktopKey:t,value:n,onChange:o}){const r=N()[t];return i(He,{parts:e,changed:so(n),shown:s=>lo(r,n,s),onPress:(s,a)=>o(co(n,s,a)),onReset:()=>o(Lo),detail:l("the same as Desktop")})}function il(){return Bt("Card image",{min:U,max:Ye,step:an,icon:i(Qe,{}),hint:"Rounds the picture. The card's own corner is in Styles."})}function ec(){return Ae({sidesKey:"cornerSides",step:cn,useFollowed:()=>U,mark:i(ll,{label:dn}),hint:l("Rounds the picture. Left alone it stays square.")})}function ll({label:e,changed:t=!1,onReset:n=()=>{}}){return i(C,{words:y()?.panel,label:l(e),changed:t,onReset:n})}function tc(){return{type:"custom",render:({value:e,onChange:t})=>i(dl,{value:typeof e=="string"?e:"",onChange:t})}}function sl({layout:e,width:t}){const n=hn(e),o=n?`${n[0]}/${n[1]}`:void 0;return i("span",{"aria-hidden":"true",style:{display:"grid",width:t,gridTemplateColumns:"repeat(12, minmax(0, 1fr))",gridAutoRows:o?"auto":6,gridAutoFlow:"row dense",gap:2},children:mn(e).map(([r,s],a)=>i("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${r}`,gridRow:`span ${s}`,aspectRatio:o}},a))})}const al={width:"3.5rem",height:"2.5rem"},cl=200;function dl({value:e,onChange:t}){const[n,o]=z(null),[r,s]=z(4),a=V(null);Yt(()=>{const u=a.current;if(!u||typeof ResizeObserver!="function")return;const g=()=>s(u.getBoundingClientRect().width>=cl?4:3);g();const h=new ResizeObserver(g);return h.observe(u),()=>h.disconnect()},[]);const c=e&&e in ne?e:"",d=qe(n,c),f=qe(n,"").length,m=gn("no-symbol"),p=[{value:"",label:l("Not chosen"),icon:Wr(m,l("Not chosen"))},...d.map(u=>({value:u,label:l(ne[u].label),icon:i(sl,{layout:ne[u],width:40})}))];return i(S,{label:l("Layout"),icon:i(Nn,{}),value:c?l(ne[c].label):void 0,children:i("div",{ref:a,style:{flex:"1 1 auto",minWidth:0},children:i(ct,{label:l("Layout"),value:c,options:p,onChange:t,columns:r,cell:al,header:A("div",{className:"mb-2 flex flex-col gap-1",style:{minWidth:"11rem"},children:[i("span",{className:"text-2xs text-ink-faint",children:l("Photos in a row")}),i(Jn,{options:[{id:"all",label:l("All")},...pn.map(u=>({id:String(u),label:String(u)}))],value:n===null?"all":String(n),ariaLabel:l("Photos in a row"),onChange:u=>o(u==="all"?null:Number(u))}),i("span",{className:"text-2xs text-ink-faint",children:l("{n} of {total} layouts",{n:f,total:fn.length})})]})})})})}export{Qr as BOUND_TO_POST,Vs as BOUND_TO_POST_NOTE,ta as BUCKET_ICONS,$a as CUSTOM_FIELD_MEDIA,Xa as CoordsField,Nt as DESKTOP_GAP_NOT_OVERLAP,He as DisplayRow,Ba as EDGE_ARROWS,bo as FOCAL_DEFAULT,zi as FOCAL_POINTS,pe as FOLD_FIELD_MARKER,Yi as FocalPicker,ca as GroupLabel,ei as HIGHLIGHT_HINT,H as HidableTextField,Xe as LINK_FIELD_MARKER,Bs as Label,je as MEDIA_FIELD_MARKER,Ua as MEDIA_TYPE_OPTIONS,zs as NOT_BOUND_TO_POST,aa as PanelBand,oi as PanelNoteLine,ki as RowPropsContext,Ve as SCAFFOLD_FIELD_MARKER,ic as SCALAR_TEXT_CONTROLS,Xr as SiteGapDefaultReset,ee as Slider,ii as Swatches,rc as TEXT_CONTROL_KINDS,O as TEXT_FIELD_MARKER,Va as TICKER_ITEMS_ROW,nl as TextListField,Xi as ThemeFillRow,ce as WIDTH_LABEL,Jr as WidthDefaultReset,tl as aimAfterListChange,Ea as anchorFields,D as backTo,da as backgroundField,ba as boxBlockSpacingField,Sa as boxColumnsFields,Pa as boxFillField,Ei as boxPhoneRowField,Ti as boxShareField,wa as boxSharePhoneField,xa as boxShareTabletField,Vi as boxThemeIndexOf,ra as bucketHeader,ha as buttonWordsEntryField,_i as cardCornersField,ai as cardImageBackgroundField,il as cardImageField,qa as cardMediaFields,ga as cardShapeFields,Za as cardShowFields,Ja as cardStyleFields,Ca as cellWidthFields,Na as checkbox,Aa as colorInput,Hs as containerDirectionField,jr as containerGapField,Vr as containerGapPhoneField,Ds as containerGapRows,zr as containerGapTabletField,Zi as coordsResultTip,Zs as copyText,Ht as cornerSidesField,Ae as cornersRowField,Fa as date,ka as dateTime,ia as designGroupHeader,Qa as displayFields,Da as edgePad,ve as fillSlotChoices,ja as focusAfterRemove,va as focusKeptField,la as foldMarker,fe as foldMetaOf,ri as foldTitleOf,Di as followedHeightPatch,Wi as followedStickPatch,tc as galleryLayoutField,Oa as heightFields,de as heightFollowedBy,Gs as heroGroupPlacementPoints,$e as hidableText,ni as hintIsWhileTyping,ec as imageCornersField,js as inOwnBox,oa as isBucketHeader,Dt as keptBy,Qs as linkField,qi as loadingRowHint,Wa as loadingShowsField,Ha as multiSelect,La as pageBackgroundField,na as panelNote,Ni as phoneOverrideField,Js as plainText,ea as plainTextarea,Bt as pxField,sa as quietMarker,Ke as readHidable,Qi as rowText,Ga as searchSelect,si as sectionBandChoices,fa as sectionBorderField,fi as sectionCornersField,pa as sectionShapeFields,ua as sectionThemeFields,el as setRowText,ya as sizeField,Ma as sourceField,_a as spacingFields,Ia as stickFields,Ra as swapPadding,ma as templateField,Ys as text,rn as textFieldIdentifier,Ws as textFieldOffPage,$s as textFieldPanelOnly,za as textList,Ya as textListRowField,qs as textarea,$i as toggle,Ka as upload,ci as useSelectedPatch,N as useSelectedProps,L as useSelectedSibling,$r as useSiteGapDetail,Ta as widthField,Xs as withIdentifier,Us as withOffPage,Ks as withPanelOnly,Ms as withScaffold};