@telia-ace/widget-components-widget-header-flamingo 1.0.63 → 1.1.2

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/index-9758471c.js DELETED
@@ -1,148 +0,0 @@
1
- "use strict";const ut=(i,t,e,...s)=>{const n=`[${i.get("$environment").name||"webprovisions"}] ${e}`;switch(t){case"info":console.info(n,...s);break;case"warning":console.warn(n,...s);break;case"error":console.error(n,...s);break}},Te=i=>{const t=i.container||i;return{info:(e,...s)=>ut(t,"info",e,...s),warn:(e,...s)=>ut(t,"warning",e,...s),error:(e,...s)=>ut(t,"error",e,...s)}};var F=(i=>(i.Implementation="implementation",i.Widget="widget",i))(F||{}),O=(i=>(i.Pre="pre",i.Post="post",i))(O||{});const Me=(i,t,e,s)=>{try{const n=new t(e,s);return{name:i,invoke:(r,o)=>{let a;return n[r]&&(a=n[r].call(n,o)),Promise.resolve(a)},getInstance:()=>n}}catch(n){if(n.message&&n.message.indexOf("is not a constructor")>=0)return{name:i,invoke:r=>{let o;return r==="initialize"&&(o=t(e,s)),Promise.resolve(o)},getInstance:()=>t};throw n}};function It(i,t){return typeof i>"u"?t:i}let Ue=class{constructor(t={}){this.part=t}createCommand(t,e,s){let n;typeof e=="function"?n={scope:F.Widget,stage:O.Post,defaultArgs:void 0,handlerResolver:e}:n={scope:It(e.scope,F.Widget),stage:It(e.stage,O.Post),defaultArgs:e.defaultArgs,handlerResolver:s};let r=this.part;const o=t.split(".");return o.forEach((a,h)=>{h===o.length-1?r[a]||(r[a]=()=>n):r=this.part[a]=this.part[a]||{}}),this}get(){return this.part}};const pe=i=>{const t=new Ue({});return i(t),t.get()};pe(i=>{i.createCommand("types.register",{scope:F.Implementation,stage:O.Pre},t=>(e,s)=>{t.container.get("$types")[e]=s}).createCommand("type",{stage:O.Pre},t=>e=>{t.container.register("$type",e)}).createCommand("settings",{stage:O.Pre,defaultArgs:[null]},t=>e=>{t.events.dispatch("settings:change",e,{bubbles:!0}),t.container.register("$settings",e)}).createCommand("plugin",{stage:O.Pre},t=>(e,s,n)=>{const{container:r}=t;let o=null,a=e,h=s;typeof e=="string"&&(o=e,a=s,h=n);const c=l=>{const{transformPluginSettings:d}=t.container.get("$environmentOptions"),p=d?d(h||{},o,t.container,a):s;try{const u=Me(o,a,r,p);r.get("$plugins").push(u),l&&u.invoke("initialize",null)}catch(u){Te(t).warn("Error when initializing plugin",u)}};t.container.get("$instance")?c(!0):t.events.subscribeOnce("widget:instance-created",()=>c(!1))}).createCommand("container.register",t=>(e,s)=>{t.container.register(e,s)}).createCommand("container.registerAsync",t=>(e,s)=>{t.container.registerAsync(e,s)}).createCommand("container.registerFactory",t=>(e,s)=>{t.container.registerFactory(e,s)}).createCommand("container.touch",t=>(e,s)=>{t.container.touch(e,s)}).createCommand("csp",{},t=>e=>{t.container.register("csp",e)})});const He=pe(i=>{i.createCommand("ready",{scope:F.Implementation,stage:O.Pre},t=>e=>{const{container:s}=t,n=s.owner;s.get("bootstrapping").ready?e(n):n.events.subscribeOnce("bootstrap:ready",()=>{e(n)})})}),gt=new WeakMap;function z(){return i=>(gt.has(i)||gt.set(i,{}),gt.get(i))}const vt=(i,t,e,...s)=>{const n=`[${i.get("$environment").name||"webprovisions"}] ${e}`;switch(t){case"info":console.info(n,...s);break;case"warning":console.warn(n,...s);break;case"error":console.error(n,...s);break}},f=i=>{const t=i.container||i;return{info:(e,...s)=>vt(t,"info",e,...s),warn:(e,...s)=>vt(t,"warning",e,...s),error:(e,...s)=>vt(t,"error",e,...s)}},v=z(),St=(()=>{let i=0;return()=>++i})(),Nt=(i,t,e)=>{const s=v(i).touchQueue.get(t);s&&s.forEach(n=>{n(e,i)})};class Le{constructor(t,e,s,n){this.key=t,this.factory=e,this.parent=s,this.container=n,this.id=St(),this.resolved=!1,this.constructed=!1,this.async=!0}resolve(){if(!this.constructed){const t=this.factory(this.parent,this.container);return this.constructed=!0,this.value=Promise.resolve(t).then(e=>(this.resolved=!0,Nt(this.container,this.key,e),e))}return this.value}}class Re{constructor(t,e,s,n){this.key=t,this.value=e,this.parent=s,this.container=n,this.id=St(),this.async=!1,this.resolved=!1,this.constructed=!0,this.resolve=()=>(this.resolved=!0,Nt(this.container,this.key,this.value),this.value)}}class je{constructor(t,e,s,n){this.key=t,this.value=e,this.parent=s,this.container=n,this.id=St(),this.async=!1,this.resolved=!1,this.constructed=!1,this.resolve=()=>{this.resolved=!0,this.constructed=!0;const r=this.value(this.parent,this.container);return Nt(this.container,this.key,this.value),r}}}class Tt{constructor(t,e,s){this.owner=t,this.name=e,this.parent=s,v(this).resolvers=new Map,v(this).touchQueue=new Map,v(this).children=[]}delete(t){const e=v(this).resolvers,s=Array.from(e.values()).find(n=>n.id===t);return s?(v(this).touchQueue.delete(s.key),Promise.resolve(e.delete(s.key))):this.parent?this.parent.delete(t):Promise.resolve(!1)}clear(){const t=v(this).resolvers,e=Array.from(t.values());return Promise.all(e.map(s=>{if(s.constructed)return Promise.resolve(s.resolve()).then(n=>{if(n!==null&&typeof n=="object"&&typeof n.dispose=="function")return n.dispose.call(n,this,s)})})).then(()=>{e.forEach(s=>this.delete(s.id)),v(this).children.forEach(s=>s.clear())})}detach(){if(this.parent){const t=v(this.parent).children,e=t.indexOf(this);e>-1&&(t.splice(e,1),delete this.parent)}}touch(t,e){const s=v(this).resolvers.get(t);if(s&&s.constructed)Promise.resolve(s.resolve()).then(n=>{e(n,this)});else{const n=v(this).touchQueue;let r=n.get(t);r||(r=[],n.set(t,r)),r.push(e)}return this.parent&&!s?this.parent.touch(t,e):Promise.resolve()}registerAsync(t,e){const s=v(this).resolvers.get(t);s&&!s.async&&process.env.NODE_ENV!=="production"&&f(this).warn(`Mismatching resolver type. You are registering an async resolver with a key ('${t}') previously used by a non-async resolver.`);const n=new Le(t,e,s,this);return v(this).resolvers.set(t,n),n.id}registerFactory(t,e){const s=v(this).resolvers.get(t);s&&s.async&&process.env.NODE_ENV!=="production"&&f(this).warn(`Mismatching resolver type. You are registering a non-async resolver with a key ('${t}') previously used by an async resolver.`);const n=new je(t,e,s,this);return v(this).resolvers.set(t,n),n.id}register(t,e){const s=v(this).resolvers.get(t);s&&s.async&&process.env.NODE_ENV!=="production"&&f(this).warn(`Mismatching resolver type. You are registering a non-async resolver with a key ('${t}') previously used by an async resolver.`);const n=new Re(t,e,s,this);return v(this).resolvers.set(t,n),n.id}get(t){const e=v(this).resolvers.get(t);if(e)return e.async&&process.env.NODE_ENV!=="production"&&f(this).warn(`You are retrieving an async value (with key '${t}') by the non-async function 'container.get(key)'. This will not be supported in future versions. Use 'container.getAsync(key) instead.'`),e.resolve();if(this.parent)return this.parent.get(t)}getAsync(t){const e=v(this).resolvers.get(t);if(e){if(!e.async)throw process.env.NODE_ENV!=="production"&&f(this).warn(`You are retrieving a non-async value (with key '${t}') by the async function 'container.getAsync(key)'.Use 'container.get(key) instead.'`),"Mismatching resolver type";return e.resolve()}return this.parent?this.parent.getAsync(t):Promise.resolve(void 0)}getMany(...t){const e={};return t.forEach(s=>e[s]=this.get(s)),e}getManyAsync(...t){const e={};return Promise.all(t.map(s=>this.getAsync(s).then(n=>e[s]=n))).then(()=>e)}createChild(t,e){const s=new Tt(t,e,this);return v(this).children.push(s),s}}let Bt=class{constructor(t,e,s=!1,n=!1){this.type=t,this.target=e,this.cancelable=!!s,this.bubbles=!!n,this.defaultPrevented=!1}preventDefault(){this.cancelable&&(this.defaultPrevented=!0)}};const _=z(),Vt=(i,t)=>[].concat(_(i).listenerLookup.get(t.toLowerCase())||[],_(i).listenerLookup.get("*")||[]),Wt=(i,t,e,s)=>{let n,r;return t instanceof Bt?(n=t,r=t.type):(n=new Bt(t,i.target,!!e.cancelable,!!e.bubbles),r=t),{event:n,type:r,async:s}};let ze=class ue{constructor(t,e){this.target=t,this.parent=e,_(this).listenerLookup=new Map,_(this).children=[]}clear(){_(this).listenerLookup.clear(),_(this).children.forEach(t=>t.clear())}detach(){if(this.parent){const t=_(this.parent).children,e=t.indexOf(this);e>-1&&t.splice(e,1)}}subscribe(t,e,s){const n=_(this).listenerLookup,r=t.toLowerCase();return n.has(r)||n.set(r,[]),n.get(r).push(e),()=>this.unsubscribe(t,e)}subscribeOnce(t,e){const s=this.subscribe(t,(n,r)=>(s(),e(n,r)))}unsubscribe(t,e){const s=_(this).listenerLookup.get(t.toLowerCase());if(s){const n=s.indexOf(e);n>-1&&s.splice(n,1)}}dispatchAsync(t,e,s={}){const{event:n,type:r}=Wt(this,t,s,!0),o=Vt(this,r);let a=0;const h=o.length;let c=Promise.resolve();for(a=0;a<h;a++)(l=>{c=c.then(d=>d?Promise.resolve(!0):Promise.resolve(l(n,e)).then(()=>n.defaultPrevented))})(o[a]);return c.then(l=>!l&&n.bubbles&&this.parent?this.parent.dispatchAsync(n,e):l)}dispatch(t,e,s={}){const{event:n,type:r}=Wt(this,t,s,!1),o=Vt(this,r);let a=0;const h=o.length;let c=!1;for(a=0;a<h;a++)if(o[a](n,e),n.defaultPrevented){c=!0;break}return!c&&n.bubbles&&this.parent&&(c=this.parent.dispatch(n,e)),c}createChild(t){const e=new ue(t,this);return _(this).children.push(e),e}};const G=(i,t,e)=>{const s=i.get("$plugins").map(n=>{try{return n.invoke(t,e)}catch(r){f(i).error("An error occured when invoking a plugin.",n,r)}});return Promise.all(s)};let De=class{constructor(t){this.widget=t.get("$widget"),this.events=this.widget.events,this.container=this.widget.container,this.initialized=null,this.activated=null,this.initialize=this.initialize.bind(this),this.activate=this.activate.bind(this),this.deactivate=this.deactivate.bind(this),this.invoke=this.invoke.bind(this),this.createInstance()}createInstance(){if(!this.widget.container.get("$instance")){const t=this.widget.container.get("$types"),e=this.widget.container.get("$type");!e&&f(this).error("Unable to create widget. No type is specified.");const s=t[e];!s&&f(this).error(`Unable to create widget. Type '${e}' is not registered.`),this.widget.events.dispatch("widget:create-instance",{},{bubbles:!0});try{this.widget.container.register("$instance",new s(this.container))}catch(n){f(this).error("Unable to create widget type.",n)}this.widget.events.dispatch("widget:instance-created",{},{bubbles:!0})}}initialize(t){return this.initialized=this.initialized||(()=>{const e=this.container.get("$instance"),s=e.initialize||(()=>{});return this.initialized=Promise.resolve(s.call(e,t)).then(()=>G(this.container,"initialize",t)).then(()=>{})})()}activate(t){return(this.initialized||this.initialize()).then(()=>{this.activated=this.activated||(()=>G(this.container,"activate").then(()=>{const e=this.container.get("$instance");return this.activated=e.activate(t)}))()})}deactivate(){const t=this.container.get("$instance"),e=t.deactivate||(()=>{});return G(this.container,"deactivate").then(()=>Promise.resolve(e.call(t))).then(()=>{this.initialized=null,this.activated=null}).then(()=>{})}invoke(t,...e){return G(this.container,"invoke",{command:t,args:e}).then(()=>{const s=this.container.get("$instance");if(s[t])return s[t].apply(s,e);const n=s.invoke;if(n)return n.call(s,t,...e)})}};const H=(i,t)=>{if(!t)return!0;if(typeof t=="string"){const e=t.split(",");for(let s=0,n=e.length;s<n;s++){const r=e[s].trim();if(r===i||r==="*")return!0}}return t instanceof Array?t.indexOf(i)>-1:!1},Ie=(i,t)=>{if(typeof t=="function")return t(i);const e=typeof t=="string"?We(t):t;return!(!H(i.implementation.tenant||"",e.tenant||"")||!H(i.implementation.name,e.implementation||"")||!H(i.name,e.widget||"")||!H(i.container.get("$type"),e.type||""))},Be=(i,t)=>{if(typeof t=="function")return t(i);const e=typeof t=="string"?Fe(t):t;return!(!H(i.tenant||"",e.tenant||"")||!H(i.name,e.implementation||""))},ge=i=>t=>Ie(t,i),Ve=i=>t=>Be(t,i),x=i=>i instanceof Array&&i.length===1?i[0]:i,We=i=>{const t={},e=i.split(":");return e.length===1?t.widget=x(e[0].split(",")):e.length===2?(t.implementation=x(e[0].split(",")),t.widget=x(e[1].split(","))):(t.tenant=x(e[0].split(",")),t.implementation=x(e[1].split(",")),t.widget=x(e[2].split(","))),t},Fe=i=>{const t={},e=i.split(":");return e.length===1?t.implementation=x(e[0].split(",")):(t.tenant=x(e[0].split(",")),t.implementation=x(e[1].split(","))),t},et=z(),Ft=(i,t,e)=>i.filter(s=>s.stage===t&&ge(s.selector)(e));function qe(i){const t=i.container.get("$environment");let e=et(t).configurationCache;e&&(e=e.filter(s=>s[0]!==i),et(t).configurationCache=e)}var st=(i=>(i.Implementation="implementation",i.Widget="widget",i))(st||{}),C=(i=>(i.Pre="pre",i.Post="post",i))(C||{});const ve=(i,t,e)=>(Object.keys(t).forEach(s=>{const n=t[s];if(typeof n=="function"){const r=n();typeof r.defaultArgs<"u"&&e(r,...r.defaultArgs),i[s]=(...o)=>{const a=Object.assign({},r,{handlerResolver:r.handlerResolver.bind({})});return e(a,...o),i}}else i[s]=ve({},n,e)}),i),Ye=(i,t)=>{switch(t){case"implementation":return i.implementation;case"widget":return i}},qt=(i,t,e,s)=>(s.forEach(n=>{ve(i,n,(r,...o)=>{const a={selector:t,stage:r.stage,handler:h=>{const c=Ye(h,r.scope),l={container:c.container,events:c.events},d=r.handlerResolver,p=d(l);let u=et(e.environment).configurationCache;return u||(u=et(e.environment).configurationCache=[]),u.find(y=>y.indexOf(c)>-1&&y.indexOf(d)>-1)?Promise.resolve():(u.push([c,d]),Promise.resolve(p(...o)))}};e.instructions.push(a)})}),i);function Qe(i,t){function e(s){return qt({},s,i,t)}return qt(e,"*",i,t)}const Ze=(i,t,e,s)=>{try{const n=new t(e,s);return{name:i,invoke:(r,o)=>{let a;return n[r]&&(a=n[r].call(n,o)),Promise.resolve(a)},getInstance:()=>n}}catch(n){if(n.message&&n.message.indexOf("is not a constructor")>=0)return{name:i,invoke:r=>{let o;return r==="initialize"&&(o=t(e,s)),Promise.resolve(o)},getInstance:()=>t};throw n}};function Yt(i,t){return typeof i>"u"?t:i}let Ke=class{constructor(t={}){this.part=t}createCommand(t,e,s){let n;typeof e=="function"?n={scope:st.Widget,stage:C.Post,defaultArgs:void 0,handlerResolver:e}:n={scope:Yt(e.scope,st.Widget),stage:Yt(e.stage,C.Post),defaultArgs:e.defaultArgs,handlerResolver:s};let r=this.part;const o=t.split(".");return o.forEach((a,h)=>{h===o.length-1?r[a]||(r[a]=()=>n):r=this.part[a]=this.part[a]||{}}),this}get(){return this.part}};const me=i=>{const t=new Ke({});return i(t),t.get()},Je=me(i=>{i.createCommand("types.register",{scope:st.Implementation,stage:C.Pre},t=>(e,s)=>{t.container.get("$types")[e]=s}).createCommand("type",{stage:C.Pre},t=>e=>{t.container.register("$type",e)}).createCommand("settings",{stage:C.Pre,defaultArgs:[null]},t=>e=>{t.events.dispatch("settings:change",e,{bubbles:!0}),t.container.register("$settings",e)}).createCommand("plugin",{stage:C.Pre},t=>(e,s,n)=>{const{container:r}=t;let o=null,a=e,h=s;typeof e=="string"&&(o=e,a=s,h=n);const c=l=>{const{transformPluginSettings:d}=t.container.get("$environmentOptions"),p=d?d(h||{},o,t.container,a):s;try{const u=Ze(o,a,r,p);r.get("$plugins").push(u),l&&u.invoke("initialize",null)}catch(u){f(t).warn("Error when initializing plugin",u)}};t.container.get("$instance")?c(!0):t.events.subscribeOnce("widget:instance-created",()=>c(!1))}).createCommand("container.register",t=>(e,s)=>{t.container.register(e,s)}).createCommand("container.registerAsync",t=>(e,s)=>{t.container.registerAsync(e,s)}).createCommand("container.registerFactory",t=>(e,s)=>{t.container.registerFactory(e,s)}).createCommand("container.touch",t=>(e,s)=>{t.container.touch(e,s)}).createCommand("csp",{},t=>e=>{t.container.register("csp",e)})}),Ge=Je;function Xe(i,t,e=[]){const s=[Ge].concat(e),n=Qe(t,s);i(n,t)}let ts=class{constructor(){this.tasks=[],this.current=Promise.resolve(),this.next=this.next.bind(this)}add(t,e,s,n){this.tasks.push({task:t,resolve:e,reject:s,done:n}),this.next()}next(){this.current=this.current.then(()=>{const t=this.tasks.shift();if(t){const e=Promise.resolve(t.task());return Promise.resolve(e).then(this.next).then(()=>e.then(s=>{t.done(),t.resolve(s)})).catch(s=>(t.done(),t.reject(s),this.next()))}return Promise.resolve()})}};const X=new WeakMap;function es(i){return X.has(i)||X.set(i,new ts),t=>new Promise((e,s)=>{const n=X.get(i);n.add(t,e,s,()=>{n.tasks.length||X.delete(i)})})}const Qt=i=>typeof i<"u",I=(i,t)=>{i.events.dispatch("widget:state-change",{state:t},{bubbles:!0}),i.state=t,i.events.dispatch("widget:state-changed",{},{bubbles:!0})},b=z(),ss=i=>{const{container:t,events:e}=i;t.get("$controller")||(t.register("$controller",new De(t)),e.dispatch("widget:controller-created",{},{bubbles:!0}))};class is{constructor(t,e,s){this.state="deactivated",this.name=t,this.implementation=e,this.container=e.container.createChild(this,t),this.events=e.events.createChild(this),b(this).subscriptions=[],s&&e.configure(n=>{const r=n(t);Qt(s.type)&&r.type(s.type),Qt(s.settings)&&r.settings(s.settings),s.plugins&&Object.keys(s.plugins).forEach(o=>{var a;const h=(a=s.plugins)==null?void 0:a[o];r.plugin(o,h)})}),this.load=this.load.bind(this),this.activate=this.activate.bind(this),this.invoke=this.invoke.bind(this),this.deactivate=this.deactivate.bind(this)}load(){return es(this)(()=>{b(this).deactivatedPromise=null;const t=this.state==="deactivated";t&&(I(this,"activating"),this.container.register("$widget",this),this.container.register("$controller",null),this.container.register("$plugins",[]),this.container.register("$type",null),this.container.register("$instance",null)),I(this,"loading");const e=this.implementation.instructions,s=Ft(e,C.Pre,this);return Promise.all(s.map(n=>n.handler(this))).then(()=>{ss(this);const n=Ft(e,C.Post,this);return Promise.all(n.map(r=>r.handler(this))).then(()=>{t&&this.container.get("$controller").initialize()})}).then(()=>(I(this,"activated"),this))})}activate(t){b(this).subscriptions.push(this.implementation.events.subscribe("implementation:configured",()=>{["activated","activating","loading"].indexOf(this.state)>-1&&this.load()}));const e=b(this).activatedPromise;return e?(process.env.NODE_ENV!=="production"&&f(this).warn(`Widget '${this.name}' has already been activated. The passed arguments for this activation will be discarded.`,t),e):b(this).activatedPromise=this.load().then(()=>this.container.get("$controller").activate(t))}invoke(t,...e){const s=b(this).activatedPromise,n=(r,...o)=>s.then(this.load).then(()=>this.container.get("$controller").invoke(r,...o));return s?n(t,...e):(process.env.NODE_ENV!=="production"&&f(this).warn("You are invoking a command on a deactivated widget. The invocation will be queued until the widget is activated.",this),new Promise(r=>{const o=this.events.subscribe("widget:state-changed",()=>{this.state==="activated"&&(o(),r(n(t,...e)))})}))}deactivate(){return b(this).deactivatedPromise||(this.state==="deactivated"?Promise.resolve():(I(this,"deactivating"),b(this).deactivatedPromise=this.container.get("$controller").deactivate().then(()=>(b(this).activatedPromise=null,b(this).subscriptions.forEach(e=>e()),b(this).subscriptions=[],this.container.clear().then(()=>{this.events.clear(),qe(this),I(this,"deactivated")})))))}}const Zt=z();class ns{constructor(t,e,s=[]){this.instructions=[],this.widgets=new Map,this.name=t.name,this.tenant=t.tenant,this.environment=e,this.container=e.container.createChild(this,this.name),this.events=e.events.createChild(this),this.container.register("$types",{}),Zt(this).configurationApiExtensions=s}load(){const t=Array.from(this.widgets.values());return Promise.all(t.map(e=>e.load())).then(()=>t)}configure(t){return Xe(t,this,Zt(this).configurationApiExtensions),this.events.dispatch("implementation:configured",{implementation:this},{bubbles:!0}),this}createWidget(t,e){const s=new is(t,this,e);return this.widgets.set(s.name,s),s}}function rs(i,t,e){const s=new ns(i,t,e);return i.widgets&&Object.keys(i.widgets).forEach(n=>{var r;const o=(r=i.widgets)==null?void 0:r[n];s.createWidget(n,o)}),s}let Kt=class fe{constructor(t,e){this.selectorFactory=e,typeof t=="function"?this.resolver=t:this.resolver=()=>t}append(t){const e=typeof t=="function"?t:()=>t;return new fe(()=>this.all().concat(e()),this.selectorFactory)}all(){return this.resolver().concat([])}query(t){return this.all().filter(this.selectorFactory(t))}find(t){const e=this.query(t);if(e.length)return e[0]}};const Mt="#____version____#",mt=z(),os=i=>i.tenant?`${i.name}:${i.tenant}`:i.name,ye=class{constructor(t,e=[],s={}){this.widgets=new Kt(()=>{let n=[];return this.implementations.all().forEach(r=>{n=n.concat(Array.from(r.widgets.values()))}),n},ge),this.implementations=new Kt([],Ve),this.name=t,this.container=new Tt(this,t),this.events=new ze(this),this.container.register("$version",Mt),this.container.register("$environment",this),this.container.register("$environmentOptions",s),mt(this).configurationApiExtensions=e}createImplementation(t){const e=os(t);let s=this.implementations.find(e);if(s)return process.env.NODE_ENV!=="production"&&f(s).warn(`Implementation "${e}" already exist on current environment.`),s;const n=mt(this).configurationApiExtensions;return s=rs(t,this,n),this.implementations=this.implementations.append([s]),this.events.dispatch("implementation:created",{implementation:s}),s}patch(t={}){const{name:e,configurationApiExtensions:s}=t;typeof e<"u"&&e!==null&&(this.name=e),s&&s.forEach(n=>{mt(this).configurationApiExtensions.push(n)})}static create(t={}){return new ye(t.name||"",t.configurationApiExtensions,t.options)}};let $e=ye;$e.version=Mt;const rt=(i,t,...e)=>typeof t=="string"?i(`[humany] ${t}`,...e):i(t,...e),V=class{constructor(){this.keys=[],this.log=(t,...e)=>this.lookup(t,()=>V.log(...e)),this.warn=(t,...e)=>this.lookup(t,()=>V.warn(...e)),this.error=(t,...e)=>this.lookup(t,()=>V.error(...e)),this.info=(t,...e)=>this.lookup(t,()=>V.info(...e))}lookup(t,e){this.keys.indexOf(t)===-1&&(this.keys.push(t),e())}};let Z=V;Z.log=(...i)=>rt(console.log,...i);Z.warn=(...i)=>rt(console.warn,...i);Z.error=(...i)=>rt(console.error,...i);Z.info=(...i)=>rt(console.info,...i);const P=()=>Math.floor((1+Math.random())*65536).toString(16).substring(1);function ot(){return P()+P()+"-"+P()+"-"+P()+"-"+P()+"-"+P()+P()+P()}var as=Object.defineProperty,cs=Object.defineProperties,hs=Object.getOwnPropertyDescriptors,Jt=Object.getOwnPropertySymbols,ls=Object.prototype.hasOwnProperty,ds=Object.prototype.propertyIsEnumerable,Gt=(i,t,e)=>t in i?as(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,Ct=(i,t)=>{for(var e in t||(t={}))ls.call(t,e)&&Gt(i,e,t[e]);if(Jt)for(var e of Jt(t))ds.call(t,e)&&Gt(i,e,t[e]);return i},ps=(i,t)=>cs(i,hs(t));const us=i=>{const t=[];return[(e,s)=>{t.push(i.subscribe(e,s))},()=>{t.forEach(e=>{e()})}]};let at=class{constructor(t,e=[]){this.platform=t,this.rules=e}match(t){return this.rules.every(e=>!(e.id&&e.id!==t.id||e.type&&e.type!==t.type))}ofType(t){return this.rules.push({type:t}),this}withId(t){return this.rules.push({id:t}),this}select(){return new gs(this.platform,this)}},be=class{constructor(t,e,s){this.platform=t,this.node=e,this.actions=new Ut(t,new at(t).withId(e.id),s);const[n,r]=us(this.platform.events);this.subscribe=n,this.unsubscribe=r}properties(t){return t&&this.node.touchProperties(e=>t(e)),this.node.attributes.properties}context(t){return t&&this.subscribe("components:context-changed",(e,{node:s})=>{s===this.node&&t(this.node.attributes.context)}),this.node.attributes.context}layout(t){return t&&this.subscribe("components:layout-changed",(e,{node:s})=>{s===this.node&&t(this.node.attributes.layout)}),this.node.attributes.layout}writeProperties(t,e){this.node.writeProperties(t,e)}writeContext(t,e){this.node.writeProperties(t,e)}writeLayout(t,e){this.node.writeLayout(t,e)}dispose(){this.unsubscribe(),this.actions.dispose()}};class gs{constructor(t,e,s=!0){this.platform=t,this.target=e,this.clearOnDispose=s,this.removes=[],this.actions=new Ut(this.platform,this.target)}writeProperties(t,e){this.removes.push(this.platform.write({options:e,attributes:{properties:t},target:this.target,removable:this.clearOnDispose}))}writeContext(t,e){this.removes.push(this.platform.write({options:e,attributes:{context:t},target:this.target,removable:this.clearOnDispose}))}writeLayout(t,e){this.removes.push(this.platform.write({options:e,attributes:{layout:t},target:this.target,removable:this.clearOnDispose}))}dispose(){this.removes.forEach(t=>{t()}),this.actions.dispose()}}const vs=(i,t,e)=>{const s=i.concat(),n=(r,o,a)=>{let h=!0;if(s.length){const c=s.shift(),l=(d,p)=>(h=!1,n(d,Object.assign({},o,p),a));return Promise.resolve(c(r,l,a)).then(d=>ps(Ct({},d),{cancelled:h}))}return Promise.resolve({data:r,cancelled:!1,options:o})};return n(t,{},e)};let Ut=class{constructor(t,e,s){this.platform=t,this.target=e,this.ns=s,this.subscriptions=[],this.create=this.create.bind(this)}create(t,e=()=>{}){const s={key:t,fn:e,target:this.target,ns:this.ns};this.platform.actionsState.handlers.push(s);const n=()=>{const r=this.platform.actionsState.handlers.indexOf(s);r>-1&&this.platform.actionsState.handlers.splice(r,1)};return this.subscriptions.push(n),n}dispatch(t,e){const s=this.platform.nodes.all.concat(this.platform.nodes.detached),n={},r=this.platform.actionsState.handlers.filter(o=>o.key===t&&(!o.ns||!this.ns||o.ns===this.ns));return Promise.all(r.map(o=>{const a=s.filter(c=>o.target.match(c)&&this.target.match(c)),h=this.platform.actionsState.watchers.filter(c=>c.key===t&&(!c.ns||!this.ns||c.ns===this.ns)&&a.some(l=>c.target.match(l))).map(c=>c.fn);return Promise.all(a.map(c=>{const l=new be(this.platform,c,this.ns);return vs(h,e,l).then(d=>{const{data:p={},options:u,cancelled:y}=d;return Promise.resolve(y?{}:o.fn(p,u,l)).then(w=>{n[c.id]=w})})}))})).then(()=>n)}watch(t,e){let s=t,n=this.ns;const r=t.split(".");r.length>1&&(n=r[0],s=r.splice(1).join("."));const o={fn:e,target:this.target,key:s,ns:n};this.platform.actionsState.watchers.push(o);const a=()=>{const h=this.platform.actionsState.watchers.indexOf(o);h>-1&&this.platform.actionsState.watchers.splice(h,1)};return this.subscriptions.push(a),a}dispose(){this.subscriptions.forEach(t=>t())}};me(i=>{i.createCommand("components",t=>e=>{t.events.subscribeOnce("components:platform-created",(s,{platform:n})=>{e.handlers&&e.handlers.forEach(([r,o])=>{n.addComponentHandler(r,o)})})})});let Xt=class{constructor(t,e){this.events=t,this.tags=[],this.children={},this.changesets=[],this.mountCount=0,this.id=ot(),this.type=e,this.attributes={context:{},properties:{},layout:{},tags:[]},this.writeLayout({size:"full",indent:0})}mount(t,e){let s=t.get("mounted-nodes");return s||(s=new Map,t.register("mounted-nodes",s)),s.has(this)?(process.env.NODE_ENV!=="production"&&Z.error("Trying to mount an already mounted component node.",this),()=>{}):(this.events.dispatch("components:node-mounted",{node:this}),this.mountCount===0&&(this.mountCount=this.mountCount+1,this.events.dispatch("components:node-enter",{node:this})),()=>{s.delete(this),this.events.dispatch("components:node-unmounted",{node:this}),this.mountCount=this.mountCount-1,this.mountCount===0&&this.events.dispatch("components:node-exit",{node:this})})}appendChild(t,e="default"){if(t.parent){if(t.parent===this)return;t.parent.removeChild(t)}t.parent=this,this.children[e]||(this.children[e]=[]),this.children[e].push(t),this.events.dispatch("components:node-appended",{node:t})}prependChild(t,e="default"){if(t.parent){if(t.parent===this)return;t.parent.removeChild(t)}t.parent=this,this.children[e]||(this.children[e]=[]),this.children[e].unshift(t),this.events.dispatch("components:node-appended",{node:t})}touchProperties(t,e={},s){const n=[{properties:t},e];return this.changesets.push(n),this.events.dispatch("components:set-properties",{node:this}),()=>{if(s){const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-properties",{node:this}))}}}writeProperties(t,e={},s){const n=[{properties:t},e];return this.changesets.push(n),this.events.dispatch("components:set-properties",{node:this}),()=>{if(s){const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-properties",{node:this}))}}}writeLayout(t,e={},s){const n=[{layout:t},e];return this.changesets.push(n),this.events.dispatch("components:set-layout",{node:this}),()=>{if(!s)return;const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-layout",{node:this}))}}writeContext(t,e={},s){const n=[{context:t},e];return this.changesets.push(n),this.events.dispatch("components:set-context",{node:this}),()=>{if(!s)return;const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-context",{node:this}))}}getChildren(t="default"){const e=this.children[t]||[];return e.reduce((s,n,r)=>{const{order:o=r}=n.attributes.layout;return s[o]?s.splice(o,0,n):s[o]=n,s},Array(e.length))}remove(){this.parent&&this.parent.removeChild(this)}removeChild(t){Object.keys(this.children).forEach(e=>{const s=this.children[e],n=s.indexOf(t);n>-1&&(s.splice(n,1),this.events.dispatch("components:node-removed",{node:t,parentNode:this}))}),delete t.parent}};const we=(i,t,e)=>{for(let s=0,n=i.length;s<n&&e(i[s])!==!0;s++){const r=t[i[s].id]||"default",o=i[s].getChildren(r);we(o,t,e)}},Ht=(i,t,e)=>{if(e(i)!==!0){const s=t[i.id]||"default",n=i.children[s];we(n,t,e)}},ft=(i,t)=>{const e=[];return Ht(i,t,s=>{e.push(s)}),e},ms=(i,t,e)=>{let s;return Ht(i,t,n=>{if(e(n))return s=n,!0}),s};class fs{constructor(t,e,s){this.root=t,this.switches=e,this.all=[],this.visible=[],this.detached=[],s.subscribe("components:node-appended",(n,r)=>{this.all.push(r.node),this.visible=ft(t,e)}),s.subscribe("components:node-removed",(n,r)=>{let o=this.all.indexOf(r.node);o>-1&&this.all.splice(o,1),o=this.visible.indexOf(r.node),o>-1&&this.visible.splice(o,1),this.visible=ft(t,e)}),s.subscribe("components:node-switched",(n,r)=>{this.visible=ft(t,e)})}query(t={}){const e=[];return Ht(this.root,this.switches,s=>{Object.keys(t).every(n=>t[n]===s[n])&&e.push(s)}),e}get(t){return ms(this.root,this.switches,e=>e.id===t)||this.detached.find(e=>e.id===t)}}class ys{constructor(){this.handlers=new Map}add(t,e){this.handlers.set(t,e)}get(t){return this.handlers.get(t)}}const $s=i=>{let t=i,e=0;for(;t.parent;)e=e+1,t=t.parent;return e},bs=i=>i.map(([t,e])=>[$s(t),t,e]).sort(([t],[e])=>t-e).map(([,t,e])=>[t,e]),yt=i=>i instanceof Date?!1:i&&typeof i=="object"&&!Array.isArray(i),E=(i,...t)=>{if(!t.length)return i;const e=t.shift();if(yt(i)&&yt(e))for(const s in e)yt(e[s])?(i[s]||Object.assign(i,{[s]:{}}),E(i[s],e[s])):Object.assign(i,{[s]:e[s]});return E(i,...t)},ws=(i,t)=>!i||i==="all"?!0:i.some(e=>t.indexOf(e)>-1),_s=(i,t)=>{let e=[],s=[],n;const r=()=>{process.env.NODE_ENV!=="production"&&console.time("state-processor.flush");const a=new Map,h=bs(e.map((l,d)=>[l,s[d]])),c=(l,d)=>{var p;const u=a.get(l)||{},y=d.context&&!u.context,w=d.properties&&!u.properties,dt=d.layout&&!u.layout;a.set(l,{context:u.context||y,properties:u.properties||w,layout:u.layout||dt}),w&&(l.attributes.properties={}),dt&&(l.attributes.layout={}),y&&(l.attributes.context=E({},(p=l.parent)==null?void 0:p.attributes.context));const jt=[],zt=[],Dt=[];if(l.changesets.forEach(A=>{const[$,pt]=A;ws(pt.breakpoints,i.breakpoints)&&(w&&(typeof $.properties=="function"?jt.push($.properties):E(l.attributes.properties,$.properties)),dt&&(typeof $.layout=="function"?zt.push($.layout):E(l.attributes.layout,$.layout)),y&&(typeof $.context=="function"?Dt.push($.context):E(l.attributes.context,$.context)))}),jt.forEach(A=>{E(l.attributes.properties,A(l.attributes.properties))}),zt.forEach(A=>{E(l.attributes.layout,A(l.attributes.layout))}),Dt.forEach(A=>{E(l.attributes.context,A(l.attributes.context))}),y||d.recursive){const A=i.getBranch(l),$=d.recursive?d:{context:!!y};l.getChildren(A).forEach(pt=>{c(pt,$)})}};process.env.NODE_ENV!=="production"&&console.timeEnd("state-processor.flush"),h.forEach(([l,d])=>{c(l,d)}),e=[],s=[],t(a)},o=()=>{clearTimeout(n),n=setTimeout(r,0)};return(a,h)=>{const c=e.indexOf(a);if(c>-1){const l=s[c];return h.context&&(l.context=!0),h.properties&&(l.properties=!0),h.layout&&(l.layout=!0),h.recursive&&(l.recursive=!0),o()}return e.push(a),s.push(h),o()}};class _e{constructor(t,e={}){this.providers=e,this.breakpoints=[],this.actionsState={handlers:[],watchers:[]},this.switches={},this.changesets=[],this.subscriptions=[],this.customComponentHandler=new ys,this.events=t.events.createChild(this);const s=new Xt(this.events,"root");s.name=`root-${t.name}`,this.nodes=new fs(s,this.switches,this.events);const n=this.processNode=_s(this,r=>{const o=Array.from(r.keys());process.env.NODE_ENV!=="production"&&console.info(`STATE PROCESSOR: ${o.length} node(s) processed:
2
- ${o.map(a=>`${a.name||"<no name>"} (${a.id})
3
- `)}`),o.forEach(a=>{const h=r.get(a);a.parent&&a.parent.type==="root"&&this.events.dispatch("components:root-children-changed",{node:a}),h!=null&&h.context&&this.events.dispatch("components:context-changed",{node:a}),h!=null&&h.properties&&this.events.dispatch("components:properties-changed",{node:a}),h!=null&&h.layout&&this.events.dispatch("components:layout-changed",{node:a})}),this.events.dispatch("components:component-model-initialized",{},{bubbles:!0})});Promise.all(Object.keys(e).map(r=>e[r].load(this))),this.subscriptions.push(this.events.subscribe("components:node-appended",(r,o)=>{const{node:a}=o;this.changesets.forEach(h=>{const{changeset:c,target:l,removes:d}=h,[p,u]=c;l.match(o.node)&&(p.properties&&d.push(a.writeProperties(p.properties,u)),p.context&&d.push(a.writeContext(p.context,u)),p.layout&&d.push(a.writeLayout(p.layout,u)))})})),this.subscriptions.push(this.events.subscribe("components:node-appended",(r,o)=>{n(o.node,{properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:set-properties",(r,o)=>{n(o.node,{properties:!0})})),this.subscriptions.push(this.events.subscribe("components:set-context",(r,o)=>{n(o.node,{properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:set-indent",(r,o)=>{n(o.node,{layout:!0})})),this.subscriptions.push(this.events.subscribe("components:set-layout",(r,o)=>{n(o.node,{layout:!0})})),this.subscriptions.push(this.events.subscribe("components:node-switched",(r,{node:o,branch:a})=>{n(o,{layout:!0,recursive:!0,properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:node-removed",(r,{parentNode:o})=>{n(o,{properties:!0})})),this.events.parent&&this.events.parent.dispatch("components:platform-created",{platform:this})}static getInstance(t){return t.getAsync("components")}addBreakpoint(t){this.breakpoints.indexOf(t)===-1&&(this.breakpoints.push(t),this.processNode(this.nodes.root,{context:!0,properties:!0,layout:!0,recursive:!0}))}removeBreakpoint(t){const e=this.breakpoints.indexOf(t);e>-1&&(this.breakpoints.splice(e,1),this.processNode(this.nodes.root,{context:!0,properties:!0,layout:!0,recursive:!0}))}setSwitch(t,e){this.switches[t.id]=e,this.events.dispatch("components:node-switched",{node:t,branch:e})}getBranch(t){return this.switches[t.id]}createNode(t,e={}){const s=new Xt(this.events,t);return e.detached&&this.nodes.detached.push(s),s}components(){return new at(this)}actions(t,e){return new Ut(this,t,e)}write(t){const{provider:e,target:s,attributes:n,options:r={},removable:o}=t,a=t.key||ot(),h={changeset:[n,r],target:s,removes:[]};if(e){const c=this.providers[e];c.write(a,s,n,r),h.removes.push(()=>{c.remove(a)})}return this.changesets.push(h),this.nodes.all.forEach(c=>{if(s.match(c)){let l=()=>{};n.properties&&(l=c.writeProperties(n.properties,r,o)),n.context&&(l=c.writeContext(n.context,r,o)),n.layout&&(l=c.writeContext(n.layout,r,o)),h.removes.push(l)}}),()=>{if(o){h.removes.forEach(l=>l());const c=this.changesets.indexOf(h);c>-1&&this.changesets.splice(c,1)}}}addComponentHandler(t,e){this.customComponentHandler.add(t,e)}getComponentHandler(t){return this.customComponentHandler.get(t)}dispose(){this.subscriptions.forEach(t=>t())}}const As=(i,t)=>({id:i.id,type:i.type,name:i.name,branch:t||"default"}),Es=(i,t,e,s=ot(),n={})=>i.getAsync("components").then(r=>{let o;if(typeof t=="string"){const c=new at(r);c.ofType(t),o=c}else o=t;const a={},h=c=>{const l=a[c.id];return l?Promise.resolve(l.controller):_e.getInstance(i).then(d=>new be(d,c,s))};r.events.subscribe("components:node-enter",(c,{node:l})=>{o.match(l)&&h(l).then(d=>{Promise.resolve(e(d)).then(p=>{a[l.id]={dispose:p,controller:d}})})}),r.events.subscribe("components:node-exit",(c,{node:l})=>{const d=a[l.id];d&&(d.dispose&&d.dispose(),n.reuseController||(d.controller.dispose(),delete a[l.id]))})}),xs="#____version____#",Ae=class extends $e{constructor(t,e=[]){super(t,e,{transformPluginSettings:(s,n,r)=>{const o=r.get("$settings"),a=o.plugins&&n?o.plugins[n]||{}:{};return Ct(Ct({},a),s)}})}createImplementation(t){const e=super.createImplementation(t);return e.bindings=t.bindings,e}navigate(t,e,s){this.widgets.query(t).forEach(n=>n.invoke("navigate",{route:e,params:s}))}static create(t={}){const e=[He].concat(t.configurationApiExtensions||[]);return new Ae("humany",e)}static createFromGlobal(t,e={}){if(this.isRuntime(t))return t.patch(e),t;const s=[],n=t&&t._c;n&&n.forEach(o=>s.push(o));const r=this.create(e);return r.container.register("$runtimecfg",s),r}static isRuntime(t){return!!(t&&typeof t=="object"&&t.container&&typeof t.container.get=="function"&&t.container.get("$environment")===t&&t.container.owner===t)}};let Cs=Ae;Cs.version=`${xs} (${Mt})`;/**
4
- * @license
5
- * Copyright 2019 Google LLC
6
- * SPDX-License-Identifier: BSD-3-Clause
7
- */const tt=window,Lt=tt.ShadowRoot&&(tt.ShadyCSS===void 0||tt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Rt=Symbol(),te=new WeakMap;let Ee=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==Rt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(Lt&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=te.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&te.set(e,t))}return t}toString(){return this.cssText}};const Ps=i=>new Ee(typeof i=="string"?i:i+"",void 0,Rt),xe=(i,...t)=>{const e=i.length===1?i[0]:t.reduce((s,n,r)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[r+1],i[0]);return new Ee(e,i,Rt)},ks=(i,t)=>{Lt?i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(e=>{const s=document.createElement("style"),n=tt.litNonce;n!==void 0&&s.setAttribute("nonce",n),s.textContent=e.cssText,i.appendChild(s)})},ee=Lt?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return Ps(e)})(i):i;/**
8
- * @license
9
- * Copyright 2017 Google LLC
10
- * SPDX-License-Identifier: BSD-3-Clause
11
- */var $t;const it=window,se=it.trustedTypes,Os=se?se.emptyScript:"",ie=it.reactiveElementPolyfillSupport,Pt={toAttribute(i,t){switch(t){case Boolean:i=i?Os:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},Ce=(i,t)=>t!==i&&(t==t||i==i),bt={attribute:!0,type:String,converter:Pt,reflect:!1,hasChanged:Ce},kt="finalized";let U=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),((e=this.h)!==null&&e!==void 0?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach((e,s)=>{const n=this._$Ep(s,e);n!==void 0&&(this._$Ev.set(n,s),t.push(n))}),t}static createProperty(t,e=bt){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const s=typeof t=="symbol"?Symbol():"__"+t,n=this.getPropertyDescriptor(t,s,e);n!==void 0&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(n){const r=this[t];this[e]=n,this.requestUpdate(t,r,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||bt}static finalize(){if(this.hasOwnProperty(kt))return!1;this[kt]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),t.h!==void 0&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,s=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const n of s)this.createProperty(n,e[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const n of s)e.unshift(ee(n))}else t!==void 0&&e.push(ee(t));return e}static _$Ep(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(t=this.constructor.h)===null||t===void 0||t.forEach(e=>e(this))}addController(t){var e,s;((e=this._$ES)!==null&&e!==void 0?e:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((s=t.hostConnected)===null||s===void 0||s.call(t))}removeController(t){var e;(e=this._$ES)===null||e===void 0||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])})}createRenderRoot(){var t;const e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return ks(e,this.constructor.elementStyles),e}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)===null||t===void 0||t.forEach(e=>{var s;return(s=e.hostConnected)===null||s===void 0?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)===null||t===void 0||t.forEach(e=>{var s;return(s=e.hostDisconnected)===null||s===void 0?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e,s=bt){var n;const r=this.constructor._$Ep(t,s);if(r!==void 0&&s.reflect===!0){const o=(((n=s.converter)===null||n===void 0?void 0:n.toAttribute)!==void 0?s.converter:Pt).toAttribute(e,s.type);this._$El=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$El=null}}_$AK(t,e){var s;const n=this.constructor,r=n._$Ev.get(t);if(r!==void 0&&this._$El!==r){const o=n.getPropertyOptions(r),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((s=o.converter)===null||s===void 0?void 0:s.fromAttribute)!==void 0?o.converter:Pt;this._$El=r,this[r]=a.fromAttribute(e,o.type),this._$El=null}}requestUpdate(t,e,s){let n=!0;t!==void 0&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||Ce)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$El!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,s))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((n,r)=>this[r]=n),this._$Ei=void 0);let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),(t=this._$ES)===null||t===void 0||t.forEach(n=>{var r;return(r=n.hostUpdate)===null||r===void 0?void 0:r.call(n)}),this.update(s)):this._$Ek()}catch(n){throw e=!1,this._$Ek(),n}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;(e=this._$ES)===null||e===void 0||e.forEach(s=>{var n;return(n=s.hostUpdated)===null||n===void 0?void 0:n.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){this._$EC!==void 0&&(this._$EC.forEach((e,s)=>this._$EO(s,this[s],e)),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}};U[kt]=!0,U.elementProperties=new Map,U.elementStyles=[],U.shadowRootOptions={mode:"open"},ie==null||ie({ReactiveElement:U}),(($t=it.reactiveElementVersions)!==null&&$t!==void 0?$t:it.reactiveElementVersions=[]).push("1.6.3");/**
12
- * @license
13
- * Copyright 2017 Google LLC
14
- * SPDX-License-Identifier: BSD-3-Clause
15
- */var wt;const nt=window,R=nt.trustedTypes,ne=R?R.createPolicy("lit-html",{createHTML:i=>i}):void 0,Ot="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,Pe="?"+k,Ss=`<${Pe}>`,T=document,q=()=>T.createComment(""),Y=i=>i===null||typeof i!="object"&&typeof i!="function",ke=Array.isArray,Ns=i=>ke(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",_t=`[
16
- \f\r]`,B=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,re=/-->/g,oe=/>/g,S=RegExp(`>|${_t}(?:([^\\s"'>=/]+)(${_t}*=${_t}*(?:[^
17
- \f\r"'\`<>=]|("|')|))|$)`,"g"),ae=/'/g,ce=/"/g,Oe=/^(?:script|style|textarea|title)$/i,Ts=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),W=Ts(1),M=Symbol.for("lit-noChange"),g=Symbol.for("lit-nothing"),he=new WeakMap,N=T.createTreeWalker(T,129,null,!1);function Se(i,t){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return ne!==void 0?ne.createHTML(t):t}const Ms=(i,t)=>{const e=i.length-1,s=[];let n,r=t===2?"<svg>":"",o=B;for(let a=0;a<e;a++){const h=i[a];let c,l,d=-1,p=0;for(;p<h.length&&(o.lastIndex=p,l=o.exec(h),l!==null);)p=o.lastIndex,o===B?l[1]==="!--"?o=re:l[1]!==void 0?o=oe:l[2]!==void 0?(Oe.test(l[2])&&(n=RegExp("</"+l[2],"g")),o=S):l[3]!==void 0&&(o=S):o===S?l[0]===">"?(o=n??B,d=-1):l[1]===void 0?d=-2:(d=o.lastIndex-l[2].length,c=l[1],o=l[3]===void 0?S:l[3]==='"'?ce:ae):o===ce||o===ae?o=S:o===re||o===oe?o=B:(o=S,n=void 0);const u=o===S&&i[a+1].startsWith("/>")?" ":"";r+=o===B?h+Ss:d>=0?(s.push(c),h.slice(0,d)+Ot+h.slice(d)+k+u):h+k+(d===-2?(s.push(void 0),a):u)}return[Se(i,r+(i[e]||"<?>")+(t===2?"</svg>":"")),s]};class Q{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let r=0,o=0;const a=t.length-1,h=this.parts,[c,l]=Ms(t,e);if(this.el=Q.createElement(c,s),N.currentNode=this.el.content,e===2){const d=this.el.content,p=d.firstChild;p.remove(),d.append(...p.childNodes)}for(;(n=N.nextNode())!==null&&h.length<a;){if(n.nodeType===1){if(n.hasAttributes()){const d=[];for(const p of n.getAttributeNames())if(p.endsWith(Ot)||p.startsWith(k)){const u=l[o++];if(d.push(p),u!==void 0){const y=n.getAttribute(u.toLowerCase()+Ot).split(k),w=/([.?@])?(.*)/.exec(u);h.push({type:1,index:r,name:w[2],strings:y,ctor:w[1]==="."?Hs:w[1]==="?"?Rs:w[1]==="@"?js:ct})}else h.push({type:6,index:r})}for(const p of d)n.removeAttribute(p)}if(Oe.test(n.tagName)){const d=n.textContent.split(k),p=d.length-1;if(p>0){n.textContent=R?R.emptyScript:"";for(let u=0;u<p;u++)n.append(d[u],q()),N.nextNode(),h.push({type:2,index:++r});n.append(d[p],q())}}}else if(n.nodeType===8)if(n.data===Pe)h.push({type:2,index:r});else{let d=-1;for(;(d=n.data.indexOf(k,d+1))!==-1;)h.push({type:7,index:r}),d+=k.length-1}r++}}static createElement(t,e){const s=T.createElement("template");return s.innerHTML=t,s}}function j(i,t,e=i,s){var n,r,o,a;if(t===M)return t;let h=s!==void 0?(n=e._$Co)===null||n===void 0?void 0:n[s]:e._$Cl;const c=Y(t)?void 0:t._$litDirective$;return(h==null?void 0:h.constructor)!==c&&((r=h==null?void 0:h._$AO)===null||r===void 0||r.call(h,!1),c===void 0?h=void 0:(h=new c(i),h._$AT(i,e,s)),s!==void 0?((o=(a=e)._$Co)!==null&&o!==void 0?o:a._$Co=[])[s]=h:e._$Cl=h),h!==void 0&&(t=j(i,h._$AS(i,t.values),h,s)),t}class Us{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;const{el:{content:s},parts:n}=this._$AD,r=((e=t==null?void 0:t.creationScope)!==null&&e!==void 0?e:T).importNode(s,!0);N.currentNode=r;let o=N.nextNode(),a=0,h=0,c=n[0];for(;c!==void 0;){if(a===c.index){let l;c.type===2?l=new K(o,o.nextSibling,this,t):c.type===1?l=new c.ctor(o,c.name,c.strings,this,t):c.type===6&&(l=new zs(o,this,t)),this._$AV.push(l),c=n[++h]}a!==(c==null?void 0:c.index)&&(o=N.nextNode(),a++)}return N.currentNode=T,r}v(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class K{constructor(t,e,s,n){var r;this.type=2,this._$AH=g,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cp=(r=n==null?void 0:n.isConnected)===null||r===void 0||r}get _$AU(){var t,e;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=j(this,t,e),Y(t)?t===g||t==null||t===""?(this._$AH!==g&&this._$AR(),this._$AH=g):t!==this._$AH&&t!==M&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):Ns(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==g&&Y(this._$AH)?this._$AA.nextSibling.data=t:this.$(T.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:n}=t,r=typeof n=="number"?this._$AC(t):(n.el===void 0&&(n.el=Q.createElement(Se(n.h,n.h[0]),this.options)),n);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===r)this._$AH.v(s);else{const o=new Us(r,this),a=o.u(this.options);o.v(s),this.$(a),this._$AH=o}}_$AC(t){let e=he.get(t.strings);return e===void 0&&he.set(t.strings,e=new Q(t)),e}T(t){ke(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const r of t)n===e.length?e.push(s=new K(this.k(q()),this.k(q()),this,this.options)):s=e[n],s._$AI(r),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)===null||s===void 0||s.call(this,!1,!0,e);t&&t!==this._$AB;){const n=t.nextSibling;t.remove(),t=n}}setConnected(t){var e;this._$AM===void 0&&(this._$Cp=t,(e=this._$AP)===null||e===void 0||e.call(this,t))}}class ct{constructor(t,e,s,n,r){this.type=1,this._$AH=g,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=g}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const r=this.strings;let o=!1;if(r===void 0)t=j(this,t,e,0),o=!Y(t)||t!==this._$AH&&t!==M,o&&(this._$AH=t);else{const a=t;let h,c;for(t=r[0],h=0;h<r.length-1;h++)c=j(this,a[s+h],e,h),c===M&&(c=this._$AH[h]),o||(o=!Y(c)||c!==this._$AH[h]),c===g?t=g:t!==g&&(t+=(c??"")+r[h+1]),this._$AH[h]=c}o&&!n&&this.j(t)}j(t){t===g?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Hs extends ct{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===g?void 0:t}}const Ls=R?R.emptyScript:"";class Rs extends ct{constructor(){super(...arguments),this.type=4}j(t){t&&t!==g?this.element.setAttribute(this.name,Ls):this.element.removeAttribute(this.name)}}class js extends ct{constructor(t,e,s,n,r){super(t,e,s,n,r),this.type=5}_$AI(t,e=this){var s;if((t=(s=j(this,t,e,0))!==null&&s!==void 0?s:g)===M)return;const n=this._$AH,r=t===g&&n!==g||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,o=t!==g&&(n===g||r);r&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,s;typeof this._$AH=="function"?this._$AH.call((s=(e=this.options)===null||e===void 0?void 0:e.host)!==null&&s!==void 0?s:this.element,t):this._$AH.handleEvent(t)}}class zs{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){j(this,t)}}const le=nt.litHtmlPolyfillSupport;le==null||le(Q,K),((wt=nt.litHtmlVersions)!==null&&wt!==void 0?wt:nt.litHtmlVersions=[]).push("2.8.0");const Ds=(i,t,e)=>{var s,n;const r=(s=e==null?void 0:e.renderBefore)!==null&&s!==void 0?s:t;let o=r._$litPart$;if(o===void 0){const a=(n=e==null?void 0:e.renderBefore)!==null&&n!==void 0?n:null;r._$litPart$=o=new K(t.insertBefore(q(),a),a,void 0,e??{})}return o._$AI(i),o};/**
18
- * @license
19
- * Copyright 2017 Google LLC
20
- * SPDX-License-Identifier: BSD-3-Clause
21
- */var At,Et;class L extends U{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const s=super.createRenderRoot();return(t=(e=this.renderOptions).renderBefore)!==null&&t!==void 0||(e.renderBefore=s.firstChild),s}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Ds(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!1)}render(){return M}}L.finalized=!0,L._$litElement$=!0,(At=globalThis.litElementHydrateSupport)===null||At===void 0||At.call(globalThis,{LitElement:L});const de=globalThis.litElementPolyfillSupport;de==null||de({LitElement:L});((Et=globalThis.litElementVersions)!==null&&Et!==void 0?Et:globalThis.litElementVersions=[]).push("3.3.3");/**
22
- * @license
23
- * Copyright 2017 Google LLC
24
- * SPDX-License-Identifier: BSD-3-Clause
25
- */const Is=(i,t)=>t.kind==="method"&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(e){e.createProperty(t.key,i)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){typeof t.initializer=="function"&&(this[t.key]=t.initializer.call(this))},finisher(e){e.createProperty(t.key,i)}},Bs=(i,t,e)=>{t.constructor.createProperty(e,i)};function ht(i){return(t,e)=>e!==void 0?Bs(i,t,e):Is(i,t)}/**
26
- * @license
27
- * Copyright 2017 Google LLC
28
- * SPDX-License-Identifier: BSD-3-Clause
29
- */function lt(i){return ht({...i,state:!0})}/**
30
- * @license
31
- * Copyright 2021 Google LLC
32
- * SPDX-License-Identifier: BSD-3-Clause
33
- */var xt;((xt=window.HTMLSlotElement)===null||xt===void 0?void 0:xt.prototype.assignedElements)!=null;/**
34
- * @license
35
- * Copyright 2017 Google LLC
36
- * SPDX-License-Identifier: BSD-3-Clause
37
- */const Vs={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Ws=i=>(...t)=>({_$litDirective$:i,values:t});class Fs{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/**
38
- * @license
39
- * Copyright 2018 Google LLC
40
- * SPDX-License-Identifier: BSD-3-Clause
41
- */const qs=Ws(class extends Fs{constructor(i){var t;if(super(i),i.type!==Vs.ATTRIBUTE||i.name!=="class"||((t=i.strings)===null||t===void 0?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(i){return" "+Object.keys(i).filter(t=>i[t]).join(" ")+" "}update(i,[t]){var e,s;if(this.it===void 0){this.it=new Set,i.strings!==void 0&&(this.nt=new Set(i.strings.join(" ").split(/\s/).filter(r=>r!=="")));for(const r in t)t[r]&&!(!((e=this.nt)===null||e===void 0)&&e.has(r))&&this.it.add(r);return this.render(t)}const n=i.element.classList;this.it.forEach(r=>{r in t||(n.remove(r),this.it.delete(r))});for(const r in t){const o=!!t[r];o===this.it.has(r)||!((s=this.nt)===null||s===void 0)&&s.has(r)||(o?(n.add(r),this.it.add(r)):(n.remove(r),this.it.delete(r)))}return M}}),m=(i,t,e)=>{i&&e.style.setProperty(t,i)},Ne=(i,t)=>{var e,s,n,r,o,a,h,c,l,d,p;m((e=i.colors)==null?void 0:e.primary,"--primary-color",t),m((s=i.colors)==null?void 0:s.secondary,"--secondary-color",t),m((n=i.colors)==null?void 0:n.text,"--text-color",t),m((r=i.colors)==null?void 0:r.link,"--link-color",t),m((o=i.colors)==null?void 0:o.gray,"--gray-color",t),m((a=i.colors)==null?void 0:a.grayDark,"--gray-dark-color",t),m((h=i.spacing)==null?void 0:h.xs,"--spacing-xs",t),m((c=i.spacing)==null?void 0:c.sm,"--spacing-sm",t),m((l=i.spacing)==null?void 0:l.md,"--spacing-md",t),m((d=i.spacing)==null?void 0:d.lg,"--spacing-lg",t),m((p=i.spacing)==null?void 0:p.xl,"--spacing-xl",t),m(i.boxShadow,"--box-shadow",t),m(i.borderRadius,"--border-radius",t),m(i.borderRadiusSm,"--border-radius-sm",t),m(i.fontFamily,"--font-family",t)};var Ys=Object.defineProperty,Qs=Object.getOwnPropertyDescriptor,J=(i,t,e,s)=>{for(var n=s>1?void 0:s?Qs(t,e):t,r=i.length-1,o;r>=0;r--)(o=i[r])&&(n=(s?o(t,e,n):o(n))||n);return s&&n&&Ys(t,e,n),n};class D extends L{constructor(){super(...arguments),this.active=!1,this.loaded=!1}async connectedCallback(){super.connectedCallback(),this.icon=await this._renderSymbol(this.symbol),this.loaded=!0,this._applyBranding()}_toggleActive(){this.active=!this.active}_applyBranding(){var s;const t=((s=this.container)==null?void 0:s.get("$settings"))??{},e=t==null?void 0:t.components[t==null?void 0:t.entry];e&&Ne(e.context,this)}async _renderSymbol(t){const e=async s=>await Promise.resolve().then(()=>require("./index-6dd00f59.js")).then(r=>r[s]);if(t){const{type:s,content:n}=t;switch(s){case"Telia":{const r=await e(n);return r?W`<telia-icon
42
- class="trigger-icon"
43
- svg=${r.svg}
44
- size="lg"
45
- ></telia-icon>`:g}case"FontAwesome":return W`<i class="trigger-fa-icon fa fa-${n}"></i>`;case"Uri":return W`<i
46
- class="trigger-custom-icon"
47
- style="background: url(${n}) no-repeat center center;background-size: contain;"
48
- ></i>`;default:return g}}}render(){return W`<button
49
- class=${qs({trigger:!0,active:this.active,rendered:this.loaded})}
50
- @click=${this._toggleActive}
51
- >
52
- ${this.icon}
53
- <span class="trigger-close">
54
- <svg
55
- width="18"
56
- height="9"
57
- viewBox="0 0 18 9"
58
- fill="none"
59
- xmlns="http://www.w3.org/2000/svg"
60
- >
61
- <path
62
- d="M9 9C8.81794 9.00045 8.63759 8.96634 8.46939 8.89965C8.3012 8.83295 8.14851 8.735 8.02015 8.61145L0.194523 1.12367C0.068294 0.99862 -0.00155266 0.831133 2.61958e-05 0.657285C0.00160506 0.483436 0.0744832 0.317136 0.202964 0.194202C0.331445 0.0712675 0.505249 0.00153576 0.686941 2.50649e-05C0.868634 -0.00148563 1.04368 0.0653456 1.17437 0.186125L9 7.6739L16.8256 0.186125C16.9563 0.0653456 17.1314 -0.00148563 17.3131 2.50649e-05C17.4948 0.00153576 17.6686 0.0712675 17.797 0.194202C17.9255 0.317136 17.9984 0.483436 18 0.657285C18.0016 0.831133 17.9317 0.99862 17.8055 1.12367L9.97985 8.61145C9.85149 8.735 9.6988 8.83295 9.53061 8.89965C9.36241 8.96634 9.18206 9.00045 9 9Z"
63
- fill="white"
64
- />
65
- </svg>
66
- </span>
67
- <span class="trigger-loader">
68
- <svg viewBox="25 25 50 50">
69
- <circle
70
- cx="50"
71
- cy="50"
72
- r="20"
73
- fill="none"
74
- stroke="#000"
75
- stroke-width="2"
76
- stroke-miterlimit="10"
77
- />
78
- </svg>
79
- </span>
80
- </button>`}}D.styles=[xe`
81
- :host {
82
- --voca-rem-multiplier: 0.625;
83
- display: block;
84
- box-sizing: border-box;
85
- }
86
-
87
- .trigger {
88
- position: fixed;
89
- transform: scale(0);
90
- box-shadow: rgba(0, 0, 0, 0.16) 0px 5px 40px;
91
- bottom: 20px;
92
- right: 20px;
93
- z-index: 5;
94
- display: flex;
95
- align-items: center;
96
- justify-content: center;
97
- border: none;
98
- line-height: 55px;
99
- height: 55px;
100
- width: 55px;
101
- border-radius: 55px;
102
- cursor: pointer;
103
- background-color: var(--trigger-bg, var(--primary-color));
104
- font-family: Lato;
105
- text-decoration: none;
106
- border: 3px dashed transparent;
107
- box-sizing: border-box;
108
- transition: transform 200ms ease-out;
109
- }
110
- .trigger:hover {
111
- transform: scale(1.1) !important;
112
- }
113
- .trigger.rendered {
114
- transform: scale(1);
115
- }
116
- .trigger.active .trigger-icon {
117
- opacity: 0;
118
- transform: rotate(-180deg) scale(0);
119
- }
120
- .trigger.active .trigger-close {
121
- opacity: 1;
122
- transform: rotate(0deg) scale(1);
123
- }
124
-
125
- .trigger-icon {
126
- display: inline-block;
127
- line-height: inherit;
128
- text-align: center;
129
- opacity: 1;
130
- transform: rotate(0deg) scale(1);
131
- transition: opacity 200ms ease-out, transform 200ms ease-out;
132
- color: var(--trigger-text-color, #fff);
133
- }
134
- .trigger-close {
135
- opacity: 0;
136
- transition: transform 200ms ease-out;
137
- transform: rotate(180deg) scale(0);
138
- position: absolute;
139
- top: 0;
140
- bottom: 0;
141
- left: 0;
142
- right: 0;
143
- display: flex;
144
- justify-content: center;
145
- align-items: center;
146
- fill: var(--trigger-text-color, #fff);
147
- }
148
- `];J([ht({attribute:!1})],D.prototype,"symbol",2);J([ht({attribute:!1})],D.prototype,"container",2);J([lt()],D.prototype,"active",2);J([lt()],D.prototype,"loaded",2);J([lt()],D.prototype,"icon",2);const Zs=(i,t,e,s,n)=>i.getAsync("componentResolver").then(r=>(r.registerComponent(t,e),Es(i,t,s||(()=>{}),t,n))),Ks=i=>Zs(i,"widget-header",Promise.resolve().then(()=>require("./widget-header-7608ed74.js")),t=>{});console.log("3");exports.A=g;exports.Et=As;exports.P=at;exports.WidgetHeaderComponent=Ks;exports.ht=ot;exports.i=xe;exports.mapBranding=Ne;exports.n=ht;exports.pt=_e;exports.s=L;exports.t=lt;exports.x=W;
package/index.js DELETED
@@ -1 +0,0 @@
1
- "use strict";const e=require("./index-9758471c.js");module.exports=e.WidgetHeaderComponent;
package/index.mjs DELETED
@@ -1,4 +0,0 @@
1
- import { W as f } from "./index-8690ade6.mjs";
2
- export {
3
- f as default
4
- };
@@ -1,72 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-9758471c.js");/**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */const y=o=>t=>typeof t=="function"?((i,e)=>(customElements.define(i,e),e))(o,t):((i,e)=>{const{kind:s,elements:n}=e;return{kind:s,elements:n,finisher(r){customElements.define(i,r)}}})(o,t);/**
6
- * @license
7
- * Copyright 2017 Google LLC
8
- * SPDX-License-Identifier: BSD-3-Clause
9
- */const _=({finisher:o,descriptor:t})=>(i,e)=>{var s;if(e===void 0){const n=(s=i.originalKey)!==null&&s!==void 0?s:i.key,r=t!=null?{kind:"method",placement:"prototype",key:n,descriptor:t(i.key)}:{...i,key:n};return o!=null&&(r.finisher=function(h){o(h,n)}),r}{const n=i.constructor;t!==void 0&&Object.defineProperty(i,e,t(e)),o==null||o(n,e)}};/**
10
- * @license
11
- * Copyright 2021 Google LLC
12
- * SPDX-License-Identifier: BSD-3-Clause
13
- */let v=class extends Event{constructor(t,i,e){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=i,this.subscribe=e!=null&&e}};/**
14
- * @license
15
- * Copyright 2021 Google LLC
16
- * SPDX-License-Identifier: BSD-3-Clause
17
- *//**
18
- * @license
19
- * Copyright 2021 Google LLC
20
- * SPDX-License-Identifier: BSD-3-Clause
21
- */let g=class{constructor(t,i,e,s){var n;if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(r,h)=>{this.unsubscribe&&(this.unsubscribe!==h&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=r,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(r,h)),this.unsubscribe=h},this.host=t,i.context!==void 0){const r=i;this.context=r.context,this.callback=r.callback,this.subscribe=(n=r.subscribe)!==null&&n!==void 0&&n}else this.context=i,this.callback=e,this.subscribe=s!=null&&s;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new v(this.context,this.t,this.subscribe))}};/**
22
- * @license
23
- * Copyright 2021 Google LLC
24
- * SPDX-License-Identifier: BSD-3-Clause
25
- */class m{constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(const[i,{disposer:e}]of this.subscriptions)i(this.o,e)},t!==void 0&&(this.value=t)}get value(){return this.o}set value(t){this.setValue(t)}setValue(t,i=!1){const e=i||!Object.is(t,this.o);this.o=t,e&&this.updateObservers()}addCallback(t,i,e){if(!e)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:i});const{disposer:s}=this.subscriptions.get(t);t(this.value,s)}clearCallbacks(){this.subscriptions.clear()}}/**
26
- * @license
27
- * Copyright 2021 Google LLC
28
- * SPDX-License-Identifier: BSD-3-Clause
29
- */class C extends Event{constructor(t){super("context-provider",{bubbles:!0,composed:!0}),this.context=t}}class u extends m{constructor(t,i,e){super(i.context!==void 0?i.initialValue:e),this.onContextRequest=s=>{const n=s.composedPath()[0];s.context===this.context&&n!==this.host&&(s.stopPropagation(),this.addCallback(s.callback,n,s.subscribe))},this.onProviderRequest=s=>{const n=s.composedPath()[0];if(s.context!==this.context||n===this.host)return;const r=new Set;for(const[h,{consumerHost:l}]of this.subscriptions)r.has(h)||(r.add(h),l.dispatchEvent(new v(this.context,h,!0)));s.stopPropagation()},this.host=t,i.context!==void 0?this.context=i.context:this.context=i,this.attachListeners(),this.host.addController(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new C(this.context))}}/**
30
- * @license
31
- * Copyright 2022 Google LLC
32
- * SPDX-License-Identifier: BSD-3-Clause
33
- */function P({context:o,subscribe:t}){return _({finisher:(i,e)=>{i.addInitializer(s=>{new g(s,{context:o,callback:n=>{s[e]=n},subscribe:t})})}})}const w="children",L="descriptor",O="container",E="context",k="layout",q="properties";class R{constructor(t){(this.host=t).addController(this)}hostConnected(){}hostDisconnected(){}setDescriptor(t){this._descriptor=t}setContainer(t){this._container=t}async dispatch(t,i){if(!this._container||!this._descriptor)return;const e=await c.pt.getInstance(this._container),s=new c.P(e).withId(this._descriptor.id);await e.actions(s,this._descriptor.type||c.ht()).dispatch(t,i)}}const D=o=>{const t={};return Object.keys(o).forEach(i=>{i.indexOf("css-")>-1&&(t[i]=o[i])}),t},W=(o,t)=>{const i=D(t);Object.entries(i).forEach(([e,s])=>{o.style.setProperty(e.replace("css-",""),s)})};var $=Object.defineProperty,j=Object.getOwnPropertyDescriptor,d=(o,t,i,e)=>{for(var s=e>1?void 0:e?j(t,i):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(s=(e?r(t,i,s):r(s))||s);return e&&s&&$(t,i,s),s};const H=o=>{class t extends o{constructor(){super(...arguments),this.entry="",this._descriptorProvider=new u(this,L,void 0),this._childrenProvider=new u(this,w,[]),this._propertiesProvider=new u(this,q,{}),this._contextProvider=new u(this,E,{}),this._layoutProvider=new u(this,k,{}),this.actions=new R(this),this.context={},this.layout={},this.properties={}}connectedCallback(){super.connectedCallback(),this.container&&(this.actions.setContainer(this.container),c.pt.getInstance(this.container).then(async e=>{var n,r;const s=e.nodes.get(this.entry);if(s){this._propertyChangeListener=e.events.subscribe("components:properties-changed",(p,a)=>{s.id===a.node.id&&this._setProperties(a.node.attributes.properties)}),this._contextChangeListener=e.events.subscribe("components:context-changed",(p,a)=>{s.id===a.node.id&&this._setContext(a.node.attributes.context)}),this._layoutChangeListener=e.events.subscribe("components:layout-changed",(p,a)=>{s.id===a.node.id&&this._setLayout(a.node.attributes.layout)});const h="default";this._unmountNode=s.mount(this.container),this._setDescriptor(c.Et(s,h)),this._setProperties(s.attributes.properties),this._setContext(s.attributes.context),this._setLayout(this.layout);const l=s.getChildren(h).map(p=>c.Et(p));this._childrenProvider.setValue(l);const f=await this.container.getAsync("componentResolver");if(((n=this.descriptor)==null?void 0:n.type)==="area")return;const b=f.getComponent(((r=this.descriptor)==null?void 0:r.type)||"");b.then&&b.then(p=>{this.component=p.default})}}))}disconnectedCallback(){super.disconnectedCallback(),this._propertyChangeListener&&this._propertyChangeListener(),this._contextChangeListener&&this._contextChangeListener(),this._layoutChangeListener&&this._layoutChangeListener(),this._unmountNode&&this._unmountNode()}updated(){this.container&&this.actions.setContainer(this.container),c.mapBranding(this.context,this.renderRoot.host),this.renderRoot.host.style.setProperty("--width",this.layout.size==="full"?"var(--columns, 1)":`min(${this.layout.size||"var(--columns)"}, var(--columns))`),W(this.renderRoot.host,this.properties)}_setProperties(e){this._propertiesProvider.setValue(e),this.properties=e}_setContext(e){this._contextProvider.setValue(e),this.context=e}_setLayout(e){this._layoutProvider.setValue(e),this.layout=e}_setDescriptor(e){this.descriptor=e,this._descriptorProvider.setValue(e),this.actions.setDescriptor(e)}}return t.styles=[o.styles??[],c.i`
34
- :host {
35
- font-family: var(--font-family);
36
- grid-column: span var(--width);
37
- max-width: 100%;
38
- overflow: hidden;
39
- box-sizing: border-box;
40
- display: block;
41
- }
42
- * {
43
- box-sizing: border-box;
44
- }
45
- `],d([P({context:O}),c.n({attribute:!1})],t.prototype,"container",2),d([c.n()],t.prototype,"entry",2),d([c.t()],t.prototype,"descriptor",2),d([c.t()],t.prototype,"component",2),d([c.t()],t.prototype,"context",2),d([c.t()],t.prototype,"layout",2),d([c.t()],t.prototype,"properties",2),t};var V=Object.defineProperty,z=Object.getOwnPropertyDescriptor,I=(o,t,i,e)=>{for(var s=e>1?void 0:e?z(t,i):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(s=(e?r(t,i,s):r(s))||s);return e&&s&&V(t,i,s),s};const x=H(c.s);exports.WidgetHeaderComponent=class extends x{render(){return c.x` <div class="widget-header">
46
- <div>
47
- <h1>${this.properties.header}</h1>
48
-
49
- ${this.properties.tagline?c.x`<p>${this.properties.tagline}</p>`:c.A}
50
- </div>
51
- </div>`}};exports.WidgetHeaderComponent.styles=[x.styles||[],c.i`
52
- .widget-header {
53
- background-color: var(--primary-color);
54
- color: #fff;
55
- height: 85px;
56
- display: flex;
57
- flex-direction: row;
58
- align-items: center;
59
- border-radius: var(--spacing-sm) var(--spacing-sm) 0px 0px;
60
- padding: 0 var(--spacing-md);
61
- }
62
-
63
- h1 {
64
- font-size: 1.2rem;
65
- }
66
-
67
- h1,
68
- p {
69
- margin: 0;
70
- padding: 0;
71
- }
72
- `];exports.WidgetHeaderComponent=I([y("ace-widget-header")],exports.WidgetHeaderComponent);const N=exports.WidgetHeaderComponent;exports.default=N;