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