efficient-web-builder 74.1.0 → 74.3.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 (173) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/editor/components/PreviewFooterContext.d.ts +3 -1
  3. package/dist/editor/components/PreviewFooterContext.js +1 -1
  4. package/dist/editor/components/SectionTextPartBridge.d.ts +2 -8
  5. package/dist/editor/components/SectionTextPartBridge.js +1 -1
  6. package/dist/editor/components/StorefrontEditor.js +1 -1
  7. package/dist/editor/components/storefront-editor.css +7 -0
  8. package/dist/editor/lib/document/blocks/general/ContactLocations/fields.js +1 -1
  9. package/dist/editor/lib/document/blocks/general/Footprint/fields.d.ts +3 -0
  10. package/dist/editor/lib/document/blocks/general/Footprint/fields.js +1 -1
  11. package/dist/editor/lib/document/controls.d.ts +1 -0
  12. package/dist/editor/lib/document/controls.js +1 -1
  13. package/dist/editor/lib/document/own-pad-fields.d.ts +4 -3
  14. package/dist/editor/lib/document/own-pad-fields.js +1 -1
  15. package/dist/editor/lib/document/page-root-fields.d.ts +4 -0
  16. package/dist/editor/lib/document/page-root-fields.js +1 -1
  17. package/dist/editor/lib/document/page-root.d.ts +3 -2
  18. package/dist/editor/lib/document/page-root.js +2 -2
  19. package/dist/editor/lib/document/registry.js +1 -1
  20. package/dist/editor/lib/editor-document-adapter.d.ts +1 -0
  21. package/dist/editor/lib/editor-document-adapter.js +1 -1
  22. package/dist/editor/lib/pinned-chrome-doc.d.ts +1 -0
  23. package/dist/editor/lib/pinned-chrome-doc.js +1 -1
  24. package/dist/format/lib/build/module-specifiers.d.ts +8 -0
  25. package/dist/format/lib/build/module-specifiers.js +1 -1
  26. package/dist/format/lib/content/block-sources.d.ts +1 -0
  27. package/dist/format/lib/content/block-sources.js +1 -1
  28. package/dist/format/lib/content/page-width.d.ts +15 -0
  29. package/dist/format/lib/content/page-width.js +1 -1
  30. package/dist/format/lib/content/section-css.d.ts +1 -1
  31. package/dist/format/lib/content/section-css.js +1 -1
  32. package/dist/format/lib/content/site-css.d.ts +5 -0
  33. package/dist/format/lib/content/site-css.js +1 -0
  34. package/dist/format/lib/content/site-offices.d.ts +7 -0
  35. package/dist/format/lib/content/site-offices.js +1 -0
  36. package/dist/format/lib/document/passes/types.d.ts +3 -2
  37. package/dist/format/lib/editor-words-catalogue.d.ts +3 -0
  38. package/dist/format/lib/editor-words-catalogue.js +3 -3
  39. package/dist/format/lib/source-rules/panel-colour-tokens.js +7 -7
  40. package/dist/format/lib/source-rules/site-gutter-once.d.ts +12 -0
  41. package/dist/format/lib/source-rules/site-gutter-once.js +23 -0
  42. package/dist/render/components/Banner.d.ts +3 -1
  43. package/dist/render/components/Banner.js +1 -1
  44. package/dist/render/components/Breadcrumb.js +1 -1
  45. package/dist/render/components/Cards.d.ts +3 -1
  46. package/dist/render/components/Cards.js +1 -1
  47. package/dist/render/components/ChartSection.d.ts +3 -1
  48. package/dist/render/components/ChartSection.js +1 -1
  49. package/dist/render/components/ContactLocations.d.ts +3 -1
  50. package/dist/render/components/ContactLocations.js +2 -2
  51. package/dist/render/components/Countdown.d.ts +3 -1
  52. package/dist/render/components/Countdown.js +1 -1
  53. package/dist/render/components/DocBody.d.ts +3 -1
  54. package/dist/render/components/DocBody.js +4 -4
  55. package/dist/render/components/DocMasthead.d.ts +3 -1
  56. package/dist/render/components/DocMasthead.js +1 -1
  57. package/dist/render/components/DocMetaCards.d.ts +3 -1
  58. package/dist/render/components/DocMetaCards.js +1 -1
  59. package/dist/render/components/FAQ.d.ts +3 -1
  60. package/dist/render/components/FAQ.js +1 -1
  61. package/dist/render/components/FeaturedCover.d.ts +3 -1
  62. package/dist/render/components/FeaturedCover.js +1 -1
  63. package/dist/render/components/Flex.js +1 -1
  64. package/dist/render/components/Footprint.js +1 -1
  65. package/dist/render/components/Grid.d.ts +3 -1
  66. package/dist/render/components/Grid.js +1 -1
  67. package/dist/render/components/HeroGroup.js +1 -1
  68. package/dist/render/components/HeroSingle.js +1 -1
  69. package/dist/render/components/HeroSlide.js +1 -1
  70. package/dist/render/components/ImageBlock.js +1 -1
  71. package/dist/render/components/IntegrationsSection.d.ts +3 -1
  72. package/dist/render/components/IntegrationsSection.js +1 -1
  73. package/dist/render/components/KeyFeatures.d.ts +3 -1
  74. package/dist/render/components/KeyFeatures.js +1 -1
  75. package/dist/render/components/Logos.d.ts +3 -1
  76. package/dist/render/components/Logos.js +1 -1
  77. package/dist/render/components/LongRead.d.ts +3 -1
  78. package/dist/render/components/LongRead.js +1 -1
  79. package/dist/render/components/Manifesto.js +1 -1
  80. package/dist/render/components/Masthead.d.ts +3 -1
  81. package/dist/render/components/Masthead.js +1 -1
  82. package/dist/render/components/MockupSection.d.ts +3 -1
  83. package/dist/render/components/MockupSection.js +1 -1
  84. package/dist/render/components/OrderSummary.d.ts +3 -1
  85. package/dist/render/components/OrderSummary.js +1 -1
  86. package/dist/render/components/ParagraphsA.js +1 -1
  87. package/dist/render/components/PaymentBadges.d.ts +3 -1
  88. package/dist/render/components/PaymentBadges.js +1 -1
  89. package/dist/render/components/ProcessSteps.js +1 -1
  90. package/dist/render/components/Prose.d.ts +3 -1
  91. package/dist/render/components/Prose.js +1 -1
  92. package/dist/render/components/SectionHeader.d.ts +2 -1
  93. package/dist/render/components/SectionHeader.js +1 -1
  94. package/dist/render/components/Series.d.ts +3 -1
  95. package/dist/render/components/Series.js +1 -1
  96. package/dist/render/components/SideSpaceOnce.d.ts +6 -0
  97. package/dist/render/components/SideSpaceOnce.js +1 -0
  98. package/dist/render/components/SiteGutterFrame.js +1 -1
  99. package/dist/render/components/SiteOffices.d.ts +5 -0
  100. package/dist/render/components/SiteOffices.js +1 -0
  101. package/dist/render/components/SiteRootProps.d.ts +6 -0
  102. package/dist/render/components/SiteRootProps.js +1 -0
  103. package/dist/render/components/SpecStrip.js +1 -1
  104. package/dist/render/components/Split.js +1 -1
  105. package/dist/render/components/Stats.d.ts +3 -1
  106. package/dist/render/components/Stats.js +1 -1
  107. package/dist/render/components/StatsParagraph.js +1 -1
  108. package/dist/render/components/Testimonials.d.ts +3 -1
  109. package/dist/render/components/Testimonials.js +1 -1
  110. package/dist/render/components/TickerSection.d.ts +3 -1
  111. package/dist/render/components/TickerSection.js +1 -1
  112. package/dist/render/components/Timeline.js +1 -1
  113. package/dist/render/components/TimelineTrack.js +1 -1
  114. package/dist/render/components/TitleWithButtons.js +1 -1
  115. package/dist/render/lib/content/section-edge.d.ts +1 -1
  116. package/dist/render/lib/content/section-edge.js +1 -1
  117. package/dist/render/lib/content/section-own-pads.d.ts +35 -0
  118. package/dist/render/lib/content/section-own-pads.js +1 -0
  119. package/dist/render/lib/content/section-padding.d.ts +9 -3
  120. package/dist/render/lib/content/section-padding.js +1 -1
  121. package/dist/render/lib/document/blocks/general/Banner/render.js +1 -1
  122. package/dist/render/lib/document/blocks/general/Cards/render.js +1 -1
  123. package/dist/render/lib/document/blocks/general/Chart/render.js +1 -1
  124. package/dist/render/lib/document/blocks/general/ContactLocations/render.js +1 -1
  125. package/dist/render/lib/document/blocks/general/Countdown/render.js +1 -1
  126. package/dist/render/lib/document/blocks/general/DocBody/render.js +1 -1
  127. package/dist/render/lib/document/blocks/general/DocMasthead/render.js +1 -1
  128. package/dist/render/lib/document/blocks/general/DocMetaCards/render.js +1 -1
  129. package/dist/render/lib/document/blocks/general/FAQ/render.js +1 -1
  130. package/dist/render/lib/document/blocks/general/FeaturedCover/render.js +1 -1
  131. package/dist/render/lib/document/blocks/general/Footprint/render.js +1 -1
  132. package/dist/render/lib/document/blocks/general/Grid/render.js +1 -1
  133. package/dist/render/lib/document/blocks/general/Integrations/render.js +2 -2
  134. package/dist/render/lib/document/blocks/general/KeyFeatures/render.js +1 -1
  135. package/dist/render/lib/document/blocks/general/Logos/render.js +1 -1
  136. package/dist/render/lib/document/blocks/general/LongRead/render.js +1 -1
  137. package/dist/render/lib/document/blocks/general/Masthead/render.js +1 -1
  138. package/dist/render/lib/document/blocks/general/Mockup/render.js +2 -2
  139. package/dist/render/lib/document/blocks/general/OrderSummary/render.js +1 -1
  140. package/dist/render/lib/document/blocks/general/PaymentBadges/render.js +1 -1
  141. package/dist/render/lib/document/blocks/general/Prose/render.js +1 -1
  142. package/dist/render/lib/document/blocks/general/SectionHeader/render.js +1 -1
  143. package/dist/render/lib/document/blocks/general/Series/render.js +1 -1
  144. package/dist/render/lib/document/blocks/general/Stats/render.js +1 -1
  145. package/dist/render/lib/document/blocks/general/Testimonials/render.js +1 -1
  146. package/dist/render/lib/document/blocks/general/Ticker/render.js +1 -1
  147. package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.js +1 -1
  148. package/dist/render/lib/document/blocks/general/section-to-box-rows-docbody.js +2 -2
  149. package/dist/render/lib/document/blocks/general/section-to-box-rows-head.js +1 -1
  150. package/dist/render/lib/document/blocks/general/section-to-box-rows-integrations.js +1 -1
  151. package/dist/render/lib/document/blocks/general/section-to-box-rows-locations.js +1 -1
  152. package/dist/render/lib/document/blocks/general/section-to-box-rows-logos.js +1 -1
  153. package/dist/render/lib/document/blocks/general/section-to-box-rows-pageheader.js +1 -1
  154. package/dist/render/lib/document/blocks/general/section-to-box-rows-promo.js +1 -1
  155. package/dist/render/lib/document/blocks/general/section-to-box-rows-proof.js +1 -1
  156. package/dist/render/lib/document/blocks/general/section-to-box-rows-stats.js +1 -1
  157. package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
  158. package/dist/render/lib/document/custom-css.d.ts +2 -1
  159. package/dist/render/lib/document/editing-bridges.d.ts +5 -1
  160. package/dist/render/lib/document/editing-bridges.js +1 -1
  161. package/dist/render/lib/document/part-styles.d.ts +3 -1
  162. package/dist/render/lib/document/part-styles.js +2 -2
  163. package/dist/render/lib/document/passes/clickable-parts.js +1 -1
  164. package/dist/render/lib/document/passes/section-custom-css.d.ts +7 -0
  165. package/dist/render/lib/document/passes/section-custom-css.js +1 -1
  166. package/dist/render/lib/document/passes/section-padding.d.ts +3 -3
  167. package/dist/render/lib/document/passes/section-padding.js +1 -1
  168. package/dist/render/lib/document/passes/section-width.js +1 -1
  169. package/dist/render/lib/document/section-css-style.d.ts +3 -1
  170. package/dist/render/lib/document/section-css-style.js +1 -1
  171. package/dist/routine-index.json +1 -1
  172. package/dist/value-index.json +1 -1
  173. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # Changelog
2
2
 
