@sitecore-feaas/clientside 0.1.8 → 0.1.10

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 z=Object.defineProperty,Ft=Object.defineProperties,St=Object.getOwnPropertyDescriptor,wt=Object.getOwnPropertyDescriptors,Rt=Object.getOwnPropertyNames,nt=Object.getOwnPropertySymbols;var it=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable;var at=(t,r,e)=>r in t?z(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,v=(t,r)=>{for(var e in r||(r={}))it.call(r,e)&&at(t,e,r[e]);if(nt)for(var e of nt(r))Ct.call(r,e)&&at(t,e,r[e]);return t},w=(t,r)=>Ft(t,wt(r));var Pt=(t,r)=>{for(var e in r)z(t,e,{get:r[e],enumerable:!0})},Tt=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Rt(r))!it.call(t,a)&&a!==e&&z(t,a,{get:()=>r[a],enumerable:!(n=St(r,a))||n.enumerable});return t};var Dt=t=>Tt(z({},"__esModule",{value:!0}),t);var g=(t,r,e)=>new Promise((n,a)=>{var i=u=>{try{o(e.next(u))}catch(h){a(h)}},s=u=>{try{o(e.throw(u))}catch(h){a(h)}},o=u=>u.done?n(u.value):Promise.resolve(u.value).then(i,s);o((e=e.apply(t,r)).next())});var Xt={};Pt(Xt,{FEAASComponent:()=>U,FEAASComponentsProps:()=>gt,FEAASLoader:()=>I,FEAASLoaderProps:()=>Kt,FEAASStylesheet:()=>Y,FEAASStylesheetProps:()=>bt,autoloadScripts:()=>dt,cleanCollectionBit:()=>ct,fetchAndRevalidate:()=>q,loadScript:()=>X,normalizeCollectionScope:()=>ht,observeDOMElement:()=>ft,queryScopes:()=>et,renderComponent:()=>Vt,renderComponentElement:()=>Wt,renderComponentPromise:()=>mt,renderDOMContent:()=>j,renderDOMElement:()=>R,renderStylesheet:()=>qt,renderStylesheetPromise:()=>yt,setDOMAttribute:()=>_});module.exports=Dt(Xt);function E(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?E=function(r){return typeof r}:E=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},E(t)}function _t(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function xt(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&&N(t,r)}function B(t){return B=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},B(t)}function N(t,r){return N=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},N(t,r)}function ot(){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 $(t,r,e){return ot()?$=Reflect.construct:$=function(a,i,s){var o=[null];o.push.apply(o,i);var u=Function.bind.apply(a,o),h=new u;return s&&N(h,s.prototype),h},$.apply(null,arguments)}function Mt(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Z(t){var r=typeof Map=="function"?new Map:void 0;return Z=function(n){if(n===null||!Mt(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 $(n,arguments,B(this).constructor)}return a.prototype=Object.create(n.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),N(a,n)},Z(t)}function Lt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ot(t,r){return r&&(typeof r=="object"||typeof r=="function")?r:Lt(t)}function kt(t){var r=ot();return function(){var n=B(t),a;if(r){var i=B(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return Ot(this,a)}}function st(t){return Ht(t)||$t(t)||ut(t)||Bt()}function Ht(t){if(Array.isArray(t))return tt(t)}function $t(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ut(t,r){if(!!t){if(typeof t=="string")return tt(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 tt(t,r)}}function tt(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 Bt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ var z=Object.defineProperty,Ft=Object.defineProperties,St=Object.getOwnPropertyDescriptor,wt=Object.getOwnPropertyDescriptors,Rt=Object.getOwnPropertyNames,nt=Object.getOwnPropertySymbols;var it=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable;var at=(t,r,e)=>r in t?z(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,v=(t,r)=>{for(var e in r||(r={}))it.call(r,e)&&at(t,e,r[e]);if(nt)for(var e of nt(r))Ct.call(r,e)&&at(t,e,r[e]);return t},w=(t,r)=>Ft(t,wt(r));var Pt=(t,r)=>{for(var e in r)z(t,e,{get:r[e],enumerable:!0})},Tt=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Rt(r))!it.call(t,a)&&a!==e&&z(t,a,{get:()=>r[a],enumerable:!(n=St(r,a))||n.enumerable});return t};var Dt=t=>Tt(z({},"__esModule",{value:!0}),t);var g=(t,r,e)=>new Promise((n,a)=>{var i=u=>{try{o(e.next(u))}catch(h){a(h)}},s=u=>{try{o(e.throw(u))}catch(h){a(h)}},o=u=>u.done?n(u.value):Promise.resolve(u.value).then(i,s);o((e=e.apply(t,r)).next())});var Xt={};Pt(Xt,{FEAASComponent:()=>U,FEAASComponentsProps:()=>gt,FEAASLoader:()=>I,FEAASLoaderProps:()=>Kt,FEAASStylesheet:()=>Y,FEAASStylesheetProps:()=>bt,autoloadScripts:()=>dt,cleanCollectionBit:()=>ct,fetchAndRevalidate:()=>q,loadScript:()=>X,normalizeCollectionScope:()=>ht,observeDOMElement:()=>ft,queryScopes:()=>et,renderComponent:()=>Vt,renderComponentElement:()=>Wt,renderComponentPromise:()=>mt,renderDOMContent:()=>j,renderDOMElement:()=>R,renderStylesheet:()=>qt,renderStylesheetPromise:()=>yt,setDOMAttribute:()=>_});module.exports=Dt(Xt);function A(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?A=function(r){return typeof r}:A=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},A(t)}function _t(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function xt(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&&N(t,r)}function B(t){return B=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},B(t)}function N(t,r){return N=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},N(t,r)}function ot(){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 $(t,r,e){return ot()?$=Reflect.construct:$=function(a,i,s){var o=[null];o.push.apply(o,i);var u=Function.bind.apply(a,o),h=new u;return s&&N(h,s.prototype),h},$.apply(null,arguments)}function Mt(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Z(t){var r=typeof Map=="function"?new Map:void 0;return Z=function(n){if(n===null||!Mt(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 $(n,arguments,B(this).constructor)}return a.prototype=Object.create(n.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),N(a,n)},Z(t)}function Lt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ot(t,r){return r&&(typeof r=="object"||typeof r=="function")?r:Lt(t)}function kt(t){var r=ot();return function(){var n=B(t),a;if(r){var i=B(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return Ot(this,a)}}function st(t){return Ht(t)||$t(t)||ut(t)||Bt()}function Ht(t){if(Array.isArray(t))return tt(t)}function $t(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ut(t,r){if(!!t){if(typeof t=="string")return tt(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 tt(t,r)}}function tt(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 Bt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nt(t,r){var e=typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=ut(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(u){throw u},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 i=!0,s=!1,o;return{s:function(){e=e.call(t)},n:function(){var u=e.next();return i=u.done,u},e:function(u){s=!0,o=u},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(s)throw o}}}}var b=Object.prototype.hasOwnProperty;function H(t,r){return t=t.slice(),t.push(r),t}function D(t,r){return r=r.slice(),r.unshift(t),r}var jt=function(t){xt(e,t);var r=kt(e);function e(n){var a;return _t(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}(Z(Error));function f(t,r,e,n,a){if(!(this instanceof f))try{return new f(t,r,e,n,a)}catch(u){if(!u.avoidNew)throw u;return u.value}typeof t=="string"&&(a=n,n=e,e=r,r=t,t=null);var i=t&&E(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=b.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:i?t.path:r};i?"json"in t&&(s.json=t.json):s.json=e;var o=this.evaluate(s);if(!o||E(o)!=="object")throw new jt(o);return o}}f.prototype.evaluate=function(t,r,e,n){var a=this,i=this.parent,s=this.parentProperty,o=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&&E(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(!b.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var h=t;r=h.json,o=b.call(t,"flatten")?t.flatten:o,this.currResultType=b.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=b.call(t,"sandbox")?t.sandbox:this.currSandbox,u=b.call(t,"wrap")?t.wrap:u,this.currPreventEval=b.call(t,"preventEval")?t.preventEval:this.currPreventEval,e=b.call(t,"callback")?t.callback:e,this.currOtherTypeCallback=b.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,i=b.call(t,"parent")?t.parent:i,s=b.call(t,"parentProperty")?t.parentProperty:s,t=t.path}if(i=i||null,s=s||null,Array.isArray(t)&&(t=f.toPathString(t)),!(!t&&t!==""||!r)){var l=f.toPathArray(t);l[0]==="$"&&l.length>1&&l.shift(),this._hasParentSelector=null;var c=this._trace(l,r,["$"],i,s,e).filter(function(p){return p&&!p.isParentSelector});return c.length?!u&&c.length===1&&!c[0].hasArrExpr?this._getPreferredOutput(c[0]):c.reduce(function(p,d){var y=a._getPreferredOutput(d);return o&&Array.isArray(y)?p=p.concat(y):p.push(y),p},[]):u?[]:void 0}};f.prototype._getPreferredOutput=function(t){var r=this.currResultType;switch(r){case"all":{var e=Array.isArray(t.path)?t.path:f.toPathArray(t.path);return t.pointer=f.toPointer(e),t.path=typeof t.path=="string"?t.path:f.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[r];case"path":return f.toPathString(t[r]);case"pointer":return f.toPointer(t.path);default:throw new TypeError("Unknown result type")}};f.prototype._handleCallback=function(t,r,e){if(r){var n=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:f.toPathString(t.path),r(n,e,t)}};f.prototype._trace=function(t,r,e,n,a,i,s,o){var u=this,h;if(!t.length)return h={path:e,value:r,parent:n,parentProperty:a,hasArrExpr:s},this._handleCallback(h,i,"value"),h;var l=t[0],c=t.slice(1),p=[];function d(m){Array.isArray(m)?m.forEach(function(P){p.push(P)}):p.push(m)}if((typeof l!="string"||o)&&r&&b.call(r,l))d(this._trace(c,r[l],H(e,l),r,l,i,s));else if(l==="*")this._walk(l,c,r,e,n,a,i,function(m,P,M,A,T,L,O,k){d(u._trace(D(m,M),A,T,L,O,k,!0,!0))});else if(l==="..")d(this._trace(c,r,e,n,a,i,s)),this._walk(l,c,r,e,n,a,i,function(m,P,M,A,T,L,O,k){E(A[m])==="object"&&d(u._trace(D(P,M),A[m],H(T,m),A,m,k,!0))});else{if(l==="^")return this._hasParentSelector=!0,{path:e.slice(0,-1),expr:c,isParentSelector:!0};if(l==="~")return h={path:H(e,l),value:a,parent:n,parentProperty:null},this._handleCallback(h,i,"property"),h;if(l==="$")d(this._trace(c,r,e,null,null,i,s));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(l))d(this._slice(l,c,r,e,n,a,i));else if(l.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");this._walk(l,c,r,e,n,a,i,function(m,P,M,A,T,L,O,k){u._eval(P.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1"),A[m],m,T,L,O)&&d(u._trace(D(m,M),A,T,L,O,k,!0))})}else if(l[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");d(this._trace(D(this._eval(l,r,e[e.length-1],e.slice(0,-1),n,a),c),r,e,n,a,i,s))}else if(l[0]==="@"){var y=!1,C=l.slice(1,-2);switch(C){case"scalar":(!r||!["object","function"].includes(E(r)))&&(y=!0);break;case"boolean":case"string":case"undefined":case"function":E(r)===C&&(y=!0);break;case"integer":Number.isFinite(r)&&!(r%1)&&(y=!0);break;case"number":Number.isFinite(r)&&(y=!0);break;case"nonFinite":typeof r=="number"&&!Number.isFinite(r)&&(y=!0);break;case"object":r&&E(r)===C&&(y=!0);break;case"array":Array.isArray(r)&&(y=!0);break;case"other":y=this.currOtherTypeCallback(r,e,n,a);break;case"null":r===null&&(y=!0);break;default:throw new TypeError("Unknown value type "+C)}if(y)return h={path:e,value:r,parent:n,parentProperty:a},this._handleCallback(h,i,"value"),h}else if(l[0]==="`"&&r&&b.call(r,l.slice(1))){var G=l.slice(1);d(this._trace(c,r[G],H(e,G),r,G,i,s,!0))}else if(l.includes(",")){var vt=l.split(","),J=Nt(vt),rt;try{for(J.s();!(rt=J.n()).done;){var Et=rt.value;d(this._trace(D(Et,c),r,e,n,a,i,!0))}}catch(m){J.e(m)}finally{J.f()}}else!o&&r&&b.call(r,l)&&d(this._trace(c,r[l],H(e,l),r,l,i,s,!0))}if(this._hasParentSelector)for(var S=0;S<p.length;S++){var W=p[S];if(W&&W.isParentSelector){var x=this._trace(W.expr,r,W.path,n,a,i,s);if(Array.isArray(x)){p[S]=x[0];for(var At=x.length,Q=1;Q<At;Q++)S++,p.splice(S,0,x[Q])}else p[S]=x}}return p};f.prototype._walk=function(t,r,e,n,a,i,s,o){if(Array.isArray(e))for(var u=e.length,h=0;h<u;h++)o(h,t,r,e,n,a,i,s);else e&&E(e)==="object"&&Object.keys(e).forEach(function(l){o(l,t,r,e,n,a,i,s)})};f.prototype._slice=function(t,r,e,n,a,i,s){if(!!Array.isArray(e)){var o=e.length,u=t.split(":"),h=u[2]&&Number.parseInt(u[2])||1,l=u[0]&&Number.parseInt(u[0])||0,c=u[1]&&Number.parseInt(u[1])||o;l=l<0?Math.max(0,l+o):Math.min(o,l),c=c<0?Math.max(0,c+o):Math.min(o,c);for(var p=[],d=l;d<c;d+=h){var y=this._trace(D(d,r),e,n,a,i,s,!0);y.forEach(function(C){p.push(C)})}return p}};f.prototype._eval=function(t,r,e,n,a,i){t.includes("@parentProperty")&&(this.currSandbox._$_parentProperty=i,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=f.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)}};f.cache={};f.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};f.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};f.toPathArray=function(t){var r=f.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(i,s){return"[#"+(e.push(s)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(i,s){return"['"+s.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(i,s){return";"+s.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),a=n.split(";").map(function(i){var s=i.match(/#([0-9]+)/);return!s||!s[1]?i:e[s[1]]});return r[t]=a,r[t].concat()};var It=function(r,e,n){for(var a=r.length,i=0;i<a;i++){var s=r[i];n(s)&&e.push(r.splice(i--,1)[0])}};f.prototype.vm={runInNewContext:function(r,e){var n=Object.keys(e),a=[];It(n,a,function(h){return typeof e[h]=="function"});var i=n.map(function(h,l){return e[h]}),s=a.reduce(function(h,l){var c=e[l].toString();return/function/.test(c)||(c="function "+c),"var "+l+"="+c+";"+h},"");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 o=r.lastIndexOf(";"),u=o>-1?r.slice(0,o+1)+" return "+r.slice(o+1):" return "+r;return $(Function,st(n).concat([u])).apply(void 0,st(i))}};function q(t,r,e,n){return g(this,null,function*(){let a=new Date,i=yield fetch(t,r);if(!i.ok)throw new Error("Fetch failed");let s=new Date(i.headers.get("date"));var o=i;if(n(i,"cached"),s<a){let u=yield fetch(t+"?"+Math.random(),w(v({},r),{method:"HEAD",cache:"no-cache"}));if(u.headers.get("last-modified")!=i.headers.get("last-modified")){if(e(u)===!1)throw new Error("Response is stale");o=yield fetch(t,w(v({},r),{cache:"reload"}))}}if(e(o)===!1)throw new Error("Response is not valid");return i!==o&&n(o,"valid"),o})}function Ut({cdn:t="https://feaascomponentsapidev.blob.core.windows.net",hostname:r,library:e,component:n,version:a,revision:i="published"}){return`${t||r}/components/${e}/${n}/${a}/${i}.html`}function Jt({cdn:t="https://feaascomponentsapidev.blob.core.windows.net",hostname:r,library:e,revision:n="published"}){return`${t||r}/styles/${e}/${n}.css`}function V(t,r){return g(this,null,function*(){return q(Ut(t),{},e=>e.headers.get("x-ms-meta-versionDeletedAt")==null,e=>{e.text().then(r)})})}function K(t,r){return g(this,null,function*(){return q(Jt(t),{},e=>e.headers.get("x-ms-meta-deletedAt")==null,e=>{e.text().then(r)})})}function Wt(t,r){let e=document.createElement("div");e.innerHTML=t;let n=document.createDocumentFragment();for(;e.firstChild;)n.appendChild(e.firstChild);return R(n,r),e}function ct(t){return t.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function ht(t){return ct(t)+".*"}function pt(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 zt(t,r,e){let n=t.getAttribute("data-path-scope");if(n==null)return;var a=pt(t);if(a!=0)return;let i=t.parentElement;if(i!=null){r==0?t.style.display="none":t.style.display&&(t.style.display="",t.getAttribute("style")==""&&t.removeAttribute("style"));for(var s=a+1,o=t,u=t;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(s++,o=u);for(var h=s;h<r;h++)i.insertBefore(o.cloneNode(!0),o.nextElementSibling);for(var h=Math.max(1,r);h<s;h++)o=o.previousElementSibling,i.removeChild(o.nextElementSibling)}}function et(t,r,e=!1,n=t){var a=r;let i=Object.keys(t).sort((o,u)=>u.length-o.length);for(let o of i)if(r.startsWith(o)){if(o==r){if(e)return t[o];continue}a=r.substring(o.length+1),n=t[o];break}let s=f({path:a,json:n});return e&&s&&Array.isArray(s)?s[0]:s}function _(t,r,e,n){var l;if(!!t){var a=t;n!=null&&n.processValue&&(e=n==null?void 0:n.processValue(t,r,e));var i=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")i="innerHTML";else if(r=="data-embed-src")X(t,e);else if(r=="data-path-attributes"){let c=((l=t.getAttribute("data-attributes-keys"))==null?void 0:l.split(",").filter(Boolean))||[];for(var s in e){var o=e[s];_(t,s,typeof o=="object"&&o?JSON.stringify(o):o,n)}for(var u=0;u<c.length;u++)(e==null||!(c[u]in e))&&_(t,c[u],null,n);_(t,"data-attributes-keys",Object.keys(e||{}).join(","));return}if(typeof e=="boolean"&&(e=e?"":null),!!a){var h=String(t.getAttribute("data-path-placeholder")||a[i]);e!=null?i=="innerHTML"?a.innerHTML!=e&&(a.innerHTML=e):a.getAttribute(i)!=e&&a.setAttribute(i,e):i=="innerHTML"?a.innerHTML=h:a.removeAttribute(i)}}}function ft(t){let r=new t.ownerDocument.defaultView.MutationObserver(e=>{e.forEach(n=>{let a=n.target,i=a.getAttribute("data-embed-src");i&&X(a,i),n.addedNodes&&n.addedNodes.forEach(s=>{s.nodeType==1&&dt(s,!1)})})});return r.observe(t,{attributes:!0,subtree:!0,childList:!0}),r}function dt(t,r=!0){let e=t.querySelectorAll("[data-embed-src]");for(var n=0;n<e.length;n++){let a=e[n];X(a,a.getAttribute("data-embed-src"))}if(r)return ft(t)}function X(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 i=e.ownerDocument.createElement("script");i.type="module",i.src=r,e.appendChild(i);break}}var lt=["data-attributes-keys","data-path-attributes","data-path-scope"];function R(t,r,e,n){var s,o,u;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 h=a.getAttribute("data-path-scope");if(h){let c=pt(a),p=et(r,h,!1)||[];c==0&&zt(a,((o=e==null?void 0:e.shouldRepeat)==null?void 0:o.call(e,a,p))===!1?1:p.length,e),r=w(v({},r),{[ht(h)]:p[c]})}let l=Array.prototype.slice.call(a.attributes).sort((c,p)=>lt.indexOf(c.name)-lt.indexOf(p.name));for(var i=0;i<l.length;i++){let{name:c,value:p}=l[i];c.startsWith("data-path")&&c!="data-path-scope"&&_(a,c,et(r,p,!0),e),c=="data-embed-src"&&_(a,c,a.getAttribute(c),e)}}for(var i=0;i<a.children.length;i++)R(a.children[i],r,e,!0);return n||(u=e==null?void 0:e.onRender)==null||u.call(e,a,r),a}function j(t,r,e,n){var i;let a=((i=n==null?void 0:n.processTemplate)==null?void 0:i.call(n,t,r,e))||r;return t.innerHTML=a,t.classList.add("-feaas"),R(t,e,n)}function qt(t,r){return yt(t,r||(r=document.createElement("style"))),r}function yt(t,r){return r||(r=document.createElement("style")),K(t,e=>{r.textContent=e}).then(()=>r)}function Vt(t,r){return mt(t,r||(r=document.createElement("div"))),r}function mt(t,r){return g(this,null,function*(){return r||(r=document.createElement("div")),r.childNodes.length?R(r,t.data,t):"template"in t?j(r,t.template,t.data,t):V(t,e=>j(r,e,t.data,t)).then(()=>r)})}var F=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 i,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,(i=n.refs).parent||(i.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 g(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 i,s,o;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?(i=this.forceUpdateReact)==null||i.call(this):(o=(s=this.refs.topReact).forceUpdateReact)==null||o.call(s)}invokeReactRendering(){let{React:e,ReactDOM:n}=this.payload||{},a=this.descendants.filter(i=>i.refs.parentReact==this&&i.payload).map((i,s)=>e.createElement(this.getReactWrapper(i),{key:this.tagName+"-"+s,slot:i.getAttribute("slot")}));return this.renderReact(w(v({},this.props),{children:a}),this.payload)}getReactWrapper(e=this,n=e.tagName){let a=e.reactWrapper||(e.reactWrapper=i=>{if(e.renderReact){let{React:s,ReactDOM:o}=e.payload||{},[u,h]=s.useReducer(l=>l+1,0);return e.forceUpdateReact=h,o.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=v(v({},this.overrides),e),this.props=v(v({},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,i;return(i=(a=n.closest(`[${e}]`))==null?void 0:a.getAttribute(e))!=null?i:this.getAttribute(e)}static register(e){window.customElements.get(e)||window.customElements.define(e,this)}};function Kt(t=this){return{hidden:(t==null?void 0:t.getAttribute("hidden"))!=null}}var I=class extends F{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=`
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,o;return{s:function(){e=e.call(t)},n:function(){var u=e.next();return i=u.done,u},e:function(u){s=!0,o=u},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(s)throw o}}}}var b=Object.prototype.hasOwnProperty;function H(t,r){return t=t.slice(),t.push(r),t}function D(t,r){return r=r.slice(),r.unshift(t),r}var jt=function(t){xt(e,t);var r=kt(e);function e(n){var a;return _t(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}(Z(Error));function f(t,r,e,n,a){if(!(this instanceof f))try{return new f(t,r,e,n,a)}catch(u){if(!u.avoidNew)throw u;return u.value}typeof t=="string"&&(a=n,n=e,e=r,r=t,t=null);var i=t&&A(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=b.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:i?t.path:r};i?"json"in t&&(s.json=t.json):s.json=e;var o=this.evaluate(s);if(!o||A(o)!=="object")throw new jt(o);return o}}f.prototype.evaluate=function(t,r,e,n){var a=this,i=this.parent,s=this.parentProperty,o=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&&A(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(!b.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var h=t;r=h.json,o=b.call(t,"flatten")?t.flatten:o,this.currResultType=b.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=b.call(t,"sandbox")?t.sandbox:this.currSandbox,u=b.call(t,"wrap")?t.wrap:u,this.currPreventEval=b.call(t,"preventEval")?t.preventEval:this.currPreventEval,e=b.call(t,"callback")?t.callback:e,this.currOtherTypeCallback=b.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,i=b.call(t,"parent")?t.parent:i,s=b.call(t,"parentProperty")?t.parentProperty:s,t=t.path}if(i=i||null,s=s||null,Array.isArray(t)&&(t=f.toPathString(t)),!(!t&&t!==""||!r)){var l=f.toPathArray(t);l[0]==="$"&&l.length>1&&l.shift(),this._hasParentSelector=null;var c=this._trace(l,r,["$"],i,s,e).filter(function(p){return p&&!p.isParentSelector});return c.length?!u&&c.length===1&&!c[0].hasArrExpr?this._getPreferredOutput(c[0]):c.reduce(function(p,d){var y=a._getPreferredOutput(d);return o&&Array.isArray(y)?p=p.concat(y):p.push(y),p},[]):u?[]:void 0}};f.prototype._getPreferredOutput=function(t){var r=this.currResultType;switch(r){case"all":{var e=Array.isArray(t.path)?t.path:f.toPathArray(t.path);return t.pointer=f.toPointer(e),t.path=typeof t.path=="string"?t.path:f.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[r];case"path":return f.toPathString(t[r]);case"pointer":return f.toPointer(t.path);default:throw new TypeError("Unknown result type")}};f.prototype._handleCallback=function(t,r,e){if(r){var n=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:f.toPathString(t.path),r(n,e,t)}};f.prototype._trace=function(t,r,e,n,a,i,s,o){var u=this,h;if(!t.length)return h={path:e,value:r,parent:n,parentProperty:a,hasArrExpr:s},this._handleCallback(h,i,"value"),h;var l=t[0],c=t.slice(1),p=[];function d(m){Array.isArray(m)?m.forEach(function(P){p.push(P)}):p.push(m)}if((typeof l!="string"||o)&&r&&b.call(r,l))d(this._trace(c,r[l],H(e,l),r,l,i,s));else if(l==="*")this._walk(l,c,r,e,n,a,i,function(m,P,M,E,T,L,O,k){d(u._trace(D(m,M),E,T,L,O,k,!0,!0))});else if(l==="..")d(this._trace(c,r,e,n,a,i,s)),this._walk(l,c,r,e,n,a,i,function(m,P,M,E,T,L,O,k){A(E[m])==="object"&&d(u._trace(D(P,M),E[m],H(T,m),E,m,k,!0))});else{if(l==="^")return this._hasParentSelector=!0,{path:e.slice(0,-1),expr:c,isParentSelector:!0};if(l==="~")return h={path:H(e,l),value:a,parent:n,parentProperty:null},this._handleCallback(h,i,"property"),h;if(l==="$")d(this._trace(c,r,e,null,null,i,s));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(l))d(this._slice(l,c,r,e,n,a,i));else if(l.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");this._walk(l,c,r,e,n,a,i,function(m,P,M,E,T,L,O,k){u._eval(P.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[m],m,T,L,O)&&d(u._trace(D(m,M),E,T,L,O,k,!0))})}else if(l[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");d(this._trace(D(this._eval(l,r,e[e.length-1],e.slice(0,-1),n,a),c),r,e,n,a,i,s))}else if(l[0]==="@"){var y=!1,C=l.slice(1,-2);switch(C){case"scalar":(!r||!["object","function"].includes(A(r)))&&(y=!0);break;case"boolean":case"string":case"undefined":case"function":A(r)===C&&(y=!0);break;case"integer":Number.isFinite(r)&&!(r%1)&&(y=!0);break;case"number":Number.isFinite(r)&&(y=!0);break;case"nonFinite":typeof r=="number"&&!Number.isFinite(r)&&(y=!0);break;case"object":r&&A(r)===C&&(y=!0);break;case"array":Array.isArray(r)&&(y=!0);break;case"other":y=this.currOtherTypeCallback(r,e,n,a);break;case"null":r===null&&(y=!0);break;default:throw new TypeError("Unknown value type "+C)}if(y)return h={path:e,value:r,parent:n,parentProperty:a},this._handleCallback(h,i,"value"),h}else if(l[0]==="`"&&r&&b.call(r,l.slice(1))){var G=l.slice(1);d(this._trace(c,r[G],H(e,G),r,G,i,s,!0))}else if(l.includes(",")){var vt=l.split(","),J=Nt(vt),rt;try{for(J.s();!(rt=J.n()).done;){var At=rt.value;d(this._trace(D(At,c),r,e,n,a,i,!0))}}catch(m){J.e(m)}finally{J.f()}}else!o&&r&&b.call(r,l)&&d(this._trace(c,r[l],H(e,l),r,l,i,s,!0))}if(this._hasParentSelector)for(var S=0;S<p.length;S++){var W=p[S];if(W&&W.isParentSelector){var x=this._trace(W.expr,r,W.path,n,a,i,s);if(Array.isArray(x)){p[S]=x[0];for(var Et=x.length,Q=1;Q<Et;Q++)S++,p.splice(S,0,x[Q])}else p[S]=x}}return p};f.prototype._walk=function(t,r,e,n,a,i,s,o){if(Array.isArray(e))for(var u=e.length,h=0;h<u;h++)o(h,t,r,e,n,a,i,s);else e&&A(e)==="object"&&Object.keys(e).forEach(function(l){o(l,t,r,e,n,a,i,s)})};f.prototype._slice=function(t,r,e,n,a,i,s){if(!!Array.isArray(e)){var o=e.length,u=t.split(":"),h=u[2]&&Number.parseInt(u[2])||1,l=u[0]&&Number.parseInt(u[0])||0,c=u[1]&&Number.parseInt(u[1])||o;l=l<0?Math.max(0,l+o):Math.min(o,l),c=c<0?Math.max(0,c+o):Math.min(o,c);for(var p=[],d=l;d<c;d+=h){var y=this._trace(D(d,r),e,n,a,i,s,!0);y.forEach(function(C){p.push(C)})}return p}};f.prototype._eval=function(t,r,e,n,a,i){t.includes("@parentProperty")&&(this.currSandbox._$_parentProperty=i,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=f.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)}};f.cache={};f.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};f.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};f.toPathArray=function(t){var r=f.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(i,s){return"[#"+(e.push(s)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(i,s){return"['"+s.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(i,s){return";"+s.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),a=n.split(";").map(function(i){var s=i.match(/#([0-9]+)/);return!s||!s[1]?i:e[s[1]]});return r[t]=a,r[t].concat()};var It=function(r,e,n){for(var a=r.length,i=0;i<a;i++){var s=r[i];n(s)&&e.push(r.splice(i--,1)[0])}};f.prototype.vm={runInNewContext:function(r,e){var n=Object.keys(e),a=[];It(n,a,function(h){return typeof e[h]=="function"});var i=n.map(function(h,l){return e[h]}),s=a.reduce(function(h,l){var c=e[l].toString();return/function/.test(c)||(c="function "+c),"var "+l+"="+c+";"+h},"");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 o=r.lastIndexOf(";"),u=o>-1?r.slice(0,o+1)+" return "+r.slice(o+1):" return "+r;return $(Function,st(n).concat([u])).apply(void 0,st(i))}};function q(t,r,e,n){return g(this,null,function*(){let a=new Date,i=yield fetch(t,r);if(!i.ok)throw new Error("Fetch failed");let s=new Date(i.headers.get("date"));var o=i;if(n(i,"cached"),s<a){let u=yield fetch(t+"?"+Math.random(),w(v({},r),{method:"HEAD",cache:"no-cache"}));if(u.headers.get("last-modified")!=i.headers.get("last-modified")){if(e(u)===!1)throw new Error("Response is stale");o=yield fetch(t,w(v({},r),{cache:"reload"}))}}if(e(o)===!1)throw new Error("Response is not valid");return i!==o&&n(o,"valid"),o})}function Ut({cdn:t="https://feaascomponentsapidev.blob.core.windows.net",hostname:r,library:e,component:n,version:a,revision:i="published"}){return`${t||r}/components/${e}/${n}/${a}/${i}.html`}function Jt({cdn:t="https://feaascomponentsapidev.blob.core.windows.net",hostname:r,library:e,revision:n="published"}){return`${t||r}/styles/${e}/${n}.css`}function V(t,r){return g(this,null,function*(){return q(Ut(t),{},e=>e.headers.get("x-ms-meta-versionDeletedAt")==null,e=>{e.text().then(r)})})}function K(t,r){return g(this,null,function*(){return q(Jt(t),{},e=>e.headers.get("x-ms-meta-deletedAt")==null,e=>{e.text().then(r)})})}function Wt(t,r){let e=document.createElement("div");e.innerHTML=t;let n=document.createDocumentFragment();for(;e.firstChild;)n.appendChild(e.firstChild);return R(n,r),e}function ct(t){return t.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function ht(t){return ct(t)+".*"}function pt(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 zt(t,r,e){let n=t.getAttribute("data-path-scope");if(n==null)return;var a=pt(t);if(a!=0)return;let i=t.parentElement;if(i!=null){r==0?t.style.display="none":t.style.display&&(t.style.display="",t.getAttribute("style")==""&&t.removeAttribute("style"));for(var s=a+1,o=t,u=t;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(s++,o=u);for(var h=s;h<r;h++)i.insertBefore(o.cloneNode(!0),o.nextElementSibling);for(var h=Math.max(1,r);h<s;h++)o=o.previousElementSibling,i.removeChild(o.nextElementSibling)}}function et(t,r,e=!1,n=t){var a=r;let i=Object.keys(t).sort((o,u)=>u.length-o.length);for(let o of i)if(r.startsWith(o)){if(o==r){if(e)return t[o];continue}a=r.substring(o.length+1),n=t[o];break}let s=f({path:a,json:n});return e&&s&&Array.isArray(s)?s[0]:s}function _(t,r,e,n){var l;if(!!t){var a=t;n!=null&&n.processValue&&(e=n==null?void 0:n.processValue(t,r,e));var i=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")i="innerHTML";else if(r=="data-embed-src")X(t,e);else if(r=="data-path-attributes"){let c=((l=t.getAttribute("data-attributes-keys"))==null?void 0:l.split(",").filter(Boolean))||[];for(var s in e){var o=e[s];_(t,s,typeof o=="object"&&o?JSON.stringify(o):o,n)}for(var u=0;u<c.length;u++)(e==null||!(c[u]in e))&&_(t,c[u],null,n);_(t,"data-attributes-keys",Object.keys(e||{}).join(","));return}if(typeof e=="boolean"&&(e=e?"":null),!!a){var h=String(t.getAttribute("data-path-placeholder")||a[i]);e!=null?i=="innerHTML"?a.innerHTML!=e&&(a.innerHTML=e):a.getAttribute(i)!=e&&a.setAttribute(i,e):i=="innerHTML"?a.innerHTML=h:a.removeAttribute(i)}}}function ft(t){let r=new t.ownerDocument.defaultView.MutationObserver(e=>{e.forEach(n=>{let a=n.target,i=a.getAttribute("data-embed-src");i&&X(a,i),n.addedNodes&&n.addedNodes.forEach(s=>{s.nodeType==1&&dt(s,!1)})})});return r.observe(t,{attributes:!0,subtree:!0,childList:!0}),r}function dt(t,r=!0){let e=t.querySelectorAll("[data-embed-src]");for(var n=0;n<e.length;n++){let a=e[n];X(a,a.getAttribute("data-embed-src"))}if(r)return ft(t)}function X(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 i=e.ownerDocument.createElement("script");i.type="module",i.src=r,e.appendChild(i);break}}var lt=["data-attributes-keys","data-path-attributes","data-path-scope"];function R(t,r,e,n){var s,o,u;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 h=a.getAttribute("data-path-scope");if(h){let c=pt(a),p=et(r,h,!1)||[];c==0&&zt(a,((o=e==null?void 0:e.shouldRepeat)==null?void 0:o.call(e,a,p))===!1?1:p.length,e),r=w(v({},r),{[ht(h)]:p[c]})}let l=Array.prototype.slice.call(a.attributes).sort((c,p)=>lt.indexOf(c.name)-lt.indexOf(p.name));for(var i=0;i<l.length;i++){let{name:c,value:p}=l[i];c.startsWith("data-path")&&c!="data-path-scope"&&_(a,c,et(r,p,!0),e),c=="data-embed-src"&&_(a,c,a.getAttribute(c),e)}}for(var i=0;i<a.children.length;i++)R(a.children[i],r,e,!0);return n||(u=e==null?void 0:e.onRender)==null||u.call(e,a,r),a}function j(t,r,e,n){var i;let a=((i=n==null?void 0:n.processTemplate)==null?void 0:i.call(n,t,r,e))||r;return t.innerHTML=a,t.classList.add("-feaas"),R(t,e,n)}function qt(t,r){return yt(t,r||(r=document.createElement("style"))),r}function yt(t,r){return r||(r=document.createElement("style")),K(t,e=>{r.textContent=e}).then(()=>r)}function Vt(t,r){return mt(t,r||(r=document.createElement("div"))),r}function mt(t,r){return g(this,null,function*(){return r||(r=document.createElement("div")),r.childNodes.length?R(r,t.data,t):"template"in t?j(r,t.template,t.data,t):V(t,e=>j(r,e,t.data,t)).then(()=>r)})}var F=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 i,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,(i=n.refs).parent||(i.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 g(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 i,s,o;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?(i=this.forceUpdateReact)==null||i.call(this):(o=(s=this.refs.topReact).forceUpdateReact)==null||o.call(s)}invokeReactRendering(){let{React:e,ReactDOM:n}=this.payload||{},a=this.descendants.filter(i=>i.refs.parentReact==this&&i.payload).map((i,s)=>e.createElement(this.getReactWrapper(i),{key:this.tagName+"-"+s,slot:i.getAttribute("slot")}));return this.renderReact(w(v({},this.props),{children:a}),this.payload)}getReactWrapper(e=this,n=e.tagName){let a=e.reactWrapper||(e.reactWrapper=i=>{if(e.renderReact){let{React:s,ReactDOM:o}=e.payload||{},[u,h]=s.useReducer(l=>l+1,0);return e.forceUpdateReact=h,o.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=v(v({},this.overrides),e),this.props=v(v({},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,i;return(i=(a=n.closest(`[${e}]`))==null?void 0:a.getAttribute(e))!=null?i:this.getAttribute(e)}static register(e){window.customElements.get(e)||window.customElements.define(e,this)}};function Kt(t=this){return{hidden:(t==null?void 0:t.getAttribute("hidden"))!=null}}var I=class extends F{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=`
4
4
  #loader {
5
5
  position: absolute;
6
6
  top: 0;
@@ -64,4 +64,4 @@ 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)}};I.observedAttributes=["hidden"];I.register("feaas-loader");function bt(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 Y=class extends F{getProps(){return bt(this)}isReadyToLoad(){return this.props.library!=null&&this.props.revision!=null&&this.props.cdn!=null}load(){return g(this,null,function*(){K(this.props,this.onLoad)})}render(){this.stylesheet||(this.stylesheet=document.createElement("style"),this.appendChild(this.stylesheet)),this.stylesheet.textContent=this.payload}};Y.register("feaas-stylesheet");function gt(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 U=class extends F{setData(e){this.set({data:e})}getProps(){return gt(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 g(this,null,function*(){if(!this.getOriginal())try{V(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)R(this,this.props.data);else{if(this.needsRefresh=!0,this.getOriginal())return;j(this,this.payload,this.props.data)}}};U.observedAttributes=["library","component","version","revision","hostname","cdn","template","data"];U.register("feaas-component");
67
+ </div>`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}};I.observedAttributes=["hidden"];I.register("feaas-loader");function bt(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"))||(t==null?void 0:t.getContextAttribute("hostname"))}}var Y=class extends F{getProps(){return bt(this)}isReadyToLoad(){return this.props.library!=null&&this.props.revision!=null&&this.props.cdn!=null}load(){return g(this,null,function*(){K(this.props,this.onLoad)})}render(){this.stylesheet||(this.stylesheet=document.createElement("style"),this.appendChild(this.stylesheet)),this.stylesheet.textContent=this.payload}};Y.register("feaas-stylesheet");function gt(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 U=class extends F{setData(e){this.set({data:e})}getProps(){return gt(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 g(this,null,function*(){if(!this.getOriginal())try{V(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)R(this,this.props.data);else{if(this.needsRefresh=!0,this.getOriginal())return;j(this,this.payload,this.props.data)}}};U.observedAttributes=["library","component","version","revision","hostname","cdn","template","data"];U.register("feaas-component");
@@ -1,6 +1,6 @@
1
- var pt=Object.defineProperty,ft=Object.defineProperties;var dt=Object.getOwnPropertyDescriptors;var et=Object.getOwnPropertySymbols;var yt=Object.prototype.hasOwnProperty,mt=Object.prototype.propertyIsEnumerable;var rt=(t,r,e)=>r in t?pt(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,v=(t,r)=>{for(var e in r||(r={}))yt.call(r,e)&&rt(t,e,r[e]);if(et)for(var e of et(r))mt.call(r,e)&&rt(t,e,r[e]);return t},w=(t,r)=>ft(t,dt(r));var g=(t,r,e)=>new Promise((n,a)=>{var i=u=>{try{o(e.next(u))}catch(h){a(h)}},s=u=>{try{o(e.throw(u))}catch(h){a(h)}},o=u=>u.done?n(u.value):Promise.resolve(u.value).then(i,s);o((e=e.apply(t,r)).next())});function E(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?E=function(r){return typeof r}:E=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},E(t)}function bt(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function gt(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&&B(t,r)}function $(t){return $=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},$(t)}function B(t,r){return B=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},B(t,r)}function at(){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 H(t,r,e){return at()?H=Reflect.construct:H=function(a,i,s){var o=[null];o.push.apply(o,i);var u=Function.bind.apply(a,o),h=new u;return s&&B(h,s.prototype),h},H.apply(null,arguments)}function vt(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function X(t){var r=typeof Map=="function"?new Map:void 0;return X=function(n){if(n===null||!vt(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 H(n,arguments,$(this).constructor)}return a.prototype=Object.create(n.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),B(a,n)},X(t)}function Et(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function At(t,r){return r&&(typeof r=="object"||typeof r=="function")?r:Et(t)}function Ft(t){var r=at();return function(){var n=$(t),a;if(r){var i=$(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return At(this,a)}}function nt(t){return St(t)||wt(t)||it(t)||Rt()}function St(t){if(Array.isArray(t))return Y(t)}function wt(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function it(t,r){if(!!t){if(typeof t=="string")return Y(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 Y(t,r)}}function Y(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 Rt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ var pt=Object.defineProperty,ft=Object.defineProperties;var dt=Object.getOwnPropertyDescriptors;var et=Object.getOwnPropertySymbols;var yt=Object.prototype.hasOwnProperty,mt=Object.prototype.propertyIsEnumerable;var rt=(t,r,e)=>r in t?pt(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,v=(t,r)=>{for(var e in r||(r={}))yt.call(r,e)&&rt(t,e,r[e]);if(et)for(var e of et(r))mt.call(r,e)&&rt(t,e,r[e]);return t},w=(t,r)=>ft(t,dt(r));var g=(t,r,e)=>new Promise((n,a)=>{var i=u=>{try{o(e.next(u))}catch(h){a(h)}},s=u=>{try{o(e.throw(u))}catch(h){a(h)}},o=u=>u.done?n(u.value):Promise.resolve(u.value).then(i,s);o((e=e.apply(t,r)).next())});function A(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?A=function(r){return typeof r}:A=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},A(t)}function bt(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function gt(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&&B(t,r)}function $(t){return $=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},$(t)}function B(t,r){return B=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},B(t,r)}function at(){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 H(t,r,e){return at()?H=Reflect.construct:H=function(a,i,s){var o=[null];o.push.apply(o,i);var u=Function.bind.apply(a,o),h=new u;return s&&B(h,s.prototype),h},H.apply(null,arguments)}function vt(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function X(t){var r=typeof Map=="function"?new Map:void 0;return X=function(n){if(n===null||!vt(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 H(n,arguments,$(this).constructor)}return a.prototype=Object.create(n.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),B(a,n)},X(t)}function At(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Et(t,r){return r&&(typeof r=="object"||typeof r=="function")?r:At(t)}function Ft(t){var r=at();return function(){var n=$(t),a;if(r){var i=$(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return Et(this,a)}}function nt(t){return St(t)||wt(t)||it(t)||Rt()}function St(t){if(Array.isArray(t))return Y(t)}function wt(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function it(t,r){if(!!t){if(typeof t=="string")return Y(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 Y(t,r)}}function Y(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 Rt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ct(t,r){var e=typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=it(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(u){throw u},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 i=!0,s=!1,o;return{s:function(){e=e.call(t)},n:function(){var u=e.next();return i=u.done,u},e:function(u){s=!0,o=u},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(s)throw o}}}}var b=Object.prototype.hasOwnProperty;function k(t,r){return t=t.slice(),t.push(r),t}function T(t,r){return r=r.slice(),r.unshift(t),r}var Pt=function(t){gt(e,t);var r=Ft(e);function e(n){var a;return bt(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}(X(Error));function f(t,r,e,n,a){if(!(this instanceof f))try{return new f(t,r,e,n,a)}catch(u){if(!u.avoidNew)throw u;return u.value}typeof t=="string"&&(a=n,n=e,e=r,r=t,t=null);var i=t&&E(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=b.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:i?t.path:r};i?"json"in t&&(s.json=t.json):s.json=e;var o=this.evaluate(s);if(!o||E(o)!=="object")throw new Pt(o);return o}}f.prototype.evaluate=function(t,r,e,n){var a=this,i=this.parent,s=this.parentProperty,o=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&&E(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(!b.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var h=t;r=h.json,o=b.call(t,"flatten")?t.flatten:o,this.currResultType=b.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=b.call(t,"sandbox")?t.sandbox:this.currSandbox,u=b.call(t,"wrap")?t.wrap:u,this.currPreventEval=b.call(t,"preventEval")?t.preventEval:this.currPreventEval,e=b.call(t,"callback")?t.callback:e,this.currOtherTypeCallback=b.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,i=b.call(t,"parent")?t.parent:i,s=b.call(t,"parentProperty")?t.parentProperty:s,t=t.path}if(i=i||null,s=s||null,Array.isArray(t)&&(t=f.toPathString(t)),!(!t&&t!==""||!r)){var l=f.toPathArray(t);l[0]==="$"&&l.length>1&&l.shift(),this._hasParentSelector=null;var c=this._trace(l,r,["$"],i,s,e).filter(function(p){return p&&!p.isParentSelector});return c.length?!u&&c.length===1&&!c[0].hasArrExpr?this._getPreferredOutput(c[0]):c.reduce(function(p,d){var y=a._getPreferredOutput(d);return o&&Array.isArray(y)?p=p.concat(y):p.push(y),p},[]):u?[]:void 0}};f.prototype._getPreferredOutput=function(t){var r=this.currResultType;switch(r){case"all":{var e=Array.isArray(t.path)?t.path:f.toPathArray(t.path);return t.pointer=f.toPointer(e),t.path=typeof t.path=="string"?t.path:f.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[r];case"path":return f.toPathString(t[r]);case"pointer":return f.toPointer(t.path);default:throw new TypeError("Unknown result type")}};f.prototype._handleCallback=function(t,r,e){if(r){var n=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:f.toPathString(t.path),r(n,e,t)}};f.prototype._trace=function(t,r,e,n,a,i,s,o){var u=this,h;if(!t.length)return h={path:e,value:r,parent:n,parentProperty:a,hasArrExpr:s},this._handleCallback(h,i,"value"),h;var l=t[0],c=t.slice(1),p=[];function d(m){Array.isArray(m)?m.forEach(function(C){p.push(C)}):p.push(m)}if((typeof l!="string"||o)&&r&&b.call(r,l))d(this._trace(c,r[l],k(e,l),r,l,i,s));else if(l==="*")this._walk(l,c,r,e,n,a,i,function(m,C,x,A,P,M,L,O){d(u._trace(T(m,x),A,P,M,L,O,!0,!0))});else if(l==="..")d(this._trace(c,r,e,n,a,i,s)),this._walk(l,c,r,e,n,a,i,function(m,C,x,A,P,M,L,O){E(A[m])==="object"&&d(u._trace(T(C,x),A[m],k(P,m),A,m,O,!0))});else{if(l==="^")return this._hasParentSelector=!0,{path:e.slice(0,-1),expr:c,isParentSelector:!0};if(l==="~")return h={path:k(e,l),value:a,parent:n,parentProperty:null},this._handleCallback(h,i,"property"),h;if(l==="$")d(this._trace(c,r,e,null,null,i,s));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(l))d(this._slice(l,c,r,e,n,a,i));else if(l.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");this._walk(l,c,r,e,n,a,i,function(m,C,x,A,P,M,L,O){u._eval(C.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1"),A[m],m,P,M,L)&&d(u._trace(T(m,x),A,P,M,L,O,!0))})}else if(l[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");d(this._trace(T(this._eval(l,r,e[e.length-1],e.slice(0,-1),n,a),c),r,e,n,a,i,s))}else if(l[0]==="@"){var y=!1,R=l.slice(1,-2);switch(R){case"scalar":(!r||!["object","function"].includes(E(r)))&&(y=!0);break;case"boolean":case"string":case"undefined":case"function":E(r)===R&&(y=!0);break;case"integer":Number.isFinite(r)&&!(r%1)&&(y=!0);break;case"number":Number.isFinite(r)&&(y=!0);break;case"nonFinite":typeof r=="number"&&!Number.isFinite(r)&&(y=!0);break;case"object":r&&E(r)===R&&(y=!0);break;case"array":Array.isArray(r)&&(y=!0);break;case"other":y=this.currOtherTypeCallback(r,e,n,a);break;case"null":r===null&&(y=!0);break;default:throw new TypeError("Unknown value type "+R)}if(y)return h={path:e,value:r,parent:n,parentProperty:a},this._handleCallback(h,i,"value"),h}else if(l[0]==="`"&&r&&b.call(r,l.slice(1))){var V=l.slice(1);d(this._trace(c,r[V],k(e,V),r,V,i,s,!0))}else if(l.includes(",")){var lt=l.split(","),j=Ct(lt),tt;try{for(j.s();!(tt=j.n()).done;){var ct=tt.value;d(this._trace(T(ct,c),r,e,n,a,i,!0))}}catch(m){j.e(m)}finally{j.f()}}else!o&&r&&b.call(r,l)&&d(this._trace(c,r[l],k(e,l),r,l,i,s,!0))}if(this._hasParentSelector)for(var S=0;S<p.length;S++){var I=p[S];if(I&&I.isParentSelector){var _=this._trace(I.expr,r,I.path,n,a,i,s);if(Array.isArray(_)){p[S]=_[0];for(var ht=_.length,K=1;K<ht;K++)S++,p.splice(S,0,_[K])}else p[S]=_}}return p};f.prototype._walk=function(t,r,e,n,a,i,s,o){if(Array.isArray(e))for(var u=e.length,h=0;h<u;h++)o(h,t,r,e,n,a,i,s);else e&&E(e)==="object"&&Object.keys(e).forEach(function(l){o(l,t,r,e,n,a,i,s)})};f.prototype._slice=function(t,r,e,n,a,i,s){if(!!Array.isArray(e)){var o=e.length,u=t.split(":"),h=u[2]&&Number.parseInt(u[2])||1,l=u[0]&&Number.parseInt(u[0])||0,c=u[1]&&Number.parseInt(u[1])||o;l=l<0?Math.max(0,l+o):Math.min(o,l),c=c<0?Math.max(0,c+o):Math.min(o,c);for(var p=[],d=l;d<c;d+=h){var y=this._trace(T(d,r),e,n,a,i,s,!0);y.forEach(function(R){p.push(R)})}return p}};f.prototype._eval=function(t,r,e,n,a,i){t.includes("@parentProperty")&&(this.currSandbox._$_parentProperty=i,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=f.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)}};f.cache={};f.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};f.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};f.toPathArray=function(t){var r=f.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(i,s){return"[#"+(e.push(s)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(i,s){return"['"+s.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(i,s){return";"+s.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),a=n.split(";").map(function(i){var s=i.match(/#([0-9]+)/);return!s||!s[1]?i:e[s[1]]});return r[t]=a,r[t].concat()};var Tt=function(r,e,n){for(var a=r.length,i=0;i<a;i++){var s=r[i];n(s)&&e.push(r.splice(i--,1)[0])}};f.prototype.vm={runInNewContext:function(r,e){var n=Object.keys(e),a=[];Tt(n,a,function(h){return typeof e[h]=="function"});var i=n.map(function(h,l){return e[h]}),s=a.reduce(function(h,l){var c=e[l].toString();return/function/.test(c)||(c="function "+c),"var "+l+"="+c+";"+h},"");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 o=r.lastIndexOf(";"),u=o>-1?r.slice(0,o+1)+" return "+r.slice(o+1):" return "+r;return H(Function,nt(n).concat([u])).apply(void 0,nt(i))}};function G(t,r,e,n){return g(this,null,function*(){let a=new Date,i=yield fetch(t,r);if(!i.ok)throw new Error("Fetch failed");let s=new Date(i.headers.get("date"));var o=i;if(n(i,"cached"),s<a){let u=yield fetch(t+"?"+Math.random(),w(v({},r),{method:"HEAD",cache:"no-cache"}));if(u.headers.get("last-modified")!=i.headers.get("last-modified")){if(e(u)===!1)throw new Error("Response is stale");o=yield fetch(t,w(v({},r),{cache:"reload"}))}}if(e(o)===!1)throw new Error("Response is not valid");return i!==o&&n(o,"valid"),o})}function Dt({cdn:t="https://feaascomponentsapidev.blob.core.windows.net",hostname:r,library:e,component:n,version:a,revision:i="published"}){return`${t||r}/components/${e}/${n}/${a}/${i}.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 U(t,r){return g(this,null,function*(){return G(Dt(t),{},e=>e.headers.get("x-ms-meta-versionDeletedAt")==null,e=>{e.text().then(r)})})}function J(t,r){return g(this,null,function*(){return G(_t(t),{},e=>e.headers.get("x-ms-meta-deletedAt")==null,e=>{e.text().then(r)})})}function Xt(t,r){let e=document.createElement("div");e.innerHTML=t;let n=document.createDocumentFragment();for(;e.firstChild;)n.appendChild(e.firstChild);return D(n,r),e}function xt(t){return t.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function Mt(t){return xt(t)+".*"}function ut(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 Lt(t,r,e){let n=t.getAttribute("data-path-scope");if(n==null)return;var a=ut(t);if(a!=0)return;let i=t.parentElement;if(i!=null){r==0?t.style.display="none":t.style.display&&(t.style.display="",t.getAttribute("style")==""&&t.removeAttribute("style"));for(var s=a+1,o=t,u=t;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(s++,o=u);for(var h=s;h<r;h++)i.insertBefore(o.cloneNode(!0),o.nextElementSibling);for(var h=Math.max(1,r);h<s;h++)o=o.previousElementSibling,i.removeChild(o.nextElementSibling)}}function st(t,r,e=!1,n=t){var a=r;let i=Object.keys(t).sort((o,u)=>u.length-o.length);for(let o of i)if(r.startsWith(o)){if(o==r){if(e)return t[o];continue}a=r.substring(o.length+1),n=t[o];break}let s=f({path:a,json:n});return e&&s&&Array.isArray(s)?s[0]:s}function N(t,r,e,n){var l;if(!!t){var a=t;n!=null&&n.processValue&&(e=n==null?void 0:n.processValue(t,r,e));var i=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")i="innerHTML";else if(r=="data-embed-src")Q(t,e);else if(r=="data-path-attributes"){let c=((l=t.getAttribute("data-attributes-keys"))==null?void 0:l.split(",").filter(Boolean))||[];for(var s in e){var o=e[s];N(t,s,typeof o=="object"&&o?JSON.stringify(o):o,n)}for(var u=0;u<c.length;u++)(e==null||!(c[u]in e))&&N(t,c[u],null,n);N(t,"data-attributes-keys",Object.keys(e||{}).join(","));return}if(typeof e=="boolean"&&(e=e?"":null),!!a){var h=String(t.getAttribute("data-path-placeholder")||a[i]);e!=null?i=="innerHTML"?a.innerHTML!=e&&(a.innerHTML=e):a.getAttribute(i)!=e&&a.setAttribute(i,e):i=="innerHTML"?a.innerHTML=h:a.removeAttribute(i)}}}function Ot(t){let r=new t.ownerDocument.defaultView.MutationObserver(e=>{e.forEach(n=>{let a=n.target,i=a.getAttribute("data-embed-src");i&&Q(a,i),n.addedNodes&&n.addedNodes.forEach(s=>{s.nodeType==1&&kt(s,!1)})})});return r.observe(t,{attributes:!0,subtree:!0,childList:!0}),r}function kt(t,r=!0){let e=t.querySelectorAll("[data-embed-src]");for(var n=0;n<e.length;n++){let a=e[n];Q(a,a.getAttribute("data-embed-src"))}if(r)return Ot(t)}function Q(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 i=e.ownerDocument.createElement("script");i.type="module",i.src=r,e.appendChild(i);break}}var ot=["data-attributes-keys","data-path-attributes","data-path-scope"];function D(t,r,e,n){var s,o,u;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 h=a.getAttribute("data-path-scope");if(h){let c=ut(a),p=st(r,h,!1)||[];c==0&&Lt(a,((o=e==null?void 0:e.shouldRepeat)==null?void 0:o.call(e,a,p))===!1?1:p.length,e),r=w(v({},r),{[Mt(h)]:p[c]})}let l=Array.prototype.slice.call(a.attributes).sort((c,p)=>ot.indexOf(c.name)-ot.indexOf(p.name));for(var i=0;i<l.length;i++){let{name:c,value:p}=l[i];c.startsWith("data-path")&&c!="data-path-scope"&&N(a,c,st(r,p,!0),e),c=="data-embed-src"&&N(a,c,a.getAttribute(c),e)}}for(var i=0;i<a.children.length;i++)D(a.children[i],r,e,!0);return n||(u=e==null?void 0:e.onRender)==null||u.call(e,a,r),a}function W(t,r,e,n){var i;let a=((i=n==null?void 0:n.processTemplate)==null?void 0:i.call(n,t,r,e))||r;return t.innerHTML=a,t.classList.add("-feaas"),D(t,e,n)}function Yt(t,r){return Ht(t,r||(r=document.createElement("style"))),r}function Ht(t,r){return r||(r=document.createElement("style")),J(t,e=>{r.textContent=e}).then(()=>r)}function Gt(t,r){return $t(t,r||(r=document.createElement("div"))),r}function $t(t,r){return g(this,null,function*(){return r||(r=document.createElement("div")),r.childNodes.length?D(r,t.data,t):"template"in t?W(r,t.template,t.data,t):U(t,e=>W(r,e,t.data,t)).then(()=>r)})}var F=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 i,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,(i=n.refs).parent||(i.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 g(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 i,s,o;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?(i=this.forceUpdateReact)==null||i.call(this):(o=(s=this.refs.topReact).forceUpdateReact)==null||o.call(s)}invokeReactRendering(){let{React:e,ReactDOM:n}=this.payload||{},a=this.descendants.filter(i=>i.refs.parentReact==this&&i.payload).map((i,s)=>e.createElement(this.getReactWrapper(i),{key:this.tagName+"-"+s,slot:i.getAttribute("slot")}));return this.renderReact(w(v({},this.props),{children:a}),this.payload)}getReactWrapper(e=this,n=e.tagName){let a=e.reactWrapper||(e.reactWrapper=i=>{if(e.renderReact){let{React:s,ReactDOM:o}=e.payload||{},[u,h]=s.useReducer(l=>l+1,0);return e.forceUpdateReact=h,o.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=v(v({},this.overrides),e),this.props=v(v({},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,i;return(i=(a=n.closest(`[${e}]`))==null?void 0:a.getAttribute(e))!=null?i: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 z=class extends F{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=`
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,o;return{s:function(){e=e.call(t)},n:function(){var u=e.next();return i=u.done,u},e:function(u){s=!0,o=u},f:function(){try{!i&&e.return!=null&&e.return()}finally{if(s)throw o}}}}var b=Object.prototype.hasOwnProperty;function k(t,r){return t=t.slice(),t.push(r),t}function T(t,r){return r=r.slice(),r.unshift(t),r}var Pt=function(t){gt(e,t);var r=Ft(e);function e(n){var a;return bt(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}(X(Error));function f(t,r,e,n,a){if(!(this instanceof f))try{return new f(t,r,e,n,a)}catch(u){if(!u.avoidNew)throw u;return u.value}typeof t=="string"&&(a=n,n=e,e=r,r=t,t=null);var i=t&&A(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=b.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:i?t.path:r};i?"json"in t&&(s.json=t.json):s.json=e;var o=this.evaluate(s);if(!o||A(o)!=="object")throw new Pt(o);return o}}f.prototype.evaluate=function(t,r,e,n){var a=this,i=this.parent,s=this.parentProperty,o=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&&A(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(!b.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var h=t;r=h.json,o=b.call(t,"flatten")?t.flatten:o,this.currResultType=b.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=b.call(t,"sandbox")?t.sandbox:this.currSandbox,u=b.call(t,"wrap")?t.wrap:u,this.currPreventEval=b.call(t,"preventEval")?t.preventEval:this.currPreventEval,e=b.call(t,"callback")?t.callback:e,this.currOtherTypeCallback=b.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,i=b.call(t,"parent")?t.parent:i,s=b.call(t,"parentProperty")?t.parentProperty:s,t=t.path}if(i=i||null,s=s||null,Array.isArray(t)&&(t=f.toPathString(t)),!(!t&&t!==""||!r)){var l=f.toPathArray(t);l[0]==="$"&&l.length>1&&l.shift(),this._hasParentSelector=null;var c=this._trace(l,r,["$"],i,s,e).filter(function(p){return p&&!p.isParentSelector});return c.length?!u&&c.length===1&&!c[0].hasArrExpr?this._getPreferredOutput(c[0]):c.reduce(function(p,d){var y=a._getPreferredOutput(d);return o&&Array.isArray(y)?p=p.concat(y):p.push(y),p},[]):u?[]:void 0}};f.prototype._getPreferredOutput=function(t){var r=this.currResultType;switch(r){case"all":{var e=Array.isArray(t.path)?t.path:f.toPathArray(t.path);return t.pointer=f.toPointer(e),t.path=typeof t.path=="string"?t.path:f.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[r];case"path":return f.toPathString(t[r]);case"pointer":return f.toPointer(t.path);default:throw new TypeError("Unknown result type")}};f.prototype._handleCallback=function(t,r,e){if(r){var n=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:f.toPathString(t.path),r(n,e,t)}};f.prototype._trace=function(t,r,e,n,a,i,s,o){var u=this,h;if(!t.length)return h={path:e,value:r,parent:n,parentProperty:a,hasArrExpr:s},this._handleCallback(h,i,"value"),h;var l=t[0],c=t.slice(1),p=[];function d(m){Array.isArray(m)?m.forEach(function(C){p.push(C)}):p.push(m)}if((typeof l!="string"||o)&&r&&b.call(r,l))d(this._trace(c,r[l],k(e,l),r,l,i,s));else if(l==="*")this._walk(l,c,r,e,n,a,i,function(m,C,x,E,P,M,L,O){d(u._trace(T(m,x),E,P,M,L,O,!0,!0))});else if(l==="..")d(this._trace(c,r,e,n,a,i,s)),this._walk(l,c,r,e,n,a,i,function(m,C,x,E,P,M,L,O){A(E[m])==="object"&&d(u._trace(T(C,x),E[m],k(P,m),E,m,O,!0))});else{if(l==="^")return this._hasParentSelector=!0,{path:e.slice(0,-1),expr:c,isParentSelector:!0};if(l==="~")return h={path:k(e,l),value:a,parent:n,parentProperty:null},this._handleCallback(h,i,"property"),h;if(l==="$")d(this._trace(c,r,e,null,null,i,s));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(l))d(this._slice(l,c,r,e,n,a,i));else if(l.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");this._walk(l,c,r,e,n,a,i,function(m,C,x,E,P,M,L,O){u._eval(C.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[m],m,P,M,L)&&d(u._trace(T(m,x),E,P,M,L,O,!0))})}else if(l[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");d(this._trace(T(this._eval(l,r,e[e.length-1],e.slice(0,-1),n,a),c),r,e,n,a,i,s))}else if(l[0]==="@"){var y=!1,R=l.slice(1,-2);switch(R){case"scalar":(!r||!["object","function"].includes(A(r)))&&(y=!0);break;case"boolean":case"string":case"undefined":case"function":A(r)===R&&(y=!0);break;case"integer":Number.isFinite(r)&&!(r%1)&&(y=!0);break;case"number":Number.isFinite(r)&&(y=!0);break;case"nonFinite":typeof r=="number"&&!Number.isFinite(r)&&(y=!0);break;case"object":r&&A(r)===R&&(y=!0);break;case"array":Array.isArray(r)&&(y=!0);break;case"other":y=this.currOtherTypeCallback(r,e,n,a);break;case"null":r===null&&(y=!0);break;default:throw new TypeError("Unknown value type "+R)}if(y)return h={path:e,value:r,parent:n,parentProperty:a},this._handleCallback(h,i,"value"),h}else if(l[0]==="`"&&r&&b.call(r,l.slice(1))){var V=l.slice(1);d(this._trace(c,r[V],k(e,V),r,V,i,s,!0))}else if(l.includes(",")){var lt=l.split(","),j=Ct(lt),tt;try{for(j.s();!(tt=j.n()).done;){var ct=tt.value;d(this._trace(T(ct,c),r,e,n,a,i,!0))}}catch(m){j.e(m)}finally{j.f()}}else!o&&r&&b.call(r,l)&&d(this._trace(c,r[l],k(e,l),r,l,i,s,!0))}if(this._hasParentSelector)for(var S=0;S<p.length;S++){var I=p[S];if(I&&I.isParentSelector){var _=this._trace(I.expr,r,I.path,n,a,i,s);if(Array.isArray(_)){p[S]=_[0];for(var ht=_.length,K=1;K<ht;K++)S++,p.splice(S,0,_[K])}else p[S]=_}}return p};f.prototype._walk=function(t,r,e,n,a,i,s,o){if(Array.isArray(e))for(var u=e.length,h=0;h<u;h++)o(h,t,r,e,n,a,i,s);else e&&A(e)==="object"&&Object.keys(e).forEach(function(l){o(l,t,r,e,n,a,i,s)})};f.prototype._slice=function(t,r,e,n,a,i,s){if(!!Array.isArray(e)){var o=e.length,u=t.split(":"),h=u[2]&&Number.parseInt(u[2])||1,l=u[0]&&Number.parseInt(u[0])||0,c=u[1]&&Number.parseInt(u[1])||o;l=l<0?Math.max(0,l+o):Math.min(o,l),c=c<0?Math.max(0,c+o):Math.min(o,c);for(var p=[],d=l;d<c;d+=h){var y=this._trace(T(d,r),e,n,a,i,s,!0);y.forEach(function(R){p.push(R)})}return p}};f.prototype._eval=function(t,r,e,n,a,i){t.includes("@parentProperty")&&(this.currSandbox._$_parentProperty=i,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=f.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)}};f.cache={};f.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};f.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};f.toPathArray=function(t){var r=f.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(i,s){return"[#"+(e.push(s)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(i,s){return"['"+s.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(i,s){return";"+s.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),a=n.split(";").map(function(i){var s=i.match(/#([0-9]+)/);return!s||!s[1]?i:e[s[1]]});return r[t]=a,r[t].concat()};var Tt=function(r,e,n){for(var a=r.length,i=0;i<a;i++){var s=r[i];n(s)&&e.push(r.splice(i--,1)[0])}};f.prototype.vm={runInNewContext:function(r,e){var n=Object.keys(e),a=[];Tt(n,a,function(h){return typeof e[h]=="function"});var i=n.map(function(h,l){return e[h]}),s=a.reduce(function(h,l){var c=e[l].toString();return/function/.test(c)||(c="function "+c),"var "+l+"="+c+";"+h},"");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 o=r.lastIndexOf(";"),u=o>-1?r.slice(0,o+1)+" return "+r.slice(o+1):" return "+r;return H(Function,nt(n).concat([u])).apply(void 0,nt(i))}};function G(t,r,e,n){return g(this,null,function*(){let a=new Date,i=yield fetch(t,r);if(!i.ok)throw new Error("Fetch failed");let s=new Date(i.headers.get("date"));var o=i;if(n(i,"cached"),s<a){let u=yield fetch(t+"?"+Math.random(),w(v({},r),{method:"HEAD",cache:"no-cache"}));if(u.headers.get("last-modified")!=i.headers.get("last-modified")){if(e(u)===!1)throw new Error("Response is stale");o=yield fetch(t,w(v({},r),{cache:"reload"}))}}if(e(o)===!1)throw new Error("Response is not valid");return i!==o&&n(o,"valid"),o})}function Dt({cdn:t="https://feaascomponentsapidev.blob.core.windows.net",hostname:r,library:e,component:n,version:a,revision:i="published"}){return`${t||r}/components/${e}/${n}/${a}/${i}.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 U(t,r){return g(this,null,function*(){return G(Dt(t),{},e=>e.headers.get("x-ms-meta-versionDeletedAt")==null,e=>{e.text().then(r)})})}function J(t,r){return g(this,null,function*(){return G(_t(t),{},e=>e.headers.get("x-ms-meta-deletedAt")==null,e=>{e.text().then(r)})})}function Xt(t,r){let e=document.createElement("div");e.innerHTML=t;let n=document.createDocumentFragment();for(;e.firstChild;)n.appendChild(e.firstChild);return D(n,r),e}function xt(t){return t.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function Mt(t){return xt(t)+".*"}function ut(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 Lt(t,r,e){let n=t.getAttribute("data-path-scope");if(n==null)return;var a=ut(t);if(a!=0)return;let i=t.parentElement;if(i!=null){r==0?t.style.display="none":t.style.display&&(t.style.display="",t.getAttribute("style")==""&&t.removeAttribute("style"));for(var s=a+1,o=t,u=t;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(s++,o=u);for(var h=s;h<r;h++)i.insertBefore(o.cloneNode(!0),o.nextElementSibling);for(var h=Math.max(1,r);h<s;h++)o=o.previousElementSibling,i.removeChild(o.nextElementSibling)}}function st(t,r,e=!1,n=t){var a=r;let i=Object.keys(t).sort((o,u)=>u.length-o.length);for(let o of i)if(r.startsWith(o)){if(o==r){if(e)return t[o];continue}a=r.substring(o.length+1),n=t[o];break}let s=f({path:a,json:n});return e&&s&&Array.isArray(s)?s[0]:s}function N(t,r,e,n){var l;if(!!t){var a=t;n!=null&&n.processValue&&(e=n==null?void 0:n.processValue(t,r,e));var i=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")i="innerHTML";else if(r=="data-embed-src")Q(t,e);else if(r=="data-path-attributes"){let c=((l=t.getAttribute("data-attributes-keys"))==null?void 0:l.split(",").filter(Boolean))||[];for(var s in e){var o=e[s];N(t,s,typeof o=="object"&&o?JSON.stringify(o):o,n)}for(var u=0;u<c.length;u++)(e==null||!(c[u]in e))&&N(t,c[u],null,n);N(t,"data-attributes-keys",Object.keys(e||{}).join(","));return}if(typeof e=="boolean"&&(e=e?"":null),!!a){var h=String(t.getAttribute("data-path-placeholder")||a[i]);e!=null?i=="innerHTML"?a.innerHTML!=e&&(a.innerHTML=e):a.getAttribute(i)!=e&&a.setAttribute(i,e):i=="innerHTML"?a.innerHTML=h:a.removeAttribute(i)}}}function Ot(t){let r=new t.ownerDocument.defaultView.MutationObserver(e=>{e.forEach(n=>{let a=n.target,i=a.getAttribute("data-embed-src");i&&Q(a,i),n.addedNodes&&n.addedNodes.forEach(s=>{s.nodeType==1&&kt(s,!1)})})});return r.observe(t,{attributes:!0,subtree:!0,childList:!0}),r}function kt(t,r=!0){let e=t.querySelectorAll("[data-embed-src]");for(var n=0;n<e.length;n++){let a=e[n];Q(a,a.getAttribute("data-embed-src"))}if(r)return Ot(t)}function Q(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 i=e.ownerDocument.createElement("script");i.type="module",i.src=r,e.appendChild(i);break}}var ot=["data-attributes-keys","data-path-attributes","data-path-scope"];function D(t,r,e,n){var s,o,u;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 h=a.getAttribute("data-path-scope");if(h){let c=ut(a),p=st(r,h,!1)||[];c==0&&Lt(a,((o=e==null?void 0:e.shouldRepeat)==null?void 0:o.call(e,a,p))===!1?1:p.length,e),r=w(v({},r),{[Mt(h)]:p[c]})}let l=Array.prototype.slice.call(a.attributes).sort((c,p)=>ot.indexOf(c.name)-ot.indexOf(p.name));for(var i=0;i<l.length;i++){let{name:c,value:p}=l[i];c.startsWith("data-path")&&c!="data-path-scope"&&N(a,c,st(r,p,!0),e),c=="data-embed-src"&&N(a,c,a.getAttribute(c),e)}}for(var i=0;i<a.children.length;i++)D(a.children[i],r,e,!0);return n||(u=e==null?void 0:e.onRender)==null||u.call(e,a,r),a}function W(t,r,e,n){var i;let a=((i=n==null?void 0:n.processTemplate)==null?void 0:i.call(n,t,r,e))||r;return t.innerHTML=a,t.classList.add("-feaas"),D(t,e,n)}function Yt(t,r){return Ht(t,r||(r=document.createElement("style"))),r}function Ht(t,r){return r||(r=document.createElement("style")),J(t,e=>{r.textContent=e}).then(()=>r)}function Gt(t,r){return $t(t,r||(r=document.createElement("div"))),r}function $t(t,r){return g(this,null,function*(){return r||(r=document.createElement("div")),r.childNodes.length?D(r,t.data,t):"template"in t?W(r,t.template,t.data,t):U(t,e=>W(r,e,t.data,t)).then(()=>r)})}var F=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 i,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,(i=n.refs).parent||(i.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 g(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 i,s,o;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?(i=this.forceUpdateReact)==null||i.call(this):(o=(s=this.refs.topReact).forceUpdateReact)==null||o.call(s)}invokeReactRendering(){let{React:e,ReactDOM:n}=this.payload||{},a=this.descendants.filter(i=>i.refs.parentReact==this&&i.payload).map((i,s)=>e.createElement(this.getReactWrapper(i),{key:this.tagName+"-"+s,slot:i.getAttribute("slot")}));return this.renderReact(w(v({},this.props),{children:a}),this.payload)}getReactWrapper(e=this,n=e.tagName){let a=e.reactWrapper||(e.reactWrapper=i=>{if(e.renderReact){let{React:s,ReactDOM:o}=e.payload||{},[u,h]=s.useReducer(l=>l+1,0);return e.forceUpdateReact=h,o.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=v(v({},this.overrides),e),this.props=v(v({},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,i;return(i=(a=n.closest(`[${e}]`))==null?void 0:a.getAttribute(e))!=null?i: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 z=class extends F{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=`
4
4
  #loader {
5
5
  position: absolute;
6
6
  top: 0;
@@ -64,4 +64,4 @@ 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)}};z.observedAttributes=["hidden"];z.register("feaas-loader");function Bt(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 Z=class extends F{getProps(){return Bt(this)}isReadyToLoad(){return this.props.library!=null&&this.props.revision!=null&&this.props.cdn!=null}load(){return g(this,null,function*(){J(this.props,this.onLoad)})}render(){this.stylesheet||(this.stylesheet=document.createElement("style"),this.appendChild(this.stylesheet)),this.stylesheet.textContent=this.payload}};Z.register("feaas-stylesheet");function Nt(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 F{setData(e){this.set({data:e})}getProps(){return Nt(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 g(this,null,function*(){if(!this.getOriginal())try{U(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)D(this,this.props.data);else{if(this.needsRefresh=!0,this.getOriginal())return;W(this,this.payload,this.props.data)}}};q.observedAttributes=["library","component","version","revision","hostname","cdn","template","data"];q.register("feaas-component");export{q as FEAASComponent,Nt as FEAASComponentsProps,z as FEAASLoader,ee as FEAASLoaderProps,Z as FEAASStylesheet,Bt as FEAASStylesheetProps,kt as autoloadScripts,xt as cleanCollectionBit,G as fetchAndRevalidate,Q as loadScript,Mt as normalizeCollectionScope,Ot as observeDOMElement,st as queryScopes,Gt as renderComponent,Xt as renderComponentElement,$t as renderComponentPromise,W as renderDOMContent,D as renderDOMElement,Yt as renderStylesheet,Ht as renderStylesheetPromise,N as setDOMAttribute};
67
+ </div>`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}};z.observedAttributes=["hidden"];z.register("feaas-loader");function Bt(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"))||(t==null?void 0:t.getContextAttribute("hostname"))}}var Z=class extends F{getProps(){return Bt(this)}isReadyToLoad(){return this.props.library!=null&&this.props.revision!=null&&this.props.cdn!=null}load(){return g(this,null,function*(){J(this.props,this.onLoad)})}render(){this.stylesheet||(this.stylesheet=document.createElement("style"),this.appendChild(this.stylesheet)),this.stylesheet.textContent=this.payload}};Z.register("feaas-stylesheet");function Nt(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 F{setData(e){this.set({data:e})}getProps(){return Nt(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 g(this,null,function*(){if(!this.getOriginal())try{U(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)D(this,this.props.data);else{if(this.needsRefresh=!0,this.getOriginal())return;W(this,this.payload,this.props.data)}}};q.observedAttributes=["library","component","version","revision","hostname","cdn","template","data"];q.register("feaas-component");export{q as FEAASComponent,Nt as FEAASComponentsProps,z as FEAASLoader,ee as FEAASLoaderProps,Z as FEAASStylesheet,Bt as FEAASStylesheetProps,kt as autoloadScripts,xt as cleanCollectionBit,G as fetchAndRevalidate,Q as loadScript,Mt as normalizeCollectionScope,Ot as observeDOMElement,st as queryScopes,Gt as renderComponent,Xt as renderComponentElement,$t as renderComponentPromise,W as renderDOMContent,D as renderDOMElement,Yt as renderStylesheet,Ht as renderStylesheetPromise,N as setDOMAttribute};
@@ -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)}};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 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 q=class extends m{setData(e){this.set({data:e})}getProps(){return wt(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 Rt(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=Rt(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(w=>w.id==o||!o))||[],[T]);if(!!g)return O(e,({picker:w,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:w,chrome:E&&React.createElement(C,null),children:g.reduceVersionRevisions(b).filter(S=>{var R;return D||!((R=S.saved||S.draft)!=null&&R.deletedAt)}).map((S,R)=>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=`
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"))||(t==null?void 0:t.getContextAttribute("hostname"))}}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 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 q=class extends m{setData(e){this.set({data:e})}getProps(){return wt(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 Rt(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=Rt(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(w=>w.id==o||!o))||[],[T]);if(!!g)return O(e,({picker:w,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:w,chrome:E&&React.createElement(C,null),children:g.reduceVersionRevisions(b).filter(S=>{var R;return D||!((R=S.saved||S.draft)!=null&&R.deletedAt)}).map((S,R)=>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 library='${n}'>
69
69
  <feaas-picker mode='${i}'>
70
70
  <feaas-loader />
71
71
  </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:a}){let u={containerRef:{current:this.getRoot()}};return i.defaultProps={hasArrow:!0,placement:"top",portalProps:u},a.createElement(o,{libraryId:this.props.library,container:this.getRoot(),getTheme:this.getTheme,modalProps:{portalProps:u},chakraProps:{cssVarsRoot:":host",resetCSS:!0,toastOptions:{portalProps:u}}},e)}};V.observedAttributes=["library","component","version","revision","hostname","template"];V.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:a}){let u={containerRef:{current:this.getRoot()}};return i.defaultProps={hasArrow:!0,placement:"top",portalProps:u},a.createElement(o,{libraryId:this.props.library,container:this.getRoot(),getToken:this.props.getToken,getTheme:this.getTheme,modalProps:{portalProps:u},chakraProps:{cssVarsRoot:":host",resetCSS:!0,toastOptions:{portalProps:u}}},e)}};V.observedAttributes=["library","component","version","revision","hostname","template"];V.register("feaas-context");
@@ -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)}};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(w=>w.id==o||!o))||[],[T]);if(!!g)return _(e,({picker:w,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:w,chrome:E&&React.createElement(C,null),children:g.reduceVersionRevisions(b).filter(S=>{var R;return D||!((R=S.saved||S.draft)!=null&&R.deletedAt)}).map((S,R)=>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=`
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"))||(t==null?void 0:t.getContextAttribute("hostname"))}}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(w=>w.id==o||!o))||[],[T]);if(!!g)return _(e,({picker:w,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:w,chrome:E&&React.createElement(C,null),children:g.reduceVersionRevisions(b).filter(S=>{var R;return D||!((R=S.saved||S.draft)!=null&&R.deletedAt)}).map((S,R)=>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 library='${n}'>
69
69
  <feaas-picker mode='${i}'>
70
70
  <feaas-loader />
71
71
  </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})}};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:a}){let u={containerRef:{current:this.getRoot()}};return i.defaultProps={hasArrow:!0,placement:"top",portalProps:u},a.createElement(o,{libraryId:this.props.library,container:this.getRoot(),getTheme:this.getTheme,modalProps:{portalProps:u},chakraProps:{cssVarsRoot:":host",resetCSS:!0,toastOptions:{portalProps:u}}},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};
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:a}){let u={containerRef:{current:this.getRoot()}};return i.defaultProps={hasArrow:!0,placement:"top",portalProps:u},a.createElement(o,{libraryId:this.props.library,container:this.getRoot(),getToken:this.props.getToken,getTheme:this.getTheme,modalProps:{portalProps:u},chakraProps:{cssVarsRoot:":host",resetCSS:!0,toastOptions:{portalProps:u}}},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};
@@ -1432,7 +1432,7 @@ function FEAASStylesheetProps(element = this) {
1432
1432
  return {
1433
1433
  library: element == null ? void 0 : element.getContextAttribute("library"),
1434
1434
  revision: (_a = element == null ? void 0 : element.getAttribute("revision")) != null ? _a : "published",
1435
- cdn: element == null ? void 0 : element.getContextAttribute("cdn")
1435
+ cdn: (element == null ? void 0 : element.getContextAttribute("cdn")) || (element == null ? void 0 : element.getContextAttribute("hostname"))
1436
1436
  };
1437
1437
  }
1438
1438
  var FEAASStylesheet = class extends FEAASBase {
@@ -1390,7 +1390,7 @@ function FEAASStylesheetProps(element = this) {
1390
1390
  return {
1391
1391
  library: element == null ? void 0 : element.getContextAttribute("library"),
1392
1392
  revision: (_a = element == null ? void 0 : element.getAttribute("revision")) != null ? _a : "published",
1393
- cdn: element == null ? void 0 : element.getContextAttribute("cdn")
1393
+ cdn: (element == null ? void 0 : element.getContextAttribute("cdn")) || (element == null ? void 0 : element.getContextAttribute("hostname"))
1394
1394
  };
1395
1395
  }
1396
1396
  var FEAASStylesheet = class extends FEAASBase {
@@ -1441,7 +1441,7 @@ function FEAASStylesheetProps(element = this) {
1441
1441
  return {
1442
1442
  library: element == null ? void 0 : element.getContextAttribute("library"),
1443
1443
  revision: (_a = element == null ? void 0 : element.getAttribute("revision")) != null ? _a : "published",
1444
- cdn: element == null ? void 0 : element.getContextAttribute("cdn")
1444
+ cdn: (element == null ? void 0 : element.getContextAttribute("cdn")) || (element == null ? void 0 : element.getContextAttribute("hostname"))
1445
1445
  };
1446
1446
  }
1447
1447
  var FEAASStylesheet = class extends FEAASBase {
@@ -1913,6 +1913,7 @@ var FEAASContext = class extends FEAASBase {
1913
1913
  return /* @__PURE__ */ React2.createElement(AppContext, {
1914
1914
  libraryId: this.props.library,
1915
1915
  container: this.getRoot(),
1916
+ getToken: this.props.getToken,
1916
1917
  getTheme: this.getTheme,
1917
1918
  modalProps: {
1918
1919
  portalProps
@@ -1390,7 +1390,7 @@ function FEAASStylesheetProps(element = this) {
1390
1390
  return {
1391
1391
  library: element == null ? void 0 : element.getContextAttribute("library"),
1392
1392
  revision: (_a = element == null ? void 0 : element.getAttribute("revision")) != null ? _a : "published",
1393
- cdn: element == null ? void 0 : element.getContextAttribute("cdn")
1393
+ cdn: (element == null ? void 0 : element.getContextAttribute("cdn")) || (element == null ? void 0 : element.getContextAttribute("hostname"))
1394
1394
  };
1395
1395
  }
1396
1396
  var FEAASStylesheet = class extends FEAASBase {
@@ -1862,6 +1862,7 @@ var FEAASContext = class extends FEAASBase {
1862
1862
  return /* @__PURE__ */ React2.createElement(AppContext, {
1863
1863
  libraryId: this.props.library,
1864
1864
  container: this.getRoot(),
1865
+ getToken: this.props.getToken,
1865
1866
  getTheme: this.getTheme,
1866
1867
  modalProps: {
1867
1868
  portalProps
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sitecore-feaas/clientside",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "scripts": {
5
5
  "start": "webpack serve --open",
6
6
  "build": "rm -rf dist; npm run build:node; npm run build:browser;",
@@ -73,6 +73,7 @@ export class FEAASContext extends FEAASBase<FEAASContextProps, typeof FEAASConte
73
73
  <AppContext
74
74
  libraryId={this.props.library}
75
75
  container={this.getRoot()}
76
+ getToken={this.props.getToken}
76
77
  getTheme={this.getTheme}
77
78
  modalProps={{
78
79
  portalProps
@@ -5,7 +5,7 @@ export function FEAASStylesheetProps(element: FEAASBase = this) {
5
5
  return {
6
6
  library: element?.getContextAttribute('library'),
7
7
  revision: (element?.getAttribute('revision') ?? 'published') as 'published' | 'staging' | 'saved' | number,
8
- cdn: element?.getContextAttribute('cdn')
8
+ cdn: element?.getContextAttribute('cdn') || element?.getContextAttribute('hostname')
9
9
  }
10
10
  }
11
11
  export type FEAASStylesheetProps = ReturnType<typeof FEAASStylesheetProps>
@@ -1,7 +1,7 @@
1
1
  import { FEAASBase } from './FEAASBase.js';
2
2
  export declare function FEAASStylesheetProps(element?: FEAASBase): {
3
3
  library: string;
4
- revision: number | "staging" | "published" | "saved";
4
+ revision: number | "published" | "staging" | "saved";
5
5
  cdn: string;
6
6
  };
7
7
  export declare type FEAASStylesheetProps = ReturnType<typeof FEAASStylesheetProps>;
@@ -9,7 +9,7 @@ export declare class FEAASStylesheet extends FEAASBase<FEAASStylesheetProps, str
9
9
  stylesheet: HTMLStyleElement;
10
10
  getProps(): {
11
11
  library: string;
12
- revision: number | "staging" | "published" | "saved";
12
+ revision: number | "published" | "staging" | "saved";
13
13
  cdn: string;
14
14
  };
15
15
  isReadyToLoad(): boolean;