@sitecore-feaas/clientside 0.3.10 → 0.3.11-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -0
- package/build/components/FEAASComponent.js.map +1 -1
- package/build/components/FEAASElement.js +12 -8
- package/build/components/FEAASElement.js.map +1 -1
- package/build/dom/rendering.js +16 -13
- package/build/dom/rendering.js.map +1 -1
- package/build/ui/FEAASExternal.js +29 -14
- package/build/ui/FEAASExternal.js.map +1 -1
- package/build/ui/react.js +58 -13
- package/build/ui/react.js.map +1 -1
- package/build/utils/data.js +9 -1
- package/build/utils/data.js.map +1 -1
- package/dist/browser/headless.cjs +7 -7
- package/dist/browser/headless.cjs.map +3 -3
- package/dist/browser/headless.esm.js +7 -7
- package/dist/browser/headless.esm.js.map +1 -1
- package/dist/browser/index.cjs +6 -6
- package/dist/browser/index.cjs.map +3 -3
- package/dist/browser/index.esm.js +6 -6
- package/dist/browser/index.esm.js.map +1 -1
- package/dist/browser/react.cjs +7 -7
- package/dist/browser/react.cjs.map +3 -3
- package/dist/browser/react.esm.js +7 -7
- package/dist/browser/react.esm.js.map +1 -1
- package/dist/node/headless.cjs +4 -4
- package/dist/node/headless.cjs.map +3 -3
- package/dist/node/headless.esm.js +4 -4
- package/dist/node/headless.esm.js.map +3 -3
- package/dist/node/index.cjs +4 -4
- package/dist/node/index.cjs.map +3 -3
- package/dist/node/index.esm.js +5 -5
- package/dist/node/index.esm.js.map +3 -3
- package/dist/node/react.cjs +6 -6
- package/dist/node/react.cjs.map +3 -3
- package/dist/node/react.esm.js +6 -6
- package/dist/node/react.esm.js.map +3 -3
- package/headless.cjs +4 -4
- package/headless.cjs.map +3 -3
- package/headless.js +4 -4
- package/headless.js.map +3 -3
- package/package.json +5 -1
- package/react.cjs +7 -7
- package/react.cjs.map +3 -3
- package/react.js +7 -7
- package/react.js.map +3 -3
- package/src/components/FEAASComponent.tsx +1 -0
- package/src/components/FEAASElement.tsx +15 -10
- package/src/dom/rendering.ts +16 -14
- package/src/ui/FEAASExternal.tsx +35 -15
- package/src/ui/react.tsx +73 -16
- package/src/utils/data.ts +8 -1
- package/test/FEAASComponent.react.test.tsx +99 -19
- package/test/FEAASExternal.test.tsx +2 -2
- package/test/ServerComponent.test.tsx +31 -15
- package/test/dom.test.ts +70 -0
- package/types/components/FEAASComponent.d.ts +1 -0
- package/types/components/FEAASComponent.d.ts.map +1 -1
- package/types/components/FEAASElement.d.ts.map +1 -1
- package/types/dom/rendering.d.ts.map +1 -1
- package/types/tsbuildinfo +1 -1
- package/types/ui/FEAASExternal.d.ts +9 -2
- package/types/ui/FEAASExternal.d.ts.map +1 -1
- package/types/ui/react.d.ts +17 -7
- package/types/ui/react.d.ts.map +1 -1
- package/types/ui/tsbuildinfo +1 -1
- package/types/utils/data.d.ts +1 -0
- package/types/utils/data.d.ts.map +1 -1
package/dist/node/react.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var $e=Object.defineProperty;var Y=(e,t)=>{for(var r in t)$e(e,r,{get:t[r],enumerable:!0})};var jt={};Y(jt,{Component:()=>nt,ComponentProps:()=>fe,Context:()=>W,ControlledPromise:()=>S,DEFAULT_CDN_URL:()=>_,DOM:()=>ft,DataPath:()=>pt,DataScope:()=>ct,DataSettings:()=>E,Element:()=>A,FEAASComponent:()=>nt,FEAASComponentsProps:()=>fe,FEAASContext:()=>W,FEAASContextProps:()=>Se,FEAASEditor:()=>st,FEAASEditorProps:()=>Ee,FEAASElement:()=>A,FEAASLoader:()=>ot,FEAASLoaderProps:()=>me,FEAASPicker:()=>at,FEAASPickerProps:()=>xe,FEAASStylesheet:()=>wt,FEAASStylesheetProps:()=>ge,InvalidResponse:()=>mt,JSONPath:()=>m,Loader:()=>ot,MyComponent:()=>dt,Picker:()=>at,Stylesheet:()=>wt,Thumbnail:()=>Ct,adjustNumbers:()=>Zt,autoloadScripts:()=>Kt,cleanCollectionBit:()=>Q,clearFetchCache:()=>ze,createStylesheet:()=>ue,fetchAndRevalidate:()=>et,fetchAndRevalidateComponent:()=>J,fetchAndRevalidateStylesheet:()=>bt,fetchBypassingCache:()=>gt,fetchCache:()=>tt,fetchComponent:()=>Ot,fetchData:()=>$t,fetchToValidateCache:()=>rt,fetchWithCacheAwareness:()=>U,findStylesheet:()=>ce,getComponentSource:()=>Je,getComponentURL:()=>it,getFetchCache:()=>le,getFramePosition:()=>Ce,getHumanizedLabel:()=>Qt,getLastPathBit:()=>te,getQualifier:()=>Xt,getStylesheetSource:()=>Ve,getStylesheetURL:()=>I,loadScript:()=>Z,loadStylesheet:()=>yt,loadStylesheetAllowStale:()=>Mt,normalizeCollectionScope:()=>ht,observeDOMElement:()=>qt,parseComponentSource:()=>j,parseLimit:()=>Gt,parseRange:()=>Yt,parseStylesheetSource:()=>vt,queryObject:()=>z,queryScopes:()=>X,renderComponent:()=>Dt,renderComponentElement:()=>Ke,renderComponentPromise:()=>he,renderDOMContent:()=>F,renderDOMElement:()=>R,renderHTMLContent:()=>se,renderStylesheet:()=>qe,renderStylesheetPromise:()=>de,serializeCH1RichText:()=>D,setDOMAttribute:()=>$});function S(e,t=r=>{}){var r;let i=()=>{var n,s;let o=new Promise((l,d)=>{n=u=>{e==null||e(u),l(u)},s=d});var a=Object.assign(o,{resolve:n,reject:s,restart:i,first:r});return r=a,a.catch(t),a};return i()}var Fe=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,A=class extends Fe{getProps(t){return{}}constructor(){super(),this.defaultProps={},this.connected=!1,this.refs={},this.descendants=[],this.whenLoaded=S(t=>{this.payload=t}),this.whenRendered=S(()=>this.initialized=!0,()=>cancelAnimationFrame(this.nextRender)),this.addEventListener("feaasMount",this),this.addEventListener("feaasUnmount",this)}getRoot(){return this}attributeChangedCallback(t,r,i){this.set()}connectedCallback(){this.mount()}disconnectedCallback(){this.unmount()}mount(){try{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 i;return(i=r.mount)===null||i===void 0?void 0:i.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){if(typeof process!="undefined"&&process.env.TESTING)return;let r=t[0];console.log(r+" "+t.slice(1).map(i=>i&&typeof i=="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=!1)}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(i=>[!r||i.tagName.startsWith("FEAAS-")?i:null,i.shadowRoot?this.getElements(i.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,i;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&&((i=t.refs).parentReact||(i.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",i=!1){let n=new CustomEvent("feaasError",{bubbles:!0,composed:!0,detail:t});if(this.dispatchEventIndirectly(n),this.whenLoaded.reject(t),!n.defaultPrevented&&!i){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 i=(r=(t=this.payload)===null||t===void 0?void 0:t.ReactDOM)===null||r===void 0?void 0:r.flushSync;i?i(()=>this.update()):this.update()}load(){return Promise.resolve(null)}update(){var t,r,i;if(this.payload==null||!this.render)return;let{React:n,ReactDOM:s,ReactDOMClient:o}=this.payload||{};if(!n)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.refs.topReact&&!this.forceUpdateReact?o?(this.reactRoot||(this.reactRoot=o.createRoot(this.getReactRootElement())),this.reactRoot.render(this.getReactElement())):s.render(this.getReactElement(),this.getReactRootElement()):this.forceUpdateReact?(t=this.forceUpdateReact)===null||t===void 0||t.call(this):(i=(r=this.refs.topReact).forceUpdateReact)===null||i===void 0||i.call(r)}invokeReactRendering(){let{React:t,ReactDOM:r}=this.payload||{};if(!this.connected)return null;let i=this.descendants.filter(n=>n.refs.parentReact==this&&n.payload).map((n,s)=>this.getReactElement(n));return this.render({...this.props,children:i},this.payload)}getReactErrorBoundary(t=this,r=t.tagName){if(this.reactErrorBoundary)return this.reactErrorBoundary;let{React:i,ReactDOM:n}=t.payload||{};return this.reactErrorBoundary||(this.reactErrorBoundary=class extends i.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:i,ReactDOM:n}=t.payload||{},s=this.getReactErrorBoundary(),o=this.getReactWrapper(t);return i.createElement(s,{key:t.tagName+"-"+t.getUID(),slot:t.getAttribute("slot")},i.createElement(o,null))}getReactWrapper(t=this,r=t.tagName){if(t.reactWrapper)return t.reactWrapper;let{React:i,ReactDOM:n}=t.payload||{};return t.reactWrapper=s=>{if(t.render){let[o,a]=i.useReducer(l=>l+1,0);return t.forceUpdateReact=a,n.createPortal(i.createElement(i.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 n=this.isJSONAttribute(r),s=this.props[r],o=n?JSON.stringify(s):String(s),a=this.defaultProps[r],l=n?JSON.stringify(a):String(a),d=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),u=this.getAttribute(d);try{var i=n?JSON.stringify(JSON.parse(u)):u}catch(f){var i=null}s==null||o===l?this.removeAttribute(d):(typeof s=="string"||typeof s=="number"||typeof s=="boolean"||n)&&i!=o&&this.setAttribute(d,o)}}catch(n){this.whenRendered.reject(n),this.onError(n,"set")}return this}import(t){return import( /*@vite-ignore*/ /* webpackIgnore: true */ t)}scheduleRender(){this.nextRender==null&&(this.whenRendered=this.whenRendered.restart()),cancelAnimationFrame(this.nextRender),this.nextRender=requestAnimationFrame(()=>{this.nextRender=null,this.advance().catch(t=>{})})}formatURL(t,r){return typeof t=="string"&&t.match(/^\/[^\/]/)?r+t:t}getContextAttribute(t,r=this){for(var i=this;i=i.parentElement||(i.parentNode instanceof ShadowRoot?i.parentNode.host:null);)if(i.getAttribute(t)!=null)return i.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 B=class extends A{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")]).then(([t,r])=>({React:t,ReactDOM:r}))}render({},{React:t}){return t.createElement(t.Fragment,null)}},dt=class extends B{constructor(){super(...arguments),this.useShadowRoot=!0}getProps(){return{counter:parseFloat(this.getAttribute("counter"))}}render({counter:t},{React:r}){let[i,n]=r.useState(0);return r.useEffect(()=>{n(s=>s+1)},[t]),r.createElement(r.Fragment,null,r.createElement("p",null,"Rendering attribute: ",t),r.createElement("p",null,"Triggered updates: ",i))}};dt.observedAttributes=["counter"];var ft={};Y(ft,{renderDOMContent:()=>F,renderDOMElement:()=>R,renderHTMLContent:()=>se,setDOMAttribute:()=>$});var ct={};Y(ct,{JSONPath:()=>m,queryObject:()=>z,queryScopes:()=>X,serializeCH1RichText:()=>D});import Ue from"vm";var{hasOwnProperty:x}=Object.prototype;function M(e,t){return e=e.slice(),e.push(t),e}function kt(e,t){return t=t.slice(),t.unshift(e),t}var Nt=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,i,n){if(!(this instanceof m))try{return new m(e,t,r,i,n)}catch(o){if(!o.avoidNew)throw o;return o.value}typeof e=="string"&&(n=i,i=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=x.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||i||null,this.otherTypeCallback=e.otherTypeCallback||n||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 Nt(a);return a}}m.prototype.evaluate=function(e,t,r,i){let n=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=i||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(!x.call(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:t}=e),o=x.call(e,"flatten")?e.flatten:o,this.currResultType=x.call(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=x.call(e,"sandbox")?e.sandbox:this.currSandbox,a=x.call(e,"wrap")?e.wrap:a,this.currPreventEval=x.call(e,"preventEval")?e.preventEval:this.currPreventEval,r=x.call(e,"callback")?e.callback:r,this.currOtherTypeCallback=x.call(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,n=x.call(e,"parent")?e.parent:n,s=x.call(e,"parentProperty")?e.parentProperty:s,e=e.path}if(n=n||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 d=this._trace(l,t,["$"],n,s,r).filter(function(u){return u&&!u.isParentSelector});return d.length?!a&&d.length===1&&!d[0].hasArrExpr?this._getPreferredOutput(d[0]):d.reduce((u,f)=>{let h=this._getPreferredOutput(f);return o&&Array.isArray(h)?u=u.concat(h):u.push(h),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 i=this._getPreferredOutput(e);e.path=typeof e.path=="string"?e.path:m.toPathString(e.path),t(i,r,e)}};m.prototype._trace=function(e,t,r,i,n,s,o,a){let l;if(!e.length)return l={path:r,value:t,parent:i,parentProperty:n,hasArrExpr:o},this._handleCallback(l,s,"value"),l;let d=e[0],u=e.slice(1),f=[];function h(c){Array.isArray(c)?c.forEach(p=>{f.push(p)}):f.push(c)}if((typeof d!="string"||a)&&t&&x.call(t,d))h(this._trace(u,t[d],M(r,d),t,d,s,o));else if(d==="*")this._walk(t,c=>{h(this._trace(u,t[c],M(r,c),t,c,s,!0,!0))});else if(d==="..")h(this._trace(u,t,r,i,n,s,o)),this._walk(t,c=>{typeof t[c]=="object"&&h(this._trace(e.slice(),t[c],M(r,c),t,c,s,!0))});else{if(d==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:u,isParentSelector:!0};if(d==="~")return l={path:M(r,d),value:n,parent:i,parentProperty:null},this._handleCallback(l,s,"property"),l;if(d==="$")h(this._trace(u,t,r,null,null,s,o));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(d))h(this._slice(d,u,t,r,i,n,s));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(t,p=>{this._eval(c,t[p],p,r,i,n)&&h(this._trace(u,t[p],M(r,p),t,p,s,!0))})}else if(d[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");h(this._trace(kt(this._eval(d,t,r[r.length-1],r.slice(0,-1),i,n),u),t,r,i,n,s,o))}else if(d[0]==="@"){let c=!1,p=d.slice(1,-2);switch(p){case"scalar":(!t||!["object","function"].includes(typeof t))&&(c=!0);break;case"boolean":case"string":case"undefined":case"function":typeof t===p&&(c=!0);break;case"integer":Number.isFinite(t)&&!(t%1)&&(c=!0);break;case"number":Number.isFinite(t)&&(c=!0);break;case"nonFinite":typeof t=="number"&&!Number.isFinite(t)&&(c=!0);break;case"object":t&&typeof t===p&&(c=!0);break;case"array":Array.isArray(t)&&(c=!0);break;case"other":c=this.currOtherTypeCallback(t,r,i,n);break;case"null":t===null&&(c=!0);break;default:throw new TypeError("Unknown value type "+p)}if(c)return l={path:r,value:t,parent:i,parentProperty:n},this._handleCallback(l,s,"value"),l}else if(d[0]==="`"&&t&&x.call(t,d.slice(1))){let c=d.slice(1);h(this._trace(u,t[c],M(r,c),t,c,s,o,!0))}else if(d.includes(",")){let c=d.split(",");for(let p of c)h(this._trace(kt(p,u),t,r,i,n,s,!0))}else!a&&t&&x.call(t,d)&&h(this._trace(u,t[d],M(r,d),t,d,s,o,!0))}if(this._hasParentSelector)for(let c=0;c<f.length;c++){let p=f[c];if(p&&p.isParentSelector){let b=this._trace(p.expr,t,p.path,i,n,s,o);if(Array.isArray(b)){f[c]=b[0];let C=b.length;for(let y=1;y<C;y++)c++,f.splice(c,0,b[y])}else f[c]=b}}return f};m.prototype._walk=function(e,t){if(Array.isArray(e)){let r=e.length;for(let i=0;i<r;i++)t(i)}else e&&typeof e=="object"&&Object.keys(e).forEach(r=>{t(r)})};m.prototype._slice=function(e,t,r,i,n,s,o){if(!Array.isArray(r))return;let a=r.length,l=e.split(":"),d=l[2]&&Number.parseInt(l[2])||1,u=l[0]&&Number.parseInt(l[0])||0,f=l[1]&&Number.parseInt(l[1])||a;u=u<0?Math.max(0,u+a):Math.min(a,u),f=f<0?Math.max(0,f+a):Math.min(a,f);let h=[];for(let c=u;c<f;c+=d)this._trace(kt(c,t),r,i,n,s,o,!0).forEach(b=>{h.push(b)});return h};m.prototype._eval=function(e,t,r,i,n,s){this.currSandbox._$_parentProperty=s,this.currSandbox._$_parent=n,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;let o=e.includes("@path");o&&(this.currSandbox._$_path=m.toPathString(i.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,i="$";for(let n=1;n<r;n++)/^(~|\^|@.*?\(\))$/u.test(t[n])||(i+=/^[0-9*]+$/u.test(t[n])?"["+t[n]+"]":"['"+t[n]+"']");return i};m.toPointer=function(e){let t=e,r=t.length,i="";for(let n=1;n<r;n++)/^(~|\^|@.*?\(\))$/u.test(t[n])||(i+="/"+t[n].toString().replace(/~/gu,"~0").replace(/\//gu,"~1"));return i};m.toPathArray=function(e){let{cache:t}=m;if(t[e])return t[e].concat();let r=[],n=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]=n,t[e].concat()};m.prototype.vm=Ue;function z(e,t){var r;return((r=m({path:t,json:e}))===null||r===void 0?void 0:r.flat(1/0))||[]}function X(e,t,r=!1,i=e){var n=t;let s=Object.keys(e).sort((a,l)=>l.length-a.length);for(let a of s)if(t.startsWith(a)){if(a==t){if(r)return e[a];continue}n=t.substring(a.length+1),i=e[a];break}var o=z(i,n);return Array.isArray(o)&&(o==null?void 0:o.length)==0&&(o=[n.replace(/^.*?\./,"_."),n.replace(/^.*?\./,""),n.replace(/^([^.]+).*?\.\$([\.\[])/,"$1$2"),n.replace(/^.*?\.\$([\.\[])/,"_$1"),n.replace(/^.*?\.\$([\.\[])/,"$$$1"),n.replace(/^[^.]+$/,"_")].filter((a,l,d)=>d.indexOf(a)===l).reduce((a,l)=>a.length>0?a:z(i,l),[])),r&&Array.isArray(o)?o[0]:o}function Tt(e,t={},r){return r?`<${r}${Object.entries(t).map(([i,n])=>n!=null&&` ${i}="${n}"`).filter(Boolean).join("")}>${D(e)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):D(e)}function D(e){var t;if(Array.isArray(e))return e.map(D).join(`
|
|
2
|
-
`).trim();if(typeof e=="string")return e;if(e==null)return"";switch(e.type){case"heading":let{level:r,...i}=e.attrs;return Tt(e.content,i,"h"+r);case"text":return(e.marks||[]).reduce((n,s)=>Tt(n,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 Tt(e.content||e.text,e.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[e.type])}}var L=class{constructor(t,r=1,i){this.ownerDocument={createElement(n){return new L(n)}},this.nodeName=t,this.nodeType=r,this.textContent=i,this.attributes=[],this.childNodes=[]}setAttribute(t,r){let i=this.attributes.find(n=>n.name===t);i?i.value=r:this.attributes.push({name:t,value:r})}getAttribute(t){let r=this.attributes.find(i=>i.name===t);return r?r.value:void 0}insertBefore(t,r){if(t.parentNode=this,r===null)this.childNodes.push(t);else{let i=this.childNodes.indexOf(r);i!==-1&&this.childNodes.splice(i,0,t)}}removeAttribute(t){let r=this.attributes.findIndex(i=>i.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 _t(this.childNodes)}set innerHTML(t){this.childNodes=ut(String(t!=null?t:""))}get outerHTML(){return _t([this])}get children(){return this.childNodes.filter(t=>t.nodeType==1)}closest(t){let r=this;for(;r;){if(Vt(t,r))return r;r=r.parentNode}return null}querySelectorAll(t){let r=t.split(/\s*,\s*/),i=[],n=s=>{for(let o of r)if(Vt(o,s)){i.push(s);break}for(let o of s.childNodes)n(o)};for(let s of this.childNodes)n(s);return i}querySelector(t){return this.querySelectorAll(t)[0]}findSibling(t,r){if(!this.parentNode)return null;let i=this.parentNode.childNodes,n=i.indexOf(this);if(n===-1)return null;for(let s=n+t;s>=0&&s<i.length;s+=t){let o=i[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 L(this.nodeName,this.nodeType);if(r.attributes=JSON.parse(JSON.stringify(this.attributes)),this.textContent&&(r.textContent=this.textContent),t)for(let i of this.childNodes){let n=i.cloneNode(!0);r.appendChild(n)}return r}get parentElement(){var t;return((t=this.parentNode)===null||t===void 0?void 0:t.nodeType)==1?this.parentNode:null}};function Vt(e,t){let r=e.match(/([.#]?[\w-]+|\[([\w-]+)(="([^"]*)")?\])/g);if(!r)return!1;for(let i of r)if(i.startsWith("#")){if(t.getAttribute("id")!==i.slice(1))return!1}else if(i.startsWith(".")){if(!(t.getAttribute("class")||"").split(" ").includes(i.slice(1)))return!1}else if(i.startsWith("[")){let n=i.match(/^\[([\w-]+)(="([^"]*)")?\]$/);if(n){let s=n[1],o=n[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!==i)return!1;return!0}function ut(e){var t;let r=[],i=[];for(;e;){let n=e.match(/^<([\w-]+)(\s[^>]*)?>/),s=e.match(/^<\/([\w-]+)>/);if(n){let o=n[1],l=((t=(n[2]||"").match(/([\w-]+)(="([^"]*)")?/g))===null||t===void 0?void 0:t.map(u=>{let[f,h,,c]=u.match(/([\w-]+)(="([^"]*)")?/);return{name:h,value:Ie(c||"")}}))||[],d=new L(o,1);if(d.attributes=l,i.length>0){let u=i[i.length-1];u.childNodes.push(d),d.parentNode=u}else r.push(d);i.push(d),e=e.slice(n[0].length)}else if(s)i.pop(),e=e.slice(s[0].length);else{let o=e.indexOf("<"),a=e.slice(0,o!==-1?o:void 0),l=new L("#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);e=e.slice(a.length)}}return r}function je(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ie(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")}function _t(e){return e.map(t=>{if(t.nodeType===3)return t.textContent||"";let{nodeName:r,attributes:i}=t,n=i.map(({name:o,value:a})=>` ${o}="${je(String(a))}"`).join(""),s=_t(t.childNodes);return["img","input","br"].includes(r)?`<${r}${n} />`:`<${r}${n}>${s}</${r}>`}).join("")}function We(e,t,r){return Pt(e,t,r)[0].outerHTML}function Pt(e,t,r){var i;let n=((i=r==null?void 0:r.processTemplate)===null||i===void 0?void 0:i.call(r,null,e,t))||e;return ut(n).map(o=>R(o,t,r))}function qt(e){let t=new e.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(i=>{let n=i.target,s=n.getAttribute("data-embed-src");s&&Z(n,s),i.addedNodes&&i.addedNodes.forEach(o=>{o.nodeType==1&&Kt(o,!1)})})});return t.observe(e,{attributes:!0,subtree:!0,childList:!0}),t}function Kt(e,t=!0){let r=e.querySelectorAll("[data-embed-src]");for(var i=0;i<r.length;i++){let n=r[i];Z(n,n.getAttribute("data-embed-src"))}if(t)return qt(e)}function Z(e,t){for(var r=e;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")==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 pt={};Y(pt,{adjustNumbers:()=>Zt,cleanCollectionBit:()=>Q,getHumanizedLabel:()=>Qt,getLastPathBit:()=>te,getQualifier:()=>Xt,normalizeCollectionScope:()=>ht,parseLimit:()=>Gt,parseRange:()=>Yt});var Gt=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},Yt=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(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},Xt=e=>{var t;return(t=e==null?void 0:e.match(/(\.\*|\[[^\]]*\])$/))===null||t===void 0?void 0:t[0]};function Q(e){return e.replace(/(\.?\[[^\]\[]*\]|\.\*)$/g,"")}function ht(e){return Q(e)+".*"}function Zt(e,t){return e==null?void 0:e.replace(/(.|^)(\d+)/g,(r,i,n)=>i+(i==":"?n:String(parseInt(n)+t)))}function Qt(e,t=2){var r=Q(e).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(-t).join(" ")}function te(e){return Q(e).split(".").pop()}var He=["January","February","March","April","May","June","July","August","September","October","November","December"],ee=e=>{if(!e||typeof e.getDay!="function")return;let t=e.getFullYear(),r=He[e.getMonth()],i=e.getDate();return`${r} ${i}, ${t}`},re=function(e){return String(new Date(e))!=="Invalid Date"&&!isNaN(Number(new Date(e)))};function ne(e){let t=e.getAttribute("data-path-scope");for(var r=0,i=e;i=i.previousElementSibling;)i.getAttribute("data-path-scope")==t&&r++;return r}function Be(e,t,r){let i=e.getAttribute("data-path-scope");if(i==null)return;var n=ne(e);if(n!=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=n+1,a=e,l=e;l=l.nextElementSibling;)l.getAttribute("data-path-scope")==i&&(o++,a=l);for(var d=o;d<t;d++)s.insertBefore(a.cloneNode(!0),a.nextElementSibling);for(var d=Math.max(1,t);d<o;d++)a=a.previousElementSibling,s.removeChild(a.nextElementSibling)}}function $(e,t,r,i){var n,s;if(e){var o=e;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=D(r)),i!=null&&i.processValue&&(r=i==null?void 0:i.processValue(e,t,r));var a=t.replace("data-path-","");if(t=="data-path-src"){let p=Array.from(e.children).find(b=>b.localName=="picture")||e;o=e.localName=="img"?e:p.querySelector("img, video")}else if(t=="data-path-href")o=e.querySelector("a")||e.closest("a");else if(t=="data-path-alt")o=(Array.from(e.children).find(b=>b.localName=="picture")||e).querySelector("img, picture");else if(t=="data-path-hidden")r=r?null:!0;else if(t=="data-path"||t=="data-embed-html"||t=="html")a="innerHTML";else if(t=="data-embed-src")Z(e,r);else if(t=="data-path-attributes"){let p=((n=e.getAttribute("data-attributes-keys"))===null||n===void 0?void 0:n.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var l in r){var d=r[l];$(e,l,typeof d=="object"&&d?JSON.stringify(d):d,i)}for(var u=0;u<p.length;u++)(r==null||!(p[u]in r))&&$(e,p[u],null,i);$(e,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!!o){var f=String((s=e.getAttribute("data-path-placeholder")||o[a])!==null&&s!==void 0?s:o.getAttribute(a));if(r!=null)if(a=="innerHTML"){for(var h=String(r),c=o;c.parentElement&&c.localName.match(/^(a|var|strong|em|i|b)$/);)c=c.parentElement;c.localName.match(/p|h\d|button|time|li/)&&(h=h.replace(/<(p|h\d|li|ul)[^>]*?>|<\/(p|h\d|li|ul)[^>]*?>/g," ").trim().replace(/\s+/g," ")),String(c.getAttribute("class")).includes("-inline--time")&&re(h)&&(h=ee(new Date(h))),o.innerHTML!=h&&(o.innerHTML=h)}else o.getAttribute(a)!=r&&o.setAttribute(a,r);else a=="innerHTML"?o.innerHTML=f:o.removeAttribute(a)}}}var ie=["data-attributes-keys","data-path-attributes","data-path-scope"];function R(e,t,r,i){var n,s,o;let a=e;if(i||(t=((n=r==null?void 0:r.processData)===null||n===void 0?void 0:n.call(r,a,t))||t),a.nodeType==1){let u=a.getAttribute("data-path-scope");if(u){let h=ne(a),c=X(t,u,!1);h==0&&Be(a,((s=r==null?void 0:r.shouldRepeat)===null||s===void 0?void 0:s.call(r,a,c))===!1?1:c.length,r),t={...t,[ht(u)]:c[h]}}let f=Array.prototype.slice.call(a.attributes).sort((h,c)=>ie.indexOf(h.name)-ie.indexOf(c.name));for(var l=0;l<f.length;l++){let{name:h,value:c}=f[l];h.startsWith("data-path")&&h!="data-path-scope"&&$(a,h,X(t,c,!0),r),h=="data-embed-src"&&$(a,h,a.getAttribute(h),r)}}for(var l=0,d;d=a.childNodes[l++];)oe(d)&&R(d,t,r,!0);return i||(o=r==null?void 0:r.onRender)===null||o===void 0||o.call(r,a,t),a}function oe(e){return e.nodeType==1}function F(e,t,r,i){var n;let s=((n=i==null?void 0:i.processTemplate)===null||n===void 0?void 0:n.call(i,e,t,r))||t;if(e.innerHTML=s,e.classList.add("-feaas"),(e.closest(".component.feaas")||e).className.includes("-theme--"))for(var a=0,l;l=e.childNodes[a++];)oe(l)&&(l.className=l.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return R(e,r,i)}function se(e,t,r,i=!1){var n;let s=((n=r==null?void 0:r.processTemplate)===null||n===void 0?void 0:n.call(r,null,e,t))||e;if(typeof document=="undefined"||i){let o=ut(s);return R(o[0],t,r).outerHTML}else{let o=document.createElement("div");return o.innerHTML=s,R(o,t,r),o.innerHTML}}var ae=["initial","check","updated"],tt={};function ze(){tt={}}async function et(e,t,r,i,n=tt){return U({url:e,options:t,validator:r,callback:i,cache:n}).then(rt).then(s=>s.response)}function le(e,t=!1){let r=String(e).replace("?head","");var i=tt[r];return!i&&!t&&(i=tt[r]={phase:null,initial:S(),check:S(),updated:S(),final:S()}),i}var mt=class extends Error{};async function U({url:e,options:t,validator:r,callback:i,cache:n},s="initial"){let o=new Date;if(n!=null){var a=le(e);if(ae.indexOf(a.phase)>=ae.indexOf(s))var l=a[s];else a.phase=s}let d=await(l||fetch(e,t));if(!l&&a&&(d.ok?a[s].resolve(d):a[s].reject(new Error("Fetch failed"))),!d.ok)throw new Error("Fetch failed");let u=new Date(d.headers.get("date"))<o||l&&s=="initial"&&(a.phase=="updated"||a.phase=="check");if((r==null?void 0:r(d,u))===!1)throw new mt("Response is not valid");return await(i==null?void 0:i(d,s,u)),{url:e,options:t,isCached:u,response:d,validator:r,callback:i,cache:n}}async function rt(e){let{url:t,isCached:r,options:i,validator:n,response:s,cache:o}=e;if(r){let{response:a}=await U({url:t+"?head",options:{...i,method:"HEAD",cache:"no-cache"},validator:n,cache:o},"check");if(a.headers.get("last-modified")!=s.headers.get("last-modified"))return gt(e)}return e}async function gt(e){return U({...e,options:{...e.options,cache:"reload"}},"updated")}var _="https://feaas.blob.core.windows.net";function j(e){let t=e.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(t){var[,r,i,n,s,o]=t;return{cdn:r,library:i,component:n,version:s,revision:o}}}function Je(e){if(!e||!e.library||!e.component)throw new Error("Component requires `library` and `component` properties");return`${e.cdn&&e.cdn!=_?`${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 Ve(e){return`${e.cdn&&e.cdn!=_?`${e.cdn}/styles/`:""}${e.library}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function vt(e){let t=e.match(/^(?:(.*?)\/styles\/)?([^\/]+)(?:\/(published|staged|saved|\d+)(?:.css)?)?$/);if(t){var[,r,i,n]=t;return{cdn:r,library:i,revision:n}}else{let s=j(e);if(s){var{cdn:r,library:i,revision:n}=s;return n!=null&&n.match(/\d/)&&(n=void 0),{cdn:r,library:i,revision:n}}}}function it(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...j(e.src)}),`${e.cdn||e.hostname||_}/components/${e.library}/${e.component}/${e.version}/${e.revision||"published"}.html`}function I(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...vt(e.src)}),`${e.cdn||e.hostname||_}/styles/${e.library}/${e.revision||"published"}.css`}async function J(e,t,r=!1){let i=a=>a.headers.get("x-ms-meta-versionDeletedAt")==null,n=a=>a.clone().text().then(t),s=await Promise.all([e.instance&&U({options:{headers:{Accept:"text/html"},credentials:"omit"},url:it({...e,version:e.instance}),validator:i}).catch(a=>a),U({url:it(e),validator:i}).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 n(o.response),r?o:rt({...o,callback:n}).catch(a=>{if(s[0]==o&&(gt({...o,callback:null,validator:null}),console.log("Fork was deleted"),!(s[1]instanceof Error)))return n(s[1].response),rt({...s[1],callback:n});throw a})}async function Ot(e){typeof e=="string"&&(e={src:e});var t;let{response:r}=await J(e,i=>{t=i},!0);return{...e,template:t,lastModified:r.headers.get("last-modified")}}async function bt(e,t){return typeof e=="string"&&(e={src:e}),et(I(e),{headers:{Accept:"text/css"},credentials:"omit"},r=>r.headers.get("x-ms-meta-deletedAt")==null,(r,i)=>r.clone().text().then(n=>t(n,i)))}function qe(e,t){return de(e,t||(t=document.createElement("style"))),t}function de(e,t){return t||(t=document.createElement("style")),bt(e,(r,i)=>{t.textContent=r}).then(()=>t)}function yt(e,t){var r=ce(e);if(!r)var i=ue(e);return bt(e,(n,s)=>{i&&(i.textContent=n),t==null||t(n,s)}).then(()=>r||i)}function Mt(e){return new Promise((t,r)=>{yt(e,t).catch(r)})}function ce(e){return document.head.querySelector(`style[data-href="${I(e)}"]`)}function ue(e){let t=I(e),r=document.createElement("style");return r.setAttribute("data-href",t),document.head.appendChild(r),r}function Ke(e,t){let r=document.createElement("div");r.innerHTML=e;let i=document.createDocumentFragment();for(;r.firstChild;)i.appendChild(r.firstChild);return R(i,t),r}function Dt(e,t){return he(e,t||(t=document.createElement("div"))),t}async function he(e,t){return t||(t=document.createElement("div")),t.childNodes.length?R(t,e.data,e):"template"in e?F(t,e.template,e.data,e):J(e,r=>F(t,r,e.data,e)).then(()=>t)}function Ge(e){let{params:t,method:r,headers:i,body:n,url:s}=E(e);var o={url:s},a={...i};return i["Content-Type"]==="application/json"&&delete a["Content-Type"],i.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(n).length===0||(o.body=n),Object.keys(t).length>0&&(o={...o,params:t}),o}var At=e=>{if(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 pe(e){let{url:t,headers:r,params:i,method:n,body:s}=E(e),o,a=r["Content-Type"];n!="GET"&&n!="HEAD"&&(a==="application/json"&&(o=JSON.stringify(s)),a==="multipart/form-data"&&(o=Object.keys(s).reduce((d,u)=>(d.append(u,s[u]),d),new FormData)),a==="application/x-www-form-urlencoded"&&(o=new URLSearchParams(s)));let l=Object.keys(i).length?`?${new URLSearchParams(i)}`:"";return[`${t}${l}`,{headers:r,body:o,method:n}]}function E(e){let t={};for(let r in(e==null?void 0:e.headers)||{})if(e.headers.hasOwnProperty(r)){let i=r.replace(/^[a-z]|\-[a-z]/g,n=>n.toUpperCase());t[i]=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 Lt=async e=>{try{let[t,r]=pe(e),n=await(await E.fetchImplementation(t,{...r,method:r.method.toLowerCase()})).json();return e.jsonpath&&e.jsonpath!="$"?z(n,e.jsonpath):n}catch(t){return{}}};async function $t(e){if(!e)return e;if(At(e))return Lt(e);let t=Object.keys(e),r=await Promise.all(t.map(i=>At(e[i])?Lt(e[i]):null).filter(Boolean));return t.reduce((i,n)=>({...i,[n]:At(e[n])?r.shift():e[n]}),{})}E.clean=Ge;E.toFetchArguments=pe;E.fetchOne=Lt;E.fetch=$t;E.isDataSettings=At;E.fetchImplementation=(...e)=>fetch(...e);function fe(e){var t,r,i,n,s,o,a,l;let d,u=e.getAttribute("src");if(u){let y=j(u);if(!y)throw new Error(`Could not parse FEAAS Component source: ${u}`);var{cdn:f,library:h,component:c,version:p,revision:b}=y}let C=e.getAttribute("data");if(C!=null&&C!="")try{d=typeof C=="string"?JSON.parse(C):{}}catch(y){console.error(y)}return{data:d||{},cdn:(r=(t=e.getContextAttribute("cdn"))!==null&&t!==void 0?t:f)!==null&&r!==void 0?r:_,library:(i=e.getAttribute("library"))!==null&&i!==void 0?i:h,component:(n=e.getAttribute("component"))!==null&&n!==void 0?n:c,version:(o=(s=e.getAttribute("version"))!==null&&s!==void 0?s:p)!==null&&o!==void 0?o:"responsive",revision:(l=(a=e.getAttribute("revision"))!==null&&a!==void 0?a:b)!==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"),withStylesheet:e.getAttribute("with-stylesheet")!="false"}}var nt=class extends A{setData(t){this.set({data:t})}getProps(){return fe(this)}isJSONAttribute(t){return t=="data"}attributeChangedCallback(t,r,i){r!==i&&((t=="library"||t=="component"||t=="revision"||t=="version")&&(this.payload=void 0),this.needsRefresh=!0,super.attributeChangedCallback(t,r,i),t==="data"&&this.fetchData())}async fetchData(){this.readyData=void 0,this.whenDataReady=this.whenDataReady.restart();let t=await E.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=S(t=>this.readyData=t,t=>this.onError(t)),this.defaultProps={cdn:_,revision:"published",version:"responsive",withStylesheet:!0,editable:!1,suspended:!1,data:{}},this.onLoad=t=>{this.payload=t,this.advance()},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 i=r;return i}}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null&&this.props.component!=null&&this.props.version!=null}async load(){if(this.getOriginal())return;let t=()=>{this.payload&&(r||this.readyData&&this.onLoad(this.payload))};if(this.props.withStylesheet)var r=Mt({...this.props,revision:"published"}).then(()=>{r=null,t()});return Promise.all([r,this.whenDataReady.then(()=>t()),J(this.props,i=>{this.payload=i,t()})]).then(()=>this.payload)}flush(){this.readyData&&super.flush()}update(){if(this.alreadyRendered=!0,Array.from(this.children).filter(t=>t.tagName!="BR").length>0&&!this.needsRefresh)R(this,this.readyData);else{if(this.needsRefresh=!0,this.getOriginal())return;F(this,this.payload,this.readyData)}}};nt.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet"];nt.register("feaas-component");function me(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 ot=class extends A{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return me(this)}attributeChangedCallback(t,r,i){if(r!==i)return t=="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(t,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=`
|
|
1
|
+
var Be=Object.defineProperty;var Y=(e,t)=>{for(var r in t)Be(e,r,{get:t[r],enumerable:!0})};var Bt={};Y(Bt,{Component:()=>it,ComponentProps:()=>Ae,Context:()=>W,ControlledPromise:()=>R,DEFAULT_CDN_URL:()=>_,DOM:()=>mt,DataPath:()=>ft,DataScope:()=>ut,DataSettings:()=>x,Element:()=>A,FEAASComponent:()=>it,FEAASComponentsProps:()=>Ae,FEAASContext:()=>W,FEAASContextProps:()=>_e,FEAASEditor:()=>st,FEAASEditorProps:()=>Te,FEAASElement:()=>A,FEAASLoader:()=>ot,FEAASLoaderProps:()=>Ce,FEAASPicker:()=>at,FEAASPickerProps:()=>Pe,FEAASStylesheet:()=>Et,FEAASStylesheetProps:()=>Ee,InvalidResponse:()=>gt,JSONPath:()=>m,Loader:()=>ot,MyComponent:()=>ct,Picker:()=>at,Stylesheet:()=>Et,Thumbnail:()=>wt,adjustNumbers:()=>ie,autoloadScripts:()=>te,cleanCollectionBit:()=>Q,clearFetchCache:()=>Xe,createStylesheet:()=>be,fetchAndRevalidate:()=>et,fetchAndRevalidateComponent:()=>z,fetchAndRevalidateStylesheet:()=>vt,fetchBypassingCache:()=>bt,fetchCache:()=>tt,fetchComponent:()=>$t,fetchData:()=>It,fetchToValidateCache:()=>rt,fetchWithCacheAwareness:()=>j,findStylesheet:()=>ge,getComponentSource:()=>Ze,getComponentURL:()=>nt,getFetchCache:()=>fe,getFramePosition:()=>ke,getHumanizedLabel:()=>oe,getLastPathBit:()=>se,getQualifier:()=>ne,getStylesheetSource:()=>Qe,getStylesheetURL:()=>I,loadScript:()=>Z,loadStylesheet:()=>At,loadStylesheetAllowStale:()=>Ft,normalizeCollectionScope:()=>pt,observeDOMElement:()=>Qt,parseComponentSource:()=>U,parseLimit:()=>ee,parseRange:()=>re,parseStylesheetSource:()=>yt,queryObject:()=>V,queryObjectRaw:()=>Mt,queryScopes:()=>X,renderComponent:()=>jt,renderComponentElement:()=>er,renderComponentPromise:()=>ye,renderDOMContent:()=>F,renderDOMElement:()=>N,renderHTMLContent:()=>he,renderStylesheet:()=>tr,renderStylesheetPromise:()=>me,serializeCH1RichText:()=>D,setDOMAttribute:()=>$});function R(e,t=r=>{}){var r;let n=()=>{var i,o;let s=new Promise((l,d)=>{i=c=>{e==null||e(c),l(c)},o=d});var a=Object.assign(s,{resolve:i,reject:o,restart:n,first:r});return r=a,a.catch(t),a};return n()}var Ve=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,A=class extends Ve{getProps(t){return{}}constructor(){super(),this.defaultProps={},this.connected=!1,this.refs={},this.descendants=[],this.whenLoaded=R(t=>{this.payload=t}),this.whenRendered=R(()=>this.initialized=!0,()=>cancelAnimationFrame(this.nextRender)),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{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){if(typeof process!="undefined"&&process.env.TESTING)return;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=!1)}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 o=t.refs.parent;o;o=o.refs.parent)o.render&&((n=t.refs).parentReact||(n.parentReact=o),t.refs.topReact=o)}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(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 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:o,ReactDOMClient:s}=this.payload||{};if(!i)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.refs.topReact&&!this.forceUpdateReact?s?(this.reactRoot||(this.reactRoot=s.createRoot(this.getReactRootElement())),this.reactRoot.render(this.getReactElement())):o.render(this.getReactElement(),this.getReactRootElement()):this.forceUpdateReact?(t=this.forceUpdateReact)===null||t===void 0||t.call(this):(n=(r=this.refs.topReact).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).map((i,o)=>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(s){return{error:s}}componentDidCatch(s,a){console.error(`FEAAS: ${t.tagName} Error:`,s,a),t.onError(s,"react")}render(){if(!this.state.error)return this.props.children}})}getReactElement(t=this,r){let{React:n,ReactDOM:i}=t.payload||{},o=this.getReactErrorBoundary(),s=this.getReactWrapper(t);return n.createElement(o,{key:t.tagName+"-"+t.getUID(),slot:t.getAttribute("slot")},n.createElement(s,null))}getReactWrapper(t=this,r=t.tagName){if(t.reactWrapper)return t.reactWrapper;let{React:n,ReactDOM:i}=t.payload||{};return t.reactWrapper=o=>{if(t.render){let[s,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),o=this.props[r],s=i?JSON.stringify(o):String(o),a=this.defaultProps[r],l=i?JSON.stringify(a):String(a),d=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),c=this.getAttribute(d);try{var n=i?JSON.stringify(JSON.parse(c)):c}catch(f){var n=null}o==null||s===l?this.removeAttribute(d):(typeof o=="string"||typeof o=="number"||typeof o=="boolean"||i)&&n!=s&&this.setAttribute(d,s)}}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()),cancelAnimationFrame(this.nextRender),this.nextRender=requestAnimationFrame(()=>{this.nextRender=null,this.advance().catch(t=>{})})}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 B=class extends A{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")]).then(([t,r])=>({React:t,ReactDOM:r}))}render({},{React:t}){return t.createElement(t.Fragment,null)}},ct=class extends B{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(o=>o+1)},[t]),r.createElement(r.Fragment,null,r.createElement("p",null,"Rendering attribute: ",t),r.createElement("p",null,"Triggered updates: ",n))}};ct.observedAttributes=["counter"];var mt={};Y(mt,{renderDOMContent:()=>F,renderDOMElement:()=>N,renderHTMLContent:()=>he,setDOMAttribute:()=>$});var ut={};Y(ut,{JSONPath:()=>m,queryObject:()=>V,queryObjectRaw:()=>Mt,queryScopes:()=>X,serializeCH1RichText:()=>D});import ze from"vm";var{hasOwnProperty:S}=Object.prototype;function M(e,t){return e=e.slice(),e.push(t),e}function Pt(e,t){return t=t.slice(),t.unshift(e),t}var _t=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(s){if(!s.avoidNew)throw s;return s.value}typeof e=="string"&&(i=n,n=r,r=t,t=e,e=null);let o=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=S.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 s={path:o?e.path:t};o?"json"in e&&(s.json=e.json):s.json=r;let a=this.evaluate(s);if(!a||typeof a!="object")throw new _t(a);return a}}m.prototype.evaluate=function(e,t,r,n){let i=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=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(!S.call(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');({json:t}=e),s=S.call(e,"flatten")?e.flatten:s,this.currResultType=S.call(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=S.call(e,"sandbox")?e.sandbox:this.currSandbox,a=S.call(e,"wrap")?e.wrap:a,this.currPreventEval=S.call(e,"preventEval")?e.preventEval:this.currPreventEval,r=S.call(e,"callback")?e.callback:r,this.currOtherTypeCallback=S.call(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,i=S.call(e,"parent")?e.parent:i,o=S.call(e,"parentProperty")?e.parentProperty:o,e=e.path}if(i=i||null,o=o||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 d=this._trace(l,t,["$"],i,o,r).filter(function(c){return c&&!c.isParentSelector});return d.length?!a&&d.length===1&&!d[0].hasArrExpr?this._getPreferredOutput(d[0]):d.reduce((c,f)=>{let h=this._getPreferredOutput(f);return s&&Array.isArray(h)?c=c.concat(h):c.push(h),c},[]):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,o,s,a){let l;if(!e.length)return l={path:r,value:t,parent:n,parentProperty:i,hasArrExpr:s},this._handleCallback(l,o,"value"),l;let d=e[0],c=e.slice(1),f=[];function h(u){Array.isArray(u)?u.forEach(p=>{f.push(p)}):f.push(u)}if((typeof d!="string"||a)&&t&&S.call(t,d))h(this._trace(c,t[d],M(r,d),t,d,o,s));else if(d==="*")this._walk(t,u=>{h(this._trace(c,t[u],M(r,u),t,u,o,!0,!0))});else if(d==="..")h(this._trace(c,t,r,n,i,o,s)),this._walk(t,u=>{typeof t[u]=="object"&&h(this._trace(e.slice(),t[u],M(r,u),t,u,o,!0))});else{if(d==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:c,isParentSelector:!0};if(d==="~")return l={path:M(r,d),value:i,parent:n,parentProperty:null},this._handleCallback(l,o,"property"),l;if(d==="$")h(this._trace(c,t,r,null,null,o,s));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(d))h(this._slice(d,c,t,r,n,i,o));else if(d.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");let u=d.replace(/^\?\((.*?)\)$/u,"$1");this._walk(t,p=>{this._eval(u,t[p],p,r,n,i)&&h(this._trace(c,t[p],M(r,p),t,p,o,!0))})}else if(d[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");h(this._trace(Pt(this._eval(d,t,r[r.length-1],r.slice(0,-1),n,i),c),t,r,n,i,o,s))}else if(d[0]==="@"){let u=!1,p=d.slice(1,-2);switch(p){case"scalar":(!t||!["object","function"].includes(typeof t))&&(u=!0);break;case"boolean":case"string":case"undefined":case"function":typeof t===p&&(u=!0);break;case"integer":Number.isFinite(t)&&!(t%1)&&(u=!0);break;case"number":Number.isFinite(t)&&(u=!0);break;case"nonFinite":typeof t=="number"&&!Number.isFinite(t)&&(u=!0);break;case"object":t&&typeof t===p&&(u=!0);break;case"array":Array.isArray(t)&&(u=!0);break;case"other":u=this.currOtherTypeCallback(t,r,n,i);break;case"null":t===null&&(u=!0);break;default:throw new TypeError("Unknown value type "+p)}if(u)return l={path:r,value:t,parent:n,parentProperty:i},this._handleCallback(l,o,"value"),l}else if(d[0]==="`"&&t&&S.call(t,d.slice(1))){let u=d.slice(1);h(this._trace(c,t[u],M(r,u),t,u,o,s,!0))}else if(d.includes(",")){let u=d.split(",");for(let p of u)h(this._trace(Pt(p,c),t,r,n,i,o,!0))}else!a&&t&&S.call(t,d)&&h(this._trace(c,t[d],M(r,d),t,d,o,s,!0))}if(this._hasParentSelector)for(let u=0;u<f.length;u++){let p=f[u];if(p&&p.isParentSelector){let g=this._trace(p.expr,t,p.path,n,i,o,s);if(Array.isArray(g)){f[u]=g[0];let C=g.length;for(let v=1;v<C;v++)u++,f.splice(u,0,g[v])}else f[u]=g}}return f};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,o,s){if(!Array.isArray(r))return;let a=r.length,l=e.split(":"),d=l[2]&&Number.parseInt(l[2])||1,c=l[0]&&Number.parseInt(l[0])||0,f=l[1]&&Number.parseInt(l[1])||a;c=c<0?Math.max(0,c+a):Math.min(a,c),f=f<0?Math.max(0,f+a):Math.min(a,f);let h=[];for(let u=c;u<f;u+=d)this._trace(Pt(u,t),r,n,i,o,s,!0).forEach(g=>{h.push(g)});return h};m.prototype._eval=function(e,t,r,n,i,o){this.currSandbox._$_parentProperty=o,this.currSandbox._$_parent=i,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;let s=e.includes("@path");s&&(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");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+": "+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(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 t[e]=i,t[e].concat()};m.prototype.vm=ze;function Mt(e,t){try{return m({path:t,json:e})}catch(r){return[]}}function V(e,t){var r;return((r=Mt(e,t))===null||r===void 0?void 0:r.flat(1/0))||[]}function X(e,t,r=!1,n=e){var i=t;let o=Object.keys(e).sort((a,l)=>l.length-a.length);for(let a of o)if(t.startsWith(a)){if(a==t){if(r)return e[a];continue}i=t.substring(a.length+1),n=e[a];break}var s=V(n,i);return Array.isArray(s)&&(s==null?void 0:s.length)==0&&(s=[i.replace(/^.*?\./,"_."),i.replace(/^.*?\./,""),i.replace(/^([^.]+).*?\.\$([\.\[])/,"$1$2"),i.replace(/^.*?\.\$([\.\[])/,"_$1"),i.replace(/^.*?\.\$([\.\[])/,"$$$1"),i.replace(/^[^.]+$/,"_")].filter((a,l,d)=>d.indexOf(a)===l).reduce((a,l)=>a.length>0?a:V(n,l),[])),r&&Array.isArray(s)?s[0]:s}function Ot(e,t={},r){return r?`<${r}${Object.entries(t).map(([n,i])=>i!=null&&` ${n}="${i}"`).filter(Boolean).join("")}>${D(e)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):D(e)}function D(e){var t;if(Array.isArray(e))return e.map(D).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 Ot(e.content,n,"h"+r);case"text":return(e.marks||[]).reduce((i,o)=>Ot(i,o.attrs,{link:"a",bold:"strong",italic:"em",strike:"s",underline:"u"}[o.type]),(t=e.text)===null||t===void 0?void 0:t.replace(/\s+/," "));default:return Ot(e.content||e.text,e.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[e.type])}}var L=class{constructor(t,r=1,n){this.ownerDocument={createElement(i){return new L(i)}},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 Dt(this.childNodes)}set innerHTML(t){this.childNodes=ht(String(t!=null?t:""))}get outerHTML(){return Dt([this])}get children(){return this.childNodes.filter(t=>t.nodeType==1)}closest(t){let r=this;for(;r;){if(Zt(t,r))return r;r=r.parentNode}return null}querySelectorAll(t){let r=t.split(/\s*,\s*/),n=[],i=o=>{for(let s of r)if(Zt(s,o)){n.push(o);break}for(let s of o.childNodes)i(s)};for(let o of this.childNodes)i(o);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 o=i+t;o>=0&&o<n.length;o+=t){let s=n[o];if(!r||s.nodeType===1)return s}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 L(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 Zt(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 o=i[1],s=i[3],a=t.getAttribute(o);if(typeof s=="undefined"){if(a===void 0)return!1}else if(a!==s)return!1}else return!1}else if(t.nodeName!==n)return!1;return!0}function ht(e){var t;let r=[],n=[];for(;e;){let i=e.match(/^<([\w-]+)(\s[^>]*)?>/),o=e.match(/^<\/([\w-]+)>/);if(i){let s=i[1],l=((t=(i[2]||"").match(/([\w-]+)(="([^"]*)")?/g))===null||t===void 0?void 0:t.map(c=>{let[f,h,,u]=c.match(/([\w-]+)(="([^"]*)")?/);return{name:h,value:qe(u||"")}}))||[],d=new L(s,1);if(d.attributes=l,n.length>0){let c=n[n.length-1];c.childNodes.push(d),d.parentNode=c}else r.push(d);n.push(d),e=e.slice(i[0].length)}else if(o)n.pop(),e=e.slice(o[0].length);else{let s=e.indexOf("<"),a=e.slice(0,s!==-1?s:void 0),l=new L("#text",3);if(l.textContent=a,n.length>0){let d=n[n.length-1];d.childNodes.push(l),l.parentNode=d}else r.push(l);e=e.slice(a.length)}}return r}function Je(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function qe(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")}function Dt(e){return e.map(t=>{if(t.nodeType===3)return t.textContent||"";let{nodeName:r,attributes:n}=t,i=n.map(({name:s,value:a})=>` ${s}="${Je(String(a))}"`).join(""),o=Dt(t.childNodes);return["img","input","br"].includes(r)?`<${r}${i} />`:`<${r}${i}>${o}</${r}>`}).join("")}function Ke(e,t,r){return Lt(e,t,r)[0].outerHTML}function Lt(e,t,r){var n;let i=((n=r==null?void 0:r.processTemplate)===null||n===void 0?void 0:n.call(r,null,e,t))||e;return ht(i).map(s=>N(s,t,r))}function Qt(e){let t=new e.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,o=i.getAttribute("data-embed-src");o&&Z(i,o),n.addedNodes&&n.addedNodes.forEach(s=>{s.nodeType==1&&te(s,!1)})})});return t.observe(e,{attributes:!0,subtree:!0,childList:!0}),t}function te(e,t=!0){let r=e.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];Z(i,i.getAttribute("data-embed-src"))}if(t)return Qt(e)}function Z(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 o=r.ownerDocument.createElement("script");o.setAttribute("type","module"),o.setAttribute("src",t),r.appendChild(o);break}}var ft={};Y(ft,{adjustNumbers:()=>ie,cleanCollectionBit:()=>Q,getHumanizedLabel:()=>oe,getLastPathBit:()=>se,getQualifier:()=>ne,normalizeCollectionScope:()=>pt,parseLimit:()=>ee,parseRange:()=>re});var ee=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},re=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},ne=e=>{var t;return(t=e==null?void 0:e.match(/(\.\*|\[[^\]]*\])$/))===null||t===void 0?void 0:t[0]};function Q(e){return e.replace(/(\.?\[[^\]\[]*\]|\.\*)$/g,"")}function pt(e){return Q(e)+".*"}function ie(e,t){return e==null?void 0:e.replace(/(.|^)(\d+)/g,(r,n,i)=>n+(n==":"?i:String(parseInt(i)+t)))}function oe(e,t=2){var r=Q(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 se(e){return Q(e).split(".").pop()}var Ge=["January","February","March","April","May","June","July","August","September","October","November","December"],ae=e=>{if(!e||typeof e.getDay!="function")return;let t=e.getFullYear(),r=Ge[e.getMonth()],n=e.getDate();return`${r} ${n}, ${t}`},le=function(e){return String(new Date(e))!=="Invalid Date"&&!isNaN(Number(new Date(e)))};function ce(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 Ye(e,t,r){let n=e.getAttribute("data-path-scope");if(n==null)return;var i=ce(e);if(i!=0)return;let o=e.parentNode;if(o!=null){t==0?e.setAttribute("hidden","hidden"):e.getAttribute("hidden")!=null&&e.removeAttribute("hidden");for(var s=i+1,a=e,l=e;l=l.nextElementSibling;)l.getAttribute("data-path-scope")==n&&(s++,a=l);for(var d=s;d<t;d++)o.insertBefore(a.cloneNode(!0),a.nextElementSibling);for(var d=Math.max(1,t);d<s;d++)a=a.previousElementSibling,o.removeChild(a.nextElementSibling)}}function $(e,t,r,n){var i,o;if(!e)return;var s=e;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=D(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(e,t,r));var a=t.replace("data-path-","");if(t=="data-path-src"||t=="data-path-alt"){let g=Array.from(e.children).find(C=>C.localName=="picture")||e;s=e.localName=="img"?e:g.querySelector("img, video")}else if(t=="data-path-href")s=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")a="innerHTML";else if(t=="data-embed-src")Z(e,r);else if(t=="data-path-attributes"){let g=((i=e.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var l in r){var d=r[l];$(e,l,typeof d=="object"&&d?JSON.stringify(d):d,n)}for(var c=0;c<g.length;c++)(r==null||!(g[c]in r))&&$(e,g[c],null,n);$(e,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!s)return;if((a=="innerHTML"||a=="src")&&(r==null||r==="")){var h=String((o=e.getAttribute("data-path-placeholder")||s[a])!==null&&o!==void 0?o:s.getAttribute(a));a=="innerHTML"?s.innerHTML=h:h?s.setAttribute(a,h):s.removeAttribute(a)}else if(r!=null)if(a=="innerHTML"){for(var u=String(r),p=s;p.parentElement&&p.localName.match(/^(a|var|strong|em|i|b)$/);)p=p.parentElement;p.localName.match(/p|h\d|button|time|li/)&&(u=u.replace(/<(p|h\d|li|ul)[^>]*?>|<\/(p|h\d|li|ul)[^>]*?>/g," ").trim().replace(/\s+/g," ")),String(p.getAttribute("class")).includes("-inline--time")&&le(u)&&(u=ae(new Date(u))),s.innerHTML!=u&&(s.innerHTML=u)}else s.getAttribute(a)!=r&&s.setAttribute(a,r);else s.removeAttribute(a)}var de=["data-attributes-keys","data-path-attributes","data-path-scope"];function N(e,t,r,n){var i,o,s;let a=e;if(n||(t=((i=r==null?void 0:r.processData)===null||i===void 0?void 0:i.call(r,a,t))||t),a.nodeType==1){let c=a.getAttribute("data-path-scope");if(c){let h=ce(a),u=X(t,c,!1);h==0&&Ye(a,((o=r==null?void 0:r.shouldRepeat)===null||o===void 0?void 0:o.call(r,a,u))===!1?1:u.length,r),t={...t,[pt(c)]:u[h]}}let f=Array.prototype.slice.call(a.attributes).sort((h,u)=>de.indexOf(h.name)-de.indexOf(u.name));for(var l=0;l<f.length;l++){let{name:h,value:u}=f[l];h.startsWith("data-path")&&h!="data-path-scope"&&$(a,h,X(t,u,!0),r),h=="data-embed-src"&&$(a,h,a.getAttribute(h),r)}}for(var l=0,d;d=a.childNodes[l++];)ue(d)&&N(d,t,r,!0);return n||(s=r==null?void 0:r.onRender)===null||s===void 0||s.call(r,a,t),a}function ue(e){return e.nodeType==1}function F(e,t,r,n){var i;let o=((i=n==null?void 0:n.processTemplate)===null||i===void 0?void 0:i.call(n,e,t,r))||t;if(e.innerHTML=o,e.classList.add("-feaas"),(e.closest(".component.feaas")||e).className.includes("-theme--"))for(var a=0,l;l=e.childNodes[a++];)ue(l)&&(l.className=l.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return N(e,r,n)}function he(e,t,r,n=!1){var i;let o=((i=r==null?void 0:r.processTemplate)===null||i===void 0?void 0:i.call(r,null,e,t))||e;if(typeof document=="undefined"||n){let s=ht(o);return N(s[0],t,r).outerHTML}else{let s=document.createElement("div");return s.innerHTML=o,N(s,t,r),s.innerHTML}}var pe=["initial","check","updated"],tt={};function Xe(){tt={}}async function et(e,t,r,n,i=tt){return j({url:e,options:t,validator:r,callback:n,cache:i}).then(rt).then(o=>o.response)}function fe(e,t=!1){let r=String(e).replace("?head","");var n=tt[r];return!n&&!t&&(n=tt[r]={phase:null,initial:R(),check:R(),updated:R(),final:R()}),n}var gt=class extends Error{};async function j({url:e,options:t,validator:r,callback:n,cache:i},o="initial"){let s=new Date;if(i!=null){var a=fe(e);if(pe.indexOf(a.phase)>=pe.indexOf(o))var l=a[o];else a.phase=o}let d=await(l||fetch(e,t));if(!l&&a&&(d.ok?a[o].resolve(d):a[o].reject(new Error("Fetch failed"))),!d.ok)throw new Error("Fetch failed");let c=new Date(d.headers.get("date"))<s||l&&o=="initial"&&(a.phase=="updated"||a.phase=="check");if((r==null?void 0:r(d,c))===!1)throw new gt("Response is not valid");return await(n==null?void 0:n(d,o,c)),{url:e,options:t,isCached:c,response:d,validator:r,callback:n,cache:i}}async function rt(e){let{url:t,isCached:r,options:n,validator:i,response:o,cache:s}=e;if(r){let{response:a}=await j({url:t+"?head",options:{...n,method:"HEAD",cache:"no-cache"},validator:i,cache:s},"check");if(a.headers.get("last-modified")!=o.headers.get("last-modified"))return bt(e)}return e}async function bt(e){return j({...e,options:{...e.options,cache:"reload"}},"updated")}var _="https://feaas.blob.core.windows.net";function U(e){let t=e.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(t){var[,r,n,i,o,s]=t;return{cdn:r,library:n,component:i,version:o,revision:s}}}function Ze(e){if(!e||!e.library||!e.component)throw new Error("Component requires `library` and `component` properties");return`${e.cdn&&e.cdn!=_?`${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 Qe(e){return`${e.cdn&&e.cdn!=_?`${e.cdn}/styles/`:""}${e.library}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function yt(e){let t=e.match(/^(?:(.*?)\/styles\/)?([^\/]+)(?:\/(published|staged|saved|\d+)(?:.css)?)?$/);if(t){var[,r,n,i]=t;return{cdn:r,library:n,revision:i}}else{let o=U(e);if(o){var{cdn:r,library:n,revision:i}=o;return i!=null&&i.match(/\d/)&&(i=void 0),{cdn:r,library:n,revision:i}}}}function nt(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...U(e.src)}),`${e.cdn||e.hostname||_}/components/${e.library}/${e.component}/${e.version}/${e.revision||"published"}.html`}function I(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...yt(e.src)}),`${e.cdn||e.hostname||_}/styles/${e.library}/${e.revision||"published"}.css`}async function z(e,t,r=!1){let n=a=>a.headers.get("x-ms-meta-versionDeletedAt")==null,i=a=>a.clone().text().then(t),o=await Promise.all([e.instance&&j({options:{headers:{Accept:"text/html"},credentials:"omit"},url:nt({...e,version:e.instance}),validator:n}).catch(a=>a),j({url:nt(e),validator:n}).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 i(s.response),r?s:rt({...s,callback:i}).catch(a=>{if(o[0]==s&&(bt({...s,callback:null,validator:null}),console.log("Fork was deleted"),!(o[1]instanceof Error)))return i(o[1].response),rt({...o[1],callback:i});throw a})}async function $t(e){typeof e=="string"&&(e={src:e});var t;let{response:r}=await z(e,n=>{t=n},!0);return{...e,template:t,lastModified:r.headers.get("last-modified")}}async function vt(e,t){return typeof e=="string"&&(e={src:e}),et(I(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 tr(e,t){return me(e,t||(t=document.createElement("style"))),t}function me(e,t){return t||(t=document.createElement("style")),vt(e,(r,n)=>{t.textContent=r}).then(()=>t)}function At(e,t){var r=ge(e);if(!r)var n=be(e);return vt(e,(i,o)=>{n&&(n.textContent=i),t==null||t(i,o)}).then(()=>r||n)}function Ft(e){return new Promise((t,r)=>{At(e,t).catch(r)})}function ge(e){return document.head.querySelector(`style[data-href="${I(e)}"]`)}function be(e){let t=I(e),r=document.createElement("style");return r.setAttribute("data-href",t),document.head.appendChild(r),r}function er(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return N(n,t),r}function jt(e,t){return ye(e,t||(t=document.createElement("div"))),t}async function ye(e,t){return t||(t=document.createElement("div")),t.childNodes.length?N(t,e.data,e):"template"in e?F(t,e.template,e.data,e):z(e,r=>F(t,r,e.data,e)).then(()=>t)}function rr(e){let{params:t,method:r,headers:n,body:i,url:o}=x(e);var s={url:o},a={...n};return n["Content-Type"]==="application/json"&&delete a["Content-Type"],n.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(i).length===0||(s.body=i),Object.keys(t).length>0&&(s={...s,params:t}),s}var Ct=e=>{if(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 ve(e){let{url:t,headers:r,params:n,method:i,body:o}=x(e),s,a=r["Content-Type"];i!="GET"&&i!="HEAD"&&(a==="application/json"&&(s=JSON.stringify(o)),a==="multipart/form-data"&&(s=Object.keys(o).reduce((d,c)=>(d.append(c,o[c]),d),new FormData)),a==="application/x-www-form-urlencoded"&&(s=new URLSearchParams(o)));let l=Object.keys(n).length?`?${new URLSearchParams(n)}`:"";return[`${t}${l}`,{headers:r,body:s,method:i}]}function x(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 Ut=async e=>{try{let[t,r]=ve(e),i=await(await x.fetchImplementation(t,{...r,method:r.method.toLowerCase()})).json();return e.jsonpath&&e.jsonpath!="$"?V(i,e.jsonpath):i}catch(t){return{}}};async function It(e){if(!e)return e;if(Ct(e))return Ut(e);let t=Object.keys(e),r=await Promise.all(t.map(n=>Ct(e[n])?Ut(e[n]):null).filter(Boolean));return t.reduce((n,i)=>({...n,[i]:Ct(e[i])?r.shift():e[i]}),{})}x.clean=rr;x.toFetchArguments=ve;x.fetchOne=Ut;x.fetch=It;x.isDataSettings=Ct;x.fetchImplementation=(...e)=>fetch(...e);function Ae(e){var t,r,n,i,o,s,a,l;let d,c=e.getAttribute("src");if(c){let v=U(c);if(!v)throw new Error(`Could not parse FEAAS Component source: ${c}`);var{cdn:f,library:h,component:u,version:p,revision:g}=v}let C=e.getAttribute("data");if(C!=null&&C!="")try{d=typeof C=="string"?JSON.parse(C):{}}catch(v){console.error(v)}return{data:d||{},cdn:(r=(t=e.getContextAttribute("cdn"))!==null&&t!==void 0?t:f)!==null&&r!==void 0?r:_,library:(n=e.getAttribute("library"))!==null&&n!==void 0?n:h,component:(i=e.getAttribute("component"))!==null&&i!==void 0?i:u,version:(s=(o=e.getAttribute("version"))!==null&&o!==void 0?o:p)!==null&&s!==void 0?s:"responsive",revision:(l=(a=e.getAttribute("revision"))!==null&&a!==void 0?a:g)!==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"),withStylesheet:e.getAttribute("with-stylesheet")!="false"}}var it=class extends A{setData(t){this.set({data:t})}getProps(){return Ae(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.needsRefresh=!0,super.attributeChangedCallback(t,r,n),t==="data"&&this.fetchData())}async fetchData(){this.readyData=void 0,this.whenDataReady=this.whenDataReady.restart();let t=await x.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=R(t=>this.readyData=t,t=>this.onError(t)),this.defaultProps={cdn:_,revision:"published",version:"responsive",withStylesheet:!0,editable:!1,suspended:!1,data:{}},this.onLoad=t=>{this.payload=t,this.advance()},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(){if(this.getOriginal())return;let t=()=>{this.payload&&(r||this.readyData&&this.onLoad(this.payload))};if(this.props.withStylesheet)var r=Ft({...this.props,revision:"published"}).then(()=>{r=null,t()});return Promise.all([r,this.whenDataReady.then(()=>t()),z(this.props,n=>{this.payload=n,t()})]).then(()=>this.payload)}flush(){this.readyData&&super.flush()}update(){if(this.alreadyRendered=!0,Array.from(this.children).filter(t=>t.tagName!="BR").length>0&&!this.needsRefresh)N(this,this.readyData);else{if(this.needsRefresh=!0,this.getOriginal())return;F(this,this.payload,this.readyData)}}};it.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet"];it.register("feaas-component");function Ce(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 ot=class extends A{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return Ce(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=`
|
|
3
3
|
#loader {
|
|
4
4
|
position: absolute;
|
|
5
5
|
top: 0;
|
|
@@ -63,10 +63,10 @@ var $e=Object.defineProperty;var Y=(e,t)=>{for(var r in t)$e(e,r,{get:t[r],enume
|
|
|
63
63
|
style="animation: 1.5s linear 0s infinite normal none running loader-circular-track"
|
|
64
64
|
></circle>
|
|
65
65
|
</svg>
|
|
66
|
-
</div>`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}update(){this.loader.style.opacity=String(this.props.opacity)}};ot.observedAttributes=["hidden","opacity"];ot.register("feaas-loader");function
|
|
67
|
-
${
|
|
66
|
+
</div>`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}update(){this.loader.style.opacity=String(this.props.opacity)}};ot.observedAttributes=["hidden","opacity"];ot.register("feaas-loader");function Ee(e){var t,r,n,i;let o=e.getAttribute("src");if(o)var{cdn:s,library:a,revision:l}=yt(o);return{library:e==null?void 0:e.getContextAttribute("library"),revision:(r=(t=e==null?void 0:e.getAttribute("revision"))!==null&&t!==void 0?t:l)!==null&&r!==void 0?r:"published",cdn:(i=(n=e==null?void 0:e.getContextAttribute("cdn"))!==null&&n!==void 0?n:e==null?void 0:e.getContextAttribute("hostname"))!==null&&i!==void 0?i:_}}var Et=class extends A{constructor(){super(...arguments),this.onLoad=t=>{this.payload=t,this.advance()}}getProps(){return Ee(this)}isReadyToLoad(){return this.props.library!=null&&this.props.revision!=null&&this.props.cdn!=null}load(){return At(this.props,this.onLoad)}};Et.register("feaas-stylesheet");var wt={};Y(wt,{convertBase64toBlob:()=>we,generate:()=>Re,get:()=>nr,getVersionForThumbnail:()=>xe,load:()=>Se,responseToImage:()=>Wt,upload:()=>Ne});var we=e=>fetch(e).then(t=>t.blob()),Wt=e=>e.blob().then(t=>new Promise((r,n)=>{let i=new Image;i.onerror=n,i.onload=()=>{r(i)},i.src=URL.createObjectURL(t)}));async function xe(e){return e.versions.length||await e.versions.fetch(),e.getVersionForWidth(800)}async function nr(e,t,r){try{if(!e.isNew)return await Se(e,t,r)}catch(i){e.sdk.log(`FEAAS: Thumbnail ${e.id}, version: ${(t==null?void 0:t.id)||"responsive"}, status: generating ${status}, reason: ${i}`)}let n=await Re(e,t);return r==null||r(n,!1),n&&!e.isNew&&we(n.src).then(i=>Ne(e,t,i)),n}async function Se(e,t,r){let n=t?t.getThumbnailURL():e.getThumbnailURL(),i=e.library.stylesheet,o=new Date(Math.max(Number(e.modifiedAt),Number(i.modifiedAt)));e.sdk.log(`FEAAS: Thumbnail ${e.id}/${(t==null?void 0:t.id)||"responsive"}, loading`);var s;return await et(n,{},(a,l)=>{let d=Math.abs(Number(new Date(a.headers.get("x-ms-meta-componentRenderedAt")))-Number(o))<2e3;return l&&!d&&Wt(a).then(c=>{s=c,r(c,l)}),d},(a,l,d)=>{e.sdk.log(`FEAAS: Thumbnail ${e.id}/${(t==null?void 0:t.id)||"responsive"}, status: ${l}`),Wt(a).then(c=>{s=c,r(c,d)})},null),s}async function Re(e,t){let r=t||(e.isNew?null:await xe(e));if(!r||r.isViewEmpty())return null;let{stylesheet:n}=e.library,{datasources:i}=e.sdk;return await ir(r.classList,n.getBreakpointForWidth(800,r.getBreakpoints()),r.view,i.reduce((s,a)=>Object.assign(s,{[a.id]:a.sample}),{}),n.css,e.sdk)}function ir(e,t,r,n,i,o){let s=document.createElement("iframe");return s.style.position="absolute",s.style.top="-2000px",s.style.left="-2000px",s.style.width=t.props.minWidth+"px",s.style.height="720px",s.style.zIndex="100011",document.body.appendChild(s),new Promise((a,l)=>{let d=document.createElement("script");d.onerror=l,d.src=o.frontend+"/assets/html2canvas.js",d.onload=()=>{var u;(((u=s.contentWindow.document.fonts)===null||u===void 0?void 0:u.ready)||Promise.resolve()).then(function(){return s.contentWindow.html2canvas(h,{scale:Math.max(1.1,1e3/Math.min(1401,Math.max(320,t.props.minWidth))),width:Math.min(1401,Math.max(320,t.props.minWidth)),height:Math.max(1,Math.min(2e3,h.offsetHeight)),windowWidth:t.props.minWidth+"px",windowHeight:1e3,proxy:o.backend+"/proxy/media",backgroundColor:"#ffffff"}).then(p=>{let g=p.toDataURL("image/jpeg",.6);s.parentElement.removeChild(s);let C=new Image;C.onload=()=>{a(C)},C.onerror=l,C.src=g})})},s.contentWindow.document.head.appendChild(d);let c=s.contentWindow.document.createElement("style");c.textContent=`
|
|
67
|
+
${i}
|
|
68
68
|
body, html { padding: 0; margin: 0; overflow: hidden }
|
|
69
|
-
`;let f=
|
|
69
|
+
`;let f=s.contentWindow.document.createElement("style");f.textContent=`
|
|
70
70
|
body, html { padding: 0; margin: 0; overflow: hidden }
|
|
71
|
-
`,o.contentWindow.document.head.appendChild(u),o.contentWindow.document.head.appendChild(f);let h=Dt({template:r,data:i});h.classList.add(...e,"-feaas--preview","-emulate--"+t.details.slug),o.contentWindow.document.body.appendChild(h)})}async function we(e,t,r){let i=t?t.getThumbnailURL():e.getThumbnailURL(),n=new Date(Math.max(Number(e.modifiedAt),Number(e.library.stylesheet.modifiedAt)));try{await e.sdk.uploadBlob("thumbnails",i.split(/\/thumbnails\//)[1],r,{headers:{"x-ms-blob-content-type":"image/jpg","x-ms-blob-cache-control":"public,max-age=31536000,immutable","x-ms-meta-versionId":t?t.id:null,"x-ms-meta-versionRevision":t?t.revision.toString():null,"x-ms-meta-componentId":e.id,"x-ms-meta-componentRenderedAt":n.toUTCString(),"x-ms-meta-componentModifiedAt":e.modifiedAt.toUTCString(),"x-ms-meta-componentCreatedAt":e.createdAt.toUTCString(),"x-ms-meta-modifiedAt":e.modifiedAt.toUTCString()}}),fetch(i,{cache:"no-cache"}).then(()=>{e.sdk.log("FEAAS: Thumbnail uploaded",i)})}catch(s){e.sdk.log("FEAAS: Thumbnail failed to upload",i,s)}return i}var Ut;typeof window!="undefined"&&(window.FEAASReactElement=B,(Ut=window.FEAASLoading)!==null&&Ut!==void 0||(window.FEAASLoading=Promise.resolve()));function Ce(e){let t=[];if(e){let r=e.ownerDocument.defaultView,i,n;for(;r!==window.top;){i=r.parent;for(let s=0;s<i.frames.length;s++)if(i.frames[s]===r){for(let o of i.document.getElementsByTagName("iframe"))if(o.contentWindow===r){n=o.getBoundingClientRect();let a=o.contentWindow.getComputedStyle(o);t.push({left:n.left+parseInt(a.borderLeftWidth),top:n.top+parseInt(a.borderTopWidth)})}r=i;break}}}return t.reduce((r,i)=>({left:r.left+i.left,top:r.top+i.top}),{left:0,top:0})}function Ee(e){var t;return{context:HTMLElement,frontend:e==null?void 0:e.getContextAttribute("frontend"),src:(t=e==null?void 0:e.getAttribute("src"))!==null&&t!==void 0?t:"/editor.js",library:e==null?void 0:e.getAttribute("library"),component:e==null?void 0:e.getAttribute("component"),version:e==null?void 0:e.getAttribute("version"),instance:e==null?void 0:e.getAttribute("instance"),forked:e==null?void 0:e.getAttribute("forked"),revision:(e==null?void 0:e.getAttribute("revision"))||"saved",hidden:(e==null?void 0:e.getAttribute("hidden"))!=null,for:e==null?void 0:e.getAttribute("for"),state:(e==null?void 0:e.getAttribute("state"))||"idle",changed:(e==null?void 0:e.getAttribute("changed"))!=null}}var st=class extends A{constructor(){super(...arguments),this.framePoint={top:0,left:0},this.wrapperRect={top:0,left:0,width:0,height:0},this.bodyRect={top:0,left:0,width:0,height:0},this.defaultProps={hidden:!1},this.setTarget=(t,r={component:t.getAttribute("component"),version:t.getAttribute("version"),revision:t.getAttribute("revision"),instance:t.getAttribute("instance")})=>{if(!this.closing&&(!this.target||t==null))return this.set(r),this.target=t,!0},this.onChromeMeasureElement=(t,r=t.getBoundingClientRect())=>t.ownerDocument==document?{left:r.left-this.bodyRect.left,top:r.top-this.bodyRect.top,width:r.width,height:r.height}:{left:r.left+this.framePoint.left-this.bodyRect.left,top:r.top+this.framePoint.top-this.bodyRect.top,width:r.width,height:r.height},this.onBeforeMeasure=t=>{t.memoized.focusable&&(this.framePoint=Ce(t.memoized.focusable)),this.chrome&&(this.wrapperRect=this.chrome.positionable.getBoundingClientRect(),this.bodyRect=this.chrome.positionable.ownerDocument.body.parentElement.getBoundingClientRect())},this.onMeasure=()=>{},this.onPosition=({focusable:t,root:r})=>{!this.chrome||this.props.hidden||(t?(this.chrome.wrapper.style.width=t.width+16*2+"px",this.chrome.wrapper.style.height=t.height+16*1+64+"px",this.chrome.wrapper.style.left=t.left-16+"px",this.chrome.wrapper.style.top=t.top-64+"px",this.chrome.wrapper.style.opacity="1",this.chrome.absolute=this.querySelector(".ui.overlays"),this.chrome.absolute&&(this.chrome.absolute.style.left=r.left+"px",this.chrome.absolute.style.top=r.top+"px")):(this.chrome.wrapper.style.opacity="0",this.chrome.wrapper.style.left="-1000px",this.chrome.wrapper.style.top="-1000px"))},this.onWindowMessage=t=>{var r;switch((r=t.data)===null||r===void 0?void 0:r.type){case"feaasEdit":let i=this.getPlaceholder();this.setTarget(i.editable,t.data)&&(this.loader=i.loader,document.body.appendChild(i.clipper),this.editedUID=t.data.id,this.setPlaceholder(),this.open());break;case"feaasMeasurements":this.measurements=t.data.measurements,this.props.hidden||this.setPlaceholder();break}},this.onContentChange=()=>{this.setAttribute("changed","changed"),requestAnimationFrame(()=>{this.setIframeComponentContent()})},this.onClose=()=>{var t;this.setAttribute("hidden","hidden"),this.placeholder&&(this.placeholder.positionable.style.opacity="0",this.placeholder.positionable.style.pointerEvents="none"),this.chrome&&(this.chrome.wrapper.style.opacity="0"),!((t=this.target)===null||t===void 0)&&t.parentNode&&(this.target.outerHTML=this.target.outerHTML),this.setTarget(null,{component:null,version:null,instance:null,revision:null}),this.setEditorContext({isFocused:!1})},this.onVersionStateChange=(t,r)=>{this.versionContext=t,this.setVersionContext=r},this.onEditorStateChange=(t,r)=>{this.editorContext=t,this.setEditorContext=r,t.editor&&this.props.state=="loading"&&!this.props.hidden&&(this.setAttribute("state","ready"),this.ownerDocument.fonts.ready.then(()=>setTimeout(()=>{this.setReadyState(),this.setIframeComponentContent()},100)))}}getProps(){return Ee(this)}getReactRootElement(){return this.reactRootElement||(this.reactRootElement=document.createElement("div"),this.getRoot().appendChild(this.reactRootElement)),this.reactRootElement}showLoader(){this.loader||(this.loader=document.createElement("feaas-loader"),this.loader.setAttribute("opacity","0.6"),this.loader.style.zIndex="1000",this.target.appendChild(this.loader),this.target.tagName=="FEAAS-COMPONENT"&&(this.target.style.position="relative"))}hideLoader(){this.loader&&(this.loader.setAttribute("hidden","hidden"),this.target.tagName=="FEAAS-COMPONENT"&&(this.target.style.position="relative",this.target.style.position=""))}load(){return import( /*@vite-ignore*/ /* webpackIgnore: true */ this.formatURL(this.props.src,this.props.frontend))}connectedCallback(){super.connectedCallback(),window.addEventListener("message",this.onWindowMessage)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("message",this.onWindowMessage)}setIframe(t){this.iframe=t}setIframeComponentContent(){this.placeholder&&this.iframe&&this.placeholder.editable.innerHTML&&this.iframe.contentWindow.postMessage({type:"feaasUpdate",id:this.editedUID,content:this.placeholder.editable.innerHTML})}setPlaceholder(){if(!this.iframe)return;let t=this.iframe.clientWidth,r=this.iframe.clientHeight,i=this.iframe.getBoundingClientRect(),n=this.getPlaceholder(),s=document.body.getBoundingClientRect(),o=this.measurements[this.editedUID];o&&(Object.assign(n.clipper.style,{position:"absolute",top:i.top+this.iframe.clientTop-s.top+"px",left:i.left+this.iframe.clientLeft-s.left+"px",width:t+"px",height:r+"px",pointerEvents:"none",zIndex:1,overflow:"hidden"}),Object.assign(n.positionable.style,{position:"absolute",top:o.top+"px",left:o.left+"px",width:o.width+"px",zIndex:2,transition:"opacity 0.4s",pointerEvents:this.props.hidden?"none":"all"}),Object.assign(n.loader.style,{position:"absolute",top:o.top+"px",left:o.left+"px",width:o.width+"px",height:o.height+"px",filter:"opacity(0.6)",zIndex:3,pointerEvents:"none"}),document.dispatchEvent(new Event("feaasRefresh",{bubbles:!0})))}getPlaceholder(){return this.placeholder?this.placeholder:(this.placeholder={clipper:document.createElement("div"),positionable:document.createElement("div"),editable:Object.assign(document.createElement("div"),{className:"-feaas"}),loader:document.createElement("feaas-loader")},this.placeholder.clipper.appendChild(this.placeholder.positionable),this.placeholder.positionable.appendChild(this.placeholder.editable),this.placeholder.clipper.appendChild(this.placeholder.loader),this.placeholder)}attributeChangedCallback(t,r,i){r!==i&&(t=="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(t,r,i))}open(){clearTimeout(this.closing),this.removeAttribute("hidden"),this.removeAttribute("changed"),this.setLoadingState()}shouldFork(t){return t.forkOriginId==null&&this.props.instance!=null}cleanup(){var t;this.placeholder&&((t=this.placeholder.clipper)===null||t===void 0||t.remove(),this.placeholder=null)}close(){console.log("Editor is not ready")}unfork(){console.log("Editor is not ready")}discard(){console.log("Editor is not ready")}save(){console.log("Editor is not ready")}setVersionContext(t){console.log("Editor is not ready")}setEditorContext(t){console.log("Editor is not ready")}setLoadingState(){this.showLoader(),this.setAttribute("state","loading")}setReadyState(){this.hideLoader(),this.setEditorContext({activeVersionId:this.component.versions[0].id}),this.setAttribute("state","ready")}render({children:t,component:r,version:i,instance:n},{Editor:s,VersionStatusList:o,VersionStatusButton:a,Version:l,VersionMenu:d,EditorUIUndo:u,EditorUIMode:f,React:{useEffect:h,useMemo:c,useState:p,useContext:b},Chakra:{HStack:C,Box:y,Button:O,MenuItem:lt},Chrome:k,ReactDOM:V,useSDK:H,useLibrary:Pe,useSlots:Oe,useModelObserver:Me,ConfirmationContext:De,VersionContext:ar}){if(!this.payload)return;let{React:v}=this.payload,Ht=H(),Bt=Pe(),[w,zt]=p(),{setConfirm:xt}=b(De),q=n||i;w&&(this.component=w),h(()=>{if(this.props.hidden)return;let T=Bt.components.getItem(r).clone();return T.versions.search({ids:[i,n].filter(Boolean),componentIds:[r]}).then(St=>{T.versions.setItems(St);let N=T.findVersion(n,["staged","published"]),G=T.findVersion(i,["staged","published"]);if(N)N.deletedAt?(N.getDraft().changeAndNotify(G.toProperties()).restore(),console.error("FEAAS Editor: Restoring fork")):(console.error("FEAAS Editor: Pre-forked"),this.setAttribute("forked",N.id));else if(this.removeAttribute("forked"),this.shouldFork(G)){console.error("FEAAS Editor: Forking");let Rt=G.fork(n).id;this.setAttribute("instance",Rt)}else console.error("FEAAS Editor: Regular");zt(T)}),()=>{this.closing=setTimeout(()=>{this.closing=null,this.cleanup(),zt(null)},400)}},[i,this.props.hidden]);let Jt=Me(w==null?void 0:w.versions,[]).filter(T=>T.id==q),K=Jt[0];K&&!this.props.hidden&&(this.version=K),h(()=>(this.unfork=()=>{xt({title:"Reverting component customizations",button:"Discard",body:"Are you sure to reset component to its original state? All changes will be lost.",action:()=>{let T=w.findVersion(i,["staged","published"]);w.findVersion(n).unstage().unpublish().changeAndNotify(T.toProperties()),w.saveVersions(!1),this.setVersionContext({needsWrite:!0}),this.removeAttribute("forked"),requestAnimationFrame(this.onClose)}})},this.discard=()=>{this.props.changed&&(w.findVersion(q).revert(),w.saveVersions(!1),this.setVersionContext({needsWrite:!0}))},this.close=()=>{xt({title:"Component has unsaved changes",button:"Discard",body:"Are you sure to close editor and discard changes?",bypass:!this.props.changed,action:()=>{this.discard(),requestAnimationFrame(this.onClose)}})},this.save=()=>{xt({bypass:!!this.props.forked,title:"Customizing component",button:"Save",body:"Changes to the component will only be visible on that page. Changes to component done in Component Builder will not be reflected here. It will be possible to revert the customization.",action:()=>{w.findVersion(q).commitData({view:this.editorContext.editor.getData({rootName:q}),model:""}).stage().publish(),this.removeAttribute("changed"),this.setAttribute("forked",q),w.saveVersions(!1)}})},()=>{delete this.unfork,delete this.discard,delete this.save,delete this.editorContext,delete this.versionContext,delete this.setEditorContext,delete this.setVersionContext}),[w]);let Le=c(()=>this.target,[w]);return c(()=>w&&Oe(t,({picker:T,children:St})=>v.createElement(y,{ref:N=>{this.chrome=N?{positionable:N,wrapper:N.querySelector(".editor-chrome"),absolute:this.querySelector(".ui.overlays")}:null}},v.createElement(y,{className:"editor-wrapper",position:"absolute",left:0,top:0},v.createElement(s,{datasources:Ht.datasources,sdk:Ht,library:Bt,component:w,versions:Jt,context:{isAutosaveEnabled:!1,onChromeMeasure:this.onMeasure,onChromeBeforeMeasure:this.onBeforeMeasure,onChromeMeasureElement:this.onChromeMeasureElement,onChromePosition:this.onPosition,onContentChange:this.onContentChange}},{exports:this.onEditorStateChange,after:St,chrome:({editor:N})=>N&&v.createElement(k,null),children:({isArchivedDisplayed:N,editor:G,status:Rt})=>v.createElement(y,{position:"absolute",left:0,top:0,className:"editor-chrome",p:4,boxShadow:"2xl",pointerEvents:"none",opacity:0,transition:"opacity 0.3s"},v.createElement(y,{left:0,width:"4",top:0,bottom:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),v.createElement(y,{right:0,width:"4",top:0,bottom:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),v.createElement(y,{top:0,height:"16",left:0,right:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),v.createElement(y,{bottom:0,height:"4",left:0,right:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),K&&v.createElement(l,{version:K,node:Le,ignoreBreakpoints:!0,deps:[this.props.forked,this.props.changed]},{exports:this.onVersionStateChange,left:v.createElement(C,{justifyContent:"space-between"},v.createElement(u,{size:"sm",editor:Rt=="ready"?G:null}),v.createElement(f,{size:"sm"})),middle:(lr,dr)=>[!1],right:v.createElement(v.Fragment,null,v.createElement(O,{variant:"secondary",size:"sm",onClick:this.close},"Close"),v.createElement(O,{variant:"primary",size:"sm",onClick:this.save,isDisabled:!this.props.changed},this.props.changed?this.props.forked?"Save":"Save customization":"Up to date"),v.createElement(d,{isDisabled:!this.props.forked&&!this.props.changed},v.createElement(lt,{onClick:this.unfork,isDisabled:!this.props.forked},"Unfork"),v.createElement(lt,{onClick:this.discard,isDisabled:!this.props.changed},"Discard")))}))})))),[K,this.props.forked,this.props.changed])}isReadyToLoad(){return this.props.component!=null&&this.props.version!=null&&!this.props.hidden}};st.observedAttributes=["library","component","version","revision","hidden","state","changed","forked"];st.register("feaas-editor");function xe(e){var t,r;return{part:(e==null?void 0:e.getAttribute("part"))||"picker",slot:(e==null?void 0:e.getAttribute("part"))||"picker",mode:e==null?void 0:e.getAttribute("mode"),dialog:e==null?void 0:e.getAttribute("dialog"),placeholder:(e==null?void 0:e.getAttribute("placeholder"))||"No theme",frontend:(t=e==null?void 0:e.getContextAttribute("frontend"))!==null&&t!==void 0?t:"https://components.sitecorecloud.io",src:(r=e==null?void 0:e.getAttribute("src"))!==null&&r!==void 0?r:"/picker.js",hidden:(e==null?void 0:e.getAttribute("hidden"))!=null,variant:e==null?void 0:e.getAttribute("variant"),context:void 0,onClose:void 0,setAttribute:void 0,getAttribute:void 0}}var at=class extends A{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return xe(this)}load(){return this.import( /*@vite-ignore*/ /* webpackIgnore: true */ this.formatURL(this.props.src,this.props.frontend))}connectedCallback(){this.setAttribute("feaas-role","ui"),super.connectedCallback()}render({placeholder:t,context:r,mode:i,dialog:n,children:s,variant:o},{Picker:a,React:l,useLibrary:d,useSDK:u}){let[f,h]=l.useReducer(k=>k+1,0),c=d("collections"),p=d("components"),b=u("datasources"),C=d("stylesheet.styles"),y=p.find(k=>k.id==(r==null?void 0:r.getAttribute("component")));var O=r==null?void 0:r.getAttribute("data");if(O)try{O=JSON.parse(O)}catch(k){}let lt=i=="datasources"?b.find(k=>k.id==n):null;return l.createElement(a,{rules:C,collections:c,themeContext:r,placeholder:t,component:y,datasource:lt,data:O,versionId:r==null?void 0:r.getAttribute("version"),mode:i||(y?"component":null),setAttribute:(k,V,H)=>{V=="data"&&H&&(H=JSON.stringify(H)),this.props.setAttribute(k,V,H),h()},context:r,variant:o,onModeChange:(k,V)=>{this.set({mode:k,dialog:V})}},s)}};at.observedAttributes=["library","mode","frontend","src","hidden","variant","dialog"];at.register("feaas-picker");function Se(e){var t,r,i,n,s;return{library:e==null?void 0:e.getAttribute("library"),src:(t=e==null?void 0:e.getAttribute("src"))!==null&&t!==void 0?t:"/context.js",environment:(r=e==null?void 0:e.getAttribute("environment"))!==null&&r!==void 0?r:void 0,frontend:(i=e==null?void 0:e.getAttribute("frontend"))!==null&&i!==void 0?i:"https://components.sitecorecloud.io",backend:(n=e==null?void 0:e.getAttribute("backend"))!==null&&n!==void 0?n:"https://components.sitecorecloud.io/api",cdn:(s=e==null?void 0:e.getAttribute("cdn"))!==null&&s!==void 0?s:"https://feaas.blob.core.windows.net",auth:null,isolate:(e==null?void 0:e.getAttribute("isolate"))==null||(e==null?void 0:e.getAttribute("isolate"))=="true"}}var W=class extends A{constructor(){super(...arguments),this.defaultProps={isolate:!0},this.onStatusChange=(t,r)=>{t=="ready"&&(this.whenSDKReady.resolve(r),this.dispatchEvent(new CustomEvent("feaasReady",{bubbles:!0,composed:!0,detail:r})))},this.whenSDKReady=S(t=>{this.sdk=t})}getProps(){return Se(this)}load(){return this.import( /*@vite-ignore*/ /* webpackIgnore: true */ this.formatURL(this.props.src,this.props.frontend))}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null}getTheme(t){return t}getRoot(){return this.getAttribute("isolate")==="false"?this:this.shadowRoot||this.attachShadow({mode:"open"})}getReactRootElement(){return this.reactRootElement||(this.reactRootElement=document.createElement("div"),this.getRoot().appendChild(this.reactRootElement)),this.reactRootElement}connectedCallback(){this.setAttribute("feaas-role","ui"),Array.from(this.children).forEach(t=>{this.getRoot().appendChild(t)}),document.addEventListener("feaasMount",this),document.addEventListener("feaasUnmount",this),super.connectedCallback()}disconnectedCallback(){document.removeEventListener("feaasMount",this),document.removeEventListener("feaasUnmount",this),super.disconnectedCallback()}getPortalRoot(){return this.getRoot()}render({children:t,library:r},{AppContext:i,Chakra:{Button:n,Tooltip:s},React:o}){let a={containerRef:{current:this.getPortalRoot()}};return s.defaultProps={hasArrow:!0,placement:"top",portalProps:a},o.createElement(i,{environment:this.props.environment,backend:this.props.backend,libraryId:this.props.library,container:this.getRoot(),auth:this.props.auth,getTheme:this.getTheme,onStatusChange:this.onStatusChange,modalProps:{portalProps:a},chakraProps:{resetScope:':where([feaas-role="ui"])',cssVarsRoot:":host",resetCSS:!0,toastOptions:{portalProps:a}}},t)}};W.observedAttributes=["library","component","version","revision","hostname","template"];W.register("feaas-context");W.prototype.clientside=jt;import P from"react";import Re from"react";import Ze from"react-dom";function It(e){let t=/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g;return e.replace(t,function(r){return"-"+r.toLowerCase()})}function Wt(e){let t=/-[a-z\u00E0-\u00F6\u00F8-\u00FE]/g;return e.replace(t,function(r){return r.slice(1).toUpperCase()})}var Qe=e=>Object.keys(e).reduce((t,r)=>{if(e[r].title)t[r]=e[r];else{let i=r.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase()).join(" ");t[r]={...e[r],title:i}}return t},{}),ke=(e={})=>Object.keys(e).reduce((t,r)=>(t[It(r)]=e[r],t),{}),tr=e=>{if(!e)return;if(!e.properties)return e;let t,r;return t=ke(e.properties),r=(e.required||[]).map(n=>It(n)),t=Qe(t),{...e,properties:t,required:r,title:void 0}},er=(e,t)=>{if(!e||!t)return;let r;return r=ke(e),Object.keys(t).filter(n=>/(integer|number)/.test(t[n].type)).forEach(n=>{r[n]?r[n]["ui:widget"]||(r[n]["ui:widget"]="updown"):r[n]={"ui:widget":"updown"}}),r},rr=(e,t,r)=>{var i;switch((i=r==null?void 0:r[e])===null||i===void 0?void 0:i.type){case"string":return t;case"object":return JSON.parse(t);case"array":return JSON.parse(t);case"number":return+t;case"integer":return+t;case"boolean":return t==="true";default:return t}};function ir(e){var t;let r=e.getAttribute("data-external-id"),i=(t=g.registered[r])===null||t===void 0?void 0:t.schema;return Array.from(e.attributes).reduce((s,{name:o,value:a})=>!o.startsWith("data-attribute")&&!["class","id","contenteditable"].includes(o)?{...s,[Wt(o)]:rr(Wt(o),a,i==null?void 0:i.properties)}:s,{})}var g=class extends A{load(){return Promise.resolve({React:Re,ReactDOM:Ze})}update(){var t;let{dataExternalId:r}=this.props;if(!(!(!((t=g.registered[r])===null||t===void 0)&&t.component)&&this.childNodes.length>0))return super.update()}render(t,{React:r}){var i;let{dataExternalId:n}=t,s=(i=g.registered[n])===null||i===void 0?void 0:i.component;return s||console.warn("FEAASExternal: The component you requested is not registered"),r.createElement(r.Fragment,null,s&&r.createElement(s,{...t}))}getProps(){return ir(this)}static registerComponent(t,r){if(!r.name)throw new Error("Could not register external component. Please make sure you provide a name in the options");let i=r.name,{thumbnail:n,group:s,ui:o,...a}=r,l={...a,type:"object"};g.registered[i]={component:t,name:i,schema:l,uiSchema:o,thumbnail:n,group:s,title:(l==null?void 0:l.title)||i},g.setRegistrationCallback()}static setRegistrationCallback(){clearTimeout(g.registrationCallback),g.registrationCallback=setTimeout(()=>{var t;if(typeof window!="undefined"){let r=Object.keys(g.registered).map(i=>{var n;return{...g.registered[i],name:i,schema:tr(g.registered[i].schema),uiSchema:er(g.registered[i].uiSchema,(n=g.registered[i].schema)===null||n===void 0?void 0:n.properties)}});(t=window.parent)===null||t===void 0||t.postMessage(JSON.stringify({action:"register-components",data:r}),"*")}},30)}static Preview(t){var r;let i=(t==null?void 0:t.src)||(typeof window!="undefined"?(r=window.location.search.match(/feaasSrc=([^&]+)/))===null||r===void 0?void 0:r[1]:null);return i?Re.createElement(Ne,{src:i,...t}):null}static linkComponents(t){return()=>t.map(r=>null)}static getComponent(t){return g.registered[t]}};g.registered={};g.register("feaas-external");g.setRegistrationCallback();var{getComponent:Et,linkComponents:nr,registerComponent:or}=g;var zi=async e=>{let t=await E.fetch((e==null?void 0:e.data)||{}),r={...e};if(("src"in e||"component"in e)&&(e==null?void 0:e.template)==null){let i=await Ot(e);r.template=i.template,r.lastModified=i.lastModified}return Te({...r,data:t})};function Te({data:e,...t}){let r="",i=null,n;return"template"in t&&t.template&&(n=Pt(t.template,e||{}).map((s,o)=>_e(s,a=>{if(a.localName=="feaas-external"&&Et(a.getAttribute("data-external-id")))return[sr,{}]},o))),"src"in t&&(t={...j(t.src),...t}),P.createElement(P.Fragment,null,"preload"in t&&i===!0&&"src"in t&&P.createElement(P.Fragment,null,P.createElement("link",{rel:"preload",as:"fetch",href:it(t.src),crossOrigin:"anonymous"}),P.createElement("link",{rel:"preload",as:"style",href:I(t.src),crossOrigin:"anonymous"})),P.createElement("feaas-component",{...t,suppressHydrationWarning:!0,template:null,data:typeof e=="string"?e:e?JSON.stringify(e):null},n))}function sr(e){var t;let r=(t=Et(e["data-external-id"]))===null||t===void 0?void 0:t.component;return P.createElement("feaas-external",{...e,suppressHydrationWarning:!0},typeof r=="function"?r({...e}):P.createElement(r,{...e}))}function _e(e,t,r){if(e.nodeType===3)return e.textContent;let i=Array.from(e.childNodes).map((l,d)=>_e(l,t,d)),n={};for(let l=0;l<e.attributes.length;l++){let{name:d,value:u}=e.attributes[l];d=="style"?n[d]=String(u||"").trim().split(/\s*;\s*/).reduce((f,h)=>{let[c,p]=h.split(":");return{...f,[c]:p}},{}):n[d]=u}let s=t==null?void 0:t(e),o=(s==null?void 0:s[0])||e.nodeName.toLowerCase(),a=Object.assign({key:r,suppressHydrationWarning:!0},n,(s==null?void 0:s[1])||{});return P.createElement(o,a,["img","br","input"].includes(o)?null:i)}var Ne=Te;export{Ne as Component,fe as ComponentProps,W as Context,S as ControlledPromise,_ as DEFAULT_CDN_URL,ft as DOM,pt as DataPath,ct as DataScope,E as DataSettings,A as Element,g as External,nt as FEAASComponent,fe as FEAASComponentsProps,W as FEAASContext,Se as FEAASContextProps,st as FEAASEditor,Ee as FEAASEditorProps,A as FEAASElement,ot as FEAASLoader,me as FEAASLoaderProps,at as FEAASPicker,xe as FEAASPickerProps,Te as FEAASReactComponent,sr as FEAASReactExternal,wt as FEAASStylesheet,ge as FEAASStylesheetProps,_e as HTMLNodeToReact,mt as InvalidResponse,m as JSONPath,ot as Loader,dt as MyComponent,at as Picker,zi as ServerComponent,wt as Stylesheet,Ct as Thumbnail,Zt as adjustNumbers,Kt as autoloadScripts,Q as cleanCollectionBit,ze as clearFetchCache,ue as createStylesheet,et as fetchAndRevalidate,J as fetchAndRevalidateComponent,bt as fetchAndRevalidateStylesheet,gt as fetchBypassingCache,tt as fetchCache,Ot as fetchComponent,$t as fetchData,rt as fetchToValidateCache,U as fetchWithCacheAwareness,ce as findStylesheet,Et as getComponent,Je as getComponentSource,it as getComponentURL,le as getFetchCache,Ce as getFramePosition,Qt as getHumanizedLabel,te as getLastPathBit,Xt as getQualifier,Ve as getStylesheetSource,I as getStylesheetURL,nr as linkComponents,Z as loadScript,yt as loadStylesheet,Mt as loadStylesheetAllowStale,ht as normalizeCollectionScope,qt as observeDOMElement,j as parseComponentSource,Gt as parseLimit,Yt as parseRange,vt as parseStylesheetSource,z as queryObject,X as queryScopes,or as registerComponent,Dt as renderComponent,Ke as renderComponentElement,he as renderComponentPromise,F as renderDOMContent,R as renderDOMElement,We as renderHTMLContent,qe as renderStylesheet,de as renderStylesheetPromise,D as serializeCH1RichText,$ as setDOMAttribute};
|
|
71
|
+
`,s.contentWindow.document.head.appendChild(c),s.contentWindow.document.head.appendChild(f);let h=jt({template:r,data:n});h.classList.add(...e,"-feaas--preview","-emulate--"+t.details.slug),s.contentWindow.document.body.appendChild(h)})}async function Ne(e,t,r){let n=t?t.getThumbnailURL():e.getThumbnailURL(),i=new Date(Math.max(Number(e.modifiedAt),Number(e.library.stylesheet.modifiedAt)));try{await e.sdk.uploadBlob("thumbnails",n.split(/\/thumbnails\//)[1],r,{headers:{"x-ms-blob-content-type":"image/jpg","x-ms-blob-cache-control":"public,max-age=31536000,immutable","x-ms-meta-versionId":t?t.id:null,"x-ms-meta-versionRevision":t?t.revision.toString():null,"x-ms-meta-componentId":e.id,"x-ms-meta-componentRenderedAt":i.toUTCString(),"x-ms-meta-componentModifiedAt":e.modifiedAt.toUTCString(),"x-ms-meta-componentCreatedAt":e.createdAt.toUTCString(),"x-ms-meta-modifiedAt":e.modifiedAt.toUTCString()}}),fetch(n,{cache:"no-cache"}).then(()=>{e.sdk.log("FEAAS: Thumbnail uploaded",n)})}catch(o){e.sdk.log("FEAAS: Thumbnail failed to upload",n,o)}return n}var Ht;typeof window!="undefined"&&(window.FEAASReactElement=B,(Ht=window.FEAASLoading)!==null&&Ht!==void 0||(window.FEAASLoading=Promise.resolve()));function ke(e){let t=[];if(e){let r=e.ownerDocument.defaultView,n,i;for(;r!==window.top;){n=r.parent;for(let o=0;o<n.frames.length;o++)if(n.frames[o]===r){for(let s of n.document.getElementsByTagName("iframe"))if(s.contentWindow===r){i=s.getBoundingClientRect();let a=s.contentWindow.getComputedStyle(s);t.push({left:i.left+parseInt(a.borderLeftWidth),top:i.top+parseInt(a.borderTopWidth)})}r=n;break}}}return t.reduce((r,n)=>({left:r.left+n.left,top:r.top+n.top}),{left:0,top:0})}function Te(e){var t;return{context:HTMLElement,frontend:e==null?void 0:e.getContextAttribute("frontend"),src:(t=e==null?void 0:e.getAttribute("src"))!==null&&t!==void 0?t:"/editor.js",library:e==null?void 0:e.getAttribute("library"),component:e==null?void 0:e.getAttribute("component"),version:e==null?void 0:e.getAttribute("version"),instance:e==null?void 0:e.getAttribute("instance"),forked:e==null?void 0:e.getAttribute("forked"),revision:(e==null?void 0:e.getAttribute("revision"))||"saved",hidden:(e==null?void 0:e.getAttribute("hidden"))!=null,for:e==null?void 0:e.getAttribute("for"),state:(e==null?void 0:e.getAttribute("state"))||"idle",changed:(e==null?void 0:e.getAttribute("changed"))!=null}}var st=class extends A{constructor(){super(...arguments),this.framePoint={top:0,left:0},this.wrapperRect={top:0,left:0,width:0,height:0},this.bodyRect={top:0,left:0,width:0,height:0},this.defaultProps={hidden:!1},this.setTarget=(t,r={component:t.getAttribute("component"),version:t.getAttribute("version"),revision:t.getAttribute("revision"),instance:t.getAttribute("instance")})=>{if(!this.closing&&(!this.target||t==null))return this.set(r),this.target=t,!0},this.onChromeMeasureElement=(t,r=t.getBoundingClientRect())=>t.ownerDocument==document?{left:r.left-this.bodyRect.left,top:r.top-this.bodyRect.top,width:r.width,height:r.height}:{left:r.left+this.framePoint.left-this.bodyRect.left,top:r.top+this.framePoint.top-this.bodyRect.top,width:r.width,height:r.height},this.onBeforeMeasure=t=>{t.memoized.focusable&&(this.framePoint=ke(t.memoized.focusable)),this.chrome&&(this.wrapperRect=this.chrome.positionable.getBoundingClientRect(),this.bodyRect=this.chrome.positionable.ownerDocument.body.parentElement.getBoundingClientRect())},this.onMeasure=()=>{},this.onPosition=({focusable:t,root:r})=>{!this.chrome||this.props.hidden||(t?(this.chrome.wrapper.style.width=t.width+16*2+"px",this.chrome.wrapper.style.height=t.height+16*1+64+"px",this.chrome.wrapper.style.left=t.left-16+"px",this.chrome.wrapper.style.top=t.top-64+"px",this.chrome.wrapper.style.opacity="1",this.chrome.absolute=this.querySelector(".ui.overlays"),this.chrome.absolute&&(this.chrome.absolute.style.left=r.left+"px",this.chrome.absolute.style.top=r.top+"px")):(this.chrome.wrapper.style.opacity="0",this.chrome.wrapper.style.left="-1000px",this.chrome.wrapper.style.top="-1000px"))},this.onWindowMessage=t=>{var r;switch((r=t.data)===null||r===void 0?void 0:r.type){case"feaasEdit":let n=this.getPlaceholder();this.setTarget(n.editable,t.data)&&(this.loader=n.loader,document.body.appendChild(n.clipper),this.editedUID=t.data.id,this.setPlaceholder(),this.open());break;case"feaasMeasurements":this.measurements=t.data.measurements,this.props.hidden||this.setPlaceholder();break}},this.onContentChange=()=>{this.setAttribute("changed","changed"),requestAnimationFrame(()=>{this.setIframeComponentContent()})},this.onClose=()=>{var t;this.setAttribute("hidden","hidden"),this.placeholder&&(this.placeholder.positionable.style.opacity="0",this.placeholder.positionable.style.pointerEvents="none"),this.chrome&&(this.chrome.wrapper.style.opacity="0"),!((t=this.target)===null||t===void 0)&&t.parentNode&&(this.target.outerHTML=this.target.outerHTML),this.setTarget(null,{component:null,version:null,instance:null,revision:null}),this.setEditorContext({isFocused:!1})},this.onVersionStateChange=(t,r)=>{this.versionContext=t,this.setVersionContext=r},this.onEditorStateChange=(t,r)=>{this.editorContext=t,this.setEditorContext=r,t.editor&&this.props.state=="loading"&&!this.props.hidden&&(this.setAttribute("state","ready"),this.ownerDocument.fonts.ready.then(()=>setTimeout(()=>{this.setReadyState(),this.setIframeComponentContent()},100)))}}getProps(){return Te(this)}getReactRootElement(){return this.reactRootElement||(this.reactRootElement=document.createElement("div"),this.getRoot().appendChild(this.reactRootElement)),this.reactRootElement}showLoader(){this.loader||(this.loader=document.createElement("feaas-loader"),this.loader.setAttribute("opacity","0.6"),this.loader.style.zIndex="1000",this.target.appendChild(this.loader),this.target.tagName=="FEAAS-COMPONENT"&&(this.target.style.position="relative"))}hideLoader(){this.loader&&(this.loader.setAttribute("hidden","hidden"),this.target.tagName=="FEAAS-COMPONENT"&&(this.target.style.position="relative",this.target.style.position=""))}load(){return import( /*@vite-ignore*/ /* webpackIgnore: true */ this.formatURL(this.props.src,this.props.frontend))}connectedCallback(){super.connectedCallback(),window.addEventListener("message",this.onWindowMessage)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("message",this.onWindowMessage)}setIframe(t){this.iframe=t}setIframeComponentContent(){this.placeholder&&this.iframe&&this.placeholder.editable.innerHTML&&this.iframe.contentWindow.postMessage({type:"feaasUpdate",id:this.editedUID,content:this.placeholder.editable.innerHTML})}setPlaceholder(){if(!this.iframe)return;let t=this.iframe.clientWidth,r=this.iframe.clientHeight,n=this.iframe.getBoundingClientRect(),i=this.getPlaceholder(),o=document.body.getBoundingClientRect(),s=this.measurements[this.editedUID];s&&(Object.assign(i.clipper.style,{position:"absolute",top:n.top+this.iframe.clientTop-o.top+"px",left:n.left+this.iframe.clientLeft-o.left+"px",width:t+"px",height:r+"px",pointerEvents:"none",zIndex:1,overflow:"hidden"}),Object.assign(i.positionable.style,{position:"absolute",top:s.top+"px",left:s.left+"px",width:s.width+"px",zIndex:2,transition:"opacity 0.4s",pointerEvents:this.props.hidden?"none":"all"}),Object.assign(i.loader.style,{position:"absolute",top:s.top+"px",left:s.left+"px",width:s.width+"px",height:s.height+"px",filter:"opacity(0.6)",zIndex:3,pointerEvents:"none"}),document.dispatchEvent(new Event("feaasRefresh",{bubbles:!0})))}getPlaceholder(){return this.placeholder?this.placeholder:(this.placeholder={clipper:document.createElement("div"),positionable:document.createElement("div"),editable:Object.assign(document.createElement("div"),{className:"-feaas"}),loader:document.createElement("feaas-loader")},this.placeholder.clipper.appendChild(this.placeholder.positionable),this.placeholder.positionable.appendChild(this.placeholder.editable),this.placeholder.clipper.appendChild(this.placeholder.loader),this.placeholder)}attributeChangedCallback(t,r,n){r!==n&&(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))}open(){clearTimeout(this.closing),this.removeAttribute("hidden"),this.removeAttribute("changed"),this.setLoadingState()}shouldFork(t){return t.forkOriginId==null&&this.props.instance!=null}cleanup(){var t;this.placeholder&&((t=this.placeholder.clipper)===null||t===void 0||t.remove(),this.placeholder=null)}close(){console.log("Editor is not ready")}unfork(){console.log("Editor is not ready")}discard(){console.log("Editor is not ready")}save(){console.log("Editor is not ready")}setVersionContext(t){console.log("Editor is not ready")}setEditorContext(t){console.log("Editor is not ready")}setLoadingState(){this.showLoader(),this.setAttribute("state","loading")}setReadyState(){this.hideLoader(),this.setEditorContext({activeVersionId:this.component.versions[0].id}),this.setAttribute("state","ready")}render({children:t,component:r,version:n,instance:i},{Editor:o,VersionStatusList:s,VersionStatusButton:a,Version:l,VersionMenu:d,EditorUIUndo:c,EditorUIMode:f,React:{useEffect:h,useMemo:u,useState:p,useContext:g},Chakra:{HStack:C,Box:v,Button:O,MenuItem:dt},Chrome:k,ReactDOM:J,useSDK:H,useLibrary:je,useSlots:Ue,useModelObserver:Ie,ConfirmationContext:We,VersionContext:mr}){if(!this.payload)return;let{React:y}=this.payload,Kt=H(),Gt=je(),[E,Yt]=p(),{setConfirm:Nt}=g(We),q=i||n;E&&(this.component=E),h(()=>{if(this.props.hidden)return;let P=Gt.components.getItem(r).clone();return P.versions.search({ids:[n,i].filter(Boolean),componentIds:[r]}).then(kt=>{P.versions.setItems(kt);let T=P.findVersion(i,["staged","published"]),G=P.findVersion(n,["staged","published"]);if(T)T.deletedAt?(T.getDraft().changeAndNotify(G.toProperties()).restore(),console.error("FEAAS Editor: Restoring fork")):(console.error("FEAAS Editor: Pre-forked"),this.setAttribute("forked",T.id));else if(this.removeAttribute("forked"),this.shouldFork(G)){console.error("FEAAS Editor: Forking");let Tt=G.fork(i).id;this.setAttribute("instance",Tt)}else console.error("FEAAS Editor: Regular");Yt(P)}),()=>{this.closing=setTimeout(()=>{this.closing=null,this.cleanup(),Yt(null)},400)}},[n,this.props.hidden]);let Xt=Ie(E==null?void 0:E.versions,[]).filter(P=>P.id==q),K=Xt[0];K&&!this.props.hidden&&(this.version=K),h(()=>(this.unfork=()=>{Nt({title:"Reverting component customizations",button:"Discard",body:"Are you sure to reset component to its original state? All changes will be lost.",action:()=>{let P=E.findVersion(n,["staged","published"]);E.findVersion(i).unstage().unpublish().changeAndNotify(P.toProperties()),E.saveVersions(!1),this.setVersionContext({needsWrite:!0}),this.removeAttribute("forked"),requestAnimationFrame(this.onClose)}})},this.discard=()=>{this.props.changed&&(E.findVersion(q).revert(),E.saveVersions(!1),this.setVersionContext({needsWrite:!0}))},this.close=()=>{Nt({title:"Component has unsaved changes",button:"Discard",body:"Are you sure to close editor and discard changes?",bypass:!this.props.changed,action:()=>{this.discard(),requestAnimationFrame(this.onClose)}})},this.save=()=>{Nt({bypass:!!this.props.forked,title:"Customizing component",button:"Save",body:"Changes to the component will only be visible on that page. Changes to component done in Component Builder will not be reflected here. It will be possible to revert the customization.",action:()=>{E.findVersion(q).commitData({view:this.editorContext.editor.getData({rootName:q}),model:""}).stage().publish(),this.removeAttribute("changed"),this.setAttribute("forked",q),E.saveVersions(!1)}})},()=>{delete this.unfork,delete this.discard,delete this.save,delete this.editorContext,delete this.versionContext,delete this.setEditorContext,delete this.setVersionContext}),[E]);let He=u(()=>this.target,[E]);return u(()=>E&&Ue(t,({picker:P,children:kt})=>y.createElement(v,{ref:T=>{this.chrome=T?{positionable:T,wrapper:T.querySelector(".editor-chrome"),absolute:this.querySelector(".ui.overlays")}:null}},y.createElement(v,{className:"editor-wrapper",position:"absolute",left:0,top:0},y.createElement(o,{datasources:Kt.datasources,sdk:Kt,library:Gt,component:E,versions:Xt,context:{isAutosaveEnabled:!1,onChromeMeasure:this.onMeasure,onChromeBeforeMeasure:this.onBeforeMeasure,onChromeMeasureElement:this.onChromeMeasureElement,onChromePosition:this.onPosition,onContentChange:this.onContentChange}},{exports:this.onEditorStateChange,after:kt,chrome:({editor:T})=>T&&y.createElement(k,null),children:({isArchivedDisplayed:T,editor:G,status:Tt})=>y.createElement(v,{position:"absolute",left:0,top:0,className:"editor-chrome",p:4,boxShadow:"2xl",pointerEvents:"none",opacity:0,transition:"opacity 0.3s"},y.createElement(v,{left:0,width:"4",top:0,bottom:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),y.createElement(v,{right:0,width:"4",top:0,bottom:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),y.createElement(v,{top:0,height:"16",left:0,right:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),y.createElement(v,{bottom:0,height:"4",left:0,right:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),K&&y.createElement(l,{version:K,node:He,ignoreBreakpoints:!0,deps:[this.props.forked,this.props.changed]},{exports:this.onVersionStateChange,left:y.createElement(C,{justifyContent:"space-between"},y.createElement(c,{size:"sm",editor:Tt=="ready"?G:null}),y.createElement(f,{size:"sm"})),middle:(gr,br)=>[!1],right:y.createElement(y.Fragment,null,y.createElement(O,{variant:"secondary",size:"sm",onClick:this.close},"Close"),y.createElement(O,{variant:"primary",size:"sm",onClick:this.save,isDisabled:!this.props.changed},this.props.changed?this.props.forked?"Save":"Save customization":"Up to date"),y.createElement(d,{isDisabled:!this.props.forked&&!this.props.changed},y.createElement(dt,{onClick:this.unfork,isDisabled:!this.props.forked},"Unfork"),y.createElement(dt,{onClick:this.discard,isDisabled:!this.props.changed},"Discard")))}))})))),[K,this.props.forked,this.props.changed])}isReadyToLoad(){return this.props.component!=null&&this.props.version!=null&&!this.props.hidden}};st.observedAttributes=["library","component","version","revision","hidden","state","changed","forked"];st.register("feaas-editor");function Pe(e){var t,r;return{part:(e==null?void 0:e.getAttribute("part"))||"picker",slot:(e==null?void 0:e.getAttribute("part"))||"picker",mode:e==null?void 0:e.getAttribute("mode"),dialog:e==null?void 0:e.getAttribute("dialog"),placeholder:(e==null?void 0:e.getAttribute("placeholder"))||"No theme",frontend:(t=e==null?void 0:e.getContextAttribute("frontend"))!==null&&t!==void 0?t:"https://components.sitecorecloud.io",src:(r=e==null?void 0:e.getAttribute("src"))!==null&&r!==void 0?r:"/picker.js",hidden:(e==null?void 0:e.getAttribute("hidden"))!=null,variant:e==null?void 0:e.getAttribute("variant"),context:void 0,onClose:void 0,setAttribute:void 0,getAttribute:void 0}}var at=class extends A{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return Pe(this)}load(){return this.import( /*@vite-ignore*/ /* webpackIgnore: true */ this.formatURL(this.props.src,this.props.frontend))}connectedCallback(){this.setAttribute("feaas-role","ui"),super.connectedCallback()}render({placeholder:t,context:r,mode:n,dialog:i,children:o,variant:s},{Picker:a,React:l,useLibrary:d,useSDK:c}){let[f,h]=l.useReducer(k=>k+1,0),u=d("collections"),p=d("components"),g=c("datasources"),C=d("stylesheet.styles"),v=p.find(k=>k.id==(r==null?void 0:r.getAttribute("component")));var O=r==null?void 0:r.getAttribute("data");if(O)try{O=JSON.parse(O)}catch(k){}let dt=n=="datasources"?g.find(k=>k.id==i):null;return l.createElement(a,{rules:C,collections:u,themeContext:r,placeholder:t,component:v,datasource:dt,data:O,versionId:r==null?void 0:r.getAttribute("version"),mode:n||(v?"component":null),setAttribute:(k,J,H)=>{J=="data"&&H&&(H=JSON.stringify(H)),this.props.setAttribute(k,J,H),h()},context:r,variant:s,onModeChange:(k,J)=>{this.set({mode:k,dialog:J})}},o)}};at.observedAttributes=["library","mode","frontend","src","hidden","variant","dialog"];at.register("feaas-picker");function _e(e){var t,r,n,i,o;return{library:e==null?void 0:e.getAttribute("library"),src:(t=e==null?void 0:e.getAttribute("src"))!==null&&t!==void 0?t:"/context.js",environment:(r=e==null?void 0:e.getAttribute("environment"))!==null&&r!==void 0?r:void 0,frontend:(n=e==null?void 0:e.getAttribute("frontend"))!==null&&n!==void 0?n:"https://components.sitecorecloud.io",backend:(i=e==null?void 0:e.getAttribute("backend"))!==null&&i!==void 0?i:"https://components.sitecorecloud.io/api",cdn:(o=e==null?void 0:e.getAttribute("cdn"))!==null&&o!==void 0?o:"https://feaas.blob.core.windows.net",auth:null,isolate:(e==null?void 0:e.getAttribute("isolate"))==null||(e==null?void 0:e.getAttribute("isolate"))=="true"}}var W=class extends A{constructor(){super(...arguments),this.defaultProps={isolate:!0},this.onStatusChange=(t,r)=>{t=="ready"&&(this.whenSDKReady.resolve(r),this.dispatchEvent(new CustomEvent("feaasReady",{bubbles:!0,composed:!0,detail:r})))},this.whenSDKReady=R(t=>{this.sdk=t})}getProps(){return _e(this)}load(){return this.import( /*@vite-ignore*/ /* webpackIgnore: true */ this.formatURL(this.props.src,this.props.frontend))}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null}getTheme(t){return t}getRoot(){return this.getAttribute("isolate")==="false"?this:this.shadowRoot||this.attachShadow({mode:"open"})}getReactRootElement(){return this.reactRootElement||(this.reactRootElement=document.createElement("div"),this.getRoot().appendChild(this.reactRootElement)),this.reactRootElement}connectedCallback(){this.setAttribute("feaas-role","ui"),Array.from(this.children).forEach(t=>{this.getRoot().appendChild(t)}),document.addEventListener("feaasMount",this),document.addEventListener("feaasUnmount",this),super.connectedCallback()}disconnectedCallback(){document.removeEventListener("feaasMount",this),document.removeEventListener("feaasUnmount",this),super.disconnectedCallback()}getPortalRoot(){return this.getRoot()}render({children:t,library:r},{AppContext:n,Chakra:{Button:i,Tooltip:o},React:s}){let a={containerRef:{current:this.getPortalRoot()}};return o.defaultProps={hasArrow:!0,placement:"top",portalProps:a},s.createElement(n,{environment:this.props.environment,backend:this.props.backend,libraryId:this.props.library,container:this.getRoot(),auth:this.props.auth,getTheme:this.getTheme,onStatusChange:this.onStatusChange,modalProps:{portalProps:a},chakraProps:{resetScope:':where([feaas-role="ui"])',cssVarsRoot:":host",resetCSS:!0,toastOptions:{portalProps:a}}},t)}};W.observedAttributes=["library","component","version","revision","hostname","template"];W.register("feaas-context");W.prototype.clientside=Bt;import w from"react";import Oe from"react";import or from"react-dom";function Vt(e){let t=/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g;return e.replace(t,function(r){return"-"+r.toLowerCase()})}function lt(e){let t=/-[a-z\u00E0-\u00F6\u00F8-\u00FE]/g;return e.replace(t,function(r){return r.slice(1).toUpperCase()})}var sr=e=>Object.keys(e).reduce((t,r)=>{if(e[r].title)t[r]=e[r];else{let n=r.split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()).join(" ");t[r]={...e[r],title:n}}return t},{}),xt=(e={})=>Object.keys(e).reduce((t,r)=>(t[Vt(r)]=e[r],t),{}),ar=e=>{if(!e)return;if(!e.properties)return e;let t,r;return t=xt(e.properties),r=(e.required||[]).map(i=>Vt(i)),t=sr(t),{...e,properties:t,required:r,title:void 0}},lr=(e,t)=>{if(!e||!t)return;let r;return r=xt(e),Object.keys(t).filter(i=>/(integer|number)/.test(t[i].type)).forEach(i=>{r[i]?r[i]["ui:widget"]||(r[i]["ui:widget"]="updown"):r[i]={"ui:widget":"updown"}}),r},dr=(e,t,r)=>{var n;switch((n=r==null?void 0:r[e])===null||n===void 0?void 0:n.type){case"string":return t;case"object":try{return typeof t=="object"&&t!=null?t:JSON.parse(t)}catch(i){return null}case"array":try{return Array.isArray(t)?t:JSON.parse(t)}catch(i){return null}case"number":return parseFloat(t);case"integer":return parseInt(t);case"boolean":return t=="true"||t=="1";default:return t}};function cr(e){let t=Array.from(e.attributes).reduce((r,{name:n,value:i})=>Object.assign(r,{[n]:i}),{});return St(t["data-external-id"],t)}function St(e,t){var r;let n=(r=b.registered[e])===null||r===void 0?void 0:r.schema;return Object.keys(t).reduce((i,o)=>{let s=t[o];return!o.startsWith("data-attribute")&&!["class","id","contenteditable"].includes(o)?{...i,[lt(o)]:dr(lt(o),s,n==null?void 0:n.properties)}:i},{})}var b=class extends A{load(){return Promise.resolve({React:Oe,ReactDOM:or})}update(){var t;let{dataExternalId:r}=this.props;if(!(!(!((t=b.registered[r])===null||t===void 0)&&t.component)&&this.childNodes.length>0))return super.update()}render(t,{React:r}){var n;let{dataExternalId:i}=t,o=(n=b.registered[i])===null||n===void 0?void 0:n.component;return o||console.warn("FEAASExternal: The component you requested is not registered"),r.createElement(r.Fragment,null,o&&r.createElement(o,{...t}))}getProps(){return cr(this)}static registerComponent(t,r){if(!r.name)throw new Error("Could not register external component. Please make sure you provide a name in the options"+JSON.stringify(r));let n=r.name,{thumbnail:i,group:o,ui:s,...a}=r,l={...a,type:"object"};b.registered[n]={component:t,name:n,schema:l,uiSchema:s,thumbnail:i,group:o,title:(l==null?void 0:l.title)||n},b.setRegistrationCallback()}static setRegistrationCallback(){clearTimeout(b.registrationCallback),b.registrationCallback=setTimeout(()=>{var t;if(typeof window!="undefined"){let r=Object.keys(b.registered).map(n=>{var i;return{...b.registered[n],name:n,schema:ar(b.registered[n].schema),uiSchema:lr(b.registered[n].uiSchema,(i=b.registered[n].schema)===null||i===void 0?void 0:i.properties)}});(t=window.parent)===null||t===void 0||t.postMessage(JSON.stringify({action:"register-components",data:r}),"*")}},30)}static Preview(t){var r;let n=(t==null?void 0:t.src)||(typeof window!="undefined"?(r=window.location.search.match(/feaasSrc=([^&]+)/))===null||r===void 0?void 0:r[1]:null);return n?Oe.createElement(Me,{src:n,...t}):null}static linkComponents(t){return()=>t.map(r=>null)}static getComponent(t){return b.registered[t]}};b.registered={};b.register("feaas-external");b.setRegistrationCallback();var{getComponent:Rt,linkComponents:ur,registerComponent:hr}=b;var pr=e=>w.createElement("feaas-stylesheet",{...e}),fr=async({...e})=>{let t=await x.fetch((e==null?void 0:e.data)||{}),r={...e};if(("src"in e||"component"in e)&&(e==null?void 0:e.template)==null){let n=await $t(e);r.template=n.template,r.lastModified=n.lastModified}return De({...r,data:t})};function De({data:e,...t}){let r=null,n;return"template"in t&&t.template&&(n=Lt(t.template,e||{}).map((i,o)=>Le(i,(s,a)=>{if(s.localName=="feaas-external"){let d={};for(var l in a){let c=l=="data-external-id"?"componentName":lt(l);d[c]=a[l]}return[qt?Fe:Jt,d]}},o))),"src"in t&&(t={...U(t.src),...t}),w.createElement(w.Fragment,null,"preload"in t&&r===!0&&"src"in t&&w.createElement(w.Fragment,null,w.createElement("link",{rel:"preload",as:"fetch",href:nt(t.src),crossOrigin:"anonymous"}),w.createElement("link",{rel:"preload",as:"style",href:I(t.src),crossOrigin:"anonymous"})),w.createElement("feaas-component",{...t,suppressHydrationWarning:!0,template:null,data:typeof e=="string"?e:e?JSON.stringify(e):null,hydrate:"false"},n))}function Jt(e){var t;let{componentName:r,fallback:n,...i}=e,o=(t=Rt(r))===null||t===void 0?void 0:t.component;if(!o&&n)return n;let s=St(r,i);return delete s.suppressHydrationWarning,w.createElement(w.Fragment,null,w.createElement("feaas-external",{...xt(s),"data-external-id":r,suppressHydrationWarning:!0,hydrate:o?"false":null},o==null?null:w.createElement(o,{...s})))}function Le(e,t,r){if(e.nodeType===3)return e.textContent;let n=Array.from(e.childNodes).map((l,d)=>Le(l,t,d)),i={};for(let l=0;l<e.attributes.length;l++){let{name:d,value:c}=e.attributes[l];d=="style"?i[d]=String(c||"").trim().split(/\s*;\s*/).reduce((f,h)=>{let[u,p]=h.split(":");return{...f,[u]:p}},{}):d=="class"?i.className=c:i[d]=c}let o=t==null?void 0:t(e,i),s=(o==null?void 0:o[0])||e.nodeName.toLowerCase(),a=Object.assign({key:r,suppressHydrationWarning:!0},(o==null?void 0:o[1])||i);return w.createElement(s,a,["img","br","input"].includes(s)?null:n)}var zt=new Map,$e=null,qt=null;function Fe(e){var t;let{componentName:r,...n}=e,i=(t=Rt(r))===null||t===void 0?void 0:t.component;if(!zt.get(r)){let s=qt(()=>Promise.resolve($e),{ssr:!1,loading:()=>w.createElement(Jt,{...n,componentName:r})});zt.set(r,s)}let o=zt.get(r);return w.createElement(o,{...e,fallback:i?w.createElement(i,{...e}):null})}function ti(e,t){return qt=e,$e=t,t}var ei=Jt,ri=Fe,Me=De,ni=fr,ii=pr;export{Me as Component,Ae as ComponentProps,W as Context,R as ControlledPromise,_ as DEFAULT_CDN_URL,mt as DOM,ft as DataPath,ut as DataScope,x as DataSettings,A as Element,b as External,ei as ExternalComponent,it as FEAASComponent,Ae as FEAASComponentsProps,W as FEAASContext,_e as FEAASContextProps,st as FEAASEditor,Te as FEAASEditorProps,A as FEAASElement,St as FEAASExternalPropsObject,ot as FEAASLoader,Ce as FEAASLoaderProps,Fe as FEAASNextExternalComponent,at as FEAASPicker,Pe as FEAASPickerProps,De as FEAASReactComponent,Jt as FEAASReactExternalComponent,fr as FEAASReactServerComponent,pr as FEAASReactStylesheet,Et as FEAASStylesheet,Ee as FEAASStylesheetProps,Le as HTMLNodeToReact,gt as InvalidResponse,m as JSONPath,ot as Loader,ct as MyComponent,ri as NextExternalComponent,at as Picker,ni as ServerComponent,ii as Stylesheet,wt as Thumbnail,ie as adjustNumbers,te as autoloadScripts,Q as cleanCollectionBit,Xe as clearFetchCache,be as createStylesheet,ti as enableNextClientsideComponents,et as fetchAndRevalidate,z as fetchAndRevalidateComponent,vt as fetchAndRevalidateStylesheet,bt as fetchBypassingCache,tt as fetchCache,$t as fetchComponent,It as fetchData,rt as fetchToValidateCache,j as fetchWithCacheAwareness,ge as findStylesheet,Rt as getComponent,Ze as getComponentSource,nt as getComponentURL,fe as getFetchCache,ke as getFramePosition,oe as getHumanizedLabel,se as getLastPathBit,ne as getQualifier,Qe as getStylesheetSource,I as getStylesheetURL,ur as linkComponents,Z as loadScript,At as loadStylesheet,Ft as loadStylesheetAllowStale,pt as normalizeCollectionScope,Qt as observeDOMElement,U as parseComponentSource,ee as parseLimit,re as parseRange,yt as parseStylesheetSource,V as queryObject,Mt as queryObjectRaw,X as queryScopes,hr as registerComponent,jt as renderComponent,er as renderComponentElement,ye as renderComponentPromise,F as renderDOMContent,N as renderDOMElement,Ke as renderHTMLContent,tr as renderStylesheet,me as renderStylesheetPromise,D as serializeCH1RichText,$ as setDOMAttribute};
|
|
72
72
|
//# sourceMappingURL=react.esm.js.map
|