3
+ ## 74.3.0 - 2026-11-22
4
+
5
+ From main at `9ce39b74`: #830.
6
+
7
+ A minor: a stored section top or bottom padding is drawn once, on the section, for 25 sections; the Padding row's older-value note is per side; a card text region takes its block's size cap. New exports and a new optional block setting; no new peer, no removed path. No stored key or value moves. A section with nothing stored, or an older value without `padTotal`, draws main's bytes (310-case fixture in `test-section-one-padding`).
8
+
9
+ **For hosts:**
10
+ - No host step. storefront-blocks declares the product name cap (`partSizeCaps: { "@name": true }`) in its own PR (batch 2).
11
+
12
+ ### Fixed
13
+
14
+ - **A stored top or bottom total is drawn once, on the section.** Before, a section with a vertical padding of its own drew a stored Padding top or bottom in the outer wrapper (`.sf-section-pad`) and its own class inside it, so "top 40" drew 40 plus its own padding. Now, once a top or bottom is a total (its key in `padTotal`, written by an edit of the Padding row), the element that draws the section's own padding draws it once (`sectionRootPad`, `withRootPad`, `lib/content/section-own-pads`) and the wrapper keeps the sides only. Sections: Banner, Cards, Chart, ContactLocations, Countdown, DocBody, DocMasthead, DocMetaCards, FAQ, FeaturedCover, Grid, Integrations, KeyFeatures, Logos, LongRead, Masthead, Mockup, OrderSummary, PaymentBadges, Prose, SectionHeader, Series, Stats, Testimonials, Ticker. Manifesto and Split are not changed (their padding is on a words column, `NO_OWN_PAD`). Look change on newly edited values only. A guard, `test-section-one-padding`, fails a new section with its own vertical padding until it names its frame in `SECTION_OWN_PADS`. (#830)
15
+ - **The Padding row's older-value note is per side.** While a top or bottom value is an older one, the row of that side gives the frame of that side ("plus 40 px (older setting)"), and nothing when that frame is 0. Before, only the top rows spoke, with the top frame. (#830)
16
+
17
+ ### Added
18
+
19
+ - **A card text region takes its block's size cap.** A block that names a kind in `partSizeCaps` (for example `{ "@name": true }`) caps the region's size in the published sheet and on the canvas (`BlockSizeCapsProvider`, `lib/document/editing-bridges`). Each block sets its own caps; a nested block gets none of its parent's. A block that names no kind draws the same bytes. (#830)
20
+ - One home for the own pads of these sections: `lib/content/section-own-pads` (`FAQ_OWN`, `LONG_READ_OWN`, `GRID_OWN`, `TESTIMONIALS_OWN`, ...). The section-to-box rows read the same names; converter output is unchanged. (#830)
21
+
22
+ ## 74.2.0 - 2026-11-22
23
+
24
+ From main at `65a9e17d`: #827, #828.
25
+
26
+ A minor: the site-footer page's root settings get one "Website" group (count the site's side space once, one office list for the website, the site's own Custom CSS), and the Add page window's card area scrolls. New exports and new optional root props; no new peer, no removed path. No stored key or value moves. A site without the three values draws the same bytes as before (`test-site-root-bytes`).
27
+
28
+ **For hosts:**
29
+ - storefront: wrap the page in `SiteRootPropsProvider` (`components/SiteRootProps`) with the site-footer root props, and put `data-sf-side` (from `sideSpaceOnceAttr`, `lib/content/page-width`) and `data-sf-site-css` (from `siteCssScopeAttr`, `lib/content/site-css`) on the outermost wrapper (header + page + footer). Each hand-built route's phone/tablet rung reads the phone-room class through `withSideOnce(cls, useSideSpaceOnce())`, with its own breakpoint. Without these steps a host page draws as today.
30
+ - storefront-blocks and storefront: the files that write `--sf-site-gutter` (blocks 19, storefront 12) follow in their own PRs.
31
+ - admin-portal: no step. The admin bump checks the site Custom CSS in the real editor (not checked before this release).
32
+
33
+ ### Added
34
+
35
+ - **Count the site's side space once.** A switch, off by default: `sideSpaceOnce` (`SIDE_SPACE_ONCE_PROP`) in the site-footer page's root props. On, the page carrier gets `data-sf-side="once"` (`SIDE_ONCE_ATTR`); the outer "site" side draws the gutter and what it holds gives way (`SIDE_ONCE_HOLDS_CLASS`, the scoped twin of `BOX_HOLDS_NO_GUTTER_CLASS`; a test holds the two together). Below the phone edge (800) a switched site draws its phone side space; from 800 up a "site" section draws one count at its own step. Look change on switched sites only. A source rule, `site-gutter-once`, fails a web-builder file that draws a gutter token inside a "site" side without the switch. (#827)
36
+ - **One office list for the website.** `siteOffices` (`SITE_OFFICES_PROP`) in the site-footer root props, edited as "Offices" with the "Find coordinates" control Footprint uses (the `FootprintOffice` shape). A "Site offices" source (`SITE_OFFICES_BLOCK_SOURCE`, `lib/content/site-offices`) that Footprint and Contact/Locations read, so no section keeps a second copy. (#827)
37
+ - **The site's own Custom CSS.** `siteCustomCss` (`SITE_CSS_KEY`) in the site-footer root props, filtered like the section Custom CSS (`scopeCustomCss`) and scoped by `data-sf-site-css` (`SITE_CSS_SCOPE_ATTR`). Refused CSS does not reach the page. Like the section CSS, it has no Suspense boundary of its own: a cold `renderToString` / `renderToStaticMarkup` under the provider throws instead of sending the page without its CSS (no host path renders that way today). (#827)
38
+ - **One provider of the site-footer root props:** `SiteRootPropsProvider` and `useSiteRootProps` (`components/SiteRootProps`). The switch, the offices and the site CSS read it; with no provider, main's markup. (#827)
39
+ - The three rows are one "Website" group on the site-footer page's root settings: "Count side space once", "Offices", "Custom CSS". (#827)
40
+
41
+ ### Fixed
42
+
43
+ - **The Add page window's card area scrolls.** `.sf-add-page` (`storefront-editor.css`) fills its column and scrolls its own overflow (`flex: 1 1 0%; min-height: 0; overflow-y: auto`), as the shell `SidebarLayout` content contract asks. Before, at 1440 × 900 the cards ran past the window and the bottom cards could not be reached. A real-Chromium check, `tests/browser/addPageScroll`, holds it. (#828)
44
+
3
45
  ## 74.1.0 - 2026-11-21
4
46
 
5
47
  From main at `f81d0ed3`: #824, #825.
@@ -8,10 +8,12 @@ type PreviewFooterCtx = {
8
8
  editFooter?: () => void;
9
9
  refreshToken: number;
10
10
  refreshFooter: () => void;
11
+ chromeRootProps: Record<string, unknown> | null;
11
12
  };
12
- export declare function PreviewFooterProvider({ children, editFooter, }: {
13
+ export declare function PreviewFooterProvider({ children, editFooter, chromeRootProps, }: {
13
14
  children: ReactNode;
14
15
  editFooter?: () => void;
16
+ chromeRootProps?: Record<string, unknown> | null;
15
17
  }): import("react").JSX.Element;
16
18
  export declare const usePreviewFooter: () => PreviewFooterCtx;
17
19
  export {};
@@ -1 +1 @@
1
- "use client";import{jsx as h}from"react/jsx-runtime";import{createContext as k,useCallback as p,useContext as d,useState as e}from"react";const o=k({footerBlock:null,setFooterBlock:()=>{},headerGroup:null,setHeaderGroup:()=>{},refreshToken:0,refreshFooter:()=>{}});function v({children:r,editFooter:t}){const[s,n]=e(null),[l,u]=e(null),[c,a]=e(0),f=p(()=>a(i=>i+1),[]);return h(o.Provider,{value:{footerBlock:s,setFooterBlock:n,headerGroup:l,setHeaderGroup:u,editFooter:t,refreshToken:c,refreshFooter:f},children:r})}const P=()=>d(o);export{v as PreviewFooterProvider,P as usePreviewFooter};
1
+ "use client";import{jsx as p}from"react/jsx-runtime";import{createContext as k,useCallback as d,useContext as x,useState as e}from"react";const o=k({footerBlock:null,setFooterBlock:()=>{},headerGroup:null,setHeaderGroup:()=>{},refreshToken:0,refreshFooter:()=>{},chromeRootProps:null});function P({children:r,editFooter:t,chromeRootProps:s=null}){const[n,l]=e(null),[u,c]=e(null),[a,f]=e(0),i=d(()=>f(h=>h+1),[]);return p(o.Provider,{value:{footerBlock:n,setFooterBlock:l,headerGroup:u,setHeaderGroup:c,editFooter:t,refreshToken:a,refreshFooter:i,chromeRootProps:s},children:r})}const m=()=>x(o);export{P as PreviewFooterProvider,m as usePreviewFooter};
@@ -1,8 +1,2 @@
1
- import { type ReactNode } from "react";
2
- import { type PartStyles } from "../../render/lib/document/part-styles.js";
3
- export default function SectionTextPartBridge({ nodeId, sectionType, partStyles, children, }: {
4
- nodeId: string;
5
- sectionType: string;
6
- partStyles?: PartStyles;
7
- children: ReactNode;
8
- }): import("react").JSX.Element;
1
+ import type { SectionTextBridgeProps } from "../../render/lib/document/editing-bridges.js";
2
+ export default function SectionTextPartBridge({ nodeId, sectionType, partStyles, sizeCaps, children, }: SectionTextBridgeProps): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as x}from"react/jsx-runtime";import{useEffect as E,useRef as _}from"react";import{markOverlayPortal as I}from"../../format/lib/document/overlay-portal.js";import{measureStyleBase as O,styleTagsOf as w}from"./PreviewPartAnchors.js";import{shownTier as D}from"efficient-easel/screen/lib/document/device-fields";import{usePreviewDevice as K,usePreviewParts as N}from"efficient-easel/draw/client";import{usePartStyle as j}from"./PreviewPartStyleContext.js";import{REGION_PART_ATTR as R,encodePartId as B}from"../../render/lib/document/text-parts.js";import{TEXT_REGION_ATTR as v,textRegionOfAttr as C,textRegionPartKey as G}from"../../format/lib/sections/text-regions.js";import{regionsForSection as X}from"../../format/lib/sections/section-text-regions.js";import{TEXT_STYLE_ATTR as n,isTextStyleId as k,regionCanvasDeclarations as q,regionCanvasRestore as J,regionSheetStyle as L,regionShownDeclarations as Y}from"../../render/lib/document/part-styles.js";function $({nodeId:s,sectionType:c,partStyles:m,children:z}){const y=_(null),{selectedPartId:u}=N(),{setPartStyle:p}=j(),f=D(K()),F=JSON.stringify(m??null);return E(()=>{const S=y.current,o=X(c);if(!S||!s||!o)return;const l=[],d=Array.from(S.querySelectorAll(`[${v}]`));for(const t of d){const r=C(o,t.getAttribute(v));if(!r)continue;const g=I(t);g&&l.push(g);const T=G(r),a=B(s,T);t.setAttribute(R,a);const i=m?.[T];if(o[r].sized&&L(i)){const e=q(i,f),b={fontFamily:t.style.fontFamily,fontSize:t.style.fontSize},A=t.getAttribute(n);e.fontFamily&&(t.style.fontFamily=e.fontFamily),e.fontSize&&(t.style.fontSize=e.fontSize);const h={fontFamily:e.fontFamily?t.style.fontFamily:void 0,fontSize:e.fontSize?t.style.fontSize:void 0},P=i?.textStyle;k(P)&&t.setAttribute(n,P),l.push(()=>{J(t.style,b,h),A===null?t.removeAttribute(n):t.setAttribute(n,A)})}if(a===u){const e=O(t,Y(i,o[r],f));p({partId:a,...w(t),base:e})}}return()=>{for(const t of l)t();for(const t of d)t.removeAttribute(R)}},[s,c,u,p,f,F]),x("div",{ref:y,style:{display:"contents"},children:z})}export{$ as default};
1
+ "use client";import{jsx as E}from"react/jsx-runtime";import{useEffect as _,useRef as I}from"react";import{markOverlayPortal as O}from"../../format/lib/document/overlay-portal.js";import{measureStyleBase as w,styleTagsOf as C}from"./PreviewPartAnchors.js";import{shownTier as D}from"efficient-easel/screen/lib/document/device-fields";import{usePreviewDevice as K,usePreviewParts as N}from"efficient-easel/draw/client";import{usePartStyle as j}from"./PreviewPartStyleContext.js";import{REGION_PART_ATTR as v,encodePartId as k}from"../../render/lib/document/text-parts.js";import{TEXT_REGION_ATTR as z,textRegionOfAttr as B,textRegionPartKey as G}from"../../format/lib/sections/text-regions.js";import{regionsForSection as X}from"../../format/lib/sections/section-text-regions.js";import{TEXT_STYLE_ATTR as n,blockCapsPartSize as q,isTextStyleId as J,regionCanvasDeclarations as L,regionCanvasRestore as Y,regionSheetStyle as $,regionShownDeclarations as H}from"../../render/lib/document/part-styles.js";function M({nodeId:s,sectionType:m,partStyles:y,sizeCaps:u,children:b}){const p=I(null),{selectedPartId:S}=N(),{setPartStyle:d}=j(),f=D(K()),F=JSON.stringify([y??null,u??null]);return _(()=>{const g=p.current,o=X(m);if(!g||!s||!o)return;const l=[],T=Array.from(g.querySelectorAll(`[${z}]`));for(const t of T){const r=B(o,t.getAttribute(z));if(!r)continue;const A=O(t);A&&l.push(A);const a=G(r),c=k(s,a);t.setAttribute(v,c);const i=y?.[a];if(o[r].sized&&$(i)){const e=L(i,f,{sizeCap:q(u,a)}),h={fontFamily:t.style.fontFamily,fontSize:t.style.fontSize},P=t.getAttribute(n);e.fontFamily&&(t.style.fontFamily=e.fontFamily),e.fontSize&&(t.style.fontSize=e.fontSize);const x={fontFamily:e.fontFamily?t.style.fontFamily:void 0,fontSize:e.fontSize?t.style.fontSize:void 0},R=i?.textStyle;J(R)&&t.setAttribute(n,R),l.push(()=>{Y(t.style,h,x),P===null?t.removeAttribute(n):t.setAttribute(n,P)})}if(c===S){const e=w(t,H(i,o[r],f));d({partId:c,...C(t),base:e})}}return()=>{for(const t of l)t();for(const t of T)t.removeAttribute(v)}},[s,m,S,d,f,F]),E("div",{ref:p,style:{display:"contents"},children:b})}export{M as default};
@@ -1 +1 @@
1
- "use client";import{jsx as a,jsxs as wt}from"react/jsx-runtime";import{useCallback as o,useEffect as f,useMemo as Ct,useRef as g,useState as r}from"react";import"efficient-easel/easel.css";import"efficient-easel/shell.css";import"efficient-easel/rail.css";import"efficient-easel/panel.css";import"efficient-easel/fields.css";import"efficient-easel/pick.css";import"efficient-easel/copy.css";import"efficient-easel/gold.css";import"efficient-easel/text-styles.css";import"efficient-easel/menu.css";import"efficient-easel/chrome.css";import"efficient-easel/tree.css";import"efficient-easel/drag.css";import"efficient-easel/screen.css";import"./storefront-editor.css";import{useHostConfig as _t}from"../lib/document/host-config.js";import{ChromeWrap as Pt}from"efficient-easel/screen/lib/host-chrome";import{refreshSiteLiveState as Tt}from"../lib/site-live-state.js";import{holdSiteWrites as Et}from"../../format/lib/site-writes.js";import{backendOf as k}from"../lib/website-session.js";import{useEaselSession as yt}from"efficient-easel/screen/lib/session-context";import{withSiteBlockGapFields as Gt}from"../../format/lib/document/site-gap-fields.js";import{withTemplateMediaPlaceholders as vt}from"../../format/lib/document/templateFields.js";import{setEditorPage as he}from"../../format/lib/document/editor-page-context.js";import{EditorPagePathProvider as Ht}from"./EditorPagePathProvider.js";import{AddPageOnOpen as Wt}from"./AddPageOnOpen.js";import{resolveSiteName as kt}from"../../format/lib/content/site-name.js";import{normalizeSiteGutter as Bt,normalizeSiteGutterPhone as Rt,normalizeSiteWidth as Ft}from"../../format/lib/content/page-width.js";import{siteLengthNumber as w,siteLengthUnitsOfRow as It}from"../../format/lib/content/css-length.js";import{normalizeSiteBackground as ue}from"../../format/lib/content/section-width.js";import{normalizeSiteBlockGap as le}from"../../format/lib/content/container-gap.js";import Dt,{DocumentScreen as Ot}from"efficient-easel/screen/components/ScreenMount";import Mt from"./WebsiteHintsProvider.js";import{useScreenDocument as bt}from"efficient-easel/screen/components/ScreenDocumentContext";import{PreviewHeaderProvider as Nt,siteThemeRow as xt,themeEdited as Ut,themeSeeded as At}from"../../render/components/PreviewHeaderContext.js";import{PreviewFooterProvider as Lt}from"./PreviewFooterContext.js";import{PreviewChatProvider as zt,DEFAULT_CHAT_PREVIEW as Yt}from"./PreviewChatContext.js";import{PreviewSocialProvider as jt}from"../../render/components/PreviewSocialContext.js";import{useSocialSettings as Kt}from"./useSocialSettings.js";import{PreviewSurfaceProvider as Vt}from"./PreviewSurfaceContext.js";import{WEBSITE_ADDRESSING as Xt}from"../lib/website-document-addressing.js";import{PreviewTickerProvider as Zt}from"../../render/components/PreviewTickerContext.js";import{PreviewHeroPartProvider as qt}from"../../render/components/PreviewHeroPartContext.js";import{PreviewPartsProvider as Jt}from"efficient-easel/draw/client";import{CanvasPartsBridge as Qt}from"./CanvasPartsBridge.js";import{PreviewLocationPartProvider as $t}from"../../render/components/PreviewLocationPartContext.js";import{PreviewPartStyleProvider as er}from"./PreviewPartStyleContext.js";import{CORNER_STYLE_TO_PX as tr,DEFAULT_HEADING_COMPRESSION as rr,DEFAULT_HEADING_TYPOGRAPHY as or,DEFAULT_SWITCH_SHOWN as B,DEFAULT_SIZES as nr,DEFAULT_THEME_MODE as T,normalizeCornerRadius as ir,normalizeCornerStyle as ar,normalizeCardShadow as cr,normalizeCardGap as sr,normalizeHoverEffect as dr,IDENTITY_CARD_GAP as me,IDENTITY_CARD_SHADOW as hr,IDENTITY_HOVER_EFFECT as ur,THEME_MODE_KEY as pe,THEME_STORAGE_KEY as lr,THEME_SWITCH_HIDE as Se,THEME_SWITCH_KEY as R}from"../../format/lib/theme.js";import{pictureShadowColor as mr}from"efficient-easel/screen/lib/document/shadow-values";import{DEFAULT_FONTS as pr}from"../../format/lib/fonts.js";import{WEBSITE_SCREEN as Sr}from"./WebsiteScreenParts.js";import{routeWebsiteHostMessage as fr}from"../../format/lib/website-host-inbound.js";import{siteTextFromRow as gr}from"../../render/lib/text-styles/site-text-styles.js";import{wordStylesFromRow as wr}from"../../format/lib/word-styles.js";import{chatPreviewFrom as Cr}from"./PreviewChatContext.js";import{parseOption as _r}from"efficient-shell/format";import{THEME_MODES as Pr}from"../../format/lib/theme.js";const Tr=()=>{if(typeof window>"u")return T;try{const d=window.localStorage.getItem(pe);return _r(Pr,T,d)}catch{return T}},fe=d=>{if(!(typeof window>"u"))try{window.localStorage.setItem(pe,d)}catch{}},Er=()=>{if(typeof window>"u")return B;try{return window.localStorage.getItem(R)!==Se}catch{return B}},yr=()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem(lr)}catch{}},ge=d=>{if(!(typeof window>"u"))try{d?window.localStorage.removeItem(R):window.localStorage.setItem(R,Se)}catch{}};function Gr(){const{adapter:d,capabilities:s,templateId:F,ready:_,token:h,siteId:c,currentSlug:I,currentKind:D}=bt();f(()=>(he(I,D),()=>he(null,null)),[I,D]);const E=s.placeholderFrames,[we,O]=r(null),[Ce,M]=r("");f(()=>{const e=d.templateName;if(!_||!F||!e){M("");return}let i=!1;return e().then(u=>!i&&M(u??"")).catch(()=>{}),()=>{i=!0}},[_,h,F,d]);const[_e,y]=r(T),[Pe,G]=r(B),[b,N]=r({value:{selected:0,themes:[]},readFor:null}),Te=b.value,[Ee,x]=r(pr),[ye,U]=r(nr),[Ge,A]=r(null),[ve,L]=r(rr),[He,z]=r(null),[We,Y]=r(null),[ke,j]=r(me),[Be,K]=r(null),[Re,V]=r(null),[Fe,X]=r(null),[Ie,Z]=r(null),[v,q]=r(null),[H,J]=r(null),[De,Q]=r({}),Oe=o(e=>Q(i=>({...i,...e})),[]),l=yt(),$=_t(),Me=Ct(()=>Gt(vt($,E),v,H),[$,E,v,H]),[be,ee]=r(or),[Ne,te]=r(null),[xe,re]=r(null),[Ue,oe]=r(null),[Ae,ne]=r(null),[Le,ie]=r(null),ae=g(null),n=g(!1);f(()=>{y(Tr()),G(Er())},[]);const ze=o(e=>{n.current=!0,yr(),fe(e),y(e)},[]),Ye=o(e=>{n.current=!0,ge(e),G(e)},[]),je=o(e=>{n.current=!0,N(i=>Ut(i,e,c??""))},[c]),Ke=o(e=>{n.current=!0,x(e)},[]),Ve=o(e=>{n.current=!0,U(e)},[]),Xe=o(e=>{n.current=!0,A(e)},[]),Ze=o(e=>{n.current=!0,L(e)},[]),qe=o(e=>{n.current=!0,z(e)},[]),Je=o(e=>{n.current=!0,Y(e)},[]),Qe=o(e=>{n.current=!0,j(e)},[]),$e=o(e=>{n.current=!0,K(e)},[]),et=o(e=>{n.current=!0,ee(e)},[]),[tt,ce]=r(null),[rt,ot]=r(null),nt=o(e=>{n.current=!0,ce(e)},[]),it=o(e=>{n.current=!0,V(e)},[]),at=o(e=>{n.current=!0,X(e)},[]),ct=o(e=>{n.current=!0,Z(e)},[]),st=o(e=>{n.current=!0,q(e)},[]),dt=o(e=>{n.current=!0,J(e)},[]),ht=o(e=>{n.current=!0,te(e)},[]),ut=o(e=>{n.current=!0,re(e)},[]),lt=o(e=>{n.current=!0,oe(e)},[]),mt=o(e=>{n.current=!0,ne(e)},[]),pt=o(e=>{n.current=!0,ie(e)},[]);f(()=>{const e=k(l).theme;if(!h||!s.hasSiteTheme||!e)return;const i=c??"";ae.current!==i&&(ae.current=i,n.current=!1);let u=!1;return e.get(c?{siteId:c}:void 0).then(t=>{if(u||n.current)return;fe(t.default_mode),ge(t.show_theme_switch),y(t.default_mode),G(t.show_theme_switch),N(At({selected:t.selected_preset,themes:t.theme_presets},i));const C=gr(t);x(C.fonts),U(C.sizes);const S=It(t);Q(S),A(t.corner_radius_px===void 0?tr[ar(t.corner_style)]:w(t.corner_radius_px,S.cornerRadiusUnit,ir)),L(C.compression),z(t.card_shadow==null?hr:cr(t.card_shadow)),j(t.card_gap==null?me:sr(t.card_gap)),K(t.hover_effect==null?ur:dr(t.hover_effect)),Y(mr(t.shadow_color)),V(w(t.site_width,S.siteWidthUnit,Ft)),X(w(t.site_gutter,S.siteGutterUnit,Bt)),Z(w(t.site_gutter_phone,S.siteGutterPhoneUnit,Rt)),q(w(t.block_gap,S.blockGapUnit,le)),J(w(t.block_gap_phone,S.blockGapPhoneUnit,le)),ee(C.typography),ce(C.textStyles),ot(wr(t)),te(t.hero_background_follows_width===!0),re(ue(t.section_background_width)),oe(ue(t.section_content_width)),ne(t.photography_grayscale===!0),ie(t.share_button_on_posts===!0)}).catch(()=>{}),()=>{u=!0}},[h,c,s.hasSiteTheme,l]);const St=Kt({token:h,siteId:c,enabled:s.hasSiteSettings}),[ft,se]=r(Yt),de=g(null),W=g(!1),m=g(null),p=g({}),P=o(async()=>{m.current&&clearTimeout(m.current),m.current=null;const e=p.current;p.current={};try{await k(l).chat?.update(e,c?{siteId:c}:void 0),Tt()}catch(i){throw p.current={...e,...p.current},i}},[l,c]);f(()=>Et(()=>m.current||Object.keys(p.current).length>0?P():void 0),[P]);const gt=o(e=>{W.current=!0,se(i=>({...i,...e})),!(!s.hasSiteSettings||!h)&&(p.current={...p.current,...e},m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{P().catch(()=>{})},500))},[s.hasSiteSettings,h,P]);return f(()=>{if(!h||!s.hasSiteSettings)return;const e=c??"";de.current!==e&&(de.current=e,W.current=!1);let i=!1;const u=k(l).chat;if(u)return u.get(c?{siteId:c}:void 0).then(t=>{i||W.current||se(Cr(t))}).catch(()=>{}),()=>{i=!0}},[h,c,s.hasSiteSettings,l]),f(()=>{const e=d.site;if(!_||!s.hasSiteRecord||!e){O(null);return}let i=!1;return e().then(u=>{i||O(kt(u.name))}).catch(()=>{}),()=>{i=!0}},[_,h,s.hasSiteRecord,c,d]),a(Ot,{config:Me,parts:Sr,wrap:(e,i)=>a(Nt,{websiteName:we,templateChrome:E,templateName:Ce||null,themeMode:_e,onThemeModeChange:ze,themeSwitchShown:Pe,onThemeSwitchShownChange:Ye,theme:Te,themeRow:xt(s.hasSiteTheme,b.readFor,c??""),onThemeChange:je,fonts:Ee,onFontsChange:Ke,cornerRadiusPx:Ge,onCornerRadiusPxChange:Xe,cardShadow:He,onCardShadowChange:qe,shadowColor:We,onShadowColorChange:Je,cardGap:ke,onCardGapChange:Qe,hoverEffect:Be,onHoverEffectChange:$e,headingCompression:ve,onHeadingCompressionChange:Ze,headingTypography:be,onHeadingTypographyChange:et,textStyles:tt,onTextStylesChange:nt,wordStyles:rt,sizes:ye,onSizesChange:Ve,siteWidth:Re,onSiteWidthChange:it,siteGutter:Fe,onSiteGutterChange:at,siteGutterPhone:Ie,onSiteGutterPhoneChange:ct,blockGap:v,onBlockGapChange:st,blockGapPhone:H,onBlockGapPhoneChange:dt,siteLengthUnits:De,onSiteLengthUnitsChange:Oe,heroBackgroundFollowsWidth:Ne,onHeroBackgroundFollowsWidthChange:ht,sectionBackgroundWidth:xe,onSectionBackgroundWidthChange:ut,sectionContentWidth:Ue,onSectionContentWidthChange:lt,photographyGrayscale:Ae,onPhotographyGrayscaleChange:mt,shareButtonOnPosts:Le,onShareButtonOnPostsChange:pt,themeFromDocument:!s.hasSiteTheme,children:a(Lt,{children:a(Pt,{wrap:l.chrome?.wrap,surface:"page",children:a(Zt,{children:a(qt,{children:a(Jt,{children:a($t,{children:a(Qt,{children:wt(er,{children:[a(zt,{chat:ft,onChatChange:gt,children:a(jt,{value:St,children:a(Vt,{children:a(Ht,{children:a(Mt,{children:e})})})})}),i]})})})})})})})})})})}function vr({target:d,openAddPage:s}){return a(Wt,{open:s,children:a(Dt,{target:d,addressing:Xt,onHostMessage:fr,children:a(Gr,{})})})}export{vr as default};
1
+ "use client";import{jsx as a,jsxs as Ct}from"react/jsx-runtime";import{useCallback as o,useEffect as f,useMemo as _t,useRef as g,useState as r}from"react";import"efficient-easel/easel.css";import"efficient-easel/shell.css";import"efficient-easel/rail.css";import"efficient-easel/panel.css";import"efficient-easel/fields.css";import"efficient-easel/pick.css";import"efficient-easel/copy.css";import"efficient-easel/gold.css";import"efficient-easel/text-styles.css";import"efficient-easel/menu.css";import"efficient-easel/chrome.css";import"efficient-easel/tree.css";import"efficient-easel/drag.css";import"efficient-easel/screen.css";import"./storefront-editor.css";import{useHostConfig as Pt}from"../lib/document/host-config.js";import{ChromeWrap as Tt}from"efficient-easel/screen/lib/host-chrome";import{refreshSiteLiveState as Et}from"../lib/site-live-state.js";import{holdSiteWrites as yt}from"../../format/lib/site-writes.js";import{backendOf as k}from"../lib/website-session.js";import{useEaselSession as Gt}from"efficient-easel/screen/lib/session-context";import{withSiteBlockGapFields as vt}from"../../format/lib/document/site-gap-fields.js";import{withTemplateMediaPlaceholders as Ht}from"../../format/lib/document/templateFields.js";import{setEditorPage as he}from"../../format/lib/document/editor-page-context.js";import{EditorPagePathProvider as Wt}from"./EditorPagePathProvider.js";import{AddPageOnOpen as kt}from"./AddPageOnOpen.js";import{resolveSiteName as Rt}from"../../format/lib/content/site-name.js";import{normalizeSiteGutter as Bt,normalizeSiteGutterPhone as Ft,normalizeSiteWidth as It}from"../../format/lib/content/page-width.js";import{siteLengthNumber as w,siteLengthUnitsOfRow as Dt}from"../../format/lib/content/css-length.js";import{normalizeSiteBackground as ue}from"../../format/lib/content/section-width.js";import{normalizeSiteBlockGap as le}from"../../format/lib/content/container-gap.js";import Ot,{DocumentScreen as Mt}from"efficient-easel/screen/components/ScreenMount";import bt from"./WebsiteHintsProvider.js";import{useScreenDocument as Nt}from"efficient-easel/screen/components/ScreenDocumentContext";import{PreviewHeaderProvider as xt,siteThemeRow as Ut,themeEdited as At,themeSeeded as Lt}from"../../render/components/PreviewHeaderContext.js";import{PreviewFooterProvider as zt}from"./PreviewFooterContext.js";import{usePinnedChromeState as Yt}from"./usePinnedChromeState.js";import{PreviewChatProvider as jt,DEFAULT_CHAT_PREVIEW as Kt}from"./PreviewChatContext.js";import{PreviewSocialProvider as Vt}from"../../render/components/PreviewSocialContext.js";import{useSocialSettings as Xt}from"./useSocialSettings.js";import{PreviewSurfaceProvider as Zt}from"./PreviewSurfaceContext.js";import{WEBSITE_ADDRESSING as qt}from"../lib/website-document-addressing.js";import{PreviewTickerProvider as Jt}from"../../render/components/PreviewTickerContext.js";import{PreviewHeroPartProvider as Qt}from"../../render/components/PreviewHeroPartContext.js";import{PreviewPartsProvider as $t}from"efficient-easel/draw/client";import{CanvasPartsBridge as er}from"./CanvasPartsBridge.js";import{PreviewLocationPartProvider as tr}from"../../render/components/PreviewLocationPartContext.js";import{PreviewPartStyleProvider as rr}from"./PreviewPartStyleContext.js";import{CORNER_STYLE_TO_PX as or,DEFAULT_HEADING_COMPRESSION as nr,DEFAULT_HEADING_TYPOGRAPHY as ir,DEFAULT_SWITCH_SHOWN as R,DEFAULT_SIZES as ar,DEFAULT_THEME_MODE as T,normalizeCornerRadius as cr,normalizeCornerStyle as sr,normalizeCardShadow as dr,normalizeCardGap as hr,normalizeHoverEffect as ur,IDENTITY_CARD_GAP as me,IDENTITY_CARD_SHADOW as lr,IDENTITY_HOVER_EFFECT as mr,THEME_MODE_KEY as pe,THEME_STORAGE_KEY as pr,THEME_SWITCH_HIDE as Se,THEME_SWITCH_KEY as B}from"../../format/lib/theme.js";import{pictureShadowColor as Sr}from"efficient-easel/screen/lib/document/shadow-values";import{DEFAULT_FONTS as fr}from"../../format/lib/fonts.js";import{WEBSITE_SCREEN as gr}from"./WebsiteScreenParts.js";import{routeWebsiteHostMessage as wr}from"../../format/lib/website-host-inbound.js";import{siteTextFromRow as Cr}from"../../render/lib/text-styles/site-text-styles.js";import{wordStylesFromRow as _r}from"../../format/lib/word-styles.js";import{chatPreviewFrom as Pr}from"./PreviewChatContext.js";import{parseOption as Tr}from"efficient-shell/format";import{THEME_MODES as Er}from"../../format/lib/theme.js";const yr=()=>{if(typeof window>"u")return T;try{const d=window.localStorage.getItem(pe);return Tr(Er,T,d)}catch{return T}},fe=d=>{if(!(typeof window>"u"))try{window.localStorage.setItem(pe,d)}catch{}},Gr=()=>{if(typeof window>"u")return R;try{return window.localStorage.getItem(B)!==Se}catch{return R}},vr=()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem(pr)}catch{}},ge=d=>{if(!(typeof window>"u"))try{d?window.localStorage.removeItem(B):window.localStorage.setItem(B,Se)}catch{}};function Hr(){const{adapter:d,capabilities:s,templateId:F,ready:_,token:h,siteId:c,currentSlug:I,currentKind:D}=Nt();f(()=>(he(I,D),()=>he(null,null)),[I,D]);const we=Yt(d?.pinnedChrome)?.rootProps??null,E=s.placeholderFrames,[Ce,O]=r(null),[_e,M]=r("");f(()=>{const e=d.templateName;if(!_||!F||!e){M("");return}let i=!1;return e().then(u=>!i&&M(u??"")).catch(()=>{}),()=>{i=!0}},[_,h,F,d]);const[Pe,y]=r(T),[Te,G]=r(R),[b,N]=r({value:{selected:0,themes:[]},readFor:null}),Ee=b.value,[ye,x]=r(fr),[Ge,U]=r(ar),[ve,A]=r(null),[He,L]=r(nr),[We,z]=r(null),[ke,Y]=r(null),[Re,j]=r(me),[Be,K]=r(null),[Fe,V]=r(null),[Ie,X]=r(null),[De,Z]=r(null),[v,q]=r(null),[H,J]=r(null),[Oe,Q]=r({}),Me=o(e=>Q(i=>({...i,...e})),[]),l=Gt(),$=Pt(),be=_t(()=>vt(Ht($,E),v,H),[$,E,v,H]),[Ne,ee]=r(ir),[xe,te]=r(null),[Ue,re]=r(null),[Ae,oe]=r(null),[Le,ne]=r(null),[ze,ie]=r(null),ae=g(null),n=g(!1);f(()=>{y(yr()),G(Gr())},[]);const Ye=o(e=>{n.current=!0,vr(),fe(e),y(e)},[]),je=o(e=>{n.current=!0,ge(e),G(e)},[]),Ke=o(e=>{n.current=!0,N(i=>At(i,e,c??""))},[c]),Ve=o(e=>{n.current=!0,x(e)},[]),Xe=o(e=>{n.current=!0,U(e)},[]),Ze=o(e=>{n.current=!0,A(e)},[]),qe=o(e=>{n.current=!0,L(e)},[]),Je=o(e=>{n.current=!0,z(e)},[]),Qe=o(e=>{n.current=!0,Y(e)},[]),$e=o(e=>{n.current=!0,j(e)},[]),et=o(e=>{n.current=!0,K(e)},[]),tt=o(e=>{n.current=!0,ee(e)},[]),[rt,ce]=r(null),[ot,nt]=r(null),it=o(e=>{n.current=!0,ce(e)},[]),at=o(e=>{n.current=!0,V(e)},[]),ct=o(e=>{n.current=!0,X(e)},[]),st=o(e=>{n.current=!0,Z(e)},[]),dt=o(e=>{n.current=!0,q(e)},[]),ht=o(e=>{n.current=!0,J(e)},[]),ut=o(e=>{n.current=!0,te(e)},[]),lt=o(e=>{n.current=!0,re(e)},[]),mt=o(e=>{n.current=!0,oe(e)},[]),pt=o(e=>{n.current=!0,ne(e)},[]),St=o(e=>{n.current=!0,ie(e)},[]);f(()=>{const e=k(l).theme;if(!h||!s.hasSiteTheme||!e)return;const i=c??"";ae.current!==i&&(ae.current=i,n.current=!1);let u=!1;return e.get(c?{siteId:c}:void 0).then(t=>{if(u||n.current)return;fe(t.default_mode),ge(t.show_theme_switch),y(t.default_mode),G(t.show_theme_switch),N(Lt({selected:t.selected_preset,themes:t.theme_presets},i));const C=Cr(t);x(C.fonts),U(C.sizes);const S=Dt(t);Q(S),A(t.corner_radius_px===void 0?or[sr(t.corner_style)]:w(t.corner_radius_px,S.cornerRadiusUnit,cr)),L(C.compression),z(t.card_shadow==null?lr:dr(t.card_shadow)),j(t.card_gap==null?me:hr(t.card_gap)),K(t.hover_effect==null?mr:ur(t.hover_effect)),Y(Sr(t.shadow_color)),V(w(t.site_width,S.siteWidthUnit,It)),X(w(t.site_gutter,S.siteGutterUnit,Bt)),Z(w(t.site_gutter_phone,S.siteGutterPhoneUnit,Ft)),q(w(t.block_gap,S.blockGapUnit,le)),J(w(t.block_gap_phone,S.blockGapPhoneUnit,le)),ee(C.typography),ce(C.textStyles),nt(_r(t)),te(t.hero_background_follows_width===!0),re(ue(t.section_background_width)),oe(ue(t.section_content_width)),ne(t.photography_grayscale===!0),ie(t.share_button_on_posts===!0)}).catch(()=>{}),()=>{u=!0}},[h,c,s.hasSiteTheme,l]);const ft=Xt({token:h,siteId:c,enabled:s.hasSiteSettings}),[gt,se]=r(Kt),de=g(null),W=g(!1),m=g(null),p=g({}),P=o(async()=>{m.current&&clearTimeout(m.current),m.current=null;const e=p.current;p.current={};try{await k(l).chat?.update(e,c?{siteId:c}:void 0),Et()}catch(i){throw p.current={...e,...p.current},i}},[l,c]);f(()=>yt(()=>m.current||Object.keys(p.current).length>0?P():void 0),[P]);const wt=o(e=>{W.current=!0,se(i=>({...i,...e})),!(!s.hasSiteSettings||!h)&&(p.current={...p.current,...e},m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{P().catch(()=>{})},500))},[s.hasSiteSettings,h,P]);return f(()=>{if(!h||!s.hasSiteSettings)return;const e=c??"";de.current!==e&&(de.current=e,W.current=!1);let i=!1;const u=k(l).chat;if(u)return u.get(c?{siteId:c}:void 0).then(t=>{i||W.current||se(Pr(t))}).catch(()=>{}),()=>{i=!0}},[h,c,s.hasSiteSettings,l]),f(()=>{const e=d.site;if(!_||!s.hasSiteRecord||!e){O(null);return}let i=!1;return e().then(u=>{i||O(Rt(u.name))}).catch(()=>{}),()=>{i=!0}},[_,h,s.hasSiteRecord,c,d]),a(Mt,{config:be,parts:gr,wrap:(e,i)=>a(xt,{websiteName:Ce,templateChrome:E,templateName:_e||null,themeMode:Pe,onThemeModeChange:Ye,themeSwitchShown:Te,onThemeSwitchShownChange:je,theme:Ee,themeRow:Ut(s.hasSiteTheme,b.readFor,c??""),onThemeChange:Ke,fonts:ye,onFontsChange:Ve,cornerRadiusPx:ve,onCornerRadiusPxChange:Ze,cardShadow:We,onCardShadowChange:Je,shadowColor:ke,onShadowColorChange:Qe,cardGap:Re,onCardGapChange:$e,hoverEffect:Be,onHoverEffectChange:et,headingCompression:He,onHeadingCompressionChange:qe,headingTypography:Ne,onHeadingTypographyChange:tt,textStyles:rt,onTextStylesChange:it,wordStyles:ot,sizes:Ge,onSizesChange:Xe,siteWidth:Fe,onSiteWidthChange:at,siteGutter:Ie,onSiteGutterChange:ct,siteGutterPhone:De,onSiteGutterPhoneChange:st,blockGap:v,onBlockGapChange:dt,blockGapPhone:H,onBlockGapPhoneChange:ht,siteLengthUnits:Oe,onSiteLengthUnitsChange:Me,heroBackgroundFollowsWidth:xe,onHeroBackgroundFollowsWidthChange:ut,sectionBackgroundWidth:Ue,onSectionBackgroundWidthChange:lt,sectionContentWidth:Ae,onSectionContentWidthChange:mt,photographyGrayscale:Le,onPhotographyGrayscaleChange:pt,shareButtonOnPosts:ze,onShareButtonOnPostsChange:St,themeFromDocument:!s.hasSiteTheme,children:a(zt,{chromeRootProps:we,children:a(Tt,{wrap:l.chrome?.wrap,surface:"page",children:a(Jt,{children:a(Qt,{children:a($t,{children:a(tr,{children:a(er,{children:Ct(rr,{children:[a(jt,{chat:gt,onChatChange:wt,children:a(Vt,{value:ft,children:a(Zt,{children:a(Wt,{children:a(bt,{children:e})})})})}),i]})})})})})})})})})})}function Wr({target:d,openAddPage:s}){return a(kt,{open:s,children:a(Ot,{target:d,addressing:qt,onHostMessage:wr,children:a(Hr,{})})})}export{Wr as default};
@@ -1673,7 +1673,14 @@
1673
1673
  its two lines of words, the gap above "From your template", and the card.
