@rulecms/widget-svelte 0.8.1 → 0.8.3
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/README.md +3 -1
- package/dist/index.cjs +34 -34
- package/dist/index.js +1567 -1589
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ Fetches a widget by **token + key** and renders the `itemList` layout tree throu
|
|
|
10
10
|
npm install @rulecms/widget-svelte @rulecms/source-components-svelte
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
Peer dependency: `svelte` >= 5.
|
|
13
|
+
Peer dependency: `svelte` >= 5.41.1. The package ships compiled components, and earlier Svelte runtimes switch their `{#if}` blocks wrongly.
|
|
14
14
|
|
|
15
15
|
## Usage
|
|
16
16
|
|
|
@@ -39,6 +39,8 @@ Same routing rules as `@rulecms/widget-react`.
|
|
|
39
39
|
|
|
40
40
|
## Server-side rendering
|
|
41
41
|
|
|
42
|
+
> **Not working yet.** The package ships components compiled for the browser, so `render` from `svelte/server`, which SvelteKit uses to render a page on the server, throws `effect_orphan` on them. Render the widget in the browser until a server build ships.
|
|
43
|
+
|
|
42
44
|
Fetch widget data on the server (or at build time), then render with pre-fetched data so images and content appear in the initial HTML.
|
|
43
45
|
|
|
44
46
|
```ts
|
package/dist/index.cjs
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
"use strict";var Ir=Object.defineProperty;var Pr=(e,t,r)=>t in e?Ir(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var it=(e,t,r)=>Pr(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("svelte/internal/disclose-version");const Dr=require("svelte/internal/client"),Re=require("svelte");function xr(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const n=xr(Dr),ee="default";function Be(e,t){return!(e!=null&&e.length)||e===ee?t:`${e}/${t}`}const Lr=`RuleCMS widget: this widget config uses components from the default component library, but no "default" library is registered. The default library is registered by the consumer app: add the RuleCMS default source components package as a direct dependency and register it, e.g. libraries: { default: sourceComponentsModule } (statically imported for SSR) or libraries: { default: () => import('<default source components package>') }. See the @rulecms/widget-svelte README.`;function lt(e){if(!e||typeof e!="object")return!1;const t=e;return!!t.manifest&&typeof t.manifest=="object"&&!!t.components&&typeof t.components=="object"&&!Array.isArray(t.components)}function kr(e){if(lt(e))return e;const t=e;return lt(t==null?void 0:t.default)?t.default:null}function Le(e){return e.usesDefaultLibrary?[ee,...e.libraryIds]:[...e.libraryIds]}function at({registrations:e,referenced:t}){if(t.usesDefaultLibrary&&!(e!=null&&e[ee]))throw new Error(Lr)}function Rr(e){const t=[],r=new Set;for(const o of e.values()){if(typeof o.stylesheet!="string")continue;const s=o.stylesheet.trim();!s||r.has(s)||(r.add(s),t.push(s))}return t.length>0?t:void 0}function ht(e){const t={};for(const[o,s]of e){const i=o===ee;for(const[l,a]of Object.entries(s.components))t[i?l:`${o}/${l}`]=a}const r=Rr(e);return r?{components:t,stylesheets:r}:{components:t}}function ie(){const e=new Map,t=new Map,r=new Map,o=new Map;let s=0;function i(u,c){var f;e.get(u)!==c&&((f=c.manifest)!=null&&f.id&&c.manifest.id!==u&&console.warn(`RuleCMS widget: component library registered as "${u}" declares manifest id "${c.manifest.id}". The registered id wins for resolution.`),e.set(u,c),s+=1)}function l(u){const c=Le(u),f=[...c].sort().join("|"),p=o.get(f);if(p&&p.loadedVersion===s)return p.plugin;const g=new Map;for(const A of c){const b=e.get(A);b&&g.set(A,b)}const E=ht(g);return o.set(f,{loadedVersion:s,plugin:E}),E}function a(u){at(u);const{registrations:c,referenced:f}=u;for(const p of Le(f)){if(e.has(p)||r.has(p))continue;const g=c==null?void 0:c[p];if(!g){console.error(`RuleCMS widget: no component library registered for libraryId "${p}"; its components will not render.`),r.set(p,new Error(`No registration for libraryId "${p}"`));continue}if(typeof g=="function")return null;i(p,g)}return l(f)}async function d(u){at(u);const{registrations:c,referenced:f}=u,p=Le(f);return await Promise.all(p.map(async g=>{if(e.has(g)||r.has(g))return;const E=c==null?void 0:c[g];if(!E){console.error(`RuleCMS widget: no component library registered for libraryId "${g}"; its components will not render.`),r.set(g,new Error(`No registration for libraryId "${g}"`));return}if(typeof E!="function"){i(g,E);return}let A=t.get(g);A||(A=E().then(b=>{const _=kr(b);if(!_)throw new Error(`Registration for libraryId "${g}" did not resolve to a ComponentLibraryModule (expected { manifest, components }).`);i(g,_)}).catch(b=>{r.set(g,b),console.error(`RuleCMS widget: failed to load component library "${g}":`,b)}).finally(()=>{t.delete(g)}),t.set(g,A)),await A})),l(f)}return{resolveSync:a,resolve:d}}const Oe={Preview:"Preview",Compose:"Compose",RenderedPage:"RenderedPage"},be={DroppableBox:"droppable-box"},We={FlexStart:"flex-start",FlexEnd:"flex-end",Center:"center",SpaceBetween:"space-between",SpaceAround:"space-around",SpaceEvenly:"space-evenly"},Or={FlexStart:"flex-start",FlexEnd:"flex-end",Center:"center",SpaceBetween:"space-between",SpaceAround:"space-around",SpaceEvenly:"space-evenly",Stretch:"stretch"},ge="cssAttrArray",Wr={Phone:"phone",Tablet:"tablet",Desktop:"desktop"},Ue={ComposerComponent:"ComposerWidget",Collection:"Collection",MoveComponentHandle:"MoveWidgetHandle"},He=`${Ue.Collection}_`,bt="dev.",_t="https://rulecms.com",Ct="https://widget-cache.rulecms.com",vt="/api/v1/c/widget/get",At="/api/v1/c/dev/widget/get",Et="/api/v1/c/widget/resolve",wt="/api/v1/c/dev/widget/resolve";function G(e){return typeof e=="string"&&e.startsWith(bt)}function ze(e,t){return t?t.replace(/\/$/,""):G(e)?_t:Ct}function Ge({publishedKey:e,token:t,endpoint:r}){const o=G(t),s=o?At:vt,i=o?new URLSearchParams({widgetKey:e,token:t}):new URLSearchParams({publishedKey:e,token:t});return`${ze(t,r)}${s}?${i.toString()}`}function Ye({token:e,endpoint:t}){const r=G(e)?wt:Et;return`${ze(e,t)}${r}`}const Nr=({id:e,prefix:t})=>`${t}_${e}`,St=e=>{if(!(e!=null&&e.length)||!e.includes("_")){console.error(`Invalid drag item id: ${e}. Type does not exist.`);return}return Tt(e)},Xe=e=>e.includes("_"),Tt=e=>{const t=e.indexOf("_"),r=e.substring(0,t),o=e.substring(t+1);return{prefix:r,id:o}},Je=e=>{if(!Xe(e))return;const r=St(e);return(r==null?void 0:r.prefix)===Ue.Collection||console.error("getCollectionIdForCollectionType - Invalid component type: ${componentType}. Invalid prefix type."),r==null?void 0:r.id},Mr=e=>{if(!(e!=null&&e.length)){console.error("getNameAndInstanceIdFromWidgetKey: Missing widget key");return}const t=e.split("$");if(t.length<2){console.error("getNameAndInstanceIdFromWidgetKey: Invalid widget key format");return}const r=t[0];if(!t[1].includes("@"))return{name:r,instanceId:t[1]};const s=t[1].split("@");return{name:r,instanceId:s[0],parentId:s[1]}},jr=e=>{if(!(e!=null&&e.length))return{errorMessage:"getNameFromWidgetKey: Missing widget key"};const t=e.split("$");return t.length<2?{errorMessage:"getNameFromWidgetKey: Invalid widget key format"}:{name:t[0]}},It=e=>{var s,i,l,a;if(!e)return{error:"getWidgetKeyForCollection: Missing collection"};if(!((s=e.name)!=null&&s.length))return{error:"getWidgetKeyForCollection: Missing collection name"};const t=(i=e.name)==null?void 0:i.trim().toLowerCase();if(!((l=e.id)!=null&&l.length))return{error:"getWidgetKeyForCollection: Missing collection id"};const o=((a=e.parentId)==null?void 0:a.length)?`${e.id}@${e.parentId}`:`${e.id}`;return{data:`${t}$${o}`}},Pt=e=>{var s,i,l,a;if(!e)return{error:"getWidgetKeyForPublishedCollection: Missing collection"};if(!((s=e.name)!=null&&s.length))return{error:"getWidgetKeyForPublishedCollection: Missing collection name"};const t=(i=e.name)==null?void 0:i.trim().toLowerCase();if(!((l=e.publishedKey)!=null&&l.length))return{error:"getWidgetKeyForPublishedCollection: Missing collection publishedKey"};const o=((a=e.parentId)==null?void 0:a.length)?`${e.publishedKey}@${e.parentId}`:`${e.publishedKey}`;return{data:`${t}$${o}`}},Vr=e=>{const t=It(e);return`${He}${t.data}`},Fr=e=>{const t=Pt(e);return`${He}${t.data}`},pe="---",Dt="___";function xt(e,t){return`${e}${pe}${t}`}function Kr(e,t,r){return`${xt(e,t)}${Dt}${r}`}function Br(e){const t=e.split(".");if(t.length!==3)throw new Error(`Invalid version format: ${e}. Expected format: x.y.z`);const r=t[0],o=t[1],s=parseInt(t[2],10);if(isNaN(s))throw new Error(`Invalid patch version: ${t[2]}. Expected a number.`);return`${r}.${o}.${s+1}`}function _e({displayItemList:e,widgetCollections:t}){const r=new Set;let o=!1;const s=i=>{var l,a,d;if((l=i==null?void 0:i.rows)!=null&&l.length){for(const u of i.rows)if((a=u==null?void 0:u.columns)!=null&&a.length)for(const c of u.columns)c.collection&&s(c.collection.collectionRows),!(!c.type||c.type===be.DroppableBox)&&(Xe(c.type)||(!((d=c.libraryId)!=null&&d.length)||c.libraryId===ee?o=!0:r.add(c.libraryId)))}};s(e);for(const i of Object.values(t??{}))s(i==null?void 0:i.collectionRows);return{libraryIds:Array.from(r),usesDefaultLibrary:o}}const qe=Symbol("rulecms-widget-context");function Ur(){return{token:"",endpoint:void 0,libraries:void 0,libraryRegistry:ie()}}function Hr(e,t){n.push(t,!0);const r=n.proxy(Ur());function o(){r.token=t.token,r.endpoint=t.endpoint,r.libraries=t.libraries}o(),n.user_effect(o),Re.setContext(qe,r);var s=n.comment(),i=n.first_child(s);n.snippet(i,()=>t.children),n.append(e,s),n.pop()}const Lt="1200px",Ze="500px",Qe="820px",zr=Lt,kt="rulecms",Gr=1920,Yr={f:"auto",q:"auto",c:"limit"},Xr=/^[A-Za-z0-9][A-Za-z0-9._\-/]*$/,Jr=300,qr=/^[A-Za-z0-9][A-Za-z0-9_-]*$/,Zr=100,Qr=/^https:\/\/[^\s"'()\\<>]+$/,$r=2e3,eo=/^[A-Za-z0-9_,.:\-/]*$/,to=300,Rt=e=>typeof e=="string"&&e.length<=Jr&&Xr.test(e),Ot=e=>typeof e=="string"&&e.length<=Zr&&qr.test(e),Wt=e=>typeof e=="string"&&e.length<=$r&&Qr.test(e),Nt=e=>typeof e=="string"&&e.length<=to&&eo.test(e),no=e=>Object.entries(e).map(([t,r])=>`${t}_${r}`).join(","),ro=e=>{const t={};for(const r of e.split(",")){const o=r.trim(),s=o.indexOf("_");s<=0||(t[o.slice(0,s)]=o.slice(s+1))}return t},Mt=({publicId:e,cloudName:t=kt,transformations:r,width:o=Gr})=>{const s=typeof r=="string"?ro(r):r,i={...Yr,...s,w:o};return encodeURI(`https://res.cloudinary.com/${t}/image/upload/${no(i)}/${e}`)},jt=/^--[A-Za-z0-9_-]+$/,Vt=200,Q=e=>{if(typeof e!="string")return!1;const t=e.trim();return t.length<=Vt&&jt.test(t)},F=e=>`var(${e.trim()})`,L=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return;const t=e.cssVariable;if(t!=null)return Q(t)?t.trim():void 0},U=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e.cssVariable;return t==null?!1:!Q(t)},oo=(e,t)=>{const r=L(e);return r?{[t]:F(r)}:void 0},Ft=e=>{if(typeof e!="object"||e===null||Array.isArray(e)||U(e))return!1;if(L(e))return!0;const t=e;return t.source==="none"?!0:t.source==="url"?Wt(t.url):t.source==="cloudinary"?!Rt(t.publicId)||t.cloudName!==void 0&&t.cloudName!==null&&!Ot(t.cloudName)?!1:t.transformations===void 0||t.transformations===null||Nt(t.transformations):!1},Kt=["px","%","em","rem","vh","vw"],Ce=["inherit","unset"],Bt=["allSides","top","right","bottom","left"],q=(e,t={})=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const r=e;return U(e)?!1:L(e)?!0:r.unit==="auto"?t.allowAuto!==!1:r.unit==="keyword"?t.allowKeywords!==!1&&Ce.includes(r.keyword):Kt.includes(r.unit)?typeof r.value!="number"||!Number.isFinite(r.value)?!1:t.allowNegative!==!1||r.value>=0:!1},Ut=(e,t={})=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const r=e;for(const o of Bt){const s=r[o];if(s!=null&&!q(s,t))return!1}return!0},so=[...Ce,"transparent","currentColor"],io=/^(#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})|rgba?\([^)]+\)|hsla?\([^)]+\))$/,ve=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return U(e)?!1:L(e)?!0:t.unit==="keyword"?so.includes(t.keyword):t.unit==="color"?typeof t.value=="string"&&io.test(t.value.trim()):!1},Ae=e=>{const t=L(e);return t?F(t):"unit"in e?e.unit==="keyword"?e.keyword:e.value.trim():""},Ht=(e,t)=>typeof e=="object"&&e!==null&&!Array.isArray(e)?!U(e)&&!!L(e):typeof e!="string"||!e.length?!1:t.includes(e)?!0:Ce.includes(e),zt=['system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif','Georgia, "Times New Roman", Times, serif',"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace","Arial, Helvetica, sans-serif",'"Helvetica Neue", Helvetica, Arial, sans-serif',"Verdana, Geneva, sans-serif"],Gt=["normal","bold","100","200","300","400","500","600","700","800","900"],Yt=["normal","italic","oblique"],Xt=["left","center","right","justify","start","end"],Jt=["none","underline","line-through","overline"],qt=["none","uppercase","lowercase","capitalize"],de=["visible","hidden","scroll","auto","clip"],Zt=["auto","none"],Qt=["flex-start","flex-end","center","space-between","space-around","space-evenly"],$t=["flex-start","flex-end","center","baseline","stretch"],en=["wrap","nowrap"],tn=["flex-start","flex-end","center","space-between","space-around","space-evenly","stretch"],nn=["row","row-reverse","column","column-reverse"],rn=["cover","contain","auto"],on=["center center","center top","center bottom","left center","left top","left bottom","right center","right top","right bottom"],sn=["no-repeat","repeat","repeat-x","repeat-y","space","round"],ln=["justifyContent","alignItems","flexWrap","alignContent","flexDirection"],an=["none","solid","dashed","dotted","double","groove","ridge","inset","outset"],cn=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?!U(e)&&!!L(e):an.includes(e),un=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return U(e)?!1:L(e)?!0:!(t.width!==void 0&&t.width!==null&&!q(t.width,{allowAuto:!1,allowNegative:!1})||t.style!==void 0&&t.style!==null&&!cn(t.style)||t.color!==void 0&&t.color!==null&&!ve(t.color))},lo={allowAuto:!1,allowKeywords:!1,allowNegative:!0},ao={allowAuto:!1,allowKeywords:!1,allowNegative:!1},dn=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;if(U(e))return!1;if(L(e))return!0;for(const r of["offsetX","offsetY","spread"]){const o=t[r];if(o!=null&&!q(o,lo))return!1}return!(t.blur!==void 0&&t.blur!==null&&!q(t.blur,ao)||t.color!==void 0&&t.color!==null&&!ve(t.color)||t.inset!==void 0&&t.inset!==null&&typeof t.inset!="boolean")},fn=e=>e?e.cssVariable!==void 0&&e.cssVariable!==null||e.offsetX!==void 0||e.offsetY!==void 0||e.blur!==void 0||e.spread!==void 0||e.color!==void 0:!1,gn=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return U(e)?!1:L(e)?!0:t.unit==="number"?typeof t.value=="number"&&Number.isFinite(t.value)&&t.value>0:q(e,{allowAuto:!1,allowNegative:!1})},pn=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?!U(e)&&!!L(e):typeof e=="number"&&Number.isFinite(e)&&e>=0&&e<=1,mn=e=>{if(!Ft(e))return{};const t=L(e);if(t)return{backgroundImage:F(t)};const r=e;return r.source==="none"?{backgroundImage:"none"}:r.source==="url"?{backgroundImage:`url("${r.url}")`}:{backgroundImage:`url("${Mt({publicId:r.publicId,cloudName:r.cloudName,transformations:r.transformations})}")`}},Z=e=>{const t=L(e);return t?F(t):"unit"in e?e.unit==="auto"?"auto":e.unit==="keyword"?e.keyword:`${e.value}${e.unit}`:""},yn=e=>{if(!un(e))return{};const t=L(e);if(t)return{border:F(t)};const r={};if(e.width&&(r.borderWidth=Z(e.width)),e.style){const o=L(e.style);r.borderStyle=o?F(o):e.style}return e.color&&(r.borderColor=Ae(e.color)),r},ce=e=>e?Z(e):"0px",hn=e=>{if(!dn(e)||!fn(e))return{};const t=L(e);if(t)return{boxShadow:F(t)};const r=[ce(e.offsetX),ce(e.offsetY),ce(e.blur),ce(e.spread)];return e.color&&r.push(Ae(e.color)),e.inset&&r.unshift("inset"),{boxShadow:r.join(" ")}},co=e=>`${e.charAt(0).toUpperCase()}${e.slice(1)}`,bn=(e,t)=>{if(!Ut(e))return{};if(e.allSides)return{[t]:Z(e.allSides)};const r={};for(const o of["top","right","bottom","left"]){const s=e[o];s&&(r[`${t}${co(o)}`]=Z(s))}return r},_n=(e,t)=>ve(e)?{[t]:Ae(e)}:{},Cn=(e,t,r)=>{if(!Ht(e,r))return{};const o=L(e);return o?{[t]:F(o)}:{[t]:e}},vn=(e,t,r={})=>q(e,r)?{[t]:Z(e)}:{},An=e=>{if(!gn(e))return{};const t=L(e);return t?{lineHeight:F(t)}:"unit"in e&&e.unit==="number"?{lineHeight:e.value}:{lineHeight:Z(e)}},En=e=>{if(!pn(e))return{};const t=L(e);return t?{opacity:F(t)}:{opacity:e}},Ee={"margin-3-resolutions":{kind:"boxSpacing",cssProperty:"margin"},"padding-3-resolutions":{kind:"boxSpacing",cssProperty:"padding"},"border-3-resolutions":{kind:"border"},"box-shadow-3-resolutions":{kind:"boxShadow"},"border-radius-3-resolutions":{kind:"length",cssProperty:"borderRadius",capabilities:{allowAuto:!1,allowNegative:!1}},"width-3-resolutions":{kind:"length",cssProperty:"width",capabilities:{allowAuto:!0,allowNegative:!1}},"height-3-resolutions":{kind:"length",cssProperty:"height",capabilities:{allowAuto:!0,allowNegative:!1}},"min-width-3-resolutions":{kind:"length",cssProperty:"minWidth",capabilities:{allowAuto:!1,allowNegative:!1}},"max-width-3-resolutions":{kind:"length",cssProperty:"maxWidth",capabilities:{allowAuto:!1,allowNegative:!1}},"min-height-3-resolutions":{kind:"length",cssProperty:"minHeight",capabilities:{allowAuto:!1,allowNegative:!1}},"max-height-3-resolutions":{kind:"length",cssProperty:"maxHeight",capabilities:{allowAuto:!1,allowNegative:!1}},"gap-3-resolutions":{kind:"length",cssProperty:"gap",capabilities:{allowAuto:!1,allowNegative:!1}},"justify-content-3-resolutions":{kind:"enum",cssProperty:"justifyContent",allowedValues:Qt},"align-items-3-resolutions":{kind:"enum",cssProperty:"alignItems",allowedValues:$t},"flex-wrap-3-resolutions":{kind:"enum",cssProperty:"flexWrap",allowedValues:en},"align-content-3-resolutions":{kind:"enum",cssProperty:"alignContent",allowedValues:tn},"flex-direction-3-resolutions":{kind:"enum",cssProperty:"flexDirection",allowedValues:nn},"overflow-3-resolutions":{kind:"enum",cssProperty:"overflow",allowedValues:de},"overflow-x-3-resolutions":{kind:"enum",cssProperty:"overflowX",allowedValues:de},"overflow-y-3-resolutions":{kind:"enum",cssProperty:"overflowY",allowedValues:de},"pointer-events-3-resolutions":{kind:"enum",cssProperty:"pointerEvents",allowedValues:Zt},"background-color-3-resolutions":{kind:"color",cssProperty:"backgroundColor"},"color-3-resolutions":{kind:"color",cssProperty:"color"},"background-image-3-resolutions":{kind:"backgroundImage"},"background-size-3-resolutions":{kind:"enum",cssProperty:"backgroundSize",allowedValues:rn},"background-position-3-resolutions":{kind:"enum",cssProperty:"backgroundPosition",allowedValues:on},"background-repeat-3-resolutions":{kind:"enum",cssProperty:"backgroundRepeat",allowedValues:sn},"opacity-3-resolutions":{kind:"opacity"},"font-family-3-resolutions":{kind:"enum",cssProperty:"fontFamily",allowedValues:zt},"font-size-3-resolutions":{kind:"length",cssProperty:"fontSize",capabilities:{allowAuto:!1,allowNegative:!1}},"font-weight-3-resolutions":{kind:"enum",cssProperty:"fontWeight",allowedValues:Gt},"font-style-3-resolutions":{kind:"enum",cssProperty:"fontStyle",allowedValues:Yt},"line-height-3-resolutions":{kind:"lineHeight"},"letter-spacing-3-resolutions":{kind:"length",cssProperty:"letterSpacing",capabilities:{allowAuto:!1,allowNegative:!0}},"text-align-3-resolutions":{kind:"enum",cssProperty:"textAlign",allowedValues:Xt},"text-decoration-3-resolutions":{kind:"enum",cssProperty:"textDecoration",allowedValues:Jt},"text-transform-3-resolutions":{kind:"enum",cssProperty:"textTransform",allowedValues:qt}},wn=(e,t)=>{const r=Ee[e];if(!r)return{};switch(r.kind){case"boxSpacing":return bn(t,r.cssProperty);case"length":return vn(t,r.cssProperty,r.capabilities);case"border":return yn(t);case"boxShadow":return hn(t);case"color":return _n(t,r.cssProperty);case"opacity":return En(t);case"enum":return Cn(t,r.cssProperty,r.allowedValues);case"lineHeight":return An(t);case"backgroundImage":return mn(t);default:return{}}},uo=Object.fromEntries(Object.entries(Ee).filter(([,e])=>e.kind==="boxSpacing").map(([e,t])=>[e,t.cssProperty])),fo=e=>e!=null&&e!=="",Sn=e=>e?!ln.some(r=>fo(e[r]))||e.display==="flex"?e:{...e,display:"flex"}:{},Tn=({dbEntryType:e,libraryId:t,sourceComponentsPlugin:r})=>{if(!(e!=null&&e.length))return;const o=r.components[Be(t,e)];if(!o||!("defaultAttributeValues"in o))return;const i=o.defaultAttributeValues;if(i!=null&&i.length)return i.reduce((l,a)=>({...l,[a.name]:a.defaultValues}),{})},Y=({deviceDisplayType:e,componentAttributes:t})=>{if(!t)return;const r={},o={};for(const[s,i]of Object.entries(t)){if(!s.includes("3-resolutions")||!i)continue;const l=i.all,a=l??i[e.toLowerCase()];o[s]=a,Ee[s]&&Object.assign(r,wn(s,a))}return Object.keys(r).length||Object.keys(o).length?{styles:Object.keys(r).length?r:void 0,componentAttributesSpecificToDeviceType:Object.keys(o).length?o:void 0}:void 0},In=({defaultAttributes:e,userModifiedAttributes:t})=>e?t?{...e,...t}:e:t;function se(e){return e.componentAttributes??e.widgetAttributes}function Ne({col:e,deviceDisplayType:t,isComposeMode:r,sourceComponentsPlugin:o}){const s=se(e),i=Tn({dbEntryType:e.type,libraryId:e.libraryId,sourceComponentsPlugin:o})||[],l=In({defaultAttributes:i,userModifiedAttributes:s}),{styles:a,componentAttributesSpecificToDeviceType:d}=Y({deviceDisplayType:t,componentAttributes:l})||{styles:void 0,componentAttributesSpecificToDeviceType:void 0};let u={};const c={};if(a)for(const[g,E]of Object.entries(a))r&&c[g]||(u={...u,[g]:E});let f=se(e);for(const g in d)if(g.includes("3-resolutions")){f={...se(e)||{},...d||{}};break}const p=Sn(u);if(r&&p.pointerEvents!==void 0){const g={...p};return delete g.pointerEvents,{componentAttributesBasedOnDevice:f,componentStyles:g}}return{componentAttributesBasedOnDevice:f,componentStyles:p}}const Pn=e=>{const t=(e==null?void 0:e.rows)||[];for(const r of t)if(((r==null?void 0:r.columns)||[]).length>0)return!0;return(e==null?void 0:e.containerAttributes)&&Object.keys(e.containerAttributes).length>0},Dn="var(--sl-spacing-x-small)";function xn(e){return e!=null&&e.horizontalAlignment||e!=null&&e.verticalAlignment||e!=null&&e.flexWrap||e!=null&&e.gap||e!=null&&e.alignContent?!0:!!(e!=null&&e.rowAttributes&&Object.keys(e.rowAttributes).length>0)}function Ln({row:e,deviceDisplayType:t}){var o;const r=Y({deviceDisplayType:t,componentAttributes:e.rowAttributes});return((o=r==null?void 0:r.componentAttributesSpecificToDeviceType)==null?void 0:o["hide-component-3-resolutions"])==="true"}function kn({row:e,deviceDisplayType:t,isComposeMode:r}){var g;const o=((g=Y({deviceDisplayType:t,componentAttributes:e.rowAttributes}))==null?void 0:g.styles)||{},s=o.justifyContent??e.horizontalAlignment??We.Center,i=o.alignItems??e.verticalAlignment??We.Center,l=o.flexDirection??"row",a=o.gap??e.gap??Dn,d=r?"nowrap":o.flexWrap??e.flexWrap??"nowrap",u=o.alignContent??e.alignContent??void 0,c=new Set(["justifyContent","alignItems","flexDirection","gap","flexWrap","alignContent","display"]),f={};for(const[E,A]of Object.entries(o))c.has(E)||(f[E]=A);const p={display:"flex",flexDirection:l,gap:a,flexWrap:d,justifyContent:s,alignItems:i,...f};return u!==void 0&&(p.alignContent=u),p}const we="css-classes-3-resolutions",go=500,po=/[\x00-\x1f\x7f]/g,Se=e=>{if(typeof e!="string")return;const t=new Set,r=[];for(const s of e.split(/\s+/)){const i=s.replace(po,"");i&&(t.has(i)||(t.add(i),r.push(i)))}if(!r.length)return;let o="";for(const s of r){const i=o?`${o} ${s}`:s;if(i.length>go)break;o=i}return o.length?o:void 0},$e="hide-component-3-resolutions",Rn="pointer-events-3-resolutions",On=["width-3-resolutions","min-width-3-resolutions","max-width-3-resolutions","height-3-resolutions","min-height-3-resolutions","max-height-3-resolutions","margin-3-resolutions","padding-3-resolutions","border-3-resolutions","border-radius-3-resolutions","box-shadow-3-resolutions","overflow-3-resolutions","overflow-x-3-resolutions","overflow-y-3-resolutions",$e,Rn],mo=new Set(On);function Te({containerAttributes:e,deviceDisplayType:t}){var o;const r=Y({deviceDisplayType:t,componentAttributes:e});return((o=r==null?void 0:r.componentAttributesSpecificToDeviceType)==null?void 0:o[$e])==="true"}function et({containerAttributes:e,deviceDisplayType:t,isComposeMode:r}){var i;if(!e)return{styles:{}};const o=r?Object.fromEntries(Object.entries(e).filter(([l])=>!mo.has(l))):e,s=Y({deviceDisplayType:t,componentAttributes:o});return{styles:(s==null?void 0:s.styles)??{},cssClasses:Se((i=s==null?void 0:s.componentAttributesSpecificToDeviceType)==null?void 0:i[we])}}function Wn(e){return Object.keys(e.styles).length>0||!!e.cssClasses}function tt({containerAttributes:e,widgetContainerStyles:t}){return((e==null?void 0:e[ge])||[]).some(o=>o.toLowerCase().startsWith("height:"))||t.styles.height!==void 0}const Nn="z-index-3-resolutions",nt=0;function Mn(e){var t,r;return!!((r=(t=e==null?void 0:e.overlayLayers)==null?void 0:t.layers)!=null&&r.length)}function Me({containerAttributes:e,deviceDisplayType:t}){var s;const r=Y({deviceDisplayType:t,componentAttributes:e}),o=(s=r==null?void 0:r.componentAttributesSpecificToDeviceType)==null?void 0:s[Nn];if(typeof o=="number"&&Number.isFinite(o))return o;if(typeof o=="string"&&o.trim().length){const i=Number(o);if(Number.isFinite(i))return i}return nt}function jn(e,t){return e+t+1}function Vn({containerAttributes:e,deviceDisplayType:t}){var s;const r=Y({deviceDisplayType:t,componentAttributes:e}),o=(s=r==null?void 0:r.styles)==null?void 0:s.pointerEvents;return typeof o=="string"?o:void 0}function Fn({layer:e,deviceDisplayType:t}){var r;return(r=e==null?void 0:e.rows)!=null&&r.length?Te({containerAttributes:e.containerAttributes,deviceDisplayType:t}):!0}function Kn({isWithinCollection:e,baseDeclaresOwnHeight:t,baseZIndex:r}){return{position:"relative",isolation:"isolate",display:"flex",flexDirection:"column",...t?{}:{height:e?"auto":"100%"},...r===nt?{}:{zIndex:r}}}function Bn({zIndex:e,pointerEvents:t}){return{position:"absolute",top:0,left:0,width:"100%",height:"100%",boxSizing:"border-box",zIndex:e,...t?{pointerEvents:t}:{}}}function O(e){if(!e)return;const t=[];for(const[r,o]of Object.entries(e)){if(o==null||o==="")continue;const s=r.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`);t.push(`${s}: ${o}`)}return t.length>0?t.join("; "):void 0}const le="/";function Un({componentProps:e,ancestorColumnIds:t,columnId:r}){if(!e||!r)return;const o=[...t??[],r];for(let s=0;s<o.length;s+=1){const i=o.slice(s).join(le),l=e[i];if(l)return l}}const je="placeholderValues";function Hn({widgetInstanceProps:e,placeholderValues:t}){return t===void 0||e!=null&&Object.prototype.hasOwnProperty.call(e,je)?e:{...e,[je]:t}}function zn({displayItemList:e,widgetCollections:t}){const r=[],o=(s,i)=>{var l;if((l=s==null?void 0:s.rows)!=null&&l.length)for(const a of s.rows)for(const d of a.columns){if(!d.id||d.type===be.DroppableBox)continue;const u=Je(d.type);if(u!=null&&u.length){const c=d.collection??(t==null?void 0:t[u]);c&&!i.includes(d.id)&&o(c.collectionRows,[...i,d.id]);continue}r.push([...i,d.id].join(le))}};return o(e,[]),r}function yo(e,t){const r=`${le}${e}`;return t.some(o=>o===e||o.endsWith(r))}function Gn({componentProps:e,displayItemList:t,widgetCollections:r}){const o=e?Object.keys(e):[];if(!o.length)return[];const s=zn({displayItemList:t,widgetCollections:r});return o.filter(i=>!yo(i,s))}function Yn({componentProps:e,displayItemList:t,widgetCollections:r,publishedKey:o}){if(process.env.NODE_ENV==="production")return;const s=Gn({componentProps:e,displayItemList:t,widgetCollections:r});s.length&&console.warn(`RuleCMSWidget "${o}": componentProps ${s.map(i=>`"${i}"`).join(", ")} ${s.length===1?"matches":"match"} no component in this widget, so those props were not passed to anything. Keys are column ids from the widget config — the composer's Modify drawer shows the id of the selected component.`)}function ho(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function bo(e){if(e.all!==void 0&&e.all!==null)return!1;const t=e.phone,r=e.tablet,o=e.desktop;return t!==r||t!==o||r!==o}function Ve(e){var t,r;if(!((t=e==null?void 0:e.rows)!=null&&t.length))return!1;if(ke(e.containerAttributes))return!0;for(const o of e.rows){if(ke(o.rowAttributes))return!0;for(const s of o.columns)if(ke(se(s)))return!0}for(const o of((r=e.overlayLayers)==null?void 0:r.layers)??[])if(Ve(o))return!0;return!1}function ke(e){if(!e)return!1;for(const[t,r]of Object.entries(e))if(!(!t.includes("3-resolutions")||!ho(r))){if(t==="hide-component-3-resolutions"){const o=r,s=i=>i==="true"||i===!0;if(s(o.phone)!==s(o.tablet)||s(o.phone)!==s(o.desktop))return!0;continue}if(bo(r))return!0}return!1}function Xn(e,t){if(Ve(e))return!0;for(const r of Object.values(t))if(Ve(r.collectionRows))return!0;return!1}const Jn=parseInt(Ze,10),qn=parseInt(Qe,10),_o=Jn+1,Co=qn+1;function vo(e){const t=`.${e}-phone`,r=`.${e}-tablet`,o=`.${e}-desktop`;return`
|
|
2
|
-
${t}, ${
|
|
3
|
-
@media (max-width: ${
|
|
4
|
-
@media (min-width: ${
|
|
5
|
-
@media (min-width: ${
|
|
6
|
-
`.trim()}function
|
|
7
|
-
`)}),u=n.derived(()=>n.get(d)?`.${
|
|
1
|
+
"use strict";var ko=Object.defineProperty;var Ro=(e,t,o)=>t in e?ko(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var ct=(e,t,o)=>Ro(e,typeof t!="symbol"?t+"":t,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("svelte/internal/disclose-version");const xo=require("svelte/internal/client"),We=require("svelte");function Oo(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const n=Oo(xo),te="default";function ze(e,t){return!(e!=null&&e.length)||e===te?t:`${e}/${t}`}const No=`RuleCMS widget: this widget config uses components from the default component library, but no "default" library is registered. The default library is registered by the consumer app: add the RuleCMS default source components package as a direct dependency and register it, e.g. libraries: { default: sourceComponentsModule } (statically imported for SSR) or libraries: { default: () => import('<default source components package>') }. See the @rulecms/widget-svelte README.`;function ut(e){if(!e||typeof e!="object")return!1;const t=e;return!!t.manifest&&typeof t.manifest=="object"&&!!t.components&&typeof t.components=="object"&&!Array.isArray(t.components)}function Wo(e){if(ut(e))return e;const t=e;return ut(t==null?void 0:t.default)?t.default:null}function Oe(e){return e.usesDefaultLibrary?[te,...e.libraryIds]:[...e.libraryIds]}function dt({registrations:e,referenced:t}){if(t.usesDefaultLibrary&&!(e!=null&&e[te]))throw new Error(No)}function Mo(e){const t=[],o=new Set;for(const r of e.values()){if(typeof r.stylesheet!="string")continue;const s=r.stylesheet.trim();!s||o.has(s)||(o.add(s),t.push(s))}return t.length>0?t:void 0}function _t(e){const t={};for(const[r,s]of e){const i=r===te;for(const[l,a]of Object.entries(s.components))t[i?l:`${r}/${l}`]=a}const o=Mo(e);return o?{components:t,stylesheets:o}:{components:t}}function ie(){const e=new Map,t=new Map,o=new Map,r=new Map;let s=0;function i(d,u){var g;e.get(d)!==u&&((g=u.manifest)!=null&&g.id&&u.manifest.id!==d&&console.warn(`RuleCMS widget: component library registered as "${d}" declares manifest id "${u.manifest.id}". The registered id wins for resolution.`),e.set(d,u),s+=1)}function l(d){const u=Oe(d),g=[...u].sort().join("|"),m=r.get(g);if(m&&m.loadedVersion===s)return m.plugin;const f=new Map;for(const w of u){const h=e.get(w);h&&f.set(w,h)}const A=_t(f);return r.set(g,{loadedVersion:s,plugin:A}),A}function a(d){dt(d);const{registrations:u,referenced:g}=d;for(const m of Oe(g)){if(e.has(m)||o.has(m))continue;const f=u==null?void 0:u[m];if(!f){console.error(`RuleCMS widget: no component library registered for libraryId "${m}"; its components will not render.`),o.set(m,new Error(`No registration for libraryId "${m}"`));continue}if(typeof f=="function")return null;i(m,f)}return l(g)}async function c(d){dt(d);const{registrations:u,referenced:g}=d,m=Oe(g);return await Promise.all(m.map(async f=>{if(e.has(f)||o.has(f))return;const A=u==null?void 0:u[f];if(!A){console.error(`RuleCMS widget: no component library registered for libraryId "${f}"; its components will not render.`),o.set(f,new Error(`No registration for libraryId "${f}"`));return}if(typeof A!="function"){i(f,A);return}let w=t.get(f);w||(w=A().then(h=>{const E=Wo(h);if(!E)throw new Error(`Registration for libraryId "${f}" did not resolve to a ComponentLibraryModule (expected { manifest, components }).`);i(f,E)}).catch(h=>{o.set(f,h),console.error(`RuleCMS widget: failed to load component library "${f}":`,h)}).finally(()=>{t.delete(f)}),t.set(f,w)),await w})),l(g)}return{resolveSync:a,resolve:c}}const Me={Preview:"Preview",Compose:"Compose",RenderedPage:"RenderedPage"},_e={DroppableBox:"droppable-box"},je={FlexStart:"flex-start",FlexEnd:"flex-end",Center:"center",SpaceBetween:"space-between",SpaceAround:"space-around",SpaceEvenly:"space-evenly"},jo={FlexStart:"flex-start",FlexEnd:"flex-end",Center:"center",SpaceBetween:"space-between",SpaceAround:"space-around",SpaceEvenly:"space-evenly",Stretch:"stretch"},me="cssAttrArray",Vo={Phone:"phone",Tablet:"tablet",Desktop:"desktop"},Ge={ComposerComponent:"ComposerWidget",Collection:"Collection",MoveComponentHandle:"MoveWidgetHandle"},Ye=`${Ge.Collection}_`,vt="dev.",At="https://rulecms.com",Et="https://widget-cache.rulecms.com",wt="/api/v1/c/widget/get",St="/api/v1/c/dev/widget/get",Tt="/api/v1/c/widget/resolve",It="/api/v1/c/dev/widget/resolve";function G(e){return typeof e=="string"&&e.startsWith(vt)}function Xe(e,t){return t?t.replace(/\/$/,""):G(e)?At:Et}function Je({publishedKey:e,token:t,endpoint:o}){const r=G(t),s=r?St:wt,i=r?new URLSearchParams({widgetKey:e,token:t}):new URLSearchParams({publishedKey:e,token:t});return`${Xe(t,o)}${s}?${i.toString()}`}function qe({token:e,endpoint:t}){const o=G(e)?It:Tt;return`${Xe(e,t)}${o}`}const Fo=({id:e,prefix:t})=>`${t}_${e}`,Pt=e=>{if(!(e!=null&&e.length)||!e.includes("_")){console.error(`Invalid drag item id: ${e}. Type does not exist.`);return}return Dt(e)},Ze=e=>e.includes("_"),Dt=e=>{const t=e.indexOf("_"),o=e.substring(0,t),r=e.substring(t+1);return{prefix:o,id:r}},Qe=e=>{if(!Ze(e))return;const o=Pt(e);return(o==null?void 0:o.prefix)===Ge.Collection||console.error("getCollectionIdForCollectionType - Invalid component type: ${componentType}. Invalid prefix type."),o==null?void 0:o.id},Ko=e=>{if(!(e!=null&&e.length)){console.error("getNameAndInstanceIdFromWidgetKey: Missing widget key");return}const t=e.split("$");if(t.length<2){console.error("getNameAndInstanceIdFromWidgetKey: Invalid widget key format");return}const o=t[0];if(!t[1].includes("@"))return{name:o,instanceId:t[1]};const s=t[1].split("@");return{name:o,instanceId:s[0],parentId:s[1]}},Bo=e=>{if(!(e!=null&&e.length))return{errorMessage:"getNameFromWidgetKey: Missing widget key"};const t=e.split("$");return t.length<2?{errorMessage:"getNameFromWidgetKey: Invalid widget key format"}:{name:t[0]}},Lt=e=>{var s,i,l,a;if(!e)return{error:"getWidgetKeyForCollection: Missing collection"};if(!((s=e.name)!=null&&s.length))return{error:"getWidgetKeyForCollection: Missing collection name"};const t=(i=e.name)==null?void 0:i.trim().toLowerCase();if(!((l=e.id)!=null&&l.length))return{error:"getWidgetKeyForCollection: Missing collection id"};const r=((a=e.parentId)==null?void 0:a.length)?`${e.id}@${e.parentId}`:`${e.id}`;return{data:`${t}$${r}`}},kt=e=>{var s,i,l,a;if(!e)return{error:"getWidgetKeyForPublishedCollection: Missing collection"};if(!((s=e.name)!=null&&s.length))return{error:"getWidgetKeyForPublishedCollection: Missing collection name"};const t=(i=e.name)==null?void 0:i.trim().toLowerCase();if(!((l=e.publishedKey)!=null&&l.length))return{error:"getWidgetKeyForPublishedCollection: Missing collection publishedKey"};const r=((a=e.parentId)==null?void 0:a.length)?`${e.publishedKey}@${e.parentId}`:`${e.publishedKey}`;return{data:`${t}$${r}`}},Uo=e=>{const t=Lt(e);return`${Ye}${t.data}`},Ho=e=>{const t=kt(e);return`${Ye}${t.data}`},ye="---",Rt="___";function xt(e,t){return`${e}${ye}${t}`}function zo(e,t,o){return`${xt(e,t)}${Rt}${o}`}function Go(e){const t=e.split(".");if(t.length!==3)throw new Error(`Invalid version format: ${e}. Expected format: x.y.z`);const o=t[0],r=t[1],s=parseInt(t[2],10);if(isNaN(s))throw new Error(`Invalid patch version: ${t[2]}. Expected a number.`);return`${o}.${r}.${s+1}`}function ve({displayItemList:e,widgetCollections:t}){const o=new Set;let r=!1;const s=i=>{var l,a,c;if((l=i==null?void 0:i.rows)!=null&&l.length){for(const d of i.rows)if((a=d==null?void 0:d.columns)!=null&&a.length)for(const u of d.columns)u.collection&&s(u.collection.collectionRows),!(!u.type||u.type===_e.DroppableBox)&&(Ze(u.type)||(!((c=u.libraryId)!=null&&c.length)||u.libraryId===te?r=!0:o.add(u.libraryId)))}};s(e);for(const i of Object.values(t??{}))s(i==null?void 0:i.collectionRows);return{libraryIds:Array.from(o),usesDefaultLibrary:r}}const $e=Symbol("rulecms-widget-context");function Yo(){return{token:"",endpoint:void 0,libraries:void 0,libraryRegistry:ie()}}function Xo(e,t){n.push(t,!0);const o=n.proxy(Yo());function r(){o.token=t.token,o.endpoint=t.endpoint,o.libraries=t.libraries}r(),n.user_effect(r),We.setContext($e,o);var s=n.comment(),i=n.first_child(s);n.snippet(i,()=>t.children),n.append(e,s),n.pop()}const Ot="1200px",et="500px",tt="820px",Jo=Ot,Nt="rulecms",qo=1920,Zo={f:"auto",q:"auto",c:"limit"},Qo=/^[A-Za-z0-9][A-Za-z0-9._\-/]*$/,$o=300,er=/^[A-Za-z0-9][A-Za-z0-9_-]*$/,tr=100,nr=/^https:\/\/[^\s"'()\\<>]+$/,or=2e3,rr=/^[A-Za-z0-9_,.:\-/]*$/,sr=300,Wt=e=>typeof e=="string"&&e.length<=$o&&Qo.test(e),Mt=e=>typeof e=="string"&&e.length<=tr&&er.test(e),jt=e=>typeof e=="string"&&e.length<=or&&nr.test(e),Vt=e=>typeof e=="string"&&e.length<=sr&&rr.test(e),ir=e=>Object.entries(e).map(([t,o])=>`${t}_${o}`).join(","),lr=e=>{const t={};for(const o of e.split(",")){const r=o.trim(),s=r.indexOf("_");s<=0||(t[r.slice(0,s)]=r.slice(s+1))}return t},Ft=({publicId:e,cloudName:t=Nt,transformations:o,width:r=qo})=>{const s=typeof o=="string"?lr(o):o,i={...Zo,...s,w:r};return encodeURI(`https://res.cloudinary.com/${t}/image/upload/${ir(i)}/${e}`)},Kt=/^--[A-Za-z0-9_-]+$/,Bt=200,Q=e=>{if(typeof e!="string")return!1;const t=e.trim();return t.length<=Bt&&Kt.test(t)},K=e=>`var(${e.trim()})`,L=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return;const t=e.cssVariable;if(t!=null)return Q(t)?t.trim():void 0},H=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e.cssVariable;return t==null?!1:!Q(t)},ar=(e,t)=>{const o=L(e);return o?{[t]:K(o)}:void 0},Ut=e=>{if(typeof e!="object"||e===null||Array.isArray(e)||H(e))return!1;if(L(e))return!0;const t=e;return t.source==="none"?!0:t.source==="url"?jt(t.url):t.source==="cloudinary"?!Wt(t.publicId)||t.cloudName!==void 0&&t.cloudName!==null&&!Mt(t.cloudName)?!1:t.transformations===void 0||t.transformations===null||Vt(t.transformations):!1},Ht=["px","%","em","rem","vh","vw"],Ae=["inherit","unset"],zt=["allSides","top","right","bottom","left"],q=(e,t={})=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const o=e;return H(e)?!1:L(e)?!0:o.unit==="auto"?t.allowAuto!==!1:o.unit==="keyword"?t.allowKeywords!==!1&&Ae.includes(o.keyword):Ht.includes(o.unit)?typeof o.value!="number"||!Number.isFinite(o.value)?!1:t.allowNegative!==!1||o.value>=0:!1},Gt=(e,t={})=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const o=e;for(const r of zt){const s=o[r];if(s!=null&&!q(s,t))return!1}return!0},cr=[...Ae,"transparent","currentColor"],ur=/^(#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})|rgba?\([^)]+\)|hsla?\([^)]+\))$/,Ee=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return H(e)?!1:L(e)?!0:t.unit==="keyword"?cr.includes(t.keyword):t.unit==="color"?typeof t.value=="string"&&ur.test(t.value.trim()):!1},we=e=>{const t=L(e);return t?K(t):"unit"in e?e.unit==="keyword"?e.keyword:e.value.trim():""},Yt=(e,t)=>typeof e=="object"&&e!==null&&!Array.isArray(e)?!H(e)&&!!L(e):typeof e!="string"||!e.length?!1:t.includes(e)?!0:Ae.includes(e),Xt=['system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif','Georgia, "Times New Roman", Times, serif',"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace","Arial, Helvetica, sans-serif",'"Helvetica Neue", Helvetica, Arial, sans-serif',"Verdana, Geneva, sans-serif"],Jt=["normal","bold","100","200","300","400","500","600","700","800","900"],qt=["normal","italic","oblique"],Zt=["left","center","right","justify","start","end"],Qt=["none","underline","line-through","overline"],$t=["none","uppercase","lowercase","capitalize"],ge=["visible","hidden","scroll","auto","clip"],en=["auto","none"],tn=["flex-start","flex-end","center","space-between","space-around","space-evenly"],nn=["flex-start","flex-end","center","baseline","stretch"],on=["wrap","nowrap"],rn=["flex-start","flex-end","center","space-between","space-around","space-evenly","stretch"],sn=["row","row-reverse","column","column-reverse"],ln=["cover","contain","auto"],an=["center center","center top","center bottom","left center","left top","left bottom","right center","right top","right bottom"],cn=["no-repeat","repeat","repeat-x","repeat-y","space","round"],un=["justifyContent","alignItems","flexWrap","alignContent","flexDirection"],dn=["none","solid","dashed","dotted","double","groove","ridge","inset","outset"],fn=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?!H(e)&&!!L(e):dn.includes(e),gn=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return H(e)?!1:L(e)?!0:!(t.width!==void 0&&t.width!==null&&!q(t.width,{allowAuto:!1,allowNegative:!1})||t.style!==void 0&&t.style!==null&&!fn(t.style)||t.color!==void 0&&t.color!==null&&!Ee(t.color))},dr={allowAuto:!1,allowKeywords:!1,allowNegative:!0},fr={allowAuto:!1,allowKeywords:!1,allowNegative:!1},pn=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;if(H(e))return!1;if(L(e))return!0;for(const o of["offsetX","offsetY","spread"]){const r=t[o];if(r!=null&&!q(r,dr))return!1}return!(t.blur!==void 0&&t.blur!==null&&!q(t.blur,fr)||t.color!==void 0&&t.color!==null&&!Ee(t.color)||t.inset!==void 0&&t.inset!==null&&typeof t.inset!="boolean")},mn=e=>e?e.cssVariable!==void 0&&e.cssVariable!==null||e.offsetX!==void 0||e.offsetY!==void 0||e.blur!==void 0||e.spread!==void 0||e.color!==void 0:!1,yn=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return H(e)?!1:L(e)?!0:t.unit==="number"?typeof t.value=="number"&&Number.isFinite(t.value)&&t.value>0:q(e,{allowAuto:!1,allowNegative:!1})},hn=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?!H(e)&&!!L(e):typeof e=="number"&&Number.isFinite(e)&&e>=0&&e<=1,bn=e=>{if(!Ut(e))return{};const t=L(e);if(t)return{backgroundImage:K(t)};const o=e;return o.source==="none"?{backgroundImage:"none"}:o.source==="url"?{backgroundImage:`url("${o.url}")`}:{backgroundImage:`url("${Ft({publicId:o.publicId,cloudName:o.cloudName,transformations:o.transformations})}")`}},Z=e=>{const t=L(e);return t?K(t):"unit"in e?e.unit==="auto"?"auto":e.unit==="keyword"?e.keyword:`${e.value}${e.unit}`:""},Cn=e=>{if(!gn(e))return{};const t=L(e);if(t)return{border:K(t)};const o={};if(e.width&&(o.borderWidth=Z(e.width)),e.style){const r=L(e.style);o.borderStyle=r?K(r):e.style}return e.color&&(o.borderColor=we(e.color)),o},de=e=>e?Z(e):"0px",_n=e=>{if(!pn(e)||!mn(e))return{};const t=L(e);if(t)return{boxShadow:K(t)};const o=[de(e.offsetX),de(e.offsetY),de(e.blur),de(e.spread)];return e.color&&o.push(we(e.color)),e.inset&&o.unshift("inset"),{boxShadow:o.join(" ")}},gr=e=>`${e.charAt(0).toUpperCase()}${e.slice(1)}`,vn=(e,t)=>{if(!Gt(e))return{};if(e.allSides)return{[t]:Z(e.allSides)};const o={};for(const r of["top","right","bottom","left"]){const s=e[r];s&&(o[`${t}${gr(r)}`]=Z(s))}return o},An=(e,t)=>Ee(e)?{[t]:we(e)}:{},En=(e,t,o)=>{if(!Yt(e,o))return{};const r=L(e);return r?{[t]:K(r)}:{[t]:e}},wn=(e,t,o={})=>q(e,o)?{[t]:Z(e)}:{},Sn=e=>{if(!yn(e))return{};const t=L(e);return t?{lineHeight:K(t)}:"unit"in e&&e.unit==="number"?{lineHeight:e.value}:{lineHeight:Z(e)}},Tn=e=>{if(!hn(e))return{};const t=L(e);return t?{opacity:K(t)}:{opacity:e}},Se={"margin-3-resolutions":{kind:"boxSpacing",cssProperty:"margin"},"padding-3-resolutions":{kind:"boxSpacing",cssProperty:"padding"},"border-3-resolutions":{kind:"border"},"box-shadow-3-resolutions":{kind:"boxShadow"},"border-radius-3-resolutions":{kind:"length",cssProperty:"borderRadius",capabilities:{allowAuto:!1,allowNegative:!1}},"width-3-resolutions":{kind:"length",cssProperty:"width",capabilities:{allowAuto:!0,allowNegative:!1}},"height-3-resolutions":{kind:"length",cssProperty:"height",capabilities:{allowAuto:!0,allowNegative:!1}},"min-width-3-resolutions":{kind:"length",cssProperty:"minWidth",capabilities:{allowAuto:!1,allowNegative:!1}},"max-width-3-resolutions":{kind:"length",cssProperty:"maxWidth",capabilities:{allowAuto:!1,allowNegative:!1}},"min-height-3-resolutions":{kind:"length",cssProperty:"minHeight",capabilities:{allowAuto:!1,allowNegative:!1}},"max-height-3-resolutions":{kind:"length",cssProperty:"maxHeight",capabilities:{allowAuto:!1,allowNegative:!1}},"gap-3-resolutions":{kind:"length",cssProperty:"gap",capabilities:{allowAuto:!1,allowNegative:!1}},"justify-content-3-resolutions":{kind:"enum",cssProperty:"justifyContent",allowedValues:tn},"align-items-3-resolutions":{kind:"enum",cssProperty:"alignItems",allowedValues:nn},"flex-wrap-3-resolutions":{kind:"enum",cssProperty:"flexWrap",allowedValues:on},"align-content-3-resolutions":{kind:"enum",cssProperty:"alignContent",allowedValues:rn},"flex-direction-3-resolutions":{kind:"enum",cssProperty:"flexDirection",allowedValues:sn},"overflow-3-resolutions":{kind:"enum",cssProperty:"overflow",allowedValues:ge},"overflow-x-3-resolutions":{kind:"enum",cssProperty:"overflowX",allowedValues:ge},"overflow-y-3-resolutions":{kind:"enum",cssProperty:"overflowY",allowedValues:ge},"pointer-events-3-resolutions":{kind:"enum",cssProperty:"pointerEvents",allowedValues:en},"background-color-3-resolutions":{kind:"color",cssProperty:"backgroundColor"},"color-3-resolutions":{kind:"color",cssProperty:"color"},"background-image-3-resolutions":{kind:"backgroundImage"},"background-size-3-resolutions":{kind:"enum",cssProperty:"backgroundSize",allowedValues:ln},"background-position-3-resolutions":{kind:"enum",cssProperty:"backgroundPosition",allowedValues:an},"background-repeat-3-resolutions":{kind:"enum",cssProperty:"backgroundRepeat",allowedValues:cn},"opacity-3-resolutions":{kind:"opacity"},"font-family-3-resolutions":{kind:"enum",cssProperty:"fontFamily",allowedValues:Xt},"font-size-3-resolutions":{kind:"length",cssProperty:"fontSize",capabilities:{allowAuto:!1,allowNegative:!1}},"font-weight-3-resolutions":{kind:"enum",cssProperty:"fontWeight",allowedValues:Jt},"font-style-3-resolutions":{kind:"enum",cssProperty:"fontStyle",allowedValues:qt},"line-height-3-resolutions":{kind:"lineHeight"},"letter-spacing-3-resolutions":{kind:"length",cssProperty:"letterSpacing",capabilities:{allowAuto:!1,allowNegative:!0}},"text-align-3-resolutions":{kind:"enum",cssProperty:"textAlign",allowedValues:Zt},"text-decoration-3-resolutions":{kind:"enum",cssProperty:"textDecoration",allowedValues:Qt},"text-transform-3-resolutions":{kind:"enum",cssProperty:"textTransform",allowedValues:$t}},In=(e,t)=>{const o=Se[e];if(!o)return{};switch(o.kind){case"boxSpacing":return vn(t,o.cssProperty);case"length":return wn(t,o.cssProperty,o.capabilities);case"border":return Cn(t);case"boxShadow":return _n(t);case"color":return An(t,o.cssProperty);case"opacity":return Tn(t);case"enum":return En(t,o.cssProperty,o.allowedValues);case"lineHeight":return Sn(t);case"backgroundImage":return bn(t);default:return{}}},pr=Object.fromEntries(Object.entries(Se).filter(([,e])=>e.kind==="boxSpacing").map(([e,t])=>[e,t.cssProperty])),mr=e=>e!=null&&e!=="",Pn=e=>e?!un.some(o=>mr(e[o]))||e.display==="flex"?e:{...e,display:"flex"}:{},Dn=({dbEntryType:e,libraryId:t,sourceComponentsPlugin:o})=>{if(!(e!=null&&e.length))return;const r=o.components[ze(t,e)];if(!r||!("defaultAttributeValues"in r))return;const i=r.defaultAttributeValues;if(i!=null&&i.length)return i.reduce((l,a)=>({...l,[a.name]:a.defaultValues}),{})},Y=({deviceDisplayType:e,componentAttributes:t})=>{if(!t)return;const o={},r={};for(const[s,i]of Object.entries(t)){if(!s.includes("3-resolutions")||!i)continue;const l=i.all,a=l??i[e.toLowerCase()];r[s]=a,Se[s]&&Object.assign(o,In(s,a))}return Object.keys(o).length||Object.keys(r).length?{styles:Object.keys(o).length?o:void 0,componentAttributesSpecificToDeviceType:Object.keys(r).length?r:void 0}:void 0},Ln=({defaultAttributes:e,userModifiedAttributes:t})=>e?t?{...e,...t}:e:t;function se(e){return e.componentAttributes??e.widgetAttributes}function Ve({col:e,deviceDisplayType:t,isComposeMode:o,sourceComponentsPlugin:r}){const s=se(e),i=Dn({dbEntryType:e.type,libraryId:e.libraryId,sourceComponentsPlugin:r})||[],l=Ln({defaultAttributes:i,userModifiedAttributes:s}),{styles:a,componentAttributesSpecificToDeviceType:c}=Y({deviceDisplayType:t,componentAttributes:l})||{styles:void 0,componentAttributesSpecificToDeviceType:void 0};let d={};const u={};if(a)for(const[f,A]of Object.entries(a))o&&u[f]||(d={...d,[f]:A});let g=se(e);for(const f in c)if(f.includes("3-resolutions")){g={...se(e)||{},...c||{}};break}const m=Pn(d);if(o&&m.pointerEvents!==void 0){const f={...m};return delete f.pointerEvents,{componentAttributesBasedOnDevice:g,componentStyles:f}}return{componentAttributesBasedOnDevice:g,componentStyles:m}}const kn=e=>{const t=(e==null?void 0:e.rows)||[];for(const o of t)if(((o==null?void 0:o.columns)||[]).length>0)return!0;return(e==null?void 0:e.containerAttributes)&&Object.keys(e.containerAttributes).length>0},Rn="var(--sl-spacing-x-small)";function xn(e){return e!=null&&e.horizontalAlignment||e!=null&&e.verticalAlignment||e!=null&&e.flexWrap||e!=null&&e.gap||e!=null&&e.alignContent?!0:!!(e!=null&&e.rowAttributes&&Object.keys(e.rowAttributes).length>0)}function On({row:e,deviceDisplayType:t}){var r;const o=Y({deviceDisplayType:t,componentAttributes:e.rowAttributes});return((r=o==null?void 0:o.componentAttributesSpecificToDeviceType)==null?void 0:r["hide-component-3-resolutions"])==="true"}function Nn({row:e,deviceDisplayType:t,isComposeMode:o}){var f;const r=((f=Y({deviceDisplayType:t,componentAttributes:e.rowAttributes}))==null?void 0:f.styles)||{},s=r.justifyContent??e.horizontalAlignment??je.Center,i=r.alignItems??e.verticalAlignment??je.Center,l=r.flexDirection??"row",a=r.gap??e.gap??Rn,c=o?"nowrap":r.flexWrap??e.flexWrap??"nowrap",d=r.alignContent??e.alignContent??void 0,u=new Set(["justifyContent","alignItems","flexDirection","gap","flexWrap","alignContent","display"]),g={};for(const[A,w]of Object.entries(r))u.has(A)||(g[A]=w);const m={display:"flex",flexDirection:l,gap:a,flexWrap:c,justifyContent:s,alignItems:i,...g};return d!==void 0&&(m.alignContent=d),m}const Te="css-classes-3-resolutions",yr=500,hr=/[\x00-\x1f\x7f]/g,Ie=e=>{if(typeof e!="string")return;const t=new Set,o=[];for(const s of e.split(/\s+/)){const i=s.replace(hr,"");i&&(t.has(i)||(t.add(i),o.push(i)))}if(!o.length)return;let r="";for(const s of o){const i=r?`${r} ${s}`:s;if(i.length>yr)break;r=i}return r.length?r:void 0},nt="hide-component-3-resolutions",Wn="pointer-events-3-resolutions",Mn=["width-3-resolutions","min-width-3-resolutions","max-width-3-resolutions","height-3-resolutions","min-height-3-resolutions","max-height-3-resolutions","margin-3-resolutions","padding-3-resolutions","border-3-resolutions","border-radius-3-resolutions","box-shadow-3-resolutions","overflow-3-resolutions","overflow-x-3-resolutions","overflow-y-3-resolutions",nt,Wn],br=new Set(Mn);function Pe({containerAttributes:e,deviceDisplayType:t}){var r;const o=Y({deviceDisplayType:t,componentAttributes:e});return((r=o==null?void 0:o.componentAttributesSpecificToDeviceType)==null?void 0:r[nt])==="true"}function ot({containerAttributes:e,deviceDisplayType:t,isComposeMode:o}){var i;if(!e)return{styles:{}};const r=o?Object.fromEntries(Object.entries(e).filter(([l])=>!br.has(l))):e,s=Y({deviceDisplayType:t,componentAttributes:r});return{styles:(s==null?void 0:s.styles)??{},cssClasses:Ie((i=s==null?void 0:s.componentAttributesSpecificToDeviceType)==null?void 0:i[Te])}}function jn(e){return Object.keys(e.styles).length>0||!!e.cssClasses}function rt({containerAttributes:e,widgetContainerStyles:t}){return((e==null?void 0:e[me])||[]).some(r=>r.toLowerCase().startsWith("height:"))||t.styles.height!==void 0}const Vn="z-index-3-resolutions",st=0;function Fn(e){var t,o;return!!((o=(t=e==null?void 0:e.overlayLayers)==null?void 0:t.layers)!=null&&o.length)}function Fe({containerAttributes:e,deviceDisplayType:t}){var s;const o=Y({deviceDisplayType:t,componentAttributes:e}),r=(s=o==null?void 0:o.componentAttributesSpecificToDeviceType)==null?void 0:s[Vn];if(typeof r=="number"&&Number.isFinite(r))return r;if(typeof r=="string"&&r.trim().length){const i=Number(r);if(Number.isFinite(i))return i}return st}function Kn(e,t){return e+t+1}function Bn({containerAttributes:e,deviceDisplayType:t}){var s;const o=Y({deviceDisplayType:t,componentAttributes:e}),r=(s=o==null?void 0:o.styles)==null?void 0:s.pointerEvents;return typeof r=="string"?r:void 0}function Un({layer:e,deviceDisplayType:t}){var o;return(o=e==null?void 0:e.rows)!=null&&o.length?Pe({containerAttributes:e.containerAttributes,deviceDisplayType:t}):!0}function Hn({isWithinCollection:e,baseDeclaresOwnHeight:t,baseZIndex:o}){return{position:"relative",isolation:"isolate",display:"flex",flexDirection:"column",...t?{}:{height:e?"auto":"100%"},...o===st?{}:{zIndex:o}}}function zn({zIndex:e,pointerEvents:t}){return{position:"absolute",top:0,left:0,width:"100%",height:"100%",boxSizing:"border-box",zIndex:e,...t?{pointerEvents:t}:{}}}function W(e){if(!e)return;const t=[];for(const[o,r]of Object.entries(e)){if(r==null||r==="")continue;const s=o.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`);t.push(`${s}: ${r}`)}return t.length>0?t.join("; "):void 0}const le="/";function Gn({componentProps:e,ancestorColumnIds:t,columnId:o}){if(!e||!o)return;const r=[...t??[],o];for(let s=0;s<r.length;s+=1){const i=r.slice(s).join(le),l=e[i];if(l)return l}}const Ke="placeholderValues";function Yn({widgetInstanceProps:e,placeholderValues:t}){return t===void 0||e!=null&&Object.prototype.hasOwnProperty.call(e,Ke)?e:{...e,[Ke]:t}}function Xn({displayItemList:e,widgetCollections:t}){const o=[],r=(s,i)=>{var l;if((l=s==null?void 0:s.rows)!=null&&l.length)for(const a of s.rows)for(const c of a.columns){if(!c.id||c.type===_e.DroppableBox)continue;const d=Qe(c.type);if(d!=null&&d.length){const u=c.collection??(t==null?void 0:t[d]);u&&!i.includes(c.id)&&r(u.collectionRows,[...i,c.id]);continue}o.push([...i,c.id].join(le))}};return r(e,[]),o}function Cr(e,t){const o=`${le}${e}`;return t.some(r=>r===e||r.endsWith(o))}function Jn({componentProps:e,displayItemList:t,widgetCollections:o}){const r=e?Object.keys(e):[];if(!r.length)return[];const s=Xn({displayItemList:t,widgetCollections:o});return r.filter(i=>!Cr(i,s))}function qn({componentProps:e,displayItemList:t,widgetCollections:o,publishedKey:r}){if(process.env.NODE_ENV==="production")return;const s=Jn({componentProps:e,displayItemList:t,widgetCollections:o});s.length&&console.warn(`RuleCMSWidget "${r}": componentProps ${s.map(i=>`"${i}"`).join(", ")} ${s.length===1?"matches":"match"} no component in this widget, so those props were not passed to anything. Keys are column ids from the widget config — the composer's Modify drawer shows the id of the selected component.`)}function _r(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function vr(e){if(e.all!==void 0&&e.all!==null)return!1;const t=e.phone,o=e.tablet,r=e.desktop;return t!==o||t!==r||o!==r}function Be(e){var t,o;if(!((t=e==null?void 0:e.rows)!=null&&t.length))return!1;if(Ne(e.containerAttributes))return!0;for(const r of e.rows){if(Ne(r.rowAttributes))return!0;for(const s of r.columns)if(Ne(se(s)))return!0}for(const r of((o=e.overlayLayers)==null?void 0:o.layers)??[])if(Be(r))return!0;return!1}function Ne(e){if(!e)return!1;for(const[t,o]of Object.entries(e))if(!(!t.includes("3-resolutions")||!_r(o))){if(t==="hide-component-3-resolutions"){const r=o,s=i=>i==="true"||i===!0;if(s(r.phone)!==s(r.tablet)||s(r.phone)!==s(r.desktop))return!0;continue}if(vr(o))return!0}return!1}function Zn(e,t){if(Be(e))return!0;for(const o of Object.values(t))if(Be(o.collectionRows))return!0;return!1}const Qn=parseInt(et,10),$n=parseInt(tt,10),Ar=Qn+1,Er=$n+1;function wr(e){const t=`.${e}-phone`,o=`.${e}-tablet`,r=`.${e}-desktop`;return`
|
|
2
|
+
${t}, ${o}, ${r} { display: none; }
|
|
3
|
+
@media (max-width: ${Qn}px) { ${t} { display: block; } }
|
|
4
|
+
@media (min-width: ${Ar}px) and (max-width: ${$n}px) { ${o} { display: block; } }
|
|
5
|
+
@media (min-width: ${Er}px) { ${r} { display: block; } }
|
|
6
|
+
`.trim()}const Sr=/(<\/|<)(s)(tyle)/gi;function Tr(e){return e.replace(Sr,(t,o,r,s)=>`${o}${r==="s"?"\\73 ":"\\53 "}${s}`)}function B(e,t){return`<style${t?` ${t}=""`:""}>${Tr(e)}</style>`}function pe(e){if(!e)throw new Error("Source components plugin is required, but no plugins were provided");const t=e.sourceComponents;if(!t)throw new Error("Source components plugin is required, but was not found in plugins object");if(!t.components)throw new Error("Source components plugin is missing required property: components");if(typeof t.components!="object"||t.components===null||Array.isArray(t.components))throw new Error("Source components plugin components must be an object (Record<string, LibraryComponentEntry>)");return t}var Ir=n.from_html("<div><!> <!></div>");function Pr(e,t){const o=n.props_id();n.push(t,!0);let r=n.prop(t,"isComposeMode",3,!1),s=n.prop(t,"showDropContainers",3,!1),i=n.prop(t,"isWithinCollection",3,!1),l=n.prop(t,"deviceDisplayType",3,"Desktop");const a=`rulecms-vc-${o.replace(/[^a-zA-Z0-9_-]/g,"")}`;function c(_,b,v){const I=_&&!v?3:1;return!!(b!=null&&b.length)&&b.length>I}const d=n.derived(()=>{var _;return(((_=t.displayItemList.containerAttributes)==null?void 0:_[me])||[]).join(`;
|
|
7
|
+
`)}),u=n.derived(()=>n.get(d)?`.${a} {
|
|
8
8
|
${n.get(d)}
|
|
9
|
-
}`:""),c=n.derived(()=>!r()&&Te({containerAttributes:t.displayItemList.containerAttributes,deviceDisplayType:i()})),f=n.derived(()=>et({containerAttributes:t.displayItemList.containerAttributes,deviceDisplayType:i(),isComposeMode:r()})),p=n.derived(()=>{var v;const h=((v=t.displayItemList.containerAttributes)==null?void 0:v[ge])||[],C=Wn(n.get(f));return r()&&!s()||o()||h.length>0||C||a(r(),t.displayItemList.rows,s())}),g=n.derived(()=>[n.get(d)?l:void 0,n.get(f).cssClasses].filter(Boolean).join(" ")),E=n.derived(()=>({...tt({containerAttributes:t.displayItemList.containerAttributes,widgetContainerStyles:n.get(f)})?{}:{height:s()?"auto":"100%"},display:"flex",flexDirection:"column",...n.get(f).styles})),A=n.derived(()=>n.get(p)?n.get(g):""),b=n.derived(()=>n.get(c)?{display:"none"}:n.get(p)?n.get(E):{display:"contents"});var _=Eo(),T=n.child(_);{var W=h=>{var C=n.comment(),v=n.first_child(C);n.element(v,()=>"style",!1,(w,D)=>{var x=n.text();n.template_effect(()=>n.set_text(x,n.get(u))),n.append(D,x)}),n.append(h,C)};n.if(T,h=>{n.get(d)&&h(W)})}var H=n.sibling(T,2);n.snippet(H,()=>t.children),n.reset(_),n.template_effect(h=>{n.set_attribute(_,"hidden",n.get(c)||void 0),n.set_class(_,1,n.clsx(n.get(A)||void 0)),n.set_style(_,h)},[()=>O(n.get(b))]),n.append(e,_),n.pop()}var So=n.from_html("<div><!></div>");function To(e,t){n.push(t,!0);let r=n.prop(t,"isComposeMode",3,!1),o=n.prop(t,"showDropContainers",3,!1),s=n.prop(t,"isWithinCollection",3,!1),i=n.prop(t,"deviceDisplayType",3,"Desktop");function l(A,b,_){var W;const T=A&&!_?3:1;return!!((W=b==null?void 0:b.columns)!=null&&W.length)&&b.columns.length>T}const a=n.derived(()=>!r()&&Ln({row:t.row,deviceDisplayType:i()})),d=n.derived(()=>o()||xn(t.row)||l(r(),t.row,s())),u=n.derived(()=>kn({row:t.row,deviceDisplayType:i(),isComposeMode:r()})),c=n.derived(()=>{var b;const A=Y({deviceDisplayType:i(),componentAttributes:t.row.rowAttributes});return Se((b=A==null?void 0:A.componentAttributesSpecificToDeviceType)==null?void 0:b[we])??""}),f=n.derived(()=>n.get(d)?n.get(c):""),p=n.derived(()=>n.get(a)?{display:"none"}:n.get(d)?n.get(u):{display:"contents"});var g=So(),E=n.child(g);n.snippet(E,()=>t.children),n.reset(g),n.template_effect(A=>{n.set_attribute(g,"hidden",n.get(a)||void 0),n.set_class(g,1,n.clsx(n.get(f)||void 0)),n.set_style(g,A)},[()=>O(n.get(p))]),n.append(e,g),n.pop()}const Zn=["minWidth","maxWidth","minHeight","maxHeight","margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","borderWidth","borderStyle","borderColor","border","borderRadius","boxShadow","width","height","gap","display","justifyContent","alignItems","flexWrap","alignContent","flexDirection","overflow","overflowX","overflowY","backgroundColor","backgroundImage","backgroundSize","backgroundPosition","backgroundRepeat","opacity","fontFamily","fontSize","fontWeight","fontStyle","color","lineHeight","letterSpacing","textAlign","textDecoration","textTransform"],Io=e=>e!=null&&e!=="",Po=e=>e?Zn.reduce((t,r)=>{const o=e[r];return Io(o)&&(t[r]=o),t},{}):{},Do=e=>{if(!e)return;const t={...e};for(const r of Zn)delete t[r];return Object.keys(t).length?t:void 0},xo=e=>Object.keys(e).length>0,Lo=(e,t)=>{const r=(e==null?void 0:e.noContainer)??!1,o=e==null?void 0:e.resolveNoContainer;if(typeof o!="function")return r;try{const s=o(t);if(typeof s=="boolean")return s;console.error(`resolveNoContainer: component "${e==null?void 0:e.id}" returned ${typeof s} instead of a boolean; falling back to noContainer=${r}`)}catch(s){console.error(`resolveNoContainer: component "${e==null?void 0:e.id}" threw; falling back to noContainer=${r}`,s)}return r},ko=(e,t)=>{const r=e==null?void 0:e.resolveRendersOwnElement;if(typeof r!="function")return!1;try{const o=r(t);if(typeof o=="boolean")return o;console.error(`resolveRendersOwnElement: component "${e==null?void 0:e.id}" returned ${typeof o} instead of a boolean; falling back to false`)}catch(o){console.error(`resolveRendersOwnElement: component "${e==null?void 0:e.id}" threw; falling back to false`,o)}return!1};var ct=n.from_html("<div><!></div>");function Qn(e,t){n.push(t,!0);const r=n.derived(()=>t.components[Be(t.libraryId,t.componentType)]),o=n.derived(()=>{var _;const b=(_=n.get(r))==null?void 0:_.card;return b||(console.error(`DisplayComponent: Component with type ${t.componentType}${t.libraryId?` (library "${t.libraryId}")`:""} not found in components`),null)}),s=n.derived(()=>({componentAttributes:t.componentAttributes,styleProps:t.styleProps})),i=n.derived(()=>n.get(r)?Lo(n.get(r),n.get(s)):!1),l=n.derived(()=>Po(t.styleProps)),a=n.derived(()=>n.get(i)?Do(t.styleProps):t.styleProps),d=n.derived(()=>{var b;return Se((b=t.componentAttributes)==null?void 0:b[we])}),u=n.derived(()=>n.get(i)&&xo(n.get(l))),c=n.derived(()=>!n.get(i)||(n.get(r)?ko(n.get(r),n.get(s)):!1)),f=n.derived(()=>!n.get(u)&&n.get(c)?n.get(d):void 0),p=n.derived(()=>({componentAttributes:t.componentAttributes,styleProps:n.get(a),className:n.get(f),widgetInstanceProps:t.widgetInstanceProps,pageViewType:t.pageViewType,columnPath:t.columnPath,mounts:t.mounts}));var g=n.comment(),E=n.first_child(g);{var A=b=>{const _=n.derived(()=>n.get(o));var T=n.comment(),W=n.first_child(T);{var H=v=>{var w=ct(),D=n.child(w);n.component(D,()=>n.get(_),(x,k)=>{k(x,n.spread_props(()=>n.get(p)))}),n.reset(w),n.template_effect(x=>{n.set_class(w,1,n.clsx(n.get(d)||void 0)),n.set_style(w,x)},[()=>O(n.get(l))]),n.append(v,w)},h=v=>{var w=ct(),D=n.child(w);n.component(D,()=>n.get(_),(x,k)=>{k(x,n.spread_props(()=>n.get(p)))}),n.reset(w),n.template_effect(()=>n.set_class(w,1,n.clsx(n.get(d)))),n.append(v,w)},C=v=>{var w=n.comment(),D=n.first_child(w);n.component(D,()=>n.get(_),(x,k)=>{k(x,n.spread_props(()=>n.get(p)))}),n.append(v,w)};n.if(W,v=>{n.get(u)?v(H):!n.get(c)&&n.get(d)?v(h,1):v(C,-1)})}n.append(b,T)};n.if(E,b=>{n.get(o)&&b(A)})}n.append(e,g),n.pop()}var Ro=n.from_html("<div><!></div>"),Oo=n.from_html("<div><!> <!></div>");function me(e,t){n.push(t,!0);const r=h=>{wo(h,{get displayItemList(){return t.displayItemList},get isComposeMode(){return o()},get showDropContainers(){return i()},get isWithinCollection(){return s()},get deviceDisplayType(){return t.deviceDisplayType},children:(C,v)=>{var w=n.comment(),D=n.first_child(w);n.each(D,17,()=>t.displayItemList.rows,x=>x.id,(x,k)=>{To(x,{get row(){return n.get(k)},get isComposeMode(){return o()},get showDropContainers(){return i()},get isWithinCollection(){return s()},get deviceDisplayType(){return t.deviceDisplayType},children:($,te)=>{var ne=n.comment(),De=n.first_child(ne);n.each(De,17,()=>n.get(k).columns,re=>re.id,(re,V)=>{var ae=n.comment(),xe=n.first_child(ae);{var y=S=>{const P=n.derived(()=>p(n.get(V)));var N=n.comment(),R=n.first_child(N);{var K=z=>{{let J=n.derived(()=>g(n.get(V).id));me(z,{get displayItemList(){return n.get(P)},get isComposeMode(){return o()},isWithinCollection:!0,get widgetCollections(){return t.widgetCollections},get showDropContainers(){return i()},get reduxDeviceDisplayType(){return t.reduxDeviceDisplayType},get plugins(){return t.plugins},get deviceDisplayType(){return t.deviceDisplayType},get componentProps(){return t.componentProps},get mounts(){return t.mounts},get placeholderValues(){return t.placeholderValues},get ancestorColumnIds(){return n.get(J)}})}},oe=z=>{{let J=n.derived(()=>f(n.get(V)).componentAttributes),ot=n.derived(()=>f(n.get(V)).styleProps),st=n.derived(()=>b(n.get(V).id)),I=n.derived(E),M=n.derived(()=>A(n.get(V).id));Qn(z,{get componentType(){return n.get(V).type},get libraryId(){return n.get(V).libraryId},get componentAttributes(){return n.get(J)},get components(){return n.get(l)},get styleProps(){return n.get(ot)},get widgetInstanceProps(){return n.get(st)},get pageViewType(){return n.get(I)},get columnPath(){return n.get(M)},get mounts(){return t.mounts}})}};n.if(R,z=>{n.get(P)?z(K):z(oe,-1)})}n.append(S,N)},m=n.derived(()=>c(n.get(V)));n.if(xe,S=>{n.get(m)&&S(y)})}n.append(re,ae)}),n.append($,ne)},$$slots:{default:!0}})}),n.append(C,w)},$$slots:{default:!0}})};let o=n.prop(t,"isComposeMode",3,!1),s=n.prop(t,"isWithinCollection",3,!1),i=n.prop(t,"showDropContainers",3,!1);const l=n.derived(()=>fe(t.plugins).components),a=n.derived(()=>!o()&&Mn(t.displayItemList)&&!Te({containerAttributes:t.displayItemList.containerAttributes,deviceDisplayType:t.deviceDisplayType})),d=n.derived(()=>{const h=Me({containerAttributes:t.displayItemList.containerAttributes,deviceDisplayType:t.deviceDisplayType});return Kn({isWithinCollection:s(),baseDeclaresOwnHeight:tt({containerAttributes:t.displayItemList.containerAttributes,widgetContainerStyles:et({containerAttributes:t.displayItemList.containerAttributes,deviceDisplayType:t.deviceDisplayType,isComposeMode:o()})}),baseZIndex:h})}),u=n.derived(()=>{var v;const h=((v=t.displayItemList.overlayLayers)==null?void 0:v.layers)??[],C=Me({containerAttributes:t.displayItemList.containerAttributes,deviceDisplayType:t.deviceDisplayType});return h.flatMap((w,D)=>Fn({layer:w,deviceDisplayType:t.deviceDisplayType})?[]:[{index:D,layer:w,boxStyles:Bn({zIndex:jn(C,D),pointerEvents:Vn({containerAttributes:w.containerAttributes,deviceDisplayType:t.deviceDisplayType})})}])});function c(h){if(o()&&h.type===be.DroppableBox)return!1;const{componentAttributesBasedOnDevice:C}=Ne({col:h,deviceDisplayType:t.deviceDisplayType,isComposeMode:o(),sourceComponentsPlugin:fe(t.plugins)}),v=!!C&&C["hide-component-3-resolutions"]==="true";return!(!o()&&v)}function f(h){const{componentAttributesBasedOnDevice:C,componentStyles:v}=Ne({col:h,deviceDisplayType:t.deviceDisplayType,isComposeMode:o(),sourceComponentsPlugin:fe(t.plugins)});return{componentAttributes:C,styleProps:v}}function p(h){const C=Je(h.type);if(!(C!=null&&C.length))return null;const v=h.collection??t.widgetCollections[C];if(!v)throw new Error(`DisplayCollection - Collection with ID ${C} not found in widgetCollections. Available collections: ${Object.keys(t.widgetCollections).join(", ")}`);return!v.collectionRows||!Pn(v.collectionRows)?null:v.collectionRows}function g(h){return[...t.ancestorColumnIds??[],h]}function E(){return o()?Oe.Compose:Oe.RenderedPage}function A(h){if(!(o()||!h))return[...t.ancestorColumnIds??[],h].join(le)}function b(h){return Hn({widgetInstanceProps:Un({componentProps:t.componentProps,ancestorColumnIds:t.ancestorColumnIds,columnId:h}),placeholderValues:o()?void 0:t.placeholderValues})}var _=n.comment(),T=n.first_child(_);{var W=h=>{var C=Oo(),v=n.child(C);r(v);var w=n.sibling(v,2);n.each(w,17,()=>n.get(u),D=>D.index,(D,x)=>{var k=Ro(),$=n.child(k);me($,{get displayItemList(){return n.get(x).layer},get isComposeMode(){return o()},isWithinCollection:!1,get widgetCollections(){return t.widgetCollections},showDropContainers:!1,get reduxDeviceDisplayType(){return t.reduxDeviceDisplayType},get plugins(){return t.plugins},get deviceDisplayType(){return t.deviceDisplayType},get componentProps(){return t.componentProps},get mounts(){return t.mounts},get placeholderValues(){return t.placeholderValues},get ancestorColumnIds(){return t.ancestorColumnIds}}),n.reset(k),n.template_effect(te=>{n.set_attribute(k,"data-rulecms-overlay-layer",n.get(x).index),n.set_style(k,te)},[()=>O(n.get(x).boxStyles)]),n.append(D,k)}),n.reset(C),n.template_effect(D=>n.set_style(C,D),[()=>O(n.get(d))]),n.append(h,C)},H=h=>{r(h)};n.if(T,h=>{n.get(a)?h(W):h(H,-1)})}n.append(e,_),n.pop()}function ye(e,t){n.push(t,!0);var r=n.comment(),o=n.first_child(r);{var s=i=>{me(i,{get displayItemList(){return t.displayItemList},get isComposeMode(){return t.isComposeMode},get isWithinCollection(){return t.isWithinCollection},get widgetCollections(){return t.widgetCollections},get showDropContainers(){return t.showDropContainers},get reduxDeviceDisplayType(){return t.reduxDeviceDisplayType},get plugins(){return t.plugins},get deviceDisplayType(){return t.deviceDisplayType},get componentProps(){return t.componentProps},get mounts(){return t.mounts},get placeholderValues(){return t.placeholderValues},get ancestorColumnIds(){return t.ancestorColumnIds}})};n.if(o,i=>{var l,a;(a=(l=t.displayItemList)==null?void 0:l.rows)!=null&&a.length&&i(s)})}n.append(e,r),n.pop()}function $n(e,t){var r=n.comment(),o=n.first_child(r);n.each(o,17,()=>t.stylesheets??[],n.index,(s,i)=>{var l=n.comment(),a=n.first_child(l);n.element(a,()=>"style",!1,(d,u)=>{n.attribute_effect(d,()=>({"data-rulecms-library-stylesheet":""}));var c=n.text();n.template_effect(()=>n.set_text(c,n.get(i))),n.append(u,c)}),n.append(s,l)}),n.append(e,r)}let Wo=0;var No=n.from_html("<div><!></div>"),ut=n.from_html("<!> <!>",1);function er(e,t){n.push(t,!0);const r=["Phone","Tablet","Desktop"],o=`rulecms-bp-${++Wo}`,s=n.derived(()=>t.scopeIdInput??o),i=n.derived(()=>Xn(t.displayItemList,t.widgetCollections)),l=n.derived(()=>vo(n.get(s)));var a=ut(),d=n.first_child(a);{let p=n.derived(()=>{var g;return(g=t.plugins.sourceComponents)==null?void 0:g.stylesheets});$n(d,{get stylesheets(){return n.get(p)}})}var u=n.sibling(d,2);{var c=p=>{ye(p,{get displayItemList(){return t.displayItemList},isComposeMode:!1,isWithinCollection:!1,get widgetCollections(){return t.widgetCollections},showDropContainers:!1,reduxDeviceDisplayType:"desktop",deviceDisplayType:"Desktop",get plugins(){return t.plugins},get componentProps(){return t.componentProps},get mounts(){return t.mounts},get placeholderValues(){return t.placeholderValues}})},f=p=>{var g=ut(),E=n.first_child(g);n.element(E,()=>"style",!1,(b,_)=>{var T=n.text();n.template_effect(()=>n.set_text(T,n.get(l))),n.append(_,T)});var A=n.sibling(E,2);n.each(A,16,()=>r,b=>b,(b,_)=>{var T=No(),W=n.child(T);ye(W,{get displayItemList(){return t.displayItemList},isComposeMode:!1,isWithinCollection:!1,get widgetCollections(){return t.widgetCollections},showDropContainers:!1,reduxDeviceDisplayType:"desktop",get deviceDisplayType(){return _},get plugins(){return t.plugins},get componentProps(){return t.componentProps},get mounts(){return t.mounts},get placeholderValues(){return t.placeholderValues}}),n.reset(T),n.template_effect(H=>n.set_class(T,1,H),[()=>`${n.get(s)}-${_.toLowerCase()}`]),n.append(b,T)}),n.append(p,g)};n.if(u,p=>{n.get(i)?p(f,-1):p(c)})}n.append(e,a),n.pop()}function Mo(e,t,r){if(e)return"Phone";if(t)return"Tablet";const o=(r==null?void 0:r.toLowerCase())||"desktop";return o==="phone"?"Phone":o==="tablet"?"Tablet":"Desktop"}const jo=`(max-width: ${Ze})`,Vo=`(max-width: ${Qe})`;var Fo=n.from_html("<!> <!>",1);function tr(e,t){n.push(t,!0);let r=n.state("Desktop"),o,s;function i(){n.set(r,Mo((o==null?void 0:o.matches)??!1,(s==null?void 0:s.matches)??!1,t.reduxDeviceDisplayType),!0)}n.user_effect(()=>(typeof matchMedia=="function"&&(o=matchMedia(jo),s=matchMedia(Vo),o.addEventListener("change",i),s.addEventListener("change",i)),i(),()=>{o==null||o.removeEventListener("change",i),s==null||s.removeEventListener("change",i)}));var l=Fo(),a=n.first_child(l);{var d=c=>{{let f=n.derived(()=>{var p;return(p=t.plugins.sourceComponents)==null?void 0:p.stylesheets});$n(c,{get stylesheets(){return n.get(f)}})}};n.if(a,c=>{t.isWithinCollection||c(d)})}var u=n.sibling(a,2);ye(u,{get displayItemList(){return t.displayItemList},get isComposeMode(){return t.isComposeMode},get isWithinCollection(){return t.isWithinCollection},get widgetCollections(){return t.widgetCollections},get showDropContainers(){return t.showDropContainers},get reduxDeviceDisplayType(){return t.reduxDeviceDisplayType},get deviceDisplayType(){return n.get(r)},get plugins(){return t.plugins},get componentProps(){return t.componentProps},get mounts(){return t.mounts},get placeholderValues(){return t.placeholderValues}}),n.append(e,l),n.pop()}function nr(e){return e!==!1}const Ko=["utilities","components"],Bo=new Set(Ko),rr=e=>typeof e=="string"&&Bo.has(e),Uo=e=>e.split(`
|
|
9
|
+
}`:""),g=n.derived(()=>!r()&&Pe({containerAttributes:t.displayItemList.containerAttributes,deviceDisplayType:l()})),m=n.derived(()=>ot({containerAttributes:t.displayItemList.containerAttributes,deviceDisplayType:l(),isComposeMode:r()})),f=n.derived(()=>{var v;const _=((v=t.displayItemList.containerAttributes)==null?void 0:v[me])||[],b=jn(n.get(m));return r()&&!i()||s()||_.length>0||b||c(r(),t.displayItemList.rows,i())}),A=n.derived(()=>[n.get(d)?a:void 0,n.get(m).cssClasses].filter(Boolean).join(" ")),w=n.derived(()=>({...rt({containerAttributes:t.displayItemList.containerAttributes,widgetContainerStyles:n.get(m)})?{}:{height:i()?"auto":"100%"},display:"flex",flexDirection:"column",...n.get(m).styles})),h=n.derived(()=>n.get(f)?n.get(A):""),E=n.derived(()=>n.get(g)?{display:"none"}:n.get(f)?n.get(w):{display:"contents"});var T=Ir(),k=n.child(T);{var z=_=>{var b=n.comment(),v=n.first_child(b);n.html(v,()=>B(n.get(u))),n.append(_,b)};n.if(k,_=>{n.get(d)&&_(z)})}var C=n.sibling(k,2);n.snippet(C,()=>t.children),n.reset(T),n.template_effect(_=>{n.set_attribute(T,"hidden",n.get(g)||void 0),n.set_class(T,1,n.clsx(n.get(h)||void 0)),n.set_style(T,_)},[()=>W(n.get(E))]),n.append(e,T),n.pop()}var Dr=n.from_html("<div><!></div>");function Lr(e,t){n.push(t,!0);let o=n.prop(t,"isComposeMode",3,!1),r=n.prop(t,"showDropContainers",3,!1),s=n.prop(t,"isWithinCollection",3,!1),i=n.prop(t,"deviceDisplayType",3,"Desktop");function l(w,h,E){var k;const T=w&&!E?3:1;return!!((k=h==null?void 0:h.columns)!=null&&k.length)&&h.columns.length>T}const a=n.derived(()=>!o()&&On({row:t.row,deviceDisplayType:i()})),c=n.derived(()=>r()||xn(t.row)||l(o(),t.row,s())),d=n.derived(()=>Nn({row:t.row,deviceDisplayType:i(),isComposeMode:o()})),u=n.derived(()=>{var h;const w=Y({deviceDisplayType:i(),componentAttributes:t.row.rowAttributes});return Ie((h=w==null?void 0:w.componentAttributesSpecificToDeviceType)==null?void 0:h[Te])??""}),g=n.derived(()=>n.get(c)?n.get(u):""),m=n.derived(()=>n.get(a)?{display:"none"}:n.get(c)?n.get(d):{display:"contents"});var f=Dr(),A=n.child(f);n.snippet(A,()=>t.children),n.reset(f),n.template_effect(w=>{n.set_attribute(f,"hidden",n.get(a)||void 0),n.set_class(f,1,n.clsx(n.get(g)||void 0)),n.set_style(f,w)},[()=>W(n.get(m))]),n.append(e,f),n.pop()}const eo=["minWidth","maxWidth","minHeight","maxHeight","margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","borderWidth","borderStyle","borderColor","border","borderRadius","boxShadow","width","height","gap","display","justifyContent","alignItems","flexWrap","alignContent","flexDirection","overflow","overflowX","overflowY","backgroundColor","backgroundImage","backgroundSize","backgroundPosition","backgroundRepeat","opacity","fontFamily","fontSize","fontWeight","fontStyle","color","lineHeight","letterSpacing","textAlign","textDecoration","textTransform"],kr=e=>e!=null&&e!=="",Rr=e=>e?eo.reduce((t,o)=>{const r=e[o];return kr(r)&&(t[o]=r),t},{}):{},xr=e=>{if(!e)return;const t={...e};for(const o of eo)delete t[o];return Object.keys(t).length?t:void 0},Or=e=>Object.keys(e).length>0,Nr=(e,t)=>{const o=(e==null?void 0:e.noContainer)??!1,r=e==null?void 0:e.resolveNoContainer;if(typeof r!="function")return o;try{const s=r(t);if(typeof s=="boolean")return s;console.error(`resolveNoContainer: component "${e==null?void 0:e.id}" returned ${typeof s} instead of a boolean; falling back to noContainer=${o}`)}catch(s){console.error(`resolveNoContainer: component "${e==null?void 0:e.id}" threw; falling back to noContainer=${o}`,s)}return o},Wr=(e,t)=>{const o=e==null?void 0:e.resolveRendersOwnElement;if(typeof o!="function")return!1;try{const r=o(t);if(typeof r=="boolean")return r;console.error(`resolveRendersOwnElement: component "${e==null?void 0:e.id}" returned ${typeof r} instead of a boolean; falling back to false`)}catch(r){console.error(`resolveRendersOwnElement: component "${e==null?void 0:e.id}" threw; falling back to false`,r)}return!1};var ft=n.from_html("<div><!></div>");function to(e,t){n.push(t,!0);const o=n.derived(()=>t.components[ze(t.libraryId,t.componentType)]),r=n.derived(()=>{var E;const h=(E=n.get(o))==null?void 0:E.card;return h||(console.error(`DisplayComponent: Component with type ${t.componentType}${t.libraryId?` (library "${t.libraryId}")`:""} not found in components`),null)}),s=n.derived(()=>({componentAttributes:t.componentAttributes,styleProps:t.styleProps})),i=n.derived(()=>n.get(o)?Nr(n.get(o),n.get(s)):!1),l=n.derived(()=>Rr(t.styleProps)),a=n.derived(()=>n.get(i)?xr(t.styleProps):t.styleProps),c=n.derived(()=>{var h;return Ie((h=t.componentAttributes)==null?void 0:h[Te])}),d=n.derived(()=>n.get(i)&&Or(n.get(l))),u=n.derived(()=>!n.get(i)||(n.get(o)?Wr(n.get(o),n.get(s)):!1)),g=n.derived(()=>!n.get(d)&&n.get(u)?n.get(c):void 0),m=n.derived(()=>({componentAttributes:t.componentAttributes,styleProps:n.get(a),className:n.get(g),widgetInstanceProps:t.widgetInstanceProps,pageViewType:t.pageViewType,columnPath:t.columnPath,mounts:t.mounts}));var f=n.comment(),A=n.first_child(f);{var w=h=>{const E=n.derived(()=>n.get(r));var T=n.comment(),k=n.first_child(T);{var z=b=>{var v=ft(),I=n.child(v);n.component(I,()=>n.get(E),(R,x)=>{x(R,n.spread_props(()=>n.get(m)))}),n.reset(v),n.template_effect(R=>{n.set_class(v,1,n.clsx(n.get(c)||void 0)),n.set_style(v,R)},[()=>W(n.get(l))]),n.append(b,v)},C=b=>{var v=ft(),I=n.child(v);n.component(I,()=>n.get(E),(R,x)=>{x(R,n.spread_props(()=>n.get(m)))}),n.reset(v),n.template_effect(()=>n.set_class(v,1,n.clsx(n.get(c)))),n.append(b,v)},_=b=>{var v=n.comment(),I=n.first_child(v);n.component(I,()=>n.get(E),(R,x)=>{x(R,n.spread_props(()=>n.get(m)))}),n.append(b,v)};n.if(k,b=>{n.get(d)?b(z):!n.get(u)&&n.get(c)?b(C,1):b(_,-1)})}n.append(h,T)};n.if(A,h=>{n.get(r)&&h(w)})}n.append(e,f),n.pop()}var Mr=n.from_html("<div><!></div>"),jr=n.from_html("<div><!> <!></div>");function he(e,t){n.push(t,!0);const o=C=>{Pr(C,{get displayItemList(){return t.displayItemList},get isComposeMode(){return r()},get showDropContainers(){return i()},get isWithinCollection(){return s()},get deviceDisplayType(){return t.deviceDisplayType},children:(_,b)=>{var v=n.comment(),I=n.first_child(v);n.each(I,17,()=>t.displayItemList.rows,R=>R.id,(R,x)=>{Lr(R,{get row(){return n.get(x)},get isComposeMode(){return r()},get showDropContainers(){return i()},get isWithinCollection(){return s()},get deviceDisplayType(){return t.deviceDisplayType},children:($,ne)=>{var oe=n.comment(),ae=n.first_child(oe);n.each(ae,17,()=>n.get(x).columns,ee=>ee.id,(ee,V)=>{var ce=n.comment(),ke=n.first_child(ce);{var Re=y=>{const p=n.derived(()=>m(n.get(V)));var S=n.comment(),P=n.first_child(S);{var M=N=>{{let J=n.derived(()=>f(n.get(V).id));he(N,{get displayItemList(){return n.get(p)},get isComposeMode(){return r()},isWithinCollection:!0,get widgetCollections(){return t.widgetCollections},get showDropContainers(){return i()},get reduxDeviceDisplayType(){return t.reduxDeviceDisplayType},get plugins(){return t.plugins},get deviceDisplayType(){return t.deviceDisplayType},get componentProps(){return t.componentProps},get mounts(){return t.mounts},get placeholderValues(){return t.placeholderValues},get ancestorColumnIds(){return n.get(J)}})}},O=N=>{{let J=n.derived(()=>g(n.get(V)).componentAttributes),ue=n.derived(()=>g(n.get(V)).styleProps),re=n.derived(()=>h(n.get(V).id)),lt=n.derived(A),at=n.derived(()=>w(n.get(V).id));to(N,{get componentType(){return n.get(V).type},get libraryId(){return n.get(V).libraryId},get componentAttributes(){return n.get(J)},get components(){return n.get(l)},get styleProps(){return n.get(ue)},get widgetInstanceProps(){return n.get(re)},get pageViewType(){return n.get(lt)},get columnPath(){return n.get(at)},get mounts(){return t.mounts}})}};n.if(P,N=>{n.get(p)?N(M):N(O,-1)})}n.append(y,S)},xe=n.derived(()=>u(n.get(V)));n.if(ke,y=>{n.get(xe)&&y(Re)})}n.append(ee,ce)}),n.append($,oe)},$$slots:{default:!0}})}),n.append(_,v)},$$slots:{default:!0}})};let r=n.prop(t,"isComposeMode",3,!1),s=n.prop(t,"isWithinCollection",3,!1),i=n.prop(t,"showDropContainers",3,!1);const l=n.derived(()=>pe(t.plugins).components),a=n.derived(()=>!r()&&Fn(t.displayItemList)&&!Pe({containerAttributes:t.displayItemList.containerAttributes,deviceDisplayType:t.deviceDisplayType})),c=n.derived(()=>{const C=Fe({containerAttributes:t.displayItemList.containerAttributes,deviceDisplayType:t.deviceDisplayType});return Hn({isWithinCollection:s(),baseDeclaresOwnHeight:rt({containerAttributes:t.displayItemList.containerAttributes,widgetContainerStyles:ot({containerAttributes:t.displayItemList.containerAttributes,deviceDisplayType:t.deviceDisplayType,isComposeMode:r()})}),baseZIndex:C})}),d=n.derived(()=>{var b;const C=((b=t.displayItemList.overlayLayers)==null?void 0:b.layers)??[],_=Fe({containerAttributes:t.displayItemList.containerAttributes,deviceDisplayType:t.deviceDisplayType});return C.flatMap((v,I)=>Un({layer:v,deviceDisplayType:t.deviceDisplayType})?[]:[{index:I,layer:v,boxStyles:zn({zIndex:Kn(_,I),pointerEvents:Bn({containerAttributes:v.containerAttributes,deviceDisplayType:t.deviceDisplayType})})}])});function u(C){if(r()&&C.type===_e.DroppableBox)return!1;const{componentAttributesBasedOnDevice:_}=Ve({col:C,deviceDisplayType:t.deviceDisplayType,isComposeMode:r(),sourceComponentsPlugin:pe(t.plugins)}),b=!!_&&_["hide-component-3-resolutions"]==="true";return!(!r()&&b)}function g(C){const{componentAttributesBasedOnDevice:_,componentStyles:b}=Ve({col:C,deviceDisplayType:t.deviceDisplayType,isComposeMode:r(),sourceComponentsPlugin:pe(t.plugins)});return{componentAttributes:_,styleProps:b}}function m(C){const _=Qe(C.type);if(!(_!=null&&_.length))return null;const b=C.collection??t.widgetCollections[_];if(!b)throw new Error(`DisplayCollection - Collection with ID ${_} not found in widgetCollections. Available collections: ${Object.keys(t.widgetCollections).join(", ")}`);return!b.collectionRows||!kn(b.collectionRows)?null:b.collectionRows}function f(C){return[...t.ancestorColumnIds??[],C]}function A(){return r()?Me.Compose:Me.RenderedPage}function w(C){if(!(r()||!C))return[...t.ancestorColumnIds??[],C].join(le)}function h(C){return Yn({widgetInstanceProps:Gn({componentProps:t.componentProps,ancestorColumnIds:t.ancestorColumnIds,columnId:C}),placeholderValues:r()?void 0:t.placeholderValues})}var E=n.comment(),T=n.first_child(E);{var k=C=>{var _=jr(),b=n.child(_);o(b);var v=n.sibling(b,2);n.each(v,17,()=>n.get(d),I=>I.index,(I,R)=>{var x=Mr(),$=n.child(x);he($,{get displayItemList(){return n.get(R).layer},get isComposeMode(){return r()},isWithinCollection:!1,get widgetCollections(){return t.widgetCollections},showDropContainers:!1,get reduxDeviceDisplayType(){return t.reduxDeviceDisplayType},get plugins(){return t.plugins},get deviceDisplayType(){return t.deviceDisplayType},get componentProps(){return t.componentProps},get mounts(){return t.mounts},get placeholderValues(){return t.placeholderValues},get ancestorColumnIds(){return t.ancestorColumnIds}}),n.reset(x),n.template_effect(ne=>{n.set_attribute(x,"data-rulecms-overlay-layer",n.get(R).index),n.set_style(x,ne)},[()=>W(n.get(R).boxStyles)]),n.append(I,x)}),n.reset(_),n.template_effect(I=>n.set_style(_,I),[()=>W(n.get(c))]),n.append(C,_)},z=C=>{o(C)};n.if(T,C=>{n.get(a)?C(k):C(z,-1)})}n.append(e,E),n.pop()}function be(e,t){n.push(t,!0);var o=n.comment(),r=n.first_child(o);{var s=i=>{he(i,{get displayItemList(){return t.displayItemList},get isComposeMode(){return t.isComposeMode},get isWithinCollection(){return t.isWithinCollection},get widgetCollections(){return t.widgetCollections},get showDropContainers(){return t.showDropContainers},get reduxDeviceDisplayType(){return t.reduxDeviceDisplayType},get plugins(){return t.plugins},get deviceDisplayType(){return t.deviceDisplayType},get componentProps(){return t.componentProps},get mounts(){return t.mounts},get placeholderValues(){return t.placeholderValues},get ancestorColumnIds(){return t.ancestorColumnIds}})};n.if(r,i=>{var l,a;(a=(l=t.displayItemList)==null?void 0:l.rows)!=null&&a.length&&i(s)})}n.append(e,o),n.pop()}function no(e,t){n.push(t,!0);var o=n.comment(),r=n.first_child(o);n.each(r,17,()=>t.stylesheets??[],n.index,(s,i)=>{var l=n.comment(),a=n.first_child(l);n.html(a,()=>B(n.get(i),"data-rulecms-library-stylesheet")),n.append(s,l)}),n.append(e,o),n.pop()}var Vr=n.from_html("<div><!></div>"),gt=n.from_html("<!> <!>",1);function oo(e,t){const o=n.props_id();n.push(t,!0);const r=["Phone","Tablet","Desktop"],s=`rulecms-bp-${o.replace(/[^a-zA-Z0-9_-]/g,"")}`,i=n.derived(()=>t.scopeIdInput??s),l=n.derived(()=>Zn(t.displayItemList,t.widgetCollections)),a=n.derived(()=>wr(n.get(i)));var c=gt(),d=n.first_child(c);{let f=n.derived(()=>{var A;return(A=t.plugins.sourceComponents)==null?void 0:A.stylesheets});no(d,{get stylesheets(){return n.get(f)}})}var u=n.sibling(d,2);{var g=f=>{be(f,{get displayItemList(){return t.displayItemList},isComposeMode:!1,isWithinCollection:!1,get widgetCollections(){return t.widgetCollections},showDropContainers:!1,reduxDeviceDisplayType:"desktop",deviceDisplayType:"Desktop",get plugins(){return t.plugins},get componentProps(){return t.componentProps},get mounts(){return t.mounts},get placeholderValues(){return t.placeholderValues}})},m=f=>{var A=gt(),w=n.first_child(A);n.html(w,()=>B(n.get(a)));var h=n.sibling(w,2);n.each(h,16,()=>r,E=>E,(E,T)=>{var k=Vr(),z=n.child(k);be(z,{get displayItemList(){return t.displayItemList},isComposeMode:!1,isWithinCollection:!1,get widgetCollections(){return t.widgetCollections},showDropContainers:!1,reduxDeviceDisplayType:"desktop",get deviceDisplayType(){return T},get plugins(){return t.plugins},get componentProps(){return t.componentProps},get mounts(){return t.mounts},get placeholderValues(){return t.placeholderValues}}),n.reset(k),n.template_effect(C=>n.set_class(k,1,C),[()=>`${n.get(i)}-${T.toLowerCase()}`]),n.append(E,k)}),n.append(f,A)};n.if(u,f=>{n.get(l)?f(m,-1):f(g)})}n.append(e,c),n.pop()}function Fr(e,t,o){if(e)return"Phone";if(t)return"Tablet";const r=(o==null?void 0:o.toLowerCase())||"desktop";return r==="phone"?"Phone":r==="tablet"?"Tablet":"Desktop"}const Kr=`(max-width: ${et})`,Br=`(max-width: ${tt})`;var Ur=n.from_html("<!> <!>",1);function ro(e,t){n.push(t,!0);let o=n.state("Desktop"),r,s;function i(){n.set(o,Fr((r==null?void 0:r.matches)??!1,(s==null?void 0:s.matches)??!1,t.reduxDeviceDisplayType),!0)}n.user_effect(()=>(typeof matchMedia=="function"&&(r=matchMedia(Kr),s=matchMedia(Br),r.addEventListener("change",i),s.addEventListener("change",i)),i(),()=>{r==null||r.removeEventListener("change",i),s==null||s.removeEventListener("change",i)}));var l=Ur(),a=n.first_child(l);{var c=u=>{{let g=n.derived(()=>{var m;return(m=t.plugins.sourceComponents)==null?void 0:m.stylesheets});no(u,{get stylesheets(){return n.get(g)}})}};n.if(a,u=>{t.isWithinCollection||u(c)})}var d=n.sibling(a,2);be(d,{get displayItemList(){return t.displayItemList},get isComposeMode(){return t.isComposeMode},get isWithinCollection(){return t.isWithinCollection},get widgetCollections(){return t.widgetCollections},get showDropContainers(){return t.showDropContainers},get reduxDeviceDisplayType(){return t.reduxDeviceDisplayType},get deviceDisplayType(){return n.get(o)},get plugins(){return t.plugins},get componentProps(){return t.componentProps},get mounts(){return t.mounts},get placeholderValues(){return t.placeholderValues}}),n.append(e,l),n.pop()}function so(e){return e!==!1}const Hr=["utilities","components"],zr=new Set(Hr),io=e=>typeof e=="string"&&zr.has(e),Gr=e=>e.split(`
|
|
10
10
|
`).map(t=>t.length>0?` ${t}`:t).join(`
|
|
11
|
-
`),
|
|
12
|
-
${
|
|
13
|
-
}`:e:null,
|
|
11
|
+
`),Yr=(e,t)=>e?io(t)?`@layer ${t} {
|
|
12
|
+
${Gr(e)}
|
|
13
|
+
}`:e:null,Xr=e=>e.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),Jr=e=>{const t=e.replace(/[^A-Za-z0-9_-]/g,o=>`\\${o}`);return/^[0-9]/.test(t)?`\\3${t[0]} ${t.slice(1)}`:/^-[0-9]/.test(t)?`-\\3${t[1]} ${t.slice(2)}`:t},qr=["</","<script","@import","javascript:","vbscript:","expression("],Zr=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/,Qr=/[\s{};"]/,$r=/^[A-Za-z0-9_:%./[\]%-]+$/,es=e=>{let t=0;for(const o of e)if(o==="{")t+=1;else if(o==="}"&&(t-=1,t<0))return!1;return t===0},ts=e=>{const t=e.startsWith(".")?e.slice(1):e;return!t||t.length>200||t.startsWith(".")||Qr.test(t)?!1:$r.test(t)},ns=e=>{const t=e.trim();if(!t||t.length>4e3||Zr.test(t)||!es(t))return!1;const o=t.toLowerCase();return!qr.some(r=>o.includes(r))},os=e=>{if(!e)return{};const t={};for(const[o,r]of Object.entries(e)){const s=o.startsWith(".")?o.slice(1):o.trim();if(!ts(s)||typeof r!="string")continue;const i=r.trim();ns(i)&&(t[s]=i)}return t},rs=e=>e.split(`
|
|
14
14
|
`).map(t=>` ${t}`).join(`
|
|
15
|
-
`),
|
|
16
|
-
${
|
|
15
|
+
`),ss=(e,t,o,r)=>{if(!so(o))return null;const s=os(t),i=Object.keys(s);if(i.length===0||!e)return null;const l=`[data-rulecms-published-key="${Xr(e)}"]`,a=i.map(c=>`${l} .${Jr(c)} {
|
|
16
|
+
${rs(s[c])}
|
|
17
17
|
}`).join(`
|
|
18
|
-
`);return
|
|
18
|
+
`);return Yr(a,r)};function is(e,t){n.push(t,!0);const o=n.derived(()=>ss(t.publishedKey,t.classes,void 0,t.classLayer));var r=n.comment(),s=n.first_child(r);{var i=l=>{var a=n.comment(),c=n.first_child(a);n.html(c,()=>B(n.get(o),"data-rulecms-project-class-definitions")),n.append(l,a)};n.if(s,l=>{n.get(o)&&l(i)})}n.append(e,r),n.pop()}function it(e){return e!==!1}const lo=e=>e.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),ls=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-sans-serif","ui-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]),as=/^[a-zA-Z_\u00A0-\uFFFF-][a-zA-Z0-9_\u00A0-\uFFFF-]*$/,cs=/url\(|@|[{};\\<>]|javascript:/i,us=/url\(|@|[{};\\<>]|javascript:|expression\(/i,ds=/^--[A-Za-z_][\w-]*$/,fs=/^[A-Za-z0-9 ]+$/,gs=new Set([100,200,300,400,500,600,700,800,900]),ps=4,ms=8,ys=255,Ue=e=>ls.has(e.toLowerCase())||as.test(e)?e:`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`,pt=e=>typeof e=="string"&&e.trim()!==""&&e.trim().length<=80&&!e.includes(",")&&!cs.test(e),hs=e=>typeof e=="string"&&ds.test(e.trim())&&e.trim().length<=80,bs=e=>typeof e=="string"&&e.trim()!==""&&e.trim().length<=400&&!us.test(e),Cs=e=>typeof e!="number"||!Number.isInteger(e)||e<0||e>ys?null:e,_s=(e,t,o)=>{if(!Array.isArray(e))return[];const r=[];for(const s of e){if(!s||typeof s!="object"||r.length>=ps)continue;const i=s;if(!hs(i.name))continue;const l=i.name.trim();if(t.has(l))continue;const a=[],c=new Set;for(const u of i.overrideColors??[]){if(a.length>=ms)break;const g=Cs(u==null?void 0:u.index);g===null||c.has(g)||!bs(u==null?void 0:u.color)||(c.add(g),a.push({index:g,color:u.color.trim()}))}a.sort((u,g)=>u.index-g.index);const d=i.applyToWidget===!0&&!o.current;d&&(o.current=!0),t.add(l),r.push({name:l,...a.length>0?{overrideColors:a}:{},...d?{applyToWidget:!0}:{}})}return r},De=e=>{var l;if(!Array.isArray(e))return[];const t=[],o=new Set,r=new Set,s={current:!1};let i=!1;for(const a of e){if(!a||!pt(a.family))continue;const c=a.family.trim(),d=c.toLowerCase();if(o.has(d)||t.length>=12)continue;const u=(a.fallbacks??[]).filter(pt).slice(0,8),g=typeof a.cssVariable=="string"&&Q(a.cssVariable.trim())?a.cssVariable.trim():void 0;let m={kind:"stack-only"};if(((l=a.source)==null?void 0:l.kind)==="google"){if(!fs.test(c))continue;const h=(Array.isArray(a.source.weights)?a.source.weights:[]).filter(E=>typeof E=="number"&&gs.has(E)).filter((E,T,k)=>k.indexOf(E)===T).sort((E,T)=>E-T);if(h.length===0)continue;m={kind:"google",weights:h}}o.add(d);const f=a.applyToWidget===!0&&!i;f&&(i=!0);const A=_s(a.palettes,r,s);t.push({family:c,...g?{cssVariable:g}:{},fallbacks:u,applyToWidget:f,source:m,...A.length>0?{palettes:A}:{}})}return t},vs=e=>{const t=De(e).filter(o=>o.source.kind==="google").map(o=>{const r=o.source.kind==="google"?o.source.weights.join(";"):"400";return`family=${o.family.replace(/ /g,"+")}:wght@${r}`});return t.length===0?null:`https://fonts.googleapis.com/css2?${t.join("&")}&display=swap`},As=e=>[Ue(e.family),...(e.fallbacks??[]).map(Ue)].join(", "),Es=e=>{const t=[];for(const o of e)for(const r of o.palettes??[]){const s=[` font-family: ${Ue(o.family)};`];if(r.overrideColors&&r.overrideColors.length>0){const i=r.overrideColors.map(l=>`${l.index} ${l.color}`).join(", ");s.push(` override-colors: ${i};`)}t.push(`@font-palette-values ${r.name} {
|
|
19
19
|
${s.join(`
|
|
20
20
|
`)}
|
|
21
21
|
}`)}return t.length>0?t.join(`
|
|
22
22
|
|
|
23
|
-
`):null},
|
|
23
|
+
`):null},ws=e=>{for(const t of e)for(const o of t.palettes??[])if(o.applyToWidget)return o.name},Ss=(e,t,o)=>{if(!it(o)||!e)return null;const r=De(t),s=[];for(const d of r){const u=As(d);d.cssVariable&&s.push(` ${d.cssVariable}: ${u};`),d.applyToWidget&&s.push(` font-family: ${d.cssVariable?`var(${d.cssVariable})`:u};`)}const i=ws(r);i&&s.push(` font-palette: ${i};`);const l=Es(r),a=`[data-rulecms-published-key="${lo(e)}"] > *`,c=s.length>0?`${a} {
|
|
24
24
|
${s.join(`
|
|
25
25
|
`)}
|
|
26
|
-
}`:null;return!l&&!
|
|
26
|
+
}`:null;return!l&&!c?null:l?c?`${l}
|
|
27
27
|
|
|
28
|
-
${
|
|
28
|
+
${c}`:l:c};var Ts=n.from_html('<link rel="stylesheet" data-rulecms-project-fonts=""/>'),Is=n.from_html("<!> <!>",1);function Ps(e,t){n.push(t,!0);const o=n.derived(()=>De(t.fonts)),r=n.derived(()=>it(t.includeFontFaces)?vs(n.get(o)):null),s=n.derived(()=>Ss(t.publishedKey,n.get(o),t.includeFontFaces));var i=Is(),l=n.first_child(i);{var a=u=>{var g=Ts();n.template_effect(()=>n.set_attribute(g,"href",n.get(r))),n.append(u,g)};n.if(l,u=>{n.get(r)&&u(a)})}var c=n.sibling(l,2);{var d=u=>{var g=n.comment(),m=n.first_child(g);n.html(m,()=>B(n.get(s),"data-rulecms-project-fonts")),n.append(u,g)};n.if(c,u=>{n.get(s)&&u(d)})}n.append(e,i),n.pop()}function ao(e){return e!==!1}const Ds=80,Ls=4e3,ks=32,co=["url(","@import","@font-face","@media","@keyframes","</","<script","javascript:","expression(","behavior:"],Rs=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/,xs=/^[A-Za-z_][\w-]*$/,Os=e=>{let t=0;for(const o of e)if(o==="{")t+=1;else if(o==="}"&&(t-=1,t<0))return!1;return t===0},Ns=e=>{if(!e||e.length>Ds||e.includes("@")||e.includes(".")||/\s/.test(e))return!1;const t=e.toLowerCase();return co.some(o=>t.includes(o))?!1:xs.test(e)},Ws=e=>{const t=e.trim();if(t==="")return!1;const o=t.toLowerCase();if(o==="from"||o==="to")return!0;const r=t.match(/^(\d{1,3}(?:\.\d+)?)%$/);if(!r)return!1;const s=Number(r[1]);return s>=0&&s<=100},Ms=e=>{let t=0;const o=e.length;let r=0;const s=()=>{for(;t<o&&/\s/.test(e[t]);)t+=1};for(s();t<o;){const i=e.indexOf("{",t);if(i===-1||!e.slice(t,i).trim().split(",").every(d=>Ws(d)))return!1;t=i+1;const a=e.indexOf("}",t);if(a===-1)return!1;const c=e.slice(t,a);if(c.includes("{")||c.includes("}")||c.includes("@"))return!1;t=a+1,r+=1,s()}return r>0},js=e=>{const t=e.trim();if(!t||t.length>Ls||Rs.test(t)||!Os(t))return!1;const o=t.toLowerCase();return co.some(r=>o.includes(r))||t.includes("@")?!1:Ms(t)},uo=e=>{if(!e)return{};const t={};for(const[o,r]of Object.entries(e)){const s=o.trim();if(!Ns(s)||t[s]!==void 0||typeof r!="string")continue;const i=r.trim();if(js(i)&&(t[s]=i,Object.keys(t).length===ks))break}return Object.fromEntries(Object.entries(t).sort(([o],[r])=>o.localeCompare(r)))},Vs=e=>e.split(`
|
|
29
29
|
`).map(t=>` ${t}`).join(`
|
|
30
|
-
`),
|
|
31
|
-
${
|
|
30
|
+
`),Fs=(e,t,o)=>{if(!ao(o))return null;const r=uo(t),s=Object.keys(r);return s.length===0?null:s.map(i=>`@keyframes ${i} {
|
|
31
|
+
${Vs(r[i])}
|
|
32
32
|
}`).join(`
|
|
33
33
|
|
|
34
|
-
`)};function
|
|
34
|
+
`)};function Ks(e,t){n.push(t,!0);const o=n.derived(()=>Fs(t.publishedKey,t.keyframes));var r=n.comment(),s=n.first_child(r);{var i=l=>{var a=n.comment(),c=n.first_child(a);n.html(c,()=>B(n.get(o),"data-rulecms-project-keyframes")),n.append(l,a)};n.if(s,l=>{n.get(o)&&l(i)})}n.append(e,r),n.pop()}const fo=e=>e!==!1,Bs=80,Us=2e3,Hs=16,go=["url(","@","</","<script","javascript:","expression("],zs=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/,Gs=/^--[A-Za-z_][\w-]*$/,Ys=e=>{for(const t of e)if(t==="{"||t==="}")return!1;return!0},Xs=e=>{if(!e||e.length>Bs||e.includes("@")||e.includes(".")||/\s/.test(e))return!1;const t=e.toLowerCase();return go.some(o=>t.includes(o))?!1:Gs.test(e)},Js=e=>{const t=e.trim();if(!t||t.length>Us||zs.test(t)||!Ys(t))return!1;const o=t.toLowerCase();return!go.some(r=>o.includes(r))},po=e=>{if(!e)return{};const t={};for(const[o,r]of Object.entries(e)){const s=o.trim();if(!Xs(s)||t[s]!==void 0||typeof r!="string")continue;const i=r.trim();if(Js(i)&&(t[s]=i,Object.keys(t).length===Hs))break}return Object.fromEntries(Object.entries(t).sort(([o],[r])=>o.localeCompare(r)))},qs=e=>e.split(`
|
|
35
35
|
`).map(t=>` ${t}`).join(`
|
|
36
|
-
`),
|
|
37
|
-
${
|
|
36
|
+
`),Zs=(e,t,o)=>{if(!fo(o))return null;const r=po(t),s=Object.keys(r);return s.length===0?null:s.map(i=>`@position-try ${i} {
|
|
37
|
+
${qs(r[i])}
|
|
38
38
|
}`).join(`
|
|
39
39
|
|
|
40
|
-
`)};function
|
|
41
|
-
`)},
|
|
40
|
+
`)};function Qs(e,t){n.push(t,!0);const o=n.derived(()=>Zs(t.publishedKey,t.positionTry));var r=n.comment(),s=n.first_child(r);{var i=l=>{var a=n.comment(),c=n.first_child(a);n.html(c,()=>B(n.get(o),"data-rulecms-project-position-try")),n.append(l,a)};n.if(s,l=>{n.get(o)&&l(i)})}n.append(e,r),n.pop()}function mo(e){return e!==!1}const $s=["*","<number>","<integer>","<length>","<percentage>","<length-percentage>","<color>","<angle>","<time>","<transform-function>","<transform-list>"],ei=new Set($s),ti=/[{};]/,ni=200,oi=200,ri=e=>typeof e=="string"&&ei.has(e),si=(e,t)=>t!=="*"&&e===""?!1:t==="*"&&e===""?!0:!(e.length>oi||ti.test(e)||e.includes("url(")||e.includes("@")),yo=e=>{if(!Array.isArray(e))return[];const t=[],o=new Set;for(const r of e){if(!r||typeof r.name!="string"||!Q(r.name.trim()))continue;const s=r.name.trim();if(o.has(s)||t.length>=ni||!ri(r.syntax)||typeof r.inherits!="boolean")continue;const i=typeof r.initialValue=="string"?r.initialValue.trim():"";si(i,r.syntax)&&(o.add(s),t.push({name:s,syntax:r.syntax,inherits:r.inherits,initialValue:i}))}return t},ii=e=>{const t=[`@property ${e.name} {`,` syntax: "${e.syntax}";`,` inherits: ${e.inherits?"true":"false"};`];return e.initialValue!==""&&t.push(` initial-value: ${e.initialValue};`),t.push("}"),t.join(`
|
|
41
|
+
`)},li=(e,t,o)=>{if(!mo(o))return null;const r=yo(t);return r.length===0?null:r.map(ii).join(`
|
|
42
42
|
|
|
43
|
-
`)};function
|
|
43
|
+
`)};function ai(e,t){n.push(t,!0);const o=n.derived(()=>li(t.publishedKey,t.cssProperties));var r=n.comment(),s=n.first_child(r);{var i=l=>{var a=n.comment(),c=n.first_child(a);n.html(c,()=>B(n.get(o),"data-rulecms-project-css-properties")),n.append(l,a)};n.if(s,l=>{n.get(o)&&l(i)})}n.append(e,r),n.pop()}function ho(e){return e!==!1}const bo=e=>e.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),ci=/[{};]/,ui=e=>{if(!e)return{};const t={};for(const[o,r]of Object.entries(e)){if(!Q(o)||typeof r!="string")continue;const s=r.trim();s===""||ci.test(s)||(t[o.trim()]=s)}return t},di=(e,t,o)=>{if(!ho(o))return null;const r=ui(t),s=Object.keys(r);if(s.length===0||!e)return null;const i=`[data-rulecms-published-key="${bo(e)}"] > *`,l=s.sort((a,c)=>a.localeCompare(c)).map(a=>` ${a}: ${r[a]};`).join(`
|
|
44
44
|
`);return`${i} {
|
|
45
45
|
${l}
|
|
46
|
-
}`};function
|
|
47
|
-
${
|
|
46
|
+
}`};function Co(e){return e!==!1}const fi=5,gi=200,pi=[{kind:"prefers-color-scheme",value:"dark"},{kind:"prefers-color-scheme",value:"light"},{kind:"html-class",value:"dark"},{kind:"data-theme",value:"dark"},{kind:"data-theme",value:"light"}],mi=/[{};]/,yi=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e;return pi.some(o=>o.kind===t.kind&&o.value===t.value)},hi=e=>{if(!e||typeof e!="object"||Array.isArray(e))return{};const t={};for(const[o,r]of Object.entries(e)){if(!Q(o)||typeof r!="string")continue;const s=r.trim();s===""||mi.test(s)||s.includes("url(")||s.includes("@")||(t[o.trim()]=s)}return Object.fromEntries(Object.entries(t).sort(([o],[r])=>o.localeCompare(r)))},_o=e=>{if(!Array.isArray(e))return[];const t=[],o=new Set;let r=0;for(const s of e){if(!s||!yi(s.condition))continue;const i=`${s.condition.kind}:${s.condition.value}`;if(o.has(i))continue;const l=hi(s.variables),a=r+Object.keys(l).length;if(!(Object.keys(l).length===0||a>gi)&&(o.add(i),r=a,t.push({condition:s.condition,variables:l}),t.length===fi))break}return t},bi=(e,t)=>{const o=Object.entries(e).map(([r,s])=>` ${r}: ${s};`);return`${t} {
|
|
47
|
+
${o.join(`
|
|
48
48
|
`)}
|
|
49
|
-
}`},
|
|
49
|
+
}`},Ci=e=>e.split(`
|
|
50
50
|
`).map(t=>` ${t}`).join(`
|
|
51
|
-
`),
|
|
52
|
-
${
|
|
53
|
-
}`:
|
|
51
|
+
`),_i=(e,t)=>{const o=bi(e.variables,t),{kind:r,value:s}=e.condition;return r==="prefers-color-scheme"?`@media (prefers-color-scheme: ${s}) {
|
|
52
|
+
${Ci(o)}
|
|
53
|
+
}`:r==="html-class"?`html.${s} ${o}`:`[data-theme="${s}"] ${o}`},vi=(e,t,o)=>{if(!Co(o)||!e)return null;const r=_o(t);if(r.length===0)return null;const s=`[data-rulecms-published-key="${bo(e)}"] > *`;return r.map(i=>_i(i,s)).join(`
|
|
54
54
|
|
|
55
|
-
`)};function
|
|
55
|
+
`)};function Ai(e,t){n.push(t,!0);const o=n.derived(()=>vi(t.publishedKey,t.themes));var r=n.comment(),s=n.first_child(r);{var i=l=>{var a=n.comment(),c=n.first_child(a);n.html(c,()=>B(n.get(o),"data-rulecms-project-themes")),n.append(l,a)};n.if(s,l=>{n.get(o)&&l(i)})}n.append(e,r),n.pop()}function Ei(e,t){n.push(t,!0);const o=n.derived(()=>di(t.publishedKey,t.variables));var r=n.comment(),s=n.first_child(r);{var i=l=>{var a=n.comment(),c=n.first_child(a);n.html(c,()=>B(n.get(o),"data-rulecms-project-css-variables")),n.append(l,a)};n.if(s,l=>{n.get(o)&&l(i)})}n.append(e,r),n.pop()}function vo(e){return e!==!1}const wi=["light","dark","light dark"],Si=["auto","thin","none"],Ti=new Set(wi),Ii=new Set(Si),Pi=/[{};]|url\(|@/i,Di=e=>typeof e=="string"&&e.trim()!==""&&e.trim().length<=400&&!Pi.test(e),fe=e=>Di(e)?e.trim():void 0,Ao=e=>{if(!e||typeof e!="object"||Array.isArray(e))return null;const t=fe(e.selectionBackground),o=fe(e.selectionColor),r=fe(e.caretColor),s=fe(e.scrollbarColor),i={...typeof e.colorScheme=="string"&&Ti.has(e.colorScheme)?{colorScheme:e.colorScheme}:{},...t?{selectionBackground:t}:{},...o?{selectionColor:o}:{},...r?{caretColor:r}:{},...s?{scrollbarColor:s}:{},...typeof e.scrollbarWidth=="string"&&Ii.has(e.scrollbarWidth)?{scrollbarWidth:e.scrollbarWidth}:{}};return Object.keys(i).length>0?i:null},Li=(e,t,o)=>{if(!vo(o)||!e)return null;const r=Ao(t);if(!r)return null;const s=`[data-rulecms-published-key="${lo(e)}"]`,i=[];r.colorScheme&&i.push(` color-scheme: ${r.colorScheme};`),r.caretColor&&i.push(` caret-color: ${r.caretColor};`),r.scrollbarWidth&&i.push(` scrollbar-width: ${r.scrollbarWidth};`),r.scrollbarColor&&i.push(` scrollbar-color: ${r.scrollbarColor};`);const l=[];r.selectionBackground&&l.push(` background: ${r.selectionBackground};`),r.selectionColor&&l.push(` color: ${r.selectionColor};`);const a=[];return i.length>0&&a.push(`${s} > * {
|
|
56
56
|
${i.join(`
|
|
57
57
|
`)}
|
|
58
58
|
}`),l.length>0&&a.push(`${s} > * ::selection {
|
|
59
59
|
${l.join(`
|
|
60
60
|
`)}
|
|
61
61
|
}`),a.length>0?a.join(`
|
|
62
|
-
`):null};function
|
|
62
|
+
`):null};function ki(e,t){n.push(t,!0);const o=n.derived(()=>Li(t.publishedKey,t.widgetChrome));var r=n.comment(),s=n.first_child(r);{var i=l=>{var a=n.comment(),c=n.first_child(a);n.html(c,()=>B(n.get(o),"data-rulecms-project-widget-chrome")),n.append(l,a)};n.if(s,l=>{n.get(o)&&l(i)})}n.append(e,r),n.pop()}function Ri(e){return e!==!1}function xi(e){const t={};return Object.entries(e).forEach(([o,r])=>{const s={...r};if(s.itemList)try{s.collectionRows=typeof s.itemList=="string"?JSON.parse(s.itemList):s.itemList}catch(l){console.error(`Failed to parse itemList for collection ${o}:`,l),s.collectionRows={rows:[]}}let i=`${s.name}$${o}`;s.parentId&&(i=`${i}@${s.parentId}`),t[i]=s}),t}function Oi(e){return typeof e.itemList=="string"?JSON.parse(e.itemList):e.itemList}function Le(e){const t=De(e.fontFaces),o=uo(e.keyframes),r=_o(e.themes),s=yo(e.cssProperties),i=Ao(e.widgetChrome),l=po(e.positionTry),a=Ri(e.includeClassLayer)&&io(e.classLayer)?e.classLayer:void 0;return{displayItemList:Oi(e.widget),widgetCollections:xi(e.childCollections),...e.libraries?{libraries:e.libraries}:{},...ho(e.includeCssVariables)&&e.cssVariables&&Object.keys(e.cssVariables).length>0?{cssVariables:e.cssVariables}:{},...so(e.includeClassDefinitions)&&e.classDefinitions&&Object.keys(e.classDefinitions).length>0?{classDefinitions:e.classDefinitions}:{},...it(e.includeFontFaces)&&t.length>0?{fontFaces:t}:{},...ao(e.includeKeyframes)&&Object.keys(o).length>0?{keyframes:o}:{},...Co(e.includeThemes)&&r.length>0?{themes:r}:{},...mo(e.includeCssProperties)&&s.length>0?{cssProperties:s}:{},...vo(e.includeWidgetChrome)&&i?{widgetChrome:i}:{},...a?{classLayer:a}:{},...fo(e.includePositionTry)&&Object.keys(l).length>0?{positionTry:l}:{}}}function Ni(e){const t=e.registry??ie(),o=ve({displayItemList:e.displayItemList,widgetCollections:e.widgetCollections});return t.resolveSync({registrations:e.libraries,referenced:o})}function Wi(e){const t=e.registry??ie(),o=ve({displayItemList:e.displayItemList,widgetCollections:e.widgetCollections});return t.resolve({registrations:e.libraries,referenced:o})}function Mi(e){const t=e.lastIndexOf(ye);return t===-1?e:e.slice(t+ye.length)}const ji="text/plain";function Vi({token:e,rulesetPublishedKey:t,params:o}){return G(e)?{token:e,rulesetKey:Mi(t),...o?{params:o}:{}}:{token:e,rulesetPublishedKey:t,...o?{params:o}:{},mode:"payload"}}function Eo({contentType:e=ji,...t}){return{method:"POST",headers:{"Content-Type":e},body:JSON.stringify(Vi(t))}}const He="rulecms_anon_id";function mt(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function wo(){if(!(typeof window>"u"))try{const e=window.localStorage.getItem(He);if(e)return e;const t=mt();return window.localStorage.setItem(He,t),t}catch{return mt()}}function So(e){return e>=500}function Fi(e){if(!(e!=null&&e.success)||!e.data)return null;const{selection:t,...o}=e.data;return{raw:o,selection:t}}function Ki(e,t){if(!(e!=null&&e.resolution)||!e.widget)return null;const{resolution:o,...r}=e,s={rulesetPublishedKey:t,outcome:o.outcome,ruleId:o.ruleId??null,variantId:o.variantId??null,widgetKey:o.widgetKey,widgetPublishedKey:o.widgetPublishedKey};return{raw:r,selection:s}}function To({token:e,rulesetPublishedKey:t,body:o}){return G(e)?Ki(o,t):Fi(o)}function Io(e){return JSON.stringify(e,(t,o)=>{if(o===null||typeof o!="object"||Array.isArray(o))return o;const r={};for(const s of Object.keys(o).sort())r[s]=o[s];return r})}const Bi={display:"flex",justifyContent:"center",alignItems:"center",padding:"3rem",color:"#e2e8f0"},Ui={display:"flex",alignItems:"center",gap:"1rem"},Hi={width:"40px",height:"40px",border:"4px solid #4a5568",borderTopColor:"#63b3ed",borderRadius:"50%",animation:"spin 1s linear infinite"},yt={padding:"1.5rem",backgroundColor:"#742a2a",border:"1px solid #9b2c2c",borderRadius:"8px",color:"#fed7d7"},ht={fontSize:"16px",fontWeight:"600",marginBottom:"0.5rem",color:"#feb2b2"},bt={fontSize:"14px",color:"#fed7d7"},zi=`
|
|
63
63
|
@keyframes spin {
|
|
64
64
|
from {
|
|
65
65
|
transform: rotate(0deg);
|
|
@@ -68,4 +68,4 @@ ${l.join(`
|
|
|
68
68
|
transform: rotate(360deg);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
`,Ui="data-rulecms-published-key";var Hi=n.from_html("<div><div><div></div></div></div>"),zi=n.from_html("<div><div>Error Loading Widget</div> <div> </div></div>"),Gi=n.from_html("<div><div>No Widget Data</div> <div>No widget data available</div></div>"),Yi=n.from_html('<span style="display: contents"><!> <!> <!> <!> <!> <!> <!> <!> <!></span>');function Xi(e,t){n.push(t,!0);let r=n.prop(t,"mode",3,"client-fetch");const o=Re.getContext(qe);let s=n.state(!0),i=n.state(null),l=n.state(null),a=n.state(null),d=n.state("");const u=n.derived(()=>r()==="pre-fetched"),c=n.derived(()=>({sourceComponents:n.get(a)??void 0})),f=n.derived(()=>t.publishedKey||n.get(d));let p=null,g=null,E=!1,A=0;class b extends Error{constructor(m){super(m),this.name="FetchWidgetMessage"}}function _(){if(!n.get(l)){n.set(a,null);return}const y=t.libraries??(o==null?void 0:o.libraries),m=o==null?void 0:o.libraryRegistry,S=ki({displayItemList:n.get(l).displayItemList,widgetCollections:n.get(l).widgetCollections,libraries:y,registry:m});if(S){n.set(a,S,!0);return}Ri({displayItemList:n.get(l).displayItemList,widgetCollections:n.get(l).widgetCollections,libraries:y,registry:m}).then(P=>{n.set(a,P,!0)})}function T(){n.get(l)&&Yn({componentProps:t.componentProps,displayItemList:n.get(l).displayItemList,widgetCollections:n.get(l).widgetCollections,publishedKey:n.get(f)})}function W(){if(E||typeof document>"u")return;const y="rulecms-widget-spinner-styles";if(!document.getElementById(y)){const m=document.createElement("style");m.id=y,m.textContent=Bi,document.head.appendChild(m)}E=!0}function H(){const y=t.token??(o==null?void 0:o.token),m=t.endpoint??(o==null?void 0:o.endpoint),S=G(y),P=t.rulesetPublishedKey;if(!t.publishedKey&&!P||!y){!t.publishedKey&&!P?n.set(i,P!==void 0?S?"Ruleset key is required":"Ruleset published key is required":S?"Widget key is required":"Published key is required",!0):n.set(i,"Token is required. Provide it either directly as a prop (`token`) or via RuleCMSWidgetProvider."),n.set(l,null),n.set(s,!1);return}const N=Er(t.params),R=JSON.stringify({publishedKey:t.publishedKey,rulesetPublishedKey:P,token:y,endpoint:m,paramsKey:N,anonymousId:t.anonymousId,fallbackPublishedKey:t.fallbackPublishedKey,contentType:t.contentType});if(g===R&&n.get(l)){n.set(s,!1),_();return}p==null||p.abort(),p=new AbortController;const K=p.signal;g=R,n.set(s,!0),n.set(i,null);const oe=++A,z=async I=>(await I.json().catch(()=>({error:"Unknown error"}))).error||`Request failed with status ${I.status}`,J=async I=>{const M=Ge({publishedKey:I,token:y,endpoint:m}),B=await fetch(M,{method:"GET",...S?{cache:"no-store"}:{},signal:K});if(!B.ok)throw new b(await z(B));const j=await B.json();if(!j.success)throw new b("Failed to fetch widget data");return j.data};(P?(async()=>{const I=N?JSON.parse(N):{};if(t.anonymousId!==!1){if(typeof t.anonymousId=="string")I.anonId=I.anonId??t.anonymousId;else if(I.anonId==null){const j=Cr();j&&(I.anonId=j)}}let M;try{M=await fetch(Ye({token:y,endpoint:m}),{..._r({token:y,rulesetPublishedKey:P,params:I,contentType:t.contentType}),signal:K})}catch(j){if(j instanceof DOMException&&j.name==="AbortError")throw j;if(t.fallbackPublishedKey)return{raw:await J(t.fallbackPublishedKey),selection:null};throw j}if(!M.ok){if(t.fallbackPublishedKey&&vr(M.status))return{raw:await J(t.fallbackPublishedKey),selection:null};throw new b(await z(M))}const B=Ar({token:y,rulesetPublishedKey:P,body:await M.json()});if(!B)throw new b("Failed to fetch widget data");return{raw:B.raw,selection:B.selection}})():J(t.publishedKey).then(I=>({raw:I,selection:null}))).then(({raw:I,selection:M})=>{var B,j;n.set(l,Pe(I),!0),n.set(d,((B=I.widget)==null?void 0:B.publishedKey)??"",!0),n.set(i,null),_(),T(),M&&((j=t.onSelection)==null||j.call(t,M))}).catch(I=>{I instanceof DOMException&&I.name==="AbortError"||(console.error("Error fetching widget:",I),n.set(i,I instanceof b?I.message:"Failed to fetch widget",!0),n.set(l,null))}).finally(()=>{A===oe&&n.set(s,!1)})}function h(){if(r()==="pre-fetched"){n.set(l,t.initialData??null,!0),n.set(s,!1),n.set(i,null),_(),T();return}W(),H()}n.user_effect(()=>(t.publishedKey,t.rulesetPublishedKey,t.params,t.anonymousId,t.fallbackPublishedKey,t.contentType,t.token,t.endpoint,r(),t.initialData,t.libraries,t.componentProps,Re.untrack(()=>h()),()=>{p==null||p.abort()}));var C=Yi(),v=n.child(C);{let y=n.derived(()=>{var m;return(m=n.get(l))==null?void 0:m.fontFaces});Ss(v,{get publishedKey(){return n.get(f)},get fonts(){return n.get(y)}})}var w=n.sibling(v,2);{let y=n.derived(()=>{var m;return(m=n.get(l))==null?void 0:m.keyframes});js(w,{get publishedKey(){return n.get(f)},get keyframes(){return n.get(y)}})}var D=n.sibling(w,2);{let y=n.derived(()=>{var m;return(m=n.get(l))==null?void 0:m.themes});_i(D,{get publishedKey(){return n.get(f)},get themes(){return n.get(y)}})}var x=n.sibling(D,2);{let y=n.derived(()=>{var m;return(m=n.get(l))==null?void 0:m.cssProperties});si(x,{get publishedKey(){return n.get(f)},get cssProperties(){return n.get(y)}})}var k=n.sibling(x,2);{let y=n.derived(()=>{var m;return(m=n.get(l))==null?void 0:m.widgetChrome});Pi(k,{get publishedKey(){return n.get(f)},get widgetChrome(){return n.get(y)}})}var $=n.sibling(k,2);{let y=n.derived(()=>{var m;return(m=n.get(l))==null?void 0:m.positionTry});Js($,{get publishedKey(){return n.get(f)},get positionTry(){return n.get(y)}})}var te=n.sibling($,2);{let y=n.derived(()=>{var m;return(m=n.get(l))==null?void 0:m.cssVariables});Ci(te,{get publishedKey(){return n.get(f)},get variables(){return n.get(y)}})}var ne=n.sibling(te,2);{let y=n.derived(()=>{var S;return(S=n.get(l))==null?void 0:S.classDefinitions}),m=n.derived(()=>{var S;return(S=n.get(l))==null?void 0:S.classLayer});rs(ne,{get publishedKey(){return n.get(f)},get classes(){return n.get(y)},get classLayer(){return n.get(m)}})}var De=n.sibling(ne,2);{var re=y=>{var m=Hi(),S=n.child(m),P=n.child(S);n.reset(S),n.reset(m),n.template_effect((N,R,K)=>{n.set_style(m,N),n.set_style(S,R),n.set_style(P,K)},[()=>O(Vi),()=>O(Fi),()=>O(Ki)]),n.append(y,m)},V=y=>{var m=zi(),S=n.child(m),P=n.sibling(S,2),N=n.child(P,!0);n.reset(P),n.reset(m),n.template_effect((R,K,oe)=>{n.set_style(m,R),n.set_style(S,K),n.set_style(P,oe),n.set_text(N,n.get(i))},[()=>O(gt),()=>O(pt),()=>O(mt)]),n.append(y,m)},ae=y=>{var m=Gi(),S=n.child(m),P=n.sibling(S,2);n.reset(m),n.template_effect((N,R,K)=>{n.set_style(m,N),n.set_style(S,R),n.set_style(P,K)},[()=>O(gt),()=>O(pt),()=>O(mt)]),n.append(y,m)},xe=y=>{var m=n.comment(),S=n.first_child(m);{var P=R=>{er(R,{get displayItemList(){return n.get(l).displayItemList},get widgetCollections(){return n.get(l).widgetCollections},get plugins(){return n.get(c)},get componentProps(){return t.componentProps},get mounts(){return t.mounts},get placeholderValues(){return t.placeholderValues}})},N=R=>{tr(R,{get displayItemList(){return n.get(l).displayItemList},isComposeMode:!1,isWithinCollection:!1,get widgetCollections(){return n.get(l).widgetCollections},showDropContainers:!1,reduxDeviceDisplayType:"desktop",get plugins(){return n.get(c)},get componentProps(){return t.componentProps},get mounts(){return t.mounts},get placeholderValues(){return t.placeholderValues}})};n.if(S,R=>{n.get(u)?R(P):R(N,-1)})}n.append(y,m)};n.if(De,y=>{r()!=="pre-fetched"&&n.get(s)?y(re):r()!=="pre-fetched"&&n.get(i)?y(V,1):r()!=="pre-fetched"&&!n.get(l)?y(ae,2):n.get(a)&&n.get(l)&&y(xe,3)})}n.reset(C),n.template_effect(()=>n.set_attribute(C,"data-rulecms-published-key",n.get(f))),n.append(e,C),n.pop()}const wr=6e4;class X extends Error{constructor(r,o){super(r);it(this,"status");this.name="FetchRuleCMSWidgetError",this.status=o}}const he=new Map;function Ji(){he.clear()}function yt(e){const t=e==null?void 0:e.cache;return t==="no-store"||t==="reload"||t==="no-cache"}function qi(e,t){const r=he.get(e);if(r){if(r.expiresAt<=t){he.delete(e);return}return r.data}}async function Sr(e){return(await e.json().catch(()=>({error:"Unknown error"}))).error||`Request failed with status ${e.status}`}async function Tr({publishedKey:e,token:t,endpoint:r,fetchOptions:o}){const s=Ge({publishedKey:e,token:t,endpoint:r}),i=G(t),l=Date.now();if(!i&&!yt(o)){const c=qi(s,l);if(c)return c}const a=await fetch(s,{method:"GET",...i?{cache:"no-store"}:{},...o});if(!a.ok)throw new X(await Sr(a),a.status);const d=await a.json();if(!d.success)throw new X("Failed to fetch widget data");const u=Pe(d.data);return!i&&!yt(o)&&he.set(s,{expiresAt:l+wr,data:u}),u}async function Zi(e){const{rulesetPublishedKey:t,params:r,fallbackPublishedKey:o,contentType:s,token:i,endpoint:l,fetchOptions:a}=e,d=()=>Tr({publishedKey:o,token:i,endpoint:l,fetchOptions:a});let u;try{u=await fetch(Ye({token:i,endpoint:l}),{..._r({token:i,rulesetPublishedKey:t,params:r,contentType:s}),...a})}catch(f){if(o)return d();throw f}if(!u.ok){if(o&&vr(u.status))return d();throw new X(await Sr(u),u.status)}const c=Ar({token:i,rulesetPublishedKey:t,body:await u.json()});if(!c)throw new X("Failed to fetch widget data");return{...Pe(c.raw),selection:c.selection}}async function Qi(e){const{publishedKey:t,rulesetPublishedKey:r,token:o}=e;if(!t&&!r){const s=G(o);throw r!==void 0?new X(s?"Ruleset key is required":"Ruleset published key is required"):new X(s?"Widget key is required":"Published key is required")}if(!o)throw new X("Token is required");return e.rulesetPublishedKey?Zi(e):Tr(e)}async function $i(e){const{data:t,libraries:r}=e,o=_e({displayItemList:t.displayItemList,widgetCollections:t.widgetCollections});return ie().resolve({registrations:r,referenced:o})}exports.AlignContentTypes=Or;exports.BreakpointVariantRender=er;exports.COLLECTION_TYPE_PREFIX=He;exports.COMPONENT_PROPS_PATH_SEPARATOR=le;exports.CSS_CLASSES_ATTRIBUTE_NAME=we;exports.CSS_VARIABLE_NAME_MAX_LENGTH=Vt;exports.CSS_VARIABLE_NAME_PATTERN=jt;exports.DEFAULT_BASE_Z_INDEX=nt;exports.DEFAULT_CLOUDINARY_CLOUD_NAME=kt;exports.DEFAULT_LIBRARY_ID=ee;exports.DEFAULT_PUBLISHED_WIDGET_CACHE_MS=wr;exports.DEFAULT_ROW_GAP=Dn;exports.DEV_CLIENT_TOKEN_PREFIX=bt;exports.DEV_WIDGET_API_PATH=At;exports.DEV_WIDGET_RESOLVE_API_PATH=wt;exports.DeviceDisplayTypes=Wr;exports.DisplayComponent=Qn;exports.DisplayItemTypes=be;exports.DragItemIdPrefixTypes=Ue;exports.EMBEDDED_KEY_SEPARATOR=Dt;exports.FLEX_LAYOUT_STYLE_KEYS_THAT_DERIVE_DISPLAY=ln;exports.FetchRuleCMSWidgetError=X;exports.HIDE_WIDGET_ATTRIBUTE_NAME=$e;exports.JustifyContentTypes=We;exports.POINTER_EVENTS_ATTRIBUTE_NAME=Rn;exports.PUBLISHED_KEY_SEPARATOR=pe;exports.PUBLISHED_WIDGET_API_PATH=vt;exports.PUBLISHED_WIDGET_RESOLVE_API_PATH=Et;exports.PageViewTypes=Oe;exports.RULECMS_ANONYMOUS_ID_STORAGE_KEY=Ke;exports.RULECMS_API_ORIGIN=_t;exports.RULECMS_PUBLISHED_KEY_ATTRIBUTE=Ui;exports.RULECMS_WIDGET_CONTEXT_KEY=qe;exports.RenderComponents=tr;exports.RenderComponentsForDevice=ye;exports.RenderComponentsInner=me;exports.RuleCMSWidget=Xi;exports.RuleCMSWidgetProvider=Hr;exports.WIDGET_ATTRIBUTES_IGNORED_IN_COMPOSE_MODE=On;exports.WIDGET_CACHE_API_ORIGIN=Ct;exports.WIDGET_PLACEHOLDER_VALUES_KEY=je;exports.Z_INDEX_WIDGET_ATTRIBUTE_NAME=Nn;exports.alignContentAllowlist=tn;exports.alignItemsAllowlist=$t;exports.backgroundPositionAllowlist=on;exports.backgroundRepeatAllowlist=sn;exports.backgroundSizeAllowlist=rn;exports.borderStyleKeywords=an;exports.boxSpacingSideKeys=Bt;exports.boxSpacingStyleAttributeEntries=uo;exports.buildCloudinaryBackgroundUrl=Mt;exports.buildOverlayLayerBoxStyles=Bn;exports.buildOverlayStackStyles=Kn;exports.buildWidgetFetchUrl=Ge;exports.buildWidgetResolveUrl=Ye;exports.clearPublishedWidgetFetchCache=Ji;exports.collectComponentInstancePaths=zn;exports.collectReferencedLibraryIds=_e;exports.composeSourceComponentsPlugin=ht;exports.createComponentLibraryRegistry=ie;exports.cssAttrArrayKey=ge;exports.defaultPageWidth=Lt;exports.deriveDisplayFlexIfNeeded=Sn;exports.desktopModeWidth=zr;exports.fetchRuleCMSWidget=Qi;exports.findUnmatchedComponentPropsKeys=Gn;exports.flexDirectionAllowlist=nn;exports.flexWrapAllowlist=en;exports.fontFamilyAllowlist=zt;exports.fontStyleAllowlist=Yt;exports.fontWeightAllowlist=Gt;exports.formatBackgroundImageStyles=mn;exports.formatBorderStyles=yn;exports.formatBoxShadowStyles=hn;exports.formatBoxSpacingStyles=bn;exports.formatCssColorStyles=_n;exports.formatCssColorValue=Ae;exports.formatCssEnumStyles=Cn;exports.formatCssLengthStyles=vn;exports.formatCssVariable=F;exports.formatCssVariableStyles=oo;exports.formatLineHeightStyles=An;exports.formatObjectStyleAttribute=wn;exports.formatOpacityStyles=En;exports.formatSpacingSideValue=Z;exports.generatePublishedKey=xt;exports.generatePublishedKeyForEmbedded=Kr;exports.getCollectionIdForCollectionType=Je;exports.getColumnAttributes=se;exports.getComponentAttributesAndStyles=Ne;exports.getComponentsPluginFromPlugins=fe;exports.getCssVariableFromLeaf=L;exports.getDefaultDimensionAttributes=Tn;exports.getDeviceTypeBasedAttributes=Y;exports.getDragItemId=Nr;exports.getDragItemPrefixAndId=St;exports.getIdAndPrefix=Tt;exports.getMergedAttributes=In;exports.getNameAndInstanceIdFromWidgetKey=Mr;exports.getNameFromWidgetKey=jr;exports.getOrCreateAnonymousId=Cr;exports.getOverlayLayerZIndex=jn;exports.getWidgetKeyForCollection=It;exports.getWidgetKeyForCollectionWithPrefix=Vr;exports.getWidgetKeyForPublishedCollection=Pt;exports.getWidgetKeyForPublishedCollectionWithPrefix=Fr;exports.hasBoxShadowLeaf=fn;exports.hasDeviceDivergentValues=Xn;exports.hasInvalidCssVariable=U;exports.hasItems=Pn;exports.hasOverlayLayers=Mn;exports.incrementVersion=Br;exports.isBackgroundImageValue=Ft;exports.isBorderStyleValue=cn;exports.isBorderValue=un;exports.isBoxShadowValue=dn;exports.isBoxSpacingValue=Ut;exports.isCloudinaryCloudName=Ot;exports.isCloudinaryPublicId=Rt;exports.isCloudinaryTransformationString=Nt;exports.isCssColorValue=ve;exports.isCssEnumValue=Ht;exports.isCssVariableName=Q;exports.isDevClientToken=G;exports.isLineHeightValue=gn;exports.isOpacityValue=pn;exports.isOverlayLayerEmptyForDevice=Fn;exports.isRowHiddenForDevice=Ln;exports.isSafeImageUrl=Wt;exports.isSpacingSideValue=q;exports.isWidgetHiddenForDevice=Te;exports.justifyContentAllowlist=Qt;exports.normalizeCssClasses=Se;exports.objectStyleAttributeRegistry=Ee;exports.overflowAllowlist=de;exports.phoneModeWidth=Ze;exports.pointerEventsAllowlist=Zt;exports.prepareRuleCMSWidgetData=Pe;exports.resolveBaseZIndex=Me;exports.resolveKey=Be;exports.resolveOverlayLayerPointerEvents=Vn;exports.resolveRowStyles=kn;exports.resolveWidgetApiOrigin=ze;exports.resolveWidgetContainerStyles=et;exports.resolveWidgetInstanceProps=Un;exports.resolveWidgetLibraries=$i;exports.rowBasedPropertiesAreAssigned=xn;exports.spacingKeywords=Ce;exports.spacingLengthUnits=Kt;exports.stableJsonStringify=Er;exports.tabletModeWidth=Qe;exports.textAlignAllowlist=Xt;exports.textDecorationAllowlist=Jt;exports.textTransformAllowlist=qt;exports.toStyleAttr=O;exports.typeHasPrefix=Xe;exports.warnUnmatchedComponentProps=Yn;exports.widgetBasedPropertiesAreAssigned=Wn;exports.widgetDeclaresOwnHeight=tt;exports.withWidgetPlaceholderValues=Hn;
|
|
71
|
+
`,Gi="data-rulecms-published-key";var Yi=n.from_html("<div><div><div></div></div></div>"),Xi=n.from_html("<div><div>Error Loading Widget</div> <div> </div></div>"),Ji=n.from_html("<div><div>No Widget Data</div> <div>No widget data available</div></div>"),qi=n.from_html('<span style="display: contents"><!> <!> <!> <!> <!> <!> <!> <!> <!></span>');function Zi(e,t){n.push(t,!0);let o=n.prop(t,"mode",3,"client-fetch");const r=We.getContext($e);let s=n.state(!0),i=n.state(null),l=n.state(null),a=n.state(null),c=n.state("");const d=n.derived(()=>o()==="pre-fetched"),u=n.derived(()=>({sourceComponents:n.get(a)??void 0})),g=n.derived(()=>t.publishedKey||n.get(c));let m=null,f=null,A=!1,w=0;class h extends Error{constructor(p){super(p),this.name="FetchWidgetMessage"}}function E(){if(!n.get(l)){n.set(a,null);return}const y=t.libraries??(r==null?void 0:r.libraries),p=r==null?void 0:r.libraryRegistry,S=Ni({displayItemList:n.get(l).displayItemList,widgetCollections:n.get(l).widgetCollections,libraries:y,registry:p});if(S){n.set(a,S,!0);return}Wi({displayItemList:n.get(l).displayItemList,widgetCollections:n.get(l).widgetCollections,libraries:y,registry:p}).then(P=>{n.set(a,P,!0)})}function T(){n.get(l)&&qn({componentProps:t.componentProps,displayItemList:n.get(l).displayItemList,widgetCollections:n.get(l).widgetCollections,publishedKey:n.get(g)})}function k(){if(A||typeof document>"u")return;const y="rulecms-widget-spinner-styles";if(!document.getElementById(y)){const p=document.createElement("style");p.id=y,p.textContent=zi,document.head.appendChild(p)}A=!0}function z(){const y=t.token??(r==null?void 0:r.token),p=t.endpoint??(r==null?void 0:r.endpoint),S=G(y),P=t.rulesetPublishedKey;if(!t.publishedKey&&!P||!y){!t.publishedKey&&!P?n.set(i,P!==void 0?S?"Ruleset key is required":"Ruleset published key is required":S?"Widget key is required":"Published key is required",!0):n.set(i,"Token is required. Provide it either directly as a prop (`token`) or via RuleCMSWidgetProvider."),n.set(l,null),n.set(s,!1);return}const M=Io(t.params),O=JSON.stringify({publishedKey:t.publishedKey,rulesetPublishedKey:P,token:y,endpoint:p,paramsKey:M,anonymousId:t.anonymousId,fallbackPublishedKey:t.fallbackPublishedKey,contentType:t.contentType});if(f===O&&n.get(l)){n.set(s,!1),E();return}m==null||m.abort(),m=new AbortController;const N=m.signal;f=O,n.set(s,!0),n.set(i,null);const J=++w,ue=async D=>(await D.json().catch(()=>({error:"Unknown error"}))).error||`Request failed with status ${D.status}`,re=async D=>{const F=Je({publishedKey:D,token:y,endpoint:p}),U=await fetch(F,{method:"GET",...S?{cache:"no-store"}:{},signal:N});if(!U.ok)throw new h(await ue(U));const j=await U.json();if(!j.success)throw new h("Failed to fetch widget data");return j.data};(P?(async()=>{const D=M?JSON.parse(M):{};if(t.anonymousId!==!1){if(typeof t.anonymousId=="string")D.anonId=D.anonId??t.anonymousId;else if(D.anonId==null){const j=wo();j&&(D.anonId=j)}}let F;try{F=await fetch(qe({token:y,endpoint:p}),{...Eo({token:y,rulesetPublishedKey:P,params:D,contentType:t.contentType}),signal:N})}catch(j){if(j instanceof DOMException&&j.name==="AbortError")throw j;if(t.fallbackPublishedKey)return{raw:await re(t.fallbackPublishedKey),selection:null};throw j}if(!F.ok){if(t.fallbackPublishedKey&&So(F.status))return{raw:await re(t.fallbackPublishedKey),selection:null};throw new h(await ue(F))}const U=To({token:y,rulesetPublishedKey:P,body:await F.json()});if(!U)throw new h("Failed to fetch widget data");return{raw:U.raw,selection:U.selection}})():re(t.publishedKey).then(D=>({raw:D,selection:null}))).then(({raw:D,selection:F})=>{var U,j;n.set(l,Le(D),!0),n.set(c,((U=D.widget)==null?void 0:U.publishedKey)??"",!0),n.set(i,null),E(),T(),F&&((j=t.onSelection)==null||j.call(t,F))}).catch(D=>{D instanceof DOMException&&D.name==="AbortError"||(console.error("Error fetching widget:",D),n.set(i,D instanceof h?D.message:"Failed to fetch widget",!0),n.set(l,null))}).finally(()=>{w===J&&n.set(s,!1)})}function C(){n.set(l,t.initialData??null,!0),n.set(s,!1),n.set(i,null),E(),T()}function _(){if(o()==="pre-fetched"){C();return}k(),z()}function b(){o()==="pre-fetched"&&C()}b(),n.user_effect(()=>(t.publishedKey,t.rulesetPublishedKey,t.params,t.anonymousId,t.fallbackPublishedKey,t.contentType,t.token,t.endpoint,o(),t.initialData,t.libraries,t.componentProps,We.untrack(()=>_()),()=>{m==null||m.abort()}));var v=qi(),I=n.child(v);{let y=n.derived(()=>{var p;return(p=n.get(l))==null?void 0:p.fontFaces});Ps(I,{get publishedKey(){return n.get(g)},get fonts(){return n.get(y)}})}var R=n.sibling(I,2);{let y=n.derived(()=>{var p;return(p=n.get(l))==null?void 0:p.keyframes});Ks(R,{get publishedKey(){return n.get(g)},get keyframes(){return n.get(y)}})}var x=n.sibling(R,2);{let y=n.derived(()=>{var p;return(p=n.get(l))==null?void 0:p.themes});Ai(x,{get publishedKey(){return n.get(g)},get themes(){return n.get(y)}})}var $=n.sibling(x,2);{let y=n.derived(()=>{var p;return(p=n.get(l))==null?void 0:p.cssProperties});ai($,{get publishedKey(){return n.get(g)},get cssProperties(){return n.get(y)}})}var ne=n.sibling($,2);{let y=n.derived(()=>{var p;return(p=n.get(l))==null?void 0:p.widgetChrome});ki(ne,{get publishedKey(){return n.get(g)},get widgetChrome(){return n.get(y)}})}var oe=n.sibling(ne,2);{let y=n.derived(()=>{var p;return(p=n.get(l))==null?void 0:p.positionTry});Qs(oe,{get publishedKey(){return n.get(g)},get positionTry(){return n.get(y)}})}var ae=n.sibling(oe,2);{let y=n.derived(()=>{var p;return(p=n.get(l))==null?void 0:p.cssVariables});Ei(ae,{get publishedKey(){return n.get(g)},get variables(){return n.get(y)}})}var ee=n.sibling(ae,2);{let y=n.derived(()=>{var S;return(S=n.get(l))==null?void 0:S.classDefinitions}),p=n.derived(()=>{var S;return(S=n.get(l))==null?void 0:S.classLayer});is(ee,{get publishedKey(){return n.get(g)},get classes(){return n.get(y)},get classLayer(){return n.get(p)}})}var V=n.sibling(ee,2);{var ce=y=>{var p=Yi(),S=n.child(p),P=n.child(S);n.reset(S),n.reset(p),n.template_effect((M,O,N)=>{n.set_style(p,M),n.set_style(S,O),n.set_style(P,N)},[()=>W(Bi),()=>W(Ui),()=>W(Hi)]),n.append(y,p)},ke=y=>{var p=Xi(),S=n.child(p),P=n.sibling(S,2),M=n.child(P,!0);n.reset(P),n.reset(p),n.template_effect((O,N,J)=>{n.set_style(p,O),n.set_style(S,N),n.set_style(P,J),n.set_text(M,n.get(i))},[()=>W(yt),()=>W(ht),()=>W(bt)]),n.append(y,p)},Re=y=>{var p=Ji(),S=n.child(p),P=n.sibling(S,2);n.reset(p),n.template_effect((M,O,N)=>{n.set_style(p,M),n.set_style(S,O),n.set_style(P,N)},[()=>W(yt),()=>W(ht),()=>W(bt)]),n.append(y,p)},xe=y=>{var p=n.comment(),S=n.first_child(p);{var P=O=>{oo(O,{get displayItemList(){return n.get(l).displayItemList},get widgetCollections(){return n.get(l).widgetCollections},get plugins(){return n.get(u)},get componentProps(){return t.componentProps},get mounts(){return t.mounts},get placeholderValues(){return t.placeholderValues}})},M=O=>{ro(O,{get displayItemList(){return n.get(l).displayItemList},isComposeMode:!1,isWithinCollection:!1,get widgetCollections(){return n.get(l).widgetCollections},showDropContainers:!1,reduxDeviceDisplayType:"desktop",get plugins(){return n.get(u)},get componentProps(){return t.componentProps},get mounts(){return t.mounts},get placeholderValues(){return t.placeholderValues}})};n.if(S,O=>{n.get(d)?O(P):O(M,-1)})}n.append(y,p)};n.if(V,y=>{o()!=="pre-fetched"&&n.get(s)?y(ce):o()!=="pre-fetched"&&n.get(i)?y(ke,1):o()!=="pre-fetched"&&!n.get(l)?y(Re,2):n.get(a)&&n.get(l)&&y(xe,3)})}n.reset(v),n.template_effect(()=>n.set_attribute(v,"data-rulecms-published-key",n.get(g))),n.append(e,v),n.pop()}const Po=6e4;class X extends Error{constructor(o,r){super(o);ct(this,"status");this.name="FetchRuleCMSWidgetError",this.status=r}}const Ce=new Map;function Qi(){Ce.clear()}function Ct(e){const t=e==null?void 0:e.cache;return t==="no-store"||t==="reload"||t==="no-cache"}function $i(e,t){const o=Ce.get(e);if(o){if(o.expiresAt<=t){Ce.delete(e);return}return o.data}}async function Do(e){return(await e.json().catch(()=>({error:"Unknown error"}))).error||`Request failed with status ${e.status}`}async function Lo({publishedKey:e,token:t,endpoint:o,fetchOptions:r}){const s=Je({publishedKey:e,token:t,endpoint:o}),i=G(t),l=Date.now();if(!i&&!Ct(r)){const u=$i(s,l);if(u)return u}const a=await fetch(s,{method:"GET",...i?{cache:"no-store"}:{},...r});if(!a.ok)throw new X(await Do(a),a.status);const c=await a.json();if(!c.success)throw new X("Failed to fetch widget data");const d=Le(c.data);return!i&&!Ct(r)&&Ce.set(s,{expiresAt:l+Po,data:d}),d}async function el(e){const{rulesetPublishedKey:t,params:o,fallbackPublishedKey:r,contentType:s,token:i,endpoint:l,fetchOptions:a}=e,c=()=>Lo({publishedKey:r,token:i,endpoint:l,fetchOptions:a});let d;try{d=await fetch(qe({token:i,endpoint:l}),{...Eo({token:i,rulesetPublishedKey:t,params:o,contentType:s}),...a})}catch(g){if(r)return c();throw g}if(!d.ok){if(r&&So(d.status))return c();throw new X(await Do(d),d.status)}const u=To({token:i,rulesetPublishedKey:t,body:await d.json()});if(!u)throw new X("Failed to fetch widget data");return{...Le(u.raw),selection:u.selection}}async function tl(e){const{publishedKey:t,rulesetPublishedKey:o,token:r}=e;if(!t&&!o){const s=G(r);throw o!==void 0?new X(s?"Ruleset key is required":"Ruleset published key is required"):new X(s?"Widget key is required":"Published key is required")}if(!r)throw new X("Token is required");return e.rulesetPublishedKey?el(e):Lo(e)}async function nl(e){const{data:t,libraries:o}=e,r=ve({displayItemList:t.displayItemList,widgetCollections:t.widgetCollections});return ie().resolve({registrations:o,referenced:r})}exports.AlignContentTypes=jo;exports.BreakpointVariantRender=oo;exports.COLLECTION_TYPE_PREFIX=Ye;exports.COMPONENT_PROPS_PATH_SEPARATOR=le;exports.CSS_CLASSES_ATTRIBUTE_NAME=Te;exports.CSS_VARIABLE_NAME_MAX_LENGTH=Bt;exports.CSS_VARIABLE_NAME_PATTERN=Kt;exports.DEFAULT_BASE_Z_INDEX=st;exports.DEFAULT_CLOUDINARY_CLOUD_NAME=Nt;exports.DEFAULT_LIBRARY_ID=te;exports.DEFAULT_PUBLISHED_WIDGET_CACHE_MS=Po;exports.DEFAULT_ROW_GAP=Rn;exports.DEV_CLIENT_TOKEN_PREFIX=vt;exports.DEV_WIDGET_API_PATH=St;exports.DEV_WIDGET_RESOLVE_API_PATH=It;exports.DeviceDisplayTypes=Vo;exports.DisplayComponent=to;exports.DisplayItemTypes=_e;exports.DragItemIdPrefixTypes=Ge;exports.EMBEDDED_KEY_SEPARATOR=Rt;exports.FLEX_LAYOUT_STYLE_KEYS_THAT_DERIVE_DISPLAY=un;exports.FetchRuleCMSWidgetError=X;exports.HIDE_WIDGET_ATTRIBUTE_NAME=nt;exports.JustifyContentTypes=je;exports.POINTER_EVENTS_ATTRIBUTE_NAME=Wn;exports.PUBLISHED_KEY_SEPARATOR=ye;exports.PUBLISHED_WIDGET_API_PATH=wt;exports.PUBLISHED_WIDGET_RESOLVE_API_PATH=Tt;exports.PageViewTypes=Me;exports.RULECMS_ANONYMOUS_ID_STORAGE_KEY=He;exports.RULECMS_API_ORIGIN=At;exports.RULECMS_PUBLISHED_KEY_ATTRIBUTE=Gi;exports.RULECMS_WIDGET_CONTEXT_KEY=$e;exports.RenderComponents=ro;exports.RenderComponentsForDevice=be;exports.RenderComponentsInner=he;exports.RuleCMSWidget=Zi;exports.RuleCMSWidgetProvider=Xo;exports.WIDGET_ATTRIBUTES_IGNORED_IN_COMPOSE_MODE=Mn;exports.WIDGET_CACHE_API_ORIGIN=Et;exports.WIDGET_PLACEHOLDER_VALUES_KEY=Ke;exports.Z_INDEX_WIDGET_ATTRIBUTE_NAME=Vn;exports.alignContentAllowlist=rn;exports.alignItemsAllowlist=nn;exports.backgroundPositionAllowlist=an;exports.backgroundRepeatAllowlist=cn;exports.backgroundSizeAllowlist=ln;exports.borderStyleKeywords=dn;exports.boxSpacingSideKeys=zt;exports.boxSpacingStyleAttributeEntries=pr;exports.buildCloudinaryBackgroundUrl=Ft;exports.buildOverlayLayerBoxStyles=zn;exports.buildOverlayStackStyles=Hn;exports.buildWidgetFetchUrl=Je;exports.buildWidgetResolveUrl=qe;exports.clearPublishedWidgetFetchCache=Qi;exports.collectComponentInstancePaths=Xn;exports.collectReferencedLibraryIds=ve;exports.composeSourceComponentsPlugin=_t;exports.createComponentLibraryRegistry=ie;exports.cssAttrArrayKey=me;exports.defaultPageWidth=Ot;exports.deriveDisplayFlexIfNeeded=Pn;exports.desktopModeWidth=Jo;exports.fetchRuleCMSWidget=tl;exports.findUnmatchedComponentPropsKeys=Jn;exports.flexDirectionAllowlist=sn;exports.flexWrapAllowlist=on;exports.fontFamilyAllowlist=Xt;exports.fontStyleAllowlist=qt;exports.fontWeightAllowlist=Jt;exports.formatBackgroundImageStyles=bn;exports.formatBorderStyles=Cn;exports.formatBoxShadowStyles=_n;exports.formatBoxSpacingStyles=vn;exports.formatCssColorStyles=An;exports.formatCssColorValue=we;exports.formatCssEnumStyles=En;exports.formatCssLengthStyles=wn;exports.formatCssVariable=K;exports.formatCssVariableStyles=ar;exports.formatLineHeightStyles=Sn;exports.formatObjectStyleAttribute=In;exports.formatOpacityStyles=Tn;exports.formatSpacingSideValue=Z;exports.generatePublishedKey=xt;exports.generatePublishedKeyForEmbedded=zo;exports.getCollectionIdForCollectionType=Qe;exports.getColumnAttributes=se;exports.getComponentAttributesAndStyles=Ve;exports.getComponentsPluginFromPlugins=pe;exports.getCssVariableFromLeaf=L;exports.getDefaultDimensionAttributes=Dn;exports.getDeviceTypeBasedAttributes=Y;exports.getDragItemId=Fo;exports.getDragItemPrefixAndId=Pt;exports.getIdAndPrefix=Dt;exports.getMergedAttributes=Ln;exports.getNameAndInstanceIdFromWidgetKey=Ko;exports.getNameFromWidgetKey=Bo;exports.getOrCreateAnonymousId=wo;exports.getOverlayLayerZIndex=Kn;exports.getWidgetKeyForCollection=Lt;exports.getWidgetKeyForCollectionWithPrefix=Uo;exports.getWidgetKeyForPublishedCollection=kt;exports.getWidgetKeyForPublishedCollectionWithPrefix=Ho;exports.hasBoxShadowLeaf=mn;exports.hasDeviceDivergentValues=Zn;exports.hasInvalidCssVariable=H;exports.hasItems=kn;exports.hasOverlayLayers=Fn;exports.incrementVersion=Go;exports.isBackgroundImageValue=Ut;exports.isBorderStyleValue=fn;exports.isBorderValue=gn;exports.isBoxShadowValue=pn;exports.isBoxSpacingValue=Gt;exports.isCloudinaryCloudName=Mt;exports.isCloudinaryPublicId=Wt;exports.isCloudinaryTransformationString=Vt;exports.isCssColorValue=Ee;exports.isCssEnumValue=Yt;exports.isCssVariableName=Q;exports.isDevClientToken=G;exports.isLineHeightValue=yn;exports.isOpacityValue=hn;exports.isOverlayLayerEmptyForDevice=Un;exports.isRowHiddenForDevice=On;exports.isSafeImageUrl=jt;exports.isSpacingSideValue=q;exports.isWidgetHiddenForDevice=Pe;exports.justifyContentAllowlist=tn;exports.normalizeCssClasses=Ie;exports.objectStyleAttributeRegistry=Se;exports.overflowAllowlist=ge;exports.phoneModeWidth=et;exports.pointerEventsAllowlist=en;exports.prepareRuleCMSWidgetData=Le;exports.resolveBaseZIndex=Fe;exports.resolveKey=ze;exports.resolveOverlayLayerPointerEvents=Bn;exports.resolveRowStyles=Nn;exports.resolveWidgetApiOrigin=Xe;exports.resolveWidgetContainerStyles=ot;exports.resolveWidgetInstanceProps=Gn;exports.resolveWidgetLibraries=nl;exports.rowBasedPropertiesAreAssigned=xn;exports.spacingKeywords=Ae;exports.spacingLengthUnits=Ht;exports.stableJsonStringify=Io;exports.tabletModeWidth=tt;exports.textAlignAllowlist=Zt;exports.textDecorationAllowlist=Qt;exports.textTransformAllowlist=$t;exports.toStyleAttr=W;exports.typeHasPrefix=Ze;exports.warnUnmatchedComponentProps=qn;exports.widgetBasedPropertiesAreAssigned=jn;exports.widgetDeclaresOwnHeight=rt;exports.withWidgetPlaceholderValues=Yn;
|