efficient-web-builder 52.0.0 → 53.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/editor/components/ChatSettingsPanel.js +1 -1
  3. package/dist/editor/components/MediaUploadField.d.ts +7 -7
  4. package/dist/editor/components/MediaUploadField.js +1 -1
  5. package/dist/editor/components/PartSettingsPanel.js +1 -1
  6. package/dist/editor/components/PartTextBox.js +1 -1
  7. package/dist/editor/components/PreviewPartAnchors.js +1 -1
  8. package/dist/editor/components/SectionTextPartBridge.js +1 -1
  9. package/dist/editor/components/SiteAccentField.js +1 -1
  10. package/dist/editor/components/SiteTextStylesField.d.ts +3 -3
  11. package/dist/editor/components/SiteTextStylesField.js +1 -1
  12. package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
  13. package/dist/editor/components/storefront-editor.css +70 -20
  14. package/dist/editor/lib/animation/entrance-fields.js +1 -1
  15. package/dist/editor/lib/animation/hover-fields.js +1 -1
  16. package/dist/editor/lib/document/blocks/general/Breadcrumb/fields.js +1 -1
  17. package/dist/editor/lib/document/blocks/general/ButtonBlock/fields.js +1 -1
  18. package/dist/editor/lib/document/blocks/general/Cards/fields.js +1 -1
  19. package/dist/editor/lib/document/blocks/general/Chart/fields.js +1 -1
  20. package/dist/editor/lib/document/blocks/general/Contents/fields.js +1 -1
  21. package/dist/editor/lib/document/blocks/general/Divider/fields.js +1 -1
  22. package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
  23. package/dist/editor/lib/document/blocks/general/Hero/fields.js +1 -1
  24. package/dist/editor/lib/document/blocks/general/HeroSingle/fields.js +1 -1
  25. package/dist/editor/lib/document/blocks/general/HeroSlide/fields.js +1 -1
  26. package/dist/editor/lib/document/blocks/general/ImageBlock/fields.js +1 -1
  27. package/dist/editor/lib/document/blocks/general/IntroBleed/fields.js +1 -1
  28. package/dist/editor/lib/document/blocks/general/Logos/fields.js +1 -1
  29. package/dist/editor/lib/document/blocks/general/Mockup/fields.js +2 -2
  30. package/dist/editor/lib/document/blocks/general/PostCard/fields.js +1 -1
  31. package/dist/editor/lib/document/blocks/general/SectionHeader/fields.js +1 -1
  32. package/dist/editor/lib/document/blocks/general/Timeline/fields.js +1 -1
  33. package/dist/editor/lib/document/blocks/shared-fields.d.ts +5 -0
  34. package/dist/editor/lib/document/blocks/shared-fields.js +1 -1
  35. package/dist/editor/lib/document/box-fields.d.ts +23 -2
  36. package/dist/editor/lib/document/box-fields.js +1 -1
  37. package/dist/editor/lib/document/card-row-fields.js +1 -1
  38. package/dist/editor/lib/document/choice-pictures.d.ts +21 -0
  39. package/dist/editor/lib/document/choice-pictures.js +1 -0
  40. package/dist/editor/lib/document/controls.d.ts +19 -5
  41. package/dist/editor/lib/document/controls.js +1 -1
  42. package/dist/editor/lib/document/hidable-rows-drawn.d.ts +1 -0
  43. package/dist/editor/lib/document/hidable-rows-drawn.js +1 -1
  44. package/dist/editor/lib/document/part-panel-rows.d.ts +1 -0
  45. package/dist/editor/lib/document/part-panel-rows.js +1 -1
  46. package/dist/editor/lib/document/separator-field.d.ts +9 -1
  47. package/dist/editor/lib/document/separator-field.js +1 -1
  48. package/dist/editor/lib/document/shape-picker.d.ts +37 -0
  49. package/dist/editor/lib/document/shape-picker.js +1 -0
  50. package/dist/editor/lib/document/show-for-field.d.ts +6 -0
  51. package/dist/editor/lib/document/show-for-field.js +1 -0
  52. package/dist/format/lib/animation/hover.d.ts +0 -2
  53. package/dist/format/lib/animation/hover.js +1 -1
  54. package/dist/format/lib/content/box-layout.d.ts +21 -6
  55. package/dist/format/lib/content/box-layout.js +1 -1
  56. package/dist/format/lib/content/box-shape.d.ts +1 -5
  57. package/dist/format/lib/content/box-shape.js +1 -1
  58. package/dist/format/lib/content/box-show-for-choices.d.ts +9 -0
  59. package/dist/format/lib/content/box-show-for-choices.js +1 -0
  60. package/dist/format/lib/content/card-template.js +1 -1
  61. package/dist/format/lib/content/gallery-card-layout.d.ts +45 -1
  62. package/dist/format/lib/content/gallery-card-layout.js +1 -1
  63. package/dist/format/lib/content/image-aspect.d.ts +47 -0
  64. package/dist/format/lib/content/image-aspect.js +1 -0
  65. package/dist/format/lib/content/list-number.d.ts +11 -0
  66. package/dist/format/lib/content/list-number.js +1 -1
  67. package/dist/format/lib/content/phone-focus.d.ts +4 -1
  68. package/dist/format/lib/content/phone-focus.js +1 -1
  69. package/dist/format/lib/content/record-row.d.ts +14 -0
  70. package/dist/format/lib/content/record-row.js +1 -0
  71. package/dist/format/lib/content/record-types.d.ts +1 -1
  72. package/dist/format/lib/content/record-types.js +1 -1
  73. package/dist/format/lib/content/section-height.d.ts +8 -0
  74. package/dist/format/lib/content/section-height.js +1 -1
  75. package/dist/format/lib/document/blocks/general/text-part-shapes.json +2 -2
  76. package/dist/format/lib/document/media-manifest.json +5 -2
  77. package/dist/format/lib/document/mockup-variant-fields.d.ts +1 -0
  78. package/dist/format/lib/document/mockup-variant-fields.js +1 -1
  79. package/dist/format/lib/document/section-catalog.js +2 -2
  80. package/dist/format/lib/document/section-descriptions.js +1 -1
  81. package/dist/format/lib/editor-words-catalogue.d.ts +25 -11
  82. package/dist/format/lib/editor-words-catalogue.js +4 -4
  83. package/dist/format/lib/fonts.js +1 -1
  84. package/dist/format/lib/sections/divider-style.d.ts +4 -0
  85. package/dist/format/lib/sections/divider-style.js +1 -1
  86. package/dist/format/lib/sections/hero-single-to-hero.js +1 -1
  87. package/dist/format/lib/sections/section-presets.js +1 -1
  88. package/dist/format/lib/source-rules/editor-words.js +2 -2
  89. package/dist/format/lib/source-rules/mirrored-rows-agree.js +4 -4
  90. package/dist/format/lib/source-rules/shape-rows-use-the-picker.d.ts +7 -0
  91. package/dist/format/lib/source-rules/shape-rows-use-the-picker.js +2 -0
  92. package/dist/format/lib/text-styles/site-text-colours.d.ts +2 -9
  93. package/dist/format/lib/text-styles/site-text-colours.js +1 -1
  94. package/dist/render/components/Breadcrumb.d.ts +2 -1
  95. package/dist/render/components/Breadcrumb.js +1 -1
  96. package/dist/render/components/CardRowContext.d.ts +1 -1
  97. package/dist/render/components/CardRowContext.js +1 -1
  98. package/dist/render/components/ContentsList.d.ts +4 -1
  99. package/dist/render/components/ContentsList.js +1 -1
  100. package/dist/render/components/CurrentRecord.d.ts +23 -0
  101. package/dist/render/components/CurrentRecord.js +1 -0
  102. package/dist/render/components/Flex.d.ts +1 -1
  103. package/dist/render/components/Flex.js +1 -1
  104. package/dist/render/components/HeroPictures.d.ts +2 -0
  105. package/dist/render/components/HeroPictures.js +1 -1
  106. package/dist/render/components/HeroPoster.d.ts +2 -1
  107. package/dist/render/components/HeroPoster.js +1 -1
  108. package/dist/render/components/HeroSection.d.ts +2 -1
  109. package/dist/render/components/HeroSection.js +1 -1
  110. package/dist/render/components/HeroSingle.d.ts +3 -1
  111. package/dist/render/components/HeroSingle.js +1 -1
  112. package/dist/render/components/HeroSlide.d.ts +3 -1
  113. package/dist/render/components/HeroSlide.js +1 -1
  114. package/dist/render/components/ImageBlock.d.ts +5 -3
  115. package/dist/render/components/ImageBlock.js +1 -1
  116. package/dist/render/components/InBoxContext.d.ts +3 -0
  117. package/dist/render/components/SiteGutterFrame.d.ts +1 -0
  118. package/dist/render/components/SiteGutterFrame.js +1 -1
  119. package/dist/render/lib/content/block-size.d.ts +2 -0
  120. package/dist/render/lib/content/block-size.js +1 -1
  121. package/dist/render/lib/content/box-show-for.d.ts +14 -0
  122. package/dist/render/lib/content/box-show-for.js +1 -0
  123. package/dist/render/lib/content/page-contents.d.ts +1 -0
  124. package/dist/render/lib/content/page-contents.js +1 -1
  125. package/dist/render/lib/content/picture-focus-rows.d.ts +13 -0
  126. package/dist/render/lib/content/picture-focus-rows.js +1 -0
  127. package/dist/render/lib/document/blocks/general/Breadcrumb/render.js +1 -1
  128. package/dist/render/lib/document/blocks/general/Contents/render.js +1 -1
  129. package/dist/render/lib/document/blocks/general/Hero/render.js +1 -1
  130. package/dist/render/lib/document/blocks/general/HeroSingle/render.js +1 -1
  131. package/dist/render/lib/document/blocks/general/HeroSlide/render.js +1 -1
  132. package/dist/render/lib/document/blocks/general/ImageBlock/render.js +1 -1
  133. package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.js +1 -1
  134. package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
  135. package/dist/render/lib/document/part-styles.d.ts +21 -7
  136. package/dist/render/lib/document/part-styles.js +2 -2
  137. package/dist/render/lib/document/passes/block-size.js +1 -1
  138. package/dist/render/lib/document/passes/index.js +1 -1
  139. package/dist/render/lib/document/passes/show-for.d.ts +2 -0
  140. package/dist/render/lib/document/passes/show-for.js +1 -0
  141. package/dist/render/lib/document/show-when.js +1 -1
  142. package/dist/render/lib/text-styles/site-text-styles.js +2 -2
  143. package/package.json +3 -3
