@sitecore-feaas/clientside 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- var dt=Object.defineProperty,Xt=Object.defineProperties,Kt=Object.getOwnPropertyDescriptor,Yt=Object.getOwnPropertyDescriptors,Gt=Object.getOwnPropertyNames,Ct=Object.getOwnPropertySymbols;var Tt=Object.prototype.hasOwnProperty,Qt=Object.prototype.propertyIsEnumerable;var xt=(t,r,e)=>r in t?dt(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,N=(t,r)=>{for(var e in r||(r={}))Tt.call(r,e)&&xt(t,e,r[e]);if(Ct)for(var e of Ct(r))Qt.call(r,e)&&xt(t,e,r[e]);return t},Y=(t,r)=>Xt(t,Yt(r));var Zt=(t,r)=>{for(var e in r)dt(t,e,{get:r[e],enumerable:!0})},te=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let A of Gt(r))!Tt.call(t,A)&&A!==e&&dt(t,A,{get:()=>r[A],enumerable:!(n=Kt(r,A))||n.enumerable});return t};var ee=t=>te(dt({},"__esModule",{value:!0}),t);var I=(t,r,e)=>new Promise((n,A)=>{var E=P=>{try{F(e.next(P))}catch(C){A(C)}},S=P=>{try{F(e.throw(P))}catch(C){A(C)}},F=P=>P.done?n(P.value):Promise.resolve(P.value).then(E,S);F((e=e.apply(t,r)).next())});var ve={};Zt(ve,{FEAASComponent:()=>ct,FEAASComponentsProps:()=>Wt,FEAASContext:()=>pt,FEAASContextProps:()=>Vt,FEAASEditor:()=>At,FEAASEditorProps:()=>Ut,FEAASLoader:()=>ut,FEAASLoaderProps:()=>Ee,FEAASPicker:()=>Et,FEAASPickerLazy:()=>vt,FEAASPickerLazyProps:()=>qt,FEAASPickerProps:()=>Jt,FEAASStylesheet:()=>mt,FEAASStylesheetProps:()=>jt,autoloadScripts:()=>It,cleanCollectionBit:()=>_t,fetchAndRevalidate:()=>ft,getFramePosition:()=>zt,loadScript:()=>gt,normalizeCollectionScope:()=>Ot,observeDOMElement:()=>Bt,queryScopes:()=>wt,renderComponent:()=>Ae,renderComponentElement:()=>be,renderComponentPromise:()=>Nt,renderDOMContent:()=>at,renderDOMElement:()=>G,renderStylesheet:()=>me,renderStylesheetPromise:()=>$t,setDOMAttribute:()=>et});module.exports=ee(ve);function j(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(r){return typeof r}:j=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},j(t)}function re(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function ne(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&it(t,r)}function st(t){return st=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},st(t)}function it(t,r){return it=Object.setPrototypeOf||function(n,A){return n.__proto__=A,n},it(t,r)}function Mt(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function ot(t,r,e){return Mt()?ot=Reflect.construct:ot=function(A,E,S){var F=[null];F.push.apply(F,E);var P=Function.bind.apply(A,F),C=new P;return S&&it(C,S.prototype),C},ot.apply(null,arguments)}function oe(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Pt(t){var r=typeof Map=="function"?new Map:void 0;return Pt=function(n){if(n===null||!oe(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r!="undefined"){if(r.has(n))return r.get(n);r.set(n,A)}function A(){return ot(n,arguments,st(this).constructor)}return A.prototype=Object.create(n.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),it(A,n)},Pt(t)}function se(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ie(t,r){return r&&(typeof r=="object"||typeof r=="function")?r:se(t)}function ae(t){var r=Mt();return function(){var n=st(t),A;if(r){var E=st(this).constructor;A=Reflect.construct(n,arguments,E)}else A=n.apply(this,arguments);return ie(this,A)}}function kt(t){return ue(t)||ce(t)||Dt(t)||pe()}function ue(t){if(Array.isArray(t))return Rt(t)}function ce(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Dt(t,r){if(!!t){if(typeof t=="string")return Rt(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Rt(t,r)}}function Rt(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function pe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function le(t,r){var e=typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Dt(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,A=function(){};return{s:A,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(P){throw P},f:A}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var E=!0,S=!1,F;return{s:function(){e=e.call(t)},n:function(){var P=e.next();return E=P.done,P},e:function(P){S=!0,F=P},f:function(){try{!E&&e.return!=null&&e.return()}finally{if(S)throw F}}}}var H=Object.prototype.hasOwnProperty;function nt(t,r){return t=t.slice(),t.push(r),t}function tt(t,r){return r=r.slice(),r.unshift(t),r}var he=function(t){ne(e,t);var r=ae(e);function e(n){var A;return re(this,e),A=r.call(this,'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),A.avoidNew=!0,A.value=n,A.name="NewError",A}return e}(Pt(Error));function T(t,r,e,n,A){if(!(this instanceof T))try{return new T(t,r,e,n,A)}catch(P){if(!P.avoidNew)throw P;return P.value}typeof t=="string"&&(A=n,n=e,e=r,r=t,t=null);var E=t&&j(t)==="object";if(t=t||{},this.json=t.json||e,this.path=t.path||r,this.resultType=t.resultType||"value",this.flatten=t.flatten||!1,this.wrap=H.call(t,"wrap")?t.wrap:!0,this.sandbox=t.sandbox||{},this.preventEval=t.preventEval||!1,this.parent=t.parent||null,this.parentProperty=t.parentProperty||null,this.callback=t.callback||n||null,this.otherTypeCallback=t.otherTypeCallback||A||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},t.autostart!==!1){var S={path:E?t.path:r};E?"json"in t&&(S.json=t.json):S.json=e;var F=this.evaluate(S);if(!F||j(F)!=="object")throw new he(F);return F}}T.prototype.evaluate=function(t,r,e,n){var A=this,E=this.parent,S=this.parentProperty,F=this.flatten,P=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,e=e||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,r=r||this.json,t=t||this.path,t&&j(t)==="object"&&!Array.isArray(t)){if(!t.path&&t.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!H.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var C=t;r=C.json,F=H.call(t,"flatten")?t.flatten:F,this.currResultType=H.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=H.call(t,"sandbox")?t.sandbox:this.currSandbox,P=H.call(t,"wrap")?t.wrap:P,this.currPreventEval=H.call(t,"preventEval")?t.preventEval:this.currPreventEval,e=H.call(t,"callback")?t.callback:e,this.currOtherTypeCallback=H.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,E=H.call(t,"parent")?t.parent:E,S=H.call(t,"parentProperty")?t.parentProperty:S,t=t.path}if(E=E||null,S=S||null,Array.isArray(t)&&(t=T.toPathString(t)),!(!t&&t!==""||!r)){var R=T.toPathArray(t);R[0]==="$"&&R.length>1&&R.shift(),this._hasParentSelector=null;var w=this._trace(R,r,["$"],E,S,e).filter(function(x){return x&&!x.isParentSelector});return w.length?!P&&w.length===1&&!w[0].hasArrExpr?this._getPreferredOutput(w[0]):w.reduce(function(x,D){var M=A._getPreferredOutput(D);return F&&Array.isArray(M)?x=x.concat(M):x.push(M),x},[]):P?[]:void 0}};T.prototype._getPreferredOutput=function(t){var r=this.currResultType;switch(r){case"all":{var e=Array.isArray(t.path)?t.path:T.toPathArray(t.path);return t.pointer=T.toPointer(e),t.path=typeof t.path=="string"?t.path:T.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[r];case"path":return T.toPathString(t[r]);case"pointer":return T.toPointer(t.path);default:throw new TypeError("Unknown result type")}};T.prototype._handleCallback=function(t,r,e){if(r){var n=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:T.toPathString(t.path),r(n,e,t)}};T.prototype._trace=function(t,r,e,n,A,E,S,F){var P=this,C;if(!t.length)return C={path:e,value:r,parent:n,parentProperty:A,hasArrExpr:S},this._handleCallback(C,E,"value"),C;var R=t[0],w=t.slice(1),x=[];function D(L){Array.isArray(L)?L.forEach(function(W){x.push(W)}):x.push(L)}if((typeof R!="string"||F)&&r&&H.call(r,R))D(this._trace(w,r[R],nt(e,R),r,R,E,S));else if(R==="*")this._walk(R,w,r,e,n,A,E,function(L,W,X,B,V,K,$,z){D(P._trace(tt(L,X),B,V,K,$,z,!0,!0))});else if(R==="..")D(this._trace(w,r,e,n,A,E,S)),this._walk(R,w,r,e,n,A,E,function(L,W,X,B,V,K,$,z){j(B[L])==="object"&&D(P._trace(tt(W,X),B[L],nt(V,L),B,L,z,!0))});else{if(R==="^")return this._hasParentSelector=!0,{path:e.slice(0,-1),expr:w,isParentSelector:!0};if(R==="~")return C={path:nt(e,R),value:A,parent:n,parentProperty:null},this._handleCallback(C,E,"property"),C;if(R==="$")D(this._trace(w,r,e,null,null,E,S));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(R))D(this._slice(R,w,r,e,n,A,E));else if(R.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");this._walk(R,w,r,e,n,A,E,function(L,W,X,B,V,K,$,z){P._eval(W.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1"),B[L],L,V,K,$)&&D(P._trace(tt(L,X),B,V,K,$,z,!0))})}else if(R[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");D(this._trace(tt(this._eval(R,r,e[e.length-1],e.slice(0,-1),n,A),w),r,e,n,A,E,S))}else if(R[0]==="@"){var M=!1,U=R.slice(1,-2);switch(U){case"scalar":(!r||!["object","function"].includes(j(r)))&&(M=!0);break;case"boolean":case"string":case"undefined":case"function":j(r)===U&&(M=!0);break;case"integer":Number.isFinite(r)&&!(r%1)&&(M=!0);break;case"number":Number.isFinite(r)&&(M=!0);break;case"nonFinite":typeof r=="number"&&!Number.isFinite(r)&&(M=!0);break;case"object":r&&j(r)===U&&(M=!0);break;case"array":Array.isArray(r)&&(M=!0);break;case"other":M=this.currOtherTypeCallback(r,e,n,A);break;case"null":r===null&&(M=!0);break;default:throw new TypeError("Unknown value type "+U)}if(M)return C={path:e,value:r,parent:n,parentProperty:A},this._handleCallback(C,E,"value"),C}else if(R[0]==="`"&&r&&H.call(r,R.slice(1))){var lt=R.slice(1);D(this._trace(w,r[lt],nt(e,lt),r,lt,E,S,!0))}else if(R.includes(",")){var St=R.split(","),Q=le(St),ht;try{for(Q.s();!(ht=Q.n()).done;){var rt=ht.value;D(this._trace(tt(rt,w),r,e,n,A,E,!0))}}catch(L){Q.e(L)}finally{Q.f()}}else!F&&r&&H.call(r,R)&&D(this._trace(w,r[R],nt(e,R),r,R,E,S,!0))}if(this._hasParentSelector)for(var _=0;_<x.length;_++){var Z=x[_];if(Z&&Z.isParentSelector){var J=this._trace(Z.expr,r,Z.path,n,A,E,S);if(Array.isArray(J)){x[_]=J[0];for(var Ft=J.length,q=1;q<Ft;q++)_++,x.splice(_,0,J[q])}else x[_]=J}}return x};T.prototype._walk=function(t,r,e,n,A,E,S,F){if(Array.isArray(e))for(var P=e.length,C=0;C<P;C++)F(C,t,r,e,n,A,E,S);else e&&j(e)==="object"&&Object.keys(e).forEach(function(R){F(R,t,r,e,n,A,E,S)})};T.prototype._slice=function(t,r,e,n,A,E,S){if(!!Array.isArray(e)){var F=e.length,P=t.split(":"),C=P[2]&&Number.parseInt(P[2])||1,R=P[0]&&Number.parseInt(P[0])||0,w=P[1]&&Number.parseInt(P[1])||F;R=R<0?Math.max(0,R+F):Math.min(F,R),w=w<0?Math.max(0,w+F):Math.min(F,w);for(var x=[],D=R;D<w;D+=C){var M=this._trace(tt(D,r),e,n,A,E,S,!0);M.forEach(function(U){x.push(U)})}return x}};T.prototype._eval=function(t,r,e,n,A,E){t.includes("@parentProperty")&&(this.currSandbox._$_parentProperty=E,t=t.replace(/@parentProperty/g,"_$_parentProperty")),t.includes("@parent")&&(this.currSandbox._$_parent=A,t=t.replace(/@parent/g,"_$_parent")),t.includes("@property")&&(this.currSandbox._$_property=e,t=t.replace(/@property/g,"_$_property")),t.includes("@path")&&(this.currSandbox._$_path=T.toPathString(n.concat([e])),t=t.replace(/@path/g,"_$_path")),t.includes("@root")&&(this.currSandbox._$_root=this.json,t=t.replace(/@root/g,"_$_root")),/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/.test(t)&&(this.currSandbox._$_v=r,t=t.replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1"));try{return this.vm.runInNewContext(t,this.currSandbox)}catch(S){throw console.log(S),new Error("jsonPath: "+S.message+": "+t)}};T.cache={};T.toPathString=function(t){for(var r=t,e=r.length,n="$",A=1;A<e;A++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(r[A])||(n+=/^[\*0-9]+$/.test(r[A])?"["+r[A]+"]":"['"+r[A]+"']");return n};T.toPointer=function(t){for(var r=t,e=r.length,n="",A=1;A<e;A++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(r[A])||(n+="/"+r[A].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};T.toPathArray=function(t){var r=T.cache;if(r[t])return r[t].concat();var e=[],n=t.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,function(E,S){return"[#"+(e.push(S)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(E,S){return"['"+S.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(E,S){return";"+S.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),A=n.split(";").map(function(E){var S=E.match(/#([0-9]+)/);return!S||!S[1]?E:e[S[1]]});return r[t]=A,r[t].concat()};var de=function(r,e,n){for(var A=r.length,E=0;E<A;E++){var S=r[E];n(S)&&e.push(r.splice(E--,1)[0])}};T.prototype.vm={runInNewContext:function(r,e){var n=Object.keys(e),A=[];de(n,A,function(C){return typeof e[C]=="function"});var E=n.map(function(C,R){return e[C]}),S=A.reduce(function(C,R){var w=e[R].toString();return/function/.test(w)||(w="function "+w),"var "+R+"="+w+";"+C},"");r=S+r,!/(["'])use strict\1/.test(r)&&!n.includes("arguments")&&(r="var arguments = undefined;"+r),r=r.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"");var F=r.lastIndexOf(";"),P=F>-1?r.slice(0,F+1)+" return "+r.slice(F+1):" return "+r;return ot(Function,kt(n).concat([P])).apply(void 0,kt(E))}};function ft(t,r,e,n){return I(this,null,function*(){let A=new Date,E=yield fetch(t,r);if(!E.ok)throw new Error("Fetch failed");let S=new Date(E.headers.get("date"));var F=E;if(n(E,"cached"),S<A){let P=yield fetch(t+"?"+Math.random(),Y(N({},r),{method:"HEAD",cache:"no-cache"}));if(P.headers.get("last-modified")!=E.headers.get("last-modified")){if(e(P)===!1)throw new Error("Response is stale");F=yield fetch(t,Y(N({},r),{cache:"reload"}))}}if(e(F)===!1)throw new Error("Response is not valid");return E!==F&&n(F,"valid"),F})}function fe({cdn:t="https://feaascomponentsapidev.blob.core.windows.net",hostname:r,library:e,component:n,version:A,revision:E="published"}){return`${t||r}/components/${e}/${n}/${A}/${E}.html`}function ye({cdn:t="https://feaascomponentsapidev.blob.core.windows.net",hostname:r,library:e,revision:n="published"}){return`${t||r}/styles/${e}/${n}.css`}function yt(t,r){return I(this,null,function*(){return ft(fe(t),{},e=>e.headers.get("x-ms-meta-versionDeletedAt")==null,e=>{e.text().then(r)})})}function bt(t,r){return I(this,null,function*(){return ft(ye(t),{},e=>e.headers.get("x-ms-meta-deletedAt")==null,e=>{e.text().then(r)})})}function be(t,r){let e=document.createElement("div");e.innerHTML=t;let n=document.createDocumentFragment();for(;e.firstChild;)n.appendChild(e.firstChild);return G(n,r),e}function _t(t){return t.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function Ot(t){return _t(t)+".*"}function Ht(t){let r=t.getAttribute("data-path-scope");for(var e=0,n=t;n=n.previousElementSibling;)n.getAttribute("data-path-scope")==r&&e++;return e}function ge(t,r,e){let n=t.getAttribute("data-path-scope");if(n==null)return;var A=Ht(t);if(A!=0)return;let E=t.parentElement;if(E!=null){r==0?t.style.display="none":t.style.display&&(t.style.display="",t.getAttribute("style")==""&&t.removeAttribute("style"));for(var S=A+1,F=t,P=t;P=P.nextElementSibling;)P.getAttribute("data-path-scope")==n&&(S++,F=P);for(var C=S;C<r;C++)E.insertBefore(F.cloneNode(!0),F.nextElementSibling);for(var C=Math.max(1,r);C<S;C++)F=F.previousElementSibling,E.removeChild(F.nextElementSibling)}}function wt(t,r,e=!1,n=t){var A=r;let E=Object.keys(t).sort((F,P)=>P.length-F.length);for(let F of E)if(r.startsWith(F)){if(F==r){if(e)return t[F];continue}A=r.substring(F.length+1),n=t[F];break}let S=T({path:A,json:n});return e&&S&&Array.isArray(S)?S[0]:S}function et(t,r,e,n){var R;if(!!t){var A=t;n!=null&&n.processValue&&(e=n==null?void 0:n.processValue(t,r,e));var E=r.replace("data-path-","");if(r=="data-path-src")A=t.tagName=="IMG"?t:t.querySelector("img, video");else if(r=="data-path-href")A=t.querySelector("a")||t.closest("a");else if(r=="data-path-alt")A=t.querySelector("img, picture");else if(r=="data-path-hidden")e=e?null:!0;else if(r=="data-path"||r=="data-embed-html"||r=="html")E="innerHTML";else if(r=="data-embed-src")gt(t,e);else if(r=="data-path-attributes"){let w=((R=t.getAttribute("data-attributes-keys"))==null?void 0:R.split(",").filter(Boolean))||[];for(var S in e){var F=e[S];et(t,S,typeof F=="object"&&F?JSON.stringify(F):F,n)}for(var P=0;P<w.length;P++)(e==null||!(w[P]in e))&&et(t,w[P],null,n);et(t,"data-attributes-keys",Object.keys(e||{}).join(","));return}if(typeof e=="boolean"&&(e=e?"":null),!!A){var C=String(t.getAttribute("data-path-placeholder")||A[E]);e!=null?E=="innerHTML"?A.innerHTML!=e&&(A.innerHTML=e):A.getAttribute(E)!=e&&A.setAttribute(E,e):E=="innerHTML"?A.innerHTML=C:A.removeAttribute(E)}}}function Bt(t){let r=new t.ownerDocument.defaultView.MutationObserver(e=>{e.forEach(n=>{let A=n.target,E=A.getAttribute("data-embed-src");E&&gt(A,E),n.addedNodes&&n.addedNodes.forEach(S=>{S.nodeType==1&&It(S,!1)})})});return r.observe(t,{attributes:!0,subtree:!0,childList:!0}),r}function It(t,r=!0){let e=t.querySelectorAll("[data-embed-src]");for(var n=0;n<e.length;n++){let A=e[n];gt(A,A.getAttribute("data-embed-src"))}if(r)return Bt(t)}function gt(t,r){for(var e=t;e;e=e.parentElement)if(!e.parentElement){let A=e.querySelectorAll("script");for(var n=0;n<A.length;n++)if(A[n].getAttribute("src")==r)return!0;e.tagName=="HTML"&&(e=e.querySelector("head")||e);let E=e.ownerDocument.createElement("script");E.type="module",E.src=r,e.appendChild(E);break}}var Lt=["data-attributes-keys","data-path-attributes","data-path-scope"];function G(t,r,e,n){var S,F,P;let A=t;if(n||(r=((S=e==null?void 0:e.processData)==null?void 0:S.call(e,A,r))||r),A.nodeType==1){let C=A.getAttribute("data-path-scope");if(C){let w=Ht(A),x=wt(r,C,!1)||[];w==0&&ge(A,((F=e==null?void 0:e.shouldRepeat)==null?void 0:F.call(e,A,x))===!1?1:x.length,e),r=Y(N({},r),{[Ot(C)]:x[w]})}let R=Array.prototype.slice.call(A.attributes).sort((w,x)=>Lt.indexOf(w.name)-Lt.indexOf(x.name));for(var E=0;E<R.length;E++){let{name:w,value:x}=R[E];w.startsWith("data-path")&&w!="data-path-scope"&&et(A,w,wt(r,x,!0),e),w=="data-embed-src"&&et(A,w,A.getAttribute(w),e)}}for(var E=0;E<A.children.length;E++)G(A.children[E],r,e,!0);return n||(P=e==null?void 0:e.onRender)==null||P.call(e,A,r),A}function at(t,r,e,n){var E;let A=((E=n==null?void 0:n.processTemplate)==null?void 0:E.call(n,t,r,e))||r;return t.innerHTML=A,t.classList.add("-feaas"),G(t,e,n)}function me(t,r){return $t(t,r||(r=document.createElement("style"))),r}function $t(t,r){return r||(r=document.createElement("style")),bt(t,e=>{r.textContent=e}).then(()=>r)}function Ae(t,r){return Nt(t,r||(r=document.createElement("div"))),r}function Nt(t,r){return I(this,null,function*(){return r||(r=document.createElement("div")),r.childNodes.length?G(r,t.data,t):"template"in t?at(r,t.template,t.data,t):yt(t,e=>at(r,e,t.data,t)).then(()=>r)})}var O=class extends HTMLElement{constructor(){super(...arguments);this.connected=null;this.refs={};this.descendants=[];this.onLoad=e=>{e!=null&&(this.payload=e,this.render())}}getProps(e){return{}}getRoot(){return this}attributeChangedCallback(e,n,A){this.set()}connectedCallback(){console.log("FEAAS: Connected",this),this.connected=new Event("feaasConnected",{bubbles:!0,composed:!0}),this.dispatchEvent(this.connected),this.addEventListener("feaasConnected",this),this.addEventListener("feaasDisconnected",this),this.set()}disconnectedCallback(){console.log("FEAAS: Disconnected",this),this.removeEventListener("feaasConnected",this),this.removeEventListener("feaasDisconnected",this),this.dispatchEvent(new Event("feaasDisconnected",{bubbles:!0,composed:!0})),this.connected=null}handleEvent(e){switch(e.type){case"feaasConnected":this.adoptedCallback(e);break;case"feaasDisconnected":this.orphanCallback(e);break}}orphanCallback(e){let n=e.composedPath()[0],A=this.descendants.indexOf(n);A!=-1&&(console.log("FEAAS: Orphaning",this,n),this.descendants.splice(A,-1),this.refs[n.getComponentName()]=null,n.refs.parent==this&&(n.refs.parent=null),n.refs.top==this&&(n.refs.top=n.refs.parent))}adoptedCallback(e){var E,S;let n=e.composedPath()[0];if(this.descendants.push(n),console.log("FEAAS: Adopting",this,n),this.refs[n.getComponentName()]=n,n.refs.top=this,(E=n.refs).parent||(E.parent=this),n.renderReact)for(var A=n.refs.parent;A;A=A.refs.parent)A.renderReact&&((S=n.refs).parentReact||(S.parentReact=A),n.refs.topReact=A)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return this.payload===void 0&&this.getAttribute("hidden")==null}reify(){return I(this,null,function*(){this.payload!==void 0?this.render():this.isReadyToLoad()&&(this.payload=null,this.load().then(this.onLoad))})}load(){return Promise.resolve(null)}render(e=!1){var E,S,F;if(console.log("FEAAS: React",this.tagName,this.payload),this.payload==null)return;let{React:n,ReactDOM:A}=this.payload||{};if(!n)throw new Error(`${this.tagName}: React is not present in payload`);if(!A)throw new Error(`${this.tagName}: ReactDOM is not present in payload`);!this.refs.topReact&&!this.forceUpdateReact?A.render(n.createElement(this.getReactWrapper()),this.getReactRoot()):this.forceUpdateReact?(E=this.forceUpdateReact)==null||E.call(this):(F=(S=this.refs.topReact).forceUpdateReact)==null||F.call(S)}invokeReactRendering(){let{React:e,ReactDOM:n}=this.payload||{},A=this.descendants.filter(E=>E.refs.parentReact==this&&E.payload).map((E,S)=>e.createElement(this.getReactWrapper(E),{key:this.tagName+"-"+S,slot:E.getAttribute("slot")}));return this.renderReact(Y(N({},this.props),{children:A}),this.payload)}getReactWrapper(e=this,n=e.tagName){let A=e.reactWrapper||(e.reactWrapper=E=>{if(e.renderReact){let{React:S,ReactDOM:F}=e.payload||{},[P,C]=S.useReducer(R=>R+1,0);return e.forceUpdateReact=C,F.createPortal(S.createElement(S.Fragment,null,e.invokeReactRendering()),e.getReactRoot())}else return e.render()});return Object.assign(A,{displayName:n}),A}getUID(){return this.uid||(this.uid=String(Math.random()))}getReactRoot(){return this.getRoot()}set(e){this.overrides=N(N({},this.overrides),e),this.props=N(N({},this.getProps()),this.overrides);for(var n in this.props){let A=this.props[n];this.props[n]==null?this.removeAttribute(n):(typeof A=="string"||typeof A=="number")&&this.getAttribute(n)!=String(A)&&this.setAttribute(n,String(A))}this.scheduleRender()}scheduleRender(){cancelAnimationFrame(this.nextRender),this.nextRender=requestAnimationFrame(()=>{this.reify()})}formatURL(e,n){return typeof e=="string"&&e.match(/\/[^\/]/)?n+e:e}getContextAttribute(e,n=this){var A,E;return(E=(A=n.closest(`[${e}]`))==null?void 0:A.getAttribute(e))!=null?E:this.getAttribute(e)}static register(e){window.customElements.get(e)||window.customElements.define(e,this)}};function Ee(t=this){return{hidden:(t==null?void 0:t.getAttribute("hidden"))!=null}}var ut=class extends O{attributeChangedCallback(e,n,A){e=="hidden"&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),A?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all"))}connectedCallback(){this.attributeChangedCallback("hidden",this.getAttribute("hidden"),this.getAttribute("hidden")),this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
1
+ var Y=Object.defineProperty,Mt=Object.defineProperties,Dt=Object.getOwnPropertyDescriptor,Lt=Object.getOwnPropertyDescriptors,_t=Object.getOwnPropertyNames,pt=Object.getOwnPropertySymbols;var ht=Object.prototype.hasOwnProperty,Ot=Object.prototype.propertyIsEnumerable;var lt=(t,r,e)=>r in t?Y(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,F=(t,r)=>{for(var e in r||(r={}))ht.call(r,e)&&lt(t,e,r[e]);if(pt)for(var e of pt(r))Ot.call(r,e)&&lt(t,e,r[e]);return t},L=(t,r)=>Mt(t,Lt(r));var Ht=(t,r)=>{for(var e in r)Y(t,e,{get:r[e],enumerable:!0})},Bt=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of _t(r))!ht.call(t,o)&&o!==e&&Y(t,o,{get:()=>r[o],enumerable:!(n=Dt(r,o))||n.enumerable});return t};var It=t=>Bt(Y({},"__esModule",{value:!0}),t);var v=(t,r,e)=>new Promise((n,o)=>{var s=u=>{try{a(e.next(u))}catch(l){o(l)}},i=u=>{try{a(e.throw(u))}catch(l){o(l)}},a=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,i);a((e=e.apply(t,r)).next())});var oe={};Ht(oe,{FEAASComponent:()=>q,FEAASComponentsProps:()=>Rt,FEAASContext:()=>V,FEAASContextProps:()=>kt,FEAASEditor:()=>rt,FEAASEditorProps:()=>Ct,FEAASLoader:()=>J,FEAASLoaderProps:()=>ne,FEAASPicker:()=>nt,FEAASPickerLazy:()=>ot,FEAASPickerLazyProps:()=>Tt,FEAASPickerProps:()=>xt,FEAASStylesheet:()=>et,FEAASStylesheetProps:()=>Pt,autoloadScripts:()=>vt,cleanCollectionBit:()=>gt,fetchAndRevalidate:()=>G,getFramePosition:()=>wt,loadScript:()=>tt,normalizeCollectionScope:()=>mt,observeDOMElement:()=>Et,queryScopes:()=>ct,renderComponent:()=>re,renderComponentElement:()=>Zt,renderComponentPromise:()=>Ft,renderDOMContent:()=>U,renderDOMElement:()=>_,renderStylesheet:()=>ee,renderStylesheetPromise:()=>St,setDOMAttribute:()=>I});module.exports=It(oe);function P(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?P=function(r){return typeof r}:P=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},P(t)}function $t(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function Nt(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&z(t,r)}function W(t){return W=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},W(t)}function z(t,r){return z=Object.setPrototypeOf||function(n,o){return n.__proto__=o,n},z(t,r)}function ft(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function j(t,r,e){return ft()?j=Reflect.construct:j=function(o,s,i){var a=[null];a.push.apply(a,s);var u=Function.bind.apply(o,a),l=new u;return i&&z(l,i.prototype),l},j.apply(null,arguments)}function jt(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function at(t){var r=typeof Map=="function"?new Map:void 0;return at=function(n){if(n===null||!jt(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r!="undefined"){if(r.has(n))return r.get(n);r.set(n,o)}function o(){return j(n,arguments,W(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),z(o,n)},at(t)}function Wt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function zt(t,r){return r&&(typeof r=="object"||typeof r=="function")?r:Wt(t)}function Ut(t){var r=ft();return function(){var n=W(t),o;if(r){var s=W(this).constructor;o=Reflect.construct(n,arguments,s)}else o=n.apply(this,arguments);return zt(this,o)}}function dt(t){return Jt(t)||qt(t)||yt(t)||Vt()}function Jt(t){if(Array.isArray(t))return ut(t)}function qt(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function yt(t,r){if(!!t){if(typeof t=="string")return ut(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return ut(t,r)}}function ut(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function Vt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xt(t,r){var e=typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=yt(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,i=!1,a;return{s:function(){e=e.call(t)},n:function(){var u=e.next();return s=u.done,u},e:function(u){i=!0,a=u},f:function(){try{!s&&e.return!=null&&e.return()}finally{if(i)throw a}}}}var A=Object.prototype.hasOwnProperty;function N(t,r){return t=t.slice(),t.push(r),t}function B(t,r){return r=r.slice(),r.unshift(t),r}var Kt=function(t){Nt(e,t);var r=Ut(e);function e(n){var o;return $t(this,e),o=r.call(this,'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),o.avoidNew=!0,o.value=n,o.name="NewError",o}return e}(at(Error));function d(t,r,e,n,o){if(!(this instanceof d))try{return new d(t,r,e,n,o)}catch(u){if(!u.avoidNew)throw u;return u.value}typeof t=="string"&&(o=n,n=e,e=r,r=t,t=null);var s=t&&P(t)==="object";if(t=t||{},this.json=t.json||e,this.path=t.path||r,this.resultType=t.resultType||"value",this.flatten=t.flatten||!1,this.wrap=A.call(t,"wrap")?t.wrap:!0,this.sandbox=t.sandbox||{},this.preventEval=t.preventEval||!1,this.parent=t.parent||null,this.parentProperty=t.parentProperty||null,this.callback=t.callback||n||null,this.otherTypeCallback=t.otherTypeCallback||o||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},t.autostart!==!1){var i={path:s?t.path:r};s?"json"in t&&(i.json=t.json):i.json=e;var a=this.evaluate(i);if(!a||P(a)!=="object")throw new Kt(a);return a}}d.prototype.evaluate=function(t,r,e,n){var o=this,s=this.parent,i=this.parentProperty,a=this.flatten,u=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,e=e||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,r=r||this.json,t=t||this.path,t&&P(t)==="object"&&!Array.isArray(t)){if(!t.path&&t.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!A.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var l=t;r=l.json,a=A.call(t,"flatten")?t.flatten:a,this.currResultType=A.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=A.call(t,"sandbox")?t.sandbox:this.currSandbox,u=A.call(t,"wrap")?t.wrap:u,this.currPreventEval=A.call(t,"preventEval")?t.preventEval:this.currPreventEval,e=A.call(t,"callback")?t.callback:e,this.currOtherTypeCallback=A.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,s=A.call(t,"parent")?t.parent:s,i=A.call(t,"parentProperty")?t.parentProperty:i,t=t.path}if(s=s||null,i=i||null,Array.isArray(t)&&(t=d.toPathString(t)),!(!t&&t!==""||!r)){var c=d.toPathArray(t);c[0]==="$"&&c.length>1&&c.shift(),this._hasParentSelector=null;var p=this._trace(c,r,["$"],s,i,e).filter(function(h){return h&&!h.isParentSelector});return p.length?!u&&p.length===1&&!p[0].hasArrExpr?this._getPreferredOutput(p[0]):p.reduce(function(h,y){var f=o._getPreferredOutput(y);return a&&Array.isArray(f)?h=h.concat(f):h.push(f),h},[]):u?[]:void 0}};d.prototype._getPreferredOutput=function(t){var r=this.currResultType;switch(r){case"all":{var e=Array.isArray(t.path)?t.path:d.toPathArray(t.path);return t.pointer=d.toPointer(e),t.path=typeof t.path=="string"?t.path:d.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[r];case"path":return d.toPathString(t[r]);case"pointer":return d.toPointer(t.path);default:throw new TypeError("Unknown result type")}};d.prototype._handleCallback=function(t,r,e){if(r){var n=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:d.toPathString(t.path),r(n,e,t)}};d.prototype._trace=function(t,r,e,n,o,s,i,a){var u=this,l;if(!t.length)return l={path:e,value:r,parent:n,parentProperty:o,hasArrExpr:i},this._handleCallback(l,s,"value"),l;var c=t[0],p=t.slice(1),h=[];function y(b){Array.isArray(b)?b.forEach(function(R){h.push(R)}):h.push(b)}if((typeof c!="string"||a)&&r&&A.call(r,c))y(this._trace(p,r[c],N(e,c),r,c,s,i));else if(c==="*")this._walk(c,p,r,e,n,o,s,function(b,R,M,E,k,D,S,w){y(u._trace(B(b,M),E,k,D,S,w,!0,!0))});else if(c==="..")y(this._trace(p,r,e,n,o,s,i)),this._walk(c,p,r,e,n,o,s,function(b,R,M,E,k,D,S,w){P(E[b])==="object"&&y(u._trace(B(R,M),E[b],N(k,b),E,b,w,!0))});else{if(c==="^")return this._hasParentSelector=!0,{path:e.slice(0,-1),expr:p,isParentSelector:!0};if(c==="~")return l={path:N(e,c),value:o,parent:n,parentProperty:null},this._handleCallback(l,s,"property"),l;if(c==="$")y(this._trace(p,r,e,null,null,s,i));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(c))y(this._slice(c,p,r,e,n,o,s));else if(c.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");this._walk(c,p,r,e,n,o,s,function(b,R,M,E,k,D,S,w){u._eval(R.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1"),E[b],b,k,D,S)&&y(u._trace(B(b,M),E,k,D,S,w,!0))})}else if(c[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");y(this._trace(B(this._eval(c,r,e[e.length-1],e.slice(0,-1),n,o),p),r,e,n,o,s,i))}else if(c[0]==="@"){var f=!1,C=c.slice(1,-2);switch(C){case"scalar":(!r||!["object","function"].includes(P(r)))&&(f=!0);break;case"boolean":case"string":case"undefined":case"function":P(r)===C&&(f=!0);break;case"integer":Number.isFinite(r)&&!(r%1)&&(f=!0);break;case"number":Number.isFinite(r)&&(f=!0);break;case"nonFinite":typeof r=="number"&&!Number.isFinite(r)&&(f=!0);break;case"object":r&&P(r)===C&&(f=!0);break;case"array":Array.isArray(r)&&(f=!0);break;case"other":f=this.currOtherTypeCallback(r,e,n,o);break;case"null":r===null&&(f=!0);break;default:throw new TypeError("Unknown value type "+C)}if(f)return l={path:e,value:r,parent:n,parentProperty:o},this._handleCallback(l,s,"value"),l}else if(c[0]==="`"&&r&&A.call(r,c.slice(1))){var X=c.slice(1);y(this._trace(p,r[X],N(e,X),r,X,s,i,!0))}else if(c.includes(",")){var st=c.split(","),O=Xt(st),K;try{for(O.s();!(K=O.n()).done;){var $=K.value;y(this._trace(B($,p),r,e,n,o,s,!0))}}catch(b){O.e(b)}finally{O.f()}}else!a&&r&&A.call(r,c)&&y(this._trace(p,r[c],N(e,c),r,c,s,i,!0))}if(this._hasParentSelector)for(var g=0;g<h.length;g++){var H=h[g];if(H&&H.isParentSelector){var x=this._trace(H.expr,r,H.path,n,o,s,i);if(Array.isArray(x)){h[g]=x[0];for(var it=x.length,T=1;T<it;T++)g++,h.splice(g,0,x[T])}else h[g]=x}}return h};d.prototype._walk=function(t,r,e,n,o,s,i,a){if(Array.isArray(e))for(var u=e.length,l=0;l<u;l++)a(l,t,r,e,n,o,s,i);else e&&P(e)==="object"&&Object.keys(e).forEach(function(c){a(c,t,r,e,n,o,s,i)})};d.prototype._slice=function(t,r,e,n,o,s,i){if(!!Array.isArray(e)){var a=e.length,u=t.split(":"),l=u[2]&&Number.parseInt(u[2])||1,c=u[0]&&Number.parseInt(u[0])||0,p=u[1]&&Number.parseInt(u[1])||a;c=c<0?Math.max(0,c+a):Math.min(a,c),p=p<0?Math.max(0,p+a):Math.min(a,p);for(var h=[],y=c;y<p;y+=l){var f=this._trace(B(y,r),e,n,o,s,i,!0);f.forEach(function(C){h.push(C)})}return h}};d.prototype._eval=function(t,r,e,n,o,s){t.includes("@parentProperty")&&(this.currSandbox._$_parentProperty=s,t=t.replace(/@parentProperty/g,"_$_parentProperty")),t.includes("@parent")&&(this.currSandbox._$_parent=o,t=t.replace(/@parent/g,"_$_parent")),t.includes("@property")&&(this.currSandbox._$_property=e,t=t.replace(/@property/g,"_$_property")),t.includes("@path")&&(this.currSandbox._$_path=d.toPathString(n.concat([e])),t=t.replace(/@path/g,"_$_path")),t.includes("@root")&&(this.currSandbox._$_root=this.json,t=t.replace(/@root/g,"_$_root")),/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/.test(t)&&(this.currSandbox._$_v=r,t=t.replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1"));try{return this.vm.runInNewContext(t,this.currSandbox)}catch(i){throw console.log(i),new Error("jsonPath: "+i.message+": "+t)}};d.cache={};d.toPathString=function(t){for(var r=t,e=r.length,n="$",o=1;o<e;o++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(r[o])||(n+=/^[\*0-9]+$/.test(r[o])?"["+r[o]+"]":"['"+r[o]+"']");return n};d.toPointer=function(t){for(var r=t,e=r.length,n="",o=1;o<e;o++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(r[o])||(n+="/"+r[o].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};d.toPathArray=function(t){var r=d.cache;if(r[t])return r[t].concat();var e=[],n=t.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,function(s,i){return"[#"+(e.push(i)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(s,i){return"['"+i.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(s,i){return";"+i.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),o=n.split(";").map(function(s){var i=s.match(/#([0-9]+)/);return!i||!i[1]?s:e[i[1]]});return r[t]=o,r[t].concat()};var Yt=function(r,e,n){for(var o=r.length,s=0;s<o;s++){var i=r[s];n(i)&&e.push(r.splice(s--,1)[0])}};d.prototype.vm={runInNewContext:function(r,e){var n=Object.keys(e),o=[];Yt(n,o,function(l){return typeof e[l]=="function"});var s=n.map(function(l,c){return e[l]}),i=o.reduce(function(l,c){var p=e[c].toString();return/function/.test(p)||(p="function "+p),"var "+c+"="+p+";"+l},"");r=i+r,!/(["'])use strict\1/.test(r)&&!n.includes("arguments")&&(r="var arguments = undefined;"+r),r=r.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"");var a=r.lastIndexOf(";"),u=a>-1?r.slice(0,a+1)+" return "+r.slice(a+1):" return "+r;return j(Function,dt(n).concat([u])).apply(void 0,dt(s))}};function G(t,r,e,n){return v(this,null,function*(){let o=new Date,s=yield fetch(t,r);if(!s.ok)throw new Error("Fetch failed");let i=new Date(s.headers.get("date"));var a=s;if(n(s,"cached"),i<o){let u=yield fetch(t+"?"+Math.random(),L(F({},r),{method:"HEAD",cache:"no-cache"}));if(u.headers.get("last-modified")!=s.headers.get("last-modified")){if(e(u)===!1)throw new Error("Response is stale");a=yield fetch(t,L(F({},r),{cache:"reload"}))}}if(e(a)===!1)throw new Error("Response is not valid");return s!==a&&n(a,"valid"),a})}function Gt({cdn:t="https://feaascomponentsapidev.blob.core.windows.net",hostname:r,library:e,component:n,version:o,revision:s="published"}){return`${t||r}/components/${e}/${n}/${o}/${s}.html`}function Qt({cdn:t="https://feaascomponentsapidev.blob.core.windows.net",hostname:r,library:e,revision:n="published"}){return`${t||r}/styles/${e}/${n}.css`}function Q(t,r){return v(this,null,function*(){return G(Gt(t),{},e=>e.headers.get("x-ms-meta-versionDeletedAt")==null,e=>{e.text().then(r)})})}function Z(t,r){return v(this,null,function*(){return G(Qt(t),{},e=>e.headers.get("x-ms-meta-deletedAt")==null,e=>{e.text().then(r)})})}function Zt(t,r){let e=document.createElement("div");e.innerHTML=t;let n=document.createDocumentFragment();for(;e.firstChild;)n.appendChild(e.firstChild);return _(n,r),e}function gt(t){return t.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function mt(t){return gt(t)+".*"}function At(t){let r=t.getAttribute("data-path-scope");for(var e=0,n=t;n=n.previousElementSibling;)n.getAttribute("data-path-scope")==r&&e++;return e}function te(t,r,e){let n=t.getAttribute("data-path-scope");if(n==null)return;var o=At(t);if(o!=0)return;let s=t.parentElement;if(s!=null){r==0?t.style.display="none":t.style.display&&(t.style.display="",t.getAttribute("style")==""&&t.removeAttribute("style"));for(var i=o+1,a=t,u=t;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(i++,a=u);for(var l=i;l<r;l++)s.insertBefore(a.cloneNode(!0),a.nextElementSibling);for(var l=Math.max(1,r);l<i;l++)a=a.previousElementSibling,s.removeChild(a.nextElementSibling)}}function ct(t,r,e=!1,n=t){var o=r;let s=Object.keys(t).sort((a,u)=>u.length-a.length);for(let a of s)if(r.startsWith(a)){if(a==r){if(e)return t[a];continue}o=r.substring(a.length+1),n=t[a];break}let i=d({path:o,json:n});return e&&i&&Array.isArray(i)?i[0]:i}function I(t,r,e,n){var c;if(!!t){var o=t;n!=null&&n.processValue&&(e=n==null?void 0:n.processValue(t,r,e));var s=r.replace("data-path-","");if(r=="data-path-src")o=t.tagName=="IMG"?t:t.querySelector("img, video");else if(r=="data-path-href")o=t.querySelector("a")||t.closest("a");else if(r=="data-path-alt")o=t.querySelector("img, picture");else if(r=="data-path-hidden")e=e?null:!0;else if(r=="data-path"||r=="data-embed-html"||r=="html")s="innerHTML";else if(r=="data-embed-src")tt(t,e);else if(r=="data-path-attributes"){let p=((c=t.getAttribute("data-attributes-keys"))==null?void 0:c.split(",").filter(Boolean))||[];for(var i in e){var a=e[i];I(t,i,typeof a=="object"&&a?JSON.stringify(a):a,n)}for(var u=0;u<p.length;u++)(e==null||!(p[u]in e))&&I(t,p[u],null,n);I(t,"data-attributes-keys",Object.keys(e||{}).join(","));return}if(typeof e=="boolean"&&(e=e?"":null),!!o){var l=String(t.getAttribute("data-path-placeholder")||o[s]);e!=null?s=="innerHTML"?o.innerHTML!=e&&(o.innerHTML=e):o.getAttribute(s)!=e&&o.setAttribute(s,e):s=="innerHTML"?o.innerHTML=l:o.removeAttribute(s)}}}function Et(t){let r=new t.ownerDocument.defaultView.MutationObserver(e=>{e.forEach(n=>{let o=n.target,s=o.getAttribute("data-embed-src");s&&tt(o,s),n.addedNodes&&n.addedNodes.forEach(i=>{i.nodeType==1&&vt(i,!1)})})});return r.observe(t,{attributes:!0,subtree:!0,childList:!0}),r}function vt(t,r=!0){let e=t.querySelectorAll("[data-embed-src]");for(var n=0;n<e.length;n++){let o=e[n];tt(o,o.getAttribute("data-embed-src"))}if(r)return Et(t)}function tt(t,r){for(var e=t;e;e=e.parentElement)if(!e.parentElement){let o=e.querySelectorAll("script");for(var n=0;n<o.length;n++)if(o[n].getAttribute("src")==r)return!0;e.tagName=="HTML"&&(e=e.querySelector("head")||e);let s=e.ownerDocument.createElement("script");s.type="module",s.src=r,e.appendChild(s);break}}var bt=["data-attributes-keys","data-path-attributes","data-path-scope"];function _(t,r,e,n){var i,a,u;let o=t;if(n||(r=((i=e==null?void 0:e.processData)==null?void 0:i.call(e,o,r))||r),o.nodeType==1){let l=o.getAttribute("data-path-scope");if(l){let p=At(o),h=ct(r,l,!1)||[];p==0&&te(o,((a=e==null?void 0:e.shouldRepeat)==null?void 0:a.call(e,o,h))===!1?1:h.length,e),r=L(F({},r),{[mt(l)]:h[p]})}let c=Array.prototype.slice.call(o.attributes).sort((p,h)=>bt.indexOf(p.name)-bt.indexOf(h.name));for(var s=0;s<c.length;s++){let{name:p,value:h}=c[s];p.startsWith("data-path")&&p!="data-path-scope"&&I(o,p,ct(r,h,!0),e),p=="data-embed-src"&&I(o,p,o.getAttribute(p),e)}}for(var s=0;s<o.children.length;s++)_(o.children[s],r,e,!0);return n||(u=e==null?void 0:e.onRender)==null||u.call(e,o,r),o}function U(t,r,e,n){var s;let o=((s=n==null?void 0:n.processTemplate)==null?void 0:s.call(n,t,r,e))||r;return t.innerHTML=o,t.classList.add("-feaas"),_(t,e,n)}function ee(t,r){return St(t,r||(r=document.createElement("style"))),r}function St(t,r){return r||(r=document.createElement("style")),Z(t,e=>{r.textContent=e}).then(()=>r)}function re(t,r){return Ft(t,r||(r=document.createElement("div"))),r}function Ft(t,r){return v(this,null,function*(){return r||(r=document.createElement("div")),r.childNodes.length?_(r,t.data,t):"template"in t?U(r,t.template,t.data,t):Q(t,e=>U(r,e,t.data,t)).then(()=>r)})}var m=class extends HTMLElement{constructor(){super(...arguments);this.connected=null;this.refs={};this.descendants=[];this.onLoad=e=>{e!=null&&(this.payload=e,this.render())}}getProps(e){return{}}getRoot(){return this}attributeChangedCallback(e,n,o){this.set()}connectedCallback(){console.log("FEAAS: Connected",this),this.connected=new Event("feaasConnected",{bubbles:!0,composed:!0}),this.dispatchEvent(this.connected),this.addEventListener("feaasConnected",this),this.addEventListener("feaasDisconnected",this),this.set()}disconnectedCallback(){console.log("FEAAS: Disconnected",this),this.removeEventListener("feaasConnected",this),this.removeEventListener("feaasDisconnected",this),this.dispatchEvent(new Event("feaasDisconnected",{bubbles:!0,composed:!0})),this.connected=null}handleEvent(e){switch(e.type){case"feaasConnected":this.adoptedCallback(e);break;case"feaasDisconnected":this.orphanCallback(e);break}}orphanCallback(e){let n=e.composedPath()[0],o=this.descendants.indexOf(n);o!=-1&&(console.log("FEAAS: Orphaning",this,n),this.descendants.splice(o,-1),this.refs[n.getComponentName()]=null,n.refs.parent==this&&(n.refs.parent=null),n.refs.top==this&&(n.refs.top=n.refs.parent))}adoptedCallback(e){var s,i;let n=e.composedPath()[0];if(this.descendants.push(n),console.log("FEAAS: Adopting",this,n),this.refs[n.getComponentName()]=n,n.refs.top=this,(s=n.refs).parent||(s.parent=this),n.renderReact)for(var o=n.refs.parent;o;o=o.refs.parent)o.renderReact&&((i=n.refs).parentReact||(i.parentReact=o),n.refs.topReact=o)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return this.payload===void 0&&this.getAttribute("hidden")==null}reify(){return v(this,null,function*(){this.payload!==void 0?this.render():this.isReadyToLoad()&&(this.payload=null,this.load().then(this.onLoad))})}load(){return Promise.resolve(null)}render(e=!1){var s,i,a;if(console.log("FEAAS: React",this.tagName,this.payload),this.payload==null)return;let{React:n,ReactDOM:o}=this.payload||{};if(!n)throw new Error(`${this.tagName}: React is not present in payload`);if(!o)throw new Error(`${this.tagName}: ReactDOM is not present in payload`);!this.refs.topReact&&!this.forceUpdateReact?o.render(n.createElement(this.getReactWrapper()),this.getReactRoot()):this.forceUpdateReact?(s=this.forceUpdateReact)==null||s.call(this):(a=(i=this.refs.topReact).forceUpdateReact)==null||a.call(i)}invokeReactRendering(){let{React:e,ReactDOM:n}=this.payload||{},o=this.descendants.filter(s=>s.refs.parentReact==this&&s.payload).map((s,i)=>e.createElement(this.getReactWrapper(s),{key:this.tagName+"-"+i,slot:s.getAttribute("slot")}));return this.renderReact(L(F({},this.props),{children:o}),this.payload)}getReactWrapper(e=this,n=e.tagName){let o=e.reactWrapper||(e.reactWrapper=s=>{if(e.renderReact){let{React:i,ReactDOM:a}=e.payload||{},[u,l]=i.useReducer(c=>c+1,0);return e.forceUpdateReact=l,a.createPortal(i.createElement(i.Fragment,null,e.invokeReactRendering()),e.getReactRoot())}else return e.render()});return Object.assign(o,{displayName:n}),o}getUID(){return this.uid||(this.uid=String(Math.random()))}getReactRoot(){return this.getRoot()}set(e){this.overrides=F(F({},this.overrides),e),this.props=F(F({},this.getProps()),this.overrides);for(var n in this.props){let o=this.props[n];this.props[n]==null?this.removeAttribute(n):(typeof o=="string"||typeof o=="number")&&this.getAttribute(n)!=String(o)&&this.setAttribute(n,String(o))}this.scheduleRender()}scheduleRender(){cancelAnimationFrame(this.nextRender),this.nextRender=requestAnimationFrame(()=>{this.reify()})}formatURL(e,n){return typeof e=="string"&&e.match(/\/[^\/]/)?n+e:e}getContextAttribute(e,n=this){var o,s;return(s=(o=n.closest(`[${e}]`))==null?void 0:o.getAttribute(e))!=null?s:this.getAttribute(e)}static register(e){window.customElements.get(e)||window.customElements.define(e,this)}};function ne(t=this){return{hidden:(t==null?void 0:t.getAttribute("hidden"))!=null}}var J=class extends m{attributeChangedCallback(e,n,o){e=="hidden"&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),o?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all"))}connectedCallback(){this.attributeChangedCallback("hidden",this.getAttribute("hidden"),this.getAttribute("hidden")),this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
4
4
  #loader {
5
5
  position: absolute;
6
6
  top: 0;
@@ -64,9 +64,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
64
64
  style="animation: 1.5s linear 0s infinite normal none running loader-circular-track"
65
65
  ></circle>
66
66
  </svg>
67
- </div>`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}};ut.observedAttributes=["hidden"];ut.register("feaas-loader");function jt(t=this){var r;return{library:t==null?void 0:t.getContextAttribute("library"),revision:(r=t==null?void 0:t.getAttribute("revision"))!=null?r:"published",cdn:t==null?void 0:t.getContextAttribute("cdn")}}var mt=class extends O{getProps(){return jt(this)}isReadyToLoad(){return this.props.library!=null&&this.props.revision!=null&&this.props.cdn!=null}load(){return I(this,null,function*(){bt(this.props,this.onLoad)})}render(){this.stylesheet||(this.stylesheet=document.createElement("style"),this.appendChild(this.stylesheet)),this.stylesheet.textContent=this.payload}};mt.register("feaas-stylesheet");function Wt(t=this){let r,e=t.getAttribute("data");if(e!=null)try{r=typeof e=="string"?JSON.parse(e):{}}catch(n){}return{data:r!=null?r:{},library:t.getAttribute("library"),component:t.getAttribute("component"),version:t.getAttribute("version"),revision:t.getAttribute("revision"),hostname:t.getAttribute("hostname"),cdn:t.getContextAttribute("cdn"),template:t.getAttribute("template")}}var ct=class extends O{setData(e){this.set({data:e})}getProps(){return Wt(this)}attributeChangedCallback(e,n,A){this.payload=void 0,this.needsRefresh=!0,super.attributeChangedCallback(e,n,A)}getOriginal(){let e=this.getAttribute("data-path-scope");if(!!e){for(var n=this;(n=n.previousElementSibling)&&n.getAttribute("data-path-scope")==e;)var A=n;return A}}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null&&this.props.component!=null&&this.props.version!=null}load(){return I(this,null,function*(){if(!this.getOriginal())try{yt(this.props,this.onLoad)}catch(e){console.error(`FEAAS: Could not fetch component: ${this.props.component}/${this.props.version}/${this.props.revision}`)}})}render(){if(Array.from(this.children).filter(e=>e.tagName!="BR").length>0&&!this.needsRefresh)G(this,this.props.data);else{if(this.needsRefresh=!0,this.getOriginal())return;at(this,this.payload,this.props.data)}}};ct.observedAttributes=["library","component","version","revision","hostname","cdn","template","data"];ct.register("feaas-component");function zt(t){let r=[];if(t){let e=t.ownerDocument.defaultView,n,A;for(;e!==window.top;){n=e.parent;for(let E=0;E<n.frames.length;E++)if(n.frames[E]===e){for(let S of n.document.getElementsByTagName("iframe"))if(S.contentWindow===e){A=S.getBoundingClientRect();let F=S.contentWindow.getComputedStyle(S);r.push({left:A.left+parseInt(F.borderLeftWidth),top:A.top+parseInt(F.borderTopWidth)})}e=n;break}}}return r.reduce((e,n)=>({left:e.left+n.left,top:e.top+n.top}),{left:0,top:0})}function Ut(t=this){var r;return{context:HTMLElement,frontend:t==null?void 0:t.getContextAttribute("frontend"),src:(r=t==null?void 0:t.getAttribute("src"))!=null?r:"/assets/editor.js",library:t==null?void 0:t.getAttribute("library"),component:t==null?void 0:t.getAttribute("component"),version:t==null?void 0:t.getAttribute("version"),revision:(t==null?void 0:t.getAttribute("revision"))||"saved",hidden:(t==null?void 0:t.getAttribute("hidden"))!=null,for:t==null?void 0:t.getAttribute("for")}}var At=class extends O{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.getTarget=()=>document.querySelector("iframe").contentWindow.document.getElementById(this.props.for);this.onChromeMeasureElement=(e,n)=>(n==null&&(n=e.getBoundingClientRect()),e.ownerDocument==document?{left:n.left-this.bodyRect.left,top:n.top-this.bodyRect.top,width:n.width,height:n.height}:{left:n.left+this.framePoint.left-this.bodyRect.left,top:n.top+this.framePoint.top-this.bodyRect.top,width:n.width,height:n.height});this.onBeforeMeasure=e=>{e.memoized.focusable&&(this.framePoint=zt(e.memoized.focusable)),this.wrapperRect=this.wrapper.getBoundingClientRect(),this.bodyRect=this.wrapper.ownerDocument.body.parentElement.getBoundingClientRect()};this.onMeasure=()=>{};this.onPosition=({focusable:e,root:n})=>{let A=this.wrapper.querySelector(".editor-chrome"),E=this.wrapper.querySelector(".ui.overlays");e?(A.style.width=e.width+16*2+"px",A.style.height=e.height+16*1+64+"px",A.style.left=e.left-16+"px",A.style.top=e.top-64+"px",E&&(E.style.left=n.left+"px",E.style.top=n.top+"px")):(A.style.left="-1000px",A.style.top="-1000px")}}getProps(){return Ut(this)}load(){return import(this.formatURL(this.props.src,this.props.frontend))}renderReact({children:e,component:n,version:A},{Editor:E,VersionStatusList:S,Version:F,EditorUIUndo:P,EditorUIMode:C,React:{useEffect:R,useMemo:w,useState:x},Chakra:{HStack:D,Box:M},Chrome:U,ReactDOM:lt,useSDK:St,useSlots:Q,useModelObserver:ht}){if(!this.payload)return;let{sdk:rt}=St(),[_,Z]=x(),J=rt.library;R(()=>Z(J.components.getItem(n)),[n,J]),R(()=>{_==null||_.versions.fetch()},[_]);let Ft=w(this.getTarget,[this.props.for]),q=ht(_==null?void 0:_.versions),L=w(()=>(q==null?void 0:q.filter(W=>W.id==A||!A))||[],[q]);if(!!_)return Q(e,({picker:W,children:X})=><M ref={B=>this.wrapper=B}><M className="editor-wrapper"position="absolute"left={0}top={0}><E sdk={rt}library={rt.library}component={_}versions={L}context={{onChromeMeasure:this.onMeasure,onChromeBeforeMeasure:this.onBeforeMeasure,onChromeMeasureElement:this.onChromeMeasureElement,onChromePosition:this.onPosition}}>{({editor:B,status:V,isArchivedDisplayed:K})=>({after:X,picker:W,chrome:B&&<U/>,children:_.reduceVersionRevisions(L).filter($=>{var z;return K||!((z=$.saved||$.draft)!=null&&z.deletedAt)}).map(($,z)=><M key={$.head.id}position="absolute"left={0}top={0}className="editor-chrome"p={4}boxShadow="2xl"pointerEvents="none"><M className="borders"pointerEvents="none"left={0}width="4"top={0}bottom={0}backdropFilter="blur(2px)"background="rgb(244 244 244 / 80%)"position="absolute"/><M className="borders"pointerEvents="none"right={0}width="4"top={0}bottom={0}backdropFilter="blur(2px)"background="rgb(244 244 244 / 80%)"position="absolute"/><M className="borders"pointerEvents="none"top={0}height="16"left={0}right={0}backdropFilter="blur(2px)"background="rgb(244 244 244 / 80%)"position="absolute"/><M className="borders"pointerEvents="none"bottom={0}height="4"left={0}right={0}backdropFilter="blur(2px)"background="rgb(244 244 244 / 80%)"position="absolute"/><F version={$.head}node={Ft}>{{left:<D justifyContent="space-between"><P size="sm"editor={V=="ready"?B:null}/><C size="sm"/></D>,middle:<S/>}}</F></M>)})}</E></M></M>)}isReadyToLoad(){return this.props.component!=null&&this.props.version!=null}};At.register("feaas-editor");function Jt(t=this){var r,e;return{part:(t==null?void 0:t.getAttribute("part"))||"picker",slot:(t==null?void 0:t.getAttribute("part"))||"slot",mode:t==null?void 0:t.getAttribute("mode"),frontend:(r=t==null?void 0:t.getContextAttribute("frontend"))!=null?r:"https://components.sitecorecloud.io",src:(e=t==null?void 0:t.getAttribute("src"))!=null?e:"/assets/picker.js",hidden:(t==null?void 0:t.getAttribute("hidden"))!=null,context:void 0,onClose:void 0}}var Et=class extends O{getProps(){return Jt(this)}load(){return import(this.formatURL(this.props.src,this.props.frontend))}renderReact({context:r,mode:e,children:n},{Picker:A,React:E,ReactDOM:S}){return<A mode={e||void 0}onClose={this.props.onClose}context={r}>{n}</A>}};Et.register("feaas-picker");function qt(t=this){var r,e;return{library:(t==null?void 0:t.getAttribute("library"))||"library",mode:t==null?void 0:t.getAttribute("mode"),frontend:(r=t==null?void 0:t.getContextAttribute("frontend"))!=null?r:"https://components.sitecorecloud.io",src:(e=t==null?void 0:t.getAttribute("src"))!=null?e:"/assets/picker.js",hidden:(t==null?void 0:t.getAttribute("hidden"))!=null,context:null,getToken:null}}var vt=class extends O{constructor(){super(...arguments);this.payload=null;this.onClose=()=>{this.setAttribute("hidden","hidden")}}getProps(){return qt(this)}render(){let{frontend:e,library:n,getToken:A,src:E,mode:S,context:F}=this.props;this.children.length==0&&(this.innerHTML=`
67
+ </div>`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}};J.observedAttributes=["hidden"];J.register("feaas-loader");function Pt(t=this){var r;return{library:t==null?void 0:t.getContextAttribute("library"),revision:(r=t==null?void 0:t.getAttribute("revision"))!=null?r:"published",cdn:t==null?void 0:t.getContextAttribute("cdn")}}var et=class extends m{getProps(){return Pt(this)}isReadyToLoad(){return this.props.library!=null&&this.props.revision!=null&&this.props.cdn!=null}load(){return v(this,null,function*(){Z(this.props,this.onLoad)})}render(){this.stylesheet||(this.stylesheet=document.createElement("style"),this.appendChild(this.stylesheet)),this.stylesheet.textContent=this.payload}};et.register("feaas-stylesheet");function Rt(t=this){let r,e=t.getAttribute("data");if(e!=null)try{r=typeof e=="string"?JSON.parse(e):{}}catch(n){}return{data:r!=null?r:{},library:t.getAttribute("library"),component:t.getAttribute("component"),version:t.getAttribute("version"),revision:t.getAttribute("revision"),hostname:t.getAttribute("hostname"),cdn:t.getContextAttribute("cdn"),template:t.getAttribute("template")}}var q=class extends m{setData(e){this.set({data:e})}getProps(){return Rt(this)}attributeChangedCallback(e,n,o){this.payload=void 0,this.needsRefresh=!0,super.attributeChangedCallback(e,n,o)}getOriginal(){let e=this.getAttribute("data-path-scope");if(!!e){for(var n=this;(n=n.previousElementSibling)&&n.getAttribute("data-path-scope")==e;)var o=n;return o}}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null&&this.props.component!=null&&this.props.version!=null}load(){return v(this,null,function*(){if(!this.getOriginal())try{Q(this.props,this.onLoad)}catch(e){console.error(`FEAAS: Could not fetch component: ${this.props.component}/${this.props.version}/${this.props.revision}`)}})}render(){if(Array.from(this.children).filter(e=>e.tagName!="BR").length>0&&!this.needsRefresh)_(this,this.props.data);else{if(this.needsRefresh=!0,this.getOriginal())return;U(this,this.payload,this.props.data)}}};q.observedAttributes=["library","component","version","revision","hostname","cdn","template","data"];q.register("feaas-component");function wt(t){let r=[];if(t){let e=t.ownerDocument.defaultView,n,o;for(;e!==window.top;){n=e.parent;for(let s=0;s<n.frames.length;s++)if(n.frames[s]===e){for(let i of n.document.getElementsByTagName("iframe"))if(i.contentWindow===e){o=i.getBoundingClientRect();let a=i.contentWindow.getComputedStyle(i);r.push({left:o.left+parseInt(a.borderLeftWidth),top:o.top+parseInt(a.borderTopWidth)})}e=n;break}}}return r.reduce((e,n)=>({left:e.left+n.left,top:e.top+n.top}),{left:0,top:0})}function Ct(t=this){var r;return{context:HTMLElement,frontend:t==null?void 0:t.getContextAttribute("frontend"),src:(r=t==null?void 0:t.getAttribute("src"))!=null?r:"/assets/editor.js",library:t==null?void 0:t.getAttribute("library"),component:t==null?void 0:t.getAttribute("component"),version:t==null?void 0:t.getAttribute("version"),revision:(t==null?void 0:t.getAttribute("revision"))||"saved",hidden:(t==null?void 0:t.getAttribute("hidden"))!=null,for:t==null?void 0:t.getAttribute("for")}}var rt=class extends m{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.getTarget=()=>document.querySelector("iframe").contentWindow.document.getElementById(this.props.for);this.onChromeMeasureElement=(e,n)=>(n==null&&(n=e.getBoundingClientRect()),e.ownerDocument==document?{left:n.left-this.bodyRect.left,top:n.top-this.bodyRect.top,width:n.width,height:n.height}:{left:n.left+this.framePoint.left-this.bodyRect.left,top:n.top+this.framePoint.top-this.bodyRect.top,width:n.width,height:n.height});this.onBeforeMeasure=e=>{e.memoized.focusable&&(this.framePoint=wt(e.memoized.focusable)),this.wrapperRect=this.wrapper.getBoundingClientRect(),this.bodyRect=this.wrapper.ownerDocument.body.parentElement.getBoundingClientRect()};this.onMeasure=()=>{};this.onPosition=({focusable:e,root:n})=>{let o=this.wrapper.querySelector(".editor-chrome"),s=this.wrapper.querySelector(".ui.overlays");e?(o.style.width=e.width+16*2+"px",o.style.height=e.height+16*1+64+"px",o.style.left=e.left-16+"px",o.style.top=e.top-64+"px",s&&(s.style.left=n.left+"px",s.style.top=n.top+"px")):(o.style.left="-1000px",o.style.top="-1000px")}}getProps(){return Ct(this)}load(){return import(this.formatURL(this.props.src,this.props.frontend))}renderReact({children:e,component:n,version:o},{Editor:s,VersionStatusList:i,Version:a,EditorUIUndo:u,EditorUIMode:l,React:{useEffect:c,useMemo:p,useState:h},Chakra:{HStack:y,Box:f},Chrome:C,ReactDOM:X,useSDK:st,useSlots:O,useModelObserver:K}){if(!this.payload)return;let{sdk:$}=st(),[g,H]=h(),x=$.library;c(()=>H(x.components.getItem(n)),[n,x]),c(()=>{g==null||g.versions.fetch()},[g]);let it=p(this.getTarget,[this.props.for]),T=K(g==null?void 0:g.versions),b=p(()=>(T==null?void 0:T.filter(R=>R.id==o||!o))||[],[T]);if(!!g)return O(e,({picker:R,children:M})=>React.createElement(f,{ref:E=>this.wrapper=E},React.createElement(f,{className:"editor-wrapper",position:"absolute",left:0,top:0},React.createElement(s,{sdk:$,library:$.library,component:g,versions:b,context:{onChromeMeasure:this.onMeasure,onChromeBeforeMeasure:this.onBeforeMeasure,onChromeMeasureElement:this.onChromeMeasureElement,onChromePosition:this.onPosition}},({editor:E,status:k,isArchivedDisplayed:D})=>({after:M,picker:R,chrome:E&&React.createElement(C,null),children:g.reduceVersionRevisions(b).filter(S=>{var w;return D||!((w=S.saved||S.draft)!=null&&w.deletedAt)}).map((S,w)=>React.createElement(f,{key:S.head.id,position:"absolute",left:0,top:0,className:"editor-chrome",p:4,boxShadow:"2xl",pointerEvents:"none"},React.createElement(f,{className:"borders",pointerEvents:"none",left:0,width:"4",top:0,bottom:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),React.createElement(f,{className:"borders",pointerEvents:"none",right:0,width:"4",top:0,bottom:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),React.createElement(f,{className:"borders",pointerEvents:"none",top:0,height:"16",left:0,right:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),React.createElement(f,{className:"borders",pointerEvents:"none",bottom:0,height:"4",left:0,right:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),React.createElement(a,{version:S.head,node:it},{left:React.createElement(y,{justifyContent:"space-between"},React.createElement(u,{size:"sm",editor:k=="ready"?E:null}),React.createElement(l,{size:"sm"})),middle:React.createElement(i,null)})))})))))}isReadyToLoad(){return this.props.component!=null&&this.props.version!=null}};rt.register("feaas-editor");function xt(t=this){var r,e;return{part:(t==null?void 0:t.getAttribute("part"))||"picker",slot:(t==null?void 0:t.getAttribute("part"))||"slot",mode:t==null?void 0:t.getAttribute("mode"),frontend:(r=t==null?void 0:t.getContextAttribute("frontend"))!=null?r:"https://components.sitecorecloud.io",src:(e=t==null?void 0:t.getAttribute("src"))!=null?e:"/assets/picker.js",hidden:(t==null?void 0:t.getAttribute("hidden"))!=null,context:void 0,onClose:void 0}}var nt=class extends m{getProps(){return xt(this)}load(){return import(this.formatURL(this.props.src,this.props.frontend))}renderReact({context:r,mode:e,children:n},{Picker:o,React:s,ReactDOM:i}){return s.createElement(o,{mode:e||void 0,onClose:this.props.onClose,context:r},n)}};nt.register("feaas-picker");function Tt(t=this){var r,e;return{library:(t==null?void 0:t.getAttribute("library"))||"library",mode:t==null?void 0:t.getAttribute("mode"),frontend:(r=t==null?void 0:t.getContextAttribute("frontend"))!=null?r:"https://components.sitecorecloud.io",src:(e=t==null?void 0:t.getAttribute("src"))!=null?e:"/assets/picker.js",hidden:(t==null?void 0:t.getAttribute("hidden"))!=null,context:null,getToken:null}}var ot=class extends m{constructor(){super(...arguments);this.payload=null;this.onClose=()=>{this.setAttribute("hidden","hidden")}}getProps(){return Tt(this)}render(){let{frontend:e,library:n,getToken:o,src:s,mode:i,context:a}=this.props;this.children.length==0&&(this.innerHTML=`
68
68
  <feaas-context src='/components/providers/ContextProvider.tsx' library='${n}'>
69
- <feaas-picker mode='${S}'>
69
+ <feaas-picker mode='${i}'>
70
70
  <feaas-loader />
71
71
  </feaas-context>
72
- `),this.refs.context.set({frontend:e,library:n,getToken:A}),this.refs.picker.set({frontend:e,context:F,src:E,mode:S,onClose:this.onClose})}};vt.register("feaas-picker-lazy");function Vt(t=this){var r,e,n,A;return{library:t==null?void 0:t.getAttribute("library"),src:(r=t==null?void 0:t.getAttribute("src"))!=null?r:"/assets/context.js",frontend:(e=t==null?void 0:t.getAttribute("frontend"))!=null?e:"https://components.sitecoreclud.io",backend:(n=t==null?void 0:t.getAttribute("backend"))!=null?n:"https://components-api.sitecoreclud.io",cdn:(A=t==null?void 0:t.getAttribute("cdn"))!=null?A:"https://feaascompontsapiprod.blob.core.windows.net",getToken:null}}var pt=class extends O{getProps(){return Vt(this)}load(){return import(this.formatURL(this.props.src,this.props.frontend))}getTheme(e){return e}getRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}getReactRoot(){return this.reactRoot||(this.reactRoot=document.createElement("div"),this.getRoot().appendChild(this.reactRoot)),this.reactRoot}adoptedCallback(e){super.adoptedCallback(e);let n=e.composedPath()[0];n.parentNode!=this.getRoot()&&this.getRoot().appendChild(n)}renderReact({children:e,library:n},{AppContext:A,Chakra:{Button:E,Tooltip:S},React:{useRef:F}}){return S.defaultProps={hasArrow:!0,placement:"top",portalProps:{containerRef:{current:this.getRoot()}}},<A libraryId={this.props.library}container={this.getRoot()}getTheme={this.getTheme}modalProps={{portalProps:{containerRef:{current:this.getRoot()}}}}chakraProps={{cssVarsRoot:":host",resetCSS:!0,toastOptions:{portalProps:{containerRef:{current:this.getRoot()}}}}}>{e}</A>}};pt.observedAttributes=["library","component","version","revision","hostname","template"];pt.register("feaas-context");
72
+ `),this.refs.context.set({frontend:e,library:n,getToken:o}),this.refs.picker.set({frontend:e,context:a,src:s,mode:i,onClose:this.onClose})}};ot.register("feaas-picker-lazy");function kt(t=this){var r,e,n,o;return{library:t==null?void 0:t.getAttribute("library"),src:(r=t==null?void 0:t.getAttribute("src"))!=null?r:"/assets/context.js",frontend:(e=t==null?void 0:t.getAttribute("frontend"))!=null?e:"https://components.sitecoreclud.io",backend:(n=t==null?void 0:t.getAttribute("backend"))!=null?n:"https://components-api.sitecoreclud.io",cdn:(o=t==null?void 0:t.getAttribute("cdn"))!=null?o:"https://feaascompontsapiprod.blob.core.windows.net",getToken:null}}var V=class extends m{getProps(){return kt(this)}load(){return import(this.formatURL(this.props.src,this.props.frontend))}getTheme(e){return e}getRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}getReactRoot(){return this.reactRoot||(this.reactRoot=document.createElement("div"),this.getRoot().appendChild(this.reactRoot)),this.reactRoot}adoptedCallback(e){super.adoptedCallback(e);let n=e.composedPath()[0];n.parentNode!=this.getRoot()&&this.getRoot().appendChild(n)}renderReact({children:e,library:n},{AppContext:o,Chakra:{Button:s,Tooltip:i},React:{useRef:a}}){return i.defaultProps={hasArrow:!0,placement:"top",portalProps:{containerRef:{current:this.getRoot()}}},React.createElement(o,{libraryId:this.props.library,container:this.getRoot(),getTheme:this.getTheme,modalProps:{portalProps:{containerRef:{current:this.getRoot()}}},chakraProps:{cssVarsRoot:":host",resetCSS:!0,toastOptions:{portalProps:{containerRef:{current:this.getRoot()}}}}},e)}};V.observedAttributes=["library","component","version","revision","hostname","template"];V.register("feaas-context");
@@ -1,6 +1,6 @@
1
- var Lt=Object.defineProperty,_t=Object.defineProperties;var Ot=Object.getOwnPropertyDescriptors;var Rt=Object.getOwnPropertySymbols;var Ht=Object.prototype.hasOwnProperty,Bt=Object.prototype.propertyIsEnumerable;var wt=(t,r,e)=>r in t?Lt(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,N=(t,r)=>{for(var e in r||(r={}))Ht.call(r,e)&&wt(t,e,r[e]);if(Rt)for(var e of Rt(r))Bt.call(r,e)&&wt(t,e,r[e]);return t},Y=(t,r)=>_t(t,Ot(r));var I=(t,r,e)=>new Promise((n,A)=>{var E=P=>{try{F(e.next(P))}catch(C){A(C)}},S=P=>{try{F(e.throw(P))}catch(C){A(C)}},F=P=>P.done?n(P.value):Promise.resolve(P.value).then(E,S);F((e=e.apply(t,r)).next())});function j(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(r){return typeof r}:j=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},j(t)}function It(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function $t(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&st(t,r)}function ot(t){return ot=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ot(t)}function st(t,r){return st=Object.setPrototypeOf||function(n,A){return n.__proto__=A,n},st(t,r)}function xt(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function nt(t,r,e){return xt()?nt=Reflect.construct:nt=function(A,E,S){var F=[null];F.push.apply(F,E);var P=Function.bind.apply(A,F),C=new P;return S&&st(C,S.prototype),C},nt.apply(null,arguments)}function Nt(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function gt(t){var r=typeof Map=="function"?new Map:void 0;return gt=function(n){if(n===null||!Nt(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r!="undefined"){if(r.has(n))return r.get(n);r.set(n,A)}function A(){return nt(n,arguments,ot(this).constructor)}return A.prototype=Object.create(n.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),st(A,n)},gt(t)}function jt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Wt(t,r){return r&&(typeof r=="object"||typeof r=="function")?r:jt(t)}function zt(t){var r=xt();return function(){var n=ot(t),A;if(r){var E=ot(this).constructor;A=Reflect.construct(n,arguments,E)}else A=n.apply(this,arguments);return Wt(this,A)}}function Ct(t){return Ut(t)||Jt(t)||Tt(t)||qt()}function Ut(t){if(Array.isArray(t))return mt(t)}function Jt(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Tt(t,r){if(!!t){if(typeof t=="string")return mt(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return mt(t,r)}}function mt(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function qt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vt(t,r){var e=typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Tt(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,A=function(){};return{s:A,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(P){throw P},f:A}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var E=!0,S=!1,F;return{s:function(){e=e.call(t)},n:function(){var P=e.next();return E=P.done,P},e:function(P){S=!0,F=P},f:function(){try{!E&&e.return!=null&&e.return()}finally{if(S)throw F}}}}var H=Object.prototype.hasOwnProperty;function rt(t,r){return t=t.slice(),t.push(r),t}function Z(t,r){return r=r.slice(),r.unshift(t),r}var Xt=function(t){$t(e,t);var r=zt(e);function e(n){var A;return It(this,e),A=r.call(this,'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),A.avoidNew=!0,A.value=n,A.name="NewError",A}return e}(gt(Error));function T(t,r,e,n,A){if(!(this instanceof T))try{return new T(t,r,e,n,A)}catch(P){if(!P.avoidNew)throw P;return P.value}typeof t=="string"&&(A=n,n=e,e=r,r=t,t=null);var E=t&&j(t)==="object";if(t=t||{},this.json=t.json||e,this.path=t.path||r,this.resultType=t.resultType||"value",this.flatten=t.flatten||!1,this.wrap=H.call(t,"wrap")?t.wrap:!0,this.sandbox=t.sandbox||{},this.preventEval=t.preventEval||!1,this.parent=t.parent||null,this.parentProperty=t.parentProperty||null,this.callback=t.callback||n||null,this.otherTypeCallback=t.otherTypeCallback||A||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},t.autostart!==!1){var S={path:E?t.path:r};E?"json"in t&&(S.json=t.json):S.json=e;var F=this.evaluate(S);if(!F||j(F)!=="object")throw new Xt(F);return F}}T.prototype.evaluate=function(t,r,e,n){var A=this,E=this.parent,S=this.parentProperty,F=this.flatten,P=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,e=e||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,r=r||this.json,t=t||this.path,t&&j(t)==="object"&&!Array.isArray(t)){if(!t.path&&t.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!H.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var C=t;r=C.json,F=H.call(t,"flatten")?t.flatten:F,this.currResultType=H.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=H.call(t,"sandbox")?t.sandbox:this.currSandbox,P=H.call(t,"wrap")?t.wrap:P,this.currPreventEval=H.call(t,"preventEval")?t.preventEval:this.currPreventEval,e=H.call(t,"callback")?t.callback:e,this.currOtherTypeCallback=H.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,E=H.call(t,"parent")?t.parent:E,S=H.call(t,"parentProperty")?t.parentProperty:S,t=t.path}if(E=E||null,S=S||null,Array.isArray(t)&&(t=T.toPathString(t)),!(!t&&t!==""||!r)){var R=T.toPathArray(t);R[0]==="$"&&R.length>1&&R.shift(),this._hasParentSelector=null;var w=this._trace(R,r,["$"],E,S,e).filter(function(x){return x&&!x.isParentSelector});return w.length?!P&&w.length===1&&!w[0].hasArrExpr?this._getPreferredOutput(w[0]):w.reduce(function(x,D){var M=A._getPreferredOutput(D);return F&&Array.isArray(M)?x=x.concat(M):x.push(M),x},[]):P?[]:void 0}};T.prototype._getPreferredOutput=function(t){var r=this.currResultType;switch(r){case"all":{var e=Array.isArray(t.path)?t.path:T.toPathArray(t.path);return t.pointer=T.toPointer(e),t.path=typeof t.path=="string"?t.path:T.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[r];case"path":return T.toPathString(t[r]);case"pointer":return T.toPointer(t.path);default:throw new TypeError("Unknown result type")}};T.prototype._handleCallback=function(t,r,e){if(r){var n=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:T.toPathString(t.path),r(n,e,t)}};T.prototype._trace=function(t,r,e,n,A,E,S,F){var P=this,C;if(!t.length)return C={path:e,value:r,parent:n,parentProperty:A,hasArrExpr:S},this._handleCallback(C,E,"value"),C;var R=t[0],w=t.slice(1),x=[];function D(L){Array.isArray(L)?L.forEach(function(W){x.push(W)}):x.push(L)}if((typeof R!="string"||F)&&r&&H.call(r,R))D(this._trace(w,r[R],rt(e,R),r,R,E,S));else if(R==="*")this._walk(R,w,r,e,n,A,E,function(L,W,X,B,V,K,$,z){D(P._trace(Z(L,X),B,V,K,$,z,!0,!0))});else if(R==="..")D(this._trace(w,r,e,n,A,E,S)),this._walk(R,w,r,e,n,A,E,function(L,W,X,B,V,K,$,z){j(B[L])==="object"&&D(P._trace(Z(W,X),B[L],rt(V,L),B,L,z,!0))});else{if(R==="^")return this._hasParentSelector=!0,{path:e.slice(0,-1),expr:w,isParentSelector:!0};if(R==="~")return C={path:rt(e,R),value:A,parent:n,parentProperty:null},this._handleCallback(C,E,"property"),C;if(R==="$")D(this._trace(w,r,e,null,null,E,S));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(R))D(this._slice(R,w,r,e,n,A,E));else if(R.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");this._walk(R,w,r,e,n,A,E,function(L,W,X,B,V,K,$,z){P._eval(W.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1"),B[L],L,V,K,$)&&D(P._trace(Z(L,X),B,V,K,$,z,!0))})}else if(R[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");D(this._trace(Z(this._eval(R,r,e[e.length-1],e.slice(0,-1),n,A),w),r,e,n,A,E,S))}else if(R[0]==="@"){var M=!1,U=R.slice(1,-2);switch(U){case"scalar":(!r||!["object","function"].includes(j(r)))&&(M=!0);break;case"boolean":case"string":case"undefined":case"function":j(r)===U&&(M=!0);break;case"integer":Number.isFinite(r)&&!(r%1)&&(M=!0);break;case"number":Number.isFinite(r)&&(M=!0);break;case"nonFinite":typeof r=="number"&&!Number.isFinite(r)&&(M=!0);break;case"object":r&&j(r)===U&&(M=!0);break;case"array":Array.isArray(r)&&(M=!0);break;case"other":M=this.currOtherTypeCallback(r,e,n,A);break;case"null":r===null&&(M=!0);break;default:throw new TypeError("Unknown value type "+U)}if(M)return C={path:e,value:r,parent:n,parentProperty:A},this._handleCallback(C,E,"value"),C}else if(R[0]==="`"&&r&&H.call(r,R.slice(1))){var at=R.slice(1);D(this._trace(w,r[at],rt(e,at),r,at,E,S,!0))}else if(R.includes(",")){var yt=R.split(","),G=Vt(yt),ut;try{for(G.s();!(ut=G.n()).done;){var et=ut.value;D(this._trace(Z(et,w),r,e,n,A,E,!0))}}catch(L){G.e(L)}finally{G.f()}}else!F&&r&&H.call(r,R)&&D(this._trace(w,r[R],rt(e,R),r,R,E,S,!0))}if(this._hasParentSelector)for(var _=0;_<x.length;_++){var Q=x[_];if(Q&&Q.isParentSelector){var J=this._trace(Q.expr,r,Q.path,n,A,E,S);if(Array.isArray(J)){x[_]=J[0];for(var bt=J.length,q=1;q<bt;q++)_++,x.splice(_,0,J[q])}else x[_]=J}}return x};T.prototype._walk=function(t,r,e,n,A,E,S,F){if(Array.isArray(e))for(var P=e.length,C=0;C<P;C++)F(C,t,r,e,n,A,E,S);else e&&j(e)==="object"&&Object.keys(e).forEach(function(R){F(R,t,r,e,n,A,E,S)})};T.prototype._slice=function(t,r,e,n,A,E,S){if(!!Array.isArray(e)){var F=e.length,P=t.split(":"),C=P[2]&&Number.parseInt(P[2])||1,R=P[0]&&Number.parseInt(P[0])||0,w=P[1]&&Number.parseInt(P[1])||F;R=R<0?Math.max(0,R+F):Math.min(F,R),w=w<0?Math.max(0,w+F):Math.min(F,w);for(var x=[],D=R;D<w;D+=C){var M=this._trace(Z(D,r),e,n,A,E,S,!0);M.forEach(function(U){x.push(U)})}return x}};T.prototype._eval=function(t,r,e,n,A,E){t.includes("@parentProperty")&&(this.currSandbox._$_parentProperty=E,t=t.replace(/@parentProperty/g,"_$_parentProperty")),t.includes("@parent")&&(this.currSandbox._$_parent=A,t=t.replace(/@parent/g,"_$_parent")),t.includes("@property")&&(this.currSandbox._$_property=e,t=t.replace(/@property/g,"_$_property")),t.includes("@path")&&(this.currSandbox._$_path=T.toPathString(n.concat([e])),t=t.replace(/@path/g,"_$_path")),t.includes("@root")&&(this.currSandbox._$_root=this.json,t=t.replace(/@root/g,"_$_root")),/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/.test(t)&&(this.currSandbox._$_v=r,t=t.replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1"));try{return this.vm.runInNewContext(t,this.currSandbox)}catch(S){throw console.log(S),new Error("jsonPath: "+S.message+": "+t)}};T.cache={};T.toPathString=function(t){for(var r=t,e=r.length,n="$",A=1;A<e;A++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(r[A])||(n+=/^[\*0-9]+$/.test(r[A])?"["+r[A]+"]":"['"+r[A]+"']");return n};T.toPointer=function(t){for(var r=t,e=r.length,n="",A=1;A<e;A++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(r[A])||(n+="/"+r[A].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};T.toPathArray=function(t){var r=T.cache;if(r[t])return r[t].concat();var e=[],n=t.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,function(E,S){return"[#"+(e.push(S)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(E,S){return"['"+S.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(E,S){return";"+S.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),A=n.split(";").map(function(E){var S=E.match(/#([0-9]+)/);return!S||!S[1]?E:e[S[1]]});return r[t]=A,r[t].concat()};var Kt=function(r,e,n){for(var A=r.length,E=0;E<A;E++){var S=r[E];n(S)&&e.push(r.splice(E--,1)[0])}};T.prototype.vm={runInNewContext:function(r,e){var n=Object.keys(e),A=[];Kt(n,A,function(C){return typeof e[C]=="function"});var E=n.map(function(C,R){return e[C]}),S=A.reduce(function(C,R){var w=e[R].toString();return/function/.test(w)||(w="function "+w),"var "+R+"="+w+";"+C},"");r=S+r,!/(["'])use strict\1/.test(r)&&!n.includes("arguments")&&(r="var arguments = undefined;"+r),r=r.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"");var F=r.lastIndexOf(";"),P=F>-1?r.slice(0,F+1)+" return "+r.slice(F+1):" return "+r;return nt(Function,Ct(n).concat([P])).apply(void 0,Ct(E))}};function At(t,r,e,n){return I(this,null,function*(){let A=new Date,E=yield fetch(t,r);if(!E.ok)throw new Error("Fetch failed");let S=new Date(E.headers.get("date"));var F=E;if(n(E,"cached"),S<A){let P=yield fetch(t+"?"+Math.random(),Y(N({},r),{method:"HEAD",cache:"no-cache"}));if(P.headers.get("last-modified")!=E.headers.get("last-modified")){if(e(P)===!1)throw new Error("Response is stale");F=yield fetch(t,Y(N({},r),{cache:"reload"}))}}if(e(F)===!1)throw new Error("Response is not valid");return E!==F&&n(F,"valid"),F})}function Yt({cdn:t="https://feaascomponentsapidev.blob.core.windows.net",hostname:r,library:e,component:n,version:A,revision:E="published"}){return`${t||r}/components/${e}/${n}/${A}/${E}.html`}function Gt({cdn:t="https://feaascomponentsapidev.blob.core.windows.net",hostname:r,library:e,revision:n="published"}){return`${t||r}/styles/${e}/${n}.css`}function ct(t,r){return I(this,null,function*(){return At(Yt(t),{},e=>e.headers.get("x-ms-meta-versionDeletedAt")==null,e=>{e.text().then(r)})})}function pt(t,r){return I(this,null,function*(){return At(Gt(t),{},e=>e.headers.get("x-ms-meta-deletedAt")==null,e=>{e.text().then(r)})})}function ve(t,r){let e=document.createElement("div");e.innerHTML=t;let n=document.createDocumentFragment();for(;e.firstChild;)n.appendChild(e.firstChild);return tt(n,r),e}function Qt(t){return t.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function Zt(t){return Qt(t)+".*"}function Dt(t){let r=t.getAttribute("data-path-scope");for(var e=0,n=t;n=n.previousElementSibling;)n.getAttribute("data-path-scope")==r&&e++;return e}function te(t,r,e){let n=t.getAttribute("data-path-scope");if(n==null)return;var A=Dt(t);if(A!=0)return;let E=t.parentElement;if(E!=null){r==0?t.style.display="none":t.style.display&&(t.style.display="",t.getAttribute("style")==""&&t.removeAttribute("style"));for(var S=A+1,F=t,P=t;P=P.nextElementSibling;)P.getAttribute("data-path-scope")==n&&(S++,F=P);for(var C=S;C<r;C++)E.insertBefore(F.cloneNode(!0),F.nextElementSibling);for(var C=Math.max(1,r);C<S;C++)F=F.previousElementSibling,E.removeChild(F.nextElementSibling)}}function kt(t,r,e=!1,n=t){var A=r;let E=Object.keys(t).sort((F,P)=>P.length-F.length);for(let F of E)if(r.startsWith(F)){if(F==r){if(e)return t[F];continue}A=r.substring(F.length+1),n=t[F];break}let S=T({path:A,json:n});return e&&S&&Array.isArray(S)?S[0]:S}function it(t,r,e,n){var R;if(!!t){var A=t;n!=null&&n.processValue&&(e=n==null?void 0:n.processValue(t,r,e));var E=r.replace("data-path-","");if(r=="data-path-src")A=t.tagName=="IMG"?t:t.querySelector("img, video");else if(r=="data-path-href")A=t.querySelector("a")||t.closest("a");else if(r=="data-path-alt")A=t.querySelector("img, picture");else if(r=="data-path-hidden")e=e?null:!0;else if(r=="data-path"||r=="data-embed-html"||r=="html")E="innerHTML";else if(r=="data-embed-src")Et(t,e);else if(r=="data-path-attributes"){let w=((R=t.getAttribute("data-attributes-keys"))==null?void 0:R.split(",").filter(Boolean))||[];for(var S in e){var F=e[S];it(t,S,typeof F=="object"&&F?JSON.stringify(F):F,n)}for(var P=0;P<w.length;P++)(e==null||!(w[P]in e))&&it(t,w[P],null,n);it(t,"data-attributes-keys",Object.keys(e||{}).join(","));return}if(typeof e=="boolean"&&(e=e?"":null),!!A){var C=String(t.getAttribute("data-path-placeholder")||A[E]);e!=null?E=="innerHTML"?A.innerHTML!=e&&(A.innerHTML=e):A.getAttribute(E)!=e&&A.setAttribute(E,e):E=="innerHTML"?A.innerHTML=C:A.removeAttribute(E)}}}function ee(t){let r=new t.ownerDocument.defaultView.MutationObserver(e=>{e.forEach(n=>{let A=n.target,E=A.getAttribute("data-embed-src");E&&Et(A,E),n.addedNodes&&n.addedNodes.forEach(S=>{S.nodeType==1&&re(S,!1)})})});return r.observe(t,{attributes:!0,subtree:!0,childList:!0}),r}function re(t,r=!0){let e=t.querySelectorAll("[data-embed-src]");for(var n=0;n<e.length;n++){let A=e[n];Et(A,A.getAttribute("data-embed-src"))}if(r)return ee(t)}function Et(t,r){for(var e=t;e;e=e.parentElement)if(!e.parentElement){let A=e.querySelectorAll("script");for(var n=0;n<A.length;n++)if(A[n].getAttribute("src")==r)return!0;e.tagName=="HTML"&&(e=e.querySelector("head")||e);let E=e.ownerDocument.createElement("script");E.type="module",E.src=r,e.appendChild(E);break}}var Mt=["data-attributes-keys","data-path-attributes","data-path-scope"];function tt(t,r,e,n){var S,F,P;let A=t;if(n||(r=((S=e==null?void 0:e.processData)==null?void 0:S.call(e,A,r))||r),A.nodeType==1){let C=A.getAttribute("data-path-scope");if(C){let w=Dt(A),x=kt(r,C,!1)||[];w==0&&te(A,((F=e==null?void 0:e.shouldRepeat)==null?void 0:F.call(e,A,x))===!1?1:x.length,e),r=Y(N({},r),{[Zt(C)]:x[w]})}let R=Array.prototype.slice.call(A.attributes).sort((w,x)=>Mt.indexOf(w.name)-Mt.indexOf(x.name));for(var E=0;E<R.length;E++){let{name:w,value:x}=R[E];w.startsWith("data-path")&&w!="data-path-scope"&&it(A,w,kt(r,x,!0),e),w=="data-embed-src"&&it(A,w,A.getAttribute(w),e)}}for(var E=0;E<A.children.length;E++)tt(A.children[E],r,e,!0);return n||(P=e==null?void 0:e.onRender)==null||P.call(e,A,r),A}function lt(t,r,e,n){var E;let A=((E=n==null?void 0:n.processTemplate)==null?void 0:E.call(n,t,r,e))||r;return t.innerHTML=A,t.classList.add("-feaas"),tt(t,e,n)}function Se(t,r){return ne(t,r||(r=document.createElement("style"))),r}function ne(t,r){return r||(r=document.createElement("style")),pt(t,e=>{r.textContent=e}).then(()=>r)}function Fe(t,r){return oe(t,r||(r=document.createElement("div"))),r}function oe(t,r){return I(this,null,function*(){return r||(r=document.createElement("div")),r.childNodes.length?tt(r,t.data,t):"template"in t?lt(r,t.template,t.data,t):ct(t,e=>lt(r,e,t.data,t)).then(()=>r)})}var O=class extends HTMLElement{constructor(){super(...arguments);this.connected=null;this.refs={};this.descendants=[];this.onLoad=e=>{e!=null&&(this.payload=e,this.render())}}getProps(e){return{}}getRoot(){return this}attributeChangedCallback(e,n,A){this.set()}connectedCallback(){console.log("FEAAS: Connected",this),this.connected=new Event("feaasConnected",{bubbles:!0,composed:!0}),this.dispatchEvent(this.connected),this.addEventListener("feaasConnected",this),this.addEventListener("feaasDisconnected",this),this.set()}disconnectedCallback(){console.log("FEAAS: Disconnected",this),this.removeEventListener("feaasConnected",this),this.removeEventListener("feaasDisconnected",this),this.dispatchEvent(new Event("feaasDisconnected",{bubbles:!0,composed:!0})),this.connected=null}handleEvent(e){switch(e.type){case"feaasConnected":this.adoptedCallback(e);break;case"feaasDisconnected":this.orphanCallback(e);break}}orphanCallback(e){let n=e.composedPath()[0],A=this.descendants.indexOf(n);A!=-1&&(console.log("FEAAS: Orphaning",this,n),this.descendants.splice(A,-1),this.refs[n.getComponentName()]=null,n.refs.parent==this&&(n.refs.parent=null),n.refs.top==this&&(n.refs.top=n.refs.parent))}adoptedCallback(e){var E,S;let n=e.composedPath()[0];if(this.descendants.push(n),console.log("FEAAS: Adopting",this,n),this.refs[n.getComponentName()]=n,n.refs.top=this,(E=n.refs).parent||(E.parent=this),n.renderReact)for(var A=n.refs.parent;A;A=A.refs.parent)A.renderReact&&((S=n.refs).parentReact||(S.parentReact=A),n.refs.topReact=A)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return this.payload===void 0&&this.getAttribute("hidden")==null}reify(){return I(this,null,function*(){this.payload!==void 0?this.render():this.isReadyToLoad()&&(this.payload=null,this.load().then(this.onLoad))})}load(){return Promise.resolve(null)}render(e=!1){var E,S,F;if(console.log("FEAAS: React",this.tagName,this.payload),this.payload==null)return;let{React:n,ReactDOM:A}=this.payload||{};if(!n)throw new Error(`${this.tagName}: React is not present in payload`);if(!A)throw new Error(`${this.tagName}: ReactDOM is not present in payload`);!this.refs.topReact&&!this.forceUpdateReact?A.render(n.createElement(this.getReactWrapper()),this.getReactRoot()):this.forceUpdateReact?(E=this.forceUpdateReact)==null||E.call(this):(F=(S=this.refs.topReact).forceUpdateReact)==null||F.call(S)}invokeReactRendering(){let{React:e,ReactDOM:n}=this.payload||{},A=this.descendants.filter(E=>E.refs.parentReact==this&&E.payload).map((E,S)=>e.createElement(this.getReactWrapper(E),{key:this.tagName+"-"+S,slot:E.getAttribute("slot")}));return this.renderReact(Y(N({},this.props),{children:A}),this.payload)}getReactWrapper(e=this,n=e.tagName){let A=e.reactWrapper||(e.reactWrapper=E=>{if(e.renderReact){let{React:S,ReactDOM:F}=e.payload||{},[P,C]=S.useReducer(R=>R+1,0);return e.forceUpdateReact=C,F.createPortal(S.createElement(S.Fragment,null,e.invokeReactRendering()),e.getReactRoot())}else return e.render()});return Object.assign(A,{displayName:n}),A}getUID(){return this.uid||(this.uid=String(Math.random()))}getReactRoot(){return this.getRoot()}set(e){this.overrides=N(N({},this.overrides),e),this.props=N(N({},this.getProps()),this.overrides);for(var n in this.props){let A=this.props[n];this.props[n]==null?this.removeAttribute(n):(typeof A=="string"||typeof A=="number")&&this.getAttribute(n)!=String(A)&&this.setAttribute(n,String(A))}this.scheduleRender()}scheduleRender(){cancelAnimationFrame(this.nextRender),this.nextRender=requestAnimationFrame(()=>{this.reify()})}formatURL(e,n){return typeof e=="string"&&e.match(/\/[^\/]/)?n+e:e}getContextAttribute(e,n=this){var A,E;return(E=(A=n.closest(`[${e}]`))==null?void 0:A.getAttribute(e))!=null?E:this.getAttribute(e)}static register(e){window.customElements.get(e)||window.customElements.define(e,this)}};function Ce(t=this){return{hidden:(t==null?void 0:t.getAttribute("hidden"))!=null}}var ht=class extends O{attributeChangedCallback(e,n,A){e=="hidden"&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),A?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all"))}connectedCallback(){this.attributeChangedCallback("hidden",this.getAttribute("hidden"),this.getAttribute("hidden")),this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
1
+ var bt=Object.defineProperty,gt=Object.defineProperties;var mt=Object.getOwnPropertyDescriptors;var ut=Object.getOwnPropertySymbols;var At=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable;var ct=(t,r,e)=>r in t?bt(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,F=(t,r)=>{for(var e in r||(r={}))At.call(r,e)&&ct(t,e,r[e]);if(ut)for(var e of ut(r))Et.call(r,e)&&ct(t,e,r[e]);return t},L=(t,r)=>gt(t,mt(r));var v=(t,r,e)=>new Promise((n,o)=>{var s=u=>{try{a(e.next(u))}catch(l){o(l)}},i=u=>{try{a(e.throw(u))}catch(l){o(l)}},a=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,i);a((e=e.apply(t,r)).next())});function P(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?P=function(r){return typeof r}:P=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},P(t)}function vt(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function St(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&W(t,r)}function j(t){return j=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},j(t)}function W(t,r){return W=Object.setPrototypeOf||function(n,o){return n.__proto__=o,n},W(t,r)}function lt(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function N(t,r,e){return lt()?N=Reflect.construct:N=function(o,s,i){var a=[null];a.push.apply(a,s);var u=Function.bind.apply(o,a),l=new u;return i&&W(l,i.prototype),l},N.apply(null,arguments)}function Ft(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function tt(t){var r=typeof Map=="function"?new Map:void 0;return tt=function(n){if(n===null||!Ft(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r!="undefined"){if(r.has(n))return r.get(n);r.set(n,o)}function o(){return N(n,arguments,j(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),W(o,n)},tt(t)}function Pt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Rt(t,r){return r&&(typeof r=="object"||typeof r=="function")?r:Pt(t)}function wt(t){var r=lt();return function(){var n=j(t),o;if(r){var s=j(this).constructor;o=Reflect.construct(n,arguments,s)}else o=n.apply(this,arguments);return Rt(this,o)}}function pt(t){return Ct(t)||xt(t)||ht(t)||Tt()}function Ct(t){if(Array.isArray(t))return et(t)}function xt(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ht(t,r){if(!!t){if(typeof t=="string")return et(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return et(t,r)}}function et(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function Tt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kt(t,r){var e=typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=ht(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,i=!1,a;return{s:function(){e=e.call(t)},n:function(){var u=e.next();return s=u.done,u},e:function(u){i=!0,a=u},f:function(){try{!s&&e.return!=null&&e.return()}finally{if(i)throw a}}}}var A=Object.prototype.hasOwnProperty;function $(t,r){return t=t.slice(),t.push(r),t}function H(t,r){return r=r.slice(),r.unshift(t),r}var Mt=function(t){St(e,t);var r=wt(e);function e(n){var o;return vt(this,e),o=r.call(this,'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),o.avoidNew=!0,o.value=n,o.name="NewError",o}return e}(tt(Error));function d(t,r,e,n,o){if(!(this instanceof d))try{return new d(t,r,e,n,o)}catch(u){if(!u.avoidNew)throw u;return u.value}typeof t=="string"&&(o=n,n=e,e=r,r=t,t=null);var s=t&&P(t)==="object";if(t=t||{},this.json=t.json||e,this.path=t.path||r,this.resultType=t.resultType||"value",this.flatten=t.flatten||!1,this.wrap=A.call(t,"wrap")?t.wrap:!0,this.sandbox=t.sandbox||{},this.preventEval=t.preventEval||!1,this.parent=t.parent||null,this.parentProperty=t.parentProperty||null,this.callback=t.callback||n||null,this.otherTypeCallback=t.otherTypeCallback||o||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},t.autostart!==!1){var i={path:s?t.path:r};s?"json"in t&&(i.json=t.json):i.json=e;var a=this.evaluate(i);if(!a||P(a)!=="object")throw new Mt(a);return a}}d.prototype.evaluate=function(t,r,e,n){var o=this,s=this.parent,i=this.parentProperty,a=this.flatten,u=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,e=e||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,r=r||this.json,t=t||this.path,t&&P(t)==="object"&&!Array.isArray(t)){if(!t.path&&t.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!A.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var l=t;r=l.json,a=A.call(t,"flatten")?t.flatten:a,this.currResultType=A.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=A.call(t,"sandbox")?t.sandbox:this.currSandbox,u=A.call(t,"wrap")?t.wrap:u,this.currPreventEval=A.call(t,"preventEval")?t.preventEval:this.currPreventEval,e=A.call(t,"callback")?t.callback:e,this.currOtherTypeCallback=A.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,s=A.call(t,"parent")?t.parent:s,i=A.call(t,"parentProperty")?t.parentProperty:i,t=t.path}if(s=s||null,i=i||null,Array.isArray(t)&&(t=d.toPathString(t)),!(!t&&t!==""||!r)){var c=d.toPathArray(t);c[0]==="$"&&c.length>1&&c.shift(),this._hasParentSelector=null;var p=this._trace(c,r,["$"],s,i,e).filter(function(h){return h&&!h.isParentSelector});return p.length?!u&&p.length===1&&!p[0].hasArrExpr?this._getPreferredOutput(p[0]):p.reduce(function(h,y){var f=o._getPreferredOutput(y);return a&&Array.isArray(f)?h=h.concat(f):h.push(f),h},[]):u?[]:void 0}};d.prototype._getPreferredOutput=function(t){var r=this.currResultType;switch(r){case"all":{var e=Array.isArray(t.path)?t.path:d.toPathArray(t.path);return t.pointer=d.toPointer(e),t.path=typeof t.path=="string"?t.path:d.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[r];case"path":return d.toPathString(t[r]);case"pointer":return d.toPointer(t.path);default:throw new TypeError("Unknown result type")}};d.prototype._handleCallback=function(t,r,e){if(r){var n=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:d.toPathString(t.path),r(n,e,t)}};d.prototype._trace=function(t,r,e,n,o,s,i,a){var u=this,l;if(!t.length)return l={path:e,value:r,parent:n,parentProperty:o,hasArrExpr:i},this._handleCallback(l,s,"value"),l;var c=t[0],p=t.slice(1),h=[];function y(b){Array.isArray(b)?b.forEach(function(R){h.push(R)}):h.push(b)}if((typeof c!="string"||a)&&r&&A.call(r,c))y(this._trace(p,r[c],$(e,c),r,c,s,i));else if(c==="*")this._walk(c,p,r,e,n,o,s,function(b,R,M,E,k,D,S,w){y(u._trace(H(b,M),E,k,D,S,w,!0,!0))});else if(c==="..")y(this._trace(p,r,e,n,o,s,i)),this._walk(c,p,r,e,n,o,s,function(b,R,M,E,k,D,S,w){P(E[b])==="object"&&y(u._trace(H(R,M),E[b],$(k,b),E,b,w,!0))});else{if(c==="^")return this._hasParentSelector=!0,{path:e.slice(0,-1),expr:p,isParentSelector:!0};if(c==="~")return l={path:$(e,c),value:o,parent:n,parentProperty:null},this._handleCallback(l,s,"property"),l;if(c==="$")y(this._trace(p,r,e,null,null,s,i));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(c))y(this._slice(c,p,r,e,n,o,s));else if(c.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");this._walk(c,p,r,e,n,o,s,function(b,R,M,E,k,D,S,w){u._eval(R.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1"),E[b],b,k,D,S)&&y(u._trace(H(b,M),E,k,D,S,w,!0))})}else if(c[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");y(this._trace(H(this._eval(c,r,e[e.length-1],e.slice(0,-1),n,o),p),r,e,n,o,s,i))}else if(c[0]==="@"){var f=!1,C=c.slice(1,-2);switch(C){case"scalar":(!r||!["object","function"].includes(P(r)))&&(f=!0);break;case"boolean":case"string":case"undefined":case"function":P(r)===C&&(f=!0);break;case"integer":Number.isFinite(r)&&!(r%1)&&(f=!0);break;case"number":Number.isFinite(r)&&(f=!0);break;case"nonFinite":typeof r=="number"&&!Number.isFinite(r)&&(f=!0);break;case"object":r&&P(r)===C&&(f=!0);break;case"array":Array.isArray(r)&&(f=!0);break;case"other":f=this.currOtherTypeCallback(r,e,n,o);break;case"null":r===null&&(f=!0);break;default:throw new TypeError("Unknown value type "+C)}if(f)return l={path:e,value:r,parent:n,parentProperty:o},this._handleCallback(l,s,"value"),l}else if(c[0]==="`"&&r&&A.call(r,c.slice(1))){var U=c.slice(1);y(this._trace(p,r[U],$(e,U),r,U,s,i,!0))}else if(c.includes(",")){var Q=c.split(","),_=kt(Q),J;try{for(_.s();!(J=_.n()).done;){var I=J.value;y(this._trace(H(I,p),r,e,n,o,s,!0))}}catch(b){_.e(b)}finally{_.f()}}else!a&&r&&A.call(r,c)&&y(this._trace(p,r[c],$(e,c),r,c,s,i,!0))}if(this._hasParentSelector)for(var g=0;g<h.length;g++){var O=h[g];if(O&&O.isParentSelector){var x=this._trace(O.expr,r,O.path,n,o,s,i);if(Array.isArray(x)){h[g]=x[0];for(var Z=x.length,T=1;T<Z;T++)g++,h.splice(g,0,x[T])}else h[g]=x}}return h};d.prototype._walk=function(t,r,e,n,o,s,i,a){if(Array.isArray(e))for(var u=e.length,l=0;l<u;l++)a(l,t,r,e,n,o,s,i);else e&&P(e)==="object"&&Object.keys(e).forEach(function(c){a(c,t,r,e,n,o,s,i)})};d.prototype._slice=function(t,r,e,n,o,s,i){if(!!Array.isArray(e)){var a=e.length,u=t.split(":"),l=u[2]&&Number.parseInt(u[2])||1,c=u[0]&&Number.parseInt(u[0])||0,p=u[1]&&Number.parseInt(u[1])||a;c=c<0?Math.max(0,c+a):Math.min(a,c),p=p<0?Math.max(0,p+a):Math.min(a,p);for(var h=[],y=c;y<p;y+=l){var f=this._trace(H(y,r),e,n,o,s,i,!0);f.forEach(function(C){h.push(C)})}return h}};d.prototype._eval=function(t,r,e,n,o,s){t.includes("@parentProperty")&&(this.currSandbox._$_parentProperty=s,t=t.replace(/@parentProperty/g,"_$_parentProperty")),t.includes("@parent")&&(this.currSandbox._$_parent=o,t=t.replace(/@parent/g,"_$_parent")),t.includes("@property")&&(this.currSandbox._$_property=e,t=t.replace(/@property/g,"_$_property")),t.includes("@path")&&(this.currSandbox._$_path=d.toPathString(n.concat([e])),t=t.replace(/@path/g,"_$_path")),t.includes("@root")&&(this.currSandbox._$_root=this.json,t=t.replace(/@root/g,"_$_root")),/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/.test(t)&&(this.currSandbox._$_v=r,t=t.replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1"));try{return this.vm.runInNewContext(t,this.currSandbox)}catch(i){throw console.log(i),new Error("jsonPath: "+i.message+": "+t)}};d.cache={};d.toPathString=function(t){for(var r=t,e=r.length,n="$",o=1;o<e;o++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(r[o])||(n+=/^[\*0-9]+$/.test(r[o])?"["+r[o]+"]":"['"+r[o]+"']");return n};d.toPointer=function(t){for(var r=t,e=r.length,n="",o=1;o<e;o++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(r[o])||(n+="/"+r[o].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};d.toPathArray=function(t){var r=d.cache;if(r[t])return r[t].concat();var e=[],n=t.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,function(s,i){return"[#"+(e.push(i)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(s,i){return"['"+i.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(s,i){return";"+i.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),o=n.split(";").map(function(s){var i=s.match(/#([0-9]+)/);return!i||!i[1]?s:e[i[1]]});return r[t]=o,r[t].concat()};var Dt=function(r,e,n){for(var o=r.length,s=0;s<o;s++){var i=r[s];n(i)&&e.push(r.splice(s--,1)[0])}};d.prototype.vm={runInNewContext:function(r,e){var n=Object.keys(e),o=[];Dt(n,o,function(l){return typeof e[l]=="function"});var s=n.map(function(l,c){return e[l]}),i=o.reduce(function(l,c){var p=e[c].toString();return/function/.test(p)||(p="function "+p),"var "+c+"="+p+";"+l},"");r=i+r,!/(["'])use strict\1/.test(r)&&!n.includes("arguments")&&(r="var arguments = undefined;"+r),r=r.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"");var a=r.lastIndexOf(";"),u=a>-1?r.slice(0,a+1)+" return "+r.slice(a+1):" return "+r;return N(Function,pt(n).concat([u])).apply(void 0,pt(s))}};function rt(t,r,e,n){return v(this,null,function*(){let o=new Date,s=yield fetch(t,r);if(!s.ok)throw new Error("Fetch failed");let i=new Date(s.headers.get("date"));var a=s;if(n(s,"cached"),i<o){let u=yield fetch(t+"?"+Math.random(),L(F({},r),{method:"HEAD",cache:"no-cache"}));if(u.headers.get("last-modified")!=s.headers.get("last-modified")){if(e(u)===!1)throw new Error("Response is stale");a=yield fetch(t,L(F({},r),{cache:"reload"}))}}if(e(a)===!1)throw new Error("Response is not valid");return s!==a&&n(a,"valid"),a})}function Lt({cdn:t="https://feaascomponentsapidev.blob.core.windows.net",hostname:r,library:e,component:n,version:o,revision:s="published"}){return`${t||r}/components/${e}/${n}/${o}/${s}.html`}function _t({cdn:t="https://feaascomponentsapidev.blob.core.windows.net",hostname:r,library:e,revision:n="published"}){return`${t||r}/styles/${e}/${n}.css`}function q(t,r){return v(this,null,function*(){return rt(Lt(t),{},e=>e.headers.get("x-ms-meta-versionDeletedAt")==null,e=>{e.text().then(r)})})}function V(t,r){return v(this,null,function*(){return rt(_t(t),{},e=>e.headers.get("x-ms-meta-deletedAt")==null,e=>{e.text().then(r)})})}function oe(t,r){let e=document.createElement("div");e.innerHTML=t;let n=document.createDocumentFragment();for(;e.firstChild;)n.appendChild(e.firstChild);return B(n,r),e}function Ot(t){return t.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function Ht(t){return Ot(t)+".*"}function yt(t){let r=t.getAttribute("data-path-scope");for(var e=0,n=t;n=n.previousElementSibling;)n.getAttribute("data-path-scope")==r&&e++;return e}function Bt(t,r,e){let n=t.getAttribute("data-path-scope");if(n==null)return;var o=yt(t);if(o!=0)return;let s=t.parentElement;if(s!=null){r==0?t.style.display="none":t.style.display&&(t.style.display="",t.getAttribute("style")==""&&t.removeAttribute("style"));for(var i=o+1,a=t,u=t;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(i++,a=u);for(var l=i;l<r;l++)s.insertBefore(a.cloneNode(!0),a.nextElementSibling);for(var l=Math.max(1,r);l<i;l++)a=a.previousElementSibling,s.removeChild(a.nextElementSibling)}}function dt(t,r,e=!1,n=t){var o=r;let s=Object.keys(t).sort((a,u)=>u.length-a.length);for(let a of s)if(r.startsWith(a)){if(a==r){if(e)return t[a];continue}o=r.substring(a.length+1),n=t[a];break}let i=d({path:o,json:n});return e&&i&&Array.isArray(i)?i[0]:i}function z(t,r,e,n){var c;if(!!t){var o=t;n!=null&&n.processValue&&(e=n==null?void 0:n.processValue(t,r,e));var s=r.replace("data-path-","");if(r=="data-path-src")o=t.tagName=="IMG"?t:t.querySelector("img, video");else if(r=="data-path-href")o=t.querySelector("a")||t.closest("a");else if(r=="data-path-alt")o=t.querySelector("img, picture");else if(r=="data-path-hidden")e=e?null:!0;else if(r=="data-path"||r=="data-embed-html"||r=="html")s="innerHTML";else if(r=="data-embed-src")nt(t,e);else if(r=="data-path-attributes"){let p=((c=t.getAttribute("data-attributes-keys"))==null?void 0:c.split(",").filter(Boolean))||[];for(var i in e){var a=e[i];z(t,i,typeof a=="object"&&a?JSON.stringify(a):a,n)}for(var u=0;u<p.length;u++)(e==null||!(p[u]in e))&&z(t,p[u],null,n);z(t,"data-attributes-keys",Object.keys(e||{}).join(","));return}if(typeof e=="boolean"&&(e=e?"":null),!!o){var l=String(t.getAttribute("data-path-placeholder")||o[s]);e!=null?s=="innerHTML"?o.innerHTML!=e&&(o.innerHTML=e):o.getAttribute(s)!=e&&o.setAttribute(s,e):s=="innerHTML"?o.innerHTML=l:o.removeAttribute(s)}}}function It(t){let r=new t.ownerDocument.defaultView.MutationObserver(e=>{e.forEach(n=>{let o=n.target,s=o.getAttribute("data-embed-src");s&&nt(o,s),n.addedNodes&&n.addedNodes.forEach(i=>{i.nodeType==1&&$t(i,!1)})})});return r.observe(t,{attributes:!0,subtree:!0,childList:!0}),r}function $t(t,r=!0){let e=t.querySelectorAll("[data-embed-src]");for(var n=0;n<e.length;n++){let o=e[n];nt(o,o.getAttribute("data-embed-src"))}if(r)return It(t)}function nt(t,r){for(var e=t;e;e=e.parentElement)if(!e.parentElement){let o=e.querySelectorAll("script");for(var n=0;n<o.length;n++)if(o[n].getAttribute("src")==r)return!0;e.tagName=="HTML"&&(e=e.querySelector("head")||e);let s=e.ownerDocument.createElement("script");s.type="module",s.src=r,e.appendChild(s);break}}var ft=["data-attributes-keys","data-path-attributes","data-path-scope"];function B(t,r,e,n){var i,a,u;let o=t;if(n||(r=((i=e==null?void 0:e.processData)==null?void 0:i.call(e,o,r))||r),o.nodeType==1){let l=o.getAttribute("data-path-scope");if(l){let p=yt(o),h=dt(r,l,!1)||[];p==0&&Bt(o,((a=e==null?void 0:e.shouldRepeat)==null?void 0:a.call(e,o,h))===!1?1:h.length,e),r=L(F({},r),{[Ht(l)]:h[p]})}let c=Array.prototype.slice.call(o.attributes).sort((p,h)=>ft.indexOf(p.name)-ft.indexOf(h.name));for(var s=0;s<c.length;s++){let{name:p,value:h}=c[s];p.startsWith("data-path")&&p!="data-path-scope"&&z(o,p,dt(r,h,!0),e),p=="data-embed-src"&&z(o,p,o.getAttribute(p),e)}}for(var s=0;s<o.children.length;s++)B(o.children[s],r,e,!0);return n||(u=e==null?void 0:e.onRender)==null||u.call(e,o,r),o}function X(t,r,e,n){var s;let o=((s=n==null?void 0:n.processTemplate)==null?void 0:s.call(n,t,r,e))||r;return t.innerHTML=o,t.classList.add("-feaas"),B(t,e,n)}function se(t,r){return Nt(t,r||(r=document.createElement("style"))),r}function Nt(t,r){return r||(r=document.createElement("style")),V(t,e=>{r.textContent=e}).then(()=>r)}function ie(t,r){return jt(t,r||(r=document.createElement("div"))),r}function jt(t,r){return v(this,null,function*(){return r||(r=document.createElement("div")),r.childNodes.length?B(r,t.data,t):"template"in t?X(r,t.template,t.data,t):q(t,e=>X(r,e,t.data,t)).then(()=>r)})}var m=class extends HTMLElement{constructor(){super(...arguments);this.connected=null;this.refs={};this.descendants=[];this.onLoad=e=>{e!=null&&(this.payload=e,this.render())}}getProps(e){return{}}getRoot(){return this}attributeChangedCallback(e,n,o){this.set()}connectedCallback(){console.log("FEAAS: Connected",this),this.connected=new Event("feaasConnected",{bubbles:!0,composed:!0}),this.dispatchEvent(this.connected),this.addEventListener("feaasConnected",this),this.addEventListener("feaasDisconnected",this),this.set()}disconnectedCallback(){console.log("FEAAS: Disconnected",this),this.removeEventListener("feaasConnected",this),this.removeEventListener("feaasDisconnected",this),this.dispatchEvent(new Event("feaasDisconnected",{bubbles:!0,composed:!0})),this.connected=null}handleEvent(e){switch(e.type){case"feaasConnected":this.adoptedCallback(e);break;case"feaasDisconnected":this.orphanCallback(e);break}}orphanCallback(e){let n=e.composedPath()[0],o=this.descendants.indexOf(n);o!=-1&&(console.log("FEAAS: Orphaning",this,n),this.descendants.splice(o,-1),this.refs[n.getComponentName()]=null,n.refs.parent==this&&(n.refs.parent=null),n.refs.top==this&&(n.refs.top=n.refs.parent))}adoptedCallback(e){var s,i;let n=e.composedPath()[0];if(this.descendants.push(n),console.log("FEAAS: Adopting",this,n),this.refs[n.getComponentName()]=n,n.refs.top=this,(s=n.refs).parent||(s.parent=this),n.renderReact)for(var o=n.refs.parent;o;o=o.refs.parent)o.renderReact&&((i=n.refs).parentReact||(i.parentReact=o),n.refs.topReact=o)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return this.payload===void 0&&this.getAttribute("hidden")==null}reify(){return v(this,null,function*(){this.payload!==void 0?this.render():this.isReadyToLoad()&&(this.payload=null,this.load().then(this.onLoad))})}load(){return Promise.resolve(null)}render(e=!1){var s,i,a;if(console.log("FEAAS: React",this.tagName,this.payload),this.payload==null)return;let{React:n,ReactDOM:o}=this.payload||{};if(!n)throw new Error(`${this.tagName}: React is not present in payload`);if(!o)throw new Error(`${this.tagName}: ReactDOM is not present in payload`);!this.refs.topReact&&!this.forceUpdateReact?o.render(n.createElement(this.getReactWrapper()),this.getReactRoot()):this.forceUpdateReact?(s=this.forceUpdateReact)==null||s.call(this):(a=(i=this.refs.topReact).forceUpdateReact)==null||a.call(i)}invokeReactRendering(){let{React:e,ReactDOM:n}=this.payload||{},o=this.descendants.filter(s=>s.refs.parentReact==this&&s.payload).map((s,i)=>e.createElement(this.getReactWrapper(s),{key:this.tagName+"-"+i,slot:s.getAttribute("slot")}));return this.renderReact(L(F({},this.props),{children:o}),this.payload)}getReactWrapper(e=this,n=e.tagName){let o=e.reactWrapper||(e.reactWrapper=s=>{if(e.renderReact){let{React:i,ReactDOM:a}=e.payload||{},[u,l]=i.useReducer(c=>c+1,0);return e.forceUpdateReact=l,a.createPortal(i.createElement(i.Fragment,null,e.invokeReactRendering()),e.getReactRoot())}else return e.render()});return Object.assign(o,{displayName:n}),o}getUID(){return this.uid||(this.uid=String(Math.random()))}getReactRoot(){return this.getRoot()}set(e){this.overrides=F(F({},this.overrides),e),this.props=F(F({},this.getProps()),this.overrides);for(var n in this.props){let o=this.props[n];this.props[n]==null?this.removeAttribute(n):(typeof o=="string"||typeof o=="number")&&this.getAttribute(n)!=String(o)&&this.setAttribute(n,String(o))}this.scheduleRender()}scheduleRender(){cancelAnimationFrame(this.nextRender),this.nextRender=requestAnimationFrame(()=>{this.reify()})}formatURL(e,n){return typeof e=="string"&&e.match(/\/[^\/]/)?n+e:e}getContextAttribute(e,n=this){var o,s;return(s=(o=n.closest(`[${e}]`))==null?void 0:o.getAttribute(e))!=null?s:this.getAttribute(e)}static register(e){window.customElements.get(e)||window.customElements.define(e,this)}};function pe(t=this){return{hidden:(t==null?void 0:t.getAttribute("hidden"))!=null}}var K=class extends m{attributeChangedCallback(e,n,o){e=="hidden"&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),o?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all"))}connectedCallback(){this.attributeChangedCallback("hidden",this.getAttribute("hidden"),this.getAttribute("hidden")),this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
4
4
  #loader {
5
5
  position: absolute;
6
6
  top: 0;
@@ -64,9 +64,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
64
64
  style="animation: 1.5s linear 0s infinite normal none running loader-circular-track"
65
65
  ></circle>
66
66
  </svg>
67
- </div>`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}};ht.observedAttributes=["hidden"];ht.register("feaas-loader");function se(t=this){var r;return{library:t==null?void 0:t.getContextAttribute("library"),revision:(r=t==null?void 0:t.getAttribute("revision"))!=null?r:"published",cdn:t==null?void 0:t.getContextAttribute("cdn")}}var vt=class extends O{getProps(){return se(this)}isReadyToLoad(){return this.props.library!=null&&this.props.revision!=null&&this.props.cdn!=null}load(){return I(this,null,function*(){pt(this.props,this.onLoad)})}render(){this.stylesheet||(this.stylesheet=document.createElement("style"),this.appendChild(this.stylesheet)),this.stylesheet.textContent=this.payload}};vt.register("feaas-stylesheet");function ie(t=this){let r,e=t.getAttribute("data");if(e!=null)try{r=typeof e=="string"?JSON.parse(e):{}}catch(n){}return{data:r!=null?r:{},library:t.getAttribute("library"),component:t.getAttribute("component"),version:t.getAttribute("version"),revision:t.getAttribute("revision"),hostname:t.getAttribute("hostname"),cdn:t.getContextAttribute("cdn"),template:t.getAttribute("template")}}var dt=class extends O{setData(e){this.set({data:e})}getProps(){return ie(this)}attributeChangedCallback(e,n,A){this.payload=void 0,this.needsRefresh=!0,super.attributeChangedCallback(e,n,A)}getOriginal(){let e=this.getAttribute("data-path-scope");if(!!e){for(var n=this;(n=n.previousElementSibling)&&n.getAttribute("data-path-scope")==e;)var A=n;return A}}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null&&this.props.component!=null&&this.props.version!=null}load(){return I(this,null,function*(){if(!this.getOriginal())try{ct(this.props,this.onLoad)}catch(e){console.error(`FEAAS: Could not fetch component: ${this.props.component}/${this.props.version}/${this.props.revision}`)}})}render(){if(Array.from(this.children).filter(e=>e.tagName!="BR").length>0&&!this.needsRefresh)tt(this,this.props.data);else{if(this.needsRefresh=!0,this.getOriginal())return;lt(this,this.payload,this.props.data)}}};dt.observedAttributes=["library","component","version","revision","hostname","cdn","template","data"];dt.register("feaas-component");function ae(t){let r=[];if(t){let e=t.ownerDocument.defaultView,n,A;for(;e!==window.top;){n=e.parent;for(let E=0;E<n.frames.length;E++)if(n.frames[E]===e){for(let S of n.document.getElementsByTagName("iframe"))if(S.contentWindow===e){A=S.getBoundingClientRect();let F=S.contentWindow.getComputedStyle(S);r.push({left:A.left+parseInt(F.borderLeftWidth),top:A.top+parseInt(F.borderTopWidth)})}e=n;break}}}return r.reduce((e,n)=>({left:e.left+n.left,top:e.top+n.top}),{left:0,top:0})}function ue(t=this){var r;return{context:HTMLElement,frontend:t==null?void 0:t.getContextAttribute("frontend"),src:(r=t==null?void 0:t.getAttribute("src"))!=null?r:"/assets/editor.js",library:t==null?void 0:t.getAttribute("library"),component:t==null?void 0:t.getAttribute("component"),version:t==null?void 0:t.getAttribute("version"),revision:(t==null?void 0:t.getAttribute("revision"))||"saved",hidden:(t==null?void 0:t.getAttribute("hidden"))!=null,for:t==null?void 0:t.getAttribute("for")}}var St=class extends O{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.getTarget=()=>document.querySelector("iframe").contentWindow.document.getElementById(this.props.for);this.onChromeMeasureElement=(e,n)=>(n==null&&(n=e.getBoundingClientRect()),e.ownerDocument==document?{left:n.left-this.bodyRect.left,top:n.top-this.bodyRect.top,width:n.width,height:n.height}:{left:n.left+this.framePoint.left-this.bodyRect.left,top:n.top+this.framePoint.top-this.bodyRect.top,width:n.width,height:n.height});this.onBeforeMeasure=e=>{e.memoized.focusable&&(this.framePoint=ae(e.memoized.focusable)),this.wrapperRect=this.wrapper.getBoundingClientRect(),this.bodyRect=this.wrapper.ownerDocument.body.parentElement.getBoundingClientRect()};this.onMeasure=()=>{};this.onPosition=({focusable:e,root:n})=>{let A=this.wrapper.querySelector(".editor-chrome"),E=this.wrapper.querySelector(".ui.overlays");e?(A.style.width=e.width+16*2+"px",A.style.height=e.height+16*1+64+"px",A.style.left=e.left-16+"px",A.style.top=e.top-64+"px",E&&(E.style.left=n.left+"px",E.style.top=n.top+"px")):(A.style.left="-1000px",A.style.top="-1000px")}}getProps(){return ue(this)}load(){return import(this.formatURL(this.props.src,this.props.frontend))}renderReact({children:e,component:n,version:A},{Editor:E,VersionStatusList:S,Version:F,EditorUIUndo:P,EditorUIMode:C,React:{useEffect:R,useMemo:w,useState:x},Chakra:{HStack:D,Box:M},Chrome:U,ReactDOM:at,useSDK:yt,useSlots:G,useModelObserver:ut}){if(!this.payload)return;let{sdk:et}=yt(),[_,Q]=x(),J=et.library;R(()=>Q(J.components.getItem(n)),[n,J]),R(()=>{_==null||_.versions.fetch()},[_]);let bt=w(this.getTarget,[this.props.for]),q=ut(_==null?void 0:_.versions),L=w(()=>(q==null?void 0:q.filter(W=>W.id==A||!A))||[],[q]);if(!!_)return G(e,({picker:W,children:X})=><M ref={B=>this.wrapper=B}><M className="editor-wrapper"position="absolute"left={0}top={0}><E sdk={et}library={et.library}component={_}versions={L}context={{onChromeMeasure:this.onMeasure,onChromeBeforeMeasure:this.onBeforeMeasure,onChromeMeasureElement:this.onChromeMeasureElement,onChromePosition:this.onPosition}}>{({editor:B,status:V,isArchivedDisplayed:K})=>({after:X,picker:W,chrome:B&&<U/>,children:_.reduceVersionRevisions(L).filter($=>{var z;return K||!((z=$.saved||$.draft)!=null&&z.deletedAt)}).map(($,z)=><M key={$.head.id}position="absolute"left={0}top={0}className="editor-chrome"p={4}boxShadow="2xl"pointerEvents="none"><M className="borders"pointerEvents="none"left={0}width="4"top={0}bottom={0}backdropFilter="blur(2px)"background="rgb(244 244 244 / 80%)"position="absolute"/><M className="borders"pointerEvents="none"right={0}width="4"top={0}bottom={0}backdropFilter="blur(2px)"background="rgb(244 244 244 / 80%)"position="absolute"/><M className="borders"pointerEvents="none"top={0}height="16"left={0}right={0}backdropFilter="blur(2px)"background="rgb(244 244 244 / 80%)"position="absolute"/><M className="borders"pointerEvents="none"bottom={0}height="4"left={0}right={0}backdropFilter="blur(2px)"background="rgb(244 244 244 / 80%)"position="absolute"/><F version={$.head}node={bt}>{{left:<D justifyContent="space-between"><P size="sm"editor={V=="ready"?B:null}/><C size="sm"/></D>,middle:<S/>}}</F></M>)})}</E></M></M>)}isReadyToLoad(){return this.props.component!=null&&this.props.version!=null}};St.register("feaas-editor");function ce(t=this){var r,e;return{part:(t==null?void 0:t.getAttribute("part"))||"picker",slot:(t==null?void 0:t.getAttribute("part"))||"slot",mode:t==null?void 0:t.getAttribute("mode"),frontend:(r=t==null?void 0:t.getContextAttribute("frontend"))!=null?r:"https://components.sitecorecloud.io",src:(e=t==null?void 0:t.getAttribute("src"))!=null?e:"/assets/picker.js",hidden:(t==null?void 0:t.getAttribute("hidden"))!=null,context:void 0,onClose:void 0}}var Ft=class extends O{getProps(){return ce(this)}load(){return import(this.formatURL(this.props.src,this.props.frontend))}renderReact({context:r,mode:e,children:n},{Picker:A,React:E,ReactDOM:S}){return<A mode={e||void 0}onClose={this.props.onClose}context={r}>{n}</A>}};Ft.register("feaas-picker");function pe(t=this){var r,e;return{library:(t==null?void 0:t.getAttribute("library"))||"library",mode:t==null?void 0:t.getAttribute("mode"),frontend:(r=t==null?void 0:t.getContextAttribute("frontend"))!=null?r:"https://components.sitecorecloud.io",src:(e=t==null?void 0:t.getAttribute("src"))!=null?e:"/assets/picker.js",hidden:(t==null?void 0:t.getAttribute("hidden"))!=null,context:null,getToken:null}}var Pt=class extends O{constructor(){super(...arguments);this.payload=null;this.onClose=()=>{this.setAttribute("hidden","hidden")}}getProps(){return pe(this)}render(){let{frontend:e,library:n,getToken:A,src:E,mode:S,context:F}=this.props;this.children.length==0&&(this.innerHTML=`
67
+ </div>`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}};K.observedAttributes=["hidden"];K.register("feaas-loader");function Wt(t=this){var r;return{library:t==null?void 0:t.getContextAttribute("library"),revision:(r=t==null?void 0:t.getAttribute("revision"))!=null?r:"published",cdn:t==null?void 0:t.getContextAttribute("cdn")}}var ot=class extends m{getProps(){return Wt(this)}isReadyToLoad(){return this.props.library!=null&&this.props.revision!=null&&this.props.cdn!=null}load(){return v(this,null,function*(){V(this.props,this.onLoad)})}render(){this.stylesheet||(this.stylesheet=document.createElement("style"),this.appendChild(this.stylesheet)),this.stylesheet.textContent=this.payload}};ot.register("feaas-stylesheet");function zt(t=this){let r,e=t.getAttribute("data");if(e!=null)try{r=typeof e=="string"?JSON.parse(e):{}}catch(n){}return{data:r!=null?r:{},library:t.getAttribute("library"),component:t.getAttribute("component"),version:t.getAttribute("version"),revision:t.getAttribute("revision"),hostname:t.getAttribute("hostname"),cdn:t.getContextAttribute("cdn"),template:t.getAttribute("template")}}var Y=class extends m{setData(e){this.set({data:e})}getProps(){return zt(this)}attributeChangedCallback(e,n,o){this.payload=void 0,this.needsRefresh=!0,super.attributeChangedCallback(e,n,o)}getOriginal(){let e=this.getAttribute("data-path-scope");if(!!e){for(var n=this;(n=n.previousElementSibling)&&n.getAttribute("data-path-scope")==e;)var o=n;return o}}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null&&this.props.component!=null&&this.props.version!=null}load(){return v(this,null,function*(){if(!this.getOriginal())try{q(this.props,this.onLoad)}catch(e){console.error(`FEAAS: Could not fetch component: ${this.props.component}/${this.props.version}/${this.props.revision}`)}})}render(){if(Array.from(this.children).filter(e=>e.tagName!="BR").length>0&&!this.needsRefresh)B(this,this.props.data);else{if(this.needsRefresh=!0,this.getOriginal())return;X(this,this.payload,this.props.data)}}};Y.observedAttributes=["library","component","version","revision","hostname","cdn","template","data"];Y.register("feaas-component");function Ut(t){let r=[];if(t){let e=t.ownerDocument.defaultView,n,o;for(;e!==window.top;){n=e.parent;for(let s=0;s<n.frames.length;s++)if(n.frames[s]===e){for(let i of n.document.getElementsByTagName("iframe"))if(i.contentWindow===e){o=i.getBoundingClientRect();let a=i.contentWindow.getComputedStyle(i);r.push({left:o.left+parseInt(a.borderLeftWidth),top:o.top+parseInt(a.borderTopWidth)})}e=n;break}}}return r.reduce((e,n)=>({left:e.left+n.left,top:e.top+n.top}),{left:0,top:0})}function Jt(t=this){var r;return{context:HTMLElement,frontend:t==null?void 0:t.getContextAttribute("frontend"),src:(r=t==null?void 0:t.getAttribute("src"))!=null?r:"/assets/editor.js",library:t==null?void 0:t.getAttribute("library"),component:t==null?void 0:t.getAttribute("component"),version:t==null?void 0:t.getAttribute("version"),revision:(t==null?void 0:t.getAttribute("revision"))||"saved",hidden:(t==null?void 0:t.getAttribute("hidden"))!=null,for:t==null?void 0:t.getAttribute("for")}}var st=class extends m{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.getTarget=()=>document.querySelector("iframe").contentWindow.document.getElementById(this.props.for);this.onChromeMeasureElement=(e,n)=>(n==null&&(n=e.getBoundingClientRect()),e.ownerDocument==document?{left:n.left-this.bodyRect.left,top:n.top-this.bodyRect.top,width:n.width,height:n.height}:{left:n.left+this.framePoint.left-this.bodyRect.left,top:n.top+this.framePoint.top-this.bodyRect.top,width:n.width,height:n.height});this.onBeforeMeasure=e=>{e.memoized.focusable&&(this.framePoint=Ut(e.memoized.focusable)),this.wrapperRect=this.wrapper.getBoundingClientRect(),this.bodyRect=this.wrapper.ownerDocument.body.parentElement.getBoundingClientRect()};this.onMeasure=()=>{};this.onPosition=({focusable:e,root:n})=>{let o=this.wrapper.querySelector(".editor-chrome"),s=this.wrapper.querySelector(".ui.overlays");e?(o.style.width=e.width+16*2+"px",o.style.height=e.height+16*1+64+"px",o.style.left=e.left-16+"px",o.style.top=e.top-64+"px",s&&(s.style.left=n.left+"px",s.style.top=n.top+"px")):(o.style.left="-1000px",o.style.top="-1000px")}}getProps(){return Jt(this)}load(){return import(this.formatURL(this.props.src,this.props.frontend))}renderReact({children:e,component:n,version:o},{Editor:s,VersionStatusList:i,Version:a,EditorUIUndo:u,EditorUIMode:l,React:{useEffect:c,useMemo:p,useState:h},Chakra:{HStack:y,Box:f},Chrome:C,ReactDOM:U,useSDK:Q,useSlots:_,useModelObserver:J}){if(!this.payload)return;let{sdk:I}=Q(),[g,O]=h(),x=I.library;c(()=>O(x.components.getItem(n)),[n,x]),c(()=>{g==null||g.versions.fetch()},[g]);let Z=p(this.getTarget,[this.props.for]),T=J(g==null?void 0:g.versions),b=p(()=>(T==null?void 0:T.filter(R=>R.id==o||!o))||[],[T]);if(!!g)return _(e,({picker:R,children:M})=>React.createElement(f,{ref:E=>this.wrapper=E},React.createElement(f,{className:"editor-wrapper",position:"absolute",left:0,top:0},React.createElement(s,{sdk:I,library:I.library,component:g,versions:b,context:{onChromeMeasure:this.onMeasure,onChromeBeforeMeasure:this.onBeforeMeasure,onChromeMeasureElement:this.onChromeMeasureElement,onChromePosition:this.onPosition}},({editor:E,status:k,isArchivedDisplayed:D})=>({after:M,picker:R,chrome:E&&React.createElement(C,null),children:g.reduceVersionRevisions(b).filter(S=>{var w;return D||!((w=S.saved||S.draft)!=null&&w.deletedAt)}).map((S,w)=>React.createElement(f,{key:S.head.id,position:"absolute",left:0,top:0,className:"editor-chrome",p:4,boxShadow:"2xl",pointerEvents:"none"},React.createElement(f,{className:"borders",pointerEvents:"none",left:0,width:"4",top:0,bottom:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),React.createElement(f,{className:"borders",pointerEvents:"none",right:0,width:"4",top:0,bottom:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),React.createElement(f,{className:"borders",pointerEvents:"none",top:0,height:"16",left:0,right:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),React.createElement(f,{className:"borders",pointerEvents:"none",bottom:0,height:"4",left:0,right:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),React.createElement(a,{version:S.head,node:Z},{left:React.createElement(y,{justifyContent:"space-between"},React.createElement(u,{size:"sm",editor:k=="ready"?E:null}),React.createElement(l,{size:"sm"})),middle:React.createElement(i,null)})))})))))}isReadyToLoad(){return this.props.component!=null&&this.props.version!=null}};st.register("feaas-editor");function qt(t=this){var r,e;return{part:(t==null?void 0:t.getAttribute("part"))||"picker",slot:(t==null?void 0:t.getAttribute("part"))||"slot",mode:t==null?void 0:t.getAttribute("mode"),frontend:(r=t==null?void 0:t.getContextAttribute("frontend"))!=null?r:"https://components.sitecorecloud.io",src:(e=t==null?void 0:t.getAttribute("src"))!=null?e:"/assets/picker.js",hidden:(t==null?void 0:t.getAttribute("hidden"))!=null,context:void 0,onClose:void 0}}var it=class extends m{getProps(){return qt(this)}load(){return import(this.formatURL(this.props.src,this.props.frontend))}renderReact({context:r,mode:e,children:n},{Picker:o,React:s,ReactDOM:i}){return s.createElement(o,{mode:e||void 0,onClose:this.props.onClose,context:r},n)}};it.register("feaas-picker");function Vt(t=this){var r,e;return{library:(t==null?void 0:t.getAttribute("library"))||"library",mode:t==null?void 0:t.getAttribute("mode"),frontend:(r=t==null?void 0:t.getContextAttribute("frontend"))!=null?r:"https://components.sitecorecloud.io",src:(e=t==null?void 0:t.getAttribute("src"))!=null?e:"/assets/picker.js",hidden:(t==null?void 0:t.getAttribute("hidden"))!=null,context:null,getToken:null}}var at=class extends m{constructor(){super(...arguments);this.payload=null;this.onClose=()=>{this.setAttribute("hidden","hidden")}}getProps(){return Vt(this)}render(){let{frontend:e,library:n,getToken:o,src:s,mode:i,context:a}=this.props;this.children.length==0&&(this.innerHTML=`
68
68
  <feaas-context src='/components/providers/ContextProvider.tsx' library='${n}'>
69
- <feaas-picker mode='${S}'>
69
+ <feaas-picker mode='${i}'>
70
70
  <feaas-loader />
71
71
  </feaas-context>
72
- `),this.refs.context.set({frontend:e,library:n,getToken:A}),this.refs.picker.set({frontend:e,context:F,src:E,mode:S,onClose:this.onClose})}};Pt.register("feaas-picker-lazy");function le(t=this){var r,e,n,A;return{library:t==null?void 0:t.getAttribute("library"),src:(r=t==null?void 0:t.getAttribute("src"))!=null?r:"/assets/context.js",frontend:(e=t==null?void 0:t.getAttribute("frontend"))!=null?e:"https://components.sitecoreclud.io",backend:(n=t==null?void 0:t.getAttribute("backend"))!=null?n:"https://components-api.sitecoreclud.io",cdn:(A=t==null?void 0:t.getAttribute("cdn"))!=null?A:"https://feaascompontsapiprod.blob.core.windows.net",getToken:null}}var ft=class extends O{getProps(){return le(this)}load(){return import(this.formatURL(this.props.src,this.props.frontend))}getTheme(e){return e}getRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}getReactRoot(){return this.reactRoot||(this.reactRoot=document.createElement("div"),this.getRoot().appendChild(this.reactRoot)),this.reactRoot}adoptedCallback(e){super.adoptedCallback(e);let n=e.composedPath()[0];n.parentNode!=this.getRoot()&&this.getRoot().appendChild(n)}renderReact({children:e,library:n},{AppContext:A,Chakra:{Button:E,Tooltip:S},React:{useRef:F}}){return S.defaultProps={hasArrow:!0,placement:"top",portalProps:{containerRef:{current:this.getRoot()}}},<A libraryId={this.props.library}container={this.getRoot()}getTheme={this.getTheme}modalProps={{portalProps:{containerRef:{current:this.getRoot()}}}}chakraProps={{cssVarsRoot:":host",resetCSS:!0,toastOptions:{portalProps:{containerRef:{current:this.getRoot()}}}}}>{e}</A>}};ft.observedAttributes=["library","component","version","revision","hostname","template"];ft.register("feaas-context");export{dt as FEAASComponent,ie as FEAASComponentsProps,ft as FEAASContext,le as FEAASContextProps,St as FEAASEditor,ue as FEAASEditorProps,ht as FEAASLoader,Ce as FEAASLoaderProps,Ft as FEAASPicker,Pt as FEAASPickerLazy,pe as FEAASPickerLazyProps,ce as FEAASPickerProps,vt as FEAASStylesheet,se as FEAASStylesheetProps,re as autoloadScripts,Qt as cleanCollectionBit,At as fetchAndRevalidate,ae as getFramePosition,Et as loadScript,Zt as normalizeCollectionScope,ee as observeDOMElement,kt as queryScopes,Fe as renderComponent,ve as renderComponentElement,oe as renderComponentPromise,lt as renderDOMContent,tt as renderDOMElement,Se as renderStylesheet,ne as renderStylesheetPromise,it as setDOMAttribute};
72
+ `),this.refs.context.set({frontend:e,library:n,getToken:o}),this.refs.picker.set({frontend:e,context:a,src:s,mode:i,onClose:this.onClose})}};at.register("feaas-picker-lazy");function Xt(t=this){var r,e,n,o;return{library:t==null?void 0:t.getAttribute("library"),src:(r=t==null?void 0:t.getAttribute("src"))!=null?r:"/assets/context.js",frontend:(e=t==null?void 0:t.getAttribute("frontend"))!=null?e:"https://components.sitecoreclud.io",backend:(n=t==null?void 0:t.getAttribute("backend"))!=null?n:"https://components-api.sitecoreclud.io",cdn:(o=t==null?void 0:t.getAttribute("cdn"))!=null?o:"https://feaascompontsapiprod.blob.core.windows.net",getToken:null}}var G=class extends m{getProps(){return Xt(this)}load(){return import(this.formatURL(this.props.src,this.props.frontend))}getTheme(e){return e}getRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}getReactRoot(){return this.reactRoot||(this.reactRoot=document.createElement("div"),this.getRoot().appendChild(this.reactRoot)),this.reactRoot}adoptedCallback(e){super.adoptedCallback(e);let n=e.composedPath()[0];n.parentNode!=this.getRoot()&&this.getRoot().appendChild(n)}renderReact({children:e,library:n},{AppContext:o,Chakra:{Button:s,Tooltip:i},React:{useRef:a}}){return i.defaultProps={hasArrow:!0,placement:"top",portalProps:{containerRef:{current:this.getRoot()}}},React.createElement(o,{libraryId:this.props.library,container:this.getRoot(),getTheme:this.getTheme,modalProps:{portalProps:{containerRef:{current:this.getRoot()}}},chakraProps:{cssVarsRoot:":host",resetCSS:!0,toastOptions:{portalProps:{containerRef:{current:this.getRoot()}}}}},e)}};G.observedAttributes=["library","component","version","revision","hostname","template"];G.register("feaas-context");export{Y as FEAASComponent,zt as FEAASComponentsProps,G as FEAASContext,Xt as FEAASContextProps,st as FEAASEditor,Jt as FEAASEditorProps,K as FEAASLoader,pe as FEAASLoaderProps,it as FEAASPicker,at as FEAASPickerLazy,Vt as FEAASPickerLazyProps,qt as FEAASPickerProps,ot as FEAASStylesheet,Wt as FEAASStylesheetProps,$t as autoloadScripts,Ot as cleanCollectionBit,rt as fetchAndRevalidate,Ut as getFramePosition,nt as loadScript,Ht as normalizeCollectionScope,It as observeDOMElement,dt as queryScopes,ie as renderComponent,oe as renderComponentElement,jt as renderComponentPromise,X as renderDOMContent,B as renderDOMElement,se as renderStylesheet,Nt as renderStylesheetPromise,z as setDOMAttribute};
@@ -1274,10 +1274,7 @@ var FEAASBase = class extends HTMLElement {
1274
1274
  const { React, ReactDOM } = target.payload || {};
1275
1275
  const [value, forceUpdateReact] = React.useReducer((r) => r + 1, 0);
1276
1276
  target.forceUpdateReact = forceUpdateReact;
1277
- return ReactDOM.createPortal(
1278
- React.createElement(React.Fragment, null, target.invokeReactRendering()),
1279
- target.getReactRoot()
1280
- );
1277
+ return ReactDOM.createPortal(/* @__PURE__ */ React.createElement(React.Fragment, null, target.invokeReactRendering()), target.getReactRoot());
1281
1278
  } else {
1282
1279
  return target.render();
1283
1280
  }
@@ -1232,10 +1232,7 @@ var FEAASBase = class extends HTMLElement {
1232
1232
  const { React, ReactDOM } = target.payload || {};
1233
1233
  const [value, forceUpdateReact] = React.useReducer((r) => r + 1, 0);
1234
1234
  target.forceUpdateReact = forceUpdateReact;
1235
- return ReactDOM.createPortal(
1236
- React.createElement(React.Fragment, null, target.invokeReactRendering()),
1237
- target.getReactRoot()
1238
- );
1235
+ return ReactDOM.createPortal(/* @__PURE__ */ React.createElement(React.Fragment, null, target.invokeReactRendering()), target.getReactRoot());
1239
1236
  } else {
1240
1237
  return target.render();
1241
1238
  }