1674
1674
  The window is portalled to <body>, outside the screen's `.sf-editor` scope,
1675
1675
  so it reads the shell's own root tokens (`--ink*`, `--line`). */
1676
+ /* The card area fills the shell SidebarLayout's content column and scrolls its
1677
+ own overflow (the layout's contract: a child that fills the pane takes
1678
+ `min-h-0 flex-1`), so the last card can be reached. The sidebar keeps its
1679
+ own scroll. */
1676
1680
  .sf-add-page {
1681
+ flex: 1 1 0%;
1682
+ min-height: 0;
1683
+ overflow-y: auto;
1677
1684
  padding: var(--space-32) var(--space-48);
1678
1685
  }
1679
1686
  /* The main area takes the window's first focus (initialFocus), so a mouse
@@ -1 +1 @@
1
- import{jsx as a}from"react/jsx-runtime";import p from"../../../../../components/LocationsGroupedField.js";import{splitLegacyRegion as m}from"../../../../../../format/lib/content/contact.js";import{BLOCK_SOURCE_ROWS_PROP as l}from"../../../../../../format/lib/content/block-sources.js";import{blockSourceField as d,blockSourceFields as u}from"../../../block-source-fields.js";import{needsGeocodeWork as g,resolveGeocodeRows as f}from"../../../geocode-resolve.js";const _={fields:{dataSource:d("Location content","Manual"),locations:{type:"custom",render:({value:o,onChange:r})=>a(p,{value:o,onChange:r})}},resolveData:async o=>{const r=o.props,e=r.locations??[];if(!g(e))return o;const n=await f(e,t=>{const s=m(t.region);return[String(t.address??"").replace(/\s*\n+\s*/g,", "),t.name,String(t.state??"").trim()||s.state,String(t.country??"").trim()||s.country].map(c=>String(c??"").trim()).filter(Boolean).join(", ")}),{[l]:S,...i}=r;return{...o,props:{...i,locations:n}}},resolveFields:(o,{fields:r})=>u("ContactLocations",r,o.props)};export{_ as ContactLocationsFields};
1
+ import{jsx as a}from"react/jsx-runtime";import{group as p}from"efficient-easel/screen/lib/document/box-fields";import m from"../../../../../components/LocationsGroupedField.js";import{splitLegacyRegion as l}from"../../../../../../format/lib/content/contact.js";import{BLOCK_SOURCE_ROWS_PROP as f}from"../../../../../../format/lib/content/block-sources.js";import{blockSourceField as d,blockSourceFields as u}from"../../../block-source-fields.js";import{needsGeocodeWork as g,resolveGeocodeRows as S}from"../../../geocode-resolve.js";const k={fields:{_gOffices:p("Offices"),dataSource:d("Location content","Manual"),locations:{type:"custom",render:({value:o,onChange:r})=>a(m,{value:o,onChange:r})}},resolveData:async o=>{const r=o.props,t=r.locations??[];if(!g(t))return o;const n=await S(t,e=>{const s=l(e.region);return[String(e.address??"").replace(/\s*\n+\s*/g,", "),e.name,String(e.state??"").trim()||s.state,String(e.country??"").trim()||s.country].map(c=>String(c??"").trim()).filter(Boolean).join(", ")}),{[f]:y,...i}=r;return{...o,props:{...i,locations:n}}},resolveFields:(o,{fields:r})=>u("ContactLocations",r,o.props)};export{k as ContactLocationsFields};
@@ -1,2 +1,5 @@
1
+ import { type FootprintOffice } from "../../../../../../format/lib/content/footprint.js";
1
2
  import type { BlockFields } from "../../../../../../format/lib/document/blocks/block-types.js";
3
+ export declare function resolveOfficeCoords(offices: readonly FootprintOffice[]): Promise<readonly FootprintOffice[]>;
2
4
  export declare const FootprintFields: BlockFields;
5
+ export declare const FOOTPRINT_OFFICES_FIELD: import("efficient-easel/blocks").Field<any>;
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{FOOTPRINT_DEFAULTS as A,FOOTPRINT_LIST_COLUMNS as C,FOOTPRINT_LIST_COLUMNS_DEFAULT as g,FOOTPRINT_MAP_HEIGHT_DEFAULT as F,FOOTPRINT_MAP_HEIGHT_FULL as v,FOOTPRINT_MAP_HEIGHT_KEY as N,FOOTPRINT_SHOWS_DEFAULT as i,FOOTPRINT_SHOWS_KEY as r}from"../../../../../../format/lib/content/footprint.js";import{ColumnsIcon as w,HeadquartersIcon as D,HeightIcon as M,LayoutIcon as k,LocationIcon as x,MapIcon as B,SearchIcon as U,ThemeIcon as G}from"efficient-easel/icons";import{CoordsField as W,copyText as K,plainText as a,sourceField as j,text as f,textarea as I,toggle as d,withPanelOnly as L}from"../../../controls.js";import{group as u}from"efficient-easel/screen/lib/document/box-fields";import{segmented as n}from"../../../box-fields.js";import{withShowWhen as t}from"../../../../../../render/lib/document/show-when.js";import{needsGeocodeWork as q,resolveGeocodeRows as Y}from"../../../geocode-resolve.js";import{deviceField as s}from"efficient-easel/screen/lib/document/device-fields";import{SPLITTABLE_SECTIONS as Q,headFieldsForPlacement as z}from"../../../../../../format/lib/sections/section-head-placement.js";import{BLOCK_SOURCE_PROP as m,DEALERS_SOURCE as J,registerBlockSources as V}from"../../../../../../format/lib/content/block-sources.js";import{blockSourceField as X,blockSourceFields as Z}from"../../../block-source-fields.js";import{DEALERS_BLOCK_SOURCE as $}from"../../../../../../render/lib/dealer-source.js";import{FOOTPRINT_PH as S,FootprintSlots as ee}from"../../../../../../format/lib/document/blocks/general/Footprint/meta.js";import{withFootprintListTemplate as oe}from"../../../../../../format/lib/document/blocks/general/Footprint/card-seed.js";const P={field:m,is:J,default:""},h={field:r,is:i,default:i},te={field:r,is:"list",default:i},le={field:r,is:"map",default:i},b={all:[h,{field:"listPosition",in:["left","right"],default:"below"}]},y={any:[{all:[P,{not:le}]},b]},ie={any:[{all:[h,{field:"listPosition",is:"below",default:"below"}]},te]},E={all:[y,{field:"search",is:!0,default:!1}]};V([$]);const ge={fields:{_gContent:u("Section"),sectionNumber:f("Section number",S.sectionNumber),heading:I("Heading",S.heading),tagline:I("Body",S.tagline),_gOffices:u("Offices"),[m]:X("Office content","Manual"),offices:{type:"array",label:"Offices",arrayFields:{role:a("Role"),city:a("City"),country:a("Region · country"),address:K("Address"),phone:a("Phone"),group:a("Group"),hq:d("HQ",!1,o(D,{})),geocode:j(W,{label:"Coordinates"})},defaultItemProps:{role:"Sales & Distribution",city:"City",country:"Country",address:"",phone:"",group:"",hq:!1,lat:0,lng:0},getItemSummary:e=>e?.city||"Office"},...ee,[r]:n("Shows",o(B,{}),[{label:"Map and list",value:i},{label:"Map only",value:"map"},{label:"List only",value:"list"}],i),mapTheme:n("Map theme",o(G,{}),[{label:"Auto",value:"auto"},{label:"Dark",value:"dark"},{label:"Light",value:"light"}],A.mapTheme),_gList:u("List"),listPosition:s("desktop",t(n("Position",o(k,{}),[{label:"Left",value:"left"},{label:"Right",value:"right"},{label:"Below",value:"below"}],"below"),h)),listColumns:s("desktop",t(n("Columns",o(w,{}),[{label:"Auto",value:g},...C.map(e=>({label:String(e),value:String(e)}))],g),ie)),[N]:s("desktop",t(n("Map height",o(M,{}),[{label:"Fixed",value:F},{label:"Full height",value:v}],F),b)),search:s("desktop",t(d("Search",!1,o(U,{})),y)),searchHint:s("desktop",t(L(f("Hint","Type a postcode or address")),E)),noMatchText:s("desktop",t(L(f("No match","No place found. Try another postcode.")),E)),showDistance:t(d("Distance",!0,o(x,{})),P)},resolveData:async(e,c)=>{const p=c?.changed,T=e.props;if(p?.listPosition===!0||p?.[r]===!0||p?.[m]===!0){const l=oe(T);l!==T&&(e={...e,props:l})}const O=e.props,_=O.offices??[];if(!q(_))return e;const R=await Y(_,l=>[l.address,l.city,l.country].map(H=>String(H??"").replace(/\*/g,"").trim()).filter(Boolean).join(", "));return{...e,props:{...O,offices:R}}},resolveFields:(e,{fields:c})=>z(Z("Footprint",c,e.props,{hides:["offices"]}),e.props.headPlacement,Q.Footprint.headRows)};export{ge as FootprintFields};
1
+ import{jsx as o}from"react/jsx-runtime";import{FOOTPRINT_DEFAULTS as C,FOOTPRINT_LIST_COLUMNS as H,FOOTPRINT_LIST_COLUMNS_DEFAULT as I,FOOTPRINT_MAP_HEIGHT_DEFAULT as g,FOOTPRINT_MAP_HEIGHT_FULL as v,FOOTPRINT_MAP_HEIGHT_KEY as A,FOOTPRINT_SHOWS_DEFAULT as i,FOOTPRINT_SHOWS_KEY as a}from"../../../../../../format/lib/content/footprint.js";import{ColumnsIcon as N,HeadquartersIcon as w,HeightIcon as D,LayoutIcon as M,LocationIcon as k,MapIcon as x,SearchIcon as B,ThemeIcon as U}from"efficient-easel/icons";import{CoordsField as G,copyText as W,plainText as n,sourceField as K,text as p,textarea as E,toggle as f,withPanelOnly as L}from"../../../controls.js";import{group as d}from"efficient-easel/screen/lib/document/box-fields";import{segmented as c}from"../../../box-fields.js";import{withShowWhen as l}from"../../../../../../render/lib/document/show-when.js";import{needsGeocodeWork as j,resolveGeocodeRows as q}from"../../../geocode-resolve.js";import{deviceField as r}from"efficient-easel/screen/lib/document/device-fields";import{SPLITTABLE_SECTIONS as Y,headFieldsForPlacement as Q}from"../../../../../../format/lib/sections/section-head-placement.js";import{BLOCK_SOURCE_PROP as u,DEALERS_SOURCE as z,registerBlockSources as J}from"../../../../../../format/lib/content/block-sources.js";import{blockSourceField as V,blockSourceFields as X}from"../../../block-source-fields.js";import{DEALERS_BLOCK_SOURCE as Z}from"../../../../../../render/lib/dealer-source.js";import{SITE_OFFICES_BLOCK_SOURCE as $}from"../../../../../../format/lib/content/site-offices.js";import{FOOTPRINT_PH as m,FootprintSlots as ee}from"../../../../../../format/lib/document/blocks/general/Footprint/meta.js";import{withFootprintListTemplate as oe}from"../../../../../../format/lib/document/blocks/general/Footprint/card-seed.js";const P={field:u,is:z,default:""},O={field:a,is:i,default:i},te={field:a,is:"list",default:i},le={field:a,is:"map",default:i},y={all:[O,{field:"listPosition",in:["left","right"],default:"below"}]},b={any:[{all:[P,{not:le}]},y]},ie={any:[{all:[O,{field:"listPosition",is:"below",default:"below"}]},te]},R={all:[b,{field:"search",is:!0,default:!1}]};J([Z,$]);async function re(e){return j(e)?q(e,t=>[t.address,t.city,t.country].map(s=>String(s??"").replace(/\*/g,"").trim()).filter(Boolean).join(", ")):e}const se={fields:{_gContent:d("Section"),sectionNumber:p("Section number",m.sectionNumber),heading:E("Heading",m.heading),tagline:E("Body",m.tagline),_gOffices:d("Offices"),[u]:V("Office content","Manual"),offices:{type:"array",label:"Offices",arrayFields:{role:n("Role"),city:n("City"),country:n("Region · country"),address:W("Address"),phone:n("Phone"),group:n("Group"),hq:f("HQ",!1,o(w,{})),geocode:K(G,{label:"Coordinates"})},defaultItemProps:{role:"Sales & Distribution",city:"City",country:"Country",address:"",phone:"",group:"",hq:!1,lat:0,lng:0},getItemSummary:e=>e?.city||"Office"},...ee,[a]:c("Shows",o(x,{}),[{label:"Map and list",value:i},{label:"Map only",value:"map"},{label:"List only",value:"list"}],i),mapTheme:c("Map theme",o(U,{}),[{label:"Auto",value:"auto"},{label:"Dark",value:"dark"},{label:"Light",value:"light"}],C.mapTheme),_gList:d("List"),listPosition:r("desktop",l(c("Position",o(M,{}),[{label:"Left",value:"left"},{label:"Right",value:"right"},{label:"Below",value:"below"}],"below"),O)),listColumns:r("desktop",l(c("Columns",o(N,{}),[{label:"Auto",value:I},...H.map(e=>({label:String(e),value:String(e)}))],I),ie)),[A]:r("desktop",l(c("Map height",o(D,{}),[{label:"Fixed",value:g},{label:"Full height",value:v}],g),y)),search:r("desktop",l(f("Search",!1,o(B,{})),b)),searchHint:r("desktop",l(L(p("Hint","Type a postcode or address")),R)),noMatchText:r("desktop",l(L(p("No match","No place found. Try another postcode.")),R)),showDistance:l(f("Distance",!0,o(k,{})),P)},resolveData:async(e,t)=>{const s=t?.changed,S=e.props;if(s?.listPosition===!0||s?.[a]===!0||s?.[u]===!0){const F=oe(S);F!==S&&(e={...e,props:F})}const T=e.props,h=T.offices??[],_=await re(h);return _===h?e:{...e,props:{...T,offices:[..._]}}},resolveFields:(e,{fields:t})=>Q(X("Footprint",t,e.props,{hides:["offices"]}),e.props.headPlacement,Y.Footprint.headRows)},Ee=se.fields.offices;export{Ee as FOOTPRINT_OFFICES_FIELD,se as FootprintFields,re as resolveOfficeCoords};
@@ -301,6 +301,7 @@ type StickNumberKey = "stickTopDistance" | typeof SECTION_PIN_SCREENS_KEY;
301
301
  export declare function followedStickPatch(view: PanelView, props: Record<string, unknown>, next: unknown, base?: StickNumberKey, intro?: boolean): Record<string, unknown> | null;
302
302
  export declare function anchorFields(): Record<string, CustomField<undefined> | CustomField<HidableValue>>;
303
303
  export declare function customCssFields(): Record<string, CustomField<undefined> | CustomField<string>>;
304
+ export declare const CUSTOM_CSS_ROW: CustomField<string>;
304
305
  export declare function dateTime(label: string, icon?: ReactNode, hint?: string): CustomField<string>;
305
306
  export declare function date(label: string, icon?: ReactNode, hint?: string): CustomField<string>;
306
307
  export declare function toggle(label: string, fallback: boolean, icon?: ReactNode, hint?: string): CustomField<boolean>;
