efficient-web-builder 58.0.0 → 59.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.
- package/CHANGELOG.md +40 -0
- package/dist/editor/components/SwitchToBoxFooter.js +1 -1
- package/dist/editor/components/useCardContentSwitchPass.d.ts +1 -0
- package/dist/editor/components/useCardContentSwitchPass.js +1 -0
- package/dist/editor/components/usePinnedChromeSeed.js +1 -1
- package/dist/editor/lib/document/ColourControl.js +1 -1
- package/dist/editor/lib/document/blocks/general/CardList/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Cards/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Chart/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Countdown/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Logos/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Mockup/fields.js +2 -2
- package/dist/editor/lib/document/box-footer-rows.d.ts +3 -0
- package/dist/editor/lib/document/box-footer-rows.js +1 -0
- package/dist/editor/lib/document/card-row-fields.d.ts +2 -1
- package/dist/editor/lib/document/card-row-fields.js +1 -1
- package/dist/editor/lib/document/choice-pictures.d.ts +2 -1
- package/dist/editor/lib/document/choice-pictures.js +1 -1
- package/dist/editor/lib/document/controls.d.ts +12 -6
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/page-root.js +2 -2
- package/dist/editor/lib/sections/text-layouts.js +1 -1
- package/dist/format/lib/content/block-align.d.ts +1 -0
- package/dist/format/lib/content/block-align.js +1 -1
- package/dist/format/lib/content/block-sources.d.ts +1 -0
- package/dist/format/lib/content/block-sources.js +1 -1
- package/dist/format/lib/content/box-background.d.ts +2 -2
- package/dist/format/lib/content/box-background.js +1 -1
- package/dist/format/lib/content/box-shape.d.ts +1 -1
- package/dist/format/lib/content/card-columns.d.ts +1 -0
- package/dist/format/lib/content/card-columns.js +1 -0
- package/dist/format/lib/content/card-place.js +1 -1
- package/dist/format/lib/content/card-state.d.ts +17 -0
- package/dist/format/lib/content/card-state.js +1 -1
- package/dist/format/lib/content/card-template.js +1 -1
- package/dist/format/lib/content/gallery-layout.d.ts +13 -1
- package/dist/format/lib/content/gallery-layout.js +1 -1
- package/dist/format/lib/content/page-background.js +1 -1
- package/dist/format/lib/content/page-width.d.ts +1 -0
- package/dist/format/lib/content/page-width.js +1 -1
- package/dist/format/lib/content/section-background.js +1 -1
- package/dist/format/lib/document/blocks/general/Cards/card-list-seed.d.ts +17 -0
- package/dist/format/lib/document/blocks/general/Cards/card-list-seed.js +1 -0
- package/dist/format/lib/document/blocks/general/Chart/meta.d.ts +1 -0
- package/dist/format/lib/document/blocks/general/Chart/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/Countdown/meta.d.ts +1 -0
- package/dist/format/lib/document/blocks/general/Countdown/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/Mockup/meta.d.ts +1 -0
- package/dist/format/lib/document/blocks/general/Mockup/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/text-part-shapes.json +10 -0
- package/dist/format/lib/document/box-footer.d.ts +13 -2
- package/dist/format/lib/document/box-footer.js +1 -1
- package/dist/format/lib/document/card-content-switch.d.ts +21 -0
- package/dist/format/lib/document/card-content-switch.js +1 -0
- package/dist/format/lib/document/card-row-keys.d.ts +14 -0
- package/dist/format/lib/document/card-row-keys.js +1 -0
- package/dist/format/lib/document/cards-template-on-read.d.ts +1 -1
- package/dist/format/lib/document/cards-template-on-read.js +1 -1
- package/dist/format/lib/document/container-blocks.js +1 -1
- package/dist/format/lib/document/neutralization-contracts.js +1 -1
- package/dist/format/lib/document/part-inks.d.ts +5 -2
- package/dist/format/lib/document/part-inks.js +1 -1
- package/dist/format/lib/document/section-catalog.js +2 -10
- package/dist/format/lib/document/seed-parts.d.ts +2 -0
- package/dist/format/lib/document/seed-parts.js +1 -1
- package/dist/format/lib/document/theme-slots.d.ts +20 -0
- package/dist/format/lib/document/theme-slots.js +1 -0
- package/dist/format/lib/editor-words-catalogue.d.ts +4 -0
- package/dist/format/lib/editor-words-catalogue.js +2 -2
- package/dist/format/lib/sections/logo-look.d.ts +1 -1
- package/dist/format/lib/sections/logo-look.js +1 -1
- package/dist/format/lib/theme.d.ts +1 -0
- package/dist/format/lib/theme.js +4 -4
- package/dist/render/components/Cards.d.ts +2 -1
- package/dist/render/components/Cards.js +1 -1
- package/dist/render/components/ChartSection.d.ts +2 -1
- package/dist/render/components/ChartSection.js +1 -1
- package/dist/render/components/Countdown.d.ts +2 -1
- package/dist/render/components/Countdown.js +1 -1
- package/dist/render/components/FeaturedCover.d.ts +2 -1
- package/dist/render/components/FeaturedCover.js +1 -1
- package/dist/render/components/KeyFeatures.js +1 -1
- package/dist/render/components/Logos.d.ts +5 -1
- package/dist/render/components/Logos.js +1 -1
- package/dist/render/components/MockupSection.d.ts +2 -1
- package/dist/render/components/MockupSection.js +1 -1
- package/dist/render/components/SiteGutterFrame.d.ts +5 -1
- package/dist/render/components/SiteGutterFrame.js +1 -1
- package/dist/render/components/Text.d.ts +2 -1
- package/dist/render/components/Text.js +1 -1
- package/dist/render/lib/content/section-edge.d.ts +7 -0
- package/dist/render/lib/content/section-edge.js +1 -1
- package/dist/render/lib/document/blocks/general/CardList/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Cards/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Chart/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Countdown/render.js +1 -1
- package/dist/render/lib/document/blocks/general/FeaturedCover/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Logos/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Logos/wall-rows.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/Logos/wall-rows.js +1 -0
- package/dist/render/lib/document/blocks/general/Mockup/render.js +2 -2
- package/dist/render/lib/document/blocks/general/Text/render.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +3 -1
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.d.ts +3 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-head.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-logos.d.ts +1 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-logos.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-promo.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-promo.js +1 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-proof.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-proof.js +1 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-stats.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
- package/dist/render/lib/document/head-core-boxes.d.ts +1 -0
- package/dist/render/lib/document/head-core-boxes.js +1 -1
- package/dist/render/lib/document/hero-media-parts.d.ts +2 -2
- package/dist/render/lib/document/page-render.js +1 -1
- package/dist/render/lib/document/passes/section-width.js +1 -1
- package/dist/render/lib/document/wall-labels.d.ts +3 -0
- package/dist/render/lib/document/wall-labels.js +1 -0
- package/dist/render/lib/sections/section-to-box.d.ts +1 -0
- package/dist/render/lib/sections/section-to-box.js +1 -1
- package/package.json +3 -3
- package/dist/editor/lib/document/theme-swatches.d.ts +0 -3
- package/dist/editor/lib/document/theme-swatches.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as i,jsxs as N,Fragment as k}from"react/jsx-runtime";import{cloneElement as ve,createContext as Xt,useContext as Be,useEffect as Vt,useId as De,useRef as V,useState as z}from"react";import{useEasel as te,useSelectedHost as M}from"efficient-easel/easel";import{toDateKey as zt,fromDateKey as Yt}from"efficient-shell/format";import{say as l,editorEaselWords as S}from"../../../format/lib/editor-words.js";import{LOADING_SHOWS_LABELS as He,firstFrameHint as qt,loadingShowsOf as Jt,loadingStillHint as Zt}from"../../../format/lib/hero-video.js";import{pageFramesFor as Qt,usePageVideoFrames as en}from"../page-video-frames.js";import{ScreenDocumentContext as tn}from"efficient-easel/screen/components/ScreenDocumentContext";import{readHidable as Ge,hidableText as Me}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as ue,LINK_FIELD_MARKER as Ue,MEDIA_FIELD_MARKER as We,SCAFFOLD_FIELD_MARKER as Ke,TEXT_FIELD_MARKER as O,foldMetaOf as pe,textFieldIdentifier as nn}from"efficient-easel/draw";import on from"../../components/ApplyCornersToSiblings.js";import{withShowWhen as $e}from"../../../render/lib/document/show-when.js";import rn from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as ln,CORNER_RADIUS_MAX as je,CORNER_RADIUS_MIN as U}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as sn,IMAGE_CORNERS_LABEL as an}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as cn}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as dn,GALLERY_LAYOUTS as ne,GALLERY_LAYOUT_KEYS as un,galleryChoices as Xe,galleryPictureCells as pn}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as fn}from"./shell-glyph.js";import{anchorSiblingsOf as hn,placementPoints as mn}from"../../../format/lib/hero-group-placement.js";import gn from"../../components/AnchorField.js";import bn from"../../components/SourceStatus.js";import{AdjustIcon as wn,EyeIcon as xn,AnimationIcon as Sn,BackgroundIcon as yn,BorderAllIcon as Cn,BlockSectionIcon as _n,ColumnWidthsIcon as fe,ColumnsIcon as Ve,CornerIcon as Rn,DirectionDownIcon as Tn,DirectionLeftIcon as On,DirectionRightIcon as In,DirectionUpIcon as En,EditIcon as kn,GapIcon as Fn,GridIcon as An,GroundIcon as oe,HashIcon as ze,HeightIcon as Ln,ImageIcon as Nn,ListIcon as Pn,LocationIcon as Ye,PaddingBottomIcon as qe,PaddingLeftIcon as Je,PaddingRightIcon as Ze,PaddingTopIcon as Qe,PageIcon as vn,StickyIcon as Bn,SearchIcon as Dn,SquareIcon as Hn,TypeIcon as Gn,WidthIcon as Mn}from"efficient-easel/icons";import{FieldGlyph as et}from"../../components/FieldGlyph.js";import{resolvePageBackground as Un}from"../../../format/lib/content/page-background.js";import{boxFillOf as Wn,boxFillSlot as tt}from"../../../format/lib/content/box-background.js";import{typedHex as Kn}from"efficient-easel/pick";import{CORNER_SIDES as nt,CORNER_SIDE_POINTS as $n,hasOwnSectionCorners as jn,normalizeCornerSides as ot}from"../../../format/lib/content/section-corners.js";import{enclosingPath as Xn,enclosingSection as Vn}from"./enclosing-section.js";import{SettingsDefaultReset as y,SettingsDrill as zn,SettingsField as w,SettingsGroup as Yn,SettingsGroupSub as qn,SettingsSegmented as Jn,SettingsBorder as Zn,SettingsSidesEach as Qn,SettingsSwitch as he,borderSides as eo,borderStartEach as to}from"efficient-easel/panel";import{ListField as no}from"efficient-easel/fields";import{DisplayChips as oo}from"efficient-shell/ui";import{desktopDisplayChanged as ro,partShownOnDesktop as io,partShownOnPhone as lo,phoneDisplayChanged as so,withDesktopPart as ao,withPhonePart as co}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as uo,Checkbox as po,ColorSwatch as fo,CornersInput as ho,DatePicker as mo,DateTimePicker as go,FOCAL_DEFAULT as bo,IconPicker as rt,COLUMN_COUNT_MAX as it,COLUMN_SHARE_MIN as wo,COLUMN_SHARES_EQUAL as xo,resolveColumnShares as lt,WidthsBar as So,useShellStrings as yo,IconButton as st,InputNumber as at,Slider as Co,Tooltip as me}from"efficient-shell/ui";import{LOOKUP_BUSY_NOTE as _o}from"./geocode-resolve.js";import{ColourRow as ge,InheritedColourRow as be}from"./ColourControl.js";import{keptByRow as Ro}from"efficient-easel/screen/lib/document/style-fields";import ct from"./MarkupToolbar.js";import{deviceField as R}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as To,NoControlMark as Oo,noControlField as dt}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as Io}from"../../../format/lib/document/own-box.js";import{PHONE_CLEAR as Eo,resolvePhoneValue as we}from"../../../format/lib/document/phone-override.js";import{phoneKey as F,tabletKey as W}from"efficient-easel/draw";import{SuppressibleText as ko}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Fo,CARD_OUTLINE_OPTIONS as Ao,DEFAULT_CARD_INDEX_FORMAT as Lo,DEFAULT_CARD_OUTLINE as No}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as Po,DEFAULT_COVER_INDEX as vo}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as Bo}from"efficient-easel/draw";import Do from"../../components/MediaUploadField.js";import Ho from"../../components/MultiSelectField.js";import Go from"../../components/SectionThemePicker.js";import Mo from"../../components/SearchSelectField.js";import Uo from"../../components/StorefrontLinkField.js";import{UiIcon as ut}from"efficient-easel/draw/client";import{SECTION_PADDING as I}from"../../../render/lib/content/section-padding.js";import{buttonWordsSummary as Wo}from"../../../render/lib/content/button-look.js";import{usePreviewParts as Ko}from"efficient-easel/draw/client";import{encodePartId as $o}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as jo,useEaselStrings as Xo}from"efficient-easel/strings";import{hasPhoneHeight as Vo,hasTabletHeight as xe,resolveSectionMinHeight as zo,resolveTabletHeight as Yo}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as re,SECTION_STICK_LABEL as Se,hasPhoneStick as qo,hasTabletStick as Jo,resolveSectionStick as pt}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as Zo,SECTION_MIN_HEIGHT_GROUP_LABEL as Y,SECTION_SCREEN_PCT as Qo}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as er,resolveContainerDirection as ft}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as tr,BOX_BLOCK_SPACING_POINTS as ht,BOX_PHONE_ROW_LABEL as mt,BOX_COLUMNS_MAX as nr,BOX_COLUMNS_MIN as gt,BOX_PHONE_ROW_MAX as or,BOX_PHONE_ROW_MIN as ye,BOX_SHARE_CHOICES as bt,BOX_SHARE_LABEL as K,boxShareChoiceOf as wt,boxShareWidthsOf as Ce,BOX_SHARE_PHONE_DEFAULT as rr,BOX_SHARE_PHONE_POINTS as ir}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as v}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as lr,borderBySide as xt}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as sr,normalizeTheme as St,normalizeThemeColors as ar,sectionBandTone as cr,surfaceTwoTone as dr}from"../../../format/lib/theme.js";import{CONTAINER_GAP as yt,CONTAINER_GAP_BUILT_IN as ur,CONTAINER_GAP_PHONE as _e,GAP_FIELD_CONTAINER as Re,followsSitePhoneGap as pr,hasOwnContainerGap as fr,hasOwnPhoneGap as Te,resolveContainerGap as Ct,resolvePhoneContainerGap as _t}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as hr,CARD_IMAGE_BG_OFF as mr,CARD_IMAGE_BG_SWATCH_NAMES as gr,CARD_IMAGE_BG_SWATCHES as br,isCardImageBackgroundInheriting as wr,cardImageBackgroundChoice as xr,THEME_CARD_IMAGE_BG as Sr}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as yr,SECTION_BG_NO_FILL as Cr,sectionBackgroundChoice as _r,THEME_SECTION_BG as Oe,isSectionBackgroundEmpty as Rr,sectionBackgroundHex as Rt}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as Tr,nestedAccentValue as Tt,resolveSectionAccent as ie}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as Or,TYPE_SIZE_INHERIT as Ir,isTypeSizeInheriting as Er}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as kr,WIDTH_CHOICE_LABEL as Fr,WIDTH_INHERIT as Ar}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as Lr}from"./panel-heading-scope.js";import{useEaselSession as Nr}from"efficient-easel/screen/lib/session-context";import{backendOf as Pr}from"../website-session.js";import{BOX_GAP as vr,describedAs as E,group as T,iconOf as q,sharedStyleKinds as J}from"efficient-easel/screen/lib/document/box-fields";import{VIEW_KEY_ACCESS as Ie,onDesktopWords as B,phoneTwinFields as le}from"efficient-easel/screen/lib/document/box-fields";import{directionField as Br,gapField as Ee,iconPickerRow as Dr,pickerCellIcon as Hr,pickerNoneIcon as Gr,Segmented as ke,segmented as Mr,select as Z,slider as $}from"./box-fields.js";function ks({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function D(e,t){return l("{value} from {from}",{value:e,from:t})}function Ur(){const{blockGap:e}=v();return e===null?l("this container's own spacing"):D(`${e}px`,l("Styles"))}function Wr({inherited:e,onReset:t,label:n}){return i(y,{words:S()?.panel,label:l(n),changed:!e,detail:Ur(),onReset:t})}function Kr(e){return Ee({...vr,builtIn:ur[e],resolve:(t,n)=>Ct(e,t,n?.siteGap),action:(t,n)=>i(Wr,{inherited:!fr(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[Re]:e}})}function $r(e){return $e(R("mobile",{[Re]:e,type:"custom",render:t=>i(Vr,{container:e,...t})}),Ot)}function jr(e){return $e(R("tablet",{[Re]:e,type:"custom",render:t=>i(Xr,{container:e,...t})}),Ot)}const Ot={not:{field:"gap",in:Array.from({length:-yt.min},(e,t)=>yt.min+t)}};function Fs(e){return{gap:R("desktop",Kr(e)),[W("gap")]:jr(e),[F("gap")]:$r(e)}}function Xr({container:e,...t}){const[n]=A("gap"),{siteGap:o}=t.field??{},r=Math.max(_e.min,Ct(e,n,o));return Ee({..._e,builtIn:r,resolve:a=>Te(a)?a:r,action:(a,c)=>i(y,{words:S()?.panel,label:l("Gap"),changed:Te(a),detail:B(d=>l(d),`${r}px`),onReset:()=>c(void 0)})}).render(t)}function Vr({container:e,...t}){const[n]=A("gap"),{siteGap:o,siteGapPhone:r}=t.field??{},s=_t(e,void 0,n,o,r);return Ee({..._e,builtIn:s,resolve:c=>_t(e,c,n,o,r),action:(c,d)=>i(y,{words:S()?.panel,label:l("Gap"),changed:Te(c),detail:D(`${s}px`,pr(e,n,r)?l("Styles"):l("Desktop")),onReset:()=>d(void 0)})}).render(t)}function As(e){return Br({offered:er(e),fallback:ft(e,void 0),resolve:t=>ft(e,t)})}function Ls(e,t){return mn(t?hn(e,t):[],t)}function zr({inherited:e,onReset:t,label:n}){return i(y,{words:S()?.panel,label:l(n),changed:!e,detail:D(l("Full"),l("the page")),onReset:t})}function H({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:s,hideable:a=!0,markup:c=!0}){const{text:d,hidden:f}=Ge(e),h=V(null),p=V(null),u=_=>t(a?{text:_,hidden:f}:_),g=()=>t({text:d,hidden:!f}),m=a&&f,C=De(),x=r?Qr(r)?i("span",{className:"sf-hint-while-typing",children:l(r)}):l(r):void 0,b=f?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return i(w,{label:l(n),icon:i(Gn,{}),htmlFor:C,className:m?"is-hidden":void 0,hint:x,action:a?i(me,{content:b,children:i(st,{"aria-pressed":f,"aria-label":b,onClick:g,children:f?i(ut,{name:"eye-off",size:14}):i(ut,{name:"eye",size:14})})}):void 0,children:N("div",{className:"sf-copybox",children:[c&&i(ct,{target:s?p:h,value:d,onChange:u}),s?i("textarea",{id:C,ref:p,value:d,placeholder:o===void 0?void 0:l(o),onChange:_=>u(_.target.value)}):i("input",{id:C,ref:h,type:"text",value:d,placeholder:o===void 0?void 0:l(o),onChange:_=>u(_.target.value)})]})})}function Ns(e,t){return{...e,[Ke]:t}}function Ps(e){const t=e[O];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[O]:{...t,offPage:!0}}}function vs(e){return!e||typeof e!="object"?!1:e[O]?.offPage===!0}const It="sfPanelOnly";function Bs(e){if(!e[O])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[It]:!0}}function Ds(e){return!!e&&typeof e=="object"&&e[It]===!0}function Hs(e){const t=e[O];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[O]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as Ja,SCALAR_TEXT_CONTROLS as Za}from"efficient-easel/draw";function Gs(e,t){if(!e[O])throw new Error("inOwnBox: the field holds no authored text");const{[To]:o,...r}=e;return{...r,[Io]:!0,render:t}}const Yr=new Set(Bo),Q={type:"radio",options:[{value:!0},{value:!1}]},Et={text:{type:"object",objectFields:{text:{type:"text"},hidden:Q}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:Q}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},G=(e,t)=>{const n=E({...t,[O]:e},{...Et[e.control],label:e.label});if(!Yr.has(e.control))return n;const o=t.render;return{...dt(n,"authored-copy"),render:r=>i(ko,{name:r.name,children:o(r)})}},Ms="Everything else on this block comes from the linked post. Unlink it to edit by hand.",qr={field:"source.slug",set:!0},Us={not:qr},Jr="Select a word, then press the highlighter.",Zr=new Set([Jr]),Qr=e=>Zr.has(e);function Ws(e,t,n){return G({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function Ks(e,t,n){return G({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function $s(e,t,n){return G({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function js(e,t,n){return G({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function Xs(e){return{type:"custom",[Ue]:{label:e},...E({},{type:"text",label:e}),render:({value:t,onChange:n})=>i(Uo,{value:Me(t),onChange:n,label:e})}}function Vs(e,t,n){return G({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const zs={Design:wn,Animation:Sn};function Ys(e){return{type:"custom",render:()=>i(ei,{text:e})}}function ei({text:e}){return i("p",{className:"sf-note",children:l(e)})}function qs(e){return pe(e)!==null&&e?.tabs!==void 0}const kt=new Map;function Js(e,t){const n=`${e}\0${t?t.join(""):""}`,o=kt.get(n)??{type:"custom",tabs:t,[ue]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(k,{})};return kt.set(n,o),o}const Ft=new Map;function Zs(e){const t=Ft.get(e)??{type:"custom",[ue]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(k,{})};return Ft.set(e,t),t}function ti(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function Qs(e,t){return ti(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(k,{})}}function ea(e){const t=e;if(t.marker===!0&&t.fold===void 0)return e;const{fold:n,...o}=e;return{...o,marker:!0,render:()=>i(k,{})}}function ta({title:e,children:t}){const[n,o]=z(()=>!Fe.has(e));return i(Yn,{title:e,open:n,onToggle:r=>{o(r),r?Fe.delete(e):Fe.add(e)},children:t})}const Fe=new Set;function na({label:e}){return i(qn,{title:l(e),level:Lr(2)})}function ni({swatches:e,current:t,onPick:n,names:o}){const r=e.find(c=>c.toLowerCase()===t.toLowerCase()),s=r?o?.[r]:void 0,a=s?l(s):t;return N("div",{className:"sf-swatches",children:[e.map(c=>{const d=o?.[c]?l(o[c]):c;return i(me,{content:d,children:i(fo,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":d})},c)}),i("span",{className:"sf-swatch-hex",children:a})]})}function oa(e,t,n=!1){return{type:"custom",render:({value:o,onChange:r})=>i(oi,{label:e,builtIn:t,followsBand:n,value:o,onChange:r})}}function oi({label:e,builtIn:t,followsBand:n,value:o,onChange:r}){const s=typeof o=="string"?o:void 0,{colors:a,n:c}=jt(),d={background:a.background,surface:a.surface,surface2:dr(a),band:cr(a)},f=n?Oe:t,h=Rr(s,t,f),p=Rt(void 0,f,d),u=n?yr:void 0,g=_r(s,t),m=f===Oe?l("the theme's section background"):l("Theme {n} background",{n:c});return i(be,{label:l(e),icon:i(yn,{}),value:h?"":Rt(s,t,d),inherited:p,resetTo:D(p.toUpperCase(),m),onChange:r,onReset:()=>r(u),choices:[{label:l("No fill"),color:"",selected:g==="none",onPick:()=>r(Cr)},{label:`${l("Section band")} · ${d.band.toUpperCase()}`,color:d.band,selected:g==="band",onPick:()=>r(Oe)}]})}function ri(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,s=wr(r,t);return i(w,{label:l(e),icon:i(oe,{}),changed:!s,action:i(y,{words:S()?.panel,label:l(e),changed:!s,detail:l("the theme's image stage"),onReset:()=>o(hr)}),children:ni({swatches:br,current:s?Sr:xr(r,t),onPick:o,names:gr})})}}}function ra(e=n=>n,t){return J({_gSectionTheme:T(Tr),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(Go,{value:e(n),onChange:o,followLabel:t})}})}function ee({min:e,max:t,step:n,value:o,onChange:r,suffix:s="",readout:a=!0,notch:c,ariaLabel:d,disabled:f=!1,placeholder:h,placeholderWord:p,onClear:u}){const g=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:g?"sf-slider has-notch":"sf-slider",style:g?{"--sf-notch":(c-e)/(t-e)}:void 0,children:i(Co,{min:e,max:t,step:n,value:o,...o===null&&h!==void 0?{placeholderValue:h}:{},...p?{emptyLabel:l(p)}:{},suffix:s||void 0,showInput:a,label:d===void 0?void 0:l(d),disabled:f,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:m=>{m===null?u?.():m!==o&&r(m)}})})}function At(e,t){const{min:n,max:o,step:r=1,unsetLabel:s,hint:a,restTrack:c,unsetMark:d,icon:f,unit:h="px"}=t;return{type:"custom",render:({value:p,onChange:u})=>{const g=typeof p=="number"?p:null,m=g===null;return i(w,{label:l(e),icon:f?q(f):void 0,value:m?d||s===void 0?void 0:l(s):`${g}${h}`,changed:!m,action:d?ve(d,{changed:!m,onReset:()=>u(null)}):i(y,{words:S()?.panel,label:l(e),changed:!m,onReset:()=>u(null)}),hint:typeof a=="string"?l(a):a,children:c?c({min:n,max:o,step:r,px:g,label:e,onChange:u}):ee({min:n,max:o,step:r,value:g??n,readout:!1,ariaLabel:e,onChange:u})})}}}const se="Corners";function Ae(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,r=o!==null;return i(w,{label:l(se),icon:i(Rn,{}),changed:r,action:ve(e.mark,{changed:r,onReset:()=>n(null)}),hint:e.hint,children:i(li,{tier:e,px:o,onRadius:n})})}}}function A(e){const t=M();return[t?.values?.[e],n=>t?.onChange(e,n)]}function Lt(){return dt({type:"custom",render:()=>i(Oo,{})},"always")}function ii(){const e=M();return t=>e?.onChangeMany(t)}function li({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),[r,s]=A(e.sidesKey),a=ot(r)??[...nt];return i(ho,{label:l(se),value:a,corners:$n,onChange:c=>{const d=ot(c)??[];s(d.length===nt.length?null:d)},radius:t,onRadiusChange:n,radiusMin:U,radiusMax:je,radiusStep:e.step??1,radiusPlaceholder:String(o)})}function Nt(){return Lt()}function si({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=v(),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"):D(r,l("Styles")),onReset:n})}function ai(){const{cornerRadiusPx:e}=v();return typeof e=="number"?e:U}function ci(){return Ae({sidesKey:"sectionCornerSides",useFollowed:ai,mark:i(si,{label:se}),hint:di})}const di="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function ia(){return J({_gShape:T("Shape"),sectionCorners:ci(),sectionCornerSides:Nt(),...j("sectionBorder",Pt)})}const ui=()=>({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 pi(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function fi(){let e;try{const t=St(v().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||sr.line}function hi({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:s=!0,above:a={}}){const c=e&&typeof e=="object"?e:{},[d,f]=z(()=>r?to(c,a):!1),h=ui(),p=u=>pi(r&&s?u:{width:u.width,color:u.color,...s?{style:u.style}:{}});return i(w,{label:l("Border"),icon:i(Cn,{}),action:r?i(Qn,{each:d,label:l("Each side"),onChange:f}):void 0,children:i(Zn,{label:l("Border"),value:c,each:d,onChange:u=>t(p(u)),placeholder:n,presets:o,words:h,styles:s,max:lr})})}function mi({value:e,onChange:t,view:n}){const[o]=A("sectionBorder"),[r]=A(W("sectionBorder")),s=fi(),a=d=>d&&typeof d=="object"?d:{},c=n==="phone"?{...xt(a(o)),...xt(a(r))}:n==="tablet"?a(o):{};return i(hi,{value:e,onChange:t,placeholder:{sides:eo(c),style:c.style??"solid",color:c.color||s},presets:[s],above:c})}function la(e){return R(e,Pt(e==="mobile"?"phone":e))}function Pt(e){return{type:"custom",render:({value:t,onChange:n})=>i(mi,{value:t,onChange:n,view:e})}}function j(e,t){const n=(o,r)=>le(e,t(o),Ie)[r];return{[e]:n("desktop",e),[W(e)]:n("tablet",W(e)),[F(e)]:n("phone",F(e))}}function sa(e){return{type:"custom",render:()=>i(gi,{partKey:e})}}function gi({partKey:e}){const[t]=A("id"),[n]=A("_partStyles"),{textStyles:o}=v(),r=Xo();let s=null;try{s=Ko().select}catch{s=null}const a=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i(zn,{name:l("Text"),preview:Wo(a,c,{noStyle:l("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??jo.copy.panel).cases}),onOpen:()=>{s&&typeof t=="string"&&s($o(t,e))}})}function vt(e){const{cornerRadiusPx:t}=v(),n=typeof t=="number"?t:e;let o=null;try{const{appState:s,selectedItem:a}=te(d=>d),c=a?.props?.id?String(a.props.id):void 0;o=c?Vn(s?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return jn(r)?r:n}function bi({label:e,changed:t=!1,onReset:n=()=>{}}){const o=vt(U);return i(y,{words:S()?.panel,label:l(e),changed:t,detail:D(`${o}px`,l("the section")),onReset:n})}function wi(){return i(k,{children:l("Follows the section's Corners until you set a number here.")})}function xi(){return Ae({sidesKey:"cardCornerSides",useFollowed:()=>vt(U),mark:i(bi,{label:se}),hint:i(wi,{})})}function Si(){return{type:"custom",render:()=>i(on,{})}}function aa(e){return{...e,render:t=>i(rn,{render:e.render,props:t})}}function ca(){return{_gShape:T("Shape"),cardCorners:xi(),cardCornerSides:Nt(),cardCornersApplyAll:Si()}}function yi(){return E({type:"custom",render:e=>i(_i,{...e})},{type:"select",label:K,options:[{value:"content",label:"Fit content"},{value:"equal",label:"Equal"},{value:[50],label:"Custom: the width of each block in %, the last block left out"}]})}function Ci(e,t){const n=wt(e);if(n!=="custom")return l(bt.find(r=>r.value===n)?.label??"");const o=lt(Ce(e,t),t);return o?[...o,100-o.reduce((r,s)=>r+s,0)].join(" / "):l("Custom")}function _i(e){const{value:t,onChange:n}=e,[o]=A("content"),r=Array.isArray(o)?o.length:0,s="follows"in e,a=t!=null,c=a?t:s?e.follows:void 0,d=wt(c),f=r>=2&&r<=it,h=()=>[...xo[r]??[]],p=V(null),u=b=>{const _=p.current;_&&JSON.stringify(b)===JSON.stringify(_.shares)?n(_.value):b&&n(b)},g=b=>{b===d||b==="custom"&&!f||n(b==="custom"?h():b)},m=l("The width bar works for 2 to {count} blocks.",{count:it}),C=a&&(s||t!=="content"),x=yo().widths.hint(r,wo);return i(w,{label:l(K),icon:i(fe,{}),changed:C,hint:d!=="custom"?void 0:f?x:m,action:i(y,{words:S()?.panel,label:l(K),changed:C,disabled:e.readOnly===!0,detail:s?B(b=>l(b),Ci(e.follows,r),e.followsView):l("Fit content"),onReset:()=>n(void 0)}),children:N("div",{className:"sf-share-row",children:[i("div",{className:"sf-share-pick",children:i(rt,{label:l(K),value:d,options:bt.map(b=>({value:b.value,label:b.value==="custom"&&!f?m:l(b.label),icon:Hr(i("span",{className:"sf-gallery-pic sf-share-pic",children:Bt(b.weights).map((_,X)=>i("i",{style:{gridColumn:`span ${_}`}},X))}),l(b.label),b.value==="custom"&&!f?m:l(b.label))})),onChange:g,columns:3,cell:Dt,tooltips:!1,disabled:e.readOnly===!0})}),d==="custom"&&f?i("div",{onFocus:()=>{p.current={value:t,shares:lt(Ce(c,r),r)}},onBlur:()=>{p.current=null},children:i(So,{label:l(K),count:r,value:Ce(c,r),onChange:u,readOnly:e.readOnly===!0})}):null]})})}function Bt(e){if(!e)return[3,4];const t=e.reduce((n,o)=>n+o,0);return e.map(n=>Math.round(n/t*12))}function da(){return Z(tr,i(Fn,{}),ht,ht[0].value)}function ua(){return R("mobile",Dr(K,i(fe,{}),ir.map(e=>({label:e.label,value:e.value,picture:i("span",{className:"sf-gallery-pic sf-share-pic",children:Bt(e.weights).map((t,n)=>i("i",{style:{gridColumn:`span ${t}`}},n))})})),rr,{columns:2,cell:Dt}))}const Dt={width:"5.75rem",height:"3.25rem"};function pa(){return le("share",yi(),Ie)[W("share")]}function Ri(){return R("mobile",$(mt,i(Ve,{}),ye,or,1,ye,"",{clear:{phoneFollows:!1,hint:ye}}))}const Ht={read:e=>e.phoneRow,write:(e,t,n)=>({phoneRow:n}),fieldKey:()=>"phoneRow",ownField:!0};function fa(){const e=$(mt,i(Ve,{}),gt,nr,1,gt,"",{clear:{emptyLabel:"Auto"}}),t=le("columns",e,{...Ht,tablet:Ie.tablet}),n=le("columns",e,Ht,{phoneRow:Ri()});return{...t,phoneRow:n.phoneRow}}function ha(e,t,n,o,r,s){return{type:"custom",render:({value:a,onChange:c})=>i(w,{label:l(e),icon:i(et,{noun:s}),action:i(y,{words:S()?.panel,label:l(e),changed:!Er(a),detail:l("the Text style in Styles"),onReset:()=>c(Ir),defaultAction:{onPress:()=>c(Or),title:l("Keep this section's own built-in size"),icon:i(_n,{})}}),children:ee({min:t,max:n,step:o,value:typeof a=="number"?a:r,suffix:"px",ariaLabel:e,onChange:c})})}}function ma(){return{_gCellWidth:T("Cell width"),gridSpan:Z("Positions",i(fe,{}),[{label:"Auto",value:""},...Array.from({length:cn},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function L(){let e=null,t=null;try{e=Be(Ti),t=te(n=>n).selectedItem}catch{t=null}return e??t?.props??{}}const Ti=Xt(null);function Oi({min:e,max:t,step:n,px:o,label:r,onChange:s,desktopKey:a,fallback:c}){const d=L()[a],f=we(void 0,d,c);return i(k,{children:ee({min:e,max:t,step:n,value:we(o,d,c),readout:!1,ariaLabel:r,notch:f,onChange:s})})}function Ii({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:s=()=>{}}){const a=L()[t],c=we(void 0,a,n);return i(y,{words:S()?.panel,label:l(e),changed:r,detail:B(d=>l(d),`${c}${o}`),onReset:s})}function Ei(e){return At(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:i(Ii,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:t=>i(Oi,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const ki={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Fi={Top:Qe,Bottom:qe,Left:Je,Right:Ze},Ai=e=>{const t=Fi[e];return i(t,{})};function ga(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=x=>ki[x],s=x=>$(r("Top"),i(Qe,{}),I.min,I.max,I.step,x,"px"),a=(x,b,_,X=I)=>R("mobile",Ei({label:r(x),icon:Ai(x),desktopKey:b,min:X.min,max:X.max,step:X.step,fallback:_})),c=e.top??I.min,d=e.bottom??I.min,f="sectionPaddingLeft",h="sectionPaddingRight",p=e.sideBounds??I,u=e.side??p.min,g=e.sidePhone??u,m=e.phone===!0,C=x=>m?R("desktop",x):x;return J({...o?{_gSpacing:T("Padding")}:{},[t]:C(s(c)),...m?{[F(t)]:a("Top",t,c)}:{},...e.only==="top"?{}:{[n]:C($(r("Bottom"),i(qe,{}),I.min,I.max,I.step,d,"px")),...m?{[F(n)]:a("Bottom",n,d)}:{}},...e.sides?{[f]:C($(r("Left"),i(Je,{}),p.min,p.max,p.step,u,"px")),...m?{[F(f)]:a("Left",f,g,p)}:{},[h]:C($(r("Right"),i(Ze,{}),p.min,p.max,p.step,u,"px")),...m?{[F(h)]:a("Right",h,g,p)}:{}}:{}})}function ba(e,t){const n=Object.fromEntries(Object.entries(t).map(([s,a])=>[s,s in e&&pe(a)?e[s]:a])),o={};let r=!1;for(const[s,a]of Object.entries(e)){if(s in t){r||Object.assign(o,n),r=!0;continue}o[s]=a}return r||Object.assign(o,n),o}const ae="Width";function wa(e,t=kr,n=!0){const o=t.map(r=>({label:Fr[r],value:r}));return J({...n?{_gWidth:T(ae)}:{},widthMode:{type:"custom",render:({onChange:r,field:s})=>i(w,{label:l(ae),icon:i(Mn,{}),action:n?i(zr,{inherited:s?.inherited??!1,onReset:()=>r(Ar),label:ae}):void 0,children:ke({options:o,value:s?.currentValue||e,onChange:r,ariaLabel:ae})})}})}function xa(){const e=(o,r)=>({type:"custom",render:({value:s,onChange:a})=>i(Li,{value:s,onChange:a,view:o,badge:r})}),t=o=>({type:"custom",render:({value:r,onChange:s,field:a})=>i(Pi,{value:r,onChange:s,unit:a?.unit,view:o})}),n=o=>{const r=Mr("Unit",i(ze,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");if(o==="desktop")return r;const s=r.render;return{...r,render:a=>i(vi,{props:a,draw:s,view:o})}};return J({_gHeight:T(Y),...j("sectionHeightMode",o=>o==="desktop"?e(o):e(o,r=>i(Bi,{view:o,onClear:()=>r(void 0)}))),...j("sectionHeightValue",t),...j("sectionHeightUnit",n)})}function Li({value:e,onChange:t,view:n,badge:o}){const r=L(),s=c=>["auto","fixed","screen"].includes(c),a=ce(n,r)?.mode??"auto";return i(w,{label:Y,icon:q(i(Ln,{})),action:o?o(t):void 0,children:ke({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:s(e)?e:a,onChange:t,ariaLabel:Y})})}function Gt(e,t){return e==="phone"&&xe(t)?Yo(t):zo(t)}function ce(e,t){return e==="desktop"||(e==="tablet"?xe(t):Vo(t))?null:Gt(e,t)}const P=(e,t)=>e==="tablet"?W(t):F(t);function Ni(e,t,n,o){const r=ce(e,t);return!r||e==="desktop"?null:o===void 0?{}:{[P(e,"sectionHeightMode")]:r.mode,...r.mode==="fixed"?{[P(e,"sectionHeightUnit")]:r.unit}:{},...n==="sectionHeightUnit"?{[P(e,"sectionHeightValue")]:r.value}:{},[P(e,n)]:o}}function Mt(e,t,n){const o=M(),r=ce(e,L());return!o||!r?{followed:null,write:n}:{followed:r,write:a=>o.onChangeMany(c=>{const d=Ni(e,c,t,a);return d===null?{[e==="desktop"?t:P(e,t)]:a}:Object.keys(d).length?d:null})}}function Pi({value:e,onChange:t,unit:n,view:o}){const{followed:r,write:s}=Mt(o,"sectionHeightValue",t),a=(r?r.unit:n)==="%"?"%":"px",c=a==="%"?Qo:Zo;return i("div",{className:"sf-field",children:ee({min:c.min,max:c.max,step:c.step,value:r?null:typeof e=="number"?e:c.fallback,...r?{placeholder:r.value}:{},suffix:a,ariaLabel:Y,onChange:s})})}function vi({props:e,draw:t,view:n}){const{followed:o,write:r}=Mt(n,"sectionHeightUnit",e.onChange);return t({...e,...o?{value:void 0,storedValue:void 0,follows:o.unit}:{},onChange:r})}function Bi({view:e,onClear:t}){const n=L(),o=ce(e,n)===null,r=e==="phone"&&xe(n),s=Gt(e,n),a=B(c=>l(c),s.mode==="auto"?l("Auto"):`${s.value}${s.unit}`,r?"tablet":"desktop");return i(y,{words:S()?.panel,label:l(Y),changed:o,detail:a,onReset:t})}function Sa(){const e=n=>({type:"custom",render:({value:o,onChange:r,id:s,name:a})=>i(Gi,{value:o,onChange:r,labelId:`${s??a??"stickTop"}-label`,view:n})}),t=n=>({type:"custom",render:({value:o,onChange:r})=>i(Di,{value:o,onChange:r,view:n})});return{_gStick:T(Se),...j("stickTop",e),...j("stickTopDistance",t)}}function Di({value:e,onChange:t,view:n}){const o=M(),r=L(),s=n==="desktop"||Le(n,r)?null:Ut(n,pt(r)),a=s&&o?c=>o.onChangeMany(d=>{const f=Hi(n,d,c);return f===null?{[P(n,"stickTopDistance")]:c}:Object.keys(f).length?f:null}):t;return i("div",{className:"sf-field",children:ee({min:re.min,max:re.max,step:re.step,value:s?null:typeof e=="number"?e:re.fallback,...s?{placeholder:s.distance}:{},suffix:"px",ariaLabel:l("Distance from top"),onChange:a})})}function Le(e,t){return e==="tablet"?Jo(t):qo(t)}function Ut(e,t){return e==="phone"?{on:t.tablet,distance:t.tabletDistance}:{on:t.desktop,distance:t.desktopDistance}}function Hi(e,t,n){return e==="desktop"||Le(e,t)?null:n===void 0?{}:{[P(e,"stickTop")]:!0,[P(e,"stickTopDistance")]:n}}function Gi({value:e,onChange:t,labelId:n,view:o}){const r=L(),s=pt(r),a=o==="phone"?s.phone:o==="tablet"?s.tablet:e===!0,c=o==="phone"&&s.ownTablet,d=o==="desktop"?null:Ut(o,s),f=d?.on?`${d.distance}px`:l("Off");return i(w,{label:l(Se),labelId:n,icon:q(i(Bn,{})),action:N(k,{children:[o!=="desktop"?i(y,{words:S()?.panel,label:l(Se),changed:Le(o,r),detail:B(h=>l(h),f,c?"tablet":"desktop"),onReset:()=>t(void 0)}):null,i(he,{checked:a,onChange:t,ariaLabelledBy:n})]})})}const Wt="e.g. about";function ya(){return{_gAnchor:T("Anchor"),anchor:G({control:"plainText",label:"Name",placeholder:Wt},{type:"custom",render:({value:e,onChange:t})=>i(gn,{value:e,onChange:t,nameBox:(n,o)=>i(H,{value:n,onChange:o,label:"Name",placeholder:Wt,hideable:!1,markup:!1})})})}}function Ca(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:s,name:a})=>{const c=`${s??a??e}-datetime`,d=Date.parse(typeof o=="string"?o:"");return i(w,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(go,{id:c,value:Number.isFinite(d)?new Date(d):null,onChange:f=>r(f?f.toISOString():"")})})}}}function _a(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:s,name:a})=>{const c=`${s??a??e}-date`;return i(w,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(mo,{id:c,value:Yt(typeof o=="string"?o:null),onChange:d=>r(d?zt(d):"")})})}}}function Mi(e,t,n,o){return{type:"custom",...E({},{...Q,label:e}),render:r=>{const{value:s,onChange:a,id:c,name:d}=r,f="follows"in r,h=r,p=typeof s=="boolean",u=typeof h.follows=="boolean"?h.follows:t,g=p?s:f?u:t,m=`${c??d??e}-label`,C=h.readOnly===!0,x=i(he,{checked:g,onChange:a,disabled:C,ariaLabelledBy:m});return i(w,{label:l(e),labelId:m,icon:n,hint:o===void 0?void 0:l(o),action:f?N(k,{children:[i(y,{words:S()?.panel,label:l(e),changed:p,detail:h.followsNoView?l(u?"On":"Off"):B(b=>l(b),l(u?"On":"Off"),h.followsView),disabled:C,onReset:()=>a(void 0)}),x]}):x})}}}function Ra(){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(vn,{}),id:r,value:Un(e),onChange:t})}}}function Ta(e,t){return{type:"custom",...E({},{...Q,label:e}),render:({value:n,onChange:o,id:r})=>{const s=typeof n=="boolean"?n:t,a=`${r??e}-checkbox`;return i(w,{label:l(e),htmlFor:a,className:"sf-checkbox",action:i(po,{id:a,checked:s,onChange:o})})}}}function Oa(e,t,n){return{type:"custom",render:({value:o,onChange:r})=>i(ge,{label:l(e),icon:n,value:o||t,onChange:r})}}function Ia(){return{type:"custom",render:e=>{const{value:t,onChange:n}=e,o=e;return i(Ui,{value:typeof t=="string"?t:"",onChange:n,twin:"follows"in e?{follows:o.follows,view:o.followsView}:void 0})}}}function Ui({value:e,onChange:t,twin:n}){const{colors:o,n:r}=jt(),s=o.background,a=D(s.toUpperCase(),l("Theme {n} background",{n:r})),c=tt(e),d=c?Kt(c,o,r):null,f=n?()=>t(void 0):()=>t("");if(n){const h=tt(n.follows),p=Wn(n.follows),u=h?Kt(h,o,r):p?{hex:p,words:p.toUpperCase()}:null,g=B(m=>l(m),u?u.words:a,n.view);return d?i($t,{slot:d,resetTo:g,onChange:t,onReset:f}):i(be,{label:l("Fill"),icon:i(oe,{}),value:e,inherited:u?.hex??s,resetTo:g,onChange:t,onReset:f})}return d?i($t,{slot:d,resetTo:a,onChange:t,onReset:f}):i(be,{label:l("Fill"),icon:i(oe,{}),value:e,inherited:s,resetTo:a,onChange:t,onReset:f})}function Kt(e,t,n){const o={main:()=>[t.accent,l("Theme {n} main color",{n})],text:()=>[t.text,l("Theme {n} text color",{n})],background:()=>[t.background,l("Theme {n} background",{n})],muted:()=>[t.muted,l("Theme {n} muted color",{n})]},r=Object.hasOwn(o,e)?o[e]:void 0;if(!r)return null;const[s,a]=r();return{hex:Kn(s??"")??"",words:a}}function $t({slot:e,resetTo:t,onChange:n,onReset:o}){return i(ge,{label:l("Fill"),icon:i(oe,{}),value:e.hex,caption:e.words,onChange:n,changed:!0,onReset:o,resetTo:t})}function Wi(e,t,n){if((e?.content??[]).some(a=>a?.props?.id===t))return ie(n);const r=Xn(e,t);if(r.length===0)return null;const s=ie(Tt(n));if(s!==null)return s;for(let a=r.length-1;a>0;a-=1){const c=ie(Tt(r[a].sectionAccent));if(c!==null)return c}return ie(r[0].sectionAccent)}function jt(){const e=St(v().theme),[t]=A("sectionAccent");let n=null;try{const{appState:r,selectedItem:s}=te(c=>c),a=s?.props?.id?String(s.props.id):void 0;n=a?Wi(r?.data,a,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{colors:ar(e.themes[o]),n:o+1}}const Ki=[{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 $i({label:e,value:t,onChange:n,points:o=Ki}){const r=o.map(s=>({...s,label:l(s.label),...s.title?{title:l(s.title)}:null}));return i(uo,{label:l(e),value:t,points:r,onChange:n})}function Ea(){return Lt()}const ka={top:i(En,{}),right:i(In,{}),bottom:i(Tn,{}),left:i(On,{})};function Fa(e,t,n,o,r,s,a){const c=p=>t.find(u=>u.value===p),d=p=>({value:p,label:"",disabled:!0,title:o}),f=p=>{const u=t.find(m=>m.cell===p);if(!u)return d(`missing-${p}`);const g=s?.[p];return g?{value:u.value,label:u.label,icon:g}:{value:u.value,label:u.label}},h=[d("corner-top-left"),f("top"),d("corner-top-right"),f("left"),d("centre"),f("right"),d("corner-bottom-left"),f("bottom"),d("corner-bottom-right")];return{type:"custom",render:({value:p,onChange:u})=>{const g=t.some(m=>m.value===p)?p:n;return i(w,{label:l(e),icon:r,value:c(g)?.label?l(c(g).label):a?l(a):"",children:$i({label:e,value:g,onChange:u,points:h})})}}}function Aa(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:s})=>i(Ho,{label:e,options:(s.options??t).map(a=>({...a,label:l(a.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:l(n)}:{}})}}function La(e,t,n,o){return{type:"custom",options:t,fallback:n,...E({},{type:"select",label:e}),render:({value:r,onChange:s,field:a})=>i(Mo,{label:e,options:(a.options??t).map(c=>({...c,label:l(c.label)})),fallback:a.fallback??n,value:r,onChange:s,placeholder:o===void 0?void 0:l(o)})}}function Na(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}const Pa=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function va(e,t,n){const o=Object.keys(He).map(r=>({label:He[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(Xi,{label:e,icon:t,options:o,onChange:r})}}function ji(e,t,n){const o=qt(e,t,n);if(o!==void 0)return o==="save-makes-frame"?l("A frame is made from this video when you save the page."):o==="starts-dark"?l("This video starts dark, so no frame was made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="outside"?l("This video is on another website, so no frame can be made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="unsupported"?l("This video's file type gives no frame. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="failed"?l("No frame could be made from this video. It is tried again the next time you save the page. The slide shows its background colour while the video loads."):o==="image-no-frame"?l("The slide shows your Image while the video loads, because this video has no frame."):void 0;const r=Zt(e);return r==="frame-missing-image"?l("This video has no frame yet. The slide shows its image until one is made."):r==="frame-missing-surface"?l("This video has no frame yet. The slide shows its background colour until one is made."):r==="image-missing-frame"?l("No image yet. The slide shows the video's frame until you choose one."):r==="image-missing-surface"?l("No image yet. The slide shows its background colour until you choose one."):void 0}function Xi({label:e,icon:t,options:n,onChange:o}){const r=M(),s=r?.values??{},a=Jt(s),c=Be(tn),d=en(c?.docId??null);let f=null;try{f=te(p=>p.appState.data)}catch{f=null}const h=Qt(r?.id,f,d);return i(w,{label:l(e),icon:q(t),hint:ji(s,h,c?.hasUnsavedEdits??!1),children:ke({options:n,value:a,onChange:o,ariaLabel:e})})}function Ba(e,t,n,o={}){const r={type:"custom",[We]:!0,render:({value:s,onChange:a,name:c})=>i(Do,{value:s||"",onChange:a,fieldKey:c,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen,frameKey:o.frame}),...o.focus?{focusKey:o.focus}:{},...o.focusWhen?{focusWhen:o.focusWhen}:{}};return o.focus?R("each",r):r}const Da={HeroSingle:["imageFocal"],HeroSlide:["videoFrame"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function Vi(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 Ha({value:e,onChange:t,label:n}){const o=e||{},r=M(),s=r?r.values!==r.node.props:!0,a=!!o.pending&&s,c=!!o.pending&&!s,d=!!Pr(Nr()).geocode,f=De(),h=(p,u)=>t({...o,[p]:u??void 0});return N(k,{children:[i(w,{label:l(n),icon:i(Ye,{}),action:d?i(me,{content:l("Find from the address (OpenStreetMap)"),children:i(st,{"aria-label":l("Find from the address"),"aria-busy":a||void 0,disabled:a,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:i(Dn,{})})}):void 0,children:d&&o.status?i(bn,{compact:!0,oneLine:!0,spaced:!1,status:a?"busy":o.ok&&!c?"found":"notfound",statusText:a?l("Finding…"):c?l(_o):l(o.status),hint:Vi(o)}):null}),i(w,{label:l("Enter by hand"),labelId:f,icon:i(kn,{}),action:i(he,{checked:!!o.manual,onChange:p=>t({...o,manual:p}),ariaLabelledBy:f})}),o.manual&&i(w,{label:l("Latitude, longitude"),icon:i(Ye,{}),children:N("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[i(at,{value:typeof o.lat=="number"?o.lat:null,onChange:p=>h("lat",p),min:-90,max:90,step:1e-4,placeholder:l("Latitude")}),i(at,{value:typeof o.lng=="number"?o.lng:null,onChange:p=>h("lng",p),min:-180,max:180,step:1e-4,placeholder:l("Longitude")})]})})]})}function zi(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function Yi(e,t,n){const o=e.map(r=>({text:r?.text??""}));return t===null||t<0||t>=e.length?o:o.map((r,s)=>s===t?{text:n}:r)}function Ga(e,t){return e===null?null:t>e?e:null}function qi(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 Ma={label:"Ticker items",icon:i(Pn,{})};function Ua(e,t,n,o){return{type:"custom",[O]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...E({},{...Et.textList,label:e}),render:({value:r,onChange:s})=>i(Ji,{label:e,icon:q(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:s,markup:o==="markup"})}}function Ji({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:s=!1}){const a=V(null),[c,d]=z(null),f=p=>p.map(u=>({text:u?.text??""})),h=p=>{const u=qi(n,p,c);u===null&&(a.current=null),d(u),r(f(p))};return i(no,{label:l(e),icon:t,noun:l("item"),items:n,onChange:h,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:s?i(ct,{target:a,value:zi(n,c),onChange:p=>r(Yi(n,c??-1,p)),disabled:c===null,label:c===null?l("Formatting — click a row first"):l("Formatting — row {n}",{n:c+1})}):void 0,renderRow:(p,u,g)=>i("input",{type:"text",className:s&&c===u?"sf-list-marking":void 0,value:p?.text??"",placeholder:l(o),"aria-label":l("{label} {n}",{label:l(e),n:u+1}),onChange:m=>g({text:m.target.value}),onFocus:m=>{a.current=m.currentTarget,d(u)}})})}function Wa(e,t){const n=`${e.label} — row ${t+1}`;return G({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:l("{label} — row {n}",{label:l(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function Ka(e){return{_gCards:T("Cards"),coverIndex:Z("Cover image",i(Nn,{}),Po,String(vo),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:ri("Image background",mr),cardImage:el()}}function $a(){return{outline:Z("Card outline",i(Hn,{}),Ao,No),indexBadge:Z("Card number",i(ze,{}),Fo,Lo),showBadge:Mi("Product badge",!0,i(et,{noun:"tag"}))}}function ja(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...Q,label:de.find(s=>s.id===r).label}),o=r=>E(Ro(Ne),n(r));return{_gShowOnCard:T("Show on a card"),[Ne]:E({type:"custom",render:()=>i(Zi,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(Ne)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const Ne="showCardPrice",de=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function Zi({rest:e}){const t=L(),n=ii(),o=a=>typeof t[a]=="boolean"?t[a]:void 0,r=a=>o(a)??e[a],s=de.some(({id:a})=>o(a)!==void 0&&o(a)!==e[a]);return i(Pe,{parts:de,changed:s,shown:r,onPress:(a,c)=>n({[a]:c}),onReset:()=>n(Object.fromEntries(de.map(({id:a})=>[a,void 0])))})}function Xa(e,t="display"){const n=F(t);return{[t]:R("desktop",{type:"custom",render:({value:o,onChange:r})=>i(Pe,{parts:e,changed:ro(o),shown:s=>io(o,s),onPress:(s,a)=>r(ao(o,s,a)),onReset:()=>r(void 0)})}),[n]:R("mobile",{type:"custom",render:({value:o,onChange:r})=>i(Qi,{parts:e,desktopKey:t,value:o,onChange:r})})}}function Pe({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:s,disabledReason:a}){const c=l("Display");return i(w,{label:c,icon:i(xn,{}),changed:t,action:i(y,{words:S()?.panel,label:c,changed:t,detail:s,onReset:r}),children:i(oo,{label:c,items:e.map(d=>({id:d.id,label:l(d.label),shown:n(d.id),...a?{disabled:!0,disabledReason:l(a)}:{}})),onChange:o})})}function Qi({parts:e,desktopKey:t,value:n,onChange:o}){const r=L()[t];return i(Pe,{parts:e,changed:so(n),shown:s=>lo(r,n,s),onPress:(s,a)=>o(co(n,s,a)),onReset:()=>o(Eo),detail:l("the same as Desktop")})}function el(){return At("Card image",{min:U,max:je,step:ln,hint:"Rounds the picture. The card's own corner is in Styles."})}function Va(){return Ae({sidesKey:"cornerSides",step:sn,useFollowed:()=>U,mark:i(tl,{label:an}),hint:l("Rounds the picture. Left alone it stays square.")})}function tl({label:e,changed:t=!1,onReset:n=()=>{}}){return i(y,{words:S()?.panel,label:l(e),changed:t,onReset:n})}function za(){return{type:"custom",render:({value:e,onChange:t})=>i(il,{value:typeof e=="string"?e:"",onChange:t})}}function nl({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:pn(e).map(([n,o],r)=>i("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${n}`,gridRow:`span ${o}`}},r))})}const ol={width:"3.5rem",height:"2.5rem"},rl=200;function il({value:e,onChange:t}){const[n,o]=z(null),[r,s]=z(4),a=V(null);Vt(()=>{const u=a.current;if(!u||typeof ResizeObserver!="function")return;const g=()=>s(u.getBoundingClientRect().width>=rl?4:3);g();const m=new ResizeObserver(g);return m.observe(u),()=>m.disconnect()},[]);const c=e&&e in ne?e:"",d=Xe(n,c),f=Xe(n,"").length,h=fn("no-symbol"),p=[{value:"",label:l("Not chosen"),icon:Gr(h,l("Not chosen"))},...d.map(u=>({value:u,label:l(ne[u].label),icon:i(nl,{layout:ne[u],width:40})}))];return i(w,{label:l("Layout"),icon:i(An,{}),value:c?l(ne[c].label):void 0,children:i("div",{ref:a,style:{flex:"1 1 auto",minWidth:0},children:i(rt,{label:l("Layout"),value:c,options:p,onChange:t,columns:r,cell:ol,header:N("div",{className:"mb-2 flex flex-col gap-1",style:{minWidth:"11rem"},children:[i("span",{className:"text-2xs text-ink-faint",children:l("Photos in a row")}),i(Jn,{options:[{id:"all",label:l("All")},...dn.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:un.length})})]})})})})}export{qr as BOUND_TO_POST,Ms as BOUND_TO_POST_NOTE,zs as BUCKET_ICONS,Da as CUSTOM_FIELD_MEDIA,Ha as CoordsField,Ot as DESKTOP_GAP_NOT_OVERLAP,Pe as DisplayRow,ka as EDGE_ARROWS,bo as FOCAL_DEFAULT,Ki as FOCAL_POINTS,ue as FOLD_FIELD_MARKER,$i as FocalPicker,na as GroupLabel,Jr as HIGHLIGHT_HINT,H as HidableTextField,Ue as LINK_FIELD_MARKER,ks as Label,We as MEDIA_FIELD_MARKER,Pa as MEDIA_TYPE_OPTIONS,Us as NOT_BOUND_TO_POST,ta as PanelBand,ei as PanelNoteLine,Ti as RowPropsContext,Ke as SCAFFOLD_FIELD_MARKER,Za as SCALAR_TEXT_CONTROLS,Wr as SiteGapDefaultReset,ee as Slider,ni as Swatches,Ja as TEXT_CONTROL_KINDS,O as TEXT_FIELD_MARKER,Ma as TICKER_ITEMS_ROW,Ji as TextListField,ae as WIDTH_LABEL,zr as WidthDefaultReset,qi as aimAfterListChange,ya as anchorFields,D as backTo,oa as backgroundField,da as boxBlockSpacingField,fa as boxColumnsFields,Ia as boxFillField,Ri as boxPhoneRowField,yi as boxShareField,ua as boxSharePhoneField,pa as boxShareTabletField,Wi as boxThemeIndexOf,Js as bucketHeader,sa as buttonWordsEntryField,xi as cardCornersField,ri as cardImageBackgroundField,el as cardImageField,Ka as cardMediaFields,ca as cardShapeFields,ja as cardShowFields,$a as cardStyleFields,ma as cellWidthFields,Ta as checkbox,Oa as colorInput,As as containerDirectionField,Kr as containerGapField,$r as containerGapPhoneField,Fs as containerGapRows,jr as containerGapTabletField,Vi as coordsResultTip,js as copyText,Nt as cornerSidesField,Ae as cornersRowField,_a as date,Ca as dateTime,Zs as designGroupHeader,Xa as displayFields,Fa as edgePad,Ga as focusAfterRemove,Ea as focusKeptField,Qs as foldMarker,pe as foldMetaOf,ti as foldTitleOf,Ni as followedHeightPatch,Hi as followedStickPatch,za as galleryLayoutField,xa as heightFields,ce as heightFollowedBy,Ls as heroGroupPlacementPoints,Me as hidableText,Qr as hintIsWhileTyping,Va as imageCornersField,Gs as inOwnBox,qs as isBucketHeader,Lt as keptBy,Xs as linkField,ji as loadingRowHint,va as loadingShowsField,Aa as multiSelect,Ra as pageBackgroundField,Ys as panelNote,Ei as phoneOverrideField,$s as plainText,Vs as plainTextarea,At as pxField,ea as quietMarker,Ge as readHidable,zi as rowText,La as searchSelect,la as sectionBorderField,ci as sectionCornersField,ia as sectionShapeFields,ra as sectionThemeFields,Yi as setRowText,ha as sizeField,Kt as slotFill,Na as sourceField,ga as spacingFields,Sa as stickFields,ba as swapPadding,aa as templateField,Ws as text,nn as textFieldIdentifier,vs as textFieldOffPage,Ds as textFieldPanelOnly,Ua as textList,Wa as textListRowField,Ks as textarea,Mi as toggle,Ba as upload,ii as useSelectedPatch,L as useSelectedProps,A as useSelectedSibling,Ur as useSiteGapDetail,wa as widthField,Hs as withIdentifier,Ps as withOffPage,Bs as withPanelOnly,Ns as withScaffold};
|
|
1
|
+
"use client";import{jsx as i,jsxs as N,Fragment as k}from"react/jsx-runtime";import{cloneElement as Ge,createContext as zt,useContext as Me,useEffect as Yt,useId as Ue,useRef as V,useState as z}from"react";import{useEasel as te,useSelectedHost as M}from"efficient-easel/easel";import{toDateKey as qt,fromDateKey as Jt}from"efficient-shell/format";import{say as l,editorEaselWords as y}from"../../../format/lib/editor-words.js";import{LOADING_SHOWS_LABELS as We,firstFrameHint as Zt,loadingShowsOf as Qt,loadingStillHint as en}from"../../../format/lib/hero-video.js";import{pageFramesFor as tn,usePageVideoFrames as nn}from"../page-video-frames.js";import{ScreenDocumentContext as on}from"efficient-easel/screen/components/ScreenDocumentContext";import{readHidable as Ke,hidableText as $e}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as pe,LINK_FIELD_MARKER as Xe,MEDIA_FIELD_MARKER as je,SCAFFOLD_FIELD_MARKER as Ve,TEXT_FIELD_MARKER as O,foldMetaOf as fe,textFieldIdentifier as rn}from"efficient-easel/draw";import ln from"../../components/ApplyCornersToSiblings.js";import{withShowWhen as ze}from"../../../render/lib/document/show-when.js";import sn from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as an,CORNER_RADIUS_MAX as Ye,CORNER_RADIUS_MIN as U}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as cn,IMAGE_CORNERS_LABEL as dn}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as un}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as pn,GALLERY_LAYOUTS as ne,GALLERY_LAYOUT_KEYS as fn,galleryChoices as qe,galleryLayoutRatio as hn,galleryPictureCells as mn}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as gn}from"./shell-glyph.js";import{anchorSiblingsOf as bn,placementPoints as wn}from"../../../format/lib/hero-group-placement.js";import xn from"../../components/AnchorField.js";import Sn from"../../components/SourceStatus.js";import{AdjustIcon as yn,EyeIcon as Cn,AnimationIcon as _n,BackgroundIcon as Je,BorderAllIcon as Rn,BlockSectionIcon as Tn,ColumnWidthsIcon as he,ColumnsIcon as Ze,CornerIcon as On,DirectionDownIcon as In,DirectionLeftIcon as En,DirectionRightIcon as kn,DirectionUpIcon as Fn,EditIcon as An,GapIcon as Ln,GridIcon as Nn,GroundIcon as me,HashIcon as Qe,HeightIcon as Pn,ImageIcon as vn,ListIcon as Bn,LocationIcon as et,PaddingBottomIcon as tt,PaddingLeftIcon as nt,PaddingRightIcon as ot,PaddingTopIcon as rt,PageIcon as Dn,StickyIcon as Hn,SearchIcon as Gn,SquareIcon as Mn,TypeIcon as Un,WidthIcon as Wn}from"efficient-easel/icons";import{FieldGlyph as it}from"../../components/FieldGlyph.js";import{resolvePageBackground as Kn}from"../../../format/lib/content/page-background.js";import{boxFillOf as $n,boxFillSlot as ge}from"../../../format/lib/content/box-background.js";import{CORNER_SIDES as lt,CORNER_SIDE_POINTS as Xn,hasOwnSectionCorners as jn,normalizeCornerSides as st}from"../../../format/lib/content/section-corners.js";import{enclosingPath as Vn,enclosingSection as zn}from"./enclosing-section.js";import{SettingsDefaultReset as C,SettingsDrill as Yn,SettingsField as S,SettingsGroup as qn,SettingsGroupSub as Jn,SettingsSegmented as Zn,SettingsBorder as Qn,SettingsSidesEach as eo,SettingsSwitch as be,borderSides as to,borderStartEach as no}from"efficient-easel/panel";import{ListField as oo}from"efficient-easel/fields";import{DisplayChips as ro}from"efficient-shell/ui";import{desktopDisplayChanged as io,partShownOnDesktop as lo,partShownOnPhone as so,phoneDisplayChanged as ao,withDesktopPart as co,withPhonePart as uo}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as po,Checkbox as fo,ColorSwatch as ho,CornersInput as mo,DatePicker as go,DateTimePicker as bo,FOCAL_DEFAULT as wo,IconPicker as at,COLUMN_COUNT_MAX as ct,COLUMN_SHARE_MIN as xo,COLUMN_SHARES_EQUAL as So,resolveColumnShares as dt,WidthsBar as yo,useShellStrings as Co,IconButton as ut,InputNumber as pt,Slider as _o,Tooltip as we}from"efficient-shell/ui";import{LOOKUP_BUSY_NOTE as Ro}from"./geocode-resolve.js";import{ColourRow as oe,InheritedColourRow as ft}from"./ColourControl.js";import{fillThemeColors as To,slotFill as re}from"../../../format/lib/document/theme-slots.js";import{fillSlotNamed as xe}from"../../../format/lib/document/part-inks.js";import{keptByRow as Oo}from"efficient-easel/screen/lib/document/style-fields";import ht from"./MarkupToolbar.js";import{deviceField as R}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as Io,NoControlMark as Eo,noControlField as mt}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as ko}from"../../../format/lib/document/own-box.js";import{PHONE_CLEAR as Fo,resolvePhoneValue as Se}from"../../../format/lib/document/phone-override.js";import{phoneKey as F,tabletKey as W}from"efficient-easel/draw";import{SuppressibleText as Ao}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Lo,CARD_OUTLINE_OPTIONS as No,DEFAULT_CARD_INDEX_FORMAT as Po,DEFAULT_CARD_OUTLINE as vo}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as Bo,DEFAULT_COVER_INDEX as Do}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as Ho}from"efficient-easel/draw";import Go from"../../components/MediaUploadField.js";import Mo from"../../components/MultiSelectField.js";import Uo from"../../components/SectionThemePicker.js";import Wo from"../../components/SearchSelectField.js";import Ko from"../../components/StorefrontLinkField.js";import{UiIcon as gt}from"efficient-easel/draw/client";import{SECTION_PADDING as I}from"../../../render/lib/content/section-padding.js";import{buttonWordsSummary as $o}from"../../../render/lib/content/button-look.js";import{usePreviewParts as Xo}from"efficient-easel/draw/client";import{encodePartId as jo}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as Vo,useEaselStrings as zo}from"efficient-easel/strings";import{hasPhoneHeight as Yo,hasTabletHeight as ye,resolveSectionMinHeight as qo,resolveTabletHeight as Jo}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as ie,SECTION_STICK_LABEL as Ce,hasPhoneStick as Zo,hasTabletStick as Qo,resolveSectionStick as bt}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as er,SECTION_MIN_HEIGHT_GROUP_LABEL as Y,SECTION_SCREEN_PCT as tr}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as nr,resolveContainerDirection as wt}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as or,BOX_BLOCK_SPACING_POINTS as xt,BOX_PHONE_ROW_LABEL as St,BOX_COLUMNS_MAX as rr,BOX_COLUMNS_MIN as yt,BOX_PHONE_ROW_MAX as ir,BOX_PHONE_ROW_MIN as _e,BOX_SHARE_CHOICES as Ct,BOX_SHARE_LABEL as K,boxShareChoiceOf as _t,boxShareWidthsOf as Re,BOX_SHARE_PHONE_DEFAULT as lr,BOX_SHARE_PHONE_POINTS as sr}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as v}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as ar,borderBySide as Rt}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as cr,normalizeTheme as Tt,normalizeThemeColors as dr,sectionBandTone as ur,surfaceTwoTone as pr}from"../../../format/lib/theme.js";import{CONTAINER_GAP as Ot,CONTAINER_GAP_BUILT_IN as fr,CONTAINER_GAP_PHONE as Te,GAP_FIELD_CONTAINER as Oe,followsSitePhoneGap as hr,hasOwnContainerGap as mr,hasOwnPhoneGap as Ie,resolveContainerGap as It,resolvePhoneContainerGap as Et}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as gr,CARD_IMAGE_BG_OFF as br,CARD_IMAGE_BG_SWATCH_NAMES as wr,CARD_IMAGE_BG_SWATCHES as xr,isCardImageBackgroundInheriting as Sr,cardImageBackgroundChoice as yr,THEME_CARD_IMAGE_BG as Cr}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as _r,SECTION_BG_NO_FILL as Rr,sectionBackgroundChoice as Tr,THEME_SECTION_BG as Ee,isSectionBackgroundEmpty as Or,sectionBackgroundHex as kt}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as Ir,nestedAccentValue as Ft,resolveSectionAccent as le}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as Er,TYPE_SIZE_INHERIT as kr,isTypeSizeInheriting as Fr}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as Ar,WIDTH_CHOICE_LABEL as Lr,WIDTH_INHERIT as Nr}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as Pr}from"./panel-heading-scope.js";import{useEaselSession as vr}from"efficient-easel/screen/lib/session-context";import{backendOf as Br}from"../website-session.js";import{BOX_GAP as Dr,describedAs as E,group as T,iconOf as q,sharedStyleKinds as J}from"efficient-easel/screen/lib/document/box-fields";import{VIEW_KEY_ACCESS as ke,onDesktopWords as B,phoneTwinFields as se}from"efficient-easel/screen/lib/document/box-fields";import{directionField as Hr,gapField as Fe,iconPickerRow as Gr,pickerCellIcon as Mr,pickerNoneIcon as Ur,Segmented as Ae,segmented as Wr,select as Z,slider as $}from"./box-fields.js";function Ps({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function D(e,t){return l("{value} from {from}",{value:e,from:t})}function Kr(){const{blockGap:e}=v();return e===null?l("this container's own spacing"):D(`${e}px`,l("Styles"))}function $r({inherited:e,onReset:t,label:n}){return i(C,{words:y()?.panel,label:l(n),changed:!e,detail:Kr(),onReset:t})}function Xr(e){return Fe({...Dr,builtIn:fr[e],resolve:(t,n)=>It(e,t,n?.siteGap),action:(t,n)=>i($r,{inherited:!mr(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[Oe]:e}})}function jr(e){return ze(R("mobile",{[Oe]:e,type:"custom",render:t=>i(Yr,{container:e,...t})}),At)}function Vr(e){return ze(R("tablet",{[Oe]:e,type:"custom",render:t=>i(zr,{container:e,...t})}),At)}const At={not:{field:"gap",in:Array.from({length:-Ot.min},(e,t)=>Ot.min+t)}};function vs(e){return{gap:R("desktop",Xr(e)),[W("gap")]:Vr(e),[F("gap")]:jr(e)}}function zr({container:e,...t}){const[n]=A("gap"),{siteGap:o}=t.field??{},r=Math.max(Te.min,It(e,n,o));return Fe({...Te,builtIn:r,resolve:a=>Ie(a)?a:r,action:(a,c)=>i(C,{words:y()?.panel,label:l("Gap"),changed:Ie(a),detail:B(d=>l(d),`${r}px`),onReset:()=>c(void 0)})}).render(t)}function Yr({container:e,...t}){const[n]=A("gap"),{siteGap:o,siteGapPhone:r}=t.field??{},s=Et(e,void 0,n,o,r);return Fe({...Te,builtIn:s,resolve:c=>Et(e,c,n,o,r),action:(c,d)=>i(C,{words:y()?.panel,label:l("Gap"),changed:Ie(c),detail:D(`${s}px`,hr(e,n,r)?l("Styles"):l("Desktop")),onReset:()=>d(void 0)})}).render(t)}function Bs(e){return Hr({offered:nr(e),fallback:wt(e,void 0),resolve:t=>wt(e,t)})}function Ds(e,t){return wn(t?bn(e,t):[],t)}function qr({inherited:e,onReset:t,label:n}){return i(C,{words:y()?.panel,label:l(n),changed:!e,detail:D(l("Full"),l("the page")),onReset:t})}function H({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:s,hideable:a=!0,markup:c=!0}){const{text:d,hidden:f}=Ke(e),m=V(null),p=V(null),u=_=>t(a?{text:_,hidden:f}:_),g=()=>t({text:d,hidden:!f}),h=a&&f,w=Ue(),x=r?ti(r)?i("span",{className:"sf-hint-while-typing",children:l(r)}):l(r):void 0,b=f?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return i(S,{label:l(n),icon:i(Un,{}),htmlFor:w,className:h?"is-hidden":void 0,hint:x,action:a?i(we,{content:b,children:i(ut,{"aria-pressed":f,"aria-label":b,onClick:g,children:f?i(gt,{name:"eye-off",size:14}):i(gt,{name:"eye",size:14})})}):void 0,children:N("div",{className:"sf-copybox",children:[c&&i(ht,{target:s?p:m,value:d,onChange:u}),s?i("textarea",{id:w,ref:p,value:d,placeholder:o===void 0?void 0:l(o),onChange:_=>u(_.target.value)}):i("input",{id:w,ref:m,type:"text",value:d,placeholder:o===void 0?void 0:l(o),onChange:_=>u(_.target.value)})]})})}function Hs(e,t){return{...e,[Ve]:t}}function Gs(e){const t=e[O];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[O]:{...t,offPage:!0}}}function Ms(e){return!e||typeof e!="object"?!1:e[O]?.offPage===!0}const Lt="sfPanelOnly";function Us(e){if(!e[O])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Lt]:!0}}function Ws(e){return!!e&&typeof e=="object"&&e[Lt]===!0}function Ks(e){const t=e[O];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[O]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as nc,SCALAR_TEXT_CONTROLS as oc}from"efficient-easel/draw";function $s(e,t){if(!e[O])throw new Error("inOwnBox: the field holds no authored text");const{[Io]:o,...r}=e;return{...r,[ko]:!0,render:t}}const Jr=new Set(Ho),Q={type:"radio",options:[{value:!0},{value:!1}]},Nt={text:{type:"object",objectFields:{text:{type:"text"},hidden:Q}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:Q}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},G=(e,t)=>{const n=E({...t,[O]:e},{...Nt[e.control],label:e.label});if(!Jr.has(e.control))return n;const o=t.render;return{...mt(n,"authored-copy"),render:r=>i(Ao,{name:r.name,children:o(r)})}},Xs="Everything else on this block comes from the linked post. Unlink it to edit by hand.",Zr={field:"source.slug",set:!0},js={not:Zr},Qr="Select a word, then press the highlighter.",ei=new Set([Qr]),ti=e=>ei.has(e);function Vs(e,t,n){return G({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function zs(e,t,n){return G({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function Ys(e,t,n){return G({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function qs(e,t,n){return G({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function Js(e){return{type:"custom",[Xe]:{label:e},...E({},{type:"text",label:e}),render:({value:t,onChange:n})=>i(Ko,{value:$e(t),onChange:n,label:e})}}function Zs(e,t,n){return G({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const Qs={Design:yn,Animation:_n};function ea(e){return{type:"custom",render:()=>i(ni,{text:e})}}function ni({text:e}){return i("p",{className:"sf-note",children:l(e)})}function ta(e){return fe(e)!==null&&e?.tabs!==void 0}const Pt=new Map;function na(e,t){const n=`${e}\0${t?t.join(""):""}`,o=Pt.get(n)??{type:"custom",tabs:t,[pe]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(k,{})};return Pt.set(n,o),o}const vt=new Map;function oa(e){const t=vt.get(e)??{type:"custom",[pe]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(k,{})};return vt.set(e,t),t}function oi(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function ra(e,t){return oi(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(k,{})}}function ia(e){const t=e;if(t.marker===!0&&t.fold===void 0)return e;const{fold:n,...o}=e;return{...o,marker:!0,render:()=>i(k,{})}}function la({title:e,children:t}){const[n,o]=z(()=>!Le.has(e));return i(qn,{title:e,open:n,onToggle:r=>{o(r),r?Le.delete(e):Le.add(e)},children:t})}const Le=new Set;function sa({label:e}){return i(Jn,{title:l(e),level:Pr(2)})}function ri({swatches:e,current:t,onPick:n,names:o}){const r=e.find(c=>c.toLowerCase()===t.toLowerCase()),s=r?o?.[r]:void 0,a=s?l(s):t;return N("div",{className:"sf-swatches",children:[e.map(c=>{const d=o?.[c]?l(o[c]):c;return i(we,{content:d,children:i(ho,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":d})},c)}),i("span",{className:"sf-swatch-hex",children:a})]})}function aa(e,t,n=!1){return{type:"custom",render:({value:o,onChange:r})=>i(ii,{label:e,builtIn:t,followsBand:n,value:o,onChange:r})}}function ii({label:e,builtIn:t,followsBand:n,value:o,onChange:r}){const s=typeof o=="string"?o:void 0,{colors:a,n:c}=Be(),d={background:a.background,surface:a.surface,surface2:pr(a),band:ur(a)},f=n?Ee:t,m=Or(s,t,f),p=kt(void 0,f,d),u=n?_r:void 0,g=f===Ee?l("the theme's section background"):l("Theme {n} background",{n:c}),h=li(s,t,a,c,d,r),w=D(p.toUpperCase(),g),x=xe(s),b=x?re(x,a,c):null;return b?i(oe,{label:l(e),icon:i(Je,{}),value:b.hex,caption:b.words,onChange:r,changed:!0,onReset:()=>r(u),resetTo:w,choices:h}):i(ft,{label:l(e),icon:i(Je,{}),value:m?"":kt(s,t,d),inherited:p,resetTo:w,onChange:r,onReset:()=>r(u),choices:h})}function li(e,t,n,o,r,s){const a=Tr(e,t);return[{label:l("No fill"),color:"",selected:a==="none",onPick:()=>s(Rr)},{label:`${l("Section band")} · ${r.band.toUpperCase()}`,color:r.band,selected:a==="band",onPick:()=>s(Ee)},...ve(xe(e)??"",n,o,s)]}function si(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,s=Sr(r,t);return i(S,{label:l(e),icon:i(me,{}),changed:!s,action:i(C,{words:y()?.panel,label:l(e),changed:!s,detail:l("the theme's image stage"),onReset:()=>o(gr)}),children:ri({swatches:xr,current:s?Cr:yr(r,t),onPick:o,names:wr})})}}}function ca(e=n=>n,t){return J({_gSectionTheme:T(Ir),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(Uo,{value:e(n),onChange:o,followLabel:t})}})}function ee({min:e,max:t,step:n,value:o,onChange:r,suffix:s="",readout:a=!0,notch:c,ariaLabel:d,disabled:f=!1,placeholder:m,placeholderWord:p,onClear:u}){const g=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:g?"sf-slider has-notch":"sf-slider",style:g?{"--sf-notch":(c-e)/(t-e)}:void 0,children:i(_o,{min:e,max:t,step:n,value:o,...o===null&&m!==void 0?{placeholderValue:m}:{},...p?{emptyLabel:l(p)}:{},suffix:s||void 0,showInput:a,label:d===void 0?void 0:l(d),disabled:f,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:h=>{h===null?u?.():h!==o&&r(h)}})})}function Bt(e,t){const{min:n,max:o,step:r=1,unsetLabel:s,hint:a,restTrack:c,unsetMark:d,icon:f,unit:m="px"}=t;return{type:"custom",render:({value:p,onChange:u})=>{const g=typeof p=="number"?p:null,h=g===null;return i(S,{label:l(e),icon:f?q(f):void 0,value:h?d||s===void 0?void 0:l(s):`${g}${m}`,changed:!h,action:d?Ge(d,{changed:!h,onReset:()=>u(null)}):i(C,{words:y()?.panel,label:l(e),changed:!h,onReset:()=>u(null)}),hint:typeof a=="string"?l(a):a,children:c?c({min:n,max:o,step:r,px:g,label:e,onChange:u}):ee({min:n,max:o,step:r,value:g??n,readout:!1,ariaLabel:e,onChange:u})})}}}const ae="Corners";function Ne(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,r=o!==null;return i(S,{label:l(ae),icon:i(On,{}),changed:r,action:Ge(e.mark,{changed:r,onReset:()=>n(null)}),hint:e.hint,children:i(ci,{tier:e,px:o,onRadius:n})})}}}function A(e){const t=M();return[t?.values?.[e],n=>t?.onChange(e,n)]}function Dt(){return mt({type:"custom",render:()=>i(Eo,{})},"always")}function ai(){const e=M();return t=>e?.onChangeMany(t)}function ci({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),[r,s]=A(e.sidesKey),a=st(r)??[...lt];return i(mo,{label:l(ae),value:a,corners:Xn,onChange:c=>{const d=st(c)??[];s(d.length===lt.length?null:d)},radius:t,onRadiusChange:n,radiusMin:U,radiusMax:Ye,radiusStep:e.step??1,radiusPlaceholder:String(o)})}function Ht(){return Dt()}function di({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=v(),r=typeof o=="number"?`${o}px`:l("not set");return i(C,{words:y()?.panel,label:l(e),changed:t,detail:o==null?l("the built-in corners"):D(r,l("Styles")),onReset:n})}function ui(){const{cornerRadiusPx:e}=v();return typeof e=="number"?e:U}function pi(){return Ne({sidesKey:"sectionCornerSides",useFollowed:ui,mark:i(di,{label:ae}),hint:fi})}const fi="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function da(){return J({_gShape:T("Shape"),sectionCorners:pi(),sectionCornerSides:Ht(),...X("sectionBorder",Gt)})}const hi=()=>({width:l("Border width"),sides:{top:l("Border top"),right:l("Border right"),bottom:l("Border bottom"),left:l("Border left")},style:l("Border style"),styles:{solid:l("Solid"),dashed:l("Dashed"),dotted:l("Dotted")},color:l("Border color"),unit:"px"});function mi(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function gi(){let e;try{const t=Tt(v().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||cr.line}function bi({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:s=!0,above:a={}}){const c=e&&typeof e=="object"?e:{},[d,f]=z(()=>r?no(c,a):!1),m=hi(),p=u=>mi(r&&s?u:{width:u.width,color:u.color,...s?{style:u.style}:{}});return i(S,{label:l("Border"),icon:i(Rn,{}),action:r?i(eo,{each:d,label:l("Each side"),onChange:f}):void 0,children:i(Qn,{label:l("Border"),value:c,each:d,onChange:u=>t(p(u)),placeholder:n,presets:o,words:m,styles:s,max:ar})})}function wi({value:e,onChange:t,view:n}){const[o]=A("sectionBorder"),[r]=A(W("sectionBorder")),s=gi(),a=d=>d&&typeof d=="object"?d:{},c=n==="phone"?{...Rt(a(o)),...Rt(a(r))}:n==="tablet"?a(o):{};return i(bi,{value:e,onChange:t,placeholder:{sides:to(c),style:c.style??"solid",color:c.color||s},presets:[s],above:c})}function ua(e){return R(e,Gt(e==="mobile"?"phone":e))}function Gt(e){return{type:"custom",render:({value:t,onChange:n})=>i(wi,{value:t,onChange:n,view:e})}}function X(e,t){const n=(o,r)=>se(e,t(o),ke)[r];return{[e]:n("desktop",e),[W(e)]:n("tablet",W(e)),[F(e)]:n("phone",F(e))}}function pa(e){return{type:"custom",render:()=>i(xi,{partKey:e})}}function xi({partKey:e}){const[t]=A("id"),[n]=A("_partStyles"),{textStyles:o}=v(),r=zo();let s=null;try{s=Xo().select}catch{s=null}const a=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i(Yn,{name:l("Text"),preview:$o(a,c,{noStyle:l("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??Vo.copy.panel).cases}),onOpen:()=>{s&&typeof t=="string"&&s(jo(t,e))}})}function Mt(e){const{cornerRadiusPx:t}=v(),n=typeof t=="number"?t:e;let o=null;try{const{appState:s,selectedItem:a}=te(d=>d),c=a?.props?.id?String(a.props.id):void 0;o=c?zn(s?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return jn(r)?r:n}function Si({label:e,changed:t=!1,onReset:n=()=>{}}){const o=Mt(U);return i(C,{words:y()?.panel,label:l(e),changed:t,detail:D(`${o}px`,l("the section")),onReset:n})}function yi(){return i(k,{children:l("Follows the section's Corners until you set a number here.")})}function Ci(){return Ne({sidesKey:"cardCornerSides",useFollowed:()=>Mt(U),mark:i(Si,{label:ae}),hint:i(yi,{})})}function _i(){return{type:"custom",render:()=>i(ln,{})}}function fa(e){return{...e,render:t=>i(sn,{render:e.render,props:t})}}function ha(){return{_gShape:T("Shape"),cardCorners:Ci(),cardCornerSides:Ht(),cardCornersApplyAll:_i()}}function Ri(){return E({type:"custom",render:e=>i(Oi,{...e})},{type:"select",label:K,options:[{value:"content",label:"Fit content"},{value:"equal",label:"Equal"},{value:[50],label:"Custom: the width of each block in %, the last block left out"}]})}function Ti(e,t){const n=_t(e);if(n!=="custom")return l(Ct.find(r=>r.value===n)?.label??"");const o=dt(Re(e,t),t);return o?[...o,100-o.reduce((r,s)=>r+s,0)].join(" / "):l("Custom")}function Oi(e){const{value:t,onChange:n}=e,[o]=A("content"),r=Array.isArray(o)?o.length:0,s="follows"in e,a=t!=null,c=a?t:s?e.follows:void 0,d=_t(c),f=r>=2&&r<=ct,m=()=>[...So[r]??[]],p=V(null),u=b=>{const _=p.current;_&&JSON.stringify(b)===JSON.stringify(_.shares)?n(_.value):b&&n(b)},g=b=>{b===d||b==="custom"&&!f||n(b==="custom"?m():b)},h=l("The width bar works for 2 to {count} blocks.",{count:ct}),w=a&&(s||t!=="content"),x=Co().widths.hint(r,xo);return i(S,{label:l(K),icon:i(he,{}),changed:w,hint:d!=="custom"?void 0:f?x:h,action:i(C,{words:y()?.panel,label:l(K),changed:w,disabled:e.readOnly===!0,detail:s?B(b=>l(b),Ti(e.follows,r),e.followsView):l("Fit content"),onReset:()=>n(void 0)}),children:N("div",{className:"sf-share-row",children:[i("div",{className:"sf-share-pick",children:i(at,{label:l(K),value:d,options:Ct.map(b=>({value:b.value,label:b.value==="custom"&&!f?h:l(b.label),icon:Mr(i("span",{className:"sf-gallery-pic sf-share-pic",children:Ut(b.weights).map((_,j)=>i("i",{style:{gridColumn:`span ${_}`}},j))}),l(b.label),b.value==="custom"&&!f?h:l(b.label))})),onChange:g,columns:3,cell:Wt,tooltips:!1,disabled:e.readOnly===!0})}),d==="custom"&&f?i("div",{onFocus:()=>{p.current={value:t,shares:dt(Re(c,r),r)}},onBlur:()=>{p.current=null},children:i(yo,{label:l(K),count:r,value:Re(c,r),onChange:u,readOnly:e.readOnly===!0})}):null]})})}function Ut(e){if(!e)return[3,4];const t=e.reduce((n,o)=>n+o,0);return e.map(n=>Math.round(n/t*12))}function ma(){return Z(or,i(Ln,{}),xt,xt[0].value)}function ga(){return R("mobile",Gr(K,i(he,{}),sr.map(e=>({label:e.label,value:e.value,picture:i("span",{className:"sf-gallery-pic sf-share-pic",children:Ut(e.weights).map((t,n)=>i("i",{style:{gridColumn:`span ${t}`}},n))})})),lr,{columns:2,cell:Wt}))}const Wt={width:"5.75rem",height:"3.25rem"};function ba(){return se("share",Ri(),ke)[W("share")]}function Ii(){return R("mobile",$(St,i(Ze,{}),_e,ir,1,_e,"",{clear:{phoneFollows:!1,hint:_e}}))}const Kt={read:e=>e.phoneRow,write:(e,t,n)=>({phoneRow:n}),fieldKey:()=>"phoneRow",ownField:!0};function wa(){const e=$(St,i(Ze,{}),yt,rr,1,yt,"",{clear:{emptyLabel:"Auto"}}),t=se("columns",e,{...Kt,tablet:ke.tablet}),n=se("columns",e,Kt,{phoneRow:Ii()});return{...t,phoneRow:n.phoneRow}}function xa(e,t,n,o,r,s){return{type:"custom",render:({value:a,onChange:c})=>i(S,{label:l(e),icon:i(it,{noun:s}),action:i(C,{words:y()?.panel,label:l(e),changed:!Fr(a),detail:l("the Text style in Styles"),onReset:()=>c(kr),defaultAction:{onPress:()=>c(Er),title:l("Keep this section's own built-in size"),icon:i(Tn,{})}}),children:ee({min:t,max:n,step:o,value:typeof a=="number"?a:r,suffix:"px",ariaLabel:e,onChange:c})})}}function Sa(){return{_gCellWidth:T("Cell width"),gridSpan:Z("Positions",i(he,{}),[{label:"Auto",value:""},...Array.from({length:un},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function L(){let e=null,t=null;try{e=Me(Ei),t=te(n=>n).selectedItem}catch{t=null}return e??t?.props??{}}const Ei=zt(null);function ki({min:e,max:t,step:n,px:o,label:r,onChange:s,desktopKey:a,fallback:c}){const d=L()[a],f=Se(void 0,d,c);return i(k,{children:ee({min:e,max:t,step:n,value:Se(o,d,c),readout:!1,ariaLabel:r,notch:f,onChange:s})})}function Fi({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:s=()=>{}}){const a=L()[t],c=Se(void 0,a,n);return i(C,{words:y()?.panel,label:l(e),changed:r,detail:B(d=>l(d),`${c}${o}`),onReset:s})}function Ai(e){return Bt(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:i(Fi,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:t=>i(ki,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const Li={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Ni={Top:rt,Bottom:tt,Left:nt,Right:ot},Pi=e=>{const t=Ni[e];return i(t,{})};function ya(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=x=>Li[x],s=x=>$(r("Top"),i(rt,{}),I.min,I.max,I.step,x,"px"),a=(x,b,_,j=I)=>R("mobile",Ai({label:r(x),icon:Pi(x),desktopKey:b,min:j.min,max:j.max,step:j.step,fallback:_})),c=e.top??I.min,d=e.bottom??I.min,f="sectionPaddingLeft",m="sectionPaddingRight",p=e.sideBounds??I,u=e.side??p.min,g=e.sidePhone??u,h=e.phone===!0,w=x=>h?R("desktop",x):x;return J({...o?{_gSpacing:T("Padding")}:{},[t]:w(s(c)),...h?{[F(t)]:a("Top",t,c)}:{},...e.only==="top"?{}:{[n]:w($(r("Bottom"),i(tt,{}),I.min,I.max,I.step,d,"px")),...h?{[F(n)]:a("Bottom",n,d)}:{}},...e.sides?{[f]:w($(r("Left"),i(nt,{}),p.min,p.max,p.step,u,"px")),...h?{[F(f)]:a("Left",f,g,p)}:{},[m]:w($(r("Right"),i(ot,{}),p.min,p.max,p.step,u,"px")),...h?{[F(m)]:a("Right",m,g,p)}:{}}:{}})}function Ca(e,t){const n=Object.fromEntries(Object.entries(t).map(([s,a])=>[s,s in e&&fe(a)?e[s]:a])),o={};let r=!1;for(const[s,a]of Object.entries(e)){if(s in t){r||Object.assign(o,n),r=!0;continue}o[s]=a}return r||Object.assign(o,n),o}const ce="Width";function _a(e,t=Ar,n=!0){const o=t.map(r=>({label:Lr[r],value:r}));return J({...n?{_gWidth:T(ce)}:{},widthMode:{type:"custom",render:({onChange:r,field:s})=>i(S,{label:l(ce),icon:i(Wn,{}),action:n?i(qr,{inherited:s?.inherited??!1,onReset:()=>r(Nr),label:ce}):void 0,children:Ae({options:o,value:s?.currentValue||e,onChange:r,ariaLabel:ce})})}})}function Ra(){const e=(o,r)=>({type:"custom",render:({value:s,onChange:a})=>i(vi,{value:s,onChange:a,view:o,badge:r})}),t=o=>({type:"custom",render:({value:r,onChange:s,field:a})=>i(Di,{value:r,onChange:s,unit:a?.unit,view:o})}),n=o=>{const r=Wr("Unit",i(Qe,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");if(o==="desktop")return r;const s=r.render;return{...r,render:a=>i(Hi,{props:a,draw:s,view:o})}};return J({_gHeight:T(Y),...X("sectionHeightMode",o=>o==="desktop"?e(o):e(o,r=>i(Gi,{view:o,onClear:()=>r(void 0)}))),...X("sectionHeightValue",t),...X("sectionHeightUnit",n)})}function vi({value:e,onChange:t,view:n,badge:o}){const r=L(),s=c=>["auto","fixed","screen"].includes(c),a=de(n,r)?.mode??"auto";return i(S,{label:Y,icon:q(i(Pn,{})),action:o?o(t):void 0,children:Ae({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:s(e)?e:a,onChange:t,ariaLabel:Y})})}function $t(e,t){return e==="phone"&&ye(t)?Jo(t):qo(t)}function de(e,t){return e==="desktop"||(e==="tablet"?ye(t):Yo(t))?null:$t(e,t)}const P=(e,t)=>e==="tablet"?W(t):F(t);function Bi(e,t,n,o){const r=de(e,t);return!r||e==="desktop"?null:o===void 0?{}:{[P(e,"sectionHeightMode")]:r.mode,...r.mode==="fixed"?{[P(e,"sectionHeightUnit")]:r.unit}:{},...n==="sectionHeightUnit"?{[P(e,"sectionHeightValue")]:r.value}:{},[P(e,n)]:o}}function Xt(e,t,n){const o=M(),r=de(e,L());return!o||!r?{followed:null,write:n}:{followed:r,write:a=>o.onChangeMany(c=>{const d=Bi(e,c,t,a);return d===null?{[e==="desktop"?t:P(e,t)]:a}:Object.keys(d).length?d:null})}}function Di({value:e,onChange:t,unit:n,view:o}){const{followed:r,write:s}=Xt(o,"sectionHeightValue",t),a=(r?r.unit:n)==="%"?"%":"px",c=a==="%"?tr:er;return i("div",{className:"sf-field",children:ee({min:c.min,max:c.max,step:c.step,value:r?null:typeof e=="number"?e:c.fallback,...r?{placeholder:r.value}:{},suffix:a,ariaLabel:Y,onChange:s})})}function Hi({props:e,draw:t,view:n}){const{followed:o,write:r}=Xt(n,"sectionHeightUnit",e.onChange);return t({...e,...o?{value:void 0,storedValue:void 0,follows:o.unit}:{},onChange:r})}function Gi({view:e,onClear:t}){const n=L(),o=de(e,n)===null,r=e==="phone"&&ye(n),s=$t(e,n),a=B(c=>l(c),s.mode==="auto"?l("Auto"):`${s.value}${s.unit}`,r?"tablet":"desktop");return i(C,{words:y()?.panel,label:l(Y),changed:o,detail:a,onReset:t})}function Ta(){const e=n=>({type:"custom",render:({value:o,onChange:r,id:s,name:a})=>i(Wi,{value:o,onChange:r,labelId:`${s??a??"stickTop"}-label`,view:n})}),t=n=>({type:"custom",render:({value:o,onChange:r})=>i(Mi,{value:o,onChange:r,view:n})});return{_gStick:T(Ce),...X("stickTop",e),...X("stickTopDistance",t)}}function Mi({value:e,onChange:t,view:n}){const o=M(),r=L(),s=n==="desktop"||Pe(n,r)?null:jt(n,bt(r)),a=s&&o?c=>o.onChangeMany(d=>{const f=Ui(n,d,c);return f===null?{[P(n,"stickTopDistance")]:c}:Object.keys(f).length?f:null}):t;return i("div",{className:"sf-field",children:ee({min:ie.min,max:ie.max,step:ie.step,value:s?null:typeof e=="number"?e:ie.fallback,...s?{placeholder:s.distance}:{},suffix:"px",ariaLabel:l("Distance from top"),onChange:a})})}function Pe(e,t){return e==="tablet"?Qo(t):Zo(t)}function jt(e,t){return e==="phone"?{on:t.tablet,distance:t.tabletDistance}:{on:t.desktop,distance:t.desktopDistance}}function Ui(e,t,n){return e==="desktop"||Pe(e,t)?null:n===void 0?{}:{[P(e,"stickTop")]:!0,[P(e,"stickTopDistance")]:n}}function Wi({value:e,onChange:t,labelId:n,view:o}){const r=L(),s=bt(r),a=o==="phone"?s.phone:o==="tablet"?s.tablet:e===!0,c=o==="phone"&&s.ownTablet,d=o==="desktop"?null:jt(o,s),f=d?.on?`${d.distance}px`:l("Off");return i(S,{label:l(Ce),labelId:n,icon:q(i(Hn,{})),action:N(k,{children:[o!=="desktop"?i(C,{words:y()?.panel,label:l(Ce),changed:Pe(o,r),detail:B(m=>l(m),f,c?"tablet":"desktop"),onReset:()=>t(void 0)}):null,i(be,{checked:a,onChange:t,ariaLabelledBy:n})]})})}const Vt="e.g. about";function Oa(){return{_gAnchor:T("Anchor"),anchor:G({control:"plainText",label:"Name",placeholder:Vt},{type:"custom",render:({value:e,onChange:t})=>i(xn,{value:e,onChange:t,nameBox:(n,o)=>i(H,{value:n,onChange:o,label:"Name",placeholder:Vt,hideable:!1,markup:!1})})})}}function Ia(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:s,name:a})=>{const c=`${s??a??e}-datetime`,d=Date.parse(typeof o=="string"?o:"");return i(S,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(bo,{id:c,value:Number.isFinite(d)?new Date(d):null,onChange:f=>r(f?f.toISOString():"")})})}}}function Ea(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:s,name:a})=>{const c=`${s??a??e}-date`;return i(S,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(go,{id:c,value:Jt(typeof o=="string"?o:null),onChange:d=>r(d?qt(d):"")})})}}}function Ki(e,t,n,o){return{type:"custom",...E({},{...Q,label:e}),render:r=>{const{value:s,onChange:a,id:c,name:d}=r,f="follows"in r,m=r,p=typeof s=="boolean",u=typeof m.follows=="boolean"?m.follows:t,g=p?s:f?u:t,h=`${c??d??e}-label`,w=m.readOnly===!0,x=i(be,{checked:g,onChange:a,disabled:w,ariaLabelledBy:h});return i(S,{label:l(e),labelId:h,icon:n,hint:o===void 0?void 0:l(o),action:f?N(k,{children:[i(C,{words:y()?.panel,label:l(e),changed:p,detail:m.followsNoView?l(u?"On":"Off"):B(b=>l(b),l(u?"On":"Off"),m.followsView),disabled:w,onReset:()=>a(void 0)}),x]}):x})}}}function ka(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i($i,{label:"Background",icon:i(Dn,{}),id:r,value:e,shown:Kn(e),onChange:t})}}}function Fa(e,t){return{type:"custom",...E({},{...Q,label:e}),render:({value:n,onChange:o,id:r})=>{const s=typeof n=="boolean"?n:t,a=`${r??e}-checkbox`;return i(S,{label:l(e),htmlFor:a,className:"sf-checkbox",action:i(fo,{id:a,checked:s,onChange:o})})}}}function Aa(e,t,n){return{type:"custom",render:({value:o,onChange:r})=>i(oe,{label:l(e),icon:n,value:o||t,onChange:r})}}function $i({label:e,icon:t,id:n,value:o,shown:r,onChange:s}){const{colors:a,n:c}=Be(),d=xe(o),f=d?re(d,a,c):null;return i(oe,{label:l(e),icon:t,id:n,value:f?f.hex:r,caption:f?.words,onChange:s,choices:ve(d??"",a,c,s)})}function La(){return{type:"custom",render:e=>{const{value:t,onChange:n}=e,o=e;return i(Xi,{value:typeof t=="string"?t:"",onChange:n,twin:"follows"in e?{follows:o.follows,view:o.followsView}:void 0})}}}function ve(e,t,n,o){const r=ge(e);return To(t,n).map(s=>({label:s.label,color:s.value,selected:r===s.name,onPick:()=>o(s.name)}))}function Xi({value:e,onChange:t,twin:n}){const{colors:o,n:r}=Be(),s=o.background,a=D(s.toUpperCase(),l("Theme {n} background",{n:r})),c=ge(e),d=c?re(c,o,r):null,f=ve(e,o,r,t),m=n?()=>t(void 0):()=>t("");let p=s,u=a;if(n){const g=ge(n.follows),h=$n(n.follows),w=g?re(g,o,r):h?{hex:h,words:h.toUpperCase()}:null;p=w?.hex??s,u=B(x=>l(x),w?w.words:a,n.view)}return d?i(oe,{label:l("Fill"),icon:i(me,{}),value:d.hex,caption:d.words,onChange:t,changed:!0,onReset:m,resetTo:u,choices:f}):i(ft,{label:l("Fill"),icon:i(me,{}),value:e,inherited:p,resetTo:u,onChange:t,onReset:m,choices:f})}function ji(e,t,n){if((e?.content??[]).some(a=>a?.props?.id===t))return le(n);const r=Vn(e,t);if(r.length===0)return null;const s=le(Ft(n));if(s!==null)return s;for(let a=r.length-1;a>0;a-=1){const c=le(Ft(r[a].sectionAccent));if(c!==null)return c}return le(r[0].sectionAccent)}function Be(){const e=Tt(v().theme),[t]=A("sectionAccent");let n=null;try{const{appState:r,selectedItem:s}=te(c=>c),a=s?.props?.id?String(s.props.id):void 0;n=a?ji(r?.data,a,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{colors:dr(e.themes[o]),n:o+1}}const Vi=[{value:"0% 0%",label:"Top left"},{value:"50% 0%",label:"Top"},{value:"100% 0%",label:"Top right"},{value:"0% 50%",label:"Left"},{value:"50% 50%",label:"Center"},{value:"100% 50%",label:"Right"},{value:"0% 100%",label:"Bottom left"},{value:"50% 100%",label:"Bottom"},{value:"100% 100%",label:"Bottom right"}];function zi({label:e,value:t,onChange:n,points:o=Vi}){const r=o.map(s=>({...s,label:l(s.label),...s.title?{title:l(s.title)}:null}));return i(po,{label:l(e),value:t,points:r,onChange:n})}function Na(){return Dt()}const Pa={top:i(Fn,{}),right:i(kn,{}),bottom:i(In,{}),left:i(En,{})};function va(e,t,n,o,r,s,a){const c=p=>t.find(u=>u.value===p),d=p=>({value:p,label:"",disabled:!0,title:o}),f=p=>{const u=t.find(h=>h.cell===p);if(!u)return d(`missing-${p}`);const g=s?.[p];return g?{value:u.value,label:u.label,icon:g}:{value:u.value,label:u.label}},m=[d("corner-top-left"),f("top"),d("corner-top-right"),f("left"),d("centre"),f("right"),d("corner-bottom-left"),f("bottom"),d("corner-bottom-right")];return{type:"custom",render:({value:p,onChange:u})=>{const g=t.some(h=>h.value===p)?p:n;return i(S,{label:l(e),icon:r,value:c(g)?.label?l(c(g).label):a?l(a):"",children:zi({label:e,value:g,onChange:u,points:m})})}}}function Ba(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:s})=>i(Mo,{label:e,options:(s.options??t).map(a=>({...a,label:l(a.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:l(n)}:{}})}}function Da(e,t,n,o){return{type:"custom",options:t,fallback:n,...E({},{type:"select",label:e}),render:({value:r,onChange:s,field:a})=>i(Wo,{label:e,options:(a.options??t).map(c=>({...c,label:l(c.label)})),fallback:a.fallback??n,value:r,onChange:s,placeholder:o===void 0?void 0:l(o)})}}function Ha(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}const Ga=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function Ma(e,t,n){const o=Object.keys(We).map(r=>({label:We[r],value:r,picture:n[r]}));return{type:"custom",...E({},{type:"radio",label:e,options:o.map(r=>({value:r.value,label:r.label}))}),render:({onChange:r})=>i(qi,{label:e,icon:t,options:o,onChange:r})}}function Yi(e,t,n){const o=Zt(e,t,n);if(o!==void 0)return o==="save-makes-frame"?l("A frame is made from this video when you save the page."):o==="starts-dark"?l("This video starts dark, so no frame was made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="outside"?l("This video is on another website, so no frame can be made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="unsupported"?l("This video's file type gives no frame. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="failed"?l("No frame could be made from this video. It is tried again the next time you save the page. The slide shows its background colour while the video loads."):o==="image-no-frame"?l("The slide shows your Image while the video loads, because this video has no frame."):void 0;const r=en(e);return r==="frame-missing-image"?l("This video has no frame yet. The slide shows its image until one is made."):r==="frame-missing-surface"?l("This video has no frame yet. The slide shows its background colour until one is made."):r==="image-missing-frame"?l("No image yet. The slide shows the video's frame until you choose one."):r==="image-missing-surface"?l("No image yet. The slide shows its background colour until you choose one."):void 0}function qi({label:e,icon:t,options:n,onChange:o}){const r=M(),s=r?.values??{},a=Qt(s),c=Me(on),d=nn(c?.docId??null);let f=null;try{f=te(p=>p.appState.data)}catch{f=null}const m=tn(r?.id,f,d);return i(S,{label:l(e),icon:q(t),hint:Yi(s,m,c?.hasUnsavedEdits??!1),children:Ae({options:n,value:a,onChange:o,ariaLabel:e})})}function Ua(e,t,n,o={}){const r={type:"custom",[je]:!0,render:({value:s,onChange:a,name:c})=>i(Go,{value:s||"",onChange:a,fieldKey:c,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen,frameKey:o.frame}),...o.focus?{focusKey:o.focus}:{},...o.focusWhen?{focusWhen:o.focusWhen}:{}};return o.focus?R("each",r):r}const Wa={HeroSingle:["imageFocal"],HeroSlide:["videoFrame"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function Ji(e){const t=l(e.status??"");return e.ok&&typeof e.lat=="number"&&typeof e.lng=="number"?`${t} · ${e.lat.toFixed(4)}, ${e.lng.toFixed(4)}`:t}function Ka({value:e,onChange:t,label:n}){const o=e||{},r=M(),s=r?r.values!==r.node.props:!0,a=!!o.pending&&s,c=!!o.pending&&!s,d=!!Br(vr()).geocode,f=Ue(),m=(p,u)=>t({...o,[p]:u??void 0});return N(k,{children:[i(S,{label:l(n),icon:i(et,{}),action:d?i(we,{content:l("Find from the address (OpenStreetMap)"),children:i(ut,{"aria-label":l("Find from the address"),"aria-busy":a||void 0,disabled:a,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:i(Gn,{})})}):void 0,children:d&&o.status?i(Sn,{compact:!0,oneLine:!0,spaced:!1,status:a?"busy":o.ok&&!c?"found":"notfound",statusText:a?l("Finding…"):c?l(Ro):l(o.status),hint:Ji(o)}):null}),i(S,{label:l("Enter by hand"),labelId:f,icon:i(An,{}),action:i(be,{checked:!!o.manual,onChange:p=>t({...o,manual:p}),ariaLabelledBy:f})}),o.manual&&i(S,{label:l("Latitude, longitude"),icon:i(et,{}),children:N("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[i(pt,{value:typeof o.lat=="number"?o.lat:null,onChange:p=>m("lat",p),min:-90,max:90,step:1e-4,placeholder:l("Latitude")}),i(pt,{value:typeof o.lng=="number"?o.lng:null,onChange:p=>m("lng",p),min:-180,max:180,step:1e-4,placeholder:l("Longitude")})]})})]})}function Zi(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function Qi(e,t,n){const o=e.map(r=>({text:r?.text??""}));return t===null||t<0||t>=e.length?o:o.map((r,s)=>s===t?{text:n}:r)}function $a(e,t){return e===null?null:t>e?e:null}function el(e,t,n){if(n===null||n>=t.length)return null;for(let o=0;o<n;o+=1)if(e[o]!==t[o])return null;return e[n]!==t[n]&&t.includes(e[n])||e[n]!==t[n]&&t.length!==e.length?null:n}const Xa={label:"Ticker items",icon:i(Bn,{})};function ja(e,t,n,o){return{type:"custom",[O]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...E({},{...Nt.textList,label:e}),render:({value:r,onChange:s})=>i(tl,{label:e,icon:q(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:s,markup:o==="markup"})}}function tl({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:s=!1}){const a=V(null),[c,d]=z(null),f=p=>p.map(u=>({text:u?.text??""})),m=p=>{const u=el(n,p,c);u===null&&(a.current=null),d(u),r(f(p))};return i(oo,{label:l(e),icon:t,noun:l("item"),items:n,onChange:m,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:s?i(ht,{target:a,value:Zi(n,c),onChange:p=>r(Qi(n,c??-1,p)),disabled:c===null,label:c===null?l("Formatting — click a row first"):l("Formatting — row {n}",{n:c+1})}):void 0,renderRow:(p,u,g)=>i("input",{type:"text",className:s&&c===u?"sf-list-marking":void 0,value:p?.text??"",placeholder:l(o),"aria-label":l("{label} {n}",{label:l(e),n:u+1}),onChange:h=>g({text:h.target.value}),onFocus:h=>{a.current=h.currentTarget,d(u)}})})}function Va(e,t){const n=`${e.label} — row ${t+1}`;return G({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:l("{label} — row {n}",{label:l(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function za(e){return{_gCards:T("Cards"),coverIndex:Z("Cover image",i(vn,{}),Bo,String(Do),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:si("Image background",br),cardImage:rl()}}function Ya(){return{outline:Z("Card outline",i(Mn,{}),No,vo),indexBadge:Z("Card number",i(Qe,{}),Lo,Po),showBadge:Ki("Product badge",!0,i(it,{noun:"tag"}))}}function qa(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...Q,label:ue.find(s=>s.id===r).label}),o=r=>E(Oo(De),n(r));return{_gShowOnCard:T("Show on a card"),[De]:E({type:"custom",render:()=>i(nl,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(De)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const De="showCardPrice",ue=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function nl({rest:e}){const t=L(),n=ai(),o=a=>typeof t[a]=="boolean"?t[a]:void 0,r=a=>o(a)??e[a],s=ue.some(({id:a})=>o(a)!==void 0&&o(a)!==e[a]);return i(He,{parts:ue,changed:s,shown:r,onPress:(a,c)=>n({[a]:c}),onReset:()=>n(Object.fromEntries(ue.map(({id:a})=>[a,void 0])))})}function Ja(e,t="display"){const n=F(t);return{[t]:R("desktop",{type:"custom",render:({value:o,onChange:r})=>i(He,{parts:e,changed:io(o),shown:s=>lo(o,s),onPress:(s,a)=>r(co(o,s,a)),onReset:()=>r(void 0)})}),[n]:R("mobile",{type:"custom",render:({value:o,onChange:r})=>i(ol,{parts:e,desktopKey:t,value:o,onChange:r})})}}function He({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:s,disabledReason:a}){const c=l("Display");return i(S,{label:c,icon:i(Cn,{}),changed:t,action:i(C,{words:y()?.panel,label:c,changed:t,detail:s,onReset:r}),children:i(ro,{label:c,items:e.map(d=>({id:d.id,label:l(d.label),shown:n(d.id),...a?{disabled:!0,disabledReason:l(a)}:{}})),onChange:o})})}function ol({parts:e,desktopKey:t,value:n,onChange:o}){const r=L()[t];return i(He,{parts:e,changed:ao(n),shown:s=>so(r,n,s),onPress:(s,a)=>o(uo(n,s,a)),onReset:()=>o(Fo),detail:l("the same as Desktop")})}function rl(){return Bt("Card image",{min:U,max:Ye,step:an,hint:"Rounds the picture. The card's own corner is in Styles."})}function Za(){return Ne({sidesKey:"cornerSides",step:cn,useFollowed:()=>U,mark:i(il,{label:dn}),hint:l("Rounds the picture. Left alone it stays square.")})}function il({label:e,changed:t=!1,onReset:n=()=>{}}){return i(C,{words:y()?.panel,label:l(e),changed:t,onReset:n})}function Qa(){return{type:"custom",render:({value:e,onChange:t})=>i(cl,{value:typeof e=="string"?e:"",onChange:t})}}function ll({layout:e,width:t}){const n=hn(e),o=n?`${n[0]}/${n[1]}`:void 0;return i("span",{"aria-hidden":"true",style:{display:"grid",width:t,gridTemplateColumns:"repeat(12, minmax(0, 1fr))",gridAutoRows:o?"auto":6,gridAutoFlow:"row dense",gap:2},children:mn(e).map(([r,s],a)=>i("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${r}`,gridRow:`span ${s}`,aspectRatio:o}},a))})}const sl={width:"3.5rem",height:"2.5rem"},al=200;function cl({value:e,onChange:t}){const[n,o]=z(null),[r,s]=z(4),a=V(null);Yt(()=>{const u=a.current;if(!u||typeof ResizeObserver!="function")return;const g=()=>s(u.getBoundingClientRect().width>=al?4:3);g();const h=new ResizeObserver(g);return h.observe(u),()=>h.disconnect()},[]);const c=e&&e in ne?e:"",d=qe(n,c),f=qe(n,"").length,m=gn("no-symbol"),p=[{value:"",label:l("Not chosen"),icon:Ur(m,l("Not chosen"))},...d.map(u=>({value:u,label:l(ne[u].label),icon:i(ll,{layout:ne[u],width:40})}))];return i(S,{label:l("Layout"),icon:i(Nn,{}),value:c?l(ne[c].label):void 0,children:i("div",{ref:a,style:{flex:"1 1 auto",minWidth:0},children:i(at,{label:l("Layout"),value:c,options:p,onChange:t,columns:r,cell:sl,header:N("div",{className:"mb-2 flex flex-col gap-1",style:{minWidth:"11rem"},children:[i("span",{className:"text-2xs text-ink-faint",children:l("Photos in a row")}),i(Zn,{options:[{id:"all",label:l("All")},...pn.map(u=>({id:String(u),label:String(u)}))],value:n===null?"all":String(n),ariaLabel:l("Photos in a row"),onChange:u=>o(u==="all"?null:Number(u))}),i("span",{className:"text-2xs text-ink-faint",children:l("{n} of {total} layouts",{n:f,total:fn.length})})]})})})})}export{Zr as BOUND_TO_POST,Xs as BOUND_TO_POST_NOTE,Qs as BUCKET_ICONS,Wa as CUSTOM_FIELD_MEDIA,Ka as CoordsField,At as DESKTOP_GAP_NOT_OVERLAP,He as DisplayRow,Pa as EDGE_ARROWS,wo as FOCAL_DEFAULT,Vi as FOCAL_POINTS,pe as FOLD_FIELD_MARKER,zi as FocalPicker,sa as GroupLabel,Qr as HIGHLIGHT_HINT,H as HidableTextField,Xe as LINK_FIELD_MARKER,Ps as Label,je as MEDIA_FIELD_MARKER,Ga as MEDIA_TYPE_OPTIONS,js as NOT_BOUND_TO_POST,la as PanelBand,ni as PanelNoteLine,Ei as RowPropsContext,Ve as SCAFFOLD_FIELD_MARKER,oc as SCALAR_TEXT_CONTROLS,$r as SiteGapDefaultReset,ee as Slider,ri as Swatches,nc as TEXT_CONTROL_KINDS,O as TEXT_FIELD_MARKER,Xa as TICKER_ITEMS_ROW,tl as TextListField,$i as ThemeFillRow,ce as WIDTH_LABEL,qr as WidthDefaultReset,el as aimAfterListChange,Oa as anchorFields,D as backTo,aa as backgroundField,ma as boxBlockSpacingField,wa as boxColumnsFields,La as boxFillField,Ii as boxPhoneRowField,Ri as boxShareField,ga as boxSharePhoneField,ba as boxShareTabletField,ji as boxThemeIndexOf,na as bucketHeader,pa as buttonWordsEntryField,Ci as cardCornersField,si as cardImageBackgroundField,rl as cardImageField,za as cardMediaFields,ha as cardShapeFields,qa as cardShowFields,Ya as cardStyleFields,Sa as cellWidthFields,Fa as checkbox,Aa as colorInput,Bs as containerDirectionField,Xr as containerGapField,jr as containerGapPhoneField,vs as containerGapRows,Vr as containerGapTabletField,Ji as coordsResultTip,qs as copyText,Ht as cornerSidesField,Ne as cornersRowField,Ea as date,Ia as dateTime,oa as designGroupHeader,Ja as displayFields,va as edgePad,ve as fillSlotChoices,$a as focusAfterRemove,Na as focusKeptField,ra as foldMarker,fe as foldMetaOf,oi as foldTitleOf,Bi as followedHeightPatch,Ui as followedStickPatch,Qa as galleryLayoutField,Ra as heightFields,de as heightFollowedBy,Ds as heroGroupPlacementPoints,$e as hidableText,ti as hintIsWhileTyping,Za as imageCornersField,$s as inOwnBox,ta as isBucketHeader,Dt as keptBy,Js as linkField,Yi as loadingRowHint,Ma as loadingShowsField,Ba as multiSelect,ka as pageBackgroundField,ea as panelNote,Ai as phoneOverrideField,Ys as plainText,Zs as plainTextarea,Bt as pxField,ia as quietMarker,Ke as readHidable,Zi as rowText,Da as searchSelect,li as sectionBandChoices,ua as sectionBorderField,pi as sectionCornersField,da as sectionShapeFields,ca as sectionThemeFields,Qi as setRowText,xa as sizeField,Ha as sourceField,ya as spacingFields,Ta as stickFields,Ca as swapPadding,fa as templateField,Vs as text,rn as textFieldIdentifier,Ms as textFieldOffPage,Ws as textFieldPanelOnly,ja as textList,Va as textListRowField,zs as textarea,Ki as toggle,Ua as upload,ai as useSelectedPatch,L as useSelectedProps,A as useSelectedSibling,Kr as useSiteGapDetail,_a as widthField,Ks as withIdentifier,Gs as withOffPage,Us as withPanelOnly,Hs as withScaffold};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as o,jsxs as
|
|
2
|
-
`),O=
|
|
1
|
+
import{jsx as o,jsxs as C}from"react/jsx-runtime";import{accentItalicCss as $,storedTextStyles as K,textStylesCss as X}from"../../../render/lib/text-styles/site-text-styles.js";import{pageWidthMarker as Y,PAGE_WIDTH_ATTR as q,siteWidthTokens as J,siteGutterTokens as Q,siteGutterPhoneClass as U,siteGutterPhoneTokens as Z,heroBackgroundTokens as ee}from"../../../format/lib/content/page-width.js";import{siteBlockGapPhoneClass as te,siteBlockGapPhoneTokens as oe,siteBlockGapTokens as ne}from"../../../format/lib/content/container-gap.js";import{usePreviewHeader as re}from"../../../render/components/PreviewHeaderContext.js";import{SitePhotographyProvider as se}from"../../../render/components/SitePhotographyContext.js";import{CORNER_STYLE_TO_PX as ae,normalizeCornerStyle as ie,normalizeCornerRadius as de,themeColorStyle as ce,typeSizesStyle as le,headingTypographyStyle as he,normalizeHeadingTypography as pe,themeAccentStyle as me,themeButtonStyle as fe,themePresetAccentVars as ue,themeSurfaceStyle as Se,siteCornerRadiusTokens as ge,shadowColorTokens as ye,headingCompressionAttr as xe,cardShadowAttr as Te,cardGapAttr as ke,hoverEffectAttr as Ce}from"../../../format/lib/theme.js";import{fontRoleStyle as Pe}from"../../../format/lib/fonts.js";import{wordStyleTokens as Ee}from"../../../format/lib/word-styles.js";import{isStandaloneSectionDocument as Ae,pageHasHeaderSection as P,pageTakesTopSpace as Ge,topSpaceMarker as ve,TOP_SPACE_ATTR as _e,HEADER_CLEARANCE_CLASS as Be}from"../../../render/lib/document/header-clearance.js";import{leadSectionInk as we,HEADER_INK_ATTR as Re}from"../../../render/lib/document/header-ink.js";import{useEasel as Ie}from"efficient-easel/easel";import{useCardContentSwitchPass as We}from"../../components/useCardContentSwitchPass.js";import{pageBackgroundVars as He}from"../../../format/lib/content/page-background.js";import{pageWidthTokens as Ne}from"../../../render/lib/document/page-frame.js";import{EditingBridgesProvider as be}from"../../../render/lib/document/editing-bridges.js";import De from"../../components/SectionTextPartBridge.js";import{PageContentsFromDocument as E}from"../../../render/components/PageContentsContext.js";const ze={SectionTextParts:De};import{PageWidthWrapper as lt,PublishedPageFrame as ht,pageWidthTokens as pt}from"../../../render/lib/document/page-frame.js";const je="color-mix(in oklab, var(--bg) 40%, #ffffff)",Fe="12vh";function Ve({style:n,children:a}){const{appState:i}=Ie(u=>u),t=i.data.content,r=i.data.root;if(Ae(t))return o("div",{className:"sf-themed-content",style:{...n,background:je,minHeight:"100vh",paddingBottom:Fe},children:o("div",{style:{background:"var(--bg)"},children:o(E,{content:t,children:a})})});const d=P(t)&&Ge(r,t),c=P(t)?ve(r,t):null,p=c?{[_e]:c}:null,l=Y(r?.widthChoice),m=l?{[q]:l}:null,h=d?null:we(t),f=h?{[Re]:h}:null;return o("div",{className:`sf-themed-content${d?` ${Be}`:""}`,style:n,...f,...p,...m,children:o("div",{style:{background:"var(--bg)",minHeight:"100%"},children:o(E,{content:t,children:a})})})}function at({propsTheme:n,propsFonts:a,propsCornerStyle:i,propsCornerRadiusPx:t,propsHeadingCompression:r,propsHeadingTypography:d,pageBackground:c,chromeInheritsSiteBackground:p,suppressPreviewNav:l,footer:m,overlay:h,children:f}){const{theme:u,fonts:A,sizes:G,cornerRadiusPx:v,cardShadow:S,shadowColor:_,cardGap:B,hoverEffect:g,headingCompression:w,siteWidth:R,siteGutter:I,siteGutterPhone:y,blockGap:W,blockGapPhone:x,headingTypography:H,heroBackgroundFollowsWidth:N,photographyGrayscale:b,textStyles:D,wordStyles:z,themeFromDocument:e}=re();We();const s=e?n:u,j=e?a:A,F=e?void 0:G,V=e?t===void 0?ae[ie(i)]:de(t):v,L=e?r:w,T=e?d:H,k=[X(K(e?void 0:D)),$(pe(T).italicStrong)].filter(Boolean).join(`
|
|
2
|
+
`),O=Ne(),M={...ce(s),...le(F),...he(T),...O.style,...p?{}:He(c)};return C("div",{className:`sf-theme-surfaces sf-theme-accent ${[U(e?void 0:y),te(e?void 0:x)].filter(Boolean).join(" ")}`.trim(),style:{...Pe(j),...Ee(e?null:z),...me(s),...fe(s),...ue(s),...Se(s),...ge(V),...ye(e?void 0:S,e?void 0:_,e?void 0:g),...J(e?void 0:R),...Q(e?void 0:I),...Z(e?void 0:y),...ne(e?void 0:W),...oe(e?void 0:x),...ee(e?void 0:N)},"data-sf-headings":xe(L),"data-sf-card-shadow":e?void 0:Te(S),"data-sf-card-gap":e?void 0:ke(B),"data-sf-card-hover":e?void 0:Ce(g),onClickCapture:l,children:[k?o("style",{"data-sf-text-styles":"",dangerouslySetInnerHTML:{__html:k}}):null,o(se,{grayscale:e?void 0:b,children:C(be,{value:ze,children:[o(Ve,{style:M,children:f}),m,h]})})]})}const it=n=>{n.target?.closest?.("a")&&n.preventDefault()};export{ze as EDITING_BRIDGES,Ve as EditorPageBody,at as EditorThemedBody,lt as PageWidthWrapper,ht as PublishedPageFrame,je as SECTION_PREVIEW_CANVAS,Fe as SECTION_PREVIEW_CANVAS_TAIL,pt as pageWidthTokens,it as suppressPreviewNav};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{convertSection as
|
|
1
|
+
import{convertSection as P,pressesAsBox as S,SECTION_TO_BOX_PRESS as _,sectionToBoxRow as l}from"../../../render/lib/sections/section-to-box.js";import{SECTION_PRESETS as k,presetFor as R}from"../../../format/lib/sections/section-presets.js";import{GENERAL_SECTION_TO_BOX as B}from"../../../render/lib/document/blocks/general/section-to-box-rows.js";import{statsBoxSeed as T,statsPressSeed as d,statsSeedRows as C}from"../../../render/lib/document/blocks/general/section-to-box-rows-stats.js";import{footerPaymentPressStarter as L,logosPressStarter as N,paymentPressStarter as w}from"../../../render/lib/document/blocks/general/section-to-box-rows-logos.js";import{cardsPressStarter as j}from"../../../render/lib/document/blocks/general/section-to-box-rows-cards.js";import{pageHeaderPressStarter as v}from"../../../render/lib/document/blocks/general/section-to-box-rows-pageheader.js";import{milestoneTimelinePressStarter as A,storyTimelinePressStarter as U}from"../../../render/lib/document/blocks/general/section-to-box-rows-timeline.js";import{seedNodes as W}from"../../../format/lib/document/seed-parts.js";import{propsWithPartStyleValue as X}from"../../../render/lib/document/part-styles.js";import{isNodeList as m}from"efficient-easel/data";const D=Object.keys(B),E={Logos:N,DocMasthead:v,Timeline:U,TimelineTrack:A},G={PaymentBadges:w,PaymentLogosBlock:L};function u(t,r,e){const o={};for(const n of Object.keys(r(t.type)))o[n]=void 0;for(const[n,s]of Object.entries(t.props))o[n]=m(s)?s.map(p=>u(p,r,e)):s;return o.id=e(t.type),{type:t.type,props:o}}const O=t=>({...t?.theme?{theme:t.theme}:{},press:!0});function b(t,r,e=0,o=()=>({})){return(n,s,p)=>{const{nodes:i}=P({type:t,props:{...n(t),...o(),id:s(t)}},r,O(p));return u(i[e],n,s)}}const M={Stats:$,Cards:Y};function Y(){const t=l("Cards");if(!t)return null;const r=b("Cards",t,0,j);return(e,o,n)=>{const s=r(e,o,n);return{...s,props:{...s.props,name:"Cards section"}}}}function $(){const t=l("StatsParagraph");return t?(r,e,o)=>{const{nodes:n}=P({type:"StatsParagraph",props:{...r("StatsParagraph"),...d(),id:e("StatsParagraph")}},t,O(o)),s=n[0],p=m(s.props.content)?s.props.content.filter(f=>f.props?.cardStyle===void 0):[],i=x(T(C(),"table")),a=p.map(h),c=u({...s,props:{...s.props,content:[...a,i]}},r,e);return{...c,props:{...c.props,name:"Stats section"}}}:null}function h(t){if(t.props?.name==="Words"){const r=m(t.props.content)?t.props.content.map(H):t.props.content;return{...t,props:{...t.props,widthFitPhone:"fill",content:r}}}return m(t.props?.content)?{...t,props:{...t.props,content:t.props.content.map(h)}}:t}function H(t){return t.type!=="Text"?t:{...t,props:X({...t.props,alignTablet:"left"},"text","alignTablet","left")}}const x=t=>W([t],(r,e)=>`${r}-seed-${e}`)[0];function I(t,r){if(!S(t,r))return null;const e=M[t];if(e)return e();const o=l(t);return o?b(t,o,0,E[t]??G[t]):null}function V(t){return(r,e,o)=>{const n=s=>{if(s.type==="Stats"){const a=u(x(T([],"list")),r,e);return{...a,props:{...a.props,name:"Numbers"}}}let p=!1;const i={};for(const[a,c]of Object.entries(s.props))if(m(c)){const f=c.map(n);p||=f.some((y,g)=>y!==c[g]),i[a]=f}else i[a]=c;return p?{type:s.type,props:i}:s};return n(t(r,e,o))}}function ot(t,r=_){const e=R(t);return e?V(e):I(t,r)}function nt(){return[...Object.keys(k),...D.filter(t=>S(t)),...Object.keys(E).filter(t=>S(t))]}export{E as MERGE_LAYOUTS,D as TEXT_LAYOUTS,b as conversionPreset,ot as layoutPresetFor,nt as layoutTypes};
|
|
@@ -3,5 +3,6 @@ export type BlockAlign = "left" | "center" | "right";
|
|
|
3
3
|
export declare const BLOCK_ALIGN_JUSTIFY: Record<BlockAlign, string>;
|
|
4
4
|
export type AlignKind = "text" | "place" | "justify" | "items";
|
|
5
5
|
export declare function blockAlignOf(value: unknown): BlockAlign | undefined;
|
|
6
|
+
export declare function legacyBlockAlignOf(value: unknown): BlockAlign | undefined;
|
|
6
7
|
export declare function alignViewAnswers(desktop: unknown, tablet: unknown, phone: unknown): ViewOverrides<BlockAlign>;
|
|
7
8
|
export declare function alignViewClasses(kind: AlignKind, desktop: unknown, tablet: unknown, phone: unknown): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{viewOverrides as n}from"./view-overrides.js";const
|
|
1
|
+
import{viewOverrides as n}from"./view-overrides.js";const f={left:"justify-start",center:"justify-center",right:"justify-end"},o={text:{left:"view-tablet:max-view-desktop:text-left",center:"view-tablet:max-view-desktop:text-center",right:"view-tablet:max-view-desktop:text-right"},place:{left:"view-tablet:max-view-desktop:mx-0",center:"view-tablet:max-view-desktop:mx-auto",right:"view-tablet:max-view-desktop:ml-auto view-tablet:max-view-desktop:mr-0"},items:{left:"view-tablet:max-view-desktop:grid-cols-1 view-tablet:max-view-desktop:justify-items-start",center:"view-tablet:max-view-desktop:grid-cols-1 view-tablet:max-view-desktop:justify-items-center",right:"view-tablet:max-view-desktop:justify-items-end"},justify:{left:"view-tablet:max-view-desktop:justify-start",center:"view-tablet:max-view-desktop:justify-center",right:"view-tablet:max-view-desktop:justify-end"}},w={text:{left:"max-view-tablet:text-left",center:"max-view-tablet:text-center",right:"max-view-tablet:text-right"},place:{left:"max-view-tablet:mx-0",center:"max-view-tablet:mx-auto",right:"max-view-tablet:ml-auto max-view-tablet:mr-0"},items:{left:"max-view-tablet:grid-cols-1 max-view-tablet:justify-items-start",center:"max-view-tablet:grid-cols-1 max-view-tablet:justify-items-center",right:"max-view-tablet:justify-items-end"},justify:{left:"max-view-tablet:justify-start",center:"max-view-tablet:justify-center",right:"max-view-tablet:justify-end"}};function a(t){return t==="left"||t==="center"||t==="right"?t:void 0}function v(t){return t==="start"?"left":t==="end"?"right":a(t)}function m(t,r,s){const i=a(t)??"left",e=n("same",i,a(r),a(s)),l={};return e.tablet&&e.tablet!==i&&(l.tablet=e.tablet),e.phone&&e.phone!==i&&(l.phone=e.phone),l}function b(t,r,s,i){const e=m(r,s,i);return[e.tablet?o[t][e.tablet]:"",e.phone?w[t][e.phone]:""].filter(Boolean).join(" ")}export{f as BLOCK_ALIGN_JUSTIFY,m as alignViewAnswers,b as alignViewClasses,a as blockAlignOf,v as legacyBlockAlignOf};
|
|
@@ -6,6 +6,7 @@ export declare const COUNT_KEY_PROP = "countKey";
|
|
|
6
6
|
export declare const COUNTS_SOURCE = "counts";
|
|
7
7
|
export declare const LOCATION_PAYMENT_METHODS_SOURCE = "location-payment-methods";
|
|
8
8
|
export declare const SHOP_PAYMENT_METHODS_SOURCE = "shop-payment-methods";
|
|
9
|
+
export declare const DELIVERY_OPTIONS_SOURCE = "delivery-options";
|
|
9
10
|
export type SourceRow = Readonly<Record<string, string>>;
|
|
10
11
|
export interface SourceChoice {
|
|
11
12
|
key: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{globalRegistry as c}from"../global-registry.js";import{nonEmptyString as a}from"../non-empty-string.js";const f="dataSource",x="dataSourceOptions",
|
|
1
|
+
import{globalRegistry as c}from"../global-registry.js";import{nonEmptyString as a}from"../non-empty-string.js";const f="dataSource",x="dataSourceOptions",p="dataRows",_="countKey",g="counts",A="location-payment-methods",C="shop-payment-methods",w="delivery-options";function u(e){return typeof e.open=="function"}const y=/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/;function s(){return c("efficient.block-sources",()=>({sources:new Map,revision:0}))}const m=e=>[e?.key,e?.label,e?.value].every(t=>typeof t=="string"&&t.trim()!==""),b=e=>[e?.key,e?.label].every(t=>typeof t=="string"&&t.trim()!==""),i=e=>typeof e=="string"&&e.trim()!=="";function O(e){if(!e||!i(e.label))return null;if(u(e))return{label:e.label.trim(),open:e.open};const t=e.href;return i(t)?{label:e.label.trim(),href:t.trim()}:null}function d(e){if(typeof e.key!="string"||!y.test(e.key))throw new Error(`A block source key is lower-case words joined by hyphens, not ${JSON.stringify(e.key)}.`);if(typeof e.label!="string"||!e.label.trim())throw new Error(`The block source ${e.key} has no label.`);if(!Array.isArray(e.blocks)||!e.blocks.length||e.blocks.some(r=>typeof r!="string"||!r))throw new Error(`The block source ${e.key} names no block it can fill.`);const t=O(e.edit);return{key:e.key,label:e.label.trim(),blocks:[...e.blocks],...e.sample?{sample:e.sample.map(r=>l(r)).filter(r=>r!==null)}:{},...Array.isArray(e.choices)?{choices:e.choices.filter(m)}:{},...Array.isArray(e.fields)?{fields:e.fields.filter(b).map(r=>({...r}))}:{},...t?{edit:t}:{},...typeof e.useRows=="function"?{useRows:e.useRows}:{},...Array.isArray(e.records)?{records:e.records.filter(r=>typeof r=="string"&&r.trim()!=="").map(r=>r.trim())}:{}}}function P(e){const t=e.map(d),r=s();for(const o of t)r.sources.set(o.key,o);t.length&&(r.revision+=1)}function v(e){const t=[...s().sources.values()];return e===void 0?t:t.filter(r=>r.blocks.includes(e))}function h(e){return s().sources.get(e)??null}function T(e){return s().sources.get(e)?.choices??[]}function U(){return s().revision}function S(e){const t=e?.[f];return typeof t=="string"?t.trim():""}function l(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t={};for(const[r,o]of Object.entries(e)){const n=a(o);n&&(t[r]=n)}return Object.keys(t).length?t:null}function k(e){const t=e?.[p];return Array.isArray(t)?t.map(l).filter(r=>r!==null):null}function N(e,t,r=[]){const o=k(e);if(o!==null&&(o.length||!t))return{rows:o,sample:!1};if(!t)return{rows:[],sample:!1};const n=h(S(e))?.sample;return{rows:n?.length?n:r,sample:!0}}export{x as BLOCK_SOURCE_OPTIONS_PROP,f as BLOCK_SOURCE_PROP,p as BLOCK_SOURCE_ROWS_PROP,g as COUNTS_SOURCE,_ as COUNT_KEY_PROP,w as DELIVERY_OPTIONS_SOURCE,A as LOCATION_PAYMENT_METHODS_SOURCE,C as SHOP_PAYMENT_METHODS_SOURCE,h as blockSourceSpec,v as blockSources,U as blockSourcesRevision,S as declaredBlockSource,u as isSourceEditAction,P as registerBlockSources,k as servedRows,T as sourceChoices,N as sourcedRows};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CSSProperties } from "react";
|
|
2
|
-
import { type
|
|
2
|
+
import { type FillColorSlot } from "efficient-shell/markup";
|
|
3
3
|
import type { SourceRow } from "./block-sources.js";
|
|
4
4
|
import { type ViewVarNames } from "./view-var-split.js";
|
|
5
5
|
export declare const CARD_SHADOW_CLASS = "sf-card";
|
|
@@ -33,7 +33,7 @@ export declare function isBackgroundBox(src?: string | null): boolean;
|
|
|
33
33
|
export declare function boxDarkenStyle(darken: unknown, style?: unknown): CSSProperties | null;
|
|
34
34
|
export declare const boxFillOf: (value: unknown) => string | null;
|
|
35
35
|
export declare const boxPaintOf: (value: unknown) => string | null;
|
|
36
|
-
export declare const boxFillSlot: (value: unknown) =>
|
|
36
|
+
export declare const boxFillSlot: (value: unknown) => FillColorSlot | null;
|
|
37
37
|
export declare const BOX_SWATCH_PROP = "swatch";
|
|
38
38
|
export declare function boxSwatchFill(props: Record<string, unknown> | null | undefined, row: SourceRow | null | undefined): string | null;
|
|
39
39
|
export declare const BOX_FILL_VIEWS: ViewVarNames;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseHexColor as
|
|
1
|
+
import{parseHexColor as k}from"efficient-shell/format";import{fillColorRole as _}from"efficient-shell/markup";import{namedRowField as g,rowFieldText as y}from"./card-template.js";import{fillInkCss as O,fillSlotNamed as C,inkTokenOf as F,partColourName as A}from"../document/part-inks.js";import{scrim as u}from"./scrim.js";import{viewVarSplit as b}from"./view-var-split.js";const L="sf-card",x={min:0,max:100,step:5,fallback:0,unit:"%"},T=[{label:"Even",value:"even"},{label:"From the bottom",value:"bottom"}],D="68%",$={desktop:20,phone:20,side:40,sidePhone:24},H="sf-box-sides",M={min:0,max:200,step:10};function j(t){return typeof t=="string"&&t.trim()!==""}function S(t,n){const e=typeof t=="number"?t:Number.parseFloat(String(t??""));if(!Number.isFinite(e)||e<=0)return null;const s=(Math.min(x.max,Math.max(x.min,e))/100).toFixed(2);return n!=="bottom"?{background:u(Number(s))}:{background:`linear-gradient(0deg, ${u(Number(s))} 0%, ${u(0)} ${D})`}}const h=t=>typeof t=="string"?k(t.trim()):null,p=t=>{const n=h(t);if(n!==null||typeof t!="string")return n;const e=t.trim();return e&&!e.startsWith("#")&&O(e)||null},w=t=>{if(typeof t!="string")return null;const n=_(A(t.trim()));return n?.kind==="slot"?n.slot:null},N="swatch";function K(t,n){if(!n)return null;const e=y(n,g(t,N)),r=C(e);return h(e)??(r&&F(r)||null)}const B={tabletClass:"sf-fill-tablet",tabletVar:"--sf-fill-tablet",phoneClass:"sf-fill-phone",phoneVar:"--sf-fill-phone"};function Y(t,n,e){return b(B,p(t),p(n),p(e))}const E={tabletClass:"sf-wash-tablet",tabletVar:"--sf-wash-tablet",phoneClass:"sf-wash-phone",phoneVar:"--sf-wash-phone"};function z(t){const n=S(t.darken,t.darkenStyle);if(!n)return{className:"",style:{}};const e=(o,f)=>String(S(o,f)?.background??"none"),r=o=>(typeof o=="number"||typeof o=="string"&&o.trim()!=="")&&Number.isFinite(Number(o))?o:void 0,s=o=>T.some(f=>f.value===o)?o:void 0,[l,a,i,c]=[r(t.darkenTablet),s(t.darkenStyleTablet),r(t.darkenPhone),s(t.darkenStylePhone)],m=l??t.darken,d=a??t.darkenStyle;return b(E,String(n.background),l!==void 0||a!==void 0?e(m,d):null,i!==void 0||c!==void 0?e(i??m,c??d):null)}function J(t,n){const e={"top-left":["start","start"],"top-center":["center","start"],"top-right":["end","start"],left:["start","center"],center:["center","center"],right:["end","center"],"bottom-left":["start","end"],"bottom-center":["center","end"],"bottom-right":["end","end"]},[r,s]=e[t]??e.center,[l,a]=n==="column"?[s,r]:[r,s],i={start:"justify-start",center:"justify-center",end:"justify-end"},c={start:"items-start",center:"items-center",end:"items-end"};return`${i[l]} ${c[a]}`}export{$ as BOX_CARD_PAD,M as BOX_CARD_SIDE,x as BOX_DARKEN,T as BOX_DARKEN_STYLES,B as BOX_FILL_VIEWS,H as BOX_OWNS_SIDES_CLASS,N as BOX_SWATCH_PROP,E as BOX_WASH_VIEWS,L as CARD_SHADOW_CLASS,S as boxDarkenStyle,h as boxFillOf,w as boxFillSlot,Y as boxFillViews,p as boxPaintOf,J as boxPlacementClasses,K as boxSwatchFill,z as boxWashViews,j as isBackgroundBox};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const BOX_SHAPES: ("square" | "
|
|
1
|
+
export declare const BOX_SHAPES: ("square" | "auto" | "video" | "poster" | "tall" | "wide" | "landscape" | "portrait" | "panorama" | "story")[];
|
|
2
2
|
export type BoxShape = (typeof BOX_SHAPES)[number];
|
|
3
3
|
export declare function boxShapeOf(value: unknown): BoxShape;
|
|
4
4
|
export declare function boxShapeClass(value: unknown): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function cardColumns(columns: number | undefined): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(n){return Math.min(4,Math.max(2,n??3))}export{t as cardColumns};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const c="cardPlace";function
|
|
1
|
+
import{CARD_LIST_TYPE as p}from"./card-template.js";const c="cardPlace";function a(t){return t[c]==="top-line"?"top-line":""}const _="absolute left-5 top-0 z-10 -translate-y-1/2 bg-bg px-2",x="data-sf-top-line",i=new Set(["Cards",p]);function A(t){return typeof t=="string"&&i.has(t)}const f=t=>{if(!t||typeof t!="object")return!1;const e=t,n=o=>typeof o=="number"&&o>0,s=e.width,r=o=>typeof e[o]=="number"?n(e[o]):n(s);return r("top")&&!r("right")&&!r("bottom")&&!r("left")};function C(t,e,n){return!n||!e?.linesBetween||e.index!==0?t:f(t)?{...t,top:0}:t}const E="outsideFramedCard";export{c as CARD_PLACE_PROP,i as FRAMED_CARD_OWNERS,E as OUTSIDE_FRAMED_CARD,x as TOP_LINE_ATTRIBUTE,_ as TOP_LINE_CLASS,C as cardLineBetween,a as cardPlaceOf,A as framesItsCards};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SourceRow } from "./block-sources.js";
|
|
1
2
|
declare const CARD_ROW_STATES: readonly ["selected", "highlighted"];
|
|
2
3
|
type CardRowStateName = (typeof CARD_ROW_STATES)[number];
|
|
3
4
|
export type CardRowState = Readonly<Partial<Record<CardRowStateName, boolean>>>;
|
|
@@ -7,6 +8,22 @@ export type CardStateLine = "frame" | "under";
|
|
|
7
8
|
export declare const CARD_STATE_UNDER_LINE_CLASS = "pointer-events-none absolute inset-x-0 bottom-0 border-b-2 border-accent";
|
|
8
9
|
export declare function cardStateValue(state: CardRowState | undefined | null): string;
|
|
9
10
|
export declare function cardStateAttrs(state: CardRowState | undefined | null): Record<string, string>;
|
|
11
|
+
export declare const CARD_BADGE_FIELD = "badge";
|
|
12
|
+
export declare function keyedRows(rows: readonly SourceRow[], keys?: readonly {
|
|
13
|
+
key: string;
|
|
14
|
+
}[]): SourceRow[];
|
|
15
|
+
export declare function rowHoldsContent(row: unknown): boolean;
|
|
16
|
+
export declare function markedRows(rows: readonly SourceRow[], { chosen, badge }: {
|
|
17
|
+
chosen: string;
|
|
18
|
+
badge: string;
|
|
19
|
+
}): {
|
|
20
|
+
rows: SourceRow[];
|
|
21
|
+
states: CardRowState[];
|
|
22
|
+
};
|
|
23
|
+
export declare function highlightOf(props: Record<string, unknown>): {
|
|
24
|
+
chosen: string;
|
|
25
|
+
badge: string;
|
|
26
|
+
};
|
|
10
27
|
export type CardItemAction = {
|
|
11
28
|
readonly press: () => void;
|
|
12
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BOX_LINK_CLASS as
|
|
1
|
+
import{BOX_LINK_CLASS as a}from"./box-link.js";import{cardKeyOf as d}from"./card-template.js";const f=["selected","highlighted"],p="data-sf-card-state",T="pointer-events-none absolute inset-0 border border-accent",C="pointer-events-none absolute inset-x-0 bottom-0 border-b-2 border-accent";function u(t){return t?f.filter(e=>t[e]===!0).join(" "):""}function S(t){const e=u(t);return e?{[p]:e,className:"relative"}:{}}const A={highlighted:!0},g={},c="badge";function b(t,e=[]){return t.map((r,n)=>({...r,key:r.key||e[n]?.key||d(r,n)}))}function l(t){return!t||typeof t!="object"?!1:Object.entries(t).some(([e,r])=>e==="key"||e===c||e==="state"?!1:typeof r=="string"?r.trim()!=="":Array.isArray(r)?r.length>0:r!=null&&typeof r!="function")}function x(t,{chosen:e,badge:r}){const n=e.trim(),s=n?t.findIndex(o=>o.key===n):-1;return{rows:t.map((o,i)=>({...o,[c]:i===s?r:""})),states:t.map((o,i)=>i===s?A:g)}}function y(t){return{chosen:typeof t.highlightedCard=="string"?t.highlightedCard.trim():"",badge:typeof t.highlightBadge=="string"?t.highlightBadge:""}}function m(t){if(!t||typeof t!="object")return;const e=t.press;return typeof e=="function"?{press:e}:void 0}const R="data-sf-card-press",D=`${a} appearance-none bg-transparent border-0 p-0 m-0 cursor-pointer`;export{R as CARD_ACTION_ATTR,D as CARD_ACTION_CLASS,c as CARD_BADGE_FIELD,p as CARD_STATE_ATTR,T as CARD_STATE_LINE_CLASS,C as CARD_STATE_UNDER_LINE_CLASS,m as cardItemAction,S as cardStateAttrs,u as cardStateValue,y as highlightOf,b as keyedRows,x as markedRows,l as rowHoldsContent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{blockSourceSpec as
|
|
1
|
+
import{blockSourceSpec as x,declaredBlockSource as g}from"./block-sources.js";import{isNodeList as O}from"efficient-easel/data";import{BOX_TYPE as _}from"../document/container-blocks.js";import{globalRegistry as C}from"../global-registry.js";import{nonEmptyString as w}from"../non-empty-string.js";import{accentItalicRuns as h}from"../markup.js";import{withCardsTemplate as A}from"../document/cards-template-on-read.js";import{withCardListTemplate as S}from"../document/blocks/general/CardList/item-seed.js";import{ARTICLE_BODY_BLOCK as I,withArticleBodyTemplate as E}from"../document/article-body-seed.js";import{withLogosTemplate as P}from"../document/blocks/general/Logos/card-seed.js";import{withFaqTemplate as F}from"../document/blocks/general/FAQ/card-seed.js";const D="template",ce="Card template",y="CardList",B=["Text","ImageBlock","ButtonBlock","Flex"],f="rowField",v="rowLinkField";function ue(){return{type:"slot",allow:[...B]}}const W=B.filter(e=>e!=="ButtonBlock"),T="items",R="itemFields";function de(){return{type:"slot",allow:[...W]}}const M=[{block:"OrderSummary",typedRows:"rows",linesBetween:!0,fields:[{key:"label",label:"Item"},{key:"meta",label:"Meta line"},{key:"amount",label:"Amount"}]},{block:"FAQ",typedRows:"items",fields:[{key:"question",label:"Question"},{key:"answer",label:"Answer",multiline:!0}],seedOnInsert:e=>F(e)},{block:"Footprint",typedRows:"offices",fields:[{key:"badge",label:"HQ"},{key:"role",label:"Role"},{key:"city",label:"City"},{key:"country",label:"Region · country"},{key:"address",label:"Address"},{key:"linkLabel",label:"Button"},{key:"href",label:"Link",kind:"link"}]},{block:"Cards",typedRows:"items",fields:[{key:"num",label:"Number"},{key:"since",label:"Corner note"},{key:"label",label:"Label"},{key:"title",label:"Card title"},{key:"value",label:"Value"},{key:"body",label:"Card body",multiline:!0},{key:"href",label:"Link",kind:"link"},{key:"count",label:"Count"},{key:"badge",label:"Highlight badge",everySource:!0}],seed:e=>A("Cards",e)},{block:"ProcessSteps",fields:[{key:"eyebrow",label:"Eyebrow"},{key:"title",label:"Title",mark:"accentItalic"},{key:"copy",label:"Body",multiline:!0},{key:"image",label:"Image",kind:"image",alt:"title"},{key:"tag",label:"Image tag"},{key:"specs",label:"Specs",kind:"list",fields:[{key:"label",label:"Label"},{key:"value",label:"Value"}]}],blocks:[{type:y,label:"Card list"}]},{block:"Logos",fields:[{key:"label",label:"Name"},{key:"kind",label:"Kind"}],seed:e=>P(e)},{block:y,fields:[{key:"badge",label:"Highlight badge",everySource:!0}],typedRows:T,seed:e=>S(e)},{block:I,fields:[{key:"heading",label:"Subhead"},{key:"paragraph",label:"Paragraph",multiline:!0}],seed:e=>E(e)}];function a(){return C("efficient.card-templates",()=>new Map(M.map(e=>[e.block,e])))}function fe(e){for(const t of e){if(typeof t.block!="string"||!t.block)throw new Error("A card template names no block.");const r=[];for(const o of t.blocks??[]){if(typeof o?.type!="string"||!o.type)throw new Error(`The card template of ${t.block} names an empty block.`);r.some(i=>i.type===o.type)||r.push({type:o.type,label:o.label||o.type})}const n=w(t.typedRows);a().set(t.block,{block:t.block,fields:t.fields.map(o=>({...o})),blocks:r,typedRows:n,...t.seed?{seed:t.seed}:{},...t.seedOnInsert?{seedOnInsert:t.seedOnInsert}:{},...t.linesBetween===!0?{linesBetween:!0}:{}})}}function N(e,t){const r=e?a().get(e)?.seed:void 0;return r?r(t):t}function pe(e,t){if(!(t.template===void 0||Array.isArray(t.template)&&t.template.length===0))return t;const{template:n,...o}=t,i=e?a().get(e)?.seedOnInsert:void 0,l=i?i(o):N(e,o);return l===o?t:l}function ye(){for(const e of a().values())if(e.blocks?.length)return!0;return!1}function me(e){return a().get(e)?.blocks??[]}function ke(e){for(const t of a().values())if(t.blocks?.some(r=>r.type===e))return!0;return!1}function be(e){return typeof e=="string"&&a().get(e)?.typedRows||""}function xe(e){return typeof e=="string"&&a().get(e)?.linesBetween===!0}function K(e){return typeof e=="string"&&a().has(e)}function j(e,t){const r=a().get(e)?.fields??[];return t?r.filter(n=>(n.kind??"text")===t):r}function H(e){return typeof e=="string"?j(e,"list")[0]?.key??"":""}function Y(e,t){return m(e)||H(t)}function L(e,t){const r=typeof e?.type=="string"?e.type:"";if(!r)return[];const n=a().get(r)?.fields??[],o=x(g(e?.props))?.fields,i=o?.length?[...o.map(l=>({...l})),...n.filter(l=>l.everySource&&!o.some(s=>s.key===l.key))]:n;return t?i.filter(l=>(l.kind??"text")===t):i}function Q(e,t,r){return e?r?L(r).find(n=>n.key===t)??null:a().get(e)?.fields.find(n=>n.key===t)??null:null}function m(e,t=f){const r=e?.[t];return typeof r=="string"?r.trim():""}function ge(e,t){return e.key||String(t+1)}function we(e){const t={};if(e&&typeof e=="object"&&!Array.isArray(e))for(const[r,n]of Object.entries(e))typeof n=="string"&&(t[r]=n);return t}const U="hideWhenRowEmpty";function Be(e,t){const r=e[U];return!t||!Array.isArray(r)||!r.length?!1:r.every(n=>typeof n!="string"||!t[n]?.trim())}function Te(e,t,r=""){const n=t&&e&&typeof e=="object"?e[t]:void 0;if(!Array.isArray(n))return"";for(const o of n){const i=typeof o=="string"?o:o?.src,l=w(typeof i=="string"?i.trim():void 0);if(l&&l!==r.trim())return l}return""}const k={Text:{text:f},ImageBlock:{src:f},ButtonBlock:{label:f,href:v},LogoBlock:{alt:f},Breadcrumb:{currentCrumb:f}},Re=k,$=new Set(["ButtonBlock.label","LogoBlock.alt"]);function Le(e,t,r){return q(e,t,r)&&!$.has(`${e}.${r}`)}function q(e,t,r){return V(e,t,r)!==""}function V(e,t,r){const n=k[e]?.[r];return n?m(t,n):""}function X(e,t){return!t||!e?null:e[t]??""}function Oe(e,t,r,n){if(!r)return t;let o=null;for(const[i,l]of Object.entries(k[e]??{})){const s=m(t,l),c=X(r,s);c!==null&&(o??={...t},o[i]=n&&Q(n,s)?.mark==="accentItalic"?h(c):c)}return o??t}function b(e,t){const r=e?.data?.content;if(!Array.isArray(r)||typeof t!="string")return;const n=(i,l)=>{for(const s of i){if(s?.props?.id===t)return l;for(const[c,u]of Object.entries(s?.props??{})){if(!O(u))continue;const d=c===D&&K(s.type)?{owner:s,direct:!0,nested:l!==null,underBox:!1}:l&&{owner:l.owner,direct:!1,nested:l.nested,underBox:l.underBox||s.type===_},p=n(u,d);if(p!==void 0)return p}}},o=n(r,null);return o===void 0?null:o}function z(e,t){const r=b(e,t);return r&&r.owner}function _e(e,t){const r=b(e,t);return r&&(r.direct?r.owner:null)}function Ce(e,t){const r=b(e,t);if(r!==void 0)return r===null?{inCopy:!1,nestedCopy:!1,underBox:!1}:{inCopy:!0,nestedCopy:r.nested,underBox:r.underBox}}function he(e,t,r){if(t?.type!==y)return[];const n=z(e,t.props?.id);if(!n){const l=x(g(t.props))?.fields,s=l?.length?l.map(d=>({...d})):G(t.props),c=(a().get(y)?.fields??[]).filter(d=>d.everySource&&!s.some(p=>p.key===d.key)),u=[...s,...c];return r?u.filter(d=>(d.kind??"text")===r):u}const o=Y(t.props,n.type),i=o&&L(n,"list").find(l=>l.key===o)?.fields||[];return r?i.filter(l=>(l.kind??"text")===r):i}function Ae(e,t){return{[f]:"",[T]:e.map(r=>({...r})),[R]:t.map(r=>({...r}))}}function G(e,t){const r=e?.[R];if(!Array.isArray(r))return[];const n=r.flatMap(o=>{if(!o||typeof o!="object")return[];const{key:i,label:l,kind:s,multiline:c}=o;if(typeof i!="string"||!i||typeof l!="string")return[];const u=s==="image"||s==="link"||s==="colour"?s:void 0;return[{key:i,label:l,...u?{kind:u}:{},...c===!0?{multiline:!0}:{}}]});return t?n.filter(o=>(o.kind??"text")===t):n}export{U as BOX_HIDE_WHEN_ROW_EMPTY,R as CARD_LIST_FIELDS,W as CARD_LIST_ITEM_BLOCKS,T as CARD_LIST_ROWS,y as CARD_LIST_TYPE,f as CARD_ROW_FIELD_PROP,v as CARD_ROW_LINK_PROP,B as CARD_TEMPLATE_BLOCKS,ce as CARD_TEMPLATE_LABEL,D as CARD_TEMPLATE_SLOT,Re as ROW_BOUND_PROPS,$ as ROW_PART_BY_WORDS,Ce as cardCopyPlace,ge as cardKeyOf,he as cardListFieldsOf,de as cardListItemSlot,Ae as cardListProps,Y as cardListShows,we as cardRow,me as cardTemplateBlocks,_e as cardTemplateCardOwner,Q as cardTemplateField,j as cardTemplateFields,L as cardTemplateFieldsOf,xe as cardTemplateLinesBetween,z as cardTemplateOwner,ue as cardTemplateSlot,be as cardTemplateTypedRows,ye as cardTemplatesNameBlocks,H as defaultListField,K as hasCardTemplate,ke as isCardTemplateBlock,m as namedRowField,fe as registerCardTemplates,q as rowBound,V as rowFieldOf,X as rowFieldText,Oe as rowFilledProps,Te as rowNextPicture,Le as rowPartByKey,Be as templateBoxIsEmpty,pe as templateOnInsert,N as templateOnRead};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type GalleryCardRatio } from "./gallery-card-layout.js";
|
|
1
2
|
export declare const GALLERY_COLUMNS = 12;
|
|
2
3
|
export declare const GALLERY_COLUMNS_PHONE = 6;
|
|
3
4
|
export declare const GALLERY_PHONE_BREAKPOINT = 800;
|
|
@@ -7,9 +8,10 @@ export interface GalleryLayout {
|
|
|
7
8
|
readonly desktop: readonly GalleryCell[];
|
|
8
9
|
readonly phone: readonly GalleryCell[];
|
|
9
10
|
readonly across: 2 | 3 | 4 | 6;
|
|
10
|
-
readonly acrossPhone: 2 | 3 | 6;
|
|
11
|
+
readonly acrossPhone: 1 | 2 | 3 | 6;
|
|
11
12
|
readonly lead?: readonly GalleryCell[];
|
|
12
13
|
readonly leadPhone?: readonly GalleryCell[];
|
|
14
|
+
readonly ratio?: GalleryCardRatio;
|
|
13
15
|
}
|
|
14
16
|
export declare const GALLERY_LAYOUTS: {
|
|
15
17
|
readonly twoAcross: {
|
|
@@ -154,6 +156,15 @@ export declare const GALLERY_LAYOUTS: {
|
|
|
154
156
|
readonly leadPhone: readonly [readonly [3, 1], readonly [3, 1]];
|
|
155
157
|
readonly phone: readonly [readonly [2, 1], readonly [2, 1], readonly [2, 1]];
|
|
156
158
|
};
|
|
159
|
+
readonly twoThenThreesPhoto: {
|
|
160
|
+
readonly label: "Two, then threes · photo";
|
|
161
|
+
readonly across: 3;
|
|
162
|
+
readonly acrossPhone: 1;
|
|
163
|
+
readonly lead: readonly [readonly [6, 1], readonly [6, 1]];
|
|
164
|
+
readonly desktop: readonly [readonly [4, 1], readonly [4, 1], readonly [4, 1]];
|
|
165
|
+
readonly phone: readonly [readonly [6, 1]];
|
|
166
|
+
readonly ratio: "landscape";
|
|
167
|
+
};
|
|
157
168
|
};
|
|
158
169
|
export type GalleryLayoutKey = keyof typeof GALLERY_LAYOUTS;
|
|
159
170
|
export declare const GALLERY_LAYOUT_KEYS: GalleryLayoutKey[];
|
|
@@ -161,6 +172,7 @@ export declare const GALLERY_ACROSS_BUCKETS: readonly (2 | 3 | 4 | 6)[];
|
|
|
161
172
|
export declare function galleryChoices(across: number | null, chosen: string): GalleryLayoutKey[];
|
|
162
173
|
export declare function resolveGalleryLayout(value: unknown): GalleryLayout | null;
|
|
163
174
|
export declare function galleryTailSpan(layout: GalleryLayout, phone: boolean): number;
|
|
175
|
+
export declare function galleryLayoutRatio(layout: GalleryLayout): readonly [number, number] | null;
|
|
164
176
|
export declare function galleryPictureCells(layout: GalleryLayout): readonly GalleryCell[];
|
|
165
177
|
export declare const GALLERY_LAYOUT_CLASS_PREFIX = "sf-wall--";
|
|
166
178
|
export declare function galleryLayoutClass(key: GalleryLayoutKey): string;
|