@telia-ace/widget-conversation-flamingo 1.1.12-rc.1 → 1.1.12-rc.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. package/conversation-8e924136.js +572 -0
  2. package/conversation-a518bd92.mjs +2634 -0
  3. package/conversation-component.d.ts +2 -0
  4. package/conversation-platform.d.ts +9 -49
  5. package/conversation-session.d.ts +11 -0
  6. package/conversation.d.ts +23 -0
  7. package/entry.d.ts +9 -0
  8. package/group.d.ts +7 -0
  9. package/index-231900d1.mjs +780 -0
  10. package/index-592f145b.js +3 -0
  11. package/index-b34ddf78.js +1 -0
  12. package/{index-1ea0fde8.mjs → index-b5ca9962.mjs} +320 -319
  13. package/index.d.ts +6 -10
  14. package/index.js +1 -1
  15. package/index.mjs +7 -9
  16. package/{components/conversation/ui/message-types → message-types}/message-type-html.d.ts +3 -2
  17. package/models/agent.d.ts +8 -0
  18. package/models/conversation-entry.d.ts +11 -0
  19. package/models/conversation-provider.d.ts +19 -0
  20. package/models/conversation-session-state.d.ts +13 -0
  21. package/models/user.d.ts +8 -0
  22. package/package.json +5 -6
  23. package/types.d.ts +9 -123
  24. package/agent.d.ts +0 -20
  25. package/components/conversation/conversation.d.ts +0 -19
  26. package/components/conversation/plugin.d.ts +0 -45
  27. package/components/conversation/ui/message-list.d.ts +0 -9
  28. package/components/conversation/ui/message-types/message-type-link-list.d.ts +0 -8
  29. package/components/conversation/ui/message-types/message-type-separator.d.ts +0 -7
  30. package/components/conversation/ui/message.d.ts +0 -8
  31. package/components/conversation/utils.d.ts +0 -1
  32. package/conversation-5265abc7.js +0 -446
  33. package/conversation-8c2255c2.mjs +0 -1865
  34. package/conversation-controller.d.ts +0 -118
  35. package/conversation-history.d.ts +0 -26
  36. package/conversation-provider.d.ts +0 -32
  37. package/index-5cf6726d.js +0 -156
  38. package/index-836222bd.mjs +0 -3923
  39. package/index-c51d4b6a.js +0 -1
  40. package/send-18482cae.mjs +0 -4
  41. package/send-eb8b9428.js +0 -1
  42. package/store.d.ts +0 -31
  43. package/user.d.ts +0 -9
  44. package/utils/custom-message.d.ts +0 -2
  45. package/utils/index.d.ts +0 -1
  46. package/utils/open-chat-widget.d.ts +0 -4
  47. package/utils/swap-provider.d.ts +0 -8
