@telia-ace/widget-core-flamingo 1.1.70-rc.27 → 1.1.70-rc.28
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +15 -15
- package/index.mjs +54 -62
- package/package.json +1 -1
- package/services/widget-api.d.ts +0 -2
package/index.js
CHANGED
@@ -1,24 +1,24 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var gt=function(s,t){return gt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])},gt(s,t)};function F(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");gt(s,t);function e(){this.constructor=s}s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function mt(s){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&s[t],i=0;if(e)return e.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&i>=s.length&&(s=void 0),{value:s&&s[i++],done:!s}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function J(s,t){var e=typeof Symbol=="function"&&s[Symbol.iterator];if(!e)return s;var i=e.call(s),r,n=[],o;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)n.push(r.value)}catch(a){o={error:a}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return n}function X(s,t,e){if(e||arguments.length===2)for(var i=0,r=t.length,n;i<r;i++)(n||!(i in t))&&(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return s.concat(n||Array.prototype.slice.call(t))}function
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var gt=function(s,t){return gt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])},gt(s,t)};function F(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");gt(s,t);function e(){this.constructor=s}s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function mt(s){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&s[t],i=0;if(e)return e.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&i>=s.length&&(s=void 0),{value:s&&s[i++],done:!s}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function J(s,t){var e=typeof Symbol=="function"&&s[Symbol.iterator];if(!e)return s;var i=e.call(s),r,n=[],o;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)n.push(r.value)}catch(a){o={error:a}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return n}function X(s,t,e){if(e||arguments.length===2)for(var i=0,r=t.length,n;i<r;i++)(n||!(i in t))&&(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return s.concat(n||Array.prototype.slice.call(t))}function _(s){return typeof s=="function"}function Qt(s){var t=function(i){Error.call(i),i.stack=new Error().stack},e=s(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var ot=Qt(function(s){return function(e){s(this),this.message=e?e.length+` errors occurred during unsubscription:
|
2
2
|
`+e.map(function(i,r){return r+1+") "+i.toString()}).join(`
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=e}});function vt(s,t){if(s){var e=s.indexOf(t);0<=e&&s.splice(e,1)}}var it=function(){function s(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return s.prototype.unsubscribe=function(){var t,e,i,r,n;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=mt(o),c=a.next();!c.done;c=a.next()){var h=c.value;h.remove(this)}}catch(y){t={error:y}}finally{try{c&&!c.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var l=this.initialTeardown;if(
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=e}});function vt(s,t){if(s){var e=s.indexOf(t);0<=e&&s.splice(e,1)}}var it=function(){function s(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return s.prototype.unsubscribe=function(){var t,e,i,r,n;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=mt(o),c=a.next();!c.done;c=a.next()){var h=c.value;h.remove(this)}}catch(y){t={error:y}}finally{try{c&&!c.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var l=this.initialTeardown;if(_(l))try{l()}catch(y){n=y instanceof ot?y.errors:[y]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var f=mt(p),u=f.next();!u.done;u=f.next()){var g=u.value;try{Ot(g)}catch(y){n=n??[],y instanceof ot?n=X(X([],J(n)),J(y.errors)):n.push(y)}}}catch(y){i={error:y}}finally{try{u&&!u.done&&(r=f.return)&&r.call(f)}finally{if(i)throw i.error}}}if(n)throw new ot(n)}},s.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Ot(t);else{if(t instanceof s){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},s.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},s.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},s.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&vt(e,t)},s.prototype.remove=function(t){var e=this._finalizers;e&&vt(e,t),t instanceof s&&t._removeParent(this)},s.EMPTY=function(){var t=new s;return t.closed=!0,t}(),s}(),te=it.EMPTY;function ee(s){return s instanceof it||s&&"closed"in s&&_(s.remove)&&_(s.add)&&_(s.unsubscribe)}function Ot(s){_(s)?s():s.unsubscribe()}var ie={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},yt={setTimeout:function(s,t){for(var e=[],i=2;i<arguments.length;i++)e[i-2]=arguments[i];var r=yt.delegate;return r!=null&&r.setTimeout?r.setTimeout.apply(r,X([s,t],J(e))):setTimeout.apply(void 0,X([s,t],J(e)))},clearTimeout:function(s){var t=yt.delegate;return((t==null?void 0:t.clearTimeout)||clearTimeout)(s)},delegate:void 0};function Ee(s){yt.setTimeout(function(){throw s})}function Tt(){}function G(s){s()}var se=function(s){F(t,s);function t(e){var i=s.call(this)||this;return i.isStopped=!1,e?(i.destination=e,ee(e)&&e.add(i)):i.destination=Ie,i}return t.create=function(e,i,r){return new bt(e,i,r)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,s.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(it),Pe=Function.prototype.bind;function at(s,t){return Pe.call(s,t)}var Oe=function(){function s(t){this.partialObserver=t}return s.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(i){q(i)}},s.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(i){q(i)}else q(t)},s.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){q(e)}},s}(),bt=function(s){F(t,s);function t(e,i,r){var n=s.call(this)||this,o;if(_(e)||!e)o={next:e??void 0,error:i??void 0,complete:r??void 0};else{var a;n&&ie.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return n.unsubscribe()},o={next:e.next&&at(e.next,a),error:e.error&&at(e.error,a),complete:e.complete&&at(e.complete,a)}):o=e}return n.destination=new Oe(o),n}return t}(se);function q(s){Ee(s)}function Te(s){throw s}var Ie={closed:!0,next:Tt,error:Te,complete:Tt},Re=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Me(s){return s}function Ue(s){return s.length===0?Me:s.length===1?s[0]:function(e){return s.reduce(function(i,r){return r(i)},e)}}var It=function(){function s(t){t&&(this._subscribe=t)}return s.prototype.lift=function(t){var e=new s;return e.source=this,e.operator=t,e},s.prototype.subscribe=function(t,e,i){var r=this,n=Ne(t)?t:new bt(t,e,i);return G(function(){var o=r,a=o.operator,c=o.source;n.add(a?a.call(n,c):c?r._subscribe(n):r._trySubscribe(n))}),n},s.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},s.prototype.forEach=function(t,e){var i=this;return e=Rt(e),new e(function(r,n){var o=new bt({next:function(a){try{t(a)}catch(c){n(c),o.unsubscribe()}},error:n,complete:r});i.subscribe(o)})},s.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},s.prototype[Re]=function(){return this},s.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ue(t)(this)},s.prototype.toPromise=function(t){var e=this;return t=Rt(t),new t(function(i,r){var n;e.subscribe(function(o){return n=o},function(o){return r(o)},function(){return i(n)})})},s.create=function(t){return new s(t)},s}();function Rt(s){var t;return(t=s??ie.Promise)!==null&&t!==void 0?t:Promise}function ke(s){return s&&_(s.next)&&_(s.error)&&_(s.complete)}function Ne(s){return s&&s instanceof se||ke(s)&&ee(s)}var je=Qt(function(s){return function(){s(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),_t=function(s){F(t,s);function t(){var e=s.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return t.prototype.lift=function(e){var i=new Mt(this,this);return i.operator=e,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new je},t.prototype.next=function(e){var i=this;G(function(){var r,n;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var o=mt(i.currentObservers),a=o.next();!a.done;a=o.next()){var c=a.value;c.next(e)}}catch(h){r={error:h}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}})},t.prototype.error=function(e){var i=this;G(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=e;for(var r=i.observers;r.length;)r.shift().error(e)}})},t.prototype.complete=function(){var e=this;G(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var i=e.observers;i.length;)i.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return((e=this.observers)===null||e===void 0?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(e){return this._throwIfClosed(),s.prototype._trySubscribe.call(this,e)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var i=this,r=this,n=r.hasError,o=r.isStopped,a=r.observers;return n||o?te:(this.currentObservers=null,a.push(e),new it(function(){i.currentObservers=null,vt(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var i=this,r=i.hasError,n=i.thrownError,o=i.isStopped;r?e.error(n):o&&e.complete()},t.prototype.asObservable=function(){var e=new It;return e.source=this,e},t.create=function(e,i){return new Mt(e,i)},t}(It),Mt=function(s){F(t,s);function t(e,i){var r=s.call(this)||this;return r.destination=e,r.source=i,r}return t.prototype.next=function(e){var i,r;(r=(i=this.destination)===null||i===void 0?void 0:i.next)===null||r===void 0||r.call(i,e)},t.prototype.error=function(e){var i,r;(r=(i=this.destination)===null||i===void 0?void 0:i.error)===null||r===void 0||r.call(i,e)},t.prototype.complete=function(){var e,i;(i=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||i===void 0||i.call(e)},t.prototype._subscribe=function(e){var i,r;return(r=(i=this.source)===null||i===void 0?void 0:i.subscribe(e))!==null&&r!==void 0?r:te},t}(_t),re=function(s){F(t,s);function t(e){var i=s.call(this)||this;return i._value=e,i}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(e){var i=s.prototype._subscribe.call(this,e);return!i.closed&&e.next(this._value),i},t.prototype.getValue=function(){var e=this,i=e.hasError,r=e.thrownError,n=e._value;if(i)throw r;return this._throwIfClosed(),n},t.prototype.next=function(e){s.prototype.next.call(this,this._value=e)},t}(_t),ne=(s=>(s.Loading="loading",s.Ready="ready",s))(ne||{});class $t{constructor(t,e){this.state=new re("loading"),this.resolvers=new Map,this.name=t,this.environment=e,this.state.next("ready")}setState(t){this.state.next(t)}async register(t,e){this.resolvers.set(t,e)}async get(t){return this.resolvers.get(t)}}/**
|
4
4
|
* @license
|
5
5
|
* Copyright 2019 Google LLC
|
6
6
|
* SPDX-License-Identifier: BSD-3-Clause
|
7
|
-
*/const Z=globalThis,
|
7
|
+
*/const Z=globalThis,wt=Z.ShadowRoot&&(Z.ShadyCSS===void 0||Z.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,At=Symbol(),Ut=new WeakMap;let oe=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==At)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(wt&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=Ut.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Ut.set(e,t))}return t}toString(){return this.cssText}};const He=s=>new oe(typeof s=="string"?s:s+"",void 0,At),M=(s,...t)=>{const e=s.length===1?s[0]:t.reduce((i,r,n)=>i+(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.")})(r)+s[n+1],s[0]);return new oe(e,s,At)},Le=(s,t)=>{if(wt)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),r=Z.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}},kt=wt?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return He(e)})(s):s;/**
|
8
8
|
* @license
|
9
9
|
* Copyright 2017 Google LLC
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
11
|
-
*/const{is:
|
11
|
+
*/const{is:De,defineProperty:Be,getOwnPropertyDescriptor:ze,getOwnPropertyNames:We,getOwnPropertySymbols:Fe,getPrototypeOf:Ve}=Object,x=globalThis,Nt=x.trustedTypes,Ye=Nt?Nt.emptyScript:"",ct=x.reactiveElementPolyfillSupport,j=(s,t)=>s,Q={toAttribute(s,t){switch(t){case Boolean:s=s?Ye:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},xt=(s,t)=>!De(s,t),jt={attribute:!0,type:String,converter:Q,reflect:!1,hasChanged:xt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),x.litPropertyMetadata??(x.litPropertyMetadata=new WeakMap);let T=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=jt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,e);r!==void 0&&Be(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){const{get:r,set:n}=ze(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return r==null?void 0:r.call(this)},set(o){const a=r==null?void 0:r.call(this);n.call(this,o),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??jt}static _$Ei(){if(this.hasOwnProperty(j("elementProperties")))return;const t=Ve(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(j("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(j("properties"))){const e=this.properties,i=[...We(e),...Fe(e)];for(const r of i)this.createProperty(r,e[r])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,r]of e)this.elementProperties.set(i,r)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const r=this._$Eu(e,i);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const r of i)e.unshift(kt(r))}else t!==void 0&&e.push(kt(t));return e}static _$Eu(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Le(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostConnected)==null?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){var n;const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(r!==void 0&&i.reflect===!0){const o=(((n=i.converter)==null?void 0:n.toAttribute)!==void 0?i.converter:Q).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){var n;const i=this.constructor,r=i._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const o=i.getPropertyOptions(r),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)==null?void 0:n.fromAttribute)!==void 0?o.converter:Q;this._$Em=r,this[r]=a.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,i){if(t!==void 0){if(i??(i=this.constructor.getPropertyOptions(t)),!(i.hasChanged??xt)(this[t],e))return;this.P(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[n,o]of r)o.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(i=this._$EO)==null||i.forEach(r=>{var n;return(n=r.hostUpdate)==null?void 0:n.call(r)}),this.update(e)):this._$EU()}catch(r){throw t=!1,this._$EU(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(i=>{var r;return(r=i.hostUpdated)==null?void 0:r.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}};T.elementStyles=[],T.shadowRootOptions={mode:"open"},T[j("elementProperties")]=new Map,T[j("finalized")]=new Map,ct==null||ct({ReactiveElement:T}),(x.reactiveElementVersions??(x.reactiveElementVersions=[])).push("2.0.4");/**
|
12
12
|
* @license
|
13
13
|
* Copyright 2017 Google LLC
|
14
14
|
* SPDX-License-Identifier: BSD-3-Clause
|
15
|
-
*/const H=globalThis,tt=H.trustedTypes,Ht=tt?tt.createPolicy("lit-html",{createHTML:s=>s}):void 0,ae="$lit$",A=`lit$${(Math.random()+"").slice(9)}$`,ce="?"+A,qe=`<${ce}>`,P=document,
|
16
|
-
\f\r]`,N=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Lt=/-->/g,
|
17
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
15
|
+
*/const H=globalThis,tt=H.trustedTypes,Ht=tt?tt.createPolicy("lit-html",{createHTML:s=>s}):void 0,ae="$lit$",A=`lit$${(Math.random()+"").slice(9)}$`,ce="?"+A,qe=`<${ce}>`,P=document,D=()=>P.createComment(""),B=s=>s===null||typeof s!="object"&&typeof s!="function",he=Array.isArray,Ke=s=>he(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",ht=`[
|
16
|
+
\f\r]`,N=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Lt=/-->/g,Dt=/>/g,C=RegExp(`>|${ht}(?:([^\\s"'>=/]+)(${ht}*=${ht}*(?:[^
|
17
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Bt=/'/g,zt=/"/g,le=/^(?:script|style|textarea|title)$/i,Ge=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),I=Ge(1),O=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Wt=new WeakMap,E=P.createTreeWalker(P,129);function pe(s,t){if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ht!==void 0?Ht.createHTML(t):t}const Ze=(s,t)=>{const e=s.length-1,i=[];let r,n=t===2?"<svg>":"",o=N;for(let a=0;a<e;a++){const c=s[a];let h,l,p=-1,f=0;for(;f<c.length&&(o.lastIndex=f,l=o.exec(c),l!==null);)f=o.lastIndex,o===N?l[1]==="!--"?o=Lt:l[1]!==void 0?o=Dt:l[2]!==void 0?(le.test(l[2])&&(r=RegExp("</"+l[2],"g")),o=C):l[3]!==void 0&&(o=C):o===C?l[0]===">"?(o=r??N,p=-1):l[1]===void 0?p=-2:(p=o.lastIndex-l[2].length,h=l[1],o=l[3]===void 0?C:l[3]==='"'?zt:Bt):o===zt||o===Bt?o=C:o===Lt||o===Dt?o=N:(o=C,r=void 0);const u=o===C&&s[a+1].startsWith("/>")?" ":"";n+=o===N?c+qe:p>=0?(i.push(h),c.slice(0,p)+ae+c.slice(p)+A+u):c+A+(p===-2?a:u)}return[pe(s,n+(s[e]||"<?>")+(t===2?"</svg>":"")),i]};class z{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let n=0,o=0;const a=t.length-1,c=this.parts,[h,l]=Ze(t,e);if(this.el=z.createElement(h,i),E.currentNode=this.el.content,e===2){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(r=E.nextNode())!==null&&c.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const p of r.getAttributeNames())if(p.endsWith(ae)){const f=l[o++],u=r.getAttribute(p).split(A),g=/([.?@])?(.*)/.exec(f);c.push({type:1,index:n,name:g[2],strings:u,ctor:g[1]==="."?Xe:g[1]==="?"?Qe:g[1]==="@"?ti:st}),r.removeAttribute(p)}else p.startsWith(A)&&(c.push({type:6,index:n}),r.removeAttribute(p));if(le.test(r.tagName)){const p=r.textContent.split(A),f=p.length-1;if(f>0){r.textContent=tt?tt.emptyScript:"";for(let u=0;u<f;u++)r.append(p[u],D()),E.nextNode(),c.push({type:2,index:++n});r.append(p[f],D())}}}else if(r.nodeType===8)if(r.data===ce)c.push({type:2,index:n});else{let p=-1;for(;(p=r.data.indexOf(A,p+1))!==-1;)c.push({type:7,index:n}),p+=A.length-1}n++}}static createElement(t,e){const i=P.createElement("template");return i.innerHTML=t,i}}function R(s,t,e=s,i){var o,a;if(t===O)return t;let r=i!==void 0?(o=e._$Co)==null?void 0:o[i]:e._$Cl;const n=B(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==n&&((a=r==null?void 0:r._$AO)==null||a.call(r,!1),n===void 0?r=void 0:(r=new n(s),r._$AT(s,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=r:e._$Cl=r),r!==void 0&&(t=R(s,r._$AS(s,t.values),r,i)),t}class Je{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){const{el:{content:e},parts:i}=this._$AD,r=((t==null?void 0:t.creationScope)??P).importNode(e,!0);E.currentNode=r;let n=E.nextNode(),o=0,a=0,c=i[0];for(;c!==void 0;){if(o===c.index){let h;c.type===2?h=new V(n,n.nextSibling,this,t):c.type===1?h=new c.ctor(n,c.name,c.strings,this,t):c.type===6&&(h=new ei(n,this,t)),this._$AV.push(h),c=i[++a]}o!==(c==null?void 0:c.index)&&(n=E.nextNode(),o++)}return E.currentNode=P,r}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class V{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,i,r){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}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=R(this,t,e),B(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==O&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Ke(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==d&&B(this._$AH)?this._$AA.nextSibling.data=t:this.T(P.createTextNode(t)),this._$AH=t}$(t){var n;const{values:e,_$litType$:i}=t,r=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=z.createElement(pe(i.h,i.h[0]),this.options)),i);if(((n=this._$AH)==null?void 0:n._$AD)===r)this._$AH.p(e);else{const o=new Je(r,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=Wt.get(t.strings);return e===void 0&&Wt.set(t.strings,e=new z(t)),e}k(t){he(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,r=0;for(const n of t)r===e.length?e.push(i=new V(this.S(D()),this.S(D()),this,this.options)):i=e[r],i._$AI(n),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t&&t!==this._$AB;){const r=t.nextSibling;t.remove(),t=r}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class st{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,r,n){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=d}_$AI(t,e=this,i,r){const n=this.strings;let o=!1;if(n===void 0)t=R(this,t,e,0),o=!B(t)||t!==this._$AH&&t!==O,o&&(this._$AH=t);else{const a=t;let c,h;for(t=n[0],c=0;c<n.length-1;c++)h=R(this,a[i+c],e,c),h===O&&(h=this._$AH[c]),o||(o=!B(h)||h!==this._$AH[c]),h===d?t=d:t!==d&&(t+=(h??"")+n[c+1]),this._$AH[c]=h}o&&!r&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Xe extends st{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class Qe extends st{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class ti extends st{constructor(t,e,i,r,n){super(t,e,i,r,n),this.type=5}_$AI(t,e=this){if((t=R(this,t,e,0)??d)===O)return;const i=this._$AH,r=t===d&&i!==d||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==d&&(i===d||r);r&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class ei{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){R(this,t)}}const lt=H.litHtmlPolyfillSupport;lt==null||lt(z,V),(H.litHtmlVersions??(H.litHtmlVersions=[])).push("3.1.2");const ii=(s,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let r=i._$litPart$;if(r===void 0){const n=(e==null?void 0:e.renderBefore)??null;i._$litPart$=r=new V(t.insertBefore(D(),n),n,void 0,e??{})}return r._$AI(s),r};/**
|
18
18
|
* @license
|
19
19
|
* Copyright 2017 Google LLC
|
20
20
|
* SPDX-License-Identifier: BSD-3-Clause
|
21
|
-
*/let
|
21
|
+
*/let w=class extends T{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=ii(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return O}};var Xt;w._$litElement$=!0,w.finalized=!0,(Xt=globalThis.litElementHydrateSupport)==null||Xt.call(globalThis,{LitElement:w});const pt=globalThis.litElementPolyfillSupport;pt==null||pt({LitElement:w});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.4");/**
|
22
22
|
* @license
|
23
23
|
* Copyright 2017 Google LLC
|
24
24
|
* SPDX-License-Identifier: BSD-3-Clause
|
@@ -26,7 +26,7 @@
|
|
26
26
|
* @license
|
27
27
|
* Copyright 2017 Google LLC
|
28
28
|
* SPDX-License-Identifier: BSD-3-Clause
|
29
|
-
*/function U(s){return m({...s,state:!0,attribute:!1})}var ni=Object.defineProperty,oi=Object.getOwnPropertyDescriptor,ai=(s,t,e,i)=>{for(var r=i>1?void 0:i?oi(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&ni(t,e,r),r};class rt extends
|
29
|
+
*/function U(s){return m({...s,state:!0,attribute:!1})}var ni=Object.defineProperty,oi=Object.getOwnPropertyDescriptor,ai=(s,t,e,i)=>{for(var r=i>1?void 0:i?oi(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&ni(t,e,r),r};class rt extends w{constructor(){super(...arguments),this.anchor="BottomRight"}appendChild(t){var e;return(e=this.shadowRoot)==null||e.appendChild(t),t}render(){return this.anchor==="BottomLeft"?this.renderRoot.host.classList.add("bottom-left"):this.anchor==="BottomRight"&&this.renderRoot.host.classList.add("bottom-right"),d}}rt.styles=[M`
|
30
30
|
:host {
|
31
31
|
position: fixed;
|
32
32
|
display: flex;
|
@@ -62,7 +62,7 @@
|
|
62
62
|
* @license
|
63
63
|
* Copyright 2020 Google LLC
|
64
64
|
* SPDX-License-Identifier: BSD-3-Clause
|
65
|
-
*/const me=()=>new bi;class bi{}const ft=new WeakMap,ve=St(class extends fe{render(s){return d}update(s,[t]){var i;const e=t!==this.Y;return e&&this.Y!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.Y=t,this.ht=(i=s.options)==null?void 0:i.host,this.rt(this.ct=s.element)),d}rt(s){if(typeof this.Y=="function"){const t=this.ht??globalThis;let e=ft.get(t);e===void 0&&(e=new WeakMap,ft.set(t,e)),e.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),e.set(this.Y,s),s!==void 0&&this.Y.call(this.ht,s)}else this.Y.value=s}get lt(){var s,t;return typeof this.Y=="function"?(s=ft.get(this.ht??globalThis))==null?void 0:s.get(this.Y):(t=this.Y)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var $i=Object.defineProperty,
|
65
|
+
*/const me=()=>new bi;class bi{}const ft=new WeakMap,ve=St(class extends fe{render(s){return d}update(s,[t]){var i;const e=t!==this.Y;return e&&this.Y!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.Y=t,this.ht=(i=s.options)==null?void 0:i.host,this.rt(this.ct=s.element)),d}rt(s){if(typeof this.Y=="function"){const t=this.ht??globalThis;let e=ft.get(t);e===void 0&&(e=new WeakMap,ft.set(t,e)),e.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),e.set(this.Y,s),s!==void 0&&this.Y.call(this.ht,s)}else this.Y.value=s}get lt(){var s,t;return typeof this.Y=="function"?(s=ft.get(this.ht??globalThis))==null?void 0:s.get(this.Y):(t=this.Y)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var $i=Object.defineProperty,_i=Object.getOwnPropertyDescriptor,Y=(s,t,e,i)=>{for(var r=i>1?void 0:i?_i(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&$i(t,e,r),r};class b extends w{constructor(){super(...arguments),this.active=!1,this.triggerVisible=!0,this.loaded=!1,this.containerRef=me(),this.widgetActive$=new re(!1),this.componentIsDestroyed$=new _t}async connectedCallback(){super.connectedCallback(),this.icon=await this._renderSymbol(),this.loaded=!0,this._applyBranding()}disconnectedCallback(){super.disconnectedCallback(),this.componentIsDestroyed$.next(),this.componentIsDestroyed$.complete()}toggleActive(){var t;if(!((t=this.application)!=null&&t.root)){console.warn("Could not activate widget. No root element assigned to widget.");return}this.active=!this.active,this.active?(this.application.appendToDOM(),this.widgetActive$.next(!0)):(this.application.hide(),this.widgetActive$.next(!1))}_applyBranding(){var t;(t=this.application)!=null&&t.settings&&ge(this.application.settings.branding,this)}async _renderSymbol(){var a,c,h;const t=(a=this.application)==null?void 0:a.branding(),e=(c=t==null?void 0:t.graphics)==null?void 0:c.trigger;if(e)return I` <img src=${e} class="trigger-icon" alt="" /> `;const i=(h=this.application)==null?void 0:h.triggerIcon;if(!i)return d;const r=async l=>yi,{type:n,content:o}=i;switch(n){case"Telia":{const l=await r();return l?I`<telia-icon
|
66
66
|
class="trigger-icon"
|
67
67
|
svg=${l.svg}
|
68
68
|
size="lg"
|
@@ -224,7 +224,7 @@
|
|
224
224
|
.trigger-label:hover {
|
225
225
|
opacity: 0.8;
|
226
226
|
}
|
227
|
-
`];Y([m({attribute:!1})],b.prototype,"application",2);Y([U()],b.prototype,"active",2);Y([U()],b.prototype,"triggerVisible",2);Y([U()],b.prototype,"loaded",2);Y([U()],b.prototype,"icon",2);var
|
227
|
+
`];Y([m({attribute:!1})],b.prototype,"application",2);Y([U()],b.prototype,"active",2);Y([U()],b.prototype,"triggerVisible",2);Y([U()],b.prototype,"loaded",2);Y([U()],b.prototype,"icon",2);var wi=Object.defineProperty,Ai=Object.getOwnPropertyDescriptor,S=(s,t,e,i)=>{for(var r=i>1?void 0:i?Ai(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&wi(t,e,r),r};const ye=s=>{class t extends s{constructor(){super(...arguments),this.properties={},this.context={},this.layout={},this.nodes=[]}writeProperties(i){this.properties=i}writeLayout(i){this.layout=i}writeContext(i){this.context=i}addChild(i){i.parent=this,this.nodes.push(i)}connectedCallback(){super.connectedCallback(),this.renderRoot.host.style.setProperty("--width",this.layout.size==="full"?"var(--columns, 1)":`min(${this.layout.size||"var(--columns)"}, var(--columns))`),this.application.mountComponent(this)}}return t.styles=[M`
|
228
228
|
:host {
|
229
229
|
font-family: var(--font-family);
|
230
230
|
grid-column: span var(--width);
|
@@ -236,7 +236,7 @@
|
|
236
236
|
* {
|
237
237
|
box-sizing: border-box;
|
238
238
|
}
|
239
|
-
`],S([m()],t.prototype,"properties",2),S([m()],t.prototype,"context",2),S([m()],t.prototype,"layout",2),S([m()],t.prototype,"name",2),S([m()],t.prototype,"type",2),S([m({attribute:!1})],t.prototype,"application",2),S([m({attribute:!1})],t.prototype,"parent",2),t};class Et extends ye(
|
239
|
+
`],S([m()],t.prototype,"properties",2),S([m()],t.prototype,"context",2),S([m()],t.prototype,"layout",2),S([m()],t.prototype,"name",2),S([m()],t.prototype,"type",2),S([m({attribute:!1})],t.prototype,"application",2),S([m({attribute:!1})],t.prototype,"parent",2),t};class Et extends ye(w){render(){return I`Non resolved component`}}Et.styles=[M`
|
240
240
|
:host {
|
241
241
|
display: block;
|
242
242
|
}
|
@@ -264,7 +264,7 @@
|
|
264
264
|
* @license
|
265
265
|
* Copyright 2017 Google LLC
|
266
266
|
* SPDX-License-Identifier: BSD-3-Clause
|
267
|
-
*/function Pi({context:s}){return(t,e)=>{const i=new WeakMap;if(typeof e=="object")return e.addInitializer(function(){i.set(this,new Jt(this,{context:s}))}),{get(){return t.get.call(this)},set(r){var n;return(n=i.get(this))==null||n.setValue(r),t.set.call(this,r)},init(r){var n;return(n=i.get(this))==null||n.setValue(r),r}};{t.constructor.addInitializer(o=>{i.set(o,new Jt(o,{context:s}))});const r=Object.getOwnPropertyDescriptor(t,e);let n;if(r===void 0){const o=new WeakMap;n={get:function(){return o.get(this)},set:function(a){i.get(this).setValue(a),o.set(this,a)},configurable:!0,enumerable:!0}}else{const o=r.set;n={...r,set:function(a){i.get(this).setValue(a),o==null||o.call(this,a)}}}return void Object.defineProperty(t,e,n)}}}var Oi=Object.defineProperty,Ti=Object.getOwnPropertyDescriptor,Ii=(s,t,e,i)=>{for(var r=i>1?void 0:i?Ti(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&Oi(t,e,r),r};const be="application";class nt extends
|
267
|
+
*/function Pi({context:s}){return(t,e)=>{const i=new WeakMap;if(typeof e=="object")return e.addInitializer(function(){i.set(this,new Jt(this,{context:s}))}),{get(){return t.get.call(this)},set(r){var n;return(n=i.get(this))==null||n.setValue(r),t.set.call(this,r)},init(r){var n;return(n=i.get(this))==null||n.setValue(r),r}};{t.constructor.addInitializer(o=>{i.set(o,new Jt(o,{context:s}))});const r=Object.getOwnPropertyDescriptor(t,e);let n;if(r===void 0){const o=new WeakMap;n={get:function(){return o.get(this)},set:function(a){i.get(this).setValue(a),o.set(this,a)},configurable:!0,enumerable:!0}}else{const o=r.set;n={...r,set:function(a){i.get(this).setValue(a),o==null||o.call(this,a)}}}return void Object.defineProperty(t,e,n)}}}var Oi=Object.defineProperty,Ti=Object.getOwnPropertyDescriptor,Ii=(s,t,e,i)=>{for(var r=i>1?void 0:i?Ti(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&Oi(t,e,r),r};const be="application";class nt extends w{constructor(){super(...arguments),this.nodes=[],this.wrapperRef=me()}addChild(t){t.parent=this,this.nodes.push(t)}applyBranding(){if(!this.wrapperRef.value)return;const t=this.application.settings;t!=null&&t.branding&&ge(t.branding,this.wrapperRef.value)}applyStyles(){if(!this.wrapperRef.value)return;const t=this.application.styles(),e=this.wrapperRef.value;Object.entries(t).forEach(([i,r])=>{e.style.setProperty(`--${i}`,r)})}firstUpdated(t){this.applyBranding(),this.applyStyles()}render(){return this.application.renderStrategy===$.Trigger&&(this.renderRoot.host.classList.add("floating"),this.application.anchor==="BottomLeft"?this.renderRoot.host.classList.add("bottom-left"):this.application.anchor==="BottomRight"&&this.renderRoot.host.classList.add("bottom-right")),I`<div class="widget-container" ${ve(this.wrapperRef)}>
|
268
268
|
${xi(this.nodes,t=>t)}
|
269
269
|
</div>`}}nt.styles=M`
|
270
270
|
:host {
|
@@ -376,8 +376,8 @@
|
|
376
376
|
animation: slideDown 0.3s linear;
|
377
377
|
pointer-events: none;
|
378
378
|
}
|
379
|
-
`;Ii([m({attribute:!1}),Pi({context:be})],nt.prototype,"application",2);class Ri{constructor(){this.root=this.createRoot()}createComponentModel(t,e){this.root.application=e;const i=a=>{if(Array.isArray(a)){const[c,...h]=a;return{definitionId:c,overrides:h}}return{definitionId:a,overrides:[]}},r=(a,c,h,l)=>{h.forEach(p=>{const f=i(p),u=l[f.definitionId];if(!u){console.error(`No definition found for component type '${f.definitionId}'.`);return}const g=a.createNode(u.type,u.type);g&&(g.name=f.definitionId,g.application=e,u.properties&&g.writeProperties(u.properties),u.context&&g.writeContext(u.context),u.layout&&g.writeLayout(u.layout),c.addChild(g),u.children&&r(a,g,u.children,l))})},{entry:n,components:o}=t;return r(this,this.root,[n],o),this.root}createRoot(){return new nt}createNode(t,e){const i=this.resolveComponent(e);if(!i)return console.warn(`Unable to resolve component: ${e}`),new Et;const r=new i;return r.type=e,r.name=t,r}resolveComponent(t){return customElements.get(`ace-${t}`)}getRoot(){return this.root}}const $e=class{constructor(){this.components=new Map}getComponent(s){const t=this.components.get(s);return t||console.warn(`Unable to resolve component: ${s}. You most likely forgot to register the required plugin.`),t}registerComponent(s,t){this.components.set(s,t)}async loadComponents(){const s=[...this.components.entries()].map(([t,e])=>e.then(i=>{this.defineAsWebComponent(t,i.default)}));await Promise.all(s)}defineAsWebComponent(s,t){const e=$e.ResolveWebComponentName(s);customElements.get(e)||customElements.define(e,t)}};let
|
379
|
+
`;Ii([m({attribute:!1}),Pi({context:be})],nt.prototype,"application",2);class Ri{constructor(){this.root=this.createRoot()}createComponentModel(t,e){this.root.application=e;const i=a=>{if(Array.isArray(a)){const[c,...h]=a;return{definitionId:c,overrides:h}}return{definitionId:a,overrides:[]}},r=(a,c,h,l)=>{h.forEach(p=>{const f=i(p),u=l[f.definitionId];if(!u){console.error(`No definition found for component type '${f.definitionId}'.`);return}const g=a.createNode(u.type,u.type);g&&(g.name=f.definitionId,g.application=e,u.properties&&g.writeProperties(u.properties),u.context&&g.writeContext(u.context),u.layout&&g.writeLayout(u.layout),c.addChild(g),u.children&&r(a,g,u.children,l))})},{entry:n,components:o}=t;return r(this,this.root,[n],o),this.root}createRoot(){return new nt}createNode(t,e){const i=this.resolveComponent(e);if(!i)return console.warn(`Unable to resolve component: ${e}`),new Et;const r=new i;return r.type=e,r.name=t,r}resolveComponent(t){return customElements.get(`ace-${t}`)}getRoot(){return this.root}}const $e=class{constructor(){this.components=new Map}getComponent(s){const t=this.components.get(s);return t||console.warn(`Unable to resolve component: ${s}. You most likely forgot to register the required plugin.`),t}registerComponent(s,t){this.components.set(s,t)}async loadComponents(){const s=[...this.components.entries()].map(([t,e])=>e.then(i=>{this.defineAsWebComponent(t,i.default)}));await Promise.all(s)}defineAsWebComponent(s,t){const e=$e.ResolveWebComponentName(s);customElements.get(e)||customElements.define(e,t)}};let _e=$e;_e.ResolveWebComponentName=s=>`ace-${s}`;var v=(s=>(s.Mandatory="mandatory",s.Preferences="preferences",s.Analytics="analytics",s))(v||{});class we{constructor(t,e,i){this.widgetId=t,this.storage=e==="localStorage"?window.localStorage:window.sessionStorage,this.policy=i}set(t,e,i){if(this.policy[i]){const r={value:e,category:i};this.storage.setItem(this._prefixKey(t),JSON.stringify(r))}else console.warn(`Storage policy does not allow storing items in category: ${i}`)}get(t){const e=this.storage.getItem(this._prefixKey(t));if(!e)return null;try{const i=JSON.parse(e);return this.policy[i.category]?i.value:(console.warn(`Storage policy does not allow retrieving items from category: ${i.category}`),null)}catch{return null}}removeItem(t){this.storage.removeItem(this._prefixKey(t))}updatePolicy(t){this.policy=t}_prefixKey(t){return`ace_${this.widgetId.substring(0,7)}-${t}`}}class Mi{constructor(){this.texts=new Map}loadTexts(t){this.texts=new Map(Object.entries(t))}get(t,e){const i=this.texts.get(t);return i||e||null}getOrFallback(t,e){return this.texts.get(t)||e}}class Ui{constructor(t){this.widget=t,this.name=t.name}open(){this.widget.appendToDOM()}close(){this.widget.hide()}}class Ae{constructor(t,e,i,r,n){this.id=t,this.name=e,this.container=i,this.settings=r,this.options=n,this.platform=new Ri,this.texts=new Mi,this.renderStrategy=$.Inline,this.anchor="BottomRight",this.autoActivate=!1,this.plugins=[],this.componentResolver=new _e,this.components=[],this.trigger=null,this.api=new Ui(this),this.renderStrategy=this.options.renderStrategy||$.Inline,this.triggerIcon=this.options.triggerIcon;const o={[v.Mandatory]:!0,[v.Preferences]:!0,[v.Analytics]:!0};this.storage=new we(this.id,"sessionStorage",o),typeof n.autoActivate=="boolean"&&(this.autoActivate=n.autoActivate),n.anchor&&(this.anchor=n.anchor),this.container.register("$settings",r),this.texts.loadTexts(r.texts||{})}async activate(){if(await this.loadPlugins(),await this.componentResolver.loadComponents(),this.root=this.platform.createComponentModel(this.settings,this),this.container.setState(ne.Ready),this.autoActivate){const t=this.render();t&&this._getTargetElement().appendChild(t)}}async loadPlugins(){for await(const t of this.plugins)await t(this)}styles(){return this.settings.styles||{}}branding(){return this.settings.branding||{}}plugin(t){return this.plugins.push(t),this}appendToDOM(){this.root&&(this.root.classList.add("expanded"),this.root.classList.remove("hidden"),document.body.appendChild(this.root)),this.storage.set("open","true",v.Mandatory)}hide(){this.root&&(this.root.classList.add("hidden"),this.root.classList.remove("expanded")),this.storage.set("open","false",v.Mandatory)}mute(){this.storage.set("muteAudioNotifications","true",v.Mandatory)}unmute(){this.storage.set("muteAudioNotifications","false",v.Mandatory)}registerComponent(t,e){this.componentResolver.registerComponent(t,e)}resolveComponent(t){return this.componentResolver.getComponent(t)}mountComponent(t){this.components.push(t)}getComponent(t){const e=this.components.find(i=>i.type===t);return e||null}_getTargetElement(){let t="bottom-right";if(this.anchor==="BottomRight"?t="bottom-right":this.anchor==="BottomLeft"&&(t="bottom-left"),this.renderStrategy===$.Trigger){let e=document.querySelector(`ace-trigger-slot.${t}`);return e||(e=new rt,e.anchor=this.anchor,document.body.appendChild(e)),e}return document.body}render(){if(this.renderStrategy===$.Trigger){const t=new b;return t.application=this,this.trigger=t,this.storage.get("open")&&this.trigger.toggleActive(),t}return this.root}}const ki=s=>new W(s),xe=class{constructor(s=xe.endpoint){this._endpoint=s}async getSite(s){const e=await(await fetch(s)).json();return e?{id:e.id,apps:e.widgets.map(i=>{let r=$.Inline;return i.renderStrategy==="Trigger"&&(r=$.Trigger),{id:i.id,widgetId:i.widgetId,renderStrategy:r,autoActivate:i.autoActivate,anchor:i.anchor,triggerIcon:{type:"Telia",content:i.triggerIcon}}})}:null}async getWidget(s){const e=await(await fetch(`${this._endpoint}/widget/${s}`)).json();return e?{name:e.name,config:JSON.parse(e.configuration)}:null}};let W=xe;W.endpoint="https://widgets.ace.teliacompany.net/api";class Ni{constructor(t){this.site=t}storagePolicy(t){var i;(((i=this.site.environment)==null?void 0:i.applications)||[]).forEach(r=>{if(r.storage){const n={[v.Analytics]:t.includes("analytics"),[v.Mandatory]:t.includes("mandatory"),[v.Preferences]:t.includes("preferences")};r.storage.updatePolicy(n)}})}}class Ce{constructor(){this.applications=[],this.container=new $t("environment",this),this.bootstrapped=!1,this.site=null,this.widgetAPIHandlers=new Map,this.siteConfigurationHandlers=[],setTimeout(()=>{this.notifyWidgetsOfCreation()},1e3)}async bootstrap(){await this.activate(),this.siteConfigurationHandlers.forEach(t=>{this.site&&t(this.site.api)});for(const[t,e]of this.widgetAPIHandlers)e.forEach(i=>{i()});this.bootstrapped=!0}async activate(){const t=this.applications.filter(e=>e.autoActivate);for await(const e of t)await e.activate()}notifyWidgetsOfCreation(){document.querySelectorAll("ace-widget").forEach(e=>{const i=this.applications.find(r=>r.name===e.name);i&&e.dispatchEvent(new CustomEvent("environment-created",{detail:{widget:i}}))})}configure(t){if(!this.site||!this.bootstrapped){this.siteConfigurationHandlers.push(t);return}t(this.site.api)}widget(t,e){const i=this.applications.find(r=>r.name===t);if(!i){const r=this.widgetAPIHandlers.get(t)||[];r.push(()=>{const n=this.applications.find(o=>o.name===t);e(n==null?void 0:n.api)}),this.widgetAPIHandlers.set(t,r);return}e(i==null?void 0:i.api)}registerApp(t,e,i,r){const n=new $t(e,this),o=new Ae(t,e,n,i,r);this.applications.push(o)}registerSite(t){this.site=t}plugin(t){return this.applications.forEach(e=>{e.plugin(t)}),this}}class Se{constructor(t){this.configurations=[],this.httpClient=new W,this.api=new Ni(this),this.httpClient=new W,typeof t=="string"?this.url=t:(t.httpClient&&(this.httpClient=t.httpClient),this.loadFromConfig(t))}async load(t){const e=await this.httpClient.getSite(t);if(!e){console.warn(`Unable to load site from the url provided: ${t}`);return}this.configurations=e.apps}loadFromConfig(t){this.configurations=t.apps.map(e=>({id:"",renderStrategy:e.renderStrategy,widgetId:e.widgetId,autoActivate:e.autoActivate,anchor:e.anchor,triggerIcon:{type:"Telia",content:e.triggerIcon||"question"}}))}async bootstrap(t){var e;this.url&&await this.load(this.url),this.environment=new Ce,this.addGlobal(this.environment);for await(const i of this.configurations){const r=await this.httpClient.getWidget(i.widgetId);r&&((e=this.environment)==null||e.registerApp(i.widgetId,r.name,r.config,{renderStrategy:i.renderStrategy,triggerIcon:i.triggerIcon,autoActivate:i.autoActivate,anchor:i.anchor}))}t(this.environment),this.environment.registerSite(this),await this.environment.bootstrap()}addGlobal(t){const e=globalThis.ace;((e==null?void 0:e._w)||[]).forEach(([i,r])=>{t.widget(i,r)}),((e==null?void 0:e._c)||[]).forEach(i=>{t.configure(i)}),globalThis.ace=t}}var ji=Object.defineProperty,Hi=Object.getOwnPropertyDescriptor,Pt=(s,t,e,i)=>{for(var r=i>1?void 0:i?Hi(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&ji(t,e,r),r};class k extends w{constructor(){super(),this.status="deactivated",this.addEventListener("environment-created",this.onEnvironmentCreated)}async connectedCallback(){super.connectedCallback(),await this.getGlobalEnvironment()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("environment-created",this.onEnvironmentCreated)}async onEnvironmentCreated(t){this.widget=t.detail.widget,await this.activate(),this.requestUpdate()}async activate(){this.widget&&(await this.widget.activate(),this.status="activated")}async getGlobalEnvironment(){const t=globalThis.ace;t&&(this.widget=t.applications.find(e=>e.name===this.name),await this.activate())}render(){if(!this.widget||this.status!=="activated")return d;if(this.widget.renderStrategy===$.Trigger){const t=new b;return t.application=this.widget,t}return this.widget.render()}}k.styles=[M`
|
380
380
|
:host {
|
381
381
|
display: block;
|
382
382
|
}
|
383
|
-
`];Pt([m({attribute:!0})],k.prototype,"name",2);Pt([U()],k.prototype,"widget",2);Pt([U()],k.prototype,"status",2);customElements.get("ace-trigger-slot")||customElements.define("ace-trigger-slot",rt);customElements.get("ace-trigger")||customElements.define("ace-trigger",b);customElements.get("ace-unresolved-component")||customElements.define("ace-unresolved-component",Et);customElements.get("ace-wrapper")||customElements.define("ace-wrapper",nt);customElements.get("ace-widget")||customElements.define("ace-widget",k);const Li=async(s,t)=>{await new Se(s).bootstrap(t)};exports.AceWidget=k;exports.Application=Ae;exports.Container=$t;exports.Environment=Ce;exports.HttpClient=W;exports.Site=Se;exports.StorageCategory=v;exports.StorageService=
|
383
|
+
`];Pt([m({attribute:!0})],k.prototype,"name",2);Pt([U()],k.prototype,"widget",2);Pt([U()],k.prototype,"status",2);customElements.get("ace-trigger-slot")||customElements.define("ace-trigger-slot",rt);customElements.get("ace-trigger")||customElements.define("ace-trigger",b);customElements.get("ace-unresolved-component")||customElements.define("ace-unresolved-component",Et);customElements.get("ace-wrapper")||customElements.define("ace-wrapper",nt);customElements.get("ace-widget")||customElements.define("ace-widget",k);const Li=async(s,t)=>{await new Se(s).bootstrap(t)};exports.AceWidget=k;exports.Application=Ae;exports.Container=$t;exports.Environment=Ce;exports.HttpClient=W;exports.Site=Se;exports.StorageCategory=v;exports.StorageService=we;exports.Trigger=b;exports.WidgetComponent=ye;exports.applicationContext=be;exports.bootstrap=Li;exports.createHttpClient=ki;
|
package/index.mjs
CHANGED
@@ -193,7 +193,7 @@ var ie = {
|
|
193
193
|
},
|
194
194
|
delegate: void 0
|
195
195
|
};
|
196
|
-
function
|
196
|
+
function _e(s) {
|
197
197
|
yt.setTimeout(function() {
|
198
198
|
throw s;
|
199
199
|
});
|
@@ -234,9 +234,9 @@ var se = function(s) {
|
|
234
234
|
this.unsubscribe();
|
235
235
|
}
|
236
236
|
}, t;
|
237
|
-
}(it),
|
237
|
+
}(it), we = Function.prototype.bind;
|
238
238
|
function at(s, t) {
|
239
|
-
return
|
239
|
+
return we.call(s, t);
|
240
240
|
}
|
241
241
|
var Ae = function() {
|
242
242
|
function s(t) {
|
@@ -294,7 +294,7 @@ var Ae = function() {
|
|
294
294
|
return t;
|
295
295
|
}(se);
|
296
296
|
function Y(s) {
|
297
|
-
|
297
|
+
_e(s);
|
298
298
|
}
|
299
299
|
function xe(s) {
|
300
300
|
throw s;
|
@@ -539,17 +539,17 @@ class Ut {
|
|
539
539
|
* Copyright 2019 Google LLC
|
540
540
|
* SPDX-License-Identifier: BSD-3-Clause
|
541
541
|
*/
|
542
|
-
const G = globalThis,
|
542
|
+
const G = globalThis, _t = G.ShadowRoot && (G.ShadyCSS === void 0 || G.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, wt = Symbol(), Mt = /* @__PURE__ */ new WeakMap();
|
543
543
|
let oe = class {
|
544
544
|
constructor(t, e, i) {
|
545
|
-
if (this._$cssResult$ = !0, i !==
|
545
|
+
if (this._$cssResult$ = !0, i !== wt)
|
546
546
|
throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
547
547
|
this.cssText = t, this.t = e;
|
548
548
|
}
|
549
549
|
get styleSheet() {
|
550
550
|
let t = this.o;
|
551
551
|
const e = this.t;
|
552
|
-
if (
|
552
|
+
if (_t && t === void 0) {
|
553
553
|
const i = e !== void 0 && e.length === 1;
|
554
554
|
i && (t = Mt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && Mt.set(e, t));
|
555
555
|
}
|
@@ -559,7 +559,7 @@ let oe = class {
|
|
559
559
|
return this.cssText;
|
560
560
|
}
|
561
561
|
};
|
562
|
-
const Re = (s) => new oe(typeof s == "string" ? s : s + "", void 0,
|
562
|
+
const Re = (s) => new oe(typeof s == "string" ? s : s + "", void 0, wt), U = (s, ...t) => {
|
563
563
|
const e = s.length === 1 ? s[0] : t.reduce((i, r, n) => i + ((o) => {
|
564
564
|
if (o._$cssResult$ === !0)
|
565
565
|
return o.cssText;
|
@@ -567,16 +567,16 @@ const Re = (s) => new oe(typeof s == "string" ? s : s + "", void 0, _t), U = (s,
|
|
567
567
|
return o;
|
568
568
|
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.");
|
569
569
|
})(r) + s[n + 1], s[0]);
|
570
|
-
return new oe(e, s,
|
570
|
+
return new oe(e, s, wt);
|
571
571
|
}, Ue = (s, t) => {
|
572
|
-
if (
|
572
|
+
if (_t)
|
573
573
|
s.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
|
574
574
|
else
|
575
575
|
for (const e of t) {
|
576
576
|
const i = document.createElement("style"), r = G.litNonce;
|
577
577
|
r !== void 0 && i.setAttribute("nonce", r), i.textContent = e.cssText, s.appendChild(i);
|
578
578
|
}
|
579
|
-
}, kt =
|
579
|
+
}, kt = _t ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => {
|
580
580
|
let e = "";
|
581
581
|
for (const i of t.cssRules)
|
582
582
|
e += i.cssText;
|
@@ -587,10 +587,10 @@ const Re = (s) => new oe(typeof s == "string" ? s : s + "", void 0, _t), U = (s,
|
|
587
587
|
* Copyright 2017 Google LLC
|
588
588
|
* SPDX-License-Identifier: BSD-3-Clause
|
589
589
|
*/
|
590
|
-
const { is: Me, defineProperty: ke, getOwnPropertyDescriptor: Ne, getOwnPropertyNames: je, getOwnPropertySymbols: He, getPrototypeOf: Le } = Object, x = globalThis, Nt = x.trustedTypes,
|
590
|
+
const { is: Me, defineProperty: ke, getOwnPropertyDescriptor: Ne, getOwnPropertyNames: je, getOwnPropertySymbols: He, getPrototypeOf: Le } = Object, x = globalThis, Nt = x.trustedTypes, De = Nt ? Nt.emptyScript : "", ct = x.reactiveElementPolyfillSupport, N = (s, t) => s, X = { toAttribute(s, t) {
|
591
591
|
switch (t) {
|
592
592
|
case Boolean:
|
593
|
-
s = s ?
|
593
|
+
s = s ? De : null;
|
594
594
|
break;
|
595
595
|
case Object:
|
596
596
|
case Array:
|
@@ -834,9 +834,9 @@ T.elementStyles = [], T.shadowRootOptions = { mode: "open" }, T[N("elementProper
|
|
834
834
|
* Copyright 2017 Google LLC
|
835
835
|
* SPDX-License-Identifier: BSD-3-Clause
|
836
836
|
*/
|
837
|
-
const j = globalThis, Q = j.trustedTypes, Ht = Q ? Q.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, ae = "$lit$", A = `lit$${(Math.random() + "").slice(9)}$`, ce = "?" + A,
|
838
|
-
\f\r]`, k = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Lt = /-->/g,
|
839
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
837
|
+
const j = globalThis, Q = j.trustedTypes, Ht = Q ? Q.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, ae = "$lit$", A = `lit$${(Math.random() + "").slice(9)}$`, ce = "?" + A, Be = `<${ce}>`, P = document, L = () => P.createComment(""), D = (s) => s === null || typeof s != "object" && typeof s != "function", he = Array.isArray, ze = (s) => he(s) || typeof (s == null ? void 0 : s[Symbol.iterator]) == "function", ht = `[
|
838
|
+
\f\r]`, k = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Lt = /-->/g, Dt = />/g, C = RegExp(`>|${ht}(?:([^\\s"'>=/]+)(${ht}*=${ht}*(?:[^
|
839
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Bt = /'/g, zt = /"/g, le = /^(?:script|style|textarea|title)$/i, We = (s) => (t, ...e) => ({ _$litType$: s, strings: t, values: e }), I = We(1), O = Symbol.for("lit-noChange"), d = Symbol.for("lit-nothing"), Wt = /* @__PURE__ */ new WeakMap(), E = P.createTreeWalker(P, 129);
|
840
840
|
function pe(s, t) {
|
841
841
|
if (!Array.isArray(s) || !s.hasOwnProperty("raw"))
|
842
842
|
throw Error("invalid template strings array");
|
@@ -849,19 +849,19 @@ const Fe = (s, t) => {
|
|
849
849
|
const c = s[a];
|
850
850
|
let h, l, p = -1, f = 0;
|
851
851
|
for (; f < c.length && (o.lastIndex = f, l = o.exec(c), l !== null); )
|
852
|
-
f = o.lastIndex, o === k ? l[1] === "!--" ? o = Lt : l[1] !== void 0 ? o =
|
852
|
+
f = o.lastIndex, o === k ? l[1] === "!--" ? o = Lt : l[1] !== void 0 ? o = Dt : l[2] !== void 0 ? (le.test(l[2]) && (r = RegExp("</" + l[2], "g")), o = C) : l[3] !== void 0 && (o = C) : o === C ? l[0] === ">" ? (o = r ?? k, p = -1) : l[1] === void 0 ? p = -2 : (p = o.lastIndex - l[2].length, h = l[1], o = l[3] === void 0 ? C : l[3] === '"' ? zt : Bt) : o === zt || o === Bt ? o = C : o === Lt || o === Dt ? o = k : (o = C, r = void 0);
|
853
853
|
const u = o === C && s[a + 1].startsWith("/>") ? " " : "";
|
854
|
-
n += o === k ? c +
|
854
|
+
n += o === k ? c + Be : p >= 0 ? (i.push(h), c.slice(0, p) + ae + c.slice(p) + A + u) : c + A + (p === -2 ? a : u);
|
855
855
|
}
|
856
856
|
return [pe(s, n + (s[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
|
857
857
|
};
|
858
|
-
class
|
858
|
+
class B {
|
859
859
|
constructor({ strings: t, _$litType$: e }, i) {
|
860
860
|
let r;
|
861
861
|
this.parts = [];
|
862
862
|
let n = 0, o = 0;
|
863
863
|
const a = t.length - 1, c = this.parts, [h, l] = Fe(t, e);
|
864
|
-
if (this.el =
|
864
|
+
if (this.el = B.createElement(h, i), E.currentNode = this.el.content, e === 2) {
|
865
865
|
const p = this.el.content.firstChild;
|
866
866
|
p.replaceWith(...p.childNodes);
|
867
867
|
}
|
@@ -904,7 +904,7 @@ function R(s, t, e = s, i) {
|
|
904
904
|
if (t === O)
|
905
905
|
return t;
|
906
906
|
let r = i !== void 0 ? (o = e._$Co) == null ? void 0 : o[i] : e._$Cl;
|
907
|
-
const n =
|
907
|
+
const n = D(t) ? void 0 : t._$litDirective$;
|
908
908
|
return (r == null ? void 0 : r.constructor) !== n && ((a = r == null ? void 0 : r._$AO) == null || a.call(r, !1), n === void 0 ? r = void 0 : (r = new n(s), r._$AT(s, e, i)), i !== void 0 ? (e._$Co ?? (e._$Co = []))[i] = r : e._$Cl = r), r !== void 0 && (t = R(s, r._$AS(s, t.values), r, i)), t;
|
909
909
|
}
|
910
910
|
class Ve {
|
@@ -956,7 +956,7 @@ class W {
|
|
956
956
|
return this._$AB;
|
957
957
|
}
|
958
958
|
_$AI(t, e = this) {
|
959
|
-
t = R(this, t, e),
|
959
|
+
t = R(this, t, e), D(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== O && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : ze(t) ? this.k(t) : this._(t);
|
960
960
|
}
|
961
961
|
S(t) {
|
962
962
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
@@ -965,11 +965,11 @@ class W {
|
|
965
965
|
this._$AH !== t && (this._$AR(), this._$AH = this.S(t));
|
966
966
|
}
|
967
967
|
_(t) {
|
968
|
-
this._$AH !== d &&
|
968
|
+
this._$AH !== d && D(this._$AH) ? this._$AA.nextSibling.data = t : this.T(P.createTextNode(t)), this._$AH = t;
|
969
969
|
}
|
970
970
|
$(t) {
|
971
971
|
var n;
|
972
|
-
const { values: e, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el =
|
972
|
+
const { values: e, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = B.createElement(pe(i.h, i.h[0]), this.options)), i);
|
973
973
|
if (((n = this._$AH) == null ? void 0 : n._$AD) === r)
|
974
974
|
this._$AH.p(e);
|
975
975
|
else {
|
@@ -979,7 +979,7 @@ class W {
|
|
979
979
|
}
|
980
980
|
_$AC(t) {
|
981
981
|
let e = Wt.get(t.strings);
|
982
|
-
return e === void 0 && Wt.set(t.strings, e = new
|
982
|
+
return e === void 0 && Wt.set(t.strings, e = new B(t)), e;
|
983
983
|
}
|
984
984
|
k(t) {
|
985
985
|
he(this._$AH) || (this._$AH = [], this._$AR());
|
@@ -1015,12 +1015,12 @@ class st {
|
|
1015
1015
|
const n = this.strings;
|
1016
1016
|
let o = !1;
|
1017
1017
|
if (n === void 0)
|
1018
|
-
t = R(this, t, e, 0), o = !
|
1018
|
+
t = R(this, t, e, 0), o = !D(t) || t !== this._$AH && t !== O, o && (this._$AH = t);
|
1019
1019
|
else {
|
1020
1020
|
const a = t;
|
1021
1021
|
let c, h;
|
1022
1022
|
for (t = n[0], c = 0; c < n.length - 1; c++)
|
1023
|
-
h = R(this, a[i + c], e, c), h === O && (h = this._$AH[c]), o || (o = !
|
1023
|
+
h = R(this, a[i + c], e, c), h === O && (h = this._$AH[c]), o || (o = !D(h) || h !== this._$AH[c]), h === d ? t = d : t !== d && (t += (h ?? "") + n[c + 1]), this._$AH[c] = h;
|
1024
1024
|
}
|
1025
1025
|
o && !r && this.j(t);
|
1026
1026
|
}
|
@@ -1071,7 +1071,7 @@ class Ge {
|
|
1071
1071
|
}
|
1072
1072
|
}
|
1073
1073
|
const lt = j.litHtmlPolyfillSupport;
|
1074
|
-
lt == null || lt(
|
1074
|
+
lt == null || lt(B, W), (j.litHtmlVersions ?? (j.litHtmlVersions = [])).push("3.1.2");
|
1075
1075
|
const Ze = (s, t, e) => {
|
1076
1076
|
const i = (e == null ? void 0 : e.renderBefore) ?? t;
|
1077
1077
|
let r = i._$litPart$;
|
@@ -1086,7 +1086,7 @@ const Ze = (s, t, e) => {
|
|
1086
1086
|
* Copyright 2017 Google LLC
|
1087
1087
|
* SPDX-License-Identifier: BSD-3-Clause
|
1088
1088
|
*/
|
1089
|
-
let
|
1089
|
+
let _ = class extends T {
|
1090
1090
|
constructor() {
|
1091
1091
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
1092
1092
|
}
|
@@ -1112,9 +1112,9 @@ let w = class extends T {
|
|
1112
1112
|
}
|
1113
1113
|
};
|
1114
1114
|
var Xt;
|
1115
|
-
|
1115
|
+
_._$litElement$ = !0, _.finalized = !0, (Xt = globalThis.litElementHydrateSupport) == null || Xt.call(globalThis, { LitElement: _ });
|
1116
1116
|
const pt = globalThis.litElementPolyfillSupport;
|
1117
|
-
pt == null || pt({ LitElement:
|
1117
|
+
pt == null || pt({ LitElement: _ });
|
1118
1118
|
(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.4");
|
1119
1119
|
/**
|
1120
1120
|
* @license
|
@@ -1161,7 +1161,7 @@ var Qe = Object.defineProperty, ti = Object.getOwnPropertyDescriptor, ei = (s, t
|
|
1161
1161
|
(o = s[n]) && (r = (i ? o(t, e, r) : o(r)) || r);
|
1162
1162
|
return i && r && Qe(t, e, r), r;
|
1163
1163
|
};
|
1164
|
-
class rt extends
|
1164
|
+
class rt extends _ {
|
1165
1165
|
constructor() {
|
1166
1166
|
super(...arguments), this.anchor = "BottomRight";
|
1167
1167
|
}
|
@@ -1590,7 +1590,7 @@ var fi = Object.defineProperty, gi = Object.getOwnPropertyDescriptor, F = (s, t,
|
|
1590
1590
|
(o = s[n]) && (r = (i ? o(t, e, r) : o(r)) || r);
|
1591
1591
|
return i && r && fi(t, e, r), r;
|
1592
1592
|
};
|
1593
|
-
class
|
1593
|
+
class w extends _ {
|
1594
1594
|
constructor() {
|
1595
1595
|
super(...arguments), this.active = !1, this.triggerVisible = !0, this.loaded = !1, this.containerRef = me(), this.widgetActive$ = new re(!1), this.componentIsDestroyed$ = new $t();
|
1596
1596
|
}
|
@@ -1708,7 +1708,7 @@ class _ extends w {
|
|
1708
1708
|
</div>`;
|
1709
1709
|
}
|
1710
1710
|
}
|
1711
|
-
|
1711
|
+
w.styles = [
|
1712
1712
|
U`
|
1713
1713
|
:host {
|
1714
1714
|
--voca-rem-multiplier: 0.625;
|
@@ -1822,19 +1822,19 @@ _.styles = [
|
|
1822
1822
|
];
|
1823
1823
|
F([
|
1824
1824
|
m({ attribute: !1 })
|
1825
|
-
],
|
1825
|
+
], w.prototype, "application", 2);
|
1826
1826
|
F([
|
1827
1827
|
M()
|
1828
|
-
],
|
1828
|
+
], w.prototype, "active", 2);
|
1829
1829
|
F([
|
1830
1830
|
M()
|
1831
|
-
],
|
1831
|
+
], w.prototype, "triggerVisible", 2);
|
1832
1832
|
F([
|
1833
1833
|
M()
|
1834
|
-
],
|
1834
|
+
], w.prototype, "loaded", 2);
|
1835
1835
|
F([
|
1836
1836
|
M()
|
1837
|
-
],
|
1837
|
+
], w.prototype, "icon", 2);
|
1838
1838
|
var mi = Object.defineProperty, vi = Object.getOwnPropertyDescriptor, S = (s, t, e, i) => {
|
1839
1839
|
for (var r = i > 1 ? void 0 : i ? vi(t, e) : t, n = s.length - 1, o; n >= 0; n--)
|
1840
1840
|
(o = s[n]) && (r = (i ? o(t, e, r) : o(r)) || r);
|
@@ -1895,7 +1895,7 @@ const yi = (s) => {
|
|
1895
1895
|
m({ attribute: !1 })
|
1896
1896
|
], t.prototype, "parent", 2), t;
|
1897
1897
|
};
|
1898
|
-
class St extends yi(
|
1898
|
+
class St extends yi(_) {
|
1899
1899
|
render() {
|
1900
1900
|
return I`Non resolved component`;
|
1901
1901
|
}
|
@@ -1940,7 +1940,7 @@ let $i = class extends Event {
|
|
1940
1940
|
* Copyright 2021 Google LLC
|
1941
1941
|
* SPDX-License-Identifier: BSD-3-Clause
|
1942
1942
|
*/
|
1943
|
-
class
|
1943
|
+
class _i {
|
1944
1944
|
get value() {
|
1945
1945
|
return this.o;
|
1946
1946
|
}
|
@@ -1975,12 +1975,12 @@ class wi {
|
|
1975
1975
|
* Copyright 2021 Google LLC
|
1976
1976
|
* SPDX-License-Identifier: BSD-3-Clause
|
1977
1977
|
*/
|
1978
|
-
let
|
1978
|
+
let wi = class extends Event {
|
1979
1979
|
constructor(t) {
|
1980
1980
|
super("context-provider", { bubbles: !0, composed: !0 }), this.context = t;
|
1981
1981
|
}
|
1982
1982
|
};
|
1983
|
-
class Jt extends
|
1983
|
+
class Jt extends _i {
|
1984
1984
|
constructor(t, e, i) {
|
1985
1985
|
var r, n;
|
1986
1986
|
super(e.context !== void 0 ? e.initialValue : i), this.onContextRequest = (o) => {
|
@@ -2000,7 +2000,7 @@ class Jt extends wi {
|
|
2000
2000
|
this.host.addEventListener("context-request", this.onContextRequest), this.host.addEventListener("context-provider", this.onProviderRequest);
|
2001
2001
|
}
|
2002
2002
|
hostConnected() {
|
2003
|
-
this.host.dispatchEvent(new
|
2003
|
+
this.host.dispatchEvent(new wi(this.context));
|
2004
2004
|
}
|
2005
2005
|
}
|
2006
2006
|
/**
|
@@ -2052,7 +2052,7 @@ var xi = Object.defineProperty, Ci = Object.getOwnPropertyDescriptor, Si = (s, t
|
|
2052
2052
|
return i && r && xi(t, e, r), r;
|
2053
2053
|
};
|
2054
2054
|
const Ei = "application";
|
2055
|
-
class nt extends
|
2055
|
+
class nt extends _ {
|
2056
2056
|
constructor() {
|
2057
2057
|
super(...arguments), this.nodes = [], this.wrapperRef = me();
|
2058
2058
|
}
|
@@ -2341,14 +2341,6 @@ class Ii {
|
|
2341
2341
|
close() {
|
2342
2342
|
this.widget.hide();
|
2343
2343
|
}
|
2344
|
-
hideTriggerButton() {
|
2345
|
-
var t;
|
2346
|
-
(t = this.widget.trigger) == null || t.hideTrigger();
|
2347
|
-
}
|
2348
|
-
showTriggerButton() {
|
2349
|
-
var t;
|
2350
|
-
(t = this.widget.trigger) == null || t.showTrigger();
|
2351
|
-
}
|
2352
2344
|
}
|
2353
2345
|
class Ri {
|
2354
2346
|
constructor(t, e, i, r, n) {
|
@@ -2424,7 +2416,7 @@ class Ri {
|
|
2424
2416
|
}
|
2425
2417
|
render() {
|
2426
2418
|
if (this.renderStrategy === b.Trigger) {
|
2427
|
-
const t = new
|
2419
|
+
const t = new w();
|
2428
2420
|
return t.application = this, this.trigger = t, this.storage.get("open") && this.trigger.toggleActive(), t;
|
2429
2421
|
}
|
2430
2422
|
return this.root;
|
@@ -2494,7 +2486,7 @@ class Mi {
|
|
2494
2486
|
await this.activate(), this.siteConfigurationHandlers.forEach((t) => {
|
2495
2487
|
this.site && t(this.site.api);
|
2496
2488
|
});
|
2497
|
-
for (
|
2489
|
+
for (const [t, e] of this.widgetAPIHandlers)
|
2498
2490
|
e.forEach((i) => {
|
2499
2491
|
i();
|
2500
2492
|
});
|
@@ -2594,12 +2586,12 @@ class ki {
|
|
2594
2586
|
t(this.environment), this.environment.registerSite(this), await this.environment.bootstrap();
|
2595
2587
|
}
|
2596
2588
|
addGlobal(t) {
|
2597
|
-
const e = globalThis.
|
2589
|
+
const e = globalThis.ace;
|
2598
2590
|
((e == null ? void 0 : e._w) || []).forEach(([i, r]) => {
|
2599
2591
|
t.widget(i, r);
|
2600
2592
|
}), ((e == null ? void 0 : e._c) || []).forEach((i) => {
|
2601
2593
|
t.configure(i);
|
2602
|
-
}), globalThis.
|
2594
|
+
}), globalThis.ace = t;
|
2603
2595
|
}
|
2604
2596
|
}
|
2605
2597
|
var Ni = Object.defineProperty, ji = Object.getOwnPropertyDescriptor, Et = (s, t, e, i) => {
|
@@ -2607,7 +2599,7 @@ var Ni = Object.defineProperty, ji = Object.getOwnPropertyDescriptor, Et = (s, t
|
|
2607
2599
|
(o = s[n]) && (r = (i ? o(t, e, r) : o(r)) || r);
|
2608
2600
|
return i && r && Ni(t, e, r), r;
|
2609
2601
|
};
|
2610
|
-
class V extends
|
2602
|
+
class V extends _ {
|
2611
2603
|
constructor() {
|
2612
2604
|
super(), this.status = "deactivated", this.addEventListener("environment-created", this.onEnvironmentCreated);
|
2613
2605
|
}
|
@@ -2624,7 +2616,7 @@ class V extends w {
|
|
2624
2616
|
this.widget && (await this.widget.activate(), this.status = "activated");
|
2625
2617
|
}
|
2626
2618
|
async getGlobalEnvironment() {
|
2627
|
-
const t = globalThis.
|
2619
|
+
const t = globalThis.ace;
|
2628
2620
|
t && (this.widget = t.applications.find(
|
2629
2621
|
(e) => e.name === this.name
|
2630
2622
|
), await this.activate());
|
@@ -2633,7 +2625,7 @@ class V extends w {
|
|
2633
2625
|
if (!this.widget || this.status !== "activated")
|
2634
2626
|
return d;
|
2635
2627
|
if (this.widget.renderStrategy === b.Trigger) {
|
2636
|
-
const t = new
|
2628
|
+
const t = new w();
|
2637
2629
|
return t.application = this.widget, t;
|
2638
2630
|
}
|
2639
2631
|
return this.widget.render();
|
@@ -2656,7 +2648,7 @@ Et([
|
|
2656
2648
|
M()
|
2657
2649
|
], V.prototype, "status", 2);
|
2658
2650
|
customElements.get("ace-trigger-slot") || customElements.define("ace-trigger-slot", rt);
|
2659
|
-
customElements.get("ace-trigger") || customElements.define("ace-trigger",
|
2651
|
+
customElements.get("ace-trigger") || customElements.define("ace-trigger", w);
|
2660
2652
|
customElements.get("ace-unresolved-component") || customElements.define("ace-unresolved-component", St);
|
2661
2653
|
customElements.get("ace-wrapper") || customElements.define("ace-wrapper", nt);
|
2662
2654
|
customElements.get("ace-widget") || customElements.define("ace-widget", V);
|
@@ -2672,7 +2664,7 @@ export {
|
|
2672
2664
|
ki as Site,
|
2673
2665
|
y as StorageCategory,
|
2674
2666
|
Oi as StorageService,
|
2675
|
-
|
2667
|
+
w as Trigger,
|
2676
2668
|
yi as WidgetComponent,
|
2677
2669
|
Ei as applicationContext,
|
2678
2670
|
Vi as bootstrap,
|
package/package.json
CHANGED