1"use strict";(globalThis.__LOADABLE_LOADED_CHUNKS__=globalThis.__LOADABLE_LOADED_CHUNKS__||[]).push([[5019],{25019:function(e,t,r){r.d(t,{O:function(){return Ar}});var n=r(96540),i=r(5556),o=r.n(i);const a=e=>{const t=e.rendering&&e.rendering.componentName?e.rendering.componentName:"Unnamed Component";!e.errorOverride&&console.log(`Component props for unimplemented '${t}' component`,e);const r=e.errorOverride||"JSS component is missing React implementation. See the developer console for more information.";return n.createElement("div",{style:{background:"darkorange",outline:"5px solid orange",padding:"10px",color:"white",maxWidth:"500px"}},n.createElement("h2",null,t),n.createElement("p",null,r))};a.propTypes={rendering:o().shape({componentName:o().string})},a.displayName="MissingComponent";var s=r(96012);const l={height:"100px",backgroundImage:"linear-gradient(45deg, #ffffff 25%, #dcdcdc 25%, #dcdcdc 50%, #ffffff 50%, #ffffff 75%, #dcdcdc 75%, #dcdcdc 100%)",backgroundSize:"3px 3px"},c=()=>n.createElement("div",{style:l});function d(e){return u(e).replace(/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g,(function(e){return"-"+e.toLowerCase()}))}function u(e){return(e=(e=e.replace(/[-_ ]+/g," ")).charAt(0).toLowerCase()+e.slice(1)).split(/\s+/).map(((e,t)=>0===t?e:e.charAt(0).toUpperCase()+e.slice(1))).join("")}var p=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};var h={},m=e=>{var{properties:t}=e,r=p(e,["properties"]);return Object.assign(Object.assign({},r),{type:"object",properties:{name:{type:"string"},displayName:{type:"string"},id:{type:"string"},url:{type:"string"},fields:f(t)}})};function f(e={}){return{type:"object",properties:Object.keys(e).reduce(((t,r)=>{let n=e[r],{title:i}=n;p(n,["title"]);return Object.assign(Object.assign({},t),{[r]:{type:"object",properties:{value:Object.assign({title:i||r},e[r])}}})}),{})}}var g={Link:()=>({type:"object",properties:{href:{required:!0,type:"string",title:"URL",description:"The URL of the link, except for media items, for which the Url property contains the path to the media item relative to /Sitecore/Media Library."},text:{type:"string",title:"Text",description:"The text content of the HTML <a> element."},linktype:{type:"string",enum:["internal","external","media","anchor","mailto","javascript"],default:"internal",title:"Target",description:"The target attribute of the HTML <a> element."},title:{type:"string",title:"Title",description:"The title attribute of the HTML <a> element."},class:{type:"string",title:"Class Name",description:"The class attribute of the HTML <a> element."},target:{type:"string",title:"Target",description:"The target attribute of the HTML <a> element.",enum:["","_blank","_self","_parent","_top"]},anchor:{type:"string",title:"Anchor",description:"The name attribute of the HTML <a> element, without the leading hash character (â#â)."},querystring:{type:"string",title:"Query String",description:"Query string parameters to add to the URL."}}}),DropLink:m,DropTree:m,File:()=>({type:"object",properties:{src:{type:"string",title:"Source",description:"The URL of the file."},title:{type:"string",title:"Title",description:"Title of a file"},displayName:{type:"string",title:"Display name",description:"Display name of a file"}}}),Date:()=>({type:"string",format:"date"}),Datetime:()=>({type:"string",format:"date-time"}),RichText:()=>({type:"string"}),Image:e=>({type:"object",properties:Object.assign({src:{type:"string"}},e.properties)}),SingleLineText:()=>{},MultiLineText:()=>({type:"string"}),Checkbox:()=>({type:"boolean"}),String:()=>({type:"string"}),Number:()=>({type:"number"}),Boolean:()=>({type:"boolean"}),Item:m,List:e=>{var{properties:t}=e,r=p(e,["properties"]);return Object.assign(Object.assign({},r),{type:"array",items:{type:"object",properties:{name:{type:"string"},displayName:{type:"string"},id:{type:"string"},url:{type:"string"},fields:f(t)}}})}};function b(e,t){var r={};for(var n in e){let i=e[n];i&&"object"==typeof i?Array.isArray(i)?r[n]=i.map((e=>"object"==typeof e&&e?b(e,t):e)):r[n]=b(t(i),t):r[n]=e[n]}return r}function v(e,t={}){return b(e=y(Object.assign({type:"object",properties:{},required:[]},e)),(e=>e.properties?y(e,t):e))}function y(e,t={}){var r;let n=Object.assign({},e);return n.properties&&(n.required=(null===(r=e.required)||void 0===r?void 0:r.slice())||[],n.properties=Object.keys(n.properties).reduce(((e,r)=>{var i;let o=n.properties[r],a=null===(i=h[null==o?void 0:o.type])||void 0===i?void 0:i.call(h,o),s=Object.assign(Object.assign(Object.assign({},a),o),{type:(null==a?void 0:a.type)||o.type,default:t.hasOwnProperty(r)?t[r]:o.default,title:o.title||d(r).split("-").map((e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())).join(" ")});return(null!=o&&o.properties||null!=a&&a.properties)&&(s.properties=Object.assign({},(null==a?void 0:a.properties)||(null==o?void 0:o.properties)),Object.keys((null==a?void 0:a.properties)||{}
1).forEach((e=>{var t,r;s.properties[e]=Object.assign(Object.assign({},null===(t=null==a?void 0:a.properties)||void 0===t?void 0:t[e]),null===(r=null==o?void 0:o.properties)||void 0===r?void 0:r[e])}))),(null!=o&&o.items||null!=a&&a.items)&&(s.items=(null==a?void 0:a.items)||(null==o?void 0:o.items)),void 0===s.default&&delete s.default,"required"in s&&"boolean"==typeof s.required&&(-1==n.required.indexOf(r)&&n.required.push(r),delete s.required),Object.assign(e,{[r]:s})}),{})),Object.assign({type:"object"},n)}Object.keys(g).forEach((e=>{!function(e,{name:t}){if(t.charAt(0)!=t.charAt(0).toUpperCase())throw new Error("Custom types must start with a capital letter");h[t]=e}(g[e],{name:e})}));var w=(e,t)=>{var r,n,i,o;let a=Object.assign({},e);for(var s in t)"object"!=typeof t[s]||!t[s]||(("integer"==(null===(r=t[s])||void 0===r?void 0:r.type)||"number"==(null===(n=t[s])||void 0===n?void 0:n.type))&&(a[s]=Object.assign(Object.assign({},a[s]),{"ui:options":{widget:"updown"}})),!(null===(i=t[s])||void 0===i)&&i.ui&&(a[s]=Object.assign(Object.assign({},a[s]),{"ui:options":Object.assign(Object.assign({},null===(o=a[s])||void 0===o?void 0:o["ui:options"]),t[s].ui)})),a=Object.assign(Object.assign({},a),{[s]:t[s].items?{items:w(a[s],t[s].items.properties)}:w(a[s],t[s].properties||{})}));return a};function E(e,t){switch(t){case"string":return e;case"object":try{return"object"==typeof e&&null!=e?e:JSON.parse(e)}catch(r){return null}case"array":try{return Array.isArray(e)?e:JSON.parse(e)}catch(r){return null}case"number":return parseFloat(e);case"integer":return parseInt(e);case"boolean":return"true"==e||"1"==e;default:return e}}function A(e,t){return Object.assign(Object.assign({},function(e){return Object.keys(e.properties).reduce(((t,r)=>{var n,i;return null!=(null===(n=e.properties[r])||void 0===n?void 0:n.default)?Object.assign(Object.assign({},t),{[r]:null===(i=e.properties[r])||void 0===i?void 0:i.default}):t}),{})}(e)),function(e,t){return Object.keys(t).reduce(((r,n)=>{let i=t[n],o=u(n),a=null==e?void 0:e.properties[o],s=E(i,null==a?void 0:a.type);return null==s||n.startsWith("data-attribute")||["class","id","contenteditable"].includes(n)?r:Object.assign(Object.assign({},r),{[o]:s})}),{})}(e,t))}var C,O="undefined"!=typeof window?window.BYOCDatasources||(window.BYOCDatasources={}):{};function S(e,t){if("function"!=typeof e)throw new Error("The first argument of registerDatasource must be a function returning DataSettings or Promise of data");if(!t.id)throw new Error("Missing 'id' property in input");if(!/^[a-zA-Z0-9-_]+$/.test(t.id))throw new Error("Invalid 'id' property in input. 'id' should only contain alphanumeric characters, hyphens, and underscores.");O[t.id]=Object.assign(Object.assign({},function(e){let{id:t,name:r,title:n,properties:i,sample:o,schema:a,description:s=null,type:l="object"}=e;return{id:t,description:s,sample:o,name:r||n||t,handler:e=>e,schema:a||i?v(Object.assign(Object.assign({},a||{properties:i,type:l}),{title:(null==a?void 0:a.title)||n||r})):void 0}}(t)),{handler:e}),j()}function j(){clearTimeout(C),C=setTimeout((()=>{var e;"undefined"!=typeof window&&window.parent!==window&&(null===(e=window.parent)||void 0===e||e.postMessage(JSON.stringify({action:"register-datasources",data:Object.values(O)}),"*"))}),30)}function x(e,t){let r=O[e];return null!=r&&r.handler?r.handler(t):t}j();var k=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};var R,N="undefined"!=typeof HTMLElement?HTMLElement:"undefined"!=typeof windowJSDOM?windowJSDOM.HTMLElement:class{setAttribute(){}},F="undefined"!=typeof window?window.BYOCComponents||(window.BYOCComponents={}):{};function D(e,t,r={}){if(null==t||!t.name)throw new Error("Could not register external component. Please make sure you provide a name in the options"+JSON.stringify(t));let n=function(e,t,r){let{thumbnail:n="https://feaasstatic.blob.core.windows.net/assets/thumbnails/byoc.svg",name:i,id:o=e.name,group:a=null,ui:s,isHidden:l=!1,datasourceIds:c=[],links:d={},meta:u={},uiSchema:p,schema:h}=e,m=k(e,["thumbnail","name","id","group","ui","isHidden","datasourceIds","links","meta","uiSchema","schema"]),f=h||m||{},g=p||s||{},b=v(Object.assign(Object.assign({description:"External component"},f),{type:"object"}),r);return{component:t||(()=>null),name:i,schema:b,uiSchema:w(g,b.properties||{}),thumbnail:n,group:a||"Default collection",isHidden:l,id:o,datasourceIds:c,links:d,meta:u,title:(null==b?void 0:b.title)||(null==m?void 0:m.title)||i}}(t,e,r);F[n.id]=n,P(e)&&$.register("byoc-"+d(t.name),void 0,e),M()}function P(e){return e&&"prototype"in e&&"setAttribute"in e.prototype}function T(e){if("string"!=typeof e){if(e&&"schema"in e)return e;throw new Error("Component name should be a string, got "+typeof e)}let[t,r]=e.split("?");var n=F[t];if(r){let t=F[e];if(!t&&!n)return null;t&&(n=Object.assign(Object.assign(Object.assign({},n),t),{component:t.component||(null==n?void 0:n.component)})),r.split(/\&/g).forEach((e=>{var t,r,i;let[o,a]=e.split("="),s=(null===(t=n.schema.properties)||void 0===t?void 0:t[o])||{type:"string"};n=Object.assign(Object.assign({},n),{schema:Object.assign(Object.assign({},n.schema),{properties:Object.assign(Object.assign({},n.schema.properties),{[o]:Object.assign(Object.assign({},s),{default:E(decodeURIComponent(a),s.type)})})}),uiSchema:Object.assign(Object.assign({},n.uiSchema),{[o]:Object.assign(Object.assign({},n.uiSchema[o]),{"ui:widget":null!==(i=null===(r=n.uiSchema[o])||void 0===r?void 0:r["ui:widget"])&&void 0!==i?i:"hidden"})})})}))}return n}
1function L(e){let{componentName:t,className:r,fallbackWrapper:n,fallback:i,suppressHydrationWarning:o,_dynamic:a,datasources:s}=e,l=k(e,["componentName","className","fallbackWrapper","fallback","suppressHydrationWarning","_dynamic","datasources"]);try{var c="string"==typeof s?JSON.parse(s):s}catch(m){}let u=Object.values(c||{}).find((e=>e&&!Array.isArray(e)&&Object.keys(e).length>0)),p=Object.assign(Object.assign(Object.assign({},u),function(e,t={}){var r;let n=null===(r=T(e))||void 0===r?void 0:r.schema;return n?A(n,t):t}(t,Object.assign(Object.assign({},u),l))),c?{datasources:c}:{}),h=Object.assign(Object.assign({"data-external-id":t},((e={})=>Object.keys(e).reduce(((t,r)=>Object.assign(t,{[d(r)]:e[r]})),{}))(p)),{suppressHydrationWarning:!0,class:r});return I.forEach((e=>{Object.assign(h,{[d(e)]:_[e]})})),Object.keys(h).forEach((e=>{let t=h[e];if(t&&"object"==typeof t&&"class"!=e&&"children"!=e)try{Object.assign(h,{[e]:JSON.stringify(t)})}catch(r){delete h[e]}("function"==typeof t||null==t)&&delete h[e]})),{attributes:h,properties:p,merged:Object.assign(Object.assign({},_),p)}}function M(){clearTimeout(R),R=setTimeout((()=>{var e;"undefined"!=typeof window&&window.parent!==window&&(null===(e=window.parent)||void 0===e||e.postMessage(JSON.stringify({action:"register-components",data:Object.values(F)}),"*"))}),30)}M();var $=class extends N{connectedCallback(){try{JSON.parse(String(this.getAttribute("components"))).forEach((e=>{T(e.id)||D(null,e)})),JSON.parse(String(this.getAttribute("datasources"))).forEach((e=>{var t;t=e.id,O[t]||S((e=>e),e)}))}catch(e){}}static register(e,t,r=this){null==t&&(t="undefined"!=typeof window?window:void 0),t&&!t.customElements.get(e)&&t.customElements.define(e,class extends r{})}},_={};var I=["sitecoreEdgeUrl","sitecoreEdgeContextId"];$.register("byoc-registration");var B=null,U=null;function H(e){var t;let{componentName:r,clientFallback:i}=e,o=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(e,["componentName","clientFallback"]),a=null===(t=T(r))||void 0===t?void 0:t.component,s=n.useMemo((()=>n.createElement(q,Object.assign({},o,{componentName:r}))),[]),l=n.useMemo((()=>U((()=>Promise.resolve(B)),{ssr:!1,loading:()=>s})),[]);var c="undefined"==typeof window?JSON.parse(JSON.stringify(o)):o;return n.createElement(l,Object.assign({},c,{componentName:r,fallbackWrapper:!a,fallback:a?s:i?n.createElement(U((()=>Promise.resolve((()=>i))),{ssr:!1})):e.fallback}))}function W(e){return 0==Object.keys(e).length?n.createElement(n.Fragment,null):U&&!e._dynamic?H(Object.assign({_dynamic:!0},e)):q(e)}function q(e){let{componentName:t,fallback:r,fallbackWrapper:i}=e,o=T(t),a=null==o?void 0:o.component,{attributes:s,properties:l,merged:c}=L(e);if(!a&&r||!t)return!1===i?n.createElement(n.Fragment,null,r):n.createElement("feaas-external",Object.assign({},s,{hydrate:"false"}),r);if(o&&a&&P(a)){let e="byoc-"+d(o.id);return n.createElement(e,Object.assign(Object.assign({},s),{ref:t=>{var r;t&&"undefined"!=typeof window&&(null===(r=window.customElements)||void 0===r||r.whenDefined(e).then((()=>{var e;null===(e=t.sitecoreContextCallback)||void 0===e||e.call(t,Object.assign({},c))})))}}))}return n.createElement(n.Fragment,null,n.createElement("feaas-external",Object.assign({},s,{hydrate:"false"}),null==a?null:n.createElement(a,Object.assign({},c))))}var J=r(40961),z=Object.defineProperty,V=(e,t)=>{for(var r in t)z(e,r,{get:t[r],enumerable:!0})},Y={};V(Y,{renderDOMContent:()=>Be,renderDOMElement:()=>_e,renderHTMLContent:()=>Ue,setDOMAttribute:()=>Me});var K={};function G(e){return(G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function X(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Q(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Z(e,t,r){return t&&Q(e.prototype,t),r&&Q(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ee(e){return(ee=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function te(e,t){return(te=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function re(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}function ne(e,t,r){return ne=re()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&te(i,r.prototype),i},ne.apply(null,arguments)}function ie(e){var t="function"==typeof Map?new Map:void 0;return ie=function(e){if(null===e||!function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return ne(e,arguments,ee(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),te(r,e)},ie(e)}function oe(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ae(e){return function(e){if(Array.isArray(e))return le(e)}(e)||function(e){if(typeof Symbol<"u"&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||se(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function se(e,t){if(e){if("string"==typeof e)return le(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return le(e,t)}}function le(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}V(K,{JSONPath:()=>he,queryObject:()=>ge,queryObjectRaw:()=>fe,queryScopes:()=>be,serializeCH1RichText:()=>ye});var ce=Object.prototype.hasOwnProperty;function de(e,t){return(e=e.slice()).push(t),e}function ue(e,t){return(t=t.slice()).unshift(e),t}var pe=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&te(e,t)}(r,e);var t=function(e){var t=re();return function(){var r,n=ee(e);
1if(t){var i=ee(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return oe(this,r)}}(r);function r(e){var n;return X(this,r),(n=t.call(this,'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)')).avoidNew=!0,n.value=e,n.name="NewError",n}return Z(r)}(ie(Error));function he(e,t,r,n,i){if(!(this instanceof he))try{return new he(e,t,r,n,i)}catch(l){if(!l.avoidNew)throw l;return l.value}"string"==typeof e&&(i=n,n=r,r=t,t=e,e=null);var o=e&&"object"===G(e);if(e=e||{},this.json=e.json||r,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=!ce.call(e,"wrap")||e.wrap,this.sandbox=e.sandbox||{},this.preventEval=e.preventEval||!1,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||n||null,this.otherTypeCallback=e.otherTypeCallback||i||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},!1!==e.autostart){var a={path:o?e.path:t};o?"json"in e&&(a.json=e.json):a.json=r;var s=this.evaluate(a);if(!s||"object"!==G(s))throw new pe(s);return s}}he.prototype.evaluate=function(e,t,r,n){var i=this,o=this.parent,a=this.parentProperty,s=this.flatten,l=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,t=t||this.json,(e=e||this.path)&&"object"===G(e)&&!Array.isArray(e)){if(!e.path&&""!==e.path)throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!ce.call(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');t=e.json,s=ce.call(e,"flatten")?e.flatten:s,this.currResultType=ce.call(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=ce.call(e,"sandbox")?e.sandbox:this.currSandbox,l=ce.call(e,"wrap")?e.wrap:l,this.currPreventEval=ce.call(e,"preventEval")?e.preventEval:this.currPreventEval,r=ce.call(e,"callback")?e.callback:r,this.currOtherTypeCallback=ce.call(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,o=ce.call(e,"parent")?e.parent:o,a=ce.call(e,"parentProperty")?e.parentProperty:a,e=e.path}if(o=o||null,a=a||null,Array.isArray(e)&&(e=he.toPathString(e)),(e||""===e)&&t){var c=he.toPathArray(e);"$"===c[0]&&c.length>1&&c.shift(),this._hasParentSelector=null;var d=this._trace(c,t,["$"],o,a,r).filter((function(e){return e&&!e.isParentSelector}));return d.length?l||1!==d.length||d[0].hasArrExpr?d.reduce((function(e,t){var r=i._getPreferredOutput(t);return s&&Array.isArray(r)?e=e.concat(r):e.push(r),e}),[]):this._getPreferredOutput(d[0]):l?[]:void 0}},he.prototype._getPreferredOutput=function(e){var t=this.currResultType;switch(t){case"all":var r=Array.isArray(e.path)?e.path:he.toPathArray(e.path);
1return e.pointer=he.toPointer(r),e.path="string"==typeof e.path?e.path:he.toPathString(e.path),e;case"value":case"parent":case"parentProperty":return e[t];case"path":return he.toPathString(e[t]);case"pointer":return he.toPointer(e.path);default:throw new TypeError("Unknown result type")}},he.prototype._handleCallback=function(e,t,r){if(t){var n=this._getPreferredOutput(e);e.path="string"==typeof e.path?e.path:he.toPathString(e.path),t(n,r,e)}},he.prototype._trace=function(e,t,r,n,i,o,a,s){var l,c=this;if(!e.length)return l={path:r,value:t,parent:n,parentProperty:i,hasArrExpr:a},this._handleCallback(l,o,"value"),l;var u=e[0],p=e.slice(1),h=[];function m(e){Array.isArray(e)?e.forEach((function(e){h.push(e)})):h.push(e)}if(("string"!=typeof u||s)&&t&&ce.call(t,u))m(this._trace(p,t[u],de(r,u),t,u,o,a));else if("*"===u)this._walk(t,(function(e){m(c._trace(p,t[e],de(r,e),t,e,o,!0,!0))}));else if(".."===u)m(this._trace(p,t,r,n,i,o,a)),this._walk(t,(function(n){"object"===G(t[n])&&m(c._trace(e.slice(),t[n],de(r,n),t,n,o,!0))}));else{if("^"===u)return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:p,isParentSelector:!0};if("~"===u)return l={path:de(r,u),value:i,parent:n,parentProperty:null},this._handleCallback(l,o,"property"),l;if("$"===u)m(this._trace(p,t,r,null,null,o,a));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(u))m(this._slice(u,p,t,r,n,i,o));else if(0===u.indexOf("?(")){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");var f=u.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1");this._walk(t,(function(e){c._eval(f,t[e],e,r,n,i)&&m(c._trace(p,t[e],de(r,e),t,e,o,!0))}))}else if("("===u[0]){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");m(this._trace(ue(this._eval(u,t,r[r.length-1],r.slice(0,-1),n,i),p),t,r,n,i,o,a))}else if("@"===u[0]){var g=!1,b=u.slice(1,-2);switch(b){case"scalar":(!t||!["object","function"].includes(G(t)))&&(g=!0);break;case"boolean":case"string":case"undefined":case"function":G(t)===b&&(g=!0);break;case"integer":Number.isFinite(t)&&!(t%1)&&(g=!0);break;case"number":Number.isFinite(t)&&(g=!0);break;case"nonFinite":"number"==typeof t&&!Number.isFinite(t)&&(g=!0);break;case"object":t&&G(t)===b&&(g=!0);break;case"array":Array.isArray(t)&&(g=!0);break;case"other":g=this.currOtherTypeCallback(t,r,n,i);break;case"null":null===t&&(g=!0);break;default:throw new TypeError("Unknown value type "+b)}if(g)return l={path:r,value:t,parent:n,parentProperty:i},this._handleCallback(l,o,"value"),l}else if("`"===u[0]&&t&&ce.call(t,u.slice(1))){var v=u.slice(1);m(this._trace(p,t[v],de(r,v),t,v,o,a,!0))}else if(u.includes(",")){var y,w=function(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=se(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{!a&&null!=r.return&&r.return()}finally{if(s)throw o}}}}(u.split(","));try{for(w.s();!(y=w.n()).done;){var E=y.value;m(this._trace(ue(E,p),t,r,n,i,o,!0))}}catch(d){w.e(d)}finally{w.f()}}else!s&&t&&ce.call(t,u)&&m(this._trace(p,t[u],de(r,u),t,u,o,a,!0))}if(this._hasParentSelector)for(var A=0;A<h.length;A++){var C=h[A];if(C&&C.isParentSelector){var O=this._trace(C.expr,t,C.path,n,i,o,a);if(Array.isArray(O)){h[A]=O[0];for(var S=O.length,j=1;j<S;j++)A++,h.splice(A,0,O[j])}else h[A]=O}}return h},he.prototype._walk=function(e,t){if(Array.isArray(e))for(var r=e.length,n=0;n<r;n++)t(n);else e&&"object"===G(e)&&Object.keys(e).forEach((function(e){t(e)}))},he.prototype._slice=function(e,t,r,n,i,o,a){if(Array.isArray(r)){var s=r.length,l=e.split(":"),c=l[2]&&Number.parseInt(l[2])||1,d=l[0]&&Number.parseInt(l[0])||0,u=l[1]&&Number.parseInt(l[1])||s;d=d<0?Math.max(0,d+s):Math.min(s,d),u=u<0?Math.max(0,u+s):Math.min(s,u);for(var p=[],h=d;h<u;
1h+=c){this._trace(ue(h,t),r,n,i,o,a,!0).forEach((function(e){p.push(e)}))}return p}},he.prototype._eval=function(e,t,r,n,i,o){this.currSandbox._$_parentProperty=o,this.currSandbox._$_parent=i,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;var a=e.includes("@path");a&&(this.currSandbox._$_path=he.toPathString(n.concat([r])));var s="script:"+e;if(!he.cache[s]){var l=e.replace(/@parentProperty/g,"_$_parentProperty").replace(/@parent/g,"_$_parent").replace(/@property/g,"_$_property").replace(/@root/g,"_$_root").replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1");a&&(l=l.replace(/@path/g,"_$_path")),he.cache[s]=new this.vm.Script(l)}try{return he.cache[s].runInNewContext(this.currSandbox)}catch(c){throw new Error("jsonPath: "+c.message+": "+e)}},he.cache={},he.toPathString=function(e){for(var t=e,r=t.length,n="$",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[i])||(n+=/^[\*0-9]+$/.test(t[i])?"["+t[i]+"]":"['"+t[i]+"']");return n},he.toPointer=function(e){for(var t=e,r=t.length,n="",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[i])||(n+="/"+t[i].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n},he.toPathArray=function(e){var t=he.cache;if(t[e])return t[e].concat();var r=[],n=e.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,(function(e,t){return"[#"+(r.push(t)-1)+"]"})).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,(function(e,t){return"['"+t.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"})).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,(function(e,t){return";"+t.split("").join(";")+";"})).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),i=n.split(";").map((function(e){var t=e.match(/#([0-9]+)/);return t&&t[1]?r[t[1]]:e}));return t[e]=i,t[e].concat()};var me=function(){function e(t){X(this,e),this.code=t}return Z(e,[{key:"runInNewContext",value:function(e){var t=this.code,r=Object.keys(e),n=[];!function(e,t,r){for(var n=e.length,i=0;i<n;i++)r(e[i])&&t.push(e.splice(i--,1)[0])}(r,n,(function(t){return"function"==typeof e[t]}));var i=r.map((function(t,r){return e[t]})),o=n.reduce((function(t,r){var n=e[r].toString();return/function/.test(n)||(n="function "+n),"var "+r+"="+n+";"+t}),"");!/(["'])use strict\1/.test(t=o+t)&&!r.includes("arguments")&&(t="var arguments = undefined;"+t);var a=(t=t.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"")).lastIndexOf(";"),s=a>-1?t.slice(0,a+1)+" return "+t.slice(a+1):" return "+t;return ne(Function,r.concat([s])).apply(void 0,ae(i))}}]),e}();function fe(e,t){try{return he({path:t,json:e})}catch(r){return[]}}function ge(e,t,r=!0){let n=fe(e,t)||[];return r?n.flat(1/0):n}function be(e,t,r=!1,n=e,i=!0){var o=t;let a=Object.keys(e).sort(((e,t)=>t.length-e.length));for(let l of a)if(t.startsWith(l)){if(l==t){if(r)return e[l];continue}o=t.substring(l.length+1),n=e[l];break}var s=ge(n,o,i);return 0==s.length&&(s=[o.replace(/^.*?\./,"_."),o.replace(/^.*?\./,""),o.replace(/^([^.]+).*?\.\$([\.\[])/,"$1$2"),o.replace(/^.*?\.\$([\.\[])/,"_$1"),o.replace(/^.*?\.\$([\.\[])/,"$$$1"),o.replace(/^[^.]+$/,"_")].filter(((e,t,r)=>r.indexOf(e)===t)).reduce(((e,t)=>e.length>0?e:ge(n,t,i)),[])),r?s[0]:s}function ve(e,t={},r){return r?`<${r}${Object.entries(t).map((([e,t])=>null!=t&&` ${e}="${t}"`)).filter(Boolean).join("")}>${ye(e)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):ye(e)}function ye(e){var t;if(Array.isArray(e))return e.map(ye).join("\n").trim();if("string"==typeof e)return e;if(null==e)return"";switch(e.type){case"heading":let{level:r,...n}=e.attrs;return ve(e.content,n,"h"+r);case"text":return(e.marks||[]).reduce(((e,t)=>ve(e,t.attrs,{link:"a",bold:"strong",italic:"em",strike:"s",underline:"u"}[t.type])),null===(t=e.text)||void 0===t?void 0:t.replace(/\s+/," "));default:return ve(e.content||e.text,e.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[e.type])}}function we(e){let t=new e.ownerDocument.defaultView.MutationObserver((e=>{e.forEach((e=>{let t=e.target,r=t.getAttribute("data-embed-src");
1r&&Ae(t,r),e.addedNodes&&e.addedNodes.forEach((e=>{1==e.nodeType&&Ee(e,!1)}))}))}));return t.observe(e,{attributes:!0,subtree:!0,childList:!0}),t}function Ee(e,t=!0){let r=e.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let e=r[n];Ae(e,e.getAttribute("data-embed-src"))}if(t)return we(e)}function Ae(e,t){for(var r=e;r;r=r.parentElement)if(!r.parentElement){let e=r.querySelectorAll("script");for(var n=0;n<e.length;n++)if(e[n].getAttribute("src")==t)return!0;"HTML"==r.tagName&&(r=r.querySelector("head")||r);let i=r.ownerDocument.createElement("script");i.setAttribute("type","module"),i.setAttribute("src",t),r.appendChild(i);break}}he.prototype.vm={Script:me};var Ce={};V(Ce,{adjustNumbers:()=>Re,cleanCollectionBit:()=>xe,getHumanizedLabel:()=>Ne,getLastPathBit:()=>Fe,getQualifier:()=>je,normalizeCollectionScope:()=>ke,parseLimit:()=>Oe,parseRange:()=>Se});var Oe=e=>{var t;let r=parseInt(null===(t=null==e?void 0:e.match(/\[0:(\d+)\]/))||void 0===t?void 0:t[1],10);return!isNaN(r)&&r>0?String(r):null},Se=e=>{var t;let r=null===(t=null==e?void 0:e.match(/\[([^\]]+)\]/))||void 0===t?void 0:t[1].split(/\s*,\s*/g).filter(Boolean).map((e=>{if(e.match(/^-?\d+$/))return e;let t=e.match(/^(\d+):(\d+)$/);return t&&parseInt(t[1],10)<parseInt(t[2],10)?t[1]+"-"+t[2]:null}));return null!=r&&r.every(Boolean)?r.join(","):null},je=e=>{var t;return null===(t=null==e?void 0:e.match(/(\.\*|\[[^\]]*\])$/))||void 0===t?void 0:t[0]};function xe(e){return e.replace(/(\.?\[[^\]\[]*\]|\.\*)$/g,"")}function ke(e){return xe(e)+".*"}function Re(e,t){return null==e?void 0:e.replace(/(.|^)(\d+)/g,((e,r,n)=>r+(":"==r?n:String(parseInt(n)+t))))}function Ne(e,t=2){var r=xe(e).split(/]\.|\.\*\./g).pop().split(/\./g).slice(-3);return(r=r.filter((e=>isNaN(parseInt(e))))).map((e=>e.charAt(0).toUpperCase()+e.slice(1))).slice(-t).join(" ")}function Fe(e){return xe(e).split(".").pop()}var De=["January","February","March","April","May","June","July","August","September","October","November","December"],Pe=e=>{if(!e||"function"!=typeof e.getDay)return;let t=e.getFullYear();return`${De[e.getMonth()]} ${e.getDate()}, ${t}`},Te=function(e){return"Invalid Date"!==String(new Date(e))&&!isNaN(Number(new Date(e)))};function Le(e){let t=e.getAttribute("data-path-scope");for(var r=0,n=e;n=n.previousElementSibling;)n.getAttribute("data-path-scope")==t&&r++;return r}function Me(e,t,r,n){var i,o,a;if(e){var s=e;"doc"==(null==r?void 0:r.type)&&Array.isArray(r.content)&&(r=ye(r)),null!=n&&n.processValue&&(r=null==n?void 0:n.processValue(e,t,r));var l=t.replace("data-path-","");if("data-path-src"==t||"data-path-alt"==t){let t=Array.from(e.children).find((e=>"picture"==e.localName))||e;s="img"==e.localName?e:t.querySelector("img, video")}else if("data-path-href"==t)s=e.querySelector("a")||e.closest("a");else if("data-path-hidden"==t)r=!r||null;else if("data-path"==t||"data-embed-html"==t||"html"==t)l="innerHTML";else if("data-embed-src"==t)Ae(e,r);else if("data-path-attributes"==t){if(!Array.isArray(r)){let t=(null===(i=e.getAttribute("data-attributes-keys"))||void 0===i?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var c in r){var d=r[c];Me(e,c,"object"==typeof d&&d?JSON.stringify(d):d,n)}for(var u=0;u<t.length;u++)(null==r||!(t[u]in r))&&Me(e,t[u],null,n);Me(e,"data-attributes-keys",Object.keys(r||{}).join(","))}if("FEAAS-EXTERNAL"==e.tagName){let t=String(e.getAttribute("data-path-attributes")||"").slice(0,-1).split(".")[0]||"_";Me(e,"datasources",JSON.stringify({[t]:r}))}return}if("boolean"==typeof r&&(r=r?"":null),s)if("innerHTML"!=l&&"src"!=l||null!=r&&""!==r)if(null!=r)if("innerHTML"==l){for(var p=String(r),h=s;h.parentElement&&h.localName.match(/^(a|var|strong|em|i|b)$/);)h=h.parentElement;h.localName.match(/p|h\d|button|time|li/)&&(p=p.replace(/<(p|h\d|li|ul)[^>]*?>|<\/(p|h\d|li|ul)[^>]*?>/g," ").trim().replace(/\s+/g," ")),String(h.getAttribute("class")).includes("-inline--time")&&Te(p)&&(p=Pe(new Date(p))),s.innerHTML!=p&&(s.innerHTML=p)}else s.getAttribute(l)!=r&&s.setAttribute(l,r);else s.removeAttribute(l);else{var m=String(null!==(a=null!==(o=e.getAttribute("data-path-placeholder")||s[l])&&void 0!==o?o:s.getAttribute(l))&&void 0!==a?a:"");"innerHTML"==l?s.innerHTML=m:m?s.setAttribute(l,m):s.removeAttribute(l)}}}
1var $e=["data-attributes-keys","data-path-attributes","data-path-scope"];function _e(e,t,r,n){var i,o,a;let s=e;if(n||(t=(null===(i=null==r?void 0:r.processData)||void 0===i?void 0:i.call(r,s,t))||t),1==s.nodeType){let e=s.getAttribute("data-path-scope");if(e){let n=Le(s),i=be(t,e,!1);0==n&&function(e,t){let r=e.getAttribute("data-path-scope");if(null==r)return;var n=Le(e);if(0!=n)return;let i=e.parentNode;if(null!=i){0==t?e.setAttribute("hidden","hidden"):null!=e.getAttribute("hidden")&&e.removeAttribute("hidden");for(var o=n+1,a=e,s=e;s=s.nextElementSibling;)s.getAttribute("data-path-scope")==r&&(o++,a=s);for(var l=o;l<t;l++)i.insertBefore(a.cloneNode(!0),a.nextElementSibling);for(l=Math.max(1,t);l<o;l++)a=a.previousElementSibling,i.removeChild(a.nextElementSibling)}}(s,!1===(null===(o=null==r?void 0:r.shouldRepeat)||void 0===o?void 0:o.call(r,s,i))?1:i.length),t={...t,[ke(e)]:i[n]}}let n=Array.prototype.slice.call(s.attributes).sort(((e,t)=>$e.indexOf(e.name)-$e.indexOf(t.name)));for(var l=0;l<n.length;l++){let{name:e,value:i}=n[l];e.startsWith("data-path")&&"data-path-scope"!=e&&Me(s,e,be(t,i,!0,void 0,"FEAAS-EXTERNAL"!=s.tagName),r),"data-embed-src"==e&&Me(s,e,s.getAttribute(e),r)}}var c;for(l=0;c=s.childNodes[l++];)Ie(c)&&_e(c,t,r,!0);return n||null===(a=null==r?void 0:r.onRender)||void 0===a||a.call(r,s,t),s}function Ie(e){return 1==e.nodeType}function Be(e,t,r,n){var i;let o=(null===(i=null==n?void 0:n.processTemplate)||void 0===i?void 0:i.call(n,e,t,r))||t;if(e.innerHTML=o,e.classList.add("-feaas"),(e.closest(".component.feaas")||e).className.includes("-theme--"))for(var a,s=0;a=e.childNodes[s++];)Ie(a)&&(a.className=a.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return _e(e,r,n)}function Ue(e,t,r,n=!1){var i;let o=(null===(i=null==r?void 0:r.processTemplate)||void 0===i?void 0:i.call(r,null,e,t))||e;if("undefined"==typeof document||n){return _e(qe(o)[0],t,r).outerHTML}{let e=document.createElement("div");return e.innerHTML=o,_e(e,t,r),e.innerHTML}}var He=class{constructor(e,t=1,r){this.ownerDocument={createElement(e){return new He(e)},createDocumentFragment(){return new He(null,11)}},this.nodeName=e,this.nodeType=t,this.textContent=r,this.attributes=[],this.childNodes=[]}setAttribute(e,t){let r=this.attributes.find((t=>t.name===e));r?r.value=t:this.attributes.push({name:e,value:t})}getAttribute(e){let t=this.attributes.find((t=>t.name===e));return t?t.value:void 0}insertBefore(e,t){if(e.parentNode=this,null===t)this.childNodes.push(e);else{let r=this.childNodes.indexOf(t);-1!==r&&this.childNodes.splice(r,0,e)}}removeAttribute(e){let t=this.attributes.findIndex((t=>t.name===e));-1!==t&&this.attributes.splice(t,1)}appendChild(e){e.parentNode=this,this.childNodes.push(e)}get tagName(){var e;return null===(e=this.nodeName)||void 0===e?void 0:e.toUpperCase()}get localName(){var e;return null===(e=this.nodeName)||void 0===e?void 0:e.toLowerCase()}get innerHTML(){return ze(this.childNodes)}set innerHTML(e){this.childNodes=qe(String(null!=e?e:""))}get outerHTML(){return ze([this])}get children(){return this.childNodes.filter((e=>1==e.nodeType))}closest(e){let t=this;for(;t;){if(We(e,t))return t;t=t.parentNode}return null}querySelectorAll(e){let t=e.split(/\s*,\s*/),r=[],n=e=>{for(let n of t)if(We(n,e)){r.push(e);break}for(let t of e.childNodes)n(t)};for(let i of this.childNodes)n(i);return r}querySelector(e){return this.querySelectorAll(e)[0]}findSibling(e,t){if(!this.parentNode)return null;let r=this.parentNode.childNodes,n=r.indexOf(this);if(-1===n)return null;for(let i=n+e;i>=0&&i<r.length;i+=e){let e=r[i];if(!t||1===e.nodeType)return e}return null}removeChild(e){let t=this.childNodes.indexOf(e);if(-1!==t)return this.childNodes.splice(t,1),e.parentNode=void 0,e}get previousSibling(){return this.findSibling(-1)}get nextSibling(){return this.findSibling(1)}get previousElementSibling(){return this.findSibling(-1,!0)}get nextElementSibling(){return this.findSibling(1,!0)}cloneNode(e=!1){let t=new He(this.nodeName,this.nodeType);if(t.attributes=JSON.parse(JSON.stringify(this.attributes)),this.textContent&&(t.textContent=this.textContent),e)for(let r of this.childNodes){let e=r.cloneNode(!0);t.appendChild(e)}return t}get parentElement(){var e;return 1==(null===(e=this.parentNode)||void 0===e?void 0:e.nodeType)?this.parentNode:null}};function We(e,t){let r=e.match(/([.#]?[\w-]+|\[([\w-]+)(="([^"]*)")?\])/g);if(!r)return!1;for(let n of r)if(n.startsWith("#")){if(t.getAttribute("id")!==n.slice(1))return!1}else if(n.startsWith(".")){if(!(t.getAttribute("class")||"").split(" ").includes(n.slice(1)))return!1}else if(n.startsWith("[")){let e=n.match(/^\[([\w-]+)(="([^"]*)")?\]$/);if(!e)return!1;{let r=e[1],n=e[3],i=t.getAttribute(r);if("undefined"==typeof n){if(void 0===i)return!1}else if(i!==n)return!1}}else if(t.nodeName!==n)return!1;return!0}function qe(e){var t;let r=[],n=[];for(;e;){let i=e.match(/^<([\w-]+)(\s[^>]*)?>/),o=e.match(/^<\/([\w-]+)>/);if(i){let o=i[1].toLowerCase(),a=(null===(t=(i[2]||"").match(/([\w-]+)(="([^"]*)")?/g))||void 0===t?void 0:t.map((e=>{let[t,r,,n]=e.match(/([\w-]+)(="([^"]*)")?/);return{name:r,value:Je(n||"")}})))||[],s=new He(o,1);if(s.attributes=a,n.length>0){let e=n[n.length-1];e.childNodes.push(s),s.parentNode=e}else r.push(s);["img","input","br"].includes(o)||n.push(s),e=e.slice(i[0].length)}else if(o)n.pop(),e=e.slice(o[0].length);else{let t=e.indexOf("<"),i=e.slice(0,-1!==t?t:void 0),o=new He("#text",3);if(o.textContent=i,n.length>0){let e=n[n.length-1];e.childNodes.push(o),o.parentNode=e}else r.push(o);e=e.slice(i.length)}}return r}function Je(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")}function ze(e){return e.map((e=>{if(3===e.nodeType)return e.textContent||"";let{nodeName:t,attributes:r}=e,n=r.map((({name:e,value:t})=>` ${e}="${function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}(String(t))}"`)).join(""),i=ze(e.childNodes);return["img","input","br"].includes(t)?`<${t}${n} />`:`<${t}${n}>${i}</${t}>`})).join("")}function Ve(e,t,r){var n;return qe((null===(n=null==r?void 0:r.processTemplate)||void 0===n?void 0:n.call(r,null,e,t))||e).map((e=>_e(e,t,r)))}var Ye=e=>{if(!e||"string"!=typeof e.url)return!1;for(var t in e)if("body"!=t&&"params"!=t&&"headers"!=t&&"url"!=t&&"method"
1!==t&&("jsonpath"!=t||"string"!=typeof e[t]))return!1;return!0};function Ke(e){let t,{url:r,headers:n,params:i,method:o,body:a}=Ge(e),s=n["Content-Type"];return"GET"!=o&&"HEAD"!=o&&("application/json"===s&&(t=JSON.stringify(a)),"multipart/form-data"===s&&(t=Object.keys(a).reduce(((e,t)=>(e.append(t,a[t]),e)),new FormData)),"application/x-www-form-urlencoded"===s&&(t=new URLSearchParams(a))),[`${r}${Object.keys(i).length?`?${new URLSearchParams(i)}`:""}`,{headers:n,body:t,method:o}]}function Ge(e){let t={};for(let r in(null==e?void 0:e.headers)||{})if(e.headers.hasOwnProperty(r)){t[r.replace(/^[a-z]|\-[a-z]/g,(e=>e.toUpperCase()))]=e.headers[r]}return t.Accept||(t.Accept="application/json"),{params:(null==e?void 0:e.params)||{},headers:t,jsonpath:String((null==e?void 0:e.jsonpath)||"$"),method:((null==e?void 0:e.method)||"GET").toUpperCase(),body:(null==e?void 0:e.body)||{},url:String((null==e?void 0:e.url)||"")}}var Xe=async(e,t)=>{let r=x(t,e);if(r instanceof Promise)return r;let n=e;r&&(n=Ge(r));try{let[e,t]=Ke(n),r=await(await Ge.fetchImplementation(e,{...t,method:t.method.toLowerCase()})).json();return n.jsonpath&&"$"!=n.jsonpath?ge(r,n.jsonpath):r}catch(i){return{}}};async function Qe(e){if(!e)return e;if(Ye(e))return Xe(e);let t=Object.keys(e),r=await Promise.all(t.map((t=>Ye(e[t])?Xe(e[t],t):null)).filter(Boolean));return t.reduce(((t,n)=>({...t,[n]:Ye(e[n])?r.shift():e[n]})),{})}Ge.clean=function(e){let{params:t,method:r,headers:n,body:i,url:o}=Ge(e);var a={url:o},s={...n};return"application/json"===n["Content-Type"]&&delete s["Content-Type"],"application/json"===n.Accept&&delete s.Accept,Object.keys(s).length>0&&(a.headers=s),"GET"!==r&&(a.method=r),"GET"===r||"HEAD"===r||0===Object.keys(i).length||(a.body=i),Object.keys(t).length>0&&(a={...a,params:t}),a},Ge.toFetchArguments=Ke,Ge.fetchOne=Xe,Ge.fetch=Qe,Ge.isDataSettings=Ye,Ge.hasDataSettings=function(e){return!!e&&(Ye(e)||Object.values(e).some(Ye))},Ge.fetchImplementation=(...e)=>fetch(...e);var Ze={};function et(e,t=e=>{}){var r;let n=()=>{var i,o;let a=new Promise(((t,r)=>{i=r=>{null==e||e(r),t(r)},o=r}));var s=Object.assign(a,{resolve:i,reject:o,restart:n,first:r});return r=s,s.catch(t),s};return n()}V(Ze,{Component:()=>Lt,ComponentProps:()=>Tt,Context:()=>tr,ControlledPromise:()=>et,DEFAULT_CDN_URL:()=>mt,DOM:()=>Y,DataPath:()=>Ce,DataScope:()=>K,DataSettings:()=>Ge,Element:()=>rt,FEAASComponent:()=>Lt,FEAASComponentsProps:()=>Tt,FEAASContext:()=>tr,FEAASContextProps:()=>er,FEAASEditor:()=>Xt,FEAASEditorProps:()=>Gt,FEAASElement:()=>rt,FEAASLoader:()=>$t,FEAASLoaderProps:()=>Mt,FEAASPicker:()=>Zt,FEAASPickerProps:()=>Qt,FEAASStylesheet:()=>It,FEAASStylesheetProps:()=>_t,InvalidResponse:()=>ut,JSONPath:()=>he,Loader:()=>$t,MyComponent:()=>it,Picker:()=>Zt,Stylesheet:()=>It,Thumbnail:()=>Bt,WebComponent:()=>tt,adjustNumbers:()=>Re,autoloadScripts:()=>Ee,cleanCollectionBit:()=>xe,clearFetchCache:()=>st,createStylesheet:()=>Nt,customizeDataSettings:()=>x,fetchAndRevalidate:()=>lt,fetchAndRevalidateComponent:()=>Et,fetchAndRevalidateStylesheet:()=>Ct,fetchBypassingCache:()=>ht,fetchCache:()=>at,fetchComponent:()=>At,fetchData:()=>Qe,fetchToValidateCache:()=>pt,fetchWithCacheAwareness:()=>ct,findStylesheet:()=>Rt,getComponent:()=>T,getComponentSource:()=>gt,getComponentURL:()=>yt,getFetchCache:()=>dt,getFramePosition:()=>Kt,getHumanizedLabel:()=>Ne,getLastPathBit:()=>Fe,getQualifier:()=>je,getStylesheetSource:()=>bt,getStylesheetURL:()=>wt,loadScript:()=>Ae,loadStylesheet:()=>xt,loadStylesheetAllowStale:()=>kt,normalizeCollectionScope:()=>ke,observeDOMElement:()=>we,parseComponentSource:()=>ft,parseLimit:()=>Oe,parseRange:()=>Se,parseStylesheetSource:()=>vt,queryObject:()=>ge,queryObjectRaw:()=>fe,queryScopes:()=>be,registerComponent:()=>D,registerDatasource:()=>S,renderComponent:()=>Dt,renderComponentElement:()=>Ft,renderComponentPromise:()=>Pt,renderDOMContent:()=>Be,renderDOMElement:()=>_e,renderHTMLContent:()=>Ue,renderStylesheet:()=>Ot,renderStylesheetPromise:()=>St,serializeCH1RichText:()=>ye,setDOMAttribute:()=>Me});var tt="undefined"==typeof HTMLElement?"undefined"!=typeof windowJSDOM?windowJSDOM.HTMLElement:class{}:HTMLElement,rt=class extends tt{getProps(e){return{}}constructor(){super(),this.defaultProps={},this.connected=!1,this.refs={},this.descendants=[],this.whenLoaded=et((e=>{this.payload=e})),this.whenRendered=et((()=>this.initialized=!0),(()=>this.cancelRender())),this.addEventListener("feaasMount",this),this.addEventListener("feaasUnmount",this)}getRoot(){return this}attributeChangedCallback(e,t,r){this.set()}connectedCallback(){this.mount()}disconnectedCallback(){this.unmount()}mount(){try{let e=this.getParent();if(e&&!e.connected||this.connected)return;this.connected=!0,this.log("FEAAS: Mount",this.tagName,this),this.dispatchEventIndirectly(new Event("feaasMount",{bubbles:!0,composed:!0})),this.getElements().map((e=>{var t;return null===(t=e.mount)||void 0===t?void 0:t.call(e)})),this.set()}catch(e){this.onError(e)}}dispatchEventIndirectly(e){this.dispatchEvent(e);let t=this.getParent();t&&!t.contains(this)&&(Object.defineProperty(e,"target",{value:this,writable:!1}),Object.defineProperty(e,"composedPath",{value:()=>[this],writable:!1}),t.handleEvent(e))}isJSONAttribute(e){return!1}log(...e){let t=e[0];("undefined"!=typeof location&&null!=location&&location.hostname.startsWith("components-")||localStorage["Sitecore.Components.Debug"])&&console.log(t+" "+e.slice(1).map((e=>e&&"object"==typeof e?"%O":"%s")).join(" "),...e.slice(1))}unmount(){this.connected&&(this.log("FEAAS: Unmount",this),this.dispatchEventIndirectly(new Event("feaasUnmount",{bubbles:!0,composed:!0})),this.connected&&this.initialized&&this.render&&this.update(),this.cancelRender(),this.connected=!1,this.initialized&&this.render&&this.update())}getParent(e=!0){for(var t=this;t=t.parentElement||(t.parentNode instanceof ShadowRoot?t.parentNode.host:null);)if(!e||t.tagName.startsWith("FEAAS-"))return t;if("FEAAS-CONTEXT"!=this.tagName)return document.querySelector("feaas-context")}getElements(e=this.getRoot(),t=!0){return Array.from(e.querySelectorAll("*")).map((e=>[!t||e.tagName.startsWith("FEAAS-")?e:null,e.shadowRoot?this.getElements(e.shadowRoot,t):null])).flat().filter(
1Boolean)}handleEvent(e){let t=e.composedPath()[0];switch(e.type){case"feaasMount":t!=this&&this.nestedCallback(t);break;case"feaasUnmount":t!=this&&this.unnestedCallback(t)}}unnestedCallback(e){let t=this.descendants.indexOf(e);-1!=t&&(this.log("FEAAS: Unnest",this,e),this.descendants.splice(t,1),this.refs[e.getComponentName()]=null,e.refs.parent==this&&(e.refs.parent=null),e.refs.top==this&&(e.refs.top=e.refs.parent))}nestedCallback(e){var t,r;if(-1==this.descendants.indexOf(e)&&(this.descendants.push(e),this.log("FEAAS: Nest",this,e),this.refs[e.getComponentName()]=e,e.refs.top=this,(t=e.refs).parent||(t.parent=this),e.render))for(var n=e.refs.parent;n;n=n.refs.parent)n.render&&((r=e.refs).parentReact||(r.parentReact=n),e.refs.topReact=n)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return void 0===this.payload&&null==this.getAttribute("hidden")}onError(e,t="uncaught",r=!1){let n=new CustomEvent("feaasError",{bubbles:!0,composed:!0,detail:e});if(this.dispatchEventIndirectly(n),this.whenLoaded.reject(e),!n.defaultPrevented&&!r){this.whenRendered.reject(e);try{this.unmount()}catch(i){}return!0}return!1}shouldUpdateOnLoad(){return!0}async advance(){try{if(void 0===this.payload){if(!this.isReadyToLoad())return;this.payload=null,this.dispatchEventIndirectly(new Event("feaasLoad",{bubbles:!0,composed:!0}));let e=await this.load().catch((e=>{throw this.payload=void 0,e}));if(this.whenLoaded.resolve(e),this.onLoad)return}else if(null==this.payload)return;this.flush(),this.whenRendered.resolve(this)}catch(e){this.onError(e)}}flush(){var e,t;if(!this.connected)return;let r=null===(t=null===(e=this.payload)||void 0===e?void 0:e.ReactDOM)||void 0===t?void 0:t.flushSync;r?r((()=>this.update())):this.update()}load(){return Promise.resolve(null)}update(){var e,t,r;if(null==this.payload||!this.render)return;let{React:n,ReactDOM:i,ReactDOMClient:o}=this.payload||{};if(!n)throw new Error(`${this.tagName}: React is not present in payload`);if(!i)throw new Error(`${this.tagName}: ReactDOM is not present in payload`);"false"==this.getAttribute("hydrate")&&this.firstElementChild||(this.refs.topReact||this.forceUpdateReact?this.forceUpdateReact&&this.connected?null===(e=this.forceUpdateReact)||void 0===e||e.call(this):null===(r=null===(t=this.refs.topReact)||void 0===t?void 0:t.forceUpdateReact)||void 0===r||r.call(t):o?(this.reactRoot||(this.reactRoot=o.createRoot(this.getReactRootElement())),this.reactRoot.render(this.getReactElement())):i.render(this.getReactElement(),this.getReactRootElement()))}invokeReactRendering(){let{React:e,ReactDOM:t}=this.payload||{};if(!this.connected)return null;let r=this.descendants.filter((e=>e.refs.parentReact==this&&e.payload&&e.connected)).map(((e,t)=>this.getReactElement(e)));return this.render({...this.props,children:r},this.payload)}getReactErrorBoundary(e=this,t=e.tagName){if(this.reactErrorBoundary)return this.reactErrorBoundary;let{React:r,ReactDOM:n}=e.payload||{};return this.reactErrorBoundary||(this.reactErrorBoundary=class extends r.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(t,r){console.error(`FEAAS: ${e.tagName} Error:`,t,r),e.onError(t,"react")}render(){if(!this.state.error)return this.props.children}})}getReactElement(e=this,t){let{React:r,ReactDOM:n}=e.payload||{},i=this.getReactErrorBoundary(),o=this.getReactWrapper(e);return r.createElement(i,{key:e.tagName+"-"+e.getUID(),slot:e.getAttribute("slot")},r.createElement(o,null))}getReactWrapper(e=this,t=e.tagName){if(e.reactWrapper)return e.reactWrapper;let{React:r,ReactDOM:n}=e.payload||{};return e.reactWrapper=t=>{if(e.render){let[t,i]=r.useReducer((e=>e+1),0);return e.forceUpdateReact=i,n.createPortal(r.createElement(r.Fragment,null,e.invokeReactRendering()),e.getReactRootElement())}return e.update()},Object.assign(e.reactWrapper,{key:e.tagName+"-"+e.getUID(),displayName:t}),e.reactWrapper}getUID(){return this.uid||(this.uid=String(Math.random()))}getShadowRoot(){return this.shadowRoot||this.attachShadow({mode:"open"}),this.shadowRoot}
1getReactRootElement(){return this.useShadowRoot?this.getShadowRoot():this.getRoot()}set(e){try{for(var t in this.scheduleRender(),this.overrides={...this.overrides,...e},this.props={...this.getProps(),...this.overrides},this.props){let e=this.isJSONAttribute(t),n=this.props[t],i=e?JSON.stringify(n):String(n),o=this.defaultProps[t],a=e?JSON.stringify(o):String(o),s=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),l=this.getAttribute(s);try{var r=e?JSON.stringify(JSON.parse(l)):l}catch(h){r=null}null==n||i===a?this.removeAttribute(s):("string"==typeof n||"number"==typeof n||"boolean"==typeof n||e)&&r!=i&&this.setAttribute(s,i)}}catch(n){this.whenRendered.reject(n),this.onError(n,"set")}return this}import(e){return import(e)}scheduleRender(){null==this.nextRender&&(this.whenRendered=this.whenRendered.restart()),this.cancelRender(),this.nextRender=requestAnimationFrame((()=>{this.nextRender=null,this.advance().catch((e=>{}))}))}cancelRender(){cancelAnimationFrame(this.nextRender)}formatURL(e,t){return"string"==typeof e&&e.match(/^\/[^\/]/)?t+e:e}getContextAttribute(e,t=this){for(var r=this;r=r.parentElement||(r.parentNode instanceof ShadowRoot?r.parentNode.host:null);)if(null!=r.getAttribute(e))return r.getAttribute(e);return this.getAttribute(e)}static register(e,t){null==t&&(t="undefined"!=typeof window?window:null),t&&!t.customElements.get(e)&&t.customElements.define(e,this)}},nt=class extends rt{load(){return Promise.all([import("https://cdn.skypack.dev/react"),import("https://cdn.skypack.dev/react-dom")]).then((([e,t])=>({React:e,ReactDOM:t})))}render({},{React:e}){return e.createElement(e.Fragment,null)}},it=class extends nt{constructor(){super(...arguments),this.useShadowRoot=!0}getProps(){return{counter:parseFloat(this.getAttribute("counter"))}}render({counter:e},{React:t}){let[r,n]=t.useState(0);return t.useEffect((()=>{n((e=>e+1))}),[e]),t.createElement(t.Fragment,null,t.createElement("p",null,"Rendering attribute: ",e),t.createElement("p",null,"Triggered updates: ",r))}};it.observedAttributes=["counter"];var ot=["initial","check","updated"],at={};function st(){at={}}async function lt(e,t,r,n,i=at){return ct({url:e,options:t,validator:r,callback:n,cache:i}).then(pt).then((e=>e.response))}async function ct({url:e,options:t,validator:r,callback:n,cache:i},o="initial"){let a=new Date;if(null!=i){var s=dt(e);if(ot.indexOf(s.phase)>=ot.indexOf(o))var l=s[o];else s.phase=o}let c=await(l||fetch(e,t));if(!l&&s&&(c.ok?s[o].resolve(c):s[o].reject(new Error("Fetch failed"))),!c.ok)throw new Error("Fetch failed");let d=new Date(c.headers.get("date"))<a||l&&"initial"==o&&("updated"==s.phase||"check"==s.phase);if(!1===(null==r?void 0:r(c,d)))throw new ut("Response is not valid");return await(null==n?void 0:n(c,o,d)),{url:e,options:t,isCached:d,response:c,validator:r,callback:n,cache:i}}function dt(e,t=!1){let r=String(e).replace("?head","");var n=at[r];return!n&&!t&&(n=at[r]={phase:null,initial:et(),check:et(),updated:et(),final:et()}),n}var ut=class extends Error{};async function pt(e){let{url:t,isCached:r,options:n,validator:i,response:o,cache:a}=e;if(r){let{response:r}=await ct({url:t+(t.toString().includes("?")?"&":"?")+"head",options:{...n,method:"HEAD",cache:"no-cache"},validator:i,cache:a},"check");if(r.headers.get("last-modified")!=o.headers.get("last-modified"))return ht(e)}return e}async function ht(e){return ct({...e,options:{...e.options,cache:"reload"}},"updated")}var mt="https://feaas.blob.core.windows.net";function ft(e){let t=e.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(t){var[,r,n,i,o,a]=t;return{cdn:r,library:n,component:i,version:o,revision:a}}}function gt(e){if(!e||!e.library||!e.component)throw new Error("Component requires `library` and `component` properties");return`${e.cdn&&e.cdn!=mt?`${e.cdn}/components`:""}/${e.library}/${e.component}/${e.version&&("responsive"!=e.version||e.revision&&"published"!=e.revision)?e.version:""}/${e.revision&&"published"!=e.revision?e.revision:""}`.replace(/(^\/|\/$|\/\/)(?!.+\/components\/)/g,"")}function bt(e){return`${e.cdn&&e.cdn!=mt?`${e.cdn}/styles/`:""}${e.library}/${e.revision&&"published"!=e.revision?e.revision:""}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function vt(e){let t=e.match(/^(?:(.*?)\/styles\/)?([^\/]+)(?:\/(published|staged|saved|\d+)(?:.css)?)?$/);if(t){var[,r,n,i]=t;return{cdn:r,library:n,revision:i}}{let t=ft(e);if(t){var{cdn:r,library:n,revision:i}=t;return null!=i&&i.match(/\d/)&&(i=void 0),{cdn:r,library:n,revision:i}}}}function yt(e){return"string"==typeof e&&(e={src:e}),"src"in e&&(e={...ft(e.src)}),`${e.cdn||e.hostname||mt}/components/${e.library}/${e.component}/${e.version||"responsive"}/${e.revision||"published"}.html`}function wt(e){if("string"==typeof e&&(e={src:e}),"src"in e){if(String(e.src).includes("v1/files/components/styles"))return e.src;e={...vt(e.src)}}return`${e.cdn||e.hostname||mt}/styles/${e.library}/${"staged"==e.revision?"staged":"saved"==e.revision?"saved":"published"}.css`}async function Et(e,t,r=!1){let n=e=>null==e.headers.get("x-ms-meta-versionDeletedAt"),i=e=>e.clone().text().then(t),o=await Promise.all([e.instance&&ct({options:{headers:{Accept:"text/html"},credentials:"omit"},url:yt({...e,version:e.instance}),validator:n}).catch((e=>e)),ct({url:yt(e),validator:n}).catch((e=>e))]),a=o.find((e=>e&&"isCached"in e&&e));if(!a||a instanceof Error)throw o.find((e=>e&&e instanceof Error))||new Error("Can not fetch component");return o[0]==a&&console.log("Using fork!",o),await i(a.response),r?a:pt({...a,callback:i}).catch((e=>{if(o[0]==a&&(ht({...a,callback:null,validator:null}),console.log("Fork was deleted"),!(o[1]instanceof Error)))return i(o[1].response),pt({...o[1],callback:i});throw e}))}async function At(e){var t;"string"==typeof e&&(e={src:e});let{response:r}=await Et(e,(e=>{t=e}),!0);return{...e,template:t,lastModified:r.headers.get("last-modified")}}async function Ct(e,t){return lt(wt(e),{headers:{Accept:"text/css"},credentials:"omit"},(e=>null==e.headers.get("x-ms-meta-deletedAt")),((e,r)=>e.clone().text().then((e=>t(e,r)))))}function Ot(e,t){return St(e,t||(t=document.createElement("style"))),t}function St(e,t){return t||(t=document.createElement("style")),Ct(e,((e,r)=>{t.textContent=e})).then((()=>t))}var jt=new WeakSet;function xt(e,t){var r,n=Rt(e);
1if(n){if(jt.has(n))return Promise.resolve(n);e=n.getAttribute("data-href")||n.getAttribute("href")}return Ct(e,((i,o)=>{"initial"==o&&n||(r||(r=n&&"LINK"!=n.tagName?n:Nt(e)),r.textContent=i),null==t||t(i,o)})).then((()=>r||n))}function kt(e){return new Promise(((t,r)=>{xt(e,t).catch(r)}))}function Rt(e){let t=wt(e),{library:r}=vt(t),n=`/files/components/styles/${r}.css`;return document.querySelector(`style[data-href="${t}"], \n link[rel="stylesheet"][href="${t}"], \n style[data-href*="${n}"], \n link[rel="stylesheet"][href*="${n}"]`)}function Nt(e){let t=wt(e),r=document.createElement("style");return r.setAttribute("data-href",t),document.head.appendChild(r),r}function Ft(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return _e(n,t),r}function Dt(e,t){return Pt(e,t||(t=document.createElement("div"))),t}async function Pt(e,t){return t||(t=document.createElement("div")),t.childNodes.length?_e(t,e.data,e):"template"in e?Be(t,e.template,e.data,e):Et(e,(r=>Be(t,r,e.data,e))).then((()=>t))}function Tt(e){var t,r,n,i,o,a,s,l;let c,d=e.getAttribute("src");if(d){let e=ft(d);if(!e)throw new Error(`Could not parse FEAAS Component source: ${d}`);var{cdn:p,library:h,component:m,version:f,revision:g}=e}let b=e.getAttribute("data");if(null!=b&&""!=b)try{c="string"==typeof b?JSON.parse(b):{}}catch(u){console.error(u)}let v=e.getAttribute("fetch");return{data:c||{},cdn:null!==(r=null!==(t=e.getContextAttribute("cdn"))&&void 0!==t?t:p)&&void 0!==r?r:mt,library:null!==(n=e.getAttribute("library"))&&void 0!==n?n:h,component:null!==(i=e.getAttribute("component"))&&void 0!==i?i:m,version:null!==(a=null!==(o=e.getAttribute("version"))&&void 0!==o?o:f)&&void 0!==a?a:"responsive",revision:null!==(l=null!==(s=e.getAttribute("revision"))&&void 0!==s?s:g)&&void 0!==l?l:"published",hostname:e.getAttribute("hostname"),template:e.getAttribute("template"),instance:e.getAttribute("instance"),editable:null!=e.getAttribute("editable"),suspended:null!=e.getAttribute("suspended"),lastModified:e.getAttribute("last-modified"),fetch:"false"==v||null==v&&e.hasAttribute("fetch")?[]:null==v||"true"==v?["data","template","stylesheet"]:v.split(/(\s+|\-)+/g).filter(Boolean)}}var Lt=class extends rt{setData(e){this.set({data:e})}getProps(){return Tt(this)}isJSONAttribute(e){return"data"==e}attributeChangedCallback(e,t,r){t!==r&&(("library"==e||"component"==e||"revision"==e||"version"==e)&&(this.payload=void 0,this.alreadyRendered&&this.connected&&(this.needsRefresh=!0,this.needsToFetchTemplate=!0)),super.attributeChangedCallback(e,t,r),"data"==e&&(this.needsRefresh=!0,(this.props.fetch.includes("data")||this.alreadyRendered||!Ge.hasDataSettings(this.props.data))&&this.fetchData()))}async fetchData(){this.readyData=void 0,this.whenDataReady=this.whenDataReady.restart();let e=await Ge.fetch(this.props.data),t=this.alreadyRendered;await this.whenDataReady.resolve(e),t&&this.advance()}getEditor(){var e;return null===(e=document.querySelector("feaas-context"))||void 0===e?void 0:e.refs.editor}constructor(){super(),this.readyData={},this.whenDataReady=et((e=>this.readyData=e),(e=>this.onError(e))),this.defaultProps={cdn:mt,revision:"published",version:"responsive",editable:!1,suspended:!1,data:{}},this.onLoad=e=>{this.payload=e,this.advance()};this.getAttribute("data");this.getAttribute("data")||this.whenDataReady.resolve({}),this.addEventListener("click",(()=>{this.props.editable&&this.edit()}))}edit(){let e=this.getEditor();if(null!=e&&e.setTarget(this))return e.open(),!0}getOriginal(){let e=this.getAttribute("data-path-scope");if(e){for(var t=this;(t=t.previousElementSibling)&&t.getAttribute("data-path-scope")==e;)var r=t;return r}}isReadyToLoad(){return super.isReadyToLoad()&&null!=this.props.library&&null!=this.props.component&&null!=this.props.version}async load(){var e;if(this.getOriginal())return;let t=()=>{null!=this.payload&&(r||this.readyData&&this.onLoad(this.payload))};if(this.props.fetch.includes("stylesheet"))var r=kt({...this.props}).then((()=>{r=null,t()}));if(this.props.fetch.includes("template")||this.needsToFetchTemplate){this.needsToFetchTemplate=!1;var n=Et(this.props,(e=>{this.payload=e,this.needsRefresh=!0,t()}))}else this.payload=null!==(e=this.props.template)&&void 0!==e?e:this.innerHTML;return Promise.all([r,this.whenDataReady.then((()=>t())),n]).then((()=>this.payload))}flush(){this.readyData&&super.flush()}update(){if(this.alreadyRendered=!0,this.props.fetch.includes("data")||this.props.fetch.includes("template")||!this.firstElementChild||this.needsRefresh)if(Array.from(this.children).filter((e=>"BR"!=e.tagName)).length>0&&!this.needsRefresh)_e(this,this.readyData);else{if(this.needsRefresh=!1,this.getOriginal())return;Be(this,this.payload,this.readyData)}}};
1function Mt(e){return{opacity:null!=e&&e.getAttribute("opacity")?parseFloat(null==e?void 0:e.getAttribute("opacity")):1,hidden:null!=(null==e?void 0:e.getAttribute("hidden"))}}Lt.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet","fetch"],Lt.register("feaas-component");var $t=class extends rt{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return Mt(this)}attributeChangedCallback(e,t,r){if(t!==r)return"hidden"==e&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),r?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all")),super.attributeChangedCallback(e,t,r)}connectedCallback(){this.payload=null,super.connectedCallback(),this.attributeChangedCallback("hidden",this.getAttribute("hidden"),this.getAttribute("hidden")),this.stylesheet=document.createElement("style"),this.stylesheet.textContent="\n #loader {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background: #f6f6ff;\n z-index: 1000;\n }\n @keyframes loader-circular-track {\n 0% {\n stroke-dasharray: 1, 400;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 400, 400;\n stroke-dashoffset: -100;\n }\n 100% {\n stroke-dasharray: 400, 400;\n stroke-dashoffset: -260;\n }\n }\n \n @keyframes loader-circular-spinner {\n 0% {\n transform: rotate(0deg);\n }\n \n 100% {\n transform: rotate(360deg);\n }\n }\n #loader .spinner {\n width: 48px;\n height: 48px;\n }\n ",this.loader=document.createElement("div"),this.loader.id="loader",this.loader.innerHTML='\n <div class="spinner">\n <svg\n viewBox="0 0 100 100"\n style="\n animation: 2s linear 0s infinite normal none running loader-circular-spinner;\n display: block;\n width: 48px;\n height: 48px;\n "\n >\n <circle fill="transparent" cx="50" cy="50" r="42" stroke="rgba(0,0,0,0.1)" stroke-width="10px"></circle>\n <circle\n fill="transparent"\n stroke="#5548D9"\n cx="50"\n cy="50"\n r="42"\n stroke-width="10px"\n stroke-linecap="round"\n style="animation: 1.5s linear 0s infinite normal none running loader-circular-track"\n ></circle>\n </svg>\n </div>',this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}update(){this.loader.style.opacity=String(this.props.opacity)}};function _t(e){var t,r,n,i;let o=e.getAttribute("src");if(o)var{cdn:a,library:s,revision:l}=vt(o);return{library:null==e?void 0:e.getContextAttribute("library"),revision:null!==(r=null!==(t=null==e?void 0:e.getAttribute("revision"))&&void 0!==t?t:l)&&void 0!==r?r:"published",cdn:null!==(i=null!==(n=null==e?void 0:e.getContextAttribute("cdn"))&&void 0!==n?n:null==e?void 0:e.getContextAttribute("hostname"))&&void 0!==i?i:mt}}$t.observedAttributes=["hidden","opacity"],$t.register("feaas-loader");var It=class extends rt{constructor(){super(...arguments),this.onLoad=e=>{this.payload=e,this.advance()}}getProps(){return _t(this)}isReadyToLoad(){return null!=this.props.library&&null!=this.props.revision&&null!=this.props.cdn}load(){return xt(this.props,this.onLoad)}};It.register("feaas-stylesheet");var Bt={};V(Bt,{convertBase64toBlob:()=>Ht,generate:()=>Vt,get:()=>Jt,getVersionForThumbnail:()=>qt,load:()=>zt,responseToImage:()=>Wt,upload:()=>Yt});var Ut,Ht=e=>fetch(e).then((e=>e.blob())),Wt=e=>e.blob().then((e=>new Promise(((t,r)=>{let n=new Image;n.onerror=r,n.onload=()=>{t(n)},n.src=URL.createObjectURL(e)}))));async function qt(e){return e.versions.length||await e.versions.fetch(),e.getVersionForWidth(800)}async function Jt(e,t,r){try{if(!e.isNew)return await zt(e,t,r)}catch(i){e.sdk.log(`FEAAS: Thumbnail ${e.id}, version: ${(null==t?void 0:t.id)||"responsive"}, status: generating ${status}, reason: ${i}`)}let n=await Vt(e,t);return null==r||r(n,!1),n&&!e.isNew&&Ht(n.src).then((r=>Yt(e,t,r))),n}async function zt(e,t,r){let n=t?t.getThumbnailURL():e.getThumbnailURL(),i=e.library.stylesheet,o=new Date(Math.max(Number(e.modifiedAt),Number(i.modifiedAt)));var a;return e.sdk.log(`FEAAS: Thumbnail ${e.id}/${(null==t?void 0:t.id)||"responsive"}, loading`),await lt(n,{},((e,t)=>{let n=Math.abs(Number(new Date(e.headers.get("x-ms-meta-componentRenderedAt")))-Number(o))<2e3;return t&&!n&&Wt(e).then((e=>{a=e,r(e,t)})),n}),((n,i,o)=>{e.sdk.log(`FEAAS: Thumbnail ${e.id}/${(null==t?void 0:t.id)||"responsive"}, status: ${i}`),Wt(n).then((e=>{a=e,r(e,o)}))}),null),a}async function Vt(e,t,r){let n=t||(e.isNew?null:await qt(e));if(!n||n.isViewEmpty())return null;let i=r||e.library.stylesheets.first,{datasources:o}=e.sdk;return await function(e,t,r,n,i,o){let a=document.createElement("iframe");return a.style.position="absolute",a.style.top="-2000px",a.style.left="-2000px",a.style.width=t.props.minWidth+"px",a.style.height="720px",a.style.zIndex="100011",document.body.appendChild(a),new Promise(((s,l)=>{let c=document.createElement("script");c.onerror=l,c.src=o.frontend+"/assets/html2canvas.js",c.onload=()=>{var e;((null===(e=a.contentWindow.document.fonts)||void 0===e?void 0:e.ready)||Promise.resolve()).then((function(){return a.contentWindow.html2canvas(p,{scale:Math.max(1.1,1e3/Math.min(1401,Math.max(320,t.props.minWidth))),width:Math.min(1401,Math.max(320,t.props.minWidth)),height:Math.max(1,Math.min(2e3,p.offsetHeight)),windowWidth:t.props.minWidth||t.props.maxWidth+"px",windowHeight:1e3,proxy:o.backend+"/proxy/media",backgroundColor:"#ffffff"}).then((e=>{let t=e.toDataURL("image/jpeg",.6);a.parentElement.removeChild(a);let r=new Image;r.onload=()=>{s(r)},r.onerror=l,r.src=t}))}))},a.contentWindow.document.head.appendChild(c);let d=a.contentWindow.document.createElement("style");d.textContent=`\n ${i}\n body, html { padding: 0; margin: 0; overflow: hidden }\n `;let u=a.contentWindow.document.createElement("style");u.textContent="\n body, html { padding: 0; margin: 0; overflow: hidden }
1\n ",a.contentWindow.document.head.appendChild(d),a.contentWindow.document.head.appendChild(u);let p=Dt({template:r,data:n});p.classList.add(...e,"-feaas--preview","-emulate--"+t.details.slug),a.contentWindow.document.body.appendChild(p)}))}(n.classList,i.getBreakpointForWidth(800,n.getBreakpoints()),n.view,o.reduce(((e,t)=>Object.assign(e,{[t.id]:t.sample})),{}),i.css,e.sdk)}async function Yt(e,t,r){let n=t?t.getThumbnailURL():e.getThumbnailURL(),i=new Date(Math.max(Number(e.modifiedAt),Number(e.library.stylesheet.modifiedAt)));try{await e.sdk.uploadBlob("thumbnails",n.split(/\/thumbnails\//)[1],r,{headers:{"x-ms-blob-content-type":"image/jpg","x-ms-blob-cache-control":"public,max-age=31536000,immutable","x-ms-meta-versionId":t?t.id:null,"x-ms-meta-versionRevision":t?t.revision.toString():null,"x-ms-meta-componentId":e.id,"x-ms-meta-componentRenderedAt":i.toUTCString(),"x-ms-meta-componentModifiedAt":e.modifiedAt.toUTCString(),"x-ms-meta-componentCreatedAt":e.createdAt.toUTCString(),"x-ms-meta-modifiedAt":e.modifiedAt.toUTCString()}}),fetch(n,{cache:"no-cache"}).then((()=>{e.sdk.log("FEAAS: Thumbnail uploaded",n)}))}catch(o){e.sdk.log("FEAAS: Thumbnail failed to upload",n,o)}return n}function Kt(e){let t=[];if(e){let r,n,i=e.ownerDocument.defaultView;for(;i!==window.top;){r=i.parent;for(let e=0;e<r.frames.length;e++)if(r.frames[e]===i){for(let e of r.document.getElementsByTagName("iframe"))if(e.contentWindow===i){n=e.getBoundingClientRect();let r=e.contentWindow.getComputedStyle(e);t.push({left:n.left+parseInt(r.borderLeftWidth),top:n.top+parseInt(r.borderTopWidth)})}i=r;break}}}return t.reduce(((e,t)=>({left:e.left+t.left,top:e.top+t.top})),{left:0,top:0})}function Gt(e){var t;return{context:HTMLElement,frontend:null==e?void 0:e.getContextAttribute("frontend"),src:null!==(t=null==e?void 0:e.getAttribute("src"))&&void 0!==t?t:"/editor.js",library:null==e?void 0:e.getAttribute("library"),component:null==e?void 0:e.getAttribute("component"),version:null==e?void 0:e.getAttribute("version"),instance:null==e?void 0:e.getAttribute("instance"),forked:null==e?void 0:e.getAttribute("forked"),revision:(null==e?void 0:e.getAttribute("revision"))||"saved",hidden:null!=(null==e?void 0:e.getAttribute("hidden")),for:null==e?void 0:e.getAttribute("for"),state:(null==e?void 0:e.getAttribute("state"))||"idle",changed:null!=(null==e?void 0:e.getAttribute("changed"))}}"undefined"!=typeof window&&(window.FEAASReactElement=nt,null!==(Ut=window.FEAASLoading)&&void 0!==Ut||(window.FEAASLoading=Promise.resolve()));var Xt=class extends rt{constructor(){super(...arguments),this.framePoint={top:0,left:0},this.wrapperRect={top:0,left:0,width:0,height:0},this.bodyRect={top:0,left:0,width:0,height:0},this.defaultProps={hidden:!1},this.setTarget=(e,t={component:e.getAttribute("component"),version:e.getAttribute("version"),revision:e.getAttribute("revision"),instance:e.getAttribute("instance")})=>{if(!this.closing&&(!this.target||null==e))return this.set(t),this.target=e,!0},this.onChromeMeasureElement=(e,t=e.getBoundingClientRect())=>e.ownerDocument==document?{left:t.left-this.bodyRect.left,top:t.top-this.bodyRect.top,width:t.width,height:t.height}:{left:t.left+this.framePoint.left-this.bodyRect.left,top:t.top+this.framePoint.top-this.bodyRect.top,width:t.width,height:t.height},this.onBeforeMeasure=e=>{e.memoized.focusable&&(this.framePoint=Kt(e.memoized.focusable)),this.chrome&&(this.wrapperRect=this.chrome.positionable.getBoundingClientRect(),this.bodyRect=this.chrome.positionable.ownerDocument.body.parentElement.getBoundingClientRect())},this.onMeasure=()=>{},this.onPosition=({focusable:e,root:t})=>{!this.chrome||this.props.hidden||(e?(this.chrome.wrapper.style.width=e.width+32+"px",this.chrome.wrapper.style.height=e.height+16+64+"px",this.chrome.wrapper.style.left=e.left-16+"px",this.chrome.wrapper.style.top=e.top-64+"px",this.chrome.wrapper.style.opacity="1",this.chrome.absolute=this.querySelector(".ui.overlays"),this.chrome.absolute&&(this.chrome.absolute.style.left=t.left+"px",this.chrome.absolute.style.top=t.top+"px")):(this.chrome.wrapper.style.opacity="0",this.chrome.wrapper.style.left="-1000px",this.chrome.wrapper.style.top="-1000px"))},this.onWindowMessage=e=>{var t;switch(null===(t=e.data)||void 0===t?void 0:t.type){case"feaasEdit":let t=this.getPlaceholder();this.setTarget(t.editable,e.data)&&(this.loader=t.loader,document.body.appendChild(t.clipper),this.editedUID=e.data.id,this.setPlaceholder(),this.open());break;case"feaasMeasurements":this.measurements=e.data.measurements,this.props.hidden||this.setPlaceholder()}},this.onContentChange=()=>{this.setAttribute("changed","changed"),requestAnimationFrame((()=>{this.setIframeComponentContent()}))},this.onClose=()=>{var e;this.setAttribute("hidden","hidden"),this.placeholder&&(this.placeholder.positionable.style.opacity="0",this.placeholder.positionable.style.pointerEvents="none"),this.chrome&&(this.chrome.wrapper.style.opacity="0"),!(null===(e=this.target)||void 0===e)&&e.parentNode&&(this.target.outerHTML=this.target.outerHTML),this.setTarget(null,{component:null,version:null,instance:null,revision:null}),this.setEditorContext({isFocused:!1})},this.onVersionStateChange=(e,t)=>
1{this.versionContext=e,this.setVersionContext=t},this.onEditorStateChange=(e,t)=>{this.editorContext=e,this.setEditorContext=t,e.editor&&"loading"==this.props.state&&!this.props.hidden&&(this.setAttribute("state","ready"),this.ownerDocument.fonts.ready.then((()=>setTimeout((()=>{this.setReadyState(),this.setIframeComponentContent()}),100))))}}getProps(){return Gt(this)}getReactRootElement(){return this.reactRootElement||(this.reactRootElement=document.createElement("div"),this.getRoot().appendChild(this.reactRootElement)),this.reactRootElement}showLoader(){this.loader||(this.loader=document.createElement("feaas-loader"),this.loader.setAttribute("opacity","0.6"),this.loader.style.zIndex="1000",this.target.appendChild(this.loader),"FEAAS-COMPONENT"==this.target.tagName&&(this.target.style.position="relative"))}hideLoader(){this.loader&&(this.loader.setAttribute("hidden","hidden"),"FEAAS-COMPONENT"==this.target.tagName&&(this.target.style.position="relative",this.target.style.position=""))}load(){return import(this.formatURL(this.props.src,this.props.frontend))}connectedCallback(){super.connectedCallback(),window.addEventListener("message",this.onWindowMessage)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("message",this.onWindowMessage)}setIframe(e){this.iframe=e}setIframeComponentContent(){this.placeholder&&this.iframe&&this.placeholder.editable.innerHTML&&this.iframe.contentWindow.postMessage({type:"feaasUpdate",id:this.editedUID,content:this.placeholder.editable.innerHTML})}setPlaceholder(){if(!this.iframe)return;let e=this.iframe.clientWidth,t=this.iframe.clientHeight,r=this.iframe.getBoundingClientRect(),n=this.getPlaceholder(),i=document.body.getBoundingClientRect(),o=this.measurements[this.editedUID];o&&(Object.assign(n.clipper.style,{position:"absolute",top:r.top+this.iframe.clientTop-i.top+"px",left:r.left+this.iframe.clientLeft-i.left+"px",width:e+"px",height:t+"px",pointerEvents:"none",zIndex:1,overflow:"hidden"}),Object.assign(n.positionable.style,{position:"absolute",top:o.top+"px",left:o.left+"px",width:o.width+"px",zIndex:2,transition:"opacity 0.4s",pointerEvents:this.props.hidden?"none":"all"}),Object.assign(n.loader.style,{position:"absolute",top:o.top+"px",left:o.left+"px",width:o.width+"px",height:o.height+"px",filter:"opacity(0.6)",zIndex:3,pointerEvents:"none"}),document.dispatchEvent(new Event("feaasRefresh",{bubbles:!0})))}getPlaceholder(){return this.placeholder||(this.placeholder={clipper:document.createElement("div"),positionable:document.createElement("div"),editable:Object.assign(document.createElement("div"),{className:"-feaas"}),loader:document.createElement("feaas-loader")},this.placeholder.clipper.appendChild(this.placeholder.positionable),this.placeholder.positionable.appendChild(this.placeholder.editable),this.placeholder.clipper.appendChild(this.placeholder.loader)),this.placeholder}attributeChangedCallback(e,t,r){t!==r&&("hidden"==e&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),r?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all")),super.attributeChangedCallback(e,t,r))}open(){clearTimeout(this.closing),this.removeAttribute("hidden"),this.removeAttribute("changed"),this.setLoadingState()}shouldFork(e){return null==e.forkOriginId&&null!=this.props.instance}cleanup(){var e;this.placeholder&&(null===(e=this.placeholder.clipper)||void 0===e||e.remove(),this.placeholder=null)}close(){console.log("Editor is not ready")}unfork(){console.log("Editor is not ready")}discard(){console.log("Editor is not ready")}save(){console.log("Editor is not ready")}setVersionContext(e){console.log("Editor is not ready")}setEditorContext(e){console.log("Editor is not ready")}setLoadingState(){this.showLoader(),this.setAttribute("state","loading")}setReadyState(){this.hideLoader(),this.setEditorContext({activeVersionId:this.component.versions[0].id}),this.setAttribute("state","ready")}
1render({children:e,component:t,version:r,instance:n},{Editor:i,VersionStatusList:o,VersionStatusButton:a,Version:s,VersionMenu:l,EditorUIUndo:c,EditorUIMode:d,React:{useEffect:u,useMemo:p,useState:h,useContext:m},Chakra:{HStack:f,Box:g,Button:b,MenuItem:v},Chrome:y,ReactDOM:w,useSDK:E,useLibrary:A,useSlots:C,useModelObserver:O,ConfirmationContext:S,VersionContext:j}){if(!this.payload)return;let{React:x}=this.payload,k=E(),R=A(),[N,F]=h(),{setConfirm:D}=m(S),P=n||r;N&&(this.component=N),u((()=>{if(this.props.hidden)return;let e=R.components.getItem(t).clone();return e.versions.search({ids:[r,n].filter(Boolean),componentIds:[t]}).then((t=>{e.versions.setItems(t);let i=e.findVersion(n,["staged","published"]),o=e.findVersion(r,["staged","published"]);if(i)i.deletedAt?(i.getDraft().changeAndNotify(o.toProperties()).restore(),console.error("FEAAS Editor: Restoring fork")):(console.error("FEAAS Editor: Pre-forked"),this.setAttribute("forked",i.id));else if(this.removeAttribute("forked"),this.shouldFork(o)){console.error("FEAAS Editor: Forking");let e=o.fork(n).id;this.setAttribute("instance",e)}else console.error("FEAAS Editor: Regular");F(e)})),()=>{this.closing=setTimeout((()=>{this.closing=null,this.cleanup(),F(null)}),400)}}),[r,this.props.hidden]);let T=O(null==N?void 0:N.versions,[]).filter((e=>e.id==P)),L=T[0];L&&!this.props.hidden&&(this.version=L),u((()=>(this.unfork=()=>{D({title:"Reverting component customizations",button:"Discard",body:"Are you sure to reset component to its original state? All changes will be lost.",action:()=>{let e=N.findVersion(r,["staged","published"]);N.findVersion(n).unstage().unpublish().changeAndNotify(e.toProperties()),N.saveVersions(!1),this.setVersionContext({needsWrite:!0}),this.removeAttribute("forked"),requestAnimationFrame(this.onClose)}})},this.discard=()=>{this.props.changed&&(N.findVersion(P).revert(),N.saveVersions(!1),this.setVersionContext({needsWrite:!0}))},this.close=()=>{D({title:"Component has unsaved changes",button:"Discard",body:"Are you sure to close editor and discard changes?",bypass:!this.props.changed,action:()=>{this.discard(),requestAnimationFrame(this.onClose)}})},this.save=()=>{D({bypass:!!this.props.forked,title:"Customizing component",button:"Save",body:"Changes to the component will only be visible on that page. Changes to component done in Component Builder will not be reflected here. It will be possible to revert the customization.",action:()=>{var e,t;null===(t=null===(e=N.findVersion(P).commitData({view:this.editorContext.editor.getData({rootName:P}),model:""}))||void 0===e?void 0:e.stage())||void 0===t||t.publish(),this.removeAttribute("changed"),this.setAttribute("forked",P),N.saveVersions(!1)}})},()=>{delete this.unfork,delete this.discard,delete this.save,delete this.editorContext,delete this.versionContext,delete this.setEditorContext,delete this.setVersionContext})),[N]);let M=p((()=>this.target),[N]);return p((()=>N&&C(e,(({picker:e,children:t})=>x.createElement(g,{ref:e=>{this.chrome=e?{positionable:e,wrapper:e.querySelector(".editor-chrome"),absolute:this.querySelector(".ui.overlays")}:null}},x.createElement(g,{className:"editor-wrapper",position:"absolute",left:0,top:0},x.createElement(i,{datasources:k.datasources,sdk:k,library:R,component:N,versions:T,context:{isAutosaveEnabled:!1,onChromeMeasure:this.onMeasure,onChromeBeforeMeasure:this.onBeforeMeasure,onChromeMeasureElement:this.onChromeMeasureElement,onChromePosition:this.onPosition,onContentChange:this.onContentChange}},{exports:this.onEditorStateChange,after:t,chrome:({editor:e})=>e&&x.createElement(y,null),children:({isArchivedDisplayed:e,editor:t,status:r})=>x.createElement(g,{position:"absolute",left:0,top:0,className:"editor-chrome",p:4,boxShadow:"2xl",pointerEvents:"none",opacity:0,transition:"opacity 0.3s"},x.createElement(g,{left:0,width:"4",top:0,bottom:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),x.createElement(g,{right:0,width:"4",top:0,bottom:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),x.createElement(g,{top:0,height:"16",left:0,right:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),x.createElement(g,{bottom:0,height:"4",left:0,right:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),L&&x.createElement(s,{version:L,node:M,ignoreBreakpoints:!0,deps:[this.props.forked,this.props.changed]},{exports:this.onVersionStateChange,left:x.createElement(f,{justifyContent:"space-between"},x.createElement(c,{size:"sm",editor:"ready"==r?t:null}),x.createElement(d,{size:"sm"})),middle:(e,t)=>
1[!1],right:x.createElement(x.Fragment,null,x.createElement(b,{variant:"secondary",size:"sm",onClick:this.close},"Close"),x.createElement(b,{variant:"primary",size:"sm",onClick:this.save,isDisabled:!this.props.changed},this.props.changed?this.props.forked?"Save":"Save customization":"Up to date"),x.createElement(l,{isDisabled:!this.props.forked&&!this.props.changed},x.createElement(v,{onClick:this.unfork,isDisabled:!this.props.forked},"Unfork"),x.createElement(v,{onClick:this.discard,isDisabled:!this.props.changed},"Discard")))}))})))))),[L,this.props.forked,this.props.changed])}isReadyToLoad(){return null!=this.props.component&&null!=this.props.version&&!this.props.hidden}};function Qt(e){var t,r;return{part:(null==e?void 0:e.getAttribute("part"))||"picker",slot:(null==e?void 0:e.getAttribute("part"))||"picker",mode:null==e?void 0:e.getAttribute("mode"),dialog:null==e?void 0:e.getAttribute("dialog"),placeholder:(null==e?void 0:e.getAttribute("placeholder"))||"No theme",frontend:null!==(t=null==e?void 0:e.getContextAttribute("frontend"))&&void 0!==t?t:"https://components.sitecorecloud.io",src:null!==(r=null==e?void 0:e.getAttribute("src"))&&void 0!==r?r:"/picker.js",hidden:null!=(null==e?void 0:e.getAttribute("hidden")),variant:null==e?void 0:e.getAttribute("variant"),context:void 0,onClose:void 0,setAttribute:void 0,getAttribute:void 0}}Xt.observedAttributes=["library","component","version","revision","hidden","state","changed","forked"],Xt.register("feaas-editor");var Zt=class extends rt{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return Qt(this)}load(){return this.import(this.formatURL(this.props.src,this.props.frontend))}connectedCallback(){this.setAttribute("feaas-role","ui"),super.connectedCallback()}render({placeholder:e,context:t,mode:r,dialog:n,children:i,variant:o},{Picker:a,React:s,useContext:l,EnvironmentContext:c,useLibrary:d,useSDK:u,BYOC:p}){var h,m,f;let[b,v]=s.useReducer((e=>e+1),0),y=u(),w=l(c),E=d("collections"),A=d("components"),C=u("datasources"),O=d(),S=(null===(m=null===(h=O.stylesheets)||void 0===h?void 0:h.first)||void 0===m?void 0:m.rules)||(null===(f=null==O?void 0:O.stylesheet)||void 0===f?void 0:f.styles),j=u("renderingHost.expandedComponents");var x=null==t?void 0:t.getAttribute("data");if(x)try{x=JSON.parse(x)}catch(g){}if(t)var k=y.ExternalComponent.getDefinition(t),R=k&&!k.getConfiguration(t),N="feaas"==(null==k?void 0:k.type)?A.find((e=>e.id==t.getAttribute("component"))):null==p?void 0:p.getComponent(String(t.getAttribute("data-external-id")));return s.createElement(a,{cdn:w.cdn,rules:S,collections:E,themeContext:t,placeholder:e,embed:N,externalComponents:j,datasources:C,data:x,versionId:null==t?void 0:t.getAttribute("version"),mode:r||(R?"library":N?"context":null),setAttribute:(e,t,r)=>{"data"==t&&r&&(r=JSON.stringify(r)),this.props.setAttribute(e,t,r),v()},getAttribute:(e,r)=>null==t?void 0:t.getAttribute(r),dialog:n,context:t,variant:o,onModeChange:(e,t)=>
1{this.set({mode:e,dialog:t})}},i)}};function er(e){var t,r,n,i,o;return{library:null==e?void 0:e.getAttribute("library"),src:null!==(t=null==e?void 0:e.getAttribute("src"))&&void 0!==t?t:"/context.js",environment:null!==(r=null==e?void 0:e.getAttribute("environment"))&&void 0!==r?r:void 0,frontend:null!==(n=null==e?void 0:e.getAttribute("frontend"))&&void 0!==n?n:"https://components.sitecorecloud.io",backend:null!==(i=null==e?void 0:e.getAttribute("backend"))&&void 0!==i?i:"https://components.sitecorecloud.io/api",cdn:null!==(o=null==e?void 0:e.getAttribute("cdn"))&&void 0!==o?o:"https://feaas.blob.core.windows.net",auth:null,isolate:null==(null==e?void 0:e.getAttribute("isolate"))||"true"==(null==e?void 0:e.getAttribute("isolate"))}}Zt.observedAttributes=["library","mode","frontend","src","hidden","variant","dialog"],Zt.register("feaas-picker");var tr=class extends rt{constructor(){super(...arguments),this.defaultProps={isolate:!0},this.onStatusChange=(e,t)=>{"ready"==e&&(this.whenSDKReady.resolve(t),this.dispatchEvent(new CustomEvent("feaasReady",{bubbles:!0,composed:!0,detail:t})))},this.whenSDKReady=et((e=>{this.sdk=e}))}getProps(){return er(this)}load(){return this.import(this.formatURL(this.props.src,this.props.frontend))}isReadyToLoad(){return super.isReadyToLoad()&&null!=this.props.library}getTheme(e){return e}getRoot(){return"false"===this.getAttribute("isolate")?this:this.shadowRoot||this.attachShadow({mode:"open"})}getReactRootElement(){return this.reactRootElement||(this.reactRootElement=document.createElement("div"),this.getRoot().appendChild(this.reactRootElement)),this.reactRootElement}connectedCallback(){this.setAttribute("feaas-role","ui"),Array.from(this.children).forEach((e=>{this.getRoot().appendChild(e)})),document.addEventListener("feaasMount",this),document.addEventListener("feaasUnmount",this),super.connectedCallback()}disconnectedCallback(){document.removeEventListener("feaasMount",this),document.removeEventListener("feaasUnmount",this),super.disconnectedCallback()}getPortalRoot(){return this.getRoot()}render({children:e,library:t},{AppContext:r,Chakra:{Button:n,Tooltip:i},React:o}){let a={containerRef:{current:this.getPortalRoot()}};return i.defaultProps={hasArrow:!0,placement:"top",portalProps:a},o.createElement(r,{environment:this.props.environment,backend:this.props.backend,libraryId:this.props.library,container:this.getRoot(),auth:this.props.auth,getTheme:this.getTheme,onStatusChange:this.onStatusChange,modalProps:{portalProps:a},chakraProps:{resetScope:':where([feaas-role="ui"])',cssVarsRoot:":host",resetCSS:!0,toastOptions:{portalProps:a}}},e)}};tr.observedAttributes=["library","component","version","revision","hostname","template"],tr.register("feaas-context"),tr.prototype.clientside=Ze;var rr=L;function nr(e){let t=((e={})=>Object.keys(e).reduce(((t,r)=>Object.assign(t,{[u(r)]:e[r]})),{}))(Array.from(e.attributes).reduce(((e,{name:t,value:r})=>("data-external-id"==t&&(t="component-name"),Object.assign(e,{[t]:r}))),{}));return rr(t).merged}var ir=class extends rt{load(){return Promise.resolve({React:n,ReactDOM:J})}connectedCallback(){this._setAttribute||(this._setAttribute=this.setAttribute,this.setAttribute=function(e,t){let r=this.getAttribute(t);this._setAttribute(e,t),this.attributeChangedCallback(e,r,t)}),super.connectedCallback()}update(){var e;if(null!==(e=T(this.getComponentName()))&&void 0!==e&&e.component||"false"!=this.getAttribute("hydrate"))return super.update()}render(e,{React:t}){var r;let n=null===(r=T(this.getComponentName()))||void 0===r?void 0:r.component;return n||console.warn(`FEAASExternal: \`${this.getComponentName()}\` is not registered`),t.createElement(t.Fragment,null,n&&t.createElement(n,{componentName:this.getComponentName(),...this.getProps()}))}getComponentName(){return this.getAttribute("data-external-id")}getProps(){return nr(this)}static Preview(e){var t;let r=(null==e?void 0:e.src)||("undefined"!=typeof window?null===(t=window.location.search.match(/feaasSrc=([^&]+)/))||void 0===t?void 0:t[1]:null);return r?n.createElement(ur,{src:r,...e}):null}static linkComponents(e){return()=>e.map((e=>null))}};
1ir.registered=F,ir.registerComponent=D,ir.setRegistrationCallback=M,ir.getComponent=T,ir.register("feaas-external");var{linkComponents:or}=ir,ar={};function sr(e){return null==e||!0===e?["template","stylesheet","data"]:[].concat(e||[])}function lr({data:e,lastModified:t,fetchedData:r,renderNode:i,...o}){let a;"template"in o&&o.template&&(a=Ve(o.template,r||e||{}).map(((e,t)=>cr(e,((e,t)=>{if(i){let r=null==i?void 0:i(e,t);if(null!=r&&"type"in r)return[r.type,r.props];t={...t,...r}}if(ar[e.localName])return[ar[e.localName],t];if("feaas-external"==e.localName){let e={};for(var r in t){e["data-external-id"==r?"componentName":u(r)]=t[r]}return[W,e]}}),t)))),"src"in o&&(o={...ft(o.src),...o});let s=sr(o.fetch),l=s.includes("data")?e:s.includes("template")?r||e:null;return n.createElement(n.Fragment,null,"preload"in o&&!1,n.createElement("feaas-component",{class:"-feaas",...o,"last-modified":t?String(t):null,fetch:null==o.fetch?o.fetch:[].concat(o.fetch).join(" "),suppressHydrationWarning:!0,template:null,data:"string"==typeof l?l:l?JSON.stringify(l):null},a))}function cr(e,t,r){var i;if(3===e.nodeType)return e.textContent;let o=Array.from(e.childNodes).map(((e,r)=>cr(e,t,r))),a={};for(let n=0;n<e.attributes.length;n++){let{name:t,value:r}=e.attributes[n];"style"==t?a[t]=String(r||"").trim().split(/\s*;\s*/).reduce(((e,t)=>{let[r,n]=t.split(":");return{...e,[u(r)]:n}}),{}):"class"==t?a.className=r:a[t]=r}let s=null==t?void 0:t(e,a),l=(null==s?void 0:s[0])||e.nodeName.toLowerCase();"style"==l&&(a.dangerouslySetInnerHTML={__html:o.join("\n")});let c=Object.assign({key:r,suppressHydrationWarning:!0},(null==s?void 0:s[1])||a),d=(null===(i=null==s?void 0:s[1])||void 0===i?void 0:i.children)||o;return n.createElement(l,c,["img","br","input","style"].includes(l)?null:d)}var dr=W,ur=lr;const pr=e=>{var t,r,i,o,a,l,c;const d=(null===(t=e.params)||void 0===t?void 0:t.ComponentRevision)||e.revisionFallback;if(!e.template&&(!e.params||!e.params.LibraryId||!e.params.ComponentId||!e.params.ComponentVersion||!e.params.ComponentHostName||!d))return null;const u=Object.assign(Object.assign({},e.fetchedData),{_:(0,s.q1)(null!==(r=e.fields)&&void 0!==r?r:{})});return n.createElement(ur,{data:u,template:e.template,cdn:null===(i=e.params)||void 0===i?void 0:i.ComponentHostName,library:null===(o=e.params)||void 0===o?void 0:o.LibraryId,version:null===(a=e.params)||void 0===a?void 0:a.ComponentVersion,component:null===(l=e.params)||void 0===l?void 0:l.ComponentId,instance:null===(c=e.params)||void 0===c?void 0:c.ComponentInstanceId,revision:d,fetch:[]})};const hr=e=>{var t,r;const i=`component feaas ${null===(t=e.params)||void 0===t?void 0:t.styles}`.trimEnd(),o=null===(r=e.params)||void 0===r?void 0:r.RenderingIdentifier;return n.createElement("div",{className:i,id:o||void 0},n.createElement("div",{className:"component-content"},n.createElement(pr,Object.assign({},e))))};const mr=e=>{var t;return n.createElement("div",null,"A rendering error occurred: ",null===(t=e.error)||void 0===t?void 0:t.message,".")};class fr extends n.Component{constructor(e){super(e),this.state={}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e){this.setState({error:e})}render(){var e,t,r;const i=this.props;if(this.state.error)return this.props.errorComponent?n.createElement(this.props.errorComponent,{error:this.state.error}):n.createElement(mr,{error:this.state.error});const{ComponentName:o}=i.params||{};if(!o){const e={errorOverride:"BYOC: The ComponentName for this rendering is missing"};return i.missingComponentComponent?n.createElement(this.props.missingComponentComponent,Object.assign({},e)):n.createElement(a,Object.assign({},e))}const l={rendering:{componentName:o},errorOverride:"BYOC: This component was not registered."},c=this.props.missingComponentComponent?n.createElement(this.props.missingComponentComponent,Object.assign({},l)):n.createElement(a,Object.assign({},l)),d=this.props.errorComponent;let u={};if(null===(e=i.params)||void 0===e?void 0:e.ComponentProps)try{u=null!==(t=JSON.parse(i.params.ComponentProps))&&void 0!==t?t:{}}catch(h){return console.error(`Parsing props for ${o} component from rendering params failed. Error: ${h}`),d?n.createElement(d,{error:h}):n.createElement(mr,{error:h})}const p=Object.assign(Object.assign({},i.fetchedData),{_:(0,s.q1)(null!==(r=i.fields)&&void 0!==r?r:{})});return n.createElement(dr,Object.assign({componentName:o,clientFallback:c,datasources:p},u))}}const gr=e=>{var t,r,i;const o=null===(r=null===(t=e.params)||void 0===t?void 0:t.styles)||void 0===r?void 0:r.trimEnd(),a=null===(i=e.params)||void 0===i?void 0:i.RenderingIdentifier;return n.createElement("div",{className:o||void 0,id:a||void 0},n.createElement("div",{className:"component-content"},n.createElement(fr,Object.assign({},e))))};var br=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};class vr extends n.Component{constructor(e){super(e),this.nodeRefs=[],this.state={},this.addRef=this.addRef.bind(this),this.updateKeyAttributes=this.updateKeyAttributes.bind(this),this.createRawElement=this.createRawElement.bind(this)}static getPlaceholderDataFromRenderingData(e,t){let r;return(null===e||void 0===e?void 0:e.placeholders)&&Object.keys(e.placeholders).forEac
1h((r=>{const n=-1!==r.indexOf("{*}")?new RegExp(`^${r.replace(/\{\*\}+/i,"\\d+")}$`):null;n&&n.test(t)&&(e.placeholders[t]=e.placeholders[r],delete e.placeholders[r])})),r=e&&e.placeholders&&Object.keys(e.placeholders).length>0?e.placeholders[t]:null,r||(console.warn(`Placeholder '${t}' was not found in the current rendering data`,JSON.stringify(e,null,2)),[])}componentDidMount(){this.updateKeyAttributes()}componentDidUpdate(){this.updateKeyAttributes()}componentDidCatch(e){this.setState({error:e})}getSXAParams(e){return e.params?e.params.FieldNames&&{styles:`${e.params.GridParameters||""} ${e.params.Styles||""}`}:{}}getComponentsForRenderingData(e){const t=this.props,{name:r,fields:i,params:o,missingComponentComponent:s,hiddenRenderingComponent:l}=t,d=br(t,["name","fields","params","missingComponentComponent","hiddenRenderingComponent"]);return e.map(((e,t)=>{const u={key:e.uid?e.uid:`component-${t}`};if(!e.componentName&&e.name)return this.createRawElement(e,u);const p=e;let h;h="Hidden Rendering"===p.componentName?null!==l&&void 0!==l?l:c:p.componentName?this.getComponentForRendering(p):()=>n.createElement(n.Fragment,null),h||("FEaaSComponent"===p.componentName?h=pr:"FEaaSWrapper"===p.componentName?h=hr:"BYOCComponent"===p.componentName?h=fr:"BYOCWrapper"===p.componentName&&(h=gr)),h||(console.error(`Placeholder ${r} contains unknown component ${p.componentName}. Ensure that a React component exists for it, and that it is registered in your componentFactory.js.`),h=null!==s&&void 0!==s?s:a);const m=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},u),d),(i||p.fields)&&{fields:Object.assign(Object.assign({},i),p.fields)}),(o||p.params)&&{params:Object.assign(Object.assign(Object.assign({},o),p.params),this.getSXAParams(p))}),{rendering:p});return n.createElement(h,this.props.modifyComponentProps?this.props.modifyComponentProps(m):m)})).filter((e=>e))}getComponentForRendering(e){var t;const r=this.props.componentFactory;return r&&"function"===typeof r?(null===(t=e.params)||void 0===t?void 0:t.FieldNames)?r(e.componentName,e.params.FieldNames):r(e.componentName):(console.warn(`No componentFactory was available to service request for component ${e}`),null)}addRef(e){this.nodeRefs.push(e)}createRawElement(e,t){if(!e.name)return console.error('"elem.name" is undefined in "createRawElement". Something is likely wrong with your component data. Ensure that your components have a name.'),null;const r=(0,s.f_)(e.attributes),i=Object.assign(Object.assign(Object.assign({},t),r),{dangerouslySetInnerHTML:e.contents?{__html:e.contents}:void 0});return!Array.isArray(r)&&r&&"placeholder"===r.chrometype&&(i.phkey=e.attributes.key,i.ref=this.addRef),n.createElement(e.name,i)}updateKeyAttributes(){this.nodeRefs&&this.nodeRefs.forEach((e=>{if(e&&e.getAttribute){const t=e.getAttribute("phkey");t&&e.setAttribute("key",t)}}))}}vr.propTypes={rendering:o().oneOfType([o().object,o().object]).isRequired,fields:o().objectOf(o().oneOfType([o().object,o().object]).isRequired),params:o().objectOf(o().string.isRequired),missingComponentComponent:o().oneOfType([o().object,o().func]),hiddenRenderingComponent:o().oneOfType([o().object,o().func]),errorComponent:o().oneOfType([o().object,o().func]),modifyComponentProps:o().func};var yr=r(32121);var wr=r(99940);class Er extends vr{constructor(e){super(e),this.isEmpty=!1}componentDidMount(){super.componentDidMount(),this.isEmpty&&wr.HorizonEditor.isActive()&&wr.HorizonEditor.resetChromes()}renderEmptyPlaceholder(e){return n.createElement("div",{className:"sc-jss-empty-placeholder"},e)}render(){const e=Object.assign({},this.props);if(delete e.componentFactory,this.state.error)return e.errorComponent?n.createElement(e.errorComponent,{error:this.state.error}):n.createElement("div",{className:"sc-jss-placeholder-error"},"A rendering error occurred: ",this.state.error.message,".");const t=e.rendering,r=vr.getPlaceholderDataFromRenderingData(t,this.props.name),i=this.getComponentsForRenderingData(r);if(this.isEmpty=r.every((e=>function(e){return!e.componentName&&void 0!==e.name}(e))),this.props.renderEmpty&&this.isEmpty){const e=this.props.renderEmpty(i);return i.length?this.renderEmptyPlaceholder(e):e}if(i.length&&this.isEmpty)return this.renderEmptyPlaceholder(i);if(this.props.render)return this.props.render(i,r,e);if(this.props.renderEach){const e=this.props.renderEach;return i.map(((t,r)=>t&&t.props&&"text/sitecore"===t.props.type?t:e(t,r)))}return i}}
1Er.propTypes=vr.propTypes;const Ar=function(e){function t(t){const r=(0,n.useContext)(yr.Gu);return n.createElement(e,Object.assign({},t,{componentFactory:t.componentFactory||r}))}return t.displayName=`withComponentFactory(${e.displayName||e.name||"Anonymous"})`,t}(Er)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.