@sitecore-feaas/clientside 0.6.3-alpha.2 → 0.6.3-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- var _e=Object.defineProperty;var Q=(t,e)=>{for(var r in e)_e(t,r,{get:e[r],enumerable:!0})};var Ht={};Q(Ht,{Component:()=>st,ComponentProps:()=>fe,Context:()=>j,ControlledPromise:()=>S,DEFAULT_CDN_URL:()=>N,DOM:()=>gt,DataPath:()=>mt,DataScope:()=>pt,DataSettings:()=>w,Element:()=>E,FEAASComponent:()=>st,FEAASComponentsProps:()=>fe,FEAASContext:()=>j,FEAASContextProps:()=>Se,FEAASEditor:()=>lt,FEAASEditorProps:()=>Ce,FEAASElement:()=>E,FEAASLoader:()=>at,FEAASLoaderProps:()=>me,FEAASPicker:()=>dt,FEAASPickerProps:()=>xe,FEAASStylesheet:()=>Et,FEAASStylesheetProps:()=>ge,InvalidResponse:()=>vt,JSONPath:()=>m,Loader:()=>at,MyComponent:()=>ut,Picker:()=>dt,Stylesheet:()=>Et,Thumbnail:()=>wt,WebComponent:()=>Vt,adjustNumbers:()=>Qt,autoloadScripts:()=>Gt,cleanCollectionBit:()=>tt,clearFetchCache:()=>Me,createStylesheet:()=>he,customizeDataSettings:()=>Ge,fetchAndRevalidate:()=>rt,fetchAndRevalidateComponent:()=>V,fetchAndRevalidateStylesheet:()=>bt,fetchBypassingCache:()=>yt,fetchCache:()=>et,fetchComponent:()=>$e,fetchData:()=>It,fetchToValidateCache:()=>it,fetchWithCacheAwareness:()=>I,findStylesheet:()=>ce,getComponent:()=>qe,getComponentSource:()=>De,getComponentURL:()=>Lt,getFetchCache:()=>le,getFramePosition:()=>we,getHumanizedLabel:()=>Zt,getLastPathBit:()=>te,getQualifier:()=>Yt,getStylesheetSource:()=>Le,getStylesheetURL:()=>ot,loadScript:()=>Z,loadStylesheet:()=>At,loadStylesheetAllowStale:()=>$t,normalizeCollectionScope:()=>ft,observeDOMElement:()=>qt,parseComponentSource:()=>nt,parseLimit:()=>Kt,parseRange:()=>Xt,parseStylesheetSource:()=>z,queryObject:()=>H,queryObjectRaw:()=>Ot,queryScopes:()=>B,registerComponent:()=>Je,registerDatasource:()=>Ve,renderComponent:()=>Ft,renderComponentElement:()=>Ie,renderComponentPromise:()=>ue,renderDOMContent:()=>U,renderDOMElement:()=>R,renderHTMLContent:()=>se,renderStylesheet:()=>Fe,renderStylesheetPromise:()=>de,serializeCH1RichText:()=>F,setDOMAttribute:()=>D});function S(t,e=r=>{}){var r;let i=()=>{var n,o;let s=new Promise((l,d)=>{n=h=>{t==null||t(h),l(h)},o=d});var a=Object.assign(s,{resolve:n,reject:o,restart:i,first:r});return r=a,a.catch(e),a};return i()}var Vt=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,E=class extends Vt{getProps(e){return{}}constructor(){super(),this.defaultProps={},this.connected=!1,this.refs={},this.descendants=[],this.whenLoaded=S(e=>{this.payload=e}),this.whenRendered=S(()=>this.initialized=!0,()=>this.cancelRender()),this.addEventListener("feaasMount",this),this.addEventListener("feaasUnmount",this)}getRoot(){return this}attributeChangedCallback(e,r,i){this.set()}connectedCallback(){this.mount()}disconnectedCallback(){this.unmount()}mount(){try{console.log("hello in here");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(r=>{var i;return(i=r.mount)===null||i===void 0?void 0:i.call(r)}),this.set()}catch(e){this.onError(e)}}dispatchEventIndirectly(e){this.dispatchEvent(e);let r=this.getParent();r&&!r.contains(this)&&(Object.defineProperty(e,"target",{value:this,writable:!1}),Object.defineProperty(e,"composedPath",{value:()=>[this],writable:!1}),r.handleEvent(e))}isJSONAttribute(e){return!1}log(...e){let r=e[0];(typeof location!="undefined"&&(location!=null&&location.hostname.startsWith("components-"))||localStorage["Sitecore.Components.Debug"])&&console.log(r+" "+e.slice(1).map(i=>i&&typeof i=="object"?"%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 r=this;r=r.parentElement||(r.parentNode instanceof ShadowRoot?r.parentNode.host:null);)if(!e||r.tagName.startsWith("FEAAS-"))return r;if(this.tagName!="FEAAS-CONTEXT")return document.querySelector("feaas-context")}getElements(e=this.getRoot(),r=!0){return Array.from(e.querySelectorAll("*")).map(i=>[!r||i.tagName.startsWith("FEAAS-")?i:null,i.shadowRoot?this.getElements(i.shadowRoot,r):null]).flat().filter(Boolean)}handleEvent(e){let r=e.composedPath()[0];switch(e.type){case"feaasMount":r!=this&&this.nestedCallback(r);break;case"feaasUnmount":r!=this&&this.unnestedCallback(r);break}}unnestedCallback(e){let r=this.descendants.indexOf(e);r!=-1&&(this.log("FEAAS: Unnest",this,e),this.descendants.splice(r,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 r,i;if(this.descendants.indexOf(e)==-1&&(this.descendants.push(e),this.log("FEAAS: Nest",this,e),this.refs[e.getComponentName()]=e,e.refs.top=this,(r=e.refs).parent||(r.parent=this),e.render))for(var o=e.refs.parent;o;o=o.refs.parent)o.render&&((i=e.refs).parentReact||(i.parentReact=o),e.refs.topReact=o)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return this.payload===void 0&&this.getAttribute("hidden")==null}onError(e,r="uncaught",i=!1){let n=new CustomEvent("feaasError",{bubbles:!0,composed:!0,detail:e});if(this.dispatchEventIndirectly(n),this.whenLoaded.reject(e),!n.defaultPrevented&&!i){this.whenRendered.reject(e);try{this.unmount()}catch(o){}return!0}return!1}shouldUpdateOnLoad(){return!0}async advance(){try{if(this.payload===void 0){if(!this.isReadyToLoad())return;this.payload=null,this.dispatchEventIndirectly(new Event("feaasLoad",{bubbles:!0,composed:!0}));let e=await this.load().catch(r=>{throw this.payload=void 0,r});if(this.whenLoaded.resolve(e),this.onLoad)return}else if(this.payload==null)return;this.flush(),this.whenRendered.resolve(this)}catch(e){this.onError(e)}}flush(){var e,r;if(!this.connected)return;let i=(r=(e=this.payload)===null||e===void 0?void 0:e.ReactDOM)===null||r===void 0?void 0:r.flushSync;i?i(()=>this.update()):this.update()}load(){return Promise.resolve(null)}update(){var e,r,i;if(this.payload==null||!this.render)return;let{React:n,ReactDOM:o,ReactDOMClient:s}=this.payload||{};if(!n)throw new Error(`${this.tagName}: React is not present in payload`);if(!o)throw new Error(`${this.tagName}: ReactDOM is not present in payload`);this.getAttribute("hydrate")=="false"&&this.firstElementChild||(!this.refs.topReact&&!this.forceUpdateReact?(this.reactRoot||(this.reactRoot=s.createRoot(this.getReactRootElement())),this.reactRoot.render(this.getReactElement())):this.forceUpdateReact&&this.connected?(e=this.forceUpdateReact)===null||e===void 0||e.call(this):(i=(r=this.refs.topReact)===null||r===void 0?void 0:r.forceUpdateReact)===null||i===void 0||i.call(r))}invokeReactRendering(){let{React:e,ReactDOM:r}=this.payload||{};if(!this.connected)return null;let i=this.descendants.filter(n=>n.refs.parentReact==this&&n.payload&&n.connected).map((n,o)=>this.getReactElement(n));return this.render({...this.props,children:i},this.payload)}getReactErrorBoundary(e=this,r=e.tagName){if(this.reactErrorBoundary)return this.reactErrorBoundary;let{React:i,ReactDOM:n}=e.payload||{};return this.reactErrorBoundary||(this.reactErrorBoundary=class extends i.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromError(s){return{error:s}}componentDidCatch(s,a){console.error(`FEAAS: ${e.tagName} Error:`,s,a),e.onError(s,"react")}render(){if(!this.state.error)return this.props.children}})}getReactElement(e=this,r){let{React:i,ReactDOM:n}=e.payload||{},o=this.getReactErrorBoundary(),s=this.getReactWrapper(e);return i.createElement(o,{key:e.tagName+"-"+e.getUID(),slot:e.getAttribute("slot")},i.createElement(s,null))}getReactWrapper(e=this,r=e.tagName){if(e.reactWrapper)return e.reactWrapper;let{React:i,ReactDOM:n}=e.payload||{};return e.reactWrapper=o=>{if(e.render){let[s,a]=i.useReducer(l=>l+1,0);return e.forceUpdateReact=a,n.createPortal(i.createElement(i.Fragment,null,e.invokeReactRendering()),e.getReactRootElement())}else return e.update()},Object.assign(e.reactWrapper,{key:e.tagName+"-"+e.getUID(),displayName:r}),e.reactWrapper}getUID(){return this.uid||(this.uid=String(Math.random()))}getShadowRoot(){return this.shadowRoot||this.attachShadow({mode:"open"}),this.shadowRoot}getReactRootElement(){return this.useShadowRoot?this.getShadowRoot():this.getRoot()}set(e){try{this.scheduleRender(),this.overrides={...this.overrides,...e},this.props={...this.getProps(),...this.overrides};for(var r in this.props){let n=this.isJSONAttribute(r),o=this.props[r],s=n?JSON.stringify(o):String(o),a=this.defaultProps[r],l=n?JSON.stringify(a):String(a),d=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),h=this.getAttribute(d);try{var i=n?JSON.stringify(JSON.parse(h)):h}catch(f){var i=null}o==null||s===l?this.removeAttribute(d):(typeof o=="string"||typeof o=="number"||typeof o=="boolean"||n)&&i!=s&&this.setAttribute(d,s)}}catch(n){this.whenRendered.reject(n),this.onError(n,"set")}return this}import(e){return import( /*@vite-ignore*/ /* webpackIgnore: true */ e)}scheduleRender(){this.nextRender==null&&(this.whenRendered=this.whenRendered.restart()),this.cancelRender(),this.nextRender=requestAnimationFrame(()=>{this.nextRender=null,this.advance().catch(e=>{})})}cancelRender(){cancelAnimationFrame(this.nextRender)}formatURL(e,r){return typeof e=="string"&&e.match(/^\/[^\/]/)?r+e:e}getContextAttribute(e,r=this){for(var i=this;i=i.parentElement||(i.parentNode instanceof ShadowRoot?i.parentNode.host:null);)if(i.getAttribute(e)!=null)return i.getAttribute(e);return this.getAttribute(e)}static register(e,r){r==null&&(r=typeof window!="undefined"?window:null),r&&!r.customElements.get(e)&&r.customElements.define(e,this)}};var W=class extends E{load(){return Promise.all([import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react"),import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react-dom"),import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react-dom/client")]).then(([e,r,i])=>({React:e,ReactDOM:r,ReactDOMClient:i}))}render({},{React:e}){return e.createElement(e.Fragment,null)}},ut=class extends W{constructor(){super(...arguments),this.useShadowRoot=!0}getProps(){return{counter:parseFloat(this.getAttribute("counter"))}}render({counter:e},{React:r}){let[i,n]=r.useState(0);return r.useEffect(()=>{n(o=>o+1)},[e]),r.createElement(r.Fragment,null,r.createElement("p",null,"Rendering attribute: ",e),r.createElement("p",null,"Triggered updates: ",i))}};ut.observedAttributes=["counter"];var gt={};Q(gt,{renderDOMContent:()=>U,renderDOMElement:()=>R,renderHTMLContent:()=>se,setDOMAttribute:()=>D});var pt={};Q(pt,{JSONPath:()=>m,queryObject:()=>H,queryObjectRaw:()=>Ot,queryScopes:()=>B,serializeCH1RichText:()=>F});import ke from"vm";var{hasOwnProperty:x}=Object.prototype;function $(t,e){return t=t.slice(),t.push(e),t}function Nt(t,e){return e=e.slice(),e.unshift(t),e}var Tt=class extends Error{constructor(e){super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),this.avoidNew=!0,this.value=e,this.name="NewError"}};function m(t,e,r,i,n){if(!(this instanceof m))try{return new m(t,e,r,i,n)}catch(s){if(!s.avoidNew)throw s;return s.value}typeof t=="string"&&(n=i,i=r,r=e,e=t,t=null);let o=t&&typeof t=="object";if(t=t||{},this.json=t.json||r,this.path=t.path||e,this.resultType=t.resultType||"value",this.flatten=t.flatten||!1,this.wrap=x.call(t,"wrap")?t.wrap:!0,this.sandbox=t.sandbox||{},this.preventEval=t.preventEval||!1,this.parent=t.parent||null,this.parentProperty=t.parentProperty||null,this.callback=t.callback||i||null,this.otherTypeCallback=t.otherTypeCallback||n||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},t.autostart!==!1){let s={path:o?t.path:e};o?"json"in t&&(s.json=t.json):s.json=r;let a=this.evaluate(s);if(!a||typeof a!="object")throw new Tt(a);return a}}m.prototype.evaluate=function(t,e,r,i){let n=this.parent,o=this.parentProperty,{flatten:s,wrap:a}=this;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=i||this.otherTypeCallback,e=e||this.json,t=t||this.path,t&&typeof t=="object"&&!Array.isArray(t)){if(!t.path&&t.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!x.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:e}=t),s=x.call(t,"flatten")?t.flatten:s,this.currResultType=x.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=x.call(t,"sandbox")?t.sandbox:this.currSandbox,a=x.call(t,"wrap")?t.wrap:a,this.currPreventEval=x.call(t,"preventEval")?t.preventEval:this.currPreventEval,r=x.call(t,"callback")?t.callback:r,this.currOtherTypeCallback=x.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,n=x.call(t,"parent")?t.parent:n,o=x.call(t,"parentProperty")?t.parentProperty:o,t=t.path}if(n=n||null,o=o||null,Array.isArray(t)&&(t=m.toPathString(t)),!t&&t!==""||!e)return;let l=m.toPathArray(t);l[0]==="$"&&l.length>1&&l.shift(),this._hasParentSelector=null;let d=this._trace(l,e,["$"],n,o,r).filter(function(h){return h&&!h.isParentSelector});return d.length?!a&&d.length===1&&!d[0].hasArrExpr?this._getPreferredOutput(d[0]):d.reduce((h,f)=>{let p=this._getPreferredOutput(f);return s&&Array.isArray(p)?h=h.concat(p):h.push(p),h},[]):a?[]:void 0};m.prototype._getPreferredOutput=function(t){let e=this.currResultType;switch(e){case"all":{let r=Array.isArray(t.path)?t.path:m.toPathArray(t.path);return t.pointer=m.toPointer(r),t.path=typeof t.path=="string"?t.path:m.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[e];case"path":return m.toPathString(t[e]);case"pointer":return m.toPointer(t.path);default:throw new TypeError("Unknown result type")}};m.prototype._handleCallback=function(t,e,r){if(e){let i=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:m.toPathString(t.path),e(i,r,t)}};m.prototype._trace=function(t,e,r,i,n,o,s,a){let l;if(!t.length)return l={path:r,value:e,parent:i,parentProperty:n,hasArrExpr:s},this._handleCallback(l,o,"value"),l;let d=t[0],h=t.slice(1),f=[];function p(c){Array.isArray(c)?c.forEach(u=>{f.push(u)}):f.push(c)}if((typeof d!="string"||a)&&e&&x.call(e,d))p(this._trace(h,e[d],$(r,d),e,d,o,s));else if(d==="*")this._walk(e,c=>{p(this._trace(h,e[c],$(r,c),e,c,o,!0,!0))});else if(d==="..")p(this._trace(h,e,r,i,n,o,s)),this._walk(e,c=>{typeof e[c]=="object"&&p(this._trace(t.slice(),e[c],$(r,c),e,c,o,!0))});else{if(d==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:h,isParentSelector:!0};if(d==="~")return l={path:$(r,d),value:n,parent:i,parentProperty:null},this._handleCallback(l,o,"property"),l;if(d==="$")p(this._trace(h,e,r,null,null,o,s));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(d))p(this._slice(d,h,e,r,i,n,o));else if(d.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");let c=d.replace(/^\?\((.*?)\)$/u,"$1");this._walk(e,u=>{this._eval(c,e[u],u,r,i,n)&&p(this._trace(h,e[u],$(r,u),e,u,o,!0))})}else if(d[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");p(this._trace(Nt(this._eval(d,e,r[r.length-1],r.slice(0,-1),i,n),h),e,r,i,n,o,s))}else if(d[0]==="@"){let c=!1,u=d.slice(1,-2);switch(u){case"scalar":(!e||!["object","function"].includes(typeof e))&&(c=!0);break;case"boolean":case"string":case"undefined":case"function":typeof e===u&&(c=!0);break;case"integer":Number.isFinite(e)&&!(e%1)&&(c=!0);break;case"number":Number.isFinite(e)&&(c=!0);break;case"nonFinite":typeof e=="number"&&!Number.isFinite(e)&&(c=!0);break;case"object":e&&typeof e===u&&(c=!0);break;case"array":Array.isArray(e)&&(c=!0);break;case"other":c=this.currOtherTypeCallback(e,r,i,n);break;case"null":e===null&&(c=!0);break;default:throw new TypeError("Unknown value type "+u)}if(c)return l={path:r,value:e,parent:i,parentProperty:n},this._handleCallback(l,o,"value"),l}else if(d[0]==="`"&&e&&x.call(e,d.slice(1))){let c=d.slice(1);p(this._trace(h,e[c],$(r,c),e,c,o,s,!0))}else if(d.includes(",")){let c=d.split(",");for(let u of c)p(this._trace(Nt(u,h),e,r,i,n,o,!0))}else!a&&e&&x.call(e,d)&&p(this._trace(h,e[d],$(r,d),e,d,o,s,!0))}if(this._hasParentSelector)for(let c=0;c<f.length;c++){let u=f[c];if(u&&u.isParentSelector){let b=this._trace(u.expr,e,u.path,i,n,o,s);if(Array.isArray(b)){f[c]=b[0];let A=b.length;for(let g=1;g<A;g++)c++,f.splice(c,0,b[g])}else f[c]=b}}return f};m.prototype._walk=function(t,e){if(Array.isArray(t)){let r=t.length;for(let i=0;i<r;i++)e(i)}else t&&typeof t=="object"&&Object.keys(t).forEach(r=>{e(r)})};m.prototype._slice=function(t,e,r,i,n,o,s){if(!Array.isArray(r))return;let a=r.length,l=t.split(":"),d=l[2]&&Number.parseInt(l[2])||1,h=l[0]&&Number.parseInt(l[0])||0,f=l[1]&&Number.parseInt(l[1])||a;h=h<0?Math.max(0,h+a):Math.min(a,h),f=f<0?Math.max(0,f+a):Math.min(a,f);let p=[];for(let c=h;c<f;c+=d)this._trace(Nt(c,e),r,i,n,o,s,!0).forEach(b=>{p.push(b)});return p};m.prototype._eval=function(t,e,r,i,n,o){this.currSandbox._$_parentProperty=o,this.currSandbox._$_parent=n,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=e;let s=t.includes("@path");s&&(this.currSandbox._$_path=m.toPathString(i.concat([r])));let a="script:"+t;if(!m.cache[a]){let l=t.replace(/@parentProperty/gu,"_$_parentProperty").replace(/@parent/gu,"_$_parent").replace(/@property/gu,"_$_property").replace(/@root/gu,"_$_root").replace(/@([.\s)[])/gu,"_$_v$1");s&&(l=l.replace(/@path/gu,"_$_path")),m.cache[a]=new this.vm.Script(l)}try{return m.cache[a].runInNewContext(this.currSandbox)}catch(l){throw new Error("jsonPath: "+l.message+": "+t)}};m.cache={};m.toPathString=function(t){let e=t,r=e.length,i="$";for(let n=1;n<r;n++)/^(~|\^|@.*?\(\))$/u.test(e[n])||(i+=/^[0-9*]+$/u.test(e[n])?"["+e[n]+"]":"['"+e[n]+"']");return i};m.toPointer=function(t){let e=t,r=e.length,i="";for(let n=1;n<r;n++)/^(~|\^|@.*?\(\))$/u.test(e[n])||(i+="/"+e[n].toString().replace(/~/gu,"~0").replace(/\//gu,"~1"));return i};m.toPathArray=function(t){let{cache:e}=m;if(e[t])return e[t].concat();let r=[],n=t.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu,";$&;").replace(/[['](\??\(.*?\))[\]']/gu,function(o,s){return"[#"+(r.push(s)-1)+"]"}).replace(/\[['"]([^'\]]*)['"]\]/gu,function(o,s){return"['"+s.replace(/\./gu,"%@%").replace(/~/gu,"%%@@%%")+"']"}).replace(/~/gu,";~;").replace(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu,";").replace(/%@%/gu,".").replace(/%%@@%%/gu,"~").replace(/(?:;)?(\^+)(?:;)?/gu,function(o,s){return";"+s.split("").join(";")+";"}).replace(/;;;|;;/gu,";..;").replace(/;$|'?\]|'$/gu,"").split(";").map(function(o){let s=o.match(/#(\d+)/u);return!s||!s[1]?o:r[s[1]]});return e[t]=n,e[t].concat()};m.prototype.vm=ke;function Ot(t,e){try{return m({path:e,json:t})}catch(r){return[]}}function H(t,e,r=!0){let i=Ot(t,e)||[];return r?i.flat(1/0):i}function B(t,e,r=!1,i=t,n=!0){var o=e;let s=Object.keys(t).sort((l,d)=>d.length-l.length);for(let l of s)if(e.startsWith(l)){if(l==e){if(r)return t[l];continue}o=e.substring(l.length+1),i=t[l];break}var a=H(i,o,n);return a.length==0&&(a=[o.replace(/^.*?\./,"_."),o.replace(/^.*?\./,""),o.replace(/^([^.]+).*?\.\$([\.\[])/,"$1$2"),o.replace(/^.*?\.\$([\.\[])/,"_$1"),o.replace(/^.*?\.\$([\.\[])/,"$$$1"),o.replace(/^[^.]+$/,"_")].filter((l,d,h)=>h.indexOf(l)===d).reduce((l,d)=>l.length>0?l:H(i,d,n),[])),r?a[0]:a}function Pt(t,e={},r){return r?`<${r}${Object.entries(e).map(([i,n])=>n!=null&&` ${i}="${n}"`).filter(Boolean).join("")}>${F(t)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):F(t)}function F(t){var e;if(Array.isArray(t))return t.map(F).join(`
2
- `).trim();if(typeof t=="string")return t;if(t==null)return"";switch(t.type){case"heading":let{level:r,...i}=t.attrs;return Pt(t.content,i,"h"+r);case"text":return(t.marks||[]).reduce((n,o)=>Pt(n,o.attrs,{link:"a",bold:"strong",italic:"em",strike:"s",underline:"u"}[o.type]),(e=t.text)===null||e===void 0?void 0:e.replace(/\s+/," "));default:return Pt(t.content||t.text,t.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[t.type])}}var M=class{constructor(e,r=1,i){this.ownerDocument={createElement(n){return new M(n)},createDocumentFragment(){return new M(null,11)}},this.nodeName=e,this.nodeType=r,this.textContent=i,this.attributes=[],this.childNodes=[]}setAttribute(e,r){let i=this.attributes.find(n=>n.name===e);i?i.value=r:this.attributes.push({name:e,value:r})}getAttribute(e){let r=this.attributes.find(i=>i.name===e);return r?r.value:void 0}insertBefore(e,r){if(e.parentNode=this,r===null)this.childNodes.push(e);else{let i=this.childNodes.indexOf(r);i!==-1&&this.childNodes.splice(i,0,e)}}removeAttribute(e){let r=this.attributes.findIndex(i=>i.name===e);r!==-1&&this.attributes.splice(r,1)}appendChild(e){e.parentNode=this,this.childNodes.push(e)}get tagName(){var e;return(e=this.nodeName)===null||e===void 0?void 0:e.toUpperCase()}get localName(){var e;return(e=this.nodeName)===null||e===void 0?void 0:e.toLowerCase()}get innerHTML(){return Mt(this.childNodes)}set innerHTML(e){this.childNodes=Dt(String(e!=null?e:""))}get outerHTML(){return Mt([this])}get children(){return this.childNodes.filter(e=>e.nodeType==1)}closest(e){let r=this;for(;r;){if(Jt(e,r))return r;r=r.parentNode}return null}querySelectorAll(e){let r=e.split(/\s*,\s*/),i=[],n=o=>{for(let s of r)if(Jt(s,o)){i.push(o);break}for(let s of o.childNodes)n(s)};for(let o of this.childNodes)n(o);return i}querySelector(e){return this.querySelectorAll(e)[0]}findSibling(e,r){if(!this.parentNode)return null;let i=this.parentNode.childNodes,n=i.indexOf(this);if(n===-1)return null;for(let o=n+e;o>=0&&o<i.length;o+=e){let s=i[o];if(!r||s.nodeType===1)return s}return null}removeChild(e){let r=this.childNodes.indexOf(e);if(r!==-1)return this.childNodes.splice(r,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 r=new M(this.nodeName,this.nodeType);if(r.attributes=JSON.parse(JSON.stringify(this.attributes)),this.textContent&&(r.textContent=this.textContent),e)for(let i of this.childNodes){let n=i.cloneNode(!0);r.appendChild(n)}return r}get parentElement(){var e;return((e=this.parentNode)===null||e===void 0?void 0:e.nodeType)==1?this.parentNode:null}};function Jt(t,e){let r=t.match(/([.#]?[\w-]+|\[([\w-]+)(="([^"]*)")?\])/g);if(!r)return!1;for(let i of r)if(i.startsWith("#")){if(e.getAttribute("id")!==i.slice(1))return!1}else if(i.startsWith(".")){if(!(e.getAttribute("class")||"").split(" ").includes(i.slice(1)))return!1}else if(i.startsWith("[")){let n=i.match(/^\[([\w-]+)(="([^"]*)")?\]$/);if(n){let o=n[1],s=n[3],a=e.getAttribute(o);if(typeof s=="undefined"){if(a===void 0)return!1}else if(a!==s)return!1}else return!1}else if(e.nodeName!==i)return!1;return!0}function Dt(t){var e;let r=[],i=[];for(;t;){let n=t.match(/^<([\w-]+)(\s[^>]*)?>/),o=t.match(/^<\/([\w-]+)>/);if(n){let s=n[1].toLowerCase(),l=((e=(n[2]||"").match(/([\w-]+)(="([^"]*)")?/g))===null||e===void 0?void 0:e.map(h=>{let[f,p,,c]=h.match(/([\w-]+)(="([^"]*)")?/);return{name:p,value:Te(c||"")}}))||[],d=new M(s,1);if(d.attributes=l,i.length>0){let h=i[i.length-1];h.childNodes.push(d),d.parentNode=h}else r.push(d);["img","input","br"].includes(s)||i.push(d),t=t.slice(n[0].length)}else if(o)i.pop(),t=t.slice(o[0].length);else{let s=t.indexOf("<"),a=t.slice(0,s!==-1?s:void 0),l=new M("#text",3);if(l.textContent=a,i.length>0){let d=i[i.length-1];d.childNodes.push(l),l.parentNode=d}else r.push(l);t=t.slice(a.length)}}return r}function Ne(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Te(t){return t.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#x27;/g,"'")}function Mt(t){return t.map(e=>{if(e.nodeType===3)return e.textContent||"";let{nodeName:r,attributes:i}=e,n=i.map(({name:s,value:a})=>` ${s}="${Ne(String(a))}"`).join(""),o=Mt(e.childNodes);return["img","input","br"].includes(r)?`<${r}${n} />`:`<${r}${n}>${o}</${r}>`}).join("")}function qt(t){let e=new t.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(i=>{let n=i.target,o=n.getAttribute("data-embed-src");o&&Z(n,o),i.addedNodes&&i.addedNodes.forEach(s=>{s.nodeType==1&&Gt(s,!1)})})});return e.observe(t,{attributes:!0,subtree:!0,childList:!0}),e}function Gt(t,e=!0){let r=t.querySelectorAll("[data-embed-src]");for(var i=0;i<r.length;i++){let n=r[i];Z(n,n.getAttribute("data-embed-src"))}if(e)return qt(t)}function Z(t,e){for(var r=t;r;r=r.parentElement)if(!r.parentElement){let n=r.querySelectorAll("script");for(var i=0;i<n.length;i++)if(n[i].getAttribute("src")==e)return!0;r.tagName=="HTML"&&(r=r.querySelector("head")||r);let o=r.ownerDocument.createElement("script");o.setAttribute("type","module"),o.setAttribute("src",e),r.appendChild(o);break}}var mt={};Q(mt,{adjustNumbers:()=>Qt,cleanCollectionBit:()=>tt,getHumanizedLabel:()=>Zt,getLastPathBit:()=>te,getQualifier:()=>Yt,normalizeCollectionScope:()=>ft,parseLimit:()=>Kt,parseRange:()=>Xt});var Kt=t=>{var e;let r=parseInt((e=t==null?void 0:t.match(/\[0:(\d+)\]/))===null||e===void 0?void 0:e[1],10);return!isNaN(r)&&r>0?String(r):null},Xt=t=>{var e;let r=(e=t==null?void 0:t.match(/\[([^\]]+)\]/))===null||e===void 0?void 0:e[1].split(/\s*,\s*/g).filter(Boolean).map(i=>{if(i.match(/^-?\d+$/))return i;let n=i.match(/^(\d+):(\d+)$/);return n&&parseInt(n[1],10)<parseInt(n[2],10)?n[1]+"-"+n[2]:null});return r!=null&&r.every(Boolean)?r.join(","):null},Yt=t=>{var e;return(e=t==null?void 0:t.match(/(\.\*|\[[^\]]*\])$/))===null||e===void 0?void 0:e[0]};function tt(t){return t.replace(/(\.?\[[^\]\[]*\]|\.\*)$/g,"")}function ft(t){return tt(t)+".*"}function Qt(t,e){return t==null?void 0:t.replace(/(.|^)(\d+)/g,(r,i,n)=>i+(i==":"?n:String(parseInt(n)+e)))}function Zt(t,e=2){var r=tt(t).split(/]\.|\.\*\./g).pop().split(/\./g).slice(-3);return r=r.filter(i=>isNaN(parseInt(i))),r.map(i=>i.charAt(0).toUpperCase()+i.slice(1)).slice(-e).join(" ")}function te(t){return tt(t).split(".").pop()}var Pe=["January","February","March","April","May","June","July","August","September","October","November","December"],ee=t=>{if(!t||typeof t.getDay!="function")return;let e=t.getFullYear(),r=Pe[t.getMonth()],i=t.getDate();return`${r} ${i}, ${e}`},re=function(t){return String(new Date(t))!=="Invalid Date"&&!isNaN(Number(new Date(t)))};function ne(t){let e=t.getAttribute("data-path-scope");for(var r=0,i=t;i=i.previousElementSibling;)i.getAttribute("data-path-scope")==e&&r++;return r}function Oe(t,e,r){let i=t.getAttribute("data-path-scope");if(i==null)return;var n=ne(t);if(n!=0)return;let o=t.parentNode;if(o!=null){e==0?t.setAttribute("hidden","hidden"):t.getAttribute("hidden")!=null&&t.removeAttribute("hidden");for(var s=n+1,a=t,l=t;l=l.nextElementSibling;)l.getAttribute("data-path-scope")==i&&(s++,a=l);for(var d=s;d<e;d++)o.insertBefore(a.cloneNode(!0),a.nextElementSibling);for(var d=Math.max(1,e);d<s;d++)a=a.previousElementSibling,o.removeChild(a.nextElementSibling)}}function D(t,e,r,i,n=!0){var o,s,a;if(!t)return;var l=t;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=F(r)),i!=null&&i.processValue&&(r=i==null?void 0:i.processValue(t,e,r));var d=e.replace("data-path-","");if(e=="data-path-src"||e=="data-path-alt"){let g=Array.from(t.children).find(_=>_.localName=="picture")||t;l=t.localName=="img"?t:g.querySelector("img, video")}else if(e=="data-path-href")l=t.querySelector("a")||t.closest("a");else if(e=="data-path-hidden")r=r?null:!0;else if(e=="data-path"||e=="data-embed-html"||e=="html")d="innerHTML";else if(e=="data-embed-src"&&n)Z(t,r);else if(e=="data-path-attributes"){if(!Array.isArray(r)){let g=((o=t.getAttribute("data-attributes-keys"))===null||o===void 0?void 0:o.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var h in r){var f=r[h];D(t,h,typeof f=="object"&&f?JSON.stringify(f):f,i,n)}for(var p=0;p<g.length;p++)(r==null||!(g[p]in r))&&D(t,g[p],null,i,n);D(t,"data-attributes-keys",Object.keys(r||{}).join(","),{},n)}if(t.tagName=="FEAAS-EXTERNAL"){let g=String(t.getAttribute("data-path-attributes")||"").slice(0,-1).split(".")[0]||"_";D(t,"datasources",JSON.stringify({[g]:r}),{},n)}return}if(typeof r=="boolean"&&(r=r?"":null),!l)return;let c=d=="innerHTML"||d=="src";if(console.log("debug set dom",t,e,d,r,c),c&&(r==null||r==="")){var u=String((a=(s=t.getAttribute("data-path-placeholder")||l[d])!==null&&s!==void 0?s:l.getAttribute(d))!==null&&a!==void 0?a:"");d=="innerHTML"?l.innerHTML=u:u?(console.log("set with empty value placeholder",e,d,u),l.setAttribute(d,u)):l.removeAttribute(d)}else if(r!=null)if(d=="innerHTML"){for(var b=String(r),A=l;A.parentElement&&A.localName.match(/^(a|var|strong|em|i|b)$/);)A=A.parentElement;A.localName.match(/p|h\d|button|time|li/)&&(b=b.replace(/<(p|h\d|li|ul)[^>]*?>|<\/(p|h\d|li|ul)[^>]*?>/g," ").trim().replace(/\s+/g," ")),String(A.getAttribute("class")).includes("-inline--time")&&re(b)&&(b=ee(new Date(b))),l.innerHTML!=b&&(l.innerHTML=b)}else l.getAttribute(d)!=r&&(console.log("set with value",e,d),l.setAttribute(d,r));else l.removeAttribute(d)}var ie=["data-attributes-keys","data-path-attributes","data-path-scope"];function R(t,e,r,i,n=!0){var o,s,a;let l=t;if(i||(e=((o=r==null?void 0:r.processData)===null||o===void 0?void 0:o.call(r,l,e))||e),l.nodeType==1){let f=l.getAttribute("data-path-scope");if(f){let c=ne(l),u=B(e,f,!1);c==0&&Oe(l,((s=r==null?void 0:r.shouldRepeat)===null||s===void 0?void 0:s.call(r,l,u))===!1?1:u.length,r),e={...e,[ft(f)]:u[c]}}let p=Array.prototype.slice.call(l.attributes).sort((c,u)=>ie.indexOf(c.name)-ie.indexOf(u.name));for(var d=0;d<p.length;d++){let{name:c,value:u}=p[d];c.startsWith("data-path")&&c!="data-path-scope"&&(console.log("debug entry",c,B(e,u,!0,void 0,l.tagName!="FEAAS-EXTERNAL")),D(l,c,B(e,u,!0,void 0,l.tagName!="FEAAS-EXTERNAL"),r,n)),c=="data-embed-src"&&D(l,c,l.getAttribute(c),r,n)}}for(var d=0,h;h=l.childNodes[d++];)oe(h)&&R(h,e,r,!0,n);return i||(a=r==null?void 0:r.onRender)===null||a===void 0||a.call(r,l,e),l}function oe(t){return t.nodeType==1}function U(t,e,r,i,n=!0){var o;let s=((o=i==null?void 0:i.processTemplate)===null||o===void 0?void 0:o.call(i,t,e,r))||e;if(t.innerHTML=s,t.classList.add("-feaas"),(t.closest(".component.feaas")||t).className.includes("-theme--"))for(var l=0,d;d=t.childNodes[l++];)oe(d)&&(d.className=d.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return R(t,r,i,null,n)}function se(t,e,r,i=!1,n=!0){var o;let s=((o=r==null?void 0:r.processTemplate)===null||o===void 0?void 0:o.call(r,null,t,e))||t;if(typeof document=="undefined"||i){let a=Dt(s);return R(a[0],e,r,null,n).outerHTML}else{let a=document.createElement("div");return a.innerHTML=s,R(a,e,r,null,n),a.innerHTML}}var ae=["initial","check","updated"],et={};function Me(){et={}}async function rt(t,e,r,i,n=et){return I({url:t,options:e,validator:r,callback:i,cache:n}).then(it).then(o=>o.response)}async function I({url:t,options:e,validator:r,callback:i,cache:n},o="initial"){let s=new Date;if(n!=null){var a=le(t);if(ae.indexOf(a.phase)>=ae.indexOf(o))var l=a[o];else a.phase=o}let d=await(l||fetch(t,e));if(!l&&a&&(d.ok?a[o].resolve(d):a[o].reject(new Error("Fetch failed"))),!d.ok)throw new Error("Fetch failed");let h=new Date(d.headers.get("date"))<s||l&&o=="initial"&&(a.phase=="updated"||a.phase=="check");if((r==null?void 0:r(d,h))===!1)throw new vt("Response is not valid");return await(i==null?void 0:i(d,o,h)),{url:t,options:e,isCached:h,response:d,validator:r,callback:i,cache:n}}function le(t,e=!1){let r=String(t).replace("?head","");var i=et[r];return!i&&!e&&(i=et[r]={phase:null,initial:S(),check:S(),updated:S(),final:S()}),i}var vt=class extends Error{};async function it(t){let{url:e,isCached:r,options:i,validator:n,response:o,cache:s}=t;if(r){let{response:a}=await I({url:e+(e.toString().includes("?")?"&":"?")+"head",options:{...i,method:"HEAD",cache:"no-cache"},validator:n,cache:s},"check");if(a.headers.get("last-modified")!=o.headers.get("last-modified"))return yt(t)}return t}async function yt(t){return I({...t,options:{...t.options,cache:"reload"}},"updated")}var N="https://feaas.blob.core.windows.net";function nt(t){let e=t==null?void 0:t.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(e){var[,r,i,n,o,s]=e;return{cdn:r,library:i,component:n,version:o,revision:s}}}function De(t){if(!t||!t.library||!t.component)throw new Error("Component requires `library` and `component` properties");return`${t.cdn&&t.cdn!=N?`${t.cdn}/components`:""}/${t.library}/${t.component}/${!t.version||t.version=="responsive"&&(!t.revision||t.revision=="published")?"":t.version}/${!t.revision||t.revision=="published"?"":t.revision}`.replace(/(^\/|\/$|\/\/)(?!.+\/components\/)/g,"")}function Le(t){return`${t.cdn&&t.cdn!=N?`${t.cdn}/styles/`:""}${t.library}/${!t.revision||t.revision=="published"?"":t.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function z(t){let e=t==null?void 0:t.match(/^(?:(.*?)\/styles\/)?([^\/]+)(?:\/(published|staged|saved|\d+)(?:.css)?)?$/);if(e){var[,r,i,n]=e;return{cdn:r,library:i,revision:n}}else{let o=nt(t);if(o){var{cdn:r,library:i,revision:n}=o;return n!=null&&n.match(/\d/)&&(n=void 0),{cdn:r,library:i,revision:n}}}}function Lt(t){return typeof t=="string"&&(t={src:t}),"src"in t&&t.src?t={...nt(t.src)}:t={...t},`${t.cdn||t.hostname||N}/components/${t.library}/${t.component}/${t.version||"responsive"}/${t.revision||"published"}.html`}function ot(t){if(typeof t=="string"&&(t={src:t}),"src"in t){if(String(t.src).includes("v1/files/components/styles"))return t.src;t={...z(t.src)}}else t={...t};return`${t.cdn||t.hostname||N}/styles/${t.library}/${t.revision=="staged"?"staged":t.revision=="saved"?"saved":"published"}.css`}async function V(t,e,r=!1){let i=a=>a.headers.get("x-ms-meta-versionDeletedAt")==null,n=a=>a.clone().text().then(e),o=await Promise.all([t.instance&&I({options:{headers:{Accept:"text/html"},credentials:"omit"},url:Lt({...t,version:t.instance}),validator:i}).catch(a=>a),I({url:Lt(t),validator:i}).catch(a=>a)]),s=o.find(a=>a&&"isCached"in a&&a);if(!s||s instanceof Error)throw o.find(l=>l&&l instanceof Error)||new Error("Can not fetch component");return o[0]==s&&console.log("Using fork!",o),await n(s.response),r?s:it({...s,callback:n}).catch(a=>{if(o[0]==s&&(yt({...s,callback:null,validator:null}),console.log("Fork was deleted"),!(o[1]instanceof Error)))return n(o[1].response),it({...o[1],callback:n});throw a})}async function $e(t){typeof t=="string"&&(t={src:t});var e;let{response:r}=await V(t,i=>{e=i},!0);return{...t,template:e,lastModified:r.headers.get("last-modified")}}async function bt(t,e){return rt(ot(t),{headers:{Accept:"text/css"},credentials:"omit"},r=>r.headers.get("x-ms-meta-deletedAt")==null,(r,i)=>r.clone().text().then(n=>e(n,i)))}function Fe(t,e){return de(t,e||(e=document.createElement("style"))),e}function de(t,e){return e||(e=document.createElement("style")),bt(t,(r,i)=>{e.textContent=r}).then(()=>e)}var Ue=new WeakSet;function At(t,e){var r,i=ce(t);if(i){if(Ue.has(i))return Promise.resolve(i);t=i.getAttribute("data-href")||i.getAttribute("href")}return bt(t,(n,o)=>{o=="initial"&&i||(r||(r=!i||i.tagName=="LINK"?he(t):i),r.textContent=n),e==null||e(n,o)}).then(()=>r||i)}function $t(t){return new Promise((e,r)=>{At(t,e).catch(r)})}function ce(t){let e=ot(t),{library:r}=z(e),i=`/files/components/styles/${r}.css`;return document.querySelector(`style[data-href="${e}"],
1
+ var _e=Object.defineProperty;var Q=(t,e)=>{for(var r in e)_e(t,r,{get:e[r],enumerable:!0})};var Ht={};Q(Ht,{Component:()=>st,ComponentProps:()=>fe,Context:()=>j,ControlledPromise:()=>S,DEFAULT_CDN_URL:()=>N,DOM:()=>gt,DataPath:()=>mt,DataScope:()=>pt,DataSettings:()=>w,Element:()=>E,FEAASComponent:()=>st,FEAASComponentsProps:()=>fe,FEAASContext:()=>j,FEAASContextProps:()=>Se,FEAASEditor:()=>lt,FEAASEditorProps:()=>Ce,FEAASElement:()=>E,FEAASLoader:()=>at,FEAASLoaderProps:()=>me,FEAASPicker:()=>dt,FEAASPickerProps:()=>xe,FEAASStylesheet:()=>Et,FEAASStylesheetProps:()=>ge,InvalidResponse:()=>vt,JSONPath:()=>m,Loader:()=>at,MyComponent:()=>ut,Picker:()=>dt,Stylesheet:()=>Et,Thumbnail:()=>wt,WebComponent:()=>Vt,adjustNumbers:()=>Qt,autoloadScripts:()=>Gt,cleanCollectionBit:()=>tt,clearFetchCache:()=>Me,createStylesheet:()=>he,customizeDataSettings:()=>Ge,fetchAndRevalidate:()=>rt,fetchAndRevalidateComponent:()=>V,fetchAndRevalidateStylesheet:()=>bt,fetchBypassingCache:()=>yt,fetchCache:()=>et,fetchComponent:()=>$e,fetchData:()=>It,fetchToValidateCache:()=>it,fetchWithCacheAwareness:()=>I,findStylesheet:()=>ce,getComponent:()=>qe,getComponentSource:()=>De,getComponentURL:()=>Lt,getFetchCache:()=>le,getFramePosition:()=>we,getHumanizedLabel:()=>Zt,getLastPathBit:()=>te,getQualifier:()=>Yt,getStylesheetSource:()=>Le,getStylesheetURL:()=>ot,loadScript:()=>Z,loadStylesheet:()=>At,loadStylesheetAllowStale:()=>$t,normalizeCollectionScope:()=>ft,observeDOMElement:()=>qt,parseComponentSource:()=>nt,parseLimit:()=>Kt,parseRange:()=>Xt,parseStylesheetSource:()=>z,queryObject:()=>H,queryObjectRaw:()=>Ot,queryScopes:()=>B,registerComponent:()=>Je,registerDatasource:()=>Ve,renderComponent:()=>Ft,renderComponentElement:()=>Ie,renderComponentPromise:()=>ue,renderDOMContent:()=>U,renderDOMElement:()=>R,renderHTMLContent:()=>se,renderStylesheet:()=>Fe,renderStylesheetPromise:()=>de,serializeCH1RichText:()=>F,setDOMAttribute:()=>D});function S(t,e=r=>{}){var r;let i=()=>{var n,o;let s=new Promise((l,d)=>{n=h=>{t==null||t(h),l(h)},o=d});var a=Object.assign(s,{resolve:n,reject:o,restart:i,first:r});return r=a,a.catch(e),a};return i()}var Vt=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,E=class extends Vt{getProps(e){return{}}constructor(){super(),this.defaultProps={},this.connected=!1,this.refs={},this.descendants=[],this.whenLoaded=S(e=>{this.payload=e}),this.whenRendered=S(()=>this.initialized=!0,()=>this.cancelRender()),this.addEventListener("feaasMount",this),this.addEventListener("feaasUnmount",this)}getRoot(){return this}attributeChangedCallback(e,r,i){this.set()}connectedCallback(){this.mount()}disconnectedCallback(){this.unmount()}mount(){try{console.log("hello in here");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(r=>{var i;return(i=r.mount)===null||i===void 0?void 0:i.call(r)}),this.set()}catch(e){this.onError(e)}}dispatchEventIndirectly(e){this.dispatchEvent(e);let r=this.getParent();r&&!r.contains(this)&&(Object.defineProperty(e,"target",{value:this,writable:!1}),Object.defineProperty(e,"composedPath",{value:()=>[this],writable:!1}),r.handleEvent(e))}isJSONAttribute(e){return!1}log(...e){let r=e[0];(typeof location!="undefined"&&(location!=null&&location.hostname.startsWith("components-"))||localStorage["Sitecore.Components.Debug"])&&console.log(r+" "+e.slice(1).map(i=>i&&typeof i=="object"?"%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 r=this;r=r.parentElement||(r.parentNode instanceof ShadowRoot?r.parentNode.host:null);)if(!e||r.tagName.startsWith("FEAAS-"))return r;if(this.tagName!="FEAAS-CONTEXT")return document.querySelector("feaas-context")}getElements(e=this.getRoot(),r=!0){return Array.from(e.querySelectorAll("*")).map(i=>[!r||i.tagName.startsWith("FEAAS-")?i:null,i.shadowRoot?this.getElements(i.shadowRoot,r):null]).flat().filter(Boolean)}handleEvent(e){let r=e.composedPath()[0];switch(e.type){case"feaasMount":r!=this&&this.nestedCallback(r);break;case"feaasUnmount":r!=this&&this.unnestedCallback(r);break}}unnestedCallback(e){let r=this.descendants.indexOf(e);r!=-1&&(this.log("FEAAS: Unnest",this,e),this.descendants.splice(r,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 r,i;if(this.descendants.indexOf(e)==-1&&(this.descendants.push(e),this.log("FEAAS: Nest",this,e),this.refs[e.getComponentName()]=e,e.refs.top=this,(r=e.refs).parent||(r.parent=this),e.render))for(var o=e.refs.parent;o;o=o.refs.parent)o.render&&((i=e.refs).parentReact||(i.parentReact=o),e.refs.topReact=o)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return this.payload===void 0&&this.getAttribute("hidden")==null}onError(e,r="uncaught",i=!1){let n=new CustomEvent("feaasError",{bubbles:!0,composed:!0,detail:e});if(this.dispatchEventIndirectly(n),this.whenLoaded.reject(e),!n.defaultPrevented&&!i){this.whenRendered.reject(e);try{this.unmount()}catch(o){}return!0}return!1}shouldUpdateOnLoad(){return!0}async advance(){try{if(this.payload===void 0){if(!this.isReadyToLoad())return;this.payload=null,this.dispatchEventIndirectly(new Event("feaasLoad",{bubbles:!0,composed:!0}));let e=await this.load().catch(r=>{throw this.payload=void 0,r});if(this.whenLoaded.resolve(e),this.onLoad)return}else if(this.payload==null)return;this.flush(),this.whenRendered.resolve(this)}catch(e){this.onError(e)}}flush(){var e,r;if(!this.connected)return;let i=(r=(e=this.payload)===null||e===void 0?void 0:e.ReactDOM)===null||r===void 0?void 0:r.flushSync;i?i(()=>this.update()):this.update()}load(){return Promise.resolve(null)}update(){var e,r,i;if(this.payload==null||!this.render)return;let{React:n,ReactDOM:o,ReactDOMClient:s}=this.payload||{};if(!n)throw new Error(`${this.tagName}: React is not present in payload`);if(!o)throw new Error(`${this.tagName}: ReactDOM is not present in payload`);this.getAttribute("hydrate")=="false"&&this.firstElementChild||(!this.refs.topReact&&!this.forceUpdateReact?(this.reactRoot||(this.reactRoot=s.createRoot(this.getReactRootElement())),this.reactRoot.render(this.getReactElement())):this.forceUpdateReact&&this.connected?(e=this.forceUpdateReact)===null||e===void 0||e.call(this):(i=(r=this.refs.topReact)===null||r===void 0?void 0:r.forceUpdateReact)===null||i===void 0||i.call(r))}invokeReactRendering(){let{React:e,ReactDOM:r}=this.payload||{};if(!this.connected)return null;let i=this.descendants.filter(n=>n.refs.parentReact==this&&n.payload&&n.connected).map((n,o)=>this.getReactElement(n));return this.render({...this.props,children:i},this.payload)}getReactErrorBoundary(e=this,r=e.tagName){if(this.reactErrorBoundary)return this.reactErrorBoundary;let{React:i,ReactDOM:n}=e.payload||{};return this.reactErrorBoundary||(this.reactErrorBoundary=class extends i.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromError(s){return{error:s}}componentDidCatch(s,a){console.error(`FEAAS: ${e.tagName} Error:`,s,a),e.onError(s,"react")}render(){if(!this.state.error)return this.props.children}})}getReactElement(e=this,r){let{React:i,ReactDOM:n}=e.payload||{},o=this.getReactErrorBoundary(),s=this.getReactWrapper(e);return i.createElement(o,{key:e.tagName+"-"+e.getUID(),slot:e.getAttribute("slot")},i.createElement(s,null))}getReactWrapper(e=this,r=e.tagName){if(e.reactWrapper)return e.reactWrapper;let{React:i,ReactDOM:n}=e.payload||{};return e.reactWrapper=o=>{if(e.render){let[s,a]=i.useReducer(l=>l+1,0);return e.forceUpdateReact=a,n.createPortal(i.createElement(i.Fragment,null,e.invokeReactRendering()),e.getReactRootElement())}else return e.update()},Object.assign(e.reactWrapper,{key:e.tagName+"-"+e.getUID(),displayName:r}),e.reactWrapper}getUID(){return this.uid||(this.uid=String(Math.random()))}getShadowRoot(){return this.shadowRoot||this.attachShadow({mode:"open"}),this.shadowRoot}getReactRootElement(){return this.useShadowRoot?this.getShadowRoot():this.getRoot()}set(e){try{this.scheduleRender(),this.overrides={...this.overrides,...e},this.props={...this.getProps(),...this.overrides};for(var r in this.props){let n=this.isJSONAttribute(r),o=this.props[r],s=n?JSON.stringify(o):String(o),a=this.defaultProps[r],l=n?JSON.stringify(a):String(a),d=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),h=this.getAttribute(d);try{var i=n?JSON.stringify(JSON.parse(h)):h}catch(f){var i=null}o==null||s===l?this.removeAttribute(d):(typeof o=="string"||typeof o=="number"||typeof o=="boolean"||n)&&i!=s&&this.setAttribute(d,s)}}catch(n){this.whenRendered.reject(n),this.onError(n,"set")}return this}import(e){return import( /*@vite-ignore*/ /* webpackIgnore: true */ e)}scheduleRender(){this.nextRender==null&&(this.whenRendered=this.whenRendered.restart()),this.cancelRender(),this.nextRender=requestAnimationFrame(()=>{this.nextRender=null,this.advance().catch(e=>{})})}cancelRender(){cancelAnimationFrame(this.nextRender)}formatURL(e,r){return typeof e=="string"&&e.match(/^\/[^\/]/)?r+e:e}getContextAttribute(e,r=this){for(var i=this;i=i.parentElement||(i.parentNode instanceof ShadowRoot?i.parentNode.host:null);)if(i.getAttribute(e)!=null)return i.getAttribute(e);return this.getAttribute(e)}static register(e,r){r==null&&(r=typeof window!="undefined"?window:null),r&&!r.customElements.get(e)&&r.customElements.define(e,this)}};var W=class extends E{load(){return Promise.all([import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react"),import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react-dom"),import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react-dom/client")]).then(([e,r,i])=>({React:e,ReactDOM:r,ReactDOMClient:i}))}render({},{React:e}){return e.createElement(e.Fragment,null)}},ut=class extends W{constructor(){super(...arguments),this.useShadowRoot=!0}getProps(){return{counter:parseFloat(this.getAttribute("counter"))}}render({counter:e},{React:r}){let[i,n]=r.useState(0);return r.useEffect(()=>{n(o=>o+1)},[e]),r.createElement(r.Fragment,null,r.createElement("p",null,"Rendering attribute: ",e),r.createElement("p",null,"Triggered updates: ",i))}};ut.observedAttributes=["counter"];var gt={};Q(gt,{renderDOMContent:()=>U,renderDOMElement:()=>R,renderHTMLContent:()=>se,setDOMAttribute:()=>D});var pt={};Q(pt,{JSONPath:()=>m,queryObject:()=>H,queryObjectRaw:()=>Ot,queryScopes:()=>B,serializeCH1RichText:()=>F});import ke from"vm";var{hasOwnProperty:x}=Object.prototype;function $(t,e){return t=t.slice(),t.push(e),t}function Nt(t,e){return e=e.slice(),e.unshift(t),e}var Tt=class extends Error{constructor(e){super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),this.avoidNew=!0,this.value=e,this.name="NewError"}};function m(t,e,r,i,n){if(!(this instanceof m))try{return new m(t,e,r,i,n)}catch(s){if(!s.avoidNew)throw s;return s.value}typeof t=="string"&&(n=i,i=r,r=e,e=t,t=null);let o=t&&typeof t=="object";if(t=t||{},this.json=t.json||r,this.path=t.path||e,this.resultType=t.resultType||"value",this.flatten=t.flatten||!1,this.wrap=x.call(t,"wrap")?t.wrap:!0,this.sandbox=t.sandbox||{},this.preventEval=t.preventEval||!1,this.parent=t.parent||null,this.parentProperty=t.parentProperty||null,this.callback=t.callback||i||null,this.otherTypeCallback=t.otherTypeCallback||n||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},t.autostart!==!1){let s={path:o?t.path:e};o?"json"in t&&(s.json=t.json):s.json=r;let a=this.evaluate(s);if(!a||typeof a!="object")throw new Tt(a);return a}}m.prototype.evaluate=function(t,e,r,i){let n=this.parent,o=this.parentProperty,{flatten:s,wrap:a}=this;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=i||this.otherTypeCallback,e=e||this.json,t=t||this.path,t&&typeof t=="object"&&!Array.isArray(t)){if(!t.path&&t.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!x.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:e}=t),s=x.call(t,"flatten")?t.flatten:s,this.currResultType=x.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=x.call(t,"sandbox")?t.sandbox:this.currSandbox,a=x.call(t,"wrap")?t.wrap:a,this.currPreventEval=x.call(t,"preventEval")?t.preventEval:this.currPreventEval,r=x.call(t,"callback")?t.callback:r,this.currOtherTypeCallback=x.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,n=x.call(t,"parent")?t.parent:n,o=x.call(t,"parentProperty")?t.parentProperty:o,t=t.path}if(n=n||null,o=o||null,Array.isArray(t)&&(t=m.toPathString(t)),!t&&t!==""||!e)return;let l=m.toPathArray(t);l[0]==="$"&&l.length>1&&l.shift(),this._hasParentSelector=null;let d=this._trace(l,e,["$"],n,o,r).filter(function(h){return h&&!h.isParentSelector});return d.length?!a&&d.length===1&&!d[0].hasArrExpr?this._getPreferredOutput(d[0]):d.reduce((h,f)=>{let p=this._getPreferredOutput(f);return s&&Array.isArray(p)?h=h.concat(p):h.push(p),h},[]):a?[]:void 0};m.prototype._getPreferredOutput=function(t){let e=this.currResultType;switch(e){case"all":{let r=Array.isArray(t.path)?t.path:m.toPathArray(t.path);return t.pointer=m.toPointer(r),t.path=typeof t.path=="string"?t.path:m.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[e];case"path":return m.toPathString(t[e]);case"pointer":return m.toPointer(t.path);default:throw new TypeError("Unknown result type")}};m.prototype._handleCallback=function(t,e,r){if(e){let i=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:m.toPathString(t.path),e(i,r,t)}};m.prototype._trace=function(t,e,r,i,n,o,s,a){let l;if(!t.length)return l={path:r,value:e,parent:i,parentProperty:n,hasArrExpr:s},this._handleCallback(l,o,"value"),l;let d=t[0],h=t.slice(1),f=[];function p(c){Array.isArray(c)?c.forEach(u=>{f.push(u)}):f.push(c)}if((typeof d!="string"||a)&&e&&x.call(e,d))p(this._trace(h,e[d],$(r,d),e,d,o,s));else if(d==="*")this._walk(e,c=>{p(this._trace(h,e[c],$(r,c),e,c,o,!0,!0))});else if(d==="..")p(this._trace(h,e,r,i,n,o,s)),this._walk(e,c=>{typeof e[c]=="object"&&p(this._trace(t.slice(),e[c],$(r,c),e,c,o,!0))});else{if(d==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:h,isParentSelector:!0};if(d==="~")return l={path:$(r,d),value:n,parent:i,parentProperty:null},this._handleCallback(l,o,"property"),l;if(d==="$")p(this._trace(h,e,r,null,null,o,s));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(d))p(this._slice(d,h,e,r,i,n,o));else if(d.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");let c=d.replace(/^\?\((.*?)\)$/u,"$1");this._walk(e,u=>{this._eval(c,e[u],u,r,i,n)&&p(this._trace(h,e[u],$(r,u),e,u,o,!0))})}else if(d[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");p(this._trace(Nt(this._eval(d,e,r[r.length-1],r.slice(0,-1),i,n),h),e,r,i,n,o,s))}else if(d[0]==="@"){let c=!1,u=d.slice(1,-2);switch(u){case"scalar":(!e||!["object","function"].includes(typeof e))&&(c=!0);break;case"boolean":case"string":case"undefined":case"function":typeof e===u&&(c=!0);break;case"integer":Number.isFinite(e)&&!(e%1)&&(c=!0);break;case"number":Number.isFinite(e)&&(c=!0);break;case"nonFinite":typeof e=="number"&&!Number.isFinite(e)&&(c=!0);break;case"object":e&&typeof e===u&&(c=!0);break;case"array":Array.isArray(e)&&(c=!0);break;case"other":c=this.currOtherTypeCallback(e,r,i,n);break;case"null":e===null&&(c=!0);break;default:throw new TypeError("Unknown value type "+u)}if(c)return l={path:r,value:e,parent:i,parentProperty:n},this._handleCallback(l,o,"value"),l}else if(d[0]==="`"&&e&&x.call(e,d.slice(1))){let c=d.slice(1);p(this._trace(h,e[c],$(r,c),e,c,o,s,!0))}else if(d.includes(",")){let c=d.split(",");for(let u of c)p(this._trace(Nt(u,h),e,r,i,n,o,!0))}else!a&&e&&x.call(e,d)&&p(this._trace(h,e[d],$(r,d),e,d,o,s,!0))}if(this._hasParentSelector)for(let c=0;c<f.length;c++){let u=f[c];if(u&&u.isParentSelector){let b=this._trace(u.expr,e,u.path,i,n,o,s);if(Array.isArray(b)){f[c]=b[0];let A=b.length;for(let g=1;g<A;g++)c++,f.splice(c,0,b[g])}else f[c]=b}}return f};m.prototype._walk=function(t,e){if(Array.isArray(t)){let r=t.length;for(let i=0;i<r;i++)e(i)}else t&&typeof t=="object"&&Object.keys(t).forEach(r=>{e(r)})};m.prototype._slice=function(t,e,r,i,n,o,s){if(!Array.isArray(r))return;let a=r.length,l=t.split(":"),d=l[2]&&Number.parseInt(l[2])||1,h=l[0]&&Number.parseInt(l[0])||0,f=l[1]&&Number.parseInt(l[1])||a;h=h<0?Math.max(0,h+a):Math.min(a,h),f=f<0?Math.max(0,f+a):Math.min(a,f);let p=[];for(let c=h;c<f;c+=d)this._trace(Nt(c,e),r,i,n,o,s,!0).forEach(b=>{p.push(b)});return p};m.prototype._eval=function(t,e,r,i,n,o){this.currSandbox._$_parentProperty=o,this.currSandbox._$_parent=n,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=e;let s=t.includes("@path");s&&(this.currSandbox._$_path=m.toPathString(i.concat([r])));let a="script:"+t;if(!m.cache[a]){let l=t.replace(/@parentProperty/gu,"_$_parentProperty").replace(/@parent/gu,"_$_parent").replace(/@property/gu,"_$_property").replace(/@root/gu,"_$_root").replace(/@([.\s)[])/gu,"_$_v$1");s&&(l=l.replace(/@path/gu,"_$_path")),m.cache[a]=new this.vm.Script(l)}try{return m.cache[a].runInNewContext(this.currSandbox)}catch(l){throw new Error("jsonPath: "+l.message+": "+t)}};m.cache={};m.toPathString=function(t){let e=t,r=e.length,i="$";for(let n=1;n<r;n++)/^(~|\^|@.*?\(\))$/u.test(e[n])||(i+=/^[0-9*]+$/u.test(e[n])?"["+e[n]+"]":"['"+e[n]+"']");return i};m.toPointer=function(t){let e=t,r=e.length,i="";for(let n=1;n<r;n++)/^(~|\^|@.*?\(\))$/u.test(e[n])||(i+="/"+e[n].toString().replace(/~/gu,"~0").replace(/\//gu,"~1"));return i};m.toPathArray=function(t){let{cache:e}=m;if(e[t])return e[t].concat();let r=[],n=t.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu,";$&;").replace(/[['](\??\(.*?\))[\]']/gu,function(o,s){return"[#"+(r.push(s)-1)+"]"}).replace(/\[['"]([^'\]]*)['"]\]/gu,function(o,s){return"['"+s.replace(/\./gu,"%@%").replace(/~/gu,"%%@@%%")+"']"}).replace(/~/gu,";~;").replace(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu,";").replace(/%@%/gu,".").replace(/%%@@%%/gu,"~").replace(/(?:;)?(\^+)(?:;)?/gu,function(o,s){return";"+s.split("").join(";")+";"}).replace(/;;;|;;/gu,";..;").replace(/;$|'?\]|'$/gu,"").split(";").map(function(o){let s=o.match(/#(\d+)/u);return!s||!s[1]?o:r[s[1]]});return e[t]=n,e[t].concat()};m.prototype.vm=ke;function Ot(t,e){try{return m({path:e,json:t})}catch(r){return[]}}function H(t,e,r=!0){let i=Ot(t,e)||[];return r?i.flat(1/0):i}function B(t,e,r=!1,i=t,n=!0){var o=e;let s=Object.keys(t).sort((l,d)=>d.length-l.length);for(let l of s)if(e.startsWith(l)){if(l==e){if(r)return t[l];continue}o=e.substring(l.length+1),i=t[l];break}console.log("------",a);var a=H(i,o,n);return a.length==0&&(a=[o.replace(/^.*?\./,"_."),o.replace(/^.*?\./,""),o.replace(/^([^.]+).*?\.\$([\.\[])/,"$1$2"),o.replace(/^.*?\.\$([\.\[])/,"_$1"),o.replace(/^.*?\.\$([\.\[])/,"$$$1"),o.replace(/^[^.]+$/,"_")].filter((l,d,h)=>h.indexOf(l)===d).reduce((l,d)=>l.length>0?l:H(i,d,n),[])),console.log("----",o,a),r?a[0]:a}function Pt(t,e={},r){return r?`<${r}${Object.entries(e).map(([i,n])=>n!=null&&` ${i}="${n}"`).filter(Boolean).join("")}>${F(t)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):F(t)}function F(t){var e;if(Array.isArray(t))return t.map(F).join(`
2
+ `).trim();if(typeof t=="string")return t;if(t==null)return"";switch(t.type){case"heading":let{level:r,...i}=t.attrs;return Pt(t.content,i,"h"+r);case"text":return(t.marks||[]).reduce((n,o)=>Pt(n,o.attrs,{link:"a",bold:"strong",italic:"em",strike:"s",underline:"u"}[o.type]),(e=t.text)===null||e===void 0?void 0:e.replace(/\s+/," "));default:return Pt(t.content||t.text,t.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[t.type])}}var M=class{constructor(e,r=1,i){this.ownerDocument={createElement(n){return new M(n)},createDocumentFragment(){return new M(null,11)}},this.nodeName=e,this.nodeType=r,this.textContent=i,this.attributes=[],this.childNodes=[]}setAttribute(e,r){let i=this.attributes.find(n=>n.name===e);i?i.value=r:this.attributes.push({name:e,value:r})}getAttribute(e){let r=this.attributes.find(i=>i.name===e);return r?r.value:void 0}insertBefore(e,r){if(e.parentNode=this,r===null)this.childNodes.push(e);else{let i=this.childNodes.indexOf(r);i!==-1&&this.childNodes.splice(i,0,e)}}removeAttribute(e){let r=this.attributes.findIndex(i=>i.name===e);r!==-1&&this.attributes.splice(r,1)}appendChild(e){e.parentNode=this,this.childNodes.push(e)}get tagName(){var e;return(e=this.nodeName)===null||e===void 0?void 0:e.toUpperCase()}get localName(){var e;return(e=this.nodeName)===null||e===void 0?void 0:e.toLowerCase()}get innerHTML(){return Mt(this.childNodes)}set innerHTML(e){this.childNodes=Dt(String(e!=null?e:""))}get outerHTML(){return Mt([this])}get children(){return this.childNodes.filter(e=>e.nodeType==1)}closest(e){let r=this;for(;r;){if(Jt(e,r))return r;r=r.parentNode}return null}querySelectorAll(e){let r=e.split(/\s*,\s*/),i=[],n=o=>{for(let s of r)if(Jt(s,o)){i.push(o);break}for(let s of o.childNodes)n(s)};for(let o of this.childNodes)n(o);return i}querySelector(e){return this.querySelectorAll(e)[0]}findSibling(e,r){if(!this.parentNode)return null;let i=this.parentNode.childNodes,n=i.indexOf(this);if(n===-1)return null;for(let o=n+e;o>=0&&o<i.length;o+=e){let s=i[o];if(!r||s.nodeType===1)return s}return null}removeChild(e){let r=this.childNodes.indexOf(e);if(r!==-1)return this.childNodes.splice(r,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 r=new M(this.nodeName,this.nodeType);if(r.attributes=JSON.parse(JSON.stringify(this.attributes)),this.textContent&&(r.textContent=this.textContent),e)for(let i of this.childNodes){let n=i.cloneNode(!0);r.appendChild(n)}return r}get parentElement(){var e;return((e=this.parentNode)===null||e===void 0?void 0:e.nodeType)==1?this.parentNode:null}};function Jt(t,e){let r=t.match(/([.#]?[\w-]+|\[([\w-]+)(="([^"]*)")?\])/g);if(!r)return!1;for(let i of r)if(i.startsWith("#")){if(e.getAttribute("id")!==i.slice(1))return!1}else if(i.startsWith(".")){if(!(e.getAttribute("class")||"").split(" ").includes(i.slice(1)))return!1}else if(i.startsWith("[")){let n=i.match(/^\[([\w-]+)(="([^"]*)")?\]$/);if(n){let o=n[1],s=n[3],a=e.getAttribute(o);if(typeof s=="undefined"){if(a===void 0)return!1}else if(a!==s)return!1}else return!1}else if(e.nodeName!==i)return!1;return!0}function Dt(t){var e;let r=[],i=[];for(;t;){let n=t.match(/^<([\w-]+)(\s[^>]*)?>/),o=t.match(/^<\/([\w-]+)>/);if(n){let s=n[1].toLowerCase(),l=((e=(n[2]||"").match(/([\w-]+)(="([^"]*)")?/g))===null||e===void 0?void 0:e.map(h=>{let[f,p,,c]=h.match(/([\w-]+)(="([^"]*)")?/);return{name:p,value:Te(c||"")}}))||[],d=new M(s,1);if(d.attributes=l,i.length>0){let h=i[i.length-1];h.childNodes.push(d),d.parentNode=h}else r.push(d);["img","input","br"].includes(s)||i.push(d),t=t.slice(n[0].length)}else if(o)i.pop(),t=t.slice(o[0].length);else{let s=t.indexOf("<"),a=t.slice(0,s!==-1?s:void 0),l=new M("#text",3);if(l.textContent=a,i.length>0){let d=i[i.length-1];d.childNodes.push(l),l.parentNode=d}else r.push(l);t=t.slice(a.length)}}return r}function Ne(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Te(t){return t.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#x27;/g,"'")}function Mt(t){return t.map(e=>{if(e.nodeType===3)return e.textContent||"";let{nodeName:r,attributes:i}=e,n=i.map(({name:s,value:a})=>` ${s}="${Ne(String(a))}"`).join(""),o=Mt(e.childNodes);return["img","input","br"].includes(r)?`<${r}${n} />`:`<${r}${n}>${o}</${r}>`}).join("")}function qt(t){let e=new t.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(i=>{let n=i.target,o=n.getAttribute("data-embed-src");o&&Z(n,o),i.addedNodes&&i.addedNodes.forEach(s=>{s.nodeType==1&&Gt(s,!1)})})});return e.observe(t,{attributes:!0,subtree:!0,childList:!0}),e}function Gt(t,e=!0){let r=t.querySelectorAll("[data-embed-src]");for(var i=0;i<r.length;i++){let n=r[i];Z(n,n.getAttribute("data-embed-src"))}if(e)return qt(t)}function Z(t,e){for(var r=t;r;r=r.parentElement)if(!r.parentElement){let n=r.querySelectorAll("script");for(var i=0;i<n.length;i++)if(n[i].getAttribute("src")==e)return!0;r.tagName=="HTML"&&(r=r.querySelector("head")||r);let o=r.ownerDocument.createElement("script");o.setAttribute("type","module"),o.setAttribute("src",e),r.appendChild(o);break}}var mt={};Q(mt,{adjustNumbers:()=>Qt,cleanCollectionBit:()=>tt,getHumanizedLabel:()=>Zt,getLastPathBit:()=>te,getQualifier:()=>Yt,normalizeCollectionScope:()=>ft,parseLimit:()=>Kt,parseRange:()=>Xt});var Kt=t=>{var e;let r=parseInt((e=t==null?void 0:t.match(/\[0:(\d+)\]/))===null||e===void 0?void 0:e[1],10);return!isNaN(r)&&r>0?String(r):null},Xt=t=>{var e;let r=(e=t==null?void 0:t.match(/\[([^\]]+)\]/))===null||e===void 0?void 0:e[1].split(/\s*,\s*/g).filter(Boolean).map(i=>{if(i.match(/^-?\d+$/))return i;let n=i.match(/^(\d+):(\d+)$/);return n&&parseInt(n[1],10)<parseInt(n[2],10)?n[1]+"-"+n[2]:null});return r!=null&&r.every(Boolean)?r.join(","):null},Yt=t=>{var e;return(e=t==null?void 0:t.match(/(\.\*|\[[^\]]*\])$/))===null||e===void 0?void 0:e[0]};function tt(t){return t.replace(/(\.?\[[^\]\[]*\]|\.\*)$/g,"")}function ft(t){return tt(t)+".*"}function Qt(t,e){return t==null?void 0:t.replace(/(.|^)(\d+)/g,(r,i,n)=>i+(i==":"?n:String(parseInt(n)+e)))}function Zt(t,e=2){var r=tt(t).split(/]\.|\.\*\./g).pop().split(/\./g).slice(-3);return r=r.filter(i=>isNaN(parseInt(i))),r.map(i=>i.charAt(0).toUpperCase()+i.slice(1)).slice(-e).join(" ")}function te(t){return tt(t).split(".").pop()}var Pe=["January","February","March","April","May","June","July","August","September","October","November","December"],ee=t=>{if(!t||typeof t.getDay!="function")return;let e=t.getFullYear(),r=Pe[t.getMonth()],i=t.getDate();return`${r} ${i}, ${e}`},re=function(t){return String(new Date(t))!=="Invalid Date"&&!isNaN(Number(new Date(t)))};function ne(t){let e=t.getAttribute("data-path-scope");for(var r=0,i=t;i=i.previousElementSibling;)i.getAttribute("data-path-scope")==e&&r++;return r}function Oe(t,e,r){let i=t.getAttribute("data-path-scope");if(i==null)return;var n=ne(t);if(n!=0)return;let o=t.parentNode;if(o!=null){e==0?t.setAttribute("hidden","hidden"):t.getAttribute("hidden")!=null&&t.removeAttribute("hidden");for(var s=n+1,a=t,l=t;l=l.nextElementSibling;)l.getAttribute("data-path-scope")==i&&(s++,a=l);for(var d=s;d<e;d++)o.insertBefore(a.cloneNode(!0),a.nextElementSibling);for(var d=Math.max(1,e);d<s;d++)a=a.previousElementSibling,o.removeChild(a.nextElementSibling)}}function D(t,e,r,i,n=!0){var o,s,a;if(!t)return;var l=t;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=F(r)),i!=null&&i.processValue&&(r=i==null?void 0:i.processValue(t,e,r));var d=e.replace("data-path-","");if(e=="data-path-src"||e=="data-path-alt"){let g=Array.from(t.children).find(_=>_.localName=="picture")||t;l=t.localName=="img"?t:g.querySelector("img, video")}else if(e=="data-path-href")l=t.querySelector("a")||t.closest("a");else if(e=="data-path-hidden")console.log("hidden init value",r),r=r?null:!0;else if(e=="data-path"||e=="data-embed-html"||e=="html")d="innerHTML";else if(e=="data-embed-src"&&n)Z(t,r);else if(e=="data-path-attributes"){if(!Array.isArray(r)){let g=((o=t.getAttribute("data-attributes-keys"))===null||o===void 0?void 0:o.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var h in r){var f=r[h];D(t,h,typeof f=="object"&&f?JSON.stringify(f):f,i,n)}for(var p=0;p<g.length;p++)(r==null||!(g[p]in r))&&D(t,g[p],null,i,n);D(t,"data-attributes-keys",Object.keys(r||{}).join(","),{},n)}if(t.tagName=="FEAAS-EXTERNAL"){let g=String(t.getAttribute("data-path-attributes")||"").slice(0,-1).split(".")[0]||"_";D(t,"datasources",JSON.stringify({[g]:r}),{},n)}return}if(typeof r=="boolean"&&(r=r?"":null),!l)return;let c=d=="innerHTML"||d=="src";if(console.log("debug set dom",e,d,r,c),c&&(r==null||r==="")){var u=String((a=(s=t.getAttribute("data-path-placeholder")||l[d])!==null&&s!==void 0?s:l.getAttribute(d))!==null&&a!==void 0?a:"");d=="innerHTML"?l.innerHTML=u:u?(console.log("set with empty value placeholder",e,d,u),l.setAttribute(d,u)):l.removeAttribute(d)}else if(r!=null)if(d=="innerHTML"){for(var b=String(r),A=l;A.parentElement&&A.localName.match(/^(a|var|strong|em|i|b)$/);)A=A.parentElement;A.localName.match(/p|h\d|button|time|li/)&&(b=b.replace(/<(p|h\d|li|ul)[^>]*?>|<\/(p|h\d|li|ul)[^>]*?>/g," ").trim().replace(/\s+/g," ")),String(A.getAttribute("class")).includes("-inline--time")&&re(b)&&(b=ee(new Date(b))),l.innerHTML!=b&&(l.innerHTML=b)}else l.getAttribute(d)!=r&&(console.log("set with value",e,d),l.setAttribute(d,r));else l.removeAttribute(d)}var ie=["data-attributes-keys","data-path-attributes","data-path-scope"];function R(t,e,r,i,n=!0){var o,s,a;let l=t;if(i||(e=((o=r==null?void 0:r.processData)===null||o===void 0?void 0:o.call(r,l,e))||e),l.nodeType==1){let f=l.getAttribute("data-path-scope");if(f){let c=ne(l),u=B(e,f,!1);c==0&&Oe(l,((s=r==null?void 0:r.shouldRepeat)===null||s===void 0?void 0:s.call(r,l,u))===!1?1:u.length,r),e={...e,[ft(f)]:u[c]}}let p=Array.prototype.slice.call(l.attributes).sort((c,u)=>ie.indexOf(c.name)-ie.indexOf(u.name));for(var d=0;d<p.length;d++){let{name:c,value:u}=p[d];c.startsWith("data-path")&&c!="data-path-scope"&&(console.log("debug entry",c,e,u,B(e,u,!0,void 0,l.tagName!="FEAAS-EXTERNAL")),D(l,c,B(e,u,!0,void 0,l.tagName!="FEAAS-EXTERNAL"),r,n)),c=="data-embed-src"&&D(l,c,l.getAttribute(c),r,n)}}for(var d=0,h;h=l.childNodes[d++];)oe(h)&&R(h,e,r,!0,n);return i||(a=r==null?void 0:r.onRender)===null||a===void 0||a.call(r,l,e),l}function oe(t){return t.nodeType==1}function U(t,e,r,i,n=!0){var o;let s=((o=i==null?void 0:i.processTemplate)===null||o===void 0?void 0:o.call(i,t,e,r))||e;if(t.innerHTML=s,t.classList.add("-feaas"),(t.closest(".component.feaas")||t).className.includes("-theme--"))for(var l=0,d;d=t.childNodes[l++];)oe(d)&&(d.className=d.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return R(t,r,i,null,n)}function se(t,e,r,i=!1,n=!0){var o;let s=((o=r==null?void 0:r.processTemplate)===null||o===void 0?void 0:o.call(r,null,t,e))||t;if(typeof document=="undefined"||i){let a=Dt(s);return R(a[0],e,r,null,n).outerHTML}else{let a=document.createElement("div");return a.innerHTML=s,R(a,e,r,null,n),a.innerHTML}}var ae=["initial","check","updated"],et={};function Me(){et={}}async function rt(t,e,r,i,n=et){return I({url:t,options:e,validator:r,callback:i,cache:n}).then(it).then(o=>o.response)}async function I({url:t,options:e,validator:r,callback:i,cache:n},o="initial"){let s=new Date;if(n!=null){var a=le(t);if(ae.indexOf(a.phase)>=ae.indexOf(o))var l=a[o];else a.phase=o}let d=await(l||fetch(t,e));if(!l&&a&&(d.ok?a[o].resolve(d):a[o].reject(new Error("Fetch failed"))),!d.ok)throw new Error("Fetch failed");let h=new Date(d.headers.get("date"))<s||l&&o=="initial"&&(a.phase=="updated"||a.phase=="check");if((r==null?void 0:r(d,h))===!1)throw new vt("Response is not valid");return await(i==null?void 0:i(d,o,h)),{url:t,options:e,isCached:h,response:d,validator:r,callback:i,cache:n}}function le(t,e=!1){let r=String(t).replace("?head","");var i=et[r];return!i&&!e&&(i=et[r]={phase:null,initial:S(),check:S(),updated:S(),final:S()}),i}var vt=class extends Error{};async function it(t){let{url:e,isCached:r,options:i,validator:n,response:o,cache:s}=t;if(r){let{response:a}=await I({url:e+(e.toString().includes("?")?"&":"?")+"head",options:{...i,method:"HEAD",cache:"no-cache"},validator:n,cache:s},"check");if(a.headers.get("last-modified")!=o.headers.get("last-modified"))return yt(t)}return t}async function yt(t){return I({...t,options:{...t.options,cache:"reload"}},"updated")}var N="https://feaas.blob.core.windows.net";function nt(t){let e=t==null?void 0:t.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(e){var[,r,i,n,o,s]=e;return{cdn:r,library:i,component:n,version:o,revision:s}}}function De(t){if(!t||!t.library||!t.component)throw new Error("Component requires `library` and `component` properties");return`${t.cdn&&t.cdn!=N?`${t.cdn}/components`:""}/${t.library}/${t.component}/${!t.version||t.version=="responsive"&&(!t.revision||t.revision=="published")?"":t.version}/${!t.revision||t.revision=="published"?"":t.revision}`.replace(/(^\/|\/$|\/\/)(?!.+\/components\/)/g,"")}function Le(t){return`${t.cdn&&t.cdn!=N?`${t.cdn}/styles/`:""}${t.library}/${!t.revision||t.revision=="published"?"":t.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function z(t){let e=t==null?void 0:t.match(/^(?:(.*?)\/styles\/)?([^\/]+)(?:\/(published|staged|saved|\d+)(?:.css)?)?$/);if(e){var[,r,i,n]=e;return{cdn:r,library:i,revision:n}}else{let o=nt(t);if(o){var{cdn:r,library:i,revision:n}=o;return n!=null&&n.match(/\d/)&&(n=void 0),{cdn:r,library:i,revision:n}}}}function Lt(t){return typeof t=="string"&&(t={src:t}),"src"in t&&t.src?t={...nt(t.src)}:t={...t},`${t.cdn||t.hostname||N}/components/${t.library}/${t.component}/${t.version||"responsive"}/${t.revision||"published"}.html`}function ot(t){if(typeof t=="string"&&(t={src:t}),"src"in t){if(String(t.src).includes("v1/files/components/styles"))return t.src;t={...z(t.src)}}else t={...t};return`${t.cdn||t.hostname||N}/styles/${t.library}/${t.revision=="staged"?"staged":t.revision=="saved"?"saved":"published"}.css`}async function V(t,e,r=!1){let i=a=>a.headers.get("x-ms-meta-versionDeletedAt")==null,n=a=>a.clone().text().then(e),o=await Promise.all([t.instance&&I({options:{headers:{Accept:"text/html"},credentials:"omit"},url:Lt({...t,version:t.instance}),validator:i}).catch(a=>a),I({url:Lt(t),validator:i}).catch(a=>a)]),s=o.find(a=>a&&"isCached"in a&&a);if(!s||s instanceof Error)throw o.find(l=>l&&l instanceof Error)||new Error("Can not fetch component");return o[0]==s&&console.log("Using fork!",o),await n(s.response),r?s:it({...s,callback:n}).catch(a=>{if(o[0]==s&&(yt({...s,callback:null,validator:null}),console.log("Fork was deleted"),!(o[1]instanceof Error)))return n(o[1].response),it({...o[1],callback:n});throw a})}async function $e(t){typeof t=="string"&&(t={src:t});var e;let{response:r}=await V(t,i=>{e=i},!0);return{...t,template:e,lastModified:r.headers.get("last-modified")}}async function bt(t,e){return rt(ot(t),{headers:{Accept:"text/css"},credentials:"omit"},r=>r.headers.get("x-ms-meta-deletedAt")==null,(r,i)=>r.clone().text().then(n=>e(n,i)))}function Fe(t,e){return de(t,e||(e=document.createElement("style"))),e}function de(t,e){return e||(e=document.createElement("style")),bt(t,(r,i)=>{e.textContent=r}).then(()=>e)}var Ue=new WeakSet;function At(t,e){var r,i=ce(t);if(i){if(Ue.has(i))return Promise.resolve(i);t=i.getAttribute("data-href")||i.getAttribute("href")}return bt(t,(n,o)=>{o=="initial"&&i||(r||(r=!i||i.tagName=="LINK"?he(t):i),r.textContent=n),e==null||e(n,o)}).then(()=>r||i)}function $t(t){return new Promise((e,r)=>{At(t,e).catch(r)})}function ce(t){let e=ot(t),{library:r}=z(e),i=`/files/components/styles/${r}.css`;return document.querySelector(`style[data-href="${e}"],
3
3
  link[rel="stylesheet"][href="${e}"],
4
4
  style[data-href*="${i}"],
5
5
  link[rel="stylesheet"][href*="${i}"]`)}function he(t){let e=ot(t),r=document.createElement("style");return r.setAttribute("data-href",e),document.head.appendChild(r),r}function Ie(t,e){let r=document.createElement("div");r.innerHTML=t;let i=document.createDocumentFragment();for(;r.firstChild;)i.appendChild(r.firstChild);return console.log("=== renderComponentElement",i,e),R(i,e),r}function Ft(t,e,r=!0){return ue(t,e||(e=document.createElement("div")),r),e}async function ue(t,e,r=!0){return e||(e=document.createElement("div")),e.childNodes.length?(console.log("=== renderComponentPromise",e,t.data),R(e,t.data,t,null,r)):"template"in t?U(e,t.template,t.data,t,r):V(t,i=>U(e,i,t.data,t,r)).then(()=>e)}import{customizeDataSettings as je}from"@sitecore/byoc";function We(t){let{params:e,method:r,headers:i,body:n,url:o}=w(t);var s={url:o},a={...i};return i["Content-Type"]==="application/json"&&delete a["Content-Type"],i.Accept==="application/json"&&delete a.Accept,Object.keys(a).length>0&&(s.headers=a),r!=="GET"&&(s.method=r),r==="GET"||r==="HEAD"||Object.keys(n).length===0||(s.body=n),Object.keys(e).length>0&&(s={...s,params:e}),s}var J=t=>{if(!t||typeof t.url!="string")return!1;for(var e in t)if(!(e=="body"||e=="params"||e=="headers"||e=="url"||e==="method"||e=="jsonpath"&&typeof t[e]=="string"))return!1;return!0};function pe(t){let{url:e,headers:r,params:i,method:n,body:o}=w(t),s,a=r["Content-Type"];n!="GET"&&n!="HEAD"&&(a==="application/json"&&(s=JSON.stringify(o)),a==="multipart/form-data"&&(s=Object.keys(o).reduce((d,h)=>(d.append(h,o[h]),d),new FormData)),a==="application/x-www-form-urlencoded"&&(s=new URLSearchParams(o)));let l=Object.keys(i).length?`?${new URLSearchParams(i)}`:"";return[`${e}${l}`,{headers:r,body:s,method:n}]}function w(t){let e={};for(let r in(t==null?void 0:t.headers)||{})if(t.headers.hasOwnProperty(r)){let i=r.replace(/^[a-z]|\-[a-z]/g,n=>n.toUpperCase());e[i]=t.headers[r]}return e.Accept||(e.Accept="application/json"),{params:(t==null?void 0:t.params)||{},headers:e,jsonpath:String((t==null?void 0:t.jsonpath)||"$"),method:((t==null?void 0:t.method)||"GET").toUpperCase(),body:(t==null?void 0:t.body)||{},url:String((t==null?void 0:t.url)||"")}}var Ut=async(t,e)=>{let r=je(e,t);if(r instanceof Promise)return r;let i=t;r&&(i=w(r));try{let[n,o]=pe(i),a=await(await w.fetchImplementation(n,{...o,method:o.method.toLowerCase()})).json();return i.jsonpath&&i.jsonpath!="$"?H(a,i.jsonpath):a}catch(n){return{}}};async function It(t){if(!t)return t;if(J(t))return Ut(t);let e=Object.keys(t),r=await Promise.all(e.map(i=>J(t[i])?Ut(t[i],i):null).filter(Boolean));return e.reduce((i,n)=>({...i,[n]:J(t[n])?r.shift():t[n]}),{})}function He(t){return t?J(t)||Object.values(t).some(J):!1}w.clean=We;w.toFetchArguments=pe;w.fetchOne=Ut;w.fetch=It;w.isDataSettings=J;w.hasDataSettings=He;w.fetchImplementation=(...t)=>fetch(...t);function fe(t){var e,r,i,n,o,s,a,l;let d,h=t.getAttribute("src");if(h){let _=nt(h);if(!_)throw new Error(`Could not parse FEAAS Component source: ${h}`);var{cdn:f,library:p,component:c,version:u,revision:b}=_}let A=t.getAttribute("data");if(A!=null&&A!="")try{d=typeof A=="string"?JSON.parse(A):{}}catch(_){console.error(_)}let g=t.getAttribute("fetch");return{data:d||{},cdn:(r=(e=t.getContextAttribute("cdn"))!==null&&e!==void 0?e:f)!==null&&r!==void 0?r:N,library:(i=t.getAttribute("library"))!==null&&i!==void 0?i:p,component:(n=t.getAttribute("component"))!==null&&n!==void 0?n:c,version:(s=(o=t.getAttribute("version"))!==null&&o!==void 0?o:u)!==null&&s!==void 0?s:"responsive",revision:(l=(a=t.getAttribute("revision"))!==null&&a!==void 0?a:b)!==null&&l!==void 0?l:"published",hostname:t.getAttribute("hostname"),template:t.getAttribute("template"),instance:t.getAttribute("instance"),editable:t.getAttribute("editable")!=null,suspended:t.getAttribute("suspended")!=null,lastModified:t.getAttribute("last-modified"),fetch:g=="false"||g==null&&t.hasAttribute("fetch")?[]:g==null||g=="true"?["data","template","stylesheet"]:g.split(/(\s+|\-)+/g).filter(Boolean)}}var st=class extends E{setData(e){this.set({data:e})}getProps(){return fe(this)}isJSONAttribute(e){return e=="data"}attributeChangedCallback(e,r,i){r!==i&&((e=="library"||e=="component"||e=="revision"||e=="version")&&(this.payload=void 0,this.alreadyRendered&&this.connected&&(this.needsRefresh=!0,this.needsToFetchTemplate=!0)),super.attributeChangedCallback(e,r,i),e=="data"&&(this.needsRefresh=!0,(this.props.fetch.includes("data")||this.alreadyRendered||!w.hasDataSettings(this.props.data))&&this.fetchData()))}async fetchData(){this.readyData=void 0,this.whenDataReady=this.whenDataReady.restart();let e=await w.fetch(this.props.data),r=this.alreadyRendered;await this.whenDataReady.resolve(e),r&&this.advance()}getEditor(){var e;return(e=document.querySelector("feaas-context"))===null||e===void 0?void 0:e.refs.editor}constructor(){super(),this.readyData={},this.whenDataReady=S(r=>this.readyData=r,r=>this.onError(r)),this.defaultProps={cdn:N,revision:"published",version:"responsive",editable:!1,suspended:!1,data:{}},this.onLoad=r=>{this.payload=r,this.advance()};let e=this.getAttribute("data");this.getAttribute("data")||this.whenDataReady.resolve({}),this.addEventListener("click",()=>{this.props.editable&&this.edit()})}edit(){let e=this.getEditor();if(e!=null&&e.setTarget(this))return e.open(),!0}getOriginal(){let e=this.getAttribute("data-path-scope");if(e){for(var r=this;(r=r.previousElementSibling)&&r.getAttribute("data-path-scope")==e;)var i=r;return i}}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null&&this.props.component!=null&&this.props.version!=null}async load(){var e;if(this.getOriginal())return;let r=()=>{this.payload!=null&&(i||this.readyData&&this.onLoad(this.payload))};if(this.props.fetch.includes("stylesheet"))var i=$t({...this.props}).then(()=>{i=null,r()});if(this.props.fetch.includes("template")||this.needsToFetchTemplate){this.needsToFetchTemplate=!1;var n=V(this.props,o=>{this.payload=o,this.needsRefresh=!0,r()})}else this.payload=(e=this.props.template)!==null&&e!==void 0?e:this.innerHTML;return Promise.all([i,this.whenDataReady.then(()=>r()),n]).then(()=>this.payload)}flush(){this.readyData&&super.flush()}update(){if(this.alreadyRendered=!0,console.log("=== feaascomponent update",this.alreadyRendered),!(!this.props.fetch.includes("data")&&!this.props.fetch.includes("template")&&this.firstElementChild&&!this.needsRefresh))if(Array.from(this.children).filter(e=>e.tagName!="BR").length>0&&!this.needsRefresh)console.log("=== feaas component render dom",this.readyData),R(this,this.readyData);else{if(this.needsRefresh=!1,this.getOriginal())return;U(this,this.payload,this.readyData)}}};st.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet","fetch"];st.register("feaas-component");function me(t){return{opacity:t!=null&&t.getAttribute("opacity")?parseFloat(t==null?void 0:t.getAttribute("opacity")):1,hidden:(t==null?void 0:t.getAttribute("hidden"))!=null}}var at=class extends E{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return me(this)}attributeChangedCallback(e,r,i){if(r!==i)return e=="hidden"&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),i?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all")),super.attributeChangedCallback(e,r,i)}connectedCallback(){this.payload=null,super.connectedCallback(),this.attributeChangedCallback("hidden",this.getAttribute("hidden"),this.getAttribute("hidden")),this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`