PageSourceSearch

https://code.org/_next/static/chunks/c44f3486.2d1c9fd2979abc1f.js

js code.org collected 2026-09-24 08:24:18 UTC 88,787 bytes, 5 lines download raw bytes

1"use strict";
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1866149d-13a5-5f85-b3d1-c023f181e400")}catch(e){}}();
3(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2295],{98035:(e,t,n)=>{n.r(t),n.d(t,{default:()=>nj});var i,r,a,o,s,l,d,c,u,p,f,y,m,g=n(96282),h=n(7620),b=n(20880),E=n(74281),v=n(17085),z=n(4963),x=n(29906),I=n(859),w=n(36858),k=n(67048),T=n(44902);n(69708),(0,g.A)("html,\nbody {\n  margin: 0;\n  padding: 0;\n}\n\n/*\n * All of these variables are tokens from Forma-36 and should not be adjusted as these\n * are global variables that may affect multiple places.\n * As our customers may use other design libraries, we try to avoid overlapping global\n * variables by always using the prefix `--exp-builder-` inside this SDK.\n */\n\n:root {\n  /* Color tokens from Forma 36: https://f36.contentful.com/tokens/color-system */\n  --exp-builder-blue100: #e8f5ff;\n  --exp-builder-blue200: #ceecff;\n  --exp-builder-blue300: #98cbff;\n  --exp-builder-blue400: #40a0ff;\n  --exp-builder-blue500: #036fe3;\n  --exp-builder-blue600: #0059c8;\n  --exp-builder-blue700: #0041ab;\n  --exp-builder-blue800: #003298;\n  --exp-builder-blue900: #002a8e;\n  --exp-builder-gray100: #f7f9fa;\n  --exp-builder-gray200: #e7ebee;\n  --exp-builder-gray300: #cfd9e0;\n  --exp-builder-gray400: #aec1cc;\n  --exp-builder-gray500: #67728a;\n  --exp-builder-gray600: #5a657c;\n  --exp-builder-gray700: #414d63;\n  --exp-builder-gray800: #1b273a;\n  --exp-builder-gray900: #111b2b;\n  --exp-builder-purple600: #6c3ecf;\n  --exp-builder-red200: #ffe0e0;\n  --exp-builder-red800: #7f0010;\n  --exp-builder-color-white: #ffffff;\n  --exp-builder-glow-primary: 0px 0px 0px 3px #e8f5ff;\n\n  /* RGB colors for applying opacity */\n  --exp-builder-blue100-rgb: 232, 245, 255;\n  --exp-builder-blue300-rgb: 152, 203, 255;\n\n  /* Spacing tokens from Forma 36: https://f36.contentful.com/tokens/spacing */\n  --exp-builder-spacing-s: 0.75rem;\n  --exp-builder-spacing-2xs: 0.25rem;\n\n  /* Typography tokens from Forma 36: https://f36.contentful.com/tokens/typography */\n  --exp-builder-font-size-l: 1rem;\n  --exp-builder-font-size-m: 0.875rem;\n  --exp-builder-font-stack-primary: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial,\n    sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;\n  --exp-builder-line-height-condensed: 1.25;\n}\n");let S={RequestEditorMode:"requestEditorMode",RequestReadOnlyMode:"requestReadOnlyMode",ExperienceUpdated:"componentTreeUpdated",ComponentDraggingChanged:"componentDraggingChanged",ComponentDragCanceled:"componentDragCanceled",ComponentDragStarted:"componentDragStarted",ComponentDragEnded:"componentDragEnded",ComponentMoveEnded:"componentMoveEnded",CanvasResized:"canvasResized",SelectComponent:"selectComponent",HoverComponent:"hoverComponent",UpdatedEntity:"updatedEntity",AssembliesAdded:"assembliesAdded",AssembliesRegistered:"assembliesRegistered",MouseMove:"mouseMove",RequestedEntities:"REQUESTED_ENTITIES"};!function(e){e.READ_ONLY="readOnlyMode",e.EDITOR="editorMode",e.NONE="none"}(i||(i={}));let j={section:{id:"contentful-section",name:"Section"},container:{id:"contentful-container",name:"Container"},columns:{id:"contentful-columns",name:"Columns"},singleColumn:{id:"contentful-single-column",name:"Column"},button:{id:"contentful-button",name:"Button"},heading:{id:"contentful-heading",name:"Heading"},image:{id:"contentful-image",name:"Image"},richText:{id:"contentful-richText",name:"Rich Text"},text:{id:"contentful-text",name:"Text"},divider:{id:"contentful-divider",name:"Divider"},carousel:{id:"contentful-carousel",name:"Carousel"}};!function(e){e.REQUEST_ENTITIES="REQUEST_ENTITIES",e.REQUESTED_ENTITIES="REQUESTED_ENTITIES"}(r||(r={}));let C=["jpg","png","webp","gif","avif"],N=new Set([j.section.id,j.columns.id,j.container.id,j.singleColumn.id]),V=new Set(Object.values(j).map(e=>e.id)),$=e=>N.has(e??""),M={cfVerticalAlignment:{validations:{in:[{value:"start",displayName:"Align left"},{value:"center",displayName:"Align center"},{value:"end",displayName:"Align right"},{value:"stretch",displayName:"Stretch"}]},type:"Text",group:"style",defaultValue:"center",displayName:"Vertical alignment"},cfHorizontalAlignment:{validations:{in:[{value:"start",displayName:"Align top"},{value:"center",displayName:"Align center"},{value:"end",displayName:"Align bottom"},{value:"stretch",displayName:"Stretch"}]},type:"Text",group:"style",defaultValue:"center",displayName:"Horizontal alignment"},cfVisibility:{displayName:"Visibility toggle",type:"Boolean",group:"style",defaultValue:!0},cfMargin:{displayName:"Margin",type:"Text",group:"style",defaultValue:"0 0 0 0"},cfPadding:{displayName:"Padding",type:"Text",group:"style",defaultValue:"0 0 0 0"}
3,cfBackgroundColor:{displayName:"Background color",type:"Text",group:"style",defaultValue:"rgba(0, 0, 0, 0)"},cfWidth:{displayName:"Width",type:"Text",group:"style",defaultValue:"100%"},cfHeight:{displayName:"Height",type:"Text",group:"style",defaultValue:"fit-content"},cfMaxWidth:{displayName:"Max width",type:"Text",group:"style",defaultValue:"none"},cfFlexDirection:{displayName:"Direction",type:"Text",group:"style",defaultValue:"column"},cfFlexReverse:{displayName:"Reverse Direction",type:"Boolean",group:"style",defaultValue:!1},cfFlexWrap:{displayName:"Wrap objects",type:"Text",group:"style",defaultValue:"nowrap"},cfBorder:{displayName:"Border",type:"Text",group:"style",defaultValue:"0px solid rgba(0, 0, 0, 0)"},cfGap:{displayName:"Gap",type:"Text",group:"style",defaultValue:"0px"},cfHyperlink:{displayName:"URL",type:"Hyperlink",defaultValue:"",validations:{format:"URL",bindingSourceType:["entry","experience","manual"]}},cfOpenInNewTab:{displayName:"URL behaviour",type:"Boolean",defaultValue:!1,description:"Open in new tab"}},O={cfFontSize:{displayName:"Font Size",type:"Text",group:"style",defaultValue:"16px"},cfFontWeight:{validations:{in:[{value:"400",displayName:"Normal"},{value:"500",displayName:"Medium"},{value:"600",displayName:"Semi Bold"}]},displayName:"Font Weight",type:"Text",group:"style",defaultValue:"400"},cfImageAsset:{displayName:"Image",type:"Media",validations:{bindingSourceType:["asset","entry","manual"]}},cfImageOptions:{displayName:"Image options",type:"Object",group:"style",defaultValue:{width:"100%",height:"100%",targetSize:"unset"}},cfBackgroundColor:{displayName:"Background color",type:"Text",group:"style",defaultValue:"rgba(0, 0, 0, 0)"},cfBackgroundImageUrl:{displayName:"Background image",type:"Media",validations:{bindingSourceType:["asset","entry","manual"]}},cfBackgroundImageOptions:{displayName:"Background image options",type:"Object",group:"style",defaultValue:{scaling:"fill",alignment:"left top",targetSize:"2000px"}},cfBorderRadius:{displayName:"Border Radius",type:"Text",group:"style",defaultValue:"0px"},cfLineHeight:{displayName:"Line Height",type:"Text",group:"style",defaultValue:"20px"},cfLetterSpacing:{displayName:"Letter Spacing",type:"Text",group:"style",defaultValue:"0px"},cfTextColor:{displayName:"Text Color",type:"Text",group:"style",defaultValue:"rgba(0, 0, 0, 1)"},cfTextAlign:{validations:{in:[{value:"start",displayName:"Align start"},{value:"center",displayName:"Align center"},{value:"end",displayName:"Align end"}]},displayName:"Text Align",type:"Text",group:"style",defaultValue:"start"},cfTextTransform:{validations:{in:[{value:"none",displayName:"Normal"},{value:"capitalize",displayName:"Capitalize"},{value:"uppercase",displayName:"Uppercase"},{value:"lowercase",displayName:"Lowercase"}]},displayName:"Text Transform",type:"Text",group:"style",defaultValue:"none"},cfTextBold:{displayName:"Bold",type:"Boolean",group:"style",defaultValue:!1},cfTextItalic:{displayName:"Italic",type:"Boolean",group:"style",defaultValue:!1},cfTextUnderline:{displayName:"Underline",type:"Boolean",group:"style",defaultValue:!1}},A={},R=/\${(\w.+?)}/g,D=(e,t)=>{let[n,i]=e.replace(R,"$1").split("."),r=A[n];if(r&&r[i]){if("cfBorder"===t){let{width:e,style:t,color:n}=r[i];return`${e} ${t} ${n}`}return r[i]}return M[t]?M[t].defaultValue:O[t]?O[t].defaultValue:"0px"},B=b.z.literal("2023-09-28");b.z.union([b.z.literal("2023-08-23"),b.z.literal("2023-07-26"),b.z.literal("2023-06-27")]);let L=b.z.enum(["Text","RichText","Number","Date","Boolean","Location","Media","Object","Hyperlink","Array","Link"]),F=b.z.string().regex(/^[a-zA-Z0-9-_]{1,32}$/,{message:"Property needs to match: /^[a-zA-Z0-9-_]{1,32}$/"}),_=b.z.union([b.z.string(),b.z.boolean(),b.z.number(),b.z.record(b.z.any(),b.z.any()),b.z.undefined()]),U=b.z.array(b.z.object({sys:b.z.object({type:b.z.literal("Link"),id:b.z.string(),linkType:b.z.literal("Entry")})})),Z=b.z.string().regex(/^[a-zA-Z0-9-_]{1,21}$/,{message:"Does not match /^[a-zA-Z0-9-_]{1,21}$/"}),P=b.z.record(Z,b.z.object({sys:b.z.object({type:b.z.literal("Link"),id:b.z.string(),linkType:b.z.enum(["Entry","Asset"])})})),q=b.z.record(Z,b.z.object({value:_})),W=b.z.string().regex(/^[a-zA-Z0-9-_]{1,54}$/,{message:"Does not match /^[a-zA-Z0-9-_]{1,54}$/"}),H=b.z.string().regex(/^[a-zA-Z0-9]{1,8}$/,{message:"Does not match /^[a-zA-Z0-9]{1,8}$/"}),Q=b.z.record(b.z.lazy(()=>_)),J=b.z.array(b.z.enum(["entry","asset","manual","experience"])).nonempty(),K=b.z.object({type:b.z.literal("DesignValue"),valuesByBreakpoint:Q}).strict(),Y=b.z.object({type:b.z.literal("BoundValue"),path:b.z.string()}).strict(),G=b.z.object({type:b.z.literal("HyperlinkValue"),linkTargetKey:b.z.string(),overrides:b.z.object({}).optional()}).strict(),X=b.z.object({type:b.z.literal("UnboundValue"),key:b.z.string()}).strict(),ee=b.z.object({type:b.z.literal("ComponentValue"),key:b.z.string()}).strict(),et=b.z.object({type:b.z.literal("NoValue")}
3).strict(),en=b.z.discriminatedUnion("type",[K,Y,X,G,ee,et]),ei=b.z.object({type:b.z.literal("BoundValue"),path:b.z.string()}),er=b.z.record(W,ei),ea=/^\*$|^[<>][0-9]+px$/,eo=b.z.object({id:W,query:b.z.string().refine(e=>ea.test(e)),previewSize:b.z.string().optional(),displayName:b.z.string(),displayIcon:b.z.enum(["desktop","tablet","mobile"]).optional()}).strict(),es=b.z.object({id:H.optional(),definitionId:F,prebindingId:b.z.string().optional(),displayName:b.z.string().optional(),slotId:b.z.string().optional(),variables:b.z.record(W,en),parameters:er.optional()}),el=b.z.object({displayName:b.z.string().optional(),type:L,description:b.z.string().optional(),group:b.z.string().optional(),defaultValue:_.or(en).optional(),validations:b.z.object({bindingSourceType:J.optional(),required:b.z.boolean().optional(),format:b.z.literal("URL").optional(),in:b.z.array(b.z.object({value:b.z.union([b.z.string(),b.z.number()]),displayName:b.z.string().optional()})).optional()}).optional()}),ed=es.extend({children:b.z.lazy(()=>ed.array())}).superRefine(({id:e,prebindingId:t,parameters:n},i)=>{t&&!n&&i.addIssue({code:b.z.ZodIssueCode.custom,message:`Found "prebindingId" but no "parameters" for node with i
3d: "${e}"`})}),ec=b.z.object({breakpoints:b.z.array(eo).superRefine((e,t)=>{if(!e.length||"*"!==e[0].query)return void t.addIssue({code:b.z.ZodIssueCode.custom,message:'The first breakpoint should include the following attributes: { "query": "*" }'});if(1===e.length)return;let n=e.map(e=>e.id);if(new Set(n).size!==n.length)return void t.addIssue({code:b.z.ZodIssueCode.custom,message:"Breakpoint IDs must be unique"});let i=e.slice(1),r=i[0].query.startsWith(">"),a=i[0].query.startsWith("<");r?(i.every(({query:e})=>e.startsWith(">"))||t.addIssue({code:b.z.ZodIssueCode.custom,message:'Breakpoint queries must be in the format ">[size]px" for mobile-first strategy'}),i.map(e=>parseInt(e.query.replace(/px|<|>/,""))).every((e,t,n)=>0===t||e>n[t-1])||t.addIssue({code:b.z.ZodIssueCode.custom,message:"When using a mobile-first strategy, all breakpoints must have strictly increasing pixel values"})):a?(i.every(({query:e})=>e.startsWith("<"))||t.addIssue({code:b.z.ZodIssueCode.custom,message:'Breakpoint queries must be in the format "<[size]px" for desktop-first strategy'}),i.map(e=>parseInt(e.query.replace(/px|<|>/,""))).every((e,t,n)=>0===t||e<n[t-1])||t.addIssue({code:b.z.ZodIssueCode.custom,message:"When using a desktop-first strategy, all breakpoints must have strictly decreasing pixel values"})):r||a||t.addIssue({code:b.z.ZodIssueCode.custom,message:"You may only use a mobile-first or desktop-first strategy for breakpoints using '<' or '>' queries"})}),children:b.z.array(ed),schemaVersion:B}).strict(),eu=e=>b.z.record(b.z.string(),e);b.z.object({componentTree:eu(ec),dataSource:eu(P),unboundValues:eu(q),usedComponents:eu(U).optional()});let ep=b.z.object({parameterId:W,type:b.z.literal("ContentTypeMapping"),pathsByContentType:b.z.record(b.z.string(),b.z.object({path:b.z.string()})).superRefine((e,t)=>{let n=t.path[t.path.length-2];Object.keys(e).length>200&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`Too many paths defined for variable mapping with id "${n}", maximum allowed is 200`})})}),ef=b.z.object({nodeId:W,parameterId:W,prebindingId:W}).strict(),ey=b.z.object({defaultSource:b.z.strictObject({type:b.z.enum(["Entry"]),contentTypeId:b.z.string(),link:b.z.strictObject({sys:b.z.strictObject({type:b.z.literal("Link"),id:b.z.string(),linkType:b.z.enum(["Entry"])})})}).optional(),contentTypes:b.z.array(b.z.string()).min(1),passToNodes:b.z.array(ef).max(1,'At most one "passToNodes" element is allowed per parameter definition.')}),em=b.z.record(W,ey),eg=b.z.record(W,ep),eh=b.z.record(b.z.string().regex(/^[a-zA-Z0-9-_]{1,54}$/),el),eb=b.z.object({id:W,parameterDefinitions:em,variableMappings:eg.optional(),allowedVariableOverrides:b.z.array(b.z.string()).optional()}).strict(),eE=b.z.object({variableDefinitions:eh,thumbnailId:b.z.enum(["columns","columnsPlusRight","imagesSquare","subtitles","rowsPlusBottom","userRectangle","textbox","monitorPlay","article","table","star","heartStraight","frameCorners","rows","dotsThreeOutline","listDashes","checkerBoard","gridFour","slideshow","diamondsFour","cards","textColumns","duplex"]).optional(),category:b.z.string().max(50,"Category must contain at most 50 characters").optional(),prebindingDefinitions:b.z.array(eb).length(1).optional()}).strict().superRefine((e,t)=>{let{variableDefinitions:n,prebindingDefinitions:i}=e;if(!i||0===i.length)return;let{parameterDefinitions:r,variableMappings:a,allowedVariableOverrides:o}=i[0];ev(r,t),ez(a,o,t),ex(a,o,n,t),eI(a,r,t)});b.z.object({componentTree:eu(ec),dataSource:eu(P),unboundValues:eu(q),usedComponents:eu(U).optional(),componentSettings:eu(eE)}).superRefine((e,t)=>{let{componentTree:n,componentSettings:i}=e,r=Object.values(n)[0],a=Object.values(i)[0];a&&r&&ew(r.children||[],a||{},t)});let ev=(e,t)=>
3{Object.values(e).filter(e=>!(e.passToNodes&&e.passToNodes.length>0)).length>1&&t.addIssue({code:b.z.ZodIssueCode.custom,message:"Only one native parameter definition (parameter definition without passToNodes) is allowed per prebinding definition."})},ez=(e,t,n)=>{let i=Object.keys(e||{}),r=new Set(t||[]),a=i.filter(e=>r.has(e));a.length>0&&n.addIssue({code:b.z.ZodIssueCode.custom,message:`Found both variable mapping and allowed override for the following keys: ${a.map(e=>`"${e}"`).join(", ")}.`})},ex=(e,t,n,i)=>{let r=Object.entries(n).filter(([e,t])=>"style"!==t.group).map(([e])=>e),a=[...Object.keys(e||{}),...t||[]].filter(e=>!r.includes(e));a.length>0&&i.addIssue({code:b.z.ZodIssueCode.custom,message:`The following variable mappings or overrides are missing from the variable definitions: ${a.map(e=>`"${e}"`).join(", ")}.`})},eI=(e,t,n)=>{let i=Object.keys(t||{});for(let[t,r]of Object.entries(e||{}))i.includes(r.parameterId)||n.addIssue({code:b.z.ZodIssueCode.custom,message:`The variable mapping with id "${t}" references a non-existing parameterId "${r.parameterId}".`})},ew=(e,t,n)=>{if(!t.prebindingDefinitions||0===t.prebindingDefinitions.length)return;let{parameterDefinitions:i}=t.prebindingDefinitions[0],r=new Set;for(let e of Object.values(i||{}))e.passToNodes?.forEach(e=>r.add(e.nodeId));if(!function(e,t){let n=e=>{let i=[...e.children];for(let r of(t(e),i))n(r)};if(Array.isArray(e))for(let t of e)n(t);else n(e)}(e,e=>{e.id&&r.has(e.id)&&r.delete(e.id)}),r.size>0){let e=Array.from(r).map(e=>`"${e}"`).join(", ");n.addIssue({code:b.z.ZodIssueCode.custom,message:`The following node IDs referenced in passToNodes are not present in the component tree: ${e}.`})}};b.z.object({id:F,name:b.z.string(),category:b.z.string().optional(),thumbnailUrl:b.z.string().optional(),thumbnailId:b.z.string().optional(),hyperlinkPattern:b.z.string().optional(),children:b.z.boolean().optional(),slots:b.z.record(F,b.z.object({displayName:b.z.string().optional()})).optional(),builtInStyles:b.z.array(b.z.string()).optional(),tooltip:b.z.object({imageUrl:b.z.string().optional(),description:b.z.string()}).optional(),variables:b.z.record(F,el.extend({defaultValue:_.optional()}).superRefine((e,t)=>{switch(e.type){case"Array":void 0!==e.defaultValue&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`defaultValue is not supported for "Array" type for ${t.path.join(".")}`,fatal:!1});break;case"Boolean":void 0!==e.defaultValue&&"boolean"!=typeof e.defaultValue&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`defaultValue must be a boolean when type is "Boolean" for ${t.path.join(".")}, got ${typeof e.defaultValue} instead`,fatal:!1});break;case"Date":void 0!==e.defaultValue&&"string"!=typeof e.defaultValue&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`defaultValue must be a string when type is "Date" for ${t.path.join(".")}, got ${typeof e.defaultValue} instead`,fatal:!1});break;case"Hyperlink":void 0!==e.defaultValue&&"string"!=typeof e.defaultValue&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`defaultValue must be a string when type is "Hyperlink" for ${t.path.join(".")}, got ${typeof e.defaultValue} instead`,fatal:!1});break;case"Link":void 0!==e.defaultValue&&"object"!=typeof e.defaultValue&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`defaultValue is not supported for "Link" type for ${t.path.join(".")}`,fatal:!1});break;case"Location":void 0!==e.defaultValue&&"object"!=typeof e.defaultValue&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`defaultValue must be an object when type is "Location" for ${t.path.join(".")}, got ${typeof e.defaultValue} instead`,fatal:!1});break;case"Media":void 0!==e.defaultValue&&"string"!=typeof e.defaultValue&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`defaultValue must be a string when type is "Media" for ${t.path.join(".")}, got ${typeof e.defaultValue} instead`,fatal:!1});break;case"Number":void 0!==e.defaultValue&&"number"!=typeof e.defaultValue&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`defaultValue must be a number when type is "Number" for ${t.path.join(".")}, got ${typeof e.defaultValue} instead`,fatal:!1});break;case"Object":void 0!==e.defaultValue&&"object"!=typeof e.defaultValue&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`defaultValue must be an object when type is "Object" for ${t.path.join(".")}, got ${typeof e.defaultValue} instead`,fatal:!1});break;case"RichText":void 0!==e.defaultValue&&"object"!=typeof e.defaultValue&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`defaultValue must be an object when type is "RichText" for ${t.path.join(".")}, got ${typeof e.defaultValue} instead`,fatal:!1});break;case"Text":void 0!==e.defaultValue&&"string"!=typeof e.defaultValue&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`defaultValue must be a string when type is "Text" for ${t.path.join(".")}, got ${typeof e.defaultValue} instead`,fatal:!1})}}))}).superRefine((e,t)=>
3{!0===e.children&&(e.variables.children||e.slots?.children)&&t.addIssue({code:b.z.ZodIssueCode.custom,message:"Cannot activate 'children: true' and name a variable or slot 'children' at the same time",fatal:!1}),e.variables&&e.slots&&Object.keys(e.variables).forEach(n=>{e.slots[n]&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`Variable and slot cannot have the same name: ${n}`,fatal:!1})})}),function(e){e.Type="type",e.Required="required",e.Unexpected="unexpected",e.Regex="regex",e.In="in",e.Size="size",e.Custom="custom"}(a||(a={}));let ek={},eT=/(<|>)(\d{1,})(px|cm|mm|in|pt|pc)$/,eS=e=>{let t={};return[e.map(e=>{let n=(({query:e})=>{if("*"===e)return;let t=e.match(eT);if(!t)return;let[,n,i,r]=t;if("<"===n){let e=Number(i)-1;return`(max-width: ${e}${r})`}if(">"===n){let e=Number(i)+1;return`(min-width: ${e}${r})`}})(e);if(!n||"undefined"==typeof window)return;let i=window.matchMedia(n);return t[e.id]=i.matches,{id:e.id,signal:i}}).filter(e=>!!e),t]},ej=["cfMargin","cfPadding","cfGap","cfWidth","cfHeight","cfBackgroundColor","cfBorder","cfBorderRadius","cfFontSize","cfLineHeight","cfLetterSpacing","cfTextColor","cfMaxWidth"],eC=e=>null!=e&&""!==e;function eN(e,t){if(!e||!t)return e??t;let n={...e.valuesByBreakpoint};for(let[e,i]of Object.entries(t.valuesByBreakpoint))eC(i)&&(n[e]=i);return{type:"DesignValue",valuesByBreakpoint:n}}let eV="cf_debug",e$=()=>{try{if("undefined"==typeof localStorage||null===localStorage)return!1;let e="cf_test_local_storage";if(localStorage.setItem(e,"yes"),"yes"===localStorage.getItem(e))return localStorage.removeItem(e),!0;return!1}catch(e){return!1}},eM=["error","warn","log","debug"],eO=class e{constructor(){if(this.activeLevel="warn",this.error=this.logger("error"),this.warn=this.logger("warn"),this.log=this.logger("log"),this.debug=this.logger("debug"),!e$())return;"true"===localStorage.getItem(eV)&&(this.activeLevel="debug")}static getInstance(){return null===this.instance&&(this.instance=new e),this.instance}getActiveLevel(){return this.activeLevel}setActiveLevel(e){this.activeLevel=e,e$()&&("debug"===this.activeLevel||"log"===this.activeLevel?localStorage.setItem(eV,"true"):localStorage.removeItem(eV))}logger(e){return(...t)=>{let n=eM.indexOf(e);n<=eM.indexOf(this.activeLevel)&&console[e](...t)}}};eO.instance=null;let eA=eO.getInstance(),eR=(e,t)=>({top:Math.min(e.top,t.top),right:Math.max(e.right,t.right),bottom:Math.max(e.bottom,t.bottom),left:Math.min(e.left,t.left)}),eD=e=>{let t=e.getBoundingClientRect();if(0===e.children.length||0!==t.width||0!==t.height)return t;let n=[];for(let t of e.children){let e=eD(t);if(0!==e.width||0!==e.height){let{top:t,right:i,bottom:r,left:a}=e;n.push({top:t,right:i,bottom:r,left:a})}}if(0===n.length)return t;let{top:i,right:r,bottom:a,left:o}=n.reduce(eR);return DOMRect.fromRect({x:o,y:i,height:a-i,width:r-o})};function eB(e){return null!==e&&"object"==typeof e&&!!e.sys?.id&&e.sys?.type==="Link"&&!!e.sys?.linkType}let eL=e=>"BoundValue"===e.type&&"boolean"==typeof e.isPrebound&&!!e.pathsByContentType,eF=e=>{let t=eZ(e);return!!t&&t.fields.length>1},e_=e=>!!e?.path&&"BoundValue"===e.type&&!!eL(e)&&(!!eF(e.path)||Object.values(e.pathsByContentType||{}).some(e=>eF(e.path))),eU=(e,t)=>{if(!eL(e))return;let[,n]=e.path.split("/");if(!n)return;let i=t(n);if(i?.sys.type!=="Entry")return;let r=i.sys.contentType.sys.id;if(e.pathsByContentType?.[r])return e.pathsByContentType?.[r]?.path},eZ=e=>{let t=eP(e.split("/"),{startNextChunkOnElementEqualTo:"fields"});if(t.length<=1||2===t.length)return null;let[n,...i]=t;return/^\/([^/^~]+)$/.test(n.join("/"))&&i.every(e=>/^fields\/[^/^~]+\/~locale$/.test(e.join("/")))?{key:n[1],fields:i.map(e=>e[1])}:null},eP=(e,{startNextChunkOnElementEqualTo:t})=>{let n=[],i=[],r=e=>e===t;for(let t=0;t<e.length;t++){let a=0===t,o=e[t];a?i=[o]:r(o)?(n.push(i),i=[o]):i.push(o)}return n.push(i),n.filter(e=>e.length>0)},eq=["cfImageAsset"],eW=["cfVisibility","cfHorizontalAlignment","cfVerticalAlignment","cfMargin","cfPadding","cfBackgroundColor","cfWidth","cfMaxWidth","cfHeight","cfImageAsset","cfImageOptions","cfBackgroundImageUrl","cfBackgroun
3dImageOptions","cfFlexDirection","cfFlexWrap","cfFlexReverse","cfBorder","cfBorderRadius","cfGap","cfColumnSpan","cfColumnSpanLock","cfColumns","cfFontSize","cfFontWeight","cfLineHeight","cfLetterSpacing","cfTextColor","cfTextAlign","cfTextTransform","cfTextBold","cfTextItalic","cfTextUnderline"].filter(e=>!eq.includes(e)),eH=["cfSsrClassName","cfWrapColumns","cfWrapColumnsCount"],eQ=e=>{let t=e.replace(/[A-Z]/g,e=>"-"+e.toLowerCase());return t.replace(/\d+$/,"")};function eJ(e,t,n,i){e.startsWith("//")&&(e="https:"+e);let r=new URLSearchParams;t&&r.append("w",t.toString()),n&&n>0&&n<100&&r.append("q",n.toString()),i&&r.append("fm",i);let a=r.toString();return`${e}${a?"?"+a:""}`}function eK(e,t,n){if(!e.details.image)throw Error("No image in file asset to transform");if(t<0||t>100)throw Error("Quality must be between 0 and 100");if(n&&!C.includes(n))throw Error(`Format must be one of ${C.join(", ")}`);return!0}function eY(e,t){if(!t.length)return e;try{let[n,...i]=t;return eY(e[n],i)}catch(e){return}}let eG=(e,t)=>{let n=eY(e,t.split("/").slice(2,-1));return n&&"object"==typeof n&&n.url?n.url:n},eX=(e,t)=>{if(e){if(e?.data?.target?.sys?.type==="Link"){let n=t.getEntityFromLink(e.data.target);n&&(e.data.target=n)}"content"in e&&Array.isArray(e.content)&&e.content.forEach(e=>eX(e,t))}},e0=e=>null!==e&&"object"==typeof e&&"sys"in e&&e.sys?.type==="Entry",e1=e=>null!==e&&"object"==typeof e&&"sys"in e&&e.sys?.type==="Asset",e2=e=>void 0!==e,e3=(e,t,n,i,r,a,o)=>{let s=t.getEntryOrAsset(n,o);if(s)switch(a){case"Media":if("Entry"===s.sys.type)return eG(s,o);return((e,t,n,i,r)=>{if(!eF(r)&&!((e,t)=>{let n=e.split("/");return n.length<2?(eA.warn(`[experiences-core::pathSchema] Attempting to check whether last named segment of the path (${e}) equals to '${t}', but the path doesn't have enough segments.`),!1):n[n.length-2]===t})(r,"file"))return eG(e,r);if("cfImageAsset"===i){let i="cfImageOptions",r=n(t[i]?.type==="DesignValue"?t[i].valuesByBreakpoint:{});if(!r)return void eA.error(`[experiences-core::transformMedia] Error transforming image asset: Required variable [${i}] missing from component definition`);try{return(({file:e,sizes:t,loading:n,quality:i="100%",format:r})=>{let a=Number(i.replace("%",""));eK(e,a,r);let o=e.url,s=Math.min(e.details.image.width,4e3),l=Math.max(2,Math.ceil(s/500)),d=Array.from({length:l},(e,t)=>Math.ceil(s/l*(t+1))),c=t?d.map(e=>`${eJ(o,e,a,r)} ${e}w`):[],u=e.details.image.width;return u>4e3&&c.push(`${eJ(o,void 0,a,r)} ${u}w`),{url:eJ(o,e.details.image.width>2e3?2e3:void 0,a,r),srcSet:c,sizes:t,file:e,loading:n}})({file:e.fields.file,loading:r.loading,sizes:r.targetSize,quality:r.quality,format:r.format})}catch(e){eA.error("[experiences-core::transformMedia] Error transforming image asset",e)}return}if("cfBackgroundImageUrl"===i){let i=n(t.cfWidth?.type==="DesignValue"?t.cfWidth.valuesByBreakpoint:{},"cfWidth")||"100%",r="cfBackgroundImageOptions",a=n(t[r]?.type==="DesignValue"?t[r].valuesByBreakpoint:{});if(!a)return void eA.error(`[experiences-core::transformMedia] Error transforming image asset: Required variable [${r}] missing from component definition`);try{let t=e.fields.file?.details,n=t?.image?.width||0,r=function(e){let t=e.match(/^(\d+(\.\d+)?)(px|em|rem)$/);return t?{value:parseFloat(t[1]),unit:t[3]}:null}(a.targetSize),o=r?function(e){switch(e.unit){case"px":default:return e.value;case"em":case"rem":return 16*e.value}}(r):n;return o<n&&(i=`${o}px`),((e,t,n="100%",i)=>{let r=Number(n.replace("%",""));eK(e,r,i),eK(e,r,i);let a=e.url,{width1x:o,width2x:s}=function(e,t){let n=0,i=0,r=t.details.image.width;return i=Math.min(2*(n=e.endsWith("px")?Math.min(Number(e.replace("px","")),r):Math.min(2e3,r)),r),{width1x:n,width2x:i}}(t,e),l=eJ(a,o,r,i),d=eJ(a,s,r,i),c=[`url(${l}) 1x`,`url(${d}) 2x`];return{url:eJ(a,s,r,i),srcSet:c,file:e}})(e.fields.file,i,a.quality,a.format)}catch(e){eA.error("[experiences-core::transformMedia] Error transforming image asset",e)}}return e.fields.file?.url})(s,e,i,r,o);case"RichText":return((e,t,n)=>{let i=eG(e,n);if("string"==typeof i)return{data:{},content:[{nodeType:z.BLOCKS.PARAGRAPH,data:{},content:[{data:{},nodeType:"text",value:i,marks:[]}]}],nodeType:z.BLOCKS.DOCUMENT};
3if("object"==typeof i&&i.nodeType===z.BLOCKS.DOCUMENT){let e=E(i);return eX(e,t),e}})(s,t,o);case"Array":return function(e,t,n){if("Asset"===e.sys.type)return e;let i=t.split("/").slice(2,-1),r=eY(e,i);if(!Array.isArray(r))return void eA.warn(`[experiences-core::getArrayValue] A field '${i}' of an entity was bound to an Array variable. Expected value of that field to be an array, but got: ${JSON.stringify(r)}`,{entity:e});let a=r.map(e=>{if("string"==typeof e)return e;if(e?.sys?.type!=="Link")return void eA.warn(`[experiences-core::getArrayValue] Expected value to be a string or Link, but got: ${JSON.stringify(e)}`);{let t=n.getEntityFromLink(e);if(!t)return;return t}}).filter(e2);return a.length>0?a:void 0}(s,o,t);case"Link":return function(e,t,n){let i;if(e1(e))return e;if(!e0(e))throw Error(`Expected an Entry or Asset, but got: ${JSON.stringify(e)}`);let r=t.split("/").slice(2,-1),a=eY(e,r);if(e1(a)||e0(a))i=a;else{if(a?.sys.type!=="Link")return void eA.warn(`[experiences-core::getResolvedEntryFromLink] When attempting to follow link in field '${r}' of entity, the value is expected to be a link, but got: ${JSON.stringify(a)}`,{entity:e});i=n.getEntityFromLink(a)}if(i)return i}(s,o,t);default:return eG(s,o)}};function e5(e,t){let n=(e,i,r)=>{let a=[...e.children];t(e,i,r);let o=i+1;for(let e of a)o=n(e,o,r+1)+1;return i};n(e,0,0)}class e6 extends Error{constructor(e){super(e)}}let e4=e=>{if(!e.data)throw new e6("Field event.data is missing");if("string"!=typeof e.data)throw new e6(`Field event.data must be a string, instead of '${typeof e.data}'`);if(!(e=>{try{let t=JSON.parse(e);if("object"!=typeof t)return!1;return!0}catch(e){return!1}})(e.data))throw new e6("Field event.data must be a valid JSON object serialized as string");let t=JSON.parse(e.data);if(!t.source)throw new e6("Field eventData.source must be equal to 'composability-app'");if("composability-app"!==t.source)throw new e6(`Field eventData.source must be equal to 'composability-app', instead of '${t.source}'`);let n=Object.values(S);if(!n.includes(t.eventType)&&t.eventType!==r.REQUESTED_ENTITIES)throw new e6(`Field eventData.eventType must be one of the supported values: [${n.join(", ")}]`);return t},e7=(e,t)=>{"undefined"!=typeof window&&(eA.debug(`[experiences-sdk-react::sendMessage] Sending message [${e}]`,{source:"customer-app",eventType:e,payload:t}),window.parent?.postMessage({source:"customer-app",eventType:e,payload:t},"*"))};function e9(e){for(let t of Object.getOwnPropertyNames(e)){let n=e[t];n&&"object"==typeof n&&e9(n)}return Object.freeze(e)}let e8=class{constructor({entities:e,locale:t}){for(let n of(this.entryMap=new Map,this.assetMap=new Map,this.locale=t,e))this.addEntity(n)}get entities(){return[...this.entryMap.values(),...this.assetMap.values()]}updateEntity(e){this.addEntity(e)}getEntryOrAsset(e,t){let n;if(eF(t))return this.getDeepEntry(e,t);if(eB(e)){let t="Entry"===e.sys.linkType?this.entryMap.get(e.sys.id):this.assetMap.get(e.sys.id);if(!t||t.sys.type!==e.sys.linkType)return void eA.warn(`[experiences-core::EntityStoreBase] Experience references unresolved entity: ${JSON.stringify(e)}`);n=t}else if(e1(e)||e0(e))n=e;else throw Error(`[experiences-core::EntityStoreBase] Unexpected object when resolving entity: ${JSON.stringify(e)}`);return n}getValue(e,t){let n=this.getEntity(e.sys.linkType,e.sys.id);return n?eY(n,t):void eA.warn(`Unresolved entity reference: ${e.sys.linkType} with ID ${e.sys.id}`)}getEntityFromLink(e){let t="Entry"===e.sys.linkType?this.entryMap.get(e.sys.id):this.assetMap.get(e.sys.id);return t&&t.sys.type===e.sys.linkType?t:void eA.warn(`[experiences-core::EntityStoreBase] Experience references unresolved entity: ${JSON.stringify(e)}`)}getAssetById(e){let t=this.assetMap.get(e);return t||void eA.warn(`[experiences-core::EntityStoreBase] Asset with ID "${e}" is not found in the store`)}getEntryById(e){let t=this.entryMap.get(e);return t||void eA.warn(`[experiences-core::EntityStoreBase] Entry with ID "${e}" is not found in the store`)}getEntitiesFromMap(e,t){let n=[],i=[];for(let r of t){let t=this.getEntity(e,r);t?n.push(t):i.push(r)}return{resolved:n,missing:i}}addEntity(e){if(e1(e))this.assetMap.set(e.sys.id,e9(E(e)));else if(e0(e))this.entryMap.set(e.sys.id,e9(E(e)));else throw Error(`Attempted to add an entity to the store that is neither Asset nor Entry: '${JSON.stringify(e)}'`)}async fetchAsset(e){let{resolved:t,missing:n}=this.getEntitiesFromMap("Asset",[e]);return n.length?void eA.warn(`[experiences-core::EntityStoreBase] Asset "${e}" is not in the store`):t[0]}async fetchAssets(e){let{resolved:t,missing:n}=this.getEntitiesFromMap("Asset",e);if(n.length)throw Error(`Missing assets in the store (${n.join(",")})`);return t}async fetchEntry(e){let{resolved:t,missing:n}=this.getEntitiesFromMap("Entry",[e]);return n.length?void eA.warn(`[experiences-core::EntityStoreBase] Entry "${e}" is not in the store`):t[0]}async fetchEntries(e){let{resolved:t,missing:n}=this.getEntitiesFromMap("Entry",e);if(n.length)throw Error(`Missing assets in the store (${n.join(",")})`);return t}getDeepEntry(e,t){let n=(e,t)=>{let n=[],i=t;for(let t=0;t<e.length;t++){let r=t===e.length-1,[,a,o]=e[t];if(!i)throw Error(`Logic Error: Cannot resolve field ${a} of a fieldset as there is no entity to resolve it from.`);if(r){n.push([i,a,o]);break}let s=eY(i,["fields",a]);if(void 0===s)return{resolvedFieldset:n,isFullyResolved:!1,reason:`Cannot resolve field Link<${i.sys.type}>(sys.id=${i.sys.id}).fields[${a}] as field value is not defined`};if(eB(s)){let e=this.getEntityFromLink(s);if(void 0===e)return{resolvedFieldset:n,isFullyResolved:!1,reason:`Field reference Link (sys.id=${s.sys.id}) not found in the EntityStore, waiting...`};n.push([i,a,o]),i=e}else{if(!(e1(s)||e0(s)))return{resolvedFieldset:n,isFullyResolved:!1,reason:`Deep path points to an invali
3d field value of type '${typeof s}' (value=${s})`};n.push([i,a,o]),i=s}}return{resolvedFieldset:n,isFullyResolved:!0}},i=eB(e)?this.getEntityFromLink(e):e;if(void 0===i)return;let{resolvedFieldset:r,isFullyResolved:a,reason:o}=n((e=>{let t=eZ(e);if(null===t)throw Error(`Cannot parse path '${e}' as deep path`);return t.fields.map(e=>[null,e,"~locale"])})(t),i);if(!a){o&&eA.log(`[experiences-core::EntityStoreBase] Deep path wasn't resolved till leaf node, falling back to undefined, because: ${o}`);return}let[s]=r[r.length-1];return s}getEntity(e,t){return"Asset"===e?this.assetMap.get(t):this.entryMap.get(t)}toJSON(){return{entryMap:Object.fromEntries(this.entryMap),assetMap:Object.fromEntries(this.assetMap),locale:this.locale}}};class te extends e8{constructor({entities:e,locale:t,sendMessage:n,subscribe:i,timeoutDuration:r=3e3}){super({entities:e,locale:t}),this.requestCache=new Map,this.cacheIdSeperator=",",this.sendMessage=n,this.subscribe=i,this.timeoutDuration=r}cleanupPromise(e){setTimeout(()=>{this.requestCache.delete(e)},300)}getCacheId(e){return 1===e.length?e[0]:e.join(this.cacheIdSeperator)}async fetchEntity(e,t,n=!1){let i;if(n)i=[...t];else{let{missing:n,resolved:r}=this.getEntitiesFromMap(e,t);if(0===n.length)return r;i=n}let a=this.getCacheId(i),o=this.requestCache.get(a);if(o)return o;let s=new Promise((n,o)=>{let s=this.subscribe(r.REQUESTED_ENTITIES,e=>{let r=[...e.entities.map(e=>e.sys.id),...e.missingEntityIds??[]];i.every(e=>r.includes(e))?(clearTimeout(l),n(e.entities),this.cleanupPromise(a),t.forEach(e=>this.cleanupPromise(e)),s()):eA.warn("[experiences-core::EditorEntityStore] Unexpected entities received in REQUESTED_ENTITIES. Ignoring this response.")}),l=setTimeout(()=>{o(Error(`Request for entities timed out ${this.timeoutDuration}ms for ${a}`)),this.cleanupPromise(a),t.forEach(e=>this.cleanupPromise(e)),s()},this.timeoutDuration);this.sendMessage(r.REQUEST_ENTITIES,{entityIds:i,entityType:e,locale:this.locale})});return this.requestCache.set(a,s),t.forEach(e=>{this.requestCache.set(e,s)}),(await s).forEach(e=>{this.addEntity(e)}),this.getEntitiesFromMap(e,t).resolved}async fetchAsset(e,t=!1){try{return(await this.fetchAssets([e],t))[0]}catch(t){eA.warn(`[experiences-core::EditorEntityStore] Failed to request asset ${e}`);return}}fetchAssets(e,t=!1){return this.fetchEntity("Asset",e,t)}async fetchEntry(e,t=!1){try{return(await this.fetchEntries([e],t))[0]}catch(t){eA.warn(`[experiences-core::EditorEntityStore] Failed to request entry ${e}`,t);return}}fetchEntries(e,t=!1){return this.fetchEntity("Entry",e,t)}}class tt extends te{constructor({entities:e,locale:t}){eA.debug(`[experiences-core::EditorModeEntityStore] Initializing editor entity store with ${e.length} entities for locale ${t}.`,{entities:e}),super({entities:e,sendMessage:e7,subscribe:(e,t)=>{let n=n=>{let i=JSON.parse(n.data);"object"==typeof i&&i&&"composability-app"===i.source&&i.eventType===e&&t(i.payload)};return"undefined"!=typeof window&&window.addEventListener("message",n),()=>{"undefined"!=typeof window&&window.removeEventListener("message",n)}},locale:t,timeoutDuration:1e4})}async fetchEntities({missingEntryIds:e,missingAssetIds:t,skipCache:n=!1}){await Promise.all([super.fetchEntries(e,n),super.fetchAssets(t,n)])}getMissingEntityIds(e){let t=e.filter(e=>e.sys?.linkType==="Entry"),n=e.filter(e=>e.sys?.linkType==="Asset"),i=[...new Set(t.map(e=>e.sys.id))],r=[...new Set(n.map(e=>e.sys.id))],{missing:a}=this.getEntitiesFromMap("Entry",i),{missing:o}=this.getEntitiesFromMap("Asset",r);return{missingEntryIds:a,missingAssetIds:o}}getValue(e,t){var n;let i=this.getEntryOrAsset(e,t.join("/"));if(i)return(n=eY(i,t))&&"object"==typeof n&&n.url?n.url:n}}let tn=class extends e8{constructor(){super({entities:[],locale:"uninitialized-locale-in-uninitialized-entity-store"})}},ti=(0,x.vt)((e,t)=>({entityStore:new tn,areEntitiesFetched:!1,setEntitiesFetched(t){e({areEntitiesFetched:t})},resolveAssetById(e){if(!e)return;let{entityStore:n}=t();return n.getAssetById(e)},resolveEntryById(e){if(!e)return;let{entityStore:n}=t();return n.getEntryById(e)},resolveEntity(e){if(!e)return;let{entityStore:n}=t();return n.getEntityFromLink(e)},resetEntityStore(t){e({entityStore:t,areEntitiesFetched:!1})}})),tr={maybeResolveLink:function(e){return eB(e)?ti.getState().resolveEntity(e):void eA.warn("[experiences-core::InMemoryEntitiesStore] maybeResolveLink function must receive Link shape. Provided argument does not match the Link shape: ",e)}};!function(e){e.LazyLoad="lazyLoad",e.InjectScript="injectScript"}(o||(o={}));class ta{constructor({path:e,dataSource:t}){let{key:n,field:i,referentField:r}=(e=>{let t=eZ(e);if(null===t)throw Error(`Cannot parse path '${e}' as deep path`);return{key:t.key,field:t.fields[0],referentField:t.fields[1]}})(e);
3this.originalPath=e,this.entityId=t[n].sys.id,this.entityLink=t[n],this.field=i,this.referentField=r}get headEntityId(){return this.entityId}extractReferent(e){let t=e.getEntityFromLink(this.entityLink),n=t?.fields[this.field];if(void 0!==n&&eB(n))return n}static from(e){return new ta(e)}}let to="root";function ts(e,t,n){if(n.data.id===e){n.data=t.data;return}n.children.forEach(n=>ts(e,t,n))}!function(e){e[e.REMOVE_NODE=0]="REMOVE_NODE",e[e.ADD_NODE=1]="ADD_NODE",e[e.MOVE_NODE=2]="MOVE_NODE",e[e.UPDATE_NODE=3]="UPDATE_NODE",e[e.REORDER_NODE=4]="REORDER_NODE",e[e.REPLACE_NODE=5]="REPLACE_NODE"}(s||(s={}));let tl=(e,t)=>(function e(t,n){if(n.data.id===t)return n;for(let i of n.children){let n=e(t,i);if(n)return n}})(e.id,{type:"block",data:{id:to},children:t.root.children}),td={RequestComponentTreeUpdate:"requestComponentTreeUpdate",CanvasReload:"canvasReload",CanvasGeometryUpdated:"canvasGeometryUpdated",CanvasPan:"canvasPan"},tc={RequestEditorMode:"requestEditorMode",RequestReadOnlyMode:"requestReadOnlyMode",ExperienceUpdated:"componentTreeUpdated",ComponentDraggingChanged:"componentDraggingChanged",ComponentDragCanceled:"componentDragCanceled",ComponentDragStarted:"componentDragStarted",ComponentDragEnded:"componentDragEnded",ComponentMoveEnded:"componentMoveEnded",CanvasResized:"canvasResized",SelectComponent:"selectComponent",HoverComponent:"hoverComponent",UpdatedEntity:"updatedEntity",AssembliesAdded:"assembliesAdded",AssembliesRegistered:"assembliesRegistered",MouseMove:"mouseMove",RequestedEntities:"REQUESTED_ENTITIES"},tu={VisualEditorInitialize:"cfVisualEditorInitialize"},tp={Ready:"cfVisualEditorReady"};!function(e){e.READ_ONLY="readOnlyMode",e.EDITOR="editorMode",e.NONE="none"}(l||(l={}));let tf="assembly",ty="80px";!function(e){e.REQUEST_ENTITIES="REQUEST_ENTITIES",e.REQUESTED_ENTITIES="REQUESTED_ENTITIES"}(d||(d={}));let tm=(0,x.vt)((e,t)=>({tree:{root:{children:[],type:"root",data:{breakpoints:[],dataSource:{},id:to,props:{},unboundValues:{}}}},breakpoints:[],updateNodesByUpdatedEntity:t=>{e((0,I.jM)(e=>{e5(e.tree.root,n=>{if(th(n)&&n.data.blockId===t)return void ts(n.data.id,tb(n),e.tree.root);Object.values(n.data.dataSource).map(e=>e.sys.id).includes(t)&&ts(n.data.id,tb(n),e.tree.root)})}))},updateTree:n=>{let i=t().tree,r=function(e,t,n){let i=[];return!function e({currentNode:t,updatedNode:n,originalTree:i,differences:r=[]}){let a=new Map;if(!t||!n)return r;let o=t.children.length,l=n.children.length,d=o>l,c=o<l,u=n.data.id;return(0,w.A)(t.data,n.data)||r.push({type:s.UPDATE_NODE,nodeId:t.data.id,node:n}),t.children.forEach((e,t)=>a.set(e.data.id,t)),n.children.forEach((n,o)=>{let l=n.data.id;if(!a.has(l)){let e=function({index:e,nodeAdded:t,child:n,tree:i,parentNodeId:r,currentNode:a}){if(t)return{type:s.ADD_NODE,indexToAdd:e,nodeToAdd:n,parentNodeId:r};let o=tl({id:n.data.id},i);if(o){let t=tl({id:o.parentId},i);if(!t)return null;let a=t.children.findIndex(e=>e.data.id===n.data.id);return{type:s.MOVE_NODE,sourceIndex:a,destinationIndex:e,parentNodeId:r}}return{type:s.REPLACE_NODE,originalId:a.children[e].data.id,indexToReplace:e,node:n}}({index:o,child:n,nodeAdded:c,parentNodeId:u,tree:i,currentNode:t});return e?.type===s.REPLACE_NODE&&a.delete(e.originalId),r.push(e)}let p=a.get(l),f=function({index:e,originalIndex:t,nodeRemoved:n,nodeAdded:i,parentNodeId:r}){return e===t||n||i?null:{type:s.REORDER_NODE,sourceIndex:t,destinationIndex:e,parentNodeId:r}}({index:o,originalIndex:p,nodeAdded:c,nodeRemoved:d,parentNodeId:u});r.push(f),a.delete(l),e({currentNode:t.children[p],updatedNode:n,originalTree:i,differences:r})}),a.forEach((e,t)=>{r.push({type:s.REMOVE_NODE,indexToRemove:e,parentNodeId:u,idToRemove:t})}),r}({currentNode:e,updatedNode:t,originalTree:n,differences:i}),i.filter(e=>e)}({...i.root},{...n.root},i),a=tg(i,n);if(!r.length&&!a)return void eA.debug("[experiences-visual-editor-react::useTreeStore]: During smart-diffing no diffs. Skipping tree update.");e((0,I.jM)(e=>{r.map(t=>{switch(t.type){case s.ADD_NODE:!function e(t,n,i,r){if(r.data.id===n){r.children=[...r.children.slice(0,t),i,...r.children.slice(t)];return}
3r.children.forEach(r=>e(t,n,i,r))}(t.indexToAdd,t.parentNodeId,t.nodeToAdd,e.tree.root);break;case s.REPLACE_NODE:!function e(t,n,i){if(i.data.id===n.parentId){i.children=[...i.children.slice(0,t),n,...i.children.slice(t+1)];return}i.children.forEach(i=>e(t,n,i))}(t.indexToReplace,t.node,e.tree.root);break;case s.UPDATE_NODE:ts(t.nodeId,t.node,e.tree.root);break;case s.REMOVE_NODE:!function e(t,n,i,r){if(r.data.id===i){let e=r.children.findIndex(e=>e.data.id===n);r.children.splice(-1===e?t:e,1);return}r.children.forEach(r=>e(t,n,i,r))}(t.indexToRemove,t.idToRemove,t.parentNodeId,e.tree.root);break;case s.MOVE_NODE:case s.REORDER_NODE:e.tree=n}}),e.breakpoints=n?.root?.data?.breakpoints||[]}))},findNodeById(e){if(!e)return null;let n=t().tree.root,i=[],r=[],a=n;for(r.push(a);r.length;){if(a=r.shift(),i.push(a.data.id),a.data.id===e)return a;r.push(...a.children)}return null}})),tg=(e,t)=>{let n=e?.root?.data?.breakpoints??[],i=t?.root?.data?.breakpoints??[];return!(0,w.A)(n,i)},th=e=>e.type===tf,tb=e=>JSON.parse(JSON.stringify(e)),tE=new Map,tv=(0,x.vt)((e,t)=>({dataSource:{},hyperLinkPattern:void 0,unboundValues:{},locale:null,setHyperLinkPattern:t=>{e({hyperLinkPattern:t})},setDataSource(n){let i=t().dataSource,r={...i,...n};(0,w.A)(i,r)||e({dataSource:r})},setUnboundValues(t){e({unboundValues:t})},setLocale(n){n!==t().locale&&e({locale:n})},initializeEditor({componentRegistry:t,designTokens:n,sdkOptions:i,initialLocale:r}){t.forEach(e=>{tE.set(e.definition.id,e)}),Object.assign(A,(e=>{if(e.text)for(let t in e.text){let n=e.text[t];e.text[t]={emphasis:n.emphasis||"none",fontSize:n.fontSize||"16px",case:n.case||"normal",fontWeight:n.fontWeight||"400",lineHeight:n.lineHeight||"20px",letterSpacing:n.letterSpacing||"0px",color:n.color||"#000000"}}if(e.border)for(let t in e.border){let n=e.border[t];e.border[t]={width:n.width||"1px",style:n.style||"solid",color:n.color||"#000000"}}return e})(n)),Object.assign(ek,i),e({locale:r})}})),tz=({wrappingPatternIds:e,...t})=>h.createElement("div",{...t,"data-cf-node-error":"circular-pattern-dependency",style:{border:"1px solid red",background:"rgba(255, 0, 0, 0.1)",padding:"1rem 1rem 0 1rem",width:"100%",height:"100%"}},"Circular usage of patterns detected:",h.createElement("ul",null,Array.from(e).map(e=>{let t=tr.maybeResolveLink({sys:{type:"Link",linkType:"Entry",id:e}}),n=t?.fields?.title,i=n?`${n} (${e})`:e;return h.createElement("li",{key:e},i)})));class tx extends Error{constructor(e){super(e),this.name="ImportedComponentError"}}class tI extends Error{constructor(e){super(e),this.name="ExperienceSDKError"}}class tw extends h.Component{componentDidCatch(e,t){let n;if("ImportedComponentError"===e.name||"ExperienceSDKError"===e.name)throw e;let i=new((n=this.props.componentId,V.has(n??""))?tI:tx)(e.message);throw i.stack=e.stack,i}render(){return this.props.children}}let tk=({blockId:e})=>h.createElement("div",{style:{border:"1px solid red",width:"100%",height:"100%"}},"Missing component '",e,"'");var tT={emptySlot:"EditorBlock-module_emptySlot__za-Bi"};(0,g.A)(".EditorBlock-module_emptySlot__za-Bi {\n  min-height: 80px;\n  min-width: 80px;\n}\n"),(0,g.A)(":root{--cf-color-white:#fff;--cf-color-black:#000;--cf-color-gray100:#f7f9fa;--cf-color-gray400:#aec1cc;--cf-color-gray400-rgb:174,193,204;--cf-spacing-0:0rem;--cf-spacing-1:0.125rem;--cf-spacing-2:0.25rem;--cf-spacing-3:0.375rem;--cf-spacing-4:0.5rem;--cf-spacing-5:0.625rem;--cf-spacing-6:0.75rem;--cf-spacing-7:0.875rem;--cf-spacing-8:1rem;--cf-spacing-9:1.25rem;--cf-spacing-10:1.5rem;--cf-spacing-11:1.75rem;--cf-spacing-12:2rem;--cf-spacing-13:2.25rem;--cf-text-xs:0.75rem;--cf-text-sm:0.875rem;--cf-text-base:1rem;--cf-text-lg:1.125rem;--cf-text-xl:1.25rem;--cf-text-2xl:1.5rem;--cf-text-3xl:2rem;--cf-text-4xl:2.75rem;--cf-font-light:300;--cf-font-normal:400;--cf-font-medium:500;--cf-font-semibold:600;--cf-font-bold:700;--cf-font-extra-bold:800;--cf-font-black:900;--cf-border-radius-none:0px;--cf-border-radius-sm:0.125rem;--cf-border-radius:0.25rem;--cf-border-radius-md:0.375rem;--cf-border-radius-lg:0.5rem;--cf-border-radius-xl:0.75rem;--cf-border-radius-2xl:1rem;--cf-border-radius-3xl:1.5rem;--cf-border-radius-full:9999px;--cf-max-width-full:100%;--cf-button-bg:var(--cf-color-black);--cf-button-color:var(--cf-color-white);--cf-text-color:var(--cf-color-black)}*{box-sizing:border-box}"),function(e){e.READ_ONLY="readOnlyMode",e.EDITOR="editorMode",e.NONE="none"}(c||(c={})),function(e){e.REQUEST_ENTITIES="REQUEST_ENTITIES",e.REQUESTED_ENTITIES="REQUESTED_ENTITIES"}(u||(u={})),(0,g.A)('.cf-button:empty:before{content:"";display:inline-block}'),(0,g.A)(".cf-heading{white-space:pre-line}"),(0,g.A)(".cf-richtext{white-space:pre-line}.cf-richtext>:first-child{margin-top:0}.cf-richtext>:last-child{margin-bottom:0}"),(0,g.A)(".cf-text{white-space:pre-line}.cf-text-link .cf-text{margin:0}"),(0,g.A)("div.cf-placeholder-wrapper{outline:2px solid rgba(var(--cf-color-gray400-rgb),.5);outline-offset:-2px;overflow:hidden;position:relative}img.cf-placeholder-image{background-color:var(--cf-color-gray100);
3height:100%;width:100%}svg.cf-placeholder-icon{height:var(--cf-text-3xl);left:50%;max-height:100%;max-width:100%;position:absolute;top:50%;transform:translate(-50%,-50%);width:var(--cf-text-3xl)}svg.cf-placeholder-icon path{fill:var(--cf-color-gray400)}"),function(e){e.READ_ONLY="readOnlyMode",e.EDITOR="editorMode",e.NONE="none"}(p||(p={})),!function(e){e.REQUEST_ENTITIES="REQUEST_ENTITIES",e.REQUESTED_ENTITIES="REQUESTED_ENTITIES"}(f||(f={})),Object.values({section:{id:"contentful-section",name:"Section"},container:{id:"contentful-container",name:"Container"},columns:{id:"contentful-columns",name:"Columns"},singleColumn:{id:"contentful-single-column",name:"Column"},button:{id:"contentful-button",name:"Button"},heading:{id:"contentful-heading",name:"Heading"},image:{id:"contentful-image",name:"Image"},richText:{id:"contentful-richText",name:"Rich Text"},text:{id:"contentful-text",name:"Text"},divider:{id:"contentful-divider",name:"Divider"},carousel:{id:"contentful-carousel",name:"Carousel"}}).map(e=>e.id);let tS=b.z.literal("2023-09-28");b.z.union([b.z.literal("2023-08-23"),b.z.literal("2023-07-26"),b.z.literal("2023-06-27")]);let tj=b.z.enum(["Text","RichText","Number","Date","Boolean","Location","Media","Object","Hyperlink","Array","Link"]),tC=b.z.string().regex(/^[a-zA-Z0-9-_]{1,32}$/,{message:"Property needs to match: /^[a-zA-Z0-9-_]{1,32}$/"}),tN=b.z.union([b.z.string(),b.z.boolean(),b.z.number(),b.z.record(b.z.any(),b.z.any()),b.z.undefined()]),tV=b.z.array(b.z.object({sys:b.z.object({type:b.z.literal("Link"),id:b.z.string(),linkType:b.z.literal("Entry")})})),t$=b.z.string().regex(/^[a-zA-Z0-9-_]{1,21}$/,{message:"Does not match /^[a-zA-Z0-9-_]{1,21}$/"}),tM=b.z.record(t$,b.z.object({sys:b.z.object({type:b.z.literal("Link"),id:b.z.string(),linkType:b.z.enum(["Entry","Asset"])})})),tO=b.z.record(t$,b.z.object({value:tN})),tA=b.z.string().regex(/^[a-zA-Z0-9-_]{1,54}$/,{message:"Does not match /^[a-zA-Z0-9-_]{1,54}$/"}),tR=b.z.string().regex(/^[a-zA-Z0-9]{1,8}$/,{message:"Does not match /^[a-zA-Z0-9]{1,8}$/"}),tD=b.z.record(b.z.lazy(()=>tN)),tB=b.z.array(b.z.enum(["entry","asset","manual","experience"])).nonempty(),tL=b.z.object({type:b.z.literal("DesignValue"),valuesByBreakpoint:tD}).strict(),tF=b.z.object({type:b.z.literal("BoundValue"),path:b.z.string()}).strict(),t_=b.z.object({type:b.z.literal("HyperlinkValue"),linkTargetKey:b.z.string(),overrides:b.z.object({}).optional()}).strict(),tU=b.z.object({type:b.z.literal("UnboundValue"),key:b.z.string()}).strict(),tZ=b.z.object({type:b.z.literal("ComponentValue"),key:b.z.string()}).strict(),tP=b.z.object({type:b.z.literal("NoValue")}).strict(),tq=b.z.discriminatedUnion("type",[tL,tF,tU,t_,tZ,tP]),tW=b.z.object({type:b.z.literal("BoundValue"),path:b.z.string()}),tH=b.z.record(tA,tW),tQ=/^\*$|^[<>][0-9]+px$/,tJ=b.z.object({id:tA,query:b.z.string().refine(e=>tQ.test(e)),previewSize:b.z.string().optional(),displayName:b.z.string(),displayIcon:b.z.enum(["desktop","tablet","mobile"]).optional()}).strict(),tK=b.z.object({id:tR.optional(),definitionId:tC,prebindingId:b.z.string().optional(),displayName:b.z.string().optional(),slotId:b.z.string().optional(),variables:b.z.record(tA,tq),parameters:tH.optional()}),tY=b.z.object({displayName:b.z.string().optional(),type:tj,description:b.z.string().optional(),group:b.z.string().optional(),defaultValue:tN.or(tq).optional(),validations:b.z.object({bindingSourceType:tB.optional(),required:b.z.boolean().optional(),format:b.z.literal("URL").optional(),in:b.z.array(b.z.object({value:b.z.union([b.z.string(),b.z.number()]),displayName:b.z.string().optional()})).optional()}).optional()}),tG=tK.extend({children:b.z.lazy(()=>tG.array())}).superRefine(({id:e,prebindingId:t,parameters:n},i)=>{t&&!n&&i.addIssue({code:b.z.ZodIssueCode.custom,message:`Found "prebindingId" but no "parameters" for node with i
3d: "${e}"`})}),tX=b.z.object({breakpoints:b.z.array(tJ).superRefine((e,t)=>{if(!e.length||"*"!==e[0].query)return void t.addIssue({code:b.z.ZodIssueCode.custom,message:'The first breakpoint should include the following attributes: { "query": "*" }'});if(1===e.length)return;let n=e.map(e=>e.id);if(new Set(n).size!==n.length)return void t.addIssue({code:b.z.ZodIssueCode.custom,message:"Breakpoint IDs must be unique"});let i=e.slice(1),r=i[0].query.startsWith(">"),a=i[0].query.startsWith("<");r?(i.every(({query:e})=>e.startsWith(">"))||t.addIssue({code:b.z.ZodIssueCode.custom,message:'Breakpoint queries must be in the format ">[size]px" for mobile-first strategy'}),i.map(e=>parseInt(e.query.replace(/px|<|>/,""))).every((e,t,n)=>0===t||e>n[t-1])||t.addIssue({code:b.z.ZodIssueCode.custom,message:"When using a mobile-first strategy, all breakpoints must have strictly increasing pixel values"})):a?(i.every(({query:e})=>e.startsWith("<"))||t.addIssue({code:b.z.ZodIssueCode.custom,message:'Breakpoint queries must be in the format "<[size]px" for desktop-first strategy'}),i.map(e=>parseInt(e.query.replace(/px|<|>/,""))).every((e,t,n)=>0===t||e<n[t-1])||t.addIssue({code:b.z.ZodIssueCode.custom,message:"When using a desktop-first strategy, all breakpoints must have strictly decreasing pixel values"})):r||a||t.addIssue({code:b.z.ZodIssueCode.custom,message:"You may only use a mobile-first or desktop-first strategy for breakpoints using '<' or '>' queries"})}),children:b.z.array(tG),schemaVersion:tS}).strict(),t0=e=>b.z.record(b.z.string(),e);b.z.object({componentTree:t0(tX),dataSource:t0(tM),unboundValues:t0(tO),usedComponents:t0(tV).optional()});let t1=b.z.object({parameterId:tA,type:b.z.literal("ContentTypeMapping"),pathsByContentType:b.z.record(b.z.string(),b.z.object({path:b.z.string()})).superRefine((e,t)=>{let n=t.path[t.path.length-2];Object.keys(e).length>200&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`Too many paths defined for variable mapping with id "${n}", maximum allowed is 200`})})}),t2=b.z.object({nodeId:tA,parameterId:tA,prebindingId:tA}).strict(),t3=b.z.object({defaultSource:b.z.strictObject({type:b.z.enum(["Entry"]),contentTypeId:b.z.string(),link:b.z.strictObject({sys:b.z.strictObject({type:b.z.literal("Link"),id:b.z.string(),linkType:b.z.enum(["Entry"])})})}).optional(),contentTypes:b.z.array(b.z.string()).min(1),passToNodes:b.z.array(t2).max(1,'At most one "passToNodes" element is allowed per parameter definition.')}),t5=b.z.record(tA,t3),t6=b.z.record(tA,t1),t4=b.z.record(b.z.string().regex(/^[a-zA-Z0-9-_]{1,54}$/),tY),t7=b.z.object({id:tA,parameterDefinitions:t5,variableMappings:t6.optional(),allowedVariableOverrides:b.z.array(b.z.string()).optional()}).strict(),t9=b.z.object({variableDefinitions:t4,thumbnailId:b.z.enum(["columns","columnsPlusRight","imagesSquare","subtitles","rowsPlusBottom","userRectangle","textbox","monitorPlay","article","table","star","heartStraight","frameCorners","rows","dotsThreeOutline","listDashes","checkerBoard","gridFour","slideshow","diamondsFour","cards","textColumns","duplex"]).optional(),category:b.z.string().max(50,"Category must contain at most 50 characters").optional(),prebindingDefinitions:b.z.array(t7).length(1).optional()}).strict().superRefine((e,t)=>{let{variableDefinitions:n,prebindingDefinitions:i}=e;if(!i||0===i.length)return;let{parameterDefinitions:r,variableMappings:a,allowedVariableOverrides:o}=i[0];t8(r,t),ne(a,o,t),nt(a,o,n,t),nn(a,r,t)});b.z.object({componentTree:t0(tX),dataSource:t0(tM),unboundValues:t0(tO),usedComponents:t0(tV).optional(),componentSettings:t0(t9)}).superRefine((e,t)=>{let{componentTree:n,componentSettings:i}=e,r=Object.values(n)[0],a=Object.values(i)[0];a&&r&&ni(r.children||[],a||{},t)});let t8=(e,t)=>{Object.values(e).filter(e=>!(e.passToNodes&&e.passToNodes.length>0)).length>1&&t.addIssue({code:b.z.ZodIssueCode.custom,message:"Only one native parameter definition (parameter definition without passToNodes) is allowed per prebinding definition."})},ne=(e,t,n)=>{let i=Object.keys(e||{}),r=new Set(t||[]),a=i.filter(e=>r.has(e));a.length>0&&n.addIssue({code:b.z.ZodIssueCode.custom,message:`Found both variable mapping and allowed override for the following keys: ${a.map(e=>`"${e}"`).join(", ")}.`})},nt=(e,t,n,i)=>{let r=Object.entries(n).filter(([e,t])=>"style"!==t.group).map(([e])=>e),a=[...Object.keys(e||{}),...t||[]].filter(e=>!r.includes(e));a.length>0&&i.addIssue({code:b.z.ZodIssueCode.custom,message:`The following variable mappings or overrides are missing from the variable definitions: ${a.map(e=>`"${e}"`).join(", ")}.`})},nn=(e,t,n)=>{let i=Object.keys(t||{});for(let[t,r]of Object.entries(e||{}))i.includes(r.parameterId)||n.addIssue({code:b.z.ZodIssueCode.custom,message:`The variable mapping with id "${t}" references a non-existing parameterId "${r.parameterId}".`})},ni=(e,t,n)=>{if(!t.prebindingDefinitions||0===t.prebindingDefinitions.length)return;let{parameterDefinitions:i}=t.prebindingDefinitions[0],r=new Set;for(let e of Object.values(i||{}
3))e.passToNodes?.forEach(e=>r.add(e.nodeId));if(!function(e,t){let n=e=>{let i=[...e.children];for(let r of(t(e),i))n(r)};if(Array.isArray(e))for(let t of e)n(t);else n(e)}(e,e=>{e.id&&r.has(e.id)&&r.delete(e.id)}),r.size>0){let e=Array.from(r).map(e=>`"${e}"`).join(", ");n.addIssue({code:b.z.ZodIssueCode.custom,message:`The following node IDs referenced in passToNodes are not present in the component tree: ${e}.`})}};b.z.object({id:tC,name:b.z.string(),category:b.z.string().optional(),thumbnailUrl:b.z.string().optional(),thumbnailId:b.z.string().optional(),hyperlinkPattern:b.z.string().optional(),children:b.z.boolean().optional(),slots:b.z.record(tC,b.z.object({displayName:b.z.string().optional()})).optional(),builtInStyles:b.z.array(b.z.string()).optional(),tooltip:b.z.object({imageUrl:b.z.string().optional(),description:b.z.string()}).optional(),variables:b.z.record(tC,tY.extend({defaultValue:tN.optional()}).superRefine((e,t)=>{switch(e.type){case"Array":void 0!==e.defaultValue&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`defaultValue is not supported for "Array" type for ${t.path.join(".")}`,fatal:!1});break;case"Boolean":void 0!==e.defaultValue&&"boolean"!=typeof e.defaultValue&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`defaultValue must be a boolean when type is "Boolean" for ${t.path.join(".")}, got ${typeof e.defaultValue} instead`,fatal:!1});break;case"Date":void 0!==e.defaultValue&&"string"!=typeof e.defaultValue&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`defaultValue must be a string when type is "Date" for ${t.path.join(".")}, got ${typeof e.defaultValue} instead`,fatal:!1});break;case"Hyperlink":void 0!==e.defaultValue&&"string"!=typeof e.defaultValue&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`defaultValue must be a string when type is "Hyperlink" for ${t.path.join(".")}, got ${typeof e.defaultValue} instead`,fatal:!1});break;case"Link":void 0!==e.defaultValue&&"object"!=typeof e.defaultValue&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`defaultValue is not supported for "Link" type for ${t.path.join(".")}`,fatal:!1});break;case"Location":void 0!==e.defaultValue&&"object"!=typeof e.defaultValue&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`defaultValue must be an object when type is "Location" for ${t.path.join(".")}, got ${typeof e.defaultValue} instead`,fatal:!1});break;case"Media":void 0!==e.defaultValue&&"string"!=typeof e.defaultValue&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`defaultValue must be a string when type is "Media" for ${t.path.join(".")}, got ${typeof e.defaultValue} instead`,fatal:!1});break;case"Number":void 0!==e.defaultValue&&"number"!=typeof e.defaultValue&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`defaultValue must be a number when type is "Number" for ${t.path.join(".")}, got ${typeof e.defaultValue} instead`,fatal:!1});break;case"Object":void 0!==e.defaultValue&&"object"!=typeof e.defaultValue&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`defaultValue must be an object when type is "Object" for ${t.path.join(".")}, got ${typeof e.defaultValue} instead`,fatal:!1});break;case"RichText":void 0!==e.defaultValue&&"object"!=typeof e.defaultValue&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`defaultValue must be an object when type is "RichText" for ${t.path.join(".")}, got ${typeof e.defaultValue} instead`,fatal:!1});break;case"Text":void 0!==e.defaultValue&&"string"!=typeof e.defaultValue&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`defaultValue must be a string when type is "Text" for ${t.path.join(".")}, got ${typeof e.defaultValue} instead`,fatal:!1})}}))}).superRefine((e,t)=>{!0===e.children&&(e.variables.children||e.slots?.children)&&t.addIssue({code:b.z.ZodIssueCode.custom,message:"Cannot activate 'children: true' and name a variable or slot 'children' at the same time",fatal:!1}),e.variables&&e.slots&&Object.keys(e.variables).forEach(n=>{e.slots[n]&&t.addIssue({code:b.z.ZodIssueCode.custom,message:`Variable and slot cannot have the same name: ${n}`,fatal:!1})})}),function(e){e.Type="type",e.Required="required",e.Unexpected="unexpected",e.Regex="regex",e.In="in",e.Size="size",e.Custom="custom"}(y||(y={}));let nr="cf_debug",na=()=>{try{if("undefined"==typeof localStorage||null===localStorage)return!1;let e="cf_test_local_storage";if(localStorage.setItem(e,"yes"),"yes"===localStorage.getItem(e))return localStorage.removeItem(e),!0;return!1}catch(e){return!1}},no=["error","warn","log","debug"];class ns{constructor(){if(this.activeLevel="warn",this.error=this.logger("error"),this.warn=this.logger("warn"),this.log=this.logger("log"),this.debug=this.logger("debug"),!na())return;"true"===localStorage.getItem(nr)&&(this.activeLevel="debug")}static getInstance(){return null===this.instance&&(this.instance=new ns),this.instance}getActiveLevel(){return this.activeLevel}setActiveLevel(e){this.activeLevel=e,na()&&("debug"===this.activeLevel||"log"===this.activeLevel?localStorage.setItem(nr,"true"):localStorage.removeItem(nr))}logger(e){return(...t)=>{let n=no.indexOf(e);n<=no.indexOf(this.activeLevel)&&console[e](...t)}}}ns.instance=null;let nl=ns.getInstance();
3function nd(e){return null!==e&&"object"==typeof e&&!!e.sys?.id&&e.sys?.type==="Link"&&!!e.sys?.linkType}let nc=e=>{let t=nu(e.split("/"),{startNextChunkOnElementEqualTo:"fields"});if(t.length<=1||2===t.length)return null;let[n,...i]=t;return/^\/([^/^~]+)$/.test(n.join("/"))&&i.every(e=>/^fields\/[^/^~]+\/~locale$/.test(e.join("/")))?{key:n[1],fields:i.map(e=>e[1])}:null},nu=(e,{startNextChunkOnElementEqualTo:t})=>{let n=[],i=[],r=e=>e===t;for(let t=0;t<e.length;t++){let a=0===t,o=e[t];a?i=[o]:r(o)?(n.push(i),i=[o]):i.push(o)}return n.push(i),n.filter(e=>e.length>0)};function np(e,t){if(!t.length)return e;try{let[n,...i]=t;return np(e[n],i)}catch(e){return}}let nf=e=>null!==e&&"object"==typeof e&&"sys"in e&&e.sys?.type==="Entry",ny=e=>null!==e&&"object"==typeof e&&"sys"in e&&e.sys?.type==="Asset";function nm(e){for(let t of Object.getOwnPropertyNames(e)){let n=e[t];n&&"object"==typeof n&&nm(n)}return Object.freeze(e)}class ng{constructor({entities:e,locale:t}){for(let n of(this.entryMap=new Map,this.assetMap=new Map,this.locale=t,e))this.addEntity(n)}get entities(){return[...this.entryMap.values(),...this.assetMap.values()]}updateEntity(e){this.addEntity(e)}getEntryOrAsset(e,t){let n;if((e=>{let t=nc(e);return!!t&&t.fields.length>1})(t))return this.getDeepEntry(e,t);if(nd(e)){let t="Entry"===e.sys.linkType?this.entryMap.get(e.sys.id):this.assetMap.get(e.sys.id);if(!t||t.sys.type!==e.sys.linkType)return void nl.warn(`[experiences-core::EntityStoreBase] Experience references unresolved entity: ${JSON.stringify(e)}`);n=t}else if(ny(e)||nf(e))n=e;else throw Error(`[experiences-core::EntityStoreBase] Unexpected object when resolving entity: ${JSON.stringify(e)}`);return n}getValue(e,t){let n=this.getEntity(e.sys.linkType,e.sys.id);return n?np(n,t):void nl.warn(`Unresolved entity reference: ${e.sys.linkType} with ID ${e.sys.id}`)}getEntityFromLink(e){let t="Entry"===e.sys.linkType?this.entryMap.get(e.sys.id):this.assetMap.get(e.sys.id);return t&&t.sys.type===e.sys.linkType?t:void nl.warn(`[experiences-core::EntityStoreBase] Experience references unresolved entity: ${JSON.stringify(e)}`)}getAssetById(e){let t=this.assetMap.get(e);return t||void nl.warn(`[experiences-core::EntityStoreBase] Asset with ID "${e}" is not found in the store`)}getEntryById(e){let t=this.entryMap.get(e);return t||void nl.warn(`[experiences-core::EntityStoreBase] Entry with ID "${e}" is not found in the store`)}getEntitiesFromMap(e,t){let n=[],i=[];for(let r of t){let t=this.getEntity(e,r);t?n.push(t):i.push(r)}return{resolved:n,missing:i}}addEntity(e){if(ny(e))this.assetMap.set(e.sys.id,nm(E(e)));else if(nf(e))this.entryMap.set(e.sys.id,nm(E(e)));else throw Error(`Attempted to add an entity to the store that is neither Asset nor Entry: '${JSON.stringify(e)}'`)}async fetchAsset(e){let{resolved:t,missing:n}=this.getEntitiesFromMap("Asset",[e]);return n.length?void nl.warn(`[experiences-core::EntityStoreBase] Asset "${e}" is not in the store`):t[0]}async fetchAssets(e){let{resolved:t,missing:n}=this.getEntitiesFromMap("Asset",e);if(n.length)throw Error(`Missing assets in the store (${n.join(",")})`);return t}async fetchEntry(e){let{resolved:t,missing:n}=this.getEntitiesFromMap("Entry",[e]);return n.length?void nl.warn(`[experiences-core::EntityStoreBase] Entry "${e}" is not in the store`):t[0]}async fetchEntries(e){let{resolved:t,missing:n}=this.getEntitiesFromMap("Entry",e);if(n.length)throw Error(`Missing assets in the store (${n.join(",")})`);return t}getDeepEntry(e,t){let n=(e,t)=>{let n=[],i=t;for(let t=0;t<e.length;t++){let r=t===e.length-1,[,a,o]=e[t];if(!i)throw Error(`Logic Error: Cannot resolve field ${a} of a fieldset as there is no entity to resolve it from.`);if(r){n.push([i,a,o]);break}let s=np(i,["fields",a]);if(void 0===s)return{resolvedFieldset:n,isFullyResolved:!1,reason:`Cannot resolve field Link<${i.sys.type}>(sys.id=${i.sys.id}).fields[${a}] as field value is not defined`};if(nd(s)){let e=this.getEntityFromLink(s);if(void 0===e)return{resolvedFieldset:n,isFullyResolved:!1,reason:`Field reference Link (sys.id=${s.sys.id}) not found in the EntityStore, waiting...`};n.push([i,a,o]),i=e}else{if(!(ny(s)||nf(s)))return{resolvedFieldset:n,isFullyResolved:!1,reason:`Deep path points to an invali
3d field value of type '${typeof s}' (value=${s})`};n.push([i,a,o]),i=s}}return{resolvedFieldset:n,isFullyResolved:!0}},i=nd(e)?this.getEntityFromLink(e):e;if(void 0===i)return;let{resolvedFieldset:r,isFullyResolved:a,reason:o}=n((e=>{let t=nc(e);if(null===t)throw Error(`Cannot parse path '${e}' as deep path`);return t.fields.map(e=>[null,e,"~locale"])})(t),i);if(!a){o&&nl.log(`[experiences-core::EntityStoreBase] Deep path wasn't resolved till leaf node, falling back to undefined, because: ${o}`);return}let[s]=r[r.length-1];return s}getEntity(e,t){return"Asset"===e?this.assetMap.get(t):this.entryMap.get(t)}toJSON(){return{entryMap:Object.fromEntries(this.entryMap),assetMap:Object.fromEntries(this.assetMap),locale:this.locale}}}class nh extends ng{constructor(){super({entities:[],locale:"uninitialized-locale-in-uninitialized-entity-store"})}}(0,x.vt)((e,t)=>({entityStore:new nh,areEntitiesFetched:!1,setEntitiesFetched(t){e({areEntitiesFetched:t})},resolveAssetById(e){if(!e)return;let{entityStore:n}=t();return n.getAssetById(e)},resolveEntryById(e){if(!e)return;let{entityStore:n}=t();return n.getEntryById(e)},resolveEntity(e){if(!e)return;let{entityStore:n}=t();return n.getEntityFromLink(e)},resetEntityStore(t){e({entityStore:t,areEntitiesFetched:!1})}})),function(e){e.LazyLoad="lazyLoad",e.InjectScript="injectScript"}(m||(m={})),(0,g.A)('.contentful-container{display:flex;pointer-events:all;position:relative}.contentful-container::-webkit-scrollbar{display:none}.cf-container-wrapper{position:relative;width:100%}.contentful-container:after{align-items:center;bottom:0;color:var(--exp-builder-gray400);content:"";display:block;display:flex;font-family:var(--exp-builder-font-stack-primary);font-size:12px;justify-content:center;left:0;overflow-x:clip;pointer-events:none;position:absolute;right:0;top:0;z-index:1}.contentful-section-label:after{content:"Section"}.contentful-container-label:after{content:"Container"}.contentful-container-link,.contentful-container-link:active,.contentful-container-link:focus-visible,.contentful-container-link:hover,.contentful-container-link:read-write,.contentful-container-link:visited{color:inherit;outline:unset;text-decoration:unset}'),(0,h.forwardRef)(({id:e,children:t,onMouseEnter:n,onMouseUp:i,onMouseLeave:r,onMouseDown:a,onClick:o,flex:s,flexBasis:l,flexShrink:d,flexDirection:c,gap:u,justifyContent:p,justifyItems:f,justifySelf:y,alignItems:m,alignSelf:g,alignContent:b,order:E,flexWrap:v,flexGrow:z,className:x,cssStyles:I,...w},k)=>h.createElement("div",{id:e,ref:k,style:{display:"flex",flex:s,flexBasis:l,flexShrink:d,flexDirection:c,gap:u,justifyContent:p,justifyItems:f,justifySelf:y,alignItems:m,alignSelf:g,alignContent:b,order:E,flexWrap:v,flexGrow:z,...I},className:x,onMouseEnter:n,onMouseUp:i,onMouseDown:a,onMouseLeave:r,onClick:o,...w},t)).displayName="Flex",(0,g.A)(".cf-divider{display:contents;height:100%;position:relative;width:100%}.cf-divider hr{border:none}"),(0,g.A)('.cf-columns{display:flex;flex-direction:column;gap:24px;grid-template-columns:repeat(12,1fr);min-height:0;min-width:0}@media (min-width:768px){.cf-columns{display:grid}}.cf-single-column-wrapper{position:relative}.cf-single-column-wrapper:after{align-items:center;bottom:0;color:var(--exp-builder-gray400);content:"";display:block;display:flex;font-family:var(--exp-builder-font-stack-primary);font-size:12px;justify-content:center;left:0;overflow-x:clip;pointer-events:none;position:absolute;right:0;top:0;z-index:1}.cf-single-column-label:after{content:"Column"}');let nb={display:"contents"},nE=e=>h.createElement("div",{"data-test-id":"assembly",...e,style:nb}),nv=(e,t)=>e.type===tf||e.type===to?e.children.some(e=>nv(e,t)):!1!==t(e.data.props.cfVisibility?.valuesByBreakpoint);function nz({node:e,resolveDesignValue:t,wrappingPatternIds:n=new Set,entityStore:i,areEntitiesFetched:r}){let a=e.type===tf,o=(0,h.useMemo)(()=>a&&e.data.blockId?new Set([e.data.blockId,...n]):n,[a,e,n]),s=(0,h.useMemo)(()=>{if(e.type===tf)return{component:nE,definition:{id:e.data.blockId,name:"Component",variables:{},children:!0,category:"Assemblies"}};let t=tE.get(e.data.blockId);return t||void eA.warn(`[experiences-visual-editor-react::useComponentRegistration] Component registration not found for component with id: "${e.data.blockId}". The registered component might have been removed from the code. To proceed, remove the component manually from the layers tab.`)},[e]);if(!s)return h.createElement(tk,{blockId:e.data.blockId});if(a&&e.data.blockId&&n.has(e.data.blockId))return h.createElement(tz,{wrappingPatternIds:o});let{slotNodesMap:l,directChildNodes:d}=((e,t)=>{let n=e=>"data"in e?e.data.slotId:e.slotId,i={};for(let r in t.slots){let t=e.filter(e=>n(e)===r);i[r]=t.length?t:null}let r=e.filter(e=>void 0===n(e));return t.children&&r.length?{slotNodesMap:i,directChildNodes:r}:{slotNodesMap:i,directChildNodes:void 0}})(e.children,s.definition),c=e=>h.createElement(nz,{key:e.data.id,node:e,resolveDesignValue:t,wrappingPatternIds:o,entityStore:i,areEntitiesFetched:r}),u=Object.entries(l).reduce((e,[t,n])=>(n?.length?e[t]=h.createElement(h.Fragment,null,n.map(e=>c(e))):e[t]=h.createElement("div",{className:tT.emptySlot}),e),{}),p=d?.map(e=>c(e));return h.createElement(nx,{node:e,resolveDesignValue:t,componentRegistration:s,slotNodes:u,entityStore:i,areEntitiesFetched:r},p)}let nx=({node:e,resolveDesignValue:t,componentRegistration:n,slotNodes:i,children:r,entityStore:a,areEntitiesFetched:o})=>{let{componentProps:s}=(({node:e,entityStore:t,areEntitiesFetched:n,resolveDesignValue:i,definition:r,options:a})=>{let o=tv(e=>e.unboundValues),s=tv(e=>e.hyperLinkPattern),l=tv(e=>e.locale),d=tv(e=>e.dataSource),c=tm(e=>e.findNodeById),u=(0,h.useMemo)(()=>{let a={cfSsrClassName:e.data.props.cfSsrClassName?i(e.data.props.cfSsrClassName.valuesByBreakpoint):void 0};if(!r||e.type===tf)return a;let u=Object.entries(r.variables).reduce((a,[u,p])=>{let f=e.data.props[u];if(!f)return{...a,[u]:p.defaultValue};if("DesignValue"===f.type){let t=i((({variableName:e,variableMapping:t,node:n,findNodeById:i})=>{if("assemblyBlock"===n.type){let r=n.data.pattern?.id,a=n.exposedPropertyNameToKeyMap[e];if(!a||!r)return t.valuesByBreakpoint;let o=tE.get(r)?.definition.variables[a],s=o?.defaultValue,l=i(n.data.pattern?.nodeId);for(;l;){let e=l.data.pattern?.id,t=l.exposedPropertyNameToKeyMap[a];if(!e||!t)break;let n=tE.get(e)?.definition.variables[t];s=eN(n?.defaultValue,s),l=i(l.data.pattern?.nodeId)}let d=eN(s,t);return d?.valuesByBreakpoint}return t.valuesByBreakpoint})({variableName:u,variableMapping:f,node:e,findNodeById:c}),u),n="cfHeight"===u?(({blockId:e,children:t,value:n})=>e&&$(e)&&"auto"===n?t.length?"100%":"80px":n)({blockId:e.data.blockId,children:e.children,value:t}):t;return{...a,[u]:n}}if("HyperlinkValue"===f.type){let e=d[f.linkTargetKey],n=t.getEntryOrAsset(e,f.linkTargetKey);return{...a,[u]:((e,t,n)=>t&&n?function({template:e,context:t}){return e.replace(/{\s*locale\s*}/g,t.locale).replace(/{\s*([\S]+?)\s*}/g,(e,n)=>{let i=n+"_NOT_FOUND",r=function(e,t){let n=function(e,t){let n="fields",i=e.indexOf(n);if(-1!==i){let r=e.indexOf(".",i+n.length+1);if(-1!==r)return e.slice(0,r+1)+t+"."+e.slice(r+1)}return e}(t,e.locale),i=n.replace(/\[/g,".").replace(/\]/g,"").split(".").reduce((e,t)=>
3(e||{})[t],e);return"object"==typeof i&&null!==i?i[e.locale]:i}(t,n)??i;return String("function"==typeof r?r():r)})}({template:e,context:{entry:t,locale:n}}):null)(r.hyperlinkPattern||s||"/{locale}/{entry.fields.slug}/",n,l)}}if("BoundValue"===f.type){let o,[,s,l]=f.path.split("/"),c=d[s];if(!c)return{...a,[u]:p.defaultValue};if(c&&eL(f)&&f.isPrebound){let n=eU(f,e=>{let n=d[e];return t.getEntityFromLink(n)});if(!n)return{...a,[u]:p.defaultValue};o=e3(e.data.props,t,c,i,u,p.type,n)}else{let n=r.variables[u];o=e3(e.data.props,t,c,i,u,n.type,f.path)}if(!o&&l){let e=n?t.getValue(c,l.split("/").slice(0,-2)):void 0;(e=>null!==e&&"object"==typeof e&&"sys"in e&&null!==e.sys&&"object"==typeof e.sys&&"linkType"in e.sys&&"id"in e.sys&&"type"in e.sys&&e.sys?.linkType==="Asset"&&"string"==typeof e.sys?.id&&!!e.sys?.id&&e.sys?.type==="Link")(e)&&(o=e)}let y=o||p.defaultValue;return{...a,[u]:y}}if("UnboundValue"===f.type){let e=(({key:e,fallback:t,unboundValues:n})=>{let i=`${e}.value`;return(0,k.A)(n,i,t)})({key:f.key,fallback:p.defaultValue,unboundValues:o||{}});return{...a,[u]:e}}if("ComponentValue"===f.type)return{...a,[u]:p.defaultValue};else return{...a}},{});return{...a,...u}},[s,e,l,r,i,d,n,o,t,c]),p=(0,h.useMemo)(()=>({...(e=>Object.fromEntries(Object.entries({margin:e.cfMargin,padding:e.cfPadding,backgroundColor:e.cfBackgroundColor,width:e.cfWidth||e.cfImageOptions?.width,height:e.cfHeight||e.cfImageOptions?.height,maxWidth:e.cfMaxWidth,...(e=>e?{gridColumn:`span ${e}`}:{})(e.cfColumnSpan),...(e=>{if(!e)return{};let t=e.split(" ");if(t.length<3)return{border:e};let[n,i,...r]=t,a=r.join(" ");return{border:`${n} ${i} ${a}`}})(e.cfBorder),borderRadius:e.cfBorderRadius,gap:e.cfGap,...((e,t,n="column")=>"row"===n?{alignItems:e,justifyContent:"center"===t?`safe ${t}`:t}:{alignItems:t,justifyContent:"center"===e?`safe ${e}`:e})(e.cfHorizontalAlignment,e.cfVerticalAlignment,e.cfFlexDirection),flexDirection:e.cfFlexReverse&&e.cfFlexDirection?`${e.cfFlexDirection}-reverse`:e.cfFlexDirection,flexWrap:e.cfFlexWrap,...((e,t)=>{let n,i;if(e){if("string"==typeof e)n=`url(${e})`;else{let t=e.srcSet?.join(",");n=`url(${e.url})`,i=`image-set(${t})`}return{backgroundImage:n,backgroundImage2:i,backgroundRepeat:t?.scaling==="tile"?"repeat":"no-repeat",backgroundPosition:(e=>{if(!e||"string"!=typeof e)return;let[t,n]=e.trim().split(/\s+/,2),i=["left","right","center"].includes(t),r=["top","bottom","center"].includes(n);return t=i?t:"left",n=r?n:"top",`${t} ${n}`})(t?.alignment),backgroundSize:(e=>"fill"===e?"cover":"fit"===e?"contain":void 0)(t?.scaling)}}})(e.cfBackgroundImageUrl,e.cfBackgroundImageOptions),fontSize:e.cfFontSize,fontWeight:e.cfTextBold?"bold":e.cfFontWeight,fontStyle:e.cfTextItalic?"italic":void 0,textDecoration:e.cfTextUnderline?"underline":void 0,lineHeight:e.cfLineHeight,letterSpacing:e.cfLetterSpacing,color:e.cfTextColor,textAlign:(e=>{if(e){if(!({...ek}).__disableTextAlignmentTransform){if("left"===e)return"start";if("right"===e)return"end"}return e}})(e.cfTextAlign),textTransform:e.cfTextTransform,objectFit:e.cfImageOptions?.objectFit,objectPosition:e.cfImageOptions?.objectPosition}).filter(([,e])=>void 0!==e)))(u),...!1===u.cfVisibility?{display:"none !important"}:{}}),[u]),f=(0,h.useMemo)(()=>{let t,n;return!e.children.some(e=>nv(e,i))&&(t=e.data.blockId,n=p.height,!!($(t)&&!n?.toString().endsWith("px")||r?.children))},[p.height,r?.children,e.children,e.data.blockId,i]),y=(({styles:e,nodeId:t})=>{let[n,i]=(0,h.useState)("");return(0,h.useLayoutEffect)(()=>{if(0===Object.keys(e).length)return;let[r,a]=(({styles:e,nodeId:t})=>{let n=((e,t=!1)=>Object.entries(e).filter(([,e])=>void 0!==e).map(([e,n])=>t?`${eQ(e)}: ${n};`:`${eQ(e)}:${n};`).join(t?"\n":""))(e,!0),i=`cfstyles-${t||v(n)}`,r=`.${i}{ ${n} }`;return[i,r]})({styles:e,nodeId:t});((e,t)=>{let n=document.querySelector(`[data-cf-styles="${e}"]`);if(n){n.innerHTML=t;return}let i=document.createElement("style");i.dataset.cfStyles=e,document.head.appendChild(i).innerHTML=t})(r,a),n!==r&&(i(r),(e=>{let t=document.querySelector(`[data-cf-styles="${e}"]`);t&&document.head.removeChild(t)})(n))},[e,t,n]),n})({styles:(0,h.useMemo)(()=>({...p,...f&&{minHeight:ty,minWidth:ty}}),[p,f]),nodeId:e.data.id}),m=(0,h.useMemo)(()=>{let t={};if(a?.enableEditorProperties?.isEditorMode&&(t.isEditorMode=!0),a?.enableEditorProperties?.isEmpty){let n=e.children.every(e=>!nv(e,i));t.isEmpty=0===e.children.length||n}
3return a?.enableEditorProperties?.nodeBlockId&&(t.nodeBlockId=e.data.blockId),a?.enableCustomEditorView&&(t.isInExpEditorMode=!0),t},[a?.enableEditorProperties?.isEditorMode,a?.enableEditorProperties?.isEmpty,a?.enableEditorProperties?.nodeBlockId,a?.enableCustomEditorView,e,i]);return{componentProps:(0,h.useMemo)(()=>{let t={"data-cf-node-id":e.data.id,"data-cf-node-block-id":e.data.blockId,"data-cf-node-block-type":e.type,className:u.cfSsrClassName??y};return{...(e=>{let t=[...eW,...eH];return Object.fromEntries(Object.entries(e).filter(([e])=>!t.includes(e)))})(u),...m,...t}},[y,m,e,u])}})({node:e,resolveDesignValue:t,definition:n.definition,options:n.options,entityStore:a,areEntitiesFetched:o});return h.createElement(tw,{componentId:e.data.blockId},h.createElement(n.component,{...s,...i},...r??[]))};var nI={"empty-canvas-container":"EmptyCanvasMessage-module_empty-canvas-container__7K-0l","empty-canvas-icon":"EmptyCanvasMessage-module_empty-canvas-icon__EztFr","empty-canvas-label":"EmptyCanvasMessage-module_empty-canvas-label__cbIrR"};(0,g.A)(".EmptyCanvasMessage-module_empty-canvas-container__7K-0l {\n  height: 200px;\n  display: flex;\n  width: 100%;\n  align-items: center;\n  justify-content: center;\n  flex-direction: row;\n  transition: all 0.2s;\n  color: var(--exp-builder-gray400);\n  font-size: var(--exp-builder-font-size-l);\n  font-family: var(--exp-builder-font-stack-primary);\n  outline: 2px dashed var(--exp-builder-gray400);\n  outline-offset: -2px;\n}\n\n.EmptyCanvasMessage-module_empty-canvas-icon__EztFr rect {\n  fill: var(--exp-builder-gray400);\n}\n\n.EmptyCanvasMessage-module_empty-canvas-label__cbIrR {\n  margin-left: var(--exp-builder-spacing-s);\n}\n");let nw=()=>h.createElement("div",{className:nI["empty-canvas-container"],"data-type":"empty-container"},h.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"37",height:"36",fill:"none",className:nI["empty-canvas-icon"]},h.createElement("rect",{width:"11.676",height:"11.676",x:"18.512",y:".153",rx:"1.621",transform:"rotate(45 18.512 .153)"}),h.createElement("rect",{width:"11.676",height:"11.676",x:"9.254",y:"9.139",rx:"1.621",transform:"rotate(45 9.254 9.139)"}),h.createElement("rect",{width:"11.676",height:"11.676",x:"18.011",y:"18.625",rx:"1.621",transform:"rotate(45 18.01 18.625)"}),h.createElement("rect",{width:"11.676",height:"11.676",x:"30.557",y:"10.131",rx:"1.621",transform:"rotate(60 30.557 10.13)"}),h.createElement("path",{fill:"#fff",stroke:"#fff",strokeWidth:".243",d:"M31.113 17.038a.463.463 0 0 0-.683-.517l-1.763 1.032-1.033-1.763a.464.464 0 0 0-.8.469l1.034 1.763-1.763 1.033a.463.463 0 1 0 .468.8l1.763-1.033 1.033 1.763a.463.463 0 1 0 .8-.469l-1.033-1.763 1.763-1.033a.463.463 0 0 0 .214-.282Z"})),h.createElement("span",{className:nI["empty-canvas-label"]},"Add components to begin")),nk=async(e,t)=>{let n={};nT(e.root,n);let i=document.documentElement.getBoundingClientRect(),r=document.body.getBoundingClientRect(),a=Math.max(document.documentElement.offsetWidth,i.width,r.width),o=Math.max(document.documentElement.offsetHeight,i.height,r.height,function e(t=2,n=document.body){if(t<=0)return 0;let i=0;for(let r of n.children){let n=r.getBoundingClientRect(),a=window.getComputedStyle(r),o=0===n.width&&0===n.height||"none"===a.display||"hidden"===a.visibility,s=("fixed"===a.position||"absolute"===a.position||"relative"===a.position||"sticky"===a.position)&&0>parseFloat(a.bottom);o||s||(i=Math.max(i,Math.ceil(n.bottom),e(t-1,r)))}return i}());e7(td.CanvasGeometryUpdated,{size:{width:a,height:o},nodes:n,sourceEvent:t})},nT=(e,t)=>{let n=document.querySelector(`[data-cf-node-id="${e.data.id}"]`);if(n){let i=eD(n);if((e=>0===e.width&&0===e.height&&0===e.x&&0===e.y)(i))return;t[e.data.id]={coordinates:{x:i.x+window.scrollX,y:i.y+window.scrollY,width:i.width,height:i.height}}}e.children.forEach(e=>nT(e,t))};(0,g.A)("body {\n  margin: 0;\n}\n\nhtml {\n  -ms-overflow-style: none; /* Internet Explorer 10+ */\n  scrollbar-width: none; /* Firefox */\n}\n\nhtml::-webkit-scrollbar {\n  display: none;\n}\n");let nS=({inMemoryEntitiesStore:e,canvasMode:t})=>{!function(e){let t=e(e=>e.entityStore),n=e(e=>e.areEntitiesFetched),i=e(e=>e.setEntitiesFetched),r=e(e=>e.resetEntityStore),{updateTree:a,updateNodesByUpdatedEntity:o}=tm(e=>({updateTree:e.updateTree,updateNodesByUpdatedEntity:e.updateNodesByUpdatedEntity})),s=tv(e=>e.unboundValues),l=tv(e=>e.dataSource),c=tv(e=>e.setLocale),u=tv(e=>e.setUnboundValues),p=tv(e=>e.setDataSource);(0,h.useEffect)(()=>{e7(td.RequestComponentTreeUpdate,void 0)},[]);let f=(0,h.useCallback)(async(e,t,n)=>{let r=()=>{i(!1)},a=Object.values(t),o=async({entityLinksL1:t})=>{let{missingAssetIds:n,missingEntryIds:i}=e.getMissingEntityIds(t);await e.fetchEntities({missingAssetIds:n,missingEntryIds:i})},s=async({deepReferences:t})=>{let n=t.map(t=>t.extractReferent(e)).filter(eB),{missingAssetIds:i,missingEntryIds:r}=e.getMissingEntityIds(n);await e.fetchEntities({missingAssetIds:i,missingEntryIds:r})};try{(t=>{let{missingAssetIds:n,missingEntryIds:i}=e.getMissingEntityIds(t);return!!n.length||!!i.length}
3)(a)&&(r(),await o({entityLinksL1:a}));let i=function(e,t,n){let i=[];return e5(e,e=>{if(e.data.props){for(let[,r]of Object.entries(e.data.props))if("BoundValue"===r.type){if(eF(r.path))i.push(ta.from({path:r.path,dataSource:t}));else if(eL(r)&&e_(r)){let e=eU(r,e=>{let i=t[e];if(i)return n(i)});if(!e)continue;i.push(ta.from({path:e,dataSource:t}))}}}}),i}(n.root,t,e.getEntityFromLink.bind(e));(t=>{let n=t.map(t=>t.extractReferent(e)).filter(eB),{missingAssetIds:i,missingEntryIds:r}=e.getMissingEntityIds(n);return!!i.length||!!r.length})(i)&&(r(),await s({deepReferences:i}))}catch(e){throw eA.error("[experiences-visual-editor-react::useEditorSubscriber] Failed fetching entities",{error:e}),e}finally{i(!0)}},[i]);(0,h.useEffect)(()=>{let e=async e=>{let n;if(n=(e=>{try{return e4(e),!1}catch(e){if(e instanceof e6)return e.message;throw e}})(e))return void(e.origin.startsWith("http://localhost")&&`${e.data}`.includes("webpackHotUpdate")?(e7(td.CanvasReload,void 0),setTimeout(()=>{window.location.reload()},50)):eA.warn(`[experiences-visual-editor-react::onMessage] Ignoring alien incoming message from origin [${e.origin}], due to: [${n}]`,e));let i=e4(e);if(eA.debug(`[experiences-visual-editor-react::onMessage] Received message [${i.eventType}]`,i),i.eventType!==d.REQUESTED_ENTITIES)switch(i.eventType){case tc.ExperienceUpdated:{let{tree:e,locale:n,changedNode:o,changedValueType:d}=i.payload,y=t;if(t.locale!==n&&(y=new tt({locale:n,entities:[]}),c(n),r(y)),o)if("BoundValue"===d){let t={...l,...o.data.dataSource};p(t),await f(y,t,e)}else"UnboundValue"===d&&u({...s,...o.data.unboundValues});else{let{dataSource:t,unboundValues:n}=(e=>{let t={},n={},i=[...e.root.children];for(;i.length;){let e=i.shift();e&&(t={...t,...e.data.dataSource},n={...n,...e.data.unboundValues},e.children.length&&i.push(...e.children))}return{dataSource:t,unboundValues:n}})(e);p(t),u(n),await f(y,t,e)}a(e);break}case tc.AssembliesRegistered:case tc.AssembliesAdded:break;case tc.UpdatedEntity:{let{entity:e,shouldRerender:n}=i.payload;if(e){let i=t.entities.find(t=>t.sys.id===e.sys.id),r=i?.sys.version!==e.sys.version;t.updateEntity(e),n&&r&&o(e.sys.id)}break}case tc.RequestEditorMode:break;default:Object.values(tc).includes(i.eventType)||eA.error(`[experiences-visual-editor-react::onMessage] Logic error, unsupported eventType: [${i.eventType}]`)}};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}},[t,p,c,l,n,f,u,s,a,o,r])}(e);let n=tm(e=>e.tree);(({tree:e,canvasMode:t})=>{let n=(0,h.useMemo)(()=>(0,T.A)((e,t)=>{window.requestAnimationFrame(()=>{nk(e,t)})},100,{leading:!0,trailing:!0}),[]),[i]=(0,h.useState)(()=>new ResizeObserver(()=>{n(a.current,"mediaResize")})),r=(0,h.useMemo)(()=>(0,T.A)(()=>{for(let e of Array.from(document.querySelectorAll("img, video")))i.observe(e)},300,{trailing:!0}),[i]),a=(0,h.useRef)(e);(0,h.useEffect)(()=>{a.current=e},[e]),(0,h.useEffect)(()=>{let e=()=>{n(a.current,"resize")};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[n]),(0,h.useEffect)(()=>{let e=new MutationObserver(()=>{n(a.current,"mutation"),r()});return n(a.current,"mutation"),e.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),()=>e.disconnect()},[r,n]),(0,h.useEffect)(()=>{if(t!==l.EDITOR)return;let e=e=>{e.preventDefault(),e7(td.CanvasPan,{ctrlKey:e.ctrlKey,metaKey:e.metaKey,clientX:e.clientX,clientY:e.clientY,deltaX:e.deltaX,deltaY:e.deltaY})};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e)},[t])})({tree:n,canvasMode:t});let{resolveDesignValue:i}=(e=>{let[,t]=eS(e),[n,i]=(0,h.useState)(t);return(0,h.useEffect)(()=>{let[t]=eS(e),n=t.map(({id:e,signal:t})=>{let n=()=>i(n=>({...n,[e]:t.matches}));return t.addEventListener("change",n),n});return()=>{n.forEach((e,n)=>{t[n].signal.removeEventListener("change",e)})}},[e]),{resolveDesignValue:(0,h.useCallback)((t,i)=>{let r=Math.max(e.findIndex(({query:e})=>"*"===e),0),a=((e,t,n)=>{let i,r=e.map(({id:e},i)=>({id:e,index:i,isMatch:t[e]??i===n}));return(i=({isMatch:e})=>e,[...r].reverse().find(i))?.index??n})(e,n,r);return((e,t,n,i,r,a=!0)=>{let o=e=>a&&r&&ej.includes(r)?((e,t)=>
3{if(!e)return e;let n="",i=e.match(/(\${.+?}|\S+)/g);if(i)for(let e of i){let i=R.test(e)?D(e,t):e;n+=`${i} `}return n.trim()})(e,r):e;if(!(e instanceof Object))return e;{for(let i=n;i>=0;i--){let n=t[i]?.id;if(eC(e[n]))return o(e[n])}let r=t[i]?.id;if(eC(e[r]))return o(e[r])}})(t,e,a,r,i)},[n,e])}})(tm(e=>e.breakpoints)),r=n.root.data.blockId??to,a=r!==to?new Set([r]):new Set,o=e(e=>e.entityStore),s=e(e=>e.areEntitiesFetched),c=nv(n.root,i);return h.createElement(h.Fragment,null,c?n.root.children.map(e=>h.createElement(nz,{key:e.data.id,node:e,resolveDesignValue:i,wrappingPatternIds:a,entityStore:o,areEntitiesFetched:s})):h.createElement(nw,null))},nj=({experience:e,inMemoryEntitiesStore:t=ti,canvasMode:n})=>{let i=(e=>{let t=tv(e=>e.initializeEditor),[n,i]=(0,h.useState)(!1),r=(0,x.Pj)(e,e=>e.resetEntityStore);return(0,h.useEffect)(()=>{let e=e=>{if(!e.detail)return;let{componentRegistry:n,designTokens:a,sdkOptions:o,locale:s,entities:l}=e.detail;t({initialLocale:s,componentRegistry:n,designTokens:a,sdkOptions:o}),r(new tt({locale:s,entities:l})),i(!0)};return window.addEventListener(tu.VisualEditorInitialize,e),()=>{window.removeEventListener(tu.VisualEditorInitialize,e)}},[t,r]),(0,h.useEffect)(()=>{n||window.dispatchEvent(new CustomEvent(tp.Ready))},[n]),n})(t),r=tv(e=>e.setHyperLinkPattern);return((0,h.useEffect)(()=>{e?.hyperlinkPattern&&r(e.hyperlinkPattern)},[e?.hyperlinkPattern,r]),i)?h.createElement(nS,{inMemoryEntitiesStore:t,canvasMode:n}):null}}}]);
4//# sourceMappingURL=c44f3486.2d1c9fd2979abc1f.js.map
5//# debugId=1866149d-13a5-5f85-b3d1-c023f181e400

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.