@@ -1 +1 @@
1
- "use client";import{jsx as i,jsxs as L,Fragment as k}from"react/jsx-runtime";import{HERO_FOCUS as An,HERO_MEDIA_TYPES as Ln}from"../../../format/lib/hero-media-layout.js";import{cloneElement as xe,createContext as kn,useContext as st,useEffect as Fn,useId as lt,useRef as J,useState as Z}from"react";import{useEasel as re,useSelectedHost as G}from"efficient-easel/easel";import{PIN_LENGTH as ie,toDateKey as vn,fromDateKey as Dn,parseOption as Bn}from"efficient-shell/format";import{say as a,editorEaselWords as x}from"../../../format/lib/editor-words.js";import{finiteNumber as Y}from"../../../format/lib/finite-number.js";import{LOADING_SHOWS_LABELS as at,firstFrameHint as Hn,loadingShowsOf as Gn,loadingStillHint as Mn}from"../../../format/lib/hero-video.js";import{pageFramesFor as Un,usePageVideoFrames as Wn}from"../page-video-frames.js";import{ScreenDocumentContext as Kn}from"efficient-easel/screen/components/ScreenDocumentContext";import{readHidable as ct,hidableText as ut}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as Oe,LINK_FIELD_MARKER as dt,MEDIA_FIELD_MARKER as Ie,SCAFFOLD_FIELD_MARKER as pt,TEXT_FIELD_MARKER as N,foldMetaOf as Ee,textFieldIdentifier as Xn}from"efficient-easel/draw";import $n from"../../components/ApplyCornersToSiblings.js";import{withShowWhen as ft}from"../../../render/lib/document/show-when.js";import{CARD_IMAGE_PX_ROW as jn,CARD_IMAGE_RADIUS_ROW as ht,CARD_IMAGE_RADIUS_STEP as Vn,CORNER_RADIUS_MAX as Te,CORNER_RADIUS_MIN as F}from"../../../format/lib/content/card-image-shape.js";import{SECTION_CSS_KEY as Yn}from"../../../format/lib/content/section-css.js";import{IMAGE_CORNER_STEP as zn,IMAGE_CORNERS_LABEL as qn,IMAGE_CORNERS_ROW as Jn}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as Zn,GRID_MAX_ROW_SPAN as mt,GRID_MAX_TILE_AT as Qn,GRID_MOBILE_MAX_COLUMNS as eo,GRID_TILE_AT_KEY as to}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as no,GALLERY_LAYOUTS as Re,GALLERY_LAYOUT_KEYS as oo,GALLERY_PHONE_LAYOUTS as ro,galleryChoices as gt,galleryLayoutRatio as io,galleryPictureCells as so}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as lo}from"./shell-glyph.js";import{anchorSiblingsOf as ao,placementPoints as co}from"../../../format/lib/hero-group-placement.js";import uo from"../../components/AnchorField.js";import po from"../../components/SourceStatus.js";import{AdjustIcon as fo,EyeIcon as ho,AnimationIcon as mo,BackgroundIcon as bt,BorderAllIcon as go,BlockSectionIcon as bo,ColumnWidthsIcon as se,ColumnsIcon as wt,CornerIcon as St,DirectionDownIcon as wo,DirectionLeftIcon as So,DirectionRightIcon as _o,DirectionUpIcon as Co,EditIcon as yo,GapIcon as xo,GridIcon as _t,GroundIcon as Ne,HashIcon as Ct,HeightIcon as le,ImageIcon as Oo,ListIcon as Io,LocationIcon as yt,PaddingBottomIcon as xt,PaddingLeftIcon as Ot,PaddingRightIcon as It,PaddingTopIcon as Pe,PageIcon as Eo,PhoneIcon as To,StickyIcon as Et,SearchIcon as Ro,SquareIcon as No,TypeIcon as Po,WidthIcon as Ao}from"efficient-easel/icons";import{FieldGlyph as Tt}from"../../components/FieldGlyph.js";import{resolvePageBackground as Lo}from"../../../format/lib/content/page-background.js";import{BOX_FILL_FADE_PROP as ko,BOX_FILL_FADES as Fo,BOX_SWATCH_PROP as vo,boxFillFadeOf as Rt,boxFillOf as Do,boxFillSlot as Ae,boxPaintOf as Bo}from"../../../format/lib/content/box-background.js";import{CORNER_SIDES as Nt,CORNER_SIDE_POINTS as Ho,SECTION_CORNERS_ROW as Pt,hasOwnSectionCorners as Go,normalizeCornerSides as At}from"../../../format/lib/content/section-corners.js";import{CARD_CORNERS_ROW as Lt}from"../../../format/lib/content/card-corners.js";import{enclosingPath as Mo,enclosingSection as Uo}from"./enclosing-section.js";import{SettingsDefaultReset as O,SettingsDrill as Wo,SettingsField as _,SettingsGroup as Ko,SettingsSegmented as Xo,SettingsBorder as $o,SettingsSidesEach as jo,SettingsSwitch as Le,borderSides as Vo,borderStartEach as Yo}from"efficient-easel/panel";import{ListField as zo}from"efficient-easel/fields";import{CodeIcon as qo}from"efficient-shell/icons/efficient";import{DisplayChips as Jo}from"efficient-shell/ui";import{desktopDisplayChanged as Zo,partShownOnDesktop as Qo,partShownOnPhone as er,phoneDisplayChanged as tr,withDesktopPart as nr,withPhonePart as or}from"../../../format/lib/content/part-display.js";import{ColorSwatch as rr,CornersInput as ir,DatePicker as sr,DateTimePicker as lr,FOCAL_DEFAULT as ar,IconPicker as kt,COLUMN_COUNT_MAX as Ft,COLUMN_SHARE_MIN as cr,COLUMN_SHARES_EQUAL as ur,resolveColumnShares as vt,WidthsBar as dr,useShellStrings as pr,IconButton as Dt,InputNumber as Bt,Slider as fr,Textarea as hr,Tooltip as ke}from"efficient-shell/ui";import{LOOKUP_BUSY_NOTE as mr}from"./geocode-resolve.js";import{ColourRow as ae,InheritedColourRow as Ht}from"./ColourControl.js";import{fillThemeColors as gr,slotFill as ce}from"../../../format/lib/document/theme-slots.js";import{fillSlotNamed as Fe}from"../../../format/lib/document/part-inks.js";import{keptByRow as ve}from"efficient-easel/screen/lib/document/style-fields";import Gt from"./MarkupToolbar.js";import{deviceField as y}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as br,NoControlMark as wr,noControlField as Mt}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as Sr}from"../../../format/lib/document/own-box.js";import{fieldPanelOnly as _r,PANEL_ONLY_FIELD as Cr}from"../../../format/lib/document/panel-only.js";import{PHONE_CLEAR as yr,resolvePhoneValue as De}from"../../../format/lib/document/phone-override.js";import{phoneKey as B,tabletKey as Be,viewKeyAt as He}from"efficient-easel/draw";import{viewKey as I}from"../../../format/lib/animation/views.js";import{viewRows as M}from"../animation/view-rows.js";import{SuppressibleText as xr}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Or,CARD_OUTLINE_OPTIONS as Ir,DEFAULT_CARD_INDEX_FORMAT as Er,DEFAULT_CARD_OUTLINE as Tr}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as Rr,DEFAULT_COVER_INDEX as Nr}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as Pr}from"efficient-easel/draw";import Ar from"../../components/MediaUploadField.js";import Lr from"../../components/MultiSelectField.js";import kr from"../../components/SectionThemePicker.js";import Fr from"../../components/SearchSelectField.js";import vr from"../../components/StorefrontLinkField.js";import{UiIcon as Ut}from"efficient-easel/draw/client";import{SECTION_PADDING as P}from"../../../render/lib/content/section-padding.js";import{buttonWordsSummary as Dr}from"../../../render/lib/content/button-look.js";import{usePreviewParts as Br}from"efficient-easel/draw/client";import{encodePartId as Hr}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as Gr,useEaselStrings as Mr}from"efficient-easel/strings";import{hasPhoneHeight as Ur,hasTabletHeight as Ge,resolveSectionMinHeight as Wr,resolveTabletHeight as Kr}from"../../../format/lib/content/section-min-height.js";import{INTRO_OLD_STICKY_PINS as Xr,SECTION_PIN_ABOVE_HINT as $r,SECTION_PIN_ABOVE_KEY as jr,SECTION_PIN_ABOVE_LABEL as Vr,SECTION_PIN_GROUP as Yr,SECTION_PIN_LABEL as Wt,SECTION_PIN_SCREENS_KEY as Me,SECTION_PIN_SCREENS_LABEL as Kt,SECTION_PIN_STOP_DEFAULT as zr,SECTION_PIN_STOP_HINT as qr,SECTION_PIN_STOP_KEY as Jr,SECTION_PIN_STOP_LABEL as Zr,SECTION_PIN_STOP_OPTIONS as Qr,SECTION_STICK_DISTANCE as U,SECTION_STICK_DISTANCE_ROW as Ue,SOME_VIEW_PINS as Xt,hasPhoneStick as ei,hasTabletStick as ti,resolveSectionStick as ue,sectionPinStopOf as ni,sectionPinStopWrite as oi}from"../../../format/lib/content/section-sticky.js";import{cssLengthOf as ri}from"../../../format/lib/content/css-length.js";import{SECTION_HEIGHT_MODES as ii,SECTION_MIN_HEIGHT as si,SECTION_MIN_HEIGHT_GROUP_LABEL as Q,SECTION_SCREEN_PCT as li,SECTION_HEIGHT_UNITS as ai}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as ci,resolveContainerDirection as $t}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as ui,BOX_BLOCK_SPACING_POINTS as jt,BOX_PHONE_ROW_LABEL as Vt,BOX_COLUMNS_MAX as di,BOX_COLUMNS_MIN as Yt,BOX_PHONE_ROW_MAX as pi,BOX_PHONE_ROW_MIN as We,BOX_SHARE_CHOICES as zt,BOX_SHARE_LABEL as z,boxShareChoiceOf as qt,boxShareWidthsOf as Ke,BOX_SHARE_PHONE_DEFAULT as fi,BOX_SHARE_PHONE_POINTS as hi}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as W}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as Jt,BORDER_SIDES as mi,SECTION_BORDER_ROW as Zt,borderBySide as Qt}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as gi,normalizeTheme as en,normalizeThemeColors as bi,sectionBandTone as wi,surfaceTwoTone as Si}from"../../../format/lib/theme.js";import{CONTAINER_GAP as tn,CONTAINER_GAP_BUILT_IN as _i,CONTAINER_GAP_PHONE as Xe,GAP_FIELD_CONTAINER as $e,followsSitePhoneGap as Ci,hasOwnContainerGap as yi,hasOwnPhoneGap as je,resolveContainerGap as nn,resolvePhoneContainerGap as on}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as xi,CARD_IMAGE_BG_OFF as Oi,CARD_IMAGE_BG_SWATCH_NAMES as Ii,CARD_IMAGE_BG_SWATCHES as Ei,isCardImageBackgroundInheriting as Ti,cardImageBackgroundChoice as Ri,THEME_CARD_IMAGE_BG as Ni}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as Pi,SECTION_BG_NO_FILL as Ai,sectionBackgroundChoice as Li,THEME_SECTION_BG as Ve,isSectionBackgroundEmpty as ki,sectionBackgroundHex as rn}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as Fi,nestedAccentValue as sn,resolveSectionAccent as de}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as vi,TYPE_SIZE_INHERIT as Di,isTypeSizeInheriting as Bi}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as Hi,WIDTH_CHOICE_LABEL as Gi,WIDTH_INHERIT as Mi}from"../../../format/lib/content/section-width.js";import{useEaselSession as Ui}from"efficient-easel/screen/lib/session-context";import{backendOf as Wi}from"../website-session.js";import{BOX_GAP as Ki,describedAs as v,group as T,iconOf as K,sharedStyleKinds as ee}from"efficient-easel/screen/lib/document/box-fields";import{VIEW_KEY_ACCESS as ln,onDesktopWords as X,phoneTwinFields as Ye,saidAlignmentGrid as Xi,useLengthUnit as $i}from"efficient-easel/screen/lib/document/box-fields";import{LENGTH_UNITS_TABLE as ji,PICTURE_PICKER_ROW as Vi,directionField as Yi,gapField as ze,iconPickerRow as an,lengthUnitFields as pe,pickerCellIcon as zi,pickerNoneIcon as qi,Segmented as fe,select as A,slider as H}from"./box-fields.js";import{VIEW_ABOVE as qe}from"efficient-easel/screen/lib/content/length-units";import{tierOfView as cn,viewOfTier as Ji}from"../../../format/lib/content/view-tier.js";import{ownEntry as Zi}from"../../../format/lib/own-entry.js";import{LAYOUT_CELL as Qi,galleryPhonePicture as un}from"./choice-pictures.js";function uc({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?a(e):e})}function $(e,t){return a("{value} from {from}",{value:e,from:t})}function es(){const{blockGap:e}=W();return e===null?a("this container's own spacing"):$(`${e}px`,a("Styles"))}function ts({inherited:e,onReset:t,label:n}){return i(O,{words:x()?.panel,label:a(n),changed:!e,detail:es(),onReset:t})}function ns(e){return ze({...Ki,builtIn:_i[e],resolve:(t,n)=>nn(e,t,n?.siteGap),action:(t,n)=>i(ts,{inherited:!yi(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[$e]:e}})}function os(e){return ft(y("mobile",{[$e]:e,type:"custom",render:t=>i(ss,{container:e,...t})}),dn)}function rs(e){return ft(y("tablet",{[$e]:e,type:"custom",render:t=>i(is,{container:e,...t})}),dn)}const dn={not:{field:"gap",in:Array.from({length:-tn.min},(e,t)=>tn.min+t)}};function dc(e){return{gap:y("desktop",ns(e)),[Be("gap")]:rs(e),[B("gap")]:os(e)}}function is({container:e,...t}){const[n]=R("gap"),{siteGap:o}=t.field??{},r=Math.max(Xe.min,nn(e,n,o));return ze({...Xe,builtIn:r,resolve:s=>je(s)?s:r,action:(s,c)=>i(O,{words:x()?.panel,label:a("Gap"),changed:je(s),detail:X(u=>a(u),`${r}px`),onReset:()=>c(void 0)})}).render(t)}function ss({container:e,...t}){const[n]=R("gap"),{siteGap:o,siteGapPhone:r}=t.field??{},l=on(e,void 0,n,o,r);return ze({...Xe,builtIn:l,resolve:c=>on(e,c,n,o,r),action:(c,u)=>i(O,{words:x()?.panel,label:a("Gap"),changed:je(c),detail:$(`${l}px`,Ci(e,n,r)?a("Styles"):a("Desktop")),onReset:()=>u(void 0)})}).render(t)}function pc(e){return Yi({offered:ci(e),fallback:$t(e,void 0),resolve:t=>$t(e,t)})}function fc(e,t){return co(t?ao(e,t):[],t)}function ls({inherited:e,onReset:t,label:n}){return i(O,{words:x()?.panel,label:a(n),changed:!e,detail:$(a("Full"),a("the page")),onReset:t})}function j({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:l,hideable:s=!0,markup:c=!0}){const{text:u,hidden:d}=ct(e),h=J(null),p=J(null),f=C=>t(s?{text:C,hidden:d}:C),m=()=>t({text:u,hidden:!d}),g=s&&d,b=lt(),S=r?ps(r)?i("span",{className:"sf-hint-while-typing",children:a(r)}):a(r):void 0,w=d?a("Show {label} on the slide",{label:a(n)}):a("Hide {label} on the slide",{label:a(n)});return i(_,{label:a(n),icon:i(Po,{}),htmlFor:b,className:g?"is-hidden":void 0,hint:S,action:s?i(ke,{content:w,children:i(Dt,{"aria-pressed":d,"aria-label":w,onClick:m,children:d?i(Ut,{name:"eye-off",size:14}):i(Ut,{name:"eye",size:14})})}):void 0,children:L("div",{className:"sf-copybox",children:[c&&i(Gt,{target:l?p:h,value:u,onChange:f}),l?i("textarea",{id:b,ref:p,value:u,placeholder:o===void 0?void 0:a(o),onChange:C=>f(C.target.value)}):i("input",{id:b,ref:h,type:"text",value:u,placeholder:o===void 0?void 0:a(o),onChange:C=>f(C.target.value)})]})})}function hc(e,t){return{...e,[pt]:t}}function mc(e){const t=e[N];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[N]:{...t,offPage:!0}}}function gc(e){return!e||typeof e!="object"?!1:e[N]?.offPage===!0}function bc(e){if(!e[N])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Cr]:!0}}function wc(e){return _r(e)}function Sc(e){const t=e[N];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[N]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as ku,SCALAR_TEXT_CONTROLS as Fu}from"efficient-easel/draw";function _c(e,t){if(!e[N])throw new Error("inOwnBox: the field holds no authored text");const{[br]:o,...r}=e;return{...r,[Sr]:!0,render:t}}const as=new Set(Pr),he={type:"radio",options:[{value:!0},{value:!1}]},pn={text:{type:"object",objectFields:{text:{type:"text"},hidden:he}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:he}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},V=(e,t)=>{const n=v({...t,[N]:e},{...pn[e.control],label:e.label});if(!as.has(e.control))return n;const o=t.render;return{...Mt(n,"authored-copy"),render:r=>i(xr,{name:r.name,children:o(r)})}},Cc="Everything else on this block comes from the linked post. Unlink it to edit by hand.",cs={field:"source.slug",set:!0},yc={not:cs},us="Select a word, then press the highlighter.",ds=new Set([us]),ps=e=>ds.has(e);function xc(e,t,n){return V({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(j,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function Oc(e,t,n){return V({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(j,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function Ic(e,t,n){return V({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(j,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function Ec(e,t,n){return V({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(j,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function Tc(e){return{type:"custom",[dt]:{label:e},...v({},{type:"text",label:e}),render:({value:t,onChange:n})=>i(vr,{value:ut(t),onChange:n,label:e})}}function Rc(e,t,n){return V({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(j,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const Nc={Design:fo,Animation:mo};function Pc(e,t){return{type:"custom",render:()=>i(fs,{text:e,values:t})}}function fs({text:e,values:t}){return i("p",{className:"sf-note",children:a(e,t)})}function Ac(e){return Ee(e)!==null&&e?.tabs!==void 0}const fn=new Map;function Lc(e,t){const n=`${e}\0${t?t.join(""):""}`,o=fn.get(n)??{type:"custom",tabs:t,[Oe]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(k,{})};return fn.set(n,o),o}const hn=new Map;function kc(e){const t=hn.get(e)??{type:"custom",[Oe]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(k,{})};return hn.set(e,t),t}function hs(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function Fc(e,t){return hs(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(k,{})}}function vc(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 Dc({title:e,children:t}){const[n,o]=Z(()=>!Je.has(e));return i(Ko,{title:e,open:n,onToggle:r=>{o(r),r?Je.delete(e):Je.add(e)},children:t})}const Je=new Set;function ms({swatches:e,current:t,onPick:n,names:o}){const r=e.find(c=>c.toLowerCase()===t.toLowerCase()),l=r?o?.[r]:void 0,s=l?a(l):t;return L("div",{className:"sf-swatches",children:[e.map(c=>{const u=o?.[c]?a(o[c]):c;return i(ke,{content:u,children:i(rr,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":u})},c)}),i("span",{className:"sf-swatch-hex",children:s})]})}function Bc(e,t,n=!1){return{type:"custom",render:({value:o,onChange:r})=>i(gs,{label:e,builtIn:t,followsBand:n,value:o,onChange:r})}}function gs({label:e,builtIn:t,followsBand:n,value:o,onChange:r}){const l=typeof o=="string"?o:void 0,{colors:s,n:c}=nt(),u={background:s.background,surface:s.surface,surface2:Si(s),band:wi(s)},d=n?Ve:t,h=ki(l,t,d),p=rn(void 0,d,u),f=n?Pi:void 0,m=d===Ve?a("the theme's section background"):a("Theme {n} background",{n:c}),g=bs(l,t,s,c,u,r),b=$(p.toUpperCase(),m),S=Fe(l),w=S?ce(S,s,c):null;return w?i(ae,{label:a(e),icon:i(bt,{}),value:w.hex,caption:w.words,onChange:r,changed:!0,onReset:()=>r(f),resetTo:b,choices:g}):i(Ht,{label:a(e),icon:i(bt,{}),value:h?"":rn(l,t,u),inherited:p,resetTo:b,onChange:r,onReset:()=>r(f),choices:g})}function bs(e,t,n,o,r,l){const s=Li(e,t);return[{label:a("No fill"),color:"",selected:s==="none",onPick:()=>l(Ai)},{label:`${a("Section band")} · ${r.band.toUpperCase()}`,color:r.band,selected:s==="band",onPick:()=>l(Ve)},...tt(Fe(e)??"",n,o,l)]}function ws(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,l=Ti(r,t);return i(_,{label:a(e),icon:i(Ne,{}),changed:!l,action:i(O,{words:x()?.panel,label:a(e),changed:!l,detail:a("the theme's image stage"),onReset:()=>o(xi)}),children:ms({swatches:Ei,current:l?Ni:Ri(r,t),onPick:o,names:Ii})})}}}function Hc(e=n=>n,t){return ee({_gSectionTheme:T(Fi),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(kr,{value:e(n),onChange:o,followLabel:t})}})}function me(e){const t=E(),n=cn(e?.view),o=s=>He(e.valueKey,s),r=e.numbersIn??(s=>Y(t[o(s)])!==void 0),l=e.followsView??ks(n,r);return $i({props:{value:void 0,onChange:()=>{},field:{}},row:e.valueKey?e.row:void 0,table:ji,label:a(e.label),grid:e.grid,hasOwn:r(n),view:{tier:n,numbersIn:r,followsView:l},convertTo:e.convertTo??(s=>{const c=Y(t[o(n)]);return c===void 0?{}:{[o(n)]:s(c)}})})}function q({min:e,max:t,step:n,value:o,onChange:r,suffix:l="",readout:s=!0,notch:c,ariaLabel:u,disabled:d=!1,placeholder:h,placeholderWord:p,onClear:f,units:m,inputMax:g}){const b=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:b?"sf-slider has-notch":"sf-slider",style:b?{"--sf-notch":(c-e)/(t-e)}:void 0,children:i(fr,{min:e,max:t,step:n,value:o,...o===null&&h!==void 0?{placeholderValue:h}:{},...p?{emptyLabel:a(p)}:{},suffix:l||void 0,...m?{units:m}:{},...g!==void 0?{inputMax:g}:{},showInput:s,label:u===void 0?void 0:a(u),disabled:d,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:S=>{S===null?f?.():S!==o&&r(S)}})})}function Ss(e,t){const{min:n,max:o,step:r=1,unsetLabel:l,hint:s,restTrack:c,unsetMark:u,icon:d,unit:h="px"}=t;return{type:"custom",render:({value:p,onChange:f})=>{const m=typeof p=="number"?p:null,g=m===null;return i(_,{label:a(e),icon:d?K(d):void 0,value:g?u||l===void 0?void 0:a(l):`${m}${h}`,changed:!g,action:u?xe(u,{changed:!g,onReset:()=>f(null)}):i(O,{words:x()?.panel,label:a(e),changed:!g,onReset:()=>f(null)}),hint:typeof s=="string"?a(s):s,children:c?c({min:n,max:o,step:r,px:m,label:e,onChange:f}):q({min:n,max:o,step:r,value:m??n,readout:!1,ariaLabel:e,onChange:f})})}}}const te="Corners",_s={kind:"radius"};function Ze(e){return{type:"custom",render:t=>{const{value:n,onChange:o}=t,r=typeof n=="number"&&Number.isFinite(n)?n:null,l=r!==null;return i(_,{label:a(te),icon:i(St,{}),changed:l,action:xe(e.mark,{changed:l,onReset:()=>o(null)}),hint:e.hint,children:i(Cs,{tier:e,px:r,name:t.name,onRadius:o})})}}}function R(e){const t=G();return[t?.values?.[e],n=>t?.onChange(e,n)]}function mn(){return Mt({type:"custom",render:()=>i(wr,{})},"always")}function ge(){const e=G();return t=>e?.onChangeMany(t)}function Cs({tier:e,px:t,name:n,onRadius:o}){const r=e.useFollowed(),[l,s]=R(e.sidesKey),c=ge(),u=me({row:e.row??_s,label:te,grid:{min:F,max:Te,step:e.step??1},valueKey:n??"",view:"desktop"}),d=At(l)??[...Nt];return i(ir,{label:a(te),value:d,corners:Ho,onChange:h=>{const p=At(h)??[];s(p.length===Nt.length?null:p)},radius:t,onRadiusChange:u&&n?h=>c({[n]:h,...u.unitPatch(h===null)}):o,radiusMin:u?.grid.min??F,radiusMax:u?.grid.max??Te,radiusStep:u?.grid.step??e.step??1,radiusPlaceholder:u&&u.unit!=="px"?"–":String(r),...u?{radiusUnit:u.unit,units:u.units}:{}})}function gn(e,t){return pe(e,t)}function bn(){return mn()}function ys({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=W(),r=typeof o=="number"?`${o}px`:a("not set");return i(O,{words:x()?.panel,label:a(e),changed:t,detail:o==null?a("the built-in corners"):$(r,a("Styles")),onReset:n})}function xs(){const{cornerRadiusPx:e}=W();return typeof e=="number"?e:F}function Os(){return Ze({sidesKey:"sectionCornerSides",row:Pt,useFollowed:xs,mark:i(ys,{label:te}),hint:Is})}const Is="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function Gc(){return ee({_gShape:T("Shape"),sectionCorners:Os(),...gn(Pt,"sectionCorners"),sectionCornerSides:bn(),...M("sectionBorder",Ls),...pe(Zt,"sectionBorder",{tablet:!0,phone:!0})})}const Es=()=>({width:a("Border width"),sides:{top:a("Border top"),right:a("Border right"),bottom:a("Border bottom"),left:a("Border left")},style:a("Border style"),styles:{solid:a("Solid"),dashed:a("Dashed"),dotted:a("Dotted")},color:a("Border color"),unit:"px"});function Ts(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function Rs(){let e;try{const t=en(W().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||gi.line}function Ns({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:l=!0,above:s={},length:c}){const u=e&&typeof e=="object"?e:{},[d,h]=Z(()=>r?Yo(u,s):!1),p=Es(),f=m=>Ts(r&&l?m:{width:m.width,color:m.color,...l?{style:m.style}:{}});return i(_,{label:a("Border"),icon:i(go,{}),action:r?i(jo,{each:d,label:a("Each side"),onChange:h}):void 0,children:i($o,{label:a("Border"),value:u,each:d,onChange:m=>t(f(m)),placeholder:n,presets:o,words:c?{...p,unit:c.unit}:p,styles:l,max:c?.grid.max??Jt,...c?{step:c.grid.step,units:c.units}:{}})})}function Ps({value:e,onChange:t,view:n}){const[o]=R("sectionBorder"),[r]=R(Be("sectionBorder")),l=Rs(),s=f=>f&&typeof f=="object"?f:{},c=n==="phone"?{...Qt(s(o)),...Qt(s(r))}:n==="tablet"?s(o):{},u=E(),d=ge(),h=I("sectionBorder",n),p=me({row:Zt,label:"Border",grid:{min:0,max:Jt,step:1},valueKey:"sectionBorder",view:n,numbersIn:f=>Qe(u[He("sectionBorder",f)]),convertTo:f=>{const m=s(u[h]);return Qe(m)?{[h]:As(m,f)}:{}}});return i(Ns,{value:e,length:p,onChange:p?f=>d({[h]:f,...p.unitPatch(!Qe(f))}):t,placeholder:{sides:Vo(c),style:c.style??"solid",color:c.color||l},presets:[l],above:c})}const wn=["width",...mi];function Qe(e){if(!e||typeof e!="object")return!1;const t=e;return wn.some(n=>Y(t[n])!==void 0)}function As(e,t){const n={...e};for(const o of wn){const r=Y(n[o]);r!==void 0&&(n[o]=t(r))}return n}function Ls(e){return{type:"custom",render:({value:t,onChange:n})=>i(Ps,{value:t,onChange:n,view:e})}}function ks(e,t){let n=qe[e];for(;n&&qe[n]!==null&&!t(n);)n=qe[n];return n??e}function Mc(e){return{type:"custom",render:()=>i(Fs,{partKey:e})}}function Fs({partKey:e}){const[t]=R("id"),[n]=R("_partStyles"),{textStyles:o}=W(),r=Mr();let l=null;try{l=Br().select}catch{l=null}const s=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i(Wo,{name:a("Text"),preview:Dr(s,c,{noStyle:a("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??Gr.copy.panel).cases}),onOpen:()=>{l&&typeof t=="string"&&l(Hr(t,e))}})}function Sn(e){const{cornerRadiusPx:t}=W(),n=typeof t=="number"?t:e;let o=null;try{const{appState:l,selectedItem:s}=re(u=>u),c=s?.props?.id?String(s.props.id):void 0;o=c?Uo(l?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return Go(r)?r:n}function vs({label:e,changed:t=!1,onReset:n=()=>{}}){const o=Sn(F);return i(O,{words:x()?.panel,label:a(e),changed:t,detail:$(`${o}px`,a("the section")),onReset:n})}function Ds(){return i(k,{children:a("Follows the section's Corners until you set a number here.")})}function Bs(){return Ze({sidesKey:"cardCornerSides",row:Lt,useFollowed:()=>Sn(F),mark:i(vs,{label:te}),hint:i(Ds,{})})}function Hs(){return{type:"custom",render:()=>i($n,{})}}function Uc(){return{_gShape:T("Shape"),cardCorners:Bs(),...gn(Lt,"cardCorners"),cardCornerSides:bn(),cardCornersApplyAll:Hs()}}function Gs(){return v({type:"custom",[Vi]:!0,render:e=>i(Us,{...e})},{type:"select",label:z,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 Ms(e,t){const n=qt(e);if(n!=="custom")return a(zt.find(r=>r.value===n)?.label??"");const o=vt(Ke(e,t),t);return o?[...o,100-o.reduce((r,l)=>r+l,0)].join(" / "):a("Custom")}function Us(e){const{value:t,onChange:n}=e,[o]=R("content"),r=Array.isArray(o)?o.length:0,l="follows"in e,s=t!=null,c=s?t:l?e.follows:void 0,u=qt(c),d=r>=2&&r<=Ft,h=()=>[...ur[r]??[]],p=J(null),f=w=>{const C=p.current;C&&JSON.stringify(w)===JSON.stringify(C.shares)?n(C.value):w&&n(w)},m=w=>{w===u||w==="custom"&&!d||n(w==="custom"?h():w)},g=a("The width bar works for 2 to {count} blocks.",{count:Ft}),b=s&&(l||t!=="content"),S=pr().widths.hint(r,cr);return i(_,{label:a(z),icon:i(se,{}),changed:b,hint:u!=="custom"?void 0:d?S:g,action:i(O,{words:x()?.panel,label:a(z),changed:b,disabled:e.readOnly===!0,detail:l?X(w=>a(w),Ms(e.follows,r),e.followsView):a("Fit content"),onReset:()=>n(void 0)}),children:L("div",{className:"sf-share-row",children:[i("div",{className:"sf-share-pick",children:i(kt,{label:a(z),value:u,options:zt.map(w=>({value:w.value,label:w.value==="custom"&&!d?g:a(w.label),icon:zi(i("span",{className:"sf-gallery-pic sf-share-pic",children:_n(w.weights).map((C,D)=>i("i",{style:{gridColumn:`span ${C}`}},D))}),a(w.label),w.value==="custom"&&!d?g:a(w.label))})),onChange:m,columns:3,cell:Cn,tooltips:!1,disabled:e.readOnly===!0})}),u==="custom"&&d?i("div",{onFocus:()=>{p.current={value:t,shares:vt(Ke(c,r),r)}},onBlur:()=>{p.current=null},children:i(dr,{label:a(z),count:r,value:Ke(c,r),onChange:f,readOnly:e.readOnly===!0})}):null]})})}function _n(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 Wc(){return A(ui,i(xo,{}),jt,jt[0].value)}function Kc(e){return A("On a phone",i(To,{}),[{label:"In the header",value:"header"},{label:"In the menu",value:"menu"}],e)}function Xc(){return y("mobile",an(z,i(se,{}),hi.map(e=>({label:e.label,value:e.value,picture:i("span",{className:"sf-gallery-pic sf-share-pic",children:_n(e.weights).map((t,n)=>i("i",{style:{gridColumn:`span ${t}`}},n))})})),fi,{columns:2,cell:Cn}))}const Cn={width:"5.75rem",height:"3.25rem",words:!0};function $c(){return Ye("share",Gs(),ln)[Be("share")]}function Ws(){return y("mobile",H(Vt,i(wt,{}),We,pi,1,We,"",{clear:{phoneFollows:!1,hint:We}}))}const yn={read:e=>e.phoneRow,write:(e,t,n)=>({phoneRow:n}),fieldKey:()=>"phoneRow",ownField:!0};function jc(){const e=H(Vt,i(wt,{}),Yt,di,1,Yt,"",{clear:{emptyLabel:"Auto"}}),t=Ye("columns",e,{...yn,tablet:ln.tablet}),n=Ye("columns",e,yn,{phoneRow:Ws()});return{...t,phoneRow:n.phoneRow}}function Vc(e,t,n,o,r,l,s){return{type:"custom",render:({value:c,onChange:u,name:d})=>i(Ks,{label:e,min:t,max:n,step:o,fallback:r,role:l,value:c,onChange:u,name:d??"",length:s})}}function Ks({label:e,min:t,max:n,step:o,fallback:r,role:l,value:s,onChange:c,name:u,length:d}){const h=E(),p=ge(),f=cn(d?.view),m=me({row:d?.row??{kind:"fontSize"},label:e,grid:{min:t,max:n,step:o},valueKey:d?u:"",view:d?.view??"desktop",numbersIn:b=>b===f&&typeof h[u]=="number",followsView:f,convertTo:b=>typeof h[u]=="number"?{[u]:b(h[u])}:{}}),g=b=>m?p({[u]:b,...m.unitPatch(typeof b!="number")}):c(b);return i(_,{label:a(e),icon:i(Tt,{noun:l}),action:i(O,{words:x()?.panel,label:a(e),changed:!Bi(s),detail:a("the Text style in Styles"),onReset:()=>g(Di),defaultAction:{onPress:()=>g(vi),title:a("Keep this section's own built-in size"),icon:i(bo,{})}}),children:q({min:m?.grid.min??t,max:m?.grid.max??n,step:m?.grid.step??o,value:typeof s=="number"?s:r,...m?{suffix:m.unit,units:m.units}:{suffix:"px"},ariaLabel:e,onChange:g})})}function be(e,t,n){return[{label:"Auto",value:""},...Array.from({length:e},(o,r)=>({label:r===0?`1 ${t}`:`${r+1} ${n}`,value:String(r+1)}))]}function Yc(){return{_gCellWidth:T("Cell size"),gridSpan:y("desktop",A("Positions",i(se,{}),be(Zn,"position","positions"),"")),gridRowSpan:y("desktop",A("Rows tall",i(le,{}),be(mt,"row","rows"),"")),[to]:H("At card",i(Ct,{}),1,Qn,1,1,""),[B("gridSpan")]:y("mobile",A("Positions",i(se,{}),[{label:"Full row",value:""},...be(eo,"position","positions").slice(1)],"")),[B("gridRowSpan")]:y("mobile",A("Rows tall",i(le,{}),be(mt,"row","rows"),""))}}function E(){let e=null,t=null;try{e=st(Xs),t=re(n=>n).selectedItem}catch{t=null}return e??t?.props??{}}const Xs=kn(null);function $s({min:e,max:t,step:n,px:o,label:r,onChange:l,desktopKey:s,fallback:c}){const u=E()[s],d=De(void 0,u,c);return i(k,{children:q({min:e,max:t,step:n,value:De(o,u,c),readout:!1,ariaLabel:r,notch:d,onChange:l})})}function js({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:l=()=>{}}){const s=E()[t],c=De(void 0,s,n);return i(O,{words:x()?.panel,label:a(e),changed:r,detail:X(u=>a(u),`${c}${o}`),onReset:l})}function Vs(e){return Ss(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:i(js,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:t=>i($s,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const Ys={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},zs={Top:Pe,Bottom:xt,Left:Ot,Right:It},qs=e=>{const t=zs[e];return i(t,{})};function zc(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=S=>Ys[S],l=S=>H(r("Top"),i(Pe,{}),P.min,P.max,P.step,S,"px"),s=(S,w,C,D=P)=>y("mobile",Vs({label:r(S),icon:qs(S),desktopKey:w,min:D.min,max:D.max,step:D.step,fallback:C})),c=e.top??P.min,u=e.bottom??P.min,d="sectionPaddingLeft",h="sectionPaddingRight",p=e.sideBounds??P,f=e.side??p.min,m=e.sidePhone??f,g=e.phone===!0,b=S=>g?y("desktop",S):S;return ee({...o?{_gSpacing:T("Padding")}:{},[t]:b(l(c)),...g?{[B(t)]:s("Top",t,c)}:{},...e.only==="top"?{}:{[n]:b(H(r("Bottom"),i(xt,{}),P.min,P.max,P.step,u,"px")),...g?{[B(n)]:s("Bottom",n,u)}:{}},...e.sides?{[d]:b(H(r("Left"),i(Ot,{}),p.min,p.max,p.step,f,"px")),...g?{[B(d)]:s("Left",d,m,p)}:{},[h]:b(H(r("Right"),i(It,{}),p.min,p.max,p.step,f,"px")),...g?{[B(h)]:s("Right",h,m,p)}:{}}:{}})}function qc(e,t){const n=Object.fromEntries(Object.entries(t).map(([l,s])=>[l,l in e&&Ee(s)?e[l]:s])),o={};let r=!1;for(const[l,s]of Object.entries(e)){if(l in t){r||Object.assign(o,n),r=!0;continue}o[l]=s}return r||Object.assign(o,n),o}const we="Width";function Jc(e,t=Hi,n=!0){const o=t.map(r=>({label:Gi[r],value:r}));return ee({...n?{_gWidth:T(we)}:{},widthMode:{type:"custom",render:({onChange:r,field:l})=>i(_,{label:a(we),icon:i(Ao,{}),action:n?i(ls,{inherited:l?.inherited??!1,onReset:()=>r(Mi),label:we}):void 0,children:fe({options:o,value:l?.currentValue||e,onChange:r,ariaLabel:we})})}})}function Zc({fill:e=!1}={}){const t=(r,l)=>({type:"custom",render:({value:s,onChange:c})=>i(Js,{value:s,onChange:c,view:r,badge:l,fill:e})}),n=()=>ve("sectionHeightMode"),o=()=>ve("sectionHeightMode");return ee({_gHeight:T(Q),...M("sectionHeightMode",r=>r==="desktop"?t(r):t(r,l=>i(tl,{view:r,onClear:()=>l(void 0)}))),...M("sectionHeightValue",n),...M("sectionHeightUnit",o)})}function Js({value:e,onChange:t,view:n,badge:o,fill:r=!1}){const l=E(),{mode:s,number:c,unit:u}=Zs(n,l,e);return i(_,{label:Q,icon:K(i(le,{})),action:o?o(t):void 0,children:L("div",{className:"es-width-stack",children:[fe({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"},...r?[{label:"Fill",value:"fill"}]:[]],value:s,onChange:t,ariaLabel:Q}),c?i(el,{view:n,mode:s,menu:u}):null]})})}function xn(e,t){return e==="phone"&&Ge(t)?Kr(t):Wr(t)}function Se(e,t){return e==="desktop"||(e==="tablet"?Ge(t):Ur(t))?null:xn(e,t)}function Zs(e,t,n){const r=(l=>ii.includes(l))(n)?n:Se(e,t)?.mode??"auto";return{mode:r,number:r!=="auto"&&r!=="fill",unit:r==="fixed"}}function Qs(e,t,n,o){const r=Se(e,t);return!r||e==="desktop"?null:o===void 0?{}:{[I("sectionHeightMode",e)]:r.mode,...r.mode==="fixed"?{[I("sectionHeightUnit",e)]:r.unit}:{},...n==="sectionHeightUnit"?{[I("sectionHeightValue",e)]:r.value}:{},[I(n,e)]:o}}function On(e,t,n){const o=G(),r=Se(e,E());return!o||!r?{followed:null,write:n}:{followed:r,write:s=>o.onChangeMany(c=>{const u=Qs(e,c,t,s);return u===null?{[I(t,e)]:s}:Object.keys(u).length?u:null})}}function el({view:e,mode:t,menu:n}){const o=G(),r=E(),l=I("sectionHeightValue",e),s=I("sectionHeightUnit",e),c=S=>w=>o?.onChangeMany(()=>({[S]:w})),{followed:u,write:d}=On(e,"sectionHeightValue",c(l)),{write:h}=On(e,"sectionHeightUnit",c(s)),p=t==="screen"?"%":r[s],f=Bn(ai,"px",u?u.unit:p),m=f==="%"?li:si,g=r[l],b=n?{options:["px","%"],label:a("Unit"),onChange:S=>h(S)}:void 0;return q({min:m.min,max:m.max,step:m.step,value:u?null:typeof g=="number"?g:m.fallback,...u?{placeholder:u.value}:{},suffix:f,...b?{units:b}:{},ariaLabel:Q,onChange:d})}function tl({view:e,onClear:t}){const n=E(),o=Se(e,n)===null,r=e==="phone"&&Ge(n),l=xn(e,n),s=X(c=>a(c),l.mode==="auto"?a("Auto"):`${l.value}${l.unit}`,r?"tablet":"desktop");return i(O,{words:x()?.panel,label:a(Q),changed:o,detail:s,onReset:t})}function Qc(e={}){const t=e.intro===!0,n=l=>({type:"custom",render:({value:s,onChange:c,id:u,name:d})=>i(al,{value:s,onChange:c,labelId:`${u??d??"stickTop"}-label`,view:l,intro:t})}),o=l=>({type:"custom",render:({value:s,onChange:c})=>i(il,{value:s,onChange:c,view:l,intro:t})}),r=l=>({type:"custom",render:({value:s,onChange:c})=>i(sl,{value:s,onChange:c,view:l,intro:t})});return{_gStick:T(Yr,{dot:t?rl:Xt}),...M("stickTop",n),...M("stickTopDistance",o),...pe(Ue,"stickTopDistance",{tablet:!0,phone:!0}),...e.screens?M(Me,r):{},...t?{}:{[Jr]:nl()},...t||e.above===!1?{}:{[jr]:ol()}}}function nl(){const e=A(Zr,i(Pe,{}),Qr,zr);return y("desktop",{...e,render:t=>{const n=e.render({...t,value:ni(t.value),onChange:o=>t.onChange(oi(o))});return xe(n,{hint:a(qr)})}})}function ol(){const e=Tn(Vr,!1,i(Et,{}),$r);return y("desktop",{...e,render:t=>e.render({...t,onChange:n=>t.onChange(n===!0?!0:void 0)})})}const rl={any:[Xt,Xr]};function In(e,t,n,o,r){const l=G(),s=E(),c=e==="desktop"||ne(e,s)?null:et(e,ue(s,{intro:o}));return{followed:c,write:(c||r)&&l?d=>l.onChangeMany(h=>{const p=ll(e,h,d,t,o),f=p===null?{[I(t,e)]:d}:p;return Object.keys(f).length?{...f,...r?.(d)??{}}:null}):n}}function il({value:e,onChange:t,view:n,intro:o}){const r=E(),l=ue(r,{intro:o}),s=h=>{const p=Ji(h);return p==="desktop"||ne(p,r)},c=me({row:Ue,label:"Distance from top",grid:{min:U.min,max:U.max,step:U.step},valueKey:"stickTopDistance",view:n,numbersIn:h=>s(h)&&Y(r[He("stickTopDistance",h)])!==void 0,followsView:n==="phone"&&l.ownTablet?"tablet":"desktop"}),{followed:u,write:d}=In(n,"stickTopDistance",t,o,c?h=>c.unitPatch(h===void 0):void 0);return i("div",{className:"sf-field",children:q({min:c?.grid.min??U.min,max:c?.grid.max??U.max,step:c?.grid.step??U.step,value:u?null:typeof e=="number"?e:U.fallback,...u?{placeholder:u.distance}:{},...c?{suffix:c.unit,units:c.units}:{suffix:"px"},ariaLabel:a("Distance from top"),onChange:d})})}function sl({value:e,onChange:t,view:n,intro:o}){const{followed:r,write:l}=In(n,Me,t,o);return i(_,{label:a(Kt),icon:K(i(le,{})),children:q({min:ie.min,max:ie.max,step:ie.step,value:r?null:Y(e)??ie.default,...r?{placeholder:r.screens}:{},ariaLabel:a(Kt),onChange:l})})}function ne(e,t){return e==="tablet"?ti(t):ei(t)}function et(e,t){return e==="phone"?{on:t.tablet,distance:t.tabletDistance,unit:t.tabletUnit,screens:t.tabletScreens}:{on:t.desktop,distance:t.desktopDistance,unit:t.desktopUnit,screens:t.desktopScreens}}function ll(e,t,n,o="stickTopDistance",r=!1){if(e==="desktop"||ne(e,t))return null;if(n===void 0)return{};const l=et(e,ue(t,{intro:r})),s=e==="phone"&&ne("tablet",t)?h=>I(h,"tablet"):h=>h,c=(h,p)=>t[s(h)]==null?{}:{[I(h,e)]:p},u=Ue.unitKey,d=t[s(u)]==null?{}:{[I(u,e)]:l.unit};return{[I("stickTop",e)]:!0,...c("stickTopDistance",l.distance),...d,...c(Me,l.screens),[I(o,e)]:n}}function al({value:e,onChange:t,labelId:n,view:o,intro:r}){const l=E(),s=ue(l,{intro:r}),c=o==="phone"?s.phone:o==="tablet"?s.tablet:r?s.desktop:e===!0,u=o==="phone"&&s.ownTablet,d=o==="desktop"?null:et(o,s),h=d?.on?ri(d.distance,d.unit):a("Off");return i(_,{label:a(Wt),labelId:n,icon:K(i(Et,{})),action:L(k,{children:[o!=="desktop"?i(O,{words:x()?.panel,label:a(Wt),changed:ne(o,l),detail:X(p=>a(p),h,u?"tablet":"desktop"),onReset:()=>t(void 0)}):null,i(Le,{checked:c,onChange:t,ariaLabelledBy:n})]})})}const En="e.g. about";function eu(){return{_gAnchor:T("Anchor"),anchor:V({control:"plainText",label:"Name",placeholder:En},{type:"custom",render:({value:e,onChange:t})=>i(uo,{value:e,onChange:t,nameBox:(n,o)=>i(j,{value:n,onChange:o,label:"Name",placeholder:En,hideable:!1,markup:!1})})})}}function tu(){return{_gAdvanced:T("Advanced"),[Yn]:{type:"custom",render:({value:e,onChange:t})=>i(_,{label:a("Custom CSS"),icon:K(i(qo,{})),children:i(hr,{"aria-label":a("Custom CSS"),spellCheck:!1,autoGrow:!0,className:"font-mono",value:typeof e=="string"?e:"",onChange:n=>t(n.target.value)})})}}}function nu(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:l,name:s})=>{const c=`${l??s??e}-datetime`,u=Date.parse(typeof o=="string"?o:"");return i(_,{label:a(e),icon:t,htmlFor:c,hint:n===void 0?void 0:a(n),children:i(lr,{id:c,value:Number.isFinite(u)?new Date(u):null,onChange:d=>r(d?d.toISOString():"")})})}}}function ou(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:l,name:s})=>{const c=`${l??s??e}-date`;return i(_,{label:a(e),icon:t,htmlFor:c,hint:n===void 0?void 0:a(n),children:i(sr,{id:c,value:Dn(typeof o=="string"?o:null),onChange:u=>r(u?vn(u):"")})})}}}function Tn(e,t,n,o){return{type:"custom",...v({},{...he,label:e}),render:r=>{const{value:l,onChange:s,id:c,name:u}=r,d="follows"in r,h=r,p=typeof l=="boolean",f=typeof h.follows=="boolean"?h.follows:t,m=p?l:d?f:t,g=`${c??u??e}-label`,b=h.readOnly===!0,S=i(Le,{checked:m,onChange:s,disabled:b,ariaLabelledBy:g});return i(_,{label:a(e),labelId:g,icon:n,hint:o===void 0?void 0:a(o),action:d?L(k,{children:[i(O,{words:x()?.panel,label:a(e),changed:p,detail:h.followsNoView?a(f?"On":"Off"):X(w=>a(w),a(f?"On":"Off"),h.followsView),disabled:b,onReset:()=>s(void 0)}),S]}):S})}}}function ru(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i(cl,{label:"Background",icon:i(Eo,{}),id:r,value:e,shown:Lo(e),onChange:t})}}}function iu(e,t,n){return{type:"custom",render:({value:o,onChange:r})=>i(ae,{label:a(e),icon:n,value:o||t,onChange:r})}}function cl({label:e,icon:t,id:n,value:o,shown:r,onChange:l}){const{colors:s,n:c}=nt(),u=Fe(o),d=u?ce(u,s,c):null;return i(ae,{label:a(e),icon:t,id:n,value:d?d.hex:r,caption:d?.words,onChange:l,choices:tt(u??"",s,c,l)})}function su(){return{type:"custom",render:e=>{const{value:t,onChange:n}=e,o=e;return i(ul,{value:typeof t=="string"?t:"",onChange:n,twin:"follows"in e?{follows:o.follows,view:o.followsView}:void 0})}}}function tt(e,t,n,o){const r=Ae(e);return gr(t,n).map(l=>({label:l.label,color:l.value,selected:r===l.name,onPick:()=>o(l.name)}))}function ul({value:e,onChange:t,twin:n}){const{colors:o,n:r}=nt(),l=o.background,s=$(l.toUpperCase(),a("Theme {n} background",{n:r})),[c,u]=R(ko),[d]=R(vo),h=typeof d=="string"&&d.trim()!=="",p=Rt(c),f=oe=>u(Rt(oe)||void 0),m=Ae(e),g=m?ce(m,o,r):null,b=tt(e,o,r,t),S=n?()=>t(void 0):()=>t("");let w=l,C=s;if(n){const oe=Ae(n.follows),Ce=Do(n.follows),ye=oe?ce(oe,o,r):Ce?{hex:Ce,words:Ce.toUpperCase()}:null;w=ye?.hex??l,C=X(Pn=>a(Pn),ye?ye.words:s,n.view)}const D=!n&&(Bo(e)||h)?i(dl,{value:p,onChange:f}):null;return g?i(ae,{label:a("Fill"),icon:i(Ne,{}),value:g.hex,caption:g.words,onChange:t,changed:!0,onReset:S,resetTo:C,choices:b,children:D}):i(Ht,{label:a("Fill"),icon:i(Ne,{}),value:e,inherited:w,resetTo:C,onChange:t,onReset:S,choices:b,children:D})}function dl({value:e,onChange:t}){return fe({options:Fo.map(n=>({label:n.label,value:n.value,hint:n.hint})),value:e,onChange:t,ariaLabel:a("Fill")})}function pl(e,t,n){if((e?.content??[]).some(s=>s?.props?.id===t))return de(n);const r=Mo(e,t);if(r.length===0)return null;const l=de(sn(n));if(l!==null)return l;for(let s=r.length-1;s>0;s-=1){const c=de(sn(r[s].sectionAccent));if(c!==null)return c}return de(r[0].sectionAccent)}function nt(){const e=en(W().theme),[t]=R("sectionAccent");let n=null;try{const{appState:r,selectedItem:l}=re(c=>c),s=l?.props?.id?String(l.props.id):void 0;n=s?pl(r?.data,s,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{colors:bi(e.themes[o]),n:o+1}}function lu(){return mn()}const au={top:i(Co,{}),right:i(_o,{}),bottom:i(wo,{}),left:i(So,{})};function cu(e,t,n,o,r,l,s){const c=p=>t.find(f=>f.value===p),u=p=>({value:p,label:"",disabled:!0,title:o}),d=p=>{const f=t.find(g=>g.cell===p);if(!f)return u(`missing-${p}`);const m=l?.[p];return m?{value:f.value,label:f.label,icon:m}:{value:f.value,label:f.label}},h=[u("corner-top-left"),d("top"),u("corner-top-right"),d("left"),u("centre"),d("right"),u("corner-bottom-left"),d("bottom"),u("corner-bottom-right")];return{type:"custom",render:({value:p,onChange:f})=>{const m=t.some(g=>g.value===p)?p:n;return i(_,{label:a(e),icon:r,value:c(m)?.label?a(c(m).label):s?a(s):"",children:Xi(a,{label:e,value:m,onChange:f,points:h})})}}}function uu(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:l})=>i(Lr,{label:e,options:(l.options??t).map(s=>({...s,label:a(s.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:a(n)}:{}})}}function du(e,t,n,o){return{type:"custom",options:t,fallback:n,...v({},{type:"select",label:e}),render:({value:r,onChange:l,field:s})=>i(Fr,{label:e,options:(s.options??t).map(c=>({...c,label:a(c.label)})),fallback:s.fallback??n,value:r,onChange:l,placeholder:o===void 0?void 0:a(o)})}}function pu(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}const fl={image:"Image",video:"Video"},fu=Ln.map(e=>({label:fl[e],value:e}));function hu(e,t,n){const o=Object.keys(at).map(r=>({label:at[r],value:r,picture:n[r]}));return{type:"custom",...v({},{type:"radio",label:e,options:o.map(r=>({value:r.value,label:r.label}))}),render:({onChange:r})=>i(ml,{label:e,icon:t,options:o,onChange:r})}}function hl(e,t,n){const o=Hn(e,t,n);if(o!==void 0)return o==="save-makes-frame"?a("A frame is made from this video when you save the page."):o==="starts-dark"?a("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"?a("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"?a("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"?a("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"?a("The slide shows your Image while the video loads, because this video has no frame."):void 0;const r=Mn(e);return r==="frame-missing-image"?a("This video has no frame yet. The slide shows its image until one is made."):r==="frame-missing-surface"?a("This video has no frame yet. The slide shows its background colour until one is made."):r==="image-missing-frame"?a("No image yet. The slide shows the video's frame until you choose one."):r==="image-missing-surface"?a("No image yet. The slide shows its background colour until you choose one."):void 0}function ml({label:e,icon:t,options:n,onChange:o}){const r=G(),l=r?.values??{},s=Gn(l),c=st(Kn),u=Wn(c?.docId??null);let d=null;try{d=re(p=>p.appState.data)}catch{d=null}const h=Un(r?.id,d,u);return i(_,{label:a(e),icon:K(t),hint:hl(l,h,c?.hasUnsavedEdits??!1),children:fe({options:n,value:s,onChange:o,ariaLabel:e})})}function mu(e,t,n,o={}){const r={type:"custom",[Ie]:!0,render:({value:l,onChange:s,name:c})=>i(Ar,{value:l||"",onChange:s,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?y("each",r):r}function gu(e){return ot(e).map(t=>t.path)}function ot(e,t="",n=[]){const o=[];for(const[r,l]of Object.entries(e??{})){const s=t?`${t}.${r}`:r,c=l;if(c&&c[Ie]){o.push({path:s,field:c,along:n});continue}c?.arrayFields&&o.push(...ot(c.arrayFields,`${s}[]`,[...n,c])),c?.objectFields&&o.push(...ot(c.objectFields,s,[...n,c]))}return o}const bu={HeroSingle:[An.image],HeroSlide:["videoFrame","videoFramePhone"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function gl(e){const t=a(e.status??"");return e.ok&&typeof e.lat=="number"&&typeof e.lng=="number"?`${t} · ${e.lat.toFixed(4)}, ${e.lng.toFixed(4)}`:t}function wu({value:e,onChange:t,label:n}){const o=e||{},r=G(),l=r?r.values!==r.node.props:!0,s=!!o.pending&&l,c=!!o.pending&&!l,u=!!Wi(Ui()).geocode,d=lt(),h=(p,f)=>t({...o,[p]:f??void 0});return L(k,{children:[i(_,{label:a(n),icon:i(yt,{}),action:u?i(ke,{content:a("Find from the address (OpenStreetMap)"),children:i(Dt,{"aria-label":a("Find from the address"),"aria-busy":s||void 0,disabled:s,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:i(Ro,{})})}):void 0,children:u&&o.status?i(po,{compact:!0,oneLine:!0,spaced:!1,status:s?"busy":o.ok&&!c?"found":"notfound",statusText:s?a("Finding…"):c?a(mr):a(o.status),hint:gl(o)}):null}),i(_,{label:a("Enter by hand"),labelId:d,icon:i(yo,{}),action:i(Le,{checked:!!o.manual,onChange:p=>t({...o,manual:p}),ariaLabelledBy:d})}),o.manual&&i(_,{label:a("Latitude, longitude"),icon:i(yt,{}),children:L("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[i(Bt,{value:typeof o.lat=="number"?o.lat:null,onChange:p=>h("lat",p),min:-90,max:90,step:1e-4,placeholder:a("Latitude")}),i(Bt,{value:typeof o.lng=="number"?o.lng:null,onChange:p=>h("lng",p),min:-180,max:180,step:1e-4,placeholder:a("Longitude")})]})})]})}function bl(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function wl(e,t,n){const o=e.map(r=>({text:r?.text??""}));return t===null||t<0||t>=e.length?o:o.map((r,l)=>l===t?{text:n}:r)}function Su(e,t){return e===null?null:t>e?e:null}function Sl(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 _u={label:"Ticker items",icon:i(Io,{})};function Cu(e,t,n,o){return{type:"custom",[N]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...v({},{...pn.textList,label:e}),render:({value:r,onChange:l})=>i(_l,{label:e,icon:K(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:l,markup:o==="markup"})}}function _l({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:l=!1}){const s=J(null),[c,u]=Z(null),d=p=>p.map(f=>({text:f?.text??""})),h=p=>{const f=Sl(n,p,c);f===null&&(s.current=null),u(f),r(d(p))};return i(zo,{label:a(e),icon:t,noun:a("item"),items:n,onChange:h,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:l?i(Gt,{target:s,value:bl(n,c),onChange:p=>r(wl(n,c??-1,p)),disabled:c===null,label:c===null?a("Formatting — click a row first"):a("Formatting — row {n}",{n:c+1})}):void 0,renderRow:(p,f,m)=>i("input",{type:"text",className:l&&c===f?"sf-list-marking":void 0,value:p?.text??"",placeholder:a(o),"aria-label":a("{label} {n}",{label:a(e),n:f+1}),onChange:g=>m({text:g.target.value}),onFocus:g=>{s.current=g.currentTarget,u(f)}})})}function yu(e,t){const n=`${e.label} — row ${t+1}`;return V({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>i(j,{value:o,onChange:r,label:a("{label} — row {n}",{label:a(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function xu(e){return{_gCards:T("Cards"),coverIndex:A("Cover image",i(Oo,{}),Rr,String(Nr),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:ws("Image background",Oi),cardImage:Rn()}}function Ou(){return{outline:A("Card outline",i(No,{}),Ir,Tr),indexBadge:A("Card number",i(Ct,{}),Or,Er),showBadge:Tn("Product badge",!0,i(Tt,{noun:"tag"}))}}function Iu(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...he,label:_e.find(l=>l.id===r).label}),o=r=>v(ve(rt),n(r));return{_gShowOnCard:T("Show on a card"),[rt]:v({type:"custom",render:()=>i(Cl,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(rt)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const rt="showCardPrice",_e=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function Cl({rest:e}){const t=E(),n=ge(),o=s=>typeof t[s]=="boolean"?t[s]:void 0,r=s=>o(s)??e[s],l=_e.some(({id:s})=>o(s)!==void 0&&o(s)!==e[s]);return i(it,{parts:_e,changed:l,shown:r,onPress:(s,c)=>n({[s]:c}),onReset:()=>n(Object.fromEntries(_e.map(({id:s})=>[s,void 0])))})}function Eu(e,t="display"){const n=B(t);return{[t]:y("desktop",{type:"custom",render:({value:o,onChange:r})=>i(it,{parts:e,changed:Zo(o),shown:l=>Qo(o,l),onPress:(l,s)=>r(nr(o,l,s)),onReset:()=>r(void 0)})}),[n]:y("mobile",{type:"custom",render:({value:o,onChange:r})=>i(yl,{parts:e,desktopKey:t,value:o,onChange:r})})}}function it({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:l,disabledReason:s}){const c=a("Display");return i(_,{label:c,icon:i(ho,{}),changed:t,action:i(O,{words:x()?.panel,label:c,changed:t,detail:l,onReset:r}),children:i(Jo,{label:c,items:e.map(u=>({id:u.id,label:a(u.label),shown:n(u.id),...s?{disabled:!0,disabledReason:a(s)}:{}})),onChange:o})})}function yl({parts:e,desktopKey:t,value:n,onChange:o}){const r=E()[t];return i(it,{parts:e,changed:tr(n),shown:l=>er(r,n,l),onPress:(l,s)=>o(or(n,l,s)),onReset:()=>o(yr),detail:a("the same as Desktop")})}function Rn(e=jn){return H("Card image",i(St,{}),F,Te,Vn,F,e,{clear:{hint:F},hint:"Rounds the picture. The card's own corner is in Styles."})}function xl(){return pe(ht,"cardImage")}function Tu(){return{cardImage:Rn(ht),...xl()}}function Ru(){return Ze({sidesKey:"cornerSides",row:Jn,step:zn,useFollowed:()=>F,mark:i(Ol,{label:qn}),hint:a("Rounds the picture. Left alone it stays square.")})}function Ol({label:e,changed:t=!1,onReset:n=()=>{}}){return i(O,{words:x()?.panel,label:a(e),changed:t,onReset:n})}function Nu(){return{type:"custom",render:({value:e,onChange:t})=>i(Rl,{value:typeof e=="string"?e:"",onChange:t})}}const Nn="own";function Pu(){const e=[{value:Nn,label:"Layout's own",picture:un(Array.from({length:8},()=>[3,1]))},...Object.entries(ro).map(([t,n])=>({value:t,label:n.label,picture:un([...n.phone,...n.phone])}))];return y("mobile",an("Layout",i(_t,{}),e,Nn,{columns:2,cell:Qi}))}function Il({layout:e,width:t}){const n=io(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:so(e).map(([r,l],s)=>i("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${r}`,gridRow:`span ${l}`,aspectRatio:o}},s))})}const El={width:"3.5rem",height:"2.5rem",words:!1},Tl=200;function Rl({value:e,onChange:t}){const[n,o]=Z(null),[r,l]=Z(4),s=J(null);Fn(()=>{const m=s.current;if(!m||typeof ResizeObserver!="function")return;const g=()=>l(m.getBoundingClientRect().width>=Tl?4:3);g();const b=new ResizeObserver(g);return b.observe(m),()=>b.disconnect()},[]);const c=e?Zi(Re,e):void 0,u=c?e:"",d=gt(n,u),h=gt(n,"").length,p=lo("no-symbol"),f=[{value:"",label:a("Not chosen"),icon:qi(p,a("Not chosen"))},...d.map(m=>({value:m,label:a(Re[m].label),icon:i(Il,{layout:Re[m],width:40})}))];return i(_,{label:a("Layout"),icon:i(_t,{}),value:c?a(c.label):void 0,children:i("div",{ref:s,style:{flex:"1 1 auto",minWidth:0},children:i(kt,{label:a("Layout"),value:u,options:f,onChange:t,columns:r,cell:El,header:L("div",{className:"mb-2 flex flex-col gap-1",style:{minWidth:"11rem"},children:[i("span",{className:"text-2xs text-ink-faint",children:a("Photos in a row")}),i(Xo,{options:[{id:"all",label:a("All")},...no.map(m=>({id:String(m),label:String(m)}))],value:n===null?"all":String(n),ariaLabel:a("Photos in a row"),onChange:m=>o(m==="all"?null:Number(m))}),i("span",{className:"text-2xs text-ink-faint",children:a("{n} of {total} layouts",{n:h,total:oo.length})})]})})})})}export{cs as BOUND_TO_POST,Cc as BOUND_TO_POST_NOTE,Nc as BUCKET_ICONS,bu as CUSTOM_FIELD_MEDIA,wu as CoordsField,dn as DESKTOP_GAP_NOT_OVERLAP,it as DisplayRow,au as EDGE_ARROWS,ar as FOCAL_DEFAULT,Oe as FOLD_FIELD_MARKER,us as HIGHLIGHT_HINT,j as HidableTextField,dt as LINK_FIELD_MARKER,uc as Label,Ie as MEDIA_FIELD_MARKER,fu as MEDIA_TYPE_OPTIONS,yc as NOT_BOUND_TO_POST,Dc as PanelBand,fs as PanelNoteLine,Xs as RowPropsContext,pt as SCAFFOLD_FIELD_MARKER,Fu as SCALAR_TEXT_CONTROLS,ts as SiteGapDefaultReset,q as Slider,ms as Swatches,ku as TEXT_CONTROL_KINDS,N as TEXT_FIELD_MARKER,_u as TICKER_ITEMS_ROW,_l as TextListField,cl as ThemeFillRow,we as WIDTH_LABEL,ls as WidthDefaultReset,Sl as aimAfterListChange,eu as anchorFields,$ as backTo,Bc as backgroundField,Wc as boxBlockSpacingField,jc as boxColumnsFields,su as boxFillField,Ws as boxPhoneRowField,Gs as boxShareField,Xc as boxSharePhoneField,$c as boxShareTabletField,pl as boxThemeIndexOf,Lc as bucketHeader,Mc as buttonWordsEntryField,Bs as cardCornersField,ws as cardImageBackgroundField,Rn as cardImageField,Tu as cardImageFields,xu as cardMediaFields,Uc as cardShapeFields,Iu as cardShowFields,Ou as cardStyleFields,Yc as cellWidthFields,iu as colorInput,pc as containerDirectionField,ns as containerGapField,os as containerGapPhoneField,dc as containerGapRows,rs as containerGapTabletField,gl as coordsResultTip,Ec as copyText,bn as cornerSidesField,Ze as cornersRowField,gn as cornersUnitFields,tu as customCssFields,ou as date,nu as dateTime,kc as designGroupHeader,Eu as displayFields,cu as edgePad,tt as fillSlotChoices,Su as focusAfterRemove,lu as focusKeptField,Fc as foldMarker,Ee as foldMetaOf,hs as foldTitleOf,Qs as followedHeightPatch,ll as followedStickPatch,Nu as galleryLayoutField,Pu as galleryLayoutPhoneField,Zc as heightFields,Se as heightFollowedBy,Zs as heightLayersAt,fc as heroGroupPlacementPoints,ut as hidableText,ps as hintIsWhileTyping,Ru as imageCornersField,_c as inOwnBox,Ac as isBucketHeader,mn as keptBy,Tc as linkField,hl as loadingRowHint,hu as loadingShowsField,gu as mediaFieldPaths,ot as mediaFields,uu as multiSelect,ru as pageBackgroundField,Pc as panelNote,Vs as phoneOverrideField,Kc as phonePlaceField,Ic as plainText,Rc as plainTextarea,Ss as pxField,vc as quietMarker,ct as readHidable,bl as rowText,du as searchSelect,bs as sectionBandChoices,Os as sectionCornersField,Gc as sectionShapeFields,Hc as sectionThemeFields,wl as setRowText,Vc as sizeField,pu as sourceField,zc as spacingFields,Qc as stickFields,qc as swapPadding,xc as text,Xn as textFieldIdentifier,gc as textFieldOffPage,wc as textFieldPanelOnly,Cu as textList,yu as textListRowField,Oc as textarea,Tn as toggle,mu as upload,me as useLengthRow,ge as useSelectedPatch,E as useSelectedProps,R as useSelectedSibling,es as useSiteGapDetail,Jc as widthField,Sc as withIdentifier,mc as withOffPage,bc as withPanelOnly,hc as withScaffold};
1
+ "use client";import{jsx as i,jsxs as L,Fragment as k}from"react/jsx-runtime";import{HERO_FOCUS as An,HERO_MEDIA_TYPES as Ln}from"../../../format/lib/hero-media-layout.js";import{cloneElement as xe,createContext as kn,useContext as st,useEffect as Fn,useId as lt,useRef as J,useState as Z}from"react";import{useEasel as re,useSelectedHost as G}from"efficient-easel/easel";import{PIN_LENGTH as ie,toDateKey as vn,fromDateKey as Dn,parseOption as Bn}from"efficient-shell/format";import{say as a,editorEaselWords as x}from"../../../format/lib/editor-words.js";import{finiteNumber as Y}from"../../../format/lib/finite-number.js";import{LOADING_SHOWS_LABELS as at,firstFrameHint as Hn,loadingShowsOf as Gn,loadingStillHint as Mn}from"../../../format/lib/hero-video.js";import{pageFramesFor as Un,usePageVideoFrames as Wn}from"../page-video-frames.js";import{ScreenDocumentContext as Kn}from"efficient-easel/screen/components/ScreenDocumentContext";import{readHidable as ct,hidableText as ut}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as Oe,LINK_FIELD_MARKER as dt,MEDIA_FIELD_MARKER as Ie,SCAFFOLD_FIELD_MARKER as pt,TEXT_FIELD_MARKER as N,foldMetaOf as Ee,textFieldIdentifier as Xn}from"efficient-easel/draw";import $n from"../../components/ApplyCornersToSiblings.js";import{withShowWhen as ft}from"../../../render/lib/document/show-when.js";import{CARD_IMAGE_PX_ROW as jn,CARD_IMAGE_RADIUS_ROW as ht,CARD_IMAGE_RADIUS_STEP as Vn,CORNER_RADIUS_MAX as Te,CORNER_RADIUS_MIN as F}from"../../../format/lib/content/card-image-shape.js";import{SECTION_CSS_KEY as Yn}from"../../../format/lib/content/section-css.js";import{IMAGE_CORNER_STEP as zn,IMAGE_CORNERS_LABEL as qn,IMAGE_CORNERS_ROW as Jn}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as Zn,GRID_MAX_ROW_SPAN as mt,GRID_MAX_TILE_AT as Qn,GRID_MOBILE_MAX_COLUMNS as eo,GRID_TILE_AT_KEY as to}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as no,GALLERY_LAYOUTS as Re,GALLERY_LAYOUT_KEYS as oo,GALLERY_PHONE_LAYOUTS as ro,galleryChoices as gt,galleryLayoutRatio as io,galleryPictureCells as so}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as lo}from"./shell-glyph.js";import{anchorSiblingsOf as ao,placementPoints as co}from"../../../format/lib/hero-group-placement.js";import uo from"../../components/AnchorField.js";import po from"../../components/SourceStatus.js";import{AdjustIcon as fo,EyeIcon as ho,AnimationIcon as mo,BackgroundIcon as bt,BorderAllIcon as go,BlockSectionIcon as bo,ColumnWidthsIcon as se,ColumnsIcon as St,CornerIcon as wt,DirectionDownIcon as So,DirectionLeftIcon as wo,DirectionRightIcon as _o,DirectionUpIcon as Co,EditIcon as yo,GapIcon as xo,GridIcon as _t,GroundIcon as Ne,HashIcon as Ct,HeightIcon as le,ImageIcon as Oo,ListIcon as Io,LocationIcon as yt,PaddingBottomIcon as xt,PaddingLeftIcon as Ot,PaddingRightIcon as It,PaddingTopIcon as Pe,PageIcon as Eo,PhoneIcon as To,StickyIcon as Et,SearchIcon as Ro,SquareIcon as No,TypeIcon as Po,WidthIcon as Ao}from"efficient-easel/icons";import{FieldGlyph as Tt}from"../../components/FieldGlyph.js";import{resolvePageBackground as Lo}from"../../../format/lib/content/page-background.js";import{BOX_FILL_FADE_PROP as ko,BOX_FILL_FADES as Fo,BOX_SWATCH_PROP as vo,boxFillFadeOf as Rt,boxFillOf as Do,boxFillSlot as Ae,boxPaintOf as Bo}from"../../../format/lib/content/box-background.js";import{CORNER_SIDES as Nt,CORNER_SIDE_POINTS as Ho,SECTION_CORNERS_ROW as Pt,hasOwnSectionCorners as Go,normalizeCornerSides as At}from"../../../format/lib/content/section-corners.js";import{CARD_CORNERS_ROW as Lt}from"../../../format/lib/content/card-corners.js";import{enclosingPath as Mo,enclosingSection as Uo}from"./enclosing-section.js";import{SettingsDefaultReset as O,SettingsDrill as Wo,SettingsField as _,SettingsGroup as Ko,SettingsSegmented as Xo,SettingsBorder as $o,SettingsSidesEach as jo,SettingsSwitch as Le,borderSides as Vo,borderStartEach as Yo}from"efficient-easel/panel";import{ListField as zo}from"efficient-easel/fields";import{CodeIcon as qo}from"efficient-shell/icons/efficient";import{DisplayChips as Jo}from"efficient-shell/ui";import{desktopDisplayChanged as Zo,partShownOnDesktop as Qo,partShownOnPhone as er,phoneDisplayChanged as tr,withDesktopPart as nr,withPhonePart as or}from"../../../format/lib/content/part-display.js";import{ColorSwatch as rr,CornersInput as ir,DatePicker as sr,DateTimePicker as lr,FOCAL_DEFAULT as ar,IconPicker as kt,COLUMN_COUNT_MAX as Ft,COLUMN_SHARE_MIN as cr,COLUMN_SHARES_EQUAL as ur,resolveColumnShares as vt,WidthsBar as dr,useShellStrings as pr,IconButton as Dt,InputNumber as Bt,Slider as fr,Textarea as hr,Tooltip as ke}from"efficient-shell/ui";import{LOOKUP_BUSY_NOTE as mr}from"./geocode-resolve.js";import{ColourRow as ae,InheritedColourRow as Ht}from"./ColourControl.js";import{fillThemeColors as gr,slotFill as ce}from"../../../format/lib/document/theme-slots.js";import{fillSlotNamed as Fe}from"../../../format/lib/document/part-inks.js";import{keptByRow as ve}from"efficient-easel/screen/lib/document/style-fields";import Gt from"./MarkupToolbar.js";import{deviceField as y}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as br,NoControlMark as Sr,noControlField as Mt}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as wr}from"../../../format/lib/document/own-box.js";import{fieldPanelOnly as _r,PANEL_ONLY_FIELD as Cr}from"../../../format/lib/document/panel-only.js";import{PHONE_CLEAR as yr,resolvePhoneValue as De}from"../../../format/lib/document/phone-override.js";import{phoneKey as B,tabletKey as Be,viewKeyAt as He}from"efficient-easel/draw";import{viewKey as I}from"../../../format/lib/animation/views.js";import{viewRows as M}from"../animation/view-rows.js";import{SuppressibleText as xr}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Or,CARD_OUTLINE_OPTIONS as Ir,DEFAULT_CARD_INDEX_FORMAT as Er,DEFAULT_CARD_OUTLINE as Tr}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as Rr,DEFAULT_COVER_INDEX as Nr}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as Pr}from"efficient-easel/draw";import Ar from"../../components/MediaUploadField.js";import Lr from"../../components/MultiSelectField.js";import kr from"../../components/SectionThemePicker.js";import Fr from"../../components/SearchSelectField.js";import vr from"../../components/StorefrontLinkField.js";import{UiIcon as Ut}from"efficient-easel/draw/client";import{SECTION_PADDING as P}from"../../../render/lib/content/section-padding.js";import{buttonWordsSummary as Dr}from"../../../render/lib/content/button-look.js";import{usePreviewParts as Br}from"efficient-easel/draw/client";import{encodePartId as Hr}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as Gr,useEaselStrings as Mr}from"efficient-easel/strings";import{hasPhoneHeight as Ur,hasTabletHeight as Ge,resolveSectionMinHeight as Wr,resolveTabletHeight as Kr}from"../../../format/lib/content/section-min-height.js";import{INTRO_OLD_STICKY_PINS as Xr,SECTION_PIN_ABOVE_HINT as $r,SECTION_PIN_ABOVE_KEY as jr,SECTION_PIN_ABOVE_LABEL as Vr,SECTION_PIN_GROUP as Yr,SECTION_PIN_LABEL as Wt,SECTION_PIN_SCREENS_KEY as Me,SECTION_PIN_SCREENS_LABEL as Kt,SECTION_PIN_STOP_DEFAULT as zr,SECTION_PIN_STOP_HINT as qr,SECTION_PIN_STOP_KEY as Jr,SECTION_PIN_STOP_LABEL as Zr,SECTION_PIN_STOP_OPTIONS as Qr,SECTION_STICK_DISTANCE as U,SECTION_STICK_DISTANCE_ROW as Ue,SOME_VIEW_PINS as Xt,hasPhoneStick as ei,hasTabletStick as ti,resolveSectionStick as ue,sectionPinStopOf as ni,sectionPinStopWrite as oi}from"../../../format/lib/content/section-sticky.js";import{cssLengthOf as ri}from"../../../format/lib/content/css-length.js";import{SECTION_HEIGHT_MODES as ii,SECTION_MIN_HEIGHT as si,SECTION_MIN_HEIGHT_GROUP_LABEL as Q,SECTION_SCREEN_PCT as li,SECTION_HEIGHT_UNITS as ai}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as ci,resolveContainerDirection as $t}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as ui,BOX_BLOCK_SPACING_POINTS as jt,BOX_PHONE_ROW_LABEL as Vt,BOX_COLUMNS_MAX as di,BOX_COLUMNS_MIN as Yt,BOX_PHONE_ROW_MAX as pi,BOX_PHONE_ROW_MIN as We,BOX_SHARE_CHOICES as zt,BOX_SHARE_LABEL as z,boxShareChoiceOf as qt,boxShareWidthsOf as Ke,BOX_SHARE_PHONE_DEFAULT as fi,BOX_SHARE_PHONE_POINTS as hi}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as W}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as Jt,BORDER_SIDES as mi,SECTION_BORDER_ROW as Zt,borderBySide as Qt}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as gi,normalizeTheme as en,normalizeThemeColors as bi,sectionBandTone as Si,surfaceTwoTone as wi}from"../../../format/lib/theme.js";import{CONTAINER_GAP as tn,CONTAINER_GAP_BUILT_IN as _i,CONTAINER_GAP_PHONE as Xe,GAP_FIELD_CONTAINER as $e,followsSitePhoneGap as Ci,hasOwnContainerGap as yi,hasOwnPhoneGap as je,resolveContainerGap as nn,resolvePhoneContainerGap as on}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as xi,CARD_IMAGE_BG_OFF as Oi,CARD_IMAGE_BG_SWATCH_NAMES as Ii,CARD_IMAGE_BG_SWATCHES as Ei,isCardImageBackgroundInheriting as Ti,cardImageBackgroundChoice as Ri,THEME_CARD_IMAGE_BG as Ni}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as Pi,SECTION_BG_NO_FILL as Ai,sectionBackgroundChoice as Li,THEME_SECTION_BG as Ve,isSectionBackgroundEmpty as ki,sectionBackgroundHex as rn}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as Fi,nestedAccentValue as sn,resolveSectionAccent as de}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as vi,TYPE_SIZE_INHERIT as Di,isTypeSizeInheriting as Bi}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as Hi,WIDTH_CHOICE_LABEL as Gi,WIDTH_INHERIT as Mi}from"../../../format/lib/content/section-width.js";import{useEaselSession as Ui}from"efficient-easel/screen/lib/session-context";import{backendOf as Wi}from"../website-session.js";import{BOX_GAP as Ki,describedAs as v,group as T,iconOf as K,sharedStyleKinds as ee}from"efficient-easel/screen/lib/document/box-fields";import{VIEW_KEY_ACCESS as ln,onDesktopWords as X,phoneTwinFields as Ye,saidAlignmentGrid as Xi,useLengthUnit as $i}from"efficient-easel/screen/lib/document/box-fields";import{LENGTH_UNITS_TABLE as ji,PICTURE_PICKER_ROW as Vi,directionField as Yi,gapField as ze,iconPickerRow as an,lengthUnitFields as pe,pickerCellIcon as zi,pickerNoneIcon as qi,Segmented as fe,select as A,slider as H}from"./box-fields.js";import{VIEW_ABOVE as qe}from"efficient-easel/screen/lib/content/length-units";import{tierOfView as cn,viewOfTier as Ji}from"../../../format/lib/content/view-tier.js";import{ownEntry as Zi}from"../../../format/lib/own-entry.js";import{LAYOUT_CELL as Qi,galleryPhonePicture as un}from"./choice-pictures.js";function dc({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?a(e):e})}function $(e,t){return a("{value} from {from}",{value:e,from:t})}function es(){const{blockGap:e}=W();return e===null?a("this container's own spacing"):$(`${e}px`,a("Styles"))}function ts({inherited:e,onReset:t,label:n}){return i(O,{words:x()?.panel,label:a(n),changed:!e,detail:es(),onReset:t})}function ns(e){return ze({...Ki,builtIn:_i[e],resolve:(t,n)=>nn(e,t,n?.siteGap),action:(t,n)=>i(ts,{inherited:!yi(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[$e]:e}})}function os(e){return ft(y("mobile",{[$e]:e,type:"custom",render:t=>i(ss,{container:e,...t})}),dn)}function rs(e){return ft(y("tablet",{[$e]:e,type:"custom",render:t=>i(is,{container:e,...t})}),dn)}const dn={not:{field:"gap",in:Array.from({length:-tn.min},(e,t)=>tn.min+t)}};function pc(e){return{gap:y("desktop",ns(e)),[Be("gap")]:rs(e),[B("gap")]:os(e)}}function is({container:e,...t}){const[n]=R("gap"),{siteGap:o}=t.field??{},r=Math.max(Xe.min,nn(e,n,o));return ze({...Xe,builtIn:r,resolve:s=>je(s)?s:r,action:(s,c)=>i(O,{words:x()?.panel,label:a("Gap"),changed:je(s),detail:X(u=>a(u),`${r}px`),onReset:()=>c(void 0)})}).render(t)}function ss({container:e,...t}){const[n]=R("gap"),{siteGap:o,siteGapPhone:r}=t.field??{},l=on(e,void 0,n,o,r);return ze({...Xe,builtIn:l,resolve:c=>on(e,c,n,o,r),action:(c,u)=>i(O,{words:x()?.panel,label:a("Gap"),changed:je(c),detail:$(`${l}px`,Ci(e,n,r)?a("Styles"):a("Desktop")),onReset:()=>u(void 0)})}).render(t)}function fc(e){return Yi({offered:ci(e),fallback:$t(e,void 0),resolve:t=>$t(e,t)})}function hc(e,t){return co(t?ao(e,t):[],t)}function ls({inherited:e,onReset:t,label:n}){return i(O,{words:x()?.panel,label:a(n),changed:!e,detail:$(a("Full"),a("the page")),onReset:t})}function j({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:l,hideable:s=!0,markup:c=!0}){const{text:u,hidden:d}=ct(e),h=J(null),p=J(null),f=C=>t(s?{text:C,hidden:d}:C),m=()=>t({text:u,hidden:!d}),g=s&&d,b=lt(),w=r?ps(r)?i("span",{className:"sf-hint-while-typing",children:a(r)}):a(r):void 0,S=d?a("Show {label} on the slide",{label:a(n)}):a("Hide {label} on the slide",{label:a(n)});return i(_,{label:a(n),icon:i(Po,{}),htmlFor:b,className:g?"is-hidden":void 0,hint:w,action:s?i(ke,{content:S,children:i(Dt,{"aria-pressed":d,"aria-label":S,onClick:m,children:d?i(Ut,{name:"eye-off",size:14}):i(Ut,{name:"eye",size:14})})}):void 0,children:L("div",{className:"sf-copybox",children:[c&&i(Gt,{target:l?p:h,value:u,onChange:f}),l?i("textarea",{id:b,ref:p,value:u,placeholder:o===void 0?void 0:a(o),onChange:C=>f(C.target.value)}):i("input",{id:b,ref:h,type:"text",value:u,placeholder:o===void 0?void 0:a(o),onChange:C=>f(C.target.value)})]})})}function mc(e,t){return{...e,[pt]:t}}function gc(e){const t=e[N];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[N]:{...t,offPage:!0}}}function bc(e){return!e||typeof e!="object"?!1:e[N]?.offPage===!0}function Sc(e){if(!e[N])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Cr]:!0}}function wc(e){return _r(e)}function _c(e){const t=e[N];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[N]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as Fu,SCALAR_TEXT_CONTROLS as vu}from"efficient-easel/draw";function Cc(e,t){if(!e[N])throw new Error("inOwnBox: the field holds no authored text");const{[br]:o,...r}=e;return{...r,[wr]:!0,render:t}}const as=new Set(Pr),he={type:"radio",options:[{value:!0},{value:!1}]},pn={text:{type:"object",objectFields:{text:{type:"text"},hidden:he}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:he}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},V=(e,t)=>{const n=v({...t,[N]:e},{...pn[e.control],label:e.label});if(!as.has(e.control))return n;const o=t.render;return{...Mt(n,"authored-copy"),render:r=>i(xr,{name:r.name,children:o(r)})}},yc="Everything else on this block comes from the linked post. Unlink it to edit by hand.",cs={field:"source.slug",set:!0},xc={not:cs},us="Select a word, then press the highlighter.",ds=new Set([us]),ps=e=>ds.has(e);function Oc(e,t,n){return V({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(j,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function Ic(e,t,n){return V({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(j,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function Ec(e,t,n){return V({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(j,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function Tc(e,t,n){return V({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(j,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function Rc(e){return{type:"custom",[dt]:{label:e},...v({},{type:"text",label:e}),render:({value:t,onChange:n})=>i(vr,{value:ut(t),onChange:n,label:e})}}function Nc(e,t,n){return V({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(j,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const Pc={Design:fo,Animation:mo};function Ac(e,t){return{type:"custom",render:()=>i(fs,{text:e,values:t})}}function fs({text:e,values:t}){return i("p",{className:"sf-note",children:a(e,t)})}function Lc(e){return Ee(e)!==null&&e?.tabs!==void 0}const fn=new Map;function kc(e,t){const n=`${e}\0${t?t.join(""):""}`,o=fn.get(n)??{type:"custom",tabs:t,[Oe]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(k,{})};return fn.set(n,o),o}const hn=new Map;function Fc(e){const t=hn.get(e)??{type:"custom",[Oe]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(k,{})};return hn.set(e,t),t}function hs(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function vc(e,t){return hs(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(k,{})}}function Dc(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 Bc({title:e,children:t}){const[n,o]=Z(()=>!Je.has(e));return i(Ko,{title:e,open:n,onToggle:r=>{o(r),r?Je.delete(e):Je.add(e)},children:t})}const Je=new Set;function ms({swatches:e,current:t,onPick:n,names:o}){const r=e.find(c=>c.toLowerCase()===t.toLowerCase()),l=r?o?.[r]:void 0,s=l?a(l):t;return L("div",{className:"sf-swatches",children:[e.map(c=>{const u=o?.[c]?a(o[c]):c;return i(ke,{content:u,children:i(rr,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":u})},c)}),i("span",{className:"sf-swatch-hex",children:s})]})}function Hc(e,t,n=!1){return{type:"custom",render:({value:o,onChange:r})=>i(gs,{label:e,builtIn:t,followsBand:n,value:o,onChange:r})}}function gs({label:e,builtIn:t,followsBand:n,value:o,onChange:r}){const l=typeof o=="string"?o:void 0,{colors:s,n:c}=nt(),u={background:s.background,surface:s.surface,surface2:wi(s),band:Si(s)},d=n?Ve:t,h=ki(l,t,d),p=rn(void 0,d,u),f=n?Pi:void 0,m=d===Ve?a("the theme's section background"):a("Theme {n} background",{n:c}),g=bs(l,t,s,c,u,r),b=$(p.toUpperCase(),m),w=Fe(l),S=w?ce(w,s,c):null;return S?i(ae,{label:a(e),icon:i(bt,{}),value:S.hex,caption:S.words,onChange:r,changed:!0,onReset:()=>r(f),resetTo:b,choices:g}):i(Ht,{label:a(e),icon:i(bt,{}),value:h?"":rn(l,t,u),inherited:p,resetTo:b,onChange:r,onReset:()=>r(f),choices:g})}function bs(e,t,n,o,r,l){const s=Li(e,t);return[{label:a("No fill"),color:"",selected:s==="none",onPick:()=>l(Ai)},{label:`${a("Section band")} · ${r.band.toUpperCase()}`,color:r.band,selected:s==="band",onPick:()=>l(Ve)},...tt(Fe(e)??"",n,o,l)]}function Ss(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,l=Ti(r,t);return i(_,{label:a(e),icon:i(Ne,{}),changed:!l,action:i(O,{words:x()?.panel,label:a(e),changed:!l,detail:a("the theme's image stage"),onReset:()=>o(xi)}),children:ms({swatches:Ei,current:l?Ni:Ri(r,t),onPick:o,names:Ii})})}}}function Gc(e=n=>n,t){return ee({_gSectionTheme:T(Fi),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(kr,{value:e(n),onChange:o,followLabel:t})}})}function me(e){const t=E(),n=cn(e?.view),o=s=>He(e.valueKey,s),r=e.numbersIn??(s=>Y(t[o(s)])!==void 0),l=e.followsView??ks(n,r);return $i({props:{value:void 0,onChange:()=>{},field:{}},row:e.valueKey?e.row:void 0,table:ji,label:a(e.label),grid:e.grid,hasOwn:r(n),view:{tier:n,numbersIn:r,followsView:l},convertTo:e.convertTo??(s=>{const c=Y(t[o(n)]);return c===void 0?{}:{[o(n)]:s(c)}})})}function q({min:e,max:t,step:n,value:o,onChange:r,suffix:l="",readout:s=!0,notch:c,ariaLabel:u,disabled:d=!1,placeholder:h,placeholderWord:p,onClear:f,units:m,inputMax:g}){const b=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:b?"sf-slider has-notch":"sf-slider",style:b?{"--sf-notch":(c-e)/(t-e)}:void 0,children:i(fr,{min:e,max:t,step:n,value:o,...o===null&&h!==void 0?{placeholderValue:h}:{},...p?{emptyLabel:a(p)}:{},suffix:l||void 0,...m?{units:m}:{},...g!==void 0?{inputMax:g}:{},showInput:s,label:u===void 0?void 0:a(u),disabled:d,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:w=>{w===null?f?.():w!==o&&r(w)}})})}function ws(e,t){const{min:n,max:o,step:r=1,unsetLabel:l,hint:s,restTrack:c,unsetMark:u,icon:d,unit:h="px"}=t;return{type:"custom",render:({value:p,onChange:f})=>{const m=typeof p=="number"?p:null,g=m===null;return i(_,{label:a(e),icon:d?K(d):void 0,value:g?u||l===void 0?void 0:a(l):`${m}${h}`,changed:!g,action:u?xe(u,{changed:!g,onReset:()=>f(null)}):i(O,{words:x()?.panel,label:a(e),changed:!g,onReset:()=>f(null)}),hint:typeof s=="string"?a(s):s,children:c?c({min:n,max:o,step:r,px:m,label:e,onChange:f}):q({min:n,max:o,step:r,value:m??n,readout:!1,ariaLabel:e,onChange:f})})}}}const te="Corners",_s={kind:"radius"};function Ze(e){return{type:"custom",render:t=>{const{value:n,onChange:o}=t,r=typeof n=="number"&&Number.isFinite(n)?n:null,l=r!==null;return i(_,{label:a(te),icon:i(wt,{}),changed:l,action:xe(e.mark,{changed:l,onReset:()=>o(null)}),hint:e.hint,children:i(Cs,{tier:e,px:r,name:t.name,onRadius:o})})}}}function R(e){const t=G();return[t?.values?.[e],n=>t?.onChange(e,n)]}function mn(){return Mt({type:"custom",render:()=>i(Sr,{})},"always")}function ge(){const e=G();return t=>e?.onChangeMany(t)}function Cs({tier:e,px:t,name:n,onRadius:o}){const r=e.useFollowed(),[l,s]=R(e.sidesKey),c=ge(),u=me({row:e.row??_s,label:te,grid:{min:F,max:Te,step:e.step??1},valueKey:n??"",view:"desktop"}),d=At(l)??[...Nt];return i(ir,{label:a(te),value:d,corners:Ho,onChange:h=>{const p=At(h)??[];s(p.length===Nt.length?null:p)},radius:t,onRadiusChange:u&&n?h=>c({[n]:h,...u.unitPatch(h===null)}):o,radiusMin:u?.grid.min??F,radiusMax:u?.grid.max??Te,radiusStep:u?.grid.step??e.step??1,radiusPlaceholder:u&&u.unit!=="px"?"–":String(r),...u?{radiusUnit:u.unit,units:u.units}:{}})}function gn(e,t){return pe(e,t)}function bn(){return mn()}function ys({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=W(),r=typeof o=="number"?`${o}px`:a("not set");return i(O,{words:x()?.panel,label:a(e),changed:t,detail:o==null?a("the built-in corners"):$(r,a("Styles")),onReset:n})}function xs(){const{cornerRadiusPx:e}=W();return typeof e=="number"?e:F}function Os(){return Ze({sidesKey:"sectionCornerSides",row:Pt,useFollowed:xs,mark:i(ys,{label:te}),hint:Is})}const Is="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function Mc(){return ee({_gShape:T("Shape"),sectionCorners:Os(),...gn(Pt,"sectionCorners"),sectionCornerSides:bn(),...M("sectionBorder",Ls),...pe(Zt,"sectionBorder",{tablet:!0,phone:!0})})}const Es=()=>({width:a("Border width"),sides:{top:a("Border top"),right:a("Border right"),bottom:a("Border bottom"),left:a("Border left")},style:a("Border style"),styles:{solid:a("Solid"),dashed:a("Dashed"),dotted:a("Dotted")},color:a("Border color"),unit:"px"});function Ts(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function Rs(){let e;try{const t=en(W().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||gi.line}function Ns({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:l=!0,above:s={},length:c}){const u=e&&typeof e=="object"?e:{},[d,h]=Z(()=>r?Yo(u,s):!1),p=Es(),f=m=>Ts(r&&l?m:{width:m.width,color:m.color,...l?{style:m.style}:{}});return i(_,{label:a("Border"),icon:i(go,{}),action:r?i(jo,{each:d,label:a("Each side"),onChange:h}):void 0,children:i($o,{label:a("Border"),value:u,each:d,onChange:m=>t(f(m)),placeholder:n,presets:o,words:c?{...p,unit:c.unit}:p,styles:l,max:c?.grid.max??Jt,...c?{step:c.grid.step,units:c.units}:{}})})}function Ps({value:e,onChange:t,view:n}){const[o]=R("sectionBorder"),[r]=R(Be("sectionBorder")),l=Rs(),s=f=>f&&typeof f=="object"?f:{},c=n==="phone"?{...Qt(s(o)),...Qt(s(r))}:n==="tablet"?s(o):{},u=E(),d=ge(),h=I("sectionBorder",n),p=me({row:Zt,label:"Border",grid:{min:0,max:Jt,step:1},valueKey:"sectionBorder",view:n,numbersIn:f=>Qe(u[He("sectionBorder",f)]),convertTo:f=>{const m=s(u[h]);return Qe(m)?{[h]:As(m,f)}:{}}});return i(Ns,{value:e,length:p,onChange:p?f=>d({[h]:f,...p.unitPatch(!Qe(f))}):t,placeholder:{sides:Vo(c),style:c.style??"solid",color:c.color||l},presets:[l],above:c})}const Sn=["width",...mi];function Qe(e){if(!e||typeof e!="object")return!1;const t=e;return Sn.some(n=>Y(t[n])!==void 0)}function As(e,t){const n={...e};for(const o of Sn){const r=Y(n[o]);r!==void 0&&(n[o]=t(r))}return n}function Ls(e){return{type:"custom",render:({value:t,onChange:n})=>i(Ps,{value:t,onChange:n,view:e})}}function ks(e,t){let n=qe[e];for(;n&&qe[n]!==null&&!t(n);)n=qe[n];return n??e}function Uc(e){return{type:"custom",render:()=>i(Fs,{partKey:e})}}function Fs({partKey:e}){const[t]=R("id"),[n]=R("_partStyles"),{textStyles:o}=W(),r=Mr();let l=null;try{l=Br().select}catch{l=null}const s=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i(Wo,{name:a("Text"),preview:Dr(s,c,{noStyle:a("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??Gr.copy.panel).cases}),onOpen:()=>{l&&typeof t=="string"&&l(Hr(t,e))}})}function wn(e){const{cornerRadiusPx:t}=W(),n=typeof t=="number"?t:e;let o=null;try{const{appState:l,selectedItem:s}=re(u=>u),c=s?.props?.id?String(s.props.id):void 0;o=c?Uo(l?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return Go(r)?r:n}function vs({label:e,changed:t=!1,onReset:n=()=>{}}){const o=wn(F);return i(O,{words:x()?.panel,label:a(e),changed:t,detail:$(`${o}px`,a("the section")),onReset:n})}function Ds(){return i(k,{children:a("Follows the section's Corners until you set a number here.")})}function Bs(){return Ze({sidesKey:"cardCornerSides",row:Lt,useFollowed:()=>wn(F),mark:i(vs,{label:te}),hint:i(Ds,{})})}function Hs(){return{type:"custom",render:()=>i($n,{})}}function Wc(){return{_gShape:T("Shape"),cardCorners:Bs(),...gn(Lt,"cardCorners"),cardCornerSides:bn(),cardCornersApplyAll:Hs()}}function Gs(){return v({type:"custom",[Vi]:!0,render:e=>i(Us,{...e})},{type:"select",label:z,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 Ms(e,t){const n=qt(e);if(n!=="custom")return a(zt.find(r=>r.value===n)?.label??"");const o=vt(Ke(e,t),t);return o?[...o,100-o.reduce((r,l)=>r+l,0)].join(" / "):a("Custom")}function Us(e){const{value:t,onChange:n}=e,[o]=R("content"),r=Array.isArray(o)?o.length:0,l="follows"in e,s=t!=null,c=s?t:l?e.follows:void 0,u=qt(c),d=r>=2&&r<=Ft,h=()=>[...ur[r]??[]],p=J(null),f=S=>{const C=p.current;C&&JSON.stringify(S)===JSON.stringify(C.shares)?n(C.value):S&&n(S)},m=S=>{S===u||S==="custom"&&!d||n(S==="custom"?h():S)},g=a("The width bar works for 2 to {count} blocks.",{count:Ft}),b=s&&(l||t!=="content"),w=pr().widths.hint(r,cr);return i(_,{label:a(z),icon:i(se,{}),changed:b,hint:u!=="custom"?void 0:d?w:g,action:i(O,{words:x()?.panel,label:a(z),changed:b,disabled:e.readOnly===!0,detail:l?X(S=>a(S),Ms(e.follows,r),e.followsView):a("Fit content"),onReset:()=>n(void 0)}),children:L("div",{className:"sf-share-row",children:[i("div",{className:"sf-share-pick",children:i(kt,{label:a(z),value:u,options:zt.map(S=>({value:S.value,label:S.value==="custom"&&!d?g:a(S.label),icon:zi(i("span",{className:"sf-gallery-pic sf-share-pic",children:_n(S.weights).map((C,D)=>i("i",{style:{gridColumn:`span ${C}`}},D))}),a(S.label),S.value==="custom"&&!d?g:a(S.label))})),onChange:m,columns:3,cell:Cn,tooltips:!1,disabled:e.readOnly===!0})}),u==="custom"&&d?i("div",{onFocus:()=>{p.current={value:t,shares:vt(Ke(c,r),r)}},onBlur:()=>{p.current=null},children:i(dr,{label:a(z),count:r,value:Ke(c,r),onChange:f,readOnly:e.readOnly===!0})}):null]})})}function _n(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 Kc(){return A(ui,i(xo,{}),jt,jt[0].value)}function Xc(e){return A("On a phone",i(To,{}),[{label:"In the header",value:"header"},{label:"In the menu",value:"menu"}],e)}function $c(){return y("mobile",an(z,i(se,{}),hi.map(e=>({label:e.label,value:e.value,picture:i("span",{className:"sf-gallery-pic sf-share-pic",children:_n(e.weights).map((t,n)=>i("i",{style:{gridColumn:`span ${t}`}},n))})})),fi,{columns:2,cell:Cn}))}const Cn={width:"5.75rem",height:"3.25rem",words:!0};function jc(){return Ye("share",Gs(),ln)[Be("share")]}function Ws(){return y("mobile",H(Vt,i(St,{}),We,pi,1,We,"",{clear:{phoneFollows:!1,hint:We}}))}const yn={read:e=>e.phoneRow,write:(e,t,n)=>({phoneRow:n}),fieldKey:()=>"phoneRow",ownField:!0};function Vc(){const e=H(Vt,i(St,{}),Yt,di,1,Yt,"",{clear:{emptyLabel:"Auto"}}),t=Ye("columns",e,{...yn,tablet:ln.tablet}),n=Ye("columns",e,yn,{phoneRow:Ws()});return{...t,phoneRow:n.phoneRow}}function Yc(e,t,n,o,r,l,s){return{type:"custom",render:({value:c,onChange:u,name:d})=>i(Ks,{label:e,min:t,max:n,step:o,fallback:r,role:l,value:c,onChange:u,name:d??"",length:s})}}function Ks({label:e,min:t,max:n,step:o,fallback:r,role:l,value:s,onChange:c,name:u,length:d}){const h=E(),p=ge(),f=cn(d?.view),m=me({row:d?.row??{kind:"fontSize"},label:e,grid:{min:t,max:n,step:o},valueKey:d?u:"",view:d?.view??"desktop",numbersIn:b=>b===f&&typeof h[u]=="number",followsView:f,convertTo:b=>typeof h[u]=="number"?{[u]:b(h[u])}:{}}),g=b=>m?p({[u]:b,...m.unitPatch(typeof b!="number")}):c(b);return i(_,{label:a(e),icon:i(Tt,{noun:l}),action:i(O,{words:x()?.panel,label:a(e),changed:!Bi(s),detail:a("the Text style in Styles"),onReset:()=>g(Di),defaultAction:{onPress:()=>g(vi),title:a("Keep this section's own built-in size"),icon:i(bo,{})}}),children:q({min:m?.grid.min??t,max:m?.grid.max??n,step:m?.grid.step??o,value:typeof s=="number"?s:r,...m?{suffix:m.unit,units:m.units}:{suffix:"px"},ariaLabel:e,onChange:g})})}function be(e,t,n){return[{label:"Auto",value:""},...Array.from({length:e},(o,r)=>({label:r===0?`1 ${t}`:`${r+1} ${n}`,value:String(r+1)}))]}function zc(){return{_gCellWidth:T("Cell size"),gridSpan:y("desktop",A("Positions",i(se,{}),be(Zn,"position","positions"),"")),gridRowSpan:y("desktop",A("Rows tall",i(le,{}),be(mt,"row","rows"),"")),[to]:H("At card",i(Ct,{}),1,Qn,1,1,""),[B("gridSpan")]:y("mobile",A("Positions",i(se,{}),[{label:"Full row",value:""},...be(eo,"position","positions").slice(1)],"")),[B("gridRowSpan")]:y("mobile",A("Rows tall",i(le,{}),be(mt,"row","rows"),""))}}function E(){let e=null,t=null;try{e=st(Xs),t=re(n=>n).selectedItem}catch{t=null}return e??t?.props??{}}const Xs=kn(null);function $s({min:e,max:t,step:n,px:o,label:r,onChange:l,desktopKey:s,fallback:c}){const u=E()[s],d=De(void 0,u,c);return i(k,{children:q({min:e,max:t,step:n,value:De(o,u,c),readout:!1,ariaLabel:r,notch:d,onChange:l})})}function js({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:l=()=>{}}){const s=E()[t],c=De(void 0,s,n);return i(O,{words:x()?.panel,label:a(e),changed:r,detail:X(u=>a(u),`${c}${o}`),onReset:l})}function Vs(e){return ws(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:i(js,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:t=>i($s,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const Ys={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},zs={Top:Pe,Bottom:xt,Left:Ot,Right:It},qs=e=>{const t=zs[e];return i(t,{})};function qc(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=w=>Ys[w],l=w=>H(r("Top"),i(Pe,{}),P.min,P.max,P.step,w,"px"),s=(w,S,C,D=P)=>y("mobile",Vs({label:r(w),icon:qs(w),desktopKey:S,min:D.min,max:D.max,step:D.step,fallback:C})),c=e.top??P.min,u=e.bottom??P.min,d="sectionPaddingLeft",h="sectionPaddingRight",p=e.sideBounds??P,f=e.side??p.min,m=e.sidePhone??f,g=e.phone===!0,b=w=>g?y("desktop",w):w;return ee({...o?{_gSpacing:T("Padding")}:{},[t]:b(l(c)),...g?{[B(t)]:s("Top",t,c)}:{},...e.only==="top"?{}:{[n]:b(H(r("Bottom"),i(xt,{}),P.min,P.max,P.step,u,"px")),...g?{[B(n)]:s("Bottom",n,u)}:{}},...e.sides?{[d]:b(H(r("Left"),i(Ot,{}),p.min,p.max,p.step,f,"px")),...g?{[B(d)]:s("Left",d,m,p)}:{},[h]:b(H(r("Right"),i(It,{}),p.min,p.max,p.step,f,"px")),...g?{[B(h)]:s("Right",h,m,p)}:{}}:{}})}function Jc(e,t){const n=Object.fromEntries(Object.entries(t).map(([l,s])=>[l,l in e&&Ee(s)?e[l]:s])),o={};let r=!1;for(const[l,s]of Object.entries(e)){if(l in t){r||Object.assign(o,n),r=!0;continue}o[l]=s}return r||Object.assign(o,n),o}const Se="Width";function Zc(e,t=Hi,n=!0){const o=t.map(r=>({label:Gi[r],value:r}));return ee({...n?{_gWidth:T(Se)}:{},widthMode:{type:"custom",render:({onChange:r,field:l})=>i(_,{label:a(Se),icon:i(Ao,{}),action:n?i(ls,{inherited:l?.inherited??!1,onReset:()=>r(Mi),label:Se}):void 0,children:fe({options:o,value:l?.currentValue||e,onChange:r,ariaLabel:Se})})}})}function Qc({fill:e=!1}={}){const t=(r,l)=>({type:"custom",render:({value:s,onChange:c})=>i(Js,{value:s,onChange:c,view:r,badge:l,fill:e})}),n=()=>ve("sectionHeightMode"),o=()=>ve("sectionHeightMode");return ee({_gHeight:T(Q),...M("sectionHeightMode",r=>r==="desktop"?t(r):t(r,l=>i(tl,{view:r,onClear:()=>l(void 0)}))),...M("sectionHeightValue",n),...M("sectionHeightUnit",o)})}function Js({value:e,onChange:t,view:n,badge:o,fill:r=!1}){const l=E(),{mode:s,number:c,unit:u}=Zs(n,l,e);return i(_,{label:Q,icon:K(i(le,{})),action:o?o(t):void 0,children:L("div",{className:"es-width-stack",children:[fe({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"},...r?[{label:"Fill",value:"fill"}]:[]],value:s,onChange:t,ariaLabel:Q}),c?i(el,{view:n,mode:s,menu:u}):null]})})}function xn(e,t){return e==="phone"&&Ge(t)?Kr(t):Wr(t)}function we(e,t){return e==="desktop"||(e==="tablet"?Ge(t):Ur(t))?null:xn(e,t)}function Zs(e,t,n){const r=(l=>ii.includes(l))(n)?n:we(e,t)?.mode??"auto";return{mode:r,number:r!=="auto"&&r!=="fill",unit:r==="fixed"}}function Qs(e,t,n,o){const r=we(e,t);return!r||e==="desktop"?null:o===void 0?{}:{[I("sectionHeightMode",e)]:r.mode,...r.mode==="fixed"?{[I("sectionHeightUnit",e)]:r.unit}:{},...n==="sectionHeightUnit"?{[I("sectionHeightValue",e)]:r.value}:{},[I(n,e)]:o}}function On(e,t,n){const o=G(),r=we(e,E());return!o||!r?{followed:null,write:n}:{followed:r,write:s=>o.onChangeMany(c=>{const u=Qs(e,c,t,s);return u===null?{[I(t,e)]:s}:Object.keys(u).length?u:null})}}function el({view:e,mode:t,menu:n}){const o=G(),r=E(),l=I("sectionHeightValue",e),s=I("sectionHeightUnit",e),c=w=>S=>o?.onChangeMany(()=>({[w]:S})),{followed:u,write:d}=On(e,"sectionHeightValue",c(l)),{write:h}=On(e,"sectionHeightUnit",c(s)),p=t==="screen"?"%":r[s],f=Bn(ai,"px",u?u.unit:p),m=f==="%"?li:si,g=r[l],b=n?{options:["px","%"],label:a("Unit"),onChange:w=>h(w)}:void 0;return q({min:m.min,max:m.max,step:m.step,value:u?null:typeof g=="number"?g:m.fallback,...u?{placeholder:u.value}:{},suffix:f,...b?{units:b}:{},ariaLabel:Q,onChange:d})}function tl({view:e,onClear:t}){const n=E(),o=we(e,n)===null,r=e==="phone"&&Ge(n),l=xn(e,n),s=X(c=>a(c),l.mode==="auto"?a("Auto"):`${l.value}${l.unit}`,r?"tablet":"desktop");return i(O,{words:x()?.panel,label:a(Q),changed:o,detail:s,onReset:t})}function eu(e={}){const t=e.intro===!0,n=l=>({type:"custom",render:({value:s,onChange:c,id:u,name:d})=>i(al,{value:s,onChange:c,labelId:`${u??d??"stickTop"}-label`,view:l,intro:t})}),o=l=>({type:"custom",render:({value:s,onChange:c})=>i(il,{value:s,onChange:c,view:l,intro:t})}),r=l=>({type:"custom",render:({value:s,onChange:c})=>i(sl,{value:s,onChange:c,view:l,intro:t})});return{_gStick:T(Yr,{dot:t?rl:Xt}),...M("stickTop",n),...M("stickTopDistance",o),...pe(Ue,"stickTopDistance",{tablet:!0,phone:!0}),...e.screens?M(Me,r):{},...t?{}:{[Jr]:nl()},...t||e.above===!1?{}:{[jr]:ol()}}}function nl(){const e=A(Zr,i(Pe,{}),Qr,zr);return y("desktop",{...e,render:t=>{const n=e.render({...t,value:ni(t.value),onChange:o=>t.onChange(oi(o))});return xe(n,{hint:a(qr)})}})}function ol(){const e=Tn(Vr,!1,i(Et,{}),$r);return y("desktop",{...e,render:t=>e.render({...t,onChange:n=>t.onChange(n===!0?!0:void 0)})})}const rl={any:[Xt,Xr]};function In(e,t,n,o,r){const l=G(),s=E(),c=e==="desktop"||ne(e,s)?null:et(e,ue(s,{intro:o}));return{followed:c,write:(c||r)&&l?d=>l.onChangeMany(h=>{const p=ll(e,h,d,t,o),f=p===null?{[I(t,e)]:d}:p;return Object.keys(f).length?{...f,...r?.(d)??{}}:null}):n}}function il({value:e,onChange:t,view:n,intro:o}){const r=E(),l=ue(r,{intro:o}),s=h=>{const p=Ji(h);return p==="desktop"||ne(p,r)},c=me({row:Ue,label:"Distance from top",grid:{min:U.min,max:U.max,step:U.step},valueKey:"stickTopDistance",view:n,numbersIn:h=>s(h)&&Y(r[He("stickTopDistance",h)])!==void 0,followsView:n==="phone"&&l.ownTablet?"tablet":"desktop"}),{followed:u,write:d}=In(n,"stickTopDistance",t,o,c?h=>c.unitPatch(h===void 0):void 0);return i("div",{className:"sf-field",children:q({min:c?.grid.min??U.min,max:c?.grid.max??U.max,step:c?.grid.step??U.step,value:u?null:typeof e=="number"?e:U.fallback,...u?{placeholder:u.distance}:{},...c?{suffix:c.unit,units:c.units}:{suffix:"px"},ariaLabel:a("Distance from top"),onChange:d})})}function sl({value:e,onChange:t,view:n,intro:o}){const{followed:r,write:l}=In(n,Me,t,o);return i(_,{label:a(Kt),icon:K(i(le,{})),children:q({min:ie.min,max:ie.max,step:ie.step,value:r?null:Y(e)??ie.default,...r?{placeholder:r.screens}:{},ariaLabel:a(Kt),onChange:l})})}function ne(e,t){return e==="tablet"?ti(t):ei(t)}function et(e,t){return e==="phone"?{on:t.tablet,distance:t.tabletDistance,unit:t.tabletUnit,screens:t.tabletScreens}:{on:t.desktop,distance:t.desktopDistance,unit:t.desktopUnit,screens:t.desktopScreens}}function ll(e,t,n,o="stickTopDistance",r=!1){if(e==="desktop"||ne(e,t))return null;if(n===void 0)return{};const l=et(e,ue(t,{intro:r})),s=e==="phone"&&ne("tablet",t)?h=>I(h,"tablet"):h=>h,c=(h,p)=>t[s(h)]==null?{}:{[I(h,e)]:p},u=Ue.unitKey,d=t[s(u)]==null?{}:{[I(u,e)]:l.unit};return{[I("stickTop",e)]:!0,...c("stickTopDistance",l.distance),...d,...c(Me,l.screens),[I(o,e)]:n}}function al({value:e,onChange:t,labelId:n,view:o,intro:r}){const l=E(),s=ue(l,{intro:r}),c=o==="phone"?s.phone:o==="tablet"?s.tablet:r?s.desktop:e===!0,u=o==="phone"&&s.ownTablet,d=o==="desktop"?null:et(o,s),h=d?.on?ri(d.distance,d.unit):a("Off");return i(_,{label:a(Wt),labelId:n,icon:K(i(Et,{})),action:L(k,{children:[o!=="desktop"?i(O,{words:x()?.panel,label:a(Wt),changed:ne(o,l),detail:X(p=>a(p),h,u?"tablet":"desktop"),onReset:()=>t(void 0)}):null,i(Le,{checked:c,onChange:t,ariaLabelledBy:n})]})})}const En="e.g. about";function tu(){return{_gAnchor:T("Anchor"),anchor:V({control:"plainText",label:"Name",placeholder:En},{type:"custom",render:({value:e,onChange:t})=>i(uo,{value:e,onChange:t,nameBox:(n,o)=>i(j,{value:n,onChange:o,label:"Name",placeholder:En,hideable:!1,markup:!1})})})}}function nu(){return{_gAdvanced:T("Advanced"),[Yn]:cl}}const cl={type:"custom",render:({value:e,onChange:t})=>i(_,{label:a("Custom CSS"),icon:K(i(qo,{})),children:i(hr,{"aria-label":a("Custom CSS"),spellCheck:!1,autoGrow:!0,className:"font-mono",value:typeof e=="string"?e:"",onChange:n=>t(n.target.value)})})};function ou(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:l,name:s})=>{const c=`${l??s??e}-datetime`,u=Date.parse(typeof o=="string"?o:"");return i(_,{label:a(e),icon:t,htmlFor:c,hint:n===void 0?void 0:a(n),children:i(lr,{id:c,value:Number.isFinite(u)?new Date(u):null,onChange:d=>r(d?d.toISOString():"")})})}}}function ru(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:l,name:s})=>{const c=`${l??s??e}-date`;return i(_,{label:a(e),icon:t,htmlFor:c,hint:n===void 0?void 0:a(n),children:i(sr,{id:c,value:Dn(typeof o=="string"?o:null),onChange:u=>r(u?vn(u):"")})})}}}function Tn(e,t,n,o){return{type:"custom",...v({},{...he,label:e}),render:r=>{const{value:l,onChange:s,id:c,name:u}=r,d="follows"in r,h=r,p=typeof l=="boolean",f=typeof h.follows=="boolean"?h.follows:t,m=p?l:d?f:t,g=`${c??u??e}-label`,b=h.readOnly===!0,w=i(Le,{checked:m,onChange:s,disabled:b,ariaLabelledBy:g});return i(_,{label:a(e),labelId:g,icon:n,hint:o===void 0?void 0:a(o),action:d?L(k,{children:[i(O,{words:x()?.panel,label:a(e),changed:p,detail:h.followsNoView?a(f?"On":"Off"):X(S=>a(S),a(f?"On":"Off"),h.followsView),disabled:b,onReset:()=>s(void 0)}),w]}):w})}}}function iu(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i(ul,{label:"Background",icon:i(Eo,{}),id:r,value:e,shown:Lo(e),onChange:t})}}}function su(e,t,n){return{type:"custom",render:({value:o,onChange:r})=>i(ae,{label:a(e),icon:n,value:o||t,onChange:r})}}function ul({label:e,icon:t,id:n,value:o,shown:r,onChange:l}){const{colors:s,n:c}=nt(),u=Fe(o),d=u?ce(u,s,c):null;return i(ae,{label:a(e),icon:t,id:n,value:d?d.hex:r,caption:d?.words,onChange:l,choices:tt(u??"",s,c,l)})}function lu(){return{type:"custom",render:e=>{const{value:t,onChange:n}=e,o=e;return i(dl,{value:typeof t=="string"?t:"",onChange:n,twin:"follows"in e?{follows:o.follows,view:o.followsView}:void 0})}}}function tt(e,t,n,o){const r=Ae(e);return gr(t,n).map(l=>({label:l.label,color:l.value,selected:r===l.name,onPick:()=>o(l.name)}))}function dl({value:e,onChange:t,twin:n}){const{colors:o,n:r}=nt(),l=o.background,s=$(l.toUpperCase(),a("Theme {n} background",{n:r})),[c,u]=R(ko),[d]=R(vo),h=typeof d=="string"&&d.trim()!=="",p=Rt(c),f=oe=>u(Rt(oe)||void 0),m=Ae(e),g=m?ce(m,o,r):null,b=tt(e,o,r,t),w=n?()=>t(void 0):()=>t("");let S=l,C=s;if(n){const oe=Ae(n.follows),Ce=Do(n.follows),ye=oe?ce(oe,o,r):Ce?{hex:Ce,words:Ce.toUpperCase()}:null;S=ye?.hex??l,C=X(Pn=>a(Pn),ye?ye.words:s,n.view)}const D=!n&&(Bo(e)||h)?i(pl,{value:p,onChange:f}):null;return g?i(ae,{label:a("Fill"),icon:i(Ne,{}),value:g.hex,caption:g.words,onChange:t,changed:!0,onReset:w,resetTo:C,choices:b,children:D}):i(Ht,{label:a("Fill"),icon:i(Ne,{}),value:e,inherited:S,resetTo:C,onChange:t,onReset:w,choices:b,children:D})}function pl({value:e,onChange:t}){return fe({options:Fo.map(n=>({label:n.label,value:n.value,hint:n.hint})),value:e,onChange:t,ariaLabel:a("Fill")})}function fl(e,t,n){if((e?.content??[]).some(s=>s?.props?.id===t))return de(n);const r=Mo(e,t);if(r.length===0)return null;const l=de(sn(n));if(l!==null)return l;for(let s=r.length-1;s>0;s-=1){const c=de(sn(r[s].sectionAccent));if(c!==null)return c}return de(r[0].sectionAccent)}function nt(){const e=en(W().theme),[t]=R("sectionAccent");let n=null;try{const{appState:r,selectedItem:l}=re(c=>c),s=l?.props?.id?String(l.props.id):void 0;n=s?fl(r?.data,s,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{colors:bi(e.themes[o]),n:o+1}}function au(){return mn()}const cu={top:i(Co,{}),right:i(_o,{}),bottom:i(So,{}),left:i(wo,{})};function uu(e,t,n,o,r,l,s){const c=p=>t.find(f=>f.value===p),u=p=>({value:p,label:"",disabled:!0,title:o}),d=p=>{const f=t.find(g=>g.cell===p);if(!f)return u(`missing-${p}`);const m=l?.[p];return m?{value:f.value,label:f.label,icon:m}:{value:f.value,label:f.label}},h=[u("corner-top-left"),d("top"),u("corner-top-right"),d("left"),u("centre"),d("right"),u("corner-bottom-left"),d("bottom"),u("corner-bottom-right")];return{type:"custom",render:({value:p,onChange:f})=>{const m=t.some(g=>g.value===p)?p:n;return i(_,{label:a(e),icon:r,value:c(m)?.label?a(c(m).label):s?a(s):"",children:Xi(a,{label:e,value:m,onChange:f,points:h})})}}}function du(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:l})=>i(Lr,{label:e,options:(l.options??t).map(s=>({...s,label:a(s.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:a(n)}:{}})}}function pu(e,t,n,o){return{type:"custom",options:t,fallback:n,...v({},{type:"select",label:e}),render:({value:r,onChange:l,field:s})=>i(Fr,{label:e,options:(s.options??t).map(c=>({...c,label:a(c.label)})),fallback:s.fallback??n,value:r,onChange:l,placeholder:o===void 0?void 0:a(o)})}}function fu(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}const hl={image:"Image",video:"Video"},hu=Ln.map(e=>({label:hl[e],value:e}));function mu(e,t,n){const o=Object.keys(at).map(r=>({label:at[r],value:r,picture:n[r]}));return{type:"custom",...v({},{type:"radio",label:e,options:o.map(r=>({value:r.value,label:r.label}))}),render:({onChange:r})=>i(gl,{label:e,icon:t,options:o,onChange:r})}}function ml(e,t,n){const o=Hn(e,t,n);if(o!==void 0)return o==="save-makes-frame"?a("A frame is made from this video when you save the page."):o==="starts-dark"?a("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"?a("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"?a("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"?a("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"?a("The slide shows your Image while the video loads, because this video has no frame."):void 0;const r=Mn(e);return r==="frame-missing-image"?a("This video has no frame yet. The slide shows its image until one is made."):r==="frame-missing-surface"?a("This video has no frame yet. The slide shows its background colour until one is made."):r==="image-missing-frame"?a("No image yet. The slide shows the video's frame until you choose one."):r==="image-missing-surface"?a("No image yet. The slide shows its background colour until you choose one."):void 0}function gl({label:e,icon:t,options:n,onChange:o}){const r=G(),l=r?.values??{},s=Gn(l),c=st(Kn),u=Wn(c?.docId??null);let d=null;try{d=re(p=>p.appState.data)}catch{d=null}const h=Un(r?.id,d,u);return i(_,{label:a(e),icon:K(t),hint:ml(l,h,c?.hasUnsavedEdits??!1),children:fe({options:n,value:s,onChange:o,ariaLabel:e})})}function gu(e,t,n,o={}){const r={type:"custom",[Ie]:!0,render:({value:l,onChange:s,name:c})=>i(Ar,{value:l||"",onChange:s,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?y("each",r):r}function bu(e){return ot(e).map(t=>t.path)}function ot(e,t="",n=[]){const o=[];for(const[r,l]of Object.entries(e??{})){const s=t?`${t}.${r}`:r,c=l;if(c&&c[Ie]){o.push({path:s,field:c,along:n});continue}c?.arrayFields&&o.push(...ot(c.arrayFields,`${s}[]`,[...n,c])),c?.objectFields&&o.push(...ot(c.objectFields,s,[...n,c]))}return o}const Su={HeroSingle:[An.image],HeroSlide:["videoFrame","videoFramePhone"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function bl(e){const t=a(e.status??"");return e.ok&&typeof e.lat=="number"&&typeof e.lng=="number"?`${t} · ${e.lat.toFixed(4)}, ${e.lng.toFixed(4)}`:t}function wu({value:e,onChange:t,label:n}){const o=e||{},r=G(),l=r?r.values!==r.node.props:!0,s=!!o.pending&&l,c=!!o.pending&&!l,u=!!Wi(Ui()).geocode,d=lt(),h=(p,f)=>t({...o,[p]:f??void 0});return L(k,{children:[i(_,{label:a(n),icon:i(yt,{}),action:u?i(ke,{content:a("Find from the address (OpenStreetMap)"),children:i(Dt,{"aria-label":a("Find from the address"),"aria-busy":s||void 0,disabled:s,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:i(Ro,{})})}):void 0,children:u&&o.status?i(po,{compact:!0,oneLine:!0,spaced:!1,status:s?"busy":o.ok&&!c?"found":"notfound",statusText:s?a("Finding…"):c?a(mr):a(o.status),hint:bl(o)}):null}),i(_,{label:a("Enter by hand"),labelId:d,icon:i(yo,{}),action:i(Le,{checked:!!o.manual,onChange:p=>t({...o,manual:p}),ariaLabelledBy:d})}),o.manual&&i(_,{label:a("Latitude, longitude"),icon:i(yt,{}),children:L("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[i(Bt,{value:typeof o.lat=="number"?o.lat:null,onChange:p=>h("lat",p),min:-90,max:90,step:1e-4,placeholder:a("Latitude")}),i(Bt,{value:typeof o.lng=="number"?o.lng:null,onChange:p=>h("lng",p),min:-180,max:180,step:1e-4,placeholder:a("Longitude")})]})})]})}function Sl(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function wl(e,t,n){const o=e.map(r=>({text:r?.text??""}));return t===null||t<0||t>=e.length?o:o.map((r,l)=>l===t?{text:n}:r)}function _u(e,t){return e===null?null:t>e?e:null}function _l(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 Cu={label:"Ticker items",icon:i(Io,{})};function yu(e,t,n,o){return{type:"custom",[N]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...v({},{...pn.textList,label:e}),render:({value:r,onChange:l})=>i(Cl,{label:e,icon:K(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:l,markup:o==="markup"})}}function Cl({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:l=!1}){const s=J(null),[c,u]=Z(null),d=p=>p.map(f=>({text:f?.text??""})),h=p=>{const f=_l(n,p,c);f===null&&(s.current=null),u(f),r(d(p))};return i(zo,{label:a(e),icon:t,noun:a("item"),items:n,onChange:h,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:l?i(Gt,{target:s,value:Sl(n,c),onChange:p=>r(wl(n,c??-1,p)),disabled:c===null,label:c===null?a("Formatting — click a row first"):a("Formatting — row {n}",{n:c+1})}):void 0,renderRow:(p,f,m)=>i("input",{type:"text",className:l&&c===f?"sf-list-marking":void 0,value:p?.text??"",placeholder:a(o),"aria-label":a("{label} {n}",{label:a(e),n:f+1}),onChange:g=>m({text:g.target.value}),onFocus:g=>{s.current=g.currentTarget,u(f)}})})}function xu(e,t){const n=`${e.label} — row ${t+1}`;return V({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>i(j,{value:o,onChange:r,label:a("{label} — row {n}",{label:a(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function Ou(e){return{_gCards:T("Cards"),coverIndex:A("Cover image",i(Oo,{}),Rr,String(Nr),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:Ss("Image background",Oi),cardImage:Rn()}}function Iu(){return{outline:A("Card outline",i(No,{}),Ir,Tr),indexBadge:A("Card number",i(Ct,{}),Or,Er),showBadge:Tn("Product badge",!0,i(Tt,{noun:"tag"}))}}function Eu(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...he,label:_e.find(l=>l.id===r).label}),o=r=>v(ve(rt),n(r));return{_gShowOnCard:T("Show on a card"),[rt]:v({type:"custom",render:()=>i(yl,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(rt)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const rt="showCardPrice",_e=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function yl({rest:e}){const t=E(),n=ge(),o=s=>typeof t[s]=="boolean"?t[s]:void 0,r=s=>o(s)??e[s],l=_e.some(({id:s})=>o(s)!==void 0&&o(s)!==e[s]);return i(it,{parts:_e,changed:l,shown:r,onPress:(s,c)=>n({[s]:c}),onReset:()=>n(Object.fromEntries(_e.map(({id:s})=>[s,void 0])))})}function Tu(e,t="display"){const n=B(t);return{[t]:y("desktop",{type:"custom",render:({value:o,onChange:r})=>i(it,{parts:e,changed:Zo(o),shown:l=>Qo(o,l),onPress:(l,s)=>r(nr(o,l,s)),onReset:()=>r(void 0)})}),[n]:y("mobile",{type:"custom",render:({value:o,onChange:r})=>i(xl,{parts:e,desktopKey:t,value:o,onChange:r})})}}function it({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:l,disabledReason:s}){const c=a("Display");return i(_,{label:c,icon:i(ho,{}),changed:t,action:i(O,{words:x()?.panel,label:c,changed:t,detail:l,onReset:r}),children:i(Jo,{label:c,items:e.map(u=>({id:u.id,label:a(u.label),shown:n(u.id),...s?{disabled:!0,disabledReason:a(s)}:{}})),onChange:o})})}function xl({parts:e,desktopKey:t,value:n,onChange:o}){const r=E()[t];return i(it,{parts:e,changed:tr(n),shown:l=>er(r,n,l),onPress:(l,s)=>o(or(n,l,s)),onReset:()=>o(yr),detail:a("the same as Desktop")})}function Rn(e=jn){return H("Card image",i(wt,{}),F,Te,Vn,F,e,{clear:{hint:F},hint:"Rounds the picture. The card's own corner is in Styles."})}function Ol(){return pe(ht,"cardImage")}function Ru(){return{cardImage:Rn(ht),...Ol()}}function Nu(){return Ze({sidesKey:"cornerSides",row:Jn,step:zn,useFollowed:()=>F,mark:i(Il,{label:qn}),hint:a("Rounds the picture. Left alone it stays square.")})}function Il({label:e,changed:t=!1,onReset:n=()=>{}}){return i(O,{words:x()?.panel,label:a(e),changed:t,onReset:n})}function Pu(){return{type:"custom",render:({value:e,onChange:t})=>i(Nl,{value:typeof e=="string"?e:"",onChange:t})}}const Nn="own";function Au(){const e=[{value:Nn,label:"Layout's own",picture:un(Array.from({length:8},()=>[3,1]))},...Object.entries(ro).map(([t,n])=>({value:t,label:n.label,picture:un([...n.phone,...n.phone])}))];return y("mobile",an("Layout",i(_t,{}),e,Nn,{columns:2,cell:Qi}))}function El({layout:e,width:t}){const n=io(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:so(e).map(([r,l],s)=>i("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${r}`,gridRow:`span ${l}`,aspectRatio:o}},s))})}const Tl={width:"3.5rem",height:"2.5rem",words:!1},Rl=200;function Nl({value:e,onChange:t}){const[n,o]=Z(null),[r,l]=Z(4),s=J(null);Fn(()=>{const m=s.current;if(!m||typeof ResizeObserver!="function")return;const g=()=>l(m.getBoundingClientRect().width>=Rl?4:3);g();const b=new ResizeObserver(g);return b.observe(m),()=>b.disconnect()},[]);const c=e?Zi(Re,e):void 0,u=c?e:"",d=gt(n,u),h=gt(n,"").length,p=lo("no-symbol"),f=[{value:"",label:a("Not chosen"),icon:qi(p,a("Not chosen"))},...d.map(m=>({value:m,label:a(Re[m].label),icon:i(El,{layout:Re[m],width:40})}))];return i(_,{label:a("Layout"),icon:i(_t,{}),value:c?a(c.label):void 0,children:i("div",{ref:s,style:{flex:"1 1 auto",minWidth:0},children:i(kt,{label:a("Layout"),value:u,options:f,onChange:t,columns:r,cell:Tl,header:L("div",{className:"mb-2 flex flex-col gap-1",style:{minWidth:"11rem"},children:[i("span",{className:"text-2xs text-ink-faint",children:a("Photos in a row")}),i(Xo,{options:[{id:"all",label:a("All")},...no.map(m=>({id:String(m),label:String(m)}))],value:n===null?"all":String(n),ariaLabel:a("Photos in a row"),onChange:m=>o(m==="all"?null:Number(m))}),i("span",{className:"text-2xs text-ink-faint",children:a("{n} of {total} layouts",{n:h,total:oo.length})})]})})})})}export{cs as BOUND_TO_POST,yc as BOUND_TO_POST_NOTE,Pc as BUCKET_ICONS,cl as CUSTOM_CSS_ROW,Su as CUSTOM_FIELD_MEDIA,wu as CoordsField,dn as DESKTOP_GAP_NOT_OVERLAP,it as DisplayRow,cu as EDGE_ARROWS,ar as FOCAL_DEFAULT,Oe as FOLD_FIELD_MARKER,us as HIGHLIGHT_HINT,j as HidableTextField,dt as LINK_FIELD_MARKER,dc as Label,Ie as MEDIA_FIELD_MARKER,hu as MEDIA_TYPE_OPTIONS,xc as NOT_BOUND_TO_POST,Bc as PanelBand,fs as PanelNoteLine,Xs as RowPropsContext,pt as SCAFFOLD_FIELD_MARKER,vu as SCALAR_TEXT_CONTROLS,ts as SiteGapDefaultReset,q as Slider,ms as Swatches,Fu as TEXT_CONTROL_KINDS,N as TEXT_FIELD_MARKER,Cu as TICKER_ITEMS_ROW,Cl as TextListField,ul as ThemeFillRow,Se as WIDTH_LABEL,ls as WidthDefaultReset,_l as aimAfterListChange,tu as anchorFields,$ as backTo,Hc as backgroundField,Kc as boxBlockSpacingField,Vc as boxColumnsFields,lu as boxFillField,Ws as boxPhoneRowField,Gs as boxShareField,$c as boxSharePhoneField,jc as boxShareTabletField,fl as boxThemeIndexOf,kc as bucketHeader,Uc as buttonWordsEntryField,Bs as cardCornersField,Ss as cardImageBackgroundField,Rn as cardImageField,Ru as cardImageFields,Ou as cardMediaFields,Wc as cardShapeFields,Eu as cardShowFields,Iu as cardStyleFields,zc as cellWidthFields,su as colorInput,fc as containerDirectionField,ns as containerGapField,os as containerGapPhoneField,pc as containerGapRows,rs as containerGapTabletField,bl as coordsResultTip,Tc as copyText,bn as cornerSidesField,Ze as cornersRowField,gn as cornersUnitFields,nu as customCssFields,ru as date,ou as dateTime,Fc as designGroupHeader,Tu as displayFields,uu as edgePad,tt as fillSlotChoices,_u as focusAfterRemove,au as focusKeptField,vc as foldMarker,Ee as foldMetaOf,hs as foldTitleOf,Qs as followedHeightPatch,ll as followedStickPatch,Pu as galleryLayoutField,Au as galleryLayoutPhoneField,Qc as heightFields,we as heightFollowedBy,Zs as heightLayersAt,hc as heroGroupPlacementPoints,ut as hidableText,ps as hintIsWhileTyping,Nu as imageCornersField,Cc as inOwnBox,Lc as isBucketHeader,mn as keptBy,Rc as linkField,ml as loadingRowHint,mu as loadingShowsField,bu as mediaFieldPaths,ot as mediaFields,du as multiSelect,iu as pageBackgroundField,Ac as panelNote,Vs as phoneOverrideField,Xc as phonePlaceField,Ec as plainText,Nc as plainTextarea,ws as pxField,Dc as quietMarker,ct as readHidable,Sl as rowText,pu as searchSelect,bs as sectionBandChoices,Os as sectionCornersField,Mc as sectionShapeFields,Gc as sectionThemeFields,wl as setRowText,Yc as sizeField,fu as sourceField,qc as spacingFields,eu as stickFields,Jc as swapPadding,Oc as text,Xn as textFieldIdentifier,bc as textFieldOffPage,wc as textFieldPanelOnly,yu as textList,xu as textListRowField,Ic as textarea,Tn as toggle,gu as upload,me as useLengthRow,ge as useSelectedPatch,E as useSelectedProps,R as useSelectedSibling,es as useSiteGapDetail,Zc as widthField,_c as withIdentifier,gc as withOffPage,Sc as withPanelOnly,mc as withScaffold};
@@ -1,7 +1,8 @@
1
- import { type TierFrames } from "../../../render/lib/content/section-padding.js";
1
+ import { type OwnFrame } from "../../../render/lib/content/section-padding.js";
2
2
  type Props = Record<string, unknown>;
3
- type FrameOf = (props: Props) => number | TierFrames;
4
- type Note = (props: Props, frame: number) => string | null;
3
+ type FrameOf = (props: Props) => OwnFrame;
4
+ type Side = "top" | "bottom";
5
+ type Note = (props: Props, frame: number, side?: Side) => string | null;
5
6
  export declare function ownPadFallbackAt(frameOf: FrameOf, values: Props, key: string | undefined): {
6
7
  top: number;
7
8
  bottom: number;
@@ -1 +1 @@
1
- import{jsx as i,Fragment as f,jsxs as p}from"react/jsx-runtime";import{useSelectedHost as d}from"efficient-easel/easel";import{VIEW_TIERS as O,viewKeyAt as P}from"efficient-easel/draw";import{SECTION_PAD_KEYS as c,frameAt as u,padTotalKeys as b}from"../../../render/lib/content/section-padding.js";import{sidesPaddingFields as j}from"./box-fields.js";const m=t=>O.find(r=>Object.values(c).some(e=>P(e,r)===t))??"desktop";function w(t,r,e){const n=u(t(r),m(e));return{top:n,bottom:n}}function x(t,r,e,n){return r(e,u(t(e),m(n)))}function S({frameOf:t,note:r,rowKey:e}){const n=d()?.values,o=n?x(t,r,n,e):null;return o?i("p",{className:"es-field-hint",children:o}):null}const _=new Set(b().filter(t=>t.startsWith(c.top)));function K(t,r,e){const n=j({tablet:!0,siteSide:!0,...e?{label:e}:{},useFallback:o=>{const s=d()?.values;return s?w(t,s,o.name):{top:0,bottom:0}}});return Object.fromEntries(Object.entries(n).map(([o,s])=>{const a=s.render;return!_.has(o)||typeof a!="function"?[o,s]:[o,{...s,render:l=>p(f,{children:[a(l),i(S,{frameOf:t,note:r,rowKey:o})]})}]}))}export{w as ownPadFallbackAt,x as ownPadNoteAt,K as ownPaddingFields};
1
+ import{jsx as d,Fragment as f,jsxs as p}from"react/jsx-runtime";import{useSelectedHost as c}from"efficient-easel/easel";import{VIEW_TIERS as b,viewKeyAt as O}from"efficient-easel/draw";import{SECTION_PAD_KEYS as m,padTotalKeys as P,sideFrameAt as i}from"../../../render/lib/content/section-padding.js";import{sidesPaddingFields as j}from"./box-fields.js";const u=e=>b.find(r=>Object.values(m).some(o=>O(o,r)===e))??"desktop";function w(e,r,o){const n=e(r),t=u(o);return{top:i(n,"top",t),bottom:i(n,"bottom",t)}}const x=e=>e.startsWith(m.bottom)?"bottom":"top";function F(e,r,o,n){const t=x(n);return r(o,i(e(o),t,u(n)),t)}function S({frameOf:e,note:r,rowKey:o}){const n=c()?.values,t=n?F(e,r,n,o):null;return t?d("p",{className:"es-field-hint",children:t}):null}const _=new Set(P());function N(e,r,o){const n=j({tablet:!0,siteSide:!0,...o?{label:o}:{},useFallback:t=>{const s=c()?.values;return s?w(e,s,t.name):{top:0,bottom:0}}});return Object.fromEntries(Object.entries(n).map(([t,s])=>{const a=s.render;return!_.has(t)||typeof a!="function"?[t,s]:[t,{...s,render:l=>p(f,{children:[a(l),d(S,{frameOf:e,note:r,rowKey:t})]})}]}))}export{w as ownPadFallbackAt,F as ownPadNoteAt,N as ownPaddingFields};