efficient-web-builder 66.0.0 → 67.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/editor/components/MediaUploadField.js +1 -1
  3. package/dist/editor/components/PartSettingsPanel.js +1 -1
  4. package/dist/editor/components/PartTextBox.js +1 -1
  5. package/dist/editor/components/PreviewPartAnchors.js +1 -1
  6. package/dist/editor/components/SectionWidthRows.d.ts +3 -1
  7. package/dist/editor/components/SectionWidthRows.js +1 -1
  8. package/dist/editor/components/SiteTextStylesField.js +1 -1
  9. package/dist/editor/components/storefront-editor.css +47 -0
  10. package/dist/editor/lib/animation/hover-fields.d.ts +1 -1
  11. package/dist/editor/lib/animation/hover-fields.js +1 -1
  12. package/dist/editor/lib/document/block-offer.d.ts +2 -0
  13. package/dist/editor/lib/document/block-offer.js +1 -1
  14. package/dist/editor/lib/document/blocks/general/Divider/fields.js +1 -1
  15. package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
  16. package/dist/editor/lib/document/blocks/general/HeroGroup/fields.js +1 -1
  17. package/dist/editor/lib/document/blocks/general/ImageBlock/fields.js +1 -1
  18. package/dist/editor/lib/document/blocks/general/IntroBleed/fields.js +1 -1
  19. package/dist/editor/lib/document/blocks/general/PostCard/fields.js +1 -1
  20. package/dist/editor/lib/document/blocks/general/Split/fields.js +1 -1
  21. package/dist/editor/lib/document/blocks/hero-shared-fields.js +1 -1
  22. package/dist/editor/lib/document/box-fields.d.ts +1 -1
  23. package/dist/editor/lib/document/controls.d.ts +24 -14
  24. package/dist/editor/lib/document/controls.js +1 -1
  25. package/dist/editor/lib/document/passes/inspector.js +1 -1
  26. package/dist/editor/lib/document/section-own-width-fields.js +1 -1
  27. package/dist/format/lib/animation/views.js +1 -1
  28. package/dist/format/lib/content/borders.d.ts +12 -2
  29. package/dist/format/lib/content/borders.js +1 -1
  30. package/dist/format/lib/content/card-corners.d.ts +3 -1
  31. package/dist/format/lib/content/card-corners.js +1 -1
  32. package/dist/format/lib/content/css-length.d.ts +6 -0
  33. package/dist/format/lib/content/css-length.js +1 -1
  34. package/dist/format/lib/content/image-corners.d.ts +3 -1
  35. package/dist/format/lib/content/image-corners.js +1 -1
  36. package/dist/format/lib/content/section-corners.d.ts +3 -1
  37. package/dist/format/lib/content/section-corners.js +1 -1
  38. package/dist/format/lib/content/section-min-height.d.ts +11 -1
  39. package/dist/format/lib/content/section-min-height.js +1 -1
  40. package/dist/format/lib/content/section-sticky.d.ts +5 -0
  41. package/dist/format/lib/content/section-sticky.js +1 -1
  42. package/dist/format/lib/content/section-type-size.d.ts +12 -1
  43. package/dist/format/lib/content/section-type-size.js +1 -1
  44. package/dist/format/lib/content/section-width.d.ts +8 -0
  45. package/dist/format/lib/content/section-width.js +1 -1
  46. package/dist/format/lib/content/view-tier.d.ts +10 -0
  47. package/dist/format/lib/content/view-tier.js +1 -0
  48. package/dist/format/lib/document/blocks/general/Split/meta.d.ts +1 -0
  49. package/dist/format/lib/document/blocks/general/Split/meta.js +2 -2
  50. package/dist/format/lib/document/easel-row-words.d.ts +2 -0
  51. package/dist/format/lib/document/easel-row-words.js +1 -1
  52. package/dist/format/lib/document/passes/types.d.ts +3 -1
  53. package/dist/format/lib/document/section-catalog.d.ts +5 -0
  54. package/dist/format/lib/document/section-catalog.js +10 -2
  55. package/dist/format/lib/editor-words-catalogue.d.ts +3 -0
  56. package/dist/format/lib/editor-words-catalogue.js +3 -3
  57. package/dist/format/lib/fit-words.js +4 -2
  58. package/dist/format/lib/post-card-layout.d.ts +3 -0
  59. package/dist/format/lib/post-card-layout.js +1 -1
  60. package/dist/format/lib/sections/divider-style.d.ts +9 -0
  61. package/dist/format/lib/sections/divider-style.js +1 -1
  62. package/dist/format/lib/sections/hero-single-to-hero.js +1 -1
  63. package/dist/format/lib/sections/section-presets.js +1 -1
  64. package/dist/format/lib/source-rules/one-length-control.js +3 -3
  65. package/dist/format/lib/theme.d.ts +1 -1
  66. package/dist/format/lib/theme.js +4 -4
  67. package/dist/render/components/Divider.d.ts +3 -1
  68. package/dist/render/components/Divider.js +1 -1
  69. package/dist/render/components/Flex.d.ts +3 -1
  70. package/dist/render/components/Flex.js +1 -1
  71. package/dist/render/components/HeroGroup.d.ts +3 -1
  72. package/dist/render/components/HeroGroup.js +1 -1
  73. package/dist/render/components/ImageBlock.d.ts +2 -1
  74. package/dist/render/components/ImageBlock.js +1 -1
  75. package/dist/render/components/IntroBleed.d.ts +3 -2
  76. package/dist/render/components/IntroBleed.js +1 -1
  77. package/dist/render/components/PictureHoverMove.d.ts +18 -0
  78. package/dist/render/components/PictureHoverMove.js +1 -0
  79. package/dist/render/components/PictureWash.d.ts +2 -1
  80. package/dist/render/components/PictureWash.js +1 -1
  81. package/dist/render/components/ViewHideRoot.d.ts +6 -0
  82. package/dist/render/components/ViewHideRoot.js +1 -1
  83. package/dist/render/lib/content/block-size.d.ts +1 -1
  84. package/dist/render/lib/content/block-size.js +1 -1
  85. package/dist/render/lib/content/button-look.js +1 -1
  86. package/dist/render/lib/content/section-padding.js +1 -1
  87. package/dist/render/lib/document/blocks/general/Divider/render.js +1 -1
  88. package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
  89. package/dist/render/lib/document/blocks/general/HeroGroup/render.js +1 -1
  90. package/dist/render/lib/document/blocks/general/ImageBlock/render.js +1 -1
  91. package/dist/render/lib/document/blocks/general/IntroBleed/render.js +1 -1
  92. package/dist/render/lib/document/blocks/general/Split/render.js +1 -1
  93. package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
  94. package/dist/render/lib/document/blocks/general/section-to-box-rows-editorial.js +1 -1
  95. package/dist/render/lib/document/blocks/general/section-to-box-rows-head.js +1 -1
  96. package/dist/render/lib/document/part-styles.d.ts +13 -0
  97. package/dist/render/lib/document/part-styles.js +2 -2
  98. package/dist/render/lib/document/passes/borders.js +1 -1
  99. package/dist/render/lib/document/passes/corners.js +1 -1
  100. package/dist/render/lib/document/passes/index.js +1 -1
  101. package/dist/render/lib/document/passes/section-height.d.ts +5 -1
  102. package/dist/render/lib/document/passes/section-height.js +1 -1
  103. package/dist/render/lib/document/passes/section-width.js +1 -1
  104. package/dist/render/lib/sections/section-to-box.js +1 -1
  105. package/dist/render/lib/text-styles/site-text-styles.js +2 -2
  106. package/package.json +7 -6
@@ -3,7 +3,7 @@ import { boxFieldBuilders, type BoxFieldSay } from "efficient-easel/screen/lib/d
3
3
  import type { ShowWhenRule } from "efficient-shell/format";
4
4
  type Rows = ReturnType<typeof boxFieldBuilders>;
5
5
  export declare const rowSay: BoxFieldSay;
6
- export declare const LENGTH_UNITS_TABLE: Readonly<Record<"size" | "spacing" | "gap" | "letterSpacing" | "fontSize" | "border" | "height" | "position" | "radius" | "breakpoint", readonly ("%" | "px" | "vw")[]>>;
6
+ export declare const LENGTH_UNITS_TABLE: Readonly<Record<"size" | "spacing" | "gap" | "letterSpacing" | "fontSize" | "border" | "height" | "position" | "radius" | "breakpoint", readonly ("px" | "%" | "vw")[]>>;
7
7
  export declare const slider: Rows["slider"];
8
8
  export declare const select: Rows["select"];
9
9
  export declare const Segmented: Rows["Segmented"];
@@ -6,8 +6,9 @@ import { readHidable, hidableText, type HidableValue } from "efficient-easel/dra
6
6
  import { FOLD_FIELD_MARKER, LINK_FIELD_MARKER, MEDIA_FIELD_MARKER, SCAFFOLD_FIELD_MARKER, TEXT_FIELD_MARKER, foldMetaOf, textFieldIdentifier, type EdgeCell, type FoldFieldMeta, type TextFieldMeta, type TextListRendering } from "efficient-easel/draw";
7
7
  import { type ShowWhenRule } from "../../../render/lib/document/show-when.js";
8
8
  import { CARD_IMAGE_RADIUS_ROW } from "../../../format/lib/content/card-image-shape.js";
9
- import { type AlignmentPoint, FOCAL_DEFAULT, type UnitChoice as ShellUnitChoice } from "efficient-shell/ui";
9
+ import { FOCAL_DEFAULT, type UnitChoice as ShellUnitChoice } from "efficient-shell/ui";
10
10
  import { type ColourChoice } from "./ColourControl.js";
11
+ import { type DeviceTier } from "efficient-easel/screen/lib/document/device-fields";
11
12
  import type { GeocodeState } from "../../../format/lib/content/contact.js";
12
13
  import { SECTION_PIN_SCREENS_KEY } from "../../../format/lib/content/section-sticky.js";
13
14
  import { type SectionHeightMode, type SectionHeightUnit } from "../../../format/lib/content/section-min-height.js";
@@ -19,6 +20,9 @@ import { type TypeRole, type TypeSizeValue } from "../../../format/lib/content/s
19
20
  import { type WidthMode } from "../../../format/lib/content/section-width.js";
20
21
  import type { Bucket, DesignGroup } from "./field-groups.js";
21
22
  import { type SelectField, type SelectOption } from "efficient-easel/screen/lib/document/box-fields";
