@sitecore-feaas/clientside 0.3.14 → 0.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/FEAASComponent.js +2 -0
- package/build/components/FEAASComponent.js.map +1 -1
- package/build/components/FEAASElement.js +14 -5
- package/build/components/FEAASElement.js.map +1 -1
- package/build/ui/react.js +2 -0
- package/build/ui/react.js.map +1 -1
- package/dist/browser/headless.cjs +2 -2
- package/dist/browser/headless.cjs.map +2 -2
- package/dist/browser/headless.esm.js +2 -2
- package/dist/browser/headless.esm.js.map +1 -1
- package/dist/browser/index.cjs +2 -2
- package/dist/browser/index.cjs.map +2 -2
- package/dist/browser/index.esm.js +2 -2
- package/dist/browser/index.esm.js.map +1 -1
- package/dist/browser/react.cjs +6 -6
- package/dist/browser/react.cjs.map +2 -2
- package/dist/browser/react.esm.js +5 -5
- package/dist/browser/react.esm.js.map +1 -1
- package/dist/node/headless.cjs +2 -2
- package/dist/node/headless.cjs.map +2 -2
- package/dist/node/headless.esm.js +2 -2
- package/dist/node/headless.esm.js.map +2 -2
- package/dist/node/index.cjs +2 -2
- package/dist/node/index.cjs.map +2 -2
- package/dist/node/index.esm.js +2 -2
- package/dist/node/index.esm.js.map +2 -2
- package/dist/node/react.cjs +3 -3
- package/dist/node/react.cjs.map +2 -2
- package/dist/node/react.esm.js +4 -4
- package/dist/node/react.esm.js.map +2 -2
- package/headless.cjs +2 -2
- package/headless.cjs.map +2 -2
- package/headless.js +2 -2
- package/headless.js.map +2 -2
- package/package.json +1 -1
- package/react.cjs +6 -6
- package/react.cjs.map +2 -2
- package/react.js +6 -6
- package/react.js.map +2 -2
- package/src/components/FEAASComponent.tsx +2 -1
- package/src/components/FEAASElement.tsx +15 -5
- package/src/ui/react.tsx +2 -0
- package/test/ServerComponent.test.tsx +8 -8
- package/types/components/FEAASComponent.d.ts.map +1 -1
- package/types/components/FEAASElement.d.ts +1 -0
- package/types/components/FEAASElement.d.ts.map +1 -1
- package/types/tsbuildinfo +1 -1
- package/types/ui/react.d.ts.map +1 -1
- package/types/ui/tsbuildinfo +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var Qe=Object.defineProperty;var H=(e,t)=>{for(var r in t)Qe(e,r,{get:t[r],enumerable:!0})};function S(e,t=r=>{}){var r;let n=()=>{var i,a;let o=new Promise((u,c)=>{i=l=>{e==null||e(l),u(l)},a=c});var s=Object.assign(o,{resolve:i,reject:a,restart:n,first:r});return r=s,s.catch(t),s};return n()}var Xe=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,x=class extends Xe{getProps(t){return{}}constructor(){super(),this.defaultProps={},this.connected=!1,this.refs={},this.descendants=[],this.whenLoaded=S(t=>{this.payload=t}),this.whenRendered=S(()=>this.initialized=!0,()=>cancelAnimationFrame(this.nextRender)),this.addEventListener("feaasMount",this),this.addEventListener("feaasUnmount",this)}getRoot(){return this}attributeChangedCallback(t,r,n){this.set()}connectedCallback(){this.mount()}disconnectedCallback(){this.unmount()}mount(){try{let t=this.getParent();if(t&&!t.connected||this.connected)return;this.connected=!0,this.log("FEAAS: Mount",this.tagName,this),this.dispatchEventIndirectly(new Event("feaasMount",{bubbles:!0,composed:!0})),this.getElements().map(r=>{var n;return(n=r.mount)===null||n===void 0?void 0:n.call(r)}),this.set()}catch(t){this.onError(t)}}dispatchEventIndirectly(t){this.dispatchEvent(t);let r=this.getParent();r&&!r.contains(this)&&(Object.defineProperty(t,"target",{value:this,writable:!1}),Object.defineProperty(t,"composedPath",{value:()=>[this],writable:!1}),r.handleEvent(t))}isJSONAttribute(t){return!1}log(...t){if(typeof process!="undefined"&&process.env.TESTING)return;let r=t[0];(typeof location!="undefined"&&(location!=null&&location.hostname.startsWith("components-"))||localStorage["Sitecore.Components.Debug"])&&console.log(r+" "+t.slice(1).map(n=>n&&typeof n=="object"?"%O":"%s").join(" "),...t.slice(1))}unmount(){this.connected&&(this.log("FEAAS: Unmount",this),this.dispatchEventIndirectly(new Event("feaasUnmount",{bubbles:!0,composed:!0})),this.connected=!1)}getParent(t=!0){for(var r=this;r=r.parentElement||(r.parentNode instanceof ShadowRoot?r.parentNode.host:null);)if(!t||r.tagName.startsWith("FEAAS-"))return r;if(this.tagName!="FEAAS-CONTEXT")return document.querySelector("feaas-context")}getElements(t=this.getRoot(),r=!0){return Array.from(t.querySelectorAll("*")).map(n=>[!r||n.tagName.startsWith("FEAAS-")?n:null,n.shadowRoot?this.getElements(n.shadowRoot,r):null]).flat().filter(Boolean)}handleEvent(t){let r=t.composedPath()[0];switch(t.type){case"feaasMount":r!=this&&this.nestedCallback(r);break;case"feaasUnmount":r!=this&&this.unnestedCallback(r);break}}unnestedCallback(t){let r=this.descendants.indexOf(t);r!=-1&&(this.log("FEAAS: Unnest",this,t),this.descendants.splice(r,1),this.refs[t.getComponentName()]=null,t.refs.parent==this&&(t.refs.parent=null),t.refs.top==this&&(t.refs.top=t.refs.parent))}nestedCallback(t){var r,n;if(this.descendants.indexOf(t)==-1&&(this.descendants.push(t),this.log("FEAAS: Nest",this,t),this.refs[t.getComponentName()]=t,t.refs.top=this,(r=t.refs).parent||(r.parent=this),t.render))for(var a=t.refs.parent;a;a=a.refs.parent)a.render&&((n=t.refs).parentReact||(n.parentReact=a),t.refs.topReact=a)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return this.payload===void 0&&this.getAttribute("hidden")==null}onError(t,r="uncaught",n=!1){let i=new CustomEvent("feaasError",{bubbles:!0,composed:!0,detail:t});if(this.dispatchEventIndirectly(i),this.whenLoaded.reject(t),!i.defaultPrevented&&!n){this.whenRendered.reject(t);try{this.unmount()}catch(a){}return!0}return!1}shouldUpdateOnLoad(){return!0}async advance(){try{if(this.payload===void 0){if(!this.isReadyToLoad())return;this.payload=null,this.dispatchEventIndirectly(new Event("feaasLoad",{bubbles:!0,composed:!0}));let t=await this.load().catch(r=>{throw this.payload=void 0,r});if(this.whenLoaded.resolve(t),this.onLoad)return}else if(this.payload==null)return;this.flush(),this.whenRendered.resolve(this)}catch(t){this.onError(t)}}flush(){var t,r;if(!this.connected)return;let n=(r=(t=this.payload)===null||t===void 0?void 0:t.ReactDOM)===null||r===void 0?void 0:r.flushSync;n?n(()=>this.update()):this.update()}load(){return Promise.resolve(null)}update(){var t,r,n;if(this.payload==null||!this.render)return;let{React:i,ReactDOM:a,ReactDOMClient:o}=this.payload||{};if(!i)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.getAttribute("hydrate")!="false"&&(!this.refs.topReact&&!this.forceUpdateReact?o?(this.reactRoot||(this.reactRoot=o.createRoot(this.getReactRootElement())),this.reactRoot.render(this.getReactElement())):a.render(this.getReactElement(),this.getReactRootElement()):this.forceUpdateReact?(t=this.forceUpdateReact)===null||t===void 0||t.call(this):(n=(r=this.refs.topReact).forceUpdateReact)===null||n===void 0||n.call(r))}invokeReactRendering(){let{React:t,ReactDOM:r}=this.payload||{};if(!this.connected)return null;let n=this.descendants.filter(i=>i.refs.parentReact==this&&i.payload).map((i,a)=>this.getReactElement(i));return this.render({...this.props,children:n},this.payload)}getReactErrorBoundary(t=this,r=t.tagName){if(this.reactErrorBoundary)return this.reactErrorBoundary;let{React:n,ReactDOM:i}=t.payload||{};return this.reactErrorBoundary||(this.reactErrorBoundary=class extends n.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromError(o){return{error:o}}componentDidCatch(o,s){console.error(`FEAAS: ${t.tagName} Error:`,o,s),t.onError(o,"react")}render(){if(!this.state.error)return this.props.children}})}getReactElement(t=this,r){let{React:n,ReactDOM:i}=t.payload||{},a=this.getReactErrorBoundary(),o=this.getReactWrapper(t);return n.createElement(a,{key:t.tagName+"-"+t.getUID(),slot:t.getAttribute("slot")},n.createElement(o,null))}getReactWrapper(t=this,r=t.tagName){if(t.reactWrapper)return t.reactWrapper;let{React:n,ReactDOM:i}=t.payload||{};return t.reactWrapper=a=>{if(t.render){let[o,s]=n.useReducer(u=>u+1,0);return t.forceUpdateReact=s,i.createPortal(n.createElement(n.Fragment,null,t.invokeReactRendering()),t.getReactRootElement())}else return t.update()},Object.assign(t.reactWrapper,{key:t.tagName+"-"+t.getUID(),displayName:r}),t.reactWrapper}getUID(){return this.uid||(this.uid=String(Math.random()))}getShadowRoot(){return this.shadowRoot||this.attachShadow({mode:"open"}),this.shadowRoot}getReactRootElement(){return this.useShadowRoot?this.getShadowRoot():this.getRoot()}set(t){try{this.scheduleRender(),this.overrides={...this.overrides,...t},this.props={...this.getProps(),...this.overrides};for(var r in this.props){let i=this.isJSONAttribute(r),a=this.props[r],o=i?JSON.stringify(a):String(a),s=this.defaultProps[r],u=i?JSON.stringify(s):String(s),c=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),l=this.getAttribute(c);try{var n=i?JSON.stringify(JSON.parse(l)):l}catch(f){var n=null}a==null||o===u?this.removeAttribute(c):(typeof a=="string"||typeof a=="number"||typeof a=="boolean"||i)&&n!=o&&this.setAttribute(c,o)}}catch(i){this.whenRendered.reject(i),this.onError(i,"set")}return this}import(t){return import( /*@vite-ignore*/ /* webpackIgnore: true */ t)}scheduleRender(){this.nextRender==null&&(this.whenRendered=this.whenRendered.restart()),cancelAnimationFrame(this.nextRender),this.nextRender=requestAnimationFrame(()=>{this.nextRender=null,this.advance().catch(t=>{})})}formatURL(t,r){return typeof t=="string"&&t.match(/^\/[^\/]/)?r+t:t}getContextAttribute(t,r=this){for(var n=this;n=n.parentElement||(n.parentNode instanceof ShadowRoot?n.parentNode.host:null);)if(n.getAttribute(t)!=null)return n.getAttribute(t);return this.getAttribute(t)}static register(t,r){r==null&&(r=typeof window!="undefined"?window:null),r&&!r.customElements.get(t)&&r.customElements.define(t,this)}};var N=class extends x{load(){return Promise.all([import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react"),import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react-dom")]).then(([t,r])=>({React:t,ReactDOM:r}))}render({},{React:t}){return t.createElement(t.Fragment,null)}},re=class extends N{constructor(){super(...arguments),this.useShadowRoot=!0}getProps(){return{counter:parseFloat(this.getAttribute("counter"))}}render({counter:t},{React:r}){let[n,i]=r.useState(0);return r.useEffect(()=>{i(a=>a+1)},[t]),r.createElement(r.Fragment,null,r.createElement("p",null,"Rendering attribute: ",t),r.createElement("p",null,"Triggered updates: ",n))}};re.observedAttributes=["counter"];var he={};H(he,{renderDOMContent:()=>$,renderDOMElement:()=>A,renderHTMLContent:()=>Et,setDOMAttribute:()=>T});var se={};H(se,{JSONPath:()=>p,queryObject:()=>I,queryObjectRaw:()=>Re,queryScopes:()=>J,serializeCH1RichText:()=>O});function E(e){return E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E(e)}function _e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ee(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ce(e,t,r){return t&&Ee(e.prototype,t),r&&Ee(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ze(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&j(e,t)}function L(e){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},L(e)}function j(e,t){return j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},j(e,t)}function De(){if(typeof Reflect>"u"||!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{return!1}}function k(e,t,r){return De()?k=Reflect.construct.bind():k=function(i,a,o){var s=[null];s.push.apply(s,a);var u=Function.bind.apply(i,s),c=new u;return o&&j(c,o.prototype),c},k.apply(null,arguments)}function et(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function ne(e){var t=typeof Map=="function"?new Map:void 0;return ne=function(n){if(n===null||!et(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,i)}function i(){return k(n,arguments,L(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),j(i,n)},ne(e)}function tt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rt(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tt(e)}function nt(e){var t=De();return function(){var n=L(e),i;if(t){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return rt(this,i)}}function it(e){return ot(e)||at(e)||Fe(e)||st()}function ot(e){if(Array.isArray(e))return ie(e)}function at(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Fe(e,t){if(e){if(typeof e=="string")return ie(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ie(e,t)}}function ie(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function st(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1
|
+
var Qe=Object.defineProperty;var H=(e,t)=>{for(var r in t)Qe(e,r,{get:t[r],enumerable:!0})};function S(e,t=r=>{}){var r;let n=()=>{var i,a;let o=new Promise((u,c)=>{i=l=>{e==null||e(l),u(l)},a=c});var s=Object.assign(o,{resolve:i,reject:a,restart:n,first:r});return r=s,s.catch(t),s};return n()}var Xe=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,x=class extends Xe{getProps(t){return{}}constructor(){super(),this.defaultProps={},this.connected=!1,this.refs={},this.descendants=[],this.whenLoaded=S(t=>{this.payload=t}),this.whenRendered=S(()=>this.initialized=!0,()=>this.cancelRender()),this.addEventListener("feaasMount",this),this.addEventListener("feaasUnmount",this)}getRoot(){return this}attributeChangedCallback(t,r,n){this.set()}connectedCallback(){this.mount()}disconnectedCallback(){this.unmount()}mount(){try{let t=this.getParent();if(t&&!t.connected||this.connected)return;this.connected=!0,this.log("FEAAS: Mount",this.tagName,this),this.dispatchEventIndirectly(new Event("feaasMount",{bubbles:!0,composed:!0})),this.getElements().map(r=>{var n;return(n=r.mount)===null||n===void 0?void 0:n.call(r)}),this.set()}catch(t){this.onError(t)}}dispatchEventIndirectly(t){this.dispatchEvent(t);let r=this.getParent();r&&!r.contains(this)&&(Object.defineProperty(t,"target",{value:this,writable:!1}),Object.defineProperty(t,"composedPath",{value:()=>[this],writable:!1}),r.handleEvent(t))}isJSONAttribute(t){return!1}log(...t){if(typeof process!="undefined"&&process.env.TESTING)return;let r=t[0];(typeof location!="undefined"&&(location!=null&&location.hostname.startsWith("components-"))||localStorage["Sitecore.Components.Debug"])&&console.log(r+" "+t.slice(1).map(n=>n&&typeof n=="object"?"%O":"%s").join(" "),...t.slice(1))}unmount(){this.connected&&(this.log("FEAAS: Unmount",this),this.dispatchEventIndirectly(new Event("feaasUnmount",{bubbles:!0,composed:!0})),this.cancelRender(),this.connected=!1,this.initialized&&this.render&&this.update())}getParent(t=!0){for(var r=this;r=r.parentElement||(r.parentNode instanceof ShadowRoot?r.parentNode.host:null);)if(!t||r.tagName.startsWith("FEAAS-"))return r;if(this.tagName!="FEAAS-CONTEXT")return document.querySelector("feaas-context")}getElements(t=this.getRoot(),r=!0){return Array.from(t.querySelectorAll("*")).map(n=>[!r||n.tagName.startsWith("FEAAS-")?n:null,n.shadowRoot?this.getElements(n.shadowRoot,r):null]).flat().filter(Boolean)}handleEvent(t){let r=t.composedPath()[0];switch(t.type){case"feaasMount":r!=this&&this.nestedCallback(r);break;case"feaasUnmount":r!=this&&this.unnestedCallback(r);break}}unnestedCallback(t){let r=this.descendants.indexOf(t);r!=-1&&(this.log("FEAAS: Unnest",this,t),this.descendants.splice(r,1),this.refs[t.getComponentName()]=null,t.refs.parent==this&&(t.refs.parent=null),t.refs.top==this&&(t.refs.top=t.refs.parent))}nestedCallback(t){var r,n;if(this.descendants.indexOf(t)==-1&&(this.descendants.push(t),this.log("FEAAS: Nest",this,t),this.refs[t.getComponentName()]=t,t.refs.top=this,(r=t.refs).parent||(r.parent=this),t.render))for(var a=t.refs.parent;a;a=a.refs.parent)a.render&&((n=t.refs).parentReact||(n.parentReact=a),t.refs.topReact=a)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return this.payload===void 0&&this.getAttribute("hidden")==null}onError(t,r="uncaught",n=!1){let i=new CustomEvent("feaasError",{bubbles:!0,composed:!0,detail:t});if(this.dispatchEventIndirectly(i),this.whenLoaded.reject(t),!i.defaultPrevented&&!n){this.whenRendered.reject(t);try{this.unmount()}catch(a){}return!0}return!1}shouldUpdateOnLoad(){return!0}async advance(){try{if(this.payload===void 0){if(!this.isReadyToLoad())return;this.payload=null,this.dispatchEventIndirectly(new Event("feaasLoad",{bubbles:!0,composed:!0}));let t=await this.load().catch(r=>{throw this.payload=void 0,r});if(this.whenLoaded.resolve(t),this.onLoad)return}else if(this.payload==null)return;this.flush(),this.whenRendered.resolve(this)}catch(t){this.onError(t)}}flush(){var t,r;if(!this.connected)return;let n=(r=(t=this.payload)===null||t===void 0?void 0:t.ReactDOM)===null||r===void 0?void 0:r.flushSync;n?n(()=>this.update()):this.update()}load(){return Promise.resolve(null)}update(){var t,r,n;if(this.payload==null||!this.render)return;let{React:i,ReactDOM:a,ReactDOMClient:o}=this.payload||{};if(!i)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.getAttribute("hydrate")!="false"&&(!this.refs.topReact&&!this.forceUpdateReact?o?(this.reactRoot||(this.reactRoot=o.createRoot(this.getReactRootElement())),this.reactRoot.render(this.getReactElement())):a.render(this.getReactElement(),this.getReactRootElement()):this.forceUpdateReact&&this.connected?(t=this.forceUpdateReact)===null||t===void 0||t.call(this):(n=(r=this.refs.topReact)===null||r===void 0?void 0:r.forceUpdateReact)===null||n===void 0||n.call(r))}invokeReactRendering(){let{React:t,ReactDOM:r}=this.payload||{};if(!this.connected)return null;let n=this.descendants.filter(i=>i.refs.parentReact==this&&i.payload&&i.connected).map((i,a)=>this.getReactElement(i));return this.render({...this.props,children:n},this.payload)}getReactErrorBoundary(t=this,r=t.tagName){if(this.reactErrorBoundary)return this.reactErrorBoundary;let{React:n,ReactDOM:i}=t.payload||{};return this.reactErrorBoundary||(this.reactErrorBoundary=class extends n.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromError(o){return{error:o}}componentDidCatch(o,s){console.error(`FEAAS: ${t.tagName} Error:`,o,s),t.onError(o,"react")}render(){if(!this.state.error)return this.props.children}})}getReactElement(t=this,r){let{React:n,ReactDOM:i}=t.payload||{},a=this.getReactErrorBoundary(),o=this.getReactWrapper(t);return n.createElement(a,{key:t.tagName+"-"+t.getUID(),slot:t.getAttribute("slot")},n.createElement(o,null))}getReactWrapper(t=this,r=t.tagName){if(t.reactWrapper)return t.reactWrapper;let{React:n,ReactDOM:i}=t.payload||{};return t.reactWrapper=a=>{if(t.render){let[o,s]=n.useReducer(u=>u+1,0);return t.forceUpdateReact=s,i.createPortal(n.createElement(n.Fragment,null,t.invokeReactRendering()),t.getReactRootElement())}else return t.update()},Object.assign(t.reactWrapper,{key:t.tagName+"-"+t.getUID(),displayName:r}),t.reactWrapper}getUID(){return this.uid||(this.uid=String(Math.random()))}getShadowRoot(){return this.shadowRoot||this.attachShadow({mode:"open"}),this.shadowRoot}getReactRootElement(){return this.useShadowRoot?this.getShadowRoot():this.getRoot()}set(t){try{this.scheduleRender(),this.overrides={...this.overrides,...t},this.props={...this.getProps(),...this.overrides};for(var r in this.props){let i=this.isJSONAttribute(r),a=this.props[r],o=i?JSON.stringify(a):String(a),s=this.defaultProps[r],u=i?JSON.stringify(s):String(s),c=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),l=this.getAttribute(c);try{var n=i?JSON.stringify(JSON.parse(l)):l}catch(f){var n=null}a==null||o===u?this.removeAttribute(c):(typeof a=="string"||typeof a=="number"||typeof a=="boolean"||i)&&n!=o&&this.setAttribute(c,o)}}catch(i){this.whenRendered.reject(i),this.onError(i,"set")}return this}import(t){return import( /*@vite-ignore*/ /* webpackIgnore: true */ t)}scheduleRender(){this.nextRender==null&&(this.whenRendered=this.whenRendered.restart()),this.cancelRender(),this.nextRender=requestAnimationFrame(()=>{this.nextRender=null,this.advance().catch(t=>{})})}cancelRender(){cancelAnimationFrame(this.nextRender)}formatURL(t,r){return typeof t=="string"&&t.match(/^\/[^\/]/)?r+t:t}getContextAttribute(t,r=this){for(var n=this;n=n.parentElement||(n.parentNode instanceof ShadowRoot?n.parentNode.host:null);)if(n.getAttribute(t)!=null)return n.getAttribute(t);return this.getAttribute(t)}static register(t,r){r==null&&(r=typeof window!="undefined"?window:null),r&&!r.customElements.get(t)&&r.customElements.define(t,this)}};var N=class extends x{load(){return Promise.all([import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react"),import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react-dom")]).then(([t,r])=>({React:t,ReactDOM:r}))}render({},{React:t}){return t.createElement(t.Fragment,null)}},re=class extends N{constructor(){super(...arguments),this.useShadowRoot=!0}getProps(){return{counter:parseFloat(this.getAttribute("counter"))}}render({counter:t},{React:r}){let[n,i]=r.useState(0);return r.useEffect(()=>{i(a=>a+1)},[t]),r.createElement(r.Fragment,null,r.createElement("p",null,"Rendering attribute: ",t),r.createElement("p",null,"Triggered updates: ",n))}};re.observedAttributes=["counter"];var he={};H(he,{renderDOMContent:()=>$,renderDOMElement:()=>A,renderHTMLContent:()=>Et,setDOMAttribute:()=>T});var se={};H(se,{JSONPath:()=>p,queryObject:()=>I,queryObjectRaw:()=>Re,queryScopes:()=>J,serializeCH1RichText:()=>O});function E(e){return E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E(e)}function _e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ee(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ce(e,t,r){return t&&Ee(e.prototype,t),r&&Ee(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ze(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&j(e,t)}function L(e){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},L(e)}function j(e,t){return j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},j(e,t)}function De(){if(typeof Reflect>"u"||!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{return!1}}function k(e,t,r){return De()?k=Reflect.construct.bind():k=function(i,a,o){var s=[null];s.push.apply(s,a);var u=Function.bind.apply(i,s),c=new u;return o&&j(c,o.prototype),c},k.apply(null,arguments)}function et(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function ne(e){var t=typeof Map=="function"?new Map:void 0;return ne=function(n){if(n===null||!et(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,i)}function i(){return k(n,arguments,L(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),j(i,n)},ne(e)}function tt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rt(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tt(e)}function nt(e){var t=De();return function(){var n=L(e),i;if(t){var a=L(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return rt(this,i)}}function it(e){return ot(e)||at(e)||Fe(e)||st()}function ot(e){if(Array.isArray(e))return ie(e)}function at(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Fe(e,t){if(e){if(typeof e=="string")return ie(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ie(e,t)}}function ie(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function st(){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 ut(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Fe(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return a=u.done,u},e:function(u){o=!0,s=u},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}var g=Object.prototype.hasOwnProperty;function F(e,t){return e=e.slice(),e.push(t),e}function oe(e,t){return t=t.slice(),t.unshift(e),t}var lt=function(e){Ze(r,e);var t=nt(r);function r(n){var i;return _e(this,r),i=t.call(this,'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),i.avoidNew=!0,i.value=n,i.name="NewError",i}return Ce(r)}(ne(Error));function p(e,t,r,n,i){if(!(this instanceof p))try{return new p(e,t,r,n,i)}catch(u){if(!u.avoidNew)throw u;return u.value}typeof e=="string"&&(i=n,n=r,r=t,t=e,e=null);var a=e&&E(e)==="object";if(e=e||{},this.json=e.json||r,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=g.call(e,"wrap")?e.wrap:!0,this.sandbox=e.sandbox||{},this.preventEval=e.preventEval||!1,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||n||null,this.otherTypeCallback=e.otherTypeCallback||i||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},e.autostart!==!1){var o={path:a?e.path:t};a?"json"in e&&(o.json=e.json):o.json=r;var s=this.evaluate(o);if(!s||E(s)!=="object")throw new lt(s);return s}}p.prototype.evaluate=function(e,t,r,n){var i=this,a=this.parent,o=this.parentProperty,s=this.flatten,u=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,t=t||this.json,e=e||this.path,e&&E(e)==="object"&&!Array.isArray(e)){if(!e.path&&e.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!g.call(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var c=e;t=c.json,s=g.call(e,"flatten")?e.flatten:s,this.currResultType=g.call(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=g.call(e,"sandbox")?e.sandbox:this.currSandbox,u=g.call(e,"wrap")?e.wrap:u,this.currPreventEval=g.call(e,"preventEval")?e.preventEval:this.currPreventEval,r=g.call(e,"callback")?e.callback:r,this.currOtherTypeCallback=g.call(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,a=g.call(e,"parent")?e.parent:a,o=g.call(e,"parentProperty")?e.parentProperty:o,e=e.path}if(a=a||null,o=o||null,Array.isArray(e)&&(e=p.toPathString(e)),!(!e&&e!==""||!t)){var l=p.toPathArray(e);l[0]==="$"&&l.length>1&&l.shift(),this._hasParentSelector=null;var f=this._trace(l,t,["$"],a,o,r).filter(function(d){return d&&!d.isParentSelector});return f.length?!u&&f.length===1&&!f[0].hasArrExpr?this._getPreferredOutput(f[0]):f.reduce(function(d,h){var v=i._getPreferredOutput(h);return s&&Array.isArray(v)?d=d.concat(v):d.push(v),d},[]):u?[]:void 0}};p.prototype._getPreferredOutput=function(e){var t=this.currResultType;switch(t){case"all":{var r=Array.isArray(e.path)?e.path:p.toPathArray(e.path);return e.pointer=p.toPointer(r),e.path=typeof e.path=="string"?e.path:p.toPathString(e.path),e}case"value":case"parent":case"parentProperty":return e[t];case"path":return p.toPathString(e[t]);case"pointer":return p.toPointer(e.path);default:throw new TypeError("Unknown result type")}};p.prototype._handleCallback=function(e,t,r){if(t){var n=this._getPreferredOutput(e);e.path=typeof e.path=="string"?e.path:p.toPathString(e.path),t(n,r,e)}};p.prototype._trace=function(e,t,r,n,i,a,o,s){var u=this,c;if(!e.length)return c={path:r,value:t,parent:n,parentProperty:i,hasArrExpr:o},this._handleCallback(c,a,"value"),c;var l=e[0],f=e.slice(1),d=[];function h(y){Array.isArray(y)?y.forEach(function(Ye){d.push(Ye)}):d.push(y)}if((typeof l!="string"||s)&&t&&g.call(t,l))h(this._trace(f,t[l],F(r,l),t,l,a,o));else if(l==="*")this._walk(t,function(y){h(u._trace(f,t[y],F(r,y),t,y,a,!0,!0))});else if(l==="..")h(this._trace(f,t,r,n,i,a,o)),this._walk(t,function(y){E(t[y])==="object"&&h(u._trace(e.slice(),t[y],F(r,y),t,y,a,!0))});else{if(l==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:f,isParentSelector:!0};if(l==="~")return c={path:F(r,l),value:i,parent:n,parentProperty:null},this._handleCallback(c,a,"property"),c;if(l==="$")h(this._trace(f,t,r,null,null,a,o));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(l))h(this._slice(l,f,t,r,n,i,a));else if(l.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");var v=l.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1");this._walk(t,function(y){u._eval(v,t[y],y,r,n,i)&&h(u._trace(f,t[y],F(r,y),t,y,a,!0))})}else if(l[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");h(this._trace(oe(this._eval(l,t,r[r.length-1],r.slice(0,-1),n,i),f),t,r,n,i,a,o))}else if(l[0]==="@"){var m=!1,b=l.slice(1,-2);switch(b){case"scalar":(!t||!["object","function"].includes(E(t)))&&(m=!0);break;case"boolean":case"string":case"undefined":case"function":E(t)===b&&(m=!0);break;case"integer":Number.isFinite(t)&&!(t%1)&&(m=!0);break;case"number":Number.isFinite(t)&&(m=!0);break;case"nonFinite":typeof t=="number"&&!Number.isFinite(t)&&(m=!0);break;case"object":t&&E(t)===b&&(m=!0);break;case"array":Array.isArray(t)&&(m=!0);break;case"other":m=this.currOtherTypeCallback(t,r,n,i);break;case"null":t===null&&(m=!0);break;default:throw new TypeError("Unknown value type "+b)}if(m)return c={path:r,value:t,parent:n,parentProperty:i},this._handleCallback(c,a,"value"),c}else if(l[0]==="`"&&t&&g.call(t,l.slice(1))){var C=l.slice(1);h(this._trace(f,t[C],F(r,C),t,C,a,o,!0))}else if(l.includes(",")){var qe=l.split(","),B=ut(qe),xe;try{for(B.s();!(xe=B.n()).done;){var Ge=xe.value;h(this._trace(oe(Ge,f),t,r,n,i,a,!0))}}catch(y){B.e(y)}finally{B.f()}}else!s&&t&&g.call(t,l)&&h(this._trace(f,t[l],F(r,l),t,l,a,o,!0))}if(this._hasParentSelector)for(var D=0;D<d.length;D++){var W=d[D];if(W&&W.isParentSelector){var M=this._trace(W.expr,t,W.path,n,i,a,o);if(Array.isArray(M)){d[D]=M[0];for(var Ke=M.length,te=1;te<Ke;te++)D++,d.splice(D,0,M[te])}else d[D]=M}}return d};p.prototype._walk=function(e,t){if(Array.isArray(e))for(var r=e.length,n=0;n<r;n++)t(n);else e&&E(e)==="object"&&Object.keys(e).forEach(function(i){t(i)})};p.prototype._slice=function(e,t,r,n,i,a,o){if(Array.isArray(r)){var s=r.length,u=e.split(":"),c=u[2]&&Number.parseInt(u[2])||1,l=u[0]&&Number.parseInt(u[0])||0,f=u[1]&&Number.parseInt(u[1])||s;l=l<0?Math.max(0,l+s):Math.min(s,l),f=f<0?Math.max(0,f+s):Math.min(s,f);for(var d=[],h=l;h<f;h+=c){var v=this._trace(oe(h,t),r,n,i,a,o,!0);v.forEach(function(m){d.push(m)})}return d}};p.prototype._eval=function(e,t,r,n,i,a){this.currSandbox._$_parentProperty=a,this.currSandbox._$_parent=i,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;var o=e.includes("@path");o&&(this.currSandbox._$_path=p.toPathString(n.concat([r])));var s="script:"+e;if(!p.cache[s]){var u=e.replace(/@parentProperty/g,"_$_parentProperty").replace(/@parent/g,"_$_parent").replace(/@property/g,"_$_property").replace(/@root/g,"_$_root").replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1");o&&(u=u.replace(/@path/g,"_$_path")),p.cache[s]=new this.vm.Script(u)}try{return p.cache[s].runInNewContext(this.currSandbox)}catch(c){throw new Error("jsonPath: "+c.message+": "+e)}};p.cache={};p.toPathString=function(e){for(var t=e,r=t.length,n="$",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[i])||(n+=/^[\*0-9]+$/.test(t[i])?"["+t[i]+"]":"['"+t[i]+"']");return n};p.toPointer=function(e){for(var t=e,r=t.length,n="",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[i])||(n+="/"+t[i].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};p.toPathArray=function(e){var t=p.cache;if(t[e])return t[e].concat();var r=[],n=e.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(a,o){return"[#"+(r.push(o)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(a,o){return"['"+o.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(a,o){return";"+o.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),i=n.split(";").map(function(a){var o=a.match(/#([0-9]+)/);return!o||!o[1]?a:r[o[1]]});return t[e]=i,t[e].concat()};var ct=function(t,r,n){for(var i=t.length,a=0;a<i;a++){var o=t[a];n(o)&&r.push(t.splice(a--,1)[0])}},dt=function(){function e(t){_e(this,e),this.code=t}return Ce(e,[{key:"runInNewContext",value:function(r){var n=this.code,i=Object.keys(r),a=[];ct(i,a,function(l){return typeof r[l]=="function"});var o=i.map(function(l,f){return r[l]}),s=a.reduce(function(l,f){var d=r[f].toString();return/function/.test(d)||(d="function "+d),"var "+f+"="+d+";"+l},"");n=s+n,!/(["'])use strict\1/.test(n)&&!i.includes("arguments")&&(n="var arguments = undefined;"+n),n=n.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"");var u=n.lastIndexOf(";"),c=u>-1?n.slice(0,u+1)+" return "+n.slice(u+1):" return "+n;return k(Function,i.concat([c])).apply(void 0,it(o))}}]),e}();p.prototype.vm={Script:dt};function Re(e,t){try{return p({path:t,json:e})}catch(r){return[]}}function I(e,t){var r;return((r=Re(e,t))===null||r===void 0?void 0:r.flat(1/0))||[]}function J(e,t,r=!1,n=e){var i=t;let a=Object.keys(e).sort((s,u)=>u.length-s.length);for(let s of a)if(t.startsWith(s)){if(s==t){if(r)return e[s];continue}i=t.substring(s.length+1),n=e[s];break}var o=I(n,i);return Array.isArray(o)&&(o==null?void 0:o.length)==0&&(o=[i.replace(/^.*?\./,"_."),i.replace(/^.*?\./,""),i.replace(/^([^.]+).*?\.\$([\.\[])/,"$1$2"),i.replace(/^.*?\.\$([\.\[])/,"_$1"),i.replace(/^.*?\.\$([\.\[])/,"$$$1"),i.replace(/^[^.]+$/,"_")].filter((s,u,c)=>c.indexOf(s)===u).reduce((s,u)=>s.length>0?s:I(n,u),[])),r&&Array.isArray(o)?o[0]:o}function ae(e,t={},r){return r?`<${r}${Object.entries(t).map(([n,i])=>i!=null&&` ${n}="${i}"`).filter(Boolean).join("")}>${O(e)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):O(e)}function O(e){var t;if(Array.isArray(e))return e.map(O).join(`
|
|
4
|
-
`).trim();if(typeof e=="string")return e;if(e==null)return"";switch(e.type){case"heading":let{level:r,...n}=e.attrs;return ae(e.content,n,"h"+r);case"text":return(e.marks||[]).reduce((i,a)=>ae(i,a.attrs,{link:"a",bold:"strong",italic:"em",strike:"s",underline:"u"}[a.type]),(t=e.text)===null||t===void 0?void 0:t.replace(/\s+/," "));default:return ae(e.content||e.text,e.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[e.type])}}var R=class{constructor(t,r=1,n){this.ownerDocument={createElement(i){return new R(i)}},this.nodeName=t,this.nodeType=r,this.textContent=n,this.attributes=[],this.childNodes=[]}setAttribute(t,r){let n=this.attributes.find(i=>i.name===t);n?n.value=r:this.attributes.push({name:t,value:r})}getAttribute(t){let r=this.attributes.find(n=>n.name===t);return r?r.value:void 0}insertBefore(t,r){if(t.parentNode=this,r===null)this.childNodes.push(t);else{let n=this.childNodes.indexOf(r);n!==-1&&this.childNodes.splice(n,0,t)}}removeAttribute(t){let r=this.attributes.findIndex(n=>n.name===t);r!==-1&&this.attributes.splice(r,1)}appendChild(t){t.parentNode=this,this.childNodes.push(t)}get tagName(){var t;return(t=this.nodeName)===null||t===void 0?void 0:t.toUpperCase()}get localName(){var t;return(t=this.nodeName)===null||t===void 0?void 0:t.toLowerCase()}get innerHTML(){return ue(this.childNodes)}set innerHTML(t){this.childNodes=le(String(t!=null?t:""))}get outerHTML(){return ue([this])}get children(){return this.childNodes.filter(t=>t.nodeType==1)}closest(t){let r=this;for(;r;){if(Ne(t,r))return r;r=r.parentNode}return null}querySelectorAll(t){let r=t.split(/\s*,\s*/),n=[],i=a=>{for(let o of r)if(Ne(o,a)){n.push(a);break}for(let o of a.childNodes)i(o)};for(let a of this.childNodes)i(a);return n}querySelector(t){return this.querySelectorAll(t)[0]}findSibling(t,r){if(!this.parentNode)return null;let n=this.parentNode.childNodes,i=n.indexOf(this);if(i===-1)return null;for(let a=i+t;a>=0&&a<n.length;a+=t){let o=n[a];if(!r||o.nodeType===1)return o}return null}removeChild(t){let r=this.childNodes.indexOf(t);if(r!==-1)return this.childNodes.splice(r,1),t.parentNode=void 0,t}get previousSibling(){return this.findSibling(-1)}get nextSibling(){return this.findSibling(1)}get previousElementSibling(){return this.findSibling(-1,!0)}get nextElementSibling(){return this.findSibling(1,!0)}cloneNode(t=!1){let r=new R(this.nodeName,this.nodeType);if(r.attributes=JSON.parse(JSON.stringify(this.attributes)),this.textContent&&(r.textContent=this.textContent),t)for(let n of this.childNodes){let i=n.cloneNode(!0);r.appendChild(i)}return r}get parentElement(){var t;return((t=this.parentNode)===null||t===void 0?void 0:t.nodeType)==1?this.parentNode:null}};function Ne(e,t){let r=e.match(/([.#]?[\w-]+|\[([\w-]+)(="([^"]*)")?\])/g);if(!r)return!1;for(let n of r)if(n.startsWith("#")){if(t.getAttribute("id")!==n.slice(1))return!1}else if(n.startsWith(".")){if(!(t.getAttribute("class")||"").split(" ").includes(n.slice(1)))return!1}else if(n.startsWith("[")){let i=n.match(/^\[([\w-]+)(="([^"]*)")?\]$/);if(i){let a=i[1],o=i[3],s=t.getAttribute(a);if(typeof o=="undefined"){if(s===void 0)return!1}else if(s!==o)return!1}else return!1}else if(t.nodeName!==n)return!1;return!0}function le(e){var t;let r=[],n=[];for(;e;){let i=e.match(/^<([\w-]+)(\s[^>]*)?>/),a=e.match(/^<\/([\w-]+)>/);if(i){let o=i[1],u=((t=(i[2]||"").match(/([\w-]+)(="([^"]*)")?/g))===null||t===void 0?void 0:t.map(l=>{let[f,d,,h]=l.match(/([\w-]+)(="([^"]*)")?/);return{name:d,value:ft(h||"")}}))||[],c=new R(o,1);if(c.attributes=u,n.length>0){let l=n[n.length-1];l.childNodes.push(c),c.parentNode=l}else r.push(c);n.push(c),e=e.slice(i[0].length)}else if(a)n.pop(),e=e.slice(a[0].length);else{let o=e.indexOf("<"),s=e.slice(0,o!==-1?o:void 0),u=new R("#text",3);if(u.textContent=s,n.length>0){let c=n[n.length-1];c.childNodes.push(u),u.parentNode=c}else r.push(u);e=e.slice(s.length)}}return r}function ht(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ft(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")}function ue(e){return e.map(t=>{if(t.nodeType===3)return t.textContent||"";let{nodeName:r,attributes:n}=t,i=n.map(({name:o,value:s})=>` ${o}="${ht(String(s))}"`).join(""),a=ue(t.childNodes);return["img","input","br"].includes(r)?`<${r}${i} />`:`<${r}${i}>${a}</${r}>`}).join("")}function pt(e){let t=new e.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,a=i.getAttribute("data-embed-src");a&&z(i,a),n.addedNodes&&n.addedNodes.forEach(o=>{o.nodeType==1&&mt(o,!1)})})});return t.observe(e,{attributes:!0,subtree:!0,childList:!0}),t}function mt(e,t=!0){let r=e.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];z(i,i.getAttribute("data-embed-src"))}if(t)return pt(e)}function z(e,t){for(var r=e;r;r=r.parentElement)if(!r.parentElement){let i=r.querySelectorAll("script");for(var n=0;n<i.length;n++)if(i[n].getAttribute("src")==t)return!0;r.tagName=="HTML"&&(r=r.querySelector("head")||r);let a=r.ownerDocument.createElement("script");a.setAttribute("type","module"),a.setAttribute("src",t),r.appendChild(a);break}}var de={};H(de,{adjustNumbers:()=>gt,cleanCollectionBit:()=>V,getHumanizedLabel:()=>wt,getLastPathBit:()=>At,getQualifier:()=>bt,normalizeCollectionScope:()=>ce,parseLimit:()=>yt,parseRange:()=>vt});var yt=e=>{var t;let r=parseInt((t=e==null?void 0:e.match(/\[0:(\d+)\]/))===null||t===void 0?void 0:t[1],10);return!isNaN(r)&&r>0?String(r):null},vt=e=>{var t;let r=(t=e==null?void 0:e.match(/\[([^\]]+)\]/))===null||t===void 0?void 0:t[1].split(/\s*,\s*/g).filter(Boolean).map(n=>{if(n.match(/^-?\d+$/))return n;let i=n.match(/^(\d+):(\d+)$/);return i&&parseInt(i[1],10)<parseInt(i[2],10)?i[1]+"-"+i[2]:null});return r!=null&&r.every(Boolean)?r.join(","):null},bt=e=>{var t;return(t=e==null?void 0:e.match(/(\.\*|\[[^\]]*\])$/))===null||t===void 0?void 0:t[0]};function V(e){return e.replace(/(\.?\[[^\]\[]*\]|\.\*)$/g,"")}function ce(e){return V(e)+".*"}function gt(e,t){return e==null?void 0:e.replace(/(.|^)(\d+)/g,(r,n,i)=>n+(n==":"?i:String(parseInt(i)+t)))}function wt(e,t=2){var r=V(e).split(/]\.|\.\*\./g).pop().split(/\./g).slice(-3);return r=r.filter(n=>isNaN(parseInt(n))),r.map(n=>n.charAt(0).toUpperCase()+n.slice(1)).slice(-t).join(" ")}function At(e){return V(e).split(".").pop()}var St=["January","February","March","April","May","June","July","August","September","October","November","December"],Oe=e=>{if(!e||typeof e.getDay!="function")return;let t=e.getFullYear(),r=St[e.getMonth()],n=e.getDate();return`${r} ${n}, ${t}`},Te=function(e){return String(new Date(e))!=="Invalid Date"&&!isNaN(Number(new Date(e)))};function Pe(e){let t=e.getAttribute("data-path-scope");for(var r=0,n=e;n=n.previousElementSibling;)n.getAttribute("data-path-scope")==t&&r++;return r}function xt(e,t,r){let n=e.getAttribute("data-path-scope");if(n==null)return;var i=Pe(e);if(i!=0)return;let a=e.parentNode;if(a!=null){t==0?e.setAttribute("hidden","hidden"):e.getAttribute("hidden")!=null&&e.removeAttribute("hidden");for(var o=i+1,s=e,u=e;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(o++,s=u);for(var c=o;c<t;c++)a.insertBefore(s.cloneNode(!0),s.nextElementSibling);for(var c=Math.max(1,t);c<o;c++)s=s.previousElementSibling,a.removeChild(s.nextElementSibling)}}function T(e,t,r,n){var i,a;if(!e)return;var o=e;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=O(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(e,t,r));var s=t.replace("data-path-","");if(t=="data-path-src"||t=="data-path-alt"){let m=Array.from(e.children).find(b=>b.localName=="picture")||e;o=e.localName=="img"?e:m.querySelector("img, video")}else if(t=="data-path-href")o=e.querySelector("a")||e.closest("a");else if(t=="data-path-hidden")r=r?null:!0;else if(t=="data-path"||t=="data-embed-html"||t=="html")s="innerHTML";else if(t=="data-embed-src")z(e,r);else if(t=="data-path-attributes"){let m=((i=e.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var u in r){var c=r[u];T(e,u,typeof c=="object"&&c?JSON.stringify(c):c,n)}for(var l=0;l<m.length;l++)(r==null||!(m[l]in r))&&T(e,m[l],null,n);T(e,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!o)return;if((s=="innerHTML"||s=="src")&&(r==null||r==="")){var d=String((a=e.getAttribute("data-path-placeholder")||o[s])!==null&&a!==void 0?a:o.getAttribute(s));s=="innerHTML"?o.innerHTML=d:d?o.setAttribute(s,d):o.removeAttribute(s)}else if(r!=null)if(s=="innerHTML"){for(var h=String(r),v=o;v.parentElement&&v.localName.match(/^(a|var|strong|em|i|b)$/);)v=v.parentElement;v.localName.match(/p|h\d|button|time|li/)&&(h=h.replace(/<(p|h\d|li|ul)[^>]*?>|<\/(p|h\d|li|ul)[^>]*?>/g," ").trim().replace(/\s+/g," ")),String(v.getAttribute("class")).includes("-inline--time")&&Te(h)&&(h=Oe(new Date(h))),o.innerHTML!=h&&(o.innerHTML=h)}else o.getAttribute(s)!=r&&o.setAttribute(s,r);else o.removeAttribute(s)}var $e=["data-attributes-keys","data-path-attributes","data-path-scope"];function A(e,t,r,n){var i,a,o;let s=e;if(n||(t=((i=r==null?void 0:r.processData)===null||i===void 0?void 0:i.call(r,s,t))||t),s.nodeType==1){let l=s.getAttribute("data-path-scope");if(l){let d=Pe(s),h=J(t,l,!1);d==0&&xt(s,((a=r==null?void 0:r.shouldRepeat)===null||a===void 0?void 0:a.call(r,s,h))===!1?1:h.length,r),t={...t,[ce(l)]:h[d]}}let f=Array.prototype.slice.call(s.attributes).sort((d,h)=>$e.indexOf(d.name)-$e.indexOf(h.name));for(var u=0;u<f.length;u++){let{name:d,value:h}=f[u];d.startsWith("data-path")&&d!="data-path-scope"&&T(s,d,J(t,h,!0),r),d=="data-embed-src"&&T(s,d,s.getAttribute(d),r)}}for(var u=0,c;c=s.childNodes[u++];)Me(c)&&A(c,t,r,!0);return n||(o=r==null?void 0:r.onRender)===null||o===void 0||o.call(r,s,t),s}function Me(e){return e.nodeType==1}function $(e,t,r,n){var i;let a=((i=n==null?void 0:n.processTemplate)===null||i===void 0?void 0:i.call(n,e,t,r))||t;if(e.innerHTML=a,e.classList.add("-feaas"),(e.closest(".component.feaas")||e).className.includes("-theme--"))for(var s=0,u;u=e.childNodes[s++];)Me(u)&&(u.className=u.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return A(e,r,n)}function Et(e,t,r,n=!1){var i;let a=((i=r==null?void 0:r.processTemplate)===null||i===void 0?void 0:i.call(r,null,e,t))||e;if(typeof document=="undefined"||n){let o=le(a);return A(o[0],t,r).outerHTML}else{let o=document.createElement("div");return o.innerHTML=a,A(o,t,r),o.innerHTML}}var ke=["initial","check","updated"],q={};function rr(){q={}}async function G(e,t,r,n,i=q){return P({url:e,options:t,validator:r,callback:n,cache:i}).then(K).then(a=>a.response)}function _t(e,t=!1){let r=String(e).replace("?head","");var n=q[r];return!n&&!t&&(n=q[r]={phase:null,initial:S(),check:S(),updated:S(),final:S()}),n}var fe=class extends Error{};async function P({url:e,options:t,validator:r,callback:n,cache:i},a="initial"){let o=new Date;if(i!=null){var s=_t(e);if(ke.indexOf(s.phase)>=ke.indexOf(a))var u=s[a];else s.phase=a}let c=await(u||fetch(e,t));if(!u&&s&&(c.ok?s[a].resolve(c):s[a].reject(new Error("Fetch failed"))),!c.ok)throw new Error("Fetch failed");let l=new Date(c.headers.get("date"))<o||u&&a=="initial"&&(s.phase=="updated"||s.phase=="check");if((r==null?void 0:r(c,l))===!1)throw new fe("Response is not valid");return await(n==null?void 0:n(c,a,l)),{url:e,options:t,isCached:l,response:c,validator:r,callback:n,cache:i}}async function K(e){let{url:t,isCached:r,options:n,validator:i,response:a,cache:o}=e;if(r){let{response:s}=await P({url:t+"?head",options:{...n,method:"HEAD",cache:"no-cache"},validator:i,cache:o},"check");if(s.headers.get("last-modified")!=a.headers.get("last-modified"))return pe(e)}return e}async function pe(e){return P({...e,options:{...e.options,cache:"reload"}},"updated")}var _="https://feaas.blob.core.windows.net";function Y(e){let t=e.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(t){var[,r,n,i,a,o]=t;return{cdn:r,library:n,component:i,version:a,revision:o}}}function or(e){if(!e||!e.library||!e.component)throw new Error("Component requires `library` and `component` properties");return`${e.cdn&&e.cdn!=_?`${e.cdn}/components`:""}/${e.library}/${e.component}/${!e.version||e.version=="responsive"&&(!e.revision||e.revision=="published")?"":e.version}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/(^\/|\/$|\/\/)(?!.+\/components\/)/g,"")}function ar(e){return`${e.cdn&&e.cdn!=_?`${e.cdn}/styles/`:""}${e.library}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function me(e){let t=e.match(/^(?:(.*?)\/styles\/)?([^\/]+)(?:\/(published|staged|saved|\d+)(?:.css)?)?$/);if(t){var[,r,n,i]=t;return{cdn:r,library:n,revision:i}}else{let a=Y(e);if(a){var{cdn:r,library:n,revision:i}=a;return i!=null&&i.match(/\d/)&&(i=void 0),{cdn:r,library:n,revision:i}}}}function Le(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...Y(e.src)}),`${e.cdn||e.hostname||_}/components/${e.library}/${e.component}/${e.version}/${e.revision||"published"}.html`}function Q(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...me(e.src)}),`${e.cdn||e.hostname||_}/styles/${e.library}/${e.revision||"published"}.css`}async function U(e,t,r=!1){let n=s=>s.headers.get("x-ms-meta-versionDeletedAt")==null,i=s=>s.clone().text().then(t),a=await Promise.all([e.instance&&P({options:{headers:{Accept:"text/html"},credentials:"omit"},url:Le({...e,version:e.instance}),validator:n}).catch(s=>s),P({url:Le(e),validator:n}).catch(s=>s)]),o=a.find(s=>s&&"isCached"in s&&s);if(!o||o instanceof Error)throw a.find(u=>u&&u instanceof Error)||new Error("Can not fetch component");return a[0]==o&&console.log("Using fork!",a),await i(o.response),r?o:K({...o,callback:i}).catch(s=>{if(a[0]==o&&(pe({...o,callback:null,validator:null}),console.log("Fork was deleted"),!(a[1]instanceof Error)))return i(a[1].response),K({...a[1],callback:i});throw s})}async function sr(e){typeof e=="string"&&(e={src:e});var t;let{response:r}=await U(e,n=>{t=n},!0);return{...e,template:t,lastModified:r.headers.get("last-modified")}}async function ye(e,t){return typeof e=="string"&&(e={src:e}),G(Q(e),{headers:{Accept:"text/css"},credentials:"omit"},r=>r.headers.get("x-ms-meta-deletedAt")==null,(r,n)=>r.clone().text().then(i=>t(i,n)))}function cr(e,t){return Ct(e,t||(t=document.createElement("style"))),t}function Ct(e,t){return t||(t=document.createElement("style")),ye(e,(r,n)=>{t.textContent=r}).then(()=>t)}function ve(e,t){var r=Dt(e);if(!r)var n=Ft(e);return ye(e,(i,a)=>{n&&(n.textContent=i),t==null||t(i,a)}).then(()=>r||n)}function je(e){return new Promise((t,r)=>{ve(e,t).catch(r)})}function Dt(e){return document.head.querySelector(`style[data-href="${Q(e)}"]`)}function Ft(e){let t=Q(e),r=document.createElement("style");return r.setAttribute("data-href",t),document.head.appendChild(r),r}function pr(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return A(n,t),r}function Ie(e,t){return Rt(e,t||(t=document.createElement("div"))),t}async function Rt(e,t){return t||(t=document.createElement("div")),t.childNodes.length?A(t,e.data,e):"template"in e?$(t,e.template,e.data,e):U(e,r=>$(t,r,e.data,e)).then(()=>t)}function Nt(e){let{params:t,method:r,headers:n,body:i,url:a}=w(e);var o={url:a},s={...n};return n["Content-Type"]==="application/json"&&delete s["Content-Type"],n.Accept==="application/json"&&delete s.Accept,Object.keys(s).length>0&&(o.headers=s),r!=="GET"&&(o.method=r),r==="GET"||r==="HEAD"||Object.keys(i).length===0||(o.body=i),Object.keys(t).length>0&&(o={...o,params:t}),o}var X=e=>{if(typeof e.url!="string")return!1;for(var t in e)if(!(t=="body"||t=="params"||t=="headers"||t=="url"||t==="method"||t=="jsonpath"&&typeof e[t]=="string"))return!1;return!0};function Ue(e){let{url:t,headers:r,params:n,method:i,body:a}=w(e),o,s=r["Content-Type"];i!="GET"&&i!="HEAD"&&(s==="application/json"&&(o=JSON.stringify(a)),s==="multipart/form-data"&&(o=Object.keys(a).reduce((c,l)=>(c.append(l,a[l]),c),new FormData)),s==="application/x-www-form-urlencoded"&&(o=new URLSearchParams(a)));let u=Object.keys(n).length?`?${new URLSearchParams(n)}`:"";return[`${t}${u}`,{headers:r,body:o,method:i}]}function w(e){let t={};for(let r in(e==null?void 0:e.headers)||{})if(e.headers.hasOwnProperty(r)){let n=r.replace(/^[a-z]|\-[a-z]/g,i=>i.toUpperCase());t[n]=e.headers[r]}return t.Accept||(t.Accept="application/json"),{params:(e==null?void 0:e.params)||{},headers:t,jsonpath:String((e==null?void 0:e.jsonpath)||"$"),method:((e==null?void 0:e.method)||"GET").toUpperCase(),body:(e==null?void 0:e.body)||{},url:String((e==null?void 0:e.url)||"")}}var be=async e=>{try{let[t,r]=Ue(e),i=await(await w.fetchImplementation(t,{...r,method:r.method.toLowerCase()})).json();return e.jsonpath&&e.jsonpath!="$"?I(i,e.jsonpath):i}catch(t){return{}}};async function Be(e){if(!e)return e;if(X(e))return be(e);let t=Object.keys(e),r=await Promise.all(t.map(n=>X(e[n])?be(e[n]):null).filter(Boolean));return t.reduce((n,i)=>({...n,[i]:X(e[i])?r.shift():e[i]}),{})}w.clean=Nt;w.toFetchArguments=Ue;w.fetchOne=be;w.fetch=Be;w.isDataSettings=X;w.fetchImplementation=(...e)=>fetch(...e);function Ot(e){var t,r,n,i,a,o,s,u;let c,l=e.getAttribute("src");if(l){let C=Y(l);if(!C)throw new Error(`Could not parse FEAAS Component source: ${l}`);var{cdn:f,library:d,component:h,version:v,revision:m}=C}let b=e.getAttribute("data");if(b!=null&&b!="")try{c=typeof b=="string"?JSON.parse(b):{}}catch(C){console.error(C)}return{data:c||{},cdn:(r=(t=e.getContextAttribute("cdn"))!==null&&t!==void 0?t:f)!==null&&r!==void 0?r:_,library:(n=e.getAttribute("library"))!==null&&n!==void 0?n:d,component:(i=e.getAttribute("component"))!==null&&i!==void 0?i:h,version:(o=(a=e.getAttribute("version"))!==null&&a!==void 0?a:v)!==null&&o!==void 0?o:"responsive",revision:(u=(s=e.getAttribute("revision"))!==null&&s!==void 0?s:m)!==null&&u!==void 0?u:"published",hostname:e.getAttribute("hostname"),template:e.getAttribute("template"),instance:e.getAttribute("instance"),editable:e.getAttribute("editable")!=null,suspended:e.getAttribute("suspended")!=null,lastModified:e.getAttribute("last-modified"),withStylesheet:e.getAttribute("with-stylesheet")!="false"}}var Z=class extends x{setData(t){this.set({data:t})}getProps(){return Ot(this)}isJSONAttribute(t){return t=="data"}attributeChangedCallback(t,r,n){r!==n&&((t=="library"||t=="component"||t=="revision"||t=="version")&&(this.payload=void 0),this.needsRefresh=!0,super.attributeChangedCallback(t,r,n),t==="data"&&this.fetchData())}async fetchData(){this.readyData=void 0,this.whenDataReady=this.whenDataReady.restart();let t=await w.fetch(this.props.data),r=this.alreadyRendered;await this.whenDataReady.resolve(t),r&&this.advance()}getEditor(){var t;return(t=document.querySelector("feaas-context"))===null||t===void 0?void 0:t.refs.editor}constructor(){super(),this.readyData={},this.whenDataReady=S(t=>this.readyData=t,t=>this.onError(t)),this.defaultProps={cdn:_,revision:"published",version:"responsive",withStylesheet:!0,editable:!1,suspended:!1,data:{}},this.onLoad=t=>{this.payload=t,this.advance()},this.getAttribute("data")||this.whenDataReady.resolve({}),this.addEventListener("click",()=>{this.props.editable&&this.edit()})}edit(){let t=this.getEditor();if(t!=null&&t.setTarget(this))return t.open(),!0}getOriginal(){let t=this.getAttribute("data-path-scope");if(t){for(var r=this;(r=r.previousElementSibling)&&r.getAttribute("data-path-scope")==t;)var n=r;return n}}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null&&this.props.component!=null&&this.props.version!=null}async load(){if(this.getOriginal())return;let t=()=>{this.payload&&(r||this.readyData&&this.onLoad(this.payload))};if(this.props.withStylesheet)var r=je({...this.props,revision:"published"}).then(()=>{r=null,t()});return Promise.all([r,this.whenDataReady.then(()=>t()),U(this.props,n=>{this.payload=n,t()})]).then(()=>this.payload)}flush(){this.readyData&&super.flush()}update(){if(this.alreadyRendered=!0,Array.from(this.children).filter(t=>t.tagName!="BR").length>0&&!this.needsRefresh)A(this,this.readyData);else{if(this.needsRefresh=!0,this.getOriginal())return;$(this,this.payload,this.readyData)}}};Z.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet"];Z.register("feaas-component");function Tt(e){return{opacity:e!=null&&e.getAttribute("opacity")?parseFloat(e==null?void 0:e.getAttribute("opacity")):1,hidden:(e==null?void 0:e.getAttribute("hidden"))!=null}}var ee=class extends x{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return Tt(this)}attributeChangedCallback(t,r,n){if(r!==n)return t=="hidden"&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),n?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all")),super.attributeChangedCallback(t,r,n)}connectedCallback(){this.payload=null,super.connectedCallback(),this.attributeChangedCallback("hidden",this.getAttribute("hidden"),this.getAttribute("hidden")),this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
|
|
4
|
+
`).trim();if(typeof e=="string")return e;if(e==null)return"";switch(e.type){case"heading":let{level:r,...n}=e.attrs;return ae(e.content,n,"h"+r);case"text":return(e.marks||[]).reduce((i,a)=>ae(i,a.attrs,{link:"a",bold:"strong",italic:"em",strike:"s",underline:"u"}[a.type]),(t=e.text)===null||t===void 0?void 0:t.replace(/\s+/," "));default:return ae(e.content||e.text,e.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[e.type])}}var R=class{constructor(t,r=1,n){this.ownerDocument={createElement(i){return new R(i)}},this.nodeName=t,this.nodeType=r,this.textContent=n,this.attributes=[],this.childNodes=[]}setAttribute(t,r){let n=this.attributes.find(i=>i.name===t);n?n.value=r:this.attributes.push({name:t,value:r})}getAttribute(t){let r=this.attributes.find(n=>n.name===t);return r?r.value:void 0}insertBefore(t,r){if(t.parentNode=this,r===null)this.childNodes.push(t);else{let n=this.childNodes.indexOf(r);n!==-1&&this.childNodes.splice(n,0,t)}}removeAttribute(t){let r=this.attributes.findIndex(n=>n.name===t);r!==-1&&this.attributes.splice(r,1)}appendChild(t){t.parentNode=this,this.childNodes.push(t)}get tagName(){var t;return(t=this.nodeName)===null||t===void 0?void 0:t.toUpperCase()}get localName(){var t;return(t=this.nodeName)===null||t===void 0?void 0:t.toLowerCase()}get innerHTML(){return ue(this.childNodes)}set innerHTML(t){this.childNodes=le(String(t!=null?t:""))}get outerHTML(){return ue([this])}get children(){return this.childNodes.filter(t=>t.nodeType==1)}closest(t){let r=this;for(;r;){if(Ne(t,r))return r;r=r.parentNode}return null}querySelectorAll(t){let r=t.split(/\s*,\s*/),n=[],i=a=>{for(let o of r)if(Ne(o,a)){n.push(a);break}for(let o of a.childNodes)i(o)};for(let a of this.childNodes)i(a);return n}querySelector(t){return this.querySelectorAll(t)[0]}findSibling(t,r){if(!this.parentNode)return null;let n=this.parentNode.childNodes,i=n.indexOf(this);if(i===-1)return null;for(let a=i+t;a>=0&&a<n.length;a+=t){let o=n[a];if(!r||o.nodeType===1)return o}return null}removeChild(t){let r=this.childNodes.indexOf(t);if(r!==-1)return this.childNodes.splice(r,1),t.parentNode=void 0,t}get previousSibling(){return this.findSibling(-1)}get nextSibling(){return this.findSibling(1)}get previousElementSibling(){return this.findSibling(-1,!0)}get nextElementSibling(){return this.findSibling(1,!0)}cloneNode(t=!1){let r=new R(this.nodeName,this.nodeType);if(r.attributes=JSON.parse(JSON.stringify(this.attributes)),this.textContent&&(r.textContent=this.textContent),t)for(let n of this.childNodes){let i=n.cloneNode(!0);r.appendChild(i)}return r}get parentElement(){var t;return((t=this.parentNode)===null||t===void 0?void 0:t.nodeType)==1?this.parentNode:null}};function Ne(e,t){let r=e.match(/([.#]?[\w-]+|\[([\w-]+)(="([^"]*)")?\])/g);if(!r)return!1;for(let n of r)if(n.startsWith("#")){if(t.getAttribute("id")!==n.slice(1))return!1}else if(n.startsWith(".")){if(!(t.getAttribute("class")||"").split(" ").includes(n.slice(1)))return!1}else if(n.startsWith("[")){let i=n.match(/^\[([\w-]+)(="([^"]*)")?\]$/);if(i){let a=i[1],o=i[3],s=t.getAttribute(a);if(typeof o=="undefined"){if(s===void 0)return!1}else if(s!==o)return!1}else return!1}else if(t.nodeName!==n)return!1;return!0}function le(e){var t;let r=[],n=[];for(;e;){let i=e.match(/^<([\w-]+)(\s[^>]*)?>/),a=e.match(/^<\/([\w-]+)>/);if(i){let o=i[1],u=((t=(i[2]||"").match(/([\w-]+)(="([^"]*)")?/g))===null||t===void 0?void 0:t.map(l=>{let[f,d,,h]=l.match(/([\w-]+)(="([^"]*)")?/);return{name:d,value:ft(h||"")}}))||[],c=new R(o,1);if(c.attributes=u,n.length>0){let l=n[n.length-1];l.childNodes.push(c),c.parentNode=l}else r.push(c);n.push(c),e=e.slice(i[0].length)}else if(a)n.pop(),e=e.slice(a[0].length);else{let o=e.indexOf("<"),s=e.slice(0,o!==-1?o:void 0),u=new R("#text",3);if(u.textContent=s,n.length>0){let c=n[n.length-1];c.childNodes.push(u),u.parentNode=c}else r.push(u);e=e.slice(s.length)}}return r}function ht(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ft(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")}function ue(e){return e.map(t=>{if(t.nodeType===3)return t.textContent||"";let{nodeName:r,attributes:n}=t,i=n.map(({name:o,value:s})=>` ${o}="${ht(String(s))}"`).join(""),a=ue(t.childNodes);return["img","input","br"].includes(r)?`<${r}${i} />`:`<${r}${i}>${a}</${r}>`}).join("")}function pt(e){let t=new e.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,a=i.getAttribute("data-embed-src");a&&z(i,a),n.addedNodes&&n.addedNodes.forEach(o=>{o.nodeType==1&&mt(o,!1)})})});return t.observe(e,{attributes:!0,subtree:!0,childList:!0}),t}function mt(e,t=!0){let r=e.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];z(i,i.getAttribute("data-embed-src"))}if(t)return pt(e)}function z(e,t){for(var r=e;r;r=r.parentElement)if(!r.parentElement){let i=r.querySelectorAll("script");for(var n=0;n<i.length;n++)if(i[n].getAttribute("src")==t)return!0;r.tagName=="HTML"&&(r=r.querySelector("head")||r);let a=r.ownerDocument.createElement("script");a.setAttribute("type","module"),a.setAttribute("src",t),r.appendChild(a);break}}var de={};H(de,{adjustNumbers:()=>gt,cleanCollectionBit:()=>V,getHumanizedLabel:()=>wt,getLastPathBit:()=>At,getQualifier:()=>bt,normalizeCollectionScope:()=>ce,parseLimit:()=>yt,parseRange:()=>vt});var yt=e=>{var t;let r=parseInt((t=e==null?void 0:e.match(/\[0:(\d+)\]/))===null||t===void 0?void 0:t[1],10);return!isNaN(r)&&r>0?String(r):null},vt=e=>{var t;let r=(t=e==null?void 0:e.match(/\[([^\]]+)\]/))===null||t===void 0?void 0:t[1].split(/\s*,\s*/g).filter(Boolean).map(n=>{if(n.match(/^-?\d+$/))return n;let i=n.match(/^(\d+):(\d+)$/);return i&&parseInt(i[1],10)<parseInt(i[2],10)?i[1]+"-"+i[2]:null});return r!=null&&r.every(Boolean)?r.join(","):null},bt=e=>{var t;return(t=e==null?void 0:e.match(/(\.\*|\[[^\]]*\])$/))===null||t===void 0?void 0:t[0]};function V(e){return e.replace(/(\.?\[[^\]\[]*\]|\.\*)$/g,"")}function ce(e){return V(e)+".*"}function gt(e,t){return e==null?void 0:e.replace(/(.|^)(\d+)/g,(r,n,i)=>n+(n==":"?i:String(parseInt(i)+t)))}function wt(e,t=2){var r=V(e).split(/]\.|\.\*\./g).pop().split(/\./g).slice(-3);return r=r.filter(n=>isNaN(parseInt(n))),r.map(n=>n.charAt(0).toUpperCase()+n.slice(1)).slice(-t).join(" ")}function At(e){return V(e).split(".").pop()}var St=["January","February","March","April","May","June","July","August","September","October","November","December"],Oe=e=>{if(!e||typeof e.getDay!="function")return;let t=e.getFullYear(),r=St[e.getMonth()],n=e.getDate();return`${r} ${n}, ${t}`},Te=function(e){return String(new Date(e))!=="Invalid Date"&&!isNaN(Number(new Date(e)))};function Pe(e){let t=e.getAttribute("data-path-scope");for(var r=0,n=e;n=n.previousElementSibling;)n.getAttribute("data-path-scope")==t&&r++;return r}function xt(e,t,r){let n=e.getAttribute("data-path-scope");if(n==null)return;var i=Pe(e);if(i!=0)return;let a=e.parentNode;if(a!=null){t==0?e.setAttribute("hidden","hidden"):e.getAttribute("hidden")!=null&&e.removeAttribute("hidden");for(var o=i+1,s=e,u=e;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(o++,s=u);for(var c=o;c<t;c++)a.insertBefore(s.cloneNode(!0),s.nextElementSibling);for(var c=Math.max(1,t);c<o;c++)s=s.previousElementSibling,a.removeChild(s.nextElementSibling)}}function T(e,t,r,n){var i,a;if(!e)return;var o=e;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=O(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(e,t,r));var s=t.replace("data-path-","");if(t=="data-path-src"||t=="data-path-alt"){let m=Array.from(e.children).find(b=>b.localName=="picture")||e;o=e.localName=="img"?e:m.querySelector("img, video")}else if(t=="data-path-href")o=e.querySelector("a")||e.closest("a");else if(t=="data-path-hidden")r=r?null:!0;else if(t=="data-path"||t=="data-embed-html"||t=="html")s="innerHTML";else if(t=="data-embed-src")z(e,r);else if(t=="data-path-attributes"){let m=((i=e.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var u in r){var c=r[u];T(e,u,typeof c=="object"&&c?JSON.stringify(c):c,n)}for(var l=0;l<m.length;l++)(r==null||!(m[l]in r))&&T(e,m[l],null,n);T(e,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!o)return;if((s=="innerHTML"||s=="src")&&(r==null||r==="")){var d=String((a=e.getAttribute("data-path-placeholder")||o[s])!==null&&a!==void 0?a:o.getAttribute(s));s=="innerHTML"?o.innerHTML=d:d?o.setAttribute(s,d):o.removeAttribute(s)}else if(r!=null)if(s=="innerHTML"){for(var h=String(r),v=o;v.parentElement&&v.localName.match(/^(a|var|strong|em|i|b)$/);)v=v.parentElement;v.localName.match(/p|h\d|button|time|li/)&&(h=h.replace(/<(p|h\d|li|ul)[^>]*?>|<\/(p|h\d|li|ul)[^>]*?>/g," ").trim().replace(/\s+/g," ")),String(v.getAttribute("class")).includes("-inline--time")&&Te(h)&&(h=Oe(new Date(h))),o.innerHTML!=h&&(o.innerHTML=h)}else o.getAttribute(s)!=r&&o.setAttribute(s,r);else o.removeAttribute(s)}var $e=["data-attributes-keys","data-path-attributes","data-path-scope"];function A(e,t,r,n){var i,a,o;let s=e;if(n||(t=((i=r==null?void 0:r.processData)===null||i===void 0?void 0:i.call(r,s,t))||t),s.nodeType==1){let l=s.getAttribute("data-path-scope");if(l){let d=Pe(s),h=J(t,l,!1);d==0&&xt(s,((a=r==null?void 0:r.shouldRepeat)===null||a===void 0?void 0:a.call(r,s,h))===!1?1:h.length,r),t={...t,[ce(l)]:h[d]}}let f=Array.prototype.slice.call(s.attributes).sort((d,h)=>$e.indexOf(d.name)-$e.indexOf(h.name));for(var u=0;u<f.length;u++){let{name:d,value:h}=f[u];d.startsWith("data-path")&&d!="data-path-scope"&&T(s,d,J(t,h,!0),r),d=="data-embed-src"&&T(s,d,s.getAttribute(d),r)}}for(var u=0,c;c=s.childNodes[u++];)Me(c)&&A(c,t,r,!0);return n||(o=r==null?void 0:r.onRender)===null||o===void 0||o.call(r,s,t),s}function Me(e){return e.nodeType==1}function $(e,t,r,n){var i;let a=((i=n==null?void 0:n.processTemplate)===null||i===void 0?void 0:i.call(n,e,t,r))||t;if(e.innerHTML=a,e.classList.add("-feaas"),(e.closest(".component.feaas")||e).className.includes("-theme--"))for(var s=0,u;u=e.childNodes[s++];)Me(u)&&(u.className=u.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return A(e,r,n)}function Et(e,t,r,n=!1){var i;let a=((i=r==null?void 0:r.processTemplate)===null||i===void 0?void 0:i.call(r,null,e,t))||e;if(typeof document=="undefined"||n){let o=le(a);return A(o[0],t,r).outerHTML}else{let o=document.createElement("div");return o.innerHTML=a,A(o,t,r),o.innerHTML}}var ke=["initial","check","updated"],q={};function rr(){q={}}async function G(e,t,r,n,i=q){return P({url:e,options:t,validator:r,callback:n,cache:i}).then(K).then(a=>a.response)}function _t(e,t=!1){let r=String(e).replace("?head","");var n=q[r];return!n&&!t&&(n=q[r]={phase:null,initial:S(),check:S(),updated:S(),final:S()}),n}var fe=class extends Error{};async function P({url:e,options:t,validator:r,callback:n,cache:i},a="initial"){let o=new Date;if(i!=null){var s=_t(e);if(ke.indexOf(s.phase)>=ke.indexOf(a))var u=s[a];else s.phase=a}let c=await(u||fetch(e,t));if(!u&&s&&(c.ok?s[a].resolve(c):s[a].reject(new Error("Fetch failed"))),!c.ok)throw new Error("Fetch failed");let l=new Date(c.headers.get("date"))<o||u&&a=="initial"&&(s.phase=="updated"||s.phase=="check");if((r==null?void 0:r(c,l))===!1)throw new fe("Response is not valid");return await(n==null?void 0:n(c,a,l)),{url:e,options:t,isCached:l,response:c,validator:r,callback:n,cache:i}}async function K(e){let{url:t,isCached:r,options:n,validator:i,response:a,cache:o}=e;if(r){let{response:s}=await P({url:t+"?head",options:{...n,method:"HEAD",cache:"no-cache"},validator:i,cache:o},"check");if(s.headers.get("last-modified")!=a.headers.get("last-modified"))return pe(e)}return e}async function pe(e){return P({...e,options:{...e.options,cache:"reload"}},"updated")}var _="https://feaas.blob.core.windows.net";function Y(e){let t=e.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(t){var[,r,n,i,a,o]=t;return{cdn:r,library:n,component:i,version:a,revision:o}}}function or(e){if(!e||!e.library||!e.component)throw new Error("Component requires `library` and `component` properties");return`${e.cdn&&e.cdn!=_?`${e.cdn}/components`:""}/${e.library}/${e.component}/${!e.version||e.version=="responsive"&&(!e.revision||e.revision=="published")?"":e.version}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/(^\/|\/$|\/\/)(?!.+\/components\/)/g,"")}function ar(e){return`${e.cdn&&e.cdn!=_?`${e.cdn}/styles/`:""}${e.library}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function me(e){let t=e.match(/^(?:(.*?)\/styles\/)?([^\/]+)(?:\/(published|staged|saved|\d+)(?:.css)?)?$/);if(t){var[,r,n,i]=t;return{cdn:r,library:n,revision:i}}else{let a=Y(e);if(a){var{cdn:r,library:n,revision:i}=a;return i!=null&&i.match(/\d/)&&(i=void 0),{cdn:r,library:n,revision:i}}}}function Le(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...Y(e.src)}),`${e.cdn||e.hostname||_}/components/${e.library}/${e.component}/${e.version}/${e.revision||"published"}.html`}function Q(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...me(e.src)}),`${e.cdn||e.hostname||_}/styles/${e.library}/${e.revision||"published"}.css`}async function U(e,t,r=!1){let n=s=>s.headers.get("x-ms-meta-versionDeletedAt")==null,i=s=>s.clone().text().then(t),a=await Promise.all([e.instance&&P({options:{headers:{Accept:"text/html"},credentials:"omit"},url:Le({...e,version:e.instance}),validator:n}).catch(s=>s),P({url:Le(e),validator:n}).catch(s=>s)]),o=a.find(s=>s&&"isCached"in s&&s);if(!o||o instanceof Error)throw a.find(u=>u&&u instanceof Error)||new Error("Can not fetch component");return a[0]==o&&console.log("Using fork!",a),await i(o.response),r?o:K({...o,callback:i}).catch(s=>{if(a[0]==o&&(pe({...o,callback:null,validator:null}),console.log("Fork was deleted"),!(a[1]instanceof Error)))return i(a[1].response),K({...a[1],callback:i});throw s})}async function sr(e){typeof e=="string"&&(e={src:e});var t;let{response:r}=await U(e,n=>{t=n},!0);return{...e,template:t,lastModified:r.headers.get("last-modified")}}async function ye(e,t){return typeof e=="string"&&(e={src:e}),G(Q(e),{headers:{Accept:"text/css"},credentials:"omit"},r=>r.headers.get("x-ms-meta-deletedAt")==null,(r,n)=>r.clone().text().then(i=>t(i,n)))}function cr(e,t){return Ct(e,t||(t=document.createElement("style"))),t}function Ct(e,t){return t||(t=document.createElement("style")),ye(e,(r,n)=>{t.textContent=r}).then(()=>t)}function ve(e,t){var r=Dt(e);if(!r)var n=Ft(e);return ye(e,(i,a)=>{n&&(n.textContent=i),t==null||t(i,a)}).then(()=>r||n)}function je(e){return new Promise((t,r)=>{ve(e,t).catch(r)})}function Dt(e){return document.head.querySelector(`style[data-href="${Q(e)}"]`)}function Ft(e){let t=Q(e),r=document.createElement("style");return r.setAttribute("data-href",t),document.head.appendChild(r),r}function pr(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return A(n,t),r}function Ie(e,t){return Rt(e,t||(t=document.createElement("div"))),t}async function Rt(e,t){return t||(t=document.createElement("div")),t.childNodes.length?A(t,e.data,e):"template"in e?$(t,e.template,e.data,e):U(e,r=>$(t,r,e.data,e)).then(()=>t)}function Nt(e){let{params:t,method:r,headers:n,body:i,url:a}=w(e);var o={url:a},s={...n};return n["Content-Type"]==="application/json"&&delete s["Content-Type"],n.Accept==="application/json"&&delete s.Accept,Object.keys(s).length>0&&(o.headers=s),r!=="GET"&&(o.method=r),r==="GET"||r==="HEAD"||Object.keys(i).length===0||(o.body=i),Object.keys(t).length>0&&(o={...o,params:t}),o}var X=e=>{if(typeof e.url!="string")return!1;for(var t in e)if(!(t=="body"||t=="params"||t=="headers"||t=="url"||t==="method"||t=="jsonpath"&&typeof e[t]=="string"))return!1;return!0};function Ue(e){let{url:t,headers:r,params:n,method:i,body:a}=w(e),o,s=r["Content-Type"];i!="GET"&&i!="HEAD"&&(s==="application/json"&&(o=JSON.stringify(a)),s==="multipart/form-data"&&(o=Object.keys(a).reduce((c,l)=>(c.append(l,a[l]),c),new FormData)),s==="application/x-www-form-urlencoded"&&(o=new URLSearchParams(a)));let u=Object.keys(n).length?`?${new URLSearchParams(n)}`:"";return[`${t}${u}`,{headers:r,body:o,method:i}]}function w(e){let t={};for(let r in(e==null?void 0:e.headers)||{})if(e.headers.hasOwnProperty(r)){let n=r.replace(/^[a-z]|\-[a-z]/g,i=>i.toUpperCase());t[n]=e.headers[r]}return t.Accept||(t.Accept="application/json"),{params:(e==null?void 0:e.params)||{},headers:t,jsonpath:String((e==null?void 0:e.jsonpath)||"$"),method:((e==null?void 0:e.method)||"GET").toUpperCase(),body:(e==null?void 0:e.body)||{},url:String((e==null?void 0:e.url)||"")}}var be=async e=>{try{let[t,r]=Ue(e),i=await(await w.fetchImplementation(t,{...r,method:r.method.toLowerCase()})).json();return e.jsonpath&&e.jsonpath!="$"?I(i,e.jsonpath):i}catch(t){return{}}};async function Be(e){if(!e)return e;if(X(e))return be(e);let t=Object.keys(e),r=await Promise.all(t.map(n=>X(e[n])?be(e[n]):null).filter(Boolean));return t.reduce((n,i)=>({...n,[i]:X(e[i])?r.shift():e[i]}),{})}w.clean=Nt;w.toFetchArguments=Ue;w.fetchOne=be;w.fetch=Be;w.isDataSettings=X;w.fetchImplementation=(...e)=>fetch(...e);function Ot(e){var t,r,n,i,a,o,s,u;let c,l=e.getAttribute("src");if(l){let C=Y(l);if(!C)throw new Error(`Could not parse FEAAS Component source: ${l}`);var{cdn:f,library:d,component:h,version:v,revision:m}=C}let b=e.getAttribute("data");if(b!=null&&b!="")try{c=typeof b=="string"?JSON.parse(b):{}}catch(C){console.error(C)}return{data:c||{},cdn:(r=(t=e.getContextAttribute("cdn"))!==null&&t!==void 0?t:f)!==null&&r!==void 0?r:_,library:(n=e.getAttribute("library"))!==null&&n!==void 0?n:d,component:(i=e.getAttribute("component"))!==null&&i!==void 0?i:h,version:(o=(a=e.getAttribute("version"))!==null&&a!==void 0?a:v)!==null&&o!==void 0?o:"responsive",revision:(u=(s=e.getAttribute("revision"))!==null&&s!==void 0?s:m)!==null&&u!==void 0?u:"published",hostname:e.getAttribute("hostname"),template:e.getAttribute("template"),instance:e.getAttribute("instance"),editable:e.getAttribute("editable")!=null,suspended:e.getAttribute("suspended")!=null,lastModified:e.getAttribute("last-modified"),withStylesheet:e.getAttribute("with-stylesheet")!="false"}}var Z=class extends x{setData(t){this.set({data:t})}getProps(){return Ot(this)}isJSONAttribute(t){return t=="data"}attributeChangedCallback(t,r,n){r!==n&&((t=="library"||t=="component"||t=="revision"||t=="version")&&(this.payload=void 0),this.needsRefresh=!0,super.attributeChangedCallback(t,r,n),t==="data"&&this.fetchData())}async fetchData(){this.readyData=void 0,this.whenDataReady=this.whenDataReady.restart();let t=await w.fetch(this.props.data),r=this.alreadyRendered;await this.whenDataReady.resolve(t),r&&this.advance()}getEditor(){var t;return(t=document.querySelector("feaas-context"))===null||t===void 0?void 0:t.refs.editor}constructor(){super(),this.readyData={},this.whenDataReady=S(t=>this.readyData=t,t=>this.onError(t)),this.defaultProps={cdn:_,revision:"published",version:"responsive",withStylesheet:!0,editable:!1,suspended:!1,data:{}},this.onLoad=t=>{this.payload=t,this.advance()},this.getAttribute("data")||this.whenDataReady.resolve({}),this.addEventListener("click",()=>{this.props.editable&&this.edit()})}edit(){let t=this.getEditor();if(t!=null&&t.setTarget(this))return t.open(),!0}getOriginal(){let t=this.getAttribute("data-path-scope");if(t){for(var r=this;(r=r.previousElementSibling)&&r.getAttribute("data-path-scope")==t;)var n=r;return n}}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null&&this.props.component!=null&&this.props.version!=null}async load(){if(this.getOriginal())return;let t=()=>{this.payload&&(r||this.readyData&&this.onLoad(this.payload))};if(this.props.withStylesheet)var r=je({...this.props,revision:"published"}).then(()=>{r=null,t()});return Promise.all([r,this.whenDataReady.then(()=>t()),U(this.props,n=>{this.payload=n,t()})]).then(()=>this.payload)}flush(){this.readyData&&super.flush()}update(){if(this.alreadyRendered=!0,this.getAttribute("hydrate")!="false")if(Array.from(this.children).filter(t=>t.tagName!="BR").length>0&&!this.needsRefresh)A(this,this.readyData);else{if(this.needsRefresh=!0,this.getOriginal())return;$(this,this.payload,this.readyData)}}};Z.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet"];Z.register("feaas-component");function Tt(e){return{opacity:e!=null&&e.getAttribute("opacity")?parseFloat(e==null?void 0:e.getAttribute("opacity")):1,hidden:(e==null?void 0:e.getAttribute("hidden"))!=null}}var ee=class extends x{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return Tt(this)}attributeChangedCallback(t,r,n){if(r!==n)return t=="hidden"&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),n?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all")),super.attributeChangedCallback(t,r,n)}connectedCallback(){this.payload=null,super.connectedCallback(),this.attributeChangedCallback("hidden",this.getAttribute("hidden"),this.getAttribute("hidden")),this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
|
|
5
5
|
#loader {
|
|
6
6
|
position: absolute;
|
|
7
7
|
top: 0;
|