@@ -1 +1 @@
1
- "use client";import{jsx as i,jsxs as v,Fragment as F}from"react/jsx-runtime";import{cloneElement as Fe,createContext as Dt,useContext as vt,useEffect as Ht,useId as Pe,useRef as J,useState as W}from"react";import{useEasel as de,useSelectedHost as H}from"efficient-easel/easel";import{toDateKey as Gt,fromDateKey as Mt}from"efficient-shell/format";import{say as l,editorEaselWords as x}from"../../../format/lib/editor-words.js";import{mediaValueSrc as Ae}from"../../../format/lib/media-value.js";import{LOADING_SHOWS_LABELS as Le,loadingShowsOf as Kt}from"../../../format/lib/hero-video.js";import{readHidable as Ne,hidableText as Be}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as ue,LINK_FIELD_MARKER as De,MEDIA_FIELD_MARKER as ve,SCAFFOLD_FIELD_MARKER as He,TEXT_FIELD_MARKER as w,foldMetaOf as pe,textFieldIdentifier as Ut}from"efficient-easel/draw";import Wt from"../../components/ApplyCornersToSiblings.js";import{withShowWhen as Ge}from"../../../render/lib/document/show-when.js";import $t from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as Xt,CORNER_RADIUS_MAX as Me,CORNER_RADIUS_MIN as G}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as jt,IMAGE_CORNERS_LABEL as Vt}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as zt}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as Yt,GALLERY_LAYOUTS as Q,GALLERY_LAYOUT_KEYS as qt,galleryChoices as Ke,galleryPictureCells as Zt}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as Jt}from"./shell-glyph.js";import{anchorSiblingsOf as Qt,placementPoints as en}from"../../../format/lib/hero-group-placement.js";import tn,{KEEP_HINT_CLASS as nn}from"../../components/KeepHint.js";import on from"../../components/AnchorField.js";import{AdjustIcon as rn,EyeIcon as ln,AnimationIcon as an,BackgroundIcon as sn,BorderAllIcon as cn,BlockSectionIcon as dn,ColumnWidthsIcon as Ue,ColumnsIcon as We,CornerIcon as un,DirectionDownIcon as pn,DirectionLeftIcon as fn,DirectionRightIcon as hn,DirectionUpIcon as mn,EditIcon as gn,GapIcon as bn,GridIcon as xn,GroundIcon as $e,HashIcon as Xe,HeightIcon as Sn,ImageIcon as yn,ListIcon as Cn,LocationIcon as je,PaddingBottomIcon as Ve,PaddingLeftIcon as ze,PaddingRightIcon as Ye,PaddingTopIcon as qe,PageIcon as wn,StickyIcon as _n,SearchIcon as Rn,SquareIcon as Tn,TypeIcon as In,WidthIcon as En}from"efficient-easel/icons";import{FieldGlyph as Ze}from"../../components/FieldGlyph.js";import{resolvePageBackground as On}from"../../../format/lib/content/page-background.js";import{CORNER_SIDES as Je,CORNER_SIDE_POINTS as kn,hasOwnSectionCorners as Fn,normalizeCornerSides as Qe}from"../../../format/lib/content/section-corners.js";import{enclosingPath as Pn,enclosingSection as An}from"./enclosing-section.js";import{SettingsDefaultReset as S,SettingsDrill as Ln,SettingsField as b,SettingsGroup as Nn,SettingsGroupSub as Bn,SettingsSegmented as Dn,SettingsBorder as vn,SettingsSidesEach as Hn,SettingsSwitch as fe,borderSides as Gn,borderStartEach as Mn}from"efficient-easel/panel";import{ListField as Kn}from"efficient-easel/fields";import{DisplayChips as Un}from"efficient-shell/ui";import{desktopDisplayChanged as Wn,partShownOnDesktop as $n,partShownOnPhone as Xn,phoneDisplayChanged as jn,withDesktopPart as Vn,withPhonePart as zn}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as Yn,Checkbox as qn,ColorSwatch as Zn,CornersInput as Jn,DatePicker as Qn,DateTimePicker as eo,FOCAL_DEFAULT as to,PictureTiles as no,IconPicker as oo,IconButton as et,InputNumber as tt,Slider as ro,Tooltip as ee}from"efficient-shell/ui";import{LOOKUP_BUSY_NOTE as io}from"./geocode-resolve.js";import{ColourRow as nt,InheritedColourRow as ot}from"./ColourControl.js";import{keptByRow as lo}from"efficient-easel/screen/lib/document/style-fields";import rt from"./MarkupToolbar.js";import{deviceField as _}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as ao,NoControlMark as so,noControlField as it}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as co}from"../../../format/lib/document/own-box.js";import{PHONE_CLEAR as uo,resolvePhoneValue as he}from"../../../format/lib/document/phone-override.js";import{phoneKey as I,tabletKey as M}from"efficient-easel/draw";import{SuppressibleText as po}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as fo,CARD_OUTLINE_OPTIONS as ho,DEFAULT_CARD_INDEX_FORMAT as mo,DEFAULT_CARD_OUTLINE as go}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as bo,DEFAULT_COVER_INDEX as xo}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as So}from"efficient-easel/draw";import yo from"../../components/MediaUploadField.js";import Co from"../../components/MultiSelectField.js";import wo from"../../components/SectionThemePicker.js";import _o from"../../components/SearchSelectField.js";import Ro from"../../components/StorefrontLinkField.js";import{UiIcon as lt}from"efficient-easel/draw/client";import{SECTION_PADDING as R}from"../../../render/lib/content/section-padding.js";import{buttonWordsSummary as To}from"../../../render/lib/content/button-look.js";import{usePreviewParts as Io}from"efficient-easel/draw/client";import{encodePartId as Eo}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as Oo,useEaselStrings as ko}from"efficient-easel/strings";import{hasPhoneHeight as Fo,hasTabletHeight as me,resolveSectionMinHeight as Po,resolveTabletHeight as Ao}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as te,SECTION_STICK_LABEL as ge,hasPhoneStick as Lo,hasTabletStick as No,resolveSectionStick as at}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as Bo,SECTION_MIN_HEIGHT_GROUP_LABEL as $,SECTION_SCREEN_PCT as Do}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as vo,resolveContainerDirection as st}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as Ho,BOX_BLOCK_SPACING_POINTS as ct,BOX_PHONE_ROW_LABEL as dt,BOX_COLUMNS_MAX as Go,BOX_COLUMNS_MIN as ut,BOX_PHONE_ROW_MAX as Mo,BOX_PHONE_ROW_MIN as be,BOX_SHARE_LABEL as ne,BOX_SHARE_PHONE_DEFAULT as Ko,BOX_SHARE_PHONE_POINTS as Uo,BOX_SHARE_POINTS as Wo}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as L}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as $o,borderBySide as pt}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as Xo,normalizeTheme as ft,normalizeThemeColors as jo,sectionBandTone as Vo,surfaceTwoTone as zo}from"../../../format/lib/theme.js";import{CONTAINER_GAP as ht,CONTAINER_GAP_BUILT_IN as Yo,CONTAINER_GAP_PHONE as xe,GAP_FIELD_CONTAINER as Se,followsSitePhoneGap as qo,hasOwnContainerGap as Zo,hasOwnPhoneGap as ye,resolveContainerGap as mt,resolvePhoneContainerGap as gt}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as Jo,CARD_IMAGE_BG_OFF as Qo,CARD_IMAGE_BG_SWATCH_NAMES as er,CARD_IMAGE_BG_SWATCHES as tr,isCardImageBackgroundInheriting as nr,cardImageBackgroundChoice as or,THEME_CARD_IMAGE_BG as rr}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as ir,SECTION_BG_NO_FILL as lr,sectionBackgroundChoice as ar,THEME_SECTION_BG as Ce,isSectionBackgroundEmpty as sr,sectionBackgroundHex as bt}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as cr,nestedAccentValue as xt,resolveSectionAccent as oe}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as dr,TYPE_SIZE_INHERIT as ur,isTypeSizeInheriting as pr}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as fr,WIDTH_CHOICE_LABEL as hr,WIDTH_INHERIT as mr}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as gr}from"./panel-heading-scope.js";import{useEaselSession as br}from"efficient-easel/screen/lib/session-context";import{backendOf as xr}from"../website-session.js";import{BOX_GAP as Sr,describedAs as T,group as C,iconOf as X,sharedStyleKinds as j}from"efficient-easel/screen/lib/document/box-fields";import{VIEW_KEY_ACCESS as we,onDesktopWords as V,phoneTwinFields as re}from"efficient-easel/screen/lib/document/box-fields";import{directionField as yr,gapField as _e,Segmented as Re,segmented as Cr,select as z,slider as K}from"./box-fields.js";function ia({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function N(e,t){return l("{value} from {from}",{value:e,from:t})}function wr(){const{blockGap:e}=L();return e===null?l("this container's own spacing"):N(`${e}px`,l("Styles"))}function _r({inherited:e,onReset:t,label:n}){return i(S,{words:x()?.panel,label:l(n),changed:!e,detail:wr(),onReset:t})}function Rr(e){return _e({...Sr,builtIn:Yo[e],resolve:(t,n)=>mt(e,t,n?.siteGap),action:(t,n)=>i(_r,{inherited:!Zo(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[Se]:e}})}function Tr(e){return Ge(_("mobile",{[Se]:e,type:"custom",render:t=>i(Or,{container:e,...t})}),St)}function Ir(e){return Ge(_("tablet",{[Se]:e,type:"custom",render:t=>i(Er,{container:e,...t})}),St)}const St={not:{field:"gap",in:Array.from({length:-ht.min},(e,t)=>ht.min+t)}};function la(e){return{gap:_("desktop",Rr(e)),[M("gap")]:Ir(e),[I("gap")]:Tr(e)}}function Er({container:e,...t}){const[n]=P("gap"),{siteGap:o}=t.field??{},r=Math.max(xe.min,mt(e,n,o));return _e({...xe,builtIn:r,resolve:s=>ye(s)?s:r,action:(s,c)=>i(S,{words:x()?.panel,label:l("Gap"),changed:ye(s),detail:V(d=>l(d),`${r}px`),onReset:()=>c(void 0)})}).render(t)}function Or({container:e,...t}){const[n]=P("gap"),{siteGap:o,siteGapPhone:r}=t.field??{},a=gt(e,void 0,n,o,r);return _e({...xe,builtIn:a,resolve:c=>gt(e,c,n,o,r),action:(c,d)=>i(S,{words:x()?.panel,label:l("Gap"),changed:ye(c),detail:N(`${a}px`,qo(e,n,r)?l("Styles"):l("Desktop")),onReset:()=>d(void 0)})}).render(t)}function aa(e){return yr({offered:vo(e),fallback:st(e,void 0),resolve:t=>st(e,t)})}function sa(e,t){return en(t?Qt(e,t):[],t)}function kr({inherited:e,onReset:t,label:n}){return i(S,{words:x()?.panel,label:l(n),changed:!e,detail:N(l("Full"),l("the page")),onReset:t})}function B({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:a,hideable:s=!0,markup:c=!0}){const{text:d,hidden:f}=Ne(e),h=J(null),p=J(null),u=k=>t(s?{text:k,hidden:f}:k),m=()=>t({text:d,hidden:!f}),g=s&&f,O=Pe(),y=r?Nr(r)?i("span",{className:"sf-hint-keep sf-hint-while-typing",children:l(r)}):i(tn,{children:l(r)}):void 0,Z=f?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return i(b,{label:l(n),icon:i(In,{}),htmlFor:O,className:g?"is-hidden":void 0,hint:y,action:s?i(ee,{content:Z,children:i(et,{"aria-pressed":f,"aria-label":Z,onClick:m,children:f?i(lt,{name:"eye-off",size:14}):i(lt,{name:"eye",size:14})})}):void 0,children:v("div",{className:"sf-copybox",children:[c&&i(rt,{target:a?p:h,value:d,onChange:u}),a?i("textarea",{id:O,ref:p,value:d,placeholder:o===void 0?void 0:l(o),onChange:k=>u(k.target.value)}):i("input",{id:O,ref:h,type:"text",value:d,placeholder:o===void 0?void 0:l(o),onChange:k=>u(k.target.value)})]})})}function ca(e,t){return{...e,[He]:t}}function da(e){const t=e[w];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[w]:{...t,offPage:!0}}}function ua(e){return!e||typeof e!="object"?!1:e[w]?.offPage===!0}const yt="sfPanelOnly";function pa(e){if(!e[w])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[yt]:!0}}function fa(e){return!!e&&typeof e=="object"&&e[yt]===!0}function ha(e){const t=e[w];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[w]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as Es,SCALAR_TEXT_CONTROLS as Os}from"efficient-easel/draw";function ma(e,t){if(!e[w])throw new Error("inOwnBox: the field holds no authored text");const{[ao]:o,...r}=e;return{...r,[co]:!0,render:t}}const Fr=new Set(So),Y={type:"radio",options:[{value:!0},{value:!1}]},Ct={text:{type:"object",objectFields:{text:{type:"text"},hidden:Y}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:Y}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},D=(e,t)=>{const n=T({...t,[w]:e},{...Ct[e.control],label:e.label});if(!Fr.has(e.control))return n;const o=t.render;return{...it(n,"authored-copy"),render:r=>i(po,{name:r.name,children:o(r)})}},ga="Everything else on this block comes from the linked post. Unlink it to edit by hand.",Pr={field:"source.slug",set:!0},ba={not:Pr},Ar="Select a word, then press the highlighter.",Lr=new Set([Ar]),Nr=e=>Lr.has(e);function xa(e,t,n){return D({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(B,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function Sa(e,t,n){return D({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(B,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function ya(e,t,n){return D({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(B,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function Ca(e,t,n){return D({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(B,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function wa(e){return{type:"custom",[De]:{label:e},...T({},{type:"text",label:e}),render:({value:t,onChange:n})=>i(Ro,{value:Be(t),onChange:n,label:e})}}function _a(e,t,n){return D({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(B,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const Ra={Design:rn,Animation:an};function Ta(e){return{type:"custom",render:()=>i(Br,{text:e})}}function Br({text:e}){return i("p",{className:"sf-note",children:l(e)})}function Ia(e){return pe(e)!==null&&e?.tabs!==void 0}const wt=new Map;function Ea(e,t){const n=`${e}\0${t?t.join(""):""}`,o=wt.get(n)??{type:"custom",tabs:t,[ue]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(F,{})};return wt.set(n,o),o}const _t=new Map;function Oa(e){const t=_t.get(e)??{type:"custom",[ue]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(F,{})};return _t.set(e,t),t}function Dr(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function ka(e,t){return Dr(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(F,{})}}function Fa(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(F,{})}}function Pa({title:e,children:t}){const[n,o]=W(()=>!Te.has(e));return i(Nn,{title:e,open:n,onToggle:r=>{o(r),r?Te.delete(e):Te.add(e)},children:t})}const Te=new Set;function Aa({label:e}){return i(Bn,{title:l(e),level:gr(2)})}function vr({swatches:e,current:t,onPick:n,names:o}){const r=e.find(c=>c.toLowerCase()===t.toLowerCase()),a=r?o?.[r]:void 0,s=a?l(a):t;return v("div",{className:"sf-swatches",children:[e.map(c=>{const d=o?.[c]?l(o[c]):c;return i(ee,{content:d,children:i(Zn,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":d})},c)}),i("span",{className:"sf-swatch-hex",children:s})]})}function La(e,t,n=!1){return{type:"custom",render:({value:o,onChange:r})=>i(Hr,{label:e,builtIn:t,followsBand:n,value:o,onChange:r})}}function Hr({label:e,builtIn:t,followsBand:n,value:o,onChange:r}){const a=typeof o=="string"?o:void 0,{colors:s,n:c}=Bt(),d={background:s.background,surface:s.surface,surface2:zo(s),band:Vo(s)},f=n?Ce:t,h=sr(a,t,f),p=bt(void 0,f,d),u=n?ir:void 0,m=ar(a,t),g=f===Ce?l("the theme's section background"):l("Theme {n} background",{n:c});return i(ot,{label:l(e),icon:i(sn,{}),value:h?"":bt(a,t,d),inherited:p,resetTo:N(p.toUpperCase(),g),onChange:r,onReset:()=>r(u),choices:[{label:l("No fill"),color:"",selected:m==="none",onPick:()=>r(lr)},{label:`${l("Section band")} · ${d.band.toUpperCase()}`,color:d.band,selected:m==="band",onPick:()=>r(Ce)}]})}function Gr(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,a=nr(r,t);return i(b,{label:l(e),icon:i($e,{}),changed:!a,action:i(S,{words:x()?.panel,label:l(e),changed:!a,detail:l("the theme's image stage"),onReset:()=>o(Jo)}),children:vr({swatches:tr,current:a?rr:or(r,t),onPick:o,names:er})})}}}function Na(e=n=>n,t){return j({_gSectionTheme:C(cr),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(wo,{value:e(n),onChange:o,followLabel:t})}})}function q({min:e,max:t,step:n,value:o,onChange:r,suffix:a="",readout:s=!0,notch:c,ariaLabel:d,disabled:f=!1,placeholder:h}){const p=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:p?"sf-slider has-notch":"sf-slider",style:p?{"--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}:{},suffix:a||void 0,showInput:s,label:d===void 0?void 0:l(d),disabled:f,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:u=>{u!==null&&u!==o&&r(u)}})})}function Rt(e,t){const{min:n,max:o,step:r=1,unsetLabel:a,hint:s,restTrack:c,unsetMark:d,icon:f,unit:h="px"}=t;return{type:"custom",render:({value:p,onChange:u})=>{const m=typeof p=="number"?p:null,g=m===null;return i(b,{label:l(e),icon:f?X(f):void 0,value:g?d||a===void 0?void 0:l(a):`${m}${h}`,changed:!g,action:d?Fe(d,{changed:!g,onReset:()=>u(null)}):i(S,{words:x()?.panel,label:l(e),changed:!g,onReset:()=>u(null)}),hint:typeof s=="string"?l(s):s,children:c?c({min:n,max:o,step:r,px:m,label:e,onChange:u}):q({min:n,max:o,step:r,value:m??n,readout:!1,ariaLabel:e,onChange:u})})}}}const ie="Corners";function Ie(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,r=o!==null;return i(b,{label:l(ie),icon:i(un,{}),changed:r,action:Fe(e.mark,{changed:r,onReset:()=>n(null)}),hint:e.hint,children:i(Kr,{tier:e,px:o,onRadius:n})})}}}function P(e){const t=H();return[t?.values?.[e],n=>t?.onChange(e,n)]}function Tt(){return it({type:"custom",render:()=>i(so,{})},"always")}function Mr(){const e=H();return t=>e?.onChangeMany(t)}function Kr({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),[r,a]=P(e.sidesKey),s=Qe(r)??[...Je];return i(Jn,{label:l(ie),value:s,corners:kn,onChange:c=>{const d=Qe(c)??[];a(d.length===Je.length?null:d)},radius:t,onRadiusChange:n,radiusMin:G,radiusMax:Me,radiusStep:e.step??1,radiusPlaceholder:String(o)})}function It(){return Tt()}function Ur({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=L(),r=typeof o=="number"?`${o}px`:l("not set");return i(S,{words:x()?.panel,label:l(e),changed:t,detail:o==null?l("the built-in corners"):N(r,l("Styles")),onReset:n})}function Wr(){const{cornerRadiusPx:e}=L();return typeof e=="number"?e:G}function $r(){return Ie({sidesKey:"sectionCornerSides",useFollowed:Wr,mark:i(Ur,{label:ie}),hint:Xr})}const Xr="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function Ba(){return j({_gShape:C("Shape"),sectionCorners:$r(),sectionCornerSides:It(),...U("sectionBorder",Et)})}const jr=()=>({width:l("Border width"),sides:{top:l("Border top"),right:l("Border right"),bottom:l("Border bottom"),left:l("Border left")},style:l("Border style"),styles:{solid:l("Solid"),dashed:l("Dashed"),dotted:l("Dotted")},color:l("Border color"),unit:"px"});function Vr(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function zr(){let e;try{const t=ft(L().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||Xo.line}function Yr({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:a=!0,above:s={}}){const c=e&&typeof e=="object"?e:{},[d,f]=W(()=>r?Mn(c,s):!1),h=jr(),p=u=>Vr(r&&a?u:{width:u.width,color:u.color,...a?{style:u.style}:{}});return i(b,{label:l("Border"),icon:i(cn,{}),action:r?i(Hn,{each:d,label:l("Each side"),onChange:f}):void 0,children:i(vn,{label:l("Border"),value:c,each:d,onChange:u=>t(p(u)),placeholder:n,presets:o,words:h,styles:a,max:$o})})}function qr({value:e,onChange:t,view:n}){const[o]=P("sectionBorder"),[r]=P(M("sectionBorder")),a=zr(),s=d=>d&&typeof d=="object"?d:{},c=n==="phone"?{...pt(s(o)),...pt(s(r))}:n==="tablet"?s(o):{};return i(Yr,{value:e,onChange:t,placeholder:{sides:Gn(c),style:c.style??"solid",color:c.color||a},presets:[a],above:c})}function Da(e){return _(e,Et(e==="mobile"?"phone":e))}function Et(e){return{type:"custom",render:({value:t,onChange:n})=>i(qr,{value:t,onChange:n,view:e})}}function U(e,t){const n=(o,r)=>re(e,t(o),we)[r];return{[e]:n("desktop",e),[M(e)]:n("tablet",M(e)),[I(e)]:n("phone",I(e))}}function va(e){return{type:"custom",render:()=>i(Zr,{partKey:e})}}function Zr({partKey:e}){const[t]=P("id"),[n]=P("_partStyles"),{textStyles:o}=L(),r=ko();let a=null;try{a=Io().select}catch{a=null}const s=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i(Ln,{name:l("Text"),preview:To(s,c,{noStyle:l("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??Oo.copy.panel).cases}),onOpen:()=>{a&&typeof t=="string"&&a(Eo(t,e))}})}function Ot(e){const{cornerRadiusPx:t}=L(),n=typeof t=="number"?t:e;let o=null;try{const{appState:a,selectedItem:s}=de(d=>d),c=s?.props?.id?String(s.props.id):void 0;o=c?An(a?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return Fn(r)?r:n}function Jr({label:e,changed:t=!1,onReset:n=()=>{}}){const o=Ot(G);return i(S,{words:x()?.panel,label:l(e),changed:t,detail:N(`${o}px`,l("the section")),onReset:n})}function Qr(){return i(F,{children:l("Follows the section's Corners until you set a number here.")})}function ei(){return Ie({sidesKey:"cardCornerSides",useFollowed:()=>Ot(G),mark:i(Jr,{label:ie}),hint:i(Qr,{})})}function ti(){return{type:"custom",render:()=>i(Wt,{})}}function Ha(e){return{...e,render:t=>i($t,{render:e.render,props:t})}}function Ga(){return{_gShape:C("Shape"),cardCorners:ei(),cardCornerSides:It(),cardCornersApplyAll:ti()}}function kt(e=Wo,t=e[0].value){return T({type:"custom",render:n=>{const{value:o,onChange:r}=n,a="follows"in n,s=n.follows,c=o!=null,d=c?o:a?s??t:o,f=e.find(p=>p.value===d)??e.find(p=>p.value===t)??e[0],h=e.find(p=>p.value===(s??t))??e[0];return i(b,{label:l(ne),icon:i(Ue,{}),value:l(f.label),action:a?i(S,{words:x()?.panel,label:l(ne),changed:c,detail:V(p=>l(p),l(h.label),n.followsView),onReset:()=>r(void 0)}):void 0,children:i(no,{className:"sf-gallery-layouts",label:l(ne),value:f.value,onChange:r,options:e.map(p=>({value:p.value,label:l(p.label),picture:i("span",{className:"sf-gallery-pic",children:ni(p.weights).map((u,m)=>i("i",{style:{gridColumn:`span ${u}`}},m))})}))})})}},{type:"select",label:ne,options:e.map(n=>({value:n.value,label:n.label}))})}function ni(e){if(!e)return[3,4];const t=e.reduce((n,o)=>n+o,0);return e.map(n=>Math.round(n/t*12))}function Ma(){return z(Ho,i(bn,{}),ct,ct[0].value)}function Ka(){return _("mobile",kt(Uo,Ko))}function Ua(){return re("share",kt(),we)[M("share")]}function oi(){return _("mobile",K(dt,i(We,{}),be,Mo,1,be,"",{clear:{phoneFollows:!1,hint:be}}))}const Ft={read:e=>e.phoneRow,write:(e,t,n)=>({phoneRow:n}),fieldKey:()=>"phoneRow",ownField:!0};function Wa(){const e=K(dt,i(We,{}),ut,Go,1,ut,"",{clear:{emptyLabel:"Auto"}}),t=re("columns",e,{...Ft,tablet:we.tablet}),n=re("columns",e,Ft,{phoneRow:oi()});return{...t,phoneRow:n.phoneRow}}function $a(e,t,n,o,r,a){return{type:"custom",render:({value:s,onChange:c})=>i(b,{label:l(e),icon:i(Ze,{noun:a}),action:i(S,{words:x()?.panel,label:l(e),changed:!pr(s),detail:l("the Text style in Styles"),onReset:()=>c(ur),defaultAction:{onPress:()=>c(dr),title:l("Keep this section's own built-in size"),icon:i(dn,{})}}),children:q({min:t,max:n,step:o,value:typeof s=="number"?s:r,suffix:"px",ariaLabel:e,onChange:c})})}}function Xa(){return{_gCellWidth:C("Cell width"),gridSpan:z("Positions",i(Ue,{}),[{label:"Auto",value:""},...Array.from({length:zt},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function E(){let e=null,t=null;try{e=vt(ri),t=de(n=>n).selectedItem}catch{t=null}return e??t?.props??{}}const ri=Dt(null);function ii({min:e,max:t,step:n,px:o,label:r,onChange:a,desktopKey:s,fallback:c}){const d=E()[s],f=he(void 0,d,c);return i(F,{children:q({min:e,max:t,step:n,value:he(o,d,c),readout:!1,ariaLabel:r,notch:f,onChange:a})})}function li({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:a=()=>{}}){const s=E()[t],c=he(void 0,s,n);return i(S,{words:x()?.panel,label:l(e),changed:r,detail:V(d=>l(d),`${c}${o}`),onReset:a})}function ai(e){return Rt(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:i(li,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:t=>i(ii,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const si={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},ci={Top:qe,Bottom:Ve,Left:ze,Right:Ye},di=e=>{const t=ci[e];return i(t,{})};function ja(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=y=>si[y],a=y=>K(r("Top"),i(qe,{}),R.min,R.max,R.step,y,"px"),s=(y,Z,k,ce=R)=>_("mobile",ai({label:r(y),icon:di(y),desktopKey:Z,min:ce.min,max:ce.max,step:ce.step,fallback:k})),c=e.top??R.min,d=e.bottom??R.min,f="sectionPaddingLeft",h="sectionPaddingRight",p=e.sideBounds??R,u=e.side??p.min,m=e.sidePhone??u,g=e.phone===!0,O=y=>g?_("desktop",y):y;return j({...o?{_gSpacing:C("Padding")}:{},[t]:O(a(c)),...g?{[I(t)]:s("Top",t,c)}:{},...e.only==="top"?{}:{[n]:O(K(r("Bottom"),i(Ve,{}),R.min,R.max,R.step,d,"px")),...g?{[I(n)]:s("Bottom",n,d)}:{}},...e.sides?{[f]:O(K(r("Left"),i(ze,{}),p.min,p.max,p.step,u,"px")),...g?{[I(f)]:s("Left",f,m,p)}:{},[h]:O(K(r("Right"),i(Ye,{}),p.min,p.max,p.step,u,"px")),...g?{[I(h)]:s("Right",h,m,p)}:{}}:{}})}function Va(e,t){const n=Object.fromEntries(Object.entries(t).map(([a,s])=>[a,a in e&&pe(s)?e[a]:s])),o={};let r=!1;for(const[a,s]of Object.entries(e)){if(a in t){r||Object.assign(o,n),r=!0;continue}o[a]=s}return r||Object.assign(o,n),o}const le="Width";function za(e,t=fr,n=!0){const o=t.map(r=>({label:hr[r],value:r}));return j({...n?{_gWidth:C(le)}:{},widthMode:{type:"custom",render:({onChange:r,field:a})=>i(b,{label:l(le),icon:i(En,{}),action:n?i(kr,{inherited:a?.inherited??!1,onReset:()=>r(mr),label:le}):void 0,children:Re({options:o,value:a?.currentValue||e,onChange:r,ariaLabel:le})})}})}function Ya(){const e=(o,r)=>({type:"custom",render:({value:a,onChange:s})=>i(ui,{value:a,onChange:s,view:o,badge:r})}),t=o=>({type:"custom",render:({value:r,onChange:a,field:s})=>i(fi,{value:r,onChange:a,unit:s?.unit,view:o})}),n=o=>{const r=Cr("Unit",i(Xe,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");if(o==="desktop")return r;const a=r.render;return{...r,render:s=>i(hi,{props:s,draw:a,view:o})}};return j({_gHeight:C($),...U("sectionHeightMode",o=>o==="desktop"?e(o):e(o,r=>i(mi,{view:o,onClear:()=>r(void 0)}))),...U("sectionHeightValue",t),...U("sectionHeightUnit",n)})}function ui({value:e,onChange:t,view:n,badge:o}){const r=E(),a=c=>["auto","fixed","screen"].includes(c),s=ae(n,r)?.mode??"auto";return i(b,{label:$,icon:X(i(Sn,{})),action:o?o(t):void 0,children:Re({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:a(e)?e:s,onChange:t,ariaLabel:$})})}function Pt(e,t){return e==="phone"&&me(t)?Ao(t):Po(t)}function ae(e,t){return e==="desktop"||(e==="tablet"?me(t):Fo(t))?null:Pt(e,t)}const A=(e,t)=>e==="tablet"?M(t):I(t);function pi(e,t,n,o){const r=ae(e,t);return!r||e==="desktop"?null:o===void 0?{}:{[A(e,"sectionHeightMode")]:r.mode,...r.mode==="fixed"?{[A(e,"sectionHeightUnit")]:r.unit}:{},...n==="sectionHeightUnit"?{[A(e,"sectionHeightValue")]:r.value}:{},[A(e,n)]:o}}function At(e,t,n){const o=H(),r=ae(e,E());return!o||!r?{followed:null,write:n}:{followed:r,write:s=>o.onChangeMany(c=>{const d=pi(e,c,t,s);return d===null?{[e==="desktop"?t:A(e,t)]:s}:Object.keys(d).length?d:null})}}function fi({value:e,onChange:t,unit:n,view:o}){const{followed:r,write:a}=At(o,"sectionHeightValue",t),s=(r?r.unit:n)==="%"?"%":"px",c=s==="%"?Do:Bo;return i("div",{className:"sf-field",children:q({min:c.min,max:c.max,step:c.step,value:r?null:typeof e=="number"?e:c.fallback,...r?{placeholder:r.value}:{},suffix:s,ariaLabel:$,onChange:a})})}function hi({props:e,draw:t,view:n}){const{followed:o,write:r}=At(n,"sectionHeightUnit",e.onChange);return t({...e,...o?{value:void 0,storedValue:void 0,follows:o.unit}:{},onChange:r})}function mi({view:e,onClear:t}){const n=E(),o=ae(e,n)===null,r=e==="phone"&&me(n),a=Pt(e,n),s=V(c=>l(c),a.mode==="auto"?l("Auto"):`${a.value}${a.unit}`,r?"tablet":"desktop");return i(S,{words:x()?.panel,label:l($),changed:o,detail:s,onReset:t})}function qa(){const e=n=>({type:"custom",render:({value:o,onChange:r,id:a,name:s})=>i(xi,{value:o,onChange:r,labelId:`${a??s??"stickTop"}-label`,view:n})}),t=n=>({type:"custom",render:({value:o,onChange:r})=>i(gi,{value:o,onChange:r,view:n})});return{_gStick:C(ge),...U("stickTop",e),...U("stickTopDistance",t)}}function gi({value:e,onChange:t,view:n}){const o=H(),r=E(),a=n==="desktop"||Ee(n,r)?null:Lt(n,at(r)),s=a&&o?c=>o.onChangeMany(d=>{const f=bi(n,d,c);return f===null?{[A(n,"stickTopDistance")]:c}:Object.keys(f).length?f:null}):t;return i("div",{className:"sf-field",children:q({min:te.min,max:te.max,step:te.step,value:a?null:typeof e=="number"?e:te.fallback,...a?{placeholder:a.distance}:{},suffix:"px",ariaLabel:l("Distance from top"),onChange:s})})}function Ee(e,t){return e==="tablet"?No(t):Lo(t)}function Lt(e,t){return e==="phone"?{on:t.tablet,distance:t.tabletDistance}:{on:t.desktop,distance:t.desktopDistance}}function bi(e,t,n){return e==="desktop"||Ee(e,t)?null:n===void 0?{}:{[A(e,"stickTop")]:!0,[A(e,"stickTopDistance")]:n}}function xi({value:e,onChange:t,labelId:n,view:o}){const r=E(),a=at(r),s=o==="phone"?a.phone:o==="tablet"?a.tablet:e===!0,c=o==="phone"&&a.ownTablet,d=o==="desktop"?null:Lt(o,a),f=d?.on?`${d.distance}px`:l("Off");return i(b,{label:l(ge),labelId:n,icon:X(i(_n,{})),action:v(F,{children:[o!=="desktop"?i(S,{words:x()?.panel,label:l(ge),changed:Ee(o,r),detail:V(h=>l(h),f,c?"tablet":"desktop"),onReset:()=>t(void 0)}):null,i(fe,{checked:s,onChange:t,ariaLabelledBy:n})]})})}const Nt="e.g. about";function Za(){return{_gAnchor:C("Anchor"),anchor:D({control:"plainText",label:"Name",placeholder:Nt},{type:"custom",render:({value:e,onChange:t})=>i(on,{value:e,onChange:t,nameBox:(n,o)=>i(B,{value:n,onChange:o,label:"Name",placeholder:Nt,hideable:!1,markup:!1})})})}}function Ja(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:a,name:s})=>{const c=`${a??s??e}-datetime`,d=Date.parse(typeof o=="string"?o:"");return i(b,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(eo,{id:c,value:Number.isFinite(d)?new Date(d):null,onChange:f=>r(f?f.toISOString():"")})})}}}function Qa(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:a,name:s})=>{const c=`${a??s??e}-date`;return i(b,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(Qn,{id:c,value:Mt(typeof o=="string"?o:null),onChange:d=>r(d?Gt(d):"")})})}}}function Si(e,t,n,o){return{type:"custom",...T({},{...Y,label:e}),render:({value:r,onChange:a,id:s,name:c})=>{const d=typeof r=="boolean"?r:t,f=`${s??c??e}-label`;return i(b,{label:l(e),labelId:f,icon:n,hint:o===void 0?void 0:l(o),action:i(fe,{checked:d,onChange:a,ariaLabelledBy:f})})}}}function es(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i(nt,{label:l("Background"),icon:i(wn,{}),id:r,value:On(e),onChange:t})}}}function ts(e,t){return{type:"custom",...T({},{...Y,label:e}),render:({value:n,onChange:o,id:r})=>{const a=typeof n=="boolean"?n:t,s=`${r??e}-checkbox`;return i(b,{label:l(e),htmlFor:s,className:"sf-checkbox",action:i(qn,{id:s,checked:a,onChange:o})})}}}function ns(e,t,n){return{type:"custom",render:({value:o,onChange:r})=>i(nt,{label:l(e),icon:n,value:o||t,onChange:r})}}function os(){return{type:"custom",render:({value:e,onChange:t})=>i(yi,{value:typeof e=="string"?e:"",onChange:t})}}function yi({value:e,onChange:t}){const{hex:n,n:o}=wi();return i(ot,{label:l("Fill"),icon:i($e,{}),value:e,inherited:n,resetTo:N(n.toUpperCase(),l("Theme {n} background",{n:o})),onChange:t,onReset:()=>t("")})}function Ci(e,t,n){if((e?.content??[]).some(s=>s?.props?.id===t))return oe(n);const r=Pn(e,t);if(r.length===0)return null;const a=oe(xt(n));if(a!==null)return a;for(let s=r.length-1;s>0;s-=1){const c=oe(xt(r[s].sectionAccent));if(c!==null)return c}return oe(r[0].sectionAccent)}function wi(){const{colors:e,n:t}=Bt();return{hex:e.background,n:t}}function Bt(){const e=ft(L().theme),[t]=P("sectionAccent");let n=null;try{const{appState:r,selectedItem:a}=de(c=>c),s=a?.props?.id?String(a.props.id):void 0;n=s?Ci(r?.data,s,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{colors:jo(e.themes[o]),n:o+1}}const _i=[{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 Ri({label:e,value:t,onChange:n,points:o=_i}){const r=o.map(a=>({...a,label:l(a.label),...a.title?{title:l(a.title)}:null}));return i(Yn,{label:l(e),value:t,points:r,onChange:n})}function rs(){return Tt()}const is={top:i(mn,{}),right:i(hn,{}),bottom:i(pn,{}),left:i(fn,{})};function ls(e,t,n,o,r,a,s){const c=p=>t.find(u=>u.value===p),d=p=>({value:p,label:"",disabled:!0,title:o}),f=p=>{const u=t.find(g=>g.cell===p);if(!u)return d(`missing-${p}`);const m=a?.[p];return m?{value:u.value,label:u.label,icon:m}:{value:u.value,label:u.label}},h=[d("corner-top-left"),f("top"),d("corner-top-right"),f("left"),d("centre"),f("right"),d("corner-bottom-left"),f("bottom"),d("corner-bottom-right")];return{type:"custom",render:({value:p,onChange:u})=>{const m=t.some(g=>g.value===p)?p:n;return i(b,{label:l(e),icon:r,value:c(m)?.label?l(c(m).label):s?l(s):"",children:Ri({label:e,value:m,onChange:u,points:h})})}}}function as(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:a})=>i(Co,{label:e,options:(a.options??t).map(s=>({...s,label:l(s.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:l(n)}:{}})}}function ss(e,t,n,o){return{type:"custom",options:t,fallback:n,...T({},{type:"select",label:e}),render:({value:r,onChange:a,field:s})=>i(_o,{label:e,options:(s.options??t).map(c=>({...c,label:l(c.label)})),fallback:s.fallback??n,value:r,onChange:a,placeholder:o===void 0?void 0:l(o)})}}function cs(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}const ds=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function us(e,t,n){const o=Object.keys(Le).map(r=>({label:Le[r],value:r,picture:n[r]}));return{type:"custom",...T({},{type:"radio",label:e,options:o.map(r=>({value:r.value,label:r.label}))}),render:({onChange:r})=>i(Ti,{label:e,icon:t,options:o,onChange:r})}}function Ti({label:e,icon:t,options:n,onChange:o}){const r=H()?.values??{},a=Kt(r),s=a==="frame"&&!!Ae(r.mediaVideo)&&!Ae(r.videoFrame);return i(b,{label:l(e),icon:X(t),hint:s?l("This video has no frame yet. The slide shows its background colour until one is made."):void 0,children:Re({options:n,value:a,onChange:o,ariaLabel:e})})}function ps(e,t,n,o={}){return{type:"custom",[ve]:!0,render:({value:r,onChange:a,name:s})=>i(yo,{value:r||"",onChange:a,fieldKey:s,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen,frameKey:o.frame})}}const fs={HeroSingle:["imageFocal"],HeroSlide:["videoFrame"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function Ii(e){const t=l(e.status??"");return e.ok&&typeof e.lat=="number"&&typeof e.lng=="number"?`${t} · ${e.lat.toFixed(4)}, ${e.lng.toFixed(4)}`:t}function hs({value:e,onChange:t,label:n}){const o=e||{},r=H(),a=r?r.values!==r.node.props:!0,s=!!o.pending&&a,c=!!o.pending&&!a,d=s?"var(--ink-faint)":o.ok&&!c?"var(--status-success-soft-ink)":"var(--status-danger-soft-ink)",f=!!xr(br()).geocode,h=Pe(),p=(u,m)=>t({...o,[u]:m??void 0});return v(F,{children:[i(b,{label:l(n),icon:i(je,{}),action:f?i(ee,{content:l("Find from the address (OpenStreetMap)"),children:i(et,{"aria-label":l("Find from the address"),"aria-busy":s||void 0,disabled:s,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:i(Rn,{})})}):void 0,children:f&&o.status?i(ee,{content:Ii(o),className:"sf-name-tip",children:i("div",{className:`es-field-hint ${nn}`,style:{margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0,color:d},children:s?l("Finding…"):c?l(io):l(o.status)})}):null}),i(b,{label:l("Enter by hand"),labelId:h,icon:i(gn,{}),action:i(fe,{checked:!!o.manual,onChange:u=>t({...o,manual:u}),ariaLabelledBy:h})}),o.manual&&i(b,{label:l("Latitude, longitude"),icon:i(je,{}),children:v("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[i(tt,{value:typeof o.lat=="number"?o.lat:null,onChange:u=>p("lat",u),min:-90,max:90,step:1e-4,placeholder:l("Latitude")}),i(tt,{value:typeof o.lng=="number"?o.lng:null,onChange:u=>p("lng",u),min:-180,max:180,step:1e-4,placeholder:l("Longitude")})]})})]})}function Ei(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function Oi(e,t,n){const o=e.map(r=>({text:r?.text??""}));return t===null||t<0||t>=e.length?o:o.map((r,a)=>a===t?{text:n}:r)}function ms(e,t){return e===null?null:t>e?e:null}function ki(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 gs={label:"Ticker items",icon:i(Cn,{})};function bs(e,t,n,o){return{type:"custom",[w]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...T({},{...Ct.textList,label:e}),render:({value:r,onChange:a})=>i(Fi,{label:e,icon:X(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:a,markup:o==="markup"})}}function Fi({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:a=!1}){const s=J(null),[c,d]=W(null),f=p=>p.map(u=>({text:u?.text??""})),h=p=>{const u=ki(n,p,c);u===null&&(s.current=null),d(u),r(f(p))};return i(Kn,{label:l(e),icon:t,noun:l("item"),items:n,onChange:h,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:a?i(rt,{target:s,value:Ei(n,c),onChange:p=>r(Oi(n,c??-1,p)),disabled:c===null,label:c===null?l("Formatting — click a row first"):l("Formatting — row {n}",{n:c+1})}):void 0,renderRow:(p,u,m)=>i("input",{type:"text",className:a&&c===u?"sf-list-marking":void 0,value:p?.text??"",placeholder:l(o),"aria-label":l("{label} {n}",{label:l(e),n:u+1}),onChange:g=>m({text:g.target.value}),onFocus:g=>{s.current=g.currentTarget,d(u)}})})}function xs(e,t){const n=`${e.label} — row ${t+1}`;return D({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>i(B,{value:o,onChange:r,label:l("{label} — row {n}",{label:l(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function Ss(e){return{_gCards:C("Cards"),coverIndex:z("Cover image",i(yn,{}),bo,String(xo),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:Gr("Image background",Qo),cardImage:Li()}}function ys(){return{outline:z("Card outline",i(Tn,{}),ho,go),indexBadge:z("Card number",i(Xe,{}),fo,mo),showBadge:Si("Product badge",!0,i(Ze,{noun:"tag"}))}}function Cs(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...Y,label:se.find(a=>a.id===r).label}),o=r=>T(lo(Oe),n(r));return{_gShowOnCard:C("Show on a card"),[Oe]:T({type:"custom",render:()=>i(Pi,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(Oe)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const Oe="showCardPrice",se=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function Pi({rest:e}){const t=E(),n=Mr(),o=s=>typeof t[s]=="boolean"?t[s]:void 0,r=s=>o(s)??e[s],a=se.some(({id:s})=>o(s)!==void 0&&o(s)!==e[s]);return i(ke,{parts:se,changed:a,shown:r,onPress:(s,c)=>n({[s]:c}),onReset:()=>n(Object.fromEntries(se.map(({id:s})=>[s,void 0])))})}function ws(e,t="display"){const n=I(t);return{[t]:_("desktop",{type:"custom",render:({value:o,onChange:r})=>i(ke,{parts:e,changed:Wn(o),shown:a=>$n(o,a),onPress:(a,s)=>r(Vn(o,a,s)),onReset:()=>r(void 0)})}),[n]:_("mobile",{type:"custom",render:({value:o,onChange:r})=>i(Ai,{parts:e,desktopKey:t,value:o,onChange:r})})}}function ke({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:a,disabledReason:s}){const c=l("Display");return i(b,{label:c,icon:i(ln,{}),changed:t,action:i(S,{words:x()?.panel,label:c,changed:t,detail:a,onReset:r}),children:i(Un,{label:c,items:e.map(d=>({id:d.id,label:l(d.label),shown:n(d.id),...s?{disabled:!0,disabledReason:l(s)}:{}})),onChange:o})})}function Ai({parts:e,desktopKey:t,value:n,onChange:o}){const r=E()[t];return i(ke,{parts:e,changed:jn(n),shown:a=>Xn(r,n,a),onPress:(a,s)=>o(zn(n,a,s)),onReset:()=>o(uo),detail:l("the same as Desktop")})}function Li(){return Rt("Card image",{min:G,max:Me,step:Xt,hint:"Rounds the picture. The card's own corner is in Styles."})}function _s(){return Ie({sidesKey:"cornerSides",step:jt,useFollowed:()=>G,mark:i(Ni,{label:Vt}),hint:l("Rounds the picture. Left alone it stays square.")})}function Ni({label:e,changed:t=!1,onReset:n=()=>{}}){return i(S,{words:x()?.panel,label:l(e),changed:t,onReset:n})}function Rs(){return{type:"custom",render:({value:e,onChange:t})=>i(Hi,{value:typeof e=="string"?e:"",onChange:t})}}function Bi({layout:e,width:t}){return i("span",{"aria-hidden":"true",style:{display:"grid",width:t,gridTemplateColumns:"repeat(12, minmax(0, 1fr))",gridAutoRows:6,gridAutoFlow:"row dense",gap:2},children:Zt(e).map(([n,o],r)=>i("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${n}`,gridRow:`span ${o}`}},r))})}const Di={width:"3.5rem",height:"2.5rem"},vi=200;function Hi({value:e,onChange:t}){const[n,o]=W(null),[r,a]=W(4),s=J(null);Ht(()=>{const u=s.current;if(!u||typeof ResizeObserver!="function")return;const m=()=>a(u.getBoundingClientRect().width>=vi?4:3);m();const g=new ResizeObserver(m);return g.observe(u),()=>g.disconnect()},[]);const c=e&&e in Q?e:"",d=Ke(n,c),f=Ke(n,"").length,h=Jt("no-symbol"),p=[{value:"",label:l("Not chosen"),icon:h},...d.map(u=>({value:u,label:l(Q[u].label),icon:i(Bi,{layout:Q[u],width:40})}))];return i(b,{label:l("Layout"),icon:i(xn,{}),value:c?l(Q[c].label):void 0,children:i("div",{ref:s,style:{flex:"1 1 auto",minWidth:0},children:i(oo,{label:l("Layout"),value:c,emptyValue:"",options:p,onChange:t,columns:r,cell:Di,header:v("div",{className:"mb-2 flex flex-col gap-1",style:{minWidth:"11rem"},children:[i("span",{className:"text-2xs text-ink-faint",children:l("Photos in a row")}),i(Dn,{options:[{id:"all",label:l("All")},...Yt.map(u=>({id:String(u),label:String(u)}))],value:n===null?"all":String(n),ariaLabel:l("Photos in a row"),onChange:u=>o(u==="all"?null:Number(u))}),i("span",{className:"text-2xs text-ink-faint",children:l("{n} of {total} layouts",{n:f,total:qt.length})})]})})})})}export{Pr as BOUND_TO_POST,ga as BOUND_TO_POST_NOTE,Ra as BUCKET_ICONS,fs as CUSTOM_FIELD_MEDIA,hs as CoordsField,St as DESKTOP_GAP_NOT_OVERLAP,ke as DisplayRow,is as EDGE_ARROWS,to as FOCAL_DEFAULT,_i as FOCAL_POINTS,ue as FOLD_FIELD_MARKER,Ri as FocalPicker,Aa as GroupLabel,Ar as HIGHLIGHT_HINT,B as HidableTextField,De as LINK_FIELD_MARKER,ia as Label,ve as MEDIA_FIELD_MARKER,ds as MEDIA_TYPE_OPTIONS,ba as NOT_BOUND_TO_POST,Pa as PanelBand,Br as PanelNoteLine,ri as RowPropsContext,He as SCAFFOLD_FIELD_MARKER,Os as SCALAR_TEXT_CONTROLS,_r as SiteGapDefaultReset,q as Slider,vr as Swatches,Es as TEXT_CONTROL_KINDS,w as TEXT_FIELD_MARKER,gs as TICKER_ITEMS_ROW,Fi as TextListField,le as WIDTH_LABEL,kr as WidthDefaultReset,ki as aimAfterListChange,Za as anchorFields,N as backTo,La as backgroundField,Ma as boxBlockSpacingField,Wa as boxColumnsFields,os as boxFillField,oi as boxPhoneRowField,kt as boxShareField,Ka as boxSharePhoneField,Ua as boxShareTabletField,Ci as boxThemeIndexOf,Ea as bucketHeader,va as buttonWordsEntryField,ei as cardCornersField,Gr as cardImageBackgroundField,Li as cardImageField,Ss as cardMediaFields,Ga as cardShapeFields,Cs as cardShowFields,ys as cardStyleFields,Xa as cellWidthFields,ts as checkbox,ns as colorInput,aa as containerDirectionField,Rr as containerGapField,Tr as containerGapPhoneField,la as containerGapRows,Ir as containerGapTabletField,Ii as coordsResultTip,Ca as copyText,It as cornerSidesField,Ie as cornersRowField,Qa as date,Ja as dateTime,Oa as designGroupHeader,ws as displayFields,ls as edgePad,ms as focusAfterRemove,rs as focusKeptField,ka as foldMarker,pe as foldMetaOf,Dr as foldTitleOf,pi as followedHeightPatch,bi as followedStickPatch,Rs as galleryLayoutField,Ya as heightFields,ae as heightFollowedBy,sa as heroGroupPlacementPoints,Be as hidableText,Nr as hintIsWhileTyping,_s as imageCornersField,ma as inOwnBox,Ia as isBucketHeader,Tt as keptBy,wa as linkField,us as loadingShowsField,as as multiSelect,es as pageBackgroundField,Ta as panelNote,ai as phoneOverrideField,ya as plainText,_a as plainTextarea,Rt as pxField,Fa as quietMarker,Ne as readHidable,Ei as rowText,ss as searchSelect,Da as sectionBorderField,$r as sectionCornersField,Ba as sectionShapeFields,Na as sectionThemeFields,Oi as setRowText,$a as sizeField,cs as sourceField,ja as spacingFields,qa as stickFields,Va as swapPadding,Ha as templateField,xa as text,Ut as textFieldIdentifier,ua as textFieldOffPage,fa as textFieldPanelOnly,bs as textList,xs as textListRowField,Sa as textarea,Si as toggle,ps as upload,Mr as useSelectedPatch,E as useSelectedProps,P as useSelectedSibling,wr as useSiteGapDetail,za as widthField,ha as withIdentifier,da as withOffPage,pa as withPanelOnly,ca as withScaffold};
1
+ "use client";import{jsx as i,jsxs as P,Fragment as L}from"react/jsx-runtime";import{cloneElement as Le,createContext as Ut,useContext as $t,useEffect as Xt,useId as Ne,useRef as j,useState as V}from"react";import{useEasel as ue,useSelectedHost as G}from"efficient-easel/easel";import{toDateKey as jt,fromDateKey as Vt}from"efficient-shell/format";import{say as l,editorEaselWords as S}from"../../../format/lib/editor-words.js";import{mediaValueSrc as Pe}from"../../../format/lib/media-value.js";import{LOADING_SHOWS_LABELS as Be,loadingShowsOf as zt}from"../../../format/lib/hero-video.js";import{readHidable as De,hidableText as ve}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as de,LINK_FIELD_MARKER as He,MEDIA_FIELD_MARKER as Ge,SCAFFOLD_FIELD_MARKER as Me,TEXT_FIELD_MARKER as E,foldMetaOf as pe,textFieldIdentifier as Yt}from"efficient-easel/draw";import qt from"../../components/ApplyCornersToSiblings.js";import{withShowWhen as We}from"../../../render/lib/document/show-when.js";import Jt from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as Zt,CORNER_RADIUS_MAX as Ke,CORNER_RADIUS_MIN as M}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as Qt,IMAGE_CORNERS_LABEL as en}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as tn}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as nn,GALLERY_LAYOUTS as te,GALLERY_LAYOUT_KEYS as on,galleryChoices as Ue,galleryPictureCells as rn}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as ln}from"./shell-glyph.js";import{anchorSiblingsOf as sn,placementPoints as an}from"../../../format/lib/hero-group-placement.js";import cn,{KEEP_HINT_CLASS as un}from"../../components/KeepHint.js";import dn from"../../components/AnchorField.js";import{AdjustIcon as pn,EyeIcon as fn,AnimationIcon as hn,BackgroundIcon as mn,BorderAllIcon as gn,BlockSectionIcon as bn,ColumnWidthsIcon as fe,ColumnsIcon as $e,CornerIcon as xn,DirectionDownIcon as Sn,DirectionLeftIcon as Cn,DirectionRightIcon as yn,DirectionUpIcon as wn,EditIcon as _n,GapIcon as Rn,GridIcon as On,GroundIcon as Xe,HashIcon as je,HeightIcon as En,ImageIcon as In,ListIcon as Tn,LocationIcon as Ve,PaddingBottomIcon as ze,PaddingLeftIcon as Ye,PaddingRightIcon as qe,PaddingTopIcon as Je,PageIcon as kn,StickyIcon as Fn,SearchIcon as An,SquareIcon as Ln,TypeIcon as Nn,WidthIcon as Pn}from"efficient-easel/icons";import{FieldGlyph as Ze}from"../../components/FieldGlyph.js";import{resolvePageBackground as Bn}from"../../../format/lib/content/page-background.js";import{CORNER_SIDES as Qe,CORNER_SIDE_POINTS as Dn,hasOwnSectionCorners as vn,normalizeCornerSides as et}from"../../../format/lib/content/section-corners.js";import{enclosingPath as Hn,enclosingSection as Gn}from"./enclosing-section.js";import{SettingsDefaultReset as C,SettingsDrill as Mn,SettingsField as x,SettingsGroup as Wn,SettingsGroupSub as Kn,SettingsSegmented as Un,SettingsBorder as $n,SettingsSidesEach as Xn,SettingsSwitch as he,borderSides as jn,borderStartEach as Vn}from"efficient-easel/panel";import{ListField as zn}from"efficient-easel/fields";import{DisplayChips as Yn}from"efficient-shell/ui";import{desktopDisplayChanged as qn,partShownOnDesktop as Jn,partShownOnPhone as Zn,phoneDisplayChanged as Qn,withDesktopPart as eo,withPhonePart as to}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as no,Checkbox as oo,ColorSwatch as ro,CornersInput as io,DatePicker as lo,DateTimePicker as so,FOCAL_DEFAULT as ao,IconPicker as tt,COLUMN_COUNT_MAX as nt,COLUMN_SHARE_MIN as co,COLUMN_SHARES_EQUAL as uo,resolveColumnShares as ot,WidthsBar as po,useShellStrings as fo,IconButton as rt,InputNumber as it,Slider as ho,Tooltip as ne}from"efficient-shell/ui";import{LOOKUP_BUSY_NOTE as mo}from"./geocode-resolve.js";import{ColourRow as lt,InheritedColourRow as st}from"./ColourControl.js";import{keptByRow as go}from"efficient-easel/screen/lib/document/style-fields";import at from"./MarkupToolbar.js";import{deviceField as R}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as bo,NoControlMark as xo,noControlField as ct}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as So}from"../../../format/lib/document/own-box.js";import{PHONE_CLEAR as Co,resolvePhoneValue as me}from"../../../format/lib/document/phone-override.js";import{phoneKey as k,tabletKey as W}from"efficient-easel/draw";import{SuppressibleText as yo}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as wo,CARD_OUTLINE_OPTIONS as _o,DEFAULT_CARD_INDEX_FORMAT as Ro,DEFAULT_CARD_OUTLINE as Oo}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as Eo,DEFAULT_COVER_INDEX as Io}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as To}from"efficient-easel/draw";import ko from"../../components/MediaUploadField.js";import Fo from"../../components/MultiSelectField.js";import Ao from"../../components/SectionThemePicker.js";import Lo from"../../components/SearchSelectField.js";import No from"../../components/StorefrontLinkField.js";import{UiIcon as ut}from"efficient-easel/draw/client";import{SECTION_PADDING as I}from"../../../render/lib/content/section-padding.js";import{buttonWordsSummary as Po}from"../../../render/lib/content/button-look.js";import{usePreviewParts as Bo}from"efficient-easel/draw/client";import{encodePartId as Do}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as vo,useEaselStrings as Ho}from"efficient-easel/strings";import{hasPhoneHeight as Go,hasTabletHeight as ge,resolveSectionMinHeight as Mo,resolveTabletHeight as Wo}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as oe,SECTION_STICK_LABEL as be,hasPhoneStick as Ko,hasTabletStick as Uo,resolveSectionStick as dt}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as $o,SECTION_MIN_HEIGHT_GROUP_LABEL as z,SECTION_SCREEN_PCT as Xo}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as jo,resolveContainerDirection as pt}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as Vo,BOX_BLOCK_SPACING_POINTS as ft,BOX_PHONE_ROW_LABEL as ht,BOX_COLUMNS_MAX as zo,BOX_COLUMNS_MIN as mt,BOX_PHONE_ROW_MAX as Yo,BOX_PHONE_ROW_MIN as xe,BOX_SHARE_CHOICES as gt,BOX_SHARE_LABEL as K,boxShareChoiceOf as bt,boxShareWidthsOf as Se,BOX_SHARE_PHONE_DEFAULT as qo,BOX_SHARE_PHONE_POINTS as Jo}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as B}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as Zo,borderBySide as xt}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as Qo,normalizeTheme as St,normalizeThemeColors as er,sectionBandTone as tr,surfaceTwoTone as nr}from"../../../format/lib/theme.js";import{CONTAINER_GAP as Ct,CONTAINER_GAP_BUILT_IN as or,CONTAINER_GAP_PHONE as Ce,GAP_FIELD_CONTAINER as ye,followsSitePhoneGap as rr,hasOwnContainerGap as ir,hasOwnPhoneGap as we,resolveContainerGap as yt,resolvePhoneContainerGap as wt}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as lr,CARD_IMAGE_BG_OFF as sr,CARD_IMAGE_BG_SWATCH_NAMES as ar,CARD_IMAGE_BG_SWATCHES as cr,isCardImageBackgroundInheriting as ur,cardImageBackgroundChoice as dr,THEME_CARD_IMAGE_BG as pr}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as fr,SECTION_BG_NO_FILL as hr,sectionBackgroundChoice as mr,THEME_SECTION_BG as _e,isSectionBackgroundEmpty as gr,sectionBackgroundHex as _t}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as br,nestedAccentValue as Rt,resolveSectionAccent as re}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as xr,TYPE_SIZE_INHERIT as Sr,isTypeSizeInheriting as Cr}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as yr,WIDTH_CHOICE_LABEL as wr,WIDTH_INHERIT as _r}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as Rr}from"./panel-heading-scope.js";import{useEaselSession as Or}from"efficient-easel/screen/lib/session-context";import{backendOf as Er}from"../website-session.js";import{BOX_GAP as Ir,describedAs as T,group as O,iconOf as Y,sharedStyleKinds as q}from"efficient-easel/screen/lib/document/box-fields";import{VIEW_KEY_ACCESS as Re,onDesktopWords as J,phoneTwinFields as ie}from"efficient-easel/screen/lib/document/box-fields";import{directionField as Tr,gapField as Oe,iconPickerRow as kr,pickerCellIcon as Fr,pickerNoneIcon as Ar,Segmented as Ee,segmented as Lr,select as Z,slider as U}from"./box-fields.js";function xs({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function D(e,t){return l("{value} from {from}",{value:e,from:t})}function Nr(){const{blockGap:e}=B();return e===null?l("this container's own spacing"):D(`${e}px`,l("Styles"))}function Pr({inherited:e,onReset:t,label:n}){return i(C,{words:S()?.panel,label:l(n),changed:!e,detail:Nr(),onReset:t})}function Br(e){return Oe({...Ir,builtIn:or[e],resolve:(t,n)=>yt(e,t,n?.siteGap),action:(t,n)=>i(Pr,{inherited:!ir(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[ye]:e}})}function Dr(e){return We(R("mobile",{[ye]:e,type:"custom",render:t=>i(Gr,{container:e,...t})}),Ot)}function vr(e){return We(R("tablet",{[ye]:e,type:"custom",render:t=>i(Hr,{container:e,...t})}),Ot)}const Ot={not:{field:"gap",in:Array.from({length:-Ct.min},(e,t)=>Ct.min+t)}};function Ss(e){return{gap:R("desktop",Br(e)),[W("gap")]:vr(e),[k("gap")]:Dr(e)}}function Hr({container:e,...t}){const[n]=F("gap"),{siteGap:o}=t.field??{},r=Math.max(Ce.min,yt(e,n,o));return Oe({...Ce,builtIn:r,resolve:a=>we(a)?a:r,action:(a,c)=>i(C,{words:S()?.panel,label:l("Gap"),changed:we(a),detail:J(u=>l(u),`${r}px`),onReset:()=>c(void 0)})}).render(t)}function Gr({container:e,...t}){const[n]=F("gap"),{siteGap:o,siteGapPhone:r}=t.field??{},s=wt(e,void 0,n,o,r);return Oe({...Ce,builtIn:s,resolve:c=>wt(e,c,n,o,r),action:(c,u)=>i(C,{words:S()?.panel,label:l("Gap"),changed:we(c),detail:D(`${s}px`,rr(e,n,r)?l("Styles"):l("Desktop")),onReset:()=>u(void 0)})}).render(t)}function Cs(e){return Tr({offered:jo(e),fallback:pt(e,void 0),resolve:t=>pt(e,t)})}function ys(e,t){return an(t?sn(e,t):[],t)}function Mr({inherited:e,onReset:t,label:n}){return i(C,{words:S()?.panel,label:l(n),changed:!e,detail:D(l("Full"),l("the page")),onReset:t})}function v({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:s,hideable:a=!0,markup:c=!0}){const{text:u,hidden:p}=De(e),m=j(null),f=j(null),d=y=>t(a?{text:y,hidden:p}:y),g=()=>t({text:u,hidden:!p}),h=a&&p,_=Ne(),w=r?Xr(r)?i("span",{className:"sf-hint-keep sf-hint-while-typing",children:l(r)}):i(cn,{children:l(r)}):void 0,b=p?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return i(x,{label:l(n),icon:i(Nn,{}),htmlFor:_,className:h?"is-hidden":void 0,hint:w,action:a?i(ne,{content:b,children:i(rt,{"aria-pressed":p,"aria-label":b,onClick:g,children:p?i(ut,{name:"eye-off",size:14}):i(ut,{name:"eye",size:14})})}):void 0,children:P("div",{className:"sf-copybox",children:[c&&i(at,{target:s?f:m,value:u,onChange:d}),s?i("textarea",{id:_,ref:f,value:u,placeholder:o===void 0?void 0:l(o),onChange:y=>d(y.target.value)}):i("input",{id:_,ref:m,type:"text",value:u,placeholder:o===void 0?void 0:l(o),onChange:y=>d(y.target.value)})]})})}function ws(e,t){return{...e,[Me]:t}}function _s(e){const t=e[E];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[E]:{...t,offPage:!0}}}function Rs(e){return!e||typeof e!="object"?!1:e[E]?.offPage===!0}const Et="sfPanelOnly";function Os(e){if(!e[E])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Et]:!0}}function Es(e){return!!e&&typeof e=="object"&&e[Et]===!0}function Is(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 Ma,SCALAR_TEXT_CONTROLS as Wa}from"efficient-easel/draw";function Ts(e,t){if(!e[E])throw new Error("inOwnBox: the field holds no authored text");const{[bo]:o,...r}=e;return{...r,[So]:!0,render:t}}const Wr=new Set(To),Q={type:"radio",options:[{value:!0},{value:!1}]},It={text:{type:"object",objectFields:{text:{type:"text"},hidden:Q}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:Q}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},H=(e,t)=>{const n=T({...t,[E]:e},{...It[e.control],label:e.label});if(!Wr.has(e.control))return n;const o=t.render;return{...ct(n,"authored-copy"),render:r=>i(yo,{name:r.name,children:o(r)})}},ks="Everything else on this block comes from the linked post. Unlink it to edit by hand.",Kr={field:"source.slug",set:!0},Fs={not:Kr},Ur="Select a word, then press the highlighter.",$r=new Set([Ur]),Xr=e=>$r.has(e);function As(e,t,n){return H({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(v,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function Ls(e,t,n){return H({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(v,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function Ns(e,t,n){return H({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(v,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function Ps(e,t,n){return H({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(v,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function Bs(e){return{type:"custom",[He]:{label:e},...T({},{type:"text",label:e}),render:({value:t,onChange:n})=>i(No,{value:ve(t),onChange:n,label:e})}}function Ds(e,t,n){return H({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(v,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const vs={Design:pn,Animation:hn};function Hs(e){return{type:"custom",render:()=>i(jr,{text:e})}}function jr({text:e}){return i("p",{className:"sf-note",children:l(e)})}function Gs(e){return pe(e)!==null&&e?.tabs!==void 0}const Tt=new Map;function Ms(e,t){const n=`${e}\0${t?t.join(""):""}`,o=Tt.get(n)??{type:"custom",tabs:t,[de]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(L,{})};return Tt.set(n,o),o}const kt=new Map;function Ws(e){const t=kt.get(e)??{type:"custom",[de]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(L,{})};return kt.set(e,t),t}function Vr(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function Ks(e,t){return Vr(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(L,{})}}function Us(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(L,{})}}function $s({title:e,children:t}){const[n,o]=V(()=>!Ie.has(e));return i(Wn,{title:e,open:n,onToggle:r=>{o(r),r?Ie.delete(e):Ie.add(e)},children:t})}const Ie=new Set;function Xs({label:e}){return i(Kn,{title:l(e),level:Rr(2)})}function zr({swatches:e,current:t,onPick:n,names:o}){const r=e.find(c=>c.toLowerCase()===t.toLowerCase()),s=r?o?.[r]:void 0,a=s?l(s):t;return P("div",{className:"sf-swatches",children:[e.map(c=>{const u=o?.[c]?l(o[c]):c;return i(ne,{content:u,children:i(ro,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":u})},c)}),i("span",{className:"sf-swatch-hex",children:a})]})}function js(e,t,n=!1){return{type:"custom",render:({value:o,onChange:r})=>i(Yr,{label:e,builtIn:t,followsBand:n,value:o,onChange:r})}}function Yr({label:e,builtIn:t,followsBand:n,value:o,onChange:r}){const s=typeof o=="string"?o:void 0,{colors:a,n:c}=Kt(),u={background:a.background,surface:a.surface,surface2:nr(a),band:tr(a)},p=n?_e:t,m=gr(s,t,p),f=_t(void 0,p,u),d=n?fr:void 0,g=mr(s,t),h=p===_e?l("the theme's section background"):l("Theme {n} background",{n:c});return i(st,{label:l(e),icon:i(mn,{}),value:m?"":_t(s,t,u),inherited:f,resetTo:D(f.toUpperCase(),h),onChange:r,onReset:()=>r(d),choices:[{label:l("No fill"),color:"",selected:g==="none",onPick:()=>r(hr)},{label:`${l("Section band")} · ${u.band.toUpperCase()}`,color:u.band,selected:g==="band",onPick:()=>r(_e)}]})}function qr(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,s=ur(r,t);return i(x,{label:l(e),icon:i(Xe,{}),changed:!s,action:i(C,{words:S()?.panel,label:l(e),changed:!s,detail:l("the theme's image stage"),onReset:()=>o(lr)}),children:zr({swatches:cr,current:s?pr:dr(r,t),onPick:o,names:ar})})}}}function Vs(e=n=>n,t){return q({_gSectionTheme:O(br),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(Ao,{value:e(n),onChange:o,followLabel:t})}})}function ee({min:e,max:t,step:n,value:o,onChange:r,suffix:s="",readout:a=!0,notch:c,ariaLabel:u,disabled:p=!1,placeholder:m}){const f=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:f?"sf-slider has-notch":"sf-slider",style:f?{"--sf-notch":(c-e)/(t-e)}:void 0,children:i(ho,{min:e,max:t,step:n,value:o,...o===null&&m!==void 0?{placeholderValue:m}:{},suffix:s||void 0,showInput:a,label:u===void 0?void 0:l(u),disabled:p,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:d=>{d!==null&&d!==o&&r(d)}})})}function Ft(e,t){const{min:n,max:o,step:r=1,unsetLabel:s,hint:a,restTrack:c,unsetMark:u,icon:p,unit:m="px"}=t;return{type:"custom",render:({value:f,onChange:d})=>{const g=typeof f=="number"?f:null,h=g===null;return i(x,{label:l(e),icon:p?Y(p):void 0,value:h?u||s===void 0?void 0:l(s):`${g}${m}`,changed:!h,action:u?Le(u,{changed:!h,onReset:()=>d(null)}):i(C,{words:S()?.panel,label:l(e),changed:!h,onReset:()=>d(null)}),hint:typeof a=="string"?l(a):a,children:c?c({min:n,max:o,step:r,px:g,label:e,onChange:d}):ee({min:n,max:o,step:r,value:g??n,readout:!1,ariaLabel:e,onChange:d})})}}}const le="Corners";function Te(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:l(le),icon:i(xn,{}),changed:r,action:Le(e.mark,{changed:r,onReset:()=>n(null)}),hint:e.hint,children:i(Zr,{tier:e,px:o,onRadius:n})})}}}function F(e){const t=G();return[t?.values?.[e],n=>t?.onChange(e,n)]}function At(){return ct({type:"custom",render:()=>i(xo,{})},"always")}function Jr(){const e=G();return t=>e?.onChangeMany(t)}function Zr({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),[r,s]=F(e.sidesKey),a=et(r)??[...Qe];return i(io,{label:l(le),value:a,corners:Dn,onChange:c=>{const u=et(c)??[];s(u.length===Qe.length?null:u)},radius:t,onRadiusChange:n,radiusMin:M,radiusMax:Ke,radiusStep:e.step??1,radiusPlaceholder:String(o)})}function Lt(){return At()}function Qr({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=B(),r=typeof o=="number"?`${o}px`:l("not set");return i(C,{words:S()?.panel,label:l(e),changed:t,detail:o==null?l("the built-in corners"):D(r,l("Styles")),onReset:n})}function ei(){const{cornerRadiusPx:e}=B();return typeof e=="number"?e:M}function ti(){return Te({sidesKey:"sectionCornerSides",useFollowed:ei,mark:i(Qr,{label:le}),hint:ni})}const ni="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function zs(){return q({_gShape:O("Shape"),sectionCorners:ti(),sectionCornerSides:Lt(),...$("sectionBorder",Nt)})}const oi=()=>({width:l("Border width"),sides:{top:l("Border top"),right:l("Border right"),bottom:l("Border bottom"),left:l("Border left")},style:l("Border style"),styles:{solid:l("Solid"),dashed:l("Dashed"),dotted:l("Dotted")},color:l("Border color"),unit:"px"});function ri(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function ii(){let e;try{const t=St(B().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||Qo.line}function li({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:s=!0,above:a={}}){const c=e&&typeof e=="object"?e:{},[u,p]=V(()=>r?Vn(c,a):!1),m=oi(),f=d=>ri(r&&s?d:{width:d.width,color:d.color,...s?{style:d.style}:{}});return i(x,{label:l("Border"),icon:i(gn,{}),action:r?i(Xn,{each:u,label:l("Each side"),onChange:p}):void 0,children:i($n,{label:l("Border"),value:c,each:u,onChange:d=>t(f(d)),placeholder:n,presets:o,words:m,styles:s,max:Zo})})}function si({value:e,onChange:t,view:n}){const[o]=F("sectionBorder"),[r]=F(W("sectionBorder")),s=ii(),a=u=>u&&typeof u=="object"?u:{},c=n==="phone"?{...xt(a(o)),...xt(a(r))}:n==="tablet"?a(o):{};return i(li,{value:e,onChange:t,placeholder:{sides:jn(c),style:c.style??"solid",color:c.color||s},presets:[s],above:c})}function Ys(e){return R(e,Nt(e==="mobile"?"phone":e))}function Nt(e){return{type:"custom",render:({value:t,onChange:n})=>i(si,{value:t,onChange:n,view:e})}}function $(e,t){const n=(o,r)=>ie(e,t(o),Re)[r];return{[e]:n("desktop",e),[W(e)]:n("tablet",W(e)),[k(e)]:n("phone",k(e))}}function qs(e){return{type:"custom",render:()=>i(ai,{partKey:e})}}function ai({partKey:e}){const[t]=F("id"),[n]=F("_partStyles"),{textStyles:o}=B(),r=Ho();let s=null;try{s=Bo().select}catch{s=null}const a=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i(Mn,{name:l("Text"),preview:Po(a,c,{noStyle:l("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??vo.copy.panel).cases}),onOpen:()=>{s&&typeof t=="string"&&s(Do(t,e))}})}function Pt(e){const{cornerRadiusPx:t}=B(),n=typeof t=="number"?t:e;let o=null;try{const{appState:s,selectedItem:a}=ue(u=>u),c=a?.props?.id?String(a.props.id):void 0;o=c?Gn(s?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return vn(r)?r:n}function ci({label:e,changed:t=!1,onReset:n=()=>{}}){const o=Pt(M);return i(C,{words:S()?.panel,label:l(e),changed:t,detail:D(`${o}px`,l("the section")),onReset:n})}function ui(){return i(L,{children:l("Follows the section's Corners until you set a number here.")})}function di(){return Te({sidesKey:"cardCornerSides",useFollowed:()=>Pt(M),mark:i(ci,{label:le}),hint:i(ui,{})})}function pi(){return{type:"custom",render:()=>i(qt,{})}}function Js(e){return{...e,render:t=>i(Jt,{render:e.render,props:t})}}function Zs(){return{_gShape:O("Shape"),cardCorners:di(),cardCornerSides:Lt(),cardCornersApplyAll:pi()}}function fi(){return T({type:"custom",render:e=>i(mi,{...e})},{type:"select",label:K,options:[{value:"content",label:"Fit content"},{value:"equal",label:"Equal"},{value:[50],label:"Custom: the width of each block in %, the last block left out"}]})}function hi(e,t){const n=bt(e);if(n!=="custom")return l(gt.find(r=>r.value===n)?.label??"");const o=ot(Se(e,t),t);return o?[...o,100-o.reduce((r,s)=>r+s,0)].join(" / "):l("Custom")}function mi(e){const{value:t,onChange:n}=e,[o]=F("content"),r=Array.isArray(o)?o.length:0,s="follows"in e,a=t!=null,c=a?t:s?e.follows:void 0,u=bt(c),p=r>=2&&r<=nt,m=()=>[...uo[r]??[]],f=j(null),d=b=>{const y=f.current;y&&JSON.stringify(b)===JSON.stringify(y.shares)?n(y.value):b&&n(b)},g=b=>{b===u||b==="custom"&&!p||n(b==="custom"?m():b)},h=l("The width bar works for 2 to {count} blocks.",{count:nt}),_=a&&(s||t!=="content"),w=fo().widths.hint(r,co);return i(x,{label:l(K),icon:i(fe,{}),changed:_,hint:u!=="custom"?void 0:p?w:h,action:i(C,{words:S()?.panel,label:l(K),changed:_,disabled:e.readOnly===!0,detail:s?J(b=>l(b),hi(e.follows,r),e.followsView):l("Fit content"),onReset:()=>n(void 0)}),children:P("div",{className:"sf-share-row",children:[i("div",{className:"sf-share-pick",children:i(tt,{label:l(K),value:u,options:gt.map(b=>({value:b.value,label:b.value==="custom"&&!p?h:l(b.label),icon:Fr(i("span",{className:"sf-gallery-pic sf-share-pic",children:Bt(b.weights).map((y,X)=>i("i",{style:{gridColumn:`span ${y}`}},X))}),l(b.label),b.value==="custom"&&!p?h:l(b.label))})),onChange:g,columns:3,cell:Dt,tooltips:!1,disabled:e.readOnly===!0})}),u==="custom"&&p?i("div",{onFocus:()=>{f.current={value:t,shares:ot(Se(c,r),r)}},onBlur:()=>{f.current=null},children:i(po,{label:l(K),count:r,value:Se(c,r),onChange:d,readOnly:e.readOnly===!0})}):null]})})}function Bt(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 Qs(){return Z(Vo,i(Rn,{}),ft,ft[0].value)}function ea(){return R("mobile",kr(K,i(fe,{}),Jo.map(e=>({label:e.label,value:e.value,picture:i("span",{className:"sf-gallery-pic sf-share-pic",children:Bt(e.weights).map((t,n)=>i("i",{style:{gridColumn:`span ${t}`}},n))})})),qo,{columns:2,cell:Dt}))}const Dt={width:"5.75rem",height:"3.25rem"};function ta(){return ie("share",fi(),Re)[W("share")]}function gi(){return R("mobile",U(ht,i($e,{}),xe,Yo,1,xe,"",{clear:{phoneFollows:!1,hint:xe}}))}const vt={read:e=>e.phoneRow,write:(e,t,n)=>({phoneRow:n}),fieldKey:()=>"phoneRow",ownField:!0};function na(){const e=U(ht,i($e,{}),mt,zo,1,mt,"",{clear:{emptyLabel:"Auto"}}),t=ie("columns",e,{...vt,tablet:Re.tablet}),n=ie("columns",e,vt,{phoneRow:gi()});return{...t,phoneRow:n.phoneRow}}function oa(e,t,n,o,r,s){return{type:"custom",render:({value:a,onChange:c})=>i(x,{label:l(e),icon:i(Ze,{noun:s}),action:i(C,{words:S()?.panel,label:l(e),changed:!Cr(a),detail:l("the Text style in Styles"),onReset:()=>c(Sr),defaultAction:{onPress:()=>c(xr),title:l("Keep this section's own built-in size"),icon:i(bn,{})}}),children:ee({min:t,max:n,step:o,value:typeof a=="number"?a:r,suffix:"px",ariaLabel:e,onChange:c})})}}function ra(){return{_gCellWidth:O("Cell width"),gridSpan:Z("Positions",i(fe,{}),[{label:"Auto",value:""},...Array.from({length:tn},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function A(){let e=null,t=null;try{e=$t(bi),t=ue(n=>n).selectedItem}catch{t=null}return e??t?.props??{}}const bi=Ut(null);function xi({min:e,max:t,step:n,px:o,label:r,onChange:s,desktopKey:a,fallback:c}){const u=A()[a],p=me(void 0,u,c);return i(L,{children:ee({min:e,max:t,step:n,value:me(o,u,c),readout:!1,ariaLabel:r,notch:p,onChange:s})})}function Si({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:s=()=>{}}){const a=A()[t],c=me(void 0,a,n);return i(C,{words:S()?.panel,label:l(e),changed:r,detail:J(u=>l(u),`${c}${o}`),onReset:s})}function Ci(e){return Ft(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:i(Si,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:t=>i(xi,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const yi={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},wi={Top:Je,Bottom:ze,Left:Ye,Right:qe},_i=e=>{const t=wi[e];return i(t,{})};function ia(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=w=>yi[w],s=w=>U(r("Top"),i(Je,{}),I.min,I.max,I.step,w,"px"),a=(w,b,y,X=I)=>R("mobile",Ci({label:r(w),icon:_i(w),desktopKey:b,min:X.min,max:X.max,step:X.step,fallback:y})),c=e.top??I.min,u=e.bottom??I.min,p="sectionPaddingLeft",m="sectionPaddingRight",f=e.sideBounds??I,d=e.side??f.min,g=e.sidePhone??d,h=e.phone===!0,_=w=>h?R("desktop",w):w;return q({...o?{_gSpacing:O("Padding")}:{},[t]:_(s(c)),...h?{[k(t)]:a("Top",t,c)}:{},...e.only==="top"?{}:{[n]:_(U(r("Bottom"),i(ze,{}),I.min,I.max,I.step,u,"px")),...h?{[k(n)]:a("Bottom",n,u)}:{}},...e.sides?{[p]:_(U(r("Left"),i(Ye,{}),f.min,f.max,f.step,d,"px")),...h?{[k(p)]:a("Left",p,g,f)}:{},[m]:_(U(r("Right"),i(qe,{}),f.min,f.max,f.step,d,"px")),...h?{[k(m)]:a("Right",m,g,f)}:{}}:{}})}function la(e,t){const n=Object.fromEntries(Object.entries(t).map(([s,a])=>[s,s in e&&pe(a)?e[s]:a])),o={};let r=!1;for(const[s,a]of Object.entries(e)){if(s in t){r||Object.assign(o,n),r=!0;continue}o[s]=a}return r||Object.assign(o,n),o}const se="Width";function sa(e,t=yr,n=!0){const o=t.map(r=>({label:wr[r],value:r}));return q({...n?{_gWidth:O(se)}:{},widthMode:{type:"custom",render:({onChange:r,field:s})=>i(x,{label:l(se),icon:i(Pn,{}),action:n?i(Mr,{inherited:s?.inherited??!1,onReset:()=>r(_r),label:se}):void 0,children:Ee({options:o,value:s?.currentValue||e,onChange:r,ariaLabel:se})})}})}function aa(){const e=(o,r)=>({type:"custom",render:({value:s,onChange:a})=>i(Ri,{value:s,onChange:a,view:o,badge:r})}),t=o=>({type:"custom",render:({value:r,onChange:s,field:a})=>i(Ei,{value:r,onChange:s,unit:a?.unit,view:o})}),n=o=>{const r=Lr("Unit",i(je,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");if(o==="desktop")return r;const s=r.render;return{...r,render:a=>i(Ii,{props:a,draw:s,view:o})}};return q({_gHeight:O(z),...$("sectionHeightMode",o=>o==="desktop"?e(o):e(o,r=>i(Ti,{view:o,onClear:()=>r(void 0)}))),...$("sectionHeightValue",t),...$("sectionHeightUnit",n)})}function Ri({value:e,onChange:t,view:n,badge:o}){const r=A(),s=c=>["auto","fixed","screen"].includes(c),a=ae(n,r)?.mode??"auto";return i(x,{label:z,icon:Y(i(En,{})),action:o?o(t):void 0,children:Ee({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:s(e)?e:a,onChange:t,ariaLabel:z})})}function Ht(e,t){return e==="phone"&&ge(t)?Wo(t):Mo(t)}function ae(e,t){return e==="desktop"||(e==="tablet"?ge(t):Go(t))?null:Ht(e,t)}const N=(e,t)=>e==="tablet"?W(t):k(t);function Oi(e,t,n,o){const r=ae(e,t);return!r||e==="desktop"?null:o===void 0?{}:{[N(e,"sectionHeightMode")]:r.mode,...r.mode==="fixed"?{[N(e,"sectionHeightUnit")]:r.unit}:{},...n==="sectionHeightUnit"?{[N(e,"sectionHeightValue")]:r.value}:{},[N(e,n)]:o}}function Gt(e,t,n){const o=G(),r=ae(e,A());return!o||!r?{followed:null,write:n}:{followed:r,write:a=>o.onChangeMany(c=>{const u=Oi(e,c,t,a);return u===null?{[e==="desktop"?t:N(e,t)]:a}:Object.keys(u).length?u:null})}}function Ei({value:e,onChange:t,unit:n,view:o}){const{followed:r,write:s}=Gt(o,"sectionHeightValue",t),a=(r?r.unit:n)==="%"?"%":"px",c=a==="%"?Xo:$o;return i("div",{className:"sf-field",children:ee({min:c.min,max:c.max,step:c.step,value:r?null:typeof e=="number"?e:c.fallback,...r?{placeholder:r.value}:{},suffix:a,ariaLabel:z,onChange:s})})}function Ii({props:e,draw:t,view:n}){const{followed:o,write:r}=Gt(n,"sectionHeightUnit",e.onChange);return t({...e,...o?{value:void 0,storedValue:void 0,follows:o.unit}:{},onChange:r})}function Ti({view:e,onClear:t}){const n=A(),o=ae(e,n)===null,r=e==="phone"&&ge(n),s=Ht(e,n),a=J(c=>l(c),s.mode==="auto"?l("Auto"):`${s.value}${s.unit}`,r?"tablet":"desktop");return i(C,{words:S()?.panel,label:l(z),changed:o,detail:a,onReset:t})}function ca(){const e=n=>({type:"custom",render:({value:o,onChange:r,id:s,name:a})=>i(Ai,{value:o,onChange:r,labelId:`${s??a??"stickTop"}-label`,view:n})}),t=n=>({type:"custom",render:({value:o,onChange:r})=>i(ki,{value:o,onChange:r,view:n})});return{_gStick:O(be),...$("stickTop",e),...$("stickTopDistance",t)}}function ki({value:e,onChange:t,view:n}){const o=G(),r=A(),s=n==="desktop"||ke(n,r)?null:Mt(n,dt(r)),a=s&&o?c=>o.onChangeMany(u=>{const p=Fi(n,u,c);return p===null?{[N(n,"stickTopDistance")]:c}:Object.keys(p).length?p:null}):t;return i("div",{className:"sf-field",children:ee({min:oe.min,max:oe.max,step:oe.step,value:s?null:typeof e=="number"?e:oe.fallback,...s?{placeholder:s.distance}:{},suffix:"px",ariaLabel:l("Distance from top"),onChange:a})})}function ke(e,t){return e==="tablet"?Uo(t):Ko(t)}function Mt(e,t){return e==="phone"?{on:t.tablet,distance:t.tabletDistance}:{on:t.desktop,distance:t.desktopDistance}}function Fi(e,t,n){return e==="desktop"||ke(e,t)?null:n===void 0?{}:{[N(e,"stickTop")]:!0,[N(e,"stickTopDistance")]:n}}function Ai({value:e,onChange:t,labelId:n,view:o}){const r=A(),s=dt(r),a=o==="phone"?s.phone:o==="tablet"?s.tablet:e===!0,c=o==="phone"&&s.ownTablet,u=o==="desktop"?null:Mt(o,s),p=u?.on?`${u.distance}px`:l("Off");return i(x,{label:l(be),labelId:n,icon:Y(i(Fn,{})),action:P(L,{children:[o!=="desktop"?i(C,{words:S()?.panel,label:l(be),changed:ke(o,r),detail:J(m=>l(m),p,c?"tablet":"desktop"),onReset:()=>t(void 0)}):null,i(he,{checked:a,onChange:t,ariaLabelledBy:n})]})})}const Wt="e.g. about";function ua(){return{_gAnchor:O("Anchor"),anchor:H({control:"plainText",label:"Name",placeholder:Wt},{type:"custom",render:({value:e,onChange:t})=>i(dn,{value:e,onChange:t,nameBox:(n,o)=>i(v,{value:n,onChange:o,label:"Name",placeholder:Wt,hideable:!1,markup:!1})})})}}function da(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:s,name:a})=>{const c=`${s??a??e}-datetime`,u=Date.parse(typeof o=="string"?o:"");return i(x,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(so,{id:c,value:Number.isFinite(u)?new Date(u):null,onChange:p=>r(p?p.toISOString():"")})})}}}function pa(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:s,name:a})=>{const c=`${s??a??e}-date`;return i(x,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(lo,{id:c,value:Vt(typeof o=="string"?o:null),onChange:u=>r(u?jt(u):"")})})}}}function Li(e,t,n,o){return{type:"custom",...T({},{...Q,label:e}),render:({value:r,onChange:s,id:a,name:c})=>{const u=typeof r=="boolean"?r:t,p=`${a??c??e}-label`;return i(x,{label:l(e),labelId:p,icon:n,hint:o===void 0?void 0:l(o),action:i(he,{checked:u,onChange:s,ariaLabelledBy:p})})}}}function fa(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i(lt,{label:l("Background"),icon:i(kn,{}),id:r,value:Bn(e),onChange:t})}}}function ha(e,t){return{type:"custom",...T({},{...Q,label:e}),render:({value:n,onChange:o,id:r})=>{const s=typeof n=="boolean"?n:t,a=`${r??e}-checkbox`;return i(x,{label:l(e),htmlFor:a,className:"sf-checkbox",action:i(oo,{id:a,checked:s,onChange:o})})}}}function ma(e,t,n){return{type:"custom",render:({value:o,onChange:r})=>i(lt,{label:l(e),icon:n,value:o||t,onChange:r})}}function ga(){return{type:"custom",render:({value:e,onChange:t})=>i(Ni,{value:typeof e=="string"?e:"",onChange:t})}}function Ni({value:e,onChange:t}){const{hex:n,n:o}=Bi();return i(st,{label:l("Fill"),icon:i(Xe,{}),value:e,inherited:n,resetTo:D(n.toUpperCase(),l("Theme {n} background",{n:o})),onChange:t,onReset:()=>t("")})}function Pi(e,t,n){if((e?.content??[]).some(a=>a?.props?.id===t))return re(n);const r=Hn(e,t);if(r.length===0)return null;const s=re(Rt(n));if(s!==null)return s;for(let a=r.length-1;a>0;a-=1){const c=re(Rt(r[a].sectionAccent));if(c!==null)return c}return re(r[0].sectionAccent)}function Bi(){const{colors:e,n:t}=Kt();return{hex:e.background,n:t}}function Kt(){const e=St(B().theme),[t]=F("sectionAccent");let n=null;try{const{appState:r,selectedItem:s}=ue(c=>c),a=s?.props?.id?String(s.props.id):void 0;n=a?Pi(r?.data,a,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{colors:er(e.themes[o]),n:o+1}}const Di=[{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 vi({label:e,value:t,onChange:n,points:o=Di}){const r=o.map(s=>({...s,label:l(s.label),...s.title?{title:l(s.title)}:null}));return i(no,{label:l(e),value:t,points:r,onChange:n})}function ba(){return At()}const xa={top:i(wn,{}),right:i(yn,{}),bottom:i(Sn,{}),left:i(Cn,{})};function Sa(e,t,n,o,r,s,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(h=>h.cell===f);if(!d)return u(`missing-${f}`);const g=s?.[f];return g?{value:d.value,label:d.label,icon:g}:{value:d.value,label:d.label}},m=[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(h=>h.value===f)?f:n;return i(x,{label:l(e),icon:r,value:c(g)?.label?l(c(g).label):a?l(a):"",children:vi({label:e,value:g,onChange:d,points:m})})}}}function Ca(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:s})=>i(Fo,{label:e,options:(s.options??t).map(a=>({...a,label:l(a.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:l(n)}:{}})}}function ya(e,t,n,o){return{type:"custom",options:t,fallback:n,...T({},{type:"select",label:e}),render:({value:r,onChange:s,field:a})=>i(Lo,{label:e,options:(a.options??t).map(c=>({...c,label:l(c.label)})),fallback:a.fallback??n,value:r,onChange:s,placeholder:o===void 0?void 0:l(o)})}}function wa(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}const _a=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function Ra(e,t,n){const o=Object.keys(Be).map(r=>({label:Be[r],value:r,picture:n[r]}));return{type:"custom",...T({},{type:"radio",label:e,options:o.map(r=>({value:r.value,label:r.label}))}),render:({onChange:r})=>i(Hi,{label:e,icon:t,options:o,onChange:r})}}function Hi({label:e,icon:t,options:n,onChange:o}){const r=G()?.values??{},s=zt(r),a=s==="frame"&&!!Pe(r.mediaVideo)&&!Pe(r.videoFrame);return i(x,{label:l(e),icon:Y(t),hint:a?l("This video has no frame yet. The slide shows its background colour until one is made."):void 0,children:Ee({options:n,value:s,onChange:o,ariaLabel:e})})}function Oa(e,t,n,o={}){const r={type:"custom",[Ge]:!0,render:({value:s,onChange:a,name:c})=>i(ko,{value:s||"",onChange:a,fieldKey:c,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen,frameKey:o.frame}),...o.focus?{focusKey:o.focus}:{},...o.focusWhen?{focusWhen:o.focusWhen}:{}};return o.focus?R("each",r):r}const Ea={HeroSingle:["imageFocal"],HeroSlide:["videoFrame"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function Gi(e){const t=l(e.status??"");return e.ok&&typeof e.lat=="number"&&typeof e.lng=="number"?`${t} · ${e.lat.toFixed(4)}, ${e.lng.toFixed(4)}`:t}function Ia({value:e,onChange:t,label:n}){const o=e||{},r=G(),s=r?r.values!==r.node.props:!0,a=!!o.pending&&s,c=!!o.pending&&!s,u=a?"var(--ink-faint)":o.ok&&!c?"var(--status-success-soft-ink)":"var(--status-danger-soft-ink)",p=!!Er(Or()).geocode,m=Ne(),f=(d,g)=>t({...o,[d]:g??void 0});return P(L,{children:[i(x,{label:l(n),icon:i(Ve,{}),action:p?i(ne,{content:l("Find from the address (OpenStreetMap)"),children:i(rt,{"aria-label":l("Find from the address"),"aria-busy":a||void 0,disabled:a,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:i(An,{})})}):void 0,children:p&&o.status?i(ne,{content:Gi(o),className:"sf-name-tip",children:i("div",{className:`es-field-hint ${un}`,style:{margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0,color:u},children:a?l("Finding…"):c?l(mo):l(o.status)})}):null}),i(x,{label:l("Enter by hand"),labelId:m,icon:i(_n,{}),action:i(he,{checked:!!o.manual,onChange:d=>t({...o,manual:d}),ariaLabelledBy:m})}),o.manual&&i(x,{label:l("Latitude, longitude"),icon:i(Ve,{}),children:P("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[i(it,{value:typeof o.lat=="number"?o.lat:null,onChange:d=>f("lat",d),min:-90,max:90,step:1e-4,placeholder:l("Latitude")}),i(it,{value:typeof o.lng=="number"?o.lng:null,onChange:d=>f("lng",d),min:-180,max:180,step:1e-4,placeholder:l("Longitude")})]})})]})}function Mi(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function Wi(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 Ta(e,t){return e===null?null:t>e?e:null}function Ki(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 ka={label:"Ticker items",icon:i(Tn,{})};function Fa(e,t,n,o){return{type:"custom",[E]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...T({},{...It.textList,label:e}),render:({value:r,onChange:s})=>i(Ui,{label:e,icon:Y(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:s,markup:o==="markup"})}}function Ui({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:s=!1}){const a=j(null),[c,u]=V(null),p=f=>f.map(d=>({text:d?.text??""})),m=f=>{const d=Ki(n,f,c);d===null&&(a.current=null),u(d),r(p(f))};return i(zn,{label:l(e),icon:t,noun:l("item"),items:n,onChange:m,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:s?i(at,{target:a,value:Mi(n,c),onChange:f=>r(Wi(n,c??-1,f)),disabled:c===null,label:c===null?l("Formatting — click a row first"):l("Formatting — row {n}",{n:c+1})}):void 0,renderRow:(f,d,g)=>i("input",{type:"text",className:s&&c===d?"sf-list-marking":void 0,value:f?.text??"",placeholder:l(o),"aria-label":l("{label} {n}",{label:l(e),n:d+1}),onChange:h=>g({text:h.target.value}),onFocus:h=>{a.current=h.currentTarget,u(d)}})})}function Aa(e,t){const n=`${e.label} — row ${t+1}`;return H({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>i(v,{value:o,onChange:r,label:l("{label} — row {n}",{label:l(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function La(e){return{_gCards:O("Cards"),coverIndex:Z("Cover image",i(In,{}),Eo,String(Io),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:qr("Image background",sr),cardImage:ji()}}function Na(){return{outline:Z("Card outline",i(Ln,{}),_o,Oo),indexBadge:Z("Card number",i(je,{}),wo,Ro),showBadge:Li("Product badge",!0,i(Ze,{noun:"tag"}))}}function Pa(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...Q,label:ce.find(s=>s.id===r).label}),o=r=>T(go(Fe),n(r));return{_gShowOnCard:O("Show on a card"),[Fe]:T({type:"custom",render:()=>i($i,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(Fe)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const Fe="showCardPrice",ce=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function $i({rest:e}){const t=A(),n=Jr(),o=a=>typeof t[a]=="boolean"?t[a]:void 0,r=a=>o(a)??e[a],s=ce.some(({id:a})=>o(a)!==void 0&&o(a)!==e[a]);return i(Ae,{parts:ce,changed:s,shown:r,onPress:(a,c)=>n({[a]:c}),onReset:()=>n(Object.fromEntries(ce.map(({id:a})=>[a,void 0])))})}function Ba(e,t="display"){const n=k(t);return{[t]:R("desktop",{type:"custom",render:({value:o,onChange:r})=>i(Ae,{parts:e,changed:qn(o),shown:s=>Jn(o,s),onPress:(s,a)=>r(eo(o,s,a)),onReset:()=>r(void 0)})}),[n]:R("mobile",{type:"custom",render:({value:o,onChange:r})=>i(Xi,{parts:e,desktopKey:t,value:o,onChange:r})})}}function Ae({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:s,disabledReason:a}){const c=l("Display");return i(x,{label:c,icon:i(fn,{}),changed:t,action:i(C,{words:S()?.panel,label:c,changed:t,detail:s,onReset:r}),children:i(Yn,{label:c,items:e.map(u=>({id:u.id,label:l(u.label),shown:n(u.id),...a?{disabled:!0,disabledReason:l(a)}:{}})),onChange:o})})}function Xi({parts:e,desktopKey:t,value:n,onChange:o}){const r=A()[t];return i(Ae,{parts:e,changed:Qn(n),shown:s=>Zn(r,n,s),onPress:(s,a)=>o(to(n,s,a)),onReset:()=>o(Co),detail:l("the same as Desktop")})}function ji(){return Ft("Card image",{min:M,max:Ke,step:Zt,hint:"Rounds the picture. The card's own corner is in Styles."})}function Da(){return Te({sidesKey:"cornerSides",step:Qt,useFollowed:()=>M,mark:i(Vi,{label:en}),hint:l("Rounds the picture. Left alone it stays square.")})}function Vi({label:e,changed:t=!1,onReset:n=()=>{}}){return i(C,{words:S()?.panel,label:l(e),changed:t,onReset:n})}function va(){return{type:"custom",render:({value:e,onChange:t})=>i(Ji,{value:typeof e=="string"?e:"",onChange:t})}}function zi({layout:e,width:t}){return i("span",{"aria-hidden":"true",style:{display:"grid",width:t,gridTemplateColumns:"repeat(12, minmax(0, 1fr))",gridAutoRows:6,gridAutoFlow:"row dense",gap:2},children:rn(e).map(([n,o],r)=>i("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${n}`,gridRow:`span ${o}`}},r))})}const Yi={width:"3.5rem",height:"2.5rem"},qi=200;function Ji({value:e,onChange:t}){const[n,o]=V(null),[r,s]=V(4),a=j(null);Xt(()=>{const d=a.current;if(!d||typeof ResizeObserver!="function")return;const g=()=>s(d.getBoundingClientRect().width>=qi?4:3);g();const h=new ResizeObserver(g);return h.observe(d),()=>h.disconnect()},[]);const c=e&&e in te?e:"",u=Ue(n,c),p=Ue(n,"").length,m=ln("no-symbol"),f=[{value:"",label:l("Not chosen"),icon:Ar(m,l("Not chosen"))},...u.map(d=>({value:d,label:l(te[d].label),icon:i(zi,{layout:te[d],width:40})}))];return i(x,{label:l("Layout"),icon:i(On,{}),value:c?l(te[c].label):void 0,children:i("div",{ref:a,style:{flex:"1 1 auto",minWidth:0},children:i(tt,{label:l("Layout"),value:c,options:f,onChange:t,columns:r,cell:Yi,header:P("div",{className:"mb-2 flex flex-col gap-1",style:{minWidth:"11rem"},children:[i("span",{className:"text-2xs text-ink-faint",children:l("Photos in a row")}),i(Un,{options:[{id:"all",label:l("All")},...nn.map(d=>({id:String(d),label:String(d)}))],value:n===null?"all":String(n),ariaLabel:l("Photos in a row"),onChange:d=>o(d==="all"?null:Number(d))}),i("span",{className:"text-2xs text-ink-faint",children:l("{n} of {total} layouts",{n:p,total:on.length})})]})})})})}export{Kr as BOUND_TO_POST,ks as BOUND_TO_POST_NOTE,vs as BUCKET_ICONS,Ea as CUSTOM_FIELD_MEDIA,Ia as CoordsField,Ot as DESKTOP_GAP_NOT_OVERLAP,Ae as DisplayRow,xa as EDGE_ARROWS,ao as FOCAL_DEFAULT,Di as FOCAL_POINTS,de as FOLD_FIELD_MARKER,vi as FocalPicker,Xs as GroupLabel,Ur as HIGHLIGHT_HINT,v as HidableTextField,He as LINK_FIELD_MARKER,xs as Label,Ge as MEDIA_FIELD_MARKER,_a as MEDIA_TYPE_OPTIONS,Fs as NOT_BOUND_TO_POST,$s as PanelBand,jr as PanelNoteLine,bi as RowPropsContext,Me as SCAFFOLD_FIELD_MARKER,Wa as SCALAR_TEXT_CONTROLS,Pr as SiteGapDefaultReset,ee as Slider,zr as Swatches,Ma as TEXT_CONTROL_KINDS,E as TEXT_FIELD_MARKER,ka as TICKER_ITEMS_ROW,Ui as TextListField,se as WIDTH_LABEL,Mr as WidthDefaultReset,Ki as aimAfterListChange,ua as anchorFields,D as backTo,js as backgroundField,Qs as boxBlockSpacingField,na as boxColumnsFields,ga as boxFillField,gi as boxPhoneRowField,fi as boxShareField,ea as boxSharePhoneField,ta as boxShareTabletField,Pi as boxThemeIndexOf,Ms as bucketHeader,qs as buttonWordsEntryField,di as cardCornersField,qr as cardImageBackgroundField,ji as cardImageField,La as cardMediaFields,Zs as cardShapeFields,Pa as cardShowFields,Na as cardStyleFields,ra as cellWidthFields,ha as checkbox,ma as colorInput,Cs as containerDirectionField,Br as containerGapField,Dr as containerGapPhoneField,Ss as containerGapRows,vr as containerGapTabletField,Gi as coordsResultTip,Ps as copyText,Lt as cornerSidesField,Te as cornersRowField,pa as date,da as dateTime,Ws as designGroupHeader,Ba as displayFields,Sa as edgePad,Ta as focusAfterRemove,ba as focusKeptField,Ks as foldMarker,pe as foldMetaOf,Vr as foldTitleOf,Oi as followedHeightPatch,Fi as followedStickPatch,va as galleryLayoutField,aa as heightFields,ae as heightFollowedBy,ys as heroGroupPlacementPoints,ve as hidableText,Xr as hintIsWhileTyping,Da as imageCornersField,Ts as inOwnBox,Gs as isBucketHeader,At as keptBy,Bs as linkField,Ra as loadingShowsField,Ca as multiSelect,fa as pageBackgroundField,Hs as panelNote,Ci as phoneOverrideField,Ns as plainText,Ds as plainTextarea,Ft as pxField,Us as quietMarker,De as readHidable,Mi as rowText,ya as searchSelect,Ys as sectionBorderField,ti as sectionCornersField,zs as sectionShapeFields,Vs as sectionThemeFields,Wi as setRowText,oa as sizeField,wa as sourceField,ia as spacingFields,ca as stickFields,la as swapPadding,Js as templateField,As as text,Yt as textFieldIdentifier,Rs as textFieldOffPage,Es as textFieldPanelOnly,Fa as textList,Aa as textListRowField,Ls as textarea,Li as toggle,Oa as upload,Jr as useSelectedPatch,A as useSelectedProps,F as useSelectedSibling,Nr as useSiteGapDetail,sa as widthField,Is as withIdentifier,_s as withOffPage,Os as withPanelOnly,ws as withScaffold};
@@ -18,4 +18,5 @@ export declare function hidableRowProblems(blocks: Record<string, HidableCheckBl
18
18
  list: string[];
19
19
  rows: number;
20
20
  drawings: number;
21
+ rowsDrawn: Set<string>;
21
22
  };
@@ -1 +1 @@
1
- import{textControlKind as m}from"../../../render/lib/document/part-text.js";const v=new Set(["text","textarea"]),g=s=>v.has(m(s)??""),u=s=>`Zq${s.replace(/[^A-Za-z0-9]/g,"")}Zq`,j=(s,n)=>n==="bare"?u(s):{text:u(s),hidden:n==="shut"};function $(s,n){const t={...s.defaultProps??{},id:"t-1",editor:{isEditing:!1}},r=[];for(const[e,o]of Object.entries(s.fields??{}))if(o){if(o.type==="slot")t[e]=()=>null;else if(g(o))t[e]=j(e,n),r.push(u(e));else if(o.type==="array"&&o.arrayFields){const i=Object.entries(o.arrayFields).filter(([,a])=>g(a));if(!i.length)continue;const c=Array.isArray(t[e])&&t[e].length?t[e]:[{},{}];t[e]=c.map((a,f)=>{const d={...a??{}};for(const[l]of i)d[l]=j(`${e}${f}${l}`,n),r.push(u(`${e}${f}${l}`));return d})}}return{props:t,needles:r}}function A(s){const n=[{label:"",props:{}}];for(const[t,r]of Object.entries(s.fields??{})){const e=r?.options;if(!(!Array.isArray(e)||e.length>16))for(const o of e)o&&typeof o.value!="object"&&n.push({label:` (${t}=${String(o.value)})`,props:{[t]:o.value}})}return n}function E(s,n,t){const r=[];let e=0,o=0;for(const i of n){const c=s[i];if(!c)continue;const a=$(c,"open");if(e+=a.needles.length,!a.needles.length)continue;const f=$(c,"shut"),d=$(c,"bare");for(const l of A(c)){o+=1;const p=`${i}${l.label}`,h=t(i,{...a.props,...l.props});h.error?r.push(`${p}: a typed row ({ text, hidden: false }) throws — ${h.error}`):h.html?.includes("[object Object]")&&r.push(`${p}: a typed row reaches the page as [object Object]`);const b=t(i,{...f.props,...l.props});if(b.error)r.push(`${p}: a hidden row ({ text, hidden: true }) throws — ${b.error}`);else{const y=f.needles.filter(x=>b.html?.includes(x));y.length&&r.push(`${p}: a hidden row still draws its words (${y.join(", ")})`)}const w=t(i,{...d.props,...l.props});w.error&&r.push(`${p}: a row stored as a bare string throws — ${w.error}`)}}return{list:r,rows:e,drawings:o}}export{E as hidableRowProblems,g as isHideableRow};
1
+ import{FIELD_DESCRIPTION_MARKER as A}from"efficient-easel/screen/lib/host";import{textControlKind as v}from"../../../render/lib/document/part-text.js";const E=new Set(["text","textarea"]),j=r=>E.has(v(r)??""),h=r=>`Zq${r.replace(/[^A-Za-z0-9]/g,"")}Zq`,x=(r,i)=>i==="bare"?h(r):{text:h(r),hidden:i==="shut"};function b(r,i){const t={...r.defaultProps??{},id:"t-1",editor:{isEditing:!1}},o=[];for(const[e,n]of Object.entries(r.fields??{}))if(n){if(n.type==="slot")t[e]=()=>null;else if(j(n))t[e]=x(e,i),o.push(h(e));else if(n.type==="array"&&n.arrayFields){const l=Object.entries(n.arrayFields).filter(([,c])=>j(c));if(!l.length)continue;const s=Array.isArray(t[e])&&t[e].length?t[e]:[{},{}];t[e]=s.map((c,a)=>{const p={...c??{}};for(const[d]of l)p[d]=x(`${e}${a}${d}`,i),o.push(h(`${e}${a}${d}`));return p})}}return{props:t,needles:o}}function O(r,i){const t=[{label:"",props:{}}];for(const[o,e]of Object.entries(r.fields??{})){const l=e?.[A]?.options??e?.options;if(!(!Array.isArray(l)||l.length>16))for(const s of l)s&&typeof s.value!="object"&&t.push({label:` (${o}=${String(s.value)})`,row:`${i}.${o}`,props:{[o]:s.value}})}return t}function I(r,i,t){const o=[],e=new Set;let n=0,l=0;for(const s of i){const c=r[s];if(!c)continue;const a=b(c,"open");if(n+=a.needles.length,!a.needles.length)continue;const p=b(c,"shut"),d=b(c,"bare");for(const f of O(c,s)){l+=1,f.row&&e.add(f.row);const u=`${s}${f.label}`,w=t(s,{...a.props,...f.props});w.error?o.push(`${u}: a typed row ({ text, hidden: false }) throws — ${w.error}`):w.html?.includes("[object Object]")&&o.push(`${u}: a typed row reaches the page as [object Object]`);const $=t(s,{...p.props,...f.props});if($.error)o.push(`${u}: a hidden row ({ text, hidden: true }) throws — ${$.error}`);else{const g=p.needles.filter(m=>$.html?.includes(m));g.length&&o.push(`${u}: a hidden row still draws its words (${g.join(", ")})`)}const y=t(s,{...d.props,...f.props});y.error&&o.push(`${u}: a row stored as a bare string throws — ${y.error}`)}}return{list:o,rows:n,drawings:l,rowsDrawn:e}}export{I as hidableRowProblems,j as isHideableRow};
@@ -63,6 +63,7 @@ export declare const PART_PANEL_ROWS: {
63
63
  };
64
64
  };
65
65
  export type PartPanelRow = keyof typeof PART_PANEL_ROWS;
66
+ export declare function partRowHasTabletValue(row: PartPanelRow): boolean;
66
67
  export declare const TICKER_PANEL_ROWS: {
67
68
  showTicker: {
68
69
  type: "custom";
@@ -1 +1 @@
1
- import{Fragment as i,createElement as r}from"react";import{deviceField as t}from"efficient-easel/screen/lib/document/device-fields";const e=()=>({type:"custom",render:()=>r(i)}),a=["fontSize","lineHeight","letterSpacing","paragraphSpacing","padding"],c={words:e(),sourceNote:e(),style:e(),font:e(),italic:e(),fontSize:t("each",e()),lineHeight:e(),letterSpacing:e(),paragraphSpacing:e(),padding:e(),align:t("each",e()),letterCase:e(),fixedSizeHint:t("each",e()),regionNote:e(),regionStyle:e()},p={showTicker:e(),items:e()};export{a as PART_CELL_KEYS,c as PART_PANEL_ROWS,p as TICKER_PANEL_ROWS};
1
+ import{Fragment as n,createElement as o}from"react";import{deviceField as t}from"efficient-easel/screen/lib/document/device-fields";const e=()=>({type:"custom",render:()=>o(n)}),p=["fontSize","lineHeight","letterSpacing","paragraphSpacing","padding"],g={words:e(),sourceNote:e(),style:e(),font:e(),italic:e(),fontSize:t("each",e()),lineHeight:e(),letterSpacing:e(),paragraphSpacing:e(),padding:e(),align:t("each",e()),letterCase:e(),fixedSizeHint:t("each",e()),regionNote:e(),regionStyle:e()},r=["fontSize"];function l(i){return r.includes(i)}const s={showTicker:e(),items:e()};export{p as PART_CELL_KEYS,g as PART_PANEL_ROWS,s as TICKER_PANEL_ROWS,l as partRowHasTabletValue};
@@ -1,10 +1,18 @@
1
1
  import type { ReactElement } from "react";
2
2
  import type { TickerSeparator } from "../../../format/lib/sections/ticker-style.js";
3
3
  export declare function separatorField(icon: ReactElement, fallback: TickerSeparator): {
4
- render: ({ value, onChange, field }: {
4
+ options: {
5
+ showWhen?: import("efficient-shell/ui").ShowWhenRule | undefined;
6
+ label?: string | undefined;
7
+ value: TickerSeparator;
8
+ }[];
9
+ render: (props: {
5
10
  value?: unknown;
6
11
  onChange: (v: TickerSeparator) => void;
7
12
  field?: object;
13
+ readOnly?: boolean;
14
+ follows?: unknown;
15
+ followsView?: "desktop" | "tablet";
8
16
  }) => import("react").FunctionComponentElement<import("efficient-easel/panel").SettingsFieldProps>;
9
17
  type: "custom";
10
18
  };
@@ -1 +1 @@
1
- import{BOX_SEPARATOR_POINTS as e,boxSeparatorOf as a}from"../../../format/lib/content/box-separator.js";import{iconPickerRow as t}from"./box-fields.js";import{shellGlyphOf as l}from"./shell-glyph.js";const s={none:"no-symbol",dot:"dot",cross:"close",slash:"separator-slash",triangle:"separator-triangle"},n=e.map(o=>({value:o.value,picture:l(s[o.value])}));function c(o,r){return t("Separator",o,n,r,{emptyValue:"none",resolve:a})}export{c as separatorField};
1
+ import{BOX_SEPARATOR_POINTS as e,boxSeparatorOf as a}from"../../../format/lib/content/box-separator.js";import{iconPickerRow as t}from"./box-fields.js";import{shellGlyphOf as s}from"./shell-glyph.js";const l={none:"no-symbol",dot:"dot",cross:"close",slash:"separator-slash",triangle:"separator-triangle"},n=e.map(o=>({value:o.value,picture:s(l[o.value])}));function m(o,r){return t("Separator",o,n,r,{resolve:a})}export{m as separatorField};
@@ -0,0 +1,37 @@
1
+ import type { ReactElement, ReactNode } from "react";
2
+ import type { ShowWhenRule } from "efficient-shell/format";
3
+ import type { ShapeLine } from "../../../format/lib/content/gallery-card-layout.js";
4
+ export declare function fillRowCell<V extends string>(option: {
5
+ label: string;
6
+ value: V;
7
+ showWhen: ShowWhenRule;
8
+ }): {
9
+ picture: import("react").JSX.Element;
10
+ label: string;
11
+ value: V;
12
+ showWhen: ShowWhenRule;
13
+ };
14
+ export declare function shapePickerRow<V extends string>(label: string, icon: ReactElement, lines: readonly ShapeLine[], column: "shape" | "image", fallback: V, extra?: {
15
+ phoneRest?: (follows: unknown) => V | undefined;
16
+ more?: readonly {
17
+ label: string;
18
+ value: V;
19
+ picture: ReactNode;
20
+ showWhen: ShowWhenRule;
21
+ }[];
22
+ }): {
23
+ options: {
24
+ showWhen?: ShowWhenRule | undefined;
25
+ label?: string | undefined;
26
+ value: V;
27
+ }[];
28
+ render: (props: {
29
+ value?: unknown;
30
+ onChange: (v: V) => void;
31
+ field?: object;
32
+ readOnly?: boolean;
33
+ follows?: unknown;
34
+ followsView?: "desktop" | "tablet";
35
+ }) => import("react").FunctionComponentElement<import("efficient-easel/panel").SettingsFieldProps>;
36
+ type: "custom";
37
+ };
@@ -0,0 +1 @@
1
+ import{jsx as o,jsxs as a}from"react/jsx-runtime";import{iconPickerRow as d}from"./box-fields.js";const e=28,t=1.5;function x({ratio:r}){const[n,s]=r??[1,1],c=(e-t*2)/Math.max(n,s),h=n*c,i=s*c;return o("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,"aria-hidden":"true",children:o("rect",{x:(e-h)/2,y:(e-i)/2,width:h,height:i,rx:2,fill:"none",stroke:"currentColor",strokeWidth:t,strokeDasharray:r?void 0:"3 2"})})}function w(){const r=t*2;return a("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,"aria-hidden":"true",children:[o("line",{x1:t,y1:t/2,x2:e-t,y2:t/2,stroke:"currentColor",strokeWidth:t}),o("line",{x1:t,y1:e-t/2,x2:e-t,y2:e-t/2,stroke:"currentColor",strokeWidth:t}),o("rect",{x:e/4,y:r,width:e/2,height:e-r*2,rx:2,fill:"none",stroke:"currentColor",strokeWidth:t})]})}function m(r){return{...r,picture:o(w,{})}}const p={width:"5.25rem",height:"3.5rem"};function g(r,n,s,c,h,i={}){const u=[...s.map(l=>({value:l[c],label:l.label,picture:o(x,{ratio:l.ratio})})),...i.more??[]];return d(r,n,u,h,{columns:3,cell:p,phoneRest:i.phoneRest})}export{m as fillRowCell,g as shapePickerRow};
@@ -0,0 +1,6 @@
1
+ import type { SelectField } from "efficient-easel/screen/lib/document/box-fields";
2
+ import { type BlockShowWhenFacts } from "../../../format/lib/document/show-when-attach.js";
3
+ export declare const SHOW_FOR_UNOFFERED = "showForUnoffered";
4
+ export declare const SHOW_FOR_FACTS: BlockShowWhenFacts;
5
+ export declare function showForField(): SelectField;
6
+ export declare function showForFields<Fields extends Record<string, unknown>>(fields: Fields, props: Record<string, unknown> | null | undefined): Fields;
@@ -0,0 +1 @@
1
+ import{jsx as p}from"react/jsx-runtime";import{FilterIcon as v}from"efficient-easel/icons";import{deviceField as O}from"efficient-easel/screen/lib/document/device-fields";import{SHOW_FOR_PROP as f,showForChoices as w,showForChoicesRevision as x,showForOf as m}from"../../../format/lib/content/box-show-for-choices.js";import{select as _}from"./box-fields.js";import{withShowWhen as k}from"../../../format/lib/document/show-when-attach.js";const h="showForUnoffered",y={[h]:e=>w().length===0&&m(e.props?.[f])===void 0},R="Show for",S="All";function W(e,n){if(!e)return;const o=w().find(s=>s.slug===e);if(o)return{slug:o.slug,name:o.name};const r=m(n);return r?.slug===e?r:void 0}function E(){const e=_(R,p(v,{}),[{label:S,value:""}],"");return k(O("desktop",{...e,render:n=>e.render({...n,value:m(n.value)?.slug??"",onChange:o=>n.onChange(W(o,n.value))})}),{not:{context:h,is:!0}})}const F=new WeakMap;function H(e,n){const o=e[f];if(!o)return e;const r=w(),s=m(n?.[f]),t=s&&!r.some(c=>c.slug===s.slug)?s:void 0;let i=F.get(o);i||F.set(o,i=new Map);const u=`${x()}\0${t?`${t.slug}\0${t.name}`:""}`;let l=i.get(u);l||(l={...o,options:[...o.options,...r.map(c=>({label:c.name,value:c.slug})),...t?[{label:t.name,value:t.slug}]:[]]},i.set(u,l));let a=g.get(e);a||g.set(e,a=new Map);let d=a.get(u);return d||a.set(u,d={...e,[f]:l}),d}const g=new WeakMap;export{y as SHOW_FOR_FACTS,h as SHOW_FOR_UNOFFERED,E as showForField,H as showForFields};
@@ -27,14 +27,12 @@ export declare const CARD_HOVER_TURN: number;
27
27
  export type CardHoverDrawn = {
28
28
  kind: CardHover;
29
29
  angle: number | null;
30
- angleSet?: boolean;
31
30
  duration: number;
32
31
  delay: number;
33
32
  };
34
33
  export declare function cardHoverKindOf(record: Readonly<Record<string, unknown>>, resting: CardHover): CardHover;
35
34
  export declare function cardHoverAngleOf(stored: unknown): number;
36
35
  export declare function cardHoverOf(record: Readonly<Record<string, unknown>>, blockKey: string): CardHoverDrawn;
37
- export declare function cardTurnFor(hover: CardHoverDrawn, spokes: unknown): CardHoverDrawn;
38
36
  export declare function cardRotatesRule(resting: CardHover): ShowWhenRule;
39
37
  export type PictureHover = Extract<HoverKind, "none" | "nextImage" | "mono">;
40
38
  export declare const PICTURE_HOVER_KINDS: readonly PictureHover[];
@@ -1 +1 @@
1
- import{HOVER_MOTION as E,motionSeconds as a,rotateDegrees as H}from"efficient-shell/format";import{finiteNumber as u}from"../finite-number.js";const i="hover",P="_gHover",I=["none","nextImage","rotate","zoom","lift","mono"],L={none:"None",nextImage:"Show next image",rotate:"Rotate",zoom:"Zoom",lift:"Lift",mono:"Black and white"};function c(n){return I.filter(e=>n.includes(e))}const g=c(["none","lift"]);function M(n){const e=n[i];return g.includes(e)?e:"none"}const p=c(["none","rotate"]),r={kind:i,angle:"hoverAngle",duration:"hoverDuration",delay:"hoverDelay"},s="spinOnHover",R={min:0,max:360,step:1},x={ProductGrid:"rotate",RelatedProducts:"rotate",AlloyWheelsListing:"none"},U=Object.keys(x);function v(n){return x[n]??"none"}const S=E.rotateFallbackDeg;function k(n,e){const o=n[r.kind];if(p.includes(o))return o;const t=n[s];return typeof t=="boolean"?t?"rotate":"none":e}function D(n){const e=u(n);return e===void 0?S:Math.min(R.max,Math.max(R.min,e))}function B(n,e){const o=v(e),t=k(n,o);return{kind:t,angle:t==="rotate"?D(n[r.angle]):null,angleSet:t==="rotate"&&u(n[r.angle])!==void 0,duration:a("hover","duration",t==="rotate"?n[r.duration]:void 0),delay:a("hover","delay",t==="rotate"?n[r.delay]:void 0)}}function G(n,e){return n.kind!=="rotate"||n.angleSet?n:{...n,angle:H(u(e))}}function z(n){const e={field:r.kind,in:[...p]};return{any:[{field:r.kind,is:"rotate"},{all:[{not:e},n==="rotate"?{not:{field:s,is:!1}}:{field:s,is:!0}]}]}}const m=c(["none","mono"]),N=c(["none","nextImage","mono"]),O={ImageBlock:"none",Manifesto:"none",Split:"none",ContactLocations:"mono"},Y=Object.keys(O);function V(n){return O[n]??"none"}const _={zoom:"hoverZoom",darken:"hoverDarken"},d={min:100,max:150,step:1,unit:"%"},l=["nextImage"];function C(n,e){if(!l.includes(e))return null;const o=u(n[_.zoom]);if(o===void 0)return null;const t=Math.min(d.max,Math.max(d.min,o));return t===d.min?null:String(t/100)}function T(n,e){if(!l.includes(e))return null;const o=u(n[_.darken]);return o!==void 0&&o>0?o:null}const h=["ImageBlock"];function K(n,e,o=m){const t=n[i];return o.includes(t)?t:e}function b(n,e=""){const o=h.includes(e)?N:m,t=K(n,V(e),o),f=t!=="none";return{kind:t,duration:a("hover","duration",f?n[r.duration]:void 0),delay:a("hover","delay",f?n[r.delay]:void 0),...l.includes(t)?{zoom:C(n,t),darken:T(n,t)}:{}}}function Z(){return{field:i,in:[...l]}}function w(n){return n==="none"?{field:i,in:["mono","nextImage"]}:{not:{field:i,is:"none"}}}export{R as CARD_HOVER_ANGLE,r as CARD_HOVER_KEYS,p as CARD_HOVER_KINDS,U as CARD_HOVER_SECTIONS,S as CARD_HOVER_TURN,P as HOVER_GROUP_KEY,i as HOVER_KEY,I as HOVER_KINDS,L as HOVER_KIND_LABELS,h as NEXT_PICTURE_BLOCKS,N as NEXT_PICTURE_HOVER_KINDS,s as OLD_SPIN_KEY,g as PART_HOVER_KINDS,Y as PICTURE_HOVER_BLOCKS,_ as PICTURE_HOVER_KEYS,m as PICTURE_HOVER_KINDS,d as PICTURE_HOVER_ZOOM,D as cardHoverAngleOf,k as cardHoverKindOf,B as cardHoverOf,v as cardHoverResting,z as cardRotatesRule,G as cardTurnFor,M as hoverOf,K as pictureHoverKindOf,Z as pictureHoverMovesRule,b as pictureHoverOf,V as pictureHoverResting,w as pictureHoverRunsRule,C as pictureHoverZoomOf};
1
+ import{HOVER_MOTION as E,motionSeconds as u}from"efficient-shell/format";import{finiteNumber as s}from"../finite-number.js";const i="hover",A="_gHover",H=["none","nextImage","rotate","zoom","lift","mono"],P={none:"None",nextImage:"Show next image",rotate:"Rotate",zoom:"Zoom",lift:"Lift",mono:"Black and white"};function a(n){return H.filter(e=>n.includes(e))}const v=a(["none","lift"]);function L(n){const e=n[i];return v.includes(e)?e:"none"}const R=a(["none","rotate"]),r={kind:i,angle:"hoverAngle",duration:"hoverDuration",delay:"hoverDelay"},l="spinOnHover",p={min:0,max:360,step:1},m={ProductGrid:"rotate",RelatedProducts:"rotate",AlloyWheelsListing:"none"},M=Object.keys(m);function I(n){return m[n]??"none"}const g=E.rotateFallbackDeg;function S(n,e){const t=n[r.kind];if(R.includes(t))return t;const o=n[l];return typeof o=="boolean"?o?"rotate":"none":e}function k(n){const e=s(n);return e===void 0?g:Math.min(p.max,Math.max(p.min,e))}function U(n,e){const t=I(e),o=S(n,t);return{kind:o,angle:o==="rotate"?k(n[r.angle]):null,duration:u("hover","duration",o==="rotate"?n[r.duration]:void 0),delay:u("hover","delay",o==="rotate"?n[r.delay]:void 0)}}function B(n){const e={field:r.kind,in:[...R]};return{any:[{field:r.kind,is:"rotate"},{all:[{not:e},n==="rotate"?{not:{field:l,is:!1}}:{field:l,is:!0}]}]}}const x=a(["none","mono"]),D=a(["none","nextImage","mono"]),O={ImageBlock:"none",Manifesto:"none",Split:"none",ContactLocations:"mono"},G=Object.keys(O);function N(n){return O[n]??"none"}const _={zoom:"hoverZoom",darken:"hoverDarken"},d={min:100,max:150,step:1,unit:"%"},c=["nextImage"];function V(n,e){if(!c.includes(e))return null;const t=s(n[_.zoom]);if(t===void 0)return null;const o=Math.min(d.max,Math.max(d.min,t));return o===d.min?null:String(o/100)}function h(n,e){if(!c.includes(e))return null;const t=s(n[_.darken]);return t!==void 0&&t>0?t:null}const C=["ImageBlock"];function K(n,e,t=x){const o=n[i];return t.includes(o)?o:e}function z(n,e=""){const t=C.includes(e)?D:x,o=K(n,N(e),t),f=o!=="none";return{kind:o,duration:u("hover","duration",f?n[r.duration]:void 0),delay:u("hover","delay",f?n[r.delay]:void 0),...c.includes(o)?{zoom:V(n,o),darken:h(n,o)}:{}}}function Y(){return{field:i,in:[...c]}}function b(n){return n==="none"?{field:i,in:["mono","nextImage"]}:{not:{field:i,is:"none"}}}export{p as CARD_HOVER_ANGLE,r as CARD_HOVER_KEYS,R as CARD_HOVER_KINDS,M as CARD_HOVER_SECTIONS,g as CARD_HOVER_TURN,A as HOVER_GROUP_KEY,i as HOVER_KEY,H as HOVER_KINDS,P as HOVER_KIND_LABELS,C as NEXT_PICTURE_BLOCKS,D as NEXT_PICTURE_HOVER_KINDS,l as OLD_SPIN_KEY,v as PART_HOVER_KINDS,G as PICTURE_HOVER_BLOCKS,_ as PICTURE_HOVER_KEYS,x as PICTURE_HOVER_KINDS,d as PICTURE_HOVER_ZOOM,k as cardHoverAngleOf,S as cardHoverKindOf,U as cardHoverOf,I as cardHoverResting,B as cardRotatesRule,L as hoverOf,K as pictureHoverKindOf,Y as pictureHoverMovesRule,z as pictureHoverOf,N as pictureHoverResting,b as pictureHoverRunsRule,V as pictureHoverZoomOf};
@@ -1,4 +1,5 @@
1
1
  import type { BoxAlign } from "efficient-easel/screen/lib/document/box-fields";
2
+ import type { ShowWhenRule } from "efficient-shell/format";
2
3
  export declare const NESTED_BOX_PADDING: {
3
4
  readonly sectionPaddingTop: 0;
4
5
  readonly sectionPaddingBottom: 0;
@@ -16,29 +17,42 @@ export declare const BOX_SHARE_POINTS: readonly [{
16
17
  readonly value: "equal";
17
18
  readonly weights: readonly [1, 1];
18
19
  }, {
19
- readonly label: "Big left";
20
20
  readonly value: "bigLeft";
21
21
  readonly weights: readonly [2, 1];
22
22
  }, {
23
- readonly label: "Big right";
24
23
  readonly value: "bigRight";
25
24
  readonly weights: readonly [1, 2];
26
25
  }, {
27
- readonly label: "Bigger left";
28
26
  readonly value: "biggerLeft";
29
27
  readonly weights: readonly [3, 1];
30
28
  }, {
31
- readonly label: "Bigger right";
32
29
  readonly value: "biggerRight";
33
30
  readonly weights: readonly [1, 3];
34
31
  }, {
35
- readonly label: "2 : 3";
36
32
  readonly value: "twoThree";
37
33
  readonly weights: readonly [2, 3];
38
34
  }];
39
35
  export type BoxShare = (typeof BOX_SHARE_POINTS)[number]["value"];
36
+ export declare const BOX_SHARE_CHOICES: readonly [{
37
+ readonly label: "Fit content";
38
+ readonly value: "content";
39
+ readonly weights: null;
40
+ }, {
41
+ readonly label: "Equal";
42
+ readonly value: "equal";
43
+ readonly weights: readonly [1, 1];
44
+ }, {
45
+ readonly label: "Custom";
46
+ readonly value: "custom";
47
+ readonly weights: readonly [2, 1];
48
+ }];
49
+ export type BoxShareChoice = (typeof BOX_SHARE_CHOICES)[number]["value"];
50
+ export declare function boxShareChoiceOf(share: unknown): BoxShareChoice;
51
+ export declare function boxShareVars(share: unknown, shareTablet: unknown, count: number): Record<string, number> | undefined;
52
+ export declare function boxShareWidthsOf(share: unknown, count: number): unknown;
40
53
  export declare function boxShareClasses(share: unknown): string;
41
- export declare function boxShareTabletOf(shareTablet: unknown): string | null;
54
+ export declare const BOX_GIVES_PICTURES_A_HEIGHT: ShowWhenRule;
55
+ export declare function boxShareTabletOf(shareTablet: unknown): string | readonly unknown[] | null;
42
56
  export declare function boxRowTabletShareClass(box: {
43
57
  direction?: unknown;
44
58
  separator?: unknown;
@@ -83,6 +97,7 @@ export declare function boxRowColumnsClass(box: {
83
97
  }): string;
84
98
  export declare function boxPhoneRowOneLine(wrapPhone: unknown): boolean;
85
99
  export declare function boxPhoneRowClasses(perRow: unknown, sharePhone?: unknown, wrapPhone?: unknown): string;
100
+ export declare function boxPhoneCellsShareLine(perRow: unknown, sharePhone: unknown): boolean;
86
101
  export declare function boxPhoneRowFits(perRow: unknown, sharePhone: unknown): boolean;
87
102
  export declare const BOX_BLOCK_SPACING_LABEL = "Block spacing";
88
103
  export declare const BOX_BLOCK_SPACING_POINTS: readonly [{
@@ -1 +1 @@
1
- import{isStripBox as o}from"./box-separator.js";const N={sectionPaddingTop:0,sectionPaddingBottom:0},r={start:"justify-start",center:"justify-center",between:"justify-between",end:"justify-end"},c={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"};function T(e,t){const w=typeof e=="string"&&e in r?r[e]:"",l=typeof t=="string"&&t in c?c[t]:"";return[w,l].filter(Boolean).join(" ")}function R(e){return e===!0||e==="wrap"?"flex-wrap":""}const P="Block widths",b=[{label:"Fit content",value:"content",weights:null},{label:"Equal",value:"equal",weights:[1,1]},{label:"Big left",value:"bigLeft",weights:[2,1]},{label:"Big right",value:"bigRight",weights:[1,2]},{label:"Bigger left",value:"biggerLeft",weights:[3,1]},{label:"Bigger right",value:"biggerRight",weights:[1,3]},{label:"2 : 3",value:"twoThree",weights:[2,3]}],i="[&>*]:min-w-0 [&>*]:flex-1 [&>*]:basis-0",h={equal:i,bigLeft:`${i} [&>*:first-child]:view-wide:grow-[2]`,bigRight:`${i} [&>*:last-child]:view-wide:grow-[2]`,biggerLeft:`${i} [&>*:first-child]:view-wide:grow-[3]`,biggerRight:`${i} [&>*:last-child]:view-wide:grow-[3]`,twoThree:`${i} [&>*:first-child]:view-wide:grow-[2] [&>*:last-child]:view-wide:grow-[3]`};function m(e){return typeof e=="string"?h[e]??"":""}const v="view-tablet:max-view-desktop:flex-row!",a=`${v} [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-0!`,p={content:`${v} [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[content]!`,equal:a,bigLeft:`${a} [&>*:first-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[2]!`,bigRight:`${a} [&>*:last-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[2]!`,biggerLeft:`${a} [&>*:first-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[3]!`,biggerRight:`${a} [&>*:last-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[3]!`,twoThree:`${a} [&>*:first-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[2]! [&>*:last-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[3]!`};function f(e){return typeof e=="string"&&e in p?e:null}function X(e){if(e.direction!=="row"||o(e.direction,e.separator)||e.loop==="scroll"||e.line===!0||x(e.columns)!==""||_(e.columnsTablet)!=="")return"";const t=f(e.shareTablet);return t===null?"":p[t]}const g="[&>*]:view-wide:basis-[content]";function $(e){return m(e)===""?g:""}const H="Columns",I=1,y=3,d={2:"max-view-wide:flex-wrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px)))/2)]",3:"max-view-wide:flex-wrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px))_*_2)/3)]"},W=b.filter(e=>e.value==="content"||e.value==="equal"),M="equal",U=1,F=6,n="view-wide:flex-wrap [&>*]:view-wide:min-w-0 [&>*]:view-wide:grow-0!",u={1:`${n} [&>*]:view-wide:basis-[calc(100%/1)]!`,2:`${n} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px))/2)]!`,3:`${n} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_2)/3)]!`,4:`${n} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_3)/4)]!`,5:`${n} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_4)/5)]!`,6:`${n} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_5)/6)]!`};function x(e){return typeof e=="number"?u[e]??"":""}const S={1:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc(100%/1)]!",2:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px)))/2)]!",3:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_2)/3)]!",4:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_3)/4)]!",5:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_4)/5)]!",6:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_5)/6)]!"};function _(e){return typeof e=="number"?S[e]??"":""}function q(e){return e.direction!=="row"||o(e.direction,e.separator)||e.loop==="scroll"||e.line===!0?"":_(e.columnsTablet)}function G(e){return e.direction!=="row"||o(e.direction,e.separator)||e.loop==="scroll"||e.line===!0?"":x(e.columns)}const O="max-view-wide:flex-wrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:grow-0 [&>*]:max-view-wide:basis-[content]",k={2:"max-view-wide:flex-nowrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px)))/2)]",3:"max-view-wide:flex-nowrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px))_*_2)/3)]"},L="max-view-wide:flex-nowrap [&>*]:max-view-wide:grow-0 [&>*]:max-view-wide:basis-[content]";function C(e){return e===!1||e==="nowrap"}function j(e,t,w){const l=d[Number(e)];if(!l)return"max-view-wide:flex-col";const s=C(w);return A(e,t)?s?L:O:s?k[Number(e)]:l}function A(e,t){return Number(e)in d&&t==="content"}const D="Block spacing",K=[{label:"Each block",value:"each"},{label:"Gap only",value:"gap"}],B="sf-box-gap-only";function Q(e){return e==="gap"?B:""}export{c as BOX_ALIGN_CLASS,D as BOX_BLOCK_SPACING_LABEL,K as BOX_BLOCK_SPACING_POINTS,F as BOX_COLUMNS_MAX,U as BOX_COLUMNS_MIN,B as BOX_GAP_ONLY_CLASS,H as BOX_PHONE_ROW_LABEL,y as BOX_PHONE_ROW_MAX,I as BOX_PHONE_ROW_MIN,P as BOX_SHARE_LABEL,M as BOX_SHARE_PHONE_DEFAULT,W as BOX_SHARE_PHONE_POINTS,b as BOX_SHARE_POINTS,N as NESTED_BOX_PADDING,Q as boxBlockSpacingClass,x as boxColumnsClass,$ as boxFitContentClass,T as boxLayoutClasses,j as boxPhoneRowClasses,A as boxPhoneRowFits,C as boxPhoneRowOneLine,G as boxRowColumnsClass,q as boxRowTabletColumnsClass,X as boxRowTabletShareClass,m as boxShareClasses,f as boxShareTabletOf,_ as boxTabletColumnsClass,R as boxWrapClass};
1
+ import{isStripBox as p}from"./box-separator.js";const W={sectionPaddingTop:0,sectionPaddingBottom:0},x={start:"justify-start",center:"justify-center",between:"justify-between",end:"justify-end"},h={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"};function U(e,t){const i=typeof e=="string"&&e in x?x[e]:"",n=typeof t=="string"&&t in h?h[t]:"";return[i,n].filter(Boolean).join(" ")}function q(e){return e===!0||e==="wrap"?"flex-wrap":""}const F="Block widths",f=[{label:"Fit content",value:"content",weights:null},{label:"Equal",value:"equal",weights:[1,1]},{value:"bigLeft",weights:[2,1]},{value:"bigRight",weights:[1,2]},{value:"biggerLeft",weights:[3,1]},{value:"biggerRight",weights:[1,3]},{value:"twoThree",weights:[2,3]}],G=[{label:"Fit content",value:"content",weights:null},{label:"Equal",value:"equal",weights:[1,1]},{label:"Custom",value:"custom",weights:[2,1]}];function j(e){return Array.isArray(e)?"custom":e==="equal"?"equal":typeof e=="string"&&e in v?"custom":"content"}const u=4,_=10;function k(e,t){if(!Number.isInteger(t)||t<2||t>u||e.length!==t-1||!e.every(a=>typeof a=="number"&&Number.isFinite(a)))return;const i=[];let n=0;return e.forEach((a,o)=>{const r=100-n-_*(t-1-o),c=Math.min(r,Math.max(_,Math.round(a)));i.push(c),n+=c}),i}function m(e,t,i){if(!Array.isArray(t))return;const n=k(t,i),a=n?[...n,100-n.reduce((r,c)=>r+c,0)]:[],o={};for(let r=0;r<u;r+=1)o[`--${e}-${r+1}`]=a[r]??1;return o}function D(e,t,i){const n=m("sf-share",e,i),a=m("sf-share-tablet",t,i);return n||a?{...n,...a}:void 0}function C(e,t){const i=Array.from({length:t},()=>1),n=f.find(r=>r.value===e);if(!n?.weights||t<1)return i;const[a,o]=n.weights;return a>1&&(i[0]=a),o>1&&(i[t-1]=o),i}function K(e,t){if(typeof e!="string"||!(e in v)||e==="equal")return e;const i=C(e,t),n=i.reduce((a,o)=>a+o,0);return i.slice(0,-1).map(a=>Math.round(a/n*100))}const s="[&>*]:min-w-0 [&>*]:flex-1 [&>*]:basis-0",v={equal:s,bigLeft:`${s} [&>*:first-child]:view-wide:grow-[2]`,bigRight:`${s} [&>*:last-child]:view-wide:grow-[2]`,biggerLeft:`${s} [&>*:first-child]:view-wide:grow-[3]`,biggerRight:`${s} [&>*:last-child]:view-wide:grow-[3]`,twoThree:`${s} [&>*:first-child]:view-wide:grow-[2] [&>*:last-child]:view-wide:grow-[3]`},L=`${s} [&>*:nth-child(1)]:view-wide:grow-[var(--sf-share-1,1)] [&>*:nth-child(2)]:view-wide:grow-[var(--sf-share-2,1)] [&>*:nth-child(3)]:view-wide:grow-[var(--sf-share-3,1)] [&>*:nth-child(4)]:view-wide:grow-[var(--sf-share-4,1)]`;function E(e){return Array.isArray(e)?L:typeof e=="string"?v[e]??"":""}const V={all:[{context:"parentType",is:"Flex"},{context:"parent.direction",is:"row"},{any:[{not:{context:"parent.align",set:!0}},{context:"parent.align",is:"stretch"}]},{not:{context:"parent.separator",set:!0}},{not:{context:"parent.loop",is:"scroll"}},{not:{context:"parent.line",is:!0}},{not:{context:"parent.bgImage",set:!0}},{any:[{context:"parent.columns",in:[2,3,4,5,6]},{all:[{not:{context:"parent.columns",is:1}},{context:"parent.share",in:Object.keys(v)}]}]}]},b="view-tablet:max-view-desktop:flex-row!",l=`${b} [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-0!`,g={content:`${b} [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[content]!`,equal:l,bigLeft:`${l} [&>*:first-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[2]!`,bigRight:`${l} [&>*:last-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[2]!`,biggerLeft:`${l} [&>*:first-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[3]!`,biggerRight:`${l} [&>*:last-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[3]!`,twoThree:`${l} [&>*:first-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[2]! [&>*:last-child:nth-child(n)]:view-tablet:max-view-desktop:grow-[3]!`},B=`${l} [&>*:nth-child(1):nth-child(n)]:view-tablet:max-view-desktop:grow-[var(--sf-share-tablet-1,1)]! [&>*:nth-child(2):nth-child(n)]:view-tablet:max-view-desktop:grow-[var(--sf-share-tablet-2,1)]! [&>*:nth-child(3):nth-child(n)]:view-tablet:max-view-desktop:grow-[var(--sf-share-tablet-3,1)]! [&>*:nth-child(4):nth-child(n)]:view-tablet:max-view-desktop:grow-[var(--sf-share-tablet-4,1)]!`;function N(e){return Array.isArray(e)||typeof e=="string"&&e in g?e:null}function Q(e){if(e.direction!=="row"||p(e.direction,e.separator)||e.loop==="scroll"||e.line===!0||S(e.columns)!==""||O(e.columnsTablet)!=="")return"";const t=N(e.shareTablet);return t===null?"":typeof t=="string"?g[t]:B}const T="[&>*]:view-wide:basis-[content]";function Y(e){return E(e)===""?T:""}const J="Columns",z=1,Z=3,d={2:"max-view-wide:flex-wrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px)))/2)]",3:"max-view-wide:flex-wrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px))_*_2)/3)]"},ee=f.filter(e=>e.value==="content"||e.value==="equal"),te="equal",ie=1,ne=6,w="view-wide:flex-wrap [&>*]:view-wide:min-w-0 [&>*]:view-wide:grow-0!",y={1:`${w} [&>*]:view-wide:basis-[calc(100%/1)]!`,2:`${w} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px))/2)]!`,3:`${w} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_2)/3)]!`,4:`${w} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_3)/4)]!`,5:`${w} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_4)/5)]!`,6:`${w} [&>*]:view-wide:basis-[calc((100%_-_var(--sf-gap-len,0px)_*_5)/6)]!`};function S(e){return typeof e=="number"?y[e]??"":""}const R={1:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc(100%/1)]!",2:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px)))/2)]!",3:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_2)/3)]!",4:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_3)/4)]!",5:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_4)/5)]!",6:"view-tablet:max-view-desktop:flex-row! view-tablet:max-view-desktop:flex-wrap! [&>*:nth-child(n)]:view-tablet:max-view-desktop:min-w-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:grow-0! [&>*:nth-child(n)]:view-tablet:max-view-desktop:basis-[calc((100%_-_var(--sf-gap-len-tablet,var(--sf-gap-len,0px))_*_5)/6)]!"};function O(e){return typeof e=="number"?R[e]??"":""}function ae(e){return e.direction!=="row"||p(e.direction,e.separator)||e.loop==="scroll"||e.line===!0?"":O(e.columnsTablet)}function re(e){return e.direction!=="row"||p(e.direction,e.separator)||e.loop==="scroll"||e.line===!0?"":S(e.columns)}const P="max-view-wide:flex-wrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:grow-0 [&>*]:max-view-wide:basis-[content]",$={2:"max-view-wide:flex-nowrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px)))/2)]",3:"max-view-wide:flex-nowrap [&>*]:max-view-wide:min-w-0 [&>*]:max-view-wide:basis-[calc((100%_-_var(--sf-gap-len-phone,var(--sf-gap-len,0px))_*_2)/3)]"},H="max-view-wide:flex-nowrap [&>*]:max-view-wide:grow-0 [&>*]:max-view-wide:basis-[content]";function X(e){return e===!1||e==="nowrap"}function oe(e,t,i){const n=d[Number(e)];if(!n)return"max-view-wide:flex-col";const a=X(i);return A(e,t)?a?H:P:a?$[Number(e)]:n}function se(e,t){return Number(e)in d&&!A(e,t)}function A(e,t){return Number(e)in d&&t==="content"}const le="Block spacing",we=[{label:"Each block",value:"each"},{label:"Gap only",value:"gap"}],I="sf-box-gap-only";function ce(e){return e==="gap"?I:""}export{h as BOX_ALIGN_CLASS,le as BOX_BLOCK_SPACING_LABEL,we as BOX_BLOCK_SPACING_POINTS,ne as BOX_COLUMNS_MAX,ie as BOX_COLUMNS_MIN,I as BOX_GAP_ONLY_CLASS,V as BOX_GIVES_PICTURES_A_HEIGHT,J as BOX_PHONE_ROW_LABEL,Z as BOX_PHONE_ROW_MAX,z as BOX_PHONE_ROW_MIN,G as BOX_SHARE_CHOICES,F as BOX_SHARE_LABEL,te as BOX_SHARE_PHONE_DEFAULT,ee as BOX_SHARE_PHONE_POINTS,f as BOX_SHARE_POINTS,W as NESTED_BOX_PADDING,ce as boxBlockSpacingClass,S as boxColumnsClass,Y as boxFitContentClass,U as boxLayoutClasses,se as boxPhoneCellsShareLine,oe as boxPhoneRowClasses,A as boxPhoneRowFits,X as boxPhoneRowOneLine,re as boxRowColumnsClass,ae as boxRowTabletColumnsClass,Q as boxRowTabletShareClass,j as boxShareChoiceOf,E as boxShareClasses,N as boxShareTabletOf,D as boxShareVars,K as boxShareWidthsOf,O as boxTabletColumnsClass,q as boxWrapClass};
@@ -1,9 +1,5 @@
1
- export declare const BOX_SHAPES: readonly ["auto", "tall", "square", "landscape", "wide"];
1
+ export declare const BOX_SHAPES: readonly ["auto", "tall", "square", "landscape", "video", "wide", "panorama"];
2
2
  export type BoxShape = (typeof BOX_SHAPES)[number];
3
- export declare const BOX_SHAPE_OPTIONS: readonly {
4
- label: string;
5
- value: BoxShape;
6
- }[];
7
3
  export declare function boxShapeOf(value: unknown): BoxShape;
8
4
  export declare function boxShapeClass(value: unknown): string;
9
5
  export declare function boxShapePhoneOf(desktop: unknown, phone: unknown): BoxShape | null;
@@ -1 +1 @@
1
- import{galleryCardRatioClass as n}from"./gallery-card-layout.js";const l=["auto","tall","square","landscape","wide"],b=[{label:"Auto",value:"auto"},{label:"Tall (3:4)",value:"tall"},{label:"Square (1:1)",value:"square"},{label:"Landscape (4:3)",value:"landscape"},{label:"Wide (2:1)",value:"wide"}];function o(e){return l.includes(String(e??""))?e:"auto"}function u(e){const a=o(e);return a==="auto"?"":n(a)}const r={tall:"view-wide:aspect-[3/4]",square:"view-wide:aspect-square",landscape:"view-wide:aspect-[4/3]",wide:"view-wide:aspect-[2/1]"},c={auto:"max-view-wide:aspect-auto",tall:"max-view-wide:h-auto max-view-wide:aspect-[3/4]",square:"max-view-wide:h-auto max-view-wide:aspect-square",landscape:"max-view-wide:h-auto max-view-wide:aspect-[4/3]",wide:"max-view-wide:h-auto max-view-wide:aspect-[2/1]"};function d(e,a){return l.includes(String(a??""))?a===o(e)?null:a:null}const p={auto:"view-tablet:max-view-desktop:aspect-auto!",tall:"view-tablet:max-view-desktop:h-auto! view-tablet:max-view-desktop:aspect-[3/4]!",square:"view-tablet:max-view-desktop:h-auto! view-tablet:max-view-desktop:aspect-square!",landscape:"view-tablet:max-view-desktop:h-auto! view-tablet:max-view-desktop:aspect-[4/3]!",wide:"view-tablet:max-view-desktop:h-auto! view-tablet:max-view-desktop:aspect-[2/1]!"};function v(e){return l.includes(String(e??""))?e:null}function m(e,a,w){const t=v(w),i=d(e,l.includes(String(a??""))?a:t);if(i===null&&t===null)return u(e);const s=o(e);return[i===null?u(e):s==="auto"?"":r[s],i===null?"":c[i],t===null?"":p[t]].filter(Boolean).join(" ")}export{l as BOX_SHAPES,b as BOX_SHAPE_OPTIONS,u as boxShapeClass,m as boxShapeClasses,o as boxShapeOf,d as boxShapePhoneOf,v as boxShapeTabletOf};
1
+ import{galleryCardRatioClass as u}from"./gallery-card-layout.js";const w=["auto","tall","square","landscape","video","wide","panorama"];function o(e){return w.includes(String(e??""))?e:"auto"}function l(e){const a=o(e);return a==="auto"?"":u(a)}const p={tall:"view-wide:aspect-[3/4]",square:"view-wide:aspect-square",landscape:"view-wide:aspect-[4/3]",video:"view-wide:aspect-[16/9]",wide:"view-wide:aspect-[2/1]",panorama:"view-wide:aspect-[21/9]"},v={auto:"max-view-wide:aspect-auto",tall:"max-view-wide:h-auto max-view-wide:aspect-[3/4]",square:"max-view-wide:h-auto max-view-wide:aspect-square",landscape:"max-view-wide:h-auto max-view-wide:aspect-[4/3]",video:"max-view-wide:h-auto max-view-wide:aspect-[16/9]",wide:"max-view-wide:h-auto max-view-wide:aspect-[2/1]",panorama:"max-view-wide:h-auto max-view-wide:aspect-[21/9]"};function d(e,a){return w.includes(String(a??""))?a===o(e)?null:a:null}const c={auto:"view-tablet:max-view-desktop:aspect-auto!",tall:"view-tablet:max-view-desktop:h-auto! view-tablet:max-view-desktop:aspect-[3/4]!",square:"view-tablet:max-view-desktop:h-auto! view-tablet:max-view-desktop:aspect-square!",landscape:"view-tablet:max-view-desktop:h-auto! view-tablet:max-view-desktop:aspect-[4/3]!",video:"view-tablet:max-view-desktop:h-auto! view-tablet:max-view-desktop:aspect-[16/9]!",wide:"view-tablet:max-view-desktop:h-auto! view-tablet:max-view-desktop:aspect-[2/1]!",panorama:"view-tablet:max-view-desktop:h-auto! view-tablet:max-view-desktop:aspect-[21/9]!"};function r(e){return w.includes(String(e??""))?e:null}function m(e,a,n){const t=r(n),i=d(e,w.includes(String(a??""))?a:t);if(i===null&&t===null)return l(e);const s=o(e);return[i===null?l(e):s==="auto"?"":p[s],i===null?"":v[i],t===null?"":c[t]].filter(Boolean).join(" ")}export{w as BOX_SHAPES,l as boxShapeClass,m as boxShapeClasses,o as boxShapeOf,d as boxShapePhoneOf,r as boxShapeTabletOf};
@@ -0,0 +1,9 @@
1
+ export declare const SHOW_FOR_PROP = "showFor";
2
+ export interface ShowForChoice {
3
+ slug: string;
4
+ name: string;
5
+ }
6
+ export declare function registerShowForChoices(choices: readonly ShowForChoice[] | null): void;
7
+ export declare function showForChoices(): readonly ShowForChoice[];
8
+ export declare function showForChoicesRevision(): number;
9
+ export declare function showForOf(value: unknown): ShowForChoice | undefined;
@@ -0,0 +1 @@
1
+ import{globalRegistry as s}from"../global-registry.js";const c="showFor";function e(){return s("efficient.box-show-for-choices",()=>({choices:[],revision:0}))}const i=o=>!!o&&typeof o=="object"&&typeof o.slug=="string"&&o.slug.trim()!==""&&typeof o.name=="string"&&o.name.trim()!=="";function f(o){const r=e();r.choices=(o??[]).filter(i).map(t=>({slug:t.slug,name:t.name})),r.revision+=1}function u(){return e().choices}function h(){return e().revision}function g(o){return i(o)?{slug:o.slug,name:o.name}:void 0}export{c as SHOW_FOR_PROP,f as registerShowForChoices,u as showForChoices,h as showForChoicesRevision,g as showForOf};