efficient-web-builder 46.0.0 → 47.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/README.md +6 -0
  3. package/dist/editor/components/PagesPanel.js +1 -1
  4. package/dist/editor/lib/animation/entrance-fields.js +1 -1
  5. package/dist/editor/lib/document/ColourControl.d.ts +4 -7
  6. package/dist/editor/lib/document/ColourControl.js +1 -1
  7. package/dist/editor/lib/document/blocks/general/ButtonBlock/fields.js +1 -1
  8. package/dist/editor/lib/document/blocks/general/Divider/fields.js +1 -1
  9. package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
  10. package/dist/editor/lib/document/blocks/general/Grid/fields.js +1 -1
  11. package/dist/editor/lib/document/blocks/general/HeroGroup/fields.js +1 -1
  12. package/dist/editor/lib/document/blocks/general/HeroSingle/fields.js +1 -1
  13. package/dist/editor/lib/document/box-fields.d.ts +2 -1
  14. package/dist/editor/lib/document/box-fields.js +1 -1
  15. package/dist/editor/lib/document/consent-words-field.d.ts +1 -2
  16. package/dist/editor/lib/document/consent-words-field.js +1 -1
  17. package/dist/editor/lib/document/controls.d.ts +7 -60
  18. package/dist/editor/lib/document/controls.js +1 -1
  19. package/dist/editor/lib/document/passes/inspector.js +1 -1
  20. package/dist/format/lib/content/section-corners.d.ts +2 -4
  21. package/dist/format/lib/content/section-corners.js +1 -1
  22. package/dist/format/lib/document/box-footer.js +1 -1
  23. package/dist/format/lib/document/easel-row-words.d.ts +6 -0
  24. package/dist/format/lib/document/easel-row-words.js +1 -0
  25. package/dist/format/lib/document/passes/types.d.ts +2 -1
  26. package/dist/format/lib/editor-words-catalogue.d.ts +0 -5
  27. package/dist/format/lib/editor-words-catalogue.js +2 -2
  28. package/dist/format/lib/source-rules/one-alignment-row.js +2 -2
  29. package/dist/format/lib/theme.d.ts +1 -0
  30. package/dist/format/lib/theme.js +4 -4
  31. package/dist/render/components/ButtonBlock.d.ts +2 -0
  32. package/dist/render/components/ButtonBlock.js +1 -1
  33. package/dist/render/components/Flex.js +1 -1
  34. package/dist/render/components/Grid.d.ts +2 -1
  35. package/dist/render/components/Grid.js +1 -1
  36. package/dist/render/components/HeroGroup.d.ts +2 -1
  37. package/dist/render/components/HeroGroup.js +1 -1
  38. package/dist/render/components/InBoxContext.d.ts +23 -1
  39. package/dist/render/components/InBoxContext.js +1 -1
  40. package/dist/render/components/SectionAnimation.js +1 -1
  41. package/dist/render/components/SiteGutterFrame.d.ts +3 -0
  42. package/dist/render/components/SiteGutterFrame.js +1 -1
  43. package/dist/render/components/Text.d.ts +2 -1
  44. package/dist/render/components/Text.js +1 -1
  45. package/dist/render/lib/content/block-size.d.ts +21 -0
  46. package/dist/render/lib/content/block-size.js +1 -0
  47. package/dist/render/lib/content/button-look.d.ts +6 -6
  48. package/dist/render/lib/content/button-look.js +1 -1
  49. package/dist/render/lib/document/blocks/general/ButtonBlock/render.js +1 -1
  50. package/dist/render/lib/document/blocks/general/Grid/render.js +1 -1
  51. package/dist/render/lib/document/blocks/general/HeroGroup/render.js +1 -1
  52. package/dist/render/lib/document/blocks/general/LocationMap/render.js +1 -1
  53. package/dist/render/lib/document/blocks/general/Text/render.js +1 -1
  54. package/dist/render/lib/document/passes/block-size.js +1 -1
  55. package/dist/render/lib/document/passes/index.js +1 -1
  56. package/dist/render/lib/document/passes/section-height.js +1 -1
  57. package/dist/render/lib/document/passes/section-sticky.js +1 -1
  58. package/dist/render/lib/document/passes/section-theme.js +1 -1
  59. package/dist/render/lib/document/passes/slots-start-afresh.d.ts +2 -0
  60. package/dist/render/lib/document/passes/slots-start-afresh.js +1 -0
  61. package/dist/render/lib/media.d.ts +0 -1
  62. package/dist/render/lib/media.js +1 -1
  63. package/package.json +3 -3
  64. package/dist/editor/components/DuplicatePageDialog.d.ts +0 -10
  65. package/dist/editor/components/DuplicatePageDialog.js +0 -1
  66. package/dist/editor/lib/page-copy.d.ts +0 -6
  67. package/dist/editor/lib/page-copy.js +0 -1
  68. package/dist/format/lib/content/block-size.d.ts +0 -59
  69. package/dist/format/lib/content/block-size.js +0 -1
