ttp-agent-sdk 2.34.13 → 2.34.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/agent-widget.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see agent-widget.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.TTPAgentSDK=t():e.TTPAgentSDK=t()}(window,()=>(()=>{var e={354:function(e){e.exports=function(){"use strict";var e=function(t,A){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var A in t)Object.prototype.hasOwnProperty.call(t,A)&&(e[A]=t[A])},e(t,A)};function t(t,A){if("function"!=typeof A&&null!==A)throw new TypeError("Class extends value "+String(A)+" is not a constructor or null");function n(){this.constructor=t}e(t,A),t.prototype=null===A?Object.create(A):(n.prototype=A.prototype,new n)}var A=function(){return A=Object.assign||function(e){for(var t,A=1,n=arguments.length;A<n;A++)for(var o in t=arguments[A])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},A.apply(this,arguments)};function n(e,t,A,n){return new(A||(A=Promise))(function(o,r){function i(e){try{s(n.next(e))}catch(e){r(e)}}function a(e){try{s(n.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof A?t:new A(function(e){e(t)})).then(i,a)}s((n=n.apply(e,t||[])).next())})}function o(e,t){var A,n,o,r,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(A)throw new TypeError("Generator is already executing.");for(;i;)try{if(A=1,n&&(o=2&r[0]?n.return:r[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,r[1])).done)return o;switch(n=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return i.label++,{value:r[1],done:!1};case 5:i.label++,n=r[1],r=[0];continue;case 7:r=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){i=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){i.label=r[1];break}if(6===r[0]&&i.label<o[1]){i.label=o[1],o=r;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(r);break}o[2]&&i.ops.pop(),i.trys.pop();continue}r=t.call(e,i)}catch(e){r=[6,e],n=0}finally{A=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}function r(e,t,A){if(A||2===arguments.length)for(var n,o=0,r=t.length;o<r;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||t)}for(var i=function(){function e(e,t,A,n){this.left=e,this.top=t,this.width=A,this.height=n}return e.prototype.add=function(t,A,n,o){return new e(this.left+t,this.top+A,this.width+n,this.height+o)},e.fromClientRect=function(t,A){return new e(A.left+t.windowBounds.left,A.top+t.windowBounds.top,A.width,A.height)},e.fromDOMRectList=function(t,A){var n=Array.from(A).find(function(e){return 0!==e.width});return n?new e(n.left+t.windowBounds.left,n.top+t.windowBounds.top,n.width,n.height):e.EMPTY},e.EMPTY=new e(0,0,0,0),e}(),a=function(e,t){return i.fromClientRect(e,t.getBoundingClientRect())},s=function(e){for(var t=[],A=0,n=e.length;A<n;){var o=e.charCodeAt(A++);if(o>=55296&&o<=56319&&A<n){var r=e.charCodeAt(A++);56320==(64512&r)?t.push(((1023&o)<<10)+(1023&r)+65536):(t.push(o),A--)}else t.push(o)}return t},c=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var A=e.length;if(!A)return"";for(var n=[],o=-1,r="";++o<A;){var i=e[o];i<=65535?n.push(i):(i-=65536,n.push(55296+(i>>10),i%1024+56320)),(o+1===A||n.length>16384)&&(r+=String.fromCharCode.apply(String,n),n.length=0)}return r},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u="undefined"==typeof Uint8Array?[]:new Uint8Array(256),d=0;d<64;d++)u[l.charCodeAt(d)]=d;for(var p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h="undefined"==typeof Uint8Array?[]:new Uint8Array(256),g=0;g<64;g++)h[p.charCodeAt(g)]=g;for(var f=function(e,t,A){return e.slice?e.slice(t,A):new Uint16Array(Array.prototype.slice.call(e,t,A))},m=function(){function e(e,t,A,n,o,r){this.initialValue=e,this.errorValue=t,this.highStart=A,this.highValueIndex=n,this.index=o,this.data=r}return e.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>5])<<2)+(31&e),this.data[t];if(e<=65535)return t=((t=this.index[2048+(e-55296>>5)])<<2)+(31&e),this.data[t];if(e<this.highStart)return t=2080+(e>>11),t=this.index[t],t+=e>>5&63,t=((t=this.index[t])<<2)+(31&e),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",B="undefined"==typeof Uint8Array?[]:new Uint8Array(256),w=0;w<64;w++)B[v.charCodeAt(w)]=w;var y=10,b=13,C=15,x=17,Q=18,F=19,U=20,S=21,k=22,E=24,I=25,T=26,H=27,D=28,P=30,O=32,K=33,M=34,L=35,R=37,_=38,V=39,j=40,N=42,G=[9001,65288],W="×",z="÷",X=function(e){var t,A,n,o=function(e){var t,A,n,o,r,i=.75*e.length,a=e.length,s=0;"="===e[e.length-1]&&(i--,"="===e[e.length-2]&&i--);var c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(i):new Array(i),l=Array.isArray(c)?c:new Uint8Array(c);for(t=0;t<a;t+=4)A=h[e.charCodeAt(t)],n=h[e.charCodeAt(t+1)],o=h[e.charCodeAt(t+2)],r=h[e.charCodeAt(t+3)],l[s++]=A<<2|n>>4,l[s++]=(15&n)<<4|o>>2,l[s++]=(3&o)<<6|63&r;return c}(e),r=Array.isArray(o)?function(e){for(var t=e.length,A=[],n=0;n<t;n+=4)A.push(e[n+3]<<24|e[n+2]<<16|e[n+1]<<8|e[n]);return A}(o):new Uint32Array(o),i=Array.isArray(o)?function(e){for(var t=e.length,A=[],n=0;n<t;n+=2)A.push(e[n+1]<<8|e[n]);return A}(o):new Uint16Array(o),a=f(i,12,r[4]/2),s=2===r[5]?f(i,(24+r[4])/2):(t=r,A=Math.ceil((24+r[4])/4),t.slice?t.slice(A,n):new Uint32Array(Array.prototype.slice.call(t,A,n)));return new m(r[0],r[1],r[2],r[3],a,s)}("KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA=="),J=[P,36],Y=[1,2,3,5],q=[y,8],Z=[H,T],$=Y.concat(q),ee=[_,V,j,M,L],te=[C,b],Ae=function(e,t,A,n){var o=n[A];if(Array.isArray(e)?-1!==e.indexOf(o):e===o)for(var r=A;r<=n.length;){if((s=n[++r])===t)return!0;if(s!==y)break}if(o===y)for(r=A;r>0;){var i=n[--r];if(Array.isArray(e)?-1!==e.indexOf(i):e===i)for(var a=A;a<=n.length;){var s;if((s=n[++a])===t)return!0;if(s!==y)break}if(i!==y)break}return!1},ne=function(e,t){for(var A=e;A>=0;){var n=t[A];if(n!==y)return n;A--}return 0},oe=function(e,t,A,n,o){if(0===A[n])return W;var r=n-1;if(Array.isArray(o)&&!0===o[r])return W;var i=r-1,a=r+1,s=t[r],c=i>=0?t[i]:0,l=t[a];if(2===s&&3===l)return W;if(-1!==Y.indexOf(s))return"!";if(-1!==Y.indexOf(l))return W;if(-1!==q.indexOf(l))return W;if(8===ne(r,t))return z;if(11===X.get(e[r]))return W;if((s===O||s===K)&&11===X.get(e[a]))return W;if(7===s||7===l)return W;if(9===s)return W;if(-1===[y,b,C].indexOf(s)&&9===l)return W;if(-1!==[x,Q,F,E,D].indexOf(l))return W;if(ne(r,t)===k)return W;if(Ae(23,k,r,t))return W;if(Ae([x,Q],S,r,t))return W;if(Ae(12,12,r,t))return W;if(s===y)return z;if(23===s||23===l)return W;if(16===l||16===s)return z;if(-1!==[b,C,S].indexOf(l)||14===s)return W;if(36===c&&-1!==te.indexOf(s))return W;if(s===D&&36===l)return W;if(l===U)return W;if(-1!==J.indexOf(l)&&s===I||-1!==J.indexOf(s)&&l===I)return W;if(s===H&&-1!==[R,O,K].indexOf(l)||-1!==[R,O,K].indexOf(s)&&l===T)return W;if(-1!==J.indexOf(s)&&-1!==Z.indexOf(l)||-1!==Z.indexOf(s)&&-1!==J.indexOf(l))return W;if(-1!==[H,T].indexOf(s)&&(l===I||-1!==[k,C].indexOf(l)&&t[a+1]===I)||-1!==[k,C].indexOf(s)&&l===I||s===I&&-1!==[I,D,E].indexOf(l))return W;if(-1!==[I,D,E,x,Q].indexOf(l))for(var u=r;u>=0;){if((d=t[u])===I)return W;if(-1===[D,E].indexOf(d))break;u--}if(-1!==[H,T].indexOf(l))for(u=-1!==[x,Q].indexOf(s)?i:r;u>=0;){var d;if((d=t[u])===I)return W;if(-1===[D,E].indexOf(d))break;u--}if(_===s&&-1!==[_,V,M,L].indexOf(l)||-1!==[V,M].indexOf(s)&&-1!==[V,j].indexOf(l)||-1!==[j,L].indexOf(s)&&l===j)return W;if(-1!==ee.indexOf(s)&&-1!==[U,T].indexOf(l)||-1!==ee.indexOf(l)&&s===H)return W;if(-1!==J.indexOf(s)&&-1!==J.indexOf(l))return W;if(s===E&&-1!==J.indexOf(l))return W;if(-1!==J.concat(I).indexOf(s)&&l===k&&-1===G.indexOf(e[a])||-1!==J.concat(I).indexOf(l)&&s===Q)return W;if(41===s&&41===l){for(var p=A[r],h=1;p>0&&41===t[--p];)h++;if(h%2!=0)return W}return s===O&&l===K?W:z},re=function(e,t){t||(t={lineBreak:"normal",wordBreak:"normal"});var A=function(e,t){void 0===t&&(t="strict");var A=[],n=[],o=[];return e.forEach(function(e,r){var i=X.get(e);if(i>50?(o.push(!0),i-=50):o.push(!1),-1!==["normal","auto","loose"].indexOf(t)&&-1!==[8208,8211,12316,12448].indexOf(e))return n.push(r),A.push(16);if(4===i||11===i){if(0===r)return n.push(r),A.push(P);var a=A[r-1];return-1===$.indexOf(a)?(n.push(n[r-1]),A.push(a)):(n.push(r),A.push(P))}return n.push(r),31===i?A.push("strict"===t?S:R):i===N||29===i?A.push(P):43===i?e>=131072&&e<=196605||e>=196608&&e<=262141?A.push(R):A.push(P):void A.push(i)}),[n,A,o]}(e,t.lineBreak),n=A[0],o=A[1],r=A[2];"break-all"!==t.wordBreak&&"break-word"!==t.wordBreak||(o=o.map(function(e){return-1!==[I,P,N].indexOf(e)?R:e}));var i="keep-all"===t.wordBreak?r.map(function(t,A){return t&&e[A]>=19968&&e[A]<=40959}):void 0;return[n,o,i]},ie=function(){function e(e,t,A,n){this.codePoints=e,this.required="!"===t,this.start=A,this.end=n}return e.prototype.slice=function(){return c.apply(void 0,this.codePoints.slice(this.start,this.end))},e}(),ae=45,se=43,ce=-1,le=function(e){return e>=48&&e<=57},ue=function(e){return le(e)||e>=65&&e<=70||e>=97&&e<=102},de=function(e){return 10===e||9===e||32===e},pe=function(e){return function(e){return function(e){return e>=97&&e<=122}(e)||function(e){return e>=65&&e<=90}(e)}(e)||function(e){return e>=128}(e)||95===e},he=function(e){return pe(e)||le(e)||e===ae},ge=function(e){return e>=0&&e<=8||11===e||e>=14&&e<=31||127===e},fe=function(e,t){return 92===e&&10!==t},me=function(e,t,A){return e===ae?pe(t)||fe(t,A):!!pe(e)||!(92!==e||!fe(e,t))},ve=function(e,t,A){return e===se||e===ae?!!le(t)||46===t&&le(A):le(46===e?t:e)},Be=function(e){var t=0,A=1;e[t]!==se&&e[t]!==ae||(e[t]===ae&&(A=-1),t++);for(var n=[];le(e[t]);)n.push(e[t++]);var o=n.length?parseInt(c.apply(void 0,n),10):0;46===e[t]&&t++;for(var r=[];le(e[t]);)r.push(e[t++]);var i=r.length,a=i?parseInt(c.apply(void 0,r),10):0;69!==e[t]&&101!==e[t]||t++;var s=1;e[t]!==se&&e[t]!==ae||(e[t]===ae&&(s=-1),t++);for(var l=[];le(e[t]);)l.push(e[t++]);var u=l.length?parseInt(c.apply(void 0,l),10):0;return A*(o+a*Math.pow(10,-i))*Math.pow(10,s*u)},we={type:2},ye={type:3},be={type:4},Ce={type:13},xe={type:8},Qe={type:21},Fe={type:9},Ue={type:10},Se={type:11},ke={type:12},Ee={type:14},Ie={type:23},Te={type:1},He={type:25},De={type:24},Pe={type:26},Oe={type:27},Ke={type:28},Me={type:29},Le={type:31},Re={type:32},_e=function(){function e(){this._value=[]}return e.prototype.write=function(e){this._value=this._value.concat(s(e))},e.prototype.read=function(){for(var e=[],t=this.consumeToken();t!==Re;)e.push(t),t=this.consumeToken();return e},e.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case 34:return this.consumeStringToken(34);case 35:var t=this.peekCodePoint(0),A=this.peekCodePoint(1),n=this.peekCodePoint(2);if(he(t)||fe(A,n)){var o=me(t,A,n)?2:1;return{type:5,value:this.consumeName(),flags:o}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Ce;break;case 39:return this.consumeStringToken(39);case 40:return we;case 41:return ye;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Ee;break;case se:if(ve(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case 44:return be;case ae:var r=e,i=this.peekCodePoint(0),a=this.peekCodePoint(1);if(ve(r,i,a))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(me(r,i,a))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(i===ae&&62===a)return this.consumeCodePoint(),this.consumeCodePoint(),De;break;case 46:if(ve(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case 47:if(42===this.peekCodePoint(0))for(this.consumeCodePoint();;){var s=this.consumeCodePoint();if(42===s&&47===(s=this.consumeCodePoint()))return this.consumeToken();if(s===ce)return this.consumeToken()}break;case 58:return Pe;case 59:return Oe;case 60:if(33===this.peekCodePoint(0)&&this.peekCodePoint(1)===ae&&this.peekCodePoint(2)===ae)return this.consumeCodePoint(),this.consumeCodePoint(),He;break;case 64:var l=this.peekCodePoint(0),u=this.peekCodePoint(1),d=this.peekCodePoint(2);if(me(l,u,d))return{type:7,value:this.consumeName()};break;case 91:return Ke;case 92:if(fe(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case 93:return Me;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),xe;break;case 123:return Se;case 125:return ke;case 117:case 85:var p=this.peekCodePoint(0),h=this.peekCodePoint(1);return p!==se||!ue(h)&&63!==h||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Fe;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),Qe;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Ue;break;case ce:return Re}return de(e)?(this.consumeWhiteSpace(),Le):le(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):pe(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:c(e)}},e.prototype.consumeCodePoint=function(){var e=this._value.shift();return void 0===e?-1:e},e.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},e.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},e.prototype.consumeUnicodeRangeToken=function(){for(var e=[],t=this.consumeCodePoint();ue(t)&&e.length<6;)e.push(t),t=this.consumeCodePoint();for(var A=!1;63===t&&e.length<6;)e.push(t),t=this.consumeCodePoint(),A=!0;if(A)return{type:30,start:parseInt(c.apply(void 0,e.map(function(e){return 63===e?48:e})),16),end:parseInt(c.apply(void 0,e.map(function(e){return 63===e?70:e})),16)};var n=parseInt(c.apply(void 0,e),16);if(this.peekCodePoint(0)===ae&&ue(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();for(var o=[];ue(t)&&o.length<6;)o.push(t),t=this.consumeCodePoint();return{type:30,start:n,end:parseInt(c.apply(void 0,o),16)}}return{type:30,start:n,end:n}},e.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return"url"===e.toLowerCase()&&40===this.peekCodePoint(0)?(this.consumeCodePoint(),this.consumeUrlToken()):40===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}},e.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===ce)return{type:22,value:""};var t=this.peekCodePoint(0);if(39===t||34===t){var A=this.consumeStringToken(this.consumeCodePoint());return 0===A.type&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===ce||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:22,value:A.value}):(this.consumeBadUrlRemnants(),Ie)}for(;;){var n=this.consumeCodePoint();if(n===ce||41===n)return{type:22,value:c.apply(void 0,e)};if(de(n))return this.consumeWhiteSpace(),this.peekCodePoint(0)===ce||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:22,value:c.apply(void 0,e)}):(this.consumeBadUrlRemnants(),Ie);if(34===n||39===n||40===n||ge(n))return this.consumeBadUrlRemnants(),Ie;if(92===n){if(!fe(n,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),Ie;e.push(this.consumeEscapedCodePoint())}else e.push(n)}},e.prototype.consumeWhiteSpace=function(){for(;de(this.peekCodePoint(0));)this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(41===e||e===ce)return;fe(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},e.prototype.consumeStringSlice=function(e){for(var t="";e>0;){var A=Math.min(5e4,e);t+=c.apply(void 0,this._value.splice(0,A)),e-=A}return this._value.shift(),t},e.prototype.consumeStringToken=function(e){for(var t="",A=0;;){var n=this._value[A];if(n===ce||void 0===n||n===e)return{type:0,value:t+=this.consumeStringSlice(A)};if(10===n)return this._value.splice(0,A),Te;if(92===n){var o=this._value[A+1];o!==ce&&void 0!==o&&(10===o?(t+=this.consumeStringSlice(A),A=-1,this._value.shift()):fe(n,o)&&(t+=this.consumeStringSlice(A),t+=c(this.consumeEscapedCodePoint()),A=-1))}A++}},e.prototype.consumeNumber=function(){var e=[],t=4,A=this.peekCodePoint(0);for(A!==se&&A!==ae||e.push(this.consumeCodePoint());le(this.peekCodePoint(0));)e.push(this.consumeCodePoint());A=this.peekCodePoint(0);var n=this.peekCodePoint(1);if(46===A&&le(n))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;le(this.peekCodePoint(0));)e.push(this.consumeCodePoint());A=this.peekCodePoint(0),n=this.peekCodePoint(1);var o=this.peekCodePoint(2);if((69===A||101===A)&&((n===se||n===ae)&&le(o)||le(n)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;le(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[Be(e),t]},e.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),t=e[0],A=e[1],n=this.peekCodePoint(0),o=this.peekCodePoint(1),r=this.peekCodePoint(2);return me(n,o,r)?{type:15,number:t,flags:A,unit:this.consumeName()}:37===n?(this.consumeCodePoint(),{type:16,number:t,flags:A}):{type:17,number:t,flags:A}},e.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(ue(e)){for(var t=c(e);ue(this.peekCodePoint(0))&&t.length<6;)t+=c(this.consumeCodePoint());de(this.peekCodePoint(0))&&this.consumeCodePoint();var A=parseInt(t,16);return 0===A||function(e){return e>=55296&&e<=57343}(A)||A>1114111?65533:A}return e===ce?65533:e},e.prototype.consumeName=function(){for(var e="";;){var t=this.consumeCodePoint();if(he(t))e+=c(t);else{if(!fe(t,this.peekCodePoint(0)))return this.reconsumeCodePoint(t),e;e+=c(this.consumeEscapedCodePoint())}}},e}(),Ve=function(){function e(e){this._tokens=e}return e.create=function(t){var A=new _e;return A.write(t),new e(A.read())},e.parseValue=function(t){return e.create(t).parseComponentValue()},e.parseValues=function(t){return e.create(t).parseComponentValues()},e.prototype.parseComponentValue=function(){for(var e=this.consumeToken();31===e.type;)e=this.consumeToken();if(32===e.type)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var t=this.consumeComponentValue();do{e=this.consumeToken()}while(31===e.type);if(32===e.type)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},e.prototype.parseComponentValues=function(){for(var e=[];;){var t=this.consumeComponentValue();if(32===t.type)return e;e.push(t),e.push()}},e.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e},e.prototype.consumeSimpleBlock=function(e){for(var t={type:e,values:[]},A=this.consumeToken();;){if(32===A.type||qe(A,e))return t;this.reconsumeToken(A),t.values.push(this.consumeComponentValue()),A=this.consumeToken()}},e.prototype.consumeFunction=function(e){for(var t={name:e.value,values:[],type:18};;){var A=this.consumeToken();if(32===A.type||3===A.type)return t;this.reconsumeToken(A),t.values.push(this.consumeComponentValue())}},e.prototype.consumeToken=function(){var e=this._tokens.shift();return void 0===e?Re:e},e.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},e}(),je=function(e){return 15===e.type},Ne=function(e){return 17===e.type},Ge=function(e){return 20===e.type},We=function(e){return 0===e.type},ze=function(e,t){return Ge(e)&&e.value===t},Xe=function(e){return 31!==e.type},Je=function(e){return 31!==e.type&&4!==e.type},Ye=function(e){var t=[],A=[];return e.forEach(function(e){if(4===e.type){if(0===A.length)throw new Error("Error parsing function args, zero tokens for arg");return t.push(A),void(A=[])}31!==e.type&&A.push(e)}),A.length&&t.push(A),t},qe=function(e,t){return 11===t&&12===e.type||28===t&&29===e.type||2===t&&3===e.type},Ze=function(e){return 17===e.type||15===e.type},$e=function(e){return 16===e.type||Ze(e)},et=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},tt={type:17,number:0,flags:4},At={type:16,number:50,flags:4},nt={type:16,number:100,flags:4},ot=function(e,t,A){var n=e[0],o=e[1];return[rt(n,t),rt(void 0!==o?o:n,A)]},rt=function(e,t){if(16===e.type)return e.number/100*t;if(je(e))switch(e.unit){case"rem":case"em":return 16*e.number;default:return e.number}return e.number},it="grad",at="turn",st=function(e,t){if(15===t.type)switch(t.unit){case"deg":return Math.PI*t.number/180;case it:return Math.PI/200*t.number;case"rad":return t.number;case at:return 2*Math.PI*t.number}throw new Error("Unsupported angle type")},ct=function(e){return 15===e.type&&("deg"===e.unit||e.unit===it||"rad"===e.unit||e.unit===at)},lt=function(e){switch(e.filter(Ge).map(function(e){return e.value}).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[tt,tt];case"to top":case"bottom":return ut(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[tt,nt];case"to right":case"left":return ut(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[nt,nt];case"to bottom":case"top":return ut(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[nt,tt];case"to left":case"right":return ut(270)}return 0},ut=function(e){return Math.PI*e/180},dt=function(e,t){if(18===t.type){var A=wt[t.name];if(void 0===A)throw new Error('Attempting to parse an unsupported color function "'+t.name+'"');return A(e,t.values)}if(5===t.type){if(3===t.value.length){var n=t.value.substring(0,1),o=t.value.substring(1,2),r=t.value.substring(2,3);return gt(parseInt(n+n,16),parseInt(o+o,16),parseInt(r+r,16),1)}if(4===t.value.length){n=t.value.substring(0,1),o=t.value.substring(1,2),r=t.value.substring(2,3);var i=t.value.substring(3,4);return gt(parseInt(n+n,16),parseInt(o+o,16),parseInt(r+r,16),parseInt(i+i,16)/255)}if(6===t.value.length)return n=t.value.substring(0,2),o=t.value.substring(2,4),r=t.value.substring(4,6),gt(parseInt(n,16),parseInt(o,16),parseInt(r,16),1);if(8===t.value.length)return n=t.value.substring(0,2),o=t.value.substring(2,4),r=t.value.substring(4,6),i=t.value.substring(6,8),gt(parseInt(n,16),parseInt(o,16),parseInt(r,16),parseInt(i,16)/255)}if(20===t.type){var a=bt[t.value.toUpperCase()];if(void 0!==a)return a}return bt.TRANSPARENT},pt=function(e){return!(255&e)},ht=function(e){var t=255&e,A=255&e>>8,n=255&e>>16,o=255&e>>24;return t<255?"rgba("+o+","+n+","+A+","+t/255+")":"rgb("+o+","+n+","+A+")"},gt=function(e,t,A,n){return(e<<24|t<<16|A<<8|Math.round(255*n))>>>0},ft=function(e,t){if(17===e.type)return e.number;if(16===e.type){var A=3===t?1:255;return 3===t?e.number/100*A:Math.round(e.number/100*A)}return 0},mt=function(e,t){var A=t.filter(Je);if(3===A.length){var n=A.map(ft),o=n[0],r=n[1],i=n[2];return gt(o,r,i,1)}if(4===A.length){var a=A.map(ft),s=(o=a[0],r=a[1],i=a[2],a[3]);return gt(o,r,i,s)}return 0};function vt(e,t,A){return A<0&&(A+=1),A>=1&&(A-=1),A<1/6?(t-e)*A*6+e:A<.5?t:A<2/3?6*(t-e)*(2/3-A)+e:e}var Bt=function(e,t){var A=t.filter(Je),n=A[0],o=A[1],r=A[2],i=A[3],a=(17===n.type?ut(n.number):st(e,n))/(2*Math.PI),s=$e(o)?o.number/100:0,c=$e(r)?r.number/100:0,l=void 0!==i&&$e(i)?rt(i,1):1;if(0===s)return gt(255*c,255*c,255*c,1);var u=c<=.5?c*(s+1):c+s-c*s,d=2*c-u,p=vt(d,u,a+1/3),h=vt(d,u,a),g=vt(d,u,a-1/3);return gt(255*p,255*h,255*g,l)},wt={hsl:Bt,hsla:Bt,rgb:mt,rgba:mt},yt=function(e,t){return dt(e,Ve.create(t).parseComponentValue())},bt={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},Ct={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map(function(e){if(Ge(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},xt={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Qt=function(e,t){var A=dt(e,t[0]),n=t[1];return n&&$e(n)?{color:A,stop:n}:{color:A,stop:null}},Ft=function(e,t){var A=e[0],n=e[e.length-1];null===A.stop&&(A.stop=tt),null===n.stop&&(n.stop=nt);for(var o=[],r=0,i=0;i<e.length;i++){var a=e[i].stop;if(null!==a){var s=rt(a,t);s>r?o.push(s):o.push(r),r=s}else o.push(null)}var c=null;for(i=0;i<o.length;i++){var l=o[i];if(null===l)null===c&&(c=i);else if(null!==c){for(var u=i-c,d=(l-o[c-1])/(u+1),p=1;p<=u;p++)o[c+p-1]=d*p;c=null}}return e.map(function(e,A){return{color:e.color,stop:Math.max(Math.min(1,o[A]/t),0)}})},Ut=function(e,t,A){var n="number"==typeof e?e:function(e,t,A){var n=t/2,o=A/2,r=rt(e[0],t)-n,i=o-rt(e[1],A);return(Math.atan2(i,r)+2*Math.PI)%(2*Math.PI)}(e,t,A),o=Math.abs(t*Math.sin(n))+Math.abs(A*Math.cos(n)),r=t/2,i=A/2,a=o/2,s=Math.sin(n-Math.PI/2)*a,c=Math.cos(n-Math.PI/2)*a;return[o,r-c,r+c,i-s,i+s]},St=function(e,t){return Math.sqrt(e*e+t*t)},kt=function(e,t,A,n,o){return[[0,0],[0,t],[e,0],[e,t]].reduce(function(e,t){var r=t[0],i=t[1],a=St(A-r,n-i);return(o?a<e.optimumDistance:a>e.optimumDistance)?{optimumCorner:t,optimumDistance:a}:e},{optimumDistance:o?1/0:-1/0,optimumCorner:null}).optimumCorner},Et=function(e,t){var A=ut(180),n=[];return Ye(t).forEach(function(t,o){if(0===o){var r=t[0];if(20===r.type&&-1!==["top","left","right","bottom"].indexOf(r.value))return void(A=lt(t));if(ct(r))return void(A=(st(e,r)+ut(270))%ut(360))}var i=Qt(e,t);n.push(i)}),{angle:A,stops:n,type:1}},It="closest-side",Tt="farthest-side",Ht="closest-corner",Dt="farthest-corner",Pt="circle",Ot="ellipse",Kt="cover",Mt="contain",Lt=function(e,t){var A=0,n=3,o=[],r=[];return Ye(t).forEach(function(t,i){var a=!0;if(0===i?a=t.reduce(function(e,t){if(Ge(t))switch(t.value){case"center":return r.push(At),!1;case"top":case"left":return r.push(tt),!1;case"right":case"bottom":return r.push(nt),!1}else if($e(t)||Ze(t))return r.push(t),!1;return e},a):1===i&&(a=t.reduce(function(e,t){if(Ge(t))switch(t.value){case Pt:return A=0,!1;case Ot:return A=1,!1;case Mt:case It:return n=0,!1;case Tt:return n=1,!1;case Ht:return n=2,!1;case Kt:case Dt:return n=3,!1}else if(Ze(t)||$e(t))return Array.isArray(n)||(n=[]),n.push(t),!1;return e},a)),a){var s=Qt(e,t);o.push(s)}}),{size:n,shape:A,stops:o,position:r,type:2}},Rt=function(e,t){if(22===t.type){var A={url:t.value,type:0};return e.cache.addImage(t.value),A}if(18===t.type){var n=Vt[t.name];if(void 0===n)throw new Error('Attempting to parse an unsupported image function "'+t.name+'"');return n(e,t.values)}throw new Error("Unsupported image type "+t.type)};var _t,Vt={"linear-gradient":function(e,t){var A=ut(180),n=[];return Ye(t).forEach(function(t,o){if(0===o){var r=t[0];if(20===r.type&&"to"===r.value)return void(A=lt(t));if(ct(r))return void(A=st(e,r))}var i=Qt(e,t);n.push(i)}),{angle:A,stops:n,type:1}},"-moz-linear-gradient":Et,"-ms-linear-gradient":Et,"-o-linear-gradient":Et,"-webkit-linear-gradient":Et,"radial-gradient":function(e,t){var A=0,n=3,o=[],r=[];return Ye(t).forEach(function(t,i){var a=!0;if(0===i){var s=!1;a=t.reduce(function(e,t){if(s)if(Ge(t))switch(t.value){case"center":return r.push(At),e;case"top":case"left":return r.push(tt),e;case"right":case"bottom":return r.push(nt),e}else($e(t)||Ze(t))&&r.push(t);else if(Ge(t))switch(t.value){case Pt:return A=0,!1;case Ot:return A=1,!1;case"at":return s=!0,!1;case It:return n=0,!1;case Kt:case Tt:return n=1,!1;case Mt:case Ht:return n=2,!1;case Dt:return n=3,!1}else if(Ze(t)||$e(t))return Array.isArray(n)||(n=[]),n.push(t),!1;return e},a)}if(a){var c=Qt(e,t);o.push(c)}}),{size:n,shape:A,stops:o,position:r,type:2}},"-moz-radial-gradient":Lt,"-ms-radial-gradient":Lt,"-o-radial-gradient":Lt,"-webkit-radial-gradient":Lt,"-webkit-gradient":function(e,t){var A=ut(180),n=[],o=1;return Ye(t).forEach(function(t,A){var r=t[0];if(0===A){if(Ge(r)&&"linear"===r.value)return void(o=1);if(Ge(r)&&"radial"===r.value)return void(o=2)}if(18===r.type)if("from"===r.name){var i=dt(e,r.values[0]);n.push({stop:tt,color:i})}else if("to"===r.name)i=dt(e,r.values[0]),n.push({stop:nt,color:i});else if("color-stop"===r.name){var a=r.values.filter(Je);if(2===a.length){i=dt(e,a[1]);var s=a[0];Ne(s)&&n.push({stop:{type:16,number:100*s.number,flags:s.flags},color:i})}}}),1===o?{angle:(A+ut(180))%ut(360),stops:n,type:o}:{size:3,shape:0,stops:n,position:[],type:o}}},jt={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(0===t.length)return[];var A=t[0];return 20===A.type&&"none"===A.value?[]:t.filter(function(e){return Je(e)&&function(e){return!(20===e.type&&"none"===e.value||18===e.type&&!Vt[e.name])}(e)}).map(function(t){return Rt(e,t)})}},Nt={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map(function(e){if(Ge(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Gt={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(e,t){return Ye(t).map(function(e){return e.filter($e)}).map(et)}},Wt={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(e,t){return Ye(t).map(function(e){return e.filter(Ge).map(function(e){return e.value}).join(" ")}).map(zt)}},zt=function(e){switch(e){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}};!function(e){e.AUTO="auto",e.CONTAIN="contain",e.COVER="cover"}(_t||(_t={}));var Xt,Jt={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(e,t){return Ye(t).map(function(e){return e.filter(Yt)})}},Yt=function(e){return Ge(e)||$e(e)},qt=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},Zt=qt("top"),$t=qt("right"),eA=qt("bottom"),tA=qt("left"),AA=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:1,parse:function(e,t){return et(t.filter($e))}}},nA=AA("top-left"),oA=AA("top-right"),rA=AA("bottom-right"),iA=AA("bottom-left"),aA=function(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(e,t){switch(t){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},sA=aA("top"),cA=aA("right"),lA=aA("bottom"),uA=aA("left"),dA=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return je(t)?t.number:0}}},pA=dA("top"),hA=dA("right"),gA=dA("bottom"),fA=dA("left"),mA={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},vA={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(e,t){return"rtl"===t?1:0}},BA={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(e,t){return t.filter(Ge).reduce(function(e,t){return e|wA(t.value)},0)}},wA=function(e){switch(e){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},yA={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},bA={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(e,t){return 20===t.type&&"normal"===t.value?0:17===t.type||15===t.type?t.number:0}};!function(e){e.NORMAL="normal",e.STRICT="strict"}(Xt||(Xt={}));var CA,xA={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){return"strict"===t?Xt.STRICT:Xt.NORMAL}},QA={name:"line-height",initialValue:"normal",prefix:!1,type:4},FA=function(e,t){return Ge(e)&&"normal"===e.value?1.2*t:17===e.type?t*e.number:$e(e)?rt(e,t):t},UA={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(e,t){return 20===t.type&&"none"===t.value?null:Rt(e,t)}},SA={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(e,t){return"inside"===t?0:1}},kA={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},EA=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:4}},IA=EA("top"),TA=EA("right"),HA=EA("bottom"),DA=EA("left"),PA={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(e,t){return t.filter(Ge).map(function(e){switch(e.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}})}},OA={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){return"break-word"===t?"break-word":"normal"}},KA=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},MA=KA("top"),LA=KA("right"),RA=KA("bottom"),_A=KA("left"),VA={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(e,t){switch(t){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},jA={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(e,t){switch(t){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},NA={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return 1===t.length&&ze(t[0],"none")?[]:Ye(t).map(function(t){for(var A={color:bt.TRANSPARENT,offsetX:tt,offsetY:tt,blur:tt},n=0,o=0;o<t.length;o++){var r=t[o];Ze(r)?(0===n?A.offsetX=r:1===n?A.offsetY=r:A.blur=r,n++):A.color=dt(e,r)}return A})}},GA={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},WA={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(e,t){if(20===t.type&&"none"===t.value)return null;if(18===t.type){var A=zA[t.name];if(void 0===A)throw new Error('Attempting to parse an unsupported transform function "'+t.name+'"');return A(t.values)}return null}},zA={matrix:function(e){var t=e.filter(function(e){return 17===e.type}).map(function(e){return e.number});return 6===t.length?t:null},matrix3d:function(e){var t=e.filter(function(e){return 17===e.type}).map(function(e){return e.number}),A=t[0],n=t[1];t[2],t[3];var o=t[4],r=t[5];t[6],t[7],t[8],t[9],t[10],t[11];var i=t[12],a=t[13];return t[14],t[15],16===t.length?[A,n,o,r,i,a]:null}},XA={type:16,number:50,flags:4},JA=[XA,XA],YA={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(e,t){var A=t.filter($e);return 2!==A.length?JA:[A[0],A[1]]}},qA={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"hidden":return 1;case"collapse":return 2;default:return 0}}};!function(e){e.NORMAL="normal",e.BREAK_ALL="break-all",e.KEEP_ALL="keep-all"}(CA||(CA={}));for(var ZA={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"break-all":return CA.BREAK_ALL;case"keep-all":return CA.KEEP_ALL;default:return CA.NORMAL}}},$A={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(e,t){if(20===t.type)return{auto:!0,order:0};if(Ne(t))return{auto:!1,order:t.number};throw new Error("Invalid z-index number parsed")}},en={name:"time",parse:function(e,t){if(15===t.type)switch(t.unit.toLowerCase()){case"s":return 1e3*t.number;case"ms":return t.number}throw new Error("Unsupported time type")}},tn={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(e,t){return Ne(t)?t.number:1}},An={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},nn={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(e,t){return t.filter(Ge).map(function(e){switch(e.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(e){return 0!==e})}},on={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(e,t){var A=[],n=[];return t.forEach(function(e){switch(e.type){case 20:case 0:A.push(e.value);break;case 17:A.push(e.number.toString());break;case 4:n.push(A.join(" ")),A.length=0}}),A.length&&n.push(A.join(" ")),n.map(function(e){return-1===e.indexOf(" ")?e:"'"+e+"'"})}},rn={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},an={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(e,t){return Ne(t)?t.number:Ge(t)&&"bold"===t.value?700:400}},sn={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.filter(Ge).map(function(e){return e.value})}},cn={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},ln=function(e,t){return 0!==(e&t)},un={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(0===t.length)return[];var A=t[0];return 20===A.type&&"none"===A.value?[]:t}},dn={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return null;var A=t[0];if(20===A.type&&"none"===A.value)return null;for(var n=[],o=t.filter(Xe),r=0;r<o.length;r++){var i=o[r],a=o[r+1];if(20===i.type){var s=a&&Ne(a)?a.number:1;n.push({counter:i.value,increment:s})}}return n}},pn={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return[];for(var A=[],n=t.filter(Xe),o=0;o<n.length;o++){var r=n[o],i=n[o+1];if(Ge(r)&&"none"!==r.value){var a=i&&Ne(i)?i.number:0;A.push({counter:r.value,reset:a})}}return A}},hn={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(e,t){return t.filter(je).map(function(t){return en.parse(e,t)})}},gn={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return null;var A=t[0];if(20===A.type&&"none"===A.value)return null;var n=[],o=t.filter(We);if(o.length%2!=0)return null;for(var r=0;r<o.length;r+=2){var i=o[r].value,a=o[r+1].value;n.push({open:i,close:a})}return n}},fn=function(e,t,A){if(!e)return"";var n=e[Math.min(t,e.length-1)];return n?A?n.open:n.close:""},mn={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return 1===t.length&&ze(t[0],"none")?[]:Ye(t).map(function(t){for(var A={color:255,offsetX:tt,offsetY:tt,blur:tt,spread:tt,inset:!1},n=0,o=0;o<t.length;o++){var r=t[o];ze(r,"inset")?A.inset=!0:Ze(r)?(0===n?A.offsetX=r:1===n?A.offsetY=r:2===n?A.blur=r:A.spread=r,n++):A.color=dt(e,r)}return A})}},vn={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(e,t){var A=[];return t.filter(Ge).forEach(function(e){switch(e.value){case"stroke":A.push(1);break;case"fill":A.push(0);break;case"markers":A.push(2)}}),[0,1,2].forEach(function(e){-1===A.indexOf(e)&&A.push(e)}),A}},Bn={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},wn={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return je(t)?t.number:0}},yn=function(){function e(e,t){var A,n;this.animationDuration=xn(e,hn,t.animationDuration),this.backgroundClip=xn(e,Ct,t.backgroundClip),this.backgroundColor=xn(e,xt,t.backgroundColor),this.backgroundImage=xn(e,jt,t.backgroundImage),this.backgroundOrigin=xn(e,Nt,t.backgroundOrigin),this.backgroundPosition=xn(e,Gt,t.backgroundPosition),this.backgroundRepeat=xn(e,Wt,t.backgroundRepeat),this.backgroundSize=xn(e,Jt,t.backgroundSize),this.borderTopColor=xn(e,Zt,t.borderTopColor),this.borderRightColor=xn(e,$t,t.borderRightColor),this.borderBottomColor=xn(e,eA,t.borderBottomColor),this.borderLeftColor=xn(e,tA,t.borderLeftColor),this.borderTopLeftRadius=xn(e,nA,t.borderTopLeftRadius),this.borderTopRightRadius=xn(e,oA,t.borderTopRightRadius),this.borderBottomRightRadius=xn(e,rA,t.borderBottomRightRadius),this.borderBottomLeftRadius=xn(e,iA,t.borderBottomLeftRadius),this.borderTopStyle=xn(e,sA,t.borderTopStyle),this.borderRightStyle=xn(e,cA,t.borderRightStyle),this.borderBottomStyle=xn(e,lA,t.borderBottomStyle),this.borderLeftStyle=xn(e,uA,t.borderLeftStyle),this.borderTopWidth=xn(e,pA,t.borderTopWidth),this.borderRightWidth=xn(e,hA,t.borderRightWidth),this.borderBottomWidth=xn(e,gA,t.borderBottomWidth),this.borderLeftWidth=xn(e,fA,t.borderLeftWidth),this.boxShadow=xn(e,mn,t.boxShadow),this.color=xn(e,mA,t.color),this.direction=xn(e,vA,t.direction),this.display=xn(e,BA,t.display),this.float=xn(e,yA,t.cssFloat),this.fontFamily=xn(e,on,t.fontFamily),this.fontSize=xn(e,rn,t.fontSize),this.fontStyle=xn(e,cn,t.fontStyle),this.fontVariant=xn(e,sn,t.fontVariant),this.fontWeight=xn(e,an,t.fontWeight),this.letterSpacing=xn(e,bA,t.letterSpacing),this.lineBreak=xn(e,xA,t.lineBreak),this.lineHeight=xn(e,QA,t.lineHeight),this.listStyleImage=xn(e,UA,t.listStyleImage),this.listStylePosition=xn(e,SA,t.listStylePosition),this.listStyleType=xn(e,kA,t.listStyleType),this.marginTop=xn(e,IA,t.marginTop),this.marginRight=xn(e,TA,t.marginRight),this.marginBottom=xn(e,HA,t.marginBottom),this.marginLeft=xn(e,DA,t.marginLeft),this.opacity=xn(e,tn,t.opacity);var o=xn(e,PA,t.overflow);this.overflowX=o[0],this.overflowY=o[o.length>1?1:0],this.overflowWrap=xn(e,OA,t.overflowWrap),this.paddingTop=xn(e,MA,t.paddingTop),this.paddingRight=xn(e,LA,t.paddingRight),this.paddingBottom=xn(e,RA,t.paddingBottom),this.paddingLeft=xn(e,_A,t.paddingLeft),this.paintOrder=xn(e,vn,t.paintOrder),this.position=xn(e,jA,t.position),this.textAlign=xn(e,VA,t.textAlign),this.textDecorationColor=xn(e,An,null!==(A=t.textDecorationColor)&&void 0!==A?A:t.color),this.textDecorationLine=xn(e,nn,null!==(n=t.textDecorationLine)&&void 0!==n?n:t.textDecoration),this.textShadow=xn(e,NA,t.textShadow),this.textTransform=xn(e,GA,t.textTransform),this.transform=xn(e,WA,t.transform),this.transformOrigin=xn(e,YA,t.transformOrigin),this.visibility=xn(e,qA,t.visibility),this.webkitTextStrokeColor=xn(e,Bn,t.webkitTextStrokeColor),this.webkitTextStrokeWidth=xn(e,wn,t.webkitTextStrokeWidth),this.wordBreak=xn(e,ZA,t.wordBreak),this.zIndex=xn(e,$A,t.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},e.prototype.isTransparent=function(){return pt(this.backgroundColor)},e.prototype.isTransformed=function(){return null!==this.transform},e.prototype.isPositioned=function(){return 0!==this.position},e.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},e.prototype.isFloating=function(){return 0!==this.float},e.prototype.isInlineLevel=function(){return ln(this.display,4)||ln(this.display,33554432)||ln(this.display,268435456)||ln(this.display,536870912)||ln(this.display,67108864)||ln(this.display,134217728)},e}(),bn=function(e,t){this.content=xn(e,un,t.content),this.quotes=xn(e,gn,t.quotes)},Cn=function(e,t){this.counterIncrement=xn(e,dn,t.counterIncrement),this.counterReset=xn(e,pn,t.counterReset)},xn=function(e,t,A){var n=new _e,o=null!=A?A.toString():t.initialValue;n.write(o);var r=new Ve(n.read());switch(t.type){case 2:var i=r.parseComponentValue();return t.parse(e,Ge(i)?i.value:t.initialValue);case 0:return t.parse(e,r.parseComponentValue());case 1:return t.parse(e,r.parseComponentValues());case 4:return r.parseComponentValue();case 3:switch(t.format){case"angle":return st(e,r.parseComponentValue());case"color":return dt(e,r.parseComponentValue());case"image":return Rt(e,r.parseComponentValue());case"length":var a=r.parseComponentValue();return Ze(a)?a:tt;case"length-percentage":var s=r.parseComponentValue();return $e(s)?s:tt;case"time":return en.parse(e,r.parseComponentValue())}}},Qn=function(e,t){var A=function(e){switch(e.getAttribute("data-html2canvas-debug")){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}}(e);return 1===A||t===A},Fn=function(e,t){this.context=e,this.textNodes=[],this.elements=[],this.flags=0,Qn(t,3),this.styles=new yn(e,window.getComputedStyle(t,null)),Io(t)&&(this.styles.animationDuration.some(function(e){return e>0})&&(t.style.animationDuration="0s"),null!==this.styles.transform&&(t.style.transform="none")),this.bounds=a(this.context,t),Qn(t,4)&&(this.flags|=16)},Un="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Sn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),kn=0;kn<64;kn++)Sn[Un.charCodeAt(kn)]=kn;for(var En=function(e,t,A){return e.slice?e.slice(t,A):new Uint16Array(Array.prototype.slice.call(e,t,A))},In=function(){function e(e,t,A,n,o,r){this.initialValue=e,this.errorValue=t,this.highStart=A,this.highValueIndex=n,this.index=o,this.data=r}return e.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>5])<<2)+(31&e),this.data[t];if(e<=65535)return t=((t=this.index[2048+(e-55296>>5)])<<2)+(31&e),this.data[t];if(e<this.highStart)return t=2080+(e>>11),t=this.index[t],t+=e>>5&63,t=((t=this.index[t])<<2)+(31&e),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),Tn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Hn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Dn=0;Dn<64;Dn++)Hn[Tn.charCodeAt(Dn)]=Dn;var Pn,On=8,Kn=9,Mn=11,Ln=12,Rn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var A=e.length;if(!A)return"";for(var n=[],o=-1,r="";++o<A;){var i=e[o];i<=65535?n.push(i):(i-=65536,n.push(55296+(i>>10),i%1024+56320)),(o+1===A||n.length>16384)&&(r+=String.fromCharCode.apply(String,n),n.length=0)}return r},_n=function(e){var t,A,n,o=function(e){var t,A,n,o,r,i=.75*e.length,a=e.length,s=0;"="===e[e.length-1]&&(i--,"="===e[e.length-2]&&i--);var c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(i):new Array(i),l=Array.isArray(c)?c:new Uint8Array(c);for(t=0;t<a;t+=4)A=Sn[e.charCodeAt(t)],n=Sn[e.charCodeAt(t+1)],o=Sn[e.charCodeAt(t+2)],r=Sn[e.charCodeAt(t+3)],l[s++]=A<<2|n>>4,l[s++]=(15&n)<<4|o>>2,l[s++]=(3&o)<<6|63&r;return c}(e),r=Array.isArray(o)?function(e){for(var t=e.length,A=[],n=0;n<t;n+=4)A.push(e[n+3]<<24|e[n+2]<<16|e[n+1]<<8|e[n]);return A}(o):new Uint32Array(o),i=Array.isArray(o)?function(e){for(var t=e.length,A=[],n=0;n<t;n+=2)A.push(e[n+1]<<8|e[n]);return A}(o):new Uint16Array(o),a=En(i,12,r[4]/2),s=2===r[5]?En(i,(24+r[4])/2):(t=r,A=Math.ceil((24+r[4])/4),t.slice?t.slice(A,n):new Uint32Array(Array.prototype.slice.call(t,A,n)));return new In(r[0],r[1],r[2],r[3],a,s)}("AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA="),Vn="×",jn=function(e){return _n.get(e)},Nn=function(e,t,A){var n=A-2,o=t[n],r=t[A-1],i=t[A];if(2===r&&3===i)return Vn;if(2===r||3===r||4===r)return"÷";if(2===i||3===i||4===i)return"÷";if(r===On&&-1!==[On,Kn,Mn,Ln].indexOf(i))return Vn;if(!(r!==Mn&&r!==Kn||i!==Kn&&10!==i))return Vn;if((r===Ln||10===r)&&10===i)return Vn;if(13===i||5===i)return Vn;if(7===i)return Vn;if(1===r)return Vn;if(13===r&&14===i){for(;5===o;)o=t[--n];if(14===o)return Vn}if(15===r&&15===i){for(var a=0;15===o;)a++,o=t[--n];if(a%2==0)return Vn}return"÷"},Gn=function(e){var t=function(e){for(var t=[],A=0,n=e.length;A<n;){var o=e.charCodeAt(A++);if(o>=55296&&o<=56319&&A<n){var r=e.charCodeAt(A++);56320==(64512&r)?t.push(((1023&o)<<10)+(1023&r)+65536):(t.push(o),A--)}else t.push(o)}return t}(e),A=t.length,n=0,o=0,r=t.map(jn);return{next:function(){if(n>=A)return{done:!0,value:null};for(var e=Vn;n<A&&(e=Nn(0,r,++n))===Vn;);if(e!==Vn||n===A){var i=Rn.apply(null,t.slice(o,n));return o=n,{value:i,done:!1}}return{done:!0,value:null}}}},Wn=function(e){return 0===e[0]&&255===e[1]&&0===e[2]&&255===e[3]},zn=function(e,t,A,n,o){var r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),a=document.createElementNS(r,"foreignObject");return i.setAttributeNS(null,"width",e.toString()),i.setAttributeNS(null,"height",t.toString()),a.setAttributeNS(null,"width","100%"),a.setAttributeNS(null,"height","100%"),a.setAttributeNS(null,"x",A.toString()),a.setAttributeNS(null,"y",n.toString()),a.setAttributeNS(null,"externalResourcesRequired","true"),i.appendChild(a),a.appendChild(o),i},Xn=function(e){return new Promise(function(t,A){var n=new Image;n.onload=function(){return t(n)},n.onerror=A,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))})},Jn={get SUPPORT_RANGE_BOUNDS(){var e=function(e){if(e.createRange){var t=e.createRange();if(t.getBoundingClientRect){var A=e.createElement("boundtest");A.style.height="123px",A.style.display="block",e.body.appendChild(A),t.selectNode(A);var n=t.getBoundingClientRect(),o=Math.round(n.height);if(e.body.removeChild(A),123===o)return!0}}return!1}(document);return Object.defineProperty(Jn,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_WORD_BREAKING(){var e=Jn.SUPPORT_RANGE_BOUNDS&&function(e){var t=e.createElement("boundtest");t.style.width="50px",t.style.display="block",t.style.fontSize="12px",t.style.letterSpacing="0px",t.style.wordSpacing="0px",e.body.appendChild(t);var A=e.createRange();t.innerHTML="function"==typeof"".repeat?"👨".repeat(10):"";var n=t.firstChild,o=s(n.data).map(function(e){return c(e)}),r=0,i={},a=o.every(function(e,t){A.setStart(n,r),A.setEnd(n,r+e.length);var o=A.getBoundingClientRect();r+=e.length;var a=o.x>i.x||o.y>i.y;return i=o,0===t||a});return e.body.removeChild(t),a}(document);return Object.defineProperty(Jn,"SUPPORT_WORD_BREAKING",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=function(e){var t=new Image,A=e.createElement("canvas"),n=A.getContext("2d");if(!n)return!1;t.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{n.drawImage(t,0,0),A.toDataURL()}catch(e){return!1}return!0}(document);return Object.defineProperty(Jn,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e="function"==typeof Array.from&&"function"==typeof window.fetch?function(e){var t=e.createElement("canvas"),A=100;t.width=A,t.height=A;var n=t.getContext("2d");if(!n)return Promise.reject(!1);n.fillStyle="rgb(0, 255, 0)",n.fillRect(0,0,A,A);var o=new Image,r=t.toDataURL();o.src=r;var i=zn(A,A,0,0,o);return n.fillStyle="red",n.fillRect(0,0,A,A),Xn(i).then(function(t){n.drawImage(t,0,0);var o=n.getImageData(0,0,A,A).data;n.fillStyle="red",n.fillRect(0,0,A,A);var i=e.createElement("div");return i.style.backgroundImage="url("+r+")",i.style.height=A+"px",Wn(o)?Xn(zn(A,A,0,0,i)):Promise.reject(!1)}).then(function(e){return n.drawImage(e,0,0),Wn(n.getImageData(0,0,A,A).data)}).catch(function(){return!1})}(document):Promise.resolve(!1);return Object.defineProperty(Jn,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=void 0!==(new Image).crossOrigin;return Object.defineProperty(Jn,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(Jn,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Jn,"SUPPORT_CORS_XHR",{value:e}),e},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var e=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(Jn,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:e}),e}},Yn=function(e,t){this.text=e,this.bounds=t},qn=function(e,t){var A=t.ownerDocument;if(A){var n=A.createElement("html2canvaswrapper");n.appendChild(t.cloneNode(!0));var o=t.parentNode;if(o){o.replaceChild(n,t);var r=a(e,n);return n.firstChild&&o.replaceChild(n.firstChild,n),r}}return i.EMPTY},Zn=function(e,t,A){var n=e.ownerDocument;if(!n)throw new Error("Node has no owner document");var o=n.createRange();return o.setStart(e,t),o.setEnd(e,t+A),o},$n=function(e){if(Jn.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(t.segment(e)).map(function(e){return e.segment})}return function(e){for(var t,A=Gn(e),n=[];!(t=A.next()).done;)t.value&&n.push(t.value.slice());return n}(e)},eo=function(e,t){return 0!==t.letterSpacing?$n(e):function(e,t){if(Jn.SUPPORT_NATIVE_TEXT_SEGMENTATION){var A=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(A.segment(e)).map(function(e){return e.segment})}return Ao(e,t)}(e,t)},to=[32,160,4961,65792,65793,4153,4241],Ao=function(e,t){for(var A,n=function(e,t){var A=s(e),n=re(A,t),o=n[0],r=n[1],i=n[2],a=A.length,c=0,l=0;return{next:function(){if(l>=a)return{done:!0,value:null};for(var e=W;l<a&&(e=oe(A,r,o,++l,i))===W;);if(e!==W||l===a){var t=new ie(A,e,c,l);return c=l,{value:t,done:!1}}return{done:!0,value:null}}}}(e,{lineBreak:t.lineBreak,wordBreak:"break-word"===t.overflowWrap?"break-word":t.wordBreak}),o=[],r=function(){if(A.value){var e=A.value.slice(),t=s(e),n="";t.forEach(function(e){-1===to.indexOf(e)?n+=c(e):(n.length&&o.push(n),o.push(c(e)),n="")}),n.length&&o.push(n)}};!(A=n.next()).done;)r();return o},no=function(e,t,A){this.text=oo(t.data,A.textTransform),this.textBounds=function(e,t,A,n){var o=eo(t,A),r=[],a=0;return o.forEach(function(t){if(A.textDecorationLine.length||t.trim().length>0)if(Jn.SUPPORT_RANGE_BOUNDS){var o=Zn(n,a,t.length).getClientRects();if(o.length>1){var s=$n(t),c=0;s.forEach(function(t){r.push(new Yn(t,i.fromDOMRectList(e,Zn(n,c+a,t.length).getClientRects()))),c+=t.length})}else r.push(new Yn(t,i.fromDOMRectList(e,o)))}else{var l=n.splitText(t.length);r.push(new Yn(t,qn(e,n))),n=l}else Jn.SUPPORT_RANGE_BOUNDS||(n=n.splitText(t.length));a+=t.length}),r}(e,this.text,A,t)},oo=function(e,t){switch(t){case 1:return e.toLowerCase();case 3:return e.replace(ro,io);case 2:return e.toUpperCase();default:return e}},ro=/(^|\s|:|-|\(|\))([a-z])/g,io=function(e,t,A){return e.length>0?t+A.toUpperCase():e},ao=function(e){function A(t,A){var n=e.call(this,t,A)||this;return n.src=A.currentSrc||A.src,n.intrinsicWidth=A.naturalWidth,n.intrinsicHeight=A.naturalHeight,n.context.cache.addImage(n.src),n}return t(A,e),A}(Fn),so=function(e){function A(t,A){var n=e.call(this,t,A)||this;return n.canvas=A,n.intrinsicWidth=A.width,n.intrinsicHeight=A.height,n}return t(A,e),A}(Fn),co=function(e){function A(t,A){var n=e.call(this,t,A)||this,o=new XMLSerializer,r=a(t,A);return A.setAttribute("width",r.width+"px"),A.setAttribute("height",r.height+"px"),n.svg="data:image/svg+xml,"+encodeURIComponent(o.serializeToString(A)),n.intrinsicWidth=A.width.baseVal.value,n.intrinsicHeight=A.height.baseVal.value,n.context.cache.addImage(n.svg),n}return t(A,e),A}(Fn),lo=function(e){function A(t,A){var n=e.call(this,t,A)||this;return n.value=A.value,n}return t(A,e),A}(Fn),uo=function(e){function A(t,A){var n=e.call(this,t,A)||this;return n.start=A.start,n.reversed="boolean"==typeof A.reversed&&!0===A.reversed,n}return t(A,e),A}(Fn),po=[{type:15,flags:0,unit:"px",number:3}],ho=[{type:16,flags:0,number:50}],go="checkbox",fo="radio",mo="password",vo=707406591,Bo=function(e){function A(t,A){var n,o,r,a=e.call(this,t,A)||this;switch(a.type=A.type.toLowerCase(),a.checked=A.checked,a.value=0===(r=(o=A).type===mo?new Array(o.value.length+1).join("•"):o.value).length?o.placeholder||"":r,a.type!==go&&a.type!==fo||(a.styles.backgroundColor=3739148031,a.styles.borderTopColor=a.styles.borderRightColor=a.styles.borderBottomColor=a.styles.borderLeftColor=2779096575,a.styles.borderTopWidth=a.styles.borderRightWidth=a.styles.borderBottomWidth=a.styles.borderLeftWidth=1,a.styles.borderTopStyle=a.styles.borderRightStyle=a.styles.borderBottomStyle=a.styles.borderLeftStyle=1,a.styles.backgroundClip=[0],a.styles.backgroundOrigin=[0],a.bounds=(n=a.bounds).width>n.height?new i(n.left+(n.width-n.height)/2,n.top,n.height,n.height):n.width<n.height?new i(n.left,n.top+(n.height-n.width)/2,n.width,n.width):n),a.type){case go:a.styles.borderTopRightRadius=a.styles.borderTopLeftRadius=a.styles.borderBottomRightRadius=a.styles.borderBottomLeftRadius=po;break;case fo:a.styles.borderTopRightRadius=a.styles.borderTopLeftRadius=a.styles.borderBottomRightRadius=a.styles.borderBottomLeftRadius=ho}return a}return t(A,e),A}(Fn),wo=function(e){function A(t,A){var n=e.call(this,t,A)||this,o=A.options[A.selectedIndex||0];return n.value=o&&o.text||"",n}return t(A,e),A}(Fn),yo=function(e){function A(t,A){var n=e.call(this,t,A)||this;return n.value=A.value,n}return t(A,e),A}(Fn),bo=function(e){function A(t,A){var n=e.call(this,t,A)||this;n.src=A.src,n.width=parseInt(A.width,10)||0,n.height=parseInt(A.height,10)||0,n.backgroundColor=n.styles.backgroundColor;try{if(A.contentWindow&&A.contentWindow.document&&A.contentWindow.document.documentElement){n.tree=Fo(t,A.contentWindow.document.documentElement);var o=A.contentWindow.document.documentElement?yt(t,getComputedStyle(A.contentWindow.document.documentElement).backgroundColor):bt.TRANSPARENT,r=A.contentWindow.document.body?yt(t,getComputedStyle(A.contentWindow.document.body).backgroundColor):bt.TRANSPARENT;n.backgroundColor=pt(o)?pt(r)?n.styles.backgroundColor:r:o}}catch(e){}return n}return t(A,e),A}(Fn),Co=["OL","UL","MENU"],xo=function(e,t,A,n){for(var o=t.firstChild,r=void 0;o;o=r)if(r=o.nextSibling,ko(o)&&o.data.trim().length>0)A.textNodes.push(new no(e,o,A.styles));else if(Eo(o))if(Go(o)&&o.assignedNodes)o.assignedNodes().forEach(function(t){return xo(e,t,A,n)});else{var i=Qo(e,o);i.styles.isVisible()&&(Uo(o,i,n)?i.flags|=4:So(i.styles)&&(i.flags|=2),-1!==Co.indexOf(o.tagName)&&(i.flags|=8),A.elements.push(i),o.slot,o.shadowRoot?xo(e,o.shadowRoot,i,n):jo(o)||Oo(o)||No(o)||xo(e,o,i,n))}},Qo=function(e,t){return Ro(t)?new ao(e,t):Mo(t)?new so(e,t):Oo(t)?new co(e,t):Ho(t)?new lo(e,t):Do(t)?new uo(e,t):Po(t)?new Bo(e,t):No(t)?new wo(e,t):jo(t)?new yo(e,t):_o(t)?new bo(e,t):new Fn(e,t)},Fo=function(e,t){var A=Qo(e,t);return A.flags|=4,xo(e,t,A,A),A},Uo=function(e,t,A){return t.styles.isPositionedWithZIndex()||t.styles.opacity<1||t.styles.isTransformed()||Ko(e)&&A.styles.isTransparent()},So=function(e){return e.isPositioned()||e.isFloating()},ko=function(e){return e.nodeType===Node.TEXT_NODE},Eo=function(e){return e.nodeType===Node.ELEMENT_NODE},Io=function(e){return Eo(e)&&void 0!==e.style&&!To(e)},To=function(e){return"object"==typeof e.className},Ho=function(e){return"LI"===e.tagName},Do=function(e){return"OL"===e.tagName},Po=function(e){return"INPUT"===e.tagName},Oo=function(e){return"svg"===e.tagName},Ko=function(e){return"BODY"===e.tagName},Mo=function(e){return"CANVAS"===e.tagName},Lo=function(e){return"VIDEO"===e.tagName},Ro=function(e){return"IMG"===e.tagName},_o=function(e){return"IFRAME"===e.tagName},Vo=function(e){return"STYLE"===e.tagName},jo=function(e){return"TEXTAREA"===e.tagName},No=function(e){return"SELECT"===e.tagName},Go=function(e){return"SLOT"===e.tagName},Wo=function(e){return e.tagName.indexOf("-")>0},zo=function(){function e(){this.counters={}}return e.prototype.getCounterValue=function(e){var t=this.counters[e];return t&&t.length?t[t.length-1]:1},e.prototype.getCounterValues=function(e){return this.counters[e]||[]},e.prototype.pop=function(e){var t=this;e.forEach(function(e){return t.counters[e].pop()})},e.prototype.parse=function(e){var t=this,A=e.counterIncrement,n=e.counterReset,o=!0;null!==A&&A.forEach(function(e){var A=t.counters[e.counter];A&&0!==e.increment&&(o=!1,A.length||A.push(1),A[Math.max(0,A.length-1)]+=e.increment)});var r=[];return o&&n.forEach(function(e){var A=t.counters[e.counter];r.push(e.counter),A||(A=t.counters[e.counter]=[]),A.push(e.reset)}),r},e}(),Xo={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},Jo={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},Yo={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},qo={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},Zo=function(e,t,A,n,o,r){return e<t||e>A?ar(e,o,r.length>0):n.integers.reduce(function(t,A,o){for(;e>=A;)e-=A,t+=n.values[o];return t},"")+r},$o=function(e,t,A,n){var o="";do{A||e--,o=n(e)+o,e/=t}while(e*t>=t);return o},er=function(e,t,A,n,o){var r=A-t+1;return(e<0?"-":"")+($o(Math.abs(e),r,n,function(e){return c(Math.floor(e%r)+t)})+o)},tr=function(e,t,A){void 0===A&&(A=". ");var n=t.length;return $o(Math.abs(e),n,!1,function(e){return t[Math.floor(e%n)]})+A},Ar=function(e,t,A,n,o,r){if(e<-9999||e>9999)return ar(e,4,o.length>0);var i=Math.abs(e),a=o;if(0===i)return t[0]+a;for(var s=0;i>0&&s<=4;s++){var c=i%10;0===c&&ln(r,1)&&""!==a?a=t[c]+a:c>1||1===c&&0===s||1===c&&1===s&&ln(r,2)||1===c&&1===s&&ln(r,4)&&e>100||1===c&&s>1&&ln(r,8)?a=t[c]+(s>0?A[s-1]:"")+a:1===c&&s>0&&(a=A[s-1]+a),i=Math.floor(i/10)}return(e<0?n:"")+a},nr="十百千萬",or="拾佰仟萬",rr="マイナス",ir="마이너스",ar=function(e,t,A){var n=A?". ":"",o=A?"、":"",r=A?", ":"",i=A?" ":"";switch(t){case 0:return"•"+i;case 1:return"◦"+i;case 2:return"◾"+i;case 5:var a=er(e,48,57,!0,n);return a.length<4?"0"+a:a;case 4:return tr(e,"〇一二三四五六七八九",o);case 6:return Zo(e,1,3999,Xo,3,n).toLowerCase();case 7:return Zo(e,1,3999,Xo,3,n);case 8:return er(e,945,969,!1,n);case 9:return er(e,97,122,!1,n);case 10:return er(e,65,90,!1,n);case 11:return er(e,1632,1641,!0,n);case 12:case 49:return Zo(e,1,9999,Jo,3,n);case 35:return Zo(e,1,9999,Jo,3,n).toLowerCase();case 13:return er(e,2534,2543,!0,n);case 14:case 30:return er(e,6112,6121,!0,n);case 15:return tr(e,"子丑寅卯辰巳午未申酉戌亥",o);case 16:return tr(e,"甲乙丙丁戊己庚辛壬癸",o);case 17:case 48:return Ar(e,"零一二三四五六七八九",nr,"負",o,14);case 47:return Ar(e,"零壹貳參肆伍陸柒捌玖",or,"負",o,15);case 42:return Ar(e,"零一二三四五六七八九",nr,"负",o,14);case 41:return Ar(e,"零壹贰叁肆伍陆柒捌玖",or,"负",o,15);case 26:return Ar(e,"〇一二三四五六七八九","十百千万",rr,o,0);case 25:return Ar(e,"零壱弐参四伍六七八九","拾百千万",rr,o,7);case 31:return Ar(e,"영일이삼사오육칠팔구","십백천만",ir,r,7);case 33:return Ar(e,"零一二三四五六七八九","十百千萬",ir,r,0);case 32:return Ar(e,"零壹貳參四五六七八九","拾百千",ir,r,7);case 18:return er(e,2406,2415,!0,n);case 20:return Zo(e,1,19999,qo,3,n);case 21:return er(e,2790,2799,!0,n);case 22:return er(e,2662,2671,!0,n);case 22:return Zo(e,1,10999,Yo,3,n);case 23:return tr(e,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return tr(e,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return er(e,3302,3311,!0,n);case 28:return tr(e,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",o);case 29:return tr(e,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",o);case 34:return er(e,3792,3801,!0,n);case 37:return er(e,6160,6169,!0,n);case 38:return er(e,4160,4169,!0,n);case 39:return er(e,2918,2927,!0,n);case 40:return er(e,1776,1785,!0,n);case 43:return er(e,3046,3055,!0,n);case 44:return er(e,3174,3183,!0,n);case 45:return er(e,3664,3673,!0,n);case 46:return er(e,3872,3881,!0,n);default:return er(e,48,57,!0,n)}},sr="data-html2canvas-ignore",cr=function(){function e(e,t,A){if(this.context=e,this.options=A,this.scrolledElements=[],this.referenceElement=t,this.counters=new zo,this.quoteDepth=0,!t.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(t.ownerDocument.documentElement,!1)}return e.prototype.toIFrame=function(e,t){var A=this,r=ur(e,t);if(!r.contentWindow)return Promise.reject("Unable to find iframe window");var i=e.defaultView.pageXOffset,a=e.defaultView.pageYOffset,s=r.contentWindow,c=s.document,l=hr(r).then(function(){return n(A,void 0,void 0,function(){var e,A;return o(this,function(n){switch(n.label){case 0:return this.scrolledElements.forEach(Br),s&&(s.scrollTo(t.left,t.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||s.scrollY===t.top&&s.scrollX===t.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(s.scrollX-t.left,s.scrollY-t.top,0,0))),e=this.options.onclone,void 0===(A=this.clonedReferenceElement)?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:c.fonts&&c.fonts.ready?[4,c.fonts.ready]:[3,2];case 1:n.sent(),n.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,pr(c)]:[3,4];case 3:n.sent(),n.label=4;case 4:return"function"==typeof e?[2,Promise.resolve().then(function(){return e(c,A)}).then(function(){return r})]:[2,r]}})})});return c.open(),c.write(mr(document.doctype)+"<html></html>"),vr(this.referenceElement.ownerDocument,i,a),c.replaceChild(c.adoptNode(this.documentElement),c.documentElement),c.close(),l},e.prototype.createElementClone=function(e){if(Qn(e,2),Mo(e))return this.createCanvasClone(e);if(Lo(e))return this.createVideoClone(e);if(Vo(e))return this.createStyleClone(e);var t=e.cloneNode(!1);return Ro(t)&&(Ro(e)&&e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),"lazy"===t.loading&&(t.loading="eager")),Wo(t)?this.createCustomElementClone(t):t},e.prototype.createCustomElementClone=function(e){var t=document.createElement("html2canvascustomelement");return fr(e.style,t),t},e.prototype.createStyleClone=function(e){try{var t=e.sheet;if(t&&t.cssRules){var A=[].slice.call(t.cssRules,0).reduce(function(e,t){return t&&"string"==typeof t.cssText?e+t.cssText:e},""),n=e.cloneNode(!1);return n.textContent=A,n}}catch(e){if(this.context.logger.error("Unable to access cssRules property",e),"SecurityError"!==e.name)throw e}return e.cloneNode(!1)},e.prototype.createCanvasClone=function(e){var t;if(this.options.inlineImages&&e.ownerDocument){var A=e.ownerDocument.createElement("img");try{return A.src=e.toDataURL(),A}catch(t){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",e)}}var n=e.cloneNode(!1);try{n.width=e.width,n.height=e.height;var o=e.getContext("2d"),r=n.getContext("2d");if(r)if(!this.options.allowTaint&&o)r.putImageData(o.getImageData(0,0,e.width,e.height),0,0);else{var i=null!==(t=e.getContext("webgl2"))&&void 0!==t?t:e.getContext("webgl");if(i){var a=i.getContextAttributes();!1===(null==a?void 0:a.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",e)}r.drawImage(e,0,0)}return n}catch(t){this.context.logger.info("Unable to clone canvas as it is tainted",e)}return n},e.prototype.createVideoClone=function(e){var t=e.ownerDocument.createElement("canvas");t.width=e.offsetWidth,t.height=e.offsetHeight;var A=t.getContext("2d");try{return A&&(A.drawImage(e,0,0,t.width,t.height),this.options.allowTaint||A.getImageData(0,0,t.width,t.height)),t}catch(t){this.context.logger.info("Unable to clone video as it is tainted",e)}var n=e.ownerDocument.createElement("canvas");return n.width=e.offsetWidth,n.height=e.offsetHeight,n},e.prototype.appendChildNode=function(e,t,A){Eo(t)&&("SCRIPT"===t.tagName||t.hasAttribute(sr)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(t))||this.options.copyStyles&&Eo(t)&&Vo(t)||e.appendChild(this.cloneNode(t,A))},e.prototype.cloneChildNodes=function(e,t,A){for(var n=this,o=e.shadowRoot?e.shadowRoot.firstChild:e.firstChild;o;o=o.nextSibling)if(Eo(o)&&Go(o)&&"function"==typeof o.assignedNodes){var r=o.assignedNodes();r.length&&r.forEach(function(e){return n.appendChildNode(t,e,A)})}else this.appendChildNode(t,o,A)},e.prototype.cloneNode=function(e,t){if(ko(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var A=e.ownerDocument.defaultView;if(A&&Eo(e)&&(Io(e)||To(e))){var n=this.createElementClone(e);n.style.transitionProperty="none";var o=A.getComputedStyle(e),r=A.getComputedStyle(e,":before"),i=A.getComputedStyle(e,":after");this.referenceElement===e&&Io(n)&&(this.clonedReferenceElement=n),Ko(n)&&Cr(n);var a=this.counters.parse(new Cn(this.context,o)),s=this.resolvePseudoContent(e,n,r,Pn.BEFORE);Wo(e)&&(t=!0),Lo(e)||this.cloneChildNodes(e,n,t),s&&n.insertBefore(s,n.firstChild);var c=this.resolvePseudoContent(e,n,i,Pn.AFTER);return c&&n.appendChild(c),this.counters.pop(a),(o&&(this.options.copyStyles||To(e))&&!_o(e)||t)&&fr(o,n),0===e.scrollTop&&0===e.scrollLeft||this.scrolledElements.push([n,e.scrollLeft,e.scrollTop]),(jo(e)||No(e))&&(jo(n)||No(n))&&(n.value=e.value),n}return e.cloneNode(!1)},e.prototype.resolvePseudoContent=function(e,t,A,n){var o=this;if(A){var r=A.content,i=t.ownerDocument;if(i&&r&&"none"!==r&&"-moz-alt-content"!==r&&"none"!==A.display){this.counters.parse(new Cn(this.context,A));var a=new bn(this.context,A),s=i.createElement("html2canvaspseudoelement");fr(A,s),a.content.forEach(function(t){if(0===t.type)s.appendChild(i.createTextNode(t.value));else if(22===t.type){var A=i.createElement("img");A.src=t.value,A.style.opacity="1",s.appendChild(A)}else if(18===t.type){if("attr"===t.name){var n=t.values.filter(Ge);n.length&&s.appendChild(i.createTextNode(e.getAttribute(n[0].value)||""))}else if("counter"===t.name){var r=t.values.filter(Je),c=r[0],l=r[1];if(c&&Ge(c)){var u=o.counters.getCounterValue(c.value),d=l&&Ge(l)?kA.parse(o.context,l.value):3;s.appendChild(i.createTextNode(ar(u,d,!1)))}}else if("counters"===t.name){var p=t.values.filter(Je),h=(c=p[0],p[1]);if(l=p[2],c&&Ge(c)){var g=o.counters.getCounterValues(c.value),f=l&&Ge(l)?kA.parse(o.context,l.value):3,m=h&&0===h.type?h.value:"",v=g.map(function(e){return ar(e,f,!1)}).join(m);s.appendChild(i.createTextNode(v))}}}else if(20===t.type)switch(t.value){case"open-quote":s.appendChild(i.createTextNode(fn(a.quotes,o.quoteDepth++,!0)));break;case"close-quote":s.appendChild(i.createTextNode(fn(a.quotes,--o.quoteDepth,!1)));break;default:s.appendChild(i.createTextNode(t.value))}}),s.className=wr+" "+yr;var c=n===Pn.BEFORE?" "+wr:" "+yr;return To(t)?t.className.baseValue+=c:t.className+=c,s}}},e.destroy=function(e){return!!e.parentNode&&(e.parentNode.removeChild(e),!0)},e}();!function(e){e[e.BEFORE=0]="BEFORE",e[e.AFTER=1]="AFTER"}(Pn||(Pn={}));var lr,ur=function(e,t){var A=e.createElement("iframe");return A.className="html2canvas-container",A.style.visibility="hidden",A.style.position="fixed",A.style.left="-10000px",A.style.top="0px",A.style.border="0",A.width=t.width.toString(),A.height=t.height.toString(),A.scrolling="no",A.setAttribute(sr,"true"),e.body.appendChild(A),A},dr=function(e){return new Promise(function(t){e.complete?t():e.src?(e.onload=t,e.onerror=t):t()})},pr=function(e){return Promise.all([].slice.call(e.images,0).map(dr))},hr=function(e){return new Promise(function(t,A){var n=e.contentWindow;if(!n)return A("No window assigned for iframe");var o=n.document;n.onload=e.onload=function(){n.onload=e.onload=null;var A=setInterval(function(){o.body.childNodes.length>0&&"complete"===o.readyState&&(clearInterval(A),t(e))},50)}})},gr=["all","d","content"],fr=function(e,t){for(var A=e.length-1;A>=0;A--){var n=e.item(A);-1===gr.indexOf(n)&&t.style.setProperty(n,e.getPropertyValue(n))}return t},mr=function(e){var t="";return e&&(t+="<!DOCTYPE ",e.name&&(t+=e.name),e.internalSubset&&(t+=e.internalSubset),e.publicId&&(t+='"'+e.publicId+'"'),e.systemId&&(t+='"'+e.systemId+'"'),t+=">"),t},vr=function(e,t,A){e&&e.defaultView&&(t!==e.defaultView.pageXOffset||A!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(t,A)},Br=function(e){var t=e[0],A=e[1],n=e[2];t.scrollLeft=A,t.scrollTop=n},wr="___html2canvas___pseudoelement_before",yr="___html2canvas___pseudoelement_after",br='{\n content: "" !important;\n display: none !important;\n}',Cr=function(e){xr(e,"."+wr+":before"+br+"\n ."+yr+":after"+br)},xr=function(e,t){var A=e.ownerDocument;if(A){var n=A.createElement("style");n.textContent=t,e.appendChild(n)}},Qr=function(){function e(){}return e.getOrigin=function(t){var A=e._link;return A?(A.href=t,A.href=A.href,A.protocol+A.hostname+A.port):"about:blank"},e.isSameOrigin=function(t){return e.getOrigin(t)===e._origin},e.setContext=function(t){e._link=t.document.createElement("a"),e._origin=e.getOrigin(t.location.href)},e._origin="about:blank",e}(),Fr=function(){function e(e,t){this.context=e,this._options=t,this._cache={}}return e.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)?t:Hr(e)||Er(e)?((this._cache[e]=this.loadImage(e)).catch(function(){}),t):t},e.prototype.match=function(e){return this._cache[e]},e.prototype.loadImage=function(e){return n(this,void 0,void 0,function(){var t,A,n,r,i=this;return o(this,function(o){switch(o.label){case 0:return t=Qr.isSameOrigin(e),A=!Ir(e)&&!0===this._options.useCORS&&Jn.SUPPORT_CORS_IMAGES&&!t,n=!Ir(e)&&!t&&!Hr(e)&&"string"==typeof this._options.proxy&&Jn.SUPPORT_CORS_XHR&&!A,t||!1!==this._options.allowTaint||Ir(e)||Hr(e)||n||A?(r=e,n?[4,this.proxy(r)]:[3,2]):[2];case 1:r=o.sent(),o.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(e,t){var n=new Image;n.onload=function(){return e(n)},n.onerror=t,(Tr(r)||A)&&(n.crossOrigin="anonymous"),n.src=r,!0===n.complete&&setTimeout(function(){return e(n)},500),i._options.imageTimeout>0&&setTimeout(function(){return t("Timed out ("+i._options.imageTimeout+"ms) loading image")},i._options.imageTimeout)})];case 3:return[2,o.sent()]}})})},e.prototype.has=function(e){return void 0!==this._cache[e]},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(e){var t=this,A=this._options.proxy;if(!A)throw new Error("No proxy defined");var n=e.substring(0,256);return new Promise(function(o,r){var i=Jn.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(200===a.status)if("text"===i)o(a.response);else{var e=new FileReader;e.addEventListener("load",function(){return o(e.result)},!1),e.addEventListener("error",function(e){return r(e)},!1),e.readAsDataURL(a.response)}else r("Failed to proxy resource "+n+" with status code "+a.status)},a.onerror=r;var s=A.indexOf("?")>-1?"&":"?";if(a.open("GET",""+A+s+"url="+encodeURIComponent(e)+"&responseType="+i),"text"!==i&&a instanceof XMLHttpRequest&&(a.responseType=i),t._options.imageTimeout){var c=t._options.imageTimeout;a.timeout=c,a.ontimeout=function(){return r("Timed out ("+c+"ms) proxying "+n)}}a.send()})},e}(),Ur=/^data:image\/svg\+xml/i,Sr=/^data:image\/.*;base64,/i,kr=/^data:image\/.*/i,Er=function(e){return Jn.SUPPORT_SVG_DRAWING||!Dr(e)},Ir=function(e){return kr.test(e)},Tr=function(e){return Sr.test(e)},Hr=function(e){return"blob"===e.substr(0,4)},Dr=function(e){return"svg"===e.substr(-3).toLowerCase()||Ur.test(e)},Pr=function(){function e(e,t){this.type=0,this.x=e,this.y=t}return e.prototype.add=function(t,A){return new e(this.x+t,this.y+A)},e}(),Or=function(e,t,A){return new Pr(e.x+(t.x-e.x)*A,e.y+(t.y-e.y)*A)},Kr=function(){function e(e,t,A,n){this.type=1,this.start=e,this.startControl=t,this.endControl=A,this.end=n}return e.prototype.subdivide=function(t,A){var n=Or(this.start,this.startControl,t),o=Or(this.startControl,this.endControl,t),r=Or(this.endControl,this.end,t),i=Or(n,o,t),a=Or(o,r,t),s=Or(i,a,t);return A?new e(this.start,n,i,s):new e(s,a,r,this.end)},e.prototype.add=function(t,A){return new e(this.start.add(t,A),this.startControl.add(t,A),this.endControl.add(t,A),this.end.add(t,A))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),Mr=function(e){return 1===e.type},Lr=function(e){var t=e.styles,A=e.bounds,n=ot(t.borderTopLeftRadius,A.width,A.height),o=n[0],r=n[1],i=ot(t.borderTopRightRadius,A.width,A.height),a=i[0],s=i[1],c=ot(t.borderBottomRightRadius,A.width,A.height),l=c[0],u=c[1],d=ot(t.borderBottomLeftRadius,A.width,A.height),p=d[0],h=d[1],g=[];g.push((o+a)/A.width),g.push((p+l)/A.width),g.push((r+h)/A.height),g.push((s+u)/A.height);var f=Math.max.apply(Math,g);f>1&&(o/=f,r/=f,a/=f,s/=f,l/=f,u/=f,p/=f,h/=f);var m=A.width-a,v=A.height-u,B=A.width-l,w=A.height-h,y=t.borderTopWidth,b=t.borderRightWidth,C=t.borderBottomWidth,x=t.borderLeftWidth,Q=rt(t.paddingTop,e.bounds.width),F=rt(t.paddingRight,e.bounds.width),U=rt(t.paddingBottom,e.bounds.width),S=rt(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=o>0||r>0?Rr(A.left+x/3,A.top+y/3,o-x/3,r-y/3,lr.TOP_LEFT):new Pr(A.left+x/3,A.top+y/3),this.topRightBorderDoubleOuterBox=o>0||r>0?Rr(A.left+m,A.top+y/3,a-b/3,s-y/3,lr.TOP_RIGHT):new Pr(A.left+A.width-b/3,A.top+y/3),this.bottomRightBorderDoubleOuterBox=l>0||u>0?Rr(A.left+B,A.top+v,l-b/3,u-C/3,lr.BOTTOM_RIGHT):new Pr(A.left+A.width-b/3,A.top+A.height-C/3),this.bottomLeftBorderDoubleOuterBox=p>0||h>0?Rr(A.left+x/3,A.top+w,p-x/3,h-C/3,lr.BOTTOM_LEFT):new Pr(A.left+x/3,A.top+A.height-C/3),this.topLeftBorderDoubleInnerBox=o>0||r>0?Rr(A.left+2*x/3,A.top+2*y/3,o-2*x/3,r-2*y/3,lr.TOP_LEFT):new Pr(A.left+2*x/3,A.top+2*y/3),this.topRightBorderDoubleInnerBox=o>0||r>0?Rr(A.left+m,A.top+2*y/3,a-2*b/3,s-2*y/3,lr.TOP_RIGHT):new Pr(A.left+A.width-2*b/3,A.top+2*y/3),this.bottomRightBorderDoubleInnerBox=l>0||u>0?Rr(A.left+B,A.top+v,l-2*b/3,u-2*C/3,lr.BOTTOM_RIGHT):new Pr(A.left+A.width-2*b/3,A.top+A.height-2*C/3),this.bottomLeftBorderDoubleInnerBox=p>0||h>0?Rr(A.left+2*x/3,A.top+w,p-2*x/3,h-2*C/3,lr.BOTTOM_LEFT):new Pr(A.left+2*x/3,A.top+A.height-2*C/3),this.topLeftBorderStroke=o>0||r>0?Rr(A.left+x/2,A.top+y/2,o-x/2,r-y/2,lr.TOP_LEFT):new Pr(A.left+x/2,A.top+y/2),this.topRightBorderStroke=o>0||r>0?Rr(A.left+m,A.top+y/2,a-b/2,s-y/2,lr.TOP_RIGHT):new Pr(A.left+A.width-b/2,A.top+y/2),this.bottomRightBorderStroke=l>0||u>0?Rr(A.left+B,A.top+v,l-b/2,u-C/2,lr.BOTTOM_RIGHT):new Pr(A.left+A.width-b/2,A.top+A.height-C/2),this.bottomLeftBorderStroke=p>0||h>0?Rr(A.left+x/2,A.top+w,p-x/2,h-C/2,lr.BOTTOM_LEFT):new Pr(A.left+x/2,A.top+A.height-C/2),this.topLeftBorderBox=o>0||r>0?Rr(A.left,A.top,o,r,lr.TOP_LEFT):new Pr(A.left,A.top),this.topRightBorderBox=a>0||s>0?Rr(A.left+m,A.top,a,s,lr.TOP_RIGHT):new Pr(A.left+A.width,A.top),this.bottomRightBorderBox=l>0||u>0?Rr(A.left+B,A.top+v,l,u,lr.BOTTOM_RIGHT):new Pr(A.left+A.width,A.top+A.height),this.bottomLeftBorderBox=p>0||h>0?Rr(A.left,A.top+w,p,h,lr.BOTTOM_LEFT):new Pr(A.left,A.top+A.height),this.topLeftPaddingBox=o>0||r>0?Rr(A.left+x,A.top+y,Math.max(0,o-x),Math.max(0,r-y),lr.TOP_LEFT):new Pr(A.left+x,A.top+y),this.topRightPaddingBox=a>0||s>0?Rr(A.left+Math.min(m,A.width-b),A.top+y,m>A.width+b?0:Math.max(0,a-b),Math.max(0,s-y),lr.TOP_RIGHT):new Pr(A.left+A.width-b,A.top+y),this.bottomRightPaddingBox=l>0||u>0?Rr(A.left+Math.min(B,A.width-x),A.top+Math.min(v,A.height-C),Math.max(0,l-b),Math.max(0,u-C),lr.BOTTOM_RIGHT):new Pr(A.left+A.width-b,A.top+A.height-C),this.bottomLeftPaddingBox=p>0||h>0?Rr(A.left+x,A.top+Math.min(w,A.height-C),Math.max(0,p-x),Math.max(0,h-C),lr.BOTTOM_LEFT):new Pr(A.left+x,A.top+A.height-C),this.topLeftContentBox=o>0||r>0?Rr(A.left+x+S,A.top+y+Q,Math.max(0,o-(x+S)),Math.max(0,r-(y+Q)),lr.TOP_LEFT):new Pr(A.left+x+S,A.top+y+Q),this.topRightContentBox=a>0||s>0?Rr(A.left+Math.min(m,A.width+x+S),A.top+y+Q,m>A.width+x+S?0:a-x+S,s-(y+Q),lr.TOP_RIGHT):new Pr(A.left+A.width-(b+F),A.top+y+Q),this.bottomRightContentBox=l>0||u>0?Rr(A.left+Math.min(B,A.width-(x+S)),A.top+Math.min(v,A.height+y+Q),Math.max(0,l-(b+F)),u-(C+U),lr.BOTTOM_RIGHT):new Pr(A.left+A.width-(b+F),A.top+A.height-(C+U)),this.bottomLeftContentBox=p>0||h>0?Rr(A.left+x+S,A.top+w,Math.max(0,p-(x+S)),h-(C+U),lr.BOTTOM_LEFT):new Pr(A.left+x+S,A.top+A.height-(C+U))};!function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"}(lr||(lr={}));var Rr=function(e,t,A,n,o){var r=(Math.sqrt(2)-1)/3*4,i=A*r,a=n*r,s=e+A,c=t+n;switch(o){case lr.TOP_LEFT:return new Kr(new Pr(e,c),new Pr(e,c-a),new Pr(s-i,t),new Pr(s,t));case lr.TOP_RIGHT:return new Kr(new Pr(e,t),new Pr(e+i,t),new Pr(s,c-a),new Pr(s,c));case lr.BOTTOM_RIGHT:return new Kr(new Pr(s,t),new Pr(s,t+a),new Pr(e+i,c),new Pr(e,c));case lr.BOTTOM_LEFT:default:return new Kr(new Pr(s,c),new Pr(s-i,c),new Pr(e,t+a),new Pr(e,t))}},_r=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},Vr=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},jr=function(e,t,A){this.offsetX=e,this.offsetY=t,this.matrix=A,this.type=0,this.target=6},Nr=function(e,t){this.path=e,this.target=t,this.type=1},Gr=function(e){this.opacity=e,this.type=2,this.target=6},Wr=function(e){return 1===e.type},zr=function(e,t){return e.length===t.length&&e.some(function(e,A){return e===t[A]})},Xr=function(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},Jr=function(){function e(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new Lr(this.container),this.container.styles.opacity<1&&this.effects.push(new Gr(this.container.styles.opacity)),null!==this.container.styles.transform){var A=this.container.bounds.left+this.container.styles.transformOrigin[0].number,n=this.container.bounds.top+this.container.styles.transformOrigin[1].number,o=this.container.styles.transform;this.effects.push(new jr(A,n,o))}if(0!==this.container.styles.overflowX){var r=_r(this.curves),i=Vr(this.curves);zr(r,i)?this.effects.push(new Nr(r,6)):(this.effects.push(new Nr(r,2)),this.effects.push(new Nr(i,4)))}}return e.prototype.getEffects=function(e){for(var t=-1===[2,3].indexOf(this.container.styles.position),A=this.parent,n=this.effects.slice(0);A;){var o=A.effects.filter(function(e){return!Wr(e)});if(t||0!==A.container.styles.position||!A.parent){if(n.unshift.apply(n,o),t=-1===[2,3].indexOf(A.container.styles.position),0!==A.container.styles.overflowX){var r=_r(A.curves),i=Vr(A.curves);zr(r,i)||n.unshift(new Nr(i,6))}}else n.unshift.apply(n,o);A=A.parent}return n.filter(function(t){return ln(t.target,e)})},e}(),Yr=function(e,t,A,n){e.container.elements.forEach(function(o){var r=ln(o.flags,4),i=ln(o.flags,2),a=new Jr(o,e);ln(o.styles.display,2048)&&n.push(a);var s=ln(o.flags,8)?[]:n;if(r||i){var c=r||o.styles.isPositioned()?A:t,l=new Xr(a);if(o.styles.isPositioned()||o.styles.opacity<1||o.styles.isTransformed()){var u=o.styles.zIndex.order;if(u<0){var d=0;c.negativeZIndex.some(function(e,t){return u>e.element.container.styles.zIndex.order?(d=t,!1):d>0}),c.negativeZIndex.splice(d,0,l)}else if(u>0){var p=0;c.positiveZIndex.some(function(e,t){return u>=e.element.container.styles.zIndex.order?(p=t+1,!1):p>0}),c.positiveZIndex.splice(p,0,l)}else c.zeroOrAutoZIndexOrTransformedOrOpacity.push(l)}else o.styles.isFloating()?c.nonPositionedFloats.push(l):c.nonPositionedInlineLevel.push(l);Yr(a,l,r?l:A,s)}else o.styles.isInlineLevel()?t.inlineLevel.push(a):t.nonInlineLevel.push(a),Yr(a,t,A,s);ln(o.flags,8)&&qr(o,s)})},qr=function(e,t){for(var A=e instanceof uo?e.start:1,n=e instanceof uo&&e.reversed,o=0;o<t.length;o++){var r=t[o];r.container instanceof lo&&"number"==typeof r.container.value&&0!==r.container.value&&(A=r.container.value),r.listValue=ar(A,r.container.styles.listStyleType,!0),A+=n?-1:1}},Zr=function(e,t){switch(t){case 0:return ei(e.topLeftBorderBox,e.topLeftPaddingBox,e.topRightBorderBox,e.topRightPaddingBox);case 1:return ei(e.topRightBorderBox,e.topRightPaddingBox,e.bottomRightBorderBox,e.bottomRightPaddingBox);case 2:return ei(e.bottomRightBorderBox,e.bottomRightPaddingBox,e.bottomLeftBorderBox,e.bottomLeftPaddingBox);default:return ei(e.bottomLeftBorderBox,e.bottomLeftPaddingBox,e.topLeftBorderBox,e.topLeftPaddingBox)}},$r=function(e,t){var A=[];return Mr(e)?A.push(e.subdivide(.5,!1)):A.push(e),Mr(t)?A.push(t.subdivide(.5,!0)):A.push(t),A},ei=function(e,t,A,n){var o=[];return Mr(e)?o.push(e.subdivide(.5,!1)):o.push(e),Mr(A)?o.push(A.subdivide(.5,!0)):o.push(A),Mr(n)?o.push(n.subdivide(.5,!0).reverse()):o.push(n),Mr(t)?o.push(t.subdivide(.5,!1).reverse()):o.push(t),o},ti=function(e){var t=e.bounds,A=e.styles;return t.add(A.borderLeftWidth,A.borderTopWidth,-(A.borderRightWidth+A.borderLeftWidth),-(A.borderTopWidth+A.borderBottomWidth))},Ai=function(e){var t=e.styles,A=e.bounds,n=rt(t.paddingLeft,A.width),o=rt(t.paddingRight,A.width),r=rt(t.paddingTop,A.width),i=rt(t.paddingBottom,A.width);return A.add(n+t.borderLeftWidth,r+t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth+n+o),-(t.borderTopWidth+t.borderBottomWidth+r+i))},ni=function(e,t,A){var n=function(e,t){return 0===e?t.bounds:2===e?Ai(t):ti(t)}(ai(e.styles.backgroundOrigin,t),e),o=function(e,t){return 0===e?t.bounds:2===e?Ai(t):ti(t)}(ai(e.styles.backgroundClip,t),e),r=ii(ai(e.styles.backgroundSize,t),A,n),i=r[0],a=r[1],s=ot(ai(e.styles.backgroundPosition,t),n.width-i,n.height-a);return[si(ai(e.styles.backgroundRepeat,t),s,r,n,o),Math.round(n.left+s[0]),Math.round(n.top+s[1]),i,a]},oi=function(e){return Ge(e)&&e.value===_t.AUTO},ri=function(e){return"number"==typeof e},ii=function(e,t,A){var n=t[0],o=t[1],r=t[2],i=e[0],a=e[1];if(!i)return[0,0];if($e(i)&&a&&$e(a))return[rt(i,A.width),rt(a,A.height)];var s=ri(r);if(Ge(i)&&(i.value===_t.CONTAIN||i.value===_t.COVER))return ri(r)?A.width/A.height<r!=(i.value===_t.COVER)?[A.width,A.width/r]:[A.height*r,A.height]:[A.width,A.height];var c=ri(n),l=ri(o),u=c||l;if(oi(i)&&(!a||oi(a)))return c&&l?[n,o]:s||u?u&&s?[c?n:o*r,l?o:n/r]:[c?n:A.width,l?o:A.height]:[A.width,A.height];if(s){var d=0,p=0;return $e(i)?d=rt(i,A.width):$e(a)&&(p=rt(a,A.height)),oi(i)?d=p*r:a&&!oi(a)||(p=d/r),[d,p]}var h=null,g=null;if($e(i)?h=rt(i,A.width):a&&$e(a)&&(g=rt(a,A.height)),null===h||a&&!oi(a)||(g=c&&l?h/n*o:A.height),null!==g&&oi(i)&&(h=c&&l?g/o*n:A.width),null!==h&&null!==g)return[h,g];throw new Error("Unable to calculate background-size for element")},ai=function(e,t){var A=e[t];return void 0===A?e[0]:A},si=function(e,t,A,n,o){var r=t[0],i=t[1],a=A[0],s=A[1];switch(e){case 2:return[new Pr(Math.round(n.left),Math.round(n.top+i)),new Pr(Math.round(n.left+n.width),Math.round(n.top+i)),new Pr(Math.round(n.left+n.width),Math.round(s+n.top+i)),new Pr(Math.round(n.left),Math.round(s+n.top+i))];case 3:return[new Pr(Math.round(n.left+r),Math.round(n.top)),new Pr(Math.round(n.left+r+a),Math.round(n.top)),new Pr(Math.round(n.left+r+a),Math.round(n.height+n.top)),new Pr(Math.round(n.left+r),Math.round(n.height+n.top))];case 1:return[new Pr(Math.round(n.left+r),Math.round(n.top+i)),new Pr(Math.round(n.left+r+a),Math.round(n.top+i)),new Pr(Math.round(n.left+r+a),Math.round(n.top+i+s)),new Pr(Math.round(n.left+r),Math.round(n.top+i+s))];default:return[new Pr(Math.round(o.left),Math.round(o.top)),new Pr(Math.round(o.left+o.width),Math.round(o.top)),new Pr(Math.round(o.left+o.width),Math.round(o.height+o.top)),new Pr(Math.round(o.left),Math.round(o.height+o.top))]}},ci="Hidden Text",li=function(){function e(e){this._data={},this._document=e}return e.prototype.parseMetrics=function(e,t){var A=this._document.createElement("div"),n=this._document.createElement("img"),o=this._document.createElement("span"),r=this._document.body;A.style.visibility="hidden",A.style.fontFamily=e,A.style.fontSize=t,A.style.margin="0",A.style.padding="0",A.style.whiteSpace="nowrap",r.appendChild(A),n.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",n.width=1,n.height=1,n.style.margin="0",n.style.padding="0",n.style.verticalAlign="baseline",o.style.fontFamily=e,o.style.fontSize=t,o.style.margin="0",o.style.padding="0",o.appendChild(this._document.createTextNode(ci)),A.appendChild(o),A.appendChild(n);var i=n.offsetTop-o.offsetTop+2;A.removeChild(o),A.appendChild(this._document.createTextNode(ci)),A.style.lineHeight="normal",n.style.verticalAlign="super";var a=n.offsetTop-A.offsetTop+2;return r.removeChild(A),{baseline:i,middle:a}},e.prototype.getMetrics=function(e,t){var A=e+" "+t;return void 0===this._data[A]&&(this._data[A]=this.parseMetrics(e,t)),this._data[A]},e}(),ui=function(e,t){this.context=e,this.options=t},di=function(e){function A(t,A){var n=e.call(this,t,A)||this;return n._activeEffects=[],n.canvas=A.canvas?A.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),A.canvas||(n.canvas.width=Math.floor(A.width*A.scale),n.canvas.height=Math.floor(A.height*A.scale),n.canvas.style.width=A.width+"px",n.canvas.style.height=A.height+"px"),n.fontMetrics=new li(document),n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-A.x,-A.y),n.ctx.textBaseline="bottom",n._activeEffects=[],n.context.logger.debug("Canvas renderer initialized ("+A.width+"x"+A.height+") with scale "+A.scale),n}return t(A,e),A.prototype.applyEffects=function(e){for(var t=this;this._activeEffects.length;)this.popEffect();e.forEach(function(e){return t.applyEffect(e)})},A.prototype.applyEffect=function(e){this.ctx.save(),function(e){return 2===e.type}(e)&&(this.ctx.globalAlpha=e.opacity),function(e){return 0===e.type}(e)&&(this.ctx.translate(e.offsetX,e.offsetY),this.ctx.transform(e.matrix[0],e.matrix[1],e.matrix[2],e.matrix[3],e.matrix[4],e.matrix[5]),this.ctx.translate(-e.offsetX,-e.offsetY)),Wr(e)&&(this.path(e.path),this.ctx.clip()),this._activeEffects.push(e)},A.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},A.prototype.renderStack=function(e){return n(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return e.element.container.styles.isVisible()?[4,this.renderStackContent(e)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})},A.prototype.renderNode=function(e){return n(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return ln(e.container.flags,16),e.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(e)]:[3,3];case 1:return t.sent(),[4,this.renderNodeContent(e)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},A.prototype.renderTextWithLetterSpacing=function(e,t,A){var n=this;0===t?this.ctx.fillText(e.text,e.bounds.left,e.bounds.top+A):$n(e.text).reduce(function(t,o){return n.ctx.fillText(o,t,e.bounds.top+A),t+n.ctx.measureText(o).width},e.bounds.left)},A.prototype.createFontStyle=function(e){var t=e.fontVariant.filter(function(e){return"normal"===e||"small-caps"===e}).join(""),A=mi(e.fontFamily).join(", "),n=je(e.fontSize)?""+e.fontSize.number+e.fontSize.unit:e.fontSize.number+"px";return[[e.fontStyle,t,e.fontWeight,n,A].join(" "),A,n]},A.prototype.renderTextNode=function(e,t){return n(this,void 0,void 0,function(){var A,n,r,i,a,s,c,l,u=this;return o(this,function(o){return A=this.createFontStyle(t),n=A[0],r=A[1],i=A[2],this.ctx.font=n,this.ctx.direction=1===t.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",a=this.fontMetrics.getMetrics(r,i),s=a.baseline,c=a.middle,l=t.paintOrder,e.textBounds.forEach(function(e){l.forEach(function(A){switch(A){case 0:u.ctx.fillStyle=ht(t.color),u.renderTextWithLetterSpacing(e,t.letterSpacing,s);var n=t.textShadow;n.length&&e.text.trim().length&&(n.slice(0).reverse().forEach(function(A){u.ctx.shadowColor=ht(A.color),u.ctx.shadowOffsetX=A.offsetX.number*u.options.scale,u.ctx.shadowOffsetY=A.offsetY.number*u.options.scale,u.ctx.shadowBlur=A.blur.number,u.renderTextWithLetterSpacing(e,t.letterSpacing,s)}),u.ctx.shadowColor="",u.ctx.shadowOffsetX=0,u.ctx.shadowOffsetY=0,u.ctx.shadowBlur=0),t.textDecorationLine.length&&(u.ctx.fillStyle=ht(t.textDecorationColor||t.color),t.textDecorationLine.forEach(function(t){switch(t){case 1:u.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top+s),e.bounds.width,1);break;case 2:u.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top),e.bounds.width,1);break;case 3:u.ctx.fillRect(e.bounds.left,Math.ceil(e.bounds.top+c),e.bounds.width,1)}}));break;case 1:t.webkitTextStrokeWidth&&e.text.trim().length&&(u.ctx.strokeStyle=ht(t.webkitTextStrokeColor),u.ctx.lineWidth=t.webkitTextStrokeWidth,u.ctx.lineJoin=window.chrome?"miter":"round",u.ctx.strokeText(e.text,e.bounds.left,e.bounds.top+s)),u.ctx.strokeStyle="",u.ctx.lineWidth=0,u.ctx.lineJoin="miter"}})}),[2]})})},A.prototype.renderReplacedElement=function(e,t,A){if(A&&e.intrinsicWidth>0&&e.intrinsicHeight>0){var n=Ai(e),o=Vr(t);this.path(o),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(A,0,0,e.intrinsicWidth,e.intrinsicHeight,n.left,n.top,n.width,n.height),this.ctx.restore()}},A.prototype.renderNodeContent=function(e){return n(this,void 0,void 0,function(){var t,n,r,a,s,c,l,u,d,p,h,g,f,m,v,B,w,y;return o(this,function(o){switch(o.label){case 0:this.applyEffects(e.getEffects(4)),t=e.container,n=e.curves,r=t.styles,a=0,s=t.textNodes,o.label=1;case 1:return a<s.length?(c=s[a],[4,this.renderTextNode(c,r)]):[3,4];case 2:o.sent(),o.label=3;case 3:return a++,[3,1];case 4:if(!(t instanceof ao))return[3,8];o.label=5;case 5:return o.trys.push([5,7,,8]),[4,this.context.cache.match(t.src)];case 6:return v=o.sent(),this.renderReplacedElement(t,n,v),[3,8];case 7:return o.sent(),this.context.logger.error("Error loading image "+t.src),[3,8];case 8:if(t instanceof so&&this.renderReplacedElement(t,n,t.canvas),!(t instanceof co))return[3,12];o.label=9;case 9:return o.trys.push([9,11,,12]),[4,this.context.cache.match(t.svg)];case 10:return v=o.sent(),this.renderReplacedElement(t,n,v),[3,12];case 11:return o.sent(),this.context.logger.error("Error loading svg "+t.svg.substring(0,255)),[3,12];case 12:return t instanceof bo&&t.tree?[4,new A(this.context,{scale:this.options.scale,backgroundColor:t.backgroundColor,x:0,y:0,width:t.width,height:t.height}).render(t.tree)]:[3,14];case 13:l=o.sent(),t.width&&t.height&&this.ctx.drawImage(l,0,0,t.width,t.height,t.bounds.left,t.bounds.top,t.bounds.width,t.bounds.height),o.label=14;case 14:if(t instanceof Bo&&(u=Math.min(t.bounds.width,t.bounds.height),t.type===go?t.checked&&(this.ctx.save(),this.path([new Pr(t.bounds.left+.39363*u,t.bounds.top+.79*u),new Pr(t.bounds.left+.16*u,t.bounds.top+.5549*u),new Pr(t.bounds.left+.27347*u,t.bounds.top+.44071*u),new Pr(t.bounds.left+.39694*u,t.bounds.top+.5649*u),new Pr(t.bounds.left+.72983*u,t.bounds.top+.23*u),new Pr(t.bounds.left+.84*u,t.bounds.top+.34085*u),new Pr(t.bounds.left+.39363*u,t.bounds.top+.79*u)]),this.ctx.fillStyle=ht(vo),this.ctx.fill(),this.ctx.restore()):t.type===fo&&t.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.bounds.left+u/2,t.bounds.top+u/2,u/4,0,2*Math.PI,!0),this.ctx.fillStyle=ht(vo),this.ctx.fill(),this.ctx.restore())),pi(t)&&t.value.length){switch(d=this.createFontStyle(r),w=d[0],p=d[1],h=this.fontMetrics.getMetrics(w,p).baseline,this.ctx.font=w,this.ctx.fillStyle=ht(r.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=gi(t.styles.textAlign),y=Ai(t),g=0,t.styles.textAlign){case 1:g+=y.width/2;break;case 2:g+=y.width}f=y.add(g,0,0,-y.height/2+1),this.ctx.save(),this.path([new Pr(y.left,y.top),new Pr(y.left+y.width,y.top),new Pr(y.left+y.width,y.top+y.height),new Pr(y.left,y.top+y.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Yn(t.value,f),r.letterSpacing,h),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!ln(t.styles.display,2048))return[3,20];if(null===t.styles.listStyleImage)return[3,19];if(0!==(m=t.styles.listStyleImage).type)return[3,18];v=void 0,B=m.url,o.label=15;case 15:return o.trys.push([15,17,,18]),[4,this.context.cache.match(B)];case 16:return v=o.sent(),this.ctx.drawImage(v,t.bounds.left-(v.width+10),t.bounds.top),[3,18];case 17:return o.sent(),this.context.logger.error("Error loading list-style-image "+B),[3,18];case 18:return[3,20];case 19:e.listValue&&-1!==t.styles.listStyleType&&(w=this.createFontStyle(r)[0],this.ctx.font=w,this.ctx.fillStyle=ht(r.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",y=new i(t.bounds.left,t.bounds.top+rt(t.styles.paddingTop,t.bounds.width),t.bounds.width,FA(r.lineHeight,r.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Yn(e.listValue,y),r.letterSpacing,FA(r.lineHeight,r.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),o.label=20;case 20:return[2]}})})},A.prototype.renderStackContent=function(e){return n(this,void 0,void 0,function(){var t,A,n,r,i,a,s,c,l,u,d,p,h,g,f;return o(this,function(o){switch(o.label){case 0:return ln(e.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(e.element)];case 1:o.sent(),t=0,A=e.negativeZIndex,o.label=2;case 2:return t<A.length?(f=A[t],[4,this.renderStack(f)]):[3,5];case 3:o.sent(),o.label=4;case 4:return t++,[3,2];case 5:return[4,this.renderNodeContent(e.element)];case 6:o.sent(),n=0,r=e.nonInlineLevel,o.label=7;case 7:return n<r.length?(f=r[n],[4,this.renderNode(f)]):[3,10];case 8:o.sent(),o.label=9;case 9:return n++,[3,7];case 10:i=0,a=e.nonPositionedFloats,o.label=11;case 11:return i<a.length?(f=a[i],[4,this.renderStack(f)]):[3,14];case 12:o.sent(),o.label=13;case 13:return i++,[3,11];case 14:s=0,c=e.nonPositionedInlineLevel,o.label=15;case 15:return s<c.length?(f=c[s],[4,this.renderStack(f)]):[3,18];case 16:o.sent(),o.label=17;case 17:return s++,[3,15];case 18:l=0,u=e.inlineLevel,o.label=19;case 19:return l<u.length?(f=u[l],[4,this.renderNode(f)]):[3,22];case 20:o.sent(),o.label=21;case 21:return l++,[3,19];case 22:d=0,p=e.zeroOrAutoZIndexOrTransformedOrOpacity,o.label=23;case 23:return d<p.length?(f=p[d],[4,this.renderStack(f)]):[3,26];case 24:o.sent(),o.label=25;case 25:return d++,[3,23];case 26:h=0,g=e.positiveZIndex,o.label=27;case 27:return h<g.length?(f=g[h],[4,this.renderStack(f)]):[3,30];case 28:o.sent(),o.label=29;case 29:return h++,[3,27];case 30:return[2]}})})},A.prototype.mask=function(e){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(e.slice(0).reverse()),this.ctx.closePath()},A.prototype.path=function(e){this.ctx.beginPath(),this.formatPath(e),this.ctx.closePath()},A.prototype.formatPath=function(e){var t=this;e.forEach(function(e,A){var n=Mr(e)?e.start:e;0===A?t.ctx.moveTo(n.x,n.y):t.ctx.lineTo(n.x,n.y),Mr(e)&&t.ctx.bezierCurveTo(e.startControl.x,e.startControl.y,e.endControl.x,e.endControl.y,e.end.x,e.end.y)})},A.prototype.renderRepeat=function(e,t,A,n){this.path(e),this.ctx.fillStyle=t,this.ctx.translate(A,n),this.ctx.fill(),this.ctx.translate(-A,-n)},A.prototype.resizeImage=function(e,t,A){var n;if(e.width===t&&e.height===A)return e;var o=(null!==(n=this.canvas.ownerDocument)&&void 0!==n?n:document).createElement("canvas");return o.width=Math.max(1,t),o.height=Math.max(1,A),o.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t,A),o},A.prototype.renderBackgroundImage=function(e){return n(this,void 0,void 0,function(){var t,A,n,r,i,a;return o(this,function(s){switch(s.label){case 0:t=e.styles.backgroundImage.length-1,A=function(A){var r,i,a,s,c,l,u,d,p,h,g,f,m,v,B,w,y,b,C,x,Q,F,U,S,k,E,I,T,H,D,P;return o(this,function(o){switch(o.label){case 0:if(0!==A.type)return[3,5];r=void 0,i=A.url,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,n.context.cache.match(i)];case 2:return r=o.sent(),[3,4];case 3:return o.sent(),n.context.logger.error("Error loading background-image "+i),[3,4];case 4:return r&&(a=ni(e,t,[r.width,r.height,r.width/r.height]),w=a[0],F=a[1],U=a[2],C=a[3],x=a[4],v=n.ctx.createPattern(n.resizeImage(r,C,x),"repeat"),n.renderRepeat(w,v,F,U)),[3,6];case 5:1===A.type?(s=ni(e,t,[null,null,null]),w=s[0],F=s[1],U=s[2],C=s[3],x=s[4],c=Ut(A.angle,C,x),l=c[0],u=c[1],d=c[2],p=c[3],h=c[4],(g=document.createElement("canvas")).width=C,g.height=x,f=g.getContext("2d"),m=f.createLinearGradient(u,p,d,h),Ft(A.stops,l).forEach(function(e){return m.addColorStop(e.stop,ht(e.color))}),f.fillStyle=m,f.fillRect(0,0,C,x),C>0&&x>0&&(v=n.ctx.createPattern(g,"repeat"),n.renderRepeat(w,v,F,U))):function(e){return 2===e.type}(A)&&(B=ni(e,t,[null,null,null]),w=B[0],y=B[1],b=B[2],C=B[3],x=B[4],Q=0===A.position.length?[At]:A.position,F=rt(Q[0],C),U=rt(Q[Q.length-1],x),S=function(e,t,A,n,o){var r=0,i=0;switch(e.size){case 0:0===e.shape?r=i=Math.min(Math.abs(t),Math.abs(t-n),Math.abs(A),Math.abs(A-o)):1===e.shape&&(r=Math.min(Math.abs(t),Math.abs(t-n)),i=Math.min(Math.abs(A),Math.abs(A-o)));break;case 2:if(0===e.shape)r=i=Math.min(St(t,A),St(t,A-o),St(t-n,A),St(t-n,A-o));else if(1===e.shape){var a=Math.min(Math.abs(A),Math.abs(A-o))/Math.min(Math.abs(t),Math.abs(t-n)),s=kt(n,o,t,A,!0),c=s[0],l=s[1];i=a*(r=St(c-t,(l-A)/a))}break;case 1:0===e.shape?r=i=Math.max(Math.abs(t),Math.abs(t-n),Math.abs(A),Math.abs(A-o)):1===e.shape&&(r=Math.max(Math.abs(t),Math.abs(t-n)),i=Math.max(Math.abs(A),Math.abs(A-o)));break;case 3:if(0===e.shape)r=i=Math.max(St(t,A),St(t,A-o),St(t-n,A),St(t-n,A-o));else if(1===e.shape){a=Math.max(Math.abs(A),Math.abs(A-o))/Math.max(Math.abs(t),Math.abs(t-n));var u=kt(n,o,t,A,!1);c=u[0],l=u[1],i=a*(r=St(c-t,(l-A)/a))}}return Array.isArray(e.size)&&(r=rt(e.size[0],n),i=2===e.size.length?rt(e.size[1],o):r),[r,i]}(A,F,U,C,x),k=S[0],E=S[1],k>0&&E>0&&(I=n.ctx.createRadialGradient(y+F,b+U,0,y+F,b+U,k),Ft(A.stops,2*k).forEach(function(e){return I.addColorStop(e.stop,ht(e.color))}),n.path(w),n.ctx.fillStyle=I,k!==E?(T=e.bounds.left+.5*e.bounds.width,H=e.bounds.top+.5*e.bounds.height,P=1/(D=E/k),n.ctx.save(),n.ctx.translate(T,H),n.ctx.transform(1,0,0,D,0,0),n.ctx.translate(-T,-H),n.ctx.fillRect(y,P*(b-H)+H,C,x*P),n.ctx.restore()):n.ctx.fill())),o.label=6;case 6:return t--,[2]}})},n=this,r=0,i=e.styles.backgroundImage.slice(0).reverse(),s.label=1;case 1:return r<i.length?(a=i[r],[5,A(a)]):[3,4];case 2:s.sent(),s.label=3;case 3:return r++,[3,1];case 4:return[2]}})})},A.prototype.renderSolidBorder=function(e,t,A){return n(this,void 0,void 0,function(){return o(this,function(n){return this.path(Zr(A,t)),this.ctx.fillStyle=ht(e),this.ctx.fill(),[2]})})},A.prototype.renderDoubleBorder=function(e,t,A,r){return n(this,void 0,void 0,function(){var n,i;return o(this,function(o){switch(o.label){case 0:return t<3?[4,this.renderSolidBorder(e,A,r)]:[3,2];case 1:return o.sent(),[2];case 2:return n=function(e,t){switch(t){case 0:return ei(e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox,e.topRightBorderBox,e.topRightBorderDoubleOuterBox);case 1:return ei(e.topRightBorderBox,e.topRightBorderDoubleOuterBox,e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox);case 2:return ei(e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox,e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox);default:return ei(e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox,e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox)}}(r,A),this.path(n),this.ctx.fillStyle=ht(e),this.ctx.fill(),i=function(e,t){switch(t){case 0:return ei(e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox,e.topRightBorderDoubleInnerBox,e.topRightPaddingBox);case 1:return ei(e.topRightBorderDoubleInnerBox,e.topRightPaddingBox,e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox);case 2:return ei(e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox,e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox);default:return ei(e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox,e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox)}}(r,A),this.path(i),this.ctx.fill(),[2]}})})},A.prototype.renderNodeBackgroundAndBorders=function(e){return n(this,void 0,void 0,function(){var t,A,n,r,i,a,s,c,l=this;return o(this,function(o){switch(o.label){case 0:return this.applyEffects(e.getEffects(2)),t=e.container.styles,A=!pt(t.backgroundColor)||t.backgroundImage.length,n=[{style:t.borderTopStyle,color:t.borderTopColor,width:t.borderTopWidth},{style:t.borderRightStyle,color:t.borderRightColor,width:t.borderRightWidth},{style:t.borderBottomStyle,color:t.borderBottomColor,width:t.borderBottomWidth},{style:t.borderLeftStyle,color:t.borderLeftColor,width:t.borderLeftWidth}],r=hi(ai(t.backgroundClip,0),e.curves),A||t.boxShadow.length?(this.ctx.save(),this.path(r),this.ctx.clip(),pt(t.backgroundColor)||(this.ctx.fillStyle=ht(t.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(e.container)]):[3,2];case 1:o.sent(),this.ctx.restore(),t.boxShadow.slice(0).reverse().forEach(function(t){l.ctx.save();var A,n,o,r,i,a=_r(e.curves),s=t.inset?0:1e4,c=(A=a,n=-s+(t.inset?1:-1)*t.spread.number,o=(t.inset?1:-1)*t.spread.number,r=t.spread.number*(t.inset?-2:2),i=t.spread.number*(t.inset?-2:2),A.map(function(e,t){switch(t){case 0:return e.add(n,o);case 1:return e.add(n+r,o);case 2:return e.add(n+r,o+i);case 3:return e.add(n,o+i)}return e}));t.inset?(l.path(a),l.ctx.clip(),l.mask(c)):(l.mask(a),l.ctx.clip(),l.path(c)),l.ctx.shadowOffsetX=t.offsetX.number+s,l.ctx.shadowOffsetY=t.offsetY.number,l.ctx.shadowColor=ht(t.color),l.ctx.shadowBlur=t.blur.number,l.ctx.fillStyle=t.inset?ht(t.color):"rgba(0,0,0,1)",l.ctx.fill(),l.ctx.restore()}),o.label=2;case 2:i=0,a=0,s=n,o.label=3;case 3:return a<s.length?0!==(c=s[a]).style&&!pt(c.color)&&c.width>0?2!==c.style?[3,5]:[4,this.renderDashedDottedBorder(c.color,c.width,i,e.curves,2)]:[3,11]:[3,13];case 4:return o.sent(),[3,11];case 5:return 3!==c.style?[3,7]:[4,this.renderDashedDottedBorder(c.color,c.width,i,e.curves,3)];case 6:return o.sent(),[3,11];case 7:return 4!==c.style?[3,9]:[4,this.renderDoubleBorder(c.color,c.width,i,e.curves)];case 8:return o.sent(),[3,11];case 9:return[4,this.renderSolidBorder(c.color,i,e.curves)];case 10:o.sent(),o.label=11;case 11:i++,o.label=12;case 12:return a++,[3,3];case 13:return[2]}})})},A.prototype.renderDashedDottedBorder=function(e,t,A,r,i){return n(this,void 0,void 0,function(){var n,a,s,c,l,u,d,p,h,g,f,m,v,B,w,y;return o(this,function(o){return this.ctx.save(),n=function(e,t){switch(t){case 0:return $r(e.topLeftBorderStroke,e.topRightBorderStroke);case 1:return $r(e.topRightBorderStroke,e.bottomRightBorderStroke);case 2:return $r(e.bottomRightBorderStroke,e.bottomLeftBorderStroke);default:return $r(e.bottomLeftBorderStroke,e.topLeftBorderStroke)}}(r,A),a=Zr(r,A),2===i&&(this.path(a),this.ctx.clip()),Mr(a[0])?(s=a[0].start.x,c=a[0].start.y):(s=a[0].x,c=a[0].y),Mr(a[1])?(l=a[1].end.x,u=a[1].end.y):(l=a[1].x,u=a[1].y),d=0===A||2===A?Math.abs(s-l):Math.abs(c-u),this.ctx.beginPath(),3===i?this.formatPath(n):this.formatPath(a.slice(0,2)),p=t<3?3*t:2*t,h=t<3?2*t:t,3===i&&(p=t,h=t),g=!0,d<=2*p?g=!1:d<=2*p+h?(p*=f=d/(2*p+h),h*=f):(m=Math.floor((d+h)/(p+h)),v=(d-m*p)/(m-1),h=(B=(d-(m+1)*p)/m)<=0||Math.abs(h-v)<Math.abs(h-B)?v:B),g&&(3===i?this.ctx.setLineDash([0,p+h]):this.ctx.setLineDash([p,h])),3===i?(this.ctx.lineCap="round",this.ctx.lineWidth=t):this.ctx.lineWidth=2*t+1.1,this.ctx.strokeStyle=ht(e),this.ctx.stroke(),this.ctx.setLineDash([]),2===i&&(Mr(a[0])&&(w=a[3],y=a[0],this.ctx.beginPath(),this.formatPath([new Pr(w.end.x,w.end.y),new Pr(y.start.x,y.start.y)]),this.ctx.stroke()),Mr(a[1])&&(w=a[1],y=a[2],this.ctx.beginPath(),this.formatPath([new Pr(w.end.x,w.end.y),new Pr(y.start.x,y.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},A.prototype.render=function(e){return n(this,void 0,void 0,function(){var t;return o(this,function(A){switch(A.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=ht(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),n=new Jr(e,null),o=new Xr(n),Yr(n,o,o,r=[]),qr(n.container,r),t=o,[4,this.renderStack(t)];case 1:return A.sent(),this.applyEffects([]),[2,this.canvas]}var n,o,r})})},A}(ui),pi=function(e){return e instanceof yo||e instanceof wo||e instanceof Bo&&e.type!==fo&&e.type!==go},hi=function(e,t){switch(e){case 0:return _r(t);case 2:return function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]}(t);default:return Vr(t)}},gi=function(e){switch(e){case 1:return"center";case 2:return"right";default:return"left"}},fi=["-apple-system","system-ui"],mi=function(e){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?e.filter(function(e){return-1===fi.indexOf(e)}):e},vi=function(e){function A(t,A){var n=e.call(this,t,A)||this;return n.canvas=A.canvas?A.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),n.options=A,n.canvas.width=Math.floor(A.width*A.scale),n.canvas.height=Math.floor(A.height*A.scale),n.canvas.style.width=A.width+"px",n.canvas.style.height=A.height+"px",n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-A.x,-A.y),n.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+A.width+"x"+A.height+" at "+A.x+","+A.y+") with scale "+A.scale),n}return t(A,e),A.prototype.render=function(e){return n(this,void 0,void 0,function(){var t,A;return o(this,function(n){switch(n.label){case 0:return t=zn(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,e),[4,Bi(t)];case 1:return A=n.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=ht(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(A,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},A}(ui),Bi=function(e){return new Promise(function(t,A){var n=new Image;n.onload=function(){t(n)},n.onerror=A,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))})},wi=function(){function e(e){var t=e.id,A=e.enabled;this.id=t,this.enabled=A,this.start=Date.now()}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.debug?console.debug.apply(console,r([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.prototype.getTime=function(){return Date.now()-this.start},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&"undefined"!=typeof window&&window.console&&"function"==typeof console.info&&console.info.apply(console,r([this.id,this.getTime()+"ms"],e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.warn?console.warn.apply(console,r([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.error?console.error.apply(console,r([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.instances={},e}(),yi=function(){function e(t,A){var n;this.windowBounds=A,this.instanceName="#"+e.instanceCount++,this.logger=new wi({id:this.instanceName,enabled:t.logging}),this.cache=null!==(n=t.cache)&&void 0!==n?n:new Fr(this,t)}return e.instanceCount=1,e}();"undefined"!=typeof window&&Qr.setContext(window);var bi=function(e,t){return n(void 0,void 0,void 0,function(){var n,r,s,c,l,u,d,p,h,g,f,m,v,B,w,y,b,C,x,Q,F,U,S,k,E,I,T,H,D,P,O,K,M,L,R,_,V,j;return o(this,function(o){switch(o.label){case 0:if(!e||"object"!=typeof e)return[2,Promise.reject("Invalid element provided as first argument")];if(!(n=e.ownerDocument))throw new Error("Element is not attached to a Document");if(!(r=n.defaultView))throw new Error("Document is not attached to a Window");return s={allowTaint:null!==(U=t.allowTaint)&&void 0!==U&&U,imageTimeout:null!==(S=t.imageTimeout)&&void 0!==S?S:15e3,proxy:t.proxy,useCORS:null!==(k=t.useCORS)&&void 0!==k&&k},c=A({logging:null===(E=t.logging)||void 0===E||E,cache:t.cache},s),l={windowWidth:null!==(I=t.windowWidth)&&void 0!==I?I:r.innerWidth,windowHeight:null!==(T=t.windowHeight)&&void 0!==T?T:r.innerHeight,scrollX:null!==(H=t.scrollX)&&void 0!==H?H:r.pageXOffset,scrollY:null!==(D=t.scrollY)&&void 0!==D?D:r.pageYOffset},u=new i(l.scrollX,l.scrollY,l.windowWidth,l.windowHeight),d=new yi(c,u),p=null!==(P=t.foreignObjectRendering)&&void 0!==P&&P,h={allowTaint:null!==(O=t.allowTaint)&&void 0!==O&&O,onclone:t.onclone,ignoreElements:t.ignoreElements,inlineImages:p,copyStyles:p},d.logger.debug("Starting document clone with size "+u.width+"x"+u.height+" scrolled to "+-u.left+","+-u.top),g=new cr(d,e,h),(f=g.clonedReferenceElement)?[4,g.toIFrame(n,u)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return m=o.sent(),v=Ko(f)||"HTML"===f.tagName?function(e){var t=e.body,A=e.documentElement;if(!t||!A)throw new Error("Unable to get document size");var n=Math.max(Math.max(t.scrollWidth,A.scrollWidth),Math.max(t.offsetWidth,A.offsetWidth),Math.max(t.clientWidth,A.clientWidth)),o=Math.max(Math.max(t.scrollHeight,A.scrollHeight),Math.max(t.offsetHeight,A.offsetHeight),Math.max(t.clientHeight,A.clientHeight));return new i(0,0,n,o)}(f.ownerDocument):a(d,f),B=v.width,w=v.height,y=v.left,b=v.top,C=Ci(d,f,t.backgroundColor),x={canvas:t.canvas,backgroundColor:C,scale:null!==(M=null!==(K=t.scale)&&void 0!==K?K:r.devicePixelRatio)&&void 0!==M?M:1,x:(null!==(L=t.x)&&void 0!==L?L:0)+y,y:(null!==(R=t.y)&&void 0!==R?R:0)+b,width:null!==(_=t.width)&&void 0!==_?_:Math.ceil(B),height:null!==(V=t.height)&&void 0!==V?V:Math.ceil(w)},p?(d.logger.debug("Document cloned, using foreign object rendering"),[4,new vi(d,x).render(f)]):[3,3];case 2:return Q=o.sent(),[3,5];case 3:return d.logger.debug("Document cloned, element located at "+y+","+b+" with size "+B+"x"+w+" using computed rendering"),d.logger.debug("Starting DOM parsing"),F=Fo(d,f),C===F.styles.backgroundColor&&(F.styles.backgroundColor=bt.TRANSPARENT),d.logger.debug("Starting renderer for element at "+x.x+","+x.y+" with size "+x.width+"x"+x.height),[4,new di(d,x).render(F)];case 4:Q=o.sent(),o.label=5;case 5:return(null===(j=t.removeContainer)||void 0===j||j)&&(cr.destroy(m)||d.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),d.logger.debug("Finished rendering"),[2,Q]}})})},Ci=function(e,t,A){var n=t.ownerDocument,o=n.documentElement?yt(e,getComputedStyle(n.documentElement).backgroundColor):bt.TRANSPARENT,r=n.body?yt(e,getComputedStyle(n.body).backgroundColor):bt.TRANSPARENT,i="string"==typeof A?yt(e,A):null===A?bt.TRANSPARENT:4294967295;return t===n.documentElement?pt(o)?pt(r)?i:r:o:i};return function(e,t){return void 0===t&&(t={}),bi(e,t)}}()}},t={};function A(n){var o=t[n];if(void 0!==o)return o.exports;var r=t[n]={exports:{}};return e[n].call(r.exports,r,r.exports,A),r.exports}A.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return A.d(t,{a:t}),t},A.d=(e,t)=>{for(var n in t)A.o(t,n)&&!A.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},A.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),A.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";A.r(n),A.d(n,{AgentSDK:()=>fr,AudioPlayer:()=>ZA,AudioRecorder:()=>q,EventEmitter:()=>O,MicPermissionModals:()=>t,MicPermissionUtils:()=>e,TTPChatWidget:()=>xo,TTPEcommerceWidget:()=>or,TextChatSDK:()=>mA,VERSION:()=>mr,VoiceSDK_v2:()=>oA,WebSocketManager:()=>_A,default:()=>vr});var e={};A.r(e),A.d(e,{checkPermissionState:()=>nn,getDeviceInfo:()=>An,getPermissionInstructions:()=>rn,openSettings:()=>an});var t={};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function r(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=o(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}A.r(t),A.d(t,{showBlockedModal:()=>gn,showNoMicrophoneModal:()=>fn,showPrePromptModal:()=>hn});const a=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.events={}},t=[{key:"on",value:function(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),this}},{key:"off",value:function(e,t){return this.events[e]?(this.events[e]=this.events[e].filter(function(e){return e!==t}),this):this}},{key:"emit",value:function(e){for(var t=arguments.length,A=new Array(t>1?t-1:0),n=1;n<t;n++)A[n-1]=arguments[n];return!!this.events[e]&&(this.events[e].forEach(function(e){e.apply(void 0,A)}),!0)}},{key:"once",value:function(e,t){var A=this,n=function(){t.apply(void 0,arguments),A.off(e,n)};return this.on(e,n)}},{key:"removeAllListeners",value:function(e){return e?delete this.events[e]:this.events={},this}}],t&&r(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function c(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function l(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=s(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}const u=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name="PCM"},(t=[{key:"decode",value:function(e){if(e instanceof ArrayBuffer)return e;if(e instanceof Uint8Array)return e.buffer;throw new Error("Invalid PCM data type")}},{key:"encode",value:function(e){return e}}])&&c(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function p(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,h(n.key),n)}}function h(e){var t=function(e){if("object"!=d(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=d(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==d(t)?t:t+""}const g=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name="PCMU"},(t=[{key:"decode",value:function(e){for(var t=e instanceof Uint8Array?e:new Uint8Array(e),A=new Int16Array(t.length),n=0;n<t.length;n++)A[n]=this.mulawToLinear(t[n]);return A.buffer}},{key:"encode",value:function(e){for(var t=e instanceof Int16Array?e:new Int16Array(e),A=new Uint8Array(t.length),n=0;n<t.length;n++)A[n]=this.linearToMulaw(t[n]);return A}},{key:"mulawToLinear",value:function(e){var t=1<<3+(e>>4&7);return(128&e?-1:1)*(132+(15&e)*t+(t>>1)-4)}},{key:"linearToMulaw",value:function(e){var t=e>>8&128;t&&(e=-e),e>32635&&(e=32635),e+=132;for(var A=7,n=16384;0===(e&n)&&A>0;A--,n>>=1);return 255&~(t|A<<4|e>>A+3&15)}}])&&p(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function m(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,v(n.key),n)}}function v(e){var t=function(e){if("object"!=f(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=f(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==f(t)?t:t+""}const B=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name="PCMA"},(t=[{key:"decode",value:function(e){for(var t=e instanceof Uint8Array?e:new Uint8Array(e),A=new Int16Array(t.length),n=0;n<t.length;n++)A[n]=this.alawToLinear(t[n]);return A.buffer}},{key:"encode",value:function(e){for(var t=e instanceof Int16Array?e:new Int16Array(e),A=new Uint8Array(t.length),n=0;n<t.length;n++)A[n]=this.linearToAlaw(t[n]);return A}},{key:"alawToLinear",value:function(e){var t=(e^=85)>>4&7,A=15&e;return(128&e?-1:1)*(0===t?8+(A<<4):264+(A<<4)<<t-1)}},{key:"linearToAlaw",value:function(e){var t,A,n=e>>8&128;if(n&&(e=-e),e>32635&&(e=32635),e<256)t=0,A=e>>4;else{t=7;for(var o=16384;0===(e&o)&&t>0;t--,o>>=1);A=e>>t+3&15}return 85^(n|t<<4|A)}}])&&m(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var A=0,n=Array(t);A<t;A++)n[A]=e[A];return n}function b(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],A=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&A>=e.length&&(e=void 0),{value:e&&e[A++],done:!e}}}}throw new TypeError(w(e)+" is not iterable")}function C(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return x(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(x(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,x(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,x(u,"constructor",c),x(c,"constructor",s),s.displayName="GeneratorFunction",x(c,o,"GeneratorFunction"),x(u),x(u,o,"Generator"),x(u,n,function(){return this}),x(u,"toString",function(){return"[object Generator]"}),(C=function(){return{w:r,m:d}})()}function x(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}x=function(e,t,A,n){function r(t,A){x(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},x(e,t,A,n)}function Q(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function F(e){return function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){Q(r,n,o,i,a,"next",e)}function a(e){Q(r,n,o,i,a,"throw",e)}i(void 0)})}}function U(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,S(n.key),n)}}function S(e){var t=function(e){if("object"!=w(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=w(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==w(t)?t:t+""}function k(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(k=function(){return!!e})()}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function I(e,t){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},I(e,t)}const T=function(e){function t(){var e,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),e=function(e,t,A){return t=E(t),function(e,t){if(t&&("object"==w(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,k()?Reflect.construct(t,A||[],E(e).constructor):t.apply(e,A))}(this,t),console.log("%c🔊 AUDIO PLAYER - SILENT BUFFER PRIMING FIX ENABLED","background: #10b981; color: white; font-size: 14px; font-weight: bold; padding: 4px 8px; border-radius: 4px;"),console.log("%cAndroid Greeting Cut-Off Fix: Silent buffer priming (150ms) + dynamic startup buffer","background: #d1fae5; color: #065f46; font-size: 12px; padding: 2px 6px; border-radius: 3px;"),console.log("%cBuild: 2026-01-30-SILENT-BUFFER-PRIMING | Look for [scheduleWAV] and priming logs","background: #e0e7ff; color: #1e40af; font-size: 11px; padding: 2px 6px; border-radius: 3px;"),console.log(""),e.config=A,e.audioContext=null,e.gainNode=null,e._audioContextPrimed=!1,e._waitForReadyStateHandler=null,e.audioQueue=[],e.isPlaying=!1,e.isProcessingQueue=!1,e.currentSource=null,e.outputFormat=null,e.nextStartTime=0,e.scheduledBuffers=0,e.scheduledSources=new Set,e.pcmChunkQueue=[],e.preparedBuffer=[],e.MAX_PREPARED_BUFFER_SIZE=200,e.MAX_PCM_CHUNK_QUEUE_SIZE=50,e.isProcessingPcmQueue=!1,e.isSchedulingFrames=!1,e._emptySentenceTimeout=null,e.MAX_LOOKAHEAD_SECONDS=.02,e.pendingSentenceText=null,e.sentenceTimings=[],e.isCheckingTranscripts=!1,e._isStopped=!1,e._currentSentenceId=0,e.codecs={pcm:new u,pcmu:new g,pcma:new B},e.SUPPORTED_CONTAINERS=["wav","raw"],e.SUPPORTED_ENCODINGS=["pcm","pcmu","pcma"],e.SUPPORTED_SAMPLE_RATES=[8e3,16e3,22050,24e3,44100,48e3],e.SUPPORTED_BIT_DEPTHS=[8,16,24],e.SUPPORTED_CHANNELS=[1],console.log("🎵 AudioPlayer v2 initialized"),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&I(e,t)}(t,e),A=t,n=[{key:"setOutputFormat",value:function(e){var t;this.validateFormat(e)||(console.warn("⚠️ AudioPlayer: Invalid format, using defaults:",e),e=this.getDefaultFormat());var A=null===(t=this.outputFormat)||void 0===t?void 0:t.sampleRate,n=e.sampleRate;this.outputFormat=e,console.log("✅ AudioPlayer v2: Format set:",e),this.audioContext&&A&&A!==n&&(console.warn("⚠️ AudioPlayer: Sample rate changed, recreating AudioContext"),console.warn(" Old: ".concat(A,"Hz → New: ").concat(n,"Hz")),this.stopImmediate(),this._cleanupAudioContext(),console.log("ℹ️ AudioContext will be recreated on next audio chunk with correct sample rate"))}},{key:"validateFormat",value:function(e){var t,A;if(!e)return!1;var n=null===(t=e.container)||void 0===t?void 0:t.toLowerCase(),o=null===(A=e.encoding)||void 0===A?void 0:A.toLowerCase();return n&&o&&this.SUPPORTED_CONTAINERS.includes(n)&&this.SUPPORTED_ENCODINGS.includes(o)&&this.SUPPORTED_SAMPLE_RATES.includes(e.sampleRate)&&this.SUPPORTED_BIT_DEPTHS.includes(e.bitDepth)&&(!e.channels||this.SUPPORTED_CHANNELS.includes(e.channels))}},{key:"getDefaultFormat",value:function(){return{container:"raw",encoding:"pcm",sampleRate:16e3,channels:1,bitDepth:16}}},{key:"playAudio",value:function(e){var t=this;if(this._isStopped)console.log("🛑 AudioPlayer: Ignoring audio chunk - playback was stopped (barge-in)");else try{var A=this.createAudioBlob(e);this.audioQueue.push(A),this.isPlaying||this.isProcessingQueue||this.currentSource||setTimeout(function(){return t.processQueue()},50)}catch(e){console.error("❌ AudioPlayer v2: Playback error:",e),this.emit("playbackError",e)}}},{key:"playChunk",value:(l=F(C().m(function e(t){var A,n,o=this;return C().w(function(e){for(;;)switch(e.n){case 0:if(!this._isStopped){e.n=1;break}return console.log("🛑 AudioPlayer: Ignoring PCM chunk - playback was stopped (barge-in)"),e.a(2);case 1:(A=this.prepareChunk(t))?(this._emptySentenceTimeout&&(clearTimeout(this._emptySentenceTimeout),this._emptySentenceTimeout=null),this.preparedBuffer.length>=this.MAX_PREPARED_BUFFER_SIZE&&(this.preparedBuffer.shift(),console.warn("⚠️ AudioPlayer: preparedBuffer at max size (".concat(this.MAX_PREPARED_BUFFER_SIZE,"), dropped oldest frame"))),this.preparedBuffer.push(A),this.isSchedulingFrames||this._isStopped?setTimeout(function(){o.preparedBuffer.length>0&&!o.isSchedulingFrames&&!o._isStopped&&o.schedulePreparedFrames()},5):this.schedulePreparedFrames(),this.pcmChunkQueue.length>0&&!this.isProcessingPcmQueue&&this.processPcmQueue()):(console.error("❌ AudioPlayer: playChunk failed - prepareChunk returned null"),console.error(" pcmData length:",(null==t?void 0:t.byteLength)||"undefined"),console.error(" outputFormat:",this.outputFormat),console.error(" audioContext:",this.audioContext?"initialized":"not initialized"),console.error(" audioContext state:",(null===(n=this.audioContext)||void 0===n?void 0:n.state)||"N/A"),this.emit("playbackError",new Error("Failed to prepare PCM chunk for playback")));case 2:return e.a(2)}},e,this)})),function(e){return l.apply(this,arguments)})},{key:"prepareChunk",value:function(e){try{var t;if(!this.outputFormat)return console.error("❌ AudioPlayer: Cannot prepare chunk - outputFormat not set"),console.error(" Call setOutputFormat() before playing audio chunks"),null;if(this.audioContext||this.initializeAudioContext(),!this.audioContext)return console.error("❌ AudioPlayer: Cannot prepare chunk - AudioContext not available"),null;var A=e;if(e.byteLength%2!=0){console.warn("⚠️ Odd PCM chunk size, padding:",e.byteLength);var n=new Uint8Array(e.byteLength+1);n.set(new Uint8Array(e),0),n[e.byteLength]=0,A=n.buffer}for(var o=new Int16Array(A),r=new Float32Array(o.length),i=1/32768,a=o.length,s=0;s<a;s++)r[s]=o[s]*i;var c=(null===(t=this.outputFormat)||void 0===t?void 0:t.sampleRate)||this.audioContext.sampleRate,l=this.audioContext.sampleRate,u=this.audioContext.createBuffer(1,r.length,c);u.getChannelData(0).set(r);var d=u.duration,p=r.length,h=d;return l!==c&&(h=p/l),{buffer:u,duration:h,sampleRate:c,contextSampleRate:l}}catch(e){return console.error("❌ AudioPlayer: Error preparing chunk:",e),null}}},{key:"applyFadeOut",value:function(e){return e}},{key:"schedulePreparedFrames",value:(c=F(C().m(function e(){var t,A,n,o,r,i,a,s,c,l=this;return C().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!this._isStopped){e.n=1;break}return console.log("🛑 AudioPlayer: Not scheduling frames - playback was stopped (barge-in)"),e.a(2);case 1:if(!this.isSchedulingFrames){e.n=2;break}return e.a(2);case 2:return this.isSchedulingFrames=!0,t=this.preparedBuffer.length,0===(A=Math.min(t,5))&&t>0&&(A=1),e.p=3,this.audioContext||this.initializeAudioContext(),console.log("🔍 [scheduleWAV] BEFORE waitForAudioContextReady - state:",null===(n=this.audioContext)||void 0===n?void 0:n.state,"currentTime:",null===(o=this.audioContext)||void 0===o?void 0:o.currentTime),e.n=4,this.waitForAudioContextReady();case 4:console.log("🔍 [scheduleWAV] AFTER waitForAudioContextReady - state:",null===(r=this.audioContext)||void 0===r?void 0:r.state,"currentTime:",null===(i=this.audioContext)||void 0===i?void 0:i.currentTime),a=0,s=C().m(function e(){var t,A,n,o,r,i,s;return C().w(function(e){for(;;)switch(e.n){case 0:if(!l._isStopped){e.n=1;break}return console.log("🛑 AudioPlayer: Stopping frame scheduling - playback was stopped"),e.a(2,0);case 1:if(t=l.preparedBuffer.shift()){e.n=2;break}return e.a(2,0);case 2:(A=l.audioContext.createBufferSource()).buffer=t.buffer,A.connect(l.gainNode||l.audioContext.destination),l.scheduledSources.add(A),n=l.audioContext.currentTime,0===l.scheduledBuffers?(o=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),r=.03,o&&(l._audioContextPrimed?r=0:(r=2,console.warn("⚠️ AudioPlayer: Audio not primed yet, using 2000ms fallback buffer"))),l.nextStartTime=n+r,console.log("🎵 [scheduleWAV] FIRST FRAME - primed: ".concat(l._audioContextPrimed,", buffer: ").concat(1e3*r,"ms"))):(i=n+l.MAX_LOOKAHEAD_SECONDS,l.nextStartTime<i&&(l.nextStartTime=i,console.warn("⚠️ AudioPlayer: Fell behind schedule, adjusting nextStartTime to ".concat(l.nextStartTime.toFixed(4),"s")))),l.pendingSentenceText&&(l.sentenceTimings.push({startTime:l.nextStartTime,text:l.pendingSentenceText,displayed:!1}),console.log("📝 AudioPlayer: Sentence scheduled at ".concat(l.nextStartTime.toFixed(3),'s: "').concat(l.pendingSentenceText.substring(0,40),'..."')),l.pendingSentenceText=null,l.isCheckingTranscripts||l.startTranscriptChecker()),A.start(l.nextStartTime),l.nextStartTime+=t.duration,l.nextStartTime=Math.round(1e6*l.nextStartTime)/1e6,s=l.nextStartTime-t.duration,l.scheduledBuffers<5&&(console.log("🎵 AudioPlayer: Scheduled frame ".concat(l.scheduledBuffers+1," at ").concat(s.toFixed(4),"s, next at ").concat(l.nextStartTime.toFixed(4),"s")),console.log(" Duration: ".concat(t.duration.toFixed(4),"s (").concat((1e3*t.duration).toFixed(2),"ms), Queued: ").concat(l.preparedBuffer.length,", Scheduled: ").concat(l.scheduledBuffers))),l.scheduledBuffers++,a++,A.onended=function(){if(!l._isStopped&&l.scheduledSources.has(A))if(l.scheduledSources.delete(A),!l._isStopped&&l.scheduledBuffers>0&&l.scheduledBuffers--,0!==l.scheduledBuffers||0!==l.preparedBuffer.length||0!==l.pcmChunkQueue.length||l._isStopped){if(l.preparedBuffer.length>0&&!l._isStopped)setTimeout(function(){l.preparedBuffer.length>0&&!l.isSchedulingFrames&&!l._isStopped&&l.schedulePreparedFrames()},0);else if(l.scheduledBuffers>0&&!l._isStopped){var e=function(){l._isStopped||(l.preparedBuffer.length>0&&!l.isSchedulingFrames&&l.scheduledBuffers>0?l.schedulePreparedFrames():l.scheduledBuffers>0&&!l._isStopped&&setTimeout(e,10))};setTimeout(e,10)}}else l.isPlaying=!1,l.isSchedulingFrames=!1,console.log("🛑 AudioPlayer: Emitting playbackStopped event (all buffers finished)"),l.emit("playbackStopped")},l.isPlaying||(l.isPlaying=!0,console.log("🎵 AudioPlayer: Emitting playbackStarted event"),l.emit("playbackStarted"));case 3:return e.a(2)}},e)});case 5:if(!(this.preparedBuffer.length>0&&a<A)){e.n=8;break}return e.d(b(s()),6);case 6:if(0!==e.v){e.n=7;break}return e.a(3,8);case 7:e.n=5;break;case 8:this.isSchedulingFrames=!1,this.preparedBuffer.length>0&&!this._isStopped&&requestAnimationFrame(function(){l.preparedBuffer.length>0&&!l.isSchedulingFrames&&!l._isStopped&&l.schedulePreparedFrames()}),this.scheduledBuffers>0&&!this._isStopped&&setTimeout(function(){l.preparedBuffer.length>0&&!l.isSchedulingFrames&&l.scheduledBuffers>0&&!l._isStopped?l.schedulePreparedFrames():l.scheduledBuffers>0&&!l._isStopped&&setTimeout(function(){l.preparedBuffer.length>0&&!l.isSchedulingFrames&&l.scheduledBuffers>0&&!l._isStopped&&l.schedulePreparedFrames()},10)},10),e.n=10;break;case 9:e.p=9,c=e.v,console.error("❌ AudioPlayer v2: Error scheduling frames:",c),this.emit("playbackError",c),this.isSchedulingFrames=!1;case 10:return e.a(2)}},e,this,[[3,9]])})),function(){return c.apply(this,arguments)})},{key:"processPcmQueue",value:(s=F(C().m(function e(){var t,A,n,o,r,i,a,s,c,l,u,d,p,h,g,f,m,v,B,w,y=this;return C().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!this._isStopped){e.n=1;break}return console.log("🛑 AudioPlayer: Not processing PCM queue - playback was stopped (barge-in)"),e.a(2);case 1:if(!this.isProcessingPcmQueue){e.n=2;break}return e.a(2);case 2:return this.isProcessingPcmQueue=!0,e.p=3,this.audioContext||this.initializeAudioContext(),e.n=4,this.waitForAudioContextReady();case 4:if(!(this.pcmChunkQueue.length>0)){e.n=7;break}if(!this._isStopped){e.n=5;break}return console.log("🛑 AudioPlayer: Stopping PCM queue processing - playback was stopped"),e.a(3,7);case 5:if(n=this.pcmChunkQueue.shift()){e.n=6;break}return e.a(3,4);case 6:for(o=n,n.byteLength%2!=0&&(console.warn("⚠️ Odd PCM chunk size, padding:",n.byteLength),(r=new Uint8Array(n.byteLength+1)).set(new Uint8Array(n),0),r[n.byteLength]=0,o=r.buffer),i=new Int16Array(o),a=new Float32Array(i.length),s=1/32768,c=i.length,l=0;l<c;l++)a[l]=i[l]*s;u=(null===(t=this.outputFormat)||void 0===t?void 0:t.sampleRate)||this.audioContext.sampleRate,d=this.audioContext.sampleRate,null!==(A=this.outputFormat)&&void 0!==A&&A.sampleRate?this.scheduledBuffers<3&&console.log("🎵 AudioPlayer: Creating buffer at ".concat(u,"Hz (AudioContext: ").concat(d,"Hz)")):console.warn("⚠️ AudioPlayer: outputFormat.sampleRate not set! Using AudioContext sample rate:",d),(p=this.audioContext.createBuffer(1,a.length,u)).getChannelData(0).set(a),(h=this.audioContext.createBufferSource()).buffer=p,h.connect(this.gainNode||this.audioContext.destination),g=this.audioContext.currentTime,this.nextStartTime<g&&(this.nextStartTime=g,0===this.scheduledBuffers&&console.log("🎵 Starting playback at current time:",g)),f=p.duration,m=a.length,v=f,d!==u&&(v=m/d,this.scheduledBuffers<3&&(console.log("🔄 Resampling detected: ".concat(u,"Hz → ").concat(d,"Hz")),console.log(" Buffer duration: ".concat(f.toFixed(4),"s, Calculated: ").concat(v.toFixed(4),"s")))),h.start(this.nextStartTime),this.nextStartTime+=v,this.nextStartTime=Math.round(1e6*this.nextStartTime)/1e6,this.scheduledBuffers<3&&(B=this.nextStartTime-v,console.log("🎵 AudioPlayer: Scheduled chunk ".concat(this.scheduledBuffers+1," at ").concat(B.toFixed(4),"s, next at ").concat(this.nextStartTime.toFixed(4),"s")),console.log(" Duration: ".concat(v.toFixed(4),"s (").concat((1e3*v).toFixed(2),"ms)"))),this.scheduledBuffers++,h.onended=function(){y.scheduledBuffers--,0===y.scheduledBuffers&&0===y.pcmChunkQueue.length&&(y.isPlaying=!1,y.isProcessingPcmQueue=!1,y.emit("playbackStopped"))},this.isPlaying||(this.isPlaying=!0,this.emit("playbackStarted")),e.n=4;break;case 7:this.isProcessingPcmQueue=!1,e.n=9;break;case 8:e.p=8,w=e.v,console.error("❌ AudioPlayer v2: Error playing chunk:",w),this.emit("playbackError",w),this.isProcessingPcmQueue=!1;case 9:return e.a(2)}},e,this,[[3,8]])})),function(){return s.apply(this,arguments)})},{key:"createAudioBlob",value:function(e){var t=new Uint8Array(e);console.log("🎵 AudioPlayer: Processing ".concat(t.length," bytes")),console.log("🎵 AudioPlayer: Negotiated format:",this.outputFormat);var A=this.outputFormat&&this.outputFormat.container&&"wav"===this.outputFormat.container.toLowerCase(),n=this.outputFormat&&this.outputFormat.container&&"raw"===this.outputFormat.container.toLowerCase(),o=this.isWavFile(t);if(o&&console.log("🎵 AudioPlayer: Data has WAV header (RIFF)"),n&&o)return console.error("❌ AudioPlayer: CRITICAL MISMATCH!"),console.error(" Negotiated format: RAW"),console.error(" Actual data: WAV (RIFF header detected)"),console.error(" Backend is ignoring format request and sending WAV anyway."),console.warn("⚠️ AudioPlayer: Processing as WAV to avoid playback failure, but UI configuration was bypassed."),this.handleWavFile(t);if(n&&!o)console.log("🎵 AudioPlayer: Processing as RAW data (as negotiated)");else{if(A&&o)return console.log("✅ AudioPlayer: Processing as WAV file (matches negotiation)"),this.handleWavFile(t);if(A&&!o)return console.warn("⚠️ AudioPlayer: Negotiated WAV but data lacks WAV header. Attempting WAV processing anyway."),this.handleWavFile(t);if(!this.outputFormat&&o)return console.log("🎵 AudioPlayer: No format negotiated, auto-detecting WAV"),this.handleWavFile(t);this.outputFormat||o||(console.warn("⚠️ AudioPlayer: No format negotiated and data not WAV, using defaults"),this.outputFormat=this.getDefaultFormat())}return this.outputFormat||(console.warn("⚠️ AudioPlayer: No format set, using defaults"),this.outputFormat=this.getDefaultFormat()),console.log("🎵 AudioPlayer: Processing as RAW data with encoding:",this.outputFormat.encoding),this.handleRawData(t)}},{key:"isWavFile",value:function(e){return e.length>=44&&82===e[0]&&73===e[1]&&70===e[2]&&70===e[3]}},{key:"handleWavFile",value:function(e){var t=this.parseWavHeader(e);if(console.log("🎵 WAV file detected:",{format:t.audioFormat,encoding:this.getEncodingName(t.audioFormat),sampleRate:t.sampleRate,channels:t.channels,bitDepth:t.bitsPerSample}),1===t.audioFormat)return console.log("✅ PCM WAV - using directly"),new Blob([e],{type:"audio/wav"});var A=this.getCodecForWavFormat(t.audioFormat);if(!A)throw new Error("Unsupported WAV format code: ".concat(t.audioFormat));console.log("🔄 Non-PCM WAV - converting to PCM WAV");var n=e.slice(44),o=A.decode(n),r=this.createWavHeader(o.byteLength,t.sampleRate,t.channels,16);return new Blob([r,o],{type:"audio/wav"})}},{key:"handleRawData",value:function(e){var t,A,n=this.outputFormat.encoding.toLowerCase(),o=this.getCodec(n);if(!o)throw new Error("No codec found for encoding: ".concat(n));if(console.log("🎵 AudioPlayer: Decoding ".concat(n.toUpperCase()," to PCM")),console.log("🎵 AudioPlayer: Input format - bitDepth: ".concat(this.outputFormat.bitDepth,", sampleRate: ").concat(this.outputFormat.sampleRate)),"pcm"===n){var r=this.outputFormat.bitDepth||16;e.length,24===r?(console.warn("⚠️ AudioPlayer: Format says 24-bit PCM, but browser support is limited."),console.warn(" Treating as 16-bit PCM. If audio sounds wrong, backend should send 16-bit instead."),t=this.convert24BitTo16Bit(e),A=16):8===r?(console.log("🔄 AudioPlayer: Converting 8-bit PCM to 16-bit PCM"),t=this.convert8BitTo16Bit(e),A=16):(t=e.buffer,A=r,console.log("✅ AudioPlayer: Using native ".concat(r,"-bit PCM (no conversion needed)")))}else t=o.decode(e),A=16,console.log("🔄 AudioPlayer: Decoded ".concat(n.toUpperCase()," to 16-bit PCM"));var i=this.createWavHeader(t.byteLength,this.outputFormat.sampleRate,this.outputFormat.channels,A);return new Blob([i,t],{type:"audio/wav"})}},{key:"convert24BitTo16Bit",value:function(e){for(var t=Math.floor(e.length/3),A=new Int16Array(t),n=0;n<t;n++){var o=e[3*n],r=e[3*n+1],i=e[3*n+2],a=o|r<<8|(255&i)<<16;128&i&&(a|=4278190080),A[n]=Math.max(-32768,Math.min(32767,Math.round(a/256)))}return A.buffer}},{key:"convert8BitTo16Bit",value:function(e){for(var t=e.length,A=new Int16Array(t),n=0;n<t;n++){var o=e[n];A[n]=256*(o-128)}return A.buffer}},{key:"getCodec",value:function(e){var t={pcm:"pcm",linear:"pcm",l16:"pcm",pcmu:"pcmu",ulaw:"pcmu",mulaw:"pcmu",g711u:"pcmu",pcma:"pcma",alaw:"pcma",g711a:"pcma"}[e.toLowerCase()];return this.codecs[t]}},{key:"getCodecForWavFormat",value:function(e){switch(e){case 1:return this.codecs.pcm;case 6:return this.codecs.pcma;case 7:return this.codecs.pcmu;default:return null}}},{key:"getEncodingName",value:function(e){switch(e){case 1:return"PCM";case 6:return"A-law";case 7:return"μ-law";default:return"Unknown (".concat(e,")")}}},{key:"parseWavHeader",value:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{audioFormat:t.getUint16(20,!0),channels:t.getUint16(22,!0),sampleRate:t.getUint32(24,!0),byteRate:t.getUint32(28,!0),blockAlign:t.getUint16(32,!0),bitsPerSample:t.getUint16(34,!0)}}},{key:"createWavHeader",value:function(e,t,A,n){var o=new ArrayBuffer(44),r=new DataView(o);return r.setUint32(0,1380533830,!1),r.setUint32(4,36+e,!0),r.setUint32(8,1463899717,!1),r.setUint32(12,1718449184,!1),r.setUint32(16,16,!0),r.setUint16(20,1,!0),r.setUint16(22,A,!0),r.setUint32(24,t,!0),r.setUint32(28,t*A*n/8,!0),r.setUint16(32,A*n/8,!0),r.setUint16(34,n,!0),r.setUint32(36,1684108385,!1),r.setUint32(40,e,!0),o}},{key:"waitForAudioContextReady",value:(a=F(C().m(function e(){var t,A,n,o=this;return C().w(function(e){for(;;)switch(e.n){case 0:if(console.log("🔍 [waitForAudioContextReady] ENTRY - audioContext exists:",!!this.audioContext),this.audioContext||(console.log("🔍 [waitForAudioContextReady] Creating AudioContext..."),this.initializeAudioContext(),console.log("🔍 [waitForAudioContextReady] After initializeAudioContext - state:",null===(t=this.audioContext)||void 0===t?void 0:t.state,"currentTime:",null===(A=this.audioContext)||void 0===A?void 0:A.currentTime)),this.audioContext){e.n=1;break}return console.error("❌ AudioPlayer: Failed to create AudioContext"),e.a(2,Promise.resolve());case 1:if(n=this.audioContext,console.log("🔍 [waitForAudioContextReady] Initial state:",n.state,"currentTime:",n.currentTime),"running"!==n.state){e.n=2;break}return console.log("🔍 [waitForAudioContextReady] Already running - returning immediately, currentTime:",n.currentTime),e.a(2,Promise.resolve());case 2:if("suspended"!==n.state){e.n=5;break}return console.log("🔍 [waitForAudioContextReady] State is suspended - calling resume()..."),e.n=3,n.resume();case 3:if(console.log("🔍 [waitForAudioContextReady] After resume() - state:",n.state,"currentTime:",n.currentTime),"running"===n.state){e.n=4;break}return console.log("🔍 [waitForAudioContextReady] Still not running after resume() - waiting for statechange event..."),e.a(2,new Promise(function(e){var t=setTimeout(function(){n&&o._waitForReadyStateHandler&&(n.removeEventListener("statechange",o._waitForReadyStateHandler),o._waitForReadyStateHandler=null),console.warn("⚠️ AudioPlayer: AudioContext did not become running within timeout - proceeding anyway, state:",null==n?void 0:n.state,"currentTime:",null==n?void 0:n.currentTime),e()},2e3),A=function(){if(console.log("🔍 [waitForAudioContextReady] statechange event fired - state:",null==n?void 0:n.state,"currentTime:",null==n?void 0:n.currentTime),!n)return clearTimeout(t),o._waitForReadyStateHandler=null,console.warn("⚠️ AudioPlayer: AudioContext became null during state change"),void e();"running"===n.state&&(clearTimeout(t),o._waitForReadyStateHandler&&(n.removeEventListener("statechange",o._waitForReadyStateHandler),o._waitForReadyStateHandler=null),console.log("✅ [waitForAudioContextReady] AudioContext became running via statechange, currentTime:",n.currentTime),e())};o._waitForReadyStateHandler=A,n.addEventListener("statechange",A),console.log("🔍 [waitForAudioContextReady] Synchronous check - state:",null==n?void 0:n.state),n&&"running"===n.state&&(clearTimeout(t),o._waitForReadyStateHandler&&(n.removeEventListener("statechange",o._waitForReadyStateHandler),o._waitForReadyStateHandler=null),console.log("✅ [waitForAudioContextReady] State became running synchronously, currentTime:",n.currentTime),e())}));case 4:console.log("🔍 [waitForAudioContextReady] State is running after resume() - returning, currentTime:",n.currentTime);case 5:if("closed"!==n.state){e.n=6;break}return console.warn("⚠️ AudioPlayer: AudioContext was closed, recreating..."),this.initializeAudioContext(),e.a(2,this.waitForAudioContextReady());case 6:return console.log("🔍 [waitForAudioContextReady] EXIT - state:",n.state,"currentTime:",n.currentTime),e.a(2,Promise.resolve())}},e,this)})),function(){return a.apply(this,arguments)})},{key:"initializeAudioContext",value:function(){var e,t,A=(null===(e=this.outputFormat)||void 0===e?void 0:e.sampleRate)||44100;if(48e3!==A&&44100!==A&&(console.log("ℹ️ AudioPlayer: Backend requested ".concat(A,"Hz, but browser may resample")),console.log(" Consider requesting 44100Hz or 48000Hz from backend to avoid resampling and improve quality")),this.audioContext){var n=this.audioContext.sampleRate;if(!(Math.abs(n-A)>100))return;console.warn("⚠️ AudioPlayer: AudioContext sample rate (".concat(n,"Hz) doesn't match format (").concat(A,"Hz), recreating...")),this.stopImmediate(),this._cleanupAudioContext()}console.log("🎵 AudioPlayer: Creating AudioContext at ".concat(A,"Hz (from outputFormat: ").concat((null===(t=this.outputFormat)||void 0===t?void 0:t.sampleRate)||"not set",")"));try{this.audioContext=new(window.AudioContext||window.webkitAudioContext)({sampleRate:A,latencyHint:"playback"}),console.log("✅ AudioContext created at ".concat(this.audioContext.sampleRate,"Hz (requested: ").concat(A,"Hz)")),Math.abs(this.audioContext.sampleRate-A)>100?(console.error("❌ CRITICAL: Browser sample rate mismatch!"),console.error(" Requested: ".concat(A,"Hz")),console.error(" Got: ".concat(this.audioContext.sampleRate,"Hz")),console.error(" This WILL cause audio distortion/noise!"),console.error(" Solution: Backend should send ".concat(this.audioContext.sampleRate,"Hz audio instead"))):this.audioContext.sampleRate!==A&&(console.warn("⚠️ Browser adjusted sample rate: ".concat(A,"Hz → ").concat(this.audioContext.sampleRate,"Hz")),console.warn(" Browser will automatically resample audio.")),this.setupAudioContextStateMonitoring(),this.gainNode=this.audioContext.createGain(),this.gainNode.gain.value=1,this.gainNode.connect(this.audioContext.destination),console.log("✅ AudioPlayer: GainNode created for volume control"),this._primeAudioContext()}catch(e){console.error("❌ Failed to create AudioContext:",e),this.audioContext=new(window.AudioContext||window.webkitAudioContext),console.log("ℹ️ Using browser default: ".concat(this.audioContext.sampleRate,"Hz")),this.setupAudioContextStateMonitoring(),this.gainNode=this.audioContext.createGain(),this.gainNode.gain.value=1,this.gainNode.connect(this.audioContext.destination),console.log("✅ AudioPlayer: GainNode created for volume control (fallback)"),this._primeAudioContext()}}},{key:"_primeAudioContext",value:(i=F(C().m(function e(){var t,A,n,o;return C().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,this.audioContext&&!this._audioContextPrimed){e.n=1;break}return e.a(2);case 1:return t=this.audioContext.sampleRate,A=this.audioContext.createBuffer(1,.15*t,t),(n=this.audioContext.createBufferSource()).buffer=A,n.connect(this.audioContext.destination),n.start(),e.n=2,new Promise(function(e){return setTimeout(e,150)});case 2:this._audioContextPrimed=!0,console.log("✅ AudioPlayer: Audio hardware primed with silent buffer"),e.n=4;break;case 3:e.p=3,o=e.v,console.error("❌ AudioPlayer: Audio priming failed:",o);case 4:return e.a(2)}},e,this,[[0,3]])})),function(){return i.apply(this,arguments)})},{key:"_cleanupAudioContext",value:function(){if(console.log("[TTP AudioPlayer] 🧹 Cleaning up AudioContext (refactored method)"),this.gainNode){try{this.gainNode.disconnect()}catch(e){}this.gainNode=null}this._audioContextStateChangeHandler&&this.audioContext&&(this.audioContext.removeEventListener("statechange",this._audioContextStateChangeHandler),this._audioContextStateChangeHandler=null),this._waitForReadyStateHandler&&this.audioContext&&(this.audioContext.removeEventListener("statechange",this._waitForReadyStateHandler),this._waitForReadyStateHandler=null),this.audioContext&&"closed"!==this.audioContext.state&&this.audioContext.close(),this.audioContext=null,this._audioContextPrimed=!1}},{key:"setupAudioContextStateMonitoring",value:function(){var e=this;this.audioContext&&(this._audioContextStateChangeHandler&&this.audioContext.removeEventListener("statechange",this._audioContextStateChangeHandler),this._audioContextStateChangeHandler=function(){e.audioContext?(console.log("🎵 AudioPlayer: AudioContext state changed to: ".concat(e.audioContext.state)),"suspended"===e.audioContext.state&&e.isPlaying?console.warn("⚠️ AudioPlayer: AudioContext suspended during playback"):"running"===e.audioContext.state&&!e.isPlaying&&(e.audioQueue.length>0||e.pcmChunkQueue.length>0||e.preparedBuffer.length>0)&&(console.log("✅ AudioPlayer: AudioContext resumed - resuming queue processing"),e.audioQueue.length>0&&!e.isProcessingQueue&&setTimeout(function(){return e.processQueue()},50),e.pcmChunkQueue.length>0&&!e.isProcessingPcmQueue&&setTimeout(function(){return e.processPcmQueue()},50),e.preparedBuffer.length>0&&!e.isSchedulingFrames&&setTimeout(function(){return e.scheduleFrames()},50))):console.warn("⚠️ AudioPlayer: State change handler fired but AudioContext is null")},this.audioContext.addEventListener("statechange",this._audioContextStateChangeHandler))}},{key:"processQueue",value:(r=F(C().m(function e(){var t,A,n,o,r,i,a,s,c=this;return C().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!this._isStopped){e.n=1;break}return console.log("🛑 AudioPlayer: Not processing queue - playback was stopped (barge-in)"),e.a(2);case 1:if(!this.isProcessingQueue&&0!==this.audioQueue.length){e.n=2;break}return e.a(2);case 2:if(this.isProcessingQueue=!0,t=this.audioQueue.shift()){e.n=3;break}return this.isProcessingQueue=!1,e.a(2);case 3:return e.p=3,A=!this.isPlaying&&null===this.currentSource,this.audioContext||this.initializeAudioContext(),e.n=4,this.waitForAudioContextReady();case 4:return n=this.audioContext,e.n=5,t.arrayBuffer();case 5:return o=e.v,e.n=6,n.decodeAudioData(o);case 6:r=e.v,i=A&&!this.isPlaying&&null===this.currentSource,(a=n.createBufferSource()).buffer=r,a.connect(this.gainNode||n.destination),this.currentSource=a,this.isPlaying=!0,i&&this.emit("playbackStarted"),a.onended=function(){c.currentSource=null,c.isProcessingQueue=!1,c.audioQueue.length>0?setTimeout(function(){return c.processQueue()},50):setTimeout(function(){0!==c.audioQueue.length||c.currentSource||(c.isPlaying=!1,c.emit("playbackStopped"))},100)},a.start(),e.n=8;break;case 7:e.p=7,s=e.v,console.error("❌ AudioPlayer v2: Error processing queue:",s),this.currentSource=null,this.emit("playbackError",s),this.audioQueue.length>0?(this.isProcessingQueue=!1,setTimeout(function(){return c.processQueue()},100)):(this.isPlaying=!1,this.isProcessingQueue=!1,this.emit("playbackStopped"));case 8:return e.a(2)}},e,this,[[3,7]])})),function(){return r.apply(this,arguments)})},{key:"stop",value:function(){this.stopImmediate()}},{key:"reset",value:function(){this.stop(),this.audioQueue=[],this.pcmChunkQueue=[]}},{key:"stopImmediate",value:function(){var e=this.isPlaying||null!==this.currentSource||this.scheduledSources.size>0;if(console.log("🛑 AudioPlayer.stopImmediate() called"),console.log(" isPlaying:",this.isPlaying),console.log(" currentSource:",null!==this.currentSource),console.log(" scheduledSources.size:",this.scheduledSources.size),console.log(" scheduledBuffers:",this.scheduledBuffers),this._isStopped=!0,this.isSchedulingFrames=!1,this.currentSource){try{console.log(" Stopping currentSource..."),this.currentSource.stop()}catch(e){console.log(" currentSource already stopped or error:",e.message)}this.currentSource=null}if(this.scheduledSources.size>0){console.log(" Stopping ".concat(this.scheduledSources.size," scheduled sources..."));var t=0,A=Array.from(this.scheduledSources),n=A.length;this.scheduledSources.clear(),this.scheduledBuffers=0;for(var o=0,r=A;o<r.length;o++){var i=r[o];try{i.stop(),t++}catch(e){console.log(" Source already stopped or not started:",e.message)}}console.log(" Stopped ".concat(t," sources (cleared ").concat(n," from scheduledSources)"))}this.isPlaying=!1,this.isProcessingQueue=!1,this.audioQueue=[],this.pcmChunkQueue=[],this.preparedBuffer=[],this.isProcessingPcmQueue=!1,this.isSchedulingFrames=!1,this._emptySentenceTimeout&&(clearTimeout(this._emptySentenceTimeout),this._emptySentenceTimeout=null),this.nextStartTime=0,this.clearTranscriptState(),e&&(console.log("🛑 AudioPlayer: Emitting playbackStopped event (stopImmediate called)"),this.emit("playbackStopped"))}},{key:"markNewSentence",value:function(e){var t=this,A=this._isStopped,n=this.isPlaying||this.scheduledSources.size>0;this._isStopped?(console.log("🛑 AudioPlayer: Clearing stopped flag - new audio starting after barge-in"),this._isStopped=!1,this.nextStartTime=0,this.scheduledBuffers<0&&console.log("🔄 AudioPlayer: scheduledBuffers was negative (".concat(this.scheduledBuffers,"), resetting to 0")),this.scheduledBuffers=0,this.preparedBuffer.length>0&&console.log("🔄 AudioPlayer: Clearing ".concat(this.preparedBuffer.length," prepared frames from previous sentence (after barge-in)")),this.preparedBuffer=[],this.pcmChunkQueue.length>0&&console.log("🔄 AudioPlayer: Clearing ".concat(this.pcmChunkQueue.length," raw PCM chunks from previous sentence (after barge-in)")),this.pcmChunkQueue=[],this.isProcessingPcmQueue=!1,console.log("🔄 AudioPlayer: Reset scheduling state for new sentence (after barge-in)")):n&&console.log("📝 AudioPlayer: New sentence queued while audio playing - will start after current sentence finishes"),this.pendingSentenceText=e,console.log('📝 AudioPlayer: New sentence marked: "'.concat(e.substring(0,40),'..." (wasStopped: ').concat(A,", isPlaying: ").concat(n,")")),this._emptySentenceTimeout&&clearTimeout(this._emptySentenceTimeout);var o=e;this._emptySentenceTimeout=setTimeout(function(){t.pendingSentenceText!==o||0!==t.scheduledBuffers||0!==t.preparedBuffer.length||0!==t.pcmChunkQueue.length||t._isStopped||(console.warn('⚠️ AudioPlayer: Empty sentence detected after 5s timeout - no chunks received for: "'.concat(o.substring(0,40),'..."')),t.pendingSentenceText===o&&(t.pendingSentenceText=null),t.isPlaying||0!==t.scheduledSources.size||(console.log("🛑 AudioPlayer: Emitting playbackStopped for empty sentence timeout"),t.emit("playbackStopped"))),t._emptySentenceTimeout=null},5e3)}},{key:"startTranscriptChecker",value:function(){var e=this;if(!this.isCheckingTranscripts){this.isCheckingTranscripts=!0,console.log("📝 AudioPlayer: Transcript checker started");var t=function(){if(e.isCheckingTranscripts&&e.audioContext){var A,n=e.audioContext.currentTime,o=function(e,t){var A="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!A){if(Array.isArray(e)||(A=function(e,t){if(e){if("string"==typeof e)return y(e,t);var A={}.toString.call(e).slice(8,-1);return"Object"===A&&e.constructor&&(A=e.constructor.name),"Map"===A||"Set"===A?Array.from(e):"Arguments"===A||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A)?y(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){A&&(e=A);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){A=A.call(e)},n:function(){var e=A.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==A.return||A.return()}finally{if(a)throw r}}}}(e.sentenceTimings);try{for(o.s();!(A=o.n()).done;){var r=A.value;!r.displayed&&n>=r.startTime&&(r.displayed=!0,console.log("📝 AudioPlayer: Display transcript at ".concat(n.toFixed(3),'s: "').concat(r.text.substring(0,40),'..."')),e.emit("transcriptDisplay",{text:r.text}))}}catch(e){o.e(e)}finally{o.f()}e.isPlaying||e.scheduledBuffers>0?requestAnimationFrame(t):(e.isCheckingTranscripts=!1,console.log("📝 AudioPlayer: Transcript checker stopped"))}};requestAnimationFrame(t)}}},{key:"clearTranscriptState",value:function(){this.pendingSentenceText=null,this.sentenceTimings=[],this.isCheckingTranscripts=!1,console.log("📝 AudioPlayer: Transcript state cleared")}},{key:"resumeAudioContext",value:(o=F(C().m(function e(){var t;return C().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this.audioContext&&"closed"!==this.audioContext.state){e.n=2;break}return e.n=1,this.initializeAudioContext();case 1:return e.a(2);case 2:if("suspended"!==this.audioContext.state){e.n=6;break}return e.p=3,e.n=4,this.audioContext.resume();case 4:console.log("✅ AudioPlayer v2: AudioContext resumed after mic permission"),e.n=6;break;case 5:e.p=5,t=e.v,console.warn("⚠️ AudioPlayer v2: Failed to resume AudioContext:",t);case 6:return e.a(2)}},e,this,[[3,5]])})),function(){return o.apply(this,arguments)})},{key:"setVolume",value:function(e){this.gainNode?(this.gainNode.gain.value=Math.max(0,Math.min(1,e)),console.log("🔊 AudioPlayer: Volume set to ".concat(this.gainNode.gain.value))):console.warn("⚠️ AudioPlayer: Cannot set volume - gainNode not initialized")}},{key:"setMuted",value:function(e){this.setVolume(e?0:1)}},{key:"getStatus",value:function(){return{isPlaying:this.isPlaying,isProcessingQueue:this.isProcessingQueue,queueLength:this.audioQueue.length,audioContextState:this.audioContext?this.audioContext.state:"closed",outputFormat:this.outputFormat,scheduledBuffers:this.scheduledBuffers,preparedBufferLength:this.preparedBuffer.length,scheduledSourcesCount:this.scheduledSources.size}}},{key:"destroy",value:function(){this.stop(),this._cleanupAudioContext(),this.removeAllListeners()}}],n&&U(A.prototype,n),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,n,o,r,i,a,s,c,l}(a);function H(e){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H(e)}function D(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,P(n.key),n)}}function P(e){var t=function(e){if("object"!=H(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=H(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==H(t)?t:t+""}var O=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.events={}},t=[{key:"on",value:function(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t)}},{key:"off",value:function(e,t){this.events[e]&&(this.events[e]=this.events[e].filter(function(e){return e!==t}))}},{key:"emit",value:function(e){for(var t=arguments.length,A=new Array(t>1?t-1:0),n=1;n<t;n++)A[n-1]=arguments[n];this.events[e]&&this.events[e].forEach(function(t){try{t.apply(void 0,A)}catch(t){console.error("Error in event listener for ".concat(e,":"),t)}})}},{key:"removeAllListeners",value:function(e){e?delete this.events[e]:this.events={}}}],t&&D(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function K(e){return K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},K(e)}function M(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),A.push.apply(A,n)}return A}function L(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?M(Object(A),!0).forEach(function(t){R(e,t,A[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):M(Object(A)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}return e}function R(e,t,A){return(t=z(t))in e?Object.defineProperty(e,t,{value:A,enumerable:!0,configurable:!0,writable:!0}):e[t]=A,e}function _(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return V(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(V(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,V(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,V(u,"constructor",c),V(c,"constructor",s),s.displayName="GeneratorFunction",V(c,o,"GeneratorFunction"),V(u),V(u,o,"Generator"),V(u,n,function(){return this}),V(u,"toString",function(){return"[object Generator]"}),(_=function(){return{w:r,m:d}})()}function V(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}V=function(e,t,A,n){function r(t,A){V(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},V(e,t,A,n)}function j(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function N(e){return function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){j(r,n,o,i,a,"next",e)}function a(e){j(r,n,o,i,a,"throw",e)}i(void 0)})}}function G(e,t){(null==t||t>e.length)&&(t=e.length);for(var A=0,n=Array(t);A<t;A++)n[A]=e[A];return n}function W(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,z(n.key),n)}}function z(e){var t=function(e){if("object"!=K(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=K(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==K(t)?t:t+""}function X(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(X=function(){return!!e})()}function J(e){return J=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},J(e)}function Y(e,t){return Y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Y(e,t)}var q=function(e){function t(e){var A;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(A=function(e,t,A){return t=J(t),function(e,t){if(t&&("object"==K(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,X()?Reflect.construct(t,A||[],J(e).constructor):t.apply(e,A))}(this,t)).config=e,A.audioContext=null,A.audioWorkletNode=null,A.mediaStream=null,A.isRecording=!1,A}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Y(e,t)}(t,e),A=t,n=[{key:"getAudioProcessorPath",value:function(){if(this.config.audioProcessorPath)return this.config.audioProcessorPath;var e,t=function(e,t){var A="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!A){if(Array.isArray(e)||(A=function(e,t){if(e){if("string"==typeof e)return G(e,t);var A={}.toString.call(e).slice(8,-1);return"Object"===A&&e.constructor&&(A=e.constructor.name),"Map"===A||"Set"===A?Array.from(e):"Arguments"===A||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A)?G(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){A&&(e=A);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){A=A.call(e)},n:function(){var e=A.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==A.return||A.return()}finally{if(a)throw r}}}}(document.getElementsByTagName("script"));try{for(t.s();!(e=t.n()).done;){var A=e.value.src;if(A&&(A.includes("agent-widget.js")||A.includes("ttp-agent-sdk")))try{new URL(A);var n=A.substring(0,A.lastIndexOf("/"));return"".concat(n,"/audio-processor.js")}catch(e){var o=A.substring(0,A.lastIndexOf("/"));return"".concat(o,"/audio-processor.js")}}}catch(e){t.e(e)}finally{t.f()}return"https://cdn.talktopc.com/audio-processor.js"}},{key:"checkPermissionState",value:function(){var e=N(_().m(function e(){var t;return _().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!navigator.permissions||!navigator.permissions.query){e.n=2;break}return e.n=1,navigator.permissions.query({name:"microphone"});case 1:return t=e.v,e.a(2,t.state);case 2:e.n=4;break;case 3:e.p=3,e.v,console.log("⚠️ AudioRecorder: Permissions API not available or not supported for microphone");case 4:return e.a(2,null)}},e,null,[[0,3]])}));return function(){return e.apply(this,arguments)}}()},{key:"requestPermission",value:(a=N(_().m(function e(){var t,A,n,o;return _().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.checkPermissionState();case 1:if("granted"!==e.v){e.n=2;break}return console.log("✅ AudioRecorder: Microphone permission already granted"),e.a(2,!0);case 2:return console.log("🎤 AudioRecorder: Requesting microphone permission..."),t=this.config.sampleRate||this.config.outputSampleRate||44100,A={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},n=this.config.audioConstraints?L(L({},A),this.config.audioConstraints):A,e.n=3,navigator.mediaDevices.getUserMedia({audio:L({sampleRate:t,channelCount:1},n)});case 3:return e.v.getTracks().forEach(function(e){return e.stop()}),console.log("✅ AudioRecorder: Microphone permission granted"),e.a(2,!0);case 4:return e.p=4,o=e.v,console.error("❌ AudioRecorder: Failed to get microphone permission:",o),e.a(2,!1)}},e,this,[[0,4]])})),function(){return a.apply(this,arguments)})},{key:"start",value:(i=N(_().m(function e(){var t,A,n,o,r,i,a,s,c,l,u,d,p,h=this;return _().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,console.log("🎤 AudioRecorder: Requesting microphone access..."),e.n=1,this.checkPermissionState();case 1:return(t=e.v)&&(console.log("📋 AudioRecorder: Current permission state: ".concat(t)),"denied"===t&&console.warn('⚠️ AudioRecorder: Permission state is "denied" - browser may not show prompt. User may need to change in browser settings.')),A=this.config.sampleRate||this.config.outputSampleRate||44100,n={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},o=this.config.audioConstraints?L(L({},n),this.config.audioConstraints):n,e.n=2,navigator.mediaDevices.getUserMedia({audio:L({sampleRate:A,channelCount:1},o)});case 2:if(this.mediaStream=e.v,!this.config.checkConnection||"function"!=typeof this.config.checkConnection){e.n=3;break}if(this.config.checkConnection()){e.n=3;break}throw this.mediaStream.getTracks().forEach(function(e){return e.stop()}),this.mediaStream=null,(r=new Error("Connection lost - server may have rejected the call")).name="ServerRejected",r.isServerRejection=!0,r;case 3:if(this.audioContext=new(window.AudioContext||window.webkitAudioContext)({sampleRate:A}),"suspended"!==this.audioContext.state){e.n=4;break}return e.n=4,this.audioContext.resume();case 4:if(!this.config.checkConnection||"function"!=typeof this.config.checkConnection){e.n=6;break}if(this.config.checkConnection()){e.n=6;break}if(this.mediaStream.getTracks().forEach(function(e){return e.stop()}),this.mediaStream=null,!this.audioContext||"closed"===this.audioContext.state){e.n=5;break}return e.n=5,this.audioContext.close();case 5:throw this.audioContext=null,(i=new Error("Connection lost - server may have rejected the call")).name="ServerRejected",i.isServerRejection=!0,i;case 6:return a=this.getAudioProcessorPath(),e.n=7,this.audioContext.audioWorklet.addModule(a);case 7:if(!this.config.checkConnection||"function"!=typeof this.config.checkConnection){e.n=9;break}if(this.config.checkConnection()){e.n=9;break}if(this.mediaStream.getTracks().forEach(function(e){return e.stop()}),this.mediaStream=null,!this.audioContext||"closed"===this.audioContext.state){e.n=8;break}return e.n=8,this.audioContext.close();case 8:throw this.audioContext=null,(s=new Error("Connection lost - server may have rejected the call")).name="ServerRejected",s.isServerRejection=!0,s;case 9:this.audioWorkletNode=new AudioWorkletNode(this.audioContext,"audio-processor",{processorOptions:{sampleRate:A,outputSampleRate:this.config.outputSampleRate}}),(c=this.audioContext.createMediaStreamSource(this.mediaStream)).connect(this.audioWorkletNode),this.mediaStreamSource=c,this.audioWorkletNode.port.onmessage=function(e){var t=e.data,A=t.type,n=t.data;"pcm_audio_data"===A&&h.emit("audioData",n)},this.audioWorkletNode.port.postMessage({type:"setForceContinuous",data:{enabled:!0}}),console.log("✅ AudioRecorder: Microphone access granted"),this.isRecording=!0,this.emit("recordingStarted"),e.n=15;break;case 10:if(e.p=10,!(p=e.v).isServerRejection&&"ServerRejected"!==p.name){e.n=11;break}throw p;case 11:if(l=p.message,"NotAllowedError"!==p.name&&"PermissionDeniedError"!==p.name){e.n=13;break}return e.n=12,this.checkPermissionState();case 12:"denied"===(u=e.v)?(l='Microphone access was blocked. To enable it: 1) Click the lock icon (🔒) in your browser\'s address bar, 2) Find "Microphone" and change it to "Allow", 3) Refresh this page and try again.',console.error("❌ AudioRecorder: Permission explicitly denied. User must change in browser settings.")):"prompt"===u?(l='Microphone permission was denied. Click the "Voice Call" button again to see the permission prompt.',console.error('❌ AudioRecorder: Permission denied but state is "prompt" - user can try again.')):(l="Microphone permission was denied. Click the button again to retry, or enable microphone access in your browser settings (lock icon 🔒 in address bar).",console.error("❌ AudioRecorder: Permission denied. User can try again or change in browser settings.")),e.n=14;break;case 13:"NotFoundError"===p.name||"DevicesNotFoundError"===p.name?(l="No microphone found. Please connect a microphone and try again.",console.error("❌ AudioRecorder: No microphone device found.")):"NotReadableError"===p.name||"TrackStartError"===p.name?(l="Microphone is already in use by another application. Please close other apps using the microphone and try again.",console.error("❌ AudioRecorder: Microphone is busy or not readable.")):"SecurityError"!==p.name&&"PermissionDeniedError"!==p.name||(l="Microphone access blocked. On mobile devices, please tap the recording button directly (not from an iframe or popup).",console.error("❌ AudioRecorder: User agent blocked microphone access. This often happens on mobile when not called from direct user interaction."));case 14:throw(d=new Error(l)).name=p.name,d.originalError=p,this.emit("error",d),d;case 15:return e.a(2)}},e,this,[[0,10]])})),function(){return i.apply(this,arguments)})},{key:"stop",value:(r=N(_().m(function e(){var t;return _().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this.isRecording){e.n=1;break}return e.a(2);case 1:if(e.p=1,this.mediaStreamSource)try{console.log("🛑 AudioRecorder: Disconnecting media stream source to stop audio flow..."),this.mediaStreamSource.disconnect(),this.mediaStreamSource=null,console.log("✅ AudioRecorder: Media stream source disconnected")}catch(e){console.warn("⚠️ AudioRecorder: Error disconnecting source:",e)}if(!this.audioWorkletNode){e.n=4;break}return console.log("🛑 AudioRecorder: Sending stop message to AudioWorklet to stop VAD..."),this.audioWorkletNode.port.postMessage({type:"stop"}),e.n=2,new Promise(function(e){return setTimeout(e,150)});case 2:return this.audioWorkletNode.port.postMessage({type:"flush"}),e.n=3,new Promise(function(e){return setTimeout(e,50)});case 3:try{this.audioWorkletNode.disconnect(),console.log("✅ AudioRecorder: AudioWorkletNode disconnected")}catch(e){console.log("⚠️ AudioRecorder: AudioWorkletNode already disconnected")}case 4:if(this.mediaStream&&(console.log("🛑 AudioRecorder: Stopping media stream tracks..."),this.mediaStream.getTracks().forEach(function(e){e.stop(),console.log("✅ AudioRecorder: Stopped track:",e.kind)}),this.mediaStream=null),!this.audioContext||"closed"===this.audioContext.state){e.n=6;break}return console.log("🛑 AudioRecorder: Closing AudioContext..."),e.n=5,this.audioContext.close();case 5:this.audioContext=null,console.log("✅ AudioRecorder: AudioContext closed");case 6:this.audioWorkletNode=null,this.isRecording=!1,this.emit("recordingStopped"),console.log("✅ AudioRecorder: Recording stopped, VAD should be stopped"),e.n=8;break;case 7:throw e.p=7,t=e.v,this.emit("error",t),t;case 8:return e.a(2)}},e,this,[[1,7]])})),function(){return r.apply(this,arguments)})},{key:"resumeAudioContext",value:(o=N(_().m(function e(){var t,A;return _().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this.isRecording&&this.audioContext){e.n=1;break}return e.a(2);case 1:if(e.p=1,"suspended"!==this.audioContext.state){e.n=3;break}return console.log("🔄 AudioRecorder: Resuming suspended AudioContext..."),e.n=2,this.audioContext.resume();case 2:console.log("✅ AudioRecorder: AudioContext resumed");case 3:this.mediaStream&&0===(t=this.mediaStream.getAudioTracks()).filter(function(e){return"live"===e.readyState}).length&&t.length>0&&(console.warn("⚠️ AudioRecorder: All audio tracks are inactive. Recording may have stopped."),this.emit("tracksInactive")),e.n=5;break;case 4:e.p=4,A=e.v,console.error("❌ AudioRecorder: Failed to resume AudioContext:",A),this.emit("error",A);case 5:return e.a(2)}},e,this,[[1,4]])})),function(){return o.apply(this,arguments)})},{key:"getStatus",value:function(){return{isRecording:this.isRecording,audioContextState:this.audioContext?this.audioContext.state:"closed"}}},{key:"destroy",value:function(){this.stop()}}],n&&W(A.prototype,n),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,n,o,r,i,a}(O);function Z(e){return Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Z(e)}function $(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ee(n.key),n)}}function ee(e){var t=function(e){if("object"!=Z(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Z(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Z(t)?t:t+""}const te=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return t=e,A=[{key:"extractPcmFromWav",value:function(e){var t=e instanceof Uint8Array?e:new Uint8Array(e);if(t.length<44)throw new Error("WAV data too short (< 44 bytes)");if("RIFF"!==String.fromCharCode(t[0],t[1],t[2],t[3]))throw new Error("Not a valid WAV file - missing RIFF header");if("WAVE"!==String.fromCharCode(t[8],t[9],t[10],t[11]))throw new Error("Not a valid WAV file - missing WAVE format");for(var A=t[22]|t[23]<<8,n=t[24]|t[25]<<8|t[26]<<16|t[27]<<24,o=t[34]|t[35]<<8,r=-1,i=12;i<t.length-8;i+=4){if("data"===String.fromCharCode(t[i],t[i+1],t[i+2],t[i+3])){r=i;break}i+=4+(t[i+4]|t[i+5]<<8|t[i+6]<<16|t[i+7]<<24)}if(-1===r)throw new Error("No data chunk found in WAV");var a=t[r+4]|t[r+5]<<8|t[r+6]<<16|t[r+7]<<24,s=r+8,c=Math.min(a,t.length-s);return{pcmData:t.slice(s,s+c).buffer,format:{sampleRate:n,channels:A,bitDepth:o}}}},{key:"isWavFile",value:function(e){return e.length>=44&&82===e[0]&&73===e[1]&&70===e[2]&&70===e[3]}},{key:"createWavHeader",value:function(e,t,A,n){var o=new ArrayBuffer(44),r=new DataView(o);return r.setUint32(0,1380533830,!1),r.setUint32(4,36+e,!0),r.setUint32(8,1463899717,!1),r.setUint32(12,1718449184,!1),r.setUint32(16,16,!0),r.setUint16(20,1,!0),r.setUint16(22,A,!0),r.setUint32(24,t,!0),r.setUint32(28,t*A*n/8,!0),r.setUint16(32,A*n/8,!0),r.setUint16(34,n,!0),r.setUint32(36,1684108385,!1),r.setUint32(40,e,!0),o}},{key:"wrapPcmInWav",value:function(t,A){var n=e.createWavHeader(t.byteLength,A.sampleRate,A.channels||1,A.bitDepth||16),o=new Uint8Array(n.byteLength+t.byteLength);return o.set(new Uint8Array(n),0),o.set(new Uint8Array(t),n.byteLength),o.buffer}}],null&&$(t.prototype,null),A&&$(t,A),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,A}();function Ae(e){return Ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ae(e)}function ne(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,oe(n.key),n)}}function oe(e){var t=function(e){if("object"!=Ae(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Ae(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ae(t)?t:t+""}const re=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.codecs={pcm:new u,pcmu:new g,pcma:new B}},(t=[{key:"decodeToPcm",value:function(e,t){var A=null==t?void 0:t.toLowerCase();if(!A||"pcm"===A)return e instanceof ArrayBuffer?e:e instanceof Uint8Array?e.buffer:e;var n=this.codecs[A];if(!n)throw new Error("Unsupported encoding: ".concat(t));var o=e instanceof Uint8Array?e:new Uint8Array(e);return n.decode(o)}},{key:"encodeFromPcm",value:function(e,t){var A=null==t?void 0:t.toLowerCase();if(!A||"pcm"===A)return e;var n=this.codecs[A];if(!n)throw new Error("Unsupported target encoding: ".concat(t));var o=n.encode(e);return o instanceof Uint8Array?o.buffer:o}},{key:"getCodec",value:function(e){var t=null==e?void 0:e.toLowerCase();return this.codecs[t]||null}}])&&ne(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function ie(e){return ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ie(e)}function ae(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,se(n.key),n)}}function se(e){var t=function(e){if("object"!=ie(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=ie(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ie(t)?t:t+""}const ce=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return t=e,A=[{key:"convert",value:function(t,A,n){if(A===n)return t;if(8===A)throw new Error("Source bit depth cannot be 8-bit (only 16-bit or 24-bit supported)");var o=A/8,r=n/8,i=t.byteLength/o;if(new ArrayBuffer(i*r),16===A&&16===n)return t;if(24===A&&16===n)return e.convert24To16(t);if(16===A&&24===n)return e.convert16To24(t);if(16===A&&8===n)return e.convert16To8(t);if(24===A&&8===n)return e.convert24To8(t);throw new Error("Unsupported bit depth conversion: ".concat(A,"-bit → ").concat(n,"-bit"))}},{key:"convert24To16",value:function(e){for(var t=new Uint8Array(e),A=Math.floor(t.length/3),n=new Int16Array(A),o=0;o<A;o++){var r=t[3*o],i=t[3*o+1],a=t[3*o+2],s=r|i<<8|(255&a)<<16;128&a&&(s|=4278190080),n[o]=Math.max(-32768,Math.min(32767,Math.round(s/256)))}return n.buffer}},{key:"convert16To24",value:function(e){for(var t=new Int16Array(e),A=new Uint8Array(3*t.length),n=0;n<t.length;n++){var o=256*t[n];A[3*n]=255&o,A[3*n+1]=o>>8&255,A[3*n+2]=o>>16&255}return A.buffer}},{key:"convert16To8",value:function(e){for(var t=new Int16Array(e),A=new Uint8Array(t.length),n=0;n<t.length;n++){var o=t[n];A[n]=Math.max(0,Math.min(255,Math.round(o/256+128)))}return A.buffer}},{key:"convert24To8",value:function(t){var A=e.convert24To16(t);return e.convert16To8(A)}}],null&&ae(t.prototype,null),A&&ae(t,A),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,A}();function le(e){return le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},le(e)}function ue(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return de(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(de(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,de(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,de(u,"constructor",c),de(c,"constructor",s),s.displayName="GeneratorFunction",de(c,o,"GeneratorFunction"),de(u),de(u,o,"Generator"),de(u,n,function(){return this}),de(u,"toString",function(){return"[object Generator]"}),(ue=function(){return{w:r,m:d}})()}function de(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}de=function(e,t,A,n){function r(t,A){de(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},de(e,t,A,n)}function pe(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function he(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ge(n.key),n)}}function ge(e){var t=function(e){if("object"!=le(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=le(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==le(t)?t:t+""}const fe=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"resample",value:(A=ue().m(function e(t,A,n){var o,r,i,a,s,c,l,u,d,p,h,g,f;return ue().w(function(e){for(;;)switch(e.n){case 0:if(A!==n){e.n=1;break}return e.a(2,t);case 1:for(o=new Int16Array(t),r=new Float32Array(o.length),i=1/32768,a=0;a<o.length;a++)r[a]=o[a]*i;return s=Math.ceil(r.length*n/A),c=new OfflineAudioContext(1,s,n),(l=c.createBuffer(1,r.length,A)).getChannelData(0).set(r),(u=c.createBufferSource()).buffer=l,u.connect(c.destination),u.start(),e.n=2,c.startRendering();case 2:for(d=e.v,p=d.getChannelData(0),h=new Int16Array(p.length),g=0;g<p.length;g++)f=Math.max(-1,Math.min(1,p[g])),h[g]=Math.round(32767*f);return e.a(2,h.buffer)}},e)}),n=function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(e){pe(r,n,o,i,a,"next",e)}function a(e){pe(r,n,o,i,a,"throw",e)}i(void 0)})},function(e,t,A){return n.apply(this,arguments)})}],t&&he(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,A,n}();function me(e){return me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},me(e)}function ve(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Be(n.key),n)}}function Be(e){var t=function(e){if("object"!=me(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=me(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==me(t)?t:t+""}const we=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return t=e,A=[{key:"convert",value:function(t,A,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:16;if(A===n)return t;if(1===A&&1===n)return t;if(1===A&&2===n)return e.monoToStereo(t,o);if(2===A&&1===n)return e.stereoToMono(t,o);throw new Error("Unsupported channel conversion: ".concat(A," → ").concat(n))}},{key:"monoToStereo",value:function(e,t){for(var A=t/8,n=e.byteLength/A,o=new ArrayBuffer(n*A*2),r=new Uint8Array(e),i=new Uint8Array(o),a=0;a<n;a++)for(var s=a*A,c=a*A*2,l=0;l<A;l++)i[c+l]=r[s+l],i[c+A+l]=r[s+l];return o}},{key:"stereoToMono",value:function(e,t){var A=t/8,n=e.byteLength/(2*A),o=new ArrayBuffer(n*A),r=new Uint8Array(e),i=new Uint8Array(o);if(16===t)for(var a=0;a<n;a++){var s=a*A*2,c=s+A,l=(r[s]|r[s+1]<<8)<<16>>16,u=(r[c]|r[c+1]<<8)<<16>>16,d=Math.round((l+u)/2),p=a*A;i[p]=255&d,i[p+1]=d>>8&255}else for(var h=0;h<n;h++)for(var g=h*A*2,f=h*A,m=0;m<A;m++)i[f+m]=r[g+m];return o}}],null&&ve(t.prototype,null),A&&ve(t,A),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,A}();function ye(e){return ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ye(e)}function be(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Ce(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Ce(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Ce(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Ce(u,"constructor",c),Ce(c,"constructor",s),s.displayName="GeneratorFunction",Ce(c,o,"GeneratorFunction"),Ce(u),Ce(u,o,"Generator"),Ce(u,n,function(){return this}),Ce(u,"toString",function(){return"[object Generator]"}),(be=function(){return{w:r,m:d}})()}function Ce(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Ce=function(e,t,A,n){function r(t,A){Ce(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},Ce(e,t,A,n)}function xe(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),A.push.apply(A,n)}return A}function Qe(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?xe(Object(A),!0).forEach(function(t){Fe(e,t,A[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):xe(Object(A)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}return e}function Fe(e,t,A){return(t=ke(t))in e?Object.defineProperty(e,t,{value:A,enumerable:!0,configurable:!0,writable:!0}):e[t]=A,e}function Ue(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function Se(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ke(n.key),n)}}function ke(e){var t=function(e){if("object"!=ye(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=ye(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ye(t)?t:t+""}const Ee=function(){return e=function e(t,A){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.requestedFormat=t,this.actualFormat=A,this.encodingConverter=new re,this.conversionSteps=[],this._analyzeConversions()},t=[{key:"_analyzeConversions",value:function(){this.conversionSteps=[],this.actualFormat.container!==this.requestedFormat.container&&("wav"===this.actualFormat.container?this.conversionSteps.push("extract_wav"):"wav"===this.requestedFormat.container&&this.conversionSteps.push("wrap_wav")),this.actualFormat.encoding!==this.requestedFormat.encoding&&("pcm"!==this.actualFormat.encoding&&this.conversionSteps.push("decode_encoding"),"pcm"!==this.requestedFormat.encoding&&this.conversionSteps.push("encode_encoding")),this.actualFormat.sampleRate!==this.requestedFormat.sampleRate&&this.conversionSteps.push("resample"),this.actualFormat.bitDepth!==this.requestedFormat.bitDepth&&this.conversionSteps.push("convert_bitdepth"),this.actualFormat.channels!==this.requestedFormat.channels&&this.conversionSteps.push("convert_channels")}},{key:"needsConversion",value:function(){return this.conversionSteps.length>0}},{key:"getConversionSteps",value:function(){var e=[];return this.conversionSteps.includes("extract_wav")&&e.push("Extract PCM from WAV (".concat(this.actualFormat.container," → raw)")),this.conversionSteps.includes("decode_encoding")&&e.push("Decode ".concat(this.actualFormat.encoding.toUpperCase()," → PCM")),this.conversionSteps.includes("resample")&&e.push("Resample ".concat(this.actualFormat.sampleRate,"Hz → ").concat(this.requestedFormat.sampleRate,"Hz")),this.conversionSteps.includes("convert_bitdepth")&&e.push("Convert bit depth ".concat(this.actualFormat.bitDepth,"-bit → ").concat(this.requestedFormat.bitDepth,"-bit")),this.conversionSteps.includes("convert_channels")&&e.push("Convert channels ".concat(this.actualFormat.channels," → ").concat(this.requestedFormat.channels)),this.conversionSteps.includes("encode_encoding")&&e.push("Encode PCM → ".concat(this.requestedFormat.encoding.toUpperCase())),this.conversionSteps.includes("wrap_wav")&&e.push("Wrap in WAV container (raw → ".concat(this.requestedFormat.container,")")),e}},{key:"convert",value:(A=be().m(function e(t){var A,n,o,r;return be().w(function(e){for(;;)switch(e.n){case 0:if(this.needsConversion()){e.n=1;break}return e.a(2,t instanceof ArrayBuffer?t:t.buffer);case 1:if(A=t instanceof ArrayBuffer?t:t.buffer,n=Qe({},this.actualFormat),this.conversionSteps.includes("extract_wav")&&(o=te.extractPcmFromWav(A),A=o.pcmData,n=Qe(Qe({},n),{},{container:"raw",sampleRate:o.format.sampleRate,channels:o.format.channels,bitDepth:o.format.bitDepth}),console.log("🔄 AudioFormatConverter: Extracted PCM from WAV",o.format)),this.conversionSteps.includes("decode_encoding")&&(A=this.encodingConverter.decodeToPcm(A,n.encoding),n.encoding="pcm",n.bitDepth=16,console.log("🔄 AudioFormatConverter: Decoded ".concat(this.actualFormat.encoding.toUpperCase()," → PCM"))),24===n.bitDepth&&n.bitDepth!==this.requestedFormat.bitDepth&&(this.conversionSteps.includes("resample")||this.conversionSteps.includes("convert_channels")||24!==this.requestedFormat.bitDepth)&&(A=ce.convert(A,24,16),n.bitDepth=16,console.log("🔄 AudioFormatConverter: Normalized 24-bit → 16-bit PCM")),!this.conversionSteps.includes("resample")){e.n=3;break}return e.n=2,fe.resample(A,n.sampleRate,this.requestedFormat.sampleRate);case 2:A=e.v,n.sampleRate=this.requestedFormat.sampleRate,console.log("🔄 AudioFormatConverter: Resampled ".concat(this.actualFormat.sampleRate,"Hz → ").concat(this.requestedFormat.sampleRate,"Hz"));case 3:return this.conversionSteps.includes("convert_channels")&&(A=we.convert(A,n.channels,this.requestedFormat.channels,n.bitDepth),n.channels=this.requestedFormat.channels,console.log("🔄 AudioFormatConverter: Converted channels ".concat(this.actualFormat.channels," → ").concat(this.requestedFormat.channels))),this.conversionSteps.includes("convert_bitdepth")&&(A=ce.convert(A,n.bitDepth,this.requestedFormat.bitDepth),n.bitDepth=this.requestedFormat.bitDepth,console.log("🔄 AudioFormatConverter: Converted bit depth ".concat(this.actualFormat.bitDepth,"-bit → ").concat(this.requestedFormat.bitDepth,"-bit"))),this.conversionSteps.includes("encode_encoding")&&(r=this.encodingConverter.encodeFromPcm(A,this.requestedFormat.encoding),A=r instanceof ArrayBuffer?r:r.buffer,n.encoding=this.requestedFormat.encoding,console.log("🔄 AudioFormatConverter: Encoded PCM → ".concat(this.requestedFormat.encoding.toUpperCase()))),this.conversionSteps.includes("wrap_wav")&&(A=te.wrapPcmInWav(A,n),n.container="wav",console.log("🔄 AudioFormatConverter: Wrapped in WAV container")),console.log("✅ AudioFormatConverter: Conversion complete"),e.a(2,A)}},e,this)}),n=function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(e){Ue(r,n,o,i,a,"next",e)}function a(e){Ue(r,n,o,i,a,"throw",e)}i(void 0)})},function(e){return n.apply(this,arguments)})}],t&&Se(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,A,n}();function Ie(e){return Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ie(e)}function Te(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return He(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(He(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,He(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,He(u,"constructor",c),He(c,"constructor",s),s.displayName="GeneratorFunction",He(c,o,"GeneratorFunction"),He(u),He(u,o,"Generator"),He(u,n,function(){return this}),He(u,"toString",function(){return"[object Generator]"}),(Te=function(){return{w:r,m:d}})()}function He(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}He=function(e,t,A,n){function r(t,A){He(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},He(e,t,A,n)}function De(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function Pe(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Oe(n.key),n)}}function Oe(e){var t=function(e){if("object"!=Ie(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Ie(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ie(t)?t:t+""}const Ke=function(){return e=function e(t){var A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return null};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.handlers=new Map,this.sendMessage=t,this.getConversationId=A},t=[{key:"registerHandler",value:function(e,t){if("function"!=typeof t)throw new Error("Handler for tool '".concat(e,"' must be a function"));this.handlers.set(e,t),console.log("🔧 ClientTools: Registered handler for '".concat(e,"'"))}},{key:"unregisterHandler",value:function(e){this.handlers.delete(e),console.log("🔧 ClientTools: Unregistered handler for '".concat(e,"'"))}},{key:"hasHandler",value:function(e){return this.handlers.has(e)}},{key:"getRegisteredTools",value:function(){return Array.from(this.handlers.keys())}},{key:"handleToolCall",value:(A=Te().m(function e(t){var A,n,o,r,i,a,s,c,l,u,d,p,h,g;return Te().w(function(e){for(;;)switch(e.p=e.n){case 0:if(A=t.toolCallId,n=t.toolName,o=t.parameters,r=Date.now(),i=(new Date).toISOString(),console.log("🔧 ClientTools: [".concat(i,"] Received tool call '").concat(n,"' (id: ").concat(A,")")),console.log(" 📋 Full message received:",JSON.stringify(t,null,2)),console.log(" ⏱️ Start time: ".concat(r,"ms (").concat(new Date(r).toISOString(),")")),a=this.handlers.get(n)){e.n=1;break}return s=Array.from(this.handlers.keys()),console.error("🔧 ClientTools: No handler registered for '".concat(n,"'")),console.error(" 📋 Currently registered tools:",s),console.error(" 📋 Total registered: ".concat(s.length)),this.sendError(A,n,"No handler registered for tool '".concat(n,"'"),"NO_HANDLER",r),e.a(2);case 1:return e.p=1,e.n=2,a(o);case 2:c=e.v,l=Date.now()-r,console.log("🔧 ClientTools: Tool '".concat(n,"' completed in ").concat(l,"ms")),this.sendResult(A,n,c,l),e.n=4;break;case 3:e.p=3,g=e.v,p=Date.now()-r,console.error("🔧 ClientTools: Tool '".concat(n,"' failed:"),g),h="EXECUTION_ERROR","NotAllowedError"===g.name||null!==(u=g.message)&&void 0!==u&&u.includes("permission")?h="PERMISSION_DENIED":("NotSupportedError"===g.name||null!==(d=g.message)&&void 0!==d&&d.includes("not supported"))&&(h="API_UNAVAILABLE"),this.sendError(A,n,g.message||"Unknown error",h,p);case 4:return e.a(2)}},e,this,[[1,3]])}),n=function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(e){De(r,n,o,i,a,"next",e)}function a(e){De(r,n,o,i,a,"throw",e)}i(void 0)})},function(e){return n.apply(this,arguments)})},{key:"sendResult",value:function(e,t,A,n){var o=this.getConversationId(),r=(new Date).toISOString(),i={t:"client_tool_result",toolCallId:e,toolName:t,conversationId:o,result:A,executionTimeMs:n};console.log("🔧 ClientTools: [".concat(r,"] Sending result for tool '").concat(t,"'")),console.log(" 📋 toolCallId: ".concat(e)),console.log(" 📋 conversationId: ".concat(o||"null")),console.log(" 📋 toolName: ".concat(t)),console.log(" 📋 result:",A),console.log(" 📋 Full message:",JSON.stringify(i,null,2)),this.sendMessage(i),console.log("✅ ClientTools: Result message sent at ".concat(r))}},{key:"sendError",value:function(e,t,A,n,o){var r="number"==typeof o?Date.now()-o:o,i=(new Date).toISOString(),a=this.getConversationId(),s={t:"client_tool_error",toolCallId:e,toolName:t,conversationId:a,error:A,errorCode:n,executionTimeMs:r};console.log("🔧 ClientTools: [".concat(i,"] Sending error for tool '").concat(t,"'")),console.log(" 📋 toolCallId: ".concat(e)),console.log(" 📋 conversationId: ".concat(a||"null")),console.log(" 📋 toolName: ".concat(t)),console.log(" 📋 error: ".concat(A,", errorCode: ").concat(n)),console.log(" 📋 Full message:",JSON.stringify(s,null,2)),this.sendMessage(s),console.log("✅ ClientTools: Error message sent at ".concat(i))}},{key:"setSendMessage",value:function(e){this.sendMessage=e}}],t&&Pe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,A,n}();var Me=A(354),Le=A.n(Me);function Re(e){return Re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Re(e)}function _e(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Ve(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Ve(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Ve(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Ve(u,"constructor",c),Ve(c,"constructor",s),s.displayName="GeneratorFunction",Ve(c,o,"GeneratorFunction"),Ve(u),Ve(u,o,"Generator"),Ve(u,n,function(){return this}),Ve(u,"toString",function(){return"[object Generator]"}),(_e=function(){return{w:r,m:d}})()}function Ve(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Ve=function(e,t,A,n){function r(t,A){Ve(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},Ve(e,t,A,n)}function je(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),A.push.apply(A,n)}return A}function Ne(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?je(Object(A),!0).forEach(function(t){Ge(e,t,A[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):je(Object(A)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}return e}function Ge(e,t,A){return(t=function(e){var t=function(e){if("object"!=Re(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Re(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Re(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:A,enumerable:!0,configurable:!0,writable:!0}):e[t]=A,e}function We(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}var ze={useCORS:!0,allowTaint:!1,backgroundColor:"#ffffff",scale:1,logging:!1,imageTimeout:15e3};function Xe(){return Je.apply(this,arguments)}function Je(){var e;return e=_e().m(function e(){var t,A,n,o,r,i,a,s,c,l,u,d,p,h,g,f,m,v,B,w,y,b,C,x,Q,F,U=arguments;return _e().w(function(e){for(;;)switch(e.p=e.n){case 0:if(A=(t=U.length>0&&void 0!==U[0]?U[0]:{}).selector,n=void 0===A?null:A,o=t.format,r=void 0===o?"jpeg":o,i=t.quality,a=void 0===i?.85:i,s=t.scale,c=void 0===s?1:s,l=t.maxWidth,u=void 0===l?1280:l,d=t.maxHeight,p=void 0===d?1280:d,h=t.fullPage,g=void 0!==h&&h,console.log("📸 SDK Screenshot: Starting capture with options:",t),f=Date.now(),e.p=1,m=document.body,!n){e.n=3;break}if(v=document.querySelector(n)){e.n=2;break}throw new Error("Element not found: ".concat(n));case 2:m=v,console.log("📸 SDK Screenshot: Capturing element: ".concat(n)),e.n=4;break;case 3:console.log("📸 SDK Screenshot: Capturing entire page");case 4:return B=Ne(Ne({},ze),{},{scale:c}),g&&!n&&(B.windowHeight=document.documentElement.scrollHeight,B.height=document.documentElement.scrollHeight,B.y=0),e.n=5,Le()(m,B);case 5:return w=e.v,console.log("📸 SDK Screenshot: Canvas created (".concat(w.width,"x").concat(w.height,")")),y=w,(u||p)&&(y=Ye(w,u,p))!==w&&console.log("📸 SDK Screenshot: Resized to ".concat(y.width,"x").concat(y.height)),b="jpeg"===r?"image/jpeg":"image/png",C=y.toDataURL(b,"jpeg"===r?a:void 0),x=C.split(",")[1],Q=Date.now()-f,console.log("📸 SDK Screenshot: Capture completed in ".concat(Q,"ms")),console.log("📸 SDK Screenshot: Size: ".concat(Math.round(x.length/1024),"KB")),e.a(2,{image:x,mimeType:b,width:y.width,height:y.height,captureTimeMs:Q,selector:n||"body"});case 6:throw e.p=6,F=e.v,console.error("📸 SDK Screenshot: Capture failed:",F),new Error("Screenshot capture failed: ".concat(F.message));case 7:return e.a(2)}},e,null,[[1,6]])}),Je=function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){We(r,n,o,i,a,"next",e)}function a(e){We(r,n,o,i,a,"throw",e)}i(void 0)})},Je.apply(this,arguments)}function Ye(e,t,A){var n=e.width,o=e.height,r=1;if(t&&n>t&&(r=Math.min(r,t/n)),A&&o>A&&(r=Math.min(r,A/o)),1===r)return e;var i=Math.round(n*r),a=Math.round(o*r),s=document.createElement("canvas");return s.width=i,s.height=a,s.getContext("2d").drawImage(e,0,0,i,a),s}function qe(e,t){var A="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!A){if(Array.isArray(e)||(A=function(e,t){if(e){if("string"==typeof e)return Ze(e,t);var A={}.toString.call(e).slice(8,-1);return"Object"===A&&e.constructor&&(A=e.constructor.name),"Map"===A||"Set"===A?Array.from(e):"Arguments"===A||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A)?Ze(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){A&&(e=A);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){A=A.call(e)},n:function(){var e=A.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==A.return||A.return()}finally{if(a)throw r}}}}function Ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var A=0,n=Array(t);A<t;A++)n[A]=e[A];return n}var $e={types:["password"],names:["cc","card","credit","cvv","cvc","csc","expir","cardnumber","card-number","card_number","cardholder","card-holder","card_holder","password","pwd","passwd","pass","secret","token","auth","api-key","apikey","api_key","access-key","accesskey","access_key","secret-key","secretkey","secret_key","private-key","privatekey","private_key","bearer","jwt","ssn","social-security","social_security","socialsecurity","tax-id","taxid","tax_id","national-id","nationalid","national_id","credential","private","secure"],autocomplete:["cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc","cc-name","cc-type","current-password","new-password"],dataAttributes:["data-secret","data-sensitive","data-private","data-api-key","data-token","data-auth"]};function et(e){if(!e)return!1;var t=(e.type||"").toLowerCase(),A=(e.name||"").toLowerCase(),n=(e.id||"").toLowerCase(),o=(e.className||"").toLowerCase(),r=(e.autocomplete||"").toLowerCase(),i=(e.placeholder||"").toLowerCase(),a=(e.getAttribute("aria-label")||"").toLowerCase(),s="".concat(A," ").concat(n," ").concat(o," ").concat(i," ").concat(a);if($e.types.includes(t))return!0;if($e.autocomplete.includes(r))return!0;var c,l=qe($e.names);try{for(l.s();!(c=l.n()).done;){var u=c.value;if(s.includes(u))return!0}}catch(e){l.e(e)}finally{l.f()}var d,p=qe($e.dataAttributes);try{for(p.s();!(d=p.n()).done;){var h=d.value;if(e.hasAttribute(h))return!0}}catch(e){p.e(e)}finally{p.f()}return"password"===(e.inputMode||"").toLowerCase()}function tt(e){return tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tt(e)}function At(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return nt(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(nt(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,nt(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,nt(u,"constructor",c),nt(c,"constructor",s),s.displayName="GeneratorFunction",nt(c,o,"GeneratorFunction"),nt(u),nt(u,o,"Generator"),nt(u,n,function(){return this}),nt(u,"toString",function(){return"[object Generator]"}),(At=function(){return{w:r,m:d}})()}function nt(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}nt=function(e,t,A,n){function r(t,A){nt(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},nt(e,t,A,n)}function ot(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),A.push.apply(A,n)}return A}function rt(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(A),!0).forEach(function(t){it(e,t,A[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):ot(Object(A)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}return e}function it(e,t,A){return(t=function(e){var t=function(e){if("object"!=tt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=tt(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==tt(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:A,enumerable:!0,configurable:!0,writable:!0}):e[t]=A,e}function at(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function st(e,t){var A="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!A){if(Array.isArray(e)||(A=function(e,t){if(e){if("string"==typeof e)return ct(e,t);var A={}.toString.call(e).slice(8,-1);return"Object"===A&&e.constructor&&(A=e.constructor.name),"Map"===A||"Set"===A?Array.from(e):"Arguments"===A||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A)?ct(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){A&&(e=A);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){A=A.call(e)},n:function(){var e=A.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==A.return||A.return()}finally{if(a)throw r}}}}function ct(e,t){(null==t||t>e.length)&&(t=e.length);for(var A=0,n=Array(t);A<t;A++)n[A]=e[A];return n}var lt={buttons:20,links:30,forms:5,fieldsPerForm:15,sections:10,headings:15,maxTextLength:100,maxSummaryLength:150};function ut(e){var t,A;if(!e||!e.tagName)return null;if(null!==(t=e.dataset)&&void 0!==t&&t.testid)return'[data-testid="'.concat(e.dataset.testid,'"]');if(null!==(A=e.dataset)&&void 0!==A&&A.cy)return'[data-cy="'.concat(e.dataset.cy,'"]');var n=e.getAttribute("aria-label");if(n&&n.length<50)return'[aria-label="'.concat(n.replace(/"/g,'\\"'),'"]');if(e.id&&!dt(e.id))return"#".concat(CSS.escape(e.id));if(e.name){var o=e.tagName.toLowerCase();return"".concat(o,'[name="').concat(e.name,'"]')}if(["BUTTON","A"].includes(e.tagName)){var r,i=null===(r=e.innerText)||void 0===r?void 0:r.trim();if(i&&i.length<30&&i.length>0){var a=e.tagName.toLowerCase(),s=document.querySelectorAll("".concat(a));if(1===Array.from(s).filter(function(e){var t;return(null===(t=e.innerText)||void 0===t?void 0:t.trim())===i}).length)return"".concat(a,':contains("').concat(i.replace(/"/g,'\\"'),'")')}}return function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,A=[],n=e,o=0;n&&n!==document.body&&o<t;){var r=n.tagName.toLowerCase();if(n.id&&!dt(n.id)){A.unshift("#".concat(CSS.escape(n.id)));break}var i=pt(n);if(i)A.unshift("".concat(r,".").concat(i));else{var a,s=null===(a=n.parentElement)||void 0===a?void 0:a.children;if(s&&s.length>1){var c=Array.from(s).indexOf(n)+1;A.unshift("".concat(r,":nth-child(").concat(c,")"))}else A.unshift(r)}n=n.parentElement,o++}return A.join(" > ")}(e)}function dt(e){return[/^:r[0-9a-z]+:$/,/^react-/i,/^ng-/i,/^vue-/i,/^ember[0-9]+/i,/^_[a-z0-9]{8,}$/i,/^[a-f0-9]{8}-[a-f0-9]{4}/i,/^uid-/i,/^id[0-9]+$/i].some(function(t){return t.test(e)})}function pt(e){var t=Array.from(e.classList||[]),A=[/^(flex|grid|block|inline|hidden)$/,/^(m|p|w|h|min|max)-/,/^(text|font|bg|border)-/,/^(col|row)-/,/^(sm|md|lg|xl|2xl):/,/^hover:|focus:|active:/,/^[a-z]{1,3}-[0-9]+$/];return t.filter(function(e){return!A.some(function(t){return t.test(e)})&&e.length>2&&e.length<30})[0]||null}function ht(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,A=e.getBoundingClientRect();return A.bottom>=-t&&A.top<=window.innerHeight+t&&A.right>=0&&A.left<=window.innerWidth}function gt(e){if(!e)return!1;var t=window.getComputedStyle(e);return"none"!==t.display&&"hidden"!==t.visibility&&"0"!==t.opacity&&e.offsetWidth>0&&e.offsetHeight>0}function ft(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lt,A=[],n=st(document.querySelectorAll('button, [type="submit"], [type="button"], [role="button"], .btn, .button'));try{for(n.s();!(e=n.n()).done;){var o=e.value;if(A.length>=t.buttons)break;if(gt(o)){var r=(o.innerText||o.value||o.getAttribute("aria-label")||"").trim();r&&A.push({selector:ut(o),text:r.substring(0,t.maxTextLength),type:o.type||"button",disabled:o.disabled||!1,inViewport:ht(o,0)})}}}catch(e){n.e(e)}finally{n.f()}return A}function mt(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lt,A=[],n=document.querySelectorAll("a[href]"),o=window.location.origin,r=st(n);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(A.length>=t.links)break;if(gt(i)){var a=(i.innerText||i.getAttribute("aria-label")||"").trim();if(a&&!(a.length<2)){var s=i.href;if(s&&!s.startsWith("javascript:")&&"#"!==s){var c=!1;try{c=new URL(s).origin===o}catch(e){}A.push({selector:ut(i),text:a.substring(0,t.maxTextLength),href:s,internal:c,inViewport:ht(i,0)})}}}}}catch(e){r.e(e)}finally{r.f()}return A}function vt(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lt,A=[],n=0,o=st(document.querySelectorAll("form"));try{for(o.s();!(e=o.n()).done;){var r=e.value;if(A.length>=t.forms)break;if(gt(r)){var i,a=[],s=st(r.querySelectorAll("input, textarea, select"));try{for(s.s();!(i=s.n()).done;){var c,l,u=i.value;if(a.length>=t.fieldsPerForm)break;if("hidden"!==u.type)if(et(u))n++;else{var d=null;if(u.id){var p,h=document.querySelector('label[for="'.concat(u.id,'"]'));d=null==h||null===(p=h.innerText)||void 0===p?void 0:p.trim()}!d&&u.getAttribute("aria-label")&&(d=u.getAttribute("aria-label")),!d&&u.placeholder&&(d=u.placeholder),a.push({selector:ut(u),name:u.name||null,type:u.type||"text",label:(null===(c=d)||void 0===c?void 0:c.substring(0,50))||null,placeholder:(null===(l=u.placeholder)||void 0===l?void 0:l.substring(0,50))||null,required:u.required||!1})}}}catch(e){s.e(e)}finally{s.f()}0!==a.length&&A.push({selector:ut(r),id:r.id||null,action:r.action||null,method:(r.method||"get").toUpperCase(),fields:a})}}}catch(e){o.e(e)}finally{o.f()}return{forms:A,sensitiveCount:n}}function Bt(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lt,A=[],n=st(document.querySelectorAll('section, article, main, [role="main"], [role="region"], .section'));try{for(n.s();!(e=n.n()).done;){var o,r,i,a=e.value;if(A.length>=t.sections)break;if(gt(a)){var s=a.querySelector("h1, h2, h3"),c=(null==s||null===(o=s.innerText)||void 0===o?void 0:o.trim())||"",l=a.querySelector("p"),u=c||(null==l||null===(r=l.innerText)||void 0===r?void 0:r.trim().substring(0,t.maxSummaryLength))||(null===(i=a.innerText)||void 0===i?void 0:i.trim().substring(0,t.maxSummaryLength))||"";A.push({selector:ut(a),id:a.id||null,tagName:a.tagName.toLowerCase(),summary:u.substring(0,t.maxSummaryLength),inViewport:ht(a,0)})}}}catch(e){n.e(e)}finally{n.f()}return A}function wt(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lt,A=[],n=st(document.querySelectorAll("h1, h2, h3"));try{for(n.s();!(e=n.n()).done;){var o,r=e.value;if(A.length>=t.headings)break;if(gt(r)){var i=null===(o=r.innerText)||void 0===o?void 0:o.trim();i&&A.push({selector:ut(r),level:r.tagName.toLowerCase(),text:i.substring(0,t.maxTextLength),inViewport:ht(r,0)})}}}catch(e){n.e(e)}finally{n.f()}return A}function yt(){return bt.apply(this,arguments)}function bt(){return e=At().m(function e(){var t,A,n,o,r,i,a,s,c,l,u,d,p,h,g,f=arguments;return At().w(function(e){for(;;)if(0===e.n)return A=f.length>0&&void 0!==f[0]?f[0]:{},n=rt(rt({},lt),A.limits),o=ft(n),r=mt(n),i=vt(n),a=i.forms,s=i.sensitiveCount,c=Bt(n),l=wt(n),u=o.length+r.length+a.reduce(function(e,t){return e+t.fields.length},0)+c.length+l.length,d=o.filter(function(e){return e.inViewport}).length+r.filter(function(e){return e.inViewport}).length+c.filter(function(e){return e.inViewport}).length+l.filter(function(e){return e.inViewport}).length,p=document.documentElement.lang||(null===(t=document.querySelector("html"))||void 0===t?void 0:t.getAttribute("lang"))||null,h=navigator.language||navigator.languages&&navigator.languages[0]||null,g=p||h||null,e.a(2,{url:window.location.href,title:document.title,timestamp:Date.now(),language:g,viewport:{width:window.innerWidth,height:window.innerHeight,scrollX:window.scrollX,scrollY:window.scrollY,pageHeight:document.documentElement.scrollHeight},buttons:o,links:r,forms:a,sections:c,headings:l,metadata:{totalElements:u,visibleInViewport:d,formsCount:a.length,sensitiveFieldsFiltered:s}})},e)}),bt=function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){at(r,n,o,i,a,"next",e)}function a(e){at(r,n,o,i,a,"throw",e)}i(void 0)})},bt.apply(this,arguments);var e}function Ct(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return xt(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(xt(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,xt(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,xt(u,"constructor",c),xt(c,"constructor",s),s.displayName="GeneratorFunction",xt(c,o,"GeneratorFunction"),xt(u),xt(u,o,"Generator"),xt(u,n,function(){return this}),xt(u,"toString",function(){return"[object Generator]"}),(Ct=function(){return{w:r,m:d}})()}function xt(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}xt=function(e,t,A,n){function r(t,A){xt(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},xt(e,t,A,n)}function Qt(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function Ft(e){return function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){Qt(r,n,o,i,a,"next",e)}function a(e){Qt(r,n,o,i,a,"throw",e)}i(void 0)})}}function Ut(){return St.apply(this,arguments)}function St(){return St=Ft(Ct().m(function e(){var t,A,n,o,r,i,a,s,c,l,u=arguments;return Ct().w(function(e){for(;;)switch(e.n){case 0:if(n=(A=u.length>0&&void 0!==u[0]?u[0]:{}).selector,o=A.color,r=void 0===o?"#6366f1":o,i=A.duration,a=void 0===i?3e3:i,n){e.n=1;break}return e.a(2,{success:!1,error:"Selector is required"});case 1:if(s=document.querySelector(n)){e.n=2;break}return e.a(2,{success:!1,error:"Element not found: ".concat(n)});case 2:return s.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"}),e.n=3,Mt(400);case 3:return c=s.getBoundingClientRect(),kt(),(l=document.createElement("div")).className="ttp-highlight-overlay",l.style.cssText="\n position: fixed;\n top: ".concat(c.top-4,"px;\n left: ").concat(c.left-4,"px;\n width: ").concat(c.width+8,"px;\n height: ").concat(c.height+8,"px;\n --ttp-highlight-color: ").concat(r,";\n border-color: ").concat(r,";\n box-shadow: 0 0 20px ").concat(r,"80, 0 0 40px ").concat(r,"40;\n pointer-events: none;\n z-index: 2147483647;\n "),document.body.appendChild(l),setTimeout(function(){l.classList.add("ttp-fade-out"),setTimeout(function(){l.remove()},300)},a),e.a(2,{success:!0,selector:n,elementInfo:{tag:s.tagName.toLowerCase(),id:s.id||null,text:(null===(t=s.innerText)||void 0===t?void 0:t.trim().substring(0,100))||null,position:{top:c.top,left:c.left,width:c.width,height:c.height}}})}},e)})),St.apply(this,arguments)}function kt(){if(!document.getElementById("ttp-highlight-styles")){var e=document.createElement("style");e.id="ttp-highlight-styles",e.textContent="\n @keyframes ttp-pulse {\n 0%, 100% {\n box-shadow: 0 0 20px var(--ttp-highlight-color, #6366f1)80,\n 0 0 40px var(--ttp-highlight-color, #6366f1)40;\n }\n 50% {\n box-shadow: 0 0 30px var(--ttp-highlight-color, #6366f1)99,\n 0 0 60px var(--ttp-highlight-color, #6366f1)60;\n }\n }\n \n .ttp-highlight-overlay {\n border: 3px solid var(--ttp-highlight-color, #6366f1);\n border-radius: 8px;\n animation: ttp-pulse 1s ease-in-out infinite;\n transition: opacity 0.3s ease;\n }\n \n .ttp-highlight-overlay.ttp-fade-out {\n opacity: 0;\n }\n \n .ttp-fill-success {\n outline: 3px solid #22c55e !important;\n outline-offset: 2px;\n transition: outline 0.3s ease;\n }\n ",document.head.appendChild(e)}}function Et(){return It.apply(this,arguments)}function It(){return It=Ft(Ct().m(function e(){var t,A,n,o,r,i,a,s,c,l,u,d,p,h,g,f,m,v,B=arguments;return Ct().w(function(e){for(;;)switch(e.n){case 0:if(A=(t=B.length>0&&void 0!==B[0]?B[0]:{}).selector,n=t.x,o=t.y,r=t.direction,i=t.amount,a=void 0===i?500:i,s=t.position,c=void 0===s?"center":s,l=t.behavior,u=void 0===l?"smooth":l,!A){e.n=3;break}if(d=document.querySelector(A)){e.n=1;break}return e.a(2,{success:!1,error:"Element not found: ".concat(A)});case 1:return p="top"===c?"start":"bottom"===c?"end":"center",d.scrollIntoView({behavior:u,block:p,inline:"nearest"}),e.n=2,Mt("smooth"===u?500:100);case 2:return h=d.getBoundingClientRect(),e.a(2,{success:!0,scrollType:"element",selector:A,elementPosition:{top:h.top,left:h.left}});case 3:if("up"!==r&&"down"!==r){e.n=5;break}return g=a||500,f=window.scrollY,m=document.documentElement.scrollHeight-window.innerHeight,v="up"===r?Math.max(0,f-g):Math.min(m,f+g),window.scrollTo({top:v,left:window.scrollX,behavior:u}),e.n=4,Mt("smooth"===u?500:100);case 4:return e.a(2,{success:!0,scrollType:"relative",direction:r,amount:g,scrolledFrom:{y:f},scrolledTo:{y:window.scrollY},atTop:0===window.scrollY,atBottom:window.scrollY>=m-1});case 5:if(void 0===n&&void 0===o){e.n=7;break}return window.scrollTo({top:null!=o?o:window.scrollY,left:null!=n?n:window.scrollX,behavior:u}),e.n=6,Mt("smooth"===u?500:100);case 6:return e.a(2,{success:!0,scrollType:"position",scrolledTo:{x:null!=n?n:window.scrollX,y:null!=o?o:window.scrollY}});case 7:return e.a(2,{success:!1,error:"Either selector, x/y position, or direction (up/down) required"})}},e)})),It.apply(this,arguments)}function Tt(){return Ht.apply(this,arguments)}function Ht(){return Ht=Ft(Ct().m(function e(){var t,A,n,o,r=arguments;return Ct().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t=(r.length>0&&void 0!==r[0]?r[0]:{}).url){e.n=1;break}return e.a(2,{success:!1,error:"URL is required"});case 1:e.p=1,A=new URL(t,window.location.origin),e.n=3;break;case 2:return e.p=2,e.v,e.a(2,{success:!1,error:"Invalid URL: ".concat(t)});case 3:if(["http:","https:"].includes(A.protocol)){e.n=4;break}return e.a(2,{success:!1,error:"Invalid protocol: ".concat(A.protocol)});case 4:if(A.origin===window.location.origin){e.n=7;break}return e.p=5,window.open(A.href,"_blank","noopener,noreferrer"),e.a(2,{success:!0,openedInNewTab:!0,navigatedTo:A.href,message:"Opened external link in a new tab"});case 6:return e.p=6,o=e.v,e.a(2,{success:!1,error:"Failed to open external link in new tab: "+o.message,attempted:A.href});case 7:return n=window.location.href,window.location.href=A.href,e.a(2,{success:!0,navigatedTo:A.href,from:n})}},e,null,[[5,6],[1,2]])})),Ht.apply(this,arguments)}function Dt(){return Pt.apply(this,arguments)}function Pt(){return Pt=Ft(Ct().m(function e(){var t,A,n,o,r,i,a,s,c,l,u,d,p=arguments;return Ct().w(function(e){for(;;)switch(e.n){case 0:if(A=(t=p.length>0&&void 0!==p[0]?p[0]:{}).selector,n=t.value,o=t.triggerEvents,r=void 0===o||o,A){e.n=1;break}return e.a(2,{success:!1,error:"Selector is required"});case 1:if(null!=n){e.n=2;break}return e.a(2,{success:!1,error:"Value is required"});case 2:if(i=document.querySelector(A)){e.n=3;break}return e.a(2,{success:!1,error:"Element not found: ".concat(A)});case 3:if(a=i.tagName.toLowerCase(),["input","textarea","select"].includes(a)){e.n=4;break}return e.a(2,{success:!1,error:"Element is not a form field: ".concat(a)});case 4:if(!et(i)){e.n=5;break}return e.a(2,{success:!1,error:"Cannot fill sensitive fields (password, credit card, etc.)",blocked:!0,fieldType:i.type,fieldName:i.name});case 5:return i.scrollIntoView({behavior:"smooth",block:"center"}),e.n=6,Mt(300);case 6:return i.focus(),"select"===a?(s=Array.from(i.options),c=s.find(function(e){return e.value===n||e.text.toLowerCase()===n.toLowerCase()}),i.value=c?c.value:n):"checkbox"===i.type||"radio"===i.type?(l=!0===n||"true"===n||"1"===n,i.checked=l):i.value=n,r&&(i.dispatchEvent(new Event("input",{bubbles:!0})),i.dispatchEvent(new Event("change",{bubbles:!0})),(d=null===(u=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))||void 0===u?void 0:u.set)&&(d.call(i,n),i.dispatchEvent(new Event("input",{bubbles:!0})))),kt(),i.classList.add("ttp-fill-success"),setTimeout(function(){i.classList.remove("ttp-fill-success")},2e3),e.a(2,{success:!0,selector:A,fieldType:i.type||a,fieldName:i.name||null,filled:!0})}},e)})),Pt.apply(this,arguments)}function Ot(){return Kt.apply(this,arguments)}function Kt(){return Kt=Ft(Ct().m(function e(){var t,A,n,o,r,i,a,s,c,l,u,d,p,h,g,f,m,v,B,w,y,b=arguments;return Ct().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=(A=b.length>0&&void 0!==b[0]?b[0]:{}).selector,o=A.waitForNavigation,r=void 0!==o&&o,i=A.openInNewTab,a=void 0!==i&&i,s=A.isExternal,c=void 0!==s&&s,l=A.href,u=void 0===l?null:l,n){e.n=1;break}return e.a(2,{success:!1,error:"Selector is required"});case 1:if(d=document.querySelector(n)){e.n=2;break}return e.a(2,{success:!1,error:"Element not found: ".concat(n)});case 2:if(0!==(p=d.getBoundingClientRect()).width&&0!==p.height){e.n=3;break}return e.a(2,{success:!1,error:"Element is not visible (zero size)"});case 3:if(!d.disabled){e.n=4;break}return e.a(2,{success:!1,error:"Element is disabled"});case 4:return d.scrollIntoView({behavior:"smooth",block:"center"}),e.n=5,Mt(300);case 5:return(h=document.createElement("div")).style.cssText="\n position: fixed;\n top: ".concat(p.top-2,"px;\n left: ").concat(p.left-2,"px;\n width: ").concat(p.width+4,"px;\n height: ").concat(p.height+4,"px;\n border: 2px solid #22c55e;\n border-radius: 4px;\n pointer-events: none;\n z-index: 2147483647;\n transition: opacity 0.2s;\n "),document.body.appendChild(h),e.n=6,Mt(200);case 6:if(h.remove(),!a&&!c){e.n=9;break}if(!(g=u||d.href||("A"===d.tagName?d.getAttribute("href"):null))||"#"===g||g.startsWith("javascript:")){e.n=9;break}return e.p=7,window.open(g,"_blank","noopener,noreferrer"),e.a(2,{success:!0,selector:n,clicked:!0,openedInNewTab:!0,url:g,elementInfo:{tag:d.tagName.toLowerCase(),text:(null===(f=d.innerText)||void 0===f?void 0:f.trim().substring(0,50))||null},message:"Opened link in a new tab"});case 8:e.p=8,y=e.v,console.warn("[TTP] Failed to open in new tab:",y);case 9:if(!r){e.n=11;break}return v=window.location.href,B=new Promise(function(e){var t=setTimeout(function(){e({navigated:!1})},5e3),A=function(){clearTimeout(t),window.removeEventListener("beforeunload",A),e({navigated:!0})};window.addEventListener("beforeunload",A)}),d.click(),e.n=10,B;case 10:return w=e.v,e.a(2,{success:!0,selector:n,clicked:!0,elementInfo:{tag:d.tagName.toLowerCase(),text:(null===(m=d.innerText)||void 0===m?void 0:m.trim().substring(0,50))||null},navigated:w.navigated||window.location.href!==v});case 11:return d.click(),e.a(2,{success:!0,selector:n,clicked:!0,elementInfo:{tag:d.tagName.toLowerCase(),text:(null===(t=d.innerText)||void 0===t?void 0:t.trim().substring(0,50))||null}})}},e,null,[[7,8]])})),Kt.apply(this,arguments)}function Mt(e){return new Promise(function(t){return setTimeout(t,e)})}function Lt(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Rt(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Rt(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Rt(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Rt(u,"constructor",c),Rt(c,"constructor",s),s.displayName="GeneratorFunction",Rt(c,o,"GeneratorFunction"),Rt(u),Rt(u,o,"Generator"),Rt(u,n,function(){return this}),Rt(u,"toString",function(){return"[object Generator]"}),(Lt=function(){return{w:r,m:d}})()}function Rt(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Rt=function(e,t,A,n){function r(t,A){Rt(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},Rt(e,t,A,n)}function _t(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function Vt(e){return function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){_t(r,n,o,i,a,"next",e)}function a(e){_t(r,n,o,i,a,"throw",e)}i(void 0)})}}function jt(){return(jt=Vt(Lt().m(function e(){var t;return Lt().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,yt();case 1:return t=e.v,e.a(2,{url:t.url,title:t.title,timestamp:t.timestamp,language:t.language,viewport:t.viewport,dom:{buttons:t.buttons,links:t.links,forms:t.forms,sections:t.sections,headings:t.headings,metadata:t.metadata}})}},e)}))).apply(this,arguments)}function Nt(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Gt(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Gt(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Gt(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Gt(u,"constructor",c),Gt(c,"constructor",s),s.displayName="GeneratorFunction",Gt(c,o,"GeneratorFunction"),Gt(u),Gt(u,o,"Generator"),Gt(u,n,function(){return this}),Gt(u,"toString",function(){return"[object Generator]"}),(Nt=function(){return{w:r,m:d}})()}function Gt(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Gt=function(e,t,A,n){function r(t,A){Gt(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},Gt(e,t,A,n)}function Wt(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function zt(e){return function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){Wt(r,n,o,i,a,"next",e)}function a(e){Wt(r,n,o,i,a,"throw",e)}i(void 0)})}}function Xt(e){return Xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xt(e)}function Jt(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),A.push.apply(A,n)}return A}function Yt(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?Jt(Object(A),!0).forEach(function(t){tA(e,t,A[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):Jt(Object(A)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}return e}function qt(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,AA(n.key),n)}}function Zt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Zt=function(){return!!e})()}function $t(e){return $t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$t(e)}function eA(e,t){return eA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},eA(e,t)}function tA(e,t,A){return(t=AA(t))in e?Object.defineProperty(e,t,{value:A,enumerable:!0,configurable:!0,writable:!0}):e[t]=A,e}function AA(e){var t=function(e){if("object"!=Xt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Xt(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Xt(t)?t:t+""}var nA=function(e){function t(){var e,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,A){return t=$t(t),function(e,t){if(t&&("object"==Xt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Zt()?Reflect.construct(t,A||[],$t(e).constructor):t.apply(e,A))}(this,t)).version="2.0.0",e.config={signedUrl:A.signedUrl||A.websocketUrl||"wss://speech.talktopc.com/ws/conv",websocketUrl:A.signedUrl||A.websocketUrl||"wss://speech.talktopc.com/ws/conv",agentId:A.agentId,appId:A.appId,sampleRate:A.sampleRate||16e3,channels:A.channels||1,bitDepth:A.bitDepth||16,audioProcessorPath:A.audioProcessorPath,outputContainer:A.outputContainer||e.getDefaultContainer(A),outputEncoding:A.outputEncoding||A.outputCodec||"pcm",outputSampleRate:A.outputSampleRate||16e3,outputChannels:A.outputChannels||1,outputBitDepth:A.outputBitDepth||16,outputFrameDurationMs:A.outputFrameDurationMs||600,outputCodec:A.outputCodec,agentSettingsOverride:A.agentSettingsOverride||null,visualAssistant:A.visualAssistant||null,variables:A.variables||null,autoReconnect:!1!==A.autoReconnect,audioConstraints:A.audioConstraints||null,protocolVersion:A.protocolVersion||2},e.isConnected=!1,e.hasEverConnected=!1,e.isRecording=!1,e.isPlaying=!1,e.isDestroyed=!1,e.outputAudioFormat=null,e.requestedOutputFormat=null,e.formatConverter=null,e.websocket=null,e.conversationId=null,e.transcriptQueue=[],e.currentPlayingSentenceId=null,e.audioFrameCount=0,e.lastAudioStartTime=0,e.wakeLock=null,e._wakeLockRequesting=!1,e.pendingInjections=new Map,e.injectionCounter=0,e.audioPlayer=new T(e.config);var n=Yt(Yt({},e.config),{},{checkConnection:function(){return e.isConnected&&e.websocket&&e.websocket.readyState===WebSocket.OPEN}});return e.audioRecorder=new q(n),e.setupAudioPlayerEvents(),e.setupAudioRecorderEvents(),e.clientToolsRegistry=new Ke(function(t){return e.sendMessage(t)},function(){return e.conversationId}),e._registerBuiltInTools(),e.validateConfig(),e._setupPageUnloadHandler(),console.log("🎵 VoiceSDK v2 initialized:",{version:e.version,outputContainer:e.config.outputContainer,outputEncoding:e.config.outputEncoding,outputSampleRate:e.config.outputSampleRate}),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eA(e,t)}(t,e),A=t,n=[{key:"_registerBuiltInTools",value:function(){var e=this;console.log("📸 VoiceSDK: _registerBuiltInTools() called"),console.log("📸 VoiceSDK: captureScreenshot available?",void 0!==Xe);try{if(void 0===Xe)return console.error("❌ VoiceSDK: captureScreenshot is undefined - import may have failed"),void console.error(" This will prevent capture_screen tool from working");console.log("📸 VoiceSDK: Registering capture_screen tool, captureScreenshot type:",Xt(Xe)),this.clientToolsRegistry.registerHandler("capture_screen",zt(Nt().m(function t(){var A,n,o,r,i,a,s,c,l,u,d,p,h,g,f,m,v,B=arguments;return Nt().w(function(t){for(;;)switch(t.p=t.n){case 0:return A=B.length>0&&void 0!==B[0]?B[0]:{},console.log("📸 VoiceSDK: capture_screen tool called with params:",A),n=A.selector,o=void 0===n?null:n,r=A.format,i=void 0===r?"jpeg":r,a=A.quality,s=void 0===a?.85:a,c=A.scale,l=void 0===c?1:c,u=A.fullPage,d=void 0!==u&&u,p=A.maxWidth,h=void 0===p?1280:p,g=A.maxHeight,f=void 0===g?1280:g,t.p=1,t.n=2,Xe({selector:o,format:i,quality:s,scale:l,fullPage:d,maxWidth:h,maxHeight:f});case 2:return m=t.v,console.log("📸 VoiceSDK: Screenshot captured: ".concat(m.width,"x").concat(m.height,", ").concat(Math.round(m.image.length/1024),"KB")),e.emit("screenshotCaptured",{width:m.width,height:m.height,sizeKB:Math.round(m.image.length/1024),selector:m.selector}),t.a(2,m);case 3:throw t.p=3,v=t.v,console.error("📸 VoiceSDK: Screenshot capture failed:",v),e.emit("screenshotError",{error:v.message}),v;case 4:return t.a(2)}},t,null,[[1,3]])}))),console.log("📸 VoiceSDK: Built-in capture_screen tool registered")}catch(e){console.error("❌ VoiceSDK: Error registering built-in tools:",e),console.error(" Error details:",e.message,e.stack)}try{!function(e){e.registerHandler("read_page",Vt(Lt().m(function e(){var t,A,n=arguments;return Lt().w(function(e){for(;;)switch(e.n){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] 📋 Reading page structure..."),e.n=1,yt(t);case 1:return A=e.v,console.log("[TTP] ✅ Page structure extracted:",{buttons:A.buttons.length,links:A.links.length,forms:A.forms.length,headings:A.headings.length}),e.a(2,A)}},e)}))),e.registerHandler("highlight_element",Vt(Lt().m(function e(){var t,A,n=arguments;return Lt().w(function(e){for(;;)switch(e.n){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] ✨ Highlighting element:",t.selector),e.n=1,Ut(t);case 1:return(A=e.v).success?console.log("[TTP] ✅ Element highlighted"):console.warn("[TTP] ⚠️ Highlight failed:",A.error),e.a(2,A)}},e)}))),e.registerHandler("scroll_to_element",Vt(Lt().m(function e(){var t,A,n,o,r=arguments;return Lt().w(function(e){for(;;)switch(e.n){case 0:return(t=r.length>0&&void 0!==r[0]?r[0]:{}).selector?console.log("[TTP] 📜 Scrolling to element:",t.selector):t.direction?console.log("[TTP] 📜 Scrolling",t.direction,"by",t.amount||500,"px"):void 0!==t.x||void 0!==t.y?console.log("[TTP] 📜 Scrolling to position:","(".concat(null!==(A=t.x)&&void 0!==A?A:"current",", ").concat(null!==(n=t.y)&&void 0!==n?n:"current",")")):console.log("[TTP] 📜 Scroll called with params:",t),e.n=1,Et(t);case 1:return(o=e.v).success?console.log("[TTP] ✅ Scrolled successfully"):console.warn("[TTP] ⚠️ Scroll failed:",o.error),e.a(2,o)}},e)}))),e.registerHandler("navigate_to",Vt(Lt().m(function e(){var t,A,n=arguments;return Lt().w(function(e){for(;;)switch(e.n){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] 🔗 Navigating to:",t.url),e.n=1,Tt(t);case 1:return(A=e.v).success?console.log("[TTP] ✅ Navigation initiated"):console.warn("[TTP] ⚠️ Navigation blocked:",A.error),e.a(2,A)}},e)}))),e.registerHandler("fill_field",Vt(Lt().m(function e(){var t,A,n=arguments;return Lt().w(function(e){for(;;)switch(e.n){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] 📝 Filling field:",t.selector),e.n=1,Dt(t);case 1:return(A=e.v).success?console.log("[TTP] ✅ Field filled"):console.warn("[TTP] ⚠️ Fill failed:",A.error),e.a(2,A)}},e)}))),e.registerHandler("click_element",Vt(Lt().m(function e(){var t,A,n=arguments;return Lt().w(function(e){for(;;)switch(e.n){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] 👆 Clicking element:",t.selector),e.n=1,Ot(t);case 1:return(A=e.v).success?console.log("[TTP] ✅ Element clicked"):console.warn("[TTP] ⚠️ Click failed:",A.error),e.a(2,A)}},e)})));var t=e.getRegisteredTools(),A=["read_page","highlight_element","scroll_to_element","navigate_to","fill_field","click_element"].filter(function(e){return!t.includes(e)});A.length>0?console.error("[TTP] ❌ Some visual tools failed to register:",A):console.log("[TTP] 👁️ Visual assistant tools registered successfully:",t)}(this.clientToolsRegistry);var t=this.clientToolsRegistry.getRegisteredTools(),A=["read_page","click_element","fill_field","highlight_element","scroll_to_element","navigate_to"],n=t.filter(function(e){return A.includes(e)});if(n.length!==A.length){var o=A.filter(function(e){return!n.includes(e)});console.error("❌ VoiceSDK: Some visual tools failed to register:",o),console.error(" Registered visual tools:",n)}else console.log("✅ VoiceSDK: All visual tools registered:",n)}catch(e){console.error("❌ VoiceSDK: Error registering visual assistant tools:",e),console.error(" Error details:",e.message,e.stack)}var r=this.clientToolsRegistry.getRegisteredTools(),i=["read_page","capture_screen","highlight_element","click_element","fill_field","scroll_to_element","navigate_to"],a=r.filter(function(e){return i.includes(e)});if(a.length!==i.length){var s=i.filter(function(e){return!a.includes(e)});console.error("❌ VoiceSDK: Missing internal tools:",s),console.error(" Expected 7 internal tools:",i),console.error(" Registered:",a)}else console.log("✅ VoiceSDK: All 7 internal tools registered:",a);console.log("🔧 VoiceSDK: All registered tools after _registerBuiltInTools():",r)}},{key:"getStoredConversationId",value:function(){try{if("undefined"==typeof sessionStorage)return console.warn("⚠️ VoiceSDK v2: sessionStorage not available (private mode?)"),null;var e=sessionStorage.getItem(t.RESUME_STORAGE_KEY);if(e){var A=JSON.parse(e);if(A&&A.conversationId)return console.log("📦 VoiceSDK v2: Found stored conversationId:",A.conversationId),A.conversationId}return null}catch(e){return console.warn("⚠️ VoiceSDK v2: Error reading sessionStorage:",e),null}}},{key:"storeConversationId",value:function(e){if(e)try{if("undefined"==typeof sessionStorage)return void console.warn("⚠️ VoiceSDK v2: sessionStorage not available (private mode?)");var A={},n=sessionStorage.getItem(t.RESUME_STORAGE_KEY);if(n)try{A=JSON.parse(n)}catch(e){}A.conversationId=e,A.timestamp=Date.now(),A.fromPage=A.fromPage||window.location.pathname+window.location.search,sessionStorage.setItem(t.RESUME_STORAGE_KEY,JSON.stringify(A)),console.log("💾 VoiceSDK v2: Stored conversationId:",e)}catch(e){console.warn("⚠️ VoiceSDK v2: Error writing to sessionStorage:",e)}}},{key:"clearStoredConversationId",value:function(){try{if("undefined"==typeof sessionStorage)return;sessionStorage.removeItem(t.RESUME_STORAGE_KEY),console.log("🗑️ VoiceSDK v2: Cleared stored conversationId")}catch(e){console.warn("⚠️ VoiceSDK v2: Error clearing sessionStorage:",e)}}},{key:"_getResumeState",value:function(){try{if("undefined"==typeof sessionStorage)return null;var e=sessionStorage.getItem(t.RESUME_STORAGE_KEY);if(!e)return null;var A=JSON.parse(e),n=Date.now()-A.timestamp;return n>t.RESUME_TTL_MS?(console.log("[VoiceSDK] Resume state expired:",n,"ms"),this._clearResumeState(),null):(console.log("[VoiceSDK] Found valid resume state:",A,"age:",n,"ms"),A)}catch(e){return console.warn("[VoiceSDK] Failed to get resume state:",e),null}}},{key:"_clearResumeState",value:function(){try{if("undefined"==typeof sessionStorage)return;sessionStorage.removeItem(t.RESUME_STORAGE_KEY)}catch(e){}}},{key:"_setupPageUnloadHandler",value:function(){var e=this;window.addEventListener("beforeunload",function(){e.conversationId&&e.websocket&&e.websocket.readyState===WebSocket.OPEN&&e.storeConversationId(e.conversationId)}),document.addEventListener("visibilitychange",function(){"visible"===document.visibilityState&&(e.isRecording&&e.isConnected&&e._requestWakeLock(),e.isRecording&&e.audioRecorder&&e.audioRecorder.resumeAudioContext().catch(function(e){console.error("VoiceSDK v2: Error resuming AudioContext on visibility change:",e)}),e.audioPlayer&&e.audioPlayer.resumeAudioContext().catch(function(e){console.error("VoiceSDK v2: Error resuming playback AudioContext on visibility change:",e)})),"hidden"===document.visibilityState&&e.conversationId&&e.websocket&&e.websocket.readyState===WebSocket.OPEN&&e.storeConversationId(e.conversationId)})}},{key:"checkAndResume",value:function(){var e=this._getResumeState();if(!e)return null;var t=window.location.pathname+window.location.search;return console.log("[VoiceSDK] Auto-resuming conversation:",e.conversationId),console.log("[VoiceSDK] Page change:",e.fromPage,"→",t),{conversationId:e.conversationId,fromPage:e.fromPage,toPage:t}}},{key:"getDefaultContainer",value:function(e){return"wav"===e.outputCodec?"wav":"raw"}},{key:"validateInputFormat",value:function(e){var A;if(!e)return"Input format is required";var n=null===(A=e.encoding)||void 0===A?void 0:A.toLowerCase();return n&&t.SUPPORTED_INPUT_ENCODINGS.includes(n)?e.sampleRate&&t.SUPPORTED_INPUT_SAMPLE_RATES.includes(e.sampleRate)?e.bitDepth&&t.SUPPORTED_INPUT_BIT_DEPTHS.includes(e.bitDepth)?e.channels&&t.SUPPORTED_INPUT_CHANNELS.includes(e.channels)?null:"Unsupported input channels: ".concat(e.channels,". Supported: ").concat(t.SUPPORTED_INPUT_CHANNELS.join(", ")):"Unsupported input bit depth: ".concat(e.bitDepth,". Supported: ").concat(t.SUPPORTED_INPUT_BIT_DEPTHS.join(", ")):"Unsupported input sample rate: ".concat(e.sampleRate,". Supported: ").concat(t.SUPPORTED_INPUT_SAMPLE_RATES.join(", ")):"Unsupported input encoding: ".concat(e.encoding,". Supported: ").concat(t.SUPPORTED_INPUT_ENCODINGS.join(", "))}},{key:"validateOutputFormat",value:function(e){var A,n;if(!e)return"Output format is required";var o=null===(A=e.encoding)||void 0===A?void 0:A.toLowerCase();if(!o||!t.SUPPORTED_OUTPUT_ENCODINGS.includes(o))return"Unsupported output encoding: ".concat(e.encoding,". Supported: ").concat(t.SUPPORTED_OUTPUT_ENCODINGS.join(", "));if(!e.sampleRate||!t.SUPPORTED_OUTPUT_SAMPLE_RATES.includes(e.sampleRate))return"Unsupported output sample rate: ".concat(e.sampleRate,". Supported: ").concat(t.SUPPORTED_OUTPUT_SAMPLE_RATES.join(", "));if(!e.bitDepth||!t.SUPPORTED_OUTPUT_BIT_DEPTHS.includes(e.bitDepth))return"Unsupported output bit depth: ".concat(e.bitDepth,". Supported: ").concat(t.SUPPORTED_OUTPUT_BIT_DEPTHS.join(", "));if(!e.channels||!t.SUPPORTED_OUTPUT_CHANNELS.includes(e.channels))return"Unsupported output channels: ".concat(e.channels,". Supported: ").concat(t.SUPPORTED_OUTPUT_CHANNELS.join(", "));var r=null===(n=e.container)||void 0===n?void 0:n.toLowerCase();return r&&t.SUPPORTED_OUTPUT_CONTAINERS.includes(r)?null:"Unsupported output container: ".concat(e.container,". Supported: ").concat(t.SUPPORTED_OUTPUT_CONTAINERS.join(", "))}},{key:"validateConfig",value:function(){var e={encoding:"pcm",sampleRate:this.config.sampleRate,channels:this.config.channels,bitDepth:this.config.bitDepth},t=this.validateInputFormat(e);if(t)return console.error("❌ VoiceSDK v2: Invalid input format:",t),void this.emit("error",new Error(t));var A={encoding:this.config.outputEncoding,sampleRate:this.config.outputSampleRate,channels:this.config.outputChannels,bitDepth:this.config.outputBitDepth,container:this.config.outputContainer},n=this.validateOutputFormat(A);if(n)return console.error("❌ VoiceSDK v2: Invalid output format:",n),void this.emit("error",new Error(n));console.log("✅ VoiceSDK v2: Format validation passed")}},{key:"setupAudioPlayerEvents",value:function(){var e=this;this.audioPlayer.on("playbackStarted",function(){e.isPlaying=!0,e.emit("playbackStarted"),e.isConnected?(console.log("📤 VoiceSDK v2: Sending audio_started_playing message to server"),e.sendMessage({t:"audio_started_playing"})):console.warn("⚠️ VoiceSDK v2: Cannot send audio_started_playing - not connected")}),this.audioPlayer.on("transcriptDisplay",function(t){var A=e.currentPlayingSentenceId?e.currentPlayingSentenceId+1:1;e.currentPlayingSentenceId=A;var n={text:t.text,role:"assistant",sentenceId:A,final:!0,timestamp:Date.now()};console.log("📝 VoiceSDK v2: Emitting synced transcriptDisplay from AudioPlayer:",n),e.emit("transcriptDisplay",n),e.emit("transcript",n)}),this.audioPlayer.on("playbackStopped",function(){e.isPlaying=!1,e.emit("playbackStopped"),e.isConnected?(console.log("📤 VoiceSDK v2: Sending audio_stopped_playing message to server"),e.sendMessage({t:"audio_stopped_playing"})):console.warn("⚠️ VoiceSDK v2: Cannot send audio_stopped_playing - not connected")}),this.audioPlayer.on("playbackError",function(t){e.emit("playbackError",t),e.emit("error",t)})}},{key:"setupAudioRecorderEvents",value:function(){var e=this;this.audioRecorder.on("recordingStarted",function(){e.isRecording=!0,e.emit("recordingStarted")}),this.audioRecorder.on("recordingStopped",function(){e.isRecording&&(e.isRecording=!1,e.emit("recordingStopped"),console.log("🛑 VoiceSDK v2: Recording stopped (from audioRecorder event)"))}),this.audioRecorder.on("audioData",function(t){e.isConnected&&e.sendBinary(t)}),this.audioRecorder.on("error",function(t){t.isServerRejection||"ServerRejected"===t.name||(console.error("❌ AudioRecorder error:",t),e.emit("error",t))})}},{key:"buildWebSocketUrl",value:function(){var e=this.config.signedUrl||this.config.websocketUrl,t=new URL(e,"wss://placeholder.com"),A=t.searchParams;this.config.agentId&&!A.has("agentId")&&A.append("agentId",this.config.agentId),this.config.appId&&!A.has("appId")&&A.append("appId",this.config.appId);var n=this.getStoredConversationId();n&&!A.has("conversationId")&&(A.append("conversationId",n),console.log("🔄 VoiceSDK v2: Attempting resume via query param:",n));var o=window.location.pathname+window.location.search;o&&!A.has("currentPage")&&A.append("currentPage",o);var r=A.toString();return r?"".concat(t.origin).concat(t.pathname,"?").concat(r):"".concat(t.origin).concat(t.pathname)}},{key:"connect",value:(p=zt(Nt().m(function e(){var t,A,n=this;return Nt().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!this.isDestroyed){e.n=1;break}return console.warn("VoiceSDK v2: Cannot connect - SDK is destroyed"),e.a(2,!1);case 1:if(!this.isConnected){e.n=2;break}return console.warn("VoiceSDK v2: Already connected"),e.a(2,!0);case 2:return e.p=2,t=this.buildWebSocketUrl(),e.n=3,new Promise(function(e,A){n.websocket=new WebSocket(t),n.websocket.onopen=function(){if(console.log("✅ VoiceSDK v2: WebSocket connected"),n.isConnected=!0,n.hasEverConnected=!0,n.clientToolsRegistry){n.clientToolsRegistry.setSendMessage(function(e){return n.sendMessage(e)});var t=n.clientToolsRegistry.getRegisteredTools();console.log("🔧 VoiceSDK v2: Registered tools on connect:",t);var A=["read_page","capture_screen","highlight_element","click_element","fill_field","scroll_to_element","navigate_to"].filter(function(e){return!t.includes(e)});if(A.length>0){console.warn("⚠️ VoiceSDK v2: Missing tools detected, re-registering:",A),n._registerBuiltInTools();var o=n.clientToolsRegistry.getRegisteredTools();console.log("🔧 VoiceSDK v2: Tools after re-registration:",o)}}n.sendHelloMessage(),n.emit("connected"),e(!0)},n.websocket.onerror=function(e){console.error("❌ VoiceSDK v2: WebSocket error:",e),A(e)},n.websocket.onclose=function(e){if(console.log("🔌 VoiceSDK v2: WebSocket closed:",e.code,e.reason),n.isConnected=!1,n.isRecording&&n.stopRecording().catch(function(e){return console.error("Error stopping recording:",e)}),n._releaseWakeLock(),n.pendingInjections.size>0){console.warn("VoiceSDK v2: Rejecting ".concat(n.pendingInjections.size," pending data injections due to disconnect"));var t=new Error("Connection closed - data injection cancelled");t.error="CONNECTION_CLOSED",n.pendingInjections.forEach(function(e,A){clearTimeout(e.timeout),e.reject(t),n.emit("dataInjectionError",{error:"CONNECTION_CLOSED",message:"Connection closed - data injection cancelled",correlationId:A})}),n.pendingInjections.clear()}n.emit("disconnected",e),n.config.autoReconnect&&!n.isDestroyed&&n.hasEverConnected?(console.log("🔄 VoiceSDK v2: Auto-reconnecting in 3s..."),setTimeout(function(){n.isDestroyed||n.isConnected||n.connect()},3e3)):n.config.autoReconnect&&!n.hasEverConnected&&console.log("⚠️ VoiceSDK v2: Initial connection failed. Auto-reconnect disabled to prevent retry loop.")},n.websocket.onmessage=function(e){n.handleMessage(e)}});case 3:return e.a(2,e.v);case 4:return e.p=4,A=e.v,console.error("🔌 VoiceSDK v2: Connection failed:",A),this.emit("error",A),e.a(2,!1)}},e,this,[[2,4]])})),function(){return p.apply(this,arguments)})},{key:"detectBrowserLocale",value:function(){var e,t,A=navigator.language||(null===(e=navigator.languages)||void 0===e?void 0:e[0])||"en-US";return{language:(null===(t=A.split("-")[0])||void 0===t?void 0:t.toLowerCase())||"en",fullLocale:A}}},{key:"sendHelloMessage",value:(d=zt(Nt().m(function e(){var t,A,n,o,r;return Nt().w(function(e){for(;;)switch(e.n){case 0:if(this.isConnected){e.n=1;break}return console.warn("VoiceSDK v2: Cannot send hello - not connected"),e.a(2);case 1:if(t={encoding:"pcm",sampleRate:this.config.sampleRate,channels:this.config.channels,bitDepth:this.config.bitDepth},A={encoding:this.config.outputEncoding,sampleRate:this.config.outputSampleRate,channels:this.config.outputChannels,bitDepth:this.config.outputBitDepth,container:this.config.outputContainer},!(n=this.validateInputFormat(t))){e.n=2;break}return console.error("❌ VoiceSDK v2: Cannot send hello - invalid input format:",n),this.emit("error",new Error("Invalid input format: ".concat(n))),e.a(2);case 2:if(!(o=this.validateOutputFormat(A))){e.n=3;break}return console.error("❌ VoiceSDK v2: Cannot send hello - invalid output format:",o),this.emit("error",new Error("Invalid output format: ".concat(o))),e.a(2);case 3:r={t:"hello",v:this.config.protocolVersion,inputFormat:t,requestedOutputFormat:A,outputFrameDurationMs:this.config.outputFrameDurationMs},this.config.agentSettingsOverride&&(r.agentSettingsOverride=this.config.agentSettingsOverride),r.locale=this.detectBrowserLocale(),console.log("🌍 VoiceSDK v2: Auto-detected locale:",r.locale),console.log("🔍 VoiceSDK v2: Checking variables:",{hasVariables:!!this.config.variables,variables:this.config.variables,keys:this.config.variables?Object.keys(this.config.variables):[]}),this.config.variables&&Object.keys(this.config.variables).length>0?(r.variables=this.config.variables,console.log("📝 VoiceSDK v2: Including variables in hello:",Object.keys(this.config.variables))):console.log("⚠️ VoiceSDK v2: Variables NOT included - condition failed"),console.log("📤 VoiceSDK v2: Sending hello:",{version:r.v,requestedFormat:r.requestedOutputFormat,variables:r.variables?Object.keys(r.variables):void 0}),console.log("📤 VoiceSDK v2: Requested output format:",{container:r.requestedOutputFormat.container,encoding:r.requestedOutputFormat.encoding,sampleRate:r.requestedOutputFormat.sampleRate,bitDepth:r.requestedOutputFormat.bitDepth}),console.log("📤 VoiceSDK v2: Full hello message being sent:",JSON.stringify(r,null,2));try{this.sendMessage(r)}catch(e){console.error("VoiceSDK v2: Failed to send hello:",e),this.emit("error",e)}case 4:return e.a(2)}},e,this)})),function(){return d.apply(this,arguments)})},{key:"handleMessage",value:function(e){var t,A=this;if(e.data instanceof ArrayBuffer||e.data instanceof Blob)this.handleBinaryMessage(e.data);else try{var n=JSON.parse(e.data);switch("audio"!==n.t&&console.log("📥 VoiceSDK v2: Received message type:",n.t,"Full message:",JSON.stringify(n).substring(0,200)),!this.conversationId&&n.conversationId&&(this.conversationId=n.conversationId,console.log("🔍 VoiceSDK v2: Captured conversationId from message:",this.conversationId),this.emit("conversationIdChanged",this.conversationId)),"audio"!==n.t&&console.log("📨 VoiceSDK v2: Received message type:",n.t,n),n.t){case"hello_ack":this.handleHelloAck(n);break;case"transcript":console.log("📝 VoiceSDK v2: Processing transcript message:",n),this.handleTranscript(n);break;case"user_transcript":console.log("📝 VoiceSDK v2: Received user_transcript:",n),this.emit("message",n);break;case"agent_response":if(console.log("📝 VoiceSDK v2: Received agent_response:",n),(n.text||n.transcript)&&(console.log("📝 VoiceSDK v2: agent_response contains transcript data:",n.text||n.transcript),n.sentenceId&&(n.text||n.transcript))){var o={t:"transcript",sentenceId:n.sentenceId,text:n.text||n.transcript,role:n.role||"assistant",final:!1!==n.final,timestamp:n.timestamp||Date.now()};console.log("📝 VoiceSDK v2: Converting agent_response to transcript:",o),this.handleTranscript(o)}this.emit("message",n);break;case"error":this.emit("message",n);break;case"barge_in":this.emit("bargeIn",n),this.stopAudioPlayback();break;case"stop_playing":var r=Date.now()-this.lastAudioStartTime;if(r<200){console.warn("⚠️ VoiceSDK v2: Ignoring premature stop_playing (".concat(r,"ms after audio_start, minimum ").concat(200,"ms required)"));break}this.emit("stopPlaying",n),this.stopAudioPlayback();break;case"audio_start":console.log("📝 VoiceSDK v2: Received audio_start with text:",n.text),this.lastAudioStartTime=Date.now(),this.audioPlayer&&(this.audioPlayer.isPlaying||(null===(t=this.audioPlayer.scheduledSources)||void 0===t?void 0:t.size)>0)&&console.log("📝 VoiceSDK v2: New sentence received while audio playing - will queue and wait for current sentence to finish"),n.text&&this.audioPlayer&&this.audioPlayer.markNewSentence(n.text),this.emit("message",n);break;case"client_tool_call":this.clientToolsRegistry.handleToolCall(n);break;case"text_inject_ack":this.handleTextInjectAck(n);break;case"data_inject_ack":this.handleDataInjectAck(n);break;case"data_inject_error":this.handleDataInjectError(n);break;case"hangup_ack":console.log("📞 VoiceSDK v2: Hangup acknowledged by server"),this.websocket&&this.websocket.readyState===WebSocket.OPEN&&(this.websocket.close(1e3,"User hangup"),this.websocket=null),this.isConnected=!1,this.emit("hangupAcknowledged");break;case"get_page_context":console.log("📖 [VISUAL ASSISTANT] Backend requested page context"),function(){return jt.apply(this,arguments)}().then(function(e){A.sendMessage({t:"page_context",pageContext:e}),console.log("📖 [VISUAL ASSISTANT] Page context sent:",e.url)}).catch(function(e){console.error("❌ [VISUAL ASSISTANT] Failed to scan page:",e),A.sendMessage({t:"page_context",pageContext:null,error:e.message})});break;case"get_screenshot":console.log("📸 [VISUAL ASSISTANT] Backend requested screenshot");try{Xe().then(function(e){A.sendMessage({t:"screenshot",screenshot:{image:e.base64,mimeType:e.mimeType||"image/png",width:e.width,height:e.height}}),console.log("📸 [VISUAL ASSISTANT] Screenshot sent:",e.width+"x"+e.height)}).catch(function(e){console.error("❌ [VISUAL ASSISTANT] Screenshot capture failed:",e),A.sendMessage({t:"screenshot",screenshot:null,error:e.message})})}catch(e){console.error("❌ [VISUAL ASSISTANT] Screenshot error:",e),this.sendMessage({t:"screenshot",screenshot:null,error:e.message})}break;case"page_context_ack":n.ok?console.log("✅ [VISUAL ASSISTANT] Page context acknowledged"):console.warn("⚠️ [VISUAL ASSISTANT] Page context error:",n.error);break;case"screenshot_ack":n.ok?console.log("✅ [VISUAL ASSISTANT] Screenshot acknowledged"):console.warn("⚠️ [VISUAL ASSISTANT] Screenshot error:",n.error);break;default:if(console.log("VoiceSDK v2: Unknown message type:",n.t,"Full message:",JSON.stringify(n).substring(0,300)),(n.text||n.transcript||n.transcription)&&(console.log("📝 VoiceSDK v2: Unknown message contains transcript-like data:",{text:n.text,transcript:n.transcript,transcription:n.transcription,sentenceId:n.sentenceId,role:n.role}),n.sentenceId&&(n.text||n.transcript||n.transcription))){var i={t:"transcript",sentenceId:n.sentenceId,text:n.text||n.transcript||n.transcription,role:n.role||"assistant",final:!1!==n.final,timestamp:n.timestamp||Date.now()};console.log("📝 VoiceSDK v2: Attempting to process unknown message as transcript:",i),this.handleTranscript(i)}this.emit("message",n)}}catch(t){var a,s,c="string"==typeof e.data?e.data:String(e.data),l=(null===(a=t.message)||void 0===a||null===(a=a.match(/position (\d+)/))||void 0===a?void 0:a[1])||"unknown",u=parseInt(l,10);if(console.error("VoiceSDK v2: Error parsing message:",t),console.error("VoiceSDK v2: Raw message length:",c.length),console.error("VoiceSDK v2: Error at position:",u),"unknown"!==u&&u>0){var d=Math.max(0,u-50),p=Math.min(c.length,u+50),h=c.substring(d,p),g=" ".repeat(u-d)+"^";console.error("VoiceSDK v2: Context around error:"),console.error(h),console.error(g);var f=c.charAt(u),m=f.charCodeAt(0);console.error('VoiceSDK v2: Problematic character: "'.concat(f,'" (charCode: ').concat(m,")")),m<32&&9!==m&&10!==m&&13!==m&&console.error("VoiceSDK v2: This is an unescaped control character. The backend should escape it in JSON strings.")}var v=c.includes("client_tool_call")||c.includes('"t":"client_tool_call"');if(v){console.error("⚠️ VoiceSDK v2: CRITICAL - Failed to parse client_tool_call message!"),console.error("⚠️ VoiceSDK v2: This means a tool execution (like form filling) was lost due to JSON parsing error."),console.error("⚠️ VoiceSDK v2: The backend sent malformed JSON with unescaped control characters.");var B=c.match(/"toolName"\s*:\s*"([^"]+)"/);B&&console.error('⚠️ VoiceSDK v2: Attempted tool: "'.concat(B[1],'"'));var w=c.match(/"toolCallId"\s*:\s*"([^"]+)"/);w&&console.error('⚠️ VoiceSDK v2: Tool call ID: "'.concat(w[1],'"'))}if(null!==(s=t.message)&&void 0!==s&&s.includes("Bad control character")){console.warn("VoiceSDK v2: Attempting to recover by sanitizing control characters...");try{var y=c;y=y.replace(/([^\\])([\x00-\x08\x0B\x0C\x0E-\x1F])/g,function(e,t,A){var n=A.charCodeAt(0);return t+({0:"\\u0000",1:"\\u0001",2:"\\u0002",3:"\\u0003",4:"\\u0004",5:"\\u0005",6:"\\u0006",7:"\\u0007",8:"\\b",11:"\\u000B",12:"\\f",14:"\\u000E",15:"\\u000F",16:"\\u0010",17:"\\u0011",18:"\\u0012",19:"\\u0013",20:"\\u0014",21:"\\u0015",22:"\\u0016",23:"\\u0017",24:"\\u0018",25:"\\u0019",26:"\\u001A",27:"\\u001B",28:"\\u001C",29:"\\u001D",30:"\\u001E",31:"\\u001F"}[n]||"\\u".concat(n.toString(16).padStart(4,"0")))});var b=JSON.parse(y);if(console.warn("✅ VoiceSDK v2: Successfully recovered message after sanitization!"),console.warn("✅ VoiceSDK v2: Processing recovered message..."),"client_tool_call"===b.t&&this.clientToolsRegistry)console.warn("✅ VoiceSDK v2: Recovered client_tool_call - executing tool"),this.clientToolsRegistry.handleToolCall(b);else{var C=b;"audio"!==C.t&&console.log("📥 VoiceSDK v2: Received message type:",C.t,"Full message:",JSON.stringify(C).substring(0,200)),!this.conversationId&&C.conversationId&&(this.conversationId=C.conversationId,console.log("🔍 VoiceSDK v2: Captured conversationId from message:",this.conversationId),this.emit("conversationIdChanged",this.conversationId)),"audio"!==C.t&&console.log("📨 VoiceSDK v2: Received message type:",C.t,C),"client_tool_call"===C.t?this.clientToolsRegistry.handleToolCall(C):this.emit("message",C)}return}catch(e){console.error("❌ VoiceSDK v2: Recovery attempt failed:",e)}}console.error("VoiceSDK v2: First 500 chars of raw message:",c.substring(0,500)),this.emit("error",{type:"json_parse_error",error:t,rawMessage:c.substring(0,1e3),position:u,wasToolCall:v})}}},{key:"handleHelloAck",value:function(e){if(console.log("📥 VoiceSDK v2: Received hello_ack:",{hasOutputFormat:!!e.outputAudioFormat,outputFormat:e.outputAudioFormat,hasConversationId:!!e.conversationId,messageType:e.t}),e.conversationId&&(this.conversationId=e.conversationId,console.log("🔍 VoiceSDK v2: Received conversationId:",this.conversationId),this.emit("conversationIdChanged",this.conversationId),this.storeConversationId(this.conversationId)),!0===e.resumed?(console.log("✅ VoiceSDK v2: Conversation resumed successfully"),this.emit("callResumed",{conversationId:this.conversationId,timestamp:Date.now()})):!1===e.resumed&&e.resumeRejectedReason&&(console.warn("⚠️ VoiceSDK v2: Resume rejected:",e.resumeRejectedReason),this.clearStoredConversationId(),this.emit("resumeRejected",{reason:e.resumeRejectedReason,conversationId:e.conversationId||null,timestamp:Date.now()})),e.outputAudioFormat){this.outputAudioFormat=e.outputAudioFormat,this.audioPlayer.setOutputFormat(e.outputAudioFormat),console.log("✅ VoiceSDK v2: Format negotiated by server:",this.outputAudioFormat),this.requestedOutputFormat={container:this.config.outputContainer||"wav",encoding:this.config.outputEncoding||"pcm",sampleRate:this.config.outputSampleRate||16e3,bitDepth:this.config.outputBitDepth||16,channels:this.config.outputChannels||1};var t={container:this.outputAudioFormat.container||"unknown",encoding:this.outputAudioFormat.encoding||"unknown",sampleRate:this.outputAudioFormat.sampleRate||0,bitDepth:this.outputAudioFormat.bitDepth||0,channels:this.outputAudioFormat.channels||0},A=[];if(this.requestedOutputFormat.container!==t.container&&A.push('container: "'.concat(this.requestedOutputFormat.container,'" → "').concat(t.container,'"')),this.requestedOutputFormat.encoding!==t.encoding&&A.push('encoding: "'.concat(this.requestedOutputFormat.encoding,'" → "').concat(t.encoding,'"')),this.requestedOutputFormat.sampleRate!==t.sampleRate&&A.push("sampleRate: ".concat(this.requestedOutputFormat.sampleRate,"Hz → ").concat(t.sampleRate,"Hz")),this.requestedOutputFormat.bitDepth!==t.bitDepth&&A.push("bitDepth: ".concat(this.requestedOutputFormat.bitDepth,"-bit → ").concat(t.bitDepth,"-bit")),this.requestedOutputFormat.channels!==t.channels&&A.push("channels: ".concat(this.requestedOutputFormat.channels," → ").concat(t.channels)),A.length>0){console.warn("⚠️ VoiceSDK v2: Format negotiation mismatch!"),console.warn(" Requested:",this.requestedOutputFormat),console.warn(" Negotiated:",t),console.warn(" Differences:",A.join(", "));try{if(this.formatConverter=new Ee(this.requestedOutputFormat,t),this.formatConverter.needsConversion()){var n=this.formatConverter.getConversionSteps();console.log("🔄 VoiceSDK v2: Format conversion enabled"),console.log(" Conversion steps:",n.join(", ")),console.log(" Audio will be automatically converted to requested format")}}catch(e){console.error("❌ VoiceSDK v2: Failed to create format converter:",e),console.warn(" Will use backend format without conversion"),this.formatConverter=null}}else console.log("✅ VoiceSDK v2: Format perfectly matched!",t),this.formatConverter=null;this.emit("formatNegotiated",this.outputAudioFormat)}else{this.config.protocolVersion>=2&&(console.warn("⚠️ VoiceSDK v2: hello_ack received but no outputAudioFormat in response."),console.warn(" This may happen if:"),console.warn(" 1. Backend is not sending outputAudioFormat (check backend logs)"),console.warn(" 2. Hello message missing v2 fields (v, inputFormat, requestedOutputFormat)"),console.warn(" 3. Backend validation failed (check backend error logs)"),console.warn(" Using default format from config..."));var o={container:this.config.outputContainer||"wav",encoding:this.config.outputEncoding||"pcm",sampleRate:this.config.outputSampleRate||16e3,channels:this.config.outputChannels||1,bitDepth:this.config.outputBitDepth||16};this.outputAudioFormat=o,this.requestedOutputFormat=o,this.audioPlayer.setOutputFormat(o),this.formatConverter=null}}},{key:"handleTextInjectAck",value:function(e){console.log("📝 VoiceSDK v2: Text inject ack received:",e),this.emit("textInjectAck",e)}},{key:"injectData",value:(u=zt(Nt().m(function e(t){var A,n,o,r,i,a,s,c,l,u=this,d=arguments;return Nt().w(function(e){for(;;)switch(e.n){case 0:if(A=d.length>1&&void 0!==d[1]?d[1]:{},n=null==t?void 0:t.trim()){e.n=1;break}throw o={error:"EMPTY_DATA",message:"Cannot inject empty data"},console.warn("VoiceSDK v2: Cannot inject empty data"),this.emit("dataInjectionError",o),new Error(o.message);case 1:if(this.isConnected&&this.websocket){e.n=2;break}throw r={error:"NOT_CONNECTED",message:"Voice call is not active"},console.warn("VoiceSDK v2: Cannot inject data - not connected"),this.emit("dataInjectionError",r),new Error(r.message);case 2:if(!(n.length>5e3)){e.n=3;break}throw i={error:"DATA_TOO_LONG",message:"Data exceeds maximum length of 5000 characters",maxLength:5e3,currentLength:n.length},console.warn("VoiceSDK v2: Data too long (max 5000 characters)"),this.emit("dataInjectionError",i),new Error(i.message);case 3:return a=this.generateCorrelationId(),s=A.timeout||1e4,c=A.source||"programmatic",l={t:"data_inject",data:n,correlationId:a,source:c,timestamp:Date.now()},A.metadata&&(l.metadata=A.metadata),e.a(2,new Promise(function(e,t){var A=setTimeout(function(){u.pendingInjections.delete(a);var e={error:"TIMEOUT",message:"Data injection timeout - no response from server",correlationId:a,timeout:s};console.warn("VoiceSDK v2: Data injection timeout:",a),u.emit("dataInjectionError",e),t(new Error(e.message))},s);if(u.pendingInjections.set(a,{resolve:function(t){clearTimeout(A),e(t)},reject:function(e){clearTimeout(A),t(e)},timeout:A}),u.sendMessage(l))console.log("📤 VoiceSDK v2: Sent data_inject message:",{correlationId:a,dataLength:n.length,source:c});else{u.pendingInjections.delete(a),clearTimeout(A);var o={error:"SEND_FAILED",message:"Failed to send data injection message"};console.warn("VoiceSDK v2: Failed to send data injection message"),u.emit("dataInjectionError",o),t(new Error(o.message))}}))}},e,this)})),function(e){return u.apply(this,arguments)})},{key:"handleDataInjectAck",value:function(e){var t=e.correlationId;if(t){var A=this.pendingInjections.get(t);A?(this.pendingInjections.delete(t),A.resolve(e),this.emit("dataInjected",{correlationId:t,data:e.data,metadata:e.metadata}),console.log("✅ VoiceSDK v2: Data injection acknowledged:",t)):console.warn("VoiceSDK v2: data_inject_ack received for unknown correlationId:",t)}else console.warn("VoiceSDK v2: data_inject_ack received without correlationId")}},{key:"handleDataInjectError",value:function(e){var t=e.correlationId;if(t){var A=this.pendingInjections.get(t);if(A){this.pendingInjections.delete(t);var n=new Error(e.message||"Data injection failed");n.error=e.error,n.correlationId=t,A.reject(n),this.emit("dataInjectionError",{error:e.error,message:e.message,correlationId:t}),console.warn("❌ VoiceSDK v2: Data injection error:",t,e.error)}else console.warn("VoiceSDK v2: data_inject_error received for unknown correlationId:",t)}else console.warn("VoiceSDK v2: data_inject_error received without correlationId")}},{key:"handleTranscript",value:function(e){if(e.sentenceId&&e.text){var t=e.sentenceId,A={text:e.text,role:e.role||"assistant",sentenceId:t,final:!1!==e.final,timestamp:e.timestamp||Date.now()};this.transcriptQueue.push(A),console.log("📝 VoiceSDK v2: Received transcript for sentence",t,":",A.text),console.log(" Transcript queue length:",this.transcriptQueue.length),console.log(" Current playing sentence:",this.currentPlayingSentenceId),console.log("📝 VoiceSDK v2: Displaying transcript for completed sentence",t),this.emit("transcriptDisplay",A),this.currentPlayingSentenceId=t,this.emit("transcript",A)}else console.warn("⚠️ VoiceSDK v2: Invalid transcript message:",e)}},{key:"handleBinaryMessage",value:(l=zt(Nt().m(function e(t){var A,n,o,r,i,a,s,c,l;return Nt().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!(t instanceof Blob)){e.n=2;break}return e.n=1,t.arrayBuffer();case 1:A=e.v,e.n=3;break;case 2:A=t;case 3:if(n=A,!this.formatConverter||!this.formatConverter.needsConversion()){e.n=7;break}return e.p=4,e.n=5,this.formatConverter.convert(A);case 5:n=e.v,console.log("✅ VoiceSDK v2: Audio converted to requested format"),e.n=7;break;case 6:e.p=6,l=e.v,console.error("❌ VoiceSDK v2: Format conversion failed:",l),console.warn(" Using backend format without conversion"),n=A;case 7:o=this.formatConverter&&this.formatConverter.needsConversion()?this.requestedOutputFormat:this.outputAudioFormat||{container:this.config.outputContainer||"raw",encoding:this.config.outputEncoding||"pcm",sampleRate:this.config.outputSampleRate||16e3,bitDepth:this.config.outputBitDepth||16,channels:this.config.outputChannels||1},r=o.container||"raw",i=(o.encoding||"pcm").toLowerCase(),"raw"===r?(a=n,"pcm"!==i&&((s=this.audioPlayer.getCodec(i))?(c=s.decode(new Uint8Array(n)),a=c.buffer,console.log("🔄 VoiceSDK v2: Decoded ".concat(i.toUpperCase()," to PCM (").concat(c.byteLength," bytes)"))):console.warn("⚠️ VoiceSDK v2: No codec for ".concat(i,", treating as PCM"))),this.audioPlayer.outputFormat||(console.warn("⚠️ VoiceSDK v2: outputFormat not set on AudioPlayer, setting from playbackFormat"),this.audioPlayer.setOutputFormat(o)),this.audioFrameCount++,this.audioPlayer.playChunk(a)):(this.audioFrameCount++,this.audioPlayer.playAudio(n));case 8:return e.a(2)}},e,this,[[4,6]])})),function(e){return l.apply(this,arguments)})},{key:"sendMessage",value:function(e){if(!this.websocket||this.websocket.readyState!==WebSocket.OPEN)return console.warn("VoiceSDK v2: Cannot send message - not connected"),!1;try{var t=(new Date).toISOString(),A=this.websocket?this.websocket.readyState:"NO_WEBSOCKET",n=this.websocket?{0:"CONNECTING",1:"OPEN",2:"CLOSING",3:"CLOSED"}[A]:"NO_WEBSOCKET";if("client_tool_result"!==e.t&&"client_tool_error"!==e.t||(console.log("📤 VoiceSDK v2: [".concat(t,"] Sending tool ").concat(e.t)),console.log(" 🔌 WebSocket state: ".concat(n," (").concat(A,")")),console.log(" 📋 toolCallId: ".concat(e.toolCallId)),console.log(" 📋 conversationId: ".concat(e.conversationId||"null")),console.log(" 📋 toolName: ".concat(e.toolName)),"client_tool_result"===e.t?console.log(" 📋 result:",e.result):console.log(" 📋 error: ".concat(e.error,", errorCode: ").concat(e.errorCode)),console.log(" 📋 Full message:",JSON.stringify(e,null,2))),!this.websocket||this.websocket.readyState!==WebSocket.OPEN)return console.error("❌ VoiceSDK v2: Cannot send message - WebSocket not open (state: ".concat(n,")")),!1;var o=JSON.stringify(e);return this.websocket.send(o),"client_tool_result"!==e.t&&"client_tool_error"!==e.t||console.log("✅ VoiceSDK v2: [".concat(t,"] Tool ").concat(e.t," message sent successfully (").concat(o.length," bytes)")),!0}catch(e){return console.error("VoiceSDK v2: Error sending message:",e),this.emit("error",e),!1}}},{key:"sendBinary",value:function(e){if(!this.websocket||this.websocket.readyState!==WebSocket.OPEN)return console.warn("VoiceSDK v2: Cannot send audio - not connected"),!1;try{return this.websocket.send(e),!0}catch(e){return console.error("VoiceSDK v2: Error sending audio:",e),this.emit("error",e),!1}}},{key:"hangup",value:function(){var e=this;if(this.websocket&&this.websocket.readyState===WebSocket.OPEN){console.log("📞 VoiceSDK v2: Hanging up call..."),this.clearStoredConversationId(),this.stopRecording(),this._releaseWakeLock(),this.audioPlayer&&this.stopAudioPlayback();try{this.sendMessage({t:"hangup"}),setTimeout(function(){e.websocket&&e.websocket.readyState===WebSocket.OPEN&&(e.websocket.close(1e3,"User hangup"),e.websocket=null),e.isConnected=!1},100)}catch(e){console.error("VoiceSDK v2: Error sending hangup message:",e),this.websocket&&(this.websocket.close(1e3,"User hangup"),this.websocket=null),this.isConnected=!1}}}},{key:"startRecording",value:(c=zt(Nt().m(function e(){var t,A,n,o;return Nt().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this.isConnected){e.n=1;break}throw t=new Error("Not connected to voice server"),this.emit("error",t),t;case 1:if(!this.isRecording){e.n=2;break}return console.warn("VoiceSDK v2: Already recording"),e.a(2,!0);case 2:return console.log("🎤 VoiceSDK v2: Starting recording..."),e.p=3,console.log("🎤 VoiceSDK v2: Requesting microphone permission (mobile-friendly)..."),e.n=4,this.audioRecorder.start();case 4:if(this.isConnected&&this.websocket&&this.websocket.readyState===WebSocket.OPEN){e.n=9;break}return e.p=5,e.n=6,this.audioRecorder.stop();case 6:e.n=8;break;case 7:e.p=7,e.v;case 8:throw(A=new Error("Connection lost - server may have rejected the call")).name="ServerRejected",A.isServerRejection=!0,A;case 9:return e.n=10,this.audioPlayer.resumeAudioContext();case 10:return this.sendMessage({t:"start_continuous_mode",ttpId:this.generateTtpId()}),this._requestWakeLock(),e.a(2,!0);case 11:if(e.p=11,o=e.v,!this.audioRecorder||!this.audioRecorder.isRecording){e.n=15;break}return e.p=12,e.n=13,this.audioRecorder.stop();case 13:e.n=15;break;case 14:e.p=14,e.v;case 15:if(!o.isServerRejection&&"ServerRejected"!==o.name){e.n=16;break}return e.a(2,!1);case 16:return console.error("❌ VoiceSDK v2: Failed to start recording:",o),"NotAllowedError"===o.name||"PermissionDeniedError"===o.name?((n=new Error("Microphone permission denied. Please allow microphone access in your browser settings and try again.")).name=o.name,n.originalError=o,this.emit("error",n)):this.emit("error",o),e.a(2,!1)}},e,this,[[12,14],[5,7],[3,11]])})),function(){return c.apply(this,arguments)})},{key:"stopRecording",value:(s=zt(Nt().m(function e(){var t;return Nt().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this.isRecording){e.n=1;break}return console.warn("VoiceSDK v2: Not recording"),e.a(2,!0);case 1:return console.log("🛑 VoiceSDK v2: Stopping recording..."),e.p=2,this.sendMessage({t:"stop_continuous_mode",ttpId:this.generateTtpId()}),this.isRecording=!1,this.emit("recordingStopped"),console.log("🛑 VoiceSDK v2: Recording stopped (emitted before audioRecorder.stop())"),this._releaseWakeLock(),e.n=3,this.audioRecorder.stop();case 3:return this.stopAudioPlayback(),e.a(2,!0);case 4:return e.p=4,t=e.v,console.error("VoiceSDK v2: Error stopping recording:",t),this.emit("error",t),e.a(2,!1)}},e,this,[[2,4]])})),function(){return s.apply(this,arguments)})},{key:"toggleRecording",value:(a=zt(Nt().m(function e(){return Nt().w(function(e){for(;;)switch(e.n){case 0:if(!this.isRecording){e.n=2;break}return e.n=1,this.stopRecording();case 1:case 3:return e.a(2,e.v);case 2:return e.n=3,this.startRecording();case 4:return e.a(2)}},e,this)})),function(){return a.apply(this,arguments)})},{key:"clearTranscriptState",value:function(){this.currentPlayingSentenceId=null,console.log("📝 VoiceSDK v2: Cleared transcript state")}},{key:"_requestWakeLock",value:(i=zt(Nt().m(function e(){var t,A=this;return Nt().w(function(e){for(;;)switch(e.p=e.n){case 0:if("wakeLock"in navigator){e.n=1;break}return console.log("📱 VoiceSDK v2: Wake Lock API not available in this browser"),e.a(2);case 1:if(null===this.wakeLock&&!this._wakeLockRequesting){e.n=2;break}return console.log("📱 VoiceSDK v2: Wake lock already active or being requested"),e.a(2);case 2:return e.p=2,this._wakeLockRequesting=!0,e.n=3,navigator.wakeLock.request("screen");case 3:this.wakeLock=e.v,console.log("📱 VoiceSDK v2: Screen wake lock activated - screen will stay on during call"),this.wakeLock.addEventListener("release",function(){console.log("📱 VoiceSDK v2: Wake lock released by system"),A.wakeLock=null}),e.n=5;break;case 4:e.p=4,t=e.v,console.warn("📱 VoiceSDK v2: Failed to request wake lock:",t.message),this.wakeLock=null;case 5:return e.p=5,this._wakeLockRequesting=!1,e.f(5);case 6:return e.a(2)}},e,this,[[2,4,5,6]])})),function(){return i.apply(this,arguments)})},{key:"_releaseWakeLock",value:(r=zt(Nt().m(function e(){var t;return Nt().w(function(e){for(;;)switch(e.p=e.n){case 0:if(null!==this.wakeLock){e.n=1;break}return e.a(2);case 1:return e.p=1,e.n=2,this.wakeLock.release();case 2:this.wakeLock=null,console.log("📱 VoiceSDK v2: Screen wake lock released"),e.n=4;break;case 3:e.p=3,t=e.v,console.warn("📱 VoiceSDK v2: Error releasing wake lock:",t.message),this.wakeLock=null;case 4:return e.a(2)}},e,this,[[1,3]])})),function(){return r.apply(this,arguments)})},{key:"stopAudioPlayback",value:function(){this.audioPlayer.stopImmediate(),this.clearTranscriptState()}},{key:"handleBargeIn",value:(o=zt(Nt().m(function e(){return Nt().w(function(e){for(;;)switch(e.n){case 0:if(this.stopAudioPlayback(),this.isRecording){e.n=1;break}return e.n=1,this.startRecording();case 1:return e.a(2)}},e,this)})),function(){return o.apply(this,arguments)})},{key:"getStatus",value:function(){return{version:this.version,isConnected:this.isConnected,isRecording:this.isRecording,isPlaying:this.isPlaying,outputFormat:this.outputAudioFormat,conversationId:this.conversationId,audioPlayer:this.audioPlayer.getStatus(),audioRecorder:this.audioRecorder.getStatus()}}},{key:"updateConfig",value:function(e){this.config=Yt(Yt({},this.config),e)}},{key:"generateTtpId",value:function(){return"sdk_"+Math.random().toString(36).substr(2,9)+"_"+Date.now()}},{key:"generateCorrelationId",value:function(){if("undefined"!=typeof crypto&&crypto.randomUUID)return crypto.randomUUID();this.injectionCounter++;var e=Date.now(),t=Math.random().toString(36).substr(2,9);return"inj_".concat(e,"_").concat(this.injectionCounter,"_").concat(t)}},{key:"registerToolHandler",value:function(e,t){return this.clientToolsRegistry.registerHandler(e,t)}},{key:"unregisterToolHandler",value:function(e){return this.clientToolsRegistry.unregisterHandler(e)}},{key:"hasToolHandler",value:function(e){return this.clientToolsRegistry.hasHandler(e)}},{key:"getRegisteredTools",value:function(){return this.clientToolsRegistry.getRegisteredTools()}},{key:"destroy",value:function(){var e=this;if(!this.isDestroyed){if(console.log("🗑️ VoiceSDK v2: Destroying..."),this.isDestroyed=!0,this.isRecording&&this.stopRecording(),this._releaseWakeLock(),this._wakeLockRequesting=!1,this.audioPlayer&&this.stopAudioPlayback(),this.websocket&&(this.websocket.close(),this.websocket=null),this.isConnected=!1,this.pendingInjections.size>0){console.warn("VoiceSDK v2: Rejecting ".concat(this.pendingInjections.size," pending data injections due to destroy"));var t=new Error("SDK destroyed - data injection cancelled");t.error="SDK_DESTROYED",this.pendingInjections.forEach(function(e,A){clearTimeout(e.timeout),e.reject(t)}),this.pendingInjections.clear()}this.audioPlayer&&this.audioPlayer.destroy(),this.audioRecorder&&this.audioRecorder.destroy(),this.clientToolsRegistry&&this.clientToolsRegistry.getRegisteredTools().forEach(function(t){return e.clientToolsRegistry.unregisterHandler(t)}),this.removeAllListeners()}}}],n&&qt(A.prototype,n),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,n,o,r,i,a,s,c,l,u,d,p}(a);tA(nA,"RESUME_STORAGE_KEY","voice_resume_state"),tA(nA,"RESUME_TTL_MS",1e4),tA(nA,"SUPPORTED_INPUT_ENCODINGS",["pcm","pcmu","pcma"]),tA(nA,"SUPPORTED_INPUT_SAMPLE_RATES",[8e3,16e3,22050,24e3,44100,48e3]),tA(nA,"SUPPORTED_INPUT_BIT_DEPTHS",[8,16,24]),tA(nA,"SUPPORTED_INPUT_CHANNELS",[1]),tA(nA,"SUPPORTED_OUTPUT_ENCODINGS",["pcm","pcmu","pcma"]),tA(nA,"SUPPORTED_OUTPUT_SAMPLE_RATES",[8e3,16e3,22050,24e3,44100,48e3]),tA(nA,"SUPPORTED_OUTPUT_BIT_DEPTHS",[8,16,24]),tA(nA,"SUPPORTED_OUTPUT_CHANNELS",[1]),tA(nA,"SUPPORTED_OUTPUT_CONTAINERS",["raw","wav"]);const oA=nA;function rA(e){return rA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rA(e)}function iA(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return aA(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(aA(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,aA(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,aA(u,"constructor",c),aA(c,"constructor",s),s.displayName="GeneratorFunction",aA(c,o,"GeneratorFunction"),aA(u),aA(u,o,"Generator"),aA(u,n,function(){return this}),aA(u,"toString",function(){return"[object Generator]"}),(iA=function(){return{w:r,m:d}})()}function aA(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}aA=function(e,t,A,n){function r(t,A){aA(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},aA(e,t,A,n)}function sA(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function cA(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),A.push.apply(A,n)}return A}function lA(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?cA(Object(A),!0).forEach(function(t){uA(e,t,A[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):cA(Object(A)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}return e}function uA(e,t,A){return(t=pA(t))in e?Object.defineProperty(e,t,{value:A,enumerable:!0,configurable:!0,writable:!0}):e[t]=A,e}function dA(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,pA(n.key),n)}}function pA(e){var t=function(e){if("object"!=rA(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=rA(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==rA(t)?t:t+""}function hA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(hA=function(){return!!e})()}function gA(e){return gA=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},gA(e)}function fA(e,t){return fA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},fA(e,t)}var mA=function(e){function t(){var e,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=(e=function(e,t,A){return t=gA(t),function(e,t){if(t&&("object"==rA(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,hA()?Reflect.construct(t,A||[],gA(e).constructor):t.apply(e,A))}(this,t)).readScriptTagConfig();return e.config=lA({baseWsUrl:"wss://backend.talktopc.com/chat/websocket",appId:A.appId||n.appId,agentId:A.agentId||n.agentId,conversationId:void 0!==A.conversationId?A.conversationId:e.getPersistedConversationId(),forceConversationId:A.forceConversationId,queue:[],inFlight:!1},A),e.fullResponseBuffer="",e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fA(e,t)}(t,e),A=t,n=[{key:"readScriptTagConfig",value:function(){try{var e=Array.from(document.getElementsByTagName("script")).reverse().find(function(e){return e.dataset&&(e.dataset.appId||e.dataset.agentId)||e.src&&e.src.includes("agent-widget")});return e?{appId:e.dataset.appId,agentId:e.dataset.agentId}:{}}catch(e){return{}}}},{key:"buildWebSocketUrl",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.baseWsUrl,t=new URLSearchParams;return this.config.appId&&t.append("appId",this.config.appId),this.config.agentId&&t.append("agentId",this.config.agentId),this.config.conversationId&&t.append("conversationId",this.config.conversationId),"".concat(e,"?").concat(t.toString())}},{key:"sendMessage",value:(o=iA().m(function e(t){var A=this;return iA().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,n){if(t&&t.trim())if(A.config.appId&&A.config.agentId){var o={text:t,resolve:e,reject:n};A.config.inFlight?A.config.queue.push(o):A.executeTask(o)}else n(new Error("Missing appId or agentId"));else n(new Error("Message is empty"))}))},e)}),r=function(){var e=this,t=arguments;return new Promise(function(A,n){var r=o.apply(e,t);function i(e){sA(r,A,n,i,a,"next",e)}function a(e){sA(r,A,n,i,a,"throw",e)}i(void 0)})},function(e){return r.apply(this,arguments)})},{key:"executeTask",value:function(e){var t=this;if(this.config.inFlight=!0,this.fullResponseBuffer="",!this.config.conversationId){var A=this.getPersistedConversationId();A&&(this.config.conversationId=A,console.log("🔍 TextChatSDK hydrated conversationId from storage:",A))}var n,o=this.buildWebSocketUrl(this.config.baseWsUrl),r=this.config.baseWsUrl.endsWith("/websocket")?this.config.baseWsUrl.replace(/\/websocket$/,""):"".concat(this.config.baseWsUrl,"/websocket"),i=this.buildWebSocketUrl(r),a=!1,s=!1,c=null,l=function(A){if(!s)try{var n={message:e.text},o=t.config.forceConversationId||t.config.conversationId;o&&(n.conversationId=o,t.config.forceConversationId&&!t.config.conversationId&&(t.config.conversationId=o,t.persistConversationId(o))),console.log("🔍 TextChatSDK sending payload:",n,"conversationId in config:",t.config.conversationId),A.send(JSON.stringify(n)),s=!0}catch(n){e.reject(n),t.emit("error",n);try{A.close()}catch(e){}}},u=function(e){return function(){t.config.conversationId?l(e):c=setTimeout(function(){return l(e)},200)}},d=function(A){return function(n){try{try{console.log("🔎 [TextChatSDK] WS <= raw:",n.data)}catch(e){}var o=JSON.parse(n.data);try{console.log("🔎 [TextChatSDK] WS <= parsed:",o)}catch(e){}if("hello"===o.type&&o.conversationId){if(console.log("🔍 TextChatSDK received conversationId:",o.conversationId),t.config.conversationId=o.conversationId,t.persistConversationId(o.conversationId),t.emit&&t.emit("conversationIdChanged",o.conversationId),!s&&A&&1===A.readyState){if(c)try{clearTimeout(c)}catch(e){}l(A)}return}if(!t.config.conversationId&&o.conversationId&&(console.log("🔍 TextChatSDK captured conversationId from message:",o.conversationId),t.config.conversationId=o.conversationId,t.persistConversationId(o.conversationId)),"chunk"===o.type&&"string"==typeof o.content)t.fullResponseBuffer+=o.content,t.emit("chunk",o.content);else if("done"===o.type){try{var r=o.text||o.content||o.answer||o.message||"";r&&!t.fullResponseBuffer&&(t.fullResponseBuffer=r)}catch(e){}!t.config.conversationId&&o.conversationId&&(console.log("🔍 TextChatSDK captured conversationId from done:",o.conversationId),t.config.conversationId=o.conversationId),t.persistConversationId(t.config.conversationId),t.emit("done",{text:t.fullResponseBuffer}),e.resolve({conversationId:t.config.conversationId,fullText:t.fullResponseBuffer});try{A.close()}catch(e){}}else if("error"===o.type){var i=new Error(o.message||"Server error");t.emit("error",i),e.reject(i);try{A.close()}catch(e){}}}catch(e){}}},p=function(A){if(1008===A.code&&A.reason&&(A.reason.includes("Domain not whitelisted")||A.reason.includes("domain")||A.reason.includes("whitelist"))){var n=new Error("DOMAIN_NOT_WHITELISTED");return n.reason=A.reason,n.code=A.code,t.emit("domainError",n),e.reject(n),t.config.inFlight=!1,void t.drainQueue()}t.config.inFlight=!1,t.drainQueue()},h=new WebSocket(o);h.onopen=u(h),h.onmessage=d(h),h.onerror=(n=h,function(A){if(!a){a=!0;try{n.close()}catch(e){}var o=new WebSocket(i);return o.onopen=u(o),o.onmessage=d(o),o.onerror=function(A){t.emit("error",A),e.reject(A)},void(o.onclose=p)}t.emit("error",A),e.reject(A)}),h.onclose=p}},{key:"drainQueue",value:function(){if(0!==this.config.queue.length&&!this.config.inFlight){var e=this.config.queue.shift();this.executeTask(e)}}},{key:"persistConversationId",value:function(e){try{e&&localStorage.setItem("ttp_text_chat_conversation_id",e)}catch(e){}}},{key:"getPersistedConversationId",value:function(){try{return localStorage.getItem("ttp_text_chat_conversation_id")||null}catch(e){return null}}},{key:"updateConfig",value:function(e){this.config=lA(lA({},this.config),e)}},{key:"destroy",value:function(){this.config.queue=[],this.config.inFlight=!1,this.removeAllListeners()}}],n&&dA(A.prototype,n),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,n,o,r}(O);function vA(e){return vA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vA(e)}function BA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var A=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=A){var n,o,r,i,a=[],s=!0,c=!1;try{if(r=(A=A.call(e)).next,0===t){if(Object(A)!==A)return;s=!1}else for(;!(s=(n=r.call(A)).done)&&(a.push(n.value),a.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=A.return&&(i=A.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}(e,t)||yA(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wA(e,t){var A="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!A){if(Array.isArray(e)||(A=yA(e))||t&&e&&"number"==typeof e.length){A&&(e=A);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){A=A.call(e)},n:function(){var e=A.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==A.return||A.return()}finally{if(a)throw r}}}}function yA(e,t){if(e){if("string"==typeof e)return bA(e,t);var A={}.toString.call(e).slice(8,-1);return"Object"===A&&e.constructor&&(A=e.constructor.name),"Map"===A||"Set"===A?Array.from(e):"Arguments"===A||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A)?bA(e,t):void 0}}function bA(e,t){(null==t||t>e.length)&&(t=e.length);for(var A=0,n=Array(t);A<t;A++)n[A]=e[A];return n}function CA(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return xA(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(xA(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,xA(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,xA(u,"constructor",c),xA(c,"constructor",s),s.displayName="GeneratorFunction",xA(c,o,"GeneratorFunction"),xA(u),xA(u,o,"Generator"),xA(u,n,function(){return this}),xA(u,"toString",function(){return"[object Generator]"}),(CA=function(){return{w:r,m:d}})()}function xA(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}xA=function(e,t,A,n){function r(t,A){xA(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},xA(e,t,A,n)}function QA(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function FA(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,UA(n.key),n)}}function UA(e){var t=function(e){if("object"!=vA(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=vA(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==vA(t)?t:t+""}function SA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(SA=function(){return!!e})()}function kA(e){return kA=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},kA(e)}function EA(e,t){return EA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},EA(e,t)}const IA=new(function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,A){return t=kA(t),function(e,t){if(t&&("object"==vA(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,SA()?Reflect.construct(t,A||[],kA(e).constructor):t.apply(e,A))}(this,t)).connections=new Map,e.connectionCounts=new Map,e.creatingConnections=new Set,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&EA(e,t)}(t,e),A=t,n=[{key:"getConnection",value:(o=CA().m(function e(t){var A,n,o=this;return CA().w(function(e){for(;;)switch(e.n){case 0:if(!this.connections.has(t)){e.n=1;break}return A=this.connections.get(t),this.connectionCounts.set(t,(this.connectionCounts.get(t)||0)+1),e.a(2,A);case 1:if(!this.creatingConnections||!this.creatingConnections.has(t)){e.n=2;break}return e.a(2,new Promise(function(e){var A=function(){if(o.connections.has(t)){var n=o.connections.get(t);o.connectionCounts.set(t,(o.connectionCounts.get(t)||0)+1),e(n)}else setTimeout(A,50)};A()}));case 2:return this.creatingConnections.add(t),n=new WebSocket(t),this.connections.set(t,n),this.connectionCounts.set(t,1),n.addEventListener("open",function(e){o.creatingConnections.delete(t),o.emit("open",e,t)}),n.addEventListener("close",function(e){o.creatingConnections.delete(t),o.connections.delete(t),o.connectionCounts.delete(t),o.emit("close",e,t)}),n.addEventListener("error",function(e){o.creatingConnections.delete(t),o.emit("error",e,t)}),n.addEventListener("message",function(e){o.emit("message",e,t)}),e.a(2,n)}},e,this)}),r=function(){var e=this,t=arguments;return new Promise(function(A,n){var r=o.apply(e,t);function i(e){QA(r,A,n,i,a,"next",e)}function a(e){QA(r,A,n,i,a,"throw",e)}i(void 0)})},function(e){return r.apply(this,arguments)})},{key:"releaseConnection",value:function(e){if(this.connections.has(e)){var t=this.connectionCounts.get(e)||0,A=Math.max(0,t-1);if(this.connectionCounts.set(e,A),0===A){var n=this.connections.get(e);n&&n.readyState===WebSocket.OPEN&&n.close(1e3,"No more subscribers"),this.connections.delete(e),this.connectionCounts.delete(e)}}}},{key:"forceClose",value:function(e){if(this.connections.has(e)){var t=this.connections.get(e);t&&t.readyState===WebSocket.OPEN&&t.close(1e3,"Force close"),this.connections.delete(e),this.connectionCounts.delete(e)}}},{key:"getConnectionStatus",value:function(e){return this.connections.has(e)?{exists:!0,readyState:this.connections.get(e).readyState,subscribers:this.connectionCounts.get(e)||0}:{exists:!1,readyState:null,subscribers:0}}},{key:"getAllConnections",value:function(){var e,t={},A=wA(this.connections.entries());try{for(A.s();!(e=A.n()).done;){var n=BA(e.value,2),o=n[0],r=n[1];t[o]={readyState:r.readyState,subscribers:this.connectionCounts.get(o)||0}}}catch(e){A.e(e)}finally{A.f()}return t}},{key:"clearAll",value:function(){var e,t=wA(this.connections.entries());try{for(t.s();!(e=t.n()).done;){var A=BA(e.value,2),n=(A[0],A[1]);n&&n.readyState===WebSocket.OPEN&&n.close(1e3,"Clear all")}}catch(e){t.e(e)}finally{t.f()}this.connections.clear(),this.connectionCounts.clear(),this.creatingConnections.clear()}}],n&&FA(A.prototype,n),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,n,o,r}(O));function TA(e){return TA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},TA(e)}function HA(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return DA(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(DA(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,DA(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,DA(u,"constructor",c),DA(c,"constructor",s),s.displayName="GeneratorFunction",DA(c,o,"GeneratorFunction"),DA(u),DA(u,o,"Generator"),DA(u,n,function(){return this}),DA(u,"toString",function(){return"[object Generator]"}),(HA=function(){return{w:r,m:d}})()}function DA(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}DA=function(e,t,A,n){function r(t,A){DA(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},DA(e,t,A,n)}function PA(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function OA(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,KA(n.key),n)}}function KA(e){var t=function(e){if("object"!=TA(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=TA(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==TA(t)?t:t+""}function MA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(MA=function(){return!!e})()}function LA(e){return LA=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},LA(e)}function RA(e,t){return RA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},RA(e,t)}var _A=function(e){function t(e){var A;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(A=function(e,t,A){return t=LA(t),function(e,t){if(t&&("object"==TA(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,MA()?Reflect.construct(t,A||[],LA(e).constructor):t.apply(e,A))}(this,t)).config=e,A.ws=null,A.isConnected=!1,A.connectionId=null,A}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&RA(e,t)}(t,e),A=t,n=[{key:"connect",value:(r=HA().m(function e(){var t=this;return HA().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,A){try{t.connectionId=Date.now()+"_"+Math.random().toString(36).substr(2,9),t.connectResolve=e,t.connectReject=A;var n=t.config.signedUrl||t.config.websocketUrl;IA.getConnection(n,t.config).then(function(A){t.ws=A,t.setupEventListeners(),A.readyState===WebSocket.OPEN&&(t.isConnected=!0,t.emit("connected"),e(),t.connectResolve=null,t.connectReject=null)}).catch(function(e){console.error("🔌 WebSocketManager: Connection failed ".concat(t.connectionId),e),A(e),t.connectResolve=null,t.connectReject=null})}catch(e){console.error("🔌 WebSocketManager: Connection error ".concat(t.connectionId),e),A(e),t.connectResolve=null,t.connectReject=null}}))},e)}),i=function(){var e=this,t=arguments;return new Promise(function(A,n){var o=r.apply(e,t);function i(e){PA(o,A,n,i,a,"next",e)}function a(e){PA(o,A,n,i,a,"throw",e)}i(void 0)})},function(){return i.apply(this,arguments)})},{key:"setupEventListeners",value:function(){var e=this;if(this.ws){var t=function(t,A){A===(e.config.signedUrl||e.config.websocketUrl)&&(e.isConnected=!0,e.emit("connected"),e.connectResolve&&(e.connectResolve(),e.connectResolve=null,e.connectReject=null))},A=function(t,A){A===(e.config.signedUrl||e.config.websocketUrl)&&(e.isConnected=!1,e.emit("disconnected",t))},n=function(t,A){A===(e.config.signedUrl||e.config.websocketUrl)&&(e.emit("error",t),e.connectReject&&(e.connectReject(t),e.connectResolve=null,e.connectReject=null))},o=function(t,A){A===(e.config.signedUrl||e.config.websocketUrl)&&e.handleMessage(t)};IA.on("open",t),IA.on("close",A),IA.on("error",n),IA.on("message",o),this.eventHandlers={open:t,close:A,error:n,message:o}}}},{key:"disconnect",value:function(){this.eventHandlers&&(IA.off("open",this.eventHandlers.open),IA.off("close",this.eventHandlers.close),IA.off("error",this.eventHandlers.error),IA.off("message",this.eventHandlers.message));var e=this.config.signedUrl||this.config.websocketUrl;e&&IA.releaseConnection(e),this.ws=null,this.isConnected=!1}},{key:"sendMessage",value:function(e){if(this.isConnected&&this.ws)try{this.ws.send(JSON.stringify(e))}catch(e){console.warn("🔌 WebSocketManager: Failed to send message:",e.message)}}},{key:"sendBinary",value:function(e){if(this.isConnected&&this.ws)try{this.ws.send(e)}catch(e){console.warn("🔌 WebSocketManager: Failed to send binary data:",e.message)}}},{key:"handleMessage",value:function(e){var t=this;if(e.data instanceof ArrayBuffer)this.emit("binaryAudio",e.data);else if(e.data instanceof Blob)e.data.arrayBuffer().then(function(e){t.emit("binaryAudio",e)}).catch(function(e){console.error("🔌 WebSocketManager: Error converting Blob to ArrayBuffer:",e)});else try{var A=JSON.parse(e.data);"barge_in_ack"!==A.t&&"stop_sending"!==A.t||this.emit("bargeIn",A),"stop_playing"===A.t&&this.emit("stopPlaying",A),this.emit("message",A)}catch(e){this.emit("error",e)}}},{key:"getStatus",value:function(){return{isConnected:this.isConnected,readyState:this.ws?this.ws.readyState:null,connectionId:this.connectionId}}}],o=[{key:"getSingletonStatus",value:function(){return IA.getAllConnections()}},{key:"clearAllConnections",value:function(){IA.clearAll()}}],n&&OA(A.prototype,n),o&&OA(A,o),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,n,o,r,i}(O);function VA(e){return VA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},VA(e)}function jA(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return NA(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(NA(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,NA(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,NA(u,"constructor",c),NA(c,"constructor",s),s.displayName="GeneratorFunction",NA(c,o,"GeneratorFunction"),NA(u),NA(u,o,"Generator"),NA(u,n,function(){return this}),NA(u,"toString",function(){return"[object Generator]"}),(jA=function(){return{w:r,m:d}})()}function NA(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}NA=function(e,t,A,n){function r(t,A){NA(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},NA(e,t,A,n)}function GA(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function WA(e){return function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){GA(r,n,o,i,a,"next",e)}function a(e){GA(r,n,o,i,a,"throw",e)}i(void 0)})}}function zA(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,XA(n.key),n)}}function XA(e){var t=function(e){if("object"!=VA(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=VA(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==VA(t)?t:t+""}function JA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(JA=function(){return!!e})()}function YA(e){return YA=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},YA(e)}function qA(e,t){return qA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},qA(e,t)}var ZA=function(e){function t(e){var A;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(A=function(e,t,A){return t=YA(t),function(e,t){if(t&&("object"==VA(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,JA()?Reflect.construct(t,A||[],YA(e).constructor):t.apply(e,A))}(this,t)).config=e,A.audioContext=null,A.audioQueue=[],A.isPlaying=!1,A.isProcessingQueue=!1,A.currentSource=null,A.audioContextReady=!1,A.initializeAudioContext().catch(function(){}),A}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qA(e,t)}(t,e),A=t,n=[{key:"initializeAudioContext",value:(i=WA(jA().m(function e(){var t,A,n,o,r,i;return jA().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!this.audioContext||"closed"===this.audioContext.state){e.n=1;break}return e.a(2);case 1:if(e.p=1,t=this.config.sampleRate||this.config.outputSampleRate||44100,A={sampleRate:t},this.audioContext=new(window.AudioContext||window.webkitAudioContext)(A),"suspended"!==this.audioContext.state){e.n=2;break}return e.n=2,this.audioContext.resume();case 2:if("running"===this.audioContext.state)try{n=this.audioContext.sampleRate,o=this.audioContext.createBuffer(1,.01*n,n),(r=this.audioContext.createBufferSource()).buffer=o,r.connect(this.audioContext.destination),r.start(0),r.stop(this.audioContext.currentTime+.01)}catch(e){console.debug("AudioPlayer: AudioContext warmup skipped:",e)}this.audioContextReady=!0,e.n=4;break;case 3:e.p=3,i=e.v,console.warn("AudioPlayer: Failed to pre-initialize AudioContext:",i),this.audioContextReady=!1;case 4:return e.a(2)}},e,this,[[1,3]])})),function(){return i.apply(this,arguments)})},{key:"playAudio",value:function(e){var t=this;try{var A=this.createAudioBlob(e);if(this.audioQueue.push(A),!this.isPlaying&&!this.isProcessingQueue&&!this.currentSource){var n=this.audioContextReady?0:50;setTimeout(function(){return t.processQueue()},n)}}catch(e){this.emit("playbackError",e)}}},{key:"createAudioBlob",value:function(e){var t=new Uint8Array(e);if(t.length>=4){if(82===t[0]&&73===t[1]&&70===t[2]&&70===t[3])return new Blob([e],{type:"audio/wav"});if(255===t[0]&&!(224&~t[1]))return new Blob([e],{type:"audio/mpeg"});if(79===t[0]&&103===t[1]&&103===t[2]&&83===t[3])return new Blob([e],{type:"audio/ogg"})}return new Blob([e],{type:"audio/wav"})}},{key:"processQueue",value:(r=WA(jA().m(function e(){var t,A,n,o,r,i,a,s,c=this;return jA().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!this.isProcessingQueue&&0!==this.audioQueue.length){e.n=1;break}return e.a(2);case 1:if(this.isProcessingQueue=!0,t=this.audioQueue.shift()){e.n=2;break}return this.isProcessingQueue=!1,e.a(2);case 2:if(e.p=2,A=!this.isPlaying&&null===this.currentSource,this.audioContext&&"closed"!==this.audioContext.state){e.n=3;break}return e.n=3,this.initializeAudioContext();case 3:if("suspended"!==(n=this.audioContext).state){e.n=5;break}return e.n=4,n.resume();case 4:if(!A){e.n=5;break}return e.n=5,new Promise(function(e){return setTimeout(e,10)});case 5:if("running"===n.state){e.n=7;break}if(console.warn("AudioPlayer: AudioContext not in running state:",n.state),"suspended"!==n.state){e.n=7;break}return e.n=6,n.resume();case 6:return e.n=7,new Promise(function(e){return setTimeout(e,10)});case 7:return e.n=8,t.arrayBuffer();case 8:return o=e.v,e.n=9,n.decodeAudioData(o);case 9:r=e.v,i=A&&!this.isPlaying&&null===this.currentSource,(a=n.createBufferSource()).buffer=r,a.connect(n.destination),this.currentSource=a,this.isPlaying=!0,i&&this.emit("playbackStarted"),a.onended=function(){c.currentSource=null,c.isProcessingQueue=!1,c.audioQueue.length>0?setTimeout(function(){return c.processQueue()},0):setTimeout(function(){0!==c.audioQueue.length||c.currentSource||(c.isPlaying=!1,c.emit("playbackStopped"))},100)},a.start(),e.n=11;break;case 10:e.p=10,s=e.v,this.currentSource=null,this.emit("playbackError",s),this.audioQueue.length>0?(this.isProcessingQueue=!1,setTimeout(function(){return c.processQueue()},100)):(this.isPlaying=!1,this.isProcessingQueue=!1,this.emit("playbackStopped"));case 11:return e.a(2)}},e,this,[[2,10]])})),function(){return r.apply(this,arguments)})},{key:"stop",value:function(){this.stopImmediate()}},{key:"stopImmediate",value:function(){var e=this.isPlaying||null!==this.currentSource;if(this.currentSource){try{this.currentSource.stop()}catch(e){}this.currentSource=null}this.isPlaying=!1,this.isProcessingQueue=!1,this.audioQueue=[],e&&this.emit("playbackStopped")}},{key:"resumeAudioContext",value:(o=WA(jA().m(function e(){var t;return jA().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this.audioContext&&"closed"!==this.audioContext.state){e.n=2;break}return e.n=1,this.initializeAudioContext();case 1:return e.a(2);case 2:if("suspended"!==this.audioContext.state){e.n=6;break}return e.p=3,e.n=4,this.audioContext.resume();case 4:console.log("✅ AudioPlayer: AudioContext resumed after mic permission"),e.n=6;break;case 5:e.p=5,t=e.v,console.warn("⚠️ AudioPlayer: Failed to resume AudioContext:",t);case 6:return e.a(2)}},e,this,[[3,5]])})),function(){return o.apply(this,arguments)})},{key:"getStatus",value:function(){return{isPlaying:this.isPlaying,isProcessingQueue:this.isProcessingQueue,queueLength:this.audioQueue.length,audioContextState:this.audioContext?this.audioContext.state:"closed"}}},{key:"destroy",value:function(){this.stop(),this.audioContext&&"closed"!==this.audioContext.state&&(this.audioContext.close(),this.audioContext=null),this.audioContextReady=!1}}],n&&zA(A.prototype,n),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,n,o,r,i}(O);function $A(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return en(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(en(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,en(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,en(u,"constructor",c),en(c,"constructor",s),s.displayName="GeneratorFunction",en(c,o,"GeneratorFunction"),en(u),en(u,o,"Generator"),en(u,n,function(){return this}),en(u,"toString",function(){return"[object Generator]"}),($A=function(){return{w:r,m:d}})()}function en(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}en=function(e,t,A,n){function r(t,A){en(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},en(e,t,A,n)}function tn(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function An(){var e=navigator.userAgent,t=/iPad|iPhone|iPod/.test(e)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,A=/Android/.test(e),n=/Mac/.test(e)&&!t,o=/Win/.test(e),r=/Chrome/.test(e)&&!/Edg|OPR/.test(e),i=/Safari/.test(e)&&!/Chrome/.test(e),a=/Firefox/.test(e),s=/Edg/.test(e),c=/SamsungBrowser/.test(e),l="unknown";t?l="safari":c?l="samsung":r?l="chrome":i?l="safari":a?l="firefox":s&&(l="edge");var u="unknown";return t?u="ios":A?u="android":n?u="mac":o&&(u="windows"),{platform:u,browser:l,isIOS:t,isAndroid:A,isMac:n,isWindows:o,isMobile:t||A,isDesktop:!t&&!A}}function nn(){return on.apply(this,arguments)}function on(){var e;return e=$A().m(function e(){var t;return $A().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!navigator.permissions||!navigator.permissions.query){e.n=2;break}return e.n=1,navigator.permissions.query({name:"microphone"});case 1:return t=e.v,e.a(2,t.state);case 2:e.n=4;break;case 3:e.p=3,e.v,console.log("⚠️ MicPermissionUtils: Permissions API not available or not supported for microphone");case 4:return e.a(2,"unknown")}},e,null,[[0,3]])}),on=function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){tn(r,n,o,i,a,"next",e)}function a(e){tn(r,n,o,i,a,"throw",e)}i(void 0)})},on.apply(this,arguments)}function rn(e){var t=e.platform,A=e.browser,n={ios:{title:"Enable Microphone on iPhone/iPad",icon:"📱",steps:["Tap the <strong>lock icon 🔒</strong>, <strong>information icon ℹ️</strong>, or <strong>AA icon</strong> in the address bar","Tap <strong>Website Settings</strong> or <strong>Permissions</strong>","Find <strong>Microphone</strong> and set it to <strong>Allow</strong>","Return to this page and refresh"],altTitle:"Alternative Method",altSteps:["Open the <strong>Settings</strong> app on your device","Scroll down and tap <strong>Safari</strong> (or your browser app)",'Tap <strong>Microphone</strong> under "Settings for Websites"',"Set it to <strong>Allow</strong> or <strong>Ask</strong>","Return to this page and refresh"],note:"On iOS, you can also change permissions in the browser address bar or in device Settings.",canOpenSettings:!0,settingsButtonText:"Open Settings App"},android_chrome:{title:"Enable Microphone in Chrome",icon:"🤖",steps:["Tap the <strong>lock icon 🔒</strong>, <strong>information icon ℹ️</strong>, or <strong>settings icon ⋮</strong> in the address bar","Tap <strong>Permissions</strong>","Tap <strong>Microphone</strong>","Select <strong>Allow</strong>","The page will refresh automatically"],altTitle:"Alternative Method",altSteps:["Tap the <strong>⋮ menu</strong> (three dots)","Tap <strong>Settings → Site settings → Microphone</strong>","Find this website and set to <strong>Allow</strong>"],canOpenSettings:!0,settingsButtonText:"Open App Settings"},android_firefox:{title:"Enable Microphone in Firefox",icon:"🦊",steps:["Tap the <strong>lock icon 🔒</strong> or <strong>information icon ℹ️</strong> in the address bar","Tap <strong>Edit Site Permissions</strong>","Toggle <strong>Microphone</strong> to enabled","Refresh the page"],canOpenSettings:!1},android_samsung:{title:"Enable Microphone in Samsung Browser",icon:"📱",steps:["Tap the <strong>menu icon</strong> (three lines)","Tap <strong>Settings → Sites and downloads</strong>","Tap <strong>Site permissions → Microphone</strong>","Find this website and set to <strong>Allow</strong>","Return and refresh the page"],canOpenSettings:!1},desktop_chrome:{title:"Enable Microphone in Chrome",icon:"🌐",steps:["Click the <strong>lock icon 🔒</strong> or <strong>information icon ℹ️</strong> in the address bar (left side)","Find <strong>Microphone</strong> in the dropdown menu",'Change it from "Block" to <strong>Allow</strong>',"Click the <strong>Refresh</strong> button or press F5"],showAddressBarHint:!0,canOpenSettings:!1},desktop_safari:{title:"Enable Microphone in Safari",icon:"🧭",steps:["Click <strong>Safari</strong> in the menu bar (top of screen)","Click <strong>Settings for This Website...</strong>","Find <strong>Microphone</strong> in the popup","Change it to <strong>Allow</strong>","Close settings and refresh the page"],canOpenSettings:!1},desktop_firefox:{title:"Enable Microphone in Firefox",icon:"🦊",steps:["Click the <strong>lock icon 🔒</strong> in the address bar",'Click the <strong>X</strong> next to "Blocked" for Microphone',"Refresh the page (press F5)","Click <strong>Allow</strong> when prompted again"],note:"Firefox requires you to clear the block and then re-allow on the next prompt.",showAddressBarHint:!0,canOpenSettings:!1},desktop_edge:{title:"Enable Microphone in Edge",icon:"🌐",steps:["Click the <strong>lock icon 🔒</strong> in the address bar","Find <strong>Microphone</strong> in the permissions list","Change it to <strong>Allow</strong>","Refresh the page"],showAddressBarHint:!0,canOpenSettings:!1},unknown:{title:"Enable Microphone Access",icon:"🎤",steps:["Look for a <strong>lock icon 🔒</strong>, <strong>information icon ℹ️</strong>, or <strong>settings icon</strong> in your browser's address bar","Find the <strong>Microphone</strong> permission setting","Change it to <strong>Allow</strong>","Refresh this page"],canOpenSettings:!1}};return"ios"===t?n.ios:"android"===t?n["android_".concat(A)]||n.android_chrome:n["desktop_".concat(A)]||n.desktop_chrome}function an(e){var t=e.isIOS,A=e.isAndroid,n=e.browser;if(t)try{return window.location.href="app-settings:",!0}catch(e){return console.warn("Could not open iOS settings:",e),!1}if(A&&"chrome"===n)try{return window.location.href="intent:#Intent;action=android.settings.APPLICATION_DETAILS_SETTINGS;data=package:com.android.chrome;end",!0}catch(e){return console.warn("Could not open Android settings:",e),!1}return!1}function sn(e){return sn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sn(e)}function cn(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ln(n.key),n)}}function ln(e){var t=function(e){if("object"!=sn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=sn(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==sn(t)?t:t+""}function un(e,t){var A="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!A){if(Array.isArray(e)||(A=function(e,t){if(e){if("string"==typeof e)return dn(e,t);var A={}.toString.call(e).slice(8,-1);return"Object"===A&&e.constructor&&(A=e.constructor.name),"Map"===A||"Set"===A?Array.from(e):"Arguments"===A||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A)?dn(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){A&&(e=A);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){A=A.call(e)},n:function(){var e=A.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==A.return||A.return()}finally{if(a)throw r}}}}function dn(e,t){(null==t||t>e.length)&&(t=e.length);for(var A=0,n=Array(t);A<t;A++)n[A]=e[A];return n}var pn=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.overlay=null,this.modal=null},(t=[{key:"createOverlay",value:function(){var e=document.createElement("div");return e.className="mic-permission-overlay",e.style.cssText="\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.6);\n backdrop-filter: blur(4px);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n padding: 20px;\n animation: mic-fadeIn 0.2s ease-out;\n ",document.getElementById("mic-permission-styles")||this.injectStyles(),e}},{key:"injectStyles",value:function(){if(!document.getElementById("mic-permission-styles")){var e=document.createElement("style");e.id="mic-permission-styles",e.textContent="\n @keyframes mic-fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n \n @keyframes mic-slideUp {\n from {\n opacity: 0;\n transform: translateY(20px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n \n @keyframes mic-bounce {\n 0%, 100% { transform: translateY(0); }\n 50% { transform: translateY(-5px); }\n }\n \n .mic-permission-overlay {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.6);\n backdrop-filter: blur(4px);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n padding: 20px;\n animation: mic-fadeIn 0.2s ease-out;\n }\n \n .mic-permission-modal {\n background: #ffffff;\n border-radius: 16px;\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\n max-width: 480px;\n width: 100%;\n padding: 32px;\n position: relative;\n animation: mic-slideUp 0.3s ease-out;\n max-height: 90vh;\n overflow-y: auto;\n }\n \n .mic-permission-modal__close {\n position: absolute;\n top: 16px;\n right: 16px;\n background: none;\n border: none;\n font-size: 20px;\n cursor: pointer;\n color: #6b7280;\n width: 32px;\n height: 32px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: background 0.2s;\n }\n \n .mic-permission-modal__close:hover {\n background: #e5e7eb;\n }\n \n .mic-permission-modal__icon {\n font-size: 48px;\n text-align: center;\n margin-bottom: 16px;\n }\n \n .mic-permission-modal__title {\n font-size: 24px;\n font-weight: 700;\n color: #111827;\n margin: 0 0 12px;\n line-height: 1.3;\n text-align: center;\n }\n \n .mic-permission-modal__description {\n color: #6b7280;\n font-size: 16px;\n line-height: 1.6;\n margin: 0 0 20px;\n text-align: center;\n }\n \n .mic-permission-modal__highlight {\n display: flex;\n align-items: center;\n gap: 12px;\n background: linear-gradient(135deg, #dbeafe, #ede9fe);\n padding: 16px 20px;\n border-radius: 8px;\n margin-bottom: 20px;\n border: 1px solid #bfdbfe;\n }\n \n .mic-permission-modal__highlight-icon {\n font-size: 24px;\n animation: mic-bounce 1s infinite;\n }\n \n .mic-permission-modal__status {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background: #fef2f2;\n color: #ef4444;\n padding: 12px 16px;\n border-radius: 8px;\n margin-bottom: 20px;\n font-weight: 500;\n }\n \n .mic-permission-modal__note {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n background: #fffbeb;\n color: #92400e;\n padding: 12px 16px;\n border-radius: 8px;\n margin-bottom: 20px;\n font-size: 14px;\n line-height: 1.5;\n border: 1px solid #fde68a;\n }\n \n .mic-permission-modal__steps {\n margin-bottom: 20px;\n }\n \n .mic-permission-modal__steps h3 {\n font-size: 14px;\n font-weight: 600;\n color: #6b7280;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n margin: 0 0 12px;\n }\n \n .mic-permission-modal__steps ol {\n margin: 0;\n padding-left: 24px;\n counter-reset: step-counter;\n list-style: none;\n }\n \n .mic-permission-modal__steps li {\n position: relative;\n padding: 12px 0 12px 16px;\n border-left: 2px solid #e5e7eb;\n color: #111827;\n font-size: 15px;\n line-height: 1.5;\n counter-increment: step-counter;\n }\n \n .mic-permission-modal__steps li::before {\n content: counter(step-counter);\n position: absolute;\n left: -14px;\n top: 10px;\n width: 24px;\n height: 24px;\n background: #4f46e5;\n color: white;\n border-radius: 50%;\n font-size: 12px;\n font-weight: 600;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n \n .mic-permission-modal__steps li:last-child {\n border-left-color: transparent;\n }\n \n .mic-permission-modal__actions {\n display: flex;\n flex-direction: column;\n gap: 10px;\n margin-top: 24px;\n }\n \n .mic-permission-modal__btn {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n padding: 14px 24px;\n border-radius: 8px;\n font-size: 16px;\n font-weight: 600;\n cursor: pointer;\n transition: all 0.2s;\n border: none;\n width: 100%;\n }\n \n .mic-permission-modal__btn--primary {\n background: #4f46e5;\n color: white;\n }\n \n .mic-permission-modal__btn--primary:hover {\n background: #4338ca;\n transform: translateY(-1px);\n }\n \n .mic-permission-modal__btn--secondary {\n background: #e5e7eb;\n color: #111827;\n }\n \n .mic-permission-modal__btn--secondary:hover {\n background: #d1d5db;\n }\n \n .mic-permission-modal__footer {\n text-align: center;\n font-size: 13px;\n color: #6b7280;\n margin-top: 20px;\n margin-bottom: 0;\n }\n \n .mic-permission-modal__visual-guide {\n width: 100%;\n max-width: 380px;\n height: auto;\n margin: 20px auto;\n border-radius: 8px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);\n display: block;\n }\n \n .mic-permission-modal__visual-guide-container {\n text-align: center;\n margin: 20px 0;\n }\n \n @media (max-width: 480px) {\n .mic-permission-modal {\n padding: 24px 20px;\n margin: 10px;\n max-height: 85vh;\n }\n \n .mic-permission-modal__title {\n font-size: 20px;\n }\n \n .mic-permission-modal__icon {\n font-size: 40px;\n }\n \n .mic-permission-modal__visual-guide {\n max-width: 100%;\n }\n }\n ",document.head.appendChild(e)}}},{key:"close",value:function(){this.overlay&&this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),this.overlay=null,this.modal=null}},{key:"show",value:function(){this.overlay&&this.modal&&document.body.appendChild(this.overlay)}}])&&cn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function hn(e,t){var A=new pn,n=A.createOverlay(),o=An(),r=document.createElement("div");return r.className="mic-permission-modal",r.innerHTML='\n <div class="mic-permission-modal__icon">🎤</div>\n <h2 class="mic-permission-modal__title">Enable Your Microphone</h2>\n <p class="mic-permission-modal__description">\n To start a voice call with our agent, we need access to your microphone.\n </p>\n <div class="mic-permission-modal__highlight">\n <span class="mic-permission-modal__highlight-icon">👆</span>\n <span>Please click <strong>"Allow"</strong> on the next popup</span>\n </div>\n '.concat(o.isIOS?'\n <div class="mic-permission-modal__note">\n <span>ℹ️</span>\n <span>On iPhone/iPad, you may need to allow microphone access in your device Settings.</span>\n </div>\n ':"",'\n <div class="mic-permission-modal__actions">\n <button class="mic-permission-modal__btn mic-permission-modal__btn--primary" data-action="accept">\n Continue\n </button>\n <button class="mic-permission-modal__btn mic-permission-modal__btn--secondary" data-action="cancel">\n Not Now\n </button>\n </div>\n '),n.appendChild(r),A.overlay=n,A.modal=r,r.querySelector('[data-action="accept"]').addEventListener("click",function(){A.close(),e()}),r.querySelector('[data-action="cancel"]').addEventListener("click",function(){A.close(),t()}),n.addEventListener("click",function(e){e.target===n&&(A.close(),t())}),A.show(),A}function gn(e,t){var A,n,o,r=new pn,i=r.createOverlay(),a=An(),s=rn(a),c=document.createElement("div");c.className="mic-permission-modal";var l="";s.altSteps&&s.altSteps.length>0&&(l='\n <div style="margin-top: 20px; border-top: 1px solid #e5e7eb; padding-top: 16px;">\n <button class="mic-permission-modal__alt-toggle" style="background: none; border: none; color: #4f46e5; font-size: 14px; font-weight: 500; cursor: pointer; padding: 0; margin-bottom: 12px;">\n ▼ '.concat(s.altTitle||"Alternative method",'\n </button>\n <ol style="margin: 0; padding-left: 20px; display: none;">\n ').concat(s.altSteps.map(function(e){return'<li style="padding: 8px 0; font-size: 14px; color: #6b7280;">'.concat(e,"</li>")}).join(""),"\n </ol>\n </div>\n "));var u=function(e){var t,A=e.platform,n=e.browser,o=document.getElementsByTagName("script"),r="",i=un(o);try{for(i.s();!(t=i.n()).done;){var a=t.value.src;if(a&&(a.includes("agent-widget.js")||a.includes("ttp-agent-sdk")||a.includes("ttp-sdk-front")))try{new URL(a),r=a.substring(0,a.lastIndexOf("/"));break}catch(e){var s=a.match(/^(.*\/)[^\/]+$/);if(s){r=s[1];break}}}}catch(e){i.e(e)}finally{i.f()}var c;if(c="ios"===A?"ios-settings.svg":"android"===A?"android-chrome.svg":"chrome"===n?"desktop-chrome.svg":"safari"===n?"desktop-safari.svg":"firefox"===n?"desktop-firefox.svg":"edge"===n?"desktop-edge.svg":"desktop-chrome.svg",!r||""===r||r.startsWith("/")){var l,u=un(o);try{for(u.s();!(l=u.n()).done;){var d=l.value.src;if(d&&(d.includes("cdn.talktopc.com")||d.includes("talktopc.com"))){if(d.includes("/ttp-agent-sdk/")||d.includes("/ttp-sdk-front/")){var p=d.match(/(https?:\/\/[^\/]+(?:\/[^\/]+)*)/);if(p){r=p[1].replace(/\/[^\/]+\.js$/,"");break}}if(!r&&(d.includes("cdn.talktopc.com")||d.includes("talktopc.com"))){r="https://cdn.talktopc.com/ttp-agent-sdk";break}}}}catch(e){u.e(e)}finally{u.f()}if(!r||""===r)if(window.location.hostname.includes("cdn.talktopc.com")||window.location.hostname.includes("talktopc.com"))r="https://cdn.talktopc.com/ttp-agent-sdk";else{var h=window.location.pathname.split("/");h.pop(),(r=window.location.origin+h.join("/"))&&r!==window.location.origin||(r=window.location.origin)}}r=r.replace(/\/$/,"");var g="".concat(r,"/shared/mic-permission-assets/").concat(c);return"undefined"!=typeof console&&console.log&&console.log("[MicPermission] Visual guide path:",g,"Base path:",r,"Platform:",A,"Browser:",n),g}(a);c.innerHTML='\n <button class="mic-permission-modal__close" data-action="close">✕</button>\n <div style="display: flex; align-items: center; gap: 12px; margin-bottom: 20px;">\n <span style="font-size: 32px;">'.concat(s.icon,'</span>\n <h2 class="mic-permission-modal__title" style="text-align: left; margin: 0;">').concat(s.title,'</h2>\n </div>\n <div class="mic-permission-modal__status">\n <span>🚫</span>\n <span>Microphone access is currently blocked</span>\n </div>\n ').concat(s.note?'\n <div class="mic-permission-modal__note">\n <span>ℹ️</span>\n <span>'.concat(s.note,"</span>\n </div>\n "):"",'\n <div class="mic-permission-modal__visual-guide-container">\n <img src="').concat(u,'" alt="Visual guide for enabling microphone" class="mic-permission-modal__visual-guide" \n onerror="console.error(\'[MicPermission] Failed to load image:\', this.src); this.style.display=\'none\';" \n onload="console.log(\'[MicPermission] Image loaded successfully:\', this.src);" />\n </div>\n <div class="mic-permission-modal__steps">\n <h3>Follow these steps:</h3>\n <ol>\n ').concat(s.steps.map(function(e){return"<li>".concat(e,"</li>")}).join(""),"\n </ol>\n </div>\n ").concat(l,'\n <div class="mic-permission-modal__actions">\n ').concat(s.canOpenSettings?'\n <button class="mic-permission-modal__btn mic-permission-modal__btn--primary" data-action="open-settings">\n '.concat(s.settingsButtonText||"Open Settings","\n </button>\n "):"","\n ").concat(s.showAddressBarHint?'\n <button class="mic-permission-modal__btn mic-permission-modal__btn--primary" data-action="show-hint">\n Show Me Where\n </button>\n ':"",'\n <button class="mic-permission-modal__btn mic-permission-modal__btn--secondary" data-action="refresh">\n 🔄 Refresh Page\n </button>\n </div>\n <p class="mic-permission-modal__footer">\n After enabling microphone access, return here and click "Refresh Page"\n </p>\n '),i.appendChild(c),r.overlay=i,r.modal=c,null===(A=c.querySelector('[data-action="close"]'))||void 0===A||A.addEventListener("click",function(){r.close(),e()}),null===(n=c.querySelector('[data-action="open-settings"]'))||void 0===n||n.addEventListener("click",function(){an(a)}),null===(o=c.querySelector('[data-action="refresh"]'))||void 0===o||o.addEventListener("click",function(){window.location.reload()});var d=c.querySelector('[data-action="show-hint"]');d&&d.addEventListener("click",function(){r.close(),e(),function(){var e=document.getElementById("mic-address-bar-hint");e&&e.remove(),An();var t,A=document.getElementsByTagName("script"),n="",o=un(A);try{for(o.s();!(t=o.n()).done;){var r=t.value.src;if(r&&(r.includes("agent-widget.js")||r.includes("ttp-agent-sdk")||r.includes("ttp-sdk-front")))try{new URL(r),n=r.substring(0,r.lastIndexOf("/"));break}catch(e){var i=r.match(/^(.*\/)[^\/]+$/);if(i){n=i[1];break}}}}catch(e){o.e(e)}finally{o.f()}if(!n||""===n||n.startsWith("/")){var a,s=un(A);try{for(s.s();!(a=s.n()).done;){var c=a.value.src;if(c&&(c.includes("cdn.talktopc.com")||c.includes("talktopc.com"))){if(c.includes("/ttp-agent-sdk/")||c.includes("/ttp-sdk-front/")){var l=c.match(/(https?:\/\/[^\/]+(?:\/[^\/]+)*)/);if(l){n=l[1].replace(/\/[^\/]+\.js$/,"");break}}if(!n&&(c.includes("cdn.talktopc.com")||c.includes("talktopc.com"))){n="https://cdn.talktopc.com/ttp-agent-sdk";break}}}}catch(e){s.e(e)}finally{s.f()}if(!n||""===n)if(window.location.hostname.includes("cdn.talktopc.com")||window.location.hostname.includes("talktopc.com"))n="https://cdn.talktopc.com/ttp-agent-sdk";else{var u=window.location.pathname.split("/");u.pop(),(n=window.location.origin+u.join("/"))&&n!==window.location.origin||(n=window.location.origin)}}n=n.replace(/\/$/,"");var d="".concat(n,"/shared/mic-permission-assets/address-bar-hint.svg"),p=document.createElement("div");p.id="mic-address-bar-hint",p.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n z-index: 10001;\n padding: 10px 20px;\n pointer-events: none;\n animation: mic-fadeIn 0.3s ease-out;\n display: flex;\n justify-content: center;\n ";var h=document.createElement("div");h.style.cssText="\n display: flex;\n align-items: center;\n gap: 12px;\n background: #f59e0b;\n color: white;\n padding: 12px 20px;\n border-radius: 0 0 8px 8px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n pointer-events: all;\n animation: mic-slideDown 0.3s ease-out;\n max-width: 540px;\n ";var g=document.createElement("div");g.style.cssText="\n flex-shrink: 0;\n ";var f=document.createElement("img");f.src=d,f.alt="Address bar hint",f.style.cssText="\n width: auto;\n height: 80px;\n display: block;\n ",f.onerror=function(){g.style.display="none"},g.appendChild(f);var m=document.createElement("div");m.style.cssText="\n display: flex;\n flex-direction: column;\n gap: 4px;\n flex: 1;\n ";var v=document.createElement("div");v.style.cssText="\n font-size: 15px;\n font-weight: 500;\n ",v.innerHTML="Click the <strong>lock icon 🔒</strong>, <strong>information icon ℹ️</strong>, or <strong>settings icon ⋮</strong> in the address bar to enable microphone";var B=document.createElement("button");if(B.style.cssText="\n background: rgba(255, 255, 255, 0.2);\n border: none;\n color: white;\n width: 28px;\n height: 28px;\n border-radius: 50%;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n transition: background 0.2s;\n flex-shrink: 0;\n ",B.textContent="✕",B.addEventListener("click",function(){p.remove()}),B.addEventListener("mouseenter",function(){B.style.background="rgba(255, 255, 255, 0.3)"}),B.addEventListener("mouseleave",function(){B.style.background="rgba(255, 255, 255, 0.2)"}),!document.getElementById("mic-address-bar-hint-styles")){var w=document.createElement("style");w.id="mic-address-bar-hint-styles",w.textContent="\n @keyframes mic-slideDown {\n from {\n opacity: 0;\n transform: translateY(-100%);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n \n @keyframes mic-pointUp {\n 0%, 100% {\n transform: translate(0, 0);\n }\n 50% {\n transform: translate(-5px, -5px);\n }\n }\n ",document.head.appendChild(w)}m.appendChild(v),h.appendChild(g),h.appendChild(m),h.appendChild(B),p.appendChild(h),document.body.appendChild(p),setTimeout(function(){p.parentNode&&(p.style.opacity="0",p.style.transition="opacity 0.3s ease-out",setTimeout(function(){p.parentNode&&p.remove()},300))},1e4)}()});var p=c.querySelector(".mic-permission-modal__alt-toggle");if(p&&s.altSteps){var h=p.nextElementSibling;h&&(h.style.display="none",p.addEventListener("click",function(){"none"===h.style.display?(h.style.display="block",p.innerHTML="▼ ".concat(s.altTitle||"Alternative method")):(h.style.display="none",p.innerHTML="▶ ".concat(s.altTitle||"Alternative method"))}))}return i.addEventListener("click",function(t){t.target===i&&(r.close(),e())}),r.show(),r}function fn(e){var t=new pn,A=t.createOverlay(),n=document.createElement("div");return n.className="mic-permission-modal",n.innerHTML='\n <div class="mic-permission-modal__icon">🎤❌</div>\n <h2 class="mic-permission-modal__title">No Microphone Found</h2>\n <p class="mic-permission-modal__description">\n We couldn\'t detect a microphone on your device. Please make sure:\n </p>\n <ul style="list-style: none; padding: 0; margin: 0 0 24px;">\n <li style="padding: 10px 0 10px 32px; position: relative; color: #111827; border-bottom: 1px solid #e5e7eb;">\n <span style="position: absolute; left: 0; font-size: 18px;">☐</span>\n Your microphone is properly connected\n </li>\n <li style="padding: 10px 0 10px 32px; position: relative; color: #111827; border-bottom: 1px solid #e5e7eb;">\n <span style="position: absolute; left: 0; font-size: 18px;">☐</span>\n Your microphone is not muted at the hardware level\n </li>\n <li style="padding: 10px 0 10px 32px; position: relative; color: #111827;">\n <span style="position: absolute; left: 0; font-size: 18px;">☐</span>\n No other app is exclusively using the microphone\n </li>\n </ul>\n <div class="mic-permission-modal__actions">\n <button class="mic-permission-modal__btn mic-permission-modal__btn--primary" data-action="retry">\n Retry\n </button>\n <button class="mic-permission-modal__btn mic-permission-modal__btn--secondary" data-action="close">\n Close\n </button>\n </div>\n ',A.appendChild(n),t.overlay=A,t.modal=n,n.querySelector('[data-action="retry"]').addEventListener("click",function(){window.location.reload()}),n.querySelector('[data-action="close"]').addEventListener("click",function(){t.close(),e()}),A.addEventListener("click",function(n){n.target===A&&(t.close(),e())}),t.show(),t}function mn(e){return mn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mn(e)}function vn(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Bn(n.key),n)}}function Bn(e){var t=function(e){if("object"!=mn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=mn(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==mn(t)?t:t+""}var wn=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=t,this.config=t.config},(t=[{key:"t",value:function(e){return this.voiceInterface.t(e)}},{key:"getText",value:function(e,t){return this.voiceInterface.getText(e,t)}},{key:"getTooltip",value:function(e){return this.voiceInterface.getTooltip(e)}},{key:"generateHTML",value:function(){return this.voiceInterface.isMobile?this.generateMobileHTML():'<div class="voice-interface" id="voiceInterface">\n \x3c!-- Before Call State --\x3e\n <div id="voiceIdleState">\n <div class="voice-avatar" id="voiceAvatar">🤖</div>\n <div class="voice-status">\n <div class="voice-status-title">'.concat(this.getText("startCallTitle","clickToStartCall"),'</div>\n <div class="voice-status-subtitle">').concat(this.getText("startCallSubtitle","realTimeVoice"),'</div>\n </div>\n <button class="start-call-btn" id="startCallBtn">\n <svg width="32" height="32" viewBox="0 0 24 24" fill="currentColor">\n <path d="M20.01 15.38c-1.23 0-2.42-.2-3.53-.56-.35-.12-.74-.03-1.01.24l-1.57 1.97c-2.83-1.35-5.48-3.9-6.89-6.83l1.95-1.66c.27-.28.35-.67.24-1.02-.37-1.11-.56-2.3-.56-3.53 0-.54-.45-.99-.99-.99H4.19C3.65 3 3 3.24 3 3.99 3 13.28 10.73 21 20.01 21c.71 0 .99-.63.99-1.18v-3.45c0-.54-.45-.99-.99-.99z"/>\n </svg>\n <span>').concat(this.getText("startCallButtonText","startCall"),'</span>\n </button>\n </div>\n \x3c!-- During Call State - Desktop View --\x3e\n <div id="voiceActiveState" style="display: none;">\n \x3c!-- Original Multi-Row Voice Section (shown when history is collapsed) --\x3e\n <div class="desktop-voice-section" id="desktopVoiceSection">\n \x3c!-- Timer --\x3e\n <div class="desktop-timer">\n <div class="timer-dot"></div>\n <span id="desktopTimerText">00:00</span>\n </div>\n\n \x3c!-- Main Waveform --\x3e\n <div class="desktop-main-waveform" id="desktopMainWaveform">\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n </div>\n\n \x3c!-- Status --\x3e\n <div class="desktop-status" id="desktopStatus">\n <div class="status-dot"></div>\n <span id="desktopStatusText">').concat(this.t("listening")||"Listening...",'</span>\n </div>\n\n \x3c!-- Controls --\x3e\n <div class="desktop-controls">\n <button class="desktop-control-btn secondary" id="desktopMuteBtn" title="').concat(this.getTooltip("mute"),'">\n <svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" class="desktop-mic-icon">\n <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2"/>\n <line x1="12" y1="19" x2="12" y2="23"/>\n </svg>\n <svg fill="none" viewBox="0 0 24 24" class="desktop-mic-off-icon" style="display: none; position: absolute;">\n \x3c!-- Original mic icon (same as normal state) --\x3e\n <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" stroke="currentColor" stroke-width="2" fill="none"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2" stroke="currentColor" stroke-width="2" fill="none"/>\n <line x1="12" y1="19" x2="12" y2="23" stroke="currentColor" stroke-width="2"/>\n \x3c!-- Red circle surrounding the icon --\x3e\n <circle cx="12" cy="12" r="11.8" fill="none" stroke="#ef4444" stroke-width="2"/>\n \x3c!-- Red diagonal strike line --\x3e\n <line x1="4" y1="4" x2="20" y2="20" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round"/>\n </svg>\n </button>\n <button class="desktop-control-btn danger" id="desktopEndCallBtn" title="').concat(this.getTooltip("endCall"),'">\n <svg fill="none" stroke="currentColor" stroke-width="1.8" viewBox="0 0 24 24" style="overflow: visible;">\n <path d="M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.5 19.5 0 01-6-6 19.79 19.79 0 01-3.07-8.67A2 2 0 014.11 2h3a2 2 0 012 1.72c.127.96.361 1.903.7 2.81a2 2 0 01-.45 2.11L8.09 9.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0122 16.92z" transform="rotate(135 12 12)"/>\n </svg>\n </button>\n <button class="desktop-control-btn secondary" id="desktopSpeakerBtn" title="').concat(this.getTooltip("speaker"),'">\n <svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" class="desktop-speaker-icon">\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/>\n <path d="M19.07 4.93a10 10 0 010 14.14M15.54 8.46a5 5 0 010 7.07"/>\n </svg>\n <svg fill="none" viewBox="0 0 24 24" class="desktop-speaker-off-icon" style="display: none; position: absolute;">\n \x3c!-- Original speaker icon (same as normal state) --\x3e\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5" stroke="currentColor" stroke-width="2" fill="none"/>\n <path d="M19.07 4.93a10 10 0 010 14.14" stroke="currentColor" stroke-width="2" fill="none"/>\n <path d="M15.54 8.46a5 5 0 010 7.07" stroke="currentColor" stroke-width="2" fill="none"/>\n \x3c!-- Red circle surrounding the icon --\x3e\n <circle cx="12" cy="12" r="11.8" fill="none" stroke="#ef4444" stroke-width="2"/>\n \x3c!-- Red diagonal strike line --\x3e\n <line x1="4" y1="4" x2="20" y2="20" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round"/>\n </svg>\n </button>\n </div>\n </div>\n\n \x3c!-- Compact Voice Section - Single Row Layout (shown only when history is expanded) --\x3e\n <div class="compact-voice-section" id="compactVoiceSection" style="display: none;">\n \x3c!-- Left side: Avatar + Info --\x3e\n <div class="compact-left">\n \x3c!-- Avatar container with waveform --\x3e\n <div class="compact-avatar" id="desktopAvatarCompact">\n \x3c!-- Main Waveform - Scaled down for compact view --\x3e\n <div class="desktop-main-waveform" id="desktopMainWaveformCompact">\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n </div>\n </div>\n \n \x3c!-- Timer and Status stacked vertically --\x3e\n <div class="compact-info">\n <div class="compact-timer" id="desktopTimerCompact">\n <span class="timer-dot"></span>\n <span id="compactTimerText">00:00</span>\n </div>\n <div class="compact-status" id="desktopStatusCompact">\n <span class="status-dot"></span>\n <span id="compactStatusText">').concat(this.t("listening")||"Listening",'</span>\n </div>\n </div>\n </div>\n \n \x3c!-- Right side: Control buttons (reuse same IDs, handlers will work for both) --\x3e\n <div class="compact-controls">\n <button class="compact-control-btn secondary" id="desktopMuteBtnCompact" title="').concat(this.getTooltip("mute"),'">\n <svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" class="desktop-mic-icon">\n <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2"/>\n <line x1="12" y1="19" x2="12" y2="23"/>\n </svg>\n <svg fill="none" viewBox="0 0 24 24" class="desktop-mic-off-icon" style="display: none; position: absolute;">\n \x3c!-- Original mic icon (same as normal state) --\x3e\n <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" stroke="currentColor" stroke-width="2" fill="none"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2" stroke="currentColor" stroke-width="2" fill="none"/>\n <line x1="12" y1="19" x2="12" y2="23" stroke="currentColor" stroke-width="2"/>\n \x3c!-- Red circle surrounding the icon --\x3e\n <circle cx="12" cy="12" r="11.8" fill="none" stroke="#ef4444" stroke-width="2"/>\n \x3c!-- Red diagonal strike line --\x3e\n <line x1="4" y1="4" x2="20" y2="20" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round"/>\n </svg>\n </button>\n <button class="compact-control-btn danger" id="desktopEndCallBtnCompact" title="').concat(this.getTooltip("endCall"),'">\n <svg fill="none" stroke="currentColor" stroke-width="1.8" viewBox="0 0 24 24" style="overflow: visible;">\n <path d="M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.5 19.5 0 01-6-6 19.79 19.79 0 01-3.07-8.67A2 2 0 014.11 2h3a2 2 0 012 1.72c.127.96.361 1.903.7 2.81a2 2 0 01-.45 2.11L8.09 9.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0122 16.92z" transform="rotate(135 12 12)"/>\n </svg>\n </button>\n <button class="compact-control-btn secondary" id="desktopSpeakerBtnCompact" title="').concat(this.getTooltip("speaker"),'">\n <svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" class="desktop-speaker-icon">\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/>\n <path d="M19.07 4.93a10 10 0 010 14.14M15.54 8.46a5 5 0 010 7.07"/>\n </svg>\n <svg fill="none" viewBox="0 0 24 24" class="desktop-speaker-off-icon" style="display: none; position: absolute;">\n \x3c!-- Original speaker icon (same as normal state) --\x3e\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5" stroke="currentColor" stroke-width="2" fill="none"/>\n <path d="M19.07 4.93a10 10 0 010 14.14" stroke="currentColor" stroke-width="2" fill="none"/>\n <path d="M15.54 8.46a5 5 0 010 7.07" stroke="currentColor" stroke-width="2" fill="none"/>\n \x3c!-- Red circle surrounding the icon --\x3e\n <circle cx="12" cy="12" r="11.8" fill="none" stroke="#ef4444" stroke-width="2"/>\n \x3c!-- Red diagonal strike line --\x3e\n <line x1="4" y1="4" x2="20" y2="20" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round"/>\n </svg>\n </button>\n </div>\n </div>\n\n \x3c!-- Conversation Panel --\x3e\n <div class="desktop-conversation-panel collapsed" id="desktopConversationPanel">\n \x3c!-- Header --\x3e\n <div class="conversation-header" id="conversationHeader">\n <span class="conversation-label">').concat(this.t("conversation")||"Conversation",'</span>\n <span class="conversation-toggle">\n <span id="conversationToggleText">Show history</span>\n <svg width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">\n <path d="M6 9l6 6 6-6"/>\n </svg>\n </span>\n </div>\n\n \x3c!-- Collapsed: Live transcript only (2 lines) --\x3e\n <div class="live-transcript-collapsed" id="liveTranscriptCollapsed">\n <div class="live-indicator">\n <div class="live-dot"></div>\n <span>Live</span>\n </div>\n <div class="live-text-collapsed muted" id="liveTextCollapsed">\n ').concat(this.t("transcriptWillAppear")||"Transcript will appear here...",'<span class="typing-cursor"></span>\n </div>\n </div>\n\n \x3c!-- Expanded: Full conversation history --\x3e\n <div class="conversation-history" id="conversationHistory">\n <div class="conversation-messages" id="conversationMessages">\n \x3c!-- Messages will be rendered here --\x3e\n </div>\n \n \x3c!-- Live message at bottom --\x3e\n <div class="live-message-row" id="liveMessageRow" style="display: none;">\n <div class="message-avatar assistant">\n <div class="orb"></div>\n </div>\n <div class="message-bubble">\n <span class="live-badge">Live</span>\n <span id="liveMessageText"></span><span class="typing-cursor"></span>\n </div>\n </div>\n </div>\n\n \x3c!-- Text Input --\x3e\n <div class="voice-text-input-area">\n <div class="voice-input-wrapper">\n <input type="text" class="voice-text-input" id="voiceTextInput" placeholder="').concat(this.getText("inputPlaceholder","typeMessage")||"Type a message...",'">\n <button class="voice-send-btn" id="voiceSendBtn">\n <svg width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">\n <line x1="22" y1="2" x2="11" y2="13"/>\n <polygon points="22 2 15 22 11 13 2 9 22 2"/>\n </svg>\n </button>\n </div>\n <div class="voice-input-hint" id="voiceInputHint">\n <svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">\n <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/>\n </svg>\n ').concat(this.getText("voiceActiveHint","voiceActive")||"Voice is still active • Type or speak","\n </div>\n </div>\n </div>\n </div>\n </div>")}},{key:"generateMobileHTML",value:function(){return'<div class="voice-interface mobile-voice-interface" id="voiceInterface">\n \x3c!-- Before Call State (same as desktop) --\x3e\n <div id="voiceIdleState">\n <div class="voice-avatar" id="voiceAvatar">🤖</div>\n <div class="voice-status">\n <div class="voice-status-title">'.concat(this.getText("startCallTitle","clickToStartCall"),'</div>\n <div class="voice-status-subtitle">').concat(this.getText("startCallSubtitle","realTimeVoice"),'</div>\n </div>\n <button class="start-call-btn" id="startCallBtn">\n <svg width="32" height="32" viewBox="0 0 24 24" fill="currentColor">\n <path d="M20.01 15.38c-1.23 0-2.42-.2-3.53-.56-.35-.12-.74-.03-1.01.24l-1.57 1.97c-2.83-1.35-5.48-3.9-6.89-6.83l1.95-1.66c.27-.28.35-.67.24-1.02-.37-1.11-.56-2.3-.56-3.53 0-.54-.45-.99-.99-.99H4.19C3.65 3 3 3.24 3 3.99 3 13.28 10.73 21 20.01 21c.71 0 .99-.63.99-1.18v-3.45c0-.54-.45-.99-.99-.99z"/>\n </svg>\n <span>').concat(this.getText("startCallButtonText","startCall"),'</span>\n </button>\n </div>\n \n \x3c!-- Mobile Active Call State - Hidden placeholder (actual bar will be appended to body) --\x3e\n <div id="voiceActiveState" class="mobile-active-state" style="display: none;">\n \x3c!-- Duration Badge --\x3e\n <div class="mobile-duration-badge" id="mobileDurationBadge">\n <div class="mobile-duration-dot"></div>\n <span id="mobileDurationText">00:00</span>\n </div>\n \n \x3c!-- Main Bar --\x3e\n <div class="mobile-voice-bar">\n \x3c!-- Top Row: Status, Waveform, Controls --\x3e\n <div class="mobile-top-row">\n \x3c!-- Status Indicator --\x3e\n <div class="mobile-status-indicator">\n <div class="mobile-status-dot" id="mobileStatusDot"></div>\n <span class="mobile-status-text" id="mobileStatusText">Listening...</span>\n </div>\n \n \x3c!-- Centered Waveform --\x3e\n <div class="mobile-waveform-center" id="mobileWaveform">\n ').concat(Array(8).fill(0).map(function(e,t){return'<div class="mobile-waveform-bar" data-index="'.concat(t,'"></div>')}).join(""),'\n </div>\n \n \x3c!-- Controls --\x3e\n <div class="mobile-controls">\n <button class="mobile-control-btn" id="mobileMuteBtn" aria-label="Mute microphone">\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-mic-icon">\n <path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2"/>\n <line x1="12" x2="12" y1="19" y2="22"/>\n </svg>\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-mic-off-icon" style="display: none;">\n <line x1="2" x2="22" y1="2" y2="22"/>\n <path d="M18.89 13.23A7.12 7.12 0 0 0 19 12v-2"/>\n <path d="M5 10v2a7 7 0 0 0 12 5"/>\n <path d="M15 9.34V5a3 3 0 0 0-5.68-1.33"/>\n <path d="M9 9v3a3 3 0 0 0 5.12 2.12"/>\n <line x1="12" x2="12" y1="19" y2="22"/>\n </svg>\n </button>\n \n <button class="mobile-control-btn" id="mobileSpeakerBtn" aria-label="Toggle speaker">\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-speaker-icon">\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/>\n <path d="M15.54 8.46a5 5 0 0 1 0 7.07"/>\n </svg>\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-speaker-off-icon" style="display: none;">\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/>\n <line x1="22" x2="16" y1="9" y2="15"/>\n <line x1="16" x2="22" y1="9" y2="15"/>\n </svg>\n </button>\n \n <button class="mobile-end-call-btn" id="mobileEndCallBtn" aria-label="End call">\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"/>\n <line x1="22" x2="2" y1="2" y2="22"/>\n </svg>\n </button>\n </div>\n </div>\n \n \x3c!-- Bottom Row: Transcript (expandable) --\x3e\n <button class="mobile-transcript-row" id="mobileTranscriptRow">\n <p class="mobile-transcript-text" id="mobileTranscriptText">').concat(this.t("transcriptWillAppear"),'</p>\n <div class="mobile-transcript-footer">\n <span class="mobile-expand-hint">tap to expand & type</span>\n <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="opacity: 0.6;">\n <path d="M7 17L17 7M17 7H7M17 7V17"/>\n </svg>\n </div>\n </button>\n </div>\n </div>\n \n \x3c!-- Expanded Transcript Overlay --\x3e\n <div class="mobile-transcript-overlay" id="mobileTranscriptOverlay" style="display: none;">\n <div class="mobile-expanded-transcript" id="mobileExpandedTranscript">\n \x3c!-- Header --\x3e\n <div class="mobile-transcript-header">\n <div class="mobile-header-left">\n <div class="mobile-header-status">\n <div class="mobile-header-status-dot"></div>\n <span class="mobile-header-status-text" id="mobileHeaderStatusText">Listening...</span>\n <span class="mobile-header-duration" id="mobileHeaderDuration">00:00</span>\n </div>\n <span class="mobile-transcript-label">CONVERSATION</span>\n </div>\n <button class="mobile-close-transcript-btn" id="mobileCloseTranscriptBtn">\n <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 6L6 18M6 6l12 12"/>\n </svg>\n </button>\n </div>\n \n \x3c!-- Messages Container --\x3e\n <div class="mobile-messages-container" id="mobileMessagesContainer">\n \x3c!-- Messages will be dynamically added here --\x3e\n </div>\n \n \x3c!-- Text Input Area --\x3e\n <div class="mobile-input-area">\n <div class="mobile-input-wrapper">\n <input\n type="text"\n placeholder="Type a message..."\n id="mobileTextInput"\n class="mobile-text-input"\n />\n <button class="mobile-send-btn" id="mobileSendBtn" disabled>\n <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"/>\n </svg>\n </button>\n </div>\n <p class="mobile-input-hint">🎙️ Voice is still active • Type or speak</p>\n </div>\n </div>\n </div>\n </div>')}}])&&vn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function yn(e){return yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yn(e)}function bn(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Cn(n.key),n)}}function Cn(e){var t=function(e){if("object"!=yn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=yn(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==yn(t)?t:t+""}var xn=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=t,this.config=t.config},(t=[{key:"generateCSS",value:function(){var e,t=this.config.avatarBackgroundColor||"#667eea",A=this.config.avatarActiveBackgroundColor||this.config.avatarBackgroundColor||"#667eea",n=this.config.statusTitleColor||"#1e293b",o=this.config.statusSubtitleColor||"#64748b",r=this.config.statusDotColor||"#10b981",i=(this.config.statusText,this.config.startCallButtonColor||"#667eea"),a=this.config.startCallButtonTextColor||"#FFFFFF",s=this.config.transcriptBackgroundColor||"#FFFFFF",c=this.config.transcriptTextColor||"#1e293b",l=this.config.transcriptLabelColor||"#94a3b8",u=this.config.controlButtonColor||"#FFFFFF",d=this.config.liveTranscriptTextColor||this.config.transcriptTextColor||"#64748b",p=this.config.liveTranscriptFontSize||"14px",h=this.config.controlButtonSecondaryColor||"#64748b",g=this.config.liveIndicatorDotColor||"#10b981",f=this.config.liveIndicatorTextColor||"#10b981",m=this.config.micButtonColor||u,v=this.config.speakerButtonColor||u,B=this.config.endCallButtonColor||"#ef4444",w=this.config.sendButtonColor||(null===(e=this.config.text)||void 0===e?void 0:e.sendButtonColor)||this.config.voiceSendButtonColor||"#7C3AED",y=" !important";return"\n /* Voice Interface Styles - Ultra-compact for Wix iframes */\n .voice-interface { \n display: none".concat(y,"; \n flex: 1; \n flex-direction: column;\n align-items: stretch; \n justify-content: flex-start; \n padding: 0; \n background: linear-gradient(180deg, #f8fafc 0%, #e0e7ff 100%);\n overflow: hidden;\n min-height: 0;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n }\n .voice-interface.active { display: flex").concat(y,'; }\n \n /* Voice States - Better scaling gaps */\n #voiceIdleState {\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n min-height: 0;\n justify-content: center;\n overflow: hidden;\n flex: 1;\n box-sizing: border-box;\n gap: clamp(6px, 1.5vh, 12px);\n }\n \n #voiceActiveState {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n width: 100%;\n height: 100%;\n min-height: 0;\n justify-content: flex-start;\n overflow: hidden;\n flex: 1;\n box-sizing: border-box;\n gap: 0;\n padding: 0;\n }\n \n #voiceActiveState[style*="display: none"] {\n display: none !important;\n }\n \n /* Voice Avatar - Scales better from small to large */\n .voice-avatar,\n .voice-avatar-active {\n width: clamp(80px, 18vh, 160px);\n height: clamp(80px, 18vh, 160px);\n aspect-ratio: 1;\n border-radius: 50%;\n background: linear-gradient(135deg, ').concat(t," 0%, ").concat(A," 100%);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: clamp(40px, 9vh, 80px);\n margin: 0;\n box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);\n transition: all 0.3s ease;\n flex-shrink: 0;\n position: relative;\n }\n \n .voice-avatar-active {\n animation: avatarPulse 2s ease-in-out infinite;\n }\n \n @keyframes avatarPulse {\n 0%, 100% { \n transform: scale(1);\n }\n 50% { \n transform: scale(1.05);\n }\n }\n \n .voice-avatar-active.speaking {\n animation: avatarSpeak 0.5s ease-in-out infinite;\n }\n \n @keyframes avatarSpeak {\n 0%, 100% { transform: scale(1); }\n 50% { transform: scale(1.08); }\n }\n \n /* Voice Rings Animation */\n .voice-rings {\n position: absolute;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n }\n \n .voice-ring {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n border: 2px solid rgba(102, 126, 234, 0.3);\n border-radius: 50%;\n opacity: 0;\n animation: ringExpand 2s ease-out infinite;\n }\n \n .voice-ring:nth-child(2) { animation-delay: 0.5s; }\n .voice-ring:nth-child(3) { animation-delay: 1s; }\n \n @keyframes ringExpand {\n 0% {\n width: 100%;\n height: 100%;\n opacity: 0.6;\n }\n 100% {\n width: 160%;\n height: 160%;\n opacity: 0;\n }\n }\n \n /* Voice Status - Scales with container */\n .voice-status {\n text-align: center;\n margin: 0;\n flex-shrink: 0;\n min-height: 0;\n }\n \n .voice-status-title {\n font-size: clamp(12px, 3vh, 20px);\n font-weight: 600;\n color: ").concat(n,";\n margin-bottom: clamp(2px, 0.5vh, 4px);\n line-height: 1.2;\n }\n \n .voice-status-subtitle {\n font-size: clamp(10px, 2vh, 14px);\n color: ").concat(o,";\n line-height: 1.2;\n }\n \n /* Start Call Button - Scales with container */\n .start-call-btn {\n margin: 0;\n width: min(280px, 70vw)").concat(y,";\n height: clamp(48px, 8vh, 64px)").concat(y,";\n border-radius: clamp(24px, 4vh, 32px)").concat(y,";\n border: none").concat(y,";\n background: ").concat(i).concat(y,";\n color: ").concat(a).concat(y,";\n font-size: clamp(14px, 2.5vh, 18px)").concat(y,";\n font-weight: 600").concat(y,";\n cursor: pointer").concat(y,";\n display: flex").concat(y,";\n align-items: center").concat(y,";\n justify-content: center").concat(y,";\n gap: clamp(8px, 1.5vh, 12px);\n box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);\n transition: all 0.3s ease;\n flex-shrink: 0;\n }\n \n .start-call-btn svg {\n display: block").concat(y,";\n visibility: visible").concat(y,";\n opacity: 1").concat(y,";\n width: auto").concat(y,";\n height: auto").concat(y,";\n }\n \n .start-call-btn svg {\n width: clamp(22px, 4vh, 32px);\n height: clamp(22px, 4vh, 32px);\n }\n \n .start-call-btn:hover {\n transform: translateY(-2px);\n box-shadow: 0 12px 28px rgba(102, 126, 234, 0.5);\n }\n \n .start-call-btn:active {\n transform: translateY(-1px);\n }\n .start-call-btn:disabled {\n cursor: not-allowed").concat(y,";\n opacity: 0.6").concat(y,";\n }\n \n /* Connecting Spinner */\n .connecting-spinner {\n display: inline-block;\n width: 16px;\n height: 16px;\n border: 2px solid rgba(255, 255, 255, 0.3);\n border-top-color: ").concat(a,";\n border-radius: 50%;\n animation: spin 1s linear infinite;\n margin-right: 8px;\n vertical-align: middle;\n }\n \n @keyframes spin {\n to { transform: rotate(360deg); }\n }\n\n \n /* Voice Transcript - Scales with container */\n .voice-transcript {\n background: ").concat(s,";\n padding: clamp(6px, 1.5vh, 12px);\n border-radius: 10px;\n width: min(360px, calc(100% - 40px));\n margin: 0;\n min-height: clamp(80px, 15vh, 120px);\n max-height: clamp(100px, 18vh, 140px);\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);\n flex-shrink: 1;\n overflow-y: auto;\n overflow-x: hidden;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n }\n \n .transcript-label {\n font-size: clamp(8px, 1.4vh, 11px);\n color: ").concat(l,";\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.3px;\n margin-bottom: clamp(3px, 0.6vh, 6px);\n flex-shrink: 0;\n word-wrap: break-word;\n }\n \n .transcript-text {\n font-size: clamp(11px, 2vh, 15px);\n color: ").concat(c,";\n line-height: 1.4;\n flex: 1;\n overflow-y: auto;\n overflow-x: hidden;\n word-wrap: break-word;\n overflow-wrap: break-word;\n }\n \n .transcript-text.empty {\n color: #cbd5e1;\n font-style: italic;\n }\n \n /* Voice Text Input Area - Type while on voice call */\n .voice-text-input-area {\n width: 100%;\n padding: 14px 16px;\n margin: 0;\n flex-shrink: 0;\n background: #ffffff;\n border-top: 1px solid rgba(0, 0, 0, 0.06);\n box-sizing: border-box;\n }\n \n .voice-input-wrapper {\n display: flex;\n align-items: center;\n gap: 10px;\n background: #f1f5f9;\n border-radius: 12px;\n padding: 4px 4px 4px 14px;\n border: 1px solid transparent;\n transition: all 0.2s ease;\n }\n \n .voice-input-wrapper:focus-within {\n background: #fff;\n border-color: #a855f7;\n box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);\n }\n \n .voice-text-input {\n flex: 1;\n border: none;\n outline: none;\n font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;\n font-size: 14px;\n color: ").concat(d).concat(y,";\n background: transparent;\n padding: 10px 0;\n }\n \n .voice-text-input::placeholder {\n color: #94a3b8;\n }\n \n .voice-send-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 38px;\n height: 38px;\n border-radius: 10px;\n border: none;\n background: ").concat(w).concat(y,";\n color: #fff;\n cursor: pointer;\n transition: transform 0.2s ease;\n flex-shrink: 0;\n }\n \n .voice-send-btn:hover:not(:disabled) {\n transform: scale(1.05);\n }\n \n .voice-send-btn:active:not(:disabled) {\n transform: scale(0.95);\n }\n \n .voice-send-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n transform: none;\n }\n \n .voice-send-btn svg {\n width: 16px;\n height: 16px;\n }\n \n .voice-input-hint {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 5px;\n margin-top: 10px;\n font-size: 11px;\n color: #64748b;\n transition: color 0.2s ease;\n }\n \n .voice-input-hint svg {\n width: 12px;\n height: 12px;\n color: #10b981;\n }\n \n /* Text input status states */\n .voice-input-hint--sending {\n color: #666;\n }\n \n .voice-input-hint--success {\n color: #28a745;\n }\n \n .voice-input-hint--queued {\n color: #ffc107;\n }\n \n .voice-input-hint--error {\n color: #dc3545;\n }\n \n /* Disabled input styling */\n .voice-text-input:disabled,\n #mobileTextInput:disabled {\n background-color: #f5f5f5;\n cursor: not-allowed;\n }\n \n .voice-send-btn:disabled,\n #mobileSendBtn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n \n /* Voice Controls - Scales with container */\n .voice-controls {\n display: flex;\n gap: clamp(8px, 1.8vh, 14px);\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n margin: 0;\n padding-top: 0;\n }\n \n .voice-control-btn {\n width: clamp(48px, 9vh, 72px)").concat(y,";\n height: clamp(48px, 9vh, 72px)").concat(y,";\n min-width: clamp(48px, 9vh, 72px)").concat(y,";\n min-height: clamp(48px, 9vh, 72px)").concat(y,";\n max-width: clamp(48px, 9vh, 72px)").concat(y,";\n max-height: clamp(48px, 9vh, 72px)").concat(y,";\n aspect-ratio: 1").concat(y,";\n border-radius: 50%").concat(y,";\n border: none").concat(y,";\n cursor: pointer").concat(y,";\n display: flex").concat(y,";\n align-items: center").concat(y,";\n justify-content: center").concat(y,";\n transition: all 0.2s;\n position: relative").concat(y,";\n flex-shrink: 0;\n overflow: hidden").concat(y,";\n padding: 0").concat(y,";\n margin: 0").concat(y,";\n box-sizing: border-box").concat(y,";\n }\n \n .voice-control-btn svg {\n width: 48%").concat(y,";\n height: 48%").concat(y,";\n min-width: 48%").concat(y,";\n min-height: 48%").concat(y,";\n max-width: 48%").concat(y,";\n max-height: 48%").concat(y,";\n display: block").concat(y,";\n visibility: visible").concat(y,";\n opacity: 1").concat(y,";\n margin: 0").concat(y,";\n padding: 0").concat(y,";\n position: relative").concat(y,";\n flex-shrink: 0").concat(y,";\n }\n \n .voice-control-btn.primary {\n width: clamp(54px, 10vh, 80px)").concat(y,";\n height: clamp(54px, 10vh, 80px)").concat(y,";\n min-width: clamp(54px, 10vh, 80px)").concat(y,";\n min-height: clamp(54px, 10vh, 80px)").concat(y,";\n max-width: clamp(54px, 10vh, 80px)").concat(y,";\n max-height: clamp(54px, 10vh, 80px)").concat(y,";\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%)").concat(y,";\n color: white").concat(y,";\n box-shadow: 0 6px 18px rgba(102, 126, 234, 0.4);\n }\n \n .voice-control-btn.primary:hover {\n transform: scale(1.05);\n }\n \n .voice-control-btn.primary.active {\n background: ").concat(B).concat(y,";\n animation: recordingPulse 1.5s ease-in-out infinite;\n }\n .voice-control-btn.primary.active svg {\n fill: white").concat(y,";\n }\n \n /* More specific selectors for WordPress compatibility */\n #endCallBtn.voice-control-btn.primary.active,\n #muteBtn.voice-control-btn.secondary,\n #speakerBtn.voice-control-btn.secondary {\n border-radius: 50% !important;\n width: clamp(48px, 9vh, 72px) !important;\n height: clamp(48px, 9vh, 72px) !important;\n min-width: clamp(48px, 9vh, 72px) !important;\n min-height: clamp(48px, 9vh, 72px) !important;\n max-width: clamp(48px, 9vh, 72px) !important;\n max-height: clamp(48px, 9vh, 72px) !important;\n aspect-ratio: 1 !important;\n overflow: hidden !important;\n }\n \n #endCallBtn.voice-control-btn.primary.active {\n width: clamp(54px, 10vh, 80px) !important;\n height: clamp(54px, 10vh, 80px) !important;\n min-width: clamp(54px, 10vh, 80px) !important;\n min-height: clamp(54px, 10vh, 80px) !important;\n max-width: clamp(54px, 10vh, 80px) !important;\n max-height: clamp(54px, 10vh, 80px) !important;\n }\n \n \n /* Microphone button specific background color */\n #muteBtn.voice-control-btn.secondary {\n background: ").concat(m).concat(y,";\n }\n \n /* Speaker button specific background color */\n #speakerBtn.voice-control-btn.secondary {\n background: ").concat(v).concat(y,";\n }\n \n #endCallBtn.voice-control-btn.primary.active svg,\n #muteBtn.voice-control-btn.secondary svg,\n #speakerBtn.voice-control-btn.secondary svg {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n width: 48% !important;\n height: 48% !important;\n margin: 0 !important;\n padding: 0 !important;\n position: relative !important;\n }\n \n @keyframes recordingPulse {\n 0%, 100% { \n box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);\n }\n 50% { \n box-shadow: 0 6px 24px rgba(239, 68, 68, 0.7);\n }\n }\n \n .voice-control-btn.secondary {\n background: ").concat(u).concat(y,";\n color: ").concat(h).concat(y,";\n box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);\n width: clamp(48px, 9vh, 72px)").concat(y,";\n height: clamp(48px, 9vh, 72px)").concat(y,";\n min-width: clamp(48px, 9vh, 72px)").concat(y,";\n min-height: clamp(48px, 9vh, 72px)").concat(y,";\n max-width: clamp(48px, 9vh, 72px)").concat(y,";\n max-height: clamp(48px, 9vh, 72px)").concat(y,";\n }\n \n .voice-control-btn.secondary:hover {\n background: #f8fafc").concat(y,";\n transform: scale(1.05);\n }\n \n .voice-control-btn.secondary.muted {\n background: #f3f4f6").concat(y,";\n }\n \n .voice-control-btn.secondary.muted .mute-icon {\n stroke: #9ca3af !important;\n }\n \n .voice-control-btn.secondary svg {\n width: 48%").concat(y,";\n height: 48%").concat(y,";\n display: block").concat(y,";\n visibility: visible").concat(y,";\n opacity: 1").concat(y,";\n margin: 0").concat(y,";\n padding: 0").concat(y,";\n position: relative").concat(y,";\n }\n \n .voice-timer {\n position: absolute;\n bottom: clamp(-18px, -3vh, -24px);\n font-size: clamp(9px, 1.6vh, 12px);\n color: #64748b;\n font-weight: 500;\n white-space: nowrap;\n }\n \n /* ===== DESKTOP VOICE SECTION - New Design ===== */\n .desktop-voice-section {\n padding: 16px 20px;\n background: linear-gradient(180deg, #ffffff 0%, rgba(168, 85, 247, 0.04) 100%);\n width: 100%;\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 12px;\n box-sizing: border-box;\n text-align: center;\n }\n \n /* Ensure all children are centered */\n .desktop-voice-section > * {\n margin-left: auto;\n margin-right: auto;\n }\n \n .desktop-timer {\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n gap: 6px !important;\n padding: 5px 10px !important;\n background: rgba(0, 0, 0, 0.05) !important;\n border-radius: 20px !important;\n font-family: 'JetBrains Mono', 'Courier New', monospace;\n font-size: 11px !important;\n color: #64748b !important;\n margin: 0 auto !important;\n }\n \n .desktop-timer .timer-dot {\n width: 5px").concat(y,";\n height: 5px").concat(y,";\n background: #ef4444").concat(y,";\n border-radius: 50%").concat(y,";\n animation: timerPulse 1s ease-in-out infinite").concat(y,";\n }\n \n @keyframes timerPulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.4; }\n }\n \n .desktop-avatar-container {\n margin-bottom: 12px;\n }\n \n .desktop-avatar-large {\n width: 80px !important;\n height: 80px !important;\n border-radius: 20px !important;\n margin: 0 auto 12px !important;\n box-shadow: 0 8px 24px rgba(168, 85, 247, 0.35) !important;\n background: linear-gradient(135deg, ").concat(t," 0%, ").concat(A,' 100%) !important;\n }\n \n .desktop-waveform {\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n gap: 4px !important;\n height: 36px !important;\n width: 100% !important;\n }\n \n .desktop-waveform-bar {\n width: 4px !important;\n background: rgba(255, 255, 255, 0.9) !important;\n border-radius: 2px !important;\n animation: waveformAnimation 0.8s ease-in-out infinite !important;\n }\n \n .desktop-waveform-bar[data-index="0"] { height: 14px !important; animation-delay: 0s !important; }\n .desktop-waveform-bar[data-index="1"] { height: 26px !important; animation-delay: 0.1s !important; }\n .desktop-waveform-bar[data-index="2"] { height: 36px !important; animation-delay: 0.2s !important; }\n .desktop-waveform-bar[data-index="3"] { height: 22px !important; animation-delay: 0.3s !important; }\n .desktop-waveform-bar[data-index="4"] { height: 16px !important; animation-delay: 0.4s !important; }\n \n @keyframes waveformAnimation {\n 0%, 100% { transform: scaleY(0.5); }\n 50% { transform: scaleY(1); }\n }\n \n .desktop-waveform.paused .desktop-waveform-bar {\n animation-play-state: paused;\n }\n\n /* New main waveform (used in updated template) */\n .desktop-main-waveform {\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n gap: 3px !important;\n height: 48px !important;\n width: 100% !important;\n max-width: 200px !important;\n margin: 0 auto !important;\n padding: 0 20px !important;\n }\n\n .desktop-main-waveform .waveform-bar {\n width: 3px !important;\n background: #a855f7 !important;\n border-radius: 2px !important;\n height: 8px !important;\n animation: waveformAnimation 0.8s ease-in-out infinite !important;\n }\n\n .desktop-main-waveform .waveform-bar:nth-child(1) { height: 12px !important; animation-delay: 0s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(2) { height: 20px !important; animation-delay: 0.05s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(3) { height: 28px !important; animation-delay: 0.1s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(4) { height: 36px !important; animation-delay: 0.15s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(5) { height: 44px !important; animation-delay: 0.2s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(6) { height: 50px !important; animation-delay: 0.25s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(7) { height: 54px !important; animation-delay: 0.3s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(8) { height: 56px !important; animation-delay: 0.35s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(9) { height: 54px !important; animation-delay: 0.4s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(10) { height: 50px !important; animation-delay: 0.45s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(11) { height: 44px !important; animation-delay: 0.5s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(12) { height: 36px !important; animation-delay: 0.55s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(13) { height: 28px !important; animation-delay: 0.6s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(14) { height: 20px !important; animation-delay: 0.65s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(15) { height: 12px !important; animation-delay: 0.7s !important; }\n\n .desktop-status {\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n gap: 5px !important;\n font-size: 12px !important;\n color: ').concat(n,";\n font-weight: 500;\n width: 100%;\n text-align: center;\n margin: 0 auto;\n }\n \n .desktop-status .status-dot {\n width: 5px !important;\n height: 5px !important;\n background: ").concat(r," !important;\n border-radius: 50% !important;\n animation: statusPulse 1.5s ease-in-out infinite !important;\n }\n \n @keyframes statusPulse {\n 0%, 100% { transform: scale(1); opacity: 1; }\n 50% { transform: scale(1.15); opacity: 0.8; }\n }\n \n .desktop-live-waveform {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 3px;\n height: 48px;\n margin-bottom: 20px;\n }\n \n .desktop-live-bar {\n width: 3px;\n background: linear-gradient(180deg, ").concat(t,", ").concat(A,");\n border-radius: 2px;\n transition: height 0.1s ease;\n height: 8px;\n }\n \n .desktop-controls {\n display: flex;\n gap: 8px;\n align-items: center;\n justify-content: center;\n width: 100%;\n margin: 0 auto;\n }\n \n .desktop-control-btn {\n width: 46px;\n height: 46px;\n border-radius: 50%;\n border: none;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n }\n \n .desktop-control-btn svg {\n width: 20px;\n height: 20px;\n }\n \n .desktop-mic-icon,\n .desktop-speaker-icon {\n width: 20px !important;\n height: 20px !important;\n display: block;\n flex-shrink: 0;\n }\n \n .desktop-control-btn.secondary.muted .desktop-mic-icon,\n .desktop-control-btn.secondary.muted .desktop-speaker-icon {\n width: 20px !important;\n height: 20px !important;\n }\n \n \n .desktop-control-btn.secondary:hover {\n background: rgba(0, 0, 0, 0.1);\n color: #1e293b;\n transform: scale(1.05);\n }\n .desktop-control-btn.secondary.muted {\n background: #f3f4f6;\n color: #9ca3af;\n }\n \n .desktop-control-btn.secondary.muted .desktop-mic-icon,\n .desktop-control-btn.secondary.muted .desktop-speaker-icon {\n stroke: #9ca3af;\n }\n \n .desktop-control-btn.secondary {\n position: relative;\n }\n \n \n /* Desktop microphone button background color */\n #desktopMuteBtn.desktop-control-btn.secondary,\n #desktopMuteBtnCompact.compact-control-btn.secondary {\n background: ").concat(m).concat(y,";\n }\n \n /* Desktop speaker button background color */\n #desktopSpeakerBtn.desktop-control-btn.secondary,\n #desktopSpeakerBtnCompact.compact-control-btn.secondary {\n background: ").concat(v).concat(y,";\n }\n .desktop-mic-off-icon,\n .desktop-speaker-off-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n width: 46px;\n height: 46px;\n transform: translate(-50%, -50%);\n z-index: 10;\n }\n .desktop-control-btn.danger {\n width: 50px;\n height: 50px;\n background: ").concat(B).concat(y,";\n color: #ffffff;\n box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);\n overflow: visible;\n }\n \n .desktop-control-btn.danger svg {\n width: 20px;\n height: 20px;\n overflow: visible;\n }\n \n .desktop-control-btn.danger:hover {\n transform: scale(1.06);\n box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);\n }\n \n .desktop-control-btn.danger:hover {\n transform: scale(1.06);\n box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);\n }\n \n \n /* ===== COMPACT VOICE SECTION (Single-row layout) ===== */\n .compact-voice-section {\n padding: 10px 14px;\n background: linear-gradient(180deg, #ffffff, rgba(168, 85, 247, 0.04));\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n border-bottom: 1px solid rgba(0, 0, 0, 0.06);\n min-height: 62px;\n flex-shrink: 0;\n }\n \n .compact-left {\n display: flex;\n align-items: center;\n gap: 10px;\n }\n \n .compact-avatar {\n width: 42px;\n height: 42px;\n min-width: 42px;\n min-height: 42px;\n border-radius: 12px;\n background: transparent;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n overflow: visible;\n position: relative;\n }\n \n /* Waveform container in compact avatar - ensure it's visible */\n .compact-avatar .desktop-main-waveform {\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n gap: 2px !important;\n height: 100% !important;\n width: 100% !important;\n padding: 4px !important;\n transform: scale(0.75) !important;\n transform-origin: center !important;\n }\n \n /* Ensure waveform bars are visible and animated in compact mode */\n .compact-avatar .desktop-main-waveform .waveform-bar {\n width: 2px !important;\n min-width: 2px !important;\n background: #a855f7 !important;\n border-radius: 1px !important;\n flex-shrink: 0 !important;\n animation: waveformAnimation 0.8s ease-in-out infinite !important;\n }\n \n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(1) { height: 6px !important; animation-delay: 0s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(2) { height: 10px !important; animation-delay: 0.05s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(3) { height: 14px !important; animation-delay: 0.1s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(4) { height: 18px !important; animation-delay: 0.15s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(5) { height: 22px !important; animation-delay: 0.2s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(6) { height: 26px !important; animation-delay: 0.25s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(7) { height: 28px !important; animation-delay: 0.3s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(8) { height: 30px !important; animation-delay: 0.35s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(9) { height: 28px !important; animation-delay: 0.4s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(10) { height: 26px !important; animation-delay: 0.45s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(11) { height: 22px !important; animation-delay: 0.5s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(12) { height: 18px !important; animation-delay: 0.55s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(13) { height: 14px !important; animation-delay: 0.6s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(14) { height: 10px !important; animation-delay: 0.65s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(15) { height: 6px !important; animation-delay: 0.7s !important; }\n\n }\n \n .compact-info {\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n \n .compact-timer {\n display: flex;\n align-items: center;\n gap: 5px;\n font-family: 'JetBrains Mono', 'Courier New', monospace;\n font-size: 13px;\n font-weight: 600;\n color: ").concat(d).concat(y,";\n }\n \n .compact-timer .timer-dot {\n width: 6px").concat(y,";\n height: 6px").concat(y,";\n background: #ef4444").concat(y,";\n border-radius: 50%").concat(y,";\n animation: timerPulse 1s ease-in-out infinite").concat(y,";\n }\n \n .compact-status {\n display: flex").concat(y,";\n align-items: center").concat(y,";\n gap: 4px").concat(y,";\n font-size: 11px").concat(y,";\n color: ").concat(n).concat(y,";\n }\n \n .compact-status .status-dot {\n width: 5px").concat(y,";\n height: 5px").concat(y,";\n background: ").concat(r).concat(y,";\n border-radius: 50%").concat(y,";\n animation: statusPulse 1.5s ease-in-out infinite").concat(y,";\n }\n \n @keyframes statusPulse {\n 0%, 100% { opacity: 1; transform: scale(1); }\n 50% { opacity: 0.7; transform: scale(1.1); }\n }\n \n .compact-controls {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n \n .compact-control-btn {\n width: 36px;\n height: 36px;\n min-width: 36px;\n min-height: 36px;\n border-radius: 50%;\n border: none;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: all 0.2s ease;\n padding: 0;\n position: relative;\n }\n \n .compact-control-btn svg {\n width: 16px;\n height: 16px;\n }\n \n .compact-control-btn.secondary {\n background: #f1f5f9;\n color: #64748b;\n }\n \n \n /* Compact speaker button background color */\n #desktopSpeakerBtnCompact.compact-control-btn.secondary {\n background: ").concat(v).concat(y,";\n }\n /* Compact microphone button background color */\n #desktopMuteBtnCompact.compact-control-btn.secondary {\n background: ").concat(m).concat(y,";\n }\n \n .compact-control-btn.secondary:hover {\n background: #e2e8f0;\n color: #475569;\n }\n \n .compact-control-btn.secondary.muted {\n background: rgba(239, 68, 68, 0.1);\n color: #ef4444;\n }\n \n \n .compact-control-btn.secondary.muted .desktop-mic-icon,\n .compact-control-btn.secondary.muted .desktop-speaker-icon {\n stroke: #ef4444;\n }\n \n .compact-control-btn.secondary.muted .desktop-mic-off-icon,\n .compact-control-btn.secondary.muted .desktop-speaker-off-icon {\n width: 46px;\n height: 46px;\n }\n\n .compact-control-btn.danger {\n width: 40px;\n height: 40px;\n min-width: 40px;\n min-height: 40px;\n background: ").concat(B).concat(y,";\n color: white;\n box-shadow: 0 3px 10px rgba(239, 68, 68, 0.35);\n }\n \n .compact-control-btn.danger:hover {\n transform: scale(1.05);\n box-shadow: 0 4px 14px rgba(239, 68, 68, 0.45);\n }\n \n .compact-control-btn.danger svg {\n width: 18px;\n height: 18px;\n overflow: visible;\n }\n \n/* ===== CONVERSATION PANEL ===== */\n .desktop-conversation-panel {\n border-top: 1px solid rgba(0, 0, 0, 0.06);\n width: 100%;\n display: flex;\n flex-direction: column;\n min-height: 0;\n overflow: hidden;\n flex: 1;\n }\n \n .conversation-header {\n padding: 10px 16px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n background: #fafafa;\n cursor: pointer;\n flex-shrink: 0;\n border-bottom: 1px solid rgba(0, 0, 0, 0.04);\n transition: background 0.2s ease;\n }\n \n .conversation-header:hover {\n background: #f5f5f5;\n }\n \n .conversation-label {\n font-size: 11px;\n font-weight: 600;\n color: #64748b;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n }\n \n .conversation-toggle {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 11px;\n color: #94a3b8;\n font-weight: 500;\n }\n \n .conversation-toggle svg {\n transition: transform 0.2s ease;\n }\n \n .conversation-header.expanded .conversation-toggle svg {\n transform: rotate(180deg);\n }\n \n /* ===== COLLAPSED: Live Transcript Only (2 lines) ===== */\n .live-transcript-collapsed {\n padding: 12px 16px;\n background: #fafafa;\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex-shrink: 0;\n min-height: 50px;\n }\n \n .live-indicator {\n display: flex;\n align-items: center;\n gap: 5px;\n font-size: 9px;\n font-weight: 700;\n color: ").concat(f).concat(y,";\n text-transform: uppercase;\n letter-spacing: 0.08em;\n }\n \n .live-indicator .live-dot {\n height: 5px;\n width: 5px;\n background: ").concat(g).concat(y,";\n border-radius: 50%;\n animation: statusPulse 1.5s ease-in-out infinite;\n }\n \n .live-text-collapsed {\n font-size: ").concat(p).concat(y,";\n color: ").concat(d).concat(y,";\n line-height: 1.5;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n \n .live-text-collapsed.muted {\n color: #94a3b8;\n font-style: italic;\n }\n \n .typing-cursor {\n display: inline-block;\n width: 2px;\n height: 14px;\n background: #a855f7;\n margin-left: 2px;\n animation: blink 1s step-end infinite;\n vertical-align: middle;\n }\n \n @keyframes blink {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0; }\n }\n \n /* ===== EXPANDED: Full Conversation History ===== */\n .conversation-history {\n flex: 1;\n flex-direction: column;\n gap: 10px;\n overflow-y: auto;\n padding: 14px 16px;\n min-height: 0;\n }\n .conversation-history.visible {\n display: flex;\n }\n\n .conversation-messages {\n display: flex;\n flex-direction: column;\n gap: 10px;\n }\n\n /* Message Rows */\n .message-row {\n display: flex;\n gap: 8px;\n animation: msgIn 0.25s ease;\n }\n \n @keyframes msgIn {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes slideIn {\n from { opacity: 0; transform: translateY(-10px); }\n to { opacity: 1; transform: translateY(0); }\n }\n \n @keyframes slideOut {\n from { opacity: 1; transform: translateY(0); }\n to { opacity: 0; transform: translateY(-10px); }\n }\n \n .message-row.user {\n flex-direction: row-reverse;\n }\n \n .message-avatar {\n width: 28px;\n height: 28px;\n border-radius: 8px;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n\n .message-avatar.assistant {\n background: linear-gradient(135deg, #c084fc, #a855f7);\n }\n\n .message-avatar.assistant .orb {\n width: 12px;\n height: 12px;\n background: rgba(255, 255, 255, 0.9);\n border-radius: 50%;\n }\n\n .message-avatar.user {\n background: linear-gradient(135deg, #64748b, #475569);\n color: #fff;\n font-size: 11px;\n font-weight: 600;\n }\n\n .message-bubble {\n max-width: 80%;\n padding: 9px 13px;\n border-radius: 12px;\n font-size: 13px;\n line-height: 1.5;\n }\n \n .message-row.assistant .message-bubble {\n background: #fff;\n color: ").concat(d).concat(y,";\n border: 1px solid rgba(0, 0, 0, 0.06);\n border-bottom-left-radius: 4px;\n }\n \n .message-row.user .message-bubble {\n background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);\n color: #fff;\n border-bottom-right-radius: 4px;\n }\n \n /* Live message at bottom of history */\n .live-message-row {\n display: flex;\n gap: 8px;\n padding-top: 8px;\n border-top: 1px dashed rgba(0, 0, 0, 0.08);\n margin-top: auto;\n }\n \n .live-message-row .message-bubble {\n background: #fff;\n border: 1px solid rgba(16, 185, 129, 0.3);\n color: ").concat(d).concat(y,";\n position: relative;\n border-radius: 14px;\n border-bottom-left-radius: 4px;\n }\n \n .live-message-row .live-badge {\n position: absolute;\n top: -8px;\n left: 10px;\n background: #10b981;\n color: #fff;\n font-size: 8px;\n font-weight: 700;\n padding: 2px 6px;\n border-radius: 4px;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n }\n \n /* Hide/show based on expanded state */\n .desktop-conversation-panel.collapsed .conversation-history {\n display: none;\n }\n \n .desktop-conversation-panel.collapsed .live-transcript-collapsed {\n display: flex;\n }\n \n .desktop-conversation-panel.expanded .conversation-history {\n display: flex;\n max-height: 400px;\n }\n \n .desktop-conversation-panel.expanded .live-transcript-collapsed {\n display: none;\n }\n \n /* ===== DARK MODE SUPPORT ===== */\n @media (prefers-color-scheme: dark) {\n .desktop-voice-section {\n background: linear-gradient(180deg, #1e1e2e 0%, rgba(168, 85, 247, 0.08) 100%);\n }\n\n .desktop-timer {\n color: #94a3b8;\n }\n\n .desktop-status {\n color: #34d399;\n }\n\n .desktop-status .status-dot {\n \n .desktop-control-btn.secondary.muted {\n background: rgba(255, 255, 255, 0.1);\n color: #9ca3af;\n \n .compact-voice-section {\n background: linear-gradient(180deg, #1e1e2e 0%, rgba(168, 85, 247, 0.08) 100%);\n border-bottom: 1px solid rgba(255, 255, 255, 0.08);\n }\n \n .compact-timer {\n color: #e2e8f0;\n }\n \n .compact-status {\n color: #34d399;\n }\n \n .compact-status .status-dot {\n background: #34d399;\n }\n \n .compact-control-btn.secondary {\n background: rgba(255, 255, 255, 0.08);\n color: #94a3b8;\n }\n \n .compact-control-btn.secondary:hover {\n background: rgba(255, 255, 255, 0.15);\n color: #e2e8f0;\n }\n \n .compact-control-btn.secondary.muted {\n background: rgba(239, 68, 68, 0.2);\n color: #f87171;\n }\n\n }\n \n .desktop-control-btn.secondary.muted svg {\n \n .desktop-control-btn.secondary {\n position: relative;\n }\n \n /* Desktop microphone button background color */\n #desktopMuteBtn.desktop-control-btn.secondary,\n #desktopMuteBtnCompact.compact-control-btn.secondary {\n background: ").concat(m).concat(y,";\n }\n \n .desktop-mic-off-icon,\n .desktop-speaker-off-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 20px;\n height: 20px;\n }\n \n .desktop-control-btn.secondary.muted {\n background: #f3f4f6;\n color: #9ca3af;\n }\n \n .desktop-control-btn.secondary.muted svg {\n \n .desktop-control-btn.secondary {\n position: relative;\n }\n \n /* Desktop microphone button background color */\n #desktopMuteBtn.desktop-control-btn.secondary,\n #desktopMuteBtnCompact.compact-control-btn.secondary {\n background: ").concat(m).concat(y,";\n }\n \n .desktop-mic-off-icon,\n .desktop-speaker-off-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 20px;\n height: 20px;\n }\n stroke: #9ca3af;\n }\n stroke: #9ca3af;\n }\n background: #34d399;\n }\n\n .desktop-control-btn.secondary {\n background: rgba(255, 255, 255, 0.08);\n color: #94a3b8;\n }\n\n .desktop-control-btn.secondary:hover {\n background: rgba(255, 255, 255, 0.15);\n color: #e2e8f0;\n }\n\n .desktop-conversation-panel {\n border-top: 1px solid rgba(255, 255, 255, 0.08);\n }\n\n .conversation-header {\n background: #1a1a2e;\n }\n\n .conversation-header:hover {\n background: #252540;\n }\n\n .conversation-label {\n color: #94a3b8;\n }\n\n .conversation-toggle {\n color: #64748b;\n }\n\n .live-transcript-preview {\n background: #1a1a2e;\n }\n .live-indicator {\n color: ").concat(f).concat(y,";\n }\n .live-indicator .live-dot {\n background: ").concat(g).concat(y,";\n }\n\n .live-text {\n color: #e2e8f0;\n }\n\n .live-text.muted {\n color: #64748b;\n }\n\n .conversation-history {\n background: #1a1a2e;\n }\n\n .conversation-msg.assistant .conversation-msg-bubble {\n background: #252540;\n color: #e2e8f0;\n border: 1px solid rgba(255, 255, 255, 0.08);\n }\n\n .voice-text-input-area {\n background: #1a1a2e;\n }\n\n .voice-text-input {\n background: #252540 !important;\n color: #e2e8f0 !important;\n border-color: rgba(255, 255, 255, 0.1) !important;\n }\n\n .voice-text-input::placeholder {\n color: #64748b !important;\n }\n\n .voice-text-input:focus {\n border-color: ").concat(t," !important;\n box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2) !important;\n }\n\n .voice-input-hint {\n color: #64748b !important;\n }\n\n .voice-send-btn {\n background: ").concat(w," !important;\n }\n\n .voice-send-btn:disabled {\n background: #374151 !important;\n color: #4b5563 !important;\n }\n }\n\n /* Mobile optimization */\n @media (max-width: 768px) {\n .voice-interface {\n padding: 6px 10px;\n }\n }\n \n @media (max-width: 480px) {\n .voice-interface {\n padding: 5px 8px;\n }\n }\n \n /* Mobile Voice Call UI - Shared styles (also used in generateMobileCSS) */\n ").concat(this._getSharedMobileCSS(y),"\n\n ")}},{key:"_getSharedMobileCSS",value:function(e){return"\n .mobile-duration-dot {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background-color: #ef4444;\n animation: mobilePulse 1.5s ease-in-out infinite;\n }\n\n @keyframes mobilePulse {\n 0%, 100% { opacity: 1; transform: scale(1); }\n 50% { opacity: 0.5; transform: scale(0.95); }\n }\n\n .mobile-voice-bar {\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding: 14px;\n background: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #c084fc 100%);\n border-radius: 24px 24px 0 0;\n box-shadow: 0 -8px 32px rgba(124, 58, 237, 0.5), 0 -2px 8px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.2);\n width: 100%;\n max-width: 100%;\n pointer-events: auto;\n }\n\n .mobile-top-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n position: relative;\n }\n\n .mobile-status-indicator {\n display: flex;\n align-items: center;\n gap: 5px;\n min-width: 85px;\n }\n\n .mobile-status-dot {\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background-color: #22c55e;\n box-shadow: 0 0 8px #22c55e;\n transition: all 0.3s ease;\n }\n\n .mobile-status-text {\n font-size: 11px;\n font-weight: 700;\n color: rgba(255,255,255,0.95);\n text-transform: uppercase;\n letter-spacing: 0.3px;\n }\n\n .mobile-waveform-center {\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 3px;\n height: 24px;\n }\n\n .mobile-waveform-bar {\n width: 4px;\n height: 4px;\n background-color: #fff;\n border-radius: 2px;\n transition: height 0.15s ease;\n box-shadow: 0 0 8px rgba(255,255,255,0.5);\n }\n\n .mobile-controls {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n\n .mobile-control-btn {\n display: flex".concat(e,";\n align-items: center").concat(e,";\n justify-content: center").concat(e,";\n width: 32px").concat(e,";\n height: 32px").concat(e,";\n min-width: 32px").concat(e,";\n min-height: 32px").concat(e,";\n max-width: 32px").concat(e,";\n max-height: 32px").concat(e,";\n border-radius: 50%").concat(e,";\n border: none").concat(e,";\n cursor: pointer").concat(e,";\n transition: all 0.2s ease;\n background-color: rgba(255,255,255,0.15)").concat(e,";\n position: relative").concat(e,";\n overflow: hidden").concat(e,";\n padding: 0").concat(e,";\n margin: 0").concat(e,";\n box-sizing: border-box").concat(e,";\n }\n\n .mobile-control-btn:hover {\n background-color: rgba(255,255,255,0.25)").concat(e,";\n }\n\n .mobile-control-btn.muted {\n background-color: rgba(239, 68, 68, 0.3)").concat(e,";\n }\n\n .mobile-control-btn svg {\n position: absolute").concat(e,";\n top: 50%").concat(e,";\n left: 50%").concat(e,";\n transform: translate(-50%, -50%)").concat(e,";\n display: block").concat(e,";\n visibility: visible").concat(e,";\n opacity: 1").concat(e,";\n width: 15px").concat(e,";\n height: 15px").concat(e,";\n margin: 0").concat(e,";\n padding: 0").concat(e,";\n }\n\n .mobile-mic-off-icon,\n .mobile-speaker-off-icon {\n display: none !important;\n }\n\n .mobile-control-btn.muted .mobile-mic-icon,\n .mobile-control-btn.muted .mobile-speaker-icon {\n display: none !important;\n }\n\n .mobile-control-btn.muted .mobile-mic-off-icon,\n .mobile-control-btn.muted .mobile-speaker-off-icon {\n display: block !important;\n }\n\n .mobile-end-call-btn {\n display: flex").concat(e,";\n align-items: center").concat(e,";\n justify-content: center").concat(e,";\n width: 36px").concat(e,";\n height: 36px").concat(e,";\n min-width: 36px").concat(e,";\n min-height: 36px").concat(e,";\n max-width: 36px").concat(e,";\n max-height: 36px").concat(e,";\n border-radius: 50%").concat(e,";\n border: none").concat(e,";\n cursor: pointer").concat(e,";\n background-color: #ef4444").concat(e,";\n box-shadow: 0 4px 14px rgba(239, 68, 68, 0.5);\n transition: all 0.2s ease;\n overflow: hidden").concat(e,";\n padding: 0").concat(e,";\n margin: 0").concat(e,";\n box-sizing: border-box").concat(e,";\n }\n\n .mobile-end-call-btn svg {\n display: block").concat(e,";\n visibility: visible").concat(e,";\n opacity: 1").concat(e,";\n width: 15px").concat(e,";\n height: 15px").concat(e,";\n margin: 0").concat(e,";\n padding: 0").concat(e,";\n position: relative").concat(e,";\n }\n\n /* ID-specific selectors for WordPress compatibility */\n #mobileMuteBtn.mobile-control-btn,\n #mobileSpeakerBtn.mobile-control-btn,\n #mobileEndCallBtn.mobile-end-call-btn {\n border-radius: 50% !important;\n overflow: hidden !important;\n }\n\n #mobileMuteBtn.mobile-control-btn,\n #mobileSpeakerBtn.mobile-control-btn {\n width: 32px !important;\n height: 32px !important;\n min-width: 32px !important;\n min-height: 32px !important;\n max-width: 32px !important;\n max-height: 32px !important;\n }\n\n #mobileEndCallBtn.mobile-end-call-btn {\n width: 36px !important;\n height: 36px !important;\n min-width: 36px !important;\n min-height: 36px !important;\n max-width: 36px !important;\n max-height: 36px !important;\n }\n\n #mobileMuteBtn.mobile-control-btn svg,\n #mobileSpeakerBtn.mobile-control-btn svg,\n #mobileEndCallBtn.mobile-end-call-btn svg {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n width: 15px !important;\n height: 15px !important;\n margin: 0 !important;\n padding: 0 !important;\n }\n\n .mobile-end-call-btn:hover {\n transform: scale(1.05);\n }\n\n .mobile-transcript-row {\n width: 100%;\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 10px 12px;\n background: rgba(255,255,255,0.18);\n border-radius: 14px;\n border: none;\n cursor: pointer;\n text-align: left;\n backdrop-filter: blur(4px);\n transition: background 0.2s ease;\n }\n\n .mobile-transcript-row:hover {\n background: rgba(255,255,255,0.25);\n }\n\n .mobile-transcript-text {\n margin: 0;\n font-size: 13px;\n color: #fff;\n line-height: 1.4;\n font-weight: 500;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .mobile-transcript-footer {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n .mobile-expand-hint {\n font-size: 10px;\n color: rgba(255,255,255,0.6);\n text-transform: uppercase;\n letter-spacing: 0.5px;\n font-weight: 600;\n }\n\n .mobile-transcript-overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0,0,0,0.6);\n display: flex;\n align-items: flex-end;\n padding: 12px;\n z-index: 100000;\n pointer-events: auto;\n }\n\n .mobile-expanded-transcript {\n width: 100%;\n max-height: 75%;\n background: #fff;\n border-radius: 24px 24px 16px 16px;\n overflow: hidden;\n box-shadow: 0 -8px 40px rgba(0,0,0,0.3);\n display: flex;\n flex-direction: column;\n }\n\n .mobile-transcript-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 14px 16px;\n background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);\n flex-shrink: 0;\n }\n\n .mobile-header-left {\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n\n .mobile-header-status {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n\n .mobile-header-status-dot {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background-color: #22c55e;\n box-shadow: 0 0 6px #22c55e;\n }\n\n .mobile-header-status-text {\n font-size: 10px;\n font-weight: 700;\n color: rgba(255,255,255,0.9);\n text-transform: uppercase;\n letter-spacing: 0.5px;\n }\n\n .mobile-header-duration {\n font-size: 10px;\n font-weight: 600;\n color: rgba(255,255,255,0.7);\n margin-left: 8px;\n }\n\n .mobile-transcript-label {\n font-size: 11px;\n font-weight: 800;\n color: rgba(255,255,255,0.7);\n letter-spacing: 1px;\n }\n\n .mobile-close-transcript-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n border-radius: 50%;\n border: none;\n background: rgba(255,255,255,0.2);\n color: #fff;\n cursor: pointer;\n }\n\n .mobile-close-transcript-btn:hover {\n background: rgba(255,255,255,0.3);\n }\n\n .mobile-messages-container {\n flex: 1;\n padding: 16px;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 12px;\n }\n\n .mobile-message-bubble {\n max-width: 85%;\n padding: 12px 16px;\n border-radius: 18px;\n font-size: 14px;\n line-height: 1.5;\n word-wrap: break-word;\n }\n\n .mobile-message-bubble.assistant {\n align-self: flex-start;\n background-color: #f3f4f6;\n color: #374151;\n border-bottom-left-radius: 4px;\n }\n\n .mobile-message-bubble.user {\n align-self: flex-end;\n background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);\n color: #fff;\n border-bottom-right-radius: 4px;\n }\n\n .mobile-input-area {\n padding: 12px 16px 16px;\n border-top: 1px solid #e5e7eb;\n background: #f9fafb;\n flex-shrink: 0;\n }\n\n .mobile-input-wrapper {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 4px 4px 16px;\n background: #fff;\n border-radius: 24px;\n border: 2px solid #e5e7eb;\n }\n\n .mobile-text-input {\n flex: 1;\n border: none;\n outline: none;\n font-size: 14px;\n color: #374151;\n background: transparent;\n padding: 10px 0;\n }\n\n .mobile-text-input::placeholder {\n color: #9ca3af;\n }\n\n .mobile-send-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 40px;\n height: 40px;\n border-radius: 50%;\n border: none;\n background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);\n color: #fff;\n cursor: pointer;\n transition: all 0.2s ease;\n }\n\n .mobile-send-btn:hover:not(:disabled) {\n transform: scale(1.05);\n }\n\n .mobile-send-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .mobile-input-hint {\n margin: 8px 0 0;\n font-size: 11px;\n color: #9ca3af;\n text-align: center;\n transition: color 0.2s ease;\n }\n\n /* Mobile text input status states */\n .mobile-input-hint--sending {\n color: #666;\n }\n\n .mobile-input-hint--success {\n color: #28a745;\n }\n\n .mobile-input-hint--queued {\n color: #ffc107;\n }\n\n .mobile-input-hint--error {\n color: #dc3545;\n }\n\n /* Disabled mobile input styling */\n #mobileTextInput:disabled {\n background-color: #f5f5f5;\n cursor: not-allowed;\n }\n\n #mobileSendBtn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n ")}},{key:"generateMobileCSS",value:function(){var e=!1===this.config.useShadowDOM?" !important":"";return"\n /* Mobile Voice Call UI - Container positioning */\n #mobile-voice-call-bar-container {\n position: fixed;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 99999;\n font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;\n padding: 0 12px 12px;\n pointer-events: none;\n }\n\n .mobile-duration-badge {\n position: absolute;\n top: -28px;\n left: 50%;\n transform: translateX(-50%);\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 5px 14px;\n background: rgba(0,0,0,0.75);\n border-radius: 20px;\n font-size: 12px;\n font-weight: 700;\n color: #fff;\n backdrop-filter: blur(8px);\n z-index: 10;\n pointer-events: auto;\n }\n\n /* Shared mobile styles */\n ".concat(this._getSharedMobileCSS(e),"\n ")}}])&&bn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Qn(e){return Qn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qn(e)}function Fn(e,t){(null==t||t>e.length)&&(t=e.length);for(var A=0,n=Array(t);A<t;A++)n[A]=e[A];return n}function Un(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Sn(n.key),n)}}function Sn(e){var t=function(e){if("object"!=Qn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Qn(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Qn(t)?t:t+""}var kn=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=t,this.config=t.config,this.conversationMessages=[],this.currentLiveMessage=null},(t=[{key:"t",value:function(e){return this.voiceInterface.t(e)}},{key:"escapeHtml",value:function(e){return this.voiceInterface.escapeHtml(e)}},{key:"updateTranscript",value:function(e){if(console.log("📝 [TRANSCRIPT] updateTranscript() called with text:",e?e.substring(0,50)+"...":"null/empty"),this.voiceInterface.isMobile){var t=document.getElementById("mobileTranscriptText");t&&(t.textContent=e),this.voiceInterface.messages.length>0&&"assistant"===this.voiceInterface.messages[this.voiceInterface.messages.length-1].type?this.voiceInterface.messages[this.voiceInterface.messages.length-1].text=e:this.voiceInterface.messages.push({type:"assistant",text:e});var A=document.getElementById("mobileMessagesContainer");if(A){var n=A.querySelector(".mobile-message-bubble.assistant:last-child");n?n.textContent=e:this.voiceInterface.addMobileMessage("assistant",e)}}else{var o=this.voiceInterface.shadowRoot.getElementById("liveTextCollapsed");if(o)if(e&&e.trim()){o.textContent=e,o.classList.remove("muted");var r=document.createElement("span");r.className="typing-cursor",o.appendChild(r)}else o.textContent=this.t("transcriptWillAppear")||"Transcript will appear here...",o.classList.add("muted");if(e&&e.trim()?(this.currentLiveMessage&&"assistant"===this.currentLiveMessage.role&&e.startsWith(this.currentLiveMessage.content)?this.currentLiveMessage.content=e:(this.currentLiveMessage&&this.finalizeLiveMessage(),this.currentLiveMessage={role:"assistant",content:e}),this.updateLiveMessageRow()):(this.currentLiveMessage=null,this.updateLiveMessageRow()),this.voiceInterface.conversationExpanded){var i=this.voiceInterface.shadowRoot.getElementById("conversationHistory");i&&setTimeout(function(){i.scrollTop=i.scrollHeight},10)}}}},{key:"toggleConversationPanel",value:function(){if(!this.voiceInterface.isMobile){this.voiceInterface.conversationExpanded=!this.voiceInterface.conversationExpanded;var e=this.voiceInterface.shadowRoot.getElementById("desktopConversationPanel"),t=this.voiceInterface.shadowRoot.getElementById("conversationHeader"),A=this.voiceInterface.shadowRoot.getElementById("conversationToggleText"),n=this.voiceInterface.shadowRoot.querySelector(".voice-interface");if(e){var o,r=this.voiceInterface.shadowRoot.getElementById("desktopVoiceSection"),i=this.voiceInterface.shadowRoot.getElementById("compactVoiceSection");this.voiceInterface.conversationExpanded?(e.classList.remove("collapsed"),e.classList.add("expanded"),t&&t.classList.add("expanded"),A&&(A.textContent="Hide history"),n&&n.classList.add("expanded"),r&&(r.style.display="none"),i&&(i.style.display="flex"),console.log("📝 [TRANSCRIPT] Expanding panel, rendering",(null===(o=this.conversationMessages)||void 0===o?void 0:o.length)||0,"messages"),this.renderConversationMessages()):(e.classList.remove("expanded"),e.classList.add("collapsed"),t&&t.classList.remove("expanded"),A&&(A.textContent="Show history"),n&&n.classList.remove("expanded"),r&&(r.style.display=""),i&&(i.style.display="none"))}}}},{key:"finalizeLiveMessage",value:function(){this.currentLiveMessage&&this.currentLiveMessage.content&&this.currentLiveMessage.content.trim()&&(this.conversationMessages||(this.conversationMessages=[]),this.conversationMessages.push({role:this.currentLiveMessage.role,content:this.currentLiveMessage.content}),console.log("📝 [TRANSCRIPT] Finalized live message:",this.currentLiveMessage.role,this.currentLiveMessage.content.substring(0,50)+"..."),this.currentLiveMessage=null,this.voiceInterface.conversationExpanded&&this.renderConversationMessages())}},{key:"addConversationMessage",value:function(e,t){if(!this.voiceInterface.isMobile&&t&&t.trim()){if(this.currentLiveMessage&&this.finalizeLiveMessage(),this.conversationMessages||(this.conversationMessages=[]),"user"!==e)return this.currentLiveMessage={role:e,content:t},this.updateLiveMessageRow(),void console.log("📝 [TRANSCRIPT] Assistant message set as live (via addConversationMessage)");this.conversationMessages.push({role:e,content:t}),console.log("📝 [TRANSCRIPT] User message added to history"),this.voiceInterface.conversationExpanded&&this.renderConversationMessages()}}},{key:"updateLiveMessageRow",value:function(){var e=this.voiceInterface.shadowRoot.getElementById("liveMessageRow"),t=this.voiceInterface.shadowRoot.getElementById("liveMessageText"),A=null==e?void 0:e.querySelector(".message-avatar");if(e&&t)if(this.currentLiveMessage&&this.currentLiveMessage.content&&this.currentLiveMessage.content.trim()){A&&("user"===this.currentLiveMessage.role?(A.textContent="U",A.className="message-avatar user"):(A.innerHTML='<div class="orb"></div>',A.className="message-avatar assistant")),t.textContent=this.currentLiveMessage.content,e.style.display="flex";var n=t.querySelector(".typing-cursor")||document.createElement("span");n.className="typing-cursor",t.querySelector(".typing-cursor")||t.appendChild(n)}else e.style.display="none"}},{key:"clearConversationMessages",value:function(){this.conversationMessages=[],this.currentLiveMessage=null;var e=this.voiceInterface.shadowRoot.getElementById("liveMessageRow");e&&(e.style.display="none")}},{key:"renderConversationMessages",value:function(){var e=this,t=this.voiceInterface.shadowRoot.getElementById("conversationMessages");if(t){if(!this.conversationMessages||0===this.conversationMessages.length)return console.log("📝 [TRANSCRIPT] No messages to render"),void(t.innerHTML="");var A=function(e){return function(e){if(Array.isArray(e))return Fn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Fn(e,t);var A={}.toString.call(e).slice(8,-1);return"Object"===A&&e.constructor&&(A=e.constructor.name),"Map"===A||"Set"===A?Array.from(e):"Arguments"===A||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A)?Fn(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(this.conversationMessages);if(this.currentLiveMessage&&A.length>0){var n=A[A.length-1];n.role===this.currentLiveMessage.role&&n.content===this.currentLiveMessage.content&&(A=A.slice(0,-1))}console.log("📝 [TRANSCRIPT] Rendering",A.length,"messages (live message excluded)"),t.innerHTML=A.map(function(t){var A="user"===t.role;return'\n <div class="message-row '.concat(t.role,'">\n <div class="message-avatar ').concat(t.role,'">\n ').concat(A?"U":'<div class="orb"></div>','\n </div>\n <div class="message-bubble">').concat(e.escapeHtml(t.content),"</div>\n </div>\n ")}).join("");var o=this.voiceInterface.shadowRoot.getElementById("conversationHistory");o&&setTimeout(function(){o.scrollTop=o.scrollHeight},10)}else console.warn("📝 [TRANSCRIPT] conversationMessages container not found")}}])&&Un(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function En(e){return En="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},En(e)}function In(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Tn(n.key),n)}}function Tn(e){var t=function(e){if("object"!=En(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=En(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==En(t)?t:t+""}var Hn=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=t,this.config=t.config,this.shadowRoot=t.shadowRoot,this._textInjectTimeout=null,this._mobileTextInjectTimeout=null,this._statusClearTimeout=null,this._mobileStatusClearTimeout=null,this._originalHintText=null,this._originalMobileHintText=null,this._textInjectAckHandler=null},t=[{key:"t",value:function(e){return this.voiceInterface.t(e)}},{key:"setupTextInjectAckHandler",value:function(){var e,t=this;null!==(e=this.voiceInterface.sdk)&&void 0!==e&&e.voiceSDK&&(this._textInjectAckHandler&&this.voiceInterface.sdk.voiceSDK.off("textInjectAck",this._textInjectAckHandler),this._textInjectAckHandler=function(e){t.handleTextInjectAck(e)},this.voiceInterface.sdk.voiceSDK.on("textInjectAck",this._textInjectAckHandler))}},{key:"cleanup",value:function(){this._textInjectTimeout&&(clearTimeout(this._textInjectTimeout),this._textInjectTimeout=null),this._mobileTextInjectTimeout&&(clearTimeout(this._mobileTextInjectTimeout),this._mobileTextInjectTimeout=null),this._statusClearTimeout&&(clearTimeout(this._statusClearTimeout),this._statusClearTimeout=null),this._mobileStatusClearTimeout&&(clearTimeout(this._mobileStatusClearTimeout),this._mobileStatusClearTimeout=null),this._originalHintText=null,this._originalMobileHintText=null}},{key:"handleTextInjectAck",value:function(e){var t,A;this._textInjectTimeout&&(clearTimeout(this._textInjectTimeout),this._textInjectTimeout=null),this._mobileTextInjectTimeout&&(clearTimeout(this._mobileTextInjectTimeout),this._mobileTextInjectTimeout=null);var n=this.shadowRoot.getElementById("voiceTextInput"),o=this.shadowRoot.getElementById("voiceSendBtn");n&&(n.disabled=!1),o&&(o.disabled=!(null!=n&&null!==(t=n.value)&&void 0!==t&&t.trim()));var r=document.getElementById("mobileTextInput"),i=document.getElementById("mobileSendBtn");if(r&&(r.disabled=!1),i&&(i.disabled=!(null!=r&&null!==(A=r.value)&&void 0!==A&&A.trim())),e.success){var a,s=null===(a=e.message)||void 0===a?void 0:a.toLowerCase().includes("queued"),c=s?"queued":"success",l=s?"Message queued":"Message sent";this.voiceInterface.isMobile?this.showMobileTextInputStatus(c,l):this.showDesktopTextInputStatus(c,l)}else{var u=e.message||"Failed to send";this.voiceInterface.isMobile?this.showMobileTextInputStatus("error",u):this.showDesktopTextInputStatus("error",u)}}},{key:"sendDesktopTextMessage",value:function(){var e=this.shadowRoot.getElementById("voiceTextInput"),t=this.shadowRoot.getElementById("voiceSendBtn");if(e&&t){var A=e.value.trim();A&&this._sendTextMessage(A,e,t,!1)}else console.warn("VoiceInterface: Missing UI elements for desktop text send")}},{key:"sendMobileTextMessage",value:function(){var e=document.getElementById("mobileTextInput"),t=document.getElementById("mobileSendBtn");e&&t?this._sendTextMessage(e.value,e,t,!0):console.warn("VoiceInterface: Missing UI elements for mobile text send")}},{key:"_sendTextMessage",value:function(e,t,A,n){var o,r=this;if(this.voiceInterface.isActive&&null!==(o=this.voiceInterface.sdk)&&void 0!==o&&o.voiceSDK){var i=null==e?void 0:e.trim();if(i){t.value="",A&&(A.disabled=!0),this.showTextInputStatus(n?"mobile":"desktop","sending","Sending...");try{if(this.voiceInterface.sdk.voiceSDK.sendMessage({t:"text_inject",text:i})){var a=setTimeout(function(){n?r._mobileTextInjectTimeout=null:r._textInjectTimeout=null,t.disabled=!1,A&&(A.disabled=!1),r.showTextInputStatus(n?"mobile":"desktop","error","No response")},5e3);n?this._mobileTextInjectTimeout=a:this._textInjectTimeout=a,n?this.voiceInterface.addMobileMessage("user",i):this.voiceInterface.addConversationMessage("user",i)}else t.disabled=!1,A&&(A.disabled=!1),this.showTextInputStatus(n?"mobile":"desktop","error","Failed to send")}catch(e){console.error("Error sending text message:",e),t.disabled=!1,A&&(A.disabled=!1),this.showTextInputStatus(n?"mobile":"desktop","error","Error sending")}}else this.showTextInputStatus(n?"mobile":"desktop","error","Enter text first")}else console.warn("VoiceInterface: Cannot send text - call not active")}},{key:"showTextInputStatus",value:function(e,t,A){"mobile"===e?this.showMobileTextInputStatus(t,A):this.showDesktopTextInputStatus(t,A)}},{key:"showDesktopTextInputStatus",value:function(e,t){var A=this.shadowRoot.querySelector(".voice-input-hint");A&&(this._originalHintText||(this._originalHintText=A.textContent),A.classList.remove("voice-input-hint--sending","voice-input-hint--success","voice-input-hint--queued","voice-input-hint--error"),"sending"===e?(A.classList.add("voice-input-hint--sending"),A.textContent=t||"Sending..."):"success"===e?(A.classList.add("voice-input-hint--success"),A.textContent=t||"Sent",this.clearTextInputStatusAfterDelay(3e3)):"queued"===e?(A.classList.add("voice-input-hint--queued"),A.textContent=t||"Queued"):"error"===e?(A.classList.add("voice-input-hint--error"),A.textContent=t||"Error",this.clearTextInputStatusAfterDelay(3e3)):"clear"===e&&(A.textContent=this._originalHintText||this.t("voiceActive")||"Voice is still active • Type or speak",this._originalHintText=null))}},{key:"showMobileTextInputStatus",value:function(e,t){var A=document.querySelector(".mobile-input-hint");A&&(this._originalMobileHintText||(this._originalMobileHintText=A.textContent),A.classList.remove("mobile-input-hint--sending","mobile-input-hint--success","mobile-input-hint--queued","mobile-input-hint--error"),"sending"===e?(A.classList.add("mobile-input-hint--sending"),A.textContent=t||"Sending..."):"success"===e?(A.classList.add("mobile-input-hint--success"),A.textContent=t||"Sent",this.clearMobileTextInputStatusAfterDelay(3e3)):"queued"===e?(A.classList.add("mobile-input-hint--queued"),A.textContent=t||"Queued"):"error"===e?(A.classList.add("mobile-input-hint--error"),A.textContent=t||"Error",this.clearMobileTextInputStatusAfterDelay(3e3)):"clear"===e&&(A.textContent=this._originalMobileHintText||"🎙️ Voice is still active • Type or speak",this._originalMobileHintText=null))}},{key:"clearTextInputStatusAfterDelay",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;this._statusClearTimeout&&clearTimeout(this._statusClearTimeout),this._statusClearTimeout=setTimeout(function(){e.showDesktopTextInputStatus("clear"),e._statusClearTimeout=null},t)}},{key:"clearMobileTextInputStatusAfterDelay",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;this._mobileStatusClearTimeout&&clearTimeout(this._mobileStatusClearTimeout),this._mobileStatusClearTimeout=setTimeout(function(){e.showMobileTextInputStatus("clear"),e._mobileStatusClearTimeout=null},t)}}],t&&In(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Dn(e){return Dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dn(e)}function Pn(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,On(n.key),n)}}function On(e){var t=function(e){if("object"!=Dn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Dn(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Dn(t)?t:t+""}var Kn=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=t,this.config=t.config,this.shadowRoot=t.shadowRoot},t=[{key:"setupEventHandlers",value:function(e){var t=this,A=this.shadowRoot.getElementById("startCallBtn"),n=this.shadowRoot.getElementById("desktopEndCallBtn"),o=this.shadowRoot.getElementById("desktopMuteBtn"),r=this.shadowRoot.getElementById("desktopSpeakerBtn"),i=this.shadowRoot.getElementById("desktopEndCallBtnCompact"),a=this.shadowRoot.getElementById("desktopMuteBtnCompact"),s=this.shadowRoot.getElementById("desktopSpeakerBtnCompact");if(A&&(A.onclick=function(){return t.voiceInterface.startVoiceCall()}),n&&(n.onclick=function(){return t.voiceInterface.endVoiceCall()}),o&&(o.onclick=function(){return t.voiceInterface.toggleMute()}),r&&(r.onclick=function(){return t.voiceInterface.toggleSpeaker()}),i&&(i.onclick=function(){return t.voiceInterface.endVoiceCall()}),a&&(a.onclick=function(){return t.voiceInterface.toggleMute()}),s&&(s.onclick=function(){return t.voiceInterface.toggleSpeaker()}),!this.voiceInterface.isMobile){var c=this.shadowRoot.getElementById("voiceTextInput"),l=this.shadowRoot.getElementById("voiceSendBtn");c&&(c.addEventListener("input",function(){l&&(l.disabled=!c.value.trim())}),c.addEventListener("keypress",function(e){"Enter"===e.key&&!e.shiftKey&&c.value.trim()&&(e.preventDefault(),l&&!l.disabled&&l.click())})),l&&(l.onclick=function(){t.voiceInterface.sendDesktopTextMessage()});var u=this.shadowRoot.getElementById("conversationHeader");u&&u.addEventListener("click",function(){t.voiceInterface.transcript.toggleConversationPanel()})}}},{key:"setupMobileEventHandlers",value:function(){var e=this;if(this.voiceInterface.isMobile){var t=document.getElementById("mobileMuteBtn"),A=document.getElementById("mobileSpeakerBtn"),n=document.getElementById("mobileEndCallBtn"),o=document.getElementById("mobileTranscriptRow"),r=document.getElementById("mobileCloseTranscriptBtn"),i=document.getElementById("mobileTextInput"),a=document.getElementById("mobileSendBtn");t&&(t.onclick=function(){return e.voiceInterface.toggleMute()}),A&&(A.onclick=function(){return e.voiceInterface.toggleSpeaker()}),n&&(n.onclick=function(){return e.voiceInterface.endVoiceCall()}),o&&(o.onclick=function(){e.voiceInterface.expandMobileTranscript()}),r&&(r.onclick=function(){e.voiceInterface.collapseMobileTranscript()}),i&&(i.addEventListener("input",function(){a&&(a.disabled=!i.value.trim())}),i.addEventListener("keypress",function(e){"Enter"===e.key&&!e.shiftKey&&i.value.trim()&&(e.preventDefault(),a&&!a.disabled&&a.click())})),a&&(a.onclick=function(){e.voiceInterface.sendMobileTextMessage()})}}}],t&&Pn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Mn(e){return Mn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mn(e)}function Ln(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Rn(n.key),n)}}function Rn(e){var t=function(e){if("object"!=Mn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Mn(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Mn(t)?t:t+""}var _n=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=t,this.config=t.config,this.shadowRoot=t.shadowRoot,this._liveWaveformInterval=null},(t=[{key:"t",value:function(e){return this.voiceInterface.t(e)}},{key:"adjustSizesForContainer",value:function(){var e=this.shadowRoot.getElementById("voiceInterface");if(e){var t,A,n,o,r,i,a=e.clientHeight||e.offsetHeight||400,s=e.clientWidth||e.offsetWidth||400;a<=350?(t=80,A=80,n=48,o=54,r=6,i=12):a<=450?(t=100,A=100,n=56,o=62,r=8,i=14):a<=550?(t=120,A=120,n=64,o=70,r=10,i=16):a<=700?(t=140,A=140,n=72,o=78,r=12,i=18):(t=160,A=160,n=80,o=86,r=14,i=20);var c=this.shadowRoot.querySelector(".voice-avatar, .voice-avatar-active");c&&(c.style.width="".concat(t,"px"),c.style.height="".concat(t,"px"),c.style.fontSize="".concat(.5*t,"px"));var l=this.shadowRoot.querySelector(".voice-status-title"),u=this.shadowRoot.querySelector(".voice-status-subtitle");l&&(l.style.fontSize="".concat(i,"px")),u&&(u.style.fontSize="".concat(Math.max(10,i-4),"px"));var d=this.shadowRoot.querySelector(".voice-transcript");d&&(d.style.minHeight="".concat(A,"px"),d.style.maxHeight="".concat(A,"px"),d.style.height="".concat(A,"px"),d.style.width="min(360px, ".concat(s-40,"px)"),d.style.boxSizing="border-box");var p=this.shadowRoot.querySelector(".transcript-label");p&&(p.style.fontSize="".concat(Math.max(8,i-4),"px"));var h=this.shadowRoot.querySelector(".transcript-text");h&&(h.style.fontSize="".concat(Math.max(10,i-2),"px"));var g=this.shadowRoot.querySelector(".voice-text-input-area");if(g){var f=g.querySelector(".voice-input-wrapper"),m=g.querySelector(".voice-text-input"),v=g.querySelector(".voice-send-btn"),B=g.querySelector(".voice-input-hint");if(f&&v){var w=Math.max(32,Math.min(40,.7*n));v.style.width="".concat(w,"px"),v.style.height="".concat(w,"px");var y=v.querySelector("svg");if(y){var b=Math.max(14,Math.min(18,.45*w));y.style.width="".concat(b,"px"),y.style.height="".concat(b,"px")}}m&&(m.style.fontSize="".concat(Math.max(11,Math.min(14,i)),"px"),m.style.padding="".concat(Math.max(6,Math.min(10,Math.floor(.15*n))),"px 0")),B&&(B.style.fontSize="".concat(Math.max(8,Math.min(11,i-4)),"px"),B.style.marginTop="".concat(Math.max(3,Math.min(6,Math.floor(.6*r))),"px"))}this.shadowRoot.querySelectorAll(".voice-control-btn.secondary").forEach(function(e){e.style.width="".concat(n,"px"),e.style.height="".concat(n,"px");var t=e.querySelector("svg");if(t){var A=.65*n;t.style.setProperty("width","".concat(A,"px"),"important"),t.style.setProperty("height","".concat(A,"px"),"important"),t.style.setProperty("min-width","".concat(A,"px"),"important"),t.style.setProperty("min-height","".concat(A,"px"),"important")}});var C=this.shadowRoot.querySelector(".voice-control-btn.primary");if(C){C.style.width="".concat(o,"px"),C.style.height="".concat(o,"px");var x=C.querySelector("svg");if(x){var Q=.7*o;x.style.setProperty("width","".concat(Q,"px"),"important"),x.style.setProperty("height","".concat(Q,"px"),"important"),x.style.setProperty("min-width","".concat(Q,"px"),"important"),x.style.setProperty("min-height","".concat(Q,"px"),"important")}}var F=this.shadowRoot.querySelector(".start-call-btn");if(F){var U,S;a<=350?(U=48,S=14):a<=450?(U=52,S=15):a<=550?(U=58,S=17):a<=700?(U=62,S=18):(U=64,S=18),F.style.height="".concat(U,"px"),F.style.fontSize="".concat(S,"px");var k=F.querySelector("svg");if(k){var E=Math.max(22,.5*U);k.style.width="".concat(E,"px"),k.style.height="".concat(E,"px")}}}}},{key:"startDesktopWaveformAnimation",value:function(){if(!this.voiceInterface.isMobile){var e=this.shadowRoot.getElementById("desktopWaveform");e&&(e.classList.remove("paused"),this.updateDesktopStatus())}}},{key:"stopDesktopWaveformAnimation",value:function(){if(!this.voiceInterface.isMobile){var e=this.shadowRoot.getElementById("desktopWaveform");e&&e.classList.add("paused")}}},{key:"updateDesktopStatus",value:function(){if(!this.voiceInterface.isMobile){var e=this.shadowRoot.getElementById("compactStatusText")||this.shadowRoot.getElementById("desktopStatusText");if(e){var t;t=this.config.statusText||(this.voiceInterface.isActive&&!this.voiceInterface.isMicMuted?this.t("listening"):this.t("connected")),e.textContent=t;var A=this.shadowRoot.getElementById("desktopStatusText");A&&A!==e&&(A.textContent=t)}}}},{key:"updateLiveWaveform",value:function(e){if(!this.voiceInterface.isMobile){var t=this.shadowRoot.getElementById("desktopLiveWaveform");t&&t.querySelectorAll(".desktop-live-bar").forEach(function(t,A){if(e){var n=40*Math.random()+8;t.style.height="".concat(n,"px")}else t.style.height="8px"})}}},{key:"showError",value:function(e){var t=this.shadowRoot.getElementById("transcriptText");t&&(t.textContent="".concat(this.t("error"),": ").concat(e),t.classList.remove("empty"))}},{key:"showDomainError",value:function(){var e=this;console.log("🚫 Showing domain error in widget UI...");var t=this.shadowRoot.getElementById("voiceIdleState");if(t){var A=t.querySelector(".voice-status-title"),n=t.querySelector(".voice-status-subtitle"),o=t.querySelector("#startCallBtn"),r=this.t("domainNotValidated"),i=this.t("domainErrorMessage");console.log("🚫 Domain error title:",r),console.log("🚫 Domain error message:",i),A?(A.textContent=r,A.style.color="#991B1B",A.style.fontSize="20px",A.style.fontWeight="600",A.style.marginLeft="20px",A.style.marginRight="20px",A.style.textAlign="center",console.log("✅ Updated statusTitle with domain error")):console.warn("⚠️ .voice-status-title element not found"),n?(n.textContent=i,n.style.color="#991B1B",n.style.fontSize="16px",n.style.marginLeft="20px",n.style.marginRight="20px",n.style.marginTop="12px",n.style.textAlign="center",n.style.lineHeight="1.5",console.log("✅ Updated statusSubtitle with domain error")):console.warn("⚠️ .voice-status-subtitle element not found"),o?(o.style.display="none",console.log("✅ Hidden start call button")):console.warn("⚠️ #startCallBtn element not found");var a=t.querySelector("#domainErrorBackBtn");if(a)a.style.display="flex";else{(a=document.createElement("button")).id="domainErrorBackBtn",a.className="domain-error-back-btn",a.innerHTML='\n <svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" style="margin-right: 8px;">\n <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/>\n </svg>\n <span>'.concat(this.t("back")||"Back","</span>\n ");var s=t.querySelector(".voice-status");s&&s.parentNode?s.parentNode.insertBefore(a,s.nextSibling):n&&n.parentNode?n.parentNode.insertBefore(a,n.nextSibling):t.appendChild(a),a.style.cssText="\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 24px auto 0;\n padding: 12px 24px;\n background-color: #7C3AED;\n color: white;\n border: none;\n border-radius: 8px;\n font-size: 16px;\n font-weight: 500;\n cursor: pointer;\n transition: background-color 0.2s;\n max-width: 200px;\n ",a.addEventListener("mouseenter",function(){a.style.backgroundColor="#6D28D9"}),a.addEventListener("mouseleave",function(){a.style.backgroundColor="#7C3AED"}),a.onclick=function(){console.log("🔙 Domain error back button clicked"),e.voiceInterface.isShowingDomainError=!1,e.voiceInterface.resetConnectingState(),a&&a.parentNode&&a.parentNode.removeChild(a),e.voiceInterface.config.onShowLanding&&"function"==typeof e.voiceInterface.config.onShowLanding&&e.voiceInterface.config.onShowLanding()},console.log("✅ Created domain error back button")}t.style.display="flex",console.log("✅ Domain error displayed in widget UI");var c=this.shadowRoot.getElementById("transcriptText");if(c){var l=this.t("domainNotValidated"),u=this.t("domainErrorMessage");c.innerHTML='<div style="font-weight: 600; font-size: 16px; margin-bottom: 8px; color: #991B1B;">'.concat(l,'</div><div style="font-size: 14px; color: #991B1B; line-height: 1.5;">').concat(u,"</div>"),c.classList.remove("empty")}}else console.warn("⚠️ voiceIdleState element not found, cannot show domain error")}},{key:"showBackButtonWarning",value:function(){var e=this.shadowRoot.getElementById("transcriptText"),t=this.shadowRoot.getElementById("liveTextCollapsed");if(e){var A=e.textContent,n=e.innerHTML;e.innerHTML='\n <div style="font-weight: 600; font-size: 16px; margin-bottom: 8px; color: #92400e; display: flex; align-items: center; gap: 8px;">\n <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="flex-shrink: 0;">\n <path d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/>\n </svg>\n Please end the call first\n </div>\n <div style="font-size: 14px; color: #92400e; line-height: 1.5;">\n You need to end the current call before going back.\n </div>\n ',e.classList.remove("empty"),setTimeout(function(){e&&(e.innerHTML=n,e.textContent=A,A&&""!==A.trim()||e.classList.add("empty"))},5e3)}else if(t){var o=t.textContent;t.innerHTML='\n <span style="color: #92400e; font-weight: 600;">⚠️ Please end the call first - You need to end the current call before going back.</span>\n ',setTimeout(function(){t&&(t.textContent=o)},5e3)}}},{key:"startLiveWaveformInterval",value:function(){var e=this;this.voiceInterface.isMobile||(this._liveWaveformInterval&&clearInterval(this._liveWaveformInterval),this._liveWaveformInterval=setInterval(function(){e.updateLiveWaveform(e.voiceInterface.isActive&&!e.voiceInterface.isMicMuted)},100))}},{key:"stopLiveWaveformInterval",value:function(){this._liveWaveformInterval&&(clearInterval(this._liveWaveformInterval),this._liveWaveformInterval=null)}},{key:"cleanup",value:function(){this.stopLiveWaveformInterval(),this.stopDesktopWaveformAnimation()}}])&&Ln(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Vn(e){return Vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vn(e)}function jn(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Nn(n.key),n)}}function Nn(e){var t=function(e){if("object"!=Vn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Vn(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Vn(t)?t:t+""}var Gn=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=t,this.config=t.config,this.waveformBars=[.3,.5,.8,.4,.6,.9,.5,.7],this.waveformInterval=null,this.isTranscriptExpanded=!1,this.voiceInterface.messages||(this.voiceInterface.messages=[])},(t=[{key:"t",value:function(e){return this.voiceInterface.t(e)}},{key:"createMobileMinimizedBar",value:function(){var e=document.getElementById("mobile-voice-call-bar-container");if(e&&e.remove(),!document.getElementById("mobile-voice-call-bar-styles")){var t=document.createElement("style");t.id="mobile-voice-call-bar-styles",t.textContent=this.voiceInterface.styles.generateMobileCSS(),document.head.appendChild(t)}var A=document.createElement("div");A.id="mobile-voice-call-bar-container",A.innerHTML='\n \x3c!-- Duration Badge --\x3e\n <div class="mobile-duration-badge" id="mobileDurationBadge">\n <div class="mobile-duration-dot"></div>\n <span id="mobileDurationText">00:00</span>\n </div>\n \n \x3c!-- Main Bar --\x3e\n <div class="mobile-voice-bar">\n \x3c!-- Top Row: Status, Waveform, Controls --\x3e\n <div class="mobile-top-row">\n \x3c!-- Status Indicator --\x3e\n <div class="mobile-status-indicator">\n <div class="mobile-status-dot" id="mobileStatusDot"></div>\n <span class="mobile-status-text" id="mobileStatusText">'.concat(this.t("listening"),'</span>\n </div>\n \n \x3c!-- Centered Waveform --\x3e\n <div class="mobile-waveform-center" id="mobileWaveform">\n ').concat(Array(8).fill(0).map(function(e,t){return'<div class="mobile-waveform-bar" data-index="'.concat(t,'"></div>')}).join(""),'\n </div>\n \n \x3c!-- Controls --\x3e\n <div class="mobile-controls">\n <button class="mobile-control-btn" id="mobileMuteBtn" aria-label="Mute microphone">\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-mic-icon">\n <path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2"/>\n <line x1="12" x2="12" y1="19" y2="22"/>\n </svg>\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-mic-off-icon" style="display: none;">\n <line x1="2" x2="22" y1="2" y2="22"/>\n <path d="M18.89 13.23A7.12 7.12 0 0 0 19 12v-2"/>\n <path d="M5 10v2a7 7 0 0 0 12 5"/>\n <path d="M15 9.34V5a3 3 0 0 0-5.68-1.33"/>\n <path d="M9 9v3a3 3 0 0 0 5.12 2.12"/>\n <line x1="12" x2="12" y1="19" y2="22"/>\n </svg>\n </button>\n \n <button class="mobile-control-btn" id="mobileSpeakerBtn" aria-label="Toggle speaker">\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-speaker-icon">\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/>\n <path d="M15.54 8.46a5 5 0 0 1 0 7.07"/>\n </svg>\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-speaker-off-icon" style="display: none;">\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/>\n <line x1="22" x2="16" y1="9" y2="15"/>\n <line x1="16" x2="22" y1="9" y2="15"/>\n </svg>\n </button>\n \n <button class="mobile-end-call-btn" id="mobileEndCallBtn" aria-label="End call">\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"/>\n <line x1="22" x2="2" y1="2" y2="22"/>\n </svg>\n </button>\n </div>\n </div>\n \n \x3c!-- Bottom Row: Transcript (expandable) --\x3e\n <button class="mobile-transcript-row" id="mobileTranscriptRow">\n <p class="mobile-transcript-text" id="mobileTranscriptText">').concat(this.t("transcriptWillAppear"),'</p>\n <div class="mobile-transcript-footer">\n <span class="mobile-expand-hint">tap to expand & type</span>\n <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="opacity: 0.6;">\n <path d="M7 17L17 7M17 7H7M17 7V17"/>\n </svg>\n </div>\n </button>\n </div>\n \n \x3c!-- Expanded Transcript Overlay --\x3e\n <div class="mobile-transcript-overlay" id="mobileTranscriptOverlay" style="display: none;">\n <div class="mobile-expanded-transcript" id="mobileExpandedTranscript">\n \x3c!-- Header --\x3e\n <div class="mobile-transcript-header">\n <div class="mobile-header-left">\n <div class="mobile-header-status">\n <div class="mobile-header-status-dot"></div>\n <span class="mobile-header-status-text" id="mobileHeaderStatusText">').concat(this.t("listening"),'</span>\n <span class="mobile-header-duration" id="mobileHeaderDuration">00:00</span>\n </div>\n <span class="mobile-transcript-label">CONVERSATION</span>\n </div>\n <button class="mobile-close-transcript-btn" id="mobileCloseTranscriptBtn">\n <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 6L6 18M6 6l12 12"/>\n </svg>\n </button>\n </div>\n \n \x3c!-- Messages Container --\x3e\n <div class="mobile-messages-container" id="mobileMessagesContainer">\n \x3c!-- Messages will be dynamically added here --\x3e\n </div>\n \n \x3c!-- Text Input Area --\x3e\n <div class="mobile-input-area">\n <div class="mobile-input-wrapper">\n <input\n type="text"\n placeholder="Type a message..."\n id="mobileTextInput"\n class="mobile-text-input"\n />\n <button class="mobile-send-btn" id="mobileSendBtn" disabled>\n <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"/>\n </svg>\n </button>\n </div>\n <p class="mobile-input-hint">🎙️ ').concat(this.t("voiceActive")||"Voice is still active"," • ").concat(this.t("typeOrSpeak")||"Type or speak","</p>\n </div>\n </div>\n </div>\n "),document.body.appendChild(A);var n=document.getElementById("mobileMuteBtn"),o=document.getElementById("mobileSpeakerBtn"),r=document.getElementById("mobileEndCallBtn");if(n){n.style.cssText="\n width: 32px !important;\n height: 32px !important;\n min-width: 32px !important;\n min-height: 32px !important;\n max-width: 32px !important;\n max-height: 32px !important;\n aspect-ratio: 1 !important;\n border-radius: 50% !important;\n overflow: hidden !important;\n padding: 0 !important;\n margin: 0 !important;\n box-sizing: border-box !important;\n ";var i=n.querySelector(".mobile-mic-icon"),a=n.querySelector(".mobile-mic-off-icon");i&&(i.style.cssText="\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n width: 15px !important;\n height: 15px !important;\n margin: 0 !important;\n padding: 0 !important;\n position: absolute !important;\n top: 50% !important;\n left: 50% !important;\n transform: translate(-50%, -50%) !important;\n "),a&&(a.style.cssText="\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n position: absolute !important;\n top: 50% !important;\n left: 50% !important;\n transform: translate(-50%, -50%) !important;\n ")}if(o){o.style.cssText="\n width: 32px !important;\n height: 32px !important;\n min-width: 32px !important;\n min-height: 32px !important;\n max-width: 32px !important;\n max-height: 32px !important;\n aspect-ratio: 1 !important;\n border-radius: 50% !important;\n overflow: hidden !important;\n padding: 0 !important;\n margin: 0 !important;\n box-sizing: border-box !important;\n ";var s=o.querySelector(".mobile-speaker-icon"),c=o.querySelector(".mobile-speaker-off-icon");s&&(s.style.cssText="\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n width: 15px !important;\n height: 15px !important;\n margin: 0 !important;\n padding: 0 !important;\n position: absolute !important;\n top: 50% !important;\n left: 50% !important;\n transform: translate(-50%, -50%) !important;\n "),c&&(c.style.cssText="\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n position: absolute !important;\n top: 50% !important;\n left: 50% !important;\n transform: translate(-50%, -50%) !important;\n ")}if(r){r.style.cssText="\n width: 36px !important;\n height: 36px !important;\n min-width: 36px !important;\n min-height: 36px !important;\n max-width: 36px !important;\n max-height: 36px !important;\n aspect-ratio: 1 !important;\n border-radius: 50% !important;\n overflow: hidden !important;\n padding: 0 !important;\n margin: 0 !important;\n box-sizing: border-box !important;\n ";var l=r.querySelector("svg");l&&(l.style.cssText="\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n width: 15px !important;\n height: 15px !important;\n margin: 0 !important;\n padding: 0 !important;\n ")}this.voiceInterface.setupMobileEventHandlers()}},{key:"removeMobileMinimizedBar",value:function(){var e=document.getElementById("mobile-voice-call-bar-container");e&&e.remove()}},{key:"expandMobileTranscript",value:function(){var e=document.getElementById("mobileTranscriptOverlay");if(e){e.style.display="flex",this.isTranscriptExpanded=!0;var t=document.getElementById("mobileTextInput");t&&setTimeout(function(){return t.focus()},100);var A=document.getElementById("mobileMessagesContainer");A&&setTimeout(function(){A.scrollTop=A.scrollHeight},100)}}},{key:"collapseMobileTranscript",value:function(){var e=document.getElementById("mobileTranscriptOverlay");e&&(e.style.display="none",this.isTranscriptExpanded=!1)}},{key:"updateMobileStatus",value:function(e){var t=document.getElementById("mobileStatusText"),A=document.getElementById("mobileHeaderStatusText"),n=document.getElementById("mobileStatusDot");if(t||A){var o=this.config.statusText,r="",i="#6b7280";o?(r=o,i=this.config.statusDotColor||"#10b981"):"connecting"===e?(r=this.t("connecting")||"Connecting...",i="#3b82f6"):"listening"===e||"recording"===e?(r=this.t("listening")||"Listening...",i="#22c55e"):"speaking"===e?(r=this.t("speaking")||"Speaking...",i="#a855f7"):(r=this.t("paused")||"Paused",i="#facc15"),t&&(t.textContent=r),A&&(A.textContent=r),n&&(n.style.backgroundColor=i,n.style.boxShadow="paused"===e?"none":"0 0 8px ".concat(i))}}},{key:"addMobileMessage",value:function(e,t){this.voiceInterface.messages.push({type:e,text:t});var A=document.getElementById("mobileMessagesContainer");if(A){var n=document.createElement("div");n.className="mobile-message-bubble ".concat(e),n.textContent=t,A.appendChild(n),A.scrollTop=A.scrollHeight}}},{key:"startWaveformAnimation",value:function(){this.waveformInterval&&clearInterval(this.waveformInterval);var e=document.getElementById("mobileWaveform");e&&(this.waveformInterval=setInterval(function(){e.querySelectorAll(".mobile-waveform-bar").forEach(function(e,t){var A=60*Math.random()+10;e.style.height="".concat(A,"px")})},100))}},{key:"stopWaveformAnimation",value:function(){this.waveformInterval&&(clearInterval(this.waveformInterval),this.waveformInterval=null);var e=document.getElementById("mobileWaveform");e&&e.querySelectorAll(".mobile-waveform-bar").forEach(function(e){e.style.height="10px"})}},{key:"cleanup",value:function(){this.stopWaveformAnimation(),this.collapseMobileTranscript(),this.removeMobileMinimizedBar(),this.voiceInterface.messages=[]}}])&&jn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Wn(e){return Wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wn(e)}function zn(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Xn(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Xn(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Xn(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Xn(u,"constructor",c),Xn(c,"constructor",s),s.displayName="GeneratorFunction",Xn(c,o,"GeneratorFunction"),Xn(u),Xn(u,o,"Generator"),Xn(u,n,function(){return this}),Xn(u,"toString",function(){return"[object Generator]"}),(zn=function(){return{w:r,m:d}})()}function Xn(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Xn=function(e,t,A,n){function r(t,A){Xn(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},Xn(e,t,A,n)}function Jn(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function Yn(e){return function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){Jn(r,n,o,i,a,"next",e)}function a(e){Jn(r,n,o,i,a,"throw",e)}i(void 0)})}}function qn(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Zn(n.key),n)}}function Zn(e){var t=function(e){if("object"!=Wn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Wn(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Wn(t)?t:t+""}var $n=function(){return e=function e(t){var A;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=t,this.audioStream=null,this.callStartTime=null,this.callTimerInterval=null,this.sdk=null,this.isActive=!1,this.isShowingDomainError=!1,this.shadowRoot=t.shadowRoot||document,this.textSDK=t.textSDK||null,this.deviceInfo=An(),this.isMobile=this.deviceInfo.isMobile,this.conversationExpanded=!1,this.isMicMuted=!1,this.isSpeakerMuted=!1;var n=t.visualAssistant||(null===(A=t.agentSettingsOverride)||void 0===A?void 0:A.visualAssistant);this.sdk=new fr({agentId:t.agentId,appId:t.appId,signedUrl:t.signedUrl,agentSettingsOverride:t.agentSettingsOverride,visualAssistant:n,variables:t.variables||{},language:t.language||"en",outputContainer:t.outputContainer,outputEncoding:t.outputEncoding,outputSampleRate:t.outputSampleRate,outputChannels:t.outputChannels,outputBitDepth:t.outputBitDepth,onConversationStart:t.onConversationStart,onConversationEnd:t.onConversationEnd,onBargeIn:t.onBargeIn,onAudioStartPlaying:t.onAudioStartPlaying,onAudioStoppedPlaying:t.onAudioStoppedPlaying,onSubtitleDisplay:t.onSubtitleDisplay}),this.templates=new wn(this),this.styles=new xn(this),this.transcript=new kn(this),this.textHandlers=new Hn(this),this.handlers=new Kn(this),this.desktop=new _n(this),this.mobile=new Gn(this),this.setupSDKEventHandlers(),this.checkAndHandleResume()},t=[{key:"getVoiceSDK",value:function(){var e;return(null===(e=this.sdk)||void 0===e?void 0:e.voiceSDK)||null}},{key:"checkAndHandleResume",value:function(){if(void 0!==this._resumeInfo)return console.log("🔄 [VOICE INTERFACE] Returning cached resume info:",this._resumeInfo),this._resumeInfo;var e=this.sdk.checkResumeBeforeConnect();return this._resumeInfo=e,e?(console.log("🔄 [WIDGET] Auto-resuming call:",e),console.log(" From:",e.fromPage,"→ To:",e.toPage),this.config.onResume&&this.config.onResume(e),e):null}},{key:"setupSDKEventHandlers",value:function(){var e=this;this.sdk.onTranscript=function(t){console.log("📝 [VOICE INTERFACE] onTranscript called with text:",t),e.updateTranscript(t)},this.sdk.onPlaybackStarted=function(){console.log("🔊 [VOICE INTERFACE] Playback started - updating status to listening"),e.isMobile?e.updateMobileStatus("listening"):e.updateDesktopStatus()},this.sdk.onAgentSpeaking=function(t){var A=e.shadowRoot.getElementById("voiceAvatarActive");A&&(t?(A.classList.add("speaking"),e.isMobile?(e.updateMobileStatus("speaking"),e.startWaveformAnimation()):(e.updateDesktopStatus(),e.startDesktopWaveformAnimation())):(A.classList.remove("speaking"),e.isMobile?(e.updateMobileStatus("listening"),e.startWaveformAnimation()):(e.updateDesktopStatus(),e.startDesktopWaveformAnimation())))},this.sdk.onDisconnected=function(){var t=Yn(zn().m(function t(A){return zn().w(function(t){for(;;)switch(t.n){case 0:if(console.log("🔌 WebSocket disconnected, hanging up call..."),!A||!(1008===A.code&&A.reason&&(A.reason.includes("Domain not whitelisted")||A.reason.includes("domain")||A.reason.includes("whitelist"))||1008===A.code&&A.reason&&A.reason.includes("localhost"))){t.n=2;break}return console.error("❌ Domain not whitelisted - WebSocket closed:",A.code,A.reason),t.n=1,e.endCallOnServerRejection();case 1:t.n=3;break;case 2:e.isActive&&(e.isActive=!1,e.endVoiceCall());case 3:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}(),this.sdk.onError=function(){var t=Yn(zn().m(function t(A){return zn().w(function(t){for(;;)switch(t.n){case 0:if(!A||!("DOMAIN_NOT_WHITELISTED"===A.message||A.message&&A.message.includes("Domain not whitelisted"))){t.n=2;break}return console.error("❌ Voice SDK Error: Domain not whitelisted:",A),t.n=1,e.endCallOnServerRejection();case 1:return t.a(2);case 2:if(!A.isServerRejection&&"ServerRejected"!==A.name){t.n=3;break}return t.a(2);case 3:console.error("❌ Voice SDK Error:",A),e.showError(A.message||A);case 4:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}()}},{key:"setupTextInjectAckHandler",value:function(){return this.textHandlers.setupTextInjectAckHandler()}},{key:"handleTextInjectAck",value:function(e){return this.textHandlers.handleTextInjectAck(e)}},{key:"sendDesktopTextMessage",value:function(){return this.textHandlers.sendDesktopTextMessage()}},{key:"sendMobileTextMessage",value:function(){return this.textHandlers.sendMobileTextMessage()}},{key:"t",value:function(e){var t,A,n=this.config.language||"en";return((null===(t=this.config.translations)||void 0===t?void 0:t[n])||(null===(A=this.config.translations)||void 0===A?void 0:A.en)||{})[e]||e}},{key:"getText",value:function(e,t){return void 0!==this.config[e]&&null!==this.config[e]?this.config[e]:this.t(t)}},{key:"getTooltip",value:function(e){var t,A=null===(t=this.config.tooltips)||void 0===t?void 0:t[e];return null!=A?A:{mute:this.t("mute"),speaker:this.t("speaker"),endCall:this.t("endCall")}[e]||""}},{key:"_updateTimerElements",value:function(e,t){var A=this.shadowRoot.getElementById("voiceTimer");A&&(A.textContent=e);var n=this.shadowRoot.getElementById("desktopTimerText"),o=this.shadowRoot.getElementById("compactTimerText");if(n&&(n.textContent=e),o&&(o.textContent=e),!o&&!n&&t<2e3){console.warn("⚠️ Timer elements not found - compactTimerText:",!!o,"desktopTimerText:",!!n,"elapsed:",t);var r=this.shadowRoot.querySelectorAll('[id*="Timer"], [id*="timer"]');console.log("Found timer-like elements:",Array.from(r).map(function(e){return e.id}))}if(this.isMobile){var i=document.getElementById("mobileDurationText"),a=document.getElementById("mobileHeaderDuration");i&&(i.textContent=e),a&&(a.textContent=e)}}},{key:"generateHTML",value:function(){return this.templates.generateHTML()}},{key:"generateMobileHTML",value:function(){return this.templates.generateMobileHTML()}},{key:"generateCSS",value:function(){return this.styles.generateCSS()}},{key:"setupEventHandlers",value:function(e){this.handlers.setupEventHandlers(e)}},{key:"setupMobileEventHandlers",value:function(){return this.handlers.setupMobileEventHandlers()}},{key:"adjustSizesForContainer",value:function(){return this.desktop.adjustSizesForContainer()}},{key:"startDesktopWaveformAnimation",value:function(){return this.desktop.startDesktopWaveformAnimation()}},{key:"stopDesktopWaveformAnimation",value:function(){return this.desktop.stopDesktopWaveformAnimation()}},{key:"updateDesktopStatus",value:function(){return this.desktop.updateDesktopStatus()}},{key:"updateLiveWaveform",value:function(e){return this.desktop.updateLiveWaveform(e)}},{key:"showError",value:function(e){return this.desktop.showError(e)}},{key:"showDomainError",value:function(){return this.desktop.showDomainError()}},{key:"startVoiceCall",value:(o=Yn(zn().m(function e(){var t,A=this;return zn().w(function(e){for(;;)switch(e.n){case 0:if(!this.isActive){e.n=1;break}return console.log("⚠️ Voice call already active"),e.a(2);case 1:return console.log("🎤 Starting voice call..."),e.n=2,nn();case 2:if(t=e.v,console.log("📋 Current permission state: ".concat(t)),"denied"!==t){e.n=3;break}throw console.log("🚫 Permission is denied, showing blocked modal..."),this.resetConnectingState(),An(),gn(function(){console.log("Blocked modal closed")}),new Error("Microphone permission denied");case 3:if("prompt"!==t&&"unknown"!==t){e.n=4;break}return console.log("📋 Permission is in prompt state, showing pre-prompt modal..."),e.a(2,new Promise(function(e,t){hn(Yn(zn().m(function n(){var o;return zn().w(function(n){for(;;)switch(n.p=n.n){case 0:return console.log("✅ Pre-prompt accepted, proceeding with voice call..."),n.p=1,n.n=2,A.proceedWithVoiceCall();case 2:e(),n.n=4;break;case 3:n.p=3,o=n.v,t(o);case 4:return n.a(2)}},n,null,[[1,3]])})),function(){console.log("❌ Pre-prompt cancelled"),A.resetConnectingState(),t(new Error("Call cancelled by user"))})}));case 4:return e.n=5,this.proceedWithVoiceCall();case 5:return e.a(2)}},e,this)})),function(){return o.apply(this,arguments)})},{key:"proceedWithVoiceCall",value:(n=Yn(zn().m(function e(){var t,A,n,o,r,i,a,s,c,l,u,d,p,h,g,f,m,v,B,w,y,b,C,x,Q,F,U,S,k,E,I,T,H,D,P,O,K,M,L,R,_,V,j,N,G,W=this;return zn().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,null!==this._resumeInfo&&void 0!==this._resumeInfo?console.log("🔄 Resume call detected - preserving conversation history"):(console.log("🆕 New call detected - clearing conversation history"),this.transcript.clearConversationMessages(),this.conversationExpanded=!1,t=this.shadowRoot.getElementById("desktopConversationPanel"),A=this.shadowRoot.getElementById("conversationHeader"),n=this.shadowRoot.getElementById("conversationToggleText"),o=this.shadowRoot.querySelector(".voice-interface"),r=this.shadowRoot.getElementById("desktopVoiceSection"),i=this.shadowRoot.getElementById("compactVoiceSection"),t&&(t.classList.remove("expanded"),t.classList.add("collapsed")),A&&A.classList.remove("expanded"),n&&(n.textContent="Show history"),o&&o.classList.remove("expanded"),r&&(r.style.display=""),i&&(i.style.display="none")),!this.isMobile){e.n=5;break}return(a=this.shadowRoot.getElementById("voiceIdleState"))&&(a.style.display="none"),(s=this.shadowRoot.getElementById("text-chat-panel"))?(s.classList.remove("open"),s.style.display="none",console.log("✅ Widget panel hidden (waiting for permission)")):(c=document.getElementById("text-chat-panel"))&&(c.classList.remove("open"),c.style.display="none",console.log("✅ Widget panel hidden (waiting for permission, fallback)")),console.log("📱 Mobile device - requesting mic permission before connecting..."),e.p=1,l=this.config.outputSampleRate||44100,e.n=2,navigator.mediaDevices.getUserMedia({audio:{sampleRate:l,channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});case 2:e.v.getTracks().forEach(function(e){return e.stop()}),console.log("✅ Mobile: Microphone permission granted - proceeding with connection"),(u=this.shadowRoot.getElementById("text-chat-button"))?(u.style.display="none",console.log("✅ Floating button hidden (permission granted)")):(d=document.getElementById("text-chat-button"))&&(d.style.display="none",console.log("✅ Floating button hidden (permission granted, fallback)")),e.n=4;break;case 3:return e.p=3,_=e.v,console.error("❌ Mobile: Permission denied before connecting:",_),this.resetConnectingState(),document.getElementById("mobile-voice-call-bar-container")&&this.removeMobileMinimizedBar(),(p=this.shadowRoot.getElementById("text-chat-button"))?p.style.display="":(h=document.getElementById("text-chat-button"))&&(h.style.display=""),(g=this.shadowRoot.getElementById("voiceIdleState"))&&(g.style.display="flex"),(f=this.shadowRoot.getElementById("text-chat-panel"))?f.style.display="":(m=document.getElementById("text-chat-panel"))&&(m.style.display=""),An(),gn(function(){W.resetUIState()}),e.a(2);case 4:e.n=6;break;case 5:this.resetConnectingState(),v=this.shadowRoot.getElementById("voiceIdleState"),B=this.shadowRoot.getElementById("voiceActiveState"),v&&(v.style.display="none"),B&&(B.style.display="flex");case 6:if(w=this.shadowRoot.getElementById("voiceInterface"),setTimeout(function(){return W.adjustSizesForContainer()},50),w&&(w.scrollTop=0),y=this.config.signedUrl||(this.config.agentId&&this.config.appId?"wss://speech.talktopc.com/ws/conv?agentId=".concat(this.config.agentId,"&appId=").concat(this.config.appId):null)){e.n=7;break}throw new Error("signedUrl or agentId+appId required for voice calls");case 7:if(console.log("🔗 Got signed URL:",y),!this.sdk||!this.sdk.isConnected){e.n=11;break}return console.log("🔄 SDK already connected, disconnecting for clean retry..."),e.p=8,this.sdk.disconnect(),e.n=9,new Promise(function(e){return setTimeout(e,100)});case 9:e.n=11;break;case 10:e.p=10,V=e.v,console.warn("Warning: Error disconnecting existing connection:",V);case 11:return e.n=12,this.sdk.connect(y);case 12:b=e.v,console.log("✅ Connected to WebSocket, connected:",b),this.setupTextInjectAckHandler(),C=!1,x=this.sdk.onError,Q=this.sdk.onDisconnected,this.sdk.onError=function(e){e&&("DOMAIN_NOT_WHITELISTED"===e.message||e.message&&e.message.includes("Domain not whitelisted"))&&(C=!0,console.log("🚫 Server rejected connection before starting audio capture")),x&&x.call(W.sdk,e)},this.sdk.onDisconnected=function(e){e&&1008===e.code&&e.reason&&(e.reason.includes("Domain not whitelisted")||e.reason.includes("domain")||e.reason.includes("whitelist"))&&(C=!0,console.log("🚫 Server disconnected due to domain error before starting audio capture")),Q&&Q.call(W.sdk,e)},F=0;case 13:if(!(F<50)){e.n=17;break}if(!C){e.n=14;break}throw console.log("🚫 Server rejected connection, aborting audio capture"),new Error("DOMAIN_NOT_WHITELISTED");case 14:if(!this.sdk.isConnected){e.n=15;break}if(!(this.sdk.voiceSDK&&this.sdk.voiceSDK.isConnected&&this.sdk.voiceSDK.websocket&&this.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN)){e.n=15;break}return e.a(3,17);case 15:return e.n=16,new Promise(function(e){return setTimeout(e,100)});case 16:F++,e.n=13;break;case 17:if(!C){e.n=18;break}throw this.sdk.onError=x,this.sdk.onDisconnected=Q,console.log("🚫 Server rejected connection, aborting audio capture"),new Error("DOMAIN_NOT_WHITELISTED");case 18:if(this.sdk.isConnected&&this.sdk.voiceSDK&&this.sdk.voiceSDK.isConnected&&this.sdk.voiceSDK.websocket&&this.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN){e.n=19;break}throw this.sdk.onError=x,this.sdk.onDisconnected=Q,console.warn("⚠️ Connection lost before starting audio capture"),new Error("Connection lost before starting audio capture");case 19:if(this.sdk.onError=x,this.sdk.onDisconnected=Q,!(this.sdk.isConnected&&this.sdk.voiceSDK&&this.sdk.voiceSDK.websocket&&this.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN)){e.n=30;break}return console.log("✅ WebSocket ready, starting listening..."),e.p=20,e.n=21,this.sdk.startListening();case 21:if(this.sdk.isConnected&&this.sdk.voiceSDK&&this.sdk.voiceSDK.isConnected&&this.sdk.voiceSDK.websocket&&this.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN){e.n=26;break}if(null===(U=this.sdk.voiceSDK)||void 0===U||!U.isRecording){e.n=25;break}return e.p=22,e.n=23,this.sdk.voiceSDK.stopRecording();case 23:e.n=25;break;case 24:e.p=24,e.v;case 25:throw(S=new Error("Connection lost - server may have rejected the call")).name="ServerRejected",S.isServerRejection=!0,S;case 26:console.log("🎤 Started listening - permission granted"),this.isActive=!0,this.isMobile?(document.getElementById("mobile-voice-call-bar-container")?console.log("📱 Mobile device - bar already exists, updating status"):(console.log("📱 Mobile device - permission granted, creating minimized bar"),this.createMobileMinimizedBar()),0===this.messages.length&&this.messages.push({type:"assistant",text:this.t("transcriptWillAppear")}),this.startWaveformAnimation()):(this.startDesktopWaveformAnimation(),this.desktop.startLiveWaveformInterval()),e.n=29;break;case 27:if(e.p=27,!(j=e.v).isServerRejection&&"ServerRejected"!==j.name){e.n=28;break}throw this.resetConnectingState(),j;case 28:throw console.error("❌ Failed to start listening - permission denied or error:",j),this.resetConnectingState(),this.isMobile&&(document.getElementById("mobile-voice-call-bar-container")&&this.removeMobileMinimizedBar(),(k=this.shadowRoot.getElementById("voiceIdleState"))&&(k.style.display="flex"),(E=this.shadowRoot.getElementById("text-chat-panel"))?E.style.display="":(I=document.getElementById("text-chat-panel"))&&(I.style.display=""),(T=this.shadowRoot.getElementById("text-chat-button"))?T.style.display="":(H=document.getElementById("text-chat-button"))&&(H.style.display="")),j;case 29:this.callStartTime=Date.now(),console.log("⏱️ Starting call timer at",new Date(this.callStartTime).toISOString()),D=function(){if(W.callStartTime){var e=Date.now()-W.callStartTime,t=Math.floor(e/6e4),A=Math.floor(e%6e4/1e3),n="".concat(t.toString().padStart(2,"0"),":").concat(A.toString().padStart(2,"0"));W._updateTimerElements(n,e)}else console.warn("⚠️ Timer update called but callStartTime is not set")},setTimeout(function(){console.log("⏱️ Starting timer interval"),D(),W.callTimerInterval=setInterval(D,1e3)},100),e.n=38;break;case 30:if(!C){e.n=31;break}throw console.log("🚫 Server rejected connection, aborting audio capture"),new Error("DOMAIN_NOT_WHITELISTED");case 31:if(this.sdk.isConnected&&this.sdk.voiceSDK&&this.sdk.voiceSDK.isConnected&&this.sdk.voiceSDK.websocket&&this.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN){e.n=32;break}throw console.warn("⚠️ Connection not valid, aborting audio capture"),new Error("Connection lost before starting audio capture");case 32:return console.warn("⚠️ Connection not fully ready, but trying to start listening anyway..."),e.p=33,e.n=34,this.sdk.startListening();case 34:console.log("🎤 Started listening - permission granted"),this.isActive=!0,this.isMobile?(document.getElementById("mobile-voice-call-bar-container")?console.log("📱 Mobile device - bar already exists, updating status"):(console.log("📱 Mobile device - permission granted, creating minimized bar"),this.createMobileMinimizedBar()),0===this.messages.length&&this.messages.push({type:"assistant",text:this.t("transcriptWillAppear")}),this.startWaveformAnimation()):(this.startDesktopWaveformAnimation(),this.desktop.startLiveWaveformInterval()),e.n=37;break;case 35:if(e.p=35,!(N=e.v).isServerRejection&&"ServerRejected"!==N.name){e.n=36;break}throw this.resetConnectingState(),N;case 36:throw console.error("❌ Failed to start listening - permission denied or error:",N),this.resetConnectingState(),this.isMobile&&(document.getElementById("mobile-voice-call-bar-container")&&this.removeMobileMinimizedBar(),(P=this.shadowRoot.getElementById("voiceIdleState"))&&(P.style.display="flex"),(O=this.shadowRoot.getElementById("text-chat-panel"))?O.style.display="":(K=document.getElementById("text-chat-panel"))&&(K.style.display=""),(M=this.shadowRoot.getElementById("text-chat-button"))?M.style.display="":(L=document.getElementById("text-chat-button"))&&(L.style.display="")),N;case 37:this.callStartTime=Date.now(),console.log("⏱️ Starting call timer at",new Date(this.callStartTime).toISOString()),R=function(){if(W.callStartTime){var e=Date.now()-W.callStartTime,t=Math.floor(e/6e4),A=Math.floor(e%6e4/1e3),n="".concat(t.toString().padStart(2,"0"),":").concat(A.toString().padStart(2,"0"));W._updateTimerElements(n,e)}else console.warn("⚠️ Timer update called but callStartTime is not set")},setTimeout(function(){console.log("⏱️ Starting timer interval"),R(),W.callTimerInterval=setInterval(R,1e3)},100);case 38:console.log("✅ Voice call started successfully"),e.n=44;break;case 39:if(e.p=39,(G=e.v).isServerRejection||"ServerRejected"===G.name||console.error("❌ Error starting voice call:",G),this.resetConnectingState(),this.isActive=!1,this.callTimerInterval&&(clearInterval(this.callTimerInterval),this.callTimerInterval=null),this.sdk&&this.sdk.isConnected)try{this.sdk.disconnect()}catch(e){console.warn("Error disconnecting SDK on error:",e)}if("NotAllowedError"!==G.name&&"PermissionDeniedError"!==G.name){e.n=40;break}An(),gn(function(){W.resetUIState()}),e.n=44;break;case 40:if("NotFoundError"!==G.name&&"DevicesNotFoundError"!==G.name){e.n=41;break}fn(function(){W.resetUIState()}),e.n=44;break;case 41:if(!G||!("DOMAIN_NOT_WHITELISTED"===G.message||G.message&&G.message.includes("Domain not whitelisted"))){e.n=43;break}return e.n=42,this.endCallOnServerRejection();case 42:e.n=44;break;case 43:this.showError(G.message||G),this.resetUIState();case 44:return e.a(2)}},e,this,[[33,35],[22,24],[20,27],[8,10],[1,3],[0,39]])})),function(){return n.apply(this,arguments)})},{key:"resetUIState",value:function(){if(this.resetConnectingState(),this.isMobile){this.removeMobileMinimizedBar(),this.stopWaveformAnimation(),this.messages=[];var e=this.shadowRoot.getElementById("text-chat-panel");if(e)e.style.display="";else{var t=document.getElementById("text-chat-panel");t&&(t.style.display="")}}var A=this.shadowRoot.getElementById("voiceIdleState"),n=this.shadowRoot.getElementById("voiceActiveState");A&&(A.style.display="flex"),n&&(n.style.display="none")}},{key:"endCallOnServerRejection",value:(A=Yn(zn().m(function e(){var t,A,n,o,r,i,a,s,c,l,u,d,p,h,g,f,m;return zn().w(function(e){for(;;)switch(e.p=e.n){case 0:if(console.log("🚫 Server rejected call - ending call and stopping audio capture/VAD..."),console.log("🚫 Calling endCallOnServerRejection() - will show domain error message"),t=this.shadowRoot.getElementById("voiceInterface"),A=this.shadowRoot.getElementById("landingScreen"),t&&(t.classList.add("active"),console.log("✅ Made voice interface visible")),A&&(A.classList.remove("active"),console.log("✅ Hid landing screen")),this.config.onShowVoice&&"function"==typeof this.config.onShowVoice&&(console.log("🚫 Calling onShowVoice callback to ensure voice interface is visible..."),this.config.onShowVoice()),!this.sdk){e.n=22;break}if(e.p=1,r=null===(n=this.sdk.voiceSDK)||void 0===n?void 0:n.audioRecorder,!(this.sdk.isListening||(null===(o=this.sdk.voiceSDK)||void 0===o?void 0:o.isRecording)||r&&r.isRecording||r&&null!==r.audioWorkletNode||r)){e.n=19;break}if(console.log("🛑 Stopping audio capture/VAD..."),null==r||!r.audioWorkletNode){e.n=5;break}return console.log("🛑 Sending stop message to AudioWorklet to stop VAD..."),e.p=2,r.audioWorkletNode.port.postMessage({type:"stop"}),e.n=3,new Promise(function(e){return setTimeout(e,150)});case 3:e.n=5;break;case 4:e.p=4,p=e.v,console.warn("Error sending stop message to AudioWorklet:",p);case 5:if(!this.sdk.voiceSDK||"function"!=typeof this.sdk.voiceSDK.stopRecording){e.n=10;break}return e.p=6,e.n=7,this.sdk.voiceSDK.stopRecording();case 7:console.log("✅ stopRecording() completed"),e.n=9;break;case 8:e.p=8,h=e.v,console.warn("Error calling stopRecording:",h);case 9:e.n=14;break;case 10:if(!this.sdk.stopListening){e.n=14;break}return e.p=11,this.sdk.stopListening(),e.n=12,new Promise(function(e){return setTimeout(e,200)});case 12:e.n=14;break;case 13:e.p=13,g=e.v,console.warn("Error calling stopListening:",g);case 14:if(!r||"function"!=typeof r.stop){e.n=18;break}return e.p=15,e.n=16,r.stop();case 16:console.log("✅ AudioRecorder.stop() completed"),e.n=18;break;case 17:e.p=17,f=e.v,console.warn("Error calling AudioRecorder.stop():",f);case 18:console.log("✅ Audio capture/VAD stopped");case 19:null!=r&&r.mediaStream&&(console.log("🛑 Force stopping media stream tracks (backup cleanup)..."),r.mediaStream.getTracks().forEach(function(e){"ended"!==e.readyState&&(e.stop(),console.log("✅ Force stopped track:",e.kind))})),this.audioStream&&(console.log("🛑 Stopping stored audio stream..."),this.audioStream.getTracks().forEach(function(e){"ended"!==e.readyState&&e.stop()}),this.audioStream=null),this.sdk.hangup(),e.n=21;break;case 20:e.p=20,m=e.v,console.warn("Error stopping listening on server rejection:",m);try{null!==(i=this.sdk.voiceSDK)&&void 0!==i&&null!==(i=i.audioRecorder)&&void 0!==i&&i.mediaStream&&this.sdk.voiceSDK.audioRecorder.mediaStream.getTracks().forEach(function(e){return e.stop()}),this.audioStream&&(this.audioStream.getTracks().forEach(function(e){return e.stop()}),this.audioStream=null)}catch(e){console.warn("Error force-stopping media streams:",e)}case 21:if(this.sdk.isConnected)try{this.sdk.disconnect()}catch(e){console.warn("Error disconnecting SDK on server rejection:",e)}case 22:this.isActive=!1,this.config.onCallEnd&&this.config.onCallEnd,this.callTimerInterval&&(clearInterval(this.callTimerInterval),this.callTimerInterval=null),a=this.shadowRoot.getElementById("voiceActiveState"),s=this.shadowRoot.getElementById("voiceIdleState"),a&&(a.style.display="none"),s&&(s.style.display="flex",this.isShowingDomainError=!0,console.log("🚫 Setting isShowingDomainError flag to true"),console.log("🚫 Calling showDomainError() to display domain error in widget..."),this.showDomainError(),console.log("🚫 showDomainError() completed, isShowingDomainError:",this.isShowingDomainError)),this.isMobile&&((c=this.shadowRoot.getElementById("text-chat-panel"))?c.style.display="":(l=document.getElementById("text-chat-panel"))&&(l.style.display=""),(u=this.shadowRoot.getElementById("text-chat-button"))?u.style.display="":(d=document.getElementById("text-chat-button"))&&(d.style.display=""),this.removeMobileMinimizedBar(),this.stopWaveformAnimation());case 23:return e.a(2)}},e,this,[[15,17],[11,13],[6,8],[2,4],[1,20]])})),function(){return A.apply(this,arguments)})},{key:"endVoiceCall",value:function(){var e,t=this;if(console.log("🔴 Ending voice call..."),this._resumeInfo=null,this.sdk&&this.isActive&&(this.sdk.stopListening(),this.sdk.hangup(),this.isActive=!1),this.audioStream&&(this.audioStream.getTracks().forEach(function(e){return e.stop()}),this.audioStream=null),this.callTimerInterval&&(clearInterval(this.callTimerInterval),this.callTimerInterval=null),this._textInjectTimeout&&(clearTimeout(this._textInjectTimeout),this._textInjectTimeout=null),this._statusClearTimeout&&(clearTimeout(this._statusClearTimeout),this._statusClearTimeout=null),this._mobileTextInjectTimeout&&(clearTimeout(this._mobileTextInjectTimeout),this._mobileTextInjectTimeout=null),this._mobileStatusClearTimeout&&(clearTimeout(this._mobileStatusClearTimeout),this._mobileStatusClearTimeout=null),null!==(e=this.sdk)&&void 0!==e&&e.voiceSDK&&this.textHandlers._textInjectAckHandler&&(this.sdk.voiceSDK.off("textInjectAck",this.textHandlers._textInjectAckHandler),this.textHandlers._textInjectAckHandler=null),this._originalHintText=null,this._originalMobileHintText=null,this.isMobile||(this.stopDesktopWaveformAnimation(),this.desktop.stopLiveWaveformInterval(),this.transcript.clearConversationMessages(),this.conversationExpanded=!1),this.isMobile){this.stopWaveformAnimation(),this.collapseMobileTranscript(),this.removeMobileMinimizedBar(),this.messages=[];var A=this.shadowRoot.getElementById("text-chat-panel");if(A)A.style.display="";else{var n=document.getElementById("text-chat-panel");n&&(n.style.display="")}}var o=this.shadowRoot.getElementById("text-chat-button");if(o)o.style.display="",console.log("✅ Floating button restored (call ended)");else{var r=document.getElementById("text-chat-button");r&&(r.style.display="",console.log("✅ Floating button restored (call ended, fallback)"))}var i=this.shadowRoot.getElementById("voiceActiveState");if(i&&(i.style.display="none"),"function"==typeof this.config.onVoiceCallButtonClick)try{this.config.onVoiceCallButtonClick({timestamp:Date.now(),widgetState:"end"})}catch(e){console.error("Error in onVoiceCallButtonClick callback:",e)}if(this.config.onCallEnd)this.config.onCallEnd();else{var a=this.shadowRoot.getElementById("voiceIdleState");a&&(a.style.display="flex"),setTimeout(function(){return t.adjustSizesForContainer()},50)}var s=this.shadowRoot.getElementById("transcriptText");if(s&&(s.textContent=this.t("transcriptWillAppear"),s.classList.add("empty")),this.isMobile){var c=document.getElementById("mobileTranscriptText");c&&(c.textContent=this.t("transcriptWillAppear"))}var l=this.shadowRoot.getElementById("voiceAvatarActive");l&&l.classList.remove("speaking"),console.log("✅ Voice call ended")}},{key:"showConnectingState",value:function(){if(this.isMobile)console.log("📱 Mobile device - skipping showConnectingState() (minimized bar handles connecting state)");else{var e=this.shadowRoot.getElementById("voiceIdleState"),t=this.shadowRoot.getElementById("voiceActiveState");if(e){var A=e.querySelector(".voice-status-title"),n=e.querySelector(".voice-status-subtitle"),o=e.querySelector("#startCallBtn");if(A&&(A.textContent=this.t("connecting")),n&&(n.textContent=this.t("connectingSubtitle")),o){o.disabled=!0,o.style.opacity="0.6",o.style.cursor="not-allowed";var r=o.querySelector("span");if(r){var i=document.createElement("span");i.className="connecting-spinner",r.textContent="",r.appendChild(i),r.appendChild(document.createTextNode(" "+this.t("connecting")))}}e.style.display="flex"}t&&(t.style.display="none")}}},{key:"resetConnectingState",value:function(){if(this.isShowingDomainError)console.log("🚫 resetConnectingState() called but domain error is displayed - skipping reset");else{var e=this.shadowRoot.getElementById("voiceIdleState");if(e){var t=e.querySelector("#domainErrorBackBtn");t&&t.parentNode&&t.parentNode.removeChild(t);var A=e.querySelector(".voice-status-title"),n=e.querySelector(".voice-status-subtitle"),o=e.querySelector("#startCallBtn");if(A&&(A.textContent=this.getText("startCallTitle","clickToStartCall"),A.style.color="",A.style.fontSize="",A.style.fontWeight="",A.style.marginLeft="",A.style.marginRight="",A.style.textAlign=""),n&&(n.textContent=this.getText("startCallSubtitle","realTimeVoice"),n.style.color="",n.style.fontSize="",n.style.marginLeft="",n.style.marginRight="",n.style.marginTop="",n.style.textAlign="",n.style.lineHeight=""),o){o.disabled=!1,o.style.opacity="",o.style.cursor="",o.style.display="";var r=o.querySelector("span");r&&(r.textContent=this.getText("startCallButtonText","startCall"))}}}}},{key:"updateTranscript",value:function(e){return this.transcript.updateTranscript(e)}},{key:"toggleConversationPanel",value:function(){return this.transcript.toggleConversationPanel()}},{key:"addConversationMessage",value:function(e,t){return this.transcript.addConversationMessage(e,t)}},{key:"renderConversationMessages",value:function(){return this.transcript.renderConversationMessages()}},{key:"escapeHtml",value:function(e){var t=document.createElement("div");return t.textContent=e,t.innerHTML}},{key:"toggleMute",value:function(){if(this.sdk&&this.isActive){var e=null;if(this.sdk.voiceSDK&&this.sdk.voiceSDK.audioRecorder&&this.sdk.voiceSDK.audioRecorder.mediaStream&&(e=this.sdk.voiceSDK.audioRecorder.mediaStream.getAudioTracks()[0]),!e&&this.audioStream&&(e=this.audioStream.getAudioTracks()[0]),e){e.enabled=!e.enabled,this.isMicMuted=!e.enabled;var t=this.shadowRoot.getElementById("desktopMuteBtn"),A=this.shadowRoot.getElementById("desktopMuteBtnCompact");if(this.isMobile||this.updateDesktopStatus(),t){var n=t.querySelector(".desktop-mic-icon"),o=t.querySelector(".desktop-mic-off-icon");n&&o&&(e.enabled?(t.classList.remove("muted"),n.style.display="block",o.style.display="none"):(t.classList.add("muted"),n.style.display="none",o.style.display="block"))}if(A){var r=A.querySelector(".desktop-mic-icon"),i=A.querySelector(".desktop-mic-off-icon");r&&i&&(e.enabled?(A.classList.remove("muted"),r.style.display="block",i.style.display="none"):(A.classList.add("muted"),r.style.display="none",i.style.display="block"))}if(this.isMobile){var a=document.getElementById("mobileMuteBtn"),s=null==a?void 0:a.querySelector(".mobile-mic-icon"),c=null==a?void 0:a.querySelector(".mobile-mic-off-icon");a&&s&&c&&(e.enabled?(a.classList.remove("muted"),s.style.cssText="display: block !important; visibility: visible !important; opacity: 1 !important; width: 15px !important; height: 15px !important; margin: 0 !important; padding: 0 !important;",c.style.cssText="display: none !important; visibility: hidden !important; opacity: 0 !important;"):(a.classList.add("muted"),s.style.cssText="display: none !important; visibility: hidden !important; opacity: 0 !important;",c.style.cssText="display: block !important; visibility: visible !important; opacity: 1 !important; width: 15px !important; height: 15px !important; margin: 0 !important; padding: 0 !important;"))}console.log(e.enabled?"🔊 Unmuted":"🔇 Muted")}else console.warn("⚠️ No audio track available for mute toggle")}}},{key:"toggleSpeaker",value:function(){if(this.sdk&&this.isActive){if(this.isSpeakerMuted=!this.isSpeakerMuted,this.sdk.voiceSDK&&this.sdk.voiceSDK.audioPlayer?(this.sdk.voiceSDK.audioPlayer.setMuted(this.isSpeakerMuted),console.log("🔊 Speaker toggle:",this.isSpeakerMuted?"muted":"unmuted")):console.warn("⚠️ Cannot toggle speaker - audioPlayer not available"),!this.isMobile){var e=this.shadowRoot.getElementById("desktopSpeakerBtn"),t=this.shadowRoot.getElementById("desktopSpeakerBtnCompact");if(e){var A=e.querySelector(".desktop-speaker-icon"),n=e.querySelector(".desktop-speaker-off-icon");A&&n&&(this.isSpeakerMuted?(e.classList.add("muted"),A.style.display="none",n.style.display="block"):(e.classList.remove("muted"),A.style.display="block",n.style.display="none"))}if(t){var o=t.querySelector(".desktop-speaker-icon"),r=t.querySelector(".desktop-speaker-off-icon");o&&r&&(this.isSpeakerMuted?(t.classList.add("muted"),o.style.display="none",r.style.display="block"):(t.classList.remove("muted"),o.style.display="block",r.style.display="none"))}}if(this.isMobile){var i=document.getElementById("mobileSpeakerBtn"),a=null==i?void 0:i.querySelector(".mobile-speaker-icon"),s=null==i?void 0:i.querySelector(".mobile-speaker-off-icon");i&&a&&s&&(this.isSpeakerMuted?(i.classList.add("muted"),a.style.cssText="display: none !important; visibility: hidden !important; opacity: 0 !important;",s.style.cssText="display: block !important; visibility: visible !important; opacity: 1 !important; width: 15px !important; height: 15px !important; margin: 0 !important; padding: 0 !important;"):(i.classList.remove("muted"),a.style.cssText="display: block !important; visibility: visible !important; opacity: 1 !important; width: 15px !important; height: 15px !important; margin: 0 !important; padding: 0 !important;",s.style.cssText="display: none !important; visibility: hidden !important; opacity: 0 !important;"))}}}},{key:"updateMobileStatus",value:function(e){return this.mobile.updateMobileStatus(e)}},{key:"createMobileMinimizedBar",value:function(){return this.mobile.createMobileMinimizedBar()}},{key:"removeMobileMinimizedBar",value:function(){return this.mobile.removeMobileMinimizedBar()}},{key:"expandMobileTranscript",value:function(){return this.mobile.expandMobileTranscript()}},{key:"collapseMobileTranscript",value:function(){return this.mobile.collapseMobileTranscript()}},{key:"addMobileMessage",value:function(e,t){return this.mobile.addMobileMessage(e,t)}},{key:"startWaveformAnimation",value:function(){return this.mobile.startWaveformAnimation()}},{key:"stopWaveformAnimation",value:function(){return this.mobile.stopWaveformAnimation()}},{key:"destroy",value:function(){this.isActive&&this.endVoiceCall(),this.audioStream&&(this.audioStream.getTracks().forEach(function(e){return e.stop()}),this.audioStream=null),this.callTimerInterval&&(clearInterval(this.callTimerInterval),this.callTimerInterval=null),this.sdk&&(this.sdk.disconnect(),this.sdk=null)}}],t&&qn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,A,n,o}();function eo(e){return eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},eo(e)}function to(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Ao(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Ao(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Ao(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Ao(u,"constructor",c),Ao(c,"constructor",s),s.displayName="GeneratorFunction",Ao(c,o,"GeneratorFunction"),Ao(u),Ao(u,o,"Generator"),Ao(u,n,function(){return this}),Ao(u,"toString",function(){return"[object Generator]"}),(to=function(){return{w:r,m:d}})()}function Ao(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Ao=function(e,t,A,n){function r(t,A){Ao(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},Ao(e,t,A,n)}function no(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function oo(e){return function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){no(r,n,o,i,a,"next",e)}function a(e){no(r,n,o,i,a,"throw",e)}i(void 0)})}}function ro(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,io(n.key),n)}}function io(e){var t=function(e){if("object"!=eo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=eo(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==eo(t)?t:t+""}var ao=function(){return e=function e(t,A){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=t,this.sdk=A,this.streamingEl=null,this.hasStartedStreaming=!1,this.isActive=!1,this.shadowRoot=t.shadowRoot||document,this.eventHandlers={autoResize:null,keydown:null},this.eventHandlersSetup=!1},t=[{key:"t",value:function(e){var t,A,n=this.config.language||"en";return((null===(t=this.config.translations)||void 0===t?void 0:t[n])||(null===(A=this.config.translations)||void 0===A?void 0:A.en)||{})[e]||e}},{key:"generateHTML",value:function(){var e,t,A,n,o,r,i,a,s,c=this.config.inputPlaceholder||(null===(e=this.config.panel)||void 0===e?void 0:e.inputPlaceholder)||this.t("typeMessage")||"Type your message...";return'<div class="text-interface" id="textInterface">\n <div class="messages-container" id="messagesContainer">\n <div class="empty-state">\n <div class="empty-state-icon">💬</div>\n <div class="empty-state-title">'.concat(this.t("hello"),'</div>\n <div class="empty-state-text">').concat(this.t("sendMessage"),'</div>\n </div>\n </div>\n <div class="input-container">\n <div class="input-wrapper" style="flex:1;">\n <textarea class="message-input" id="messageInput" placeholder="').concat(c,'" rows="1" dir="').concat(this.config.direction||"ltr",'"></textarea>\n </div>\n <button class="send-button" id="sendButton" aria-label="').concat(this.t("sendMessageAria"),'">').concat(this.config.sendButtonText||"➤","</button>\n ").concat(null!==(t=this.config.sendButtonHint)&&void 0!==t&&t.text||null!==(A=this.config.panel)&&void 0!==A&&null!==(A=A.sendButtonHint)&&void 0!==A&&A.text?'\n <div class="send-button-hint" style="color: '.concat((null===(n=this.config.sendButtonHint)||void 0===n?void 0:n.color)||(null===(o=this.config.panel)||void 0===o||null===(o=o.sendButtonHint)||void 0===o?void 0:o.color)||"#6B7280","; font-size: ").concat((null===(r=this.config.sendButtonHint)||void 0===r?void 0:r.fontSize)||(null===(i=this.config.panel)||void 0===i||null===(i=i.sendButtonHint)||void 0===i?void 0:i.fontSize)||"12px",'; text-align: center; margin-top: 4px;">\n ').concat((null===(a=this.config.sendButtonHint)||void 0===a?void 0:a.text)||(null===(s=this.config.panel)||void 0===s||null===(s=s.sendButtonHint)||void 0===s?void 0:s.text),"\n </div>\n "):"","\n </div>\n </div>")}},{key:"generateCSS",value:function(){var e,t,A,n,o,r,i,a,s,c,l,u,d,p=this.config.messages,h=(this.config.panel,this.config.animation,this.config.sendButtonColor||(null===(e=this.config.panel)||void 0===e?void 0:e.sendButtonColor)||"#7C3AED"),g=this.config.sendButtonHoverColor||(null===(t=this.config.panel)||void 0===t?void 0:t.sendButtonHoverColor)||"#6D28D9",f=this.config.sendButtonTextColor||(null===(A=this.config.panel)||void 0===A?void 0:A.sendButtonTextColor)||"#FFFFFF",m=(this.config.inputPlaceholder||null===(n=this.config.panel)||void 0===n||n.inputPlaceholder,this.config.inputBorderColor||(null===(o=this.config.panel)||void 0===o?void 0:o.inputBorderColor)||"#E5E7EB"),v=this.config.inputFocusColor||(null===(r=this.config.panel)||void 0===r?void 0:r.inputFocusColor)||"#7C3AED",B=this.config.inputBackgroundColor||(null===(i=this.config.panel)||void 0===i?void 0:i.inputBackgroundColor)||"#FFFFFF",w=this.config.inputTextColor||(null===(a=this.config.panel)||void 0===a?void 0:a.inputTextColor)||"#1F2937",y=this.config.inputFontSize||(null===(s=this.config.panel)||void 0===s?void 0:s.inputFontSize)||"14px",b=this.config.inputBorderRadius||(null===(c=this.config.panel)||void 0===c?void 0:c.inputBorderRadius)||20,C=this.config.inputPadding||(null===(l=this.config.panel)||void 0===l?void 0:l.inputPadding)||"6px 14px",x=!1===this.config.useShadowDOM?" !important":"";return"\n /* Messages container using new classes */\n #messagesContainer { \n flex: 1; \n overflow-y: auto; \n overflow-x: hidden; \n padding: 20px; \n background: #f8fafc; \n display: flex; \n flex-direction: column; \n gap: 16px; \n min-height: 0; \n }\n .empty-state { \n flex: 1; \n display: flex; \n flex-direction: column; \n align-items: center; \n justify-content: center; \n gap: 12px; \n color: #64748b; \n text-align: center; \n padding: 20px; \n }\n .empty-state-icon { font-size: 48px; opacity: 0.3; }\n .empty-state-title { font-size: 20px; font-weight: 700; color: #334155; }\n .empty-state-text { font-size: 13px; max-width: 280px; }\n\n .text-interface { \n display: none".concat(x,"; \n flex: 1; \n flex-direction: column; \n min-height: 0; \n overflow: hidden; \n }\n .text-interface.active { display: flex").concat(x,"; }\n \n .message { \n display: flex; \n gap: 8px; \n padding: 4px 0; \n max-width: 100%; \n align-items: center; \n }\n .message.edge-left { flex-direction: row; }\n .message.edge-right { flex-direction: row-reverse; }\n .message-bubble { \n padding: 12px; \n border-radius: ").concat(p.borderRadius,"px").concat(x,"; \n max-width: 80%; \n font-size: ").concat(p.fontSize,"; \n word-wrap: break-word; \n text-align: ").concat("rtl"===this.config.direction?"right":"left","; \n direction: ").concat(this.config.direction||"ltr",";\n }\n .message.user .message-bubble { \n background: ").concat(p.userBackgroundColor).concat(x,"; \n color: ").concat(p.userTextColor||p.textColor).concat(x,"; \n }\n .message.agent .message-bubble { \n background: ").concat(p.agentBackgroundColor).concat(x,"; \n color: ").concat(p.agentTextColor||p.textColor).concat(x,"; \n }\n .message.user { \n align-self: ").concat("rtl"===this.config.direction?"flex-start":"flex-end","; \n }\n .message.agent { \n align-self: ").concat("rtl"===this.config.direction?"flex-end":"flex-start","; \n }\n .message .message-bubble { \n text-align: ").concat("rtl"===this.config.direction?"right":"left"," !important; \n }\n ").concat("rtl"===this.config.direction?"\n .message-bubble {\n text-align: right !important;\n }\n ":"","\n .message-avatar { \n width: 20px; \n height: 20px; \n display: flex; \n align-items: center; \n justify-content: center; \n flex-shrink: 0; \n color: inherit; \n font-size: 18px; \n line-height: 1; \n background: transparent; \n border: none; \n }\n .message-avatar.user { background: transparent; }\n .message-avatar.agent { background: transparent; }\n \n .message.system {\n background: ").concat(p.systemBackgroundColor,";\n align-self: flex-start;\n }\n .message.error {\n background: ").concat(p.errorBackgroundColor,";\n align-self: flex-start;\n }\n \n .input-container {\n display: flex;\n gap: 8px;\n padding: 12px 16px;\n background: #FFFFFF;\n border-top: 1px solid #E5E7EB;\n align-items: center;\n flex-shrink: 0;\n flex-direction: ").concat("rtl"===this.config.direction?"row-reverse":"row",";\n }\n \n .input-wrapper {\n position: relative;\n display: flex;\n align-items: center;\n }\n \n .message-input {\n width: 100%;\n min-height: 32px;\n max-height: 120px;\n padding: ").concat(C,";\n border: 1px solid ").concat(m,";\n border-radius: ").concat(b,"px;\n font-size: ").concat(y,";\n font-family: inherit;\n line-height: 1.3;\n resize: none;\n overflow-y: auto;\n background: ").concat(B,";\n color: ").concat(w,";\n vertical-align: top;\n margin: 0;\n display: block;\n white-space: pre-wrap;\n word-wrap: break-word;\n text-align: ").concat("rtl"===this.config.direction?"right":"left",";\n direction: ").concat(this.config.direction||"ltr",";\n -webkit-appearance: none;\n appearance: none;\n box-sizing: border-box;\n }\n \n .message-input:focus {\n outline: none;\n border-color: ").concat(v,";\n background: ").concat("#FFFFFF"===B?"#FFFFFF":B,";\n box-shadow: 0 0 0 3px ").concat(v,"33;\n }\n \n .message-input::placeholder {\n color: #9CA3AF;\n text-align: ").concat("rtl"===this.config.direction?"right":"left",";\n }\n \n .send-button {\n width: 40px;\n height: 40px;\n border-radius: 50%;\n border: none;\n background: ").concat(h,";\n color: ").concat(f,";\n font-size: ").concat(this.config.sendButtonFontSize||(null===(u=this.config.panel)||void 0===u?void 0:u.sendButtonFontSize)||"18px",";\n font-weight: ").concat(this.config.sendButtonFontWeight||(null===(d=this.config.panel)||void 0===d?void 0:d.sendButtonFontWeight)||"500",";\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n transition: all 0.2s ease;\n box-shadow: 0 4px 12px rgba(124, 60, 237, 0.3);\n }\n \n .send-button:hover:not(:disabled) {\n background: ").concat(g,";\n transform: scale(1.05);\n box-shadow: 0 6px 16px rgba(124, 60, 237, 0.4);\n }\n \n .send-button-hint {\n width: 100%;\n text-align: center;\n margin-top: 4px;\n }\n \n .send-button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n \n .typing-indicator {\n display: inline-flex;\n gap: 4px;\n align-items: center;\n }\n \n .typing-dot {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: #64748b;\n animation: typingDot 1.4s ease-in-out infinite;\n }\n \n .typing-dot:nth-child(2) { animation-delay: 0.2s; }\n .typing-dot:nth-child(3) { animation-delay: 0.4s; }\n \n @keyframes typingDot {\n 0%, 60%, 100% { transform: translateY(0); opacity: 0.7; }\n 30% { transform: translateY(-8px); opacity: 1; }\n }\n \n .error-message {\n padding: 12px;\n background: ").concat(p.errorBackgroundColor,";\n border-radius: ").concat(p.borderRadius,"px;\n color: #991B1B;\n font-size: ").concat(p.fontSize,";\n margin: 8px 0;\n }\n \n @media (max-width: 768px) {\n #messagesContainer {\n padding: 12px;\n gap: 12px;\n }\n \n .message-bubble {\n max-width: 85%;\n font-size: 14px;\n padding: 10px;\n }\n \n .text-input-container {\n padding: 10px;\n gap: 8px;\n }\n \n #text-chat-input {\n font-size: 16px !important; /* Prevents iOS zoom on focus */\n padding: 10px 14px;\n min-height: 44px;\n }\n \n #text-chat-send {\n min-width: 56px;\n min-height: 44px;\n width: 56px;\n height: 44px;\n }\n \n .empty-state-icon {\n font-size: 40px;\n }\n \n .empty-state-title {\n font-size: 18px;\n }\n \n .empty-state-text {\n font-size: 12px;\n }\n }\n \n @media (max-width: 480px) {\n #messagesContainer {\n padding: 10px;\n gap: 10px;\n }\n \n .message-bubble {\n max-width: 90%;\n font-size: 13px;\n padding: 8px;\n }\n \n .text-input-container {\n padding: 8px;\n }\n \n #text-chat-input {\n font-size: 16px !important;\n padding: 8px 12px;\n }\n }\n ")}},{key:"setupEventHandlers",value:function(){var e=this,t=this.shadowRoot.getElementById("sendButton"),A=this.shadowRoot.getElementById("messageInput"),n=this.shadowRoot.getElementById("newChatBtn");if(t&&(t.onclick=function(){return e.sendMessage()}),n&&(n.onclick=function(){return e.startNewChat()}),this.updateInputAttributes(),A){A.style.height="32px",A.style.overflow="hidden";var o=function(){A.style.height="auto";var e=Math.min(A.scrollHeight,120);A.style.height=e+"px",A.style.overflowY=e>=120?"auto":"hidden",e>=120&&setTimeout(function(){A.scrollTop=A.scrollHeight},0)};A.addEventListener("input",o),A.addEventListener("keydown",function(t){"Enter"!==t.key||t.shiftKey?"Enter"===t.key&&t.shiftKey&&setTimeout(o,0):(t.preventDefault(),e.sendMessage())})}}},{key:"startNewChat",value:function(){try{localStorage.removeItem("ttp_text_chat_conversation_id")}catch(e){}this.sdk&&(this.sdk.config.conversationId=null);var e=this.shadowRoot.getElementById("messagesContainer");e&&(e.innerHTML='\n <div class="empty-state">\n <div class="empty-state-icon">💬</div>\n <div class="empty-state-title">'.concat(this.t("hello"),'</div>\n <div class="empty-state-text">').concat(this.t("sendMessage"),"</div>\n </div>"));var t=this.shadowRoot.getElementById("messageInput");t&&t.focus()}},{key:"updateInputAttributes",value:function(){var e=this.shadowRoot.getElementById("messageInput");if(e){var t,A=this.config.inputPlaceholder||(null===(t=this.config.panel)||void 0===t?void 0:t.inputPlaceholder)||this.t("typeMessage")||"Type your message...";e.placeholder=A,e.dir=this.config.direction||"ltr",e.style.textAlign="rtl"===this.config.direction?"right":"left"}}},{key:"show",value:function(){var e=this,t=this.shadowRoot.getElementById("textInterface");t&&t.classList.add("active"),setTimeout(function(){var t=e.shadowRoot.getElementById("messageInput");t&&t.focus()},50)}},{key:"hide",value:function(){var e=this.shadowRoot.getElementById("textInterface");e&&e.classList.remove("active")}},{key:"startChat",value:(n=oo(to().m(function e(){return to().w(function(e){for(;;)switch(e.n){case 0:this.isActive=!0,this.updateSendButtonState();case 1:return e.a(2)}},e,this)})),function(){return n.apply(this,arguments)})},{key:"sendMessage",value:(A=oo(to().m(function e(){var t,A,n;return to().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t=this.shadowRoot.getElementById("messageInput"),A=t.value.trim()){e.n=1;break}return e.a(2);case 1:if(this.isActive){e.n=2;break}return e.n=2,this.startChat();case 2:return this.addMessage("user",A),t.value="",t.style.height="32px",t.style.overflow="hidden",e.p=3,this.beginStreaming(),e.n=4,this.sdk.sendMessage(A);case 4:e.n=6;break;case 5:e.p=5,n=e.v,console.error("❌ Failed to send message:",n),n&&("DOMAIN_NOT_WHITELISTED"===n.message||n.message&&n.message.includes("Domain not whitelisted"))||this.showError(n),this.stopStreamingState();case 6:return e.a(2)}},e,this,[[3,5]])})),function(){return A.apply(this,arguments)})},{key:"updateSendButtonState",value:function(){var e=this.shadowRoot.getElementById("sendButton");e&&(e.disabled=!this.isActive)}},{key:"addMessage",value:function(e,t){var A,n,o=this.shadowRoot.getElementById("messagesContainer");if(o){var r=o.querySelector(".empty-state");r&&r.remove();var i=document.createElement("div"),a="rtl"===this.config.direction?"user"===e?"edge-left":"edge-right":"user"===e?"edge-right":"edge-left";i.className="message ".concat(e," ").concat(a);var s=document.createElement("div");s.className="message-avatar ".concat(e);var c="user"===e?(null===(A=this.config.messages)||void 0===A?void 0:A.userAvatarIcon)||"👤":(null===(n=this.config.messages)||void 0===n?void 0:n.agentAvatarIcon)||"🤖";s.textContent=c;var l=document.createElement("div");l.className="message-bubble",l.textContent=t,i.appendChild(s),i.appendChild(l),o.appendChild(i),o.scrollTop=o.scrollHeight}}},{key:"beginStreaming",value:function(){var e,t=this.shadowRoot.getElementById("messagesContainer");if(t){this.stopStreamingState();var A=document.createElement("div"),n="rtl"===this.config.direction?"edge-right":"edge-left";A.className="message agent ".concat(n),A.id="agent-streaming";var o=document.createElement("div");o.className="message-avatar agent",o.textContent=(null===(e=this.config.messages)||void 0===e?void 0:e.agentAvatarIcon)||"🤖";var r=document.createElement("div");r.className="message-bubble",r.innerHTML='<span class="typing-indicator"><span class="typing-dot"></span><span class="typing-dot"></span><span class="typing-dot"></span></span>',A.appendChild(o),A.appendChild(r),t.appendChild(A),this.streamingEl=r,this.hasStartedStreaming=!1,t.scrollTop=t.scrollHeight}}},{key:"appendStreamingChunk",value:function(e){if(this.streamingEl){this.hasStartedStreaming||(this.streamingEl.textContent="",this.hasStartedStreaming=!0),this.streamingEl.textContent+=e;var t=this.shadowRoot.getElementById("messagesContainer");t&&(t.scrollTop=t.scrollHeight)}}},{key:"finalizeStreaming",value:function(e){if(this.streamingEl){this.streamingEl.textContent=e||this.streamingEl.textContent;var t=this.shadowRoot.getElementById("agent-streaming");t&&(t.id=""),this.streamingEl=null}this.updateSendButtonState()}},{key:"stopStreamingState",value:function(){var e=this.shadowRoot.getElementById("agent-streaming");e&&e.remove(),this.streamingEl=null,this.hasStartedStreaming=!1}},{key:"showError",value:function(e){var t=this.shadowRoot.getElementById("messagesContainer");if(t){if(e&&("DOMAIN_NOT_WHITELISTED"===e.message||"string"==typeof e&&e.includes("DOMAIN_NOT_WHITELISTED")||e.message&&e.message.includes("Domain not whitelisted")||"string"==typeof e&&e.includes("Domain not whitelisted"))){var A,n=document.createElement("div");n.className="error-message",n.style.cssText="padding: 16px; margin: 12px; border-radius: 8px; background: "+((null===(A=this.config.messages)||void 0===A?void 0:A.errorBackgroundColor)||"#FEE2E2")+";";var o=document.createElement("div");o.style.cssText="font-weight: 600; font-size: 16px; margin-bottom: 8px; color: #991B1B;",o.textContent=this.t("domainNotValidated");var r=document.createElement("div");r.style.cssText="font-size: 14px; color: #991B1B; line-height: 1.5;",r.textContent=this.t("domainErrorMessage"),n.appendChild(o),n.appendChild(r),t.appendChild(n)}else{var i=document.createElement("div");i.className="error-message",i.textContent="string"==typeof e?e:(null==e?void 0:e.message)||e,t.appendChild(i)}t.scrollTop=t.scrollHeight}}},{key:"setActive",value:function(e){this.isActive=e,this.updateSendButtonState()}}],t&&ro(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,A,n}();function so(e){return so="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},so(e)}function co(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,lo(n.key),n)}}function lo(e){var t=function(e){if("object"!=so(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=so(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==so(t)?t:t+""}var uo=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=t,this.translations=t.translations||{},this.shadowRoot=t.shadowRoot},t=[{key:"t",value:function(e){var t=this.config.language||"en";return(this.translations[t]||this.translations.en||{})[e]||e}},{key:"generateHTML",value:function(){var e,t=this.config.landing||{};return e="image"===t.logoType&&t.logoImageUrl?'<img src="'.concat(t.logoImageUrl,'" alt="Logo" style="max-width: 44px; max-height: 44px; object-fit: contain; border: none; outline: none;">'):'<span class="landing-avatar-emoji">'.concat(t.logoIcon||t.logo||"🤖","</span>"),'\n <div class="landing-screen" id="landingScreen">\n \x3c!-- Avatar --\x3e\n <div class="landing-avatar">\n '.concat(e,'\n </div>\n\n \x3c!-- Title --\x3e\n <h2 class="landing-title">').concat(t.title||this.t("landingTitle"),'</h2>\n <p class="landing-subtitle">').concat(t.subtitle||this.t("landingSubtitle")||"Choose your preferred method",'</p>\n\n \x3c!-- Mode Selection - Side by Side --\x3e\n <div class="mode-selection">\n \x3c!-- Voice Call Option --\x3e\n <button class="mode-card" id="mode-card-voice">\n <div class="mode-card-icon">\n <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2"/>\n <line x1="12" y1="19" x2="12" y2="23"/>\n <line x1="8" y1="23" x2="16" y2="23"/>\n </svg>\n </div>\n <span class="mode-card-title">').concat(t.voiceCardTitle||this.t("voiceCall"),'</span>\n </button>\n\n \x3c!-- Text Chat Option --\x3e\n <button class="mode-card" id="mode-card-text">\n <div class="mode-card-icon">\n <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"/>\n </svg>\n </div>\n <span class="mode-card-title">').concat(t.textCardTitle||this.t("textChat"),"</span>\n </button>\n </div>\n </div>\n ")}},{key:"generateCSS",value:function(){var e=this.config.landing||{},t=(this.config.animation,!1===this.config.useShadowDOM?" !important":"");return"\n /* ===== LANDING SCREEN - New Design ===== */\n .landing-screen { \n display: none".concat(t,"; \n flex: 1; \n padding: 32px 24px; \n background: ").concat(e.backgroundColor||"linear-gradient(180deg, #ffffff 0%, rgba(168, 85, 247, 0.03) 100%)","; \n align-items: center; \n justify-content: flex-start; \n flex-direction: column; \n gap: 0; \n overflow-y: auto; \n min-height: 0;\n text-align: center;\n }\n \n .landing-screen.active { \n display: flex").concat(t,"; \n }\n\n /* Avatar - Richer purple gradient */\n .landing-avatar {\n width: 88px;\n height: 88px;\n border-radius: 22px;\n margin-bottom: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n ").concat(function(){if("image"===e.logoType){if(!1!==e.logoBackgroundEnabled){var t=e.logoBackgroundColor||e.avatarBackground||"linear-gradient(135deg, #667eea 0%, #764ba2 100%)";return"background: ".concat(t,"; box-shadow: 0 8px 28px rgba(102, 126, 234, 0.35); border: none;")}return"background: transparent; box-shadow: none; border: none; outline: none;"}var A=e.avatarBackground||"linear-gradient(135deg, #667eea 0%, #764ba2 100%)";return"background: ".concat(A,"; box-shadow: 0 8px 28px rgba(102, 126, 234, 0.35); border: none;")}(),"\n }\n \n .landing-avatar img {\n border: none !important;\n outline: none !important;\n }\n\n .landing-avatar-emoji {\n font-size: 44px;\n line-height: 1;\n }\n\n /* Title & Subtitle */\n .landing-title { \n font-size: 20px; \n color: ").concat(e.titleColor||"#1e1b4b","; \n font-weight: 600; \n margin-bottom: 6px; \n text-align: center;\n line-height: 1.3;\n }\n\n .landing-subtitle {\n font-size: 14px;\n color: ").concat(e.subtitleColor||"#64748b",";\n margin-bottom: 28px;\n text-align: center;\n }\n\n /* Mode Selection - Side by Side */\n .mode-selection { \n display: flex; \n gap: 12px; \n width: 100%; \n justify-content: center; \n }\n\n .mode-card { \n flex: 1; \n max-width: 160px; \n padding: 20px 16px;\n background: ").concat(e.modeCardBackgroundColor||"#ffffff","; \n border: 1px solid ").concat(e.modeCardBorderColor||"rgba(0, 0, 0, 0.06)","; \n border-radius: 18px; \n cursor: pointer; \n display: flex; \n flex-direction: column; \n align-items: center; \n gap: 12px; \n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); \n box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); \n font-family: inherit;\n }\n\n .mode-card:hover { \n transform: translateY(-4px); \n box-shadow: 0 8px 24px rgba(124, 58, 237, 0.2); \n border-color: rgba(124, 58, 237, 0.3); \n }\n\n .mode-card:active {\n transform: translateY(-2px);\n }\n\n /* Mode Card Icon - Vibrant purple gradient */\n .mode-card-icon { \n width: 56px; \n height: 56px; \n display: flex; \n align-items: center; \n justify-content: center; \n border-radius: 16px; \n background: ").concat(e.modeCardIconBackgroundColor||"linear-gradient(135deg, #7c3aed, #a855f7)","; \n color: #fff; \n box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);\n }\n\n .mode-card-icon svg {\n width: 26px;\n height: 26px;\n stroke: white;\n fill: none;\n }\n\n .mode-card-title { \n color: ").concat(e.modeCardTitleColor||"#1e1b4b","; \n font-weight: 600; \n font-size: 14px;\n text-align: center;\n }\n\n /* Mobile Responsive */\n @media (max-width: 768px) {\n .landing-screen {\n padding: 24px 16px;\n }\n\n .landing-avatar {\n width: 72px;\n height: 72px;\n border-radius: 18px;\n margin-bottom: 16px;\n }\n\n .landing-avatar-emoji {\n font-size: 36px;\n }\n\n .landing-title {\n font-size: 18px;\n }\n\n .landing-subtitle {\n font-size: 13px;\n margin-bottom: 20px;\n }\n\n .mode-selection {\n gap: 10px;\n }\n\n .mode-card {\n padding: 16px 12px;\n max-width: 140px;\n }\n\n .mode-card-icon {\n width: 48px;\n height: 48px;\n border-radius: 14px;\n }\n\n .mode-card-icon svg {\n width: 22px;\n height: 22px;\n }\n\n .mode-card-title {\n font-size: 13px;\n }\n }\n\n @media (max-width: 380px) {\n .mode-selection {\n flex-direction: column;\n align-items: center;\n }\n\n .mode-card {\n max-width: 100%;\n width: 100%;\n flex-direction: row;\n padding: 14px 18px;\n gap: 14px;\n }\n\n .mode-card-icon {\n flex-shrink: 0;\n }\n\n .mode-card-title {\n text-align: left;\n }\n }\n ")}},{key:"show",value:function(){var e,t=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("landingScreen");t&&t.classList.add("active")}},{key:"hide",value:function(){var e,t=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("landingScreen");t&&t.classList.remove("active")}},{key:"setupEventHandlers",value:function(){var e,t,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("mode-card-voice"),o=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("mode-card-text");n&&A.onSelectVoice&&(n.onclick=A.onSelectVoice),o&&A.onSelectText&&(o.onclick=A.onSelectText)}}],t&&co(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();const po={en:{landingTitle:"How would you like to communicate?",landingSubtitle:"Choose your preferred method",voiceCall:"Voice Call",textChat:"Text Chat",clickToStartCall:"Click to Start Call",realTimeVoice:"Real-time voice conversation",startCall:"Start Call",connecting:"Connecting...",connectingSubtitle:"Please wait",listening:"Listening...",speakFreely:"Speak freely",liveTranscript:"Live Transcript",transcriptWillAppear:"Transcript will appear here during the call...",mute:"Mute",speaker:"Speaker",endCall:"End Call",hello:"Hello! How can I help?",sendMessage:"Send a message to get started",online:"Online",newChat:"New Chat",back:"Back",close:"Close",error:"Error",typeMessage:"Type your message...",sendMessageAria:"Send message",domainNotValidated:"Domain not validated",domainErrorMessage:"This domain is not whitelisted. Please contact the administrator to whitelist your website URL."},he:{landingTitle:"איך תרצה לתקשר?",landingSubtitle:"בחר את השיטה המועדפת עליך",voiceCall:"שיחה קולית",textChat:"צ'אט טקסט",clickToStartCall:"לחץ להתחלת שיחה",realTimeVoice:"שיחה קולית בזמן אמת",startCall:"התחל שיחה",connecting:"מתחבר...",connectingSubtitle:"אנא המתן",listening:"מקשיב...",speakFreely:"דבר בחופשיות",liveTranscript:"תמלול בזמן אמת",transcriptWillAppear:"התמלול יופיע כאן במהלך השיחה...",mute:"השתק",speaker:"רמקול",endCall:"סיים שיחה",hello:"שלום! איך אפשר לעזור?",sendMessage:"שלח הודעה או עבור למצב קולי לשיחה בזמן אמת",online:"מקוון",newChat:"צ'אט חדש",back:"חזור",close:"סגור",error:"שגיאה",typeMessage:"הקלד הודעה...",sendMessageAria:"שלח הודעה",domainNotValidated:"דומיין לא מאומת",domainErrorMessage:"דומיין זה לא ברשימת המורשים. אנא פנה למנהל המערכת כדי להוסיף את כתובת האתר שלך לרשימה."},ar:{landingTitle:"كيف تريد التواصل؟",landingSubtitle:"اختر الطريقة المفضلة لديك",voiceCall:"مكالمة صوتية",textChat:"دردشة نصية",clickToStartCall:"انقر لبدء المكالمة",realTimeVoice:"محادثة صوتية في الوقت الفعلي",startCall:"ابدأ المكالمة",connecting:"جارٍ الاتصال...",connectingSubtitle:"يرجى الانتظار",listening:"الاستماع...",speakFreely:"تكلم بحرية",liveTranscript:"نص مباشر",transcriptWillAppear:"سيظهر النص هنا أثناء المكالمة...",mute:"كتم الصوت",speaker:"مكبر الصوت",endCall:"إنهاء المكالمة",hello:"مرحبا! كيف يمكنني المساعدة؟",sendMessage:"أرسل رسالة للبدء",online:"متصل",newChat:"محادثة جديدة",back:"رجوع",close:"إغلاق",error:"خطأ",typeMessage:"اكتب رسالة...",sendMessageAria:"إرسال رسالة",domainNotValidated:"النطاق غير معتمد",domainErrorMessage:"هذا النطاق غير مسموح به. يرجى الاتصال بالمسؤول لإضافة عنوان موقع الويب الخاص بك إلى القائمة."},ru:{landingTitle:"Как вы хотите общаться?",landingSubtitle:"Выберите предпочтительный способ",voiceCall:"Голосовой звонок",textChat:"Текстовый чат",clickToStartCall:"Нажмите, чтобы начать звонок",realTimeVoice:"Голосовой разговор в реальном времени",startCall:"Начать звонок",connecting:"Подключение...",connectingSubtitle:"Пожалуйста, подождите",listening:"Слушаю...",speakFreely:"Говорите свободно",liveTranscript:"Живая транскрипция",transcriptWillAppear:"Транскрипция появится здесь во время звонка...",mute:"Отключить звук",speaker:"Динамик",endCall:"Завершить звонок",hello:"Привет! Как я могу помочь?",sendMessage:"Отправьте сообщение для начала",online:"В сети",newChat:"Новый чат",back:"Назад",close:"Закрыть",error:"Ошибка",typeMessage:"Введите сообщение...",sendMessageAria:"Отправить сообщение",domainNotValidated:"Домен не проверен",domainErrorMessage:"Этот домен не в белом списке. Пожалуйста, свяжитесь с администратором, чтобы добавить URL вашего веб-сайта в список."},es:{landingTitle:"¿Cómo te gustaría comunicarte?",landingSubtitle:"Elige tu método preferido",voiceCall:"Llamada de voz",textChat:"Chat de texto",clickToStartCall:"Haz clic para iniciar la llamada",realTimeVoice:"Conversación de voz en tiempo real",startCall:"Iniciar llamada",connecting:"Conectando...",connectingSubtitle:"Por favor espere",listening:"Escuchando...",speakFreely:"Habla libremente",liveTranscript:"Transcripción en vivo",transcriptWillAppear:"La transcripción aparecerá aquí durante la llamada...",mute:"Silenciar",speaker:"Altavoz",endCall:"Terminar llamada",hello:"¡Hola! ¿Cómo puedo ayudarte?",sendMessage:"Envía un mensaje para comenzar",online:"En línea",newChat:"Nuevo chat",back:"Atrás",close:"Cerrar",error:"Error",typeMessage:"Escribe un mensaje...",sendMessageAria:"Enviar mensaje",domainNotValidated:"Dominio no validado",domainErrorMessage:"Este dominio no está en la lista blanca. Por favor, contacte al administrador para agregar la URL de su sitio web a la lista."},fr:{landingTitle:"Comment souhaitez-vous communiquer?",landingSubtitle:"Choisissez votre méthode préférée",voiceCall:"Appel vocal",textChat:"Chat texte",clickToStartCall:"Cliquez pour démarrer l'appel",realTimeVoice:"Conversation vocale en temps réel",startCall:"Démarrer l'appel",connecting:"Connexion...",connectingSubtitle:"Veuillez patienter",listening:"Écoute...",speakFreely:"Parlez librement",liveTranscript:"Transcripción en direct",transcriptWillAppear:"La transcription apparaîtra ici pendant l'appel...",mute:"Muet",speaker:"Haut-parleur",endCall:"Terminer l'appel",hello:"Bonjour! Comment puis-je vous aider?",sendMessage:"Envoyez un message pour commencer",online:"En ligne",newChat:"Nouveau chat",back:"Retour",close:"Fermer",error:"Erreur",typeMessage:"Tapez votre message...",sendMessageAria:"Envoyer un message",domainNotValidated:"Domaine non validé",domainErrorMessage:"Ce domaine n'est pas sur la liste blanche. Veuillez contacter l'administrateur pour ajouter l'URL de votre site Web à la liste."},de:{landingTitle:"Wie möchten Sie kommunizieren?",landingSubtitle:"Wählen Sie Ihre bevorzugte Methode",voiceCall:"Sprachanruf",textChat:"Text-Chat",clickToStartCall:"Klicken Sie, um den Anruf zu starten",realTimeVoice:"Sprachanruf in Echtzeit",startCall:"Anruf starten",connecting:"Verbinden...",connectingSubtitle:"Bitte warten",listening:"Hören...",speakFreely:"Sprechen Sie frei",liveTranscript:"Live-Transkription",transcriptWillAppear:"Die Transkription erscheint hier während des Anrufs...",mute:"Stumm",speaker:"Lautsprecher",endCall:"Anruf beenden",hello:"Hallo! Wie kann ich helfen?",sendMessage:"Senden Sie eine Nachricht zum Starten",online:"Online",newChat:"Neuer Chat",back:"Zurück",close:"Schließen",error:"Fehler",typeMessage:"Geben Sie eine Nachricht ein...",sendMessageAria:"Nachricht senden",domainNotValidated:"Domain nicht validiert",domainErrorMessage:"Diese Domain steht nicht auf der Whitelist. Bitte kontaktieren Sie den Administrator, um die URL Ihrer Website zur Liste hinzuzufügen."}};function ho(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return go(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(go(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,go(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,go(u,"constructor",c),go(c,"constructor",s),s.displayName="GeneratorFunction",go(c,o,"GeneratorFunction"),go(u),go(u,o,"Generator"),go(u,n,function(){return this}),go(u,"toString",function(){return"[object Generator]"}),(ho=function(){return{w:r,m:d}})()}function go(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}go=function(e,t,A,n){function r(t,A){go(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},go(e,t,A,n)}function fo(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function mo(e){return function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){fo(r,n,o,i,a,"next",e)}function a(e){fo(r,n,o,i,a,"throw",e)}i(void 0)})}}function vo(e){return vo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vo(e)}function Bo(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),A.push.apply(A,n)}return A}function wo(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?Bo(Object(A),!0).forEach(function(t){yo(e,t,A[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):Bo(Object(A)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}return e}function yo(e,t,A){return(t=Co(t))in e?Object.defineProperty(e,t,{value:A,enumerable:!0,configurable:!0,writable:!0}):e[t]=A,e}function bo(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Co(n.key),n)}}function Co(e){var t=function(e){if("object"!=vo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=vo(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==vo(t)?t:t+""}var xo=function(){return e=function e(){var t,A,n,o,r,i,a,s,c,l=this,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=this.mergeWithDefaults(u),this.sdk=new mA(this.config),this.isOpen=!1,this.isActive=!1,this.translations=po,this.currentView="landing",this.isStartingCall=!1,this.shadowRoot=null,this.container=null,this._pendingClientTools=null,this.config.useShadowDOM?(this.createShadowHost(),this.container=this.shadowRoot):(this.createRegularContainer(),this.container=this.regularContainer,this.shadowRoot=document);var d=wo(wo(wo({},this.config),this.config.voice),{},{inputPlaceholder:(null===(t=this.config.text)||void 0===t?void 0:t.inputPlaceholder)||this.config.inputPlaceholder||"Type your message...",sendButtonColor:(null===(A=this.config.text)||void 0===A?void 0:A.sendButtonColor)||this.config.sendButtonColor||"#7C3AED",language:(null===(n=this.config.voice)||void 0===n?void 0:n.language)||this.config.language||"en",signedUrl:this.config.signedUrl,agentSettingsOverride:this.config.agentSettingsOverride,visualAssistant:this.config.visualAssistant,translations:this.translations,shadowRoot:this.shadowRoot,textSDK:this.sdk,outputContainer:(null===(o=this.config.voice)||void 0===o?void 0:o.outputContainer)||"raw",outputEncoding:(null===(r=this.config.voice)||void 0===r?void 0:r.outputEncoding)||"pcm",outputSampleRate:(null===(i=this.config.voice)||void 0===i?void 0:i.outputSampleRate)||44100,outputChannels:(null===(a=this.config.voice)||void 0===a?void 0:a.outputChannels)||1,outputBitDepth:(null===(s=this.config.voice)||void 0===s?void 0:s.outputBitDepth)||16,onConversationStart:this.config.onConversationStart,onConversationEnd:this.config.onConversationEnd,onBargeIn:this.config.onBargeIn,onAudioStartPlaying:this.config.onAudioStartPlaying,onAudioStoppedPlaying:this.config.onAudioStoppedPlaying,onSubtitleDisplay:this.config.onSubtitleDisplay,onVoiceCallButtonClick:this.config.onVoiceCallButtonClick,onCallEnd:function(){var e,t,A=null===(e=l.voiceInterface)||void 0===e||null===(e=e.shadowRoot)||void 0===e?void 0:e.getElementById("voiceIdleState");if(A&&"none"!==A.style.display){var n=A.querySelector(".voice-status-title");if(n){var o,r=n.textContent.trim();if(r===(null===(o=l.voiceInterface)||void 0===o?void 0:o.t("domainNotValidated"))||r.includes("Domain not")||r.includes("not whitelisted"))return void console.log("🚫 Domain error is displayed - NOT returning to landing screen from onCallEnd")}}"unified"===((null===(t=l.config.behavior)||void 0===t?void 0:t.mode)||"unified")&&l.showLanding()},onShowVoice:function(){l.showVoice()},onShowLanding:function(){l.showLanding()},onErrorToast:function(e,t){l.showErrorToast(e,t)}});this.voiceInterface=new $n(d);var p=wo(wo(wo({},this.config),this.config.text),{},{translations:this.translations,shadowRoot:this.shadowRoot});if(this.textInterface=new ao(p,this.sdk),"unified"===((null===(c=this.config.behavior)||void 0===c?void 0:c.mode)||"unified")){var h=wo(wo({},this.config),{},{translations:this.translations,shadowRoot:this.shadowRoot});this.landingScreen=new uo(h)}else this.landingScreen=null;if(this.createWidget(),this.setupEventHandlers(),this.config.behavior.startOpen||this.config.behavior.autoOpen){var g,f=null===(g=this.shadowRoot)||void 0===g?void 0:g.getElementById("text-chat-panel");f&&(this.isOpen=!0,f.classList.add("open"))}this.checkAndHandleResume()},t=[{key:"checkAndHandleResume",value:function(){var e=this,t=this.voiceInterface.checkAndHandleResume();t&&(console.log("🔄 [WIDGET] Auto-resuming call from page navigation"),console.log(" From:",t.fromPage,"→ To:",t.toPage),this.open(),this.showVoice(),this.currentView="voice",setTimeout(function(){e.startVoiceCall().then(function(){console.log("✅ [WIDGET] Auto-resumed call successfully")}).catch(function(t){var A;console.error("❌ [WIDGET] Failed to auto-resume call:",t),"unified"===((null===(A=e.config.behavior)||void 0===A?void 0:A.mode)||"unified")&&e.showLanding()})},100))}},{key:"open",value:function(){var e;if(!this.isOpen){var t=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("text-chat-panel");t&&(this.isOpen=!0,t.classList.add("open"))}}},{key:"mergeWithDefaults",value:function(e){var t,A,n,o,r,i,a,s,c,l,u,d,p,h,g,f,m,v,B,w,y,b,C,x,Q,F,U,S,k,E,I,T,H,D,P,O,K,M,L,R,_,V,j,N,G,W,z,X,J,Y,q,Z,$,ee,te,Ae,ne,oe,re,ie,ae,se,ce,le,ue,de,pe,he,ge,fe,me,ve,Be,we,ye,be,Ce,xe,Qe,Fe,Ue,Se,ke,Ee,Ie,Te,He,De,Pe,Oe,Ke,Me,Le,Re,_e,Ve,je,Ne,Ge,We,ze,Xe,Je,Ye,qe,Ze,$e,et,tt,At,nt,ot,rt,it,at,st,ct,lt,ut,dt,pt,ht,gt,ft,mt,vt,Bt,wt,yt,bt,Ct,xt,Qt,Ft,Ut,St,kt,Et,It,Tt=e.position||"bottom-right";if("string"==typeof Tt){var Ht=Tt.split("-");Tt={vertical:Ht[0]||"bottom",horizontal:Ht[1]||"right",offset:e.positionOffset||{x:20,y:20}}}var Dt=e.primaryColor||(null===(t=e.button)||void 0===t?void 0:t.primaryColor)||(null===(A=e.button)||void 0===A?void 0:A.backgroundColor)||"#FFFFFF",Pt={};e.landing&&Object.keys(e.landing).forEach(function(t){var A=e.landing[t];null!=A&&""!==A&&(Pt[t]=A)});var Ot={};return e.header&&Object.keys(e.header).forEach(function(t){var A=e.header[t];null!=A&&""!==A&&(Ot[t]=A)}),wo({agentId:e.agentId,appId:e.appId,signedUrl:e.signedUrl,agentSettingsOverride:e.agentSettingsOverride,demo:!1!==e.demo,direction:e.direction||"ltr",language:e.language||"en",icon:wo({type:(null===(n=e.icon)||void 0===n?void 0:n.type)||"custom",customImage:(null===(o=e.icon)||void 0===o?void 0:o.customImage)||"https://talktopc.com/logo192.png",emoji:(null===(r=e.icon)||void 0===r?void 0:r.emoji)||"🎤",text:(null===(i=e.icon)||void 0===i?void 0:i.text)||"AI",size:(null===(a=e.icon)||void 0===a?void 0:a.size)||"medium",backgroundColor:(null===(s=e.icon)||void 0===s?void 0:s.backgroundColor)||"#FFFFFF"},e.icon),position:wo({vertical:Tt.vertical||"bottom",horizontal:Tt.horizontal||"right",offset:Tt.offset||{x:20,y:20}},"object"===vo(e.position)?e.position:{}),button:wo({size:(null===(c=e.button)||void 0===c?void 0:c.size)||"medium",shape:(null===(l=e.button)||void 0===l?void 0:l.shape)||"circle",backgroundColor:(null===(u=e.button)||void 0===u?void 0:u.backgroundColor)||(null===(d=e.icon)||void 0===d?void 0:d.backgroundColor)||"#FFFFFF",hoverColor:(null===(p=e.button)||void 0===p?void 0:p.hoverColor)||"#D3D3D3",shadow:!1!==(null===(h=e.button)||void 0===h?void 0:h.shadow),shadowColor:(null===(g=e.button)||void 0===g?void 0:g.shadowColor)||"rgba(0,0,0,0.15)",primaryColor:(null===(f=e.button)||void 0===f?void 0:f.backgroundColor)||(null===(m=e.icon)||void 0===m?void 0:m.backgroundColor)||"#FFFFFF"},e.button),panel:wo({width:(null===(v=e.panel)||void 0===v?void 0:v.width)||360,height:(null===(B=e.panel)||void 0===B?void 0:B.height)||500,borderRadius:(null===(w=e.panel)||void 0===w?void 0:w.borderRadius)||24,backgroundColor:(null===(y=e.panel)||void 0===y?void 0:y.backgroundColor)||"#FFFFFF",backdropFilter:(null===(b=e.panel)||void 0===b?void 0:b.backdropFilter)||null,border:(null===(C=e.panel)||void 0===C?void 0:C.border)||"1px solid #E5E7EB"},e.panel),voice:wo({micButtonColor:(null===(x=e.voice)||void 0===x?void 0:x.micButtonColor)||(null===(Q=e.panel)||void 0===Q?void 0:Q.micButtonColor)||Dt,micButtonActiveColor:(null===(F=e.voice)||void 0===F?void 0:F.micButtonActiveColor)||(null===(U=e.panel)||void 0===U?void 0:U.micButtonActiveColor)||"#EF4444",micButtonHint:wo(wo({text:(null===(S=e.voice)||void 0===S||null===(S=S.micButtonHint)||void 0===S?void 0:S.text)||(null===(k=e.panel)||void 0===k||null===(k=k.micButtonHint)||void 0===k?void 0:k.text)||"Click the button to start voice conversation",color:(null===(E=e.voice)||void 0===E||null===(E=E.micButtonHint)||void 0===E?void 0:E.color)||(null===(I=e.panel)||void 0===I||null===(I=I.micButtonHint)||void 0===I?void 0:I.color)||"#6B7280",fontSize:(null===(T=e.voice)||void 0===T||null===(T=T.micButtonHint)||void 0===T?void 0:T.fontSize)||(null===(H=e.panel)||void 0===H||null===(H=H.micButtonHint)||void 0===H?void 0:H.fontSize)||"12px"},null===(D=e.voice)||void 0===D?void 0:D.micButtonHint),null===(P=e.panel)||void 0===P?void 0:P.micButtonHint),avatarBackgroundColor:(null===(O=e.voice)||void 0===O?void 0:O.avatarBackgroundColor)||"#667eea",avatarActiveBackgroundColor:(null===(K=e.voice)||void 0===K?void 0:K.avatarActiveBackgroundColor)||"#667eea",statusTitleColor:(null===(M=e.voice)||void 0===M?void 0:M.statusTitleColor)||"#1e293b",statusSubtitleColor:(null===(L=e.voice)||void 0===L?void 0:L.statusSubtitleColor)||"#64748b",statusDotColor:(null===(R=e.voice)||void 0===R?void 0:R.statusDotColor)||"#10b981",statusText:(null===(_=e.voice)||void 0===_?void 0:_.statusText)||null,startCallButtonColor:(null===(V=e.voice)||void 0===V?void 0:V.startCallButtonColor)||"#667eea",startCallButtonTextColor:(null===(j=e.voice)||void 0===j?void 0:j.startCallButtonTextColor)||"#FFFFFF",startCallTitle:(null===(N=e.voice)||void 0===N?void 0:N.startCallTitle)||null,startCallSubtitle:(null===(G=e.voice)||void 0===G?void 0:G.startCallSubtitle)||null,startCallButtonText:(null===(W=e.voice)||void 0===W?void 0:W.startCallButtonText)||null,transcriptBackgroundColor:(null===(z=e.voice)||void 0===z?void 0:z.transcriptBackgroundColor)||"#FFFFFF",transcriptTextColor:(null===(X=e.voice)||void 0===X?void 0:X.transcriptTextColor)||"#1e293b",transcriptLabelColor:(null===(J=e.voice)||void 0===J?void 0:J.transcriptLabelColor)||"#94a3b8",controlButtonColor:(null===(Y=e.voice)||void 0===Y?void 0:Y.controlButtonColor)||"#FFFFFF",controlButtonSecondaryColor:(null===(q=e.voice)||void 0===q?void 0:q.controlButtonSecondaryColor)||"#64748b",endCallButtonColor:(null===(Z=e.voice)||void 0===Z?void 0:Z.endCallButtonColor)||"#ef4444",language:(null===($=e.voice)||void 0===$?void 0:$.language)||e.language||"en"},e.voice),text:wo({sendButtonColor:(null===(ee=e.text)||void 0===ee?void 0:ee.sendButtonColor)||(null===(te=e.panel)||void 0===te?void 0:te.sendButtonColor)||"#7C3AED",sendButtonHoverColor:(null===(Ae=e.text)||void 0===Ae?void 0:Ae.sendButtonHoverColor)||(null===(ne=e.panel)||void 0===ne?void 0:ne.sendButtonHoverColor)||"#6D28D9",sendButtonActiveColor:(null===(oe=e.text)||void 0===oe?void 0:oe.sendButtonActiveColor)||(null===(re=e.panel)||void 0===re?void 0:re.sendButtonActiveColor)||"#6D28D9",sendButtonText:(null===(ie=e.text)||void 0===ie?void 0:ie.sendButtonText)||(null===(ae=e.panel)||void 0===ae?void 0:ae.sendButtonText)||"➤",sendButtonTextColor:(null===(se=e.text)||void 0===se?void 0:se.sendButtonTextColor)||(null===(ce=e.panel)||void 0===ce?void 0:ce.sendButtonTextColor)||"#FFFFFF",sendButtonFontSize:(null===(le=e.text)||void 0===le?void 0:le.sendButtonFontSize)||(null===(ue=e.panel)||void 0===ue?void 0:ue.sendButtonFontSize)||"18px",sendButtonFontWeight:(null===(de=e.text)||void 0===de?void 0:de.sendButtonFontWeight)||(null===(pe=e.panel)||void 0===pe?void 0:pe.sendButtonFontWeight)||"500",sendButtonHint:wo(wo({text:(null===(he=e.text)||void 0===he||null===(he=he.sendButtonHint)||void 0===he?void 0:he.text)||(null===(ge=e.panel)||void 0===ge||null===(ge=ge.sendButtonHint)||void 0===ge?void 0:ge.text)||"",color:(null===(fe=e.text)||void 0===fe||null===(fe=fe.sendButtonHint)||void 0===fe?void 0:fe.color)||(null===(me=e.panel)||void 0===me||null===(me=me.sendButtonHint)||void 0===me?void 0:me.color)||"#6B7280",fontSize:(null===(ve=e.text)||void 0===ve||null===(ve=ve.sendButtonHint)||void 0===ve?void 0:ve.fontSize)||(null===(Be=e.panel)||void 0===Be||null===(Be=Be.sendButtonHint)||void 0===Be?void 0:Be.fontSize)||"12px"},null===(we=e.text)||void 0===we?void 0:we.sendButtonHint),null===(ye=e.panel)||void 0===ye?void 0:ye.sendButtonHint),inputPlaceholder:(null===(be=e.text)||void 0===be?void 0:be.inputPlaceholder)||(null===(Ce=e.panel)||void 0===Ce?void 0:Ce.inputPlaceholder)||"Type your message...",inputBorderColor:(null===(xe=e.text)||void 0===xe?void 0:xe.inputBorderColor)||(null===(Qe=e.panel)||void 0===Qe?void 0:Qe.inputBorderColor)||"#E5E7EB",inputFocusColor:(null===(Fe=e.text)||void 0===Fe?void 0:Fe.inputFocusColor)||(null===(Ue=e.panel)||void 0===Ue?void 0:Ue.inputFocusColor)||"#7C3AED",inputBackgroundColor:(null===(Se=e.text)||void 0===Se?void 0:Se.inputBackgroundColor)||(null===(ke=e.panel)||void 0===ke?void 0:ke.inputBackgroundColor)||"#FFFFFF",inputTextColor:(null===(Ee=e.text)||void 0===Ee?void 0:Ee.inputTextColor)||(null===(Ie=e.panel)||void 0===Ie?void 0:Ie.inputTextColor)||"#1F2937",inputFontSize:(null===(Te=e.text)||void 0===Te?void 0:Te.inputFontSize)||(null===(He=e.panel)||void 0===He?void 0:He.inputFontSize)||"14px",inputBorderRadius:(null===(De=e.text)||void 0===De?void 0:De.inputBorderRadius)||(null===(Pe=e.panel)||void 0===Pe?void 0:Pe.inputBorderRadius)||20,inputPadding:(null===(Oe=e.text)||void 0===Oe?void 0:Oe.inputPadding)||(null===(Ke=e.panel)||void 0===Ke?void 0:Ke.inputPadding)||"6px 14px"},e.text),landing:function(){var t={};return e.landing&&Object.keys(e.landing).forEach(function(A){var n=e.landing[A];(null!=n&&""!==n||!1===n)&&(t[A]=n)}),wo({backgroundColor:t.backgroundColor||"linear-gradient(180deg, #f8fafc 0%, #e0e7ff 100%)",logo:t.logo||"🤖",title:t.title||null,titleColor:t.titleColor||"#1e293b",modeCardBackgroundColor:t.modeCardBackgroundColor||"#FFFFFF",modeCardBorderColor:t.modeCardBorderColor||"#E2E8F0",modeCardHoverBorderColor:t.modeCardHoverBorderColor||"#7C3AED",modeCardIconBackgroundColor:t.modeCardIconBackgroundColor||"#7C3AED",modeCardTitleColor:t.modeCardTitleColor||"#111827",voiceCardIcon:t.voiceCardIcon||"🎤",textCardIcon:t.textCardIcon||"💬",voiceCardTitle:t.voiceCardTitle||null,textCardTitle:t.textCardTitle||null},t)}(),header:function(){var t={};return e.header&&Object.keys(e.header).forEach(function(A){var n=e.header[A];A.startsWith("onlineIndicator")?null!=n&&(t[A]=n):null!=n&&""!==n&&(t[A]=n)}),wo({title:t.title||"Chat Assistant",showTitle:!1!==t.showTitle,backgroundColor:t.backgroundColor||"#7C3AED",textColor:t.textColor||"#FFFFFF",showCloseButton:!1!==t.showCloseButton},t)}(),footer:wo({show:!1!==(null===(Me=e.footer)||void 0===Me?void 0:Me.show),backgroundColor:(null===(Le=e.footer)||void 0===Le?void 0:Le.backgroundColor)||"#f9fafb",textColor:(null===(Re=e.footer)||void 0===Re?void 0:Re.textColor)||"#9ca3af",hoverColor:(null===(_e=e.footer)||void 0===_e?void 0:_e.hoverColor)||"#7C3AED"},e.footer),tooltips:wo({newChat:(null===(Ve=e.tooltips)||void 0===Ve?void 0:Ve.newChat)||null,back:(null===(je=e.tooltips)||void 0===je?void 0:je.back)||null,close:(null===(Ne=e.tooltips)||void 0===Ne?void 0:Ne.close)||null,mute:(null===(Ge=e.tooltips)||void 0===Ge?void 0:Ge.mute)||null,speaker:(null===(We=e.tooltips)||void 0===We?void 0:We.speaker)||null,endCall:(null===(ze=e.tooltips)||void 0===ze?void 0:ze.endCall)||null},e.tooltips),messages:wo({userBackgroundColor:(null===(Xe=e.messages)||void 0===Xe?void 0:Xe.userBackgroundColor)||"#E5E7EB",agentBackgroundColor:(null===(Je=e.messages)||void 0===Je?void 0:Je.agentBackgroundColor)||"#F3F4F6",systemBackgroundColor:(null===(Ye=e.messages)||void 0===Ye?void 0:Ye.systemBackgroundColor)||"#DCFCE7",errorBackgroundColor:(null===(qe=e.messages)||void 0===qe?void 0:qe.errorBackgroundColor)||"#FEE2E2",textColor:(null===(Ze=e.messages)||void 0===Ze?void 0:Ze.textColor)||"#1F2937",userTextColor:(null===($e=e.messages)||void 0===$e?void 0:$e.userTextColor)||(null===(et=e.messages)||void 0===et?void 0:et.textColor)||"#1F2937",agentTextColor:(null===(tt=e.messages)||void 0===tt?void 0:tt.agentTextColor)||(null===(At=e.messages)||void 0===At?void 0:At.textColor)||"#1F2937",userAvatarIcon:(null===(nt=e.messages)||void 0===nt?void 0:nt.userAvatarIcon)||"👤",agentAvatarIcon:(null===(ot=e.messages)||void 0===ot?void 0:ot.agentAvatarIcon)||"🤖",fontSize:(null===(rt=e.messages)||void 0===rt?void 0:rt.fontSize)||"14px",borderRadius:(null===(it=e.messages)||void 0===it?void 0:it.borderRadius)||16},e.messages),animation:wo({enableHover:!1!==(null===(at=e.animation)||void 0===at?void 0:at.enableHover),enablePulse:!1!==(null===(st=e.animation)||void 0===st?void 0:st.enablePulse),enableSlide:!1!==(null===(ct=e.animation)||void 0===ct?void 0:ct.enableSlide),duration:(null===(lt=e.animation)||void 0===lt?void 0:lt.duration)||.3},e.animation),promptAnimation:wo({enabled:!0===(null===(ut=e.promptAnimation)||void 0===ut?void 0:ut.enabled),text:(null===(dt=e.promptAnimation)||void 0===dt?void 0:dt.text)||"Try me!",backgroundColor:(null===(pt=e.promptAnimation)||void 0===pt?void 0:pt.backgroundColor)||"linear-gradient(135deg, #7c3aed, #4f46e5)",textColor:(null===(ht=e.promptAnimation)||void 0===ht?void 0:ht.textColor)||"#ffffff",animationType:(null===(gt=e.promptAnimation)||void 0===gt?void 0:gt.animationType)||"bounce",showShimmer:!1!==(null===(ft=e.promptAnimation)||void 0===ft?void 0:ft.showShimmer),showPulseRings:!1!==(null===(mt=e.promptAnimation)||void 0===mt?void 0:mt.showPulseRings),hideAfterClick:!1!==(null===(vt=e.promptAnimation)||void 0===vt?void 0:vt.hideAfterClick),hideAfterSeconds:void 0!==(null===(Bt=e.promptAnimation)||void 0===Bt?void 0:Bt.hideAfterSeconds)?e.promptAnimation.hideAfterSeconds:null,position:(null===(wt=e.promptAnimation)||void 0===wt?void 0:wt.position)||"top"},e.promptAnimation),behavior:wo({autoOpen:(null===(yt=e.behavior)||void 0===yt?void 0:yt.autoOpen)||!1,startOpen:(null===(bt=e.behavior)||void 0===bt?void 0:bt.startOpen)||!1,hidden:(null===(Ct=e.behavior)||void 0===Ct?void 0:Ct.hidden)||!1,autoConnect:(null===(xt=e.behavior)||void 0===xt?void 0:xt.autoConnect)||!1,showWelcomeMessage:!1!==(null===(Qt=e.behavior)||void 0===Qt?void 0:Qt.showWelcomeMessage),welcomeMessage:(null===(Ft=e.behavior)||void 0===Ft?void 0:Ft.welcomeMessage)||"Hello! How can I help you today?",enableVoiceMode:void 0===(null===(Ut=e.behavior)||void 0===Ut?void 0:Ut.enableVoiceMode)||e.behavior.enableVoiceMode,mode:(null===(St=e.behavior)||void 0===St?void 0:St.mode)||"unified"},e.behavior),accessibility:wo({ariaLabel:(null===(kt=e.accessibility)||void 0===kt?void 0:kt.ariaLabel)||"Chat Assistant",ariaDescription:(null===(Et=e.accessibility)||void 0===Et?void 0:Et.ariaDescription)||"Click to open chat assistant",keyboardNavigation:!1!==(null===(It=e.accessibility)||void 0===It?void 0:It.keyboardNavigation)},e.accessibility),customStyles:e.customStyles||"",useShadowDOM:!1!==e.useShadowDOM,variables:e.variables||{},forceConversationId:e.forceConversationId,visualAssistant:e.visualAssistant,onConversationStart:e.onConversationStart,onConversationEnd:e.onConversationEnd,onBargeIn:e.onBargeIn,onAudioStartPlaying:e.onAudioStartPlaying,onAudioStoppedPlaying:e.onAudioStoppedPlaying,onSubtitleDisplay:e.onSubtitleDisplay,onVoiceCallButtonClick:e.onVoiceCallButtonClick,primaryColor:Dt},"string"==typeof e.position?{positionString:e.position}:{})}},{key:"setupEventHandlers",value:function(){var e=this;this.sdk.on("domainError",function(t){e.textInterface.showError(t),e.textInterface.stopStreamingState()}),this.sdk.on("error",function(t){t&&("DOMAIN_NOT_WHITELISTED"===t.message||t.message&&t.message.includes("Domain not whitelisted"))||(e.textInterface.showError(t.message||t),e.textInterface.stopStreamingState())}),this.sdk.on("chunk",function(t){e.textInterface.appendStreamingChunk(t)}),this.sdk.on("done",function(t){var A=t.text;e.textInterface.finalizeStreaming(A)})}},{key:"createShadowHost",value:function(){var e=document.getElementById("ttp-widget-shadow-host");e&&e.remove();var t=document.createElement("div");t.id="ttp-widget-shadow-host",t.style.cssText="position: fixed; z-index: 10000; pointer-events: none; top: 0; left: 0; width: 100%; height: 100%; overflow: visible;",this.shadowRoot=t.attachShadow({mode:"open"}),document.body.appendChild(t)}},{key:"createRegularContainer",value:function(){var e=document.getElementById("ttp-widget-container");e&&e.remove();var t=document.createElement("div");t.id="ttp-widget-container",t.style.cssText="position: fixed; z-index: 10000; pointer-events: none; top: 0; left: 0; width: 100%; height: 100%; overflow: visible;",document.body.appendChild(t),this.regularContainer=t}},{key:"createWidget",value:function(){var e=this;this.container||(this.config.useShadowDOM?(this.createShadowHost(),this.container=this.shadowRoot):(this.createRegularContainer(),this.container=this.regularContainer,this.shadowRoot=document));var t;t=this.config.useShadowDOM?"\n :host {\n all: initial;\n display: block;\n pointer-events: none;\n }\n img {\n max-width: none !important;\n }\n #text-chat-button img {\n width: 28px !important;\n height: 28px !important;\n }\n #text-chat-button {\n pointer-events: auto;\n }\n #text-chat-panel {\n pointer-events: auto;\n }\n ":'\n /* Reset only problematic inherited styles, not all styles */\n #text-chat-button,\n #text-chat-panel,\n #text-chat-panel * {\n box-sizing: border-box;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n }\n \n /* Prevent theme CSS from affecting images */\n #text-chat-button img,\n #text-chat-panel img {\n max-width: none !important;\n width: auto;\n height: auto;\n }\n \n #text-chat-button img {\n width: 28px !important;\n height: 28px !important;\n }\n \n /* Ensure button and panel can receive clicks */\n #text-chat-button,\n #text-chat-panel {\n pointer-events: auto;\n }\n \n /* Reset any inherited text styles that might break layout */\n #text-chat-panel {\n text-align: left;\n line-height: normal;\n letter-spacing: normal;\n word-spacing: normal;\n text-transform: none;\n text-indent: 0;\n text-shadow: none;\n white-space: normal;\n }\n \n /* Ensure flexbox works properly */\n #text-chat-panel .widget-shell,\n #text-chat-panel .panel-inner,\n #text-chat-panel .widget-container,\n #text-chat-panel .landing-screen,\n #text-chat-panel .voice-interface,\n #text-chat-panel .text-interface,\n #text-chat-panel .widget-header,\n #text-chat-panel .mode-selection {\n display: flex;\n }\n \n #text-chat-panel .widget-shell,\n #text-chat-panel .panel-inner,\n #text-chat-panel .widget-container,\n #text-chat-panel .landing-screen,\n #text-chat-panel .voice-interface,\n #text-chat-panel .text-interface {\n flex-direction: column;\n }\n \n #text-chat-panel .mode-selection {\n flex-direction: row;\n }\n \n /* Ensure proper stacking */\n #text-chat-button {\n z-index: 10001 !important;\n }\n \n #text-chat-panel {\n z-index: 10000 !important;\n }\n ';var A=this.generateWidgetHTML();if(this.config.useShadowDOM){var n="\n <style>".concat(t,"</style>\n ").concat(A,"\n ");this.shadowRoot.innerHTML=n}else this.injectStylesIntoHead(t),this.container.innerHTML=A;this.setupWidgetEvents();var o=this.shadowRoot.getElementById("text-chat-panel");o?this.config.behavior.startOpen||this.config.behavior.autoOpen?(this.isOpen=!0,o.classList.add("open"),this.hidePrompt()):this.showPrompt():setTimeout(function(){e.showPrompt()},100),setTimeout(function(){e.isOpen?e.hidePrompt():e.showPrompt()},200)}},{key:"injectStylesIntoHead",value:function(e){var t,A,n=document.getElementById("ttp-widget-styles");n&&n.remove();var o={small:50,medium:60,large:70,xl:80}[null===(t=this.config.button)||void 0===t?void 0:t.size]||60,r={small:20,medium:28,large:36,xl:44}[null===(A=this.config.icon)||void 0===A?void 0:A.size]||28,i=this.generatePositionStyles(),a=this.generateCSS(i,o,r),s=document.createElement("style");s.id="ttp-widget-styles",s.textContent=e+"\n"+a,this.config.customStyles&&(s.textContent+="\n"+this.config.customStyles),document.head.appendChild(s)}},{key:"generateWidgetHTML",value:function(){var e,t=this,A=(this.config.position,this.config.button),n=this.config.icon,o=(this.config.panel,this.config.header),r=(this.config.animation,{small:50,medium:60,large:70,xl:80}[A.size]||60),i={small:20,medium:28,large:36,xl:44}[n.size]||28,a=this.generatePositionStyles(),s=this.generateIconHTML(i),c=(null===(e=this.config.behavior)||void 0===e?void 0:e.mode)||"unified",l="unified"===c,u="unified"===c||"voice-only"===c,d="unified"===c||"text-only"===c,p=function(e){var A=t.config.language||"en";return(t.translations[A]||t.translations.en)[e]||e},h=function(e){var A,n=null===(A=t.config.tooltips)||void 0===A?void 0:A[e];return null!=n?n:{newChat:p("newChat"),back:p("back"),close:p("close"),mute:p("mute"),speaker:p("speaker"),endCall:p("endCall")}[e]||""},g=this.config.useShadowDOM?"\n <style>\n ".concat(this.generateCSS(a,r,i),"\n ").concat(this.config.customStyles,"\n </style>\n "):"",f=this.config.promptAnimation||{},m=!0===f.enabled,v=m?this.generatePromptBubbleHTML(f,r):"";return console.log("📝 generateWidgetHTML - promptAnimation:",{hasConfig:!!this.config.promptAnimation,promptConfig:f,enabled:f.enabled,isPromptEnabled:m,willGenerateHTML:!!v}),"\n ".concat(g,"\n \n ").concat(this.config.behavior.hidden?"":'\n <div id="text-chat-button-container">\n '.concat(v,"\n ").concat(m&&!1!==f.showPulseRings?this.generatePulseRingsHTML(f):"",'\n <button id="text-chat-button" \n aria-label="').concat(this.config.accessibility.ariaLabel,'"\n aria-description="').concat(this.config.accessibility.ariaDescription,'">\n ').concat(s,"\n </button>\n </div>\n "),'\n \n <div id="text-chat-panel">\n <div class="widget-shell">\n <div class="panel-inner widget-container" style="direction: ').concat(this.config.direction,';">\n <div class="widget-header" style="background: ').concat(o.backgroundColor||"#7C3AED"," !important; color: ").concat(o.textColor||"#FFFFFF",' !important;">\n <div>\n ').concat(o.showTitle?'<div class="header-title">'.concat(o.title,"</div>"):"",'\n <div class="header-status" style="color: ').concat(o.onlineIndicatorColor||"rgba(255,255,255,0.7)",' !important;">\n <span class="status-dot" style="background: ').concat(o.onlineIndicatorDotColor||"#10b981",' !important;"></span>\n <span>').concat(void 0!==o.onlineIndicatorText&&null!==o.onlineIndicatorText?o.onlineIndicatorText:p("online"),'</span>\n </div>\n </div>\n \n <div style="display: flex; gap: 6px; align-items: center; position: relative; z-index: 1;">\n \x3c!-- New Chat Button (hide on landing screen, show otherwise) --\x3e\n <button class="header-icon new-chat-btn" id="newChatBtn" title="').concat(h("newChat"),'" style="').concat(l?"display: none;":"",'">\n <span style="font-size: 18px; font-weight: bold;">+</span>\n </button>\n \n \x3c!-- Back Button (only show in unified mode) --\x3e\n ').concat("unified"===c?'<button class="header-icon back-btn" id="backBtn" title="'.concat(h("back"),'" style="display: none;">\n <span style="font-size: 16px;">‹</span>\n </button>'):"","\n \n \x3c!-- Close Button --\x3e\n ").concat(o.showCloseButton?'<button class="header-icon close-btn" id="closeBtn" title="'+h("close")+'"><span style="font-size: 18px; font-weight: bold;">×</span></button>':"","\n </div>\n </div>\n\n ").concat(l&&this.landingScreen?this.landingScreen.generateHTML():"","\n\n ").concat(u?this.voiceInterface.generateHTML():"","\n ").concat(d?this.textInterface.generateHTML():"","\n ").concat(this.generateFooterHTML(),"\n </div>\n </div>\n </div>\n ")}},{key:"generateFooterHTML",value:function(){if(!this.config.footer.show)return"";var e=encodeURIComponent(window.location.hostname||"widget"),t="https://talktopc.com?ref=widget&source=".concat(e);return'\n <div class="widget-footer" style="\n padding: 10px 16px;\n text-align: center;\n border-top: 1px solid rgba(0,0,0,0.06);\n font-size: 11px;\n color: #64748b;\n background: #fff;\n flex-shrink: 0;\n ">\n <div class="powered-by" style="\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n ">\n <svg viewBox="0 0 24 24" fill="currentColor" style="width: 11px; height: 11px; color: #f59e0b;">\n <polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/>\n </svg>\n Powered by <a href="'.concat(t,'" target="_blank" rel="noopener noreferrer" style="color: #a855f7; text-decoration: none; font-weight: 500;" onmouseover="this.style.color=\'#9333ea\'" onmouseout="this.style.color=\'#a855f7\'">TalkToPC</a>\n </div>\n </div>\n ')}},{key:"generatePositionStyles",value:function(){var e=this.config.position,t=e.offset||{x:20,y:20},A="";return"top"===e.vertical?A+="top: ".concat(t.y,"px;"):"bottom"===e.vertical?A+="bottom: ".concat(t.y,"px;"):"center"===e.vertical&&(A+="top: 50%; transform: translateY(-50%);"),"left"===e.horizontal?A+="left: ".concat(t.x,"px;"):"right"===e.horizontal?A+="right: ".concat(t.x,"px;"):"center"===e.horizontal&&(A+="left: 50%; transform: translateX(-50%);"),A}},{key:"generateIconHTML",value:function(e){var t=this.config.icon;switch(t.type){case"custom":return'<img src="'.concat(t.customImage,'" alt="Chat Assistant" style="width: ').concat(e,"px; height: ").concat(e,'px; object-fit: contain;" />');case"emoji":return'<span style="font-size: '.concat(e,'px; line-height: 1;">').concat(t.emoji,"</span>");case"text":return'<span style="font-size: '.concat(Math.floor(.6*e),'px; font-weight: bold; color: white;">').concat(t.text,"</span>");case"microphone":default:return'<svg viewBox="0 0 24 24" style="width: '.concat(e,"px; height: ").concat(e,'px; fill: white;">\n <path d="M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"/>\n <path d="M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"/>\n </svg>');case"chat":return'<svg viewBox="0 0 24 24" style="width: '.concat(e,"px; height: ").concat(e,'px; fill: white;">\n <path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"/>\n </svg>')}}},{key:"generatePromptBubbleHTML",value:function(e,t){var A="#7c3aed";if(e.backgroundColor&&e.backgroundColor.includes("gradient")){var n=e.backgroundColor.match(/#[0-9a-fA-F]{6}/);n&&(A=n[0])}else A=e.backgroundColor;var o="none"===e.animationType?"":"animation-".concat(e.animationType),r=e.showShimmer?'<div class="prompt-bubble-shimmer"></div>':"";return'\n <div class="prompt-bubble '.concat(e.position," ").concat(o,'" \n id="prompt-bubble"\n role="tooltip"\n style="--prompt-bubble-bg-color: ').concat(A,';">\n <div class="prompt-bubble-content" \n style="background: ').concat(e.backgroundColor,"; color: ").concat(e.textColor,';">\n ').concat(r,'\n <span style="position: relative; z-index: 1;">').concat(e.text,'</span>\n </div>\n <div class="prompt-bubble-arrow"></div>\n </div>\n ')}},{key:"generatePulseRingsHTML",value:function(e){var t="#7c3aed";if(e.backgroundColor&&e.backgroundColor.includes("gradient")){var A=e.backgroundColor.match(/#[0-9a-fA-F]{6}/);A&&(t=A[0])}else t=e.backgroundColor;return'\n <div class="prompt-pulse-rings" id="prompt-pulse-rings">\n <div class="prompt-pulse-ring" style="background-color: '.concat(t,'33;"></div>\n <div class="prompt-pulse-ring" style="background-color: ').concat(t,'1a;"></div>\n </div>\n ')}},{key:"generateCSS",value:function(e,t,A){var n,o,r,i,a,s=this.config.button,c=this.config.icon,l=this.config.panel,u=this.config.header,d=(this.config.messages,this.config.animation),p=(null===(n=this.config.behavior)||void 0===n?void 0:n.mode)||"unified",h="unified"===p,g="unified"===p||"voice-only"===p,f="unified"===p||"text-only"===p,m=!1===this.config.useShadowDOM?" !important":"";return'\n /* MOBILE FIRST - Default styles for all devices */\n #text-chat-widget {\n position: fixed !important;\n z-index: 10000;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n /* Mobile defaults */\n right: 10px;\n bottom: 10px;\n left: auto;\n top: auto;\n }\n \n /* Desktop positioning (only on larger screens) */\n @media (min-width: 769px) {\n #text-chat-widget {\n '.concat(e,"\n right: ").concat("right"===this.config.position.horizontal?"20px":"auto",";\n left: ").concat("left"===this.config.position.horizontal?"20px":"auto",";\n bottom: ").concat("bottom"===this.config.position.vertical?"20px":"auto",";\n top: ").concat("top"===this.config.position.vertical?"20px":"auto",";\n }\n }\n \n /* Mobile override (force mobile positioning) */\n @media (max-width: 768px) {\n #text-chat-widget {\n right: 10px !important;\n bottom: 10px !important;\n left: auto !important;\n top: auto !important;\n transform: none !important;\n }\n }\n \n @media (max-width: 480px) {\n #text-chat-widget {\n right: 8px !important;\n bottom: 8px !important;\n left: auto !important;\n top: auto !important;\n }\n }\n \n #text-chat-button {\n position: relative;\n width: ").concat(t,"px;\n height: ").concat(t,"px;\n margin: 0;\n flex-shrink: 0;\n border-radius: ").concat("circle"===s.shape?"50%":"square"===s.shape?"0":"12px",";\n background: ").concat(s.backgroundColor||c.backgroundColor||"#7C3AED",";\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all ").concat(d.duration,"s ease;\n box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);\n touch-action: manipulation;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n user-select: none;\n min-width: 44px;\n min-height: 44px;\n z-index: 1;\n }\n \n @media (max-width: 768px) {\n #text-chat-widget {\n right: 10px !important;\n bottom: 10px !important;\n left: auto !important;\n top: auto !important;\n transform: none !important;\n }\n \n #text-chat-button-container {\n width: 56px !important;\n height: 56px !important;\n }\n \n #text-chat-button {\n width: 56px !important;\n height: 56px !important;\n min-width: 56px !important;\n min-height: 56px !important;\n max-width: 56px !important;\n max-height: 56px !important;\n }\n \n #text-chat-panel {\n position: fixed !important;\n left: 10px !important;\n right: 10px !important;\n bottom: 92px !important; /* 56px button + 20px gap + 16px footer */\n top: 60px !important; /* Add top spacing */\n width: auto !important;\n max-width: none !important;\n height: auto !important; /* Change from max-height to auto */\n max-height: none !important; /* Remove max-height */\n transform: none !important;\n margin: 0 !important;\n }\n \n #text-chat-panel .widget-header {\n padding: 10px 14px;\n min-height: 56px;\n }\n \n #text-chat-panel .header-title {\n font-size: 15px;\n }\n \n #text-chat-panel .header-icon {\n width: 40px;\n height: 40px;\n min-width: 40px;\n min-height: 40px;\n }\n \n #text-chat-input {\n font-size: 16px !important; /* Prevents iOS zoom on focus */\n padding: 12px 16px !important;\n min-height: 48px !important;\n }\n \n #text-chat-send {\n min-width: 48px !important;\n min-height: 48px !important;\n width: 48px !important;\n height: 48px !important;\n }\n \n .landing-screen {\n padding: 16px;\n }\n \n .landing-logo {\n font-size: 40px;\n }\n \n .landing-title {\n font-size: 18px;\n margin-bottom: 16px;\n }\n \n .mode-selection {\n flex-direction: column;\n gap: 12px;\n align-items: center;\n }\n \n .mode-card {\n max-width: 100%;\n width: 100%;\n padding: 16px;\n }\n \n .mode-card-icon {\n width: 50px;\n height: 50px;\n font-size: 28px;\n }\n \n .mode-card-title {\n font-size: 14px;\n }\n }\n \n @media (max-width: 480px) {\n #text-chat-widget {\n right: 8px !important;\n bottom: 8px !important;\n left: auto !important;\n top: auto !important;\n }\n \n #text-chat-button-container {\n width: 54px !important;\n height: 54px !important;\n }\n \n #text-chat-button {\n width: 54px !important;\n height: 54px !important;\n min-width: 54px !important;\n min-height: 54px !important;\n }\n \n #text-chat-panel {\n left: 8px !important;\n right: 8px !important;\n bottom: 86px !important; /* 54px button + 20px gap + 12px footer */\n top: 50px !important; /* Add top spacing for very small screens */\n height: auto !important;\n max-height: none !important;\n }\n \n #text-chat-panel .widget-header {\n padding: 8px 12px;\n min-height: 52px;\n }\n \n #text-chat-panel .header-title {\n font-size: 14px;\n }\n \n .landing-logo {\n font-size: 36px;\n }\n \n .landing-title {\n font-size: 16px;\n }\n }\n \n ").concat(d.enableHover?"\n #text-chat-button:hover {\n ".concat(s.hoverColor?"background: ".concat(s.hoverColor,";"):"","\n transform: scale(1.05);\n box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);\n }\n "):"","\n \n /* Prompt Animation Keyframes */\n @keyframes widget-shimmer {\n 0% { transform: translateX(-100%); }\n 100% { transform: translateX(200%); }\n }\n \n @keyframes widget-ripple {\n 0% { transform: scale(1); opacity: 0.6; }\n 100% { transform: scale(2.5); opacity: 0; }\n }\n \n @keyframes widget-float {\n 0%, 100% { transform: translateX(-50%) translateY(0); }\n 50% { transform: translateX(-50%) translateY(-8px); }\n }\n \n @keyframes widget-bounce {\n 0%, 100% { transform: translateX(-50%) translateY(0); }\n 50% { transform: translateX(-50%) translateY(-10px); }\n }\n \n @keyframes widget-pulse-ring {\n 0% { transform: scale(1); opacity: 0.4; }\n 100% { transform: scale(1.8); opacity: 0; }\n }\n \n /* Prompt Bubble Container */\n #text-chat-button-container {\n position: fixed;\n ").concat("bottom"===this.config.position.vertical?"bottom: ".concat((null===(o=this.config.position.offset)||void 0===o?void 0:o.y)||20,"px;"):"top: ".concat((null===(r=this.config.position.offset)||void 0===r?void 0:r.y)||20,"px;"),"\n ").concat("right"===this.config.position.horizontal?"right: ".concat((null===(i=this.config.position.offset)||void 0===i?void 0:i.x)||20,"px;"):"left: ".concat((null===(a=this.config.position.offset)||void 0===a?void 0:a.x)||20,"px;"),"\n width: ").concat(t,"px;\n height: ").concat(t,"px;\n z-index: 10001;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n \n @media (max-width: 768px) {\n #text-chat-button-container {\n right: 10px !important;\n bottom: 10px !important;\n left: auto !important;\n top: auto !important;\n }\n }\n \n @media (max-width: 480px) {\n #text-chat-button-container {\n right: 8px !important;\n bottom: 8px !important;\n left: auto !important;\n top: auto !important;\n }\n }\n \n /* Prompt Bubble Styles */\n .prompt-bubble {\n position: absolute;\n z-index: 10002;\n pointer-events: none;\n white-space: nowrap;\n }\n \n .prompt-bubble.top {\n bottom: calc(100% + 18px);\n left: 50%;\n transform: translateX(-50%);\n }\n \n .prompt-bubble.left {\n right: calc(100% + 12px);\n top: 50%;\n transform: translateY(-50%);\n }\n \n .prompt-bubble.right {\n left: calc(100% + 12px);\n top: 50%;\n transform: translateY(-50%);\n }\n \n /* Ensure animations preserve horizontal centering for top position */\n .prompt-bubble.top.animation-bounce {\n animation: widget-bounce 1s ease-in-out infinite;\n transform: translateX(-50%); /* Keep centering */\n }\n \n .prompt-bubble.top.animation-float {\n animation: widget-float 2s ease-in-out infinite;\n transform: translateX(-50%); /* Keep centering */\n }\n \n .prompt-bubble.top.animation-pulse {\n animation: pulse 2s ease-in-out infinite;\n transform: translateX(-50%); /* Keep centering */\n }\n \n .prompt-bubble-content {\n position: relative;\n padding: 8px 16px;\n border-radius: 20px;\n font-weight: 500;\n font-size: 14px;\n box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);\n overflow: hidden;\n }\n \n .prompt-bubble-shimmer {\n position: absolute;\n inset: 0;\n background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);\n animation: widget-shimmer 2s infinite;\n }\n \n .prompt-bubble.animation-bounce {\n animation: widget-bounce 1s ease-in-out infinite;\n }\n \n .prompt-bubble.animation-pulse {\n animation: pulse 2s ease-in-out infinite;\n }\n \n .prompt-bubble.animation-float {\n animation: widget-float 2s ease-in-out infinite;\n }\n \n /* Ensure top-positioned bubbles maintain horizontal centering during animations */\n .prompt-bubble.top.animation-bounce,\n .prompt-bubble.top.animation-float,\n .prompt-bubble.top.animation-pulse {\n /* Animation keyframes already include translateX(-50%) for centering */\n }\n \n /* Prompt Bubble Arrow */\n .prompt-bubble-arrow {\n position: absolute;\n width: 0;\n height: 0;\n border: 8px solid transparent;\n }\n \n .prompt-bubble.top .prompt-bubble-arrow {\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n border-top-color: var(--prompt-bubble-bg-color, #7c3aed);\n border-bottom: none;\n margin-left: 0;\n }\n \n .prompt-bubble.left .prompt-bubble-arrow {\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n border-left-color: var(--prompt-bubble-bg-color, #7c3aed);\n border-right: none;\n }\n \n .prompt-bubble.right .prompt-bubble-arrow {\n right: 100%;\n top: 50%;\n transform: translateY(-50%);\n border-right-color: var(--prompt-bubble-bg-color, #7c3aed);\n border-left: none;\n }\n \n /* Pulse Rings */\n .prompt-pulse-rings {\n position: absolute;\n inset: 0;\n border-radius: 50%;\n pointer-events: none;\n }\n \n .prompt-pulse-ring {\n position: absolute;\n inset: 0;\n border-radius: 50%;\n animation: widget-pulse-ring 2s ease-out infinite;\n }\n \n .prompt-pulse-ring:nth-child(2) {\n animation-delay: 0.5s;\n }\n \n /* Mobile adjustments for prompt bubble */\n @media (max-width: 768px) {\n .prompt-bubble-content {\n font-size: 12px;\n padding: 6px 12px;\n }\n \n .prompt-bubble.top {\n bottom: calc(100% + 14px);\n }\n \n .prompt-bubble.left,\n .prompt-bubble.right {\n display: none; /* Hide side prompts on mobile */\n }\n }\n \n #text-chat-panel {\n display: none").concat(m,";\n position: fixed;\n bottom: calc(").concat(t,"px + 20px + 20px); /* Button + gap + reduced footer offset */\n ").concat("right"===this.config.position.horizontal?"right: 20px;":"left: 20px;","\n width: ").concat(l.width,"px;\n max-width: calc(100vw - 40px);\n height: ").concat(l.height,"px;\n max-height: calc(100vh - ").concat(t,"px - 40px - 20px); /* Account for footer height */\n background: transparent;\n border-radius: ").concat(l.borderRadius,"px;\n border: none;\n flex-direction: column;\n overflow: hidden;\n ").concat(l.backdropFilter?"backdrop-filter: ".concat(l.backdropFilter,";"):"","\n ").concat(d.enableSlide?"transition: all ".concat(d.duration,"s ease;"):"","\n box-sizing: border-box;\n }\n \n #text-chat-panel.open {\n display: flex").concat(m,";\n ").concat(d.enableSlide?"transform: translateY(0); opacity: 1;":"","\n }\n\n /* Shell for gradient border/background */\n .widget-shell { width: 100%; height: 100%; padding: 0; border-radius: ").concat(l.borderRadius,"px; background: transparent; box-shadow: 0 20px 60px rgba(0,0,0,0.15); overflow: hidden; display: flex; flex-direction: column; box-sizing: border-box; }\n .panel-inner { width: 100%; height: 100%; background: #ffffff; border-radius: ").concat(l.borderRadius,"px; border: ").concat(l.border,"; overflow: hidden; display:flex; flex-direction: column; padding: 0; box-sizing: border-box; max-width: 100%; }\n\n /* New structure styles matching provided design */\n #text-chat-panel .widget-container {\n width: 100%; height: 100%; background: #FFFFFF; overflow: visible; display: flex; flex-direction: column; border-radius: ").concat(l.borderRadius,"px;\n container-type: size;\n }\n \n /* Ensure content areas can scroll when height is constrained */\n #text-chat-panel .widget-container > .landing-screen,\n #text-chat-panel .widget-container > .voice-interface,\n #text-chat-panel .widget-container > .text-interface {\n flex: 1;\n overflow-y: auto;\n overflow-x: visible; /* Change from hidden to visible */\n }\n \n /* Header should not scroll */\n #text-chat-panel .widget-header {\n padding: 14px 16px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-top-left-radius: ").concat(l.borderRadius,"px;\n border-top-right-radius: ").concat(l.borderRadius,"px;\n flex-shrink: 0;\n box-sizing: border-box;\n position: relative;\n overflow: hidden;\n background: ").concat(u.backgroundColor||"#7C3AED").concat(m,";\n color: ").concat(u.textColor||"#FFFFFF").concat(m,";\n }\n \n #text-chat-panel .widget-header::before {\n content: '';\n position: absolute;\n top: -50%;\n right: -20%;\n width: 180px;\n height: 180px;\n background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);\n pointer-events: none;\n }\n \n #text-chat-panel .widget-header > div:first-child {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 4px;\n position: relative;\n z-index: 1;\n }\n \n #text-chat-panel .header-title { font-size: 15px; font-weight: 600; margin: 0; }\n #text-chat-panel .header-status { display: flex; align-items: center; gap: 5px; font-size: 12px; margin: 0; }\n #text-chat-panel .status-dot { width: 6px; height: 6px; border-radius: 50%; animation: pulse 2s ease-in-out infinite; }\n /* Online indicator customization - inline styles take precedence */\n @keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.15); opacity: 0.8; } }\n /* Header icon buttons */\n .header-icon {\n background: rgba(255, 255, 255, 0.1);\n border: none;\n color: white;\n width: 34px;\n height: 34px;\n min-width: 34px;\n min-height: 34px;\n border-radius: 10px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: background 0.2s;\n flex-shrink: 0;\n font-size: 16px;\n padding: 0;\n box-sizing: border-box;\n position: relative;\n z-index: 1;\n }\n \n .header-icon:hover {\n background: rgba(255, 255, 255, 0.2);\n }\n \n .header-icon svg {\n pointer-events: none;\n stroke: white;\n fill: none;\n }\n \n .back-btn.visible {\n display: flex !important;\n }\n\n ").concat(h&&this.landingScreen?this.landingScreen.generateCSS():"","\n\n ").concat(g?this.voiceInterface.generateCSS():"","\n ").concat(f?this.textInterface.generateCSS():"","\n \n /* Footer Branding */\n .widget-footer {\n box-sizing: border-box;\n }\n \n .footer-brand-link {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n }\n \n .footer-brand-link:hover {\n opacity: 0.9;\n }\n \n @media (max-width: 768px) {\n .widget-footer {\n height: 32px;\n }\n .widget-footer span {\n font-size: 10px;\n }\n .widget-footer span:last-child {\n font-size: 8px;\n }\n }\n \n #text-chat-send-hint {\n text-align: center;\n line-height: 1.4;\n }\n \n .agent-thinking {\n font-style: italic;\n color: #6B7280;\n }\n ")}},{key:"setupWidgetEvents",value:function(){var e,t=this;if(this.shadowRoot){this.setupPromptAnimation();var A=this.shadowRoot.getElementById("text-chat-button");A&&(A.onclick=function(){t.config.promptAnimation.hideAfterClick&&t.hidePrompt(),t.togglePanel()});var n=this.shadowRoot.getElementById("closeBtn");n&&(n.onclick=function(){t._doTogglePanel()});var o,r=(null===(e=this.config.behavior)||void 0===e?void 0:e.mode)||"unified",i="unified"===r,a="unified"===r||"voice-only"===r,s="unified"===r||"text-only"===r,c=this.shadowRoot.getElementById("backBtn"),l=this.shadowRoot.getElementById("landingScreen"),u=this.shadowRoot.getElementById("textInterface"),d=this.shadowRoot.getElementById("voiceInterface");c&&(c.onclick=function(){var e,A,n;if(null!==(e=t.voiceInterface)&&void 0!==e&&e.isShowingDomainError)return console.log("🔙 Back button clicked - clearing domain error and returning to landing"),t.voiceInterface.isShowingDomainError=!1,null!==(n=t.voiceInterface)&&void 0!==n&&n.resetConnectingState&&t.voiceInterface.resetConnectingState(),void t.showLanding();null!==(A=t.voiceInterface)&&void 0!==A&&A.isActive?t.showBackButtonWarning():t.showLanding()}),i&&this.landingScreen?(this.landingScreen.setupEventHandlers({onSelectVoice:(o=mo(ho().m(function e(){var A,n,o,r,i,a,s,c,l,u,d,p,h,g,f,m,v,B,w,y,b,C,x,Q,F,U,S;return ho().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!t.isStartingCall){e.n=1;break}return console.log("⚠️ Call already starting, ignoring duplicate click"),e.a(2);case 1:if("function"==typeof t.config.onVoiceCallButtonClick)try{t.config.onVoiceCallButtonClick({timestamp:Date.now(),widgetState:"start"})}catch(e){console.error("Error in onVoiceCallButtonClick callback:",e)}if(t.isStartingCall=!0,e.p=2,t.showVoice(),null===(A=t.voiceInterface)||void 0===A||!A.isMobile){e.n=4;break}if((s=(null===(o=t.shadowRoot)||void 0===o?void 0:o.getElementById("text-chat-panel"))||document.getElementById("text-chat-panel"))&&(s.classList.remove("open"),s.style.display="none"),(c=null===(r=t.voiceInterface)||void 0===r||null===(r=r.shadowRoot)||void 0===r?void 0:r.getElementById("voiceIdleState"))&&(c.style.display="none"),(l=(null===(i=t.shadowRoot)||void 0===i?void 0:i.getElementById("text-chat-button"))||document.getElementById("text-chat-button"))&&(l.style.display="none"),null===(a=t.voiceInterface)||void 0===a||!a.createMobileMinimizedBar){e.n=3;break}return t.voiceInterface.createMobileMinimizedBar(),t.voiceInterface.updateMobileStatus("connecting"),e.n=3,new Promise(function(e){return requestAnimationFrame(function(){return requestAnimationFrame(e)})});case 3:e.n=5;break;case 4:null!==(u=t.voiceInterface)&&void 0!==u&&u.showConnectingState&&t.voiceInterface.showConnectingState();case 5:return e.n=6,t.startVoiceCall();case 6:if(null===(n=t.voiceInterface)||void 0===n||!n.isActive){e.n=7;break}console.log("✅ Voice call started successfully"),e.n=9;break;case 7:if(console.warn("⚠️ startVoiceCall() returned but call is not active"),g=null===(d=t.voiceInterface)||void 0===d||null===(d=d.shadowRoot)||void 0===d?void 0:d.getElementById("voiceIdleState"),f=!1,g&&"none"!==g.style.display&&(m=g.querySelector(".voice-status-title"))&&(B=m.textContent.trim(),w=null===(v=t.voiceInterface)||void 0===v?void 0:v.t("domainNotValidated"),console.log("🔍 Checking for domain error - titleText:",B,"domainErrorTitle:",w),(B===w||B.includes("Domain not")||B.includes("not whitelisted"))&&(f=!0,console.log("🚫 Domain error detected - staying on voice interface, NOT returning to landing"))),!f){e.n=8;break}return t.currentView="voice",t.showVoice(),console.log("✅ Staying on voice interface with domain error displayed"),e.a(2);case 8:console.log("⚠️ Not a domain error - returning to landing screen"),null!==(p=t.voiceInterface)&&void 0!==p&&p.resetConnectingState&&t.voiceInterface.resetConnectingState(),"unified"===((null===(h=t.config.behavior)||void 0===h?void 0:h.mode)||"unified")&&t.showLanding();case 9:e.n=12;break;case 10:if(e.p=10,!(S=e.v).isServerRejection&&"ServerRejected"!==S.name){e.n=11;break}return null!==(x=t.voiceInterface)&&void 0!==x&&x.resetConnectingState&&t.voiceInterface.resetConnectingState(),e.a(2);case 11:console.error("❌ Failed to start voice call:",S),null!==(y=t.voiceInterface)&&void 0!==y&&y.resetConnectingState&&t.voiceInterface.resetConnectingState(),null!==(b=t.voiceInterface)&&void 0!==b&&b.isMobile&&(document.getElementById("mobile-voice-call-bar-container")&&null!==(Q=t.voiceInterface)&&void 0!==Q&&Q.removeMobileMinimizedBar&&t.voiceInterface.removeMobileMinimizedBar(),(U=(null===(F=t.shadowRoot)||void 0===F?void 0:F.getElementById("text-chat-button"))||document.getElementById("text-chat-button"))&&(U.style.display="")),"Call cancelled by user"!==S.message&&t.showErrorToast(S.message||"Failed to start voice call. Please try again.","error"),"unified"===((null===(C=t.config.behavior)||void 0===C?void 0:C.mode)||"unified")&&t.showLanding();case 12:return e.p=12,t.isStartingCall=!1,e.f(12);case 13:return e.a(2)}},e,null,[[2,10,12,13]])})),function(){return o.apply(this,arguments)}),onSelectText:function(){return t.showText()}}),"text"===this.currentView?(l&&l.classList.remove("active"),u&&u.classList.add("active"),d&&d.classList.remove("active"),c&&"unified"===r&&c.classList.add("visible"),p&&(p.style.display="")):"voice"===this.currentView?(l&&l.classList.remove("active"),u&&u.classList.remove("active"),d&&d.classList.add("active"),c&&"unified"===r&&c.classList.add("visible"),p&&(p.style.display="none")):(this.currentView="landing",l&&l.classList.add("active"),u&&u.classList.remove("active"),d&&d.classList.remove("active"),c&&"unified"===r&&c.classList.remove("visible"))):"voice-only"===r?(d&&d.classList.add("active"),u&&u.classList.remove("active"),l&&l.classList.remove("active")):"text-only"===r&&(u&&u.classList.add("active"),d&&d.classList.remove("active"),l&&l.classList.remove("active")),a&&(console.log("⚙️ Setting up voice interface event handlers"),this.voiceInterface.setupEventHandlers()),s&&(console.log("⚙️ Setting up text interface event handlers"),this.textInterface.setupEventHandlers());var p=this.shadowRoot.getElementById("newChatBtn");p&&(p.onclick=function(){return t.textInterface.startNewChat()},i&&(p.style.display="none")),this.config.accessibility.keyboardNavigation&&this.setupKeyboardNavigation()}}},{key:"startNewChat",value:function(){this.textInterface.startNewChat()}},{key:"showLanding",value:function(){var e;if(this.shadowRoot){var t=null===(e=this.voiceInterface)||void 0===e||null===(e=e.shadowRoot)||void 0===e?void 0:e.getElementById("voiceIdleState");if(t&&"none"!==t.style.display){var A=t.querySelector(".voice-status-title");if(A){var n,o=A.textContent.trim();if(o===(null===(n=this.voiceInterface)||void 0===n?void 0:n.t("domainNotValidated"))||o.includes("Domain not")||o.includes("not whitelisted"))return void console.log("🚫 showLanding() called but domain error is displayed - preventing return to landing")}}if("unified"===(this.config.behavior.mode||"unified")){this.currentView="landing";var r=this.shadowRoot.getElementById("landingScreen"),i=this.shadowRoot.getElementById("textInterface"),a=this.shadowRoot.getElementById("voiceInterface"),s=this.shadowRoot.getElementById("backBtn"),c=this.shadowRoot.getElementById("newChatBtn");r&&r.classList.add("active"),i&&i.classList.remove("active"),a&&a.classList.remove("active"),s&&s.classList.remove("visible"),c&&(c.style.display="none")}}}},{key:"showText",value:function(){if(this.shadowRoot){this.currentView="text";var e=this.shadowRoot.getElementById("landingScreen"),t=this.shadowRoot.getElementById("voiceInterface"),A=this.shadowRoot.getElementById("backBtn"),n=this.shadowRoot.getElementById("newChatBtn");e&&e.classList.remove("active"),t&&t.classList.remove("active"),this.textInterface.show();var o=this.config.behavior.mode||"unified";A&&"unified"===o&&A.classList.add("visible"),n&&(n.style.display="")}}},{key:"showVoice",value:function(){if(this.shadowRoot){this.currentView="voice";var e=this.shadowRoot.getElementById("landingScreen"),t=this.shadowRoot.getElementById("textInterface"),A=this.shadowRoot.getElementById("voiceInterface"),n=this.shadowRoot.getElementById("backBtn"),o=this.shadowRoot.getElementById("newChatBtn");e&&e.classList.remove("active"),t&&t.classList.remove("active"),A&&A.classList.add("active");var r=this.config.behavior.mode||"unified";n&&"unified"===r&&n.classList.add("visible"),o&&(o.style.display="none")}}},{key:"setupKeyboardNavigation",value:function(){var e=this;document.addEventListener("keydown",function(t){"Escape"===t.key&&e.isOpen&&e.togglePanel()})}},{key:"setupPromptAnimation",value:function(){var e=this;if(this.shadowRoot){var t=this.config.promptAnimation||{},A=!0===t.enabled;if(console.log("🎨 setupPromptAnimation called:",{hasPromptConfig:!!this.config.promptAnimation,promptConfig:t,enabled:t.enabled,isPromptEnabled:A,isOpen:this.isOpen}),!A)return console.log("❌ Prompt disabled, hiding"),void this.hidePrompt();if(this.isOpen?this.hidePrompt():this.showPrompt(),!this.isOpen&&null!==t.hideAfterSeconds&&t.hideAfterSeconds>0&&(this.promptAutoHideTimer=setTimeout(function(){e.hidePrompt()},1e3*t.hideAfterSeconds)),this.voiceInterface&&this.voiceInterface.sdk){var n=this.config.onConversationStart;this.config.onConversationStart=function(){var t=e.shadowRoot.getElementById("prompt-pulse-rings");t&&(t.style.display="none"),n&&n.apply(void 0,arguments)},this.voiceInterface.sdk.voiceSDK&&this.voiceInterface.sdk.voiceSDK.on("recordingStarted",function(){var t=e.shadowRoot.getElementById("prompt-pulse-rings");t&&(t.style.display="none")})}}}},{key:"hidePrompt",value:function(){if(this.shadowRoot){this.promptAutoHideTimer&&(clearTimeout(this.promptAutoHideTimer),this.promptAutoHideTimer=null);var e=this.shadowRoot.getElementById("prompt-bubble");e||this.shadowRoot===document||(e=document.getElementById("prompt-bubble")),e&&(e.style.display="none",e.style.visibility="hidden");var t=this.shadowRoot.getElementById("prompt-pulse-rings");t||this.shadowRoot===document||(t=document.getElementById("prompt-pulse-rings")),t&&(t.style.display="none",t.style.visibility="hidden")}}},{key:"showPrompt",value:function(){var e=this;if(this.shadowRoot){var t=this.config.promptAnimation||{},A=!1!==t.enabled;if(console.log("👁️ showPrompt called:",{hasPromptConfig:!!this.config.promptAnimation,promptConfig:t,enabled:t.enabled,isPromptEnabled:A,shadowRoot:!!this.shadowRoot}),A){var n=function(){var A=e.shadowRoot.getElementById("prompt-bubble");if(A||e.shadowRoot===document||(A=document.getElementById("prompt-bubble")),A?(A.style.display="block",A.style.visibility="visible",A.style.opacity="1",console.log("✅ Prompt bubble shown:",A)):console.warn("⚠️ Prompt bubble not found in shadowRoot or document"),!1!==t.showPulseRings){var n=e.shadowRoot.getElementById("prompt-pulse-rings");n||e.shadowRoot===document||(n=document.getElementById("prompt-pulse-rings")),n&&(n.style.display="block",n.style.visibility="visible",n.style.opacity="1")}};n();var o=this.shadowRoot.getElementById("prompt-bubble"),r=!1!==t.showPulseRings?this.shadowRoot.getElementById("prompt-pulse-rings"):null;o&&(!1===t.showPulseRings||r)||(setTimeout(function(){n()},100),setTimeout(function(){n()},500)),null!==t.hideAfterSeconds&&t.hideAfterSeconds>0&&(this.promptAutoHideTimer&&clearTimeout(this.promptAutoHideTimer),this.promptAutoHideTimer=setTimeout(function(){e.hidePrompt()},1e3*t.hideAfterSeconds))}else console.log("❌ Prompt not enabled, skipping show")}}},{key:"togglePanel",value:function(){this.shadowRoot&&this._doTogglePanel()}},{key:"_doTogglePanel",value:function(){var e=this;if(this.shadowRoot){this.isOpen=!this.isOpen;var t=this.shadowRoot.getElementById("text-chat-panel");t&&t.classList.toggle("open"),this.isOpen?(this.hidePrompt(),setTimeout(function(){var t=e.shadowRoot.getElementById("messageInput");t&&t.focus()},100)):(this.showPrompt(),setTimeout(function(){var t,A=e.shadowRoot.getElementById("prompt-bubble");A&&"none"===A.style.display&&(A.style.display="block");var n=e.shadowRoot.getElementById("prompt-pulse-rings");n&&!1!==(null===(t=e.config.promptAnimation)||void 0===t?void 0:t.showPulseRings)&&"none"===n.style.display&&(n.style.display="block")},100)),this.isOpen&&!this.isActive&&this.config.behavior.autoConnect&&this.startChat()}}},{key:"showErrorToast",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"error",A=document.createElement("div");A.className="widget-toast widget-toast-".concat(t),A.textContent=e;var n="error"===t?"#ef4444":"warning"===t?"#f59e0b":"#3b82f6";if(Object.assign(A.style,{position:"fixed",bottom:"20px",left:"50%",transform:"translateX(-50%)",backgroundColor:n,color:"white",padding:"12px 24px",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",zIndex:"10000",fontSize:"14px",fontWeight:"500",maxWidth:"90%",textAlign:"center",animation:"slideUp 0.3s ease-out",fontFamily:"inherit"}),!document.getElementById("widget-toast-styles")){var o=document.createElement("style");o.id="widget-toast-styles",o.textContent="\n @keyframes slideUp {\n from {\n opacity: 0;\n transform: translateX(-50%) translateY(20px);\n }\n to {\n opacity: 1;\n transform: translateX(-50%) translateY(0);\n }\n }\n @keyframes slideDown {\n from {\n opacity: 1;\n transform: translateX(-50%) translateY(0);\n }\n to {\n opacity: 0;\n transform: translateX(-50%) translateY(20px);\n }\n }\n ",document.head.appendChild(o)}(this.shadowRoot||document.body).appendChild(A),setTimeout(function(){A.style.animation="slideDown 0.3s ease-out",setTimeout(function(){A.parentNode&&A.parentNode.removeChild(A)},300)},4e3)}},{key:"showConfirmModal",value:function(e){var t=e.title,A=void 0===t?"Confirm":t,n=e.message,o=void 0===n?"Are you sure?":n,r=e.confirmText,i=void 0===r?"Confirm":r,a=e.cancelText,s=void 0===a?"Cancel":a,c=e.confirmButtonClass,l=void 0===c?"primary":c,u=e.onConfirm,d=e.onCancel,p=document.createElement("div");p.className="widget-modal-overlay",p.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n ";var h=document.createElement("div");h.className="widget-confirm-modal",h.style.cssText="\n background: white;\n border-radius: 12px;\n padding: 24px;\n max-width: 400px;\n width: 90%;\n box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);\n ";var g="danger"===l?"widget-modal-btn--danger":"widget-modal-btn--primary";h.innerHTML='\n <h3 style="margin: 0 0 12px 0; font-size: 18px; font-weight: 600; color: #1e293b;">'.concat(A,'</h3>\n <p style="margin: 0 0 24px 0; color: #64748b; font-size: 14px; line-height: 1.5;">').concat(o,'</p>\n <div style="display: flex; gap: 12px; justify-content: flex-end;">\n <button class="widget-modal-btn widget-modal-btn--cancel" data-action="cancel" style="\n padding: 10px 20px;\n border: 1px solid #e2e8f0;\n background: white;\n color: #64748b;\n border-radius: 8px;\n cursor: pointer;\n font-size: 14px;\n font-weight: 500;\n ">\n ').concat(s,'\n </button>\n <button class="widget-modal-btn ').concat(g,'" data-action="confirm" style="\n padding: 10px 20px;\n border: none;\n background: ').concat("danger"===l?"#ef4444":"#7c3aed",';\n color: white;\n border-radius: 8px;\n cursor: pointer;\n font-size: 14px;\n font-weight: 500;\n ">\n ').concat(i,"\n </button>\n </div>\n "),p.appendChild(h),(this.shadowRoot||document.body).appendChild(p),h.querySelector('[data-action="confirm"]').onclick=function(){p.remove(),null==u||u()},h.querySelector('[data-action="cancel"]').onclick=function(){p.remove(),null==d||d()},p.onclick=function(e){e.target===p&&(p.remove(),null==d||d())}}},{key:"startChat",value:(i=mo(ho().m(function e(){return ho().w(function(e){for(;;)switch(e.n){case 0:this.isActive=!0,this.textInterface.setActive(!0);case 1:return e.a(2)}},e,this)})),function(){return i.apply(this,arguments)})},{key:"sendMessage",value:(r=mo(ho().m(function e(){return ho().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.textInterface.sendMessage();case 1:return e.a(2)}},e,this)})),function(){return r.apply(this,arguments)})},{key:"updateSendButtonState",value:function(){this.textInterface.updateSendButtonState()}},{key:"showBackButtonWarning",value:function(){var e,t;null!==(e=this.voiceInterface)&&void 0!==e&&e.isActive&&null!==(t=this.voiceInterface.desktop)&&void 0!==t&&t.showBackButtonWarning&&this.voiceInterface.desktop.showBackButtonWarning()}},{key:"getSignedUrl",value:(o=mo(ho().m(function e(){var t,A,n;return ho().w(function(e){for(;;)switch(e.n){case 0:if(!this.config.signedUrl){e.n=1;break}return e.a(2,this.config.signedUrl);case 1:if(this.config.agentId){e.n=2;break}throw new Error("agentId is required when signedUrl is not provided");case 2:return t=this.config.websocketUrl||"wss://backend.talktopc.com/ws/conv",(A=new URLSearchParams).append("agentId",this.config.agentId),this.config.appId&&A.append("appId",this.config.appId),!1!==this.config.demo&&A.append("demo","true"),n="".concat(t,"?").concat(A.toString()),e.a(2,n)}},e,this)})),function(){return o.apply(this,arguments)})},{key:"addMessage",value:function(e,t){this.textInterface.addMessage(e,t)}},{key:"beginStreaming",value:function(){this.textInterface.beginStreaming()}},{key:"appendStreamingChunk",value:function(e){this.textInterface.appendStreamingChunk(e)}},{key:"finalizeStreaming",value:function(e){this.textInterface.finalizeStreaming(e)}},{key:"stopStreamingState",value:function(){this.textInterface.stopStreamingState()}},{key:"showError",value:function(e){this.textInterface.showError(e)}},{key:"updateStatus",value:function(e){}},{key:"updateConfig",value:function(e){var t,A,n,o,r,i,a,s,c,l,u=wo({},this.config);e.panel&&(u.panel=wo(wo({},this.config.panel),e.panel)),e.voice&&(u.voice=wo(wo({},this.config.voice),e.voice),e.voice.micButtonHint&&(u.voice.micButtonHint=wo(wo({},null===(c=this.config.voice)||void 0===c?void 0:c.micButtonHint),e.voice.micButtonHint))),e.text&&(u.text=wo(wo({},this.config.text),e.text),e.text.sendButtonHint&&(u.text.sendButtonHint=wo(wo({},null===(l=this.config.text)||void 0===l?void 0:l.sendButtonHint),e.text.sendButtonHint))),void 0!==e.language&&(u.language=e.language),void 0!==e.language&&(["he","ar"].includes(e.language)?u.direction="rtl":void 0===e.direction&&(u.direction="ltr")),e.translations&&(u.translations=e.translations,this.translations=e.translations),e.button&&(u.button=wo(wo({},this.config.button),e.button)),e.header&&(u.header=wo(wo({},this.config.header),e.header)),e.icon&&(u.icon=wo(wo({},this.config.icon),e.icon)),e.messages&&(u.messages=wo(wo({},this.config.messages),e.messages)),e.animation&&(u.animation=wo(wo({},this.config.animation),e.animation)),e.behavior&&(u.behavior=wo(wo({},this.config.behavior),e.behavior)),e.accessibility&&(u.accessibility=wo(wo({},this.config.accessibility),e.accessibility)),e.tooltips&&(u.tooltips=wo(wo({},this.config.tooltips),e.tooltips)),e.landing&&(u.landing=wo(wo({},this.config.landing),e.landing)),e.footer&&(u.footer=wo(wo({},this.config.footer),e.footer)),void 0!==e.direction&&void 0===u.direction&&(u.direction=e.direction),void 0!==e.primaryColor&&(u.primaryColor=e.primaryColor),u.onConversationStart=void 0!==e.onConversationStart?e.onConversationStart:this.config.onConversationStart,u.onConversationEnd=void 0!==e.onConversationEnd?e.onConversationEnd:this.config.onConversationEnd,u.onBargeIn=void 0!==e.onBargeIn?e.onBargeIn:this.config.onBargeIn,u.onAudioStartPlaying=void 0!==e.onAudioStartPlaying?e.onAudioStartPlaying:this.config.onAudioStartPlaying,u.onAudioStoppedPlaying=void 0!==e.onAudioStoppedPlaying?e.onAudioStoppedPlaying:this.config.onAudioStoppedPlaying,u.onSubtitleDisplay=void 0!==e.onSubtitleDisplay?e.onSubtitleDisplay:this.config.onSubtitleDisplay,u.onVoiceCallButtonClick=void 0!==e.onVoiceCallButtonClick?e.onVoiceCallButtonClick:this.config.onVoiceCallButtonClick,void 0!==e.useShadowDOM&&(u.useShadowDOM=e.useShadowDOM),Object.keys(e).forEach(function(t){["panel","button","header","footer","icon","messages","direction","voice","text","animation","behavior","accessibility","language","tooltips","landing","primaryColor","useShadowDOM","onConversationStart","onConversationEnd","onBargeIn","onAudioStartPlaying","onAudioStoppedPlaying","onSubtitleDisplay","onVoiceCallButtonClick"].includes(t)||(u[t]=e[t])}),null===(t=this.config)||void 0===t||t.language;var d=!1!==(null===(A=this.config)||void 0===A?void 0:A.useShadowDOM);if(this.config=this.mergeWithDefaults(u),!1!==this.config.useShadowDOM===d&&this.container){var p=document.getElementById("ttp-widget-shadow-host");p&&!this.config.useShadowDOM&&p.remove();var h=document.getElementById("ttp-widget-container");if(h&&this.config.useShadowDOM&&h.remove(),this.config.useShadowDOM)if(this.shadowRoot)this.container=this.shadowRoot;else{var g=document.getElementById("ttp-widget-shadow-host");g?(this.shadowRoot=g.shadowRoot,this.container=this.shadowRoot):(this.createShadowHost(),this.container=this.shadowRoot)}else{if(this.regularContainer)this.container=this.regularContainer;else{var f=document.getElementById("ttp-widget-container");f?(this.regularContainer=f,this.container=f):(this.createRegularContainer(),this.container=this.regularContainer)}this.shadowRoot=document}}else{var m=document.getElementById("ttp-widget-shadow-host");m&&m.remove();var v=document.getElementById("ttp-widget-container");if(v&&v.remove(),!1===d){var B=document.getElementById("ttp-widget-styles");B&&B.remove()}this.config.useShadowDOM?(this.createShadowHost(),this.container=this.shadowRoot):(this.createRegularContainer(),this.container=this.regularContainer,this.shadowRoot=document)}var w=this.config.language||"en",y=wo(wo(wo({},this.config),this.config.voice),{},{language:w,translations:this.translations,shadowRoot:this.shadowRoot,signedUrl:this.config.signedUrl,agentSettingsOverride:this.config.agentSettingsOverride,visualAssistant:this.config.visualAssistant,outputContainer:(null===(n=this.config.voice)||void 0===n?void 0:n.outputContainer)||"raw",outputEncoding:(null===(o=this.config.voice)||void 0===o?void 0:o.outputEncoding)||"pcm",outputSampleRate:(null===(r=this.config.voice)||void 0===r?void 0:r.outputSampleRate)||44100,outputChannels:(null===(i=this.config.voice)||void 0===i?void 0:i.outputChannels)||1,outputBitDepth:(null===(a=this.config.voice)||void 0===a?void 0:a.outputBitDepth)||16,onConversationStart:this.config.onConversationStart,onConversationEnd:this.config.onConversationEnd,onBargeIn:this.config.onBargeIn,onAudioStartPlaying:this.config.onAudioStartPlaying,onAudioStoppedPlaying:this.config.onAudioStoppedPlaying,onSubtitleDisplay:this.config.onSubtitleDisplay});this.voiceInterface=new $n(y);var b=wo(wo(wo({},this.config),this.config.text),{},{language:w,translations:this.translations,shadowRoot:this.shadowRoot});if(this.textInterface=new ao(b,this.sdk),"unified"===((null===(s=this.config.behavior)||void 0===s?void 0:s.mode)||"unified")){var C=wo(wo({},this.config),{},{translations:this.translations,shadowRoot:this.shadowRoot});this.landingScreen=new uo(C)}else this.landingScreen=null;this.createWidget(),this.textInterface&&this.textInterface.updateInputAttributes&&this.textInterface.updateInputAttributes()}},{key:"destroy",value:function(){this.promptAutoHideTimer&&(clearTimeout(this.promptAutoHideTimer),this.promptAutoHideTimer=null);var e=document.getElementById("ttp-widget-shadow-host");e&&e.remove();var t=document.getElementById("ttp-widget-container");t&&t.remove();var A=document.getElementById("ttp-widget-styles");A&&A.remove(),this.sdk&&this.sdk.destroy(),this.voiceInterface&&this.voiceInterface.destroy()}},{key:"startVoiceCall",value:(n=mo(ho().m(function e(){return ho().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.voiceInterface.startVoiceCall();case 1:this._flushPendingClientTools();case 2:return e.a(2)}},e,this)})),function(){return n.apply(this,arguments)})},{key:"endVoiceCall",value:function(){this.voiceInterface.endVoiceCall()}},{key:"toggleMute",value:function(){this.voiceInterface.toggleMute()}},{key:"toggleSpeaker",value:function(){this.voiceInterface.toggleSpeaker()}},{key:"injectData",value:(A=mo(ho().m(function e(t){var A,n,o,r,i=arguments;return ho().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=i.length>1&&void 0!==i[1]?i[1]:{},t&&t.trim()){e.n=1;break}throw console.warn("TTPChatWidget: Cannot inject empty data"),new Error("Cannot inject empty data");case 1:if(this.voiceInterface&&this.voiceInterface.isActive){e.n=2;break}throw console.warn("TTPChatWidget: Cannot inject data - voice call is not active"),new Error("Voice call is not active");case 2:if(o=null===(A=this.voiceInterface)||void 0===A?void 0:A.getVoiceSDK()){e.n=3;break}throw console.warn("TTPChatWidget: VoiceSDK not available"),new Error("VoiceSDK not available");case 3:return e.p=3,e.n=4,o.injectData(t,wo(wo({},n),{},{source:n.source||"widget_programmatic"}));case 4:return r=e.v,e.a(2,r);case 5:throw e.p=5,e.v;case 6:return e.a(2)}},e,this,[[3,5]])})),function(e){return A.apply(this,arguments)})},{key:"registerToolHandler",value:function(e,t){var A;return null!==(A=this.voiceInterface)&&void 0!==A&&A.sdk?this.voiceInterface.sdk.registerToolHandler(e,t):(this._pendingClientTools=this._pendingClientTools||[],this._pendingClientTools.push({name:e,handler:t}),console.warn("TTPChatWidget: Tool handler queued - voice interface SDK not ready yet"),this._flushPendingClientTools(),this)}},{key:"unregisterToolHandler",value:function(e){var t;return null!==(t=this.voiceInterface)&&void 0!==t&&t.sdk?this.voiceInterface.sdk.unregisterToolHandler(e):(this._pendingClientTools&&(this._pendingClientTools=this._pendingClientTools.filter(function(t){return t.name!==e})),this)}},{key:"hasToolHandler",value:function(e){var t;return!(null===(t=this.voiceInterface)||void 0===t||!t.sdk)&&this.voiceInterface.sdk.hasToolHandler(e)}},{key:"getRegisteredTools",value:function(){var e;return null!==(e=this.voiceInterface)&&void 0!==e&&e.sdk?this.voiceInterface.sdk.getRegisteredTools():this._pendingClientTools?this._pendingClientTools.map(function(e){return e.name}):[]}},{key:"_flushPendingClientTools",value:function(){var e,t=this;this._pendingClientTools&&null!==(e=this.voiceInterface)&&void 0!==e&&e.sdk&&(this._pendingClientTools.forEach(function(e){var A=e.name,n=e.handler;t.voiceInterface.sdk.registerToolHandler(A,n)}),this._pendingClientTools=null,console.log("TTPChatWidget: Flushed pending client tools"))}},{key:"registerClientTool",value:function(e,t){return this.registerToolHandler(e,t)}},{key:"unregisterClientTool",value:function(e){return this.unregisterToolHandler(e)}},{key:"hasClientTool",value:function(e){return this.hasToolHandler(e)}},{key:"getRegisteredClientTools",value:function(){return this.getRegisteredTools()}}],t&&bo(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,A,n,o,r,i}();function Qo(e){return Qo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qo(e)}function Fo(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),A.push.apply(A,n)}return A}function Uo(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?Fo(Object(A),!0).forEach(function(t){So(e,t,A[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):Fo(Object(A)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}return e}function So(e,t,A){return(t=Eo(t))in e?Object.defineProperty(e,t,{value:A,enumerable:!0,configurable:!0,writable:!0}):e[t]=A,e}function ko(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Eo(n.key),n)}}function Eo(e){var t=function(e){if("object"!=Qo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Qo(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Qo(t)?t:t+""}var Io=function(){return e=function e(t){var A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.product=t,this.compact=A.compact||!1,this.onAdd=A.onAdd||function(){},this.element=null;var n=t.sellBy||t.sell_by||"quantity";this.sellBy=n,this.step="weight"===n?.5:1,this.min="weight"===n?.5:1,this.unit="weight"===n?"kg":"";var o=t.cartQuantity||t.cart_quantity||0;this.inCart=o>0,this.amount=this.inCart?o:this.min},t=[{key:"_generateStepperHTML",value:function(){var e="weight"===this.sellBy?"".concat(this.amount.toFixed(1)," ").concat(this.unit):"".concat(this.amount);return'\n <div class="ttp-stepper" data-sell-by="'.concat(this.sellBy,'">\n <button class="ttp-stepper-btn ttp-stepper-minus" type="button">−</button>\n <span class="ttp-stepper-value">').concat(e,'</span>\n <button class="ttp-stepper-btn ttp-stepper-plus" type="button">+</button>\n </div>\n ')}},{key:"_updateStepperDisplay",value:function(e,t){"weight"===this.sellBy?e.textContent="".concat(this.amount.toFixed(1)," ").concat(this.unit):e.textContent="".concat(this.amount),t.disabled=this.amount<=this.min,t.classList.toggle("ttp-stepper-disabled",this.amount<=this.min)}},{key:"render",value:function(){var e=this,t=document.createElement("div");t.className=this.compact?"ttp-product-compact":"ttp-product-card";var A=this.product,n="ILS"===A.currency?"₪":"$",o=this.inCart?"Update":"Add",r=this.inCart?"ttp-add-btn ttp-update-btn":"ttp-add-btn";this.compact?t.innerHTML='\n <div class="ttp-product-image-sm">\n <img src="'.concat(A.imageUrl,'" alt="').concat(A.name,'" onerror="this.style.display=\'none\'" />\n </div>\n <div class="ttp-product-info">\n <div class="ttp-product-name">').concat(A.name,'</div>\n <div class="ttp-product-meta">').concat(A.unit," · ").concat(A.brand,'</div>\n </div>\n <div class="ttp-product-action">\n <div class="ttp-product-price">').concat(n).concat(A.price.toFixed(2),"</div>\n ").concat(A.inStock?'<button class="'.concat(r,'">').concat(o,"</button>"):'<span class="ttp-out-of-stock">Out of stock</span>',"\n ").concat(this._generateStepperHTML(),"\n </div>\n "):t.innerHTML='\n <div class="ttp-product-image">\n <img src="'.concat(A.imageUrl,'" alt="').concat(A.name,'" onerror="this.style.display=\'none\'" />\n ').concat(A.inStock?"":'<div class="ttp-stock-badge">Out of stock</div>','\n </div>\n <div class="ttp-product-details">\n <div class="ttp-product-name">').concat(A.name,'</div>\n <div class="ttp-product-meta">').concat(A.unit,'</div>\n <div class="ttp-product-footer">\n <span class="ttp-product-price">').concat(n).concat(A.price.toFixed(2),"</span>\n ").concat(A.inStock?'<button class="'.concat(r,'">').concat(o,"</button>"):'<span class="ttp-out-of-stock">Out of stock</span>',"\n ").concat(this._generateStepperHTML(),"\n </div>\n </div>\n ");var i=t.querySelector(".ttp-add-btn");i&&i.addEventListener("click",function(t){t.stopPropagation(),i.textContent="✓",i.classList.add("ttp-added"),i.disabled=!0,e.onAdd(Uo(Uo({},e.product),{},{selectedAmount:e.amount,sellBy:e.sellBy})),e.inCart=!0,setTimeout(function(){i.textContent="Update",i.classList.remove("ttp-added"),i.classList.add("ttp-update-btn"),i.disabled=!1},1500)});var a=t.querySelector(".ttp-stepper-minus"),s=t.querySelector(".ttp-stepper-plus"),c=t.querySelector(".ttp-stepper-value");return a&&s&&c&&(a.addEventListener("click",function(t){t.stopPropagation(),e.amount>e.min&&(e.amount=Math.round(10*(e.amount-e.step))/10,e._updateStepperDisplay(c,a))}),s.addEventListener("click",function(t){t.stopPropagation(),e.amount=Math.round(10*(e.amount+e.step))/10,e._updateStepperDisplay(c,a)}),this._updateStepperDisplay(c,a)),this.element=t,t}}],t&&ko(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function To(e){return To="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},To(e)}function Ho(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Do(n.key),n)}}function Do(e){var t=function(e){if("object"!=To(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=To(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==To(t)?t:t+""}var Po=function(){return e=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.onProductAdd=t.onProductAdd||function(){},this.onClose=t.onClose||function(){},this.element=null},(t=[{key:"show",value:function(e,t,A){var n=this;this.hide();var o=document.createElement("div");o.className="ttp-product-picker",o.setAttribute("data-layout",A);var r=document.createElement("div");r.className="ttp-picker-header",r.innerHTML='\n <span class="ttp-picker-title">'.concat(t,'</span>\n <button class="ttp-picker-close">✕</button>\n '),r.querySelector(".ttp-picker-close").addEventListener("click",function(){n.hide(),n.onClose()}),o.appendChild(r);var i=document.createElement("div");return i.className="cards"===A?"ttp-products-horizontal":"ttp-products-vertical",e.forEach(function(e){var t=new Io(e,{compact:"list"===A,onAdd:function(e){return n.onProductAdd(e)}});i.appendChild(t.render())}),o.appendChild(i),this.element=o,o}},{key:"hide",value:function(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=null}}])&&Ho(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Oo(e){return Oo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Oo(e)}function Ko(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Mo(n.key),n)}}function Mo(e){var t=function(e){if("object"!=Oo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Oo(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Oo(t)?t:t+""}var Lo=function(){return e=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.onUndo=t.onUndo||function(){},this.element=null,this.dismissTimer=null},(t=[{key:"show",value:function(e){var t=this;this.hide();var A=document.createElement("div");return A.className="ttp-cart-toast",A.innerHTML='\n <div class="ttp-toast-icon">✓</div>\n <div class="ttp-toast-content">\n <div class="ttp-toast-title">Added to cart!</div>\n <div class="ttp-toast-product">'.concat(e.name,'</div>\n </div>\n <button class="ttp-toast-undo">Undo</button>\n '),A.querySelector(".ttp-toast-undo").addEventListener("click",function(){t.onUndo(e),t.hide()}),this.element=A,this.dismissTimer=setTimeout(function(){return t.hide()},3e3),A}},{key:"hide",value:function(){if(this.dismissTimer&&(clearTimeout(this.dismissTimer),this.dismissTimer=null),this.element&&this.element.parentNode){this.element.classList.add("ttp-toast-hiding");var e=this.element;setTimeout(function(){e&&e.parentNode&&e.parentNode.removeChild(e)},300),this.element=null}}}])&&Ko(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Ro(e){return Ro="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ro(e)}function _o(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Vo(n.key),n)}}function Vo(e){var t=function(e){if("object"!=Ro(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Ro(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ro(t)?t:t+""}var jo=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=null,this.itemCount=0,this.total=0},(t=[{key:"render",value:function(){var e=document.createElement("div");return e.className="ttp-cart-summary",e.style.display="none",e.innerHTML='\n <div class="ttp-cart-info">\n <span class="ttp-cart-icon">🛒</span>\n <span class="ttp-cart-count">0 items</span>\n </div>\n <span class="ttp-cart-total">₪0.00</span>\n ',this.element=e,e}},{key:"update",value:function(e,t){this.itemCount=e,this.total=t,this.element&&(this.element.style.display=e>0?"flex":"none",this.element.querySelector(".ttp-cart-count").textContent="".concat(e," item").concat(1!==e?"s":""),this.element.querySelector(".ttp-cart-total").textContent="₪".concat(t.toFixed(2)))}}])&&_o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function No(e){return No="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},No(e)}function Go(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Wo(n.key),n)}}function Wo(e){var t=function(e){if("object"!=No(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=No(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==No(t)?t:t+""}var zo=function(){return e=function e(){var t=this,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.shadowRoot=A.shadowRoot,this.onProductSelected=A.onProductSelected||function(){},this.onProductDeselected=A.onProductDeselected||function(){},this.productPicker=new Po({onProductAdd:function(e){return t._handleAdd(e)},onClose:function(){return t._handlePickerClose()}}),this.cartToast=new Lo({onUndo:function(e){return t._handleUndo(e)}}),this.cartSummary=new jo,this.container=document.createElement("div"),this.container.id="ttpEcommerceArea",this.container.className="ttp-ecommerce-area",this.container.appendChild(this.cartSummary.render()),this.isAttached=!1},(t=[{key:"injectStyles",value:function(){if(this.shadowRoot){var e="\n\n/* ═══════════════════════════════════════\n ECOMMERCE AREA\n ═══════════════════════════════════════ */\n\n/*\n * When products are visible, expand the panel to 800px.\n * When the class is removed, the panel returns to its CSS-defined default.\n */\n#text-chat-panel.ttp-panel-expanded {\n height: 800px !important;\n}\n\n/*\n * Layout overrides when ecommerce layer is active.\n * voiceActiveState is a flex column: [voice-controls] [ecommerce] [conversation].\n * Ecommerce area fills the middle and scrolls; conversation panel stays at bottom.\n */\n#voiceActiveState {\n flex: 1 1 0 !important;\n min-height: 0 !important;\n overflow: hidden !important;\n}\n\n.desktop-voice-section {\n flex-shrink: 1 !important;\n}\n\n.desktop-conversation-panel {\n flex: 1 1 0 !important;\n min-height: 0 !important;\n display: flex !important;\n flex-direction: column !important;\n}\n\n.desktop-conversation-panel .live-transcript-collapsed {\n flex: 1 1 0 !important;\n min-height: 40px !important;\n overflow: hidden !important;\n}\n\n.desktop-conversation-panel .voice-text-input-area {\n margin-top: auto !important;\n padding: 3px 16px !important;\n}\n\n.desktop-conversation-panel .voice-input-hint {\n display: none !important;\n}\n\n#voiceActiveState.ttp-products-visible .desktop-voice-section {\n display: none !important;\n}\n\n#voiceActiveState.ttp-products-visible .compact-voice-section {\n display: flex !important;\n}\n\n#voiceActiveState.ttp-products-visible .desktop-conversation-panel {\n flex: 0 0 auto !important;\n}\n\n#voiceActiveState.ttp-products-visible .conversation-history {\n display: none !important;\n}\n\n#voiceActiveState.ttp-products-visible .live-transcript-collapsed {\n flex: 0 0 auto !important;\n}\n\n.voice-text-input-area {\n flex-shrink: 0 !important;\n}\n\n.conversation-history {\n flex: 1 1 0 !important;\n min-height: 0 !important;\n overflow-y: auto !important;\n}\n\n.ttp-ecommerce-area {\n display: flex;\n flex-direction: column;\n width: 100%;\n flex: 1 1 0;\n min-height: 0;\n overflow-x: hidden;\n overflow-y: auto;\n position: relative;\n}\n\n/* ═══════════════════════════════════════\n PRODUCT PICKER\n ═══════════════════════════════════════ */\n\n.ttp-product-picker {\n background: #fff;\n border-radius: 14px;\n border: 1px solid #e5e7eb;\n box-shadow: 0 6px 24px rgba(0,0,0,0.08);\n margin: 8px 12px;\n overflow: hidden;\n animation: ttpSlideUp 0.25s ease;\n display: flex;\n flex-direction: column;\n}\n\n@keyframes ttpSlideUp {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n}\n\n.ttp-picker-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 10px 14px;\n border-bottom: 1px solid #f1f5f9;\n flex-shrink: 0;\n}\n\n.ttp-picker-title {\n font-size: 12px;\n font-weight: 600;\n color: #64748b;\n}\n\n.ttp-picker-close {\n background: none;\n border: none;\n cursor: pointer;\n color: #94a3b8;\n font-size: 14px;\n padding: 2px 6px;\n border-radius: 4px;\n}\n.ttp-picker-close:hover {\n background: #f1f5f9;\n color: #475569;\n}\n\n/* Horizontal card layout */\n.ttp-products-horizontal {\n display: flex;\n gap: 10px;\n padding: 12px;\n overflow-x: auto;\n -webkit-overflow-scrolling: touch;\n scrollbar-width: thin;\n}\n.ttp-products-horizontal::-webkit-scrollbar { height: 4px; }\n.ttp-products-horizontal::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }\n\n/* Vertical list layout */\n.ttp-products-vertical {\n padding: 8px 12px;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n min-height: 0;\n}\n\n/* ═══════════════════════════════════════\n PRODUCT CARD (horizontal)\n ═══════════════════════════════════════ */\n\n.ttp-product-card {\n width: 140px;\n flex-shrink: 0;\n background: #fff;\n border-radius: 12px;\n border: 1px solid #e5e7eb;\n overflow: hidden;\n transition: border-color 0.15s;\n}\n.ttp-product-card:hover { border-color: #3b82f6; }\n\n.ttp-product-image {\n height: 85px;\n background: #f8fafc;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n overflow: hidden;\n}\n.ttp-product-image img {\n max-width: 90%;\n max-height: 75px;\n object-fit: contain;\n}\n\n.ttp-stock-badge {\n position: absolute;\n top: 4px; right: 4px;\n background: #fef2f2;\n color: #ef4444;\n font-size: 9px;\n font-weight: 600;\n padding: 2px 6px;\n border-radius: 4px;\n}\n\n.ttp-product-details {\n padding: 8px 10px 10px;\n}\n\n.ttp-product-name {\n font-size: 12px;\n font-weight: 600;\n color: #1e293b;\n line-height: 1.3;\n min-height: 30px;\n}\n\n.ttp-product-meta {\n font-size: 10px;\n color: #94a3b8;\n margin-top: 2px;\n}\n\n.ttp-product-footer {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-top: 6px;\n}\n\n.ttp-product-price {\n font-size: 14px;\n font-weight: 700;\n color: #1e293b;\n}\n\n/* ═══════════════════════════════════════\n PRODUCT COMPACT (list view)\n ═══════════════════════════════════════ */\n\n.ttp-product-compact {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 8px 10px;\n background: #fff;\n border-radius: 10px;\n border: 1px solid #e5e7eb;\n transition: border-color 0.15s;\n}\n.ttp-product-compact:hover { border-color: #3b82f6; }\n\n.ttp-product-image-sm {\n width: 40px; height: 40px;\n border-radius: 8px;\n background: #f8fafc;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n overflow: hidden;\n}\n.ttp-product-image-sm img {\n max-width: 36px;\n max-height: 36px;\n object-fit: contain;\n}\n\n.ttp-product-compact .ttp-product-info {\n flex: 1;\n min-width: 0;\n}\n.ttp-product-compact .ttp-product-name {\n min-height: auto;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ttp-product-compact .ttp-product-action {\n text-align: right;\n flex-shrink: 0;\n}\n.ttp-product-compact .ttp-product-price {\n font-size: 13px;\n}\n\n.ttp-out-of-stock {\n font-size: 10px;\n color: #ef4444;\n font-weight: 500;\n}\n\n/* ═══════════════════════════════════════\n ADD BUTTON\n ═══════════════════════════════════════ */\n\n.ttp-add-btn {\n padding: 4px 14px;\n border-radius: 8px;\n border: none;\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n background: #3b82f6;\n color: #fff;\n transition: all 0.15s;\n}\n.ttp-add-btn:hover { background: #2563eb; }\n.ttp-add-btn:active { transform: scale(0.95); }\n.ttp-add-btn.ttp-added { background: #10b981 !important; }\n.ttp-add-btn:disabled { cursor: default; }\n.ttp-add-btn.ttp-update-btn { background: #f59e0b; }\n.ttp-add-btn.ttp-update-btn:hover { background: #d97706; }\n\n/* ═══════════════════════════════════════\n CART TOAST\n ═══════════════════════════════════════ */\n\n.ttp-cart-toast {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 10px 14px;\n margin: 0 12px;\n background: #f0fdf4;\n border-radius: 12px;\n border: 1px solid #bbf7d0;\n animation: ttpToastIn 0.25s ease;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n z-index: 10;\n box-shadow: 0 4px 12px rgba(0,0,0,0.1);\n}\n\n@keyframes ttpToastIn {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n}\n.ttp-cart-toast.ttp-toast-hiding {\n animation: ttpSlideDown 0.3s ease forwards;\n}\n\n@keyframes ttpSlideDown {\n to { opacity: 0; transform: translateY(-8px); height: 0; padding: 0; margin: 0; overflow: hidden; }\n}\n\n.ttp-toast-icon {\n width: 24px; height: 24px;\n border-radius: 50%;\n background: #10b981;\n color: #fff;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 12px;\n font-weight: 700;\n flex-shrink: 0;\n}\n\n.ttp-toast-content { flex: 1; min-width: 0; }\n.ttp-toast-title { font-size: 12px; font-weight: 600; color: #166534; }\n.ttp-toast-product {\n font-size: 11px;\n color: #15803d;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ttp-toast-undo {\n background: none;\n border: 1px solid #86efac;\n border-radius: 6px;\n padding: 3px 8px;\n font-size: 10px;\n color: #15803d;\n cursor: pointer;\n font-weight: 600;\n flex-shrink: 0;\n}\n.ttp-toast-undo:hover { background: #dcfce7; }\n\n/* ═══════════════════════════════════════\n CART SUMMARY BAR\n ═══════════════════════════════════════ */\n\n.ttp-cart-summary {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 8px 14px;\n margin: 4px 12px 8px;\n background: #f8fafc;\n border-radius: 10px;\n border: 1px solid #e2e8f0;\n}\n\n.ttp-cart-info {\n display: flex;\n align-items: center;\n gap: 6px;\n}\n.ttp-cart-icon { font-size: 14px; }\n.ttp-cart-count { font-size: 12px; font-weight: 600; color: #475569; }\n.ttp-cart-total { font-size: 14px; font-weight: 700; color: #1e293b; }\n\n/* ═══════════════════════════════════════\n QUANTITY/WEIGHT STEPPER\n ═══════════════════════════════════════ */\n\n.ttp-stepper {\n display: flex;\n align-items: center;\n gap: 2px;\n margin: 4px 0;\n}\n\n.ttp-stepper-btn {\n width: 24px;\n height: 24px;\n border-radius: 6px;\n border: 1px solid #e2e8f0;\n background: #f8fafc;\n color: #475569;\n font-size: 14px;\n font-weight: 600;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n line-height: 1;\n transition: all 0.15s;\n flex-shrink: 0;\n}\n\n.ttp-stepper-btn:hover:not(:disabled) {\n background: #e2e8f0;\n border-color: #cbd5e1;\n}\n\n.ttp-stepper-btn:active:not(:disabled) {\n transform: scale(0.9);\n}\n\n.ttp-stepper-btn:disabled,\n.ttp-stepper-disabled {\n opacity: 0.35;\n cursor: default;\n}\n\n.ttp-stepper-value {\n font-size: 12px;\n font-weight: 600;\n color: #1e293b;\n min-width: 36px;\n text-align: center;\n user-select: none;\n}\n\n.ttp-product-compact .ttp-stepper {\n justify-content: flex-end;\n}\n\n.ttp-product-compact .ttp-product-action {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 2px;\n}\n\n.ttp-product-card .ttp-stepper {\n justify-content: center;\n margin: 4px 0;\n}\n\n.ttp-product-card .ttp-product-footer {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 4px;\n}\n\n ",t=this.shadowRoot.querySelector("style");if(t)t.textContent+="\n"+e;else{var A=document.createElement("style");A.textContent=e,this.shadowRoot.appendChild(A)}}}},{key:"attachToDOM",value:function(){if(!this.isAttached&&this.shadowRoot)if(this.voiceActiveState=this.shadowRoot.getElementById("voiceActiveState"),this.voiceActiveState){var e=this.voiceActiveState;if(this.shadowRoot.getElementById("ttpEcommerceArea"))this.isAttached=!0;else{var t=e.querySelector(".desktop-voice-section"),A=e.querySelector(".compact-voice-section")||t;A&&A.nextSibling?e.insertBefore(this.container,A.nextSibling):e.appendChild(this.container),this.isAttached=!0}}else console.warn("[EcommerceManager] #voiceActiveState not found — will retry on next message")}},{key:"_ensureReady",value:function(){this.isAttached||(this.injectStyles(),this.attachToDOM())}},{key:"handleShowProducts",value:function(e){this._ensureReady();var t=e.products,A=e.title,n=e.layout;if(t&&0!==t.length){this._switchToCompactMode(),this._expandPanel(),this._setContainerMode("products"),this.productPicker.hide();var o=n||(t.length<=4?"cards":"list"),r=this.productPicker.show(t,A,o);this.container.insertBefore(r,this.container.firstChild)}else console.warn("[EcommerceManager] show_products with no products")}},{key:"handleCartUpdated",value:function(e){this._ensureReady();var t=e.product,A=e.action,n=e.cartTotal,o=e.cartItemCount;if("added"===A&&t){var r=this.cartToast.show(t,A);this.container.insertBefore(r,this.container.firstChild)}void 0!==n&&void 0!==o&&this.cartSummary.update(o,n)}},{key:"handleMessage",value:function(e){var t=e.t||e.type;"show_products"===t?this.handleShowProducts(e):"cart_updated"===t&&this.handleCartUpdated(e)}},{key:"_setContainerMode",value:function(e){"products"===e?(this.container.style.flex="1 1 0",this.container.style.minHeight="0",this.container.style.overflowY="auto",this.voiceActiveState&&this.voiceActiveState.classList.add("ttp-products-visible")):(this.container.style.flex="0 0 auto",this.container.style.minHeight="",this.container.style.overflowY="",this.voiceActiveState&&this.voiceActiveState.classList.remove("ttp-products-visible")),this.cartSummary.element&&(this.cartSummary.element.style.display="summary"===e&&this.cartSummary.itemCount>0?"flex":"none")}},{key:"_expandPanel",value:function(){if(this.shadowRoot){var e=this.shadowRoot.getElementById("text-chat-panel");e&&e.classList.add("ttp-panel-expanded")}}},{key:"_shrinkPanel",value:function(){if(this.shadowRoot){var e=this.shadowRoot.getElementById("text-chat-panel");e&&(e.classList.remove("ttp-panel-expanded"),e.style.height="")}}},{key:"_switchToCompactMode",value:function(){if(this.shadowRoot){var e=this.shadowRoot.getElementById("desktopVoiceSection"),t=this.shadowRoot.getElementById("compactVoiceSection");e&&(e.style.display="none"),t&&(t.style.display="flex")}}},{key:"_restoreFullVoiceMode",value:function(){if(this.shadowRoot){var e=this.shadowRoot.getElementById("desktopVoiceSection"),t=this.shadowRoot.getElementById("compactVoiceSection");e&&t&&(e.style.display="",t.style.display="none")}}},{key:"_handlePickerClose",value:function(){this.productPicker.hide(),this._shrinkPanel(),this._restoreFullVoiceMode(),this._setContainerMode("summary")}},{key:"_handleAdd",value:function(e){var t=this,A=e.price||0,n=e.selectedAmount||1;this.cartSummary.update(this.cartSummary.itemCount+1,this.cartSummary.total+A*n);var o=this.cartToast.show(e,"added");this.container.insertBefore(o,this.container.firstChild),setTimeout(function(){t.productPicker.hide(),t._shrinkPanel(),t._restoreFullVoiceMode(),t._setContainerMode("summary")},500),this.onProductSelected(e)}},{key:"_handleUndo",value:function(e){this.onProductDeselected(e)}},{key:"destroy",value:function(){this.productPicker.hide(),this.cartToast.hide(),this._shrinkPanel(),this._restoreFullVoiceMode(),this.voiceActiveState&&this.voiceActiveState.classList.remove("ttp-products-visible"),this.container&&this.container.parentNode&&this.container.parentNode.removeChild(this.container),this.isAttached=!1}}])&&Go(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Xo(e){return Xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xo(e)}function Jo(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),A.push.apply(A,n)}return A}function Yo(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?Jo(Object(A),!0).forEach(function(t){qo(e,t,A[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):Jo(Object(A)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}return e}function qo(e,t,A){return(t=nr(t))in e?Object.defineProperty(e,t,{value:A,enumerable:!0,configurable:!0,writable:!0}):e[t]=A,e}function Zo(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return $o(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):($o(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,$o(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,$o(u,"constructor",c),$o(c,"constructor",s),s.displayName="GeneratorFunction",$o(c,o,"GeneratorFunction"),$o(u),$o(u,o,"Generator"),$o(u,n,function(){return this}),$o(u,"toString",function(){return"[object Generator]"}),(Zo=function(){return{w:r,m:d}})()}function $o(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}$o=function(e,t,A,n){function r(t,A){$o(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},$o(e,t,A,n)}function er(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function tr(e){return function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){er(r,n,o,i,a,"next",e)}function a(e){er(r,n,o,i,a,"throw",e)}i(void 0)})}}function Ar(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,nr(n.key),n)}}function nr(e){var t=function(e){if("object"!=Xo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Xo(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Xo(t)?t:t+""}var or=function(){return e=function e(){var t=this,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.partnerConfig=A.partner||{},this.cartConfig=A.cart||{},this.widget=new xo(A),this.ecommerce=new zo({shadowRoot:this.widget.shadowRoot,onProductSelected:function(e){return t._handleProductSelected(e)},onProductDeselected:function(e){return t._handleProductDeselected(e)}}),this._hookIntoVoicePipeline(),this._hookCallEnd(),this._registerEcommerceTools(),this._exposeTestAPI()},t=[{key:"_hookIntoVoicePipeline",value:function(){var e,t=null===(e=this.widget.voiceInterface)||void 0===e?void 0:e.sdk;if(t){var A=this,n=t.connect.bind(t);t.connect=function(){var e=tr(Zo().m(function e(t){return Zo().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,n(t);case 1:this.voiceSDK&&(this.voiceSDK.on("message",function(e){var t=e.t||e.type;"show_products"===t?A.ecommerce.handleShowProducts(e):"cart_updated"===t&&A._handleCartUpdatedFromServer(e)}),console.log("[TTPEcommerceWidget] E-commerce message listener attached"));case 2:return e.a(2)}},e,this)}));return function(t){return e.apply(this,arguments)}}()}else console.warn("[TTPEcommerceWidget] AgentSDK not available yet")}},{key:"_hookCallEnd",value:function(){var e=this.widget.voiceInterface;if(e){var t=e.config.onCallEnd,A=this.ecommerce;e.config.onCallEnd=function(){A.productPicker.hide(),A._setContainerMode("summary"),A._shrinkPanel(),A._restoreFullVoiceMode(),t&&t()}}}},{key:"_registerEcommerceTools",value:function(){var e=this;this.cartConfig.addToCartFn&&this.widget.registerToolHandler("addToCart",function(){var t=tr(Zo().m(function t(A){var n,o;return Zo().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,e.cartConfig.addToCartFn(A.productId,A.quantity||1);case 1:return n=t.v,t.a(2,Yo({success:!0,productName:A.productName},n));case 2:return t.p=2,o=t.v,t.a(2,{success:!1,error:o.message})}},t,null,[[0,2]])}));return function(e){return t.apply(this,arguments)}}()),this.cartConfig.getCartFn&&this.widget.registerToolHandler("getCart",tr(Zo().m(function t(){var A;return Zo().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,e.cartConfig.getCartFn();case 1:return t.a(2,t.v);case 2:return t.p=2,A=t.v,t.a(2,{items:[],total:0,count:0,error:A.message})}},t,null,[[0,2]])})))}},{key:"_handleProductSelected",value:function(e){var t=e.selectedAmount||1;this._sendToVoiceSDK({t:"product_selected",productId:e.id,productName:e.name,price:e.price,quantity:t,sellBy:e.sellBy||"quantity"})}},{key:"_handleProductDeselected",value:function(e){this._sendToVoiceSDK({t:"product_deselected",productId:e.id,productName:e.name})}},{key:"_handleCartUpdatedFromServer",value:function(e){this.ecommerce.handleCartUpdated(e)}},{key:"_sendToVoiceSDK",value:function(e){try{var t,A=null===(t=this.widget.voiceInterface)||void 0===t||null===(t=t.sdk)||void 0===t?void 0:t.voiceSDK;A&&A.sendMessage&&A.sendMessage(e)}catch(e){console.warn("[TTPEcommerceWidget] Could not send to VoiceSDK:",e)}}},{key:"_exposeTestAPI",value:function(){var e,t=this;window.__TTP_ECOMMERCE__={handleMessage:function(e){t.ecommerce.handleMessage(e)},showProducts:(e=tr(Zo().m(function e(A){var n,o,r,i,a,s,c=arguments;return Zo().w(function(e){for(;;)switch(e.p=e.n){case 0:return n=c.length>1&&void 0!==c[1]?c[1]:5,o=c.length>2&&void 0!==c[2]?c[2]:"test",r=window.__TTP_MOCK_API__||"https://backend.talktopc.com",e.p=1,e.n=2,fetch("".concat(r,"/api/partner/mock-store/products/search?q=").concat(encodeURIComponent(A),"&limit=").concat(n,"&sessionId=").concat(encodeURIComponent(o)));case 2:return i=e.v,e.n=3,i.json();case 3:a=e.v,t.ecommerce.handleShowProducts({t:"show_products",products:a.products,title:"".concat(a.totalCount,' results for "').concat(A,'"'),layout:a.products.length<=4?"cards":"list"}),e.n=5;break;case 4:e.p=4,s=e.v,console.error("[TTPEcommerceWidget] showProducts failed:",s);case 5:return e.a(2)}},e,null,[[1,4]])})),function(t){return e.apply(this,arguments)}),getCart:function(){return{total:t.ecommerce.cartSummary.total,count:t.ecommerce.cartSummary.itemCount}},clearCart:function(){t.ecommerce.cartSummary.update(0,0)}}}},{key:"open",value:function(){this.widget.open()}},{key:"togglePanel",value:function(){this.widget.togglePanel()}},{key:"updateConfig",value:function(e){this.widget.updateConfig(e)}},{key:"destroy",value:function(){delete window.__TTP_ECOMMERCE__,this.ecommerce.destroy(),this.widget.destroy()}},{key:"startVoiceCall",value:function(){return this.widget.startVoiceCall()}},{key:"endVoiceCall",value:function(){this.widget.endVoiceCall()}},{key:"toggleMute",value:function(){this.widget.toggleMute()}},{key:"toggleSpeaker",value:function(){this.widget.toggleSpeaker()}},{key:"registerToolHandler",value:function(e,t){return this.widget.registerToolHandler(e,t)}},{key:"unregisterToolHandler",value:function(e){return this.widget.unregisterToolHandler(e)}},{key:"hasToolHandler",value:function(e){return this.widget.hasToolHandler(e)}},{key:"getRegisteredTools",value:function(){return this.widget.getRegisteredTools()}},{key:"injectData",value:function(e,t){return this.widget.injectData(e,t)}}],t&&Ar(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function rr(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return ir(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(ir(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,ir(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,ir(u,"constructor",c),ir(c,"constructor",s),s.displayName="GeneratorFunction",ir(c,o,"GeneratorFunction"),ir(u),ir(u,o,"Generator"),ir(u,n,function(){return this}),ir(u,"toString",function(){return"[object Generator]"}),(rr=function(){return{w:r,m:d}})()}function ir(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ir=function(e,t,A,n){function r(t,A){ir(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},ir(e,t,A,n)}function ar(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var A=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=A){var n,o,r,i,a=[],s=!0,c=!1;try{if(r=(A=A.call(e)).next,0===t){if(Object(A)!==A)return;s=!1}else for(;!(s=(n=r.call(A)).done)&&(a.push(n.value),a.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=A.return&&(i=A.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}(e,t)||cr(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sr(e,t){var A="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!A){if(Array.isArray(e)||(A=cr(e))||t&&e&&"number"==typeof e.length){A&&(e=A);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){A=A.call(e)},n:function(){var e=A.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==A.return||A.return()}finally{if(a)throw r}}}}function cr(e,t){if(e){if("string"==typeof e)return lr(e,t);var A={}.toString.call(e).slice(8,-1);return"Object"===A&&e.constructor&&(A=e.constructor.name),"Map"===A||"Set"===A?Array.from(e):"Arguments"===A||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A)?lr(e,t):void 0}}function lr(e,t){(null==t||t>e.length)&&(t=e.length);for(var A=0,n=Array(t);A<t;A++)n[A]=e[A];return n}function ur(e){return ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ur(e)}function dr(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function pr(e){return function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){dr(r,n,o,i,a,"next",e)}function a(e){dr(r,n,o,i,a,"throw",e)}i(void 0)})}}function hr(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,gr(n.key),n)}}function gr(e){var t=function(e){if("object"!=ur(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=ur(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ur(t)?t:t+""}var fr=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),console.log("🚀 AgentSDK v2.1.8 initialized with config:",t),this.config=t,this.voiceSDK=null,this.isConnected=!1,this.isListening=!1,this.wasListening=!1,this._resumeInfo=null,this.onConnected=function(){},this.onDisconnected=function(){},this.onError=function(e){return console.error("SDK Error:",e)},this.onTranscript=function(e){},this.onAgentSpeaking=function(e){},this.onConversationStart=t.onConversationStart||function(){},this.onConversationEnd=t.onConversationEnd||function(){},this.onBargeIn=t.onBargeIn||function(){},this.onAudioStartPlaying=t.onAudioStartPlaying||function(){},this.onAudioStoppedPlaying=t.onAudioStoppedPlaying||function(){},this.onSubtitleDisplay=t.onSubtitleDisplay||function(){}},t=[{key:"checkResumeBeforeConnect",value:function(){if(void 0!==this._resumeChecked)return this._resumeInfo;try{var e,t=this.config.visualAssistant||(null===(e=this.config.agentSettingsOverride)||void 0===e?void 0:e.visualAssistant),A=new oA({signedUrl:"wss://placeholder",autoReconnect:!1,agentId:this.config.agentId,appId:this.config.appId,language:this.config.language||"en",visualAssistant:t,protocolVersion:2}).checkAndResume();return this._resumeChecked=!0,A?(console.log("🔄 [AGENT SDK] Found resume state before connect:",A),this._resumeInfo=A,A):(this._resumeInfo=null,null)}catch(e){return console.warn("⚠️ [AGENT SDK] Error checking resume:",e),this._resumeChecked=!0,this._resumeInfo=null,null}}},{key:"connect",value:(n=pr(rr().m(function e(t){var A,n,o,r,i,a,s,c,l=this;return rr().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,t){e.n=1;break}throw new Error("signedUrl is required");case 1:if(this.voiceSDK&&(console.log("🔌 AgentSDK: Cleaning up existing connection"),this.voiceSDK.destroy(),this.voiceSDK=null),n=this.config.visualAssistant||(null===(A=this.config.agentSettingsOverride)||void 0===A?void 0:A.visualAssistant),this.voiceSDK=new oA({signedUrl:t,autoReconnect:!1,agentId:this.config.agentId,appId:this.config.appId,language:this.config.language||"en",agentSettingsOverride:this.config.agentSettingsOverride,visualAssistant:n,protocolVersion:2,outputContainer:this.config.outputContainer||"raw",outputEncoding:this.config.outputEncoding||"pcm",outputSampleRate:this.config.outputSampleRate||44100,outputChannels:this.config.outputChannels||1,outputBitDepth:this.config.outputBitDepth||16}),this._resumeInfo&&(console.log("🔄 [AGENT SDK] Using stored resume info:",this._resumeInfo),console.log(" From:",this._resumeInfo.fromPage,"→ To:",this._resumeInfo.toPage)),this.voiceSDK.on("connected",function(){l.isConnected=!0,l.onConnected()}),setTimeout(function(){l.voiceSDK&&l.voiceSDK.isConnected&&!l.isConnected&&(l.isConnected=!0,l.onConnected())},10),this.voiceSDK.on("disconnected",function(e){if(l.isConnected=!1,e&&1008===e.code&&e.reason&&(e.reason.includes("Domain not whitelisted")||e.reason.includes("domain")||e.reason.includes("whitelist"))){var t=new Error("DOMAIN_NOT_WHITELISTED");t.reason=e.reason,t.code=e.code,l.onError(t)}if((l.isListening||l.wasListening)&&(console.log("🎤 [AGENT SDK] disconnected event - calling onConversationEnd hook (isListening:",l.isListening,", wasListening:",l.wasListening,")"),l.onConversationEnd&&"function"==typeof l.onConversationEnd))try{l.onConversationEnd(),console.log("🎤 [AGENT SDK] ✅ onConversationEnd hook called from disconnected event"),l.wasListening=!1}catch(e){console.error("🎤 [AGENT SDK] ❌ Error calling onConversationEnd from disconnected:",e)}l.onDisconnected()}),this.voiceSDK.on("domainError",function(e){l.onError(e)}),this.voiceSDK.on("error",function(e){l.onError(e)}),this.voiceSDK.on("message",function(e){l.handleWebSocketMessage(e)}),this.voiceSDK.on("recordingStarted",function(){if(l.isListening=!0,l.wasListening=!0,l.onConversationStart&&"function"==typeof l.onConversationStart)try{l.onConversationStart()}catch(e){console.error("🎤 [AGENT SDK] ❌ Error calling onConversationStart:",e)}}),this.voiceSDK.on("recordingStopped",function(){console.log("🎤 [AGENT SDK] recordingStopped event received");var e=l.isListening;if(l.isListening=!1,e&&l.onConversationEnd&&"function"==typeof l.onConversationEnd)try{console.log("🎤 [AGENT SDK] ✅ Calling onConversationEnd hook from recordingStopped"),l.onConversationEnd(),console.log("🎤 [AGENT SDK] ✅ onConversationEnd hook called successfully"),l.wasListening=!1}catch(e){console.error("🎤 [AGENT SDK] ❌ Error calling onConversationEnd:",e)}}),this.voiceSDK.on("playbackStarted",function(){l.onAgentSpeaking(!0),l.onAudioStartPlaying(),l.onPlaybackStarted&&"function"==typeof l.onPlaybackStarted&&l.onPlaybackStarted()}),this.voiceSDK.on("playbackStopped",function(){l.onAgentSpeaking(!1),l.onAudioStoppedPlaying()}),this.voiceSDK.on("bargeIn",function(e){l.onBargeIn(e)}),this.voiceSDK.on("transcriptDisplay",function(e){console.log("📝 [AGENT SDK] transcriptDisplay event received:",e),e&&e.text&&(console.log("📝 [AGENT SDK] Calling onTranscript with text:",e.text),l.onTranscript&&"function"==typeof l.onTranscript?l.onTranscript(e.text):console.warn("📝 [AGENT SDK] ⚠️ onTranscript is not a function!",ur(l.onTranscript))),l.onSubtitleDisplay(e)}),this._pendingToolHandlers&&this._pendingToolHandlers.size>0){console.log("🔧 AgentSDK: Registering ".concat(this._pendingToolHandlers.size," pending tool handlers")),o=sr(this._pendingToolHandlers);try{for(o.s();!(r=o.n()).done;)i=ar(r.value,2),a=i[0],s=i[1],this.voiceSDK.registerToolHandler(a,s)}catch(e){o.e(e)}finally{o.f()}}return e.n=2,this.voiceSDK.connect();case 2:e.n=4;break;case 3:throw e.p=3,c=e.v,this.onError(c),c;case 4:return e.a(2)}},e,this,[[0,3]])})),function(e){return n.apply(this,arguments)})},{key:"handleWebSocketMessage",value:function(e){switch(e.t||e.type){case"connected":case"hello_ack":console.log("Session started successfully");break;case"user_transcript":this.onTranscript(e.user_transcription||e.text||e.transcript);break;case"agent_response":case"barge_in":case"stop_playing":default:break;case"error":this.onError(new Error(e.message||e.error||"Unknown error"))}}},{key:"startListening",value:(A=pr(rr().m(function e(){var t;return rr().w(function(e){for(;;)switch(e.p=e.n){case 0:if(console.log("🎤 AgentSDK: startListening() called"),!this.voiceSDK){e.n=6;break}return e.p=1,console.log("🎤 AgentSDK: Starting recording..."),e.n=2,this.voiceSDK.startRecording();case 2:e.v&&console.log("✅ AgentSDK: Recording started successfully"),e.n=5;break;case 3:if(e.p=3,!(t=e.v).isServerRejection&&"ServerRejected"!==t.name){e.n=4;break}throw t;case 4:throw console.error("❌ AgentSDK: Failed to start recording:",t),t;case 5:e.n=7;break;case 6:throw console.error("❌ AgentSDK: No voiceSDK instance available"),new Error("No voiceSDK instance available");case 7:return e.a(2)}},e,this,[[1,3]])})),function(){return A.apply(this,arguments)})},{key:"stopListening",value:function(){this.voiceSDK&&this.voiceSDK.stopRecording()}},{key:"hangup",value:function(){this.voiceSDK&&this.voiceSDK.hangup()}},{key:"updateVariables",value:function(e){this.voiceSDK&&this.isConnected&&this.voiceSDK.sendMessage({t:"update_variables",variables:e})}},{key:"disconnect",value:function(){this.voiceSDK&&(this.voiceSDK.destroy(),this.voiceSDK=null),this.isConnected=!1,this.isListening=!1}},{key:"registerToolHandler",value:function(e,t){if(this.voiceSDK)return this.voiceSDK.registerToolHandler(e,t);this._pendingToolHandlers||(this._pendingToolHandlers=new Map),this._pendingToolHandlers.set(e,t),console.log("🔧 AgentSDK: Queued tool handler '".concat(e,"' for registration after connect"))}},{key:"unregisterToolHandler",value:function(e){if(this.voiceSDK)return this.voiceSDK.unregisterToolHandler(e);this._pendingToolHandlers&&this._pendingToolHandlers.delete(e)}},{key:"hasToolHandler",value:function(e){var t;return this.voiceSDK?this.voiceSDK.hasToolHandler(e):(null===(t=this._pendingToolHandlers)||void 0===t?void 0:t.has(e))||!1}},{key:"getRegisteredTools",value:function(){return this.voiceSDK?this.voiceSDK.getRegisteredTools():this._pendingToolHandlers?Array.from(this._pendingToolHandlers.keys()):[]}}],t&&hr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,A,n}(),mr="3.0.0";const vr={VoiceSDK_v2:oA,TextChatSDK:mA,WebSocketManager:_A,AudioRecorder:q,AudioPlayer:ZA,EventEmitter:O,AgentSDK:fr,TTPChatWidget:xo,TTPEcommerceWidget:or,VERSION:mr}})(),n})());
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.TTPAgentSDK=t():e.TTPAgentSDK=t()}(window,()=>(()=>{var e={354:function(e){e.exports=function(){"use strict";var e=function(t,A){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var A in t)Object.prototype.hasOwnProperty.call(t,A)&&(e[A]=t[A])},e(t,A)};function t(t,A){if("function"!=typeof A&&null!==A)throw new TypeError("Class extends value "+String(A)+" is not a constructor or null");function n(){this.constructor=t}e(t,A),t.prototype=null===A?Object.create(A):(n.prototype=A.prototype,new n)}var A=function(){return A=Object.assign||function(e){for(var t,A=1,n=arguments.length;A<n;A++)for(var o in t=arguments[A])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},A.apply(this,arguments)};function n(e,t,A,n){return new(A||(A=Promise))(function(o,r){function i(e){try{s(n.next(e))}catch(e){r(e)}}function a(e){try{s(n.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof A?t:new A(function(e){e(t)})).then(i,a)}s((n=n.apply(e,t||[])).next())})}function o(e,t){var A,n,o,r,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(A)throw new TypeError("Generator is already executing.");for(;i;)try{if(A=1,n&&(o=2&r[0]?n.return:r[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,r[1])).done)return o;switch(n=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return i.label++,{value:r[1],done:!1};case 5:i.label++,n=r[1],r=[0];continue;case 7:r=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){i=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){i.label=r[1];break}if(6===r[0]&&i.label<o[1]){i.label=o[1],o=r;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(r);break}o[2]&&i.ops.pop(),i.trys.pop();continue}r=t.call(e,i)}catch(e){r=[6,e],n=0}finally{A=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}function r(e,t,A){if(A||2===arguments.length)for(var n,o=0,r=t.length;o<r;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||t)}for(var i=function(){function e(e,t,A,n){this.left=e,this.top=t,this.width=A,this.height=n}return e.prototype.add=function(t,A,n,o){return new e(this.left+t,this.top+A,this.width+n,this.height+o)},e.fromClientRect=function(t,A){return new e(A.left+t.windowBounds.left,A.top+t.windowBounds.top,A.width,A.height)},e.fromDOMRectList=function(t,A){var n=Array.from(A).find(function(e){return 0!==e.width});return n?new e(n.left+t.windowBounds.left,n.top+t.windowBounds.top,n.width,n.height):e.EMPTY},e.EMPTY=new e(0,0,0,0),e}(),a=function(e,t){return i.fromClientRect(e,t.getBoundingClientRect())},s=function(e){for(var t=[],A=0,n=e.length;A<n;){var o=e.charCodeAt(A++);if(o>=55296&&o<=56319&&A<n){var r=e.charCodeAt(A++);56320==(64512&r)?t.push(((1023&o)<<10)+(1023&r)+65536):(t.push(o),A--)}else t.push(o)}return t},c=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var A=e.length;if(!A)return"";for(var n=[],o=-1,r="";++o<A;){var i=e[o];i<=65535?n.push(i):(i-=65536,n.push(55296+(i>>10),i%1024+56320)),(o+1===A||n.length>16384)&&(r+=String.fromCharCode.apply(String,n),n.length=0)}return r},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u="undefined"==typeof Uint8Array?[]:new Uint8Array(256),d=0;d<64;d++)u[l.charCodeAt(d)]=d;for(var p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h="undefined"==typeof Uint8Array?[]:new Uint8Array(256),g=0;g<64;g++)h[p.charCodeAt(g)]=g;for(var f=function(e,t,A){return e.slice?e.slice(t,A):new Uint16Array(Array.prototype.slice.call(e,t,A))},m=function(){function e(e,t,A,n,o,r){this.initialValue=e,this.errorValue=t,this.highStart=A,this.highValueIndex=n,this.index=o,this.data=r}return e.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>5])<<2)+(31&e),this.data[t];if(e<=65535)return t=((t=this.index[2048+(e-55296>>5)])<<2)+(31&e),this.data[t];if(e<this.highStart)return t=2080+(e>>11),t=this.index[t],t+=e>>5&63,t=((t=this.index[t])<<2)+(31&e),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",B="undefined"==typeof Uint8Array?[]:new Uint8Array(256),w=0;w<64;w++)B[v.charCodeAt(w)]=w;var y=10,b=13,C=15,x=17,Q=18,F=19,U=20,S=21,k=22,E=24,I=25,T=26,H=27,D=28,P=30,O=32,K=33,M=34,L=35,R=37,_=38,V=39,j=40,N=42,G=[9001,65288],W="×",z="÷",X=function(e){var t,A,n,o=function(e){var t,A,n,o,r,i=.75*e.length,a=e.length,s=0;"="===e[e.length-1]&&(i--,"="===e[e.length-2]&&i--);var c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(i):new Array(i),l=Array.isArray(c)?c:new Uint8Array(c);for(t=0;t<a;t+=4)A=h[e.charCodeAt(t)],n=h[e.charCodeAt(t+1)],o=h[e.charCodeAt(t+2)],r=h[e.charCodeAt(t+3)],l[s++]=A<<2|n>>4,l[s++]=(15&n)<<4|o>>2,l[s++]=(3&o)<<6|63&r;return c}(e),r=Array.isArray(o)?function(e){for(var t=e.length,A=[],n=0;n<t;n+=4)A.push(e[n+3]<<24|e[n+2]<<16|e[n+1]<<8|e[n]);return A}(o):new Uint32Array(o),i=Array.isArray(o)?function(e){for(var t=e.length,A=[],n=0;n<t;n+=2)A.push(e[n+1]<<8|e[n]);return A}(o):new Uint16Array(o),a=f(i,12,r[4]/2),s=2===r[5]?f(i,(24+r[4])/2):(t=r,A=Math.ceil((24+r[4])/4),t.slice?t.slice(A,n):new Uint32Array(Array.prototype.slice.call(t,A,n)));return new m(r[0],r[1],r[2],r[3],a,s)}("KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA=="),J=[P,36],Y=[1,2,3,5],q=[y,8],Z=[H,T],$=Y.concat(q),ee=[_,V,j,M,L],te=[C,b],Ae=function(e,t,A,n){var o=n[A];if(Array.isArray(e)?-1!==e.indexOf(o):e===o)for(var r=A;r<=n.length;){if((s=n[++r])===t)return!0;if(s!==y)break}if(o===y)for(r=A;r>0;){var i=n[--r];if(Array.isArray(e)?-1!==e.indexOf(i):e===i)for(var a=A;a<=n.length;){var s;if((s=n[++a])===t)return!0;if(s!==y)break}if(i!==y)break}return!1},ne=function(e,t){for(var A=e;A>=0;){var n=t[A];if(n!==y)return n;A--}return 0},oe=function(e,t,A,n,o){if(0===A[n])return W;var r=n-1;if(Array.isArray(o)&&!0===o[r])return W;var i=r-1,a=r+1,s=t[r],c=i>=0?t[i]:0,l=t[a];if(2===s&&3===l)return W;if(-1!==Y.indexOf(s))return"!";if(-1!==Y.indexOf(l))return W;if(-1!==q.indexOf(l))return W;if(8===ne(r,t))return z;if(11===X.get(e[r]))return W;if((s===O||s===K)&&11===X.get(e[a]))return W;if(7===s||7===l)return W;if(9===s)return W;if(-1===[y,b,C].indexOf(s)&&9===l)return W;if(-1!==[x,Q,F,E,D].indexOf(l))return W;if(ne(r,t)===k)return W;if(Ae(23,k,r,t))return W;if(Ae([x,Q],S,r,t))return W;if(Ae(12,12,r,t))return W;if(s===y)return z;if(23===s||23===l)return W;if(16===l||16===s)return z;if(-1!==[b,C,S].indexOf(l)||14===s)return W;if(36===c&&-1!==te.indexOf(s))return W;if(s===D&&36===l)return W;if(l===U)return W;if(-1!==J.indexOf(l)&&s===I||-1!==J.indexOf(s)&&l===I)return W;if(s===H&&-1!==[R,O,K].indexOf(l)||-1!==[R,O,K].indexOf(s)&&l===T)return W;if(-1!==J.indexOf(s)&&-1!==Z.indexOf(l)||-1!==Z.indexOf(s)&&-1!==J.indexOf(l))return W;if(-1!==[H,T].indexOf(s)&&(l===I||-1!==[k,C].indexOf(l)&&t[a+1]===I)||-1!==[k,C].indexOf(s)&&l===I||s===I&&-1!==[I,D,E].indexOf(l))return W;if(-1!==[I,D,E,x,Q].indexOf(l))for(var u=r;u>=0;){if((d=t[u])===I)return W;if(-1===[D,E].indexOf(d))break;u--}if(-1!==[H,T].indexOf(l))for(u=-1!==[x,Q].indexOf(s)?i:r;u>=0;){var d;if((d=t[u])===I)return W;if(-1===[D,E].indexOf(d))break;u--}if(_===s&&-1!==[_,V,M,L].indexOf(l)||-1!==[V,M].indexOf(s)&&-1!==[V,j].indexOf(l)||-1!==[j,L].indexOf(s)&&l===j)return W;if(-1!==ee.indexOf(s)&&-1!==[U,T].indexOf(l)||-1!==ee.indexOf(l)&&s===H)return W;if(-1!==J.indexOf(s)&&-1!==J.indexOf(l))return W;if(s===E&&-1!==J.indexOf(l))return W;if(-1!==J.concat(I).indexOf(s)&&l===k&&-1===G.indexOf(e[a])||-1!==J.concat(I).indexOf(l)&&s===Q)return W;if(41===s&&41===l){for(var p=A[r],h=1;p>0&&41===t[--p];)h++;if(h%2!=0)return W}return s===O&&l===K?W:z},re=function(e,t){t||(t={lineBreak:"normal",wordBreak:"normal"});var A=function(e,t){void 0===t&&(t="strict");var A=[],n=[],o=[];return e.forEach(function(e,r){var i=X.get(e);if(i>50?(o.push(!0),i-=50):o.push(!1),-1!==["normal","auto","loose"].indexOf(t)&&-1!==[8208,8211,12316,12448].indexOf(e))return n.push(r),A.push(16);if(4===i||11===i){if(0===r)return n.push(r),A.push(P);var a=A[r-1];return-1===$.indexOf(a)?(n.push(n[r-1]),A.push(a)):(n.push(r),A.push(P))}return n.push(r),31===i?A.push("strict"===t?S:R):i===N||29===i?A.push(P):43===i?e>=131072&&e<=196605||e>=196608&&e<=262141?A.push(R):A.push(P):void A.push(i)}),[n,A,o]}(e,t.lineBreak),n=A[0],o=A[1],r=A[2];"break-all"!==t.wordBreak&&"break-word"!==t.wordBreak||(o=o.map(function(e){return-1!==[I,P,N].indexOf(e)?R:e}));var i="keep-all"===t.wordBreak?r.map(function(t,A){return t&&e[A]>=19968&&e[A]<=40959}):void 0;return[n,o,i]},ie=function(){function e(e,t,A,n){this.codePoints=e,this.required="!"===t,this.start=A,this.end=n}return e.prototype.slice=function(){return c.apply(void 0,this.codePoints.slice(this.start,this.end))},e}(),ae=45,se=43,ce=-1,le=function(e){return e>=48&&e<=57},ue=function(e){return le(e)||e>=65&&e<=70||e>=97&&e<=102},de=function(e){return 10===e||9===e||32===e},pe=function(e){return function(e){return function(e){return e>=97&&e<=122}(e)||function(e){return e>=65&&e<=90}(e)}(e)||function(e){return e>=128}(e)||95===e},he=function(e){return pe(e)||le(e)||e===ae},ge=function(e){return e>=0&&e<=8||11===e||e>=14&&e<=31||127===e},fe=function(e,t){return 92===e&&10!==t},me=function(e,t,A){return e===ae?pe(t)||fe(t,A):!!pe(e)||!(92!==e||!fe(e,t))},ve=function(e,t,A){return e===se||e===ae?!!le(t)||46===t&&le(A):le(46===e?t:e)},Be=function(e){var t=0,A=1;e[t]!==se&&e[t]!==ae||(e[t]===ae&&(A=-1),t++);for(var n=[];le(e[t]);)n.push(e[t++]);var o=n.length?parseInt(c.apply(void 0,n),10):0;46===e[t]&&t++;for(var r=[];le(e[t]);)r.push(e[t++]);var i=r.length,a=i?parseInt(c.apply(void 0,r),10):0;69!==e[t]&&101!==e[t]||t++;var s=1;e[t]!==se&&e[t]!==ae||(e[t]===ae&&(s=-1),t++);for(var l=[];le(e[t]);)l.push(e[t++]);var u=l.length?parseInt(c.apply(void 0,l),10):0;return A*(o+a*Math.pow(10,-i))*Math.pow(10,s*u)},we={type:2},ye={type:3},be={type:4},Ce={type:13},xe={type:8},Qe={type:21},Fe={type:9},Ue={type:10},Se={type:11},ke={type:12},Ee={type:14},Ie={type:23},Te={type:1},He={type:25},De={type:24},Pe={type:26},Oe={type:27},Ke={type:28},Me={type:29},Le={type:31},Re={type:32},_e=function(){function e(){this._value=[]}return e.prototype.write=function(e){this._value=this._value.concat(s(e))},e.prototype.read=function(){for(var e=[],t=this.consumeToken();t!==Re;)e.push(t),t=this.consumeToken();return e},e.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case 34:return this.consumeStringToken(34);case 35:var t=this.peekCodePoint(0),A=this.peekCodePoint(1),n=this.peekCodePoint(2);if(he(t)||fe(A,n)){var o=me(t,A,n)?2:1;return{type:5,value:this.consumeName(),flags:o}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Ce;break;case 39:return this.consumeStringToken(39);case 40:return we;case 41:return ye;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Ee;break;case se:if(ve(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case 44:return be;case ae:var r=e,i=this.peekCodePoint(0),a=this.peekCodePoint(1);if(ve(r,i,a))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(me(r,i,a))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(i===ae&&62===a)return this.consumeCodePoint(),this.consumeCodePoint(),De;break;case 46:if(ve(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case 47:if(42===this.peekCodePoint(0))for(this.consumeCodePoint();;){var s=this.consumeCodePoint();if(42===s&&47===(s=this.consumeCodePoint()))return this.consumeToken();if(s===ce)return this.consumeToken()}break;case 58:return Pe;case 59:return Oe;case 60:if(33===this.peekCodePoint(0)&&this.peekCodePoint(1)===ae&&this.peekCodePoint(2)===ae)return this.consumeCodePoint(),this.consumeCodePoint(),He;break;case 64:var l=this.peekCodePoint(0),u=this.peekCodePoint(1),d=this.peekCodePoint(2);if(me(l,u,d))return{type:7,value:this.consumeName()};break;case 91:return Ke;case 92:if(fe(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case 93:return Me;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),xe;break;case 123:return Se;case 125:return ke;case 117:case 85:var p=this.peekCodePoint(0),h=this.peekCodePoint(1);return p!==se||!ue(h)&&63!==h||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Fe;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),Qe;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Ue;break;case ce:return Re}return de(e)?(this.consumeWhiteSpace(),Le):le(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):pe(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:c(e)}},e.prototype.consumeCodePoint=function(){var e=this._value.shift();return void 0===e?-1:e},e.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},e.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},e.prototype.consumeUnicodeRangeToken=function(){for(var e=[],t=this.consumeCodePoint();ue(t)&&e.length<6;)e.push(t),t=this.consumeCodePoint();for(var A=!1;63===t&&e.length<6;)e.push(t),t=this.consumeCodePoint(),A=!0;if(A)return{type:30,start:parseInt(c.apply(void 0,e.map(function(e){return 63===e?48:e})),16),end:parseInt(c.apply(void 0,e.map(function(e){return 63===e?70:e})),16)};var n=parseInt(c.apply(void 0,e),16);if(this.peekCodePoint(0)===ae&&ue(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();for(var o=[];ue(t)&&o.length<6;)o.push(t),t=this.consumeCodePoint();return{type:30,start:n,end:parseInt(c.apply(void 0,o),16)}}return{type:30,start:n,end:n}},e.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return"url"===e.toLowerCase()&&40===this.peekCodePoint(0)?(this.consumeCodePoint(),this.consumeUrlToken()):40===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}},e.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===ce)return{type:22,value:""};var t=this.peekCodePoint(0);if(39===t||34===t){var A=this.consumeStringToken(this.consumeCodePoint());return 0===A.type&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===ce||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:22,value:A.value}):(this.consumeBadUrlRemnants(),Ie)}for(;;){var n=this.consumeCodePoint();if(n===ce||41===n)return{type:22,value:c.apply(void 0,e)};if(de(n))return this.consumeWhiteSpace(),this.peekCodePoint(0)===ce||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:22,value:c.apply(void 0,e)}):(this.consumeBadUrlRemnants(),Ie);if(34===n||39===n||40===n||ge(n))return this.consumeBadUrlRemnants(),Ie;if(92===n){if(!fe(n,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),Ie;e.push(this.consumeEscapedCodePoint())}else e.push(n)}},e.prototype.consumeWhiteSpace=function(){for(;de(this.peekCodePoint(0));)this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(41===e||e===ce)return;fe(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},e.prototype.consumeStringSlice=function(e){for(var t="";e>0;){var A=Math.min(5e4,e);t+=c.apply(void 0,this._value.splice(0,A)),e-=A}return this._value.shift(),t},e.prototype.consumeStringToken=function(e){for(var t="",A=0;;){var n=this._value[A];if(n===ce||void 0===n||n===e)return{type:0,value:t+=this.consumeStringSlice(A)};if(10===n)return this._value.splice(0,A),Te;if(92===n){var o=this._value[A+1];o!==ce&&void 0!==o&&(10===o?(t+=this.consumeStringSlice(A),A=-1,this._value.shift()):fe(n,o)&&(t+=this.consumeStringSlice(A),t+=c(this.consumeEscapedCodePoint()),A=-1))}A++}},e.prototype.consumeNumber=function(){var e=[],t=4,A=this.peekCodePoint(0);for(A!==se&&A!==ae||e.push(this.consumeCodePoint());le(this.peekCodePoint(0));)e.push(this.consumeCodePoint());A=this.peekCodePoint(0);var n=this.peekCodePoint(1);if(46===A&&le(n))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;le(this.peekCodePoint(0));)e.push(this.consumeCodePoint());A=this.peekCodePoint(0),n=this.peekCodePoint(1);var o=this.peekCodePoint(2);if((69===A||101===A)&&((n===se||n===ae)&&le(o)||le(n)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;le(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[Be(e),t]},e.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),t=e[0],A=e[1],n=this.peekCodePoint(0),o=this.peekCodePoint(1),r=this.peekCodePoint(2);return me(n,o,r)?{type:15,number:t,flags:A,unit:this.consumeName()}:37===n?(this.consumeCodePoint(),{type:16,number:t,flags:A}):{type:17,number:t,flags:A}},e.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(ue(e)){for(var t=c(e);ue(this.peekCodePoint(0))&&t.length<6;)t+=c(this.consumeCodePoint());de(this.peekCodePoint(0))&&this.consumeCodePoint();var A=parseInt(t,16);return 0===A||function(e){return e>=55296&&e<=57343}(A)||A>1114111?65533:A}return e===ce?65533:e},e.prototype.consumeName=function(){for(var e="";;){var t=this.consumeCodePoint();if(he(t))e+=c(t);else{if(!fe(t,this.peekCodePoint(0)))return this.reconsumeCodePoint(t),e;e+=c(this.consumeEscapedCodePoint())}}},e}(),Ve=function(){function e(e){this._tokens=e}return e.create=function(t){var A=new _e;return A.write(t),new e(A.read())},e.parseValue=function(t){return e.create(t).parseComponentValue()},e.parseValues=function(t){return e.create(t).parseComponentValues()},e.prototype.parseComponentValue=function(){for(var e=this.consumeToken();31===e.type;)e=this.consumeToken();if(32===e.type)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var t=this.consumeComponentValue();do{e=this.consumeToken()}while(31===e.type);if(32===e.type)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},e.prototype.parseComponentValues=function(){for(var e=[];;){var t=this.consumeComponentValue();if(32===t.type)return e;e.push(t),e.push()}},e.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e},e.prototype.consumeSimpleBlock=function(e){for(var t={type:e,values:[]},A=this.consumeToken();;){if(32===A.type||qe(A,e))return t;this.reconsumeToken(A),t.values.push(this.consumeComponentValue()),A=this.consumeToken()}},e.prototype.consumeFunction=function(e){for(var t={name:e.value,values:[],type:18};;){var A=this.consumeToken();if(32===A.type||3===A.type)return t;this.reconsumeToken(A),t.values.push(this.consumeComponentValue())}},e.prototype.consumeToken=function(){var e=this._tokens.shift();return void 0===e?Re:e},e.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},e}(),je=function(e){return 15===e.type},Ne=function(e){return 17===e.type},Ge=function(e){return 20===e.type},We=function(e){return 0===e.type},ze=function(e,t){return Ge(e)&&e.value===t},Xe=function(e){return 31!==e.type},Je=function(e){return 31!==e.type&&4!==e.type},Ye=function(e){var t=[],A=[];return e.forEach(function(e){if(4===e.type){if(0===A.length)throw new Error("Error parsing function args, zero tokens for arg");return t.push(A),void(A=[])}31!==e.type&&A.push(e)}),A.length&&t.push(A),t},qe=function(e,t){return 11===t&&12===e.type||28===t&&29===e.type||2===t&&3===e.type},Ze=function(e){return 17===e.type||15===e.type},$e=function(e){return 16===e.type||Ze(e)},et=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},tt={type:17,number:0,flags:4},At={type:16,number:50,flags:4},nt={type:16,number:100,flags:4},ot=function(e,t,A){var n=e[0],o=e[1];return[rt(n,t),rt(void 0!==o?o:n,A)]},rt=function(e,t){if(16===e.type)return e.number/100*t;if(je(e))switch(e.unit){case"rem":case"em":return 16*e.number;default:return e.number}return e.number},it="grad",at="turn",st=function(e,t){if(15===t.type)switch(t.unit){case"deg":return Math.PI*t.number/180;case it:return Math.PI/200*t.number;case"rad":return t.number;case at:return 2*Math.PI*t.number}throw new Error("Unsupported angle type")},ct=function(e){return 15===e.type&&("deg"===e.unit||e.unit===it||"rad"===e.unit||e.unit===at)},lt=function(e){switch(e.filter(Ge).map(function(e){return e.value}).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[tt,tt];case"to top":case"bottom":return ut(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[tt,nt];case"to right":case"left":return ut(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[nt,nt];case"to bottom":case"top":return ut(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[nt,tt];case"to left":case"right":return ut(270)}return 0},ut=function(e){return Math.PI*e/180},dt=function(e,t){if(18===t.type){var A=wt[t.name];if(void 0===A)throw new Error('Attempting to parse an unsupported color function "'+t.name+'"');return A(e,t.values)}if(5===t.type){if(3===t.value.length){var n=t.value.substring(0,1),o=t.value.substring(1,2),r=t.value.substring(2,3);return gt(parseInt(n+n,16),parseInt(o+o,16),parseInt(r+r,16),1)}if(4===t.value.length){n=t.value.substring(0,1),o=t.value.substring(1,2),r=t.value.substring(2,3);var i=t.value.substring(3,4);return gt(parseInt(n+n,16),parseInt(o+o,16),parseInt(r+r,16),parseInt(i+i,16)/255)}if(6===t.value.length)return n=t.value.substring(0,2),o=t.value.substring(2,4),r=t.value.substring(4,6),gt(parseInt(n,16),parseInt(o,16),parseInt(r,16),1);if(8===t.value.length)return n=t.value.substring(0,2),o=t.value.substring(2,4),r=t.value.substring(4,6),i=t.value.substring(6,8),gt(parseInt(n,16),parseInt(o,16),parseInt(r,16),parseInt(i,16)/255)}if(20===t.type){var a=bt[t.value.toUpperCase()];if(void 0!==a)return a}return bt.TRANSPARENT},pt=function(e){return!(255&e)},ht=function(e){var t=255&e,A=255&e>>8,n=255&e>>16,o=255&e>>24;return t<255?"rgba("+o+","+n+","+A+","+t/255+")":"rgb("+o+","+n+","+A+")"},gt=function(e,t,A,n){return(e<<24|t<<16|A<<8|Math.round(255*n))>>>0},ft=function(e,t){if(17===e.type)return e.number;if(16===e.type){var A=3===t?1:255;return 3===t?e.number/100*A:Math.round(e.number/100*A)}return 0},mt=function(e,t){var A=t.filter(Je);if(3===A.length){var n=A.map(ft),o=n[0],r=n[1],i=n[2];return gt(o,r,i,1)}if(4===A.length){var a=A.map(ft),s=(o=a[0],r=a[1],i=a[2],a[3]);return gt(o,r,i,s)}return 0};function vt(e,t,A){return A<0&&(A+=1),A>=1&&(A-=1),A<1/6?(t-e)*A*6+e:A<.5?t:A<2/3?6*(t-e)*(2/3-A)+e:e}var Bt=function(e,t){var A=t.filter(Je),n=A[0],o=A[1],r=A[2],i=A[3],a=(17===n.type?ut(n.number):st(e,n))/(2*Math.PI),s=$e(o)?o.number/100:0,c=$e(r)?r.number/100:0,l=void 0!==i&&$e(i)?rt(i,1):1;if(0===s)return gt(255*c,255*c,255*c,1);var u=c<=.5?c*(s+1):c+s-c*s,d=2*c-u,p=vt(d,u,a+1/3),h=vt(d,u,a),g=vt(d,u,a-1/3);return gt(255*p,255*h,255*g,l)},wt={hsl:Bt,hsla:Bt,rgb:mt,rgba:mt},yt=function(e,t){return dt(e,Ve.create(t).parseComponentValue())},bt={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},Ct={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map(function(e){if(Ge(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},xt={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Qt=function(e,t){var A=dt(e,t[0]),n=t[1];return n&&$e(n)?{color:A,stop:n}:{color:A,stop:null}},Ft=function(e,t){var A=e[0],n=e[e.length-1];null===A.stop&&(A.stop=tt),null===n.stop&&(n.stop=nt);for(var o=[],r=0,i=0;i<e.length;i++){var a=e[i].stop;if(null!==a){var s=rt(a,t);s>r?o.push(s):o.push(r),r=s}else o.push(null)}var c=null;for(i=0;i<o.length;i++){var l=o[i];if(null===l)null===c&&(c=i);else if(null!==c){for(var u=i-c,d=(l-o[c-1])/(u+1),p=1;p<=u;p++)o[c+p-1]=d*p;c=null}}return e.map(function(e,A){return{color:e.color,stop:Math.max(Math.min(1,o[A]/t),0)}})},Ut=function(e,t,A){var n="number"==typeof e?e:function(e,t,A){var n=t/2,o=A/2,r=rt(e[0],t)-n,i=o-rt(e[1],A);return(Math.atan2(i,r)+2*Math.PI)%(2*Math.PI)}(e,t,A),o=Math.abs(t*Math.sin(n))+Math.abs(A*Math.cos(n)),r=t/2,i=A/2,a=o/2,s=Math.sin(n-Math.PI/2)*a,c=Math.cos(n-Math.PI/2)*a;return[o,r-c,r+c,i-s,i+s]},St=function(e,t){return Math.sqrt(e*e+t*t)},kt=function(e,t,A,n,o){return[[0,0],[0,t],[e,0],[e,t]].reduce(function(e,t){var r=t[0],i=t[1],a=St(A-r,n-i);return(o?a<e.optimumDistance:a>e.optimumDistance)?{optimumCorner:t,optimumDistance:a}:e},{optimumDistance:o?1/0:-1/0,optimumCorner:null}).optimumCorner},Et=function(e,t){var A=ut(180),n=[];return Ye(t).forEach(function(t,o){if(0===o){var r=t[0];if(20===r.type&&-1!==["top","left","right","bottom"].indexOf(r.value))return void(A=lt(t));if(ct(r))return void(A=(st(e,r)+ut(270))%ut(360))}var i=Qt(e,t);n.push(i)}),{angle:A,stops:n,type:1}},It="closest-side",Tt="farthest-side",Ht="closest-corner",Dt="farthest-corner",Pt="circle",Ot="ellipse",Kt="cover",Mt="contain",Lt=function(e,t){var A=0,n=3,o=[],r=[];return Ye(t).forEach(function(t,i){var a=!0;if(0===i?a=t.reduce(function(e,t){if(Ge(t))switch(t.value){case"center":return r.push(At),!1;case"top":case"left":return r.push(tt),!1;case"right":case"bottom":return r.push(nt),!1}else if($e(t)||Ze(t))return r.push(t),!1;return e},a):1===i&&(a=t.reduce(function(e,t){if(Ge(t))switch(t.value){case Pt:return A=0,!1;case Ot:return A=1,!1;case Mt:case It:return n=0,!1;case Tt:return n=1,!1;case Ht:return n=2,!1;case Kt:case Dt:return n=3,!1}else if(Ze(t)||$e(t))return Array.isArray(n)||(n=[]),n.push(t),!1;return e},a)),a){var s=Qt(e,t);o.push(s)}}),{size:n,shape:A,stops:o,position:r,type:2}},Rt=function(e,t){if(22===t.type){var A={url:t.value,type:0};return e.cache.addImage(t.value),A}if(18===t.type){var n=Vt[t.name];if(void 0===n)throw new Error('Attempting to parse an unsupported image function "'+t.name+'"');return n(e,t.values)}throw new Error("Unsupported image type "+t.type)};var _t,Vt={"linear-gradient":function(e,t){var A=ut(180),n=[];return Ye(t).forEach(function(t,o){if(0===o){var r=t[0];if(20===r.type&&"to"===r.value)return void(A=lt(t));if(ct(r))return void(A=st(e,r))}var i=Qt(e,t);n.push(i)}),{angle:A,stops:n,type:1}},"-moz-linear-gradient":Et,"-ms-linear-gradient":Et,"-o-linear-gradient":Et,"-webkit-linear-gradient":Et,"radial-gradient":function(e,t){var A=0,n=3,o=[],r=[];return Ye(t).forEach(function(t,i){var a=!0;if(0===i){var s=!1;a=t.reduce(function(e,t){if(s)if(Ge(t))switch(t.value){case"center":return r.push(At),e;case"top":case"left":return r.push(tt),e;case"right":case"bottom":return r.push(nt),e}else($e(t)||Ze(t))&&r.push(t);else if(Ge(t))switch(t.value){case Pt:return A=0,!1;case Ot:return A=1,!1;case"at":return s=!0,!1;case It:return n=0,!1;case Kt:case Tt:return n=1,!1;case Mt:case Ht:return n=2,!1;case Dt:return n=3,!1}else if(Ze(t)||$e(t))return Array.isArray(n)||(n=[]),n.push(t),!1;return e},a)}if(a){var c=Qt(e,t);o.push(c)}}),{size:n,shape:A,stops:o,position:r,type:2}},"-moz-radial-gradient":Lt,"-ms-radial-gradient":Lt,"-o-radial-gradient":Lt,"-webkit-radial-gradient":Lt,"-webkit-gradient":function(e,t){var A=ut(180),n=[],o=1;return Ye(t).forEach(function(t,A){var r=t[0];if(0===A){if(Ge(r)&&"linear"===r.value)return void(o=1);if(Ge(r)&&"radial"===r.value)return void(o=2)}if(18===r.type)if("from"===r.name){var i=dt(e,r.values[0]);n.push({stop:tt,color:i})}else if("to"===r.name)i=dt(e,r.values[0]),n.push({stop:nt,color:i});else if("color-stop"===r.name){var a=r.values.filter(Je);if(2===a.length){i=dt(e,a[1]);var s=a[0];Ne(s)&&n.push({stop:{type:16,number:100*s.number,flags:s.flags},color:i})}}}),1===o?{angle:(A+ut(180))%ut(360),stops:n,type:o}:{size:3,shape:0,stops:n,position:[],type:o}}},jt={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(0===t.length)return[];var A=t[0];return 20===A.type&&"none"===A.value?[]:t.filter(function(e){return Je(e)&&function(e){return!(20===e.type&&"none"===e.value||18===e.type&&!Vt[e.name])}(e)}).map(function(t){return Rt(e,t)})}},Nt={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map(function(e){if(Ge(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Gt={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(e,t){return Ye(t).map(function(e){return e.filter($e)}).map(et)}},Wt={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(e,t){return Ye(t).map(function(e){return e.filter(Ge).map(function(e){return e.value}).join(" ")}).map(zt)}},zt=function(e){switch(e){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}};!function(e){e.AUTO="auto",e.CONTAIN="contain",e.COVER="cover"}(_t||(_t={}));var Xt,Jt={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(e,t){return Ye(t).map(function(e){return e.filter(Yt)})}},Yt=function(e){return Ge(e)||$e(e)},qt=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},Zt=qt("top"),$t=qt("right"),eA=qt("bottom"),tA=qt("left"),AA=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:1,parse:function(e,t){return et(t.filter($e))}}},nA=AA("top-left"),oA=AA("top-right"),rA=AA("bottom-right"),iA=AA("bottom-left"),aA=function(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(e,t){switch(t){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},sA=aA("top"),cA=aA("right"),lA=aA("bottom"),uA=aA("left"),dA=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return je(t)?t.number:0}}},pA=dA("top"),hA=dA("right"),gA=dA("bottom"),fA=dA("left"),mA={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},vA={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(e,t){return"rtl"===t?1:0}},BA={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(e,t){return t.filter(Ge).reduce(function(e,t){return e|wA(t.value)},0)}},wA=function(e){switch(e){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},yA={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},bA={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(e,t){return 20===t.type&&"normal"===t.value?0:17===t.type||15===t.type?t.number:0}};!function(e){e.NORMAL="normal",e.STRICT="strict"}(Xt||(Xt={}));var CA,xA={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){return"strict"===t?Xt.STRICT:Xt.NORMAL}},QA={name:"line-height",initialValue:"normal",prefix:!1,type:4},FA=function(e,t){return Ge(e)&&"normal"===e.value?1.2*t:17===e.type?t*e.number:$e(e)?rt(e,t):t},UA={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(e,t){return 20===t.type&&"none"===t.value?null:Rt(e,t)}},SA={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(e,t){return"inside"===t?0:1}},kA={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},EA=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:4}},IA=EA("top"),TA=EA("right"),HA=EA("bottom"),DA=EA("left"),PA={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(e,t){return t.filter(Ge).map(function(e){switch(e.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}})}},OA={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){return"break-word"===t?"break-word":"normal"}},KA=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},MA=KA("top"),LA=KA("right"),RA=KA("bottom"),_A=KA("left"),VA={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(e,t){switch(t){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},jA={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(e,t){switch(t){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},NA={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return 1===t.length&&ze(t[0],"none")?[]:Ye(t).map(function(t){for(var A={color:bt.TRANSPARENT,offsetX:tt,offsetY:tt,blur:tt},n=0,o=0;o<t.length;o++){var r=t[o];Ze(r)?(0===n?A.offsetX=r:1===n?A.offsetY=r:A.blur=r,n++):A.color=dt(e,r)}return A})}},GA={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},WA={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(e,t){if(20===t.type&&"none"===t.value)return null;if(18===t.type){var A=zA[t.name];if(void 0===A)throw new Error('Attempting to parse an unsupported transform function "'+t.name+'"');return A(t.values)}return null}},zA={matrix:function(e){var t=e.filter(function(e){return 17===e.type}).map(function(e){return e.number});return 6===t.length?t:null},matrix3d:function(e){var t=e.filter(function(e){return 17===e.type}).map(function(e){return e.number}),A=t[0],n=t[1];t[2],t[3];var o=t[4],r=t[5];t[6],t[7],t[8],t[9],t[10],t[11];var i=t[12],a=t[13];return t[14],t[15],16===t.length?[A,n,o,r,i,a]:null}},XA={type:16,number:50,flags:4},JA=[XA,XA],YA={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(e,t){var A=t.filter($e);return 2!==A.length?JA:[A[0],A[1]]}},qA={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"hidden":return 1;case"collapse":return 2;default:return 0}}};!function(e){e.NORMAL="normal",e.BREAK_ALL="break-all",e.KEEP_ALL="keep-all"}(CA||(CA={}));for(var ZA={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"break-all":return CA.BREAK_ALL;case"keep-all":return CA.KEEP_ALL;default:return CA.NORMAL}}},$A={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(e,t){if(20===t.type)return{auto:!0,order:0};if(Ne(t))return{auto:!1,order:t.number};throw new Error("Invalid z-index number parsed")}},en={name:"time",parse:function(e,t){if(15===t.type)switch(t.unit.toLowerCase()){case"s":return 1e3*t.number;case"ms":return t.number}throw new Error("Unsupported time type")}},tn={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(e,t){return Ne(t)?t.number:1}},An={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},nn={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(e,t){return t.filter(Ge).map(function(e){switch(e.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(e){return 0!==e})}},on={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(e,t){var A=[],n=[];return t.forEach(function(e){switch(e.type){case 20:case 0:A.push(e.value);break;case 17:A.push(e.number.toString());break;case 4:n.push(A.join(" ")),A.length=0}}),A.length&&n.push(A.join(" ")),n.map(function(e){return-1===e.indexOf(" ")?e:"'"+e+"'"})}},rn={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},an={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(e,t){return Ne(t)?t.number:Ge(t)&&"bold"===t.value?700:400}},sn={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.filter(Ge).map(function(e){return e.value})}},cn={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},ln=function(e,t){return 0!==(e&t)},un={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(0===t.length)return[];var A=t[0];return 20===A.type&&"none"===A.value?[]:t}},dn={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return null;var A=t[0];if(20===A.type&&"none"===A.value)return null;for(var n=[],o=t.filter(Xe),r=0;r<o.length;r++){var i=o[r],a=o[r+1];if(20===i.type){var s=a&&Ne(a)?a.number:1;n.push({counter:i.value,increment:s})}}return n}},pn={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return[];for(var A=[],n=t.filter(Xe),o=0;o<n.length;o++){var r=n[o],i=n[o+1];if(Ge(r)&&"none"!==r.value){var a=i&&Ne(i)?i.number:0;A.push({counter:r.value,reset:a})}}return A}},hn={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(e,t){return t.filter(je).map(function(t){return en.parse(e,t)})}},gn={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return null;var A=t[0];if(20===A.type&&"none"===A.value)return null;var n=[],o=t.filter(We);if(o.length%2!=0)return null;for(var r=0;r<o.length;r+=2){var i=o[r].value,a=o[r+1].value;n.push({open:i,close:a})}return n}},fn=function(e,t,A){if(!e)return"";var n=e[Math.min(t,e.length-1)];return n?A?n.open:n.close:""},mn={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return 1===t.length&&ze(t[0],"none")?[]:Ye(t).map(function(t){for(var A={color:255,offsetX:tt,offsetY:tt,blur:tt,spread:tt,inset:!1},n=0,o=0;o<t.length;o++){var r=t[o];ze(r,"inset")?A.inset=!0:Ze(r)?(0===n?A.offsetX=r:1===n?A.offsetY=r:2===n?A.blur=r:A.spread=r,n++):A.color=dt(e,r)}return A})}},vn={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(e,t){var A=[];return t.filter(Ge).forEach(function(e){switch(e.value){case"stroke":A.push(1);break;case"fill":A.push(0);break;case"markers":A.push(2)}}),[0,1,2].forEach(function(e){-1===A.indexOf(e)&&A.push(e)}),A}},Bn={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},wn={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return je(t)?t.number:0}},yn=function(){function e(e,t){var A,n;this.animationDuration=xn(e,hn,t.animationDuration),this.backgroundClip=xn(e,Ct,t.backgroundClip),this.backgroundColor=xn(e,xt,t.backgroundColor),this.backgroundImage=xn(e,jt,t.backgroundImage),this.backgroundOrigin=xn(e,Nt,t.backgroundOrigin),this.backgroundPosition=xn(e,Gt,t.backgroundPosition),this.backgroundRepeat=xn(e,Wt,t.backgroundRepeat),this.backgroundSize=xn(e,Jt,t.backgroundSize),this.borderTopColor=xn(e,Zt,t.borderTopColor),this.borderRightColor=xn(e,$t,t.borderRightColor),this.borderBottomColor=xn(e,eA,t.borderBottomColor),this.borderLeftColor=xn(e,tA,t.borderLeftColor),this.borderTopLeftRadius=xn(e,nA,t.borderTopLeftRadius),this.borderTopRightRadius=xn(e,oA,t.borderTopRightRadius),this.borderBottomRightRadius=xn(e,rA,t.borderBottomRightRadius),this.borderBottomLeftRadius=xn(e,iA,t.borderBottomLeftRadius),this.borderTopStyle=xn(e,sA,t.borderTopStyle),this.borderRightStyle=xn(e,cA,t.borderRightStyle),this.borderBottomStyle=xn(e,lA,t.borderBottomStyle),this.borderLeftStyle=xn(e,uA,t.borderLeftStyle),this.borderTopWidth=xn(e,pA,t.borderTopWidth),this.borderRightWidth=xn(e,hA,t.borderRightWidth),this.borderBottomWidth=xn(e,gA,t.borderBottomWidth),this.borderLeftWidth=xn(e,fA,t.borderLeftWidth),this.boxShadow=xn(e,mn,t.boxShadow),this.color=xn(e,mA,t.color),this.direction=xn(e,vA,t.direction),this.display=xn(e,BA,t.display),this.float=xn(e,yA,t.cssFloat),this.fontFamily=xn(e,on,t.fontFamily),this.fontSize=xn(e,rn,t.fontSize),this.fontStyle=xn(e,cn,t.fontStyle),this.fontVariant=xn(e,sn,t.fontVariant),this.fontWeight=xn(e,an,t.fontWeight),this.letterSpacing=xn(e,bA,t.letterSpacing),this.lineBreak=xn(e,xA,t.lineBreak),this.lineHeight=xn(e,QA,t.lineHeight),this.listStyleImage=xn(e,UA,t.listStyleImage),this.listStylePosition=xn(e,SA,t.listStylePosition),this.listStyleType=xn(e,kA,t.listStyleType),this.marginTop=xn(e,IA,t.marginTop),this.marginRight=xn(e,TA,t.marginRight),this.marginBottom=xn(e,HA,t.marginBottom),this.marginLeft=xn(e,DA,t.marginLeft),this.opacity=xn(e,tn,t.opacity);var o=xn(e,PA,t.overflow);this.overflowX=o[0],this.overflowY=o[o.length>1?1:0],this.overflowWrap=xn(e,OA,t.overflowWrap),this.paddingTop=xn(e,MA,t.paddingTop),this.paddingRight=xn(e,LA,t.paddingRight),this.paddingBottom=xn(e,RA,t.paddingBottom),this.paddingLeft=xn(e,_A,t.paddingLeft),this.paintOrder=xn(e,vn,t.paintOrder),this.position=xn(e,jA,t.position),this.textAlign=xn(e,VA,t.textAlign),this.textDecorationColor=xn(e,An,null!==(A=t.textDecorationColor)&&void 0!==A?A:t.color),this.textDecorationLine=xn(e,nn,null!==(n=t.textDecorationLine)&&void 0!==n?n:t.textDecoration),this.textShadow=xn(e,NA,t.textShadow),this.textTransform=xn(e,GA,t.textTransform),this.transform=xn(e,WA,t.transform),this.transformOrigin=xn(e,YA,t.transformOrigin),this.visibility=xn(e,qA,t.visibility),this.webkitTextStrokeColor=xn(e,Bn,t.webkitTextStrokeColor),this.webkitTextStrokeWidth=xn(e,wn,t.webkitTextStrokeWidth),this.wordBreak=xn(e,ZA,t.wordBreak),this.zIndex=xn(e,$A,t.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},e.prototype.isTransparent=function(){return pt(this.backgroundColor)},e.prototype.isTransformed=function(){return null!==this.transform},e.prototype.isPositioned=function(){return 0!==this.position},e.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},e.prototype.isFloating=function(){return 0!==this.float},e.prototype.isInlineLevel=function(){return ln(this.display,4)||ln(this.display,33554432)||ln(this.display,268435456)||ln(this.display,536870912)||ln(this.display,67108864)||ln(this.display,134217728)},e}(),bn=function(e,t){this.content=xn(e,un,t.content),this.quotes=xn(e,gn,t.quotes)},Cn=function(e,t){this.counterIncrement=xn(e,dn,t.counterIncrement),this.counterReset=xn(e,pn,t.counterReset)},xn=function(e,t,A){var n=new _e,o=null!=A?A.toString():t.initialValue;n.write(o);var r=new Ve(n.read());switch(t.type){case 2:var i=r.parseComponentValue();return t.parse(e,Ge(i)?i.value:t.initialValue);case 0:return t.parse(e,r.parseComponentValue());case 1:return t.parse(e,r.parseComponentValues());case 4:return r.parseComponentValue();case 3:switch(t.format){case"angle":return st(e,r.parseComponentValue());case"color":return dt(e,r.parseComponentValue());case"image":return Rt(e,r.parseComponentValue());case"length":var a=r.parseComponentValue();return Ze(a)?a:tt;case"length-percentage":var s=r.parseComponentValue();return $e(s)?s:tt;case"time":return en.parse(e,r.parseComponentValue())}}},Qn=function(e,t){var A=function(e){switch(e.getAttribute("data-html2canvas-debug")){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}}(e);return 1===A||t===A},Fn=function(e,t){this.context=e,this.textNodes=[],this.elements=[],this.flags=0,Qn(t,3),this.styles=new yn(e,window.getComputedStyle(t,null)),Io(t)&&(this.styles.animationDuration.some(function(e){return e>0})&&(t.style.animationDuration="0s"),null!==this.styles.transform&&(t.style.transform="none")),this.bounds=a(this.context,t),Qn(t,4)&&(this.flags|=16)},Un="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Sn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),kn=0;kn<64;kn++)Sn[Un.charCodeAt(kn)]=kn;for(var En=function(e,t,A){return e.slice?e.slice(t,A):new Uint16Array(Array.prototype.slice.call(e,t,A))},In=function(){function e(e,t,A,n,o,r){this.initialValue=e,this.errorValue=t,this.highStart=A,this.highValueIndex=n,this.index=o,this.data=r}return e.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>5])<<2)+(31&e),this.data[t];if(e<=65535)return t=((t=this.index[2048+(e-55296>>5)])<<2)+(31&e),this.data[t];if(e<this.highStart)return t=2080+(e>>11),t=this.index[t],t+=e>>5&63,t=((t=this.index[t])<<2)+(31&e),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),Tn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Hn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Dn=0;Dn<64;Dn++)Hn[Tn.charCodeAt(Dn)]=Dn;var Pn,On=8,Kn=9,Mn=11,Ln=12,Rn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var A=e.length;if(!A)return"";for(var n=[],o=-1,r="";++o<A;){var i=e[o];i<=65535?n.push(i):(i-=65536,n.push(55296+(i>>10),i%1024+56320)),(o+1===A||n.length>16384)&&(r+=String.fromCharCode.apply(String,n),n.length=0)}return r},_n=function(e){var t,A,n,o=function(e){var t,A,n,o,r,i=.75*e.length,a=e.length,s=0;"="===e[e.length-1]&&(i--,"="===e[e.length-2]&&i--);var c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(i):new Array(i),l=Array.isArray(c)?c:new Uint8Array(c);for(t=0;t<a;t+=4)A=Sn[e.charCodeAt(t)],n=Sn[e.charCodeAt(t+1)],o=Sn[e.charCodeAt(t+2)],r=Sn[e.charCodeAt(t+3)],l[s++]=A<<2|n>>4,l[s++]=(15&n)<<4|o>>2,l[s++]=(3&o)<<6|63&r;return c}(e),r=Array.isArray(o)?function(e){for(var t=e.length,A=[],n=0;n<t;n+=4)A.push(e[n+3]<<24|e[n+2]<<16|e[n+1]<<8|e[n]);return A}(o):new Uint32Array(o),i=Array.isArray(o)?function(e){for(var t=e.length,A=[],n=0;n<t;n+=2)A.push(e[n+1]<<8|e[n]);return A}(o):new Uint16Array(o),a=En(i,12,r[4]/2),s=2===r[5]?En(i,(24+r[4])/2):(t=r,A=Math.ceil((24+r[4])/4),t.slice?t.slice(A,n):new Uint32Array(Array.prototype.slice.call(t,A,n)));return new In(r[0],r[1],r[2],r[3],a,s)}("AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA="),Vn="×",jn=function(e){return _n.get(e)},Nn=function(e,t,A){var n=A-2,o=t[n],r=t[A-1],i=t[A];if(2===r&&3===i)return Vn;if(2===r||3===r||4===r)return"÷";if(2===i||3===i||4===i)return"÷";if(r===On&&-1!==[On,Kn,Mn,Ln].indexOf(i))return Vn;if(!(r!==Mn&&r!==Kn||i!==Kn&&10!==i))return Vn;if((r===Ln||10===r)&&10===i)return Vn;if(13===i||5===i)return Vn;if(7===i)return Vn;if(1===r)return Vn;if(13===r&&14===i){for(;5===o;)o=t[--n];if(14===o)return Vn}if(15===r&&15===i){for(var a=0;15===o;)a++,o=t[--n];if(a%2==0)return Vn}return"÷"},Gn=function(e){var t=function(e){for(var t=[],A=0,n=e.length;A<n;){var o=e.charCodeAt(A++);if(o>=55296&&o<=56319&&A<n){var r=e.charCodeAt(A++);56320==(64512&r)?t.push(((1023&o)<<10)+(1023&r)+65536):(t.push(o),A--)}else t.push(o)}return t}(e),A=t.length,n=0,o=0,r=t.map(jn);return{next:function(){if(n>=A)return{done:!0,value:null};for(var e=Vn;n<A&&(e=Nn(0,r,++n))===Vn;);if(e!==Vn||n===A){var i=Rn.apply(null,t.slice(o,n));return o=n,{value:i,done:!1}}return{done:!0,value:null}}}},Wn=function(e){return 0===e[0]&&255===e[1]&&0===e[2]&&255===e[3]},zn=function(e,t,A,n,o){var r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),a=document.createElementNS(r,"foreignObject");return i.setAttributeNS(null,"width",e.toString()),i.setAttributeNS(null,"height",t.toString()),a.setAttributeNS(null,"width","100%"),a.setAttributeNS(null,"height","100%"),a.setAttributeNS(null,"x",A.toString()),a.setAttributeNS(null,"y",n.toString()),a.setAttributeNS(null,"externalResourcesRequired","true"),i.appendChild(a),a.appendChild(o),i},Xn=function(e){return new Promise(function(t,A){var n=new Image;n.onload=function(){return t(n)},n.onerror=A,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))})},Jn={get SUPPORT_RANGE_BOUNDS(){var e=function(e){if(e.createRange){var t=e.createRange();if(t.getBoundingClientRect){var A=e.createElement("boundtest");A.style.height="123px",A.style.display="block",e.body.appendChild(A),t.selectNode(A);var n=t.getBoundingClientRect(),o=Math.round(n.height);if(e.body.removeChild(A),123===o)return!0}}return!1}(document);return Object.defineProperty(Jn,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_WORD_BREAKING(){var e=Jn.SUPPORT_RANGE_BOUNDS&&function(e){var t=e.createElement("boundtest");t.style.width="50px",t.style.display="block",t.style.fontSize="12px",t.style.letterSpacing="0px",t.style.wordSpacing="0px",e.body.appendChild(t);var A=e.createRange();t.innerHTML="function"==typeof"".repeat?"👨".repeat(10):"";var n=t.firstChild,o=s(n.data).map(function(e){return c(e)}),r=0,i={},a=o.every(function(e,t){A.setStart(n,r),A.setEnd(n,r+e.length);var o=A.getBoundingClientRect();r+=e.length;var a=o.x>i.x||o.y>i.y;return i=o,0===t||a});return e.body.removeChild(t),a}(document);return Object.defineProperty(Jn,"SUPPORT_WORD_BREAKING",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=function(e){var t=new Image,A=e.createElement("canvas"),n=A.getContext("2d");if(!n)return!1;t.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{n.drawImage(t,0,0),A.toDataURL()}catch(e){return!1}return!0}(document);return Object.defineProperty(Jn,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e="function"==typeof Array.from&&"function"==typeof window.fetch?function(e){var t=e.createElement("canvas"),A=100;t.width=A,t.height=A;var n=t.getContext("2d");if(!n)return Promise.reject(!1);n.fillStyle="rgb(0, 255, 0)",n.fillRect(0,0,A,A);var o=new Image,r=t.toDataURL();o.src=r;var i=zn(A,A,0,0,o);return n.fillStyle="red",n.fillRect(0,0,A,A),Xn(i).then(function(t){n.drawImage(t,0,0);var o=n.getImageData(0,0,A,A).data;n.fillStyle="red",n.fillRect(0,0,A,A);var i=e.createElement("div");return i.style.backgroundImage="url("+r+")",i.style.height=A+"px",Wn(o)?Xn(zn(A,A,0,0,i)):Promise.reject(!1)}).then(function(e){return n.drawImage(e,0,0),Wn(n.getImageData(0,0,A,A).data)}).catch(function(){return!1})}(document):Promise.resolve(!1);return Object.defineProperty(Jn,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=void 0!==(new Image).crossOrigin;return Object.defineProperty(Jn,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(Jn,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Jn,"SUPPORT_CORS_XHR",{value:e}),e},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var e=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(Jn,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:e}),e}},Yn=function(e,t){this.text=e,this.bounds=t},qn=function(e,t){var A=t.ownerDocument;if(A){var n=A.createElement("html2canvaswrapper");n.appendChild(t.cloneNode(!0));var o=t.parentNode;if(o){o.replaceChild(n,t);var r=a(e,n);return n.firstChild&&o.replaceChild(n.firstChild,n),r}}return i.EMPTY},Zn=function(e,t,A){var n=e.ownerDocument;if(!n)throw new Error("Node has no owner document");var o=n.createRange();return o.setStart(e,t),o.setEnd(e,t+A),o},$n=function(e){if(Jn.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(t.segment(e)).map(function(e){return e.segment})}return function(e){for(var t,A=Gn(e),n=[];!(t=A.next()).done;)t.value&&n.push(t.value.slice());return n}(e)},eo=function(e,t){return 0!==t.letterSpacing?$n(e):function(e,t){if(Jn.SUPPORT_NATIVE_TEXT_SEGMENTATION){var A=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(A.segment(e)).map(function(e){return e.segment})}return Ao(e,t)}(e,t)},to=[32,160,4961,65792,65793,4153,4241],Ao=function(e,t){for(var A,n=function(e,t){var A=s(e),n=re(A,t),o=n[0],r=n[1],i=n[2],a=A.length,c=0,l=0;return{next:function(){if(l>=a)return{done:!0,value:null};for(var e=W;l<a&&(e=oe(A,r,o,++l,i))===W;);if(e!==W||l===a){var t=new ie(A,e,c,l);return c=l,{value:t,done:!1}}return{done:!0,value:null}}}}(e,{lineBreak:t.lineBreak,wordBreak:"break-word"===t.overflowWrap?"break-word":t.wordBreak}),o=[],r=function(){if(A.value){var e=A.value.slice(),t=s(e),n="";t.forEach(function(e){-1===to.indexOf(e)?n+=c(e):(n.length&&o.push(n),o.push(c(e)),n="")}),n.length&&o.push(n)}};!(A=n.next()).done;)r();return o},no=function(e,t,A){this.text=oo(t.data,A.textTransform),this.textBounds=function(e,t,A,n){var o=eo(t,A),r=[],a=0;return o.forEach(function(t){if(A.textDecorationLine.length||t.trim().length>0)if(Jn.SUPPORT_RANGE_BOUNDS){var o=Zn(n,a,t.length).getClientRects();if(o.length>1){var s=$n(t),c=0;s.forEach(function(t){r.push(new Yn(t,i.fromDOMRectList(e,Zn(n,c+a,t.length).getClientRects()))),c+=t.length})}else r.push(new Yn(t,i.fromDOMRectList(e,o)))}else{var l=n.splitText(t.length);r.push(new Yn(t,qn(e,n))),n=l}else Jn.SUPPORT_RANGE_BOUNDS||(n=n.splitText(t.length));a+=t.length}),r}(e,this.text,A,t)},oo=function(e,t){switch(t){case 1:return e.toLowerCase();case 3:return e.replace(ro,io);case 2:return e.toUpperCase();default:return e}},ro=/(^|\s|:|-|\(|\))([a-z])/g,io=function(e,t,A){return e.length>0?t+A.toUpperCase():e},ao=function(e){function A(t,A){var n=e.call(this,t,A)||this;return n.src=A.currentSrc||A.src,n.intrinsicWidth=A.naturalWidth,n.intrinsicHeight=A.naturalHeight,n.context.cache.addImage(n.src),n}return t(A,e),A}(Fn),so=function(e){function A(t,A){var n=e.call(this,t,A)||this;return n.canvas=A,n.intrinsicWidth=A.width,n.intrinsicHeight=A.height,n}return t(A,e),A}(Fn),co=function(e){function A(t,A){var n=e.call(this,t,A)||this,o=new XMLSerializer,r=a(t,A);return A.setAttribute("width",r.width+"px"),A.setAttribute("height",r.height+"px"),n.svg="data:image/svg+xml,"+encodeURIComponent(o.serializeToString(A)),n.intrinsicWidth=A.width.baseVal.value,n.intrinsicHeight=A.height.baseVal.value,n.context.cache.addImage(n.svg),n}return t(A,e),A}(Fn),lo=function(e){function A(t,A){var n=e.call(this,t,A)||this;return n.value=A.value,n}return t(A,e),A}(Fn),uo=function(e){function A(t,A){var n=e.call(this,t,A)||this;return n.start=A.start,n.reversed="boolean"==typeof A.reversed&&!0===A.reversed,n}return t(A,e),A}(Fn),po=[{type:15,flags:0,unit:"px",number:3}],ho=[{type:16,flags:0,number:50}],go="checkbox",fo="radio",mo="password",vo=707406591,Bo=function(e){function A(t,A){var n,o,r,a=e.call(this,t,A)||this;switch(a.type=A.type.toLowerCase(),a.checked=A.checked,a.value=0===(r=(o=A).type===mo?new Array(o.value.length+1).join("•"):o.value).length?o.placeholder||"":r,a.type!==go&&a.type!==fo||(a.styles.backgroundColor=3739148031,a.styles.borderTopColor=a.styles.borderRightColor=a.styles.borderBottomColor=a.styles.borderLeftColor=2779096575,a.styles.borderTopWidth=a.styles.borderRightWidth=a.styles.borderBottomWidth=a.styles.borderLeftWidth=1,a.styles.borderTopStyle=a.styles.borderRightStyle=a.styles.borderBottomStyle=a.styles.borderLeftStyle=1,a.styles.backgroundClip=[0],a.styles.backgroundOrigin=[0],a.bounds=(n=a.bounds).width>n.height?new i(n.left+(n.width-n.height)/2,n.top,n.height,n.height):n.width<n.height?new i(n.left,n.top+(n.height-n.width)/2,n.width,n.width):n),a.type){case go:a.styles.borderTopRightRadius=a.styles.borderTopLeftRadius=a.styles.borderBottomRightRadius=a.styles.borderBottomLeftRadius=po;break;case fo:a.styles.borderTopRightRadius=a.styles.borderTopLeftRadius=a.styles.borderBottomRightRadius=a.styles.borderBottomLeftRadius=ho}return a}return t(A,e),A}(Fn),wo=function(e){function A(t,A){var n=e.call(this,t,A)||this,o=A.options[A.selectedIndex||0];return n.value=o&&o.text||"",n}return t(A,e),A}(Fn),yo=function(e){function A(t,A){var n=e.call(this,t,A)||this;return n.value=A.value,n}return t(A,e),A}(Fn),bo=function(e){function A(t,A){var n=e.call(this,t,A)||this;n.src=A.src,n.width=parseInt(A.width,10)||0,n.height=parseInt(A.height,10)||0,n.backgroundColor=n.styles.backgroundColor;try{if(A.contentWindow&&A.contentWindow.document&&A.contentWindow.document.documentElement){n.tree=Fo(t,A.contentWindow.document.documentElement);var o=A.contentWindow.document.documentElement?yt(t,getComputedStyle(A.contentWindow.document.documentElement).backgroundColor):bt.TRANSPARENT,r=A.contentWindow.document.body?yt(t,getComputedStyle(A.contentWindow.document.body).backgroundColor):bt.TRANSPARENT;n.backgroundColor=pt(o)?pt(r)?n.styles.backgroundColor:r:o}}catch(e){}return n}return t(A,e),A}(Fn),Co=["OL","UL","MENU"],xo=function(e,t,A,n){for(var o=t.firstChild,r=void 0;o;o=r)if(r=o.nextSibling,ko(o)&&o.data.trim().length>0)A.textNodes.push(new no(e,o,A.styles));else if(Eo(o))if(Go(o)&&o.assignedNodes)o.assignedNodes().forEach(function(t){return xo(e,t,A,n)});else{var i=Qo(e,o);i.styles.isVisible()&&(Uo(o,i,n)?i.flags|=4:So(i.styles)&&(i.flags|=2),-1!==Co.indexOf(o.tagName)&&(i.flags|=8),A.elements.push(i),o.slot,o.shadowRoot?xo(e,o.shadowRoot,i,n):jo(o)||Oo(o)||No(o)||xo(e,o,i,n))}},Qo=function(e,t){return Ro(t)?new ao(e,t):Mo(t)?new so(e,t):Oo(t)?new co(e,t):Ho(t)?new lo(e,t):Do(t)?new uo(e,t):Po(t)?new Bo(e,t):No(t)?new wo(e,t):jo(t)?new yo(e,t):_o(t)?new bo(e,t):new Fn(e,t)},Fo=function(e,t){var A=Qo(e,t);return A.flags|=4,xo(e,t,A,A),A},Uo=function(e,t,A){return t.styles.isPositionedWithZIndex()||t.styles.opacity<1||t.styles.isTransformed()||Ko(e)&&A.styles.isTransparent()},So=function(e){return e.isPositioned()||e.isFloating()},ko=function(e){return e.nodeType===Node.TEXT_NODE},Eo=function(e){return e.nodeType===Node.ELEMENT_NODE},Io=function(e){return Eo(e)&&void 0!==e.style&&!To(e)},To=function(e){return"object"==typeof e.className},Ho=function(e){return"LI"===e.tagName},Do=function(e){return"OL"===e.tagName},Po=function(e){return"INPUT"===e.tagName},Oo=function(e){return"svg"===e.tagName},Ko=function(e){return"BODY"===e.tagName},Mo=function(e){return"CANVAS"===e.tagName},Lo=function(e){return"VIDEO"===e.tagName},Ro=function(e){return"IMG"===e.tagName},_o=function(e){return"IFRAME"===e.tagName},Vo=function(e){return"STYLE"===e.tagName},jo=function(e){return"TEXTAREA"===e.tagName},No=function(e){return"SELECT"===e.tagName},Go=function(e){return"SLOT"===e.tagName},Wo=function(e){return e.tagName.indexOf("-")>0},zo=function(){function e(){this.counters={}}return e.prototype.getCounterValue=function(e){var t=this.counters[e];return t&&t.length?t[t.length-1]:1},e.prototype.getCounterValues=function(e){return this.counters[e]||[]},e.prototype.pop=function(e){var t=this;e.forEach(function(e){return t.counters[e].pop()})},e.prototype.parse=function(e){var t=this,A=e.counterIncrement,n=e.counterReset,o=!0;null!==A&&A.forEach(function(e){var A=t.counters[e.counter];A&&0!==e.increment&&(o=!1,A.length||A.push(1),A[Math.max(0,A.length-1)]+=e.increment)});var r=[];return o&&n.forEach(function(e){var A=t.counters[e.counter];r.push(e.counter),A||(A=t.counters[e.counter]=[]),A.push(e.reset)}),r},e}(),Xo={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},Jo={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},Yo={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},qo={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},Zo=function(e,t,A,n,o,r){return e<t||e>A?ar(e,o,r.length>0):n.integers.reduce(function(t,A,o){for(;e>=A;)e-=A,t+=n.values[o];return t},"")+r},$o=function(e,t,A,n){var o="";do{A||e--,o=n(e)+o,e/=t}while(e*t>=t);return o},er=function(e,t,A,n,o){var r=A-t+1;return(e<0?"-":"")+($o(Math.abs(e),r,n,function(e){return c(Math.floor(e%r)+t)})+o)},tr=function(e,t,A){void 0===A&&(A=". ");var n=t.length;return $o(Math.abs(e),n,!1,function(e){return t[Math.floor(e%n)]})+A},Ar=function(e,t,A,n,o,r){if(e<-9999||e>9999)return ar(e,4,o.length>0);var i=Math.abs(e),a=o;if(0===i)return t[0]+a;for(var s=0;i>0&&s<=4;s++){var c=i%10;0===c&&ln(r,1)&&""!==a?a=t[c]+a:c>1||1===c&&0===s||1===c&&1===s&&ln(r,2)||1===c&&1===s&&ln(r,4)&&e>100||1===c&&s>1&&ln(r,8)?a=t[c]+(s>0?A[s-1]:"")+a:1===c&&s>0&&(a=A[s-1]+a),i=Math.floor(i/10)}return(e<0?n:"")+a},nr="十百千萬",or="拾佰仟萬",rr="マイナス",ir="마이너스",ar=function(e,t,A){var n=A?". ":"",o=A?"、":"",r=A?", ":"",i=A?" ":"";switch(t){case 0:return"•"+i;case 1:return"◦"+i;case 2:return"◾"+i;case 5:var a=er(e,48,57,!0,n);return a.length<4?"0"+a:a;case 4:return tr(e,"〇一二三四五六七八九",o);case 6:return Zo(e,1,3999,Xo,3,n).toLowerCase();case 7:return Zo(e,1,3999,Xo,3,n);case 8:return er(e,945,969,!1,n);case 9:return er(e,97,122,!1,n);case 10:return er(e,65,90,!1,n);case 11:return er(e,1632,1641,!0,n);case 12:case 49:return Zo(e,1,9999,Jo,3,n);case 35:return Zo(e,1,9999,Jo,3,n).toLowerCase();case 13:return er(e,2534,2543,!0,n);case 14:case 30:return er(e,6112,6121,!0,n);case 15:return tr(e,"子丑寅卯辰巳午未申酉戌亥",o);case 16:return tr(e,"甲乙丙丁戊己庚辛壬癸",o);case 17:case 48:return Ar(e,"零一二三四五六七八九",nr,"負",o,14);case 47:return Ar(e,"零壹貳參肆伍陸柒捌玖",or,"負",o,15);case 42:return Ar(e,"零一二三四五六七八九",nr,"负",o,14);case 41:return Ar(e,"零壹贰叁肆伍陆柒捌玖",or,"负",o,15);case 26:return Ar(e,"〇一二三四五六七八九","十百千万",rr,o,0);case 25:return Ar(e,"零壱弐参四伍六七八九","拾百千万",rr,o,7);case 31:return Ar(e,"영일이삼사오육칠팔구","십백천만",ir,r,7);case 33:return Ar(e,"零一二三四五六七八九","十百千萬",ir,r,0);case 32:return Ar(e,"零壹貳參四五六七八九","拾百千",ir,r,7);case 18:return er(e,2406,2415,!0,n);case 20:return Zo(e,1,19999,qo,3,n);case 21:return er(e,2790,2799,!0,n);case 22:return er(e,2662,2671,!0,n);case 22:return Zo(e,1,10999,Yo,3,n);case 23:return tr(e,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return tr(e,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return er(e,3302,3311,!0,n);case 28:return tr(e,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",o);case 29:return tr(e,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",o);case 34:return er(e,3792,3801,!0,n);case 37:return er(e,6160,6169,!0,n);case 38:return er(e,4160,4169,!0,n);case 39:return er(e,2918,2927,!0,n);case 40:return er(e,1776,1785,!0,n);case 43:return er(e,3046,3055,!0,n);case 44:return er(e,3174,3183,!0,n);case 45:return er(e,3664,3673,!0,n);case 46:return er(e,3872,3881,!0,n);default:return er(e,48,57,!0,n)}},sr="data-html2canvas-ignore",cr=function(){function e(e,t,A){if(this.context=e,this.options=A,this.scrolledElements=[],this.referenceElement=t,this.counters=new zo,this.quoteDepth=0,!t.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(t.ownerDocument.documentElement,!1)}return e.prototype.toIFrame=function(e,t){var A=this,r=ur(e,t);if(!r.contentWindow)return Promise.reject("Unable to find iframe window");var i=e.defaultView.pageXOffset,a=e.defaultView.pageYOffset,s=r.contentWindow,c=s.document,l=hr(r).then(function(){return n(A,void 0,void 0,function(){var e,A;return o(this,function(n){switch(n.label){case 0:return this.scrolledElements.forEach(Br),s&&(s.scrollTo(t.left,t.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||s.scrollY===t.top&&s.scrollX===t.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(s.scrollX-t.left,s.scrollY-t.top,0,0))),e=this.options.onclone,void 0===(A=this.clonedReferenceElement)?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:c.fonts&&c.fonts.ready?[4,c.fonts.ready]:[3,2];case 1:n.sent(),n.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,pr(c)]:[3,4];case 3:n.sent(),n.label=4;case 4:return"function"==typeof e?[2,Promise.resolve().then(function(){return e(c,A)}).then(function(){return r})]:[2,r]}})})});return c.open(),c.write(mr(document.doctype)+"<html></html>"),vr(this.referenceElement.ownerDocument,i,a),c.replaceChild(c.adoptNode(this.documentElement),c.documentElement),c.close(),l},e.prototype.createElementClone=function(e){if(Qn(e,2),Mo(e))return this.createCanvasClone(e);if(Lo(e))return this.createVideoClone(e);if(Vo(e))return this.createStyleClone(e);var t=e.cloneNode(!1);return Ro(t)&&(Ro(e)&&e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),"lazy"===t.loading&&(t.loading="eager")),Wo(t)?this.createCustomElementClone(t):t},e.prototype.createCustomElementClone=function(e){var t=document.createElement("html2canvascustomelement");return fr(e.style,t),t},e.prototype.createStyleClone=function(e){try{var t=e.sheet;if(t&&t.cssRules){var A=[].slice.call(t.cssRules,0).reduce(function(e,t){return t&&"string"==typeof t.cssText?e+t.cssText:e},""),n=e.cloneNode(!1);return n.textContent=A,n}}catch(e){if(this.context.logger.error("Unable to access cssRules property",e),"SecurityError"!==e.name)throw e}return e.cloneNode(!1)},e.prototype.createCanvasClone=function(e){var t;if(this.options.inlineImages&&e.ownerDocument){var A=e.ownerDocument.createElement("img");try{return A.src=e.toDataURL(),A}catch(t){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",e)}}var n=e.cloneNode(!1);try{n.width=e.width,n.height=e.height;var o=e.getContext("2d"),r=n.getContext("2d");if(r)if(!this.options.allowTaint&&o)r.putImageData(o.getImageData(0,0,e.width,e.height),0,0);else{var i=null!==(t=e.getContext("webgl2"))&&void 0!==t?t:e.getContext("webgl");if(i){var a=i.getContextAttributes();!1===(null==a?void 0:a.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",e)}r.drawImage(e,0,0)}return n}catch(t){this.context.logger.info("Unable to clone canvas as it is tainted",e)}return n},e.prototype.createVideoClone=function(e){var t=e.ownerDocument.createElement("canvas");t.width=e.offsetWidth,t.height=e.offsetHeight;var A=t.getContext("2d");try{return A&&(A.drawImage(e,0,0,t.width,t.height),this.options.allowTaint||A.getImageData(0,0,t.width,t.height)),t}catch(t){this.context.logger.info("Unable to clone video as it is tainted",e)}var n=e.ownerDocument.createElement("canvas");return n.width=e.offsetWidth,n.height=e.offsetHeight,n},e.prototype.appendChildNode=function(e,t,A){Eo(t)&&("SCRIPT"===t.tagName||t.hasAttribute(sr)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(t))||this.options.copyStyles&&Eo(t)&&Vo(t)||e.appendChild(this.cloneNode(t,A))},e.prototype.cloneChildNodes=function(e,t,A){for(var n=this,o=e.shadowRoot?e.shadowRoot.firstChild:e.firstChild;o;o=o.nextSibling)if(Eo(o)&&Go(o)&&"function"==typeof o.assignedNodes){var r=o.assignedNodes();r.length&&r.forEach(function(e){return n.appendChildNode(t,e,A)})}else this.appendChildNode(t,o,A)},e.prototype.cloneNode=function(e,t){if(ko(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var A=e.ownerDocument.defaultView;if(A&&Eo(e)&&(Io(e)||To(e))){var n=this.createElementClone(e);n.style.transitionProperty="none";var o=A.getComputedStyle(e),r=A.getComputedStyle(e,":before"),i=A.getComputedStyle(e,":after");this.referenceElement===e&&Io(n)&&(this.clonedReferenceElement=n),Ko(n)&&Cr(n);var a=this.counters.parse(new Cn(this.context,o)),s=this.resolvePseudoContent(e,n,r,Pn.BEFORE);Wo(e)&&(t=!0),Lo(e)||this.cloneChildNodes(e,n,t),s&&n.insertBefore(s,n.firstChild);var c=this.resolvePseudoContent(e,n,i,Pn.AFTER);return c&&n.appendChild(c),this.counters.pop(a),(o&&(this.options.copyStyles||To(e))&&!_o(e)||t)&&fr(o,n),0===e.scrollTop&&0===e.scrollLeft||this.scrolledElements.push([n,e.scrollLeft,e.scrollTop]),(jo(e)||No(e))&&(jo(n)||No(n))&&(n.value=e.value),n}return e.cloneNode(!1)},e.prototype.resolvePseudoContent=function(e,t,A,n){var o=this;if(A){var r=A.content,i=t.ownerDocument;if(i&&r&&"none"!==r&&"-moz-alt-content"!==r&&"none"!==A.display){this.counters.parse(new Cn(this.context,A));var a=new bn(this.context,A),s=i.createElement("html2canvaspseudoelement");fr(A,s),a.content.forEach(function(t){if(0===t.type)s.appendChild(i.createTextNode(t.value));else if(22===t.type){var A=i.createElement("img");A.src=t.value,A.style.opacity="1",s.appendChild(A)}else if(18===t.type){if("attr"===t.name){var n=t.values.filter(Ge);n.length&&s.appendChild(i.createTextNode(e.getAttribute(n[0].value)||""))}else if("counter"===t.name){var r=t.values.filter(Je),c=r[0],l=r[1];if(c&&Ge(c)){var u=o.counters.getCounterValue(c.value),d=l&&Ge(l)?kA.parse(o.context,l.value):3;s.appendChild(i.createTextNode(ar(u,d,!1)))}}else if("counters"===t.name){var p=t.values.filter(Je),h=(c=p[0],p[1]);if(l=p[2],c&&Ge(c)){var g=o.counters.getCounterValues(c.value),f=l&&Ge(l)?kA.parse(o.context,l.value):3,m=h&&0===h.type?h.value:"",v=g.map(function(e){return ar(e,f,!1)}).join(m);s.appendChild(i.createTextNode(v))}}}else if(20===t.type)switch(t.value){case"open-quote":s.appendChild(i.createTextNode(fn(a.quotes,o.quoteDepth++,!0)));break;case"close-quote":s.appendChild(i.createTextNode(fn(a.quotes,--o.quoteDepth,!1)));break;default:s.appendChild(i.createTextNode(t.value))}}),s.className=wr+" "+yr;var c=n===Pn.BEFORE?" "+wr:" "+yr;return To(t)?t.className.baseValue+=c:t.className+=c,s}}},e.destroy=function(e){return!!e.parentNode&&(e.parentNode.removeChild(e),!0)},e}();!function(e){e[e.BEFORE=0]="BEFORE",e[e.AFTER=1]="AFTER"}(Pn||(Pn={}));var lr,ur=function(e,t){var A=e.createElement("iframe");return A.className="html2canvas-container",A.style.visibility="hidden",A.style.position="fixed",A.style.left="-10000px",A.style.top="0px",A.style.border="0",A.width=t.width.toString(),A.height=t.height.toString(),A.scrolling="no",A.setAttribute(sr,"true"),e.body.appendChild(A),A},dr=function(e){return new Promise(function(t){e.complete?t():e.src?(e.onload=t,e.onerror=t):t()})},pr=function(e){return Promise.all([].slice.call(e.images,0).map(dr))},hr=function(e){return new Promise(function(t,A){var n=e.contentWindow;if(!n)return A("No window assigned for iframe");var o=n.document;n.onload=e.onload=function(){n.onload=e.onload=null;var A=setInterval(function(){o.body.childNodes.length>0&&"complete"===o.readyState&&(clearInterval(A),t(e))},50)}})},gr=["all","d","content"],fr=function(e,t){for(var A=e.length-1;A>=0;A--){var n=e.item(A);-1===gr.indexOf(n)&&t.style.setProperty(n,e.getPropertyValue(n))}return t},mr=function(e){var t="";return e&&(t+="<!DOCTYPE ",e.name&&(t+=e.name),e.internalSubset&&(t+=e.internalSubset),e.publicId&&(t+='"'+e.publicId+'"'),e.systemId&&(t+='"'+e.systemId+'"'),t+=">"),t},vr=function(e,t,A){e&&e.defaultView&&(t!==e.defaultView.pageXOffset||A!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(t,A)},Br=function(e){var t=e[0],A=e[1],n=e[2];t.scrollLeft=A,t.scrollTop=n},wr="___html2canvas___pseudoelement_before",yr="___html2canvas___pseudoelement_after",br='{\n content: "" !important;\n display: none !important;\n}',Cr=function(e){xr(e,"."+wr+":before"+br+"\n ."+yr+":after"+br)},xr=function(e,t){var A=e.ownerDocument;if(A){var n=A.createElement("style");n.textContent=t,e.appendChild(n)}},Qr=function(){function e(){}return e.getOrigin=function(t){var A=e._link;return A?(A.href=t,A.href=A.href,A.protocol+A.hostname+A.port):"about:blank"},e.isSameOrigin=function(t){return e.getOrigin(t)===e._origin},e.setContext=function(t){e._link=t.document.createElement("a"),e._origin=e.getOrigin(t.location.href)},e._origin="about:blank",e}(),Fr=function(){function e(e,t){this.context=e,this._options=t,this._cache={}}return e.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)?t:Hr(e)||Er(e)?((this._cache[e]=this.loadImage(e)).catch(function(){}),t):t},e.prototype.match=function(e){return this._cache[e]},e.prototype.loadImage=function(e){return n(this,void 0,void 0,function(){var t,A,n,r,i=this;return o(this,function(o){switch(o.label){case 0:return t=Qr.isSameOrigin(e),A=!Ir(e)&&!0===this._options.useCORS&&Jn.SUPPORT_CORS_IMAGES&&!t,n=!Ir(e)&&!t&&!Hr(e)&&"string"==typeof this._options.proxy&&Jn.SUPPORT_CORS_XHR&&!A,t||!1!==this._options.allowTaint||Ir(e)||Hr(e)||n||A?(r=e,n?[4,this.proxy(r)]:[3,2]):[2];case 1:r=o.sent(),o.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(e,t){var n=new Image;n.onload=function(){return e(n)},n.onerror=t,(Tr(r)||A)&&(n.crossOrigin="anonymous"),n.src=r,!0===n.complete&&setTimeout(function(){return e(n)},500),i._options.imageTimeout>0&&setTimeout(function(){return t("Timed out ("+i._options.imageTimeout+"ms) loading image")},i._options.imageTimeout)})];case 3:return[2,o.sent()]}})})},e.prototype.has=function(e){return void 0!==this._cache[e]},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(e){var t=this,A=this._options.proxy;if(!A)throw new Error("No proxy defined");var n=e.substring(0,256);return new Promise(function(o,r){var i=Jn.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(200===a.status)if("text"===i)o(a.response);else{var e=new FileReader;e.addEventListener("load",function(){return o(e.result)},!1),e.addEventListener("error",function(e){return r(e)},!1),e.readAsDataURL(a.response)}else r("Failed to proxy resource "+n+" with status code "+a.status)},a.onerror=r;var s=A.indexOf("?")>-1?"&":"?";if(a.open("GET",""+A+s+"url="+encodeURIComponent(e)+"&responseType="+i),"text"!==i&&a instanceof XMLHttpRequest&&(a.responseType=i),t._options.imageTimeout){var c=t._options.imageTimeout;a.timeout=c,a.ontimeout=function(){return r("Timed out ("+c+"ms) proxying "+n)}}a.send()})},e}(),Ur=/^data:image\/svg\+xml/i,Sr=/^data:image\/.*;base64,/i,kr=/^data:image\/.*/i,Er=function(e){return Jn.SUPPORT_SVG_DRAWING||!Dr(e)},Ir=function(e){return kr.test(e)},Tr=function(e){return Sr.test(e)},Hr=function(e){return"blob"===e.substr(0,4)},Dr=function(e){return"svg"===e.substr(-3).toLowerCase()||Ur.test(e)},Pr=function(){function e(e,t){this.type=0,this.x=e,this.y=t}return e.prototype.add=function(t,A){return new e(this.x+t,this.y+A)},e}(),Or=function(e,t,A){return new Pr(e.x+(t.x-e.x)*A,e.y+(t.y-e.y)*A)},Kr=function(){function e(e,t,A,n){this.type=1,this.start=e,this.startControl=t,this.endControl=A,this.end=n}return e.prototype.subdivide=function(t,A){var n=Or(this.start,this.startControl,t),o=Or(this.startControl,this.endControl,t),r=Or(this.endControl,this.end,t),i=Or(n,o,t),a=Or(o,r,t),s=Or(i,a,t);return A?new e(this.start,n,i,s):new e(s,a,r,this.end)},e.prototype.add=function(t,A){return new e(this.start.add(t,A),this.startControl.add(t,A),this.endControl.add(t,A),this.end.add(t,A))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),Mr=function(e){return 1===e.type},Lr=function(e){var t=e.styles,A=e.bounds,n=ot(t.borderTopLeftRadius,A.width,A.height),o=n[0],r=n[1],i=ot(t.borderTopRightRadius,A.width,A.height),a=i[0],s=i[1],c=ot(t.borderBottomRightRadius,A.width,A.height),l=c[0],u=c[1],d=ot(t.borderBottomLeftRadius,A.width,A.height),p=d[0],h=d[1],g=[];g.push((o+a)/A.width),g.push((p+l)/A.width),g.push((r+h)/A.height),g.push((s+u)/A.height);var f=Math.max.apply(Math,g);f>1&&(o/=f,r/=f,a/=f,s/=f,l/=f,u/=f,p/=f,h/=f);var m=A.width-a,v=A.height-u,B=A.width-l,w=A.height-h,y=t.borderTopWidth,b=t.borderRightWidth,C=t.borderBottomWidth,x=t.borderLeftWidth,Q=rt(t.paddingTop,e.bounds.width),F=rt(t.paddingRight,e.bounds.width),U=rt(t.paddingBottom,e.bounds.width),S=rt(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=o>0||r>0?Rr(A.left+x/3,A.top+y/3,o-x/3,r-y/3,lr.TOP_LEFT):new Pr(A.left+x/3,A.top+y/3),this.topRightBorderDoubleOuterBox=o>0||r>0?Rr(A.left+m,A.top+y/3,a-b/3,s-y/3,lr.TOP_RIGHT):new Pr(A.left+A.width-b/3,A.top+y/3),this.bottomRightBorderDoubleOuterBox=l>0||u>0?Rr(A.left+B,A.top+v,l-b/3,u-C/3,lr.BOTTOM_RIGHT):new Pr(A.left+A.width-b/3,A.top+A.height-C/3),this.bottomLeftBorderDoubleOuterBox=p>0||h>0?Rr(A.left+x/3,A.top+w,p-x/3,h-C/3,lr.BOTTOM_LEFT):new Pr(A.left+x/3,A.top+A.height-C/3),this.topLeftBorderDoubleInnerBox=o>0||r>0?Rr(A.left+2*x/3,A.top+2*y/3,o-2*x/3,r-2*y/3,lr.TOP_LEFT):new Pr(A.left+2*x/3,A.top+2*y/3),this.topRightBorderDoubleInnerBox=o>0||r>0?Rr(A.left+m,A.top+2*y/3,a-2*b/3,s-2*y/3,lr.TOP_RIGHT):new Pr(A.left+A.width-2*b/3,A.top+2*y/3),this.bottomRightBorderDoubleInnerBox=l>0||u>0?Rr(A.left+B,A.top+v,l-2*b/3,u-2*C/3,lr.BOTTOM_RIGHT):new Pr(A.left+A.width-2*b/3,A.top+A.height-2*C/3),this.bottomLeftBorderDoubleInnerBox=p>0||h>0?Rr(A.left+2*x/3,A.top+w,p-2*x/3,h-2*C/3,lr.BOTTOM_LEFT):new Pr(A.left+2*x/3,A.top+A.height-2*C/3),this.topLeftBorderStroke=o>0||r>0?Rr(A.left+x/2,A.top+y/2,o-x/2,r-y/2,lr.TOP_LEFT):new Pr(A.left+x/2,A.top+y/2),this.topRightBorderStroke=o>0||r>0?Rr(A.left+m,A.top+y/2,a-b/2,s-y/2,lr.TOP_RIGHT):new Pr(A.left+A.width-b/2,A.top+y/2),this.bottomRightBorderStroke=l>0||u>0?Rr(A.left+B,A.top+v,l-b/2,u-C/2,lr.BOTTOM_RIGHT):new Pr(A.left+A.width-b/2,A.top+A.height-C/2),this.bottomLeftBorderStroke=p>0||h>0?Rr(A.left+x/2,A.top+w,p-x/2,h-C/2,lr.BOTTOM_LEFT):new Pr(A.left+x/2,A.top+A.height-C/2),this.topLeftBorderBox=o>0||r>0?Rr(A.left,A.top,o,r,lr.TOP_LEFT):new Pr(A.left,A.top),this.topRightBorderBox=a>0||s>0?Rr(A.left+m,A.top,a,s,lr.TOP_RIGHT):new Pr(A.left+A.width,A.top),this.bottomRightBorderBox=l>0||u>0?Rr(A.left+B,A.top+v,l,u,lr.BOTTOM_RIGHT):new Pr(A.left+A.width,A.top+A.height),this.bottomLeftBorderBox=p>0||h>0?Rr(A.left,A.top+w,p,h,lr.BOTTOM_LEFT):new Pr(A.left,A.top+A.height),this.topLeftPaddingBox=o>0||r>0?Rr(A.left+x,A.top+y,Math.max(0,o-x),Math.max(0,r-y),lr.TOP_LEFT):new Pr(A.left+x,A.top+y),this.topRightPaddingBox=a>0||s>0?Rr(A.left+Math.min(m,A.width-b),A.top+y,m>A.width+b?0:Math.max(0,a-b),Math.max(0,s-y),lr.TOP_RIGHT):new Pr(A.left+A.width-b,A.top+y),this.bottomRightPaddingBox=l>0||u>0?Rr(A.left+Math.min(B,A.width-x),A.top+Math.min(v,A.height-C),Math.max(0,l-b),Math.max(0,u-C),lr.BOTTOM_RIGHT):new Pr(A.left+A.width-b,A.top+A.height-C),this.bottomLeftPaddingBox=p>0||h>0?Rr(A.left+x,A.top+Math.min(w,A.height-C),Math.max(0,p-x),Math.max(0,h-C),lr.BOTTOM_LEFT):new Pr(A.left+x,A.top+A.height-C),this.topLeftContentBox=o>0||r>0?Rr(A.left+x+S,A.top+y+Q,Math.max(0,o-(x+S)),Math.max(0,r-(y+Q)),lr.TOP_LEFT):new Pr(A.left+x+S,A.top+y+Q),this.topRightContentBox=a>0||s>0?Rr(A.left+Math.min(m,A.width+x+S),A.top+y+Q,m>A.width+x+S?0:a-x+S,s-(y+Q),lr.TOP_RIGHT):new Pr(A.left+A.width-(b+F),A.top+y+Q),this.bottomRightContentBox=l>0||u>0?Rr(A.left+Math.min(B,A.width-(x+S)),A.top+Math.min(v,A.height+y+Q),Math.max(0,l-(b+F)),u-(C+U),lr.BOTTOM_RIGHT):new Pr(A.left+A.width-(b+F),A.top+A.height-(C+U)),this.bottomLeftContentBox=p>0||h>0?Rr(A.left+x+S,A.top+w,Math.max(0,p-(x+S)),h-(C+U),lr.BOTTOM_LEFT):new Pr(A.left+x+S,A.top+A.height-(C+U))};!function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"}(lr||(lr={}));var Rr=function(e,t,A,n,o){var r=(Math.sqrt(2)-1)/3*4,i=A*r,a=n*r,s=e+A,c=t+n;switch(o){case lr.TOP_LEFT:return new Kr(new Pr(e,c),new Pr(e,c-a),new Pr(s-i,t),new Pr(s,t));case lr.TOP_RIGHT:return new Kr(new Pr(e,t),new Pr(e+i,t),new Pr(s,c-a),new Pr(s,c));case lr.BOTTOM_RIGHT:return new Kr(new Pr(s,t),new Pr(s,t+a),new Pr(e+i,c),new Pr(e,c));case lr.BOTTOM_LEFT:default:return new Kr(new Pr(s,c),new Pr(s-i,c),new Pr(e,t+a),new Pr(e,t))}},_r=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},Vr=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},jr=function(e,t,A){this.offsetX=e,this.offsetY=t,this.matrix=A,this.type=0,this.target=6},Nr=function(e,t){this.path=e,this.target=t,this.type=1},Gr=function(e){this.opacity=e,this.type=2,this.target=6},Wr=function(e){return 1===e.type},zr=function(e,t){return e.length===t.length&&e.some(function(e,A){return e===t[A]})},Xr=function(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},Jr=function(){function e(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new Lr(this.container),this.container.styles.opacity<1&&this.effects.push(new Gr(this.container.styles.opacity)),null!==this.container.styles.transform){var A=this.container.bounds.left+this.container.styles.transformOrigin[0].number,n=this.container.bounds.top+this.container.styles.transformOrigin[1].number,o=this.container.styles.transform;this.effects.push(new jr(A,n,o))}if(0!==this.container.styles.overflowX){var r=_r(this.curves),i=Vr(this.curves);zr(r,i)?this.effects.push(new Nr(r,6)):(this.effects.push(new Nr(r,2)),this.effects.push(new Nr(i,4)))}}return e.prototype.getEffects=function(e){for(var t=-1===[2,3].indexOf(this.container.styles.position),A=this.parent,n=this.effects.slice(0);A;){var o=A.effects.filter(function(e){return!Wr(e)});if(t||0!==A.container.styles.position||!A.parent){if(n.unshift.apply(n,o),t=-1===[2,3].indexOf(A.container.styles.position),0!==A.container.styles.overflowX){var r=_r(A.curves),i=Vr(A.curves);zr(r,i)||n.unshift(new Nr(i,6))}}else n.unshift.apply(n,o);A=A.parent}return n.filter(function(t){return ln(t.target,e)})},e}(),Yr=function(e,t,A,n){e.container.elements.forEach(function(o){var r=ln(o.flags,4),i=ln(o.flags,2),a=new Jr(o,e);ln(o.styles.display,2048)&&n.push(a);var s=ln(o.flags,8)?[]:n;if(r||i){var c=r||o.styles.isPositioned()?A:t,l=new Xr(a);if(o.styles.isPositioned()||o.styles.opacity<1||o.styles.isTransformed()){var u=o.styles.zIndex.order;if(u<0){var d=0;c.negativeZIndex.some(function(e,t){return u>e.element.container.styles.zIndex.order?(d=t,!1):d>0}),c.negativeZIndex.splice(d,0,l)}else if(u>0){var p=0;c.positiveZIndex.some(function(e,t){return u>=e.element.container.styles.zIndex.order?(p=t+1,!1):p>0}),c.positiveZIndex.splice(p,0,l)}else c.zeroOrAutoZIndexOrTransformedOrOpacity.push(l)}else o.styles.isFloating()?c.nonPositionedFloats.push(l):c.nonPositionedInlineLevel.push(l);Yr(a,l,r?l:A,s)}else o.styles.isInlineLevel()?t.inlineLevel.push(a):t.nonInlineLevel.push(a),Yr(a,t,A,s);ln(o.flags,8)&&qr(o,s)})},qr=function(e,t){for(var A=e instanceof uo?e.start:1,n=e instanceof uo&&e.reversed,o=0;o<t.length;o++){var r=t[o];r.container instanceof lo&&"number"==typeof r.container.value&&0!==r.container.value&&(A=r.container.value),r.listValue=ar(A,r.container.styles.listStyleType,!0),A+=n?-1:1}},Zr=function(e,t){switch(t){case 0:return ei(e.topLeftBorderBox,e.topLeftPaddingBox,e.topRightBorderBox,e.topRightPaddingBox);case 1:return ei(e.topRightBorderBox,e.topRightPaddingBox,e.bottomRightBorderBox,e.bottomRightPaddingBox);case 2:return ei(e.bottomRightBorderBox,e.bottomRightPaddingBox,e.bottomLeftBorderBox,e.bottomLeftPaddingBox);default:return ei(e.bottomLeftBorderBox,e.bottomLeftPaddingBox,e.topLeftBorderBox,e.topLeftPaddingBox)}},$r=function(e,t){var A=[];return Mr(e)?A.push(e.subdivide(.5,!1)):A.push(e),Mr(t)?A.push(t.subdivide(.5,!0)):A.push(t),A},ei=function(e,t,A,n){var o=[];return Mr(e)?o.push(e.subdivide(.5,!1)):o.push(e),Mr(A)?o.push(A.subdivide(.5,!0)):o.push(A),Mr(n)?o.push(n.subdivide(.5,!0).reverse()):o.push(n),Mr(t)?o.push(t.subdivide(.5,!1).reverse()):o.push(t),o},ti=function(e){var t=e.bounds,A=e.styles;return t.add(A.borderLeftWidth,A.borderTopWidth,-(A.borderRightWidth+A.borderLeftWidth),-(A.borderTopWidth+A.borderBottomWidth))},Ai=function(e){var t=e.styles,A=e.bounds,n=rt(t.paddingLeft,A.width),o=rt(t.paddingRight,A.width),r=rt(t.paddingTop,A.width),i=rt(t.paddingBottom,A.width);return A.add(n+t.borderLeftWidth,r+t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth+n+o),-(t.borderTopWidth+t.borderBottomWidth+r+i))},ni=function(e,t,A){var n=function(e,t){return 0===e?t.bounds:2===e?Ai(t):ti(t)}(ai(e.styles.backgroundOrigin,t),e),o=function(e,t){return 0===e?t.bounds:2===e?Ai(t):ti(t)}(ai(e.styles.backgroundClip,t),e),r=ii(ai(e.styles.backgroundSize,t),A,n),i=r[0],a=r[1],s=ot(ai(e.styles.backgroundPosition,t),n.width-i,n.height-a);return[si(ai(e.styles.backgroundRepeat,t),s,r,n,o),Math.round(n.left+s[0]),Math.round(n.top+s[1]),i,a]},oi=function(e){return Ge(e)&&e.value===_t.AUTO},ri=function(e){return"number"==typeof e},ii=function(e,t,A){var n=t[0],o=t[1],r=t[2],i=e[0],a=e[1];if(!i)return[0,0];if($e(i)&&a&&$e(a))return[rt(i,A.width),rt(a,A.height)];var s=ri(r);if(Ge(i)&&(i.value===_t.CONTAIN||i.value===_t.COVER))return ri(r)?A.width/A.height<r!=(i.value===_t.COVER)?[A.width,A.width/r]:[A.height*r,A.height]:[A.width,A.height];var c=ri(n),l=ri(o),u=c||l;if(oi(i)&&(!a||oi(a)))return c&&l?[n,o]:s||u?u&&s?[c?n:o*r,l?o:n/r]:[c?n:A.width,l?o:A.height]:[A.width,A.height];if(s){var d=0,p=0;return $e(i)?d=rt(i,A.width):$e(a)&&(p=rt(a,A.height)),oi(i)?d=p*r:a&&!oi(a)||(p=d/r),[d,p]}var h=null,g=null;if($e(i)?h=rt(i,A.width):a&&$e(a)&&(g=rt(a,A.height)),null===h||a&&!oi(a)||(g=c&&l?h/n*o:A.height),null!==g&&oi(i)&&(h=c&&l?g/o*n:A.width),null!==h&&null!==g)return[h,g];throw new Error("Unable to calculate background-size for element")},ai=function(e,t){var A=e[t];return void 0===A?e[0]:A},si=function(e,t,A,n,o){var r=t[0],i=t[1],a=A[0],s=A[1];switch(e){case 2:return[new Pr(Math.round(n.left),Math.round(n.top+i)),new Pr(Math.round(n.left+n.width),Math.round(n.top+i)),new Pr(Math.round(n.left+n.width),Math.round(s+n.top+i)),new Pr(Math.round(n.left),Math.round(s+n.top+i))];case 3:return[new Pr(Math.round(n.left+r),Math.round(n.top)),new Pr(Math.round(n.left+r+a),Math.round(n.top)),new Pr(Math.round(n.left+r+a),Math.round(n.height+n.top)),new Pr(Math.round(n.left+r),Math.round(n.height+n.top))];case 1:return[new Pr(Math.round(n.left+r),Math.round(n.top+i)),new Pr(Math.round(n.left+r+a),Math.round(n.top+i)),new Pr(Math.round(n.left+r+a),Math.round(n.top+i+s)),new Pr(Math.round(n.left+r),Math.round(n.top+i+s))];default:return[new Pr(Math.round(o.left),Math.round(o.top)),new Pr(Math.round(o.left+o.width),Math.round(o.top)),new Pr(Math.round(o.left+o.width),Math.round(o.height+o.top)),new Pr(Math.round(o.left),Math.round(o.height+o.top))]}},ci="Hidden Text",li=function(){function e(e){this._data={},this._document=e}return e.prototype.parseMetrics=function(e,t){var A=this._document.createElement("div"),n=this._document.createElement("img"),o=this._document.createElement("span"),r=this._document.body;A.style.visibility="hidden",A.style.fontFamily=e,A.style.fontSize=t,A.style.margin="0",A.style.padding="0",A.style.whiteSpace="nowrap",r.appendChild(A),n.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",n.width=1,n.height=1,n.style.margin="0",n.style.padding="0",n.style.verticalAlign="baseline",o.style.fontFamily=e,o.style.fontSize=t,o.style.margin="0",o.style.padding="0",o.appendChild(this._document.createTextNode(ci)),A.appendChild(o),A.appendChild(n);var i=n.offsetTop-o.offsetTop+2;A.removeChild(o),A.appendChild(this._document.createTextNode(ci)),A.style.lineHeight="normal",n.style.verticalAlign="super";var a=n.offsetTop-A.offsetTop+2;return r.removeChild(A),{baseline:i,middle:a}},e.prototype.getMetrics=function(e,t){var A=e+" "+t;return void 0===this._data[A]&&(this._data[A]=this.parseMetrics(e,t)),this._data[A]},e}(),ui=function(e,t){this.context=e,this.options=t},di=function(e){function A(t,A){var n=e.call(this,t,A)||this;return n._activeEffects=[],n.canvas=A.canvas?A.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),A.canvas||(n.canvas.width=Math.floor(A.width*A.scale),n.canvas.height=Math.floor(A.height*A.scale),n.canvas.style.width=A.width+"px",n.canvas.style.height=A.height+"px"),n.fontMetrics=new li(document),n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-A.x,-A.y),n.ctx.textBaseline="bottom",n._activeEffects=[],n.context.logger.debug("Canvas renderer initialized ("+A.width+"x"+A.height+") with scale "+A.scale),n}return t(A,e),A.prototype.applyEffects=function(e){for(var t=this;this._activeEffects.length;)this.popEffect();e.forEach(function(e){return t.applyEffect(e)})},A.prototype.applyEffect=function(e){this.ctx.save(),function(e){return 2===e.type}(e)&&(this.ctx.globalAlpha=e.opacity),function(e){return 0===e.type}(e)&&(this.ctx.translate(e.offsetX,e.offsetY),this.ctx.transform(e.matrix[0],e.matrix[1],e.matrix[2],e.matrix[3],e.matrix[4],e.matrix[5]),this.ctx.translate(-e.offsetX,-e.offsetY)),Wr(e)&&(this.path(e.path),this.ctx.clip()),this._activeEffects.push(e)},A.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},A.prototype.renderStack=function(e){return n(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return e.element.container.styles.isVisible()?[4,this.renderStackContent(e)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})},A.prototype.renderNode=function(e){return n(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return ln(e.container.flags,16),e.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(e)]:[3,3];case 1:return t.sent(),[4,this.renderNodeContent(e)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},A.prototype.renderTextWithLetterSpacing=function(e,t,A){var n=this;0===t?this.ctx.fillText(e.text,e.bounds.left,e.bounds.top+A):$n(e.text).reduce(function(t,o){return n.ctx.fillText(o,t,e.bounds.top+A),t+n.ctx.measureText(o).width},e.bounds.left)},A.prototype.createFontStyle=function(e){var t=e.fontVariant.filter(function(e){return"normal"===e||"small-caps"===e}).join(""),A=mi(e.fontFamily).join(", "),n=je(e.fontSize)?""+e.fontSize.number+e.fontSize.unit:e.fontSize.number+"px";return[[e.fontStyle,t,e.fontWeight,n,A].join(" "),A,n]},A.prototype.renderTextNode=function(e,t){return n(this,void 0,void 0,function(){var A,n,r,i,a,s,c,l,u=this;return o(this,function(o){return A=this.createFontStyle(t),n=A[0],r=A[1],i=A[2],this.ctx.font=n,this.ctx.direction=1===t.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",a=this.fontMetrics.getMetrics(r,i),s=a.baseline,c=a.middle,l=t.paintOrder,e.textBounds.forEach(function(e){l.forEach(function(A){switch(A){case 0:u.ctx.fillStyle=ht(t.color),u.renderTextWithLetterSpacing(e,t.letterSpacing,s);var n=t.textShadow;n.length&&e.text.trim().length&&(n.slice(0).reverse().forEach(function(A){u.ctx.shadowColor=ht(A.color),u.ctx.shadowOffsetX=A.offsetX.number*u.options.scale,u.ctx.shadowOffsetY=A.offsetY.number*u.options.scale,u.ctx.shadowBlur=A.blur.number,u.renderTextWithLetterSpacing(e,t.letterSpacing,s)}),u.ctx.shadowColor="",u.ctx.shadowOffsetX=0,u.ctx.shadowOffsetY=0,u.ctx.shadowBlur=0),t.textDecorationLine.length&&(u.ctx.fillStyle=ht(t.textDecorationColor||t.color),t.textDecorationLine.forEach(function(t){switch(t){case 1:u.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top+s),e.bounds.width,1);break;case 2:u.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top),e.bounds.width,1);break;case 3:u.ctx.fillRect(e.bounds.left,Math.ceil(e.bounds.top+c),e.bounds.width,1)}}));break;case 1:t.webkitTextStrokeWidth&&e.text.trim().length&&(u.ctx.strokeStyle=ht(t.webkitTextStrokeColor),u.ctx.lineWidth=t.webkitTextStrokeWidth,u.ctx.lineJoin=window.chrome?"miter":"round",u.ctx.strokeText(e.text,e.bounds.left,e.bounds.top+s)),u.ctx.strokeStyle="",u.ctx.lineWidth=0,u.ctx.lineJoin="miter"}})}),[2]})})},A.prototype.renderReplacedElement=function(e,t,A){if(A&&e.intrinsicWidth>0&&e.intrinsicHeight>0){var n=Ai(e),o=Vr(t);this.path(o),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(A,0,0,e.intrinsicWidth,e.intrinsicHeight,n.left,n.top,n.width,n.height),this.ctx.restore()}},A.prototype.renderNodeContent=function(e){return n(this,void 0,void 0,function(){var t,n,r,a,s,c,l,u,d,p,h,g,f,m,v,B,w,y;return o(this,function(o){switch(o.label){case 0:this.applyEffects(e.getEffects(4)),t=e.container,n=e.curves,r=t.styles,a=0,s=t.textNodes,o.label=1;case 1:return a<s.length?(c=s[a],[4,this.renderTextNode(c,r)]):[3,4];case 2:o.sent(),o.label=3;case 3:return a++,[3,1];case 4:if(!(t instanceof ao))return[3,8];o.label=5;case 5:return o.trys.push([5,7,,8]),[4,this.context.cache.match(t.src)];case 6:return v=o.sent(),this.renderReplacedElement(t,n,v),[3,8];case 7:return o.sent(),this.context.logger.error("Error loading image "+t.src),[3,8];case 8:if(t instanceof so&&this.renderReplacedElement(t,n,t.canvas),!(t instanceof co))return[3,12];o.label=9;case 9:return o.trys.push([9,11,,12]),[4,this.context.cache.match(t.svg)];case 10:return v=o.sent(),this.renderReplacedElement(t,n,v),[3,12];case 11:return o.sent(),this.context.logger.error("Error loading svg "+t.svg.substring(0,255)),[3,12];case 12:return t instanceof bo&&t.tree?[4,new A(this.context,{scale:this.options.scale,backgroundColor:t.backgroundColor,x:0,y:0,width:t.width,height:t.height}).render(t.tree)]:[3,14];case 13:l=o.sent(),t.width&&t.height&&this.ctx.drawImage(l,0,0,t.width,t.height,t.bounds.left,t.bounds.top,t.bounds.width,t.bounds.height),o.label=14;case 14:if(t instanceof Bo&&(u=Math.min(t.bounds.width,t.bounds.height),t.type===go?t.checked&&(this.ctx.save(),this.path([new Pr(t.bounds.left+.39363*u,t.bounds.top+.79*u),new Pr(t.bounds.left+.16*u,t.bounds.top+.5549*u),new Pr(t.bounds.left+.27347*u,t.bounds.top+.44071*u),new Pr(t.bounds.left+.39694*u,t.bounds.top+.5649*u),new Pr(t.bounds.left+.72983*u,t.bounds.top+.23*u),new Pr(t.bounds.left+.84*u,t.bounds.top+.34085*u),new Pr(t.bounds.left+.39363*u,t.bounds.top+.79*u)]),this.ctx.fillStyle=ht(vo),this.ctx.fill(),this.ctx.restore()):t.type===fo&&t.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.bounds.left+u/2,t.bounds.top+u/2,u/4,0,2*Math.PI,!0),this.ctx.fillStyle=ht(vo),this.ctx.fill(),this.ctx.restore())),pi(t)&&t.value.length){switch(d=this.createFontStyle(r),w=d[0],p=d[1],h=this.fontMetrics.getMetrics(w,p).baseline,this.ctx.font=w,this.ctx.fillStyle=ht(r.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=gi(t.styles.textAlign),y=Ai(t),g=0,t.styles.textAlign){case 1:g+=y.width/2;break;case 2:g+=y.width}f=y.add(g,0,0,-y.height/2+1),this.ctx.save(),this.path([new Pr(y.left,y.top),new Pr(y.left+y.width,y.top),new Pr(y.left+y.width,y.top+y.height),new Pr(y.left,y.top+y.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Yn(t.value,f),r.letterSpacing,h),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!ln(t.styles.display,2048))return[3,20];if(null===t.styles.listStyleImage)return[3,19];if(0!==(m=t.styles.listStyleImage).type)return[3,18];v=void 0,B=m.url,o.label=15;case 15:return o.trys.push([15,17,,18]),[4,this.context.cache.match(B)];case 16:return v=o.sent(),this.ctx.drawImage(v,t.bounds.left-(v.width+10),t.bounds.top),[3,18];case 17:return o.sent(),this.context.logger.error("Error loading list-style-image "+B),[3,18];case 18:return[3,20];case 19:e.listValue&&-1!==t.styles.listStyleType&&(w=this.createFontStyle(r)[0],this.ctx.font=w,this.ctx.fillStyle=ht(r.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",y=new i(t.bounds.left,t.bounds.top+rt(t.styles.paddingTop,t.bounds.width),t.bounds.width,FA(r.lineHeight,r.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Yn(e.listValue,y),r.letterSpacing,FA(r.lineHeight,r.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),o.label=20;case 20:return[2]}})})},A.prototype.renderStackContent=function(e){return n(this,void 0,void 0,function(){var t,A,n,r,i,a,s,c,l,u,d,p,h,g,f;return o(this,function(o){switch(o.label){case 0:return ln(e.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(e.element)];case 1:o.sent(),t=0,A=e.negativeZIndex,o.label=2;case 2:return t<A.length?(f=A[t],[4,this.renderStack(f)]):[3,5];case 3:o.sent(),o.label=4;case 4:return t++,[3,2];case 5:return[4,this.renderNodeContent(e.element)];case 6:o.sent(),n=0,r=e.nonInlineLevel,o.label=7;case 7:return n<r.length?(f=r[n],[4,this.renderNode(f)]):[3,10];case 8:o.sent(),o.label=9;case 9:return n++,[3,7];case 10:i=0,a=e.nonPositionedFloats,o.label=11;case 11:return i<a.length?(f=a[i],[4,this.renderStack(f)]):[3,14];case 12:o.sent(),o.label=13;case 13:return i++,[3,11];case 14:s=0,c=e.nonPositionedInlineLevel,o.label=15;case 15:return s<c.length?(f=c[s],[4,this.renderStack(f)]):[3,18];case 16:o.sent(),o.label=17;case 17:return s++,[3,15];case 18:l=0,u=e.inlineLevel,o.label=19;case 19:return l<u.length?(f=u[l],[4,this.renderNode(f)]):[3,22];case 20:o.sent(),o.label=21;case 21:return l++,[3,19];case 22:d=0,p=e.zeroOrAutoZIndexOrTransformedOrOpacity,o.label=23;case 23:return d<p.length?(f=p[d],[4,this.renderStack(f)]):[3,26];case 24:o.sent(),o.label=25;case 25:return d++,[3,23];case 26:h=0,g=e.positiveZIndex,o.label=27;case 27:return h<g.length?(f=g[h],[4,this.renderStack(f)]):[3,30];case 28:o.sent(),o.label=29;case 29:return h++,[3,27];case 30:return[2]}})})},A.prototype.mask=function(e){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(e.slice(0).reverse()),this.ctx.closePath()},A.prototype.path=function(e){this.ctx.beginPath(),this.formatPath(e),this.ctx.closePath()},A.prototype.formatPath=function(e){var t=this;e.forEach(function(e,A){var n=Mr(e)?e.start:e;0===A?t.ctx.moveTo(n.x,n.y):t.ctx.lineTo(n.x,n.y),Mr(e)&&t.ctx.bezierCurveTo(e.startControl.x,e.startControl.y,e.endControl.x,e.endControl.y,e.end.x,e.end.y)})},A.prototype.renderRepeat=function(e,t,A,n){this.path(e),this.ctx.fillStyle=t,this.ctx.translate(A,n),this.ctx.fill(),this.ctx.translate(-A,-n)},A.prototype.resizeImage=function(e,t,A){var n;if(e.width===t&&e.height===A)return e;var o=(null!==(n=this.canvas.ownerDocument)&&void 0!==n?n:document).createElement("canvas");return o.width=Math.max(1,t),o.height=Math.max(1,A),o.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t,A),o},A.prototype.renderBackgroundImage=function(e){return n(this,void 0,void 0,function(){var t,A,n,r,i,a;return o(this,function(s){switch(s.label){case 0:t=e.styles.backgroundImage.length-1,A=function(A){var r,i,a,s,c,l,u,d,p,h,g,f,m,v,B,w,y,b,C,x,Q,F,U,S,k,E,I,T,H,D,P;return o(this,function(o){switch(o.label){case 0:if(0!==A.type)return[3,5];r=void 0,i=A.url,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,n.context.cache.match(i)];case 2:return r=o.sent(),[3,4];case 3:return o.sent(),n.context.logger.error("Error loading background-image "+i),[3,4];case 4:return r&&(a=ni(e,t,[r.width,r.height,r.width/r.height]),w=a[0],F=a[1],U=a[2],C=a[3],x=a[4],v=n.ctx.createPattern(n.resizeImage(r,C,x),"repeat"),n.renderRepeat(w,v,F,U)),[3,6];case 5:1===A.type?(s=ni(e,t,[null,null,null]),w=s[0],F=s[1],U=s[2],C=s[3],x=s[4],c=Ut(A.angle,C,x),l=c[0],u=c[1],d=c[2],p=c[3],h=c[4],(g=document.createElement("canvas")).width=C,g.height=x,f=g.getContext("2d"),m=f.createLinearGradient(u,p,d,h),Ft(A.stops,l).forEach(function(e){return m.addColorStop(e.stop,ht(e.color))}),f.fillStyle=m,f.fillRect(0,0,C,x),C>0&&x>0&&(v=n.ctx.createPattern(g,"repeat"),n.renderRepeat(w,v,F,U))):function(e){return 2===e.type}(A)&&(B=ni(e,t,[null,null,null]),w=B[0],y=B[1],b=B[2],C=B[3],x=B[4],Q=0===A.position.length?[At]:A.position,F=rt(Q[0],C),U=rt(Q[Q.length-1],x),S=function(e,t,A,n,o){var r=0,i=0;switch(e.size){case 0:0===e.shape?r=i=Math.min(Math.abs(t),Math.abs(t-n),Math.abs(A),Math.abs(A-o)):1===e.shape&&(r=Math.min(Math.abs(t),Math.abs(t-n)),i=Math.min(Math.abs(A),Math.abs(A-o)));break;case 2:if(0===e.shape)r=i=Math.min(St(t,A),St(t,A-o),St(t-n,A),St(t-n,A-o));else if(1===e.shape){var a=Math.min(Math.abs(A),Math.abs(A-o))/Math.min(Math.abs(t),Math.abs(t-n)),s=kt(n,o,t,A,!0),c=s[0],l=s[1];i=a*(r=St(c-t,(l-A)/a))}break;case 1:0===e.shape?r=i=Math.max(Math.abs(t),Math.abs(t-n),Math.abs(A),Math.abs(A-o)):1===e.shape&&(r=Math.max(Math.abs(t),Math.abs(t-n)),i=Math.max(Math.abs(A),Math.abs(A-o)));break;case 3:if(0===e.shape)r=i=Math.max(St(t,A),St(t,A-o),St(t-n,A),St(t-n,A-o));else if(1===e.shape){a=Math.max(Math.abs(A),Math.abs(A-o))/Math.max(Math.abs(t),Math.abs(t-n));var u=kt(n,o,t,A,!1);c=u[0],l=u[1],i=a*(r=St(c-t,(l-A)/a))}}return Array.isArray(e.size)&&(r=rt(e.size[0],n),i=2===e.size.length?rt(e.size[1],o):r),[r,i]}(A,F,U,C,x),k=S[0],E=S[1],k>0&&E>0&&(I=n.ctx.createRadialGradient(y+F,b+U,0,y+F,b+U,k),Ft(A.stops,2*k).forEach(function(e){return I.addColorStop(e.stop,ht(e.color))}),n.path(w),n.ctx.fillStyle=I,k!==E?(T=e.bounds.left+.5*e.bounds.width,H=e.bounds.top+.5*e.bounds.height,P=1/(D=E/k),n.ctx.save(),n.ctx.translate(T,H),n.ctx.transform(1,0,0,D,0,0),n.ctx.translate(-T,-H),n.ctx.fillRect(y,P*(b-H)+H,C,x*P),n.ctx.restore()):n.ctx.fill())),o.label=6;case 6:return t--,[2]}})},n=this,r=0,i=e.styles.backgroundImage.slice(0).reverse(),s.label=1;case 1:return r<i.length?(a=i[r],[5,A(a)]):[3,4];case 2:s.sent(),s.label=3;case 3:return r++,[3,1];case 4:return[2]}})})},A.prototype.renderSolidBorder=function(e,t,A){return n(this,void 0,void 0,function(){return o(this,function(n){return this.path(Zr(A,t)),this.ctx.fillStyle=ht(e),this.ctx.fill(),[2]})})},A.prototype.renderDoubleBorder=function(e,t,A,r){return n(this,void 0,void 0,function(){var n,i;return o(this,function(o){switch(o.label){case 0:return t<3?[4,this.renderSolidBorder(e,A,r)]:[3,2];case 1:return o.sent(),[2];case 2:return n=function(e,t){switch(t){case 0:return ei(e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox,e.topRightBorderBox,e.topRightBorderDoubleOuterBox);case 1:return ei(e.topRightBorderBox,e.topRightBorderDoubleOuterBox,e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox);case 2:return ei(e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox,e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox);default:return ei(e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox,e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox)}}(r,A),this.path(n),this.ctx.fillStyle=ht(e),this.ctx.fill(),i=function(e,t){switch(t){case 0:return ei(e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox,e.topRightBorderDoubleInnerBox,e.topRightPaddingBox);case 1:return ei(e.topRightBorderDoubleInnerBox,e.topRightPaddingBox,e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox);case 2:return ei(e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox,e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox);default:return ei(e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox,e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox)}}(r,A),this.path(i),this.ctx.fill(),[2]}})})},A.prototype.renderNodeBackgroundAndBorders=function(e){return n(this,void 0,void 0,function(){var t,A,n,r,i,a,s,c,l=this;return o(this,function(o){switch(o.label){case 0:return this.applyEffects(e.getEffects(2)),t=e.container.styles,A=!pt(t.backgroundColor)||t.backgroundImage.length,n=[{style:t.borderTopStyle,color:t.borderTopColor,width:t.borderTopWidth},{style:t.borderRightStyle,color:t.borderRightColor,width:t.borderRightWidth},{style:t.borderBottomStyle,color:t.borderBottomColor,width:t.borderBottomWidth},{style:t.borderLeftStyle,color:t.borderLeftColor,width:t.borderLeftWidth}],r=hi(ai(t.backgroundClip,0),e.curves),A||t.boxShadow.length?(this.ctx.save(),this.path(r),this.ctx.clip(),pt(t.backgroundColor)||(this.ctx.fillStyle=ht(t.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(e.container)]):[3,2];case 1:o.sent(),this.ctx.restore(),t.boxShadow.slice(0).reverse().forEach(function(t){l.ctx.save();var A,n,o,r,i,a=_r(e.curves),s=t.inset?0:1e4,c=(A=a,n=-s+(t.inset?1:-1)*t.spread.number,o=(t.inset?1:-1)*t.spread.number,r=t.spread.number*(t.inset?-2:2),i=t.spread.number*(t.inset?-2:2),A.map(function(e,t){switch(t){case 0:return e.add(n,o);case 1:return e.add(n+r,o);case 2:return e.add(n+r,o+i);case 3:return e.add(n,o+i)}return e}));t.inset?(l.path(a),l.ctx.clip(),l.mask(c)):(l.mask(a),l.ctx.clip(),l.path(c)),l.ctx.shadowOffsetX=t.offsetX.number+s,l.ctx.shadowOffsetY=t.offsetY.number,l.ctx.shadowColor=ht(t.color),l.ctx.shadowBlur=t.blur.number,l.ctx.fillStyle=t.inset?ht(t.color):"rgba(0,0,0,1)",l.ctx.fill(),l.ctx.restore()}),o.label=2;case 2:i=0,a=0,s=n,o.label=3;case 3:return a<s.length?0!==(c=s[a]).style&&!pt(c.color)&&c.width>0?2!==c.style?[3,5]:[4,this.renderDashedDottedBorder(c.color,c.width,i,e.curves,2)]:[3,11]:[3,13];case 4:return o.sent(),[3,11];case 5:return 3!==c.style?[3,7]:[4,this.renderDashedDottedBorder(c.color,c.width,i,e.curves,3)];case 6:return o.sent(),[3,11];case 7:return 4!==c.style?[3,9]:[4,this.renderDoubleBorder(c.color,c.width,i,e.curves)];case 8:return o.sent(),[3,11];case 9:return[4,this.renderSolidBorder(c.color,i,e.curves)];case 10:o.sent(),o.label=11;case 11:i++,o.label=12;case 12:return a++,[3,3];case 13:return[2]}})})},A.prototype.renderDashedDottedBorder=function(e,t,A,r,i){return n(this,void 0,void 0,function(){var n,a,s,c,l,u,d,p,h,g,f,m,v,B,w,y;return o(this,function(o){return this.ctx.save(),n=function(e,t){switch(t){case 0:return $r(e.topLeftBorderStroke,e.topRightBorderStroke);case 1:return $r(e.topRightBorderStroke,e.bottomRightBorderStroke);case 2:return $r(e.bottomRightBorderStroke,e.bottomLeftBorderStroke);default:return $r(e.bottomLeftBorderStroke,e.topLeftBorderStroke)}}(r,A),a=Zr(r,A),2===i&&(this.path(a),this.ctx.clip()),Mr(a[0])?(s=a[0].start.x,c=a[0].start.y):(s=a[0].x,c=a[0].y),Mr(a[1])?(l=a[1].end.x,u=a[1].end.y):(l=a[1].x,u=a[1].y),d=0===A||2===A?Math.abs(s-l):Math.abs(c-u),this.ctx.beginPath(),3===i?this.formatPath(n):this.formatPath(a.slice(0,2)),p=t<3?3*t:2*t,h=t<3?2*t:t,3===i&&(p=t,h=t),g=!0,d<=2*p?g=!1:d<=2*p+h?(p*=f=d/(2*p+h),h*=f):(m=Math.floor((d+h)/(p+h)),v=(d-m*p)/(m-1),h=(B=(d-(m+1)*p)/m)<=0||Math.abs(h-v)<Math.abs(h-B)?v:B),g&&(3===i?this.ctx.setLineDash([0,p+h]):this.ctx.setLineDash([p,h])),3===i?(this.ctx.lineCap="round",this.ctx.lineWidth=t):this.ctx.lineWidth=2*t+1.1,this.ctx.strokeStyle=ht(e),this.ctx.stroke(),this.ctx.setLineDash([]),2===i&&(Mr(a[0])&&(w=a[3],y=a[0],this.ctx.beginPath(),this.formatPath([new Pr(w.end.x,w.end.y),new Pr(y.start.x,y.start.y)]),this.ctx.stroke()),Mr(a[1])&&(w=a[1],y=a[2],this.ctx.beginPath(),this.formatPath([new Pr(w.end.x,w.end.y),new Pr(y.start.x,y.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},A.prototype.render=function(e){return n(this,void 0,void 0,function(){var t;return o(this,function(A){switch(A.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=ht(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),n=new Jr(e,null),o=new Xr(n),Yr(n,o,o,r=[]),qr(n.container,r),t=o,[4,this.renderStack(t)];case 1:return A.sent(),this.applyEffects([]),[2,this.canvas]}var n,o,r})})},A}(ui),pi=function(e){return e instanceof yo||e instanceof wo||e instanceof Bo&&e.type!==fo&&e.type!==go},hi=function(e,t){switch(e){case 0:return _r(t);case 2:return function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]}(t);default:return Vr(t)}},gi=function(e){switch(e){case 1:return"center";case 2:return"right";default:return"left"}},fi=["-apple-system","system-ui"],mi=function(e){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?e.filter(function(e){return-1===fi.indexOf(e)}):e},vi=function(e){function A(t,A){var n=e.call(this,t,A)||this;return n.canvas=A.canvas?A.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),n.options=A,n.canvas.width=Math.floor(A.width*A.scale),n.canvas.height=Math.floor(A.height*A.scale),n.canvas.style.width=A.width+"px",n.canvas.style.height=A.height+"px",n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-A.x,-A.y),n.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+A.width+"x"+A.height+" at "+A.x+","+A.y+") with scale "+A.scale),n}return t(A,e),A.prototype.render=function(e){return n(this,void 0,void 0,function(){var t,A;return o(this,function(n){switch(n.label){case 0:return t=zn(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,e),[4,Bi(t)];case 1:return A=n.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=ht(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(A,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},A}(ui),Bi=function(e){return new Promise(function(t,A){var n=new Image;n.onload=function(){t(n)},n.onerror=A,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))})},wi=function(){function e(e){var t=e.id,A=e.enabled;this.id=t,this.enabled=A,this.start=Date.now()}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.debug?console.debug.apply(console,r([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.prototype.getTime=function(){return Date.now()-this.start},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&"undefined"!=typeof window&&window.console&&"function"==typeof console.info&&console.info.apply(console,r([this.id,this.getTime()+"ms"],e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.warn?console.warn.apply(console,r([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.error?console.error.apply(console,r([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.instances={},e}(),yi=function(){function e(t,A){var n;this.windowBounds=A,this.instanceName="#"+e.instanceCount++,this.logger=new wi({id:this.instanceName,enabled:t.logging}),this.cache=null!==(n=t.cache)&&void 0!==n?n:new Fr(this,t)}return e.instanceCount=1,e}();"undefined"!=typeof window&&Qr.setContext(window);var bi=function(e,t){return n(void 0,void 0,void 0,function(){var n,r,s,c,l,u,d,p,h,g,f,m,v,B,w,y,b,C,x,Q,F,U,S,k,E,I,T,H,D,P,O,K,M,L,R,_,V,j;return o(this,function(o){switch(o.label){case 0:if(!e||"object"!=typeof e)return[2,Promise.reject("Invalid element provided as first argument")];if(!(n=e.ownerDocument))throw new Error("Element is not attached to a Document");if(!(r=n.defaultView))throw new Error("Document is not attached to a Window");return s={allowTaint:null!==(U=t.allowTaint)&&void 0!==U&&U,imageTimeout:null!==(S=t.imageTimeout)&&void 0!==S?S:15e3,proxy:t.proxy,useCORS:null!==(k=t.useCORS)&&void 0!==k&&k},c=A({logging:null===(E=t.logging)||void 0===E||E,cache:t.cache},s),l={windowWidth:null!==(I=t.windowWidth)&&void 0!==I?I:r.innerWidth,windowHeight:null!==(T=t.windowHeight)&&void 0!==T?T:r.innerHeight,scrollX:null!==(H=t.scrollX)&&void 0!==H?H:r.pageXOffset,scrollY:null!==(D=t.scrollY)&&void 0!==D?D:r.pageYOffset},u=new i(l.scrollX,l.scrollY,l.windowWidth,l.windowHeight),d=new yi(c,u),p=null!==(P=t.foreignObjectRendering)&&void 0!==P&&P,h={allowTaint:null!==(O=t.allowTaint)&&void 0!==O&&O,onclone:t.onclone,ignoreElements:t.ignoreElements,inlineImages:p,copyStyles:p},d.logger.debug("Starting document clone with size "+u.width+"x"+u.height+" scrolled to "+-u.left+","+-u.top),g=new cr(d,e,h),(f=g.clonedReferenceElement)?[4,g.toIFrame(n,u)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return m=o.sent(),v=Ko(f)||"HTML"===f.tagName?function(e){var t=e.body,A=e.documentElement;if(!t||!A)throw new Error("Unable to get document size");var n=Math.max(Math.max(t.scrollWidth,A.scrollWidth),Math.max(t.offsetWidth,A.offsetWidth),Math.max(t.clientWidth,A.clientWidth)),o=Math.max(Math.max(t.scrollHeight,A.scrollHeight),Math.max(t.offsetHeight,A.offsetHeight),Math.max(t.clientHeight,A.clientHeight));return new i(0,0,n,o)}(f.ownerDocument):a(d,f),B=v.width,w=v.height,y=v.left,b=v.top,C=Ci(d,f,t.backgroundColor),x={canvas:t.canvas,backgroundColor:C,scale:null!==(M=null!==(K=t.scale)&&void 0!==K?K:r.devicePixelRatio)&&void 0!==M?M:1,x:(null!==(L=t.x)&&void 0!==L?L:0)+y,y:(null!==(R=t.y)&&void 0!==R?R:0)+b,width:null!==(_=t.width)&&void 0!==_?_:Math.ceil(B),height:null!==(V=t.height)&&void 0!==V?V:Math.ceil(w)},p?(d.logger.debug("Document cloned, using foreign object rendering"),[4,new vi(d,x).render(f)]):[3,3];case 2:return Q=o.sent(),[3,5];case 3:return d.logger.debug("Document cloned, element located at "+y+","+b+" with size "+B+"x"+w+" using computed rendering"),d.logger.debug("Starting DOM parsing"),F=Fo(d,f),C===F.styles.backgroundColor&&(F.styles.backgroundColor=bt.TRANSPARENT),d.logger.debug("Starting renderer for element at "+x.x+","+x.y+" with size "+x.width+"x"+x.height),[4,new di(d,x).render(F)];case 4:Q=o.sent(),o.label=5;case 5:return(null===(j=t.removeContainer)||void 0===j||j)&&(cr.destroy(m)||d.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),d.logger.debug("Finished rendering"),[2,Q]}})})},Ci=function(e,t,A){var n=t.ownerDocument,o=n.documentElement?yt(e,getComputedStyle(n.documentElement).backgroundColor):bt.TRANSPARENT,r=n.body?yt(e,getComputedStyle(n.body).backgroundColor):bt.TRANSPARENT,i="string"==typeof A?yt(e,A):null===A?bt.TRANSPARENT:4294967295;return t===n.documentElement?pt(o)?pt(r)?i:r:o:i};return function(e,t){return void 0===t&&(t={}),bi(e,t)}}()}},t={};function A(n){var o=t[n];if(void 0!==o)return o.exports;var r=t[n]={exports:{}};return e[n].call(r.exports,r,r.exports,A),r.exports}A.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return A.d(t,{a:t}),t},A.d=(e,t)=>{for(var n in t)A.o(t,n)&&!A.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},A.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),A.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";A.r(n),A.d(n,{AgentSDK:()=>fr,AudioPlayer:()=>ZA,AudioRecorder:()=>q,EventEmitter:()=>O,MicPermissionModals:()=>t,MicPermissionUtils:()=>e,TTPChatWidget:()=>xo,TTPEcommerceWidget:()=>or,TextChatSDK:()=>mA,VERSION:()=>mr,VoiceSDK_v2:()=>oA,WebSocketManager:()=>_A,default:()=>vr});var e={};A.r(e),A.d(e,{checkPermissionState:()=>nn,getDeviceInfo:()=>An,getPermissionInstructions:()=>rn,openSettings:()=>an});var t={};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function r(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=o(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}A.r(t),A.d(t,{showBlockedModal:()=>gn,showNoMicrophoneModal:()=>fn,showPrePromptModal:()=>hn});const a=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.events={}},t=[{key:"on",value:function(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),this}},{key:"off",value:function(e,t){return this.events[e]?(this.events[e]=this.events[e].filter(function(e){return e!==t}),this):this}},{key:"emit",value:function(e){for(var t=arguments.length,A=new Array(t>1?t-1:0),n=1;n<t;n++)A[n-1]=arguments[n];return!!this.events[e]&&(this.events[e].forEach(function(e){e.apply(void 0,A)}),!0)}},{key:"once",value:function(e,t){var A=this,n=function(){t.apply(void 0,arguments),A.off(e,n)};return this.on(e,n)}},{key:"removeAllListeners",value:function(e){return e?delete this.events[e]:this.events={},this}}],t&&r(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function c(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function l(e){var t=function(e){if("object"!=s(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=s(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s(t)?t:t+""}const u=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name="PCM"},(t=[{key:"decode",value:function(e){if(e instanceof ArrayBuffer)return e;if(e instanceof Uint8Array)return e.buffer;throw new Error("Invalid PCM data type")}},{key:"encode",value:function(e){return e}}])&&c(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function p(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,h(n.key),n)}}function h(e){var t=function(e){if("object"!=d(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=d(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==d(t)?t:t+""}const g=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name="PCMU"},(t=[{key:"decode",value:function(e){for(var t=e instanceof Uint8Array?e:new Uint8Array(e),A=new Int16Array(t.length),n=0;n<t.length;n++)A[n]=this.mulawToLinear(t[n]);return A.buffer}},{key:"encode",value:function(e){for(var t=e instanceof Int16Array?e:new Int16Array(e),A=new Uint8Array(t.length),n=0;n<t.length;n++)A[n]=this.linearToMulaw(t[n]);return A}},{key:"mulawToLinear",value:function(e){var t=1<<3+(e>>4&7);return(128&e?-1:1)*(132+(15&e)*t+(t>>1)-4)}},{key:"linearToMulaw",value:function(e){var t=e>>8&128;t&&(e=-e),e>32635&&(e=32635),e+=132;for(var A=7,n=16384;0===(e&n)&&A>0;A--,n>>=1);return 255&~(t|A<<4|e>>A+3&15)}}])&&p(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function m(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,v(n.key),n)}}function v(e){var t=function(e){if("object"!=f(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=f(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==f(t)?t:t+""}const B=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name="PCMA"},(t=[{key:"decode",value:function(e){for(var t=e instanceof Uint8Array?e:new Uint8Array(e),A=new Int16Array(t.length),n=0;n<t.length;n++)A[n]=this.alawToLinear(t[n]);return A.buffer}},{key:"encode",value:function(e){for(var t=e instanceof Int16Array?e:new Int16Array(e),A=new Uint8Array(t.length),n=0;n<t.length;n++)A[n]=this.linearToAlaw(t[n]);return A}},{key:"alawToLinear",value:function(e){var t=(e^=85)>>4&7,A=15&e;return(128&e?-1:1)*(0===t?8+(A<<4):264+(A<<4)<<t-1)}},{key:"linearToAlaw",value:function(e){var t,A,n=e>>8&128;if(n&&(e=-e),e>32635&&(e=32635),e<256)t=0,A=e>>4;else{t=7;for(var o=16384;0===(e&o)&&t>0;t--,o>>=1);A=e>>t+3&15}return 85^(n|t<<4|A)}}])&&m(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var A=0,n=Array(t);A<t;A++)n[A]=e[A];return n}function b(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],A=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&A>=e.length&&(e=void 0),{value:e&&e[A++],done:!e}}}}throw new TypeError(w(e)+" is not iterable")}function C(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return x(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(x(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,x(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,x(u,"constructor",c),x(c,"constructor",s),s.displayName="GeneratorFunction",x(c,o,"GeneratorFunction"),x(u),x(u,o,"Generator"),x(u,n,function(){return this}),x(u,"toString",function(){return"[object Generator]"}),(C=function(){return{w:r,m:d}})()}function x(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}x=function(e,t,A,n){function r(t,A){x(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},x(e,t,A,n)}function Q(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function F(e){return function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){Q(r,n,o,i,a,"next",e)}function a(e){Q(r,n,o,i,a,"throw",e)}i(void 0)})}}function U(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,S(n.key),n)}}function S(e){var t=function(e){if("object"!=w(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=w(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==w(t)?t:t+""}function k(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(k=function(){return!!e})()}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function I(e,t){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},I(e,t)}const T=function(e){function t(){var e,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),e=function(e,t,A){return t=E(t),function(e,t){if(t&&("object"==w(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,k()?Reflect.construct(t,A||[],E(e).constructor):t.apply(e,A))}(this,t),console.log("%c🔊 AUDIO PLAYER - SILENT BUFFER PRIMING FIX ENABLED","background: #10b981; color: white; font-size: 14px; font-weight: bold; padding: 4px 8px; border-radius: 4px;"),console.log("%cAndroid Greeting Cut-Off Fix: Silent buffer priming (150ms) + dynamic startup buffer","background: #d1fae5; color: #065f46; font-size: 12px; padding: 2px 6px; border-radius: 3px;"),console.log("%cBuild: 2026-01-30-SILENT-BUFFER-PRIMING | Look for [scheduleWAV] and priming logs","background: #e0e7ff; color: #1e40af; font-size: 11px; padding: 2px 6px; border-radius: 3px;"),console.log(""),e.config=A,e.audioContext=null,e.gainNode=null,e._audioContextPrimed=!1,e._waitForReadyStateHandler=null,e.audioQueue=[],e.isPlaying=!1,e.isProcessingQueue=!1,e.currentSource=null,e.outputFormat=null,e.nextStartTime=0,e.scheduledBuffers=0,e.scheduledSources=new Set,e.pcmChunkQueue=[],e.preparedBuffer=[],e.MAX_PREPARED_BUFFER_SIZE=200,e.MAX_PCM_CHUNK_QUEUE_SIZE=50,e.isProcessingPcmQueue=!1,e.isSchedulingFrames=!1,e._emptySentenceTimeout=null,e.MAX_LOOKAHEAD_SECONDS=.02,e.pendingSentenceText=null,e.sentenceTimings=[],e.isCheckingTranscripts=!1,e._isStopped=!1,e._currentSentenceId=0,e.codecs={pcm:new u,pcmu:new g,pcma:new B},e.SUPPORTED_CONTAINERS=["wav","raw"],e.SUPPORTED_ENCODINGS=["pcm","pcmu","pcma"],e.SUPPORTED_SAMPLE_RATES=[8e3,16e3,22050,24e3,44100,48e3],e.SUPPORTED_BIT_DEPTHS=[8,16,24],e.SUPPORTED_CHANNELS=[1],console.log("🎵 AudioPlayer v2 initialized"),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&I(e,t)}(t,e),A=t,n=[{key:"setOutputFormat",value:function(e){var t;this.validateFormat(e)||(console.warn("⚠️ AudioPlayer: Invalid format, using defaults:",e),e=this.getDefaultFormat());var A=null===(t=this.outputFormat)||void 0===t?void 0:t.sampleRate,n=e.sampleRate;this.outputFormat=e,console.log("✅ AudioPlayer v2: Format set:",e),this.audioContext&&A&&A!==n&&(console.warn("⚠️ AudioPlayer: Sample rate changed, recreating AudioContext"),console.warn(" Old: ".concat(A,"Hz → New: ").concat(n,"Hz")),this.stopImmediate(),this._cleanupAudioContext(),console.log("ℹ️ AudioContext will be recreated on next audio chunk with correct sample rate"))}},{key:"validateFormat",value:function(e){var t,A;if(!e)return!1;var n=null===(t=e.container)||void 0===t?void 0:t.toLowerCase(),o=null===(A=e.encoding)||void 0===A?void 0:A.toLowerCase();return n&&o&&this.SUPPORTED_CONTAINERS.includes(n)&&this.SUPPORTED_ENCODINGS.includes(o)&&this.SUPPORTED_SAMPLE_RATES.includes(e.sampleRate)&&this.SUPPORTED_BIT_DEPTHS.includes(e.bitDepth)&&(!e.channels||this.SUPPORTED_CHANNELS.includes(e.channels))}},{key:"getDefaultFormat",value:function(){return{container:"raw",encoding:"pcm",sampleRate:16e3,channels:1,bitDepth:16}}},{key:"playAudio",value:function(e){var t=this;if(this._isStopped)console.log("🛑 AudioPlayer: Ignoring audio chunk - playback was stopped (barge-in)");else try{var A=this.createAudioBlob(e);this.audioQueue.push(A),this.isPlaying||this.isProcessingQueue||this.currentSource||setTimeout(function(){return t.processQueue()},50)}catch(e){console.error("❌ AudioPlayer v2: Playback error:",e),this.emit("playbackError",e)}}},{key:"playChunk",value:(l=F(C().m(function e(t){var A,n,o=this;return C().w(function(e){for(;;)switch(e.n){case 0:if(!this._isStopped){e.n=1;break}return console.log("🛑 AudioPlayer: Ignoring PCM chunk - playback was stopped (barge-in)"),e.a(2);case 1:(A=this.prepareChunk(t))?(this._emptySentenceTimeout&&(clearTimeout(this._emptySentenceTimeout),this._emptySentenceTimeout=null),this.preparedBuffer.length>=this.MAX_PREPARED_BUFFER_SIZE&&(this.preparedBuffer.shift(),console.warn("⚠️ AudioPlayer: preparedBuffer at max size (".concat(this.MAX_PREPARED_BUFFER_SIZE,"), dropped oldest frame"))),this.preparedBuffer.push(A),this.isSchedulingFrames||this._isStopped?setTimeout(function(){o.preparedBuffer.length>0&&!o.isSchedulingFrames&&!o._isStopped&&o.schedulePreparedFrames()},5):this.schedulePreparedFrames(),this.pcmChunkQueue.length>0&&!this.isProcessingPcmQueue&&this.processPcmQueue()):(console.error("❌ AudioPlayer: playChunk failed - prepareChunk returned null"),console.error(" pcmData length:",(null==t?void 0:t.byteLength)||"undefined"),console.error(" outputFormat:",this.outputFormat),console.error(" audioContext:",this.audioContext?"initialized":"not initialized"),console.error(" audioContext state:",(null===(n=this.audioContext)||void 0===n?void 0:n.state)||"N/A"),this.emit("playbackError",new Error("Failed to prepare PCM chunk for playback")));case 2:return e.a(2)}},e,this)})),function(e){return l.apply(this,arguments)})},{key:"prepareChunk",value:function(e){try{var t;if(!this.outputFormat)return console.error("❌ AudioPlayer: Cannot prepare chunk - outputFormat not set"),console.error(" Call setOutputFormat() before playing audio chunks"),null;if(this.audioContext||this.initializeAudioContext(),!this.audioContext)return console.error("❌ AudioPlayer: Cannot prepare chunk - AudioContext not available"),null;var A=e;if(e.byteLength%2!=0){console.warn("⚠️ Odd PCM chunk size, padding:",e.byteLength);var n=new Uint8Array(e.byteLength+1);n.set(new Uint8Array(e),0),n[e.byteLength]=0,A=n.buffer}for(var o=new Int16Array(A),r=new Float32Array(o.length),i=1/32768,a=o.length,s=0;s<a;s++)r[s]=o[s]*i;var c=(null===(t=this.outputFormat)||void 0===t?void 0:t.sampleRate)||this.audioContext.sampleRate,l=this.audioContext.sampleRate,u=this.audioContext.createBuffer(1,r.length,c);u.getChannelData(0).set(r);var d=u.duration,p=r.length,h=d;return l!==c&&(h=p/l),{buffer:u,duration:h,sampleRate:c,contextSampleRate:l}}catch(e){return console.error("❌ AudioPlayer: Error preparing chunk:",e),null}}},{key:"applyFadeOut",value:function(e){return e}},{key:"schedulePreparedFrames",value:(c=F(C().m(function e(){var t,A,n,o,r,i,a,s,c,l=this;return C().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!this._isStopped){e.n=1;break}return console.log("🛑 AudioPlayer: Not scheduling frames - playback was stopped (barge-in)"),e.a(2);case 1:if(!this.isSchedulingFrames){e.n=2;break}return e.a(2);case 2:return this.isSchedulingFrames=!0,t=this.preparedBuffer.length,0===(A=Math.min(t,5))&&t>0&&(A=1),e.p=3,this.audioContext||this.initializeAudioContext(),console.log("🔍 [scheduleWAV] BEFORE waitForAudioContextReady - state:",null===(n=this.audioContext)||void 0===n?void 0:n.state,"currentTime:",null===(o=this.audioContext)||void 0===o?void 0:o.currentTime),e.n=4,this.waitForAudioContextReady();case 4:console.log("🔍 [scheduleWAV] AFTER waitForAudioContextReady - state:",null===(r=this.audioContext)||void 0===r?void 0:r.state,"currentTime:",null===(i=this.audioContext)||void 0===i?void 0:i.currentTime),a=0,s=C().m(function e(){var t,A,n,o,r,i,s;return C().w(function(e){for(;;)switch(e.n){case 0:if(!l._isStopped){e.n=1;break}return console.log("🛑 AudioPlayer: Stopping frame scheduling - playback was stopped"),e.a(2,0);case 1:if(t=l.preparedBuffer.shift()){e.n=2;break}return e.a(2,0);case 2:(A=l.audioContext.createBufferSource()).buffer=t.buffer,A.connect(l.gainNode||l.audioContext.destination),l.scheduledSources.add(A),n=l.audioContext.currentTime,0===l.scheduledBuffers?(o=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),r=.03,o&&(l._audioContextPrimed?r=0:(r=2,console.warn("⚠️ AudioPlayer: Audio not primed yet, using 2000ms fallback buffer"))),l.nextStartTime=n+r,console.log("🎵 [scheduleWAV] FIRST FRAME - primed: ".concat(l._audioContextPrimed,", buffer: ").concat(1e3*r,"ms"))):(i=n+l.MAX_LOOKAHEAD_SECONDS,l.nextStartTime<i&&(l.nextStartTime=i,console.warn("⚠️ AudioPlayer: Fell behind schedule, adjusting nextStartTime to ".concat(l.nextStartTime.toFixed(4),"s")))),l.pendingSentenceText&&(l.sentenceTimings.push({startTime:l.nextStartTime,text:l.pendingSentenceText,displayed:!1}),console.log("📝 AudioPlayer: Sentence scheduled at ".concat(l.nextStartTime.toFixed(3),'s: "').concat(l.pendingSentenceText.substring(0,40),'..."')),l.pendingSentenceText=null,l.isCheckingTranscripts||l.startTranscriptChecker()),A.start(l.nextStartTime),l.nextStartTime+=t.duration,l.nextStartTime=Math.round(1e6*l.nextStartTime)/1e6,s=l.nextStartTime-t.duration,l.scheduledBuffers<5&&(console.log("🎵 AudioPlayer: Scheduled frame ".concat(l.scheduledBuffers+1," at ").concat(s.toFixed(4),"s, next at ").concat(l.nextStartTime.toFixed(4),"s")),console.log(" Duration: ".concat(t.duration.toFixed(4),"s (").concat((1e3*t.duration).toFixed(2),"ms), Queued: ").concat(l.preparedBuffer.length,", Scheduled: ").concat(l.scheduledBuffers))),l.scheduledBuffers++,a++,A.onended=function(){if(!l._isStopped&&l.scheduledSources.has(A))if(l.scheduledSources.delete(A),!l._isStopped&&l.scheduledBuffers>0&&l.scheduledBuffers--,0!==l.scheduledBuffers||0!==l.preparedBuffer.length||0!==l.pcmChunkQueue.length||l._isStopped){if(l.preparedBuffer.length>0&&!l._isStopped)setTimeout(function(){l.preparedBuffer.length>0&&!l.isSchedulingFrames&&!l._isStopped&&l.schedulePreparedFrames()},0);else if(l.scheduledBuffers>0&&!l._isStopped){var e=function(){l._isStopped||(l.preparedBuffer.length>0&&!l.isSchedulingFrames&&l.scheduledBuffers>0?l.schedulePreparedFrames():l.scheduledBuffers>0&&!l._isStopped&&setTimeout(e,10))};setTimeout(e,10)}}else l.isPlaying=!1,l.isSchedulingFrames=!1,console.log("🛑 AudioPlayer: Emitting playbackStopped event (all buffers finished)"),l.emit("playbackStopped")},l.isPlaying||(l.isPlaying=!0,console.log("🎵 AudioPlayer: Emitting playbackStarted event"),l.emit("playbackStarted"));case 3:return e.a(2)}},e)});case 5:if(!(this.preparedBuffer.length>0&&a<A)){e.n=8;break}return e.d(b(s()),6);case 6:if(0!==e.v){e.n=7;break}return e.a(3,8);case 7:e.n=5;break;case 8:this.isSchedulingFrames=!1,this.preparedBuffer.length>0&&!this._isStopped&&requestAnimationFrame(function(){l.preparedBuffer.length>0&&!l.isSchedulingFrames&&!l._isStopped&&l.schedulePreparedFrames()}),this.scheduledBuffers>0&&!this._isStopped&&setTimeout(function(){l.preparedBuffer.length>0&&!l.isSchedulingFrames&&l.scheduledBuffers>0&&!l._isStopped?l.schedulePreparedFrames():l.scheduledBuffers>0&&!l._isStopped&&setTimeout(function(){l.preparedBuffer.length>0&&!l.isSchedulingFrames&&l.scheduledBuffers>0&&!l._isStopped&&l.schedulePreparedFrames()},10)},10),e.n=10;break;case 9:e.p=9,c=e.v,console.error("❌ AudioPlayer v2: Error scheduling frames:",c),this.emit("playbackError",c),this.isSchedulingFrames=!1;case 10:return e.a(2)}},e,this,[[3,9]])})),function(){return c.apply(this,arguments)})},{key:"processPcmQueue",value:(s=F(C().m(function e(){var t,A,n,o,r,i,a,s,c,l,u,d,p,h,g,f,m,v,B,w,y=this;return C().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!this._isStopped){e.n=1;break}return console.log("🛑 AudioPlayer: Not processing PCM queue - playback was stopped (barge-in)"),e.a(2);case 1:if(!this.isProcessingPcmQueue){e.n=2;break}return e.a(2);case 2:return this.isProcessingPcmQueue=!0,e.p=3,this.audioContext||this.initializeAudioContext(),e.n=4,this.waitForAudioContextReady();case 4:if(!(this.pcmChunkQueue.length>0)){e.n=7;break}if(!this._isStopped){e.n=5;break}return console.log("🛑 AudioPlayer: Stopping PCM queue processing - playback was stopped"),e.a(3,7);case 5:if(n=this.pcmChunkQueue.shift()){e.n=6;break}return e.a(3,4);case 6:for(o=n,n.byteLength%2!=0&&(console.warn("⚠️ Odd PCM chunk size, padding:",n.byteLength),(r=new Uint8Array(n.byteLength+1)).set(new Uint8Array(n),0),r[n.byteLength]=0,o=r.buffer),i=new Int16Array(o),a=new Float32Array(i.length),s=1/32768,c=i.length,l=0;l<c;l++)a[l]=i[l]*s;u=(null===(t=this.outputFormat)||void 0===t?void 0:t.sampleRate)||this.audioContext.sampleRate,d=this.audioContext.sampleRate,null!==(A=this.outputFormat)&&void 0!==A&&A.sampleRate?this.scheduledBuffers<3&&console.log("🎵 AudioPlayer: Creating buffer at ".concat(u,"Hz (AudioContext: ").concat(d,"Hz)")):console.warn("⚠️ AudioPlayer: outputFormat.sampleRate not set! Using AudioContext sample rate:",d),(p=this.audioContext.createBuffer(1,a.length,u)).getChannelData(0).set(a),(h=this.audioContext.createBufferSource()).buffer=p,h.connect(this.gainNode||this.audioContext.destination),g=this.audioContext.currentTime,this.nextStartTime<g&&(this.nextStartTime=g,0===this.scheduledBuffers&&console.log("🎵 Starting playback at current time:",g)),f=p.duration,m=a.length,v=f,d!==u&&(v=m/d,this.scheduledBuffers<3&&(console.log("🔄 Resampling detected: ".concat(u,"Hz → ").concat(d,"Hz")),console.log(" Buffer duration: ".concat(f.toFixed(4),"s, Calculated: ").concat(v.toFixed(4),"s")))),h.start(this.nextStartTime),this.nextStartTime+=v,this.nextStartTime=Math.round(1e6*this.nextStartTime)/1e6,this.scheduledBuffers<3&&(B=this.nextStartTime-v,console.log("🎵 AudioPlayer: Scheduled chunk ".concat(this.scheduledBuffers+1," at ").concat(B.toFixed(4),"s, next at ").concat(this.nextStartTime.toFixed(4),"s")),console.log(" Duration: ".concat(v.toFixed(4),"s (").concat((1e3*v).toFixed(2),"ms)"))),this.scheduledBuffers++,h.onended=function(){y.scheduledBuffers--,0===y.scheduledBuffers&&0===y.pcmChunkQueue.length&&(y.isPlaying=!1,y.isProcessingPcmQueue=!1,y.emit("playbackStopped"))},this.isPlaying||(this.isPlaying=!0,this.emit("playbackStarted")),e.n=4;break;case 7:this.isProcessingPcmQueue=!1,e.n=9;break;case 8:e.p=8,w=e.v,console.error("❌ AudioPlayer v2: Error playing chunk:",w),this.emit("playbackError",w),this.isProcessingPcmQueue=!1;case 9:return e.a(2)}},e,this,[[3,8]])})),function(){return s.apply(this,arguments)})},{key:"createAudioBlob",value:function(e){var t=new Uint8Array(e);console.log("🎵 AudioPlayer: Processing ".concat(t.length," bytes")),console.log("🎵 AudioPlayer: Negotiated format:",this.outputFormat);var A=this.outputFormat&&this.outputFormat.container&&"wav"===this.outputFormat.container.toLowerCase(),n=this.outputFormat&&this.outputFormat.container&&"raw"===this.outputFormat.container.toLowerCase(),o=this.isWavFile(t);if(o&&console.log("🎵 AudioPlayer: Data has WAV header (RIFF)"),n&&o)return console.error("❌ AudioPlayer: CRITICAL MISMATCH!"),console.error(" Negotiated format: RAW"),console.error(" Actual data: WAV (RIFF header detected)"),console.error(" Backend is ignoring format request and sending WAV anyway."),console.warn("⚠️ AudioPlayer: Processing as WAV to avoid playback failure, but UI configuration was bypassed."),this.handleWavFile(t);if(n&&!o)console.log("🎵 AudioPlayer: Processing as RAW data (as negotiated)");else{if(A&&o)return console.log("✅ AudioPlayer: Processing as WAV file (matches negotiation)"),this.handleWavFile(t);if(A&&!o)return console.warn("⚠️ AudioPlayer: Negotiated WAV but data lacks WAV header. Attempting WAV processing anyway."),this.handleWavFile(t);if(!this.outputFormat&&o)return console.log("🎵 AudioPlayer: No format negotiated, auto-detecting WAV"),this.handleWavFile(t);this.outputFormat||o||(console.warn("⚠️ AudioPlayer: No format negotiated and data not WAV, using defaults"),this.outputFormat=this.getDefaultFormat())}return this.outputFormat||(console.warn("⚠️ AudioPlayer: No format set, using defaults"),this.outputFormat=this.getDefaultFormat()),console.log("🎵 AudioPlayer: Processing as RAW data with encoding:",this.outputFormat.encoding),this.handleRawData(t)}},{key:"isWavFile",value:function(e){return e.length>=44&&82===e[0]&&73===e[1]&&70===e[2]&&70===e[3]}},{key:"handleWavFile",value:function(e){var t=this.parseWavHeader(e);if(console.log("🎵 WAV file detected:",{format:t.audioFormat,encoding:this.getEncodingName(t.audioFormat),sampleRate:t.sampleRate,channels:t.channels,bitDepth:t.bitsPerSample}),1===t.audioFormat)return console.log("✅ PCM WAV - using directly"),new Blob([e],{type:"audio/wav"});var A=this.getCodecForWavFormat(t.audioFormat);if(!A)throw new Error("Unsupported WAV format code: ".concat(t.audioFormat));console.log("🔄 Non-PCM WAV - converting to PCM WAV");var n=e.slice(44),o=A.decode(n),r=this.createWavHeader(o.byteLength,t.sampleRate,t.channels,16);return new Blob([r,o],{type:"audio/wav"})}},{key:"handleRawData",value:function(e){var t,A,n=this.outputFormat.encoding.toLowerCase(),o=this.getCodec(n);if(!o)throw new Error("No codec found for encoding: ".concat(n));if(console.log("🎵 AudioPlayer: Decoding ".concat(n.toUpperCase()," to PCM")),console.log("🎵 AudioPlayer: Input format - bitDepth: ".concat(this.outputFormat.bitDepth,", sampleRate: ").concat(this.outputFormat.sampleRate)),"pcm"===n){var r=this.outputFormat.bitDepth||16;e.length,24===r?(console.warn("⚠️ AudioPlayer: Format says 24-bit PCM, but browser support is limited."),console.warn(" Treating as 16-bit PCM. If audio sounds wrong, backend should send 16-bit instead."),t=this.convert24BitTo16Bit(e),A=16):8===r?(console.log("🔄 AudioPlayer: Converting 8-bit PCM to 16-bit PCM"),t=this.convert8BitTo16Bit(e),A=16):(t=e.buffer,A=r,console.log("✅ AudioPlayer: Using native ".concat(r,"-bit PCM (no conversion needed)")))}else t=o.decode(e),A=16,console.log("🔄 AudioPlayer: Decoded ".concat(n.toUpperCase()," to 16-bit PCM"));var i=this.createWavHeader(t.byteLength,this.outputFormat.sampleRate,this.outputFormat.channels,A);return new Blob([i,t],{type:"audio/wav"})}},{key:"convert24BitTo16Bit",value:function(e){for(var t=Math.floor(e.length/3),A=new Int16Array(t),n=0;n<t;n++){var o=e[3*n],r=e[3*n+1],i=e[3*n+2],a=o|r<<8|(255&i)<<16;128&i&&(a|=4278190080),A[n]=Math.max(-32768,Math.min(32767,Math.round(a/256)))}return A.buffer}},{key:"convert8BitTo16Bit",value:function(e){for(var t=e.length,A=new Int16Array(t),n=0;n<t;n++){var o=e[n];A[n]=256*(o-128)}return A.buffer}},{key:"getCodec",value:function(e){var t={pcm:"pcm",linear:"pcm",l16:"pcm",pcmu:"pcmu",ulaw:"pcmu",mulaw:"pcmu",g711u:"pcmu",pcma:"pcma",alaw:"pcma",g711a:"pcma"}[e.toLowerCase()];return this.codecs[t]}},{key:"getCodecForWavFormat",value:function(e){switch(e){case 1:return this.codecs.pcm;case 6:return this.codecs.pcma;case 7:return this.codecs.pcmu;default:return null}}},{key:"getEncodingName",value:function(e){switch(e){case 1:return"PCM";case 6:return"A-law";case 7:return"μ-law";default:return"Unknown (".concat(e,")")}}},{key:"parseWavHeader",value:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{audioFormat:t.getUint16(20,!0),channels:t.getUint16(22,!0),sampleRate:t.getUint32(24,!0),byteRate:t.getUint32(28,!0),blockAlign:t.getUint16(32,!0),bitsPerSample:t.getUint16(34,!0)}}},{key:"createWavHeader",value:function(e,t,A,n){var o=new ArrayBuffer(44),r=new DataView(o);return r.setUint32(0,1380533830,!1),r.setUint32(4,36+e,!0),r.setUint32(8,1463899717,!1),r.setUint32(12,1718449184,!1),r.setUint32(16,16,!0),r.setUint16(20,1,!0),r.setUint16(22,A,!0),r.setUint32(24,t,!0),r.setUint32(28,t*A*n/8,!0),r.setUint16(32,A*n/8,!0),r.setUint16(34,n,!0),r.setUint32(36,1684108385,!1),r.setUint32(40,e,!0),o}},{key:"waitForAudioContextReady",value:(a=F(C().m(function e(){var t,A,n,o=this;return C().w(function(e){for(;;)switch(e.n){case 0:if(console.log("🔍 [waitForAudioContextReady] ENTRY - audioContext exists:",!!this.audioContext),this.audioContext||(console.log("🔍 [waitForAudioContextReady] Creating AudioContext..."),this.initializeAudioContext(),console.log("🔍 [waitForAudioContextReady] After initializeAudioContext - state:",null===(t=this.audioContext)||void 0===t?void 0:t.state,"currentTime:",null===(A=this.audioContext)||void 0===A?void 0:A.currentTime)),this.audioContext){e.n=1;break}return console.error("❌ AudioPlayer: Failed to create AudioContext"),e.a(2,Promise.resolve());case 1:if(n=this.audioContext,console.log("🔍 [waitForAudioContextReady] Initial state:",n.state,"currentTime:",n.currentTime),"running"!==n.state){e.n=2;break}return console.log("🔍 [waitForAudioContextReady] Already running - returning immediately, currentTime:",n.currentTime),e.a(2,Promise.resolve());case 2:if("suspended"!==n.state){e.n=5;break}return console.log("🔍 [waitForAudioContextReady] State is suspended - calling resume()..."),e.n=3,n.resume();case 3:if(console.log("🔍 [waitForAudioContextReady] After resume() - state:",n.state,"currentTime:",n.currentTime),"running"===n.state){e.n=4;break}return console.log("🔍 [waitForAudioContextReady] Still not running after resume() - waiting for statechange event..."),e.a(2,new Promise(function(e){var t=setTimeout(function(){n&&o._waitForReadyStateHandler&&(n.removeEventListener("statechange",o._waitForReadyStateHandler),o._waitForReadyStateHandler=null),console.warn("⚠️ AudioPlayer: AudioContext did not become running within timeout - proceeding anyway, state:",null==n?void 0:n.state,"currentTime:",null==n?void 0:n.currentTime),e()},2e3),A=function(){if(console.log("🔍 [waitForAudioContextReady] statechange event fired - state:",null==n?void 0:n.state,"currentTime:",null==n?void 0:n.currentTime),!n)return clearTimeout(t),o._waitForReadyStateHandler=null,console.warn("⚠️ AudioPlayer: AudioContext became null during state change"),void e();"running"===n.state&&(clearTimeout(t),o._waitForReadyStateHandler&&(n.removeEventListener("statechange",o._waitForReadyStateHandler),o._waitForReadyStateHandler=null),console.log("✅ [waitForAudioContextReady] AudioContext became running via statechange, currentTime:",n.currentTime),e())};o._waitForReadyStateHandler=A,n.addEventListener("statechange",A),console.log("🔍 [waitForAudioContextReady] Synchronous check - state:",null==n?void 0:n.state),n&&"running"===n.state&&(clearTimeout(t),o._waitForReadyStateHandler&&(n.removeEventListener("statechange",o._waitForReadyStateHandler),o._waitForReadyStateHandler=null),console.log("✅ [waitForAudioContextReady] State became running synchronously, currentTime:",n.currentTime),e())}));case 4:console.log("🔍 [waitForAudioContextReady] State is running after resume() - returning, currentTime:",n.currentTime);case 5:if("closed"!==n.state){e.n=6;break}return console.warn("⚠️ AudioPlayer: AudioContext was closed, recreating..."),this.initializeAudioContext(),e.a(2,this.waitForAudioContextReady());case 6:return console.log("🔍 [waitForAudioContextReady] EXIT - state:",n.state,"currentTime:",n.currentTime),e.a(2,Promise.resolve())}},e,this)})),function(){return a.apply(this,arguments)})},{key:"initializeAudioContext",value:function(){var e,t,A=(null===(e=this.outputFormat)||void 0===e?void 0:e.sampleRate)||44100;if(48e3!==A&&44100!==A&&(console.log("ℹ️ AudioPlayer: Backend requested ".concat(A,"Hz, but browser may resample")),console.log(" Consider requesting 44100Hz or 48000Hz from backend to avoid resampling and improve quality")),this.audioContext){var n=this.audioContext.sampleRate;if(!(Math.abs(n-A)>100))return;console.warn("⚠️ AudioPlayer: AudioContext sample rate (".concat(n,"Hz) doesn't match format (").concat(A,"Hz), recreating...")),this.stopImmediate(),this._cleanupAudioContext()}console.log("🎵 AudioPlayer: Creating AudioContext at ".concat(A,"Hz (from outputFormat: ").concat((null===(t=this.outputFormat)||void 0===t?void 0:t.sampleRate)||"not set",")"));try{this.audioContext=new(window.AudioContext||window.webkitAudioContext)({sampleRate:A,latencyHint:"playback"}),console.log("✅ AudioContext created at ".concat(this.audioContext.sampleRate,"Hz (requested: ").concat(A,"Hz)")),Math.abs(this.audioContext.sampleRate-A)>100?(console.error("❌ CRITICAL: Browser sample rate mismatch!"),console.error(" Requested: ".concat(A,"Hz")),console.error(" Got: ".concat(this.audioContext.sampleRate,"Hz")),console.error(" This WILL cause audio distortion/noise!"),console.error(" Solution: Backend should send ".concat(this.audioContext.sampleRate,"Hz audio instead"))):this.audioContext.sampleRate!==A&&(console.warn("⚠️ Browser adjusted sample rate: ".concat(A,"Hz → ").concat(this.audioContext.sampleRate,"Hz")),console.warn(" Browser will automatically resample audio.")),this.setupAudioContextStateMonitoring(),this.gainNode=this.audioContext.createGain(),this.gainNode.gain.value=1,this.gainNode.connect(this.audioContext.destination),console.log("✅ AudioPlayer: GainNode created for volume control"),this._primeAudioContext()}catch(e){console.error("❌ Failed to create AudioContext:",e),this.audioContext=new(window.AudioContext||window.webkitAudioContext),console.log("ℹ️ Using browser default: ".concat(this.audioContext.sampleRate,"Hz")),this.setupAudioContextStateMonitoring(),this.gainNode=this.audioContext.createGain(),this.gainNode.gain.value=1,this.gainNode.connect(this.audioContext.destination),console.log("✅ AudioPlayer: GainNode created for volume control (fallback)"),this._primeAudioContext()}}},{key:"_primeAudioContext",value:(i=F(C().m(function e(){var t,A,n,o;return C().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,this.audioContext&&!this._audioContextPrimed){e.n=1;break}return e.a(2);case 1:return t=this.audioContext.sampleRate,A=this.audioContext.createBuffer(1,.15*t,t),(n=this.audioContext.createBufferSource()).buffer=A,n.connect(this.audioContext.destination),n.start(),e.n=2,new Promise(function(e){return setTimeout(e,150)});case 2:this._audioContextPrimed=!0,console.log("✅ AudioPlayer: Audio hardware primed with silent buffer"),e.n=4;break;case 3:e.p=3,o=e.v,console.error("❌ AudioPlayer: Audio priming failed:",o);case 4:return e.a(2)}},e,this,[[0,3]])})),function(){return i.apply(this,arguments)})},{key:"_cleanupAudioContext",value:function(){if(console.log("[TTP AudioPlayer] 🧹 Cleaning up AudioContext (refactored method)"),this.gainNode){try{this.gainNode.disconnect()}catch(e){}this.gainNode=null}this._audioContextStateChangeHandler&&this.audioContext&&(this.audioContext.removeEventListener("statechange",this._audioContextStateChangeHandler),this._audioContextStateChangeHandler=null),this._waitForReadyStateHandler&&this.audioContext&&(this.audioContext.removeEventListener("statechange",this._waitForReadyStateHandler),this._waitForReadyStateHandler=null),this.audioContext&&"closed"!==this.audioContext.state&&this.audioContext.close(),this.audioContext=null,this._audioContextPrimed=!1}},{key:"setupAudioContextStateMonitoring",value:function(){var e=this;this.audioContext&&(this._audioContextStateChangeHandler&&this.audioContext.removeEventListener("statechange",this._audioContextStateChangeHandler),this._audioContextStateChangeHandler=function(){e.audioContext?(console.log("🎵 AudioPlayer: AudioContext state changed to: ".concat(e.audioContext.state)),"suspended"===e.audioContext.state&&e.isPlaying?console.warn("⚠️ AudioPlayer: AudioContext suspended during playback"):"running"===e.audioContext.state&&!e.isPlaying&&(e.audioQueue.length>0||e.pcmChunkQueue.length>0||e.preparedBuffer.length>0)&&(console.log("✅ AudioPlayer: AudioContext resumed - resuming queue processing"),e.audioQueue.length>0&&!e.isProcessingQueue&&setTimeout(function(){return e.processQueue()},50),e.pcmChunkQueue.length>0&&!e.isProcessingPcmQueue&&setTimeout(function(){return e.processPcmQueue()},50),e.preparedBuffer.length>0&&!e.isSchedulingFrames&&setTimeout(function(){return e.scheduleFrames()},50))):console.warn("⚠️ AudioPlayer: State change handler fired but AudioContext is null")},this.audioContext.addEventListener("statechange",this._audioContextStateChangeHandler))}},{key:"processQueue",value:(r=F(C().m(function e(){var t,A,n,o,r,i,a,s,c=this;return C().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!this._isStopped){e.n=1;break}return console.log("🛑 AudioPlayer: Not processing queue - playback was stopped (barge-in)"),e.a(2);case 1:if(!this.isProcessingQueue&&0!==this.audioQueue.length){e.n=2;break}return e.a(2);case 2:if(this.isProcessingQueue=!0,t=this.audioQueue.shift()){e.n=3;break}return this.isProcessingQueue=!1,e.a(2);case 3:return e.p=3,A=!this.isPlaying&&null===this.currentSource,this.audioContext||this.initializeAudioContext(),e.n=4,this.waitForAudioContextReady();case 4:return n=this.audioContext,e.n=5,t.arrayBuffer();case 5:return o=e.v,e.n=6,n.decodeAudioData(o);case 6:r=e.v,i=A&&!this.isPlaying&&null===this.currentSource,(a=n.createBufferSource()).buffer=r,a.connect(this.gainNode||n.destination),this.currentSource=a,this.isPlaying=!0,i&&this.emit("playbackStarted"),a.onended=function(){c.currentSource=null,c.isProcessingQueue=!1,c.audioQueue.length>0?setTimeout(function(){return c.processQueue()},50):setTimeout(function(){0!==c.audioQueue.length||c.currentSource||(c.isPlaying=!1,c.emit("playbackStopped"))},100)},a.start(),e.n=8;break;case 7:e.p=7,s=e.v,console.error("❌ AudioPlayer v2: Error processing queue:",s),this.currentSource=null,this.emit("playbackError",s),this.audioQueue.length>0?(this.isProcessingQueue=!1,setTimeout(function(){return c.processQueue()},100)):(this.isPlaying=!1,this.isProcessingQueue=!1,this.emit("playbackStopped"));case 8:return e.a(2)}},e,this,[[3,7]])})),function(){return r.apply(this,arguments)})},{key:"stop",value:function(){this.stopImmediate()}},{key:"reset",value:function(){this.stop(),this.audioQueue=[],this.pcmChunkQueue=[]}},{key:"stopImmediate",value:function(){var e=this.isPlaying||null!==this.currentSource||this.scheduledSources.size>0;if(console.log("🛑 AudioPlayer.stopImmediate() called"),console.log(" isPlaying:",this.isPlaying),console.log(" currentSource:",null!==this.currentSource),console.log(" scheduledSources.size:",this.scheduledSources.size),console.log(" scheduledBuffers:",this.scheduledBuffers),this._isStopped=!0,this.isSchedulingFrames=!1,this.currentSource){try{console.log(" Stopping currentSource..."),this.currentSource.stop()}catch(e){console.log(" currentSource already stopped or error:",e.message)}this.currentSource=null}if(this.scheduledSources.size>0){console.log(" Stopping ".concat(this.scheduledSources.size," scheduled sources..."));var t=0,A=Array.from(this.scheduledSources),n=A.length;this.scheduledSources.clear(),this.scheduledBuffers=0;for(var o=0,r=A;o<r.length;o++){var i=r[o];try{i.stop(),t++}catch(e){console.log(" Source already stopped or not started:",e.message)}}console.log(" Stopped ".concat(t," sources (cleared ").concat(n," from scheduledSources)"))}this.isPlaying=!1,this.isProcessingQueue=!1,this.audioQueue=[],this.pcmChunkQueue=[],this.preparedBuffer=[],this.isProcessingPcmQueue=!1,this.isSchedulingFrames=!1,this._emptySentenceTimeout&&(clearTimeout(this._emptySentenceTimeout),this._emptySentenceTimeout=null),this.nextStartTime=0,this.clearTranscriptState(),e&&(console.log("🛑 AudioPlayer: Emitting playbackStopped event (stopImmediate called)"),this.emit("playbackStopped"))}},{key:"markNewSentence",value:function(e){var t=this,A=this._isStopped,n=this.isPlaying||this.scheduledSources.size>0;this._isStopped?(console.log("🛑 AudioPlayer: Clearing stopped flag - new audio starting after barge-in"),this._isStopped=!1,this.nextStartTime=0,this.scheduledBuffers<0&&console.log("🔄 AudioPlayer: scheduledBuffers was negative (".concat(this.scheduledBuffers,"), resetting to 0")),this.scheduledBuffers=0,this.preparedBuffer.length>0&&console.log("🔄 AudioPlayer: Clearing ".concat(this.preparedBuffer.length," prepared frames from previous sentence (after barge-in)")),this.preparedBuffer=[],this.pcmChunkQueue.length>0&&console.log("🔄 AudioPlayer: Clearing ".concat(this.pcmChunkQueue.length," raw PCM chunks from previous sentence (after barge-in)")),this.pcmChunkQueue=[],this.isProcessingPcmQueue=!1,console.log("🔄 AudioPlayer: Reset scheduling state for new sentence (after barge-in)")):n&&console.log("📝 AudioPlayer: New sentence queued while audio playing - will start after current sentence finishes"),this.pendingSentenceText=e,console.log('📝 AudioPlayer: New sentence marked: "'.concat(e.substring(0,40),'..." (wasStopped: ').concat(A,", isPlaying: ").concat(n,")")),this._emptySentenceTimeout&&clearTimeout(this._emptySentenceTimeout);var o=e;this._emptySentenceTimeout=setTimeout(function(){t.pendingSentenceText!==o||0!==t.scheduledBuffers||0!==t.preparedBuffer.length||0!==t.pcmChunkQueue.length||t._isStopped||(console.warn('⚠️ AudioPlayer: Empty sentence detected after 5s timeout - no chunks received for: "'.concat(o.substring(0,40),'..."')),t.pendingSentenceText===o&&(t.pendingSentenceText=null),t.isPlaying||0!==t.scheduledSources.size||(console.log("🛑 AudioPlayer: Emitting playbackStopped for empty sentence timeout"),t.emit("playbackStopped"))),t._emptySentenceTimeout=null},5e3)}},{key:"startTranscriptChecker",value:function(){var e=this;if(!this.isCheckingTranscripts){this.isCheckingTranscripts=!0,console.log("📝 AudioPlayer: Transcript checker started");var t=function(){if(e.isCheckingTranscripts&&e.audioContext){var A,n=e.audioContext.currentTime,o=function(e,t){var A="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!A){if(Array.isArray(e)||(A=function(e,t){if(e){if("string"==typeof e)return y(e,t);var A={}.toString.call(e).slice(8,-1);return"Object"===A&&e.constructor&&(A=e.constructor.name),"Map"===A||"Set"===A?Array.from(e):"Arguments"===A||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A)?y(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){A&&(e=A);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){A=A.call(e)},n:function(){var e=A.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==A.return||A.return()}finally{if(a)throw r}}}}(e.sentenceTimings);try{for(o.s();!(A=o.n()).done;){var r=A.value;!r.displayed&&n>=r.startTime&&(r.displayed=!0,console.log("📝 AudioPlayer: Display transcript at ".concat(n.toFixed(3),'s: "').concat(r.text.substring(0,40),'..."')),e.emit("transcriptDisplay",{text:r.text}))}}catch(e){o.e(e)}finally{o.f()}e.isPlaying||e.scheduledBuffers>0?requestAnimationFrame(t):(e.isCheckingTranscripts=!1,console.log("📝 AudioPlayer: Transcript checker stopped"))}};requestAnimationFrame(t)}}},{key:"clearTranscriptState",value:function(){this.pendingSentenceText=null,this.sentenceTimings=[],this.isCheckingTranscripts=!1,console.log("📝 AudioPlayer: Transcript state cleared")}},{key:"resumeAudioContext",value:(o=F(C().m(function e(){var t;return C().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this.audioContext&&"closed"!==this.audioContext.state){e.n=2;break}return e.n=1,this.initializeAudioContext();case 1:return e.a(2);case 2:if("suspended"!==this.audioContext.state){e.n=6;break}return e.p=3,e.n=4,this.audioContext.resume();case 4:console.log("✅ AudioPlayer v2: AudioContext resumed after mic permission"),e.n=6;break;case 5:e.p=5,t=e.v,console.warn("⚠️ AudioPlayer v2: Failed to resume AudioContext:",t);case 6:return e.a(2)}},e,this,[[3,5]])})),function(){return o.apply(this,arguments)})},{key:"setVolume",value:function(e){this.gainNode?(this.gainNode.gain.value=Math.max(0,Math.min(1,e)),console.log("🔊 AudioPlayer: Volume set to ".concat(this.gainNode.gain.value))):console.warn("⚠️ AudioPlayer: Cannot set volume - gainNode not initialized")}},{key:"setMuted",value:function(e){this.setVolume(e?0:1)}},{key:"getStatus",value:function(){return{isPlaying:this.isPlaying,isProcessingQueue:this.isProcessingQueue,queueLength:this.audioQueue.length,audioContextState:this.audioContext?this.audioContext.state:"closed",outputFormat:this.outputFormat,scheduledBuffers:this.scheduledBuffers,preparedBufferLength:this.preparedBuffer.length,scheduledSourcesCount:this.scheduledSources.size}}},{key:"destroy",value:function(){this.stop(),this._cleanupAudioContext(),this.removeAllListeners()}}],n&&U(A.prototype,n),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,n,o,r,i,a,s,c,l}(a);function H(e){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H(e)}function D(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,P(n.key),n)}}function P(e){var t=function(e){if("object"!=H(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=H(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==H(t)?t:t+""}var O=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.events={}},t=[{key:"on",value:function(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t)}},{key:"off",value:function(e,t){this.events[e]&&(this.events[e]=this.events[e].filter(function(e){return e!==t}))}},{key:"emit",value:function(e){for(var t=arguments.length,A=new Array(t>1?t-1:0),n=1;n<t;n++)A[n-1]=arguments[n];this.events[e]&&this.events[e].forEach(function(t){try{t.apply(void 0,A)}catch(t){console.error("Error in event listener for ".concat(e,":"),t)}})}},{key:"removeAllListeners",value:function(e){e?delete this.events[e]:this.events={}}}],t&&D(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function K(e){return K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},K(e)}function M(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),A.push.apply(A,n)}return A}function L(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?M(Object(A),!0).forEach(function(t){R(e,t,A[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):M(Object(A)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}return e}function R(e,t,A){return(t=z(t))in e?Object.defineProperty(e,t,{value:A,enumerable:!0,configurable:!0,writable:!0}):e[t]=A,e}function _(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return V(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(V(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,V(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,V(u,"constructor",c),V(c,"constructor",s),s.displayName="GeneratorFunction",V(c,o,"GeneratorFunction"),V(u),V(u,o,"Generator"),V(u,n,function(){return this}),V(u,"toString",function(){return"[object Generator]"}),(_=function(){return{w:r,m:d}})()}function V(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}V=function(e,t,A,n){function r(t,A){V(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},V(e,t,A,n)}function j(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function N(e){return function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){j(r,n,o,i,a,"next",e)}function a(e){j(r,n,o,i,a,"throw",e)}i(void 0)})}}function G(e,t){(null==t||t>e.length)&&(t=e.length);for(var A=0,n=Array(t);A<t;A++)n[A]=e[A];return n}function W(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,z(n.key),n)}}function z(e){var t=function(e){if("object"!=K(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=K(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==K(t)?t:t+""}function X(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(X=function(){return!!e})()}function J(e){return J=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},J(e)}function Y(e,t){return Y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Y(e,t)}var q=function(e){function t(e){var A;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(A=function(e,t,A){return t=J(t),function(e,t){if(t&&("object"==K(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,X()?Reflect.construct(t,A||[],J(e).constructor):t.apply(e,A))}(this,t)).config=e,A.audioContext=null,A.audioWorkletNode=null,A.mediaStream=null,A.isRecording=!1,A}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Y(e,t)}(t,e),A=t,n=[{key:"getAudioProcessorPath",value:function(){if(this.config.audioProcessorPath)return this.config.audioProcessorPath;var e,t=function(e,t){var A="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!A){if(Array.isArray(e)||(A=function(e,t){if(e){if("string"==typeof e)return G(e,t);var A={}.toString.call(e).slice(8,-1);return"Object"===A&&e.constructor&&(A=e.constructor.name),"Map"===A||"Set"===A?Array.from(e):"Arguments"===A||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A)?G(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){A&&(e=A);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){A=A.call(e)},n:function(){var e=A.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==A.return||A.return()}finally{if(a)throw r}}}}(document.getElementsByTagName("script"));try{for(t.s();!(e=t.n()).done;){var A=e.value.src;if(A&&(A.includes("agent-widget.js")||A.includes("ttp-agent-sdk")))try{new URL(A);var n=A.substring(0,A.lastIndexOf("/"));return"".concat(n,"/audio-processor.js")}catch(e){var o=A.substring(0,A.lastIndexOf("/"));return"".concat(o,"/audio-processor.js")}}}catch(e){t.e(e)}finally{t.f()}return"https://cdn.talktopc.com/audio-processor.js"}},{key:"checkPermissionState",value:function(){var e=N(_().m(function e(){var t;return _().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!navigator.permissions||!navigator.permissions.query){e.n=2;break}return e.n=1,navigator.permissions.query({name:"microphone"});case 1:return t=e.v,e.a(2,t.state);case 2:e.n=4;break;case 3:e.p=3,e.v,console.log("⚠️ AudioRecorder: Permissions API not available or not supported for microphone");case 4:return e.a(2,null)}},e,null,[[0,3]])}));return function(){return e.apply(this,arguments)}}()},{key:"requestPermission",value:(a=N(_().m(function e(){var t,A,n,o;return _().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.checkPermissionState();case 1:if("granted"!==e.v){e.n=2;break}return console.log("✅ AudioRecorder: Microphone permission already granted"),e.a(2,!0);case 2:return console.log("🎤 AudioRecorder: Requesting microphone permission..."),t=this.config.sampleRate||this.config.outputSampleRate||44100,A={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},n=this.config.audioConstraints?L(L({},A),this.config.audioConstraints):A,e.n=3,navigator.mediaDevices.getUserMedia({audio:L({sampleRate:t,channelCount:1},n)});case 3:return e.v.getTracks().forEach(function(e){return e.stop()}),console.log("✅ AudioRecorder: Microphone permission granted"),e.a(2,!0);case 4:return e.p=4,o=e.v,console.error("❌ AudioRecorder: Failed to get microphone permission:",o),e.a(2,!1)}},e,this,[[0,4]])})),function(){return a.apply(this,arguments)})},{key:"start",value:(i=N(_().m(function e(){var t,A,n,o,r,i,a,s,c,l,u,d,p,h=this;return _().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,console.log("🎤 AudioRecorder: Requesting microphone access..."),e.n=1,this.checkPermissionState();case 1:return(t=e.v)&&(console.log("📋 AudioRecorder: Current permission state: ".concat(t)),"denied"===t&&console.warn('⚠️ AudioRecorder: Permission state is "denied" - browser may not show prompt. User may need to change in browser settings.')),A=this.config.sampleRate||this.config.outputSampleRate||44100,n={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},o=this.config.audioConstraints?L(L({},n),this.config.audioConstraints):n,e.n=2,navigator.mediaDevices.getUserMedia({audio:L({sampleRate:A,channelCount:1},o)});case 2:if(this.mediaStream=e.v,!this.config.checkConnection||"function"!=typeof this.config.checkConnection){e.n=3;break}if(this.config.checkConnection()){e.n=3;break}throw this.mediaStream.getTracks().forEach(function(e){return e.stop()}),this.mediaStream=null,(r=new Error("Connection lost - server may have rejected the call")).name="ServerRejected",r.isServerRejection=!0,r;case 3:if(this.audioContext=new(window.AudioContext||window.webkitAudioContext)({sampleRate:A}),"suspended"!==this.audioContext.state){e.n=4;break}return e.n=4,this.audioContext.resume();case 4:if(!this.config.checkConnection||"function"!=typeof this.config.checkConnection){e.n=6;break}if(this.config.checkConnection()){e.n=6;break}if(this.mediaStream.getTracks().forEach(function(e){return e.stop()}),this.mediaStream=null,!this.audioContext||"closed"===this.audioContext.state){e.n=5;break}return e.n=5,this.audioContext.close();case 5:throw this.audioContext=null,(i=new Error("Connection lost - server may have rejected the call")).name="ServerRejected",i.isServerRejection=!0,i;case 6:return a=this.getAudioProcessorPath(),e.n=7,this.audioContext.audioWorklet.addModule(a);case 7:if(!this.config.checkConnection||"function"!=typeof this.config.checkConnection){e.n=9;break}if(this.config.checkConnection()){e.n=9;break}if(this.mediaStream.getTracks().forEach(function(e){return e.stop()}),this.mediaStream=null,!this.audioContext||"closed"===this.audioContext.state){e.n=8;break}return e.n=8,this.audioContext.close();case 8:throw this.audioContext=null,(s=new Error("Connection lost - server may have rejected the call")).name="ServerRejected",s.isServerRejection=!0,s;case 9:this.audioWorkletNode=new AudioWorkletNode(this.audioContext,"audio-processor",{processorOptions:{sampleRate:A,outputSampleRate:this.config.outputSampleRate}}),(c=this.audioContext.createMediaStreamSource(this.mediaStream)).connect(this.audioWorkletNode),this.mediaStreamSource=c,this.audioWorkletNode.port.onmessage=function(e){var t=e.data,A=t.type,n=t.data;"pcm_audio_data"===A&&h.emit("audioData",n)},this.audioWorkletNode.port.postMessage({type:"setForceContinuous",data:{enabled:!0}}),console.log("✅ AudioRecorder: Microphone access granted"),this.isRecording=!0,this.emit("recordingStarted"),e.n=15;break;case 10:if(e.p=10,!(p=e.v).isServerRejection&&"ServerRejected"!==p.name){e.n=11;break}throw p;case 11:if(l=p.message,"NotAllowedError"!==p.name&&"PermissionDeniedError"!==p.name){e.n=13;break}return e.n=12,this.checkPermissionState();case 12:"denied"===(u=e.v)?(l='Microphone access was blocked. To enable it: 1) Click the lock icon (🔒) in your browser\'s address bar, 2) Find "Microphone" and change it to "Allow", 3) Refresh this page and try again.',console.error("❌ AudioRecorder: Permission explicitly denied. User must change in browser settings.")):"prompt"===u?(l='Microphone permission was denied. Click the "Voice Call" button again to see the permission prompt.',console.error('❌ AudioRecorder: Permission denied but state is "prompt" - user can try again.')):(l="Microphone permission was denied. Click the button again to retry, or enable microphone access in your browser settings (lock icon 🔒 in address bar).",console.error("❌ AudioRecorder: Permission denied. User can try again or change in browser settings.")),e.n=14;break;case 13:"NotFoundError"===p.name||"DevicesNotFoundError"===p.name?(l="No microphone found. Please connect a microphone and try again.",console.error("❌ AudioRecorder: No microphone device found.")):"NotReadableError"===p.name||"TrackStartError"===p.name?(l="Microphone is already in use by another application. Please close other apps using the microphone and try again.",console.error("❌ AudioRecorder: Microphone is busy or not readable.")):"SecurityError"!==p.name&&"PermissionDeniedError"!==p.name||(l="Microphone access blocked. On mobile devices, please tap the recording button directly (not from an iframe or popup).",console.error("❌ AudioRecorder: User agent blocked microphone access. This often happens on mobile when not called from direct user interaction."));case 14:throw(d=new Error(l)).name=p.name,d.originalError=p,this.emit("error",d),d;case 15:return e.a(2)}},e,this,[[0,10]])})),function(){return i.apply(this,arguments)})},{key:"stop",value:(r=N(_().m(function e(){var t;return _().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this.isRecording){e.n=1;break}return e.a(2);case 1:if(e.p=1,this.mediaStreamSource)try{console.log("🛑 AudioRecorder: Disconnecting media stream source to stop audio flow..."),this.mediaStreamSource.disconnect(),this.mediaStreamSource=null,console.log("✅ AudioRecorder: Media stream source disconnected")}catch(e){console.warn("⚠️ AudioRecorder: Error disconnecting source:",e)}if(!this.audioWorkletNode){e.n=4;break}return console.log("🛑 AudioRecorder: Sending stop message to AudioWorklet to stop VAD..."),this.audioWorkletNode.port.postMessage({type:"stop"}),e.n=2,new Promise(function(e){return setTimeout(e,150)});case 2:return this.audioWorkletNode.port.postMessage({type:"flush"}),e.n=3,new Promise(function(e){return setTimeout(e,50)});case 3:try{this.audioWorkletNode.disconnect(),console.log("✅ AudioRecorder: AudioWorkletNode disconnected")}catch(e){console.log("⚠️ AudioRecorder: AudioWorkletNode already disconnected")}case 4:if(this.mediaStream&&(console.log("🛑 AudioRecorder: Stopping media stream tracks..."),this.mediaStream.getTracks().forEach(function(e){e.stop(),console.log("✅ AudioRecorder: Stopped track:",e.kind)}),this.mediaStream=null),!this.audioContext||"closed"===this.audioContext.state){e.n=6;break}return console.log("🛑 AudioRecorder: Closing AudioContext..."),e.n=5,this.audioContext.close();case 5:this.audioContext=null,console.log("✅ AudioRecorder: AudioContext closed");case 6:this.audioWorkletNode=null,this.isRecording=!1,this.emit("recordingStopped"),console.log("✅ AudioRecorder: Recording stopped, VAD should be stopped"),e.n=8;break;case 7:throw e.p=7,t=e.v,this.emit("error",t),t;case 8:return e.a(2)}},e,this,[[1,7]])})),function(){return r.apply(this,arguments)})},{key:"resumeAudioContext",value:(o=N(_().m(function e(){var t,A;return _().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this.isRecording&&this.audioContext){e.n=1;break}return e.a(2);case 1:if(e.p=1,"suspended"!==this.audioContext.state){e.n=3;break}return console.log("🔄 AudioRecorder: Resuming suspended AudioContext..."),e.n=2,this.audioContext.resume();case 2:console.log("✅ AudioRecorder: AudioContext resumed");case 3:this.mediaStream&&0===(t=this.mediaStream.getAudioTracks()).filter(function(e){return"live"===e.readyState}).length&&t.length>0&&(console.warn("⚠️ AudioRecorder: All audio tracks are inactive. Recording may have stopped."),this.emit("tracksInactive")),e.n=5;break;case 4:e.p=4,A=e.v,console.error("❌ AudioRecorder: Failed to resume AudioContext:",A),this.emit("error",A);case 5:return e.a(2)}},e,this,[[1,4]])})),function(){return o.apply(this,arguments)})},{key:"getStatus",value:function(){return{isRecording:this.isRecording,audioContextState:this.audioContext?this.audioContext.state:"closed"}}},{key:"destroy",value:function(){this.stop()}}],n&&W(A.prototype,n),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,n,o,r,i,a}(O);function Z(e){return Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Z(e)}function $(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ee(n.key),n)}}function ee(e){var t=function(e){if("object"!=Z(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Z(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Z(t)?t:t+""}const te=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return t=e,A=[{key:"extractPcmFromWav",value:function(e){var t=e instanceof Uint8Array?e:new Uint8Array(e);if(t.length<44)throw new Error("WAV data too short (< 44 bytes)");if("RIFF"!==String.fromCharCode(t[0],t[1],t[2],t[3]))throw new Error("Not a valid WAV file - missing RIFF header");if("WAVE"!==String.fromCharCode(t[8],t[9],t[10],t[11]))throw new Error("Not a valid WAV file - missing WAVE format");for(var A=t[22]|t[23]<<8,n=t[24]|t[25]<<8|t[26]<<16|t[27]<<24,o=t[34]|t[35]<<8,r=-1,i=12;i<t.length-8;i+=4){if("data"===String.fromCharCode(t[i],t[i+1],t[i+2],t[i+3])){r=i;break}i+=4+(t[i+4]|t[i+5]<<8|t[i+6]<<16|t[i+7]<<24)}if(-1===r)throw new Error("No data chunk found in WAV");var a=t[r+4]|t[r+5]<<8|t[r+6]<<16|t[r+7]<<24,s=r+8,c=Math.min(a,t.length-s);return{pcmData:t.slice(s,s+c).buffer,format:{sampleRate:n,channels:A,bitDepth:o}}}},{key:"isWavFile",value:function(e){return e.length>=44&&82===e[0]&&73===e[1]&&70===e[2]&&70===e[3]}},{key:"createWavHeader",value:function(e,t,A,n){var o=new ArrayBuffer(44),r=new DataView(o);return r.setUint32(0,1380533830,!1),r.setUint32(4,36+e,!0),r.setUint32(8,1463899717,!1),r.setUint32(12,1718449184,!1),r.setUint32(16,16,!0),r.setUint16(20,1,!0),r.setUint16(22,A,!0),r.setUint32(24,t,!0),r.setUint32(28,t*A*n/8,!0),r.setUint16(32,A*n/8,!0),r.setUint16(34,n,!0),r.setUint32(36,1684108385,!1),r.setUint32(40,e,!0),o}},{key:"wrapPcmInWav",value:function(t,A){var n=e.createWavHeader(t.byteLength,A.sampleRate,A.channels||1,A.bitDepth||16),o=new Uint8Array(n.byteLength+t.byteLength);return o.set(new Uint8Array(n),0),o.set(new Uint8Array(t),n.byteLength),o.buffer}}],null&&$(t.prototype,null),A&&$(t,A),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,A}();function Ae(e){return Ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ae(e)}function ne(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,oe(n.key),n)}}function oe(e){var t=function(e){if("object"!=Ae(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Ae(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ae(t)?t:t+""}const re=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.codecs={pcm:new u,pcmu:new g,pcma:new B}},(t=[{key:"decodeToPcm",value:function(e,t){var A=null==t?void 0:t.toLowerCase();if(!A||"pcm"===A)return e instanceof ArrayBuffer?e:e instanceof Uint8Array?e.buffer:e;var n=this.codecs[A];if(!n)throw new Error("Unsupported encoding: ".concat(t));var o=e instanceof Uint8Array?e:new Uint8Array(e);return n.decode(o)}},{key:"encodeFromPcm",value:function(e,t){var A=null==t?void 0:t.toLowerCase();if(!A||"pcm"===A)return e;var n=this.codecs[A];if(!n)throw new Error("Unsupported target encoding: ".concat(t));var o=n.encode(e);return o instanceof Uint8Array?o.buffer:o}},{key:"getCodec",value:function(e){var t=null==e?void 0:e.toLowerCase();return this.codecs[t]||null}}])&&ne(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function ie(e){return ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ie(e)}function ae(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,se(n.key),n)}}function se(e){var t=function(e){if("object"!=ie(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=ie(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ie(t)?t:t+""}const ce=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return t=e,A=[{key:"convert",value:function(t,A,n){if(A===n)return t;if(8===A)throw new Error("Source bit depth cannot be 8-bit (only 16-bit or 24-bit supported)");var o=A/8,r=n/8,i=t.byteLength/o;if(new ArrayBuffer(i*r),16===A&&16===n)return t;if(24===A&&16===n)return e.convert24To16(t);if(16===A&&24===n)return e.convert16To24(t);if(16===A&&8===n)return e.convert16To8(t);if(24===A&&8===n)return e.convert24To8(t);throw new Error("Unsupported bit depth conversion: ".concat(A,"-bit → ").concat(n,"-bit"))}},{key:"convert24To16",value:function(e){for(var t=new Uint8Array(e),A=Math.floor(t.length/3),n=new Int16Array(A),o=0;o<A;o++){var r=t[3*o],i=t[3*o+1],a=t[3*o+2],s=r|i<<8|(255&a)<<16;128&a&&(s|=4278190080),n[o]=Math.max(-32768,Math.min(32767,Math.round(s/256)))}return n.buffer}},{key:"convert16To24",value:function(e){for(var t=new Int16Array(e),A=new Uint8Array(3*t.length),n=0;n<t.length;n++){var o=256*t[n];A[3*n]=255&o,A[3*n+1]=o>>8&255,A[3*n+2]=o>>16&255}return A.buffer}},{key:"convert16To8",value:function(e){for(var t=new Int16Array(e),A=new Uint8Array(t.length),n=0;n<t.length;n++){var o=t[n];A[n]=Math.max(0,Math.min(255,Math.round(o/256+128)))}return A.buffer}},{key:"convert24To8",value:function(t){var A=e.convert24To16(t);return e.convert16To8(A)}}],null&&ae(t.prototype,null),A&&ae(t,A),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,A}();function le(e){return le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},le(e)}function ue(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return de(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(de(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,de(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,de(u,"constructor",c),de(c,"constructor",s),s.displayName="GeneratorFunction",de(c,o,"GeneratorFunction"),de(u),de(u,o,"Generator"),de(u,n,function(){return this}),de(u,"toString",function(){return"[object Generator]"}),(ue=function(){return{w:r,m:d}})()}function de(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}de=function(e,t,A,n){function r(t,A){de(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},de(e,t,A,n)}function pe(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function he(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ge(n.key),n)}}function ge(e){var t=function(e){if("object"!=le(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=le(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==le(t)?t:t+""}const fe=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"resample",value:(A=ue().m(function e(t,A,n){var o,r,i,a,s,c,l,u,d,p,h,g,f;return ue().w(function(e){for(;;)switch(e.n){case 0:if(A!==n){e.n=1;break}return e.a(2,t);case 1:for(o=new Int16Array(t),r=new Float32Array(o.length),i=1/32768,a=0;a<o.length;a++)r[a]=o[a]*i;return s=Math.ceil(r.length*n/A),c=new OfflineAudioContext(1,s,n),(l=c.createBuffer(1,r.length,A)).getChannelData(0).set(r),(u=c.createBufferSource()).buffer=l,u.connect(c.destination),u.start(),e.n=2,c.startRendering();case 2:for(d=e.v,p=d.getChannelData(0),h=new Int16Array(p.length),g=0;g<p.length;g++)f=Math.max(-1,Math.min(1,p[g])),h[g]=Math.round(32767*f);return e.a(2,h.buffer)}},e)}),n=function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(e){pe(r,n,o,i,a,"next",e)}function a(e){pe(r,n,o,i,a,"throw",e)}i(void 0)})},function(e,t,A){return n.apply(this,arguments)})}],t&&he(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,A,n}();function me(e){return me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},me(e)}function ve(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Be(n.key),n)}}function Be(e){var t=function(e){if("object"!=me(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=me(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==me(t)?t:t+""}const we=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return t=e,A=[{key:"convert",value:function(t,A,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:16;if(A===n)return t;if(1===A&&1===n)return t;if(1===A&&2===n)return e.monoToStereo(t,o);if(2===A&&1===n)return e.stereoToMono(t,o);throw new Error("Unsupported channel conversion: ".concat(A," → ").concat(n))}},{key:"monoToStereo",value:function(e,t){for(var A=t/8,n=e.byteLength/A,o=new ArrayBuffer(n*A*2),r=new Uint8Array(e),i=new Uint8Array(o),a=0;a<n;a++)for(var s=a*A,c=a*A*2,l=0;l<A;l++)i[c+l]=r[s+l],i[c+A+l]=r[s+l];return o}},{key:"stereoToMono",value:function(e,t){var A=t/8,n=e.byteLength/(2*A),o=new ArrayBuffer(n*A),r=new Uint8Array(e),i=new Uint8Array(o);if(16===t)for(var a=0;a<n;a++){var s=a*A*2,c=s+A,l=(r[s]|r[s+1]<<8)<<16>>16,u=(r[c]|r[c+1]<<8)<<16>>16,d=Math.round((l+u)/2),p=a*A;i[p]=255&d,i[p+1]=d>>8&255}else for(var h=0;h<n;h++)for(var g=h*A*2,f=h*A,m=0;m<A;m++)i[f+m]=r[g+m];return o}}],null&&ve(t.prototype,null),A&&ve(t,A),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,A}();function ye(e){return ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ye(e)}function be(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Ce(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Ce(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Ce(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Ce(u,"constructor",c),Ce(c,"constructor",s),s.displayName="GeneratorFunction",Ce(c,o,"GeneratorFunction"),Ce(u),Ce(u,o,"Generator"),Ce(u,n,function(){return this}),Ce(u,"toString",function(){return"[object Generator]"}),(be=function(){return{w:r,m:d}})()}function Ce(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Ce=function(e,t,A,n){function r(t,A){Ce(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},Ce(e,t,A,n)}function xe(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),A.push.apply(A,n)}return A}function Qe(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?xe(Object(A),!0).forEach(function(t){Fe(e,t,A[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):xe(Object(A)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}return e}function Fe(e,t,A){return(t=ke(t))in e?Object.defineProperty(e,t,{value:A,enumerable:!0,configurable:!0,writable:!0}):e[t]=A,e}function Ue(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function Se(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ke(n.key),n)}}function ke(e){var t=function(e){if("object"!=ye(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=ye(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ye(t)?t:t+""}const Ee=function(){return e=function e(t,A){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.requestedFormat=t,this.actualFormat=A,this.encodingConverter=new re,this.conversionSteps=[],this._analyzeConversions()},t=[{key:"_analyzeConversions",value:function(){this.conversionSteps=[],this.actualFormat.container!==this.requestedFormat.container&&("wav"===this.actualFormat.container?this.conversionSteps.push("extract_wav"):"wav"===this.requestedFormat.container&&this.conversionSteps.push("wrap_wav")),this.actualFormat.encoding!==this.requestedFormat.encoding&&("pcm"!==this.actualFormat.encoding&&this.conversionSteps.push("decode_encoding"),"pcm"!==this.requestedFormat.encoding&&this.conversionSteps.push("encode_encoding")),this.actualFormat.sampleRate!==this.requestedFormat.sampleRate&&this.conversionSteps.push("resample"),this.actualFormat.bitDepth!==this.requestedFormat.bitDepth&&this.conversionSteps.push("convert_bitdepth"),this.actualFormat.channels!==this.requestedFormat.channels&&this.conversionSteps.push("convert_channels")}},{key:"needsConversion",value:function(){return this.conversionSteps.length>0}},{key:"getConversionSteps",value:function(){var e=[];return this.conversionSteps.includes("extract_wav")&&e.push("Extract PCM from WAV (".concat(this.actualFormat.container," → raw)")),this.conversionSteps.includes("decode_encoding")&&e.push("Decode ".concat(this.actualFormat.encoding.toUpperCase()," → PCM")),this.conversionSteps.includes("resample")&&e.push("Resample ".concat(this.actualFormat.sampleRate,"Hz → ").concat(this.requestedFormat.sampleRate,"Hz")),this.conversionSteps.includes("convert_bitdepth")&&e.push("Convert bit depth ".concat(this.actualFormat.bitDepth,"-bit → ").concat(this.requestedFormat.bitDepth,"-bit")),this.conversionSteps.includes("convert_channels")&&e.push("Convert channels ".concat(this.actualFormat.channels," → ").concat(this.requestedFormat.channels)),this.conversionSteps.includes("encode_encoding")&&e.push("Encode PCM → ".concat(this.requestedFormat.encoding.toUpperCase())),this.conversionSteps.includes("wrap_wav")&&e.push("Wrap in WAV container (raw → ".concat(this.requestedFormat.container,")")),e}},{key:"convert",value:(A=be().m(function e(t){var A,n,o,r;return be().w(function(e){for(;;)switch(e.n){case 0:if(this.needsConversion()){e.n=1;break}return e.a(2,t instanceof ArrayBuffer?t:t.buffer);case 1:if(A=t instanceof ArrayBuffer?t:t.buffer,n=Qe({},this.actualFormat),this.conversionSteps.includes("extract_wav")&&(o=te.extractPcmFromWav(A),A=o.pcmData,n=Qe(Qe({},n),{},{container:"raw",sampleRate:o.format.sampleRate,channels:o.format.channels,bitDepth:o.format.bitDepth}),console.log("🔄 AudioFormatConverter: Extracted PCM from WAV",o.format)),this.conversionSteps.includes("decode_encoding")&&(A=this.encodingConverter.decodeToPcm(A,n.encoding),n.encoding="pcm",n.bitDepth=16,console.log("🔄 AudioFormatConverter: Decoded ".concat(this.actualFormat.encoding.toUpperCase()," → PCM"))),24===n.bitDepth&&n.bitDepth!==this.requestedFormat.bitDepth&&(this.conversionSteps.includes("resample")||this.conversionSteps.includes("convert_channels")||24!==this.requestedFormat.bitDepth)&&(A=ce.convert(A,24,16),n.bitDepth=16,console.log("🔄 AudioFormatConverter: Normalized 24-bit → 16-bit PCM")),!this.conversionSteps.includes("resample")){e.n=3;break}return e.n=2,fe.resample(A,n.sampleRate,this.requestedFormat.sampleRate);case 2:A=e.v,n.sampleRate=this.requestedFormat.sampleRate,console.log("🔄 AudioFormatConverter: Resampled ".concat(this.actualFormat.sampleRate,"Hz → ").concat(this.requestedFormat.sampleRate,"Hz"));case 3:return this.conversionSteps.includes("convert_channels")&&(A=we.convert(A,n.channels,this.requestedFormat.channels,n.bitDepth),n.channels=this.requestedFormat.channels,console.log("🔄 AudioFormatConverter: Converted channels ".concat(this.actualFormat.channels," → ").concat(this.requestedFormat.channels))),this.conversionSteps.includes("convert_bitdepth")&&(A=ce.convert(A,n.bitDepth,this.requestedFormat.bitDepth),n.bitDepth=this.requestedFormat.bitDepth,console.log("🔄 AudioFormatConverter: Converted bit depth ".concat(this.actualFormat.bitDepth,"-bit → ").concat(this.requestedFormat.bitDepth,"-bit"))),this.conversionSteps.includes("encode_encoding")&&(r=this.encodingConverter.encodeFromPcm(A,this.requestedFormat.encoding),A=r instanceof ArrayBuffer?r:r.buffer,n.encoding=this.requestedFormat.encoding,console.log("🔄 AudioFormatConverter: Encoded PCM → ".concat(this.requestedFormat.encoding.toUpperCase()))),this.conversionSteps.includes("wrap_wav")&&(A=te.wrapPcmInWav(A,n),n.container="wav",console.log("🔄 AudioFormatConverter: Wrapped in WAV container")),console.log("✅ AudioFormatConverter: Conversion complete"),e.a(2,A)}},e,this)}),n=function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(e){Ue(r,n,o,i,a,"next",e)}function a(e){Ue(r,n,o,i,a,"throw",e)}i(void 0)})},function(e){return n.apply(this,arguments)})}],t&&Se(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,A,n}();function Ie(e){return Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ie(e)}function Te(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return He(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(He(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,He(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,He(u,"constructor",c),He(c,"constructor",s),s.displayName="GeneratorFunction",He(c,o,"GeneratorFunction"),He(u),He(u,o,"Generator"),He(u,n,function(){return this}),He(u,"toString",function(){return"[object Generator]"}),(Te=function(){return{w:r,m:d}})()}function He(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}He=function(e,t,A,n){function r(t,A){He(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},He(e,t,A,n)}function De(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function Pe(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Oe(n.key),n)}}function Oe(e){var t=function(e){if("object"!=Ie(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Ie(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ie(t)?t:t+""}const Ke=function(){return e=function e(t){var A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return null};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.handlers=new Map,this.sendMessage=t,this.getConversationId=A},t=[{key:"registerHandler",value:function(e,t){if("function"!=typeof t)throw new Error("Handler for tool '".concat(e,"' must be a function"));this.handlers.set(e,t),console.log("🔧 ClientTools: Registered handler for '".concat(e,"'"))}},{key:"unregisterHandler",value:function(e){this.handlers.delete(e),console.log("🔧 ClientTools: Unregistered handler for '".concat(e,"'"))}},{key:"hasHandler",value:function(e){return this.handlers.has(e)}},{key:"getRegisteredTools",value:function(){return Array.from(this.handlers.keys())}},{key:"handleToolCall",value:(A=Te().m(function e(t){var A,n,o,r,i,a,s,c,l,u,d,p,h,g;return Te().w(function(e){for(;;)switch(e.p=e.n){case 0:if(A=t.toolCallId,n=t.toolName,o=t.parameters,r=Date.now(),i=(new Date).toISOString(),console.log("🔧 ClientTools: [".concat(i,"] Received tool call '").concat(n,"' (id: ").concat(A,")")),console.log(" 📋 Full message received:",JSON.stringify(t,null,2)),console.log(" ⏱️ Start time: ".concat(r,"ms (").concat(new Date(r).toISOString(),")")),a=this.handlers.get(n)){e.n=1;break}return s=Array.from(this.handlers.keys()),console.error("🔧 ClientTools: No handler registered for '".concat(n,"'")),console.error(" 📋 Currently registered tools:",s),console.error(" 📋 Total registered: ".concat(s.length)),this.sendError(A,n,"No handler registered for tool '".concat(n,"'"),"NO_HANDLER",r),e.a(2);case 1:return e.p=1,e.n=2,a(o);case 2:c=e.v,l=Date.now()-r,console.log("🔧 ClientTools: Tool '".concat(n,"' completed in ").concat(l,"ms")),this.sendResult(A,n,c,l),e.n=4;break;case 3:e.p=3,g=e.v,p=Date.now()-r,console.error("🔧 ClientTools: Tool '".concat(n,"' failed:"),g),h="EXECUTION_ERROR","NotAllowedError"===g.name||null!==(u=g.message)&&void 0!==u&&u.includes("permission")?h="PERMISSION_DENIED":("NotSupportedError"===g.name||null!==(d=g.message)&&void 0!==d&&d.includes("not supported"))&&(h="API_UNAVAILABLE"),this.sendError(A,n,g.message||"Unknown error",h,p);case 4:return e.a(2)}},e,this,[[1,3]])}),n=function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(e){De(r,n,o,i,a,"next",e)}function a(e){De(r,n,o,i,a,"throw",e)}i(void 0)})},function(e){return n.apply(this,arguments)})},{key:"sendResult",value:function(e,t,A,n){var o=this.getConversationId(),r=(new Date).toISOString(),i={t:"client_tool_result",toolCallId:e,toolName:t,conversationId:o,result:A,executionTimeMs:n};console.log("🔧 ClientTools: [".concat(r,"] Sending result for tool '").concat(t,"'")),console.log(" 📋 toolCallId: ".concat(e)),console.log(" 📋 conversationId: ".concat(o||"null")),console.log(" 📋 toolName: ".concat(t)),console.log(" 📋 result:",A),console.log(" 📋 Full message:",JSON.stringify(i,null,2)),this.sendMessage(i),console.log("✅ ClientTools: Result message sent at ".concat(r))}},{key:"sendError",value:function(e,t,A,n,o){var r="number"==typeof o?Date.now()-o:o,i=(new Date).toISOString(),a=this.getConversationId(),s={t:"client_tool_error",toolCallId:e,toolName:t,conversationId:a,error:A,errorCode:n,executionTimeMs:r};console.log("🔧 ClientTools: [".concat(i,"] Sending error for tool '").concat(t,"'")),console.log(" 📋 toolCallId: ".concat(e)),console.log(" 📋 conversationId: ".concat(a||"null")),console.log(" 📋 toolName: ".concat(t)),console.log(" 📋 error: ".concat(A,", errorCode: ").concat(n)),console.log(" 📋 Full message:",JSON.stringify(s,null,2)),this.sendMessage(s),console.log("✅ ClientTools: Error message sent at ".concat(i))}},{key:"setSendMessage",value:function(e){this.sendMessage=e}}],t&&Pe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,A,n}();var Me=A(354),Le=A.n(Me);function Re(e){return Re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Re(e)}function _e(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Ve(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Ve(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Ve(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Ve(u,"constructor",c),Ve(c,"constructor",s),s.displayName="GeneratorFunction",Ve(c,o,"GeneratorFunction"),Ve(u),Ve(u,o,"Generator"),Ve(u,n,function(){return this}),Ve(u,"toString",function(){return"[object Generator]"}),(_e=function(){return{w:r,m:d}})()}function Ve(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Ve=function(e,t,A,n){function r(t,A){Ve(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},Ve(e,t,A,n)}function je(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),A.push.apply(A,n)}return A}function Ne(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?je(Object(A),!0).forEach(function(t){Ge(e,t,A[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):je(Object(A)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}return e}function Ge(e,t,A){return(t=function(e){var t=function(e){if("object"!=Re(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Re(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Re(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:A,enumerable:!0,configurable:!0,writable:!0}):e[t]=A,e}function We(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}var ze={useCORS:!0,allowTaint:!1,backgroundColor:"#ffffff",scale:1,logging:!1,imageTimeout:15e3};function Xe(){return Je.apply(this,arguments)}function Je(){var e;return e=_e().m(function e(){var t,A,n,o,r,i,a,s,c,l,u,d,p,h,g,f,m,v,B,w,y,b,C,x,Q,F,U=arguments;return _e().w(function(e){for(;;)switch(e.p=e.n){case 0:if(A=(t=U.length>0&&void 0!==U[0]?U[0]:{}).selector,n=void 0===A?null:A,o=t.format,r=void 0===o?"jpeg":o,i=t.quality,a=void 0===i?.85:i,s=t.scale,c=void 0===s?1:s,l=t.maxWidth,u=void 0===l?1280:l,d=t.maxHeight,p=void 0===d?1280:d,h=t.fullPage,g=void 0!==h&&h,console.log("📸 SDK Screenshot: Starting capture with options:",t),f=Date.now(),e.p=1,m=document.body,!n){e.n=3;break}if(v=document.querySelector(n)){e.n=2;break}throw new Error("Element not found: ".concat(n));case 2:m=v,console.log("📸 SDK Screenshot: Capturing element: ".concat(n)),e.n=4;break;case 3:console.log("📸 SDK Screenshot: Capturing entire page");case 4:return B=Ne(Ne({},ze),{},{scale:c}),g&&!n&&(B.windowHeight=document.documentElement.scrollHeight,B.height=document.documentElement.scrollHeight,B.y=0),e.n=5,Le()(m,B);case 5:return w=e.v,console.log("📸 SDK Screenshot: Canvas created (".concat(w.width,"x").concat(w.height,")")),y=w,(u||p)&&(y=Ye(w,u,p))!==w&&console.log("📸 SDK Screenshot: Resized to ".concat(y.width,"x").concat(y.height)),b="jpeg"===r?"image/jpeg":"image/png",C=y.toDataURL(b,"jpeg"===r?a:void 0),x=C.split(",")[1],Q=Date.now()-f,console.log("📸 SDK Screenshot: Capture completed in ".concat(Q,"ms")),console.log("📸 SDK Screenshot: Size: ".concat(Math.round(x.length/1024),"KB")),e.a(2,{image:x,mimeType:b,width:y.width,height:y.height,captureTimeMs:Q,selector:n||"body"});case 6:throw e.p=6,F=e.v,console.error("📸 SDK Screenshot: Capture failed:",F),new Error("Screenshot capture failed: ".concat(F.message));case 7:return e.a(2)}},e,null,[[1,6]])}),Je=function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){We(r,n,o,i,a,"next",e)}function a(e){We(r,n,o,i,a,"throw",e)}i(void 0)})},Je.apply(this,arguments)}function Ye(e,t,A){var n=e.width,o=e.height,r=1;if(t&&n>t&&(r=Math.min(r,t/n)),A&&o>A&&(r=Math.min(r,A/o)),1===r)return e;var i=Math.round(n*r),a=Math.round(o*r),s=document.createElement("canvas");return s.width=i,s.height=a,s.getContext("2d").drawImage(e,0,0,i,a),s}function qe(e,t){var A="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!A){if(Array.isArray(e)||(A=function(e,t){if(e){if("string"==typeof e)return Ze(e,t);var A={}.toString.call(e).slice(8,-1);return"Object"===A&&e.constructor&&(A=e.constructor.name),"Map"===A||"Set"===A?Array.from(e):"Arguments"===A||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A)?Ze(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){A&&(e=A);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){A=A.call(e)},n:function(){var e=A.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==A.return||A.return()}finally{if(a)throw r}}}}function Ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var A=0,n=Array(t);A<t;A++)n[A]=e[A];return n}var $e={types:["password"],names:["cc","card","credit","cvv","cvc","csc","expir","cardnumber","card-number","card_number","cardholder","card-holder","card_holder","password","pwd","passwd","pass","secret","token","auth","api-key","apikey","api_key","access-key","accesskey","access_key","secret-key","secretkey","secret_key","private-key","privatekey","private_key","bearer","jwt","ssn","social-security","social_security","socialsecurity","tax-id","taxid","tax_id","national-id","nationalid","national_id","credential","private","secure"],autocomplete:["cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc","cc-name","cc-type","current-password","new-password"],dataAttributes:["data-secret","data-sensitive","data-private","data-api-key","data-token","data-auth"]};function et(e){if(!e)return!1;var t=(e.type||"").toLowerCase(),A=(e.name||"").toLowerCase(),n=(e.id||"").toLowerCase(),o=(e.className||"").toLowerCase(),r=(e.autocomplete||"").toLowerCase(),i=(e.placeholder||"").toLowerCase(),a=(e.getAttribute("aria-label")||"").toLowerCase(),s="".concat(A," ").concat(n," ").concat(o," ").concat(i," ").concat(a);if($e.types.includes(t))return!0;if($e.autocomplete.includes(r))return!0;var c,l=qe($e.names);try{for(l.s();!(c=l.n()).done;){var u=c.value;if(s.includes(u))return!0}}catch(e){l.e(e)}finally{l.f()}var d,p=qe($e.dataAttributes);try{for(p.s();!(d=p.n()).done;){var h=d.value;if(e.hasAttribute(h))return!0}}catch(e){p.e(e)}finally{p.f()}return"password"===(e.inputMode||"").toLowerCase()}function tt(e){return tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tt(e)}function At(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return nt(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(nt(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,nt(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,nt(u,"constructor",c),nt(c,"constructor",s),s.displayName="GeneratorFunction",nt(c,o,"GeneratorFunction"),nt(u),nt(u,o,"Generator"),nt(u,n,function(){return this}),nt(u,"toString",function(){return"[object Generator]"}),(At=function(){return{w:r,m:d}})()}function nt(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}nt=function(e,t,A,n){function r(t,A){nt(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},nt(e,t,A,n)}function ot(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),A.push.apply(A,n)}return A}function rt(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(A),!0).forEach(function(t){it(e,t,A[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):ot(Object(A)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}return e}function it(e,t,A){return(t=function(e){var t=function(e){if("object"!=tt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=tt(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==tt(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:A,enumerable:!0,configurable:!0,writable:!0}):e[t]=A,e}function at(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function st(e,t){var A="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!A){if(Array.isArray(e)||(A=function(e,t){if(e){if("string"==typeof e)return ct(e,t);var A={}.toString.call(e).slice(8,-1);return"Object"===A&&e.constructor&&(A=e.constructor.name),"Map"===A||"Set"===A?Array.from(e):"Arguments"===A||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A)?ct(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){A&&(e=A);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){A=A.call(e)},n:function(){var e=A.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==A.return||A.return()}finally{if(a)throw r}}}}function ct(e,t){(null==t||t>e.length)&&(t=e.length);for(var A=0,n=Array(t);A<t;A++)n[A]=e[A];return n}var lt={buttons:20,links:30,forms:5,fieldsPerForm:15,sections:10,headings:15,maxTextLength:100,maxSummaryLength:150};function ut(e){var t,A;if(!e||!e.tagName)return null;if(null!==(t=e.dataset)&&void 0!==t&&t.testid)return'[data-testid="'.concat(e.dataset.testid,'"]');if(null!==(A=e.dataset)&&void 0!==A&&A.cy)return'[data-cy="'.concat(e.dataset.cy,'"]');var n=e.getAttribute("aria-label");if(n&&n.length<50)return'[aria-label="'.concat(n.replace(/"/g,'\\"'),'"]');if(e.id&&!dt(e.id))return"#".concat(CSS.escape(e.id));if(e.name){var o=e.tagName.toLowerCase();return"".concat(o,'[name="').concat(e.name,'"]')}if(["BUTTON","A"].includes(e.tagName)){var r,i=null===(r=e.innerText)||void 0===r?void 0:r.trim();if(i&&i.length<30&&i.length>0){var a=e.tagName.toLowerCase(),s=document.querySelectorAll("".concat(a));if(1===Array.from(s).filter(function(e){var t;return(null===(t=e.innerText)||void 0===t?void 0:t.trim())===i}).length)return"".concat(a,':contains("').concat(i.replace(/"/g,'\\"'),'")')}}return function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,A=[],n=e,o=0;n&&n!==document.body&&o<t;){var r=n.tagName.toLowerCase();if(n.id&&!dt(n.id)){A.unshift("#".concat(CSS.escape(n.id)));break}var i=pt(n);if(i)A.unshift("".concat(r,".").concat(i));else{var a,s=null===(a=n.parentElement)||void 0===a?void 0:a.children;if(s&&s.length>1){var c=Array.from(s).indexOf(n)+1;A.unshift("".concat(r,":nth-child(").concat(c,")"))}else A.unshift(r)}n=n.parentElement,o++}return A.join(" > ")}(e)}function dt(e){return[/^:r[0-9a-z]+:$/,/^react-/i,/^ng-/i,/^vue-/i,/^ember[0-9]+/i,/^_[a-z0-9]{8,}$/i,/^[a-f0-9]{8}-[a-f0-9]{4}/i,/^uid-/i,/^id[0-9]+$/i].some(function(t){return t.test(e)})}function pt(e){var t=Array.from(e.classList||[]),A=[/^(flex|grid|block|inline|hidden)$/,/^(m|p|w|h|min|max)-/,/^(text|font|bg|border)-/,/^(col|row)-/,/^(sm|md|lg|xl|2xl):/,/^hover:|focus:|active:/,/^[a-z]{1,3}-[0-9]+$/];return t.filter(function(e){return!A.some(function(t){return t.test(e)})&&e.length>2&&e.length<30})[0]||null}function ht(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,A=e.getBoundingClientRect();return A.bottom>=-t&&A.top<=window.innerHeight+t&&A.right>=0&&A.left<=window.innerWidth}function gt(e){if(!e)return!1;var t=window.getComputedStyle(e);return"none"!==t.display&&"hidden"!==t.visibility&&"0"!==t.opacity&&e.offsetWidth>0&&e.offsetHeight>0}function ft(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lt,A=[],n=st(document.querySelectorAll('button, [type="submit"], [type="button"], [role="button"], .btn, .button'));try{for(n.s();!(e=n.n()).done;){var o=e.value;if(A.length>=t.buttons)break;if(gt(o)){var r=(o.innerText||o.value||o.getAttribute("aria-label")||"").trim();r&&A.push({selector:ut(o),text:r.substring(0,t.maxTextLength),type:o.type||"button",disabled:o.disabled||!1,inViewport:ht(o,0)})}}}catch(e){n.e(e)}finally{n.f()}return A}function mt(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lt,A=[],n=document.querySelectorAll("a[href]"),o=window.location.origin,r=st(n);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(A.length>=t.links)break;if(gt(i)){var a=(i.innerText||i.getAttribute("aria-label")||"").trim();if(a&&!(a.length<2)){var s=i.href;if(s&&!s.startsWith("javascript:")&&"#"!==s){var c=!1;try{c=new URL(s).origin===o}catch(e){}A.push({selector:ut(i),text:a.substring(0,t.maxTextLength),href:s,internal:c,inViewport:ht(i,0)})}}}}}catch(e){r.e(e)}finally{r.f()}return A}function vt(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lt,A=[],n=0,o=st(document.querySelectorAll("form"));try{for(o.s();!(e=o.n()).done;){var r=e.value;if(A.length>=t.forms)break;if(gt(r)){var i,a=[],s=st(r.querySelectorAll("input, textarea, select"));try{for(s.s();!(i=s.n()).done;){var c,l,u=i.value;if(a.length>=t.fieldsPerForm)break;if("hidden"!==u.type)if(et(u))n++;else{var d=null;if(u.id){var p,h=document.querySelector('label[for="'.concat(u.id,'"]'));d=null==h||null===(p=h.innerText)||void 0===p?void 0:p.trim()}!d&&u.getAttribute("aria-label")&&(d=u.getAttribute("aria-label")),!d&&u.placeholder&&(d=u.placeholder),a.push({selector:ut(u),name:u.name||null,type:u.type||"text",label:(null===(c=d)||void 0===c?void 0:c.substring(0,50))||null,placeholder:(null===(l=u.placeholder)||void 0===l?void 0:l.substring(0,50))||null,required:u.required||!1})}}}catch(e){s.e(e)}finally{s.f()}0!==a.length&&A.push({selector:ut(r),id:r.id||null,action:r.action||null,method:(r.method||"get").toUpperCase(),fields:a})}}}catch(e){o.e(e)}finally{o.f()}return{forms:A,sensitiveCount:n}}function Bt(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lt,A=[],n=st(document.querySelectorAll('section, article, main, [role="main"], [role="region"], .section'));try{for(n.s();!(e=n.n()).done;){var o,r,i,a=e.value;if(A.length>=t.sections)break;if(gt(a)){var s=a.querySelector("h1, h2, h3"),c=(null==s||null===(o=s.innerText)||void 0===o?void 0:o.trim())||"",l=a.querySelector("p"),u=c||(null==l||null===(r=l.innerText)||void 0===r?void 0:r.trim().substring(0,t.maxSummaryLength))||(null===(i=a.innerText)||void 0===i?void 0:i.trim().substring(0,t.maxSummaryLength))||"";A.push({selector:ut(a),id:a.id||null,tagName:a.tagName.toLowerCase(),summary:u.substring(0,t.maxSummaryLength),inViewport:ht(a,0)})}}}catch(e){n.e(e)}finally{n.f()}return A}function wt(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lt,A=[],n=st(document.querySelectorAll("h1, h2, h3"));try{for(n.s();!(e=n.n()).done;){var o,r=e.value;if(A.length>=t.headings)break;if(gt(r)){var i=null===(o=r.innerText)||void 0===o?void 0:o.trim();i&&A.push({selector:ut(r),level:r.tagName.toLowerCase(),text:i.substring(0,t.maxTextLength),inViewport:ht(r,0)})}}}catch(e){n.e(e)}finally{n.f()}return A}function yt(){return bt.apply(this,arguments)}function bt(){return e=At().m(function e(){var t,A,n,o,r,i,a,s,c,l,u,d,p,h,g,f=arguments;return At().w(function(e){for(;;)if(0===e.n)return A=f.length>0&&void 0!==f[0]?f[0]:{},n=rt(rt({},lt),A.limits),o=ft(n),r=mt(n),i=vt(n),a=i.forms,s=i.sensitiveCount,c=Bt(n),l=wt(n),u=o.length+r.length+a.reduce(function(e,t){return e+t.fields.length},0)+c.length+l.length,d=o.filter(function(e){return e.inViewport}).length+r.filter(function(e){return e.inViewport}).length+c.filter(function(e){return e.inViewport}).length+l.filter(function(e){return e.inViewport}).length,p=document.documentElement.lang||(null===(t=document.querySelector("html"))||void 0===t?void 0:t.getAttribute("lang"))||null,h=navigator.language||navigator.languages&&navigator.languages[0]||null,g=p||h||null,e.a(2,{url:window.location.href,title:document.title,timestamp:Date.now(),language:g,viewport:{width:window.innerWidth,height:window.innerHeight,scrollX:window.scrollX,scrollY:window.scrollY,pageHeight:document.documentElement.scrollHeight},buttons:o,links:r,forms:a,sections:c,headings:l,metadata:{totalElements:u,visibleInViewport:d,formsCount:a.length,sensitiveFieldsFiltered:s}})},e)}),bt=function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){at(r,n,o,i,a,"next",e)}function a(e){at(r,n,o,i,a,"throw",e)}i(void 0)})},bt.apply(this,arguments);var e}function Ct(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return xt(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(xt(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,xt(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,xt(u,"constructor",c),xt(c,"constructor",s),s.displayName="GeneratorFunction",xt(c,o,"GeneratorFunction"),xt(u),xt(u,o,"Generator"),xt(u,n,function(){return this}),xt(u,"toString",function(){return"[object Generator]"}),(Ct=function(){return{w:r,m:d}})()}function xt(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}xt=function(e,t,A,n){function r(t,A){xt(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},xt(e,t,A,n)}function Qt(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function Ft(e){return function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){Qt(r,n,o,i,a,"next",e)}function a(e){Qt(r,n,o,i,a,"throw",e)}i(void 0)})}}function Ut(){return St.apply(this,arguments)}function St(){return St=Ft(Ct().m(function e(){var t,A,n,o,r,i,a,s,c,l,u=arguments;return Ct().w(function(e){for(;;)switch(e.n){case 0:if(n=(A=u.length>0&&void 0!==u[0]?u[0]:{}).selector,o=A.color,r=void 0===o?"#6366f1":o,i=A.duration,a=void 0===i?3e3:i,n){e.n=1;break}return e.a(2,{success:!1,error:"Selector is required"});case 1:if(s=document.querySelector(n)){e.n=2;break}return e.a(2,{success:!1,error:"Element not found: ".concat(n)});case 2:return s.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"}),e.n=3,Mt(400);case 3:return c=s.getBoundingClientRect(),kt(),(l=document.createElement("div")).className="ttp-highlight-overlay",l.style.cssText="\n position: fixed;\n top: ".concat(c.top-4,"px;\n left: ").concat(c.left-4,"px;\n width: ").concat(c.width+8,"px;\n height: ").concat(c.height+8,"px;\n --ttp-highlight-color: ").concat(r,";\n border-color: ").concat(r,";\n box-shadow: 0 0 20px ").concat(r,"80, 0 0 40px ").concat(r,"40;\n pointer-events: none;\n z-index: 2147483647;\n "),document.body.appendChild(l),setTimeout(function(){l.classList.add("ttp-fade-out"),setTimeout(function(){l.remove()},300)},a),e.a(2,{success:!0,selector:n,elementInfo:{tag:s.tagName.toLowerCase(),id:s.id||null,text:(null===(t=s.innerText)||void 0===t?void 0:t.trim().substring(0,100))||null,position:{top:c.top,left:c.left,width:c.width,height:c.height}}})}},e)})),St.apply(this,arguments)}function kt(){if(!document.getElementById("ttp-highlight-styles")){var e=document.createElement("style");e.id="ttp-highlight-styles",e.textContent="\n @keyframes ttp-pulse {\n 0%, 100% {\n box-shadow: 0 0 20px var(--ttp-highlight-color, #6366f1)80,\n 0 0 40px var(--ttp-highlight-color, #6366f1)40;\n }\n 50% {\n box-shadow: 0 0 30px var(--ttp-highlight-color, #6366f1)99,\n 0 0 60px var(--ttp-highlight-color, #6366f1)60;\n }\n }\n \n .ttp-highlight-overlay {\n border: 3px solid var(--ttp-highlight-color, #6366f1);\n border-radius: 8px;\n animation: ttp-pulse 1s ease-in-out infinite;\n transition: opacity 0.3s ease;\n }\n \n .ttp-highlight-overlay.ttp-fade-out {\n opacity: 0;\n }\n \n .ttp-fill-success {\n outline: 3px solid #22c55e !important;\n outline-offset: 2px;\n transition: outline 0.3s ease;\n }\n ",document.head.appendChild(e)}}function Et(){return It.apply(this,arguments)}function It(){return It=Ft(Ct().m(function e(){var t,A,n,o,r,i,a,s,c,l,u,d,p,h,g,f,m,v,B=arguments;return Ct().w(function(e){for(;;)switch(e.n){case 0:if(A=(t=B.length>0&&void 0!==B[0]?B[0]:{}).selector,n=t.x,o=t.y,r=t.direction,i=t.amount,a=void 0===i?500:i,s=t.position,c=void 0===s?"center":s,l=t.behavior,u=void 0===l?"smooth":l,!A){e.n=3;break}if(d=document.querySelector(A)){e.n=1;break}return e.a(2,{success:!1,error:"Element not found: ".concat(A)});case 1:return p="top"===c?"start":"bottom"===c?"end":"center",d.scrollIntoView({behavior:u,block:p,inline:"nearest"}),e.n=2,Mt("smooth"===u?500:100);case 2:return h=d.getBoundingClientRect(),e.a(2,{success:!0,scrollType:"element",selector:A,elementPosition:{top:h.top,left:h.left}});case 3:if("up"!==r&&"down"!==r){e.n=5;break}return g=a||500,f=window.scrollY,m=document.documentElement.scrollHeight-window.innerHeight,v="up"===r?Math.max(0,f-g):Math.min(m,f+g),window.scrollTo({top:v,left:window.scrollX,behavior:u}),e.n=4,Mt("smooth"===u?500:100);case 4:return e.a(2,{success:!0,scrollType:"relative",direction:r,amount:g,scrolledFrom:{y:f},scrolledTo:{y:window.scrollY},atTop:0===window.scrollY,atBottom:window.scrollY>=m-1});case 5:if(void 0===n&&void 0===o){e.n=7;break}return window.scrollTo({top:null!=o?o:window.scrollY,left:null!=n?n:window.scrollX,behavior:u}),e.n=6,Mt("smooth"===u?500:100);case 6:return e.a(2,{success:!0,scrollType:"position",scrolledTo:{x:null!=n?n:window.scrollX,y:null!=o?o:window.scrollY}});case 7:return e.a(2,{success:!1,error:"Either selector, x/y position, or direction (up/down) required"})}},e)})),It.apply(this,arguments)}function Tt(){return Ht.apply(this,arguments)}function Ht(){return Ht=Ft(Ct().m(function e(){var t,A,n,o,r=arguments;return Ct().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t=(r.length>0&&void 0!==r[0]?r[0]:{}).url){e.n=1;break}return e.a(2,{success:!1,error:"URL is required"});case 1:e.p=1,A=new URL(t,window.location.origin),e.n=3;break;case 2:return e.p=2,e.v,e.a(2,{success:!1,error:"Invalid URL: ".concat(t)});case 3:if(["http:","https:"].includes(A.protocol)){e.n=4;break}return e.a(2,{success:!1,error:"Invalid protocol: ".concat(A.protocol)});case 4:if(A.origin===window.location.origin){e.n=7;break}return e.p=5,window.open(A.href,"_blank","noopener,noreferrer"),e.a(2,{success:!0,openedInNewTab:!0,navigatedTo:A.href,message:"Opened external link in a new tab"});case 6:return e.p=6,o=e.v,e.a(2,{success:!1,error:"Failed to open external link in new tab: "+o.message,attempted:A.href});case 7:return n=window.location.href,window.location.href=A.href,e.a(2,{success:!0,navigatedTo:A.href,from:n})}},e,null,[[5,6],[1,2]])})),Ht.apply(this,arguments)}function Dt(){return Pt.apply(this,arguments)}function Pt(){return Pt=Ft(Ct().m(function e(){var t,A,n,o,r,i,a,s,c,l,u,d,p=arguments;return Ct().w(function(e){for(;;)switch(e.n){case 0:if(A=(t=p.length>0&&void 0!==p[0]?p[0]:{}).selector,n=t.value,o=t.triggerEvents,r=void 0===o||o,A){e.n=1;break}return e.a(2,{success:!1,error:"Selector is required"});case 1:if(null!=n){e.n=2;break}return e.a(2,{success:!1,error:"Value is required"});case 2:if(i=document.querySelector(A)){e.n=3;break}return e.a(2,{success:!1,error:"Element not found: ".concat(A)});case 3:if(a=i.tagName.toLowerCase(),["input","textarea","select"].includes(a)){e.n=4;break}return e.a(2,{success:!1,error:"Element is not a form field: ".concat(a)});case 4:if(!et(i)){e.n=5;break}return e.a(2,{success:!1,error:"Cannot fill sensitive fields (password, credit card, etc.)",blocked:!0,fieldType:i.type,fieldName:i.name});case 5:return i.scrollIntoView({behavior:"smooth",block:"center"}),e.n=6,Mt(300);case 6:return i.focus(),"select"===a?(s=Array.from(i.options),c=s.find(function(e){return e.value===n||e.text.toLowerCase()===n.toLowerCase()}),i.value=c?c.value:n):"checkbox"===i.type||"radio"===i.type?(l=!0===n||"true"===n||"1"===n,i.checked=l):i.value=n,r&&(i.dispatchEvent(new Event("input",{bubbles:!0})),i.dispatchEvent(new Event("change",{bubbles:!0})),(d=null===(u=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))||void 0===u?void 0:u.set)&&(d.call(i,n),i.dispatchEvent(new Event("input",{bubbles:!0})))),kt(),i.classList.add("ttp-fill-success"),setTimeout(function(){i.classList.remove("ttp-fill-success")},2e3),e.a(2,{success:!0,selector:A,fieldType:i.type||a,fieldName:i.name||null,filled:!0})}},e)})),Pt.apply(this,arguments)}function Ot(){return Kt.apply(this,arguments)}function Kt(){return Kt=Ft(Ct().m(function e(){var t,A,n,o,r,i,a,s,c,l,u,d,p,h,g,f,m,v,B,w,y,b=arguments;return Ct().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=(A=b.length>0&&void 0!==b[0]?b[0]:{}).selector,o=A.waitForNavigation,r=void 0!==o&&o,i=A.openInNewTab,a=void 0!==i&&i,s=A.isExternal,c=void 0!==s&&s,l=A.href,u=void 0===l?null:l,n){e.n=1;break}return e.a(2,{success:!1,error:"Selector is required"});case 1:if(d=document.querySelector(n)){e.n=2;break}return e.a(2,{success:!1,error:"Element not found: ".concat(n)});case 2:if(0!==(p=d.getBoundingClientRect()).width&&0!==p.height){e.n=3;break}return e.a(2,{success:!1,error:"Element is not visible (zero size)"});case 3:if(!d.disabled){e.n=4;break}return e.a(2,{success:!1,error:"Element is disabled"});case 4:return d.scrollIntoView({behavior:"smooth",block:"center"}),e.n=5,Mt(300);case 5:return(h=document.createElement("div")).style.cssText="\n position: fixed;\n top: ".concat(p.top-2,"px;\n left: ").concat(p.left-2,"px;\n width: ").concat(p.width+4,"px;\n height: ").concat(p.height+4,"px;\n border: 2px solid #22c55e;\n border-radius: 4px;\n pointer-events: none;\n z-index: 2147483647;\n transition: opacity 0.2s;\n "),document.body.appendChild(h),e.n=6,Mt(200);case 6:if(h.remove(),!a&&!c){e.n=9;break}if(!(g=u||d.href||("A"===d.tagName?d.getAttribute("href"):null))||"#"===g||g.startsWith("javascript:")){e.n=9;break}return e.p=7,window.open(g,"_blank","noopener,noreferrer"),e.a(2,{success:!0,selector:n,clicked:!0,openedInNewTab:!0,url:g,elementInfo:{tag:d.tagName.toLowerCase(),text:(null===(f=d.innerText)||void 0===f?void 0:f.trim().substring(0,50))||null},message:"Opened link in a new tab"});case 8:e.p=8,y=e.v,console.warn("[TTP] Failed to open in new tab:",y);case 9:if(!r){e.n=11;break}return v=window.location.href,B=new Promise(function(e){var t=setTimeout(function(){e({navigated:!1})},5e3),A=function(){clearTimeout(t),window.removeEventListener("beforeunload",A),e({navigated:!0})};window.addEventListener("beforeunload",A)}),d.click(),e.n=10,B;case 10:return w=e.v,e.a(2,{success:!0,selector:n,clicked:!0,elementInfo:{tag:d.tagName.toLowerCase(),text:(null===(m=d.innerText)||void 0===m?void 0:m.trim().substring(0,50))||null},navigated:w.navigated||window.location.href!==v});case 11:return d.click(),e.a(2,{success:!0,selector:n,clicked:!0,elementInfo:{tag:d.tagName.toLowerCase(),text:(null===(t=d.innerText)||void 0===t?void 0:t.trim().substring(0,50))||null}})}},e,null,[[7,8]])})),Kt.apply(this,arguments)}function Mt(e){return new Promise(function(t){return setTimeout(t,e)})}function Lt(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Rt(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Rt(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Rt(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Rt(u,"constructor",c),Rt(c,"constructor",s),s.displayName="GeneratorFunction",Rt(c,o,"GeneratorFunction"),Rt(u),Rt(u,o,"Generator"),Rt(u,n,function(){return this}),Rt(u,"toString",function(){return"[object Generator]"}),(Lt=function(){return{w:r,m:d}})()}function Rt(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Rt=function(e,t,A,n){function r(t,A){Rt(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},Rt(e,t,A,n)}function _t(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function Vt(e){return function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){_t(r,n,o,i,a,"next",e)}function a(e){_t(r,n,o,i,a,"throw",e)}i(void 0)})}}function jt(){return(jt=Vt(Lt().m(function e(){var t;return Lt().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,yt();case 1:return t=e.v,e.a(2,{url:t.url,title:t.title,timestamp:t.timestamp,language:t.language,viewport:t.viewport,dom:{buttons:t.buttons,links:t.links,forms:t.forms,sections:t.sections,headings:t.headings,metadata:t.metadata}})}},e)}))).apply(this,arguments)}function Nt(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Gt(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Gt(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Gt(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Gt(u,"constructor",c),Gt(c,"constructor",s),s.displayName="GeneratorFunction",Gt(c,o,"GeneratorFunction"),Gt(u),Gt(u,o,"Generator"),Gt(u,n,function(){return this}),Gt(u,"toString",function(){return"[object Generator]"}),(Nt=function(){return{w:r,m:d}})()}function Gt(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Gt=function(e,t,A,n){function r(t,A){Gt(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},Gt(e,t,A,n)}function Wt(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function zt(e){return function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){Wt(r,n,o,i,a,"next",e)}function a(e){Wt(r,n,o,i,a,"throw",e)}i(void 0)})}}function Xt(e){return Xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xt(e)}function Jt(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),A.push.apply(A,n)}return A}function Yt(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?Jt(Object(A),!0).forEach(function(t){tA(e,t,A[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):Jt(Object(A)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}return e}function qt(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,AA(n.key),n)}}function Zt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Zt=function(){return!!e})()}function $t(e){return $t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$t(e)}function eA(e,t){return eA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},eA(e,t)}function tA(e,t,A){return(t=AA(t))in e?Object.defineProperty(e,t,{value:A,enumerable:!0,configurable:!0,writable:!0}):e[t]=A,e}function AA(e){var t=function(e){if("object"!=Xt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Xt(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Xt(t)?t:t+""}var nA=function(e){function t(){var e,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,A){return t=$t(t),function(e,t){if(t&&("object"==Xt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Zt()?Reflect.construct(t,A||[],$t(e).constructor):t.apply(e,A))}(this,t)).version="2.0.0",e.config={signedUrl:A.signedUrl||A.websocketUrl||"wss://speech.talktopc.com/ws/conv",websocketUrl:A.signedUrl||A.websocketUrl||"wss://speech.talktopc.com/ws/conv",agentId:A.agentId,appId:A.appId,sampleRate:A.sampleRate||16e3,channels:A.channels||1,bitDepth:A.bitDepth||16,audioProcessorPath:A.audioProcessorPath,outputContainer:A.outputContainer||e.getDefaultContainer(A),outputEncoding:A.outputEncoding||A.outputCodec||"pcm",outputSampleRate:A.outputSampleRate||16e3,outputChannels:A.outputChannels||1,outputBitDepth:A.outputBitDepth||16,outputFrameDurationMs:A.outputFrameDurationMs||600,outputCodec:A.outputCodec,agentSettingsOverride:A.agentSettingsOverride||null,visualAssistant:A.visualAssistant||null,variables:A.variables||null,autoReconnect:!1!==A.autoReconnect,audioConstraints:A.audioConstraints||null,protocolVersion:A.protocolVersion||2},e.isConnected=!1,e.hasEverConnected=!1,e.isRecording=!1,e.isPlaying=!1,e.isDestroyed=!1,e.outputAudioFormat=null,e.requestedOutputFormat=null,e.formatConverter=null,e.websocket=null,e.conversationId=null,e.transcriptQueue=[],e.currentPlayingSentenceId=null,e.audioFrameCount=0,e.lastAudioStartTime=0,e.wakeLock=null,e._wakeLockRequesting=!1,e.pendingInjections=new Map,e.injectionCounter=0,e.audioPlayer=new T(e.config);var n=Yt(Yt({},e.config),{},{checkConnection:function(){return e.isConnected&&e.websocket&&e.websocket.readyState===WebSocket.OPEN}});return e.audioRecorder=new q(n),e.setupAudioPlayerEvents(),e.setupAudioRecorderEvents(),e.clientToolsRegistry=new Ke(function(t){return e.sendMessage(t)},function(){return e.conversationId}),e._registerBuiltInTools(),e.validateConfig(),e._setupPageUnloadHandler(),console.log("🎵 VoiceSDK v2 initialized:",{version:e.version,outputContainer:e.config.outputContainer,outputEncoding:e.config.outputEncoding,outputSampleRate:e.config.outputSampleRate}),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eA(e,t)}(t,e),A=t,n=[{key:"_registerBuiltInTools",value:function(){var e=this;console.log("📸 VoiceSDK: _registerBuiltInTools() called"),console.log("📸 VoiceSDK: captureScreenshot available?",void 0!==Xe);try{if(void 0===Xe)return console.error("❌ VoiceSDK: captureScreenshot is undefined - import may have failed"),void console.error(" This will prevent capture_screen tool from working");console.log("📸 VoiceSDK: Registering capture_screen tool, captureScreenshot type:",Xt(Xe)),this.clientToolsRegistry.registerHandler("capture_screen",zt(Nt().m(function t(){var A,n,o,r,i,a,s,c,l,u,d,p,h,g,f,m,v,B=arguments;return Nt().w(function(t){for(;;)switch(t.p=t.n){case 0:return A=B.length>0&&void 0!==B[0]?B[0]:{},console.log("📸 VoiceSDK: capture_screen tool called with params:",A),n=A.selector,o=void 0===n?null:n,r=A.format,i=void 0===r?"jpeg":r,a=A.quality,s=void 0===a?.85:a,c=A.scale,l=void 0===c?1:c,u=A.fullPage,d=void 0!==u&&u,p=A.maxWidth,h=void 0===p?1280:p,g=A.maxHeight,f=void 0===g?1280:g,t.p=1,t.n=2,Xe({selector:o,format:i,quality:s,scale:l,fullPage:d,maxWidth:h,maxHeight:f});case 2:return m=t.v,console.log("📸 VoiceSDK: Screenshot captured: ".concat(m.width,"x").concat(m.height,", ").concat(Math.round(m.image.length/1024),"KB")),e.emit("screenshotCaptured",{width:m.width,height:m.height,sizeKB:Math.round(m.image.length/1024),selector:m.selector}),t.a(2,m);case 3:throw t.p=3,v=t.v,console.error("📸 VoiceSDK: Screenshot capture failed:",v),e.emit("screenshotError",{error:v.message}),v;case 4:return t.a(2)}},t,null,[[1,3]])}))),console.log("📸 VoiceSDK: Built-in capture_screen tool registered")}catch(e){console.error("❌ VoiceSDK: Error registering built-in tools:",e),console.error(" Error details:",e.message,e.stack)}try{!function(e){e.registerHandler("read_page",Vt(Lt().m(function e(){var t,A,n=arguments;return Lt().w(function(e){for(;;)switch(e.n){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] 📋 Reading page structure..."),e.n=1,yt(t);case 1:return A=e.v,console.log("[TTP] ✅ Page structure extracted:",{buttons:A.buttons.length,links:A.links.length,forms:A.forms.length,headings:A.headings.length}),e.a(2,A)}},e)}))),e.registerHandler("highlight_element",Vt(Lt().m(function e(){var t,A,n=arguments;return Lt().w(function(e){for(;;)switch(e.n){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] ✨ Highlighting element:",t.selector),e.n=1,Ut(t);case 1:return(A=e.v).success?console.log("[TTP] ✅ Element highlighted"):console.warn("[TTP] ⚠️ Highlight failed:",A.error),e.a(2,A)}},e)}))),e.registerHandler("scroll_to_element",Vt(Lt().m(function e(){var t,A,n,o,r=arguments;return Lt().w(function(e){for(;;)switch(e.n){case 0:return(t=r.length>0&&void 0!==r[0]?r[0]:{}).selector?console.log("[TTP] 📜 Scrolling to element:",t.selector):t.direction?console.log("[TTP] 📜 Scrolling",t.direction,"by",t.amount||500,"px"):void 0!==t.x||void 0!==t.y?console.log("[TTP] 📜 Scrolling to position:","(".concat(null!==(A=t.x)&&void 0!==A?A:"current",", ").concat(null!==(n=t.y)&&void 0!==n?n:"current",")")):console.log("[TTP] 📜 Scroll called with params:",t),e.n=1,Et(t);case 1:return(o=e.v).success?console.log("[TTP] ✅ Scrolled successfully"):console.warn("[TTP] ⚠️ Scroll failed:",o.error),e.a(2,o)}},e)}))),e.registerHandler("navigate_to",Vt(Lt().m(function e(){var t,A,n=arguments;return Lt().w(function(e){for(;;)switch(e.n){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] 🔗 Navigating to:",t.url),e.n=1,Tt(t);case 1:return(A=e.v).success?console.log("[TTP] ✅ Navigation initiated"):console.warn("[TTP] ⚠️ Navigation blocked:",A.error),e.a(2,A)}},e)}))),e.registerHandler("fill_field",Vt(Lt().m(function e(){var t,A,n=arguments;return Lt().w(function(e){for(;;)switch(e.n){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] 📝 Filling field:",t.selector),e.n=1,Dt(t);case 1:return(A=e.v).success?console.log("[TTP] ✅ Field filled"):console.warn("[TTP] ⚠️ Fill failed:",A.error),e.a(2,A)}},e)}))),e.registerHandler("click_element",Vt(Lt().m(function e(){var t,A,n=arguments;return Lt().w(function(e){for(;;)switch(e.n){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},console.log("[TTP] 👆 Clicking element:",t.selector),e.n=1,Ot(t);case 1:return(A=e.v).success?console.log("[TTP] ✅ Element clicked"):console.warn("[TTP] ⚠️ Click failed:",A.error),e.a(2,A)}},e)})));var t=e.getRegisteredTools(),A=["read_page","highlight_element","scroll_to_element","navigate_to","fill_field","click_element"].filter(function(e){return!t.includes(e)});A.length>0?console.error("[TTP] ❌ Some visual tools failed to register:",A):console.log("[TTP] 👁️ Visual assistant tools registered successfully:",t)}(this.clientToolsRegistry);var t=this.clientToolsRegistry.getRegisteredTools(),A=["read_page","click_element","fill_field","highlight_element","scroll_to_element","navigate_to"],n=t.filter(function(e){return A.includes(e)});if(n.length!==A.length){var o=A.filter(function(e){return!n.includes(e)});console.error("❌ VoiceSDK: Some visual tools failed to register:",o),console.error(" Registered visual tools:",n)}else console.log("✅ VoiceSDK: All visual tools registered:",n)}catch(e){console.error("❌ VoiceSDK: Error registering visual assistant tools:",e),console.error(" Error details:",e.message,e.stack)}var r=this.clientToolsRegistry.getRegisteredTools(),i=["read_page","capture_screen","highlight_element","click_element","fill_field","scroll_to_element","navigate_to"],a=r.filter(function(e){return i.includes(e)});if(a.length!==i.length){var s=i.filter(function(e){return!a.includes(e)});console.error("❌ VoiceSDK: Missing internal tools:",s),console.error(" Expected 7 internal tools:",i),console.error(" Registered:",a)}else console.log("✅ VoiceSDK: All 7 internal tools registered:",a);console.log("🔧 VoiceSDK: All registered tools after _registerBuiltInTools():",r)}},{key:"getStoredConversationId",value:function(){try{if("undefined"==typeof sessionStorage)return console.warn("⚠️ VoiceSDK v2: sessionStorage not available (private mode?)"),null;var e=sessionStorage.getItem(t.RESUME_STORAGE_KEY);if(e){var A=JSON.parse(e);if(A&&A.conversationId)return console.log("📦 VoiceSDK v2: Found stored conversationId:",A.conversationId),A.conversationId}return null}catch(e){return console.warn("⚠️ VoiceSDK v2: Error reading sessionStorage:",e),null}}},{key:"storeConversationId",value:function(e){if(e)try{if("undefined"==typeof sessionStorage)return void console.warn("⚠️ VoiceSDK v2: sessionStorage not available (private mode?)");var A={},n=sessionStorage.getItem(t.RESUME_STORAGE_KEY);if(n)try{A=JSON.parse(n)}catch(e){}A.conversationId=e,A.timestamp=Date.now(),A.fromPage=A.fromPage||window.location.pathname+window.location.search,sessionStorage.setItem(t.RESUME_STORAGE_KEY,JSON.stringify(A)),console.log("💾 VoiceSDK v2: Stored conversationId:",e)}catch(e){console.warn("⚠️ VoiceSDK v2: Error writing to sessionStorage:",e)}}},{key:"clearStoredConversationId",value:function(){try{if("undefined"==typeof sessionStorage)return;sessionStorage.removeItem(t.RESUME_STORAGE_KEY),console.log("🗑️ VoiceSDK v2: Cleared stored conversationId")}catch(e){console.warn("⚠️ VoiceSDK v2: Error clearing sessionStorage:",e)}}},{key:"_getResumeState",value:function(){try{if("undefined"==typeof sessionStorage)return null;var e=sessionStorage.getItem(t.RESUME_STORAGE_KEY);if(!e)return null;var A=JSON.parse(e),n=Date.now()-A.timestamp;return n>t.RESUME_TTL_MS?(console.log("[VoiceSDK] Resume state expired:",n,"ms"),this._clearResumeState(),null):(console.log("[VoiceSDK] Found valid resume state:",A,"age:",n,"ms"),A)}catch(e){return console.warn("[VoiceSDK] Failed to get resume state:",e),null}}},{key:"_clearResumeState",value:function(){try{if("undefined"==typeof sessionStorage)return;sessionStorage.removeItem(t.RESUME_STORAGE_KEY)}catch(e){}}},{key:"_setupPageUnloadHandler",value:function(){var e=this;window.addEventListener("beforeunload",function(){e.conversationId&&e.websocket&&e.websocket.readyState===WebSocket.OPEN&&e.storeConversationId(e.conversationId)}),document.addEventListener("visibilitychange",function(){"visible"===document.visibilityState&&(e.isRecording&&e.isConnected&&e._requestWakeLock(),e.isRecording&&e.audioRecorder&&e.audioRecorder.resumeAudioContext().catch(function(e){console.error("VoiceSDK v2: Error resuming AudioContext on visibility change:",e)}),e.audioPlayer&&e.audioPlayer.resumeAudioContext().catch(function(e){console.error("VoiceSDK v2: Error resuming playback AudioContext on visibility change:",e)})),"hidden"===document.visibilityState&&e.conversationId&&e.websocket&&e.websocket.readyState===WebSocket.OPEN&&e.storeConversationId(e.conversationId)})}},{key:"checkAndResume",value:function(){var e=this._getResumeState();if(!e)return null;var t=window.location.pathname+window.location.search;return console.log("[VoiceSDK] Auto-resuming conversation:",e.conversationId),console.log("[VoiceSDK] Page change:",e.fromPage,"→",t),{conversationId:e.conversationId,fromPage:e.fromPage,toPage:t}}},{key:"getDefaultContainer",value:function(e){return"wav"===e.outputCodec?"wav":"raw"}},{key:"validateInputFormat",value:function(e){var A;if(!e)return"Input format is required";var n=null===(A=e.encoding)||void 0===A?void 0:A.toLowerCase();return n&&t.SUPPORTED_INPUT_ENCODINGS.includes(n)?e.sampleRate&&t.SUPPORTED_INPUT_SAMPLE_RATES.includes(e.sampleRate)?e.bitDepth&&t.SUPPORTED_INPUT_BIT_DEPTHS.includes(e.bitDepth)?e.channels&&t.SUPPORTED_INPUT_CHANNELS.includes(e.channels)?null:"Unsupported input channels: ".concat(e.channels,". Supported: ").concat(t.SUPPORTED_INPUT_CHANNELS.join(", ")):"Unsupported input bit depth: ".concat(e.bitDepth,". Supported: ").concat(t.SUPPORTED_INPUT_BIT_DEPTHS.join(", ")):"Unsupported input sample rate: ".concat(e.sampleRate,". Supported: ").concat(t.SUPPORTED_INPUT_SAMPLE_RATES.join(", ")):"Unsupported input encoding: ".concat(e.encoding,". Supported: ").concat(t.SUPPORTED_INPUT_ENCODINGS.join(", "))}},{key:"validateOutputFormat",value:function(e){var A,n;if(!e)return"Output format is required";var o=null===(A=e.encoding)||void 0===A?void 0:A.toLowerCase();if(!o||!t.SUPPORTED_OUTPUT_ENCODINGS.includes(o))return"Unsupported output encoding: ".concat(e.encoding,". Supported: ").concat(t.SUPPORTED_OUTPUT_ENCODINGS.join(", "));if(!e.sampleRate||!t.SUPPORTED_OUTPUT_SAMPLE_RATES.includes(e.sampleRate))return"Unsupported output sample rate: ".concat(e.sampleRate,". Supported: ").concat(t.SUPPORTED_OUTPUT_SAMPLE_RATES.join(", "));if(!e.bitDepth||!t.SUPPORTED_OUTPUT_BIT_DEPTHS.includes(e.bitDepth))return"Unsupported output bit depth: ".concat(e.bitDepth,". Supported: ").concat(t.SUPPORTED_OUTPUT_BIT_DEPTHS.join(", "));if(!e.channels||!t.SUPPORTED_OUTPUT_CHANNELS.includes(e.channels))return"Unsupported output channels: ".concat(e.channels,". Supported: ").concat(t.SUPPORTED_OUTPUT_CHANNELS.join(", "));var r=null===(n=e.container)||void 0===n?void 0:n.toLowerCase();return r&&t.SUPPORTED_OUTPUT_CONTAINERS.includes(r)?null:"Unsupported output container: ".concat(e.container,". Supported: ").concat(t.SUPPORTED_OUTPUT_CONTAINERS.join(", "))}},{key:"validateConfig",value:function(){var e={encoding:"pcm",sampleRate:this.config.sampleRate,channels:this.config.channels,bitDepth:this.config.bitDepth},t=this.validateInputFormat(e);if(t)return console.error("❌ VoiceSDK v2: Invalid input format:",t),void this.emit("error",new Error(t));var A={encoding:this.config.outputEncoding,sampleRate:this.config.outputSampleRate,channels:this.config.outputChannels,bitDepth:this.config.outputBitDepth,container:this.config.outputContainer},n=this.validateOutputFormat(A);if(n)return console.error("❌ VoiceSDK v2: Invalid output format:",n),void this.emit("error",new Error(n));console.log("✅ VoiceSDK v2: Format validation passed")}},{key:"setupAudioPlayerEvents",value:function(){var e=this;this.audioPlayer.on("playbackStarted",function(){e.isPlaying=!0,e.emit("playbackStarted"),e.isConnected?(console.log("📤 VoiceSDK v2: Sending audio_started_playing message to server"),e.sendMessage({t:"audio_started_playing"})):console.warn("⚠️ VoiceSDK v2: Cannot send audio_started_playing - not connected")}),this.audioPlayer.on("transcriptDisplay",function(t){var A=e.currentPlayingSentenceId?e.currentPlayingSentenceId+1:1;e.currentPlayingSentenceId=A;var n={text:t.text,role:"assistant",sentenceId:A,final:!0,timestamp:Date.now()};console.log("📝 VoiceSDK v2: Emitting synced transcriptDisplay from AudioPlayer:",n),e.emit("transcriptDisplay",n),e.emit("transcript",n)}),this.audioPlayer.on("playbackStopped",function(){e.isPlaying=!1,e.emit("playbackStopped"),e.isConnected?(console.log("📤 VoiceSDK v2: Sending audio_stopped_playing message to server"),e.sendMessage({t:"audio_stopped_playing"})):console.warn("⚠️ VoiceSDK v2: Cannot send audio_stopped_playing - not connected")}),this.audioPlayer.on("playbackError",function(t){e.emit("playbackError",t),e.emit("error",t)})}},{key:"setupAudioRecorderEvents",value:function(){var e=this;this.audioRecorder.on("recordingStarted",function(){e.isRecording=!0,e.emit("recordingStarted")}),this.audioRecorder.on("recordingStopped",function(){e.isRecording&&(e.isRecording=!1,e.emit("recordingStopped"),console.log("🛑 VoiceSDK v2: Recording stopped (from audioRecorder event)"))}),this.audioRecorder.on("audioData",function(t){e.isConnected&&e.sendBinary(t)}),this.audioRecorder.on("error",function(t){t.isServerRejection||"ServerRejected"===t.name||(console.error("❌ AudioRecorder error:",t),e.emit("error",t))})}},{key:"buildWebSocketUrl",value:function(){var e=this.config.signedUrl||this.config.websocketUrl,t=new URL(e,"wss://placeholder.com"),A=t.searchParams;this.config.agentId&&!A.has("agentId")&&A.append("agentId",this.config.agentId),this.config.appId&&!A.has("appId")&&A.append("appId",this.config.appId);var n=this.getStoredConversationId();n&&!A.has("conversationId")&&(A.append("conversationId",n),console.log("🔄 VoiceSDK v2: Attempting resume via query param:",n));var o=window.location.pathname+window.location.search;o&&!A.has("currentPage")&&A.append("currentPage",o);var r=A.toString();return r?"".concat(t.origin).concat(t.pathname,"?").concat(r):"".concat(t.origin).concat(t.pathname)}},{key:"connect",value:(p=zt(Nt().m(function e(){var t,A,n=this;return Nt().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!this.isDestroyed){e.n=1;break}return console.warn("VoiceSDK v2: Cannot connect - SDK is destroyed"),e.a(2,!1);case 1:if(!this.isConnected){e.n=2;break}return console.warn("VoiceSDK v2: Already connected"),e.a(2,!0);case 2:return e.p=2,t=this.buildWebSocketUrl(),e.n=3,new Promise(function(e,A){n.websocket=new WebSocket(t),n.websocket.onopen=function(){if(console.log("✅ VoiceSDK v2: WebSocket connected"),n.isConnected=!0,n.hasEverConnected=!0,n.clientToolsRegistry){n.clientToolsRegistry.setSendMessage(function(e){return n.sendMessage(e)});var t=n.clientToolsRegistry.getRegisteredTools();console.log("🔧 VoiceSDK v2: Registered tools on connect:",t);var A=["read_page","capture_screen","highlight_element","click_element","fill_field","scroll_to_element","navigate_to"].filter(function(e){return!t.includes(e)});if(A.length>0){console.warn("⚠️ VoiceSDK v2: Missing tools detected, re-registering:",A),n._registerBuiltInTools();var o=n.clientToolsRegistry.getRegisteredTools();console.log("🔧 VoiceSDK v2: Tools after re-registration:",o)}}n.sendHelloMessage(),n.emit("connected"),e(!0)},n.websocket.onerror=function(e){console.error("❌ VoiceSDK v2: WebSocket error:",e),A(e)},n.websocket.onclose=function(e){if(console.log("🔌 VoiceSDK v2: WebSocket closed:",e.code,e.reason),n.isConnected=!1,n.isRecording&&n.stopRecording().catch(function(e){return console.error("Error stopping recording:",e)}),n._releaseWakeLock(),n.pendingInjections.size>0){console.warn("VoiceSDK v2: Rejecting ".concat(n.pendingInjections.size," pending data injections due to disconnect"));var t=new Error("Connection closed - data injection cancelled");t.error="CONNECTION_CLOSED",n.pendingInjections.forEach(function(e,A){clearTimeout(e.timeout),e.reject(t),n.emit("dataInjectionError",{error:"CONNECTION_CLOSED",message:"Connection closed - data injection cancelled",correlationId:A})}),n.pendingInjections.clear()}n.emit("disconnected",e),n.config.autoReconnect&&!n.isDestroyed&&n.hasEverConnected?(console.log("🔄 VoiceSDK v2: Auto-reconnecting in 3s..."),setTimeout(function(){n.isDestroyed||n.isConnected||n.connect()},3e3)):n.config.autoReconnect&&!n.hasEverConnected&&console.log("⚠️ VoiceSDK v2: Initial connection failed. Auto-reconnect disabled to prevent retry loop.")},n.websocket.onmessage=function(e){n.handleMessage(e)}});case 3:return e.a(2,e.v);case 4:return e.p=4,A=e.v,console.error("🔌 VoiceSDK v2: Connection failed:",A),this.emit("error",A),e.a(2,!1)}},e,this,[[2,4]])})),function(){return p.apply(this,arguments)})},{key:"detectBrowserLocale",value:function(){var e,t,A=navigator.language||(null===(e=navigator.languages)||void 0===e?void 0:e[0])||"en-US";return{language:(null===(t=A.split("-")[0])||void 0===t?void 0:t.toLowerCase())||"en",fullLocale:A}}},{key:"sendHelloMessage",value:(d=zt(Nt().m(function e(){var t,A,n,o,r;return Nt().w(function(e){for(;;)switch(e.n){case 0:if(this.isConnected){e.n=1;break}return console.warn("VoiceSDK v2: Cannot send hello - not connected"),e.a(2);case 1:if(t={encoding:"pcm",sampleRate:this.config.sampleRate,channels:this.config.channels,bitDepth:this.config.bitDepth},A={encoding:this.config.outputEncoding,sampleRate:this.config.outputSampleRate,channels:this.config.outputChannels,bitDepth:this.config.outputBitDepth,container:this.config.outputContainer},!(n=this.validateInputFormat(t))){e.n=2;break}return console.error("❌ VoiceSDK v2: Cannot send hello - invalid input format:",n),this.emit("error",new Error("Invalid input format: ".concat(n))),e.a(2);case 2:if(!(o=this.validateOutputFormat(A))){e.n=3;break}return console.error("❌ VoiceSDK v2: Cannot send hello - invalid output format:",o),this.emit("error",new Error("Invalid output format: ".concat(o))),e.a(2);case 3:r={t:"hello",v:this.config.protocolVersion,inputFormat:t,requestedOutputFormat:A,outputFrameDurationMs:this.config.outputFrameDurationMs},this.config.agentSettingsOverride&&(r.agentSettingsOverride=this.config.agentSettingsOverride),r.locale=this.detectBrowserLocale(),console.log("🌍 VoiceSDK v2: Auto-detected locale:",r.locale),console.log("🔍 VoiceSDK v2: Checking variables:",{hasVariables:!!this.config.variables,variables:this.config.variables,keys:this.config.variables?Object.keys(this.config.variables):[]}),this.config.variables&&Object.keys(this.config.variables).length>0?(r.variables=this.config.variables,console.log("📝 VoiceSDK v2: Including variables in hello:",Object.keys(this.config.variables))):console.log("⚠️ VoiceSDK v2: Variables NOT included - condition failed"),console.log("📤 VoiceSDK v2: Sending hello:",{version:r.v,requestedFormat:r.requestedOutputFormat,variables:r.variables?Object.keys(r.variables):void 0}),console.log("📤 VoiceSDK v2: Requested output format:",{container:r.requestedOutputFormat.container,encoding:r.requestedOutputFormat.encoding,sampleRate:r.requestedOutputFormat.sampleRate,bitDepth:r.requestedOutputFormat.bitDepth}),console.log("📤 VoiceSDK v2: Full hello message being sent:",JSON.stringify(r,null,2));try{this.sendMessage(r)}catch(e){console.error("VoiceSDK v2: Failed to send hello:",e),this.emit("error",e)}case 4:return e.a(2)}},e,this)})),function(){return d.apply(this,arguments)})},{key:"handleMessage",value:function(e){var t,A=this;if(e.data instanceof ArrayBuffer||e.data instanceof Blob)this.handleBinaryMessage(e.data);else try{var n=JSON.parse(e.data);switch("audio"!==n.t&&console.log("📥 VoiceSDK v2: Received message type:",n.t,"Full message:",JSON.stringify(n).substring(0,200)),!this.conversationId&&n.conversationId&&(this.conversationId=n.conversationId,console.log("🔍 VoiceSDK v2: Captured conversationId from message:",this.conversationId),this.emit("conversationIdChanged",this.conversationId)),"audio"!==n.t&&console.log("📨 VoiceSDK v2: Received message type:",n.t,n),n.t){case"hello_ack":this.handleHelloAck(n);break;case"transcript":console.log("📝 VoiceSDK v2: Processing transcript message:",n),this.handleTranscript(n);break;case"user_transcript":console.log("📝 VoiceSDK v2: Received user_transcript:",n),this.emit("message",n);break;case"agent_response":if(console.log("📝 VoiceSDK v2: Received agent_response:",n),(n.text||n.transcript)&&(console.log("📝 VoiceSDK v2: agent_response contains transcript data:",n.text||n.transcript),n.sentenceId&&(n.text||n.transcript))){var o={t:"transcript",sentenceId:n.sentenceId,text:n.text||n.transcript,role:n.role||"assistant",final:!1!==n.final,timestamp:n.timestamp||Date.now()};console.log("📝 VoiceSDK v2: Converting agent_response to transcript:",o),this.handleTranscript(o)}this.emit("message",n);break;case"error":this.emit("message",n);break;case"barge_in":this.emit("bargeIn",n),this.stopAudioPlayback();break;case"stop_playing":var r=Date.now()-this.lastAudioStartTime;if(r<200){console.warn("⚠️ VoiceSDK v2: Ignoring premature stop_playing (".concat(r,"ms after audio_start, minimum ").concat(200,"ms required)"));break}this.emit("stopPlaying",n),this.stopAudioPlayback();break;case"audio_start":console.log("📝 VoiceSDK v2: Received audio_start with text:",n.text),this.lastAudioStartTime=Date.now(),this.audioPlayer&&(this.audioPlayer.isPlaying||(null===(t=this.audioPlayer.scheduledSources)||void 0===t?void 0:t.size)>0)&&console.log("📝 VoiceSDK v2: New sentence received while audio playing - will queue and wait for current sentence to finish"),n.text&&this.audioPlayer&&this.audioPlayer.markNewSentence(n.text),this.emit("message",n);break;case"client_tool_call":this.clientToolsRegistry.handleToolCall(n);break;case"text_inject_ack":this.handleTextInjectAck(n);break;case"data_inject_ack":this.handleDataInjectAck(n);break;case"data_inject_error":this.handleDataInjectError(n);break;case"hangup_ack":console.log("📞 VoiceSDK v2: Hangup acknowledged by server"),this.websocket&&this.websocket.readyState===WebSocket.OPEN&&(this.websocket.close(1e3,"User hangup"),this.websocket=null),this.isConnected=!1,this.emit("hangupAcknowledged");break;case"get_page_context":console.log("📖 [VISUAL ASSISTANT] Backend requested page context"),function(){return jt.apply(this,arguments)}().then(function(e){A.sendMessage({t:"page_context",pageContext:e}),console.log("📖 [VISUAL ASSISTANT] Page context sent:",e.url)}).catch(function(e){console.error("❌ [VISUAL ASSISTANT] Failed to scan page:",e),A.sendMessage({t:"page_context",pageContext:null,error:e.message})});break;case"get_screenshot":console.log("📸 [VISUAL ASSISTANT] Backend requested screenshot");try{Xe().then(function(e){A.sendMessage({t:"screenshot",screenshot:{image:e.base64,mimeType:e.mimeType||"image/png",width:e.width,height:e.height}}),console.log("📸 [VISUAL ASSISTANT] Screenshot sent:",e.width+"x"+e.height)}).catch(function(e){console.error("❌ [VISUAL ASSISTANT] Screenshot capture failed:",e),A.sendMessage({t:"screenshot",screenshot:null,error:e.message})})}catch(e){console.error("❌ [VISUAL ASSISTANT] Screenshot error:",e),this.sendMessage({t:"screenshot",screenshot:null,error:e.message})}break;case"page_context_ack":n.ok?console.log("✅ [VISUAL ASSISTANT] Page context acknowledged"):console.warn("⚠️ [VISUAL ASSISTANT] Page context error:",n.error);break;case"screenshot_ack":n.ok?console.log("✅ [VISUAL ASSISTANT] Screenshot acknowledged"):console.warn("⚠️ [VISUAL ASSISTANT] Screenshot error:",n.error);break;default:if(console.log("VoiceSDK v2: Unknown message type:",n.t,"Full message:",JSON.stringify(n).substring(0,300)),(n.text||n.transcript||n.transcription)&&(console.log("📝 VoiceSDK v2: Unknown message contains transcript-like data:",{text:n.text,transcript:n.transcript,transcription:n.transcription,sentenceId:n.sentenceId,role:n.role}),n.sentenceId&&(n.text||n.transcript||n.transcription))){var i={t:"transcript",sentenceId:n.sentenceId,text:n.text||n.transcript||n.transcription,role:n.role||"assistant",final:!1!==n.final,timestamp:n.timestamp||Date.now()};console.log("📝 VoiceSDK v2: Attempting to process unknown message as transcript:",i),this.handleTranscript(i)}this.emit("message",n)}}catch(t){var a,s,c="string"==typeof e.data?e.data:String(e.data),l=(null===(a=t.message)||void 0===a||null===(a=a.match(/position (\d+)/))||void 0===a?void 0:a[1])||"unknown",u=parseInt(l,10);if(console.error("VoiceSDK v2: Error parsing message:",t),console.error("VoiceSDK v2: Raw message length:",c.length),console.error("VoiceSDK v2: Error at position:",u),"unknown"!==u&&u>0){var d=Math.max(0,u-50),p=Math.min(c.length,u+50),h=c.substring(d,p),g=" ".repeat(u-d)+"^";console.error("VoiceSDK v2: Context around error:"),console.error(h),console.error(g);var f=c.charAt(u),m=f.charCodeAt(0);console.error('VoiceSDK v2: Problematic character: "'.concat(f,'" (charCode: ').concat(m,")")),m<32&&9!==m&&10!==m&&13!==m&&console.error("VoiceSDK v2: This is an unescaped control character. The backend should escape it in JSON strings.")}var v=c.includes("client_tool_call")||c.includes('"t":"client_tool_call"');if(v){console.error("⚠️ VoiceSDK v2: CRITICAL - Failed to parse client_tool_call message!"),console.error("⚠️ VoiceSDK v2: This means a tool execution (like form filling) was lost due to JSON parsing error."),console.error("⚠️ VoiceSDK v2: The backend sent malformed JSON with unescaped control characters.");var B=c.match(/"toolName"\s*:\s*"([^"]+)"/);B&&console.error('⚠️ VoiceSDK v2: Attempted tool: "'.concat(B[1],'"'));var w=c.match(/"toolCallId"\s*:\s*"([^"]+)"/);w&&console.error('⚠️ VoiceSDK v2: Tool call ID: "'.concat(w[1],'"'))}if(null!==(s=t.message)&&void 0!==s&&s.includes("Bad control character")){console.warn("VoiceSDK v2: Attempting to recover by sanitizing control characters...");try{var y=c;y=y.replace(/([^\\])([\x00-\x08\x0B\x0C\x0E-\x1F])/g,function(e,t,A){var n=A.charCodeAt(0);return t+({0:"\\u0000",1:"\\u0001",2:"\\u0002",3:"\\u0003",4:"\\u0004",5:"\\u0005",6:"\\u0006",7:"\\u0007",8:"\\b",11:"\\u000B",12:"\\f",14:"\\u000E",15:"\\u000F",16:"\\u0010",17:"\\u0011",18:"\\u0012",19:"\\u0013",20:"\\u0014",21:"\\u0015",22:"\\u0016",23:"\\u0017",24:"\\u0018",25:"\\u0019",26:"\\u001A",27:"\\u001B",28:"\\u001C",29:"\\u001D",30:"\\u001E",31:"\\u001F"}[n]||"\\u".concat(n.toString(16).padStart(4,"0")))});var b=JSON.parse(y);if(console.warn("✅ VoiceSDK v2: Successfully recovered message after sanitization!"),console.warn("✅ VoiceSDK v2: Processing recovered message..."),"client_tool_call"===b.t&&this.clientToolsRegistry)console.warn("✅ VoiceSDK v2: Recovered client_tool_call - executing tool"),this.clientToolsRegistry.handleToolCall(b);else{var C=b;"audio"!==C.t&&console.log("📥 VoiceSDK v2: Received message type:",C.t,"Full message:",JSON.stringify(C).substring(0,200)),!this.conversationId&&C.conversationId&&(this.conversationId=C.conversationId,console.log("🔍 VoiceSDK v2: Captured conversationId from message:",this.conversationId),this.emit("conversationIdChanged",this.conversationId)),"audio"!==C.t&&console.log("📨 VoiceSDK v2: Received message type:",C.t,C),"client_tool_call"===C.t?this.clientToolsRegistry.handleToolCall(C):this.emit("message",C)}return}catch(e){console.error("❌ VoiceSDK v2: Recovery attempt failed:",e)}}console.error("VoiceSDK v2: First 500 chars of raw message:",c.substring(0,500)),this.emit("error",{type:"json_parse_error",error:t,rawMessage:c.substring(0,1e3),position:u,wasToolCall:v})}}},{key:"handleHelloAck",value:function(e){if(console.log("📥 VoiceSDK v2: Received hello_ack:",{hasOutputFormat:!!e.outputAudioFormat,outputFormat:e.outputAudioFormat,hasConversationId:!!e.conversationId,messageType:e.t}),e.conversationId&&(this.conversationId=e.conversationId,console.log("🔍 VoiceSDK v2: Received conversationId:",this.conversationId),this.emit("conversationIdChanged",this.conversationId),this.storeConversationId(this.conversationId)),!0===e.resumed?(console.log("✅ VoiceSDK v2: Conversation resumed successfully"),this.emit("callResumed",{conversationId:this.conversationId,timestamp:Date.now()})):!1===e.resumed&&e.resumeRejectedReason&&(console.warn("⚠️ VoiceSDK v2: Resume rejected:",e.resumeRejectedReason),this.clearStoredConversationId(),this.emit("resumeRejected",{reason:e.resumeRejectedReason,conversationId:e.conversationId||null,timestamp:Date.now()})),e.outputAudioFormat){this.outputAudioFormat=e.outputAudioFormat,this.audioPlayer.setOutputFormat(e.outputAudioFormat),console.log("✅ VoiceSDK v2: Format negotiated by server:",this.outputAudioFormat),this.requestedOutputFormat={container:this.config.outputContainer||"wav",encoding:this.config.outputEncoding||"pcm",sampleRate:this.config.outputSampleRate||16e3,bitDepth:this.config.outputBitDepth||16,channels:this.config.outputChannels||1};var t={container:this.outputAudioFormat.container||"unknown",encoding:this.outputAudioFormat.encoding||"unknown",sampleRate:this.outputAudioFormat.sampleRate||0,bitDepth:this.outputAudioFormat.bitDepth||0,channels:this.outputAudioFormat.channels||0},A=[];if(this.requestedOutputFormat.container!==t.container&&A.push('container: "'.concat(this.requestedOutputFormat.container,'" → "').concat(t.container,'"')),this.requestedOutputFormat.encoding!==t.encoding&&A.push('encoding: "'.concat(this.requestedOutputFormat.encoding,'" → "').concat(t.encoding,'"')),this.requestedOutputFormat.sampleRate!==t.sampleRate&&A.push("sampleRate: ".concat(this.requestedOutputFormat.sampleRate,"Hz → ").concat(t.sampleRate,"Hz")),this.requestedOutputFormat.bitDepth!==t.bitDepth&&A.push("bitDepth: ".concat(this.requestedOutputFormat.bitDepth,"-bit → ").concat(t.bitDepth,"-bit")),this.requestedOutputFormat.channels!==t.channels&&A.push("channels: ".concat(this.requestedOutputFormat.channels," → ").concat(t.channels)),A.length>0){console.warn("⚠️ VoiceSDK v2: Format negotiation mismatch!"),console.warn(" Requested:",this.requestedOutputFormat),console.warn(" Negotiated:",t),console.warn(" Differences:",A.join(", "));try{if(this.formatConverter=new Ee(this.requestedOutputFormat,t),this.formatConverter.needsConversion()){var n=this.formatConverter.getConversionSteps();console.log("🔄 VoiceSDK v2: Format conversion enabled"),console.log(" Conversion steps:",n.join(", ")),console.log(" Audio will be automatically converted to requested format")}}catch(e){console.error("❌ VoiceSDK v2: Failed to create format converter:",e),console.warn(" Will use backend format without conversion"),this.formatConverter=null}}else console.log("✅ VoiceSDK v2: Format perfectly matched!",t),this.formatConverter=null;this.emit("formatNegotiated",this.outputAudioFormat)}else{this.config.protocolVersion>=2&&(console.warn("⚠️ VoiceSDK v2: hello_ack received but no outputAudioFormat in response."),console.warn(" This may happen if:"),console.warn(" 1. Backend is not sending outputAudioFormat (check backend logs)"),console.warn(" 2. Hello message missing v2 fields (v, inputFormat, requestedOutputFormat)"),console.warn(" 3. Backend validation failed (check backend error logs)"),console.warn(" Using default format from config..."));var o={container:this.config.outputContainer||"wav",encoding:this.config.outputEncoding||"pcm",sampleRate:this.config.outputSampleRate||16e3,channels:this.config.outputChannels||1,bitDepth:this.config.outputBitDepth||16};this.outputAudioFormat=o,this.requestedOutputFormat=o,this.audioPlayer.setOutputFormat(o),this.formatConverter=null}}},{key:"handleTextInjectAck",value:function(e){console.log("📝 VoiceSDK v2: Text inject ack received:",e),this.emit("textInjectAck",e)}},{key:"injectData",value:(u=zt(Nt().m(function e(t){var A,n,o,r,i,a,s,c,l,u=this,d=arguments;return Nt().w(function(e){for(;;)switch(e.n){case 0:if(A=d.length>1&&void 0!==d[1]?d[1]:{},n=null==t?void 0:t.trim()){e.n=1;break}throw o={error:"EMPTY_DATA",message:"Cannot inject empty data"},console.warn("VoiceSDK v2: Cannot inject empty data"),this.emit("dataInjectionError",o),new Error(o.message);case 1:if(this.isConnected&&this.websocket){e.n=2;break}throw r={error:"NOT_CONNECTED",message:"Voice call is not active"},console.warn("VoiceSDK v2: Cannot inject data - not connected"),this.emit("dataInjectionError",r),new Error(r.message);case 2:if(!(n.length>5e3)){e.n=3;break}throw i={error:"DATA_TOO_LONG",message:"Data exceeds maximum length of 5000 characters",maxLength:5e3,currentLength:n.length},console.warn("VoiceSDK v2: Data too long (max 5000 characters)"),this.emit("dataInjectionError",i),new Error(i.message);case 3:return a=this.generateCorrelationId(),s=A.timeout||1e4,c=A.source||"programmatic",l={t:"data_inject",data:n,correlationId:a,source:c,timestamp:Date.now()},A.metadata&&(l.metadata=A.metadata),e.a(2,new Promise(function(e,t){var A=setTimeout(function(){u.pendingInjections.delete(a);var e={error:"TIMEOUT",message:"Data injection timeout - no response from server",correlationId:a,timeout:s};console.warn("VoiceSDK v2: Data injection timeout:",a),u.emit("dataInjectionError",e),t(new Error(e.message))},s);if(u.pendingInjections.set(a,{resolve:function(t){clearTimeout(A),e(t)},reject:function(e){clearTimeout(A),t(e)},timeout:A}),u.sendMessage(l))console.log("📤 VoiceSDK v2: Sent data_inject message:",{correlationId:a,dataLength:n.length,source:c});else{u.pendingInjections.delete(a),clearTimeout(A);var o={error:"SEND_FAILED",message:"Failed to send data injection message"};console.warn("VoiceSDK v2: Failed to send data injection message"),u.emit("dataInjectionError",o),t(new Error(o.message))}}))}},e,this)})),function(e){return u.apply(this,arguments)})},{key:"handleDataInjectAck",value:function(e){var t=e.correlationId;if(t){var A=this.pendingInjections.get(t);A?(this.pendingInjections.delete(t),A.resolve(e),this.emit("dataInjected",{correlationId:t,data:e.data,metadata:e.metadata}),console.log("✅ VoiceSDK v2: Data injection acknowledged:",t)):console.warn("VoiceSDK v2: data_inject_ack received for unknown correlationId:",t)}else console.warn("VoiceSDK v2: data_inject_ack received without correlationId")}},{key:"handleDataInjectError",value:function(e){var t=e.correlationId;if(t){var A=this.pendingInjections.get(t);if(A){this.pendingInjections.delete(t);var n=new Error(e.message||"Data injection failed");n.error=e.error,n.correlationId=t,A.reject(n),this.emit("dataInjectionError",{error:e.error,message:e.message,correlationId:t}),console.warn("❌ VoiceSDK v2: Data injection error:",t,e.error)}else console.warn("VoiceSDK v2: data_inject_error received for unknown correlationId:",t)}else console.warn("VoiceSDK v2: data_inject_error received without correlationId")}},{key:"handleTranscript",value:function(e){if(e.sentenceId&&e.text){var t=e.sentenceId,A={text:e.text,role:e.role||"assistant",sentenceId:t,final:!1!==e.final,timestamp:e.timestamp||Date.now()};this.transcriptQueue.push(A),console.log("📝 VoiceSDK v2: Received transcript for sentence",t,":",A.text),console.log(" Transcript queue length:",this.transcriptQueue.length),console.log(" Current playing sentence:",this.currentPlayingSentenceId),console.log("📝 VoiceSDK v2: Displaying transcript for completed sentence",t),this.emit("transcriptDisplay",A),this.currentPlayingSentenceId=t,this.emit("transcript",A)}else console.warn("⚠️ VoiceSDK v2: Invalid transcript message:",e)}},{key:"handleBinaryMessage",value:(l=zt(Nt().m(function e(t){var A,n,o,r,i,a,s,c,l;return Nt().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!(t instanceof Blob)){e.n=2;break}return e.n=1,t.arrayBuffer();case 1:A=e.v,e.n=3;break;case 2:A=t;case 3:if(n=A,!this.formatConverter||!this.formatConverter.needsConversion()){e.n=7;break}return e.p=4,e.n=5,this.formatConverter.convert(A);case 5:n=e.v,console.log("✅ VoiceSDK v2: Audio converted to requested format"),e.n=7;break;case 6:e.p=6,l=e.v,console.error("❌ VoiceSDK v2: Format conversion failed:",l),console.warn(" Using backend format without conversion"),n=A;case 7:o=this.formatConverter&&this.formatConverter.needsConversion()?this.requestedOutputFormat:this.outputAudioFormat||{container:this.config.outputContainer||"raw",encoding:this.config.outputEncoding||"pcm",sampleRate:this.config.outputSampleRate||16e3,bitDepth:this.config.outputBitDepth||16,channels:this.config.outputChannels||1},r=o.container||"raw",i=(o.encoding||"pcm").toLowerCase(),"raw"===r?(a=n,"pcm"!==i&&((s=this.audioPlayer.getCodec(i))?(c=s.decode(new Uint8Array(n)),a=c.buffer,console.log("🔄 VoiceSDK v2: Decoded ".concat(i.toUpperCase()," to PCM (").concat(c.byteLength," bytes)"))):console.warn("⚠️ VoiceSDK v2: No codec for ".concat(i,", treating as PCM"))),this.audioPlayer.outputFormat||(console.warn("⚠️ VoiceSDK v2: outputFormat not set on AudioPlayer, setting from playbackFormat"),this.audioPlayer.setOutputFormat(o)),this.audioFrameCount++,this.audioPlayer.playChunk(a)):(this.audioFrameCount++,this.audioPlayer.playAudio(n));case 8:return e.a(2)}},e,this,[[4,6]])})),function(e){return l.apply(this,arguments)})},{key:"sendMessage",value:function(e){if(!this.websocket||this.websocket.readyState!==WebSocket.OPEN)return console.warn("VoiceSDK v2: Cannot send message - not connected"),!1;try{var t=(new Date).toISOString(),A=this.websocket?this.websocket.readyState:"NO_WEBSOCKET",n=this.websocket?{0:"CONNECTING",1:"OPEN",2:"CLOSING",3:"CLOSED"}[A]:"NO_WEBSOCKET";if("client_tool_result"!==e.t&&"client_tool_error"!==e.t||(console.log("📤 VoiceSDK v2: [".concat(t,"] Sending tool ").concat(e.t)),console.log(" 🔌 WebSocket state: ".concat(n," (").concat(A,")")),console.log(" 📋 toolCallId: ".concat(e.toolCallId)),console.log(" 📋 conversationId: ".concat(e.conversationId||"null")),console.log(" 📋 toolName: ".concat(e.toolName)),"client_tool_result"===e.t?console.log(" 📋 result:",e.result):console.log(" 📋 error: ".concat(e.error,", errorCode: ").concat(e.errorCode)),console.log(" 📋 Full message:",JSON.stringify(e,null,2))),!this.websocket||this.websocket.readyState!==WebSocket.OPEN)return console.error("❌ VoiceSDK v2: Cannot send message - WebSocket not open (state: ".concat(n,")")),!1;var o=JSON.stringify(e);return this.websocket.send(o),"client_tool_result"!==e.t&&"client_tool_error"!==e.t||console.log("✅ VoiceSDK v2: [".concat(t,"] Tool ").concat(e.t," message sent successfully (").concat(o.length," bytes)")),!0}catch(e){return console.error("VoiceSDK v2: Error sending message:",e),this.emit("error",e),!1}}},{key:"sendBinary",value:function(e){if(!this.websocket||this.websocket.readyState!==WebSocket.OPEN)return console.warn("VoiceSDK v2: Cannot send audio - not connected"),!1;try{return this.websocket.send(e),!0}catch(e){return console.error("VoiceSDK v2: Error sending audio:",e),this.emit("error",e),!1}}},{key:"hangup",value:function(){var e=this;if(this.websocket&&this.websocket.readyState===WebSocket.OPEN){console.log("📞 VoiceSDK v2: Hanging up call..."),this.clearStoredConversationId(),this.stopRecording(),this._releaseWakeLock(),this.audioPlayer&&this.stopAudioPlayback();try{this.sendMessage({t:"hangup"}),setTimeout(function(){e.websocket&&e.websocket.readyState===WebSocket.OPEN&&(e.websocket.close(1e3,"User hangup"),e.websocket=null),e.isConnected=!1},100)}catch(e){console.error("VoiceSDK v2: Error sending hangup message:",e),this.websocket&&(this.websocket.close(1e3,"User hangup"),this.websocket=null),this.isConnected=!1}}}},{key:"startRecording",value:(c=zt(Nt().m(function e(){var t,A,n,o;return Nt().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this.isConnected){e.n=1;break}throw t=new Error("Not connected to voice server"),this.emit("error",t),t;case 1:if(!this.isRecording){e.n=2;break}return console.warn("VoiceSDK v2: Already recording"),e.a(2,!0);case 2:return console.log("🎤 VoiceSDK v2: Starting recording..."),e.p=3,console.log("🎤 VoiceSDK v2: Requesting microphone permission (mobile-friendly)..."),e.n=4,this.audioRecorder.start();case 4:if(this.isConnected&&this.websocket&&this.websocket.readyState===WebSocket.OPEN){e.n=9;break}return e.p=5,e.n=6,this.audioRecorder.stop();case 6:e.n=8;break;case 7:e.p=7,e.v;case 8:throw(A=new Error("Connection lost - server may have rejected the call")).name="ServerRejected",A.isServerRejection=!0,A;case 9:return e.n=10,this.audioPlayer.resumeAudioContext();case 10:return this.sendMessage({t:"start_continuous_mode",ttpId:this.generateTtpId()}),this._requestWakeLock(),e.a(2,!0);case 11:if(e.p=11,o=e.v,!this.audioRecorder||!this.audioRecorder.isRecording){e.n=15;break}return e.p=12,e.n=13,this.audioRecorder.stop();case 13:e.n=15;break;case 14:e.p=14,e.v;case 15:if(!o.isServerRejection&&"ServerRejected"!==o.name){e.n=16;break}return e.a(2,!1);case 16:return console.error("❌ VoiceSDK v2: Failed to start recording:",o),"NotAllowedError"===o.name||"PermissionDeniedError"===o.name?((n=new Error("Microphone permission denied. Please allow microphone access in your browser settings and try again.")).name=o.name,n.originalError=o,this.emit("error",n)):this.emit("error",o),e.a(2,!1)}},e,this,[[12,14],[5,7],[3,11]])})),function(){return c.apply(this,arguments)})},{key:"stopRecording",value:(s=zt(Nt().m(function e(){var t;return Nt().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this.isRecording){e.n=1;break}return console.warn("VoiceSDK v2: Not recording"),e.a(2,!0);case 1:return console.log("🛑 VoiceSDK v2: Stopping recording..."),e.p=2,this.sendMessage({t:"stop_continuous_mode",ttpId:this.generateTtpId()}),this.isRecording=!1,this.emit("recordingStopped"),console.log("🛑 VoiceSDK v2: Recording stopped (emitted before audioRecorder.stop())"),this._releaseWakeLock(),e.n=3,this.audioRecorder.stop();case 3:return this.stopAudioPlayback(),e.a(2,!0);case 4:return e.p=4,t=e.v,console.error("VoiceSDK v2: Error stopping recording:",t),this.emit("error",t),e.a(2,!1)}},e,this,[[2,4]])})),function(){return s.apply(this,arguments)})},{key:"toggleRecording",value:(a=zt(Nt().m(function e(){return Nt().w(function(e){for(;;)switch(e.n){case 0:if(!this.isRecording){e.n=2;break}return e.n=1,this.stopRecording();case 1:case 3:return e.a(2,e.v);case 2:return e.n=3,this.startRecording();case 4:return e.a(2)}},e,this)})),function(){return a.apply(this,arguments)})},{key:"clearTranscriptState",value:function(){this.currentPlayingSentenceId=null,console.log("📝 VoiceSDK v2: Cleared transcript state")}},{key:"_requestWakeLock",value:(i=zt(Nt().m(function e(){var t,A=this;return Nt().w(function(e){for(;;)switch(e.p=e.n){case 0:if("wakeLock"in navigator){e.n=1;break}return console.log("📱 VoiceSDK v2: Wake Lock API not available in this browser"),e.a(2);case 1:if(null===this.wakeLock&&!this._wakeLockRequesting){e.n=2;break}return console.log("📱 VoiceSDK v2: Wake lock already active or being requested"),e.a(2);case 2:return e.p=2,this._wakeLockRequesting=!0,e.n=3,navigator.wakeLock.request("screen");case 3:this.wakeLock=e.v,console.log("📱 VoiceSDK v2: Screen wake lock activated - screen will stay on during call"),this.wakeLock.addEventListener("release",function(){console.log("📱 VoiceSDK v2: Wake lock released by system"),A.wakeLock=null}),e.n=5;break;case 4:e.p=4,t=e.v,console.warn("📱 VoiceSDK v2: Failed to request wake lock:",t.message),this.wakeLock=null;case 5:return e.p=5,this._wakeLockRequesting=!1,e.f(5);case 6:return e.a(2)}},e,this,[[2,4,5,6]])})),function(){return i.apply(this,arguments)})},{key:"_releaseWakeLock",value:(r=zt(Nt().m(function e(){var t;return Nt().w(function(e){for(;;)switch(e.p=e.n){case 0:if(null!==this.wakeLock){e.n=1;break}return e.a(2);case 1:return e.p=1,e.n=2,this.wakeLock.release();case 2:this.wakeLock=null,console.log("📱 VoiceSDK v2: Screen wake lock released"),e.n=4;break;case 3:e.p=3,t=e.v,console.warn("📱 VoiceSDK v2: Error releasing wake lock:",t.message),this.wakeLock=null;case 4:return e.a(2)}},e,this,[[1,3]])})),function(){return r.apply(this,arguments)})},{key:"stopAudioPlayback",value:function(){this.audioPlayer.stopImmediate(),this.clearTranscriptState()}},{key:"handleBargeIn",value:(o=zt(Nt().m(function e(){return Nt().w(function(e){for(;;)switch(e.n){case 0:if(this.stopAudioPlayback(),this.isRecording){e.n=1;break}return e.n=1,this.startRecording();case 1:return e.a(2)}},e,this)})),function(){return o.apply(this,arguments)})},{key:"getStatus",value:function(){return{version:this.version,isConnected:this.isConnected,isRecording:this.isRecording,isPlaying:this.isPlaying,outputFormat:this.outputAudioFormat,conversationId:this.conversationId,audioPlayer:this.audioPlayer.getStatus(),audioRecorder:this.audioRecorder.getStatus()}}},{key:"updateConfig",value:function(e){this.config=Yt(Yt({},this.config),e)}},{key:"generateTtpId",value:function(){return"sdk_"+Math.random().toString(36).substr(2,9)+"_"+Date.now()}},{key:"generateCorrelationId",value:function(){if("undefined"!=typeof crypto&&crypto.randomUUID)return crypto.randomUUID();this.injectionCounter++;var e=Date.now(),t=Math.random().toString(36).substr(2,9);return"inj_".concat(e,"_").concat(this.injectionCounter,"_").concat(t)}},{key:"registerToolHandler",value:function(e,t){return this.clientToolsRegistry.registerHandler(e,t)}},{key:"unregisterToolHandler",value:function(e){return this.clientToolsRegistry.unregisterHandler(e)}},{key:"hasToolHandler",value:function(e){return this.clientToolsRegistry.hasHandler(e)}},{key:"getRegisteredTools",value:function(){return this.clientToolsRegistry.getRegisteredTools()}},{key:"destroy",value:function(){var e=this;if(!this.isDestroyed){if(console.log("🗑️ VoiceSDK v2: Destroying..."),this.isDestroyed=!0,this.isRecording&&this.stopRecording(),this._releaseWakeLock(),this._wakeLockRequesting=!1,this.audioPlayer&&this.stopAudioPlayback(),this.websocket&&(this.websocket.close(),this.websocket=null),this.isConnected=!1,this.pendingInjections.size>0){console.warn("VoiceSDK v2: Rejecting ".concat(this.pendingInjections.size," pending data injections due to destroy"));var t=new Error("SDK destroyed - data injection cancelled");t.error="SDK_DESTROYED",this.pendingInjections.forEach(function(e,A){clearTimeout(e.timeout),e.reject(t)}),this.pendingInjections.clear()}this.audioPlayer&&this.audioPlayer.destroy(),this.audioRecorder&&this.audioRecorder.destroy(),this.clientToolsRegistry&&this.clientToolsRegistry.getRegisteredTools().forEach(function(t){return e.clientToolsRegistry.unregisterHandler(t)}),this.removeAllListeners()}}}],n&&qt(A.prototype,n),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,n,o,r,i,a,s,c,l,u,d,p}(a);tA(nA,"RESUME_STORAGE_KEY","voice_resume_state"),tA(nA,"RESUME_TTL_MS",1e4),tA(nA,"SUPPORTED_INPUT_ENCODINGS",["pcm","pcmu","pcma"]),tA(nA,"SUPPORTED_INPUT_SAMPLE_RATES",[8e3,16e3,22050,24e3,44100,48e3]),tA(nA,"SUPPORTED_INPUT_BIT_DEPTHS",[8,16,24]),tA(nA,"SUPPORTED_INPUT_CHANNELS",[1]),tA(nA,"SUPPORTED_OUTPUT_ENCODINGS",["pcm","pcmu","pcma"]),tA(nA,"SUPPORTED_OUTPUT_SAMPLE_RATES",[8e3,16e3,22050,24e3,44100,48e3]),tA(nA,"SUPPORTED_OUTPUT_BIT_DEPTHS",[8,16,24]),tA(nA,"SUPPORTED_OUTPUT_CHANNELS",[1]),tA(nA,"SUPPORTED_OUTPUT_CONTAINERS",["raw","wav"]);const oA=nA;function rA(e){return rA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rA(e)}function iA(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return aA(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(aA(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,aA(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,aA(u,"constructor",c),aA(c,"constructor",s),s.displayName="GeneratorFunction",aA(c,o,"GeneratorFunction"),aA(u),aA(u,o,"Generator"),aA(u,n,function(){return this}),aA(u,"toString",function(){return"[object Generator]"}),(iA=function(){return{w:r,m:d}})()}function aA(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}aA=function(e,t,A,n){function r(t,A){aA(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},aA(e,t,A,n)}function sA(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function cA(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),A.push.apply(A,n)}return A}function lA(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?cA(Object(A),!0).forEach(function(t){uA(e,t,A[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):cA(Object(A)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}return e}function uA(e,t,A){return(t=pA(t))in e?Object.defineProperty(e,t,{value:A,enumerable:!0,configurable:!0,writable:!0}):e[t]=A,e}function dA(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,pA(n.key),n)}}function pA(e){var t=function(e){if("object"!=rA(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=rA(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==rA(t)?t:t+""}function hA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(hA=function(){return!!e})()}function gA(e){return gA=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},gA(e)}function fA(e,t){return fA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},fA(e,t)}var mA=function(e){function t(){var e,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=(e=function(e,t,A){return t=gA(t),function(e,t){if(t&&("object"==rA(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,hA()?Reflect.construct(t,A||[],gA(e).constructor):t.apply(e,A))}(this,t)).readScriptTagConfig();return e.config=lA({baseWsUrl:"wss://backend.talktopc.com/chat/websocket",appId:A.appId||n.appId,agentId:A.agentId||n.agentId,conversationId:void 0!==A.conversationId?A.conversationId:e.getPersistedConversationId(),forceConversationId:A.forceConversationId,queue:[],inFlight:!1},A),e.fullResponseBuffer="",e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fA(e,t)}(t,e),A=t,n=[{key:"readScriptTagConfig",value:function(){try{var e=Array.from(document.getElementsByTagName("script")).reverse().find(function(e){return e.dataset&&(e.dataset.appId||e.dataset.agentId)||e.src&&e.src.includes("agent-widget")});return e?{appId:e.dataset.appId,agentId:e.dataset.agentId}:{}}catch(e){return{}}}},{key:"buildWebSocketUrl",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.baseWsUrl,t=new URLSearchParams;return this.config.appId&&t.append("appId",this.config.appId),this.config.agentId&&t.append("agentId",this.config.agentId),this.config.conversationId&&t.append("conversationId",this.config.conversationId),"".concat(e,"?").concat(t.toString())}},{key:"sendMessage",value:(o=iA().m(function e(t){var A=this;return iA().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,n){if(t&&t.trim())if(A.config.appId&&A.config.agentId){var o={text:t,resolve:e,reject:n};A.config.inFlight?A.config.queue.push(o):A.executeTask(o)}else n(new Error("Missing appId or agentId"));else n(new Error("Message is empty"))}))},e)}),r=function(){var e=this,t=arguments;return new Promise(function(A,n){var r=o.apply(e,t);function i(e){sA(r,A,n,i,a,"next",e)}function a(e){sA(r,A,n,i,a,"throw",e)}i(void 0)})},function(e){return r.apply(this,arguments)})},{key:"executeTask",value:function(e){var t=this;if(this.config.inFlight=!0,this.fullResponseBuffer="",!this.config.conversationId){var A=this.getPersistedConversationId();A&&(this.config.conversationId=A,console.log("🔍 TextChatSDK hydrated conversationId from storage:",A))}var n,o=this.buildWebSocketUrl(this.config.baseWsUrl),r=this.config.baseWsUrl.endsWith("/websocket")?this.config.baseWsUrl.replace(/\/websocket$/,""):"".concat(this.config.baseWsUrl,"/websocket"),i=this.buildWebSocketUrl(r),a=!1,s=!1,c=null,l=function(A){if(!s)try{var n={message:e.text},o=t.config.forceConversationId||t.config.conversationId;o&&(n.conversationId=o,t.config.forceConversationId&&!t.config.conversationId&&(t.config.conversationId=o,t.persistConversationId(o))),console.log("🔍 TextChatSDK sending payload:",n,"conversationId in config:",t.config.conversationId),A.send(JSON.stringify(n)),s=!0}catch(n){e.reject(n),t.emit("error",n);try{A.close()}catch(e){}}},u=function(e){return function(){t.config.conversationId?l(e):c=setTimeout(function(){return l(e)},200)}},d=function(A){return function(n){try{try{console.log("🔎 [TextChatSDK] WS <= raw:",n.data)}catch(e){}var o=JSON.parse(n.data);try{console.log("🔎 [TextChatSDK] WS <= parsed:",o)}catch(e){}if("hello"===o.type&&o.conversationId){if(console.log("🔍 TextChatSDK received conversationId:",o.conversationId),t.config.conversationId=o.conversationId,t.persistConversationId(o.conversationId),t.emit&&t.emit("conversationIdChanged",o.conversationId),!s&&A&&1===A.readyState){if(c)try{clearTimeout(c)}catch(e){}l(A)}return}if(!t.config.conversationId&&o.conversationId&&(console.log("🔍 TextChatSDK captured conversationId from message:",o.conversationId),t.config.conversationId=o.conversationId,t.persistConversationId(o.conversationId)),"chunk"===o.type&&"string"==typeof o.content)t.fullResponseBuffer+=o.content,t.emit("chunk",o.content);else if("done"===o.type){try{var r=o.text||o.content||o.answer||o.message||"";r&&!t.fullResponseBuffer&&(t.fullResponseBuffer=r)}catch(e){}!t.config.conversationId&&o.conversationId&&(console.log("🔍 TextChatSDK captured conversationId from done:",o.conversationId),t.config.conversationId=o.conversationId),t.persistConversationId(t.config.conversationId),t.emit("done",{text:t.fullResponseBuffer}),e.resolve({conversationId:t.config.conversationId,fullText:t.fullResponseBuffer});try{A.close()}catch(e){}}else if("error"===o.type){var i=new Error(o.message||"Server error");t.emit("error",i),e.reject(i);try{A.close()}catch(e){}}}catch(e){}}},p=function(A){if(1008===A.code&&A.reason&&(A.reason.includes("Domain not whitelisted")||A.reason.includes("domain")||A.reason.includes("whitelist"))){var n=new Error("DOMAIN_NOT_WHITELISTED");return n.reason=A.reason,n.code=A.code,t.emit("domainError",n),e.reject(n),t.config.inFlight=!1,void t.drainQueue()}t.config.inFlight=!1,t.drainQueue()},h=new WebSocket(o);h.onopen=u(h),h.onmessage=d(h),h.onerror=(n=h,function(A){if(!a){a=!0;try{n.close()}catch(e){}var o=new WebSocket(i);return o.onopen=u(o),o.onmessage=d(o),o.onerror=function(A){t.emit("error",A),e.reject(A)},void(o.onclose=p)}t.emit("error",A),e.reject(A)}),h.onclose=p}},{key:"drainQueue",value:function(){if(0!==this.config.queue.length&&!this.config.inFlight){var e=this.config.queue.shift();this.executeTask(e)}}},{key:"persistConversationId",value:function(e){try{e&&localStorage.setItem("ttp_text_chat_conversation_id",e)}catch(e){}}},{key:"getPersistedConversationId",value:function(){try{return localStorage.getItem("ttp_text_chat_conversation_id")||null}catch(e){return null}}},{key:"updateConfig",value:function(e){this.config=lA(lA({},this.config),e)}},{key:"destroy",value:function(){this.config.queue=[],this.config.inFlight=!1,this.removeAllListeners()}}],n&&dA(A.prototype,n),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,n,o,r}(O);function vA(e){return vA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vA(e)}function BA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var A=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=A){var n,o,r,i,a=[],s=!0,c=!1;try{if(r=(A=A.call(e)).next,0===t){if(Object(A)!==A)return;s=!1}else for(;!(s=(n=r.call(A)).done)&&(a.push(n.value),a.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=A.return&&(i=A.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}(e,t)||yA(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wA(e,t){var A="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!A){if(Array.isArray(e)||(A=yA(e))||t&&e&&"number"==typeof e.length){A&&(e=A);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){A=A.call(e)},n:function(){var e=A.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==A.return||A.return()}finally{if(a)throw r}}}}function yA(e,t){if(e){if("string"==typeof e)return bA(e,t);var A={}.toString.call(e).slice(8,-1);return"Object"===A&&e.constructor&&(A=e.constructor.name),"Map"===A||"Set"===A?Array.from(e):"Arguments"===A||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A)?bA(e,t):void 0}}function bA(e,t){(null==t||t>e.length)&&(t=e.length);for(var A=0,n=Array(t);A<t;A++)n[A]=e[A];return n}function CA(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return xA(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(xA(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,xA(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,xA(u,"constructor",c),xA(c,"constructor",s),s.displayName="GeneratorFunction",xA(c,o,"GeneratorFunction"),xA(u),xA(u,o,"Generator"),xA(u,n,function(){return this}),xA(u,"toString",function(){return"[object Generator]"}),(CA=function(){return{w:r,m:d}})()}function xA(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}xA=function(e,t,A,n){function r(t,A){xA(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},xA(e,t,A,n)}function QA(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function FA(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,UA(n.key),n)}}function UA(e){var t=function(e){if("object"!=vA(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=vA(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==vA(t)?t:t+""}function SA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(SA=function(){return!!e})()}function kA(e){return kA=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},kA(e)}function EA(e,t){return EA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},EA(e,t)}const IA=new(function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,A){return t=kA(t),function(e,t){if(t&&("object"==vA(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,SA()?Reflect.construct(t,A||[],kA(e).constructor):t.apply(e,A))}(this,t)).connections=new Map,e.connectionCounts=new Map,e.creatingConnections=new Set,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&EA(e,t)}(t,e),A=t,n=[{key:"getConnection",value:(o=CA().m(function e(t){var A,n,o=this;return CA().w(function(e){for(;;)switch(e.n){case 0:if(!this.connections.has(t)){e.n=1;break}return A=this.connections.get(t),this.connectionCounts.set(t,(this.connectionCounts.get(t)||0)+1),e.a(2,A);case 1:if(!this.creatingConnections||!this.creatingConnections.has(t)){e.n=2;break}return e.a(2,new Promise(function(e){var A=function(){if(o.connections.has(t)){var n=o.connections.get(t);o.connectionCounts.set(t,(o.connectionCounts.get(t)||0)+1),e(n)}else setTimeout(A,50)};A()}));case 2:return this.creatingConnections.add(t),n=new WebSocket(t),this.connections.set(t,n),this.connectionCounts.set(t,1),n.addEventListener("open",function(e){o.creatingConnections.delete(t),o.emit("open",e,t)}),n.addEventListener("close",function(e){o.creatingConnections.delete(t),o.connections.delete(t),o.connectionCounts.delete(t),o.emit("close",e,t)}),n.addEventListener("error",function(e){o.creatingConnections.delete(t),o.emit("error",e,t)}),n.addEventListener("message",function(e){o.emit("message",e,t)}),e.a(2,n)}},e,this)}),r=function(){var e=this,t=arguments;return new Promise(function(A,n){var r=o.apply(e,t);function i(e){QA(r,A,n,i,a,"next",e)}function a(e){QA(r,A,n,i,a,"throw",e)}i(void 0)})},function(e){return r.apply(this,arguments)})},{key:"releaseConnection",value:function(e){if(this.connections.has(e)){var t=this.connectionCounts.get(e)||0,A=Math.max(0,t-1);if(this.connectionCounts.set(e,A),0===A){var n=this.connections.get(e);n&&n.readyState===WebSocket.OPEN&&n.close(1e3,"No more subscribers"),this.connections.delete(e),this.connectionCounts.delete(e)}}}},{key:"forceClose",value:function(e){if(this.connections.has(e)){var t=this.connections.get(e);t&&t.readyState===WebSocket.OPEN&&t.close(1e3,"Force close"),this.connections.delete(e),this.connectionCounts.delete(e)}}},{key:"getConnectionStatus",value:function(e){return this.connections.has(e)?{exists:!0,readyState:this.connections.get(e).readyState,subscribers:this.connectionCounts.get(e)||0}:{exists:!1,readyState:null,subscribers:0}}},{key:"getAllConnections",value:function(){var e,t={},A=wA(this.connections.entries());try{for(A.s();!(e=A.n()).done;){var n=BA(e.value,2),o=n[0],r=n[1];t[o]={readyState:r.readyState,subscribers:this.connectionCounts.get(o)||0}}}catch(e){A.e(e)}finally{A.f()}return t}},{key:"clearAll",value:function(){var e,t=wA(this.connections.entries());try{for(t.s();!(e=t.n()).done;){var A=BA(e.value,2),n=(A[0],A[1]);n&&n.readyState===WebSocket.OPEN&&n.close(1e3,"Clear all")}}catch(e){t.e(e)}finally{t.f()}this.connections.clear(),this.connectionCounts.clear(),this.creatingConnections.clear()}}],n&&FA(A.prototype,n),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,n,o,r}(O));function TA(e){return TA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},TA(e)}function HA(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return DA(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(DA(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,DA(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,DA(u,"constructor",c),DA(c,"constructor",s),s.displayName="GeneratorFunction",DA(c,o,"GeneratorFunction"),DA(u),DA(u,o,"Generator"),DA(u,n,function(){return this}),DA(u,"toString",function(){return"[object Generator]"}),(HA=function(){return{w:r,m:d}})()}function DA(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}DA=function(e,t,A,n){function r(t,A){DA(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},DA(e,t,A,n)}function PA(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function OA(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,KA(n.key),n)}}function KA(e){var t=function(e){if("object"!=TA(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=TA(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==TA(t)?t:t+""}function MA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(MA=function(){return!!e})()}function LA(e){return LA=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},LA(e)}function RA(e,t){return RA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},RA(e,t)}var _A=function(e){function t(e){var A;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(A=function(e,t,A){return t=LA(t),function(e,t){if(t&&("object"==TA(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,MA()?Reflect.construct(t,A||[],LA(e).constructor):t.apply(e,A))}(this,t)).config=e,A.ws=null,A.isConnected=!1,A.connectionId=null,A}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&RA(e,t)}(t,e),A=t,n=[{key:"connect",value:(r=HA().m(function e(){var t=this;return HA().w(function(e){for(;;)if(0===e.n)return e.a(2,new Promise(function(e,A){try{t.connectionId=Date.now()+"_"+Math.random().toString(36).substr(2,9),t.connectResolve=e,t.connectReject=A;var n=t.config.signedUrl||t.config.websocketUrl;IA.getConnection(n,t.config).then(function(A){t.ws=A,t.setupEventListeners(),A.readyState===WebSocket.OPEN&&(t.isConnected=!0,t.emit("connected"),e(),t.connectResolve=null,t.connectReject=null)}).catch(function(e){console.error("🔌 WebSocketManager: Connection failed ".concat(t.connectionId),e),A(e),t.connectResolve=null,t.connectReject=null})}catch(e){console.error("🔌 WebSocketManager: Connection error ".concat(t.connectionId),e),A(e),t.connectResolve=null,t.connectReject=null}}))},e)}),i=function(){var e=this,t=arguments;return new Promise(function(A,n){var o=r.apply(e,t);function i(e){PA(o,A,n,i,a,"next",e)}function a(e){PA(o,A,n,i,a,"throw",e)}i(void 0)})},function(){return i.apply(this,arguments)})},{key:"setupEventListeners",value:function(){var e=this;if(this.ws){var t=function(t,A){A===(e.config.signedUrl||e.config.websocketUrl)&&(e.isConnected=!0,e.emit("connected"),e.connectResolve&&(e.connectResolve(),e.connectResolve=null,e.connectReject=null))},A=function(t,A){A===(e.config.signedUrl||e.config.websocketUrl)&&(e.isConnected=!1,e.emit("disconnected",t))},n=function(t,A){A===(e.config.signedUrl||e.config.websocketUrl)&&(e.emit("error",t),e.connectReject&&(e.connectReject(t),e.connectResolve=null,e.connectReject=null))},o=function(t,A){A===(e.config.signedUrl||e.config.websocketUrl)&&e.handleMessage(t)};IA.on("open",t),IA.on("close",A),IA.on("error",n),IA.on("message",o),this.eventHandlers={open:t,close:A,error:n,message:o}}}},{key:"disconnect",value:function(){this.eventHandlers&&(IA.off("open",this.eventHandlers.open),IA.off("close",this.eventHandlers.close),IA.off("error",this.eventHandlers.error),IA.off("message",this.eventHandlers.message));var e=this.config.signedUrl||this.config.websocketUrl;e&&IA.releaseConnection(e),this.ws=null,this.isConnected=!1}},{key:"sendMessage",value:function(e){if(this.isConnected&&this.ws)try{this.ws.send(JSON.stringify(e))}catch(e){console.warn("🔌 WebSocketManager: Failed to send message:",e.message)}}},{key:"sendBinary",value:function(e){if(this.isConnected&&this.ws)try{this.ws.send(e)}catch(e){console.warn("🔌 WebSocketManager: Failed to send binary data:",e.message)}}},{key:"handleMessage",value:function(e){var t=this;if(e.data instanceof ArrayBuffer)this.emit("binaryAudio",e.data);else if(e.data instanceof Blob)e.data.arrayBuffer().then(function(e){t.emit("binaryAudio",e)}).catch(function(e){console.error("🔌 WebSocketManager: Error converting Blob to ArrayBuffer:",e)});else try{var A=JSON.parse(e.data);"barge_in_ack"!==A.t&&"stop_sending"!==A.t||this.emit("bargeIn",A),"stop_playing"===A.t&&this.emit("stopPlaying",A),this.emit("message",A)}catch(e){this.emit("error",e)}}},{key:"getStatus",value:function(){return{isConnected:this.isConnected,readyState:this.ws?this.ws.readyState:null,connectionId:this.connectionId}}}],o=[{key:"getSingletonStatus",value:function(){return IA.getAllConnections()}},{key:"clearAllConnections",value:function(){IA.clearAll()}}],n&&OA(A.prototype,n),o&&OA(A,o),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,n,o,r,i}(O);function VA(e){return VA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},VA(e)}function jA(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return NA(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(NA(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,NA(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,NA(u,"constructor",c),NA(c,"constructor",s),s.displayName="GeneratorFunction",NA(c,o,"GeneratorFunction"),NA(u),NA(u,o,"Generator"),NA(u,n,function(){return this}),NA(u,"toString",function(){return"[object Generator]"}),(jA=function(){return{w:r,m:d}})()}function NA(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}NA=function(e,t,A,n){function r(t,A){NA(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},NA(e,t,A,n)}function GA(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function WA(e){return function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){GA(r,n,o,i,a,"next",e)}function a(e){GA(r,n,o,i,a,"throw",e)}i(void 0)})}}function zA(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,XA(n.key),n)}}function XA(e){var t=function(e){if("object"!=VA(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=VA(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==VA(t)?t:t+""}function JA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(JA=function(){return!!e})()}function YA(e){return YA=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},YA(e)}function qA(e,t){return qA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},qA(e,t)}var ZA=function(e){function t(e){var A;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(A=function(e,t,A){return t=YA(t),function(e,t){if(t&&("object"==VA(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,JA()?Reflect.construct(t,A||[],YA(e).constructor):t.apply(e,A))}(this,t)).config=e,A.audioContext=null,A.audioQueue=[],A.isPlaying=!1,A.isProcessingQueue=!1,A.currentSource=null,A.audioContextReady=!1,A.initializeAudioContext().catch(function(){}),A}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qA(e,t)}(t,e),A=t,n=[{key:"initializeAudioContext",value:(i=WA(jA().m(function e(){var t,A,n,o,r,i;return jA().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!this.audioContext||"closed"===this.audioContext.state){e.n=1;break}return e.a(2);case 1:if(e.p=1,t=this.config.sampleRate||this.config.outputSampleRate||44100,A={sampleRate:t},this.audioContext=new(window.AudioContext||window.webkitAudioContext)(A),"suspended"!==this.audioContext.state){e.n=2;break}return e.n=2,this.audioContext.resume();case 2:if("running"===this.audioContext.state)try{n=this.audioContext.sampleRate,o=this.audioContext.createBuffer(1,.01*n,n),(r=this.audioContext.createBufferSource()).buffer=o,r.connect(this.audioContext.destination),r.start(0),r.stop(this.audioContext.currentTime+.01)}catch(e){console.debug("AudioPlayer: AudioContext warmup skipped:",e)}this.audioContextReady=!0,e.n=4;break;case 3:e.p=3,i=e.v,console.warn("AudioPlayer: Failed to pre-initialize AudioContext:",i),this.audioContextReady=!1;case 4:return e.a(2)}},e,this,[[1,3]])})),function(){return i.apply(this,arguments)})},{key:"playAudio",value:function(e){var t=this;try{var A=this.createAudioBlob(e);if(this.audioQueue.push(A),!this.isPlaying&&!this.isProcessingQueue&&!this.currentSource){var n=this.audioContextReady?0:50;setTimeout(function(){return t.processQueue()},n)}}catch(e){this.emit("playbackError",e)}}},{key:"createAudioBlob",value:function(e){var t=new Uint8Array(e);if(t.length>=4){if(82===t[0]&&73===t[1]&&70===t[2]&&70===t[3])return new Blob([e],{type:"audio/wav"});if(255===t[0]&&!(224&~t[1]))return new Blob([e],{type:"audio/mpeg"});if(79===t[0]&&103===t[1]&&103===t[2]&&83===t[3])return new Blob([e],{type:"audio/ogg"})}return new Blob([e],{type:"audio/wav"})}},{key:"processQueue",value:(r=WA(jA().m(function e(){var t,A,n,o,r,i,a,s,c=this;return jA().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!this.isProcessingQueue&&0!==this.audioQueue.length){e.n=1;break}return e.a(2);case 1:if(this.isProcessingQueue=!0,t=this.audioQueue.shift()){e.n=2;break}return this.isProcessingQueue=!1,e.a(2);case 2:if(e.p=2,A=!this.isPlaying&&null===this.currentSource,this.audioContext&&"closed"!==this.audioContext.state){e.n=3;break}return e.n=3,this.initializeAudioContext();case 3:if("suspended"!==(n=this.audioContext).state){e.n=5;break}return e.n=4,n.resume();case 4:if(!A){e.n=5;break}return e.n=5,new Promise(function(e){return setTimeout(e,10)});case 5:if("running"===n.state){e.n=7;break}if(console.warn("AudioPlayer: AudioContext not in running state:",n.state),"suspended"!==n.state){e.n=7;break}return e.n=6,n.resume();case 6:return e.n=7,new Promise(function(e){return setTimeout(e,10)});case 7:return e.n=8,t.arrayBuffer();case 8:return o=e.v,e.n=9,n.decodeAudioData(o);case 9:r=e.v,i=A&&!this.isPlaying&&null===this.currentSource,(a=n.createBufferSource()).buffer=r,a.connect(n.destination),this.currentSource=a,this.isPlaying=!0,i&&this.emit("playbackStarted"),a.onended=function(){c.currentSource=null,c.isProcessingQueue=!1,c.audioQueue.length>0?setTimeout(function(){return c.processQueue()},0):setTimeout(function(){0!==c.audioQueue.length||c.currentSource||(c.isPlaying=!1,c.emit("playbackStopped"))},100)},a.start(),e.n=11;break;case 10:e.p=10,s=e.v,this.currentSource=null,this.emit("playbackError",s),this.audioQueue.length>0?(this.isProcessingQueue=!1,setTimeout(function(){return c.processQueue()},100)):(this.isPlaying=!1,this.isProcessingQueue=!1,this.emit("playbackStopped"));case 11:return e.a(2)}},e,this,[[2,10]])})),function(){return r.apply(this,arguments)})},{key:"stop",value:function(){this.stopImmediate()}},{key:"stopImmediate",value:function(){var e=this.isPlaying||null!==this.currentSource;if(this.currentSource){try{this.currentSource.stop()}catch(e){}this.currentSource=null}this.isPlaying=!1,this.isProcessingQueue=!1,this.audioQueue=[],e&&this.emit("playbackStopped")}},{key:"resumeAudioContext",value:(o=WA(jA().m(function e(){var t;return jA().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this.audioContext&&"closed"!==this.audioContext.state){e.n=2;break}return e.n=1,this.initializeAudioContext();case 1:return e.a(2);case 2:if("suspended"!==this.audioContext.state){e.n=6;break}return e.p=3,e.n=4,this.audioContext.resume();case 4:console.log("✅ AudioPlayer: AudioContext resumed after mic permission"),e.n=6;break;case 5:e.p=5,t=e.v,console.warn("⚠️ AudioPlayer: Failed to resume AudioContext:",t);case 6:return e.a(2)}},e,this,[[3,5]])})),function(){return o.apply(this,arguments)})},{key:"getStatus",value:function(){return{isPlaying:this.isPlaying,isProcessingQueue:this.isProcessingQueue,queueLength:this.audioQueue.length,audioContextState:this.audioContext?this.audioContext.state:"closed"}}},{key:"destroy",value:function(){this.stop(),this.audioContext&&"closed"!==this.audioContext.state&&(this.audioContext.close(),this.audioContext=null),this.audioContextReady=!1}}],n&&zA(A.prototype,n),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,n,o,r,i}(O);function $A(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return en(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(en(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,en(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,en(u,"constructor",c),en(c,"constructor",s),s.displayName="GeneratorFunction",en(c,o,"GeneratorFunction"),en(u),en(u,o,"Generator"),en(u,n,function(){return this}),en(u,"toString",function(){return"[object Generator]"}),($A=function(){return{w:r,m:d}})()}function en(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}en=function(e,t,A,n){function r(t,A){en(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},en(e,t,A,n)}function tn(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function An(){var e=navigator.userAgent,t=/iPad|iPhone|iPod/.test(e)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,A=/Android/.test(e),n=/Mac/.test(e)&&!t,o=/Win/.test(e),r=/Chrome/.test(e)&&!/Edg|OPR/.test(e),i=/Safari/.test(e)&&!/Chrome/.test(e),a=/Firefox/.test(e),s=/Edg/.test(e),c=/SamsungBrowser/.test(e),l="unknown";t?l="safari":c?l="samsung":r?l="chrome":i?l="safari":a?l="firefox":s&&(l="edge");var u="unknown";return t?u="ios":A?u="android":n?u="mac":o&&(u="windows"),{platform:u,browser:l,isIOS:t,isAndroid:A,isMac:n,isWindows:o,isMobile:t||A,isDesktop:!t&&!A}}function nn(){return on.apply(this,arguments)}function on(){var e;return e=$A().m(function e(){var t;return $A().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!navigator.permissions||!navigator.permissions.query){e.n=2;break}return e.n=1,navigator.permissions.query({name:"microphone"});case 1:return t=e.v,e.a(2,t.state);case 2:e.n=4;break;case 3:e.p=3,e.v,console.log("⚠️ MicPermissionUtils: Permissions API not available or not supported for microphone");case 4:return e.a(2,"unknown")}},e,null,[[0,3]])}),on=function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){tn(r,n,o,i,a,"next",e)}function a(e){tn(r,n,o,i,a,"throw",e)}i(void 0)})},on.apply(this,arguments)}function rn(e){var t=e.platform,A=e.browser,n={ios:{title:"Enable Microphone on iPhone/iPad",icon:"📱",steps:["Tap the <strong>lock icon 🔒</strong>, <strong>information icon ℹ️</strong>, or <strong>AA icon</strong> in the address bar","Tap <strong>Website Settings</strong> or <strong>Permissions</strong>","Find <strong>Microphone</strong> and set it to <strong>Allow</strong>","Return to this page and refresh"],altTitle:"Alternative Method",altSteps:["Open the <strong>Settings</strong> app on your device","Scroll down and tap <strong>Safari</strong> (or your browser app)",'Tap <strong>Microphone</strong> under "Settings for Websites"',"Set it to <strong>Allow</strong> or <strong>Ask</strong>","Return to this page and refresh"],note:"On iOS, you can also change permissions in the browser address bar or in device Settings.",canOpenSettings:!0,settingsButtonText:"Open Settings App"},android_chrome:{title:"Enable Microphone in Chrome",icon:"🤖",steps:["Tap the <strong>lock icon 🔒</strong>, <strong>information icon ℹ️</strong>, or <strong>settings icon ⋮</strong> in the address bar","Tap <strong>Permissions</strong>","Tap <strong>Microphone</strong>","Select <strong>Allow</strong>","The page will refresh automatically"],altTitle:"Alternative Method",altSteps:["Tap the <strong>⋮ menu</strong> (three dots)","Tap <strong>Settings → Site settings → Microphone</strong>","Find this website and set to <strong>Allow</strong>"],canOpenSettings:!0,settingsButtonText:"Open App Settings"},android_firefox:{title:"Enable Microphone in Firefox",icon:"🦊",steps:["Tap the <strong>lock icon 🔒</strong> or <strong>information icon ℹ️</strong> in the address bar","Tap <strong>Edit Site Permissions</strong>","Toggle <strong>Microphone</strong> to enabled","Refresh the page"],canOpenSettings:!1},android_samsung:{title:"Enable Microphone in Samsung Browser",icon:"📱",steps:["Tap the <strong>menu icon</strong> (three lines)","Tap <strong>Settings → Sites and downloads</strong>","Tap <strong>Site permissions → Microphone</strong>","Find this website and set to <strong>Allow</strong>","Return and refresh the page"],canOpenSettings:!1},desktop_chrome:{title:"Enable Microphone in Chrome",icon:"🌐",steps:["Click the <strong>lock icon 🔒</strong> or <strong>information icon ℹ️</strong> in the address bar (left side)","Find <strong>Microphone</strong> in the dropdown menu",'Change it from "Block" to <strong>Allow</strong>',"Click the <strong>Refresh</strong> button or press F5"],showAddressBarHint:!0,canOpenSettings:!1},desktop_safari:{title:"Enable Microphone in Safari",icon:"🧭",steps:["Click <strong>Safari</strong> in the menu bar (top of screen)","Click <strong>Settings for This Website...</strong>","Find <strong>Microphone</strong> in the popup","Change it to <strong>Allow</strong>","Close settings and refresh the page"],canOpenSettings:!1},desktop_firefox:{title:"Enable Microphone in Firefox",icon:"🦊",steps:["Click the <strong>lock icon 🔒</strong> in the address bar",'Click the <strong>X</strong> next to "Blocked" for Microphone',"Refresh the page (press F5)","Click <strong>Allow</strong> when prompted again"],note:"Firefox requires you to clear the block and then re-allow on the next prompt.",showAddressBarHint:!0,canOpenSettings:!1},desktop_edge:{title:"Enable Microphone in Edge",icon:"🌐",steps:["Click the <strong>lock icon 🔒</strong> in the address bar","Find <strong>Microphone</strong> in the permissions list","Change it to <strong>Allow</strong>","Refresh the page"],showAddressBarHint:!0,canOpenSettings:!1},unknown:{title:"Enable Microphone Access",icon:"🎤",steps:["Look for a <strong>lock icon 🔒</strong>, <strong>information icon ℹ️</strong>, or <strong>settings icon</strong> in your browser's address bar","Find the <strong>Microphone</strong> permission setting","Change it to <strong>Allow</strong>","Refresh this page"],canOpenSettings:!1}};return"ios"===t?n.ios:"android"===t?n["android_".concat(A)]||n.android_chrome:n["desktop_".concat(A)]||n.desktop_chrome}function an(e){var t=e.isIOS,A=e.isAndroid,n=e.browser;if(t)try{return window.location.href="app-settings:",!0}catch(e){return console.warn("Could not open iOS settings:",e),!1}if(A&&"chrome"===n)try{return window.location.href="intent:#Intent;action=android.settings.APPLICATION_DETAILS_SETTINGS;data=package:com.android.chrome;end",!0}catch(e){return console.warn("Could not open Android settings:",e),!1}return!1}function sn(e){return sn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sn(e)}function cn(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ln(n.key),n)}}function ln(e){var t=function(e){if("object"!=sn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=sn(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==sn(t)?t:t+""}function un(e,t){var A="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!A){if(Array.isArray(e)||(A=function(e,t){if(e){if("string"==typeof e)return dn(e,t);var A={}.toString.call(e).slice(8,-1);return"Object"===A&&e.constructor&&(A=e.constructor.name),"Map"===A||"Set"===A?Array.from(e):"Arguments"===A||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A)?dn(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){A&&(e=A);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){A=A.call(e)},n:function(){var e=A.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==A.return||A.return()}finally{if(a)throw r}}}}function dn(e,t){(null==t||t>e.length)&&(t=e.length);for(var A=0,n=Array(t);A<t;A++)n[A]=e[A];return n}var pn=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.overlay=null,this.modal=null},(t=[{key:"createOverlay",value:function(){var e=document.createElement("div");return e.className="mic-permission-overlay",e.style.cssText="\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.6);\n backdrop-filter: blur(4px);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n padding: 20px;\n animation: mic-fadeIn 0.2s ease-out;\n ",document.getElementById("mic-permission-styles")||this.injectStyles(),e}},{key:"injectStyles",value:function(){if(!document.getElementById("mic-permission-styles")){var e=document.createElement("style");e.id="mic-permission-styles",e.textContent="\n @keyframes mic-fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n \n @keyframes mic-slideUp {\n from {\n opacity: 0;\n transform: translateY(20px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n \n @keyframes mic-bounce {\n 0%, 100% { transform: translateY(0); }\n 50% { transform: translateY(-5px); }\n }\n \n .mic-permission-overlay {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.6);\n backdrop-filter: blur(4px);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n padding: 20px;\n animation: mic-fadeIn 0.2s ease-out;\n }\n \n .mic-permission-modal {\n background: #ffffff;\n border-radius: 16px;\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\n max-width: 480px;\n width: 100%;\n padding: 32px;\n position: relative;\n animation: mic-slideUp 0.3s ease-out;\n max-height: 90vh;\n overflow-y: auto;\n }\n \n .mic-permission-modal__close {\n position: absolute;\n top: 16px;\n right: 16px;\n background: none;\n border: none;\n font-size: 20px;\n cursor: pointer;\n color: #6b7280;\n width: 32px;\n height: 32px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: background 0.2s;\n }\n \n .mic-permission-modal__close:hover {\n background: #e5e7eb;\n }\n \n .mic-permission-modal__icon {\n font-size: 48px;\n text-align: center;\n margin-bottom: 16px;\n }\n \n .mic-permission-modal__title {\n font-size: 24px;\n font-weight: 700;\n color: #111827;\n margin: 0 0 12px;\n line-height: 1.3;\n text-align: center;\n }\n \n .mic-permission-modal__description {\n color: #6b7280;\n font-size: 16px;\n line-height: 1.6;\n margin: 0 0 20px;\n text-align: center;\n }\n \n .mic-permission-modal__highlight {\n display: flex;\n align-items: center;\n gap: 12px;\n background: linear-gradient(135deg, #dbeafe, #ede9fe);\n padding: 16px 20px;\n border-radius: 8px;\n margin-bottom: 20px;\n border: 1px solid #bfdbfe;\n }\n \n .mic-permission-modal__highlight-icon {\n font-size: 24px;\n animation: mic-bounce 1s infinite;\n }\n \n .mic-permission-modal__status {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background: #fef2f2;\n color: #ef4444;\n padding: 12px 16px;\n border-radius: 8px;\n margin-bottom: 20px;\n font-weight: 500;\n }\n \n .mic-permission-modal__note {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n background: #fffbeb;\n color: #92400e;\n padding: 12px 16px;\n border-radius: 8px;\n margin-bottom: 20px;\n font-size: 14px;\n line-height: 1.5;\n border: 1px solid #fde68a;\n }\n \n .mic-permission-modal__steps {\n margin-bottom: 20px;\n }\n \n .mic-permission-modal__steps h3 {\n font-size: 14px;\n font-weight: 600;\n color: #6b7280;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n margin: 0 0 12px;\n }\n \n .mic-permission-modal__steps ol {\n margin: 0;\n padding-left: 24px;\n counter-reset: step-counter;\n list-style: none;\n }\n \n .mic-permission-modal__steps li {\n position: relative;\n padding: 12px 0 12px 16px;\n border-left: 2px solid #e5e7eb;\n color: #111827;\n font-size: 15px;\n line-height: 1.5;\n counter-increment: step-counter;\n }\n \n .mic-permission-modal__steps li::before {\n content: counter(step-counter);\n position: absolute;\n left: -14px;\n top: 10px;\n width: 24px;\n height: 24px;\n background: #4f46e5;\n color: white;\n border-radius: 50%;\n font-size: 12px;\n font-weight: 600;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n \n .mic-permission-modal__steps li:last-child {\n border-left-color: transparent;\n }\n \n .mic-permission-modal__actions {\n display: flex;\n flex-direction: column;\n gap: 10px;\n margin-top: 24px;\n }\n \n .mic-permission-modal__btn {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n padding: 14px 24px;\n border-radius: 8px;\n font-size: 16px;\n font-weight: 600;\n cursor: pointer;\n transition: all 0.2s;\n border: none;\n width: 100%;\n }\n \n .mic-permission-modal__btn--primary {\n background: #4f46e5;\n color: white;\n }\n \n .mic-permission-modal__btn--primary:hover {\n background: #4338ca;\n transform: translateY(-1px);\n }\n \n .mic-permission-modal__btn--secondary {\n background: #e5e7eb;\n color: #111827;\n }\n \n .mic-permission-modal__btn--secondary:hover {\n background: #d1d5db;\n }\n \n .mic-permission-modal__footer {\n text-align: center;\n font-size: 13px;\n color: #6b7280;\n margin-top: 20px;\n margin-bottom: 0;\n }\n \n .mic-permission-modal__visual-guide {\n width: 100%;\n max-width: 380px;\n height: auto;\n margin: 20px auto;\n border-radius: 8px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);\n display: block;\n }\n \n .mic-permission-modal__visual-guide-container {\n text-align: center;\n margin: 20px 0;\n }\n \n @media (max-width: 480px) {\n .mic-permission-modal {\n padding: 24px 20px;\n margin: 10px;\n max-height: 85vh;\n }\n \n .mic-permission-modal__title {\n font-size: 20px;\n }\n \n .mic-permission-modal__icon {\n font-size: 40px;\n }\n \n .mic-permission-modal__visual-guide {\n max-width: 100%;\n }\n }\n ",document.head.appendChild(e)}}},{key:"close",value:function(){this.overlay&&this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),this.overlay=null,this.modal=null}},{key:"show",value:function(){this.overlay&&this.modal&&document.body.appendChild(this.overlay)}}])&&cn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function hn(e,t){var A=new pn,n=A.createOverlay(),o=An(),r=document.createElement("div");return r.className="mic-permission-modal",r.innerHTML='\n <div class="mic-permission-modal__icon">🎤</div>\n <h2 class="mic-permission-modal__title">Enable Your Microphone</h2>\n <p class="mic-permission-modal__description">\n To start a voice call with our agent, we need access to your microphone.\n </p>\n <div class="mic-permission-modal__highlight">\n <span class="mic-permission-modal__highlight-icon">👆</span>\n <span>Please click <strong>"Allow"</strong> on the next popup</span>\n </div>\n '.concat(o.isIOS?'\n <div class="mic-permission-modal__note">\n <span>ℹ️</span>\n <span>On iPhone/iPad, you may need to allow microphone access in your device Settings.</span>\n </div>\n ':"",'\n <div class="mic-permission-modal__actions">\n <button class="mic-permission-modal__btn mic-permission-modal__btn--primary" data-action="accept">\n Continue\n </button>\n <button class="mic-permission-modal__btn mic-permission-modal__btn--secondary" data-action="cancel">\n Not Now\n </button>\n </div>\n '),n.appendChild(r),A.overlay=n,A.modal=r,r.querySelector('[data-action="accept"]').addEventListener("click",function(){A.close(),e()}),r.querySelector('[data-action="cancel"]').addEventListener("click",function(){A.close(),t()}),n.addEventListener("click",function(e){e.target===n&&(A.close(),t())}),A.show(),A}function gn(e,t){var A,n,o,r=new pn,i=r.createOverlay(),a=An(),s=rn(a),c=document.createElement("div");c.className="mic-permission-modal";var l="";s.altSteps&&s.altSteps.length>0&&(l='\n <div style="margin-top: 20px; border-top: 1px solid #e5e7eb; padding-top: 16px;">\n <button class="mic-permission-modal__alt-toggle" style="background: none; border: none; color: #4f46e5; font-size: 14px; font-weight: 500; cursor: pointer; padding: 0; margin-bottom: 12px;">\n ▼ '.concat(s.altTitle||"Alternative method",'\n </button>\n <ol style="margin: 0; padding-left: 20px; display: none;">\n ').concat(s.altSteps.map(function(e){return'<li style="padding: 8px 0; font-size: 14px; color: #6b7280;">'.concat(e,"</li>")}).join(""),"\n </ol>\n </div>\n "));var u=function(e){var t,A=e.platform,n=e.browser,o=document.getElementsByTagName("script"),r="",i=un(o);try{for(i.s();!(t=i.n()).done;){var a=t.value.src;if(a&&(a.includes("agent-widget.js")||a.includes("ttp-agent-sdk")||a.includes("ttp-sdk-front")))try{new URL(a),r=a.substring(0,a.lastIndexOf("/"));break}catch(e){var s=a.match(/^(.*\/)[^\/]+$/);if(s){r=s[1];break}}}}catch(e){i.e(e)}finally{i.f()}var c;if(c="ios"===A?"ios-settings.svg":"android"===A?"android-chrome.svg":"chrome"===n?"desktop-chrome.svg":"safari"===n?"desktop-safari.svg":"firefox"===n?"desktop-firefox.svg":"edge"===n?"desktop-edge.svg":"desktop-chrome.svg",!r||""===r||r.startsWith("/")){var l,u=un(o);try{for(u.s();!(l=u.n()).done;){var d=l.value.src;if(d&&(d.includes("cdn.talktopc.com")||d.includes("talktopc.com"))){if(d.includes("/ttp-agent-sdk/")||d.includes("/ttp-sdk-front/")){var p=d.match(/(https?:\/\/[^\/]+(?:\/[^\/]+)*)/);if(p){r=p[1].replace(/\/[^\/]+\.js$/,"");break}}if(!r&&(d.includes("cdn.talktopc.com")||d.includes("talktopc.com"))){r="https://cdn.talktopc.com/ttp-agent-sdk";break}}}}catch(e){u.e(e)}finally{u.f()}if(!r||""===r)if(window.location.hostname.includes("cdn.talktopc.com")||window.location.hostname.includes("talktopc.com"))r="https://cdn.talktopc.com/ttp-agent-sdk";else{var h=window.location.pathname.split("/");h.pop(),(r=window.location.origin+h.join("/"))&&r!==window.location.origin||(r=window.location.origin)}}r=r.replace(/\/$/,"");var g="".concat(r,"/shared/mic-permission-assets/").concat(c);return"undefined"!=typeof console&&console.log&&console.log("[MicPermission] Visual guide path:",g,"Base path:",r,"Platform:",A,"Browser:",n),g}(a);c.innerHTML='\n <button class="mic-permission-modal__close" data-action="close">✕</button>\n <div style="display: flex; align-items: center; gap: 12px; margin-bottom: 20px;">\n <span style="font-size: 32px;">'.concat(s.icon,'</span>\n <h2 class="mic-permission-modal__title" style="text-align: left; margin: 0;">').concat(s.title,'</h2>\n </div>\n <div class="mic-permission-modal__status">\n <span>🚫</span>\n <span>Microphone access is currently blocked</span>\n </div>\n ').concat(s.note?'\n <div class="mic-permission-modal__note">\n <span>ℹ️</span>\n <span>'.concat(s.note,"</span>\n </div>\n "):"",'\n <div class="mic-permission-modal__visual-guide-container">\n <img src="').concat(u,'" alt="Visual guide for enabling microphone" class="mic-permission-modal__visual-guide" \n onerror="console.error(\'[MicPermission] Failed to load image:\', this.src); this.style.display=\'none\';" \n onload="console.log(\'[MicPermission] Image loaded successfully:\', this.src);" />\n </div>\n <div class="mic-permission-modal__steps">\n <h3>Follow these steps:</h3>\n <ol>\n ').concat(s.steps.map(function(e){return"<li>".concat(e,"</li>")}).join(""),"\n </ol>\n </div>\n ").concat(l,'\n <div class="mic-permission-modal__actions">\n ').concat(s.canOpenSettings?'\n <button class="mic-permission-modal__btn mic-permission-modal__btn--primary" data-action="open-settings">\n '.concat(s.settingsButtonText||"Open Settings","\n </button>\n "):"","\n ").concat(s.showAddressBarHint?'\n <button class="mic-permission-modal__btn mic-permission-modal__btn--primary" data-action="show-hint">\n Show Me Where\n </button>\n ':"",'\n <button class="mic-permission-modal__btn mic-permission-modal__btn--secondary" data-action="refresh">\n 🔄 Refresh Page\n </button>\n </div>\n <p class="mic-permission-modal__footer">\n After enabling microphone access, return here and click "Refresh Page"\n </p>\n '),i.appendChild(c),r.overlay=i,r.modal=c,null===(A=c.querySelector('[data-action="close"]'))||void 0===A||A.addEventListener("click",function(){r.close(),e()}),null===(n=c.querySelector('[data-action="open-settings"]'))||void 0===n||n.addEventListener("click",function(){an(a)}),null===(o=c.querySelector('[data-action="refresh"]'))||void 0===o||o.addEventListener("click",function(){window.location.reload()});var d=c.querySelector('[data-action="show-hint"]');d&&d.addEventListener("click",function(){r.close(),e(),function(){var e=document.getElementById("mic-address-bar-hint");e&&e.remove(),An();var t,A=document.getElementsByTagName("script"),n="",o=un(A);try{for(o.s();!(t=o.n()).done;){var r=t.value.src;if(r&&(r.includes("agent-widget.js")||r.includes("ttp-agent-sdk")||r.includes("ttp-sdk-front")))try{new URL(r),n=r.substring(0,r.lastIndexOf("/"));break}catch(e){var i=r.match(/^(.*\/)[^\/]+$/);if(i){n=i[1];break}}}}catch(e){o.e(e)}finally{o.f()}if(!n||""===n||n.startsWith("/")){var a,s=un(A);try{for(s.s();!(a=s.n()).done;){var c=a.value.src;if(c&&(c.includes("cdn.talktopc.com")||c.includes("talktopc.com"))){if(c.includes("/ttp-agent-sdk/")||c.includes("/ttp-sdk-front/")){var l=c.match(/(https?:\/\/[^\/]+(?:\/[^\/]+)*)/);if(l){n=l[1].replace(/\/[^\/]+\.js$/,"");break}}if(!n&&(c.includes("cdn.talktopc.com")||c.includes("talktopc.com"))){n="https://cdn.talktopc.com/ttp-agent-sdk";break}}}}catch(e){s.e(e)}finally{s.f()}if(!n||""===n)if(window.location.hostname.includes("cdn.talktopc.com")||window.location.hostname.includes("talktopc.com"))n="https://cdn.talktopc.com/ttp-agent-sdk";else{var u=window.location.pathname.split("/");u.pop(),(n=window.location.origin+u.join("/"))&&n!==window.location.origin||(n=window.location.origin)}}n=n.replace(/\/$/,"");var d="".concat(n,"/shared/mic-permission-assets/address-bar-hint.svg"),p=document.createElement("div");p.id="mic-address-bar-hint",p.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n z-index: 10001;\n padding: 10px 20px;\n pointer-events: none;\n animation: mic-fadeIn 0.3s ease-out;\n display: flex;\n justify-content: center;\n ";var h=document.createElement("div");h.style.cssText="\n display: flex;\n align-items: center;\n gap: 12px;\n background: #f59e0b;\n color: white;\n padding: 12px 20px;\n border-radius: 0 0 8px 8px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n pointer-events: all;\n animation: mic-slideDown 0.3s ease-out;\n max-width: 540px;\n ";var g=document.createElement("div");g.style.cssText="\n flex-shrink: 0;\n ";var f=document.createElement("img");f.src=d,f.alt="Address bar hint",f.style.cssText="\n width: auto;\n height: 80px;\n display: block;\n ",f.onerror=function(){g.style.display="none"},g.appendChild(f);var m=document.createElement("div");m.style.cssText="\n display: flex;\n flex-direction: column;\n gap: 4px;\n flex: 1;\n ";var v=document.createElement("div");v.style.cssText="\n font-size: 15px;\n font-weight: 500;\n ",v.innerHTML="Click the <strong>lock icon 🔒</strong>, <strong>information icon ℹ️</strong>, or <strong>settings icon ⋮</strong> in the address bar to enable microphone";var B=document.createElement("button");if(B.style.cssText="\n background: rgba(255, 255, 255, 0.2);\n border: none;\n color: white;\n width: 28px;\n height: 28px;\n border-radius: 50%;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n transition: background 0.2s;\n flex-shrink: 0;\n ",B.textContent="✕",B.addEventListener("click",function(){p.remove()}),B.addEventListener("mouseenter",function(){B.style.background="rgba(255, 255, 255, 0.3)"}),B.addEventListener("mouseleave",function(){B.style.background="rgba(255, 255, 255, 0.2)"}),!document.getElementById("mic-address-bar-hint-styles")){var w=document.createElement("style");w.id="mic-address-bar-hint-styles",w.textContent="\n @keyframes mic-slideDown {\n from {\n opacity: 0;\n transform: translateY(-100%);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n \n @keyframes mic-pointUp {\n 0%, 100% {\n transform: translate(0, 0);\n }\n 50% {\n transform: translate(-5px, -5px);\n }\n }\n ",document.head.appendChild(w)}m.appendChild(v),h.appendChild(g),h.appendChild(m),h.appendChild(B),p.appendChild(h),document.body.appendChild(p),setTimeout(function(){p.parentNode&&(p.style.opacity="0",p.style.transition="opacity 0.3s ease-out",setTimeout(function(){p.parentNode&&p.remove()},300))},1e4)}()});var p=c.querySelector(".mic-permission-modal__alt-toggle");if(p&&s.altSteps){var h=p.nextElementSibling;h&&(h.style.display="none",p.addEventListener("click",function(){"none"===h.style.display?(h.style.display="block",p.innerHTML="▼ ".concat(s.altTitle||"Alternative method")):(h.style.display="none",p.innerHTML="▶ ".concat(s.altTitle||"Alternative method"))}))}return i.addEventListener("click",function(t){t.target===i&&(r.close(),e())}),r.show(),r}function fn(e){var t=new pn,A=t.createOverlay(),n=document.createElement("div");return n.className="mic-permission-modal",n.innerHTML='\n <div class="mic-permission-modal__icon">🎤❌</div>\n <h2 class="mic-permission-modal__title">No Microphone Found</h2>\n <p class="mic-permission-modal__description">\n We couldn\'t detect a microphone on your device. Please make sure:\n </p>\n <ul style="list-style: none; padding: 0; margin: 0 0 24px;">\n <li style="padding: 10px 0 10px 32px; position: relative; color: #111827; border-bottom: 1px solid #e5e7eb;">\n <span style="position: absolute; left: 0; font-size: 18px;">☐</span>\n Your microphone is properly connected\n </li>\n <li style="padding: 10px 0 10px 32px; position: relative; color: #111827; border-bottom: 1px solid #e5e7eb;">\n <span style="position: absolute; left: 0; font-size: 18px;">☐</span>\n Your microphone is not muted at the hardware level\n </li>\n <li style="padding: 10px 0 10px 32px; position: relative; color: #111827;">\n <span style="position: absolute; left: 0; font-size: 18px;">☐</span>\n No other app is exclusively using the microphone\n </li>\n </ul>\n <div class="mic-permission-modal__actions">\n <button class="mic-permission-modal__btn mic-permission-modal__btn--primary" data-action="retry">\n Retry\n </button>\n <button class="mic-permission-modal__btn mic-permission-modal__btn--secondary" data-action="close">\n Close\n </button>\n </div>\n ',A.appendChild(n),t.overlay=A,t.modal=n,n.querySelector('[data-action="retry"]').addEventListener("click",function(){window.location.reload()}),n.querySelector('[data-action="close"]').addEventListener("click",function(){t.close(),e()}),A.addEventListener("click",function(n){n.target===A&&(t.close(),e())}),t.show(),t}function mn(e){return mn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mn(e)}function vn(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Bn(n.key),n)}}function Bn(e){var t=function(e){if("object"!=mn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=mn(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==mn(t)?t:t+""}var wn=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=t,this.config=t.config},(t=[{key:"t",value:function(e){return this.voiceInterface.t(e)}},{key:"getText",value:function(e,t){return this.voiceInterface.getText(e,t)}},{key:"getTooltip",value:function(e){return this.voiceInterface.getTooltip(e)}},{key:"generateHTML",value:function(){return this.voiceInterface.isMobile?this.generateMobileHTML():'<div class="voice-interface" id="voiceInterface">\n \x3c!-- Before Call State --\x3e\n <div id="voiceIdleState">\n <div class="voice-avatar" id="voiceAvatar">🤖</div>\n <div class="voice-status">\n <div class="voice-status-title">'.concat(this.getText("startCallTitle","clickToStartCall"),'</div>\n <div class="voice-status-subtitle">').concat(this.getText("startCallSubtitle","realTimeVoice"),'</div>\n </div>\n <button class="start-call-btn" id="startCallBtn">\n <svg width="32" height="32" viewBox="0 0 24 24" fill="currentColor">\n <path d="M20.01 15.38c-1.23 0-2.42-.2-3.53-.56-.35-.12-.74-.03-1.01.24l-1.57 1.97c-2.83-1.35-5.48-3.9-6.89-6.83l1.95-1.66c.27-.28.35-.67.24-1.02-.37-1.11-.56-2.3-.56-3.53 0-.54-.45-.99-.99-.99H4.19C3.65 3 3 3.24 3 3.99 3 13.28 10.73 21 20.01 21c.71 0 .99-.63.99-1.18v-3.45c0-.54-.45-.99-.99-.99z"/>\n </svg>\n <span>').concat(this.getText("startCallButtonText","startCall"),'</span>\n </button>\n </div>\n \x3c!-- During Call State - Desktop View --\x3e\n <div id="voiceActiveState" style="display: none;">\n \x3c!-- Original Multi-Row Voice Section (shown when history is collapsed) --\x3e\n <div class="desktop-voice-section" id="desktopVoiceSection">\n \x3c!-- Timer --\x3e\n <div class="desktop-timer">\n <div class="timer-dot"></div>\n <span id="desktopTimerText">00:00</span>\n </div>\n\n \x3c!-- Main Waveform --\x3e\n <div class="desktop-main-waveform" id="desktopMainWaveform">\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n </div>\n\n \x3c!-- Status --\x3e\n <div class="desktop-status" id="desktopStatus">\n <div class="status-dot"></div>\n <span id="desktopStatusText">').concat(this.t("listening")||"Listening...",'</span>\n </div>\n\n \x3c!-- Controls --\x3e\n <div class="desktop-controls">\n <button class="desktop-control-btn secondary" id="desktopMuteBtn" title="').concat(this.getTooltip("mute"),'">\n <svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" class="desktop-mic-icon">\n <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2"/>\n <line x1="12" y1="19" x2="12" y2="23"/>\n </svg>\n <svg fill="none" viewBox="0 0 24 24" class="desktop-mic-off-icon" style="display: none; position: absolute;">\n \x3c!-- Original mic icon (same as normal state) --\x3e\n <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" stroke="currentColor" stroke-width="2" fill="none"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2" stroke="currentColor" stroke-width="2" fill="none"/>\n <line x1="12" y1="19" x2="12" y2="23" stroke="currentColor" stroke-width="2"/>\n \x3c!-- Red circle surrounding the icon --\x3e\n <circle cx="12" cy="12" r="11.8" fill="none" stroke="#ef4444" stroke-width="2"/>\n \x3c!-- Red diagonal strike line --\x3e\n <line x1="4" y1="4" x2="20" y2="20" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round"/>\n </svg>\n </button>\n <button class="desktop-control-btn danger" id="desktopEndCallBtn" title="').concat(this.getTooltip("endCall"),'">\n <svg fill="none" stroke="currentColor" stroke-width="1.8" viewBox="0 0 24 24" style="overflow: visible;">\n <path d="M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.5 19.5 0 01-6-6 19.79 19.79 0 01-3.07-8.67A2 2 0 014.11 2h3a2 2 0 012 1.72c.127.96.361 1.903.7 2.81a2 2 0 01-.45 2.11L8.09 9.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0122 16.92z" transform="rotate(135 12 12)"/>\n </svg>\n </button>\n <button class="desktop-control-btn secondary" id="desktopSpeakerBtn" title="').concat(this.getTooltip("speaker"),'">\n <svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" class="desktop-speaker-icon">\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/>\n <path d="M19.07 4.93a10 10 0 010 14.14M15.54 8.46a5 5 0 010 7.07"/>\n </svg>\n <svg fill="none" viewBox="0 0 24 24" class="desktop-speaker-off-icon" style="display: none; position: absolute;">\n \x3c!-- Original speaker icon (same as normal state) --\x3e\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5" stroke="currentColor" stroke-width="2" fill="none"/>\n <path d="M19.07 4.93a10 10 0 010 14.14" stroke="currentColor" stroke-width="2" fill="none"/>\n <path d="M15.54 8.46a5 5 0 010 7.07" stroke="currentColor" stroke-width="2" fill="none"/>\n \x3c!-- Red circle surrounding the icon --\x3e\n <circle cx="12" cy="12" r="11.8" fill="none" stroke="#ef4444" stroke-width="2"/>\n \x3c!-- Red diagonal strike line --\x3e\n <line x1="4" y1="4" x2="20" y2="20" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round"/>\n </svg>\n </button>\n </div>\n </div>\n\n \x3c!-- Compact Voice Section - Single Row Layout (shown only when history is expanded) --\x3e\n <div class="compact-voice-section" id="compactVoiceSection" style="display: none;">\n \x3c!-- Left side: Avatar + Info --\x3e\n <div class="compact-left">\n \x3c!-- Avatar container with waveform --\x3e\n <div class="compact-avatar" id="desktopAvatarCompact">\n \x3c!-- Main Waveform - Scaled down for compact view --\x3e\n <div class="desktop-main-waveform" id="desktopMainWaveformCompact">\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n </div>\n </div>\n \n \x3c!-- Timer and Status stacked vertically --\x3e\n <div class="compact-info">\n <div class="compact-timer" id="desktopTimerCompact">\n <span class="timer-dot"></span>\n <span id="compactTimerText">00:00</span>\n </div>\n <div class="compact-status" id="desktopStatusCompact">\n <span class="status-dot"></span>\n <span id="compactStatusText">').concat(this.t("listening")||"Listening",'</span>\n </div>\n </div>\n </div>\n \n \x3c!-- Right side: Control buttons (reuse same IDs, handlers will work for both) --\x3e\n <div class="compact-controls">\n <button class="compact-control-btn secondary" id="desktopMuteBtnCompact" title="').concat(this.getTooltip("mute"),'">\n <svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" class="desktop-mic-icon">\n <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2"/>\n <line x1="12" y1="19" x2="12" y2="23"/>\n </svg>\n <svg fill="none" viewBox="0 0 24 24" class="desktop-mic-off-icon" style="display: none; position: absolute;">\n \x3c!-- Original mic icon (same as normal state) --\x3e\n <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" stroke="currentColor" stroke-width="2" fill="none"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2" stroke="currentColor" stroke-width="2" fill="none"/>\n <line x1="12" y1="19" x2="12" y2="23" stroke="currentColor" stroke-width="2"/>\n \x3c!-- Red circle surrounding the icon --\x3e\n <circle cx="12" cy="12" r="11.8" fill="none" stroke="#ef4444" stroke-width="2"/>\n \x3c!-- Red diagonal strike line --\x3e\n <line x1="4" y1="4" x2="20" y2="20" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round"/>\n </svg>\n </button>\n <button class="compact-control-btn danger" id="desktopEndCallBtnCompact" title="').concat(this.getTooltip("endCall"),'">\n <svg fill="none" stroke="currentColor" stroke-width="1.8" viewBox="0 0 24 24" style="overflow: visible;">\n <path d="M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.5 19.5 0 01-6-6 19.79 19.79 0 01-3.07-8.67A2 2 0 014.11 2h3a2 2 0 012 1.72c.127.96.361 1.903.7 2.81a2 2 0 01-.45 2.11L8.09 9.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0122 16.92z" transform="rotate(135 12 12)"/>\n </svg>\n </button>\n <button class="compact-control-btn secondary" id="desktopSpeakerBtnCompact" title="').concat(this.getTooltip("speaker"),'">\n <svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" class="desktop-speaker-icon">\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/>\n <path d="M19.07 4.93a10 10 0 010 14.14M15.54 8.46a5 5 0 010 7.07"/>\n </svg>\n <svg fill="none" viewBox="0 0 24 24" class="desktop-speaker-off-icon" style="display: none; position: absolute;">\n \x3c!-- Original speaker icon (same as normal state) --\x3e\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5" stroke="currentColor" stroke-width="2" fill="none"/>\n <path d="M19.07 4.93a10 10 0 010 14.14" stroke="currentColor" stroke-width="2" fill="none"/>\n <path d="M15.54 8.46a5 5 0 010 7.07" stroke="currentColor" stroke-width="2" fill="none"/>\n \x3c!-- Red circle surrounding the icon --\x3e\n <circle cx="12" cy="12" r="11.8" fill="none" stroke="#ef4444" stroke-width="2"/>\n \x3c!-- Red diagonal strike line --\x3e\n <line x1="4" y1="4" x2="20" y2="20" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round"/>\n </svg>\n </button>\n </div>\n </div>\n\n \x3c!-- Conversation Panel --\x3e\n <div class="desktop-conversation-panel collapsed" id="desktopConversationPanel">\n \x3c!-- Header --\x3e\n <div class="conversation-header" id="conversationHeader">\n <span class="conversation-label">').concat(this.t("conversation")||"Conversation",'</span>\n <span class="conversation-toggle">\n <span id="conversationToggleText">Show history</span>\n <svg width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">\n <path d="M6 9l6 6 6-6"/>\n </svg>\n </span>\n </div>\n\n \x3c!-- Collapsed: Live transcript only (2 lines) --\x3e\n <div class="live-transcript-collapsed" id="liveTranscriptCollapsed">\n <div class="live-indicator">\n <div class="live-dot"></div>\n <span>Live</span>\n </div>\n <div class="live-text-collapsed muted" id="liveTextCollapsed">\n ').concat(this.t("transcriptWillAppear")||"Transcript will appear here...",'<span class="typing-cursor"></span>\n </div>\n </div>\n\n \x3c!-- Expanded: Full conversation history --\x3e\n <div class="conversation-history" id="conversationHistory">\n <div class="conversation-messages" id="conversationMessages">\n \x3c!-- Messages will be rendered here --\x3e\n </div>\n \n \x3c!-- Live message at bottom --\x3e\n <div class="live-message-row" id="liveMessageRow" style="display: none;">\n <div class="message-avatar assistant">\n <div class="orb"></div>\n </div>\n <div class="message-bubble">\n <span class="live-badge">Live</span>\n <span id="liveMessageText"></span><span class="typing-cursor"></span>\n </div>\n </div>\n </div>\n\n \x3c!-- Text Input --\x3e\n <div class="voice-text-input-area">\n <div class="voice-input-wrapper">\n <input type="text" class="voice-text-input" id="voiceTextInput" placeholder="').concat(this.getText("inputPlaceholder","typeMessage")||"Type a message...",'">\n <button class="voice-send-btn" id="voiceSendBtn">\n <svg width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">\n <line x1="22" y1="2" x2="11" y2="13"/>\n <polygon points="22 2 15 22 11 13 2 9 22 2"/>\n </svg>\n </button>\n </div>\n <div class="voice-input-hint" id="voiceInputHint">\n <svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">\n <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/>\n </svg>\n ').concat(this.getText("voiceActiveHint","voiceActive")||"Voice is still active • Type or speak","\n </div>\n </div>\n </div>\n </div>\n </div>")}},{key:"generateMobileHTML",value:function(){return'<div class="voice-interface mobile-voice-interface" id="voiceInterface">\n \x3c!-- Before Call State (same as desktop) --\x3e\n <div id="voiceIdleState">\n <div class="voice-avatar" id="voiceAvatar">🤖</div>\n <div class="voice-status">\n <div class="voice-status-title">'.concat(this.getText("startCallTitle","clickToStartCall"),'</div>\n <div class="voice-status-subtitle">').concat(this.getText("startCallSubtitle","realTimeVoice"),'</div>\n </div>\n <button class="start-call-btn" id="startCallBtn">\n <svg width="32" height="32" viewBox="0 0 24 24" fill="currentColor">\n <path d="M20.01 15.38c-1.23 0-2.42-.2-3.53-.56-.35-.12-.74-.03-1.01.24l-1.57 1.97c-2.83-1.35-5.48-3.9-6.89-6.83l1.95-1.66c.27-.28.35-.67.24-1.02-.37-1.11-.56-2.3-.56-3.53 0-.54-.45-.99-.99-.99H4.19C3.65 3 3 3.24 3 3.99 3 13.28 10.73 21 20.01 21c.71 0 .99-.63.99-1.18v-3.45c0-.54-.45-.99-.99-.99z"/>\n </svg>\n <span>').concat(this.getText("startCallButtonText","startCall"),'</span>\n </button>\n </div>\n \n \x3c!-- Mobile Active Call State - Hidden placeholder (actual bar will be appended to body) --\x3e\n <div id="voiceActiveState" class="mobile-active-state" style="display: none;">\n \x3c!-- Duration Badge --\x3e\n <div class="mobile-duration-badge" id="mobileDurationBadge">\n <div class="mobile-duration-dot"></div>\n <span id="mobileDurationText">00:00</span>\n </div>\n \n \x3c!-- Main Bar --\x3e\n <div class="mobile-voice-bar">\n \x3c!-- Top Row: Status, Waveform, Controls --\x3e\n <div class="mobile-top-row">\n \x3c!-- Status Indicator --\x3e\n <div class="mobile-status-indicator">\n <div class="mobile-status-dot" id="mobileStatusDot"></div>\n <span class="mobile-status-text" id="mobileStatusText">Listening...</span>\n </div>\n \n \x3c!-- Centered Waveform --\x3e\n <div class="mobile-waveform-center" id="mobileWaveform">\n ').concat(Array(8).fill(0).map(function(e,t){return'<div class="mobile-waveform-bar" data-index="'.concat(t,'"></div>')}).join(""),'\n </div>\n \n \x3c!-- Controls --\x3e\n <div class="mobile-controls">\n <button class="mobile-control-btn" id="mobileMuteBtn" aria-label="Mute microphone">\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-mic-icon">\n <path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2"/>\n <line x1="12" x2="12" y1="19" y2="22"/>\n </svg>\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-mic-off-icon" style="display: none;">\n <line x1="2" x2="22" y1="2" y2="22"/>\n <path d="M18.89 13.23A7.12 7.12 0 0 0 19 12v-2"/>\n <path d="M5 10v2a7 7 0 0 0 12 5"/>\n <path d="M15 9.34V5a3 3 0 0 0-5.68-1.33"/>\n <path d="M9 9v3a3 3 0 0 0 5.12 2.12"/>\n <line x1="12" x2="12" y1="19" y2="22"/>\n </svg>\n </button>\n \n <button class="mobile-control-btn" id="mobileSpeakerBtn" aria-label="Toggle speaker">\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-speaker-icon">\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/>\n <path d="M15.54 8.46a5 5 0 0 1 0 7.07"/>\n </svg>\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-speaker-off-icon" style="display: none;">\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/>\n <line x1="22" x2="16" y1="9" y2="15"/>\n <line x1="16" x2="22" y1="9" y2="15"/>\n </svg>\n </button>\n \n <button class="mobile-end-call-btn" id="mobileEndCallBtn" aria-label="End call">\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"/>\n <line x1="22" x2="2" y1="2" y2="22"/>\n </svg>\n </button>\n </div>\n </div>\n \n \x3c!-- Bottom Row: Transcript (expandable) --\x3e\n <button class="mobile-transcript-row" id="mobileTranscriptRow">\n <p class="mobile-transcript-text" id="mobileTranscriptText">').concat(this.t("transcriptWillAppear"),'</p>\n <div class="mobile-transcript-footer">\n <span class="mobile-expand-hint">tap to expand & type</span>\n <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="opacity: 0.6;">\n <path d="M7 17L17 7M17 7H7M17 7V17"/>\n </svg>\n </div>\n </button>\n </div>\n </div>\n \n \x3c!-- Expanded Transcript Overlay --\x3e\n <div class="mobile-transcript-overlay" id="mobileTranscriptOverlay" style="display: none;">\n <div class="mobile-expanded-transcript" id="mobileExpandedTranscript">\n \x3c!-- Header --\x3e\n <div class="mobile-transcript-header">\n <div class="mobile-header-left">\n <div class="mobile-header-status">\n <div class="mobile-header-status-dot"></div>\n <span class="mobile-header-status-text" id="mobileHeaderStatusText">Listening...</span>\n <span class="mobile-header-duration" id="mobileHeaderDuration">00:00</span>\n </div>\n <span class="mobile-transcript-label">CONVERSATION</span>\n </div>\n <button class="mobile-close-transcript-btn" id="mobileCloseTranscriptBtn">\n <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 6L6 18M6 6l12 12"/>\n </svg>\n </button>\n </div>\n \n \x3c!-- Messages Container --\x3e\n <div class="mobile-messages-container" id="mobileMessagesContainer">\n \x3c!-- Messages will be dynamically added here --\x3e\n </div>\n \n \x3c!-- Text Input Area --\x3e\n <div class="mobile-input-area">\n <div class="mobile-input-wrapper">\n <input\n type="text"\n placeholder="Type a message..."\n id="mobileTextInput"\n class="mobile-text-input"\n />\n <button class="mobile-send-btn" id="mobileSendBtn" disabled>\n <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"/>\n </svg>\n </button>\n </div>\n <p class="mobile-input-hint">🎙️ Voice is still active • Type or speak</p>\n </div>\n </div>\n </div>\n </div>')}}])&&vn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function yn(e){return yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yn(e)}function bn(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Cn(n.key),n)}}function Cn(e){var t=function(e){if("object"!=yn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=yn(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==yn(t)?t:t+""}var xn=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=t,this.config=t.config},(t=[{key:"generateCSS",value:function(){var e,t=this.config.avatarBackgroundColor||"#667eea",A=this.config.avatarActiveBackgroundColor||this.config.avatarBackgroundColor||"#667eea",n=this.config.statusTitleColor||"#1e293b",o=this.config.statusSubtitleColor||"#64748b",r=this.config.statusDotColor||"#10b981",i=(this.config.statusText,this.config.startCallButtonColor||"#667eea"),a=this.config.startCallButtonTextColor||"#FFFFFF",s=this.config.transcriptBackgroundColor||"#FFFFFF",c=this.config.transcriptTextColor||"#1e293b",l=this.config.transcriptLabelColor||"#94a3b8",u=this.config.controlButtonColor||"#FFFFFF",d=this.config.liveTranscriptTextColor||this.config.transcriptTextColor||"#64748b",p=this.config.liveTranscriptFontSize||"14px",h=this.config.controlButtonSecondaryColor||"#64748b",g=this.config.liveIndicatorDotColor||"#10b981",f=this.config.liveIndicatorTextColor||"#10b981",m=this.config.micButtonColor||u,v=this.config.speakerButtonColor||u,B=this.config.endCallButtonColor||"#ef4444",w=this.config.sendButtonColor||(null===(e=this.config.text)||void 0===e?void 0:e.sendButtonColor)||this.config.voiceSendButtonColor||"#7C3AED",y=" !important";return"\n /* Voice Interface Styles - Ultra-compact for Wix iframes */\n .voice-interface { \n display: none".concat(y,"; \n flex: 1; \n flex-direction: column;\n align-items: stretch; \n justify-content: flex-start; \n padding: 0; \n background: linear-gradient(180deg, #f8fafc 0%, #e0e7ff 100%);\n overflow: hidden;\n min-height: 0;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n }\n .voice-interface.active { display: flex").concat(y,'; }\n \n /* Voice States - Better scaling gaps */\n #voiceIdleState {\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n min-height: 0;\n justify-content: center;\n overflow: hidden;\n flex: 1;\n box-sizing: border-box;\n gap: clamp(6px, 1.5vh, 12px);\n }\n \n #voiceActiveState {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n width: 100%;\n height: 100%;\n min-height: 0;\n justify-content: flex-start;\n overflow: hidden;\n flex: 1;\n box-sizing: border-box;\n gap: 0;\n padding: 0;\n }\n \n #voiceActiveState[style*="display: none"] {\n display: none !important;\n }\n \n /* Voice Avatar - Scales better from small to large */\n .voice-avatar,\n .voice-avatar-active {\n width: clamp(80px, 18vh, 160px);\n height: clamp(80px, 18vh, 160px);\n aspect-ratio: 1;\n border-radius: 50%;\n background: linear-gradient(135deg, ').concat(t," 0%, ").concat(A," 100%);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: clamp(40px, 9vh, 80px);\n margin: 0;\n box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);\n transition: all 0.3s ease;\n flex-shrink: 0;\n position: relative;\n }\n \n .voice-avatar-active {\n animation: avatarPulse 2s ease-in-out infinite;\n }\n \n @keyframes avatarPulse {\n 0%, 100% { \n transform: scale(1);\n }\n 50% { \n transform: scale(1.05);\n }\n }\n \n .voice-avatar-active.speaking {\n animation: avatarSpeak 0.5s ease-in-out infinite;\n }\n \n @keyframes avatarSpeak {\n 0%, 100% { transform: scale(1); }\n 50% { transform: scale(1.08); }\n }\n \n /* Voice Rings Animation */\n .voice-rings {\n position: absolute;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n }\n \n .voice-ring {\ndisplay: block !important;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n border: 2px solid rgba(102, 126, 234, 0.3);\n border-radius: 50%;\n opacity: 0;\n animation: ringExpand 2s ease-out infinite;\n }\n \n .voice-ring:nth-child(2) { animation-delay: 0.5s; }\n .voice-ring:nth-child(3) { animation-delay: 1s; }\n \n @keyframes ringExpand {\n 0% {\n width: 100%;\n height: 100%;\n opacity: 0.6;\n }\n 100% {\n width: 160%;\n height: 160%;\n opacity: 0;\n }\n }\n \n /* Voice Status - Scales with container */\n .voice-status {\n text-align: center;\n margin: 0;\n flex-shrink: 0;\n min-height: 0;\n }\n \n .voice-status-title {\n font-size: clamp(12px, 3vh, 20px);\n font-weight: 600;\n color: ").concat(n,";\n margin-bottom: clamp(2px, 0.5vh, 4px);\n line-height: 1.2;\n }\n \n .voice-status-subtitle {\n font-size: clamp(10px, 2vh, 14px);\n color: ").concat(o,";\n line-height: 1.2;\n }\n \n /* Start Call Button - Scales with container */\n .start-call-btn {\n margin: 0;\n width: min(280px, 70vw)").concat(y,";\n height: clamp(48px, 8vh, 64px)").concat(y,";\n border-radius: clamp(24px, 4vh, 32px)").concat(y,";\n border: none").concat(y,";\n background: ").concat(i).concat(y,";\n color: ").concat(a).concat(y,";\n font-size: clamp(14px, 2.5vh, 18px)").concat(y,";\n font-weight: 600").concat(y,";\n cursor: pointer").concat(y,";\n display: flex").concat(y,";\n align-items: center").concat(y,";\n justify-content: center").concat(y,";\n gap: clamp(8px, 1.5vh, 12px);\n box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);\n transition: all 0.3s ease;\n flex-shrink: 0;\n }\n \n .start-call-btn svg {\n display: block").concat(y,";\n visibility: visible").concat(y,";\n opacity: 1").concat(y,";\n width: auto").concat(y,";\n height: auto").concat(y,";\n }\n \n .start-call-btn svg {\n width: clamp(22px, 4vh, 32px);\n height: clamp(22px, 4vh, 32px);\n }\n \n .start-call-btn:hover {\n transform: translateY(-2px);\n box-shadow: 0 12px 28px rgba(102, 126, 234, 0.5);\n }\n \n .start-call-btn:active {\n transform: translateY(-1px);\n }\n .start-call-btn:disabled {\n cursor: not-allowed").concat(y,";\n opacity: 0.6").concat(y,";\n }\n \n /* Connecting Spinner */\n .connecting-spinner {\n display: inline-block;\n width: 16px;\n height: 16px;\n border: 2px solid rgba(255, 255, 255, 0.3);\n border-top-color: ").concat(a,";\n border-radius: 50%;\n animation: spin 1s linear infinite;\n margin-right: 8px;\n vertical-align: middle;\n }\n \n @keyframes spin {\n to { transform: rotate(360deg); }\n }\n\n \n /* Voice Transcript - Scales with container */\n .voice-transcript {\n background: ").concat(s,";\n padding: clamp(6px, 1.5vh, 12px);\n border-radius: 10px;\n width: min(360px, calc(100% - 40px));\n margin: 0;\n min-height: clamp(80px, 15vh, 120px);\n max-height: clamp(100px, 18vh, 140px);\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);\n flex-shrink: 1;\n overflow-y: auto;\n overflow-x: hidden;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n }\n \n .transcript-label {\n font-size: clamp(8px, 1.4vh, 11px);\n color: ").concat(l,";\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.3px;\n margin-bottom: clamp(3px, 0.6vh, 6px);\n flex-shrink: 0;\n word-wrap: break-word;\n }\n \n .transcript-text {\n font-size: clamp(11px, 2vh, 15px);\n color: ").concat(c,";\n line-height: 1.4;\n flex: 1;\n overflow-y: auto;\n overflow-x: hidden;\n word-wrap: break-word;\n overflow-wrap: break-word;\n }\n \n .transcript-text.empty {\n color: #cbd5e1;\n font-style: italic;\n }\n \n /* Voice Text Input Area - Type while on voice call */\n .voice-text-input-area {\n width: 100%;\n padding: 14px 16px;\n margin: 0;\n flex-shrink: 0;\n background: #ffffff;\n border-top: 1px solid rgba(0, 0, 0, 0.06);\n box-sizing: border-box;\n }\n \n .voice-input-wrapper {\n display: flex;\n align-items: center;\n gap: 10px;\n background: #f1f5f9;\n border-radius: 12px;\n padding: 4px 4px 4px 14px;\n border: 1px solid transparent;\n transition: all 0.2s ease;\n }\n \n .voice-input-wrapper:focus-within {\n background: #fff;\n border-color: #a855f7;\n box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);\n }\n \n .voice-text-input {\n flex: 1;\n border: none;\n outline: none;\n font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;\n font-size: 14px;\n color: ").concat(d).concat(y,";\n background: transparent;\n padding: 10px 0;\n }\n \n .voice-text-input::placeholder {\n color: #94a3b8;\n }\n \n .voice-send-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 38px;\n height: 38px;\n border-radius: 10px;\n border: none;\n background: ").concat(w).concat(y,";\n color: #fff;\n cursor: pointer;\n transition: transform 0.2s ease;\n flex-shrink: 0;\n }\n \n .voice-send-btn:hover:not(:disabled) {\n transform: scale(1.05);\n }\n \n .voice-send-btn:active:not(:disabled) {\n transform: scale(0.95);\n }\n \n .voice-send-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n transform: none;\n }\n \n .voice-send-btn svg {\n width: 16px;\n height: 16px;\n }\n \n .voice-input-hint {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 5px;\n margin-top: 10px;\n font-size: 11px;\n color: #64748b;\n transition: color 0.2s ease;\n }\n \n .voice-input-hint svg {\n width: 12px;\n height: 12px;\n color: #10b981;\n }\n \n /* Text input status states */\n .voice-input-hint--sending {\n color: #666;\n }\n \n .voice-input-hint--success {\n color: #28a745;\n }\n \n .voice-input-hint--queued {\n color: #ffc107;\n }\n \n .voice-input-hint--error {\n color: #dc3545;\n }\n \n /* Disabled input styling */\n .voice-text-input:disabled,\n #mobileTextInput:disabled {\n background-color: #f5f5f5;\n cursor: not-allowed;\n }\n \n .voice-send-btn:disabled,\n #mobileSendBtn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n \n /* Voice Controls - Scales with container */\n .voice-controls {\n display: flex;\n gap: clamp(8px, 1.8vh, 14px);\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n margin: 0;\n padding-top: 0;\n }\n \n .voice-control-btn {\n width: clamp(48px, 9vh, 72px)").concat(y,";\n height: clamp(48px, 9vh, 72px)").concat(y,";\n min-width: clamp(48px, 9vh, 72px)").concat(y,";\n min-height: clamp(48px, 9vh, 72px)").concat(y,";\n max-width: clamp(48px, 9vh, 72px)").concat(y,";\n max-height: clamp(48px, 9vh, 72px)").concat(y,";\n aspect-ratio: 1").concat(y,";\n border-radius: 50%").concat(y,";\n border: none").concat(y,";\n cursor: pointer").concat(y,";\n display: flex").concat(y,";\n align-items: center").concat(y,";\n justify-content: center").concat(y,";\n transition: all 0.2s;\n position: relative").concat(y,";\n flex-shrink: 0;\n overflow: hidden").concat(y,";\n padding: 0").concat(y,";\n margin: 0").concat(y,";\n box-sizing: border-box").concat(y,";\n }\n \n .voice-control-btn svg {\n width: 48%").concat(y,";\n height: 48%").concat(y,";\n min-width: 48%").concat(y,";\n min-height: 48%").concat(y,";\n max-width: 48%").concat(y,";\n max-height: 48%").concat(y,";\n display: block").concat(y,";\n visibility: visible").concat(y,";\n opacity: 1").concat(y,";\n margin: 0").concat(y,";\n padding: 0").concat(y,";\n position: relative").concat(y,";\n flex-shrink: 0").concat(y,";\n }\n \n .voice-control-btn.primary {\n width: clamp(54px, 10vh, 80px)").concat(y,";\n height: clamp(54px, 10vh, 80px)").concat(y,";\n min-width: clamp(54px, 10vh, 80px)").concat(y,";\n min-height: clamp(54px, 10vh, 80px)").concat(y,";\n max-width: clamp(54px, 10vh, 80px)").concat(y,";\n max-height: clamp(54px, 10vh, 80px)").concat(y,";\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%)").concat(y,";\n color: white").concat(y,";\n box-shadow: 0 6px 18px rgba(102, 126, 234, 0.4);\n }\n \n .voice-control-btn.primary:hover {\n transform: scale(1.05);\n }\n \n .voice-control-btn.primary.active {\n background: ").concat(B).concat(y,";\n animation: recordingPulse 1.5s ease-in-out infinite;\n }\n .voice-control-btn.primary.active svg {\n fill: white").concat(y,";\n }\n \n /* More specific selectors for WordPress compatibility */\n #endCallBtn.voice-control-btn.primary.active,\n #muteBtn.voice-control-btn.secondary,\n #speakerBtn.voice-control-btn.secondary {\n border-radius: 50% !important;\n width: clamp(48px, 9vh, 72px) !important;\n height: clamp(48px, 9vh, 72px) !important;\n min-width: clamp(48px, 9vh, 72px) !important;\n min-height: clamp(48px, 9vh, 72px) !important;\n max-width: clamp(48px, 9vh, 72px) !important;\n max-height: clamp(48px, 9vh, 72px) !important;\n aspect-ratio: 1 !important;\n overflow: hidden !important;\n }\n \n #endCallBtn.voice-control-btn.primary.active {\n width: clamp(54px, 10vh, 80px) !important;\n height: clamp(54px, 10vh, 80px) !important;\n min-width: clamp(54px, 10vh, 80px) !important;\n min-height: clamp(54px, 10vh, 80px) !important;\n max-width: clamp(54px, 10vh, 80px) !important;\n max-height: clamp(54px, 10vh, 80px) !important;\n }\n \n \n /* Microphone button specific background color */\n #muteBtn.voice-control-btn.secondary {\n background: ").concat(m).concat(y,";\n }\n \n /* Speaker button specific background color */\n #speakerBtn.voice-control-btn.secondary {\n background: ").concat(v).concat(y,";\n }\n \n #endCallBtn.voice-control-btn.primary.active svg,\n #muteBtn.voice-control-btn.secondary svg,\n #speakerBtn.voice-control-btn.secondary svg {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n width: 48% !important;\n height: 48% !important;\n margin: 0 !important;\n padding: 0 !important;\n position: relative !important;\n }\n \n @keyframes recordingPulse {\n 0%, 100% { \n box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);\n }\n 50% { \n box-shadow: 0 6px 24px rgba(239, 68, 68, 0.7);\n }\n }\n \n .voice-control-btn.secondary {\n background: ").concat(u).concat(y,";\n color: ").concat(h).concat(y,";\n box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);\n width: clamp(48px, 9vh, 72px)").concat(y,";\n height: clamp(48px, 9vh, 72px)").concat(y,";\n min-width: clamp(48px, 9vh, 72px)").concat(y,";\n min-height: clamp(48px, 9vh, 72px)").concat(y,";\n max-width: clamp(48px, 9vh, 72px)").concat(y,";\n max-height: clamp(48px, 9vh, 72px)").concat(y,";\n }\n \n .voice-control-btn.secondary:hover {\n background: #f8fafc").concat(y,";\n transform: scale(1.05);\n }\n \n .voice-control-btn.secondary.muted {\n background: #f3f4f6").concat(y,";\n }\n \n .voice-control-btn.secondary.muted .mute-icon {\n stroke: #9ca3af !important;\n }\n \n .voice-control-btn.secondary svg {\n width: 48%").concat(y,";\n height: 48%").concat(y,";\n display: block").concat(y,";\n visibility: visible").concat(y,";\n opacity: 1").concat(y,";\n margin: 0").concat(y,";\n padding: 0").concat(y,";\n position: relative").concat(y,";\n }\n \n .voice-timer {\n position: absolute;\n bottom: clamp(-18px, -3vh, -24px);\n font-size: clamp(9px, 1.6vh, 12px);\n color: #64748b;\n font-weight: 500;\n white-space: nowrap;\n }\n \n /* ===== DESKTOP VOICE SECTION - New Design ===== */\n .desktop-voice-section {\n padding: 16px 20px;\n background: linear-gradient(180deg, #ffffff 0%, rgba(168, 85, 247, 0.04) 100%);\n width: 100%;\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 12px;\n box-sizing: border-box;\n text-align: center;\n }\n \n /* Ensure all children are centered */\n .desktop-voice-section > * {\n margin-left: auto;\n margin-right: auto;\n }\n \n .desktop-timer {\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n gap: 6px !important;\n padding: 5px 10px !important;\n background: rgba(0, 0, 0, 0.05) !important;\n border-radius: 20px !important;\n font-family: 'JetBrains Mono', 'Courier New', monospace;\n font-size: 11px !important;\n color: #64748b !important;\n margin: 0 auto !important;\n }\n \n .desktop-timer .timer-dot {\n display: block !important;\n width: 5px").concat(y,";\n height: 5px").concat(y,";\n background: #ef4444").concat(y,";\n border-radius: 50%").concat(y,";\n animation: timerPulse 1s ease-in-out infinite").concat(y,";\n }\n \n @keyframes timerPulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.4; }\n }\n \n .desktop-avatar-container {\n margin-bottom: 12px;\n }\n \n .desktop-avatar-large {\n width: 80px !important;\n height: 80px !important;\n border-radius: 20px !important;\n margin: 0 auto 12px !important;\n box-shadow: 0 8px 24px rgba(168, 85, 247, 0.35) !important;\n background: linear-gradient(135deg, ").concat(t," 0%, ").concat(A,' 100%) !important;\n }\n \n .desktop-waveform {\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n gap: 4px !important;\n height: 36px !important;\n width: 100% !important;\n }\n \n .desktop-waveform-bar {\n display: block !important;\n width: 4px !important;\n background: rgba(255, 255, 255, 0.9) !important;\n border-radius: 2px !important;\n animation: waveformAnimation 0.8s ease-in-out infinite !important;\n }\n \n .desktop-waveform-bar[data-index="0"] { height: 14px !important; animation-delay: 0s !important; }\n .desktop-waveform-bar[data-index="1"] { height: 26px !important; animation-delay: 0.1s !important; }\n .desktop-waveform-bar[data-index="2"] { height: 36px !important; animation-delay: 0.2s !important; }\n .desktop-waveform-bar[data-index="3"] { height: 22px !important; animation-delay: 0.3s !important; }\n .desktop-waveform-bar[data-index="4"] { height: 16px !important; animation-delay: 0.4s !important; }\n \n @keyframes waveformAnimation {\n 0%, 100% { transform: scaleY(0.5); }\n 50% { transform: scaleY(1); }\n }\n \n .desktop-waveform.paused .desktop-waveform-bar {\n animation-play-state: paused;\n }\n\n /* New main waveform (used in updated template) */\n .desktop-main-waveform {\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n gap: 3px !important;\n height: 48px !important;\n width: 100% !important;\n max-width: 200px !important;\n margin: 0 auto !important;\n padding: 0 20px !important;\n }\n\n .desktop-main-waveform .waveform-bar {\n display: block !important;\n width: 3px !important;\n background: #a855f7 !important;\n border-radius: 2px !important;\n height: 8px !important;\n animation: waveformAnimation 0.8s ease-in-out infinite !important;\n }\n\n .desktop-main-waveform .waveform-bar:nth-child(1) { height: 12px !important; animation-delay: 0s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(2) { height: 20px !important; animation-delay: 0.05s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(3) { height: 28px !important; animation-delay: 0.1s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(4) { height: 36px !important; animation-delay: 0.15s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(5) { height: 44px !important; animation-delay: 0.2s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(6) { height: 50px !important; animation-delay: 0.25s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(7) { height: 54px !important; animation-delay: 0.3s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(8) { height: 56px !important; animation-delay: 0.35s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(9) { height: 54px !important; animation-delay: 0.4s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(10) { height: 50px !important; animation-delay: 0.45s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(11) { height: 44px !important; animation-delay: 0.5s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(12) { height: 36px !important; animation-delay: 0.55s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(13) { height: 28px !important; animation-delay: 0.6s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(14) { height: 20px !important; animation-delay: 0.65s !important; }\n .desktop-main-waveform .waveform-bar:nth-child(15) { height: 12px !important; animation-delay: 0.7s !important; }\n\n .desktop-status {\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n gap: 5px !important;\n font-size: 12px !important;\n color: ').concat(n,";\n font-weight: 500;\n width: 100%;\n text-align: center;\n margin: 0 auto;\n }\n \n .desktop-status .status-dot {\n display: block !important;\n width: 5px !important;\n height: 5px !important;\n background: ").concat(r," !important;\n border-radius: 50% !important;\n animation: statusPulse 1.5s ease-in-out infinite !important;\n }\n \n @keyframes statusPulse {\n 0%, 100% { transform: scale(1); opacity: 1; }\n 50% { transform: scale(1.15); opacity: 0.8; }\n }\n \n .desktop-live-waveform {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 3px;\n height: 48px;\n margin-bottom: 20px;\n }\n \n .desktop-live-bar {\ndisplay: block !important;\n width: 3px;\n background: linear-gradient(180deg, ").concat(t,", ").concat(A,");\n border-radius: 2px;\n transition: height 0.1s ease;\n height: 8px;\n }\n \n .desktop-controls {\n display: flex;\n gap: 8px;\n align-items: center;\n justify-content: center;\n width: 100%;\n margin: 0 auto;\n }\n \n .desktop-control-btn {\n width: 46px;\n height: 46px;\n border-radius: 50%;\n border: none;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n }\n \n .desktop-control-btn svg {\n width: 20px;\n height: 20px;\n }\n \n .desktop-mic-icon,\n .desktop-speaker-icon {\n width: 20px !important;\n height: 20px !important;\n display: block;\n flex-shrink: 0;\n }\n \n .desktop-control-btn.secondary.muted .desktop-mic-icon,\n .desktop-control-btn.secondary.muted .desktop-speaker-icon {\n width: 20px !important;\n height: 20px !important;\n }\n \n \n .desktop-control-btn.secondary:hover {\n background: rgba(0, 0, 0, 0.1);\n color: #1e293b;\n transform: scale(1.05);\n }\n .desktop-control-btn.secondary.muted {\n background: #f3f4f6;\n color: #9ca3af;\n }\n \n .desktop-control-btn.secondary.muted .desktop-mic-icon,\n .desktop-control-btn.secondary.muted .desktop-speaker-icon {\n stroke: #9ca3af;\n }\n \n .desktop-control-btn.secondary {\n position: relative;\n }\n \n \n /* Desktop microphone button background color */\n #desktopMuteBtn.desktop-control-btn.secondary,\n #desktopMuteBtnCompact.compact-control-btn.secondary {\n background: ").concat(m).concat(y,";\n }\n \n /* Desktop speaker button background color */\n #desktopSpeakerBtn.desktop-control-btn.secondary,\n #desktopSpeakerBtnCompact.compact-control-btn.secondary {\n background: ").concat(v).concat(y,";\n }\n .desktop-mic-off-icon,\n .desktop-speaker-off-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n width: 46px;\n height: 46px;\n transform: translate(-50%, -50%);\n z-index: 10;\n }\n .desktop-control-btn.danger {\n width: 50px;\n height: 50px;\n background: ").concat(B).concat(y,";\n color: #ffffff;\n box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);\n overflow: visible;\n }\n \n .desktop-control-btn.danger svg {\n width: 20px;\n height: 20px;\n overflow: visible;\n }\n \n .desktop-control-btn.danger:hover {\n transform: scale(1.06);\n box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);\n }\n \n .desktop-control-btn.danger:hover {\n transform: scale(1.06);\n box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);\n }\n \n \n /* ===== COMPACT VOICE SECTION (Single-row layout) ===== */\n .compact-voice-section {\n padding: 10px 14px;\n background: linear-gradient(180deg, #ffffff, rgba(168, 85, 247, 0.04));\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n border-bottom: 1px solid rgba(0, 0, 0, 0.06);\n min-height: 62px;\n flex-shrink: 0;\n }\n \n .compact-left {\n display: flex;\n align-items: center;\n gap: 10px;\n }\n \n .compact-avatar {\n width: 42px;\n height: 42px;\n min-width: 42px;\n min-height: 42px;\n border-radius: 12px;\n background: transparent;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n overflow: visible;\n position: relative;\n }\n \n /* Waveform container in compact avatar - ensure it's visible */\n .compact-avatar .desktop-main-waveform {\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n gap: 2px !important;\n height: 100% !important;\n width: 100% !important;\n padding: 4px !important;\n transform: scale(0.75) !important;\n transform-origin: center !important;\n }\n \n /* Ensure waveform bars are visible and animated in compact mode */\n .compact-avatar .desktop-main-waveform .waveform-bar {\n display: block !important;\n width: 2px !important;\n min-width: 2px !important;\n background: #a855f7 !important;\n border-radius: 1px !important;\n flex-shrink: 0 !important;\n animation: waveformAnimation 0.8s ease-in-out infinite !important;\n }\n \n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(1) { height: 6px !important; animation-delay: 0s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(2) { height: 10px !important; animation-delay: 0.05s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(3) { height: 14px !important; animation-delay: 0.1s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(4) { height: 18px !important; animation-delay: 0.15s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(5) { height: 22px !important; animation-delay: 0.2s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(6) { height: 26px !important; animation-delay: 0.25s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(7) { height: 28px !important; animation-delay: 0.3s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(8) { height: 30px !important; animation-delay: 0.35s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(9) { height: 28px !important; animation-delay: 0.4s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(10) { height: 26px !important; animation-delay: 0.45s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(11) { height: 22px !important; animation-delay: 0.5s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(12) { height: 18px !important; animation-delay: 0.55s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(13) { height: 14px !important; animation-delay: 0.6s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(14) { height: 10px !important; animation-delay: 0.65s !important; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(15) { height: 6px !important; animation-delay: 0.7s !important; }\n\n }\n \n .compact-info {\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n \n .compact-timer {\n display: flex;\n align-items: center;\n gap: 5px;\n font-family: 'JetBrains Mono', 'Courier New', monospace;\n font-size: 13px;\n font-weight: 600;\n color: ").concat(d).concat(y,";\n }\n \n .compact-timer .timer-dot {\n display: block !important;\n width: 6px").concat(y,";\n height: 6px").concat(y,";\n background: #ef4444").concat(y,";\n border-radius: 50%").concat(y,";\n animation: timerPulse 1s ease-in-out infinite").concat(y,";\n }\n \n .compact-status {\n display: flex").concat(y,";\n align-items: center").concat(y,";\n gap: 4px").concat(y,";\n font-size: 11px").concat(y,";\n color: ").concat(n).concat(y,";\n }\n \n .compact-status .status-dot {\n display: block !important;\n width: 5px").concat(y,";\n height: 5px").concat(y,";\n background: ").concat(r).concat(y,";\n border-radius: 50%").concat(y,";\n animation: statusPulse 1.5s ease-in-out infinite").concat(y,";\n }\n \n @keyframes statusPulse {\n 0%, 100% { opacity: 1; transform: scale(1); }\n 50% { opacity: 0.7; transform: scale(1.1); }\n }\n \n .compact-controls {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n \n .compact-control-btn {\n width: 36px;\n height: 36px;\n min-width: 36px;\n min-height: 36px;\n border-radius: 50%;\n border: none;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: all 0.2s ease;\n padding: 0;\n position: relative;\n }\n \n .compact-control-btn svg {\n width: 16px;\n height: 16px;\n }\n \n .compact-control-btn.secondary {\n background: #f1f5f9;\n color: #64748b;\n }\n \n \n /* Compact speaker button background color */\n #desktopSpeakerBtnCompact.compact-control-btn.secondary {\n background: ").concat(v).concat(y,";\n }\n /* Compact microphone button background color */\n #desktopMuteBtnCompact.compact-control-btn.secondary {\n background: ").concat(m).concat(y,";\n }\n \n .compact-control-btn.secondary:hover {\n background: #e2e8f0;\n color: #475569;\n }\n \n .compact-control-btn.secondary.muted {\n background: rgba(239, 68, 68, 0.1);\n color: #ef4444;\n }\n \n \n .compact-control-btn.secondary.muted .desktop-mic-icon,\n .compact-control-btn.secondary.muted .desktop-speaker-icon {\n stroke: #ef4444;\n }\n \n .compact-control-btn.secondary.muted .desktop-mic-off-icon,\n .compact-control-btn.secondary.muted .desktop-speaker-off-icon {\n width: 46px;\n height: 46px;\n }\n\n .compact-control-btn.danger {\n width: 40px;\n height: 40px;\n min-width: 40px;\n min-height: 40px;\n background: ").concat(B).concat(y,";\n color: white;\n box-shadow: 0 3px 10px rgba(239, 68, 68, 0.35);\n }\n \n .compact-control-btn.danger:hover {\n transform: scale(1.05);\n box-shadow: 0 4px 14px rgba(239, 68, 68, 0.45);\n }\n \n .compact-control-btn.danger svg {\n width: 18px;\n height: 18px;\n overflow: visible;\n }\n \n/* ===== CONVERSATION PANEL ===== */\n .desktop-conversation-panel {\n border-top: 1px solid rgba(0, 0, 0, 0.06);\n width: 100%;\n display: flex;\n flex-direction: column;\n min-height: 0;\n overflow: hidden;\n flex: 1;\n }\n \n .conversation-header {\n padding: 10px 16px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n background: #fafafa;\n cursor: pointer;\n flex-shrink: 0;\n border-bottom: 1px solid rgba(0, 0, 0, 0.04);\n transition: background 0.2s ease;\n }\n \n .conversation-header:hover {\n background: #f5f5f5;\n }\n \n .conversation-label {\n font-size: 11px;\n font-weight: 600;\n color: #64748b;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n }\n \n .conversation-toggle {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 11px;\n color: #94a3b8;\n font-weight: 500;\n }\n \n .conversation-toggle svg {\n transition: transform 0.2s ease;\n }\n \n .conversation-header.expanded .conversation-toggle svg {\n transform: rotate(180deg);\n }\n \n /* ===== COLLAPSED: Live Transcript Only (2 lines) ===== */\n .live-transcript-collapsed {\n padding: 12px 16px;\n background: #fafafa;\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex-shrink: 0;\n min-height: 50px;\n }\n \n .live-indicator {\n display: flex;\n align-items: center;\n gap: 5px;\n font-size: 9px;\n font-weight: 700;\n color: ").concat(f).concat(y,";\n text-transform: uppercase;\n letter-spacing: 0.08em;\n }\n \n .live-indicator .live-dot {\ndisplay: block !important;\n height: 5px;\n width: 5px;\n background: ").concat(g).concat(y,";\n border-radius: 50%;\n animation: statusPulse 1.5s ease-in-out infinite;\n }\n \n .live-text-collapsed {\n font-size: ").concat(p).concat(y,";\n color: ").concat(d).concat(y,";\n line-height: 1.5;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n \n .live-text-collapsed.muted {\n color: #94a3b8;\n font-style: italic;\n }\n \n .typing-cursor {\n display: inline-block;\n width: 2px;\n height: 14px;\n background: #a855f7;\n margin-left: 2px;\n animation: blink 1s step-end infinite;\n vertical-align: middle;\n }\n \n @keyframes blink {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0; }\n }\n \n /* ===== EXPANDED: Full Conversation History ===== */\n .conversation-history {\n flex: 1;\n flex-direction: column;\n gap: 10px;\n overflow-y: auto;\n padding: 14px 16px;\n min-height: 0;\n }\n .conversation-history.visible {\n display: flex;\n }\n\n .conversation-messages {\n display: flex;\n flex-direction: column;\n gap: 10px;\n }\n\n /* Message Rows */\n .message-row {\n display: flex;\n gap: 8px;\n animation: msgIn 0.25s ease;\n }\n \n @keyframes msgIn {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes slideIn {\n from { opacity: 0; transform: translateY(-10px); }\n to { opacity: 1; transform: translateY(0); }\n }\n \n @keyframes slideOut {\n from { opacity: 1; transform: translateY(0); }\n to { opacity: 0; transform: translateY(-10px); }\n }\n \n .message-row.user {\n flex-direction: row-reverse;\n }\n \n .message-avatar {\n width: 28px;\n height: 28px;\n border-radius: 8px;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n\n .message-avatar.assistant {\n background: linear-gradient(135deg, #c084fc, #a855f7);\n }\n\n .message-avatar.assistant .orb {\n width: 12px;\n height: 12px;\n background: rgba(255, 255, 255, 0.9);\n border-radius: 50%;\n }\n\n .message-avatar.user {\n background: linear-gradient(135deg, #64748b, #475569);\n color: #fff;\n font-size: 11px;\n font-weight: 600;\n }\n\n .message-bubble {\n max-width: 80%;\n padding: 9px 13px;\n border-radius: 12px;\n font-size: 13px;\n line-height: 1.5;\n }\n \n .message-row.assistant .message-bubble {\n background: #fff;\n color: ").concat(d).concat(y,";\n border: 1px solid rgba(0, 0, 0, 0.06);\n border-bottom-left-radius: 4px;\n }\n \n .message-row.user .message-bubble {\n background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);\n color: #fff;\n border-bottom-right-radius: 4px;\n }\n \n /* Live message at bottom of history */\n .live-message-row {\n display: flex;\n gap: 8px;\n padding-top: 8px;\n border-top: 1px dashed rgba(0, 0, 0, 0.08);\n margin-top: auto;\n }\n \n .live-message-row .message-bubble {\n background: #fff;\n border: 1px solid rgba(16, 185, 129, 0.3);\n color: ").concat(d).concat(y,";\n position: relative;\n border-radius: 14px;\n border-bottom-left-radius: 4px;\n }\n \n .live-message-row .live-badge {\ndisplay: block !important;\n position: absolute;\n top: -8px;\n left: 10px;\n background: #10b981;\n color: #fff;\n font-size: 8px;\n font-weight: 700;\n padding: 2px 6px;\n border-radius: 4px;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n }\n \n /* Hide/show based on expanded state */\n .desktop-conversation-panel.collapsed .conversation-history {\n display: none;\n }\n \n .desktop-conversation-panel.collapsed .live-transcript-collapsed {\n display: flex;\n }\n \n .desktop-conversation-panel.expanded .conversation-history {\n display: flex;\n max-height: 400px;\n }\n \n .desktop-conversation-panel.expanded .live-transcript-collapsed {\n display: none;\n }\n \n /* ===== DARK MODE SUPPORT ===== */\n @media (prefers-color-scheme: dark) {\n .desktop-voice-section {\n background: linear-gradient(180deg, #1e1e2e 0%, rgba(168, 85, 247, 0.08) 100%);\n }\n\n .desktop-timer {\n color: #94a3b8;\n }\n\n .desktop-status {\n color: #34d399;\n }\n\n .desktop-status .status-dot {\n \n .desktop-control-btn.secondary.muted {\n background: rgba(255, 255, 255, 0.1);\n color: #9ca3af;\n \n .compact-voice-section {\n background: linear-gradient(180deg, #1e1e2e 0%, rgba(168, 85, 247, 0.08) 100%);\n border-bottom: 1px solid rgba(255, 255, 255, 0.08);\n }\n \n .compact-timer {\n color: #e2e8f0;\n }\n \n .compact-status {\n color: #34d399;\n }\n \n .compact-status .status-dot {\n background: #34d399;\n }\n \n .compact-control-btn.secondary {\n background: rgba(255, 255, 255, 0.08);\n color: #94a3b8;\n }\n \n .compact-control-btn.secondary:hover {\n background: rgba(255, 255, 255, 0.15);\n color: #e2e8f0;\n }\n \n .compact-control-btn.secondary.muted {\n background: rgba(239, 68, 68, 0.2);\n color: #f87171;\n }\n\n }\n \n .desktop-control-btn.secondary.muted svg {\n \n .desktop-control-btn.secondary {\n position: relative;\n }\n \n /* Desktop microphone button background color */\n #desktopMuteBtn.desktop-control-btn.secondary,\n #desktopMuteBtnCompact.compact-control-btn.secondary {\n background: ").concat(m).concat(y,";\n }\n \n .desktop-mic-off-icon,\n .desktop-speaker-off-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 20px;\n height: 20px;\n }\n \n .desktop-control-btn.secondary.muted {\n background: #f3f4f6;\n color: #9ca3af;\n }\n \n .desktop-control-btn.secondary.muted svg {\n \n .desktop-control-btn.secondary {\n position: relative;\n }\n \n /* Desktop microphone button background color */\n #desktopMuteBtn.desktop-control-btn.secondary,\n #desktopMuteBtnCompact.compact-control-btn.secondary {\n background: ").concat(m).concat(y,";\n }\n \n .desktop-mic-off-icon,\n .desktop-speaker-off-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 20px;\n height: 20px;\n }\n stroke: #9ca3af;\n }\n stroke: #9ca3af;\n }\n background: #34d399;\n }\n\n .desktop-control-btn.secondary {\n background: rgba(255, 255, 255, 0.08);\n color: #94a3b8;\n }\n\n .desktop-control-btn.secondary:hover {\n background: rgba(255, 255, 255, 0.15);\n color: #e2e8f0;\n }\n\n .desktop-conversation-panel {\n border-top: 1px solid rgba(255, 255, 255, 0.08);\n }\n\n .conversation-header {\n background: #1a1a2e;\n }\n\n .conversation-header:hover {\n background: #252540;\n }\n\n .conversation-label {\n color: #94a3b8;\n }\n\n .conversation-toggle {\n color: #64748b;\n }\n\n .live-transcript-preview {\n background: #1a1a2e;\n }\n .live-indicator {\n color: ").concat(f).concat(y,";\n }\n .live-indicator .live-dot {\n background: ").concat(g).concat(y,";\n }\n\n .live-text {\n color: #e2e8f0;\n }\n\n .live-text.muted {\n color: #64748b;\n }\n\n .conversation-history {\n background: #1a1a2e;\n }\n\n .conversation-msg.assistant .conversation-msg-bubble {\n background: #252540;\n color: #e2e8f0;\n border: 1px solid rgba(255, 255, 255, 0.08);\n }\n\n .voice-text-input-area {\n background: #1a1a2e;\n }\n\n .voice-text-input {\n background: #252540 !important;\n color: #e2e8f0 !important;\n border-color: rgba(255, 255, 255, 0.1) !important;\n }\n\n .voice-text-input::placeholder {\n color: #64748b !important;\n }\n\n .voice-text-input:focus {\n border-color: ").concat(t," !important;\n box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2) !important;\n }\n\n .voice-input-hint {\n color: #64748b !important;\n }\n\n .voice-send-btn {\n background: ").concat(w," !important;\n }\n\n .voice-send-btn:disabled {\n background: #374151 !important;\n color: #4b5563 !important;\n }\n }\n\n /* Mobile optimization */\n @media (max-width: 768px) {\n .voice-interface {\n padding: 6px 10px;\n }\n }\n \n @media (max-width: 480px) {\n .voice-interface {\n padding: 5px 8px;\n }\n }\n \n /* Mobile Voice Call UI - Shared styles (also used in generateMobileCSS) */\n ").concat(this._getSharedMobileCSS(y),"\n\n ")}},{key:"_getSharedMobileCSS",value:function(e){return"\n .mobile-duration-dot {\ndisplay: block !important;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background-color: #ef4444;\n animation: mobilePulse 1.5s ease-in-out infinite;\n }\n\n @keyframes mobilePulse {\n 0%, 100% { opacity: 1; transform: scale(1); }\n 50% { opacity: 0.5; transform: scale(0.95); }\n }\n\n .mobile-voice-bar {\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding: 14px;\n background: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #c084fc 100%);\n border-radius: 24px 24px 0 0;\n box-shadow: 0 -8px 32px rgba(124, 58, 237, 0.5), 0 -2px 8px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.2);\n width: 100%;\n max-width: 100%;\n pointer-events: auto;\n }\n\n .mobile-top-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n position: relative;\n }\n\n .mobile-status-indicator {\n display: flex;\n align-items: center;\n gap: 5px;\n min-width: 85px;\n }\n\n .mobile-status-dot {\ndisplay: block !important;\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background-color: #22c55e;\n box-shadow: 0 0 8px #22c55e;\n transition: all 0.3s ease;\n }\n\n .mobile-status-text {\n font-size: 11px;\n font-weight: 700;\n color: rgba(255,255,255,0.95);\n text-transform: uppercase;\n letter-spacing: 0.3px;\n }\n\n .mobile-waveform-center {\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 3px;\n height: 24px;\n }\n\n .mobile-waveform-bar {\ndisplay: block !important;\n width: 4px;\n height: 4px;\n background-color: #fff;\n border-radius: 2px;\n transition: height 0.15s ease;\n box-shadow: 0 0 8px rgba(255,255,255,0.5);\n }\n\n .mobile-controls {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n\n .mobile-control-btn {\n display: flex".concat(e,";\n align-items: center").concat(e,";\n justify-content: center").concat(e,";\n width: 32px").concat(e,";\n height: 32px").concat(e,";\n min-width: 32px").concat(e,";\n min-height: 32px").concat(e,";\n max-width: 32px").concat(e,";\n max-height: 32px").concat(e,";\n border-radius: 50%").concat(e,";\n border: none").concat(e,";\n cursor: pointer").concat(e,";\n transition: all 0.2s ease;\n background-color: rgba(255,255,255,0.15)").concat(e,";\n position: relative").concat(e,";\n overflow: hidden").concat(e,";\n padding: 0").concat(e,";\n margin: 0").concat(e,";\n box-sizing: border-box").concat(e,";\n }\n\n .mobile-control-btn:hover {\n background-color: rgba(255,255,255,0.25)").concat(e,";\n }\n\n .mobile-control-btn.muted {\n background-color: rgba(239, 68, 68, 0.3)").concat(e,";\n }\n\n .mobile-control-btn svg {\n position: absolute").concat(e,";\n top: 50%").concat(e,";\n left: 50%").concat(e,";\n transform: translate(-50%, -50%)").concat(e,";\n display: block").concat(e,";\n visibility: visible").concat(e,";\n opacity: 1").concat(e,";\n width: 15px").concat(e,";\n height: 15px").concat(e,";\n margin: 0").concat(e,";\n padding: 0").concat(e,";\n }\n\n .mobile-mic-off-icon,\n .mobile-speaker-off-icon {\n display: none !important;\n }\n\n .mobile-control-btn.muted .mobile-mic-icon,\n .mobile-control-btn.muted .mobile-speaker-icon {\n display: none !important;\n }\n\n .mobile-control-btn.muted .mobile-mic-off-icon,\n .mobile-control-btn.muted .mobile-speaker-off-icon {\n display: block !important;\n }\n\n .mobile-end-call-btn {\n display: flex").concat(e,";\n align-items: center").concat(e,";\n justify-content: center").concat(e,";\n width: 36px").concat(e,";\n height: 36px").concat(e,";\n min-width: 36px").concat(e,";\n min-height: 36px").concat(e,";\n max-width: 36px").concat(e,";\n max-height: 36px").concat(e,";\n border-radius: 50%").concat(e,";\n border: none").concat(e,";\n cursor: pointer").concat(e,";\n background-color: #ef4444").concat(e,";\n box-shadow: 0 4px 14px rgba(239, 68, 68, 0.5);\n transition: all 0.2s ease;\n overflow: hidden").concat(e,";\n padding: 0").concat(e,";\n margin: 0").concat(e,";\n box-sizing: border-box").concat(e,";\n }\n\n .mobile-end-call-btn svg {\n display: block").concat(e,";\n visibility: visible").concat(e,";\n opacity: 1").concat(e,";\n width: 15px").concat(e,";\n height: 15px").concat(e,";\n margin: 0").concat(e,";\n padding: 0").concat(e,";\n position: relative").concat(e,";\n }\n\n /* ID-specific selectors for WordPress compatibility */\n #mobileMuteBtn.mobile-control-btn,\n #mobileSpeakerBtn.mobile-control-btn,\n #mobileEndCallBtn.mobile-end-call-btn {\n border-radius: 50% !important;\n overflow: hidden !important;\n }\n\n #mobileMuteBtn.mobile-control-btn,\n #mobileSpeakerBtn.mobile-control-btn {\n width: 32px !important;\n height: 32px !important;\n min-width: 32px !important;\n min-height: 32px !important;\n max-width: 32px !important;\n max-height: 32px !important;\n }\n\n #mobileEndCallBtn.mobile-end-call-btn {\n width: 36px !important;\n height: 36px !important;\n min-width: 36px !important;\n min-height: 36px !important;\n max-width: 36px !important;\n max-height: 36px !important;\n }\n\n #mobileMuteBtn.mobile-control-btn svg,\n #mobileSpeakerBtn.mobile-control-btn svg,\n #mobileEndCallBtn.mobile-end-call-btn svg {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n width: 15px !important;\n height: 15px !important;\n margin: 0 !important;\n padding: 0 !important;\n }\n\n .mobile-end-call-btn:hover {\n transform: scale(1.05);\n }\n\n .mobile-transcript-row {\n width: 100%;\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 10px 12px;\n background: rgba(255,255,255,0.18);\n border-radius: 14px;\n border: none;\n cursor: pointer;\n text-align: left;\n backdrop-filter: blur(4px);\n transition: background 0.2s ease;\n }\n\n .mobile-transcript-row:hover {\n background: rgba(255,255,255,0.25);\n }\n\n .mobile-transcript-text {\n margin: 0;\n font-size: 13px;\n color: #fff;\n line-height: 1.4;\n font-weight: 500;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .mobile-transcript-footer {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n .mobile-expand-hint {\n font-size: 10px;\n color: rgba(255,255,255,0.6);\n text-transform: uppercase;\n letter-spacing: 0.5px;\n font-weight: 600;\n }\n\n .mobile-transcript-overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0,0,0,0.6);\n display: flex;\n align-items: flex-end;\n padding: 12px;\n z-index: 100000;\n pointer-events: auto;\n }\n\n .mobile-expanded-transcript {\n width: 100%;\n max-height: 75%;\n background: #fff;\n border-radius: 24px 24px 16px 16px;\n overflow: hidden;\n box-shadow: 0 -8px 40px rgba(0,0,0,0.3);\n display: flex;\n flex-direction: column;\n }\n\n .mobile-transcript-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 14px 16px;\n background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);\n flex-shrink: 0;\n }\n\n .mobile-header-left {\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n\n .mobile-header-status {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n\n .mobile-header-status-dot {\ndisplay: block !important;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background-color: #22c55e;\n box-shadow: 0 0 6px #22c55e;\n }\n\n .mobile-header-status-text {\n font-size: 10px;\n font-weight: 700;\n color: rgba(255,255,255,0.9);\n text-transform: uppercase;\n letter-spacing: 0.5px;\n }\n\n .mobile-header-duration {\n font-size: 10px;\n font-weight: 600;\n color: rgba(255,255,255,0.7);\n margin-left: 8px;\n }\n\n .mobile-transcript-label {\n font-size: 11px;\n font-weight: 800;\n color: rgba(255,255,255,0.7);\n letter-spacing: 1px;\n }\n\n .mobile-close-transcript-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n border-radius: 50%;\n border: none;\n background: rgba(255,255,255,0.2);\n color: #fff;\n cursor: pointer;\n }\n\n .mobile-close-transcript-btn:hover {\n background: rgba(255,255,255,0.3);\n }\n\n .mobile-messages-container {\n flex: 1;\n padding: 16px;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 12px;\n }\n\n .mobile-message-bubble {\n max-width: 85%;\n padding: 12px 16px;\n border-radius: 18px;\n font-size: 14px;\n line-height: 1.5;\n word-wrap: break-word;\n }\n\n .mobile-message-bubble.assistant {\n align-self: flex-start;\n background-color: #f3f4f6;\n color: #374151;\n border-bottom-left-radius: 4px;\n }\n\n .mobile-message-bubble.user {\n align-self: flex-end;\n background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);\n color: #fff;\n border-bottom-right-radius: 4px;\n }\n\n .mobile-input-area {\n padding: 12px 16px 16px;\n border-top: 1px solid #e5e7eb;\n background: #f9fafb;\n flex-shrink: 0;\n }\n\n .mobile-input-wrapper {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 4px 4px 16px;\n background: #fff;\n border-radius: 24px;\n border: 2px solid #e5e7eb;\n }\n\n .mobile-text-input {\n flex: 1;\n border: none;\n outline: none;\n font-size: 14px;\n color: #374151;\n background: transparent;\n padding: 10px 0;\n }\n\n .mobile-text-input::placeholder {\n color: #9ca3af;\n }\n\n .mobile-send-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 40px;\n height: 40px;\n border-radius: 50%;\n border: none;\n background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);\n color: #fff;\n cursor: pointer;\n transition: all 0.2s ease;\n }\n\n .mobile-send-btn:hover:not(:disabled) {\n transform: scale(1.05);\n }\n\n .mobile-send-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .mobile-input-hint {\n margin: 8px 0 0;\n font-size: 11px;\n color: #9ca3af;\n text-align: center;\n transition: color 0.2s ease;\n }\n\n /* Mobile text input status states */\n .mobile-input-hint--sending {\n color: #666;\n }\n\n .mobile-input-hint--success {\n color: #28a745;\n }\n\n .mobile-input-hint--queued {\n color: #ffc107;\n }\n\n .mobile-input-hint--error {\n color: #dc3545;\n }\n\n /* Disabled mobile input styling */\n #mobileTextInput:disabled {\n background-color: #f5f5f5;\n cursor: not-allowed;\n }\n\n #mobileSendBtn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n ")}},{key:"generateMobileCSS",value:function(){var e=!1===this.config.useShadowDOM?" !important":"";return"\n /* Mobile Voice Call UI - Container positioning */\n #mobile-voice-call-bar-container {\n position: fixed;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 99999;\n font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;\n padding: 0 12px 12px;\n pointer-events: none;\n }\n\n .mobile-duration-badge {\n position: absolute;\n top: -28px;\n left: 50%;\n transform: translateX(-50%);\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 5px 14px;\n background: rgba(0,0,0,0.75);\n border-radius: 20px;\n font-size: 12px;\n font-weight: 700;\n color: #fff;\n backdrop-filter: blur(8px);\n z-index: 10;\n pointer-events: auto;\n }\n\n /* Shared mobile styles */\n ".concat(this._getSharedMobileCSS(e),"\n ")}}])&&bn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Qn(e){return Qn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qn(e)}function Fn(e,t){(null==t||t>e.length)&&(t=e.length);for(var A=0,n=Array(t);A<t;A++)n[A]=e[A];return n}function Un(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Sn(n.key),n)}}function Sn(e){var t=function(e){if("object"!=Qn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Qn(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Qn(t)?t:t+""}var kn=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=t,this.config=t.config,this.conversationMessages=[],this.currentLiveMessage=null},(t=[{key:"t",value:function(e){return this.voiceInterface.t(e)}},{key:"escapeHtml",value:function(e){return this.voiceInterface.escapeHtml(e)}},{key:"updateTranscript",value:function(e){if(console.log("📝 [TRANSCRIPT] updateTranscript() called with text:",e?e.substring(0,50)+"...":"null/empty"),this.voiceInterface.isMobile){var t=document.getElementById("mobileTranscriptText");t&&(t.textContent=e),this.voiceInterface.messages.length>0&&"assistant"===this.voiceInterface.messages[this.voiceInterface.messages.length-1].type?this.voiceInterface.messages[this.voiceInterface.messages.length-1].text=e:this.voiceInterface.messages.push({type:"assistant",text:e});var A=document.getElementById("mobileMessagesContainer");if(A){var n=A.querySelector(".mobile-message-bubble.assistant:last-child");n?n.textContent=e:this.voiceInterface.addMobileMessage("assistant",e)}}else{var o=this.voiceInterface.shadowRoot.getElementById("liveTextCollapsed");if(o)if(e&&e.trim()){o.textContent=e,o.classList.remove("muted");var r=document.createElement("span");r.className="typing-cursor",o.appendChild(r)}else o.textContent=this.t("transcriptWillAppear")||"Transcript will appear here...",o.classList.add("muted");if(e&&e.trim()?(this.currentLiveMessage&&"assistant"===this.currentLiveMessage.role&&e.startsWith(this.currentLiveMessage.content)?this.currentLiveMessage.content=e:(this.currentLiveMessage&&this.finalizeLiveMessage(),this.currentLiveMessage={role:"assistant",content:e}),this.updateLiveMessageRow()):(this.currentLiveMessage=null,this.updateLiveMessageRow()),this.voiceInterface.conversationExpanded){var i=this.voiceInterface.shadowRoot.getElementById("conversationHistory");i&&setTimeout(function(){i.scrollTop=i.scrollHeight},10)}}}},{key:"toggleConversationPanel",value:function(){if(!this.voiceInterface.isMobile){this.voiceInterface.conversationExpanded=!this.voiceInterface.conversationExpanded;var e=this.voiceInterface.shadowRoot.getElementById("desktopConversationPanel"),t=this.voiceInterface.shadowRoot.getElementById("conversationHeader"),A=this.voiceInterface.shadowRoot.getElementById("conversationToggleText"),n=this.voiceInterface.shadowRoot.querySelector(".voice-interface");if(e){var o,r=this.voiceInterface.shadowRoot.getElementById("desktopVoiceSection"),i=this.voiceInterface.shadowRoot.getElementById("compactVoiceSection");this.voiceInterface.conversationExpanded?(e.classList.remove("collapsed"),e.classList.add("expanded"),t&&t.classList.add("expanded"),A&&(A.textContent="Hide history"),n&&n.classList.add("expanded"),r&&(r.style.display="none"),i&&(i.style.display="flex"),console.log("📝 [TRANSCRIPT] Expanding panel, rendering",(null===(o=this.conversationMessages)||void 0===o?void 0:o.length)||0,"messages"),this.renderConversationMessages()):(e.classList.remove("expanded"),e.classList.add("collapsed"),t&&t.classList.remove("expanded"),A&&(A.textContent="Show history"),n&&n.classList.remove("expanded"),r&&(r.style.display=""),i&&(i.style.display="none"))}}}},{key:"finalizeLiveMessage",value:function(){this.currentLiveMessage&&this.currentLiveMessage.content&&this.currentLiveMessage.content.trim()&&(this.conversationMessages||(this.conversationMessages=[]),this.conversationMessages.push({role:this.currentLiveMessage.role,content:this.currentLiveMessage.content}),console.log("📝 [TRANSCRIPT] Finalized live message:",this.currentLiveMessage.role,this.currentLiveMessage.content.substring(0,50)+"..."),this.currentLiveMessage=null,this.voiceInterface.conversationExpanded&&this.renderConversationMessages())}},{key:"addConversationMessage",value:function(e,t){if(!this.voiceInterface.isMobile&&t&&t.trim()){if(this.currentLiveMessage&&this.finalizeLiveMessage(),this.conversationMessages||(this.conversationMessages=[]),"user"!==e)return this.currentLiveMessage={role:e,content:t},this.updateLiveMessageRow(),void console.log("📝 [TRANSCRIPT] Assistant message set as live (via addConversationMessage)");this.conversationMessages.push({role:e,content:t}),console.log("📝 [TRANSCRIPT] User message added to history"),this.voiceInterface.conversationExpanded&&this.renderConversationMessages()}}},{key:"updateLiveMessageRow",value:function(){var e=this.voiceInterface.shadowRoot.getElementById("liveMessageRow"),t=this.voiceInterface.shadowRoot.getElementById("liveMessageText"),A=null==e?void 0:e.querySelector(".message-avatar");if(e&&t)if(this.currentLiveMessage&&this.currentLiveMessage.content&&this.currentLiveMessage.content.trim()){A&&("user"===this.currentLiveMessage.role?(A.textContent="U",A.className="message-avatar user"):(A.innerHTML='<div class="orb"></div>',A.className="message-avatar assistant")),t.textContent=this.currentLiveMessage.content,e.style.display="flex";var n=t.querySelector(".typing-cursor")||document.createElement("span");n.className="typing-cursor",t.querySelector(".typing-cursor")||t.appendChild(n)}else e.style.display="none"}},{key:"clearConversationMessages",value:function(){this.conversationMessages=[],this.currentLiveMessage=null;var e=this.voiceInterface.shadowRoot.getElementById("liveMessageRow");e&&(e.style.display="none")}},{key:"renderConversationMessages",value:function(){var e=this,t=this.voiceInterface.shadowRoot.getElementById("conversationMessages");if(t){if(!this.conversationMessages||0===this.conversationMessages.length)return console.log("📝 [TRANSCRIPT] No messages to render"),void(t.innerHTML="");var A=function(e){return function(e){if(Array.isArray(e))return Fn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Fn(e,t);var A={}.toString.call(e).slice(8,-1);return"Object"===A&&e.constructor&&(A=e.constructor.name),"Map"===A||"Set"===A?Array.from(e):"Arguments"===A||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A)?Fn(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(this.conversationMessages);if(this.currentLiveMessage&&A.length>0){var n=A[A.length-1];n.role===this.currentLiveMessage.role&&n.content===this.currentLiveMessage.content&&(A=A.slice(0,-1))}console.log("📝 [TRANSCRIPT] Rendering",A.length,"messages (live message excluded)"),t.innerHTML=A.map(function(t){var A="user"===t.role;return'\n <div class="message-row '.concat(t.role,'">\n <div class="message-avatar ').concat(t.role,'">\n ').concat(A?"U":'<div class="orb"></div>','\n </div>\n <div class="message-bubble">').concat(e.escapeHtml(t.content),"</div>\n </div>\n ")}).join("");var o=this.voiceInterface.shadowRoot.getElementById("conversationHistory");o&&setTimeout(function(){o.scrollTop=o.scrollHeight},10)}else console.warn("📝 [TRANSCRIPT] conversationMessages container not found")}}])&&Un(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function En(e){return En="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},En(e)}function In(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Tn(n.key),n)}}function Tn(e){var t=function(e){if("object"!=En(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=En(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==En(t)?t:t+""}var Hn=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=t,this.config=t.config,this.shadowRoot=t.shadowRoot,this._textInjectTimeout=null,this._mobileTextInjectTimeout=null,this._statusClearTimeout=null,this._mobileStatusClearTimeout=null,this._originalHintText=null,this._originalMobileHintText=null,this._textInjectAckHandler=null},t=[{key:"t",value:function(e){return this.voiceInterface.t(e)}},{key:"setupTextInjectAckHandler",value:function(){var e,t=this;null!==(e=this.voiceInterface.sdk)&&void 0!==e&&e.voiceSDK&&(this._textInjectAckHandler&&this.voiceInterface.sdk.voiceSDK.off("textInjectAck",this._textInjectAckHandler),this._textInjectAckHandler=function(e){t.handleTextInjectAck(e)},this.voiceInterface.sdk.voiceSDK.on("textInjectAck",this._textInjectAckHandler))}},{key:"cleanup",value:function(){this._textInjectTimeout&&(clearTimeout(this._textInjectTimeout),this._textInjectTimeout=null),this._mobileTextInjectTimeout&&(clearTimeout(this._mobileTextInjectTimeout),this._mobileTextInjectTimeout=null),this._statusClearTimeout&&(clearTimeout(this._statusClearTimeout),this._statusClearTimeout=null),this._mobileStatusClearTimeout&&(clearTimeout(this._mobileStatusClearTimeout),this._mobileStatusClearTimeout=null),this._originalHintText=null,this._originalMobileHintText=null}},{key:"handleTextInjectAck",value:function(e){var t,A;this._textInjectTimeout&&(clearTimeout(this._textInjectTimeout),this._textInjectTimeout=null),this._mobileTextInjectTimeout&&(clearTimeout(this._mobileTextInjectTimeout),this._mobileTextInjectTimeout=null);var n=this.shadowRoot.getElementById("voiceTextInput"),o=this.shadowRoot.getElementById("voiceSendBtn");n&&(n.disabled=!1),o&&(o.disabled=!(null!=n&&null!==(t=n.value)&&void 0!==t&&t.trim()));var r=document.getElementById("mobileTextInput"),i=document.getElementById("mobileSendBtn");if(r&&(r.disabled=!1),i&&(i.disabled=!(null!=r&&null!==(A=r.value)&&void 0!==A&&A.trim())),e.success){var a,s=null===(a=e.message)||void 0===a?void 0:a.toLowerCase().includes("queued"),c=s?"queued":"success",l=s?"Message queued":"Message sent";this.voiceInterface.isMobile?this.showMobileTextInputStatus(c,l):this.showDesktopTextInputStatus(c,l)}else{var u=e.message||"Failed to send";this.voiceInterface.isMobile?this.showMobileTextInputStatus("error",u):this.showDesktopTextInputStatus("error",u)}}},{key:"sendDesktopTextMessage",value:function(){var e=this.shadowRoot.getElementById("voiceTextInput"),t=this.shadowRoot.getElementById("voiceSendBtn");if(e&&t){var A=e.value.trim();A&&this._sendTextMessage(A,e,t,!1)}else console.warn("VoiceInterface: Missing UI elements for desktop text send")}},{key:"sendMobileTextMessage",value:function(){var e=document.getElementById("mobileTextInput"),t=document.getElementById("mobileSendBtn");e&&t?this._sendTextMessage(e.value,e,t,!0):console.warn("VoiceInterface: Missing UI elements for mobile text send")}},{key:"_sendTextMessage",value:function(e,t,A,n){var o,r=this;if(this.voiceInterface.isActive&&null!==(o=this.voiceInterface.sdk)&&void 0!==o&&o.voiceSDK){var i=null==e?void 0:e.trim();if(i){t.value="",A&&(A.disabled=!0),this.showTextInputStatus(n?"mobile":"desktop","sending","Sending...");try{if(this.voiceInterface.sdk.voiceSDK.sendMessage({t:"text_inject",text:i})){var a=setTimeout(function(){n?r._mobileTextInjectTimeout=null:r._textInjectTimeout=null,t.disabled=!1,A&&(A.disabled=!1),r.showTextInputStatus(n?"mobile":"desktop","error","No response")},5e3);n?this._mobileTextInjectTimeout=a:this._textInjectTimeout=a,n?this.voiceInterface.addMobileMessage("user",i):this.voiceInterface.addConversationMessage("user",i)}else t.disabled=!1,A&&(A.disabled=!1),this.showTextInputStatus(n?"mobile":"desktop","error","Failed to send")}catch(e){console.error("Error sending text message:",e),t.disabled=!1,A&&(A.disabled=!1),this.showTextInputStatus(n?"mobile":"desktop","error","Error sending")}}else this.showTextInputStatus(n?"mobile":"desktop","error","Enter text first")}else console.warn("VoiceInterface: Cannot send text - call not active")}},{key:"showTextInputStatus",value:function(e,t,A){"mobile"===e?this.showMobileTextInputStatus(t,A):this.showDesktopTextInputStatus(t,A)}},{key:"showDesktopTextInputStatus",value:function(e,t){var A=this.shadowRoot.querySelector(".voice-input-hint");A&&(this._originalHintText||(this._originalHintText=A.textContent),A.classList.remove("voice-input-hint--sending","voice-input-hint--success","voice-input-hint--queued","voice-input-hint--error"),"sending"===e?(A.classList.add("voice-input-hint--sending"),A.textContent=t||"Sending..."):"success"===e?(A.classList.add("voice-input-hint--success"),A.textContent=t||"Sent",this.clearTextInputStatusAfterDelay(3e3)):"queued"===e?(A.classList.add("voice-input-hint--queued"),A.textContent=t||"Queued"):"error"===e?(A.classList.add("voice-input-hint--error"),A.textContent=t||"Error",this.clearTextInputStatusAfterDelay(3e3)):"clear"===e&&(A.textContent=this._originalHintText||this.t("voiceActive")||"Voice is still active • Type or speak",this._originalHintText=null))}},{key:"showMobileTextInputStatus",value:function(e,t){var A=document.querySelector(".mobile-input-hint");A&&(this._originalMobileHintText||(this._originalMobileHintText=A.textContent),A.classList.remove("mobile-input-hint--sending","mobile-input-hint--success","mobile-input-hint--queued","mobile-input-hint--error"),"sending"===e?(A.classList.add("mobile-input-hint--sending"),A.textContent=t||"Sending..."):"success"===e?(A.classList.add("mobile-input-hint--success"),A.textContent=t||"Sent",this.clearMobileTextInputStatusAfterDelay(3e3)):"queued"===e?(A.classList.add("mobile-input-hint--queued"),A.textContent=t||"Queued"):"error"===e?(A.classList.add("mobile-input-hint--error"),A.textContent=t||"Error",this.clearMobileTextInputStatusAfterDelay(3e3)):"clear"===e&&(A.textContent=this._originalMobileHintText||"🎙️ Voice is still active • Type or speak",this._originalMobileHintText=null))}},{key:"clearTextInputStatusAfterDelay",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;this._statusClearTimeout&&clearTimeout(this._statusClearTimeout),this._statusClearTimeout=setTimeout(function(){e.showDesktopTextInputStatus("clear"),e._statusClearTimeout=null},t)}},{key:"clearMobileTextInputStatusAfterDelay",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;this._mobileStatusClearTimeout&&clearTimeout(this._mobileStatusClearTimeout),this._mobileStatusClearTimeout=setTimeout(function(){e.showMobileTextInputStatus("clear"),e._mobileStatusClearTimeout=null},t)}}],t&&In(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Dn(e){return Dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dn(e)}function Pn(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,On(n.key),n)}}function On(e){var t=function(e){if("object"!=Dn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Dn(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Dn(t)?t:t+""}var Kn=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=t,this.config=t.config,this.shadowRoot=t.shadowRoot},t=[{key:"setupEventHandlers",value:function(e){var t=this,A=this.shadowRoot.getElementById("startCallBtn"),n=this.shadowRoot.getElementById("desktopEndCallBtn"),o=this.shadowRoot.getElementById("desktopMuteBtn"),r=this.shadowRoot.getElementById("desktopSpeakerBtn"),i=this.shadowRoot.getElementById("desktopEndCallBtnCompact"),a=this.shadowRoot.getElementById("desktopMuteBtnCompact"),s=this.shadowRoot.getElementById("desktopSpeakerBtnCompact");if(A&&(A.onclick=function(){return t.voiceInterface.startVoiceCall()}),n&&(n.onclick=function(){return t.voiceInterface.endVoiceCall()}),o&&(o.onclick=function(){return t.voiceInterface.toggleMute()}),r&&(r.onclick=function(){return t.voiceInterface.toggleSpeaker()}),i&&(i.onclick=function(){return t.voiceInterface.endVoiceCall()}),a&&(a.onclick=function(){return t.voiceInterface.toggleMute()}),s&&(s.onclick=function(){return t.voiceInterface.toggleSpeaker()}),!this.voiceInterface.isMobile){var c=this.shadowRoot.getElementById("voiceTextInput"),l=this.shadowRoot.getElementById("voiceSendBtn");c&&(c.addEventListener("input",function(){l&&(l.disabled=!c.value.trim())}),c.addEventListener("keypress",function(e){"Enter"===e.key&&!e.shiftKey&&c.value.trim()&&(e.preventDefault(),l&&!l.disabled&&l.click())})),l&&(l.onclick=function(){t.voiceInterface.sendDesktopTextMessage()});var u=this.shadowRoot.getElementById("conversationHeader");u&&u.addEventListener("click",function(){t.voiceInterface.transcript.toggleConversationPanel()})}}},{key:"setupMobileEventHandlers",value:function(){var e=this;if(this.voiceInterface.isMobile){var t=document.getElementById("mobileMuteBtn"),A=document.getElementById("mobileSpeakerBtn"),n=document.getElementById("mobileEndCallBtn"),o=document.getElementById("mobileTranscriptRow"),r=document.getElementById("mobileCloseTranscriptBtn"),i=document.getElementById("mobileTextInput"),a=document.getElementById("mobileSendBtn");t&&(t.onclick=function(){return e.voiceInterface.toggleMute()}),A&&(A.onclick=function(){return e.voiceInterface.toggleSpeaker()}),n&&(n.onclick=function(){return e.voiceInterface.endVoiceCall()}),o&&(o.onclick=function(){e.voiceInterface.expandMobileTranscript()}),r&&(r.onclick=function(){e.voiceInterface.collapseMobileTranscript()}),i&&(i.addEventListener("input",function(){a&&(a.disabled=!i.value.trim())}),i.addEventListener("keypress",function(e){"Enter"===e.key&&!e.shiftKey&&i.value.trim()&&(e.preventDefault(),a&&!a.disabled&&a.click())})),a&&(a.onclick=function(){e.voiceInterface.sendMobileTextMessage()})}}}],t&&Pn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Mn(e){return Mn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mn(e)}function Ln(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Rn(n.key),n)}}function Rn(e){var t=function(e){if("object"!=Mn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Mn(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Mn(t)?t:t+""}var _n=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=t,this.config=t.config,this.shadowRoot=t.shadowRoot,this._liveWaveformInterval=null},(t=[{key:"t",value:function(e){return this.voiceInterface.t(e)}},{key:"adjustSizesForContainer",value:function(){var e=this.shadowRoot.getElementById("voiceInterface");if(e){var t,A,n,o,r,i,a=e.clientHeight||e.offsetHeight||400,s=e.clientWidth||e.offsetWidth||400;a<=350?(t=80,A=80,n=48,o=54,r=6,i=12):a<=450?(t=100,A=100,n=56,o=62,r=8,i=14):a<=550?(t=120,A=120,n=64,o=70,r=10,i=16):a<=700?(t=140,A=140,n=72,o=78,r=12,i=18):(t=160,A=160,n=80,o=86,r=14,i=20);var c=this.shadowRoot.querySelector(".voice-avatar, .voice-avatar-active");c&&(c.style.width="".concat(t,"px"),c.style.height="".concat(t,"px"),c.style.fontSize="".concat(.5*t,"px"));var l=this.shadowRoot.querySelector(".voice-status-title"),u=this.shadowRoot.querySelector(".voice-status-subtitle");l&&(l.style.fontSize="".concat(i,"px")),u&&(u.style.fontSize="".concat(Math.max(10,i-4),"px"));var d=this.shadowRoot.querySelector(".voice-transcript");d&&(d.style.minHeight="".concat(A,"px"),d.style.maxHeight="".concat(A,"px"),d.style.height="".concat(A,"px"),d.style.width="min(360px, ".concat(s-40,"px)"),d.style.boxSizing="border-box");var p=this.shadowRoot.querySelector(".transcript-label");p&&(p.style.fontSize="".concat(Math.max(8,i-4),"px"));var h=this.shadowRoot.querySelector(".transcript-text");h&&(h.style.fontSize="".concat(Math.max(10,i-2),"px"));var g=this.shadowRoot.querySelector(".voice-text-input-area");if(g){var f=g.querySelector(".voice-input-wrapper"),m=g.querySelector(".voice-text-input"),v=g.querySelector(".voice-send-btn"),B=g.querySelector(".voice-input-hint");if(f&&v){var w=Math.max(32,Math.min(40,.7*n));v.style.width="".concat(w,"px"),v.style.height="".concat(w,"px");var y=v.querySelector("svg");if(y){var b=Math.max(14,Math.min(18,.45*w));y.style.width="".concat(b,"px"),y.style.height="".concat(b,"px")}}m&&(m.style.fontSize="".concat(Math.max(11,Math.min(14,i)),"px"),m.style.padding="".concat(Math.max(6,Math.min(10,Math.floor(.15*n))),"px 0")),B&&(B.style.fontSize="".concat(Math.max(8,Math.min(11,i-4)),"px"),B.style.marginTop="".concat(Math.max(3,Math.min(6,Math.floor(.6*r))),"px"))}this.shadowRoot.querySelectorAll(".voice-control-btn.secondary").forEach(function(e){e.style.width="".concat(n,"px"),e.style.height="".concat(n,"px");var t=e.querySelector("svg");if(t){var A=.65*n;t.style.setProperty("width","".concat(A,"px"),"important"),t.style.setProperty("height","".concat(A,"px"),"important"),t.style.setProperty("min-width","".concat(A,"px"),"important"),t.style.setProperty("min-height","".concat(A,"px"),"important")}});var C=this.shadowRoot.querySelector(".voice-control-btn.primary");if(C){C.style.width="".concat(o,"px"),C.style.height="".concat(o,"px");var x=C.querySelector("svg");if(x){var Q=.7*o;x.style.setProperty("width","".concat(Q,"px"),"important"),x.style.setProperty("height","".concat(Q,"px"),"important"),x.style.setProperty("min-width","".concat(Q,"px"),"important"),x.style.setProperty("min-height","".concat(Q,"px"),"important")}}var F=this.shadowRoot.querySelector(".start-call-btn");if(F){var U,S;a<=350?(U=48,S=14):a<=450?(U=52,S=15):a<=550?(U=58,S=17):a<=700?(U=62,S=18):(U=64,S=18),F.style.height="".concat(U,"px"),F.style.fontSize="".concat(S,"px");var k=F.querySelector("svg");if(k){var E=Math.max(22,.5*U);k.style.width="".concat(E,"px"),k.style.height="".concat(E,"px")}}}}},{key:"startDesktopWaveformAnimation",value:function(){if(!this.voiceInterface.isMobile){var e=this.shadowRoot.getElementById("desktopWaveform");e&&(e.classList.remove("paused"),this.updateDesktopStatus())}}},{key:"stopDesktopWaveformAnimation",value:function(){if(!this.voiceInterface.isMobile){var e=this.shadowRoot.getElementById("desktopWaveform");e&&e.classList.add("paused")}}},{key:"updateDesktopStatus",value:function(){if(!this.voiceInterface.isMobile){var e=this.shadowRoot.getElementById("compactStatusText")||this.shadowRoot.getElementById("desktopStatusText");if(e){var t;t=this.config.statusText||(this.voiceInterface.isActive&&!this.voiceInterface.isMicMuted?this.t("listening"):this.t("connected")),e.textContent=t;var A=this.shadowRoot.getElementById("desktopStatusText");A&&A!==e&&(A.textContent=t)}}}},{key:"updateLiveWaveform",value:function(e){if(!this.voiceInterface.isMobile){var t=this.shadowRoot.getElementById("desktopLiveWaveform");t&&t.querySelectorAll(".desktop-live-bar").forEach(function(t,A){if(e){var n=40*Math.random()+8;t.style.height="".concat(n,"px")}else t.style.height="8px"})}}},{key:"showError",value:function(e){var t=this.shadowRoot.getElementById("transcriptText");t&&(t.textContent="".concat(this.t("error"),": ").concat(e),t.classList.remove("empty"))}},{key:"showDomainError",value:function(){var e=this;console.log("🚫 Showing domain error in widget UI...");var t=this.shadowRoot.getElementById("voiceIdleState");if(t){var A=t.querySelector(".voice-status-title"),n=t.querySelector(".voice-status-subtitle"),o=t.querySelector("#startCallBtn"),r=this.t("domainNotValidated"),i=this.t("domainErrorMessage");console.log("🚫 Domain error title:",r),console.log("🚫 Domain error message:",i),A?(A.textContent=r,A.style.color="#991B1B",A.style.fontSize="20px",A.style.fontWeight="600",A.style.marginLeft="20px",A.style.marginRight="20px",A.style.textAlign="center",console.log("✅ Updated statusTitle with domain error")):console.warn("⚠️ .voice-status-title element not found"),n?(n.textContent=i,n.style.color="#991B1B",n.style.fontSize="16px",n.style.marginLeft="20px",n.style.marginRight="20px",n.style.marginTop="12px",n.style.textAlign="center",n.style.lineHeight="1.5",console.log("✅ Updated statusSubtitle with domain error")):console.warn("⚠️ .voice-status-subtitle element not found"),o?(o.style.display="none",console.log("✅ Hidden start call button")):console.warn("⚠️ #startCallBtn element not found");var a=t.querySelector("#domainErrorBackBtn");if(a)a.style.display="flex";else{(a=document.createElement("button")).id="domainErrorBackBtn",a.className="domain-error-back-btn",a.innerHTML='\n <svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" style="margin-right: 8px;">\n <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/>\n </svg>\n <span>'.concat(this.t("back")||"Back","</span>\n ");var s=t.querySelector(".voice-status");s&&s.parentNode?s.parentNode.insertBefore(a,s.nextSibling):n&&n.parentNode?n.parentNode.insertBefore(a,n.nextSibling):t.appendChild(a),a.style.cssText="\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 24px auto 0;\n padding: 12px 24px;\n background-color: #7C3AED;\n color: white;\n border: none;\n border-radius: 8px;\n font-size: 16px;\n font-weight: 500;\n cursor: pointer;\n transition: background-color 0.2s;\n max-width: 200px;\n ",a.addEventListener("mouseenter",function(){a.style.backgroundColor="#6D28D9"}),a.addEventListener("mouseleave",function(){a.style.backgroundColor="#7C3AED"}),a.onclick=function(){console.log("🔙 Domain error back button clicked"),e.voiceInterface.isShowingDomainError=!1,e.voiceInterface.resetConnectingState(),a&&a.parentNode&&a.parentNode.removeChild(a),e.voiceInterface.config.onShowLanding&&"function"==typeof e.voiceInterface.config.onShowLanding&&e.voiceInterface.config.onShowLanding()},console.log("✅ Created domain error back button")}t.style.display="flex",console.log("✅ Domain error displayed in widget UI");var c=this.shadowRoot.getElementById("transcriptText");if(c){var l=this.t("domainNotValidated"),u=this.t("domainErrorMessage");c.innerHTML='<div style="font-weight: 600; font-size: 16px; margin-bottom: 8px; color: #991B1B;">'.concat(l,'</div><div style="font-size: 14px; color: #991B1B; line-height: 1.5;">').concat(u,"</div>"),c.classList.remove("empty")}}else console.warn("⚠️ voiceIdleState element not found, cannot show domain error")}},{key:"showBackButtonWarning",value:function(){var e=this.shadowRoot.getElementById("transcriptText"),t=this.shadowRoot.getElementById("liveTextCollapsed");if(e){var A=e.textContent,n=e.innerHTML;e.innerHTML='\n <div style="font-weight: 600; font-size: 16px; margin-bottom: 8px; color: #92400e; display: flex; align-items: center; gap: 8px;">\n <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="flex-shrink: 0;">\n <path d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/>\n </svg>\n Please end the call first\n </div>\n <div style="font-size: 14px; color: #92400e; line-height: 1.5;">\n You need to end the current call before going back.\n </div>\n ',e.classList.remove("empty"),setTimeout(function(){e&&(e.innerHTML=n,e.textContent=A,A&&""!==A.trim()||e.classList.add("empty"))},5e3)}else if(t){var o=t.textContent;t.innerHTML='\n <span style="color: #92400e; font-weight: 600;">⚠️ Please end the call first - You need to end the current call before going back.</span>\n ',setTimeout(function(){t&&(t.textContent=o)},5e3)}}},{key:"startLiveWaveformInterval",value:function(){var e=this;this.voiceInterface.isMobile||(this._liveWaveformInterval&&clearInterval(this._liveWaveformInterval),this._liveWaveformInterval=setInterval(function(){e.updateLiveWaveform(e.voiceInterface.isActive&&!e.voiceInterface.isMicMuted)},100))}},{key:"stopLiveWaveformInterval",value:function(){this._liveWaveformInterval&&(clearInterval(this._liveWaveformInterval),this._liveWaveformInterval=null)}},{key:"cleanup",value:function(){this.stopLiveWaveformInterval(),this.stopDesktopWaveformAnimation()}}])&&Ln(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Vn(e){return Vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vn(e)}function jn(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Nn(n.key),n)}}function Nn(e){var t=function(e){if("object"!=Vn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Vn(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Vn(t)?t:t+""}var Gn=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.voiceInterface=t,this.config=t.config,this.waveformBars=[.3,.5,.8,.4,.6,.9,.5,.7],this.waveformInterval=null,this.isTranscriptExpanded=!1,this.voiceInterface.messages||(this.voiceInterface.messages=[])},(t=[{key:"t",value:function(e){return this.voiceInterface.t(e)}},{key:"createMobileMinimizedBar",value:function(){var e=document.getElementById("mobile-voice-call-bar-container");if(e&&e.remove(),!document.getElementById("mobile-voice-call-bar-styles")){var t=document.createElement("style");t.id="mobile-voice-call-bar-styles",t.textContent=this.voiceInterface.styles.generateMobileCSS(),document.head.appendChild(t)}var A=document.createElement("div");A.id="mobile-voice-call-bar-container",A.innerHTML='\n \x3c!-- Duration Badge --\x3e\n <div class="mobile-duration-badge" id="mobileDurationBadge">\n <div class="mobile-duration-dot"></div>\n <span id="mobileDurationText">00:00</span>\n </div>\n \n \x3c!-- Main Bar --\x3e\n <div class="mobile-voice-bar">\n \x3c!-- Top Row: Status, Waveform, Controls --\x3e\n <div class="mobile-top-row">\n \x3c!-- Status Indicator --\x3e\n <div class="mobile-status-indicator">\n <div class="mobile-status-dot" id="mobileStatusDot"></div>\n <span class="mobile-status-text" id="mobileStatusText">'.concat(this.t("listening"),'</span>\n </div>\n \n \x3c!-- Centered Waveform --\x3e\n <div class="mobile-waveform-center" id="mobileWaveform">\n ').concat(Array(8).fill(0).map(function(e,t){return'<div class="mobile-waveform-bar" data-index="'.concat(t,'"></div>')}).join(""),'\n </div>\n \n \x3c!-- Controls --\x3e\n <div class="mobile-controls">\n <button class="mobile-control-btn" id="mobileMuteBtn" aria-label="Mute microphone">\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-mic-icon">\n <path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2"/>\n <line x1="12" x2="12" y1="19" y2="22"/>\n </svg>\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-mic-off-icon" style="display: none;">\n <line x1="2" x2="22" y1="2" y2="22"/>\n <path d="M18.89 13.23A7.12 7.12 0 0 0 19 12v-2"/>\n <path d="M5 10v2a7 7 0 0 0 12 5"/>\n <path d="M15 9.34V5a3 3 0 0 0-5.68-1.33"/>\n <path d="M9 9v3a3 3 0 0 0 5.12 2.12"/>\n <line x1="12" x2="12" y1="19" y2="22"/>\n </svg>\n </button>\n \n <button class="mobile-control-btn" id="mobileSpeakerBtn" aria-label="Toggle speaker">\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-speaker-icon">\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/>\n <path d="M15.54 8.46a5 5 0 0 1 0 7.07"/>\n </svg>\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-speaker-off-icon" style="display: none;">\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/>\n <line x1="22" x2="16" y1="9" y2="15"/>\n <line x1="16" x2="22" y1="9" y2="15"/>\n </svg>\n </button>\n \n <button class="mobile-end-call-btn" id="mobileEndCallBtn" aria-label="End call">\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"/>\n <line x1="22" x2="2" y1="2" y2="22"/>\n </svg>\n </button>\n </div>\n </div>\n \n \x3c!-- Bottom Row: Transcript (expandable) --\x3e\n <button class="mobile-transcript-row" id="mobileTranscriptRow">\n <p class="mobile-transcript-text" id="mobileTranscriptText">').concat(this.t("transcriptWillAppear"),'</p>\n <div class="mobile-transcript-footer">\n <span class="mobile-expand-hint">tap to expand & type</span>\n <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="opacity: 0.6;">\n <path d="M7 17L17 7M17 7H7M17 7V17"/>\n </svg>\n </div>\n </button>\n </div>\n \n \x3c!-- Expanded Transcript Overlay --\x3e\n <div class="mobile-transcript-overlay" id="mobileTranscriptOverlay" style="display: none;">\n <div class="mobile-expanded-transcript" id="mobileExpandedTranscript">\n \x3c!-- Header --\x3e\n <div class="mobile-transcript-header">\n <div class="mobile-header-left">\n <div class="mobile-header-status">\n <div class="mobile-header-status-dot"></div>\n <span class="mobile-header-status-text" id="mobileHeaderStatusText">').concat(this.t("listening"),'</span>\n <span class="mobile-header-duration" id="mobileHeaderDuration">00:00</span>\n </div>\n <span class="mobile-transcript-label">CONVERSATION</span>\n </div>\n <button class="mobile-close-transcript-btn" id="mobileCloseTranscriptBtn">\n <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 6L6 18M6 6l12 12"/>\n </svg>\n </button>\n </div>\n \n \x3c!-- Messages Container --\x3e\n <div class="mobile-messages-container" id="mobileMessagesContainer">\n \x3c!-- Messages will be dynamically added here --\x3e\n </div>\n \n \x3c!-- Text Input Area --\x3e\n <div class="mobile-input-area">\n <div class="mobile-input-wrapper">\n <input\n type="text"\n placeholder="Type a message..."\n id="mobileTextInput"\n class="mobile-text-input"\n />\n <button class="mobile-send-btn" id="mobileSendBtn" disabled>\n <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"/>\n </svg>\n </button>\n </div>\n <p class="mobile-input-hint">🎙️ ').concat(this.t("voiceActive")||"Voice is still active"," • ").concat(this.t("typeOrSpeak")||"Type or speak","</p>\n </div>\n </div>\n </div>\n "),document.body.appendChild(A);var n=document.getElementById("mobileMuteBtn"),o=document.getElementById("mobileSpeakerBtn"),r=document.getElementById("mobileEndCallBtn");if(n){n.style.cssText="\n width: 32px !important;\n height: 32px !important;\n min-width: 32px !important;\n min-height: 32px !important;\n max-width: 32px !important;\n max-height: 32px !important;\n aspect-ratio: 1 !important;\n border-radius: 50% !important;\n overflow: hidden !important;\n padding: 0 !important;\n margin: 0 !important;\n box-sizing: border-box !important;\n ";var i=n.querySelector(".mobile-mic-icon"),a=n.querySelector(".mobile-mic-off-icon");i&&(i.style.cssText="\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n width: 15px !important;\n height: 15px !important;\n margin: 0 !important;\n padding: 0 !important;\n position: absolute !important;\n top: 50% !important;\n left: 50% !important;\n transform: translate(-50%, -50%) !important;\n "),a&&(a.style.cssText="\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n position: absolute !important;\n top: 50% !important;\n left: 50% !important;\n transform: translate(-50%, -50%) !important;\n ")}if(o){o.style.cssText="\n width: 32px !important;\n height: 32px !important;\n min-width: 32px !important;\n min-height: 32px !important;\n max-width: 32px !important;\n max-height: 32px !important;\n aspect-ratio: 1 !important;\n border-radius: 50% !important;\n overflow: hidden !important;\n padding: 0 !important;\n margin: 0 !important;\n box-sizing: border-box !important;\n ";var s=o.querySelector(".mobile-speaker-icon"),c=o.querySelector(".mobile-speaker-off-icon");s&&(s.style.cssText="\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n width: 15px !important;\n height: 15px !important;\n margin: 0 !important;\n padding: 0 !important;\n position: absolute !important;\n top: 50% !important;\n left: 50% !important;\n transform: translate(-50%, -50%) !important;\n "),c&&(c.style.cssText="\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n position: absolute !important;\n top: 50% !important;\n left: 50% !important;\n transform: translate(-50%, -50%) !important;\n ")}if(r){r.style.cssText="\n width: 36px !important;\n height: 36px !important;\n min-width: 36px !important;\n min-height: 36px !important;\n max-width: 36px !important;\n max-height: 36px !important;\n aspect-ratio: 1 !important;\n border-radius: 50% !important;\n overflow: hidden !important;\n padding: 0 !important;\n margin: 0 !important;\n box-sizing: border-box !important;\n ";var l=r.querySelector("svg");l&&(l.style.cssText="\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n width: 15px !important;\n height: 15px !important;\n margin: 0 !important;\n padding: 0 !important;\n ")}this.voiceInterface.setupMobileEventHandlers()}},{key:"removeMobileMinimizedBar",value:function(){var e=document.getElementById("mobile-voice-call-bar-container");e&&e.remove()}},{key:"expandMobileTranscript",value:function(){var e=document.getElementById("mobileTranscriptOverlay");if(e){e.style.display="flex",this.isTranscriptExpanded=!0;var t=document.getElementById("mobileTextInput");t&&setTimeout(function(){return t.focus()},100);var A=document.getElementById("mobileMessagesContainer");A&&setTimeout(function(){A.scrollTop=A.scrollHeight},100)}}},{key:"collapseMobileTranscript",value:function(){var e=document.getElementById("mobileTranscriptOverlay");e&&(e.style.display="none",this.isTranscriptExpanded=!1)}},{key:"updateMobileStatus",value:function(e){var t=document.getElementById("mobileStatusText"),A=document.getElementById("mobileHeaderStatusText"),n=document.getElementById("mobileStatusDot");if(t||A){var o=this.config.statusText,r="",i="#6b7280";o?(r=o,i=this.config.statusDotColor||"#10b981"):"connecting"===e?(r=this.t("connecting")||"Connecting...",i="#3b82f6"):"listening"===e||"recording"===e?(r=this.t("listening")||"Listening...",i="#22c55e"):"speaking"===e?(r=this.t("speaking")||"Speaking...",i="#a855f7"):(r=this.t("paused")||"Paused",i="#facc15"),t&&(t.textContent=r),A&&(A.textContent=r),n&&(n.style.backgroundColor=i,n.style.boxShadow="paused"===e?"none":"0 0 8px ".concat(i))}}},{key:"addMobileMessage",value:function(e,t){this.voiceInterface.messages.push({type:e,text:t});var A=document.getElementById("mobileMessagesContainer");if(A){var n=document.createElement("div");n.className="mobile-message-bubble ".concat(e),n.textContent=t,A.appendChild(n),A.scrollTop=A.scrollHeight}}},{key:"startWaveformAnimation",value:function(){this.waveformInterval&&clearInterval(this.waveformInterval);var e=document.getElementById("mobileWaveform");e&&(this.waveformInterval=setInterval(function(){e.querySelectorAll(".mobile-waveform-bar").forEach(function(e,t){var A=60*Math.random()+10;e.style.height="".concat(A,"px")})},100))}},{key:"stopWaveformAnimation",value:function(){this.waveformInterval&&(clearInterval(this.waveformInterval),this.waveformInterval=null);var e=document.getElementById("mobileWaveform");e&&e.querySelectorAll(".mobile-waveform-bar").forEach(function(e){e.style.height="10px"})}},{key:"cleanup",value:function(){this.stopWaveformAnimation(),this.collapseMobileTranscript(),this.removeMobileMinimizedBar(),this.voiceInterface.messages=[]}}])&&jn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Wn(e){return Wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wn(e)}function zn(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Xn(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Xn(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Xn(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Xn(u,"constructor",c),Xn(c,"constructor",s),s.displayName="GeneratorFunction",Xn(c,o,"GeneratorFunction"),Xn(u),Xn(u,o,"Generator"),Xn(u,n,function(){return this}),Xn(u,"toString",function(){return"[object Generator]"}),(zn=function(){return{w:r,m:d}})()}function Xn(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Xn=function(e,t,A,n){function r(t,A){Xn(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},Xn(e,t,A,n)}function Jn(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function Yn(e){return function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){Jn(r,n,o,i,a,"next",e)}function a(e){Jn(r,n,o,i,a,"throw",e)}i(void 0)})}}function qn(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Zn(n.key),n)}}function Zn(e){var t=function(e){if("object"!=Wn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Wn(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Wn(t)?t:t+""}var $n=function(){return e=function e(t){var A;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=t,this.audioStream=null,this.callStartTime=null,this.callTimerInterval=null,this.sdk=null,this.isActive=!1,this.isShowingDomainError=!1,this.shadowRoot=t.shadowRoot||document,this.textSDK=t.textSDK||null,this.deviceInfo=An(),this.isMobile=this.deviceInfo.isMobile,this.conversationExpanded=!1,this.isMicMuted=!1,this.isSpeakerMuted=!1;var n=t.visualAssistant||(null===(A=t.agentSettingsOverride)||void 0===A?void 0:A.visualAssistant);this.sdk=new fr({agentId:t.agentId,appId:t.appId,signedUrl:t.signedUrl,agentSettingsOverride:t.agentSettingsOverride,visualAssistant:n,variables:t.variables||{},language:t.language||"en",outputContainer:t.outputContainer,outputEncoding:t.outputEncoding,outputSampleRate:t.outputSampleRate,outputChannels:t.outputChannels,outputBitDepth:t.outputBitDepth,onConversationStart:t.onConversationStart,onConversationEnd:t.onConversationEnd,onBargeIn:t.onBargeIn,onAudioStartPlaying:t.onAudioStartPlaying,onAudioStoppedPlaying:t.onAudioStoppedPlaying,onSubtitleDisplay:t.onSubtitleDisplay}),this.templates=new wn(this),this.styles=new xn(this),this.transcript=new kn(this),this.textHandlers=new Hn(this),this.handlers=new Kn(this),this.desktop=new _n(this),this.mobile=new Gn(this),this.setupSDKEventHandlers(),this.checkAndHandleResume()},t=[{key:"getVoiceSDK",value:function(){var e;return(null===(e=this.sdk)||void 0===e?void 0:e.voiceSDK)||null}},{key:"checkAndHandleResume",value:function(){if(void 0!==this._resumeInfo)return console.log("🔄 [VOICE INTERFACE] Returning cached resume info:",this._resumeInfo),this._resumeInfo;var e=this.sdk.checkResumeBeforeConnect();return this._resumeInfo=e,e?(console.log("🔄 [WIDGET] Auto-resuming call:",e),console.log(" From:",e.fromPage,"→ To:",e.toPage),this.config.onResume&&this.config.onResume(e),e):null}},{key:"setupSDKEventHandlers",value:function(){var e=this;this.sdk.onTranscript=function(t){console.log("📝 [VOICE INTERFACE] onTranscript called with text:",t),e.updateTranscript(t)},this.sdk.onPlaybackStarted=function(){console.log("🔊 [VOICE INTERFACE] Playback started - updating status to listening"),e.isMobile?e.updateMobileStatus("listening"):e.updateDesktopStatus()},this.sdk.onAgentSpeaking=function(t){var A=e.shadowRoot.getElementById("voiceAvatarActive");A&&(t?(A.classList.add("speaking"),e.isMobile?(e.updateMobileStatus("speaking"),e.startWaveformAnimation()):(e.updateDesktopStatus(),e.startDesktopWaveformAnimation())):(A.classList.remove("speaking"),e.isMobile?(e.updateMobileStatus("listening"),e.startWaveformAnimation()):(e.updateDesktopStatus(),e.startDesktopWaveformAnimation())))},this.sdk.onDisconnected=function(){var t=Yn(zn().m(function t(A){return zn().w(function(t){for(;;)switch(t.n){case 0:if(console.log("🔌 WebSocket disconnected, hanging up call..."),!A||!(1008===A.code&&A.reason&&(A.reason.includes("Domain not whitelisted")||A.reason.includes("domain")||A.reason.includes("whitelist"))||1008===A.code&&A.reason&&A.reason.includes("localhost"))){t.n=2;break}return console.error("❌ Domain not whitelisted - WebSocket closed:",A.code,A.reason),t.n=1,e.endCallOnServerRejection();case 1:t.n=3;break;case 2:e.isActive&&(e.isActive=!1,e.endVoiceCall());case 3:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}(),this.sdk.onError=function(){var t=Yn(zn().m(function t(A){return zn().w(function(t){for(;;)switch(t.n){case 0:if(!A||!("DOMAIN_NOT_WHITELISTED"===A.message||A.message&&A.message.includes("Domain not whitelisted"))){t.n=2;break}return console.error("❌ Voice SDK Error: Domain not whitelisted:",A),t.n=1,e.endCallOnServerRejection();case 1:return t.a(2);case 2:if(!A.isServerRejection&&"ServerRejected"!==A.name){t.n=3;break}return t.a(2);case 3:console.error("❌ Voice SDK Error:",A),e.showError(A.message||A);case 4:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}()}},{key:"setupTextInjectAckHandler",value:function(){return this.textHandlers.setupTextInjectAckHandler()}},{key:"handleTextInjectAck",value:function(e){return this.textHandlers.handleTextInjectAck(e)}},{key:"sendDesktopTextMessage",value:function(){return this.textHandlers.sendDesktopTextMessage()}},{key:"sendMobileTextMessage",value:function(){return this.textHandlers.sendMobileTextMessage()}},{key:"t",value:function(e){var t,A,n=this.config.language||"en";return((null===(t=this.config.translations)||void 0===t?void 0:t[n])||(null===(A=this.config.translations)||void 0===A?void 0:A.en)||{})[e]||e}},{key:"getText",value:function(e,t){return void 0!==this.config[e]&&null!==this.config[e]?this.config[e]:this.t(t)}},{key:"getTooltip",value:function(e){var t,A=null===(t=this.config.tooltips)||void 0===t?void 0:t[e];return null!=A?A:{mute:this.t("mute"),speaker:this.t("speaker"),endCall:this.t("endCall")}[e]||""}},{key:"_updateTimerElements",value:function(e,t){var A=this.shadowRoot.getElementById("voiceTimer");A&&(A.textContent=e);var n=this.shadowRoot.getElementById("desktopTimerText"),o=this.shadowRoot.getElementById("compactTimerText");if(n&&(n.textContent=e),o&&(o.textContent=e),!o&&!n&&t<2e3){console.warn("⚠️ Timer elements not found - compactTimerText:",!!o,"desktopTimerText:",!!n,"elapsed:",t);var r=this.shadowRoot.querySelectorAll('[id*="Timer"], [id*="timer"]');console.log("Found timer-like elements:",Array.from(r).map(function(e){return e.id}))}if(this.isMobile){var i=document.getElementById("mobileDurationText"),a=document.getElementById("mobileHeaderDuration");i&&(i.textContent=e),a&&(a.textContent=e)}}},{key:"generateHTML",value:function(){return this.templates.generateHTML()}},{key:"generateMobileHTML",value:function(){return this.templates.generateMobileHTML()}},{key:"generateCSS",value:function(){return this.styles.generateCSS()}},{key:"setupEventHandlers",value:function(e){this.handlers.setupEventHandlers(e)}},{key:"setupMobileEventHandlers",value:function(){return this.handlers.setupMobileEventHandlers()}},{key:"adjustSizesForContainer",value:function(){return this.desktop.adjustSizesForContainer()}},{key:"startDesktopWaveformAnimation",value:function(){return this.desktop.startDesktopWaveformAnimation()}},{key:"stopDesktopWaveformAnimation",value:function(){return this.desktop.stopDesktopWaveformAnimation()}},{key:"updateDesktopStatus",value:function(){return this.desktop.updateDesktopStatus()}},{key:"updateLiveWaveform",value:function(e){return this.desktop.updateLiveWaveform(e)}},{key:"showError",value:function(e){return this.desktop.showError(e)}},{key:"showDomainError",value:function(){return this.desktop.showDomainError()}},{key:"startVoiceCall",value:(o=Yn(zn().m(function e(){var t,A=this;return zn().w(function(e){for(;;)switch(e.n){case 0:if(!this.isActive){e.n=1;break}return console.log("⚠️ Voice call already active"),e.a(2);case 1:return console.log("🎤 Starting voice call..."),e.n=2,nn();case 2:if(t=e.v,console.log("📋 Current permission state: ".concat(t)),"denied"!==t){e.n=3;break}throw console.log("🚫 Permission is denied, showing blocked modal..."),this.resetConnectingState(),An(),gn(function(){console.log("Blocked modal closed")}),new Error("Microphone permission denied");case 3:if("prompt"!==t&&"unknown"!==t){e.n=4;break}return console.log("📋 Permission is in prompt state, showing pre-prompt modal..."),e.a(2,new Promise(function(e,t){hn(Yn(zn().m(function n(){var o;return zn().w(function(n){for(;;)switch(n.p=n.n){case 0:return console.log("✅ Pre-prompt accepted, proceeding with voice call..."),n.p=1,n.n=2,A.proceedWithVoiceCall();case 2:e(),n.n=4;break;case 3:n.p=3,o=n.v,t(o);case 4:return n.a(2)}},n,null,[[1,3]])})),function(){console.log("❌ Pre-prompt cancelled"),A.resetConnectingState(),t(new Error("Call cancelled by user"))})}));case 4:return e.n=5,this.proceedWithVoiceCall();case 5:return e.a(2)}},e,this)})),function(){return o.apply(this,arguments)})},{key:"proceedWithVoiceCall",value:(n=Yn(zn().m(function e(){var t,A,n,o,r,i,a,s,c,l,u,d,p,h,g,f,m,v,B,w,y,b,C,x,Q,F,U,S,k,E,I,T,H,D,P,O,K,M,L,R,_,V,j,N,G,W=this;return zn().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,null!==this._resumeInfo&&void 0!==this._resumeInfo?console.log("🔄 Resume call detected - preserving conversation history"):(console.log("🆕 New call detected - clearing conversation history"),this.transcript.clearConversationMessages(),this.conversationExpanded=!1,t=this.shadowRoot.getElementById("desktopConversationPanel"),A=this.shadowRoot.getElementById("conversationHeader"),n=this.shadowRoot.getElementById("conversationToggleText"),o=this.shadowRoot.querySelector(".voice-interface"),r=this.shadowRoot.getElementById("desktopVoiceSection"),i=this.shadowRoot.getElementById("compactVoiceSection"),t&&(t.classList.remove("expanded"),t.classList.add("collapsed")),A&&A.classList.remove("expanded"),n&&(n.textContent="Show history"),o&&o.classList.remove("expanded"),r&&(r.style.display=""),i&&(i.style.display="none")),!this.isMobile){e.n=5;break}return(a=this.shadowRoot.getElementById("voiceIdleState"))&&(a.style.display="none"),(s=this.shadowRoot.getElementById("text-chat-panel"))?(s.classList.remove("open"),s.style.display="none",console.log("✅ Widget panel hidden (waiting for permission)")):(c=document.getElementById("text-chat-panel"))&&(c.classList.remove("open"),c.style.display="none",console.log("✅ Widget panel hidden (waiting for permission, fallback)")),console.log("📱 Mobile device - requesting mic permission before connecting..."),e.p=1,l=this.config.outputSampleRate||44100,e.n=2,navigator.mediaDevices.getUserMedia({audio:{sampleRate:l,channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});case 2:e.v.getTracks().forEach(function(e){return e.stop()}),console.log("✅ Mobile: Microphone permission granted - proceeding with connection"),(u=this.shadowRoot.getElementById("text-chat-button"))?(u.style.display="none",console.log("✅ Floating button hidden (permission granted)")):(d=document.getElementById("text-chat-button"))&&(d.style.display="none",console.log("✅ Floating button hidden (permission granted, fallback)")),e.n=4;break;case 3:return e.p=3,_=e.v,console.error("❌ Mobile: Permission denied before connecting:",_),this.resetConnectingState(),document.getElementById("mobile-voice-call-bar-container")&&this.removeMobileMinimizedBar(),(p=this.shadowRoot.getElementById("text-chat-button"))?p.style.display="":(h=document.getElementById("text-chat-button"))&&(h.style.display=""),(g=this.shadowRoot.getElementById("voiceIdleState"))&&(g.style.display="flex"),(f=this.shadowRoot.getElementById("text-chat-panel"))?f.style.display="":(m=document.getElementById("text-chat-panel"))&&(m.style.display=""),An(),gn(function(){W.resetUIState()}),e.a(2);case 4:e.n=6;break;case 5:this.resetConnectingState(),v=this.shadowRoot.getElementById("voiceIdleState"),B=this.shadowRoot.getElementById("voiceActiveState"),v&&(v.style.display="none"),B&&(B.style.display="flex");case 6:if(w=this.shadowRoot.getElementById("voiceInterface"),setTimeout(function(){return W.adjustSizesForContainer()},50),w&&(w.scrollTop=0),y=this.config.signedUrl||(this.config.agentId&&this.config.appId?"wss://speech.talktopc.com/ws/conv?agentId=".concat(this.config.agentId,"&appId=").concat(this.config.appId):null)){e.n=7;break}throw new Error("signedUrl or agentId+appId required for voice calls");case 7:if(console.log("🔗 Got signed URL:",y),!this.sdk||!this.sdk.isConnected){e.n=11;break}return console.log("🔄 SDK already connected, disconnecting for clean retry..."),e.p=8,this.sdk.disconnect(),e.n=9,new Promise(function(e){return setTimeout(e,100)});case 9:e.n=11;break;case 10:e.p=10,V=e.v,console.warn("Warning: Error disconnecting existing connection:",V);case 11:return e.n=12,this.sdk.connect(y);case 12:b=e.v,console.log("✅ Connected to WebSocket, connected:",b),this.setupTextInjectAckHandler(),C=!1,x=this.sdk.onError,Q=this.sdk.onDisconnected,this.sdk.onError=function(e){e&&("DOMAIN_NOT_WHITELISTED"===e.message||e.message&&e.message.includes("Domain not whitelisted"))&&(C=!0,console.log("🚫 Server rejected connection before starting audio capture")),x&&x.call(W.sdk,e)},this.sdk.onDisconnected=function(e){e&&1008===e.code&&e.reason&&(e.reason.includes("Domain not whitelisted")||e.reason.includes("domain")||e.reason.includes("whitelist"))&&(C=!0,console.log("🚫 Server disconnected due to domain error before starting audio capture")),Q&&Q.call(W.sdk,e)},F=0;case 13:if(!(F<50)){e.n=17;break}if(!C){e.n=14;break}throw console.log("🚫 Server rejected connection, aborting audio capture"),new Error("DOMAIN_NOT_WHITELISTED");case 14:if(!this.sdk.isConnected){e.n=15;break}if(!(this.sdk.voiceSDK&&this.sdk.voiceSDK.isConnected&&this.sdk.voiceSDK.websocket&&this.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN)){e.n=15;break}return e.a(3,17);case 15:return e.n=16,new Promise(function(e){return setTimeout(e,100)});case 16:F++,e.n=13;break;case 17:if(!C){e.n=18;break}throw this.sdk.onError=x,this.sdk.onDisconnected=Q,console.log("🚫 Server rejected connection, aborting audio capture"),new Error("DOMAIN_NOT_WHITELISTED");case 18:if(this.sdk.isConnected&&this.sdk.voiceSDK&&this.sdk.voiceSDK.isConnected&&this.sdk.voiceSDK.websocket&&this.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN){e.n=19;break}throw this.sdk.onError=x,this.sdk.onDisconnected=Q,console.warn("⚠️ Connection lost before starting audio capture"),new Error("Connection lost before starting audio capture");case 19:if(this.sdk.onError=x,this.sdk.onDisconnected=Q,!(this.sdk.isConnected&&this.sdk.voiceSDK&&this.sdk.voiceSDK.websocket&&this.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN)){e.n=30;break}return console.log("✅ WebSocket ready, starting listening..."),e.p=20,e.n=21,this.sdk.startListening();case 21:if(this.sdk.isConnected&&this.sdk.voiceSDK&&this.sdk.voiceSDK.isConnected&&this.sdk.voiceSDK.websocket&&this.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN){e.n=26;break}if(null===(U=this.sdk.voiceSDK)||void 0===U||!U.isRecording){e.n=25;break}return e.p=22,e.n=23,this.sdk.voiceSDK.stopRecording();case 23:e.n=25;break;case 24:e.p=24,e.v;case 25:throw(S=new Error("Connection lost - server may have rejected the call")).name="ServerRejected",S.isServerRejection=!0,S;case 26:console.log("🎤 Started listening - permission granted"),this.isActive=!0,this.isMobile?(document.getElementById("mobile-voice-call-bar-container")?console.log("📱 Mobile device - bar already exists, updating status"):(console.log("📱 Mobile device - permission granted, creating minimized bar"),this.createMobileMinimizedBar()),0===this.messages.length&&this.messages.push({type:"assistant",text:this.t("transcriptWillAppear")}),this.startWaveformAnimation()):(this.startDesktopWaveformAnimation(),this.desktop.startLiveWaveformInterval()),e.n=29;break;case 27:if(e.p=27,!(j=e.v).isServerRejection&&"ServerRejected"!==j.name){e.n=28;break}throw this.resetConnectingState(),j;case 28:throw console.error("❌ Failed to start listening - permission denied or error:",j),this.resetConnectingState(),this.isMobile&&(document.getElementById("mobile-voice-call-bar-container")&&this.removeMobileMinimizedBar(),(k=this.shadowRoot.getElementById("voiceIdleState"))&&(k.style.display="flex"),(E=this.shadowRoot.getElementById("text-chat-panel"))?E.style.display="":(I=document.getElementById("text-chat-panel"))&&(I.style.display=""),(T=this.shadowRoot.getElementById("text-chat-button"))?T.style.display="":(H=document.getElementById("text-chat-button"))&&(H.style.display="")),j;case 29:this.callStartTime=Date.now(),console.log("⏱️ Starting call timer at",new Date(this.callStartTime).toISOString()),D=function(){if(W.callStartTime){var e=Date.now()-W.callStartTime,t=Math.floor(e/6e4),A=Math.floor(e%6e4/1e3),n="".concat(t.toString().padStart(2,"0"),":").concat(A.toString().padStart(2,"0"));W._updateTimerElements(n,e)}else console.warn("⚠️ Timer update called but callStartTime is not set")},setTimeout(function(){console.log("⏱️ Starting timer interval"),D(),W.callTimerInterval=setInterval(D,1e3)},100),e.n=38;break;case 30:if(!C){e.n=31;break}throw console.log("🚫 Server rejected connection, aborting audio capture"),new Error("DOMAIN_NOT_WHITELISTED");case 31:if(this.sdk.isConnected&&this.sdk.voiceSDK&&this.sdk.voiceSDK.isConnected&&this.sdk.voiceSDK.websocket&&this.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN){e.n=32;break}throw console.warn("⚠️ Connection not valid, aborting audio capture"),new Error("Connection lost before starting audio capture");case 32:return console.warn("⚠️ Connection not fully ready, but trying to start listening anyway..."),e.p=33,e.n=34,this.sdk.startListening();case 34:console.log("🎤 Started listening - permission granted"),this.isActive=!0,this.isMobile?(document.getElementById("mobile-voice-call-bar-container")?console.log("📱 Mobile device - bar already exists, updating status"):(console.log("📱 Mobile device - permission granted, creating minimized bar"),this.createMobileMinimizedBar()),0===this.messages.length&&this.messages.push({type:"assistant",text:this.t("transcriptWillAppear")}),this.startWaveformAnimation()):(this.startDesktopWaveformAnimation(),this.desktop.startLiveWaveformInterval()),e.n=37;break;case 35:if(e.p=35,!(N=e.v).isServerRejection&&"ServerRejected"!==N.name){e.n=36;break}throw this.resetConnectingState(),N;case 36:throw console.error("❌ Failed to start listening - permission denied or error:",N),this.resetConnectingState(),this.isMobile&&(document.getElementById("mobile-voice-call-bar-container")&&this.removeMobileMinimizedBar(),(P=this.shadowRoot.getElementById("voiceIdleState"))&&(P.style.display="flex"),(O=this.shadowRoot.getElementById("text-chat-panel"))?O.style.display="":(K=document.getElementById("text-chat-panel"))&&(K.style.display=""),(M=this.shadowRoot.getElementById("text-chat-button"))?M.style.display="":(L=document.getElementById("text-chat-button"))&&(L.style.display="")),N;case 37:this.callStartTime=Date.now(),console.log("⏱️ Starting call timer at",new Date(this.callStartTime).toISOString()),R=function(){if(W.callStartTime){var e=Date.now()-W.callStartTime,t=Math.floor(e/6e4),A=Math.floor(e%6e4/1e3),n="".concat(t.toString().padStart(2,"0"),":").concat(A.toString().padStart(2,"0"));W._updateTimerElements(n,e)}else console.warn("⚠️ Timer update called but callStartTime is not set")},setTimeout(function(){console.log("⏱️ Starting timer interval"),R(),W.callTimerInterval=setInterval(R,1e3)},100);case 38:console.log("✅ Voice call started successfully"),e.n=44;break;case 39:if(e.p=39,(G=e.v).isServerRejection||"ServerRejected"===G.name||console.error("❌ Error starting voice call:",G),this.resetConnectingState(),this.isActive=!1,this.callTimerInterval&&(clearInterval(this.callTimerInterval),this.callTimerInterval=null),this.sdk&&this.sdk.isConnected)try{this.sdk.disconnect()}catch(e){console.warn("Error disconnecting SDK on error:",e)}if("NotAllowedError"!==G.name&&"PermissionDeniedError"!==G.name){e.n=40;break}An(),gn(function(){W.resetUIState()}),e.n=44;break;case 40:if("NotFoundError"!==G.name&&"DevicesNotFoundError"!==G.name){e.n=41;break}fn(function(){W.resetUIState()}),e.n=44;break;case 41:if(!G||!("DOMAIN_NOT_WHITELISTED"===G.message||G.message&&G.message.includes("Domain not whitelisted"))){e.n=43;break}return e.n=42,this.endCallOnServerRejection();case 42:e.n=44;break;case 43:this.showError(G.message||G),this.resetUIState();case 44:return e.a(2)}},e,this,[[33,35],[22,24],[20,27],[8,10],[1,3],[0,39]])})),function(){return n.apply(this,arguments)})},{key:"resetUIState",value:function(){if(this.resetConnectingState(),this.isMobile){this.removeMobileMinimizedBar(),this.stopWaveformAnimation(),this.messages=[];var e=this.shadowRoot.getElementById("text-chat-panel");if(e)e.style.display="";else{var t=document.getElementById("text-chat-panel");t&&(t.style.display="")}}var A=this.shadowRoot.getElementById("voiceIdleState"),n=this.shadowRoot.getElementById("voiceActiveState");A&&(A.style.display="flex"),n&&(n.style.display="none")}},{key:"endCallOnServerRejection",value:(A=Yn(zn().m(function e(){var t,A,n,o,r,i,a,s,c,l,u,d,p,h,g,f,m;return zn().w(function(e){for(;;)switch(e.p=e.n){case 0:if(console.log("🚫 Server rejected call - ending call and stopping audio capture/VAD..."),console.log("🚫 Calling endCallOnServerRejection() - will show domain error message"),t=this.shadowRoot.getElementById("voiceInterface"),A=this.shadowRoot.getElementById("landingScreen"),t&&(t.classList.add("active"),console.log("✅ Made voice interface visible")),A&&(A.classList.remove("active"),console.log("✅ Hid landing screen")),this.config.onShowVoice&&"function"==typeof this.config.onShowVoice&&(console.log("🚫 Calling onShowVoice callback to ensure voice interface is visible..."),this.config.onShowVoice()),!this.sdk){e.n=22;break}if(e.p=1,r=null===(n=this.sdk.voiceSDK)||void 0===n?void 0:n.audioRecorder,!(this.sdk.isListening||(null===(o=this.sdk.voiceSDK)||void 0===o?void 0:o.isRecording)||r&&r.isRecording||r&&null!==r.audioWorkletNode||r)){e.n=19;break}if(console.log("🛑 Stopping audio capture/VAD..."),null==r||!r.audioWorkletNode){e.n=5;break}return console.log("🛑 Sending stop message to AudioWorklet to stop VAD..."),e.p=2,r.audioWorkletNode.port.postMessage({type:"stop"}),e.n=3,new Promise(function(e){return setTimeout(e,150)});case 3:e.n=5;break;case 4:e.p=4,p=e.v,console.warn("Error sending stop message to AudioWorklet:",p);case 5:if(!this.sdk.voiceSDK||"function"!=typeof this.sdk.voiceSDK.stopRecording){e.n=10;break}return e.p=6,e.n=7,this.sdk.voiceSDK.stopRecording();case 7:console.log("✅ stopRecording() completed"),e.n=9;break;case 8:e.p=8,h=e.v,console.warn("Error calling stopRecording:",h);case 9:e.n=14;break;case 10:if(!this.sdk.stopListening){e.n=14;break}return e.p=11,this.sdk.stopListening(),e.n=12,new Promise(function(e){return setTimeout(e,200)});case 12:e.n=14;break;case 13:e.p=13,g=e.v,console.warn("Error calling stopListening:",g);case 14:if(!r||"function"!=typeof r.stop){e.n=18;break}return e.p=15,e.n=16,r.stop();case 16:console.log("✅ AudioRecorder.stop() completed"),e.n=18;break;case 17:e.p=17,f=e.v,console.warn("Error calling AudioRecorder.stop():",f);case 18:console.log("✅ Audio capture/VAD stopped");case 19:null!=r&&r.mediaStream&&(console.log("🛑 Force stopping media stream tracks (backup cleanup)..."),r.mediaStream.getTracks().forEach(function(e){"ended"!==e.readyState&&(e.stop(),console.log("✅ Force stopped track:",e.kind))})),this.audioStream&&(console.log("🛑 Stopping stored audio stream..."),this.audioStream.getTracks().forEach(function(e){"ended"!==e.readyState&&e.stop()}),this.audioStream=null),this.sdk.hangup(),e.n=21;break;case 20:e.p=20,m=e.v,console.warn("Error stopping listening on server rejection:",m);try{null!==(i=this.sdk.voiceSDK)&&void 0!==i&&null!==(i=i.audioRecorder)&&void 0!==i&&i.mediaStream&&this.sdk.voiceSDK.audioRecorder.mediaStream.getTracks().forEach(function(e){return e.stop()}),this.audioStream&&(this.audioStream.getTracks().forEach(function(e){return e.stop()}),this.audioStream=null)}catch(e){console.warn("Error force-stopping media streams:",e)}case 21:if(this.sdk.isConnected)try{this.sdk.disconnect()}catch(e){console.warn("Error disconnecting SDK on server rejection:",e)}case 22:this.isActive=!1,this.config.onCallEnd&&this.config.onCallEnd,this.callTimerInterval&&(clearInterval(this.callTimerInterval),this.callTimerInterval=null),a=this.shadowRoot.getElementById("voiceActiveState"),s=this.shadowRoot.getElementById("voiceIdleState"),a&&(a.style.display="none"),s&&(s.style.display="flex",this.isShowingDomainError=!0,console.log("🚫 Setting isShowingDomainError flag to true"),console.log("🚫 Calling showDomainError() to display domain error in widget..."),this.showDomainError(),console.log("🚫 showDomainError() completed, isShowingDomainError:",this.isShowingDomainError)),this.isMobile&&((c=this.shadowRoot.getElementById("text-chat-panel"))?c.style.display="":(l=document.getElementById("text-chat-panel"))&&(l.style.display=""),(u=this.shadowRoot.getElementById("text-chat-button"))?u.style.display="":(d=document.getElementById("text-chat-button"))&&(d.style.display=""),this.removeMobileMinimizedBar(),this.stopWaveformAnimation());case 23:return e.a(2)}},e,this,[[15,17],[11,13],[6,8],[2,4],[1,20]])})),function(){return A.apply(this,arguments)})},{key:"endVoiceCall",value:function(){var e,t=this;if(console.log("🔴 Ending voice call..."),this._resumeInfo=null,this.sdk&&this.isActive&&(this.sdk.stopListening(),this.sdk.hangup(),this.isActive=!1),this.audioStream&&(this.audioStream.getTracks().forEach(function(e){return e.stop()}),this.audioStream=null),this.callTimerInterval&&(clearInterval(this.callTimerInterval),this.callTimerInterval=null),this._textInjectTimeout&&(clearTimeout(this._textInjectTimeout),this._textInjectTimeout=null),this._statusClearTimeout&&(clearTimeout(this._statusClearTimeout),this._statusClearTimeout=null),this._mobileTextInjectTimeout&&(clearTimeout(this._mobileTextInjectTimeout),this._mobileTextInjectTimeout=null),this._mobileStatusClearTimeout&&(clearTimeout(this._mobileStatusClearTimeout),this._mobileStatusClearTimeout=null),null!==(e=this.sdk)&&void 0!==e&&e.voiceSDK&&this.textHandlers._textInjectAckHandler&&(this.sdk.voiceSDK.off("textInjectAck",this.textHandlers._textInjectAckHandler),this.textHandlers._textInjectAckHandler=null),this._originalHintText=null,this._originalMobileHintText=null,this.isMobile||(this.stopDesktopWaveformAnimation(),this.desktop.stopLiveWaveformInterval(),this.transcript.clearConversationMessages(),this.conversationExpanded=!1),this.isMobile){this.stopWaveformAnimation(),this.collapseMobileTranscript(),this.removeMobileMinimizedBar(),this.messages=[];var A=this.shadowRoot.getElementById("text-chat-panel");if(A)A.style.display="";else{var n=document.getElementById("text-chat-panel");n&&(n.style.display="")}}var o=this.shadowRoot.getElementById("text-chat-button");if(o)o.style.display="",console.log("✅ Floating button restored (call ended)");else{var r=document.getElementById("text-chat-button");r&&(r.style.display="",console.log("✅ Floating button restored (call ended, fallback)"))}var i=this.shadowRoot.getElementById("voiceActiveState");if(i&&(i.style.display="none"),"function"==typeof this.config.onVoiceCallButtonClick)try{this.config.onVoiceCallButtonClick({timestamp:Date.now(),widgetState:"end"})}catch(e){console.error("Error in onVoiceCallButtonClick callback:",e)}if(this.config.onCallEnd)this.config.onCallEnd();else{var a=this.shadowRoot.getElementById("voiceIdleState");a&&(a.style.display="flex"),setTimeout(function(){return t.adjustSizesForContainer()},50)}var s=this.shadowRoot.getElementById("transcriptText");if(s&&(s.textContent=this.t("transcriptWillAppear"),s.classList.add("empty")),this.isMobile){var c=document.getElementById("mobileTranscriptText");c&&(c.textContent=this.t("transcriptWillAppear"))}var l=this.shadowRoot.getElementById("voiceAvatarActive");l&&l.classList.remove("speaking"),console.log("✅ Voice call ended")}},{key:"showConnectingState",value:function(){if(this.isMobile)console.log("📱 Mobile device - skipping showConnectingState() (minimized bar handles connecting state)");else{var e=this.shadowRoot.getElementById("voiceIdleState"),t=this.shadowRoot.getElementById("voiceActiveState");if(e){var A=e.querySelector(".voice-status-title"),n=e.querySelector(".voice-status-subtitle"),o=e.querySelector("#startCallBtn");if(A&&(A.textContent=this.t("connecting")),n&&(n.textContent=this.t("connectingSubtitle")),o){o.disabled=!0,o.style.opacity="0.6",o.style.cursor="not-allowed";var r=o.querySelector("span");if(r){var i=document.createElement("span");i.className="connecting-spinner",r.textContent="",r.appendChild(i),r.appendChild(document.createTextNode(" "+this.t("connecting")))}}e.style.display="flex"}t&&(t.style.display="none")}}},{key:"resetConnectingState",value:function(){if(this.isShowingDomainError)console.log("🚫 resetConnectingState() called but domain error is displayed - skipping reset");else{var e=this.shadowRoot.getElementById("voiceIdleState");if(e){var t=e.querySelector("#domainErrorBackBtn");t&&t.parentNode&&t.parentNode.removeChild(t);var A=e.querySelector(".voice-status-title"),n=e.querySelector(".voice-status-subtitle"),o=e.querySelector("#startCallBtn");if(A&&(A.textContent=this.getText("startCallTitle","clickToStartCall"),A.style.color="",A.style.fontSize="",A.style.fontWeight="",A.style.marginLeft="",A.style.marginRight="",A.style.textAlign=""),n&&(n.textContent=this.getText("startCallSubtitle","realTimeVoice"),n.style.color="",n.style.fontSize="",n.style.marginLeft="",n.style.marginRight="",n.style.marginTop="",n.style.textAlign="",n.style.lineHeight=""),o){o.disabled=!1,o.style.opacity="",o.style.cursor="",o.style.display="";var r=o.querySelector("span");r&&(r.textContent=this.getText("startCallButtonText","startCall"))}}}}},{key:"updateTranscript",value:function(e){return this.transcript.updateTranscript(e)}},{key:"toggleConversationPanel",value:function(){return this.transcript.toggleConversationPanel()}},{key:"addConversationMessage",value:function(e,t){return this.transcript.addConversationMessage(e,t)}},{key:"renderConversationMessages",value:function(){return this.transcript.renderConversationMessages()}},{key:"escapeHtml",value:function(e){var t=document.createElement("div");return t.textContent=e,t.innerHTML}},{key:"toggleMute",value:function(){if(this.sdk&&this.isActive){var e=null;if(this.sdk.voiceSDK&&this.sdk.voiceSDK.audioRecorder&&this.sdk.voiceSDK.audioRecorder.mediaStream&&(e=this.sdk.voiceSDK.audioRecorder.mediaStream.getAudioTracks()[0]),!e&&this.audioStream&&(e=this.audioStream.getAudioTracks()[0]),e){e.enabled=!e.enabled,this.isMicMuted=!e.enabled;var t=this.shadowRoot.getElementById("desktopMuteBtn"),A=this.shadowRoot.getElementById("desktopMuteBtnCompact");if(this.isMobile||this.updateDesktopStatus(),t){var n=t.querySelector(".desktop-mic-icon"),o=t.querySelector(".desktop-mic-off-icon");n&&o&&(e.enabled?(t.classList.remove("muted"),n.style.display="block",o.style.display="none"):(t.classList.add("muted"),n.style.display="none",o.style.display="block"))}if(A){var r=A.querySelector(".desktop-mic-icon"),i=A.querySelector(".desktop-mic-off-icon");r&&i&&(e.enabled?(A.classList.remove("muted"),r.style.display="block",i.style.display="none"):(A.classList.add("muted"),r.style.display="none",i.style.display="block"))}if(this.isMobile){var a=document.getElementById("mobileMuteBtn"),s=null==a?void 0:a.querySelector(".mobile-mic-icon"),c=null==a?void 0:a.querySelector(".mobile-mic-off-icon");a&&s&&c&&(e.enabled?(a.classList.remove("muted"),s.style.cssText="display: block !important; visibility: visible !important; opacity: 1 !important; width: 15px !important; height: 15px !important; margin: 0 !important; padding: 0 !important;",c.style.cssText="display: none !important; visibility: hidden !important; opacity: 0 !important;"):(a.classList.add("muted"),s.style.cssText="display: none !important; visibility: hidden !important; opacity: 0 !important;",c.style.cssText="display: block !important; visibility: visible !important; opacity: 1 !important; width: 15px !important; height: 15px !important; margin: 0 !important; padding: 0 !important;"))}console.log(e.enabled?"🔊 Unmuted":"🔇 Muted")}else console.warn("⚠️ No audio track available for mute toggle")}}},{key:"toggleSpeaker",value:function(){if(this.sdk&&this.isActive){if(this.isSpeakerMuted=!this.isSpeakerMuted,this.sdk.voiceSDK&&this.sdk.voiceSDK.audioPlayer?(this.sdk.voiceSDK.audioPlayer.setMuted(this.isSpeakerMuted),console.log("🔊 Speaker toggle:",this.isSpeakerMuted?"muted":"unmuted")):console.warn("⚠️ Cannot toggle speaker - audioPlayer not available"),!this.isMobile){var e=this.shadowRoot.getElementById("desktopSpeakerBtn"),t=this.shadowRoot.getElementById("desktopSpeakerBtnCompact");if(e){var A=e.querySelector(".desktop-speaker-icon"),n=e.querySelector(".desktop-speaker-off-icon");A&&n&&(this.isSpeakerMuted?(e.classList.add("muted"),A.style.display="none",n.style.display="block"):(e.classList.remove("muted"),A.style.display="block",n.style.display="none"))}if(t){var o=t.querySelector(".desktop-speaker-icon"),r=t.querySelector(".desktop-speaker-off-icon");o&&r&&(this.isSpeakerMuted?(t.classList.add("muted"),o.style.display="none",r.style.display="block"):(t.classList.remove("muted"),o.style.display="block",r.style.display="none"))}}if(this.isMobile){var i=document.getElementById("mobileSpeakerBtn"),a=null==i?void 0:i.querySelector(".mobile-speaker-icon"),s=null==i?void 0:i.querySelector(".mobile-speaker-off-icon");i&&a&&s&&(this.isSpeakerMuted?(i.classList.add("muted"),a.style.cssText="display: none !important; visibility: hidden !important; opacity: 0 !important;",s.style.cssText="display: block !important; visibility: visible !important; opacity: 1 !important; width: 15px !important; height: 15px !important; margin: 0 !important; padding: 0 !important;"):(i.classList.remove("muted"),a.style.cssText="display: block !important; visibility: visible !important; opacity: 1 !important; width: 15px !important; height: 15px !important; margin: 0 !important; padding: 0 !important;",s.style.cssText="display: none !important; visibility: hidden !important; opacity: 0 !important;"))}}}},{key:"updateMobileStatus",value:function(e){return this.mobile.updateMobileStatus(e)}},{key:"createMobileMinimizedBar",value:function(){return this.mobile.createMobileMinimizedBar()}},{key:"removeMobileMinimizedBar",value:function(){return this.mobile.removeMobileMinimizedBar()}},{key:"expandMobileTranscript",value:function(){return this.mobile.expandMobileTranscript()}},{key:"collapseMobileTranscript",value:function(){return this.mobile.collapseMobileTranscript()}},{key:"addMobileMessage",value:function(e,t){return this.mobile.addMobileMessage(e,t)}},{key:"startWaveformAnimation",value:function(){return this.mobile.startWaveformAnimation()}},{key:"stopWaveformAnimation",value:function(){return this.mobile.stopWaveformAnimation()}},{key:"destroy",value:function(){this.isActive&&this.endVoiceCall(),this.audioStream&&(this.audioStream.getTracks().forEach(function(e){return e.stop()}),this.audioStream=null),this.callTimerInterval&&(clearInterval(this.callTimerInterval),this.callTimerInterval=null),this.sdk&&(this.sdk.disconnect(),this.sdk=null)}}],t&&qn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,A,n,o}();function eo(e){return eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},eo(e)}function to(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Ao(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Ao(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Ao(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,Ao(u,"constructor",c),Ao(c,"constructor",s),s.displayName="GeneratorFunction",Ao(c,o,"GeneratorFunction"),Ao(u),Ao(u,o,"Generator"),Ao(u,n,function(){return this}),Ao(u,"toString",function(){return"[object Generator]"}),(to=function(){return{w:r,m:d}})()}function Ao(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Ao=function(e,t,A,n){function r(t,A){Ao(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},Ao(e,t,A,n)}function no(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function oo(e){return function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){no(r,n,o,i,a,"next",e)}function a(e){no(r,n,o,i,a,"throw",e)}i(void 0)})}}function ro(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,io(n.key),n)}}function io(e){var t=function(e){if("object"!=eo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=eo(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==eo(t)?t:t+""}var ao=function(){return e=function e(t,A){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=t,this.sdk=A,this.streamingEl=null,this.hasStartedStreaming=!1,this.isActive=!1,this.shadowRoot=t.shadowRoot||document,this.eventHandlers={autoResize:null,keydown:null},this.eventHandlersSetup=!1},t=[{key:"t",value:function(e){var t,A,n=this.config.language||"en";return((null===(t=this.config.translations)||void 0===t?void 0:t[n])||(null===(A=this.config.translations)||void 0===A?void 0:A.en)||{})[e]||e}},{key:"generateHTML",value:function(){var e,t,A,n,o,r,i,a,s,c=this.config.inputPlaceholder||(null===(e=this.config.panel)||void 0===e?void 0:e.inputPlaceholder)||this.t("typeMessage")||"Type your message...";return'<div class="text-interface" id="textInterface">\n <div class="messages-container" id="messagesContainer">\n <div class="empty-state">\n <div class="empty-state-icon">💬</div>\n <div class="empty-state-title">'.concat(this.t("hello"),'</div>\n <div class="empty-state-text">').concat(this.t("sendMessage"),'</div>\n </div>\n </div>\n <div class="input-container">\n <div class="input-wrapper" style="flex:1;">\n <textarea class="message-input" id="messageInput" placeholder="').concat(c,'" rows="1" dir="').concat(this.config.direction||"ltr",'"></textarea>\n </div>\n <button class="send-button" id="sendButton" aria-label="').concat(this.t("sendMessageAria"),'">').concat(this.config.sendButtonText||"➤","</button>\n ").concat(null!==(t=this.config.sendButtonHint)&&void 0!==t&&t.text||null!==(A=this.config.panel)&&void 0!==A&&null!==(A=A.sendButtonHint)&&void 0!==A&&A.text?'\n <div class="send-button-hint" style="color: '.concat((null===(n=this.config.sendButtonHint)||void 0===n?void 0:n.color)||(null===(o=this.config.panel)||void 0===o||null===(o=o.sendButtonHint)||void 0===o?void 0:o.color)||"#6B7280","; font-size: ").concat((null===(r=this.config.sendButtonHint)||void 0===r?void 0:r.fontSize)||(null===(i=this.config.panel)||void 0===i||null===(i=i.sendButtonHint)||void 0===i?void 0:i.fontSize)||"12px",'; text-align: center; margin-top: 4px;">\n ').concat((null===(a=this.config.sendButtonHint)||void 0===a?void 0:a.text)||(null===(s=this.config.panel)||void 0===s||null===(s=s.sendButtonHint)||void 0===s?void 0:s.text),"\n </div>\n "):"","\n </div>\n </div>")}},{key:"generateCSS",value:function(){var e,t,A,n,o,r,i,a,s,c,l,u,d,p=this.config.messages,h=(this.config.panel,this.config.animation,this.config.sendButtonColor||(null===(e=this.config.panel)||void 0===e?void 0:e.sendButtonColor)||"#7C3AED"),g=this.config.sendButtonHoverColor||(null===(t=this.config.panel)||void 0===t?void 0:t.sendButtonHoverColor)||"#6D28D9",f=this.config.sendButtonTextColor||(null===(A=this.config.panel)||void 0===A?void 0:A.sendButtonTextColor)||"#FFFFFF",m=(this.config.inputPlaceholder||null===(n=this.config.panel)||void 0===n||n.inputPlaceholder,this.config.inputBorderColor||(null===(o=this.config.panel)||void 0===o?void 0:o.inputBorderColor)||"#E5E7EB"),v=this.config.inputFocusColor||(null===(r=this.config.panel)||void 0===r?void 0:r.inputFocusColor)||"#7C3AED",B=this.config.inputBackgroundColor||(null===(i=this.config.panel)||void 0===i?void 0:i.inputBackgroundColor)||"#FFFFFF",w=this.config.inputTextColor||(null===(a=this.config.panel)||void 0===a?void 0:a.inputTextColor)||"#1F2937",y=this.config.inputFontSize||(null===(s=this.config.panel)||void 0===s?void 0:s.inputFontSize)||"14px",b=this.config.inputBorderRadius||(null===(c=this.config.panel)||void 0===c?void 0:c.inputBorderRadius)||20,C=this.config.inputPadding||(null===(l=this.config.panel)||void 0===l?void 0:l.inputPadding)||"6px 14px",x=!1===this.config.useShadowDOM?" !important":"";return"\n /* Messages container using new classes */\n #messagesContainer { \n flex: 1; \n overflow-y: auto; \n overflow-x: hidden; \n padding: 20px; \n background: #f8fafc; \n display: flex; \n flex-direction: column; \n gap: 16px; \n min-height: 0; \n }\n .empty-state { \n flex: 1; \n display: flex; \n flex-direction: column; \n align-items: center; \n justify-content: center; \n gap: 12px; \n color: #64748b; \n text-align: center; \n padding: 20px; \n }\n .empty-state-icon { font-size: 48px; opacity: 0.3; }\n .empty-state-title { font-size: 20px; font-weight: 700; color: #334155; }\n .empty-state-text { font-size: 13px; max-width: 280px; }\n\n .text-interface { \n display: none".concat(x,"; \n flex: 1; \n flex-direction: column; \n min-height: 0; \n overflow: hidden; \n }\n .text-interface.active { display: flex").concat(x,"; }\n \n .message { \n display: flex; \n gap: 8px; \n padding: 4px 0; \n max-width: 100%; \n align-items: center; \n }\n .message.edge-left { flex-direction: row; }\n .message.edge-right { flex-direction: row-reverse; }\n .message-bubble { \n padding: 12px; \n border-radius: ").concat(p.borderRadius,"px").concat(x,"; \n max-width: 80%; \n font-size: ").concat(p.fontSize,"; \n word-wrap: break-word; \n text-align: ").concat("rtl"===this.config.direction?"right":"left","; \n direction: ").concat(this.config.direction||"ltr",";\n }\n .message.user .message-bubble { \n background: ").concat(p.userBackgroundColor).concat(x,"; \n color: ").concat(p.userTextColor||p.textColor).concat(x,"; \n }\n .message.agent .message-bubble { \n background: ").concat(p.agentBackgroundColor).concat(x,"; \n color: ").concat(p.agentTextColor||p.textColor).concat(x,"; \n }\n .message.user { \n align-self: ").concat("rtl"===this.config.direction?"flex-start":"flex-end","; \n }\n .message.agent { \n align-self: ").concat("rtl"===this.config.direction?"flex-end":"flex-start","; \n }\n .message .message-bubble { \n text-align: ").concat("rtl"===this.config.direction?"right":"left"," !important; \n }\n ").concat("rtl"===this.config.direction?"\n .message-bubble {\n text-align: right !important;\n }\n ":"","\n .message-avatar { \n width: 20px; \n height: 20px; \n display: flex; \n align-items: center; \n justify-content: center; \n flex-shrink: 0; \n color: inherit; \n font-size: 18px; \n line-height: 1; \n background: transparent; \n border: none; \n }\n .message-avatar.user { background: transparent; }\n .message-avatar.agent { background: transparent; }\n \n .message.system {\n background: ").concat(p.systemBackgroundColor,";\n align-self: flex-start;\n }\n .message.error {\n background: ").concat(p.errorBackgroundColor,";\n align-self: flex-start;\n }\n \n .input-container {\n display: flex;\n gap: 8px;\n padding: 12px 16px;\n background: #FFFFFF;\n border-top: 1px solid #E5E7EB;\n align-items: center;\n flex-shrink: 0;\n flex-direction: ").concat("rtl"===this.config.direction?"row-reverse":"row",";\n }\n \n .input-wrapper {\n position: relative;\n display: flex;\n align-items: center;\n }\n \n .message-input {\n width: 100%;\n min-height: 32px;\n max-height: 120px;\n padding: ").concat(C,";\n border: 1px solid ").concat(m,";\n border-radius: ").concat(b,"px;\n font-size: ").concat(y,";\n font-family: inherit;\n line-height: 1.3;\n resize: none;\n overflow-y: auto;\n background: ").concat(B,";\n color: ").concat(w,";\n vertical-align: top;\n margin: 0;\n display: block;\n white-space: pre-wrap;\n word-wrap: break-word;\n text-align: ").concat("rtl"===this.config.direction?"right":"left",";\n direction: ").concat(this.config.direction||"ltr",";\n -webkit-appearance: none;\n appearance: none;\n box-sizing: border-box;\n }\n \n .message-input:focus {\n outline: none;\n border-color: ").concat(v,";\n background: ").concat("#FFFFFF"===B?"#FFFFFF":B,";\n box-shadow: 0 0 0 3px ").concat(v,"33;\n }\n \n .message-input::placeholder {\n color: #9CA3AF;\n text-align: ").concat("rtl"===this.config.direction?"right":"left",";\n }\n \n .send-button {\n width: 40px;\n height: 40px;\n border-radius: 50%;\n border: none;\n background: ").concat(h,";\n color: ").concat(f,";\n font-size: ").concat(this.config.sendButtonFontSize||(null===(u=this.config.panel)||void 0===u?void 0:u.sendButtonFontSize)||"18px",";\n font-weight: ").concat(this.config.sendButtonFontWeight||(null===(d=this.config.panel)||void 0===d?void 0:d.sendButtonFontWeight)||"500",";\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n transition: all 0.2s ease;\n box-shadow: 0 4px 12px rgba(124, 60, 237, 0.3);\n }\n \n .send-button:hover:not(:disabled) {\n background: ").concat(g,";\n transform: scale(1.05);\n box-shadow: 0 6px 16px rgba(124, 60, 237, 0.4);\n }\n \n .send-button-hint {\n width: 100%;\n text-align: center;\n margin-top: 4px;\n }\n \n .send-button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n \n .typing-indicator {\n display: inline-flex;\n gap: 4px;\n align-items: center;\n }\n \n .typing-dot {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: #64748b;\n animation: typingDot 1.4s ease-in-out infinite;\n }\n \n .typing-dot:nth-child(2) { animation-delay: 0.2s; }\n .typing-dot:nth-child(3) { animation-delay: 0.4s; }\n \n @keyframes typingDot {\n 0%, 60%, 100% { transform: translateY(0); opacity: 0.7; }\n 30% { transform: translateY(-8px); opacity: 1; }\n }\n \n .error-message {\n padding: 12px;\n background: ").concat(p.errorBackgroundColor,";\n border-radius: ").concat(p.borderRadius,"px;\n color: #991B1B;\n font-size: ").concat(p.fontSize,";\n margin: 8px 0;\n }\n \n @media (max-width: 768px) {\n #messagesContainer {\n padding: 12px;\n gap: 12px;\n }\n \n .message-bubble {\n max-width: 85%;\n font-size: 14px;\n padding: 10px;\n }\n \n .text-input-container {\n padding: 10px;\n gap: 8px;\n }\n \n #text-chat-input {\n font-size: 16px !important; /* Prevents iOS zoom on focus */\n padding: 10px 14px;\n min-height: 44px;\n }\n \n #text-chat-send {\n min-width: 56px;\n min-height: 44px;\n width: 56px;\n height: 44px;\n }\n \n .empty-state-icon {\n font-size: 40px;\n }\n \n .empty-state-title {\n font-size: 18px;\n }\n \n .empty-state-text {\n font-size: 12px;\n }\n }\n \n @media (max-width: 480px) {\n #messagesContainer {\n padding: 10px;\n gap: 10px;\n }\n \n .message-bubble {\n max-width: 90%;\n font-size: 13px;\n padding: 8px;\n }\n \n .text-input-container {\n padding: 8px;\n }\n \n #text-chat-input {\n font-size: 16px !important;\n padding: 8px 12px;\n }\n }\n ")}},{key:"setupEventHandlers",value:function(){var e=this,t=this.shadowRoot.getElementById("sendButton"),A=this.shadowRoot.getElementById("messageInput"),n=this.shadowRoot.getElementById("newChatBtn");if(t&&(t.onclick=function(){return e.sendMessage()}),n&&(n.onclick=function(){return e.startNewChat()}),this.updateInputAttributes(),A){A.style.height="32px",A.style.overflow="hidden";var o=function(){A.style.height="auto";var e=Math.min(A.scrollHeight,120);A.style.height=e+"px",A.style.overflowY=e>=120?"auto":"hidden",e>=120&&setTimeout(function(){A.scrollTop=A.scrollHeight},0)};A.addEventListener("input",o),A.addEventListener("keydown",function(t){"Enter"!==t.key||t.shiftKey?"Enter"===t.key&&t.shiftKey&&setTimeout(o,0):(t.preventDefault(),e.sendMessage())})}}},{key:"startNewChat",value:function(){try{localStorage.removeItem("ttp_text_chat_conversation_id")}catch(e){}this.sdk&&(this.sdk.config.conversationId=null);var e=this.shadowRoot.getElementById("messagesContainer");e&&(e.innerHTML='\n <div class="empty-state">\n <div class="empty-state-icon">💬</div>\n <div class="empty-state-title">'.concat(this.t("hello"),'</div>\n <div class="empty-state-text">').concat(this.t("sendMessage"),"</div>\n </div>"));var t=this.shadowRoot.getElementById("messageInput");t&&t.focus()}},{key:"updateInputAttributes",value:function(){var e=this.shadowRoot.getElementById("messageInput");if(e){var t,A=this.config.inputPlaceholder||(null===(t=this.config.panel)||void 0===t?void 0:t.inputPlaceholder)||this.t("typeMessage")||"Type your message...";e.placeholder=A,e.dir=this.config.direction||"ltr",e.style.textAlign="rtl"===this.config.direction?"right":"left"}}},{key:"show",value:function(){var e=this,t=this.shadowRoot.getElementById("textInterface");t&&t.classList.add("active"),setTimeout(function(){var t=e.shadowRoot.getElementById("messageInput");t&&t.focus()},50)}},{key:"hide",value:function(){var e=this.shadowRoot.getElementById("textInterface");e&&e.classList.remove("active")}},{key:"startChat",value:(n=oo(to().m(function e(){return to().w(function(e){for(;;)switch(e.n){case 0:this.isActive=!0,this.updateSendButtonState();case 1:return e.a(2)}},e,this)})),function(){return n.apply(this,arguments)})},{key:"sendMessage",value:(A=oo(to().m(function e(){var t,A,n;return to().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t=this.shadowRoot.getElementById("messageInput"),A=t.value.trim()){e.n=1;break}return e.a(2);case 1:if(this.isActive){e.n=2;break}return e.n=2,this.startChat();case 2:return this.addMessage("user",A),t.value="",t.style.height="32px",t.style.overflow="hidden",e.p=3,this.beginStreaming(),e.n=4,this.sdk.sendMessage(A);case 4:e.n=6;break;case 5:e.p=5,n=e.v,console.error("❌ Failed to send message:",n),n&&("DOMAIN_NOT_WHITELISTED"===n.message||n.message&&n.message.includes("Domain not whitelisted"))||this.showError(n),this.stopStreamingState();case 6:return e.a(2)}},e,this,[[3,5]])})),function(){return A.apply(this,arguments)})},{key:"updateSendButtonState",value:function(){var e=this.shadowRoot.getElementById("sendButton");e&&(e.disabled=!this.isActive)}},{key:"addMessage",value:function(e,t){var A,n,o=this.shadowRoot.getElementById("messagesContainer");if(o){var r=o.querySelector(".empty-state");r&&r.remove();var i=document.createElement("div"),a="rtl"===this.config.direction?"user"===e?"edge-left":"edge-right":"user"===e?"edge-right":"edge-left";i.className="message ".concat(e," ").concat(a);var s=document.createElement("div");s.className="message-avatar ".concat(e);var c="user"===e?(null===(A=this.config.messages)||void 0===A?void 0:A.userAvatarIcon)||"👤":(null===(n=this.config.messages)||void 0===n?void 0:n.agentAvatarIcon)||"🤖";s.textContent=c;var l=document.createElement("div");l.className="message-bubble",l.textContent=t,i.appendChild(s),i.appendChild(l),o.appendChild(i),o.scrollTop=o.scrollHeight}}},{key:"beginStreaming",value:function(){var e,t=this.shadowRoot.getElementById("messagesContainer");if(t){this.stopStreamingState();var A=document.createElement("div"),n="rtl"===this.config.direction?"edge-right":"edge-left";A.className="message agent ".concat(n),A.id="agent-streaming";var o=document.createElement("div");o.className="message-avatar agent",o.textContent=(null===(e=this.config.messages)||void 0===e?void 0:e.agentAvatarIcon)||"🤖";var r=document.createElement("div");r.className="message-bubble",r.innerHTML='<span class="typing-indicator"><span class="typing-dot"></span><span class="typing-dot"></span><span class="typing-dot"></span></span>',A.appendChild(o),A.appendChild(r),t.appendChild(A),this.streamingEl=r,this.hasStartedStreaming=!1,t.scrollTop=t.scrollHeight}}},{key:"appendStreamingChunk",value:function(e){if(this.streamingEl){this.hasStartedStreaming||(this.streamingEl.textContent="",this.hasStartedStreaming=!0),this.streamingEl.textContent+=e;var t=this.shadowRoot.getElementById("messagesContainer");t&&(t.scrollTop=t.scrollHeight)}}},{key:"finalizeStreaming",value:function(e){if(this.streamingEl){this.streamingEl.textContent=e||this.streamingEl.textContent;var t=this.shadowRoot.getElementById("agent-streaming");t&&(t.id=""),this.streamingEl=null}this.updateSendButtonState()}},{key:"stopStreamingState",value:function(){var e=this.shadowRoot.getElementById("agent-streaming");e&&e.remove(),this.streamingEl=null,this.hasStartedStreaming=!1}},{key:"showError",value:function(e){var t=this.shadowRoot.getElementById("messagesContainer");if(t){if(e&&("DOMAIN_NOT_WHITELISTED"===e.message||"string"==typeof e&&e.includes("DOMAIN_NOT_WHITELISTED")||e.message&&e.message.includes("Domain not whitelisted")||"string"==typeof e&&e.includes("Domain not whitelisted"))){var A,n=document.createElement("div");n.className="error-message",n.style.cssText="padding: 16px; margin: 12px; border-radius: 8px; background: "+((null===(A=this.config.messages)||void 0===A?void 0:A.errorBackgroundColor)||"#FEE2E2")+";";var o=document.createElement("div");o.style.cssText="font-weight: 600; font-size: 16px; margin-bottom: 8px; color: #991B1B;",o.textContent=this.t("domainNotValidated");var r=document.createElement("div");r.style.cssText="font-size: 14px; color: #991B1B; line-height: 1.5;",r.textContent=this.t("domainErrorMessage"),n.appendChild(o),n.appendChild(r),t.appendChild(n)}else{var i=document.createElement("div");i.className="error-message",i.textContent="string"==typeof e?e:(null==e?void 0:e.message)||e,t.appendChild(i)}t.scrollTop=t.scrollHeight}}},{key:"setActive",value:function(e){this.isActive=e,this.updateSendButtonState()}}],t&&ro(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,A,n}();function so(e){return so="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},so(e)}function co(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,lo(n.key),n)}}function lo(e){var t=function(e){if("object"!=so(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=so(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==so(t)?t:t+""}var uo=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=t,this.translations=t.translations||{},this.shadowRoot=t.shadowRoot},t=[{key:"t",value:function(e){var t=this.config.language||"en";return(this.translations[t]||this.translations.en||{})[e]||e}},{key:"generateHTML",value:function(){var e,t=this.config.landing||{};return e="image"===t.logoType&&t.logoImageUrl?'<img src="'.concat(t.logoImageUrl,'" alt="Logo" style="max-width: 44px; max-height: 44px; object-fit: contain; border: none; outline: none;">'):'<span class="landing-avatar-emoji">'.concat(t.logoIcon||t.logo||"🤖","</span>"),'\n <div class="landing-screen" id="landingScreen">\n \x3c!-- Avatar --\x3e\n <div class="landing-avatar">\n '.concat(e,'\n </div>\n\n \x3c!-- Title --\x3e\n <h2 class="landing-title">').concat(t.title||this.t("landingTitle"),'</h2>\n <p class="landing-subtitle">').concat(t.subtitle||this.t("landingSubtitle")||"Choose your preferred method",'</p>\n\n \x3c!-- Mode Selection - Side by Side --\x3e\n <div class="mode-selection">\n \x3c!-- Voice Call Option --\x3e\n <button class="mode-card" id="mode-card-voice">\n <div class="mode-card-icon">\n <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2"/>\n <line x1="12" y1="19" x2="12" y2="23"/>\n <line x1="8" y1="23" x2="16" y2="23"/>\n </svg>\n </div>\n <span class="mode-card-title">').concat(t.voiceCardTitle||this.t("voiceCall"),'</span>\n </button>\n\n \x3c!-- Text Chat Option --\x3e\n <button class="mode-card" id="mode-card-text">\n <div class="mode-card-icon">\n <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"/>\n </svg>\n </div>\n <span class="mode-card-title">').concat(t.textCardTitle||this.t("textChat"),"</span>\n </button>\n </div>\n </div>\n ")}},{key:"generateCSS",value:function(){var e=this.config.landing||{},t=(this.config.animation,!1===this.config.useShadowDOM?" !important":"");return"\n /* ===== LANDING SCREEN - New Design ===== */\n .landing-screen { \n display: none".concat(t,"; \n flex: 1; \n padding: 32px 24px; \n background: ").concat(e.backgroundColor||"linear-gradient(180deg, #ffffff 0%, rgba(168, 85, 247, 0.03) 100%)","; \n align-items: center; \n justify-content: flex-start; \n flex-direction: column; \n gap: 0; \n overflow-y: auto; \n min-height: 0;\n text-align: center;\n }\n \n .landing-screen.active { \n display: flex").concat(t,"; \n }\n\n /* Avatar - Richer purple gradient */\n .landing-avatar {\n width: 88px;\n height: 88px;\n border-radius: 22px;\n margin-bottom: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n ").concat(function(){if("image"===e.logoType){if(!1!==e.logoBackgroundEnabled){var t=e.logoBackgroundColor||e.avatarBackground||"linear-gradient(135deg, #667eea 0%, #764ba2 100%)";return"background: ".concat(t,"; box-shadow: 0 8px 28px rgba(102, 126, 234, 0.35); border: none;")}return"background: transparent; box-shadow: none; border: none; outline: none;"}var A=e.avatarBackground||"linear-gradient(135deg, #667eea 0%, #764ba2 100%)";return"background: ".concat(A,"; box-shadow: 0 8px 28px rgba(102, 126, 234, 0.35); border: none;")}(),"\n }\n \n .landing-avatar img {\n border: none !important;\n outline: none !important;\n }\n\n .landing-avatar-emoji {\n font-size: 44px;\n line-height: 1;\n }\n\n /* Title & Subtitle */\n .landing-title { \n font-size: 20px; \n color: ").concat(e.titleColor||"#1e1b4b","; \n font-weight: 600; \n margin-bottom: 6px; \n text-align: center;\n line-height: 1.3;\n }\n\n .landing-subtitle {\n font-size: 14px;\n color: ").concat(e.subtitleColor||"#64748b",";\n margin-bottom: 28px;\n text-align: center;\n }\n\n /* Mode Selection - Side by Side */\n .mode-selection { \n display: flex; \n gap: 12px; \n width: 100%; \n justify-content: center; \n }\n\n .mode-card { \n flex: 1; \n max-width: 160px; \n padding: 20px 16px;\n background: ").concat(e.modeCardBackgroundColor||"#ffffff","; \n border: 1px solid ").concat(e.modeCardBorderColor||"rgba(0, 0, 0, 0.06)","; \n border-radius: 18px; \n cursor: pointer; \n display: flex; \n flex-direction: column; \n align-items: center; \n gap: 12px; \n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); \n box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); \n font-family: inherit;\n }\n\n .mode-card:hover { \n transform: translateY(-4px); \n box-shadow: 0 8px 24px rgba(124, 58, 237, 0.2); \n border-color: rgba(124, 58, 237, 0.3); \n }\n\n .mode-card:active {\n transform: translateY(-2px);\n }\n\n /* Mode Card Icon - Vibrant purple gradient */\n .mode-card-icon { \n width: 56px; \n height: 56px; \n display: flex; \n align-items: center; \n justify-content: center; \n border-radius: 16px; \n background: ").concat(e.modeCardIconBackgroundColor||"linear-gradient(135deg, #7c3aed, #a855f7)","; \n color: #fff; \n box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);\n }\n\n .mode-card-icon svg {\n width: 26px;\n height: 26px;\n stroke: white;\n fill: none;\n }\n\n .mode-card-title { \n color: ").concat(e.modeCardTitleColor||"#1e1b4b","; \n font-weight: 600; \n font-size: 14px;\n text-align: center;\n }\n\n /* Mobile Responsive */\n @media (max-width: 768px) {\n .landing-screen {\n padding: 24px 16px;\n }\n\n .landing-avatar {\n width: 72px;\n height: 72px;\n border-radius: 18px;\n margin-bottom: 16px;\n }\n\n .landing-avatar-emoji {\n font-size: 36px;\n }\n\n .landing-title {\n font-size: 18px;\n }\n\n .landing-subtitle {\n font-size: 13px;\n margin-bottom: 20px;\n }\n\n .mode-selection {\n gap: 10px;\n }\n\n .mode-card {\n padding: 16px 12px;\n max-width: 140px;\n }\n\n .mode-card-icon {\n width: 48px;\n height: 48px;\n border-radius: 14px;\n }\n\n .mode-card-icon svg {\n width: 22px;\n height: 22px;\n }\n\n .mode-card-title {\n font-size: 13px;\n }\n }\n\n @media (max-width: 380px) {\n .mode-selection {\n flex-direction: column;\n align-items: center;\n }\n\n .mode-card {\n max-width: 100%;\n width: 100%;\n flex-direction: row;\n padding: 14px 18px;\n gap: 14px;\n }\n\n .mode-card-icon {\n flex-shrink: 0;\n }\n\n .mode-card-title {\n text-align: left;\n }\n }\n ")}},{key:"show",value:function(){var e,t=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("landingScreen");t&&t.classList.add("active")}},{key:"hide",value:function(){var e,t=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("landingScreen");t&&t.classList.remove("active")}},{key:"setupEventHandlers",value:function(){var e,t,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("mode-card-voice"),o=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("mode-card-text");n&&A.onSelectVoice&&(n.onclick=A.onSelectVoice),o&&A.onSelectText&&(o.onclick=A.onSelectText)}}],t&&co(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();const po={en:{landingTitle:"How would you like to communicate?",landingSubtitle:"Choose your preferred method",voiceCall:"Voice Call",textChat:"Text Chat",clickToStartCall:"Click to Start Call",realTimeVoice:"Real-time voice conversation",startCall:"Start Call",connecting:"Connecting...",connectingSubtitle:"Please wait",listening:"Listening...",speakFreely:"Speak freely",liveTranscript:"Live Transcript",transcriptWillAppear:"Transcript will appear here during the call...",mute:"Mute",speaker:"Speaker",endCall:"End Call",hello:"Hello! How can I help?",sendMessage:"Send a message to get started",online:"Online",newChat:"New Chat",back:"Back",close:"Close",error:"Error",typeMessage:"Type your message...",sendMessageAria:"Send message",domainNotValidated:"Domain not validated",domainErrorMessage:"This domain is not whitelisted. Please contact the administrator to whitelist your website URL."},he:{landingTitle:"איך תרצה לתקשר?",landingSubtitle:"בחר את השיטה המועדפת עליך",voiceCall:"שיחה קולית",textChat:"צ'אט טקסט",clickToStartCall:"לחץ להתחלת שיחה",realTimeVoice:"שיחה קולית בזמן אמת",startCall:"התחל שיחה",connecting:"מתחבר...",connectingSubtitle:"אנא המתן",listening:"מקשיב...",speakFreely:"דבר בחופשיות",liveTranscript:"תמלול בזמן אמת",transcriptWillAppear:"התמלול יופיע כאן במהלך השיחה...",mute:"השתק",speaker:"רמקול",endCall:"סיים שיחה",hello:"שלום! איך אפשר לעזור?",sendMessage:"שלח הודעה או עבור למצב קולי לשיחה בזמן אמת",online:"מקוון",newChat:"צ'אט חדש",back:"חזור",close:"סגור",error:"שגיאה",typeMessage:"הקלד הודעה...",sendMessageAria:"שלח הודעה",domainNotValidated:"דומיין לא מאומת",domainErrorMessage:"דומיין זה לא ברשימת המורשים. אנא פנה למנהל המערכת כדי להוסיף את כתובת האתר שלך לרשימה."},ar:{landingTitle:"كيف تريد التواصل؟",landingSubtitle:"اختر الطريقة المفضلة لديك",voiceCall:"مكالمة صوتية",textChat:"دردشة نصية",clickToStartCall:"انقر لبدء المكالمة",realTimeVoice:"محادثة صوتية في الوقت الفعلي",startCall:"ابدأ المكالمة",connecting:"جارٍ الاتصال...",connectingSubtitle:"يرجى الانتظار",listening:"الاستماع...",speakFreely:"تكلم بحرية",liveTranscript:"نص مباشر",transcriptWillAppear:"سيظهر النص هنا أثناء المكالمة...",mute:"كتم الصوت",speaker:"مكبر الصوت",endCall:"إنهاء المكالمة",hello:"مرحبا! كيف يمكنني المساعدة؟",sendMessage:"أرسل رسالة للبدء",online:"متصل",newChat:"محادثة جديدة",back:"رجوع",close:"إغلاق",error:"خطأ",typeMessage:"اكتب رسالة...",sendMessageAria:"إرسال رسالة",domainNotValidated:"النطاق غير معتمد",domainErrorMessage:"هذا النطاق غير مسموح به. يرجى الاتصال بالمسؤول لإضافة عنوان موقع الويب الخاص بك إلى القائمة."},ru:{landingTitle:"Как вы хотите общаться?",landingSubtitle:"Выберите предпочтительный способ",voiceCall:"Голосовой звонок",textChat:"Текстовый чат",clickToStartCall:"Нажмите, чтобы начать звонок",realTimeVoice:"Голосовой разговор в реальном времени",startCall:"Начать звонок",connecting:"Подключение...",connectingSubtitle:"Пожалуйста, подождите",listening:"Слушаю...",speakFreely:"Говорите свободно",liveTranscript:"Живая транскрипция",transcriptWillAppear:"Транскрипция появится здесь во время звонка...",mute:"Отключить звук",speaker:"Динамик",endCall:"Завершить звонок",hello:"Привет! Как я могу помочь?",sendMessage:"Отправьте сообщение для начала",online:"В сети",newChat:"Новый чат",back:"Назад",close:"Закрыть",error:"Ошибка",typeMessage:"Введите сообщение...",sendMessageAria:"Отправить сообщение",domainNotValidated:"Домен не проверен",domainErrorMessage:"Этот домен не в белом списке. Пожалуйста, свяжитесь с администратором, чтобы добавить URL вашего веб-сайта в список."},es:{landingTitle:"¿Cómo te gustaría comunicarte?",landingSubtitle:"Elige tu método preferido",voiceCall:"Llamada de voz",textChat:"Chat de texto",clickToStartCall:"Haz clic para iniciar la llamada",realTimeVoice:"Conversación de voz en tiempo real",startCall:"Iniciar llamada",connecting:"Conectando...",connectingSubtitle:"Por favor espere",listening:"Escuchando...",speakFreely:"Habla libremente",liveTranscript:"Transcripción en vivo",transcriptWillAppear:"La transcripción aparecerá aquí durante la llamada...",mute:"Silenciar",speaker:"Altavoz",endCall:"Terminar llamada",hello:"¡Hola! ¿Cómo puedo ayudarte?",sendMessage:"Envía un mensaje para comenzar",online:"En línea",newChat:"Nuevo chat",back:"Atrás",close:"Cerrar",error:"Error",typeMessage:"Escribe un mensaje...",sendMessageAria:"Enviar mensaje",domainNotValidated:"Dominio no validado",domainErrorMessage:"Este dominio no está en la lista blanca. Por favor, contacte al administrador para agregar la URL de su sitio web a la lista."},fr:{landingTitle:"Comment souhaitez-vous communiquer?",landingSubtitle:"Choisissez votre méthode préférée",voiceCall:"Appel vocal",textChat:"Chat texte",clickToStartCall:"Cliquez pour démarrer l'appel",realTimeVoice:"Conversation vocale en temps réel",startCall:"Démarrer l'appel",connecting:"Connexion...",connectingSubtitle:"Veuillez patienter",listening:"Écoute...",speakFreely:"Parlez librement",liveTranscript:"Transcripción en direct",transcriptWillAppear:"La transcription apparaîtra ici pendant l'appel...",mute:"Muet",speaker:"Haut-parleur",endCall:"Terminer l'appel",hello:"Bonjour! Comment puis-je vous aider?",sendMessage:"Envoyez un message pour commencer",online:"En ligne",newChat:"Nouveau chat",back:"Retour",close:"Fermer",error:"Erreur",typeMessage:"Tapez votre message...",sendMessageAria:"Envoyer un message",domainNotValidated:"Domaine non validé",domainErrorMessage:"Ce domaine n'est pas sur la liste blanche. Veuillez contacter l'administrateur pour ajouter l'URL de votre site Web à la liste."},de:{landingTitle:"Wie möchten Sie kommunizieren?",landingSubtitle:"Wählen Sie Ihre bevorzugte Methode",voiceCall:"Sprachanruf",textChat:"Text-Chat",clickToStartCall:"Klicken Sie, um den Anruf zu starten",realTimeVoice:"Sprachanruf in Echtzeit",startCall:"Anruf starten",connecting:"Verbinden...",connectingSubtitle:"Bitte warten",listening:"Hören...",speakFreely:"Sprechen Sie frei",liveTranscript:"Live-Transkription",transcriptWillAppear:"Die Transkription erscheint hier während des Anrufs...",mute:"Stumm",speaker:"Lautsprecher",endCall:"Anruf beenden",hello:"Hallo! Wie kann ich helfen?",sendMessage:"Senden Sie eine Nachricht zum Starten",online:"Online",newChat:"Neuer Chat",back:"Zurück",close:"Schließen",error:"Fehler",typeMessage:"Geben Sie eine Nachricht ein...",sendMessageAria:"Nachricht senden",domainNotValidated:"Domain nicht validiert",domainErrorMessage:"Diese Domain steht nicht auf der Whitelist. Bitte kontaktieren Sie den Administrator, um die URL Ihrer Website zur Liste hinzuzufügen."}};function ho(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return go(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(go(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,go(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,go(u,"constructor",c),go(c,"constructor",s),s.displayName="GeneratorFunction",go(c,o,"GeneratorFunction"),go(u),go(u,o,"Generator"),go(u,n,function(){return this}),go(u,"toString",function(){return"[object Generator]"}),(ho=function(){return{w:r,m:d}})()}function go(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}go=function(e,t,A,n){function r(t,A){go(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},go(e,t,A,n)}function fo(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function mo(e){return function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){fo(r,n,o,i,a,"next",e)}function a(e){fo(r,n,o,i,a,"throw",e)}i(void 0)})}}function vo(e){return vo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vo(e)}function Bo(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),A.push.apply(A,n)}return A}function wo(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?Bo(Object(A),!0).forEach(function(t){yo(e,t,A[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):Bo(Object(A)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}return e}function yo(e,t,A){return(t=Co(t))in e?Object.defineProperty(e,t,{value:A,enumerable:!0,configurable:!0,writable:!0}):e[t]=A,e}function bo(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Co(n.key),n)}}function Co(e){var t=function(e){if("object"!=vo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=vo(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==vo(t)?t:t+""}var xo=function(){return e=function e(){var t,A,n,o,r,i,a,s,c,l=this,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=this.mergeWithDefaults(u),this.sdk=new mA(this.config),this.isOpen=!1,this.isActive=!1,this.translations=po,this.currentView="landing",this.isStartingCall=!1,this.shadowRoot=null,this.container=null,this._pendingClientTools=null,this.config.useShadowDOM?(this.createShadowHost(),this.container=this.shadowRoot):(this.createRegularContainer(),this.container=this.regularContainer,this.shadowRoot=document);var d=wo(wo(wo({},this.config),this.config.voice),{},{inputPlaceholder:(null===(t=this.config.text)||void 0===t?void 0:t.inputPlaceholder)||this.config.inputPlaceholder||"Type your message...",sendButtonColor:(null===(A=this.config.text)||void 0===A?void 0:A.sendButtonColor)||this.config.sendButtonColor||"#7C3AED",language:(null===(n=this.config.voice)||void 0===n?void 0:n.language)||this.config.language||"en",signedUrl:this.config.signedUrl,agentSettingsOverride:this.config.agentSettingsOverride,visualAssistant:this.config.visualAssistant,translations:this.translations,shadowRoot:this.shadowRoot,textSDK:this.sdk,outputContainer:(null===(o=this.config.voice)||void 0===o?void 0:o.outputContainer)||"raw",outputEncoding:(null===(r=this.config.voice)||void 0===r?void 0:r.outputEncoding)||"pcm",outputSampleRate:(null===(i=this.config.voice)||void 0===i?void 0:i.outputSampleRate)||44100,outputChannels:(null===(a=this.config.voice)||void 0===a?void 0:a.outputChannels)||1,outputBitDepth:(null===(s=this.config.voice)||void 0===s?void 0:s.outputBitDepth)||16,onConversationStart:this.config.onConversationStart,onConversationEnd:this.config.onConversationEnd,onBargeIn:this.config.onBargeIn,onAudioStartPlaying:this.config.onAudioStartPlaying,onAudioStoppedPlaying:this.config.onAudioStoppedPlaying,onSubtitleDisplay:this.config.onSubtitleDisplay,onVoiceCallButtonClick:this.config.onVoiceCallButtonClick,onCallEnd:function(){var e,t,A=null===(e=l.voiceInterface)||void 0===e||null===(e=e.shadowRoot)||void 0===e?void 0:e.getElementById("voiceIdleState");if(A&&"none"!==A.style.display){var n=A.querySelector(".voice-status-title");if(n){var o,r=n.textContent.trim();if(r===(null===(o=l.voiceInterface)||void 0===o?void 0:o.t("domainNotValidated"))||r.includes("Domain not")||r.includes("not whitelisted"))return void console.log("🚫 Domain error is displayed - NOT returning to landing screen from onCallEnd")}}"unified"===((null===(t=l.config.behavior)||void 0===t?void 0:t.mode)||"unified")&&l.showLanding()},onShowVoice:function(){l.showVoice()},onShowLanding:function(){l.showLanding()},onErrorToast:function(e,t){l.showErrorToast(e,t)}});this.voiceInterface=new $n(d);var p=wo(wo(wo({},this.config),this.config.text),{},{translations:this.translations,shadowRoot:this.shadowRoot});if(this.textInterface=new ao(p,this.sdk),"unified"===((null===(c=this.config.behavior)||void 0===c?void 0:c.mode)||"unified")){var h=wo(wo({},this.config),{},{translations:this.translations,shadowRoot:this.shadowRoot});this.landingScreen=new uo(h)}else this.landingScreen=null;if(this.createWidget(),this.setupEventHandlers(),this.config.behavior.startOpen||this.config.behavior.autoOpen){var g,f=null===(g=this.shadowRoot)||void 0===g?void 0:g.getElementById("text-chat-panel");f&&(this.isOpen=!0,f.classList.add("open"))}this.checkAndHandleResume()},t=[{key:"checkAndHandleResume",value:function(){var e=this,t=this.voiceInterface.checkAndHandleResume();t&&(console.log("🔄 [WIDGET] Auto-resuming call from page navigation"),console.log(" From:",t.fromPage,"→ To:",t.toPage),this.open(),this.showVoice(),this.currentView="voice",setTimeout(function(){e.startVoiceCall().then(function(){console.log("✅ [WIDGET] Auto-resumed call successfully")}).catch(function(t){var A;console.error("❌ [WIDGET] Failed to auto-resume call:",t),"unified"===((null===(A=e.config.behavior)||void 0===A?void 0:A.mode)||"unified")&&e.showLanding()})},100))}},{key:"open",value:function(){var e;if(!this.isOpen){var t=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("text-chat-panel");t&&(this.isOpen=!0,t.classList.add("open"))}}},{key:"mergeWithDefaults",value:function(e){var t,A,n,o,r,i,a,s,c,l,u,d,p,h,g,f,m,v,B,w,y,b,C,x,Q,F,U,S,k,E,I,T,H,D,P,O,K,M,L,R,_,V,j,N,G,W,z,X,J,Y,q,Z,$,ee,te,Ae,ne,oe,re,ie,ae,se,ce,le,ue,de,pe,he,ge,fe,me,ve,Be,we,ye,be,Ce,xe,Qe,Fe,Ue,Se,ke,Ee,Ie,Te,He,De,Pe,Oe,Ke,Me,Le,Re,_e,Ve,je,Ne,Ge,We,ze,Xe,Je,Ye,qe,Ze,$e,et,tt,At,nt,ot,rt,it,at,st,ct,lt,ut,dt,pt,ht,gt,ft,mt,vt,Bt,wt,yt,bt,Ct,xt,Qt,Ft,Ut,St,kt,Et,It,Tt=e.position||"bottom-right";if("string"==typeof Tt){var Ht=Tt.split("-");Tt={vertical:Ht[0]||"bottom",horizontal:Ht[1]||"right",offset:e.positionOffset||{x:20,y:20}}}var Dt=e.primaryColor||(null===(t=e.button)||void 0===t?void 0:t.primaryColor)||(null===(A=e.button)||void 0===A?void 0:A.backgroundColor)||"#FFFFFF",Pt={};e.landing&&Object.keys(e.landing).forEach(function(t){var A=e.landing[t];null!=A&&""!==A&&(Pt[t]=A)});var Ot={};return e.header&&Object.keys(e.header).forEach(function(t){var A=e.header[t];null!=A&&""!==A&&(Ot[t]=A)}),wo({agentId:e.agentId,appId:e.appId,signedUrl:e.signedUrl,agentSettingsOverride:e.agentSettingsOverride,demo:!1!==e.demo,direction:e.direction||"ltr",language:e.language||"en",icon:wo({type:(null===(n=e.icon)||void 0===n?void 0:n.type)||"custom",customImage:(null===(o=e.icon)||void 0===o?void 0:o.customImage)||"https://talktopc.com/logo192.png",emoji:(null===(r=e.icon)||void 0===r?void 0:r.emoji)||"🎤",text:(null===(i=e.icon)||void 0===i?void 0:i.text)||"AI",size:(null===(a=e.icon)||void 0===a?void 0:a.size)||"medium",backgroundColor:(null===(s=e.icon)||void 0===s?void 0:s.backgroundColor)||"#FFFFFF"},e.icon),position:wo({vertical:Tt.vertical||"bottom",horizontal:Tt.horizontal||"right",offset:Tt.offset||{x:20,y:20}},"object"===vo(e.position)?e.position:{}),button:wo({size:(null===(c=e.button)||void 0===c?void 0:c.size)||"medium",shape:(null===(l=e.button)||void 0===l?void 0:l.shape)||"circle",backgroundColor:(null===(u=e.button)||void 0===u?void 0:u.backgroundColor)||(null===(d=e.icon)||void 0===d?void 0:d.backgroundColor)||"#FFFFFF",hoverColor:(null===(p=e.button)||void 0===p?void 0:p.hoverColor)||"#D3D3D3",shadow:!1!==(null===(h=e.button)||void 0===h?void 0:h.shadow),shadowColor:(null===(g=e.button)||void 0===g?void 0:g.shadowColor)||"rgba(0,0,0,0.15)",primaryColor:(null===(f=e.button)||void 0===f?void 0:f.backgroundColor)||(null===(m=e.icon)||void 0===m?void 0:m.backgroundColor)||"#FFFFFF"},e.button),panel:wo({width:(null===(v=e.panel)||void 0===v?void 0:v.width)||360,height:(null===(B=e.panel)||void 0===B?void 0:B.height)||500,borderRadius:(null===(w=e.panel)||void 0===w?void 0:w.borderRadius)||24,backgroundColor:(null===(y=e.panel)||void 0===y?void 0:y.backgroundColor)||"#FFFFFF",backdropFilter:(null===(b=e.panel)||void 0===b?void 0:b.backdropFilter)||null,border:(null===(C=e.panel)||void 0===C?void 0:C.border)||"1px solid #E5E7EB"},e.panel),voice:wo({micButtonColor:(null===(x=e.voice)||void 0===x?void 0:x.micButtonColor)||(null===(Q=e.panel)||void 0===Q?void 0:Q.micButtonColor)||Dt,micButtonActiveColor:(null===(F=e.voice)||void 0===F?void 0:F.micButtonActiveColor)||(null===(U=e.panel)||void 0===U?void 0:U.micButtonActiveColor)||"#EF4444",micButtonHint:wo(wo({text:(null===(S=e.voice)||void 0===S||null===(S=S.micButtonHint)||void 0===S?void 0:S.text)||(null===(k=e.panel)||void 0===k||null===(k=k.micButtonHint)||void 0===k?void 0:k.text)||"Click the button to start voice conversation",color:(null===(E=e.voice)||void 0===E||null===(E=E.micButtonHint)||void 0===E?void 0:E.color)||(null===(I=e.panel)||void 0===I||null===(I=I.micButtonHint)||void 0===I?void 0:I.color)||"#6B7280",fontSize:(null===(T=e.voice)||void 0===T||null===(T=T.micButtonHint)||void 0===T?void 0:T.fontSize)||(null===(H=e.panel)||void 0===H||null===(H=H.micButtonHint)||void 0===H?void 0:H.fontSize)||"12px"},null===(D=e.voice)||void 0===D?void 0:D.micButtonHint),null===(P=e.panel)||void 0===P?void 0:P.micButtonHint),avatarBackgroundColor:(null===(O=e.voice)||void 0===O?void 0:O.avatarBackgroundColor)||"#667eea",avatarActiveBackgroundColor:(null===(K=e.voice)||void 0===K?void 0:K.avatarActiveBackgroundColor)||"#667eea",statusTitleColor:(null===(M=e.voice)||void 0===M?void 0:M.statusTitleColor)||"#1e293b",statusSubtitleColor:(null===(L=e.voice)||void 0===L?void 0:L.statusSubtitleColor)||"#64748b",statusDotColor:(null===(R=e.voice)||void 0===R?void 0:R.statusDotColor)||"#10b981",statusText:(null===(_=e.voice)||void 0===_?void 0:_.statusText)||null,startCallButtonColor:(null===(V=e.voice)||void 0===V?void 0:V.startCallButtonColor)||"#667eea",startCallButtonTextColor:(null===(j=e.voice)||void 0===j?void 0:j.startCallButtonTextColor)||"#FFFFFF",startCallTitle:(null===(N=e.voice)||void 0===N?void 0:N.startCallTitle)||null,startCallSubtitle:(null===(G=e.voice)||void 0===G?void 0:G.startCallSubtitle)||null,startCallButtonText:(null===(W=e.voice)||void 0===W?void 0:W.startCallButtonText)||null,transcriptBackgroundColor:(null===(z=e.voice)||void 0===z?void 0:z.transcriptBackgroundColor)||"#FFFFFF",transcriptTextColor:(null===(X=e.voice)||void 0===X?void 0:X.transcriptTextColor)||"#1e293b",transcriptLabelColor:(null===(J=e.voice)||void 0===J?void 0:J.transcriptLabelColor)||"#94a3b8",controlButtonColor:(null===(Y=e.voice)||void 0===Y?void 0:Y.controlButtonColor)||"#FFFFFF",controlButtonSecondaryColor:(null===(q=e.voice)||void 0===q?void 0:q.controlButtonSecondaryColor)||"#64748b",endCallButtonColor:(null===(Z=e.voice)||void 0===Z?void 0:Z.endCallButtonColor)||"#ef4444",language:(null===($=e.voice)||void 0===$?void 0:$.language)||e.language||"en"},e.voice),text:wo({sendButtonColor:(null===(ee=e.text)||void 0===ee?void 0:ee.sendButtonColor)||(null===(te=e.panel)||void 0===te?void 0:te.sendButtonColor)||"#7C3AED",sendButtonHoverColor:(null===(Ae=e.text)||void 0===Ae?void 0:Ae.sendButtonHoverColor)||(null===(ne=e.panel)||void 0===ne?void 0:ne.sendButtonHoverColor)||"#6D28D9",sendButtonActiveColor:(null===(oe=e.text)||void 0===oe?void 0:oe.sendButtonActiveColor)||(null===(re=e.panel)||void 0===re?void 0:re.sendButtonActiveColor)||"#6D28D9",sendButtonText:(null===(ie=e.text)||void 0===ie?void 0:ie.sendButtonText)||(null===(ae=e.panel)||void 0===ae?void 0:ae.sendButtonText)||"➤",sendButtonTextColor:(null===(se=e.text)||void 0===se?void 0:se.sendButtonTextColor)||(null===(ce=e.panel)||void 0===ce?void 0:ce.sendButtonTextColor)||"#FFFFFF",sendButtonFontSize:(null===(le=e.text)||void 0===le?void 0:le.sendButtonFontSize)||(null===(ue=e.panel)||void 0===ue?void 0:ue.sendButtonFontSize)||"18px",sendButtonFontWeight:(null===(de=e.text)||void 0===de?void 0:de.sendButtonFontWeight)||(null===(pe=e.panel)||void 0===pe?void 0:pe.sendButtonFontWeight)||"500",sendButtonHint:wo(wo({text:(null===(he=e.text)||void 0===he||null===(he=he.sendButtonHint)||void 0===he?void 0:he.text)||(null===(ge=e.panel)||void 0===ge||null===(ge=ge.sendButtonHint)||void 0===ge?void 0:ge.text)||"",color:(null===(fe=e.text)||void 0===fe||null===(fe=fe.sendButtonHint)||void 0===fe?void 0:fe.color)||(null===(me=e.panel)||void 0===me||null===(me=me.sendButtonHint)||void 0===me?void 0:me.color)||"#6B7280",fontSize:(null===(ve=e.text)||void 0===ve||null===(ve=ve.sendButtonHint)||void 0===ve?void 0:ve.fontSize)||(null===(Be=e.panel)||void 0===Be||null===(Be=Be.sendButtonHint)||void 0===Be?void 0:Be.fontSize)||"12px"},null===(we=e.text)||void 0===we?void 0:we.sendButtonHint),null===(ye=e.panel)||void 0===ye?void 0:ye.sendButtonHint),inputPlaceholder:(null===(be=e.text)||void 0===be?void 0:be.inputPlaceholder)||(null===(Ce=e.panel)||void 0===Ce?void 0:Ce.inputPlaceholder)||"Type your message...",inputBorderColor:(null===(xe=e.text)||void 0===xe?void 0:xe.inputBorderColor)||(null===(Qe=e.panel)||void 0===Qe?void 0:Qe.inputBorderColor)||"#E5E7EB",inputFocusColor:(null===(Fe=e.text)||void 0===Fe?void 0:Fe.inputFocusColor)||(null===(Ue=e.panel)||void 0===Ue?void 0:Ue.inputFocusColor)||"#7C3AED",inputBackgroundColor:(null===(Se=e.text)||void 0===Se?void 0:Se.inputBackgroundColor)||(null===(ke=e.panel)||void 0===ke?void 0:ke.inputBackgroundColor)||"#FFFFFF",inputTextColor:(null===(Ee=e.text)||void 0===Ee?void 0:Ee.inputTextColor)||(null===(Ie=e.panel)||void 0===Ie?void 0:Ie.inputTextColor)||"#1F2937",inputFontSize:(null===(Te=e.text)||void 0===Te?void 0:Te.inputFontSize)||(null===(He=e.panel)||void 0===He?void 0:He.inputFontSize)||"14px",inputBorderRadius:(null===(De=e.text)||void 0===De?void 0:De.inputBorderRadius)||(null===(Pe=e.panel)||void 0===Pe?void 0:Pe.inputBorderRadius)||20,inputPadding:(null===(Oe=e.text)||void 0===Oe?void 0:Oe.inputPadding)||(null===(Ke=e.panel)||void 0===Ke?void 0:Ke.inputPadding)||"6px 14px"},e.text),landing:function(){var t={};return e.landing&&Object.keys(e.landing).forEach(function(A){var n=e.landing[A];(null!=n&&""!==n||!1===n)&&(t[A]=n)}),wo({backgroundColor:t.backgroundColor||"linear-gradient(180deg, #f8fafc 0%, #e0e7ff 100%)",logo:t.logo||"🤖",title:t.title||null,titleColor:t.titleColor||"#1e293b",modeCardBackgroundColor:t.modeCardBackgroundColor||"#FFFFFF",modeCardBorderColor:t.modeCardBorderColor||"#E2E8F0",modeCardHoverBorderColor:t.modeCardHoverBorderColor||"#7C3AED",modeCardIconBackgroundColor:t.modeCardIconBackgroundColor||"#7C3AED",modeCardTitleColor:t.modeCardTitleColor||"#111827",voiceCardIcon:t.voiceCardIcon||"🎤",textCardIcon:t.textCardIcon||"💬",voiceCardTitle:t.voiceCardTitle||null,textCardTitle:t.textCardTitle||null},t)}(),header:function(){var t={};return e.header&&Object.keys(e.header).forEach(function(A){var n=e.header[A];A.startsWith("onlineIndicator")?null!=n&&(t[A]=n):null!=n&&""!==n&&(t[A]=n)}),wo({title:t.title||"Chat Assistant",showTitle:!1!==t.showTitle,backgroundColor:t.backgroundColor||"#7C3AED",textColor:t.textColor||"#FFFFFF",showCloseButton:!1!==t.showCloseButton},t)}(),footer:wo({show:!1!==(null===(Me=e.footer)||void 0===Me?void 0:Me.show),backgroundColor:(null===(Le=e.footer)||void 0===Le?void 0:Le.backgroundColor)||"#f9fafb",textColor:(null===(Re=e.footer)||void 0===Re?void 0:Re.textColor)||"#9ca3af",hoverColor:(null===(_e=e.footer)||void 0===_e?void 0:_e.hoverColor)||"#7C3AED"},e.footer),tooltips:wo({newChat:(null===(Ve=e.tooltips)||void 0===Ve?void 0:Ve.newChat)||null,back:(null===(je=e.tooltips)||void 0===je?void 0:je.back)||null,close:(null===(Ne=e.tooltips)||void 0===Ne?void 0:Ne.close)||null,mute:(null===(Ge=e.tooltips)||void 0===Ge?void 0:Ge.mute)||null,speaker:(null===(We=e.tooltips)||void 0===We?void 0:We.speaker)||null,endCall:(null===(ze=e.tooltips)||void 0===ze?void 0:ze.endCall)||null},e.tooltips),messages:wo({userBackgroundColor:(null===(Xe=e.messages)||void 0===Xe?void 0:Xe.userBackgroundColor)||"#E5E7EB",agentBackgroundColor:(null===(Je=e.messages)||void 0===Je?void 0:Je.agentBackgroundColor)||"#F3F4F6",systemBackgroundColor:(null===(Ye=e.messages)||void 0===Ye?void 0:Ye.systemBackgroundColor)||"#DCFCE7",errorBackgroundColor:(null===(qe=e.messages)||void 0===qe?void 0:qe.errorBackgroundColor)||"#FEE2E2",textColor:(null===(Ze=e.messages)||void 0===Ze?void 0:Ze.textColor)||"#1F2937",userTextColor:(null===($e=e.messages)||void 0===$e?void 0:$e.userTextColor)||(null===(et=e.messages)||void 0===et?void 0:et.textColor)||"#1F2937",agentTextColor:(null===(tt=e.messages)||void 0===tt?void 0:tt.agentTextColor)||(null===(At=e.messages)||void 0===At?void 0:At.textColor)||"#1F2937",userAvatarIcon:(null===(nt=e.messages)||void 0===nt?void 0:nt.userAvatarIcon)||"👤",agentAvatarIcon:(null===(ot=e.messages)||void 0===ot?void 0:ot.agentAvatarIcon)||"🤖",fontSize:(null===(rt=e.messages)||void 0===rt?void 0:rt.fontSize)||"14px",borderRadius:(null===(it=e.messages)||void 0===it?void 0:it.borderRadius)||16},e.messages),animation:wo({enableHover:!1!==(null===(at=e.animation)||void 0===at?void 0:at.enableHover),enablePulse:!1!==(null===(st=e.animation)||void 0===st?void 0:st.enablePulse),enableSlide:!1!==(null===(ct=e.animation)||void 0===ct?void 0:ct.enableSlide),duration:(null===(lt=e.animation)||void 0===lt?void 0:lt.duration)||.3},e.animation),promptAnimation:wo({enabled:!0===(null===(ut=e.promptAnimation)||void 0===ut?void 0:ut.enabled),text:(null===(dt=e.promptAnimation)||void 0===dt?void 0:dt.text)||"Try me!",backgroundColor:(null===(pt=e.promptAnimation)||void 0===pt?void 0:pt.backgroundColor)||"linear-gradient(135deg, #7c3aed, #4f46e5)",textColor:(null===(ht=e.promptAnimation)||void 0===ht?void 0:ht.textColor)||"#ffffff",animationType:(null===(gt=e.promptAnimation)||void 0===gt?void 0:gt.animationType)||"bounce",showShimmer:!1!==(null===(ft=e.promptAnimation)||void 0===ft?void 0:ft.showShimmer),showPulseRings:!1!==(null===(mt=e.promptAnimation)||void 0===mt?void 0:mt.showPulseRings),hideAfterClick:!1!==(null===(vt=e.promptAnimation)||void 0===vt?void 0:vt.hideAfterClick),hideAfterSeconds:void 0!==(null===(Bt=e.promptAnimation)||void 0===Bt?void 0:Bt.hideAfterSeconds)?e.promptAnimation.hideAfterSeconds:null,position:(null===(wt=e.promptAnimation)||void 0===wt?void 0:wt.position)||"top"},e.promptAnimation),behavior:wo({autoOpen:(null===(yt=e.behavior)||void 0===yt?void 0:yt.autoOpen)||!1,startOpen:(null===(bt=e.behavior)||void 0===bt?void 0:bt.startOpen)||!1,hidden:(null===(Ct=e.behavior)||void 0===Ct?void 0:Ct.hidden)||!1,autoConnect:(null===(xt=e.behavior)||void 0===xt?void 0:xt.autoConnect)||!1,showWelcomeMessage:!1!==(null===(Qt=e.behavior)||void 0===Qt?void 0:Qt.showWelcomeMessage),welcomeMessage:(null===(Ft=e.behavior)||void 0===Ft?void 0:Ft.welcomeMessage)||"Hello! How can I help you today?",enableVoiceMode:void 0===(null===(Ut=e.behavior)||void 0===Ut?void 0:Ut.enableVoiceMode)||e.behavior.enableVoiceMode,mode:(null===(St=e.behavior)||void 0===St?void 0:St.mode)||"unified"},e.behavior),accessibility:wo({ariaLabel:(null===(kt=e.accessibility)||void 0===kt?void 0:kt.ariaLabel)||"Chat Assistant",ariaDescription:(null===(Et=e.accessibility)||void 0===Et?void 0:Et.ariaDescription)||"Click to open chat assistant",keyboardNavigation:!1!==(null===(It=e.accessibility)||void 0===It?void 0:It.keyboardNavigation)},e.accessibility),customStyles:e.customStyles||"",useShadowDOM:!1!==e.useShadowDOM,variables:e.variables||{},forceConversationId:e.forceConversationId,visualAssistant:e.visualAssistant,onConversationStart:e.onConversationStart,onConversationEnd:e.onConversationEnd,onBargeIn:e.onBargeIn,onAudioStartPlaying:e.onAudioStartPlaying,onAudioStoppedPlaying:e.onAudioStoppedPlaying,onSubtitleDisplay:e.onSubtitleDisplay,onVoiceCallButtonClick:e.onVoiceCallButtonClick,primaryColor:Dt},"string"==typeof e.position?{positionString:e.position}:{})}},{key:"setupEventHandlers",value:function(){var e=this;this.sdk.on("domainError",function(t){e.textInterface.showError(t),e.textInterface.stopStreamingState()}),this.sdk.on("error",function(t){t&&("DOMAIN_NOT_WHITELISTED"===t.message||t.message&&t.message.includes("Domain not whitelisted"))||(e.textInterface.showError(t.message||t),e.textInterface.stopStreamingState())}),this.sdk.on("chunk",function(t){e.textInterface.appendStreamingChunk(t)}),this.sdk.on("done",function(t){var A=t.text;e.textInterface.finalizeStreaming(A)})}},{key:"createShadowHost",value:function(){var e=document.getElementById("ttp-widget-shadow-host");e&&e.remove();var t=document.createElement("div");t.id="ttp-widget-shadow-host",t.style.cssText="position: fixed; z-index: 10000; pointer-events: none; top: 0; left: 0; width: 100%; height: 100%; overflow: visible;",this.shadowRoot=t.attachShadow({mode:"open"}),document.body.appendChild(t)}},{key:"createRegularContainer",value:function(){var e=document.getElementById("ttp-widget-container");e&&e.remove();var t=document.createElement("div");t.id="ttp-widget-container",t.style.cssText="position: fixed; z-index: 10000; pointer-events: none; top: 0; left: 0; width: 100%; height: 100%; overflow: visible;",document.body.appendChild(t),this.regularContainer=t}},{key:"createWidget",value:function(){var e=this;this.container||(this.config.useShadowDOM?(this.createShadowHost(),this.container=this.shadowRoot):(this.createRegularContainer(),this.container=this.regularContainer,this.shadowRoot=document));var t;t=this.config.useShadowDOM?"\n :host {\n all: initial;\n display: block;\n pointer-events: none;\n }\n img {\n max-width: none !important;\n }\n #text-chat-button img {\n width: 28px !important;\n height: 28px !important;\n }\n #text-chat-button {\n pointer-events: auto;\n }\n #text-chat-panel {\n pointer-events: auto;\n }\n ":'\n /* Reset only problematic inherited styles, not all styles */\n #text-chat-button,\n #text-chat-panel,\n #text-chat-panel * {\n box-sizing: border-box;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n }\n \n /* Prevent theme CSS from affecting images */\n #text-chat-button img,\n #text-chat-panel img {\n max-width: none !important;\n width: auto;\n height: auto;\n }\n \n #text-chat-button img {\n width: 28px !important;\n height: 28px !important;\n }\n \n /* Ensure button and panel can receive clicks */\n #text-chat-button,\n #text-chat-panel {\n pointer-events: auto;\n }\n \n /* Reset any inherited text styles that might break layout */\n #text-chat-panel {\n text-align: left;\n line-height: normal;\n letter-spacing: normal;\n word-spacing: normal;\n text-transform: none;\n text-indent: 0;\n text-shadow: none;\n white-space: normal;\n }\n \n /* Ensure flexbox works properly */\n #text-chat-panel .widget-shell,\n #text-chat-panel .panel-inner,\n #text-chat-panel .widget-container,\n #text-chat-panel .landing-screen,\n #text-chat-panel .voice-interface,\n #text-chat-panel .text-interface,\n #text-chat-panel .widget-header,\n #text-chat-panel .mode-selection {\n display: flex;\n }\n \n #text-chat-panel .widget-shell,\n #text-chat-panel .panel-inner,\n #text-chat-panel .widget-container,\n #text-chat-panel .landing-screen,\n #text-chat-panel .voice-interface,\n #text-chat-panel .text-interface {\n flex-direction: column;\n }\n \n #text-chat-panel .mode-selection {\n flex-direction: row;\n }\n \n /* Ensure proper stacking */\n #text-chat-button {\n z-index: 10001 !important;\n }\n \n #text-chat-panel {\n z-index: 10000 !important;\n }\n ';var A=this.generateWidgetHTML();if(this.config.useShadowDOM){var n="\n <style>".concat(t,"</style>\n ").concat(A,"\n ");this.shadowRoot.innerHTML=n}else this.injectStylesIntoHead(t),this.container.innerHTML=A;this.setupWidgetEvents();var o=this.shadowRoot.getElementById("text-chat-panel");o?this.config.behavior.startOpen||this.config.behavior.autoOpen?(this.isOpen=!0,o.classList.add("open"),this.hidePrompt()):this.showPrompt():setTimeout(function(){e.showPrompt()},100),setTimeout(function(){e.isOpen?e.hidePrompt():e.showPrompt()},200)}},{key:"injectStylesIntoHead",value:function(e){var t,A,n=document.getElementById("ttp-widget-styles");n&&n.remove();var o={small:50,medium:60,large:70,xl:80}[null===(t=this.config.button)||void 0===t?void 0:t.size]||60,r={small:20,medium:28,large:36,xl:44}[null===(A=this.config.icon)||void 0===A?void 0:A.size]||28,i=this.generatePositionStyles(),a=this.generateCSS(i,o,r),s=document.createElement("style");s.id="ttp-widget-styles",s.textContent=e+"\n"+a,this.config.customStyles&&(s.textContent+="\n"+this.config.customStyles),document.head.appendChild(s)}},{key:"generateWidgetHTML",value:function(){var e,t=this,A=(this.config.position,this.config.button),n=this.config.icon,o=(this.config.panel,this.config.header),r=(this.config.animation,{small:50,medium:60,large:70,xl:80}[A.size]||60),i={small:20,medium:28,large:36,xl:44}[n.size]||28,a=this.generatePositionStyles(),s=this.generateIconHTML(i),c=(null===(e=this.config.behavior)||void 0===e?void 0:e.mode)||"unified",l="unified"===c,u="unified"===c||"voice-only"===c,d="unified"===c||"text-only"===c,p=function(e){var A=t.config.language||"en";return(t.translations[A]||t.translations.en)[e]||e},h=function(e){var A,n=null===(A=t.config.tooltips)||void 0===A?void 0:A[e];return null!=n?n:{newChat:p("newChat"),back:p("back"),close:p("close"),mute:p("mute"),speaker:p("speaker"),endCall:p("endCall")}[e]||""},g=this.config.useShadowDOM?"\n <style>\n ".concat(this.generateCSS(a,r,i),"\n ").concat(this.config.customStyles,"\n </style>\n "):"",f=this.config.promptAnimation||{},m=!0===f.enabled,v=m?this.generatePromptBubbleHTML(f,r):"";return console.log("📝 generateWidgetHTML - promptAnimation:",{hasConfig:!!this.config.promptAnimation,promptConfig:f,enabled:f.enabled,isPromptEnabled:m,willGenerateHTML:!!v}),"\n ".concat(g,"\n \n ").concat(this.config.behavior.hidden?"":'\n <div id="text-chat-button-container">\n '.concat(v,"\n ").concat(m&&!1!==f.showPulseRings?this.generatePulseRingsHTML(f):"",'\n <button id="text-chat-button" \n aria-label="').concat(this.config.accessibility.ariaLabel,'"\n aria-description="').concat(this.config.accessibility.ariaDescription,'">\n ').concat(s,"\n </button>\n </div>\n "),'\n \n <div id="text-chat-panel">\n <div class="widget-shell">\n <div class="panel-inner widget-container" style="direction: ').concat(this.config.direction,';">\n <div class="widget-header" style="background: ').concat(o.backgroundColor||"#7C3AED"," !important; color: ").concat(o.textColor||"#FFFFFF",' !important;">\n <div>\n ').concat(o.showTitle?'<div class="header-title">'.concat(o.title,"</div>"):"",'\n <div class="header-status" style="color: ').concat(o.onlineIndicatorColor||"rgba(255,255,255,0.7)",' !important;">\n <span class="status-dot" style="background: ').concat(o.onlineIndicatorDotColor||"#10b981",' !important;"></span>\n <span>').concat(void 0!==o.onlineIndicatorText&&null!==o.onlineIndicatorText?o.onlineIndicatorText:p("online"),'</span>\n </div>\n </div>\n \n <div style="display: flex; gap: 6px; align-items: center; position: relative; z-index: 1;">\n \x3c!-- New Chat Button (hide on landing screen, show otherwise) --\x3e\n <button class="header-icon new-chat-btn" id="newChatBtn" title="').concat(h("newChat"),'" style="').concat(l?"display: none;":"",'">\n <span style="font-size: 18px; font-weight: bold;">+</span>\n </button>\n \n \x3c!-- Back Button (only show in unified mode) --\x3e\n ').concat("unified"===c?'<button class="header-icon back-btn" id="backBtn" title="'.concat(h("back"),'" style="display: none;">\n <span style="font-size: 16px;">‹</span>\n </button>'):"","\n \n \x3c!-- Close Button --\x3e\n ").concat(o.showCloseButton?'<button class="header-icon close-btn" id="closeBtn" title="'+h("close")+'"><span style="font-size: 18px; font-weight: bold;">×</span></button>':"","\n </div>\n </div>\n\n ").concat(l&&this.landingScreen?this.landingScreen.generateHTML():"","\n\n ").concat(u?this.voiceInterface.generateHTML():"","\n ").concat(d?this.textInterface.generateHTML():"","\n ").concat(this.generateFooterHTML(),"\n </div>\n </div>\n </div>\n ")}},{key:"generateFooterHTML",value:function(){if(!this.config.footer.show)return"";var e=encodeURIComponent(window.location.hostname||"widget"),t="https://talktopc.com?ref=widget&source=".concat(e);return'\n <div class="widget-footer" style="\n padding: 10px 16px;\n text-align: center;\n border-top: 1px solid rgba(0,0,0,0.06);\n font-size: 11px;\n color: #64748b;\n background: #fff;\n flex-shrink: 0;\n ">\n <div class="powered-by" style="\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n ">\n <svg viewBox="0 0 24 24" fill="currentColor" style="width: 11px; height: 11px; color: #f59e0b;">\n <polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/>\n </svg>\n Powered by <a href="'.concat(t,'" target="_blank" rel="noopener noreferrer" style="color: #a855f7; text-decoration: none; font-weight: 500;" onmouseover="this.style.color=\'#9333ea\'" onmouseout="this.style.color=\'#a855f7\'">TalkToPC</a>\n </div>\n </div>\n ')}},{key:"generatePositionStyles",value:function(){var e=this.config.position,t=e.offset||{x:20,y:20},A="";return"top"===e.vertical?A+="top: ".concat(t.y,"px;"):"bottom"===e.vertical?A+="bottom: ".concat(t.y,"px;"):"center"===e.vertical&&(A+="top: 50%; transform: translateY(-50%);"),"left"===e.horizontal?A+="left: ".concat(t.x,"px;"):"right"===e.horizontal?A+="right: ".concat(t.x,"px;"):"center"===e.horizontal&&(A+="left: 50%; transform: translateX(-50%);"),A}},{key:"generateIconHTML",value:function(e){var t=this.config.icon;switch(t.type){case"custom":return'<img src="'.concat(t.customImage,'" alt="Chat Assistant" style="width: ').concat(e,"px; height: ").concat(e,'px; object-fit: contain;" />');case"emoji":return'<span style="font-size: '.concat(e,'px; line-height: 1;">').concat(t.emoji,"</span>");case"text":return'<span style="font-size: '.concat(Math.floor(.6*e),'px; font-weight: bold; color: white;">').concat(t.text,"</span>");case"microphone":default:return'<svg viewBox="0 0 24 24" style="width: '.concat(e,"px; height: ").concat(e,'px; fill: white;">\n <path d="M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"/>\n <path d="M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"/>\n </svg>');case"chat":return'<svg viewBox="0 0 24 24" style="width: '.concat(e,"px; height: ").concat(e,'px; fill: white;">\n <path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"/>\n </svg>')}}},{key:"generatePromptBubbleHTML",value:function(e,t){var A="#7c3aed";if(e.backgroundColor&&e.backgroundColor.includes("gradient")){var n=e.backgroundColor.match(/#[0-9a-fA-F]{6}/);n&&(A=n[0])}else A=e.backgroundColor;var o="none"===e.animationType?"":"animation-".concat(e.animationType),r=e.showShimmer?'<div class="prompt-bubble-shimmer"></div>':"";return'\n <div class="prompt-bubble '.concat(e.position," ").concat(o,'" \n id="prompt-bubble"\n role="tooltip"\n style="--prompt-bubble-bg-color: ').concat(A,';">\n <div class="prompt-bubble-content" \n style="background: ').concat(e.backgroundColor,"; color: ").concat(e.textColor,';">\n ').concat(r,'\n <span style="position: relative; z-index: 1;">').concat(e.text,'</span>\n </div>\n <div class="prompt-bubble-arrow"></div>\n </div>\n ')}},{key:"generatePulseRingsHTML",value:function(e){var t="#7c3aed";if(e.backgroundColor&&e.backgroundColor.includes("gradient")){var A=e.backgroundColor.match(/#[0-9a-fA-F]{6}/);A&&(t=A[0])}else t=e.backgroundColor;return'\n <div class="prompt-pulse-rings" id="prompt-pulse-rings">\n <div class="prompt-pulse-ring" style="background-color: '.concat(t,'33;"></div>\n <div class="prompt-pulse-ring" style="background-color: ').concat(t,'1a;"></div>\n </div>\n ')}},{key:"generateCSS",value:function(e,t,A){var n,o,r,i,a,s=this.config.button,c=this.config.icon,l=this.config.panel,u=this.config.header,d=(this.config.messages,this.config.animation),p=(null===(n=this.config.behavior)||void 0===n?void 0:n.mode)||"unified",h="unified"===p,g="unified"===p||"voice-only"===p,f="unified"===p||"text-only"===p,m=!1===this.config.useShadowDOM?" !important":"";return'\n /* MOBILE FIRST - Default styles for all devices */\n #text-chat-widget {\n position: fixed !important;\n z-index: 10000;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n /* Mobile defaults */\n right: 10px;\n bottom: 10px;\n left: auto;\n top: auto;\n }\n \n /* Desktop positioning (only on larger screens) */\n @media (min-width: 769px) {\n #text-chat-widget {\n '.concat(e,"\n right: ").concat("right"===this.config.position.horizontal?"20px":"auto",";\n left: ").concat("left"===this.config.position.horizontal?"20px":"auto",";\n bottom: ").concat("bottom"===this.config.position.vertical?"20px":"auto",";\n top: ").concat("top"===this.config.position.vertical?"20px":"auto",";\n }\n }\n \n /* Mobile override (force mobile positioning) */\n @media (max-width: 768px) {\n #text-chat-widget {\n right: 10px !important;\n bottom: 10px !important;\n left: auto !important;\n top: auto !important;\n transform: none !important;\n }\n }\n \n @media (max-width: 480px) {\n #text-chat-widget {\n right: 8px !important;\n bottom: 8px !important;\n left: auto !important;\n top: auto !important;\n }\n }\n \n #text-chat-button {\n position: relative;\n width: ").concat(t,"px;\n height: ").concat(t,"px;\n margin: 0;\n flex-shrink: 0;\n border-radius: ").concat("circle"===s.shape?"50%":"square"===s.shape?"0":"12px",";\n background: ").concat(s.backgroundColor||c.backgroundColor||"#7C3AED",";\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all ").concat(d.duration,"s ease;\n box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);\n touch-action: manipulation;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n user-select: none;\n min-width: 44px;\n min-height: 44px;\n z-index: 1;\n }\n \n @media (max-width: 768px) {\n #text-chat-widget {\n right: 10px !important;\n bottom: 10px !important;\n left: auto !important;\n top: auto !important;\n transform: none !important;\n }\n \n #text-chat-button-container {\n width: 56px !important;\n height: 56px !important;\n }\n \n #text-chat-button {\n width: 56px !important;\n height: 56px !important;\n min-width: 56px !important;\n min-height: 56px !important;\n max-width: 56px !important;\n max-height: 56px !important;\n }\n \n #text-chat-panel {\n position: fixed !important;\n left: 10px !important;\n right: 10px !important;\n bottom: 92px !important; /* 56px button + 20px gap + 16px footer */\n top: 60px !important; /* Add top spacing */\n width: auto !important;\n max-width: none !important;\n height: auto !important; /* Change from max-height to auto */\n max-height: none !important; /* Remove max-height */\n transform: none !important;\n margin: 0 !important;\n }\n \n #text-chat-panel .widget-header {\n padding: 10px 14px;\n min-height: 56px;\n }\n \n #text-chat-panel .header-title {\n font-size: 15px;\n }\n \n #text-chat-panel .header-icon {\n width: 40px;\n height: 40px;\n min-width: 40px;\n min-height: 40px;\n }\n \n #text-chat-input {\n font-size: 16px !important; /* Prevents iOS zoom on focus */\n padding: 12px 16px !important;\n min-height: 48px !important;\n }\n \n #text-chat-send {\n min-width: 48px !important;\n min-height: 48px !important;\n width: 48px !important;\n height: 48px !important;\n }\n \n .landing-screen {\n padding: 16px;\n }\n \n .landing-logo {\n font-size: 40px;\n }\n \n .landing-title {\n font-size: 18px;\n margin-bottom: 16px;\n }\n \n .mode-selection {\n flex-direction: column;\n gap: 12px;\n align-items: center;\n }\n \n .mode-card {\n max-width: 100%;\n width: 100%;\n padding: 16px;\n }\n \n .mode-card-icon {\n width: 50px;\n height: 50px;\n font-size: 28px;\n }\n \n .mode-card-title {\n font-size: 14px;\n }\n }\n \n @media (max-width: 480px) {\n #text-chat-widget {\n right: 8px !important;\n bottom: 8px !important;\n left: auto !important;\n top: auto !important;\n }\n \n #text-chat-button-container {\n width: 54px !important;\n height: 54px !important;\n }\n \n #text-chat-button {\n width: 54px !important;\n height: 54px !important;\n min-width: 54px !important;\n min-height: 54px !important;\n }\n \n #text-chat-panel {\n left: 8px !important;\n right: 8px !important;\n bottom: 86px !important; /* 54px button + 20px gap + 12px footer */\n top: 50px !important; /* Add top spacing for very small screens */\n height: auto !important;\n max-height: none !important;\n }\n \n #text-chat-panel .widget-header {\n padding: 8px 12px;\n min-height: 52px;\n }\n \n #text-chat-panel .header-title {\n font-size: 14px;\n }\n \n .landing-logo {\n font-size: 36px;\n }\n \n .landing-title {\n font-size: 16px;\n }\n }\n \n ").concat(d.enableHover?"\n #text-chat-button:hover {\n ".concat(s.hoverColor?"background: ".concat(s.hoverColor,";"):"","\n transform: scale(1.05);\n box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);\n }\n "):"","\n \n /* Prompt Animation Keyframes */\n @keyframes widget-shimmer {\n 0% { transform: translateX(-100%); }\n 100% { transform: translateX(200%); }\n }\n \n @keyframes widget-ripple {\n 0% { transform: scale(1); opacity: 0.6; }\n 100% { transform: scale(2.5); opacity: 0; }\n }\n \n @keyframes widget-float {\n 0%, 100% { transform: translateX(-50%) translateY(0); }\n 50% { transform: translateX(-50%) translateY(-8px); }\n }\n \n @keyframes widget-bounce {\n 0%, 100% { transform: translateX(-50%) translateY(0); }\n 50% { transform: translateX(-50%) translateY(-10px); }\n }\n \n @keyframes widget-pulse-ring {\n 0% { transform: scale(1); opacity: 0.4; }\n 100% { transform: scale(1.8); opacity: 0; }\n }\n \n /* Prompt Bubble Container */\n #text-chat-button-container {\n position: fixed;\n ").concat("bottom"===this.config.position.vertical?"bottom: ".concat((null===(o=this.config.position.offset)||void 0===o?void 0:o.y)||20,"px;"):"top: ".concat((null===(r=this.config.position.offset)||void 0===r?void 0:r.y)||20,"px;"),"\n ").concat("right"===this.config.position.horizontal?"right: ".concat((null===(i=this.config.position.offset)||void 0===i?void 0:i.x)||20,"px;"):"left: ".concat((null===(a=this.config.position.offset)||void 0===a?void 0:a.x)||20,"px;"),"\n width: ").concat(t,"px;\n height: ").concat(t,"px;\n z-index: 10001;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n \n @media (max-width: 768px) {\n #text-chat-button-container {\n right: 10px !important;\n bottom: 10px !important;\n left: auto !important;\n top: auto !important;\n }\n }\n \n @media (max-width: 480px) {\n #text-chat-button-container {\n right: 8px !important;\n bottom: 8px !important;\n left: auto !important;\n top: auto !important;\n }\n }\n \n /* Prompt Bubble Styles */\n .prompt-bubble {\n position: absolute;\n z-index: 10002;\n pointer-events: none;\n white-space: nowrap;\n }\n \n .prompt-bubble.top {\n bottom: calc(100% + 18px);\n left: 50%;\n transform: translateX(-50%);\n }\n \n .prompt-bubble.left {\n right: calc(100% + 12px);\n top: 50%;\n transform: translateY(-50%);\n }\n \n .prompt-bubble.right {\n left: calc(100% + 12px);\n top: 50%;\n transform: translateY(-50%);\n }\n \n /* Ensure animations preserve horizontal centering for top position */\n .prompt-bubble.top.animation-bounce {\n animation: widget-bounce 1s ease-in-out infinite;\n transform: translateX(-50%); /* Keep centering */\n }\n \n .prompt-bubble.top.animation-float {\n animation: widget-float 2s ease-in-out infinite;\n transform: translateX(-50%); /* Keep centering */\n }\n \n .prompt-bubble.top.animation-pulse {\n animation: pulse 2s ease-in-out infinite;\n transform: translateX(-50%); /* Keep centering */\n }\n \n .prompt-bubble-content {\n position: relative;\n padding: 8px 16px;\n border-radius: 20px;\n font-weight: 500;\n font-size: 14px;\n box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);\n overflow: hidden;\n }\n \n .prompt-bubble-shimmer {\n position: absolute;\n inset: 0;\n background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);\n animation: widget-shimmer 2s infinite;\n }\n \n .prompt-bubble.animation-bounce {\n animation: widget-bounce 1s ease-in-out infinite;\n }\n \n .prompt-bubble.animation-pulse {\n animation: pulse 2s ease-in-out infinite;\n }\n \n .prompt-bubble.animation-float {\n animation: widget-float 2s ease-in-out infinite;\n }\n \n /* Ensure top-positioned bubbles maintain horizontal centering during animations */\n .prompt-bubble.top.animation-bounce,\n .prompt-bubble.top.animation-float,\n .prompt-bubble.top.animation-pulse {\n /* Animation keyframes already include translateX(-50%) for centering */\n }\n \n /* Prompt Bubble Arrow */\n .prompt-bubble-arrow {\n position: absolute;\n width: 0;\n height: 0;\n border: 8px solid transparent;\n }\n \n .prompt-bubble.top .prompt-bubble-arrow {\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n border-top-color: var(--prompt-bubble-bg-color, #7c3aed);\n border-bottom: none;\n margin-left: 0;\n }\n \n .prompt-bubble.left .prompt-bubble-arrow {\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n border-left-color: var(--prompt-bubble-bg-color, #7c3aed);\n border-right: none;\n }\n \n .prompt-bubble.right .prompt-bubble-arrow {\n right: 100%;\n top: 50%;\n transform: translateY(-50%);\n border-right-color: var(--prompt-bubble-bg-color, #7c3aed);\n border-left: none;\n }\n \n /* Pulse Rings */\n .prompt-pulse-rings {\n position: absolute;\n inset: 0;\n border-radius: 50%;\n pointer-events: none;\n }\n \n .prompt-pulse-ring {\n position: absolute;\n inset: 0;\n border-radius: 50%;\n animation: widget-pulse-ring 2s ease-out infinite;\n }\n \n .prompt-pulse-ring:nth-child(2) {\n animation-delay: 0.5s;\n }\n \n /* Mobile adjustments for prompt bubble */\n @media (max-width: 768px) {\n .prompt-bubble-content {\n font-size: 12px;\n padding: 6px 12px;\n }\n \n .prompt-bubble.top {\n bottom: calc(100% + 14px);\n }\n \n .prompt-bubble.left,\n .prompt-bubble.right {\n display: none; /* Hide side prompts on mobile */\n }\n }\n \n #text-chat-panel {\n display: none").concat(m,";\n position: fixed;\n bottom: calc(").concat(t,"px + 20px + 20px); /* Button + gap + reduced footer offset */\n ").concat("right"===this.config.position.horizontal?"right: 20px;":"left: 20px;","\n width: ").concat(l.width,"px;\n max-width: calc(100vw - 40px);\n height: ").concat(l.height,"px;\n max-height: calc(100vh - ").concat(t,"px - 40px - 20px); /* Account for footer height */\n background: transparent;\n border-radius: ").concat(l.borderRadius,"px;\n border: none;\n flex-direction: column;\n overflow: hidden;\n ").concat(l.backdropFilter?"backdrop-filter: ".concat(l.backdropFilter,";"):"","\n ").concat(d.enableSlide?"transition: all ".concat(d.duration,"s ease;"):"","\n box-sizing: border-box;\n }\n \n #text-chat-panel.open {\n display: flex").concat(m,";\n ").concat(d.enableSlide?"transform: translateY(0); opacity: 1;":"","\n }\n\n /* Shell for gradient border/background */\n .widget-shell { width: 100%; height: 100%; padding: 0; border-radius: ").concat(l.borderRadius,"px; background: transparent; box-shadow: 0 20px 60px rgba(0,0,0,0.15); overflow: hidden; display: flex; flex-direction: column; box-sizing: border-box; }\n .panel-inner { width: 100%; height: 100%; background: #ffffff; border-radius: ").concat(l.borderRadius,"px; border: ").concat(l.border,"; overflow: hidden; display:flex; flex-direction: column; padding: 0; box-sizing: border-box; max-width: 100%; }\n\n /* New structure styles matching provided design */\n #text-chat-panel .widget-container {\n width: 100%; height: 100%; background: #FFFFFF; overflow: visible; display: flex; flex-direction: column; border-radius: ").concat(l.borderRadius,"px;\n container-type: size;\n }\n \n /* Ensure content areas can scroll when height is constrained */\n #text-chat-panel .widget-container > .landing-screen,\n #text-chat-panel .widget-container > .voice-interface,\n #text-chat-panel .widget-container > .text-interface {\n flex: 1;\n overflow-y: auto;\n overflow-x: visible; /* Change from hidden to visible */\n }\n \n /* Header should not scroll */\n #text-chat-panel .widget-header {\n padding: 14px 16px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-top-left-radius: ").concat(l.borderRadius,"px;\n border-top-right-radius: ").concat(l.borderRadius,"px;\n flex-shrink: 0;\n box-sizing: border-box;\n position: relative;\n overflow: hidden;\n background: ").concat(u.backgroundColor||"#7C3AED").concat(m,";\n color: ").concat(u.textColor||"#FFFFFF").concat(m,";\n }\n \n #text-chat-panel .widget-header::before {\n content: '';\n position: absolute;\n top: -50%;\n right: -20%;\n width: 180px;\n height: 180px;\n background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);\n pointer-events: none;\n }\n \n #text-chat-panel .widget-header > div:first-child {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 4px;\n position: relative;\n z-index: 1;\n }\n \n #text-chat-panel .header-title { font-size: 15px; font-weight: 600; margin: 0; }\n #text-chat-panel .header-status { display: flex; align-items: center; gap: 5px; font-size: 12px; margin: 0; }\n #text-chat-panel .status-dot { width: 6px; height: 6px; border-radius: 50%; animation: pulse 2s ease-in-out infinite; }\n /* Online indicator customization - inline styles take precedence */\n @keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.15); opacity: 0.8; } }\n /* Header icon buttons */\n .header-icon {\n background: rgba(255, 255, 255, 0.1);\n border: none;\n color: white;\n width: 34px;\n height: 34px;\n min-width: 34px;\n min-height: 34px;\n border-radius: 10px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: background 0.2s;\n flex-shrink: 0;\n font-size: 16px;\n padding: 0;\n box-sizing: border-box;\n position: relative;\n z-index: 1;\n }\n \n .header-icon:hover {\n background: rgba(255, 255, 255, 0.2);\n }\n \n .header-icon svg {\n pointer-events: none;\n stroke: white;\n fill: none;\n }\n \n .back-btn.visible {\n display: flex !important;\n }\n\n ").concat(h&&this.landingScreen?this.landingScreen.generateCSS():"","\n\n ").concat(g?this.voiceInterface.generateCSS():"","\n ").concat(f?this.textInterface.generateCSS():"","\n \n /* Footer Branding */\n .widget-footer {\n box-sizing: border-box;\n }\n \n .footer-brand-link {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n }\n \n .footer-brand-link:hover {\n opacity: 0.9;\n }\n \n @media (max-width: 768px) {\n .widget-footer {\n height: 32px;\n }\n .widget-footer span {\n font-size: 10px;\n }\n .widget-footer span:last-child {\n font-size: 8px;\n }\n }\n \n #text-chat-send-hint {\n text-align: center;\n line-height: 1.4;\n }\n \n .agent-thinking {\n font-style: italic;\n color: #6B7280;\n }\n ")}},{key:"setupWidgetEvents",value:function(){var e,t=this;if(this.shadowRoot){this.setupPromptAnimation();var A=this.shadowRoot.getElementById("text-chat-button");A&&(A.onclick=function(){t.config.promptAnimation.hideAfterClick&&t.hidePrompt(),t.togglePanel()});var n=this.shadowRoot.getElementById("closeBtn");n&&(n.onclick=function(){t._doTogglePanel()});var o,r=(null===(e=this.config.behavior)||void 0===e?void 0:e.mode)||"unified",i="unified"===r,a="unified"===r||"voice-only"===r,s="unified"===r||"text-only"===r,c=this.shadowRoot.getElementById("backBtn"),l=this.shadowRoot.getElementById("landingScreen"),u=this.shadowRoot.getElementById("textInterface"),d=this.shadowRoot.getElementById("voiceInterface");c&&(c.onclick=function(){var e,A,n;if(null!==(e=t.voiceInterface)&&void 0!==e&&e.isShowingDomainError)return console.log("🔙 Back button clicked - clearing domain error and returning to landing"),t.voiceInterface.isShowingDomainError=!1,null!==(n=t.voiceInterface)&&void 0!==n&&n.resetConnectingState&&t.voiceInterface.resetConnectingState(),void t.showLanding();null!==(A=t.voiceInterface)&&void 0!==A&&A.isActive?t.showBackButtonWarning():t.showLanding()}),i&&this.landingScreen?(this.landingScreen.setupEventHandlers({onSelectVoice:(o=mo(ho().m(function e(){var A,n,o,r,i,a,s,c,l,u,d,p,h,g,f,m,v,B,w,y,b,C,x,Q,F,U,S;return ho().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!t.isStartingCall){e.n=1;break}return console.log("⚠️ Call already starting, ignoring duplicate click"),e.a(2);case 1:if("function"==typeof t.config.onVoiceCallButtonClick)try{t.config.onVoiceCallButtonClick({timestamp:Date.now(),widgetState:"start"})}catch(e){console.error("Error in onVoiceCallButtonClick callback:",e)}if(t.isStartingCall=!0,e.p=2,t.showVoice(),null===(A=t.voiceInterface)||void 0===A||!A.isMobile){e.n=4;break}if((s=(null===(o=t.shadowRoot)||void 0===o?void 0:o.getElementById("text-chat-panel"))||document.getElementById("text-chat-panel"))&&(s.classList.remove("open"),s.style.display="none"),(c=null===(r=t.voiceInterface)||void 0===r||null===(r=r.shadowRoot)||void 0===r?void 0:r.getElementById("voiceIdleState"))&&(c.style.display="none"),(l=(null===(i=t.shadowRoot)||void 0===i?void 0:i.getElementById("text-chat-button"))||document.getElementById("text-chat-button"))&&(l.style.display="none"),null===(a=t.voiceInterface)||void 0===a||!a.createMobileMinimizedBar){e.n=3;break}return t.voiceInterface.createMobileMinimizedBar(),t.voiceInterface.updateMobileStatus("connecting"),e.n=3,new Promise(function(e){return requestAnimationFrame(function(){return requestAnimationFrame(e)})});case 3:e.n=5;break;case 4:null!==(u=t.voiceInterface)&&void 0!==u&&u.showConnectingState&&t.voiceInterface.showConnectingState();case 5:return e.n=6,t.startVoiceCall();case 6:if(null===(n=t.voiceInterface)||void 0===n||!n.isActive){e.n=7;break}console.log("✅ Voice call started successfully"),e.n=9;break;case 7:if(console.warn("⚠️ startVoiceCall() returned but call is not active"),g=null===(d=t.voiceInterface)||void 0===d||null===(d=d.shadowRoot)||void 0===d?void 0:d.getElementById("voiceIdleState"),f=!1,g&&"none"!==g.style.display&&(m=g.querySelector(".voice-status-title"))&&(B=m.textContent.trim(),w=null===(v=t.voiceInterface)||void 0===v?void 0:v.t("domainNotValidated"),console.log("🔍 Checking for domain error - titleText:",B,"domainErrorTitle:",w),(B===w||B.includes("Domain not")||B.includes("not whitelisted"))&&(f=!0,console.log("🚫 Domain error detected - staying on voice interface, NOT returning to landing"))),!f){e.n=8;break}return t.currentView="voice",t.showVoice(),console.log("✅ Staying on voice interface with domain error displayed"),e.a(2);case 8:console.log("⚠️ Not a domain error - returning to landing screen"),null!==(p=t.voiceInterface)&&void 0!==p&&p.resetConnectingState&&t.voiceInterface.resetConnectingState(),"unified"===((null===(h=t.config.behavior)||void 0===h?void 0:h.mode)||"unified")&&t.showLanding();case 9:e.n=12;break;case 10:if(e.p=10,!(S=e.v).isServerRejection&&"ServerRejected"!==S.name){e.n=11;break}return null!==(x=t.voiceInterface)&&void 0!==x&&x.resetConnectingState&&t.voiceInterface.resetConnectingState(),e.a(2);case 11:console.error("❌ Failed to start voice call:",S),null!==(y=t.voiceInterface)&&void 0!==y&&y.resetConnectingState&&t.voiceInterface.resetConnectingState(),null!==(b=t.voiceInterface)&&void 0!==b&&b.isMobile&&(document.getElementById("mobile-voice-call-bar-container")&&null!==(Q=t.voiceInterface)&&void 0!==Q&&Q.removeMobileMinimizedBar&&t.voiceInterface.removeMobileMinimizedBar(),(U=(null===(F=t.shadowRoot)||void 0===F?void 0:F.getElementById("text-chat-button"))||document.getElementById("text-chat-button"))&&(U.style.display="")),"Call cancelled by user"!==S.message&&t.showErrorToast(S.message||"Failed to start voice call. Please try again.","error"),"unified"===((null===(C=t.config.behavior)||void 0===C?void 0:C.mode)||"unified")&&t.showLanding();case 12:return e.p=12,t.isStartingCall=!1,e.f(12);case 13:return e.a(2)}},e,null,[[2,10,12,13]])})),function(){return o.apply(this,arguments)}),onSelectText:function(){return t.showText()}}),"text"===this.currentView?(l&&l.classList.remove("active"),u&&u.classList.add("active"),d&&d.classList.remove("active"),c&&"unified"===r&&c.classList.add("visible"),p&&(p.style.display="")):"voice"===this.currentView?(l&&l.classList.remove("active"),u&&u.classList.remove("active"),d&&d.classList.add("active"),c&&"unified"===r&&c.classList.add("visible"),p&&(p.style.display="none")):(this.currentView="landing",l&&l.classList.add("active"),u&&u.classList.remove("active"),d&&d.classList.remove("active"),c&&"unified"===r&&c.classList.remove("visible"))):"voice-only"===r?(d&&d.classList.add("active"),u&&u.classList.remove("active"),l&&l.classList.remove("active")):"text-only"===r&&(u&&u.classList.add("active"),d&&d.classList.remove("active"),l&&l.classList.remove("active")),a&&(console.log("⚙️ Setting up voice interface event handlers"),this.voiceInterface.setupEventHandlers()),s&&(console.log("⚙️ Setting up text interface event handlers"),this.textInterface.setupEventHandlers());var p=this.shadowRoot.getElementById("newChatBtn");p&&(p.onclick=function(){return t.textInterface.startNewChat()},i&&(p.style.display="none")),this.config.accessibility.keyboardNavigation&&this.setupKeyboardNavigation()}}},{key:"startNewChat",value:function(){this.textInterface.startNewChat()}},{key:"showLanding",value:function(){var e;if(this.shadowRoot){var t=null===(e=this.voiceInterface)||void 0===e||null===(e=e.shadowRoot)||void 0===e?void 0:e.getElementById("voiceIdleState");if(t&&"none"!==t.style.display){var A=t.querySelector(".voice-status-title");if(A){var n,o=A.textContent.trim();if(o===(null===(n=this.voiceInterface)||void 0===n?void 0:n.t("domainNotValidated"))||o.includes("Domain not")||o.includes("not whitelisted"))return void console.log("🚫 showLanding() called but domain error is displayed - preventing return to landing")}}if("unified"===(this.config.behavior.mode||"unified")){this.currentView="landing";var r=this.shadowRoot.getElementById("landingScreen"),i=this.shadowRoot.getElementById("textInterface"),a=this.shadowRoot.getElementById("voiceInterface"),s=this.shadowRoot.getElementById("backBtn"),c=this.shadowRoot.getElementById("newChatBtn");r&&r.classList.add("active"),i&&i.classList.remove("active"),a&&a.classList.remove("active"),s&&s.classList.remove("visible"),c&&(c.style.display="none")}}}},{key:"showText",value:function(){if(this.shadowRoot){this.currentView="text";var e=this.shadowRoot.getElementById("landingScreen"),t=this.shadowRoot.getElementById("voiceInterface"),A=this.shadowRoot.getElementById("backBtn"),n=this.shadowRoot.getElementById("newChatBtn");e&&e.classList.remove("active"),t&&t.classList.remove("active"),this.textInterface.show();var o=this.config.behavior.mode||"unified";A&&"unified"===o&&A.classList.add("visible"),n&&(n.style.display="")}}},{key:"showVoice",value:function(){if(this.shadowRoot){this.currentView="voice";var e=this.shadowRoot.getElementById("landingScreen"),t=this.shadowRoot.getElementById("textInterface"),A=this.shadowRoot.getElementById("voiceInterface"),n=this.shadowRoot.getElementById("backBtn"),o=this.shadowRoot.getElementById("newChatBtn");e&&e.classList.remove("active"),t&&t.classList.remove("active"),A&&A.classList.add("active");var r=this.config.behavior.mode||"unified";n&&"unified"===r&&n.classList.add("visible"),o&&(o.style.display="none")}}},{key:"setupKeyboardNavigation",value:function(){var e=this;document.addEventListener("keydown",function(t){"Escape"===t.key&&e.isOpen&&e.togglePanel()})}},{key:"setupPromptAnimation",value:function(){var e=this;if(this.shadowRoot){var t=this.config.promptAnimation||{},A=!0===t.enabled;if(console.log("🎨 setupPromptAnimation called:",{hasPromptConfig:!!this.config.promptAnimation,promptConfig:t,enabled:t.enabled,isPromptEnabled:A,isOpen:this.isOpen}),!A)return console.log("❌ Prompt disabled, hiding"),void this.hidePrompt();if(this.isOpen?this.hidePrompt():this.showPrompt(),!this.isOpen&&null!==t.hideAfterSeconds&&t.hideAfterSeconds>0&&(this.promptAutoHideTimer=setTimeout(function(){e.hidePrompt()},1e3*t.hideAfterSeconds)),this.voiceInterface&&this.voiceInterface.sdk){var n=this.config.onConversationStart;this.config.onConversationStart=function(){var t=e.shadowRoot.getElementById("prompt-pulse-rings");t&&(t.style.display="none"),n&&n.apply(void 0,arguments)},this.voiceInterface.sdk.voiceSDK&&this.voiceInterface.sdk.voiceSDK.on("recordingStarted",function(){var t=e.shadowRoot.getElementById("prompt-pulse-rings");t&&(t.style.display="none")})}}}},{key:"hidePrompt",value:function(){if(this.shadowRoot){this.promptAutoHideTimer&&(clearTimeout(this.promptAutoHideTimer),this.promptAutoHideTimer=null);var e=this.shadowRoot.getElementById("prompt-bubble");e||this.shadowRoot===document||(e=document.getElementById("prompt-bubble")),e&&(e.style.display="none",e.style.visibility="hidden");var t=this.shadowRoot.getElementById("prompt-pulse-rings");t||this.shadowRoot===document||(t=document.getElementById("prompt-pulse-rings")),t&&(t.style.display="none",t.style.visibility="hidden")}}},{key:"showPrompt",value:function(){var e=this;if(this.shadowRoot){var t=this.config.promptAnimation||{},A=!1!==t.enabled;if(console.log("👁️ showPrompt called:",{hasPromptConfig:!!this.config.promptAnimation,promptConfig:t,enabled:t.enabled,isPromptEnabled:A,shadowRoot:!!this.shadowRoot}),A){var n=function(){var A=e.shadowRoot.getElementById("prompt-bubble");if(A||e.shadowRoot===document||(A=document.getElementById("prompt-bubble")),A?(A.style.display="block",A.style.visibility="visible",A.style.opacity="1",console.log("✅ Prompt bubble shown:",A)):console.warn("⚠️ Prompt bubble not found in shadowRoot or document"),!1!==t.showPulseRings){var n=e.shadowRoot.getElementById("prompt-pulse-rings");n||e.shadowRoot===document||(n=document.getElementById("prompt-pulse-rings")),n&&(n.style.display="block",n.style.visibility="visible",n.style.opacity="1")}};n();var o=this.shadowRoot.getElementById("prompt-bubble"),r=!1!==t.showPulseRings?this.shadowRoot.getElementById("prompt-pulse-rings"):null;o&&(!1===t.showPulseRings||r)||(setTimeout(function(){n()},100),setTimeout(function(){n()},500)),null!==t.hideAfterSeconds&&t.hideAfterSeconds>0&&(this.promptAutoHideTimer&&clearTimeout(this.promptAutoHideTimer),this.promptAutoHideTimer=setTimeout(function(){e.hidePrompt()},1e3*t.hideAfterSeconds))}else console.log("❌ Prompt not enabled, skipping show")}}},{key:"togglePanel",value:function(){this.shadowRoot&&this._doTogglePanel()}},{key:"_doTogglePanel",value:function(){var e=this;if(this.shadowRoot){this.isOpen=!this.isOpen;var t=this.shadowRoot.getElementById("text-chat-panel");t&&t.classList.toggle("open"),this.isOpen?(this.hidePrompt(),setTimeout(function(){var t=e.shadowRoot.getElementById("messageInput");t&&t.focus()},100)):(this.showPrompt(),setTimeout(function(){var t,A=e.shadowRoot.getElementById("prompt-bubble");A&&"none"===A.style.display&&(A.style.display="block");var n=e.shadowRoot.getElementById("prompt-pulse-rings");n&&!1!==(null===(t=e.config.promptAnimation)||void 0===t?void 0:t.showPulseRings)&&"none"===n.style.display&&(n.style.display="block")},100)),this.isOpen&&!this.isActive&&this.config.behavior.autoConnect&&this.startChat()}}},{key:"showErrorToast",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"error",A=document.createElement("div");A.className="widget-toast widget-toast-".concat(t),A.textContent=e;var n="error"===t?"#ef4444":"warning"===t?"#f59e0b":"#3b82f6";if(Object.assign(A.style,{position:"fixed",bottom:"20px",left:"50%",transform:"translateX(-50%)",backgroundColor:n,color:"white",padding:"12px 24px",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",zIndex:"10000",fontSize:"14px",fontWeight:"500",maxWidth:"90%",textAlign:"center",animation:"slideUp 0.3s ease-out",fontFamily:"inherit"}),!document.getElementById("widget-toast-styles")){var o=document.createElement("style");o.id="widget-toast-styles",o.textContent="\n @keyframes slideUp {\n from {\n opacity: 0;\n transform: translateX(-50%) translateY(20px);\n }\n to {\n opacity: 1;\n transform: translateX(-50%) translateY(0);\n }\n }\n @keyframes slideDown {\n from {\n opacity: 1;\n transform: translateX(-50%) translateY(0);\n }\n to {\n opacity: 0;\n transform: translateX(-50%) translateY(20px);\n }\n }\n ",document.head.appendChild(o)}(this.shadowRoot||document.body).appendChild(A),setTimeout(function(){A.style.animation="slideDown 0.3s ease-out",setTimeout(function(){A.parentNode&&A.parentNode.removeChild(A)},300)},4e3)}},{key:"showConfirmModal",value:function(e){var t=e.title,A=void 0===t?"Confirm":t,n=e.message,o=void 0===n?"Are you sure?":n,r=e.confirmText,i=void 0===r?"Confirm":r,a=e.cancelText,s=void 0===a?"Cancel":a,c=e.confirmButtonClass,l=void 0===c?"primary":c,u=e.onConfirm,d=e.onCancel,p=document.createElement("div");p.className="widget-modal-overlay",p.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n ";var h=document.createElement("div");h.className="widget-confirm-modal",h.style.cssText="\n background: white;\n border-radius: 12px;\n padding: 24px;\n max-width: 400px;\n width: 90%;\n box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);\n ";var g="danger"===l?"widget-modal-btn--danger":"widget-modal-btn--primary";h.innerHTML='\n <h3 style="margin: 0 0 12px 0; font-size: 18px; font-weight: 600; color: #1e293b;">'.concat(A,'</h3>\n <p style="margin: 0 0 24px 0; color: #64748b; font-size: 14px; line-height: 1.5;">').concat(o,'</p>\n <div style="display: flex; gap: 12px; justify-content: flex-end;">\n <button class="widget-modal-btn widget-modal-btn--cancel" data-action="cancel" style="\n padding: 10px 20px;\n border: 1px solid #e2e8f0;\n background: white;\n color: #64748b;\n border-radius: 8px;\n cursor: pointer;\n font-size: 14px;\n font-weight: 500;\n ">\n ').concat(s,'\n </button>\n <button class="widget-modal-btn ').concat(g,'" data-action="confirm" style="\n padding: 10px 20px;\n border: none;\n background: ').concat("danger"===l?"#ef4444":"#7c3aed",';\n color: white;\n border-radius: 8px;\n cursor: pointer;\n font-size: 14px;\n font-weight: 500;\n ">\n ').concat(i,"\n </button>\n </div>\n "),p.appendChild(h),(this.shadowRoot||document.body).appendChild(p),h.querySelector('[data-action="confirm"]').onclick=function(){p.remove(),null==u||u()},h.querySelector('[data-action="cancel"]').onclick=function(){p.remove(),null==d||d()},p.onclick=function(e){e.target===p&&(p.remove(),null==d||d())}}},{key:"startChat",value:(i=mo(ho().m(function e(){return ho().w(function(e){for(;;)switch(e.n){case 0:this.isActive=!0,this.textInterface.setActive(!0);case 1:return e.a(2)}},e,this)})),function(){return i.apply(this,arguments)})},{key:"sendMessage",value:(r=mo(ho().m(function e(){return ho().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.textInterface.sendMessage();case 1:return e.a(2)}},e,this)})),function(){return r.apply(this,arguments)})},{key:"updateSendButtonState",value:function(){this.textInterface.updateSendButtonState()}},{key:"showBackButtonWarning",value:function(){var e,t;null!==(e=this.voiceInterface)&&void 0!==e&&e.isActive&&null!==(t=this.voiceInterface.desktop)&&void 0!==t&&t.showBackButtonWarning&&this.voiceInterface.desktop.showBackButtonWarning()}},{key:"getSignedUrl",value:(o=mo(ho().m(function e(){var t,A,n;return ho().w(function(e){for(;;)switch(e.n){case 0:if(!this.config.signedUrl){e.n=1;break}return e.a(2,this.config.signedUrl);case 1:if(this.config.agentId){e.n=2;break}throw new Error("agentId is required when signedUrl is not provided");case 2:return t=this.config.websocketUrl||"wss://backend.talktopc.com/ws/conv",(A=new URLSearchParams).append("agentId",this.config.agentId),this.config.appId&&A.append("appId",this.config.appId),!1!==this.config.demo&&A.append("demo","true"),n="".concat(t,"?").concat(A.toString()),e.a(2,n)}},e,this)})),function(){return o.apply(this,arguments)})},{key:"addMessage",value:function(e,t){this.textInterface.addMessage(e,t)}},{key:"beginStreaming",value:function(){this.textInterface.beginStreaming()}},{key:"appendStreamingChunk",value:function(e){this.textInterface.appendStreamingChunk(e)}},{key:"finalizeStreaming",value:function(e){this.textInterface.finalizeStreaming(e)}},{key:"stopStreamingState",value:function(){this.textInterface.stopStreamingState()}},{key:"showError",value:function(e){this.textInterface.showError(e)}},{key:"updateStatus",value:function(e){}},{key:"updateConfig",value:function(e){var t,A,n,o,r,i,a,s,c,l,u=wo({},this.config);e.panel&&(u.panel=wo(wo({},this.config.panel),e.panel)),e.voice&&(u.voice=wo(wo({},this.config.voice),e.voice),e.voice.micButtonHint&&(u.voice.micButtonHint=wo(wo({},null===(c=this.config.voice)||void 0===c?void 0:c.micButtonHint),e.voice.micButtonHint))),e.text&&(u.text=wo(wo({},this.config.text),e.text),e.text.sendButtonHint&&(u.text.sendButtonHint=wo(wo({},null===(l=this.config.text)||void 0===l?void 0:l.sendButtonHint),e.text.sendButtonHint))),void 0!==e.language&&(u.language=e.language),void 0!==e.language&&(["he","ar"].includes(e.language)?u.direction="rtl":void 0===e.direction&&(u.direction="ltr")),e.translations&&(u.translations=e.translations,this.translations=e.translations),e.button&&(u.button=wo(wo({},this.config.button),e.button)),e.header&&(u.header=wo(wo({},this.config.header),e.header)),e.icon&&(u.icon=wo(wo({},this.config.icon),e.icon)),e.messages&&(u.messages=wo(wo({},this.config.messages),e.messages)),e.animation&&(u.animation=wo(wo({},this.config.animation),e.animation)),e.behavior&&(u.behavior=wo(wo({},this.config.behavior),e.behavior)),e.accessibility&&(u.accessibility=wo(wo({},this.config.accessibility),e.accessibility)),e.tooltips&&(u.tooltips=wo(wo({},this.config.tooltips),e.tooltips)),e.landing&&(u.landing=wo(wo({},this.config.landing),e.landing)),e.footer&&(u.footer=wo(wo({},this.config.footer),e.footer)),void 0!==e.direction&&void 0===u.direction&&(u.direction=e.direction),void 0!==e.primaryColor&&(u.primaryColor=e.primaryColor),u.onConversationStart=void 0!==e.onConversationStart?e.onConversationStart:this.config.onConversationStart,u.onConversationEnd=void 0!==e.onConversationEnd?e.onConversationEnd:this.config.onConversationEnd,u.onBargeIn=void 0!==e.onBargeIn?e.onBargeIn:this.config.onBargeIn,u.onAudioStartPlaying=void 0!==e.onAudioStartPlaying?e.onAudioStartPlaying:this.config.onAudioStartPlaying,u.onAudioStoppedPlaying=void 0!==e.onAudioStoppedPlaying?e.onAudioStoppedPlaying:this.config.onAudioStoppedPlaying,u.onSubtitleDisplay=void 0!==e.onSubtitleDisplay?e.onSubtitleDisplay:this.config.onSubtitleDisplay,u.onVoiceCallButtonClick=void 0!==e.onVoiceCallButtonClick?e.onVoiceCallButtonClick:this.config.onVoiceCallButtonClick,void 0!==e.useShadowDOM&&(u.useShadowDOM=e.useShadowDOM),Object.keys(e).forEach(function(t){["panel","button","header","footer","icon","messages","direction","voice","text","animation","behavior","accessibility","language","tooltips","landing","primaryColor","useShadowDOM","onConversationStart","onConversationEnd","onBargeIn","onAudioStartPlaying","onAudioStoppedPlaying","onSubtitleDisplay","onVoiceCallButtonClick"].includes(t)||(u[t]=e[t])}),null===(t=this.config)||void 0===t||t.language;var d=!1!==(null===(A=this.config)||void 0===A?void 0:A.useShadowDOM);if(this.config=this.mergeWithDefaults(u),!1!==this.config.useShadowDOM===d&&this.container){var p=document.getElementById("ttp-widget-shadow-host");p&&!this.config.useShadowDOM&&p.remove();var h=document.getElementById("ttp-widget-container");if(h&&this.config.useShadowDOM&&h.remove(),this.config.useShadowDOM)if(this.shadowRoot)this.container=this.shadowRoot;else{var g=document.getElementById("ttp-widget-shadow-host");g?(this.shadowRoot=g.shadowRoot,this.container=this.shadowRoot):(this.createShadowHost(),this.container=this.shadowRoot)}else{if(this.regularContainer)this.container=this.regularContainer;else{var f=document.getElementById("ttp-widget-container");f?(this.regularContainer=f,this.container=f):(this.createRegularContainer(),this.container=this.regularContainer)}this.shadowRoot=document}}else{var m=document.getElementById("ttp-widget-shadow-host");m&&m.remove();var v=document.getElementById("ttp-widget-container");if(v&&v.remove(),!1===d){var B=document.getElementById("ttp-widget-styles");B&&B.remove()}this.config.useShadowDOM?(this.createShadowHost(),this.container=this.shadowRoot):(this.createRegularContainer(),this.container=this.regularContainer,this.shadowRoot=document)}var w=this.config.language||"en",y=wo(wo(wo({},this.config),this.config.voice),{},{language:w,translations:this.translations,shadowRoot:this.shadowRoot,signedUrl:this.config.signedUrl,agentSettingsOverride:this.config.agentSettingsOverride,visualAssistant:this.config.visualAssistant,outputContainer:(null===(n=this.config.voice)||void 0===n?void 0:n.outputContainer)||"raw",outputEncoding:(null===(o=this.config.voice)||void 0===o?void 0:o.outputEncoding)||"pcm",outputSampleRate:(null===(r=this.config.voice)||void 0===r?void 0:r.outputSampleRate)||44100,outputChannels:(null===(i=this.config.voice)||void 0===i?void 0:i.outputChannels)||1,outputBitDepth:(null===(a=this.config.voice)||void 0===a?void 0:a.outputBitDepth)||16,onConversationStart:this.config.onConversationStart,onConversationEnd:this.config.onConversationEnd,onBargeIn:this.config.onBargeIn,onAudioStartPlaying:this.config.onAudioStartPlaying,onAudioStoppedPlaying:this.config.onAudioStoppedPlaying,onSubtitleDisplay:this.config.onSubtitleDisplay});this.voiceInterface=new $n(y);var b=wo(wo(wo({},this.config),this.config.text),{},{language:w,translations:this.translations,shadowRoot:this.shadowRoot});if(this.textInterface=new ao(b,this.sdk),"unified"===((null===(s=this.config.behavior)||void 0===s?void 0:s.mode)||"unified")){var C=wo(wo({},this.config),{},{translations:this.translations,shadowRoot:this.shadowRoot});this.landingScreen=new uo(C)}else this.landingScreen=null;this.createWidget(),this.textInterface&&this.textInterface.updateInputAttributes&&this.textInterface.updateInputAttributes()}},{key:"destroy",value:function(){this.promptAutoHideTimer&&(clearTimeout(this.promptAutoHideTimer),this.promptAutoHideTimer=null);var e=document.getElementById("ttp-widget-shadow-host");e&&e.remove();var t=document.getElementById("ttp-widget-container");t&&t.remove();var A=document.getElementById("ttp-widget-styles");A&&A.remove(),this.sdk&&this.sdk.destroy(),this.voiceInterface&&this.voiceInterface.destroy()}},{key:"startVoiceCall",value:(n=mo(ho().m(function e(){return ho().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.voiceInterface.startVoiceCall();case 1:this._flushPendingClientTools();case 2:return e.a(2)}},e,this)})),function(){return n.apply(this,arguments)})},{key:"endVoiceCall",value:function(){this.voiceInterface.endVoiceCall()}},{key:"toggleMute",value:function(){this.voiceInterface.toggleMute()}},{key:"toggleSpeaker",value:function(){this.voiceInterface.toggleSpeaker()}},{key:"injectData",value:(A=mo(ho().m(function e(t){var A,n,o,r,i=arguments;return ho().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=i.length>1&&void 0!==i[1]?i[1]:{},t&&t.trim()){e.n=1;break}throw console.warn("TTPChatWidget: Cannot inject empty data"),new Error("Cannot inject empty data");case 1:if(this.voiceInterface&&this.voiceInterface.isActive){e.n=2;break}throw console.warn("TTPChatWidget: Cannot inject data - voice call is not active"),new Error("Voice call is not active");case 2:if(o=null===(A=this.voiceInterface)||void 0===A?void 0:A.getVoiceSDK()){e.n=3;break}throw console.warn("TTPChatWidget: VoiceSDK not available"),new Error("VoiceSDK not available");case 3:return e.p=3,e.n=4,o.injectData(t,wo(wo({},n),{},{source:n.source||"widget_programmatic"}));case 4:return r=e.v,e.a(2,r);case 5:throw e.p=5,e.v;case 6:return e.a(2)}},e,this,[[3,5]])})),function(e){return A.apply(this,arguments)})},{key:"registerToolHandler",value:function(e,t){var A;return null!==(A=this.voiceInterface)&&void 0!==A&&A.sdk?this.voiceInterface.sdk.registerToolHandler(e,t):(this._pendingClientTools=this._pendingClientTools||[],this._pendingClientTools.push({name:e,handler:t}),console.warn("TTPChatWidget: Tool handler queued - voice interface SDK not ready yet"),this._flushPendingClientTools(),this)}},{key:"unregisterToolHandler",value:function(e){var t;return null!==(t=this.voiceInterface)&&void 0!==t&&t.sdk?this.voiceInterface.sdk.unregisterToolHandler(e):(this._pendingClientTools&&(this._pendingClientTools=this._pendingClientTools.filter(function(t){return t.name!==e})),this)}},{key:"hasToolHandler",value:function(e){var t;return!(null===(t=this.voiceInterface)||void 0===t||!t.sdk)&&this.voiceInterface.sdk.hasToolHandler(e)}},{key:"getRegisteredTools",value:function(){var e;return null!==(e=this.voiceInterface)&&void 0!==e&&e.sdk?this.voiceInterface.sdk.getRegisteredTools():this._pendingClientTools?this._pendingClientTools.map(function(e){return e.name}):[]}},{key:"_flushPendingClientTools",value:function(){var e,t=this;this._pendingClientTools&&null!==(e=this.voiceInterface)&&void 0!==e&&e.sdk&&(this._pendingClientTools.forEach(function(e){var A=e.name,n=e.handler;t.voiceInterface.sdk.registerToolHandler(A,n)}),this._pendingClientTools=null,console.log("TTPChatWidget: Flushed pending client tools"))}},{key:"registerClientTool",value:function(e,t){return this.registerToolHandler(e,t)}},{key:"unregisterClientTool",value:function(e){return this.unregisterToolHandler(e)}},{key:"hasClientTool",value:function(e){return this.hasToolHandler(e)}},{key:"getRegisteredClientTools",value:function(){return this.getRegisteredTools()}}],t&&bo(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,A,n,o,r,i}();function Qo(e){return Qo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qo(e)}function Fo(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),A.push.apply(A,n)}return A}function Uo(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?Fo(Object(A),!0).forEach(function(t){So(e,t,A[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):Fo(Object(A)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}return e}function So(e,t,A){return(t=Eo(t))in e?Object.defineProperty(e,t,{value:A,enumerable:!0,configurable:!0,writable:!0}):e[t]=A,e}function ko(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Eo(n.key),n)}}function Eo(e){var t=function(e){if("object"!=Qo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Qo(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Qo(t)?t:t+""}var Io=function(){return e=function e(t){var A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.product=t,this.compact=A.compact||!1,this.onAdd=A.onAdd||function(){},this.element=null;var n=t.sellBy||t.sell_by||"quantity";this.sellBy=n,this.step="weight"===n?.5:1,this.min="weight"===n?.5:1,this.unit="weight"===n?"kg":"";var o=t.cartQuantity||t.cart_quantity||0;this.inCart=o>0,this.amount=this.inCart?o:this.min},t=[{key:"_generateStepperHTML",value:function(){var e="weight"===this.sellBy?"".concat(this.amount.toFixed(1)," ").concat(this.unit):"".concat(this.amount);return'\n <div class="ttp-stepper" data-sell-by="'.concat(this.sellBy,'">\n <button class="ttp-stepper-btn ttp-stepper-minus" type="button">−</button>\n <span class="ttp-stepper-value">').concat(e,'</span>\n <button class="ttp-stepper-btn ttp-stepper-plus" type="button">+</button>\n </div>\n ')}},{key:"_updateStepperDisplay",value:function(e,t){"weight"===this.sellBy?e.textContent="".concat(this.amount.toFixed(1)," ").concat(this.unit):e.textContent="".concat(this.amount),t.disabled=this.amount<=this.min,t.classList.toggle("ttp-stepper-disabled",this.amount<=this.min)}},{key:"render",value:function(){var e=this,t=document.createElement("div");t.className=this.compact?"ttp-product-compact":"ttp-product-card";var A=this.product,n="ILS"===A.currency?"₪":"$",o=this.inCart?"Update":"Add",r=this.inCart?"ttp-add-btn ttp-update-btn":"ttp-add-btn";this.compact?t.innerHTML='\n <div class="ttp-product-image-sm">\n <img src="'.concat(A.imageUrl,'" alt="').concat(A.name,'" onerror="this.style.display=\'none\'" />\n </div>\n <div class="ttp-product-info">\n <div class="ttp-product-name">').concat(A.name,'</div>\n <div class="ttp-product-meta">').concat(A.unit," · ").concat(A.brand,'</div>\n </div>\n <div class="ttp-product-action">\n <div class="ttp-product-price">').concat(n).concat(A.price.toFixed(2),"</div>\n ").concat(A.inStock?'<button class="'.concat(r,'">').concat(o,"</button>"):'<span class="ttp-out-of-stock">Out of stock</span>',"\n ").concat(this._generateStepperHTML(),"\n </div>\n "):t.innerHTML='\n <div class="ttp-product-image">\n <img src="'.concat(A.imageUrl,'" alt="').concat(A.name,'" onerror="this.style.display=\'none\'" />\n ').concat(A.inStock?"":'<div class="ttp-stock-badge">Out of stock</div>','\n </div>\n <div class="ttp-product-details">\n <div class="ttp-product-name">').concat(A.name,'</div>\n <div class="ttp-product-meta">').concat(A.unit,'</div>\n <div class="ttp-product-footer">\n <span class="ttp-product-price">').concat(n).concat(A.price.toFixed(2),"</span>\n ").concat(A.inStock?'<button class="'.concat(r,'">').concat(o,"</button>"):'<span class="ttp-out-of-stock">Out of stock</span>',"\n ").concat(this._generateStepperHTML(),"\n </div>\n </div>\n ");var i=t.querySelector(".ttp-add-btn");i&&i.addEventListener("click",function(t){t.stopPropagation(),i.textContent="✓",i.classList.add("ttp-added"),i.disabled=!0,e.onAdd(Uo(Uo({},e.product),{},{selectedAmount:e.amount,sellBy:e.sellBy})),e.inCart=!0,setTimeout(function(){i.textContent="Update",i.classList.remove("ttp-added"),i.classList.add("ttp-update-btn"),i.disabled=!1},1500)});var a=t.querySelector(".ttp-stepper-minus"),s=t.querySelector(".ttp-stepper-plus"),c=t.querySelector(".ttp-stepper-value");return a&&s&&c&&(a.addEventListener("click",function(t){t.stopPropagation(),e.amount>e.min&&(e.amount=Math.round(10*(e.amount-e.step))/10,e._updateStepperDisplay(c,a))}),s.addEventListener("click",function(t){t.stopPropagation(),e.amount=Math.round(10*(e.amount+e.step))/10,e._updateStepperDisplay(c,a)}),this._updateStepperDisplay(c,a)),this.element=t,t}}],t&&ko(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function To(e){return To="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},To(e)}function Ho(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Do(n.key),n)}}function Do(e){var t=function(e){if("object"!=To(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=To(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==To(t)?t:t+""}var Po=function(){return e=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.onProductAdd=t.onProductAdd||function(){},this.onClose=t.onClose||function(){},this.element=null},(t=[{key:"show",value:function(e,t,A){var n=this;this.hide();var o=document.createElement("div");o.className="ttp-product-picker",o.setAttribute("data-layout",A);var r=document.createElement("div");r.className="ttp-picker-header",r.innerHTML='\n <span class="ttp-picker-title">'.concat(t,'</span>\n <button class="ttp-picker-close">✕</button>\n '),r.querySelector(".ttp-picker-close").addEventListener("click",function(){n.hide(),n.onClose()}),o.appendChild(r);var i=document.createElement("div");return i.className="cards"===A?"ttp-products-horizontal":"ttp-products-vertical",e.forEach(function(e){var t=new Io(e,{compact:"list"===A,onAdd:function(e){return n.onProductAdd(e)}});i.appendChild(t.render())}),o.appendChild(i),this.element=o,o}},{key:"hide",value:function(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=null}}])&&Ho(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Oo(e){return Oo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Oo(e)}function Ko(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Mo(n.key),n)}}function Mo(e){var t=function(e){if("object"!=Oo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Oo(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Oo(t)?t:t+""}var Lo=function(){return e=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.onUndo=t.onUndo||function(){},this.element=null,this.dismissTimer=null},(t=[{key:"show",value:function(e){var t=this;this.hide();var A=document.createElement("div");return A.className="ttp-cart-toast",A.innerHTML='\n <div class="ttp-toast-icon">✓</div>\n <div class="ttp-toast-content">\n <div class="ttp-toast-title">Added to cart!</div>\n <div class="ttp-toast-product">'.concat(e.name,'</div>\n </div>\n <button class="ttp-toast-undo">Undo</button>\n '),A.querySelector(".ttp-toast-undo").addEventListener("click",function(){t.onUndo(e),t.hide()}),this.element=A,this.dismissTimer=setTimeout(function(){return t.hide()},3e3),A}},{key:"hide",value:function(){if(this.dismissTimer&&(clearTimeout(this.dismissTimer),this.dismissTimer=null),this.element&&this.element.parentNode){this.element.classList.add("ttp-toast-hiding");var e=this.element;setTimeout(function(){e&&e.parentNode&&e.parentNode.removeChild(e)},300),this.element=null}}}])&&Ko(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Ro(e){return Ro="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ro(e)}function _o(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Vo(n.key),n)}}function Vo(e){var t=function(e){if("object"!=Ro(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Ro(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ro(t)?t:t+""}var jo=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=null,this.itemCount=0,this.total=0},(t=[{key:"render",value:function(){var e=document.createElement("div");return e.className="ttp-cart-summary",e.style.display="none",e.innerHTML='\n <div class="ttp-cart-info">\n <span class="ttp-cart-icon">🛒</span>\n <span class="ttp-cart-count">0 items</span>\n </div>\n <span class="ttp-cart-total">₪0.00</span>\n ',this.element=e,e}},{key:"update",value:function(e,t){this.itemCount=e,this.total=t,this.element&&(this.element.style.display=e>0?"flex":"none",this.element.querySelector(".ttp-cart-count").textContent="".concat(e," item").concat(1!==e?"s":""),this.element.querySelector(".ttp-cart-total").textContent="₪".concat(t.toFixed(2)))}}])&&_o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function No(e){return No="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},No(e)}function Go(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Wo(n.key),n)}}function Wo(e){var t=function(e){if("object"!=No(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=No(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==No(t)?t:t+""}var zo=function(){return e=function e(){var t=this,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.shadowRoot=A.shadowRoot,this.onProductSelected=A.onProductSelected||function(){},this.onProductDeselected=A.onProductDeselected||function(){},this.productPicker=new Po({onProductAdd:function(e){return t._handleAdd(e)},onClose:function(){return t._handlePickerClose()}}),this.cartToast=new Lo({onUndo:function(e){return t._handleUndo(e)}}),this.cartSummary=new jo,this.container=document.createElement("div"),this.container.id="ttpEcommerceArea",this.container.className="ttp-ecommerce-area",this.container.appendChild(this.cartSummary.render()),this.isAttached=!1},(t=[{key:"injectStyles",value:function(){if(this.shadowRoot){var e="\n\n/* ═══════════════════════════════════════\n ECOMMERCE AREA\n ═══════════════════════════════════════ */\n\n/*\n * When products are visible, expand the panel to 800px.\n * When the class is removed, the panel returns to its CSS-defined default.\n */\n#text-chat-panel.ttp-panel-expanded {\n height: 800px !important;\n}\n\n/*\n * Layout overrides when ecommerce layer is active.\n * voiceActiveState is a flex column: [voice-controls] [ecommerce] [conversation].\n * Ecommerce area fills the middle and scrolls; conversation panel stays at bottom.\n */\n#voiceActiveState {\n flex: 1 1 0 !important;\n min-height: 0 !important;\n overflow: hidden !important;\n}\n\n.desktop-voice-section {\n flex-shrink: 1 !important;\n}\n\n.desktop-conversation-panel {\n flex: 1 1 0 !important;\n min-height: 0 !important;\n display: flex !important;\n flex-direction: column !important;\n}\n\n.desktop-conversation-panel .live-transcript-collapsed {\n flex: 1 1 0 !important;\n min-height: 40px !important;\n overflow: hidden !important;\n}\n\n.desktop-conversation-panel .voice-text-input-area {\n margin-top: auto !important;\n padding: 3px 16px !important;\n}\n\n.desktop-conversation-panel .voice-input-hint {\n display: none !important;\n}\n\n#voiceActiveState.ttp-products-visible .desktop-voice-section {\n display: none !important;\n}\n\n#voiceActiveState.ttp-products-visible .compact-voice-section {\n display: flex !important;\n}\n\n#voiceActiveState.ttp-products-visible .desktop-conversation-panel {\n flex: 0 0 auto !important;\n}\n\n#voiceActiveState.ttp-products-visible .conversation-history {\n display: none !important;\n}\n\n#voiceActiveState.ttp-products-visible .live-transcript-collapsed {\n flex: 0 0 auto !important;\n}\n\n.voice-text-input-area {\n flex-shrink: 0 !important;\n}\n\n.conversation-history {\n flex: 1 1 0 !important;\n min-height: 0 !important;\n overflow-y: auto !important;\n}\n\n.ttp-ecommerce-area {\n display: flex;\n flex-direction: column;\n width: 100%;\n flex: 1 1 0;\n min-height: 0;\n overflow-x: hidden;\n overflow-y: auto;\n position: relative;\n}\n\n/* ═══════════════════════════════════════\n PRODUCT PICKER\n ═══════════════════════════════════════ */\n\n.ttp-product-picker {\n background: #fff;\n border-radius: 14px;\n border: 1px solid #e5e7eb;\n box-shadow: 0 6px 24px rgba(0,0,0,0.08);\n margin: 8px 12px;\n overflow: hidden;\n animation: ttpSlideUp 0.25s ease;\n display: flex;\n flex-direction: column;\n}\n\n@keyframes ttpSlideUp {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n}\n\n.ttp-picker-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 10px 14px;\n border-bottom: 1px solid #f1f5f9;\n flex-shrink: 0;\n}\n\n.ttp-picker-title {\n font-size: 12px;\n font-weight: 600;\n color: #64748b;\n}\n\n.ttp-picker-close {\n background: none;\n border: none;\n cursor: pointer;\n color: #94a3b8;\n font-size: 14px;\n padding: 2px 6px;\n border-radius: 4px;\n}\n.ttp-picker-close:hover {\n background: #f1f5f9;\n color: #475569;\n}\n\n/* Horizontal card layout */\n.ttp-products-horizontal {\n display: flex;\n gap: 10px;\n padding: 12px;\n overflow-x: auto;\n -webkit-overflow-scrolling: touch;\n scrollbar-width: thin;\n}\n.ttp-products-horizontal::-webkit-scrollbar { height: 4px; }\n.ttp-products-horizontal::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }\n\n/* Vertical list layout */\n.ttp-products-vertical {\n padding: 8px 12px;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n min-height: 0;\n}\n\n/* ═══════════════════════════════════════\n PRODUCT CARD (horizontal)\n ═══════════════════════════════════════ */\n\n.ttp-product-card {\n width: 140px;\n flex-shrink: 0;\n background: #fff;\n border-radius: 12px;\n border: 1px solid #e5e7eb;\n overflow: hidden;\n transition: border-color 0.15s;\n}\n.ttp-product-card:hover { border-color: #3b82f6; }\n\n.ttp-product-image {\n height: 85px;\n background: #f8fafc;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n overflow: hidden;\n}\n.ttp-product-image img {\n max-width: 90%;\n max-height: 75px;\n object-fit: contain;\n}\n\n.ttp-stock-badge {\n position: absolute;\n top: 4px; right: 4px;\n background: #fef2f2;\n color: #ef4444;\n font-size: 9px;\n font-weight: 600;\n padding: 2px 6px;\n border-radius: 4px;\n}\n\n.ttp-product-details {\n padding: 8px 10px 10px;\n}\n\n.ttp-product-name {\n font-size: 12px;\n font-weight: 600;\n color: #1e293b;\n line-height: 1.3;\n min-height: 30px;\n}\n\n.ttp-product-meta {\n font-size: 10px;\n color: #94a3b8;\n margin-top: 2px;\n}\n\n.ttp-product-footer {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-top: 6px;\n}\n\n.ttp-product-price {\n font-size: 14px;\n font-weight: 700;\n color: #1e293b;\n}\n\n/* ═══════════════════════════════════════\n PRODUCT COMPACT (list view)\n ═══════════════════════════════════════ */\n\n.ttp-product-compact {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 8px 10px;\n background: #fff;\n border-radius: 10px;\n border: 1px solid #e5e7eb;\n transition: border-color 0.15s;\n}\n.ttp-product-compact:hover { border-color: #3b82f6; }\n\n.ttp-product-image-sm {\n width: 40px; height: 40px;\n border-radius: 8px;\n background: #f8fafc;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n overflow: hidden;\n}\n.ttp-product-image-sm img {\n max-width: 36px;\n max-height: 36px;\n object-fit: contain;\n}\n\n.ttp-product-compact .ttp-product-info {\n flex: 1;\n min-width: 0;\n}\n.ttp-product-compact .ttp-product-name {\n min-height: auto;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ttp-product-compact .ttp-product-action {\n text-align: right;\n flex-shrink: 0;\n}\n.ttp-product-compact .ttp-product-price {\n font-size: 13px;\n}\n\n.ttp-out-of-stock {\n font-size: 10px;\n color: #ef4444;\n font-weight: 500;\n}\n\n/* ═══════════════════════════════════════\n ADD BUTTON\n ═══════════════════════════════════════ */\n\n.ttp-add-btn {\n padding: 4px 14px;\n border-radius: 8px;\n border: none;\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n background: #3b82f6;\n color: #fff;\n transition: all 0.15s;\n}\n.ttp-add-btn:hover { background: #2563eb; }\n.ttp-add-btn:active { transform: scale(0.95); }\n.ttp-add-btn.ttp-added { background: #10b981 !important; }\n.ttp-add-btn:disabled { cursor: default; }\n.ttp-add-btn.ttp-update-btn { background: #f59e0b; }\n.ttp-add-btn.ttp-update-btn:hover { background: #d97706; }\n\n/* ═══════════════════════════════════════\n CART TOAST\n ═══════════════════════════════════════ */\n\n.ttp-cart-toast {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 10px 14px;\n margin: 0 12px;\n background: #f0fdf4;\n border-radius: 12px;\n border: 1px solid #bbf7d0;\n animation: ttpToastIn 0.25s ease;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n z-index: 10;\n box-shadow: 0 4px 12px rgba(0,0,0,0.1);\n}\n\n@keyframes ttpToastIn {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n}\n.ttp-cart-toast.ttp-toast-hiding {\n animation: ttpSlideDown 0.3s ease forwards;\n}\n\n@keyframes ttpSlideDown {\n to { opacity: 0; transform: translateY(-8px); height: 0; padding: 0; margin: 0; overflow: hidden; }\n}\n\n.ttp-toast-icon {\n width: 24px; height: 24px;\n border-radius: 50%;\n background: #10b981;\n color: #fff;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 12px;\n font-weight: 700;\n flex-shrink: 0;\n}\n\n.ttp-toast-content { flex: 1; min-width: 0; }\n.ttp-toast-title { font-size: 12px; font-weight: 600; color: #166534; }\n.ttp-toast-product {\n font-size: 11px;\n color: #15803d;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ttp-toast-undo {\n background: none;\n border: 1px solid #86efac;\n border-radius: 6px;\n padding: 3px 8px;\n font-size: 10px;\n color: #15803d;\n cursor: pointer;\n font-weight: 600;\n flex-shrink: 0;\n}\n.ttp-toast-undo:hover { background: #dcfce7; }\n\n/* ═══════════════════════════════════════\n CART SUMMARY BAR\n ═══════════════════════════════════════ */\n\n.ttp-cart-summary {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 8px 14px;\n margin: 4px 12px 8px;\n background: #f8fafc;\n border-radius: 10px;\n border: 1px solid #e2e8f0;\n}\n\n.ttp-cart-info {\n display: flex;\n align-items: center;\n gap: 6px;\n}\n.ttp-cart-icon { font-size: 14px; }\n.ttp-cart-count { font-size: 12px; font-weight: 600; color: #475569; }\n.ttp-cart-total { font-size: 14px; font-weight: 700; color: #1e293b; }\n\n/* ═══════════════════════════════════════\n QUANTITY/WEIGHT STEPPER\n ═══════════════════════════════════════ */\n\n.ttp-stepper {\n display: flex;\n align-items: center;\n gap: 2px;\n margin: 4px 0;\n}\n\n.ttp-stepper-btn {\n width: 24px;\n height: 24px;\n border-radius: 6px;\n border: 1px solid #e2e8f0;\n background: #f8fafc;\n color: #475569;\n font-size: 14px;\n font-weight: 600;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n line-height: 1;\n transition: all 0.15s;\n flex-shrink: 0;\n}\n\n.ttp-stepper-btn:hover:not(:disabled) {\n background: #e2e8f0;\n border-color: #cbd5e1;\n}\n\n.ttp-stepper-btn:active:not(:disabled) {\n transform: scale(0.9);\n}\n\n.ttp-stepper-btn:disabled,\n.ttp-stepper-disabled {\n opacity: 0.35;\n cursor: default;\n}\n\n.ttp-stepper-value {\n font-size: 12px;\n font-weight: 600;\n color: #1e293b;\n min-width: 36px;\n text-align: center;\n user-select: none;\n}\n\n.ttp-product-compact .ttp-stepper {\n justify-content: flex-end;\n}\n\n.ttp-product-compact .ttp-product-action {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 2px;\n}\n\n.ttp-product-card .ttp-stepper {\n justify-content: center;\n margin: 4px 0;\n}\n\n.ttp-product-card .ttp-product-footer {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 4px;\n}\n\n ",t=this.shadowRoot.querySelector("style");if(t)t.textContent+="\n"+e;else{var A=document.createElement("style");A.textContent=e,this.shadowRoot.appendChild(A)}}}},{key:"attachToDOM",value:function(){if(!this.isAttached&&this.shadowRoot)if(this.voiceActiveState=this.shadowRoot.getElementById("voiceActiveState"),this.voiceActiveState){var e=this.voiceActiveState;if(this.shadowRoot.getElementById("ttpEcommerceArea"))this.isAttached=!0;else{var t=e.querySelector(".desktop-voice-section"),A=e.querySelector(".compact-voice-section")||t;A&&A.nextSibling?e.insertBefore(this.container,A.nextSibling):e.appendChild(this.container),this.isAttached=!0}}else console.warn("[EcommerceManager] #voiceActiveState not found — will retry on next message")}},{key:"_ensureReady",value:function(){this.isAttached||(this.injectStyles(),this.attachToDOM())}},{key:"handleShowProducts",value:function(e){this._ensureReady();var t=e.products,A=e.title,n=e.layout;if(t&&0!==t.length){this._switchToCompactMode(),this._expandPanel(),this._setContainerMode("products"),this.productPicker.hide();var o=n||(t.length<=4?"cards":"list"),r=this.productPicker.show(t,A,o);this.container.insertBefore(r,this.container.firstChild)}else console.warn("[EcommerceManager] show_products with no products")}},{key:"handleCartUpdated",value:function(e){this._ensureReady();var t=e.product,A=e.action,n=e.cartTotal,o=e.cartItemCount;if("added"===A&&t){var r=this.cartToast.show(t,A);this.container.insertBefore(r,this.container.firstChild)}void 0!==n&&void 0!==o&&this.cartSummary.update(o,n)}},{key:"handleMessage",value:function(e){var t=e.t||e.type;"show_products"===t?this.handleShowProducts(e):"cart_updated"===t&&this.handleCartUpdated(e)}},{key:"_setContainerMode",value:function(e){"products"===e?(this.container.style.flex="1 1 0",this.container.style.minHeight="0",this.container.style.overflowY="auto",this.voiceActiveState&&this.voiceActiveState.classList.add("ttp-products-visible")):(this.container.style.flex="0 0 auto",this.container.style.minHeight="",this.container.style.overflowY="",this.voiceActiveState&&this.voiceActiveState.classList.remove("ttp-products-visible")),this.cartSummary.element&&(this.cartSummary.element.style.display="summary"===e&&this.cartSummary.itemCount>0?"flex":"none")}},{key:"_expandPanel",value:function(){if(this.shadowRoot){var e=this.shadowRoot.getElementById("text-chat-panel");e&&e.classList.add("ttp-panel-expanded")}}},{key:"_shrinkPanel",value:function(){if(this.shadowRoot){var e=this.shadowRoot.getElementById("text-chat-panel");e&&(e.classList.remove("ttp-panel-expanded"),e.style.height="")}}},{key:"_switchToCompactMode",value:function(){if(this.shadowRoot){var e=this.shadowRoot.getElementById("desktopVoiceSection"),t=this.shadowRoot.getElementById("compactVoiceSection");e&&(e.style.display="none"),t&&(t.style.display="flex")}}},{key:"_restoreFullVoiceMode",value:function(){if(this.shadowRoot){var e=this.shadowRoot.getElementById("desktopVoiceSection"),t=this.shadowRoot.getElementById("compactVoiceSection");e&&t&&(e.style.display="",t.style.display="none")}}},{key:"_handlePickerClose",value:function(){this.productPicker.hide(),this._shrinkPanel(),this._restoreFullVoiceMode(),this._setContainerMode("summary")}},{key:"_handleAdd",value:function(e){var t=this,A=e.price||0,n=e.selectedAmount||1;this.cartSummary.update(this.cartSummary.itemCount+1,this.cartSummary.total+A*n);var o=this.cartToast.show(e,"added");this.container.insertBefore(o,this.container.firstChild),setTimeout(function(){t.productPicker.hide(),t._shrinkPanel(),t._restoreFullVoiceMode(),t._setContainerMode("summary")},500),this.onProductSelected(e)}},{key:"_handleUndo",value:function(e){this.onProductDeselected(e)}},{key:"destroy",value:function(){this.productPicker.hide(),this.cartToast.hide(),this._shrinkPanel(),this._restoreFullVoiceMode(),this.voiceActiveState&&this.voiceActiveState.classList.remove("ttp-products-visible"),this.container&&this.container.parentNode&&this.container.parentNode.removeChild(this.container),this.isAttached=!1}}])&&Go(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function Xo(e){return Xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xo(e)}function Jo(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),A.push.apply(A,n)}return A}function Yo(e){for(var t=1;t<arguments.length;t++){var A=null!=arguments[t]?arguments[t]:{};t%2?Jo(Object(A),!0).forEach(function(t){qo(e,t,A[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(A)):Jo(Object(A)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(A,t))})}return e}function qo(e,t,A){return(t=nr(t))in e?Object.defineProperty(e,t,{value:A,enumerable:!0,configurable:!0,writable:!0}):e[t]=A,e}function Zo(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return $o(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):($o(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,$o(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,$o(u,"constructor",c),$o(c,"constructor",s),s.displayName="GeneratorFunction",$o(c,o,"GeneratorFunction"),$o(u),$o(u,o,"Generator"),$o(u,n,function(){return this}),$o(u,"toString",function(){return"[object Generator]"}),(Zo=function(){return{w:r,m:d}})()}function $o(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}$o=function(e,t,A,n){function r(t,A){$o(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},$o(e,t,A,n)}function er(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function tr(e){return function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){er(r,n,o,i,a,"next",e)}function a(e){er(r,n,o,i,a,"throw",e)}i(void 0)})}}function Ar(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,nr(n.key),n)}}function nr(e){var t=function(e){if("object"!=Xo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=Xo(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Xo(t)?t:t+""}var or=function(){return e=function e(){var t=this,A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.partnerConfig=A.partner||{},this.cartConfig=A.cart||{},this.widget=new xo(A),this.ecommerce=new zo({shadowRoot:this.widget.shadowRoot,onProductSelected:function(e){return t._handleProductSelected(e)},onProductDeselected:function(e){return t._handleProductDeselected(e)}}),this._hookIntoVoicePipeline(),this._hookCallEnd(),this._registerEcommerceTools(),this._exposeTestAPI()},t=[{key:"_hookIntoVoicePipeline",value:function(){var e,t=null===(e=this.widget.voiceInterface)||void 0===e?void 0:e.sdk;if(t){var A=this,n=t.connect.bind(t);t.connect=function(){var e=tr(Zo().m(function e(t){return Zo().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,n(t);case 1:this.voiceSDK&&(this.voiceSDK.on("message",function(e){var t=e.t||e.type;"show_products"===t?A.ecommerce.handleShowProducts(e):"cart_updated"===t&&A._handleCartUpdatedFromServer(e)}),console.log("[TTPEcommerceWidget] E-commerce message listener attached"));case 2:return e.a(2)}},e,this)}));return function(t){return e.apply(this,arguments)}}()}else console.warn("[TTPEcommerceWidget] AgentSDK not available yet")}},{key:"_hookCallEnd",value:function(){var e=this.widget.voiceInterface;if(e){var t=e.config.onCallEnd,A=this.ecommerce;e.config.onCallEnd=function(){A.productPicker.hide(),A._setContainerMode("summary"),A._shrinkPanel(),A._restoreFullVoiceMode(),t&&t()}}}},{key:"_registerEcommerceTools",value:function(){var e=this;this.cartConfig.addToCartFn&&this.widget.registerToolHandler("addToCart",function(){var t=tr(Zo().m(function t(A){var n,o;return Zo().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,e.cartConfig.addToCartFn(A.productId,A.quantity||1);case 1:return n=t.v,t.a(2,Yo({success:!0,productName:A.productName},n));case 2:return t.p=2,o=t.v,t.a(2,{success:!1,error:o.message})}},t,null,[[0,2]])}));return function(e){return t.apply(this,arguments)}}()),this.cartConfig.getCartFn&&this.widget.registerToolHandler("getCart",tr(Zo().m(function t(){var A;return Zo().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,e.cartConfig.getCartFn();case 1:return t.a(2,t.v);case 2:return t.p=2,A=t.v,t.a(2,{items:[],total:0,count:0,error:A.message})}},t,null,[[0,2]])})))}},{key:"_handleProductSelected",value:function(e){var t=e.selectedAmount||1;this._sendToVoiceSDK({t:"product_selected",productId:e.id,productName:e.name,price:e.price,quantity:t,sellBy:e.sellBy||"quantity"})}},{key:"_handleProductDeselected",value:function(e){this._sendToVoiceSDK({t:"product_deselected",productId:e.id,productName:e.name})}},{key:"_handleCartUpdatedFromServer",value:function(e){this.ecommerce.handleCartUpdated(e)}},{key:"_sendToVoiceSDK",value:function(e){try{var t,A=null===(t=this.widget.voiceInterface)||void 0===t||null===(t=t.sdk)||void 0===t?void 0:t.voiceSDK;A&&A.sendMessage&&A.sendMessage(e)}catch(e){console.warn("[TTPEcommerceWidget] Could not send to VoiceSDK:",e)}}},{key:"_exposeTestAPI",value:function(){var e,t=this;window.__TTP_ECOMMERCE__={handleMessage:function(e){t.ecommerce.handleMessage(e)},showProducts:(e=tr(Zo().m(function e(A){var n,o,r,i,a,s,c=arguments;return Zo().w(function(e){for(;;)switch(e.p=e.n){case 0:return n=c.length>1&&void 0!==c[1]?c[1]:5,o=c.length>2&&void 0!==c[2]?c[2]:"test",r=window.__TTP_MOCK_API__||"https://backend.talktopc.com",e.p=1,e.n=2,fetch("".concat(r,"/api/partner/mock-store/products/search?q=").concat(encodeURIComponent(A),"&limit=").concat(n,"&sessionId=").concat(encodeURIComponent(o)));case 2:return i=e.v,e.n=3,i.json();case 3:a=e.v,t.ecommerce.handleShowProducts({t:"show_products",products:a.products,title:"".concat(a.totalCount,' results for "').concat(A,'"'),layout:a.products.length<=4?"cards":"list"}),e.n=5;break;case 4:e.p=4,s=e.v,console.error("[TTPEcommerceWidget] showProducts failed:",s);case 5:return e.a(2)}},e,null,[[1,4]])})),function(t){return e.apply(this,arguments)}),getCart:function(){return{total:t.ecommerce.cartSummary.total,count:t.ecommerce.cartSummary.itemCount}},clearCart:function(){t.ecommerce.cartSummary.update(0,0)}}}},{key:"open",value:function(){this.widget.open()}},{key:"togglePanel",value:function(){this.widget.togglePanel()}},{key:"updateConfig",value:function(e){this.widget.updateConfig(e)}},{key:"destroy",value:function(){delete window.__TTP_ECOMMERCE__,this.ecommerce.destroy(),this.widget.destroy()}},{key:"startVoiceCall",value:function(){return this.widget.startVoiceCall()}},{key:"endVoiceCall",value:function(){this.widget.endVoiceCall()}},{key:"toggleMute",value:function(){this.widget.toggleMute()}},{key:"toggleSpeaker",value:function(){this.widget.toggleSpeaker()}},{key:"registerToolHandler",value:function(e,t){return this.widget.registerToolHandler(e,t)}},{key:"unregisterToolHandler",value:function(e){return this.widget.unregisterToolHandler(e)}},{key:"hasToolHandler",value:function(e){return this.widget.hasToolHandler(e)}},{key:"getRegisteredTools",value:function(){return this.widget.getRegisteredTools()}},{key:"injectData",value:function(e,t){return this.widget.injectData(e,t)}}],t&&Ar(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function rr(){var e,t,A="function"==typeof Symbol?Symbol:{},n=A.iterator||"@@iterator",o=A.toStringTag||"@@toStringTag";function r(A,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return ir(c,"_invoke",function(A,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,A){return r=t,a=0,s=e,d.n=A,i}};function p(A,n){for(a=A,s=n,t=0;!u&&c&&!o&&t<l.length;t++){var o,r=l[t],p=d.p,h=r[2];A>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=e):r[0]<=p&&((o=A<2&&p<r[1])?(a=0,d.v=n,d.n=r[1]):p<h&&(o=A<3||r[0]>n||n>h)&&(r[4]=A,r[5]=n,d.n=h,a=0))}if(o||A>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&p(l,h),a=l,s=h;(t=a<2?e:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),p(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),t=r[o]){if(!(t=t.call(r,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=r.return)&&t.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=e}else if((t=(u=d.n<0)?s:A.call(n,d))!==i)break}catch(t){r=e,a=1,s=t}finally{c=1}}return{value:t,done:u}}}(A,o,r),!0),c}var i={};function a(){}function s(){}function c(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(ir(t={},n,function(){return this}),t),u=c.prototype=a.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,ir(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=c,ir(u,"constructor",c),ir(c,"constructor",s),s.displayName="GeneratorFunction",ir(c,o,"GeneratorFunction"),ir(u),ir(u,o,"Generator"),ir(u,n,function(){return this}),ir(u,"toString",function(){return"[object Generator]"}),(rr=function(){return{w:r,m:d}})()}function ir(e,t,A,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ir=function(e,t,A,n){function r(t,A){ir(e,t,function(e){return this._invoke(t,A,e)})}t?o?o(e,t,{value:A,enumerable:!n,configurable:!n,writable:!n}):e[t]=A:(r("next",0),r("throw",1),r("return",2))},ir(e,t,A,n)}function ar(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var A=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=A){var n,o,r,i,a=[],s=!0,c=!1;try{if(r=(A=A.call(e)).next,0===t){if(Object(A)!==A)return;s=!1}else for(;!(s=(n=r.call(A)).done)&&(a.push(n.value),a.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=A.return&&(i=A.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}(e,t)||cr(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sr(e,t){var A="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!A){if(Array.isArray(e)||(A=cr(e))||t&&e&&"number"==typeof e.length){A&&(e=A);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){A=A.call(e)},n:function(){var e=A.next();return i=e.done,e},e:function(e){a=!0,r=e},f:function(){try{i||null==A.return||A.return()}finally{if(a)throw r}}}}function cr(e,t){if(e){if("string"==typeof e)return lr(e,t);var A={}.toString.call(e).slice(8,-1);return"Object"===A&&e.constructor&&(A=e.constructor.name),"Map"===A||"Set"===A?Array.from(e):"Arguments"===A||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A)?lr(e,t):void 0}}function lr(e,t){(null==t||t>e.length)&&(t=e.length);for(var A=0,n=Array(t);A<t;A++)n[A]=e[A];return n}function ur(e){return ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ur(e)}function dr(e,t,A,n,o,r,i){try{var a=e[r](i),s=a.value}catch(e){return void A(e)}a.done?t(s):Promise.resolve(s).then(n,o)}function pr(e){return function(){var t=this,A=arguments;return new Promise(function(n,o){var r=e.apply(t,A);function i(e){dr(r,n,o,i,a,"next",e)}function a(e){dr(r,n,o,i,a,"throw",e)}i(void 0)})}}function hr(e,t){for(var A=0;A<t.length;A++){var n=t[A];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,gr(n.key),n)}}function gr(e){var t=function(e){if("object"!=ur(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var A=t.call(e,"string");if("object"!=ur(A))return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ur(t)?t:t+""}var fr=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),console.log("🚀 AgentSDK v2.1.8 initialized with config:",t),this.config=t,this.voiceSDK=null,this.isConnected=!1,this.isListening=!1,this.wasListening=!1,this._resumeInfo=null,this.onConnected=function(){},this.onDisconnected=function(){},this.onError=function(e){return console.error("SDK Error:",e)},this.onTranscript=function(e){},this.onAgentSpeaking=function(e){},this.onConversationStart=t.onConversationStart||function(){},this.onConversationEnd=t.onConversationEnd||function(){},this.onBargeIn=t.onBargeIn||function(){},this.onAudioStartPlaying=t.onAudioStartPlaying||function(){},this.onAudioStoppedPlaying=t.onAudioStoppedPlaying||function(){},this.onSubtitleDisplay=t.onSubtitleDisplay||function(){}},t=[{key:"checkResumeBeforeConnect",value:function(){if(void 0!==this._resumeChecked)return this._resumeInfo;try{var e,t=this.config.visualAssistant||(null===(e=this.config.agentSettingsOverride)||void 0===e?void 0:e.visualAssistant),A=new oA({signedUrl:"wss://placeholder",autoReconnect:!1,agentId:this.config.agentId,appId:this.config.appId,language:this.config.language||"en",visualAssistant:t,protocolVersion:2}).checkAndResume();return this._resumeChecked=!0,A?(console.log("🔄 [AGENT SDK] Found resume state before connect:",A),this._resumeInfo=A,A):(this._resumeInfo=null,null)}catch(e){return console.warn("⚠️ [AGENT SDK] Error checking resume:",e),this._resumeChecked=!0,this._resumeInfo=null,null}}},{key:"connect",value:(n=pr(rr().m(function e(t){var A,n,o,r,i,a,s,c,l=this;return rr().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,t){e.n=1;break}throw new Error("signedUrl is required");case 1:if(this.voiceSDK&&(console.log("🔌 AgentSDK: Cleaning up existing connection"),this.voiceSDK.destroy(),this.voiceSDK=null),n=this.config.visualAssistant||(null===(A=this.config.agentSettingsOverride)||void 0===A?void 0:A.visualAssistant),this.voiceSDK=new oA({signedUrl:t,autoReconnect:!1,agentId:this.config.agentId,appId:this.config.appId,language:this.config.language||"en",agentSettingsOverride:this.config.agentSettingsOverride,visualAssistant:n,protocolVersion:2,outputContainer:this.config.outputContainer||"raw",outputEncoding:this.config.outputEncoding||"pcm",outputSampleRate:this.config.outputSampleRate||44100,outputChannels:this.config.outputChannels||1,outputBitDepth:this.config.outputBitDepth||16}),this._resumeInfo&&(console.log("🔄 [AGENT SDK] Using stored resume info:",this._resumeInfo),console.log(" From:",this._resumeInfo.fromPage,"→ To:",this._resumeInfo.toPage)),this.voiceSDK.on("connected",function(){l.isConnected=!0,l.onConnected()}),setTimeout(function(){l.voiceSDK&&l.voiceSDK.isConnected&&!l.isConnected&&(l.isConnected=!0,l.onConnected())},10),this.voiceSDK.on("disconnected",function(e){if(l.isConnected=!1,e&&1008===e.code&&e.reason&&(e.reason.includes("Domain not whitelisted")||e.reason.includes("domain")||e.reason.includes("whitelist"))){var t=new Error("DOMAIN_NOT_WHITELISTED");t.reason=e.reason,t.code=e.code,l.onError(t)}if((l.isListening||l.wasListening)&&(console.log("🎤 [AGENT SDK] disconnected event - calling onConversationEnd hook (isListening:",l.isListening,", wasListening:",l.wasListening,")"),l.onConversationEnd&&"function"==typeof l.onConversationEnd))try{l.onConversationEnd(),console.log("🎤 [AGENT SDK] ✅ onConversationEnd hook called from disconnected event"),l.wasListening=!1}catch(e){console.error("🎤 [AGENT SDK] ❌ Error calling onConversationEnd from disconnected:",e)}l.onDisconnected()}),this.voiceSDK.on("domainError",function(e){l.onError(e)}),this.voiceSDK.on("error",function(e){l.onError(e)}),this.voiceSDK.on("message",function(e){l.handleWebSocketMessage(e)}),this.voiceSDK.on("recordingStarted",function(){if(l.isListening=!0,l.wasListening=!0,l.onConversationStart&&"function"==typeof l.onConversationStart)try{l.onConversationStart()}catch(e){console.error("🎤 [AGENT SDK] ❌ Error calling onConversationStart:",e)}}),this.voiceSDK.on("recordingStopped",function(){console.log("🎤 [AGENT SDK] recordingStopped event received");var e=l.isListening;if(l.isListening=!1,e&&l.onConversationEnd&&"function"==typeof l.onConversationEnd)try{console.log("🎤 [AGENT SDK] ✅ Calling onConversationEnd hook from recordingStopped"),l.onConversationEnd(),console.log("🎤 [AGENT SDK] ✅ onConversationEnd hook called successfully"),l.wasListening=!1}catch(e){console.error("🎤 [AGENT SDK] ❌ Error calling onConversationEnd:",e)}}),this.voiceSDK.on("playbackStarted",function(){l.onAgentSpeaking(!0),l.onAudioStartPlaying(),l.onPlaybackStarted&&"function"==typeof l.onPlaybackStarted&&l.onPlaybackStarted()}),this.voiceSDK.on("playbackStopped",function(){l.onAgentSpeaking(!1),l.onAudioStoppedPlaying()}),this.voiceSDK.on("bargeIn",function(e){l.onBargeIn(e)}),this.voiceSDK.on("transcriptDisplay",function(e){console.log("📝 [AGENT SDK] transcriptDisplay event received:",e),e&&e.text&&(console.log("📝 [AGENT SDK] Calling onTranscript with text:",e.text),l.onTranscript&&"function"==typeof l.onTranscript?l.onTranscript(e.text):console.warn("📝 [AGENT SDK] ⚠️ onTranscript is not a function!",ur(l.onTranscript))),l.onSubtitleDisplay(e)}),this._pendingToolHandlers&&this._pendingToolHandlers.size>0){console.log("🔧 AgentSDK: Registering ".concat(this._pendingToolHandlers.size," pending tool handlers")),o=sr(this._pendingToolHandlers);try{for(o.s();!(r=o.n()).done;)i=ar(r.value,2),a=i[0],s=i[1],this.voiceSDK.registerToolHandler(a,s)}catch(e){o.e(e)}finally{o.f()}}return e.n=2,this.voiceSDK.connect();case 2:e.n=4;break;case 3:throw e.p=3,c=e.v,this.onError(c),c;case 4:return e.a(2)}},e,this,[[0,3]])})),function(e){return n.apply(this,arguments)})},{key:"handleWebSocketMessage",value:function(e){switch(e.t||e.type){case"connected":case"hello_ack":console.log("Session started successfully");break;case"user_transcript":this.onTranscript(e.user_transcription||e.text||e.transcript);break;case"agent_response":case"barge_in":case"stop_playing":default:break;case"error":this.onError(new Error(e.message||e.error||"Unknown error"))}}},{key:"startListening",value:(A=pr(rr().m(function e(){var t;return rr().w(function(e){for(;;)switch(e.p=e.n){case 0:if(console.log("🎤 AgentSDK: startListening() called"),!this.voiceSDK){e.n=6;break}return e.p=1,console.log("🎤 AgentSDK: Starting recording..."),e.n=2,this.voiceSDK.startRecording();case 2:e.v&&console.log("✅ AgentSDK: Recording started successfully"),e.n=5;break;case 3:if(e.p=3,!(t=e.v).isServerRejection&&"ServerRejected"!==t.name){e.n=4;break}throw t;case 4:throw console.error("❌ AgentSDK: Failed to start recording:",t),t;case 5:e.n=7;break;case 6:throw console.error("❌ AgentSDK: No voiceSDK instance available"),new Error("No voiceSDK instance available");case 7:return e.a(2)}},e,this,[[1,3]])})),function(){return A.apply(this,arguments)})},{key:"stopListening",value:function(){this.voiceSDK&&this.voiceSDK.stopRecording()}},{key:"hangup",value:function(){this.voiceSDK&&this.voiceSDK.hangup()}},{key:"updateVariables",value:function(e){this.voiceSDK&&this.isConnected&&this.voiceSDK.sendMessage({t:"update_variables",variables:e})}},{key:"disconnect",value:function(){this.voiceSDK&&(this.voiceSDK.destroy(),this.voiceSDK=null),this.isConnected=!1,this.isListening=!1}},{key:"registerToolHandler",value:function(e,t){if(this.voiceSDK)return this.voiceSDK.registerToolHandler(e,t);this._pendingToolHandlers||(this._pendingToolHandlers=new Map),this._pendingToolHandlers.set(e,t),console.log("🔧 AgentSDK: Queued tool handler '".concat(e,"' for registration after connect"))}},{key:"unregisterToolHandler",value:function(e){if(this.voiceSDK)return this.voiceSDK.unregisterToolHandler(e);this._pendingToolHandlers&&this._pendingToolHandlers.delete(e)}},{key:"hasToolHandler",value:function(e){var t;return this.voiceSDK?this.voiceSDK.hasToolHandler(e):(null===(t=this._pendingToolHandlers)||void 0===t?void 0:t.has(e))||!1}},{key:"getRegisteredTools",value:function(){return this.voiceSDK?this.voiceSDK.getRegisteredTools():this._pendingToolHandlers?Array.from(this._pendingToolHandlers.keys()):[]}}],t&&hr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,A,n}(),mr="3.0.0";const vr={VoiceSDK_v2:oA,TextChatSDK:mA,WebSocketManager:_A,AudioRecorder:q,AudioPlayer:ZA,EventEmitter:O,AgentSDK:fr,TTPChatWidget:xo,TTPEcommerceWidget:or,VERSION:mr}})(),n})());
|
|
3
3
|
//# sourceMappingURL=agent-widget.js.map
|