@@ -1,446 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-5cf6726d.js"),Vt=require("./send-eb8b9428.js");/**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */const S=e=>(t,s)=>{s!==void 0?s.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)};/**
6
- * @license
7
- * Copyright 2021 Google LLC
8
- * SPDX-License-Identifier: BSD-3-Clause
9
- */let St=class extends Event{constructor(t,s,i){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=s,this.subscribe=i??!1}};/**
10
- * @license
11
- * Copyright 2021 Google LLC
12
- * SPDX-License-Identifier: BSD-3-Clause
13
- *//**
14
- * @license
15
- * Copyright 2021 Google LLC
16
- * SPDX-License-Identifier: BSD-3-Clause
17
- */let nt=class{constructor(t,s,i,n){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(o,r)=>{this.unsubscribe&&(this.unsubscribe!==r&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=o,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(o,r)),this.unsubscribe=r},this.host=t,s.context!==void 0){const o=s;this.context=o.context,this.callback=o.callback,this.subscribe=o.subscribe??!1}else this.context=s,this.callback=i,this.subscribe=n??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new St(this.context,this.t,this.subscribe))}};/**
18
- * @license
19
- * Copyright 2021 Google LLC
20
- * SPDX-License-Identifier: BSD-3-Clause
21
- */let te=class{get value(){return this.o}set value(t){this.setValue(t)}setValue(t,s=!1){const i=s||!Object.is(t,this.o);this.o=t,i&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(const[s,{disposer:i}]of this.subscriptions)s(this.o,i)},t!==void 0&&(this.value=t)}addCallback(t,s,i){if(!i)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:s});const{disposer:n}=this.subscriptions.get(t);t(this.value,n)}clearCallbacks(){this.subscriptions.clear()}};/**
22
- * @license
23
- * Copyright 2021 Google LLC
24
- * SPDX-License-Identifier: BSD-3-Clause
25
- */let ee=class extends Event{constructor(t){super("context-provider",{bubbles:!0,composed:!0}),this.context=t}},O=class extends te{constructor(t,s,i){super(s.context!==void 0?s.initialValue:i),this.onContextRequest=n=>{const o=n.composedPath()[0];n.context===this.context&&o!==this.host&&(n.stopPropagation(),this.addCallback(n.callback,o,n.subscribe))},this.onProviderRequest=n=>{const o=n.composedPath()[0];if(n.context!==this.context||o===this.host)return;const r=new Set;for(const[a,{consumerHost:l}]of this.subscriptions)r.has(a)||(r.add(a),l.dispatchEvent(new St(this.context,a,!0)));n.stopPropagation()},this.host=t,s.context!==void 0?this.context=s.context:this.context=s,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 ee(this.context))}};/**
26
- * @license
27
- * Copyright 2022 Google LLC
28
- * SPDX-License-Identifier: BSD-3-Clause
29
- */function se({context:e,subscribe:t}){return(s,i)=>{typeof i=="object"?i.addInitializer(function(){new nt(this,{context:e,callback:n=>{this[i.name]=n},subscribe:t})}):s.constructor.addInitializer(n=>{new nt(n,{context:e,callback:o=>{n[i]=o},subscribe:t})})}}const ie="children",ne="descriptor",oe="container",re="context",ae="layout",le="properties";class ce{constructor(t){(this.host=t).addController(this)}hostConnected(){}hostDisconnected(){}setDescriptor(t){this._descriptor=t}setContainer(t){this._container=t}async dispatch(t,s){if(!this._container||!this._descriptor)return;const i=await c.pt.getInstance(this._container),n=new c.P(i).withId(this._descriptor.id);await i.actions(n,this._descriptor.type||c.ht()).dispatch(t,s)}}const de=e=>{const t={};return Object.keys(e).forEach(s=>{s.indexOf("css-")>-1&&(t[s]=e[s])}),t},he=(e,t)=>{const s=de(t);Object.entries(s).forEach(([i,n])=>{e.style.setProperty(i.replace("css-",""),n)})};var ue=Object.defineProperty,pe=Object.getOwnPropertyDescriptor,b=(e,t,s,i)=>{for(var n=i>1?void 0:i?pe(t,s):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(n=(i?r(t,s,n):r(n))||n);return i&&n&&ue(t,s,n),n};const fe=e=>{class t extends e{constructor(){super(...arguments),this.entry="",this._descriptorProvider=new O(this,ne,void 0),this._childrenProvider=new O(this,ie,[]),this._propertiesProvider=new O(this,le,{}),this._contextProvider=new O(this,re,{}),this._layoutProvider=new O(this,ae,{}),this.actions=new ce(this),this.context={},this.layout={},this.properties={}}connectedCallback(){super.connectedCallback(),this.container&&(this.actions.setContainer(this.container),c.pt.getInstance(this.container).then(async i=>{var o,r;const n=i.nodes.get(this.entry);if(n){this._propertyChangeListener=i.events.subscribe("components:properties-changed",(u,p)=>{n.id===p.node.id&&this._setProperties(p.node.attributes.properties)}),this._contextChangeListener=i.events.subscribe("components:context-changed",(u,p)=>{n.id===p.node.id&&this._setContext(p.node.attributes.context)}),this._layoutChangeListener=i.events.subscribe("components:layout-changed",(u,p)=>{n.id===p.node.id&&this._setLayout(p.node.attributes.layout)});const a="default";this._unmountNode=n.mount(this.container),this._setDescriptor(c.Et(n,a)),this._setProperties(n.attributes.properties),this._setContext(n.attributes.context),this._setLayout(this.layout);const l=n.getChildren(a).map(u=>c.Et(u));this._childrenProvider.setValue(l);const d=await this.container.getAsync("componentResolver");if(((o=this.descriptor)==null?void 0:o.type)==="area")return;const h=d.getComponent(((r=this.descriptor)==null?void 0:r.type)||"");h.then&&h.then(u=>{this.component=u.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),this.renderRoot.host.style.setProperty("--width",this.layout.size==="full"?"var(--columns, 1)":`min(${this.layout.size||"var(--columns)"}, var(--columns))`),he(this.renderRoot.host,this.properties)}_setProperties(i){this._propertiesProvider.setValue(i),this.properties=i}_setContext(i){this._contextProvider.setValue(i),this.context=i}_setLayout(i){this._layoutProvider.setValue(i),this.layout=i}_setDescriptor(i){this.descriptor=i,this._descriptorProvider.setValue(i),this.actions.setDescriptor(i)}}return t.styles=[e.styles??[],c.i`
30
- :host {
31
- font-family: var(--font-family);
32
- grid-column: span var(--width);
33
- max-width: 100%;
34
- overflow: hidden;
35
- box-sizing: border-box;
36
- display: block;
37
- }
38
- * {
39
- box-sizing: border-box;
40
- }
41
- `],b([se({context:oe}),c.n({attribute:!1})],t.prototype,"container",2),b([c.n()],t.prototype,"entry",2),b([c.r()],t.prototype,"descriptor",2),b([c.r()],t.prototype,"component",2),b([c.r()],t.prototype,"context",2),b([c.r()],t.prototype,"layout",2),b([c.r()],t.prototype,"properties",2),t};/**
42
- * @license
43
- * Copyright 2020 Google LLC
44
- * SPDX-License-Identifier: BSD-3-Clause
45
- */const $e=e=>e.strings===void 0;/**
46
- * @license
47
- * Copyright 2017 Google LLC
48
- * SPDX-License-Identifier: BSD-3-Clause
49
- */const P=(e,t)=>{var i;const s=e._$AN;if(s===void 0)return!1;for(const n of s)(i=n._$AO)==null||i.call(n,t,!1),P(n,t);return!0},I=e=>{let t,s;do{if((t=e._$AM)===void 0)break;s=t._$AN,s.delete(e),e=t}while((s==null?void 0:s.size)===0)},Tt=e=>{for(let t;t=e._$AM;e=t){let s=t._$AN;if(s===void 0)t._$AN=s=new Set;else if(s.has(e))break;s.add(e),ve(t)}};function ge(e){this._$AN!==void 0?(I(this),this._$AM=e,Tt(this)):this._$AM=e}function me(e,t=!1,s=0){const i=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(t)if(Array.isArray(i))for(let o=s;o<i.length;o++)P(i[o],!1),I(i[o]);else i!=null&&(P(i,!1),I(i));else P(this,e)}const ve=e=>{e.type==c.t.CHILD&&(e._$AP??(e._$AP=me),e._$AQ??(e._$AQ=ge))};let Ot=class extends c.i$1{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,s,i){super._$AT(t,s,i),Tt(this),this.isConnected=t._$AU}_$AO(t,s=!0){var i,n;t!==this.isConnected&&(this.isConnected=t,t?(i=this.reconnected)==null||i.call(this):(n=this.disconnected)==null||n.call(this)),s&&(P(this,t),I(this))}setValue(t){if($e(this._$Ct))this._$Ct._$AI(t,this);else{const s=[...this._$Ct._$AH];s[this._$Ci]=t,this._$Ct._$AI(s,this,0)}}disconnected(){}reconnected(){}};/**
50
- * @license
51
- * Copyright 2020 Google LLC
52
- * SPDX-License-Identifier: BSD-3-Clause
53
- */const be=()=>new ye;let ye=class{};const K=new WeakMap,xe=c.e(class extends Ot{render(e){return c.T}update(e,[t]){var i;const s=t!==this.G;return s&&this.G!==void 0&&this.ot(void 0),(s||this.rt!==this.lt)&&(this.G=t,this.ct=(i=e.options)==null?void 0:i.host,this.ot(this.lt=e.element)),c.T}ot(e){if(typeof this.G=="function"){const t=this.ct??globalThis;let s=K.get(t);s===void 0&&(s=new WeakMap,K.set(t,s)),s.get(this.G)!==void 0&&this.G.call(this.ct,void 0),s.set(this.G,e),e!==void 0&&this.G.call(this.ct,e)}else this.G.value=e}get rt(){var e,t;return typeof this.G=="function"?(e=K.get(this.ct??globalThis))==null?void 0:e.get(this.G):(t=this.G)==null?void 0:t.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}}),_e=new WeakMap;let ot=0;const Q=new Map,rt=new WeakSet,at=()=>new Promise(e=>requestAnimationFrame(e)),lt=[{opacity:0}],ct=[{opacity:0},{opacity:1}],dt=(e,t)=>{const s=e-t;return s===0?void 0:s},ht=(e,t)=>{const s=e/t;return s===1?void 0:s},X={left:(e,t)=>{const s=dt(e,t);return{value:s,transform:s==null||isNaN(s)?void 0:`translateX(${s}px)`}},top:(e,t)=>{const s=dt(e,t);return{value:s,transform:s==null||isNaN(s)?void 0:`translateY(${s}px)`}},width:(e,t)=>{let s;t===0&&(t=1,s={width:"1px"});const i=ht(e,t);return{value:i,overrideFrom:s,transform:i==null||isNaN(i)?void 0:`scaleX(${i})`}},height:(e,t)=>{let s;t===0&&(t=1,s={height:"1px"});const i=ht(e,t);return{value:i,overrideFrom:s,transform:i==null||isNaN(i)?void 0:`scaleY(${i})`}}},we={duration:333,easing:"ease-in-out"},Ce=["left","top","width","height","opacity","color","background"],ut=new WeakMap;class ke extends Ot{constructor(t){if(super(t),this.t=null,this.i=null,this.o=!0,this.shouldLog=!1,t.type===c.t.CHILD)throw Error("The `animate` directive must be used in attribute position.");this.createFinished()}createFinished(){var t;(t=this.resolveFinished)==null||t.call(this),this.finished=new Promise(s=>{this.h=s})}async resolveFinished(){var t;(t=this.h)==null||t.call(this),this.h=void 0}render(t){return c.T}getController(){return _e.get(this.l)}isDisabled(){var t;return this.options.disabled||((t=this.getController())==null?void 0:t.disabled)}update(t,[s]){var n;const i=this.l===void 0;return i&&(this.l=(n=t.options)==null?void 0:n.host,this.l.addController(this),this.element=t.element,ut.set(this.element,this)),this.optionsOrCallback=s,(i||typeof s!="function")&&this.u(s),this.render(s)}u(t){t=t??{};const s=this.getController();s!==void 0&&((t={...s.defaultOptions,...t}).keyframeOptions={...s.defaultOptions.keyframeOptions,...t.keyframeOptions}),t.properties??(t.properties=Ce),this.options=t}p(){const t={},s=this.element.getBoundingClientRect(),i=getComputedStyle(this.element);return this.options.properties.forEach(n=>{const o=s[n]??(X[n]?void 0:i[n]),r=Number(o);t[n]=isNaN(r)?o+"":r}),t}m(){let t,s=!0;return this.options.guard&&(t=this.options.guard(),s=((i,n)=>{if(Array.isArray(i)){if(Array.isArray(n)&&n.length===i.length&&i.every((o,r)=>o===n[r]))return!1}else if(n===i)return!1;return!0})(t,this.v)),this.o=this.l.hasUpdated&&!this.isDisabled()&&!this.isAnimating()&&s&&this.element.isConnected,this.o&&(this.v=Array.isArray(t)?Array.from(t):t),this.o}hostUpdate(){typeof this.optionsOrCallback=="function"&&this.u(this.optionsOrCallback()),this.m()&&(this.g=this.p(),this.t=this.t??this.element.parentNode,this.i=this.element.nextSibling)}async hostUpdated(){if(!this.o||!this.element.isConnected||this.options.skipInitial&&!this.isHostRendered)return;let t;this.prepare(),await at;const s=this._(),i=this.A(this.options.keyframeOptions,s),n=this.p();if(this.g!==void 0){const{from:o,to:r}=this.O(this.g,n,s);this.log("measured",[this.g,n,o,r]),t=this.calculateKeyframes(o,r)}else{const o=Q.get(this.options.inId);if(o){Q.delete(this.options.inId);const{from:r,to:a}=this.O(o,n,s);t=this.calculateKeyframes(r,a),t=this.options.in?[{...this.options.in[0],...t[0]},...this.options.in.slice(1),t[1]]:t,ot++,t.forEach(l=>l.zIndex=ot)}else this.options.in&&(t=[...this.options.in,{}])}this.animate(t,i)}resetStyles(){this.j!==void 0&&(this.element.setAttribute("style",this.j??""),this.j=void 0)}commitStyles(){var t,s;this.j=this.element.getAttribute("style"),(t=this.webAnimation)==null||t.commitStyles(),(s=this.webAnimation)==null||s.cancel()}reconnected(){}async disconnected(){var s;if(!this.o||(this.options.id!==void 0&&Q.set(this.options.id,this.g),this.options.out===void 0))return;if(this.prepare(),await at(),(s=this.t)==null?void 0:s.isConnected){const i=this.i&&this.i.parentNode===this.t?this.i:null;if(this.t.insertBefore(this.element,i),this.options.stabilizeOut){const n=this.p();this.log("stabilizing out");const o=this.g.left-n.left,r=this.g.top-n.top;getComputedStyle(this.element).position!=="static"||o===0&&r===0||(this.element.style.position="relative"),o!==0&&(this.element.style.left=o+"px"),r!==0&&(this.element.style.top=r+"px")}}const t=this.A(this.options.keyframeOptions);await this.animate(this.options.out,t),this.element.remove()}prepare(){this.createFinished()}start(){var t,s;(s=(t=this.options).onStart)==null||s.call(t,this)}didFinish(t){var s,i;t&&((i=(s=this.options).onComplete)==null||i.call(s,this)),this.g=void 0,this.animatingProperties=void 0,this.frames=void 0,this.resolveFinished()}_(){const t=[];for(let s=this.element.parentNode;s;s=s==null?void 0:s.parentNode){const i=ut.get(s);i&&!i.isDisabled()&&i&&t.push(i)}return t}get isHostRendered(){const t=rt.has(this.l);return t||this.l.updateComplete.then(()=>{rt.add(this.l)}),t}A(t,s=this._()){const i={...we};return s.forEach(n=>Object.assign(i,n.options.keyframeOptions)),Object.assign(i,t),i}O(t,s,i){t={...t},s={...s};const n=i.map(a=>a.animatingProperties).filter(a=>a!==void 0);let o=1,r=1;return n!==void 0&&(n.forEach(a=>{a.width&&(o/=a.width),a.height&&(r/=a.height)}),t.left!==void 0&&s.left!==void 0&&(t.left=o*t.left,s.left=o*s.left),t.top!==void 0&&s.top!==void 0&&(t.top=r*t.top,s.top=r*s.top)),{from:t,to:s}}calculateKeyframes(t,s,i=!1){const n={},o={};let r=!1;const a={};for(const l in s){const d=t[l],h=s[l];if(l in X){const u=X[l];if(d===void 0||h===void 0)continue;const p=u(d,h);p.transform!==void 0&&(a[l]=p.value,r=!0,n.transform=`${n.transform??""} ${p.transform}`,p.overrideFrom!==void 0&&Object.assign(n,p.overrideFrom))}else d!==h&&d!==void 0&&h!==void 0&&(r=!0,n[l]=d,o[l]=h)}return n.transformOrigin=o.transformOrigin=i?"center center":"top left",this.animatingProperties=a,r?[n,o]:void 0}async animate(t,s=this.options.keyframeOptions){this.start(),this.frames=t;let i=!1;if(!this.isAnimating()&&!this.isDisabled()&&(this.options.onFrames&&(this.frames=t=this.options.onFrames(this),this.log("modified frames",t)),t!==void 0)){this.log("animate",[t,s]),i=!0,this.webAnimation=this.element.animate(t,s);const n=this.getController();n==null||n.add(this);try{await this.webAnimation.finished}catch{}n==null||n.remove(this)}return this.didFinish(i),i}isAnimating(){var t,s;return((t=this.webAnimation)==null?void 0:t.playState)==="running"||((s=this.webAnimation)==null?void 0:s.pending)}log(t,s){this.shouldLog&&!this.isDisabled()&&console.log(t,this.options.id,s)}}const pt=c.e(ke),x={allRenderFn:!1,cmpDidLoad:!0,cmpDidUnload:!1,cmpDidUpdate:!0,cmpDidRender:!0,cmpWillLoad:!0,cmpWillUpdate:!0,cmpWillRender:!0,connectedCallback:!0,disconnectedCallback:!0,element:!0,event:!0,hasRenderFn:!0,lifecycle:!0,hostListener:!0,hostListenerTargetWindow:!0,hostListenerTargetDocument:!0,hostListenerTargetBody:!0,hostListenerTargetParent:!1,hostListenerTarget:!0,member:!0,method:!0,mode:!0,observeAttribute:!0,prop:!0,propMutable:!0,reflect:!0,scoped:!0,shadowDom:!0,slot:!0,cssAnnotations:!0,state:!0,style:!0,svg:!0,updatable:!0,vdomAttribute:!0,vdomXlink:!0,vdomClass:!0,vdomFunctional:!0,vdomKey:!0,vdomListener:!0,vdomRef:!0,vdomPropOrAttr:!0,vdomRender:!0,vdomStyle:!0,vdomText:!0,watchCallback:!0,taskQueue:!0,hotModuleReplacement:!1,isDebug:!1,isDev:!1,isTesting:!1,hydrateServerSide:!1,hydrateClientSide:!1,lifecycleDOMEvents:!1,lazyLoad:!1,profile:!1,slotRelocation:!0,appendChildSlotFix:!1,cloneNodeFix:!1,hydratedAttribute:!1,hydratedClass:!0,safari10:!1,scriptDataOpts:!1,scopedSlotTextContentFix:!1,shadowDomShim:!1,slotChildNodesFix:!1,invisiblePrehydration:!0,propBoolean:!0,propNumber:!0,propString:!0,cssVarShim:!1,constructableCSS:!0,cmpShouldUpdate:!0,devTools:!1,dynamicImportShim:!1,shadowDelegatesFocus:!0,initializeNextTick:!1,asyncLoading:!1,asyncQueue:!1,transformTagName:!1,attachStyles:!0};let _,Pt,W,At=!1,R=!1,tt=!1,$=!1,ft=null,Y=!1;const q=typeof window<"u"?window:{},v=q.document||{head:{}},Lt=q.HTMLElement||class{},f={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,s,i)=>e.addEventListener(t,s,i),rel:(e,t,s,i)=>e.removeEventListener(t,s,i),ce:(e,t)=>new CustomEvent(e,t)},Se=(()=>{let e=!1;try{v.addEventListener("e",null,Object.defineProperty({},"passive",{get(){e=!0}}))}catch{}return e})(),Te=e=>Promise.resolve(e),Oe=(()=>{try{return new CSSStyleSheet,typeof new CSSStyleSheet().replace=="function"}catch{}return!1})(),Et=(e,t,s,i)=>{s&&s.map(([n,o,r])=>{const a=Ae(e,n),l=Pe(t,r),d=Le(n);f.ael(a,o,l,d),(t.$rmListeners$=t.$rmListeners$||[]).push(()=>f.rel(a,o,l,d))})},Pe=(e,t)=>s=>{try{x.lazyLoad||e.$hostElement$[t](s)}catch(i){L(i)}},Ae=(e,t)=>t&4?v:t&8?q:t&16?v.body:e,Le=e=>Se?{passive:(e&1)!==0,capture:(e&2)!==0}:(e&2)!==0,$t="http://www.w3.org/1999/xlink",y=(e,t="")=>()=>{},gt=new WeakMap,Ee=(e,t,s)=>{let i=M.get(e);Oe&&s?(i=i||new CSSStyleSheet,i.replace(t)):i=t,M.set(e,i)},je=(e,t,s,i)=>{let n=jt(t,s),o=M.get(n);if(e=e.nodeType===11?e:v,o)if(typeof o=="string"){e=e.head||e;let r=gt.get(e),a;r||gt.set(e,r=new Set),r.has(n)||(a=v.createElement("style"),a.innerHTML=o,e.insertBefore(a,e.querySelector("link")),r&&r.add(n))}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return n},Ie=e=>{const t=e.$cmpMeta$,s=e.$hostElement$,i=t.$flags$,n=y("attachStyles",t.$tagName$),o=je(s.shadowRoot?s.shadowRoot:s.getRootNode(),t,e.$modeName$);i&10&&(s["s-sc"]=o,s.classList.add(o+"-h"),i&2&&s.classList.add(o+"-s")),n()},jt=(e,t)=>"sc-"+(t&&e.$flags$&32?e.$tagName$+"-"+t:e.$tagName$),Re=e=>cs.map(t=>t(e)).find(t=>!!t),mt={},De="http://www.w3.org/2000/svg",Ne="http://www.w3.org/1999/xhtml",Me=e=>e!=null,et=e=>(e=typeof e,e==="object"||e==="function"),C=(e,t,...s)=>{let i=null,n=null,o=null,r=!1,a=!1,l=[];const d=u=>{for(let p=0;p<u.length;p++)i=u[p],Array.isArray(i)?d(i):i!=null&&typeof i!="boolean"&&((r=typeof e!="function"&&!et(i))&&(i=String(i)),r&&a?l[l.length-1].$text$+=i:l.push(r?D(null,i):i),a=r)};if(d(s),t){t.key&&(n=t.key),t.name&&(o=t.name);{const u=t.className||t.class;u&&(t.class=typeof u!="object"?u:Object.keys(u).filter(p=>u[p]).join(" "))}}if(typeof e=="function")return e(t===null?{}:t,l,ze);const h=D(e,null);return h.$attrs$=t,l.length>0&&(h.$children$=l),h.$key$=n,h.$name$=o,h},D=(e,t)=>{const s={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null};return s.$attrs$=null,s.$key$=null,s.$name$=null,s},st={},He=e=>e&&e.$tag$===st,ze={forEach:(e,t)=>e.map(vt).forEach(t),map:(e,t)=>e.map(vt).map(t).map(Fe)},vt=e=>({vattrs:e.$attrs$,vchildren:e.$children$,vkey:e.$key$,vname:e.$name$,vtag:e.$tag$,vtext:e.$text$}),Fe=e=>{if(typeof e.vtag=="function"){const s=Object.assign({},e.vattrs);return e.vkey&&(s.key=e.vkey),e.vname&&(s.name=e.vname),C(e.vtag,s,...e.vchildren||[])}const t=D(e.vtag,e.vtext);return t.$attrs$=e.vattrs,t.$children$=e.vchildren,t.$key$=e.vkey,t.$name$=e.vname,t},bt=(e,t,s,i,n,o)=>{if(s!==i){let r=wt(e,t),a=t.toLowerCase();if(t==="class"){const l=e.classList,d=yt(s),h=yt(i);l.remove(...d.filter(u=>u&&!h.includes(u))),l.add(...h.filter(u=>u&&!d.includes(u)))}else if(t==="style"){for(const l in s)(!i||i[l]==null)&&(l.includes("-")?e.style.removeProperty(l):e.style[l]="");for(const l in i)(!s||i[l]!==s[l])&&(l.includes("-")?e.style.setProperty(l,i[l]):e.style[l]=i[l])}else if(t!=="key")if(t==="ref")i&&i(e);else if(!e.__lookupSetter__(t)&&t[0]==="o"&&t[1]==="n")t[2]==="-"?t=t.slice(3):wt(q,a)?t=a.slice(2):t=a[2]+t.slice(3),s&&f.rel(e,t,s,!1),i&&f.ael(e,t,i,!1);else{const l=et(i);if((r||l&&i!==null)&&!n)try{if(e.tagName.includes("-"))e[t]=i;else{let h=i??"";t==="list"?r=!1:(s==null||e[t]!=h)&&(e[t]=h)}}catch{}let d=!1;a!==(a=a.replace(/^xlink\:?/,""))&&(t=a,d=!0),i==null||i===!1?(i!==!1||e.getAttribute(t)==="")&&(d?e.removeAttributeNS($t,t):e.removeAttribute(t)):(!r||o&4||n)&&!l&&(i=i===!0?"":i,d?e.setAttributeNS($t,t,i):e.setAttribute(t,i))}}},Ue=/\s/,yt=e=>e?e.split(Ue):[],It=(e,t,s,i)=>{const n=t.$elm$.nodeType===11&&t.$elm$.host?t.$elm$.host:t.$elm$,o=e&&e.$attrs$||mt,r=t.$attrs$||mt;for(i in o)i in r||bt(n,i,o[i],void 0,s,t.$flags$);for(i in r)bt(n,i,o[i],r[i],s,t.$flags$)},N=(e,t,s,i)=>{let n=t.$children$[s],o=0,r,a,l;if(At||(tt=!0,n.$tag$==="slot"&&(_&&i.classList.add(_+"-s"),n.$flags$|=n.$children$?2:1)),n.$text$!==null)r=n.$elm$=v.createTextNode(n.$text$);else if(n.$flags$&1)r=n.$elm$=v.createTextNode("");else{if($||($=n.$tag$==="svg"),r=n.$elm$=v.createElementNS($?De:Ne,n.$flags$&2?"slot-fb":n.$tag$),$&&n.$tag$==="foreignObject"&&($=!1),It(null,n,$),Me(_)&&r["s-si"]!==_&&r.classList.add(r["s-si"]=_),n.$children$)for(o=0;o<n.$children$.length;++o)a=N(e,n,o,r),a&&r.appendChild(a);n.$tag$==="svg"?$=!1:r.tagName==="foreignObject"&&($=!0)}return r["s-hn"]=W,n.$flags$&3&&(r["s-sr"]=!0,r["s-cr"]=Pt,r["s-sn"]=n.$name$||"",l=e&&e.$children$&&e.$children$[s],l&&l.$tag$===n.$tag$&&e.$elm$&&A(e.$elm$,!1)),r},A=(e,t)=>{f.$flags$|=1;const s=e.childNodes;for(let i=s.length-1;i>=0;i--){const n=s[i];n["s-hn"]!==W&&n["s-ol"]&&(Nt(n).insertBefore(n,it(n)),n["s-ol"].remove(),n["s-ol"]=void 0,tt=!0),t&&A(n,t)}f.$flags$&=-2},Rt=(e,t,s,i,n,o)=>{let r=e["s-cr"]&&e["s-cr"].parentNode||e,a;for(r.shadowRoot&&r.tagName===W&&(r=r.shadowRoot);n<=o;++n)i[n]&&(a=N(null,s,n,e),a&&(i[n].$elm$=a,r.insertBefore(a,it(t))))},Dt=(e,t,s,i,n)=>{for(;t<=s;++t)(i=e[t])&&(n=i.$elm$,zt(i),R=!0,n["s-ol"]?n["s-ol"].remove():A(n,!0),n.remove())},Be=(e,t,s,i)=>{let n=0,o=0,r=0,a=0,l=t.length-1,d=t[0],h=t[l],u=i.length-1,p=i[0],g=i[u],T,E;for(;n<=l&&o<=u;)if(d==null)d=t[++n];else if(h==null)h=t[--l];else if(p==null)p=i[++o];else if(g==null)g=i[--u];else if(j(d,p))w(d,p),d=t[++n],p=i[++o];else if(j(h,g))w(h,g),h=t[--l],g=i[--u];else if(j(d,g))(d.$tag$==="slot"||g.$tag$==="slot")&&A(d.$elm$.parentNode,!1),w(d,g),e.insertBefore(d.$elm$,h.$elm$.nextSibling),d=t[++n],g=i[--u];else if(j(h,p))(d.$tag$==="slot"||g.$tag$==="slot")&&A(h.$elm$.parentNode,!1),w(h,p),e.insertBefore(h.$elm$,d.$elm$),h=t[--l],p=i[++o];else{for(r=-1,a=n;a<=l;++a)if(t[a]&&t[a].$key$!==null&&t[a].$key$===p.$key$){r=a;break}r>=0?(E=t[r],E.$tag$!==p.$tag$?T=N(t&&t[o],s,r,e):(w(E,p),t[r]=void 0,T=E.$elm$),p=i[++o]):(T=N(t&&t[o],s,o,e),p=i[++o]),T&&Nt(d.$elm$).insertBefore(T,it(d.$elm$))}n>l?Rt(e,i[u+1]==null?null:i[u+1].$elm$,s,i,o,u):o>u&&Dt(t,n,l)},j=(e,t)=>e.$tag$===t.$tag$?e.$tag$==="slot"?e.$name$===t.$name$:e.$key$===t.$key$:!1,it=e=>e&&e["s-ol"]||e,Nt=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,w=(e,t)=>{const s=t.$elm$=e.$elm$,i=e.$children$,n=t.$children$,o=t.$tag$,r=t.$text$;let a;r===null?($=o==="svg"?!0:o==="foreignObject"?!1:$,o==="slot"||It(e,t,$),i!==null&&n!==null?Be(s,i,t,n):n!==null?(e.$text$!==null&&(s.textContent=""),Rt(s,null,t,n,0,n.length-1)):i!==null&&Dt(i,0,i.length-1),$&&o==="svg"&&($=!1)):(a=s["s-cr"])?a.parentNode.textContent=r:e.$text$!==r&&(s.data=r)},Mt=e=>{let t=e.childNodes,s,i,n,o,r,a;for(i=0,n=t.length;i<n;i++)if(s=t[i],s.nodeType===1){if(s["s-sr"]){for(r=s["s-sn"],s.hidden=!1,o=0;o<n;o++)if(a=t[o].nodeType,t[o]["s-hn"]!==s["s-hn"]||r!==""){if(a===1&&r===t[o].getAttribute("slot")){s.hidden=!0;break}}else if(a===1||a===3&&t[o].textContent.trim()!==""){s.hidden=!0;break}}Mt(s)}},m=[],Ht=e=>{let t,s,i,n,o,r,a=0,l=e.childNodes,d=l.length;for(;a<d;a++){if(t=l[a],t["s-sr"]&&(s=t["s-cr"])&&s.parentNode)for(i=s.parentNode.childNodes,n=t["s-sn"],r=i.length-1;r>=0;r--)s=i[r],!s["s-cn"]&&!s["s-nr"]&&s["s-hn"]!==t["s-hn"]&&(xt(s,n)?(o=m.find(h=>h.$nodeToRelocate$===s),R=!0,s["s-sn"]=s["s-sn"]||n,o?o.$slotRefNode$=t:m.push({$slotRefNode$:t,$nodeToRelocate$:s}),s["s-sr"]&&m.map(h=>{xt(h.$nodeToRelocate$,s["s-sn"])&&(o=m.find(u=>u.$nodeToRelocate$===s),o&&!h.$slotRefNode$&&(h.$slotRefNode$=o.$slotRefNode$))})):m.some(h=>h.$nodeToRelocate$===s)||m.push({$nodeToRelocate$:s}));t.nodeType===1&&Ht(t)}},xt=(e,t)=>e.nodeType===1?e.getAttribute("slot")===null&&t===""||e.getAttribute("slot")===t:e["s-sn"]===t?!0:t==="",zt=e=>{e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.map(zt)},We=(e,t)=>{const s=e.$hostElement$,i=e.$cmpMeta$,n=e.$vnode$||D(null,null),o=He(t)?t:C(null,null,t);W=s.tagName,i.$attrsToReflect$&&(o.$attrs$=o.$attrs$||{},i.$attrsToReflect$.map(([r,a])=>o.$attrs$[a]=s[r])),o.$tag$=null,o.$flags$|=4,e.$vnode$=o,o.$elm$=n.$elm$=s.shadowRoot||s,_=s["s-sc"],Pt=s["s-cr"],At=(i.$flags$&1)!==0,R=!1,w(n,o);{if(f.$flags$|=1,tt){Ht(o.$elm$);let r,a,l,d,h,u,p=0;for(;p<m.length;p++)r=m[p],a=r.$nodeToRelocate$,a["s-ol"]||(l=v.createTextNode(""),l["s-nr"]=a,a.parentNode.insertBefore(a["s-ol"]=l,a));for(p=0;p<m.length;p++)if(r=m[p],a=r.$nodeToRelocate$,r.$slotRefNode$){for(d=r.$slotRefNode$.parentNode,h=r.$slotRefNode$.nextSibling,l=a["s-ol"];l=l.previousSibling;)if(u=l["s-nr"],u&&u["s-sn"]===a["s-sn"]&&d===u.parentNode&&(u=u.nextSibling,!u||!u["s-nr"])){h=u;break}(!h&&d!==a.parentNode||a.nextSibling!==h)&&a!==h&&(!a["s-hn"]&&a["s-ol"]&&(a["s-hn"]=a["s-ol"].parentNode.nodeName),d.insertBefore(a,h))}else a.nodeType===1&&(a.hidden=!0)}R&&Mt(o.$elm$),f.$flags$&=-2,m.length=0}},qe=e=>e,Ge=(e,t,s)=>{const i=qe(e);return{emit:n=>Ke(i,t,{bubbles:!!(s&4),composed:!!(s&2),cancelable:!!(s&1),detail:n})}},Ke=(e,t,s)=>{const i=f.ce(t,s);return e.dispatchEvent(i),i},Qe=(e,t)=>{},Ft=(e,t)=>(e.$flags$|=16,Qe(e,e.$ancestorComponent$),us(()=>Xe(e,t))),Xe=(e,t)=>{const s=e.$hostElement$,i=y("scheduleUpdate",e.$cmpMeta$.$tagName$),n=s;let o;return t?o=k(n,"componentWillLoad"):o=k(n,"componentWillUpdate"),o=_t(o,()=>k(n,"componentWillRender")),i(),_t(o,()=>Ye(e,n,t))},Ye=async(e,t,s)=>{const i=e.$hostElement$,n=y("update",e.$cmpMeta$.$tagName$);i["s-rc"],s&&Ie(e);const o=y("render",e.$cmpMeta$.$tagName$);Je(e,t,i),o(),n(),Ze(e)},Je=(e,t,s)=>{try{ft=t,t=t.render&&t.render(),e.$flags$&=-17,e.$flags$|=2,(x.hasRenderFn||x.reflect)&&(x.vdomRender||x.reflect)&&(x.hydrateServerSide||We(e,t))}catch(a){L(a,e.$hostElement$)}return ft=null,null},Ze=e=>{const t=e.$cmpMeta$.$tagName$,s=e.$hostElement$,i=y("postUpdate",t),n=s;e.$ancestorComponent$,k(n,"componentDidRender"),e.$flags$&64?(k(n,"componentDidUpdate"),i()):(e.$flags$|=64,k(n,"componentDidLoad"),i())},k=(e,t,s)=>{if(e&&e[t])try{return e[t](s)}catch(i){L(i)}},_t=(e,t)=>e&&e.then?e.then(t):t(),Ve=(e,t)=>e!=null&&!et(e)?t&4?e==="false"?!1:e===""||!!e:t&2?parseFloat(e):t&1?String(e):e:e,ts=(e,t)=>G(e).$instanceValues$.get(t),es=(e,t,s,i)=>{const n=G(e),o=e,r=n.$instanceValues$.get(t),a=n.$flags$,l=o;s=Ve(s,i.$members$[t][0]);const d=Number.isNaN(r)&&Number.isNaN(s);if(s!==r&&!d){n.$instanceValues$.set(t,s);{if(i.$watchers$&&a&128){const u=i.$watchers$[t];u&&u.map(p=>{try{l[p](s,r,t)}catch(g){L(g,o)}})}if((a&18)===2){if(l.componentShouldUpdate&&l.componentShouldUpdate(s,r,t)===!1)return;Ft(n,!1)}}}},ss=(e,t,s)=>{if(t.$members$){e.watchers&&(t.$watchers$=e.watchers);const i=Object.entries(t.$members$),n=e.prototype;i.map(([o,[r]])=>{(r&31||r&32)&&Object.defineProperty(n,o,{get(){return ts(this,o)},set(a){es(this,o,a,t)},configurable:!0,enumerable:!0})});{const o=new Map;n.attributeChangedCallback=function(r,a,l){f.jmp(()=>{const d=o.get(r);if(this.hasOwnProperty(d))l=this[d],delete this[d];else if(n.hasOwnProperty(d)&&typeof this[d]=="number"&&this[d]==l)return;this[d]=l===null&&typeof this[d]=="boolean"?!1:l})},e.observedAttributes=i.filter(([r,a])=>a[0]&15).map(([r,a])=>{const l=a[1]||r;return o.set(l,r),a[0]&512&&t.$attrsToReflect$.push([r,l]),l})}}return e},is=async(e,t,s,i,n)=>{if(!(t.$flags$&32)&&(n=e.constructor,t.$flags$|=32,customElements.whenDefined(s.$tagName$).then(()=>t.$flags$|=128),n.style)){let r=n.style;typeof r!="string"&&(r=r[t.$modeName$=Re(e)]);const a=jt(s,t.$modeName$);if(!M.has(a)){const l=y("registerStyles",s.$tagName$);Ee(a,r,!!(s.$flags$&1)),l()}}t.$ancestorComponent$,(()=>Ft(t,!0))()},ns=e=>{},os=e=>{if(!(f.$flags$&1)){const t=G(e),s=t.$cmpMeta$,i=y("connectedCallback",s.$tagName$);t.$flags$&1?(Et(e,t,s.$listeners$),ns(t.$lazyInstance$)):(t.$flags$|=1,s.$flags$&12&&rs(e),s.$members$&&Object.entries(s.$members$).map(([n,[o]])=>{if(o&31&&e.hasOwnProperty(n)){const r=e[n];delete e[n],e[n]=r}}),is(e,t,s)),i()}},rs=e=>{const t=e["s-cr"]=v.createComment("");t["s-cn"]=!0,e.insertBefore(t,e.firstChild)},as=e=>{if(!(f.$flags$&1)){const t=G(e);t.$rmListeners$&&(t.$rmListeners$.map(s=>s()),t.$rmListeners$=void 0)}},Ut=(e,t)=>{const s={$flags$:t[0],$tagName$:t[1]};s.$members$=t[2],s.$listeners$=t[3],s.$watchers$=e.$watchers$,s.$attrsToReflect$=[];const i=e.prototype.connectedCallback,n=e.prototype.disconnectedCallback;return Object.assign(e.prototype,{__registerHost(){ls(this,s)},connectedCallback(){os(this),i&&i.call(this)},disconnectedCallback(){as(this),n&&n.call(this)},__attachShadow(){this.attachShadow({mode:"open",delegatesFocus:!!(s.$flags$&16)})}}),e.is=s.$tagName$,ss(e,s)},Bt=new WeakMap,G=e=>Bt.get(e),ls=(e,t)=>{const s={$flags$:0,$hostElement$:e,$cmpMeta$:t,$instanceValues$:new Map};return Et(e,s,t.$listeners$),Bt.set(e,s)},wt=(e,t)=>t in e,L=(e,t)=>(0,console.error)(e,t),M=new Map,cs=[],Ct=[],Wt=[],ds=(e,t)=>s=>{e.push(s),Y||(Y=!0,t&&f.$flags$&4?hs(J):f.raf(J))},kt=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(s){L(s)}e.length=0},J=()=>{kt(Ct),kt(Wt),(Y=Ct.length>0)&&f.raf(J)},hs=e=>Te().then(e),us=ds(Wt,!0),ps=(e={})=>{const{content:t="",title:s,attributes:i=[]}=e;let n="",o=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},...i];return s&&(n=`<title>${s}</title>`),`<svg ${o.map(a=>`${a.name}="${a.value}"`).join(" ")}>${n}${t}</svg>`},fs=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim();function $s(e){return`${e.getFullYear()}.${e.getMonth()+1}`}class gs{constructor(t){this.voca_component=t,this.voca_added=$s(new Date)}}const ms="telia-vst{display:none}",vs=Ut(class extends Lt{constructor(){super(),this.__registerHost(),this.vocaInternalUStats=Ge(this,"vocaInternalUStats",7)}connectedCallback(){this.vocaInternalUStats.emit(new gs(this.dataTrackingId))}render(){return C(st,null)}static get style(){return ms}},[0,"telia-vst",{dataTrackingId:[1,"data-tracking-id"]}]);function qt(){if(typeof customElements>"u")return;["telia-vst"].forEach(t=>{switch(t){case"telia-vst":customElements.get(t)||customElements.define(t,vs);break}})}qt();function Z(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{vocadsIcons:void 0,vocadsIconsRegistered:!1}}function bs(){if(typeof Z().vocadsIcons!==void 0)return Z().vocadsIcons}function ys(){return Z().vocadsIconsRegistered}const xs=".telia-icon{display:inline-block}.telia-icon__container{display:block;height:inherit}.telia-icon svg{display:block}.telia-icon--sm{height:calc(1.6rem * var(--voca-rem-multiplier));min-width:calc(1.6rem * var(--voca-rem-multiplier));width:calc(1.6rem * var(--voca-rem-multiplier))}.telia-icon--md{height:calc(2.4rem * var(--voca-rem-multiplier));min-width:calc(2.4rem * var(--voca-rem-multiplier));width:calc(2.4rem * var(--voca-rem-multiplier))}.telia-icon--lg{height:calc(3.2rem * var(--voca-rem-multiplier));min-width:calc(3.2rem * var(--voca-rem-multiplier));width:calc(3.2rem * var(--voca-rem-multiplier))}",_s=Ut(class extends Lt{constructor(){super(),this.__registerHost(),this.size="md",this.allyTitle=null,this.dataTrackingId="telia-icon"}getSvgString(){if(this.svg)return this.svg;if(ys()&&this.name){const e=bs();return e[this.name]?e[this.name].svg:""}return this.name&&console.warn(this.name,"Icons bundle is not registered and will not be rendered. Check if you have registered icons bundle or use svg property"),""}render(){let e=this.getSvgString(),t=[{name:"viewBox",value:"0 0 64 64"}];this.allyTitle?t=[...t,{name:"role",value:"img"}]:t=[...t,{name:"aria-hidden",value:"true"}];const s=ps({content:fs(e),attributes:t,title:this.allyTitle});return C(st,{class:`telia-icon telia-icon--${this.size}`},C("span",{"aria-label":this.allyTitle,class:"telia-icon__container",innerHTML:s}),C("telia-vst",{dataTrackingId:this.dataTrackingId}))}static get style(){return xs}},[0,"telia-icon",{name:[1],svg:[1],size:[1],allyTitle:[1,"ally-title"],dataTestid:[1,"data-testid"]}]);function ws(){if(typeof customElements>"u")return;["telia-icon","telia-vst"].forEach(t=>{switch(t){case"telia-icon":customElements.get(t)||customElements.define(t,_s);break;case"telia-vst":customElements.get(t)||qt();break}})}ws();var Cs=Object.defineProperty,ks=Object.getOwnPropertyDescriptor,Gt=(e,t,s,i)=>{for(var n=i>1?void 0:i?ks(t,s):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(n=(i?r(t,s,n):r(n))||n);return i&&n&&Cs(t,s,n),n};let H=class extends c.s{_renderTimestamp(e,t){if(!e&&!t)return c.T;const s=n=>new Date(n).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});let i="";return e?t?i=`${e}: ${s(t)}`:i=e:t&&(i=s(t)),c.x`<p class="conversation-timestamp">${i}</p>`}render(){var e,t;switch(this.message.type){case c.ConversationMessageType.System:return"";case c.ConversationMessageType.Agent:return c.x`<div
54
- class=${c.e$1({"conversation-agent-message":!0,"has-avatar":!!((e=this.message.sender)!=null&&e.avatar)})}
55
- >
56
- ${typeof((t=this.message.sender)==null?void 0:t.avatar)=="string"?c.x`<div class="avatar">
57
- <img src=${this.message.sender.avatar} />
58
- </div>`:c.T}
59
-
60
- <div class="content-bundle">
61
- ${this.message.content.map(s=>c.x`
62
- <div class="message-container">
63
- <div class="message-content">
64
- <conversation-component-message-list
65
- .items=${s.items||[]}
66
- ></conversation-component-message-list>
67
- </div>
68
- </div>
69
- `)}
70
- </div>
71
- ${this._renderTimestamp(this.message.sender.name||"",this.message.timestamp)}
72
- </div>`;case c.ConversationMessageType.User:return c.x`<div class="conversation-user-message">
73
- <div class="content-bundle">
74
- ${this.message.content.map(s=>c.x`
75
- <div class="message-container">
76
- <div class="message-content">
77
- <conversation-component-message-list
78
- .items=${s.items||[]}
79
- ></conversation-component-message-list>
80
- </div>
81
- </div>
82
- `)}
83
- </div>
84
- ${this._renderTimestamp("",this.message.timestamp)}
85
- </div>`;default:return c.T}}};H.styles=c.i`
86
- :host {
87
- box-sizing: border-box;
88
- display: block;
89
- }
90
- * {
91
- box-sizing: border-box;
92
- }
93
- .message-content {
94
- padding: var(--spacing-md);
95
- display: inline-block;
96
- margin-top: var(--spacing-md);
97
- max-width: 100%;
98
- border: 1px solid var(--gray-color);
99
- border-radius: var(--border-radius);
100
- background-color: var(--bubble-bg-color);
101
- color: var(--bubble-text-color);
102
- }
103
-
104
- .conversation-user-message {
105
- --bubble-bg-color: var(--conversation-user-bg-color);
106
- --bubble-text-color: var(--conversation-user-text-color);
107
- margin-left: 10%;
108
- width: 90%;
109
- display: flex;
110
- flex-direction: column;
111
- align-items: flex-end;
112
- }
113
-
114
- .conversation-agent-message {
115
- --bubble-bg-color: var(--conversation-agent-bg-color);
116
- --bubble-text-color: var(--conversation-agent-text-color);
117
- display: grid;
118
- margin-right: 10%;
119
- width: 90%;
120
-
121
- grid-template-columns: 1fr;
122
- grid-template-rows: 1fr auto;
123
- grid-template-areas:
124
- 'content'
125
- 'info';
126
- }
127
- .conversation-agent-message.has-avatar {
128
- grid-template-columns: auto 1fr;
129
- grid-template-rows: 1fr auto;
130
- grid-template-areas:
131
- 'avatar content'
132
- '. info';
133
- }
134
-
135
- .avatar {
136
- grid-area: avatar;
137
- place-self: flex-end;
138
- width: 32px;
139
- height: 32px;
140
- border-radius: 50%;
141
- align-self: flex-end;
142
- justify-self: center;
143
- overflow: hidden;
144
- margin-right: var(--spacing-md);
145
- justify-content: center;
146
- align-items: center;
147
- }
148
- .avatar img {
149
- height: 100%;
150
- width: 100%;
151
- object-fit: cover;
152
- }
153
-
154
- .conversation-timestamp {
155
- grid-area: info;
156
- margin: 0;
157
- line-height: 1.5em;
158
- grid-area: info;
159
- color: var(--text-color);
160
- font-size: 0.8rem;
161
- font-weight: 300;
162
- }
163
-
164
- .content-bundle {
165
- grid-area: content;
166
- }
167
- `;Gt([c.n()],H.prototype,"message",2);H=Gt([S("conversation-component-message")],H);var Ss=Object.defineProperty,Ts=Object.getOwnPropertyDescriptor,Kt=(e,t,s,i)=>{for(var n=i>1?void 0:i?Ts(t,s):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(n=(i?r(t,s,n):r(n))||n);return i&&n&&Ss(t,s,n),n};let z=class extends c.s{constructor(){super(...arguments),this.items=[]}_isCustomComponent(e){return!["html","link-list"].includes(e)}_createCustomComponent(e,t){const s=customElements.get(e);if(s){const i=new s;return i.message=t,i}return c.T}render(){return c.x` <div class="message-list">
168
- ${this.items.map(([e,t])=>c.x`
169
- ${e==="html"?c.x`
170
- <message-type-html .message=${t}> </message-type-html>
171
- `:c.T}
172
- ${e==="link-list"?c.x`
173
- <message-type-link-list .message=${t}>
174
- </message-type-link-list>
175
- `:c.T}
176
- ${e==="separator"?c.x`
177
- <message-type-separator .message=${t}>
178
- </message-type-separator>
179
- `:c.T}
180
- ${this._isCustomComponent(e)?this._createCustomComponent(e,t):c.T}
181
- `)}
182
- </div>`}};z.styles=c.i`
183
- :host {
184
- box-sizing: border-box;
185
- display: block;
186
- }
187
- * {
188
- box-sizing: border-box;
189
- }
190
- .message-list {
191
- display: flex;
192
- flex-direction: column;
193
- gap: var(--spacing-md);
194
- }
195
- `;Kt([c.n()],z.prototype,"items",2);z=Kt([S("conversation-component-message-list")],z);/**
196
- * @license
197
- * Copyright 2017 Google LLC
198
- * SPDX-License-Identifier: BSD-3-Clause
199
- */class V extends c.i$1{constructor(t){if(super(t),this.et=c.T,t.type!==c.t.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===c.T||t==null)return this.vt=void 0,this.et=t;if(t===c.w)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.vt;this.et=t;const s=[t];return s.raw=s,this.vt={_$litType$:this.constructor.resultType,strings:s,values:[]}}}V.directiveName="unsafeHTML",V.resultType=1;const Os=c.e(V);var Ps=Object.defineProperty,As=Object.getOwnPropertyDescriptor,Qt=(e,t,s,i)=>{for(var n=i>1?void 0:i?As(t,s):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(n=(i?r(t,s,n):r(n))||n);return i&&n&&Ps(t,s,n),n};let F=class extends c.s{render(){return c.x`<div class="message-type-html">
200
- ${Os(this.message.body)}
201
- </div>`}};F.styles=[c.i`
202
- :host {
203
- box-sizing: border-box;
204
- }
205
- * {
206
- box-sizing: border-box;
207
- }
208
- p {
209
- margin: 0;
210
- padding: 0;
211
- word-break: break-word;
212
- }
213
- `];Qt([c.n({attribute:!1})],F.prototype,"message",2);F=Qt([S("message-type-html")],F);var Ls=Object.defineProperty,Es=Object.getOwnPropertyDescriptor,Xt=(e,t,s,i)=>{for(var n=i>1?void 0:i?Es(t,s):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(n=(i?r(t,s,n):r(n))||n);return i&&n&&Ls(t,s,n),n};let U=class extends c.s{_onItemClick(e){const t=new CustomEvent("action",{bubbles:!0,composed:!0,detail:{actionKey:"action",payload:e}});this.dispatchEvent(t)}render(){return c.x`
214
- <div class="message-type-link-list">
215
- ${this.message.header?c.x`<h1>${this.message.header}</h1>`:c.T}
216
- <ul>
217
- ${this.message.actions.map(e=>c.x`
218
- <li>
219
- <button @click=${()=>this._onItemClick(e)}>
220
- ${e.label}
221
- </button>
222
- </li>
223
- `)}
224
- </ul>
225
- </div>
226
- `}};U.styles=[c.i`
227
- :host {
228
- box-sizing: border-box;
229
- }
230
- * {
231
- box-sizing: border-box;
232
- }
233
- h1 {
234
- font-size: 1.1rem;
235
- margin: 0 0 var(--spacing-sm);
236
- font-weight: normal;
237
- line-height: 1.8rem;
238
- color: var(--text-color);
239
- white-space: normal;
240
- }
241
- ul {
242
- list-style: none;
243
- margin: 0;
244
- padding: 0;
245
- }
246
- .message-type-link-list button {
247
- /* color: var(--primary-color); */
248
- background-color: transparent;
249
- max-width: 100%;
250
- border: none;
251
- cursor: pointer;
252
- text-transform: none;
253
- font-weight: 300;
254
- font-size: inherit;
255
- text-align: left;
256
- display: block;
257
- margin: 0;
258
- padding: 0;
259
- }
260
- .message-type-link-list ul {
261
- display: flex;
262
- flex-direction: column;
263
- gap: var(--spacing-sm);
264
- }
265
- `];Xt([c.n({attribute:!1})],U.prototype,"message",2);U=Xt([S("message-type-link-list")],U);var js=Object.defineProperty,Is=Object.getOwnPropertyDescriptor,Yt=(e,t,s,i)=>{for(var n=i>1?void 0:i?Is(t,s):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(n=(i?r(t,s,n):r(n))||n);return i&&n&&js(t,s,n),n};let B=class extends c.s{render(){return c.x`<div class="message-type-separator"></div>`}};B.styles=[c.i`
266
- :host {
267
- box-sizing: border-box;
268
- }
269
- * {
270
- box-sizing: border-box;
271
- }
272
- .message-type-separator {
273
- border-bottom: 1px solid var(--gray-color);
274
- width: 100%;
275
- }
276
- `];Yt([c.n({attribute:!1})],B.prototype,"message",2);B=Yt([S("message-type-separator")],B);const Rs=e=>{e.scrollTo?e.scrollTo({top:e.scrollHeight,behavior:"smooth"}):e.scrollTop=e.scrollHeight};var Ds=Object.defineProperty,Ns=Object.getOwnPropertyDescriptor,Jt=(e,t,s,i)=>{for(var n=i>1?void 0:i?Ns(t,s):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(n=(i?r(t,s,n):r(n))||n);return i&&n&&Ds(t,s,n),n};const Zt=fe(c.s);exports.ConversationComponent=class extends Zt{constructor(){super(...arguments),this.message="",this.conversationContentRef=be(),this.chatScrollHeight=0}async _onSendMessage(t){t.preventDefault(),await this.actions.dispatch("user-submit",{text:this.message}),this.message=""}_inputHandler(t){this.message=t.target.value}_actionHandler(t){this.actions.dispatch(t.detail.actionKey,t.detail.payload)}updated(t){const s=this.conversationContentRef.value;s&&setTimeout(()=>{const i=s.scrollHeight;i>this.chatScrollHeight&&(Rs(s),this.chatScrollHeight=i)},1e3)}render(){return c.x` <div
277
- @action=${this._actionHandler}
278
- class=${c.e$1({conversation:!0,"input-has-text":this.message.length>0})}
279
- >
280
- <div class="conversation-content" ${xe(this.conversationContentRef)}>
281
- <div class="conversation-content-inner">
282
- ${(this.properties.messages||[]).map(t=>c.x`<div class="conversation-entry" tabindex="-1">
283
- <conversation-component-message
284
- .message=${t}
285
- ${pt({keyframeOptions:{},in:ct,out:lt,stabilizeOut:!0,skipInitial:!1})}
286
- >
287
- </conversation-component-message>
288
- </div>`)}
289
- ${this.properties.loading?c.x`<div
290
- class="loader"
291
- ${pt({in:ct,out:lt,skipInitial:!1})}
292
- >
293
- <div></div>
294
- <div></div>
295
- <div></div>
296
- </div>`:c.T}
297
- </div>
298
- </div>
299
- <form class="conversation-bottom" @submit=${this._onSendMessage}>
300
- <input
301
- placeholder=${this.properties.inputPlaceholder||"Type your message here..."}
302
- .value=${this.message}
303
- @input=${this._inputHandler}
304
- />
305
- <div class="conversation-actions">
306
- <button class="conversation-send-button" type="submit">
307
- <telia-icon svg=${Vt.send.svg}></telia-icon>
308
- </button>
309
- </div>
310
- </form>
311
- </div>`}};exports.ConversationComponent.styles=[Zt.styles||[],c.i`
312
- :host {
313
- font-family: var(--font-family);
314
- /* --send-icon-color: var(--gray-dark-color, #a6a6a6); */
315
- --send-icon-opacity: 0.4;
316
- --send-icon-color: var(--text-color);
317
- --conversation-bg: #fafafa;
318
- --conversation-agent-bg-color: var(--secondary-background);
319
- --conversation-agent-text-color: var(--text-on-secondary-background);
320
- --conversation-user-bg-color: var(--primary-background);
321
- --conversation-user-text-color: var(--text-on-primary-background);
322
-
323
- scrollbar-width: thin; /* Firefox */
324
- scrollbar-color: #7f7f7f transparent; /* Firefox */
325
- }
326
- ::-webkit-scrollbar {
327
- width: 3px !important;
328
- background-color: transparent;
329
- border-left: none;
330
- }
331
- ::-webkit-scrollbar-thumb {
332
- background-color: #7f7f7f;
333
- }
334
- ::-webkit-scrollbar-track {
335
- -webkit-box-shadow: none !important;
336
- background-color: transparent;
337
- }
338
-
339
- .conversation {
340
- display: grid;
341
- grid-template-rows: 1fr auto;
342
- gap: var(--spacing-lg);
343
- height: 100%;
344
- background-color: transparent;
345
- }
346
-
347
- .conversation.input-has-text {
348
- /* --send-icon-color: var(--primary-color); */
349
- --send-icon-opacity: 1;
350
- }
351
-
352
- .conversation-content {
353
- flex: 1;
354
- background-color: var(--conversation-bg);
355
- padding: var(--spacing-md);
356
- overflow-y: auto;
357
- overflow-x: hidden;
358
- border-radius: var(--border-radius-sm);
359
- }
360
- .conversation-content-inner {
361
- display: flex;
362
- flex-direction: column;
363
- justify-content: end;
364
- min-height: 100%;
365
- }
366
- .conversation-bottom {
367
- border-top: 1px solid var(--gray-color);
368
- border-radius: var(--border-radius-sm);
369
- background-color: #fff;
370
- min-height: 50px;
371
- max-height: 150px;
372
- display: flex;
373
- align-items: center;
374
- padding: 0 var(--spacing-md);
375
- margin: 0;
376
- }
377
- .conversation-bottom-left {
378
- border-right: 1px solid var(--gray-color);
379
- padding-right: var(--spacing-md);
380
- }
381
- .circle {
382
- background-color: var(--gray-dark-color, #a6a6a6);
383
- border-radius: 50%;
384
- color: #fff;
385
- padding: var(--spacing-sm, 5px);
386
- border: none;
387
- display: flex;
388
- justify-content: center;
389
- align-items: center;
390
- }
391
- .conversation-send-button {
392
- border: none;
393
- background: transparent;
394
- cursor: pointer;
395
- color: var(--send-icon-color);
396
- opacity: var(--send-icon-opacity);
397
- transition: opacity 200ms ease-in-out;
398
- }
399
- .conversation-send-button:hover {
400
- --send-icon-opacity: 1;
401
- }
402
- input {
403
- border: none;
404
- font-family: inherit;
405
- font-size: inherit;
406
- flex: 1;
407
- height: 2.5rem;
408
- outline: none;
409
- }
410
-
411
- @keyframes loaderanim {
412
- 0% {
413
- opacity: 0;
414
- }
415
- 75% {
416
- opacity: 1;
417
- }
418
- 100% {
419
- opacity: 0;
420
- }
421
- }
422
-
423
- .loader {
424
- display: flex;
425
- justify-content: center;
426
- }
427
-
428
- .loader > div {
429
- height: 10px;
430
- width: 10px;
431
- border-radius: 50%;
432
- margin: 5px;
433
- background-color: var(--text-color);
434
- animation-name: loaderanim;
435
- animation-duration: 1s;
436
- animation-iteration-count: infinite;
437
- }
438
-
439
- .loader > div:nth-of-type(2) {
440
- animation-delay: 100ms;
441
- }
442
-
443
- .loader > div:nth-of-type(3) {
444
- animation-delay: 200ms;
445
- }
446
- `];Jt([c.r()],exports.ConversationComponent.prototype,"message",2);exports.ConversationComponent=Jt([S("ace-conversation")],exports.ConversationComponent);const Ms=exports.ConversationComponent;exports.default=Ms;