@telia-ace/widget-conversation-flamingo 1.1.19-rc.0 → 1.1.19-rc.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- "use strict";const xt=require("./index-b34f590f.js");/**
1
+ "use strict";const xt=require("./index-f74815a8.js");/**
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
@@ -48,9 +48,9 @@
48
48
  * @license
49
49
  * Copyright 2018 Google LLC
50
50
  * SPDX-License-Identifier: BSD-3-Clause
51
- */const Wt=bt(class extends Ft{constructor(e){var t;if(super(e),e.type!==yt.ATTRIBUTE||e.name!=="class"||((t=e.strings)==null?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(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){var i,n;if(this.it===void 0){this.it=new Set,e.strings!==void 0&&(this.st=new Set(e.strings.join(" ").split(/\s/).filter(r=>r!=="")));for(const r in t)t[r]&&!((i=this.st)!=null&&i.has(r))&&this.it.add(r);return this.render(t)}const s=e.element.classList;for(const r of this.it)r in t||(s.remove(r),this.it.delete(r));for(const r in t){const o=!!t[r];o===this.it.has(r)||(n=this.st)!=null&&n.has(r)||(o?(s.add(r),this.it.add(r)):(s.remove(r),this.it.delete(r)))}return C}}),it=(e,t,s)=>{e&&s.style.setProperty(t,e)},ts=(e,t)=>{var s,i,n,r;it((s=e.colors)==null?void 0:s.primaryBackground,"--primary-background",t),it((i=e.colors)==null?void 0:i.textOnPrimaryBackground,"--text-on-primary-background",t),it((n=e.colors)==null?void 0:n.secondaryBackground,"--secondary-background",t),it((r=e.colors)==null?void 0:r.textOnSecondaryBackground,"--text-on-secondary-background",t)};var Pi=Object.defineProperty,Li=Object.getOwnPropertyDescriptor,_t=(e,t,s,i)=>{for(var n=i>1?void 0:i?Li(t,s):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(n=(i?o(t,s,n):o(n))||n);return i&&n&&Pi(t,s,n),n};class U extends v{constructor(){super(...arguments),this.active=!1,this.loaded=!1}async connectedCallback(){super.connectedCallback(),this.icon=await this._renderSymbol(),this.loaded=!0,this._applyBranding()}_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.application.hide()}_applyBranding(){var t;(t=this.application)!=null&&t.settings&&ts(this.application.settings.branding,this)}async _renderSymbol(){var r;const t=(r=this.application)==null?void 0:r.triggerIcon;if(!t)return u;const s=async o=>await Promise.resolve().then(()=>require("./index-823bc9d0.js")).then(l=>l[o]),{type:i,content:n}=t;switch(i){case"Telia":{const o=await s(n);return o?$`<telia-icon
51
+ */const Wt=bt(class extends Ft{constructor(e){var t;if(super(e),e.type!==yt.ATTRIBUTE||e.name!=="class"||((t=e.strings)==null?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(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){var i,n;if(this.it===void 0){this.it=new Set,e.strings!==void 0&&(this.st=new Set(e.strings.join(" ").split(/\s/).filter(r=>r!=="")));for(const r in t)t[r]&&!((i=this.st)!=null&&i.has(r))&&this.it.add(r);return this.render(t)}const s=e.element.classList;for(const r of this.it)r in t||(s.remove(r),this.it.delete(r));for(const r in t){const o=!!t[r];o===this.it.has(r)||(n=this.st)!=null&&n.has(r)||(o?(s.add(r),this.it.add(r)):(s.remove(r),this.it.delete(r)))}return C}}),it=(e,t,s)=>{e&&s.style.setProperty(t,e)},ts=(e,t)=>{var s,i,n,r;it((s=e.colors)==null?void 0:s.primaryBackground,"--primary-background",t),it((i=e.colors)==null?void 0:i.textOnPrimaryBackground,"--text-on-primary-background",t),it((n=e.colors)==null?void 0:n.secondaryBackground,"--secondary-background",t),it((r=e.colors)==null?void 0:r.textOnSecondaryBackground,"--text-on-secondary-background",t)};var Pi=Object.defineProperty,Li=Object.getOwnPropertyDescriptor,_t=(e,t,s,i)=>{for(var n=i>1?void 0:i?Li(t,s):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(n=(i?o(t,s,n):o(n))||n);return i&&n&&Pi(t,s,n),n};class U extends v{constructor(){super(...arguments),this.active=!1,this.loaded=!1}async connectedCallback(){super.connectedCallback(),this.icon=await this._renderSymbol(),this.loaded=!0,this._applyBranding()}_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.application.hide()}_applyBranding(){var t;(t=this.application)!=null&&t.settings&&ts(this.application.settings.branding,this)}async _renderSymbol(){var a,l;const t=(a=this.application)==null?void 0:a.branding(),s=t==null?void 0:t.graphics.trigger;if(s)return $` <img src=${s} class="trigger-icon" alt="" /> `;const i=(l=this.application)==null?void 0:l.triggerIcon;if(!i)return u;const n=async c=>await Promise.resolve().then(()=>require("./index-8f4273fd.js")).then(d=>d[c]),{type:r,content:o}=i;switch(r){case"Telia":{const c=await n(o);return c?$`<telia-icon
52
52
  class="trigger-icon"
53
- svg=${o.svg}
53
+ svg=${c.svg}
54
54
  size="lg"
55
55
  ></telia-icon>`:u}default:return u}}render(){return $`<button
56
56
  class=${Wt({trigger:!0,active:this.active,rendered:this.loaded})}
@@ -152,6 +152,10 @@
152
152
  align-items: center;
153
153
  fill: var(--trigger-text-color, var(--text-on-primary-background));
154
154
  }
155
+
156
+ img {
157
+ max-width: 100%;
158
+ }
155
159
  `];_t([g({attribute:!1})],U.prototype,"application",2);_t([A()],U.prototype,"active",2);_t([A()],U.prototype,"loaded",2);_t([A()],U.prototype,"icon",2);var Ui=Object.defineProperty,Ni=Object.getOwnPropertyDescriptor,k=(e,t,s,i)=>{for(var n=i>1?void 0:i?Ni(t,s):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(n=(i?o(t,s,n):o(n))||n);return i&&n&&Ui(t,s,n),n};const es=e=>{class t extends e{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))`)}}return t.styles=[_`
156
160
  :host {
157
161
  font-family: var(--font-family);
@@ -1,4 +1,4 @@
1
- import { C as xt } from "./index-e9da2f7d.mjs";
1
+ import { C as xt } from "./index-9a0c787a.mjs";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2019 Google LLC
@@ -1475,19 +1475,22 @@ class U extends v {
1475
1475
  (t = this.application) != null && t.settings && Ve(this.application.settings.branding, this);
1476
1476
  }
1477
1477
  async _renderSymbol() {
1478
- var r;
1479
- const t = (r = this.application) == null ? void 0 : r.triggerIcon;
1480
- if (!t)
1478
+ var a, l;
1479
+ const t = (a = this.application) == null ? void 0 : a.branding(), s = t == null ? void 0 : t.graphics.trigger;
1480
+ if (s)
1481
+ return $` <img src=${s} class="trigger-icon" alt="" /> `;
1482
+ const i = (l = this.application) == null ? void 0 : l.triggerIcon;
1483
+ if (!i)
1481
1484
  return u;
1482
- const s = async (o) => await import("./index-cc2f0d24.mjs").then(
1483
- (l) => l[o]
1484
- ), { type: i, content: n } = t;
1485
- switch (i) {
1485
+ const n = async (c) => await import("./index-536e1cef.mjs").then(
1486
+ (d) => d[c]
1487
+ ), { type: r, content: o } = i;
1488
+ switch (r) {
1486
1489
  case "Telia": {
1487
- const o = await s(n);
1488
- return o ? $`<telia-icon
1490
+ const c = await n(o);
1491
+ return c ? $`<telia-icon
1489
1492
  class="trigger-icon"
1490
- svg=${o.svg}
1493
+ svg=${c.svg}
1491
1494
  size="lg"
1492
1495
  ></telia-icon>` : u;
1493
1496
  }
@@ -1604,6 +1607,10 @@ U.styles = [
1604
1607
  align-items: center;
1605
1608
  fill: var(--trigger-text-color, var(--text-on-primary-background));
1606
1609
  }
1610
+
1611
+ img {
1612
+ max-width: 100%;
1613
+ }
1607
1614
  `
1608
1615
  ];
1609
1616
  _t([