@@ -1 +1 @@
1
- "use client";import{jsx as i,jsxs as B,Fragment as L}from"react/jsx-runtime";import{cloneElement as _e,useEffect as Rt,useId as we,useRef as z,useState as M}from"react";import{useEasel as ie}from"efficient-easel/easel";import{toDateKey as Ft,fromDateKey as Lt}from"efficient-shell/format";import{say as s,editorEaselWords as S}from"../../../format/lib/editor-words.js";import{mediaValueSrc as Ie}from"../../../format/lib/media-value.js";import{LOADING_SHOWS_LABELS as Te,loadingShowsOf as Pt}from"../../../format/lib/hero-video.js";import{readHidable as Ee,hidableText as Oe}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as le,LINK_FIELD_MARKER as Re,MEDIA_FIELD_MARKER as Fe,SCAFFOLD_FIELD_MARKER as Le,TEXT_FIELD_MARKER as w,foldMetaOf as se,textFieldIdentifier as Nt}from"efficient-easel/draw";import kt from"../../components/ApplyCornersToSiblings.js";import At from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as vt,CORNER_RADIUS_MAX as Pe,CORNER_RADIUS_MIN as D}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as Bt,IMAGE_CORNERS_LABEL as Dt}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as Ht}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as Gt,GALLERY_LAYOUTS as Y,GALLERY_LAYOUT_KEYS as Mt,galleryChoices as Ne,galleryPictureCells as Wt}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as Kt}from"./shell-glyph.js";import{anchorSiblingsOf as Ut,placementPoints as $t}from"../../../format/lib/hero-group-placement.js";import Xt,{KEEP_HINT_CLASS as jt}from"../../components/KeepHint.js";import zt from"../../components/AnchorField.js";import{AdjustIcon as Yt,EyeIcon as Vt,AnimationIcon as qt,BackgroundIcon as Zt,BorderAllIcon as Jt,BlockSectionIcon as Qt,ColumnWidthsIcon as ke,ColumnsIcon as en,CornerIcon as tn,DirectionDownIcon as nn,DirectionLeftIcon as on,DirectionRightIcon as rn,DirectionUpIcon as ln,EditIcon as sn,GapIcon as an,GridIcon as cn,GroundIcon as Ae,HashIcon as ve,HeightIcon as dn,ImageIcon as un,ListIcon as pn,LocationIcon as Be,PaddingBottomIcon as De,PaddingLeftIcon as He,PaddingRightIcon as Ge,PaddingTopIcon as Me,PageIcon as fn,StickyIcon as hn,RotateIcon as mn,SearchIcon as gn,SquareIcon as bn,TextLinesIcon as We,TypeIcon as xn,WidthIcon as ae}from"efficient-easel/icons";import{FieldGlyph as Ke}from"../../components/FieldGlyph.js";import{resolvePageBackground as Sn}from"../../../format/lib/content/page-background.js";import{CORNER_SIDES as Ue,CORNER_SIDE_POINTS as yn,hasOwnSectionCorners as Cn,normalizeCornerSides as $e}from"../../../format/lib/content/section-corners.js";import{enclosingPath as _n,enclosingSection as wn}from"./enclosing-section.js";import{SettingsDefaultReset as y,SettingsDrill as In,SettingsField as m,SettingsGroup as Tn,SettingsGroupSub as En,SettingsSegmented as On,SettingsBorder as Rn,SettingsSidesEach as Fn,SettingsSwitch as ce,borderSides as Ln,borderStartEach as Pn}from"efficient-easel/panel";import{ListField as Nn}from"efficient-easel/fields";import{DisplayChips as kn}from"efficient-shell/ui";import{desktopDisplayChanged as An,partShownOnDesktop as vn,partShownOnPhone as Bn,phoneDisplayChanged as Dn,withDesktopPart as Hn,withPhonePart as Gn}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as Mn,Checkbox as Wn,ColorSwatch as Kn,CornersInput as Un,DatePicker as $n,DateTimePicker as Xn,FOCAL_DEFAULT as jn,PictureTiles as zn,IconPicker as Yn,IconButton as Xe,InputNumber as je,Slider as Vn,Tooltip as V}from"efficient-shell/ui";import{ColourRow as ze,InheritedColourRow as Ye}from"./ColourControl.js";import Ve from"./MarkupToolbar.js";import{deviceField as g}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as qn,NoControlMark as Zn,noControlField as qe}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as Jn}from"../../../format/lib/document/own-box.js";import{PHONE_CLEAR as Qn,resolvePhoneValue as de}from"../../../format/lib/document/phone-override.js";import{phoneKey as P}from"efficient-easel/draw";import{SuppressibleText as eo}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as to,CARD_OUTLINE_OPTIONS as no,DEFAULT_CARD_INDEX_FORMAT as oo,DEFAULT_CARD_OUTLINE as ro}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as io,DEFAULT_COVER_INDEX as lo}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as so}from"efficient-easel/draw";import ao from"../../components/MediaUploadField.js";import{useSelectedHost as ue}from"./selected-host.js";import co from"../../components/MultiSelectField.js";import uo from"../../components/SectionThemePicker.js";import po from"../../components/SearchSelectField.js";import fo from"../../components/StorefrontLinkField.js";import{UiIcon as Ze}from"efficient-easel/draw/client";import{SECTION_PADDING as I}from"../../../render/lib/content/section-padding.js";import{BLOCK_FIXED_WIDTH as Je,BLOCK_WIDTH_FIT_DEFAULT as Qe,BLOCK_WIDTH_FIT_POINTS as et,BLOCK_WIDTH_LIMIT as q,TEXT_FIT_MIN_FONT as tt,TEXT_FIT_POINTS as nt,parseBlockWidthFit as ho,parseTextFit as mo}from"../../../format/lib/content/block-size.js";import{buttonLook as go,buttonWordsSummary as bo}from"../../../render/lib/content/button-look.js";import{nonEmptyString as xo}from"../../../format/lib/non-empty-string.js";import{usePreviewParts as So}from"efficient-easel/draw/client";import{encodePartId as yo}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as Co,useEaselStrings as _o}from"efficient-easel/strings";import{hasPhoneHeight as wo,resolveSectionMinHeight as Io}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as Z,SECTION_STICK_LABEL as pe,hasPhoneStick as To,resolveSectionStick as Eo}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as Oo,SECTION_MIN_HEIGHT_GROUP_LABEL as W,SECTION_SCREEN_PCT as Ro}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as Fo,resolveContainerDirection as ot}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as Lo,BOX_BLOCK_SPACING_POINTS as rt,BOX_PHONE_ROW_LABEL as Po,BOX_PHONE_ROW_MAX as No,BOX_PHONE_ROW_MIN as it,BOX_SHARE_LABEL as fe,BOX_SHARE_PHONE_DEFAULT as ko,BOX_SHARE_PHONE_POINTS as Ao,BOX_SHARE_POINTS as vo}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as O}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as Bo}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as lt,normalizeTheme as st,selectedThemeColors as Do,siteButtonPaint as at}from"../../../format/lib/theme.js";import{CONTAINER_GAP_BUILT_IN as Ho,CONTAINER_GAP_PHONE as Go,GAP_FIELD_CONTAINER as ct,hasOwnContainerGap as Mo,hasOwnPhoneGap as Wo,resolveContainerGap as Ko,resolvePhoneContainerGap as dt}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as Uo,CARD_IMAGE_BG_OFF as $o,CARD_IMAGE_BG_SWATCH_NAMES as Xo,CARD_IMAGE_BG_SWATCHES as jo,isCardImageBackgroundInheriting as zo,cardImageBackgroundChoice as Yo,THEME_CARD_IMAGE_BG as Vo}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as qo,SECTION_BG_SWATCHES as Zo,SECTION_BG_SWATCH_NAMES as Jo,THEME_SECTION_BG as Qo,isSectionBackgroundInheriting as er}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as tr,nestedAccentValue as ut,resolveSectionAccent as J}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as nr,TYPE_SIZE_INHERIT as or,isTypeSizeInheriting as rr}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as ir,WIDTH_CHOICE_LABEL as lr,WIDTH_INHERIT as sr}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as ar}from"./panel-heading-scope.js";import{useEaselSession as cr}from"efficient-easel/screen/lib/session-context";import{backendOf as dr}from"../website-session.js";import{BOX_GAP as ur,describedAs as T,group as C,iconOf as H,noGlyph as pt,sharedStyleKinds as K}from"efficient-easel/screen/lib/document/box-fields";import{directionField as pr,gapField as ft,Segmented as Q,segmented as he,select as U,slider as G}from"./box-fields.js";function Hl({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?s(e):e})}function N(e,t){return s("{value} from {from}",{value:e,from:t})}function fr(){const{blockGap:e}=O();return e===null?s("this container's own spacing"):N(`${e}px`,s("Styles"))}function hr({inherited:e,onReset:t,label:n}){return i(y,{words:S()?.panel,label:s(n),changed:!e,detail:fr(),onReset:t})}function Gl(e){return ft({...ur,builtIn:Ho[e],resolve:(t,n)=>Ko(e,t,n?.siteGap),action:(t,n)=>i(hr,{inherited:!Mo(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[ct]:e}})}function Ml(e){return g("mobile",{[ct]:e,type:"custom",render:t=>i(mr,{container:e,...t})})}function mr({container:e,...t}){const[n]=E("gap"),o=t.field?.siteGap,r=dt(e,void 0,n,o);return ft({...Go,builtIn:r,resolve:a=>dt(e,a,n,o),action:(a,c)=>i(y,{words:S()?.panel,label:s("Gap"),changed:Wo(a),detail:N(`${r}px`,s("Desktop")),onReset:()=>c(void 0)})}).render(t)}function Wl(e){return pr({offered:Fo(e),fallback:ot(e,void 0),resolve:t=>ot(e,t)})}function Kl(e,t){return $t(t?Ut(e,t):[],t)}function gr({inherited:e,onReset:t,label:n}){return i(y,{words:S()?.panel,label:s(n),changed:!e,detail:N(s("Full"),s("the page")),onReset:t})}function k({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:l,hideable:a=!0,markup:c=!0}){const{text:d,hidden:p}=Ee(e),h=z(null),f=z(null),u=F=>t(a?{text:F,hidden:p}:F),x=()=>t({text:d,hidden:!p}),b=a&&p,R=we(),_=r?Cr(r)?i("span",{className:"sf-hint-keep sf-hint-while-typing",children:s(r)}):i(Xt,{children:s(r)}):void 0,j=p?s("Show {label} on the slide",{label:s(n)}):s("Hide {label} on the slide",{label:s(n)});return i(m,{label:s(n),icon:i(xn,{}),htmlFor:R,className:b?"is-hidden":void 0,hint:_,action:a?i(V,{content:j,children:i(Xe,{"aria-pressed":p,"aria-label":j,onClick:x,children:p?i(Ze,{name:"eye-off",size:14}):i(Ze,{name:"eye",size:14})})}):void 0,children:B("div",{className:"sf-copybox",children:[c&&i(Ve,{target:l?f:h,value:d,onChange:u}),l?i("textarea",{id:R,ref:f,value:d,placeholder:o===void 0?void 0:s(o),onChange:F=>u(F.target.value)}):i("input",{id:R,ref:h,type:"text",value:d,placeholder:o===void 0?void 0:s(o),onChange:F=>u(F.target.value)})]})})}function Ul(e,t){return{...e,[Le]:t}}function $l(e){const t=e[w];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[w]:{...t,offPage:!0}}}function Xl(e){return!e||typeof e!="object"?!1:e[w]?.offPage===!0}const ht="sfPanelOnly";function jl(e){if(!e[w])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[ht]:!0}}function zl(e){return!!e&&typeof e=="object"&&e[ht]===!0}function Yl(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 da,SCALAR_TEXT_CONTROLS as ua}from"efficient-easel/draw";function Vl(e,t){if(!e[w])throw new Error("inOwnBox: the field holds no authored text");const{[qn]:o,...r}=e;return{...r,[Jn]:!0,render:t}}const br=new Set(so),$={type:"radio",options:[{value:!0},{value:!1}]},mt={text:{type:"object",objectFields:{text:{type:"text"},hidden:$}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:$}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},A=(e,t)=>{const n=T({...t,[w]:e},{...mt[e.control],label:e.label});if(!br.has(e.control))return n;const o=t.render;return{...qe(n,"authored-copy"),render:r=>i(eo,{name:r.name,children:o(r)})}},ql="Everything else on this block comes from the linked post. Unlink it to edit by hand.",xr={field:"source.slug",set:!0},Zl={not:xr},Sr="Select a word, then press the highlighter.",yr=new Set([Sr]),Cr=e=>yr.has(e);function Jl(e,t,n){return A({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(k,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function Ql(e,t,n){return A({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(k,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function es(e,t,n){return A({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(k,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function ts(e,t,n){return A({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(k,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function ns(e){return{type:"custom",[Re]:{label:e},...T({},{type:"text",label:e}),render:({value:t,onChange:n})=>i(fo,{value:Oe(t),onChange:n,label:e})}}function os(e,t,n){return A({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(k,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const rs={Design:Yt,Animation:qt};function is(e,t){return e.includes("Design")?t!=="Design":null}function ls(e){return{type:"custom",render:()=>i(_r,{text:e})}}function _r({text:e}){return i("p",{className:"sf-note",children:s(e)})}function ss(e){return se(e)!==null&&e?.tabs!==void 0}const gt=new Map;function as(e,t){const n=`${e}\0${t?t.join(""):""}`,o=gt.get(n)??{type:"custom",tabs:t,[le]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(L,{})};return gt.set(n,o),o}const bt=new Map;function cs(e){const t=bt.get(e)??{type:"custom",[le]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(L,{})};return bt.set(e,t),t}function wr(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function ds(e,t){return wr(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 ps({title:e,children:t}){const[n,o]=M(()=>!me.has(e));return i(Tn,{title:e,open:n,onToggle:r=>{o(r),r?me.delete(e):me.add(e)},children:t})}const me=new Set;function fs({label:e}){return i(En,{title:s(e),level:ar(2)})}function xt({swatches:e,current:t,onPick:n,names:o}){const r=e.find(c=>c.toLowerCase()===t.toLowerCase()),l=r?o?.[r]:void 0,a=l?s(l):t;return B("div",{className:"sf-swatches",children:[e.map(c=>{const d=o?.[c]?s(o[c]):c;return i(V,{content:d,children:i(Kn,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":d})},c)}),i("span",{className:"sf-swatch-hex",children:a})]})}function hs(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=er(n,t);return i(m,{label:s(e),icon:i(Zt,{}),changed:!r,action:i(y,{words:S()?.panel,label:s(e),changed:!r,detail:s("the theme's section background"),onReset:()=>o(qo)}),children:xt({swatches:Zo,current:r?Qo:n??t??"",onPick:o,names:Jo})})}}}function Ir(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,l=zo(r,t);return i(m,{label:s(e),icon:i(Ae,{}),changed:!l,action:i(y,{words:S()?.panel,label:s(e),changed:!l,detail:s("the theme's image stage"),onReset:()=>o(Uo)}),children:xt({swatches:jo,current:l?Vo:Yo(r,t),onPick:o,names:Xo})})}}}function ms(e=n=>n,t){return K({_gSectionTheme:C(tr),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(uo,{value:e(n),onChange:o,followLabel:t})}})}function X({min:e,max:t,step:n,value:o,onChange:r,suffix:l="",readout:a=!0,notch:c,ariaLabel:d,disabled:p=!1}){const h=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:h?"sf-slider has-notch":"sf-slider",style:h?{"--sf-notch":(c-e)/(t-e)}:void 0,children:i(Vn,{min:e,max:t,step:n,value:o,suffix:l||void 0,showInput:a,label:d===void 0?void 0:s(d),disabled:p,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:f=>{f!==null&&f!==o&&r(f)}})})}function ge(e,t){const{min:n,max:o,step:r=1,unsetLabel:l,hint:a,restTrack:c,unsetMark:d,icon:p,unit:h="px"}=t;return{type:"custom",render:({value:f,onChange:u})=>{const x=typeof f=="number"?f:null,b=x===null;return i(m,{label:s(e),icon:p?H(p):void 0,value:b?d||l===void 0?void 0:s(l):`${x}${h}`,changed:!b,action:d?_e(d,{changed:!b,onReset:()=>u(null)}):i(y,{words:S()?.panel,label:s(e),changed:!b,onReset:()=>u(null)}),hint:typeof a=="string"?s(a):a,children:c?c({min:n,max:o,step:r,px:x,label:e,onChange:u}):X({min:n,max:o,step:r,value:x??n,readout:!1,ariaLabel:e,onChange:u})})}}}const ee="Corners";function be(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,r=o!==null;return i(m,{label:s(ee),icon:i(tn,{}),changed:r,action:_e(e.mark,{changed:r,onReset:()=>n(null)}),hint:e.hint,children:i(Er,{tier:e,px:o,onRadius:n})})}}}function E(e){const t=ue();return[t?.values?.[e],n=>t?.onChange(e,n)]}function xe(e){const t=qe({type:"custom",render:()=>i(Zn,{})},"always");return e===void 0?t:{...t,reachedBy:e}}function Tr(){const e=ue();return t=>e?.onChangeMany(t)}function Er({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),[r,l]=E(e.sidesKey),a=$e(r)??[...Ue];return i(Un,{label:s(ee),value:a,corners:yn,onChange:c=>{const d=$e(c)??[];l(d.length===Ue.length?null:d)},radius:t,onRadiusChange:n,radiusMin:D,radiusMax:Pe,radiusStep:e.step??1,radiusPlaceholder:String(o)})}function St(){return xe()}function Or({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=O(),r=typeof o=="number"?`${o}px`:s("not set");return i(y,{words:S()?.panel,label:s(e),changed:t,detail:o==null?s("the built-in corners"):N(r,s("Styles")),onReset:n})}function Rr(){const{cornerRadiusPx:e}=O();return typeof e=="number"?e:D}function Fr(){return be({sidesKey:"sectionCornerSides",useFollowed:Rr,mark:i(Or,{label:ee}),hint:Lr})}const Lr="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function gs(){return K({_gShape:C("Shape"),sectionCorners:Fr(),sectionCornerSides:St(),sectionBorder:Ct("desktop"),sectionBorderPhone:Ct("mobile")})}const Pr=()=>({width:s("Border width"),sides:{top:s("Border top"),right:s("Border right"),bottom:s("Border bottom"),left:s("Border left")},style:s("Border style"),styles:{solid:s("Solid"),dashed:s("Dashed"),dotted:s("Dotted")},color:s("Border color"),unit:"px"});function Nr(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function kr(){let e;try{const t=st(O().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||lt.line}function yt({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:l=!0,above:a={}}){const c=e&&typeof e=="object"?e:{},[d,p]=M(()=>r?Pn(c,a):!1),h=Pr(),f=u=>Nr(r&&l?u:{width:u.width,color:u.color,...l?{style:u.style}:{}});return i(m,{label:s("Border"),icon:i(Jt,{}),action:r?i(Fn,{each:d,label:s("Each side"),onChange:p}):void 0,children:i(Rn,{label:s("Border"),value:c,each:d,onChange:u=>t(f(u)),placeholder:n,presets:o,words:h,styles:l,max:Bo})})}function Ar({value:e,onChange:t,tier:n}){const[o]=E("sectionBorder"),r=kr(),l=n==="mobile"?o&&typeof o=="object"?o:{}:{};return i(yt,{value:e,onChange:t,placeholder:{sides:Ln(l),style:l.style??"solid",color:l.color||r},presets:[r],above:l})}function Ct(e){return g(e,{type:"custom",render:({value:t,onChange:n})=>i(Ar,{value:t,onChange:n,tier:e})})}function bs(e){return{type:"custom",render:()=>i(vr,{partKey:e})}}function vr({partKey:e}){const[t]=E("id"),[n]=E("_partStyles"),{textStyles:o}=O(),r=_o();let l=null;try{l=So().select}catch{l=null}const a=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i(In,{name:s("Text"),preview:bo(a,c,{noStyle:s("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??Co.copy.panel).cases}),onOpen:()=>{l&&typeof t=="string"&&l(yo(t,e))}})}function xs(){return{type:"custom",render:({value:e,onChange:t})=>i(Br,{value:e,onChange:t})}}function Br({value:e,onChange:t}){const[n]=E("variant"),[o]=E("buttonColor"),{theme:r}=O(),a=go({variant:n,buttonColor:o,buttonBorder:e&&typeof e=="object"?e:{}}).border.width,c=xo(o)??(n==="ghost"?Do(r).text:at(r).fill);return i(yt,{value:e,onChange:t,placeholder:{sides:{top:a,right:a,bottom:a,left:a},style:"solid",color:c},presets:[c],sides:!1,styles:!1})}function _t(e){const{cornerRadiusPx:t}=O(),n=typeof t=="number"?t:e;let o=null;try{const{appState:l,selectedItem:a}=ie(d=>d),c=a?.props?.id?String(a.props.id):void 0;o=c?wn(l?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return Cn(r)?r:n}function Dr({label:e,changed:t=!1,onReset:n=()=>{}}){const o=_t(D);return i(y,{words:S()?.panel,label:s(e),changed:t,detail:N(`${o}px`,s("the section")),onReset:n})}function Hr(){return i(L,{children:s("Follows the section's Corners until you set a number here.")})}function Gr(){return be({sidesKey:"cardCornerSides",useFollowed:()=>_t(D),mark:i(Dr,{label:ee}),hint:i(Hr,{})})}function Mr(){return{type:"custom",render:()=>i(kt,{})}}function Ss(e){return{...e,render:t=>i(At,{render:e.render,props:t})}}function ys(){return{_gShape:C("Shape"),cardCorners:Gr(),cardCornerSides:St(),cardCornersApplyAll:Mr()}}function Wr(e=vo,t=e[0].value){return T({type:"custom",render:({value:n,onChange:o})=>{const r=e.find(l=>l.value===n)??e.find(l=>l.value===t)??e[0];return i(m,{label:s(fe),icon:i(ke,{}),value:s(r.label),children:i(zn,{className:"sf-gallery-layouts",label:s(fe),value:r.value,onChange:o,options:e.map(l=>({value:l.value,label:s(l.label),picture:i("span",{className:"sf-gallery-pic",children:Kr(l.weights).map((a,c)=>i("i",{style:{gridColumn:`span ${a}`}},c))})}))})})}},{type:"select",label:fe,options:e.map(n=>({value:n.value,label:n.label}))})}function Kr(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 Cs(){return U(Lo,i(an,{}),rt,rt[0].value)}function _s(){return g("mobile",Wr(Ao,ko))}function ws(){return g("mobile",G(Po,i(en,{}),it,No,1,it))}function Is(e,t,n,o,r,l){return{type:"custom",render:({value:a,onChange:c})=>i(m,{label:s(e),icon:i(Ke,{noun:l}),action:i(y,{words:S()?.panel,label:s(e),changed:!rr(a),detail:s("the Text style in Styles"),onReset:()=>c(or),defaultAction:{onPress:()=>c(nr),title:s("Keep this section's own built-in size"),icon:i(Qt,{})}}),children:X({min:t,max:n,step:o,value:typeof a=="number"?a:r,suffix:"px",ariaLabel:e,onChange:c})})}}function Ts(){return{_gCellWidth:C("Cell width"),gridSpan:U("Positions",i(ke,{}),[{label:"Auto",value:""},...Array.from({length:Ht},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}const wt=pt("a value or limit row under the Width and text-fit choices; drawn bare in the approved design (owner 2026-10-29, c25 row 4); no shell glyph names a min, max or fixed width");function te(e,t,n,o,r){const l=r===void 0?G(t,pt("a fixed width or min font size under its choice; drawn bare in the approved design (owner 2026-10-29, c25 row 4)"),n.min,n.max,n.step,o,"px"):ge(t,{...n,unsetLabel:r,icon:wt});return{[e]:g("desktop",l),[P(e)]:g("mobile",Tt({label:t,desktopKey:e,icon:wt,...n,fallback:o}))}}const Se=e=>e.map(t=>({label:t.label,value:t.value}));function It(e,t,n,o,r,l,a){const c=Se(r);return{[e]:g("desktop",t),[P(e)]:g("mobile",Xr({label:n,icon:o,options:c,desktopKey:e,resolve:(d,p)=>l(d)??l(p)??a}))}}function Es(e={}){const t={_gBlockSize:C("Size"),...It("widthFit",he("Width",i(ae,{}),Se(et),Qe),"Width",i(ae,{}),et,ho,Qe),...te("width","Fixed width",Je,Je.fallback),...te("minWidth","Min width",q,q.min,"None"),...te("maxWidth","Content width",q,q.min,"None")},n=e.textFit?{_gText:C("Text"),...It("textFit",he("When the text does not fit",i(We,{}),Se(nt),e.textFit),"When the text does not fit",i(We,{}),nt,mo,e.textFit),...te("minFont","Min font size",tt,tt.fallback)}:{};return{size:t,text:n}}function v(){let e=null;try{e=ie(t=>t).selectedItem}catch{e=null}return e?.props??{}}function Ur({min:e,max:t,step:n,px:o,label:r,onChange:l,desktopKey:a,fallback:c}){const d=v()[a],p=de(void 0,d,c);return i(L,{children:X({min:e,max:t,step:n,value:de(o,d,c),readout:!1,ariaLabel:r,notch:p,onChange:l})})}function $r({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:l=()=>{}}){const a=v()[t],c=de(void 0,a,n);return i(y,{words:S()?.panel,label:s(e),changed:r,detail:s("{value} on desktop",{value:`${c}${o}`}),onReset:l})}function Tt(e){return ge(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:i($r,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:t=>i(Ur,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}function Xr(e){return{type:"custom",render:({value:t,onChange:n})=>i(zr,{...e,value:t,onChange:n})}}function jr({label:e,icon:t,options:n,value:o,resolved:r,restWord:l,onChange:a}){const c=n.some(d=>d.value===o);return i(m,{label:s(e),icon:H(t),action:i(y,{words:S()?.panel,label:s(e),changed:c,detail:s("{value} on desktop",{value:s(l)}),onReset:()=>a(void 0)}),children:Q({options:n,value:c?o:r,onChange:d=>a(d),ariaLabel:e})})}function zr({label:e,icon:t,options:n,desktopKey:o,resolve:r,value:l,onChange:a}){const c=v()[o],d=r(void 0,c),p=n.find(h=>h.value===d)?.label??"";return i(jr,{label:e,icon:t,options:n,value:l,resolved:d,restWord:p,onChange:a})}const Yr={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Vr={Top:Me,Bottom:De,Left:He,Right:Ge},qr=e=>{const t=Vr[e];return i(t,{})};function Os(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=_=>Yr[_],l=_=>G(r("Top"),i(Me,{}),I.min,I.max,I.step,_,"px"),a=(_,j,F,re=I)=>g("mobile",Tt({label:r(_),icon:qr(_),desktopKey:j,min:re.min,max:re.max,step:re.step,fallback:F})),c=e.top??I.min,d=e.bottom??I.min,p="sectionPaddingLeft",h="sectionPaddingRight",f=e.sideBounds??I,u=e.side??f.min,x=e.sidePhone??u,b=e.phone===!0,R=_=>b?g("desktop",_):_;return K({...o?{_gSpacing:C("Padding")}:{},[t]:R(l(c)),...b?{[P(t)]:a("Top",t,c)}:{},...e.only==="top"?{}:{[n]:R(G(r("Bottom"),i(De,{}),I.min,I.max,I.step,d,"px")),...b?{[P(n)]:a("Bottom",n,d)}:{}},...e.sides?{[p]:R(G(r("Left"),i(He,{}),f.min,f.max,f.step,u,"px")),...b?{[P(p)]:a("Left",p,x,f)}:{},[h]:R(G(r("Right"),i(Ge,{}),f.min,f.max,f.step,u,"px")),...b?{[P(h)]:a("Right",h,x,f)}:{}}:{}})}function Rs(e,t){const n=Object.fromEntries(Object.entries(t).map(([l,a])=>[l,l in e&&se(a)?e[l]:a])),o={};let r=!1;for(const[l,a]of Object.entries(e)){if(l in t){r||Object.assign(o,n),r=!0;continue}o[l]=a}return r||Object.assign(o,n),o}const ne="Width";function Fs(e,t=ir,n=!0){const o=t.map(r=>({label:lr[r],value:r}));return K({...n?{_gWidth:C(ne)}:{},widthMode:{type:"custom",render:({onChange:r,field:l})=>i(m,{label:s(ne),icon:i(ae,{}),action:n?i(gr,{inherited:l?.inherited??!1,onReset:()=>r(sr),label:ne}):void 0,children:Q({options:o,value:l?.currentValue||e,onChange:r,ariaLabel:ne})})}})}function Ls(){const e=o=>({type:"custom",render:({value:r,onChange:l})=>i(m,{label:W,icon:H(i(dn,{})),action:o?o(l):void 0,children:Q({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:["auto","fixed","screen"].includes(r)?r:"auto",onChange:l,ariaLabel:W})})}),t=()=>({type:"custom",render:({value:o,onChange:r,field:l})=>{const a=l?.unit==="%"?"%":"px",c=a==="%"?Ro:Oo;return i("div",{className:"sf-field",children:X({min:c.min,max:c.max,step:c.step,value:typeof o=="number"?o:c.fallback,suffix:a,ariaLabel:W,onChange:r})})}}),n=()=>he("Unit",i(ve,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");return K({_gHeight:C(W),sectionHeightMode:g("desktop",e()),sectionHeightValue:g("desktop",t()),sectionHeightUnit:g("desktop",n()),sectionHeightModePhone:g("mobile",e(o=>i(Zr,{onClear:()=>o(void 0)}))),sectionHeightValuePhone:g("mobile",t()),sectionHeightUnitPhone:g("mobile",n())})}function Zr({onClear:e}){const t=v(),n=wo(t),o=Io(t),r=s("{value} on desktop",{value:o.mode==="auto"?s("Auto"):`${o.value}${o.unit}`});return i(y,{words:S()?.panel,label:s(W),changed:n,detail:r,onReset:e})}function Ps(){const e=n=>({type:"custom",render:({value:o,onChange:r,id:l,name:a})=>i(Jr,{value:o,onChange:r,labelId:`${l??a??"stickTop"}-label`,phone:n})}),t=()=>({type:"custom",render:({value:n,onChange:o})=>i("div",{className:"sf-field",children:X({min:Z.min,max:Z.max,step:Z.step,value:typeof n=="number"?n:Z.fallback,suffix:"px",ariaLabel:s("Distance from top"),onChange:o})})});return{_gStick:C(pe),stickTop:g("desktop",e(!1)),stickTopDistance:g("desktop",t()),stickTopPhone:g("mobile",e(!0)),stickTopDistancePhone:g("mobile",t())}}function Jr({value:e,onChange:t,labelId:n,phone:o}){const r=v(),l=Eo(r),a=o?l.phone:e===!0;return i(m,{label:s(pe),labelId:n,icon:H(i(hn,{})),action:B(L,{children:[o?i(y,{words:S()?.panel,label:s(pe),changed:To(r),detail:s("{value} on desktop",{value:l.desktop?`${l.desktopDistance}px`:s("Off")}),onReset:()=>t(void 0)}):null,i(ce,{checked:a,onChange:t,ariaLabelledBy:n})]})})}const Et="e.g. about";function Ns(){return{_gAnchor:C("Anchor"),anchor:A({control:"plainText",label:"Name",placeholder:Et},{type:"custom",render:({value:e,onChange:t})=>i(zt,{value:e,onChange:t,nameBox:(n,o)=>i(k,{value:n,onChange:o,label:"Name",placeholder:Et,hideable:!1,markup:!1})})})}}function ks(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:l,name:a})=>{const c=`${l??a??e}-datetime`,d=Date.parse(typeof o=="string"?o:"");return i(m,{label:s(e),icon:t,htmlFor:c,hint:n===void 0?void 0:s(n),children:i(Xn,{id:c,value:Number.isFinite(d)?new Date(d):null,onChange:p=>r(p?p.toISOString():"")})})}}}function As(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:l,name:a})=>{const c=`${l??a??e}-date`;return i(m,{label:s(e),icon:t,htmlFor:c,hint:n===void 0?void 0:s(n),children:i($n,{id:c,value:Lt(typeof o=="string"?o:null),onChange:d=>r(d?Ft(d):"")})})}}}function Ot(e,t,n,o){return{type:"custom",...T({},{...$,label:e}),render:({value:r,onChange:l,id:a,name:c})=>{const d=typeof r=="boolean"?r:t,p=`${a??c??e}-label`;return i(m,{label:s(e),labelId:p,icon:n,hint:o===void 0?void 0:s(o),action:i(ce,{checked:d,onChange:l,ariaLabelledBy:p})})}}}function vs(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i(ze,{label:s("Background"),icon:i(fn,{}),id:r,value:Sn(e),onChange:t})}}}function Bs(e,t){return{type:"custom",...T({},{...$,label:e}),render:({value:n,onChange:o,id:r})=>{const l=typeof n=="boolean"?n:t,a=`${r??e}-checkbox`;return i(m,{label:s(e),htmlFor:a,className:"sf-checkbox",action:i(Wn,{id:a,checked:l,onChange:o})})}}}const Ds={follows:"fill"},Hs={follows:"ink"};function Gs(e,t,n,o){if(typeof t!="string"){const r=t.follows;return{type:"custom",render:({value:l,onChange:a})=>i(Qr,{label:e,part:r,icon:n,value:l,onChange:a,opacity:o})}}return{type:"custom",render:({value:r,onChange:l})=>i(ze,{label:s(e),icon:n,value:r||t,onChange:l})}}function Qr({label:e,part:t,icon:n,value:o,onChange:r,opacity:l}){const a=at(O().theme),c=t==="fill"?a.fill:a.ink,[d,p]=E(l?.key??""),[h]=E(l?.unsetFrom??""),f=typeof d=="number";return i(Ye,{label:s(e),icon:n,value:o||"",inherited:c,resetTo:N(c.toUpperCase(),s("Styles")),onChange:r,onReset:()=>{r(""),l&&f&&p(void 0)},...l?{opacity:f?d:l.unset(h),onOpacityChange:u=>p(u),changed:!!o||f}:{}})}function Ms(){return{type:"custom",render:({value:e,onChange:t})=>i(ei,{value:typeof e=="string"?e:"",onChange:t})}}function ei({value:e,onChange:t}){const{hex:n,n:o}=ni();return i(Ye,{label:s("Fill"),icon:i(Ae,{}),value:e,inherited:n,resetTo:N(n.toUpperCase(),s("Theme {n} background",{n:o})),onChange:t,onReset:()=>t("")})}function ti(e,t,n){if((e?.content??[]).some(a=>a?.props?.id===t))return J(n);const r=_n(e,t);if(r.length===0)return null;const l=J(ut(n));if(l!==null)return l;for(let a=r.length-1;a>0;a-=1){const c=J(ut(r[a].sectionAccent));if(c!==null)return c}return J(r[0].sectionAccent)}function ni(){const e=st(O().theme),[t]=E("sectionAccent");let n=null;try{const{appState:r,selectedItem:l}=ie(c=>c),a=l?.props?.id?String(l.props.id):void 0;n=a?ti(r?.data,a,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{hex:e.themes[o].background??lt.background,n:o+1}}const oi=[{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=oi}){const r=o.map(l=>({...l,label:s(l.label),...l.title?{title:s(l.title)}:null}));return i(Mn,{label:s(e),value:t,points:r,onChange:n})}function Ws(){return xe()}const Ks={top:i(ln,{}),right:i(rn,{}),bottom:i(nn,{}),left:i(on,{})};function Us(e,t,n,o,r,l){const a=h=>t.find(f=>f.value===h),c=h=>({value:h,label:"",disabled:!0,title:o}),d=h=>{const f=t.find(x=>x.cell===h);if(!f)return c(`missing-${h}`);const u=l?.[h];return u?{value:f.value,label:f.label,icon:u}:{value:f.value,label:f.label}},p=[c("corner-top-left"),d("top"),c("corner-top-right"),d("left"),c("centre"),d("right"),c("corner-bottom-left"),d("bottom"),c("corner-bottom-right")];return{type:"custom",render:({value:h,onChange:f})=>{const u=t.some(x=>x.value===h)?h:n;return i(m,{label:s(e),icon:r,value:a(u)?.label?s(a(u).label):"",children:ri({label:e,value:u,onChange:f,points:p})})}}}function $s(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:l})=>i(co,{label:e,options:(l.options??t).map(a=>({...a,label:s(a.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:s(n)}:{}})}}function Xs(e,t,n,o){return{type:"custom",options:t,fallback:n,...T({},{type:"select",label:e}),render:({value:r,onChange:l,field:a})=>i(po,{label:e,options:(a.options??t).map(c=>({...c,label:s(c.label)})),fallback:a.fallback??n,value:r,onChange:l,placeholder:o===void 0?void 0:s(o)})}}function js(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}const zs=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function Ys(e,t,n){const o=Object.keys(Te).map(r=>({label:Te[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(ii,{label:e,icon:t,options:o,onChange:r})}}function ii({label:e,icon:t,options:n,onChange:o}){const r=ue()?.values??{},l=Pt(r),a=l==="frame"&&!!Ie(r.mediaVideo)&&!Ie(r.videoFrame);return i(m,{label:s(e),icon:H(t),hint:a?s("This video has no frame yet. The slide shows its background colour until one is made."):void 0,children:Q({options:n,value:l,onChange:o,ariaLabel:e})})}function Vs(e,t,n,o={}){return{type:"custom",[Fe]:!0,render:({value:r,onChange:l,name:a})=>i(ao,{value:r||"",onChange:l,fieldKey:a,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen,frameKey:o.frame})}}const qs={HeroSingle:["imageFocal"],HeroSlide:["videoFrame"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function li(e){const t=s(e.status??"");return e.ok&&typeof e.lat=="number"&&typeof e.lng=="number"?`${t} · ${e.lat.toFixed(4)}, ${e.lng.toFixed(4)}`:t}function Zs({value:e,onChange:t,label:n}){const o=e||{},r=!!o.pending,l=r?"var(--ink-faint)":o.ok?"var(--status-success-soft-ink)":"var(--status-danger-soft-ink)",a=!!dr(cr()).geocode,c=we(),d=(p,h)=>t({...o,[p]:h??void 0});return B(L,{children:[i(m,{label:s(n),icon:i(Be,{}),action:a?i(V,{content:s("Find from the address (OpenStreetMap)"),children:i(Xe,{"aria-label":s("Find from the address"),"aria-busy":r||void 0,disabled:r,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:i(gn,{})})}):void 0,children:a&&o.status?i(V,{content:li(o),className:"sf-name-tip",children:i("div",{className:`es-field-hint ${jt}`,style:{margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0,color:l},children:r?s("Finding…"):s(o.status)})}):null}),i(m,{label:s("Enter by hand"),labelId:c,icon:i(sn,{}),action:i(ce,{checked:!!o.manual,onChange:p=>t({...o,manual:p}),ariaLabelledBy:c})}),o.manual&&i(m,{label:s("Latitude, longitude"),icon:i(Be,{}),children:B("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[i(je,{value:typeof o.lat=="number"?o.lat:null,onChange:p=>d("lat",p),min:-90,max:90,step:1e-4,placeholder:s("Latitude")}),i(je,{value:typeof o.lng=="number"?o.lng:null,onChange:p=>d("lng",p),min:-180,max:180,step:1e-4,placeholder:s("Longitude")})]})})]})}function si(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function ai(e,t,n){const o=e.map(r=>({text:r?.text??""}));return t===null||t<0||t>=e.length?o:o.map((r,l)=>l===t?{text:n}:r)}function Js(e,t){return e===null?null:t>e?e:null}function ci(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 Qs={label:"Ticker items",icon:i(pn,{})};function ea(e,t,n,o){return{type:"custom",[w]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...T({},{...mt.textList,label:e}),render:({value:r,onChange:l})=>i(di,{label:e,icon:H(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:l,markup:o==="markup"})}}function di({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:l=!1}){const a=z(null),[c,d]=M(null),p=f=>f.map(u=>({text:u?.text??""})),h=f=>{const u=ci(n,f,c);u===null&&(a.current=null),d(u),r(p(f))};return i(Nn,{label:s(e),icon:t,noun:s("item"),items:n,onChange:h,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:l?i(Ve,{target:a,value:si(n,c),onChange:f=>r(ai(n,c??-1,f)),disabled:c===null,label:c===null?s("Formatting — click a row first"):s("Formatting — row {n}",{n:c+1})}):void 0,renderRow:(f,u,x)=>i("input",{type:"text",className:l&&c===u?"sf-list-marking":void 0,value:f?.text??"",placeholder:s(o),"aria-label":s("{label} {n}",{label:s(e),n:u+1}),onChange:b=>x({text:b.target.value}),onFocus:b=>{a.current=b.currentTarget,d(u)}})})}function ta(e,t){const n=`${e.label} — row ${t+1}`;return A({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>i(k,{value:o,onChange:r,label:s("{label} — row {n}",{label:s(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function na(e){return{_gCards:C("Cards"),coverIndex:U("Cover image",i(un,{}),io,String(lo),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:Ir("Image background",$o),cardImage:fi(),spinOnHover:Ot("Rotate on hover",e?.spinDefault??!0,i(mn,{}))}}function oa(){return{outline:U("Card outline",i(bn,{}),no,ro),indexBadge:U("Card number",i(ve,{}),to,oo),showBadge:Ot("Product badge",!0,i(Ke,{noun:"tag"}))}}function ra(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...$,label:oe.find(l=>l.id===r).label}),o=r=>T(xe(ye),n(r));return{_gShowOnCard:C("Show on a card"),[ye]:T({type:"custom",render:()=>i(ui,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(ye)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const ye="showCardPrice",oe=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function ui({rest:e}){const t=v(),n=Tr(),o=a=>typeof t[a]=="boolean"?t[a]:void 0,r=a=>o(a)??e[a],l=oe.some(({id:a})=>o(a)!==void 0&&o(a)!==e[a]);return i(Ce,{parts:oe,changed:l,shown:r,onPress:(a,c)=>n({[a]:c}),onReset:()=>n(Object.fromEntries(oe.map(({id:a})=>[a,void 0])))})}function ia(e,t="display"){const n=P(t);return{[t]:g("desktop",{type:"custom",render:({value:o,onChange:r})=>i(Ce,{parts:e,changed:An(o),shown:l=>vn(o,l),onPress:(l,a)=>r(Hn(o,l,a)),onReset:()=>r(void 0)})}),[n]:g("mobile",{type:"custom",render:({value:o,onChange:r})=>i(pi,{parts:e,desktopKey:t,value:o,onChange:r})})}}function Ce({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:l}){const a=s("Display");return i(m,{label:a,icon:i(Vt,{}),changed:t,action:i(y,{words:S()?.panel,label:a,changed:t,detail:l,onReset:r}),children:i(kn,{label:a,items:e.map(c=>({id:c.id,label:s(c.label),shown:n(c.id)})),onChange:o})})}function pi({parts:e,desktopKey:t,value:n,onChange:o}){const r=v()[t];return i(Ce,{parts:e,changed:Dn(n),shown:l=>Bn(r,n,l),onPress:(l,a)=>o(Gn(n,l,a)),onReset:()=>o(Qn),detail:s("the same as Desktop")})}function fi(){return ge("Card image",{min:D,max:Pe,step:vt,hint:"Rounds the picture. The card's own corner is in Styles."})}function la(){return be({sidesKey:"cornerSides",step:Bt,useFollowed:()=>D,mark:i(hi,{label:Dt}),hint:s("Rounds the picture. Left alone it stays square.")})}function hi({label:e,changed:t=!1,onReset:n=()=>{}}){return i(y,{words:S()?.panel,label:s(e),changed:t,onReset:n})}function sa(){return{type:"custom",render:({value:e,onChange:t})=>i(xi,{value:typeof e=="string"?e:"",onChange:t})}}function mi({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:Wt(e).map(([n,o],r)=>i("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${n}`,gridRow:`span ${o}`}},r))})}const gi={width:"3.5rem",height:"2.5rem"},bi=200;function xi({value:e,onChange:t}){const[n,o]=M(null),[r,l]=M(4),a=z(null);Rt(()=>{const u=a.current;if(!u||typeof ResizeObserver!="function")return;const x=()=>l(u.getBoundingClientRect().width>=bi?4:3);x();const b=new ResizeObserver(x);return b.observe(u),()=>b.disconnect()},[]);const c=e&&e in Y?e:"",d=Ne(n,c),p=Ne(n,"").length,h=Kt("no-symbol"),f=[{value:"",label:s("Not chosen"),icon:h},...d.map(u=>({value:u,label:s(Y[u].label),icon:i(mi,{layout:Y[u],width:40})}))];return i(m,{label:s("Layout"),icon:i(cn,{}),value:c?s(Y[c].label):s("Not chosen"),children:i("div",{ref:a,style:{flex:"1 1 auto",minWidth:0},children:i(Yn,{label:s("Layout"),value:c,emptyValue:"",options:f,onChange:t,columns:r,cell:gi,header:B("div",{className:"mb-2 flex flex-col gap-1",style:{minWidth:"11rem"},children:[i("span",{className:"text-2xs text-ink-faint",children:s("Photos in a row")}),i(On,{options:[{id:"all",label:s("All")},...Gt.map(u=>({id:String(u),label:String(u)}))],value:n===null?"all":String(n),ariaLabel:s("Photos in a row"),onChange:u=>o(u==="all"?null:Number(u))}),i("span",{className:"text-2xs text-ink-faint",children:s("{n} of {total} layouts",{n:p,total:Mt.length})})]})})})})}export{xr as BOUND_TO_POST,ql as BOUND_TO_POST_NOTE,rs as BUCKET_ICONS,qs as CUSTOM_FIELD_MEDIA,Zs as CoordsField,Ks as EDGE_ARROWS,jn as FOCAL_DEFAULT,oi as FOCAL_POINTS,le as FOLD_FIELD_MARKER,Ds as FOLLOWS_SITE_BUTTON,Hs as FOLLOWS_SITE_BUTTON_INK,ri as FocalPicker,fs as GroupLabel,Sr as HIGHLIGHT_HINT,k as HidableTextField,Re as LINK_FIELD_MARKER,Hl as Label,Fe as MEDIA_FIELD_MARKER,zs as MEDIA_TYPE_OPTIONS,Zl as NOT_BOUND_TO_POST,ps as PanelBand,_r as PanelNoteLine,zr as PhoneChoiceRow,jr as PhoneChoiceStrip,Le as SCAFFOLD_FIELD_MARKER,ua as SCALAR_TEXT_CONTROLS,hr as SiteGapDefaultReset,X as Slider,xt as Swatches,da as TEXT_CONTROL_KINDS,w as TEXT_FIELD_MARKER,Qs as TICKER_ITEMS_ROW,di as TextListField,ne as WIDTH_LABEL,gr as WidthDefaultReset,ci as aimAfterListChange,Ns as anchorFields,N as backTo,hs as backgroundField,Es as blockSizeFields,Cs as boxBlockSpacingField,Ms as boxFillField,ws as boxPhoneRowField,Wr as boxShareField,_s as boxSharePhoneField,ti as boxThemeIndexOf,as as bucketHeader,xs as buttonBorderField,bs as buttonWordsEntryField,Gr as cardCornersField,Ir as cardImageBackgroundField,fi as cardImageField,na as cardMediaFields,ys as cardShapeFields,ra as cardShowFields,oa as cardStyleFields,Ts as cellWidthFields,Bs as checkbox,Gs as colorInput,Wl as containerDirectionField,Gl as containerGapField,Ml as containerGapPhoneField,li as coordsResultTip,ts as copyText,St as cornerSidesField,be as cornersRowField,As as date,ks as dateTime,cs as designGroupHeader,ia as displayFields,Us as edgePad,is as entriesHiddenForTab,Js as focusAfterRemove,Ws as focusKeptField,ds as foldMarker,se as foldMetaOf,wr as foldTitleOf,sa as galleryLayoutField,Ls as heightFields,Kl as heroGroupPlacementPoints,Oe as hidableText,Cr as hintIsWhileTyping,la as imageCornersField,Vl as inOwnBox,ss as isBucketHeader,xe as keptBy,ns as linkField,Ys as loadingShowsField,$s as multiSelect,vs as pageBackgroundField,ls as panelNote,Xr as phoneChoiceField,Tt as phoneOverrideField,es as plainText,os as plainTextarea,ge as pxField,us as quietMarker,Ee as readHidable,si as rowText,Xs as searchSelect,Ct as sectionBorderField,Fr as sectionCornersField,gs as sectionShapeFields,ms as sectionThemeFields,ai as setRowText,Is as sizeField,js as sourceField,Os as spacingFields,Ps as stickFields,Rs as swapPadding,Ss as templateField,Jl as text,Nt as textFieldIdentifier,Xl as textFieldOffPage,zl as textFieldPanelOnly,ea as textList,ta as textListRowField,Ql as textarea,Ot as toggle,Vs as upload,Tr as useSelectedPatch,v as useSelectedProps,E as useSelectedSibling,fr as useSiteGapDetail,Fs as widthField,Yl as withIdentifier,$l as withOffPage,jl as withPanelOnly,Ul as withScaffold};
1
+ "use client";import{jsx as i,jsxs as k,Fragment as O}from"react/jsx-runtime";import{cloneElement as he,useEffect as ut,useId as ge,useRef as z,useState as H}from"react";import{useEasel as ne}from"efficient-easel/easel";import{toDateKey as pt,fromDateKey as ft}from"efficient-shell/format";import{say as l,editorEaselWords as S}from"../../../format/lib/editor-words.js";import{mediaValueSrc as be}from"../../../format/lib/media-value.js";import{LOADING_SHOWS_LABELS as xe,loadingShowsOf as mt}from"../../../format/lib/hero-video.js";import{readHidable as Se,hidableText as ye}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as oe,LINK_FIELD_MARKER as Ce,MEDIA_FIELD_MARKER as _e,SCAFFOLD_FIELD_MARKER as we,TEXT_FIELD_MARKER as w,foldMetaOf as re,textFieldIdentifier as ht}from"efficient-easel/draw";import gt from"../../components/ApplyCornersToSiblings.js";import{withShowWhen as bt}from"../../../render/lib/document/show-when.js";import xt from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as St,CORNER_RADIUS_MAX as Ie,CORNER_RADIUS_MIN as L}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as yt,IMAGE_CORNERS_LABEL as Ct}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as _t}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as wt,GALLERY_LAYOUTS as Y,GALLERY_LAYOUT_KEYS as It,galleryChoices as Ee,galleryPictureCells as Et}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as Rt}from"./shell-glyph.js";import{anchorSiblingsOf as Tt,placementPoints as Ot}from"../../../format/lib/hero-group-placement.js";import Pt,{KEEP_HINT_CLASS as At}from"../../components/KeepHint.js";import Ft from"../../components/AnchorField.js";import{AdjustIcon as kt,EyeIcon as Lt,AnimationIcon as Nt,BackgroundIcon as vt,BorderAllIcon as Dt,BlockSectionIcon as Bt,ColumnWidthsIcon as Re,ColumnsIcon as Ht,CornerIcon as Gt,DirectionDownIcon as Mt,DirectionLeftIcon as Kt,DirectionRightIcon as Wt,DirectionUpIcon as Ut,EditIcon as $t,GapIcon as Xt,GridIcon as jt,GroundIcon as Te,HashIcon as Oe,HeightIcon as zt,ImageIcon as Yt,ListIcon as Vt,LocationIcon as Pe,PaddingBottomIcon as Ae,PaddingLeftIcon as Fe,PaddingRightIcon as ke,PaddingTopIcon as Le,PageIcon as qt,StickyIcon as Zt,RotateIcon as Jt,SearchIcon as Qt,SquareIcon as en,TypeIcon as tn,WidthIcon as nn}from"efficient-easel/icons";import{FieldGlyph as Ne}from"../../components/FieldGlyph.js";import{resolvePageBackground as on}from"../../../format/lib/content/page-background.js";import{CORNER_SIDES as ve,CORNER_SIDE_POINTS as rn,hasOwnSectionCorners as ln,normalizeCornerSides as De}from"../../../format/lib/content/section-corners.js";import{enclosingPath as an,enclosingSection as sn}from"./enclosing-section.js";import{SettingsDefaultReset as y,SettingsDrill as cn,SettingsField as h,SettingsGroup as dn,SettingsGroupSub as un,SettingsSegmented as pn,SettingsBorder as fn,SettingsSidesEach as mn,SettingsSwitch as ie,borderSides as hn,borderStartEach as gn}from"efficient-easel/panel";import{ListField as bn}from"efficient-easel/fields";import{DisplayChips as xn}from"efficient-shell/ui";import{desktopDisplayChanged as Sn,partShownOnDesktop as yn,partShownOnPhone as Cn,phoneDisplayChanged as _n,withDesktopPart as wn,withPhonePart as In}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as En,Checkbox as Rn,ColorSwatch as Tn,CornersInput as On,DatePicker as Pn,DateTimePicker as An,FOCAL_DEFAULT as Fn,PictureTiles as kn,IconPicker as Ln,IconButton as Be,InputNumber as He,Slider as Nn,Tooltip as V}from"efficient-shell/ui";import{ColourRow as Ge,InheritedColourRow as vn}from"./ColourControl.js";import{keptByRow as Dn}from"efficient-easel/screen/lib/document/style-fields";import Me from"./MarkupToolbar.js";import{deviceField as b}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as Bn,NoControlMark as Hn,noControlField as Ke}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as Gn}from"../../../format/lib/document/own-box.js";import{PHONE_CLEAR as Mn,resolvePhoneValue as le}from"../../../format/lib/document/phone-override.js";import{phoneKey as N}from"efficient-easel/draw";import{SuppressibleText as Kn}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Wn,CARD_OUTLINE_OPTIONS as Un,DEFAULT_CARD_INDEX_FORMAT as $n,DEFAULT_CARD_OUTLINE as Xn}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as jn,DEFAULT_COVER_INDEX as zn}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as Yn}from"efficient-easel/draw";import Vn from"../../components/MediaUploadField.js";import{useSelectedHost as ae}from"./selected-host.js";import qn from"../../components/MultiSelectField.js";import Zn from"../../components/SectionThemePicker.js";import Jn from"../../components/SearchSelectField.js";import Qn from"../../components/StorefrontLinkField.js";import{UiIcon as We}from"efficient-easel/draw/client";import{SECTION_PADDING as I}from"../../../render/lib/content/section-padding.js";import{buttonWordsSummary as eo}from"../../../render/lib/content/button-look.js";import{usePreviewParts as to}from"efficient-easel/draw/client";import{encodePartId as no}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as oo,useEaselStrings as ro}from"efficient-easel/strings";import{hasPhoneHeight as io,resolveSectionMinHeight as lo}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as q,SECTION_STICK_LABEL as se,hasPhoneStick as ao,resolveSectionStick as so}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as co,SECTION_MIN_HEIGHT_GROUP_LABEL as G,SECTION_SCREEN_PCT as uo}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as po,resolveContainerDirection as Ue}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as fo,BOX_BLOCK_SPACING_POINTS as $e,BOX_PHONE_ROW_LABEL as mo,BOX_PHONE_ROW_MAX as ho,BOX_PHONE_ROW_MIN as Xe,BOX_SHARE_LABEL as ce,BOX_SHARE_PHONE_DEFAULT as go,BOX_SHARE_PHONE_POINTS as bo,BOX_SHARE_POINTS as xo}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as P}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as So}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as je,normalizeTheme as ze}from"../../../format/lib/theme.js";import{CONTAINER_GAP as Ye,CONTAINER_GAP_BUILT_IN as yo,CONTAINER_GAP_PHONE as Co,GAP_FIELD_CONTAINER as Ve,hasOwnContainerGap as _o,hasOwnPhoneGap as wo,resolveContainerGap as Io,resolvePhoneContainerGap as qe}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as Eo,CARD_IMAGE_BG_OFF as Ro,CARD_IMAGE_BG_SWATCH_NAMES as To,CARD_IMAGE_BG_SWATCHES as Oo,isCardImageBackgroundInheriting as Po,cardImageBackgroundChoice as Ao,THEME_CARD_IMAGE_BG as Fo}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as ko,SECTION_BG_SWATCHES as Lo,SECTION_BG_SWATCH_NAMES as No,THEME_SECTION_BG as vo,isSectionBackgroundInheriting as Do}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as Bo,nestedAccentValue as Ze,resolveSectionAccent as Z}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as Ho,TYPE_SIZE_INHERIT as Go,isTypeSizeInheriting as Mo}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as Ko,WIDTH_CHOICE_LABEL as Wo,WIDTH_INHERIT as Uo}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as $o}from"./panel-heading-scope.js";import{useEaselSession as Xo}from"efficient-easel/screen/lib/session-context";import{backendOf as jo}from"../website-session.js";import{BOX_GAP as zo,describedAs as E,group as _,iconOf as M,sharedStyleKinds as K}from"efficient-easel/screen/lib/document/box-fields";import{directionField as Yo,gapField as Je,Segmented as de,segmented as Vo,select as W,slider as U}from"./box-fields.js";function Cl({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function v(e,t){return l("{value} from {from}",{value:e,from:t})}function qo(){const{blockGap:e}=P();return e===null?l("this container's own spacing"):v(`${e}px`,l("Styles"))}function Zo({inherited:e,onReset:t,label:n}){return i(y,{words:S()?.panel,label:l(n),changed:!e,detail:qo(),onReset:t})}function Jo(e){return Je({...zo,builtIn:yo[e],resolve:(t,n)=>Io(e,t,n?.siteGap),action:(t,n)=>i(Zo,{inherited:!_o(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[Ve]:e}})}function Qo(e){return bt(b("mobile",{[Ve]:e,type:"custom",render:t=>i(tr,{container:e,...t})}),er)}const er={not:{field:"gap",in:Array.from({length:-Ye.min},(e,t)=>Ye.min+t)}};function _l(e){return{gap:b("desktop",Jo(e)),[N("gap")]:Qo(e)}}function tr({container:e,...t}){const[n]=D("gap"),o=t.field?.siteGap,r=qe(e,void 0,n,o);return Je({...Co,builtIn:r,resolve:s=>qe(e,s,n,o),action:(s,c)=>i(y,{words:S()?.panel,label:l("Gap"),changed:wo(s),detail:v(`${r}px`,l("Desktop")),onReset:()=>c(void 0)})}).render(t)}function wl(e){return Yo({offered:po(e),fallback:Ue(e,void 0),resolve:t=>Ue(e,t)})}function Il(e,t){return Ot(t?Tt(e,t):[],t)}function nr({inherited:e,onReset:t,label:n}){return i(y,{words:S()?.panel,label:l(n),changed:!e,detail:v(l("Full"),l("the page")),onReset:t})}function A({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:a,hideable:s=!0,markup:c=!0}){const{text:d,hidden:f}=Se(e),m=z(null),p=z(null),u=T=>t(s?{text:T,hidden:f}:T),x=()=>t({text:d,hidden:!f}),g=s&&f,R=ge(),C=r?ar(r)?i("span",{className:"sf-hint-keep sf-hint-while-typing",children:l(r)}):i(Pt,{children:l(r)}):void 0,j=f?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return i(h,{label:l(n),icon:i(tn,{}),htmlFor:R,className:g?"is-hidden":void 0,hint:C,action:s?i(V,{content:j,children:i(Be,{"aria-pressed":f,"aria-label":j,onClick:x,children:f?i(We,{name:"eye-off",size:14}):i(We,{name:"eye",size:14})})}):void 0,children:k("div",{className:"sf-copybox",children:[c&&i(Me,{target:a?p:m,value:d,onChange:u}),a?i("textarea",{id:R,ref:p,value:d,placeholder:o===void 0?void 0:l(o),onChange:T=>u(T.target.value)}):i("input",{id:R,ref:m,type:"text",value:d,placeholder:o===void 0?void 0:l(o),onChange:T=>u(T.target.value)})]})})}function El(e,t){return{...e,[we]:t}}function Rl(e){const t=e[w];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[w]:{...t,offPage:!0}}}function Tl(e){return!e||typeof e!="object"?!1:e[w]?.offPage===!0}const Qe="sfPanelOnly";function Ol(e){if(!e[w])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Qe]:!0}}function Pl(e){return!!e&&typeof e=="object"&&e[Qe]===!0}function Al(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 Wa,SCALAR_TEXT_CONTROLS as Ua}from"efficient-easel/draw";function Fl(e,t){if(!e[w])throw new Error("inOwnBox: the field holds no authored text");const{[Bn]:o,...r}=e;return{...r,[Gn]:!0,render:t}}const or=new Set(Yn),$={type:"radio",options:[{value:!0},{value:!1}]},et={text:{type:"object",objectFields:{text:{type:"text"},hidden:$}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:$}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},F=(e,t)=>{const n=E({...t,[w]:e},{...et[e.control],label:e.label});if(!or.has(e.control))return n;const o=t.render;return{...Ke(n,"authored-copy"),render:r=>i(Kn,{name:r.name,children:o(r)})}},kl="Everything else on this block comes from the linked post. Unlink it to edit by hand.",rr={field:"source.slug",set:!0},Ll={not:rr},ir="Select a word, then press the highlighter.",lr=new Set([ir]),ar=e=>lr.has(e);function Nl(e,t,n){return F({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function vl(e,t,n){return F({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function Dl(e,t,n){return F({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function Bl(e,t,n){return F({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function Hl(e){return{type:"custom",[Ce]:{label:e},...E({},{type:"text",label:e}),render:({value:t,onChange:n})=>i(Qn,{value:ye(t),onChange:n,label:e})}}function Gl(e,t,n){return F({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(A,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const Ml={Design:kt,Animation:Nt};function Kl(e,t){return e.includes("Design")?t!=="Design":null}function Wl(e){return{type:"custom",render:()=>i(sr,{text:e})}}function sr({text:e}){return i("p",{className:"sf-note",children:l(e)})}function Ul(e){return re(e)!==null&&e?.tabs!==void 0}const tt=new Map;function $l(e,t){const n=`${e}\0${t?t.join(""):""}`,o=tt.get(n)??{type:"custom",tabs:t,[oe]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(O,{})};return tt.set(n,o),o}const nt=new Map;function Xl(e){const t=nt.get(e)??{type:"custom",[oe]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(O,{})};return nt.set(e,t),t}function cr(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function jl(e,t){return cr(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(O,{})}}function zl(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(O,{})}}function Yl({title:e,children:t}){const[n,o]=H(()=>!ue.has(e));return i(dn,{title:e,open:n,onToggle:r=>{o(r),r?ue.delete(e):ue.add(e)},children:t})}const ue=new Set;function Vl({label:e}){return i(un,{title:l(e),level:$o(2)})}function ot({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 k("div",{className:"sf-swatches",children:[e.map(c=>{const d=o?.[c]?l(o[c]):c;return i(V,{content:d,children:i(Tn,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":d})},c)}),i("span",{className:"sf-swatch-hex",children:s})]})}function ql(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=Do(n,t);return i(h,{label:l(e),icon:i(vt,{}),changed:!r,action:i(y,{words:S()?.panel,label:l(e),changed:!r,detail:l("the theme's section background"),onReset:()=>o(ko)}),children:ot({swatches:Lo,current:r?vo:n??t??"",onPick:o,names:No})})}}}function dr(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,a=Po(r,t);return i(h,{label:l(e),icon:i(Te,{}),changed:!a,action:i(y,{words:S()?.panel,label:l(e),changed:!a,detail:l("the theme's image stage"),onReset:()=>o(Eo)}),children:ot({swatches:Oo,current:a?Fo:Ao(r,t),onPick:o,names:To})})}}}function Zl(e=n=>n,t){return K({_gSectionTheme:_(Bo),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(Zn,{value:e(n),onChange:o,followLabel:t})}})}function X({min:e,max:t,step:n,value:o,onChange:r,suffix:a="",readout:s=!0,notch:c,ariaLabel:d,disabled:f=!1}){const m=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:m?"sf-slider has-notch":"sf-slider",style:m?{"--sf-notch":(c-e)/(t-e)}:void 0,children:i(Nn,{min:e,max:t,step:n,value:o,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:p=>{p!==null&&p!==o&&r(p)}})})}function rt(e,t){const{min:n,max:o,step:r=1,unsetLabel:a,hint:s,restTrack:c,unsetMark:d,icon:f,unit:m="px"}=t;return{type:"custom",render:({value:p,onChange:u})=>{const x=typeof p=="number"?p:null,g=x===null;return i(h,{label:l(e),icon:f?M(f):void 0,value:g?d||a===void 0?void 0:l(a):`${x}${m}`,changed:!g,action:d?he(d,{changed:!g,onReset:()=>u(null)}):i(y,{words:S()?.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:x,label:e,onChange:u}):X({min:n,max:o,step:r,value:x??n,readout:!1,ariaLabel:e,onChange:u})})}}}const J="Corners";function pe(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,r=o!==null;return i(h,{label:l(J),icon:i(Gt,{}),changed:r,action:he(e.mark,{changed:r,onReset:()=>n(null)}),hint:e.hint,children:i(pr,{tier:e,px:o,onRadius:n})})}}}function D(e){const t=ae();return[t?.values?.[e],n=>t?.onChange(e,n)]}function it(){return Ke({type:"custom",render:()=>i(Hn,{})},"always")}function ur(){const e=ae();return t=>e?.onChangeMany(t)}function pr({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),[r,a]=D(e.sidesKey),s=De(r)??[...ve];return i(On,{label:l(J),value:s,corners:rn,onChange:c=>{const d=De(c)??[];a(d.length===ve.length?null:d)},radius:t,onRadiusChange:n,radiusMin:L,radiusMax:Ie,radiusStep:e.step??1,radiusPlaceholder:String(o)})}function lt(){return it()}function fr({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=P(),r=typeof o=="number"?`${o}px`:l("not set");return i(y,{words:S()?.panel,label:l(e),changed:t,detail:o==null?l("the built-in corners"):v(r,l("Styles")),onReset:n})}function mr(){const{cornerRadiusPx:e}=P();return typeof e=="number"?e:L}function hr(){return pe({sidesKey:"sectionCornerSides",useFollowed:mr,mark:i(fr,{label:J}),hint:gr})}const gr="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function Jl(){return K({_gShape:_("Shape"),sectionCorners:hr(),sectionCornerSides:lt(),sectionBorder:at("desktop"),sectionBorderPhone:at("mobile")})}const br=()=>({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 xr(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function Sr(){let e;try{const t=ze(P().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||je.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]=H(()=>r?gn(c,s):!1),m=br(),p=u=>xr(r&&a?u:{width:u.width,color:u.color,...a?{style:u.style}:{}});return i(h,{label:l("Border"),icon:i(Dt,{}),action:r?i(mn,{each:d,label:l("Each side"),onChange:f}):void 0,children:i(fn,{label:l("Border"),value:c,each:d,onChange:u=>t(p(u)),placeholder:n,presets:o,words:m,styles:a,max:So})})}function Cr({value:e,onChange:t,tier:n}){const[o]=D("sectionBorder"),r=Sr(),a=n==="mobile"?o&&typeof o=="object"?o:{}:{};return i(yr,{value:e,onChange:t,placeholder:{sides:hn(a),style:a.style??"solid",color:a.color||r},presets:[r],above:a})}function at(e){return b(e,{type:"custom",render:({value:t,onChange:n})=>i(Cr,{value:t,onChange:n,tier:e})})}function Ql(e){return{type:"custom",render:()=>i(_r,{partKey:e})}}function _r({partKey:e}){const[t]=D("id"),[n]=D("_partStyles"),{textStyles:o}=P(),r=ro();let a=null;try{a=to().select}catch{a=null}const s=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i(cn,{name:l("Text"),preview:eo(s,c,{noStyle:l("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??oo.copy.panel).cases}),onOpen:()=>{a&&typeof t=="string"&&a(no(t,e))}})}function st(e){const{cornerRadiusPx:t}=P(),n=typeof t=="number"?t:e;let o=null;try{const{appState:a,selectedItem:s}=ne(d=>d),c=s?.props?.id?String(s.props.id):void 0;o=c?sn(a?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return ln(r)?r:n}function wr({label:e,changed:t=!1,onReset:n=()=>{}}){const o=st(L);return i(y,{words:S()?.panel,label:l(e),changed:t,detail:v(`${o}px`,l("the section")),onReset:n})}function Ir(){return i(O,{children:l("Follows the section's Corners until you set a number here.")})}function Er(){return pe({sidesKey:"cardCornerSides",useFollowed:()=>st(L),mark:i(wr,{label:J}),hint:i(Ir,{})})}function Rr(){return{type:"custom",render:()=>i(gt,{})}}function ea(e){return{...e,render:t=>i(xt,{render:e.render,props:t})}}function ta(){return{_gShape:_("Shape"),cardCorners:Er(),cardCornerSides:lt(),cardCornersApplyAll:Rr()}}function Tr(e=xo,t=e[0].value){return E({type:"custom",render:({value:n,onChange:o})=>{const r=e.find(a=>a.value===n)??e.find(a=>a.value===t)??e[0];return i(h,{label:l(ce),icon:i(Re,{}),value:l(r.label),children:i(kn,{className:"sf-gallery-layouts",label:l(ce),value:r.value,onChange:o,options:e.map(a=>({value:a.value,label:l(a.label),picture:i("span",{className:"sf-gallery-pic",children:Or(a.weights).map((s,c)=>i("i",{style:{gridColumn:`span ${s}`}},c))})}))})})}},{type:"select",label:ce,options:e.map(n=>({value:n.value,label:n.label}))})}function Or(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 na(){return W(fo,i(Xt,{}),$e,$e[0].value)}function oa(){return b("mobile",Tr(bo,go))}function ra(){return b("mobile",U(mo,i(Ht,{}),Xe,ho,1,Xe))}function ia(e,t,n,o,r,a){return{type:"custom",render:({value:s,onChange:c})=>i(h,{label:l(e),icon:i(Ne,{noun:a}),action:i(y,{words:S()?.panel,label:l(e),changed:!Mo(s),detail:l("the Text style in Styles"),onReset:()=>c(Go),defaultAction:{onPress:()=>c(Ho),title:l("Keep this section's own built-in size"),icon:i(Bt,{})}}),children:X({min:t,max:n,step:o,value:typeof s=="number"?s:r,suffix:"px",ariaLabel:e,onChange:c})})}}function la(){return{_gCellWidth:_("Cell width"),gridSpan:W("Positions",i(Re,{}),[{label:"Auto",value:""},...Array.from({length:_t},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function B(){let e=null;try{e=ne(t=>t).selectedItem}catch{e=null}return e?.props??{}}function Pr({min:e,max:t,step:n,px:o,label:r,onChange:a,desktopKey:s,fallback:c}){const d=B()[s],f=le(void 0,d,c);return i(O,{children:X({min:e,max:t,step:n,value:le(o,d,c),readout:!1,ariaLabel:r,notch:f,onChange:a})})}function Ar({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:a=()=>{}}){const s=B()[t],c=le(void 0,s,n);return i(y,{words:S()?.panel,label:l(e),changed:r,detail:l("{value} on desktop",{value:`${c}${o}`}),onReset:a})}function Fr(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(Ar,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:t=>i(Pr,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const kr={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Lr={Top:Le,Bottom:Ae,Left:Fe,Right:ke},Nr=e=>{const t=Lr[e];return i(t,{})};function aa(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=C=>kr[C],a=C=>U(r("Top"),i(Le,{}),I.min,I.max,I.step,C,"px"),s=(C,j,T,te=I)=>b("mobile",Fr({label:r(C),icon:Nr(C),desktopKey:j,min:te.min,max:te.max,step:te.step,fallback:T})),c=e.top??I.min,d=e.bottom??I.min,f="sectionPaddingLeft",m="sectionPaddingRight",p=e.sideBounds??I,u=e.side??p.min,x=e.sidePhone??u,g=e.phone===!0,R=C=>g?b("desktop",C):C;return K({...o?{_gSpacing:_("Padding")}:{},[t]:R(a(c)),...g?{[N(t)]:s("Top",t,c)}:{},...e.only==="top"?{}:{[n]:R(U(r("Bottom"),i(Ae,{}),I.min,I.max,I.step,d,"px")),...g?{[N(n)]:s("Bottom",n,d)}:{}},...e.sides?{[f]:R(U(r("Left"),i(Fe,{}),p.min,p.max,p.step,u,"px")),...g?{[N(f)]:s("Left",f,x,p)}:{},[m]:R(U(r("Right"),i(ke,{}),p.min,p.max,p.step,u,"px")),...g?{[N(m)]:s("Right",m,x,p)}:{}}:{}})}function sa(e,t){const n=Object.fromEntries(Object.entries(t).map(([a,s])=>[a,a in e&&re(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 Q="Width";function ca(e,t=Ko,n=!0){const o=t.map(r=>({label:Wo[r],value:r}));return K({...n?{_gWidth:_(Q)}:{},widthMode:{type:"custom",render:({onChange:r,field:a})=>i(h,{label:l(Q),icon:i(nn,{}),action:n?i(nr,{inherited:a?.inherited??!1,onReset:()=>r(Uo),label:Q}):void 0,children:de({options:o,value:a?.currentValue||e,onChange:r,ariaLabel:Q})})}})}function da(){const e=o=>({type:"custom",render:({value:r,onChange:a})=>i(h,{label:G,icon:M(i(zt,{})),action:o?o(a):void 0,children:de({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:["auto","fixed","screen"].includes(r)?r:"auto",onChange:a,ariaLabel:G})})}),t=()=>({type:"custom",render:({value:o,onChange:r,field:a})=>{const s=a?.unit==="%"?"%":"px",c=s==="%"?uo:co;return i("div",{className:"sf-field",children:X({min:c.min,max:c.max,step:c.step,value:typeof o=="number"?o:c.fallback,suffix:s,ariaLabel:G,onChange:r})})}}),n=()=>Vo("Unit",i(Oe,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");return K({_gHeight:_(G),sectionHeightMode:b("desktop",e()),sectionHeightValue:b("desktop",t()),sectionHeightUnit:b("desktop",n()),sectionHeightModePhone:b("mobile",e(o=>i(vr,{onClear:()=>o(void 0)}))),sectionHeightValuePhone:b("mobile",t()),sectionHeightUnitPhone:b("mobile",n())})}function vr({onClear:e}){const t=B(),n=io(t),o=lo(t),r=l("{value} on desktop",{value:o.mode==="auto"?l("Auto"):`${o.value}${o.unit}`});return i(y,{words:S()?.panel,label:l(G),changed:n,detail:r,onReset:e})}function ua(){const e=n=>({type:"custom",render:({value:o,onChange:r,id:a,name:s})=>i(Dr,{value:o,onChange:r,labelId:`${a??s??"stickTop"}-label`,phone:n})}),t=()=>({type:"custom",render:({value:n,onChange:o})=>i("div",{className:"sf-field",children:X({min:q.min,max:q.max,step:q.step,value:typeof n=="number"?n:q.fallback,suffix:"px",ariaLabel:l("Distance from top"),onChange:o})})});return{_gStick:_(se),stickTop:b("desktop",e(!1)),stickTopDistance:b("desktop",t()),stickTopPhone:b("mobile",e(!0)),stickTopDistancePhone:b("mobile",t())}}function Dr({value:e,onChange:t,labelId:n,phone:o}){const r=B(),a=so(r),s=o?a.phone:e===!0;return i(h,{label:l(se),labelId:n,icon:M(i(Zt,{})),action:k(O,{children:[o?i(y,{words:S()?.panel,label:l(se),changed:ao(r),detail:l("{value} on desktop",{value:a.desktop?`${a.desktopDistance}px`:l("Off")}),onReset:()=>t(void 0)}):null,i(ie,{checked:s,onChange:t,ariaLabelledBy:n})]})})}const ct="e.g. about";function pa(){return{_gAnchor:_("Anchor"),anchor:F({control:"plainText",label:"Name",placeholder:ct},{type:"custom",render:({value:e,onChange:t})=>i(Ft,{value:e,onChange:t,nameBox:(n,o)=>i(A,{value:n,onChange:o,label:"Name",placeholder:ct,hideable:!1,markup:!1})})})}}function fa(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(h,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(An,{id:c,value:Number.isFinite(d)?new Date(d):null,onChange:f=>r(f?f.toISOString():"")})})}}}function ma(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:a,name:s})=>{const c=`${a??s??e}-date`;return i(h,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(Pn,{id:c,value:ft(typeof o=="string"?o:null),onChange:d=>r(d?pt(d):"")})})}}}function dt(e,t,n,o){return{type:"custom",...E({},{...$,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(h,{label:l(e),labelId:f,icon:n,hint:o===void 0?void 0:l(o),action:i(ie,{checked:d,onChange:a,ariaLabelledBy:f})})}}}function ha(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i(Ge,{label:l("Background"),icon:i(qt,{}),id:r,value:on(e),onChange:t})}}}function ga(e,t){return{type:"custom",...E({},{...$,label:e}),render:({value:n,onChange:o,id:r})=>{const a=typeof n=="boolean"?n:t,s=`${r??e}-checkbox`;return i(h,{label:l(e),htmlFor:s,className:"sf-checkbox",action:i(Rn,{id:s,checked:a,onChange:o})})}}}function ba(e,t,n){return{type:"custom",render:({value:o,onChange:r})=>i(Ge,{label:l(e),icon:n,value:o||t,onChange:r})}}function xa(){return{type:"custom",render:({value:e,onChange:t})=>i(Br,{value:typeof e=="string"?e:"",onChange:t})}}function Br({value:e,onChange:t}){const{hex:n,n:o}=Gr();return i(vn,{label:l("Fill"),icon:i(Te,{}),value:e,inherited:n,resetTo:v(n.toUpperCase(),l("Theme {n} background",{n:o})),onChange:t,onReset:()=>t("")})}function Hr(e,t,n){if((e?.content??[]).some(s=>s?.props?.id===t))return Z(n);const r=an(e,t);if(r.length===0)return null;const a=Z(Ze(n));if(a!==null)return a;for(let s=r.length-1;s>0;s-=1){const c=Z(Ze(r[s].sectionAccent));if(c!==null)return c}return Z(r[0].sectionAccent)}function Gr(){const e=ze(P().theme),[t]=D("sectionAccent");let n=null;try{const{appState:r,selectedItem:a}=ne(c=>c),s=a?.props?.id?String(a.props.id):void 0;n=s?Hr(r?.data,s,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{hex:e.themes[o].background??je.background,n:o+1}}const Mr=[{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 Kr({label:e,value:t,onChange:n,points:o=Mr}){const r=o.map(a=>({...a,label:l(a.label),...a.title?{title:l(a.title)}:null}));return i(En,{label:l(e),value:t,points:r,onChange:n})}function Sa(){return it()}const ya={top:i(Ut,{}),right:i(Wt,{}),bottom:i(Mt,{}),left:i(Kt,{})};function Ca(e,t,n,o,r,a){const s=m=>t.find(p=>p.value===m),c=m=>({value:m,label:"",disabled:!0,title:o}),d=m=>{const p=t.find(x=>x.cell===m);if(!p)return c(`missing-${m}`);const u=a?.[m];return u?{value:p.value,label:p.label,icon:u}:{value:p.value,label:p.label}},f=[c("corner-top-left"),d("top"),c("corner-top-right"),d("left"),c("centre"),d("right"),c("corner-bottom-left"),d("bottom"),c("corner-bottom-right")];return{type:"custom",render:({value:m,onChange:p})=>{const u=t.some(x=>x.value===m)?m:n;return i(h,{label:l(e),icon:r,value:s(u)?.label?l(s(u).label):"",children:Kr({label:e,value:u,onChange:p,points:f})})}}}function _a(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:a})=>i(qn,{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 wa(e,t,n,o){return{type:"custom",options:t,fallback:n,...E({},{type:"select",label:e}),render:({value:r,onChange:a,field:s})=>i(Jn,{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 Ia(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}const Ea=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function Ra(e,t,n){const o=Object.keys(xe).map(r=>({label:xe[r],value:r,picture:n[r]}));return{type:"custom",...E({},{type:"radio",label:e,options:o.map(r=>({value:r.value,label:r.label}))}),render:({onChange:r})=>i(Wr,{label:e,icon:t,options:o,onChange:r})}}function Wr({label:e,icon:t,options:n,onChange:o}){const r=ae()?.values??{},a=mt(r),s=a==="frame"&&!!be(r.mediaVideo)&&!be(r.videoFrame);return i(h,{label:l(e),icon:M(t),hint:s?l("This video has no frame yet. The slide shows its background colour until one is made."):void 0,children:de({options:n,value:a,onChange:o,ariaLabel:e})})}function Ta(e,t,n,o={}){return{type:"custom",[_e]:!0,render:({value:r,onChange:a,name:s})=>i(Vn,{value:r||"",onChange:a,fieldKey:s,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen,frameKey:o.frame})}}const Oa={HeroSingle:["imageFocal"],HeroSlide:["videoFrame"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function Ur(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 Pa({value:e,onChange:t,label:n}){const o=e||{},r=!!o.pending,a=r?"var(--ink-faint)":o.ok?"var(--status-success-soft-ink)":"var(--status-danger-soft-ink)",s=!!jo(Xo()).geocode,c=ge(),d=(f,m)=>t({...o,[f]:m??void 0});return k(O,{children:[i(h,{label:l(n),icon:i(Pe,{}),action:s?i(V,{content:l("Find from the address (OpenStreetMap)"),children:i(Be,{"aria-label":l("Find from the address"),"aria-busy":r||void 0,disabled:r,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:i(Qt,{})})}):void 0,children:s&&o.status?i(V,{content:Ur(o),className:"sf-name-tip",children:i("div",{className:`es-field-hint ${At}`,style:{margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0,color:a},children:r?l("Finding…"):l(o.status)})}):null}),i(h,{label:l("Enter by hand"),labelId:c,icon:i($t,{}),action:i(ie,{checked:!!o.manual,onChange:f=>t({...o,manual:f}),ariaLabelledBy:c})}),o.manual&&i(h,{label:l("Latitude, longitude"),icon:i(Pe,{}),children:k("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[i(He,{value:typeof o.lat=="number"?o.lat:null,onChange:f=>d("lat",f),min:-90,max:90,step:1e-4,placeholder:l("Latitude")}),i(He,{value:typeof o.lng=="number"?o.lng:null,onChange:f=>d("lng",f),min:-180,max:180,step:1e-4,placeholder:l("Longitude")})]})})]})}function $r(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function Xr(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 Aa(e,t){return e===null?null:t>e?e:null}function jr(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 Fa={label:"Ticker items",icon:i(Vt,{})};function ka(e,t,n,o){return{type:"custom",[w]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...E({},{...et.textList,label:e}),render:({value:r,onChange:a})=>i(zr,{label:e,icon:M(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:a,markup:o==="markup"})}}function zr({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:a=!1}){const s=z(null),[c,d]=H(null),f=p=>p.map(u=>({text:u?.text??""})),m=p=>{const u=jr(n,p,c);u===null&&(s.current=null),d(u),r(f(p))};return i(bn,{label:l(e),icon:t,noun:l("item"),items:n,onChange:m,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:a?i(Me,{target:s,value:$r(n,c),onChange:p=>r(Xr(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,x)=>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=>x({text:g.target.value}),onFocus:g=>{s.current=g.currentTarget,d(u)}})})}function La(e,t){const n=`${e.label} — row ${t+1}`;return F({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>i(A,{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 Na(e){return{_gCards:_("Cards"),coverIndex:W("Cover image",i(Yt,{}),jn,String(zn),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:dr("Image background",Ro),cardImage:qr(),spinOnHover:dt("Rotate on hover",e?.spinDefault??!0,i(Jt,{}))}}function va(){return{outline:W("Card outline",i(en,{}),Un,Xn),indexBadge:W("Card number",i(Oe,{}),Wn,$n),showBadge:dt("Product badge",!0,i(Ne,{noun:"tag"}))}}function Da(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...$,label:ee.find(a=>a.id===r).label}),o=r=>E(Dn(fe),n(r));return{_gShowOnCard:_("Show on a card"),[fe]:E({type:"custom",render:()=>i(Yr,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(fe)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const fe="showCardPrice",ee=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function Yr({rest:e}){const t=B(),n=ur(),o=s=>typeof t[s]=="boolean"?t[s]:void 0,r=s=>o(s)??e[s],a=ee.some(({id:s})=>o(s)!==void 0&&o(s)!==e[s]);return i(me,{parts:ee,changed:a,shown:r,onPress:(s,c)=>n({[s]:c}),onReset:()=>n(Object.fromEntries(ee.map(({id:s})=>[s,void 0])))})}function Ba(e,t="display"){const n=N(t);return{[t]:b("desktop",{type:"custom",render:({value:o,onChange:r})=>i(me,{parts:e,changed:Sn(o),shown:a=>yn(o,a),onPress:(a,s)=>r(wn(o,a,s)),onReset:()=>r(void 0)})}),[n]:b("mobile",{type:"custom",render:({value:o,onChange:r})=>i(Vr,{parts:e,desktopKey:t,value:o,onChange:r})})}}function me({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:a}){const s=l("Display");return i(h,{label:s,icon:i(Lt,{}),changed:t,action:i(y,{words:S()?.panel,label:s,changed:t,detail:a,onReset:r}),children:i(xn,{label:s,items:e.map(c=>({id:c.id,label:l(c.label),shown:n(c.id)})),onChange:o})})}function Vr({parts:e,desktopKey:t,value:n,onChange:o}){const r=B()[t];return i(me,{parts:e,changed:_n(n),shown:a=>Cn(r,n,a),onPress:(a,s)=>o(In(n,a,s)),onReset:()=>o(Mn),detail:l("the same as Desktop")})}function qr(){return rt("Card image",{min:L,max:Ie,step:St,hint:"Rounds the picture. The card's own corner is in Styles."})}function Ha(){return pe({sidesKey:"cornerSides",step:yt,useFollowed:()=>L,mark:i(Zr,{label:Ct}),hint:l("Rounds the picture. Left alone it stays square.")})}function Zr({label:e,changed:t=!1,onReset:n=()=>{}}){return i(y,{words:S()?.panel,label:l(e),changed:t,onReset:n})}function Ga(){return{type:"custom",render:({value:e,onChange:t})=>i(ti,{value:typeof e=="string"?e:"",onChange:t})}}function Jr({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:Et(e).map(([n,o],r)=>i("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${n}`,gridRow:`span ${o}`}},r))})}const Qr={width:"3.5rem",height:"2.5rem"},ei=200;function ti({value:e,onChange:t}){const[n,o]=H(null),[r,a]=H(4),s=z(null);ut(()=>{const u=s.current;if(!u||typeof ResizeObserver!="function")return;const x=()=>a(u.getBoundingClientRect().width>=ei?4:3);x();const g=new ResizeObserver(x);return g.observe(u),()=>g.disconnect()},[]);const c=e&&e in Y?e:"",d=Ee(n,c),f=Ee(n,"").length,m=Rt("no-symbol"),p=[{value:"",label:l("Not chosen"),icon:m},...d.map(u=>({value:u,label:l(Y[u].label),icon:i(Jr,{layout:Y[u],width:40})}))];return i(h,{label:l("Layout"),icon:i(jt,{}),value:c?l(Y[c].label):l("Not chosen"),children:i("div",{ref:s,style:{flex:"1 1 auto",minWidth:0},children:i(Ln,{label:l("Layout"),value:c,emptyValue:"",options:p,onChange:t,columns:r,cell:Qr,header:k("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(pn,{options:[{id:"all",label:l("All")},...wt.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:It.length})})]})})})})}export{rr as BOUND_TO_POST,kl as BOUND_TO_POST_NOTE,Ml as BUCKET_ICONS,Oa as CUSTOM_FIELD_MEDIA,Pa as CoordsField,er as DESKTOP_GAP_NOT_OVERLAP,ya as EDGE_ARROWS,Fn as FOCAL_DEFAULT,Mr as FOCAL_POINTS,oe as FOLD_FIELD_MARKER,Kr as FocalPicker,Vl as GroupLabel,ir as HIGHLIGHT_HINT,A as HidableTextField,Ce as LINK_FIELD_MARKER,Cl as Label,_e as MEDIA_FIELD_MARKER,Ea as MEDIA_TYPE_OPTIONS,Ll as NOT_BOUND_TO_POST,Yl as PanelBand,sr as PanelNoteLine,we as SCAFFOLD_FIELD_MARKER,Ua as SCALAR_TEXT_CONTROLS,Zo as SiteGapDefaultReset,X as Slider,ot as Swatches,Wa as TEXT_CONTROL_KINDS,w as TEXT_FIELD_MARKER,Fa as TICKER_ITEMS_ROW,zr as TextListField,Q as WIDTH_LABEL,nr as WidthDefaultReset,jr as aimAfterListChange,pa as anchorFields,v as backTo,ql as backgroundField,na as boxBlockSpacingField,xa as boxFillField,ra as boxPhoneRowField,Tr as boxShareField,oa as boxSharePhoneField,Hr as boxThemeIndexOf,$l as bucketHeader,Ql as buttonWordsEntryField,Er as cardCornersField,dr as cardImageBackgroundField,qr as cardImageField,Na as cardMediaFields,ta as cardShapeFields,Da as cardShowFields,va as cardStyleFields,la as cellWidthFields,ga as checkbox,ba as colorInput,wl as containerDirectionField,Jo as containerGapField,Qo as containerGapPhoneField,_l as containerGapRows,Ur as coordsResultTip,Bl as copyText,lt as cornerSidesField,pe as cornersRowField,ma as date,fa as dateTime,Xl as designGroupHeader,Ba as displayFields,Ca as edgePad,Kl as entriesHiddenForTab,Aa as focusAfterRemove,Sa as focusKeptField,jl as foldMarker,re as foldMetaOf,cr as foldTitleOf,Ga as galleryLayoutField,da as heightFields,Il as heroGroupPlacementPoints,ye as hidableText,ar as hintIsWhileTyping,Ha as imageCornersField,Fl as inOwnBox,Ul as isBucketHeader,it as keptBy,Hl as linkField,Ra as loadingShowsField,_a as multiSelect,ha as pageBackgroundField,Wl as panelNote,Fr as phoneOverrideField,Dl as plainText,Gl as plainTextarea,rt as pxField,zl as quietMarker,Se as readHidable,$r as rowText,wa as searchSelect,at as sectionBorderField,hr as sectionCornersField,Jl as sectionShapeFields,Zl as sectionThemeFields,Xr as setRowText,ia as sizeField,Ia as sourceField,aa as spacingFields,ua as stickFields,sa as swapPadding,ea as templateField,Nl as text,ht as textFieldIdentifier,Tl as textFieldOffPage,Pl as textFieldPanelOnly,ka as textList,La as textListRowField,vl as textarea,dt as toggle,Ta as upload,ur as useSelectedPatch,B as useSelectedProps,D as useSelectedSibling,qo as useSiteGapDetail,ca as widthField,Al as withIdentifier,Rl as withOffPage,Ol as withPanelOnly,El as withScaffold};
@@ -1 +1 @@
1
- import i from"../../../components/PreviewPartAnchors.js";import{animationTabFields as o}from"../../animation/fields.js";import{BLOCK_THEME_FOLLOW_LABEL as r,SECTION_THEME_FOLLOW_LABEL as e}from"../../../components/SectionThemePicker.js";import{anchorFields as s,blockSizeFields as t,cardShapeFields as d,cellWidthFields as m,heightFields as l,sectionShapeFields as p,sectionThemeFields as F,spacingFields as n,stickFields as a,widthField as c}from"../controls.js";import{sidesPaddingFields as h}from"../box-fields.js";import{assignSectionGroups as f}from"../field-groups.js";import{boxGutterFields as E}from"../box-gutter-field.js";import{dropEmptyHeadings as L}from"../panel-drop-empty-headings.js";import{rowsShownForNode as S}from"../show-when-resolve.js";const C={spacingFields:n,sidesPaddingFields:h,sectionShapeFields:p,cardShapeFields:d,cellWidthFields:m,widthField:c,boxGutterFields:E,heightFields:l,anchorFields:s,stickFields:a,sectionThemeFields:F,animationTabFields:o,blockSizeFields:t,assignSectionGroups:f,dropEmptyHeadings:L,rowsShownForNode:S,SECTION_THEME_FOLLOW_LABEL:e,BLOCK_THEME_FOLLOW_LABEL:r,PartAnchors:i};export{C as PASS_INSPECTOR};
1
+ import o from"../../../components/PreviewPartAnchors.js";import{animationTabFields as r}from"../../animation/fields.js";import{BLOCK_THEME_FOLLOW_LABEL as e,SECTION_THEME_FOLLOW_LABEL as s}from"../../../components/SectionThemePicker.js";import{anchorFields as t,cardShapeFields as d,cellWidthFields as m,heightFields as l,sectionShapeFields as p,sectionThemeFields as F,spacingFields as a,stickFields as n,widthField as c}from"../controls.js";import{blockSizeFieldSet as S}from"efficient-easel/screen/lib/document/block-size-fields";import{rowSay as h,sidesPaddingFields as f}from"../box-fields.js";import{assignSectionGroups as E}from"../field-groups.js";import{boxGutterFields as L}from"../box-gutter-field.js";import{dropEmptyHeadings as O}from"../panel-drop-empty-headings.js";import{rowsShownForNode as _}from"../show-when-resolve.js";const H={spacingFields:a,sidesPaddingFields:f,sectionShapeFields:p,cardShapeFields:d,cellWidthFields:m,widthField:c,boxGutterFields:L,heightFields:l,anchorFields:t,stickFields:n,sectionThemeFields:F,animationTabFields:r,blockSizeFields:i=>S({...i,say:h}),assignSectionGroups:E,dropEmptyHeadings:O,rowsShownForNode:_,SECTION_THEME_FOLLOW_LABEL:s,BLOCK_THEME_FOLLOW_LABEL:e,PartAnchors:o};export{H as PASS_INSPECTOR};
@@ -1,12 +1,10 @@
1
1
  import type { CSSProperties } from "react";
2
+ import { CORNER_SIDES, type CornerSide, hasCornerSubset, normalizeCornerSides } from "efficient-easel/screen/lib/content/style-keys";
2
3
  export declare function hasOwnSectionCorners(value: unknown): boolean;
3
4
  export declare function sectionCornerStyle(value: unknown, sides?: unknown): CSSProperties | undefined;
4
5
  export declare const SECTION_RADIUS_PROP = "--sf-section-radius";
5
6
  export declare const CARD_RADIUS_PROP = "--sf-card-radius";
6
- export declare const CORNER_SIDES: readonly ["tl", "tr", "br", "bl"];
7
- export type CornerSide = (typeof CORNER_SIDES)[number];
8
- export declare function normalizeCornerSides(value: unknown): CornerSide[] | null;
9
- export declare function hasCornerSubset(value: unknown): boolean;
7
+ export { CORNER_SIDES, type CornerSide, hasCornerSubset, normalizeCornerSides };
10
8
  export declare function cornerSidesShorthand(radius: string, sides: CornerSide[]): string;
11
9
  export declare const CORNER_SIDE_POINTS: readonly {
12
10
  value: CornerSide;
@@ -1 +1 @@
1
- import{cornerRadiusTokens as l,normalizeCornerRadius as u}from"../theme.js";function c(r){return typeof r=="number"&&Number.isFinite(r)}function S(r,t){if(!c(r))return;const e=l(u(r));if(Object.keys(e).length===0)return;const o=e[a];if(typeof o!="string")return e;const s=d(t)?p(o,i(t)??[]):o;return{...e,[f]:s}}const f="--sf-section-radius",a="--sf-card-radius",n=["tl","tr","br","bl"];function i(r){if(!Array.isArray(r))return null;const t=r.filter(e=>n.includes(e));return n.filter(e=>t.includes(e))}function d(r){const t=i(r);return t!==null&&t.length<n.length}function p(r,t){return n.map(e=>t.includes(e)?r:"0").join(" ")}const R=[{value:"tl",label:"Top left"},{value:"tr",label:"Top right"},{value:"bl",label:"Bottom left"},{value:"br",label:"Bottom right"}];export{a as CARD_RADIUS_PROP,n as CORNER_SIDES,R as CORNER_SIDE_POINTS,f as SECTION_RADIUS_PROP,p as cornerSidesShorthand,d as hasCornerSubset,c as hasOwnSectionCorners,i as normalizeCornerSides,S as sectionCornerStyle};
1
+ import{CORNER_SIDES as n,hasCornerSubset as i,normalizeCornerSides as s}from"efficient-easel/screen/lib/content/style-keys";import{cornerRadiusTokens as l,normalizeCornerRadius as a}from"../theme.js";function c(e){return typeof e=="number"&&Number.isFinite(e)}function m(e,t){if(!c(e))return;const r=l(a(e));if(Object.keys(r).length===0)return;const o=r[p];if(typeof o!="string")return r;const u=i(t)?d(o,s(t)??[]):o;return{...r,[f]:u}}const f="--sf-section-radius",p="--sf-card-radius";function d(e,t){return n.map(r=>t.includes(r)?e:"0").join(" ")}const R=[{value:"tl",label:"Top left"},{value:"tr",label:"Top right"},{value:"bl",label:"Bottom left"},{value:"br",label:"Bottom right"}];export{p as CARD_RADIUS_PROP,n as CORNER_SIDES,R as CORNER_SIDE_POINTS,f as SECTION_RADIUS_PROP,d as cornerSidesShorthand,i as hasCornerSubset,c as hasOwnSectionCorners,s as normalizeCornerSides,m as sectionCornerStyle};
@@ -1 +1 @@
1
- import{FOOTER_LOGO_PX as T}from"../logo/logo-size.js";import{resolveContainerGap as E}from"../content/container-gap.js";import{NESTED_BOX_PADDING as a}from"../content/box-layout.js";import{finiteNumber as p}from"../finite-number.js";import{buildSectionGroup as _,SITE_FOOTER_TYPE as O}from"./section-groups.js";const u="Flex",P={FooterMenu:"MenuBlock",FooterEmailSignup:"EmailFormBlock",FooterSocial:"SocialLogosBlock",FooterPayment:"PaymentLogosBlock"},x=o=>{const{id:e,...t}=o;return t},d=o=>typeof o=="string"?o:"",f={sm:12,md:13,lg:15},y="md",h=1.5,L={size:13,lineHeight:h,width:280},A=14,B=40,b=o=>o==="center"||o==="right"?o:"left";function G(o){const e={},t=[["padTop","sectionPaddingTop"],["padRight","sectionPaddingRight"],["padBottom","sectionPaddingBottom"],["padLeft","sectionPaddingLeft"]];for(const[s,r]of t){const n=p(o[s]);n&&(e[r]=n)}return e}function F(o,e){const t=o.props??{},s=P[o.type];if(s)return[e(s,x(t))];switch(o.type){case"FooterLogo":{const r=b(t.align),n=e("LogoBlock",{...t.reverse?{reverse:t.reverse}:{},...typeof t.customColor=="string"&&t.customColor?{customColor:t.customColor}:{},heightPx:Math.round(T*((p(t.widthPct)??100)/100)),href:"/",align:r,...G(t)}),i=d(t.tagline).trim();return i?[n,e("Text",{text:i,tone:"dim",align:r,_partStyles:{text:{...L}}})]:[n]}case"FooterText":{const r=typeof t.size=="string"&&t.size in f?t.size:y;return[e("Text",{text:d(t.text),tone:typeof t.tone=="string"?t.tone:"default",_partStyles:{text:{size:f[r],lineHeight:h}}})]}case"FooterDivider":{const r=p(t.thickness),n=p(t.lengthPct);return[e("Divider",{...r!==void 0?{thickness:r}:{},...n!==void 0?{lengthPct:n}:{},...t.hideOnMobile===!0?{hideOnMobile:!0}:{}})]}case"FooterGroup":{const r=Array.isArray(t.blocks)?t.blocks:[];return[e(u,{direction:t.direction==="horizontal"?"row":"column",gap:E("FooterGroup",t.gap),align:t.align==="center"||t.align==="end"?t.align:"start",...a,content:r.flatMap(n=>F(n,e))})]}default:return[]}}function M(o,e,t){const s=o&&Array.isArray(o.props?.blocks)?o.props.blocks:[],r=c=>e(u,{direction:"row",wrap:!0,share:"equal",gap:B,content:c}),n=[];let i=[];for(const c of s){const l=F(c,e);if(c.type==="FooterDivider"){i.length&&n.push(r(i)),i=[],n.push(...l);continue}l.length<=1?i.push(...l):i.push(e(u,{direction:"column",gap:A,align:"stretch",...a,content:l}))}(i.length||!n.length)&&n.push(r(i));const m=e(u,{direction:"column",content:[e("LegalLineBlock")]}),g=_(O,t,[...n,m]);return{...g,props:{...g.props,...o?.props?.width==="full"?{fullWidth:!0}:{}}}}export{f as FOOTER_TEXT_PX,M as boxFooterFromFooter,F as pageBlocksFromFooterBlock};
1
+ import{FOOTER_LOGO_PX as T}from"../logo/logo-size.js";import{resolveContainerGap as E}from"../content/container-gap.js";import{NESTED_BOX_PADDING as a}from"../content/box-layout.js";import{finiteNumber as p}from"../finite-number.js";import{buildSectionGroup as _,SITE_FOOTER_TYPE as O}from"./section-groups.js";const g="Flex",P={FooterMenu:"MenuBlock",FooterEmailSignup:"EmailFormBlock",FooterSocial:"SocialLogosBlock",FooterPayment:"PaymentLogosBlock"},x=o=>{const{id:e,...t}=o;return t},d=o=>typeof o=="string"?o:"",f={sm:12,md:13,lg:15},y="md",h=1.5,L={size:13,lineHeight:h,width:280},A=14,B=40,b=o=>o==="center"||o==="right"?o:"left";function G(o){const e={},t=[["padTop","sectionPaddingTop"],["padRight","sectionPaddingRight"],["padBottom","sectionPaddingBottom"],["padLeft","sectionPaddingLeft"]];for(const[s,r]of t){const n=p(o[s]);n&&(e[r]=n)}return e}function F(o,e){const t=o.props??{},s=P[o.type];if(s)return[e(s,x(t))];switch(o.type){case"FooterLogo":{const r=b(t.align),n=e("LogoBlock",{...t.reverse?{reverse:t.reverse}:{},...typeof t.customColor=="string"&&t.customColor?{customColor:t.customColor}:{},heightPx:Math.round(T*((p(t.widthPct)??100)/100)),href:"/",align:r,...G(t)}),i=d(t.tagline).trim();return i?[n,e("Text",{text:i,tone:"dim",align:r,_partStyles:{text:{...L}}})]:[n]}case"FooterText":{const r=typeof t.size=="string"&&t.size in f?t.size:y;return[e("Text",{text:d(t.text),tone:typeof t.tone=="string"?t.tone:"default",_partStyles:{text:{size:f[r],lineHeight:h}}})]}case"FooterDivider":{const r=p(t.thickness),n=p(t.lengthPct);return[e("Divider",{...r!==void 0?{thickness:r}:{},...n!==void 0?{lengthPct:n}:{},...t.hideOnMobile===!0?{hideOnMobile:!0}:{}})]}case"FooterGroup":{const r=Array.isArray(t.blocks)?t.blocks:[];return[e(g,{direction:t.direction==="horizontal"?"row":"column",gap:E("FooterGroup",t.gap),align:t.align==="center"||t.align==="end"||t.align==="stretch"?t.align:"start",...a,content:r.flatMap(n=>F(n,e))})]}default:return[]}}function M(o,e,t){const s=o&&Array.isArray(o.props?.blocks)?o.props.blocks:[],r=c=>e(g,{direction:"row",wrap:!0,share:"equal",gap:B,content:c}),n=[];let i=[];for(const c of s){const l=F(c,e);if(c.type==="FooterDivider"){i.length&&n.push(r(i)),i=[],n.push(...l);continue}l.length<=1?i.push(...l):i.push(e(g,{direction:"column",gap:A,align:"stretch",...a,content:l}))}(i.length||!n.length)&&n.push(r(i));const m=e(g,{direction:"column",content:[e("LegalLineBlock")]}),u=_(O,t,[...n,m]);return{...u,props:{...u.props,...o?.props?.width==="full"?{fullWidth:!0}:{}}}}export{f as FOOTER_TEXT_PX,M as boxFooterFromFooter,F as pageBlocksFromFooterBlock};
@@ -0,0 +1,6 @@
1
+ export declare const EASEL_ROW_WORDS: {
2
+ readonly fillColor: "Fill color";
3
+ readonly textFit: "When the text does not fit";
4
+ readonly wrap: "Wrap";
5
+ readonly shrink: "Shrink to fit";
6
+ };
@@ -0,0 +1 @@
1
+ const t={fillColor:"Fill color",textFit:"When the text does not fit",wrap:"Wrap",shrink:"Shrink to fit"};export{t as EASEL_ROW_WORDS};
@@ -1,4 +1,5 @@
1
1
  import type { ComponentType, ReactNode } from "react";
2
+ import type { TextFit } from "efficient-easel/draw";
2
3
  import type { AnimationTabKind } from "../../../../editor/lib/animation/fields.js";
3
4
  export type PassRenderProps = Record<string, unknown>;
4
5
  export type PassResolveFields = (data: {
@@ -39,7 +40,7 @@ export type PassInspector = {
39
40
  sectionThemeFields: (readValue?: (v: unknown) => unknown, followLabel?: string) => FieldMap;
40
41
  animationTabFields: (kind: AnimationTabKind) => FieldMap;
41
42
  blockSizeFields: (opts?: {
42
- textFit?: "wrap" | "shrink";
43
+ textFit?: TextFit;
43
44
  }) => {
44
45
  size: FieldMap;
45
46
  text: FieldMap;
@@ -122,7 +122,6 @@ export declare const WEB_BUILDER_WORDS: {
122
122
  readonly Anchor: "Anchor";
123
123
  readonly Animation: "Animation";
124
124
  readonly "Another group already uses this heading \u2014 pick a different one.": "Another group already uses this heading — pick a different one.";
125
- readonly "Another page uses this URL handle.": "Another page uses this URL handle.";
126
125
  readonly Answer: "Answer";
127
126
  readonly "Any color": "Any color";
128
127
  readonly App: "App";
@@ -315,7 +314,6 @@ export declare const WEB_BUILDER_WORDS: {
315
314
  readonly "Couldn\u2019t add the page \u2014 please retry.": "Couldn’t add the page — please retry.";
316
315
  readonly "Couldn\u2019t add the popup \u2014 please retry.": "Couldn’t add the popup — please retry.";
317
316
  readonly "Couldn\u2019t delete the page \u2014 please retry.": "Couldn’t delete the page — please retry.";
318
- readonly "Couldn\u2019t duplicate the page \u2014 please retry.": "Couldn’t duplicate the page — please retry.";
319
317
  readonly "Couldn\u2019t duplicate the section \u2014 please retry": "Couldn’t duplicate the section — please retry";
320
318
  readonly "Couldn\u2019t load pages": "Couldn’t load pages";
321
319
  readonly "Couldn\u2019t open this section.": "Couldn’t open this section.";
@@ -390,7 +388,6 @@ export declare const WEB_BUILDER_WORDS: {
390
388
  readonly Down: "Down";
391
389
  readonly "Draft before restore": "Draft before restore";
392
390
  readonly "Drop in your own sanitized HTML.": "Drop in your own sanitized HTML.";
393
- readonly "Duplicate page": "Duplicate page";
394
391
  readonly "Duplicate section": "Duplicate section";
395
392
  readonly "Duplicate to another page": "Duplicate to another page";
396
393
  readonly "Duplicate to page": "Duplicate to page";
@@ -1103,7 +1100,6 @@ export declare const WEB_BUILDER_WORDS: {
1103
1100
  readonly "Texture opacity": "Texture opacity";
1104
1101
  readonly "Thanks \u2014 we'll email you to confirm.": "Thanks — we'll email you to confirm.";
1105
1102
  readonly "The chat bubble is hidden across the whole site.": "The chat bubble is hidden across the whole site.";
1106
- readonly "The copy is a draft and stays hidden until you publish it. It opens in the editor.": "The copy is a draft and stays hidden until you publish it. It opens in the editor.";
1107
1103
  readonly "The current product's compatible tyres \u2014 image, size, key specs and price per tyre, with an inquiry link. Display only.": "The current product's compatible tyres — image, size, key specs and price per tyre, with an inquiry link. Display only.";
1108
1104
  readonly "The current product's related items in a tidy row \u2014 the product page's built-in 'Pair with' cross-sell.": "The current product's related items in a tidy row — the product page's built-in 'Pair with' cross-sell.";
1109
1105
  readonly "The floating chat bubble shows in the corner of every page.": "The floating chat bubble shows in the corner of every page.";
@@ -1187,7 +1183,6 @@ export declare const WEB_BUILDER_WORDS: {
1187
1183
  readonly "Typed in": "Typed in";
1188
1184
  readonly "Tyre Fitment Form": "Tyre Fitment Form";
1189
1185
  readonly "Tyre Sizes": "Tyre Sizes";
1190
- readonly "URL handle": "URL handle";
1191
1186
  readonly "URL pill": "URL pill";
1192
1187
  readonly "URL: /{slug}": "URL: /{slug}";
1193
1188
  readonly Undo: "Undo";