23
+ import { type LengthUnitState } from "efficient-easel/screen/lib/document/box-fields";
24
+ import { type LengthGrid, type LengthRow } from "efficient-easel/screen/lib/content/length-units";
25
+ import { type PanelView } from "../../../format/lib/content/view-tier.js";
22
26
  type SelectData = {
23
27
  options: readonly SelectOption[];
24
28
  fallback: string;
@@ -142,6 +146,16 @@ export declare function backgroundField(label: string, builtIn: SectionBackgroun
142
146
  export declare function sectionBandChoices(stored: SectionBackground, builtIn: SectionBackground, colors: ReturnType<typeof normalizeThemeColors>, n: number, band: SectionBandColours, onChange: (next: SectionBackground) => void): ColourChoice[];
143
147
  export declare function cardImageBackgroundField(label: string, builtIn: string): CustomField<unknown>;
144
148
  export declare function sectionThemeFields(readValue?: (v: unknown) => unknown, followLabel?: string): Record<string, CustomField<unknown>>;
149
+ export declare function useLengthRow(o: {
150
+ row: LengthRow;
151
+ label: string;
152
+ grid: LengthGrid;
153
+ valueKey: string;
154
+ view: PanelView;
155
+ numbersIn?: (tier: DeviceTier) => boolean;
156
+ convertTo?: (convert: (value: number) => number) => Record<string, unknown>;
157
+ followsView?: DeviceTier;
158
+ }): LengthUnitState | undefined;
145
159
  export declare function Slider({ min, max, step, value, onChange, suffix, readout, notch, ariaLabel, disabled, placeholder, placeholderWord, onClear, units, }: {
146
160
  min: number;
147
161
  max: number;
@@ -178,6 +192,7 @@ export declare function pxField(label: string, opts: {
178
192
  }): CustomField<number | null>;
179
193
  interface CornersRowTier {
180
194
  sidesKey: string;
195
+ row?: LengthRow;
181
196
  step?: number;
182
197
  useFollowed: () => number;
183
198
  mark: ReactElement<MarkProps>;
@@ -187,10 +202,10 @@ export declare function cornersRowField(tier: CornersRowTier): CustomField<numbe
187
202
  export declare function useSelectedSibling(key: string): [unknown, (next: unknown) => void];
188
203
  export declare function keptBy<T = unknown>(): CustomField<T>;
189
204
  export declare function useSelectedPatch(): (patch: FieldsPatch) => void;
205
+ export declare function cornersUnitFields(row: LengthRow, reachedBy: string): Record<string, CustomField<unknown>>;
190
206
  export declare function cornerSidesField(): CustomField<string[] | null>;
191
207
  export declare function sectionCornersField(): CustomField<number | null>;
192
208
  export declare function sectionShapeFields(): Record<string, unknown>;
193
- type PanelView = "desktop" | "tablet" | "phone";
194
209
  export declare function buttonWordsEntryField(partKey: string): CustomField<undefined>;
195
210
  export declare function cardCornersField(): CustomField<number | null>;
196
211
  export declare function cardShapeFields(): Record<string, unknown>;
@@ -217,7 +232,10 @@ export declare function boxPhoneRowField(): import("efficient-easel/screen/lib/d
217
232
  export declare function boxColumnsFields(): {
218
233
  phoneRow: import("efficient-easel/screen/lib/document/box-fields").BoxField<number>;
219
234
  };
220
- export declare function sizeField(label: string, min: number, max: number, step: number, fallback: number, role: TypeRole): CustomField<TypeSizeValue>;
235
+ export declare function sizeField(label: string, min: number, max: number, step: number, fallback: number, role: TypeRole, length?: {
236
+ row: LengthRow;
237
+ view: PanelView;
238
+ }): CustomField<TypeSizeValue>;
221
239
  export declare function cellWidthFields(): Record<string, unknown>;
222
240
  export declare function useSelectedProps(): Record<string, unknown>;
223
241
  export declare const RowPropsContext: import("react").Context<Record<string, unknown> | null>;
@@ -253,7 +271,9 @@ export declare function spacingFields(opts?: {
253
271
  export declare function swapPadding(fields: Record<string, unknown>, padding: Record<string, unknown>): Record<string, unknown>;
254
272
  export declare const WIDTH_LABEL = "Width";
255
273
  export declare function widthField(defaultMode: WidthMode, modes?: readonly WidthMode[], inheritable?: boolean): Record<string, CustomField<undefined> | CustomField<string> | CustomField<number>>;
256
- export declare function heightFields(): Record<string, CustomField<undefined> | CustomField<string> | CustomField<number>>;
274
+ export declare function heightFields({ fill }?: {
275
+ fill?: boolean;
276
+ }): Record<string, CustomField<undefined> | CustomField<string> | CustomField<number>>;
257
277
  export declare function heightFollowedBy(view: PanelView, props: Record<string, unknown>): {
258
278
  mode: SectionHeightMode;
259
279
  value: number;
@@ -289,17 +309,7 @@ export declare function ThemeFillRow({ label, icon, id, value, shown, onChange,
289
309
  export declare function boxFillField(): CustomField<string>;
290
310
  export declare function fillSlotChoices(value: string, colors: ReturnType<typeof normalizeThemeColors>, n: number, onChange: (next: string) => void): ColourChoice[];
291
311
  export declare function boxThemeIndexOf(data: unknown, id: string, own: unknown): number | null;
292
- export declare const FOCAL_POINTS: {
293
- value: string;
294
- label: string;
295
- }[];
296
312
  export { FOCAL_DEFAULT };
297
- export declare function FocalPicker({ label, value, onChange, points, }: {
298
- label: string;
299
- value: string;
300
- onChange: (next: string) => void;
301
- points?: readonly AlignmentPoint[];
302
- }): import("react").JSX.Element;
303
313
  export declare function focusKeptField(): CustomField<string>;
304
314
  export type { EdgeCell };
305
315
  export declare const EDGE_ARROWS: Record<EdgeCell, ReactNode>;
@@ -1 +1 @@
1
- "use client";import{jsx as i,jsxs as P,Fragment as k}from"react/jsx-runtime";import{cloneElement as pe,createContext as nn,useContext as $e,useEffect as on,useId as Xe,useRef as z,useState as q}from"react";import{useEasel as Q,useSelectedHost as B}from"efficient-easel/easel";import{PIN_LENGTH as ee,toDateKey as rn,fromDateKey as ln}from"efficient-shell/format";import{say as s,editorEaselWords as y}from"../../../format/lib/editor-words.js";import{finiteNumber as sn}from"../../../format/lib/finite-number.js";import{LOADING_SHOWS_LABELS as je,firstFrameHint as an,loadingShowsOf as cn,loadingStillHint as un}from"../../../format/lib/hero-video.js";import{pageFramesFor as dn,usePageVideoFrames as pn}from"../page-video-frames.js";import{ScreenDocumentContext as fn}from"efficient-easel/screen/components/ScreenDocumentContext";import{readHidable as Ve,hidableText as Ye}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as fe,LINK_FIELD_MARKER as ze,MEDIA_FIELD_MARKER as qe,SCAFFOLD_FIELD_MARKER as Je,TEXT_FIELD_MARKER as E,foldMetaOf as he,textFieldIdentifier as hn}from"efficient-easel/draw";import mn from"../../components/ApplyCornersToSiblings.js";import{withShowWhen as Ze}from"../../../render/lib/document/show-when.js";import{CARD_IMAGE_PX_ROW as gn,CARD_IMAGE_RADIUS_ROW as Qe,CARD_IMAGE_RADIUS_STEP as bn,CORNER_RADIUS_MAX as et,CORNER_RADIUS_MIN as L}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as Sn,IMAGE_CORNERS_LABEL as wn}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as xn}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as yn,GALLERY_LAYOUTS as te,GALLERY_LAYOUT_KEYS as Cn,galleryChoices as tt,galleryLayoutRatio as _n,galleryPictureCells as In}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as On}from"./shell-glyph.js";import{anchorSiblingsOf as Tn,placementPoints as En}from"../../../format/lib/hero-group-placement.js";import Rn from"../../components/AnchorField.js";import Nn from"../../components/SourceStatus.js";import{AdjustIcon as Pn,EyeIcon as kn,AnimationIcon as An,BackgroundIcon as nt,BorderAllIcon as Fn,BlockSectionIcon as Ln,ColumnWidthsIcon as me,ColumnsIcon as ot,CornerIcon as rt,DirectionDownIcon as Bn,DirectionLeftIcon as vn,DirectionRightIcon as Dn,DirectionUpIcon as Hn,EditIcon as Gn,GapIcon as Mn,GridIcon as Un,GroundIcon as ge,HashIcon as Wn,HeightIcon as it,ImageIcon as Kn,ListIcon as $n,LocationIcon as lt,PaddingBottomIcon as st,PaddingLeftIcon as at,PaddingRightIcon as ct,PaddingTopIcon as be,PageIcon as Xn,StickyIcon as ut,SearchIcon as jn,SquareIcon as Vn,TypeIcon as Yn,WidthIcon as zn}from"efficient-easel/icons";import{FieldGlyph as dt}from"../../components/FieldGlyph.js";import{resolvePageBackground as qn}from"../../../format/lib/content/page-background.js";import{boxFillOf as Jn,boxFillSlot as Se}from"../../../format/lib/content/box-background.js";import{CORNER_SIDES as pt,CORNER_SIDE_POINTS as Zn,hasOwnSectionCorners as Qn,normalizeCornerSides as ft}from"../../../format/lib/content/section-corners.js";import{enclosingPath as eo,enclosingSection as to}from"./enclosing-section.js";import{SettingsDefaultReset as C,SettingsDrill as no,SettingsField as x,SettingsGroup as oo,SettingsSegmented as ro,SettingsBorder as io,SettingsSidesEach as lo,SettingsSwitch as we,borderSides as so,borderStartEach as ao}from"efficient-easel/panel";import{ListField as co}from"efficient-easel/fields";import{DisplayChips as uo}from"efficient-shell/ui";import{desktopDisplayChanged as po,partShownOnDesktop as fo,partShownOnPhone as ho,phoneDisplayChanged as mo,withDesktopPart as go,withPhonePart as bo}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as So,ColorSwatch as wo,CornersInput as xo,DatePicker as yo,DateTimePicker as Co,FOCAL_DEFAULT as _o,IconPicker as ht,COLUMN_COUNT_MAX as mt,COLUMN_SHARE_MIN as Io,COLUMN_SHARES_EQUAL as Oo,resolveColumnShares as gt,WidthsBar as To,useShellStrings as Eo,IconButton as bt,InputNumber as St,Slider as Ro,Tooltip as xe}from"efficient-shell/ui";import{LOOKUP_BUSY_NOTE as No}from"./geocode-resolve.js";import{ColourRow as ne,InheritedColourRow as wt}from"./ColourControl.js";import{fillThemeColors as Po,slotFill as oe}from"../../../format/lib/document/theme-slots.js";import{fillSlotNamed as ye}from"../../../format/lib/document/part-inks.js";import{keptByRow as Ce}from"efficient-easel/screen/lib/document/style-fields";import xt from"./MarkupToolbar.js";import{deviceField as I}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as ko,NoControlMark as Ao,noControlField as yt}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as Fo}from"../../../format/lib/document/own-box.js";import{fieldPanelOnly as Lo,PANEL_ONLY_FIELD as Bo}from"../../../format/lib/document/panel-only.js";import{PHONE_CLEAR as vo,resolvePhoneValue as _e}from"../../../format/lib/document/phone-override.js";import{phoneKey as K,tabletKey as Ie}from"efficient-easel/draw";import{viewKey as O}from"../../../format/lib/animation/views.js";import{viewRows as v}from"../animation/view-rows.js";import{SuppressibleText as Do}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Ho,CARD_OUTLINE_OPTIONS as Go,DEFAULT_CARD_INDEX_FORMAT as Mo,DEFAULT_CARD_OUTLINE as Uo}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as Wo,DEFAULT_COVER_INDEX as Ko}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as $o}from"efficient-easel/draw";import Xo from"../../components/MediaUploadField.js";import jo from"../../components/MultiSelectField.js";import Vo from"../../components/SectionThemePicker.js";import Yo from"../../components/SearchSelectField.js";import zo from"../../components/StorefrontLinkField.js";import{UiIcon as Ct}from"efficient-easel/draw/client";import{SECTION_PADDING as R}from"../../../render/lib/content/section-padding.js";import{buttonWordsSummary as qo}from"../../../render/lib/content/button-look.js";import{usePreviewParts as Jo}from"efficient-easel/draw/client";import{encodePartId as Zo}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as Qo,useEaselStrings as er}from"efficient-easel/strings";import{hasPhoneHeight as tr,hasTabletHeight as Oe,resolveSectionMinHeight as nr,resolveTabletHeight as or}from"../../../format/lib/content/section-min-height.js";import{INTRO_OLD_STICKY_PINS as rr,SECTION_PIN_ABOVE_HINT as ir,SECTION_PIN_ABOVE_KEY as lr,SECTION_PIN_ABOVE_LABEL as sr,SECTION_PIN_GROUP as ar,SECTION_PIN_LABEL as _t,SECTION_PIN_SCREENS_KEY as Te,SECTION_PIN_SCREENS_LABEL as It,SECTION_PIN_STOP_DEFAULT as cr,SECTION_PIN_STOP_HINT as ur,SECTION_PIN_STOP_KEY as dr,SECTION_PIN_STOP_LABEL as pr,SECTION_PIN_STOP_OPTIONS as fr,SECTION_STICK_DISTANCE as re,SOME_VIEW_PINS as Ot,hasPhoneStick as hr,hasTabletStick as mr,resolveSectionStick as Ee,sectionPinStopOf as gr,sectionPinStopWrite as br}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as Sr,SECTION_MIN_HEIGHT_GROUP_LABEL as J,SECTION_SCREEN_PCT as wr}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as xr,resolveContainerDirection as Tt}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as yr,BOX_BLOCK_SPACING_POINTS as Et,BOX_PHONE_ROW_LABEL as Rt,BOX_COLUMNS_MAX as Cr,BOX_COLUMNS_MIN as Nt,BOX_PHONE_ROW_MAX as _r,BOX_PHONE_ROW_MIN as Re,BOX_SHARE_CHOICES as Pt,BOX_SHARE_LABEL as $,boxShareChoiceOf as kt,boxShareWidthsOf as Ne,BOX_SHARE_PHONE_DEFAULT as Ir,BOX_SHARE_PHONE_POINTS as Or}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as D}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as Tr,borderBySide as At}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as Er,normalizeTheme as Ft,normalizeThemeColors as Rr,sectionBandTone as Nr,surfaceTwoTone as Pr}from"../../../format/lib/theme.js";import{CONTAINER_GAP as Lt,CONTAINER_GAP_BUILT_IN as kr,CONTAINER_GAP_PHONE as Pe,GAP_FIELD_CONTAINER as ke,followsSitePhoneGap as Ar,hasOwnContainerGap as Fr,hasOwnPhoneGap as Ae,resolveContainerGap as Bt,resolvePhoneContainerGap as vt}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as Lr,CARD_IMAGE_BG_OFF as Br,CARD_IMAGE_BG_SWATCH_NAMES as vr,CARD_IMAGE_BG_SWATCHES as Dr,isCardImageBackgroundInheriting as Hr,cardImageBackgroundChoice as Gr,THEME_CARD_IMAGE_BG as Mr}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as Ur,SECTION_BG_NO_FILL as Wr,sectionBackgroundChoice as Kr,THEME_SECTION_BG as Fe,isSectionBackgroundEmpty as $r,sectionBackgroundHex as Dt}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as Xr,nestedAccentValue as Ht,resolveSectionAccent as ie}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as jr,TYPE_SIZE_INHERIT as Vr,isTypeSizeInheriting as Yr}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as zr,WIDTH_CHOICE_LABEL as qr,WIDTH_INHERIT as Jr}from"../../../format/lib/content/section-width.js";import{useEaselSession as Zr}from"efficient-easel/screen/lib/session-context";import{backendOf as Qr}from"../website-session.js";import{BOX_GAP as ei,describedAs as A,group as T,iconOf as X,sharedStyleKinds as Z}from"efficient-easel/screen/lib/document/box-fields";import{VIEW_KEY_ACCESS as Gt,onDesktopWords as H,phoneTwinFields as Le}from"efficient-easel/screen/lib/document/box-fields";import{directionField as ti,gapField as Be,iconPickerRow as ni,lengthUnitFields as oi,pickerCellIcon as ri,pickerNoneIcon as ii,Segmented as ve,select as j,slider as G}from"./box-fields.js";function ra({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?s(e):e})}function M(e,t){return s("{value} from {from}",{value:e,from:t})}function li(){const{blockGap:e}=D();return e===null?s("this container's own spacing"):M(`${e}px`,s("Styles"))}function si({inherited:e,onReset:t,label:n}){return i(C,{words:y()?.panel,label:s(n),changed:!e,detail:li(),onReset:t})}function ai(e){return Be({...ei,builtIn:kr[e],resolve:(t,n)=>Bt(e,t,n?.siteGap),action:(t,n)=>i(si,{inherited:!Fr(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[ke]:e}})}function ci(e){return Ze(I("mobile",{[ke]:e,type:"custom",render:t=>i(pi,{container:e,...t})}),Mt)}function ui(e){return Ze(I("tablet",{[ke]:e,type:"custom",render:t=>i(di,{container:e,...t})}),Mt)}const Mt={not:{field:"gap",in:Array.from({length:-Lt.min},(e,t)=>Lt.min+t)}};function ia(e){return{gap:I("desktop",ai(e)),[Ie("gap")]:ui(e),[K("gap")]:ci(e)}}function di({container:e,...t}){const[n]=F("gap"),{siteGap:o}=t.field??{},r=Math.max(Pe.min,Bt(e,n,o));return Be({...Pe,builtIn:r,resolve:a=>Ae(a)?a:r,action:(a,c)=>i(C,{words:y()?.panel,label:s("Gap"),changed:Ae(a),detail:H(u=>s(u),`${r}px`),onReset:()=>c(void 0)})}).render(t)}function pi({container:e,...t}){const[n]=F("gap"),{siteGap:o,siteGapPhone:r}=t.field??{},l=vt(e,void 0,n,o,r);return Be({...Pe,builtIn:l,resolve:c=>vt(e,c,n,o,r),action:(c,u)=>i(C,{words:y()?.panel,label:s("Gap"),changed:Ae(c),detail:M(`${l}px`,Ar(e,n,r)?s("Styles"):s("Desktop")),onReset:()=>u(void 0)})}).render(t)}function la(e){return ti({offered:xr(e),fallback:Tt(e,void 0),resolve:t=>Tt(e,t)})}function sa(e,t){return En(t?Tn(e,t):[],t)}function fi({inherited:e,onReset:t,label:n}){return i(C,{words:y()?.panel,label:s(n),changed:!e,detail:M(s("Full"),s("the page")),onReset:t})}function U({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:l,hideable:a=!0,markup:c=!0}){const{text:u,hidden:p}=Ve(e),h=z(null),f=z(null),d=_=>t(a?{text:_,hidden:p}:_),g=()=>t({text:u,hidden:!p}),m=a&&p,S=Xe(),w=r?Si(r)?i("span",{className:"sf-hint-while-typing",children:s(r)}):s(r):void 0,b=p?s("Show {label} on the slide",{label:s(n)}):s("Hide {label} on the slide",{label:s(n)});return i(x,{label:s(n),icon:i(Yn,{}),htmlFor:S,className:m?"is-hidden":void 0,hint:w,action:a?i(xe,{content:b,children:i(bt,{"aria-pressed":p,"aria-label":b,onClick:g,children:p?i(Ct,{name:"eye-off",size:14}):i(Ct,{name:"eye",size:14})})}):void 0,children:P("div",{className:"sf-copybox",children:[c&&i(xt,{target:l?f:h,value:u,onChange:d}),l?i("textarea",{id:S,ref:f,value:u,placeholder:o===void 0?void 0:s(o),onChange:_=>d(_.target.value)}):i("input",{id:S,ref:h,type:"text",value:u,placeholder:o===void 0?void 0:s(o),onChange:_=>d(_.target.value)})]})})}function aa(e,t){return{...e,[Je]:t}}function ca(e){const t=e[E];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[E]:{...t,offPage:!0}}}function ua(e){return!e||typeof e!="object"?!1:e[E]?.offPage===!0}function da(e){if(!e[E])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Bo]:!0}}function pa(e){return Lo(e)}function fa(e){const t=e[E];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[E]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as _c,SCALAR_TEXT_CONTROLS as Ic}from"efficient-easel/draw";function ha(e,t){if(!e[E])throw new Error("inOwnBox: the field holds no authored text");const{[ko]:o,...r}=e;return{...r,[Fo]:!0,render:t}}const hi=new Set($o),le={type:"radio",options:[{value:!0},{value:!1}]},Ut={text:{type:"object",objectFields:{text:{type:"text"},hidden:le}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:le}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},W=(e,t)=>{const n=A({...t,[E]:e},{...Ut[e.control],label:e.label});if(!hi.has(e.control))return n;const o=t.render;return{...yt(n,"authored-copy"),render:r=>i(Do,{name:r.name,children:o(r)})}},ma="Everything else on this block comes from the linked post. Unlink it to edit by hand.",mi={field:"source.slug",set:!0},ga={not:mi},gi="Select a word, then press the highlighter.",bi=new Set([gi]),Si=e=>bi.has(e);function ba(e,t,n){return W({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(U,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function Sa(e,t,n){return W({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(U,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function wa(e,t,n){return W({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(U,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function xa(e,t,n){return W({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(U,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function ya(e){return{type:"custom",[ze]:{label:e},...A({},{type:"text",label:e}),render:({value:t,onChange:n})=>i(zo,{value:Ye(t),onChange:n,label:e})}}function Ca(e,t,n){return W({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(U,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const _a={Design:Pn,Animation:An};function Ia(e){return{type:"custom",render:()=>i(wi,{text:e})}}function wi({text:e}){return i("p",{className:"sf-note",children:s(e)})}function Oa(e){return he(e)!==null&&e?.tabs!==void 0}const Wt=new Map;function Ta(e,t){const n=`${e}\0${t?t.join(""):""}`,o=Wt.get(n)??{type:"custom",tabs:t,[fe]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(k,{})};return Wt.set(n,o),o}const Kt=new Map;function Ea(e){const t=Kt.get(e)??{type:"custom",[fe]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(k,{})};return Kt.set(e,t),t}function xi(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function Ra(e,t){return xi(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(k,{})}}function Na(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 Pa({title:e,children:t}){const[n,o]=q(()=>!De.has(e));return i(oo,{title:e,open:n,onToggle:r=>{o(r),r?De.delete(e):De.add(e)},children:t})}const De=new Set;function yi({swatches:e,current:t,onPick:n,names:o}){const r=e.find(c=>c.toLowerCase()===t.toLowerCase()),l=r?o?.[r]:void 0,a=l?s(l):t;return P("div",{className:"sf-swatches",children:[e.map(c=>{const u=o?.[c]?s(o[c]):c;return i(xe,{content:u,children:i(wo,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":u})},c)}),i("span",{className:"sf-swatch-hex",children:a})]})}function ka(e,t,n=!1){return{type:"custom",render:({value:o,onChange:r})=>i(Ci,{label:e,builtIn:t,followsBand:n,value:o,onChange:r})}}function Ci({label:e,builtIn:t,followsBand:n,value:o,onChange:r}){const l=typeof o=="string"?o:void 0,{colors:a,n:c}=Ue(),u={background:a.background,surface:a.surface,surface2:Pr(a),band:Nr(a)},p=n?Fe:t,h=$r(l,t,p),f=Dt(void 0,p,u),d=n?Ur:void 0,g=p===Fe?s("the theme's section background"):s("Theme {n} background",{n:c}),m=_i(l,t,a,c,u,r),S=M(f.toUpperCase(),g),w=ye(l),b=w?oe(w,a,c):null;return b?i(ne,{label:s(e),icon:i(nt,{}),value:b.hex,caption:b.words,onChange:r,changed:!0,onReset:()=>r(d),resetTo:S,choices:m}):i(wt,{label:s(e),icon:i(nt,{}),value:h?"":Dt(l,t,u),inherited:f,resetTo:S,onChange:r,onReset:()=>r(d),choices:m})}function _i(e,t,n,o,r,l){const a=Kr(e,t);return[{label:s("No fill"),color:"",selected:a==="none",onPick:()=>l(Wr)},{label:`${s("Section band")} · ${r.band.toUpperCase()}`,color:r.band,selected:a==="band",onPick:()=>l(Fe)},...Me(ye(e)??"",n,o,l)]}function Ii(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,l=Hr(r,t);return i(x,{label:s(e),icon:i(ge,{}),changed:!l,action:i(C,{words:y()?.panel,label:s(e),changed:!l,detail:s("the theme's image stage"),onReset:()=>o(Lr)}),children:yi({swatches:Dr,current:l?Mr:Gr(r,t),onPick:o,names:vr})})}}}function Aa(e=n=>n,t){return Z({_gSectionTheme:T(Xr),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(Vo,{value:e(n),onChange:o,followLabel:t})}})}function V({min:e,max:t,step:n,value:o,onChange:r,suffix:l="",readout:a=!0,notch:c,ariaLabel:u,disabled:p=!1,placeholder:h,placeholderWord:f,onClear:d,units:g}){const m=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:m?"sf-slider has-notch":"sf-slider",style:m?{"--sf-notch":(c-e)/(t-e)}:void 0,children:i(Ro,{min:e,max:t,step:n,value:o,...o===null&&h!==void 0?{placeholderValue:h}:{},...f?{emptyLabel:s(f)}:{},suffix:l||void 0,...g?{units:g}:{},showInput:a,label:u===void 0?void 0:s(u),disabled:p,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:S=>{S===null?d?.():S!==o&&r(S)}})})}function Oi(e,t){const{min:n,max:o,step:r=1,unsetLabel:l,hint:a,restTrack:c,unsetMark:u,icon:p,unit:h="px"}=t;return{type:"custom",render:({value:f,onChange:d})=>{const g=typeof f=="number"?f:null,m=g===null;return i(x,{label:s(e),icon:p?X(p):void 0,value:m?u||l===void 0?void 0:s(l):`${g}${h}`,changed:!m,action:u?pe(u,{changed:!m,onReset:()=>d(null)}):i(C,{words:y()?.panel,label:s(e),changed:!m,onReset:()=>d(null)}),hint:typeof a=="string"?s(a):a,children:c?c({min:n,max:o,step:r,px:g,label:e,onChange:d}):V({min:n,max:o,step:r,value:g??n,readout:!1,ariaLabel:e,onChange:d})})}}}const se="Corners";function He(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,r=o!==null;return i(x,{label:s(se),icon:i(rt,{}),changed:r,action:pe(e.mark,{changed:r,onReset:()=>n(null)}),hint:e.hint,children:i(Ei,{tier:e,px:o,onRadius:n})})}}}function F(e){const t=B();return[t?.values?.[e],n=>t?.onChange(e,n)]}function $t(){return yt({type:"custom",render:()=>i(Ao,{})},"always")}function Ti(){const e=B();return t=>e?.onChangeMany(t)}function Ei({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),[r,l]=F(e.sidesKey),a=ft(r)??[...pt];return i(xo,{label:s(se),value:a,corners:Zn,onChange:c=>{const u=ft(c)??[];l(u.length===pt.length?null:u)},radius:t,onRadiusChange:n,radiusMin:L,radiusMax:et,radiusStep:e.step??1,radiusPlaceholder:String(o)})}function Xt(){return $t()}function Ri({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=D(),r=typeof o=="number"?`${o}px`:s("not set");return i(C,{words:y()?.panel,label:s(e),changed:t,detail:o==null?s("the built-in corners"):M(r,s("Styles")),onReset:n})}function Ni(){const{cornerRadiusPx:e}=D();return typeof e=="number"?e:L}function Pi(){return He({sidesKey:"sectionCornerSides",useFollowed:Ni,mark:i(Ri,{label:se}),hint:ki})}const ki="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function Fa(){return Z({_gShape:T("Shape"),sectionCorners:Pi(),sectionCornerSides:Xt(),...v("sectionBorder",Di)})}const Ai=()=>({width:s("Border width"),sides:{top:s("Border top"),right:s("Border right"),bottom:s("Border bottom"),left:s("Border left")},style:s("Border style"),styles:{solid:s("Solid"),dashed:s("Dashed"),dotted:s("Dotted")},color:s("Border color"),unit:"px"});function Fi(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function Li(){let e;try{const t=Ft(D().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||Er.line}function Bi({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:l=!0,above:a={}}){const c=e&&typeof e=="object"?e:{},[u,p]=q(()=>r?ao(c,a):!1),h=Ai(),f=d=>Fi(r&&l?d:{width:d.width,color:d.color,...l?{style:d.style}:{}});return i(x,{label:s("Border"),icon:i(Fn,{}),action:r?i(lo,{each:u,label:s("Each side"),onChange:p}):void 0,children:i(io,{label:s("Border"),value:c,each:u,onChange:d=>t(f(d)),placeholder:n,presets:o,words:h,styles:l,max:Tr})})}function vi({value:e,onChange:t,view:n}){const[o]=F("sectionBorder"),[r]=F(Ie("sectionBorder")),l=Li(),a=u=>u&&typeof u=="object"?u:{},c=n==="phone"?{...At(a(o)),...At(a(r))}:n==="tablet"?a(o):{};return i(Bi,{value:e,onChange:t,placeholder:{sides:so(c),style:c.style??"solid",color:c.color||l},presets:[l],above:c})}function Di(e){return{type:"custom",render:({value:t,onChange:n})=>i(vi,{value:t,onChange:n,view:e})}}function La(e){return{type:"custom",render:()=>i(Hi,{partKey:e})}}function Hi({partKey:e}){const[t]=F("id"),[n]=F("_partStyles"),{textStyles:o}=D(),r=er();let l=null;try{l=Jo().select}catch{l=null}const a=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i(no,{name:s("Text"),preview:qo(a,c,{noStyle:s("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??Qo.copy.panel).cases}),onOpen:()=>{l&&typeof t=="string"&&l(Zo(t,e))}})}function jt(e){const{cornerRadiusPx:t}=D(),n=typeof t=="number"?t:e;let o=null;try{const{appState:l,selectedItem:a}=Q(u=>u),c=a?.props?.id?String(a.props.id):void 0;o=c?to(l?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return Qn(r)?r:n}function Gi({label:e,changed:t=!1,onReset:n=()=>{}}){const o=jt(L);return i(C,{words:y()?.panel,label:s(e),changed:t,detail:M(`${o}px`,s("the section")),onReset:n})}function Mi(){return i(k,{children:s("Follows the section's Corners until you set a number here.")})}function Ui(){return He({sidesKey:"cardCornerSides",useFollowed:()=>jt(L),mark:i(Gi,{label:se}),hint:i(Mi,{})})}function Wi(){return{type:"custom",render:()=>i(mn,{})}}function Ba(){return{_gShape:T("Shape"),cardCorners:Ui(),cardCornerSides:Xt(),cardCornersApplyAll:Wi()}}function Ki(){return A({type:"custom",render:e=>i(Xi,{...e})},{type:"select",label:$,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 $i(e,t){const n=kt(e);if(n!=="custom")return s(Pt.find(r=>r.value===n)?.label??"");const o=gt(Ne(e,t),t);return o?[...o,100-o.reduce((r,l)=>r+l,0)].join(" / "):s("Custom")}function Xi(e){const{value:t,onChange:n}=e,[o]=F("content"),r=Array.isArray(o)?o.length:0,l="follows"in e,a=t!=null,c=a?t:l?e.follows:void 0,u=kt(c),p=r>=2&&r<=mt,h=()=>[...Oo[r]??[]],f=z(null),d=b=>{const _=f.current;_&&JSON.stringify(b)===JSON.stringify(_.shares)?n(_.value):b&&n(b)},g=b=>{b===u||b==="custom"&&!p||n(b==="custom"?h():b)},m=s("The width bar works for 2 to {count} blocks.",{count:mt}),S=a&&(l||t!=="content"),w=Eo().widths.hint(r,Io);return i(x,{label:s($),icon:i(me,{}),changed:S,hint:u!=="custom"?void 0:p?w:m,action:i(C,{words:y()?.panel,label:s($),changed:S,disabled:e.readOnly===!0,detail:l?H(b=>s(b),$i(e.follows,r),e.followsView):s("Fit content"),onReset:()=>n(void 0)}),children:P("div",{className:"sf-share-row",children:[i("div",{className:"sf-share-pick",children:i(ht,{label:s($),value:u,options:Pt.map(b=>({value:b.value,label:b.value==="custom"&&!p?m:s(b.label),icon:ri(i("span",{className:"sf-gallery-pic sf-share-pic",children:Vt(b.weights).map((_,Y)=>i("i",{style:{gridColumn:`span ${_}`}},Y))}),s(b.label),b.value==="custom"&&!p?m:s(b.label))})),onChange:g,columns:3,cell:Yt,tooltips:!1,disabled:e.readOnly===!0})}),u==="custom"&&p?i("div",{onFocus:()=>{f.current={value:t,shares:gt(Ne(c,r),r)}},onBlur:()=>{f.current=null},children:i(To,{label:s($),count:r,value:Ne(c,r),onChange:d,readOnly:e.readOnly===!0})}):null]})})}function Vt(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 va(){return j(yr,i(Mn,{}),Et,Et[0].value)}function Da(){return I("mobile",ni($,i(me,{}),Or.map(e=>({label:e.label,value:e.value,picture:i("span",{className:"sf-gallery-pic sf-share-pic",children:Vt(e.weights).map((t,n)=>i("i",{style:{gridColumn:`span ${t}`}},n))})})),Ir,{columns:2,cell:Yt}))}const Yt={width:"5.75rem",height:"3.25rem"};function Ha(){return Le("share",Ki(),Gt)[Ie("share")]}function ji(){return I("mobile",G(Rt,i(ot,{}),Re,_r,1,Re,"",{clear:{phoneFollows:!1,hint:Re}}))}const zt={read:e=>e.phoneRow,write:(e,t,n)=>({phoneRow:n}),fieldKey:()=>"phoneRow",ownField:!0};function Ga(){const e=G(Rt,i(ot,{}),Nt,Cr,1,Nt,"",{clear:{emptyLabel:"Auto"}}),t=Le("columns",e,{...zt,tablet:Gt.tablet}),n=Le("columns",e,zt,{phoneRow:ji()});return{...t,phoneRow:n.phoneRow}}function Ma(e,t,n,o,r,l){return{type:"custom",render:({value:a,onChange:c})=>i(x,{label:s(e),icon:i(dt,{noun:l}),action:i(C,{words:y()?.panel,label:s(e),changed:!Yr(a),detail:s("the Text style in Styles"),onReset:()=>c(Vr),defaultAction:{onPress:()=>c(jr),title:s("Keep this section's own built-in size"),icon:i(Ln,{})}}),children:V({min:t,max:n,step:o,value:typeof a=="number"?a:r,suffix:"px",ariaLabel:e,onChange:c})})}}function Ua(){return{_gCellWidth:T("Cell width"),gridSpan:j("Positions",i(me,{}),[{label:"Auto",value:""},...Array.from({length:xn},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function N(){let e=null,t=null;try{e=$e(Vi),t=Q(n=>n).selectedItem}catch{t=null}return e??t?.props??{}}const Vi=nn(null);function Yi({min:e,max:t,step:n,px:o,label:r,onChange:l,desktopKey:a,fallback:c}){const u=N()[a],p=_e(void 0,u,c);return i(k,{children:V({min:e,max:t,step:n,value:_e(o,u,c),readout:!1,ariaLabel:r,notch:p,onChange:l})})}function zi({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:l=()=>{}}){const a=N()[t],c=_e(void 0,a,n);return i(C,{words:y()?.panel,label:s(e),changed:r,detail:H(u=>s(u),`${c}${o}`),onReset:l})}function qi(e){return Oi(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:i(zi,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:t=>i(Yi,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const Ji={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Zi={Top:be,Bottom:st,Left:at,Right:ct},Qi=e=>{const t=Zi[e];return i(t,{})};function Wa(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=w=>Ji[w],l=w=>G(r("Top"),i(be,{}),R.min,R.max,R.step,w,"px"),a=(w,b,_,Y=R)=>I("mobile",qi({label:r(w),icon:Qi(w),desktopKey:b,min:Y.min,max:Y.max,step:Y.step,fallback:_})),c=e.top??R.min,u=e.bottom??R.min,p="sectionPaddingLeft",h="sectionPaddingRight",f=e.sideBounds??R,d=e.side??f.min,g=e.sidePhone??d,m=e.phone===!0,S=w=>m?I("desktop",w):w;return Z({...o?{_gSpacing:T("Padding")}:{},[t]:S(l(c)),...m?{[K(t)]:a("Top",t,c)}:{},...e.only==="top"?{}:{[n]:S(G(r("Bottom"),i(st,{}),R.min,R.max,R.step,u,"px")),...m?{[K(n)]:a("Bottom",n,u)}:{}},...e.sides?{[p]:S(G(r("Left"),i(at,{}),f.min,f.max,f.step,d,"px")),...m?{[K(p)]:a("Left",p,g,f)}:{},[h]:S(G(r("Right"),i(ct,{}),f.min,f.max,f.step,d,"px")),...m?{[K(h)]:a("Right",h,g,f)}:{}}:{}})}function Ka(e,t){const n=Object.fromEntries(Object.entries(t).map(([l,a])=>[l,l in e&&he(a)?e[l]:a])),o={};let r=!1;for(const[l,a]of Object.entries(e)){if(l in t){r||Object.assign(o,n),r=!0;continue}o[l]=a}return r||Object.assign(o,n),o}const ae="Width";function $a(e,t=zr,n=!0){const o=t.map(r=>({label:qr[r],value:r}));return Z({...n?{_gWidth:T(ae)}:{},widthMode:{type:"custom",render:({onChange:r,field:l})=>i(x,{label:s(ae),icon:i(zn,{}),action:n?i(fi,{inherited:l?.inherited??!1,onReset:()=>r(Jr),label:ae}):void 0,children:ve({options:o,value:l?.currentValue||e,onChange:r,ariaLabel:ae})})}})}function Xa(){const e=(o,r)=>({type:"custom",render:({value:l,onChange:a})=>i(el,{value:l,onChange:a,view:o,badge:r})}),t=()=>Ce("sectionHeightMode"),n=()=>Ce("sectionHeightMode");return Z({_gHeight:T(J),...v("sectionHeightMode",o=>o==="desktop"?e(o):e(o,r=>i(rl,{view:o,onClear:()=>r(void 0)}))),...v("sectionHeightValue",t),...v("sectionHeightUnit",n)})}function el({value:e,onChange:t,view:n,badge:o}){const r=N(),{mode:l,number:a,unit:c}=tl(n,r,e);return i(x,{label:J,icon:X(i(it,{})),action:o?o(t):void 0,children:P("div",{className:"es-width-stack",children:[ve({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:l,onChange:t,ariaLabel:J}),a?i(ol,{view:n,mode:l,menu:c}):null]})})}function qt(e,t){return e==="phone"&&Oe(t)?or(t):nr(t)}function ce(e,t){return e==="desktop"||(e==="tablet"?Oe(t):tr(t))?null:qt(e,t)}function tl(e,t,n){const r=(l=>["auto","fixed","screen"].includes(l))(n)?n:ce(e,t)?.mode??"auto";return{mode:r,number:r!=="auto",unit:r==="fixed"}}function nl(e,t,n,o){const r=ce(e,t);return!r||e==="desktop"?null:o===void 0?{}:{[O("sectionHeightMode",e)]:r.mode,...r.mode==="fixed"?{[O("sectionHeightUnit",e)]:r.unit}:{},...n==="sectionHeightUnit"?{[O("sectionHeightValue",e)]:r.value}:{},[O(n,e)]:o}}function Jt(e,t,n){const o=B(),r=ce(e,N());return!o||!r?{followed:null,write:n}:{followed:r,write:a=>o.onChangeMany(c=>{const u=nl(e,c,t,a);return u===null?{[O(t,e)]:a}:Object.keys(u).length?u:null})}}function ol({view:e,mode:t,menu:n}){const o=B(),r=N(),l=O("sectionHeightValue",e),a=O("sectionHeightUnit",e),c=w=>b=>o?.onChangeMany(()=>({[w]:b})),{followed:u,write:p}=Jt(e,"sectionHeightValue",c(l)),{write:h}=Jt(e,"sectionHeightUnit",c(a)),f=t==="screen"?"%":r[a],d=(u?u.unit:f)==="%"?"%":"px",g=d==="%"?wr:Sr,m=r[l],S=n?{options:["px","%"],label:s("Unit"),onChange:w=>h(w)}:void 0;return V({min:g.min,max:g.max,step:g.step,value:u?null:typeof m=="number"?m:g.fallback,...u?{placeholder:u.value}:{},suffix:d,...S?{units:S}:{},ariaLabel:J,onChange:p})}function rl({view:e,onClear:t}){const n=N(),o=ce(e,n)===null,r=e==="phone"&&Oe(n),l=qt(e,n),a=H(c=>s(c),l.mode==="auto"?s("Auto"):`${l.value}${l.unit}`,r?"tablet":"desktop");return i(C,{words:y()?.panel,label:s(J),changed:o,detail:a,onReset:t})}function ja(e={}){const t=e.intro===!0,n=l=>({type:"custom",render:({value:a,onChange:c,id:u,name:p})=>i(dl,{value:a,onChange:c,labelId:`${u??p??"stickTop"}-label`,view:l,intro:t})}),o=l=>({type:"custom",render:({value:a,onChange:c})=>i(al,{value:a,onChange:c,view:l,intro:t})}),r=l=>({type:"custom",render:({value:a,onChange:c})=>i(cl,{value:a,onChange:c,view:l,intro:t})});return{_gStick:T(ar,{dot:t?sl:Ot}),...v("stickTop",n),...v("stickTopDistance",o),...e.screens?v(Te,r):{},...t?{}:{[dr]:il()},...t||e.above===!1?{}:{[lr]:ll()}}}function il(){const e=j(pr,i(be,{}),fr,cr);return I("desktop",{...e,render:t=>{const n=e.render({...t,value:gr(t.value),onChange:o=>t.onChange(br(o))});return pe(n,{hint:s(ur)})}})}function ll(){const e=en(sr,!1,i(ut,{}),ir);return I("desktop",{...e,render:t=>e.render({...t,onChange:n=>t.onChange(n===!0?!0:void 0)})})}const sl={any:[Ot,rr]};function Zt(e,t,n,o){const r=B(),l=N(),a=e==="desktop"||ue(e,l)?null:Ge(e,Ee(l,{intro:o}));return{followed:a,write:a&&r?u=>r.onChangeMany(p=>{const h=ul(e,p,u,t,o);return h===null?{[O(t,e)]:u}:Object.keys(h).length?h:null}):n}}function al({value:e,onChange:t,view:n,intro:o}){const{followed:r,write:l}=Zt(n,"stickTopDistance",t,o);return i("div",{className:"sf-field",children:V({min:re.min,max:re.max,step:re.step,value:r?null:typeof e=="number"?e:re.fallback,...r?{placeholder:r.distance}:{},suffix:"px",ariaLabel:s("Distance from top"),onChange:l})})}function cl({value:e,onChange:t,view:n,intro:o}){const{followed:r,write:l}=Zt(n,Te,t,o);return i(x,{label:s(It),icon:X(i(it,{})),children:V({min:ee.min,max:ee.max,step:ee.step,value:r?null:sn(e)??ee.default,...r?{placeholder:r.screens}:{},ariaLabel:s(It),onChange:l})})}function ue(e,t){return e==="tablet"?mr(t):hr(t)}function Ge(e,t){return e==="phone"?{on:t.tablet,distance:t.tabletDistance,screens:t.tabletScreens}:{on:t.desktop,distance:t.desktopDistance,screens:t.desktopScreens}}function ul(e,t,n,o="stickTopDistance",r=!1){if(e==="desktop"||ue(e,t))return null;if(n===void 0)return{};const l=Ge(e,Ee(t,{intro:r})),a=e==="phone"&&ue("tablet",t)?u=>O(u,"tablet"):u=>u,c=(u,p)=>t[a(u)]==null?{}:{[O(u,e)]:p};return{[O("stickTop",e)]:!0,...c("stickTopDistance",l.distance),...c(Te,l.screens),[O(o,e)]:n}}function dl({value:e,onChange:t,labelId:n,view:o,intro:r}){const l=N(),a=Ee(l,{intro:r}),c=o==="phone"?a.phone:o==="tablet"?a.tablet:r?a.desktop:e===!0,u=o==="phone"&&a.ownTablet,p=o==="desktop"?null:Ge(o,a),h=p?.on?`${p.distance}px`:s("Off");return i(x,{label:s(_t),labelId:n,icon:X(i(ut,{})),action:P(k,{children:[o!=="desktop"?i(C,{words:y()?.panel,label:s(_t),changed:ue(o,l),detail:H(f=>s(f),h,u?"tablet":"desktop"),onReset:()=>t(void 0)}):null,i(we,{checked:c,onChange:t,ariaLabelledBy:n})]})})}const Qt="e.g. about";function Va(){return{_gAnchor:T("Anchor"),anchor:W({control:"plainText",label:"Name",placeholder:Qt},{type:"custom",render:({value:e,onChange:t})=>i(Rn,{value:e,onChange:t,nameBox:(n,o)=>i(U,{value:n,onChange:o,label:"Name",placeholder:Qt,hideable:!1,markup:!1})})})}}function Ya(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:l,name:a})=>{const c=`${l??a??e}-datetime`,u=Date.parse(typeof o=="string"?o:"");return i(x,{label:s(e),icon:t,htmlFor:c,hint:n===void 0?void 0:s(n),children:i(Co,{id:c,value:Number.isFinite(u)?new Date(u):null,onChange:p=>r(p?p.toISOString():"")})})}}}function za(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:l,name:a})=>{const c=`${l??a??e}-date`;return i(x,{label:s(e),icon:t,htmlFor:c,hint:n===void 0?void 0:s(n),children:i(yo,{id:c,value:ln(typeof o=="string"?o:null),onChange:u=>r(u?rn(u):"")})})}}}function en(e,t,n,o){return{type:"custom",...A({},{...le,label:e}),render:r=>{const{value:l,onChange:a,id:c,name:u}=r,p="follows"in r,h=r,f=typeof l=="boolean",d=typeof h.follows=="boolean"?h.follows:t,g=f?l:p?d:t,m=`${c??u??e}-label`,S=h.readOnly===!0,w=i(we,{checked:g,onChange:a,disabled:S,ariaLabelledBy:m});return i(x,{label:s(e),labelId:m,icon:n,hint:o===void 0?void 0:s(o),action:p?P(k,{children:[i(C,{words:y()?.panel,label:s(e),changed:f,detail:h.followsNoView?s(d?"On":"Off"):H(b=>s(b),s(d?"On":"Off"),h.followsView),disabled:S,onReset:()=>a(void 0)}),w]}):w})}}}function qa(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i(pl,{label:"Background",icon:i(Xn,{}),id:r,value:e,shown:qn(e),onChange:t})}}}function Ja(e,t,n){return{type:"custom",render:({value:o,onChange:r})=>i(ne,{label:s(e),icon:n,value:o||t,onChange:r})}}function pl({label:e,icon:t,id:n,value:o,shown:r,onChange:l}){const{colors:a,n:c}=Ue(),u=ye(o),p=u?oe(u,a,c):null;return i(ne,{label:s(e),icon:t,id:n,value:p?p.hex:r,caption:p?.words,onChange:l,choices:Me(u??"",a,c,l)})}function Za(){return{type:"custom",render:e=>{const{value:t,onChange:n}=e,o=e;return i(fl,{value:typeof t=="string"?t:"",onChange:n,twin:"follows"in e?{follows:o.follows,view:o.followsView}:void 0})}}}function Me(e,t,n,o){const r=Se(e);return Po(t,n).map(l=>({label:l.label,color:l.value,selected:r===l.name,onPick:()=>o(l.name)}))}function fl({value:e,onChange:t,twin:n}){const{colors:o,n:r}=Ue(),l=o.background,a=M(l.toUpperCase(),s("Theme {n} background",{n:r})),c=Se(e),u=c?oe(c,o,r):null,p=Me(e,o,r,t),h=n?()=>t(void 0):()=>t("");let f=l,d=a;if(n){const g=Se(n.follows),m=Jn(n.follows),S=g?oe(g,o,r):m?{hex:m,words:m.toUpperCase()}:null;f=S?.hex??l,d=H(w=>s(w),S?S.words:a,n.view)}return u?i(ne,{label:s("Fill"),icon:i(ge,{}),value:u.hex,caption:u.words,onChange:t,changed:!0,onReset:h,resetTo:d,choices:p}):i(wt,{label:s("Fill"),icon:i(ge,{}),value:e,inherited:f,resetTo:d,onChange:t,onReset:h,choices:p})}function hl(e,t,n){if((e?.content??[]).some(a=>a?.props?.id===t))return ie(n);const r=eo(e,t);if(r.length===0)return null;const l=ie(Ht(n));if(l!==null)return l;for(let a=r.length-1;a>0;a-=1){const c=ie(Ht(r[a].sectionAccent));if(c!==null)return c}return ie(r[0].sectionAccent)}function Ue(){const e=Ft(D().theme),[t]=F("sectionAccent");let n=null;try{const{appState:r,selectedItem:l}=Q(c=>c),a=l?.props?.id?String(l.props.id):void 0;n=a?hl(r?.data,a,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{colors:Rr(e.themes[o]),n:o+1}}const ml=[{value:"0% 0%",label:"Top left"},{value:"50% 0%",label:"Top"},{value:"100% 0%",label:"Top right"},{value:"0% 50%",label:"Left"},{value:"50% 50%",label:"Center"},{value:"100% 50%",label:"Right"},{value:"0% 100%",label:"Bottom left"},{value:"50% 100%",label:"Bottom"},{value:"100% 100%",label:"Bottom right"}];function gl({label:e,value:t,onChange:n,points:o=ml}){const r=o.map(l=>({...l,label:s(l.label),...l.title?{title:s(l.title)}:null}));return i(So,{label:s(e),value:t,points:r,onChange:n})}function Qa(){return $t()}const ec={top:i(Hn,{}),right:i(Dn,{}),bottom:i(Bn,{}),left:i(vn,{})};function tc(e,t,n,o,r,l,a){const c=f=>t.find(d=>d.value===f),u=f=>({value:f,label:"",disabled:!0,title:o}),p=f=>{const d=t.find(m=>m.cell===f);if(!d)return u(`missing-${f}`);const g=l?.[f];return g?{value:d.value,label:d.label,icon:g}:{value:d.value,label:d.label}},h=[u("corner-top-left"),p("top"),u("corner-top-right"),p("left"),u("centre"),p("right"),u("corner-bottom-left"),p("bottom"),u("corner-bottom-right")];return{type:"custom",render:({value:f,onChange:d})=>{const g=t.some(m=>m.value===f)?f:n;return i(x,{label:s(e),icon:r,value:c(g)?.label?s(c(g).label):a?s(a):"",children:gl({label:e,value:g,onChange:d,points:h})})}}}function nc(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:l})=>i(jo,{label:e,options:(l.options??t).map(a=>({...a,label:s(a.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:s(n)}:{}})}}function oc(e,t,n,o){return{type:"custom",options:t,fallback:n,...A({},{type:"select",label:e}),render:({value:r,onChange:l,field:a})=>i(Yo,{label:e,options:(a.options??t).map(c=>({...c,label:s(c.label)})),fallback:a.fallback??n,value:r,onChange:l,placeholder:o===void 0?void 0:s(o)})}}function rc(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}const ic=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function lc(e,t,n){const o=Object.keys(je).map(r=>({label:je[r],value:r,picture:n[r]}));return{type:"custom",...A({},{type:"radio",label:e,options:o.map(r=>({value:r.value,label:r.label}))}),render:({onChange:r})=>i(Sl,{label:e,icon:t,options:o,onChange:r})}}function bl(e,t,n){const o=an(e,t,n);if(o!==void 0)return o==="save-makes-frame"?s("A frame is made from this video when you save the page."):o==="starts-dark"?s("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"?s("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"?s("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"?s("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"?s("The slide shows your Image while the video loads, because this video has no frame."):void 0;const r=un(e);return r==="frame-missing-image"?s("This video has no frame yet. The slide shows its image until one is made."):r==="frame-missing-surface"?s("This video has no frame yet. The slide shows its background colour until one is made."):r==="image-missing-frame"?s("No image yet. The slide shows the video's frame until you choose one."):r==="image-missing-surface"?s("No image yet. The slide shows its background colour until you choose one."):void 0}function Sl({label:e,icon:t,options:n,onChange:o}){const r=B(),l=r?.values??{},a=cn(l),c=$e(fn),u=pn(c?.docId??null);let p=null;try{p=Q(f=>f.appState.data)}catch{p=null}const h=dn(r?.id,p,u);return i(x,{label:s(e),icon:X(t),hint:bl(l,h,c?.hasUnsavedEdits??!1),children:ve({options:n,value:a,onChange:o,ariaLabel:e})})}function sc(e,t,n,o={}){const r={type:"custom",[qe]:!0,render:({value:l,onChange:a,name:c})=>i(Xo,{value:l||"",onChange:a,fieldKey:c,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen,frameKey:o.frame}),...o.focus?{focusKey:o.focus}:{},...o.focusWhen?{focusWhen:o.focusWhen}:{}};return o.focus?I("each",r):r}const ac={HeroSingle:["imageFocal"],HeroSlide:["videoFrame"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function wl(e){const t=s(e.status??"");return e.ok&&typeof e.lat=="number"&&typeof e.lng=="number"?`${t} · ${e.lat.toFixed(4)}, ${e.lng.toFixed(4)}`:t}function cc({value:e,onChange:t,label:n}){const o=e||{},r=B(),l=r?r.values!==r.node.props:!0,a=!!o.pending&&l,c=!!o.pending&&!l,u=!!Qr(Zr()).geocode,p=Xe(),h=(f,d)=>t({...o,[f]:d??void 0});return P(k,{children:[i(x,{label:s(n),icon:i(lt,{}),action:u?i(xe,{content:s("Find from the address (OpenStreetMap)"),children:i(bt,{"aria-label":s("Find from the address"),"aria-busy":a||void 0,disabled:a,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:i(jn,{})})}):void 0,children:u&&o.status?i(Nn,{compact:!0,oneLine:!0,spaced:!1,status:a?"busy":o.ok&&!c?"found":"notfound",statusText:a?s("Finding…"):c?s(No):s(o.status),hint:wl(o)}):null}),i(x,{label:s("Enter by hand"),labelId:p,icon:i(Gn,{}),action:i(we,{checked:!!o.manual,onChange:f=>t({...o,manual:f}),ariaLabelledBy:p})}),o.manual&&i(x,{label:s("Latitude, longitude"),icon:i(lt,{}),children:P("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[i(St,{value:typeof o.lat=="number"?o.lat:null,onChange:f=>h("lat",f),min:-90,max:90,step:1e-4,placeholder:s("Latitude")}),i(St,{value:typeof o.lng=="number"?o.lng:null,onChange:f=>h("lng",f),min:-180,max:180,step:1e-4,placeholder:s("Longitude")})]})})]})}function xl(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function yl(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 uc(e,t){return e===null?null:t>e?e:null}function Cl(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 dc={label:"Ticker items",icon:i($n,{})};function pc(e,t,n,o){return{type:"custom",[E]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...A({},{...Ut.textList,label:e}),render:({value:r,onChange:l})=>i(_l,{label:e,icon:X(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 a=z(null),[c,u]=q(null),p=f=>f.map(d=>({text:d?.text??""})),h=f=>{const d=Cl(n,f,c);d===null&&(a.current=null),u(d),r(p(f))};return i(co,{label:s(e),icon:t,noun:s("item"),items:n,onChange:h,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:l?i(xt,{target:a,value:xl(n,c),onChange:f=>r(yl(n,c??-1,f)),disabled:c===null,label:c===null?s("Formatting — click a row first"):s("Formatting — row {n}",{n:c+1})}):void 0,renderRow:(f,d,g)=>i("input",{type:"text",className:l&&c===d?"sf-list-marking":void 0,value:f?.text??"",placeholder:s(o),"aria-label":s("{label} {n}",{label:s(e),n:d+1}),onChange:m=>g({text:m.target.value}),onFocus:m=>{a.current=m.currentTarget,u(d)}})})}function fc(e,t){const n=`${e.label} — row ${t+1}`;return W({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>i(U,{value:o,onChange:r,label:s("{label} — row {n}",{label:s(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function hc(e){return{_gCards:T("Cards"),coverIndex:j("Cover image",i(Kn,{}),Wo,String(Ko),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:Ii("Image background",Br),cardImage:tn()}}function mc(){return{outline:j("Card outline",i(Vn,{}),Go,Uo),indexBadge:j("Card number",i(Wn,{}),Ho,Mo),showBadge:en("Product badge",!0,i(dt,{noun:"tag"}))}}function gc(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...le,label:de.find(l=>l.id===r).label}),o=r=>A(Ce(We),n(r));return{_gShowOnCard:T("Show on a card"),[We]:A({type:"custom",render:()=>i(Il,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(We)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const We="showCardPrice",de=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function Il({rest:e}){const t=N(),n=Ti(),o=a=>typeof t[a]=="boolean"?t[a]:void 0,r=a=>o(a)??e[a],l=de.some(({id:a})=>o(a)!==void 0&&o(a)!==e[a]);return i(Ke,{parts:de,changed:l,shown:r,onPress:(a,c)=>n({[a]:c}),onReset:()=>n(Object.fromEntries(de.map(({id:a})=>[a,void 0])))})}function bc(e,t="display"){const n=K(t);return{[t]:I("desktop",{type:"custom",render:({value:o,onChange:r})=>i(Ke,{parts:e,changed:po(o),shown:l=>fo(o,l),onPress:(l,a)=>r(go(o,l,a)),onReset:()=>r(void 0)})}),[n]:I("mobile",{type:"custom",render:({value:o,onChange:r})=>i(Ol,{parts:e,desktopKey:t,value:o,onChange:r})})}}function Ke({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:l,disabledReason:a}){const c=s("Display");return i(x,{label:c,icon:i(kn,{}),changed:t,action:i(C,{words:y()?.panel,label:c,changed:t,detail:l,onReset:r}),children:i(uo,{label:c,items:e.map(u=>({id:u.id,label:s(u.label),shown:n(u.id),...a?{disabled:!0,disabledReason:s(a)}:{}})),onChange:o})})}function Ol({parts:e,desktopKey:t,value:n,onChange:o}){const r=N()[t];return i(Ke,{parts:e,changed:mo(n),shown:l=>ho(r,n,l),onPress:(l,a)=>o(bo(n,l,a)),onReset:()=>o(vo),detail:s("the same as Desktop")})}function tn(e=gn){return G("Card image",i(rt,{}),L,et,bn,L,e,{clear:{hint:L},hint:"Rounds the picture. The card's own corner is in Styles."})}function Tl(){return oi(Qe,"cardImage")}function Sc(){return{cardImage:tn(Qe),...Tl()}}function wc(){return He({sidesKey:"cornerSides",step:Sn,useFollowed:()=>L,mark:i(El,{label:wn}),hint:s("Rounds the picture. Left alone it stays square.")})}function El({label:e,changed:t=!1,onReset:n=()=>{}}){return i(C,{words:y()?.panel,label:s(e),changed:t,onReset:n})}function xc(){return{type:"custom",render:({value:e,onChange:t})=>i(kl,{value:typeof e=="string"?e:"",onChange:t})}}function Rl({layout:e,width:t}){const n=_n(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:In(e).map(([r,l],a)=>i("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${r}`,gridRow:`span ${l}`,aspectRatio:o}},a))})}const Nl={width:"3.5rem",height:"2.5rem"},Pl=200;function kl({value:e,onChange:t}){const[n,o]=q(null),[r,l]=q(4),a=z(null);on(()=>{const d=a.current;if(!d||typeof ResizeObserver!="function")return;const g=()=>l(d.getBoundingClientRect().width>=Pl?4:3);g();const m=new ResizeObserver(g);return m.observe(d),()=>m.disconnect()},[]);const c=e&&e in te?e:"",u=tt(n,c),p=tt(n,"").length,h=On("no-symbol"),f=[{value:"",label:s("Not chosen"),icon:ii(h,s("Not chosen"))},...u.map(d=>({value:d,label:s(te[d].label),icon:i(Rl,{layout:te[d],width:40})}))];return i(x,{label:s("Layout"),icon:i(Un,{}),value:c?s(te[c].label):void 0,children:i("div",{ref:a,style:{flex:"1 1 auto",minWidth:0},children:i(ht,{label:s("Layout"),value:c,options:f,onChange:t,columns:r,cell:Nl,header:P("div",{className:"mb-2 flex flex-col gap-1",style:{minWidth:"11rem"},children:[i("span",{className:"text-2xs text-ink-faint",children:s("Photos in a row")}),i(ro,{options:[{id:"all",label:s("All")},...yn.map(d=>({id:String(d),label:String(d)}))],value:n===null?"all":String(n),ariaLabel:s("Photos in a row"),onChange:d=>o(d==="all"?null:Number(d))}),i("span",{className:"text-2xs text-ink-faint",children:s("{n} of {total} layouts",{n:p,total:Cn.length})})]})})})})}export{mi as BOUND_TO_POST,ma as BOUND_TO_POST_NOTE,_a as BUCKET_ICONS,ac as CUSTOM_FIELD_MEDIA,cc as CoordsField,Mt as DESKTOP_GAP_NOT_OVERLAP,Ke as DisplayRow,ec as EDGE_ARROWS,_o as FOCAL_DEFAULT,ml as FOCAL_POINTS,fe as FOLD_FIELD_MARKER,gl as FocalPicker,gi as HIGHLIGHT_HINT,U as HidableTextField,ze as LINK_FIELD_MARKER,ra as Label,qe as MEDIA_FIELD_MARKER,ic as MEDIA_TYPE_OPTIONS,ga as NOT_BOUND_TO_POST,Pa as PanelBand,wi as PanelNoteLine,Vi as RowPropsContext,Je as SCAFFOLD_FIELD_MARKER,Ic as SCALAR_TEXT_CONTROLS,si as SiteGapDefaultReset,V as Slider,yi as Swatches,_c as TEXT_CONTROL_KINDS,E as TEXT_FIELD_MARKER,dc as TICKER_ITEMS_ROW,_l as TextListField,pl as ThemeFillRow,ae as WIDTH_LABEL,fi as WidthDefaultReset,Cl as aimAfterListChange,Va as anchorFields,M as backTo,ka as backgroundField,va as boxBlockSpacingField,Ga as boxColumnsFields,Za as boxFillField,ji as boxPhoneRowField,Ki as boxShareField,Da as boxSharePhoneField,Ha as boxShareTabletField,hl as boxThemeIndexOf,Ta as bucketHeader,La as buttonWordsEntryField,Ui as cardCornersField,Ii as cardImageBackgroundField,tn as cardImageField,Sc as cardImageFields,hc as cardMediaFields,Ba as cardShapeFields,gc as cardShowFields,mc as cardStyleFields,Ua as cellWidthFields,Ja as colorInput,la as containerDirectionField,ai as containerGapField,ci as containerGapPhoneField,ia as containerGapRows,ui as containerGapTabletField,wl as coordsResultTip,xa as copyText,Xt as cornerSidesField,He as cornersRowField,za as date,Ya as dateTime,Ea as designGroupHeader,bc as displayFields,tc as edgePad,Me as fillSlotChoices,uc as focusAfterRemove,Qa as focusKeptField,Ra as foldMarker,he as foldMetaOf,xi as foldTitleOf,nl as followedHeightPatch,ul as followedStickPatch,xc as galleryLayoutField,Xa as heightFields,ce as heightFollowedBy,tl as heightLayersAt,sa as heroGroupPlacementPoints,Ye as hidableText,Si as hintIsWhileTyping,wc as imageCornersField,ha as inOwnBox,Oa as isBucketHeader,$t as keptBy,ya as linkField,bl as loadingRowHint,lc as loadingShowsField,nc as multiSelect,qa as pageBackgroundField,Ia as panelNote,qi as phoneOverrideField,wa as plainText,Ca as plainTextarea,Oi as pxField,Na as quietMarker,Ve as readHidable,xl as rowText,oc as searchSelect,_i as sectionBandChoices,Pi as sectionCornersField,Fa as sectionShapeFields,Aa as sectionThemeFields,yl as setRowText,Ma as sizeField,rc as sourceField,Wa as spacingFields,ja as stickFields,Ka as swapPadding,ba as text,hn as textFieldIdentifier,ua as textFieldOffPage,pa as textFieldPanelOnly,pc as textList,fc as textListRowField,Sa as textarea,en as toggle,sc as upload,Ti as useSelectedPatch,N as useSelectedProps,F as useSelectedSibling,li as useSiteGapDetail,$a as widthField,fa as withIdentifier,ca as withOffPage,da as withPanelOnly,aa as withScaffold};
1
+ "use client";import{jsx as i,jsxs as k,Fragment as P}from"react/jsx-runtime";import{cloneElement as be,createContext as wn,useContext as Qe,useEffect as Sn,useId as et,useRef as J,useState as Z}from"react";import{useEasel as oe,useSelectedHost as v}from"efficient-easel/easel";import{PIN_LENGTH as re,toDateKey as _n,fromDateKey as Cn}from"efficient-shell/format";import{say as a,editorEaselWords as C}from"../../../format/lib/editor-words.js";import{finiteNumber as $}from"../../../format/lib/finite-number.js";import{LOADING_SHOWS_LABELS as tt,firstFrameHint as yn,loadingShowsOf as xn,loadingStillHint as In}from"../../../format/lib/hero-video.js";import{pageFramesFor as On,usePageVideoFrames as Tn}from"../page-video-frames.js";import{ScreenDocumentContext as En}from"efficient-easel/screen/components/ScreenDocumentContext";import{readHidable as nt,hidableText as ot}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as we,LINK_FIELD_MARKER as rt,MEDIA_FIELD_MARKER as it,SCAFFOLD_FIELD_MARKER as st,TEXT_FIELD_MARKER as R,foldMetaOf as Se,textFieldIdentifier as Rn}from"efficient-easel/draw";import Nn from"../../components/ApplyCornersToSiblings.js";import{withShowWhen as lt}from"../../../render/lib/document/show-when.js";import{CARD_IMAGE_PX_ROW as kn,CARD_IMAGE_RADIUS_ROW as at,CARD_IMAGE_RADIUS_STEP as Pn,CORNER_RADIUS_MAX as _e,CORNER_RADIUS_MIN as A}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as An,IMAGE_CORNERS_LABEL as Ln,IMAGE_CORNERS_ROW as Fn}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as vn}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as Bn,GALLERY_LAYOUTS as ie,GALLERY_LAYOUT_KEYS as Dn,galleryChoices as ct,galleryLayoutRatio as Hn,galleryPictureCells as Gn}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as Mn}from"./shell-glyph.js";import{anchorSiblingsOf as Wn,placementPoints as Un}from"../../../format/lib/hero-group-placement.js";import Kn from"../../components/AnchorField.js";import $n from"../../components/SourceStatus.js";import{AdjustIcon as Xn,EyeIcon as Vn,AnimationIcon as jn,BackgroundIcon as ut,BorderAllIcon as zn,BlockSectionIcon as Yn,ColumnWidthsIcon as Ce,ColumnsIcon as dt,CornerIcon as pt,DirectionDownIcon as qn,DirectionLeftIcon as Jn,DirectionRightIcon as Zn,DirectionUpIcon as Qn,EditIcon as eo,GapIcon as to,GridIcon as no,GroundIcon as ye,HashIcon as oo,HeightIcon as ft,ImageIcon as ro,ListIcon as io,LocationIcon as ht,PaddingBottomIcon as mt,PaddingLeftIcon as gt,PaddingRightIcon as bt,PaddingTopIcon as xe,PageIcon as so,StickyIcon as wt,SearchIcon as lo,SquareIcon as ao,TypeIcon as co,WidthIcon as uo}from"efficient-easel/icons";import{FieldGlyph as St}from"../../components/FieldGlyph.js";import{resolvePageBackground as po}from"../../../format/lib/content/page-background.js";import{boxFillOf as fo,boxFillSlot as Ie}from"../../../format/lib/content/box-background.js";import{CORNER_SIDES as _t,CORNER_SIDE_POINTS as ho,SECTION_CORNERS_ROW as Ct,hasOwnSectionCorners as mo,normalizeCornerSides as yt}from"../../../format/lib/content/section-corners.js";import{CARD_CORNERS_ROW as xt}from"../../../format/lib/content/card-corners.js";import{enclosingPath as go,enclosingSection as bo}from"./enclosing-section.js";import{SettingsDefaultReset as y,SettingsDrill as wo,SettingsField as _,SettingsGroup as So,SettingsSegmented as _o,SettingsBorder as Co,SettingsSidesEach as yo,SettingsSwitch as Oe,borderSides as xo,borderStartEach as Io}from"efficient-easel/panel";import{ListField as Oo}from"efficient-easel/fields";import{DisplayChips as To}from"efficient-shell/ui";import{desktopDisplayChanged as Eo,partShownOnDesktop as Ro,partShownOnPhone as No,phoneDisplayChanged as ko,withDesktopPart as Po,withPhonePart as Ao}from"../../../format/lib/content/part-display.js";import{ColorSwatch as Lo,CornersInput as Fo,DatePicker as vo,DateTimePicker as Bo,FOCAL_DEFAULT as Do,IconPicker as It,COLUMN_COUNT_MAX as Ot,COLUMN_SHARE_MIN as Ho,COLUMN_SHARES_EQUAL as Go,resolveColumnShares as Tt,WidthsBar as Mo,useShellStrings as Wo,IconButton as Et,InputNumber as Rt,Slider as Uo,Tooltip as Te}from"efficient-shell/ui";import{LOOKUP_BUSY_NOTE as Ko}from"./geocode-resolve.js";import{ColourRow as se,InheritedColourRow as Nt}from"./ColourControl.js";import{fillThemeColors as $o,slotFill as le}from"../../../format/lib/document/theme-slots.js";import{fillSlotNamed as Ee}from"../../../format/lib/document/part-inks.js";import{keptByRow as Re}from"efficient-easel/screen/lib/document/style-fields";import kt from"./MarkupToolbar.js";import{deviceField as T}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as Xo,NoControlMark as Vo,noControlField as Pt}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as jo}from"../../../format/lib/document/own-box.js";import{fieldPanelOnly as zo,PANEL_ONLY_FIELD as Yo}from"../../../format/lib/document/panel-only.js";import{PHONE_CLEAR as qo,resolvePhoneValue as Ne}from"../../../format/lib/document/phone-override.js";import{phoneKey as X,tabletKey as ke,viewKeyAt as Pe}from"efficient-easel/draw";import{viewKey as I}from"../../../format/lib/animation/views.js";import{viewRows as B}from"../animation/view-rows.js";import{SuppressibleText as Jo}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Zo,CARD_OUTLINE_OPTIONS as Qo,DEFAULT_CARD_INDEX_FORMAT as er,DEFAULT_CARD_OUTLINE as tr}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as nr,DEFAULT_COVER_INDEX as or}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as rr}from"efficient-easel/draw";import ir from"../../components/MediaUploadField.js";import sr from"../../components/MultiSelectField.js";import lr from"../../components/SectionThemePicker.js";import ar from"../../components/SearchSelectField.js";import cr from"../../components/StorefrontLinkField.js";import{UiIcon as At}from"efficient-easel/draw/client";import{SECTION_PADDING as N}from"../../../render/lib/content/section-padding.js";import{buttonWordsSummary as ur}from"../../../render/lib/content/button-look.js";import{usePreviewParts as dr}from"efficient-easel/draw/client";import{encodePartId as pr}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as fr,useEaselStrings as hr}from"efficient-easel/strings";import{hasPhoneHeight as mr,hasTabletHeight as Ae,resolveSectionMinHeight as gr,resolveTabletHeight as br}from"../../../format/lib/content/section-min-height.js";import{INTRO_OLD_STICKY_PINS as wr,SECTION_PIN_ABOVE_HINT as Sr,SECTION_PIN_ABOVE_KEY as _r,SECTION_PIN_ABOVE_LABEL as Cr,SECTION_PIN_GROUP as yr,SECTION_PIN_LABEL as Lt,SECTION_PIN_SCREENS_KEY as Le,SECTION_PIN_SCREENS_LABEL as Ft,SECTION_PIN_STOP_DEFAULT as xr,SECTION_PIN_STOP_HINT as Ir,SECTION_PIN_STOP_KEY as Or,SECTION_PIN_STOP_LABEL as Tr,SECTION_PIN_STOP_OPTIONS as Er,SECTION_STICK_DISTANCE as D,SECTION_STICK_DISTANCE_ROW as Fe,SOME_VIEW_PINS as vt,hasPhoneStick as Rr,hasTabletStick as Nr,resolveSectionStick as ae,sectionPinStopOf as kr,sectionPinStopWrite as Pr}from"../../../format/lib/content/section-sticky.js";import{cssLengthOf as Ar}from"../../../format/lib/content/css-length.js";import{SECTION_HEIGHT_MODES as Lr,SECTION_MIN_HEIGHT as Fr,SECTION_MIN_HEIGHT_GROUP_LABEL as Q,SECTION_SCREEN_PCT as vr}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as Br,resolveContainerDirection as Bt}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as Dr,BOX_BLOCK_SPACING_POINTS as Dt,BOX_PHONE_ROW_LABEL as Ht,BOX_COLUMNS_MAX as Hr,BOX_COLUMNS_MIN as Gt,BOX_PHONE_ROW_MAX as Gr,BOX_PHONE_ROW_MIN as ve,BOX_SHARE_CHOICES as Mt,BOX_SHARE_LABEL as V,boxShareChoiceOf as Wt,boxShareWidthsOf as Be,BOX_SHARE_PHONE_DEFAULT as Mr,BOX_SHARE_PHONE_POINTS as Wr}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as H}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as Ut,BORDER_SIDES as Ur,SECTION_BORDER_ROW as Kt,borderBySide as $t}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as Kr,normalizeTheme as Xt,normalizeThemeColors as $r,sectionBandTone as Xr,surfaceTwoTone as Vr}from"../../../format/lib/theme.js";import{CONTAINER_GAP as Vt,CONTAINER_GAP_BUILT_IN as jr,CONTAINER_GAP_PHONE as De,GAP_FIELD_CONTAINER as He,followsSitePhoneGap as zr,hasOwnContainerGap as Yr,hasOwnPhoneGap as Ge,resolveContainerGap as jt,resolvePhoneContainerGap as zt}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as qr,CARD_IMAGE_BG_OFF as Jr,CARD_IMAGE_BG_SWATCH_NAMES as Zr,CARD_IMAGE_BG_SWATCHES as Qr,isCardImageBackgroundInheriting as ei,cardImageBackgroundChoice as ti,THEME_CARD_IMAGE_BG as ni}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as oi,SECTION_BG_NO_FILL as ri,sectionBackgroundChoice as ii,THEME_SECTION_BG as Me,isSectionBackgroundEmpty as si,sectionBackgroundHex as Yt}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as li,nestedAccentValue as qt,resolveSectionAccent as ce}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as ai,TYPE_SIZE_INHERIT as ci,isTypeSizeInheriting as ui}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as di,WIDTH_CHOICE_LABEL as pi,WIDTH_INHERIT as fi}from"../../../format/lib/content/section-width.js";import{useEaselSession as hi}from"efficient-easel/screen/lib/session-context";import{backendOf as mi}from"../website-session.js";import{BOX_GAP as gi,describedAs as L,group as E,iconOf as j,sharedStyleKinds as ee}from"efficient-easel/screen/lib/document/box-fields";import{VIEW_KEY_ACCESS as Jt,onDesktopWords as G,phoneTwinFields as We,saidAlignmentGrid as bi,useLengthUnit as wi}from"efficient-easel/screen/lib/document/box-fields";import{LENGTH_UNITS_TABLE as Si,directionField as _i,gapField as Ue,iconPickerRow as Ci,lengthUnitFields as ue,pickerCellIcon as yi,pickerNoneIcon as xi,Segmented as Ke,select as z,slider as M}from"./box-fields.js";import{VIEW_ABOVE as $e}from"efficient-easel/screen/lib/content/length-units";import{tierOfView as Zt,viewOfTier as Ii}from"../../../format/lib/content/view-tier.js";function Ra({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?a(e):e})}function W(e,t){return a("{value} from {from}",{value:e,from:t})}function Oi(){const{blockGap:e}=H();return e===null?a("this container's own spacing"):W(`${e}px`,a("Styles"))}function Ti({inherited:e,onReset:t,label:n}){return i(y,{words:C()?.panel,label:a(n),changed:!e,detail:Oi(),onReset:t})}function Ei(e){return Ue({...gi,builtIn:jr[e],resolve:(t,n)=>jt(e,t,n?.siteGap),action:(t,n)=>i(Ti,{inherited:!Yr(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[He]:e}})}function Ri(e){return lt(T("mobile",{[He]:e,type:"custom",render:t=>i(Pi,{container:e,...t})}),Qt)}function Ni(e){return lt(T("tablet",{[He]:e,type:"custom",render:t=>i(ki,{container:e,...t})}),Qt)}const Qt={not:{field:"gap",in:Array.from({length:-Vt.min},(e,t)=>Vt.min+t)}};function Na(e){return{gap:T("desktop",Ei(e)),[ke("gap")]:Ni(e),[X("gap")]:Ri(e)}}function ki({container:e,...t}){const[n]=F("gap"),{siteGap:o}=t.field??{},r=Math.max(De.min,jt(e,n,o));return Ue({...De,builtIn:r,resolve:l=>Ge(l)?l:r,action:(l,c)=>i(y,{words:C()?.panel,label:a("Gap"),changed:Ge(l),detail:G(u=>a(u),`${r}px`),onReset:()=>c(void 0)})}).render(t)}function Pi({container:e,...t}){const[n]=F("gap"),{siteGap:o,siteGapPhone:r}=t.field??{},s=zt(e,void 0,n,o,r);return Ue({...De,builtIn:s,resolve:c=>zt(e,c,n,o,r),action:(c,u)=>i(y,{words:C()?.panel,label:a("Gap"),changed:Ge(c),detail:W(`${s}px`,zr(e,n,r)?a("Styles"):a("Desktop")),onReset:()=>u(void 0)})}).render(t)}function ka(e){return _i({offered:Br(e),fallback:Bt(e,void 0),resolve:t=>Bt(e,t)})}function Pa(e,t){return Un(t?Wn(e,t):[],t)}function Ai({inherited:e,onReset:t,label:n}){return i(y,{words:C()?.panel,label:a(n),changed:!e,detail:W(a("Full"),a("the page")),onReset:t})}function U({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:s,hideable:l=!0,markup:c=!0}){const{text:u,hidden:p}=nt(e),h=J(null),d=J(null),f=x=>t(l?{text:x,hidden:p}:x),m=()=>t({text:u,hidden:!p}),g=l&&p,b=et(),S=r?Di(r)?i("span",{className:"sf-hint-while-typing",children:a(r)}):a(r):void 0,w=p?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(co,{}),htmlFor:b,className:g?"is-hidden":void 0,hint:S,action:l?i(Te,{content:w,children:i(Et,{"aria-pressed":p,"aria-label":w,onClick:m,children:p?i(At,{name:"eye-off",size:14}):i(At,{name:"eye",size:14})})}):void 0,children:k("div",{className:"sf-copybox",children:[c&&i(kt,{target:s?d:h,value:u,onChange:f}),s?i("textarea",{id:b,ref:d,value:u,placeholder:o===void 0?void 0:a(o),onChange:x=>f(x.target.value)}):i("input",{id:b,ref:h,type:"text",value:u,placeholder:o===void 0?void 0:a(o),onChange:x=>f(x.target.value)})]})})}function Aa(e,t){return{...e,[st]:t}}function La(e){const t=e[R];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[R]:{...t,offPage:!0}}}function Fa(e){return!e||typeof e!="object"?!1:e[R]?.offPage===!0}function va(e){if(!e[R])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Yo]:!0}}function Ba(e){return zo(e)}function Da(e){const t=e[R];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[R]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as jc,SCALAR_TEXT_CONTROLS as zc}from"efficient-easel/draw";function Ha(e,t){if(!e[R])throw new Error("inOwnBox: the field holds no authored text");const{[Xo]:o,...r}=e;return{...r,[jo]:!0,render:t}}const Li=new Set(rr),de={type:"radio",options:[{value:!0},{value:!1}]},en={text:{type:"object",objectFields:{text:{type:"text"},hidden:de}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:de}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},K=(e,t)=>{const n=L({...t,[R]:e},{...en[e.control],label:e.label});if(!Li.has(e.control))return n;const o=t.render;return{...Pt(n,"authored-copy"),render:r=>i(Jo,{name:r.name,children:o(r)})}},Ga="Everything else on this block comes from the linked post. Unlink it to edit by hand.",Fi={field:"source.slug",set:!0},Ma={not:Fi},vi="Select a word, then press the highlighter.",Bi=new Set([vi]),Di=e=>Bi.has(e);function Wa(e,t,n){return K({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(U,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function Ua(e,t,n){return K({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(U,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function Ka(e,t,n){return K({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(U,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function $a(e,t,n){return K({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(U,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function Xa(e){return{type:"custom",[rt]:{label:e},...L({},{type:"text",label:e}),render:({value:t,onChange:n})=>i(cr,{value:ot(t),onChange:n,label:e})}}function Va(e,t,n){return K({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(U,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const ja={Design:Xn,Animation:jn};function za(e){return{type:"custom",render:()=>i(Hi,{text:e})}}function Hi({text:e}){return i("p",{className:"sf-note",children:a(e)})}function Ya(e){return Se(e)!==null&&e?.tabs!==void 0}const tn=new Map;function qa(e,t){const n=`${e}\0${t?t.join(""):""}`,o=tn.get(n)??{type:"custom",tabs:t,[we]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(P,{})};return tn.set(n,o),o}const nn=new Map;function Ja(e){const t=nn.get(e)??{type:"custom",[we]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(P,{})};return nn.set(e,t),t}function Gi(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function Za(e,t){return Gi(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(P,{})}}function Qa(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(P,{})}}function ec({title:e,children:t}){const[n,o]=Z(()=>!Xe.has(e));return i(So,{title:e,open:n,onToggle:r=>{o(r),r?Xe.delete(e):Xe.add(e)},children:t})}const Xe=new Set;function Mi({swatches:e,current:t,onPick:n,names:o}){const r=e.find(c=>c.toLowerCase()===t.toLowerCase()),s=r?o?.[r]:void 0,l=s?a(s):t;return k("div",{className:"sf-swatches",children:[e.map(c=>{const u=o?.[c]?a(o[c]):c;return i(Te,{content:u,children:i(Lo,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":u})},c)}),i("span",{className:"sf-swatch-hex",children:l})]})}function tc(e,t,n=!1){return{type:"custom",render:({value:o,onChange:r})=>i(Wi,{label:e,builtIn:t,followsBand:n,value:o,onChange:r})}}function Wi({label:e,builtIn:t,followsBand:n,value:o,onChange:r}){const s=typeof o=="string"?o:void 0,{colors:l,n:c}=qe(),u={background:l.background,surface:l.surface,surface2:Vr(l),band:Xr(l)},p=n?Me:t,h=si(s,t,p),d=Yt(void 0,p,u),f=n?oi:void 0,m=p===Me?a("the theme's section background"):a("Theme {n} background",{n:c}),g=Ui(s,t,l,c,u,r),b=W(d.toUpperCase(),m),S=Ee(s),w=S?le(S,l,c):null;return w?i(se,{label:a(e),icon:i(ut,{}),value:w.hex,caption:w.words,onChange:r,changed:!0,onReset:()=>r(f),resetTo:b,choices:g}):i(Nt,{label:a(e),icon:i(ut,{}),value:h?"":Yt(s,t,u),inherited:d,resetTo:b,onChange:r,onReset:()=>r(f),choices:g})}function Ui(e,t,n,o,r,s){const l=ii(e,t);return[{label:a("No fill"),color:"",selected:l==="none",onPick:()=>s(ri)},{label:`${a("Section band")} · ${r.band.toUpperCase()}`,color:r.band,selected:l==="band",onPick:()=>s(Me)},...Ye(Ee(e)??"",n,o,s)]}function Ki(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,s=ei(r,t);return i(_,{label:a(e),icon:i(ye,{}),changed:!s,action:i(y,{words:C()?.panel,label:a(e),changed:!s,detail:a("the theme's image stage"),onReset:()=>o(qr)}),children:Mi({swatches:Qr,current:s?ni:ti(r,t),onPick:o,names:Zr})})}}}function nc(e=n=>n,t){return ee({_gSectionTheme:E(li),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(lr,{value:e(n),onChange:o,followLabel:t})}})}function pe(e){const t=O(),n=Zt(e?.view),o=l=>Pe(e.valueKey,l),r=e.numbersIn??(l=>$(t[o(l)])!==void 0),s=e.followsView??rs(n,r);return wi({props:{value:void 0,onChange:()=>{},field:{}},row:e.valueKey?e.row:void 0,table:Si,label:a(e.label),grid:e.grid,hasOwn:r(n),view:{tier:n,numbersIn:r,followsView:s},convertTo:e.convertTo??(l=>{const c=$(t[o(n)]);return c===void 0?{}:{[o(n)]:l(c)}})})}function Y({min:e,max:t,step:n,value:o,onChange:r,suffix:s="",readout:l=!0,notch:c,ariaLabel:u,disabled:p=!1,placeholder:h,placeholderWord:d,onClear:f,units:m}){const g=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:g?"sf-slider has-notch":"sf-slider",style:g?{"--sf-notch":(c-e)/(t-e)}:void 0,children:i(Uo,{min:e,max:t,step:n,value:o,...o===null&&h!==void 0?{placeholderValue:h}:{},...d?{emptyLabel:a(d)}:{},suffix:s||void 0,...m?{units:m}:{},showInput:l,label:u===void 0?void 0:a(u),disabled:p,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:b=>{b===null?f?.():b!==o&&r(b)}})})}function $i(e,t){const{min:n,max:o,step:r=1,unsetLabel:s,hint:l,restTrack:c,unsetMark:u,icon:p,unit:h="px"}=t;return{type:"custom",render:({value:d,onChange:f})=>{const m=typeof d=="number"?d:null,g=m===null;return i(_,{label:a(e),icon:p?j(p):void 0,value:g?u||s===void 0?void 0:a(s):`${m}${h}`,changed:!g,action:u?be(u,{changed:!g,onReset:()=>f(null)}):i(y,{words:C()?.panel,label:a(e),changed:!g,onReset:()=>f(null)}),hint:typeof l=="string"?a(l):l,children:c?c({min:n,max:o,step:r,px:m,label:e,onChange:f}):Y({min:n,max:o,step:r,value:m??n,readout:!1,ariaLabel:e,onChange:f})})}}}const te="Corners",Xi={kind:"radius"};function Ve(e){return{type:"custom",render:t=>{const{value:n,onChange:o}=t,r=typeof n=="number"&&Number.isFinite(n)?n:null,s=r!==null;return i(_,{label:a(te),icon:i(pt,{}),changed:s,action:be(e.mark,{changed:s,onReset:()=>o(null)}),hint:e.hint,children:i(Vi,{tier:e,px:r,name:t.name,onRadius:o})})}}}function F(e){const t=v();return[t?.values?.[e],n=>t?.onChange(e,n)]}function on(){return Pt({type:"custom",render:()=>i(Vo,{})},"always")}function fe(){const e=v();return t=>e?.onChangeMany(t)}function Vi({tier:e,px:t,name:n,onRadius:o}){const r=e.useFollowed(),[s,l]=F(e.sidesKey),c=fe(),u=pe({row:e.row??Xi,label:te,grid:{min:A,max:_e,step:e.step??1},valueKey:n??"",view:"desktop"}),p=yt(s)??[..._t];return i(Fo,{label:a(te),value:p,corners:ho,onChange:h=>{const d=yt(h)??[];l(d.length===_t.length?null:d)},radius:t,onRadiusChange:u&&n?h=>c({[n]:h,...u.unitPatch(h===null)}):o,radiusMin:u?.grid.min??A,radiusMax:u?.grid.max??_e,radiusStep:u?.grid.step??e.step??1,radiusPlaceholder:u&&u.unit!=="px"?"–":String(r),...u?{radiusUnit:u.unit,units:u.units}:{}})}function rn(e,t){return ue(e,t)}function sn(){return on()}function ji({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=H(),r=typeof o=="number"?`${o}px`:a("not set");return i(y,{words:C()?.panel,label:a(e),changed:t,detail:o==null?a("the built-in corners"):W(r,a("Styles")),onReset:n})}function zi(){const{cornerRadiusPx:e}=H();return typeof e=="number"?e:A}function Yi(){return Ve({sidesKey:"sectionCornerSides",row:Ct,useFollowed:zi,mark:i(ji,{label:te}),hint:qi})}const qi="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function oc(){return ee({_gShape:E("Shape"),sectionCorners:Yi(),...rn(Ct,"sectionCorners"),sectionCornerSides:sn(),...B("sectionBorder",os),...ue(Kt,"sectionBorder",{tablet:!0,phone:!0})})}const Ji=()=>({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 Zi(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function Qi(){let e;try{const t=Xt(H().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||Kr.line}function es({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:s=!0,above:l={},length:c}){const u=e&&typeof e=="object"?e:{},[p,h]=Z(()=>r?Io(u,l):!1),d=Ji(),f=m=>Zi(r&&s?m:{width:m.width,color:m.color,...s?{style:m.style}:{}});return i(_,{label:a("Border"),icon:i(zn,{}),action:r?i(yo,{each:p,label:a("Each side"),onChange:h}):void 0,children:i(Co,{label:a("Border"),value:u,each:p,onChange:m=>t(f(m)),placeholder:n,presets:o,words:c?{...d,unit:c.unit}:d,styles:s,max:c?.grid.max??Ut,...c?{step:c.grid.step,units:c.units}:{}})})}function ts({value:e,onChange:t,view:n}){const[o]=F("sectionBorder"),[r]=F(ke("sectionBorder")),s=Qi(),l=f=>f&&typeof f=="object"?f:{},c=n==="phone"?{...$t(l(o)),...$t(l(r))}:n==="tablet"?l(o):{},u=O(),p=fe(),h=I("sectionBorder",n),d=pe({row:Kt,label:"Border",grid:{min:0,max:Ut,step:1},valueKey:"sectionBorder",view:n,numbersIn:f=>je(u[Pe("sectionBorder",f)]),convertTo:f=>{const m=l(u[h]);return je(m)?{[h]:ns(m,f)}:{}}});return i(es,{value:e,length:d,onChange:d?f=>p({[h]:f,...d.unitPatch(!je(f))}):t,placeholder:{sides:xo(c),style:c.style??"solid",color:c.color||s},presets:[s],above:c})}const ln=["width",...Ur];function je(e){if(!e||typeof e!="object")return!1;const t=e;return ln.some(n=>$(t[n])!==void 0)}function ns(e,t){const n={...e};for(const o of ln){const r=$(n[o]);r!==void 0&&(n[o]=t(r))}return n}function os(e){return{type:"custom",render:({value:t,onChange:n})=>i(ts,{value:t,onChange:n,view:e})}}function rs(e,t){let n=$e[e];for(;n&&$e[n]!==null&&!t(n);)n=$e[n];return n??e}function rc(e){return{type:"custom",render:()=>i(is,{partKey:e})}}function is({partKey:e}){const[t]=F("id"),[n]=F("_partStyles"),{textStyles:o}=H(),r=hr();let s=null;try{s=dr().select}catch{s=null}const l=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i(wo,{name:a("Text"),preview:ur(l,c,{noStyle:a("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??fr.copy.panel).cases}),onOpen:()=>{s&&typeof t=="string"&&s(pr(t,e))}})}function an(e){const{cornerRadiusPx:t}=H(),n=typeof t=="number"?t:e;let o=null;try{const{appState:s,selectedItem:l}=oe(u=>u),c=l?.props?.id?String(l.props.id):void 0;o=c?bo(s?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return mo(r)?r:n}function ss({label:e,changed:t=!1,onReset:n=()=>{}}){const o=an(A);return i(y,{words:C()?.panel,label:a(e),changed:t,detail:W(`${o}px`,a("the section")),onReset:n})}function ls(){return i(P,{children:a("Follows the section's Corners until you set a number here.")})}function as(){return Ve({sidesKey:"cardCornerSides",row:xt,useFollowed:()=>an(A),mark:i(ss,{label:te}),hint:i(ls,{})})}function cs(){return{type:"custom",render:()=>i(Nn,{})}}function ic(){return{_gShape:E("Shape"),cardCorners:as(),...rn(xt,"cardCorners"),cardCornerSides:sn(),cardCornersApplyAll:cs()}}function us(){return L({type:"custom",render:e=>i(ps,{...e})},{type:"select",label:V,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 ds(e,t){const n=Wt(e);if(n!=="custom")return a(Mt.find(r=>r.value===n)?.label??"");const o=Tt(Be(e,t),t);return o?[...o,100-o.reduce((r,s)=>r+s,0)].join(" / "):a("Custom")}function ps(e){const{value:t,onChange:n}=e,[o]=F("content"),r=Array.isArray(o)?o.length:0,s="follows"in e,l=t!=null,c=l?t:s?e.follows:void 0,u=Wt(c),p=r>=2&&r<=Ot,h=()=>[...Go[r]??[]],d=J(null),f=w=>{const x=d.current;x&&JSON.stringify(w)===JSON.stringify(x.shares)?n(x.value):w&&n(w)},m=w=>{w===u||w==="custom"&&!p||n(w==="custom"?h():w)},g=a("The width bar works for 2 to {count} blocks.",{count:Ot}),b=l&&(s||t!=="content"),S=Wo().widths.hint(r,Ho);return i(_,{label:a(V),icon:i(Ce,{}),changed:b,hint:u!=="custom"?void 0:p?S:g,action:i(y,{words:C()?.panel,label:a(V),changed:b,disabled:e.readOnly===!0,detail:s?G(w=>a(w),ds(e.follows,r),e.followsView):a("Fit content"),onReset:()=>n(void 0)}),children:k("div",{className:"sf-share-row",children:[i("div",{className:"sf-share-pick",children:i(It,{label:a(V),value:u,options:Mt.map(w=>({value:w.value,label:w.value==="custom"&&!p?g:a(w.label),icon:yi(i("span",{className:"sf-gallery-pic sf-share-pic",children:cn(w.weights).map((x,q)=>i("i",{style:{gridColumn:`span ${x}`}},q))}),a(w.label),w.value==="custom"&&!p?g:a(w.label))})),onChange:m,columns:3,cell:un,tooltips:!1,disabled:e.readOnly===!0})}),u==="custom"&&p?i("div",{onFocus:()=>{d.current={value:t,shares:Tt(Be(c,r),r)}},onBlur:()=>{d.current=null},children:i(Mo,{label:a(V),count:r,value:Be(c,r),onChange:f,readOnly:e.readOnly===!0})}):null]})})}function cn(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 sc(){return z(Dr,i(to,{}),Dt,Dt[0].value)}function lc(){return T("mobile",Ci(V,i(Ce,{}),Wr.map(e=>({label:e.label,value:e.value,picture:i("span",{className:"sf-gallery-pic sf-share-pic",children:cn(e.weights).map((t,n)=>i("i",{style:{gridColumn:`span ${t}`}},n))})})),Mr,{columns:2,cell:un}))}const un={width:"5.75rem",height:"3.25rem"};function ac(){return We("share",us(),Jt)[ke("share")]}function fs(){return T("mobile",M(Ht,i(dt,{}),ve,Gr,1,ve,"",{clear:{phoneFollows:!1,hint:ve}}))}const dn={read:e=>e.phoneRow,write:(e,t,n)=>({phoneRow:n}),fieldKey:()=>"phoneRow",ownField:!0};function cc(){const e=M(Ht,i(dt,{}),Gt,Hr,1,Gt,"",{clear:{emptyLabel:"Auto"}}),t=We("columns",e,{...dn,tablet:Jt.tablet}),n=We("columns",e,dn,{phoneRow:fs()});return{...t,phoneRow:n.phoneRow}}function uc(e,t,n,o,r,s,l){return{type:"custom",render:({value:c,onChange:u,name:p})=>i(hs,{label:e,min:t,max:n,step:o,fallback:r,role:s,value:c,onChange:u,name:p??"",length:l})}}function hs({label:e,min:t,max:n,step:o,fallback:r,role:s,value:l,onChange:c,name:u,length:p}){const h=O(),d=fe(),f=Zt(p?.view),m=pe({row:p?.row??{kind:"fontSize"},label:e,grid:{min:t,max:n,step:o},valueKey:p?u:"",view:p?.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?d({[u]:b,...m.unitPatch(typeof b!="number")}):c(b);return i(_,{label:a(e),icon:i(St,{noun:s}),action:i(y,{words:C()?.panel,label:a(e),changed:!ui(l),detail:a("the Text style in Styles"),onReset:()=>g(ci),defaultAction:{onPress:()=>g(ai),title:a("Keep this section's own built-in size"),icon:i(Yn,{})}}),children:Y({min:m?.grid.min??t,max:m?.grid.max??n,step:m?.grid.step??o,value:typeof l=="number"?l:r,...m?{suffix:m.unit,units:m.units}:{suffix:"px"},ariaLabel:e,onChange:g})})}function dc(){return{_gCellWidth:E("Cell width"),gridSpan:z("Positions",i(Ce,{}),[{label:"Auto",value:""},...Array.from({length:vn},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function O(){let e=null,t=null;try{e=Qe(ms),t=oe(n=>n).selectedItem}catch{t=null}return e??t?.props??{}}const ms=wn(null);function gs({min:e,max:t,step:n,px:o,label:r,onChange:s,desktopKey:l,fallback:c}){const u=O()[l],p=Ne(void 0,u,c);return i(P,{children:Y({min:e,max:t,step:n,value:Ne(o,u,c),readout:!1,ariaLabel:r,notch:p,onChange:s})})}function bs({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:s=()=>{}}){const l=O()[t],c=Ne(void 0,l,n);return i(y,{words:C()?.panel,label:a(e),changed:r,detail:G(u=>a(u),`${c}${o}`),onReset:s})}function ws(e){return $i(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:i(bs,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:t=>i(gs,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const Ss={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},_s={Top:xe,Bottom:mt,Left:gt,Right:bt},Cs=e=>{const t=_s[e];return i(t,{})};function pc(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=S=>Ss[S],s=S=>M(r("Top"),i(xe,{}),N.min,N.max,N.step,S,"px"),l=(S,w,x,q=N)=>T("mobile",ws({label:r(S),icon:Cs(S),desktopKey:w,min:q.min,max:q.max,step:q.step,fallback:x})),c=e.top??N.min,u=e.bottom??N.min,p="sectionPaddingLeft",h="sectionPaddingRight",d=e.sideBounds??N,f=e.side??d.min,m=e.sidePhone??f,g=e.phone===!0,b=S=>g?T("desktop",S):S;return ee({...o?{_gSpacing:E("Padding")}:{},[t]:b(s(c)),...g?{[X(t)]:l("Top",t,c)}:{},...e.only==="top"?{}:{[n]:b(M(r("Bottom"),i(mt,{}),N.min,N.max,N.step,u,"px")),...g?{[X(n)]:l("Bottom",n,u)}:{}},...e.sides?{[p]:b(M(r("Left"),i(gt,{}),d.min,d.max,d.step,f,"px")),...g?{[X(p)]:l("Left",p,m,d)}:{},[h]:b(M(r("Right"),i(bt,{}),d.min,d.max,d.step,f,"px")),...g?{[X(h)]:l("Right",h,m,d)}:{}}:{}})}function fc(e,t){const n=Object.fromEntries(Object.entries(t).map(([s,l])=>[s,s in e&&Se(l)?e[s]:l])),o={};let r=!1;for(const[s,l]of Object.entries(e)){if(s in t){r||Object.assign(o,n),r=!0;continue}o[s]=l}return r||Object.assign(o,n),o}const he="Width";function hc(e,t=di,n=!0){const o=t.map(r=>({label:pi[r],value:r}));return ee({...n?{_gWidth:E(he)}:{},widthMode:{type:"custom",render:({onChange:r,field:s})=>i(_,{label:a(he),icon:i(uo,{}),action:n?i(Ai,{inherited:s?.inherited??!1,onReset:()=>r(fi),label:he}):void 0,children:Ke({options:o,value:s?.currentValue||e,onChange:r,ariaLabel:he})})}})}function mc({fill:e=!1}={}){const t=(r,s)=>({type:"custom",render:({value:l,onChange:c})=>i(ys,{value:l,onChange:c,view:r,badge:s,fill:e})}),n=()=>Re("sectionHeightMode"),o=()=>Re("sectionHeightMode");return ee({_gHeight:E(Q),...B("sectionHeightMode",r=>r==="desktop"?t(r):t(r,s=>i(Ts,{view:r,onClear:()=>s(void 0)}))),...B("sectionHeightValue",n),...B("sectionHeightUnit",o)})}function ys({value:e,onChange:t,view:n,badge:o,fill:r=!1}){const s=O(),{mode:l,number:c,unit:u}=xs(n,s,e);return i(_,{label:Q,icon:j(i(ft,{})),action:o?o(t):void 0,children:k("div",{className:"es-width-stack",children:[Ke({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"},...r?[{label:"Fill",value:"fill"}]:[]],value:l,onChange:t,ariaLabel:Q}),c?i(Os,{view:n,mode:l,menu:u}):null]})})}function pn(e,t){return e==="phone"&&Ae(t)?br(t):gr(t)}function me(e,t){return e==="desktop"||(e==="tablet"?Ae(t):mr(t))?null:pn(e,t)}function xs(e,t,n){const r=(s=>Lr.includes(s))(n)?n:me(e,t)?.mode??"auto";return{mode:r,number:r!=="auto"&&r!=="fill",unit:r==="fixed"}}function Is(e,t,n,o){const r=me(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 fn(e,t,n){const o=v(),r=me(e,O());return!o||!r?{followed:null,write:n}:{followed:r,write:l=>o.onChangeMany(c=>{const u=Is(e,c,t,l);return u===null?{[I(t,e)]:l}:Object.keys(u).length?u:null})}}function Os({view:e,mode:t,menu:n}){const o=v(),r=O(),s=I("sectionHeightValue",e),l=I("sectionHeightUnit",e),c=S=>w=>o?.onChangeMany(()=>({[S]:w})),{followed:u,write:p}=fn(e,"sectionHeightValue",c(s)),{write:h}=fn(e,"sectionHeightUnit",c(l)),d=t==="screen"?"%":r[l],f=(u?u.unit:d)==="%"?"%":"px",m=f==="%"?vr:Fr,g=r[s],b=n?{options:["px","%"],label:a("Unit"),onChange:S=>h(S)}:void 0;return Y({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:p})}function Ts({view:e,onClear:t}){const n=O(),o=me(e,n)===null,r=e==="phone"&&Ae(n),s=pn(e,n),l=G(c=>a(c),s.mode==="auto"?a("Auto"):`${s.value}${s.unit}`,r?"tablet":"desktop");return i(y,{words:C()?.panel,label:a(Q),changed:o,detail:l,onReset:t})}function gc(e={}){const t=e.intro===!0,n=s=>({type:"custom",render:({value:l,onChange:c,id:u,name:p})=>i(Ls,{value:l,onChange:c,labelId:`${u??p??"stickTop"}-label`,view:s,intro:t})}),o=s=>({type:"custom",render:({value:l,onChange:c})=>i(ks,{value:l,onChange:c,view:s,intro:t})}),r=s=>({type:"custom",render:({value:l,onChange:c})=>i(Ps,{value:l,onChange:c,view:s,intro:t})});return{_gStick:E(yr,{dot:t?Ns:vt}),...B("stickTop",n),...B("stickTopDistance",o),...ue(Fe,"stickTopDistance",{tablet:!0,phone:!0}),...e.screens?B(Le,r):{},...t?{}:{[Or]:Es()},...t||e.above===!1?{}:{[_r]:Rs()}}}function Es(){const e=z(Tr,i(xe,{}),Er,xr);return T("desktop",{...e,render:t=>{const n=e.render({...t,value:kr(t.value),onChange:o=>t.onChange(Pr(o))});return be(n,{hint:a(Ir)})}})}function Rs(){const e=gn(Cr,!1,i(wt,{}),Sr);return T("desktop",{...e,render:t=>e.render({...t,onChange:n=>t.onChange(n===!0?!0:void 0)})})}const Ns={any:[vt,wr]};function hn(e,t,n,o,r){const s=v(),l=O(),c=e==="desktop"||ne(e,l)?null:ze(e,ae(l,{intro:o}));return{followed:c,write:(c||r)&&s?p=>s.onChangeMany(h=>{const d=As(e,h,p,t,o),f=d===null?{[I(t,e)]:p}:d;return Object.keys(f).length?{...f,...r?.(p)??{}}:null}):n}}function ks({value:e,onChange:t,view:n,intro:o}){const r=O(),s=ae(r,{intro:o}),l=h=>{const d=Ii(h);return d==="desktop"||ne(d,r)},c=pe({row:Fe,label:"Distance from top",grid:{min:D.min,max:D.max,step:D.step},valueKey:"stickTopDistance",view:n,numbersIn:h=>l(h)&&$(r[Pe("stickTopDistance",h)])!==void 0,followsView:n==="phone"&&s.ownTablet?"tablet":"desktop"}),{followed:u,write:p}=hn(n,"stickTopDistance",t,o,c?h=>c.unitPatch(h===void 0):void 0);return i("div",{className:"sf-field",children:Y({min:c?.grid.min??D.min,max:c?.grid.max??D.max,step:c?.grid.step??D.step,value:u?null:typeof e=="number"?e:D.fallback,...u?{placeholder:u.distance}:{},...c?{suffix:c.unit,units:c.units}:{suffix:"px"},ariaLabel:a("Distance from top"),onChange:p})})}function Ps({value:e,onChange:t,view:n,intro:o}){const{followed:r,write:s}=hn(n,Le,t,o);return i(_,{label:a(Ft),icon:j(i(ft,{})),children:Y({min:re.min,max:re.max,step:re.step,value:r?null:$(e)??re.default,...r?{placeholder:r.screens}:{},ariaLabel:a(Ft),onChange:s})})}function ne(e,t){return e==="tablet"?Nr(t):Rr(t)}function ze(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 As(e,t,n,o="stickTopDistance",r=!1){if(e==="desktop"||ne(e,t))return null;if(n===void 0)return{};const s=ze(e,ae(t,{intro:r})),l=e==="phone"&&ne("tablet",t)?h=>I(h,"tablet"):h=>h,c=(h,d)=>t[l(h)]==null?{}:{[I(h,e)]:d},u=Fe.unitKey,p=t[l(u)]==null?{}:{[I(u,e)]:s.unit};return{[I("stickTop",e)]:!0,...c("stickTopDistance",s.distance),...p,...c(Le,s.screens),[I(o,e)]:n}}function Ls({value:e,onChange:t,labelId:n,view:o,intro:r}){const s=O(),l=ae(s,{intro:r}),c=o==="phone"?l.phone:o==="tablet"?l.tablet:r?l.desktop:e===!0,u=o==="phone"&&l.ownTablet,p=o==="desktop"?null:ze(o,l),h=p?.on?Ar(p.distance,p.unit):a("Off");return i(_,{label:a(Lt),labelId:n,icon:j(i(wt,{})),action:k(P,{children:[o!=="desktop"?i(y,{words:C()?.panel,label:a(Lt),changed:ne(o,s),detail:G(d=>a(d),h,u?"tablet":"desktop"),onReset:()=>t(void 0)}):null,i(Oe,{checked:c,onChange:t,ariaLabelledBy:n})]})})}const mn="e.g. about";function bc(){return{_gAnchor:E("Anchor"),anchor:K({control:"plainText",label:"Name",placeholder:mn},{type:"custom",render:({value:e,onChange:t})=>i(Kn,{value:e,onChange:t,nameBox:(n,o)=>i(U,{value:n,onChange:o,label:"Name",placeholder:mn,hideable:!1,markup:!1})})})}}function wc(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:s,name:l})=>{const c=`${s??l??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(Bo,{id:c,value:Number.isFinite(u)?new Date(u):null,onChange:p=>r(p?p.toISOString():"")})})}}}function Sc(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:s,name:l})=>{const c=`${s??l??e}-date`;return i(_,{label:a(e),icon:t,htmlFor:c,hint:n===void 0?void 0:a(n),children:i(vo,{id:c,value:Cn(typeof o=="string"?o:null),onChange:u=>r(u?_n(u):"")})})}}}function gn(e,t,n,o){return{type:"custom",...L({},{...de,label:e}),render:r=>{const{value:s,onChange:l,id:c,name:u}=r,p="follows"in r,h=r,d=typeof s=="boolean",f=typeof h.follows=="boolean"?h.follows:t,m=d?s:p?f:t,g=`${c??u??e}-label`,b=h.readOnly===!0,S=i(Oe,{checked:m,onChange:l,disabled:b,ariaLabelledBy:g});return i(_,{label:a(e),labelId:g,icon:n,hint:o===void 0?void 0:a(o),action:p?k(P,{children:[i(y,{words:C()?.panel,label:a(e),changed:d,detail:h.followsNoView?a(f?"On":"Off"):G(w=>a(w),a(f?"On":"Off"),h.followsView),disabled:b,onReset:()=>l(void 0)}),S]}):S})}}}function _c(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i(Fs,{label:"Background",icon:i(so,{}),id:r,value:e,shown:po(e),onChange:t})}}}function Cc(e,t,n){return{type:"custom",render:({value:o,onChange:r})=>i(se,{label:a(e),icon:n,value:o||t,onChange:r})}}function Fs({label:e,icon:t,id:n,value:o,shown:r,onChange:s}){const{colors:l,n:c}=qe(),u=Ee(o),p=u?le(u,l,c):null;return i(se,{label:a(e),icon:t,id:n,value:p?p.hex:r,caption:p?.words,onChange:s,choices:Ye(u??"",l,c,s)})}function yc(){return{type:"custom",render:e=>{const{value:t,onChange:n}=e,o=e;return i(vs,{value:typeof t=="string"?t:"",onChange:n,twin:"follows"in e?{follows:o.follows,view:o.followsView}:void 0})}}}function Ye(e,t,n,o){const r=Ie(e);return $o(t,n).map(s=>({label:s.label,color:s.value,selected:r===s.name,onPick:()=>o(s.name)}))}function vs({value:e,onChange:t,twin:n}){const{colors:o,n:r}=qe(),s=o.background,l=W(s.toUpperCase(),a("Theme {n} background",{n:r})),c=Ie(e),u=c?le(c,o,r):null,p=Ye(e,o,r,t),h=n?()=>t(void 0):()=>t("");let d=s,f=l;if(n){const m=Ie(n.follows),g=fo(n.follows),b=m?le(m,o,r):g?{hex:g,words:g.toUpperCase()}:null;d=b?.hex??s,f=G(S=>a(S),b?b.words:l,n.view)}return u?i(se,{label:a("Fill"),icon:i(ye,{}),value:u.hex,caption:u.words,onChange:t,changed:!0,onReset:h,resetTo:f,choices:p}):i(Nt,{label:a("Fill"),icon:i(ye,{}),value:e,inherited:d,resetTo:f,onChange:t,onReset:h,choices:p})}function Bs(e,t,n){if((e?.content??[]).some(l=>l?.props?.id===t))return ce(n);const r=go(e,t);if(r.length===0)return null;const s=ce(qt(n));if(s!==null)return s;for(let l=r.length-1;l>0;l-=1){const c=ce(qt(r[l].sectionAccent));if(c!==null)return c}return ce(r[0].sectionAccent)}function qe(){const e=Xt(H().theme),[t]=F("sectionAccent");let n=null;try{const{appState:r,selectedItem:s}=oe(c=>c),l=s?.props?.id?String(s.props.id):void 0;n=l?Bs(r?.data,l,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{colors:$r(e.themes[o]),n:o+1}}function xc(){return on()}const Ic={top:i(Qn,{}),right:i(Zn,{}),bottom:i(qn,{}),left:i(Jn,{})};function Oc(e,t,n,o,r,s,l){const c=d=>t.find(f=>f.value===d),u=d=>({value:d,label:"",disabled:!0,title:o}),p=d=>{const f=t.find(g=>g.cell===d);if(!f)return u(`missing-${d}`);const m=s?.[d];return m?{value:f.value,label:f.label,icon:m}:{value:f.value,label:f.label}},h=[u("corner-top-left"),p("top"),u("corner-top-right"),p("left"),u("centre"),p("right"),u("corner-bottom-left"),p("bottom"),u("corner-bottom-right")];return{type:"custom",render:({value:d,onChange:f})=>{const m=t.some(g=>g.value===d)?d:n;return i(_,{label:a(e),icon:r,value:c(m)?.label?a(c(m).label):l?a(l):"",children:bi(a,{label:e,value:m,onChange:f,points:h})})}}}function Tc(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:s})=>i(sr,{label:e,options:(s.options??t).map(l=>({...l,label:a(l.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:a(n)}:{}})}}function Ec(e,t,n,o){return{type:"custom",options:t,fallback:n,...L({},{type:"select",label:e}),render:({value:r,onChange:s,field:l})=>i(ar,{label:e,options:(l.options??t).map(c=>({...c,label:a(c.label)})),fallback:l.fallback??n,value:r,onChange:s,placeholder:o===void 0?void 0:a(o)})}}function Rc(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}const Nc=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function kc(e,t,n){const o=Object.keys(tt).map(r=>({label:tt[r],value:r,picture:n[r]}));return{type:"custom",...L({},{type:"radio",label:e,options:o.map(r=>({value:r.value,label:r.label}))}),render:({onChange:r})=>i(Hs,{label:e,icon:t,options:o,onChange:r})}}function Ds(e,t,n){const o=yn(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=In(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 Hs({label:e,icon:t,options:n,onChange:o}){const r=v(),s=r?.values??{},l=xn(s),c=Qe(En),u=Tn(c?.docId??null);let p=null;try{p=oe(d=>d.appState.data)}catch{p=null}const h=On(r?.id,p,u);return i(_,{label:a(e),icon:j(t),hint:Ds(s,h,c?.hasUnsavedEdits??!1),children:Ke({options:n,value:l,onChange:o,ariaLabel:e})})}function Pc(e,t,n,o={}){const r={type:"custom",[it]:!0,render:({value:s,onChange:l,name:c})=>i(ir,{value:s||"",onChange:l,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?T("each",r):r}const Ac={HeroSingle:["imageFocal"],HeroSlide:["videoFrame"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function Gs(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 Lc({value:e,onChange:t,label:n}){const o=e||{},r=v(),s=r?r.values!==r.node.props:!0,l=!!o.pending&&s,c=!!o.pending&&!s,u=!!mi(hi()).geocode,p=et(),h=(d,f)=>t({...o,[d]:f??void 0});return k(P,{children:[i(_,{label:a(n),icon:i(ht,{}),action:u?i(Te,{content:a("Find from the address (OpenStreetMap)"),children:i(Et,{"aria-label":a("Find from the address"),"aria-busy":l||void 0,disabled:l,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:i(lo,{})})}):void 0,children:u&&o.status?i($n,{compact:!0,oneLine:!0,spaced:!1,status:l?"busy":o.ok&&!c?"found":"notfound",statusText:l?a("Finding…"):c?a(Ko):a(o.status),hint:Gs(o)}):null}),i(_,{label:a("Enter by hand"),labelId:p,icon:i(eo,{}),action:i(Oe,{checked:!!o.manual,onChange:d=>t({...o,manual:d}),ariaLabelledBy:p})}),o.manual&&i(_,{label:a("Latitude, longitude"),icon:i(ht,{}),children:k("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[i(Rt,{value:typeof o.lat=="number"?o.lat:null,onChange:d=>h("lat",d),min:-90,max:90,step:1e-4,placeholder:a("Latitude")}),i(Rt,{value:typeof o.lng=="number"?o.lng:null,onChange:d=>h("lng",d),min:-180,max:180,step:1e-4,placeholder:a("Longitude")})]})})]})}function Ms(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function Ws(e,t,n){const o=e.map(r=>({text:r?.text??""}));return t===null||t<0||t>=e.length?o:o.map((r,s)=>s===t?{text:n}:r)}function Fc(e,t){return e===null?null:t>e?e:null}function Us(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 vc={label:"Ticker items",icon:i(io,{})};function Bc(e,t,n,o){return{type:"custom",[R]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...L({},{...en.textList,label:e}),render:({value:r,onChange:s})=>i(Ks,{label:e,icon:j(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:s,markup:o==="markup"})}}function Ks({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:s=!1}){const l=J(null),[c,u]=Z(null),p=d=>d.map(f=>({text:f?.text??""})),h=d=>{const f=Us(n,d,c);f===null&&(l.current=null),u(f),r(p(d))};return i(Oo,{label:a(e),icon:t,noun:a("item"),items:n,onChange:h,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:s?i(kt,{target:l,value:Ms(n,c),onChange:d=>r(Ws(n,c??-1,d)),disabled:c===null,label:c===null?a("Formatting — click a row first"):a("Formatting — row {n}",{n:c+1})}):void 0,renderRow:(d,f,m)=>i("input",{type:"text",className:s&&c===f?"sf-list-marking":void 0,value:d?.text??"",placeholder:a(o),"aria-label":a("{label} {n}",{label:a(e),n:f+1}),onChange:g=>m({text:g.target.value}),onFocus:g=>{l.current=g.currentTarget,u(f)}})})}function Dc(e,t){const n=`${e.label} — row ${t+1}`;return K({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>i(U,{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 Hc(e){return{_gCards:E("Cards"),coverIndex:z("Cover image",i(ro,{}),nr,String(or),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:Ki("Image background",Jr),cardImage:bn()}}function Gc(){return{outline:z("Card outline",i(ao,{}),Qo,tr),indexBadge:z("Card number",i(oo,{}),Zo,er),showBadge:gn("Product badge",!0,i(St,{noun:"tag"}))}}function Mc(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...de,label:ge.find(s=>s.id===r).label}),o=r=>L(Re(Je),n(r));return{_gShowOnCard:E("Show on a card"),[Je]:L({type:"custom",render:()=>i($s,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(Je)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const Je="showCardPrice",ge=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function $s({rest:e}){const t=O(),n=fe(),o=l=>typeof t[l]=="boolean"?t[l]:void 0,r=l=>o(l)??e[l],s=ge.some(({id:l})=>o(l)!==void 0&&o(l)!==e[l]);return i(Ze,{parts:ge,changed:s,shown:r,onPress:(l,c)=>n({[l]:c}),onReset:()=>n(Object.fromEntries(ge.map(({id:l})=>[l,void 0])))})}function Wc(e,t="display"){const n=X(t);return{[t]:T("desktop",{type:"custom",render:({value:o,onChange:r})=>i(Ze,{parts:e,changed:Eo(o),shown:s=>Ro(o,s),onPress:(s,l)=>r(Po(o,s,l)),onReset:()=>r(void 0)})}),[n]:T("mobile",{type:"custom",render:({value:o,onChange:r})=>i(Xs,{parts:e,desktopKey:t,value:o,onChange:r})})}}function Ze({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:s,disabledReason:l}){const c=a("Display");return i(_,{label:c,icon:i(Vn,{}),changed:t,action:i(y,{words:C()?.panel,label:c,changed:t,detail:s,onReset:r}),children:i(To,{label:c,items:e.map(u=>({id:u.id,label:a(u.label),shown:n(u.id),...l?{disabled:!0,disabledReason:a(l)}:{}})),onChange:o})})}function Xs({parts:e,desktopKey:t,value:n,onChange:o}){const r=O()[t];return i(Ze,{parts:e,changed:ko(n),shown:s=>No(r,n,s),onPress:(s,l)=>o(Ao(n,s,l)),onReset:()=>o(qo),detail:a("the same as Desktop")})}function bn(e=kn){return M("Card image",i(pt,{}),A,_e,Pn,A,e,{clear:{hint:A},hint:"Rounds the picture. The card's own corner is in Styles."})}function Vs(){return ue(at,"cardImage")}function Uc(){return{cardImage:bn(at),...Vs()}}function Kc(){return Ve({sidesKey:"cornerSides",row:Fn,step:An,useFollowed:()=>A,mark:i(js,{label:Ln}),hint:a("Rounds the picture. Left alone it stays square.")})}function js({label:e,changed:t=!1,onReset:n=()=>{}}){return i(y,{words:C()?.panel,label:a(e),changed:t,onReset:n})}function $c(){return{type:"custom",render:({value:e,onChange:t})=>i(Js,{value:typeof e=="string"?e:"",onChange:t})}}function zs({layout:e,width:t}){const n=Hn(e),o=n?`${n[0]}/${n[1]}`:void 0;return i("span",{"aria-hidden":"true",style:{display:"grid",width:t,gridTemplateColumns:"repeat(12, minmax(0, 1fr))",gridAutoRows:o?"auto":6,gridAutoFlow:"row dense",gap:2},children:Gn(e).map(([r,s],l)=>i("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${r}`,gridRow:`span ${s}`,aspectRatio:o}},l))})}const Ys={width:"3.5rem",height:"2.5rem"},qs=200;function Js({value:e,onChange:t}){const[n,o]=Z(null),[r,s]=Z(4),l=J(null);Sn(()=>{const f=l.current;if(!f||typeof ResizeObserver!="function")return;const m=()=>s(f.getBoundingClientRect().width>=qs?4:3);m();const g=new ResizeObserver(m);return g.observe(f),()=>g.disconnect()},[]);const c=e&&e in ie?e:"",u=ct(n,c),p=ct(n,"").length,h=Mn("no-symbol"),d=[{value:"",label:a("Not chosen"),icon:xi(h,a("Not chosen"))},...u.map(f=>({value:f,label:a(ie[f].label),icon:i(zs,{layout:ie[f],width:40})}))];return i(_,{label:a("Layout"),icon:i(no,{}),value:c?a(ie[c].label):void 0,children:i("div",{ref:l,style:{flex:"1 1 auto",minWidth:0},children:i(It,{label:a("Layout"),value:c,options:d,onChange:t,columns:r,cell:Ys,header:k("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(_o,{options:[{id:"all",label:a("All")},...Bn.map(f=>({id:String(f),label:String(f)}))],value:n===null?"all":String(n),ariaLabel:a("Photos in a row"),onChange:f=>o(f==="all"?null:Number(f))}),i("span",{className:"text-2xs text-ink-faint",children:a("{n} of {total} layouts",{n:p,total:Dn.length})})]})})})})}export{Fi as BOUND_TO_POST,Ga as BOUND_TO_POST_NOTE,ja as BUCKET_ICONS,Ac as CUSTOM_FIELD_MEDIA,Lc as CoordsField,Qt as DESKTOP_GAP_NOT_OVERLAP,Ze as DisplayRow,Ic as EDGE_ARROWS,Do as FOCAL_DEFAULT,we as FOLD_FIELD_MARKER,vi as HIGHLIGHT_HINT,U as HidableTextField,rt as LINK_FIELD_MARKER,Ra as Label,it as MEDIA_FIELD_MARKER,Nc as MEDIA_TYPE_OPTIONS,Ma as NOT_BOUND_TO_POST,ec as PanelBand,Hi as PanelNoteLine,ms as RowPropsContext,st as SCAFFOLD_FIELD_MARKER,zc as SCALAR_TEXT_CONTROLS,Ti as SiteGapDefaultReset,Y as Slider,Mi as Swatches,jc as TEXT_CONTROL_KINDS,R as TEXT_FIELD_MARKER,vc as TICKER_ITEMS_ROW,Ks as TextListField,Fs as ThemeFillRow,he as WIDTH_LABEL,Ai as WidthDefaultReset,Us as aimAfterListChange,bc as anchorFields,W as backTo,tc as backgroundField,sc as boxBlockSpacingField,cc as boxColumnsFields,yc as boxFillField,fs as boxPhoneRowField,us as boxShareField,lc as boxSharePhoneField,ac as boxShareTabletField,Bs as boxThemeIndexOf,qa as bucketHeader,rc as buttonWordsEntryField,as as cardCornersField,Ki as cardImageBackgroundField,bn as cardImageField,Uc as cardImageFields,Hc as cardMediaFields,ic as cardShapeFields,Mc as cardShowFields,Gc as cardStyleFields,dc as cellWidthFields,Cc as colorInput,ka as containerDirectionField,Ei as containerGapField,Ri as containerGapPhoneField,Na as containerGapRows,Ni as containerGapTabletField,Gs as coordsResultTip,$a as copyText,sn as cornerSidesField,Ve as cornersRowField,rn as cornersUnitFields,Sc as date,wc as dateTime,Ja as designGroupHeader,Wc as displayFields,Oc as edgePad,Ye as fillSlotChoices,Fc as focusAfterRemove,xc as focusKeptField,Za as foldMarker,Se as foldMetaOf,Gi as foldTitleOf,Is as followedHeightPatch,As as followedStickPatch,$c as galleryLayoutField,mc as heightFields,me as heightFollowedBy,xs as heightLayersAt,Pa as heroGroupPlacementPoints,ot as hidableText,Di as hintIsWhileTyping,Kc as imageCornersField,Ha as inOwnBox,Ya as isBucketHeader,on as keptBy,Xa as linkField,Ds as loadingRowHint,kc as loadingShowsField,Tc as multiSelect,_c as pageBackgroundField,za as panelNote,ws as phoneOverrideField,Ka as plainText,Va as plainTextarea,$i as pxField,Qa as quietMarker,nt as readHidable,Ms as rowText,Ec as searchSelect,Ui as sectionBandChoices,Yi as sectionCornersField,oc as sectionShapeFields,nc as sectionThemeFields,Ws as setRowText,uc as sizeField,Rc as sourceField,pc as spacingFields,gc as stickFields,fc as swapPadding,Wa as text,Rn as textFieldIdentifier,Fa as textFieldOffPage,Ba as textFieldPanelOnly,Bc as textList,Dc as textListRowField,Ua as textarea,gn as toggle,Pc as upload,pe as useLengthRow,fe as useSelectedPatch,O as useSelectedProps,F as useSelectedSibling,Oi as useSiteGapDetail,hc as widthField,Da as withIdentifier,La as withOffPage,va as withPanelOnly,Aa as withScaffold};
@@ -1 +1 @@
1
- import r from"../../../components/PreviewPartAnchors.js";import{animationTabFields as e}from"../../animation/fields.js";import{BLOCK_THEME_FOLLOW_LABEL as t,SECTION_THEME_FOLLOW_LABEL as s}from"../../../components/SectionThemePicker.js";import{anchorFields as m,cardShapeFields as d,cellWidthFields as l,heightFields as p,sectionShapeFields as n,sectionThemeFields as F,spacingFields as a,stickFields as S,widthField as c}from"../controls.js";import{blockSizeFieldSet as h}from"efficient-easel/screen/lib/document/block-size-fields";import{VIEW_KEY_ACCESS as E}from"efficient-easel/screen/lib/document/box-fields";import{LENGTH_UNITS_TABLE as f,rowSay as L,sidesPaddingFields as _}from"../box-fields.js";import{assignSectionGroups as T}from"../field-groups.js";import{boxGutterFields as O}from"../box-gutter-field.js";import{sectionOwnWidthFields as A}from"../section-own-width-fields.js";import{dropEmptyHeadings as g}from"../panel-drop-empty-headings.js";import{rowsShownForNode as w}from"../show-when-resolve.js";const x={spacingFields:a,sidesPaddingFields:_,sectionShapeFields:n,cardShapeFields:d,cellWidthFields:l,widthField:c,boxGutterFields:O,sectionOwnWidthFields:A,heightFields:p,anchorFields:m,stickFields:S,sectionThemeFields:F,animationTabFields:e,blockSizeFields:({tablet:i,...o}={})=>h({...o,say:L,lengthUnits:f,...i?{phone:E}:{}}),assignSectionGroups:T,dropEmptyHeadings:g,rowsShownForNode:w,SECTION_THEME_FOLLOW_LABEL:s,BLOCK_THEME_FOLLOW_LABEL:t,PartAnchors:r};export{x as PASS_INSPECTOR};
1
+ import r from"../../../components/PreviewPartAnchors.js";import{animationTabFields as e}from"../../animation/fields.js";import{BLOCK_THEME_FOLLOW_LABEL as t,SECTION_THEME_FOLLOW_LABEL as s}from"../../../components/SectionThemePicker.js";import{anchorFields as m,cardShapeFields as d,cellWidthFields as l,heightFields as n,sectionShapeFields as p,sectionThemeFields as F,spacingFields as a,stickFields as h,widthField as S}from"../controls.js";import{blockSizeFieldSet as c}from"efficient-easel/screen/lib/document/block-size-fields";import{VIEW_KEY_ACCESS as E}from"efficient-easel/screen/lib/document/box-fields";import{LENGTH_UNITS_TABLE as f,rowSay as L,sidesPaddingFields as _}from"../box-fields.js";import{assignSectionGroups as T}from"../field-groups.js";import{boxGutterFields as O}from"../box-gutter-field.js";import{sectionOwnWidthFields as A}from"../section-own-width-fields.js";import{dropEmptyHeadings as g}from"../panel-drop-empty-headings.js";import{rowsShownForNode as w}from"../show-when-resolve.js";const x={spacingFields:a,sidesPaddingFields:_,sectionShapeFields:p,cardShapeFields:d,cellWidthFields:l,widthField:S,boxGutterFields:O,sectionOwnWidthFields:A,heightFields:n,anchorFields:m,stickFields:h,sectionThemeFields:F,animationTabFields:e,blockSizeFields:({tablet:i,...o}={})=>c({...o,shorten:!0,say:L,lengthUnits:f,...i?{phone:E}:{}}),assignSectionGroups:T,dropEmptyHeadings:g,rowsShownForNode:w,SECTION_THEME_FOLLOW_LABEL:s,BLOCK_THEME_FOLLOW_LABEL:t,PartAnchors:r};export{x as PASS_INSPECTOR};
@@ -1 +1 @@
1
- "use client";import{jsx as i}from"react/jsx-runtime";import{group as k,sharedStyleKinds as l}from"efficient-easel/screen/lib/document/box-fields";import{deviceField as x}from"efficient-easel/screen/lib/document/device-fields";import{usePreviewHeader as R}from"../../../render/components/PreviewHeaderContext.js";import{BackgroundWidthRow as b,ContentWidthRow as S}from"../../components/SectionWidthRows.js";import{PAGE_WIDTH as h}from"../../../format/lib/content/page-width.js";import{SECTION_WIDTH_KEYS as s,chromeOwnWidth as _,ownSectionWidth as m,sectionBackgroundPatch as E,sectionContentMaxPatch as I,sectionContentPatch as P,sectionWidthResetPatch as f}from"../../../format/lib/content/section-width.js";import{say as F}from"../../../format/lib/editor-words.js";import{finiteNumber as N}from"../../../format/lib/finite-number.js";import{WIDTH_LABEL as T,keptBy as w,useSelectedPatch as p,useSelectedProps as g}from"./controls.js";const B="Content cannot be wider than the background.",u=t=>F(t==="content"?"Content width":"Full width");function W(t){const{siteWidth:n,sectionBackgroundWidth:r,sectionContentWidth:e,themeFromDocument:o}=R(),c=N(n)??h.default;return t.drawsFullOnItsOwn?{px:c,background:"full",content:"full"}:{px:c,background:(o?null:r)??"full",content:(o?null:e)??"content"}}const D={read:m},H={read:m,drawsFullOnItsOwn:!0},M={read:_,clearOnContent:{fullWidth:void 0}};function A({source:t}){const n=t.read(g()),r=p(),e=W(t);return i(b,{value:n.background??e.background,changed:n.background!==null,detail:u(e.background),onChange:o=>r(E(o)),onReset:()=>r(f("background"))})}function U({source:t}){const n=t.read(g()),r=p(),e=d=>r({...d,...t.clearOnContent}),o=W(t),c=(n.background??o.background)==="content",a=n.content??o.content;return i(S,{mode:c&&a==="full"?"content":a,px:n.contentMax??o.px,max:c?o.px:h.max,changed:n.content!==null,detail:o.content==="full"?u("full"):`${u("content")} ${o.px}px`,fullClosed:c,hint:c?B:void 0,onMode:d=>e(P(d)),onPx:d=>e(I(d)),onReset:()=>e(f("content"))})}const C=(t,n)=>x("desktop",{type:"custom",render:()=>i(t,{source:n})}),O=t=>({[s.background]:C(A,t),[s.content]:C(U,t),[s.contentMax]:w()});function J(t){const n=t?.drawsFullOnItsOwn?H:D;return l({_gWidth:k(T),...O(n)})}function Q(){return l({...O(M),fullWidth:w()})}export{Q as chromeOwnWidthFields,J as sectionOwnWidthFields};
1
+ "use client";import{jsx as l}from"react/jsx-runtime";import{group as R,sharedStyleKinds as h}from"efficient-easel/screen/lib/document/box-fields";import{lengthUnitFields as _}from"./box-fields.js";import{deviceField as b}from"efficient-easel/screen/lib/document/device-fields";import{usePreviewHeader as E}from"../../../render/components/PreviewHeaderContext.js";import{BackgroundWidthRow as S,CONTENT_LABEL as I,ContentWidthRow as N}from"../../components/SectionWidthRows.js";import{PAGE_WIDTH as d}from"../../../format/lib/content/page-width.js";import{SECTION_CONTENT_MAX_ROW as f,SECTION_WIDTH_KEYS as s,chromeOwnWidth as T,ownSectionWidth as w,sectionBackgroundPatch as P,sectionContentMaxPatch as F,sectionContentPatch as M,sectionWidthResetPatch as p}from"../../../format/lib/content/section-width.js";import{say as B}from"../../../format/lib/editor-words.js";import{finiteNumber as A}from"../../../format/lib/finite-number.js";import{WIDTH_LABEL as D,keptBy as g,useLengthRow as H,useSelectedPatch as O,useSelectedProps as C}from"./controls.js";const U="Content cannot be wider than the background.",a=t=>B(t==="content"?"Content width":"Full width");function x(t){const{siteWidth:n,sectionBackgroundWidth:r,sectionContentWidth:e,themeFromDocument:o}=E(),c=A(n)??d.default;return t.drawsFullOnItsOwn?{px:c,background:"full",content:"full"}:{px:c,background:(o?null:r)??"full",content:(o?null:e)??"content"}}const v={read:w},y={read:w,drawsFullOnItsOwn:!0},K={read:T,clearOnContent:{fullWidth:void 0}};function L({source:t}){const n=t.read(C()),r=O(),e=x(t);return l(S,{value:n.background??e.background,changed:n.background!==null,detail:a(e.background),onChange:o=>r(P(o)),onReset:()=>r(p("background"))})}function j({source:t}){const n=t.read(C()),r=O(),e=i=>r({...i,...t.clearOnContent}),o=x(t),c=(n.background??o.background)==="content",u=H({row:f,label:I,grid:{min:d.min,max:c?o.px:d.max,step:d.step},valueKey:s.contentMax,view:"desktop",numbersIn:()=>n.contentMax!==null}),m=n.content??o.content;return l(N,{mode:c&&m==="full"?"content":m,px:n.contentMax??o.px,max:c?o.px:d.max,changed:n.content!==null,detail:o.content==="full"?a("full"):`${a("content")} ${o.px}px`,fullClosed:c,hint:c?U:void 0,onMode:i=>e(M(i)),onPx:i=>e({...F(i),...u?.unitPatch(!1)}),...u?{length:u}:{},onReset:()=>e(p("content"))})}const W=(t,n)=>b("desktop",{type:"custom",render:()=>l(t,{source:n})}),k=t=>({[s.background]:W(L,t),[s.content]:W(j,t),[s.contentMax]:g(),..._(f,s.content)});function nt(t){const n=t?.drawsFullOnItsOwn?y:v;return h({_gWidth:R(D),...k(n)})}function ot(){return h({...k(K),fullWidth:g()})}export{ot as chromeOwnWidthFields,nt as sectionOwnWidthFields};
@@ -1 +1 @@
1
- import{FOLLOW_RULES as r,phoneKey as c,resolveViewValue as s,tabletKey as a}from"efficient-easel/screen/lib/content/view-tiers";const i=["desktop","tablet","phone"],n=(e,t)=>t==="phone"?c(e):t==="tablet"?a(e):e,w=e=>e.flatMap(t=>i.map(o=>n(t,o))),l=e=>e===null||e===""?void 0:e,f=(e,t,o)=>s("same",l(e),l(t),l(o),r);function x(e,t,o,p=e[t]){return f(p,e[n(t,"tablet")],e[n(t,"phone")])[o]}export{i as MOTION_VIEWS,f as followViews,x as followedIn,n as viewKey,w as viewStoreKeys};
1
+ import{FOLLOW_RULES as l,resolveViewValue as c,viewKeyAt as f}from"efficient-easel/screen/lib/content/view-tiers";import{tierOfView as p}from"../content/view-tier.js";const s=["desktop","tablet","phone"],n=(e,o)=>f(e,p(o)),x=e=>e.flatMap(o=>s.map(t=>n(o,t))),i=e=>e===null||e===""?void 0:e,w=(e,o,t)=>c("same",i(e),i(o),i(t),l);function O(e,o,t,r=e[o]){return w(r,e[n(o,"tablet")],e[n(o,"phone")])[t]}export{s as MOTION_VIEWS,w as followViews,O as followedIn,n as viewKey,x as viewStoreKeys};
@@ -1,4 +1,5 @@
1
1
  import type { CSSProperties } from "react";
2
+ import { type LengthRow } from "efficient-easel/screen/lib/content/length-units";
2
3
  export declare const BORDER_MAX = 20;
3
4
  export declare const BORDER_STYLES: readonly ["solid", "dashed", "dotted"];
4
5
  export type BorderStyle = (typeof BORDER_STYLES)[number];
@@ -15,9 +16,18 @@ export type BorderValue = {
15
16
  };
16
17
  export declare const SECTION_BORDER_CLASS = "sf-section-border";
17
18
  export declare const SECTION_BORDER_SELF_CLASS = "sf-section-border-self";
18
- export declare function borderVars(value: BorderValue | null | undefined, { phone, tablet }?: {
19
+ export declare const SECTION_BORDER_ROW: LengthRow;
20
+ export declare const SECTION_BORDER_UNIT_KEYS: readonly string[];
21
+ export type BorderUnits = {
22
+ desktop?: unknown;
23
+ tablet?: unknown;
24
+ phone?: unknown;
25
+ };
26
+ export declare function sectionBorderUnitsOf(props: Readonly<Record<string, unknown>>): BorderUnits;
27
+ export declare function borderVars(value: BorderValue | null | undefined, { phone, tablet, unit }?: {
19
28
  phone?: boolean;
20
29
  tablet?: boolean;
30
+ unit?: unknown;
21
31
  }): Record<string, string> | undefined;
22
32
  export declare function borderBySide(value: BorderValue): BorderValue;
23
- export declare function sectionBorderStyle(desktop: BorderValue | null | undefined, phone: BorderValue | null | undefined, tablet?: BorderValue | null): CSSProperties | undefined;
33
+ export declare function sectionBorderStyle(desktop: BorderValue | null | undefined, phone: BorderValue | null | undefined, tablet?: BorderValue | null, units?: BorderUnits): CSSProperties | undefined;
@@ -1 +1 @@
1
- const b=20,p=["solid","dashed","dotted"],i=["top","right","bottom","left"],h="sf-section-border",E="sf-section-border-self",u=/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,c=t=>typeof t=="number"&&Number.isFinite(t)?`${Math.min(20,Math.max(0,Math.round(t)))}px`:void 0;function s(t,{phone:n=!1,tablet:o=!1}={}){if(!t||typeof t!="object")return;const e=n?"-phone":o?"-tablet":"",r={};for(const f of i){const d=c(t[f])??c(t.width);d!==void 0&&(r[`--sf-border-${f}-width${e}`]=d)}return typeof t.style=="string"&&p.includes(t.style)&&(r[`--sf-border-style${e}`]=t.style),typeof t.color=="string"&&u.test(t.color)&&(r[`--sf-border-color${e}`]=t.color.toLowerCase()),Object.keys(r).length?r:void 0}function S(t){const{width:n,...o}=t;return typeof n!="number"?t:{...o,...Object.fromEntries(i.map(e=>[e,o[e]??n]))}}function y(t,n,o){const e=s(t),r=s(o,{tablet:!0}),f=s(o,{phone:!0})||s(n,{phone:!0})?{...s(o,{phone:!0}),...s(n,{phone:!0})}:void 0;return e||r||f?{...e,...r,...f}:void 0}export{b as BORDER_MAX,i as BORDER_SIDES,p as BORDER_STYLES,h as SECTION_BORDER_CLASS,E as SECTION_BORDER_SELF_CLASS,S as borderBySide,s as borderVars,y as sectionBorderStyle};
1
+ import{viewKeyAt as p}from"efficient-easel/screen/lib/content/view-tiers";import{cssLengthOf as h,rowUnitKeys as m,storedUnit as E}from"./css-length.js";const x=20,O=["solid","dashed","dotted"],b=["top","right","bottom","left"],a="sf-section-border",B="sf-section-border-self",S=/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,R=t=>typeof t=="number"&&Number.isFinite(t)?`${Math.min(x,Math.max(0,Math.round(t)))}px`:void 0,u={kind:"border",unitKey:"sectionBorderUnit"},w=m(u);function D(t){const e=u.unitKey;return{desktop:t[p(e,"desktop")],tablet:t[p(e,"tablet")],phone:t[p(e,"mobile")]}}const y=(t,e)=>e==="px"?R(t):typeof t=="number"&&Number.isFinite(t)?h(Math.max(0,t),e):void 0;function c(t,{phone:e=!1,tablet:r=!1,unit:o}={}){if(!t||typeof t!="object")return;const s=e?"-phone":r?"-tablet":"",n={},i=E(o);for(const d of b){const f=y(t[d],i)??y(t.width,i);f!==void 0&&(n[`--sf-border-${d}-width${s}`]=f)}return typeof t.style=="string"&&O.includes(t.style)&&(n[`--sf-border-style${s}`]=t.style),typeof t.color=="string"&&S.test(t.color)&&(n[`--sf-border-color${s}`]=t.color.toLowerCase()),Object.keys(n).length?n:void 0}function C(t){const{width:e,...r}=t;return typeof e!="number"?t:{...r,...Object.fromEntries(b.map(o=>[o,r[o]??e]))}}function I(t,e,r,o={}){const s=c(t,{unit:o.desktop}),n=c(r,{tablet:!0,unit:o.tablet}),i=c(r,{phone:!0,unit:o.tablet}),d=c(e,{phone:!0,unit:o.phone}),f=i||d?{...i,...d}:void 0;return s||n||f?{...s,...n,...f}:void 0}export{x as BORDER_MAX,b as BORDER_SIDES,O as BORDER_STYLES,a as SECTION_BORDER_CLASS,u as SECTION_BORDER_ROW,B as SECTION_BORDER_SELF_CLASS,w as SECTION_BORDER_UNIT_KEYS,C as borderBySide,c as borderVars,I as sectionBorderStyle,D as sectionBorderUnitsOf};
@@ -1,8 +1,10 @@
1
1
  import type { CSSProperties } from "react";
2
+ import { type LengthRow } from "efficient-easel/screen/lib/content/length-units";
3
+ export declare const CARD_CORNERS_ROW: LengthRow;
2
4
  export { CORNER_SIDES, CORNER_SIDE_POINTS, cornerSidesShorthand, hasCornerSubset, normalizeCornerSides, type CornerSide, } from "./section-corners.js";
3
5
  export declare const CARD_BOX_RADIUS_PROP = "--sf-card-box-radius";
4
6
  export declare function hasOwnCardCorners(value: unknown): boolean;
5
- export declare function cardCornerStyle(value: unknown, sides?: unknown): CSSProperties | undefined;
7
+ export declare function cardCornerStyle(value: unknown, sides?: unknown, unit?: unknown): CSSProperties | undefined;
6
8
  type CardNode = {
7
9
  props?: Record<string, unknown>;
8
10
  };
@@ -1 +1 @@
1
- import{cornerRadiusTokens as i,normalizeCornerRadius as d}from"../theme.js";import{CARD_RADIUS_PROP as p,cornerSidesShorthand as S,hasCornerSubset as u,normalizeCornerSides as C}from"./section-corners.js";import{CORNER_SIDES as O,CORNER_SIDE_POINTS as b,cornerSidesShorthand as D,hasCornerSubset as P,normalizeCornerSides as A}from"./section-corners.js";const a="--sf-card-box-radius";function c(r){return typeof r=="number"&&Number.isFinite(r)}function m(r,e){if(!c(r))return;const o=i(d(r))[p];if(typeof o!="string")return;const s=u(e)?S(o,C(e)??[]):o;return{[a]:s}}function h(r,e){const o=r.find(n=>n?.props?.id===e);if(!o)return[...r];const s=o.props?.cardCorners,t=o.props?.cardCornerSides;return r.map(n=>n?.props?.id===e?n:{...n,props:{...n.props,cardCorners:s,cardCornerSides:t}})}export{a as CARD_BOX_RADIUS_PROP,O as CORNER_SIDES,b as CORNER_SIDE_POINTS,m as cardCornerStyle,h as cardsWithSharedCorners,D as cornerSidesShorthand,P as hasCornerSubset,c as hasOwnCardCorners,A as normalizeCornerSides};
1
+ import{cornerRadiusTokens as i,normalizeCornerRadius as C}from"../theme.js";import{isLengthUnit as u}from"efficient-easel/screen/lib/content/length-units";const p={kind:"radius",unitKey:"cardCornersUnit"};import{CARD_RADIUS_PROP as S,cornerSidesShorthand as c,hasCornerSubset as a,normalizeCornerSides as f}from"./section-corners.js";import{CORNER_SIDES as A,CORNER_SIDE_POINTS as E,cornerSidesShorthand as N,hasCornerSubset as P,normalizeCornerSides as I}from"./section-corners.js";const R="--sf-card-box-radius";function m(r){return typeof r=="number"&&Number.isFinite(r)}function O(r,e,n){if(!m(r))return;const s=(u(n)&&n!=="px"?i(r,n):i(C(r)))[S];if(typeof s!="string")return;const t=a(e)?c(s,f(e)??[]):s;return{[R]:t}}function D(r,e){const n=r.find(o=>o?.props?.id===e);if(!n)return[...r];const s=n.props?.cardCorners,t=n.props?.cardCornerSides,d=n.props?.[p.unitKey];return r.map(o=>o?.props?.id===e?o:{...o,props:{...o.props,cardCorners:s,cardCornerSides:t,[p.unitKey]:d}})}export{R as CARD_BOX_RADIUS_PROP,p as CARD_CORNERS_ROW,A as CORNER_SIDES,E as CORNER_SIDE_POINTS,O as cardCornerStyle,D as cardsWithSharedCorners,N as cornerSidesShorthand,P as hasCornerSubset,m as hasOwnCardCorners,I as normalizeCornerSides};
@@ -1 +1,7 @@
1
+ import { VIEW_ABOVE, type LengthRow, type LengthUnit } from "efficient-easel/screen/lib/content/length-units";
2
+ type ViewTier = keyof typeof VIEW_ABOVE;
1
3
  export declare function cssLengthOf(value: number, unit: unknown): string;
4
+ export declare function storedUnit(stored: unknown, base?: LengthUnit): LengthUnit;
5
+ export declare function ownRowUnit(props: Readonly<Record<string, unknown>>, row: LengthRow, view: ViewTier): LengthUnit;
6
+ export declare function rowUnitKeys(row: LengthRow, views?: readonly ViewTier[]): readonly string[];
7
+ export {};
@@ -1 +1 @@
1
- import{isLengthUnit as o,lengthOf as r}from"efficient-easel/screen/lib/content/length-units";function p(e,n){const t=r(e,o(n)?n:"px");return typeof t=="number"?`${t}px`:t}export{p as cssLengthOf};
1
+ import{viewKeyAt as o}from"efficient-easel/screen/lib/content/view-tiers";import{VIEW_ABOVE as i,isLengthUnit as f,lengthOf as s}from"efficient-easel/screen/lib/content/length-units";const p=(()=>{const e=Object.keys(i),t=e.filter(n=>i[n]===null);for(let n=e.find(r=>i[r]===t[0]);n&&!t.includes(n);n=e.find(r=>i[r]===t[t.length-1]))t.push(n);return t})();function y(e,t){const n=s(e,u(t));return typeof n=="number"?`${n}px`:n}function u(e,t="px"){return f(e)?e:t}function l(e,t,n){return t.unitKey?u(e[o(t.unitKey,n)],t.base??"px"):t.base??"px"}function m(e,t=p){return e.unitKey?t.map(n=>o(e.unitKey,n)):[]}export{y as cssLengthOf,l as ownRowUnit,m as rowUnitKeys,u as storedUnit};
@@ -1,7 +1,9 @@
1
1
  import type { CSSProperties } from "react";
2
2
  import { CORNER_RADIUS_MAX, CORNER_RADIUS_MIN } from "../theme.js";
3
+ import { type LengthRow } from "efficient-easel/screen/lib/content/length-units";
4
+ export declare const IMAGE_CORNERS_ROW: LengthRow;
3
5
  export { CORNER_RADIUS_MAX, CORNER_RADIUS_MIN };
4
6
  export declare const IMAGE_CORNER_STEP = 1;
5
7
  export declare const IMAGE_CORNERS_LABEL = "Corners";
6
8
  export declare function normalizeImageCorners(value?: number | string | null): number | null;
7
- export declare function imageCornerStyle(value: unknown, sides?: unknown): CSSProperties | null;
9
+ export declare function imageCornerStyle(value: unknown, sides?: unknown, unit?: unknown): CSSProperties | null;
@@ -1 +1 @@
1
- import{cornerSidesShorthand as t,hasCornerSubset as i,normalizeCornerSides as R}from"./section-corners.js";import{CORNER_RADIUS_MAX as s,CORNER_RADIUS_MIN as u,normalizeCornerRadius as a}from"../theme.js";const S=1,l="Corners";function C(r){return a(r)}function E(r,o){const e=C(r);if(e===null)return null;const n=`${e}px`;return{borderRadius:i(o)?t(n,R(o)??[]):n}}export{s as CORNER_RADIUS_MAX,u as CORNER_RADIUS_MIN,l as IMAGE_CORNERS_LABEL,S as IMAGE_CORNER_STEP,E as imageCornerStyle,C as normalizeImageCorners};
1
+ import{cornerSidesShorthand as s,hasCornerSubset as m,normalizeCornerSides as d}from"./section-corners.js";import{CORNER_RADIUS_MAX as u,CORNER_RADIUS_MIN as R,normalizeCornerRadius as f}from"../theme.js";import{isLengthUnit as p}from"efficient-easel/screen/lib/content/length-units";import{cssLengthOf as a}from"./css-length.js";import{finiteNumber as c}from"../finite-number.js";const A={kind:"radius",unitKey:"cornersUnit"},I=1,N="Corners";function C(r){return f(r)}function O(r,o,e){const n=p(e)&&e!=="px"?c(r):void 0,t=n===void 0?C(r):null;if(n===void 0&&t===null)return null;const i=n!==void 0?a(Math.max(0,n),e):`${t}px`;return{borderRadius:m(o)?s(i,d(o)??[]):i}}export{u as CORNER_RADIUS_MAX,R as CORNER_RADIUS_MIN,N as IMAGE_CORNERS_LABEL,A as IMAGE_CORNERS_ROW,I as IMAGE_CORNER_STEP,O as imageCornerStyle,C as normalizeImageCorners};
@@ -1,7 +1,9 @@
1
1
  import type { CSSProperties } from "react";
2
2
  import { CORNER_SIDES, type CornerSide, hasCornerSubset, normalizeCornerSides } from "efficient-easel/screen/lib/content/style-keys";
3
+ import { type LengthRow } from "efficient-easel/screen/lib/content/length-units";
4
+ export declare const SECTION_CORNERS_ROW: LengthRow;
3
5
  export declare function hasOwnSectionCorners(value: unknown): boolean;
4
- export declare function sectionCornerStyle(value: unknown, sides?: unknown): CSSProperties | undefined;
6
+ export declare function sectionCornerStyle(value: unknown, sides?: unknown, unit?: unknown): CSSProperties | undefined;
5
7
  export declare const SECTION_RADIUS_PROP = "--sf-section-radius";
6
8
  export declare const CARD_RADIUS_PROP = "--sf-card-radius";
7
9
  export { CORNER_SIDES, type CornerSide, hasCornerSubset, normalizeCornerSides };
@@ -1 +1 @@
1
- import{CORNER_SIDES as n,hasCornerSubset as i,normalizeCornerSides as s}from"efficient-easel/screen/lib/content/style-keys";import{cornerRadiusTokens as l,normalizeCornerRadius as a}from"../theme.js";function c(e){return typeof e=="number"&&Number.isFinite(e)}function m(e,t){if(!c(e))return;const r=l(a(e));if(Object.keys(r).length===0)return;const o=r[p];if(typeof o!="string")return r;const u=i(t)?d(o,s(t)??[]):o;return{...r,[f]:u}}const f="--sf-section-radius",p="--sf-card-radius";function d(e,t){return n.map(r=>t.includes(r)?e:"0").join(" ")}const R=[{value:"tl",label:"Top left"},{value:"tr",label:"Top right"},{value:"bl",label:"Bottom left"},{value:"br",label:"Bottom right"}];export{p as CARD_RADIUS_PROP,n as CORNER_SIDES,R as CORNER_SIDE_POINTS,f as SECTION_RADIUS_PROP,d as cornerSidesShorthand,i as hasCornerSubset,c as hasOwnSectionCorners,s as normalizeCornerSides,m as sectionCornerStyle};
1
+ import{CORNER_SIDES as i,hasCornerSubset as s,normalizeCornerSides as u}from"efficient-easel/screen/lib/content/style-keys";import{cornerRadiusTokens as c,normalizeCornerRadius as l}from"../theme.js";import{isLengthUnit as f}from"efficient-easel/screen/lib/content/length-units";const O={kind:"radius",unitKey:"sectionCornersUnit"};function p(r){return typeof r=="number"&&Number.isFinite(r)}function x(r,t,e){if(!p(r))return;const o=f(e)&&e!=="px"?c(r,e):c(l(r));if(Object.keys(o).length===0)return;const n=o[S];if(typeof n!="string")return o;const a=s(t)?R(n,u(t)??[]):n;return{...o,[d]:a}}const d="--sf-section-radius",S="--sf-card-radius";function R(r,t){return i.map(e=>t.includes(e)?r:"0").join(" ")}const _=[{value:"tl",label:"Top left"},{value:"tr",label:"Top right"},{value:"bl",label:"Bottom left"},{value:"br",label:"Bottom right"}];export{S as CARD_RADIUS_PROP,i as CORNER_SIDES,_ as CORNER_SIDE_POINTS,O as SECTION_CORNERS_ROW,d as SECTION_RADIUS_PROP,R as cornerSidesShorthand,s as hasCornerSubset,p as hasOwnSectionCorners,u as normalizeCornerSides,x as sectionCornerStyle};
@@ -1,6 +1,7 @@
1
1
  import type { CSSProperties } from "react";
2
+ import { type ViewTier } from "efficient-easel/screen/lib/content/view-tiers";
2
3
  import { type LengthUnit } from "efficient-easel/screen/lib/content/length-units";
3
- export type SectionHeightMode = "auto" | "fixed" | "screen";
4
+ export type SectionHeightMode = "auto" | "fixed" | "screen" | "fill";
4
5
  export declare const SECTION_HEIGHT_MODES: readonly SectionHeightMode[];
5
6
  export type SectionHeightUnit = Extract<LengthUnit, "px" | "%">;
6
7
  export declare const SECTION_HEIGHT_UNITS: readonly SectionHeightUnit[];
@@ -80,3 +81,12 @@ export declare const SECTION_FILL_PASS_CLASS = "grid grid-cols-[minmax(0,1fr)]";
80
81
  export declare const SECTION_FILL_CLASS = "h-full";
81
82
  export declare const SECTION_FILL_PASS_PHONE_CLASS = "max-view-tablet:grid grid-cols-[minmax(0,1fr)]";
82
83
  export declare function sectionFillPassClass(props: Record<string, unknown>): string;
84
+ export declare const SECTION_HEIGHT_FILL_ATTR = "data-sf-height-fill";
85
+ type FillView = ViewTier;
86
+ export declare function sectionHeightFillViews(props: Record<string, unknown>): FillView[];
87
+ export declare function sectionHeightFillClass(props: Record<string, unknown>): string;
88
+ export declare function sectionHeightWrap(props: Record<string, unknown>): {
89
+ className: string;
90
+ style?: CSSProperties;
91
+ } | null;
92
+ export {};